diff --git a/.hgignore b/.hgignore index 0092bd4ff5a..2d339f9988c 100644 --- a/.hgignore +++ b/.hgignore @@ -1,3 +1,4 @@ ^build/ ^dist/ /nbproject/private/ +^webrev diff --git a/.hgtags b/.hgtags index c3213062fb5..966c17a5710 100644 --- a/.hgtags +++ b/.hgtags @@ -88,3 +88,15 @@ a6442d6bc38a44152e0662688213ce4d2701f42a jdk7-b110 69f3edf083477955b5bd2f754252c7504167d8e1 jdk7-b111 f960f117f1623629f64203e2b09a92a8f6f14ff5 jdk7-b112 1fee41c7ed2b3388970a756a85aa693c0de8407a jdk7-b113 +750c1ccb2f2d1ddfa95ab6c7f897fdab2f87f7e9 jdk7-b114 +9cb24917216bc68997154f6e9566c3de62acb2f4 jdk7-b115 +a4e6aa1f45ad23a6f083ed98d970b5006ea4d292 jdk7-b116 +228e73f288c543a8c34e2a54227103ae5649e6af jdk7-b117 +2e876e59938a853934aa738c811b26c452bd9fe8 jdk7-b118 +4951967a61b4dbbf514828879f57bd1a0d4b420b jdk7-b119 +8c840d3ab24f8d0f422b991638acb44b6ab1d98c jdk7-b120 +0ce0a2c3a6926677dc507839a820ab6625541e5a jdk7-b121 +6f09ea1c034f087916d2a8cf0d22be768400118f jdk7-b122 +142129d8599d1f56b29387e7f9a5fad53b6d61df jdk7-b123 +aa894c225b1a517b665ac2a58295217ea2245134 jdk7-b124 +f658ec2730fa29323c36d23c27e54c7219ef5e16 jdk7-b125 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 91c72f80940..5bdac4ada74 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -88,3 +88,15 @@ f8be576feefce0c6695f188ef97ec16b73ad9cfd jdk7-b104 9702d6fef68e17533ee7fcf5923b11ead3e912ce jdk7-b111 b852103caf73da70068473777ae867a457bb3ae1 jdk7-b112 c1df968c4527bfab5f97662a89245f15d12d378b jdk7-b113 +27985a5c6e5268014d25d55886e0ecb96af4763d jdk7-b114 +e8ebdf41b9c01a26642848f4134f5504e8fb3233 jdk7-b115 +94e9a1bfba8b8d1fe0bfd43b88629b1f27b02a76 jdk7-b116 +7220e60b097fa027e922f1aeecdd330f3e37409f jdk7-b117 +a12a9e78df8a9d534da0b4a244ed68f0de0bd58e jdk7-b118 +661360bef6ccad6c119f067f5829b207de80c936 jdk7-b119 +366ff0b6d2151595629806b033e2e1497e3a55d4 jdk7-b120 +2c2d4f88637b488014c37e1a2eb401f68bca8838 jdk7-b121 +f1591eed71f64f6eba79fb7426f5616cc4dfea73 jdk7-b122 +ed6950da30cf1e8904b4bdb034d471647942271f jdk7-b123 +024a6755895bf91b5a3c98984c89ee018efbf538 jdk7-b124 +5c4df7e992775c102f08e9f1c0a124b324641b70 jdk7-b125 diff --git a/Makefile b/Makefile index d42650e58ce..7c5b2db01c0 100644 --- a/Makefile +++ b/Makefile @@ -156,12 +156,6 @@ ifeq ($(BUILD_DEPLOY), true) clobber:: deploy-clobber endif -ifeq ($(BUILD_JDK), true) - ifeq ($(BUNDLE_RULES_AVAILABLE), true) - generic_build_repo_series:: openjdk-binary-plugs-bundles - endif -endif - # The debug build, fastdebug or debug. Needs special handling. # Note that debug builds do NOT do INSTALL steps, but must be done # after the product build and before the INSTALL step of the product build. @@ -301,7 +295,6 @@ ifneq ($(SKIP_OPENJDK_BUILD), true) ifeq ($(BUILD_JDK), true) ifeq ($(BUNDLE_RULES_AVAILABLE), true) -OPENJDK_PLUGS=$(ABS_OUTPUTDIR)/$(OPENJDK_BINARY_PLUGS_INAME) OPENJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/open-output OPENJDK_BUILD_NAME \ = openjdk-$(JDK_MINOR_VERSION)-$(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE) @@ -330,7 +323,6 @@ openjdk_build: GENERATE_DOCS=false \ ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR) \ ALT_OUTPUTDIR=$(OPENJDK_OUTPUTDIR) \ - ALT_BINARY_PLUGS_PATH=$(OPENJDK_PLUGS) \ ALT_BOOTDIR=$(OPENJDK_BOOTDIR) \ ALT_JDK_IMPORT_PATH=$(OPENJDK_IMPORTJDK) \ product_build ) @@ -456,7 +448,6 @@ CACERTS_FILE.desc = Location of certificates file DEVTOOLS_PATH.desc = Directory containing zip and gnumake CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files DXSDK_PATH.desc = Root directory of DirectX SDK -MSDEVTOOLS_PATH.desc = Root directory of VC++ tools (e.g. rc.exe) MSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll # Make variables to print out (description and value) @@ -487,12 +478,10 @@ ifeq ($(PLATFORM), windows) VARIABLE_PRINTVAL_LIST += \ DXSDK_PATH \ - MSDEVTOOLS_PATH \ MSVCRT_DLL_PATH VARIABLE_CHECKDIR_LIST += \ DXSDK_PATH \ - MSDEVTOOLS_PATH \ MSVCRT_DLL_PATH endif @@ -548,7 +537,7 @@ examples_help: " ################################################################ -# Source and binary plug bundling +# Source bundling ################################################################ ifeq ($(BUNDLE_RULES_AVAILABLE), true) include $(BUNDLE_RULES) diff --git a/README b/README index 5dd05f46abe..722131d683f 100644 --- a/README +++ b/README @@ -1,31 +1,41 @@ README: - This file should be located at the top of the OpenJDK Mercurial repository - forest. This top or enclosing repository will include a "make" directory, - and a Makefile at the very top of the repository. - It should also include the 6 repositories: "jdk", "hotspot", "langtools", - "corba", "jaxws" and "jaxp". + This file should be located at the top of the OpenJDK Mercurial root + repository. This root repository will include a "make" directory, + and a Makefile for building the entire OpenJDK. + A full OpenJDK repository set (forest) should also include the following + 6 nested repositories: + "jdk", "hotspot", "langtools", "corba", "jaxws" and "jaxp". + There are also several source downloads for the jax* repositories that + will be needed. + + This one root repository can be obtained with something like: + hg clone http://hg.openjdk.java.net/jdk7/jdk7 openjdk7 + To make sure you have all the nested repositories, you can run: + cd openjdk7 && sh ./get_source.sh + (This is identical to using the Mercurial Forest Extension command + 'hg fclone http://hg.openjdk.java.net/jdk7/jdk7 openjdk7'). + People unfamiliar with Mercurial should read the first few chapters of + the Mercurial book: http://hgbook.red-bean.com/read/ See http://openjdk.java.net/ for more information about the OpenJDK. Simple Build Instructions: + + 0. Get the necessary system software/packages installed on your system, see + http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html - 1. Download and install a JDK 6 from + 1. If you don't have a jdk6 installed, download and install a JDK 6 from http://java.sun.com/javase/downloads/index.jsp - Set the environment variable ALT_BOOTDIR to the location of this JDK 6. + Set the environment variable ALT_BOOTDIR to the location of JDK 6. - 2. Download and install the Binary Plugs for the most recent JDK7 from - http://download.java.net/openjdk/jdk7/ - Set the environment variable ALT_BINARY_PLUGS_PATH to the location of - these binary plugs. - - 3. Check the sanity of doing a build with the current machine: + 2. Check the sanity of doing a build with your current system: gnumake sanity See README-builds.html if you run into problems. - 4. Do a complete build of the jdk: + 3. Do a complete build of the OpenJDK: gnumake all The resulting JDK image should be found in build/*/j2sdk-image -where gnumake is GNU make 3.78.1 or newer, /usr/bin/make on Linux and +where gnumake is GNU make 3.81 or newer, /usr/bin/make on Linux and /usr/sfw/bin/gmake or /opt/sfw/bin/gmake on Solaris. diff --git a/README-builds.html b/README-builds.html index 81ada58e303..e48aaff3612 100644 --- a/README-builds.html +++ b/README-builds.html @@ -24,12 +24,12 @@

Introduction

- This README file contains build instructions for the - OpenJDK. - Building the source code for the - OpenJDK - requires - a certain degree of technical expertise. + This README file contains build instructions for the + OpenJDK. + Building the source code for the + OpenJDK + requires + a certain degree of technical expertise.


@@ -37,18 +37,23 @@
+ + +
+

Use of Mercurial

+
+ The OpenJDK sources are maintained with the revision control system + Mercurial. + If you are new to Mercurial, please see the + Beginner Guides + or refer to the Mercurial Book. + The first few chapters of the book provide an excellent overview of + Mercurial, what it is and how it works. +
+ For using Mercurial with the OpenJDK refer to the + + Developer Guide: Installing and Configuring Mercurial + section for more information. + The Forest Extension is not part of the Mercurial install, + and is optional, + but can be obtained with the following commands: +
+ + hg clone https://bitbucket.org/pmezard/hgforest-crew/overview/ YourHgForest + +
+ Once you have the file forest.py, you need to add these + lines to your ${HOME}/.hgrc file: +
+ + [extensions] +
forest = YourHgForest/forest.py +
+
+ + +

Getting the Source

+
+ To get the entire set of OpenJDK Mercurial repositories + using the Forest Extension: +
+ + hg fclone http://openjdk.java.net/jdk7/jdk7 YourOpenJDK + +
+ To get the entire set of OpenJDK Mercurial repositories + without using the Forest Extension: +
+ + hg clone http://openjdk.java.net/jdk7/jdk7 YourOpenJDK +
cd YourOpenJDK +
sh ./get_source.sh +
+
+ Once you have all the repositories, the + script make/scripts/hgforest.sh + can be used to repeat the same hg + command on every repository in the forest, e.g. +
+ + cd YourOpenJDK +
sh ./make/scripts/hgforest.sh pull -u +
+
+ You may find this script make/scripts/hgforest.sh faster + than the hg forest commands provided by the + Forest Extension. +
+ +
+

Minimum Build Environments

@@ -116,8 +191,8 @@ specific platforms, and in fact creating these specific platforms may be difficult due to the age of some of this software.

- The minimum OS and C/C++ compiler versions needed for building the - OpenJDK: + The minimum OS and C/C++ compiler versions needed for building the + OpenJDK:

@@ -146,7 +221,7 @@ @@ -156,7 +231,7 @@ @@ -166,7 +241,7 @@ @@ -176,7 +251,7 @@ @@ -195,14 +270,14 @@
Solaris 10u2 + patches
See - SunSolve for patch downloads. + SunSolve for patch downloads.
Sun Studio 12 Update 1 + patches JDK 6u14 FCS Solaris 10u2 + patches
See - SunSolve for patch downloads. + SunSolve for patch downloads.
Sun Studio 12 Update 1 + patches JDK 6u14 FCS Solaris 10u2 + patches
See - SunSolve for patch downloads. + SunSolve for patch downloads.
Sun Studio 12 Update 1 + patches JDK 6u14 FCS Solaris 10u2 + patches
See - SunSolve for patch downloads. + SunSolve for patch downloads.
Sun Studio 12 Update 1 + patches JDK 6u14 FCS
-

+

These same sources do indeed build on many more systems than the above older generation systems, again the above is just a minimum. -

+

Compilation problems with newer or different C/C++ compilers is a common problem. Similarly, compilation problems related to changes to the - /usr/include or system header files is also a + /usr/include or system header files is also a common problem with newer or unreleased OS versions. Please report these types of problems as bugs so that they can be dealt with accordingly. @@ -217,57 +292,57 @@

Fedora

-

Fedora 9

-

-

- After installing Fedora 9 +

Fedora 9

+

+

+ After installing Fedora 9 you need to install several build dependencies. The simplest way to do it is to execute the following commands as user - root: -

- yum-builddep java-openjdk -

- yum install gcc gcc-c++ -

+ root: +

+ yum-builddep java-openjdk +

+ yum install gcc gcc-c++ +

In addition, it's necessary to set a few environment variables for the build: -

- export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk +

+ export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk

-

Fedora 10

-

-

- After installing Fedora 10 +

Fedora 10

+

+

+ After installing Fedora 10 you need to install several build dependencies. The simplest way to do it is to execute the following commands as user - root: -

- yum-builddep java-1.6.0-openjdk -

- yum install gcc gcc-c++ -

+ root: +

+ yum-builddep java-1.6.0-openjdk +

+ yum install gcc gcc-c++ +

In addition, it's necessary to set a few environment variables for the build: -

- export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk +

+ export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk

-

Fedora 11

-

-

- After installing Fedora 11 +

Fedora 11

+

+

+ After installing Fedora 11 you need to install several build dependencies. The simplest way to do it is to execute the following commands as user - root: -

- yum-builddep java-1.6.0-openjdk -

- yum install gcc gcc-c++ -

+ root: +

+ yum-builddep java-1.6.0-openjdk +

+ yum install gcc gcc-c++ +

In addition, it's necessary to set a few environment variables for the build: -

- export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk -

+

+ export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk +

CentOS 5.2

@@ -285,7 +360,7 @@

- Plus the following packages: + Plus the following packages:

- The freetype 2.3 packages don't seem to be available, - but the freetype 2.3 sources can be downloaded, built, - and installed easily enough from - - the freetype site. - Build and install with something like: + The freetype 2.3 packages don't seem to be available, + but the freetype 2.3 sources can be downloaded, built, + and installed easily enough from + + the freetype site. + Build and install with something like:

./configure && make && sudo -u root make install

- Mercurial packages could not be found easily, but a Google - search should find ones, and they usually include Python if - it's needed. + Mercurial packages could not be found easily, but a Google + search should find ones, and they usually include Python if + it's needed.

Debian

Debian 5.0 (Lenny)

-

+
After installing Debian 5 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands as user root: -

- aptitude build-dep openjdk-6 -

- aptitude install openjdk-6-jdk libmotif-dev -

+

+ aptitude build-dep openjdk-6 +

+ aptitude install openjdk-6-jdk libmotif-dev +

In addition, it's necessary to set a few environment variables for the build: -

- export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk -

+

+ export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk +

-

Ubuntu

+

Ubuntu

Ubuntu 8.04

-

+
After installing Ubuntu 8.04 you need to install several build dependencies. -

+

First, you need to enable the universe repository in the Software Sources application and reload the repository information. The Software Sources application is available under the System/Administration menu. -

+

The simplest way to install the build dependencies is to execute the following commands: -

- sudo aptitude build-dep openjdk-6 -

- sudo aptitude install openjdk-6-jdk -

+

+ sudo aptitude build-dep openjdk-6 +

+ sudo aptitude install openjdk-6-jdk +

In addition, it's necessary to set a few environment variables for the build: -

- export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk -

-

Ubuntu 8.10

+

+ export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk +

+

Ubuntu 8.10

-

+
After installing Ubuntu 8.10 you need to install several build dependencies. The simplest way to do it is to execute the following commands: -

- sudo aptitude build-dep openjdk-6 -

- sudo aptitude install openjdk-6-jdk -

+

+ sudo aptitude build-dep openjdk-6 +

+ sudo aptitude install openjdk-6-jdk +

In addition, it's necessary to set a few environment variables for the build: -

- export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk -

-

Ubuntu 9.04

+

+ export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk +

+

Ubuntu 9.04

-

+
After installing Ubuntu 9.04 you need to install several build dependencies. The simplest way to do it is to execute the following commands: -

- sudo aptitude build-dep openjdk-6 -

- sudo aptitude install openjdk-6-jdk -

+

+ sudo aptitude build-dep openjdk-6 +

+ sudo aptitude install openjdk-6-jdk +

In addition, it's necessary to set a few environment variables for the build: -

- export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk -

+

+ export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk +

OpenSUSE

OpenSUSE 11.1

-

+
After installing OpenSUSE 11.1 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands: -

- sudo zypper source-install -d java-1_6_0-openjdk -

- sudo zypper install make -

+

+ sudo zypper source-install -d java-1_6_0-openjdk +

+ sudo zypper install make +

In addition, it is necessary to set a few environment variables for the build: -

- export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk -

+

+ export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk +

Finally, you need to unset the JAVA_HOME environment variable: -

- export -n JAVA_HOME -

-
+

+ export -n JAVA_HOME +

+

Mandriva

Mandriva Linux One 2009 Spring

-

+
After installing Mandriva Linux One 2009 Spring you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands as user root: -

- urpmi java-1.6.0-openjdk-devel ant make gcc gcc-c++ freetype-devel zip unzip libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel libxtst6-devel libxi-devel +

+ urpmi java-1.6.0-openjdk-devel ant make gcc gcc-c++ freetype-devel zip unzip libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel libxtst6-devel libxi-devel

In addition, it is necessary to set a few environment variables for the build: -

- export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk -

+

+ export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk +

OpenSolaris

OpenSolaris 2009.06

-

+
After installing OpenSolaris 2009.06 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands: -

- pfexec pkg install SUNWgmake SUNWj6dev SUNWant sunstudioexpress SUNWcups SUNWzip SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2 +

+ pfexec pkg install SUNWgmake SUNWj6dev SUNWant sunstudioexpress SUNWcups SUNWzip SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2

In addition, it is necessary to set a few environment variables for the build: -

- export LANG=C ALT_COMPILER_PATH=/opt/SunStudioExpress/bin/ ALT_CUPS_HEADERS_PATH=/usr/include/ -

+

+ export LANG=C ALT_COMPILER_PATH=/opt/SunStudioExpress/bin/ ALT_CUPS_HEADERS_PATH=/usr/include/ +

Finally, you need to make sure that the build process can find the Sun Studio compilers: -

- export PATH=$PATH:/opt/SunStudioExpress/bin/ -

+

+ export PATH=$PATH:/opt/SunStudioExpress/bin/ +


Source Directory Structure

- The source code for the OpenJDK is delivered in a set of - directories: - hotspot, - langtools, - corba, - jaxws, - jaxp, - and - jdk. - The hotspot directory contains the source code and make - files for building the OpenJDK Hotspot Virtual Machine. - The langtools directory contains the source code and make - files for building the OpenJDK javac and language tools. - The corba directory contains the source code and make - files for building the OpenJDK Corba files. - The jaxws directory contains the source code and make - files for building the OpenJDK JAXWS files. - The jaxp directory contains the source code and make - files for building the OpenJDK JAXP files. - The jdk directory contains the source code and make files for - building the OpenJDK runtime libraries and misc files. - The top level Makefile - is used to build the entire OpenJDK. + The source code for the OpenJDK is delivered in a set of + directories: + hotspot, + langtools, + corba, + jaxws, + jaxp, + and + jdk. + The hotspot directory contains the source code and make + files for building the OpenJDK Hotspot Virtual Machine. + The langtools directory contains the source code and make + files for building the OpenJDK javac and language tools. + The corba directory contains the source code and make + files for building the OpenJDK Corba files. + The jaxws directory contains the source code and make + files for building the OpenJDK JAXWS files. + The jaxp directory contains the source code and make + files for building the OpenJDK JAXP files. + The jdk directory contains the source code and make files for + building the OpenJDK runtime libraries and misc files. + The top level Makefile + is used to build the entire OpenJDK.


@@ -495,10 +570,10 @@ ALT_* variables (alternates) can be used to help the makefiles locate components.

- Refer to the bash/sh/ksh setup file - jdk/make/jdk_generic_profile.sh - if you need help in setting up your environment variables. - A build could be as simple as: + Refer to the bash/sh/ksh setup file + jdk/make/jdk_generic_profile.sh + if you need help in setting up your environment variables. + A build could be as simple as:


                 bash
@@ -507,12 +582,12 @@
                 

- Of course ksh or sh would work too. - But some customization will probably be necessary. - The sanity rule will make some basic checks on build - dependencies and generate appropriate warning messages - regarding missing, out of date, or newer than expected components - found on your system. + Of course ksh or sh would work too. + But some customization will probably be necessary. + The sanity rule will make some basic checks on build + dependencies and generate appropriate warning messages + regarding missing, out of date, or newer than expected components + found on your system.


@@ -524,7 +599,7 @@ A few notes about using GNU make:

- Information on GNU make, and access to ftp download sites, are - available on the - - GNU make web site - . - The latest source to GNU make is available at - - ftp.gnu.org/pub/gnu/make/. + Information on GNU make, and access to ftp download sites, are + available on the + + GNU make web site + . + The latest source to GNU make is available at + + ftp.gnu.org/pub/gnu/make/.


@@ -597,27 +672,27 @@ is a Pentium class processor or better, at least 256 MB of RAM, and approximately 1.5 GB of free disk space.

- X64 only: - The minimum recommended hardware for building the Linux - version is an AMD Opteron class processor, at least 512 MB of RAM, and - approximately 4 GB of free disk space. + X64 only: + The minimum recommended hardware for building the Linux + version is an AMD Opteron class processor, at least 512 MB of RAM, and + approximately 4 GB of free disk space.

- The build will use the tools contained in - /bin and - /usr/bin - of a standard installation of the Linux operating environment. - You should ensure that these directories are in your - PATH. + The build will use the tools contained in + /bin and + /usr/bin + of a standard installation of the Linux operating environment. + You should ensure that these directories are in your + PATH.

- Note that some Linux systems have a habit of pre-populating - your environment variables for you, for example JAVA_HOME - might get pre-defined for you to refer to the JDK installed on - your Linux system. - You will need to unset JAVA_HOME. - It's a good idea to run env and verify the - environment variables you are getting from the default system - settings make sense for building the - OpenJDK. + Note that some Linux systems have a habit of pre-populating + your environment variables for you, for example JAVA_HOME + might get pre-defined for you to refer to the JDK installed on + your Linux system. + You will need to unset JAVA_HOME. + It's a good idea to run env and verify the + environment variables you are getting from the default system + settings make sense for building the + OpenJDK.

Basic Linux Check List

@@ -628,18 +703,13 @@ Bootstrap JDK, set ALT_BOOTDIR. -
  • - Install the - Binary Plugs, set - ALT_BINARY_PLUGS_PATH. -
  • Optional Import JDK, set ALT_JDK_IMPORT_PATH.
  • Install or upgrade the FreeType development - package. + package.
  • Install @@ -660,23 +730,23 @@ Approximately 1.4 GB of free disk space is needed for a 32-bit build.

    - If you are building the 64-bit version, you should - run the command "isainfo -v" to verify that you have a - 64-bit installation, it should say sparcv9 or - amd64. - An additional 7 GB of free disk space is needed - for a 64-bit build. + If you are building the 64-bit version, you should + run the command "isainfo -v" to verify that you have a + 64-bit installation, it should say sparcv9 or + amd64. + An additional 7 GB of free disk space is needed + for a 64-bit build.

    - The build uses the tools contained in /usr/ccs/bin - and /usr/bin of a standard developer or full installation of - the Solaris operating environment. + The build uses the tools contained in /usr/ccs/bin + and /usr/bin of a standard developer or full installation of + the Solaris operating environment.

    - Solaris patches specific to the JDK can be downloaded from the - - SunSolve JDK Solaris patches download page. - You should ensure that the latest patch cluster for - your version of the Solaris operating environment has also - been installed. + Solaris patches specific to the JDK can be downloaded from the + + SunSolve JDK Solaris patches download page. + You should ensure that the latest patch cluster for + your version of the Solaris operating environment has also + been installed.

    Basic Solaris Check List

    @@ -687,11 +757,6 @@ Bootstrap JDK, set ALT_BOOTDIR.
  • -
  • - Install the - Binary Plugs, set - ALT_BINARY_PLUGS_PATH. -
  • Optional Import JDK, set ALT_JDK_IMPORT_PATH. @@ -731,10 +796,10 @@ because FAT32 doesn't support case-sensitivity in file names.

    - X64 only: - The minimum recommended hardware for building - the Windows X64 version is an AMD Opteron class processor, at least 1 - GB of RAM, and approximately 10 GB of free disk space. + X64 only: + The minimum recommended hardware for building + the Windows X64 version is an AMD Opteron class processor, at least 1 + GB of RAM, and approximately 10 GB of free disk space.

    Windows Paths

    @@ -753,18 +818,18 @@ (called 'mixed'), e.g. cygpath -s -m "path".

    - The makefiles will try to translate any pathnames supplied - to it into the C:/ style automatically. + The makefiles will try to translate any pathnames supplied + to it into the C:/ style automatically.

    - Note that use of CYGWIN creates a unique problem with regards to - setting PATH. Normally on Windows - the PATH variable contains directories - separated with the ";" character (Solaris and Linux uses ":"). - With CYGWIN, it uses ":", but that means that paths like "C:/path" - cannot be placed in the CYGWIN version of PATH and - instead CYGWIN uses something like /cygdrive/c/path - which CYGWIN understands, but only CYGWIN understands. - So be careful with paths on Windows. + Note that use of CYGWIN creates a unique problem with regards to + setting PATH. Normally on Windows + the PATH variable contains directories + separated with the ";" character (Solaris and Linux uses ":"). + With CYGWIN, it uses ":", but that means that paths like "C:/path" + cannot be placed in the CYGWIN version of PATH and + instead CYGWIN uses something like /cygdrive/c/path + which CYGWIN understands, but only CYGWIN understands. + So be careful with paths on Windows.

    Basic Windows Check List

    @@ -779,11 +844,6 @@ Bootstrap JDK, set ALT_BOOTDIR.
  • -
  • - Install the - Binary Plugs, set - ALT_BINARY_PLUGS_PATH.. -
  • Optional Import JDK, set ALT_JDK_IMPORT_PATH. @@ -828,7 +888,7 @@ JDK 6, this is often called a bootstrap JDK. The JDK 6 binaries can be downloaded from Sun's JDK 6 download site. + target="_blank">JDK 6 download site. For build performance reasons is very important that this bootstrap JDK be made available on the local disk of the machine doing the build. @@ -841,44 +901,12 @@ in the PATH environment variable, although it's not required.

    - Solaris: - Some pre-installed JDK images may be available to you in the - directory /usr/jdk/instances. - If you don't set - ALT_BOOTDIR - the makefiles will look in that location for a JDK it can use. - - -

    Binary Plugs

    -
    - Not all of the source code that makes up the JDK is available - under an open-source license. - This is a temporary situation and these binary plugs will be - replaced with fully open source replacements as soon as possible. - So currently, in order to build a complete OpenJDK image, - you must first download and install the appropriate - binary plug bundles for the OpenJDK, go to the - OpenJDK site and select - the - "Bundles(7)" - link and download the binaryplugs for - your particular platform. - The file downloaded is a jar file that must be extracted by running - the jar file with: -
    -
    -            java -jar jdk-7-ea-plug-bnn-os-arch-dd_month_year.jar
    -                    
    -
    - A prompt will be issued for acceptance of these binary plug files. - During the OpenJDK build process these "binary plugs" - for the encumbered components will be copied into your - resulting OpenJDK binary build image. - These binary plug files are only for the purpose of - building an OpenJDK binary. - Make sure you set - ALT_BINARY_PLUGS_PATH - to the root of this installation. + Solaris: + Some pre-installed JDK images may be available to you in the + directory /usr/jdk/instances. + If you don't set + ALT_BOOTDIR + the makefiles will look in that location for a JDK it can use.

    Optional Import JDK

    @@ -896,7 +924,7 @@ All OpenJDK builds require access to least Ant 1.6.5. The Ant tool is available from the - Ant download site. + Ant download site. You should always make sure ant is in your PATH, and on Windows you may also need to set ANT_HOME @@ -908,7 +936,7 @@

    Certificate Authority File (cacert)

    See - http://en.wikipedia.org/wiki/Certificate_Authority + http://en.wikipedia.org/wiki/Certificate_Authority for a better understanding of the Certificate Authority (CA). A certificates file named "cacerts" represents a system-wide keystore with CA certificates. @@ -942,121 +970,121 @@
    At a minimum, the - Sun Studio 12 Update 1 Compilers + Sun Studio 12 Update 1 Compilers (containing version 5.10 of the C and C++ compilers) is required, including specific patches. -

    +

    The Solaris SPARC patch list is: -

      -
    • - 118683-05: SunOS 5.10: Patch for profiling libraries and assembler -
    • -
    • - 119963-21: SunOS 5.10: Shared library patch for C++ -
    • -
    • - 120753-08: SunOS 5.10: Microtasking libraries (libmtsk) patch -
    • -
    • - 128228-09: Sun Studio 12 Update 1: Patch for Sun C++ Compiler -
    • -
    • - 141860-03: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C C++ F77 F95 -
    • -
    • - 141861-05: Sun Studio 12 Update 1: Patch for Sun C Compiler -
    • -
    • - 142371-01: Sun Studio 12.1 Update 1: Patch for dbx -
    • -
    • - 143384-02: Sun Studio 12 Update 1: Patch for debuginfo handling -
    • -
    • - 143385-02: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C C++ F77 F95 -
    • -
    • - 142369-01: Sun Studio 12.1: Patch for Performance Analyzer Tools -
    • +
        +
      • + 118683-05: SunOS 5.10: Patch for profiling libraries and assembler +
      • +
      • + 119963-21: SunOS 5.10: Shared library patch for C++ +
      • +
      • + 120753-08: SunOS 5.10: Microtasking libraries (libmtsk) patch +
      • +
      • + 128228-09: Sun Studio 12 Update 1: Patch for Sun C++ Compiler +
      • +
      • + 141860-03: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C C++ F77 F95 +
      • +
      • + 141861-05: Sun Studio 12 Update 1: Patch for Sun C Compiler +
      • +
      • + 142371-01: Sun Studio 12.1 Update 1: Patch for dbx +
      • +
      • + 143384-02: Sun Studio 12 Update 1: Patch for debuginfo handling +
      • +
      • + 143385-02: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C C++ F77 F95 +
      • +
      • + 142369-01: Sun Studio 12.1: Patch for Performance Analyzer Tools +

      - The Solaris X86 patch list is: + The Solaris X86 patch list is:

        -
      • - 119961-07: SunOS 5.10_x86, x64, Patch for profiling libraries and assembler -
      • -
      • - 119964-21: SunOS 5.10_x86: Shared library patch for C++_x86 -
      • -
      • - 120754-08: SunOS 5.10_x86: Microtasking libraries (libmtsk) patch -
      • -
      • - 141858-06: Sun Studio 12 Update 1_x86: Sun Compiler Common patch for x86 backend -
      • -
      • - 128229-09: Sun Studio 12 Update 1_x86: Patch for C++ Compiler -
      • -
      • - 142363-05: Sun Studio 12 Update 1_x86: Patch for C Compiler -
      • -
      • - 142368-01: Sun Studio 12.1_x86: Patch for Performance Analyzer Tools -
      • +
      • + 119961-07: SunOS 5.10_x86, x64, Patch for profiling libraries and assembler +
      • +
      • + 119964-21: SunOS 5.10_x86: Shared library patch for C++_x86 +
      • +
      • + 120754-08: SunOS 5.10_x86: Microtasking libraries (libmtsk) patch +
      • +
      • + 141858-06: Sun Studio 12 Update 1_x86: Sun Compiler Common patch for x86 backend +
      • +
      • + 128229-09: Sun Studio 12 Update 1_x86: Patch for C++ Compiler +
      • +
      • + 142363-05: Sun Studio 12 Update 1_x86: Patch for C Compiler +
      • +
      • + 142368-01: Sun Studio 12.1_x86: Patch for Performance Analyzer Tools +

      - Set - ALT_COMPILER_PATH - to point to the location of - the compiler binaries, and place this location in the PATH. + Set + ALT_COMPILER_PATH + to point to the location of + the compiler binaries, and place this location in the PATH.

      - The Oracle Solaris Studio Express compilers at: - - Oracle Solaris Studio Express Download site - are also an option, although these compilers have not - been extensively used yet. + The Oracle Solaris Studio Express compilers at: + + Oracle Solaris Studio Express Download site + are also an option, although these compilers have not + been extensively used yet.

    Windows i586: Microsoft Visual Studio 2010 Compilers
    -

    -BEGIN WARNING: At this time (Spring/Summer 2010) JDK 7 is starting a transition to -use the newest VS2010 Microsoft compilers. These build instructions are updated -to show where we are going. We have a QA process to go through before -official builds actually use VS2010. So for now, official builds are -still using VS2003. No other compilers are known to build the entire JDK, -including non-open portions. -So for now you should be able to build with either VS2003 or VS2010. -We do not guarantee that VS2008 will work, although there is sufficient -makefile support to make at least basic JDK builds plausible. -Visual Studio 2010 Express compilers are now able to build all the -open source repositories, but this is 32 bit only. To build 64 bit -Windows binaries use the the 7.1 Windows SDK.END WARNING. -

    - The 32-bit OpenJDK Windows build - requires - Microsoft Visual Studio C++ 2010 (VS2010) Professional - Edition or Express compiler. - The compiler and other tools are expected to reside - in the location defined by the variable - VS100COMNTOOLS which - is set by the Microsoft Visual Studio installer. -

    - Once the compiler is installed, - it is recommended that you run VCVARS32.BAT - to set the compiler environment variables - INCLUDE, - LIB, and - PATH - prior to building the - OpenJDK. - The above environment variables MUST be set. - This compiler also contains the Windows SDK v 7.0a, - which is an update to the Windows 7 SDK.

    - WARNING: Make sure you check out the - CYGWIN link.exe WARNING. - The path /usr/bin must be after the path to the - Visual Studio product. + BEGIN WARNING: At this time (Spring/Summer 2010) JDK 7 is starting a transition to + use the newest VS2010 Microsoft compilers. These build instructions are updated + to show where we are going. We have a QA process to go through before + official builds actually use VS2010. So for now, official builds are + still using VS2003. No other compilers are known to build the entire JDK, + including non-open portions. + So for now you should be able to build with either VS2003 or VS2010. + We do not guarantee that VS2008 will work, although there is sufficient + makefile support to make at least basic JDK builds plausible. + Visual Studio 2010 Express compilers are now able to build all the + open source repositories, but this is 32 bit only. To build 64 bit + Windows binaries use the the 7.1 Windows SDK.END WARNING. +

    + The 32-bit OpenJDK Windows build + requires + Microsoft Visual Studio C++ 2010 (VS2010) Professional + Edition or Express compiler. + The compiler and other tools are expected to reside + in the location defined by the variable + VS100COMNTOOLS which + is set by the Microsoft Visual Studio installer. +

    + Once the compiler is installed, + it is recommended that you run VCVARS32.BAT + to set the compiler environment variables + INCLUDE, + LIB, and + PATH + prior to building the + OpenJDK. + The above environment variables MUST be set. + This compiler also contains the Windows SDK v 7.0a, + which is an update to the Windows 7 SDK. +

    + WARNING: Make sure you check out the + CYGWIN link.exe WARNING. + The path /usr/bin must be after the path to the + Visual Studio product.

    Windows x64: Microsoft Visual Studio 2010 Professional Compiler
    @@ -1069,22 +1097,22 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. you have VS2010 Professional.
    Windows x64: Microsoft Windows 7.1 SDK 64 bit compilers. - For a free alternative for 64 bit builds, use the 7.1 SDK. - Microsoft say that to set up your paths for this run -
    +                For a free alternative for 64 bit builds, use the 7.1 SDK.
    +                Microsoft say that to set up your paths for this run
    +                
         c:\Program Files\Microsoft SDKs\Windows\v7.1\bin\setenv.cmd /x64.
    -
    - What was tested is just directly setting up LIB, INCLUDE, - PATH and based on the installation directories using the - DOS short name appropriate for the system, (you will - need to set them for yours, not just blindly copy this) eg : -
    +                
    + What was tested is just directly setting up LIB, INCLUDE, + PATH and based on the installation directories using the + DOS short name appropriate for the system, (you will + need to set them for yours, not just blindly copy this) eg : +
         set VSINSTALLDIR=c:\PROGRA~2\MICROS~1.0
         set WindowsSdkDir=c:\PROGRA~1\MICROS~1\Windows\v7.1
         set PATH=%VSINSTALLDIR%\vc\bin\amd64;%VSINSTALLDIR%\Common7\IDE;%WindowsSdkDir%\bin;%PATH%
         set INCLUDE=%VSINSTALLDIR%\vc\include;%WindowsSdkDir%\include
         set LIB=%VSINSTALLDIR%\vc\lib\amd64;%WindowsSdkDir%\lib\x64
    -
    +

    Zip and Unzip

    @@ -1110,41 +1138,41 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. Companion CD/DVD, these often will be installed into /opt/sfw/cups.

    - Linux: - CUPS header files are required for building the - OpenJDK on Linux. - The Linux header files are usually available from a "cups" - development package, it's recommended that you try and use - the package provided by the particular version of Linux that - you are using. + Linux: + CUPS header files are required for building the + OpenJDK on Linux. + The Linux header files are usually available from a "cups" + development package, it's recommended that you try and use + the package provided by the particular version of Linux that + you are using.

    - The CUPS header files can always be downloaded from - www.cups.org. - The variable - ALT_CUPS_HEADERS_PATH - can be used to override the default location of the - CUPS Header files. + The CUPS header files can always be downloaded from + www.cups.org. + The variable + ALT_CUPS_HEADERS_PATH + can be used to override the default location of the + CUPS Header files.

    XRender Extension Headers (Solaris & Linux)

    - Solaris: - XRender header files are required for building the - OpenJDK on Solaris. - The XRender header file is included with the other X11 header files - in the package SFWxwinc on new enough versions of - Solaris and will be installed in - /usr/X11/include/X11/extensions/Xrender.h + Solaris: + XRender header files are required for building the + OpenJDK on Solaris. + The XRender header file is included with the other X11 header files + in the package SFWxwinc on new enough versions of + Solaris and will be installed in + /usr/X11/include/X11/extensions/Xrender.h

    - Linux: - XRender header files are required for building the - OpenJDK on Linux. - The Linux header files are usually available from a "Xrender" - development package, it's recommended that you try and use - the package provided by the particular distribution of Linux that - you are using. -

    + Linux: + XRender header files are required for building the + OpenJDK on Linux. + The Linux header files are usually available from a "Xrender" + development package, it's recommended that you try and use + the package provided by the particular distribution of Linux that + you are using. +

    FreeType 2

    @@ -1155,31 +1183,31 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. Note that you need development version of package that includes both FreeType library and header files.

    - You can always download latest FreeType version from the - FreeType website. + You can always download latest FreeType version from the + FreeType website.

    - Makefiles will try to pick FreeType from /usr/lib and /usr/include. - In case it is installed elsewhere you will need to set environment - variables - ALT_FREETYPE_LIB_PATH - and - ALT_FREETYPE_HEADERS_PATH - to refer to place where library and header files are installed. + Makefiles will try to pick FreeType from /usr/lib and /usr/include. + In case it is installed elsewhere you will need to set environment + variables + ALT_FREETYPE_LIB_PATH + 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. + 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. + 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)

    @@ -1195,25 +1223,25 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. The makefiles will check this emit a sanity error if it is missing or the wrong version.

    - In particular, older Linux systems will likely not have the - right version of ALSA installed, for example - Redhat AS 2.1 U2 and SuSE 8.1 do not include a sufficiently - recent ALSA distribution. - On rpm-based systems, you can see if ALSA is installed by - running this command: + In particular, older Linux systems will likely not have the + right version of ALSA installed, for example + Redhat AS 2.1 U2 and SuSE 8.1 do not include a sufficiently + recent ALSA distribution. + On rpm-based systems, you can see if ALSA is installed by + running this command:

                         rpm -qa | grep alsa
                     
    Both alsa and alsa-devel packages are needed.

    - If your distribution does not come with ALSA, and you can't - find ALSA packages built for your particular system, - you can try to install the pre-built ALSA rpm packages from - - www.freshrpms.net. - Note that installing a newer ALSA could - break sound output if an older version of ALSA was previously - installed on the system, but it will enable JDK compilation. + If your distribution does not come with ALSA, and you can't + find ALSA packages built for your particular system, + you can try to install the pre-built ALSA rpm packages from + + www.freshrpms.net. + Note that installing a newer ALSA could + break sound output if an older version of ALSA was previously + installed on the system, but it will enable JDK compilation.

    Installation: execute as root
    [i586]: rpm -Uv --force alsa-lib-devel-0.9.1-rh61.i386.rpm
    @@ -1228,7 +1256,7 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING.
    As a last resort you can go to the - Advanced Linux Sound Architecture Site and build it from + Advanced Linux Sound Architecture Site and build it from source.
    Download driver and library @@ -1256,9 +1284,9 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. building the JDK platform. To actually use ALSA sound drivers, more steps are necessary as outlined in the documentation on ALSA's homepage.

    - ALSA can be uninstalled by executing make uninstall first in - the alsa-lib-0.9.1 directory and then in - alsa-driver-0.9.1. + ALSA can be uninstalled by executing make uninstall first in + the alsa-lib-0.9.1 directory and then in + alsa-driver-0.9.1.

    There are no ALT* variables to change the assumed locations of ALSA, the makefiles will expect to find the ALSA include files and library at: @@ -1273,15 +1301,15 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. on Windows which can be supplied by CYGWIN.

    - The OpenJDK build requires CYGWIN version 1.5.12 or newer. - Information about CYGWIN can - be obtained from the CYGWIN website at - www.cygwin.com. + The OpenJDK build requires CYGWIN version 1.5.12 or newer. + Information about CYGWIN can + be obtained from the CYGWIN website at + www.cygwin.com.

    - By default CYGWIN doesn't install all the tools required for building - the OpenJDK. - Along with the default installation, you need to install - the following tools. + By default CYGWIN doesn't install all the tools required for building + the OpenJDK. + Along with the default installation, you need to install + the following tools.

    @@ -1298,21 +1326,21 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. + utilities + NOTE: See the GNU make section + processor @@ -1354,21 +1382,21 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING.
    Devel binutils The GNU assembler, linker and binary - utilities
    make.exe Devel make The GNU version of the 'make' utility built for CYGWIN.
    - NOTE: See the GNU make section
    m4.exe Interpreters m4 GNU implementation of the traditional Unix macro - processor
    cpio.exe

    - Note that the CYGWIN software can conflict with other non-CYGWIN - software on your Windows system. - CYGWIN provides a - FAQ for - known issues and problems, of particular interest is the - section on - - BLODA (applications that interfere with CYGWIN). + Note that the CYGWIN software can conflict with other non-CYGWIN + software on your Windows system. + CYGWIN provides a + FAQ for + known issues and problems, of particular interest is the + section on + + BLODA (applications that interfere with CYGWIN).

    - WARNING: - Be very careful with link.exe, it will conflict - with the Visual Studio version. You need the Visual Studio - version of link.exe, not the CYGWIN one. - So it's important that the Visual Studio paths in PATH preceed - the CYGWIN path /usr/bin. + WARNING: + Be very careful with link.exe, it will conflict + with the Visual Studio version. You need the Visual Studio + version of link.exe, not the CYGWIN one. + So it's important that the Visual Studio paths in PATH preceed + the CYGWIN path /usr/bin. Microsoft DirectX 9.0 SDK header files and libraries

    @@ -1377,7 +1405,7 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. OpenJDK. This SDK can be downloaded from - Microsoft DirectX 9.0 SDK (Summer 2004). + Microsoft DirectX 9.0 SDK (Summer 2004). If the link above becomes obsolete, the SDK can be found from the Microsoft Download Site (search with "DirectX 9.0 SDK Update Summer 2004"). @@ -1431,14 +1459,14 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING.
  • - Solaris: - Note that ARCH_DATA_MODEL is really only needed on Solaris to - indicate you want to built the 64-bit version. - And before the Solaris 64-bit binaries can be used, they - must be merged with the binaries from a separate 32-bit build. - The merged binaries may then be used in either 32-bit or 64-bit mode, with - the selection occurring at runtime - with the -d32 or -d64 options. + Solaris: + Note that ARCH_DATA_MODEL is really only needed on Solaris to + indicate you want to built the 64-bit version. + And before the Solaris 64-bit binaries can be used, they + must be merged with the binaries from a separate 32-bit build. + The merged binaries may then be used in either 32-bit or 64-bit mode, with + the selection occurring at runtime + with the -d32 or -d64 options.


    @@ -1450,37 +1478,39 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. The default output directory is build/platform, where platform is one of - +
    + +
    In particular, the build/platform/j2sdk-image/bin directory should contain executables for the OpenJDK tools and utilities.

    - You can test that the build completed properly by using the build - to run the various demos that you will find in the - build/platform/j2sdk-image/demo - directory. + You can test that the build completed properly by using the build + to run the various demos that you will find in the + build/platform/j2sdk-image/demo + directory.

    - The provided regression tests can be run with the jtreg - utility from - the jtreg site. + The provided regression tests can be run with the jtreg + utility from + the jtreg site.


    Environment/Make Variables

    - Some of the - environment or make variables (just called variables in this - document) that can impact the build are: + Some of the + environment or make variables (just called variables in this + document) that can impact the build are:

    PATH
    @@ -1488,11 +1518,11 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING.
    MILESTONE
    @@ -1523,14 +1553,6 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. 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. - See Binary Plugs for more information. - You should always have a local copy of a - recent Binary Plugs install image - and set this variable to that location. -
    ALT_JDK_IMPORT_PATH
    The location of a previously built JDK installation. @@ -1627,36 +1649,19 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. Where each of these directories contain the import JDK image for that platform.
    -
    ALT_BUILD_BINARY_PLUGS_PATH
    -
    - These are useful in managing builds on multiple platforms. - The default network location for all of the binary plug images - for all platforms. - If ALT_BINARY_PLUGS_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 binary plugs image - for that platform. -
    Windows specific:
    -
    ALT_MSDEVTOOLS_PATH
    +
    ALT_WINDOWSSDKDIR
    The location of the - Microsoft Visual Studio - tools 'bin' directory. - The default is usually derived from - ALT_COMPILER_PATH. + Microsoft Windows SDK where some tools will be + located. + The default is whatever WINDOWSSDKDIR is set to + (or WindowsSdkDir) or the path +
    +                            c:\Program Files\Microsoft SDKs\Windows\v6.1a
    +			    
    ALT_DXSDK_PATH
    @@ -1694,17 +1699,17 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. Look for the check list of the platform you are building on in the Table of Contents.

    - You can validate your build environment by using the sanity - target. - Any errors listed - will stop the build from starting, and any warnings may result in - a flawed product build. - We strongly encourage you to evaluate every - sanity check warning and fix it if required, before you proceed - further with your build. + You can validate your build environment by using the sanity + target. + Any errors listed + will stop the build from starting, and any warnings may result in + a flawed product build. + We strongly encourage you to evaluate every + sanity check warning and fix it if required, before you proceed + further with your build.

    - Some of the more common problems with builds are briefly described - below, with suggestions for remedies. + Some of the more common problems with builds are briefly described + below, with suggestions for remedies.

    • Slow Builds: @@ -1715,15 +1720,15 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. machine, setting it to more than the the number of CPUs is probably not a good idea).

      - Creating the javadocs can be very slow, if you are running - javadoc, consider skipping that step. + Creating the javadocs can be very slow, if you are running + javadoc, consider skipping that step.

      - Faster hardware and more RAM always helps too. - The VM build tends to be CPU intensive (many C++ compiles), - and the rest of the JDK will often be disk intensive. + Faster hardware and more RAM always helps too. + The VM build tends to be CPU intensive (many C++ compiles), + and the rest of the JDK will often be disk intensive.

      - Faster compiles are possible using a tool called - ccache. + Faster compiles are possible using a tool called + ccache.

  • @@ -1732,10 +1737,10 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. If you see warnings that refer to file time stamps, e.g.
    Warning message: File `xxx' has modification time in - the future. + the future.
    Warning message: Clock skew detected. Your build may - be incomplete. + be incomplete.
    These warnings can occur when the clock on the build machine is out of sync with the timestamps on the source files. Other errors, apparently @@ -1747,9 +1752,9 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. when the pre-1.4 compiler ran across the new assert keyword in the 1.4 source code.

    - If you see these warnings, reset the clock on the build - machine, run "gmake clobber" or delete the directory - containing the build output, and restart the build from the beginning. + If you see these warnings, reset the clock on the build + machine, run "gmake clobber" or delete the directory + containing the build output, and restart the build from the beginning.

  • @@ -1776,32 +1781,28 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING.
    This is probably an issue with SELinux (See - http://en.wikipedia.org/wiki/SELinux). + http://en.wikipedia.org/wiki/SELinux). Parts of the VM is built without the -fPIC for performance reasons.

    - To completely disable SELinux: - -

      -
    1. $ su root
    2. -
    3. # system-config-securitylevel
    4. -
    5. In the window that appears, select the SELinux tab
    6. -
    7. Disable SELinux
    8. -
    - + To completely disable SELinux: +
      +
    1. $ su root
    2. +
    3. # system-config-securitylevel
    4. +
    5. In the window that appears, select the SELinux tab
    6. +
    7. Disable SELinux
    8. +

    - Alternatively, instead of completely disabling it you could - disable just this one check. - -

      -
    1. Select System->Administration->SELinux Management
    2. -
    3. In the SELinux Management Tool which appears, + Alternatively, instead of completely disabling it you could + disable just this one check. +
        +
      1. Select System->Administration->SELinux Management
      2. +
      3. In the SELinux Management Tool which appears, select "Boolean" from the menu on the left
      4. -
      5. Expand the "Memory Protection" group
      6. -
      7. Check the first item, labeled +
      8. Expand the "Memory Protection" group
      9. +
      10. Check the first item, labeled "Allow all unconfined executables to use libraries requiring text relocation ..."
      11. -
      -
      +
  • @@ -1810,7 +1811,7 @@ Windows binaries use the the 7.1 Windows SDK.END WARNING. The CYGWIN software can conflict with other non-CYGWIN software. See the CYGWIN FAQ section on - BLODA (applications that interfere with CYGWIN). + BLODA (applications that interfere with CYGWIN).
  • diff --git a/corba/.hgtags b/corba/.hgtags index 03eadfbbb1b..88d03298a46 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -88,3 +88,15 @@ c3dd858e09b20206459d9e7b0ead99d27ab00eab jdk7-b109 640fa4d4e2ad4c2d7e4815c955026740d8c52b7a jdk7-b111 cc67fdc4fee9a5b25caee4e71b51a8ff24ae7d1a jdk7-b112 a89a6c5be9d1a754868d3d359cbf7ad36aa95631 jdk7-b113 +88fddb73c5c4a4b50c319cbae9380caf5172ab45 jdk7-b114 +da7561d479e0ddaa4650d8023ac0fc7294e014e3 jdk7-b115 +98c028de4301106f2285ac0e128a1bb9b4c24f5c jdk7-b116 +fa502e4834dac2176499cc1f44794d5dc32a11b9 jdk7-b117 +42e77836fded7c2a3080d27316b96634ea9e33c6 jdk7-b118 +39829414ae31a0080578a49b751899edd518cd7d jdk7-b119 +cff5a173ec1e89013359e804a3e31736ef6fb462 jdk7-b120 +2cc9f32992101732b23730b737740e64ebc5fa89 jdk7-b121 +1523a060032c8a5b7840198da8911abeff88118f jdk7-b122 +a230c142628cea22475ab9dc5cd544266ddf2466 jdk7-b123 +f90b3e014e831eb4f32ef035a1dad2b8ba87949f jdk7-b124 +1ce58c72b7892cb813eb920276c7e7f17a1b79fe jdk7-b125 diff --git a/corba/make/Makefile b/corba/make/Makefile index b8a71915079..aef5c1b4bd4 100644 --- a/corba/make/Makefile +++ b/corba/make/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/com/sun/corba/minclude/com_sun_corba_se_impl_io.jmk b/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_io.jmk index cc3cbb69cc5..b8de62d6f2a 100644 --- a/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_io.jmk +++ b/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_io.jmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ com_sun_corba_se_impl_io_java = \ com/sun/corba/se/impl/io/ObjectStreamField.java \ com/sun/corba/se/impl/io/OptionalDataException.java \ com/sun/corba/se/impl/io/ValueHandlerImpl.java \ - com/sun/corba/se/impl/io/IIOPInputStream.java \ + com/sun/corba/se/impl/io/IIOPInputStream.java \ com/sun/corba/se/impl/io/IIOPOutputStream.java \ com/sun/corba/se/impl/io/TypeMismatchException.java \ com/sun/corba/se/impl/io/InputStreamHook.java \ diff --git a/corba/make/common/Defs-linux.gmk b/corba/make/common/Defs-linux.gmk index a5ef1d36b29..f65cfe8e535 100644 --- a/corba/make/common/Defs-linux.gmk +++ b/corba/make/common/Defs-linux.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/common/Defs-solaris.gmk b/corba/make/common/Defs-solaris.gmk index eb38771dfab..3237978a01a 100644 --- a/corba/make/common/Defs-solaris.gmk +++ b/corba/make/common/Defs-solaris.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/common/Defs-windows.gmk b/corba/make/common/Defs-windows.gmk index cef6c6c60b8..75823af9dd9 100644 --- a/corba/make/common/Defs-windows.gmk +++ b/corba/make/common/Defs-windows.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/common/Defs.gmk b/corba/make/common/Defs.gmk index 2d5c83db6e0..6d78ecb580e 100644 --- a/corba/make/common/Defs.gmk +++ b/corba/make/common/Defs.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/common/Rules.gmk b/corba/make/common/Rules.gmk index a18978697b4..7080e5bc53b 100644 --- a/corba/make/common/Rules.gmk +++ b/corba/make/common/Rules.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/common/shared/Defs-java.gmk b/corba/make/common/shared/Defs-java.gmk index 8d7531fe3e4..f45a7a1bc73 100644 --- a/corba/make/common/shared/Defs-java.gmk +++ b/corba/make/common/shared/Defs-java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/common/shared/Defs-linux.gmk b/corba/make/common/shared/Defs-linux.gmk index 9db85a39ba7..c8a3e359543 100644 --- a/corba/make/common/shared/Defs-linux.gmk +++ b/corba/make/common/shared/Defs-linux.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/common/shared/Defs-solaris.gmk b/corba/make/common/shared/Defs-solaris.gmk index 7f0abf6a790..416e868dc1d 100644 --- a/corba/make/common/shared/Defs-solaris.gmk +++ b/corba/make/common/shared/Defs-solaris.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/common/shared/Defs-windows.gmk b/corba/make/common/shared/Defs-windows.gmk index 559317a744e..1521d9461c3 100644 --- a/corba/make/common/shared/Defs-windows.gmk +++ b/corba/make/common/shared/Defs-windows.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/common/shared/Defs.gmk b/corba/make/common/shared/Defs.gmk index af1456bab97..1619dcba1c2 100644 --- a/corba/make/common/shared/Defs.gmk +++ b/corba/make/common/shared/Defs.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/common/shared/Platform.gmk b/corba/make/common/shared/Platform.gmk index e1bb4466531..07d0b505d27 100644 --- a/corba/make/common/shared/Platform.gmk +++ b/corba/make/common/shared/Platform.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -383,7 +383,7 @@ endif REQUIRED_ZIP_VER = 2.2 REQUIRED_UNZIP_VER = 5.12 -REQUIRED_MAKE_VER = 3.78 +REQUIRED_MAKE_VER = 3.81 # Unix type settings (same for all unix platforms) ifneq ($(PLATFORM), windows) diff --git a/corba/make/org/omg/idl/Makefile b/corba/make/org/omg/idl/Makefile index 87ad9db55a9..3687eb0b08c 100644 --- a/corba/make/org/omg/idl/Makefile +++ b/corba/make/org/omg/idl/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/sun/corba/Makefile b/corba/make/sun/corba/Makefile index f590de2d1a5..5b7dfd05b56 100644 --- a/corba/make/sun/corba/Makefile +++ b/corba/make/sun/corba/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/sun/corba/core/Makefile b/corba/make/sun/corba/core/Makefile index 861aed047c9..7075e865cd2 100644 --- a/corba/make/sun/corba/core/Makefile +++ b/corba/make/sun/corba/core/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/sun/rmi/rmic/FILES.gmk b/corba/make/sun/rmi/rmic/FILES.gmk index ca8f409b20e..9ad7901d54a 100644 --- a/corba/make/sun/rmi/rmic/FILES.gmk +++ b/corba/make/sun/rmi/rmic/FILES.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER 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/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java b/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java index da369f9c365..e03c71c5a95 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 @@ import com.sun.corba.se.impl.orbutil.ORBConstants; import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase; import com.sun.corba.se.impl.protocol.giopmsgheaders.FragmentMessage; +import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage; import com.sun.corba.se.impl.encoding.BufferManagerWrite; import com.sun.corba.se.impl.encoding.ByteBufferWithInfo; import com.sun.corba.se.impl.encoding.CDROutputObject; import com.sun.corba.se.spi.orb.ORB; import com.sun.corba.se.pept.transport.Connection; import com.sun.corba.se.pept.encoding.OutputObject; +import org.omg.CORBA.SystemException; /** * Streaming buffer manager. @@ -66,7 +68,13 @@ public class BufferManagerWriteStream extends BufferManagerWrite // Set the fragment's moreFragments field to true MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT); - sendFragment(false); + try { + sendFragment(false); + } catch(SystemException se){ + orb.getPIHandler().invokeClientPIEndingPoint( + ReplyMessage.SYSTEM_EXCEPTION, se); + throw se; + } // Reuse the old buffer diff --git a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ClientRequestInfoImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ClientRequestInfoImpl.java index df9f4d7a418..d24fa030725 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ClientRequestInfoImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ClientRequestInfoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,6 +74,7 @@ import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate; import com.sun.corba.se.spi.ior.iiop.GIOPVersion; import com.sun.corba.se.spi.orb.ORB; import com.sun.corba.se.spi.protocol.CorbaMessageMediator; +import com.sun.corba.se.spi.protocol.RetryType; import com.sun.corba.se.spi.transport.CorbaContactInfo; import com.sun.corba.se.spi.transport.CorbaContactInfoList; import com.sun.corba.se.spi.transport.CorbaContactInfoListIterator; @@ -110,7 +111,7 @@ public final class ClientRequestInfoImpl // The current retry request status. True if this request is being // retried and this info object is to be reused, or false otherwise. - private boolean retryRequest; + private RetryType retryRequest; // The number of times this info object has been (re)used. This is // incremented every time a request is retried, and decremented every @@ -163,7 +164,8 @@ public final class ClientRequestInfoImpl // Please keep these in the same order that they're declared above. - retryRequest = false; + // 6763340 + retryRequest = RetryType.NONE; // Do not reset entryCount because we need to know when to pop this // from the stack. @@ -824,14 +826,15 @@ public final class ClientRequestInfoImpl /** * Set or reset the retry request flag. */ - void setRetryRequest( boolean retryRequest ) { + void setRetryRequest( RetryType retryRequest ) { this.retryRequest = retryRequest; } /** * Retrieve the current retry request status. */ - boolean getRetryRequest() { + RetryType getRetryRequest() { + // 6763340 return this.retryRequest; } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/PIHandlerImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/PIHandlerImpl.java index 68782b1f356..e8c6d1560fc 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/PIHandlerImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/PIHandlerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -70,6 +70,7 @@ import com.sun.corba.se.spi.orbutil.closure.ClosureFactory; import com.sun.corba.se.spi.protocol.CorbaMessageMediator; import com.sun.corba.se.spi.protocol.ForwardException; import com.sun.corba.se.spi.protocol.PIHandler; +import com.sun.corba.se.spi.protocol.RetryType; import com.sun.corba.se.spi.logging.CORBALogDomains; import com.sun.corba.se.impl.logging.InterceptorsSystemException; @@ -372,9 +373,24 @@ public class PIHandlerImpl implements PIHandler } } - public Exception invokeClientPIEndingPoint( - int replyStatus, Exception exception ) - { + // Needed when an error forces a retry AFTER initiateClientPIRequest + // but BEFORE invokeClientPIStartingPoint. + public Exception makeCompletedClientRequest( int replyStatus, + Exception exception ) { + + // 6763340 + return handleClientPIEndingPoint( replyStatus, exception, false ) ; + } + + public Exception invokeClientPIEndingPoint( int replyStatus, + Exception exception ) { + + // 6763340 + return handleClientPIEndingPoint( replyStatus, exception, true ) ; + } + + public Exception handleClientPIEndingPoint( + int replyStatus, Exception exception, boolean invokeEndingPoint ) { if( !hasClientInterceptors ) return exception; if( !isClientPIEnabledForThisThread() ) return exception; @@ -388,24 +404,31 @@ public class PIHandlerImpl implements PIHandler ClientRequestInfoImpl info = peekClientRequestInfoImplStack(); info.setReplyStatus( piReplyStatus ); info.setException( exception ); - interceptorInvoker.invokeClientInterceptorEndingPoint( info ); - piReplyStatus = info.getReplyStatus(); + + if (invokeEndingPoint) { + // 6763340 + interceptorInvoker.invokeClientInterceptorEndingPoint( info ); + piReplyStatus = info.getReplyStatus(); + } // Check reply status: if( (piReplyStatus == LOCATION_FORWARD.value) || - (piReplyStatus == TRANSPORT_RETRY.value) ) - { + (piReplyStatus == TRANSPORT_RETRY.value) ) { // If this is a forward or a retry, reset and reuse // info object: info.reset(); - info.setRetryRequest( true ); + + // fix for 6763340: + if (invokeEndingPoint) { + info.setRetryRequest( RetryType.AFTER_RESPONSE ) ; + } else { + info.setRetryRequest( RetryType.BEFORE_RESPONSE ) ; + } // ... and return a RemarshalException so the orb internals know exception = new RemarshalException(); - } - else if( (piReplyStatus == SYSTEM_EXCEPTION.value) || - (piReplyStatus == USER_EXCEPTION.value) ) - { + } else if( (piReplyStatus == SYSTEM_EXCEPTION.value) || + (piReplyStatus == USER_EXCEPTION.value) ) { exception = info.getException(); } @@ -421,18 +444,21 @@ public class PIHandlerImpl implements PIHandler RequestInfoStack infoStack = (RequestInfoStack)threadLocalClientRequestInfoStack.get(); ClientRequestInfoImpl info = null; - if( !infoStack.empty() ) info = - (ClientRequestInfoImpl)infoStack.peek(); - if( !diiRequest && (info != null) && info.isDIIInitiate() ) { + if (!infoStack.empty() ) { + info = (ClientRequestInfoImpl)infoStack.peek(); + } + + if (!diiRequest && (info != null) && info.isDIIInitiate() ) { // In RequestImpl.doInvocation we already called // initiateClientPIRequest( true ), so ignore this initiate. info.setDIIInitiate( false ); - } - else { + } else { // If there is no info object or if we are not retrying a request, // push a new ClientRequestInfoImpl on the stack: - if( (info == null) || !info.getRetryRequest() ) { + + // 6763340: don't push unless this is not a retry + if( (info == null) || !info.getRetryRequest().isRetry() ) { info = new ClientRequestInfoImpl( orb ); infoStack.push( info ); printPush(); @@ -442,9 +468,15 @@ public class PIHandlerImpl implements PIHandler // Reset the retry request flag so that recursive calls will // push a new info object, and bump up entry count so we know // when to pop this info object: - info.setRetryRequest( false ); + info.setRetryRequest( RetryType.NONE ); info.incrementEntryCount(); + // KMC 6763340: I don't know why this wasn't set earlier, + // but we do not want a retry to pick up the previous + // reply status, so clear it here. Most likely a new + // info was pushed before, so that this was not a problem. + info.setReplyStatus( RequestInfoImpl.UNINITIALIZED ) ; + // If this is a DII request, make sure we ignore the next initiate. if( diiRequest ) { info.setDIIInitiate( true ); @@ -457,25 +489,34 @@ public class PIHandlerImpl implements PIHandler if( !isClientPIEnabledForThisThread() ) return; ClientRequestInfoImpl info = peekClientRequestInfoImplStack(); + RetryType rt = info.getRetryRequest() ; - // If the replyStatus has not yet been set, this is an indication - // that the ORB threw an exception before we had a chance to - // invoke the client interceptor ending points. - // - // _REVISIT_ We cannot handle any exceptions or ForwardRequests - // flagged by the ending points here because there is no way - // to gracefully handle this in any of the calling code. - // This is a rare corner case, so we will ignore this for now. - short replyStatus = info.getReplyStatus(); - if( replyStatus == info.UNINITIALIZED ) { - invokeClientPIEndingPoint( ReplyMessage.SYSTEM_EXCEPTION, - wrapper.unknownRequestInvoke( - CompletionStatus.COMPLETED_MAYBE ) ) ; + // fix for 6763340 + if (!rt.equals( RetryType.BEFORE_RESPONSE )) { + + // If the replyStatus has not yet been set, this is an indication + // that the ORB threw an exception before we had a chance to + // invoke the client interceptor ending points. + // + // _REVISIT_ We cannot handle any exceptions or ForwardRequests + // flagged by the ending points here because there is no way + // to gracefully handle this in any of the calling code. + // This is a rare corner case, so we will ignore this for now. + short replyStatus = info.getReplyStatus(); + if (replyStatus == info.UNINITIALIZED ) { + invokeClientPIEndingPoint( ReplyMessage.SYSTEM_EXCEPTION, + wrapper.unknownRequestInvoke( + CompletionStatus.COMPLETED_MAYBE ) ) ; + } } // Decrement entry count, and if it is zero, pop it from the stack. info.decrementEntryCount(); - if( info.getEntryCount() == 0 ) { + + // fix for 6763340, and probably other cases (non-recursive retry) + if (info.getEntryCount() == 0 && !info.getRetryRequest().isRetry()) { + // RequestInfoStack infoStack = + // threadLocalClientRequestInfoStack.get(); RequestInfoStack infoStack = (RequestInfoStack)threadLocalClientRequestInfoStack.get(); infoStack.pop(); diff --git a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/PINoOpHandlerImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/PINoOpHandlerImpl.java index 98b1572cac7..e6d9e53609f 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/PINoOpHandlerImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/PINoOpHandlerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -107,6 +107,11 @@ public class PINoOpHandlerImpl implements PIHandler return null; } + public Exception makeCompletedClientRequest( + int replyStatus, Exception exception ) { + return null; + } + public void initiateClientPIRequest( boolean diiRequest ) { } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/RequestInfoImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/RequestInfoImpl.java index 072d123d779..a20de7a3af0 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/RequestInfoImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/RequestInfoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -187,7 +187,8 @@ public abstract class RequestInfoImpl startingPointCall = 0; intermediatePointCall = 0; endingPointCall = 0; - replyStatus = UNINITIALIZED; + // 6763340 + setReplyStatus( UNINITIALIZED ) ; currentExecutionPoint = EXECUTION_POINT_STARTING; alreadyExecuted = false; connection = null; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java b/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java index 73ef8386006..1992c25a3c1 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1012,7 +1012,11 @@ public class IIOPInputStream * else, * Handle it as a serializable class. */ - if (currentClassDesc.isExternalizable()) { + if (Enum.class.isAssignableFrom( clz )) { + int ordinal = orbStream.read_long() ; + String value = (String)orbStream.read_value( String.class ) ; + return Enum.valueOf( clz, value ) ; + } else if (currentClassDesc.isExternalizable()) { try { currentObject = (currentClass == null) ? null : currentClassDesc.newInstance(); @@ -2553,8 +2557,8 @@ public class IIOPInputStream bridge.putObject( o, key, v ) ; } catch (Exception e) { throw utilWrapper.errorSetObjectField( e, fieldName, - ObjectUtility.compactObjectToString( o ), - ObjectUtility.compactObjectToString( v )) ; + o.toString(), + v.toString() ) ; } } @@ -2566,7 +2570,7 @@ public class IIOPInputStream bridge.putBoolean( o, key, v ) ; } catch (Exception e) { throw utilWrapper.errorSetBooleanField( e, fieldName, - ObjectUtility.compactObjectToString( o ), + o.toString(), new Boolean(v) ) ; } } @@ -2579,7 +2583,7 @@ public class IIOPInputStream bridge.putByte( o, key, v ) ; } catch (Exception e) { throw utilWrapper.errorSetByteField( e, fieldName, - ObjectUtility.compactObjectToString( o ), + o.toString(), new Byte(v) ) ; } } @@ -2592,7 +2596,7 @@ public class IIOPInputStream bridge.putChar( o, key, v ) ; } catch (Exception e) { throw utilWrapper.errorSetCharField( e, fieldName, - ObjectUtility.compactObjectToString( o ), + o.toString(), new Character(v) ) ; } } @@ -2605,7 +2609,7 @@ public class IIOPInputStream bridge.putShort( o, key, v ) ; } catch (Exception e) { throw utilWrapper.errorSetShortField( e, fieldName, - ObjectUtility.compactObjectToString( o ), + o.toString(), new Short(v) ) ; } } @@ -2618,7 +2622,7 @@ public class IIOPInputStream bridge.putInt( o, key, v ) ; } catch (Exception e) { throw utilWrapper.errorSetIntField( e, fieldName, - ObjectUtility.compactObjectToString( o ), + o.toString(), new Integer(v) ) ; } } @@ -2631,7 +2635,7 @@ public class IIOPInputStream bridge.putLong( o, key, v ) ; } catch (Exception e) { throw utilWrapper.errorSetLongField( e, fieldName, - ObjectUtility.compactObjectToString( o ), + o.toString(), new Long(v) ) ; } } @@ -2644,7 +2648,7 @@ public class IIOPInputStream bridge.putFloat( o, key, v ) ; } catch (Exception e) { throw utilWrapper.errorSetFloatField( e, fieldName, - ObjectUtility.compactObjectToString( o ), + o.toString(), new Float(v) ) ; } } @@ -2657,7 +2661,7 @@ public class IIOPInputStream bridge.putDouble( o, key, v ) ; } catch (Exception e) { throw utilWrapper.errorSetDoubleField( e, fieldName, - ObjectUtility.compactObjectToString( o ), + o.toString(), new Double(v) ) ; } } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java b/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java index 09eb3d2ea2e..bb4aca2d58c 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +85,9 @@ public class ObjectStreamClass implements java.io.Serializable { private static Hashtable translatedFields; + /** true if represents enum type */ + private boolean isEnum; + private static final Bridge bridge = (Bridge)AccessController.doPrivileged( new PrivilegedAction() { @@ -359,6 +362,7 @@ public class ObjectStreamClass implements java.io.Serializable { } name = cl.getName(); + isEnum = Enum.class.isAssignableFrom(cl); superclass = superdesc; serializable = serial; if (!forProxyClass) { @@ -401,7 +405,8 @@ public class ObjectStreamClass implements java.io.Serializable { if (!serializable || externalizable || forProxyClass || - name.equals("java.lang.String")) { + name.equals("java.lang.String") || + isEnum) { fields = NO_FIELDS; } else if (serializable) { /* Ask for permission to override field access checks. @@ -502,7 +507,7 @@ public class ObjectStreamClass implements java.io.Serializable { * * NonSerializable classes have a serialVerisonUID of 0L. */ - if (isNonSerializable()) { + if (isNonSerializable() || isEnum) { suid = 0L; } else { // Lookup special Serializable members using reflection. diff --git a/corba/src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java index 38e749c79fa..e1c82cf9bfc 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,32 +32,22 @@ package com.sun.corba.se.impl.io; import javax.rmi.CORBA.Util; -import javax.rmi.PortableRemoteObject; import java.util.Hashtable; -import java.util.Stack; import java.io.IOException; -import java.util.EmptyStackException; -import com.sun.corba.se.impl.util.Utility; -import com.sun.corba.se.impl.io.IIOPInputStream; -import com.sun.corba.se.impl.io.IIOPOutputStream; import com.sun.corba.se.impl.util.RepositoryId; import com.sun.corba.se.impl.util.Utility; import org.omg.CORBA.TCKind; -import org.omg.CORBA.MARSHAL; -import org.omg.CORBA.BAD_PARAM; -import org.omg.CORBA.CompletionStatus; import org.omg.CORBA.portable.IndirectionException; import com.sun.org.omg.SendingContext.CodeBase; import com.sun.org.omg.SendingContext.CodeBaseHelper; import java.security.AccessController; import java.security.PrivilegedAction; - -import com.sun.corba.se.impl.io.IIOPInputStream.ActiveRecursionManager; +import java.security.PrivilegedExceptionAction; import com.sun.corba.se.spi.logging.CORBALogDomains; import com.sun.corba.se.impl.logging.OMGSystemException; @@ -809,65 +799,163 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat return "com.sun.corba.se.impl.io.IIOPOutputStream"; } - private com.sun.corba.se.impl.io.IIOPOutputStream createOutputStream() { - return (com.sun.corba.se.impl.io.IIOPOutputStream)AccessController.doPrivileged( - new StreamFactory(getOutputStreamClassName())); + private IIOPOutputStream createOutputStream() { + final String name = getOutputStreamClassName(); + try { + IIOPOutputStream stream = createOutputStreamBuiltIn(name); + if (stream != null) { + return stream; + } + return createCustom(IIOPOutputStream.class, name); + } catch (Throwable t) { + // Throw exception under the carpet. + InternalError ie = new InternalError( + "Error loading " + name + ); + ie.initCause(t); + throw ie; + } + } + + /** + * Construct a built in implementation with priveleges. + * Returning null indicates a non-built is specified. + */ + private IIOPOutputStream createOutputStreamBuiltIn( + final String name + ) throws Throwable { + try { + return AccessController.doPrivileged( + new PrivilegedExceptionAction() { + public IIOPOutputStream run() throws IOException { + return createOutputStreamBuiltInNoPriv(name); + } + } + ); + } catch (java.security.PrivilegedActionException exc) { + throw exc.getCause(); + } + } + + /** + * Returning null indicates a non-built is specified. + */ + private IIOPOutputStream createOutputStreamBuiltInNoPriv( + final String name + ) throws IOException { + return + name.equals( + IIOPOutputStream + .class.getName() + ) ? + new IIOPOutputStream() : + + name.equals( + com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3 + .class.getName() + ) ? + new com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3() : + + name.equals( + com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3_1 + .class.getName() + ) ? + new com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3_1() : + + null; } protected String getInputStreamClassName() { return "com.sun.corba.se.impl.io.IIOPInputStream"; } - private com.sun.corba.se.impl.io.IIOPInputStream createInputStream() { - return (com.sun.corba.se.impl.io.IIOPInputStream)AccessController.doPrivileged( - new StreamFactory(getInputStreamClassName())); + private IIOPInputStream createInputStream() { + final String name = getInputStreamClassName(); + try { + IIOPInputStream stream = createInputStreamBuiltIn(name); + if (stream != null) { + return stream; + } + return createCustom(IIOPInputStream.class, name); + } catch (Throwable t) { + // Throw exception under the carpet. + InternalError ie = new InternalError( + "Error loading " + name + ); + ie.initCause(t); + throw ie; + } } /** - * Instantiates a class of the given name using the system ClassLoader - * as part of a PrivilegedAction. - * - * It's private final so hopefully people can't grab it outside of - * this class. - * - * If you're worried that someone could subclass ValueHandlerImpl, - * install his own streams, and snoop what's on the wire: - * Someone can do that only if he's allowed to use the feature - * of installing his own javax.rmi.CORBA.Util delegate (via a - * JVM property or orb.properties file, read the first time the - * Util class is used). If he can do that, he can snoop - * anything on the wire, anyway, without abusing the - * StreamFactory class. + * Construct a built in implementation with priveleges. + * Returning null indicates a non-built is specified. */ - private static final class StreamFactory implements PrivilegedAction { - private String className; + private IIOPInputStream createInputStreamBuiltIn( + final String name + ) throws Throwable { + try { + return AccessController.doPrivileged( + new PrivilegedExceptionAction() { + public IIOPInputStream run() throws IOException { + return createInputStreamBuiltInNoPriv(name); + } + } + ); + } catch (java.security.PrivilegedActionException exc) { + throw exc.getCause(); + } + } - public StreamFactory (String _className) { - className = _className; - } + /** + * Returning null indicates a non-built is specified. + */ + private IIOPInputStream createInputStreamBuiltInNoPriv( + final String name + ) throws IOException { + return + name.equals( + IIOPInputStream + .class.getName() + ) ? + new IIOPInputStream() : - public Object run() { - try { - // Note: We must use the system ClassLoader here - // since we want to load classes outside of the - // core JDK when running J2EE Pure ORB and - // talking to Kestrel. + name.equals( + com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3 + .class.getName() + ) ? + new com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3() : + + name.equals( + com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3_1 + .class.getName() + ) ? + new com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3_1() : + + null; + } + + /** + * Create a custom implementation without privileges. + */ + private T createCustom( + final Class type, final String className + ) throws Throwable { + // Note: We use the thread context or system ClassLoader here + // since we want to load classes outside of the + // core JDK when running J2EE Pure ORB and + // talking to Kestrel. ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) cl = ClassLoader.getSystemClassLoader(); - Class streamClass = cl.loadClass(className); + Class clazz = cl.loadClass(className); + Class streamClass = clazz.asSubclass(type); // Since the ClassLoader should cache the class, this isn't // as expensive as it looks. return streamClass.newInstance(); - } catch(Throwable t) { - InternalError ie = new InternalError( "Error loading " + className ) ; - ie.initCause( t ) ; - throw ie ; - } - } } /** diff --git a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java index b7564e716e4..d906afef923 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +45,10 @@ import com.sun.corba.se.spi.orbutil.fsm.StateEngineFactory ; import com.sun.corba.se.impl.orbutil.concurrent.Mutex ; import com.sun.corba.se.impl.orbutil.concurrent.CondVar ; +import org.omg.CORBA.SystemException ; + +import org.omg.PortableServer.POAPackage.ObjectAlreadyActive ; + /** AOMEntry represents a Servant or potential Servant in the ActiveObjectMap. * It may be in several states to allow for long incarnate or etherealize operations. * The methods on this class mostly represent input symbols to the state machine @@ -121,6 +125,12 @@ public class AOMEntry extends FSMImpl { } } ; + private static Action oaaAction = new ActionBase( "throwObjectAlreadyActive" ) { + public void doIt( FSM fsm, Input in ) { + throw new RuntimeException( new ObjectAlreadyActive() ) ; + } + } ; + private static Guard waitGuard = new GuardBase( "wait" ) { public Guard.Result evaluate( FSM fsm, Input in ) { AOMEntry entry = (AOMEntry)fsm ; @@ -173,19 +183,23 @@ public class AOMEntry extends FSMImpl { engine.add( INCARN, START_ETH, waitGuard, null, INCARN ) ; engine.add( INCARN, INC_DONE, null, VALID ) ; engine.add( INCARN, INC_FAIL, decrementAction, INVALID ) ; + engine.add( INCARN, ACTIVATE, oaaAction, INCARN ) ; engine.add( VALID, ENTER, incrementAction, VALID ) ; engine.add( VALID, EXIT, decrementAction, VALID ) ; engine.add( VALID, START_ETH, greaterZeroGuard, null, ETHP ) ; engine.add( VALID, START_ETH, zeroGuard, null, ETH ) ; + engine.add( VALID, ACTIVATE, oaaAction, VALID ) ; engine.add( ETHP, ENTER, waitGuard, null, ETHP ) ; engine.add( ETHP, START_ETH, null, ETHP ) ; engine.add( ETHP, EXIT, greaterOneGuard, decrementAction, ETHP ) ; engine.add( ETHP, EXIT, oneGuard, decrementAction, ETH ) ; + engine.add( ETHP, ACTIVATE, oaaAction, ETHP ) ; engine.add( ETH, START_ETH, null, ETH ) ; engine.add( ETH, ETH_DONE, null, DESTROYED ) ; + engine.add( ETH, ACTIVATE, oaaAction, ETH ) ; engine.add( ETH, ENTER, waitGuard, null, ETH ) ; engine.setDefault( DESTROYED, throwIllegalStateExceptionAction, DESTROYED ) ; @@ -217,7 +231,17 @@ public class AOMEntry extends FSMImpl { public void etherealizeComplete() { doIt( ETH_DONE ) ; } public void incarnateComplete() { doIt( INC_DONE ) ; } public void incarnateFailure() { doIt( INC_FAIL ) ; } - public void activateObject() { doIt( ACTIVATE ) ; } + public void activateObject() throws ObjectAlreadyActive { + try { + doIt( ACTIVATE ) ; + } catch (RuntimeException exc) { + Throwable thr = exc.getCause() ; + if (thr instanceof ObjectAlreadyActive) + throw (ObjectAlreadyActive)thr ; + else + throw exc ; + } + } public void enter() { doIt( ENTER ) ; } public void exit() { doIt( EXIT ) ; } } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java index b396ac5227d..1bc9130e109 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -107,13 +107,9 @@ public abstract class POAPolicyMediatorBase_R extends POAPolicyMediatorBase { throw new ServantAlreadyActive(); ActiveObjectMap.Key key = new ActiveObjectMap.Key( id ) ; - // Note that this can't happen for system assigned IDs since the - // POA never hands out the same ID. However, we make this redundant - // check here to share the code. - if (activeObjectMap.containsKey(key)) - throw new ObjectAlreadyActive() ; - AOMEntry entry = activeObjectMap.get( key ) ; + + // Check for an ObjectAlreadyActive error entry.activateObject() ; activateServant( key, entry, servant ) ; } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java index e8aac1da709..65d8246f7ad 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -245,7 +245,14 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB // All access to resolver, localResolver, and urlOperation must be protected using // resolverLock. Do not hold the ORBImpl lock while accessing // resolver, or deadlocks may occur. - private Object resolverLock ; + // Note that we now have separate locks for each resolver type. This is due + // to bug 6980681 and 6238477, which was caused by a deadlock while resolving a + // corbaname: URL that contained a reference to the same ORB as the + // ORB making the call to string_to_object. This caused a deadlock between the + // client thread holding the single lock for access to the urlOperation, + // and the server thread handling the client is_a request waiting on the + // same lock to access the localResolver. + // Used for resolver_initial_references and list_initial_services private Resolver resolver ; @@ -255,8 +262,14 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB // Converts strings to object references for resolvers and string_to_object private Operation urlOperation ; + private final Object urlOperationLock = new java.lang.Object() ; private CorbaServerRequestDispatcher insNamingDelegate ; + // resolverLock must be used for all access to either resolver or + // localResolver, since it is possible for the resolver to indirectly + // refer to the localResolver. Also used to protect access to + // insNamingDelegate. + private final Object resolverLock = new Object() ; private TaggedComponentFactoryFinder taggedComponentFactoryFinder ; @@ -396,7 +409,6 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB } }; - resolverLock = new java.lang.Object() ; requestDispatcherRegistry = new RequestDispatcherRegistryImpl( this, ORBConstants.DEFAULT_SCID); @@ -832,7 +844,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB if (str == null) throw wrapper.nullParam() ; - synchronized (resolverLock) { + synchronized (urlOperationLock) { org.omg.CORBA.Object obj = (org.omg.CORBA.Object)op.operate( str ) ; return obj ; } @@ -1672,6 +1684,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB { StackImpl invocationInfoStack = (StackImpl)clientInvocationInfoStack.get(); + int entryCount = -1; ClientInvocationInfo clientInvocationInfo = null; if (!invocationInfoStack.empty()) { clientInvocationInfo = @@ -1680,8 +1693,12 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB throw wrapper.invocationInfoStackEmpty() ; } clientInvocationInfo.decrementEntryCount(); + entryCount = clientInvocationInfo.getEntryCount(); if (clientInvocationInfo.getEntryCount() == 0) { - invocationInfoStack.pop(); + // 6763340: don't pop if this is a retry! + if (!clientInvocationInfo.isRetryInvocation()) { + invocationInfoStack.pop(); + } finishedDispatch(); } } @@ -1773,7 +1790,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB */ public void setURLOperation( Operation stringToObject ) { - synchronized (resolverLock) { + synchronized (urlOperationLock) { urlOperation = stringToObject ; } } @@ -1783,7 +1800,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB */ public Operation getURLOperation() { - synchronized (resolverLock) { + synchronized (urlOperationLock) { return urlOperation ; } } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orb/PrefixParserAction.java b/corba/src/share/classes/com/sun/corba/se/impl/orb/PrefixParserAction.java index 891628dd24e..ace0d795d15 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orb/PrefixParserAction.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orb/PrefixParserAction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -110,7 +110,7 @@ public class PrefixParserAction extends ParserActionBase { throw wrapper.couldNotSetArray( thr, getPropertyName(), new Integer(ctr), componentType, new Integer(size), - ObjectUtility.compactObjectToString( obj )) ; + obj.toString() ) ; } ctr++ ; } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/CorbaResourceUtil.java b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/CorbaResourceUtil.java index 9f23ebf76ac..5f141201392 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/CorbaResourceUtil.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/CorbaResourceUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER 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/com/sun/corba/se/impl/orbutil/ObjectUtility.java b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectUtility.java index aca7676b9c2..237ef2258c8 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectUtility.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectUtility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,103 +50,8 @@ import java.math.BigInteger ; import java.math.BigDecimal ; public final class ObjectUtility { - private boolean useToString ; - private boolean isIndenting ; - private int initialLevel ; - private int increment ; - private ClassMap classToPrinter = new ClassMap() ; + private ObjectUtility() {} - private static ObjectUtility standard = new ObjectUtility( false, true, - 0, 4 ) ; - private static ObjectUtility compact = new ObjectUtility( true, false, - 0, 4 ) ; - - private ObjectUtility( boolean useToString, boolean isIndenting, - int initialLevel, int increment ) - { - this.useToString = useToString ; - this.isIndenting = isIndenting ; - this.initialLevel = initialLevel ; - this.increment = increment ; - classToPrinter.put( Properties.class, propertiesPrinter ) ; - classToPrinter.put( Collection.class, collectionPrinter ) ; - classToPrinter.put( Map.class, mapPrinter ) ; - } - - /** Construct an Utility instance with the desired objectToString - * behavior. - */ - public static ObjectUtility make( boolean useToString, boolean isIndenting, - int initialLevel, int increment ) - { - return new ObjectUtility( useToString, isIndenting, initialLevel, - increment ) ; - } - - /** Construct an Utility instance with the desired objectToString - * behavior. - */ - public static ObjectUtility make( boolean useToString, boolean isIndenting ) - { - return new ObjectUtility( useToString, isIndenting, 0, 4 ) ; - } - - /** Get the standard Utility object that supports objectToString with - * indented display and no use of toString() methods. - */ - public static ObjectUtility make() - { - return standard ; - } - - /** A convenience method that gives the default behavior: use indenting - * to display the object's structure and do not use built-in toString - * methods. - */ - public static String defaultObjectToString( java.lang.Object object ) - { - return standard.objectToString( object ) ; - } - - public static String compactObjectToString( java.lang.Object object ) - { - return compact.objectToString( object ) ; - } - - /** objectToString handles display of arbitrary objects. It correctly - * handles objects whose elements form an arbitrary graph. It uses - * reflection to display the contents of any kind of object. - * An object's toString() method may optionally be used, but the default - * is to ignore all toString() methods except for those defined for - * primitive types, primitive type wrappers, and strings. - */ - public String objectToString(java.lang.Object obj) - { - IdentityHashMap printed = new IdentityHashMap() ; - ObjectWriter result = ObjectWriter.make( isIndenting, initialLevel, - increment ) ; - objectToStringHelper( printed, result, obj ) ; - return result.toString() ; - } - - // Perform a deep structural equality comparison of the two objects. - // This handles all arrays, maps, and sets specially, otherwise - // it just calls the object's equals() method. - public static boolean equals( java.lang.Object obj1, java.lang.Object obj2 ) - { - // Set of pairs of objects that have been (or are being) considered for - // equality. Such pairs are presumed to be equals. If they are not, - // this will be detected eventually and the equals method will return - // false. - Set considered = new HashSet() ; - - // Map that gives the corresponding component of obj2 for a component - // of obj1. This is used to check for the same aliasing and use of - // equal objects in both objects. - Map counterpart = new IdentityHashMap() ; - - return equalsHelper( counterpart, considered, obj1, obj2 ) ; - } /** If arr1 and arr2 are both arrays of the same component type, * return an array of that component type that consists of the @@ -179,544 +84,4 @@ public final class ObjectUtility { return result ; } -//=========================================================================== -// Implementation -//=========================================================================== - - private void objectToStringHelper( IdentityHashMap printed, - ObjectWriter result, java.lang.Object obj) - { - if (obj==null) { - result.append( "null" ) ; - result.endElement() ; - } else { - Class cls = obj.getClass() ; - result.startObject( obj ) ; - - if (printed.keySet().contains( obj )) { - result.endObject( "*VISITED*" ) ; - } else { - printed.put( obj, null ) ; - - if (mustUseToString(cls)) { - result.endObject( obj.toString() ) ; - } else { - // First, handle any classes that have special printer - // methods defined. This is useful when the class - // overrides toString with something that - // is not sufficiently detailed. - ObjectPrinter printer = (ObjectPrinter)(classToPrinter.get( - cls )) ; - if (printer != null) { - printer.print( printed, result, obj ) ; - result.endObject() ; - } else { - Class compClass = cls.getComponentType() ; - - if (compClass == null) - // handleObject always calls endObject - handleObject( printed, result, obj ) ; - else { - handleArray( printed, result, obj ) ; - result.endObject() ; - } - } - } - } - } - } - - private static interface ObjectPrinter { - void print( IdentityHashMap printed, ObjectWriter buff, - java.lang.Object obj ) ; - } - - private ObjectPrinter propertiesPrinter = new ObjectPrinter() { - public void print( IdentityHashMap printed, ObjectWriter buff, - java.lang.Object obj ) - { - if (!(obj instanceof Properties)) - throw new Error() ; - - Properties props = (Properties)obj ; - Enumeration keys = props.propertyNames() ; - while (keys.hasMoreElements()) { - String key = (String)(keys.nextElement()) ; - String value = props.getProperty( key ) ; - buff.startElement() ; - buff.append( key ) ; - buff.append( "=" ) ; - buff.append( value ) ; - buff.endElement() ; - } - } - } ; - - private ObjectPrinter collectionPrinter = new ObjectPrinter() { - public void print( IdentityHashMap printed, ObjectWriter buff, - java.lang.Object obj ) - { - if (!(obj instanceof Collection)) - throw new Error() ; - - Collection coll = (Collection)obj ; - Iterator iter = coll.iterator() ; - while (iter.hasNext()) { - java.lang.Object element = iter.next() ; - buff.startElement() ; - objectToStringHelper( printed, buff, element ) ; - buff.endElement() ; - } - } - } ; - - private ObjectPrinter mapPrinter = new ObjectPrinter() { - public void print( IdentityHashMap printed, ObjectWriter buff, - java.lang.Object obj ) - { - if (!(obj instanceof Map)) - throw new Error() ; - - Map map = (Map)obj ; - Iterator iter = map.entrySet().iterator() ; - while (iter.hasNext()) { - Entry entry = (Entry)(iter.next()) ; - buff.startElement() ; - objectToStringHelper( printed, buff, entry.getKey() ) ; - buff.append( "=>" ) ; - objectToStringHelper( printed, buff, entry.getValue() ) ; - buff.endElement() ; - } - } - } ; - - private static class ClassMap { - ArrayList data ; - - public ClassMap() - { - data = new ArrayList() ; - } - - /** Return the first element of the ClassMap that is assignable to cls. - * The order is determined by the order in which the put method was - * called. Returns null if there is no match. - */ - public java.lang.Object get( Class cls ) - { - Iterator iter = data.iterator() ; - while (iter.hasNext()) { - java.lang.Object[] arr = (java.lang.Object[])(iter.next()) ; - Class key = (Class)(arr[0]) ; - if (key.isAssignableFrom( cls )) - return arr[1] ; - } - - return null ; - } - - /** Add obj to the map with key cls. Note that order matters, - * as the first match is returned. - */ - public void put( Class cls, java.lang.Object obj ) - { - java.lang.Object[] pair = { cls, obj } ; - data.add( pair ) ; - } - } - - private boolean mustUseToString( Class cls ) - { - // These probably never occur - if (cls.isPrimitive()) - return true ; - - // We must use toString for all primitive wrappers, since - // otherwise the code recurses endlessly (access value field - // inside Integer, returns another Integer through reflection). - if ((cls == Integer.class) || - (cls == BigInteger.class) || - (cls == BigDecimal.class) || - (cls == String.class) || - (cls == StringBuffer.class) || - (cls == Long.class) || - (cls == Short.class) || - (cls == Byte.class) || - (cls == Character.class) || - (cls == Float.class) || - (cls == Double.class) || - (cls == Boolean.class)) - return true ; - - if (useToString) { - try { - cls.getDeclaredMethod( "toString", (Class[])null ) ; - return true ; - } catch (Exception exc) { - return false ; - } - } - - return false ; - } - - private void handleObject( IdentityHashMap printed, ObjectWriter result, - java.lang.Object obj ) - { - Class cls = obj.getClass() ; - - try { - Field[] fields; - SecurityManager security = System.getSecurityManager(); - if (security != null && !Modifier.isPublic(cls.getModifiers())) { - fields = new Field[0]; - } else { - fields = cls.getDeclaredFields(); - } - - for (int ctr=0; ctr \n\nem que inclui:\n -port porta de ativa\u00e7\u00e3o na qual o ORBD deve ser iniciado, padr\u00e3o 1049 (opcional)\n -defaultdb diret\u00f3rio dos arquivos ORBD, padr\u00e3o "./orb.db" (opcional)\n -serverid id do servidor para ORBD, padr\u00e3o 1 (opcional)\n -ORBInitialPort porta inicial (necess\u00e1rio)\n -ORBInitialHost nome de host inicial (necess\u00e1rio)\n + +servertool.usage=Uso: {0} \n\nem que inclui:\n -ORBInitialPort porta inicial (necess\u00e1rio)\n -ORBInitialHost nome de host inicial (necess\u00e1rio)\n +servertool.banner=\n\nBem-vindo a ferramenta de servidor IDL Java \ninsira os comandos no prompt \n +servertool.shorthelp=\n\n\tComandos dispon\u00edveis: \n\t------------------- \n +servertool.baddef=Servidor mal definido: {0} +servertool.nosuchserver=\tservidor n\u00e3o encontrado. +servertool.helddown=\to servidor est\u00e1 em espera. +servertool.nosuchorb=\tORB inv\u00e1lido. +servertool.serverup=\to servidor j\u00e1 est\u00e1 ativo. +servertool.appname=\tapplicationName - {0} +servertool.name=\tname - {0} +servertool.classpath=\tclasspath - {0} +servertool.args=\targs - {0} +servertool.vmargs=\tvmargs - {0} +servertool.serverid=\tserver id - {0} +servertool.servernotrunning=\to servidor n\u00e3o est\u00e1 em execu\u00e7\u00e3o. +servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n +servertool.register1=registra um servidor ativ\u00e1vel +servertool.register2=\tservidor registrado (serverid = {0}). +servertool.register3=\tservidor registrado, mas em espera (serverid = {0}). +servertool.register4=\tservidor j\u00e1 registrado (serverid = {0}). + +servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n +servertool.unregister1=cancela o registro de um servidor registrado +servertool.unregister2=\tservidor n\u00e3o registrado. + +servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n +servertool.locate1=localiza portas de tipo espec\u00edfico para um servidor registrado +servertool.locate2=\n\n\tNome do host {0} \n\n\t\tPorta\t\tTipo de porta\t\tId do ORB\n\t\t----\t\t---------\t\t------\n +servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n +servertool.locateorb1=localiza portas para um orb espec\u00edfico de servidor registrado +servertool.locateorb2=\n\n\tNome do host {0} \n\n\t\tPorta\t\tTipo de porta\t\tId do ORB\n\t\t----\t\t--------\t\t------\n +servertool.getserverid=\n\tgetserverid [ -applicationName ] \n +servertool.getserverid1=retorna o id do servidor de um applicationName +servertool.getserverid2=\tID do servidor de applicationName {0} \u00e9 {1} + +servertool.list=\n\tlist\n +servertool.list1=lista todos os servidores registrados +servertool.list2=\n\tId do servidor\tNome de classe do servidor\t\tAplicativo do servidor\n\t---------\t-----------------\t\t------------------\n +servertool.listactive=\n\tlistactive +servertool.listactive1=lista os servidores atualmente ativos +servertool.listappnames=\tlistappnames\n +servertool.listappnames1=lista os applicationNames atualmente definidos +servertool.listappnames2=applicationNames do servidor atualmente definidos: + +servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n +servertool.shutdown1=desliga um servidor registrado +servertool.shutdown2=\tservidor desligado com \u00eaxito. +servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n +servertool.startserver1=inicia um servidor registrado +servertool.startserver2=\tservidor iniciado com \u00eaxito. + +servertool.quit=\n\tquit\n +servertool.quit1=sai desta ferramenta + +servertool.help=\thelp\n\tOR\n\thelp \n +servertool.help1=obt\u00e9m ajuda + +servertool.orbidmap=\tUso: orblist [ -serverid | -applicationName ]\n +servertool.orbidmap1=lista de nomes de orb e seus mapeamentos +servertool.orbidmap2=\n\tId de ORB\t\tNome de ORB\n\t------\t\t--------\n +pnameserv.success=NameServer persistente iniciado com \u00eaxito + + +bootstrap.usage=Uso: {0} \n\nem que inclui:\n -ORBInitialPort porta inicial (necess\u00e1rio)\n -InitialServicesFile arquivo que cont\u00e9m a lista de servi\u00e7os iniciais (necess\u00e1rio)\n +bootstrap.success=configurando porta para {0} e lendo servi\u00e7os de {1} +bootstrap.filenotreadable=o arquivo {0} n\u00e3o \u00e9 leg\u00edvel +bootstrap.filenotfound=arquivo {0} n\u00e3o encontrado +bootstrap.exception=exce\u00e7\u00e3o capturada ao salvar as propriedades no arquivo {0}: Exce\u00e7\u00e3o {1} + +tnameserv.exception=uma exce\u00e7\u00e3o capturada ao iniciar o servi\u00e7o de inicializa\u00e7\u00e3o na porta {0} +tnameserv.usage=tente usar outra porta com os argumentos de linha de comando -ORBInitialPort +tnameserv.invalidhostoption=ORBInitialHost n\u00e3o \u00e9 uma op\u00e7\u00e3o v\u00e1lida para NameService +tnameserv.orbinitialport0=ORBInitialPort 0 n\u00e3o \u00e9 uma op\u00e7\u00e3o v\u00e1lida para NameService +tnameserv.hs1=Contexto de nomea\u00e7\u00e3o inicial:\n{0} +tnameserv.hs2=TransientNameServer: definindo porta para as refer\u00eancias de objeto iniciais: {0} +tnameserv.hs3=Pronto. + +orbd.commfailure=\nFalha ao iniciar ORBD porque ORBinitialPort j\u00e1 est\u00e1 em uso +orbd.internalexception=\nFalha ao iniciar ORBD devido a uma exce\u00e7\u00e3o interna. \nPoss\u00edveis causas: \n1. ORBInitialPort especificado ou ORBActivationPort j\u00e1 em uso \n2. Sem permiss\u00e3o de grava\u00e7\u00e3o para gravar orb.db + diff --git a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/ExceptionHandlerImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/ExceptionHandlerImpl.java index 6b9452e2766..f6b08eab1a5 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/ExceptionHandlerImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/ExceptionHandlerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER 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/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java index 9bde8981c13..7728a677ecd 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -122,9 +122,6 @@ public class CorbaClientRequestDispatcherImpl implements ClientRequestDispatcher { - // Used for locking - private Object lock = new Object(); - public OutputObject beginRequest(Object self, String opName, boolean isOneWay, ContactInfo contactInfo) { @@ -151,7 +148,8 @@ public class CorbaClientRequestDispatcherImpl // This locking is done so that multiple connections are not created // for the same endpoint - synchronized (lock) { + //6929137 - Synchronized on contactInfo to avoid blocking across multiple endpoints + synchronized (contactInfo) { if (contactInfo.isConnectionBased()) { if (contactInfo.shouldCacheConnection()) { connection = (CorbaConnection) @@ -185,6 +183,7 @@ public class CorbaClientRequestDispatcherImpl if(getContactInfoListIterator(orb).hasNext()) { contactInfo = (ContactInfo) getContactInfoListIterator(orb).next(); + unregisterWaiter(orb); return beginRequest(self, opName, isOneWay, contactInfo); } else { @@ -255,7 +254,7 @@ public class CorbaClientRequestDispatcherImpl registerWaiter(messageMediator); // Do connection reclaim now - synchronized (lock) { + synchronized (contactInfo) { if (contactInfo.isConnectionBased()) { if (contactInfo.shouldCacheConnection()) { OutboundConnectionCache connectionCache = @@ -292,10 +291,22 @@ public class CorbaClientRequestDispatcherImpl // ContactInfoList outside of subcontract. // Want to move that update to here. if (getContactInfoListIterator(orb).hasNext()) { - contactInfo = (ContactInfo) - getContactInfoListIterator(orb).next(); + contactInfo = (ContactInfo)getContactInfoListIterator(orb).next(); + if (orb.subcontractDebugFlag) { + dprint( "RemarshalException: hasNext true\ncontact info " + contactInfo ); + } + + // Fix for 6763340: Complete the first attempt before starting another. + orb.getPIHandler().makeCompletedClientRequest( + ReplyMessage.LOCATION_FORWARD, null ) ; + unregisterWaiter(orb); + orb.getPIHandler().cleanupClientPIRequest() ; + return beginRequest(self, opName, isOneWay, contactInfo); } else { + if (orb.subcontractDebugFlag) { + dprint( "RemarshalException: hasNext false" ); + } ORBUtilSystemException wrapper = ORBUtilSystemException.get(orb, CORBALogDomains.RPC_PROTOCOL); @@ -374,11 +385,15 @@ public class CorbaClientRequestDispatcherImpl boolean retry = getContactInfoListIterator(orb) .reportException(messageMediator.getContactInfo(), e); - if (retry) { - // Must run interceptor end point before retrying. - Exception newException = + + //Bug 6382377: must not lose exception in PI + + // Must run interceptor end point before retrying. + Exception newException = orb.getPIHandler().invokeClientPIEndingPoint( - ReplyMessage.SYSTEM_EXCEPTION, e); + ReplyMessage.SYSTEM_EXCEPTION, e); + + if (retry) { if (newException == e) { continueOrThrowSystemOrRemarshal(messageMediator, new RemarshalException()); @@ -387,6 +402,14 @@ public class CorbaClientRequestDispatcherImpl newException); } } else { + if (newException instanceof RuntimeException){ + throw (RuntimeException)newException; + } + else if (newException instanceof RemarshalException) + { + throw (RemarshalException)newException; + } + // NOTE: Interceptor ending point will run in releaseReply. throw e; } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java index d8608f21ab5..0cbce53ffc1 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ import com.sun.corba.se.pept.transport.ConnectionCache; import com.sun.corba.se.spi.logging.CORBALogDomains; import com.sun.corba.se.spi.orb.ORB; +import com.sun.corba.se.spi.transport.CorbaConnection; import com.sun.corba.se.spi.transport.CorbaConnectionCache; import com.sun.corba.se.impl.logging.ORBUtilSystemException; @@ -87,6 +88,14 @@ public abstract class CorbaConnectionCacheBase } } + public void close() { + synchronized (backingStore()) { + for (Object obj : values()) { + ((CorbaConnection)obj).closeConnectionResources() ; + } + } + } + public long numberOfIdleConnections() { long count = 0; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java index 5f56b560a95..fae2d157969 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010 Oracle and/or its affiliates. All rights reserved. * 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 org.omg.CORBA.INTERNAL; import org.omg.CORBA.CompletionStatus; import com.sun.corba.se.pept.transport.Acceptor; +import com.sun.corba.se.pept.transport.ConnectionCache; import com.sun.corba.se.pept.transport.ByteBufferPool; import com.sun.corba.se.pept.transport.ContactInfo; import com.sun.corba.se.pept.transport.InboundConnectionCache; @@ -49,6 +50,8 @@ import com.sun.corba.se.spi.ior.ObjectAdapterId; import com.sun.corba.se.spi.orb.ORB; import com.sun.corba.se.spi.transport.CorbaAcceptor; import com.sun.corba.se.spi.transport.CorbaTransportManager; +import com.sun.corba.se.pept.transport.Connection; +import com.sun.corba.se.pept.transport.ConnectionCache; // REVISIT - impl/poa specific: import com.sun.corba.se.impl.oa.poa.Policies; @@ -182,6 +185,12 @@ public class CorbaTransportManagerImpl if (orb.transportDebugFlag) { dprint(".close->"); } + for (Object cc : outboundConnectionCaches.values()) { + ((ConnectionCache)cc).close() ; + } + for (Object cc : inboundConnectionCaches.values()) { + ((ConnectionCache)cc).close() ; + } getSelector(0).close(); } finally { if (orb.transportDebugFlag) { diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java index 8686439b84f..1c60088a7a3 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +32,7 @@ import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.util.ArrayList; import java.util.HashMap; +import java.util.Map; import java.util.Iterator; import java.util.List; @@ -66,7 +67,7 @@ public class SelectorImpl private List deferredRegistrations; private List interestOpsList; private HashMap listenerThreads; - private HashMap readerThreads; + private Map readerThreads; private boolean selectorStarted; private boolean closed; private ORBUtilSystemException wrapper ; @@ -81,7 +82,7 @@ public class SelectorImpl deferredRegistrations = new ArrayList(); interestOpsList = new ArrayList(); listenerThreads = new HashMap(); - readerThreads = new HashMap(); + readerThreads = java.util.Collections.synchronizedMap(new HashMap()); closed = false; wrapper = ORBUtilSystemException.get(orb,CORBALogDomains.RPC_TRANSPORT); } @@ -178,8 +179,13 @@ public class SelectorImpl } if (eventHandler.shouldUseSelectThreadToWait()) { - SelectionKey selectionKey = eventHandler.getSelectionKey(); - selectionKey.cancel(); + SelectionKey selectionKey ; + synchronized(deferredRegistrations) { + selectionKey = eventHandler.getSelectionKey(); + } + if (selectionKey != null) { + selectionKey.cancel(); + } selector.wakeup(); return; } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java index 47e07b899fc..01d344b8c7f 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 +33,7 @@ import java.nio.channels.SelectableChannel; import java.nio.channels.SelectionKey; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Collection; import java.util.Iterator; -import java.util.LinkedList; - -import org.omg.CORBA.CompletionStatus; -import org.omg.CORBA.INTERNAL; import com.sun.corba.se.pept.broker.Broker; import com.sun.corba.se.pept.encoding.InputObject; @@ -61,18 +54,12 @@ import com.sun.corba.se.spi.ior.iiop.IIOPFactories; import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate ; import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; import com.sun.corba.se.spi.ior.iiop.AlternateIIOPAddressComponent; -import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; import com.sun.corba.se.spi.logging.CORBALogDomains; -import com.sun.corba.se.spi.monitoring.LongMonitoredAttributeBase; -import com.sun.corba.se.spi.monitoring.MonitoringConstants; -import com.sun.corba.se.spi.monitoring.MonitoringFactories; -import com.sun.corba.se.spi.monitoring.MonitoredObject; import com.sun.corba.se.spi.orb.ORB; import com.sun.corba.se.spi.orbutil.threadpool.Work; import com.sun.corba.se.spi.protocol.CorbaMessageMediator; import com.sun.corba.se.spi.transport.CorbaAcceptor; import com.sun.corba.se.spi.transport.CorbaConnection; -import com.sun.corba.se.spi.transport.CorbaContactInfo; import com.sun.corba.se.spi.transport.SocketInfo; import com.sun.corba.se.spi.transport.SocketOrChannelAcceptor; @@ -82,7 +69,6 @@ import com.sun.corba.se.impl.logging.ORBUtilSystemException; import com.sun.corba.se.impl.oa.poa.Policies; // REVISIT impl/poa specific import com.sun.corba.se.impl.orbutil.ORBConstants; import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.ior.iiop.JavaSerializationComponent; // BEGIN Legacy support. import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; @@ -442,12 +428,7 @@ public class SocketOrChannelAcceptorImpl dprint(".doWork->: " + this); } if (selectionKey.isAcceptable()) { - AccessController.doPrivileged(new PrivilegedAction() { - public java.lang.Object run() { accept(); - return null; - } - }); } else { if (orb.transportDebugFlag) { dprint(".doWork: ! selectionKey.isAcceptable: " + this); diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java index e294067184e..277657e7586 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -811,6 +811,7 @@ public class SocketOrChannelConnectionImpl dprint(".close: " + this, e); } } + closeConnectionResources(); } finally { if (orb.transportDebugFlag) { dprint(".close<-: " + this); @@ -818,6 +819,28 @@ public class SocketOrChannelConnectionImpl } } + public void closeConnectionResources() { + if (orb.transportDebugFlag) { + dprint(".closeConnectionResources->: " + this); + } + Selector selector = orb.getTransportManager().getSelector(0); + selector.unregisterForEvent(this); + try { + if (socketChannel != null) + socketChannel.close() ; + if (socket != null && !socket.isClosed()) + socket.close() ; + } catch (IOException e) { + if (orb.transportDebugFlag) { + dprint( ".closeConnectionResources: " + this, e ) ; + } + } + if (orb.transportDebugFlag) { + dprint(".closeConnectionResources<-: " + this); + } + } + + public Acceptor getAcceptor() { return acceptor; diff --git a/corba/src/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java b/corba/src/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java index d5bee7d927f..7d32050a909 100644 --- a/corba/src/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java +++ b/corba/src/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 @@ public interface ConnectionCache public long numberOfBusyConnections(); public boolean reclaim(); + + /** Close all connections in the connection cache. + * This is used as a final cleanup, and will result + * in abrupt termination of any pending communications. + */ + public void close(); } // End of file. diff --git a/corba/src/share/classes/com/sun/corba/se/spi/orb/OperationFactory.java b/corba/src/share/classes/com/sun/corba/se/spi/orb/OperationFactory.java index 1b9460bde79..eb81eb56be0 100644 --- a/corba/src/share/classes/com/sun/corba/se/spi/orb/OperationFactory.java +++ b/corba/src/share/classes/com/sun/corba/se/spi/orb/OperationFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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 com.sun.corba.se.spi.orb ; import java.util.StringTokenizer ; +import java.util.Arrays ; import java.lang.reflect.Array ; @@ -446,7 +447,7 @@ public abstract class OperationFactory { public String toString() { return "sequenceAction(separator=\"" + sep + "\",actions=" + - ObjectUtility.compactObjectToString(actions) + ")" ; + Arrays.toString(actions) + ")" ; } } @@ -533,7 +534,7 @@ public abstract class OperationFactory { public String toString() { return "mapSequenceAction(" + - ObjectUtility.compactObjectToString(op) + ")" ; + Arrays.toString(op) + ")" ; } } diff --git a/corba/src/share/classes/com/sun/corba/se/spi/orb/ParserImplBase.java b/corba/src/share/classes/com/sun/corba/se/spi/orb/ParserImplBase.java index 374e585ec40..50e5760dd64 100644 --- a/corba/src/share/classes/com/sun/corba/se/spi/orb/ParserImplBase.java +++ b/corba/src/share/classes/com/sun/corba/se/spi/orb/ParserImplBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,7 +125,7 @@ public abstract class ParserImplBase { // Since exc wraps the actual exception, use exc.getCause() // instead of exc. throw wrapper.errorSettingField( exc.getCause(), name, - ObjectUtility.compactObjectToString(value) ) ; + value.toString() ) ; } } diff --git a/corba/src/share/classes/com/sun/corba/se/spi/protocol/PIHandler.java b/corba/src/share/classes/com/sun/corba/se/spi/protocol/PIHandler.java index f5ff9df590d..b59062a43be 100644 --- a/corba/src/share/classes/com/sun/corba/se/spi/protocol/PIHandler.java +++ b/corba/src/share/classes/com/sun/corba/se/spi/protocol/PIHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -141,6 +141,27 @@ public interface PIHandler { Exception invokeClientPIEndingPoint( int replyStatus, Exception exception ) ; + /** + * Called when a retry is needed after initiateClientPIRequest but + * before invokeClientPIRequest. In this case, we need to properly + * balance initiateClientPIRequest/cleanupClientPIRequest calls, + * but WITHOUT extraneous calls to invokeClientPIEndingPoint + * (see bug 6763340). + * + * @param replyStatus One of the constants in iiop.messages.ReplyMessage + * indicating which reply status to set. + * @param exception The exception before ending interception points have + * been invoked, or null if no exception at the moment. + * @return The exception to be thrown, after having gone through + * all ending points, or null if there is no exception to be + * thrown. Note that this exception can be either the same or + * different from the exception set using setClientPIException. + * There are four possible return types: null (no exception), + * SystemException, UserException, or RemarshalException. + */ + Exception makeCompletedClientRequest( + int replyStatus, Exception exception ) ; + /** * Invoked when a request is about to be created. Must be called before * any of the setClientPI* methods so that a new info object can be diff --git a/jdk/src/solaris/hpi/include/hpi_init.h b/corba/src/share/classes/com/sun/corba/se/spi/protocol/RetryType.java similarity index 55% rename from jdk/src/solaris/hpi/include/hpi_init.h rename to corba/src/share/classes/com/sun/corba/se/spi/protocol/RetryType.java index b657a86ccf4..6035011d3e9 100644 --- a/jdk/src/solaris/hpi/include/hpi_init.h +++ b/corba/src/share/classes/com/sun/corba/se/spi/protocol/RetryType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * 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,30 @@ * questions. */ -#ifndef _JAVASOFT_SOLARIS_HPI_INIT_H_ -#define _JAVASOFT_SOLARIS_HPI_INIT_H_ +package com.sun.corba.se.spi.protocol ; -#ifndef NATIVE -extern void InitializeSbrk(void); -extern void InitializeAsyncIO(void); -extern void InitializeHelperThreads(void); -#endif /* NATIVE */ +// Introduce more information about WHY we are re-trying a request +// so we can properly handle the two cases: +// - BEFORE_RESPONSE means that the retry is caused by +// something that happened BEFORE the message was sent: either +// an exception from the SocketFactory, or one from the +// Client side send_request interceptor point. +// - AFTER_RESPONSE means that the retry is a result either of the +// request sent to the server (from the response), or from the +// Client side receive_xxx interceptor point. +public enum RetryType { + NONE( false ), + BEFORE_RESPONSE( true ), + AFTER_RESPONSE( true ) ; -extern void InitializeMem(void); + private final boolean isRetry ; + + RetryType( boolean isRetry ) { + this.isRetry = isRetry ; + } + + public boolean isRetry() { + return this.isRetry ; + } +} ; -#endif /* _JAVASOFT_SOLARIS_HPI_INIT_H_ */ diff --git a/corba/src/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java b/corba/src/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java index b0e3f6f04dc..59bbd514076 100644 --- a/corba/src/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java +++ b/corba/src/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 @@ public interface CorbaConnection // REVISIT - MessageMediator parameter? public void serverRequestProcessingBegins(); public void serverRequestProcessingEnds(); + + /** Clean up all connection resources. Used when shutting down an ORB. + */ + public void closeConnectionResources(); } // End of file. diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/constExpr/Expression.java b/corba/src/share/classes/com/sun/tools/corba/se/idl/constExpr/Expression.java index d30696cdaf3..84a1873609d 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/constExpr/Expression.java +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/constExpr/Expression.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER 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/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java index 3efe5609535..c305ada5b24 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -344,17 +344,27 @@ public class Stub implements AuxGen stream.println (" String str = s.readUTF ();"); stream.println (" String[] args = null;"); stream.println (" java.util.Properties props = null;"); - stream.println (" org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);"); + stream.println (" org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);"); + stream.println (" try {"); + stream.println (" org.omg.CORBA.Object obj = orb.string_to_object (str);"); stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();"); stream.println (" _set_delegate (delegate);"); + stream.println (" } finally {"); + stream.println (" orb.destroy() ;"); + stream.println (" }"); stream.println (" }"); stream.println (); stream.println (" private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException"); stream.println (" {"); stream.println (" String[] args = null;"); stream.println (" java.util.Properties props = null;"); - stream.println (" String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);"); + stream.println (" org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);"); + stream.println (" try {"); + stream.println (" String str = orb.object_to_string (this);"); stream.println (" s.writeUTF (str);"); + stream.println (" } finally {"); + stream.println (" orb.destroy() ;"); + stream.println (" }"); stream.println (" }"); } diff --git a/corba/src/share/classes/javax/rmi/PortableRemoteObject.java b/corba/src/share/classes/javax/rmi/PortableRemoteObject.java index fef8d40b0b2..cbd6df25510 100644 --- a/corba/src/share/classes/javax/rmi/PortableRemoteObject.java +++ b/corba/src/share/classes/javax/rmi/PortableRemoteObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER 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/CORBA/ORB.java b/corba/src/share/classes/org/omg/CORBA/ORB.java index 4c1737a94c8..42fe7bc0090 100644 --- a/corba/src/share/classes/org/omg/CORBA/ORB.java +++ b/corba/src/share/classes/org/omg/CORBA/ORB.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER 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/CORBA/SetOverrideType.java b/corba/src/share/classes/org/omg/CORBA/SetOverrideType.java index 32c0243db84..82818974d2a 100644 --- a/corba/src/share/classes/org/omg/CORBA/SetOverrideType.java +++ b/corba/src/share/classes/org/omg/CORBA/SetOverrideType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER 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/CORBA/TCKind.java b/corba/src/share/classes/org/omg/CORBA/TCKind.java index 6bea0fd2212..bfacebf18d9 100644 --- a/corba/src/share/classes/org/omg/CORBA/TCKind.java +++ b/corba/src/share/classes/org/omg/CORBA/TCKind.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER 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/CORBA/UnknownUserException.java b/corba/src/share/classes/org/omg/CORBA/UnknownUserException.java index 38b0b711679..f9c8550927d 100644 --- a/corba/src/share/classes/org/omg/CORBA/UnknownUserException.java +++ b/corba/src/share/classes/org/omg/CORBA/UnknownUserException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER 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/CORBA/portable/ServantObject.java b/corba/src/share/classes/org/omg/CORBA/portable/ServantObject.java index feddaa3cdf6..2735927f789 100644 --- a/corba/src/share/classes/org/omg/CORBA/portable/ServantObject.java +++ b/corba/src/share/classes/org/omg/CORBA/portable/ServantObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER 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/CosNaming/nameservice.idl b/corba/src/share/classes/org/omg/CosNaming/nameservice.idl index dbdf6a74050..9e5ec9b439f 100644 --- a/corba/src/share/classes/org/omg/CosNaming/nameservice.idl +++ b/corba/src/share/classes/org/omg/CosNaming/nameservice.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER 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/PortableInterceptor/Interceptors.idl b/corba/src/share/classes/org/omg/PortableInterceptor/Interceptors.idl index 2a3077d5743..e55408d704b 100644 --- a/corba/src/share/classes/org/omg/PortableInterceptor/Interceptors.idl +++ b/corba/src/share/classes/org/omg/PortableInterceptor/Interceptors.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER 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/sun/corba/Bridge.java b/corba/src/share/classes/sun/corba/Bridge.java index e7ab067422c..987ee097376 100644 --- a/corba/src/share/classes/sun/corba/Bridge.java +++ b/corba/src/share/classes/sun/corba/Bridge.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/hpi/native/mapfile-vers b/get_source.sh similarity index 81% rename from jdk/make/java/hpi/native/mapfile-vers rename to get_source.sh index c7b9e6d9ead..bc609b3ee8d 100644 --- a/jdk/make/java/hpi/native/mapfile-vers +++ b/get_source.sh @@ -1,5 +1,7 @@ +#!/bin/sh + # -# Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. # 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 +25,9 @@ # questions. # -SUNWprivate_1.1 { - global: - DLL_Initialize; +# Get clones of all nested repositories +sh ./make/scripts/hgforest.sh clone + +# Update all existing repositories to the latest sources +sh ./make/scripts/hgforest.sh pull -u - local: - *; -}; diff --git a/hotspot/.hgtags b/hotspot/.hgtags index da1bccd72ad..6b879a83409 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -123,3 +123,21 @@ cc4bb3022b3144dc5db0805b9ef6c7eff2aa3b81 jdk7-b109 07b042e13dde4f3479ba9ec55120fcd5e8623323 jdk7-b111 5511edd5d719f3fc9fdd04879482026a3d2c8652 jdk7-b112 beef35b96b81129c375d572357fb9548d9020db1 jdk7-b113 +68d6141ea19de3a9ba98ef753f0da41a61f736a0 jdk7-b114 +5511edd5d719f3fc9fdd04879482026a3d2c8652 hs20-b01 +bdbc48857210a509b3c50a3291ecb9dd6a72e016 jdk7-b115 +96b3f2a7add0b445b8aa421f6823cff5a2e2fe03 jdk7-b116 +52f19c724d9634af79044a2e0defbe4a5f1adbda hs20-b02 +806d0c037e6bbb88dac0699673f4ba55ee8c02da jdk7-b117 +698b7b727e12de44139d8cca6ab9a494ead13253 jdk7-b118 +3ef7426b4deac5dcfd4afb35cabe9ab3d666df91 hs20-b02 +5484e7c53fa7da5e869902437ee08a9ae10c1c69 jdk7-b119 +f5603a6e50422046ebc0d2f1671d55cb8f1bf1e9 jdk7-b120 +3f3653ab7af8dc1ddb9fa75dad56bf94f89e81a8 jdk7-b121 +3a548dc9cb456110ca8fc1514441a8c3bda0014d jdk7-b122 +5484e7c53fa7da5e869902437ee08a9ae10c1c69 hs20-b03 +9669f9b284108a9ee0a0ccbe215c37a130c9dcf5 jdk7-b123 +9669f9b284108a9ee0a0ccbe215c37a130c9dcf5 hs20-b04 +0a8e0d4345b37b71ec49dda08ee03b68c4f1b592 jdk7-b124 +0a8e0d4345b37b71ec49dda08ee03b68c4f1b592 hs20-b05 +e24ab3fa6aafad3efabbe7dba9918c5f461a20b1 jdk7-b125 diff --git a/hotspot/agent/src/os/linux/libproc_impl.c b/hotspot/agent/src/os/linux/libproc_impl.c index ade0638da66..971a8283519 100644 --- a/hotspot/agent/src/os/linux/libproc_impl.c +++ b/hotspot/agent/src/os/linux/libproc_impl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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_core.c b/hotspot/agent/src/os/linux/ps_core.c index 21dfd05cd7e..9739e161471 100644 --- a/hotspot/agent/src/os/linux/ps_core.c +++ b/hotspot/agent/src/os/linux/ps_core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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 5ad3ff7f367..676e88a44bc 100644 --- a/hotspot/agent/src/os/linux/ps_proc.c +++ b/hotspot/agent/src/os/linux/ps_proc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,15 +121,13 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use #define ptrace_getregs(request, pid, addr, data) ptrace(request, pid, data, addr) #endif -#ifdef _LP64 -#ifdef PTRACE_GETREGS64 +#if defined(_LP64) && defined(PTRACE_GETREGS64) #define PTRACE_GETREGS_REQ PTRACE_GETREGS64 -#endif -#else -#if defined(PTRACE_GETREGS) || defined(PT_GETREGS) +#elif defined(PTRACE_GETREGS) #define PTRACE_GETREGS_REQ PTRACE_GETREGS +#elif defined(PT_GETREGS) +#define PTRACE_GETREGS_REQ PT_GETREGS #endif -#endif /* _LP64 */ #ifdef PTRACE_GETREGS_REQ if (ptrace_getregs(PTRACE_GETREGS_REQ, pid, user, NULL) < 0) { diff --git a/hotspot/agent/src/os/linux/symtab.c b/hotspot/agent/src/os/linux/symtab.c index 70ecf82e5aa..bea59e37823 100644 --- a/hotspot/agent/src/os/linux/symtab.c +++ b/hotspot/agent/src/os/linux/symtab.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/symtab.h b/hotspot/agent/src/os/linux/symtab.h index 534e33d7588..b2b9a3b9a27 100644 --- a/hotspot/agent/src/os/linux/symtab.h +++ b/hotspot/agent/src/os/linux/symtab.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/HotSpotTypeDataBase.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java index 967f8a4f100..9cf6122c761 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 (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -99,15 +99,8 @@ public class HotSpotTypeDataBase extends BasicTypeDataBase { long typeEntrySizeOffset; long typeEntryArrayStride; - typeEntryTypeNameOffset = getLongValueFromProcess("gHotSpotVMTypeEntryTypeNameOffset"); - typeEntrySuperclassNameOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySuperclassNameOffset"); - typeEntryIsOopTypeOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsOopTypeOffset"); - typeEntryIsIntegerTypeOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsIntegerTypeOffset"); - typeEntryIsUnsignedOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsUnsignedOffset"); - typeEntrySizeOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySizeOffset"); - typeEntryArrayStride = getLongValueFromProcess("gHotSpotVMTypeEntryArrayStride"); - - // Fetch the address of the VMTypeEntry* + // Fetch the address of the VMTypeEntry*. We get this symbol first + // and try to use it to make sure that symbol lookup is working. Address entryAddr = lookupInProcess("gHotSpotVMTypes"); // System.err.println("gHotSpotVMTypes address = " + entryAddr); // Dereference this once to get the pointer to the first VMTypeEntry @@ -118,6 +111,14 @@ public class HotSpotTypeDataBase extends BasicTypeDataBase { throw new RuntimeException("gHotSpotVMTypes was not initialized properly in the remote process; can not continue"); } + typeEntryTypeNameOffset = getLongValueFromProcess("gHotSpotVMTypeEntryTypeNameOffset"); + typeEntrySuperclassNameOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySuperclassNameOffset"); + typeEntryIsOopTypeOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsOopTypeOffset"); + typeEntryIsIntegerTypeOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsIntegerTypeOffset"); + typeEntryIsUnsignedOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsUnsignedOffset"); + typeEntrySizeOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySizeOffset"); + typeEntryArrayStride = getLongValueFromProcess("gHotSpotVMTypeEntryArrayStride"); + // Start iterating down it until we find an entry with no name Address typeNameAddr = null; do { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java index b2c988224fd..d29a626598b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -122,10 +122,14 @@ public class COFFFileParser { private MemoizedObject[] sectionHeaders; private MemoizedObject[] symbols; + // Init stringTable at decl time since other fields init'ed in the + // constructor need the String Table. private MemoizedObject stringTable = new MemoizedObject() { public Object computeValue() { + // the String Table follows the Symbol Table int ptr = getPointerToSymbolTable(); if (ptr == 0) { + // no Symbol Table so no String Table return new StringTable(0); } else { return new StringTable(ptr + SYMBOL_SIZE * getNumberOfSymbols()); @@ -140,6 +144,8 @@ public class COFFFileParser { timeDateStamp = readInt(); pointerToSymbolTable = readInt(); numberOfSymbols = readInt(); + // String Table can be accessed at this point because + // pointerToSymbolTable and numberOfSymbols fields are set. sizeOfOptionalHeader = readShort(); characteristics = readShort(); @@ -222,6 +228,8 @@ public class COFFFileParser { private MemoizedObject windowsSpecificFields; private MemoizedObject dataDirectories; + // We use an offset of 2 because OptionalHeaderStandardFieldsImpl doesn't + // include the 'magic' field. private static final int STANDARD_FIELDS_OFFSET = 2; private static final int PE32_WINDOWS_SPECIFIC_FIELDS_OFFSET = 28; private static final int PE32_DATA_DIRECTORIES_OFFSET = 96; @@ -288,7 +296,7 @@ public class COFFFileParser { private int sizeOfUninitializedData; private int addressOfEntryPoint; private int baseOfCode; - private int baseOfData; + private int baseOfData; // only set in PE32 OptionalHeaderStandardFieldsImpl(int offset, boolean isPE32Plus) { @@ -301,7 +309,8 @@ public class COFFFileParser { sizeOfUninitializedData = readInt(); addressOfEntryPoint = readInt(); baseOfCode = readInt(); - if (isPE32Plus) { + if (!isPE32Plus) { + // only available in PE32 baseOfData = readInt(); } } @@ -433,7 +442,10 @@ public class COFFFileParser { if (dir.getRVA() == 0 || dir.getSize() == 0) { return null; } - return new ExportDirectoryTableImpl(rvaToFileOffset(dir.getRVA()), dir.getSize()); + // ExportDirectoryTableImpl needs both the RVA and the + // RVA converted to a file offset. + return new + ExportDirectoryTableImpl(dir.getRVA(), dir.getSize()); } }; @@ -526,6 +538,7 @@ public class COFFFileParser { } class ExportDirectoryTableImpl implements ExportDirectoryTable { + private int exportDataDirRVA; private int offset; private int size; @@ -548,8 +561,9 @@ public class COFFFileParser { private MemoizedObject exportOrdinalTable; private MemoizedObject exportAddressTable; - ExportDirectoryTableImpl(int offset, int size) { - this.offset = offset; + ExportDirectoryTableImpl(int exportDataDirRVA, int size) { + this.exportDataDirRVA = exportDataDirRVA; + offset = rvaToFileOffset(exportDataDirRVA); this.size = size; seek(offset); exportFlags = readInt(); @@ -595,6 +609,7 @@ public class COFFFileParser { exportOrdinalTable = new MemoizedObject() { public Object computeValue() { + // number of ordinals is same as the number of name pointers short[] ordinals = new short[getNumberOfNamePointers()]; seek(rvaToFileOffset(getOrdinalTableRVA())); for (int i = 0; i < ordinals.length; i++) { @@ -608,14 +623,18 @@ public class COFFFileParser { public Object computeValue() { int[] addresses = new int[getNumberOfAddressTableEntries()]; seek(rvaToFileOffset(getExportAddressTableRVA())); - // Must make two passes to avoid rvaToFileOffset - // destroying seek() position + // The Export Address Table values are a union of two + // possible values: + // Export RVA - The address of the exported symbol when + // loaded into memory, relative to the image base. + // This value doesn't get converted into a file offset. + // Forwarder RVA - The pointer to a null-terminated ASCII + // string in the export section. This value gets + // converted into a file offset because we have to + // fetch the string. for (int i = 0; i < addresses.length; i++) { addresses[i] = readInt(); } - for (int i = 0; i < addresses.length; i++) { - addresses[i] = rvaToFileOffset(addresses[i]); - } return addresses; } }; @@ -648,11 +667,12 @@ public class COFFFileParser { public boolean isExportAddressForwarder(short ordinal) { int addr = getExportAddress(ordinal); - return ((offset <= addr) && (addr < (offset + size))); + return ((exportDataDirRVA <= addr) && + (addr < (exportDataDirRVA + size))); } public String getExportAddressForwarder(short ordinal) { - seek(getExportAddress(ordinal)); + seek(rvaToFileOffset(getExportAddress(ordinal))); return readCString(); } @@ -3371,10 +3391,17 @@ public class COFFFileParser { throw new COFFException(e); } // Look up in string table + // FIXME: this index value is assumed to be in the valid range name = getStringTable().get(index); } else { try { - name = new String(tmpName, US_ASCII); + int length = 0; + // find last non-NULL + for (; length < tmpName.length && tmpName[length] != '\0';) { + length++; + } + // don't include NULL chars in returned name String + name = new String(tmpName, 0, length, US_ASCII); } catch (UnsupportedEncodingException e) { throw new COFFException(e); } @@ -3487,6 +3514,7 @@ public class COFFFileParser { tmpName[5] << 16 | tmpName[6] << 8 | tmpName[7]); + // FIXME: stringOffset is assumed to be in the valid range name = getStringTable().getAtOffset(stringOffset); } @@ -3698,12 +3726,13 @@ public class COFFFileParser { StringTable(int offset) { if (offset == 0) { + // no String Table strings = new COFFString[0]; return; } seek(offset); - int length = readInt(); + int length = readInt(); // length includes itself byte[] data = new byte[length - 4]; int numBytesRead = readBytes(data); if (numBytesRead != data.length) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java index ec563f1d626..fd9d39aa5c5 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,35 +37,48 @@ public class DumpExports { String filename = args[0]; COFFFile file = COFFFileParser.getParser().parse(filename); - ExportDirectoryTable exports = - file.getHeader(). - getOptionalHeader(). - getDataDirectories(). - getExportDirectoryTable(); + + // get common point for both things we want to dump + OptionalHeaderDataDirectories dataDirs = file.getHeader().getOptionalHeader(). + getDataDirectories(); + + // dump the header data directory for the Export Table: + DataDirectory dir = dataDirs.getExportTable(); + System.out.println("Export table: RVA = " + dir.getRVA() + "/0x" + + Integer.toHexString(dir.getRVA()) + ", size = " + dir.getSize() + "/0x" + + Integer.toHexString(dir.getSize())); + + System.out.println(file.getHeader().getNumberOfSections() + " sections in file"); + for (int i = 1; i <= file.getHeader().getNumberOfSections(); i++) { + SectionHeader sec = file.getHeader().getSectionHeader(i); + System.out.println(" Section " + i + ":"); + System.out.println(" Name = '" + sec.getName() + "'"); + System.out.println(" VirtualSize = " + sec.getSize() + "/0x" + + Integer.toHexString(sec.getSize())); + System.out.println(" VirtualAddress = " + sec.getVirtualAddress() + "/0x" + + Integer.toHexString(sec.getVirtualAddress())); + System.out.println(" SizeOfRawData = " + sec.getSizeOfRawData() + "/0x" + + Integer.toHexString(sec.getSizeOfRawData())); + System.out.println(" PointerToRawData = " + sec.getPointerToRawData() + "/0x" + + Integer.toHexString(sec.getPointerToRawData())); + } + + ExportDirectoryTable exports = dataDirs.getExportDirectoryTable(); if (exports == null) { System.out.println("No exports found."); } else { - System.out.println(file.getHeader().getNumberOfSections() + " sections in file"); - for (int i = 0; i < file.getHeader().getNumberOfSections(); i++) { - System.out.println(" Section " + i + ": " + file.getHeader().getSectionHeader(1 + i).getName()); - } - - DataDirectory dir = file.getHeader().getOptionalHeader().getDataDirectories().getExportTable(); - System.out.println("Export table: RVA = 0x" + Integer.toHexString(dir.getRVA()) + - ", size = 0x" + Integer.toHexString(dir.getSize())); - System.out.println("DLL name: " + exports.getDLLName()); System.out.println("Time/date stamp 0x" + Integer.toHexString(exports.getTimeDateStamp())); System.out.println("Major version 0x" + Integer.toHexString(exports.getMajorVersion() & 0xFFFF)); System.out.println("Minor version 0x" + Integer.toHexString(exports.getMinorVersion() & 0xFFFF)); - System.out.println(exports.getNumberOfNamePointers() + " functions found"); + System.out.println(exports.getNumberOfNamePointers() + " exports found"); for (int i = 0; i < exports.getNumberOfNamePointers(); i++) { - System.out.println(" 0x" + - Integer.toHexString(exports.getExportAddress(exports.getExportOrdinal(i))) + - " " + - (exports.isExportAddressForwarder(exports.getExportOrdinal(i)) ? - ("Forwarded to " + exports.getExportAddressForwarder(exports.getExportOrdinal(i))) : - exports.getExportName(i))); + short ordinal = exports.getExportOrdinal(i); + System.out.print("[" + i + "] '" + exports.getExportName(i) + "': [" + + ordinal + "] = 0x" + Integer.toHexString(exports.getExportAddress(ordinal))); + System.out.println(exports.isExportAddressForwarder(ordinal) + ? " Forwarded to '" + exports.getExportAddressForwarder(ordinal) + "'" + : ""); } } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java index 6f026838d58..e6f42df3ac9 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +42,8 @@ public class TestParser { COFFHeader header = file.getHeader(); int numSections = header.getNumberOfSections(); System.out.println(numSections + " sections detected."); - for (int i = 0; i < numSections; i++) { - SectionHeader secHeader = header.getSectionHeader(1 + i); + for (int i = 1; i <= numSections; i++) { + SectionHeader secHeader = header.getSectionHeader(i); System.out.println(secHeader.getName()); } 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 53141a6d2d1..3e5a6aa96b6 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 (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -506,7 +506,6 @@ public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger throw new DebuggerException("Unimplemented"); } - private static String DTFWHome; private static String imagePath; private static String symbolPath; private static boolean useNativeLookup; @@ -514,81 +513,143 @@ public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger static { /* - * sawindbg.dll depends on dbgeng.dll which - * itself depends on dbghelp.dll. dbgeng.dll and dbghelp.dll. - * On systems newer than Windows 2000, these two .dlls are - * in the standard system directory so we will find them there. - * On Windows 2000 and earlier, these files do not exist. - * The user must download Debugging Tools For Windows (DTFW) - * and install it in order to use SA. + * sawindbg.dll depends on dbgeng.dll which itself depends on + * dbghelp.dll. We have to make sure that the dbgeng.dll and + * dbghelp.dll that we load are compatible with each other. We + * load both of those libraries from the same directory based + * on the theory that co-located libraries are compatible. * - * We have to make sure we use the two files from the same directory - * in case there are more than one copy on the system because - * one version of dbgeng.dll might not be compatible with a - * different version of dbghelp.dll. - * We first look for them in the directory pointed at by - * env. var. DEBUGGINGTOOLSFORWINDOWS, next in the default - * installation dir for DTFW, and lastly in the standard - * system directory. We expect that that we will find - * them in the standard system directory on all systems - * newer than Windows 2000. + * On Windows 2000 and earlier, dbgeng.dll and dbghelp.dll were + * not included as part of the standard system directory. On + * systems newer than Windows 2000, dbgeng.dll and dbghelp.dll + * are included in the standard system directory. However, the + * versions included in the standard system directory may not + * be able to handle symbol information for the newer compilers. + * + * We search for and explicitly load the libraries using the + * following directory search order: + * + * - java.home/bin (same as $JAVA_HOME/jre/bin) + * - dir named by DEBUGGINGTOOLSFORWINDOWS environment variable + * - various "Debugging Tools For Windows" program directories + * - the system directory ($SYSROOT/system32) + * + * If SA is invoked with -Dsun.jvm.hotspot.loadLibrary.DEBUG=1, + * then debug messages about library loading are printed to + * System.err. */ - String dirName = null; - DTFWHome = System.getenv("DEBUGGINGTOOLSFORWINDOWS"); - if (DTFWHome == null) { - // See if we have the files in the default location. - String sysRoot = System.getenv("SYSTEMROOT"); - DTFWHome = sysRoot + File.separator + - ".." + File.separator + "Program Files" + - File.separator + "Debugging Tools For Windows"; - } + String dbgengPath = null; + String dbghelpPath = null; + String sawindbgPath = null; + List searchList = new ArrayList(); + + boolean loadLibraryDEBUG = + System.getProperty("sun.jvm.hotspot.loadLibrary.DEBUG") != null; { - String dbghelp = DTFWHome + File.separator + "dbghelp.dll"; - String dbgeng = DTFWHome + File.separator + "dbgeng.dll"; - File fhelp = new File(dbghelp); - File feng = new File(dbgeng); - if (fhelp.exists() && feng.exists()) { - // found both, we are happy. - // NOTE: The order of loads is important! If we load dbgeng.dll - // first, then the dependency - dbghelp.dll - will be loaded - // from usual DLL search thereby defeating the purpose! - System.load(dbghelp); - System.load(dbgeng); - } else if (! fhelp.exists() && ! feng.exists()) { - // neither exist. We will ignore this dir and assume - // they are in the system dir. - DTFWHome = null; - } else { - // one exists but not the other - //System.err.println("Error: Both files dbghelp.dll and dbgeng.dll " - // "must exist in directory " + DTFWHome); - throw new UnsatisfiedLinkError("Both files dbghelp.dll and " + - "dbgeng.dll must exist in " + - "directory " + DTFWHome); - } - } - if (DTFWHome == null) { - // The files better be in the system dir. - String sysDir = System.getenv("SYSTEMROOT") + - File.separator + "system32"; + // First place to search is co-located with sawindbg.dll in + // $JAVA_HOME/jre/bin (java.home property is set to $JAVA_HOME/jre): + searchList.add(System.getProperty("java.home") + File.separator + "bin"); + sawindbgPath = (String) searchList.get(0) + File.separator + + "sawindbg.dll"; - File feng = new File(sysDir + File.separator + "dbgeng.dll"); - if (!feng.exists()) { - throw new UnsatisfiedLinkError("File dbgeng.dll does not exist in " + - sysDir + ". Please search microsoft.com " + - "for Debugging Tools For Windows, and " + - "either download it to the default " + - "location, or download it to a custom " + - "location and set environment variable " + - " DEBUGGINGTOOLSFORWINDOWS " + - "to the pathname of that location."); + // second place to search is specified by an environment variable: + String DTFWHome = System.getenv("DEBUGGINGTOOLSFORWINDOWS"); + if (DTFWHome != null) { + searchList.add(DTFWHome); } + + // The third place to search is the install directory for the + // "Debugging Tools For Windows" package; so far there are three + // name variations that we know of: + String sysRoot = System.getenv("SYSTEMROOT"); + DTFWHome = sysRoot + File.separator + ".." + File.separator + + "Program Files" + File.separator + "Debugging Tools For Windows"; + searchList.add(DTFWHome); + searchList.add(DTFWHome + " (x86)"); + searchList.add(DTFWHome + " (x64)"); + + // The last place to search is the system directory: + searchList.add(sysRoot + File.separator + "system32"); } + for (int i = 0; i < searchList.size(); i++) { + File dir = new File((String) searchList.get(i)); + if (!dir.exists()) { + if (loadLibraryDEBUG) { + System.err.println("DEBUG: '" + searchList.get(i) + + "': directory does not exist."); + } + // this search directory doesn't exist so skip it + continue; + } + + dbgengPath = (String) searchList.get(i) + File.separator + "dbgeng.dll"; + dbghelpPath = (String) searchList.get(i) + File.separator + "dbghelp.dll"; + + File feng = new File(dbgengPath); + File fhelp = new File(dbghelpPath); + if (feng.exists() && fhelp.exists()) { + // both files exist so we have a match + break; + } + + // At least one of the files does not exist; no warning if both + // don't exist. If just one doesn't exist then we don't check + // loadLibraryDEBUG because we have a mis-configured system. + if (feng.exists()) { + System.err.println("WARNING: found '" + dbgengPath + + "' but did not find '" + dbghelpPath + "'; ignoring '" + + dbgengPath + "'."); + } else if (fhelp.exists()) { + System.err.println("WARNING: found '" + dbghelpPath + + "' but did not find '" + dbgengPath + "'; ignoring '" + + dbghelpPath + "'."); + } else if (loadLibraryDEBUG) { + System.err.println("DEBUG: searched '" + searchList.get(i) + + "': dbgeng.dll and dbghelp.dll were not found."); + } + dbgengPath = null; + dbghelpPath = null; + } + + if (dbgengPath == null || dbghelpPath == null) { + // at least one of the files wasn't found anywhere we searched + String mesg = null; + + if (dbgengPath == null && dbghelpPath == null) { + mesg = "dbgeng.dll and dbghelp.dll cannot be found. "; + } else if (dbgengPath == null) { + mesg = "dbgeng.dll cannot be found (dbghelp.dll was found). "; + } else { + mesg = "dbghelp.dll cannot be found (dbgeng.dll was found). "; + } + throw new UnsatisfiedLinkError(mesg + + "Please search microsoft.com for 'Debugging Tools For Windows', " + + "and either download it to the default location, or download it " + + "to a custom location and set environment variable " + + "'DEBUGGINGTOOLSFORWINDOWS' to the pathname of that location."); + } + + // NOTE: The order of loads is important! If we load dbgeng.dll + // first, then the dependency - dbghelp.dll - will be loaded + // from usual DLL search thereby defeating the purpose! + if (loadLibraryDEBUG) { + System.err.println("DEBUG: loading '" + dbghelpPath + "'."); + } + System.load(dbghelpPath); + if (loadLibraryDEBUG) { + System.err.println("DEBUG: loading '" + dbgengPath + "'."); + } + System.load(dbgengPath); + // Now, load sawindbg.dll - System.loadLibrary("sawindbg"); + if (loadLibraryDEBUG) { + System.err.println("DEBUG: loading '" + sawindbgPath + "'."); + } + System.load(sawindbgPath); + // where do I find '.exe', '.dll' files? imagePath = System.getProperty("sun.jvm.hotspot.debugger.windbg.imagePath"); if (imagePath == null) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java index aaf216676d9..15b49869cf7 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/interpreter/BytecodeLoadConstant.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java index f08c03128d3..1633888108a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -188,7 +188,7 @@ public class BytecodeLoadConstant extends BytecodeWithCPIndex { } else { throw new RuntimeException("should not reach here"); } - } else if (ctag.isMethodHandle() || ctag.isMethodType()) { + } else if (ctag.isMethodHandle()) { Oop x = getCachedConstant(); int refidx = cpool.getMethodHandleIndexAt(cpIndex); int refkind = cpool.getMethodHandleRefKindAt(cpIndex); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java index 55aba177058..fc0730feb14 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/interpreter/Bytecodes.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java index 16e35562f74..1306dc419db 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/memory/CompactibleFreeListSpace.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java index 2733af50aa1..06f149156ce 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 (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/memory/SystemDictionary.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java index 92cd92b9115..f8bb01adb96 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ConstantPool.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java index 27872450487..31cc2a956e1 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java @@ -53,11 +53,16 @@ public class ConstantPool extends Oop implements ClassConstants { private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { Type type = db.lookupType("constantPoolOopDesc"); tags = new OopField(type.getOopField("_tags"), 0); + operands = new OopField(type.getOopField("_operands"), 0); cache = new OopField(type.getOopField("_cache"), 0); poolHolder = new OopField(type.getOopField("_pool_holder"), 0); length = new CIntField(type.getCIntegerField("_length"), 0); headerSize = type.getSize(); elementSize = 0; + // fetch constants: + INDY_BSM_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_bsm_offset").intValue(); + INDY_ARGC_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_argc_offset").intValue(); + INDY_ARGV_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_argv_offset").intValue(); } ConstantPool(OopHandle handle, ObjectHeap heap) { @@ -67,6 +72,7 @@ public class ConstantPool extends Oop implements ClassConstants { public boolean isConstantPool() { return true; } private static OopField tags; + private static OopField operands; private static OopField cache; private static OopField poolHolder; private static CIntField length; // number of elements in oop @@ -74,7 +80,12 @@ public class ConstantPool extends Oop implements ClassConstants { private static long headerSize; private static long elementSize; + private static int INDY_BSM_OFFSET; + private static int INDY_ARGC_OFFSET; + private static int INDY_ARGV_OFFSET; + public TypeArray getTags() { return (TypeArray) tags.getValue(this); } + public TypeArray getOperands() { return (TypeArray) operands.getValue(this); } public ConstantPoolCache getCache() { return (ConstantPoolCache) cache.getValue(this); } public Klass getPoolHolder() { return (Klass) poolHolder.getValue(this); } public int getLength() { return (int)length.getValue(this); } @@ -278,6 +289,28 @@ public class ConstantPool extends Oop implements ClassConstants { return res; } + /** Lookup for multi-operand (InvokeDynamic) entries. */ + public short[] getBootstrapSpecifierAt(int i) { + if (Assert.ASSERTS_ENABLED) { + Assert.that(getTagAt(i).isInvokeDynamic(), "Corrupted constant pool"); + } + if (getTagAt(i).value() == JVM_CONSTANT_InvokeDynamicTrans) + return null; + int bsmSpec = extractLowShortFromInt(this.getIntAt(i)); + TypeArray operands = getOperands(); + if (operands == null) return null; // safety first + int basePos = VM.getVM().buildIntFromShorts(operands.getShortAt(bsmSpec * 2 + 0), + operands.getShortAt(bsmSpec * 2 + 1)); + int argv = basePos + INDY_ARGV_OFFSET; + int argc = operands.getShortAt(basePos + INDY_ARGC_OFFSET); + int endPos = argv + argc; + short[] values = new short[endPos - basePos]; + for (int j = 0; j < values.length; j++) { + values[j] = operands.getShortAt(basePos+j); + } + return values; + } + final private static String[] nameForTag = new String[] { }; @@ -298,6 +331,7 @@ public class ConstantPool extends Oop implements ClassConstants { case JVM_CONSTANT_MethodHandle: return "JVM_CONSTANT_MethodHandle"; case JVM_CONSTANT_MethodType: return "JVM_CONSTANT_MethodType"; case JVM_CONSTANT_InvokeDynamic: return "JVM_CONSTANT_InvokeDynamic"; + case JVM_CONSTANT_InvokeDynamicTrans: return "JVM_CONSTANT_InvokeDynamic/transitional"; case JVM_CONSTANT_Invalid: return "JVM_CONSTANT_Invalid"; case JVM_CONSTANT_UnresolvedClass: return "JVM_CONSTANT_UnresolvedClass"; case JVM_CONSTANT_UnresolvedClassInError: return "JVM_CONSTANT_UnresolvedClassInError"; @@ -357,6 +391,7 @@ public class ConstantPool extends Oop implements ClassConstants { case JVM_CONSTANT_MethodHandle: case JVM_CONSTANT_MethodType: case JVM_CONSTANT_InvokeDynamic: + case JVM_CONSTANT_InvokeDynamicTrans: visitor.doInt(new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true); break; } @@ -520,17 +555,19 @@ public class ConstantPool extends Oop implements ClassConstants { break; } + case JVM_CONSTANT_InvokeDynamicTrans: case JVM_CONSTANT_InvokeDynamic: { dos.writeByte(cpConstType); int value = getIntAt(ci); - short bootstrapMethodIndex = (short) extractLowShortFromInt(value); + short bsmIndex = (short) extractLowShortFromInt(value); short nameAndTypeIndex = (short) extractHighShortFromInt(value); - dos.writeShort(bootstrapMethodIndex); + dos.writeShort(bsmIndex); dos.writeShort(nameAndTypeIndex); - if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + bootstrapMethodIndex + if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + bsmIndex + ", N&T = " + nameAndTypeIndex); break; } + default: throw new InternalError("unknown tag: " + cpConstType); } // switch diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java index 0b162a438af..47a3facedfa 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ConstantPoolCacheEntry.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java index c3982615ccc..48bee4b9ed1 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/GenerateOopMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java index 82a20a5c96b..04d64086740 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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 02ba1eaff90..0e7e6fcce01 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 (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ClassConstants.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java index ff7db309fe9..3a008c0b059 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java @@ -42,7 +42,8 @@ public interface ClassConstants public static final int JVM_CONSTANT_NameAndType = 12; public static final int JVM_CONSTANT_MethodHandle = 15; public static final int JVM_CONSTANT_MethodType = 16; - public static final int JVM_CONSTANT_InvokeDynamic = 17; + public static final int JVM_CONSTANT_InvokeDynamicTrans = 17; // only occurs in old class files + public static final int JVM_CONSTANT_InvokeDynamic = 18; // JVM_CONSTANT_MethodHandle subtypes public static final int JVM_REF_getField = 1; 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 3d2afd9d754..c0b31065b72 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 (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/tools/jcore/ByteCodeRewriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java index 508357f82f9..737bbc630ea 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/tools/jcore/ClassWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java index 31f37a5df46..494f1765f13 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java @@ -303,12 +303,12 @@ public class ClassWriter implements /* imports */ ClassConstants case JVM_CONSTANT_MethodHandle: { dos.writeByte(cpConstType); int value = cpool.getIntAt(ci); - short bootstrapMethodIndex = (short) extractLowShortFromInt(value); - short nameAndTypeIndex = (short) extractHighShortFromInt(value); - dos.writeShort(bootstrapMethodIndex); - dos.writeShort(nameAndTypeIndex); - if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + - bootstrapMethodIndex + ", N&T = " + nameAndTypeIndex); + byte refKind = (byte) extractLowShortFromInt(value); + short memberIndex = (short) extractHighShortFromInt(value); + dos.writeByte(refKind); + dos.writeShort(memberIndex); + if (DEBUG) debugMessage("CP[" + ci + "] = MH kind = " + + refKind + ", mem = " + memberIndex); break; } @@ -321,12 +321,16 @@ public class ClassWriter implements /* imports */ ClassConstants break; } + case JVM_CONSTANT_InvokeDynamicTrans: case JVM_CONSTANT_InvokeDynamic: { dos.writeByte(cpConstType); int value = cpool.getIntAt(ci); - short refIndex = (short) value; - dos.writeShort(refIndex); - if (DEBUG) debugMessage("CP[" + ci + "] = MT index = " + refIndex); + short bsmIndex = (short) extractLowShortFromInt(value); + short nameAndTypeIndex = (short) extractHighShortFromInt(value); + dos.writeShort(bsmIndex); + dos.writeShort(nameAndTypeIndex); + if (DEBUG) debugMessage("CP[" + ci + "] = INDY bsm = " + + bsmIndex + ", N&T = " + nameAndTypeIndex); break; } 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 e70ba946110..979d80b3062 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 @@ -30,6 +30,7 @@ import sun.jvm.hotspot.asm.*; import sun.jvm.hotspot.asm.sparc.*; import sun.jvm.hotspot.asm.x86.*; import sun.jvm.hotspot.asm.ia64.*; +import sun.jvm.hotspot.asm.amd64.*; import sun.jvm.hotspot.code.*; import sun.jvm.hotspot.compiler.*; import sun.jvm.hotspot.debugger.*; @@ -198,6 +199,8 @@ public class HTMLGenerator implements /* imports */ ClassConstants { cpuHelper = new SPARCHelper(); } else if (cpu.equals("x86")) { cpuHelper = new X86Helper(); + } else if (cpu.equals("amd64")) { + cpuHelper = new AMD64Helper(); } else if (cpu.equals("ia64")) { cpuHelper = new IA64Helper(); } else { @@ -460,6 +463,19 @@ public class HTMLGenerator implements /* imports */ ClassConstants { return buf.toString(); } + private String genListOfShort(short[] values) { + if (values == null || values.length == 0) return ""; + Formatter buf = new Formatter(genHTML); + buf.append('['); + for (int i = 0; i < values.length; i++) { + if (i > 0) buf.append(' '); + buf.append('#'); + buf.append(Integer.toString(values[i])); + } + buf.append(']'); + return buf.toString(); + } + protected String genHTMLTableForConstantPool(ConstantPool cpool) { Formatter buf = new Formatter(genHTML); buf.beginTable(1); @@ -582,9 +598,11 @@ public class HTMLGenerator implements /* imports */ ClassConstants { buf.cell(Integer.toString(cpool.getIntAt(index))); break; + case JVM_CONSTANT_InvokeDynamicTrans: case JVM_CONSTANT_InvokeDynamic: buf.cell("JVM_CONSTANT_InvokeDynamic"); - buf.cell(genLowHighShort(cpool.getIntAt(index))); + buf.cell(genLowHighShort(cpool.getIntAt(index)) + + genListOfShort(cpool.getBootstrapSpecifierAt(index))); break; default: diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java index 3f2baf3d9cc..1ee547be39c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,8 @@ public class ConstantTag { private static int JVM_CONSTANT_NameAndType = 12; private static int JVM_CONSTANT_MethodHandle = 15; // JSR 292 private static int JVM_CONSTANT_MethodType = 16; // JSR 292 - private static int JVM_CONSTANT_InvokeDynamic = 17; // JSR 292 + private static int JVM_CONSTANT_InvokeDynamicTrans = 17; // JSR 292, only occurs in old class files + private static int JVM_CONSTANT_InvokeDynamic = 18; // JSR 292 private static int JVM_CONSTANT_Invalid = 0; // For bad value initialization private static int JVM_CONSTANT_UnresolvedClass = 100; // Temporary tag until actual use private static int JVM_CONSTANT_ClassIndex = 101; // Temporary tag while constructing constant pool @@ -66,6 +67,8 @@ public class ConstantTag { this.tag = tag; } + public int value() { return tag; } + public boolean isKlass() { return tag == JVM_CONSTANT_Class; } public boolean isField () { return tag == JVM_CONSTANT_Fieldref; } public boolean isMethod() { return tag == JVM_CONSTANT_Methodref; } @@ -80,6 +83,7 @@ public class ConstantTag { public boolean isMethodHandle() { return tag == JVM_CONSTANT_MethodHandle; } public boolean isMethodType() { return tag == JVM_CONSTANT_MethodType; } public boolean isInvokeDynamic() { return tag == JVM_CONSTANT_InvokeDynamic; } + public boolean isInvokeDynamicTrans() { return tag == JVM_CONSTANT_InvokeDynamicTrans; } public boolean isInvalid() { return tag == JVM_CONSTANT_Invalid; } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js index f181bd6262a..246dbc6772b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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 528d9405bf8..48b91684ba7 100644 --- a/hotspot/make/defs.make +++ b/hotspot/make/defs.make @@ -101,15 +101,14 @@ ifndef HOTSPOT_RELEASE_VERSION endif ifdef HOTSPOT_BUILD_VERSION -# specified in command line (PRT build) +# specified in command line else - ifdef JPRT_BUILD_VERSION -# JPR build - HOTSPOT_BUILD_VERSION=$(JPRT_BUILD_VERSION) - else - ifdef COOKED_BUILD_NUMBER + ifdef COOKED_BUILD_NUMBER # JRE build - HOTSPOT_BUILD_VERSION= + HOTSPOT_BUILD_VERSION= + else + ifdef USER_RELEASE_SUFFIX + HOTSPOT_BUILD_VERSION=internal-$(USER_RELEASE_SUFFIX) else HOTSPOT_BUILD_VERSION=internal endif diff --git a/hotspot/make/hotspot_distro b/hotspot/make/hotspot_distro index fb960646c19..059f4d1f547 100644 --- a/hotspot/make/hotspot_distro +++ b/hotspot/make/hotspot_distro @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/hotspot_version b/hotspot/make/hotspot_version index dfc53081cb3..8fe599f75e4 100644 --- a/hotspot/make/hotspot_version +++ b/hotspot/make/hotspot_version @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. # 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,11 +31,11 @@ # # Don't put quotes (fail windows build). -HOTSPOT_VM_COPYRIGHT=Copyright 2010 +HOTSPOT_VM_COPYRIGHT=Copyright 2011 HS_MAJOR_VER=20 HS_MINOR_VER=0 -HS_BUILD_NUMBER=01 +HS_BUILD_NUMBER=06 JDK_MAJOR_VER=1 JDK_MINOR_VER=7 diff --git a/hotspot/make/jprt.gmk b/hotspot/make/jprt.gmk index b7f5292a1b5..8da610d7433 100644 --- a/hotspot/make/jprt.gmk +++ b/hotspot/make/jprt.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # 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,9 +25,6 @@ # JPRT rule to build this workspace JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip -ifdef JPRT_BUILD_VERSION - MILESTONE=$(JPRT_BUILD_VERSION) -endif ifeq ($(OSNAME),windows) ZIPFLAGS=-q diff --git a/hotspot/make/jprt.properties b/hotspot/make/jprt.properties index 04554aabe92..c8bbb3c6c14 100644 --- a/hotspot/make/jprt.properties +++ b/hotspot/make/jprt.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -150,6 +150,7 @@ jprt.build.targets= \ jprt.my.solaris.sparc.test.targets= \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jvm98, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-c2-jvm98_tiered, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-scimark, \ ${jprt.my.solaris.sparc}-product-{c1|c2}-runThese, \ ${jprt.my.solaris.sparc}-fastdebug-c1-runThese_Xshare, \ @@ -168,6 +169,7 @@ jprt.my.solaris.sparc.test.targets= \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_G1, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParOldGC, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_default, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-c2-jbb_default_tiered, \ ${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, \ @@ -176,6 +178,7 @@ jprt.my.solaris.sparc.test.targets= \ jprt.my.solaris.sparcv9.test.targets= \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98_tiered, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark, \ ${jprt.my.solaris.sparcv9}-product-c2-runThese, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_default, \ @@ -193,6 +196,7 @@ jprt.my.solaris.sparcv9.test.targets= \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_G1, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParOldGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_default, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_default_tiered, \ ${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, \ @@ -201,6 +205,7 @@ jprt.my.solaris.sparcv9.test.targets= \ jprt.my.solaris.x64.test.targets= \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jvm98, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jvm98_tiered, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-scimark, \ ${jprt.my.solaris.x64}-product-c2-runThese, \ ${jprt.my.solaris.x64}-product-c2-runThese_Xcomp, \ @@ -219,6 +224,7 @@ jprt.my.solaris.x64.test.targets= \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_G1, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_default, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_default_tiered, \ ${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-GCOld_CMS, \ @@ -227,6 +233,7 @@ jprt.my.solaris.x64.test.targets= \ jprt.my.solaris.i586.test.targets= \ ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-jvm98, \ + ${jprt.my.solaris.i586}-{product|fastdebug}-c2-jvm98_tiered, \ ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-scimark, \ ${jprt.my.solaris.i586}-product-{c1|c2}-runThese_Xcomp, \ ${jprt.my.solaris.i586}-fastdebug-c1-runThese_Xcomp, \ @@ -253,6 +260,7 @@ jprt.my.solaris.i586.test.targets= \ ${jprt.my.solaris.i586}-product-c1-GCOld_G1, \ ${jprt.my.solaris.i586}-product-c1-GCOld_ParOldGC, \ ${jprt.my.solaris.i586}-fastdebug-c2-jbb_default, \ + ${jprt.my.solaris.i586}-fastdebug-c2-jbb_default_tiered, \ ${jprt.my.solaris.i586}-fastdebug-c2-jbb_ParallelGC, \ ${jprt.my.solaris.i586}-fastdebug-c2-jbb_CMS, \ ${jprt.my.solaris.i586}-fastdebug-c2-jbb_G1, \ @@ -260,6 +268,7 @@ jprt.my.solaris.i586.test.targets= \ jprt.my.linux.i586.test.targets = \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-jvm98, \ + ${jprt.my.linux.i586}-{product|fastdebug}-c2-jvm98_tiered, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-scimark, \ ${jprt.my.linux.i586}-product-c1-runThese_Xcomp, \ ${jprt.my.linux.i586}-fastdebug-c1-runThese_Xshare, \ @@ -279,6 +288,7 @@ jprt.my.linux.i586.test.targets = \ ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_G1, \ ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParOldGC, \ ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_default, \ + ${jprt.my.linux.i586}-{product|fastdebug}-c2-jbb_default_tiered, \ ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_ParallelGC, \ ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_CMS, \ ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_G1, \ @@ -286,6 +296,7 @@ jprt.my.linux.i586.test.targets = \ jprt.my.linux.x64.test.targets = \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-jvm98, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-jvm98_tiered, \ ${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, \ @@ -302,12 +313,14 @@ jprt.my.linux.x64.test.targets = \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_G1, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_default, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_default_tiered, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_G1, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_ParOldGC jprt.my.windows.i586.test.targets = \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jvm98, \ + ${jprt.my.windows.i586}-{product|fastdebug}-c2-jvm98_tiered, \ ${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, \ @@ -327,6 +340,7 @@ jprt.my.windows.i586.test.targets = \ ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_G1, \ ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_ParOldGC, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jbb_default, \ + ${jprt.my.windows.i586}-{product|fastdebug}-c2-jbb_default_tiered, \ ${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}-jbb_G1, \ @@ -334,6 +348,7 @@ jprt.my.windows.i586.test.targets = \ jprt.my.windows.x64.test.targets = \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-jvm98, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-jvm98_tiered, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark, \ ${jprt.my.windows.x64}-product-c2-runThese, \ ${jprt.my.windows.x64}-product-c2-runThese_Xcomp, \ @@ -351,6 +366,7 @@ jprt.my.windows.x64.test.targets = \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_G1, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-jbb_default, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-jbb_default_tiered, \ ${jprt.my.windows.x64}-product-c2-jbb_CMS, \ ${jprt.my.windows.x64}-product-c2-jbb_ParallelGC, \ ${jprt.my.windows.x64}-product-c2-jbb_G1, \ diff --git a/hotspot/make/linux/Makefile b/hotspot/make/linux/Makefile index 3187fb914b8..93d83ea2f81 100644 --- a/hotspot/make/linux/Makefile +++ b/hotspot/make/linux/Makefile @@ -62,7 +62,9 @@ endif include $(GAMMADIR)/make/$(OSNAME)/makefiles/rules.make ifndef CC_INTERP -FORCE_TIERED=1 + ifndef FORCE_TIERED + FORCE_TIERED=1 + endif endif ifdef LP64 @@ -254,7 +256,7 @@ $(SUBDIRS_TIERED): $(BUILDTREE_MAKE) $(BUILDTREE) VARIANT=tiered $(SUBDIRS_C2): $(BUILDTREE_MAKE) -ifdef FORCE_TIERED +ifeq ($(FORCE_TIERED),1) $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks $(BUILDTREE) VARIANT=tiered FORCE_TIERED=1 else diff --git a/hotspot/make/linux/adlc_updater b/hotspot/make/linux/adlc_updater index b54f783d6ee..6d31b792c05 100644 --- a/hotspot/make/linux/adlc_updater +++ b/hotspot/make/linux/adlc_updater @@ -15,5 +15,6 @@ fix_lines() { ' F2=$2 mv $1+ $1 } -[ -f $3/$1 ] && (fix_lines $2/$1 $3/$1; cmp -s $2/$1 $3/$1) || \ +fix_lines $2/$1 $3/$1 +[ -f $3/$1 ] && cmp -s $2/$1 $3/$1 || \ ( [ -f $3/$1 ] && echo Updating $3/$1 ; touch $2/made-change ; mv $2/$1 $3/$1 ) diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make index 35b7a89ccff..a4d2babb4b8 100644 --- a/hotspot/make/linux/makefiles/adlc.make +++ b/hotspot/make/linux/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # 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,16 +42,14 @@ SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \ $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad -Src_Dirs += $(GAMMADIR)/src/share/vm/adlc - EXEC = $(OUTDIR)/adlc # set VPATH so make knows where to look for source files -Src_Dirs_V = ${Src_Dirs} $(GENERATED)/incls -VPATH += $(Src_Dirs_V:%=%:) +Src_Dirs_V += $(GAMMADIR)/src/share/vm/adlc +VPATH += $(Src_Dirs_V:%=%:) # set INCLUDES for C preprocessor -Src_Dirs_I = ${Src_Dirs} $(GENERATED) +Src_Dirs_I += $(GAMMADIR)/src/share/vm/adlc $(GENERATED) INCLUDES += $(Src_Dirs_I:%=-I%) # set flags for adlc compilation diff --git a/hotspot/make/linux/makefiles/amd64.make b/hotspot/make/linux/makefiles/amd64.make index b6f1f2f18fc..ecdac17ee3a 100644 --- a/hotspot/make/linux/makefiles/amd64.make +++ b/hotspot/make/linux/makefiles/amd64.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. # 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,9 +22,6 @@ # # -# Not included in includeDB because it has no dependencies -Obj_Files += linux_x86_64.o - # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) # The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized diff --git a/hotspot/make/linux/makefiles/build_vm_def.sh b/hotspot/make/linux/makefiles/build_vm_def.sh index 2b6f906eee8..fb9a0d57a78 100644 --- a/hotspot/make/linux/makefiles/build_vm_def.sh +++ b/hotspot/make/linux/makefiles/build_vm_def.sh @@ -1,7 +1,7 @@ #!/bin/sh # If we're cross compiling use that path for nm -if [ "$ALT_COMPILER_PATH" != "" ]; then +if [ "$CROSS_COMPILE_ARCH" != "" ]; then NM=$ALT_COMPILER_PATH/nm else NM=nm diff --git a/hotspot/make/linux/makefiles/buildtree.make b/hotspot/make/linux/makefiles/buildtree.make index af34617f46c..4ba1f0e74b4 100644 --- a/hotspot/make/linux/makefiles/buildtree.make +++ b/hotspot/make/linux/makefiles/buildtree.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # 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 @@ # OS_FAMILY - operating system # VARIANT - core, compiler1, compiler2, or tiered # HOTSPOT_RELEASE_VERSION - .-b (11.0-b07) -# HOTSPOT_BUILD_VERSION - internal, PRTjob ID, JPRTjob ID +# HOTSPOT_BUILD_VERSION - internal, internal-$(USER_RELEASE_SUFFIX) or empty # JRE_RELEASE_VERSION - .. (1.7.0) # # Builds the directory trees with makefiles plus some convenience files in @@ -113,7 +113,7 @@ endif COMPILER = $(shell sed -n 's/^compiler[ ]*=[ ]*//p' $(PLATFORM_FILE)) SIMPLE_DIRS = \ - $(PLATFORM_DIR)/generated/incls \ + $(PLATFORM_DIR)/generated/dependencies \ $(PLATFORM_DIR)/generated/adfiles \ $(PLATFORM_DIR)/generated/jvmtifiles @@ -124,7 +124,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS)) BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \ - env.sh env.csh .dbxrc test_gamma + env.sh env.csh jdkpath.sh .dbxrc test_gamma BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) @@ -197,11 +197,27 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \ echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \ echo; \ - echo "Src_Dirs = \\"; \ + echo "# Used for platform dispatching"; \ + echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \ + echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \ + echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \ + echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \ + echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \ + echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \ + echo "CFLAGS += \$$(TARGET_DEFINES)"; \ + echo; \ + echo "Src_Dirs_V = \\"; \ sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ + echo; \ + echo "Src_Dirs_I = \\"; \ + echo "\$$(GAMMADIR)/src/share/vm \\"; \ + echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \ + echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ + echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ + echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ [ -n "$(CFLAGS_BROWSE)" ] && \ echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \ [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \ @@ -302,6 +318,13 @@ env.csh: env.sh sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \ ) > $@ +jdkpath.sh: $(BUILDTREE_MAKE) + @echo Creating $@ ... + $(QUIETLY) ( \ + $(BUILDTREE_COMMENT); \ + echo "JDK=${JAVA_HOME}"; \ + ) > $@ + .dbxrc: $(BUILDTREE_MAKE) @echo Creating $@ ... $(QUIETLY) ( \ diff --git a/hotspot/make/linux/makefiles/core.make b/hotspot/make/linux/makefiles/core.make index eb662de79cb..e032d964f57 100644 --- a/hotspot/make/linux/makefiles/core.make +++ b/hotspot/make/linux/makefiles/core.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # 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,8 +24,7 @@ # Sets make macros for making core version of VM -# Note the effect on includeDB lists in top.make: -# includeDB_compiler* and ad_.*pp are excluded from the build, +# Select which files to use (in top.make) TYPE=CORE # There is no "core" directory in JDK. Install core build in server directory. diff --git a/hotspot/make/linux/makefiles/defs.make b/hotspot/make/linux/makefiles/defs.make index 561f7f58107..88329a6f583 100644 --- a/hotspot/make/linux/makefiles/defs.make +++ b/hotspot/make/linux/makefiles/defs.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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 7107858f7d9..aa879b10fc3 100644 --- a/hotspot/make/linux/makefiles/gcc.make +++ b/hotspot/make/linux/makefiles/gcc.make @@ -25,7 +25,9 @@ #------------------------------------------------------------------------ # CC, CPP & AS -ifdef ALT_COMPILER_PATH +# When cross-compiling the ALT_COMPILER_PATH points +# to the cross-compilation toolset +ifdef CROSS_COMPILE_ARCH CPP = $(ALT_COMPILER_PATH)/g++ CC = $(ALT_COMPILER_PATH)/gcc else @@ -42,9 +44,13 @@ CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2) # check for precompiled headers support ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0" +# Allow the user to turn off precompiled headers from the command line. +ifneq ($(USE_PRECOMPILED_HEADER),0) USE_PRECOMPILED_HEADER=1 PRECOMPILED_HEADER_DIR=. -PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/incls/_precompiled.incl.gch +PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled.hpp +PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch +endif endif @@ -144,6 +150,16 @@ ifneq "$(shell expr \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) = 3 \) \) OPT_CFLAGS/mulnode.o += -O0 endif +# Flags for generating make dependency flags. +ifneq ("${CC_VER_MAJOR}", "2") +DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d) +endif + +# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. +ifneq ($(USE_PRECOMPILED_HEADER),1) +CFLAGS += -DDONT_USE_PRECOMPILED_HEADER +endif + #------------------------------------------------------------------------ # Linker flags diff --git a/hotspot/make/linux/makefiles/i486.make b/hotspot/make/linux/makefiles/i486.make index 6764e2d5d1f..86e825d3e9d 100644 --- a/hotspot/make/linux/makefiles/i486.make +++ b/hotspot/make/linux/makefiles/i486.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,6 @@ # # TLS helper, assembled from .s file -# Not included in includeDB because it has no dependencies -Obj_Files += linux_x86_32.o # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) diff --git a/hotspot/make/linux/makefiles/jvmti.make b/hotspot/make/linux/makefiles/jvmti.make index 7694b1c9b15..43cdb9d8789 100644 --- a/hotspot/make/linux/makefiles/jvmti.make +++ b/hotspot/make/linux/makefiles/jvmti.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. # 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,11 +37,10 @@ JvmtiOutDir = $(GENERATED)/jvmtifiles JvmtiSrcDir = $(GAMMADIR)/src/share/vm/prims InterpreterSrcDir = $(GAMMADIR)/src/share/vm/interpreter -Src_Dirs += $(JvmtiSrcDir) # set VPATH so make knows where to look for source files -Src_Dirs_V = ${Src_Dirs} -VPATH += $(Src_Dirs_V:%=%:) +Src_Dirs_V += $(JvmtiSrcDir) +VPATH += $(Src_Dirs_V:%=%:) JvmtiGeneratedNames = \ jvmtiEnv.hpp \ diff --git a/hotspot/make/linux/makefiles/launcher.make b/hotspot/make/linux/makefiles/launcher.make index 52ba511aea9..d9e34406bcb 100644 --- a/hotspot/make/linux/makefiles/launcher.make +++ b/hotspot/make/linux/makefiles/launcher.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # 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,19 +24,23 @@ # Rules to build gamma launcher, used by vm.make -# gamma[_g]: launcher +LAUNCHER_SCRIPT = hotspot LAUNCHER = gamma -LAUNCHER_G = $(LAUNCHER)$(G_SUFFIX) -LAUNCHERDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher -LAUNCHERFLAGS = $(ARCHFLAG) \ +LAUNCHERDIR := $(GAMMADIR)/src/os/posix/launcher +LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher +LAUNCHERFLAGS := $(ARCHFLAG) \ -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \ + -I$(LAUNCHERDIR_SHARE) \ -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ + -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \ + -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \ -DARCH=\"$(LIBARCH)\" \ -DGAMMA \ -DLAUNCHER_TYPE=\"gamma\" \ - -DLINK_INTO_$(LINK_INTO) + -DLINK_INTO_$(LINK_INTO) \ + $(TARGET_DEFINES) ifeq ($(LINK_INTO),AOUT) LAUNCHER.o = launcher.o $(JVM_OBJ_FILES) @@ -55,22 +59,35 @@ LINK_LAUNCHER = $(LINK.c) LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CC/PRE_HOOK) LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CC/POST_HOOK) -launcher.o: launcher.c $(LAUNCHERDIR)/java.c $(LAUNCHERDIR)/java_md.c - $(CC) -g -c -o $@ launcher.c $(LAUNCHERFLAGS) $(CPPFLAGS) +LAUNCHER_OUT = launcher -launcher.c: - @echo Generating $@ - $(QUIETLY) { \ - echo '#define debug launcher_debug'; \ - echo '#include "java.c"'; \ - echo '#include "java_md.c"'; \ - } > $@ +SUFFIXES += .d + +SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c") +SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c") + +OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE)) + +DEPFILES := $(patsubst %.o,%.d,$(OBJS)) +-include $(DEPFILES) + +$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c + $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } + $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS) + +$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c + $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } + $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS) + +$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE) + $(QUIETLY) echo Linking launcher... + $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK) + $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER) + $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK) + +$(LAUNCHER): $(LAUNCHER_SCRIPT) + +$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script + $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@ + $(QUIETLY) chmod +x $@ -$(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE) - $(QUIETLY) { \ - echo Linking launcher...; \ - $(LINK_LAUNCHER/PRE_HOOK) \ - $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER); \ - $(LINK_LAUNCHER/POST_HOOK) \ - [ -f $(LAUNCHER_G) ] || { ln -s $@ $(LAUNCHER_G); }; \ - } diff --git a/hotspot/make/linux/makefiles/mapfile-vers-debug b/hotspot/make/linux/makefiles/mapfile-vers-debug index edd213ea194..a7ba4583ee9 100644 --- a/hotspot/make/linux/makefiles/mapfile-vers-debug +++ b/hotspot/make/linux/makefiles/mapfile-vers-debug @@ -3,7 +3,7 @@ # # -# Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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 4cc8f15735d..7f7e279aa2f 100644 --- a/hotspot/make/linux/makefiles/mapfile-vers-product +++ b/hotspot/make/linux/makefiles/mapfile-vers-product @@ -3,7 +3,7 @@ # # -# Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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 ff768b6a6bd..379685f5f51 100644 --- a/hotspot/make/linux/makefiles/product.make +++ b/hotspot/make/linux/makefiles/product.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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 73f2eb44d7e..4ce9e3db872 100644 --- a/hotspot/make/linux/makefiles/rules.make +++ b/hotspot/make/linux/makefiles/rules.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. # 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,20 +151,20 @@ ifdef LP64 %.o: %.cpp @echo Compiling $< $(QUIETLY) $(REMOVE_TARGET) - $(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE) + $(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -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)) + $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \ + $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)) endif %.o: %.s @echo Assembling $< $(QUIETLY) $(REMOVE_TARGET) - $(QUIETLY) $(AS.S) -o $@ $< $(COMPILE_DONE) + $(QUIETLY) $(AS.S) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE) %.s: %.cpp @echo Generating assembly for $< diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make index bc4fc66c5fa..68ec2378ad4 100644 --- a/hotspot/make/linux/makefiles/saproc.make +++ b/hotspot/make/linux/makefiles/saproc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -55,10 +55,12 @@ endif # if $(AGENT_DIR) does not exist, we don't build SA # also, we don't build SA on Itanium, PPC, ARM or zero. -checkAndBuildSA: - $(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "arm" -a "$(SRCARCH)" != "ppc" -a "$(SRCARCH)" != "zero" ] ; then \ - $(MAKE) -f vm.make $(LIBSAPROC); \ - fi +ifneq ($(wildcard $(AGENT_DIR)),) +ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),) + BUILDLIBSAPROC = $(LIBSAPROC) +endif +endif + SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE) @@ -81,10 +83,10 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) -lthread_db $(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); } -install_saproc: checkAndBuildSA +install_saproc: $(BUILDLIBSAPROC) $(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \ echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \ cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \ fi -.PHONY: checkAndBuildSA install_saproc +.PHONY: install_saproc diff --git a/hotspot/make/linux/makefiles/shark.make b/hotspot/make/linux/makefiles/shark.make index f767a805039..ca702ee6616 100644 --- a/hotspot/make/linux/makefiles/shark.make +++ b/hotspot/make/linux/makefiles/shark.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright 2008, 2010 Red Hat, Inc. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # diff --git a/hotspot/make/linux/makefiles/sparc.make b/hotspot/make/linux/makefiles/sparc.make index ef5b122eab4..ddb05132fab 100644 --- a/hotspot/make/linux/makefiles/sparc.make +++ b/hotspot/make/linux/makefiles/sparc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # 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,6 +22,3 @@ # # -# Not included in includeDB because it has no dependencies -Obj_Files += linux_sparc.o - diff --git a/hotspot/make/linux/makefiles/sparcWorks.make b/hotspot/make/linux/makefiles/sparcWorks.make index 900c7ddea00..77076fff16c 100644 --- a/hotspot/make/linux/makefiles/sparcWorks.make +++ b/hotspot/make/linux/makefiles/sparcWorks.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -74,6 +74,14 @@ CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) OPT_CFLAGS+=-xO4 OPT_CFLAGS/NOOPT=-xO0 +# Flags for creating the dependency files. +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) +DEPFLAGS = -xMMD -xMF $(DEP_DIR)/$(@:%=%.d) +endif + +# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. +CFLAGS += -DDONT_USE_PRECOMPILED_HEADER + #------------------------------------------------------------------------ # Linker flags diff --git a/hotspot/make/linux/makefiles/sparcv9.make b/hotspot/make/linux/makefiles/sparcv9.make index 8687dfb4bb1..b9e4e525d76 100644 --- a/hotspot/make/linux/makefiles/sparcv9.make +++ b/hotspot/make/linux/makefiles/sparcv9.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -21,10 +21,6 @@ # questions. # -# -# Not included in includeDB because it has no dependencies -Obj_Files += linux_sparc.o - # gcc 4.0 miscompiles this code in -m64 OPT_CFLAGS/macro.o = -O0 diff --git a/hotspot/make/linux/makefiles/top.make b/hotspot/make/linux/makefiles/top.make index c9988f6aba7..db9224fc215 100644 --- a/hotspot/make/linux/makefiles/top.make +++ b/hotspot/make/linux/makefiles/top.make @@ -31,7 +31,7 @@ # -generate sa-jdi.jar (JDI binding to core files) # It assumes the following flags are set: -# CFLAGS Platform_file, Src_Dirs, SYSDEFS, AOUT, Obj_Files +# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Obj_Files # -- D. Ungar (5/97) from a file by Bill Bush @@ -45,10 +45,6 @@ VM = $(GAMMADIR)/src/share/vm Plat_File = $(Platform_file) CDG = cd $(GENERATED); -# Pick up MakeDeps' sources and definitions -include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/makedeps.make -MakeDepsClass = MakeDeps.class - ifdef USE_PRECOMPILED_HEADER PrecompiledOption = -DUSE_PRECOMPILED_HEADER UpdatePCH = $(MAKE) -f vm.make $(PRECOMPILED_HEADER) $(MFLAGS) @@ -57,33 +53,7 @@ UpdatePCH = \# precompiled header is not used PrecompiledOption = endif -MakeDeps = $(RUN.JAVA) $(PrecompiledOption) -classpath $(GENERATED) MakeDeps - -Include_DBs/GC = $(VM)/includeDB_gc \ - $(VM)/includeDB_gc_parallel \ - $(VM)/gc_implementation/includeDB_gc_parallelScavenge \ - $(VM)/gc_implementation/includeDB_gc_concurrentMarkSweep \ - $(VM)/gc_implementation/includeDB_gc_parNew \ - $(VM)/gc_implementation/includeDB_gc_g1 \ - $(VM)/gc_implementation/includeDB_gc_serial \ - $(VM)/gc_implementation/includeDB_gc_shared - -Include_DBs/CORE = $(VM)/includeDB_core $(Include_DBs/GC) \ - $(VM)/includeDB_jvmti \ - $(VM)/includeDB_features -Include_DBs/COMPILER1 = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 -Include_DBs/COMPILER2 = $(Include_DBs/CORE) $(VM)/includeDB_compiler2 -Include_DBs/TIERED = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 $(VM)/includeDB_compiler2 -Include_DBs/ZERO = $(Include_DBs/CORE) $(VM)/includeDB_zero -Include_DBs/SHARK = $(Include_DBs/ZERO) $(VM)/includeDB_shark -Include_DBs = $(Include_DBs/$(TYPE)) - Cached_plat = $(GENERATED)/platform.current -Cached_db = $(GENERATED)/includeDB.current - -Incremental_Lists = $(Cached_db) -# list generation also creates $(GENERATED)/$(Cached_plat) - AD_Dir = $(GENERATED)/adfiles ADLC = $(AD_Dir)/adlc @@ -102,7 +72,7 @@ adjust-mflags = $(GENERATED)/adjust-mflags MFLAGS-adjusted = -r `$(adjust-mflags) "$(MFLAGS)" "$(HOTSPOT_BUILD_JOBS)"` -# default target: make makeDeps, update lists, make vm +# default target: update lists, make vm # done in stages to force sequential order with parallel make # @@ -110,39 +80,18 @@ default: vm_build_preliminaries the_vm @echo All done. # This is an explicit dependency for the sake of parallel makes. -vm_build_preliminaries: checks $(Incremental_Lists) $(AD_Files_If_Required) jvmti_stuff sa_stuff +vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff sa_stuff @# We need a null action here, so implicit rules don't get consulted. -# make makeDeps: (and zap the cached db files to force a nonincremental run) - -$(GENERATED)/$(MakeDepsClass): $(MakeDepsSources) - @$(REMOTE) $(COMPILE.JAVAC) -classpath $(GAMMADIR)/src/share/tools/MakeDeps -d $(GENERATED) $(MakeDepsSources) - @echo Removing $(Incremental_Lists) to force regeneration. - @rm -f $(Incremental_Lists) - @$(CDG) echo >$(Cached_plat) - -# make incremental_lists, if cached files out of date, run makeDeps - -$(Incremental_Lists): $(Include_DBs) $(Plat_File) $(GENERATED)/$(MakeDepsClass) - $(CDG) cat $(Include_DBs) > $(GENERATED)/includeDB - $(CDG) if [ ! -r incls ] ; then \ - mkdir incls ; \ - fi - $(CDG) (echo $(CDG) echo $(MakeDeps) diffs UnixPlatform $(Cached_plat) $(Cached_db) $(Plat_File) $(GENERATED)/includeDB $(MakeDepsOptions)) > makeDeps.sh - $(CDG) $(REMOTE) sh $(GENERATED)/makeDeps.sh - $(CDG) cp includeDB $(Cached_db) +$(Cached_plat): $(Plat_File) $(CDG) cp $(Plat_File) $(Cached_plat) -# symbolic target for command lines -lists: $(Incremental_Lists) - @: lists are now up to date - # make AD files as necessary -ad_stuff: $(Incremental_Lists) $(adjust-mflags) +ad_stuff: $(Cached_plat) $(adjust-mflags) @$(MAKE) -f adlc.make $(MFLAGS-adjusted) # generate JVMTI files from the spec -jvmti_stuff: $(Incremental_Lists) $(adjust-mflags) +jvmti_stuff: $(Cached_plat) $(adjust-mflags) @$(MAKE) -f jvmti.make $(MFLAGS-adjusted) # generate SA jar files and native header @@ -169,7 +118,7 @@ the_vm: vm_build_preliminaries $(adjust-mflags) install: the_vm @$(MAKE) -f vm.make install -# next rules support "make foo.[oi]" +# next rules support "make foo.[ois]" %.o %.i %.s: $(UpdatePCH) @@ -179,7 +128,6 @@ install: the_vm # this should force everything to be rebuilt clean: rm -f $(GENERATED)/*.class - $(MAKE) $(MFLAGS) $(GENERATED)/$(MakeDepsClass) $(MAKE) -f vm.make $(MFLAGS) clean # just in case it doesn't, this should do it diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make index 92add561f09..653da7de6a7 100644 --- a/hotspot/make/linux/makefiles/vm.make +++ b/hotspot/make/linux/makefiles/vm.make @@ -35,9 +35,10 @@ default: build # Defs GENERATED = ../generated +DEP_DIR = $(GENERATED)/dependencies -# read a generated file defining the set of .o's and the .o .h dependencies -include $(GENERATED)/Dependencies +# reads the generated files defining the set of .o's and the .o .h dependencies +-include $(DEP_DIR)/*.d # read machine-specific adjustments (%%% should do this via buildtree.make?) ifeq ($(ZERO_BUILD), true) @@ -47,16 +48,16 @@ else endif # set VPATH so make knows where to look for source files -# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm -# The incls directory contains generated header file lists for inclusion. +# Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm # The adfiles directory contains ad_.[ch]pp. # The jvmtifiles directory contains jvmti*.[ch]pp -Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls -VPATH += $(Src_Dirs_V:%=%:) +Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles +VPATH += $(Src_Dirs_V:%=%:) -# set INCLUDES for C preprocessor -Src_Dirs_I = $(PRECOMPILED_HEADER_DIR) $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED) -INCLUDES += $(Src_Dirs_I:%=-I%) +# set INCLUDES for C preprocessor. +Src_Dirs_I += $(GENERATED) +# The order is important for the precompiled headers to work. +INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%) ifeq (${VERSION}, debug) SYMFLAG = -g @@ -118,6 +119,64 @@ JVM = jvm LIBJVM = lib$(JVM).so LIBJVM_G = lib$(JVM)$(G_SUFFIX).so +CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)) +CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm +CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm +CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm +CORE_PATHS += $(GENERATED)/jvmtifiles + +COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1 + +COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto +COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt +COMPILER2_PATHS += $(GENERATED)/adfiles + +# Include dirs per type. +Src_Dirs/CORE := $(CORE_PATHS) +Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS) +Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS) +Src_Dirs/TIERED := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS) +Src_Dirs/ZERO := $(CORE_PATHS) +Src_Dirs/SHARK := $(CORE_PATHS) +Src_Dirs := $(Src_Dirs/$(TYPE)) + +COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\* +COMPILER1_SPECIFIC_FILES := c1_\* +SHARK_SPECIFIC_FILES := shark +ZERO_SPECIFIC_FILES := zero + +# Always exclude these. +Src_Files_EXCLUDE := jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp + +# Exclude per type. +Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp +Src_Files_EXCLUDE/COMPILER1 := $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp +Src_Files_EXCLUDE/COMPILER2 := $(COMPILER1_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) +Src_Files_EXCLUDE/TIERED := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) +Src_Files_EXCLUDE/ZERO := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp +Src_Files_EXCLUDE/SHARK := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) + +Src_Files_EXCLUDE += $(Src_Files_EXCLUDE/$(TYPE)) + +# Special handling of arch model. +ifeq ($(Platform_arch_model), x86_32) +Src_Files_EXCLUDE += \*x86_64\* +endif +ifeq ($(Platform_arch_model), x86_64) +Src_Files_EXCLUDE += \*x86_32\* +endif + +# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE. +define findsrc + $(notdir $(shell find $(1)/. ! -name . -prune \ + -a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \ + -a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \))) +endef + +Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e))) + +Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files)))) + JVM_OBJ_FILES = $(Obj_Files) vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES)) @@ -180,10 +239,10 @@ endif LINK_VM = $(LINK_LIB.c) # rule for building precompiled header -$(PRECOMPILED_HEADER): $(Precompiled_Files) +$(PRECOMPILED_HEADER): $(QUIETLY) echo Generating precompiled header $@ - $(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)/incls - $(QUIETLY) $(COMPILE.CC) -x c++-header -c $(GENERATED)/incls/_precompiled.incl -o $@ $(COMPILE_DONE) + $(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR) + $(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -x c++-header $(PRECOMPILED_HEADER_SRC) -o $@ $(COMPILE_DONE) # making the library: @@ -252,7 +311,7 @@ include $(MAKEFILES_DIR)/saproc.make #---------------------------------------------------------------------- -build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) checkAndBuildSA +build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) install: install_jvm install_jsig install_saproc diff --git a/hotspot/make/linux/makefiles/zero.make b/hotspot/make/linux/makefiles/zero.make index 6de6d0e6374..0270711f5cb 100644 --- a/hotspot/make/linux/makefiles/zero.make +++ b/hotspot/make/linux/makefiles/zero.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright 2009 Red Hat, Inc. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # @@ -25,7 +25,7 @@ # Setup for Zero (non-Shark) version of VM -# Select which includeDB files to use (in top.make) +# Select which files to use (in top.make) TYPE = ZERO # Install libjvm.so, etc in in server directory. diff --git a/hotspot/make/solaris/Makefile b/hotspot/make/solaris/Makefile index 622ddd1f884..d4bcb90f57a 100644 --- a/hotspot/make/solaris/Makefile +++ b/hotspot/make/solaris/Makefile @@ -53,7 +53,9 @@ endif include $(GAMMADIR)/make/$(OSNAME)/makefiles/rules.make ifndef CC_INTERP -FORCE_TIERED=1 + ifndef FORCE_TIERED + FORCE_TIERED=1 + endif endif ifdef LP64 @@ -210,7 +212,7 @@ $(SUBDIRS_TIERED): $(BUILDTREE_MAKE) $(BUILDTREE) VARIANT=tiered $(SUBDIRS_C2): $(BUILDTREE_MAKE) -ifdef FORCE_TIERED +ifeq ($(FORCE_TIERED),1) $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks $(BUILDTREE) VARIANT=tiered FORCE_TIERED=1 else diff --git a/hotspot/make/solaris/adlc_updater b/hotspot/make/solaris/adlc_updater index b54f783d6ee..6d31b792c05 100644 --- a/hotspot/make/solaris/adlc_updater +++ b/hotspot/make/solaris/adlc_updater @@ -15,5 +15,6 @@ fix_lines() { ' F2=$2 mv $1+ $1 } -[ -f $3/$1 ] && (fix_lines $2/$1 $3/$1; cmp -s $2/$1 $3/$1) || \ +fix_lines $2/$1 $3/$1 +[ -f $3/$1 ] && cmp -s $2/$1 $3/$1 || \ ( [ -f $3/$1 ] && echo Updating $3/$1 ; touch $2/made-change ; mv $2/$1 $3/$1 ) diff --git a/hotspot/make/solaris/makefiles/adlc.make b/hotspot/make/solaris/makefiles/adlc.make index 35cce4b99cf..7fc55b9d39e 100644 --- a/hotspot/make/solaris/makefiles/adlc.make +++ b/hotspot/make/solaris/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. # 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,16 +42,14 @@ SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \ $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad -Src_Dirs += $(GAMMADIR)/src/share/vm/adlc - EXEC = $(OUTDIR)/adlc # set VPATH so make knows where to look for source files -Src_Dirs_V = ${Src_Dirs} $(GENERATED)/incls -VPATH += $(Src_Dirs_V:%=%:) +Src_Dirs_V += $(GAMMADIR)/src/share/vm/adlc +VPATH += $(Src_Dirs_V:%=%:) # set INCLUDES for C preprocessor -Src_Dirs_I = ${Src_Dirs} $(GENERATED) +Src_Dirs_I += $(GAMMADIR)/src/share/vm/adlc $(GENERATED) INCLUDES += $(Src_Dirs_I:%=-I%) # set flags for adlc compilation diff --git a/hotspot/make/solaris/makefiles/amd64.make b/hotspot/make/solaris/makefiles/amd64.make index d9ca84a6e67..f88d743fe7c 100644 --- a/hotspot/make/solaris/makefiles/amd64.make +++ b/hotspot/make/solaris/makefiles/amd64.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # 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,9 +25,6 @@ # Must also specify if CPU is little endian CFLAGS += -DVM_LITTLE_ENDIAN -# Not included in includeDB because it has no dependencies -Obj_Files += solaris_x86_64.o - # # Special case flags for compilers and compiler versions on amd64. # @@ -35,7 +32,8 @@ ifeq ("${Platform_compiler}", "sparcWorks") # Temporary until SS10 C++ compiler is fixed OPT_CFLAGS/generateOptoStub.o = -xO2 - +# Temporary util SS12u1 C++ compiler is fixed +OPT_CFLAGS/c1_LinearScan.o = -xO2 else ifeq ("${Platform_compiler}", "gcc") diff --git a/hotspot/make/solaris/makefiles/buildtree.make b/hotspot/make/solaris/makefiles/buildtree.make index a505963a252..08224ef1103 100644 --- a/hotspot/make/solaris/makefiles/buildtree.make +++ b/hotspot/make/solaris/makefiles/buildtree.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. # 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 @@ # OS_FAMILY - operating system # VARIANT - core, compiler1, compiler2, or tiered # HOTSPOT_RELEASE_VERSION - .-b (11.0-b07) -# HOTSPOT_BUILD_VERSION - internal, PRTjob ID, JPRTjob ID +# HOTSPOT_BUILD_VERSION - internal, internal-$(USER_RELEASE_SUFFIX) or empty # JRE_RELEASE_VERSION - .. (1.7.0) # # Builds the directory trees with makefiles plus some convenience files in @@ -61,7 +61,7 @@ include $(GAMMADIR)/make/scm.make QUIETLY$(MAKE_VERBOSE) = @ # For now, until the compiler is less wobbly: -TESTFLAGS = -Xbatch -showversion +TESTFLAGS = -Xbatch -Xmx32m -showversion ### maye ARCH_XXX instead? ifdef USE_GCC @@ -106,7 +106,7 @@ endif COMPILER = $(shell sed -n 's/^compiler[ ]*=[ ]*//p' $(PLATFORM_FILE)) SIMPLE_DIRS = \ - $(PLATFORM_DIR)/generated/incls \ + $(PLATFORM_DIR)/generated/dependencies \ $(PLATFORM_DIR)/generated/adfiles \ $(PLATFORM_DIR)/generated/jvmtifiles @@ -117,7 +117,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS)) BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \ - env.ksh env.csh .dbxrc test_gamma + env.ksh env.csh jdkpath.sh .dbxrc test_gamma BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) @@ -191,11 +191,27 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \ echo "$(LP64_SETTING/$(DATA_MODE))"; \ echo; \ - echo "Src_Dirs = \\"; \ + echo "# Used for platform dispatching"; \ + echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \ + echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \ + echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \ + echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \ + echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \ + echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \ + echo "CFLAGS += \$$(TARGET_DEFINES)"; \ + echo; \ + echo "Src_Dirs_V = \\"; \ sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ + echo; \ + echo "Src_Dirs_I = \\"; \ + echo "\$$(GAMMADIR)/src/share/vm \\"; \ + echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \ + echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ + echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ + echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ [ -n "$(CFLAGS_BROWSE)" ] && \ echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \ [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \ @@ -298,6 +314,13 @@ env.csh: env.ksh sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \ ) > $@ +jdkpath.sh: $(BUILDTREE_MAKE) + @echo Creating $@ ... + $(QUIETLY) ( \ + $(BUILDTREE_COMMENT); \ + echo "JDK=${JAVA_HOME}"; \ + ) > $@ + .dbxrc: $(BUILDTREE_MAKE) @echo Creating $@ ... $(QUIETLY) ( \ diff --git a/hotspot/make/solaris/makefiles/core.make b/hotspot/make/solaris/makefiles/core.make index 66d73b6618d..64400556fcc 100644 --- a/hotspot/make/solaris/makefiles/core.make +++ b/hotspot/make/solaris/makefiles/core.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. # 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,8 +24,7 @@ # Sets make macros for making core version of VM -# Note the effect on includeDB lists in top.make: -# includeDB_compiler* and ad_.*pp are excluded from the build, +# Select which files to use (in top.make) TYPE=CORE # There is no "core" directory in JDK. Install core build in server directory. diff --git a/hotspot/make/solaris/makefiles/defs.make b/hotspot/make/solaris/makefiles/defs.make index 637b3b49c54..6fc596404d1 100644 --- a/hotspot/make/solaris/makefiles/defs.make +++ b/hotspot/make/solaris/makefiles/defs.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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 2338c01099d..8b750858cd3 100644 --- a/hotspot/make/solaris/makefiles/dtrace.make +++ b/hotspot/make/solaris/makefiles/dtrace.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -63,8 +63,6 @@ endif # making libjvm_db -INCLS = $(GENERATED)/incls - # Use mapfile with libjvm_db.so LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE)) @@ -114,7 +112,7 @@ LFLAGS_GENOFFS += -mt -xnolib -norunpath endif lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \ - $(INCLS)/_vmStructs.cpp.incl $(LIBJVM.o) + $(LIBJVM.o) $(QUIETLY) $(CCC) $(CPPFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \ $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc @@ -161,6 +159,27 @@ $(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \ $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d $(QUIETLY) cat $^ > $@ +DTraced_Files = ciEnv.o \ + classLoadingService.o \ + compileBroker.o \ + hashtable.o \ + instanceKlass.o \ + java.o \ + jni.o \ + jvm.o \ + memoryManager.o \ + nmethod.o \ + objectMonitor.o \ + runtimeService.o \ + sharedRuntime.o \ + synchronizer.o \ + thread.o \ + unsafe.o \ + vmThread.o \ + vmCMSOperations.o \ + vmPSOperations.o \ + vmGCOperations.o \ + # Dtrace is available, so we build $(DTRACE.o) $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files) @echo Compiling $(DTRACE).d diff --git a/hotspot/make/solaris/makefiles/fastdebug.make b/hotspot/make/solaris/makefiles/fastdebug.make index 3537b3ab06e..1a033f0cba4 100644 --- a/hotspot/make/solaris/makefiles/fastdebug.make +++ b/hotspot/make/solaris/makefiles/fastdebug.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/gcc.make b/hotspot/make/solaris/makefiles/gcc.make index 0bbba240498..b0cdfc9a231 100644 --- a/hotspot/make/solaris/makefiles/gcc.make +++ b/hotspot/make/solaris/makefiles/gcc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. # 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,9 +47,13 @@ $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2) # check for precompiled headers support ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0" +# Allow the user to turn off precompiled headers from the command line. +ifneq ($(USE_PRECOMPILED_HEADER),0) USE_PRECOMPILED_HEADER=1 PRECOMPILED_HEADER_DIR=. -PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/incls/_precompiled.incl.gch +PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled.hpp +PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch +endif endif @@ -131,6 +135,17 @@ OPT_CFLAGS/bytecodeInterpreter.o += -fno-expensive-optimizations endif OPT_CFLAGS/NOOPT=-O0 + +# Flags for generating make dependency flags. +ifneq ("${CC_VER_MAJOR}", "2") +DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d) +endif + +# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. +ifneq ($(USE_PRECOMPILED_HEADER),1) +CFLAGS += -DDONT_USE_PRECOMPILED_HEADER +endif + #------------------------------------------------------------------------ # Linker flags diff --git a/hotspot/make/solaris/makefiles/i486.make b/hotspot/make/solaris/makefiles/i486.make index c5c15035e67..c2e6ff8395a 100644 --- a/hotspot/make/solaris/makefiles/i486.make +++ b/hotspot/make/solaris/makefiles/i486.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. # 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,6 @@ CFLAGS += -DVM_LITTLE_ENDIAN # TLS helper, assembled from .s file -# Not included in includeDB because it has no dependencies -Obj_Files += solaris_x86_32.o # # Special case flags for compilers and compiler versions on i486. diff --git a/hotspot/make/solaris/makefiles/jvmti.make b/hotspot/make/solaris/makefiles/jvmti.make index 08b4f0edfb4..be07e0546bc 100644 --- a/hotspot/make/solaris/makefiles/jvmti.make +++ b/hotspot/make/solaris/makefiles/jvmti.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. # 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,11 +36,10 @@ JvmtiOutDir = $(GENERATED)/jvmtifiles JvmtiSrcDir = $(GAMMADIR)/src/share/vm/prims InterpreterSrcDir = $(GAMMADIR)/src/share/vm/interpreter -Src_Dirs += $(JvmtiSrcDir) # set VPATH so make knows where to look for source files -Src_Dirs_V = ${Src_Dirs} -VPATH += $(Src_Dirs_V:%=%:) +Src_Dirs_V += $(JvmtiSrcDir) +VPATH += $(Src_Dirs_V:%=%:) JvmtiGeneratedNames = \ jvmtiEnv.hpp \ diff --git a/hotspot/make/solaris/makefiles/launcher.make b/hotspot/make/solaris/makefiles/launcher.make index 0051fd9892b..e0a2ee31640 100644 --- a/hotspot/make/solaris/makefiles/launcher.make +++ b/hotspot/make/solaris/makefiles/launcher.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # 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,18 +24,22 @@ # Rules to build gamma launcher, used by vm.make -# gamma[_g]: launcher +LAUNCHER_SCRIPT = hotspot LAUNCHER = gamma -LAUNCHER_G = $(LAUNCHER)$(G_SUFFIX) -LAUNCHERDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher +LAUNCHERDIR = $(GAMMADIR)/src/os/posix/launcher +LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher LAUNCHERFLAGS = $(ARCHFLAG) \ -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \ + -I$(LAUNCHERDIR_SHARE) \ -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ + -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \ + -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \ -DARCH=\"$(LIBARCH)\" \ -DGAMMA \ -DLAUNCHER_TYPE=\"gamma\" \ - -DLINK_INTO_$(LINK_INTO) + -DLINK_INTO_$(LINK_INTO) \ + $(TARGET_DEFINES) ifeq ($(LINK_INTO),AOUT) LAUNCHER.o = launcher.o $(JVM_OBJ_FILES) @@ -68,24 +72,37 @@ ifeq ("${Platform_compiler}", "sparcWorks") #LAUNCHERFLAGS += -W0,-noglobal endif # Platform_compiler == sparcWorks -launcher.o: launcher.c $(LAUNCHERDIR)/java.c $(LAUNCHERDIR)/java_md.c - $(CC) -g -c -o $@ launcher.c $(LAUNCHERFLAGS) $(CPPFLAGS) +LAUNCHER_OUT = launcher -launcher.c: - @echo Generating $@ - $(QUIETLY) { \ - echo '#define debug launcher_debug'; \ - echo '#include "java.c"'; \ - echo '#include "java_md.c"'; \ - } > $@ +SUFFIXES += .d -$(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE) +SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c") +SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c") + +OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE)) + +DEPFILES := $(patsubst %.o,%.d,$(OBJS)) +-include $(DEPFILES) + +$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c + $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } + $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS) + +$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c + $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } + $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS) + +$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE) ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),) - @echo Linking launcher... + $(QUIETLY) echo Linking launcher... $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK) - $(QUIETLY) \ - $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER) + $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER) $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK) - [ -f $(LAUNCHER_G) ] || ln -s $@ $(LAUNCHER_G) endif # filter -sbfast -xsbfast +$(LAUNCHER): $(LAUNCHER_SCRIPT) + +$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script + $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@ + $(QUIETLY) chmod +x $@ + diff --git a/hotspot/make/solaris/makefiles/optimized.make b/hotspot/make/solaris/makefiles/optimized.make index 9cf8543233e..563bd4c4a09 100644 --- a/hotspot/make/solaris/makefiles/optimized.make +++ b/hotspot/make/solaris/makefiles/optimized.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/product.make b/hotspot/make/solaris/makefiles/product.make index daf335cf332..e6ebeea7580 100644 --- a/hotspot/make/solaris/makefiles/product.make +++ b/hotspot/make/solaris/makefiles/product.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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 e920dcefec7..47553eb36cc 100644 --- a/hotspot/make/solaris/makefiles/reorder_COMPILER1_i486 +++ b/hotspot/make/solaris/makefiles/reorder_COMPILER1_i486 @@ -18,7 +18,6 @@ text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: compilationPolicy.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: compileBroker.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: fprofiler.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: genCollectedHeap.o; -text: .text%__1cTAssertIsPermClosure2t6M_v_: genCollectedHeap.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: generateOopMap.o; text: .text%__1cNCellTypeStateLmake_bottom6F_0_: generateOopMap.o; text: .text%__1cNCellTypeStateImake_any6Fi_0_: generateOopMap.o; @@ -34,23 +33,15 @@ text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: jvmtiTagMap.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: management.o; text: .text%__1cJTimeStamp2t6M_v_: management.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: markSweep.o; -text: .text%__1cJMarkSweepSMarkAndPushClosure2t6M_v_: markSweep.o; -text: .text%__1cJMarkSweepRFollowRootClosure2t6M_v_: markSweep.o; -text: .text%__1cJMarkSweepSFollowStackClosure2t6M_v_: markSweep.o; -text: .text%__1cJMarkSweepOIsAliveClosure2t6M_v_: markSweep.o; -text: .text%__1cJMarkSweepQKeepAliveClosure2t6M_v_: markSweep.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: memoryService.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: oopMap.o; -text: .text%__1cQDoNothingClosure2t6M_v_: oopMap.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: parGCAllocBuffer.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: psMarkSweep.o; -text: .text%__1cTPSAlwaysTrueClosure2t6M_v_: psMarkSweep.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: psScavenge.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: relocInfo.o; text: .text%__1cQRelocationHolder2t6M_v_: relocInfo.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: runtimeService.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: sharedHeap.o; -text: .text%__1cTAssertIsPermClosure2t6M_v_: sharedHeap.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: vmStructs.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: vm_version.o; text: .text%__1cTAbstract_VM_VersionKvm_release6F_pkc_; @@ -94,7 +85,6 @@ text: .text%__1cCosXnon_memory_address_word6F_pc_; text: .text%__1cCosHSolarisOlibthread_init6F_v_; text: .text%__1cRlwp_priocntl_init6F_i_: os_solaris.o; text: .text%__1cNpriocntl_stub6FinGidtype_lipc_l_: os_solaris.o; -text: .text%__1cOresolve_symbol6Fpkc_pC_: os_solaris.o; text: .text%__1cCosHSolarisQsignal_sets_init6F_v_; text: .text%__1cCosHSolarisPinit_signal_mem6F_v_; text: .text%__1cCosHSolarisXinstall_signal_handlers6F_v_; @@ -107,7 +97,6 @@ text: .text%__1cSThreadLocalStorageEinit6F_v_; text: .text%__1cSThreadLocalStorageHpd_init6F_v_; text: .text%__1cCosbDallocate_thread_local_storage6F_i_; text: .text%__1cSThreadLocalStoragebCgenerate_code_for_get_thread6F_v_; -text: .text%__1cRAllocateTLSOffset6F_v_: threadLS_solaris_x86.o; text: .text%__1cPvm_init_globals6F_v_; text: .text%__1cScheck_ThreadShadow6F_v_; text: .text%__1cNeventlog_init6F_v_; @@ -119,17 +108,8 @@ text: .text%__1cPperfMemory_init6F_v_; text: .text%__1cKPerfMemoryKinitialize6F_v_; text: .text%__1cCosZvm_allocation_granularity6F_i_; text: .text%__1cKPerfMemoryUcreate_memory_region6FI_v_; -text: .text%__1cUcreate_shared_memory6FI_pc_: perfMemory_solaris.o; -text: .text%__1cSmmap_create_shared6FI_pc_: perfMemory_solaris.o; text: .text%__1cCosScurrent_process_id6F_i_; -text: .text%__1cNget_user_name6Fl_pc_: perfMemory_solaris.o; -text: .text%__1cQget_user_tmp_dir6Fpkc_pc_: perfMemory_solaris.o; text: .text%__1cCosSget_temp_directory6F_pkc_; -text: .text%__1cWget_sharedmem_filename6Fpkci_pc_: perfMemory_solaris.o; -text: .text%__1cbBcleanup_sharedmem_resources6Fpkc_v_: perfMemory_solaris.o; -text: .text%lstat: perfMemory_solaris.o; -text: .text%__1cPfilename_to_pid6Fpkc_l_: perfMemory_solaris.o; -text: .text%__1cbAcreate_sharedmem_resources6Fpkc1I_i_: perfMemory_solaris.o; text: .text%__1cGThread2t6M_v_; text: .text%__1cFArena2t6M_v_; text: .text%__1cFChunk2n6FII_pv_; @@ -161,7 +141,6 @@ text: .text%__1cCosRinitialize_thread6F_v_; text: .text%__1cNReservedSpaceUpage_align_size_down6FI_I_; text: .text%__1cCosHSolarisVinit_thread_fpu_state6F_v_; text: .text%__1cOJNIHandleBlockOallocate_block6FpnGThread__p0_; -text: .text%__1cQcreate_os_thread6FpnGThread_I_pnIOSThread__: os_solaris.o; text: .text%__1cIOSThread2t6MpFpv_i1_v_; text: .text%__1cIOSThreadNpd_initialize6M_v_; text: .text%__1cCosHSolarisPhotspot_sigmask6FpnGThread__v_; @@ -186,7 +165,6 @@ text: .text%__1cNThreadServiceEinit6F_v_; text: .text%__1cPPerfDataManagerTcreate_long_counter6FnJCounterNS_pkcnIPerfDataFUnits_xpnGThread__pnPPerfLongCounter__; text: .text%__1cORuntimeServiceEinit6F_v_; text: .text%__1cTClassLoadingServiceEinit6F_v_; -text: .text%__1cKvtune_init6F_v_; text: .text%__1cObytecodes_init6F_v_; text: .text%__1cJBytecodesKinitialize6F_v_; text: .text%__1cJBytecodesNpd_initialize6F_v_; @@ -200,7 +178,6 @@ text: .text%__1cKHandleMark2T6M_v_; text: .text%__1cLClassLoaderbBsetup_bootstrap_search_path6F_v_; text: .text%__1cCosGstrdup6Fpkc_pc_; text: .text%__1cCosEstat6FpkcpnEstat__i_; -text: .text%stat: os_solaris.o; text: .text%JVM_RawMonitorCreate; text: .text%JVM_NativePath; text: .text%JVM_RawMonitorEnter; @@ -216,7 +193,6 @@ text: .text%__1cNReservedSpace2t6MI_v_; text: .text%__1cMVirtualSpaceQuncommitted_size6kM_I_; text: .text%__1cMVirtualSpaceNreserved_size6kM_I_; text: .text%__1cMVirtualSpaceOcommitted_size6kM_I_; -text: .text%__1cSalign_to_page_size6FI_I_: heap.o; text: .text%__1cICodeHeapFclear6M_v_; text: .text%__1cICodeHeapTmark_segmap_as_free6MII_v_; text: .text%__1cNMemoryServiceZadd_code_heap_memory_pool6FpnICodeHeap__v_; @@ -244,9 +220,7 @@ text: .text%__1cKMemoryPoolYrecord_peak_memory_usage6M_v_; text: .text%__1cMCodeHeapPoolQget_memory_usage6M_nLMemoryUsage__; text: .text%__1cMCodeHeapPoolNused_in_bytes6M_I_: memoryPool.o; text: .text%__1cICodeHeapSallocated_capacity6kM_I_; -text: .text%__1cKMemoryPoolImax_size6kM_I_: memoryPool.o; text: .text%__1cXresource_allocate_bytes6FI_pc_; -text: .text%__1cKCodeBuffer2t6MpCi_v_; text: .text%__1cRAbstractAssembler2t6MpnKCodeBuffer__v_; text: .text%__1cYVM_Version_StubGeneratorTgenerate_getPsrInfo6M_pC_: vm_version_x86.o; text: .text%__1cMStubCodeMark2t6MpnRStubCodeGenerator_pkc4_v_; @@ -269,10 +243,8 @@ text: .text%__1cJAssemblerDret6Mi_v_; text: .text%__1cMStubCodeMark2T6M_v_; text: .text%__1cRAbstractAssemblerFflush6M_v_; text: .text%__1cRStubCodeGeneratorLstub_epilog6MpnMStubCodeDesc__v_; -text: .text%__1cFVTuneNregister_stub6FpkcpC3_v_; text: .text%__1cFForteNregister_stub6FpkcpC3_v_; text: .text%__1cKVM_VersionWget_processor_features6F_v_; -text: .text%__1cVcheck_for_sse_support6F_v_: os_solaris_x86.o; text: .text%jio_snprintf; text: .text%jio_vsnprintf; text: .text%__1cPlocal_vsnprintf6FpcIpkcpv_i_; @@ -651,7 +623,6 @@ text: .text%__1cZInterpreterMacroAssemblerWprofile_switch_default6MpnMRegisterIm text: .text%__1cNTemplateTableMlookupswitch6F_v_; text: .text%__1cNTemplateTableH_return6FnITosState__v_; text: .text%__1cNTemplateTableJgetstatic6Fi_v_; -text: .text%__1cNTemplateTableXresolve_cache_and_index6FipnMRegisterImpl_2_v_; text: .text%__1cJAssemblerHfistp_d6MnHAddress__v_; text: .text%__1cNTemplateTableJputstatic6Fi_v_; text: .text%__1cOMacroAssemblerLstore_check6MpnMRegisterImpl_nHAddress__v_; @@ -735,7 +706,6 @@ text: .text%__1cbBBlockOffsetArrayContigSpaceQalloc_block_work6MpnIHeapWord_2_v_ text: .text%__1cLsymbolKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cLsymbolKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: symbolKlass.o; text: .text%__1cLsymbolKlassOset_alloc_size6MI_v_: symbolKlass.o; -text: .text%__1cKoopFactoryKnew_symbol6FpkcipnGThread__pnNsymbolOopDesc__; text: .text%__1cLSymbolTableGlookup6FpkcipnGThread__pnNsymbolOopDesc__; text: .text%__1cJHashtableLhash_symbol6Fpkci_I_: symbolTable.o; text: .text%__1cLSymbolTableGlookup6MipkciI_pnNsymbolOopDesc__; @@ -806,7 +776,6 @@ text: .text%__1cQSystemDictionaryRload_shared_class6FnMsymbolHandle_nGHandle_pnG text: .text%__1cQSystemDictionaryRfind_shared_class6FnMsymbolHandle__pnMklassOopDesc__; text: .text%__1cQSystemDictionaryRload_shared_class6FnTinstanceKlassHandle_nGHandle_pnGThread__1_; text: .text%__1cLClassLoaderOload_classfile6FnMsymbolHandle_pnGThread__nTinstanceKlassHandle__; -text: .text%__1cFVTuneQstart_class_load6F_v_; text: .text%__1cJEventMark2t6MpkcE_v_: classLoader.o; text: .text%__1cSThreadProfilerMark2t6Mn0AGRegion__v_; text: .text%__1cMstringStream2t6MI_v_; @@ -854,7 +823,6 @@ text: .text%__1cPClassFileParserYparse_checked_exceptions6MpHInSconstantPoolHand text: .text%__1cPClassFileStreamHskip_u26MipnGThread__v_; text: .text%__1cSconstMethodOopDescbEchecked_exceptions_length_addr6kM_pH_; text: .text%__1cSconstMethodOopDescYchecked_exceptions_start6kM_pnXCheckedExceptionElement__; -text: .text%__1cXcopy_u2_with_conversion6FpH0i_v_: classFileParser.o; text: .text%__1cPClassFileParserbDcompute_transitive_interfaces6MnTinstanceKlassHandle_nOobjArrayHandle_pnGThread__2_; text: .text%__1cPClassFileParserMsort_methods6MnOobjArrayHandle_111pnGThread__nPtypeArrayHandle__; text: .text%method_compare: methodOop.o; @@ -862,9 +830,6 @@ text: .text%__1cLklassVtableQget_num_mirandas6FpnMklassOopDesc_pnPobjArrayOopDes text: .text%__1cLklassVtableMget_mirandas6FpnNGrowableArray4CpnNmethodOopDesc___pnMklassOopDesc_pnPobjArrayOopDesc_8_v_; text: .text%__1cLklassItableTcompute_itable_size6FnOobjArrayHandle__i_; text: .text%__1cUvisit_all_interfaces6FpnPobjArrayOopDesc_pnXInterfaceVisiterClosure__v_; -text: .text%__1cPClassFileParserUcompute_oop_map_size6MnTinstanceKlassHandle_ii_i_; -text: .text%__1cKoopFactoryRnew_instanceKlass6FiiiinNReferenceType_pnGThread__pnMklassOopDesc__; -text: .text%__1cSinstanceKlassKlassXallocate_instance_klass6MiiiinNReferenceType_pnGThread__pnMklassOopDesc__; text: .text%__1cNinstanceKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: instanceKlass.o; text: .text%__1cNinstanceKlassOset_alloc_size6MI_v_: instanceKlass.o; text: .text%__1cNinstanceKlassQinit_implementor6M_v_; @@ -878,7 +843,6 @@ text: .text%__1cNinstanceKlassYcompute_secondary_supers6MipnGThread__pnPobjArray text: .text%__1cLklassItableZsetup_itable_offset_table6FnTinstanceKlassHandle__v_; text: .text%__1cFKlassKsuperklass6kM_pnNinstanceKlass__; text: .text%__1cPClassFileParserVset_precomputed_flags6MnTinstanceKlassHandle__v_; -text: .text%__1cFKlassNlookup_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cNinstanceKlassWuncached_lookup_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cNinstanceKlassLfind_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cNinstanceKlassLfind_method6FpnPobjArrayOopDesc_pnNsymbolOopDesc_4_pnNmethodOopDesc__; @@ -893,7 +857,6 @@ text: .text%__1cQPackageHashtableMcompute_hash6Mpkci_I_: classLoader.o; text: .text%__1cQPackageHashtableJget_entry6MiIpkcI_pnLPackageInfo__: classLoader.o; text: .text%__1cMstringStream2T6M_v_; text: .text%__1cSThreadProfilerMark2T6M_v_; -text: .text%__1cFVTuneOend_class_load6F_v_; text: .text%__1cQSystemDictionaryVdefine_instance_class6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cVLoaderConstraintTableWfind_loader_constraint6MnMsymbolHandle_nGHandle__ppnVLoaderConstraintEntry__; text: .text%__1cQSystemDictionaryQadd_to_hierarchy6FnTinstanceKlassHandle_pnGThread__v_; @@ -970,8 +933,6 @@ text: .text%__1cbBjava_lang_ref_SoftReferenceJset_clock6Fx_v_; text: .text%__1cQjni_handles_init6F_v_; text: .text%__1cKJNIHandlesKinitialize6F_v_; text: .text%__1cOvmStructs_init6F_v_; -text: .text%__1cIFrameMapEinit6F_v_; -text: .text%__1cIRuntime1Kinitialize6F_v_; text: .text%__1cIRuntime1Ninitialize_pd6F_v_; text: .text%__1cNSharedRuntimeTgenerate_deopt_blob6F_v_; text: .text%__1cJOopMapSet2t6M_v_; @@ -996,7 +957,6 @@ text: .text%__1cJOopMapSetJheap_size6kM_i_; text: .text%__1cGOopMapJheap_size6kM_i_; text: .text%__1cJOopMapSetHcopy_to6MpC_v_; text: .text%__1cGOopMapHcopy_to6MpC_v_; -text: .text%__1cIRuntime1Rgenerate_blob_for6Fn0AGStubID__v_; text: .text%__1cLOopRecorder2t6MpnFArena__v_; text: .text%__1cIRuntime1Iname_for6Fn0AGStubID__pkc_; text: .text%__1cLRuntimeStub2n6FII_pv_; @@ -1004,7 +964,6 @@ text: .text%__1cNStubAssemblerHcall_RT6MpnMRegisterImpl_2pC2_i_; text: .text%__1cNStubAssemblerHcall_RT6MpnMRegisterImpl_2pCi_i_; text: .text%__1cJStubFrame2T6M_v_; text: .text%__1cOMacroAssemblerLtlab_refill6MrnFLabel_22_v_; -text: .text%__1cLlog2_intptr6Fi_i_: assembler_x86.o; text: .text%__1cOMacroAssemblerNeden_allocate6MpnMRegisterImpl_2i2rnFLabel__v_; text: .text%__1cOMacroAssemblerLverify_tlab6M_v_; text: .text%__1cOMacroAssemblerNtlab_allocate6MpnMRegisterImpl_2i22rnFLabel__v_; @@ -1033,7 +992,6 @@ text: .text%__1cPICStubInterfaceRcode_size_to_size6kMi_i_: icBuffer.o; text: .text%__1cPICStubInterfaceKinitialize6MpnEStub_i_v_: icBuffer.o; text: .text%__1cTcompilerOracle_init6F_v_; text: .text%__1cOCompilerOraclePparse_from_file6F_v_; -text: .text%__1cHcc_file6F_pkc_: compilerOracle.o; text: .text%__1cWcompilationPolicy_init6F_v_; text: .text%__1cNinstanceKlassGvtable6kM_pnLklassVtable__; text: .text%__1cNinstanceKlassKjava_super6kM_pnMklassOopDesc__: instanceKlass.o; @@ -1076,18 +1034,14 @@ text: .text%__1cNinstanceKlassKlink_class6MpnGThread__v_; text: .text%__1cNinstanceKlassNrewrite_class6MpnGThread__v_; text: .text%__1cIRewriterHrewrite6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cYconstantPoolCacheOopDescKinitialize6MrnIintArray__v_; -text: .text%__1cWConstantPoolCacheEntryRset_initial_state6Mi_v_; text: .text%__1cTAbstractInterpreterLmethod_kind6FnMmethodHandle__n0AKMethodKind__; text: .text%__1cMNativeLookupTbase_library_lookup6Fpkc22_pC_; text: .text%__1cMNativeLookupNpure_jni_name6FnMmethodHandle__pc_; text: .text%__1cMoutputStreamFprint6MpkcE_v_; text: .text%__1cNmethodOopDescKklass_name6kM_pnNsymbolOopDesc__; -text: .text%__1cOmangle_name_on6FpnMoutputStream_pnNsymbolOopDesc__v_: nativeLookup.o; -text: .text%__1cOmangle_name_on6FpnMoutputStream_pnNsymbolOopDesc_ii_v_: nativeLookup.o; text: .text%__1cMoutputStreamDput6Mc_v_; text: .text%__1cCosYprint_jni_name_prefix_on6FpnMoutputStream_i_v_; text: .text%__1cCosYprint_jni_name_suffix_on6FpnMoutputStream_i_v_; -text: .text%__1cVlookup_special_native6Fpc_pC_: nativeLookup.o; text: .text%__1cbEinitialize_converter_functions6F_v_; text: .text%__1cIUniverseWupdate_heap_info_at_gc6F_v_; text: .text%__1cQGenCollectedHeapIcapacity6kM_I_; @@ -1137,7 +1091,6 @@ text: .text%__1cCosMstart_thread6FpnGThread__v_; text: .text%__1cCosPpd_start_thread6FpnGThread__v_; text: .text%__1cCosTset_native_priority6FpnGThread_i_nIOSReturn__; text: .text%__1cQset_lwp_priority6Fiii_i_; -text: .text%__1cVscale_to_lwp_priority6Fiii_i_: os_solaris.o; text: .text%__1cIVMThreadDrun6M_v_; text: .text%__1cIVMThreadEloop6M_v_; text: .text%__1cQVMOperationQdDueueLremove_next6M_pnMVM_Operation__; @@ -1154,7 +1107,6 @@ text: .text%__1cNinstanceKlassRclass_initializer6M_pnNmethodOopDesc__; text: .text%__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_; text: .text%__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_; text: .text%__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_; -text: .text%__1cRruntime_type_from6FpnJJavaValue__nJBasicType__: javaCalls.o; text: .text%__1cTAbstractInterpreterbFsize_top_interpreter_activation6FpnNmethodOopDesc__i_; text: .text%__1cPJavaCallWrapper2t6MnMmethodHandle_nGHandle_pnJJavaValue_pnGThread__v_; text: .text%__1cRJavaCallArgumentsKparameters6M_pi_; @@ -1192,7 +1144,6 @@ text: .text%__1cXSignatureHandlerLibraryLset_handler6FpnKCodeBuffer__pC_; text: .text%__1cXSignatureHandlerLibraryOpd_set_handler6FpC_v_; text: .text%jni_RegisterNatives: jni.o; text: .text%__1cPjava_lang_ClassLas_klassOop6FpnHoopDesc__pnMklassOopDesc__; -text: .text%__1cLSymbolTableFprobe6Fpkci_pnNsymbolOopDesc__; text: .text%__1cPJavaCallWrapper2T6M_v_; text: .text%__1cOJNIHandleBlockNrelease_block6Fp0pnGThread__v_; text: .text%__1cNinstanceKlassbJset_initialization_state_and_notify6Mn0AKClassState_pnGThread__v_; @@ -1206,7 +1157,6 @@ text: .text%__1cPFieldAccessInfoDset6MnLKlassHandle_nMsymbolHandle_iinJBasicType text: .text%__1cWConstantPoolCacheEntryOset_bytecode_26MnJBytecodesECode__v_; text: .text%__1cSInterpreterRuntimeE_new6FpnKJavaThread_pnTconstantPoolOopDesc_i_v_; text: .text%__1cMLinkResolverVresolve_invokespecial6FrnICallInfo_nSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cWConstantPoolCacheEntryPbytecode_number6FnJBytecodesECode__i_: cpCacheOop.o; text: .text%__1cNSignatureInfoJdo_object6Mii_v_: bytecode.o; text: .text%__1cNSignatureInfoHdo_long6M_v_: bytecode.o; text: .text%JVM_CurrentTimeMillis; @@ -1225,8 +1175,6 @@ text: .text%__1cQjava_lang_StringbBcreate_tenured_from_unicode6FpHipnGThread__nG text: .text%__1cKoopFactoryXnew_permanent_charArray6FipnGThread__pnQtypeArrayOopDesc__; text: .text%__1cJJavaCallsMcall_special6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_533pnGThread__v_; text: .text%__1cNmethodOopDescIbci_from6kMpC_i_; -text: .text%__1cPBytecode_invokeJsignature6kM_pnNsymbolOopDesc__; -text: .text%__1cPBytecode_invokeFindex6kM_i_; text: .text%__1cNmethodOopDescIbcp_from6kMi_pC_; text: .text%__1cFframebGinterpreter_callee_receiver_addr6MnMsymbolHandle__ppnHoopDesc__; text: .text%__1cMLinkResolverVresolve_invokevirtual6FrnICallInfo_nGHandle_nSconstantPoolHandle_ipnGThread__v_; @@ -1258,7 +1206,6 @@ text: .text%jni_GetStringUTFChars: jni.o; text: .text%__1cQjava_lang_StringOas_utf8_string6FpnHoopDesc__pc_; text: .text%__1cHUNICODEHas_utf86FpHi_pc_; text: .text%__1cHUNICODELutf8_length6FpHi_i_; -text: .text%__1cKutf8_write6FpCH_0_: utf8.o; text: .text%JVM_FindPrimitiveClass; text: .text%__1cJname2type6Fpkc_nJBasicType__; text: .text%jni_ReleaseStringUTFChars; @@ -1300,7 +1247,6 @@ text: .text%__1cKJavaThreadRthread_main_inner6M_v_; text: .text%__1cMthread_entry6FpnKJavaThread_pnGThread__v_: jvm.o; text: .text%__1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_5pnGThread__v_; text: .text%__1cJJavaCallsMcall_virtual6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnRJavaCallArguments_pnGThread__v_; -text: .text%__1cIBytecodeIset_code6MnJBytecodesECode__v_; text: .text%__1cNFingerprinterHdo_long6M_v_: dump.o; text: .text%JVM_MonitorWait; text: .text%__1cQjava_lang_ThreadRget_thread_status6FpnHoopDesc__n0AMThreadStatus__; @@ -1314,23 +1260,19 @@ text: .text%__1cNmethodOopDescKjmethod_id6M_pnK_jmethodID__; text: .text%jni_NewStringUTF: jni.o; text: .text%jni_CallObjectMethod: jni.o; text: .text%__1cRSignatureIterator2t6MpnGThread_pnNsymbolOopDesc__v_; -text: .text%__1cUjni_invoke_nonstatic6FpnHJNIEnv__pnJJavaValue_pnI_jobject_nLJNICallType_pnK_jmethodID_pnSJNI_ArgumentPusher_pnGThread__v_: jni.o; text: .text%__1cXJNI_ArgumentPusherVaArgHiterate6MX_v_: jni.o; text: .text%__1cXJNI_ArgumentPusherVaArgKget_object6M_v_: jni.o; text: .text%jni_ExceptionOccurred: jni.o; -text: .text%__1cbAjni_check_async_exceptions6FpnKJavaThread__v_: jni.o; text: .text%jni_DeleteLocalRef: jni.o; text: .text%__1cOJNIHandleBlockRrebuild_free_list6M_v_; text: .text%jni_EnsureLocalCapacity; text: .text%jni_GetStaticMethodID: jni.o; text: .text%jni_CallStaticObjectMethodV: jni.o; -text: .text%__1cRjni_invoke_static6FpnHJNIEnv__pnJJavaValue_pnI_jobject_nLJNICallType_pnK_jmethodID_pnSJNI_ArgumentPusher_pnGThread__v_: jni.o; text: .text%__1cMLinkResolverbHlookup_instance_method_in_klasses6FrnMmethodHandle_nLKlassHandle_nMsymbolHandle_4pnGThread__v_; text: .text%jni_ExceptionCheck: jni.o; text: .text%jni_NewString: jni.o; text: .text%__1cQjava_lang_StringXcreate_oop_from_unicode6FpHipnGThread__pnHoopDesc__; text: .text%JVM_InitProperties; -text: .text%__1cMset_property6FnGHandle_pkc2pnGThread__v_: jvm.o; text: .text%__1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_533pnGThread__v_; text: .text%__1cYNoJvmtiVMObjectAllocMark2t6M_v_; text: .text%__1cYNoJvmtiVMObjectAllocMark2T6M_v_; @@ -1394,7 +1336,6 @@ text: .text%__1cRLowMemoryDetectorbLdetect_low_memory_for_collected_pools6F_v_: text: .text%jni_GetStringUTFLength: jni.o; text: .text%__1cQjava_lang_StringLutf8_length6FpnHoopDesc__i_; text: .text%jni_GetStringLength: jni.o; -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; @@ -1445,13 +1386,9 @@ text: .text%Unsafe_FreeMemory; text: .text%__1cNSignatureInfoIdo_float6M_v_: bytecode.o; text: .text%__1cFJNIidEfind6Mi_p0_; text: .text%jni_NewObjectV: jni.o; -text: .text%__1cMalloc_object6FpnH_jclass_pnGThread__pnPinstanceOopDesc__: jni.o; text: .text%jni_GetStringRegion: jni.o; -text: .text%__1cQjava_lang_StringGoffset6FpnHoopDesc__i_; -text: .text%__1cQjava_lang_StringFvalue6FpnHoopDesc__pnQtypeArrayOopDesc__; text: .text%jni_GetObjectField: jni.o; text: .text%jni_GetStringCritical: jni.o; -text: .text%__1cJGC_lockerNlock_critical6FpnKJavaThread__v_: jni.o; text: .text%jni_ReleaseStringCritical: jni.o; text: .text%JVM_LoadLibrary; text: .text%JVM_FindLibraryEntry; @@ -1496,10 +1433,7 @@ text: .text%__1cNobjArrayKlassIallocate6MipnGThread__pnPobjArrayOopDesc__; text: .text%jni_SetObjectArrayElement: jni.o; text: .text%jni_GetObjectArrayElement: jni.o; text: .text%__1cQSimpleCompPolicyXmethod_invocation_event6MnMmethodHandle_pnGThread__v_; -text: .text%__1cRCompilationPolicybIreset_counter_for_invocation_event6MnMmethodHandle__v_; text: .text%__1cRInvocationCounterJset_carry6M_v_; -text: .text%__1cNCompileBrokerOcompile_method6FnMmethodHandle_i1ipkcpnGThread__pnHnmethod__; -text: .text%__1cQSimpleCompPolicyRcompilation_level6MnMmethodHandle_i_i_; text: .text%__1cNobjArrayKlassKcopy_array6MpnMarrayOopDesc_i2iipnGThread__v_; text: .text%__1cLJvmtiExportQenter_live_phase6F_v_; text: .text%__1cLJvmtiExportTpost_vm_initialized6F_v_; @@ -1512,7 +1446,6 @@ text: .text%__1cJJavaCallsMcall_special6FpnJJavaValue_nGHandle_nLKlassHandle_nMs text: .text%__1cCosOsignal_init_pd6F_v_; text: .text%__1cQjava_lang_ThreadKset_daemon6FpnHoopDesc__v_; text: .text%__1cICompiler2t6M_v_; -text: .text%__1cNCompileBrokerVinit_compiler_threads6Fi_v_; text: .text%__1cQCompilerCounters2t6MpkcipnGThread__v_; text: .text%__1cNCompileBrokerUmake_compiler_thread6FpkcpnMCompileQdDueue_pnQCompilerCounters_pnGThread__pnOCompilerThread__; text: .text%__1cOCompilerThread2t6MpnMCompileQdDueue_pnQCompilerCounters__v_; @@ -1570,10 +1503,7 @@ text: .text%__1cTjava_lang_ThrowableTfill_in_stack_trace6FnGHandle_pnGThread__v_ text: .text%__1cTjava_lang_ThrowableNset_backtrace6FpnHoopDesc_2_v_; text: .text%__1cTjava_lang_ThrowableQclear_stacktrace6FpnHoopDesc__v_; text: .text%__1cVPreserveExceptionMark2T6M_v_; -text: .text%__1cKExceptionsG_throw6FpnGThread_pkcinGHandle__v_; text: .text%__1cSInterpreterRuntimeXthrow_pending_exception6FpnKJavaThread__v_; -text: .text%__1cNSharedRuntimebKexception_handler_for_return_address6FpC_1_; -text: .text%__1cNSharedRuntimebOraw_exception_handler_for_return_address6FpC_1_; text: .text%__1cSInterpreterRuntimebFexception_handler_for_exception6FpnKJavaThread_pnHoopDesc__pC_; text: .text%__1cNmethodOopDescbEfast_exception_handler_bci_for6MnLKlassHandle_ipnGThread__i_; text: .text%__1cSInterpreterRuntimePset_bcp_and_mdp6FpCpnKJavaThread__v_; @@ -1588,7 +1518,6 @@ text: .text%__1cNCompileBrokerZinvoke_compiler_on_method6FpnLCompileTask__v_; text: .text%__1cNCompileBrokerVpush_jni_handle_block6F_v_; text: .text%__1cPciObjectFactory2t6MpnFArena_i_v_; text: .text%__1cPciObjectFactoryTinit_shared_objects6M_v_; -text: .text%__1cIciSymbol2t6MnMsymbolHandle__v_; text: .text%__1cIciObject2t6MnGHandle__v_; text: .text%__1cPciObjectFactoryEfind6MpnHoopDesc_pnNGrowableArray4CpnIciObject____i_; text: .text%__1cPciObjectFactoryNinit_ident_of6MpnIciObject__v_; @@ -1675,14 +1604,12 @@ text: .text%__1cOGenerateOopMapYrewrite_refval_conflicts6M_v_; text: .text%__1cOGenerateOopMapNreport_result6M_v_; text: .text%__1cLCompilationJbuild_hir6M_v_; text: .text%__1cCIR2t6MpnLCompilation_pnIciMethod_i_v_; -text: .text%__1cJValueTypeKinitialize6F_v_; text: .text%__1cMciNullObjectEmake6F_p0_; text: .text%__1cMGraphBuilderKinitialize6F_v_; text: .text%__1cJXHandlers2t6MpnIciMethod__v_; text: .text%__1cIciMethodJload_code6M_v_; text: .text%__1cHIRScopeLbuild_graph6MpnLCompilation_i_pnKBlockBegin__; text: .text%__1cQBlockListBuilderLset_leaders6M_v_; -text: .text%__1cKValueStack2t6MpnHIRScope_ii_v_; text: .text%__1cMGraphBuilderPpush_root_scope6MpnHIRScope_pnJBlockList_pnKBlockBegin__v_; text: .text%__1cMGraphBuilderJScopeDataJset_scope6MpnHIRScope__v_; text: .text%__1cIValueMap2t6M_v_; @@ -1690,7 +1617,6 @@ text: .text%__1cMGraphBuilderJScopeDataQadd_to_work_list6MpnKBlockBegin__v_; text: .text%__1cNResourceArrayGexpand6MIiri_v_; text: .text%__1cMGraphBuilderJScopeDataVremove_from_work_list6M_pnKBlockBegin__; text: .text%__1cIValueMapIkill_all6M_v_; -text: .text%__1cKValueStackEcopy6M_p0_; text: .text%__1cGValuesIpush_all6Mpk0_v_: c1_ValueStack.o; text: .text%__1cMGraphBuilderbBiterate_bytecodes_for_block6Mi_pnIBlockEnd__; text: .text%__1cMGraphBuilderJScopeDataIblock_at6Mi_pnKBlockBegin__; @@ -1709,8 +1635,6 @@ text: .text%__1cHciFieldPinitialize_from6MpnPfieldDescriptor__v_; text: .text%__1cMas_ValueType6FnJBasicType__pnJValueType__; text: .text%__1cMLinkResolverXresolve_klass_no_update6FrnLKlassHandle_nSconstantPoolHandle_ipnGThread__v_; text: .text%__1cTconstantPoolOopDescbCklass_ref_at_if_loaded_check6FnSconstantPoolHandle_ipnGThread__pnMklassOopDesc__; -text: .text%__1cMGraphBuilderKlock_stack6M_pnKValueStack__; -text: .text%__1cKValueStackKcopy_locks6M_p0_; text: .text%__1cJLoadFieldFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cNCanonicalizerMdo_LoadField6MpnJLoadField__v_; text: .text%__1cJLoadFieldEhash6kM_i_: c1_Instruction.o; @@ -1738,7 +1662,6 @@ text: .text%__1cMGraphBuilderNmethod_return6MpnLInstruction__v_; text: .text%__1cGReturnFvisit6MpnSInstructionVisitor__v_: c1_GraphBuilder.o; text: .text%__1cNCanonicalizerJdo_Return6MpnGReturn__v_; text: .text%__1cGReturnJas_Return6M_p0_: c1_GraphBuilder.o; -text: .text%__1cKValueStackMcaller_state6kM_p0_; text: .text%__1cQSystemDictionarybOfind_constrained_instance_or_array_klass6FnMsymbolHandle_nGHandle_pnGThread__pnMklassOopDesc__; text: .text%__1cMGraphBuilderHif_same6MpnJValueType_nLInstructionJCondition__v_; text: .text%__1cNCanonicalizerNdo_StoreField6MpnKStoreField__v_; @@ -1781,24 +1704,17 @@ text: .text%__1cTNullCheckEliminatorLiterate_one6MpnKBlockBegin__v_; text: .text%__1cGBitMapIset_from6M0_v_; text: .text%__1cQNullCheckVisitorNdo_BlockBegin6MpnKBlockBegin__v_; text: .text%__1cQNullCheckVisitorHdo_Base6MpnEBase__v_; -text: .text%__1cKStateSplitPinput_values_do6MpFppnLInstruction__v_v_: c1_Canonicalizer.o; text: .text%__1cQNullCheckVisitorHdo_Goto6MpnEGoto__v_; -text: .text%__1cTNullCheckEliminatorIdo_value6FppnLInstruction__v_; -text: .text%__1cFLocalPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cFLocalFvisit6MpnSInstructionVisitor__v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorIdo_Local6MpnFLocal__v_; -text: .text%__1cLAccessFieldPinput_values_do6MpFppnLInstruction__v_v_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorMdo_LoadField6MpnJLoadField__v_; text: .text%__1cTNullCheckEliminatorShandle_AccessField6MpnLAccessField__v_; -text: .text%__1cCIfPinput_values_do6MpFppnLInstruction__v_v_: c1_Canonicalizer.o; -text: .text%__1cIConstantPinput_values_do6MpFppnLInstruction__v_v_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorLdo_Constant6MpnIConstant__v_; text: .text%__1cQNullCheckVisitorFdo_If6MpnCIf__v_; text: .text%__1cQNullCheckVisitorPdo_ArithmeticOp6MpnMArithmeticOp__v_; text: .text%__1cQNullCheckVisitorOdo_LoadIndexed6MpnLLoadIndexed__v_; text: .text%__1cTNullCheckEliminatorShandle_LoadIndexed6MpnLLoadIndexed__v_; text: .text%__1cQNullCheckVisitorNdo_StoreField6MpnKStoreField__v_; -text: .text%__1cGReturnPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorJdo_Return6MpnGReturn__v_; text: .text%__1cGBitMapQset_intersection6M0_v_; text: .text%__1cLInstructionJas_Invoke6M_pnGInvoke__: c1_Canonicalizer.o; @@ -1811,11 +1727,7 @@ text: .text%__1cKStateSplitFscope6kM_pnHIRScope__; text: .text%__1cIBlockEndOsubstitute_sux6MpnKBlockBegin_2_v_; text: .text%__1cCIRMcompute_code6M_v_; text: .text%__1cJBlockListJblocks_do6MpFpnKBlockBegin__v_v_; -text: .text%__1cQUseCountComputerXbasic_compute_use_count6FpnKBlockBegin__v_: c1_IR.o; -text: .text%__1cQUseCountComputerQupdate_use_count6FppnLInstruction__v_: c1_IR.o; text: .text%__1cFLocalIas_Local6M_p0_: c1_GraphBuilder.o; -text: .text%__1cKStateSplitPstate_values_do6MpFppnLInstruction__v_v_; -text: .text%__1cKValueStackJvalues_do6MpFppnLInstruction__v_v_; text: .text%__1cLCompilationIemit_lir6M_v_; text: .text%__1cLInstructionGas_Phi6M_pnDPhi__: c1_Canonicalizer.o; text: .text%__1cMas_BasicType6FpnJValueType__nJBasicType__; @@ -1888,14 +1800,11 @@ text: .text%__1cLOopRecorderIoop_size6M_i_; text: .text%__1cYDebugInformationRecorderIpcs_size6M_i_; text: .text%__1cYDebugInformationRecorderJdata_size6M_i_; text: .text%__1cHnmethod2n6FIi_pv_; -text: .text%__1cHnmFlagsFclear6M_v_; text: .text%__1cYDebugInformationRecorderHcopy_to6MpnHnmethod__v_; -text: .text%__1cLOopRecorderHcopy_to6MpnICodeBlob__v_; text: .text%__1cIUniverseMnon_oop_word6F_pv_; text: .text%__1cHnmethodQcopy_scopes_data6MpCi_v_; text: .text%__1cGPcDesc2t6Miii_v_; text: .text%__1cJCodeCacheGcommit6FpnICodeBlob__v_; -text: .text%__1cFVTuneOcreate_nmethod6FpnHnmethod__v_; text: .text%__1cWImplicitExceptionTableHcopy_to6MpnHnmethod__v_; text: .text%__1cKNativeJumpbEcheck_verified_entry_alignment6FpC1_v_; text: .text%__1cFciEnvKcompile_id6M_I_; @@ -1938,8 +1847,6 @@ text: .text%__1cNCanonicalizerOdo_NewInstance6MpnLNewInstance__v_; text: .text%__1cKValueStackMclear_locals6M_v_; text: .text%__1cMGraphBuilderIstack_op6MnJBytecodesECode__v_; text: .text%__1cMGraphBuilderGinvoke6MnJBytecodesECode__v_; -text: .text%__1cFciEnvTget_method_by_index6MpnPciInstanceKlass_inJBytecodesECode__pnIciMethod__; -text: .text%__1cFciEnvYget_method_by_index_impl6MpnPciInstanceKlass_inJBytecodesECode__pnIciMethod__; text: .text%__1cFciEnvbTget_instance_klass_for_declared_method_holder6FpnHciKlass__pnPciInstanceKlass__; text: .text%__1cPciObjectFactoryTget_unloaded_method6MpnPciInstanceKlass_pnIciSymbol_4_pnIciMethod__; text: .text%__1cIciMethod2t6MpnPciInstanceKlass_pnIciSymbol_4_v_; @@ -1951,18 +1858,13 @@ text: .text%__1cKValueStackNpop_arguments6Mi_pnGValues__; text: .text%__1cGInvokeFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cNCanonicalizerJdo_Invoke6MpnGInvoke__v_; text: .text%__1cGInvokeJas_Invoke6M_p0_: c1_Instruction.o; -text: .text%__1cFThrowFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cNCanonicalizerIdo_Throw6MpnFThrow__v_; -text: .text%__1cFThrowIas_Throw6M_p0_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorOdo_NewInstance6MpnLNewInstance__v_; text: .text%__1cTNullCheckEliminatorShandle_NewInstance6MpnLNewInstance__v_; -text: .text%__1cGInvokePinput_values_do6MpFppnLInstruction__v_v_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorJdo_Invoke6MpnGInvoke__v_; text: .text%__1cTNullCheckEliminatorNhandle_Invoke6MpnGInvoke__v_; -text: .text%__1cFThrowPinput_values_do6MpFppnLInstruction__v_v_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorIdo_Throw6MpnFThrow__v_; text: .text%__1cLInstructionGnegate6Fn0AJCondition__1_; -text: .text%__1cFThrowPstate_values_do6MpFppnLInstruction__v_v_; text: .text%__1cIVoidTypeLas_VoidType6M_p0_: c1_ValueType.o; text: .text%__1cLNewInstanceKexact_type6kM_pnGciType__; text: .text%__1cLNewInstanceOas_NewInstance6M_p0_: c1_Instruction.o; @@ -1975,7 +1877,6 @@ text: .text%__1cPNewInstanceStubEinfo6kM_pnMCodeEmitInfo__: c1_CodeStubs_x86.o; text: .text%__1cNLIR_AssemblerJemit_call6MpnOLIR_OpJavaCall__v_; text: .text%__1cNLIR_AssemblerKalign_call6MnILIR_Code__v_; text: .text%__1cICodeStubEinfo6kM_pnMCodeEmitInfo__: c1_CodeStubs_x86.o; -text: .text%__1cNLIR_AssemblerEcall6MpCnJrelocInfoJrelocType_pnMCodeEmitInfo__v_; text: .text%__1cbBopt_virtual_call_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; text: .text%__1cYinternal_word_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; text: .text%__1cJrelocInfoKset_format6Mi_v_; @@ -2021,9 +1922,6 @@ text: .text%__1cMGraphBuilderUclear_inline_bailout6M_v_; text: .text%__1cMGraphBuilderWrecursive_inline_level6kMpnIciMethod__i_; text: .text%__1cPciObjectFactoryMvm_symbol_at6Fi_pnIciSymbol__; text: .text%__1cNCanonicalizerMdo_NullCheck6MpnJNullCheck__v_; -text: .text%__1cKValueStackKpush_scope6MpnHIRScope__p0_; -text: .text%__1cHIRScopeXcompute_lock_stack_size6M_v_; -text: .text%__1cMGraphBuilderJScopeDataRcaller_stack_size6kM_i_; text: .text%__1cMGraphBuilderJScopeDataLnum_returns6M_i_; text: .text%__1cMGraphBuilderJScopeDataXset_inline_cleanup_info6MpnKBlockBegin_pnLInstruction_pnKValueStack__v_; text: .text%__1cMGraphBuilderJScopeDataQincr_num_returns6M_v_; @@ -2033,12 +1931,8 @@ text: .text%__1cFciEnvVnotice_inlined_method6MpnIciMethod__v_; text: .text%__1cMLinkResolverbCresolve_special_call_or_null6FnLKlassHandle_nMsymbolHandle_21_nMmethodHandle__; text: .text%__1cMGraphBuilderOinline_bailout6Mpkc_v_; text: .text%__1cLInstructionEprev6MpnKBlockBegin__p0_; -text: .text%__1cKBlockBeginPblock_values_do6MpFppnLInstruction__v_v_; -text: .text%__1cIConstantPother_values_do6MpFppnLInstruction__v_v_; -text: .text%__1cIBlockEndPother_values_do6MpFppnLInstruction__v_v_; text: .text%__1cQNullCheckVisitorMdo_NullCheck6MpnJNullCheck__v_; text: .text%__1cTNullCheckEliminatorQhandle_NullCheck6MpnJNullCheck__v_; -text: .text%__1cHIRScopeNtop_scope_bci6kM_i_; text: .text%__1cNSharedRuntimeQfind_callee_info6FpnKJavaThread_rnJBytecodesECode_rnICallInfo_pnGThread__nGHandle__; text: .text%__1cGPcDescHreal_pc6kMpknHnmethod__pC_; text: .text%__1cLPcDescCacheLadd_pc_desc6MpnGPcDesc__v_; @@ -2055,14 +1949,11 @@ text: .text%__1cKNativeCallXset_destination_mt_safe6MpC_v_; text: .text%__1cNmethodOopDescTverified_code_entry6M_pC_; text: .text%jni_GetByteArrayRegion: jni.o; text: .text%JVM_DefineClassWithSource; -text: .text%__1cXjvm_define_class_common6FpnHJNIEnv__pkcpnI_jobject_pkWi53pnGThread__pnH_jclass__: jvm.o; -text: .text%__1cQSystemDictionaryTresolve_from_stream6FnMsymbolHandle_nGHandle_2pnPClassFileStream_pnGThread__pnMklassOopDesc__; text: .text%__1cPClassFileParserbDverify_legal_method_signature6MnMsymbolHandle_1pnGThread__i_; text: .text%__1cPClassFileParserXverify_legal_class_name6MnMsymbolHandle_pnGThread__v_; text: .text%__1cQSystemDictionarybAvalidate_protection_domain6FnTinstanceKlassHandle_nGHandle_2pnGThread__v_; text: .text%__1cKDictionaryVadd_protection_domain6MiInTinstanceKlassHandle_nGHandle_2pnGThread__v_; text: .text%__1cPDictionaryEntryVadd_protection_domain6MpnHoopDesc__v_; -text: .text%__1cUverify_byte_codes_fn6F_pv_: verifier.o; text: .text%JVM_GetClassCPEntriesCount; text: .text%JVM_GetClassCPTypes; text: .text%JVM_GetClassNameUTF; @@ -2124,7 +2015,6 @@ text: .text%__1cIOSThread2T6M_v_; text: .text%__1cIOSThreadKpd_destroy6M_v_; text: .text%jni_DestroyJavaVM; text: .text%jni_AttachCurrentThread; -text: .text%attach_current_thread: jni.o; text: .text%__1cKJavaThreadVinvoke_shutdown_hooks6M_v_; text: .text%__1cLbefore_exit6FpnKJavaThread__v_; text: .text%__1cNWatcherThreadEstop6F_v_; @@ -2139,7 +2029,6 @@ text: .text%__1cCosXterminate_signal_thread6F_v_; text: .text%__1cCosNsigexitnum_pd6F_i_; text: .text%__1cCosNsignal_notify6Fi_v_; text: .text%__1cQprint_statistics6F_v_; -text: .text%__1cFVTuneEexit6F_v_; text: .text%__1cIVMThreadXwait_for_vm_thread_exit6F_v_; text: .text%__1cUSafepointSynchronizeFbegin6F_v_; text: .text%__1cORuntimeServiceWrecord_safepoint_begin6F_v_; @@ -2158,7 +2047,6 @@ text: .text%__1cQSystemDictionaryRnumber_of_classes6F_i_; text: .text%__1cQSystemDictionaryStry_get_next_class6F_pnMklassOopDesc__; text: .text%__1cKDictionaryStry_get_next_class6M_pnMklassOopDesc__; text: .text%__1cNinstanceKlassKmethods_do6MpFpnNmethodOopDesc__v_v_; -text: .text%__1cONMethodSweeperFsweep6F_v_; text: .text%__1cNCompileBrokerQset_should_block6F_v_; text: .text%__1cHVM_ExitbJwait_for_threads_in_native_to_block6F_i_; text: .text%__1cIVMThreadHdestroy6F_v_; @@ -2171,8 +2059,6 @@ text: .text%__1cPPerfDataManagerHdestroy6F_v_; text: .text%__1cIPerfData2T6M_v_; text: .text%__1cKPerfMemoryHdestroy6F_v_; text: .text%__1cKPerfMemoryUdelete_memory_region6F_v_; -text: .text%__1cUdelete_shared_memory6FpcI_v_: perfMemory_solaris.o; -text: .text%__1cLremove_file6Fpkc_v_: perfMemory_solaris.o; text: .text%__1cMostream_exit6F_v_; text: .text%__SLIP.DELETER__C: ostream.o; text: .text%JVM_Halt; @@ -2206,14 +2092,10 @@ text: .text%jni_IsAssignableFrom: jni.o; text: .text%__1cOGenerateOopMapGdo_ldc6Mii_v_; text: .text%__1cQComputeCallStackIdo_array6Mii_v_: generateOopMap.o; text: .text%__1cMGraphBuilderNload_constant6M_v_; -text: .text%__1cQciBytecodeStreamSget_constant_index6kM_i_; -text: .text%__1cFciEnvVget_constant_by_index6MpnPciInstanceKlass_i_nKciConstant__; -text: .text%__1cFciEnvbAget_constant_by_index_impl6MpnPciInstanceKlass_i_nKciConstant__; text: .text%__1cMLinkResolverbBresolve_static_call_or_null6FnLKlassHandle_nMsymbolHandle_21_nMmethodHandle__; text: .text%__1cJValueTypeLas_VoidType6M_pnIVoidType__: c1_Canonicalizer.o; text: .text%__1cWstatic_call_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; text: .text%__1cRComputeEntryStackIdo_array6Mii_v_: generateOopMap.o; -text: .text%__1cEIfOpPinput_values_do6MpFppnLInstruction__v_v_: c1_Instruction.o; text: .text%__1cEIfOpFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorHdo_IfOp6MpnEIfOp__v_; text: .text%__1cOGenerateOopMapMdo_checkcast6M_v_; @@ -2223,12 +2105,10 @@ text: .text%__1cNCanonicalizerNdo_InstanceOf6MpnKInstanceOf__v_; text: .text%__1cKInstanceOfNas_InstanceOf6M_p0_: c1_GraphBuilder.o; text: .text%__1cMGraphBuilderKcheck_cast6Mi_v_; text: .text%__1cNCanonicalizerMdo_CheckCast6MpnJCheckCast__v_; -text: .text%__1cJTypeCheckPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorNdo_InstanceOf6MpnKInstanceOf__v_; text: .text%__1cQNullCheckVisitorMdo_CheckCast6MpnJCheckCast__v_; text: .text%__1cTSimpleExceptionStubFvisit6MpnQLIR_OpVisitState__v_: c1_CodeStubs_x86.o; text: .text%__1cNLIR_AssemblerQemit_opTypeCheck6MpnPLIR_OpTypeCheck__v_; -text: .text%__1cIciObjectIencoding6M_pnI_jobject__; text: .text%__1cTSimpleExceptionStubEinfo6kM_pnMCodeEmitInfo__: c1_CodeStubs_x86.o; text: .text%__1cTSimpleExceptionStubJemit_code6MpnNLIR_Assembler__v_; text: .text%__1cJLoadFieldMas_LoadField6M_p0_: c1_Instruction.o; @@ -2266,8 +2146,6 @@ text: .text%__1cHConvertEname6kM_pkc_: c1_GraphBuilder.o; text: .text%__1cMGraphBuilderNstore_indexed6MnJBasicType__v_; text: .text%__1cIValueMapKkill_array6MpnJValueType__v_; text: .text%__1cNCanonicalizerPdo_StoreIndexed6MpnMStoreIndexed__v_; -text: .text%__1cLAccessFieldPother_values_do6MpFppnLInstruction__v_v_; -text: .text%__1cHConvertPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorKdo_LogicOp6MpnHLogicOp__v_; text: .text%__1cQNullCheckVisitorKdo_Convert6MpnHConvert__v_; text: .text%__1cQNullCheckVisitorPdo_StoreIndexed6MpnMStoreIndexed__v_; @@ -2294,10 +2172,8 @@ text: .text%__1cMGraphBuilderOnew_type_array6M_v_; text: .text%__1cMNewTypeArrayFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cNCanonicalizerPdo_NewTypeArray6MpnMNewTypeArray__v_; text: .text%__1cNCanonicalizerMdo_Intrinsic6MpnJIntrinsic__v_; -text: .text%__1cLAccessArrayPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorOdo_ArrayLength6MpnLArrayLength__v_; text: .text%__1cTNullCheckEliminatorShandle_ArrayLength6MpnLArrayLength__v_; -text: .text%__1cINewArrayPinput_values_do6MpFppnLInstruction__v_v_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorPdo_NewTypeArray6MpnMNewTypeArray__v_; text: .text%__1cTNullCheckEliminatorPhandle_NewArray6MpnINewArray__v_; text: .text%__1cQNullCheckVisitorMdo_Intrinsic6MpnJIntrinsic__v_; @@ -2309,7 +2185,6 @@ text: .text%__1cMNewTypeArrayKexact_type6kM_pnGciType__; text: .text%__1cLArrayLengthOas_ArrayLength6M_p0_: c1_GraphBuilder.o; text: .text%__1cILIR_ListUunsigned_shift_right6MpnLLIR_OprDesc_222_v_; text: .text%__1cQNewTypeArrayStubFvisit6MpnQLIR_OpVisitState__v_: c1_CodeStubs_x86.o; -text: .text%__1cNLIR_AssemblerHic_call6MpCpnMCodeEmitInfo__v_; text: .text%__1cXvirtual_call_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; text: .text%__1cNLIR_AssemblerQemit_alloc_array6MpnQLIR_OpAllocArray__v_; text: .text%__1cNLIR_AssemblerSarray_element_size6kMnJBasicType__nHAddressLScaleFactor__; @@ -2335,8 +2210,6 @@ text: .text%__1cRInlineCacheBufferLnew_ic_stub6F_pnGICStub__; text: .text%JVM_NewArray; text: .text%__1cKReflectionRreflect_new_array6FpnHoopDesc_ipnGThread__pnMarrayOopDesc__; text: .text%__1cSInterpreterRuntimeOmultianewarray6FpnKJavaThread_pi_v_; -text: .text%__1cNinstanceKlassSlookup_osr_nmethod6kMkpnNmethodOopDesc_i_pnHnmethod__; -text: .text%__1cQSimpleCompPolicyYmethod_back_branch_event6MnMmethodHandle_iipnGThread__v_; text: .text%__1cMGraphBuilderQnew_object_array6M_v_; text: .text%__1cONewObjectArrayFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cNCanonicalizerRdo_NewObjectArray6MpnONewObjectArray__v_; @@ -2349,7 +2222,6 @@ text: .text%__1cHShiftOpEhash6kM_i_: c1_GraphBuilder.o; text: .text%__1cHShiftOpEname6kM_pkc_: c1_GraphBuilder.o; text: .text%__1cLLoadIndexedOas_LoadIndexed6M_p0_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorRdo_NewObjectArray6MpnONewObjectArray__v_; -text: .text%__1cDOp2Pinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorKdo_ShiftOp6MpnHShiftOp__v_; text: .text%__1cHciKlassMaccess_flags6M_i_; text: .text%__1cPciObjArrayKlassEmake6FpnHciKlass__p0_; @@ -2413,7 +2285,6 @@ text: .text%__1cQDefNewGenerationTallocate_from_space6MI_pnIHeapWord__; text: .text%__1cPVM_GC_OperationZacquire_pending_list_lock6M_v_; text: .text%__1cQinstanceRefKlassZacquire_pending_list_lock6FpnJBasicLock__v_; text: .text%__1cbAVM_GenCollectForAllocationEdoit6M_v_; -text: .text%__1cPGCMemoryManagerIgc_begin6M_v_; text: .text%__1cKManagementJtimestamp6F_x_; text: .text%__1cTContiguousSpacePoolQget_memory_usage6M_nLMemoryUsage__; text: .text%__1cTContiguousSpacePoolNused_in_bytes6M_I_: memoryPool.o; @@ -2441,11 +2312,7 @@ text: .text%__1cKSharedHeapbAchange_strong_roots_parity6M_v_; text: .text%__1cPFastScanClosureGdo_oop6MppnHoopDesc__v_: defNewGeneration.o; text: .text%__1cKJNIHandlesHoops_do6FpnKOopClosure__v_; text: .text%__1cOJNIHandleBlockHoops_do6MpnKOopClosure__v_; -text: .text%__1cHThreadsHoops_do6FpnKOopClosure__v_; -text: .text%__1cKJavaThreadHoops_do6MpnKOopClosure__v_; -text: .text%__1cGThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cKHandleAreaHoops_do6MpnKOopClosure__v_; -text: .text%__1cNchunk_oops_do6FpnKOopClosure_pnFChunk_pc_I_: handles.o; text: .text%__1cFframeVinterpreter_frame_bci6kM_i_; text: .text%__1cFframebDinterpreter_frame_monitor_end6kM_pnPBasicObjectLock__; text: .text%__1cFframebFinterpreter_frame_monitor_begin6kM_pnPBasicObjectLock__; @@ -2483,7 +2350,6 @@ text: .text%__1cQComputeCallStackHdo_long6M_v_: generateOopMap.o; text: .text%__1cOGenerateOopMapOdo_monitorexit6Mi_v_; text: .text%__1cOGenerateOopMapLmonitor_pop6M_nNCellTypeState__; text: .text%__1cRComputeEntryStackHdo_long6M_v_: generateOopMap.o; -text: .text%__1cIVMThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cQVMOperationQdDueueHoops_do6MpnKOopClosure__v_; text: .text%__1cQVMOperationQdDueueNqueue_oops_do6MipnKOopClosure__v_; text: .text%__1cSObjectSynchronizerHoops_do6FpnKOopClosure__v_; @@ -2584,7 +2450,6 @@ text: .text%__1cUGenGCEpilogueClosureNdo_generation6MpnKGeneration__v_: genColle text: .text%__1cRTenuredGenerationPupdate_counters6M_v_; text: .text%__1cUCompactingPermGenGenPupdate_counters6M_v_; text: .text%__1cXTraceMemoryManagerStats2T6M_v_; -text: .text%__1cPGCMemoryManagerGgc_end6M_v_; text: .text%__1cRLowMemoryDetectorWdetect_after_gc_memory6FpnKMemoryPool__v_; text: .text%__1cNJvmtiGCMarker2T6M_v_; text: .text%__1cPVM_GC_OperationNdoit_epilogue6M_v_; @@ -2597,7 +2462,6 @@ text: .text%jni_PopLocalFrame: jni.o; text: .text%__1cMGraphBuilderJnegate_op6MpnJValueType__v_; text: .text%__1cINegateOpFvisit6MpnSInstructionVisitor__v_: c1_GraphBuilder.o; text: .text%__1cNCanonicalizerLdo_NegateOp6MpnINegateOp__v_; -text: .text%__1cINegateOpPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorLdo_NegateOp6MpnINegateOp__v_; text: .text%__1cILIR_ListLstore_check6MpnLLIR_OprDesc_2222pnMCodeEmitInfo__v_; text: .text%__1cXArrayStoreExceptionStub2t6MpnMCodeEmitInfo__v_; @@ -2637,7 +2501,6 @@ text: .text%__1cYjava_lang_reflect_MethodLreturn_type6FpnHoopDesc__2_; text: .text%JVM_IsInterrupted; text: .text%__1cTresource_free_bytes6FpcI_v_; text: .text%__1cRComputeEntryStackHdo_bool6M_v_: generateOopMap.o; -text: .text%__1cMArithmeticOpKlock_stack6kM_pnKValueStack__: c1_Instruction.o; text: .text%__1cJAssemblerGfist_s6MnHAddress__v_; text: .text%__1cNLIR_AssemblerJreset_FPU6M_v_; text: .text%__1cNLIR_AssemblerIemit_op36MpnHLIR_Op3__v_; @@ -2659,7 +2522,6 @@ text: .text%__1cUBytecode_tableswitchOdest_offset_at6kMi_i_; text: .text%__1cMGraphBuilderMtable_switch6M_v_; text: .text%__1cLTableSwitchFvisit6MpnSInstructionVisitor__v_: c1_GraphBuilder.o; text: .text%__1cNCanonicalizerOdo_TableSwitch6MpnLTableSwitch__v_; -text: .text%__1cGSwitchPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorOdo_TableSwitch6MpnLTableSwitch__v_; text: .text%__1cWstatic_call_RelocationLstatic_stub6M_pC_; text: .text%__1cSCompiledStaticCallMset_to_clean6M_v_; @@ -2672,7 +2534,6 @@ text: .text%__1cNFingerprinterHdo_byte6M_v_: dump.o; text: .text%Unsafe_SetMemory; text: .text%__1cNSharedRuntimeElrem6Fxx_x_; text: .text%Unsafe_DefineClass1; -text: .text%__1cSUnsafe_DefineClass6FpnHJNIEnv__pnI_jstring_pnL_jbyteArray_iipnI_jobject_7_pnH_jclass__: unsafe.o; text: .text%JVM_DefineClass; text: .text%__1cVLoaderConstraintTableYextend_loader_constraint6MpnVLoaderConstraintEntry_nGHandle_pnMklassOopDesc__v_; text: .text%__1cVLoaderConstraintTablebHensure_loader_constraint_capacity6MpnVLoaderConstraintEntry_i_v_; @@ -2680,7 +2541,6 @@ text: .text%__1cIRuntime1Tprimitive_arraycopy6FpnIHeapWord_2i_v_; text: .text%__1cRComputeEntryStackHdo_char6M_v_: generateOopMap.o; text: .text%jni_NewDirectByteBuffer; text: .text%lookupDirectBufferClasses: jni.o; -text: .text%__1cJlookupOne6FpnHJNIEnv__pkcpnGThread__pnH_jclass__: jni.o; text: .text%__1cHJNIEnv_JNewObject6MpnH_jclass_pnK_jmethodID_E_pnI_jobject__: jni.o; text: .text%jni_GetDoubleArrayRegion: jni.o; text: .text%__1cNSignatureInfoJdo_double6M_v_: bytecode.o; @@ -2701,7 +2561,6 @@ text: .text%JVM_GetCPFieldModifiers; text: .text%__1cPClassFileParserUverify_constantvalue6MiinSconstantPoolHandle_pnGThread__v_; text: .text%JVM_MonitorNotify; text: .text%__1cSObjectSynchronizerGnotify6FnGHandle_pnGThread__v_; -text: .text%__1cKValueStackElock6MpnHIRScope_pnLInstruction__i_; text: .text%__1cKValueStackGunlock6M_i_; text: .text%__1cQMonitorEnterStubFvisit6MpnQLIR_OpVisitState__v_: c1_CodeStubs_x86.o; text: .text%__1cNLIR_AssemblerJemit_lock6MpnKLIR_OpLock__v_; @@ -2726,8 +2585,6 @@ text: .text%__1cbCOneContigSpaceCardGenerationLused_region6kM_nJMemRegion__; text: .text%__1cMGenMarkSweepPallocate_stacks6F_v_; text: .text%__1cQGenCollectedHeapOgather_scratch6MpnKGeneration_I_pnMScratchBlock__; text: .text%__1cQDefNewGenerationScontribute_scratch6MrpnMScratchBlock_pnKGeneration_I_v_; -text: .text%__1cRsort_scratch_list6FrpnMScratchBlock__v_: genCollectedHeap.o; -text: .text%__1cVremoveSmallestScratch6FppnMScratchBlock__1_: genCollectedHeap.o; text: .text%__1cJMarkSweepRFollowRootClosureGdo_oop6MppnHoopDesc__v_: markSweep.o; text: .text%__1cParrayKlassKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cLklassVtableToop_follow_contents6M_v_; @@ -2784,12 +2641,6 @@ text: .text%__1cbCOneContigSpaceCardGenerationWfirst_compaction_space6kM_pnQComp text: .text%__1cMGenMarkSweepRmark_sweep_phase36Fi_v_; text: .text%__1cUCompactingPermGenGenTpre_adjust_pointers6M_v_; text: .text%__1cJMarkSweepUAdjustPointerClosureGdo_oop6MppnHoopDesc__v_: markSweep.o; -text: .text%__1cJCodeCacheHoops_do6FpnKOopClosure__v_; -text: .text%__1cKBufferBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cSDeoptimizationBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cLRuntimeStubHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cNSafepointBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cHnmethodHoops_do6MpnKOopClosure__v_; text: .text%__1cJHashtableHoops_do6MpnKOopClosure__v_; text: .text%__1cJMarkSweepMadjust_marks6F_v_; text: .text%__1cYGenAdjustPointersClosureNdo_generation6MpnKGeneration__v_: genMarkSweep.o; @@ -2840,7 +2691,6 @@ text: .text%Unsafe_CompareAndSwapObject; text: .text%__1cMLinkResolverbEvtable_index_of_miranda_method6FnLKlassHandle_nMsymbolHandle_2pnGThread__i_; text: .text%__1cLklassVtableQindex_of_miranda6MpnNsymbolOopDesc_2_i_; text: .text%__1cRPrivilegedElementHoops_do6MpnKOopClosure__v_; -text: .text%__1cFframeRoops_code_blob_do6MpnKOopClosure_pknLRegisterMap__v_; text: .text%__1cMOopMapStream2t6MpnGOopMap_i_v_; text: .text%__1cQComputeCallStackIdo_float6M_v_: generateOopMap.o; text: .text%jni_DeleteWeakGlobalRef: jni.o; @@ -2849,7 +2699,6 @@ text: .text%JVM_IsSameClassPackage; text: .text%__1cNCanonicalizerPdo_MonitorEnter6MpnMMonitorEnter__v_; text: .text%__1cLMonitorExitFvisit6MpnSInstructionVisitor__v_: c1_GraphBuilder.o; text: .text%__1cNCanonicalizerOdo_MonitorExit6MpnLMonitorExit__v_; -text: .text%__1cNAccessMonitorPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorPdo_MonitorEnter6MpnMMonitorEnter__v_; text: .text%__1cTNullCheckEliminatorUhandle_AccessMonitor6MpnNAccessMonitor__v_; text: .text%__1cQNullCheckVisitorOdo_MonitorExit6MpnLMonitorExit__v_; @@ -2867,7 +2716,6 @@ text: .text%Unsafe_AllocateInstance; text: .text%jni_AllocObject: jni.o; text: .text%__1cQinstanceRefKlassUoop_oop_iterate_nv_m6MpnHoopDesc_pnQFilteringClosure_nJMemRegion__i_; text: .text%__1cNCanonicalizerMset_constant6Mi_v_: c1_Canonicalizer.o; -text: .text%__1cJTypeCheckPother_values_do6MpFppnLInstruction__v_v_; text: .text%__1cNLIR_AssemblerMcheck_icache6M_i_; text: .text%__1cNLIR_AssemblerZjobject2reg_with_patching6MpnMRegisterImpl_pnMCodeEmitInfo__v_; text: .text%__1cIRuntime1Mnew_instance6FpnKJavaThread_pnMklassOopDesc__v_; @@ -2878,7 +2726,6 @@ text: .text%__1cNFloatConstantQas_FloatConstant6M_p0_: c1_Canonicalizer.o; text: .text%__1cJFloatTypeMas_FloatType6M_p0_: c1_Canonicalizer.o; text: .text%__1cRAbstractAssemblerGa_long6Mi_v_; text: .text%__1cNObjectMonitorGnotify6MpnGThread__v_; -text: .text%__1cINewArrayPother_values_do6MpFppnLInstruction__v_v_; text: .text%__1cIRuntime1Mmonitorenter6FpnKJavaThread_pnHoopDesc_pnPBasicObjectLock__v_; text: .text%__1cIRuntime1Lmonitorexit6FpnKJavaThread_pnPBasicObjectLock__v_; text: .text%__1cNVM_DeoptimizeEdoit6M_v_; @@ -2887,14 +2734,8 @@ text: .text%__1cHThreadsbFdeoptimized_wrt_marked_nmethods6F_v_; text: .text%__1cKJavaThreadbFdeoptimized_wrt_marked_nmethods6M_v_; text: .text%__1cJCodeCachebGmake_marked_nmethods_not_entrant6F_v_; text: .text%__1cJCodeCacheNalive_nmethod6FpnICodeBlob__pnHnmethod__; -text: .text%__1cHnmethodbAmake_not_entrant_or_zombie6Mi_v_; text: .text%__1cKNativeJumpUpatch_verified_entry6FpC11_v_; text: .text%__1cHnmethodVmark_as_seen_on_stack6M_v_; -text: .text%__1cHThreadsLnmethods_do6F_v_; -text: .text%__1cKJavaThreadLnmethods_do6M_v_; -text: .text%__1cGThreadLnmethods_do6M_v_; -text: .text%__1cFframeLnmethods_do6M_v_; -text: .text%__1cFframeVnmethods_code_blob_do6M_v_; text: .text%__1cONMethodSweeperPprocess_nmethod6FpnHnmethod__v_; text: .text%__1cHnmethodVcleanup_inline_caches6M_v_; text: .text%__1cKCompiledIC2t6MpnKRelocation__v_; @@ -2902,14 +2743,9 @@ text: .text%JVM_HoldsLock; text: .text%__1cTMaskFillerForNativeIpass_int6M_v_: oopMapCache.o; text: .text%__1cNSharedRuntimeDf2l6Ff_x_; text: .text%__1cMGraphBuilderKcompare_op6MpnJValueType_nJBytecodesECode__v_; -text: .text%__1cJCompareOpFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cNCanonicalizerMdo_CompareOp6MpnJCompareOp__v_; -text: .text%__1cJCompareOpEhash6kM_i_: c1_Instruction.o; -text: .text%__1cJCompareOpEname6kM_pkc_: c1_Instruction.o; -text: .text%__1cJCompareOpMas_CompareOp6M_p0_: c1_Instruction.o; text: .text%__1cHnmethodSflush_dependencies6MpnRBoolObjectClosure__v_; text: .text%__1cNinstanceKlassYremove_dependent_nmethod6MpnHnmethod__v_; -text: .text%__1cFVTuneOdelete_nmethod6FpnHnmethod__v_; text: .text%__1cQPlaceholderEntryHoops_do6MpnKOopClosure__v_; text: .text%__1cHnmethodFflush6M_v_; text: .text%__1cICodeBlobFflush6M_v_; @@ -2951,9 +2787,7 @@ text: .text%__1cNCanonicalizerPdo_UnsafeGetRaw6MpnMUnsafeGetRaw__v_; text: .text%__1cMGraphBuilderNlookup_switch6M_v_; text: .text%__1cMLookupSwitchFvisit6MpnSInstructionVisitor__v_: c1_GraphBuilder.o; text: .text%__1cNCanonicalizerPdo_LookupSwitch6MpnMLookupSwitch__v_; -text: .text%__1cMUnsafePutRawPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorPdo_UnsafePutRaw6MpnMUnsafePutRaw__v_; -text: .text%__1cLUnsafeRawOpPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorPdo_UnsafeGetRaw6MpnMUnsafeGetRaw__v_; text: .text%__1cQNullCheckVisitorPdo_LookupSwitch6MpnMLookupSwitch__v_; text: .text%__1cNSharedRuntimeEldiv6Fxx_x_; diff --git a/hotspot/make/solaris/makefiles/reorder_COMPILER1_sparc b/hotspot/make/solaris/makefiles/reorder_COMPILER1_sparc index 541227310a6..45c02b4e690 100644 --- a/hotspot/make/solaris/makefiles/reorder_COMPILER1_sparc +++ b/hotspot/make/solaris/makefiles/reorder_COMPILER1_sparc @@ -135,7 +135,6 @@ text: .text%__1cNThreadServiceEinit6F_v_; text: .text%__1cPPerfDataManagerTcreate_long_counter6FnJCounterNS_pkcnIPerfDataFUnits_xpnGThread__pnPPerfLongCounter__; text: .text%__1cORuntimeServiceEinit6F_v_; text: .text%__1cTClassLoadingServiceEinit6F_v_; -text: .text%__1cKvtune_init6F_v_; text: .text%__1cObytecodes_init6F_v_; text: .text%__1cJBytecodesKinitialize6F_v_; text: .text%__1cJBytecodesNpd_initialize6F_v_; @@ -181,9 +180,7 @@ text: .text%__1cKMemoryPoolYrecord_peak_memory_usage6M_v_; text: .text%__1cMCodeHeapPoolQget_memory_usage6M_nLMemoryUsage__; text: .text%__1cMCodeHeapPoolNused_in_bytes6M_I_: memoryPool.o; text: .text%__1cICodeHeapSallocated_capacity6kM_I_; -text: .text%__1cKMemoryPoolImax_size6kM_I_: memoryPool.o; text: .text%__1cXresource_allocate_bytes6FI_pc_; -text: .text%__1cKCodeBuffer2t6MpCi_v_; text: .text%__1cRAbstractAssembler2t6MpnKCodeBuffer__v_; text: .text%__1cTICacheStubGeneratorVgenerate_icache_flush6MppFpCii_i_v_; text: .text%__1cMStubCodeMark2t6MpnRStubCodeGenerator_pkc4_v_; @@ -194,7 +191,6 @@ text: .text%__1cMStubCodeMark2T6M_v_; text: .text%__1cRAbstractAssemblerFflush6M_v_; text: .text%__1cOAbstractICacheQinvalidate_range6FpCi_v_; text: .text%__1cRStubCodeGeneratorLstub_epilog6MpnMStubCodeDesc__v_; -text: .text%__1cFVTuneNregister_stub6FpkcpC3_v_; text: .text%__1cFForteNregister_stub6FpkcpC3_v_; text: .text%__1cPVM_Version_init6F_v_; text: .text%jio_snprintf; @@ -314,10 +310,8 @@ text: .text%__1cLReadClosureGdo_ptr6MppnIHeapWord__v_: restore.o; text: .text%__1cLReadClosureGdo_ptr6Mppv_v_: restore.o; text: .text%__1cLReadClosureJdo_size_t6MpI_v_: restore.o; text: .text%__1cLReadClosureGdo_oop6MppnHoopDesc__v_: restore.o; -text: .text%__1cJCodeCacheHoops_do6FpnKOopClosure__v_; text: .text%__1cICodeHeapLfirst_block6kM_pnJHeapBlock__; text: .text%__1cICodeHeapJnext_free6kMpnJHeapBlock__pv_; -text: .text%__1cKBufferBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cICodeHeapLblock_start6kMpv_pnJHeapBlock__; text: .text%__1cICodeHeapKfind_start6kMpv_1_; text: .text%__1cICodeHeapKnext_block6kMpnJHeapBlock__2_; @@ -334,7 +328,6 @@ text: .text%__1cbCAbstractInterpreterGenerator2t6MpnJStubQdDueue__v_; text: .text%__1cbCAbstractInterpreterGeneratorMgenerate_all6M_v_; text: .text%__1cJStubQdDueueHrequest6Mi_pnEStub__; text: .text%__1cJStubQdDueueGcommit6Mi_v_; -text: .text%__1cZInterpreterMacroAssemblerbAget_cache_and_index_at_bcp6MpnMRegisterImpl_2i_v_; text: .text%__1cZInterpreterMacroAssemblerZget_2_byte_integer_at_bcp6MipnMRegisterImpl_2n0ALsignedOrNot_n0AKsetCCOrNot__v_; text: .text%__1cZInterpreterMacroAssemblerNdispatch_next6MnITosState_i_v_; text: .text%__1cOMacroAssemblerKverify_FPU6Mipkc_v_; @@ -357,7 +350,6 @@ text: .text%__1cZInterpreterMacroAssemblerNunlock_object6MpnMRegisterImpl__v_; text: .text%__1cQRelocationHolderEplus6kMi_0_; text: .text%__1cOMacroAssemblerMcall_VM_leaf6MpnMRegisterImpl_pC222_v_; text: .text%__1cOMacroAssemblerNset_vm_result6MpnMRegisterImpl__v_; -text: .text%__1cZInterpreterMacroAssemblerSsuper_call_VM_leaf6MpnMRegisterImpl_pC2_v_; text: .text%__1cOMacroAssemblerRcall_VM_leaf_base6MpnMRegisterImpl_pCi_v_; text: .text%__1cbCAbstractInterpreterGeneratorVgenerate_method_entry6MnTAbstractInterpreterKMethodKind__pC_; text: .text%__1cUInterpreterGeneratorVgenerate_counter_incr6MpnFLabel_22_v_; @@ -513,7 +505,6 @@ text: .text%__1cZInterpreterMacroAssemblerWprofile_switch_default6MpnMRegisterIm text: .text%__1cNTemplateTableMlookupswitch6F_v_; text: .text%__1cNTemplateTableH_return6FnITosState__v_; text: .text%__1cNTemplateTableJgetstatic6Fi_v_; -text: .text%__1cNTemplateTableXresolve_cache_and_index6FipnMRegisterImpl_2_v_; text: .text%__1cNTemplateTableJputstatic6Fi_v_; text: .text%__1cNTemplateTableIgetfield6Fi_v_; text: .text%__1cOMacroAssemblerKnull_check6MpnMRegisterImpl_i_v_; @@ -521,7 +512,6 @@ text: .text%__1cNTemplateTableIputfield6Fi_v_; text: .text%__1cNTemplateTableNinvokevirtual6Fi_v_; text: .text%__1cNTemplateTableTinvokevfinal_helper6FpnMRegisterImpl_2_v_; text: .text%__1cZInterpreterMacroAssemblerSprofile_final_call6MpnMRegisterImpl__v_; -text: .text%__1cZInterpreterMacroAssemblerUprofile_virtual_call6MpnMRegisterImpl_2_v_; text: .text%__1cNTemplateTableUgenerate_vtable_call6FpnMRegisterImpl_22_v_; text: .text%__1cNTemplateTableNinvokespecial6Fi_v_; text: .text%__1cZInterpreterMacroAssemblerMprofile_call6MpnMRegisterImpl__v_; @@ -629,8 +619,6 @@ text: .text%__1cQjni_handles_init6F_v_; text: .text%__1cOvmStructs_init6F_v_; text: .text%__1cMRegisterImplEname6kM_pkc_; text: .text%__1cRFloatRegisterImplEname6kM_pkc_; -text: .text%__1cIFrameMapEinit6F_v_; -text: .text%__1cIRuntime1Kinitialize6F_v_; text: .text%__1cIRuntime1Ninitialize_pd6F_v_; text: .text%__1cNSharedRuntimeTgenerate_deopt_blob6F_v_; text: .text%__1cOMacroAssemblerZtotal_frame_size_in_bytes6Mi_i_; @@ -689,7 +677,6 @@ text: .text%__1cEUTF8Sconvert_to_unicode6FpkcpHi_v_; text: .text%__1cNinstanceKlassRallocate_instance6MpnGThread__pnPinstanceOopDesc__; text: .text%__1cTjava_lang_ThrowableLset_message6FpnHoopDesc_2_v_; text: .text%__1cMNativeLookupTbase_library_lookup6Fpkc22_pC_; -text: .text%__1cKoopFactoryKnew_symbol6FpkcipnGThread__pnNsymbolOopDesc__; text: .text%__1cLSymbolTableGlookup6FpkcipnGThread__pnNsymbolOopDesc__; text: .text%__1cNinstanceKlassWuncached_lookup_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cMstringStream2t6MI_v_; @@ -788,8 +775,6 @@ text: .text%__1cXSignatureHandlerLibraryOpd_set_handler6FpC_v_; text: .text%__1cNmethodOopDescVset_signature_handler6MpC_v_; text: .text%jni_RegisterNatives: jni.o; text: .text%__1cPjava_lang_ClassLas_klassOop6FpnHoopDesc__pnMklassOopDesc__; -text: .text%__1cLSymbolTableFprobe6Fpkci_pnNsymbolOopDesc__; -text: .text%__1cFKlassNlookup_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cOJNIHandleBlockNrelease_block6Fp0pnGThread__v_; text: .text%__1cSObjectSynchronizerJnotifyall6FnGHandle_pnGThread__v_; text: .text%__1cSInterpreterRuntimeJanewarray6FpnKJavaThread_pnTconstantPoolOopDesc_ii_v_; @@ -829,7 +814,6 @@ text: .text%__1cbBcreate_initial_thread_group6FpnGThread__nGHandle__: thread.o; text: .text%__1cJJavaCallsMcall_special6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_5pnGThread__v_; text: .text%__1cJJavaCallsMcall_special6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_533pnGThread__v_; text: .text%__1cNmethodOopDescIbci_from6kMpC_i_; -text: .text%__1cPBytecode_invokeJsignature6kM_pnNsymbolOopDesc__; text: .text%__1cNmethodOopDescIbcp_from6kMi_pC_; text: .text%__1cFframebGinterpreter_callee_receiver_addr6MnMsymbolHandle__ppnHoopDesc__; text: .text%__1cRSignatureIteratorSiterate_parameters6M_v_; @@ -983,7 +967,6 @@ text: .text%jni_GetStringUTFLength: jni.o; text: .text%__1cQjava_lang_StringLutf8_length6FpnHoopDesc__i_; text: .text%__1cHUNICODELutf8_length6FpHi_i_; text: .text%jni_GetStringLength: jni.o; -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; @@ -1022,7 +1005,6 @@ text: .text%__1cbDjava_lang_reflect_ConstructorEslot6FpnHoopDesc__i_; text: .text%__1cbIjava_lang_reflect_AccessibleObjectIoverride6FpnHoopDesc__C_; text: .text%__1cbDjava_lang_reflect_ConstructorPparameter_types6FpnHoopDesc__2_; text: .text%__1cLClassLoaderOload_classfile6FnMsymbolHandle_pnGThread__nTinstanceKlassHandle__; -text: .text%__1cFVTuneQstart_class_load6F_v_; text: .text%__1cJEventMark2t6MpkcE_v_: classLoader.o; text: .text%__1cSThreadProfilerMark2t6Mn0AGRegion__v_; text: .text%__1cRClassPathZipEntryLopen_stream6Mpkc_pnPClassFileStream__; @@ -1060,8 +1042,6 @@ text: .text%__1cPClassFileParserMsort_methods6MnOobjArrayHandle_111pnGThread__nP text: .text%method_compare: methodOop.o; text: .text%__1cLklassItableTcompute_itable_size6FnOobjArrayHandle__i_; text: .text%__1cUvisit_all_interfaces6FpnPobjArrayOopDesc_pnXInterfaceVisiterClosure__v_; -text: .text%__1cKoopFactoryRnew_instanceKlass6FiiiinNReferenceType_pnGThread__pnMklassOopDesc__; -text: .text%__1cSinstanceKlassKlassXallocate_instance_klass6MiiiinNReferenceType_pnGThread__pnMklassOopDesc__; text: .text%__1cNinstanceKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: instanceKlass.o; text: .text%__1cNinstanceKlassOset_alloc_size6MI_v_: instanceKlass.o; text: .text%__1cNinstanceKlassQinit_implementor6M_v_; @@ -1077,7 +1057,6 @@ text: .text%__1cPClassFileParserVset_precomputed_flags6MnTinstanceKlassHandle__v text: .text%__1cPClassFileParserbCcheck_super_interface_access6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cPClassFileParserbBcheck_final_method_override6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cSThreadProfilerMark2T6M_v_; -text: .text%__1cFVTuneOend_class_load6F_v_; text: .text%__1cIRewriterHrewrite6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cYconstantPoolCacheOopDescKinitialize6MrnIintArray__v_; text: .text%JVM_MaxMemory; @@ -1091,15 +1070,11 @@ text: .text%Unsafe_FreeMemory; text: .text%__1cNSignatureInfoIdo_float6M_v_: bytecode.o; text: .text%jni_NewObjectV: jni.o; text: .text%jni_GetStringRegion: jni.o; -text: .text%__1cQjava_lang_StringGoffset6FpnHoopDesc__i_; -text: .text%__1cQjava_lang_StringFvalue6FpnHoopDesc__pnQtypeArrayOopDesc__; text: .text%jni_GetObjectField: jni.o; text: .text%jni_GetStringCritical: jni.o; text: .text%jni_ReleaseStringCritical: jni.o; text: .text%__1cQSimpleCompPolicyXmethod_invocation_event6MnMmethodHandle_pnGThread__v_; text: .text%__1cRInvocationCounterJset_carry6M_v_; -text: .text%__1cNCompileBrokerOcompile_method6FnMmethodHandle_i1ipkcpnGThread__pnHnmethod__; -text: .text%__1cQSimpleCompPolicyRcompilation_level6MnMmethodHandle_i_i_; text: .text%__1cNinstanceKlassUfind_interface_field6kMpnNsymbolOopDesc_2pnPfieldDescriptor__pnMklassOopDesc__; text: .text%JVM_LoadLibrary; text: .text%JVM_FindLibraryEntry; @@ -1153,7 +1128,6 @@ text: .text%__1cJJavaCallsMcall_special6FpnJJavaValue_nGHandle_nLKlassHandle_nMs text: .text%__1cCosOsignal_init_pd6F_v_; text: .text%__1cQjava_lang_ThreadKset_daemon6FpnHoopDesc__v_; text: .text%__1cICompiler2t6M_v_; -text: .text%__1cNCompileBrokerVinit_compiler_threads6Fi_v_; text: .text%__1cQCompilerCounters2t6MpkcipnGThread__v_; text: .text%__1cNCompileBrokerUmake_compiler_thread6FpkcpnMCompileQdDueue_pnQCompilerCounters_pnGThread__pnOCompilerThread__; text: .text%__1cTsignal_thread_entry6FpnKJavaThread_pnGThread__v_: os.o; @@ -1188,7 +1162,6 @@ text: .text%__1cRLowMemoryDetectorbGlow_memory_detector_thread_entry6FpnKJavaThr text: .text%__1cKPerfStringKset_string6Mpkc_v_; text: .text%__1cPciObjectFactory2t6MpnFArena_i_v_; text: .text%__1cPciObjectFactoryTinit_shared_objects6M_v_; -text: .text%__1cIciSymbol2t6MnMsymbolHandle__v_; text: .text%__1cIciObject2t6MnGHandle__v_; text: .text%__1cIciObjectJset_ident6MI_v_; text: .text%__1cGciType2t6MnJBasicType__v_; @@ -1267,7 +1240,6 @@ text: .text%__1cOGenerateOopMapYrewrite_refval_conflicts6M_v_; text: .text%__1cOGenerateOopMapNreport_result6M_v_; text: .text%__1cLCompilationJbuild_hir6M_v_; text: .text%__1cCIR2t6MpnLCompilation_pnIciMethod_i_v_; -text: .text%__1cJValueTypeKinitialize6F_v_; text: .text%__1cMciNullObjectEmake6F_p0_; text: .text%__1cMGraphBuilderKinitialize6F_v_; text: .text%__1cJXHandlers2t6MpnIciMethod__v_; @@ -1275,13 +1247,11 @@ text: .text%__1cIciMethodJload_code6M_v_; text: .text%__1cLCompilationTdebug_info_recorder6kM_pnYDebugInformationRecorder__; text: .text%__1cHIRScopeLbuild_graph6MpnLCompilation_i_pnKBlockBegin__; text: .text%__1cQBlockListBuilderLset_leaders6M_v_; -text: .text%__1cKValueStack2t6MpnHIRScope_ii_v_; text: .text%__1cLciSignatureHtype_at6kMi_pnGciType__; text: .text%__1cMas_ValueType6FnJBasicType__pnJValueType__; text: .text%__1cIValueMap2t6M_v_; text: .text%__1cNResourceArrayGexpand6MIiri_v_; text: .text%__1cIValueMapIkill_all6M_v_; -text: .text%__1cKValueStackEcopy6M_p0_; text: .text%__1cMGraphBuilderbBiterate_bytecodes_for_block6Mi_pnIBlockEnd__; text: .text%__1cMGraphBuilderJScopeDataIblock_at6Mi_pnKBlockBegin__; text: .text%__1cMGraphBuilderKload_local6MpnJValueType_i_v_; @@ -1322,7 +1292,6 @@ text: .text%__1cPciInstanceKlassLfield_cache6M_pnTciConstantPoolCache__; text: .text%__1cHciField2t6MpnPciInstanceKlass_i_v_; text: .text%__1cHciFieldPinitialize_from6MpnPfieldDescriptor__v_; text: .text%__1cTconstantPoolOopDescbCklass_ref_at_if_loaded_check6FnSconstantPoolHandle_ipnGThread__pnMklassOopDesc__; -text: .text%__1cKValueStackKcopy_locks6M_p0_; text: .text%__1cJLoadFieldFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cNCanonicalizerMdo_LoadField6MpnJLoadField__v_; text: .text%__1cJLoadFieldEhash6kM_i_: c1_Instruction.o; @@ -1365,27 +1334,18 @@ text: .text%__1cTNullCheckEliminatorLiterate_one6MpnKBlockBegin__v_; text: .text%__1cGBitMapIset_from6M0_v_; text: .text%__1cQNullCheckVisitorNdo_BlockBegin6MpnKBlockBegin__v_; text: .text%__1cQNullCheckVisitorHdo_Base6MpnEBase__v_; -text: .text%__1cKStateSplitPinput_values_do6MpFppnLInstruction__v_v_: c1_Canonicalizer.o; text: .text%__1cEGotoFvisit6MpnSInstructionVisitor__v_: c1_Canonicalizer.o; text: .text%__1cQNullCheckVisitorHdo_Goto6MpnEGoto__v_; -text: .text%__1cCIfPinput_values_do6MpFppnLInstruction__v_v_: c1_Canonicalizer.o; -text: .text%__1cTNullCheckEliminatorIdo_value6FppnLInstruction__v_; -text: .text%__1cFLocalPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cFLocalFvisit6MpnSInstructionVisitor__v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorIdo_Local6MpnFLocal__v_; text: .text%__1cQNullCheckVisitorFdo_If6MpnCIf__v_; -text: .text%__1cGReturnPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; -text: .text%__1cIConstantPinput_values_do6MpFppnLInstruction__v_v_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorLdo_Constant6MpnIConstant__v_; text: .text%__1cQNullCheckVisitorJdo_Return6MpnGReturn__v_; -text: .text%__1cJTypeCheckPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorNdo_InstanceOf6MpnKInstanceOf__v_; text: .text%__1cQNullCheckVisitorMdo_CheckCast6MpnJCheckCast__v_; -text: .text%__1cLAccessFieldPinput_values_do6MpFppnLInstruction__v_v_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorMdo_LoadField6MpnJLoadField__v_; text: .text%__1cTNullCheckEliminatorShandle_AccessField6MpnLAccessField__v_; text: .text%__1cQNullCheckVisitorPdo_ArithmeticOp6MpnMArithmeticOp__v_; -text: .text%__1cLAccessArrayPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorOdo_ArrayLength6MpnLArrayLength__v_; text: .text%__1cTNullCheckEliminatorShandle_ArrayLength6MpnLArrayLength__v_; text: .text%__1cQNullCheckVisitorOdo_LoadIndexed6MpnLLoadIndexed__v_; @@ -1403,16 +1363,12 @@ text: .text%__1cIBlockEndOsubstitute_sux6MpnKBlockBegin_2_v_; text: .text%__1cCIRMcompute_code6M_v_; text: .text%__1cLInstructionGnegate6Fn0AJCondition__1_; text: .text%__1cJBlockListJblocks_do6MpFpnKBlockBegin__v_v_; -text: .text%__1cQUseCountComputerQupdate_use_count6FppnLInstruction__v_: c1_IR.o; -text: .text%__1cKStateSplitPstate_values_do6MpFppnLInstruction__v_v_; -text: .text%__1cKValueStackJvalues_do6MpFppnLInstruction__v_v_; text: .text%__1cFLocalIas_Local6M_p0_: c1_GraphBuilder.o; text: .text%__1cLCompilationIemit_lir6M_v_; text: .text%__1cLInstructionGas_Phi6M_pnDPhi__: c1_Canonicalizer.o; text: .text%__1cMas_BasicType6FpnJValueType__nJBasicType__; text: .text%__1cJValueTypeRas_ObjectConstant6M_pnOObjectConstant__: c1_Canonicalizer.o; text: .text%__1cLLIR_OprFactKvalue_type6FpnJValueType__pnLLIR_OprDesc__; -text: .text%__1cKValueStackMcaller_state6kM_p0_; text: .text%__1cJArrayTypeMas_ArrayType6M_p0_: c1_ValueType.o; text: .text%__1cILIR_ListKshift_left6MpnLLIR_OprDesc_222_v_; text: .text%__1cJValueTypeLas_VoidType6M_pnIVoidType__: c1_Canonicalizer.o; @@ -1442,7 +1398,6 @@ text: .text%__1cNLIR_AssemblerNemit_opBranch6MpnMLIR_OpBranch__v_; text: .text%__1cNLIR_AssemblerKemit_delay6MpnLLIR_OpDelay__v_; text: .text%__1cNLIR_AssemblerLcode_offset6kM_i_; text: .text%__1cNLIR_AssemblerQemit_opTypeCheck6MpnPLIR_OpTypeCheck__v_; -text: .text%__1cIciObjectIencoding6M_pnI_jobject__; text: .text%__1cOoop_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; text: .text%__1cNLIR_AssemblerEload6MpnMRegisterImpl_i2nJBasicType_pnMCodeEmitInfo__i_; text: .text%__1cNLIR_AssemblerIemit_op16MpnHLIR_Op1__v_; @@ -1477,7 +1432,6 @@ text: .text%__1cYDebugInformationRecorderJdata_size6M_i_; text: .text%__1cNRelocIteratorTadvance_over_prefix6M_v_; text: .text%__1cOoop_RelocationLunpack_data6M_v_; text: .text%__1cYDebugInformationRecorderHcopy_to6MpnHnmethod__v_; -text: .text%__1cLOopRecorderHcopy_to6MpnICodeBlob__v_; text: .text%__1cIUniverseMnon_oop_word6F_pv_; text: .text%__1cCosXnon_memory_address_word6F_pc_; text: .text%__1cHnmethodQcopy_scopes_data6MpCi_v_; @@ -1487,7 +1441,6 @@ text: .text%__1cODataRelocationJset_value6MpC_v_: relocInfo.o; text: .text%__1cOoop_RelocationGoffset6M_i_: relocInfo.o; text: .text%__1cKRelocationRpd_set_data_value6MpCi_v_; text: .text%__1cJCodeCacheGcommit6FpnICodeBlob__v_; -text: .text%__1cFVTuneOcreate_nmethod6FpnHnmethod__v_; text: .text%__1cWImplicitExceptionTableHcopy_to6MpnHnmethod__v_; text: .text%__1cLCompilation2T6M_v_; text: .text%__1cFArena2T6M_v_; @@ -1512,7 +1465,6 @@ text: .text%__1cTjava_lang_ThrowableTfill_in_stack_trace6FnGHandle_pnGThread__v_ text: .text%__1cVPreserveExceptionMark2T6M_v_; text: .text%__1cSInterpreterRuntimeXthrow_pending_exception6FpnKJavaThread__v_; text: .text%__1cSThreadLocalStorageGthread6F_pnGThread__: assembler_sparc.o; -text: .text%__1cNSharedRuntimebKexception_handler_for_return_address6FpC_1_; text: .text%__1cSInterpreterRuntimebFexception_handler_for_exception6FpnKJavaThread_pnHoopDesc__pC_; text: .text%__1cNmethodOopDescbEfast_exception_handler_bci_for6MnLKlassHandle_ipnGThread__i_; text: .text%__1cFframeZinterpreter_frame_set_bcp6MpC_v_; @@ -1530,8 +1482,6 @@ text: .text%__1cPciInstanceKlassYprotection_domain_handle6M_pnI_jobject__; text: .text%__1cLNewInstanceFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cNCanonicalizerOdo_NewInstance6MpnLNewInstance__v_; text: .text%__1cMGraphBuilderGinvoke6MnJBytecodesECode__v_; -text: .text%__1cFciEnvTget_method_by_index6MpnPciInstanceKlass_inJBytecodesECode__pnIciMethod__; -text: .text%__1cFciEnvYget_method_by_index_impl6MpnPciInstanceKlass_inJBytecodesECode__pnIciMethod__; text: .text%__1cPciObjectFactoryTget_unloaded_method6MpnPciInstanceKlass_pnIciSymbol_4_pnIciMethod__; text: .text%__1cIciMethod2t6MpnPciInstanceKlass_pnIciSymbol_4_v_; text: .text%__1cNciMethodKlassEmake6F_p0_; @@ -1542,16 +1492,11 @@ text: .text%__1cKValueStackNpop_arguments6Mi_pnGValues__; text: .text%__1cGInvokeFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cNCanonicalizerJdo_Invoke6MpnGInvoke__v_; text: .text%__1cGInvokeJas_Invoke6M_p0_: c1_Instruction.o; -text: .text%__1cFThrowFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cNCanonicalizerIdo_Throw6MpnFThrow__v_; -text: .text%__1cFThrowIas_Throw6M_p0_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorOdo_NewInstance6MpnLNewInstance__v_; -text: .text%__1cGInvokePinput_values_do6MpFppnLInstruction__v_v_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorJdo_Invoke6MpnGInvoke__v_; text: .text%__1cTNullCheckEliminatorNhandle_Invoke6MpnGInvoke__v_; -text: .text%__1cFThrowPinput_values_do6MpFppnLInstruction__v_v_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorIdo_Throw6MpnFThrow__v_; -text: .text%__1cFThrowPstate_values_do6MpFppnLInstruction__v_v_; text: .text%__1cIVoidTypeLas_VoidType6M_p0_: c1_ValueType.o; text: .text%__1cLNewInstanceKexact_type6kM_pnGciType__; text: .text%__1cLNewInstanceOas_NewInstance6M_p0_: c1_Instruction.o; @@ -1562,7 +1507,6 @@ text: .text%__1cPNewInstanceStubEinfo6kM_pnMCodeEmitInfo__: c1_CodeStubs_sparc.o text: .text%__1cNLIR_AssemblerJemit_call6MpnOLIR_OpJavaCall__v_; text: .text%__1cNLIR_AssemblerKalign_call6MnILIR_Code__v_; text: .text%__1cICodeStubEinfo6kM_pnMCodeEmitInfo__: c1_CodeStubs_sparc.o; -text: .text%__1cNLIR_AssemblerEcall6MpCnJrelocInfoJrelocType_pnMCodeEmitInfo__v_; text: .text%__1cbBopt_virtual_call_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; text: .text%__1cYinternal_word_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; text: .text%__1cMPatchingStubJemit_code6MpnNLIR_Assembler__v_; @@ -1586,8 +1530,6 @@ text: .text%__1cFciEnvNlookup_method6MpnNinstanceKlass_2pnNsymbolOopDesc_4nJByte text: .text%__1cMLinkResolverbCresolve_virtual_call_or_null6FnLKlassHandle_1nMsymbolHandle_21_nMmethodHandle__; text: .text%__1cPciObjectFactoryMvm_symbol_at6Fi_pnIciSymbol__; text: .text%__1cNCanonicalizerMdo_NullCheck6MpnJNullCheck__v_; -text: .text%__1cKValueStackKpush_scope6MpnHIRScope__p0_; -text: .text%__1cHIRScopeXcompute_lock_stack_size6M_v_; text: .text%__1cMGraphBuilderJScopeDataLnum_returns6M_i_; text: .text%__1cNCanonicalizerHdo_Goto6MpnEGoto__v_; text: .text%__1cMGraphBuilderJScopeDataQincr_num_returns6M_v_; @@ -1596,10 +1538,7 @@ text: .text%__1cLCompilationVnotice_inlined_method6MpnIciMethod__v_; text: .text%__1cFciEnvVnotice_inlined_method6MpnIciMethod__v_; text: .text%__1cMLinkResolverbCresolve_special_call_or_null6FnLKlassHandle_nMsymbolHandle_21_nMmethodHandle__; text: .text%__1cLInstructionEprev6MpnKBlockBegin__p0_; -text: .text%__1cIConstantPother_values_do6MpFppnLInstruction__v_v_; -text: .text%__1cIBlockEndPother_values_do6MpFppnLInstruction__v_v_; text: .text%__1cQNullCheckVisitorMdo_NullCheck6MpnJNullCheck__v_; -text: .text%__1cHIRScopeNtop_scope_bci6kM_i_; text: .text%__1cIFrameMapQmake_new_address6kMi_nHAddress__; text: .text%__1cNLIR_AssemblerFstore6MpnMRegisterImpl_2inJBasicType_pnMCodeEmitInfo__v_; text: .text%__1cNLIR_AssemblerJstack2reg6MpnLLIR_OprDesc_2nJBasicType__v_; @@ -1610,7 +1549,6 @@ text: .text%__1cXNativeSignatureIteratorIdo_float6M_v_: interpreterRT_sparc.o; text: .text%JVM_IsNaN; text: .text%__1cXNativeSignatureIteratorJdo_double6M_v_: interpreterRT_sparc.o; text: .text%__1cSInterpreterRuntimeZSignatureHandlerGeneratorLpass_double6M_v_; -text: .text%__1cEIfOpPinput_values_do6MpFppnLInstruction__v_v_: c1_Instruction.o; text: .text%__1cEIfOpFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cQNullCheckVisitorHdo_IfOp6MpnEIfOp__v_; text: .text%__1cOGenerateOopMapIcopy_cts6MpnNCellTypeState_2_i_; @@ -1642,8 +1580,6 @@ text: .text%__1cHLogicOpEhash6kM_i_: c1_Instruction.o; text: .text%__1cHLogicOpEname6kM_pkc_: c1_Instruction.o; text: .text%__1cMLinkResolverbBresolve_static_call_or_null6FnLKlassHandle_nMsymbolHandle_21_nMmethodHandle__; text: .text%__1cQNullCheckVisitorNdo_StoreField6MpnKStoreField__v_; -text: .text%__1cINewArrayPinput_values_do6MpFppnLInstruction__v_v_: c1_Instruction.o; -text: .text%__1cHConvertPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorKdo_Convert6MpnHConvert__v_; text: .text%__1cQNullCheckVisitorPdo_NewTypeArray6MpnMNewTypeArray__v_; text: .text%__1cJLoadFieldMas_LoadField6M_p0_: c1_Instruction.o; @@ -1665,7 +1601,6 @@ text: .text%__1cRC1_MacroAssemblerPallocate_object6MpnMRegisterImpl_222ii2rnFLab text: .text%__1cNLIR_AssemblerOmembar_release6M_v_; text: .text%__1cNLIR_AssemblerGmembar6M_v_; text: .text%__1cNLIR_AssemblerOmembar_acquire6M_v_; -text: .text%__1cNLIR_AssemblerHic_call6MpCpnMCodeEmitInfo__v_; text: .text%__1cNLIR_AssemblerCpc6kM_pC_; text: .text%__1cXvirtual_call_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; text: .text%__1cNLIR_AssemblerIlogic_op6MnILIR_Code_pnLLIR_OprDesc_33_v_; @@ -1675,7 +1610,6 @@ text: .text%__1cXvirtual_call_RelocationLunpack_data6M_v_; text: .text%__1cNinstanceKlassVadd_dependent_nmethod6MpnHnmethod__v_; text: .text%__1cGPcDescHreal_pc6kMpknHnmethod__pC_; text: .text%__1cNSharedRuntimeXfind_callee_info_helper6FpnKJavaThread_rnMvframeStream_rnJBytecodesECode_rnICallInfo_pnGThread__nGHandle__; -text: .text%__1cPBytecode_invokeFindex6kM_i_; text: .text%__1cLRegisterMapIpd_clear6M_v_; text: .text%__1cPBytecode_invokeNstatic_target6MpnGThread__nMmethodHandle__; text: .text%__1cMLinkResolverOresolve_method6FrnMmethodHandle_rnLKlassHandle_nSconstantPoolHandle_ipnGThread__v_; @@ -1690,8 +1624,6 @@ text: .text%__1cKNativeCallXset_destination_mt_safe6MpC_v_; text: .text%__1cNmethodOopDescTverified_code_entry6M_pC_; text: .text%__1cOGenerateOopMapGdo_ldc6Mii_v_; text: .text%__1cMGraphBuilderNload_constant6M_v_; -text: .text%__1cFciEnvVget_constant_by_index6MpnPciInstanceKlass_i_nKciConstant__; -text: .text%__1cFciEnvbAget_constant_by_index_impl6MpnPciInstanceKlass_i_nKciConstant__; text: .text%__1cWstatic_call_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; text: .text%__1cKExceptionsL_throw_args6FpnGThread_pkcinMsymbolHandle_5pnRJavaCallArguments__v_; text: .text%__1cMPeriodicTaskOreal_time_tick6FI_v_; @@ -1700,7 +1632,6 @@ text: .text%jni_GetArrayLength: jni.o; text: .text%JVM_Read; text: .text%jni_GetByteArrayRegion: jni.o; text: .text%JVM_DefineClassWithSource; -text: .text%__1cQSystemDictionaryTresolve_from_stream6FnMsymbolHandle_nGHandle_2pnPClassFileStream_pnGThread__pnMklassOopDesc__; text: .text%__1cPClassFileParserbDverify_legal_method_signature6MnMsymbolHandle_1pnGThread__i_; text: .text%__1cPClassFileParserXverify_legal_class_name6MnMsymbolHandle_pnGThread__v_; text: .text%__1cQSystemDictionarybAvalidate_protection_domain6FnTinstanceKlassHandle_nGHandle_2pnGThread__v_; @@ -1780,7 +1711,6 @@ text: .text%__1cUJvmtiEventControllerIvm_death6F_v_; text: .text%__1cCosXterminate_signal_thread6F_v_; text: .text%__1cCosNsigexitnum_pd6F_i_; text: .text%__1cCosNsignal_notify6Fi_v_; -text: .text%__1cFVTuneEexit6F_v_; text: .text%__1cIVMThreadXwait_for_vm_thread_exit6F_v_; text: .text%__1cUSafepointSynchronizeFbegin6F_v_; text: .text%__1cORuntimeServiceWrecord_safepoint_begin6F_v_; @@ -1795,7 +1725,6 @@ text: .text%__1cQSystemDictionaryRnumber_of_classes6F_i_; text: .text%__1cQSystemDictionaryStry_get_next_class6F_pnMklassOopDesc__; text: .text%__1cKDictionaryStry_get_next_class6M_pnMklassOopDesc__; text: .text%__1cNinstanceKlassKmethods_do6MpFpnNmethodOopDesc__v_v_; -text: .text%__1cONMethodSweeperFsweep6F_v_; text: .text%__1cNCompileBrokerQset_should_block6F_v_; text: .text%__1cHVM_ExitbJwait_for_threads_in_native_to_block6F_i_; text: .text%__1cIVMThreadHdestroy6F_v_; @@ -1839,7 +1768,6 @@ text: .text%__1cMGraphBuilderNstore_indexed6MnJBasicType__v_; text: .text%__1cIValueMapKkill_array6MpnJValueType__v_; text: .text%__1cNCanonicalizerPdo_StoreIndexed6MpnMStoreIndexed__v_; text: .text%__1cQNullCheckVisitorPdo_StoreIndexed6MpnMStoreIndexed__v_; -text: .text%__1cKValueStackElock6MpnHIRScope_pnLInstruction__i_; text: .text%__1cKValueStackGunlock6M_i_; text: .text%__1cQMonitorEnterStubFvisit6MpnQLIR_OpVisitState__v_: c1_CodeStubs_sparc.o; text: .text%__1cNLIR_AssemblerJemit_lock6MpnKLIR_OpLock__v_; @@ -1859,7 +1787,6 @@ text: .text%__1cTconstantPoolOopDescbCverify_constant_pool_resolve6FnSconstantPo text: .text%__1cNCanonicalizerMdo_Intrinsic6MpnJIntrinsic__v_; text: .text%__1cMas_ValueType6FnKciConstant__pnJValueType__; text: .text%__1cQNullCheckVisitorMdo_Intrinsic6MpnJIntrinsic__v_; -text: .text%__1cDOp2Pinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorKdo_ShiftOp6MpnHShiftOp__v_; text: .text%__1cILIR_ListLshift_right6MpnLLIR_OprDesc_222_v_; text: .text%__1cMNewTypeArrayKexact_type6kM_pnGciType__; @@ -1876,7 +1803,6 @@ text: .text%__1cYciExceptionHandlerStreamEnext6M_v_: c1_IR.o; text: .text%__1cLInstructionGmirror6Fn0AJCondition__1_; text: .text%__1cKBlockBeginVadd_exception_handler6Mp0_v_; text: .text%__1cIciObjectEhash6M_i_; -text: .text%__1cLAccessFieldPother_values_do6MpFppnLInstruction__v_v_; text: .text%__1cFChunk2n6FII_pv_; text: .text%jni_CallStaticVoidMethodV: jni.o; text: .text%JVM_GetLastErrorString; @@ -1899,8 +1825,6 @@ text: .text%__1cWCountInterfacesClosureEdoit6MpnMklassOopDesc_i_v_: klassVtable. text: .text%__1cPfieldDescriptorRint_initial_value6kM_i_; text: .text%__1cSSetupItableClosureEdoit6MpnMklassOopDesc_i_v_: klassVtable.o; text: .text%__1cSInterpreterRuntimeOmultianewarray6FpnKJavaThread_pi_v_; -text: .text%__1cNinstanceKlassSlookup_osr_nmethod6kMkpnNmethodOopDesc_i_pnHnmethod__; -text: .text%__1cQSimpleCompPolicyYmethod_back_branch_event6MnMmethodHandle_iipnGThread__v_; text: .text%__1cMGraphBuilderQnew_object_array6M_v_; text: .text%__1cONewObjectArrayFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cNCanonicalizerRdo_NewObjectArray6MpnONewObjectArray__v_; @@ -1919,7 +1843,6 @@ text: .text%__1cUBytecode_tableswitchOdest_offset_at6kMi_i_; text: .text%__1cMGraphBuilderMtable_switch6M_v_; text: .text%__1cLTableSwitchFvisit6MpnSInstructionVisitor__v_: c1_GraphBuilder.o; text: .text%__1cNCanonicalizerOdo_TableSwitch6MpnLTableSwitch__v_; -text: .text%__1cGSwitchPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorOdo_TableSwitch6MpnLTableSwitch__v_; text: .text%__1cSCompiledStaticCallNcompute_entry6FnMmethodHandle_rnOStaticCallInfo__v_; text: .text%__1cSCompiledStaticCallDset6MrknOStaticCallInfo__v_; @@ -1972,7 +1895,6 @@ text: .text%jni_GetStaticObjectField: jni.o; text: .text%__1cXJNI_ArgumentPusherVaArgIget_long6M_v_: jni.o; text: .text%__1cINegateOpFvisit6MpnSInstructionVisitor__v_: c1_GraphBuilder.o; text: .text%__1cNCanonicalizerLdo_NegateOp6MpnINegateOp__v_; -text: .text%__1cINegateOpPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorLdo_NegateOp6MpnINegateOp__v_; text: .text%__1cILIR_ListLstore_check6MpnLLIR_OprDesc_2222pnMCodeEmitInfo__v_; text: .text%__1cXArrayStoreExceptionStub2t6MpnMCodeEmitInfo__v_; @@ -2008,13 +1930,11 @@ text: .text%__1cYjava_lang_reflect_MethodEslot6FpnHoopDesc__i_; text: .text%__1cYjava_lang_reflect_MethodPparameter_types6FpnHoopDesc__2_; text: .text%__1cYjava_lang_reflect_MethodLreturn_type6FpnHoopDesc__2_; text: .text%JVM_IsInterrupted; -text: .text%__1cMArithmeticOpKlock_stack6kM_pnKValueStack__: c1_Instruction.o; text: .text%__1cNLIR_AssemblerIemit_op36MpnHLIR_Op3__v_; text: .text%__1cNLIR_AssemblerbCadd_debug_info_for_div0_here6MpnMCodeEmitInfo__v_; text: .text%__1cNDivByZeroStubEinfo6kM_pnMCodeEmitInfo__: c1_CodeStubs_sparc.o; text: .text%__1cNDivByZeroStubJemit_code6MpnNLIR_Assembler__v_; text: .text%__1cIFrameMapLnr2floatreg6Fi_pnRFloatRegisterImpl__; -text: .text%__1cRCompilationPolicybIreset_counter_for_invocation_event6MnMmethodHandle__v_; text: .text%Unsafe_EnsureClassInitialized; text: .text%__1cPClassFileParserYparse_checked_exceptions6MpHInSconstantPoolHandle_pnGThread__1_; text: .text%__1cPClassFileStreamHskip_u26MipnGThread__v_; @@ -2070,7 +1990,6 @@ text: .text%jni_NewIntArray: jni.o; text: .text%__1cKGenerationInext_gen6kM_p0_; text: .text%__1cQinstanceRefKlassZacquire_pending_list_lock6FpnJBasicLock__v_; text: .text%__1cbAVM_GenCollectForAllocationEdoit6M_v_; -text: .text%__1cPGCMemoryManagerIgc_begin6M_v_; text: .text%__1cKManagementJtimestamp6F_x_; text: .text%__1cTContiguousSpacePoolQget_memory_usage6M_nLMemoryUsage__; text: .text%__1cTContiguousSpacePoolNused_in_bytes6M_I_: memoryPool.o; @@ -2094,8 +2013,6 @@ text: .text%__1cKSharedHeapbAchange_strong_roots_parity6M_v_; text: .text%__1cPFastScanClosureGdo_oop6MppnHoopDesc__v_: defNewGeneration.o; text: .text%__1cPContiguousSpaceIallocate6MI_pnIHeapWord__; text: .text%__1cKJNIHandlesHoops_do6FpnKOopClosure__v_; -text: .text%__1cHThreadsHoops_do6FpnKOopClosure__v_; -text: .text%__1cKJavaThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cOJNIHandleBlockHoops_do6MpnKOopClosure__v_; text: .text%__1cKHandleAreaHoops_do6MpnKOopClosure__v_; text: .text%__1cFframeVinterpreter_frame_bci6kM_i_; @@ -2124,8 +2041,6 @@ text: .text%__1cTMaskFillerForNative2t6MnMmethodHandle_pIi_v_: oopMapCache.o; text: .text%__1cTMaskFillerForNativeLpass_object6M_v_: oopMapCache.o; text: .text%__1cTMaskFillerForNativeJpass_long6M_v_: oopMapCache.o; text: .text%__1cRComputeEntryStackHdo_long6M_v_: generateOopMap.o; -text: .text%__1cIVMThreadHoops_do6MpnKOopClosure__v_; -text: .text%__1cGThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cSObjectSynchronizerHoops_do6FpnKOopClosure__v_; text: .text%__1cMFlatProfilerHoops_do6FpnKOopClosure__v_; text: .text%__1cKManagementHoops_do6FpnKOopClosure__v_; @@ -2221,7 +2136,6 @@ text: .text%__1cUGenGCEpilogueClosureNdo_generation6MpnKGeneration__v_: genColle text: .text%__1cRTenuredGenerationPupdate_counters6M_v_; text: .text%__1cUCompactingPermGenGenPupdate_counters6M_v_; text: .text%__1cXTraceMemoryManagerStats2T6M_v_; -text: .text%__1cPGCMemoryManagerGgc_end6M_v_; text: .text%__1cRLowMemoryDetectorWdetect_after_gc_memory6FpnKMemoryPool__v_; text: .text%__1cNJvmtiGCMarker2T6M_v_; text: .text%__1cPVM_GC_OperationNdoit_epilogue6M_v_; @@ -2232,7 +2146,6 @@ text: .text%__1cLklassVtableQindex_of_miranda6MpnNsymbolOopDesc_2_i_; text: .text%__1cNCanonicalizerPdo_MonitorEnter6MpnMMonitorEnter__v_; text: .text%__1cLMonitorExitFvisit6MpnSInstructionVisitor__v_: c1_GraphBuilder.o; text: .text%__1cNCanonicalizerOdo_MonitorExit6MpnLMonitorExit__v_; -text: .text%__1cNAccessMonitorPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorPdo_MonitorEnter6MpnMMonitorEnter__v_; text: .text%__1cQNullCheckVisitorOdo_MonitorExit6MpnLMonitorExit__v_; text: .text%__1cMLongConstantPas_LongConstant6M_p0_: c1_Canonicalizer.o; @@ -2246,10 +2159,7 @@ text: .text%__1cRComputeEntryStackIdo_short6M_v_: generateOopMap.o; text: .text%Unsafe_AllocateInstance; text: .text%jni_AllocObject: jni.o; text: .text%__1cNCanonicalizerMset_constant6Mi_v_: c1_Canonicalizer.o; -text: .text%__1cJTypeCheckPother_values_do6MpFppnLInstruction__v_v_; -text: .text%__1cIBytecodeIset_code6MnJBytecodesECode__v_; text: .text%__1cQComputeCallStackIdo_float6M_v_: generateOopMap.o; -text: .text%__1cFframeRoops_code_blob_do6MpnKOopClosure_pknLRegisterMap__v_; text: .text%__1cMOopMapStreamJfind_next6M_v_; text: .text%__1cQinstanceRefKlassSoop_oop_iterate_nv6MpnHoopDesc_pnQFilteringClosure__i_; text: .text%__1cQinstanceRefKlassUoop_oop_iterate_nv_m6MpnHoopDesc_pnQFilteringClosure_nJMemRegion__i_; @@ -2284,7 +2194,6 @@ text: .text%__1cLsymbolKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cQinstanceRefKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cQconstMethodKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cFJNIidHoops_do6MpnKOopClosure__v_; -text: .text%__1cHnmethodHoops_do6MpnKOopClosure__v_; text: .text%__1cQSystemDictionaryValways_strong_oops_do6FpnKOopClosure__v_; text: .text%__1cKDictionaryYalways_strong_classes_do6MpnKOopClosure__v_; text: .text%__1cVLoaderConstraintTableYalways_strong_classes_do6MpnKOopClosure__v_; @@ -2341,9 +2250,6 @@ text: .text%__1cVcompiledICHolderKlassOklass_oop_size6kM_i_: compiledICHolderKla text: .text%__1cJHashtableHoops_do6MpnKOopClosure__v_; text: .text%__1cQSystemDictionaryYalways_strong_classes_do6FpnKOopClosure__v_; text: .text%__1cQSystemDictionaryPplaceholders_do6FpnKOopClosure__v_; -text: .text%__1cSDeoptimizationBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cLRuntimeStubHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cNSafepointBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cJMarkSweepMadjust_marks6F_v_; text: .text%__1cYGenAdjustPointersClosureNdo_generation6MpnKGeneration__v_: genMarkSweep.o; text: .text%__1cKGenerationPadjust_pointers6M_v_; @@ -2379,32 +2285,24 @@ text: .text%__1cIRuntime1Onew_type_array6FpnKJavaThread_pnMklassOopDesc_i_v_; text: .text%__1cVcompiledICHolderKlassRoop_oop_iterate_m6MpnHoopDesc_pnKOopClosure_nJMemRegion__i_; text: .text%__1cNObjectMonitorGnotify6MpnGThread__v_; text: .text%__1cOMacroAssemblerEmult6MpnMRegisterImpl_22_v_; -text: .text%__1cINewArrayPother_values_do6MpFppnLInstruction__v_v_; text: .text%__1cJValueTypeLas_LongType6M_pnILongType__: c1_Canonicalizer.o; text: .text%__1cNVM_DeoptimizeEdoit6M_v_; text: .text%__1cODeoptimizationVdeoptimize_dependents6F_i_; text: .text%__1cHThreadsbFdeoptimized_wrt_marked_nmethods6F_v_; text: .text%__1cKJavaThreadbFdeoptimized_wrt_marked_nmethods6M_v_; text: .text%__1cJCodeCachebGmake_marked_nmethods_not_entrant6F_v_; -text: .text%__1cHnmethodbAmake_not_entrant_or_zombie6Mi_v_; text: .text%__1cKNativeJumpUpatch_verified_entry6FpC11_v_; text: .text%signalHandler; text: .text%JVM_handle_solaris_signal; text: .text%JVM_HoldsLock; text: .text%__1cQinstanceRefKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: instanceRefKlass.o; text: .text%__1cJCodeCacheFfirst6F_pnICodeBlob__; -text: .text%__1cHThreadsLnmethods_do6F_v_; -text: .text%__1cFframeLnmethods_do6M_v_; text: .text%__1cJCodeCacheEnext6FpnICodeBlob__2_; text: .text%__1cONewObjectArrayKexact_type6kM_pnGciType__; text: .text%__1cPciObjArrayKlassNelement_klass6M_pnHciKlass__; text: .text%__1cIRuntime1Noop_arraycopy6FpnIHeapWord_2i_v_; text: .text%__1cMGraphBuilderKcompare_op6MpnJValueType_nJBytecodesECode__v_; -text: .text%__1cJCompareOpFvisit6MpnSInstructionVisitor__v_: c1_Instruction.o; text: .text%__1cNCanonicalizerMdo_CompareOp6MpnJCompareOp__v_; -text: .text%__1cJCompareOpEhash6kM_i_: c1_Instruction.o; -text: .text%__1cJCompareOpEname6kM_pkc_: c1_Instruction.o; -text: .text%__1cJCompareOpMas_CompareOp6M_p0_: c1_Instruction.o; text: .text%__1cJValueTypeOas_IntConstant6M_pnLIntConstant__: c1_Canonicalizer.o; text: .text%__1cHIntTypeKas_IntType6M_p0_: c1_Canonicalizer.o; text: .text%__1cNSharedRuntimeDf2l6Ff_x_; @@ -2422,7 +2320,6 @@ text: .text%__1cRComputeEntryStackIdo_float6M_v_: generateOopMap.o; text: .text%__1cTMaskFillerForNativeIpass_int6M_v_: oopMapCache.o; text: .text%__1cHnmethodSflush_dependencies6MpnRBoolObjectClosure__v_; text: .text%__1cNinstanceKlassYremove_dependent_nmethod6MpnHnmethod__v_; -text: .text%__1cFVTuneOdelete_nmethod6FpnHnmethod__v_; text: .text%__1cLCardTableRSFclear6MnJMemRegion__v_: cardTableRS.o; text: .text%__1cRCardTableModRefBSFclear6MnJMemRegion__v_; text: .text%__1cHnmethodFflush6M_v_; @@ -2445,9 +2342,7 @@ text: .text%__1cNCanonicalizerPdo_UnsafeGetRaw6MpnMUnsafeGetRaw__v_; text: .text%__1cMGraphBuilderNlookup_switch6M_v_; text: .text%__1cMLookupSwitchFvisit6MpnSInstructionVisitor__v_: c1_GraphBuilder.o; text: .text%__1cNCanonicalizerPdo_LookupSwitch6MpnMLookupSwitch__v_; -text: .text%__1cMUnsafePutRawPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorPdo_UnsafePutRaw6MpnMUnsafePutRaw__v_; -text: .text%__1cLUnsafeRawOpPinput_values_do6MpFppnLInstruction__v_v_: c1_GraphBuilder.o; text: .text%__1cQNullCheckVisitorPdo_UnsafeGetRaw6MpnMUnsafeGetRaw__v_; text: .text%__1cQNullCheckVisitorPdo_LookupSwitch6MpnMLookupSwitch__v_; text: .text%__1cIRuntime1Mnew_instance6FpnKJavaThread_pnMklassOopDesc__v_; diff --git a/hotspot/make/solaris/makefiles/reorder_TIERED_amd64 b/hotspot/make/solaris/makefiles/reorder_TIERED_amd64 index 4531671c613..8aa944c7adf 100644 --- a/hotspot/make/solaris/makefiles/reorder_TIERED_amd64 +++ b/hotspot/make/solaris/makefiles/reorder_TIERED_amd64 @@ -4,38 +4,22 @@ text = LOAD ?RXO; text: .text%__1cECopyRpd_disjoint_words6FpnIHeapWord_2L_v_; text: .text%__1cSPSPromotionManagerWcopy_to_survivor_space6MpnHoopDesc__2_; -text: .text%__1cNinstanceKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cJMarkSweepO_mark_and_push6FppnHoopDesc__v_; text: .text%__1cNinstanceKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cNinstanceKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cOtypeArrayKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cOtypeArrayKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cQIndexSetIteratorEnext6M_I_; -text: .text%__1cJMarkSweepPmark_and_follow6FppnHoopDesc__v_; -text: .text%__1cCosOjavaTimeMillis6F_x_; -text: .text%__1cNRelocIteratorEnext6M_i_; text: .text%__1cQIndexSetIteratorQadvance_and_next6M_I_; text: .text%__1cIUniverseMnon_oop_word6F_pv_; -text: .text%__1cNobjArrayKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cNobjArrayKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cNobjArrayKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cQObjectStartArrayMobject_start6kMpnIHeapWord__2_; text: .text%__1cJMarkSweepUAdjustPointerClosureGdo_oop6MppnHoopDesc__v_; -text: .text%__1cJMarkSweepOIsAliveClosureLdo_object_b6MpnHoopDesc__i_; -text: .text%__1cENodeGis_Phi6M_pnHPhiNode__; text: .text%__1cIPhaseIFGIadd_edge6MII_i_; -text: .text%__1cPBoundRelocationLunpack_data6MnJrelocInfoJrelocType__v_; -text: .text%__1cIMachNodeHis_Mach6M_p0_; -text: .text%__1cENodeHis_Copy6kM_I_; -text: .text%__1cUCompressedReadStreamIread_int6M_i_; text: .text%__1cQIndexSetIterator2t6MpnIIndexSet__v_; text: .text%__1cOPhaseIdealLoopOidom_no_update6kMpnENode__2_; -text: .text%__1cHnmethodKcan_unload6MpnRBoolObjectClosure_pnKOopClosure_ppnHoopDesc_i_i_; -text: .text%__1cIMachNodeNrematerialize6kM_i_; -text: .text%__1cHRegMaskFis_UP6kM_i_; text: .text%__1cXresource_allocate_bytes6FL_pc_; text: .text%__1cNRelocIteratorFreloc6M_pnKRelocation__; -text: .text%__1cENodeHis_Mach6M_pnIMachNode__; text: .text%__1cHRegMaskESize6kM_I_; text: .text%__1cIIndexSetLalloc_block6M_pn0AIBitBlock__; text: .text%__1cWConstantPoolCacheEntryPadjust_pointers6M_v_; @@ -48,7 +32,6 @@ text: .text%__1cLsymbolKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cLsymbolKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cYPSPromotionFailedClosureJdo_object6MpnHoopDesc__v_; text: .text%__1cENodeEjvms6kM_pnIJVMState__; -text: .text%__1cKRelocationSfix_oop_relocation6M_v_; text: .text%__1cIIndexSetWalloc_block_containing6MI_pn0AIBitBlock__; text: .text%__1cENodeHdel_out6Mp0_v_; text: .text%__1cKRelocationLunpack_data6M_v_; @@ -56,18 +39,11 @@ text: .text%__1cIMachNodeJideal_reg6kM_I_; text: .text%__1cJAssemblerOlocate_operand6FpCn0AMWhichOperand__1_; text: .text%__1cKRelocationSpd_address_in_code6M_ppC_; text: .text%__1cOoop_RelocationIoop_addr6M_ppnHoopDesc__; -text: .text%__1cRMachSpillCopyNodeMis_SpillCopy6M_p0_; text: .text%__1cOPhaseIdealLoopSget_ctrl_no_update6kMpnENode__2_; text: .text%__1cJCProjNodeNis_block_proj6kM_pknENode__; -text: .text%__1cENodeGis_CFG6kM_i_; -text: .text%__1cKRelocationNunpack_2_ints6Mri1_v_; text: .text%__1cETypeDcmp6Fpk02_i_; -text: .text%__1cQObjectStartArrayWobject_starts_in_range6kMpnIHeapWord_2_i_; text: .text%__1cOoop_RelocationLunpack_data6M_v_; text: .text%__1cHRegMaskJis_bound16kM_i_; -text: .text%__1cENodeHis_Proj6M_pnIProjNode__; -text: .text%__1cENodeMis_SpillCopy6M_pnRMachSpillCopyNode__; -text: .text%__1cOtypeArrayKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cHRegMaskJis_bound26kM_i_; text: .text%__1cRmethodDataOopDescHdata_at6Mi_pnLProfileData__; text: .text%__1cNGrowableArray4CI_Hat_grow6MirkI_I_; @@ -78,126 +54,74 @@ text: .text%__1cQconstMethodKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cQconstMethodKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cLmethodKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cRmethodDataOopDescJnext_data6MpnLProfileData__2_; -text: .text%__1cMOopTaskQdDueueOpop_local_slow6MInOTaskQdDueueSuperDAge__i_; -text: .text%__1cRMachSpillCopyNodeHis_Copy6kM_I_; -text: .text%__1cENodeGpinned6kM_i_; text: .text%__1cOoop_RelocationJoop_value6M_pnHoopDesc__; text: .text%__1cJrRegPOperEtype6kM_pknEType__; text: .text%__1cECopyQpd_fill_to_words6FpnIHeapWord_LI_v_; -text: .text%__1cMOopTaskQdDueueKpop_global6MrpnHoopDesc__i_; -text: .text%__1cPOopTaskQdDueueSetPsteal_best_of_26MipirpnHoopDesc__i_; text: .text%__1cJVectorSet2R6MI_rnDSet__; text: .text%__1cNRelocIteratorTadvance_over_prefix6M_v_; -text: .text%__1cSPSPromotionManagerUflush_prefetch_queue6M_v_; -text: .text%__1cIProjNodeHis_Proj6M_p0_; text: .text%__1cPDictionaryEntrybDprotection_domain_set_oops_do6MpnKOopClosure__v_; text: .text%__1cMOopMapStreamJfind_next6M_v_; -text: .text%__1cMloadConPNodePoper_input_base6kM_I_; -text: .text%__1cMloadConPNodeHtwo_adr6kM_I_; text: .text%__1cMloadConPNodeErule6kM_I_; -text: .text%__1cHPhiNodeGis_Phi6M_p0_; text: .text%__1cITypeNodeLbottom_type6kM_pknEType__; -text: .text%__1cENodeGis_Cmp6kM_pknHCmpNode__; text: .text%__1cDff16FI_i_; -text: .text%__1cENodeNrematerialize6kM_i_; text: .text%__1cRLowMemoryDetectorbLdetect_low_memory_for_collected_pools6F_v_; -text: .text%__1cFframeVoopmapreg_to_location6kMipknLRegisterMap__ppnHoopDesc__; text: .text%__1cIIndexSetKinitialize6MI_v_; -text: .text%__1cENodeJis_Region6kM_pknKRegionNode__; text: .text%__1cMMutableSpaceMcas_allocate6ML_pnIHeapWord__; text: .text%__1cIMachNodeGOpcode6kM_i_; -text: .text%__1cMget_live_bit6Fpii_i_: buildOopMap.o; -text: .text%__1cNSafePointNodeGis_CFG6kM_i_; -text: .text%__1cIMachNodeQis_MachNullCheck6M_pnRMachNullCheckNode__; text: .text%__1cENodeHadd_req6Mp0_v_; text: .text%__1cENodeIout_grow6MI_v_; -text: .text%__1cMset_live_bit6Fpii_v_: buildOopMap.o; text: .text%__1cKTypeOopPtrFklass6kM_pnHciKlass__; text: .text%__1cIIndexSetKfree_block6MI_v_; -text: .text%__1cJCProjNodeGis_CFG6kM_i_; text: .text%__1cETypeFuhash6Fpk0_i_; text: .text%__1cJrRegIOperEtype6kM_pknEType__; text: .text%__1cMPhaseChaitinLskip_copies6MpnENode__2_; -text: .text%__1cIMachNodeMcisc_operand6kM_i_; -text: .text%__1cVCompressedWriteStreamJwrite_int6Mi_v_; text: .text%__1cICallNodeKmatch_edge6kMI_I_; -text: .text%__1cENodeHis_Call6M_pnICallNode__; text: .text%__1cNCollectedHeapbDcheck_for_bad_heap_word_value6MpnIHeapWord_L_v_; -text: .text%__1cEDictGInsert6Mpv1i_1_; text: .text%JVM_CurrentTimeMillis; -text: .text%__1cINodeHashLhash_delete6MpknENode__i_; -text: .text%__1cETypeJtype_dict6F_pnEDict__; text: .text%__1cOPSPromotionLABKinitialize6MnJMemRegion__v_; text: .text%__1cOPSPromotionLABFflush6M_v_; -text: .text%__1cIrc_class6Fi_nCRC__: ad_amd64.o; text: .text%__1cMPhaseChaitinTinterfere_with_live6MIpnIIndexSet__v_; text: .text%__1cINodeHashQhash_find_insert6MpnENode__2_; -text: .text%__1cNCollectedHeapbAcommon_mem_allocate_noinit6FLipnGThread__pnIHeapWord__; -text: .text%__1cENodeHis_Load6M_pnILoadNode__; -text: .text%__1cFArenaIcontains6kMpkv_i_; -text: .text%__1cJMultiNodeGis_CFG6kM_i_; text: .text%__1cHPhiNodeGOpcode6kM_i_; -text: .text%__1cMPhaseChaitinKelide_copy6MpnENode_ipnFBlock_rnJNode_List_6i_i_; text: .text%__1cKjmpDirNodeNis_block_proj6kM_pknENode__; -text: .text%__1cIProjNodeGis_CFG6kM_i_; text: .text%__1cRMachSpillCopyNodeJideal_reg6kM_I_; text: .text%__1cETypeIhashcons6M_pk0_; text: .text%__1cENodeEhash6kM_I_; -text: .text%__1cNMachIdealNodeMideal_Opcode6kM_i_; -text: .text%__1cOlower_pressure6FpnDLRG_IpnFBlock_pI4_v_: ifg.o; -text: .text%__1cPOopTaskQdDueueSetFsteal6MipirpnHoopDesc__i_; -text: .text%__1cENodeZcheck_for_anti_dependence6kM_i_; -text: .text%__1cKRegionNodeGis_CFG6kM_i_; -text: .text%__1cHCompileRvalid_bundle_info6MpknENode__i_; text: .text%__1cIProjNodeGOpcode6kM_i_; -text: .text%__1cENodeLis_MergeMem6M_pnMMergeMemNode__; text: .text%__1cOoop_RelocationSfix_oop_relocation6M_v_; text: .text%__1cPClassFileStreamGget_u26MpnGThread__H_; -text: .text%__1cENodeIis_Store6kM_pknJStoreNode__; text: .text%__1cPVirtualCallDataKcell_count6M_i_; -text: .text%__1cIProjNodeGpinned6kM_i_; text: .text%__1cENodeMcisc_operand6kM_i_; text: .text%__1cRInterpreterOopMapLoop_iterate6MpnKOopClosure__v_; text: .text%__1cMMachCallNodeKin_RegMask6kMI_rknHRegMask__; -text: .text%__1cMloadConINodePoper_input_base6kM_I_; -text: .text%__1cMloadConINodeHtwo_adr6kM_I_; text: .text%__1cHNTarjanEEVAL6M_p0_; text: .text%__1cNMachIdealNodeErule6kM_I_; text: .text%__1cKHandleMarkKinitialize6MpnGThread__v_; text: .text%__1cKHandleMark2T6M_v_; -text: .text%__1cETypeLisa_oop_ptr6kM_i_; -text: .text%__1cOPhaseIdealLoopUbuild_loop_late_post6MpnENode_pk0_v_; text: .text%__1cENode2t6MI_v_; text: .text%__1cJloadPNodeErule6kM_I_; -text: .text%__1cIMachNodeLis_MachCall6M_pnMMachCallNode__; text: .text%__1cMloadConINodeErule6kM_I_; text: .text%__1cICodeHeapKfind_start6kMpv_1_; text: .text%__1cWShouldNotReachHereNodeNis_block_proj6kM_pknENode__; -text: .text%__1cHTypeIntCeq6kMpknEType__i_; text: .text%__1cLProfileDataPfollow_contents6M_v_; text: .text%__1cLProfileDataPadjust_pointers6M_v_; -text: .text%__1cIMachNodeQis_MachSafePoint6M_pnRMachSafePointNode__; text: .text%__1cHRegMaskMClearToPairs6M_v_; text: .text%__1cJPhaseLiveLadd_liveout6MpnFBlock_IrnJVectorSet__v_; text: .text%__1cLemit_opcode6FrnKCodeBuffer_i_v_; text: .text%__1cIPhaseIFGQeffective_degree6kMI_i_; -text: .text%__1cENodeIis_Catch6kM_pknJCatchNode__; text: .text%__1cFArenaIArealloc6MpvLL_1_; text: .text%__1cGIfNodeGOpcode6kM_i_; text: .text%__1cHTypePtrEhash6kM_i_; text: .text%__1cIPhaseIFGLremove_node6MI_pnIIndexSet__; text: .text%__1cIPhaseIFGJre_insert6MI_v_; text: .text%__1cRMachSpillCopyNodeLbottom_type6kM_pknEType__; -text: .text%__1cMclr_live_bit6Fpii_v_: buildOopMap.o; text: .text%__1cETypeEmeet6kMpk0_2_; -text: .text%__1cMPhaseChaitinQis_high_pressure6MpnFBlock_pnDLRG_I_i_; text: .text%__1cKBranchDataKcell_count6M_i_; text: .text%__1cNCollectedHeapOarray_allocate6FnLKlassHandle_iipnGThread__pnHoopDesc__; text: .text%__1cOPhaseIdealLoopYsplit_if_with_blocks_pre6MpnENode__2_; text: .text%__1cNIdealLoopTreeJis_member6kMpk0_i_; text: .text%__1cOPhaseIdealLoopZsplit_if_with_blocks_post6MpnENode__v_; text: .text%__1cDfh16FI_i_; -text: .text%__1cJraw_score6Fdd_d_: chaitin.o; text: .text%__1cDLRGFscore6kM_d_; text: .text%__1cKTypeOopPtrEhash6kM_i_; text: .text%__1cIAddPNodeGOpcode6kM_i_; @@ -205,11 +129,8 @@ text: .text%__1cKIfTrueNodeGOpcode6kM_i_; text: .text%__1cMPhaseChaitinMchoose_color6MrnDLRG_i_i_; text: .text%__1cMPhaseIterGVNNtransform_old6MpnENode__2_; text: .text%__1cGcmpkey6Fpkv1_i_; -text: .text%__1cETypeJsingleton6kM_i_; text: .text%__1cIMachNodeKin_RegMask6kMI_rknHRegMask__; -text: .text%__1cSPSPromotionManagerMdrain_stacks6M_v_; text: .text%__1cHConNodeGOpcode6kM_i_; -text: .text%__1cITypeLongCeq6kMpknEType__i_; text: .text%__1cUParallelScavengeHeapVlarge_typearray_limit6M_L_; text: .text%__1cOtypeArrayKlassIallocate6MipnGThread__pnQtypeArrayOopDesc__; text: .text%__1cKoopFactoryNnew_typeArray6FnJBasicType_ipnGThread__pnQtypeArrayOopDesc__; @@ -220,133 +141,90 @@ text: .text%__1cICodeHeapLblock_start6kMpv_pnJHeapBlock__; text: .text%__1cJCodeCacheEnext6FpnICodeBlob__2_; text: .text%__1cRMachSpillCopyNodeKin_RegMask6kMI_rknHRegMask__; text: .text%__1cMMachProjNodeLbottom_type6kM_pknEType__; -text: .text%__1cLOptoRuntimeXdeoptimize_caller_frame6FpnKJavaThread_i_v_; text: .text%__1cSCallStaticJavaNodeGOpcode6kM_i_; text: .text%__1cYCallStaticJavaDirectNodeMideal_Opcode6kM_i_; text: .text%__1cJCodeCacheFalive6FpnICodeBlob__2_; -text: .text%__1cHRegMaskQis_aligned_Pairs6kM_i_; -text: .text%__1cSis_single_register6FI_i_: postaloc.o; text: .text%__1cRMachSpillCopyNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMPhaseIterGVNWadd_users_to_worklist06MpnENode__v_; text: .text%__1cECopyYconjoint_words_to_higher6FpnIHeapWord_2L_v_; text: .text%__1cILRG_ListGextend6MII_v_; text: .text%__1cWstatic_stub_RelocationLunpack_data6M_v_; -text: .text%__1cIciObjectGequals6Mp0_i_; text: .text%__1cJPhaseLiveGgetset6MpnFBlock__pnIIndexSet__; text: .text%__1cIConINodeGOpcode6kM_i_; -text: .text%__1cENodeRis_cisc_alternate6kM_i_; text: .text%__1cLIfFalseNodeGOpcode6kM_i_; text: .text%__1cKNode_ArrayGinsert6MIpnENode__v_; text: .text%__1cLCounterDataKcell_count6M_i_; -text: .text%__1cWThreadLocalAllocBufferFreset6M_v_; text: .text%__1cMMachProjNodeGOpcode6kM_i_; text: .text%__1cENodeEgrow6MI_v_; text: .text%__1cIMachNodePcompute_padding6kMi_i_; -text: .text%__1cKup_one_dom6FpnENode__1_: ifnode.o; text: .text%__1cIMachNodeSalignment_required6kM_i_; text: .text%__1cOPhaseIdealLoopEsort6MpnNIdealLoopTree_2_2_; -text: .text%__1cFframeOis_entry_frame6kM_i_; text: .text%__1cNCollectedHeapXallocate_from_tlab_slow6FpnGThread_L_pnIHeapWord__; -text: .text%__1cUParallelScavengeHeapVunsafe_max_tlab_alloc6kM_L_; text: .text%__1cHNTarjanICOMPRESS6M_v_; text: .text%__1cWThreadLocalAllocBufferXclear_before_allocation6M_v_; -text: .text%__1cFMutexGunlock6M_v_; -text: .text%__1cJMultiNodeIis_Multi6M_p0_; text: .text%__1cIBoolNodeGOpcode6kM_i_; text: .text%__1cSInterpreterRuntimeInewarray6FpnKJavaThread_nJBasicType_i_v_; text: .text%__1cUParallelScavengeHeapRallocate_new_tlab6ML_pnIHeapWord__; -text: .text%__1cKSharedHeapXfill_region_with_object6FnJMemRegion__v_; text: .text%__1cWThreadLocalAllocBufferKinitialize6MpnIHeapWord_22_v_; text: .text%__1cYNoJvmtiVMObjectAllocMark2t6M_v_; text: .text%__1cWThreadLocalAllocBufferEfill6MpnIHeapWord_2L_v_; text: .text%__1cYNoJvmtiVMObjectAllocMark2T6M_v_; -text: .text%__1cKTypeOopPtrCeq6kMpknEType__i_; -text: .text%__1cHTypePtrCeq6kMpknEType__i_; text: .text%__1cRMachSpillCopyNodePoper_input_base6kM_I_; text: .text%__1cIIndexSetFclear6M_v_; -text: .text%__1cHTypeIntJsingleton6kM_i_; text: .text%__1cJPhaseLiveLadd_liveout6MpnFBlock_pnIIndexSet_rnJVectorSet__v_; text: .text%__1cECopyXconjoint_words_to_lower6FpnIHeapWord_2L_v_; text: .text%__1cNRelocIteratorKset_limits6MpC1_v_; -text: .text%__1cNRelocIteratorKinitialize6MlpnICodeBlob_pC3_v_; text: .text%__1cNinstanceKlassGvtable6kM_pnLklassVtable__; text: .text%__1cSinstanceKlassKlassIoop_size6kMpnHoopDesc__i_; text: .text%__1cITypeNodeJideal_reg6kM_I_; -text: .text%__1cFframeUis_interpreted_frame6kM_i_; text: .text%__1cHTypeIntEhash6kM_i_; text: .text%__1cIPhaseGVNJtransform6MpnENode__2_; text: .text%__1cNinstanceKlassGitable6kM_pnLklassItable__; text: .text%__1cLklassItable2t6MnTinstanceKlassHandle__v_; -text: .text%__1cIMachNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cIciObjectEhash6M_i_; -text: .text%__1cENodeIis_Multi6M_pnJMultiNode__; -text: .text%__1cFState2T6M_v_; -text: .text%__1cPVirtualCallDataPfollow_contents6M_v_; -text: .text%__1cPVirtualCallDataPadjust_pointers6M_v_; -text: .text%__1cENodeGis_Con6kM_I_; -text: .text%__1cJrRegIOperJnum_edges6kM_I_; -text: .text%__1cENodeIget_long6kM_x_; text: .text%__1cNCellTypeStateFmerge6kM0i_0_; text: .text%__1cOPhaseIdealLoopUbuild_loop_tree_impl6MpnENode_i_i_; text: .text%__1cWNode_Backward_IteratorEnext6M_pnENode__; text: .text%__1cHemit_rm6FrnKCodeBuffer_iii_v_; -text: .text%__1cHPhiNodeGpinned6kM_i_; text: .text%__1cITypeNodeEhash6kM_I_; text: .text%__1cIIndexSetKinitialize6MIpnFArena__v_; text: .text%__1cJPhaseLiveKgetfreeset6M_pnIIndexSet__; text: .text%__1cMMachProjNodeJideal_reg6kM_I_; text: .text%__1cHPhiNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cIParmNodeGis_CFG6kM_i_; text: .text%__1cENodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cNCollectedHeapMobj_allocate6FnLKlassHandle_ipnGThread__pnHoopDesc__; text: .text%__1cNinstanceKlassRallocate_instance6MpnGThread__pnPinstanceOopDesc__; text: .text%__1cKRegionNodeGOpcode6kM_i_; text: .text%__1cMMachProjNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cLOptoRuntimeFnew_C6FpnMklassOopDesc_pnKJavaThread__v_; text: .text%__1cOBytecodeStreamEnext6M_nJBytecodesECode__; text: .text%__1cIProjNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cIJVMStateOis_monitor_use6kMI_i_; text: .text%__1cLTypeInstPtrEhash6kM_i_; -text: .text%__1cLuse_dom_lca6FpnFBlock_pnENode_3rnLBlock_Array__1_: gcm.o; text: .text%__1cITypeLongEhash6kM_i_; -text: .text%__1cIBoolNodeHis_Bool6M_p0_; text: .text%__1cOPhaseIdealLoopOget_early_ctrl6MpnENode__2_; text: .text%__1cOPhaseIdealLoopOset_early_ctrl6MpnENode__v_; -text: .text%__1cENodeHis_Loop6M_pnILoopNode__; text: .text%__1cIJumpDataKcell_count6M_i_; text: .text%__1cHNTarjanELINK6Mp01_v_; text: .text%__1cENodeIIdentity6MpnOPhaseTransform__p0_; -text: .text%__1cIMachNode2t6M_v_; -text: .text%__1cFStateRMachOperGenerator6MipnIMachNode_pnHCompile__pnIMachOper__; text: .text%__1cRPSOldPromotionLABFflush6M_v_; -text: .text%__1cICallNodeHis_Call6M_p0_; -text: .text%__1cENodeFIdeal6MpnIPhaseGVN_i_p0_; text: .text%__1cENodeRraise_bottom_type6MpknEType__v_; text: .text%__1cOJNIHandleBlockPallocate_handle6MpnHoopDesc__pnI_jobject__; text: .text%__1cENodeNis_block_proj6kM_pk0_; -text: .text%__1cUParallelScavengeHeapPis_in_permanent6kMpkv_i_; -text: .text%__1cHdom_lca6FpnFBlock_1_1_: gcm.o; text: .text%__1cOPhaseIdealLoopThas_local_phi_input6MpnENode__2_; text: .text%__1cJVectorSet2F6kMI_i_; text: .text%__1cIMachOperDreg6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cICallNodeLbottom_type6kM_pknEType__; text: .text%JVM_ArrayCopy; -text: .text%__1cOtypeArrayKlassQoop_is_typeArray6kM_i_; text: .text%__1cOtypeArrayKlassKcopy_array6MpnMarrayOopDesc_i2iipnGThread__v_; text: .text%__1cIMachNodeLbottom_type6kM_pknEType__; -text: .text%__1cPClassFileParserOcheck_property6MipkcipnGThread__v_; text: .text%__1cFState2t6M_v_; -text: .text%__1cFStateDDFA6MipknENode__i_; text: .text%__1cJPhaseLiveHfreeset6MpknFBlock__v_; text: .text%__1cOPhaseIdealLoopbIdom_lca_for_get_late_ctrl_internal6MpnENode_22_2_; -text: .text%__1cKRegionNodeGpinned6kM_i_; text: .text%__1cPjava_lang_ClassLas_klassOop6FpnHoopDesc__pnMklassOopDesc__; text: .text%__1cRSignatureIteratorGexpect6Mc_v_; text: .text%__1cIProjNodeEhash6kM_I_; text: .text%__1cENodeFclone6kM_p0_; text: .text%__1cILocationIwrite_on6MpnUDebugInfoWriteStream__v_; text: .text%__1cIPhaseCCPOtransform_once6MpnENode__2_; -text: .text%__1cHCompileMFillLocArray6MpnENode_pnNGrowableArray4CpnKScopeValue____i_; text: .text%__1cHRegMaskPfind_first_pair6kM_i_; text: .text%__1cENodeKmatch_edge6kMI_I_; text: .text%__1cKJNIHandlesKmake_local6FpnHJNIEnv__pnHoopDesc__pnI_jobject__; @@ -355,41 +233,27 @@ text: .text%__1cNPhaseRegAllocKreg2offset6kMi_i_; text: .text%__1cNPhaseRegAllocUreg2offset_unchecked6kMi_i_; text: .text%__1cbAfinal_graph_reshaping_impl6FpnENode_rnUFinal_Reshape_Counts__v_: compile.o; text: .text%__1cETypeFxmeet6kMpk0_2_; -text: .text%__1cENodeFis_If6M_pnGIfNode__; text: .text%__1cJStartNodeLbottom_type6kM_pknEType__; text: .text%__1cICmpPNodeGOpcode6kM_i_; text: .text%__1cOMethodLivenessKBasicBlockXcompute_gen_kill_single6MpnQciBytecodeStream__v_; text: .text%__1cKjmpDirNodeMideal_Opcode6kM_i_; text: .text%__1cOPhaseIdealLoopZremix_address_expressions6MpnENode__2_; -text: .text%__1cFMutexElock6MpnGThread__v_; -text: .text%__1cILoadNodeHis_Load6M_p0_; text: .text%__1cGciTypeEmake6FnJBasicType__p0_; text: .text%__1cQUnique_Node_ListGremove6MpnENode__v_; text: .text%__1cKNode_Array2t6MpnFArena__v_; text: .text%__1cRMachSafePointNodeEjvms6kM_pnIJVMState__; text: .text%__1cNinstanceKlassMclass_loader6kM_pnHoopDesc__; text: .text%__1cOPhaseIdealLoopNget_late_ctrl6MpnENode_2_2_; -text: .text%__1cRMachSpillCopyNodeOimplementation6kMpnKCodeBuffer_pnNPhaseRegAlloc_i_I_; text: .text%__1cKTypeAryPtrEhash6kM_i_; text: .text%__1cIIndexSet2t6Mp0_v_; text: .text%__1cNrFlagsRegOperEtype6kM_pknEType__; text: .text%__1cHTypeInt2t6Miii_v_; -text: .text%__1cTconstantPoolOopDescbAname_and_type_ref_index_at6Mi_i_; text: .text%__1cMPhaseChaitinSuse_prior_register6MpnENode_I2pnFBlock_rnJNode_List_6_i_; -text: .text%__1cIGraphKitHstopped6M_i_; -text: .text%__1cKTypeOopPtrJsingleton6kM_i_; text: .text%__1cENodeQIdeal_DU_postCCP6MpnIPhaseCCP__p0_; -text: .text%__1cNSafePointNodeGpinned6kM_i_; -text: .text%__1cQCompressedStream2t6MpCi_v_; text: .text%__1cIConLNodeGOpcode6kM_i_; text: .text%__1cHPhiNodeEhash6kM_I_; -text: .text%__1cGIfNodeGpinned6kM_i_; -text: .text%__1cOis_diamond_phi6FpnENode__i_: cfgnode.o; -text: .text%__1cLTypeInstPtrCeq6kMpknEType__i_; text: .text%__1cENodeHsize_of6kM_I_; -text: .text%__1cENodeSremove_dead_region6MpnIPhaseGVN_i_i_; text: .text%__1cHRegMaskMSmearToPairs6M_v_; -text: .text%__1cSCallStaticJavaNodeEhash6kM_I_; text: .text%jni_GetObjectField: jni.o; text: .text%__1cJMarkSweepXrevisit_weak_klass_link6FpnFKlass__v_; text: .text%__1cKklassKlassToop_follow_contents6MpnHoopDesc__v_; @@ -398,53 +262,33 @@ text: .text%__1cFKlassXfollow_weak_klass_links6MpnRBoolObjectClosure_pnKOopClosu text: .text%__1cKNode_ArrayEgrow6MI_v_; text: .text%__1cLklassVtableToop_adjust_pointers6M_v_; text: .text%__1cLklassVtableToop_follow_contents6M_v_; -text: .text%__1cCosOis_interrupted6FpnGThread_i_i_; text: .text%__1cICmpINodeGOpcode6kM_i_; -text: .text%__1cHMatcherKLabel_Root6MpknENode_pnFState_p16_6_; text: .text%__1cMPhaseChaitinHnew_lrg6MpknENode_I_v_; text: .text%__1cFframeYinterpreter_frame_method6kM_pnNmethodOopDesc__; text: .text%__1cUGenericGrowableArrayMraw_allocate6Mi_pv_; text: .text%__1cJMarkSweepNpreserve_mark6FpnHoopDesc_pnLmarkOopDesc__v_; text: .text%__1cIMachNodeKconst_size6kM_i_; -text: .text%__1cGIfNodeFis_If6M_p0_; text: .text%__1cINodeHashLhash_insert6MpnENode__v_; -text: .text%__1cOPhaseIdealLoopMis_dominator6MpnENode_2_i_; -text: .text%__1cKTypeOopPtrLxadd_offset6kMi_i_; text: .text%JVM_Read; text: .text%__1cDhpiEread6FipvI_L_; -text: .text%__1cIMachNodeIpeephole6MpnFBlock_ipnNPhaseRegAlloc_ri_p0_; text: .text%__1cMPhaseIterGVNVadd_users_to_worklist6MpnENode__v_; -text: .text%__1cIHaltNodeGis_CFG6kM_i_; -text: .text%__1cENodeKis_PCTable6kM_pknLPCTableNode__; text: .text%__1cPClassFileStreamGget_u16MpnGThread__C_; text: .text%__1cMMergeMemNodeGOpcode6kM_i_; text: .text%__1cPciObjectFactoryEfind6MpnHoopDesc_pnNGrowableArray4CpnIciObject____i_; -text: .text%__1cJCodeCacheQfind_blob_unsafe6Fpv_pnICodeBlob__; text: .text%__1cHemit_d86FrnKCodeBuffer_i_v_; -text: .text%__1cKCodeBuffer2t6MiiiiiipnKBufferBlob_pnJrelocInfo_pnORelocateBuffer_ipnLOopRecorder_pkcii_v_; text: .text%__1cLOopRecorder2t6MpnFArena__v_; text: .text%__1cKCodeBuffer2T6M_v_; -text: .text%__1cKCodeBufferQalloc_relocation6MI_v_; text: .text%__1cIMachNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cIMachNodeJemit_size6kMpnNPhaseRegAlloc__I_; -text: .text%__1cLTypeInstPtr2t6MnHTypePtrDPTR_pnHciKlass_ipnIciObject_i_v_; -text: .text%__1cLOptoRuntimeKjbyte_copy6FpW1L_v_; text: .text%__1cJloadINodeErule6kM_I_; text: .text%__1cMOopMapStream2t6MpnGOopMap_i_v_; -text: .text%__1cPciObjectFactoryLis_found_at6MipnHoopDesc_pnNGrowableArray4CpnIciObject____i_; text: .text%__1cIMachOperDreg6kMpnNPhaseRegAlloc_pknENode__i_; text: .text%__1cIAddINodeGOpcode6kM_i_; text: .text%__1cWShouldNotReachHereNodeMideal_Opcode6kM_i_; -text: .text%__1cOmatch_into_reg6FpnENode_iii1_i_: matcher.o; -text: .text%__1cENodeJis_Branch6kM_I_; -text: .text%__1cITypeLong2t6Mxxi_v_; text: .text%__1cRconstantPoolKlassIoop_size6kMpnHoopDesc__i_; text: .text%__1cIJVMStateIof_depth6kMi_p0_; -text: .text%__1cFMutexElock6M_v_; text: .text%__1cJrRegLOperEtype6kM_pknEType__; text: .text%__1cENode2t6Mp0_v_; -text: .text%__1cLTypeInstPtrEmake6FnHTypePtrDPTR_pnHciKlass_ipnIciObject_i_pk0_; -text: .text%__1cJStartNodeGpinned6kM_i_; text: .text%__1cHhashptr6Fpkv_i_; text: .text%__1cLklassItableToop_adjust_pointers6M_v_; text: .text%__1cLklassItableToop_follow_contents6M_v_; @@ -455,62 +299,39 @@ text: .text%__1cSinstanceKlassKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cNinstanceKlassXfollow_weak_klass_links6MpnRBoolObjectClosure_pnKOopClosure__v_; text: .text%__1cNinstanceKlassUadjust_static_fields6M_v_; text: .text%__1cNinstanceKlassUfollow_static_fields6M_v_; -text: .text%__1cFBlockLis_uncommon6kMrnLBlock_Array__i_; text: .text%__1cEDict2F6kMpkv_pv_; text: .text%__1cIProjNodeLbottom_type6kM_pknEType__; text: .text%__1cNCatchProjNodeGOpcode6kM_i_; text: .text%__1cJCodeCacheJfind_blob6Fpv_pnICodeBlob__; text: .text%__1cICallNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cJdo_method6FpnNmethodOopDesc__v_: recompilationMonitor.o; text: .text%__1cWconstantPoolCacheKlassIoop_size6kMpnHoopDesc__i_; text: .text%__1cKjmpConNodeMideal_Opcode6kM_i_; text: .text%__1cJLoadPNodeGOpcode6kM_i_; text: .text%__1cLSymbolTableGlookup6MipkciI_pnNsymbolOopDesc__; text: .text%__1cWconstantPoolCacheKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cWconstantPoolCacheKlassToop_adjust_pointers6MpnHoopDesc__i_; -text: .text%__1cOindOffset8OperJnum_edges6kM_I_; -text: .text%__1cKBufferBlobIis_alive6kM_i_; -text: .text%__1cFframeGsender6kMpnLRegisterMap_pnICodeBlob__0_; -text: .text%__1cJTypeTupleJsingleton6kM_i_; -text: .text%__1cKTypeAryPtrCeq6kMpknEType__i_; text: .text%__1cHPhiNodeKin_RegMask6kMI_rknHRegMask__; -text: .text%__1cETypeKhas_memory6kM_i_; -text: .text%__1cHMatcherKReduceOper6MpnFState_ipnIMachNode_rpnENode__v_; text: .text%__1cGIfNodeLbottom_type6kM_pknEType__; text: .text%__1cENodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIMachNodeFreloc6kM_i_; text: .text%__1cPciObjectFactoryDget6MpnHoopDesc__pnIciObject__; text: .text%__1cOThreadCritical2T6M_v_; text: .text%__1cOThreadCritical2t6M_v_; -text: .text%__1cFframeOis_first_frame6kM_i_; -text: .text%__1cICodeBlobOis_osr_adapter6kM_i_; -text: .text%__1cHConNodeGis_Con6kM_I_; text: .text%__1cIAddPNodeKmatch_edge6kMI_I_; text: .text%__1cILoadNodeEhash6kM_I_; text: .text%__1cRMachSpillCopyNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cICodeBlobTfix_oop_relocations6MpC1_v_; -text: .text%__1cICodeBlobTfix_oop_relocations6M_v_; text: .text%__1cIimmIOperIconstant6kM_l_; -text: .text%__1cHCmpNodeGis_Cmp6kM_pk0_; -text: .text%__1cFMutexbClock_without_safepoint_check6M_v_; text: .text%__1cENodeHdel_req6MI_v_; text: .text%__1cJCProjNodeEhash6kM_I_; -text: .text%__1cHCompileJcan_alias6MpknHTypePtr_i_i_; text: .text%__1cJMultiNodeEhash6kM_I_; text: .text%__1cRSignatureIteratorKparse_type6M_i_; -text: .text%__1cHnmethodIis_alive6kM_i_; text: .text%__1cIHaltNodeGOpcode6kM_i_; -text: .text%__1cMMergeMemNodeLis_MergeMem6M_p0_; -text: .text%__1cUPSMarkSweepDecoratorQinsert_deadspace6MrlpnIHeapWord_L_i_; text: .text%__1cHPhiNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cMPhaseIterGVNZremove_globally_dead_node6MpnENode__v_; text: .text%__1cETypeEhash6kM_i_; text: .text%__1cJHashtableLhash_symbol6Fpkci_I_; -text: .text%__1cKTypeAryPtrEmake6FnHTypePtrDPTR_pnIciObject_pknHTypeAry_pnHciKlass_ii_pk0_; -text: .text%__1cYDebugInformationRecorderLcheck_phase6Mn0AFPhase__v_; text: .text%__1cOMachReturnNodeKin_RegMask6kMI_rknHRegMask__; text: .text%__1cFframeVinterpreter_frame_bcp6kM_pC_; -text: .text%__1cICodeBlobKis_nmethod6kM_i_; text: .text%__1cICmpUNodeGOpcode6kM_i_; text: .text%__1cJOopMapSetSfind_map_at_offset6kMi_pnGOopMap__; text: .text%__1cICodeBlobbAoop_map_for_return_address6MpC_pnGOopMap__; @@ -519,91 +340,53 @@ text: .text%__1cIMachNodeHtwo_adr6kM_I_; text: .text%__1cIParmNodeGOpcode6kM_i_; text: .text%__1cTconvI2L_reg_regNodeErule6kM_I_; text: .text%__1cHTypeIntFxmeet6kMpknEType__3_; -text: .text%__1cLAdapterInfoFequal6kMp0_i_; -text: .text%__1cGOopMapbEmap_compiler_reg_to_oopmap_reg6Miii_i_; -text: .text%__1cTconstantPoolOopDescSklass_ref_index_at6Mi_i_; text: .text%__1cLSymbolTableGlookup6FpkcipnGThread__pnNsymbolOopDesc__; -text: .text%__1cKoopFactoryKnew_symbol6FpkcipnGThread__pnNsymbolOopDesc__; text: .text%__1cMloadConINodeMideal_Opcode6kM_i_; text: .text%__1cGTarjanEEVAL6M_p0_; -text: .text%__1cKRelocationYindex_to_runtime_address6Fl_pC_; text: .text%__1cYexternal_word_RelocationLunpack_data6M_v_; text: .text%__1cJCatchNodeGOpcode6kM_i_; text: .text%__1cZPhaseConservativeCoalesceIcoalesce6MpnFBlock__v_; -text: .text%__1cITypeLongJsingleton6kM_i_; -text: .text%__1cNencode_RegMem6FrnKCodeBuffer_iiiiii_v_; -text: .text%__1cFBlockGselect6MrnJNode_List_rnLBlock_Array_pirnJVectorSet_IrnNGrowableArray4CI___pnENode__; -text: .text%__1cGOopMapHset_xxx6MinLOopMapValueJoop_types_iii_v_; -text: .text%__1cFMutexNowned_by_self6kM_i_; text: .text%__1cTCreateExceptionNodeErule6kM_I_; text: .text%__1cIJVMStateLdebug_start6kM_I_; -text: .text%__1cRCardTableModRefBSEkind6M_nKBarrierSetEName__; text: .text%__1cMloadConPNodeMideal_Opcode6kM_i_; text: .text%__1cIMachNodeNoperand_index6kMI_i_; -text: .text%__1cKMachIfNodeJis_MachIf6kM_pk0_; text: .text%__1cFBlockIis_Empty6kM_i_; text: .text%__1cMMachTypeNodeLbottom_type6kM_pknEType__; text: .text%__1cIAddPNodeLbottom_type6kM_pknEType__; text: .text%__1cFBlockOcode_alignment6M_I_; -text: .text%__1cKRegionNodeJis_Region6kM_pk0_; text: .text%__1cGBitMapUclear_range_of_words6MLL_v_; -text: .text%__1cGBitMapFclear6M_v_; -text: .text%__1cSinstanceKlassKlassMoop_is_klass6kM_i_; text: .text%__1cJrRegIOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cKCastPPNodeGOpcode6kM_i_; text: .text%__1cIPhaseIFGMtest_edge_sq6kMII_i_; -text: .text%__1cFframeQoops_do_internal6MpnKOopClosure_pnLRegisterMap_i_v_; text: .text%__1cNinstanceKlassLfind_method6FpnPobjArrayOopDesc_pnNsymbolOopDesc_4_pnNmethodOopDesc__; text: .text%__1cFStateRMachNodeGenerator6MipnHCompile__pnIMachNode__; text: .text%__1cHMatcherKReduceInst6MpnFState_irpnENode__pnIMachNode__; -text: .text%__1cENodeOis_CountedLoop6M_pnPCountedLoopNode__; text: .text%__1cPClassFileStreamHskip_u16MipnGThread__v_; -text: .text%__1cMMachCallNodeGpinned6kM_i_; -text: .text%__1cHnmethodJis_zombie6kM_i_; text: .text%__1cMMergeMemNodeLbottom_type6kM_pknEType__; text: .text%__1cNinstanceKlassLfind_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; -text: .text%__1cKTypeAryPtrKadd_offset6kMi_pknHTypePtr__; -text: .text%__1cKCodeBufferIrelocate6MpCrknQRelocationHolder_i_v_; text: .text%__1cILoadNodeLbottom_type6kM_pknEType__; text: .text%__1cLConvI2LNodeGOpcode6kM_i_; text: .text%__1cHTypeIntEmake6Fi_pk0_; -text: .text%__1cbFCompressedLineNumberWriteStreamKwrite_pair6Mii_v_; text: .text%__1cJMultiNodeIproj_out6kMI_pnIProjNode__; -text: .text%__1cFKlassMoop_is_array6kM_i_; text: .text%__1cIBoolNodeEhash6kM_I_; text: .text%__1cIimmPOperEtype6kM_pknEType__; text: .text%__1cMloadConPNodeLbottom_type6kM_pknEType__; -text: .text%__1cJrRegPOperJnum_edges6kM_I_; text: .text%__1cOrFlagsRegUOperEtype6kM_pknEType__; text: .text%__1cGIfNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cNsymbolOopDescLas_C_string6kM_pc_; text: .text%__1cNsymbolOopDescLas_C_string6kMpci_1_; -text: .text%__1cGOopMapJset_value6Miii_v_; text: .text%__1cITypeLongFxmeet6kMpknEType__3_; text: .text%__1cNCollectedHeapbHcheck_for_non_bad_heap_word_value6MpnIHeapWord_L_v_; -text: .text%__1cHMatcherTReduceInst_Interior6MpnFState_ipnIMachNode_IrpnENode__I_; -text: .text%__1cNsymbolOopDescGequals6kMpkci_i_; text: .text%__1cMPhaseChaitinLinsert_proj6MpnFBlock_IpnENode_I_v_; -text: .text%__1cKjmpConNodeGpinned6kM_i_; -text: .text%__1cNSafePointNodebBneeds_polling_address_input6F_i_; text: .text%__1cHCompileRprobe_alias_cache6MpknHTypePtr__pn0APAliasCacheEntry__; -text: .text%__1cHnmethodOis_not_entrant6kM_i_; -text: .text%__1cIAddPNodeHis_AddP6M_p0_; -text: .text%__1cNobjArrayKlassQarray_klass_impl6MiipnGThread__pnMklassOopDesc__; -text: .text%__1cNobjArrayKlassQarray_klass_impl6FnTobjArrayKlassHandle_iipnGThread__pnMklassOopDesc__; -text: .text%__1cIMachNodeGExpand6MpnFState_rnJNode_List__p0_; text: .text%__1cXInterpreterFrameClosureJoffset_do6Mi_v_; -text: .text%__1cNinstanceKlassQarray_klass_impl6FnTinstanceKlassHandle_iipnGThread__pnMklassOopDesc__; -text: .text%__1cNinstanceKlassQarray_klass_impl6MiipnGThread__pnMklassOopDesc__; text: .text%__1cENodeIdestruct6M_v_; text: .text%__1cIAddPNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cPClassFileParserbEparse_constant_pool_utf8_entry6MnSconstantPoolHandle_ipnGThread__v_; text: .text%__1cPClassFileParserRverify_legal_utf86MpkCipnGThread__v_; text: .text%__1cMMachHaltNodeEjvms6kM_pnIJVMState__; text: .text%__1cKoopFactoryMnew_objArray6FpnMklassOopDesc_ipnGThread__pnPobjArrayOopDesc__; text: .text%__1cNinstanceKlassRallocate_objArray6MiipnGThread__pnPobjArrayOopDesc__; text: .text%__1cGBitMapJset_union6M0_v_; -text: .text%__1cPciInstanceKlassMis_interface6M_i_; text: .text%__1cHTypeIntEmake6Fiii_pk0_; text: .text%__1cJTypeTupleEhash6kM_i_; text: .text%__1cFParsePdo_one_bytecode6M_v_; @@ -614,27 +397,14 @@ text: .text%__1cUParallelScavengeHeapWpermanent_mem_allocate6ML_pnIHeapWord__; text: .text%__1cJPSPermGenSallocate_permanent6ML_pnIHeapWord__; text: .text%__1cPmethodDataKlassIoop_size6kMpnHoopDesc__i_; text: .text%__1cIHaltNodeKmatch_edge6kMI_I_; -text: .text%__1cENodeOis_block_start6kM_i_; -text: .text%__1cHMatcherQis_save_on_entry6Mi_i_; -text: .text%__1cLsymbolKlassNoop_is_symbol6kM_i_; -text: .text%__1cITypeLongEmake6Fxxi_pk0_; text: .text%__1cPmethodDataKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cPmethodDataKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cMPhaseIterGVNKis_IterGVN6M_p0_; text: .text%__1cGBitMap2t6MpLL_v_; -text: .text%__1cLOptoRuntimePnew_typeArray_C6FnJBasicType_ipnKJavaThread__v_; -text: .text%__1cHCompilePfind_alias_type6MpknHTypePtr_i_pn0AJAliasType__; text: .text%__1cNnew_loc_value6FpnNPhaseRegAlloc_inILocationEType__pnNLocationValue__: output.o; -text: .text%__1cKjmpDirNodePoper_input_base6kM_I_; -text: .text%__1cMMachCallNodeLis_MachCall6M_p0_; -text: .text%__1cHPhiNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cXjava_lang_ref_ReferenceNreferent_addr6FpnHoopDesc__p2_; text: .text%__1cOindOffset8OperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cOindOffset8OperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_; -text: .text%__1cZPhaseConservativeCoalesceJcopy_copy6MpnENode_2pnFBlock_I_i_; -text: .text%__1cKutf8_write6FpCH_0_: utf8.o; text: .text%__1cKNode_ArrayGremove6MI_v_; -text: .text%__1cTconstantPoolOopDescQsignature_ref_at6Mi_pnNsymbolOopDesc__; text: .text%__1cHPhiNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cRSignatureIterator2t6MnMsymbolHandle__v_; text: .text%__1cJloadPNodeMideal_Opcode6kM_i_; @@ -642,17 +412,11 @@ text: .text%__1cPSignatureStreamEnext6M_v_; text: .text%__1cOindOffset8OperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cLjmpConUNodeMideal_Opcode6kM_i_; text: .text%__1cFBlockJfind_node6kMpknENode__I_; -text: .text%__1cOis_range_check6FpnENode_r12ri_i_: ifnode.o; -text: .text%__1cENodeIis_Start6M_pnJStartNode__; text: .text%__1cHhashkey6Fpkv_i_; text: .text%__1cNLoadRangeNodeGOpcode6kM_i_; text: .text%__1cJLoadINodeGOpcode6kM_i_; -text: .text%__1cKis_x2logic6FpnIPhaseGVN_pnENode__3_: cfgnode.o; -text: .text%__1cHAbsNodeLis_absolute6FpnIPhaseGVN_pnENode__4_; text: .text%__1cGTarjanICOMPRESS6M_v_; text: .text%__1cTconstantPoolOopDescNklass_at_impl6FnSconstantPoolHandle_ipnGThread__pnMklassOopDesc__; -text: .text%__1cENodeHis_Goto6kM_I_; -text: .text%__1cLPCTableNodeGpinned6kM_i_; text: .text%JVM_ReleaseUTF; text: .text%__1cHSubNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cFChunk2t6ML_v_; @@ -662,7 +426,6 @@ text: .text%__1cMCreateExNodeGOpcode6kM_i_; text: .text%__1cFframebCsender_for_interpreter_frame6kMpnLRegisterMap__0_; text: .text%__1cFChunk2k6Fpv_v_; text: .text%__1cOMachReturnNodeIadr_type6kM_pknHTypePtr__; -text: .text%__1cJrelocInfo2t6Mn0AJrelocType_ii_v_; text: .text%__1cHMatcherKmatch_tree6MpknENode__pnIMachNode__; text: .text%__1cLTypeInstPtrFxmeet6kMpknEType__3_; text: .text%__1cKjmpConNodePoper_input_base6kM_I_; @@ -670,84 +433,45 @@ text: .text%__1cIJVMState2t6MpnIciMethod_p0_v_; text: .text%__1cMciMethodDataHdata_at6Mi_pnLProfileData__; text: .text%__1cJrelocInfoNfinish_prefix6Mph_p0_; text: .text%__1cIProjNodeHsize_of6kM_I_; -text: .text%__1cENodeHis_AddP6M_pnIAddPNode__; -text: .text%__1cLTypeInstPtrKadd_offset6kMi_pknHTypePtr__; text: .text%__1cHBitDataKcell_count6M_i_; -text: .text%__1cFframeZsender_for_compiled_frame6kMpnLRegisterMap_pnICodeBlob__0_; text: .text%__1cFArenaEgrow6ML_pv_; -text: .text%__1cNCollectedHeapWpermanent_obj_allocate6FnLKlassHandle_ipnGThread__pnHoopDesc__; text: .text%__1cMPhaseIterGVNMsubsume_node6MpnENode_2_v_; -text: .text%__1cLBoxLockNodeNrematerialize6kM_i_; -text: .text%__1cRMachSafePointNodeQis_MachSafePoint6M_p0_; text: .text%__1cJloadBNodeErule6kM_I_; -text: .text%__1cITypeNodeRraise_bottom_type6MpknEType__v_; text: .text%__1cHConNodeEhash6kM_I_; -text: .text%__1cICodeBlobLlink_offset6M_i_; text: .text%__1cENodeRdisconnect_inputs6Mp0_i_; text: .text%__1cIHaltNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cICodeBlobOis_i2c_adapter6kM_i_; text: .text%__1cTconstantPoolOopDescWsignature_ref_index_at6Mi_i_; -text: .text%__1cIJVMStateNclone_shallow6kM_p0_; text: .text%__1cRMachSpillCopyNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cGOopMapQset_callee_saved6Miiii_v_; text: .text%__1cKRegionNodeLbottom_type6kM_pknEType__; -text: .text%__1cJOopMapSetTupdate_register_map6FpknFframe_pnICodeBlob_pnLRegisterMap__v_; text: .text%__1cIJVMStateJdebug_end6kM_I_; -text: .text%__1cXjava_lang_ref_ReferenceJnext_addr6FpnHoopDesc__p2_; text: .text%__1cENode2t6Mp011_v_; -text: .text%__1cENodeMis_SafePoint6M_pnNSafePointNode__; -text: .text%__1cHMatcherTcollect_null_checks6MpnENode__v_; -text: .text%__1cNSafePointNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cHMemNodeMIdeal_common6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cGBitMapGat_put6MLi_v_; -text: .text%__1cFciEnvIis_in_vm6F_i_; text: .text%__1cNSafePointNodeHsize_of6kM_I_; -text: .text%__1cMgetTimeNanos6F_x_; -text: .text%__1cKciTypeFlowLStateVectorSapply_one_bytecode6MpnQciBytecodeStream__i_; text: .text%__1cKPSScavengeUoop_promotion_failed6FpnHoopDesc_pnLmarkOopDesc__v_; text: .text%__1cHTypePtrLmeet_offset6kMi_i_; -text: .text%__1cOMergeMemStreamOnext_non_empty6Mi_i_; -text: .text%__1cNPhaseRegAllocGis_oop6kMpknENode__i_; text: .text%__1cSPSPromotionManagerUoop_promotion_failed6MpnHoopDesc_pnLmarkOopDesc__2_; -text: .text%__1cIMachOperLdisp_is_oop6kM_i_; text: .text%__1cRSignatureIteratorSiterate_parameters6M_v_; text: .text%__1cNmethodOopDescIbci_from6kMpC_i_; -text: .text%__1cICodeBlobYcaller_must_gc_arguments6kMpnKJavaThread__i_; text: .text%__1cLLShiftLNodeGOpcode6kM_i_; text: .text%__1cOMethodLivenessKBasicBlockIload_one6Mi_v_; -text: .text%__1cJTypeTupleCeq6kMpknEType__i_; text: .text%__1cHCmpNodeLbottom_type6kM_pknEType__; text: .text%__1cFDictI2i6M_v_; -text: .text%__1cPjava_lang_ClassMis_primitive6FpnHoopDesc__i_; text: .text%JVM_GetMethodIxExceptionTableLength; -text: .text%__1cKC2IAdapterIis_alive6kM_i_; text: .text%__1cENodeHget_int6kM_i_; text: .text%__1cMMachCallNodeLbottom_type6kM_pknEType__; text: .text%__1cOGenerateOopMapHinterp16MpnOBytecodeStream__v_; -text: .text%__1cIAddPNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cMloadConINodeLbottom_type6kM_pknEType__; text: .text%__1cPCheckCastPPNodeGOpcode6kM_i_; text: .text%__1cMloadConINodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cENodeXis_iteratively_computed6M_i_; -text: .text%__1cNloadConI0NodePoper_input_base6kM_I_; -text: .text%__1cNinstanceKlassPoop_is_instance6kM_i_; text: .text%__1cENodeKreplace_by6Mp0_v_; text: .text%__1cHPhiNodeIadr_type6kM_pknHTypePtr__; text: .text%__1cIBoolTestKcc2logical6kMpknEType__3_; text: .text%__1cIBoolNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cJrelocInfoKset_format6Mi_v_; text: .text%__1cXruntime_call_RelocationEtype6M_nJrelocInfoJrelocType__; -text: .text%__1cKRelocationJpack_data6M_i_; -text: .text%__1cXjava_lang_ref_ReferencePdiscovered_addr6FpnHoopDesc__p2_; text: .text%__1cNPhaseCoalesceRcombine_these_two6MpnENode_2_v_; text: .text%__1cNtestP_regNodeMideal_Opcode6kM_i_; -text: .text%__1cETypeFempty6kM_i_; -text: .text%__1cHMemNodeGis_Mem6M_p0_; -text: .text%__1cZload_can_see_stored_value6FpnILoadNode_pnENode_pnOPhaseTransform__3_: memnode.o; text: .text%__1cICallNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cICodeBlobJis_zombie6kM_i_; text: .text%__1cJTypeTupleGfields6FI_ppknEType__; -text: .text%__1cOGenerateOopMapPjump_targets_do6MpnOBytecodeStream_pFp0ipi_v4_i_; text: .text%__1cPClassFileParserUassemble_annotations6MpCi1ipnGThread__nPtypeArrayHandle__; text: .text%method_compare: methodOop.o; text: .text%__1cMMergeMemNodeEhash6kM_I_; @@ -755,47 +479,30 @@ text: .text%__1cJloadPNodePoper_input_base6kM_I_; text: .text%__1cILoadNodeKmatch_edge6kMI_I_; text: .text%__1cFBlockUneeded_for_next_call6MpnENode_rnJVectorSet_rnLBlock_Array__v_; text: .text%__1cIIndexSetSpopulate_free_list6F_v_; -text: .text%__1cGIfNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cCosPelapsed_counter6F_x_; text: .text%__1cIAddPNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cIemit_d326FrnKCodeBuffer_i_v_; -text: .text%__1cNloadConI0NodeHtwo_adr6kM_I_; text: .text%__1cJStoreNodeKmatch_edge6kMI_I_; text: .text%__1cITypeNodeDcmp6kMrknENode__I_; text: .text%__1cMPhaseChaitinFUnion6MpknENode_3_v_; -text: .text%__1cFKlassMoop_is_klass6kM_i_; text: .text%__1cRSignatureIteratorTcheck_signature_end6M_v_; text: .text%__1cRSignatureIteratorSiterate_returntype6M_v_; text: .text%__1cNinstanceKlassWuncached_lookup_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; -text: .text%__1cHnmethodKis_nmethod6kM_i_; text: .text%__1cILoadNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cNSafePointNodeKmatch_edge6kMI_I_; text: .text%__1cPClassFileStreamGget_u46MpnGThread__I_; -text: .text%__1cSCallStaticJavaNodeRis_CallStaticJava6kM_pk0_; text: .text%__1cKarrayKlassLobject_size6kMi_i_; -text: .text%__1cPciInstanceKlassRis_instance_klass6M_i_; -text: .text%__1cOno_flip_branch6FpnFBlock__i_: block.o; text: .text%__1cKarrayKlassGvtable6kM_pnLklassVtable__; text: .text%__1cYCallStaticJavaDirectNodePoper_input_base6kM_I_; text: .text%__1cOGenerateOopMapEpush6MnNCellTypeState__v_; -text: .text%__1cKjmpDirNodeGpinned6kM_i_; -text: .text%__1cTconstantPoolOopDescLname_ref_at6Mi_pnNsymbolOopDesc__; -text: .text%__1cKjmpDirNodeHtwo_adr6kM_I_; text: .text%__1cPciInstanceKlassGloader6M_pnHoopDesc__; -text: .text%__1cJrRegLOperJnum_edges6kM_I_; text: .text%__1cOGenerateOopMapDpop6M_nNCellTypeState__; -text: .text%__1cNGrowableArray4CpnKScopeValue__2t6Mii_v_; text: .text%__1cYDebugInformationRecorderWserialize_scope_values6MpnNGrowableArray4CpnKScopeValue____i_; text: .text%__1cYDebugInformationRecorderTcreate_scope_values6MpnNGrowableArray4CpnKScopeValue____pnKDebugToken__; text: .text%__1cITypeNodeHsize_of6kM_I_; text: .text%__1cILoadNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cPPerfLongVariantGsample6M_v_; text: .text%__1cNloadConI0NodeErule6kM_I_; -text: .text%__1cJCodeCacheIcontains6Fpv_i_; text: .text%__1cQciBytecodeStreamMreset_to_bci6Mi_v_; -text: .text%__1cJOopMapSetGall_do6FpknFframe_pnICodeBlob_pknLRegisterMap_pnKOopClosure_pFppnHoopDesc_9E_v9B9B_v_; -text: .text%__1cFframeRoops_code_blob_do6MpnKOopClosure_pknLRegisterMap__v_; -text: .text%__1cJOopMapSetHoops_do6FpknFframe_pnICodeBlob_pknLRegisterMap_pnKOopClosure__v_; text: .text%__1cHPhiNodeHsize_of6kM_I_; text: .text%__1cSInterpreterRuntimeJanewarray6FpnKJavaThread_pnTconstantPoolOopDesc_ii_v_; text: .text%__1cMPhaseChaitinNFind_compress6MI_I_; @@ -804,92 +511,55 @@ text: .text%__1cLOopMapCacheIentry_at6kMi_pnQOopMapCacheEntry__; text: .text%__1cOGenerateOopMapKcheck_type6MnNCellTypeState_1_v_; text: .text%__1cPciInstanceKlassRprotection_domain6M_pnHoopDesc__; text: .text%__1cSobjArrayKlassKlassIoop_size6kMpnHoopDesc__i_; -text: .text%__1cILoadNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cMPhaseIterGVNbGregister_new_node_with_optimizer6MpnENode__2_; -text: .text%__1cKBufferBlobMdo_unloading6MpnRBoolObjectClosure_pnKOopClosure_i_v_; -text: .text%__1cKBufferBlobHoops_do6MpnKOopClosure__v_; text: .text%__1cLRegisterMapFclear6M_v_; text: .text%__1cIBoolNodeLbottom_type6kM_pknEType__; text: .text%__1cITypeNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cKRegionNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cLBlock_Array2t6MpnFArena__v_; -text: .text%__1cPSignatureStreamHis_done6kM_i_; -text: .text%__1cNrFlagsRegOperJnum_edges6kM_I_; -text: .text%__1cLPhaseValuesGintcon6Mi_pnIConINode__; text: .text%__1cKStoreINodeGOpcode6kM_i_; -text: .text%__1cLRegisterMap2t6MpnKJavaThread_i_v_; -text: .text%__1cNmethodOopDescPis_empty_method6kM_i_; text: .text%__1cJcmpOpOperJnum_edges6kM_I_; text: .text%__1cNExceptionMark2t6MrpnGThread__v_; text: .text%__1cNExceptionMark2T6M_v_; text: .text%__1cCosMvm_page_size6F_i_; -text: .text%__1cJloadPNodeZcheck_for_anti_dependence6kM_i_; -text: .text%__1cOcompU_rRegNodePoper_input_base6kM_I_; -text: .text%__1cNmethodOopDescLis_accessor6kM_i_; -text: .text%__1cPloadConUL32NodePoper_input_base6kM_I_; text: .text%__1cMPhaseChaitinSget_spillcopy_wide6MpnENode_2I_2_; -text: .text%__1cKI2CAdapterIis_alive6kM_i_; -text: .text%__1cHnmethodHoops_do6MpnKOopClosure__v_; text: .text%__1cIGraphKitJsync_jvms6kM_pnIJVMState__; text: .text%__1cFframebFinterpreter_frame_monitor_begin6kM_pnPBasicObjectLock__; -text: .text%__1cENodeGis_Mem6M_pnHMemNode__; -text: .text%__1cQSystemDictionaryXcheck_signature_loaders6FnMsymbolHandle_nGHandle_2ipnGThread__v_; -text: .text%__1cIGraphKitEstop6M_v_; text: .text%__1cNidealize_test6FpnIPhaseGVN_pnGIfNode__3_: ifnode.o; -text: .text%__1cPloadConUL32NodeHtwo_adr6kM_I_; text: .text%__1cNSafePointNodeLbottom_type6kM_pknEType__; text: .text%__1cPTwoOopHashtableMcompute_hash6MnMsymbolHandle_nGHandle__I_; text: .text%__1cRSignatureIterator2t6MpnNsymbolOopDesc__v_; text: .text%__1cKStorePNodeGOpcode6kM_i_; -text: .text%__1cHMonitorKnotify_all6M_i_; text: .text%__1cFframeVinterpreter_frame_bci6kM_i_; text: .text%__1cHRetNodeNis_block_proj6kM_pknENode__; text: .text%__1cMPhaseChaitinMyank_if_dead6MpnENode_pnFBlock_pnJNode_List_6_i_; text: .text%__1cENodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cFBlockLfind_remove6MpknENode__v_; text: .text%__1cOGenerateOopMapRdo_exception_edge6MpnOBytecodeStream__v_; -text: .text%__1cKOopClosureLdo_nmethods6kM_ki_; -text: .text%__1cGOopMapHset_oop6Miii_v_; text: .text%__1cNSafePointNodeSset_next_exception6Mp0_v_; text: .text%__1cPloadConUL32NodeErule6kM_I_; text: .text%__1cFChunkEchop6M_v_; text: .text%__1cMciMethodDataJnext_data6MpnLProfileData__2_; text: .text%__1cJStoreNodeLbottom_type6kM_pknEType__; -text: .text%__1cPciObjectFactorySget_unloaded_klass6MpnHciKlass_pnIciSymbol_i_2_; text: .text%__1cLBlock_StackXmost_frequent_successor6MpnFBlock__I_; text: .text%__1cFBlockScall_catch_cleanup6MrnLBlock_Array__v_; -text: .text%__1cFBlockOschedule_local6MrnHMatcher_rnLBlock_Array_pirnJVectorSet_rnNGrowableArray4CI___i_; text: .text%__1cXPhaseAggressiveCoalesceIcoalesce6MpnFBlock__v_; text: .text%__1cOGenerateOopMapFppop16MnNCellTypeState__v_; text: .text%__1cKstorePNodePoper_input_base6kM_I_; -text: .text%__1cMPhaseIterGVNFwiden6kMpknEType_3_3_; -text: .text%__1cKRegionNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cNmethodOopDescRis_not_compilable6kMi_i_; -text: .text%__1cLis_cond_add6FpnIPhaseGVN_pnHPhiNode__pnENode__; text: .text%__1cPsplit_flow_path6FpnIPhaseGVN_pnHPhiNode__pnENode__: cfgnode.o; text: .text%__1cKRegionNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cGTarjanELINK6Mp01_v_; -text: .text%__1cKTypeRawPtrKadd_offset6kMi_pknHTypePtr__; -text: .text%__1cWMutableSpaceUsedHelperLtake_sample6M_x_; -text: .text%__1cIBoolNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cIsplit_if6FpnGIfNode_pnMPhaseIterGVN__pnENode__: ifnode.o; -text: .text%__1cTremove_useless_bool6FpnGIfNode_pnIPhaseGVN__pnENode__: ifnode.o; text: .text%__1cMPhaseChaitinNFind_compress6MpknENode__I_; text: .text%__1cRInterpreterOopMapKinitialize6M_v_; text: .text%__1cJTypeTupleEmake6FIppknEType__pk0_; -text: .text%__1cYCallStaticJavaDirectNodeHtwo_adr6kM_I_; text: .text%__1cKDictionaryJget_entry6MiInMsymbolHandle_nGHandle__pnPDictionaryEntry__; text: .text%__1cLLShiftINodeGOpcode6kM_i_; text: .text%__1cQResultTypeFinderDset6MinJBasicType__v_; -text: .text%__1cHnmethodMdo_unloading6MpnRBoolObjectClosure_pnKOopClosure_i_v_; text: .text%__1cNmethodOopDescLresult_type6kM_nJBasicType__; text: .text%__1cIMachOperOindex_position6kM_i_; -text: .text%__1cKReflectionTverify_field_access6FpnMklassOopDesc_22nLAccessFlags_ii_i_; text: .text%__1cOemit_d32_reloc6FrnKCodeBuffer_irknQRelocationHolder_i_v_; text: .text%__1cLjmpConUNodePoper_input_base6kM_I_; text: .text%__1cHAddNodeEhash6kM_I_; -text: .text%__1cNtestP_regNodePoper_input_base6kM_I_; -text: .text%__1cHSubNodeGis_Sub6M_p0_; text: .text%__1cPcheckCastPPNodePoper_input_base6kM_I_; text: .text%__1cIRootNodeGOpcode6kM_i_; text: .text%__1cFframebDinterpreter_frame_monitor_end6kM_pnPBasicObjectLock__; @@ -900,20 +570,14 @@ text: .text%__1cRInterpreterOopMap2T6M_v_; text: .text%__1cRInterpreterOopMapNresource_copy6MpnQOopMapCacheEntry__v_; text: .text%__1cLOopMapCacheGlookup6MnMmethodHandle_ipnRInterpreterOopMap__v_; text: .text%__1cRInterpreterOopMap2t6M_v_; -text: .text%__1cFframeToops_interpreted_do6MpnKOopClosure_pknLRegisterMap_i_v_; text: .text%__1cSInterpreterRuntimeLcache_entry6FpnKJavaThread__pnWConstantPoolCacheEntry__; text: .text%__1cOindOffset8OperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cOJNIHandleBlockHoops_do6MpnKOopClosure__v_; text: .text%__1cKstorePNodeMideal_Opcode6kM_i_; text: .text%__1cFChunkJnext_chop6M_v_; text: .text%__1cENode2t6Mp0111_v_; -text: .text%__1cITypeLongEmake6Fx_pk0_; -text: .text%__1cLjmpConUNodeGpinned6kM_i_; text: .text%__1cPciObjectFactoryNfind_non_perm6MpnHoopDesc__rpn0ANNonPermObject__; text: .text%__1cHCmpNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cKTypeRawPtrJsingleton6kM_i_; -text: .text%__1cNGCTaskManagerNresource_flag6MI_i_; -text: .text%__1cNGCTaskManagerYshould_release_resources6MI_i_; text: .text%__1cIAddINodeLbottom_type6kM_pknEType__; text: .text%__1cNloadRangeNodeErule6kM_I_; text: .text%__1cNrFlagsRegOperKin_RegMask6kMi_pknHRegMask__; @@ -923,9 +587,7 @@ text: .text%__1cYciExceptionHandlerStreamEnext6M_v_; text: .text%__1cOBasicHashtableJnew_entry6MI_pnTBasicHashtableEntry__; text: .text%__1cJHashtableJnew_entry6MIpnHoopDesc__pnOHashtableEntry__; text: .text%__1cSCountedLoopEndNodeGOpcode6kM_i_; -text: .text%__1cTOopMapForCacheEntryRpossible_gc_point6MpnOBytecodeStream__i_; text: .text%__1cKstoreINodePoper_input_base6kM_I_; -text: .text%__1cNtestP_regNodeHtwo_adr6kM_I_; text: .text%__1cCosVcurrent_stack_pointer6F_pC_; text: .text%__1cMMergeMemNodePiteration_setup6Mpk0_v_; text: .text%__1cRMachSafePointNodeKin_RegMask6kMI_rknHRegMask__; @@ -933,13 +595,8 @@ text: .text%__1cJStoreNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cMMergeMemNodeJmemory_at6kMI_pnENode__; text: .text%__1cJloadSNodeErule6kM_I_; text: .text%__1cLLShiftLNodeLbottom_type6kM_pknEType__; -text: .text%__1cMBasicAdapterHoops_do6MpnKOopClosure__v_; -text: .text%__1cKjmpConNodeJnum_opnds6kM_I_; -text: .text%__1cLOptoRuntimeOnew_objArray_C6FpnMklassOopDesc_ipnKJavaThread__v_; text: .text%__1cTconstantPoolOopDescSklass_at_if_loaded6FnSconstantPoolHandle_i_pnMklassOopDesc__; -text: .text%__1cFciEnvXget_klass_by_index_impl6MpnPciInstanceKlass_iri_pnHciKlass__; text: .text%__1cKjmpDirNodeHsize_of6kM_I_; -text: .text%__1cJloadPNodeJnum_opnds6kM_I_; text: .text%__1cJCProjNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cJMultiNodeFmatch6MpknIProjNode_pknHMatcher__pnENode__; text: .text%__1cHOopFlowNcompute_reach6MpnNPhaseRegAlloc_ipnEDict__v_; @@ -952,127 +609,88 @@ text: .text%__1cLGCTaskQdDueueHenqueue6MpnGGCTask__v_; text: .text%__1cNGCTaskManagerWincrement_busy_workers6M_I_; text: .text%__1cLGCTaskQdDueueHdequeue6M_pnGGCTask__; text: .text%__1cNGCTaskManagerPnote_completion6MI_v_; -text: .text%__1cHMatcherXadjust_outgoing_stk_arg6Miiri_i_; text: .text%__1cTCreateExceptionNodeMideal_Opcode6kM_i_; text: .text%__1cKIfTrueNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cXvirtual_call_RelocationLunpack_data6M_v_; -text: .text%__1cMBasicAdapterMdo_unloading6MpnRBoolObjectClosure_pnKOopClosure_i_v_; text: .text%__1cXindIndexScaleOffsetOperJnum_edges6kM_I_; text: .text%__1cLRShiftINodeGOpcode6kM_i_; -text: .text%__1cJStoreNodeIis_Store6kM_pk0_; text: .text%Unsafe_CompareAndSwapLong; text: .text%__1cNinstanceKlassRprotection_domain6M_pnHoopDesc__; text: .text%__1cNtestI_regNodeMideal_Opcode6kM_i_; text: .text%__1cTAbstractInterpreterLmethod_kind6FnMmethodHandle__n0AKMethodKind__; text: .text%__1cJStoreNodeEhash6kM_I_; -text: .text%__1cOcompI_rRegNodePoper_input_base6kM_I_; text: .text%__1cKmethodOperGmethod6kM_l_; -text: .text%__1cHTypeAryRary_must_be_exact6kM_i_; text: .text%__1cKstoreINodeMideal_Opcode6kM_i_; text: .text%__1cGGCTask2t6M_v_; -text: .text%__1cOcompU_rRegNodeHtwo_adr6kM_I_; text: .text%__1cNSafePointNodeOnext_exception6kM_p0_; text: .text%__1cOindOffset8OperNbase_position6kM_i_; text: .text%__1cOindOffset8OperNconstant_disp6kM_i_; -text: .text%__1cKjmpDirNodeHis_Goto6kM_I_; text: .text%__1cENodeHset_req6MIp0_v_; text: .text%__1cTconstantPoolOopDescNklass_name_at6Mi_pnNsymbolOopDesc__; -text: .text%__1cSObjectSynchronizerKfast_enter6FnGHandle_pnJBasicLock_pnGThread__v_; text: .text%__1cSObjectSynchronizerJfast_exit6FpnHoopDesc_pnJBasicLock_pnGThread__v_; text: .text%__1cWShouldNotReachHereNodePoper_input_base6kM_I_; -text: .text%__1cMMergeMemNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cGThreadLis_in_stack6kMpC_i_; text: .text%__1cLIfFalseNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cKJavaThreadNis_lock_owned6kMpC_i_; text: .text%__1cXAdaptiveWeightedAverageYcompute_adaptive_average6Mff_f_; text: .text%__1cOcompU_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cJloadPNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cTconvI2L_reg_regNodeMideal_Opcode6kM_i_; text: .text%__1cSPSPromotionManagerbBgc_thread_promotion_manager6Fi_p0_; -text: .text%__1cNmethodOopDescMintrinsic_id6kM_nMvmIntrinsicsCID__; -text: .text%__1cKstorePNodeJnum_opnds6kM_I_; text: .text%__1cQinstanceRefKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cQinstanceRefKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cMMergeMemNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cLciSignatureLreturn_type6kM_pnGciType__; -text: .text%__1cMMergeMemNodeQclone_all_memory6FpnENode__p0_; text: .text%__1cIGraphKitJclone_map6M_pnNSafePointNode__; text: .text%__1cLMachNopNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cJchar2type6Fc_nJBasicType__; text: .text%__1cJFieldTypeKbasic_type6FpnNsymbolOopDesc__nJBasicType__; text: .text%__1cKRelocationLspec_simple6FnJrelocInfoJrelocType__nQRelocationHolder__; -text: .text%__1cICallNodeLis_CallLeaf6kM_pknMCallLeafNode__; -text: .text%__1cLrecord_bias6FpknIPhaseIFG_ii_v_: coalesce.o; text: .text%__1cJrRegPOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cMObjectLocker2t6MnGHandle_pnGThread__v_; text: .text%__1cMObjectLocker2T6M_v_; text: .text%__1cNloadRangeNodeMideal_Opcode6kM_i_; -text: .text%__1cRMachSafePointNodeRis_safepoint_node6kM_i_; -text: .text%__1cHTypeIntFempty6kM_i_; text: .text%__1cRInvocationCounterJset_state6Mn0AFState__v_; text: .text%__1cRInvocationCounterFreset6M_v_; -text: .text%__1cKTypeOopPtrWmake_from_klass_common6FpnHciKlass_ii_pk0_; text: .text%__1cRInvocationCounterEinit6M_v_; text: .text%__1cNSafePointNodeEjvms6kM_pnIJVMState__; text: .text%__1cNSignatureInfoJdo_object6Mii_v_; -text: .text%__1cLPhaseValuesFwiden6kMpknEType_3_3_; text: .text%__1cTconstantPoolOopDescRname_ref_index_at6Mi_i_; text: .text%__1cIHaltNodeLbottom_type6kM_pknEType__; -text: .text%__1cRRawBytecodeStreamMset_interval6Mii_v_; -text: .text%__1cNtestI_regNodeHtwo_adr6kM_I_; text: .text%__1cSsafePoint_pollNodeMideal_Opcode6kM_i_; -text: .text%__1cLOopRecorderOallocate_index6MpnI_jobject__i_; -text: .text%__1cYDebugInformationRecorderNappend_handle6MpnI_jobject__i_; text: .text%__1cYCallStaticJavaDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cYCallStaticJavaDirectNodeSalignment_required6kM_i_; text: .text%__1cMloadConPNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cGPcDescHreal_pc6kMpknHnmethod__pC_; text: .text%__1cKRegionNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cOPhaseIdealLoopIsplit_up6MpnENode_22_i_; -text: .text%__1cWConstantPoolCacheEntryRset_initial_state6Mi_v_; text: .text%__1cKNativeCallGverify6M_v_; text: .text%__1cNCompileBrokerLmaybe_block6F_v_; text: .text%__1cFPhase2t6Mn0ALPhaseNumber__v_; text: .text%__1cJloadINodeMideal_Opcode6kM_i_; text: .text%__1cNLoadKlassNodeGOpcode6kM_i_; text: .text%__1cIBoolNodeKmatch_edge6kMI_I_; -text: .text%__1cITypeLongEmake6Fxx_pk0_; -text: .text%__1cKRegionNodeOis_block_start6kM_i_; text: .text%__1cCosGmalloc6FL_pv_; text: .text%__1cXAdaptiveWeightedAverageGsample6Mf_v_; text: .text%__1cFStateM_sub_Op_RegP6MpknENode__v_; text: .text%__1cPcheckCastPPNodeHtwo_adr6kM_I_; -text: .text%__1cRMachNullCheckNodeQis_MachNullCheck6M_p0_; text: .text%__1cOGenerateOopMapGppush16MnNCellTypeState__v_; text: .text%__1cGBitMapOset_difference6M0_v_; text: .text%__1cMvalue_of_loc6FppnHoopDesc__l_; text: .text%__1cRmethodDataOopDescTbytecode_cell_count6FnJBytecodesECode__i_; text: .text%__1cRmethodDataOopDescRcompute_data_size6FpnOBytecodeStream__i_; text: .text%__1cRmethodDataOopDescPinitialize_data6MpnOBytecodeStream_i_i_; -text: .text%__1cOcompI_rRegNodeHtwo_adr6kM_I_; text: .text%__1cLSymbolTableJbasic_add6MipCiIpnGThread__pnNsymbolOopDesc__; text: .text%__1cLsymbolKlassPallocate_symbol6MpCipnGThread__pnNsymbolOopDesc__; text: .text%__1cNGrowableArray4CpnKciTypeFlowFBlock__2t6MpnFArena_iirk2_v_; -text: .text%__1cLPhaseValuesHlongcon6Mx_pnIConLNode__; text: .text%__1cKDictionaryEfind6MiInMsymbolHandle_nGHandle_2pnGThread__pnMklassOopDesc__; text: .text%__1cOcompI_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cKTypeAryPtrFxmeet6kMpknEType__3_; -text: .text%__1cMPhaseChaitinJsplit_USE6MpnENode_pnFBlock_2IIiinNGrowableArray4CI__i_I_; -text: .text%__1cNCatchProjNodeMis_CatchProj6kM_pk0_; text: .text%__1cOcompU_rRegNodeMcisc_operand6kM_i_; text: .text%__1cNSafePointNodeGOpcode6kM_i_; -text: .text%__1cTconvI2L_reg_regNodePoper_input_base6kM_I_; text: .text%__1cMTypeKlassPtrEhash6kM_i_; -text: .text%__1cMLinkResolverOresolve_method6FrnMmethodHandle_nLKlassHandle_nMsymbolHandle_43ipnGThread__v_; text: .text%__1cMLinkResolverYlookup_method_in_klasses6FrnMmethodHandle_nLKlassHandle_nMsymbolHandle_4pnGThread__v_; text: .text%__1cMciMethodDataLbci_to_data6Mi_pnLProfileData__; text: .text%JVM_GetCPMethodSignatureUTF; text: .text%__1cPfieldDescriptorKinitialize6MpnMklassOopDesc_i_v_; -text: .text%__1cIciMethodbCinterpreter_invocation_count6M_i_; text: .text%__1cMMergeMemNodeNset_memory_at6MIpnENode__v_; text: .text%JVM_CurrentThread; -text: .text%__1cPClassFileParserbLparse_constant_pool_nameandtype_entry6MnSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cKstoreINodeJnum_opnds6kM_I_; text: .text%__1cHTypeAryEhash6kM_i_; text: .text%JVM_GetClassModifiers; text: .text%JVM_GetClassAccessFlags; @@ -1088,38 +706,24 @@ text: .text%__1cParrayKlassKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cParrayKlassKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cMrax_RegPOperEtype6kM_pknEType__; text: .text%__1cKTypeRawPtrEhash6kM_i_; -text: .text%__1cLmethodKlassNoop_is_method6kM_i_; text: .text%__1cXindIndexScaleOffsetOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cPSignatureStreamJis_object6kM_i_; text: .text%__1cVCompressedWriteStream2t6Mi_v_; text: .text%__1cENode2t6Mp01_v_; text: .text%__1cHAddNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cJStartNodeIis_Start6M_p0_; text: .text%__1cMURShiftINodeGOpcode6kM_i_; -text: .text%__1cNGrowableArray4CpnMMonitorValue__2t6Mii_v_; -text: .text%__1cYDebugInformationRecorderOdescribe_scope6MpnIciMethod_ipnKDebugToken_44_v_; text: .text%__1cYDebugInformationRecorderVcreate_monitor_values6MpnNGrowableArray4CpnMMonitorValue____pnKDebugToken__; text: .text%__1cYDebugInformationRecorderYserialize_monitor_values6MpnNGrowableArray4CpnMMonitorValue____i_; text: .text%__1cMloadConINodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIMachNodeIadr_type6kM_pknHTypePtr__; -text: .text%__1cKReflectionTverify_class_access6FpnMklassOopDesc_2i_i_; text: .text%__1cOMethodLivenessKBasicBlockWcompute_gen_kill_range6MpnQciBytecodeStream__v_; text: .text%__1cJAssemblerJemit_data6MirknQRelocationHolder_i_v_; text: .text%__1cIMachOperMdisp_as_type6kM_pknHTypePtr__; -text: .text%__1cKCompiledICWis_in_transition_state6kM_i_; -text: .text%__1cRInlineCacheBufferIcontains6FpC_i_; text: .text%__1cOcompU_rRegNodeErule6kM_I_; text: .text%__1cRMemBarReleaseNodeGOpcode6kM_i_; text: .text%__1cKRelocationEtype6M_nJrelocInfoJrelocType__; text: .text%__1cETypeOget_const_type6FpnGciType__pk0_; text: .text%__1cMPhaseChaitinPset_was_spilled6MpnENode__v_; -text: .text%__1cXvirtual_call_RelocationIparse_ic6FrpnICodeBlob_rpC5rppnHoopDesc_pi_nNRelocIterator__; -text: .text%__1cLCounterDataOis_CounterData6M_i_; -text: .text%__1cRCompilationPolicyNcanBeCompiled6FnMmethodHandle__i_; -text: .text%__1cOcompU_rRegNodeJnum_opnds6kM_I_; text: .text%__1cKcmpOpUOperJnum_edges6kM_I_; -text: .text%__1cOrFlagsRegUOperJnum_edges6kM_I_; -text: .text%__1cKCastPPNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cIGraphKitMsaved_ex_oop6FpnNSafePointNode__pnENode__; text: .text%__1cMtlsLoadPNodeErule6kM_I_; text: .text%__1cIGraphKitGmemory6MI_pnENode__; @@ -1129,45 +733,22 @@ text: .text%__1cOGenerateOopMapFppush6MpnNCellTypeState__v_; text: .text%__1cSobjArrayKlassKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cSobjArrayKlassKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cQciBytecodeStreamPget_field_index6M_i_; -text: .text%__1cGThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cKHandleAreaHoops_do6MpnKOopClosure__v_; -text: .text%__1cNchunk_oops_do6FpnKOopClosure_pnFChunk_pc_L_: handles.o; text: .text%__1cKCompiledIC2t6MpnKRelocation__v_; -text: .text%__1cMUniverseOperFclone6kM_pnIMachOper__; -text: .text%__1cJlabelOperFclone6kM_pnIMachOper__; text: .text%__1cRaddI_rReg_immNodeMideal_Opcode6kM_i_; -text: .text%__1cLPhaseValuesHmakecon6MpknEType__pnHConNode__; text: .text%__1cENodeHins_req6MIp0_v_; text: .text%__1cIGraphKitLclean_stack6Mi_v_; text: .text%__1cKRegionNodeHhas_phi6kM_pnHPhiNode__; text: .text%__1cNloadRangeNodePoper_input_base6kM_I_; -text: .text%__1cOMachReturnNodeNis_MachReturn6M_p0_; -text: .text%__1cNaddI_rRegNodePoper_input_base6kM_I_; -text: .text%__1cQPreserveJVMState2t6MpnIGraphKit_i_v_; -text: .text%__1cNtestP_regNodeMcisc_operand6kM_i_; -text: .text%__1cKjmpConNodeHtwo_adr6kM_I_; -text: .text%__1cPClassFileParserbJparse_constant_pool_methodref_entry6MnSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cFKlassNoop_is_symbol6kM_i_; -text: .text%__1cWConstantPoolCacheEntryLis_resolved6kMnJBytecodesECode__i_; text: .text%__1cWConstantPoolCacheEntryPbytecode_number6FnJBytecodesECode__i_; -text: .text%__1cMPhaseChaitinVmay_be_copy_of_callee6kMpnENode__i_; text: .text%__1cNtestP_regNodeErule6kM_I_; -text: .text%__1cUThreadSafepointStateXexamine_state_of_thread6Mi_v_; -text: .text%__1cUSafepointSynchronizeOsafepoint_safe6FpnKJavaThread_nPJavaThreadState__i_; text: .text%__1cFStateM_sub_Op_ConI6MpknENode__v_; text: .text%__1cUArgumentSizeComputerDset6MinJBasicType__v_; -text: .text%__1cOcompU_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cHPhiNodeEmake6FpnENode_2pknEType_pknHTypePtr__p0_; -text: .text%__1cKCodeBufferOadd_stub_reloc6MpCrknQRelocationHolder_i_v_; -text: .text%__1cKCodeBufferOalloc_relocate6M_pnORelocateBuffer__; text: .text%__1cNtestI_regNodeErule6kM_I_; text: .text%__1cOGenerateOopMapbAget_basic_block_containing6kMi_pnKBasicBlock__; -text: .text%__1cFParseKensure_phi6Mii_pnHPhiNode__; text: .text%__1cMLinkResolverZcheck_klass_accessability6FnLKlassHandle_1pnGThread__v_; text: .text%__1cOGenerateOopMapSget_basic_block_at6kMi_pnKBasicBlock__; -text: .text%__1cHAddress2t6MpCnJrelocInfoJrelocType__v_; -text: .text%__1cFciEnvSget_klass_by_index6MpnPciInstanceKlass_iri_pnHciKlass__; -text: .text%__1cKJavaThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cFStateM_sub_Op_AddP6MpknENode__v_; text: .text%__1cICallNodeFmatch6MpknIProjNode_pknHMatcher__pnENode__; text: .text%__1cOcompI_rRegNodeMcisc_operand6kM_i_; @@ -1178,53 +759,24 @@ text: .text%__1cLMachNopNodeMideal_Opcode6kM_i_; text: .text%__1cKJNIHandlesKmake_local6FpnHoopDesc__pnI_jobject__; text: .text%__1cITypeFuncEhash6kM_i_; text: .text%__1cOcompI_rRegNodeErule6kM_I_; -text: .text%__1cIciMethodPliveness_at_bci6Mi_nGBitMap__; -text: .text%__1cOMethodLivenessPget_liveness_at6Mi_nGBitMap__; -text: .text%__1cOMethodLivenessKBasicBlockPget_liveness_at6MpnIciMethod_i_nGBitMap__; -text: .text%__1cITypeLongFempty6kM_i_; -text: .text%__1cMTypeKlassPtrCeq6kMpknEType__i_; text: .text%__1cJAssemblerJemit_data6MinJrelocInfoJrelocType_i_v_; text: .text%__1cJLoadSNodeGOpcode6kM_i_; text: .text%__1cRMemBarAcquireNodeGOpcode6kM_i_; -text: .text%__1cIGraphKitObasic_plus_adr6MpnENode_2l_2_; text: .text%__1cJVectorSet2L6MI_rnDSet__; text: .text%__1cJVectorSetEgrow6MI_v_; -text: .text%__1cLCastP2LNodeGOpcode6kM_i_; -text: .text%__1cFKlassNlookup_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; -text: .text%__1cJAssemblerEcall6MpCnJrelocInfoJrelocType__v_; text: .text%__1cPcheckCastPPNodeMideal_Opcode6kM_i_; text: .text%__1cJLoadLNodeGOpcode6kM_i_; text: .text%__1cMLinkResolverNresolve_klass6FrnLKlassHandle_nSconstantPoolHandle_ipnGThread__v_; text: .text%__1cTconstantPoolOopDescMklass_ref_at6MipnGThread__pnMklassOopDesc__; -text: .text%__1cRCompilationPolicyOmustBeCompiled6FnMmethodHandle__i_; text: .text%__1cIAndINodeGOpcode6kM_i_; -text: .text%__1cKklassKlassMoop_is_klass6kM_i_; -text: .text%__1cUParallelScavengeHeapNtlab_capacity6kM_L_; text: .text%__1cTCreateExceptionNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cIPhaseCCPFwiden6kMpknEType_3_3_; -text: .text%__1cHTypePtrJsingleton6kM_i_; text: .text%__1cNArgumentCountDset6MinJBasicType__v_; -text: .text%__1cWShouldNotReachHereNodeGpinned6kM_i_; -text: .text%__1cNsubI_rRegNodePoper_input_base6kM_I_; -text: .text%__1cNtestI_regNodePoper_input_base6kM_I_; text: .text%__1cLBoxLockNodeGOpcode6kM_i_; -text: .text%__1cWShouldNotReachHereNodeHtwo_adr6kM_I_; -text: .text%__1cQMachCallJavaNodePis_MachCallJava6M_p0_; text: .text%__1cKStoreBNodeGOpcode6kM_i_; -text: .text%__1cJAssemblerMemit_operand6MpnMRegisterImpl_22nHAddressLScaleFactor_ipCrknQRelocationHolder__v_; -text: .text%__1cJAssemblerMemit_operand6MpnMRegisterImpl_nHAddress__v_; text: .text%__1cOGenerateOopMapHget_var6Mi_nNCellTypeState__; -text: .text%__1cITypeFuncCeq6kMpknEType__i_; -text: .text%__1cMloadConLNodePoper_input_base6kM_I_; -text: .text%__1cMPhaseIterGVNHmakecon6MpknEType__pnHConNode__; text: .text%__1cWShouldNotReachHereNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cHoopDescGverify6M_v_; -text: .text%__1cQconstMethodKlassSoop_is_constMethod6kM_i_; -text: .text%__1cRconstantPoolKlassToop_is_constantPool6kM_i_; -text: .text%__1cOcompP_rRegNodePoper_input_base6kM_I_; text: .text%__1cHTypePtrHget_con6kM_l_; -text: .text%__1cHMatcherWis_short_branch_offset6Mi_i_; -text: .text%__1cMloadConLNodeHtwo_adr6kM_I_; text: .text%__1cMTypeKlassPtr2t6MnHTypePtrDPTR_pnHciKlass_i_v_; text: .text%__1cYCallStaticJavaDirectNodeKmethod_set6Ml_v_; text: .text%__1cWMachCallStaticJavaNodePret_addr_offset6M_i_; @@ -1232,31 +784,20 @@ text: .text%__1cYCallStaticJavaDirectNodePcompute_padding6kMi_i_; text: .text%__1cJVectorSet2t6MpnFArena__v_; text: .text%__1cFStateM_sub_Op_RegI6MpknENode__v_; text: .text%__1cICmpPNodeDsub6kMpknEType_3_3_; -text: .text%__1cNloadConP0NodePoper_input_base6kM_I_; text: .text%__1cOAbstractICachePinvalidate_word6FpC_v_; text: .text%__1cRNativeInstructionFwrote6Mi_v_; text: .text%__1cMURShiftLNodeGOpcode6kM_i_; text: .text%__1cOrFlagsRegUOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cIciMethodLscale_count6Mi_i_; -text: .text%__1cLjmpConUNodeJnum_opnds6kM_I_; text: .text%__1cQciBytecodeStreamQget_method_index6M_i_; text: .text%__1cFciEnvbTget_instance_klass_for_declared_method_holder6FpnHciKlass__pnPciInstanceKlass__; -text: .text%__1cPSignatureStream2t6MnMsymbolHandle_i_v_; text: .text%JVM_GetMethodIxLocalsCount; text: .text%__1cJlabelOperFlabel6kM_pnFLabel__; text: .text%__1cGOopMapJheap_size6kM_i_; text: .text%__1cLOopMapCacheLoop_iterate6MpnKOopClosure__v_; text: .text%__1cMloadConLNodeErule6kM_I_; -text: .text%__1cOMacroAssemblerZneeds_explicit_null_check6Fi_i_; -text: .text%__1cNSafePointNode2t6MIpnIJVMState__v_; text: .text%__1cLas_TosState6FnJBasicType__nITosState__; text: .text%__1cNloadKlassNodeMideal_Opcode6kM_i_; -text: .text%__1cWConstantPoolCacheEntryIas_flags6MnITosState_iiiii_i_; -text: .text%__1cNloadConP0NodeHtwo_adr6kM_I_; text: .text%__1cWThreadLocalAllocBufferVinitialize_statistics6M_v_; -text: .text%__1cWThreadLocalAllocBufferFclear6M_v_; -text: .text%__1cWThreadLocalAllocBufferVaccumulate_statistics6MLi_v_; -text: .text%__1cWThreadLocalAllocBufferImax_size6F_L_; text: .text%__1cWThreadLocalAllocBufferGresize6M_v_; text: .text%__1cJloadINodePoper_input_base6kM_I_; text: .text%__1cIRootNodeLbottom_type6kM_pknEType__; @@ -1264,10 +805,8 @@ text: .text%__1cWConstantPoolCacheEntryGverify6kMpnMoutputStream__v_; text: .text%__1cHCompileYout_preserve_stack_slots6F_I_; text: .text%__1cFParsePload_state_from6Mpn0AFBlock__v_; text: .text%__1cFParseMmerge_common6Mpn0AFBlock_i_v_; -text: .text%__1cNloadRangeNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cIGraphKitQkill_dead_locals6M_v_; text: .text%__1cKMemBarNodeLbottom_type6kM_pknEType__; -text: .text%__1cKimmL32OperJconstantL6kM_x_; text: .text%__1cIciObject2t6MnGHandle__v_; text: .text%__1cITypeFuncEmake6FpknJTypeTuple_3_pk0_; text: .text%__1cLConvI2LNodeFValue6kMpnOPhaseTransform__pknEType__; @@ -1276,30 +815,18 @@ text: .text%__1cRaddP_rReg_immNodePoper_input_base6kM_I_; text: .text%__1cLBoxLockNodeJideal_reg6kM_I_; text: .text%__1cPClassFileParserYverify_legal_method_name6MnMsymbolHandle_pnGThread__v_; text: .text%__1cICHeapObj2n6FL_pv_; -text: .text%__1cFframeUentry_frame_is_first6kM_i_; text: .text%__1cKInlineTreeJcallee_at6kMipnIciMethod__p0_; text: .text%__1cOFastUnlockNodeGOpcode6kM_i_; text: .text%__1cFStateM_sub_Op_ConL6MpknENode__v_; -text: .text%__1cIHaltNodeGpinned6kM_i_; text: .text%__1cMTypeKlassPtrEmake6FnHTypePtrDPTR_pnHciKlass_i_pk0_; text: .text%__1cOoop_RelocationEtype6M_nJrelocInfoJrelocType__; text: .text%__1cOCallRelocationFvalue6M_pC_; -text: .text%__1cKRelocationXpd_set_call_destination6MpCl_v_; -text: .text%__1cOCallRelocationWfix_relocation_at_move6Ml_v_; -text: .text%__1cKRelocationTpd_call_destination6M_pC_; -text: .text%__1cOCallRelocationPset_destination6MpCl_v_; -text: .text%__1cHcommute6FpnENode_ii_i_: addnode.o; -text: .text%__1cENodeHis_Root6M_pnIRootNode__; -text: .text%__1cENodeQlatency_from_use6kMrnLBlock_Array_rnNGrowableArray4CI__pk0p0_i_; -text: .text%__1cHAddNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cNinstanceKlassQfind_local_field6kMpnNsymbolOopDesc_2pnPfieldDescriptor__i_; text: .text%__1cMmerge_region6FpnKRegionNode_pnIPhaseGVN__pnENode__: cfgnode.o; text: .text%__1cNloadConP0NodeErule6kM_I_; text: .text%__1cIGraphKitMreset_memory6M_pnENode__; text: .text%__1cPciObjectFactoryRcreate_new_object6MpnHoopDesc__pnIciObject__; text: .text%__1cNloadRangeNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNloadConI0NodeMideal_Opcode6kM_i_; -text: .text%__1cJloadPNodeHtwo_adr6kM_I_; text: .text%__1cNSignatureInfoGdo_int6M_v_; text: .text%__1cKjmpDirNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cPThreadRootsTaskFdo_it6MpnNGCTaskManager_I_v_; @@ -1311,49 +838,31 @@ text: .text%__1cJrRegLOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cIAddLNodeGOpcode6kM_i_; text: .text%__1cJLoadPNodeJideal_reg6kM_I_; text: .text%__1cNinstanceKlassKfind_field6kMpnNsymbolOopDesc_2pnPfieldDescriptor__pnMklassOopDesc__; -text: .text%__1cOkill_dead_code6FpnENode_pnMPhaseIterGVN__i_: node.o; -text: .text%__1cKjmpDirNodeFclone6kM_pnENode__; -text: .text%__1cOcompI_rRegNodeJnum_opnds6kM_I_; text: .text%__1cFParseFBlockRsuccessor_for_bci6Mi_p1_; text: .text%__1cNGrowableArray4CpnOMethodLivenessKBasicBlock__2t6MpnFArena_iirk2_v_; text: .text%__1cQSystemDictionaryEfind6FnMsymbolHandle_nGHandle_2pnGThread__pnMklassOopDesc__; text: .text%__1cNtestP_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNincI_rRegNodeMideal_Opcode6kM_i_; -text: .text%__1cICallInfoDset6MnLKlassHandle_1nMmethodHandle_2ipnGThread__v_; text: .text%__1cHOrINodeGOpcode6kM_i_; -text: .text%__1cOcompI_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cMPhaseChaitinJsplit_DEF6MpnENode_pnFBlock_iIp25nNGrowableArray4CI__i_I_; -text: .text%__1cENodeHis_Type6M_pnITypeNode__; -text: .text%__1cNSafePointNodeMis_SafePoint6M_p0_; text: .text%__1cICHeapObj2k6Fpv_v_; text: .text%__1cRaddP_rReg_immNodeMideal_Opcode6kM_i_; text: .text%__1cICmpINodeDsub6kMpknEType_3_3_; -text: .text%__1cENode2n6FLi_pv_; -text: .text%__1cJTraceTime2t6MpkcpnMelapsedTimer_iipnMoutputStream__v_; text: .text%__1cIAddINodeGadd_id6kM_pknEType__; text: .text%__1cKStoreCNodeGOpcode6kM_i_; text: .text%__1cTconvI2L_reg_regNodeMcisc_operand6kM_i_; text: .text%__1cHMemNodeQIdeal_DU_postCCP6MpnIPhaseCCP__pnENode__; -text: .text%__1cSvframeStreamCommonPfill_from_frame6M_i_; -text: .text%__1cILoadNodeRraise_bottom_type6MpknEType__v_; -text: .text%__1cJStoreNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cNFingerprinterLfingerprint6M_L_; -text: .text%__1cLConvI2LNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cOGenerateOopMapGppload6MpnNCellTypeState_i_v_; -text: .text%__1cIGraphKitRnull_check_common6MpnENode_nJBasicType_i_2_; text: .text%__1cKBlock_ListGremove6MI_v_; text: .text%__1cKMemoryPoolYrecord_peak_memory_usage6M_v_; text: .text%__1cKciTypeFlowGJsrSetJcopy_into6Mp1_v_; text: .text%__1cICmpLNodeGOpcode6kM_i_; -text: .text%__1cLklassVtableTupdate_super_vtable6MpnNinstanceKlass_pnNmethodOopDesc_i_i_; -text: .text%__1cLcastP2LNodePoper_input_base6kM_I_; -text: .text%__1cQStackFrameStream2t6MpnKJavaThread_i_v_; text: .text%__1cTciConstantPoolCacheEfind6Mi_i_; text: .text%__1cOPhaseIdealLoopGspinup6MpnENode_2222pnLsmall_cache__2_; text: .text%__1cMVirtualSpaceOcommitted_size6kM_L_; text: .text%__1cNGrowableArray4CpnIciObject__Praw_at_put_grow6Mirk14_v_; text: .text%__1cIRootNodeNis_block_proj6kM_pknENode__; -text: .text%__1cHOopFlowEmake6FpnFArena_i_p0_; text: .text%__1cJloadLNodeErule6kM_I_; text: .text%__1cNloadConI0NodeLbottom_type6kM_pknEType__; text: .text%__1cJimmI0OperIconstant6kM_l_; @@ -1362,105 +871,57 @@ text: .text%__1cLBoxLockNodeLbottom_type6kM_pknEType__; text: .text%__1cNaddI_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cOPhaseIdealLoopKhandle_use6MpnENode_2pnLsmall_cache_22222_v_; text: .text%__1cOPhaseIdealLoopOfind_use_block6MpnENode_22222_2_; -text: .text%__1cNmethodOopDescbGupdate_compiled_code_entry_point6Mi_v_; text: .text%__1cJStoreNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cNSignatureInfoHdo_void6M_v_; -text: .text%__1cLAdapterInfoKhash_value6kM_l_; text: .text%JVM_GetCPMethodClassNameUTF; text: .text%__1cHOopFlowFclone6Mp0i_v_; text: .text%__1cRSignatureIteratorSiterate_parameters6ML_v_; -text: .text%__1cILoopNodeHis_Loop6M_p0_; text: .text%__1cPindOffset32OperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cPindOffset32OperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cMCallLeafNodeGOpcode6kM_i_; -text: .text%__1cNmethodOopDescPis_final_method6kM_i_; -text: .text%__1cSComputeAdapterInfoHcompute6Mplii_v_; -text: .text%__1cLAdapterInfoHcompute6MnMmethodHandle_i_v_; -text: .text%__1cLAdapterInfo2T6M_v_; -text: .text%__1cSComputeAdapterInfoLreturn_type6MnJBasicType__i_; -text: .text%__1cSComputeAdapterInfoMsize_in_bits6FnMmethodHandle__i_; -text: .text%__1cMAdapterCacheGlookup6MpnLAdapterInfo__pnMBasicAdapter__; -text: .text%__1cJloadINodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cPadd_derived_oop6FppnHoopDesc_2_v_: oopMap.o; text: .text%__1cTDerivedPointerTableDadd6FppnHoopDesc_3_v_; text: .text%__1cFParseFBlockJinit_node6Mp0i_v_; text: .text%__1cFParseFBlockKinit_graph6Mp0_v_; -text: .text%__1cOcompP_rRegNodeHtwo_adr6kM_I_; text: .text%__1cSObjectSynchronizerKslow_enter6FnGHandle_pnJBasicLock_pnGThread__v_; text: .text%__1cKjmpDirNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cMLinkResolverbFlinktime_resolve_virtual_method6FrnMmethodHandle_nLKlassHandle_nMsymbolHandle_43ipnGThread__v_; -text: .text%__1cKJavaThreadOis_Java_thread6kM_i_; -text: .text%__1cKCastPPNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cJTraceTime2T6M_v_; -text: .text%__1cKciTypeFlowNmake_range_at6Mi_pn0AFRange__; text: .text%__1cNmethodOopDescbAcompute_size_of_parameters6MpnGThread__v_; -text: .text%__1cKoopFactoryKnew_method6FinLAccessFlags_iiipnGThread__pnNmethodOopDesc__; -text: .text%__1cNmethodOopDescLobject_size6Fi_i_; text: .text%__1cSconstMethodOopDescLobject_size6Fiiii_i_; -text: .text%__1cLklassVtableWneeds_new_vtable_entry6FpnNmethodOopDesc_pnMklassOopDesc_pnHoopDesc_pnNsymbolOopDesc_nLAccessFlags__i_; text: .text%__1cSconstMethodOopDescZset_inlined_tables_length6Miii_v_; text: .text%__1cLmethodKlassIallocate6MnRconstMethodHandle_nLAccessFlags_pnGThread__pnNmethodOopDesc__; -text: .text%__1cQconstMethodKlassIallocate6MiiiipnGThread__pnSconstMethodOopDesc__; -text: .text%__1cNmethodOopDescJinit_code6M_v_; -text: .text%__1cKoopFactoryPnew_constMethod6FiiiipnGThread__pnSconstMethodOopDesc__; -text: .text%__1cPClassFileParserMparse_method6MnSconstantPoolHandle_ipnLAccessFlags_pnPtypeArrayHandle_55pnGThread__nMmethodHandle__; -text: .text%__1cFBlockUhoist_LCA_above_defs6Mp01IrnLBlock_Array__1_; -text: .text%__1cScompI_rReg_immNodeHtwo_adr6kM_I_; text: .text%__1cPciInstanceKlassLfield_cache6M_pnTciConstantPoolCache__; -text: .text%__1cHciFieldJwill_link6MpnPciInstanceKlass_nJBytecodesECode__i_; text: .text%__1cFciEnvXget_field_by_index_impl6MpnPciInstanceKlass_i_pnHciField__; -text: .text%__1cQciBytecodeStreamJget_field6Mri_pnHciField__; text: .text%__1cFciEnvSget_field_by_index6MpnPciInstanceKlass_i_pnHciField__; -text: .text%__1cKTypeOopPtrFempty6kM_i_; text: .text%__1cWConstantPoolCacheEntryOset_bytecode_16MnJBytecodesECode__v_; -text: .text%__1cKCastPPNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cMMergeMemNodeNgrow_to_match6Mpk0_v_; -text: .text%__1cFKlassPoop_is_objArray6kM_i_; text: .text%__1cTCreateExceptionNodePoper_input_base6kM_I_; text: .text%__1cPciInstanceKlassYunique_concrete_subklass6M_p0_; text: .text%__1cLStringTableGlookup6MipHiI_pnHoopDesc__; text: .text%__1cLBoxLockNodeHsize_of6kM_I_; -text: .text%__1cIciObjectIencoding6M_pnI_jobject__; -text: .text%__1cPClassFileParserbDverify_legal_method_modifiers6MiinMsymbolHandle_pnGThread__v_; text: .text%__1cIPhaseGVNUtransform_no_reclaim6MpnENode__2_; -text: .text%__1cIRewriterOrewrite_method6FnMmethodHandle_rnIintArray_pnGThread__1_; -text: .text%__1cNmethodOopDescLlink_method6FnMmethodHandle__v_; text: .text%__1cNloadKlassNodePoper_input_base6kM_I_; text: .text%__1cNObjectMonitorEexit6MpnGThread__v_; -text: .text%__1cPClassFileParserZskip_over_field_signature6MpciIpnGThread__1_; text: .text%__1cMMergeMemNode2t6MpnENode__v_; text: .text%__1cMMergeMemNodeRmake_empty_memory6F_pnENode__; -text: .text%__1cNinstanceKlassVshould_be_initialized6kM_i_; -text: .text%__1cNtestP_regNodeJnum_opnds6kM_I_; -text: .text%__1cJStartNodeGis_CFG6kM_i_; -text: .text%__1cRaddI_rReg_immNodePoper_input_base6kM_I_; -text: .text%__1cPVirtualCallDataSis_VirtualCallData6M_i_; text: .text%__1cMindIndexOperJnum_edges6kM_I_; text: .text%__1cRInterpretedRFrameKtop_method6kM_nMmethodHandle__; -text: .text%__1cKGCStatInfoMset_gc_usage6MinLMemoryUsage_i_v_; text: .text%__1cXmembar_acquire_lockNodeLbottom_type6kM_pknEType__; text: .text%__1cQPreserveJVMState2T6M_v_; -text: .text%__1cLRuntimeStubIis_alive6kM_i_; -text: .text%__1cMWarmCallInfoHis_cold6kM_i_; text: .text%__1cNObjectMonitorFenter6MpnGThread__v_; text: .text%__1cKjmpConNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cIemit_d646FrnKCodeBuffer_l_v_; text: .text%__1cFParseFmerge6Mi_v_; text: .text%__1cOPhaseIdealLoopIset_idom6MpnENode_2I_v_; -text: .text%__1cIAddINodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cFParseMdo_one_block6M_v_; text: .text%__1cFParseFBlockMrecord_state6Mp0_v_; -text: .text%__1cNtestP_regNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cNCollectedHeapYpermanent_array_allocate6FnLKlassHandle_iipnGThread__pnHoopDesc__; -text: .text%__1cJloadLNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cIPhaseIFGFUnion6MII_v_; -text: .text%__1cNloadRangeNodeJnum_opnds6kM_I_; text: .text%__1cWConstantPoolCacheEntryOset_bytecode_26MnJBytecodesECode__v_; text: .text%__1cOcompP_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cIBoolNodeJideal_reg6kM_I_; text: .text%__1cHCmpNodeJideal_reg6kM_I_; text: .text%__1cFStateM_sub_Op_Bool6MpknENode__v_; -text: .text%__1cJCatchNodeIis_Catch6kM_pk0_; text: .text%__1cJLoadBNodeGOpcode6kM_i_; text: .text%__1cENodeHlatency6MI_I_; text: .text%__1cIGraphKit2t6MpnIJVMState__v_; @@ -1468,67 +929,42 @@ text: .text%__1cKTypeAryPtrFklass6kM_pnHciKlass__; text: .text%__1cTciConstantPoolCacheDget6Mi_pv_; text: .text%__1cNmethodOopDescIbcp_from6kMi_pC_; text: .text%__1cKTypeOopPtrHget_con6kM_l_; -text: .text%__1cMPhaseChaitinKprompt_use6MpnFBlock_I_i_; text: .text%__1cIJVMStateLdebug_depth6kM_I_; -text: .text%__1cIGraphKitTadd_safepoint_edges6MpnNSafePointNode_i_v_; text: .text%__1cENodeNadd_req_batch6Mp0I_v_; -text: .text%__1cIJVMStateKclone_deep6kM_p0_; text: .text%__1cFStateK_sub_Op_If6MpknENode__v_; text: .text%__1cXindIndexScaleOffsetOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cXindIndexScaleOffsetOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_; -text: .text%__1cGBitMapVset_union_with_result6M0_i_; -text: .text%__1cNSafePointNodeEhash6kM_I_; text: .text%__1cMelapsedTimerFstart6M_v_; text: .text%__1cJStartNodeGOpcode6kM_i_; text: .text%__1cMelapsedTimerEstop6M_v_; text: .text%__1cOPhaseIdealLoopQconditional_move6MpnENode__2_; text: .text%__1cJloadLNodeMideal_Opcode6kM_i_; text: .text%__1cOMethodLivenessKBasicBlockJstore_one6Mi_v_; -text: .text%__1cTC2IAdapterGeneratorXlazy_std_verified_entry6FnMmethodHandle__pC_; -text: .text%__1cPindOffset32OperJnum_edges6kM_I_; text: .text%__1cPFieldAccessInfoDset6MnLKlassHandle_nMsymbolHandle_iinJBasicType_nLAccessFlags__v_; -text: .text%__1cMLinkResolverNresolve_field6FrnPFieldAccessInfo_nSconstantPoolHandle_inJBytecodesECode_iipnGThread__v_; text: .text%__1cMLinkResolverZcheck_field_accessability6FnLKlassHandle_11rnPfieldDescriptor_pnGThread__v_; text: .text%__1cNsubI_rRegNodeMideal_Opcode6kM_i_; -text: .text%__1cTCreateExceptionNodeHtwo_adr6kM_I_; text: .text%__1cPindOffset32OperFscale6kM_i_; text: .text%__1cHAddNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cICmpPNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cbFCompressedLineNumberWriteStream2t6Mi_v_; -text: .text%__1cPClassFileParserWparse_linenumber_table6MIIpipnGThread__pC_; text: .text%__1cSconstMethodOopDescbBcompressed_linenumber_table6kM_pC_; text: .text%__1cHTypePtrLdual_offset6kM_i_; text: .text%__1cNMachIdealNodePoper_input_base6kM_I_; text: .text%__1cSObjectSynchronizerOinflate_helper6FpnHoopDesc__pnNObjectMonitor__; text: .text%__1cKciTypeFlowIblock_at6Mipn0AGJsrSet_n0AMCreateOption__pn0AFBlock__; -text: .text%__1cKciTypeFlowFRangeNget_block_for6Mpn0AGJsrSet_n0AMCreateOption__pn0AFBlock__; -text: .text%__1cSvframeStreamCommonbBfill_from_interpreter_frame6M_v_; -text: .text%__1cHMonitorEwait6Mil_i_; -text: .text%__1cLcastP2LNodeMideal_Opcode6kM_i_; -text: .text%__1cNloadKlassNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cSObjectSynchronizerJslow_exit6FpnHoopDesc_pnJBasicLock_pnGThread__v_; text: .text%__1cPJavaCallWrapperHoops_do6MpnKOopClosure__v_; text: .text%__1cFframeNoops_entry_do6MpnKOopClosure_pknLRegisterMap__v_; text: .text%__1cXindIndexScaleOffsetOperFscale6kM_i_; -text: .text%__1cQciBytecodeStreamKget_method6Mri_pnIciMethod__; -text: .text%__1cFciEnvTget_method_by_index6MpnPciInstanceKlass_inJBytecodesECode__pnIciMethod__; -text: .text%__1cFciEnvYget_method_by_index_impl6MpnPciInstanceKlass_inJBytecodesECode__pnIciMethod__; text: .text%__1cFciEnvNlookup_method6MpnNinstanceKlass_2pnNsymbolOopDesc_4nJBytecodesECode__pnNmethodOopDesc__; text: .text%__1cYinternal_word_RelocationLunpack_data6M_v_; text: .text%__1cNstoreImmBNodePoper_input_base6kM_I_; text: .text%__1cNLoadRangeNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cITypeFuncEmake6FpnIciMethod__pk0_; -text: .text%__1cMindirectOperJnum_edges6kM_I_; text: .text%__1cKCompiledICOic_destination6kM_pC_; text: .text%__1cTconvI2L_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cICmpUNodeDsub6kMpknEType_3_3_; text: .text%__1cPSignatureStreamJas_symbol6MpnGThread__pnNsymbolOopDesc__; text: .text%__1cRshrL_rReg_immNodeMideal_Opcode6kM_i_; text: .text%__1cIGraphKitRcreate_and_map_if6MpnENode_2ff_pnGIfNode__; -text: .text%__1cPClassFileParserbFparse_constant_pool_class_entry6MnSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cOMethodLivenessKBasicBlockMmerge_normal6MnGBitMap__i_; -text: .text%__1cTleaPIdxScaleOffNodeHtwo_adr6kM_I_; -text: .text%__1cETypeFwiden6kMpk0_2_; text: .text%__1cKciTypeFlowLStateVector2t6Mp0_v_; text: .text%__1cNCatchProjNodeLbottom_type6kM_pknEType__; text: .text%__1cOcompU_rRegNodeLout_RegMask6kM_rknHRegMask__; @@ -1536,40 +972,26 @@ text: .text%__1cNCatchProjNodeHsize_of6kM_I_; text: .text%__1cNCatchProjNodeEhash6kM_I_; text: .text%__1cSvframeStreamCommonEnext6M_v_; text: .text%__1cFKlassIsubklass6kM_p0_; -text: .text%__1cKciTypeFlowFBlockPis_simpler_than6Mp1_i_; text: .text%__1cJimmI8OperIconstant6kM_l_; -text: .text%__1cIAddPNodeQmach_bottom_type6FpknIMachNode__pknEType__; text: .text%__1cILoadNodeHsize_of6kM_I_; -text: .text%__1cHMatcherVReduceInst_Chain_Rule6MpnFState_ipnIMachNode_rpnENode__v_; text: .text%__1cURethrowExceptionNodeNis_block_proj6kM_pknENode__; -text: .text%__1cNincI_rRegNodePoper_input_base6kM_I_; -text: .text%__1cLjmpConUNodeHtwo_adr6kM_I_; -text: .text%__1cHMatcherScalling_convention6FpnLOptoRegPair_Ii_v_; text: .text%__1cKPerfStringKset_string6Mpkc_v_; text: .text%__1cENodeLnonnull_req6kM_p0_; -text: .text%__1cICmpINodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cHTypeAryCeq6kMpknEType__i_; text: .text%__1cQSystemDictionaryKfind_class6FiInMsymbolHandle_nGHandle__pnMklassOopDesc__; text: .text%__1cKDictionaryKfind_class6MiInMsymbolHandle_nGHandle__pnMklassOopDesc__; text: .text%__1cQUnique_Node_ListEpush6MpnENode__v_; text: .text%__1cILoopNodeGOpcode6kM_i_; text: .text%__1cIGraphKitTadd_exception_state6MpnNSafePointNode__v_; text: .text%__1cJloadPNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cICallNodeSis_CallInterpreter6kM_pknTCallInterpreterNode__; text: .text%__1cOPhaseIdealLoopRregister_new_node6MpnENode_2_v_; text: .text%__1cQPSGenerationPoolImax_size6kM_L_; text: .text%__1cQPSGenerationPoolNused_in_bytes6M_L_; text: .text%__1cQPSGenerationPoolQget_memory_usage6M_nLMemoryUsage__; text: .text%__1cOMethodLivenessNwork_list_get6M_pn0AKBasicBlock__; text: .text%__1cNinstanceKlassKmethods_do6MpFpnNmethodOopDesc__v_v_; -text: .text%__1cICallNodeOis_CallRuntime6kM_pknPCallRuntimeNode__; text: .text%__1cHTypeAryFxmeet6kMpknEType__3_; text: .text%__1cNstoreImmBNodeMideal_Opcode6kM_i_; -text: .text%__1cKciTypeFlowLStateVectorEmeet6Mpk1_i_; -text: .text%__1cIMachNodeTmay_be_short_branch6kM_i_; -text: .text%__1cJloadINodeJnum_opnds6kM_I_; text: .text%__1cNaddI_rRegNodeMcisc_operand6kM_i_; -text: .text%__1cRMachSafePointNode2t6M_v_; text: .text%__1cHMatcherKmatch_sfpt6MpnNSafePointNode__pnIMachNode__; text: .text%__1cOcompP_rRegNodeMcisc_operand6kM_i_; text: .text%__1cMPhaseChaitinKFind_const6kMpknENode__I_; @@ -1591,62 +1013,41 @@ text: .text%__1cKciTypeFlowLStateVectorOpush_translate6MpnGciType__v_; text: .text%__1cOGenerateOopMapJdo_method6Miiii_v_; text: .text%__1cMloadConPNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIimmPOperIconstant6kM_l_; -text: .text%__1cIimmPOperPconstant_is_oop6kM_i_; -text: .text%__1cOleaPIdxOffNodeHtwo_adr6kM_I_; text: .text%__1cHGCCauseJto_string6Fn0AFCause__pkc_; text: .text%__1cTleaPIdxScaleOffNodeErule6kM_I_; text: .text%JVM_IsNaN; -text: .text%__1cXinsert_anti_dependences6FrpnFBlock_pnENode_rnLBlock_Array__i_: gcm.o; -text: .text%__1cLOptoRuntimebCcomplete_monitor_unlocking_C6FpnHoopDesc_pnJBasicLock__v_; text: .text%__1cJloadINodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cLOptoRuntimebAcomplete_monitor_locking_C6FpnHoopDesc_pnJBasicLock_pnKJavaThread__v_; -text: .text%__1cHCompileKTracePhase2t6MpkcpnMelapsedTimer_i_v_; text: .text%__1cHCompileKTracePhase2T6M_v_; text: .text%__1cOGenerateOopMapTmerge_state_into_bb6MpnKBasicBlock__v_; text: .text%__1cHMatcherPc_frame_pointer6kM_i_; text: .text%__1cFBlockKsched_call6MrnHMatcher_rnLBlock_Array_IrnJNode_List_pipnMMachCallNode_rnJVectorSet__I_; -text: .text%__1cMMachCallNode2t6M_v_; text: .text%__1cICallNodeJideal_reg6kM_I_; text: .text%__1cOleaPIdxOffNodeErule6kM_I_; text: .text%__1cOGenerateOopMapEppop6MpnNCellTypeState__v_; text: .text%__1cSCallLeafDirectNodeMideal_Opcode6kM_i_; text: .text%__1cOcompP_rRegNodeErule6kM_I_; -text: .text%__1cMany_RegPOperJnum_edges6kM_I_; -text: .text%__1cIGraphKitbLset_predefined_input_for_runtime_call6MpnNSafePointNode__v_; text: .text%__1cMany_RegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cScompI_rReg_immNodeErule6kM_I_; text: .text%__1cLBoxLockNodeKin_RegMask6kMI_rknHRegMask__; text: .text%__1cIGraphKitOset_all_memory6MpnENode__v_; text: .text%__1cLRegisterMap2t6Mpk0_v_; text: .text%__1cGvframe2t6MpknFframe_pknLRegisterMap_pnKJavaThread__v_; -text: .text%__1cNmethodOopDescWwas_executed_more_than6kMi_i_; text: .text%__1cKstoreCNodePoper_input_base6kM_I_; text: .text%__1cVjava_lang_ClassLoaderbBnon_reflection_class_loader6FpnHoopDesc__2_; text: .text%__1cHi2sNodeErule6kM_I_; text: .text%__1cIMulLNodeGOpcode6kM_i_; -text: .text%__1cOPhaseIdealLoopHdom_lca6kMpnENode_2_2_; -text: .text%__1cMPrefetchNodeGOpcode6kM_i_; -text: .text%__1cSReferenceProcessorSdiscover_reference6MpnHoopDesc_nNReferenceType__i_; -text: .text%__1cSReferenceProcessorTget_discovered_list6MnNReferenceType__ppnHoopDesc__; -text: .text%__1cXjava_lang_ref_ReferenceIset_next6FpnHoopDesc_2_v_; text: .text%__1cKciTypeFlowGJsrSet2t6MpnFArena_i_v_; -text: .text%__1cNtestI_regNodeJnum_opnds6kM_I_; text: .text%__1cIAddINodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cIMachOperNconstant_disp6kM_i_; text: .text%__1cIMachOperFscale6kM_i_; -text: .text%__1cFframeNis_java_frame6kM_i_; text: .text%__1cOMethodLivenessKBasicBlockJpropagate6Mp0_v_; text: .text%__1cQSystemDictionaryStry_get_next_class6F_pnMklassOopDesc__; text: .text%__1cKDictionaryStry_get_next_class6M_pnMklassOopDesc__; text: .text%__1cNloadKlassNodeErule6kM_I_; -text: .text%__1cIciMethodRhas_compiled_code6M_i_; -text: .text%__1cOoop_RelocationJpack_data6M_i_; text: .text%__1cKCompiledICKcached_oop6kM_pnHoopDesc__; text: .text%__1cGOopMap2t6Mii_v_; text: .text%__1cJOopMapSetKadd_gc_map6MipnGOopMap__v_; text: .text%__1cNincI_rRegNodeErule6kM_I_; -text: .text%__1cRMachSafePointNodePis_MachCallLeaf6M_pnQMachCallLeafNode__; -text: .text%__1cRMachSafePointNodeLset_oop_map6MpnGOopMap__v_; text: .text%__1cYDebugInformationRecorderNadd_safepoint6MipnGOopMap__v_; text: .text%__1cHCompileTProcess_OopMap_Node6MpnIMachNode_i_v_; text: .text%__1cYDebugInformationRecorderKadd_oopmap6MipnGOopMap__v_; @@ -1660,44 +1061,24 @@ text: .text%__1cHRetNodeMideal_Opcode6kM_i_; text: .text%__1cGvframeKnew_vframe6FpknFframe_pknLRegisterMap_pnKJavaThread__p0_; text: .text%__1cNsubI_rRegNodeErule6kM_I_; text: .text%__1cRaddP_rReg_immNodeErule6kM_I_; -text: .text%__1cPClassFileParserbGparse_constant_pool_string_entry6MnSconstantPoolHandle_ipnGThread__v_; text: .text%__1cJloadLNodePoper_input_base6kM_I_; -text: .text%__1cRshrL_rReg_immNodePoper_input_base6kM_I_; text: .text%__1cITypeLongFxdual6kM_pknEType__; -text: .text%__1cRMachSafePointNodeSis_MachCallRuntime6M_pnTMachCallRuntimeNode__; -text: .text%__1cNaddI_rRegNodeJnum_opnds6kM_I_; text: .text%__1cENodeJset_req_X6MIp0pnMPhaseIterGVN__v_; -text: .text%__1cOcompP_rRegNodeJnum_opnds6kM_I_; text: .text%__1cSInterpreterRuntimePresolve_get_put6FpnKJavaThread_nJBytecodesECode__v_; -text: .text%__1cMLinkResolverNresolve_field6FrnPFieldAccessInfo_nSconstantPoolHandle_inJBytecodesECode_ipnGThread__v_; -text: .text%__1cWConstantPoolCacheEntryJset_field6MnJBytecodesECode_2nLKlassHandle_iinITosState_ii_v_; text: .text%__1cIAndLNodeGOpcode6kM_i_; text: .text%__1cMindIndexOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cOtypeArrayKlassSallocate_permanent6MipnGThread__pnQtypeArrayOopDesc__; text: .text%__1cOGenerateOopMapCpp6MpnNCellTypeState_2_v_; -text: .text%__1cMCallJavaNodeLis_CallJava6kM_pk0_; -text: .text%__1cICallNodeScalling_convention6kMpnLOptoRegPair_I_v_; text: .text%__1cHCompileSflatten_alias_type6kMpknHTypePtr__3_; -text: .text%__1cRcmpFastUnlockNodePoper_input_base6kM_I_; text: .text%__1cYCallStaticJavaDirectNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cOcompP_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cFStateW_sub_Op_CallStaticJava6MpknENode__v_; -text: .text%__1cWMachCallStaticJavaNodeVis_MachCallStaticJava6M_p0_; -text: .text%__1cRaddP_rReg_immNodeJnum_opnds6kM_I_; -text: .text%__1cICallInfoDset6MnLKlassHandle_nMmethodHandle_pnGThread__v_; -text: .text%__1cSComputeAdapterInfoJdo_object6Mii_v_; -text: .text%__1cRMachSafePointNodeWis_MachCallInterpreter6M_pnXMachCallInterpreterNode__; text: .text%__1cIGraphKitbDtransfer_exceptions_into_jvms6M_pnIJVMState__; text: .text%__1cLConvL2INodeGOpcode6kM_i_; text: .text%__1cOcompI_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQSystemDictionarybEresolve_instance_class_or_null6FnMsymbolHandle_nGHandle_2pnGThread__pnMklassOopDesc__; text: .text%__1cNaddI_rRegNodeErule6kM_I_; -text: .text%__1cHConNodeEmake6FpknEType__p0_; -text: .text%__1cScompI_rReg_immNodePoper_input_base6kM_I_; -text: .text%__1cJLoadCNodeGOpcode6kM_i_; text: .text%__1cYCallStaticJavaDirectNodeFreloc6kM_i_; text: .text%__1cRcmpFastUnlockNodeMideal_Opcode6kM_i_; -text: .text%__1cJTraceTime2t6MpkciipnMoutputStream__v_; text: .text%__1cWstatic_stub_RelocationEtype6M_nJrelocInfoJrelocType__; text: .text%__1cIGraphKitQset_saved_ex_oop6FpnNSafePointNode_pnENode__v_; text: .text%__1cIGraphKitUmake_exception_state6MpnENode__pnNSafePointNode__; @@ -1705,33 +1086,16 @@ text: .text%__1cJloadBNodeMideal_Opcode6kM_i_; text: .text%__1cMLinkResolverOresolve_invoke6FrnICallInfo_nGHandle_nSconstantPoolHandle_inJBytecodesECode_pnGThread__v_; text: .text%__1cMLinkResolverMresolve_pool6FrnLKlassHandle_rnMsymbolHandle_42nSconstantPoolHandle_ipnGThread__v_; text: .text%__1cGOopMapHcopy_to6MpC_v_; -text: .text%__1cNstoreImmBNodeJnum_opnds6kM_I_; text: .text%__1cVLoaderConstraintTableWfind_loader_constraint6MnMsymbolHandle_nGHandle__ppnVLoaderConstraintEntry__; -text: .text%__1cJTimeStampJupdate_to6Mx_v_; text: .text%__1cJTimeStampGupdate6M_v_; text: .text%__1cFframeZinterpreter_frame_set_bcx6Ml_v_; -text: .text%__1cCosFsleep6FpnGThread_xi_i_; -text: .text%__1cNgetTimeMillis6F_x_; -text: .text%__1cRaddP_rReg_immNodeLbottom_type6kM_pknEType__; -text: .text%__1cIos_sleep6Fxi_i_: os_solaris.o; -text: .text%__1cLPhaseValuesHzerocon6MnJBasicType__pnHConNode__; text: .text%__1cMCreateExNodeKmatch_edge6kMI_I_; -text: .text%__1cTconvI2L_reg_regNodeJnum_opnds6kM_I_; -text: .text%__1cIGraphKitNuncommon_trap6MipnHciKlass_pkci_v_; -text: .text%__1cILoadNodeEmake6FpnENode_22pknHTypePtr_pknEType_nJBasicType__p0_; -text: .text%__1cIGraphKitJmake_load6MpnENode_2pknEType_nJBasicType_i_2_; -text: .text%__1cTconvI2L_reg_regNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cTno_rax_rbx_RegPOperJnum_edges6kM_I_; text: .text%__1cLPCTableNodeLbottom_type6kM_pknEType__; text: .text%__1cLOptoRuntimeSuncommon_trap_Type6F_pknITypeFunc__; text: .text%__1cIHaltNode2t6MpnENode_2_v_; text: .text%__1cNSafePointNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cNaddI_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cGPcDesc2t6Mii_v_; -text: .text%__1cHnmethodKcopy_pc_at6MipnGPcDesc__v_; text: .text%__1cKciTypeFlowLStateVectorJcopy_into6kMp1_v_; text: .text%__1cXmembar_release_lockNodeMideal_Opcode6kM_i_; -text: .text%__1cOcompL_rRegNodePoper_input_base6kM_I_; text: .text%__1cMoutputStreamPupdate_position6MpkcL_v_; text: .text%__1cMstringStreamFwrite6MpkcL_v_; text: .text%__1cKciTypeFlowQadd_to_work_list6Mpn0AFBlock__v_; @@ -1741,87 +1105,57 @@ text: .text%__1cKciTypeFlowOwork_list_next6M_pn0AFBlock__; text: .text%__1cIPipelineXfunctional_unit_latency6kMIpk0_I_; text: .text%__1cMPhaseIterGVNJtransform6MpnENode__2_; text: .text%__1cQSystemDictionarybCfind_instance_or_array_klass6FnMsymbolHandle_nGHandle_2pnGThread__pnMklassOopDesc__; -text: .text%__1cSCompareAndSwapNodeGis_CFG6kM_i_; -text: .text%__1cNGrowableArray4CpnOMethodLivenessKBasicBlock__Icontains6kMrk2_i_; -text: .text%__1cKciTypeFlowFBlock2t6Mp0pn0AFRange_pn0AGJsrSet__v_; text: .text%__1cNGrowableArray4CpnKciTypeFlowJJsrRecord__2t6MpnFArena_iirk2_v_; -text: .text%__1cKstoreCNodeJnum_opnds6kM_I_; text: .text%__1cNmodI_rRegNodeErule6kM_I_; -text: .text%__1cKInlineTreeWfind_subtree_from_root6Fp0pnIJVMState_pnIciMethod_i_1_; text: .text%__1cNGrowableArray4CpnPciInstanceKlass__2t6MpnFArena_iirk1_v_; text: .text%__1cKciTypeFlowFBlockScompute_exceptions6M_v_; text: .text%__1cYciExceptionHandlerStreamFcount6M_i_; text: .text%__1cINodeHashJhash_find6MpknENode__p1_; -text: .text%__1cFParsePdo_field_access6Mii_v_; text: .text%__1cPThreadLocalNodeLbottom_type6kM_pknEType__; -text: .text%__1cOMethodLivenessNmake_block_at6Mipn0AKBasicBlock__2_; -text: .text%__1cKstorePNodeHtwo_adr6kM_I_; text: .text%__1cKciTypeFlowPflow_successors6MpnNGrowableArray4Cpn0AFBlock___pn0ALStateVector__v_; -text: .text%__1cGciTypeMis_classless6kM_i_; text: .text%__1cRsalI_rReg_immNodeMideal_Opcode6kM_i_; text: .text%__1cJloadFNodeErule6kM_I_; -text: .text%__1cKBranchDataNis_BranchData6M_i_; -text: .text%__1cIJumpDataLis_JumpData6M_i_; text: .text%__1cSMemBarCPUOrderNodeGOpcode6kM_i_; text: .text%__1cLklassVtableNput_method_at6MpnNmethodOopDesc_i_v_; text: .text%__1cHi2sNodeMideal_Opcode6kM_i_; text: .text%__1cKstoreCNodeMideal_Opcode6kM_i_; text: .text%__1cRshrI_rReg_immNodeMideal_Opcode6kM_i_; text: .text%__1cNloadConI0NodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNloadKlassNodeJnum_opnds6kM_I_; text: .text%__1cHCompileKalias_type6MpnHciField__pn0AJAliasType__; text: .text%__1cLStringTableGintern6FnGHandle_pHipnGThread__pnHoopDesc__; text: .text%__1cLStringTableLhash_string6FpHi_i_; -text: .text%__1cMCreateExNodeGpinned6kM_i_; -text: .text%__1cFciEnvWget_klass_by_name_impl6MpnHciKlass_pnIciSymbol_i_2_; text: .text%__1cNloadKlassNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRScavengeRootsTaskEname6M_pc_; text: .text%__1cRScavengeRootsTaskFdo_it6MpnNGCTaskManager_I_v_; -text: .text%__1cNtestP_regNodeQuse_cisc_RegMask6M_v_; -text: .text%__1cKstoreINodeHtwo_adr6kM_I_; text: .text%__1cSInterpreterRuntimeOresolve_invoke6FpnKJavaThread_nJBytecodesECode__v_; text: .text%__1cPCountedLoopNodeGOpcode6kM_i_; -text: .text%__1cHTypeIntEmake6Fii_pk0_; -text: .text%__1cRcmpFastUnlockNodeHtwo_adr6kM_I_; text: .text%__1cJloadSNodeMideal_Opcode6kM_i_; -text: .text%__1cPDictionaryEntrybAcontains_protection_domain6kMpnHoopDesc__i_; text: .text%__1cIregFOperEtype6kM_pknEType__; text: .text%__1cLLShiftLNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%JVM_GetCPMethodNameUTF; -text: .text%__1cMLinkResolverbNlinktime_resolve_virtual_method_or_null6FnLKlassHandle_nMsymbolHandle_21i_nMmethodHandle__; -text: .text%__1cNsubI_rRegNodeJnum_opnds6kM_I_; text: .text%__1cLTypeInstPtrFxdual6kM_pknEType__; -text: .text%__1cNsubI_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cIGraphKitOreplace_in_map6MpnENode_2_v_; text: .text%__1cMPhaseChaitinLclone_projs6MpnFBlock_IpnENode_4rI_i_; text: .text%__1cTconstantPoolOopDescbCverify_constant_pool_resolve6FnSconstantPoolHandle_nLKlassHandle_pnGThread__v_; -text: .text%__1cLcastP2LNodeJnum_opnds6kM_I_; text: .text%__1cOMethodLivenessNwork_list_add6Mpn0AKBasicBlock__v_; text: .text%__1cFParseFBlockNlocal_type_at6kMi_pknEType__; text: .text%__1cWConstantPoolCacheEntryKset_method6MnJBytecodesECode_nMmethodHandle_i_v_; text: .text%__1cHTypeIntFxdual6kM_pknEType__; text: .text%__1cEUTF8Hstrrchr6FpWiW_1_; text: .text%__1cQConstantIntValueIwrite_on6MpnUDebugInfoWriteStream__v_; -text: .text%__1cQSystemDictionaryPresolve_or_fail6FnMsymbolHandle_nGHandle_2ipnGThread__pnMklassOopDesc__; text: .text%__1cNLoadKlassNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cHCompileZintrinsic_insertion_index6MpnIciMethod_i_i_; -text: .text%__1cIciObjectSis_obj_array_klass6M_i_; text: .text%__1cJVectorSetFClear6M_v_; text: .text%__1cMMergeMemNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKMemoryPoolHoops_do6MpnKOopClosure__v_; text: .text%__1cICodeHeapSallocated_capacity6kM_L_; -text: .text%__1cICodeBlobRis_at_poll_return6MpC_i_; text: .text%__1cIMachOperEtype6kM_pknEType__; text: .text%__1cLjmpConUNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cQSystemDictionarybOfind_constrained_instance_or_array_klass6FnMsymbolHandle_nGHandle_pnGThread__pnMklassOopDesc__; text: .text%__1cNCallGenerator2t6MpnIciMethod__v_; -text: .text%__1cSHighResTimeSamplerLtake_sample6M_x_; -text: .text%__1cRis_error_reported6F_i_; text: .text%__1cLStatSamplerLsample_data6FpnMPerfDataList__v_; text: .text%__1cPStatSamplerTaskEtask6M_v_; text: .text%__1cMPeriodicTaskMtime_to_wait6F_L_; text: .text%__1cMPeriodicTaskOreal_time_tick6FL_v_; -text: .text%__1cNWatcherThreadRis_Watcher_thread6kM_i_; text: .text%__1cLStatSamplerOcollect_sample6F_v_; text: .text%__1cJloadBNodePoper_input_base6kM_I_; text: .text%__1cMVM_OperationPevaluation_mode6kM_n0AEMode__; @@ -1829,98 +1163,62 @@ text: .text%__1cIGraphKit2t6M_v_; text: .text%__1cOemit_d64_reloc6FrnKCodeBuffer_lnJrelocInfoJrelocType_i_v_; text: .text%__1cNinstanceKlassKlink_class6MpnGThread__v_; text: .text%__1cIGraphKitNset_map_clone6MpnNSafePointNode__v_; -text: .text%__1cRRawBytecodeStream2t6MnMmethodHandle__v_; text: .text%__1cENodeHget_ptr6kM_l_; text: .text%__1cFStateM_sub_Op_ConP6MpknENode__v_; text: .text%__1cJloadPNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cKI2CAdapterOis_i2c_adapter6kM_i_; text: .text%__1cOcompU_rRegNodeQuse_cisc_RegMask6M_v_; text: .text%__1cNinstanceKlassPinitialize_impl6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cQciBytecodeStreamWget_field_holder_index6M_i_; text: .text%__1cQciBytecodeStreamZget_declared_field_holder6M_pnPciInstanceKlass__; text: .text%__1cRinterpretedVFrameGmethod6kM_pnNmethodOopDesc__; -text: .text%__1cMorI_rRegNodePoper_input_base6kM_I_; -text: .text%__1cIciSymbol2t6MnMsymbolHandle__v_; -text: .text%__1cFParseRensure_memory_phi6Mii_pnHPhiNode__; text: .text%__1cNdecI_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cJLoadINodeJideal_reg6kM_I_; -text: .text%__1cKRelocationWfix_relocation_at_move6Ml_v_; text: .text%__1cPindOffset32OperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cHAddNodePadd_of_identity6kMpknEType_3_3_; text: .text%__1cMFastLockNodeGOpcode6kM_i_; -text: .text%__1cScompU_rReg_immNodeHtwo_adr6kM_I_; -text: .text%__1cHCompilebAallow_range_check_smearing6kM_i_; text: .text%__1cLBuildCutout2T6M_v_; text: .text%__1cLBuildCutout2t6MpnIGraphKit_pnENode_ff_v_; text: .text%__1cTconstantPoolOopDescOstring_at_impl6FnSconstantPoolHandle_ipnGThread__pnHoopDesc__; -text: .text%__1cQjava_lang_StringQbasic_create_oop6FpnQtypeArrayOopDesc_ipnGThread__pnHoopDesc__; text: .text%__1cICodeHeapIcapacity6kM_L_; text: .text%__1cKMemoryPoolImax_size6kM_L_; text: .text%__1cMCodeHeapPoolQget_memory_usage6M_nLMemoryUsage__; text: .text%__1cMCodeHeapPoolNused_in_bytes6M_L_; -text: .text%__1cMPhaseChaitinTsplit_Rematerialize6MpnENode_pnFBlock_IrInNGrowableArray4CI__ipIp2i_2_; text: .text%__1cJcmpOpOperFccode6kM_i_; -text: .text%__1cKjmpDirNodeTmay_be_short_branch6kM_i_; -text: .text%__1cKjmpDirNodeOis_pc_relative6kM_i_; text: .text%__1cPClassFileParserXverify_legal_field_name6MnMsymbolHandle_pnGThread__v_; text: .text%__1cPClassFileParserbCverify_legal_field_signature6MnMsymbolHandle_1pnGThread__v_; text: .text%__1cEUTF8Enext6FpkcpH_pc_; text: .text%__1cOcompL_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cbAPSEvacuateFollowersClosureHdo_void6M_v_; -text: .text%__1cFParseKdo_get_xxx6MpknHTypePtr_pnENode_pnHciField_i_v_; -text: .text%__1cTInlineCallGeneratorJis_inline6kM_i_; text: .text%__1cHMulNodeEhash6kM_I_; text: .text%__1cGRFrame2t6MnFframe_pnKJavaThread_p0_v_; -text: .text%__1cTconvI2L_reg_regNodeHtwo_adr6kM_I_; text: .text%__1cOGenerateOopMapLbb_mark_fct6Fp0ipi_v_; text: .text%__1cScompU_rReg_immNodeMideal_Opcode6kM_i_; text: .text%__1cNFingerprinterJdo_object6Mii_v_; -text: .text%__1cMloadConFNodePoper_input_base6kM_I_; -text: .text%__1cOGenerateOopMapTmerge_state_vectors6MpnNCellTypeState_2_i_; -text: .text%__1cMloadConFNodeHtwo_adr6kM_I_; -text: .text%__1cICallNodeSis_CallDynamicJava6kM_pknTCallDynamicJavaNode__; -text: .text%__1cRcmpFastUnlockNodeJnum_opnds6kM_I_; text: .text%__1cEUTF8Sconvert_to_unicode6FpkcpHi_v_; -text: .text%__1cUParallelScavengeHeapMmem_allocate6MLii_pnIHeapWord__; text: .text%__1cNinstanceKlassbBallocate_permanent_instance6MpnGThread__pnPinstanceOopDesc__; text: .text%__1cKjmpConNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cOMethodLivenessKBasicBlockQcompute_gen_kill6MpnIciMethod__v_; text: .text%__1cOMethodLivenessKBasicBlock2t6Mp0ii_v_; text: .text%__1cMloadConFNodeErule6kM_I_; -text: .text%__1cLcastP2LNodeHtwo_adr6kM_I_; text: .text%__1cIMachOperIconstant6kM_l_; -text: .text%__1cJloadSNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cPcheckCastPPNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cMTypeKlassPtrKadd_offset6kMi_pknHTypePtr__; text: .text%__1cUEdenMutableSpacePoolQget_memory_usage6M_nLMemoryUsage__; text: .text%__1cYSurvivorMutableSpacePoolQget_memory_usage6M_nLMemoryUsage__; text: .text%__1cYSurvivorMutableSpacePoolImax_size6kM_L_; text: .text%__1cUEdenMutableSpacePoolNused_in_bytes6M_L_; text: .text%__1cUEdenMutableSpacePoolImax_size6kM_L_; text: .text%__1cYSurvivorMutableSpacePoolNused_in_bytes6M_L_; -text: .text%__1cKjmpConNodeTmay_be_short_branch6kM_i_; -text: .text%__1cKjmpConNodeOis_pc_relative6kM_i_; text: .text%__1cHConNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cKCodeBufferKend_a_stub6M_v_; text: .text%__1cTemit_java_to_interp6FrnKCodeBuffer__v_; -text: .text%__1cKCodeBufferMstart_a_stub6M_v_; -text: .text%__1cFParseUprofile_taken_branch6Mi_v_; text: .text%__1cKciTypeFlowGJsrSetNapply_control6Mp0pnQciBytecodeStream_pn0ALStateVector__v_; -text: .text%__1cKReturnNodeGis_CFG6kM_i_; text: .text%__1cRSignatureIteratorSskip_optional_size6M_v_; text: .text%__1cRaddI_rReg_immNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cHTypeIntFwiden6kMpknEType__3_; text: .text%__1cTCompareAndSwapLNodeGOpcode6kM_i_; -text: .text%__1cNmethodOopDescbHhas_unloaded_classes_in_signature6FnMmethodHandle_pnGThread__i_; -text: .text%__1cIciObjectRis_instance_klass6M_i_; text: .text%__1cOGenerateOopMapRsigchar_to_effect6McipnNCellTypeState__2_; text: .text%__1cOGenerateOopMapIdo_field6Miiii_v_; text: .text%__1cPloadConUL32NodeMideal_Opcode6kM_i_; text: .text%__1cEUTF8Ounicode_length6Fpkci_i_; text: .text%__1cIciMethodRget_flow_analysis6M_pnKciTypeFlow__; -text: .text%__1cICodeBlobLoop_addr_at6kMi_ppnHoopDesc__; -text: .text%__1cNloadRangeNodeHtwo_adr6kM_I_; -text: .text%__1cJloadLNodeJnum_opnds6kM_I_; text: .text%__1cSmembar_acquireNodeMideal_Opcode6kM_i_; text: .text%__1cSObjectSynchronizerXidentity_hash_value_for6FnGHandle__l_; text: .text%__1cHoopDescSslow_identity_hash6M_l_; @@ -1928,38 +1226,23 @@ text: .text%__1cKMemBarNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cOGenerateOopMapLmerge_state6Fp0ipi_v_; text: .text%__1cIMachNodeOpipeline_class6F_pknIPipeline__; text: .text%__1cIMachNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cJloadCNodeErule6kM_I_; -text: .text%__1cKOSRAdapterIis_alive6kM_i_; -text: .text%__1cQjava_lang_StringMbasic_create6FpnQtypeArrayOopDesc_ipnGThread__nGHandle__; text: .text%__1cRMachNullCheckNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cGThreadXclear_pending_exception6M_v_; text: .text%__1cXindIndexScaleOffsetOperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_; -text: .text%__1cOcompL_rRegNodeHtwo_adr6kM_I_; text: .text%__1cTconstantPoolOopDescbBbasic_type_for_signature_at6Mi_nJBasicType__; text: .text%__1cETypeRget_typeflow_type6FpnGciType__pk0_; text: .text%__1cLStringTableGintern6FpnNsymbolOopDesc_pnGThread__pnHoopDesc__; text: .text%__1cNsymbolOopDescKas_unicode6kMri_pH_; -text: .text%__1cKciTypeFlowLStateVectorJdo_invoke6MpnQciBytecodeStream_i_v_; text: .text%__1cKstorePNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cKReturnNodeKmatch_edge6kMI_I_; -text: .text%__1cKRegionNodeJideal_reg6kM_I_; -text: .text%__1cJloadINodeHtwo_adr6kM_I_; -text: .text%__1cQmark_inner_loops6FpnIPhaseCFG_pnFBlock__v_: block.o; text: .text%__1cIHaltNodeJideal_reg6kM_I_; text: .text%__1cFStateM_sub_Op_Halt6MpknENode__v_; text: .text%__1cWShouldNotReachHereNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKReturnNodeGOpcode6kM_i_; text: .text%__1cJTypeTupleKmake_range6FpnLciSignature__pk0_; text: .text%__1cKStoreLNodeGOpcode6kM_i_; -text: .text%__1cPCountedLoopNodeOis_CountedLoop6M_p0_; text: .text%__1cJTypeTupleLmake_domain6FpnPciInstanceKlass_pnLciSignature__pk0_; -text: .text%__1cPClassFileParserWparse_field_attributes6MnSconstantPoolHandle_iHpHpi2pnPtypeArrayHandle_pnGThread__v_; -text: .text%__1cPClassFileParserbCverify_legal_field_modifiers6MiipnGThread__v_; text: .text%__1cMindirectOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cMindirectOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_; -text: .text%__1cMLinkResolverUresolve_virtual_call6FrnICallInfo_nGHandle_nLKlassHandle_4nMsymbolHandle_54iipnGThread__v_; -text: .text%__1cMLinkResolverbEruntime_resolve_virtual_method6FrnICallInfo_nMmethodHandle_nLKlassHandle_nGHandle_4ipnGThread__v_; -text: .text%__1cFKlassXcan_be_statically_bound6FpnNmethodOopDesc__i_; text: .text%__1cLProfileDataOtranslate_from6Mp0_v_; text: .text%__1cKstorePNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cKstoreINodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -1967,59 +1250,36 @@ text: .text%__1cSPSKeepAliveClosureGdo_oop6MppnHoopDesc__v_; text: .text%__1cNloadConI0NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cTconvI2L_reg_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cMWarmCallInfoKalways_hot6F_p0_; -text: .text%__1cMWarmCallInfoGis_hot6kM_i_; text: .text%__1cNprefetchwNodeMideal_Opcode6kM_i_; text: .text%__1cIAddINodeJideal_reg6kM_I_; -text: .text%__1cNCatchProjNode2t6MpnENode_Ii_v_; -text: .text%__1cENodeHis_Bool6M_pnIBoolNode__; text: .text%__1cLBoxLockNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNmulL_rRegNodePoper_input_base6kM_I_; -text: .text%__1cKciTypeFlowIcan_trap6MrnQciBytecodeStream__i_; -text: .text%__1cQVMOperationQdDueueLqueue_empty6Mi_i_; text: .text%__1cIProjNodeDcmp6kMrknENode__I_; -text: .text%__1cSComputeAdapterInfoGdo_int6M_v_; text: .text%__1cNCatchProjNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%JVM_GetCPFieldSignatureUTF; -text: .text%__1cIGraphKitTtoo_many_recompiles6MnODeoptimizationLDeoptReason__i_; text: .text%__1cHCompileFstart6kM_pnJStartNode__; text: .text%__1cNmulL_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cLPCTableNodeEhash6kM_I_; text: .text%__1cIGraphKitZadd_exception_states_from6MpnIJVMState__v_; -text: .text%__1cJStartNodeOis_block_start6kM_i_; text: .text%__1cQComputeCallStackHdo_void6M_v_; text: .text%__1cNaddI_rRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cIGraphKitOtoo_many_traps6MnODeoptimizationLDeoptReason__i_; -text: .text%__1cNciCallProfileRapply_prof_factor6Mf_v_; text: .text%__1cIciMethodTcall_profile_at_bci6Mi_nNciCallProfile__; -text: .text%__1cHCompileOcall_generator6MpnIciMethod_ipnIJVMState_if_pnNCallGenerator__; -text: .text%__1cHCompileOfind_intrinsic6MpnIciMethod_i_pnNCallGenerator__; text: .text%__1cMindIndexOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cMindIndexOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%jni_GetPrimitiveArrayCritical: jni.o; text: .text%jni_ReleasePrimitiveArrayCritical: jni.o; -text: .text%__1cSInterpreterRuntimeDldc6FpnKJavaThread_i_v_; -text: .text%__1cPClassFileParserbIparse_constant_pool_fieldref_entry6MnSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cNdecI_rRegNodePoper_input_base6kM_I_; -text: .text%__1cFKlassOis_subclass_of6kMpnMklassOopDesc__i_; -text: .text%__1cNGrowableArray4Cl_2t6Mii_v_; -text: .text%__1cNinstanceKlassSlookup_osr_nmethod6kMpnNmethodOopDesc_i_pnHnmethod__; text: .text%__1cIAddINodeIadd_ring6kMpknEType_3_3_; -text: .text%__1cLPCTableNodeKis_PCTable6kM_pk0_; text: .text%__1cLPCTableNodeHsize_of6kM_I_; text: .text%__1cNincI_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKJNIHandlesKmake_local6FpnGThread_pnHoopDesc__pnI_jobject__; text: .text%__1cQciBytecodeStreamXget_method_holder_index6M_i_; text: .text%__1cMorI_rRegNodeMideal_Opcode6kM_i_; -text: .text%__1cLimmUL32OperJconstantL6kM_x_; text: .text%__1cIGraphKitWround_double_arguments6MpnIciMethod__v_; text: .text%__1cFParseHdo_call6M_v_; text: .text%__1cIGraphKitTround_double_result6MpnIciMethod__v_; -text: .text%__1cFParseZcan_not_compile_call_site6MpnIciMethod_pnPciInstanceKlass__i_; text: .text%__1cQciBytecodeStreambAget_declared_method_holder6M_pnHciKlass__; text: .text%__1cFParseMprofile_call6MpnENode__v_; text: .text%__1cScompP_mem_rRegNodePoper_input_base6kM_I_; text: .text%__1cICodeHeapLheader_size6F_L_; -text: .text%__1cJloadBNodeJnum_opnds6kM_I_; text: .text%__1cENodeLbottom_type6kM_pknEType__; text: .text%__1cXindIndexScaleOffsetOperNconstant_disp6kM_i_; text: .text%__1cSindIndexOffsetOperJnum_edges6kM_I_; @@ -2033,11 +1293,9 @@ text: .text%__1cIBoolNodeHsize_of6kM_I_; text: .text%__1cLLShiftINodeLbottom_type6kM_pknEType__; text: .text%jni_DeleteLocalRef: jni.o; text: .text%__1cJloadSNodePoper_input_base6kM_I_; -text: .text%__1cPno_rax_RegPOperJnum_edges6kM_I_; text: .text%__1cOcompI_rRegNodeQuse_cisc_RegMask6M_v_; text: .text%jni_SetIntField: jni.o; text: .text%__1cMURShiftLNodeLbottom_type6kM_pknEType__; -text: .text%__1cMMutableSpaceFclear6M_v_; text: .text%__1cNtestI_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQjava_lang_StringbBcreate_tenured_from_unicode6FpHipnGThread__nGHandle__; text: .text%__1cKoopFactoryXnew_permanent_charArray6FipnGThread__pnQtypeArrayOopDesc__; @@ -2048,46 +1306,26 @@ text: .text%__1cHMulNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cVExceptionHandlerTableJadd_entry6MnRHandlerTableEntry__v_; text: .text%__1cPsalI_rReg_1NodeMideal_Opcode6kM_i_; text: .text%__1cRaddP_rReg_immNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cMLinkResolverbFlinktime_resolve_special_method6FrnMmethodHandle_nLKlassHandle_nMsymbolHandle_43ipnGThread__v_; -text: .text%__1cMLinkResolverUresolve_special_call6FrnICallInfo_nLKlassHandle_nMsymbolHandle_43ipnGThread__v_; -text: .text%__1cMLinkResolverbEruntime_resolve_special_method6FrnICallInfo_nMmethodHandle_nLKlassHandle_4ipnGThread__v_; text: .text%__1cQComputeCallStackJdo_object6Mii_v_; -text: .text%__1cIGraphKitNcast_not_null6MpnENode__2_; text: .text%__1cTconvL2I_reg_regNodeMideal_Opcode6kM_i_; text: .text%__1cKPSYoungGenNused_in_bytes6kM_L_; -text: .text%__1cOCompilerOracleOshould_exclude6FnMmethodHandle__i_; text: .text%__1cOGenerateOopMapHset_var6MinNCellTypeState__v_; -text: .text%__1cPcheckCastPPNodeJnum_opnds6kM_I_; -text: .text%__1cLLShiftLNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cGIfNodeHsize_of6kM_I_; text: .text%__1cPciInstanceKlassFsuper6M_p0_; text: .text%__1cOcompL_rRegNodeMcisc_operand6kM_i_; text: .text%__1cLLShiftINodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cScompI_rReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMMergeMemNodeJideal_reg6kM_I_; -text: .text%__1cNandL_rRegNodePoper_input_base6kM_I_; -text: .text%__1cIciMethodWwas_executed_more_than6Mi_i_; -text: .text%__1cSReferenceProcessorbAprocess_discovered_reflist6MppnHoopDesc_pnPReferencePolicy_i_v_; -text: .text%__1cSReferenceProcessorOprocess_phase36MppnHoopDesc_ipnRBoolObjectClosure_pnKOopClosure_pnLVoidClosure__v_; -text: .text%__1cSReferenceProcessorOprocess_phase26MppnHoopDesc_pnRBoolObjectClosure_pnKOopClosure__v_; -text: .text%__1cSReferenceProcessorbAenqueue_discovered_reflist6MpnHoopDesc_p2_v_; text: .text%__1cTleaPIdxScaleOffNodeMideal_Opcode6kM_i_; text: .text%__1cTleaPIdxScaleOffNodePoper_input_base6kM_I_; -text: .text%__1cFLabelJadd_patch6Mi_v_; text: .text%__1cKMemBarNodeEhash6kM_I_; text: .text%__1cOcompP_rRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNloadConL0NodePoper_input_base6kM_I_; text: .text%__1cNsubI_rRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cJMarkSweepSMarkAndPushClosureLdo_nmethods6kM_ki_; text: .text%__1cIXorINodeGOpcode6kM_i_; -text: .text%__1cTStackWalkCompPolicyRcompilation_level6MnMmethodHandle_i_i_; text: .text%__1cMoutputStreamDput6Mc_v_; text: .text%__1cPindOffset32OperNbase_position6kM_i_; text: .text%__1cPindOffset32OperNconstant_disp6kM_i_; text: .text%__1cOcompU_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cNloadConL0NodeHtwo_adr6kM_I_; -text: .text%__1cPBytecode_invokeFindex6kM_i_; -text: .text%__1cFframeNis_glue_frame6kM_i_; text: .text%__1cLRShiftINodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cZPhaseConservativeCoalesceKupdate_ifg6MIIpnIIndexSet_2_v_; text: .text%__1cZPhaseConservativeCoalesceMunion_helper6MpnENode_2II222pnFBlock_I_v_; @@ -2095,37 +1333,24 @@ text: .text%__1cIIndexSetEswap6Mp0_v_; text: .text%__1cOPhaseIdealLoopIsink_use6MpnENode_2_v_; text: .text%__1cRshrL_rReg_immNodeErule6kM_I_; text: .text%__1cKInlineTreeMok_to_inline6MpnIciMethod_pnIJVMState_rnNciCallProfile_pnMWarmCallInfo__8_; -text: .text%__1cTpass_initial_checks6FpnIciMethod_i1_i_; -text: .text%__1cKInlineTreeMshouldInline6kMpnIciMethod_irnNciCallProfile_pnMWarmCallInfo__pkc_; -text: .text%__1cOCompilerOracleNshould_inline6FnMmethodHandle__i_; -text: .text%__1cKInlineTreeNtry_to_inline6MpnIciMethod_irnNciCallProfile_pnMWarmCallInfo__pkc_; -text: .text%__1cIciMethodbAinterpreter_throwout_count6kM_i_; -text: .text%__1cIciMethodNshould_inline6M_i_; -text: .text%__1cIciMethodOshould_exclude6M_i_; text: .text%__1cScompU_rReg_immNodeErule6kM_I_; text: .text%__1cKjmpDirNodeJlabel_set6MrnFLabel_I_v_; -text: .text%__1cKjmpDirNodeJis_Branch6kM_I_; text: .text%__1cKjmpDirNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMindirectOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cILoadNodeDcmp6kMrknENode__I_; text: .text%__1cLTypeInstPtrQcast_to_ptr_type6kMnHTypePtrDPTR__pknEType__; text: .text%__1cIGraphKitHjava_bc6kM_nJBytecodesECode__; -text: .text%__1cFLabelSpatch_instructions6MpnRAbstractAssembler__v_; -text: .text%__1cRAbstractAssemblerHbind_to6MrnFLabel_i_v_; text: .text%__1cRAbstractAssemblerEbind6MrnFLabel__v_; text: .text%__1cNloadConL0NodeErule6kM_I_; text: .text%__1cJStoreNodeSIdeal_masked_input6MpnIPhaseGVN_I_pnENode__; text: .text%__1cIGraphKitNbuiltin_throw6MnODeoptimizationLDeoptReason_pnENode__v_; text: .text%__1cbBopt_virtual_call_RelocationEtype6M_nJrelocInfoJrelocType__; -text: .text%__1cJrRegIOperFclone6kM_pnIMachOper__; text: .text%__1cMindIndexOperFscale6kM_i_; text: .text%__1cScompP_mem_rRegNodeMideal_Opcode6kM_i_; -text: .text%__1cFKlassPoop_is_instance6kM_i_; text: .text%__1cHciFieldPinitialize_from6MpnPfieldDescriptor__v_; text: .text%__1cRandI_rReg_immNodeMideal_Opcode6kM_i_; text: .text%__1cMMachProjNodeHsize_of6kM_I_; text: .text%__1cJStoreNodeZIdeal_sign_extended_input6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cScompP_mem_rRegNodeHtwo_adr6kM_I_; text: .text%__1cTconvF2D_reg_memNodeErule6kM_I_; text: .text%__1cPindOffset32OperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cFStateM_sub_Op_CmpP6MpknENode__v_; @@ -2134,38 +1359,24 @@ text: .text%__1cMloadConLNodeMideal_Opcode6kM_i_; text: .text%__1cSCompiledStaticCallJfind_stub6M_pC_; text: .text%__1cIciSymbolEmake6Fpkc_p0_; text: .text%__1cIciSymbolJmake_impl6Fpkc_p0_; -text: .text%__1cScompU_rReg_immNodePoper_input_base6kM_I_; text: .text%__1cKimmL32OperIconstant6kM_l_; -text: .text%__1cHi2sNodePoper_input_base6kM_I_; text: .text%__1cKimmL32OperJnum_edges6kM_I_; -text: .text%__1cMMonitorValue2t6MpnKScopeValue_nILocation__v_; text: .text%__1cMMonitorValueIwrite_on6MpnUDebugInfoWriteStream__v_; text: .text%__1cLBoxLockNodeKstack_slot6FpnENode__i_; -text: .text%__1cLBoxLockNodeKis_BoxLock6kM_pk0_; text: .text%__1cIBoolNodeDcmp6kMrknENode__I_; text: .text%__1cNSignatureInfoIdo_array6Mii_v_; -text: .text%__1cKDataLayoutPneeds_array_len6FC_i_; text: .text%__1cKDataLayoutKinitialize6MCHi_v_; text: .text%__1cJloadLNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFframebHnext_monitor_in_interpreter_frame6kMpnPBasicObjectLock__2_; -text: .text%__1cLRuntimeStubHoops_do6MpnKOopClosure__v_; -text: .text%__1cFParseRbranch_prediction6Mrf_f_; text: .text%__1cPshrI_rReg_1NodeMideal_Opcode6kM_i_; -text: .text%__1cHciKlassNis_subtype_of6Mp0_i_; text: .text%__1cOcompL_rRegNodeErule6kM_I_; text: .text%__1cNGrowableArray4Cpv_Praw_at_put_grow6Mirk03_v_; text: .text%__1cNGrowableArray4Cl_Praw_at_put_grow6Mirkl2_v_; text: .text%__1cISubINodeLbottom_type6kM_pknEType__; -text: .text%__1cIGraphKitZset_all_rewritable_memory6MpnENode__v_; -text: .text%__1cIGraphKitTset_all_memory_call6MpnENode__v_; text: .text%__1cMtlsLoadPNodeLbottom_type6kM_pknEType__; text: .text%__1cJAssemblerEmovq6MnHAddress_pnMRegisterImpl__v_; -text: .text%__1cRsalI_rReg_immNodePoper_input_base6kM_I_; text: .text%__1cNloadRangeNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cICodeBlobPis_runtime_stub6kM_i_; text: .text%__1cGRFrameMset_distance6Mi_v_; -text: .text%__1cICodeBlobOis_c2i_adapter6kM_i_; -text: .text%__1cFframeTis_first_java_frame6kM_i_; text: .text%__1cFframeLreal_sender6kMpnLRegisterMap__0_; text: .text%__1cGRFrameGcaller6M_p0_; text: .text%__1cTStackWalkCompPolicyIsenderOf6MpnGRFrame_pnNGrowableArray4C2___2_; @@ -2174,51 +1385,31 @@ text: .text%__1cKstoreLNodePoper_input_base6kM_I_; text: .text%__1cTconstantPoolOopDescMklass_at_put6MipnMklassOopDesc__v_; text: .text%__1cNFingerprinterGdo_int6M_v_; text: .text%__1cNSafepointBlobbDpreserve_callee_argument_oops6MnFframe_pknLRegisterMap_pnKOopClosure__v_; -text: .text%__1cRaddI_rReg_immNodeJnum_opnds6kM_I_; text: .text%__1cRshrL_rReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cHPhiNodeEmake6FpnENode_2_p0_; -text: .text%__1cScompI_rReg_immNodeJnum_opnds6kM_I_; -text: .text%__1cENodeIis_CMove6M_pnJCMoveNode__; text: .text%__1cWstatic_call_RelocationLstatic_stub6M_pC_; -text: .text%__1cLRethrowNodeGis_CFG6kM_i_; text: .text%__1cIciObjectFklass6M_pnHciKlass__; text: .text%__1cNloadConP0NodeMideal_Opcode6kM_i_; text: .text%__1cOPhaseIdealLoopOsplit_thru_phi6MpnENode_2i_2_; -text: .text%__1cNGCTaskManagerRset_resource_flag6MIi_v_; -text: .text%__1cRshrI_rReg_immNodePoper_input_base6kM_I_; -text: .text%__1cUmembar_cpu_orderNodeMideal_Opcode6kM_i_; text: .text%__1cLklassVtableIindex_of6kMpnNmethodOopDesc_i_i_; text: .text%__1cKEntryPointFentry6kMnITosState__pC_; -text: .text%__1cJloadCNodeMideal_Opcode6kM_i_; text: .text%__1cKJavaThreadJframes_do6MpFpnFframe_pknLRegisterMap__v_v_; text: .text%__1cNMemoryManagerHoops_do6MpnKOopClosure__v_; text: .text%__1cRInvocationCounterJset_carry6M_v_; -text: .text%__1cKTypeAryPtrEmake6FnHTypePtrDPTR_pknHTypeAry_pnHciKlass_ii_pk0_; text: .text%__1cFStateM_sub_Op_RegL6MpknENode__v_; text: .text%__1cNdecI_rRegNodeErule6kM_I_; -text: .text%__1cKjmpConNodeJis_Branch6kM_I_; text: .text%__1cKjmpConNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPcmpFastLockNodeMideal_Opcode6kM_i_; text: .text%__1cKjmpConNodeJlabel_set6MrnFLabel_I_v_; text: .text%__1cJttyLockerbCbreak_tty_lock_for_safepoint6Fl_v_; -text: .text%__1cNCallGeneratorJis_inline6kM_i_; text: .text%__1cUSafepointSynchronizeFblock6FpnKJavaThread__v_; text: .text%__1cCosRcurrent_thread_id6F_l_; text: .text%__1cKciTypeFlowLStateVectorMdo_getstatic6MpnQciBytecodeStream__v_; text: .text%__1cNSignatureInfoHdo_bool6M_v_; text: .text%__1cLLShiftLNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cKstoreLNodeMideal_Opcode6kM_i_; -text: .text%__1cNloadKlassNodeHtwo_adr6kM_I_; -text: .text%__1cFParseYprofile_not_taken_branch6M_v_; text: .text%__1cHPhiNodeMslice_memory6kMpknHTypePtr__p0_; -text: .text%__1cOcompL_rRegNodeJnum_opnds6kM_I_; -text: .text%__1cLRuntimeStubMdo_unloading6MpnRBoolObjectClosure_pnKOopClosure_i_v_; -text: .text%__1cLSymbolTableFprobe6Fpkci_pnNsymbolOopDesc__; -text: .text%__1cOcompL_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cPcmpFastLockNodePoper_input_base6kM_I_; -text: .text%__1cNCallGeneratorKis_virtual6kM_i_; -text: .text%__1cKInlineTreePshouldNotInline6kMpnIciMethod_pnMWarmCallInfo__pkc_; -text: .text%__1cLcastP2LNodeErule6kM_I_; text: .text%__1cNinstanceKlassKjava_super6kM_pnMklassOopDesc__; text: .text%__1cNPhaseRegAllocKoffset2reg6kMi_i_; text: .text%__1cQjmpCon_shortNodeMideal_Opcode6kM_i_; @@ -2226,88 +1417,53 @@ text: .text%__1cQjmpCon_shortNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cRInterpretedRFrame2t6MnFframe_pnKJavaThread_pnGRFrame__v_; text: .text%__1cTconvI2L_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cJloadINodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cENodeRlatency_from_uses6kMrnLBlock_Array_rnNGrowableArray4CI___i_; text: .text%__1cNGrowableArray4CI_Praw_at_put_grow6MirkI2_v_; -text: .text%__1cFParseFdo_if6MpnENode_2nIBoolTestEmask_2_v_; text: .text%__1cXmembar_acquire_lockNodeMideal_Opcode6kM_i_; text: .text%__1cKklassKlassIoop_size6kMpnHoopDesc__i_; text: .text%__1cXindIndexScaleOffsetOperOindex_position6kM_i_; text: .text%__1cXindIndexScaleOffsetOperNbase_position6kM_i_; -text: .text%__1cPsalI_rReg_1NodePoper_input_base6kM_I_; text: .text%__1cIGraphKitJpush_node6MnJBasicType_pnENode__v_; -text: .text%__1cISubINodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cSconstMethodOopDescbEchecked_exceptions_length_addr6kM_pH_; text: .text%__1cPThreadLocalNodeGOpcode6kM_i_; text: .text%__1cRsubI_rReg_memNodePoper_input_base6kM_I_; -text: .text%__1cJloadCNodePoper_input_base6kM_I_; text: .text%__1cSThreadLocalStoragePget_thread_slow6F_pnGThread__; text: .text%__1cCosXthread_local_storage_at6Fi_pv_; -text: .text%__1cLRuntimeStubYcaller_must_gc_arguments6kMpnKJavaThread__i_; text: .text%__1cIAddPNodeJideal_reg6kM_I_; -text: .text%__1cTleaPIdxScaleOffNodeJnum_opnds6kM_I_; text: .text%__1cRaddI_rReg_immNodeHtwo_adr6kM_I_; text: .text%__1cFParseNthrow_to_exit6MpnNSafePointNode__v_; text: .text%__1cQCallLeafNoFPNodeGOpcode6kM_i_; text: .text%__1cKTypeRawPtrHget_con6kM_l_; text: .text%__1cOClearArrayNodeGOpcode6kM_i_; -text: .text%__1cOoop_RelocationHoops_do6MpFppnHoopDesc__v_v_; -text: .text%__1cIciMethodbHhas_unloaded_classes_in_signature6M_i_; -text: .text%__1cScompP_mem_rRegNodeJnum_opnds6kM_I_; text: .text%__1cFStateM_sub_Op_CmpI6MpknENode__v_; -text: .text%__1cNincI_rRegNodeJnum_opnds6kM_I_; text: .text%__1cJimmP0OperEtype6kM_pknEType__; text: .text%__1cNloadConP0NodeLbottom_type6kM_pknEType__; text: .text%__1cPloadConUL32NodeLbottom_type6kM_pknEType__; text: .text%__1cNloadConI0NodeHsize_of6kM_I_; -text: .text%__1cRaddI_rReg_memNodeZcheck_for_anti_dependence6kM_i_; -text: .text%__1cPshrI_rReg_1NodePoper_input_base6kM_I_; text: .text%JVM_handle_solaris_signal; text: .text%signalHandler; text: .text%__1cQJNI_FastGetFieldQfind_slowcase_pc6FpC_1_; -text: .text%__1cMLinkResolverbElinktime_resolve_static_method6FrnMmethodHandle_nLKlassHandle_nMsymbolHandle_43ipnGThread__v_; -text: .text%__1cRresolve_and_patch6FppnHoopDesc__v_; text: .text%__1cFStateN_sub_Op_LoadP6MpknENode__v_; text: .text%__1cISubINodeDsub6kMpknEType_3_3_; text: .text%__1cPClassFileParserbDverify_legal_method_signature6MnMsymbolHandle_1pnGThread__i_; text: .text%__1cMLinkResolverVresolve_invokevirtual6FrnICallInfo_nGHandle_nSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cRInterpretedRFrameOis_interpreted6kM_i_; -text: .text%__1cGRFrameLis_compiled6kM_i_; text: .text%__1cUPSGenerationCountersKupdate_all6M_v_; text: .text%__1cTStackWalkCompPolicyMshouldInline6FnMmethodHandle_fi_pkc_; text: .text%__1cFArenaRdestruct_contents6M_v_; -text: .text%__1cIGraphKitPstore_to_memory6MpnENode_22nJBasicType_i_2_; -text: .text%__1cJStoreNodeEmake6FpnENode_22pknHTypePtr_2nJBasicType__p0_; text: .text%__1cXPhaseAggressiveCoalesceYinsert_copy_with_overlap6MpnFBlock_pnENode_II_v_; text: .text%__1cULinearLeastSquareFitGupdate6Mdd_v_; -text: .text%__1cKciTypeFlowGJsrSetSis_compatible_with6Mp1_i_; text: .text%__1cENodeIadd_prec6Mp0_v_; -text: .text%__1cKOSRAdapterOis_osr_adapter6kM_i_; text: .text%__1cIMulINodeGOpcode6kM_i_; text: .text%__1cLciSignature2t6MpnHciKlass_pnIciSymbol__v_; text: .text%__1cNGrowableArray4CpnGciType__2t6MpnFArena_iirk1_v_; -text: .text%__1cKTypeAryPtrFempty6kM_i_; -text: .text%__1cHTypeAryFempty6kM_i_; -text: .text%__1cJloadCNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cIciMethod2t6MnMmethodHandle__v_; -text: .text%__1cRandI_rReg_immNodePoper_input_base6kM_I_; text: .text%__1cJAssemblerDjcc6Mn0AJCondition_rnFLabel_nJrelocInfoJrelocType__v_; -text: .text%__1cCosRelapsed_frequency6F_x_; -text: .text%__1cNinstanceKlassVis_same_class_package6FpnHoopDesc_pnNsymbolOopDesc_24_i_; text: .text%__1cMelapsedTimerHseconds6kM_d_; text: .text%__1cOJNIHandleBlockOallocate_block6FpnGThread__p0_; -text: .text%__1cJAssemblerDnop6M_v_; -text: .text%__1cDCHANprocess_class6FnLKlassHandle_pnNGrowableArray4n0B___pnNGrowableArray4nMmethodHandle___nMsymbolHandle_6_v_; -text: .text%__1cEUTF8Fequal6FpWi1i_i_; -text: .text%__1cKstoreLNodeJnum_opnds6kM_I_; -text: .text%__1cIjniIdMapHoops_do6MpnKOopClosure__v_; -text: .text%__1cMjniIdMapBaseHoops_do6MpnKOopClosure__v_; text: .text%__1cJArrayDataKcell_count6M_i_; text: .text%__1cGBitMapIset_from6M0_v_; -text: .text%__1cPBytecode_invokeJsignature6kM_pnNsymbolOopDesc__; text: .text%__1cKType_ArrayEgrow6MI_v_; text: .text%JVM_Write; text: .text%__1cDhpiFwrite6FipkvI_L_; -text: .text%__1cMStartC2INodeGOpcode6kM_i_; text: .text%__1cSindIndexOffsetOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cFframebGinterpreter_callee_receiver_addr6MnMsymbolHandle__ppnHoopDesc__; text: .text%__1cIAddLNodeLbottom_type6kM_pknEType__; @@ -2318,33 +1474,21 @@ text: .text%__1cMtlsLoadPNodeMideal_Opcode6kM_i_; text: .text%__1cRshrI_rReg_immNodeErule6kM_I_; text: .text%__1cJcmpOpOperGnegate6M_v_; text: .text%__1cHTypeAryEmake6FpknEType_pknHTypeInt__pk0_; -text: .text%__1cFParseRoptimize_inlining6MpnIciMethod_ipnPciInstanceKlass_24irnKInlineTreeLInlineStyle_r2_v_; -text: .text%__1cQimprove_receiver6FpnPciInstanceKlass_pknLTypeInstPtr_ri_1_; -text: .text%__1cPcmpFastLockNodeHtwo_adr6kM_I_; -text: .text%__1cMLinkResolverTresolve_static_call6FrnICallInfo_rnLKlassHandle_nMsymbolHandle_53iipnGThread__v_; text: .text%__1cPCheckCastPPNodeJideal_reg6kM_I_; -text: .text%__1cKJavaThreadUin_stack_yellow_zone6MpC_i_; -text: .text%__1cFParseSmerge_memory_edges6MpnMMergeMemNode_ii_v_; text: .text%__1cJAssemblerEmovq6MpnMRegisterImpl_nHAddress__v_; text: .text%__1cUSafepointSynchronizebDhandle_polling_page_exception6FpnKJavaThread__v_; text: .text%__1cUThreadSafepointStatebDhandle_polling_page_exception6M_v_; text: .text%__1cLjmpConUNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNandL_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cKcmpOpUOperFccode6kM_i_; -text: .text%__1cLjmpConUNodeTmay_be_short_branch6kM_i_; -text: .text%__1cLjmpConUNodeOis_pc_relative6kM_i_; text: .text%__1cIPipelinePoperand_latency6kMIpk0_I_; text: .text%__1cWCallLeafNoFPDirectNodeMideal_Opcode6kM_i_; text: .text%__1cQPlaceholderTableKfind_entry6MiInMsymbolHandle_nGHandle__pnNsymbolOopDesc__; -text: .text%__1cJTimeStampSticks_since_update6kM_x_; text: .text%__1cURethrowExceptionNodeMideal_Opcode6kM_i_; text: .text%__1cJloadPNodeFreloc6kM_i_; text: .text%__1cTno_rax_rbx_RegPOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cNprefetchwNodeJnum_opnds6kM_I_; text: .text%__1cKjmpConNodeGnegate6M_v_; text: .text%__1cMindirectOperFscale6kM_i_; -text: .text%__1cQSystemDictionaryVadd_loader_constraint6FnMsymbolHandle_nGHandle_2pnGThread__v_; -text: .text%__1cVLoaderConstraintTableJadd_entry6MnMsymbolHandle_pnMklassOopDesc_nGHandle_34pnGThread__i_; text: .text%__1cRsubI_rReg_memNodeMideal_Opcode6kM_i_; text: .text%__1cTOopMapForCacheEntryZfill_stackmap_for_opcodes6MpnOBytecodeStream_pnNCellTypeState_4i_v_; text: .text%__1cQComputeCallStackGdo_int6M_v_; @@ -2352,7 +1496,6 @@ text: .text%__1cNloadRangeNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cNtestP_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNloadRangeNodeIpipeline6kM_pknIPipeline__; text: .text%__1cPCheckCastPPNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cFParseMvisit_blocks6M_v_; text: .text%__1cQjmpDir_shortNodeMideal_Opcode6kM_i_; text: .text%__1cQjmpDir_shortNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cKciTypeFlowLStateVectorLdo_getfield6MpnQciBytecodeStream__v_; @@ -2361,40 +1504,26 @@ text: .text%__1cScompP_mem_rRegNodeErule6kM_I_; text: .text%__1cPSignatureStreamRas_symbol_or_null6M_pnNsymbolOopDesc__; text: .text%__1cNSafePointNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cJloadSNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cKMemBarNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cOjmpLoopEndNodeMideal_Opcode6kM_i_; -text: .text%__1cFBlockTimplicit_null_check6MrnLBlock_Array_rnNGrowableArray4CI__pnENode_6_v_; text: .text%__1cKCastPPNodeQIdeal_DU_postCCP6MpnIPhaseCCP__pnENode__; text: .text%__1cOGenerateOopMapKcopy_state6MpnNCellTypeState_2_v_; -text: .text%__1cGThreadSis_Compiler_thread6kM_i_; text: .text%__1cRCardTableModRefBSPdirty_MemRegion6MnJMemRegion__v_; -text: .text%__1cJloadBNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cQVMOperationQdDueueSqueue_remove_front6Mi_pnMVM_Operation__; text: .text%__1cOcompI_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cVCompressedWriteStreamEgrow6M_v_; -text: .text%__1cNCompileBrokerYcheck_compilation_result6FnMmethodHandle_iippnHnmethod__i_; -text: .text%__1cKReflectionVis_same_class_package6FpnMklassOopDesc_2_i_; -text: .text%__1cNinstanceKlassVis_same_class_package6MpnMklassOopDesc__i_; text: .text%JVM_RawMonitorEnter; -text: .text%__1cFMutexMjvm_raw_lock6M_v_; text: .text%JVM_RawMonitorExit; -text: .text%__1cFMutexOjvm_raw_unlock6M_v_; text: .text%__1cHUNICODELutf8_length6FpHi_i_; text: .text%__1cRaddP_rReg_immNodeHtwo_adr6kM_I_; -text: .text%__1cIciMethodLis_accessor6kM_i_; text: .text%__1cPCountedLoopNodeDphi6kM_pnENode__; text: .text%__1cLBoxLockNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cSmembar_releaseNodeMideal_Opcode6kM_i_; -text: .text%__1cQciBytecodeStreamSget_constant_index6kM_i_; -text: .text%__1cOGenerateOopMapOset_bbmark_bit6Mi_v_; text: .text%__1cFParseOreturn_current6MpnENode__v_; text: .text%__1cLConvI2LNodeJideal_reg6kM_I_; text: .text%__1cJStartNodeFmatch6MpknIProjNode_pknHMatcher__pnENode__; text: .text%__1cMorI_rRegNodeMcisc_operand6kM_i_; text: .text%__1cMloadConPNodeFreloc6kM_i_; -text: .text%__1cGThreadMis_VM_thread6kM_i_; text: .text%__1cSPSPromotionManagerFreset6M_v_; -text: .text%__1cNPrefetchQdDueueFclear6M_v_; text: .text%__1cSPSPromotionManagerKflush_labs6M_v_; text: .text%__1cFciEnvVnotice_inlined_method6MpnIciMethod__v_; text: .text%__1cOJNIHandleBlockNrelease_block6Fp0pnGThread__v_; @@ -2407,84 +1536,52 @@ text: .text%__1cJTypeTupleFxdual6kM_pknEType__; text: .text%__1cOcompP_rRegNodeQuse_cisc_RegMask6M_v_; text: .text%__1cHi2sNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cJAssemblerKemit_arith6MiipnMRegisterImpl_2_v_; -text: .text%__1cLcastP2LNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRciVirtualCallDataOtranslate_from6MpnLProfileData__v_; text: .text%__1cXinitialize_static_field6FpnPfieldDescriptor_pnGThread__v_: classFileParser.o; text: .text%__1cKstoreCNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cNCompileBrokerXcompilation_is_in_queue6FnMmethodHandle_i_i_; -text: .text%__1cRsubI_rReg_memNodeJnum_opnds6kM_I_; -text: .text%__1cETypeCeq6kMpk0_i_; -text: .text%__1cHMatcherPstack_alignment6F_I_; text: .text%__1cNloadKlassNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cJloadSNodeJnum_opnds6kM_I_; text: .text%__1cJMultiNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cRshrL_rReg_immNodeJnum_opnds6kM_I_; -text: .text%__1cTconvI2L_reg_memNodeErule6kM_I_; text: .text%__1cMURShiftLNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cRcmpFastUnlockNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cSInterpreterRuntimebAfrequency_counter_overflow6FpnKJavaThread_pC_n0AJIcoResult__; text: .text%__1cHSubNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cQjava_lang_StringGlength6FpnHoopDesc__i_; text: .text%__1cLRethrowNodeGOpcode6kM_i_; -text: .text%__1cPcmpFastLockNodeJnum_opnds6kM_I_; -text: .text%__1cIciMethodPcan_be_compiled6M_i_; text: .text%__1cFParseQcreate_entry_map6M_pnNSafePointNode__; text: .text%__1cFParseIdo_exits6M_v_; text: .text%__1cFParseLbuild_exits6M_v_; text: .text%__1cFParseLinit_blocks6M_v_; text: .text%__1cFParse2t6MpnIJVMState_pnIciMethod_f_v_; -text: .text%__1cIciMethodVhas_balanced_monitors6M_i_; text: .text%__1cFParseNdo_all_blocks6M_v_; text: .text%__1cOParseGeneratorIgenerate6MpnIJVMState__2_; -text: .text%__1cOParseGeneratorJcan_parse6FpnIciMethod_i_i_; text: .text%__1cFArenaEused6kM_L_; text: .text%__1cRandI_rReg_immNodeErule6kM_I_; text: .text%jni_GetSuperclass: jni.o; text: .text%__1cPno_rax_RegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cFStateM_sub_Op_AddI6MpknENode__v_; -text: .text%__1cPClassFileParserUskip_over_field_name6MpciI_1_; text: .text%__1cFParsePdo_method_entry6M_v_; text: .text%__1cNCallGeneratorKfor_inline6FpnIciMethod_f_p0_; -text: .text%__1cKciTypeFlowFBlockPclone_loop_head6Mp0ip1pn0AGJsrSet__3_; text: .text%__1cLOpaque1NodeGOpcode6kM_i_; -text: .text%__1cHciKlassOis_subclass_of6Mp0_i_; -text: .text%__1cbBjava_lang_ref_SoftReferenceFclock6F_x_; text: .text%__1cTAbstractInterpreterbFsize_top_interpreter_activation6FpnNmethodOopDesc__i_; -text: .text%__1cRruntime_type_from6FpnJJavaValue__nJBasicType__: javaCalls.o; -text: .text%__1cCosbCstack_shadow_pages_available6FpnGThread_nMmethodHandle__i_; text: .text%__1cPJavaCallWrapper2t6MnMmethodHandle_nGHandle_pnJJavaValue_pnGThread__v_; text: .text%__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_; text: .text%__1cRJavaCallArgumentsKparameters6M_pl_; text: .text%__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_; text: .text%__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_; -text: .text%__1cLCastP2LNodeLbottom_type6kM_pknEType__; text: .text%__1cPJavaCallWrapper2T6M_v_; text: .text%__1cVPreserveExceptionMark2T6M_v_; text: .text%__1cVPreserveExceptionMark2t6MrpnGThread__v_; -text: .text%__1cMrax_RegPOperJnum_edges6kM_I_; text: .text%__1cMrax_RegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cITypeFuncFxdual6kM_pknEType__; -text: .text%__1cIimmLOperJconstantL6kM_x_; -text: .text%__1cIMulLNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cLRShiftINodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cJloadPNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cNCompileBrokerTcompile_method_base6FnMmethodHandle_ii1ipkcpnGThread__pnHnmethod__; -text: .text%__1cNCompileBrokerOcompile_method6FnMmethodHandle_i1ipkcpnGThread__pnHnmethod__; -text: .text%__1cNmethodOopDescWload_signature_classes6FnMmethodHandle_pnGThread__i_; text: .text%__1cTconstantPoolOopDescbDresolve_string_constants_impl6FnSconstantPoolHandle_pnGThread__v_; -text: .text%__1cYDebugInformationRecorderNadd_dependent6MpnPciInstanceKlass_pnIciMethod__v_; text: .text%__1cHciField2t6MpnPciInstanceKlass_i_v_; text: .text%__1cTconstantPoolOopDescbCklass_ref_at_if_loaded_check6FnSconstantPoolHandle_ipnGThread__pnMklassOopDesc__; text: .text%__1cMLinkResolverXresolve_klass_no_update6FrnLKlassHandle_nSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cNaddL_rRegNodePoper_input_base6kM_I_; text: .text%__1cISubINodeGadd_id6kM_pknEType__; text: .text%__1cNsubI_rRegNodeHtwo_adr6kM_I_; text: .text%__1cGciType2t6MnLKlassHandle__v_; -text: .text%__1cMMutableSpaceKinitialize6MnJMemRegion_i_v_; text: .text%__1cHciKlass2t6MnLKlassHandle__v_; -text: .text%__1cKInlineTree2t6MpnHCompile_pk0pnIciMethod_pnIJVMState_if_v_; text: .text%__1cJEventMark2t6MpkcE_v_; -text: .text%__1cJloadCNodeJnum_opnds6kM_I_; text: .text%__1cNaddI_rRegNodeQuse_cisc_RegMask6M_v_; text: .text%__1cQComputeCallStackHdo_long6M_v_; text: .text%__1cMindirectOperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_; @@ -2492,12 +1589,9 @@ text: .text%__1cRaddI_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cRLowMemoryDetectorWdetect_after_gc_memory6FpnKMemoryPool__v_; text: .text%__1cQVMOperationQdDueueNqueue_oops_do6MipnKOopClosure__v_; text: .text%__1cMCreateExNodeJideal_reg6kM_I_; -text: .text%__1cMorI_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cMorI_rRegNodeJnum_opnds6kM_I_; text: .text%__1cRmethodDataOopDescLbci_to_data6Mi_pnLProfileData__; text: .text%__1cNSCMemProjNodeGOpcode6kM_i_; text: .text%__1cNSignatureInfoHdo_long6M_v_; -text: .text%__1cLPCTableNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cMCreateExNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cRinterpretedVFrameDbci6kM_i_; text: .text%__1cKInlineTreeYcompute_callee_frequency6kMi_f_; @@ -2511,36 +1605,25 @@ text: .text%__1cNsubI_rRegNodeQuse_cisc_RegMask6M_v_; text: .text%__1cOMethodLivenessKBasicBlockIload_two6Mi_v_; text: .text%__1cFKlassTarray_klass_or_null6Mi_pnMklassOopDesc__; text: .text%__1cNmulL_rRegNodeMcisc_operand6kM_i_; -text: .text%__1cNobjArrayKlassPoop_is_objArray6kM_i_; -text: .text%__1cLklassVtableXvtable_accessibility_at6Mi_n0AKAccessType__; -text: .text%__1cNrFlagsRegOperFclone6kM_pnIMachOper__; text: .text%__1cIGraphKitJpush_pair6MpnENode__v_; text: .text%__1cNCatchProjNodeDcmp6kMrknENode__I_; -text: .text%__1cIGraphKitRmake_slow_call_ex6MpnENode_pnPciInstanceKlass__v_; text: .text%__1cTcompareAndSwapLNodePoper_input_base6kM_I_; text: .text%__1cMloadConINodeHsize_of6kM_I_; text: .text%__1cJAssemblerKemit_arith6MiipnMRegisterImpl_i_v_; -text: .text%__1cRMachSafePointNodeLis_MachCall6M_pnMMachCallNode__; text: .text%__1cNstoreImmINodeMideal_Opcode6kM_i_; -text: .text%__1cJScopeDescGis_top6kM_i_; text: .text%__1cHOrINodeLbottom_type6kM_pknEType__; text: .text%__1cPstoreImmI16NodeMideal_Opcode6kM_i_; text: .text%__1cMindIndexOperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cFStateQ_sub_Op_CreateEx6MpknENode__v_; text: .text%__1cRshrL_rReg_immNodeHtwo_adr6kM_I_; -text: .text%__1cLjmpConUNodeJis_Branch6kM_I_; text: .text%__1cLjmpConUNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLjmpConUNodeJlabel_set6MrnFLabel_I_v_; text: .text%__1cRaddI_rReg_memNodeMideal_Opcode6kM_i_; text: .text%__1cPciInstanceKlass2t6MnLKlassHandle__v_; text: .text%__1cHCompileXin_preserve_stack_slots6M_I_; -text: .text%__1cMMachCallNodeHis_Call6M_pnICallNode__; text: .text%__1cNdecI_rRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cKStoreCNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cLLShiftINodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cTtypeArrayKlassKlassIoop_size6kMpnHoopDesc__i_; -text: .text%__1cLklassVtableKis_miranda6FpnNmethodOopDesc_pnPobjArrayOopDesc_pnMklassOopDesc__i_; -text: .text%__1cTconvL2I_reg_regNodePoper_input_base6kM_I_; text: .text%__1cRalign_code_offset6Fi_I_; text: .text%__1cMURShiftINodeLbottom_type6kM_pknEType__; text: .text%__1cMorI_rRegNodeErule6kM_I_; @@ -2551,18 +1634,10 @@ text: .text%__1cTconvL2I_reg_regNodeErule6kM_I_; text: .text%__1cRmethodDataOopDescJbci_to_dp6Mi_pC_; text: .text%__1cIAddLNodeGadd_id6kM_pknEType__; text: .text%__1cRaddL_rReg_immNodeMideal_Opcode6kM_i_; -text: .text%__1cLRShiftINodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cFTypeFEhash6kM_i_; -text: .text%__1cIGraphKitMarray_length6MpnENode__2_; -text: .text%__1cPCallRuntimeNodeEhash6kM_I_; text: .text%__1cPsalI_rReg_1NodeErule6kM_I_; text: .text%__1cIJVMState2t6Mi_v_; -text: .text%__1cNstoreImmBNodeHtwo_adr6kM_I_; -text: .text%__1cLLShiftINodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cScompU_rReg_immNodeJnum_opnds6kM_I_; -text: .text%__1cNGrowableArray4Cl_Icontains6kMrkl_i_; text: .text%__1cScompU_rReg_immNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cQjava_lang_StringGequals6FpnHoopDesc_pHi_i_; text: .text%__1cOcompP_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cTCreateExceptionNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMURShiftINodeFValue6kMpnOPhaseTransform__pknEType__; @@ -2579,197 +1654,112 @@ text: .text%__1cSsafePoint_pollNodePoper_input_base6kM_I_; text: .text%__1cLRuntimeStubbDpreserve_callee_argument_oops6MnFframe_pknLRegisterMap_pnKOopClosure__v_; text: .text%__1cPshrI_rReg_1NodeErule6kM_I_; text: .text%__1cRmethodDataOopDescKmileage_of6FpnNmethodOopDesc__i_; -text: .text%__1cKManagementJtimestamp6F_x_; -text: .text%__1cbDReferenceProcessorInitializerIis_clean6kM_v_; text: .text%__1cIPSOldGenPupdate_counters6M_v_; -text: .text%__1cNSingletonBlobIis_alive6kM_i_; -text: .text%__1cKTypeRawPtrCeq6kMpknEType__i_; text: .text%__1cIregDOperEtype6kM_pknEType__; -text: .text%__1cQleaPIdxScaleNodeHtwo_adr6kM_I_; text: .text%__1cTStackWalkCompPolicyPshouldNotInline6FnMmethodHandle__pkc_; -text: .text%__1cMPrefetchNodeLbottom_type6kM_pknEType__; text: .text%__1cPcmpFastLockNodeErule6kM_I_; text: .text%__1cFArena2t6M_v_; text: .text%__1cSCallLeafDirectNodePoper_input_base6kM_I_; -text: .text%__1cMCallLeafNodeLis_CallLeaf6kM_pk0_; text: .text%__1cQleaPIdxScaleNodeMideal_Opcode6kM_i_; text: .text%__1cJcmpOpOperFequal6kM_i_; text: .text%__1cScompI_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%jni_IsSameObject: jni.o; -text: .text%__1cNmulL_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cNmulL_rRegNodeJnum_opnds6kM_I_; text: .text%__1cIGraphKitYcombine_exception_states6MpnNSafePointNode_2_v_; text: .text%__1cJloadBNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cMrcx_RegIOperJnum_edges6kM_I_; -text: .text%__1cFKlassNoop_is_method6kM_i_; text: .text%__1cIMulLNodeLbottom_type6kM_pknEType__; -text: .text%__1cHnmethodPis_locked_by_vm6kM_i_; text: .text%__1cONMethodSweeperPprocess_nmethod6FpnHnmethod__v_; text: .text%__1cRaddP_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cXjava_lang_ref_ReferenceWpending_list_lock_addr6F_ppnHoopDesc__; -text: .text%__1cJloadLNodeHtwo_adr6kM_I_; -text: .text%__1cHMulNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cMrep_stosNodePoper_input_base6kM_I_; text: .text%__1cRsalI_rReg_immNodeErule6kM_I_; text: .text%__1cJFieldTypeSskip_optional_size6FpnNsymbolOopDesc_pi_v_; text: .text%__1cMloadConPNodeHsize_of6kM_I_; -text: .text%__1cSCallLeafDirectNodeHtwo_adr6kM_I_; text: .text%__1cHnmethodVcleanup_inline_caches6M_v_; text: .text%__1cIGraphKitTcreate_and_xform_if6MpnENode_2ff_pnGIfNode__; -text: .text%__1cQsolaris_mprotect6FpcLi_i_: os_solaris.o; text: .text%__1cRaddI_rReg_memNodePoper_input_base6kM_I_; -text: .text%__1cHnmethodLis_unloaded6kM_i_; text: .text%__1cOGenerateOopMapHppstore6MpnNCellTypeState_i_v_; -text: .text%__1cIGraphKitXset_edges_for_java_call6MpnMCallJavaNode_i_v_; -text: .text%__1cTconvI2L_reg_memNodeMideal_Opcode6kM_i_; -text: .text%__1cHi2sNodeJnum_opnds6kM_I_; text: .text%__1cSconstMethodOopDescZchecked_exceptions_length6kM_i_; -text: .text%__1cHMatcherXadjust_incoming_stk_arg6Mi_i_; text: .text%__1cNIdealLoopTreeIset_nest6MI_i_; text: .text%__1cNIdealLoopTreeMcounted_loop6MpnOPhaseIdealLoop__v_; -text: .text%__1cRsubI_rReg_memNodeZcheck_for_anti_dependence6kM_i_; -text: .text%__1cIGraphKitZset_results_for_java_call6MpnMCallJavaNode__pnENode__; -text: .text%__1cTconvI2L_reg_memNodePoper_input_base6kM_I_; text: .text%__1cFStateM_sub_Op_CmpU6MpknENode__v_; text: .text%__1cLRethrowNodeKmatch_edge6kMI_I_; -text: .text%__1cKcopy_table6FppC1i_v_: interpreter.o; text: .text%__1cUBytecode_tableswitchOdest_offset_at6kMi_i_; text: .text%__1cNobjArrayKlassKcopy_array6MpnMarrayOopDesc_i2iipnGThread__v_; text: .text%__1cKTypeRawPtrFxmeet6kMpknEType__3_; -text: .text%__1cMVM_OperationVevaluate_at_safepoint6kM_i_; -text: .text%__1cMVM_OperationVevaluate_concurrently6kM_i_; -text: .text%__1cMVM_OperationSis_cheap_allocated6kM_i_; -text: .text%__1cXmembar_release_lockNodePoper_input_base6kM_I_; -text: .text%__1cRaddL_rReg_immNodePoper_input_base6kM_I_; -text: .text%__1cScompP_mem_rRegNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cJFieldTypeOget_array_info6FpnNsymbolOopDesc_pip2pnGThread__nJBasicType__; -text: .text%__1cJFieldTypeYis_valid_array_signature6FpnNsymbolOopDesc__i_; text: .text%__1cNincI_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIciObject2t6M_v_; text: .text%__1cPstoreImmI16NodePoper_input_base6kM_I_; -text: .text%__1cNinstanceKlassbDcheck_valid_for_instantiation6MipnGThread__v_; text: .text%__1cPClassFileParserbCverify_legal_class_modifiers6MipnGThread__v_; -text: .text%__1cQLibraryIntrinsicKis_virtual6kM_i_; text: .text%__1cPciObjectFactoryUget_empty_methodData6M_pnMciMethodData__; text: .text%__1cMciMethodData2t6M_v_; -text: .text%__1cPsarI_rReg_1NodePoper_input_base6kM_I_; text: .text%__1cNstoreImmBNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cFTypeDEhash6kM_i_; -text: .text%__1cMPrefetchNodeKmatch_edge6kMI_I_; -text: .text%__1cHCompileQcan_generate_C2I6MpnIciMethod_i_i_; text: .text%__1cPloadConUL32NodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cPciObjArrayKlassSis_obj_array_klass6M_i_; text: .text%__1cLOpaque1NodeEhash6kM_I_; -text: .text%__1cXmembar_release_lockNodeHtwo_adr6kM_I_; text: .text%JVM_GetMethodIxModifiers; text: .text%__1cJloadBNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cNandL_rRegNodeJnum_opnds6kM_I_; -text: .text%__1cNandL_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cFKlassMset_subklass6MpnMklassOopDesc__v_; text: .text%__1cTCallDynamicJavaNodeGOpcode6kM_i_; text: .text%__1cJloadINodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cKklassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cUCompressedReadStreamMraw_read_int6FrpC_i_; text: .text%__1cIHaltNodeEhash6kM_I_; text: .text%__1cNstoreImmINodePoper_input_base6kM_I_; text: .text%__1cLAccessFlagsPatomic_set_bits6Mi_v_; text: .text%__1cNinstanceKlassWcompute_modifier_flags6kMpnGThread__i_; -text: .text%__1cNinstanceKlassScopy_static_fields6MpnSPSPromotionManager__v_; -text: .text%__1cSinstanceKlassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cOcompL_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQVMOperationQdDueueLremove_next6M_pnMVM_Operation__; -text: .text%__1cQciTypeArrayKlassTis_type_array_klass6M_i_; text: .text%__1cRsubI_rReg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cFStateP_sub_Op_LShiftL6MpknENode__v_; text: .text%__1cLjmpConUNodeGnegate6M_v_; text: .text%__1cKcmpOpUOperGnegate6M_v_; -text: .text%__1cMrax_RegLOperJnum_edges6kM_I_; text: .text%__1cLGCTaskQdDueueKinitialize6M_v_; -text: .text%__1cJStealTask2t6Mi_v_; text: .text%__1cJStealTaskFdo_it6MpnNGCTaskManager_I_v_; text: .text%__1cTOldToYoungRootsTaskEname6M_pc_; text: .text%__1cTOldToYoungRootsTaskFdo_it6MpnNGCTaskManager_I_v_; text: .text%__1cNGCTaskManagerMnote_release6MI_v_; text: .text%__1cJStealTaskEname6M_pc_; text: .text%__1cSCardTableExtensionbAscavenge_contents_parallel6MpnQObjectStartArray_pnMMutableSpace_pnIHeapWord_pnSPSPromotionManager_I_v_; -text: .text%__1cFciEnvbAget_constant_by_index_impl6MpnPciInstanceKlass_i_nKciConstant__; text: .text%__1cQciBytecodeStreamMget_constant6M_nKciConstant__; -text: .text%__1cFciEnvVget_constant_by_index6MpnPciInstanceKlass_i_nKciConstant__; -text: .text%__1cJcmpOpOperFclone6kM_pnIMachOper__; text: .text%__1cMrep_stosNodeMideal_Opcode6kM_i_; -text: .text%__1cEhash6Fpkc1_I_; -text: .text%__1cQput_after_lookup6FnMsymbolHandle_0ppnLNameSigHash__i_; text: .text%__1cKJavaThreadLgc_epilogue6M_v_; text: .text%__1cKJavaThreadLgc_prologue6M_v_; text: .text%__1cTsize_java_to_interp6F_I_; text: .text%__1cUreloc_java_to_interp6F_I_; text: .text%__1cQinit_input_masks6FIrnHRegMask_1_p0_: matcher.o; -text: .text%__1cKOSRAdapterHoops_do6MpnKOopClosure__v_; -text: .text%__1cRCompilationPolicybIreset_counter_for_invocation_event6MnMmethodHandle__v_; text: .text%__1cRitableMethodEntryKinitialize6MpnNmethodOopDesc__v_; text: .text%__1cTcompareAndSwapLNodeMideal_Opcode6kM_i_; -text: .text%__1cNinstanceKlassPlink_class_impl6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cIGraphKitbBset_arguments_for_java_call6MpnMCallJavaNode__v_; text: .text%__1cNCallGeneratorCtf6kM_pknITypeFunc__; text: .text%__1cMloadConLNodeLbottom_type6kM_pknEType__; -text: .text%__1cKStoreBNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cNaddL_rRegNodeMideal_Opcode6kM_i_; -text: .text%__1cTcompareAndSwapLNodeJnum_opnds6kM_I_; text: .text%__1cFStateO_sub_Op_StoreI6MpknENode__v_; text: .text%__1cQleaPIdxScaleNodePoper_input_base6kM_I_; -text: .text%__1cNGrowableArray4CpnNmethodOopDesc__2t6Mii_v_; text: .text%__1cLklassVtableMget_mirandas6FpnNGrowableArray4CpnNmethodOopDesc___pnMklassOopDesc_pnPobjArrayOopDesc_8_v_; text: .text%__1cXJNI_ArgumentPusherVaArgKget_object6M_v_; text: .text%__1cNloadConP0NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFKlassKsuperklass6kM_pnNinstanceKlass__; -text: .text%__1cWstatic_stub_RelocationJpack_data6M_i_; -text: .text%__1cNsubL_rRegNodePoper_input_base6kM_I_; -text: .text%__1cbAjni_check_async_exceptions6FpnKJavaThread__v_: jni.o; -text: .text%__1cKJavaThreadbHcheck_and_handle_async_exceptions6Mi_v_; text: .text%__1cRsalI_rReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMindIndexOperNbase_position6kM_i_; text: .text%__1cMindIndexOperOindex_position6kM_i_; text: .text%__1cMindIndexOperNconstant_disp6kM_i_; -text: .text%__1cJLoadSNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cNGrowableArray4CpnOMethodLivenessKBasicBlock__2t6Mii_v_; text: .text%__1cKstoreINodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNCallGeneratorPfor_direct_call6FpnIciMethod__p0_; text: .text%__1cTDirectCallGeneratorIgenerate6MpnIJVMState__2_; text: .text%__1cMWarmCallInfoLalways_cold6F_p0_; text: .text%__1cFframeIpatch_pc6MpnGThread_pC_v_; text: .text%JVM_IsInterface; text: .text%__1cFKlassQset_next_sibling6MpnMklassOopDesc__v_; -text: .text%__1cJMultiNodeUdepends_only_on_test6kM_i_; text: .text%__1cRshrL_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQjmpCon_shortNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQjmpCon_shortNodeJlabel_set6MrnFLabel_I_v_; -text: .text%__1cKjmpConNodeUshort_branch_version6M_pnIMachNode__; -text: .text%__1cQjmpCon_shortNodeJis_Branch6kM_I_; -text: .text%__1cKJavaThreadNpd_last_frame6M_nFframe__; text: .text%__1cTStackWalkCompPolicyVfindTopInlinableFrame6MpnNGrowableArray4CpnGRFrame____2_; text: .text%__1cKJavaThreadQlast_java_vframe6MpnLRegisterMap__pnKjavaVFrame__; text: .text%__1cTStackWalkCompPolicyXmethod_invocation_event6MnMmethodHandle_pnGThread__v_; text: .text%__1cRInterpretedRFrame2t6MnFframe_pnKJavaThread_nMmethodHandle__v_; -text: .text%__1cNGrowableArray4CpnGRFrame__2t6Mii_v_; -text: .text%__1cKjavaVFrameNis_java_frame6kM_i_; -text: .text%__1cIVerifierRshould_verify_for6FpnHoopDesc__i_; -text: .text%__1cQciBytecodeStreamPget_klass_index6M_i_; text: .text%__1cRMachNullCheckNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cRMachNullCheckNode2t6MpnENode_2I_v_; text: .text%__1cRsarI_rReg_immNodeMideal_Opcode6kM_i_; -text: .text%__1cNMachIdealNodeJnum_opnds6kM_I_; -text: .text%__1cRMachSafePointNodePis_MachCallJava6M_pnQMachCallJavaNode__; text: .text%__1cKstorePNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cWImplicitExceptionTableGappend6MII_v_; text: .text%__1cHUNICODEHas_utf86FpHi_pc_; -text: .text%__1cMStartI2CNodeGOpcode6kM_i_; -text: .text%__1cKOSRAdapterMdo_unloading6MpnRBoolObjectClosure_pnKOopClosure_i_v_; -text: .text%__1cSvframeStreamCommonbHskip_method_invoke_and_aux_frames6M_v_; -text: .text%__1cNdecI_rRegNodeJnum_opnds6kM_I_; text: .text%__1cIMinINodeGOpcode6kM_i_; -text: .text%__1cNinstanceKlassbCfind_local_field_from_offset6kMiipnPfieldDescriptor__i_; -text: .text%__1cNinstanceKlassWfind_field_from_offset6kMiipnPfieldDescriptor__i_; -text: .text%__1cPciInstanceKlassTget_field_by_offset6Mii_pnHciField__; text: .text%__1cFArena2T6M_v_; text: .text%__1cKmethodOperJnum_edges6kM_I_; text: .text%__1cSconstMethodOopDescYchecked_exceptions_start6kM_pnXCheckedExceptionElement__; @@ -2780,66 +1770,37 @@ text: .text%__1cRsarL_rReg_immNodeMideal_Opcode6kM_i_; text: .text%__1cNstoreImmBNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cKstorePNodeFreloc6kM_i_; text: .text%__1cYCallStaticJavaDirectNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cYCallStaticJavaDirectNodeJnum_opnds6kM_I_; text: .text%__1cQleaPIdxScaleNodeErule6kM_I_; text: .text%__1cTciConstantPoolCacheGinsert6Mipv_v_; -text: .text%__1cNinstanceKlassXmark_dependent_nmethods6MpnMklassOopDesc__i_; -text: .text%__1cMvframeStream2t6MpnKJavaThread_i_v_; text: .text%__1cIGraphKitTuse_exception_state6MpnNSafePointNode__pnENode__; text: .text%__1cIGraphKitSclear_saved_ex_oop6FpnNSafePointNode__pnENode__; -text: .text%__1cNloadConI0NodeFclone6kM_pnENode__; -text: .text%__1cJimmI0OperFclone6kM_pnIMachOper__; -text: .text%__1cLCastP2LNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cMLinkResolverbBresolve_static_call_or_null6FnLKlassHandle_nMsymbolHandle_21_nMmethodHandle__; text: .text%__1cKcmpOpUOperNgreater_equal6kM_i_; text: .text%__1cPClassFileParserYparse_checked_exceptions6MpHInSconstantPoolHandle_pnGThread__1_; -text: .text%__1cXcopy_u2_with_conversion6FpH0i_v_: classFileParser.o; -text: .text%__1cENodeGis_Sub6M_pnHSubNode__; text: .text%__1cJAssemblerFtestq6MpnMRegisterImpl_2_v_; text: .text%__1cJCMoveNodeLis_cmove_id6FpnOPhaseTransform_pnENode_44pnIBoolNode__4_; text: .text%__1cZresource_reallocate_bytes6FpcLL_0_; text: .text%__1cKstoreINodeFreloc6kM_i_; -text: .text%__1cLsymbolKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cQciBytecodeStreamJget_klass6Mri_pnHciKlass__; -text: .text%__1cKMemBarNode2t6M_v_; text: .text%__1cIDivINodeGOpcode6kM_i_; -text: .text%__1cFframeRis_compiled_frame6kMpi_i_; -text: .text%__1cPCallRuntimeNodeOis_CallRuntime6kM_pk0_; text: .text%__1cPshrI_rReg_1NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMorI_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFParseQarray_addressing6MnJBasicType_ippknEType__pnENode__; text: .text%__1cPsalI_rReg_1NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cHciField2t6MpnPfieldDescriptor__v_; -text: .text%__1cIAddLNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cIModINodeGOpcode6kM_i_; text: .text%__1cNmulL_rRegNodeErule6kM_I_; -text: .text%__1cSsafePoint_pollNodeHtwo_adr6kM_I_; -text: .text%__1cDCHAManalyze_call6FnLKlassHandle_11nMsymbolHandle_2_pnJCHAResult__; -text: .text%__1cJCHAResult2t6MnLKlassHandle_nMsymbolHandle_2pnNGrowableArray4n0B___pnNGrowableArray4nMmethodHandle___n0E_i_v_; text: .text%__1cMLinkResolverbCresolve_virtual_call_or_null6FnLKlassHandle_1nMsymbolHandle_21_nMmethodHandle__; -text: .text%__1cJCHAResultOis_monomorphic6kM_i_; -text: .text%__1cIciMethodXfind_monomorphic_target6MpnHciKlass_22_p0_; -text: .text%__1cQconstMethodKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cKMemBarNodeJis_MemBar6kM_pk0_; -text: .text%__1cIGraphKitOinsert_mem_bar6MpnKMemBarNode__v_; -text: .text%__1cHi2sNodeHtwo_adr6kM_I_; text: .text%__1cJCodeCacheMfind_nmethod6Fpv_pnHnmethod__; text: .text%__1cLConvL2INodeLbottom_type6kM_pknEType__; text: .text%__1cMLinkResolverbCresolve_special_call_or_null6FnLKlassHandle_nMsymbolHandle_21_nMmethodHandle__; -text: .text%__1cNIdealLoopTreeObeautify_loops6MpnOPhaseIdealLoop__i_; text: .text%__1cScompP_mem_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKstoreBNodePoper_input_base6kM_I_; text: .text%__1cRandI_rReg_immNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cSCallLeafDirectNodeRis_safepoint_node6kM_i_; text: .text%__1cJloadLNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cSCallLeafDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cKMemBarNodeJideal_reg6kM_I_; -text: .text%__1cJloadSNodeHtwo_adr6kM_I_; text: .text%__1cVConstantOopWriteValueIwrite_on6MpnUDebugInfoWriteStream__v_; text: .text%__1cUDebugInfoWriteStreamMwrite_handle6MpnI_jobject__v_; -text: .text%__1cLmethodKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cNaddI_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cJlog2_long6Fx_i_; text: .text%__1cTconvL2I_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIGraphKitPpush_pair_local6Mi_v_; text: .text%__1cOjmpLoopEndNodePoper_input_base6kM_I_; @@ -2852,131 +1813,74 @@ text: .text%__1cHCmpNodeGadd_id6kM_pknEType__; text: .text%JVM_InternString; text: .text%__1cLStringTableGintern6FpnHoopDesc_pnGThread__2_; text: .text%__1cFKlassQup_cast_abstract6M_p0_; -text: .text%__1cNGrowableArray4CpnENode__2t6Mii_v_; -text: .text%__1cPCheckCastPPNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cSInterpreterRuntimeMmonitorenter6FpnKJavaThread_pnPBasicObjectLock__v_; text: .text%__1cSCountedLoopEndNodeKstride_con6kM_i_; -text: .text%__1cTconvI2L_reg_memNodeJnum_opnds6kM_I_; text: .text%__1cPCheckCastPPNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cPClassFileStreamHskip_u26MipnGThread__v_; text: .text%__1cLOpaque1NodeLbottom_type6kM_pknEType__; text: .text%__1cOPhaseIdealLoopRsplit_thru_region6MpnENode_2_2_; -text: .text%__1cFTypeFCeq6kMpknEType__i_; -text: .text%__1cNmethodOopDescOis_initializer6kM_i_; text: .text%__1cFciEnvRfind_system_klass6MpnIciSymbol__pnHciKlass__; text: .text%__1cNandL_rRegNodeErule6kM_I_; text: .text%__1cQjmpDir_shortNodeJlabel_set6MrnFLabel_I_v_; text: .text%__1cQjmpDir_shortNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cKjmpDirNodeUshort_branch_version6M_pnIMachNode__; -text: .text%__1cQjmpDir_shortNodeJis_Branch6kM_I_; text: .text%__1cLBlock_ArrayEgrow6MI_v_; -text: .text%__1cOtypeArrayKlassQarray_klass_impl6MiipnGThread__pnMklassOopDesc__; -text: .text%__1cSCompareAndSwapNodeLbottom_type6kM_pknEType__; -text: .text%__1cOtypeArrayKlassQarray_klass_impl6FnUtypeArrayKlassHandle_iipnGThread__pnMklassOopDesc__; text: .text%__1cMPhaseChaitinVfind_base_for_derived6MppnENode_2rI_2_; text: .text%__1cSindIndexOffsetOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cSindIndexOffsetOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cNGrowableArray4CI_Egrow6Mi_v_; -text: .text%__1cHMatcherMreturn_value6Fii_nLOptoRegPair__; text: .text%__1cFStateP_sub_Op_ConvI2L6MpknENode__v_; -text: .text%__1cOjmpLoopEndNodeGpinned6kM_i_; -text: .text%__1cNxorI_rRegNodePoper_input_base6kM_I_; -text: .text%__1cJCHAResultSmonomorphic_target6kM_nMmethodHandle__; text: .text%__1cNsubI_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cPCountedLoopNodeNstride_is_con6kM_i_; text: .text%__1cRcmpFastUnlockNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cbBjava_lang_ref_SoftReferenceJtimestamp6FpnHoopDesc__x_; -text: .text%__1cQLRUMaxHeapPolicyWshould_clear_reference6MpnHoopDesc__i_; -text: .text%__1cLcastP2LNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPcheckCastPPNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cPciInstanceKlassLfind_method6MpnIciSymbol_2_pnIciMethod__; -text: .text%__1cZCallInterpreterDirectNodeMideal_Opcode6kM_i_; text: .text%__1cILoopNodeHsize_of6kM_I_; text: .text%__1cSindIndexOffsetOperFscale6kM_i_; -text: .text%__1cMjniIdSupportNto_method_oop6FpnK_jmethodID__pnNmethodOopDesc__; text: .text%__1cLBoxLockNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cRSignatureIterator2t6MpnGThread_pnNsymbolOopDesc__v_; -text: .text%__1cRaddI_rReg_memNodeJnum_opnds6kM_I_; -text: .text%__1cFKlassQoop_is_typeArray6kM_i_; -text: .text%__1cGOopMapPset_derived_oop6Miiii_v_; text: .text%__1cKstoreBNodeMideal_Opcode6kM_i_; text: .text%__1cHi2bNodeErule6kM_I_; text: .text%__1cFStateN_sub_Op_LoadI6MpknENode__v_; -text: .text%__1cMloadConDNodePoper_input_base6kM_I_; text: .text%__1cPCountedLoopNodeJinit_trip6kM_pnENode__; text: .text%__1cICmpLNodeDsub6kMpknEType_3_3_; text: .text%__1cRjmpConU_shortNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cRjmpConU_shortNodeMideal_Opcode6kM_i_; -text: .text%__1cMloadConDNodeHtwo_adr6kM_I_; -text: .text%__1cHnmethodKpc_desc_at6MpC_pnGPcDesc__; -text: .text%__1cJrRegPOperFclone6kM_pnIMachOper__; -text: .text%__1cFParseNpush_constant6MnKciConstant__i_; -text: .text%__1cMrep_stosNodeJnum_opnds6kM_I_; text: .text%__1cOClearArrayNodeKmatch_edge6kMI_I_; text: .text%__1cUvisit_all_interfaces6FpnPobjArrayOopDesc_pnXInterfaceVisiterClosure__v_; text: .text%__1cXmembar_release_lockNodeLbottom_type6kM_pknEType__; text: .text%__1cPThreadLocalNodeJideal_reg6kM_I_; -text: .text%__1cPstoreImmI16NodeJnum_opnds6kM_I_; text: .text%__1cTleaPIdxScaleOffNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cIGraphKitbMset_predefined_output_for_runtime_call6MpnENode_pnMMergeMemNode__v_; -text: .text%__1cFKlassXsearch_secondary_supers6kMpnMklassOopDesc__i_; text: .text%__1cPsarI_rReg_1NodeErule6kM_I_; text: .text%__1cOPhaseIdealLoopPis_counted_loop6MpnENode_pnNIdealLoopTree__2_; -text: .text%__1cIGraphKitOhas_ex_handler6M_i_; text: .text%__1cMloadConDNodeErule6kM_I_; text: .text%__1cHCompileQsync_stack_slots6kM_i_; text: .text%__1cNMemoryServiceXtrack_memory_pool_usage6FpnKMemoryPool__v_; -text: .text%__1cMURShiftLNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cKoopFactoryTnew_system_objArray6FipnGThread__pnPobjArrayOopDesc__; text: .text%__1cNdecI_rRegNodeHtwo_adr6kM_I_; -text: .text%__1cPClassFileParserbHparse_constant_pool_integer_entry6MnSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cTDebugInfoReadStream2t6MpknHnmethod_i_v_; -text: .text%__1cRsalI_rReg_immNodeJnum_opnds6kM_I_; text: .text%__1cJScopeDescJstream_at6kMi_pnTDebugInfoReadStream__; text: .text%__1cVjava_lang_ClassLoaderGparent6FpnHoopDesc__2_; text: .text%__1cIPhaseIFGEinit6MI_v_; -text: .text%__1cMPhaseChaitinQgather_lrg_masks6Mi_v_; text: .text%__1cJPhaseLiveHcompute6MI_v_; text: .text%JVM_GetCPClassNameUTF; text: .text%__1cMLinkResolverUresolve_invokestatic6FrnICallInfo_nSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cNstoreImmINodeJnum_opnds6kM_I_; -text: .text%__1cITypeNodeHis_Type6M_p0_; text: .text%__1cHRetNodePoper_input_base6kM_I_; -text: .text%__1cLCastP2LNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%jni_GetStringLength: jni.o; text: .text%__1cPloadConUL32NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cOFastUnlockNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cPciObjArrayKlassNelement_klass6M_pnHciKlass__; -text: .text%__1cNprefetchwNodeHtwo_adr6kM_I_; -text: .text%__1cNnmethodLocker2T6M_v_; text: .text%__1cKoopFactoryYnew_permanent_shortArray6FipnGThread__pnQtypeArrayOopDesc__; -text: .text%__1cKstoreCNodeHtwo_adr6kM_I_; -text: .text%__1cQleaPIdxScaleNodeJnum_opnds6kM_I_; text: .text%__1cNaddL_rRegNodeMcisc_operand6kM_i_; text: .text%__1cOcompL_rRegNodeQuse_cisc_RegMask6M_v_; -text: .text%__1cTDebugInfoReadStreamLread_handle6M_nGHandle__; -text: .text%__1cJScopeDesc2t6MpknHnmethod_i_v_; text: .text%__1cFStateR_sub_Op_LoadRange6MpknENode__v_; text: .text%__1cOcompiledVFrame2t6MpknFframe_pknLRegisterMap_pnKJavaThread_pnJScopeDesc__v_; text: .text%__1cOcompU_rRegNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cPcmovI_reg_gNodePoper_input_base6kM_I_; -text: .text%__1cLProfileDataSis_VirtualCallData6M_i_; -text: .text%__1cSmembar_acquireNodePoper_input_base6kM_I_; text: .text%__1cNsubL_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cJMarkSweepMfollow_stack6F_v_; -text: .text%__1cNnmethodLocker2t6MpnHnmethod__v_; text: .text%__1cNloadRangeNodeFreloc6kM_i_; -text: .text%__1cNGrowableArray4CpnKciTypeFlowJJsrRecord__2t6Miirk2i_v_; text: .text%__1cTcompareAndSwapLNodeErule6kM_I_; text: .text%__1cZCallDynamicJavaDirectNodeMideal_Opcode6kM_i_; -text: .text%__1cMURShiftINodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cOcompiledVFrameGis_top6kM_i_; text: .text%__1cSInterpreterRuntimeLmonitorexit6FpnKJavaThread_pnPBasicObjectLock__v_; text: .text%__1cNxorI_rRegNodeMideal_Opcode6kM_i_; -text: .text%__1cRshrI_rReg_immNodeJnum_opnds6kM_I_; text: .text%__1cKciTypeFlow2t6MpnFciEnv_pnIciMethod_i_v_; -text: .text%__1cKciTypeFlowXmark_known_range_starts6M_v_; -text: .text%__1cKciTypeFlowLfind_ranges6M_v_; text: .text%__1cSFixupMirrorClosureJdo_object6MpnHoopDesc__v_; text: .text%__1cKciTypeFlowKmap_blocks6M_v_; text: .text%__1cKciTypeFlowHdo_flow6M_v_; @@ -2984,12 +1888,9 @@ text: .text%__1cKciTypeFlowPget_start_state6M_pkn0ALStateVector__; text: .text%__1cKciTypeFlowKflow_types6M_v_; text: .text%__1cIAndINodeGadd_id6kM_pknEType__; text: .text%__1cMURShiftINodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cJloadBNodeHtwo_adr6kM_I_; text: .text%__1cKPSYoungGenRcapacity_in_bytes6kM_L_; -text: .text%__1cHMonitorGnotify6M_i_; text: .text%__1cYciExceptionHandlerStreamPcount_remaining6M_i_; text: .text%__1cFParseXcatch_inline_exceptions6MpnNSafePointNode__v_; -text: .text%__1cHMatcherNfind_receiver6Fi_i_; text: .text%__1cMciMethodDataJload_data6M_v_; text: .text%__1cIciMethodJload_code6M_v_; text: .text%__1cJCmpL3NodeGOpcode6kM_i_; @@ -3000,14 +1901,9 @@ text: .text%__1cOGenerateOopMapGdo_ldc6Mii_v_; text: .text%__1cMTypeKlassPtrFxdual6kM_pknEType__; text: .text%__1cIMaxINodeGOpcode6kM_i_; text: .text%__1cOPhaseTransform2t6MnFPhaseLPhaseNumber__v_; -text: .text%__1cPsalI_rReg_1NodeJnum_opnds6kM_I_; text: .text%__1cQSystemDictionarybAcompute_loader_lock_object6FnGHandle_pnGThread__1_; -text: .text%__1cHciKlassMis_interface6M_i_; -text: .text%__1cPmethodDataKlassRoop_is_methodData6kM_i_; text: .text%__1cIMulLNodeGadd_id6kM_pknEType__; -text: .text%__1cJloadCNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQSystemDictionaryRpreloaded_oops_do6FpnKOopClosure__v_; -text: .text%__1cIVMThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cLJvmtiExportHoops_do6FpnKOopClosure__v_; text: .text%__1cMFlatProfilerHoops_do6FpnKOopClosure__v_; text: .text%__1cQVMOperationQdDueueHoops_do6MpnKOopClosure__v_; @@ -3020,83 +1916,55 @@ text: .text%__1cQPlaceholderTableHoops_do6MpnKOopClosure__v_; text: .text%__1cNThreadServiceHoops_do6FpnKOopClosure__v_; text: .text%__1cKJNIHandlesHoops_do6FpnKOopClosure__v_; text: .text%__1cXJvmtiCurrentBreakpointsHoops_do6FpnKOopClosure__v_; -text: .text%__1cIUniverseHoops_do6FpnKOopClosure_i_v_; text: .text%__1cbGJvmtiVMObjectAllocEventCollectorXoops_do_for_all_threads6FpnKOopClosure__v_; text: .text%__1cRindIndexScaleOperJnum_edges6kM_I_; text: .text%__1cRindIndexScaleOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cKstoreBNodeJnum_opnds6kM_I_; text: .text%__1cNSignatureInfoJdo_double6M_v_; text: .text%__1cJAssemblerEmovl6MnHAddress_pnMRegisterImpl__v_; text: .text%__1cRsalI_rReg_immNodeHtwo_adr6kM_I_; text: .text%__1cMrdx_RegIOperEtype6kM_pknEType__; text: .text%__1cMciMethodData2t6MnQmethodDataHandle__v_; -text: .text%__1cSmembar_acquireNodeHtwo_adr6kM_I_; text: .text%__1cRshrI_rReg_immNodeHtwo_adr6kM_I_; -text: .text%__1cKJNIHandlesLmake_global6FnGHandle_i_pnI_jobject__; text: .text%jni_ExceptionOccurred: jni.o; text: .text%jni_SetObjectArrayElement: jni.o; -text: .text%__1cSCompareAndSwapNodeKmatch_edge6kMI_I_; text: .text%__1cISubINodeJideal_reg6kM_I_; -text: .text%__1cRMachSafePointNodeGpinned6kM_i_; -text: .text%__1cIimmIOperFclone6kM_pnIMachOper__; -text: .text%__1cMloadConINodeFclone6kM_pnENode__; text: .text%__1cICodeHeapIallocate6ML_pv_; text: .text%__1cICodeHeapPsearch_freelist6ML_pnJFreeBlock__; -text: .text%__1cbACallCompiledJavaDirectNodeMideal_Opcode6kM_i_; text: .text%__1cPcmpFastLockNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cLCastP2LNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cNmulL_rRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cJLoadBNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cVmerge_point_too_heavy6FpnHCompile_pnENode__i_: loopopts.o; text: .text%jni_GetByteArrayRegion: jni.o; -text: .text%__1cFParseKdo_put_xxx6MpknHTypePtr_pnENode_pnHciField_i_v_; -text: .text%__1cHnmethodOis_java_method6kM_i_; text: .text%__1cQjava_lang_StringLutf8_length6FpnHoopDesc__i_; text: .text%__1cQjava_lang_StringOas_utf8_string6FpnHoopDesc_ii_pc_; text: .text%jni_GetStringUTFRegion: jni.o; text: .text%jni_GetStringUTFLength: jni.o; text: .text%__1cOMacroAssemblerWbang_stack_with_offset6Mi_v_; -text: .text%__1cRsarL_rReg_immNodePoper_input_base6kM_I_; text: .text%__1cScompU_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cFciEnvZcheck_klass_accessibility6MpnHciKlass_pnMklassOopDesc__i_; -text: .text%__1cIciObjectMis_obj_array6M_i_; -text: .text%__1cOLibraryCallKitOgenerate_guard6MpnENode_pnKRegionNode_f_v_; text: .text%__1cMoutputStream2t6Mi_v_; text: .text%__1cMstringStreamJas_string6M_pc_; text: .text%__1cMstringStream2t6ML_v_; text: .text%__1cJloadINodeFreloc6kM_i_; text: .text%__1cMstringStream2T6M_v_; text: .text%__1cOMethodLivenessKBasicBlockJstore_two6Mi_v_; -text: .text%__1cJloadINodeIpeephole6MpnFBlock_ipnNPhaseRegAlloc_ri_pnIMachNode__; -text: .text%__1cTconvL2I_reg_regNodeJnum_opnds6kM_I_; text: .text%__1cPClassFileParserXverify_legal_class_name6MnMsymbolHandle_pnGThread__v_; -text: .text%__1cRandI_rReg_immNodeJnum_opnds6kM_I_; text: .text%__1cOAbstractICacheQinvalidate_range6FpCi_v_; text: .text%__1cOAbstractICachePcall_flush_stub6FpCi_v_; text: .text%__1cICodeBlobMset_oop_maps6MpnJOopMapSet__v_; text: .text%__1cRClassPathZipEntryLopen_stream6Mpkc_pnPClassFileStream__; text: .text%__1cJCodeCacheIallocate6Fi_pnICodeBlob__; -text: .text%__1cIGraphKitOmake_slow_call6MpknITypeFunc_pCpkcpnENode_88_8_; text: .text%__1cICodeHeapPfollowing_block6MpnJFreeBlock__2_; text: .text%__1cOClearArrayNodeLbottom_type6kM_pknEType__; -text: .text%__1cPshrI_rReg_1NodeJnum_opnds6kM_I_; text: .text%__1cEDictIdoubhash6M_v_; -text: .text%__1cTleaPIdxScaleOffNodeLbottom_type6kM_pknEType__; text: .text%__1cIProjNodeJideal_reg6kM_I_; text: .text%__1cHi2sNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLimmI_16OperJnum_edges6kM_I_; -text: .text%__1cUmembar_cpu_orderNodePoper_input_base6kM_I_; text: .text%__1cPfieldDescriptorRint_initial_value6kM_i_; -text: .text%__1cTCallInterpreterNodeGOpcode6kM_i_; text: .text%__1cMloadConLNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRaddL_rReg_immNodeErule6kM_I_; text: .text%__1cJLoadLNodeJideal_reg6kM_I_; -text: .text%__1cTleaPIdxScaleOffNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cHCompileTset_cached_top_node6MpnENode__v_; text: .text%__1cENodeMsetup_is_top6M_v_; text: .text%__1cIGotoNodeGOpcode6kM_i_; text: .text%__1cOMachPrologNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cHCompilePneed_stack_bang6kMi_i_; text: .text%__1cKBranchDataPpost_initialize6MpnOBytecodeStream_pnRmethodDataOopDesc__v_; text: .text%__1cNFingerprinterIdo_array6Mii_v_; text: .text%jni_GetArrayLength: jni.o; @@ -3104,46 +1972,25 @@ text: .text%__1cJloadSNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cKReturnNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cSInterpreterRuntimeE_new6FpnKJavaThread_pnTconstantPoolOopDesc_i_v_; text: .text%__1cMorI_rRegNodeHtwo_adr6kM_I_; -text: .text%__1cKTypeRawPtrFempty6kM_i_; -text: .text%__1cHRetNodeGpinned6kM_i_; -text: .text%__1cHRetNodeHtwo_adr6kM_I_; text: .text%__1cPsalI_rReg_1NodeHtwo_adr6kM_I_; text: .text%__1cNinstanceKlassVadd_dependent_nmethod6MpnHnmethod__v_; text: .text%__1cHRetNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPGlobalTLABStatsKinitialize6M_v_; -text: .text%__1cbBjava_lang_ref_SoftReferenceJset_clock6Fx_v_; -text: .text%__1cUParallelScavengeHeapTensure_parseability6M_v_; text: .text%__1cTDerivedPointerTableFclear6F_v_; -text: .text%__1cNMemoryServiceGgc_end6Fi_v_; -text: .text%__1cSReferenceProcessorQprocess_phaseJNI6M_v_; text: .text%__1cRLowMemoryDetectorRdetect_low_memory6F_v_; -text: .text%__1cSReferenceProcessorbDenqueue_discovered_references6M_i_; -text: .text%__1cSReferenceProcessorbDprocess_discovered_references6M_v_; text: .text%__1cNCollectedHeapbFaccumulate_statistics_all_tlabs6M_v_; text: .text%__1cTDerivedPointerTablePupdate_pointers6F_v_; -text: .text%__1cNCollectedHeapTensure_parseability6M_v_; -text: .text%__1cNCollectedHeapOfill_all_tlabs6M_v_; text: .text%__1cKDictionaryHoops_do6MpnKOopClosure__v_; -text: .text%__1cSReferenceProcessorbBenqueue_discovered_reflists6MppnHoopDesc__v_; text: .text%__1cWThreadLocalAllocBufferbFaccumulate_statistics_before_gc6F_v_; -text: .text%__1cSReferenceProcessorOprocess_phase16MppnHoopDesc_pnPReferencePolicy_pnRBoolObjectClosure_pnKOopClosure_pnLVoidClosure__v_; text: .text%__1cQLRUMaxHeapPolicy2t6M_v_; -text: .text%__1cPGCMemoryManagerIgc_begin6M_v_; -text: .text%__1cPGCMemoryManagerGgc_end6M_v_; text: .text%__1cVLoaderConstraintTableHoops_do6MpnKOopClosure__v_; text: .text%__1cUParallelScavengeHeapbFaccumulate_statistics_all_tlabs6M_v_; text: .text%__1cKPSYoungGenPupdate_counters6M_v_; -text: .text%__1cXjava_lang_ref_ReferenceRpending_list_addr6F_ppnHoopDesc__; text: .text%__1cNMemoryServiceStrack_memory_usage6F_v_; text: .text%__1cQSystemDictionaryHoops_do6FpnKOopClosure__v_; -text: .text%__1cNMemoryServiceIgc_begin6Fi_v_; -text: .text%__1cUParallelScavengeHeapOfill_all_tlabs6M_v_; text: .text%__1cXTraceMemoryManagerStats2T6M_v_; -text: .text%__1cXTraceMemoryManagerStats2t6Mi_v_; text: .text%__1cUParallelScavengeHeapPupdate_counters6M_v_; -text: .text%__1cQPlaceholderTableJnew_entry6MipnNsymbolOopDesc_pnHoopDesc__pnQPlaceholderEntry__; text: .text%__1cQPlaceholderTableMremove_entry6MiInMsymbolHandle_nGHandle__v_; -text: .text%__1cQPlaceholderTableJadd_entry6MiInMsymbolHandle_nGHandle__v_; text: .text%__1cNCollectedHeapQresize_all_tlabs6M_v_; text: .text%__1cUParallelScavengeHeapQresize_all_tlabs6M_v_; text: .text%__1cWThreadLocalAllocBufferQresize_all_tlabs6F_v_; @@ -3152,80 +1999,53 @@ text: .text%__1cYGCAdaptivePolicyCountersbBupdate_counters_from_policy6M_v_; text: .text%__1cbAPSGCAdaptivePolicyCountersbBupdate_counters_from_policy6M_v_; text: .text%__1cNmethodOopDescbEfast_exception_handler_bci_for6MnLKlassHandle_ipnGThread__i_; text: .text%__1cSInterpreterRuntimebFexception_handler_for_exception6FpnKJavaThread_pnHoopDesc__pC_; -text: .text%__1cNaddL_rRegNodeJnum_opnds6kM_I_; -text: .text%__1cNaddL_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cKstoreLNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cUPSAdaptiveSizePolicyZdecay_supplemental_growth6Mi_v_; text: .text%__1cUPSAdaptiveSizePolicybPeden_increment_with_supplement_aligned_up6ML_L_; -text: .text%__1cUPSAdaptiveSizePolicyQdecaying_gc_cost6kM_d_; -text: .text%__1cUPSAdaptiveSizePolicybDcompute_generation_free_space6MLLLLLLLi_v_; text: .text%__1cIPSOldGenMmax_gen_size6M_L_; text: .text%__1cUPSAdaptiveSizePolicybHclear_generation_free_space_flags6M_v_; text: .text%__1cUPSAdaptiveSizePolicyOeden_increment6MLI_L_; -text: .text%__1cUPSAdaptiveSizePolicyVadjust_for_throughput6MipL1_v_; text: .text%__1cQSystemDictionaryTload_instance_class6FnMsymbolHandle_nGHandle_pnGThread__nTinstanceKlassHandle__; -text: .text%__1cUmembar_cpu_orderNodeHtwo_adr6kM_I_; text: .text%__1cPjava_lang_ClassNcreate_mirror6FnLKlassHandle_pnGThread__pnHoopDesc__; -text: .text%__1cLklassVtableRinitialize_vtable6MpnGThread__v_; text: .text%__1cJAssemblerDjmp6MrnFLabel_nJrelocInfoJrelocType__v_; text: .text%__1cPshrI_rReg_1NodeHtwo_adr6kM_I_; text: .text%__1cRmulI_rReg_immNodeMideal_Opcode6kM_i_; -text: .text%__1cNandI_rRegNodePoper_input_base6kM_I_; text: .text%__1cOMachEpilogNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cLklassVtableVinitialize_from_super6MnLKlassHandle__i_; text: .text%__1cIVMThreadHexecute6FpnMVM_Operation__v_; text: .text%__1cLklassVtableOcopy_vtable_to6MpnLvtableEntry__v_; text: .text%__1cQinstanceRefKlassZacquire_pending_list_lock6FpnJBasicLock__v_; -text: .text%__1cQinstanceRefKlassbKrelease_and_notify_pending_list_lock6FipnJBasicLock__v_; text: .text%__1cPVM_GC_OperationbKrelease_and_notify_pending_list_lock6M_v_; -text: .text%__1cPVM_GC_OperationOskip_operation6kM_i_; -text: .text%__1cPVM_GC_OperationNdoit_prologue6M_i_; text: .text%__1cPVM_GC_OperationZacquire_pending_list_lock6M_v_; text: .text%__1cMTypeKlassPtrFxmeet6kMpknEType__3_; text: .text%__1cKReturnNodeEhash6kM_I_; -text: .text%__1cHnmethodVis_dependent_on_entry6MpnMklassOopDesc_2pnNmethodOopDesc__i_; -text: .text%__1cbDVM_ParallelGCFailedAllocation2t6MLiiI_v_; text: .text%__1cLlog2_intptr6Fl_i_; text: .text%__1cKKlass_vtbl2n6FLrnLKlassHandle_ipnGThread__pv_; text: .text%__1cFKlassVbase_create_klass_oop6FrnLKlassHandle_irknKKlass_vtbl_pnGThread__pnMklassOopDesc__; text: .text%__1cFKlassRinitialize_supers6MpnMklassOopDesc_pnGThread__v_; -text: .text%__1cMloadConPNodeFclone6kM_pnENode__; -text: .text%__1cIimmPOperFclone6kM_pnIMachOper__; text: .text%__1cFKlassRbase_create_klass6FrnLKlassHandle_irknKKlass_vtbl_pnGThread__1_; text: .text%__1cSCallLeafDirectNodeKmethod_set6Ml_v_; text: .text%__1cJcmpOpOperJnot_equal6kM_i_; text: .text%__1cJloadLNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cRAbstractAssemblerbDgenerate_stack_overflow_check6Mi_v_; -text: .text%__1cCosOunguard_memory6FpcL_i_; text: .text%__1cNandL_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cLLShiftINodeJideal_reg6kM_I_; -text: .text%__1cRsarI_rReg_immNodePoper_input_base6kM_I_; -text: .text%__1cGThreadRis_Watcher_thread6kM_i_; text: .text%__1cJLoadSNodeJideal_reg6kM_I_; -text: .text%__1cTconvL2I_reg_regNodeHtwo_adr6kM_I_; text: .text%__1cIPhaseIFGISquareUp6M_v_; text: .text%__1cPciObjectFactoryMvm_symbol_at6Fi_pnIciSymbol__; text: .text%__1cCosJyield_all6Fi_v_; -text: .text%__1cKciTypeFlowLStateVectorOmeet_exception6MpnPciInstanceKlass_pk1_i_; text: .text%__1cCosbCmake_polling_page_unreadable6F_v_; -text: .text%__1cONMethodSweeperFsweep6F_v_; text: .text%__1cSObjectSynchronizerVdeflate_idle_monitors6F_v_; text: .text%__1cMCounterDecayFdecay6F_v_; -text: .text%__1cCosOprotect_memory6FpcL_i_; text: .text%__1cORuntimeServiceWrecord_safepoint_begin6F_v_; text: .text%__1cORuntimeServicebDrecord_safepoint_synchronized6F_v_; text: .text%__1cCosXserialize_thread_states6F_v_; text: .text%__1cUSafepointSynchronizeFbegin6F_v_; -text: .text%__1cUSafepointSynchronizeRis_cleanup_needed6F_i_; text: .text%__1cUSafepointSynchronizeQdo_cleanup_tasks6F_v_; -text: .text%__1cRInlineCacheBufferIis_empty6F_i_; text: .text%__1cRInlineCacheBufferUupdate_inline_caches6F_v_; -text: .text%__1cTAbstractInterpreterRnotice_safepoints6F_v_; text: .text%__1cNloadConP0NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cCosbAmake_polling_page_readable6F_v_; text: .text%__1cORuntimeServiceUrecord_safepoint_end6F_v_; text: .text%__1cUSafepointSynchronizeDend6F_v_; -text: .text%__1cTAbstractInterpreterRignore_safepoints6F_v_; text: .text%__1cQVMOperationQdDueueGinsert6MpnMVM_Operation_2_v_; text: .text%__1cQVMOperationQdDueueGunlink6MpnMVM_Operation__v_; text: .text%__1cMVM_OperationIevaluate6M_v_; @@ -3235,38 +2055,20 @@ text: .text%__1cQVMOperationQdDueueOqueue_add_back6MipnMVM_Operation__v_; text: .text%__1cGThreadMget_priority6Fpk0_nOThreadPriority__; text: .text%__1cCosTget_native_priority6FpknGThread_pi_nIOSReturn__; text: .text%__1cIVMThreadSevaluate_operation6MpnMVM_Operation__v_; -text: .text%__1cQVMOperationQdDueueDadd6MpnMVM_Operation__i_; text: .text%__1cSmembar_releaseNodeLbottom_type6kM_pknEType__; text: .text%__1cCosGrandom6F_l_; -text: .text%__1cNget_next_hash6F_l_: synchronizer.o; -text: .text%__1cNJvmtiGCMarker2t6Mi_v_; text: .text%__1cPVM_GC_OperationNdoit_epilogue6M_v_; -text: .text%__1cKPSScavengeXshould_attempt_scavenge6F_i_; -text: .text%__1cKPSScavengeQinvoke_no_policy6Fpi_i_; text: .text%__1cPGlobalTLABStatsHpublish6M_v_; text: .text%__1cUinitialize_hashtable6FppnLNameSigHash__v_; -text: .text%__1cPclear_hashtable6FppnLNameSigHash__v_; -text: .text%__1cQciBytecodeStreamUis_unresolved_string6kM_i_; -text: .text%__1cFciEnvUis_unresolved_string6kMpnPciInstanceKlass_i_i_; -text: .text%__1cFciEnvZis_unresolved_string_impl6kMpnNinstanceKlass_i_i_; text: .text%__1cNtestP_regNodeFreloc6kM_i_; -text: .text%__1cNSCMemProjNodeGis_CFG6kM_i_; -text: .text%__1cKPSScavengeGinvoke6Fpi_v_; -text: .text%__1cUParallelScavengeHeapTfailed_mem_allocate6MpiLii_pnIHeapWord__; -text: .text%__1cbDVM_ParallelGCFailedAllocationEname6kM_pkc_; text: .text%__1cbDVM_ParallelGCFailedAllocationEdoit6M_v_; text: .text%__1cKDictionaryJnew_entry6MIpnMklassOopDesc_pnHoopDesc__pnPDictionaryEntry__; text: .text%__1cKDictionaryJadd_klass6MnMsymbolHandle_nGHandle_nLKlassHandle__v_; text: .text%__1cQSystemDictionaryRupdate_dictionary6FiIiInTinstanceKlassHandle_nGHandle_pnGThread__v_; -text: .text%__1cQSystemDictionaryRcheck_constraints6FiInTinstanceKlassHandle_nGHandle_pnGThread__v_; text: .text%__1cQSystemDictionaryQfind_placeholder6FiInMsymbolHandle_nGHandle__pnNsymbolOopDesc__; -text: .text%__1cVLoaderConstraintTablePcheck_or_update6MnTinstanceKlassHandle_nGHandle_nMsymbolHandle__pkc_; text: .text%__1cKoopFactoryXnew_permanent_byteArray6FipnGThread__pnQtypeArrayOopDesc__; -text: .text%__1cNIdealLoopTreeTcheck_inner_safepts6MpnOPhaseIdealLoop__v_; text: .text%__1cPsarI_rReg_1NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKciTypeFlowPflow_exceptions6MpnNGrowableArray4Cpn0AFBlock___pnNGrowableArray4CpnPciInstanceKlass___pn0ALStateVector__v_; -text: .text%__1cIAndINodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cIciObjectOis_null_object6kM_i_; text: .text%__1cNIdealLoopTreeNDCE_loop_body6M_v_; text: .text%__1cNprefetchwNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cXmembar_release_lockNodeEsize6kMpnNPhaseRegAlloc__I_; @@ -3277,10 +2079,8 @@ text: .text%__1cMPhaseChaitinMreset_uf_map6MI_v_; text: .text%__1cMPhaseChaitinSbuild_ifg_physical6MpnMResourceArea__I_; text: .text%__1cNPhaseCoalescePcoalesce_driver6M_v_; text: .text%__1cNdecI_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cSComputeAdapterInfoHdo_long6M_v_; text: .text%__1cOGenerateOopMapJdo_astore6Mi_v_; text: .text%__1cSTailCalljmpIndNodeNis_block_proj6kM_pknENode__; -text: .text%__1cIciObjectMhas_encoding6M_i_; text: .text%__1cMrcx_RegIOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cIMulLNodeImul_ring6kMpknEType_3_3_; text: .text%__1cHPhiNodeKmake_blank6FpnENode_2_p0_; @@ -3291,11 +2091,7 @@ text: .text%JVM_GetMethodIxByteCodeLength; text: .text%JVM_GetMethodIxByteCode; text: .text%JVM_GetMethodIxExceptionIndexes; text: .text%JVM_GetMethodIxExceptionsCount; -text: .text%__1cENodeUdepends_only_on_test6kM_i_; -text: .text%__1cXmembar_acquire_lockNodePoper_input_base6kM_I_; text: .text%__1cOPhaseIdealLoopMdominated_by6MpnENode_2_v_; -text: .text%__1cNGrowableArray4nLKlassHandle__Icontains6kMrkn0A__i_; -text: .text%__1cLGCTaskQdDueue2t6Mi_v_; text: .text%__1cNaddL_rRegNodeErule6kM_I_; text: .text%__1cGGCTask2t6Mn0AEKindEkind__v_; text: .text%__1cZSerialOldToYoungRootsTaskEname6M_pc_; @@ -3312,7 +2108,6 @@ text: .text%__1cNMonitorSupplyHreserve6F_pnHMonitor__; text: .text%__1cUWaitForBarrierGCTaskIwait_for6M_v_; text: .text%__1cUWaitForBarrierGCTaskIdestruct6M_v_; text: .text%__1cUWaitForBarrierGCTaskHdestroy6Fp0_v_; -text: .text%__1cUWaitForBarrierGCTask2t6Mi_v_; text: .text%__1cUWaitForBarrierGCTaskGcreate6F_p0_; text: .text%__1cNBarrierGCTaskIdestruct6M_v_; text: .text%__1cNBarrierGCTaskOdo_it_internal6MpnNGCTaskManager_I_v_; @@ -3324,35 +2119,21 @@ text: .text%__1cGGCTaskIdestruct6M_v_; text: .text%__1cSCardTableExtensionRscavenge_contents6MpnQObjectStartArray_pnMMutableSpace_pnIHeapWord_pnSPSPromotionManager__v_; text: .text%__1cHThreadsZcreate_thread_roots_tasks6FpnLGCTaskQdDueue__v_; text: .text%__1cKPSYoungGenLswap_spaces6M_v_; -text: .text%__1cUPSAdaptiveSizePolicybPcompute_survivor_space_size_and_threshold6MiiL_i_; text: .text%__1cUParallelScavengeHeapQresize_young_gen6MLL_v_; -text: .text%__1cUPSAdaptiveSizePolicyPupdate_averages6MiLL_v_; -text: .text%__1cKPSYoungGenRresize_generation6MLL_i_; text: .text%__1cKPSYoungGenGresize6MLL_v_; text: .text%__1cKPSYoungGenNresize_spaces6MLL_v_; -text: .text%__1cHMatcherKcan_be_arg6Fi_i_; -text: .text%__1cHMatcherQis_spillable_arg6Fi_i_; -text: .text%__1cUPSAdaptiveSizePolicyOshould_full_GC6ML_i_; text: .text%__1cSAdaptiveSizePolicybIupdate_minor_pause_young_estimator6Md_v_; text: .text%__1cUPSAdaptiveSizePolicybGupdate_minor_pause_old_estimator6Md_v_; text: .text%__1cNsubL_rRegNodeMcisc_operand6kM_i_; text: .text%__1cMStartOSRNodeGOpcode6kM_i_; text: .text%__1cRsubI_rReg_memNodeErule6kM_I_; -text: .text%__1cQinstanceRefKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cXmembar_acquire_lockNodeHtwo_adr6kM_I_; text: .text%__1cNandI_rRegNodeMideal_Opcode6kM_i_; -text: .text%__1cNcmovI_regNodePoper_input_base6kM_I_; text: .text%__1cMURShiftINodeJideal_reg6kM_I_; text: .text%__1cMorI_rRegNodeQuse_cisc_RegMask6M_v_; text: .text%__1cLRShiftINodeJideal_reg6kM_I_; -text: .text%__1cLklassItableRinitialize_itable6M_v_; text: .text%__1cLklassVtableQfill_in_mirandas6Mri_v_; text: .text%__1cRandI_rReg_immNodeHtwo_adr6kM_I_; -text: .text%__1cSmembar_releaseNodePoper_input_base6kM_I_; -text: .text%__1cFKlassZcan_be_primary_super_slow6kM_i_; -text: .text%__1cJrRegLOperFclone6kM_pnIMachOper__; text: .text%__1cFStateR_sub_Op_LoadKlass6MpknENode__v_; -text: .text%__1cRmethodDataOopDescJis_mature6kM_i_; text: .text%__1cJcmpOpOperEless6kM_i_; text: .text%__1cFKlassWappend_to_sibling_list6M_v_; text: .text%__1cOcompL_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -3361,39 +2142,23 @@ text: .text%__1cNloadKlassNodeFreloc6kM_i_; text: .text%__1cRshrI_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIAndINodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cTjava_lang_ThrowableNset_backtrace6FpnHoopDesc_2_v_; -text: .text%__1cPcmovI_reg_gNodeMideal_Opcode6kM_i_; text: .text%__1cIAndINodeGmul_id6kM_pknEType__; text: .text%__1cTClassLoadingServiceScompute_class_size6FpnNinstanceKlass__L_; text: .text%__1cLklassVtableQget_num_mirandas6FpnMklassOopDesc_pnPobjArrayOopDesc_4_i_; -text: .text%__1cIVerifierQrelax_verify_for6FpnHoopDesc__i_; -text: .text%__1cLklassVtablebKcompute_vtable_size_and_num_mirandas6Fri1pnMklassOopDesc_pnPobjArrayOopDesc_nLAccessFlags_pnHoopDesc_pnNsymbolOopDesc_5_v_; text: .text%__1cPClassFileParserbAparse_classfile_attributes6MnSconstantPoolHandle_nTinstanceKlassHandle_pnGThread__v_; -text: .text%__1cRaddI_rReg_memNodeRis_cisc_alternate6kM_i_; -text: .text%__1cVjava_lang_ClassLoaderRis_trusted_loader6FpnHoopDesc__i_; -text: .text%__1cNmethodOopDescMsort_methods6FpnPobjArrayOopDesc_222_v_; text: .text%__1cQSystemDictionaryQadd_to_hierarchy6FnTinstanceKlassHandle_pnGThread__v_; -text: .text%__1cPClassFileParserUcompute_oop_map_size6MnTinstanceKlassHandle_ii_i_; -text: .text%__1cPClassFileParserOparseClassFile6MnMsymbolHandle_nGHandle_2r1pnGThread__nTinstanceKlassHandle__; text: .text%__1cPClassFileParserVset_precomputed_flags6MnTinstanceKlassHandle__v_; -text: .text%__1cPClassFileParserNfill_oop_maps6MnTinstanceKlassHandle_ii_v_; text: .text%__1cPClassFileParserbDcompute_transitive_interfaces6MnTinstanceKlassHandle_nOobjArrayHandle_pnGThread__2_; text: .text%__1cQSystemDictionaryVdefine_instance_class6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cPClassFileParserbCcheck_super_interface_access6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cPClassFileParserYcheck_super_class_access6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cPClassFileParserbBcheck_final_method_override6FnTinstanceKlassHandle_pnGThread__v_; -text: .text%__1cSinstanceKlassKlassXallocate_instance_klass6MiiiinNReferenceType_pnGThread__pnMklassOopDesc__; -text: .text%__1cPClassFileParserQparse_interfaces6MnSconstantPoolHandle_nGHandle_2pnGThread__nOobjArrayHandle__; text: .text%__1cPClassFileParserTparse_constant_pool6MpnGThread__nSconstantPoolHandle__; text: .text%__1cNinstanceKlassOset_alloc_size6MI_v_; -text: .text%__1cTClassLoadingServiceTnotify_class_loaded6FpnNinstanceKlass_i_v_; text: .text%__1cLklassItableZsetup_itable_offset_table6FnTinstanceKlassHandle__v_; -text: .text%__1cPClassFileParserMparse_fields6MnSconstantPoolHandle_ipnUFieldAllocationCount_pnOobjArrayHandle_pnGThread__nPtypeArrayHandle__; -text: .text%__1cPClassFileParserNparse_methods6MnSconstantPoolHandle_ipnLAccessFlags_ppnPobjArrayOopDesc_66pnGThread__nOobjArrayHandle__; text: .text%__1cPClassFileParserMsort_methods6MnOobjArrayHandle_111pnGThread__nPtypeArrayHandle__; text: .text%__1cPClassFileParserbBparse_constant_pool_entries6MnSconstantPoolHandle_ipnGThread__v_; text: .text%__1cIUniverseTflush_dependents_on6FnTinstanceKlassHandle__v_; -text: .text%__1cKoopFactoryQnew_constantPool6FipnGThread__pnTconstantPoolOopDesc__; -text: .text%__1cRconstantPoolKlassIallocate6MipnGThread__pnTconstantPoolOopDesc__; text: .text%__1cPClassFileStream2t6MpCipc_v_; text: .text%__1cNinstanceKlassbBdo_local_static_fields_impl6FnTinstanceKlassHandle_pFpnPfieldDescriptor_pnGThread__v5_v_; text: .text%__1cJCodeCachebKnumber_of_nmethods_with_dependencies6F_i_; @@ -3402,9 +2167,6 @@ text: .text%__1cNinstanceKlassYcompute_secondary_supers6MipnGThread__pnPobjArray text: .text%__1cNinstanceKlassSprocess_interfaces6MpnGThread__v_; text: .text%__1cNinstanceKlassQinit_implementor6M_v_; text: .text%__1cNinstanceKlassQeager_initialize6MpnGThread__v_; -text: .text%__1cKoopFactoryRnew_instanceKlass6FiiiinNReferenceType_pnGThread__pnMklassOopDesc__; -text: .text%__1cQSystemDictionaryVresolve_super_or_fail6FnMsymbolHandle_1nGHandle_2pnGThread__pnMklassOopDesc__; -text: .text%__1cNinstanceKlassZcan_be_primary_super_slow6kM_i_; text: .text%__1cKTypeRawPtrEmake6FpC_pk0_; text: .text%__1cScompI_rReg_memNodeMideal_Opcode6kM_i_; text: .text%__1cScompI_rReg_memNodePoper_input_base6kM_I_; @@ -3413,11 +2175,8 @@ text: .text%__1cOMethodLivenessSpropagate_liveness6M_v_; text: .text%__1cOMethodLivenessRinit_basic_blocks6M_v_; text: .text%__1cOMethodLivenessNinit_gen_kill6M_v_; text: .text%__1cOMethodLivenessQcompute_liveness6M_v_; -text: .text%__1cFKlassRoop_is_methodData6kM_i_; -text: .text%__1cFVTuneQstart_class_load6F_v_; text: .text%__1cSThreadProfilerMark2t6Mn0AGRegion__v_; text: .text%__1cLClassLoaderOload_classfile6FnMsymbolHandle_pnGThread__nTinstanceKlassHandle__; -text: .text%__1cFVTuneOend_class_load6F_v_; text: .text%__1cQSystemDictionaryRload_shared_class6FnTinstanceKlassHandle_nGHandle_pnGThread__1_; text: .text%__1cQSystemDictionaryRload_shared_class6FnMsymbolHandle_nGHandle_pnGThread__nTinstanceKlassHandle__; text: .text%__1cQSystemDictionaryRfind_shared_class6FnMsymbolHandle__pnMklassOopDesc__; @@ -3428,77 +2187,47 @@ text: .text%__1cRaddL_rReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cPClassFileParserbKparse_classfile_sourcefile_attribute6MnSconstantPoolHandle_nTinstanceKlassHandle_pnGThread__v_; text: .text%__1cKciTypeFlowLStateVectorGdo_ldc6MpnQciBytecodeStream__v_; text: .text%__1cMPhaseIterGVNIoptimize6M_v_; -text: .text%__1cOrFlagsRegUOperFclone6kM_pnIMachOper__; text: .text%__1cNmulL_rRegNodeHtwo_adr6kM_I_; -text: .text%__1cMrdi_RegPOperJnum_edges6kM_I_; text: .text%__1cRsalI_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLklassVtableYadd_new_mirandas_to_list6FpnNGrowableArray4CpnNmethodOopDesc___pnPobjArrayOopDesc_6pnMklassOopDesc__v_; text: .text%__1cQPackageHashtableMcompute_hash6Mpkci_I_; -text: .text%__1cWconstantPoolCacheKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cRsalL_rReg_immNodeMideal_Opcode6kM_i_; -text: .text%__1cIConINodeHget_int6kMpi_i_; text: .text%__1cJMarkSweepSFollowStackClosureHdo_void6M_v_; -text: .text%__1cICallNodeRis_CallStaticJava6kM_pknSCallStaticJavaNode__; text: .text%__1cLOpaque2NodeGOpcode6kM_i_; text: .text%__1cOGenerateOopMapJppdupswap6Mipkc_v_; -text: .text%__1cILoopNode2t6MpnENode_2_v_; text: .text%__1cJloadBNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPClassFileStreamGget_u86MpnGThread__X_; text: .text%__1cKstoreINodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cTconvI2L_reg_memNodeRis_cisc_alternate6kM_i_; text: .text%__1cScompP_mem_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cIVerifierRverify_byte_codes6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cIRewriterHrewrite6FnTinstanceKlassHandle_pnGThread__v_; -text: .text%__1cIRewriterScompute_index_maps6FnSconstantPoolHandle_rpnIintArray_rpnIintStack__v_; -text: .text%__1cIRewriterXnew_constant_pool_cache6FrnIintArray_pnGThread__nXconstantPoolCacheHandle__; -text: .text%__1cIintArray2t6Mii_v_; text: .text%__1cNinstanceKlassNrewrite_class6MpnGThread__v_; -text: .text%__1cKoopFactoryVnew_constantPoolCache6FipnGThread__pnYconstantPoolCacheOopDesc__; -text: .text%__1cNinstanceKlassWadd_loader_constraints6FnTinstanceKlassHandle_pnGThread__v_; -text: .text%__1cNinstanceKlassLverify_code6FnTinstanceKlassHandle_pnGThread__v_; -text: .text%__1cWconstantPoolCacheKlassIallocate6MipnGThread__pnYconstantPoolCacheOopDesc__; text: .text%__1cYconstantPoolCacheOopDescKinitialize6MrnIintArray__v_; text: .text%__1cFframeWsender_for_entry_frame6kMpnLRegisterMap__0_; text: .text%__1cHPhiNodeDcmp6kMrknENode__I_; -text: .text%__1cSmembar_releaseNodeHtwo_adr6kM_I_; text: .text%__1cSObjectSynchronizerJnotifyall6FnGHandle_pnGThread__v_; text: .text%__1cKoopFactoryWnew_permanent_intArray6FipnGThread__pnQtypeArrayOopDesc__; text: .text%__1cPClassFileParserVparse_exception_table6MIInSconstantPoolHandle_pnGThread__nPtypeArrayHandle__; -text: .text%__1cPClassFileParserbSparse_constant_pool_interfacemethodref_entry6MnSconstantPoolHandle_ipnGThread__v_; text: .text%__1cWCountInterfacesClosureEdoit6MpnMklassOopDesc_i_v_; text: .text%__1cMtlsLoadPNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNmodI_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cNtestL_regNodeMideal_Opcode6kM_i_; -text: .text%__1cRaddI_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIConFNodeGOpcode6kM_i_; text: .text%__1cLOpaque1NodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cTconvI2L_reg_memNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cNSharedRuntimebOraw_exception_handler_for_return_address6FpC_1_; -text: .text%__1cNSharedRuntimebKexception_handler_for_return_address6FpC_1_; -text: .text%__1cOMethodLivenessKBasicBlockPmerge_exception6MnGBitMap__i_; -text: .text%__1cTconvI2L_reg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIAndINodeKmul_opcode6kM_i_; text: .text%__1cIAndINodeKadd_opcode6kM_i_; -text: .text%__1cPcmovI_reg_gNodeJnum_opnds6kM_I_; text: .text%__1cKCMoveINodeGOpcode6kM_i_; -text: .text%__1cKarrayKlassMoop_is_array6kM_i_; text: .text%__1cIRootNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cPloadConUL32NodeHsize_of6kM_I_; text: .text%__1cJAssemblerEandq6MpnMRegisterImpl_i_v_; text: .text%__1cLClassLoaderOlookup_package6Fpkc_pnLPackageInfo__; text: .text%__1cQPackageHashtableJget_entry6MiIpkcL_pnLPackageInfo__; -text: .text%__1cIGraphKitRmerge_fast_memory6MpnENode_2i_v_; text: .text%JVM_Clone; text: .text%__1cLklassItableTcompute_itable_size6FnOobjArrayHandle__i_; -text: .text%__1cUCallCompiledJavaNodeGOpcode6kM_i_; text: .text%__1cPsalI_rReg_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cKadd_n_reqs6FpnENode_1_v_: graphKit.o; text: .text%__1cSTailCalljmpIndNodeMideal_Opcode6kM_i_; text: .text%__1cQComputeCallStackJdo_double6M_v_; text: .text%__1cKciTypeFlowLStateVectorMdo_putstatic6MpnQciBytecodeStream__v_; -text: .text%__1cLClassLoaderLadd_package6Fpkci_i_; text: .text%__1cIGraphKitHopt_iff6MpnENode_2_2_; -text: .text%__1cIGraphKitOmake_merge_mem6MpnENode_22_v_; text: .text%__1cGEventsDlog6FpkcE_v_; text: .text%__1cMLinkResolverbHlookup_instance_method_in_klasses6FrnMmethodHandle_nLKlassHandle_nMsymbolHandle_4pnGThread__v_; text: .text%__1cSsafePoint_pollNodeEsize6kMpnNPhaseRegAlloc__I_; @@ -3506,29 +2235,16 @@ text: .text%__1cNSharedRuntimebWnative_method_throw_unsatisfied_link_error_entry text: .text%__1cPshrI_rReg_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cFParseWensure_phis_everywhere6M_v_; text: .text%__1cNsubL_rRegNodeErule6kM_I_; -text: .text%__1cNIdealLoopTreeUiteration_split_impl6MpnOPhaseIdealLoop_rnJNode_List__v_; -text: .text%__1cNIdealLoopTreebBpolicy_do_remove_empty_loop6MpnOPhaseIdealLoop__i_; -text: .text%__1cNIdealLoopTreeOpolicy_peeling6kMpnOPhaseIdealLoop__i_; -text: .text%__1cIBoolNodeZis_counted_loop_exit_test6M_i_; -text: .text%__1cJloadCNodeHtwo_adr6kM_I_; text: .text%__1cUPSMarkSweepDecoratorVdestination_decorator6F_p0_; -text: .text%__1cTGeneratePairingInfoRpossible_gc_point6MpnOBytecodeStream__i_; -text: .text%__1cENode2n6FL_pv_; text: .text%__1cSvframeStreamCommonZsecurity_get_caller_frame6Mi_v_; text: .text%__1cKBufferBlob2n6FLI_pv_; text: .text%__1cFParseKarray_load6MnJBasicType__v_; -text: .text%__1cICodeBlob2t6Mpkcii_v_; text: .text%__1cKBufferBlob2t6Mpkci_v_; text: .text%__1cKBufferBlobGcreate6Fpkci_p0_; text: .text%__1cKciTypeFlowLStateVectorLdo_putfield6MpnQciBytecodeStream__v_; text: .text%__1cHnmethodNscope_desc_at6MpC_pnJScopeDesc__; -text: .text%__1cHnmethodJcode_size6kM_i_; -text: .text%__1cRtestP_reg_memNodeMideal_Opcode6kM_i_; -text: .text%__1cRtestP_reg_memNodePoper_input_base6kM_I_; text: .text%__1cOPhaseIdealLoopQset_subtree_ctrl6MpnENode__v_; -text: .text%__1cOjmpLoopEndNodeJnum_opnds6kM_I_; text: .text%__1cJAssemblerEmovl6MpnMRegisterImpl_i_v_; -text: .text%__1cRconstantPoolKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cNinstanceKlassbBcall_class_initializer_impl6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cNinstanceKlassRclass_initializer6M_pnNmethodOopDesc__; text: .text%__1cNinstanceKlassWcall_class_initializer6MpnGThread__v_; @@ -3536,19 +2252,11 @@ text: .text%__1cNinstanceKlassbOset_initialization_state_and_notify_impl6FnTinst text: .text%__1cNinstanceKlassbJset_initialization_state_and_notify6Mn0AKClassState_pnGThread__v_; text: .text%__1cNRelocIteratorTlocs_and_index_size6Fii_i_; text: .text%__1cMrdi_RegPOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cTStackWalkCompPolicyYmethod_back_branch_event6MnMmethodHandle_iipnGThread__v_; -text: .text%__1cFTypeDCeq6kMpknEType__i_; -text: .text%__1cJLoadCNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cNtestL_regNodeHtwo_adr6kM_I_; text: .text%__1cTconvL2I_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cRCompilationPolicybJreset_counter_for_back_branch_event6MnMmethodHandle__v_; text: .text%__1cMrax_RegLOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cNmodI_rRegNodePoper_input_base6kM_I_; text: .text%__1cNSignatureInfoIdo_short6M_v_; text: .text%JVM_GetFieldIxModifiers; -text: .text%__1cNsubL_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cNandL_rRegNodeHtwo_adr6kM_I_; -text: .text%__1cNsubL_rRegNodeJnum_opnds6kM_I_; text: .text%__1cTMachCallRuntimeNodePret_addr_offset6M_i_; text: .text%__1cOcompiledVFrameEcode6kM_pnHnmethod__; text: .text%__1cICodeHeapTmark_segmap_as_used6MLL_v_; @@ -3563,21 +2271,17 @@ text: .text%__1cJStartNodeHsize_of6kM_I_; text: .text%__1cILRG_List2t6MI_v_; text: .text%__1cHMatcherLreturn_addr6kM_i_; text: .text%__1cSindIndexOffsetOperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_; -text: .text%__1cGBundlePinitialize_nops6FppnIMachNode__v_; text: .text%__1cOMachPrologNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cHMemNodeHsize_of6kM_I_; text: .text%__1cNSignatureInfoIdo_float6M_v_; text: .text%__1cRaddI_rReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cRmulI_rReg_immNodePoper_input_base6kM_I_; text: .text%__1cFParseNadd_safepoint6M_v_; text: .text%__1cFStateT_sub_Op_CheckCastPP6MpknENode__v_; text: .text%__1cRaddI_rReg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cOCompiledRFrameEinit6M_v_; text: .text%__1cGvframeDtop6kM_p0_; -text: .text%__1cPsarI_rReg_1NodeJnum_opnds6kM_I_; text: .text%__1cRmethodDataOopDescYcompute_extra_data_count6Fii_i_; text: .text%__1cPcheckCastPPNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cIciObjectIis_klass6M_i_; text: .text%__1cFStateM_sub_Op_SubI6MpknENode__v_; text: .text%__1cRxorI_rReg_immNodeMideal_Opcode6kM_i_; text: .text%__1cNloadConP0NodeHsize_of6kM_I_; @@ -3585,76 +2289,42 @@ text: .text%__1cJAssemblerEaddq6MpnMRegisterImpl_i_v_; text: .text%__1cJAssemblerEsubq6MpnMRegisterImpl_2_v_; text: .text%__1cXJNI_ArgumentPusherVaArgHiterate6ML_v_; text: .text%__1cTresource_free_bytes6FpcL_v_; -text: .text%__1cNSingletonBlobMdo_unloading6MpnRBoolObjectClosure_pnKOopClosure_i_v_; text: .text%__1cUPSMarkSweepDecoratorPadjust_pointers6M_v_; -text: .text%__1cUPSMarkSweepDecoratorHcompact6Mi_v_; text: .text%__1cUPSMarkSweepDecoratorKprecompact6M_v_; -text: .text%__1cbBconvI2L_reg_reg_reg_zexNodeMideal_Opcode6kM_i_; text: .text%__1cRindIndexScaleOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cRindIndexScaleOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cPCountedLoopNodeHsize_of6kM_I_; text: .text%__1cENodeHrm_prec6MI_v_; -text: .text%__1cHAddNodeGis_Add6kM_pk0_; text: .text%__1cHCompilebAvarargs_C_out_slots_killed6kM_I_; -text: .text%__1cTMachCallRuntimeNodeSis_MachCallRuntime6M_p0_; -text: .text%__1cMrax_RegIOperJnum_edges6kM_I_; text: .text%__1cICodeHeapLmerge_right6MpnJFreeBlock__v_; -text: .text%__1cNaddI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNmulL_rRegNodeQuse_cisc_RegMask6M_v_; text: .text%__1cWandI_rReg_imm65535NodeMideal_Opcode6kM_i_; -text: .text%__1cKReturnNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cRjmpConU_shortNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cLjmpConUNodeUshort_branch_version6M_pnIMachNode__; text: .text%__1cRjmpConU_shortNodeJlabel_set6MrnFLabel_I_v_; -text: .text%__1cRjmpConU_shortNodeJis_Branch6kM_I_; -text: .text%__1cKcmpOpUOperFclone6kM_pnIMachOper__; -text: .text%__1cRtestP_reg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cFMutexbLwait_for_lock_blocking_implementation6MpnKJavaThread__v_; -text: .text%__1cIregDOperJnum_edges6kM_I_; -text: .text%__1cPciInstanceKlassTis_java_lang_Object6M_i_; text: .text%__1cSciExceptionHandlerLcatch_klass6M_pnPciInstanceKlass__; text: .text%__1cSindIndexOffsetOperNconstant_disp6kM_i_; text: .text%__1cIAndLNodeGadd_id6kM_pknEType__; text: .text%__1cLConvL2INodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cQleaPIdxScaleNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIAndLNodeImul_ring6kMpknEType_3_3_; -text: .text%__1cRaddP_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cMloadConLNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cHMatcherQpost_fast_unlock6FpknENode__i_; text: .text%__1cFStateV_sub_Op_MemBarRelease6MpknENode__v_; text: .text%__1cOleaPIdxOffNodeMideal_Opcode6kM_i_; -text: .text%__1cILoopNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cScompI_rReg_memNodeRis_cisc_alternate6kM_i_; -text: .text%__1cScompI_rReg_memNodeJnum_opnds6kM_I_; text: .text%__1cJAssemblerDorq6MpnMRegisterImpl_nHAddress__v_; text: .text%__1cScompI_rReg_memNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cKJNIHandlesOdestroy_global6FpnI_jobject_i_v_; text: .text%__1cPcmpFastLockNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cXmembar_release_lockNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cTcompareAndSwapLNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNmethodOopDescTset_native_function6MpC_v_; text: .text%__1cKciTypeFlowLStateVectorJhalf_type6FpnGciType__3_; -text: .text%__1cQmerge_point_safe6FpnENode__i_: loopopts.o; -text: .text%__1cRaddL_rReg_immNodeJnum_opnds6kM_I_; -text: .text%__1cHMatcherUc_calling_convention6FpnLOptoRegPair_I_v_; -text: .text%__1cPCallRuntimeNodeScalling_convention6kMpnLOptoRegPair_I_v_; -text: .text%__1cUjni_invoke_nonstatic6FpnHJNIEnv__pnJJavaValue_pnI_jobject_nLJNICallType_pnK_jmethodID_pnSJNI_ArgumentPusher_pnGThread__v_: jni.o; text: .text%__1cQSystemDictionaryRnumber_of_classes6F_i_; text: .text%__1cNaddL_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNxorI_rRegNodeMcisc_operand6kM_i_; text: .text%__1cWCallLeafNoFPDirectNodePoper_input_base6kM_I_; -text: .text%__1cENodeHget_int6kMpi_i_; -text: .text%__1cPCountedLoopNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cJLoadFNodeGOpcode6kM_i_; text: .text%__1cQSystemDictionarybBresolve_array_class_or_null6FnMsymbolHandle_nGHandle_2pnGThread__pnMklassOopDesc__; -text: .text%__1cNincI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cPClassFileParserbEparse_constant_pool_long_entry6MnSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cPcmovI_reg_lNodePoper_input_base6kM_I_; text: .text%__1cJAssemblerEleaq6MpnMRegisterImpl_nHAddress__v_; -text: .text%__1cNinstanceKlassQarray_klass_impl6MipnGThread__pnMklassOopDesc__; text: .text%__1cJloadINodeIpipeline6kM_pknIPipeline__; text: .text%__1cHTypePtrFxmeet6kMpknEType__3_; -text: .text%__1cNprefetchwNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cFKlassTarray_klass_or_null6M_pnMklassOopDesc__; text: .text%__1cIPhaseIFGYCompute_Effective_Degree6M_v_; text: .text%__1cbCfind_class_from_class_loader6FpnHJNIEnv__nMsymbolHandle_CnGHandle_3CpnGThread__pnH_jclass__; @@ -3667,46 +2337,33 @@ text: .text%__1cScompU_rReg_memNodePoper_input_base6kM_I_; text: .text%__1cScompU_rReg_memNodeMideal_Opcode6kM_i_; text: .text%__1cRNativeGeneralJumpQjump_destination6kM_pC_; text: .text%__1cLRethrowNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cWCallLeafNoFPDirectNodeHtwo_adr6kM_I_; -text: .text%__1cNSafepointBlobHoops_do6MpnKOopClosure__v_; -text: .text%__1cSvframeStreamCommonYfill_from_compiled_frame6MpnHnmethod_i_v_; text: .text%__1cNandL_rRegNodeQuse_cisc_RegMask6M_v_; -text: .text%__1cHnmethodQis_native_method6kM_i_; text: .text%__1cTleaPIdxScaleOffNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNmulL_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cODataRelocationGoffset6M_i_; text: .text%__1cODataRelocationJset_value6MpC_v_; text: .text%__1cKRelocationRpd_set_data_value6MpCl_v_; text: .text%__1cLOptoRuntimeJstub_name6FpC_pkc_; -text: .text%__1cIMulINodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cFStateO_sub_Op_StoreB6MpknENode__v_; text: .text%__1cRaddL_rReg_immNodeHtwo_adr6kM_I_; -text: .text%__1cIregFOperJnum_edges6kM_I_; text: .text%__1cRandI_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIRootNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cIRootNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cOleaPIdxOffNodePoper_input_base6kM_I_; text: .text%__1cJcmpOpOperKless_equal6kM_i_; text: .text%__1cNmethodOopDescVset_signature_handler6MpC_v_; text: .text%__1cIMulLNodeGmul_id6kM_pknEType__; -text: .text%__1cMrep_stosNodeHtwo_adr6kM_I_; text: .text%__1cHMemNodeIadr_type6kM_pknHTypePtr__; -text: .text%__1cNsubI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cHMemNodeScalculate_adr_type6FpknEType_pknHTypePtr__6_; text: .text%__1cRmulI_rReg_immNodeErule6kM_I_; text: .text%__1cURethrowExceptionNodePoper_input_base6kM_I_; text: .text%__1cNaddP_rRegNodePoper_input_base6kM_I_; text: .text%__1cFStateP_sub_Op_RShiftI6MpknENode__v_; -text: .text%__1cKstoreLNodeHtwo_adr6kM_I_; text: .text%__1cNnegI_rRegNodeMideal_Opcode6kM_i_; -text: .text%__1cbBconvI2L_reg_reg_reg_zexNodePoper_input_base6kM_I_; text: .text%__1cbFloadConL_0x6666666666666667NodeErule6kM_I_; text: .text%__1cNSharedRuntimeXfind_callee_info_helper6FpnKJavaThread_rnMvframeStream_rnJBytecodesECode_rnICallInfo_pnGThread__nGHandle__; -text: .text%__1cIGraphKitNstore_barrier6MpnENode_22_v_; text: .text%__1cNmethodOopDescTverified_code_entry6M_pC_; text: .text%__1cNloadKlassNodeIpipeline6kM_pknIPipeline__; text: .text%__1cSmembar_acquireNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cMoutputStreamMdo_vsnprintf6FpcLpkcpnR__va_list_element_irL_3_; text: .text%__1cMoutputStreamFprint6MpkcE_v_; text: .text%__1cMURShiftLNodeJideal_reg6kM_I_; text: .text%__1cZPhaseConservativeCoalesce2t6MrnMPhaseChaitin__v_; @@ -3716,58 +2373,36 @@ text: .text%__1cMPhaseChaitinZcompress_uf_map_for_nodes6M_v_; text: .text%__1cZPhaseConservativeCoalesceGverify6M_v_; text: .text%__1cQComputeCallStackIdo_short6M_v_; text: .text%__1cNFingerprinterHdo_long6M_v_; -text: .text%__1cIciMethodRinstructions_size6M_i_; text: .text%__1cSsafePoint_pollNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNloadConL0NodeLbottom_type6kM_pknEType__; -text: .text%__1cJimmL0OperJconstantL6kM_x_; -text: .text%__1cWandI_rReg_imm65535NodePoper_input_base6kM_I_; text: .text%__1cIAndINodeJideal_reg6kM_I_; text: .text%__1cZInterpreterMacroAssemblerKverify_oop6MpnMRegisterImpl_nITosState__v_; -text: .text%__1cYexternal_word_RelocationJpack_data6M_i_; -text: .text%__1cJimmP0OperFclone6kM_pnIMachOper__; -text: .text%__1cKRelocationYruntime_address_to_index6FpC_l_; text: .text%__1cOemit_d32_reloc6FrnKCodeBuffer_inJrelocInfoJrelocType_i_v_; text: .text%__1cYexternal_word_RelocationEtype6M_nJrelocInfoJrelocType__; -text: .text%__1cRsalL_rReg_immNodePoper_input_base6kM_I_; -text: .text%__1cLPhaseValues2T5B6M_v_; text: .text%__1cNstoreImmBNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateQ_sub_Op_URShiftL6MpknENode__v_; text: .text%__1cJNode_ListEyank6MpnENode__v_; -text: .text%__1cNxorI_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cNxorI_rRegNodeJnum_opnds6kM_I_; -text: .text%__1cJAssemblerEmovq6MpnMRegisterImpl_l_v_; text: .text%jni_ExceptionCheck: jni.o; text: .text%__1cMFastLockNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cTCallDynamicJavaNodeEhash6kM_I_; -text: .text%__1cMalloc_object6FpnH_jclass_pnGThread__pnPinstanceOopDesc__: jni.o; -text: .text%__1cRshrL_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIXorINodeLbottom_type6kM_pknEType__; text: .text%__1cJAssemblerEsubq6MpnMRegisterImpl_i_v_; text: .text%__1cNloadConL0NodeMideal_Opcode6kM_i_; -text: .text%__1cLPcDescCacheKpc_desc_at6kMpnHnmethod_pC_pnGPcDesc__; text: .text%__1cKBlock_ListGinsert6MIpnFBlock__v_; -text: .text%__1cKtype2basic6FpknEType__nJBasicType__; -text: .text%__1cQleaPIdxScaleNodeLbottom_type6kM_pknEType__; text: .text%__1cKklassKlassOklass_oop_size6kM_i_; -text: .text%__1cIGraphKitOnull_check_oop6MpnKRegionNode_pnENode_i_4_; -text: .text%__1cJloadCNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cRxorI_rReg_memNodeMideal_Opcode6kM_i_; text: .text%__1cKTypeAryPtrQcast_to_ptr_type6kMnHTypePtrDPTR__pknEType__; text: .text%__1cKTypeRawPtrEmake6FnHTypePtrDPTR__pk0_; text: .text%__1cJCodeCacheEfree6FpnICodeBlob__v_; text: .text%__1cICodeHeapPadd_to_freelist6MpnJHeapBlock__v_; text: .text%__1cICodeHeapKdeallocate6Mpv_v_; -text: .text%__1cFframeLnmethods_do6M_v_; text: .text%__1cJVectorSetGslamin6Mrk0_v_; text: .text%__1cFStateQ_sub_Op_URShiftI6MpknENode__v_; text: .text%__1cScompI_rReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cRaddI_rReg_memNodeErule6kM_I_; -text: .text%__1cYexternal_word_RelocationWfix_relocation_at_move6Ml_v_; text: .text%__1cKRelocationYpd_get_address_from_code6M_pC_; text: .text%__1cRxorI_rReg_memNodePoper_input_base6kM_I_; text: .text%__1cXJNI_ArgumentPusherVaArgIget_long6M_v_; text: .text%__1cNandL_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cOCompilerOracleMshould_print6FnMmethodHandle__i_; text: .text%__1cNstoreImmBNodeFreloc6kM_i_; text: .text%__1cJcmpOpOperNgreater_equal6kM_i_; text: .text%__1cKBufferBlobEfree6Fp0_v_; @@ -3776,12 +2411,9 @@ text: .text%__1cKNativeCallXset_destination_mt_safe6MpC_v_; text: .text%__1cOGenerateOopMapIppop_any6Mi_v_; text: .text%__1cKNode_ArrayFclear6M_v_; text: .text%__1cQjava_lang_StringOas_utf8_string6FpnHoopDesc__pc_; -text: .text%__1cJAssemblerFpushq6MpnMRegisterImpl__v_; -text: .text%__1cIRootNodeHis_Root6M_p0_; text: .text%__1cJJavaCallsMcall_special6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnRJavaCallArguments_pnGThread__v_; text: .text%__1cIJumpDataPpost_initialize6MpnOBytecodeStream_pnRmethodDataOopDesc__v_; text: .text%__1cRsalL_rReg_immNodeErule6kM_I_; -text: .text%__1cPstoreImmI16NodeHtwo_adr6kM_I_; text: .text%__1cQjava_lang_StringOchar_converter6FnGHandle_HHpnGThread__1_; text: .text%jni_NewObject: jni.o; text: .text%__1cNaddP_rRegNodeMideal_Opcode6kM_i_; @@ -3790,38 +2422,25 @@ text: .text%__1cFciEnvKcompile_id6M_I_; text: .text%__1cOPhaseIdealLoopNreorg_offsets6MpnNIdealLoopTree__v_; text: .text%__1cNtestL_regNodeErule6kM_I_; text: .text%__1cLOptoRuntimebAcomplete_monitor_exit_Type6F_pknITypeFunc__; -text: .text%__1cNstoreImmINodeHtwo_adr6kM_I_; text: .text%__1cIGraphKitNshared_unlock6MpnENode_2_v_; text: .text%__1cNSafePointNodeLpop_monitor6M_v_; text: .text%__1cRsarI_rReg_immNodeErule6kM_I_; -text: .text%__1cNtestL_regNodePoper_input_base6kM_I_; text: .text%__1cRsarL_rReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMindirectOperNbase_position6kM_i_; text: .text%__1cMindirectOperNconstant_disp6kM_i_; text: .text%__1cMTailCallNodeKmatch_edge6kMI_I_; text: .text%__1cKciTypeFlowLStateVectorGdo_new6MpnQciBytecodeStream__v_; -text: .text%__1cHMatcherPprior_fast_lock6FpknENode__i_; text: .text%__1cGIfNodeMdominated_by6MpnENode_pnMPhaseIterGVN__v_; text: .text%__1cFStateV_sub_Op_MemBarAcquire6MpknENode__v_; text: .text%__1cNSharedRuntimeQfind_callee_info6FpnKJavaThread_rnJBytecodesECode_rnICallInfo_pnGThread__nGHandle__; text: .text%__1cFKlassDLCA6Mp0_1_; -text: .text%__1cRtestP_reg_memNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cRtestP_reg_memNodeRis_cisc_alternate6kM_i_; -text: .text%__1cRtestP_reg_memNodeJnum_opnds6kM_I_; text: .text%__1cHciKlassVleast_common_ancestor6Mp0_1_; -text: .text%__1cUmembar_cpu_orderNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cUmembar_cpu_orderNodeLbottom_type6kM_pknEType__; -text: .text%__1cTcompareAndSwapLNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cNSCMemProjNodeLbottom_type6kM_pknEType__; -text: .text%__1cTcompareAndSwapLNodeHtwo_adr6kM_I_; text: .text%__1cJScopeDescGsender6kM_p0_; text: .text%__1cSindIndexOffsetOperOindex_position6kM_i_; text: .text%__1cSindIndexOffsetOperNbase_position6kM_i_; -text: .text%__1cNSharedRuntimeOresolve_helper6FpnKJavaThread_iipnGThread__nMmethodHandle__; text: .text%__1cNSafePointNodeMpush_monitor6MpknMFastLockNode__v_; -text: .text%__1cNSharedRuntimeSresolve_sub_helper6FpnKJavaThread_iipnGThread__nMmethodHandle__; text: .text%__1cOcompiledVFrameGsender6kM_pnGvframe__; -text: .text%__1cNtestU_regNodeHtwo_adr6kM_I_; text: .text%__1cTciConstantPoolCache2t6MpnFArena_i_v_; text: .text%__1cNGrowableArray4Cpv_2t6MpnFArena_iirk0_v_; text: .text%__1cKstoreFNodePoper_input_base6kM_I_; @@ -3832,13 +2451,11 @@ text: .text%__1cOMachEpilogNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNcmovI_regNodeMideal_Opcode6kM_i_; text: .text%__1cKCompiledIC2t6MpnKNativeCall__v_; text: .text%__1cFStateN_sub_Op_LoadL6MpknENode__v_; -text: .text%__1cNmodI_rRegNodeJnum_opnds6kM_I_; text: .text%__1cSCallLeafDirectNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNSignatureInfoHdo_char6M_v_; text: .text%__1cNtestU_regNodeMideal_Opcode6kM_i_; text: .text%__1cFStateQ_sub_Op_CallLeaf6MpknENode__v_; text: .text%__1cRAbstractAssemblerFflush6M_v_; -text: .text%__1cJloadLNodeIpeephole6MpnFBlock_ipnNPhaseRegAlloc_ri_pnIMachNode__; text: .text%__1cJloadLNodeFreloc6kM_i_; text: .text%__1cSCallLeafDirectNodeFreloc6kM_i_; text: .text%__1cIGraphKitNgen_checkcast6MpnENode_2p2_2_; @@ -3847,50 +2464,31 @@ text: .text%__1cNsubL_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cXmembar_release_lockNodeIadr_type6kM_pknHTypePtr__; text: .text%__1cJAssemblerEmovq6MpnMRegisterImpl_2_v_; text: .text%__1cRmulL_rReg_immNodeMideal_Opcode6kM_i_; -text: .text%__1cRsubI_rReg_memNodeRis_cisc_alternate6kM_i_; text: .text%__1cJAssemblerEmovl6MpnMRegisterImpl_nHAddress__v_; text: .text%__1cFframeRretrieve_receiver6MpnLRegisterMap__pnHoopDesc__; text: .text%__1cPBytecode_invokeNstatic_target6MpnGThread__nMmethodHandle__; text: .text%jni_NewGlobalRef: jni.o; -text: .text%__1cKciTypeFlowFRangeSprivate_copy_count6kMpn0AGJsrSet__i_; -text: .text%__1cOleaPIdxOffNodeJnum_opnds6kM_I_; text: .text%__1cOPhaseIdealLoopLdo_split_if6MpnENode__v_; text: .text%__1cNandI_rRegNodeMcisc_operand6kM_i_; text: .text%__1cHOrINodeGadd_id6kM_pknEType__; text: .text%__1cIPhaseCFGOinsert_goto_at6MII_v_; -text: .text%__1cOPhaseIdealLoop2t6MrnMPhaseIterGVN_pk0i_v_; text: .text%__1cOPhaseIdealLoopPbuild_loop_tree6M_v_; text: .text%__1cRsubI_rReg_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIMinINodeLbottom_type6kM_pknEType__; -text: .text%__1cOjmpLoopEndNodeHtwo_adr6kM_I_; text: .text%__1cJLoadBNodeJideal_reg6kM_I_; -text: .text%__1cNnegI_rRegNodePoper_input_base6kM_I_; text: .text%__1cFStateS_sub_Op_FastUnlock6MpknENode__v_; text: .text%__1cXmembar_release_lockNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cRcmpFastUnlockNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cMVirtualSpaceNreserved_size6kM_L_; text: .text%__1cScompU_rReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cRsarI_rReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKStoreFNodeGOpcode6kM_i_; -text: .text%__1cLCastP2LNodeJideal_reg6kM_I_; text: .text%__1cPcmovI_reg_gNodeErule6kM_I_; -text: .text%__1cFStateP_sub_Op_CastP2L6MpknENode__v_; -text: .text%__1cScompU_rReg_memNodeRis_cisc_alternate6kM_i_; -text: .text%__1cScompU_rReg_memNodeJnum_opnds6kM_I_; text: .text%__1cScompU_rReg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cMLinkResolverOresolve_method6FrnMmethodHandle_rnLKlassHandle_nSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cWCallLeafNoFPDirectNodeRis_safepoint_node6kM_i_; text: .text%__1cQjava_lang_ThreadRset_thread_status6FpnHoopDesc_n0AMThreadStatus__v_; text: .text%__1cWCallLeafNoFPDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cJAssemblerDjcc6Mn0AJCondition_pCnJrelocInfoJrelocType__v_; text: .text%__1cKstoreFNodeMideal_Opcode6kM_i_; text: .text%__1cIimmFOperJconstantF6kM_f_; -text: .text%__1cNcmovI_regNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cKTypeOopPtrSmake_from_constant6FpnIciObject__pk0_; -text: .text%__1cNcmovI_regNodeJnum_opnds6kM_I_; -text: .text%__1cJAssemblerEmovq6MnHAddress_i_v_; -text: .text%__1cIciObjectJis_method6M_i_; -text: .text%__1cIciObjectOis_method_data6M_i_; text: .text%__1cIDivINodeLbottom_type6kM_pknEType__; text: .text%__1cHOrINodeJideal_reg6kM_I_; text: .text%__1cNcmovI_regNodeMcisc_operand6kM_i_; @@ -3900,63 +2498,40 @@ text: .text%__1cNinstanceKlassUfind_interface_field6kMpnNsymbolOopDesc_2pnPfield text: .text%__1cJloadFNodeMideal_Opcode6kM_i_; text: .text%__1cbFunnecessary_membar_volatileNodeMideal_Opcode6kM_i_; text: .text%__1cSmembar_acquireNodeIadr_type6kM_pknHTypePtr__; -text: .text%__1cIAndLNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cIAndLNodeKadd_opcode6kM_i_; text: .text%__1cFStateO_sub_Op_StoreC6MpknENode__v_; text: .text%__1cIAndLNodeKmul_opcode6kM_i_; text: .text%__1cRaddL_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMrep_stosNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cXmembar_acquire_lockNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cFParseJdo_ifnull6MnIBoolTestEmask__v_; -text: .text%__1cMtlsLoadPNodeHtwo_adr6kM_I_; -text: .text%__1cIGraphKitOset_pair_local6MipnENode__v_; -text: .text%__1cJLoadCNodeJideal_reg6kM_I_; -text: .text%__1cPcmovI_reg_lNodeMideal_Opcode6kM_i_; -text: .text%__1cJCodeCacheXmark_for_deoptimization6FpnMklassOopDesc__i_; text: .text%__1cMrcx_RegIOperEtype6kM_pknEType__; -text: .text%__1cLConvL2INodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cOPhaseIdealLoopKDominators6M_v_; text: .text%__1cHNTarjanDDFS6Fp0rnJVectorSet_pnOPhaseIdealLoop_pI_i_; text: .text%__1cHNTarjanIsetdepth6MIpI_v_; text: .text%__1cIMulLNodeKmul_opcode6kM_i_; text: .text%__1cIMulLNodeKadd_opcode6kM_i_; text: .text%jni_SetLongField: jni.o; -text: .text%__1cOPhaseIdealLoopQbuild_loop_early6MrnJVectorSet_rnJNode_List_rnKNode_Stack_pk0_v_; -text: .text%__1cOPhaseIdealLoopPbuild_loop_late6MrnJVectorSet_rnJNode_List_rnKNode_Stack_pk0_v_; text: .text%__1cOPhaseIdealLoopRinit_dom_lca_tags6M_v_; text: .text%__1cKstoreLNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLPcDescCacheLadd_pc_desc6MpnGPcDesc__v_; -text: .text%__1cScheck_phi_clipping6FpnHPhiNode_rpnHConNode_rI45rpnENode_5_i_: cfgnode.o; text: .text%__1cJloadSNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cTconvI2L_reg_memNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cRsubI_rReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMloadConFNodeMideal_Opcode6kM_i_; -text: .text%__1cTC2IAdapterGeneratorUgenerate_c2i_adapter6FnMmethodHandle__pnKC2IAdapter__; -text: .text%__1cKCompiledICIis_clean6kM_i_; text: .text%__1cNaddP_rRegNodeErule6kM_I_; -text: .text%__1cRmulL_rReg_immNodePoper_input_base6kM_I_; text: .text%__1cNmethodOopDescVclear_native_function6M_v_; -text: .text%__1cICodeBlobOis_java_method6kM_i_; -text: .text%__1cKVtableStubSpd_code_size_limit6Fi_i_; -text: .text%__1cIUniverseWis_out_of_memory_error6FnGHandle__i_; text: .text%__1cTjava_lang_ThrowableTfill_in_stack_trace6FnGHandle_pnGThread__v_; text: .text%__1cTjava_lang_ThrowableQclear_stacktrace6FpnHoopDesc__v_; text: .text%__1cKJavaThreadGactive6F_p0_; text: .text%JVM_FillInStackTrace; text: .text%__1cTjava_lang_ThrowableTfill_in_stack_trace6FnGHandle__v_; text: .text%__1cSInterpreterRuntimePset_bcp_and_mdp6FpCpnKJavaThread__v_; -text: .text%__1cKJavaThreadNreguard_stack6MpC_i_; text: .text%__1cFframeZinterpreter_frame_set_bcp6MpC_v_; text: .text%jni_DeleteGlobalRef: jni.o; -text: .text%__1cKCompiledICZcompute_monomorphic_entry6FnMmethodHandle_nLKlassHandle_iirnOCompiledICInfo_pnGThread__v_; -text: .text%__1cNGrowableArray4nMmethodHandle__Icontains6kMrkn0A__i_; text: .text%__1cLOpaque2NodeEhash6kM_I_; text: .text%__1cICodeHeapLfirst_block6kM_pnJHeapBlock__; text: .text%__1cJCodeCacheFfirst6F_pnICodeBlob__; -text: .text%__1cJBytecodesRspecial_length_at6FpC_i_; text: .text%__1cFParseGdo_new6M_v_; text: .text%__1cFParseFBlockMadd_new_path6M_i_; -text: .text%__1cLklassItablebFinitialize_itable_for_interface6MpnMklassOopDesc_pnRitableMethodEntry__v_; text: .text%__1cJimmI0OperJnum_edges6kM_I_; text: .text%__1cRmulI_rReg_immNodeMcisc_operand6kM_i_; text: .text%__1cICodeHeapMmax_capacity6kM_L_; @@ -3974,103 +2549,65 @@ text: .text%__1cNobjArrayKlassIallocate6MipnGThread__pnPobjArrayOopDesc__; text: .text%__1cRmulI_rReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cHciKlassGloader6M_pnHoopDesc__; text: .text%__1cIConDNodeGOpcode6kM_i_; -text: .text%__1cNandI_rRegNodeJnum_opnds6kM_I_; text: .text%__1cLRethrowNodeEhash6kM_I_; -text: .text%__1cTC2IAdapterGeneratorSstd_verified_entry6FnMmethodHandle__pC_; text: .text%__1cIDivLNodeGOpcode6kM_i_; -text: .text%__1cNandI_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cGThreadOis_Java_thread6kM_i_; text: .text%__1cSmembar_releaseNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cHMatcherQinline_cache_reg6F_i_; -text: .text%__1cbBconvI2L_reg_reg_reg_zexNodeJnum_opnds6kM_I_; text: .text%__1cbBInterpreterCodeletInterfaceRcode_size_to_size6kMi_i_; text: .text%__1cbBInterpreterCodeletInterfaceKinitialize6MpnEStub_i_v_; text: .text%jni_NewLocalRef: jni.o; text: .text%__1cSSetupItableClosureEdoit6MpnMklassOopDesc_i_v_; -text: .text%__1cLOptoRuntimebAresolve_opt_virtual_call_C6FpnKJavaThread__pC_; text: .text%__1cPstoreImmI16NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLRShiftLNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cIemit_d166FrnKCodeBuffer_i_v_; text: .text%__1cKimmI16OperIconstant6kM_l_; text: .text%__1cPClassFileParserbNparse_classfile_inner_classes_attribute6MnSconstantPoolHandle_nTinstanceKlassHandle_pnGThread__H_; text: .text%__1cMloadConFNodeLbottom_type6kM_pknEType__; -text: .text%__1cENodeMis_CatchProj6kM_pknNCatchProjNode__; text: .text%__1cJCodeCacheNalive_nmethod6FpnICodeBlob__pnHnmethod__; text: .text%__1cJAssemblerGmovzbl6MpnMRegisterImpl_nHAddress__v_; -text: .text%__1cIVMThreadMis_VM_thread6kM_i_; -text: .text%__1cPcmovI_reg_lNodeJnum_opnds6kM_I_; text: .text%__1cMloadConLNodeHsize_of6kM_I_; text: .text%__1cOMacroAssemblerSload_unsigned_byte6MpnMRegisterImpl_nHAddress__i_; -text: .text%__1cTconvI2L_reg_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNaddL_rRegNodeHtwo_adr6kM_I_; -text: .text%__1cKstoreFNodeJnum_opnds6kM_I_; text: .text%__1cNaddL_rRegNodeQuse_cisc_RegMask6M_v_; -text: .text%__1cSComputeAdapterInfoJdo_double6M_v_; -text: .text%__1cLimmUL32OperFclone6kM_pnIMachOper__; -text: .text%__1cPloadConUL32NodeFclone6kM_pnENode__; text: .text%__1cLLShiftLNodeJideal_reg6kM_I_; -text: .text%__1cMtlsLoadPNodePoper_input_base6kM_I_; text: .text%__1cPlocal_vsnprintf6FpcLpkcpnR__va_list_element__i_; -text: .text%__1cSComputeAdapterInfoHdo_bool6M_v_; text: .text%jio_vsnprintf; -text: .text%__1cURethrowExceptionNodeGpinned6kM_i_; text: .text%__1cNstoreImmINodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIAndLNodeJideal_reg6kM_I_; -text: .text%__1cURethrowExceptionNodeHtwo_adr6kM_I_; text: .text%__1cNDispatchTableJset_entry6MirnKEntryPoint__v_; text: .text%jio_snprintf; text: .text%__1cNSafePointNodeKgrow_stack6MpnIJVMState_I_v_; -text: .text%__1cbBconvI2L_reg_reg_reg_zexNodeErule6kM_I_; text: .text%__1cURethrowExceptionNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cRsarL_rReg_immNodeJnum_opnds6kM_I_; text: .text%__1cTcompareAndSwapLNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%JVM_GetCPMethodModifiers; text: .text%__1cFStateR_sub_Op_SafePoint6MpknENode__v_; -text: .text%__1cSsafePoint_pollNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cOCompilerOraclePshould_break_at6FnMmethodHandle__i_; -text: .text%__1cJloadCNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cQorI_rReg_immNodeMideal_Opcode6kM_i_; text: .text%__1cPsarI_rReg_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLRShiftLNodeLbottom_type6kM_pknEType__; -text: .text%__1cKReturnNode2t6MpnENode_2222_v_; text: .text%__1cKReturnNodeJideal_reg6kM_I_; text: .text%__1cNinstanceKlassPadd_implementor6MpnMklassOopDesc__v_; text: .text%__1cRPrivilegedElementKinitialize6MpnMvframeStream_pnHoopDesc_p0pnGThread__v_; text: .text%JVM_DoPrivileged; text: .text%__1cOGenerateOopMapXreplace_all_CTS_matches6MnNCellTypeState_1_v_; -text: .text%__1cNIdealLoopTreeMis_loop_exit6kMpnENode_pnOPhaseIdealLoop__2_; text: .text%__1cPpoll_RelocationEtype6M_nJrelocInfoJrelocType__; text: .text%__1cSsafePoint_pollNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cSsafePoint_pollNodeFreloc6kM_i_; text: .text%__1cLStrCompNodeGOpcode6kM_i_; text: .text%__1cJOopMapSet2t6M_v_; -text: .text%__1cKloadUBNodeZcheck_for_anti_dependence6kM_i_; -text: .text%__1cNobjArrayKlassOmulti_allocate6MipiipnGThread__pnHoopDesc__; text: .text%__1cKstoreCNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cENodeGOpcode6kM_i_; -text: .text%__1cOLibraryCallKitNtry_to_inline6M_i_; text: .text%__1cNFingerprinterHdo_bool6M_v_; text: .text%__1cOPhaseIdealLoopUsplit_if_with_blocks6MrnJVectorSet_rnKNode_Stack__v_; text: .text%__1cNmethodOopDescbDbuild_interpreter_method_data6FnMmethodHandle_pnGThread__v_; text: .text%__1cQLibraryIntrinsicIgenerate6MpnIJVMState__2_; text: .text%__1cLOopRecorderIoop_size6M_i_; -text: .text%__1cHnmethodOexception_size6kM_i_; -text: .text%__1cHnmethodPscopes_pcs_size6kM_i_; text: .text%__1cYDebugInformationRecorderIpcs_size6M_i_; text: .text%__1cYDebugInformationRecorderJdata_size6M_i_; -text: .text%__1cHnmethodQscopes_data_size6kM_i_; -text: .text%__1cHnmethodJstub_size6kM_i_; text: .text%__1cHnmethodKtotal_size6kM_i_; text: .text%__1cNtestU_regNodeErule6kM_I_; text: .text%__1cJOopMapSetJheap_size6kM_i_; -text: .text%__1cICodeBlobWfix_relocation_at_move6Ml_v_; -text: .text%__1cKCodeBufferJcopy_code6MpnICodeBlob__v_; -text: .text%__1cNRelocIteratorMcreate_index6FpnKCodeBuffer_pnJrelocInfo_4_4_; -text: .text%__1cICodeBlobPallocation_size6FpnKCodeBuffer_ii_I_; text: .text%__1cRAbstractAssemblerOcode_fill_byte6F_i_; -text: .text%__1cICodeBlob2t6MpkcpnKCodeBuffer_iiipnJOopMapSet_i_v_; text: .text%__1cMrdx_RegLOperEtype6kM_pknEType__; -text: .text%__1cKCodeBufferPcopy_relocation6MpnICodeBlob__v_; text: .text%__1cVPatchingRelocIteratorHprepass6M_v_; text: .text%__1cVPatchingRelocIteratorIpostpass6M_v_; text: .text%__1cJOopMapSetHcopy_to6MpC_v_; @@ -4079,16 +2616,13 @@ text: .text%__1cINodeHash2t6Mp0_v_; text: .text%__1cOPhaseTransform2t6Mp0nFPhaseLPhaseNumber__v_; text: .text%__1cJAssemblerDjmp6MnHAddress__v_; text: .text%__1cOJNIHandleBlockRrebuild_free_list6M_v_; -text: .text%__1cSstring_compareNodeZcheck_for_anti_dependence6kM_i_; text: .text%jni_GetObjectArrayElement: jni.o; text: .text%__1cKCompiledICSset_to_monomorphic6MrknOCompiledICInfo__v_; -text: .text%__1cIDivINodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cVCallRuntimeDirectNodeMideal_Opcode6kM_i_; text: .text%__1cICmpDNodeGOpcode6kM_i_; text: .text%__1cPcmovI_reg_gNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateM_sub_Op_AndI6MpknENode__v_; text: .text%__1cHCompilebBregister_library_intrinsics6M_v_; -text: .text%__1cNGrowableArray4CpnNCallGenerator__2t6Mii_v_; text: .text%__1cETypeKInitialize6FpnHCompile__v_; text: .text%__1cYDebugInformationRecorder2t6MpnLOopRecorder__v_; text: .text%__1cOCompileWrapper2t6MpnHCompile__v_; @@ -4110,12 +2644,9 @@ text: .text%__1cXPhaseAggressiveCoalesceGverify6M_v_; text: .text%__1cJStartNodeJideal_reg6kM_I_; text: .text%__1cHMatcher2t6MrnJNode_List__v_; text: .text%__1cFArena2t6ML_v_; -text: .text%__1cIPhaseCFGOschedule_early6MrnJVectorSet_rnJNode_List_rnLBlock_Array__i_; text: .text%__1cWNode_Backward_Iterator2t6MpnENode_rnJVectorSet_rnJNode_List_rnLBlock_Array__v_; text: .text%__1cHMatcherFmatch6M_v_; text: .text%__1cFStateM_sub_Op_Goto6MpknENode__v_; -text: .text%__1cIPhaseCFGNschedule_late6MrnJVectorSet_rnJNode_List_rnNGrowableArray4CI___v_; -text: .text%__1cIPhaseCFGQFind_Inner_Loops6M_v_; text: .text%__1cIPhaseCFGQGlobalCodeMotion6MrnHMatcher_IrnJNode_List__v_; text: .text%__1cIPhaseCFGYEstimate_Block_Frequency6M_v_; text: .text%__1cIPhaseCFGJbuild_cfg6M_I_; @@ -4123,7 +2654,6 @@ text: .text%__1cHCompileICode_Gen6M_v_; text: .text%__1cMPhaseChaitin2t6MIrnIPhaseCFG_rnHMatcher__v_; text: .text%__1cMPhaseChaitinRRegister_Allocate6M_v_; text: .text%__1cMPhaseChaitinGde_ssa6M_v_; -text: .text%__1cMPhaseChaitinbGstretch_base_pointer_live_ranges6MpnMResourceArea__i_; text: .text%__1cNPhaseRegAllocTpd_preallocate_hook6M_v_; text: .text%__1cHMatcherPinit_spill_mask6MpnENode__v_; text: .text%__1cHMatcherTFixup_Save_On_Entry6M_v_; @@ -4136,30 +2666,21 @@ text: .text%__1cIPhaseCFGVschedule_pinned_nodes6MrnJVectorSet__v_; text: .text%__1cHCompileTframe_size_in_words6kM_i_; text: .text%__1cOCompileWrapper2T6M_v_; text: .text%__1cHCompileYinit_scratch_buffer_blob6M_v_; -text: .text%__1cHCompileYinit_scratch_locs_memory6M_v_; text: .text%__1cNPhasePeephole2t6MpnNPhaseRegAlloc_rnIPhaseCFG__v_; -text: .text%__1cJPhaseLive2T6M_v_; -text: .text%__1cNPhasePeephole2T6M_v_; text: .text%__1cHCompileGOutput6M_v_; text: .text%__1cHCompileQShorten_branches6MpnFLabel_ri333_v_; text: .text%__1cHCompileLFill_buffer6M_v_; text: .text%__1cHCompileTFillExceptionTables6MIpI1pnFLabel__v_; text: .text%__1cHCompileRScheduleAndBundle6M_v_; text: .text%__1cOMachPrologNodeFreloc6kM_i_; -text: .text%__1cNtestU_regNodePoper_input_base6kM_I_; -text: .text%__1cWemit_exception_handler6FrnKCodeBuffer__v_; text: .text%__1cWsize_exception_handler6F_I_; text: .text%__1cWImplicitExceptionTableIset_size6MI_v_; text: .text%__1cNPhasePeepholeMdo_transform6M_v_; text: .text%__1cMPhaseChaitinMfixup_spills6M_v_; -text: .text%__1cMPhaseChaitin2T6M_v_; text: .text%__1cNPhaseRegAllocPalloc_node_regs6Mi_v_; -text: .text%__1cKCodeBufferOrelocate_stubs6M_v_; -text: .text%__1cIPhaseCFGLRemoveEmpty6M_v_; text: .text%__1cLdo_liveness6FpnNPhaseRegAlloc_pnIPhaseCFG_pnKBlock_List_ipnFArena_pnEDict__v_: buildOopMap.o; text: .text%__1cHCompileMBuildOopMaps6M_v_; text: .text%__1cMPhaseChaitinbApost_allocate_copy_removal6M_v_; -text: .text%__1cNGrowableArray4CpnJNode_List__2t6Mii_v_; text: .text%__1cRsarL_rReg_immNodeHtwo_adr6kM_I_; text: .text%__1cOGenerateOopMapIcopy_cts6MpnNCellTypeState_2_i_; text: .text%__1cFStateM_sub_Op_CmpL6MpknENode__v_; @@ -4167,70 +2688,44 @@ text: .text%__1cJloadSNodeFreloc6kM_i_; text: .text%__1cFStateN_sub_Op_LoadS6MpknENode__v_; text: .text%__1cSInterpreterRuntimeOprofile_method6FpnKJavaThread_pC_i_; text: .text%__1cOCompiledRFrame2t6MnFframe_pnKJavaThread_pnGRFrame__v_; -text: .text%__1cKC2IAdapterOis_c2i_adapter6kM_i_; text: .text%__1cOCompiledRFrameKtop_method6kM_nMmethodHandle__; -text: .text%__1cOCompiledRFrameLis_compiled6kM_i_; -text: .text%__1cRmethodDataOopDescKinitialize6MpnNmethodOopDesc__v_; text: .text%__1cKoopFactoryOnew_methodData6FnMmethodHandle_pnGThread__pnRmethodDataOopDesc__; -text: .text%__1cRmethodDataOopDescbGcompute_allocation_size_in_bytes6FpnNmethodOopDesc__i_; text: .text%__1cPmethodDataKlassIallocate6MnMmethodHandle_pnGThread__pnRmethodDataOopDesc__; text: .text%__1cNxorI_rRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cRmethodDataOopDescbGcompute_allocation_size_in_words6FpnNmethodOopDesc__i_; text: .text%__1cRmethodDataOopDescPpost_initialize6MpnOBytecodeStream__v_; text: .text%__1cHRetNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateO_sub_Op_Return6MpknENode__v_; text: .text%__1cHRetNodeFreloc6kM_i_; -text: .text%__1cZInterpreterMacroAssemblerNdispatch_base6MnITosState_ppCi_v_; -text: .text%__1cZCallInterpreterDirectNodeHtwo_adr6kM_I_; -text: .text%__1cNloadConP0NodeFclone6kM_pnENode__; -text: .text%__1cOClearArrayNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cKScopeValueJread_from6FpnTDebugInfoReadStream__p0_; text: .text%__1cOcompiledVFrameScreate_stack_value6kMpnKScopeValue__pnKStackValue__; text: .text%__1cQleaPIdxScaleNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cRindIndexScaleOperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_; -text: .text%__1cIGraphKitNallocate_heap6MpnENode_222pknITypeFunc_pC22ipknKTypeOopPtr__2_; -text: .text%__1cPciInstanceKlassbBcompute_shared_has_subklass6M_i_; text: .text%__1cNSignatureInfoHdo_byte6M_v_; -text: .text%__1cQorI_rReg_immNodePoper_input_base6kM_I_; text: .text%__1cKCompiledICSset_ic_destination6MpC_v_; -text: .text%__1cNIdealLoopTreePiteration_split6MpnOPhaseIdealLoop_rnJNode_List__v_; text: .text%__1cNandI_rRegNodeErule6kM_I_; -text: .text%__1cRsarI_rReg_immNodeJnum_opnds6kM_I_; text: .text%__1cIMulINodeGadd_id6kM_pknEType__; text: .text%__1cVcompiledICHolderKlassIoop_size6kMpnHoopDesc__i_; text: .text%__1cNmodI_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIMulINodeImul_ring6kMpknEType_3_3_; text: .text%__1cKloadUBNodeMideal_Opcode6kM_i_; -text: .text%__1cHBitDataKis_BitData6M_i_; text: .text%__1cQsalI_rReg_CLNodeMideal_Opcode6kM_i_; -text: .text%__1cNaddP_rRegNodeJnum_opnds6kM_I_; text: .text%__1cJAssemblerEcmpq6MnHAddress_i_v_; text: .text%__1cNloadConP0NodeFreloc6kM_i_; -text: .text%__1cMLinkResolverYresolve_interface_method6FrnMmethodHandle_nLKlassHandle_nMsymbolHandle_43ipnGThread__v_; text: .text%__1cSmembar_acquireNodeLbottom_type6kM_pknEType__; text: .text%__1cOMacroAssemblerKincrementq6MpnMRegisterImpl_i_v_; text: .text%__1cRsarI_rReg_immNodeHtwo_adr6kM_I_; text: .text%__1cZInterpreterMacroAssemblerNdispatch_next6MnITosState_i_v_; -text: .text%__1cNGrowableArray4nMmethodHandle__2t6Mii_v_; text: .text%__1cLConvL2INodeJideal_reg6kM_I_; -text: .text%__1cNGrowableArray4nLKlassHandle__2t6Mii_v_; -text: .text%__1cNmethodOopDescThas_native_function6kM_i_; text: .text%JVM_GetClassNameUTF; -text: .text%__1cMPrefetchNodeJideal_reg6kM_I_; -text: .text%__1cKCodeBuffer2t6MpCi_v_; text: .text%__1cNprefetchwNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cFStateQ_sub_Op_Prefetch6MpknENode__v_; text: .text%__1cOjmpLoopEndNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cNprefetchwNodeFreloc6kM_i_; text: .text%__1cIAddLNodeJideal_reg6kM_I_; text: .text%__1cILocation2t6MpnTDebugInfoReadStream__v_; text: .text%__1cKstoreCNodeFreloc6kM_i_; -text: .text%__1cNdecI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cNmethodOopDescWis_vanilla_constructor6kM_i_; text: .text%__1cWCallLeafNoFPDirectNodeKmethod_set6Ml_v_; text: .text%__1cOPhaseIdealLoopOplace_near_use6kMpnENode__2_; text: .text%__1cHi2bNodeMideal_Opcode6kM_i_; -text: .text%__1cNLocationValueLis_location6kM_i_; text: .text%__1cNLocationValue2t6MpnTDebugInfoReadStream__v_; text: .text%__1cIMulLNodeJideal_reg6kM_I_; text: .text%__1cNsubL_rRegNodeHtwo_adr6kM_I_; @@ -4241,33 +2736,22 @@ text: .text%JVM_FindClassFromClass; text: .text%__1cKcmpOpUOperEless6kM_i_; text: .text%__1cVcompiledICHolderKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cVcompiledICHolderKlassToop_adjust_pointers6MpnHoopDesc__i_; -text: .text%__1cKReflectionGinvoke6FnTinstanceKlassHandle_nMmethodHandle_nGHandle_inOobjArrayHandle_nJBasicType_4ipnGThread__pnHoopDesc__; -text: .text%__1cITypeLongFwiden6kMpknEType__3_; -text: .text%__1cQsalI_rReg_CLNodePoper_input_base6kM_I_; text: .text%__1cbIjava_lang_reflect_AccessibleObjectIoverride6FpnHoopDesc__C_; text: .text%__1cKReflectionDbox6FpnGjvalue_nJBasicType_pnGThread__pnHoopDesc__; -text: .text%__1cMLinkResolverbHlinktime_resolve_interface_method6FrnMmethodHandle_nLKlassHandle_nMsymbolHandle_43ipnGThread__v_; text: .text%__1cLBoxLockNodeEhash6kM_I_; text: .text%__1cJOopMapSetMgrow_om_data6M_v_; -text: .text%__1cRxorI_rReg_memNodeJnum_opnds6kM_I_; -text: .text%__1cKciTypeFlowFBlockQset_private_copy6Mi_v_; text: .text%__1cWandI_rReg_imm65535NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cWandI_rReg_imm65535NodeErule6kM_I_; text: .text%__1cZInterpreterMacroAssemblerGpush_i6MpnMRegisterImpl__v_; text: .text%__1cNcmovI_regNodeErule6kM_I_; text: .text%__1cRsalL_rReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNGrowableArray4CpnKInlineTree__Egrow6Mi_v_; -text: .text%__1cSComputeAdapterInfoIdo_short6M_v_; -text: .text%__1cNtestL_regNodeJnum_opnds6kM_I_; text: .text%__1cLConvF2DNodeGOpcode6kM_i_; text: .text%__1cISubLNodeLbottom_type6kM_pknEType__; text: .text%__1cSmembar_acquireNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cSmembar_acquireNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cNaddP_rRegNodeLbottom_type6kM_pknEType__; text: .text%__1cNmodL_rRegNodeErule6kM_I_; -text: .text%__1cRsalI_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJAssemblerDret6Mi_v_; -text: .text%__1cRshrI_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cbDjava_lang_reflect_ConstructorPparameter_types6FpnHoopDesc__2_; text: .text%__1cKReflectionSinvoke_constructor6FpnHoopDesc_nOobjArrayHandle_pnGThread__2_; text: .text%__1cbDjava_lang_reflect_ConstructorFclazz6FpnHoopDesc__2_; @@ -4298,72 +2782,40 @@ text: .text%__1cTtypeArrayKlassKlassOklass_oop_size6kM_i_; text: .text%__1cWconstantPoolCacheKlassOklass_oop_size6kM_i_; text: .text%__1cQconstMethodKlassOklass_oop_size6kM_i_; text: .text%__1cPmethodDataKlassOklass_oop_size6kM_i_; -text: .text%__1cGThreadOis_interrupted6Fp0i_i_; -text: .text%__1cHThreadsHoops_do6FpnKOopClosure__v_; text: .text%__1cJHashtableHoops_do6MpnKOopClosure__v_; text: .text%__1cSsafePoint_pollNodeIpipeline6kM_pknIPipeline__; text: .text%__1cIPSOldGenHcompact6M_v_; -text: .text%__1cSsafePoint_pollNodeJnum_opnds6kM_I_; text: .text%__1cFJNIidHoops_do6MpnKOopClosure__v_; -text: .text%__1cJvmSymbolsHoops_do6FpnKOopClosure_i_v_; text: .text%__1cJHashtableGunlink6MpnRBoolObjectClosure__v_; -text: .text%__1cSReferenceProcessorHoops_do6MpnKOopClosure__v_; text: .text%__1cQObjectStartArrayFreset6M_v_; text: .text%__1cIPSOldGenPadjust_pointers6M_v_; text: .text%__1cScompP_mem_rRegNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cJloadBNodeFreloc6kM_i_; text: .text%__1cUandI_rReg_imm255NodeMideal_Opcode6kM_i_; -text: .text%__1cNGrowableArray4CpnKciTypeFlowFBlock__Icontains6kMrk2_i_; text: .text%__1cScompP_mem_rRegNodeFreloc6kM_i_; -text: .text%__1cNcmovP_regNodePoper_input_base6kM_I_; -text: .text%__1cTno_rax_rdx_RegIOperJnum_edges6kM_I_; text: .text%__1cKciTypeFlowLStateVectorJdo_aaload6MpnQciBytecodeStream__v_; -text: .text%__1cJAssemblerMemit_operand6MpnRFloatRegisterImpl_nHAddress__v_; -text: .text%__1cJAssemblerMemit_operand6MpnRFloatRegisterImpl_pnMRegisterImpl_4nHAddressLScaleFactor_ipCrknQRelocationHolder__v_; text: .text%__1cNaddL_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cLRethrowNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cRaddI_rReg_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRsubI_rReg_memNodeHtwo_adr6kM_I_; text: .text%__1cIModLNodeGOpcode6kM_i_; text: .text%__1cIMaxINodeLbottom_type6kM_pknEType__; text: .text%__1cFParseMdo_checkcast6M_v_; text: .text%__1cIMulINodeGmul_id6kM_pknEType__; -text: .text%__1cMloadConINodeGis_Con6kM_I_; text: .text%__1cIregDOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cIMulDNodeGOpcode6kM_i_; text: .text%__1cRsarL_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNsubL_rRegNodeQuse_cisc_RegMask6M_v_; -text: .text%__1cHnmethodUnumber_of_dependents6kM_i_; -text: .text%__1cTconvI2L_reg_memNodeFreloc6kM_i_; -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_; text: .text%__1cRmulL_rReg_immNodeMcisc_operand6kM_i_; -text: .text%__1cNloadConI0NodeGis_Con6kM_I_; -text: .text%__1cKstoreBNodeHtwo_adr6kM_I_; -text: .text%__1cOmangle_name_on6FpnMoutputStream_pnNsymbolOopDesc__v_: nativeLookup.o; -text: .text%__1cKRegionNodeUdepends_only_on_test6kM_i_; text: .text%__1cMMergeMemNodeIadr_type6kM_pknHTypePtr__; -text: .text%__1cFciEnvZcall_has_multiple_targets6FpnNinstanceKlass_nMsymbolHandle_3ri_i_; -text: .text%__1cMadjust_check6FpnENode_11iipnMPhaseIterGVN__v_: ifnode.o; -text: .text%__1cPsalI_rReg_1NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cTconvI2L_reg_memNodeHtwo_adr6kM_I_; text: .text%__1cLPhaseValuesKis_IterGVN6M_pnMPhaseIterGVN__; text: .text%__1cQciTypeArrayKlassJmake_impl6FnJBasicType__p0_; text: .text%__1cFStateM_sub_Op_AddL6MpknENode__v_; text: .text%__1cQciTypeArrayKlassEmake6FnJBasicType__p0_; -text: .text%__1cUmembar_cpu_orderNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cUmembar_cpu_orderNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNSCMemProjNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cSCompareAndSwapNodeJideal_reg6kM_I_; -text: .text%__1cFStateW_sub_Op_MemBarCPUOrder6MpknENode__v_; text: .text%__1cKciTypeFlowLStateVectorMdo_checkcast6MpnQciBytecodeStream__v_; -text: .text%__1cMorI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cMrax_RegIOperKin_RegMask6kMi_pknHRegMask__; text: .text%lwp_mutex_init: os_solaris.o; text: .text%__1cJStubQdDueueGcommit6Mi_v_; @@ -4375,79 +2827,49 @@ text: .text%__1cOGenerateOopMapOdo_monitorexit6Mi_v_; text: .text%__1cOGenerateOopMapLmonitor_pop6M_nNCellTypeState__; text: .text%__1cJAssemblerEmovl6MnHAddress_i_v_; text: .text%__1cKoopFactoryNnew_charArray6FpkcpnGThread__pnQtypeArrayOopDesc__; -text: .text%__1cPshrI_rReg_1NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cQjava_lang_StringTcreate_oop_from_str6FpkcpnGThread__pnHoopDesc__; -text: .text%__1cRmulI_rReg_immNodeJnum_opnds6kM_I_; text: .text%__1cNandI_rRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cbACallCompiledJavaDirectNodeHtwo_adr6kM_I_; text: .text%__1cIModINodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cNinstanceKlassVis_same_class_package6MpnHoopDesc_pnNsymbolOopDesc__i_; -text: .text%__1cbLtransform_int_divide_to_long_multiply6FpnIPhaseGVN_pnENode_i_3_: divnode.o; text: .text%__1cTno_rax_rdx_RegIOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cJAssemblerGmovzwl6MpnMRegisterImpl_nHAddress__v_; text: .text%__1cRmulL_rReg_immNodeErule6kM_I_; text: .text%__1cZCallDynamicJavaDirectNodePoper_input_base6kM_I_; -text: .text%__1cHTypePtrFempty6kM_i_; -text: .text%__1cOMacroAssemblerSload_unsigned_word6MpnMRegisterImpl_nHAddress__i_; text: .text%__1cOGenerateOopMapXdo_return_monitor_check6M_v_; -text: .text%__1cNobjArrayKlassQarray_klass_impl6MipnGThread__pnMklassOopDesc__; text: .text%__1cFStateP_sub_Op_ConvL2I6MpknENode__v_; text: .text%__1cLOptoRuntimebBcomplete_monitor_enter_Type6F_pknITypeFunc__; text: .text%__1cIGraphKitMnext_monitor6M_i_; text: .text%__1cLBoxLockNode2t6Mi_v_; -text: .text%__1cRmulI_rReg_immNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cJloadFNodeZcheck_for_anti_dependence6kM_i_; -text: .text%__1cIplus_adr6FpnENode_l_1_: generateOptoStub.o; text: .text%__1cIGraphKitLshared_lock6MpnENode__pnMFastLockNode__; -text: .text%__1cHConNode2t6MpknEType__v_; text: .text%__1cMloadConDNodeMideal_Opcode6kM_i_; -text: .text%__1cNCompileBrokerTcreate_compile_task6FpnMCompileQdDueue_inMmethodHandle_i3ipkcii_pnLCompileTask__; -text: .text%__1cLCompileTaskKinitialize6MinMmethodHandle_i1ipkcii_v_; text: .text%__1cNCompileBrokerNallocate_task6F_pnLCompileTask__; text: .text%__1cMCompileQdDueueDadd6MpnLCompileTask__v_; text: .text%__1cRxorI_rReg_memNodeErule6kM_I_; text: .text%__1cMCompileQdDueueDget6M_pnLCompileTask__; text: .text%__1cRsarI_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cQleaPIdxScaleNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cSCompileTaskWrapper2t6MpnLCompileTask__v_; text: .text%__1cQjava_lang_ThreadGthread6FpnHoopDesc__pnKJavaThread__; text: .text%__1cXmembar_acquire_lockNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateM_sub_Op_MulL6MpknENode__v_; text: .text%__1cCosPhint_no_preempt6F_v_; text: .text%__1cJAssemblerFtestl6MpnMRegisterImpl_i_v_; -text: .text%__1cObox_handleNodePoper_input_base6kM_I_; text: .text%__1cNCompileBrokerJfree_task6FpnLCompileTask__v_; text: .text%__1cSCompileTaskWrapper2T6M_v_; text: .text%__1cLCompileTaskEfree6M_v_; text: .text%__1cNnegI_rRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cKDictionarybAis_valid_protection_domain6MiInMsymbolHandle_nGHandle_2_i_; text: .text%__1cMincI_memNodeMideal_Opcode6kM_i_; text: .text%__1cRandL_rReg_immNodeMideal_Opcode6kM_i_; text: .text%__1cRaddI_rReg_memNodeFreloc6kM_i_; text: .text%__1cQjava_lang_StringXcreate_oop_from_unicode6FpHipnGThread__pnHoopDesc__; text: .text%jni_NewString: jni.o; -text: .text%__1cRxorI_rReg_immNodePoper_input_base6kM_I_; text: .text%__1cFStateM_sub_Op_AndL6MpknENode__v_; text: .text%__1cKloadUBNodePoper_input_base6kM_I_; -text: .text%__1cbBconvI2L_reg_reg_reg_zexNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cVcompiledICHolderKlassXoop_is_compiledICHolder6kM_i_; -text: .text%__1cJStoreNodeUdepends_only_on_test6kM_i_; text: .text%__1cPcmovI_reg_lNodeErule6kM_I_; -text: .text%__1cOloadConL32NodePoper_input_base6kM_I_; text: .text%__1cNSharedRuntimebJcontinuation_for_implicit_exception6FpnKJavaThread_pCn0AVImplicitExceptionKind__3_; -text: .text%__1cRtestI_reg_immNodeHtwo_adr6kM_I_; text: .text%__1cIimmDOperJconstantD6kM_d_; text: .text%__1cFParsePmerge_exception6Mi_v_; text: .text%__1cXmembar_acquire_lockNodeIadr_type6kM_pknHTypePtr__; text: .text%__1cNGrowableArray4CpnIciObject__2t6MpnFArena_iirk1_v_; -text: .text%__1cICallInfoDset6MnLKlassHandle_1nMmethodHandle_2pnGThread__v_; -text: .text%__1cZCallDynamicJavaDirectNodeHtwo_adr6kM_I_; -text: .text%__1cMLinkResolverbGruntime_resolve_interface_method6FrnICallInfo_nMmethodHandle_nLKlassHandle_nGHandle_4ipnGThread__v_; -text: .text%__1cMLinkResolverWresolve_interface_call6FrnICallInfo_nGHandle_nLKlassHandle_4nMsymbolHandle_54iipnGThread__v_; text: .text%__1cNGrowableArray4CpnIciObject__JappendAll6Mpk2_v_; -text: .text%__1cFciEnv2t6MpnHJNIEnv__iii_v_; -text: .text%__1cRtestP_reg_memNodeFreloc6kM_i_; -text: .text%__1cNtestP_regNodeMcisc_version6Mi_pnIMachNode__; text: .text%__1cNGrowableArray4CpnIciMethod__2t6MpnFArena_iirk1_v_; text: .text%__1cNGrowableArray4CpnHciKlass__2t6MpnFArena_iirk1_v_; text: .text%__1cPciObjectFactory2t6MpnFArena_i_v_; @@ -4461,49 +2883,36 @@ text: .text%__1cKstoreBNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cNCompileBrokerUpop_jni_handle_block6F_v_; text: .text%__1cbBopt_virtual_call_RelocationLstatic_stub6M_pC_; text: .text%__1cNinstanceKlassbFlookup_method_in_all_interfaces6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; -text: .text%__1cPcmpFastLockNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cFStateQ_sub_Op_FastLock6MpknENode__v_; text: .text%__1cXmembar_acquire_lockNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cTconvD2I_reg_regNodeErule6kM_I_; text: .text%__1cITemplateIbytecode6kM_nJBytecodesECode__; -text: .text%__1cLOptoRuntimeRmultianewarray1_C6FpnMklassOopDesc_ipnKJavaThread__v_; text: .text%__1cWImplicitExceptionTableCat6kMI_I_; text: .text%__1cWImplicitExceptionTable2t6MpknHnmethod__v_; text: .text%__1cLVtableStubsPstub_containing6FpC_pnKVtableStub__; -text: .text%__1cLVtableStubsIcontains6FpC_i_; text: .text%__1cNFingerprinterIdo_float6M_v_; text: .text%__1cHnmethodbJcontinuation_for_implicit_exception6MpC_1_; text: .text%__1cLRShiftLNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cUjmpLoopEnd_shortNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cNmodI_rRegNodeHtwo_adr6kM_I_; text: .text%__1cUjmpLoopEnd_shortNodeMideal_Opcode6kM_i_; text: .text%__1cKEntryPoint2t6MpC11111111_v_; text: .text%jni_GetObjectClass: jni.o; text: .text%__1cRappend_interfaces6FnOobjArrayHandle_ripnPobjArrayOopDesc__v_; -text: .text%__1cRandI_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cISubLNodeDsub6kMpknEType_3_3_; text: .text%__1cJloadSNodeIpipeline6kM_pknIPipeline__; text: .text%__1cRtestI_reg_immNodeMideal_Opcode6kM_i_; -text: .text%__1cOloadConL32NodeHtwo_adr6kM_I_; -text: .text%__1cQshrI_rReg_CLNodePoper_input_base6kM_I_; text: .text%__1cSstring_compareNodePoper_input_base6kM_I_; text: .text%__1cNcmovI_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMdecI_memNodeMideal_Opcode6kM_i_; text: .text%__1cMrax_RegLOperEtype6kM_pknEType__; -text: .text%__1cRmulI_rReg_immNodeHtwo_adr6kM_I_; text: .text%__1cIXorINodeGadd_id6kM_pknEType__; text: .text%__1cNtestP_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cPcmovI_reg_gNodeHtwo_adr6kM_I_; -text: .text%__1cOPhaseIdealLoopKclone_loop6MpnNIdealLoopTree_rnJNode_List_i_v_; -text: .text%__1cHi2bNodePoper_input_base6kM_I_; -text: .text%__1cRsalL_rReg_immNodeJnum_opnds6kM_I_; text: .text%__1cKBinaryNodeGOpcode6kM_i_; text: .text%__1cNxorI_rRegNodeQuse_cisc_RegMask6M_v_; text: .text%__1cFStateO_sub_Op_Binary6MpknENode__v_; text: .text%JVM_GetClassLoader; text: .text%__1cMstoreSSPNodeMideal_Opcode6kM_i_; -text: .text%__1cNmulL_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cRxorI_rReg_memNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cINodeHashIround_up6FI_I_; text: .text%__1cHCompileKinit_start6MpnJStartNode__v_; text: .text%__1cOPhaseTransform2t6MpnFArena_nFPhaseLPhaseNumber__v_; @@ -4511,127 +2920,63 @@ text: .text%__1cLPhaseValues2t6MpnFArena_I_v_; text: .text%__1cRaddP_rReg_immNodeIpipeline6kM_pknIPipeline__; text: .text%__1cINodeHash2t6MpnFArena_I_v_; text: .text%__1cRaddI_rReg_memNodeHtwo_adr6kM_I_; -text: .text%__1cIJVMState2n6FL_pv_; text: .text%__1cOMacroAssemblerFalign6Mi_v_; -text: .text%__1cOleaPIdxOffNodeZcheck_for_anti_dependence6kM_i_; -text: .text%__1cFVTuneNregister_stub6FpkcpC3_v_; text: .text%__1cFForteNregister_stub6FpkcpC3_v_; -text: .text%__1cMdecI_memNodeJnum_opnds6kM_I_; -text: .text%__1cIModINodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cMLinkResolverXresolve_invokeinterface6FrnICallInfo_nGHandle_nSconstantPoolHandle_ipnGThread__v_; text: .text%lwp_cond_init: os_solaris.o; text: .text%__1cSmembar_releaseNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cSmembar_releaseNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cOPhaseIdealLoopVclone_up_backedge_goo6MpnENode_22_2_; text: .text%__1cSInterpreterCodeletKinitialize6MpkcnJBytecodesECode__v_; -text: .text%__1cTconvI2L_reg_regNodeMcisc_version6Mi_pnIMachNode__; text: .text%__1cNxorI_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNaddP_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cZInterpreterMacroAssemblerZcheck_and_handle_popframe6MpnMRegisterImpl__v_; text: .text%__1cOloadConL32NodeErule6kM_I_; -text: .text%__1cOMacroAssemblerMcall_VM_base6MpnMRegisterImpl_22pCii_v_; -text: .text%__1cFframeVnmethods_code_blob_do6M_v_; text: .text%__1cHi2bNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKcmpOpUOperKless_equal6kM_i_; -text: .text%__1cWandI_rReg_imm65535NodeJnum_opnds6kM_I_; text: .text%__1cFParseTprofile_switch_case6Mi_v_; text: .text%__1cKNativeJumpbEcheck_verified_entry_alignment6FpC1_v_; text: .text%__1cFParseSjump_switch_ranges6MpnENode_pnLSwitchRange_4i_v_; text: .text%__1cFParseOmerge_new_path6Mi_v_; -text: .text%__1cUBytecode_tableswitchGlength6M_i_; text: .text%__1cNandI_rRegNodeHtwo_adr6kM_I_; -text: .text%__1cNmodL_rRegNodePoper_input_base6kM_I_; -text: .text%__1cMloadConLNodeFclone6kM_pnENode__; -text: .text%__1cNtestU_regNodeJnum_opnds6kM_I_; -text: .text%__1cIimmLOperFclone6kM_pnIMachOper__; -text: .text%__1cRandL_rReg_immNodePoper_input_base6kM_I_; text: .text%__1cOleaPIdxOffNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKstoreBNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cMmatch_option6FpknMJavaVMOption_pkcp4_i_: arguments.o; -text: .text%__1cNCompileBrokerTis_not_compile_only6FnMmethodHandle__i_; text: .text%__1cNCompileBrokerRassign_compile_id6FnMmethodHandle_i_I_; -text: .text%__1cNCompileBrokerTis_compile_blocking6FnMmethodHandle_i_i_; text: .text%__1cIMulFNodeGOpcode6kM_i_; -text: .text%__1cNIdealLoopTreeQpolicy_peel_only6kMpnOPhaseIdealLoop__i_; -text: .text%__1cNIdealLoopTreeSpolicy_range_check6kMpnOPhaseIdealLoop__i_; -text: .text%__1cQSystemDictionaryPresolve_or_fail6FnMsymbolHandle_ipnGThread__pnMklassOopDesc__; -text: .text%__1cNIdealLoopTreeMpolicy_align6kMpnOPhaseIdealLoop__i_; -text: .text%__1cNIdealLoopTreeNpolicy_unroll6kMpnOPhaseIdealLoop__i_; text: .text%__1cNtestU_regNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNCompileBrokerZcompilation_is_prohibited6FnMmethodHandle_i_i_; text: .text%__1cNTemplateTableDdef6FnJBytecodesECode_inITosState_3pFi_vi_v_; -text: .text%__1cbCAbstractInterpreterGeneratorVgenerate_and_dispatch6MpnITemplate_nITosState__v_; text: .text%__1cITemplateIgenerate6MpnZInterpreterMacroAssembler__v_; -text: .text%__1cKC2CompilerOneeds_adapters6M_i_; -text: .text%__1cLServiceUtilLvisible_oop6FpnHoopDesc__i_; text: .text%__1cITemplateKinitialize6MinITosState_1pFi_vi_v_; text: .text%__1cNObjectMonitorGEnterI6MpnGThread__v_; -text: .text%__1cIciMethodJhas_loops6kM_i_; -text: .text%__1cIciMethodVshould_print_assembly6M_i_; -text: .text%__1cOMacroAssemblerOcall_VM_helper6MpnMRegisterImpl_pCii_v_; text: .text%__1cNloadConL0NodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cZInterpreterMacroAssemblerMcall_VM_base6MpnMRegisterImpl_22pCii_v_; -text: .text%__1cMincI_memNodeJnum_opnds6kM_I_; -text: .text%__1cNCompileBrokerOcheck_break_at6FnMmethodHandle_iii_i_; text: .text%__1cJAssemblerEcall6MrnFLabel_nJrelocInfoJrelocType__v_; -text: .text%__1cNCompileBrokerQset_last_compile6FpnOCompilerThread_nMmethodHandle_ii_v_; -text: .text%__1cNCompileBrokerbAeager_compile_c2i_adapters6FpnFciEnv_pnIciMethod__v_; -text: .text%__1cNCompileBrokerbAeager_compile_i2c_adapters6FpnFciEnv_pnIciMethod__v_; text: .text%__1cNCompileBrokerZinvoke_compiler_on_method6FpnLCompileTask__v_; text: .text%__1cKC2CompilerOcompile_method6MpnFciEnv_pnIciMethod_i_v_; -text: .text%__1cMstoreSSPNodeHis_Copy6kM_I_; text: .text%__1cQshrI_rReg_CLNodeMideal_Opcode6kM_i_; -text: .text%__1cFciEnvPregister_method6MpnIciMethod_iiiiiipnKCodeBuffer_ipnJOopMapSet_pnVExceptionHandlerTable_pnWImplicitExceptionTable_pnQAbstractCompiler_ii_v_; text: .text%__1cLAccessFlagsRatomic_clear_bits6Mi_v_; -text: .text%__1cIciMethodQbreak_at_execute6M_i_; text: .text%__1cFciEnvbOcheck_for_system_dictionary_modification6MpnIciMethod__v_; -text: .text%__1cFciEnvbUsystem_dictionary_modification_counter_changed6M_i_; text: .text%__1cMelapsedTimerDadd6M0_v_; text: .text%__1cNCompileBrokerScollect_statistics6FpnOCompilerThread_nMelapsedTimer_pnLCompileTask__v_; -text: .text%__1cJStartNodeScalling_convention6kMpnLOptoRegPair_I_v_; text: .text%__1cICodeHeapMinsert_after6MpnJFreeBlock_2_v_; -text: .text%__1cKExceptionsNnew_exception6FpnGThread_nMsymbolHandle_3pnRJavaCallArguments_nGHandle_6_6_; -text: .text%__1cFMutex2t6Mipkci_v_; text: .text%__1cKloadUBNodeErule6kM_I_; text: .text%__1cQsalL_rReg_CLNodeMideal_Opcode6kM_i_; -text: .text%__1cbACallCompiledJavaDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cbACallCompiledJavaDirectNodePoper_input_base6kM_I_; -text: .text%__1cTbasictype2arraycopy6FnJBasicType_i_pC_; -text: .text%__1cOLibraryCallKitQinline_arraycopy6M_i_; text: .text%__1cPstoreImmI16NodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cLOptoRuntimeOarraycopy_Type6F_pknITypeFunc__; -text: .text%__1cFciEnvbFpost_compiled_method_load_event6MpnHnmethod__v_; text: .text%__1cJCodeCacheGcommit6FpnICodeBlob__v_; -text: .text%__1cLPcDescCache2t6M_v_; text: .text%__1cFciEnvVnum_inlined_bytecodes6kM_i_; -text: .text%__1cHnmethodSresolve_JNIHandles6M_v_; text: .text%__1cRmulL_rReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cVExceptionHandlerTableHcopy_to6MpnHnmethod__v_; text: .text%__1cWImplicitExceptionTableHcopy_to6MpnHnmethod__v_; -text: .text%__1cFVTuneOcreate_nmethod6FpnHnmethod__v_; text: .text%__1cYDebugInformationRecorderHcopy_to6MpnHnmethod__v_; -text: .text%__1cHnmethodLnew_nmethod6FnMmethodHandle_iiiiiipnYDebugInformationRecorder_pnKCodeBuffer_ipnJOopMapSet_pnVExceptionHandlerTable_pnWImplicitExceptionTable_pnQAbstractCompiler__p0_; text: .text%__1cPcmovI_reg_lNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cHnmFlagsFclear6M_v_; text: .text%__1cHnmethod2n6FLi_pv_; -text: .text%__1cHnmethod2t6MpnNmethodOopDesc_iiiiiiipnYDebugInformationRecorder_pnKCodeBuffer_ipnJOopMapSet_pnVExceptionHandlerTable_pnWImplicitExceptionTable_pnQAbstractCompiler__v_; -text: .text%__1cNaddI_rRegNodeMcisc_version6Mi_pnIMachNode__; text: .text%__1cKTypeRawPtrFxdual6kM_pknEType__; text: .text%__1cHnmethodQcopy_scopes_data6MpCi_v_; -text: .text%__1cLOopRecorderHcopy_to6MpnICodeBlob__v_; -text: .text%__1cICodeBlobJcopy_oops6MppnI_jobject_i_v_; -text: .text%__1cFStateN_sub_Op_LoadC6MpknENode__v_; -text: .text%__1cJloadCNodeFreloc6kM_i_; text: .text%__1cFParseQjump_if_fork_int6MpnENode_2nIBoolTestEmask__pnGIfNode__; text: .text%__1cWandI_rReg_imm65535NodeHtwo_adr6kM_I_; -text: .text%__1cNdivL_rRegNodePoper_input_base6kM_I_; -text: .text%__1cNmethodOopDescIset_code6MpnHnmethod__v_; text: .text%__1cINodeHashUremove_useless_nodes6MrnJVectorSet__v_; text: .text%__1cQUnique_Node_ListUremove_useless_nodes6MrnJVectorSet__v_; text: .text%__1cKInlineTreeWbuild_inline_tree_root6F_p0_; -text: .text%__1cHCompile2t6MpnFciEnv_pnKC2Compiler_pnIciMethod_ii_v_; text: .text%__1cHCompileWprint_compile_messages6M_v_; -text: .text%__1cPClassFileParserbGparse_constant_pool_double_entry6MnSconstantPoolHandle_ipnGThread__v_; text: .text%__1cQsalI_rReg_CLNodeErule6kM_I_; text: .text%__1cHCompileRbuild_start_state6MpnJStartNode_pknITypeFunc__pnIJVMState__; text: .text%__1cHCompileVidentify_useful_nodes6MrnQUnique_Node_List__v_; @@ -4641,42 +2986,27 @@ text: .text%__1cHCompileUremove_useless_nodes6MrnQUnique_Node_List__v_; text: .text%__1cSPhaseRemoveUseless2t6MpnIPhaseGVN_pnQUnique_Node_List__v_; text: .text%__1cHCompileLFinish_Warm6M_v_; text: .text%__1cHCompileLInline_Warm6M_i_; -text: .text%__1cPno_rax_RegLOperJnum_edges6kM_I_; text: .text%__1cMPhaseIterGVN2t6MpnIPhaseGVN__v_; -text: .text%__1cJBytecodesDdef6Fn0AECode_pkc33nJBasicType_ii1_v_; text: .text%__1cIciMethodRbuild_method_data6MnMmethodHandle__v_; text: .text%__1cSstring_compareNodeErule6kM_I_; text: .text%__1cbAfinal_graph_reshaping_walk6FrnKNode_Stack_pnENode_rnUFinal_Reshape_Counts__v_: compile.o; -text: .text%__1cHCompileVfinal_graph_reshaping6M_i_; -text: .text%__1cOcompI_rRegNodeMcisc_version6Mi_pnIMachNode__; text: .text%__1cScompI_rReg_memNodeFreloc6kM_i_; text: .text%__1cJStartNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cNTemplateTableKtransition6FnITosState_1_v_; text: .text%__1cIPhaseCCPJtransform6MpnENode__2_; text: .text%__1cHCompileNreturn_values6MpnIJVMState__v_; -text: .text%__1cbCAbstractInterpreterGeneratorQset_entry_points6MnJBytecodesECode__v_; -text: .text%__1cbCAbstractInterpreterGeneratorWset_short_entry_points6MpnITemplate_rpC44444444_v_; text: .text%__1cMPhaseIterGVN2t6Mp0_v_; text: .text%__1cIPhaseCCP2t6MpnMPhaseIterGVN__v_; -text: .text%__1cIPhaseCCP2T6M_v_; text: .text%__1cIPhaseCCPHanalyze6M_v_; text: .text%__1cIPhaseCCPMdo_transform6M_v_; text: .text%__1cOcompI_rRegNodeIpipeline6kM_pknIPipeline__; text: .text%__1cNsubL_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cNloadConPcNodeMideal_Opcode6kM_i_; -text: .text%__1cKExceptionsG_throw6FpnGThread_pkcinGHandle__v_; -text: .text%__1cKExceptionsRspecial_exception6FpnGThread_pkcinGHandle__i_; -text: .text%__1cGThreadVset_pending_exception6MpnHoopDesc_pkci_v_; -text: .text%__1cNandL_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cLklassItableUcompute_itable_index6FpnNmethodOopDesc__i_; text: .text%__1cWpoll_return_RelocationEtype6M_nJrelocInfoJrelocType__; text: .text%__1cWConstantPoolCacheEntrySset_interface_call6MnMmethodHandle_i_v_; text: .text%__1cJloadFNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cPClassFileParserUverify_constantvalue6MiinSconstantPoolHandle_pnGThread__v_; -text: .text%__1cQsalI_rReg_CLNodeJnum_opnds6kM_I_; -text: .text%__1cIMachNodeJis_MachIf6kM_pknKMachIfNode__; text: .text%__1cPsalL_rReg_1NodeMideal_Opcode6kM_i_; -text: .text%__1cKExceptionsRspecial_exception6FpnGThread_pkcinMsymbolHandle_4_i_; text: .text%__1cQjava_lang_StringScreate_from_symbol6FnMsymbolHandle_pnGThread__nGHandle__; text: .text%__1cOClearArrayNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cHMatcherbDinterpreter_frame_pointer_reg6F_i_; @@ -4684,32 +3014,16 @@ text: .text%__1cQorI_rReg_immNodeErule6kM_I_; text: .text%__1cJJavaCallsMcall_special6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_53pnGThread__v_; text: .text%__1cSInterpreterRuntimeXthrow_pending_exception6FpnKJavaThread__v_; text: .text%__1cKcmpOpUOperHgreater6kM_i_; -text: .text%__1cNCompileBrokerUcheck_adapter_result6FnMmethodHandle_ippnMBasicAdapter__i_; -text: .text%__1cJloadFNodeJnum_opnds6kM_I_; text: .text%__1cYinternal_word_RelocationEtype6M_nJrelocInfoJrelocType__; -text: .text%__1cSMachC2IEntriesNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cbFunnecessary_membar_volatileNodePoper_input_base6kM_I_; text: .text%__1cRmulI_rReg_immNodeQuse_cisc_RegMask6M_v_; -text: .text%__1cQPSIsAliveClosureLdo_object_b6MpnHoopDesc__i_; -text: .text%__1cTCallInterpreterNodeSis_CallInterpreter6kM_pk0_; -text: .text%__1cZCallInterpreterDirectNodePcompute_padding6kMi_i_; -text: .text%__1cSMachC2IcheckICNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cZInterpreterMacroAssemblerPdispatch_epilog6MnITosState_i_v_; text: .text%__1cZInterpreterMacroAssemblerPdispatch_prolog6MnITosState_i_v_; -text: .text%__1cZCallInterpreterDirectNodeKmethod_set6Ml_v_; -text: .text%__1cXMachCallInterpreterNodePret_addr_offset6M_i_; text: .text%__1cQjava_lang_StringPcreate_from_str6FpkcpnGThread__nGHandle__; -text: .text%__1cLOptoRuntimeInew_Type6F_pknITypeFunc__; text: .text%__1cLBoxLockNodeDcmp6kMrknENode__I_; text: .text%__1cMTailCallNodeGOpcode6kM_i_; text: .text%__1cJChunkPoolMfree_all_but6ML_v_; -text: .text%__1cIGraphKitMnew_instance6MpnPciInstanceKlass__pnENode__; -text: .text%__1cPcmpD_cc_regNodePoper_input_base6kM_I_; text: .text%__1cRsalL_rReg_immNodeHtwo_adr6kM_I_; -text: .text%__1cLOptoRuntimeSnew_typeArray_Type6F_pknITypeFunc__; -text: .text%__1cObox_handleNodeMideal_Opcode6kM_i_; text: .text%__1cJJavaCallsMcall_special6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_533pnGThread__v_; -text: .text%__1cIGraphKitJnew_array6MpnENode_nJBasicType_pknEType_pknMTypeKlassPtr__2_; text: .text%__1cNdecL_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cKJavaThreadZsecurity_get_caller_class6Mi_pnMklassOopDesc__; text: .text%__1cZCallDynamicJavaDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -4717,23 +3031,15 @@ text: .text%__1cOemit_d64_reloc6FrnKCodeBuffer_lrknQRelocationHolder_i_v_; text: .text%__1cRtestI_reg_immNodeErule6kM_I_; text: .text%__1cIAddFNodeGOpcode6kM_i_; text: .text%__1cSstring_compareNodeMideal_Opcode6kM_i_; -text: .text%__1cNmethodOopDescWcompute_has_loops_flag6M_i_; -text: .text%__1cKloadUBNodeJnum_opnds6kM_I_; -text: .text%__1cNGrowableArray4CpnHoopDesc__2t6Mii_v_; text: .text%__1cZCallDynamicJavaDirectNodeSalignment_required6kM_i_; -text: .text%__1cXvirtual_call_RelocationJpack_data6M_i_; text: .text%__1cXvirtual_call_RelocationEtype6M_nJrelocInfoJrelocType__; text: .text%__1cQorI_rReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cUParallelScavengeHeapIcapacity6kM_L_; text: .text%__1cJAssemblerEcmpq6MpnMRegisterImpl_nHAddress__v_; -text: .text%__1cNnegI_rRegNodeJnum_opnds6kM_I_; -text: .text%__1cYinternal_word_RelocationJpack_data6M_i_; -text: .text%__1cKsplit_once6FpnMPhaseIterGVN_pnENode_333_v_: cfgnode.o; text: .text%__1cQSystemDictionarybAvalidate_protection_domain6FnTinstanceKlassHandle_nGHandle_2pnGThread__v_; text: .text%__1cPDictionaryEntryVadd_protection_domain6MpnHoopDesc__v_; text: .text%__1cbIjava_lang_reflect_AccessibleObjectMset_override6FpnHoopDesc_C_v_; text: .text%__1cRCardTableModRefBSPclear_MemRegion6MnJMemRegion__v_; -text: .text%__1cOleaPIdxOffNodeLbottom_type6kM_pknEType__; text: .text%__1cNdivL_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cFParsebLincrement_and_test_invocation_counter6Mi_v_; text: .text%__1cKDictionaryVadd_protection_domain6MiInTinstanceKlassHandle_nGHandle_2pnGThread__v_; @@ -4742,28 +3048,14 @@ text: .text%__1cFParseRarray_store_check6M_v_; text: .text%__1cNobjArrayKlassWcompute_modifier_flags6kMpnGThread__i_; text: .text%__1cScompL_rReg_immNodeMideal_Opcode6kM_i_; text: .text%__1cTmembar_volatileNodeMideal_Opcode6kM_i_; -text: .text%__1cTCallDynamicJavaNodeSis_CallDynamicJava6kM_pk0_; -text: .text%__1cCosHSolarisFEventEpark6M_v_; -text: .text%__1cIMinINodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cODeoptimizationYtrap_state_is_recompiled6Fi_i_; text: .text%__1cXSignatureHandlerLibraryKinitialize6F_v_; text: .text%__1cXSignatureHandlerLibraryDadd6FnMmethodHandle__v_; text: .text%__1cSInterpreterRuntimeTprepare_native_call6FpnKJavaThread_pnNmethodOopDesc__v_; text: .text%__1cNGrowableArray4CL_Efind6kMrkL_i_; -text: .text%__1cUandI_rReg_imm255NodePoper_input_base6kM_I_; -text: .text%__1cSReferenceProcessorZadd_to_discovered_list_mt6MppnHoopDesc_23_v_; text: .text%__1cSInterpreterRuntimeNquicken_io_cc6FpnKJavaThread__v_; -text: .text%__1cJBytecodesDdef6Fn0AECode_pkc33nJBasicType_ii_v_; text: .text%__1cHOrINodeIadd_ring6kMpknEType_3_3_; -text: .text%__1cNObjectMonitorbAEntryQdDueue_SelectSuccessor6M_pnMObjectWaiter__; -text: .text%__1cNObjectMonitorREntryQdDueue_insert6MpnMObjectWaiter_i_v_; text: .text%__1cSobjArrayKlassKlassXallocate_objArray_klass6MinLKlassHandle_pnGThread__pnMklassOopDesc__; -text: .text%__1cJAssemblerEpopq6MpnMRegisterImpl__v_; text: .text%__1cSobjArrayKlassKlassbCallocate_objArray_klass_impl6FnYobjArrayKlassKlassHandle_inLKlassHandle_pnGThread__pnMklassOopDesc__; -text: .text%__1cISubLNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cMTypeKlassPtrRcast_to_exactness6kMi_pknEType__; -text: .text%__1cNloadConI0NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cSComputeAdapterInfoHdo_char6M_v_; text: .text%__1cKPerfMemoryFalloc6FL_pc_; text: .text%__1cIPerfData2T6M_v_; text: .text%__1cIPerfDataMcreate_entry6MnJBasicType_LL_v_; @@ -4772,36 +3064,27 @@ text: .text%__1cPcmovI_reg_gNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cSInterpreterRuntimeZSignatureHandlerGeneratorEfrom6F_pnMRegisterImpl__; text: .text%__1cXJNI_ArgumentPusherVaArgHget_int6M_v_; text: .text%__1cIPerfData2t6MnJCounterNS_pkcn0AFUnits_n0ALVariability__v_; -text: .text%__1cPPerfDataManagerIadd_item6FpnIPerfData_i_v_; text: .text%__1cLStrCompNodeKmatch_edge6kMI_I_; text: .text%__1cOjmpLoopEndNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cOjmpLoopEndNodeOis_pc_relative6kM_i_; -text: .text%__1cOjmpLoopEndNodeTmay_be_short_branch6kM_i_; text: .text%jni_ReleaseStringUTFChars: jni.o; text: .text%jni_GetStringUTFChars: jni.o; text: .text%__1cFStateW_sub_Op_CountedLoopEnd6MpknENode__v_; text: .text%__1cNFingerprinterIdo_short6M_v_; -text: .text%__1cOcompU_rRegNodeMcisc_version6Mi_pnIMachNode__; text: .text%__1cJAssemblerEincq6MpnMRegisterImpl__v_; text: .text%__1cFTypeDEmake6Fd_pk0_; text: .text%__1cScompU_rReg_memNodeFreloc6kM_i_; text: .text%__1cNtestL_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cFParseLdo_newarray6MnJBasicType__v_; text: .text%__1cWCallLeafNoFPDirectNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cMNativeLookupGlookup6FnMmethodHandle_ripnGThread__pC_; text: .text%__1cWCallLeafNoFPDirectNodeFreloc6kM_i_; -text: .text%__1cSstring_compareNodeJnum_opnds6kM_I_; text: .text%__1cFStateU_sub_Op_CallLeafNoFP6MpknENode__v_; text: .text%JVM_FindLibraryEntry; -text: .text%__1cSObjectSynchronizerHinflate6FpnHoopDesc__pnNObjectMonitor__; text: .text%JVM_GetMethodIxExceptionTableEntry; text: .text%__1cNObjectMonitorHRecycle6M_v_; text: .text%__1cISubLNodeGadd_id6kM_pknEType__; text: .text%__1cNmodI_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cHMatcherOc_return_value6Fii_nLOptoRegPair__; text: .text%__1cRxorI_rReg_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIMachNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cQsarL_rReg_63NodeMideal_Opcode6kM_i_; text: .text%__1cRmulI_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIMachOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cIMachOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_; @@ -4810,47 +3093,25 @@ text: .text%__1cNandI_rRegNodeQuse_cisc_RegMask6M_v_; text: .text%__1cIDivINodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cNnegI_rRegNodeHtwo_adr6kM_I_; text: .text%__1cFStateS_sub_Op_ClearArray6MpknENode__v_; -text: .text%__1cRaddL_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cFciEnvWis_dependence_violated6FpnMklassOopDesc_pnNmethodOopDesc__i_; -text: .text%__1cHCompile2t6MpnFciEnv_pnIciMethod_i_v_; text: .text%__1cIXorINodeJideal_reg6kM_I_; text: .text%__1cMrep_stosNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cRtestI_reg_immNodePoper_input_base6kM_I_; -text: .text%__1cKC2CompilerPcompile_adapter6MpnFciEnv_pnIciMethod_i_v_; -text: .text%__1cMrep_stosNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cMAdapterCacheGinsert6MpnLAdapterInfo_pnMBasicAdapter__v_; text: .text%__1cFStateO_sub_Op_StoreL6MpknENode__v_; -text: .text%__1cLAdapterInfoHcopy_to6Mp0_v_; -text: .text%__1cQjava_lang_StringFvalue6FpnHoopDesc__pnQtypeArrayOopDesc__; text: .text%__1cPciObjArrayKlassGloader6M_pnHoopDesc__; text: .text%__1cIMinINodeGadd_id6kM_pknEType__; -text: .text%__1cNdecL_rRegNodePoper_input_base6kM_I_; -text: .text%__1cQjava_lang_StringGoffset6FpnHoopDesc__i_; text: .text%__1cKstoreLNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cGThreadLnmethods_do6M_v_; -text: .text%__1cKmul_hiNodeMideal_Opcode6kM_i_; text: .text%__1cKstoreLNodeFreloc6kM_i_; text: .text%__1cMstoreSSPNodeLbottom_type6kM_pknEType__; text: .text%__1cRsubI_rReg_memNodeFreloc6kM_i_; -text: .text%__1cPsarL_rReg_2NodeMideal_Opcode6kM_i_; text: .text%__1cTconvF2D_reg_memNodeMideal_Opcode6kM_i_; -text: .text%__1cRmulL_rReg_immNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cNmodL_rRegNodeJnum_opnds6kM_I_; -text: .text%__1cRmulL_rReg_immNodeJnum_opnds6kM_I_; -text: .text%__1cbBconvI2L_reg_reg_reg_zexNodeHtwo_adr6kM_I_; text: .text%__1cSCompiledStaticCallSset_to_interpreted6MnMmethodHandle_pC_v_; text: .text%__1cScompU_rReg_immNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cRInterpreterOopMapIis_empty6M_i_; text: .text%__1cNFingerprinterHdo_char6M_v_; -text: .text%__1cOrepush_if_args6FpnFParse_pnENode_3_v_: parse2.o; text: .text%__1cMloadConDNodeLbottom_type6kM_pknEType__; text: .text%__1cNGrowableArray4CpnHoopDesc__Uclear_and_deallocate6M_v_; -text: .text%__1cMrdx_RegLOperJnum_edges6kM_I_; text: .text%__1cLMachUEPNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cZget_mirror_from_signature6FnMmethodHandle_pnPSignatureStream_pnGThread__pnHoopDesc__; text: .text%__1cNGrowableArray4CpnJNode_List__Egrow6Mi_v_; text: .text%__1cMciArrayKlass2t6MnLKlassHandle__v_; -text: .text%__1cNObjectMonitorGenter26MpnGThread__v_; text: .text%__1cKarrayKlassKjava_super6kM_pnMklassOopDesc__; text: .text%__1cIUniverseWupdate_heap_info_at_gc6F_v_; text: .text%__1cJCodeCacheLgc_prologue6F_v_; @@ -4860,12 +3121,8 @@ text: .text%__1cJMarkSweepXfollow_weak_klass_links6F_v_; text: .text%__1cJMarkSweepMadjust_marks6F_v_; text: .text%__1cJMarkSweepNrestore_marks6F_v_; text: .text%__1cHThreadsLgc_epilogue6F_v_; -text: .text%__1cKDictionaryMdo_unloading6MpnRBoolObjectClosure__i_; text: .text%__1cHThreadsLgc_prologue6F_v_; -text: .text%__1cNGrowableArray4CpnFKlass__2t6Mii_v_; -text: .text%__1cQSystemDictionaryMdo_unloading6FpnRBoolObjectClosure__i_; text: .text%__1cQSystemDictionaryPplaceholders_do6FpnKOopClosure__v_; -text: .text%__1cSReferenceProcessorPoops_do_statics6FpnKOopClosure__v_; text: .text%__1cQSystemDictionaryYalways_strong_classes_do6FpnKOopClosure__v_; text: .text%__1cUPSAdaptiveSizePolicyWmajor_collection_begin6M_v_; text: .text%__1cUPSAdaptiveSizePolicyUmajor_collection_end6MLnHGCCauseFCause__v_; @@ -4874,69 +3131,46 @@ text: .text%__1cNGrowableArray4CpnFKlass__Uclear_and_deallocate6M_v_; text: .text%__1cKPSYoungGenHcompact6M_v_; text: .text%__1cKPSYoungGenPadjust_pointers6M_v_; text: .text%__1cKPSYoungGenKprecompact6M_v_; -text: .text%__1cLPSMarkSweepQinvoke_no_policy6Fpii_v_; text: .text%__1cLPSMarkSweepPallocate_stacks6F_v_; text: .text%__1cLPSMarkSweepRdeallocate_stacks6F_v_; -text: .text%__1cLPSMarkSweepRmark_sweep_phase16Fi_v_; text: .text%__1cLPSMarkSweepRmark_sweep_phase26F_v_; text: .text%__1cLPSMarkSweepRmark_sweep_phase36F_v_; text: .text%__1cLPSMarkSweepRmark_sweep_phase46F_v_; text: .text%__1cLPSMarkSweepbAreset_millis_since_last_gc6F_v_; text: .text%__1cUPSMarkSweepDecoratorbHset_destination_decorator_tenured6F_v_; text: .text%__1cUPSMarkSweepDecoratorbIset_destination_decorator_perm_gen6F_v_; -text: .text%__1cNExceptionBlobHoops_do6MpnKOopClosure__v_; text: .text%__1cKDictionaryYalways_strong_classes_do6MpnKOopClosure__v_; -text: .text%__1cQUncommonTrapBlobHoops_do6MpnKOopClosure__v_; -text: .text%__1cSDeoptimizationBlobHoops_do6MpnKOopClosure__v_; text: .text%__1cIPSOldGenKprecompact6M_v_; text: .text%__1cVLoaderConstraintTableYpurge_loader_constraints6MpnRBoolObjectClosure__v_; -text: .text%__1cRCardTableModRefBSEis_a6MnKBarrierSetEName__i_; text: .text%__1cJPSPermGenQcompute_new_size6ML_v_; text: .text%__1cJPSPermGenKprecompact6M_v_; -text: .text%__1cJCodeCacheMdo_unloading6FpnRBoolObjectClosure_pnKOopClosure_i_v_; -text: .text%__1cJCodeCacheHoops_do6FpnKOopClosure__v_; -text: .text%__1cPcmpD_cc_regNodeHtwo_adr6kM_I_; -text: .text%__1cbFunnecessary_membar_volatileNodeHtwo_adr6kM_I_; text: .text%__1cIDivINodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cIciSymbolHas_utf86M_pkc_; text: .text%__1cQorI_rReg_memNodePoper_input_base6kM_I_; -text: .text%__1cPfieldDescriptorSlong_initial_value6kM_x_; -text: .text%__1cKJavaThreadLnmethods_do6M_v_; text: .text%__1cCosTnative_java_library6F_pv_; text: .text%__1cSTailCalljmpIndNodePoper_input_base6kM_I_; text: .text%__1cOstackSlotPOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cOstackSlotPOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_; -text: .text%__1cScompL_rReg_immNodeHtwo_adr6kM_I_; text: .text%__1cNandI_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cNinstanceKlassKfind_field6kMpnNsymbolOopDesc_2ipnPfieldDescriptor__pnMklassOopDesc__; text: .text%__1cPciObjArrayKlass2t6MnLKlassHandle__v_; text: .text%__1cPstoreImmI16NodeFreloc6kM_i_; text: .text%__1cPstoreImmI16NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cCosYprint_jni_name_prefix_on6FpnMoutputStream_i_v_; -text: .text%__1cVlookup_special_native6Fpc_pC_: nativeLookup.o; text: .text%jni_ReleaseStringCritical: jni.o; -text: .text%__1cMNativeLookupMlookup_style6FnMmethodHandle_pcpkciiripnGThread__pC_; text: .text%__1cCosYprint_jni_name_suffix_on6FpnMoutputStream_i_v_; text: .text%jni_GetStringCritical: jni.o; -text: .text%__1cSInterpreterRuntimeTnmethod_entry_point6FpnKJavaThread_pnNmethodOopDesc_pnHnmethod__pC_; text: .text%__1cIPSOldGenOgen_size_limit6M_L_; -text: .text%__1cTI2CAdapterGeneratorSstd_verified_entry6FnMmethodHandle__pC_; -text: .text%__1cTI2CAdapterGeneratorUgenerate_i2c_adapter6FnMmethodHandle__pnKI2CAdapter__; text: .text%__1cUPSAdaptiveSizePolicybQpromo_increment_with_supplement_aligned_up6ML_L_; -text: .text%__1cHnmethodXinterpreter_entry_point6M_pC_; text: .text%__1cUParallelScavengeHeapOresize_old_gen6ML_v_; text: .text%__1cUPSAdaptiveSizePolicyPpromo_increment6MLI_L_; text: .text%__1cWandI_rReg_imm65535NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIPSOldGenGresize6ML_v_; text: .text%__1cKConv2BNodeGOpcode6kM_i_; -text: .text%__1cObox_handleNodeHtwo_adr6kM_I_; text: .text%__1cKarrayKlassOset_alloc_size6MI_v_; text: .text%__1cKarrayKlassXbase_create_array_klass6FrknKKlass_vtbl_inLKlassHandle_pnGThread__nQarrayKlassHandle__; text: .text%__1cNstoreImmINodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKarrayKlassbBcomplete_create_array_klass6FnQarrayKlassHandle_nLKlassHandle_pnGThread__v_; text: .text%__1cLConvI2FNodeGOpcode6kM_i_; -text: .text%__1cNmethodOopDescVparameter_annotations6kM_pnQtypeArrayOopDesc__; -text: .text%__1cNmethodOopDescLannotations6kM_pnQtypeArrayOopDesc__; text: .text%__1cNcmovI_regNodeHtwo_adr6kM_I_; text: .text%__1cNmethodOopDescbGresolved_checked_exceptions_impl6Fp0pnGThread__nOobjArrayHandle__; text: .text%__1cIGraphKitbKcombine_and_pop_all_exception_states6M_pnNSafePointNode__; @@ -4944,71 +3178,50 @@ text: .text%__1cLRethrowNode2t6MpnENode_22222_v_; text: .text%__1cHCompileSrethrow_exceptions6MpnIJVMState__v_; text: .text%__1cKReflectionTget_parameter_types6FnMmethodHandle_ippnHoopDesc_pnGThread__nOobjArrayHandle__; text: .text%__1cKReflectionTget_exception_types6FnMmethodHandle_pnGThread__nOobjArrayHandle__; -text: .text%__1cNinstanceKlassQmethod_index_for6kMpnNmethodOopDesc_pnGThread__i_; text: .text%__1cJAssemblerEandl6MpnMRegisterImpl_i_v_; text: .text%__1cNmethodOopDescKklass_name6kM_pnNsymbolOopDesc__; text: .text%__1cFStateP_sub_Op_Rethrow6MpknENode__v_; text: .text%__1cQComputeCallStackIdo_array6Mii_v_; -text: .text%__1cQsalL_rReg_CLNodePoper_input_base6kM_I_; text: .text%__1cNdecL_rRegNodeErule6kM_I_; text: .text%__1cLRethrowNodeJideal_reg6kM_I_; -text: .text%__1cMNativeLookupLlookup_base6FnMmethodHandle_ripnGThread__pC_; text: .text%__1cNstoreImmINodeFreloc6kM_i_; text: .text%__1cURethrowExceptionNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMNativeLookupNpure_jni_name6FnMmethodHandle__pc_; text: .text%__1cIPerfLong2t6MnJCounterNS_pkcnIPerfDataFUnits_n0CLVariability__v_; text: .text%__1cURethrowExceptionNodeFreloc6kM_i_; -text: .text%__1cTCompareAndSwapLNode2t6MpnENode_2222_v_; -text: .text%__1cQshrI_rReg_CLNodeJnum_opnds6kM_I_; -text: .text%__1cSCompareAndSwapNode2t6MpnENode_2222_v_; -text: .text%__1cTcompareAndSwapLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cTcompareAndSwapLNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cOLibraryCallKitRinline_unsafe_CAS6MnJBasicType__i_; text: .text%__1cIProjNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateX_sub_Op_CompareAndSwapL6MpknENode__v_; text: .text%__1cNSCMemProjNodeJideal_reg6kM_I_; text: .text%__1cTcompareAndSwapLNodeFreloc6kM_i_; text: .text%__1cOGenerateOopMapMmonitor_push6MnNCellTypeState__v_; text: .text%__1cOcompP_rRegNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cPsarI_rReg_1NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOGenerateOopMapPdo_monitorenter6Mi_v_; text: .text%__1cMmulD_immNodeMideal_Opcode6kM_i_; -text: .text%__1cPmethodDataKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cMaddF_regNodePoper_input_base6kM_I_; text: .text%__1cPcmpD_cc_regNodeMideal_Opcode6kM_i_; text: .text%__1cJLoadPNodeMstore_Opcode6kM_i_; -text: .text%__1cbACallCompiledJavaDirectNodeKmethod_set6Ml_v_; -text: .text%__1cYMachCallCompiledJavaNodePret_addr_offset6M_i_; text: .text%__1cJCMoveNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cKciTypeFlowLStateVectorEtrap6MpnQciBytecodeStream_pnHciKlass_i_v_; text: .text%__1cIDivLNodeLbottom_type6kM_pknEType__; text: .text%__1cNobjArrayKlassYcompute_secondary_supers6MipnGThread__pnPobjArrayOopDesc__; -text: .text%__1cJloadFNodeHtwo_adr6kM_I_; text: .text%__1cNinstanceKlassYremove_dependent_nmethod6MpnHnmethod__v_; text: .text%__1cOGenerateOopMapTmark_reachable_code6M_v_; -text: .text%__1cNobjArrayKlassZcan_be_primary_super_slow6kM_i_; text: .text%__1cOGenerateOopMapKinterp_all6M_v_; text: .text%__1cOGenerateOopMapYrewrite_refval_conflicts6M_v_; text: .text%__1cOGenerateOopMapRinit_basic_blocks6M_v_; text: .text%__1cOGenerateOopMapYsetup_method_entry_state6M_v_; text: .text%__1cFframeZinterpreter_frame_set_mdx6Ml_v_; text: .text%__1cOGenerateOopMapbAmake_context_uninitialized6M_v_; -text: .text%__1cQorI_rReg_immNodeJnum_opnds6kM_I_; -text: .text%__1cOGenerateOopMapTmethodsig_to_effect6MpnNsymbolOopDesc_ipnNCellTypeState__i_; text: .text%__1cOGenerateOopMapPinitialize_vars6M_v_; text: .text%__1cNobjArrayKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_; text: .text%__1cOGenerateOopMapKinit_state6M_v_; -text: .text%__1cPClassFileParserbFparse_constant_pool_float_entry6MnSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cRmulL_rReg_immNodeHtwo_adr6kM_I_; text: .text%__1cOGenerateOopMapNinitialize_bb6M_v_; text: .text%__1cOGenerateOopMapRdo_interpretation6M_v_; -text: .text%__1cQciBytecodeStreamFtable6MnJBytecodesECode__2_; text: .text%__1cOGenerateOopMap2t6MnMmethodHandle__v_; text: .text%__1cOGenerateOopMapbImark_bbheaders_and_count_gc_points6M_v_; text: .text%__1cOGenerateOopMapLcompute_map6MpnGThread__v_; text: .text%__1cIRetTableRcompute_ret_table6MnMmethodHandle__v_; text: .text%__1cRxorI_rReg_memNodeHtwo_adr6kM_I_; -text: .text%__1cNmulI_rRegNodePoper_input_base6kM_I_; text: .text%__1cFStateM_sub_Op_XorI6MpknENode__v_; text: .text%__1cISubLNodeJideal_reg6kM_I_; text: .text%__1cLStrCompNodeLbottom_type6kM_pknEType__; @@ -5017,16 +3230,11 @@ text: .text%__1cQOopMapCacheEntryRallocate_bit_mask6M_v_; text: .text%__1cQOopMapCacheEntryTdeallocate_bit_mask6M_v_; text: .text%__1cQOopMapCacheEntryEfill6MnMmethodHandle_i_v_; text: .text%__1cRsalL_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cPsalL_rReg_1NodePoper_input_base6kM_I_; -text: .text%__1cOstackSlotPOperJnum_edges6kM_I_; text: .text%__1cOPhaseIdealLoopOadd_constraint6MiipnENode_22p23_v_; text: .text%jni_IsAssignableFrom: jni.o; text: .text%__1cOstackSlotPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cFParseWcheck_interpreter_type6MpnENode_pknEType_rpnNSafePointNode__2_; -text: .text%__1cFParseXfetch_interpreter_state6MipknEType_pnENode__5_; -text: .text%__1cObox_handleNodeJnum_opnds6kM_I_; text: .text%__1cNaddP_rRegNodeHtwo_adr6kM_I_; -text: .text%__1cSComputeAdapterInfoHdo_byte6M_v_; text: .text%__1cPPerfDataManagerMcounter_name6Fpkc2_pc_; text: .text%__1cOGenerateOopMapKpp_new_ref6MpnNCellTypeState_i_v_; text: .text%__1cNcmovI_regNodeQuse_cisc_RegMask6M_v_; @@ -5035,152 +3243,84 @@ text: .text%__1cOGenerateOopMapVresult_for_basicblock6Mi_v_; text: .text%__1cTOopMapForCacheEntry2t6MnMmethodHandle_ipnQOopMapCacheEntry__v_; text: .text%__1cPcmpD_cc_immNodeMideal_Opcode6kM_i_; text: .text%__1cTOopMapForCacheEntryLcompute_map6MpnGThread__v_; -text: .text%__1cTOopMapForCacheEntryOreport_results6kM_i_; text: .text%__1cTconvF2D_reg_memNodePoper_input_base6kM_I_; text: .text%__1cNdivL_rRegNodeErule6kM_I_; text: .text%__1cRmulL_rReg_immNodeQuse_cisc_RegMask6M_v_; text: .text%JVM_GetCallerClass; text: .text%__1cQsalL_rReg_CLNodeErule6kM_I_; text: .text%__1cJloadLNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cNloadConP0NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cXMachCallDynamicJavaNodePret_addr_offset6M_i_; text: .text%__1cRxorI_rReg_immNodeErule6kM_I_; text: .text%__1cZCallDynamicJavaDirectNodePcompute_padding6kMi_i_; -text: .text%__1cFParseScreate_jump_tables6MpnENode_pnLSwitchRange_4_i_; text: .text%__1cZCallDynamicJavaDirectNodeKmethod_set6Ml_v_; text: .text%__1cPcmovI_reg_lNodeHtwo_adr6kM_I_; text: .text%__1cLConvD2INodeGOpcode6kM_i_; text: .text%__1cNcmovP_regNodeMideal_Opcode6kM_i_; text: .text%__1cTconvI2F_reg_regNodeMideal_Opcode6kM_i_; text: .text%__1cKstorePNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cWPredictedCallGeneratorJis_inline6kM_i_; -text: .text%__1cUjmpLoopEnd_shortNodeJis_Branch6kM_I_; text: .text%__1cQorI_rReg_memNodeMideal_Opcode6kM_i_; text: .text%__1cSInterpreterRuntimeOmultianewarray6FpnKJavaThread_pi_v_; text: .text%__1cUjmpLoopEnd_shortNodeJlabel_set6MrnFLabel_I_v_; text: .text%__1cFParseSjump_if_false_fork6MpnGIfNode_ii_v_; -text: .text%__1cbFloadConL_0x6666666666666667NodeMideal_Opcode6kM_i_; text: .text%__1cJAssemblerEshll6MpnMRegisterImpl_i_v_; -text: .text%__1cOjmpLoopEndNodeUshort_branch_version6M_pnIMachNode__; text: .text%__1cUjmpLoopEnd_shortNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPCountedLoopNodeGstride6kM_pnENode__; -text: .text%__1cHi2bNodeJnum_opnds6kM_I_; text: .text%__1cHTypeAryFxdual6kM_pknEType__; text: .text%__1cOMacroAssemblerKverify_oop6MpnMRegisterImpl_pkc_v_; -text: .text%__1cKstoreFNodeHtwo_adr6kM_I_; text: .text%__1cNnegI_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLencode_copy6FrnKCodeBuffer_ii_v_; -text: .text%__1cbBconvI2L_reg_reg_reg_zexNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cTconvI2F_reg_regNodePoper_input_base6kM_I_; -text: .text%__1cUCallNativeDirectNodeMideal_Opcode6kM_i_; -text: .text%__1cKmul_hiNodePoper_input_base6kM_I_; -text: .text%__1cKExceptionsNnew_exception6FpnGThread_nMsymbolHandle_pkcnGHandle_6_6_; text: .text%__1cPcmpD_cc_regNodeMcisc_operand6kM_i_; text: .text%__1cPICStubInterfaceKinitialize6MpnEStub_i_v_; text: .text%__1cPICStubInterfaceRcode_size_to_size6kMi_i_; text: .text%__1cPcmpD_cc_regNodeErule6kM_I_; text: .text%__1cNtestU_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cOPSPromotionLABRunallocate_object6MpnHoopDesc__i_; -text: .text%__1cPcmpD_cc_immNodeHtwo_adr6kM_I_; -text: .text%__1cOPhaseIdealLoopJdo_unroll6MpnNIdealLoopTree_rnJNode_List_i_v_; text: .text%__1cRandL_rReg_immNodeErule6kM_I_; -text: .text%__1cNloadConP0NodeGis_Con6kM_I_; text: .text%__1cIMulINodeKmul_opcode6kM_i_; -text: .text%__1cNdivL_rRegNodeJnum_opnds6kM_I_; text: .text%__1cIMulINodeKadd_opcode6kM_i_; text: .text%__1cRxorI_rReg_immNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cPregister_native6FnLKlassHandle_nMsymbolHandle_1pCpnGThread__i_: jni.o; text: .text%__1cTno_rax_rdx_RegLOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cOtypeArrayKlassOmulti_allocate6MipiipnGThread__pnHoopDesc__; -text: .text%__1cTno_rax_rdx_RegLOperJnum_edges6kM_I_; -text: .text%__1cOCallNativeNodeGOpcode6kM_i_; text: .text%__1cQsalI_rReg_CLNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cSobjArrayKlassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cJAssemblerDjmp6MpCnJrelocInfoJrelocType__v_; text: .text%__1cLRShiftLNodeJideal_reg6kM_I_; text: .text%jni_SetBooleanField: jni.o; text: .text%__1cVLoaderConstraintTableWfind_constrained_klass6MnMsymbolHandle_nGHandle__pnMklassOopDesc__; text: .text%__1cIModLNodeLbottom_type6kM_pknEType__; text: .text%__1cRxorI_rReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cHMonitor2t6Mipkci_v_; -text: .text%__1cGHandle2t6MpnGThread_pnHoopDesc__v_; text: .text%__1cQorI_rReg_immNodeHtwo_adr6kM_I_; text: .text%__1cODeoptimizationVtrap_state_has_reason6Fii_i_; text: .text%__1cOloadConL32NodeMideal_Opcode6kM_i_; text: .text%__1cNGrowableArray4Cpv_Egrow6Mi_v_; text: .text%jni_GetFieldID: jni.o; text: .text%__1cNGrowableArray4Cl_Egrow6Mi_v_; -text: .text%__1cXjava_lang_ref_ReferenceOset_discovered6FpnHoopDesc_2_v_; text: .text%__1cLResourceObj2n6FLn0APallocation_type__pv_; text: .text%__1cFframeZinterpreter_frame_set_mdp6MpC_v_; -text: .text%__1cJLoadPNodeUdepends_only_on_test6kM_i_; text: .text%__1cFBlockNset_next_call6MpnENode_rnJVectorSet_rnLBlock_Array__v_; text: .text%__1cIciObject2t6MpnHciKlass__v_; text: .text%__1cScompL_rReg_immNodeErule6kM_I_; text: .text%__1cQshrI_rReg_CLNodeErule6kM_I_; -text: .text%__1cNaddL_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cFStateT_sub_Op_ThreadLocal6MpknENode__v_; -text: .text%__1cVCallRuntimeDirectNodeHtwo_adr6kM_I_; -text: .text%__1cKciTypeFlowOsplit_range_at6Mi_pn0AFRange__; -text: .text%__1cQSystemDictionaryTresolve_from_stream6FnMsymbolHandle_nGHandle_2pnPClassFileStream_pnGThread__pnMklassOopDesc__; -text: .text%__1cXjvm_define_class_common6FpnHJNIEnv__pkcpnI_jobject_pkWi53pnGThread__pnH_jclass__: jvm.o; text: .text%__1cKExceptionsK_throw_msg6FpnGThread_pkcipnNsymbolOopDesc_4_v_; text: .text%__1cKExceptionsK_throw_msg6FpnGThread_pkcinMsymbolHandle_4nGHandle_6_v_; -text: .text%__1cMmulD_immNodePoper_input_base6kM_I_; text: .text%__1cRInlineCacheBufferRic_stub_code_size6F_i_; text: .text%__1cMmulF_immNodeMideal_Opcode6kM_i_; -text: .text%__1cNGrowableArray4CpnKStackValue__2t6Mii_v_; -text: .text%__1cZInterpreterMacroAssemblerbAget_cache_and_index_at_bcp6MpnMRegisterImpl_2i_v_; text: .text%__1cRandL_rReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMloadConFNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cOMacroAssemblerHcall_VM6MpnMRegisterImpl_pCi_v_; text: .text%__1cUandI_rReg_imm255NodeErule6kM_I_; text: .text%__1cRmulL_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNcmovI_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNloadConL0NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cPsarL_rReg_2NodePoper_input_base6kM_I_; -text: .text%__1cJAssemblerGpushaq6M_v_; text: .text%__1cOMethodLivenessKBasicBlockFsplit6Mi_p1_; text: .text%__1cFStateP_sub_Op_RShiftL6MpknENode__v_; -text: .text%__1cMrsi_RegPOperJnum_edges6kM_I_; -text: .text%__1cMstoreSSPNodePoper_input_base6kM_I_; -text: .text%__1cScompL_rReg_immNodePoper_input_base6kM_I_; -text: .text%__1cKCodeBufferWinsert_double_constant6Md_pC_; text: .text%__1cPClassFileParserbJparse_classfile_signature_attribute6MnSconstantPoolHandle_nTinstanceKlassHandle_pnGThread__v_; text: .text%__1cNaddP_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cFParseHdo_irem6M_v_; -text: .text%__1cRsarL_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJAssemblerEsubl6MpnMRegisterImpl_2_v_; -text: .text%__1cHi2bNodeHtwo_adr6kM_I_; text: .text%__1cPClassFileParserbBcheck_illegal_static_method6FnTinstanceKlassHandle_pnGThread__v_; -text: .text%__1cJAssemblerFmovsd6MnHAddress_pnRFloatRegisterImpl__v_; -text: .text%__1cTCallInterpreterNodeScalling_convention6kMpnLOptoRegPair_I_v_; -text: .text%__1cXMachCallInterpreterNodeWis_MachCallInterpreter6M_p0_; -text: .text%__1cFStateX_sub_Op_CallInterpreter6MpknENode__v_; -text: .text%__1cZCallInterpreterDirectNodeFreloc6kM_i_; -text: .text%__1cMStartC2INodeScalling_convention6kMpnLOptoRegPair_I_v_; text: .text%__1cZInterpreterMacroAssemblerYtest_method_data_pointer6MpnMRegisterImpl_rnFLabel__v_; -text: .text%__1cMStartC2INodeKc2i_domain6FpknJTypeTuple__3_; -text: .text%__1cHCompilebMGenerate_Compiled_To_Interpreter_Graph6MpknITypeFunc_pC_v_; -text: .text%__1cZCallInterpreterDirectNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cFciEnvUregister_c2i_adapter6MpnIciMethod_pnJOopMapSet_pnKCodeBuffer_ii_v_; -text: .text%__1cSMachC2IcheckICNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cSMachC2IEntriesNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cRtestI_reg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cHMatcherbAinterpreter_method_oop_reg6F_i_; -text: .text%__1cHMatcherXcompiler_method_oop_reg6F_i_; text: .text%__1cIciMethodRinterpreter_entry6M_pC_; text: .text%__1cSTailCalljmpIndNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cPcmpD_cc_regNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cSTailCalljmpIndNodeGpinned6kM_i_; -text: .text%__1cSTailCalljmpIndNodeHtwo_adr6kM_I_; text: .text%jni_SetByteArrayRegion: jni.o; -text: .text%__1cHBoxNodeGOpcode6kM_i_; -text: .text%__1cPcmpD_cc_regNodeJnum_opnds6kM_I_; -text: .text%__1cKC2IAdapter2t6MpnKCodeBuffer_iIpnJOopMapSet_i_v_; -text: .text%__1cKC2IAdapterPnew_c2i_adapter6FpnKCodeBuffer_IpnJOopMapSet_i_p0_; -text: .text%__1cKC2IAdapter2n6FLI_pv_; -text: .text%__1cJAssemblerFmovss6MnHAddress_pnRFloatRegisterImpl__v_; text: .text%__1cIMulINodeJideal_reg6kM_I_; text: .text%__1cKCMovePNodeGOpcode6kM_i_; text: .text%__1cNTemplateTableDdef6FnJBytecodesECode_inITosState_3pF_vc_v_; @@ -5189,15 +3329,11 @@ text: .text%__1cSInterpreterRuntimeZSignatureHandlerGeneratorLpass_object6M_v_; text: .text%__1cHciKlass2t6MpnIciSymbol_p0_v_; text: .text%__1cFParseTjump_if_always_fork6Mii_v_; text: .text%__1cKloadUBNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cMmulF_immNodePoper_input_base6kM_I_; -text: .text%__1cPcmpD_cc_immNodePoper_input_base6kM_I_; text: .text%__1cUciInstanceKlassKlassEmake6F_p0_; text: .text%__1cJAssemblerDhlt6M_v_; text: .text%__1cOMacroAssemblerEstop6Mpkc_v_; text: .text%__1cQComputeCallStackIdo_float6M_v_; -text: .text%__1cIciObjectUis_array_klass_klass6M_i_; text: .text%__1cKciTypeFlowLStateVectorLdo_newarray6MpnQciBytecodeStream__v_; -text: .text%__1cWResolveOopMapConflictsRpossible_gc_point6MpnOBytecodeStream__i_; text: .text%__1cJloadFNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPcmovI_reg_lNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIciSymbolHbyte_at6Mi_i_; @@ -5205,15 +3341,9 @@ text: .text%__1cNFingerprinterHdo_byte6M_v_; text: .text%__1cENode2t6Mp0111111_v_; text: .text%__1cIMaxINodeGadd_id6kM_pknEType__; text: .text%__1cRCardTableModRefBSFclear6MnJMemRegion__v_; -text: .text%__1cOMacroAssemblerHcall_VM6MpnMRegisterImpl_pC2i_v_; text: .text%__1cKExceptionsL_throw_args6FpnGThread_pkcinMsymbolHandle_5pnRJavaCallArguments__v_; text: .text%__1cMmulD_immNodeErule6kM_I_; -text: .text%__1cMnegD_regNodePoper_input_base6kM_I_; -text: .text%__1cFframeVshould_be_deoptimized6kM_i_; text: .text%__1cMaddF_regNodeMideal_Opcode6kM_i_; -text: .text%__1cbDjava_lang_reflect_ConstructorThas_signature_field6F_i_; -text: .text%__1cbDjava_lang_reflect_ConstructorVhas_annotations_field6F_i_; -text: .text%__1cbDjava_lang_reflect_ConstructorbFhas_parameter_annotations_field6F_i_; text: .text%__1cbDjava_lang_reflect_ConstructorIset_slot6FpnHoopDesc_i_v_; text: .text%__1cKReflectionPnew_constructor6FnMmethodHandle_pnGThread__pnHoopDesc__; text: .text%__1cbDjava_lang_reflect_ConstructorPset_annotations6FpnHoopDesc_2_v_; @@ -5226,61 +3356,35 @@ text: .text%__1cbDjava_lang_reflect_ConstructorTset_parameter_types6FpnHoopDesc_ text: .text%__1cPciInstanceKlassYprotection_domain_handle6M_pnI_jobject__; text: .text%__1cbDjava_lang_reflect_ConstructorJset_clazz6FpnHoopDesc_2_v_; text: .text%__1cbDjava_lang_reflect_ConstructorGcreate6FpnGThread__nGHandle__; -text: .text%__1cKmul_hiNodeJnum_opnds6kM_I_; text: .text%__1cKstoreFNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cKstoreBNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRxorI_rReg_immNodeHtwo_adr6kM_I_; -text: .text%__1cNsubI_rRegNodeMcisc_version6Mi_pnIMachNode__; text: .text%__1cJAssemblerExorl6MpnMRegisterImpl_2_v_; -text: .text%__1cHMatcherXinterpreter_arg_ptr_reg6F_i_; text: .text%__1cINegDNodeGOpcode6kM_i_; text: .text%__1cNdecL_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cPjava_lang_ClassQprimitive_mirror6FnJBasicType__pnHoopDesc__; -text: .text%__1cRsarI_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJJavaCallsLcall_static6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnRJavaCallArguments_pnGThread__v_; -text: .text%__1cNcmovP_regNodeJnum_opnds6kM_I_; text: .text%__1cSCompiledStaticCallNcompute_entry6FnMmethodHandle_rnOStaticCallInfo__v_; text: .text%__1cMloadConDNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cLOptoRuntimeVresolve_static_call_C6FpnKJavaThread__pC_; -text: .text%__1cSCompiledStaticCallIis_clean6kM_i_; text: .text%__1cMrsi_RegPOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cTAbstractInterpreterLdeopt_entry6FnITosState_i_pC_; text: .text%__1cRindIndexScaleOperNconstant_disp6kM_i_; -text: .text%__1cQorI_rReg_memNodeJnum_opnds6kM_I_; -text: .text%__1cRtestI_reg_immNodeJnum_opnds6kM_I_; text: .text%jni_NewStringUTF: jni.o; text: .text%__1cTAbstractInterpreterSBasicType_as_index6FnJBasicType__i_; text: .text%__1cNtestI_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cZInterpreterMacroAssemblerGpush_l6MpnMRegisterImpl__v_; -text: .text%__1cRxorI_rReg_immNodeJnum_opnds6kM_I_; text: .text%__1cZInterpreterMacroAssemblerFpop_i6MpnMRegisterImpl__v_; -text: .text%__1cZInterpreterMacroAssemblerGpush_d6MpnRFloatRegisterImpl__v_; -text: .text%__1cObox_handleNodeErule6kM_I_; text: .text%__1cZInterpreterMacroAssemblerIpush_ptr6MpnMRegisterImpl__v_; -text: .text%__1cZInterpreterMacroAssemblerGpush_f6MpnRFloatRegisterImpl__v_; text: .text%__1cOleaPIdxOffNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cQsarL_rReg_63NodePoper_input_base6kM_I_; text: .text%__1cSCompiledStaticCallDset6MrknOStaticCallInfo__v_; text: .text%__1cJAssemblerEcmpl6MpnMRegisterImpl_i_v_; -text: .text%__1cHCompileRmake_vm_intrinsic6MpnIciMethod_i_pnNCallGenerator__; text: .text%__1cNmulI_rRegNodeErule6kM_I_; -text: .text%__1cNGrowableArray4Ci_2t6Mii_v_; -text: .text%__1cQsalL_rReg_CLNodeJnum_opnds6kM_I_; text: .text%__1cNGrowableArray4Ci_Uclear_and_deallocate6M_v_; -text: .text%__1cPCountedLoopNode2t6MpnENode_2_v_; -text: .text%__1cSCountedLoopEndNode2t6MpnENode_2ff_v_; text: .text%__1cJloadDNodeMideal_Opcode6kM_i_; text: .text%__1cENodeIpipeline6kM_pknIPipeline__; text: .text%__1cIDivLNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cMmulD_regNodePoper_input_base6kM_I_; -text: .text%__1cTconvF2D_reg_memNodeJnum_opnds6kM_I_; text: .text%__1cIModINodeJideal_reg6kM_I_; text: .text%__1cYinternal_word_RelocationGtarget6M_pC_; -text: .text%__1cObox_handleNodeLbottom_type6kM_pknEType__; -text: .text%__1cbDreorder_based_on_method_index6FpnPobjArrayOopDesc_1ppnHoopDesc__v_: methodOop.o; text: .text%__1cPshrL_rReg_1NodeMideal_Opcode6kM_i_; -text: .text%__1cUverify_byte_codes_fn6F_pv_: verifier.o; -text: .text%__1cMLinkResolverbPlinktime_resolve_interface_method_or_null6FnLKlassHandle_nMsymbolHandle_21i_nMmethodHandle__; text: .text%JVM_GetClassCPTypes; text: .text%__1cQComputeCallStackHdo_byte6M_v_; text: .text%JVM_GetClassCPEntriesCount; @@ -5291,19 +3395,14 @@ text: .text%__1cJloadBNodeIpipeline6kM_pknIPipeline__; text: .text%__1cKmul_hiNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cJAssemblerEnegq6MpnMRegisterImpl__v_; text: .text%__1cNmodL_rRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cKloadUBNodeHtwo_adr6kM_I_; -text: .text%__1cRxorI_rReg_memNodeRis_cisc_alternate6kM_i_; text: .text%__1cVCallRuntimeDirectNodePoper_input_base6kM_I_; text: .text%__1cSstring_compareNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cPPerfDataManagerUcreate_long_variable6FnJCounterNS_pkcnIPerfDataFUnits_xpnGThread__pnQPerfLongVariable__; -text: .text%__1cNsubL_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOjmpLoopEndNodeGnegate6M_v_; text: .text%__1cQorI_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cVCallRuntimeDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPsalL_rReg_1NodeErule6kM_I_; text: .text%__1cPcmpD_cc_immNodeErule6kM_I_; text: .text%__1cJAssemblerFtestl6MpnMRegisterImpl_2_v_; -text: .text%__1cbCAbstractInterpreterGeneratorVset_vtos_entry_points6MpnITemplate_rpC44444444_v_; text: .text%__1cHCompileQgrow_alias_types6M_v_; text: .text%__1cUandI_rReg_imm255NodeLout_RegMask6kM_rknHRegMask__; text: .text%jni_CallIntMethod: jni.o; @@ -5311,74 +3410,42 @@ text: .text%__1cNSharedRuntimeSfind_callee_method6FpnKJavaThread_pnGThread__nMme text: .text%__1cPno_rax_RegLOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cMrdx_RegLOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cNmulI_rRegNodeMcisc_operand6kM_i_; -text: .text%__1cNxorI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cTconvF2D_reg_memNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cIUniverseWreinitialize_vtable_of6FpnFKlass_pnGThread__v_; text: .text%__1cJLoadINodeMstore_Opcode6kM_i_; text: .text%__1cNSharedRuntimeTreresolve_call_site6FpnKJavaThread_pnGThread__nMmethodHandle__; text: .text%__1cbFunnecessary_membar_volatileNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cENodeEgetd6kM_d_; text: .text%__1cICmpFNodeGOpcode6kM_i_; -text: .text%__1cLOptoRuntimeThandle_wrong_method6FpnKJavaThread__pC_; text: .text%__1cNGrowableArray4CpnOMethodLivenessKBasicBlock__Egrow6Mi_v_; text: .text%__1cKstoreFNodeOmemory_operand6kM_pknIMachOper__; text: .text%JVM_SetClassSigners; text: .text%__1cNdivL_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cScompI_rReg_immNodeIpipeline6kM_pknIPipeline__; text: .text%__1cZCallDynamicJavaDirectNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cRandL_rReg_immNodeJnum_opnds6kM_I_; text: .text%__1cOstackSlotPOperFscale6kM_i_; -text: .text%__1cHnmethodPis_dependent_on6MpnMklassOopDesc__i_; -text: .text%__1cMdecI_memNodeHtwo_adr6kM_I_; -text: .text%__1cSalign_to_page_size6FL_L_: heap.o; text: .text%__1cNmulI_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cOstackSlotPOperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cPsarL_rReg_2NodeErule6kM_I_; text: .text%__1cOPhaseIdealLoopUpeeled_dom_test_elim6MpnNIdealLoopTree_rnJNode_List__v_; text: .text%jni_NewByteArray: jni.o; text: .text%__1cYinternal_word_RelocationFvalue6M_pC_; -text: .text%__1cYinternal_word_RelocationWfix_relocation_at_move6Ml_v_; text: .text%__1cFStateM_sub_Op_SubL6MpknENode__v_; text: .text%__1cJAssemblerSemit_arith_operand6MipnMRegisterImpl_nHAddress_i_v_; text: .text%__1cJAssemblerEcmpl6MpnMRegisterImpl_nHAddress__v_; text: .text%__1cMaddF_regNodeMcisc_operand6kM_i_; -text: .text%__1cRsubI_rReg_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cNloadConPcNodeHtwo_adr6kM_I_; -text: .text%__1cbCAbstractInterpreterGeneratorYgenerate_deopt_entry_for6MnITosState_i_pC_; -text: .text%__1cKLoadPCNodeGOpcode6kM_i_; -text: .text%__1cTconvI2F_reg_regNodeMcisc_operand6kM_i_; text: .text%__1cOstackSlotPOperEtype6kM_pknEType__; -text: .text%__1cbCAbstractInterpreterGeneratorZgenerate_return_entry_for6MnITosState_i_pC_; text: .text%__1cTconvD2I_reg_regNodeMideal_Opcode6kM_i_; text: .text%__1cMstoreSSPNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNGrowableArray4Ci_Icontains6kMrki_i_; text: .text%__1cKstoreBNodeFreloc6kM_i_; -text: .text%__1cObox_handleNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cMjniIdPrivateGid_for6FnTinstanceKlassHandle_i_l_; -text: .text%__1cNget_method_id6FpnHJNIEnv__pnH_jclass_pkc5ipnGThread__pnK_jmethodID__: jni.o; text: .text%__1cQshrI_rReg_CLNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQjava_lang_SystemTout_offset_in_bytes6F_i_; -text: .text%__1cMjniIdSupportNto_jmethod_id6FpnNmethodOopDesc__pnK_jmethodID__; text: .text%__1cNmethodOopDescKjmethod_id6M_pnK_jmethodID__; text: .text%__1cQjava_lang_SystemSin_offset_in_bytes6F_i_; text: .text%__1cRandL_rReg_immNodeHtwo_adr6kM_I_; text: .text%__1cJAssemblerEmovl6MpnMRegisterImpl_2_v_; -text: .text%__1cbACallCompiledJavaDirectNodeFreloc6kM_i_; text: .text%__1cIAddFNodeLbottom_type6kM_pknEType__; -text: .text%__1cUCallCompiledJavaNodeScalling_convention6kMpnLOptoRegPair_I_v_; -text: .text%__1cFStateY_sub_Op_CallCompiledJava6MpknENode__v_; -text: .text%__1cFciEnvUregister_i2c_adapter6MpnIciMethod_pnJOopMapSet_pnKCodeBuffer_i_v_; -text: .text%__1cbACallCompiledJavaDirectNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cMStartI2CNodeScalling_convention6kMpnLOptoRegPair_I_v_; -text: .text%__1cHCompilebMGenerate_Interpreter_To_Compiled_Graph6MpknITypeFunc__v_; text: .text%__1cPciObjectFactoryPinsert_non_perm6Mrpn0ANNonPermObject_pnHoopDesc_pnIciObject__v_; -text: .text%__1cKI2CAdapter2n6FLI_pv_; -text: .text%__1cKCodeBufferVinsert_float_constant6Mf_pC_; -text: .text%__1cbACallCompiledJavaDirectNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cKI2CAdapterPnew_i2c_adapter6FpnKCodeBuffer_pnJOopMapSet_i_p0_; text: .text%__1cKmul_hiNodeErule6kM_I_; -text: .text%__1cKI2CAdapter2t6MpnKCodeBuffer_pnJOopMapSet_ii_v_; -text: .text%__1cbBinitialize_itable_for_klass6FpnMklassOopDesc__v_; text: .text%__1cFJNIidEfind6Mi_p0_; text: .text%__1cJJavaCallsLcall_static6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4nGHandle_5pnGThread__v_; text: .text%__1cSInterpreterRuntimeZSignatureHandlerGeneratorIgenerate6ML_v_; @@ -5388,69 +3455,40 @@ text: .text%__1cXSignatureHandlerLibraryLset_handler6FpnKCodeBuffer__pC_; text: .text%JVM_IsPrimitiveClass; text: .text%__1cIDivDNodeGOpcode6kM_i_; text: .text%__1cMnegD_regNodeMideal_Opcode6kM_i_; -text: .text%__1cJCMoveNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cPciObjArrayKlassJmake_impl6FpnHciKlass__p0_; -text: .text%__1cQjava_lang_ThreadJis_daemon6FpnHoopDesc__i_; text: .text%__1cJAssemblerEcmpl6MnHAddress_i_v_; text: .text%__1cHi2bNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLimmI_24OperJnum_edges6kM_I_; text: .text%__1cRxorI_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cFTypeDJsingleton6kM_i_; text: .text%__1cPsalI_rReg_1NodeIpipeline6kM_pknIPipeline__; text: .text%__1cIModLNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cUPipeline_Use_Element2t6MIIIinXPipeline_Use_Cycle_Mask__v_; -text: .text%__1cTmembar_volatileNodePoper_input_base6kM_I_; -text: .text%__1cNloadConPcNodePoper_input_base6kM_I_; text: .text%__1cXPipeline_Use_Cycle_Mask2t6MI_v_; text: .text%__1cKCompiledICMset_to_clean6M_v_; -text: .text%__1cNdecL_rRegNodeJnum_opnds6kM_I_; text: .text%__1cIciMethodOresolve_invoke6MpnHciKlass_2_p0_; text: .text%__1cQChunkPoolCleanerEtask6M_v_; text: .text%__1cICmpDNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cPsalL_rReg_1NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateM_sub_Op_MulI6MpknENode__v_; text: .text%__1cZCallDynamicJavaDirectNodeFreloc6kM_i_; -text: .text%__1cQMachCallJavaNodeVis_MachCallStaticJava6M_pnWMachCallStaticJavaNode__; -text: .text%__1cUandI_rReg_imm255NodeJnum_opnds6kM_I_; text: .text%__1cFStateX_sub_Op_CallDynamicJava6MpknENode__v_; -text: .text%__1cNObjectMonitorEwait6MxipnGThread__v_; text: .text%jni_FindClass: jni.o; text: .text%__1cKarrayKlassTallocate_arrayArray6MiipnGThread__pnPobjArrayOopDesc__; text: .text%__1cIMinINodeJideal_reg6kM_I_; text: .text%__1cJCMoveNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cSObjectSynchronizerEwait6FnGHandle_xpnGThread__v_; -text: .text%__1cNCallGeneratorSfor_predicted_call6FpnHciKlass_p03_3_; -text: .text%__1cLTypeInstPtrRcast_to_exactness6kMi_pknEType__; text: .text%__1cTconvI2F_reg_regNodeErule6kM_I_; -text: .text%__1cWPredictedCallGeneratorKis_virtual6kM_i_; -text: .text%__1cTconvF2D_reg_memNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cNcmovP_regNodeErule6kM_I_; -text: .text%__1cMaddF_regNodeJnum_opnds6kM_I_; text: .text%__1cWPredictedCallGeneratorIgenerate6MpnIJVMState__2_; text: .text%JVM_MonitorWait; -text: .text%__1cPshrL_rReg_1NodePoper_input_base6kM_I_; -text: .text%__1cMaddF_regNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cNCallGeneratorQfor_virtual_call6FpnIciMethod__p0_; text: .text%__1cUVirtualCallGeneratorIgenerate6MpnIJVMState__2_; -text: .text%__1cLPSMarkSweepbAabsorb_live_data_from_eden6FpnUPSAdaptiveSizePolicy_pnKPSYoungGen_pnIPSOldGen__i_; text: .text%__1cUPSMarkSweepDecoratorbDadvance_destination_decorator6F_v_; -text: .text%__1cNmulI_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cNmulI_rRegNodeJnum_opnds6kM_I_; -text: .text%__1cSOnStackReplacementPget_osr_adapter6FnFframe_nMmethodHandle__pnKOSRAdapter__; -text: .text%__1cNGrowableArray4CpnKOSRAdapter__Hat_grow6Mirk1_1_; text: .text%__1cPciObjArrayKlassEmake6FpnHciKlass__p0_; text: .text%JVM_GetClassDeclaredConstructors; -text: .text%__1cRCardTableModRefBSKinvalidate6MnJMemRegion__v_; text: .text%__1cJLoadFNodeJideal_reg6kM_I_; text: .text%__1cJAssemblerEaddq6MpnMRegisterImpl_2_v_; -text: .text%__1cFTypeFJsingleton6kM_i_; text: .text%__1cTconvF2D_reg_regNodeMideal_Opcode6kM_i_; text: .text%__1cMstoreSSPNodeErule6kM_I_; text: .text%__1cOloadConL32NodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cMstoreSSPNodeHtwo_adr6kM_I_; -text: .text%__1cMincI_memNodeHtwo_adr6kM_I_; text: .text%__1cKcmpOpUOperFequal6kM_i_; -text: .text%__1cTconvF2D_reg_regNodePoper_input_base6kM_I_; text: .text%__1cHRegMask2t6M_v_; text: .text%__1cIGraphKitPdstore_rounding6MpnENode__2_; text: .text%__1cNGrowableArray4Ci_2t6MpnFArena_iirki_v_; @@ -5458,13 +3496,9 @@ text: .text%__1cNloadConL0NodeHsize_of6kM_I_; text: .text%__1cQset_lwp_priority6Fiii_i_; text: .text%__1cJCmpD3NodeGOpcode6kM_i_; text: .text%__1cKloadUBNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cPcmpD_cc_immNodeJnum_opnds6kM_I_; text: .text%__1cLConvL2DNodeGOpcode6kM_i_; -text: .text%__1cRmulI_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJAssemblerFcmovq6Mn0AJCondition_pnMRegisterImpl_3_v_; -text: .text%__1cNminI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cMmulD_regNodeMideal_Opcode6kM_i_; -text: .text%__1cNminI_rRegNodePoper_input_base6kM_I_; text: .text%__1cFStateM_sub_Op_MinI6MpknENode__v_; text: .text%__1cCosTset_native_priority6FpnGThread_i_nIOSReturn__; text: .text%__1cJStubQdDueueRrequest_committed6Mi_pnEStub__; @@ -5474,7 +3508,6 @@ text: .text%__1cNCallGeneratorRfor_uncommon_trap6FpnIciMethod_nODeoptimizationLD text: .text%__1cUandI_rReg_imm255NodeHtwo_adr6kM_I_; text: .text%__1cJStubQdDueueMremove_first6M_v_; text: .text%__1cOPhaseIdealLoopOdo_range_check6MpnNIdealLoopTree_rnJNode_List__v_; -text: .text%__1cUVirtualCallGeneratorKis_virtual6kM_i_; text: .text%__1cPICStubInterfaceIfinalize6MpnEStub__v_; text: .text%__1cZUncommonTrapCallGeneratorIgenerate6MpnIJVMState__2_; text: .text%__1cPICStubInterfaceEsize6kMpnEStub__i_; @@ -5482,27 +3515,17 @@ text: .text%__1cJAssemblerEcmpq6MpnMRegisterImpl_2_v_; text: .text%__1cNGrowableArray4CpnIciObject__Egrow6Mi_v_; text: .text%__1cFStateM_sub_Op_ModI6MpknENode__v_; text: .text%__1cNObjectMonitor2t6M_v_; -text: .text%__1cNmodI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cFParseNdo_instanceof6M_v_; text: .text%__1cPcmpD_cc_regNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNIdealLoopTreeXpolicy_maximally_unroll6kMpnOPhaseIdealLoop__i_; -text: .text%__1cTmembar_volatileNodeHtwo_adr6kM_I_; text: .text%__1cJJavaCallsMcall_virtual6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnRJavaCallArguments_pnGThread__v_; text: .text%__1cIGraphKitOgen_instanceof6MpnENode_2_2_; text: .text%__1cHciKlassOsuper_of_depth6MI_p0_; text: .text%__1cJLoadDNodeGOpcode6kM_i_; -text: .text%__1cNcmovL_regNodePoper_input_base6kM_I_; text: .text%__1cMdecI_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cRaddI_rReg_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cXNativeSignatureIteratorJdo_object6Mii_v_; text: .text%__1cQsalL_rReg_CLNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNandI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cbFunnecessary_membar_volatileNodeLbottom_type6kM_pknEType__; -text: .text%__1cHMatcherXpost_store_load_barrier6FpknENode__i_; -text: .text%__1cYjava_lang_reflect_MethodThas_signature_field6F_i_; -text: .text%__1cYjava_lang_reflect_MethodbFhas_parameter_annotations_field6F_i_; text: .text%__1cYjava_lang_reflect_MethodZset_parameter_annotations6FpnHoopDesc_2_v_; -text: .text%__1cYjava_lang_reflect_MethodbChas_annotation_default_field6F_i_; text: .text%__1cJloadDNodePoper_input_base6kM_I_; text: .text%__1cENodeEgetf6kM_f_; text: .text%__1cYjava_lang_reflect_MethodIset_name6FpnHoopDesc_2_v_; @@ -5510,33 +3533,19 @@ text: .text%__1cYjava_lang_reflect_MethodPset_return_type6FpnHoopDesc_2_v_; text: .text%__1cYjava_lang_reflect_MethodJset_clazz6FpnHoopDesc_2_v_; text: .text%__1cYjava_lang_reflect_MethodIset_slot6FpnHoopDesc_i_v_; text: .text%__1cYjava_lang_reflect_MethodGcreate6FpnGThread__nGHandle__; -text: .text%__1cPBytecode_invokeIis_valid6kM_i_; -text: .text%__1cKReflectionKnew_method6FnMmethodHandle_iipnGThread__pnHoopDesc__; -text: .text%__1cYjava_lang_reflect_MethodVhas_annotations_field6F_i_; text: .text%__1cYjava_lang_reflect_MethodPset_annotations6FpnHoopDesc_2_v_; text: .text%__1cYjava_lang_reflect_MethodWset_annotation_default6FpnHoopDesc_2_v_; text: .text%__1cYjava_lang_reflect_MethodNset_modifiers6FpnHoopDesc_i_v_; -text: .text%__1cNmethodOopDescSannotation_default6kM_pnQtypeArrayOopDesc__; text: .text%__1cYjava_lang_reflect_MethodTset_exception_types6FpnHoopDesc_2_v_; text: .text%__1cYjava_lang_reflect_MethodTset_parameter_types6FpnHoopDesc_2_v_; text: .text%__1cVCallRuntimeDirectNodeKmethod_set6Ml_v_; -text: .text%__1cTconvD2I_reg_regNodePoper_input_base6kM_I_; -text: .text%__1cSTailCalljmpIndNodeJnum_opnds6kM_I_; -text: .text%__1cTconvI2D_reg_regNodePoper_input_base6kM_I_; -text: .text%__1cQorI_rReg_memNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cKstoreFNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRaddI_mem_rRegNodePoper_input_base6kM_I_; text: .text%__1cMmulF_immNodeErule6kM_I_; -text: .text%__1cJAssemblerGmovlpd6MpnRFloatRegisterImpl_nHAddress__v_; -text: .text%__1cPcmpF_cc_regNodePoper_input_base6kM_I_; -text: .text%__1cNCompileBrokerTcompile_adapter_for6FnMmethodHandle_ii_pnMBasicAdapter__; text: .text%__1cCosbBthread_local_storage_at_put6Fipv_v_; -text: .text%__1cNCompileBrokerbBwait_for_adapter_completion6FpnLCompileTask__pnMBasicAdapter__; -text: .text%__1cOjmpLoopEndNodeJis_Branch6kM_I_; text: .text%__1cOjmpLoopEndNodeJlabel_set6MrnFLabel_I_v_; text: .text%__1cNinstanceKlassSregister_finalizer6FpnPinstanceOopDesc_pnGThread__2_; text: .text%__1cSThreadLocalStorageNpd_set_thread6FpnGThread__v_; -text: .text%__1cKCMoveINodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cSThreadLocalStoragebBget_thread_via_cache_slowly6FLi_pnGThread__; text: .text%__1cMrax_RegIOperEtype6kM_pknEType__; text: .text%__1cOjmpLoopEndNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -5545,7 +3554,6 @@ text: .text%jni_GetMethodID: jni.o; text: .text%__1cSThreadLocalStorageSset_thread_in_slot6FpnGThread__v_; text: .text%get_thread; text: .text%__1cMincI_memNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cIGraphKitXinsert_mem_bar_volatile6MpnKMemBarNode_i_v_; text: .text%__1cSThreadLocalStorageKset_thread6FpnGThread__v_; text: .text%__1cCosHSolarisKmmap_chunk6FpcLii_2_; text: .text%__1cbFloadConL_0x6666666666666667NodeLout_RegMask6kM_rknHRegMask__; @@ -5555,75 +3563,52 @@ text: .text%__1cRxorI_rReg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cMmulD_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNcmovP_regNodeLbottom_type6kM_pknEType__; text: .text%__1cJScopeDescTdecode_scope_values6Mi_pnNGrowableArray4CpnKScopeValue____; -text: .text%__1cTAbstractInterpreterWlayout_activation_impl6FpnNmethodOopDesc_iiiipnFframe_4i_i_; text: .text%__1cLconvI2BNodeMideal_Opcode6kM_i_; text: .text%__1cIDivLNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cQsalI_rReg_CLNodeHtwo_adr6kM_I_; text: .text%__1cPsarL_rReg_2NodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNmodL_rRegNodeHtwo_adr6kM_I_; -text: .text%__1cScompL_rReg_immNodeJnum_opnds6kM_I_; -text: .text%__1cQshrL_rReg_CLNodePoper_input_base6kM_I_; -text: .text%__1cJCMoveNode2t6MpnENode_22pknEType__v_; -text: .text%__1cJCMoveNodeEmake6FpnENode_222pknEType__p0_; text: .text%__1cVLoaderConstraintTableYextend_loader_constraint6MpnVLoaderConstraintEntry_nGHandle_pnMklassOopDesc__v_; text: .text%__1cIimmIOperJnum_edges6kM_I_; -text: .text%__1cJAssemblerFmovss6MpnRFloatRegisterImpl_nHAddress__v_; text: .text%__1cRtestI_reg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cRandL_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNGrowableArray4CpnKciTypeFlowFBlock__Gremove6Mrk2_v_; text: .text%__1cVLoaderConstraintTablebHensure_loader_constraint_capacity6MpnVLoaderConstraintEntry_i_v_; -text: .text%__1cPsalL_rReg_1NodeJnum_opnds6kM_I_; -text: .text%__1cMsubD_regNodePoper_input_base6kM_I_; -text: .text%__1cMstoreSSPNodeJnum_opnds6kM_I_; text: .text%__1cMnegD_regNodeHtwo_adr6kM_I_; -text: .text%__1cIBytecodeIset_code6MnJBytecodesECode__v_; -text: .text%__1cPClassFileParserXverify_unqualified_name6MpcIi_i_; text: .text%__1cMdivD_immNodeMideal_Opcode6kM_i_; text: .text%__1cTconvI2F_reg_regNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cQjava_lang_ThreadMis_stillborn6FpnHoopDesc__i_; text: .text%__1cQsarL_rReg_63NodeErule6kM_I_; text: .text%__1cRsubL_rReg_memNodeMideal_Opcode6kM_i_; text: .text%__1cMVirtualSpaceQuncommitted_size6kM_L_; text: .text%__1cRsubL_rReg_memNodePoper_input_base6kM_I_; -text: .text%__1cMVirtualSpaceJexpand_by6ML_i_; text: .text%__1cNstoreImmPNodeMideal_Opcode6kM_i_; text: .text%__1cQjava_lang_ThreadKset_thread6FpnHoopDesc_pnKJavaThread__v_; text: .text%__1cLOopMapCache2t6M_v_; -text: .text%__1cJloadDNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cQComputeCallStackHdo_char6M_v_; -text: .text%__1cNdivI_rRegNodePoper_input_base6kM_I_; -text: .text%__1cOcmovI_regUNodePoper_input_base6kM_I_; text: .text%__1cZInterpreterMacroAssemblerEpush6MnITosState__v_; text: .text%__1cSvframeArrayElementDbci6kM_i_; text: .text%__1cMaddF_regNodeErule6kM_I_; -text: .text%__1cTconvF2D_reg_memNodeHtwo_adr6kM_I_; text: .text%__1cNdecL_rRegNodeHtwo_adr6kM_I_; text: .text%__1cMdecI_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cFStateN_sub_Op_LoadF6MpknENode__v_; text: .text%__1cIMulDNodeLbottom_type6kM_pknEType__; text: .text%__1cNaddI_rRegNodeIpipeline6kM_pknIPipeline__; text: .text%__1cJAssemblerEdecl6MpnMRegisterImpl__v_; -text: .text%__1cOPhaseIdealLoopVinsert_pre_post_loops6MpnNIdealLoopTree_rnJNode_List_i_v_; text: .text%__1cJAssemblerGbswapl6MpnMRegisterImpl__v_; text: .text%__1cRInlineCacheBufferLnew_ic_stub6F_pnGICStub__; text: .text%__1cRInlineCacheBufferWcreate_transition_stub6FpnKCompiledIC_pnHoopDesc_pC_v_; text: .text%__1cIAddDNodeGOpcode6kM_i_; text: .text%__1cMincI_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cSInterpreterRuntimeZSignatureHandlerGeneratorIpass_int6M_v_; -text: .text%__1cNloadConPcNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cGICStubIset_stub6MpnKCompiledIC_pnHoopDesc_pC_v_; text: .text%__1cRInlineCacheBufferXassemble_ic_buffer_code6FpCpnHoopDesc_1_v_; text: .text%__1cTconvD2I_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cZInterpreterMacroAssemblerHpop_ptr6MpnMRegisterImpl__v_; -text: .text%__1cGThreadbCis_hidden_from_external_view6kM_i_; text: .text%__1cMelapsedTimer2t6M_v_; -text: .text%__1cGThreadVis_jvmti_agent_thread6kM_i_; text: .text%__1cMdivD_immNodeErule6kM_I_; text: .text%__1cTconvI2D_reg_regNodeMideal_Opcode6kM_i_; text: .text%__1cFTypeFFxmeet6kMpknEType__3_; text: .text%__1cJAssemblerEshrl6MpnMRegisterImpl_i_v_; text: .text%__1cGICStubLdestination6kM_pC_; -text: .text%__1cRsalL_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cRInlineCacheBufferVic_buffer_entry_point6FpC_1_; text: .text%__1cPcmpD_cc_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMaddD_immNodeMideal_Opcode6kM_i_; @@ -5636,31 +3621,21 @@ text: .text%__1cNcmovP_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cUandI_rReg_imm255NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNdivL_rRegNodeHtwo_adr6kM_I_; text: .text%__1cKcastPPNodePoper_input_base6kM_I_; -text: .text%__1cMaddD_immNodePoper_input_base6kM_I_; text: .text%__1cFTypeDFxmeet6kMpknEType__3_; text: .text%__1cKloadUBNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cIDivLNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cJloadDNodeErule6kM_I_; -text: .text%__1cRaddI_mem_rRegNodeJnum_opnds6kM_I_; text: .text%__1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_5pnGThread__v_; text: .text%__1cPsarL_rReg_1NodeMideal_Opcode6kM_i_; text: .text%__1cKCompiledICMstub_address6kM_pC_; text: .text%__1cMmulD_regNodeMcisc_operand6kM_i_; text: .text%__1cMmulF_memNodePoper_input_base6kM_I_; text: .text%lwp_cond_destroy: os_solaris.o; -text: .text%__1cHnmethodNis_osr_method6kM_i_; text: .text%lwp_mutex_destroy: os_solaris.o; -text: .text%__1cFParseScan_rerun_bytecode6M_i_; text: .text%__1cISubFNodeGOpcode6kM_i_; -text: .text%__1cRjni_invoke_static6FpnHJNIEnv__pnJJavaValue_pnI_jobject_nLJNICallType_pnK_jmethodID_pnSJNI_ArgumentPusher_pnGThread__v_: jni.o; -text: .text%__1cFTypeDGis_nan6kM_i_; -text: .text%__1cTconvI2F_reg_regNodeJnum_opnds6kM_I_; text: .text%__1cOJavaAssertionsNmatch_package6Fpkc_pn0AKOptionList__; -text: .text%__1cOJavaAssertionsHenabled6Fpkci_i_; text: .text%__1cOJavaAssertionsLmatch_class6Fpkc_pn0AKOptionList__; text: .text%JVM_DesiredAssertionStatus; text: .text%__1cHTypePtrFxdual6kM_pknEType__; -text: .text%__1cTconvI2F_reg_regNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cQjava_lang_ThreadLthreadGroup6FpnHoopDesc__2_; text: .text%__1cLConvI2FNodeLbottom_type6kM_pknEType__; text: .text%__1cXjava_lang_reflect_FieldNset_modifiers6FpnHoopDesc_i_v_; @@ -5671,41 +3646,25 @@ text: .text%__1cXjava_lang_reflect_FieldJset_clazz6FpnHoopDesc_2_v_; text: .text%__1cXjava_lang_reflect_FieldIset_name6FpnHoopDesc_2_v_; text: .text%__1cJvmSymbolsOsignature_type6FpnNsymbolOopDesc__nJBasicType__; text: .text%__1cMloadConFNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cNnegI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cPcmpF_cc_regNodeHtwo_adr6kM_I_; -text: .text%__1cKReflectionJnew_field6FpnPfieldDescriptor_ipnGThread__pnHoopDesc__; text: .text%__1cXjava_lang_reflect_FieldIset_type6FpnHoopDesc_2_v_; text: .text%__1cKJavaThreadbScheck_safepoint_and_suspend_for_native_trans6Fp0_v_; text: .text%__1cXjava_lang_reflect_FieldPset_annotations6FpnHoopDesc_2_v_; text: .text%__1cXjava_lang_reflect_FieldGcreate6FpnGThread__nGHandle__; -text: .text%__1cXjava_lang_reflect_FieldVhas_annotations_field6F_i_; text: .text%__1cISubDNodeGOpcode6kM_i_; text: .text%__1cJloadFNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cSstring_compareNodeHtwo_adr6kM_I_; text: .text%__1cPfieldDescriptorLannotations6kM_pnQtypeArrayOopDesc__; text: .text%__1cRaddI_mem_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cXjava_lang_reflect_FieldIset_slot6FpnHoopDesc_i_v_; -text: .text%__1cKScopeValueLis_location6kM_i_; -text: .text%__1cXjava_lang_reflect_FieldThas_signature_field6F_i_; text: .text%__1cMmulF_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cSObjectSynchronizerGnotify6FnGHandle_pnGThread__v_; text: .text%JVM_MonitorNotify; text: .text%__1cQsarL_rReg_63NodeLout_RegMask6kM_rknHRegMask__; text: .text%jni_GetStaticFieldID: jni.o; -text: .text%__1cIModLNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cPjava_lang_ClassOprimitive_type6FpnHoopDesc__nJBasicType__; -text: .text%__1cIjniIdMapGcreate6FnTinstanceKlassHandle__p0_; -text: .text%__1cPsarL_rReg_2NodeJnum_opnds6kM_I_; text: .text%__1cKReflectionbFbasic_type_mirror_to_basic_type6FpnHoopDesc_pnGThread__nJBasicType__; text: .text%__1cPcmpF_cc_regNodeMideal_Opcode6kM_i_; -text: .text%__1cQSystemDictionaryQjava_mirror_type6FpnHoopDesc__nJBasicType__; -text: .text%__1cIjniIdMap2t6MpnMklassOopDesc_i_v_; -text: .text%__1cIjniIdMapRcompute_index_cnt6FnTinstanceKlassHandle__i_; -text: .text%__1cLjniIdBucket2t6MpnIjniIdMap_p0_v_; text: .text%__1cNinstanceKlassKjni_id_for6Mi_pnFJNIid__; text: .text%__1cJLoadSNodeMstore_Opcode6kM_i_; -text: .text%__1cLTypeInstPtrLmirror_type6kM_pnGciType__; -text: .text%__1cMsubF_regNodePoper_input_base6kM_I_; text: .text%__1cPcmpD_cc_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cMlogD_regNodeMideal_Opcode6kM_i_; text: .text%__1cbFunnecessary_membar_volatileNodeLout_RegMask6kM_rknHRegMask__; @@ -5715,8 +3674,6 @@ text: .text%__1cMPipeline_Use2t6MIIIpnUPipeline_Use_Element__v_; text: .text%__1cKstorePNodeErule6kM_I_; text: .text%__1cNsymbolOopDescWas_klass_external_name6kM_pkc_; text: .text%__1cbFunnecessary_membar_volatileNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cNloadConPcNodeErule6kM_I_; -text: .text%__1cIPipeline2t6MIIiIIiiiipnSmachPipelineStages_2pInMPipeline_Use__v_; text: .text%__1cRComputeEntryStackGdo_int6M_v_; text: .text%__1cMstoreSSPNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cSMachBreakpointNodeEsize6kMpnNPhaseRegAlloc__I_; @@ -5725,48 +3682,33 @@ text: .text%__1cNtestU_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cPsalL_rReg_1NodeHtwo_adr6kM_I_; text: .text%__1cNmodL_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cTconvF2D_reg_regNodeErule6kM_I_; -text: .text%__1cJAssemblerDjmp6MpnMRegisterImpl_nJrelocInfoJrelocType__v_; -text: .text%__1cObox_handleNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQsalI_rReg_CLNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQorI_rReg_memNodeErule6kM_I_; -text: .text%__1cLloadSSDNodePoper_input_base6kM_I_; -text: .text%__1cNCompileBrokerbAinvoke_compiler_on_adapter6FpnLCompileTask__v_; text: .text%__1cLConvF2DNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cMaddF_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRxorI_rReg_memNodeFreloc6kM_i_; -text: .text%__1cMaddF_immNodePoper_input_base6kM_I_; text: .text%__1cKCMoveLNodeGOpcode6kM_i_; text: .text%__1cICodeHeapTmark_segmap_as_free6MLL_v_; text: .text%__1cRaddL_rReg_memNodePoper_input_base6kM_I_; text: .text%JVM_IsArrayClass; text: .text%__1cJAssemblerEsbbq6MnHAddress_i_v_; text: .text%__1cZInterpreterMacroAssemblerFpop_l6MpnMRegisterImpl__v_; -text: .text%__1cMmulD_regNodeJnum_opnds6kM_I_; -text: .text%__1cODeoptimizationYquery_update_method_data6FnQmethodDataHandle_in0ALDeoptReason_rIri4_pnLProfileData__; -text: .text%__1cICodeHeapJexpand_by6ML_i_; -text: .text%__1cMmulD_regNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cLConvF2DNodeLbottom_type6kM_pknEType__; text: .text%__1cJAssemblerEaddq6MnHAddress_i_v_; text: .text%JVM_GetClassName; text: .text%__1cTconvF2D_reg_regNodeMcisc_operand6kM_i_; text: .text%__1cLStringTableGintern6FpkcpnGThread__pnHoopDesc__; -text: .text%__1cMmulD_immNodeJnum_opnds6kM_I_; text: .text%__1cNmulI_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQorI_rReg_memNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cPPerfDataManagerTcreate_long_counter6FnJCounterNS_pkcnIPerfDataFUnits_xpnGThread__pnPPerfLongCounter__; text: .text%__1cNObjectMonitorGnotify6MpnGThread__v_; text: .text%__1cQjava_lang_ThreadMset_priority6FpnHoopDesc_nOThreadPriority__v_; text: .text%__1cRsubL_rReg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cRaddL_rReg_memNodeMideal_Opcode6kM_i_; -text: .text%__1cRsubL_rReg_memNodeRis_cisc_alternate6kM_i_; -text: .text%__1cRsubL_rReg_memNodeJnum_opnds6kM_I_; text: .text%__1cPshrL_rReg_1NodeErule6kM_I_; text: .text%__1cQshrI_rReg_CLNodeHtwo_adr6kM_I_; text: .text%__1cFStateO_sub_Op_CMoveI6MpknENode__v_; text: .text%__1cFStateM_sub_Op_RegD6MpknENode__v_; text: .text%__1cQorI_rReg_memNodeHtwo_adr6kM_I_; -text: .text%__1cUCallNativeDirectNodeHtwo_adr6kM_I_; -text: .text%__1cTconvI2D_reg_regNodeMcisc_operand6kM_i_; text: .text%__1cXNativeSignatureIteratorGdo_int6M_v_; text: .text%__1cIMaxINodeJideal_reg6kM_I_; text: .text%__1cFJNIid2t6MpnMklassOopDesc_ip0_v_; @@ -5774,31 +3716,18 @@ text: .text%__1cNinstanceKlassPjni_id_for_impl6FnTinstanceKlassHandle_i_pnFJNIid text: .text%__1cJAssemblerEaddq6MpnMRegisterImpl_nHAddress__v_; text: .text%JVM_Open; text: .text%__1cHRegMask2t6Miiiiiii_v_; -text: .text%__1cbFloadConL_0x6666666666666667NodeHtwo_adr6kM_I_; text: .text%__1cNsubI_rRegNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cMmulF_regNodePoper_input_base6kM_I_; -text: .text%__1cZInterpreterMacroAssemblerVincrement_mdp_data_at6MpnMRegisterImpl_i_v_; -text: .text%__1cQConstantIntValuePis_constant_int6kM_i_; -text: .text%__1cRmulL_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cPsarL_rReg_2NodeHtwo_adr6kM_I_; -text: .text%__1cKmul_hiNodeHtwo_adr6kM_I_; text: .text%__1cQConstantIntValue2t6MpnTDebugInfoReadStream__v_; -text: .text%__1cRxorI_rReg_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cFStateM_sub_Op_ConD6MpknENode__v_; text: .text%__1cLConvI2DNodeGOpcode6kM_i_; text: .text%__1cVLoaderConstraintTableJnew_entry6MIpnNsymbolOopDesc_pnMklassOopDesc_ii_pnVLoaderConstraintEntry__; -text: .text%__1cNaddP_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cPcmpF_cc_regNodeMcisc_operand6kM_i_; text: .text%__1cJAssemblerFcmovl6Mn0AJCondition_pnMRegisterImpl_3_v_; -text: .text%__1cVscale_to_lwp_priority6Fiii_i_: os_solaris.o; -text: .text%__1cLOptoRuntimeWresolve_virtual_call_C6FpnKJavaThread__pC_; text: .text%__1cNPerfByteArray2t6MnJCounterNS_pkcnIPerfDataFUnits_n0CLVariability_i_v_; -text: .text%__1cLStrCompNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cMmulF_memNodeMideal_Opcode6kM_i_; text: .text%__1cKConv2BNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cJloadDNodeJnum_opnds6kM_I_; text: .text%__1cFStateM_sub_Op_RegF6MpknENode__v_; -text: .text%__1cMmulF_immNodeJnum_opnds6kM_I_; text: .text%__1cOMacroAssemblerKnull_check6MpnMRegisterImpl_i_v_; text: .text%__1cNcmovP_regNodeHtwo_adr6kM_I_; text: .text%jni_GetStaticObjectField: jni.o; @@ -5806,19 +3735,14 @@ text: .text%__1cIGraphKitSprecision_rounding6MpnENode__2_; text: .text%__1cScompL_rReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cSTailCalljmpIndNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cTconvD2F_reg_regNodeMideal_Opcode6kM_i_; -text: .text%__1cLCastP2LNodeUdepends_only_on_test6kM_i_; text: .text%__1cTconvF2D_reg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMmulD_immNodeHtwo_adr6kM_I_; text: .text%__1cOMacroAssemblerFleave6M_v_; text: .text%__1cMloadConDNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMTailCallNode2t6MpnENode_222222_v_; -text: .text%__1cICmpDNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cXPartialSubtypeCheckNodeGOpcode6kM_i_; text: .text%__1cSTailCalljmpIndNodeFreloc6kM_i_; -text: .text%__1cObox_handleNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cOloadConL32NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cMlogD_regNodePoper_input_base6kM_I_; -text: .text%__1cTconvI2F_reg_regNodeHtwo_adr6kM_I_; text: .text%__1cMnegD_regNodeErule6kM_I_; text: .text%__1cLvframeArrayRregister_location6kMi_pC_; text: .text%__1cQorI_rReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -5826,10 +3750,7 @@ text: .text%__1cFStateQ_sub_Op_TailCall6MpknENode__v_; text: .text%__1cIOSThreadNpd_initialize6M_v_; text: .text%__1cCosScurrent_process_id6F_i_; text: .text%__1cMaddD_immNodeErule6kM_I_; -text: .text%__1cNmaxI_rRegNodePoper_input_base6kM_I_; text: .text%__1cPshrL_rReg_1NodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cTconvI2F_reg_regNodeQuse_cisc_RegMask6M_v_; -text: .text%__1cNmaxI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIMaxINodeIadd_ring6kMpknEType_3_3_; text: .text%__1cCosRinitialize_thread6F_v_; text: .text%__1cCosHSolarisKvm_signals6F_pnIsigset_t__; @@ -5844,7 +3765,6 @@ text: .text%__1cCosHSolarisVinit_thread_fpu_state6F_v_; text: .text%__1cIOSThread2t6MpFpv_i1_v_; text: .text%jni_CallStaticVoidMethod: jni.o; text: .text%__1cCosScurrent_stack_size6F_L_; -text: .text%__1cNPhaseRegAllocHset_oop6MpknENode_i_v_; text: .text%__1cCosScurrent_stack_base6F_pC_; text: .text%__1cJloadFNodeFreloc6kM_i_; text: .text%__1cCosMstart_thread6FpnGThread__v_; @@ -5853,14 +3773,10 @@ text: .text%__1cKstoreLNodeIpipeline6kM_pknIPipeline__; text: .text%__1cXNativeSignatureIteratorHdo_long6M_v_; text: .text%__1cNcmovL_memNodeErule6kM_I_; text: .text%__1cFStateO_sub_Op_StoreF6MpknENode__v_; -text: .text%__1cHnmethodbAmake_not_entrant_or_zombie6Mi_v_; text: .text%__1cCosPpd_start_thread6FpnGThread__v_; text: .text%__1cNcmovL_regNodeMcisc_operand6kM_i_; -text: .text%__1cCosNcreate_thread6FpnGThread_n0AKThreadType_L_i_; -text: .text%__1cLconvI2BNodePoper_input_base6kM_I_; text: .text%__1cOGenerateOopMapMdo_checkcast6M_v_; text: .text%JVM_SetThreadPriority; -text: .text%__1cG_start6Fpv_0_: os_solaris.o; text: .text%__1cLOptoRuntimeMrethrow_Type6F_pknITypeFunc__; text: .text%JVM_GetStackAccessControlContext; text: .text%JVM_IsThreadAlive; @@ -5868,27 +3784,16 @@ text: .text%__1cTconvL2D_reg_memNodeMideal_Opcode6kM_i_; text: .text%__1cSstring_compareNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNdivI_rRegNodeErule6kM_I_; text: .text%__1cNdecL_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cOLibraryCallKitYinline_native_time_funcs6Mi_i_; text: .text%__1cNGrowableArray4CpknEType__2t6MpnFArena_iirk2_v_; text: .text%__1cFParseVcatch_call_exceptions6MrnYciExceptionHandlerStream__v_; -text: .text%__1cTconvL2F_reg_regNodePoper_input_base6kM_I_; -text: .text%__1cQjava_lang_ThreadIis_alive6FpnHoopDesc__i_; text: .text%jni_CallObjectMethod: jni.o; text: .text%__1cJAssemblerExorq6MpnMRegisterImpl_2_v_; -text: .text%__1cNcmovL_regNodeJnum_opnds6kM_I_; text: .text%__1cLOptoRuntimeYcurrent_time_millis_Type6F_pknITypeFunc__; text: .text%__1cOcmovI_regUNodeMideal_Opcode6kM_i_; -text: .text%__1cNcmovL_regNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cNObjectMonitorJnotifyAll6MpnGThread__v_; text: .text%__1cMsubD_regNodeMideal_Opcode6kM_i_; -text: .text%__1cNloadConL0NodeFclone6kM_pnENode__; text: .text%__1cPcmpF_cc_regNodeErule6kM_I_; -text: .text%__1cJimmL0OperFclone6kM_pnIMachOper__; text: .text%__1cNmodI_rRegNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cPcmpF_cc_regNodeJnum_opnds6kM_I_; -text: .text%__1cPcmpF_cc_regNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cbFloadConL_0x6666666666666667NodePoper_input_base6kM_I_; -text: .text%__1cZInterpreterMacroAssemblerFpop_d6MpnRFloatRegisterImpl__v_; text: .text%__1cTconvL2D_reg_memNodePoper_input_base6kM_I_; text: .text%__1cLConvD2FNodeGOpcode6kM_i_; text: .text%__1cWThreadLocalAllocBufferKinitialize6M_v_; @@ -5896,45 +3801,30 @@ text: .text%__1cJloadDNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cSInterpreterRuntimeZSignatureHandlerGeneratorEtemp6F_pnMRegisterImpl__; text: .text%__1cMmulF_immNodeHtwo_adr6kM_I_; text: .text%__1cQsarL_rReg_63NodeHtwo_adr6kM_I_; -text: .text%__1cQsarL_rReg_63NodeJnum_opnds6kM_I_; -text: .text%__1cQjava_lang_StringbHcreate_from_platform_depended_str6FpkcpnGThread__nGHandle__; text: .text%__1cMsubF_regNodeMideal_Opcode6kM_i_; text: .text%__1cTconvI2L_reg_regNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cWThreadLocalAllocBufferMinitial_size6F_L_; text: .text%__1cSInterpreterRuntimeZSignatureHandlerGeneratorJpass_long6M_v_; text: .text%__1cSInterpreterRuntimeMat_safepoint6FpnKJavaThread__v_; text: .text%__1cTconvF2I_reg_regNodeMideal_Opcode6kM_i_; text: .text%__1cRandI_rReg_memNodePoper_input_base6kM_I_; text: .text%__1cRandI_rReg_memNodeMideal_Opcode6kM_i_; -text: .text%__1cCosNcommit_memory6FpcL_i_; -text: .text%__1cNdivI_rRegNodeJnum_opnds6kM_I_; -text: .text%__1cENodeJis_MemBar6kM_pknKMemBarNode__; -text: .text%__1cNjni_functions6F_pknTJNINativeInterface___; -text: .text%__1cNThreadServiceKadd_thread6FpnKJavaThread_i_v_; text: .text%JVM_NativePath; text: .text%__1cKJavaThreadKinitialize6M_v_; -text: .text%__1cHThreadsDadd6FpnKJavaThread_i_v_; -text: .text%__1cGParker2t6M_v_; text: .text%__1cOPhaseIdealLoopKdo_peeling6MpnNIdealLoopTree_rnJNode_List__v_; text: .text%__1cUThreadSafepointStateGcreate6FpnKJavaThread__v_; text: .text%__1cPciInstanceKlassLjava_mirror6M_pnKciInstance__; text: .text%__1cKJavaThreadYcreate_stack_guard_pages6M_v_; text: .text%__1cUThreadSafepointState2t6MpnKJavaThread__v_; -text: .text%__1cCosMguard_memory6FpcL_i_; text: .text%__1cMnegD_regNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cUCallNativeDirectNodePoper_input_base6kM_I_; text: .text%__1cHnmethodTinc_decompile_count6M_v_; text: .text%__1cIMinINodeIadd_ring6kMpknEType_3_3_; text: .text%__1cMResourceMarkNreset_to_mark6M_v_; text: .text%__1cQThreadStatistics2t6M_v_; -text: .text%__1cMFlatProfilerJis_active6F_i_; -text: .text%__1cNloadConPcNodeLbottom_type6kM_pknEType__; text: .text%__1cMmulD_regNodeErule6kM_I_; text: .text%__1cMdivD_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKJavaThread2t6MpFp0pnGThread__vL_v_; text: .text%__1cPcmpD_cc_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cTconvI2D_reg_regNodeErule6kM_I_; -text: .text%__1cQshrL_rReg_CLNodeJnum_opnds6kM_I_; text: .text%__1cNcmovL_memNodePoper_input_base6kM_I_; text: .text%__1cNdivL_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPcmpD_cc_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -5949,38 +3839,25 @@ text: .text%__1cQsalL_rReg_CLNodeHtwo_adr6kM_I_; text: .text%__1cVCallRuntimeDirectNodeFreloc6kM_i_; text: .text%__1cIGraphKitIset_jvms6MpnIJVMState__v_; text: .text%__1cKJavaThreadDrun6M_v_; -text: .text%__1cTconvD2I_reg_regNodeJnum_opnds6kM_I_; text: .text%__1cOsalI_mem_1NodePoper_input_base6kM_I_; -text: .text%__1cSMachCallNativeNodePret_addr_offset6M_i_; text: .text%__1cMLinkResolverbEresolve_interface_call_or_null6FnLKlassHandle_1nMsymbolHandle_21_nMmethodHandle__; -text: .text%__1cZInterpreterMacroAssemblerFpop_f6MpnRFloatRegisterImpl__v_; text: .text%__1cMrdi_RegIOperEtype6kM_pknEType__; -text: .text%__1cVThreadStateTransitionKtransition6FpnKJavaThread_nPJavaThreadState_3_v_; -text: .text%__1cUCallNativeDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cKJavaThreadRthread_main_inner6M_v_; -text: .text%__1cQorI_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cIGraphKitbAgen_stub_or_native_wrapper6MpCpkcpnIciMethod_iiiii_v_; text: .text%__1cPsalL_rReg_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMResourceMark2t6M_v_; text: .text%__1cQshrI_rReg_CLNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cJScopeDescGlocals6M_pnNGrowableArray4CpnKScopeValue____; text: .text%__1cJScopeDescVdecode_monitor_values6Mi_pnNGrowableArray4CpnMMonitorValue____; -text: .text%__1cSvframeArrayElementPunpack_on_stack6MiipnFframe_ii_v_; -text: .text%__1cTAbstractInterpreterRlayout_activation6FpnNmethodOopDesc_iiiipnFframe_4i_v_; text: .text%__1cOcompiledVFrameLexpressions6kM_pnUStackValueCollection__; text: .text%__1cOcompiledVFrameImonitors6kM_pnNGrowableArray4CpnLMonitorInfo____; text: .text%__1cOcompiledVFrameGmethod6kM_pnNmethodOopDesc__; text: .text%__1cSvframeArrayElementHfill_in6MpnOcompiledVFrame__v_; text: .text%__1cOcompiledVFrameHraw_bci6kM_i_; -text: .text%__1cNGrowableArray4CpnLMonitorInfo__2t6Mii_v_; text: .text%__1cPPerfDataManagerWcreate_string_constant6FnJCounterNS_pkc3pnGThread__pnSPerfStringConstant__; text: .text%__1cOMacroAssemblerKincrementl6MpnMRegisterImpl_i_v_; text: .text%__1cFframebCinterpreter_frame_set_locals6Mpl_v_; text: .text%__1cFframebHinterpreter_frame_set_monitor_end6MpnPBasicObjectLock__v_; -text: .text%__1cTAbstractInterpreterPsize_activation6FpnNmethodOopDesc_iiiii_i_; text: .text%__1cSPerfStringConstant2t6MnJCounterNS_pkc3_v_; -text: .text%__1cTAbstractInterpreterQcontinuation_for6FpnNmethodOopDesc_pCiiri_3_; -text: .text%__1cZInterpreterMacroAssemblerLcall_VM_Ico6MpnMRegisterImpl_pC2i_v_; text: .text%__1cFframebCinterpreter_frame_set_method6MpnNmethodOopDesc__v_; text: .text%__1cMmulF_regNodeMideal_Opcode6kM_i_; text: .text%__1cFframebBinterpreter_frame_sender_sp6kM_pl_; @@ -5991,18 +3868,10 @@ text: .text%__1cJScopeDescImonitors6M_pnNGrowableArray4CpnMMonitorValue____; text: .text%__1cJAssemblerEaddl6MpnMRegisterImpl_i_v_; text: .text%__1cOcompiledVFrameGlocals6kM_pnUStackValueCollection__; text: .text%__1cJScopeDescLexpressions6M_pnNGrowableArray4CpnKScopeValue____; -text: .text%__1cTconvF2D_reg_memNodeRis_cisc_alternate6kM_i_; -text: .text%__1cSvframeArrayElementNon_stack_size6kMiiii_i_; -text: .text%__1cMaddD_regNodePoper_input_base6kM_I_; text: .text%__1cXjava_lang_boxing_objectJget_value6FpnHoopDesc_pnGjvalue__nJBasicType__; -text: .text%__1cMorL_rRegNodePoper_input_base6kM_I_; -text: .text%__1cOcmovD_regUNodePoper_input_base6kM_I_; text: .text%__1cPcmovI_reg_gNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cMdivD_immNodePoper_input_base6kM_I_; -text: .text%__1cJloadDNodeHtwo_adr6kM_I_; text: .text%__1cKReflectionTunbox_for_primitive6FpnHoopDesc_pnGjvalue_pnGThread__nJBasicType__; text: .text%__1cCosMset_priority6FpnGThread_nOThreadPriority__nIOSReturn__; -text: .text%__1cMmulF_memNodeJnum_opnds6kM_I_; text: .text%__1cIMulDNodeImul_ring6kMpknEType_3_3_; text: .text%__1cODeoptimizationVtrap_state_add_reason6Fii_i_; text: .text%__1cDhpiFclose6Fi_i_; @@ -6012,32 +3881,22 @@ text: .text%__1cZInterpreterMacroAssemblerUupdate_mdp_by_offset6MpnMRegisterImpl text: .text%__1cNcmovL_regNodeMideal_Opcode6kM_i_; text: .text%__1cZInterpreterMacroAssemblerWupdate_mdp_by_constant6MpnMRegisterImpl_i_v_; text: .text%__1cOtailjmpIndNodeNis_block_proj6kM_pknENode__; -text: .text%__1cRaddL_rReg_memNodeJnum_opnds6kM_I_; text: .text%__1cTconvI2F_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cTconvL2F_reg_regNodeMideal_Opcode6kM_i_; text: .text%__1cGICStubKcached_oop6kM_pnHoopDesc__; text: .text%__1cRInlineCacheBufferUic_buffer_cached_oop6FpC_pnHoopDesc__; -text: .text%__1cTconvD2F_reg_regNodePoper_input_base6kM_I_; -text: .text%__1cJAssemblerFpushq6Mi_v_; text: .text%JVM_Close; -text: .text%__1cMnegF_regNodePoper_input_base6kM_I_; -text: .text%__1cOcmovI_regUNodeJnum_opnds6kM_I_; -text: .text%__1cbCAbstractInterpreterGeneratorRset_unimplemented6Mi_v_; text: .text%__1cRComputeEntryStackJdo_object6Mii_v_; text: .text%__1cMLinkResolverYresolve_interface_method6FrnMmethodHandle_rnLKlassHandle_nSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cOcmovI_regUNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cGThreadMset_priority6Fp0nOThreadPriority__v_; text: .text%jni_NewObjectV: jni.o; text: .text%__1cKConv2BNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cQshrL_rReg_CLNodeErule6kM_I_; text: .text%__1cTconvF2D_reg_regNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cHnmethodbCcan_not_entrant_be_converted6M_i_; text: .text%__1cNSafePointNodeQpeek_monitor_obj6kM_pnENode__; text: .text%__1cOcmovI_regUNodeMcisc_operand6kM_i_; text: .text%__1cNSafePointNodeQpeek_monitor_box6kM_pnENode__; text: .text%__1cJLoadBNodeMstore_Opcode6kM_i_; -text: .text%__1cVCompressedWriteStreamKwrite_long6Mx_v_; -text: .text%__1cTconvF2I_reg_regNodePoper_input_base6kM_I_; text: .text%__1cLConvF2INodeGOpcode6kM_i_; text: .text%__1cPMultiBranchDataScompute_cell_count6FpnOBytecodeStream__i_; text: .text%__1cFParsePdo_monitor_exit6M_v_; @@ -6047,70 +3906,39 @@ text: .text%__1cRStubCodeGeneratorLstub_epilog6MpnMStubCodeDesc__v_; text: .text%__1cRStubCodeGeneratorLstub_prolog6MpnMStubCodeDesc__v_; text: .text%__1cKcastPPNodeErule6kM_I_; text: .text%__1cNTemplateTableDdef6FnJBytecodesECode_inITosState_3pF3_v3_v_; -text: .text%__1cOsalI_mem_1NodeJnum_opnds6kM_I_; text: .text%__1cKJavaThreadbFdeoptimized_wrt_marked_nmethods6M_v_; text: .text%__1cKJavaThreadHprepare6MpnI_jobject_nOThreadPriority__v_; -text: .text%__1cPshrL_rReg_1NodeJnum_opnds6kM_I_; -text: .text%__1cRandI_rReg_memNodeRis_cisc_alternate6kM_i_; -text: .text%__1cRandI_rReg_memNodeJnum_opnds6kM_I_; -text: .text%__1cQorI_rReg_memNodeRis_cisc_alternate6kM_i_; text: .text%__1cJAssemblerGmovslq6MpnMRegisterImpl_2_v_; text: .text%__1cRandI_rReg_memNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cQjava_lang_ThreadJstackSize6FpnHoopDesc__x_; text: .text%__1cRConstantLongValueIwrite_on6MpnUDebugInfoWriteStream__v_; text: .text%JVM_StartThread; text: .text%__1cMthread_entry6FpnKJavaThread_pnGThread__v_: jvm.o; -text: .text%__1cTconvF2D_reg_regNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cMsubD_regNodeErule6kM_I_; text: .text%__1cQjava_lang_ThreadIpriority6FpnHoopDesc__nOThreadPriority__; text: .text%__1cNmulI_rRegNodeQuse_cisc_RegMask6M_v_; text: .text%__1cIMulFNodeImul_ring6kMpknEType_3_3_; text: .text%__1cLRuntimeStub2n6FLI_pv_; -text: .text%__1cLRuntimeStubQnew_runtime_stub6FpkcpnKCodeBuffer_ipnJOopMapSet_i_p0_; -text: .text%__1cLRuntimeStub2t6MpkcpnKCodeBuffer_iipnJOopMapSet_i_v_; -text: .text%__1cTconvF2D_reg_regNodeJnum_opnds6kM_I_; -text: .text%__1cRxorI_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cMmulF_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cOLibraryCallKitbDis_method_invoke_or_aux_frame6MpnIJVMState__i_; text: .text%__1cbFloadConL_0x6666666666666667NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cIAddFNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cOloadConL32NodeHsize_of6kM_I_; text: .text%__1cNTemplateTableDdef6FnJBytecodesECode_inITosState_3pFn0AJOperation__v4_v_; text: .text%__1cRaddL_rReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIDivLNodeJideal_reg6kM_I_; text: .text%__1cGICStubFclear6M_v_; -text: .text%__1cTconvI2D_reg_regNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cMsubD_regNodeJnum_opnds6kM_I_; -text: .text%__1cMsubD_regNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cHCompileWget_MethodAccessorImpl6M_pnPciInstanceKlass__; -text: .text%__1cHCompileRget_Method_invoke6M_pnIciMethod__; text: .text%__1cNdecI_rRegNodeIpipeline6kM_pknIPipeline__; text: .text%__1cFTypeFFxdual6kM_pknEType__; -text: .text%__1cTconvL2D_reg_memNodeJnum_opnds6kM_I_; -text: .text%__1cTconvI2D_reg_regNodeJnum_opnds6kM_I_; -text: .text%__1cTunsafe_intrinsic_id6FpnNsymbolOopDesc_1_nMvmIntrinsicsCID__; -text: .text%__1cPPerfDataManagerUcreate_long_constant6FnJCounterNS_pkcnIPerfDataFUnits_xpnGThread__pnQPerfLongConstant__; text: .text%__1cFStateM_sub_Op_ConF6MpknENode__v_; text: .text%__1cMloadConFNodeHsize_of6kM_I_; text: .text%__1cPsarL_rReg_2NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQsarL_rReg_63NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPoldgetTimeNanos6F_x_; -text: .text%__1cPno_rax_RegLOperFclone6kM_pnIMachOper__; -text: .text%__1cTAbstractInterpreterMreturn_entry6FnITosState_i_pC_; -text: .text%__1cPsarL_rReg_1NodePoper_input_base6kM_I_; -text: .text%__1cMnegD_regNodeJnum_opnds6kM_I_; text: .text%__1cKmul_hiNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cJAssemblerEjccb6Mn0AJCondition_rnFLabel_nJrelocInfoJrelocType__v_; text: .text%__1cNcmovP_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cHMonitor2T6M_v_; text: .text%__1cINegDNodeLbottom_type6kM_pknEType__; -text: .text%__1cLvframeArrayIallocate6FpnKJavaThread_ipnNGrowableArray4CpnOcompiledVFrame___pnLRegisterMap_nFframe_9A9A9A_p0_; -text: .text%__1cNThreadServiceNremove_thread6FpnKJavaThread_i_v_; text: .text%__1cQjava_lang_ThreadbGinherited_access_control_context6FpnHoopDesc__2_; -text: .text%__1cODeoptimizationScreate_vframeArray6FpnKJavaThread_nFframe_pnLRegisterMap__pnLvframeArray__; text: .text%__1cHThreadsGremove6FpnKJavaThread__v_; text: .text%__1cODeoptimizationTuncommon_trap_inner6FpnKJavaThread_i_v_; -text: .text%__1cODeoptimizationPget_method_data6FpnKJavaThread_nMmethodHandle_i_pnRmethodDataOopDesc__; text: .text%__1cLensure_join6FpnKJavaThread__v_: thread.o; text: .text%__1cIOSThread2T6M_v_; text: .text%__1cODeoptimizationNuncommon_trap6FpnKJavaThread_i_pn0ALUnrollBlock__; @@ -6118,10 +3946,7 @@ text: .text%__1cTconvI2D_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cODeoptimizationRgather_statistics6Fn0ALDeoptReason_n0ALDeoptAction_nJBytecodesECode__v_; text: .text%__1cUThreadSafepointStateHdestroy6FpnKJavaThread__v_; text: .text%__1cIGraphKitTdprecision_rounding6MpnENode__2_; -text: .text%__1cNGrowableArray4CpnOcompiledVFrame__2t6Mii_v_; text: .text%__1cOcmovI_regUNodeErule6kM_I_; -text: .text%__1cKJavaThreadEexit6Mi_v_; -text: .text%__1cGParker2T6M_v_; text: .text%__1cCosLfree_thread6FpnIOSThread__v_; text: .text%__1cXpartialSubtypeCheckNodeMideal_Opcode6kM_i_; text: .text%JVM_GetInheritedAccessControlContext; @@ -6135,10 +3960,6 @@ text: .text%__1cMmulD_memNodePoper_input_base6kM_I_; text: .text%__1cRInlineCacheBufferSic_destination_for6FpnKCompiledIC__pC_; text: .text%__1cLvframeArrayPunpack_to_stack6MrnFframe_i_v_; text: .text%__1cOcompL_rRegNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cODeoptimizationLUnrollBlock2t6MiiiiiplppCnJBasicType__v_; -text: .text%__1cLvframeArrayHfill_in6MpnKJavaThread_ipnNGrowableArray4CpnOcompiledVFrame___pknLRegisterMap_i_v_; -text: .text%__SLIP.DELETER__A: thread.o; -text: .text%__1cbIjava_security_AccessControlContextGcreate6FnOobjArrayHandle_inGHandle_pnGThread__pnHoopDesc__; text: .text%__1cIOSThreadKpd_destroy6M_v_; text: .text%__1cMaddF_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cODeoptimizationYfetch_unroll_info_helper6FpnKJavaThread__pn0ALUnrollBlock__; @@ -6146,15 +3967,12 @@ text: .text%__1cODeoptimizationRlast_frame_adjust6Fii_i_; text: .text%__1cKJavaThreadYremove_stack_guard_pages6M_v_; text: .text%__1cODeoptimizationNunpack_frames6FpnKJavaThread_i_nJBasicType__; text: .text%__1cNnmethodLocker2t6MpC_v_; -text: .text%__1cTconvD2I_reg_regNodeHtwo_adr6kM_I_; text: .text%__1cOtailjmpIndNodeMideal_Opcode6kM_i_; text: .text%__1cLconvI2BNodeErule6kM_I_; text: .text%__1cTconvF2I_reg_regNodeErule6kM_I_; text: .text%__1cIciMethodVget_osr_flow_analysis6Mi_pnKciTypeFlow__; text: .text%__1cSCallLeafDirectNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cQAbstractCompilerMsupports_osr6M_i_; text: .text%__1cRaddL_mem_rRegNodePoper_input_base6kM_I_; -text: .text%__1cSCallLeafDirectNodeJnum_opnds6kM_I_; text: .text%__1cXjava_lang_reflect_FieldJmodifiers6FpnHoopDesc__i_; text: .text%__1cMmulL_memNodePoper_input_base6kM_I_; text: .text%__1cODeoptimizationLUnrollBlock2T6M_v_; @@ -6171,14 +3989,10 @@ text: .text%__1cJSubFPNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cZInterpreterMacroAssemblerNdispatch_only6MnITosState__v_; text: .text%__1cRcmpFastUnlockNodeIpipeline6kM_pknIPipeline__; text: .text%__1cKloadUBNodeFreloc6kM_i_; -text: .text%__1cMStartOSRNodeScalling_convention6kMpnLOptoRegPair_I_v_; text: .text%__1cMStartOSRNodeKosr_domain6F_pknJTypeTuple__; -text: .text%__1cMloadConPNodeGis_Con6kM_I_; text: .text%__1cMmulD_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cXjava_lang_reflect_FieldFclazz6FpnHoopDesc__2_; -text: .text%__1cOPSVirtualSpaceJexpand_by6ML_i_; text: .text%__1cNCallGeneratorHfor_osr6FpnIciMethod_i_p0_; -text: .text%__1cFParseWload_interpreter_state6MpnENode_2_v_; text: .text%__1cKstoreINodeIpipeline6kM_pknIPipeline__; text: .text%__1cOstackSlotDOperKin_RegMask6kMi_pknHRegMask__; text: .text%jni_GetFloatArrayRegion: jni.o; @@ -6191,121 +4005,82 @@ text: .text%__1cRaddL_mem_rRegNodeMideal_Opcode6kM_i_; text: .text%__1cIAddFNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cJloadDNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMlogD_regNodeErule6kM_I_; -text: .text%__1cXpartialSubtypeCheckNodePoper_input_base6kM_I_; text: .text%__1cNmulI_rRegNodeHtwo_adr6kM_I_; text: .text%__1cMdecI_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQsalL_rReg_CLNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cKemit_break6FrnKCodeBuffer__v_; text: .text%jni_GetStaticMethodID: jni.o; -text: .text%__1cOstackSlotDOperJnum_edges6kM_I_; text: .text%__1cMsubF_regNodeMcisc_operand6kM_i_; text: .text%__1cMdecI_memNodeFreloc6kM_i_; -text: .text%__1cMdecI_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cRCardTableModRefBSbCfind_covering_region_by_base6MpnIHeapWord__i_; text: .text%__1cRCardTableModRefBSVresize_covered_region6MnJMemRegion__v_; text: .text%__1cINegFNodeGOpcode6kM_i_; text: .text%__1cRCardTableModRefBSbAlargest_prev_committed_end6kMi_pnIHeapWord__; -text: .text%__1cLloadSSDNodeJnum_opnds6kM_I_; text: .text%__1cSMachBreakpointNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cSCardTableExtensionVresize_covered_region6MnJMemRegion__v_; -text: .text%__1cLconvI2BNodeJnum_opnds6kM_I_; text: .text%__1cNstoreImmPNodePoper_input_base6kM_I_; text: .text%__1cKReflectionUarray_component_type6FpnHoopDesc_pnGThread__2_; text: .text%__1cKoopFactoryUnew_compiledICHolder6FnMmethodHandle_nLKlassHandle_pnGThread__pnXcompiledICHolderOopDesc__; -text: .text%__1cHCompile2t6MpnFciEnv_pF_pknITypeFunc_pCpkciiii_v_; text: .text%__1cTconvL2F_reg_regNodeMcisc_operand6kM_i_; -text: .text%__1cMciArrayKlassOis_array_klass6M_i_; -text: .text%__1cNloadConPcNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cKarrayKlassWuncached_lookup_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cFStateM_sub_Op_CmpD6MpknENode__v_; -text: .text%__1cNloadConL0NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cUCallNativeDirectNodeKmethod_set6Ml_v_; text: .text%__1cKcastPPNodeMideal_Opcode6kM_i_; -text: .text%__1cNcmovL_memNodeJnum_opnds6kM_I_; text: .text%__1cZInterpreterMacroAssemblerUprofile_taken_branch6MpnMRegisterImpl_2_v_; text: .text%__1cPshrL_rReg_1NodeHtwo_adr6kM_I_; -text: .text%__1cIGraphKitIgen_stub6MpCpkciii_v_; text: .text%__1cbDcatch_cleanup_find_cloned_def6FpnFBlock_pnENode_1rnLBlock_Array_i_3_: lcm.o; text: .text%__1cVcompiledICHolderKlassIallocate6MpnGThread__pnXcompiledICHolderOopDesc__; -text: .text%__1cTC2IAdapterGeneratorUmkh_unverified_entry6FnMmethodHandle__pC_; -text: .text%__1cRaddL_rReg_memNodeRis_cisc_alternate6kM_i_; -text: .text%__1cLOptoRuntimeNgenerate_stub6FpnFciEnv_pF_pknITypeFunc_pCpkciiii_8_; text: .text%__1cISubDNodeLbottom_type6kM_pknEType__; text: .text%__1cbCcatch_cleanup_fix_all_inputs6FpnENode_11_v_: lcm.o; text: .text%__1cISubFNodeLbottom_type6kM_pknEType__; text: .text%__1cNdivI_rRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNTemplateTableGbranch6Fii_v_; -text: .text%__1cNstoreImmPNodeHtwo_adr6kM_I_; -text: .text%__1cLOptoRuntimeRnew_objArray_Type6F_pknITypeFunc__; text: .text%JVM_GetComponentType; text: .text%__1cIMulDNodeJideal_reg6kM_I_; -text: .text%__1cTconvF2D_reg_regNodeHtwo_adr6kM_I_; text: .text%__1cJAssemblerEsbbq6MpnMRegisterImpl_i_v_; text: .text%__1cNcmovL_memNodeMideal_Opcode6kM_i_; text: .text%jni_GetStringRegion: jni.o; text: .text%jni_EnsureLocalCapacity: jni.o; -text: .text%__1cLloadSSDNodeHtwo_adr6kM_I_; text: .text%__1cMaddF_memNodePoper_input_base6kM_I_; text: .text%__1cFParseMdo_anewarray6M_v_; text: .text%__1cLConvI2FNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cLconvI2BNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cOMacroAssemblerHcall_VM6MpnMRegisterImpl_pC22i_v_; text: .text%__1cHThreadsYis_supported_jni_version6Fi_C_; -text: .text%__1cMincL_memNodeJnum_opnds6kM_I_; -text: .text%__1cRandL_rReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cKarrayKlassYcompute_secondary_supers6MipnGThread__pnPobjArrayOopDesc__; -text: .text%__1cRaddL_mem_rRegNodeJnum_opnds6kM_I_; text: .text%JVM_NewArray; text: .text%JVM_FreeMemory; text: .text%JVM_TotalMemory; -text: .text%__1cMaddD_immNodeJnum_opnds6kM_I_; -text: .text%__1cMsubF_regNodeJnum_opnds6kM_I_; -text: .text%__1cLloadSSINodePoper_input_base6kM_I_; text: .text%__1cNinstanceKlassPadd_osr_nmethod6MpnHnmethod__v_; text: .text%__1cMincI_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKReflectionRreflect_new_array6FpnHoopDesc_ipnGThread__pnMarrayOopDesc__; -text: .text%__1cMsubF_regNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cMmulF_memNodeErule6kM_I_; text: .text%__1cODeoptimizationbJupdate_method_data_from_interpreter6FnQmethodDataHandle_ii_v_; text: .text%__1cLClassLoaderSget_system_package6FpkcpnGThread__pnHoopDesc__; text: .text%__1cMTailJumpNodeKmatch_edge6kMI_I_; -text: .text%__1cFStateL_sub_Op_Box6MpknENode__v_; text: .text%__1cRaddL_rReg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cTconvL2F_reg_regNodeErule6kM_I_; text: .text%__1cKPSYoungGenLpost_resize6M_v_; text: .text%__1cNcmovL_regNodeErule6kM_I_; -text: .text%__1cOcmovD_regUNodeJnum_opnds6kM_I_; text: .text%__1cRandI_rReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMnegF_regNodeHtwo_adr6kM_I_; -text: .text%__1cTAbstractInterpreterRTosState_as_index6FnITosState__i_; text: .text%__1cHThreadsbMis_supported_jni_version_including_1_16Fi_C_; text: .text%__1cKstoreBNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cPBytecode_invokeLresult_type6kMpnGThread__nJBasicType__; text: .text%__1cMincL_memNodeMideal_Opcode6kM_i_; text: .text%__1cJAssemblerEaddl6MpnMRegisterImpl_nHAddress__v_; -text: .text%__1cJloadCNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cCosPuncommit_memory6FpcL_i_; text: .text%__1cSInterpreterRuntimeJnote_trap6FpnKJavaThread_ipnGThread__v_; text: .text%__1cRSignatureIteratorHiterate6M_v_; text: .text%__1cIModLNodeJideal_reg6kM_I_; -text: .text%__1cNTemplateTableOpatch_bytecode6FnJBytecodesECode_pnMRegisterImpl_4i_v_; text: .text%__1cLConvD2INodeLbottom_type6kM_pknEType__; text: .text%__1cMaddF_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cHBoxNodeLbottom_type6kM_pknEType__; text: .text%__1cFStateM_sub_Op_DivL6MpknENode__v_; text: .text%__1cTconvL2D_reg_memNodeErule6kM_I_; text: .text%JVM_GetSystemPackage; -text: .text%__1cCosNcommit_memory6FpcLL_i_; text: .text%__1cOMacroAssemblerFenter6M_v_; text: .text%__1cLConvF2DNodeJideal_reg6kM_I_; text: .text%__1cNTemplateTableLindex_check6FpnMRegisterImpl_2_v_; text: .text%__1cKNativeJumpUpatch_verified_entry6FpC11_v_; text: .text%__1cLMoveL2DNodeGOpcode6kM_i_; -text: .text%__1cMincI_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cFStateP_sub_Op_ConvF2D6MpknENode__v_; text: .text%__1cMmulL_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%Unsafe_DefineClass1; -text: .text%__1cSUnsafe_DefineClass6FpnHJNIEnv__pnI_jstring_pnL_jbyteArray_iipnI_jobject_7_pnH_jclass__: unsafe.o; text: .text%__1cFTypeDFxdual6kM_pknEType__; text: .text%__1cMincI_memNodeFreloc6kM_i_; text: .text%__1cPcmpF_cc_regNodeLout_RegMask6kM_rknHRegMask__; @@ -6314,12 +4089,8 @@ text: .text%__1cMsubF_memNodePoper_input_base6kM_I_; text: .text%__1cTconvF2D_reg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%JVM_DefineClass; text: .text%__1cMaddF_memNodeMideal_Opcode6kM_i_; -text: .text%__1cMmulL_memNodeRis_cisc_alternate6kM_i_; -text: .text%__1cMmulL_memNodeJnum_opnds6kM_I_; text: .text%__1cJAssemblerEshrq6MpnMRegisterImpl_i_v_; -text: .text%__1cTC2IAdapterGeneratorLadapter_for6FnMmethodHandle__pnKC2IAdapter__; text: .text%__1cPcmpFastLockNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cZInterpreterMacroAssemblerQtest_mdp_data_at6MpnMRegisterImpl_i2rnFLabel__v_; text: .text%__1cZInterpreterMacroAssemblerYprofile_not_taken_branch6MpnMRegisterImpl__v_; text: .text%__1cTleaPIdxScaleOffNodeIpipeline6kM_pknIPipeline__; text: .text%__1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_533pnGThread__v_; @@ -6327,42 +4098,29 @@ text: .text%__1cYjava_lang_reflect_MethodFclazz6FpnHoopDesc__2_; text: .text%__1cYjava_lang_reflect_MethodEslot6FpnHoopDesc__i_; text: .text%__1cYjava_lang_reflect_MethodLreturn_type6FpnHoopDesc__2_; text: .text%__1cYjava_lang_reflect_MethodPparameter_types6FpnHoopDesc__2_; -text: .text%__1cNloadConL0NodeGis_Con6kM_I_; -text: .text%__1cMset_property6FnGHandle_pkc2pnGThread__v_: jvm.o; text: .text%JVM_GetCPFieldModifiers; text: .text%JVM_InvokeMethod; text: .text%__1cFKlassWcompute_modifier_flags6kMpnGThread__i_; -text: .text%__1cZcatch_cleanup_inter_block6FpnENode_pnFBlock_13rnLBlock_Array_i_v_: lcm.o; text: .text%__1cOsalI_mem_1NodeMideal_Opcode6kM_i_; -text: .text%__1cMaddF_immNodeJnum_opnds6kM_I_; -text: .text%__1cMsubD_immNodePoper_input_base6kM_I_; text: .text%__1cMmulF_regNodeMcisc_operand6kM_i_; -text: .text%__1cMmulF_regNodeJnum_opnds6kM_I_; -text: .text%__1cMmulF_memNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cMmulD_regNodeHtwo_adr6kM_I_; text: .text%__1cTconvD2F_reg_regNodeMcisc_operand6kM_i_; text: .text%jni_AllocObject: jni.o; -text: .text%__1cCosHSolarisOset_mpss_range6FpcLL_i_; text: .text%__1cTconvF2I_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFParseOdo_tableswitch6M_v_; text: .text%__1cTmembar_volatileNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKReflectionNinvoke_method6FpnHoopDesc_nGHandle_nOobjArrayHandle_pnGThread__2_; -text: .text%__1cMrdx_RegLOperFclone6kM_pnIMachOper__; text: .text%__1cICmpFNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cNTemplateTableDdef6FnJBytecodesECode_inITosState_3pFn0AJCondition__v4_v_; -text: .text%__1cFj_not6FnNTemplateTableJCondition__nJAssemblerJCondition__: templateTable_amd64.o; text: .text%__1cNTemplateTableMlocals_index6FpnMRegisterImpl_i_v_; text: .text%__1cTconvF2D_reg_regNodeQuse_cisc_RegMask6M_v_; -text: .text%__1cMmulF_regNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%Unsafe_AllocateInstance; text: .text%__1cZInterpreterMacroAssemblerNunlock_object6MpnMRegisterImpl__v_; text: .text%__1cOcmovD_regUNodeMideal_Opcode6kM_i_; -text: .text%__1cIciObjectMis_classless6kM_i_; text: .text%__1cMsubD_immNodeMideal_Opcode6kM_i_; text: .text%__1cRInlineCacheBufferOinit_next_stub6F_v_; text: .text%__1cPshrL_rReg_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMsubD_immNodeErule6kM_I_; -text: .text%__1cHTypePtrKadd_offset6kMi_pk0_; text: .text%__1cNTemplateTableHconvert6F_v_; text: .text%__1cMnegD_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQorI_rReg_memNodeOmemory_operand6kM_pknIMachOper__; @@ -6377,7 +4135,6 @@ text: .text%__1cTconvD2I_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cScompL_rReg_memNodeMideal_Opcode6kM_i_; text: .text%__1cXpartialSubtypeCheckNodeErule6kM_I_; text: .text%__1cOstackSlotDOperEtype6kM_pknEType__; -text: .text%__1cHThreadsLnmethods_do6F_v_; text: .text%__1cLloadSSDNodeErule6kM_I_; text: .text%__1cMsubD_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRComputeEntryStackIdo_short6M_v_; @@ -6390,7 +4147,6 @@ text: .text%__1cMloadConFNodeKconst_size6kM_i_; text: .text%__1cMorL_rRegNodeMcisc_operand6kM_i_; text: .text%__1cMmulD_memNodeMideal_Opcode6kM_i_; text: .text%__1cMaddD_regNodeMideal_Opcode6kM_i_; -text: .text%__1cTconvI2D_reg_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cMnegF_regNodeMideal_Opcode6kM_i_; text: .text%__1cMloadConFNodeFreloc6kM_i_; text: .text%__1cILogDNodeLbottom_type6kM_pknEType__; @@ -6398,48 +4154,35 @@ text: .text%__1cLConvI2DNodeLbottom_type6kM_pknEType__; text: .text%__1cNstoreImmPNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLStrCompNodeJideal_reg6kM_I_; text: .text%__1cMlogD_regNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cFVTuneOdelete_nmethod6FpnHnmethod__v_; text: .text%__1cMaddD_regNodeMcisc_operand6kM_i_; text: .text%__1cMaddD_regNodeErule6kM_I_; text: .text%__1cScompL_rReg_memNodePoper_input_base6kM_I_; text: .text%__1cIAddFNodeJideal_reg6kM_I_; -text: .text%__1cJimmP0OperPconstant_is_oop6kM_i_; text: .text%__1cJimmP0OperIconstant6kM_l_; text: .text%__1cNciMethodKlassEmake6F_p0_; -text: .text%__1cETypeJis_finite6kM_i_; text: .text%__1cHnmethodFflush6M_v_; text: .text%JVM_GetClassContext; -text: .text%__1cIciObjectTis_type_array_klass6M_i_; -text: .text%__1cNsubL_rRegNodeMcisc_version6Mi_pnIMachNode__; -text: .text%__1cIregFOperFclone6kM_pnIMachOper__; text: .text%__1cRfind_field_offset6FpnI_jobject_ipnGThread__i_; -text: .text%__1cHBoxNodeJideal_reg6kM_I_; text: .text%__1cXPartialSubtypeCheckNodeLbottom_type6kM_pknEType__; text: .text%__1cIciMethod2t6MpnPciInstanceKlass_pnIciSymbol_4_v_; text: .text%__1cPfieldDescriptorTfloat_initial_value6kM_f_; -text: .text%__1cLloadSSDNodeMideal_Opcode6kM_i_; text: .text%__1cMsubF_regNodeErule6kM_I_; text: .text%__1cRsubL_rReg_memNodeFreloc6kM_i_; -text: .text%__1cKExceptionsNnew_exception6FpnGThread_pnNsymbolOopDesc_pkc_nGHandle__; text: .text%__1cTconvL2F_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMmulF_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cJStubQdDueueKremove_all6M_v_; text: .text%__1cIDivDNodeLbottom_type6kM_pknEType__; text: .text%__1cLStatSamplerTget_system_property6FpkcpnGThread__2_; -text: .text%__1cRmethodDataOopDescRbci_to_extra_data6Mii_pnLProfileData__; text: .text%__1cICodeBlobFflush6M_v_; text: .text%__1cVMoveF2I_reg_stackNodeMideal_Opcode6kM_i_; -text: .text%__1cNmodL_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJArgumentsQPropertyList_add6FppnOSystemProperty_2_v_; text: .text%__1cKstoreCNodeIpipeline6kM_pknIPipeline__; text: .text%__1cSmembar_releaseNodeIadr_type6kM_pknHTypePtr__; -text: .text%__1cQsalI_rReg_CLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cSInterpreterRuntimeQcreate_exception6FpnKJavaThread_pc3_v_; text: .text%__1cJAssemblerEaddl6MpnMRegisterImpl_2_v_; text: .text%__1cJStubQdDueueMremove_first6Mi_v_; text: .text%__1cQinitialize_class6FnMsymbolHandle_pnGThread__v_: thread.o; text: .text%__1cJAssemblerFcmovq6Mn0AJCondition_pnMRegisterImpl_nHAddress__v_; -text: .text%__1cXpartialSubtypeCheckNodeJnum_opnds6kM_I_; text: .text%__1cMmulD_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cMaddF_immNodeHtwo_adr6kM_I_; text: .text%__1cIMulDNodeGmul_id6kM_pknEType__; @@ -6451,20 +4194,15 @@ text: .text%__1cFStateM_sub_Op_MulD6MpknENode__v_; text: .text%__1cFStateM_sub_Op_ModL6MpknENode__v_; text: .text%__1cJJavaCallsLcall_static6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4nGHandle_pnGThread__v_; text: .text%__1cXjava_lang_reflect_FieldEslot6FpnHoopDesc__i_; -text: .text%__1cPloadConUL32NodeGis_Con6kM_I_; text: .text%__1cQshrL_rReg_CLNodeHtwo_adr6kM_I_; text: .text%__1cKJavaThreadbOcheck_special_condition_for_native_trans6Fp0_v_; -text: .text%__1cODeoptimizationYreset_invocation_counter6FpnJScopeDesc_i_v_; text: .text%__1cZCallDynamicJavaDirectNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cTconvF2I_reg_regNodeJnum_opnds6kM_I_; -text: .text%__1cMmulD_memNodeJnum_opnds6kM_I_; text: .text%__1cHOrLNodeGOpcode6kM_i_; text: .text%__1cIMulFNodeGmul_id6kM_pknEType__; text: .text%__1cMnegF_regNodeErule6kM_I_; text: .text%__1cMsubF_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cTconvD2F_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%JVM_RawMonitorCreate; -text: .text%__1cOresolve_symbol6Fpkc_pC_: os_solaris.o; text: .text%__1cMMutableSpaceOobject_iterate6MpnNObjectClosure__v_; text: .text%__1cKCMoveDNodeGOpcode6kM_i_; text: .text%__1cFParseQdo_monitor_enter6M_v_; @@ -6472,34 +4210,17 @@ text: .text%__1cPMultiBranchDataPpost_initialize6MpnOBytecodeStream_pnRmethodDat text: .text%__1cXpartialSubtypeCheckNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cLConvD2INodeJideal_reg6kM_I_; text: .text%__1cKcastPPNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cZCallDynamicJavaDirectNodeJnum_opnds6kM_I_; -text: .text%__1cMlogD_regNodeJnum_opnds6kM_I_; text: .text%Unsafe_CompareAndSwapInt; text: .text%__1cOstackSlotIOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cOstackSlotIOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_; -text: .text%__1cMmatch_option6FpknMJavaVMOption_ppkc5i_i_: arguments.o; text: .text%__1cMmulD_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNmulI_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cKimmL32OperFclone6kM_pnIMachOper__; -text: .text%__1cIimmFOperFclone6kM_pnIMachOper__; text: .text%__1cOMacroAssemblerTset_last_Java_frame6MpnMRegisterImpl_22pC_v_; -text: .text%__1cOindOffset8OperFclone6kM_pnIMachOper__; -text: .text%__1cOMacroAssemblerVreset_last_Java_frame6MpnMRegisterImpl_i_v_; -text: .text%__1cOloadConL32NodeFclone6kM_pnENode__; -text: .text%__1cMloadConFNodeFclone6kM_pnENode__; text: .text%__1cScompL_rReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQinstanceRefKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_; text: .text%__1cNTemplateTableRlocals_index_wide6FpnMRegisterImpl__v_; -text: .text%__1cVMoveL2D_reg_stackNodePoper_input_base6kM_I_; text: .text%__1cZInterpreterMacroAssemblerPset_mdp_data_at6MpnMRegisterImpl_i2_v_; -text: .text%__1cKOSRAdapter2n6FLI_pv_; -text: .text%__1cKOSRAdapterPnew_osr_adapter6FpnKCodeBuffer_pnJOopMapSet_ii_p0_; text: .text%__1cJAssemblerEincl6MnHAddress__v_; -text: .text%__1cKOSRAdapter2t6MpnKCodeBuffer_pnJOopMapSet_iii_v_; -text: .text%__1cTconvI2D_reg_regNodeHtwo_adr6kM_I_; -text: .text%__1cNSharedRuntimeRgenerate_osr_blob6Fi_pnKOSRAdapter__; -text: .text%__1cMaddD_regNodeJnum_opnds6kM_I_; -text: .text%__1cbCAbstractInterpreterGeneratorUset_wide_entry_point6MpnITemplate_rpC_v_; text: .text%__1cMmulF_regNodeErule6kM_I_; text: .text%__1cIMulFNodeJideal_reg6kM_I_; text: .text%__1cFStateM_sub_Op_MulF6MpknENode__v_; @@ -6507,149 +4228,85 @@ text: .text%__1cJOopMapSetQsingular_oop_map6M_pnGOopMap__; text: .text%__1cHnmethodVmark_as_seen_on_stack6M_v_; text: .text%__1cMloadConDNodeHsize_of6kM_I_; text: .text%__1cOcmovI_regUNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cLconvI2BNodeHtwo_adr6kM_I_; -text: .text%__1cMorL_rRegNodeJnum_opnds6kM_I_; text: .text%__1cQorI_rReg_memNodeFreloc6kM_i_; text: .text%__1cMaddD_immNodeHtwo_adr6kM_I_; text: .text%__1cMloadConDNodeKconst_size6kM_i_; text: .text%__1cLConvL2FNodeLbottom_type6kM_pknEType__; text: .text%__1cLConvL2DNodeLbottom_type6kM_pknEType__; -text: .text%__1cLloadSSINodeMideal_Opcode6kM_i_; text: .text%__1cOstackSlotDOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cTconvF2D_reg_memNodeFreloc6kM_i_; text: .text%__1cLConvD2INodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cTconvL2D_reg_memNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cMloadConDNodeFreloc6kM_i_; text: .text%JVM_Lseek; text: .text%__1cPsarL_rReg_1NodeErule6kM_I_; text: .text%__1cPsarL_rReg_1NodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cVcompiledICHolderKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cMaddD_regNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cOstackSlotDOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_; -text: .text%__1cMorL_rRegNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cMmulF_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMlogD_regNodeHtwo_adr6kM_I_; -text: .text%__1cRaddI_mem_rRegNodeHtwo_adr6kM_I_; text: .text%__1cFStateM_sub_Op_AddF6MpknENode__v_; text: .text%__1cIXorINodeIadd_ring6kMpknEType_3_3_; -text: .text%__1cTconvL2F_reg_regNodeJnum_opnds6kM_I_; -text: .text%__1cSstring_compareNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cNGrowableArray4CpnKOSRAdapter__Praw_at_put_grow6Mirk14_v_; text: .text%__1cFStateP_sub_Op_StrComp6MpknENode__v_; -text: .text%__1cTconvL2F_reg_regNodePin_oper_RegMask6kMIII_pknHRegMask__; -text: .text%__1cUInterpreterGeneratorUgenerate_fixed_frame6Mi_v_; text: .text%__1cGciType2t6MnJBasicType__v_; -text: .text%__1cMaddF_memNodeJnum_opnds6kM_I_; -text: .text%__1cUInterpreterGeneratorbAgenerate_run_compiled_code6M_v_; text: .text%__1cScompL_rReg_memNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cUInterpreterGeneratorZgenerate_counter_overflow6MpC_v_; text: .text%__1cUInterpreterGeneratorVgenerate_counter_incr6MpnFLabel_22_v_; text: .text%__1cPcmpF_cc_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cXNativeSignatureIteratorHdo_bool6M_v_; text: .text%__1cQmulI_mem_immNodePoper_input_base6kM_I_; -text: .text%__1cbCAbstractInterpreterGeneratorXbang_stack_shadow_pages6Mi_v_; text: .text%__1cZInterpreterMacroAssemblerTnotify_method_entry6M_v_; -text: .text%__1cNdecL_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cOLibraryCallKitXinline_string_compareTo6M_i_; -text: .text%__1cScompL_rReg_memNodeRis_cisc_alternate6kM_i_; text: .text%__1cJAssemblerEsubq6MpnMRegisterImpl_nHAddress__v_; text: .text%jni_GetEnv; text: .text%JVM_NanoTime; -text: .text%__1cCosNjavaTimeNanos6F_x_; -text: .text%__1cZInterpreterMacroAssemblerNsuper_call_VM6MpnMRegisterImpl_2pC22_v_; -text: .text%__1cFTypeFJis_finite6kM_i_; text: .text%__1cRmulI_rReg_immNodeIpipeline6kM_pknIPipeline__; text: .text%__1cOMacroAssemblerRcall_VM_leaf_base6MpCi_v_; -text: .text%__1cScompL_rReg_memNodeJnum_opnds6kM_I_; -text: .text%__1cHMulNodeGis_Mul6kM_pk0_; text: .text%__1cETypeEmake6Fn0AFTYPES__pk0_; text: .text%__1cQmulI_mem_immNodeMideal_Opcode6kM_i_; -text: .text%__1cParrayKlassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cJAssemblerLemit_data646MxnJrelocInfoJrelocType_i_v_; text: .text%__1cJAssemblerFpushq6MnHAddress__v_; -text: .text%__1cIGraphKitSgen_native_wrapper6MpnIciMethod__v_; text: .text%__1cRComputeEntryStackIdo_array6Mii_v_; text: .text%__1cPcmpD_cc_immNodeKconst_size6kM_i_; -text: .text%__1cKLoadPCNodeJideal_reg6kM_I_; text: .text%__1cMorL_rRegNodeErule6kM_I_; -text: .text%__1cUCallNativeDirectNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cScompP_rReg_memNodePoper_input_base6kM_I_; text: .text%__1cScompP_rReg_memNodeMideal_Opcode6kM_i_; -text: .text%__1cSvframeStreamCommonbFfill_in_compiled_inlined_sender6M_i_; text: .text%__1cNdivI_rRegNodeHtwo_adr6kM_I_; -text: .text%__1cKcastPPNodeJnum_opnds6kM_I_; -text: .text%__1cTconvL2D_reg_memNodeHtwo_adr6kM_I_; -text: .text%__1cOLibraryCallKitbNinline_native_Reflection_getCallerClass6M_i_; -text: .text%__1cOLibraryCallKitZinline_native_Class_query6MnMvmIntrinsicsCID__i_; text: .text%__1cMnegF_regNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cHCompile2t6MpnFciEnv_pnKC2Compiler_pnIciMethod__v_; text: .text%__1cKciTypeFlowLStateVectorOdo_null_assert6MpnHciKlass__v_; text: .text%__1cMsubD_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cJLoadLNodeMstore_Opcode6kM_i_; text: .text%__1cNGrowableArray4CpnGciType__Egrow6Mi_v_; -text: .text%__1cMdivD_immNodeJnum_opnds6kM_I_; -text: .text%__1cNstoreImmPNodeJnum_opnds6kM_I_; text: .text%__1cMdivD_immNodeHtwo_adr6kM_I_; -text: .text%__1cLloadSSINodeHtwo_adr6kM_I_; text: .text%__1cLConvI2FNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cIciMethodMnative_entry6M_pC_; text: .text%__1cPcmpD_cc_immNodeFreloc6kM_i_; -text: .text%__1cUCallNativeDirectNodeFreloc6kM_i_; -text: .text%__1cNloadConPcNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMmulD_memNodeErule6kM_I_; text: .text%jni_CallVoidMethod: jni.o; -text: .text%__1cFStateS_sub_Op_CallNative6MpknENode__v_; -text: .text%__1cFStateO_sub_Op_LoadPC6MpknENode__v_; -text: .text%__1cQAbstractCompilerPsupports_native6M_i_; -text: .text%__1cQorI_rReg_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cbCAbstractInterpreterGeneratorbBgenerate_result_handler_for6MnJBasicType__pC_; text: .text%__1cMmulF_regNodeHtwo_adr6kM_I_; -text: .text%__1cPsalL_rReg_1NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cQshrI_rReg_CLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNTemplateTableQvolatile_barrier6FnJAssemblerQMembar_mask_bits__v_; -text: .text%__1cNdivL_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cVMoveL2D_reg_stackNodeErule6kM_I_; text: .text%__1cRsalI_rReg_immNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cNRelocIterator2t6MpnKCodeBuffer_pC3_v_; text: .text%__1cJBasicLockHmove_to6MpnHoopDesc_p0_v_; -text: .text%__1cYinternal_word_RelocationMforce_target6MpC_v_; text: .text%__1cOstackSlotIOperEtype6kM_pknEType__; -text: .text%__1cLloadSSINodeJnum_opnds6kM_I_; text: .text%__1cKPSYoungGenRavailable_to_live6M_L_; text: .text%__1cOstackSlotIOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cNcmovL_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cSstore_to_stackslot6FrnKCodeBuffer_iii_v_; -text: .text%__1cFTypeFGis_nan6kM_i_; text: .text%__1cQshrL_rReg_CLNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cTconvD2F_reg_regNodeJnum_opnds6kM_I_; -text: .text%__1cbCAbstractInterpreterGeneratorZgenerate_safept_entry_for6MnITosState_pC_2_; text: .text%__1cUInterpreterGeneratorbDgenerate_stack_overflow_check6M_v_; text: .text%__1cRComputeEntryStackHdo_bool6M_v_; text: .text%__1cMmulD_immNodeFreloc6kM_i_; text: .text%__1cQmulI_mem_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cbCAbstractInterpreterGeneratorZgenerate_continuation_for6MnITosState__pC_; text: .text%__1cJJavaCallsLcall_static6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnGThread__v_; text: .text%JVM_FindPrimitiveClass; -text: .text%__1cOstackSlotIOperJnum_edges6kM_I_; text: .text%JVM_IsSameClassPackage; -text: .text%__1cUInterpreterGeneratorXcheck_for_compiled_code6MrnFLabel__v_; text: .text%__1cRaddI_mem_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMaddF_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cPjava_lang_ClassYcreate_basic_type_mirror6FpkcpnGThread__pnHoopDesc__; text: .text%__1cLconvI2BNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMaddD_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMlogD_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cOPSVirtualSpaceJshrink_by6ML_i_; -text: .text%__1cTconvD2F_reg_regNodePin_oper_RegMask6kMIII_pknHRegMask__; text: .text%__1cRCardTableModRefBSYcommitted_unique_to_self6kMinJMemRegion__1_; text: .text%__1cNTemplateTableEiop26Fn0AJOperation__v_; text: .text%__1cFStateN_sub_Op_LoadD6MpknENode__v_; text: .text%__1cTconvL2F_reg_regNodeQuse_cisc_RegMask6M_v_; -text: .text%__1cZInterpreterMacroAssemblerRremove_activation6MnITosState_pnMRegisterImpl_iii_v_; text: .text%__1cZInterpreterMacroAssemblerMdispatch_via6MnITosState_ppC_v_; -text: .text%__1cUInterpreterGeneratorbEgenerate_asm_interpreter_entry6Mi_pC_; text: .text%__1cPcmpF_cc_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cMsubF_memNodeJnum_opnds6kM_I_; text: .text%__1cKPSYoungGenUavailable_to_min_gen6M_L_; text: .text%__1cJAssemblerKrepne_scan6M_v_; text: .text%__1cJname2type6Fpkc_nJBasicType__; @@ -6658,7 +4315,6 @@ text: .text%__1cKPSYoungGenQlimit_gen_shrink6ML_L_; text: .text%__1cTconvI2D_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cFStateP_sub_Op_ConvI2F6MpknENode__v_; text: .text%__1cMmulD_immNodeKconst_size6kM_i_; -text: .text%__1cMmulD_memNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cMmulF_immNodeFreloc6kM_i_; text: .text%__1cJloadBNodeHsize_of6kM_I_; text: .text%__1cOcompI_rRegNodeHsize_of6kM_I_; @@ -6667,7 +4323,6 @@ text: .text%__1cJloadPNodeHsize_of6kM_I_; text: .text%__1cOtypeArrayKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_; text: .text%__1cOtypeArrayKlassNexternal_name6FnJBasicType__pkc_; text: .text%Unsafe_StaticFieldOffset; -text: .text%__1cFTypeFFempty6kM_i_; text: .text%__1cNcmovL_regNodeHtwo_adr6kM_I_; text: .text%__1cLloadSSDNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateO_sub_Op_CMoveP6MpknENode__v_; @@ -6677,69 +4332,41 @@ text: .text%__1cVVM_ParallelGCSystemGC2t6MIInHGCCauseFCause__v_; text: .text%__1cJCmpF3NodeGOpcode6kM_i_; text: .text%Unsafe_GetObjectVolatile; text: .text%__1cMsubD_immNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cLdivL_10NodePoper_input_base6kM_I_; -text: .text%__1cVVM_ParallelGCSystemGCEname6kM_pkc_; -text: .text%__1cOtypeArrayKlassMcreate_klass6FnJBasicType_ipnGThread__pnMklassOopDesc__; text: .text%Unsafe_EnsureClassInitialized; -text: .text%__1cJAssemblerEjmpb6MrnFLabel_nJrelocInfoJrelocType__v_; text: .text%__1cQSystemDictionaryPresolve_or_null6FnMsymbolHandle_pnGThread__pnMklassOopDesc__; text: .text%__1cOcmovI_regUNodeHtwo_adr6kM_I_; text: .text%__1cMaddD_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cJAssemblerEmovw6MnHAddress_pnMRegisterImpl__v_; text: .text%__1cJAssemblerGmovsbl6MpnMRegisterImpl_nHAddress__v_; -text: .text%__1cMrax_RegLOperFclone6kM_pnIMachOper__; text: .text%__1cMorL_rRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cTconvD2F_reg_regNodeHtwo_adr6kM_I_; text: .text%__1cUParallelScavengeHeapHcollect6MnHGCCauseFCause__v_; text: .text%__1cJLoadDNodeJideal_reg6kM_I_; text: .text%__1cQciTypeArrayKlass2t6MnLKlassHandle__v_; text: .text%__1cQmulI_mem_immNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cOMacroAssemblerMcall_VM_leaf6MpCi_v_; text: .text%__1cPcheckCastPPNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cJAssemblerFpopaq6M_v_; text: .text%__1cSmembar_acquireNodeIpipeline6kM_pknIPipeline__; text: .text%__1cKimmL10OperJnum_edges6kM_I_; text: .text%Unsafe_StaticFieldBaseFromField; -text: .text%__1cLcastP2LNodeHsize_of6kM_I_; -text: .text%__1cQmulI_mem_immNodeRis_cisc_alternate6kM_i_; text: .text%__1cMsubD_regNodeHtwo_adr6kM_I_; -text: .text%__1cZInterpreterMacroAssemblerSnotify_method_exit6MnITosState__v_; text: .text%__1cRsubI_rReg_memNodeHsize_of6kM_I_; -text: .text%__1cTconvL2F_reg_regNodeHtwo_adr6kM_I_; -text: .text%__1cNReservedSpace2t6MpcL_v_; -text: .text%__1cKmul_hiNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cSmembar_acquireNodeJnum_opnds6kM_I_; -text: .text%__1cQsarL_rReg_63NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJAssemblerMemit_arith_b6MiipnMRegisterImpl_i_v_; -text: .text%__1cPsarL_rReg_2NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cLdivL_10NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cNTemplateTableXresolve_cache_and_index6FipnMRegisterImpl_2_v_; text: .text%__1cNTemplateTableZjvmti_post_fast_field_mod6F_v_; text: .text%JVM_GC; text: .text%__1cNTemplateTablePfast_storefield6FnITosState__v_; text: .text%__1cNTemplateTableQfast_accessfield6FnITosState__v_; -text: .text%__1cScompP_rReg_memNodeJnum_opnds6kM_I_; -text: .text%__1cIPSOldGenSexpand_to_reserved6M_i_; -text: .text%__1cQmulI_mem_immNodeJnum_opnds6kM_I_; -text: .text%__1cIPSOldGenJexpand_by6ML_i_; text: .text%__1cIPSOldGenGexpand6ML_v_; text: .text%__1cIPSOldGenXexpand_and_cas_allocate6ML_pnIHeapWord__; text: .text%__1cPsarL_rReg_1NodeHtwo_adr6kM_I_; text: .text%__1cJAssemblerFtestb6MpnMRegisterImpl_i_v_; -text: .text%__1cXpartialSubtypeCheckNodeHtwo_adr6kM_I_; text: .text%__1cMsubF_regNodeHtwo_adr6kM_I_; -text: .text%__1cZInterpreterMacroAssemblerRget_constant_pool6MpnMRegisterImpl__v_; text: .text%__1cRaddL_rReg_memNodeFreloc6kM_i_; text: .text%__1cVMoveL2D_reg_stackNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cScompP_rReg_memNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cPsarL_rReg_1NodeJnum_opnds6kM_I_; text: .text%__1cOGenerateOopMapGdo_jsr6Mi_v_; text: .text%__1cMmulF_memNodeHtwo_adr6kM_I_; -text: .text%__1cScompP_rReg_memNodeRis_cisc_alternate6kM_i_; -text: .text%__1cLPSMarkSweepGinvoke6Fpii_v_; text: .text%__1cOcmovD_regUNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNcmovL_memNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cTconvF2I_reg_regNodeHtwo_adr6kM_I_; text: .text%__1cMmulF_immNodeKconst_size6kM_i_; text: .text%__1cZInterpreterMacroAssemblerbGget_unsigned_2_byte_index_at_bcp6MpnMRegisterImpl_i_v_; text: .text%__1cZInterpreterMacroAssemblerRcall_VM_leaf_base6MpCi_v_; @@ -6748,44 +4375,28 @@ text: .text%__1cMdecI_memNodeIpipeline6kM_pknIPipeline__; text: .text%__1cCosMuser_handler6F_pv_; text: .text%__1cJloadDNodeFreloc6kM_i_; text: .text%__1cMincL_memNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cNaddL_rRegNodeMcisc_version6Mi_pnIMachNode__; -text: .text%__1cCosHSolarisSset_signal_handler6Fiii_v_; text: .text%__1cNinstanceKlassSremove_osr_nmethod6MpnHnmethod__v_; text: .text%__1cTconvD2F_reg_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cKMemoryPoolLadd_manager6MpnNMemoryManager__v_; text: .text%__1cMmulD_memNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cLClassLoaderbCupdate_class_path_entry_list6Fpkc_v_; text: .text%__1cMsubF_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cOcmovI_regUNodeQuse_cisc_RegMask6M_v_; -text: .text%__1cTconvL2D_reg_memNodeRis_cisc_alternate6kM_i_; -text: .text%__1cLOptoRuntimeRresolve_call_Type6F_pknITypeFunc__; -text: .text%__1cHciKlassIis_klass6M_i_; text: .text%__1cPPerfDataManagerKname_space6Fpkci_pc_; -text: .text%__1cKScopeValuePis_constant_int6kM_i_; text: .text%jni_RegisterNatives: jni.o; text: .text%Unsafe_GetNativeFloat; -text: .text%__1cMsubF_memNodeZcheck_for_anti_dependence6kM_i_; text: .text%JVM_GetClassDeclaredFields; text: .text%__1cMsubF_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cJMemRegion2t6M_v_; text: .text%jni_SetStaticObjectField: jni.o; -text: .text%__1cQsalL_rReg_CLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cCosEstat6FpkcpnEstat__i_; -text: .text%__1cJArgumentsRverify_percentage6FLpkc_i_; text: .text%__1cLOptoRuntimeTmultianewarray_Type6Fi_pknITypeFunc__; text: .text%__1cRComputeEntryStackHdo_long6M_v_; text: .text%__1cHnmethodVinvalidate_osr_method6M_v_; -text: .text%__1cMaddF_memNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cNMemoryManagerIadd_pool6MpnKMemoryPool__v_; text: .text%jni_SetObjectField: jni.o; -text: .text%__1cLConvD2INodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cJAssemblerEcall6MpnMRegisterImpl_nJrelocInfoJrelocType__v_; text: .text%__1cJloadDNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cLConvD2INodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cOBasicHashtable2t6Mii_v_; -text: .text%__1cCosHSolarisOis_sig_ignored6Fi_i_; -text: .text%__1cNandI_rRegNodeMcisc_version6Mi_pnIMachNode__; -text: .text%__1cNcmovL_memNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cOPhaseIdealLoopJclone_iff6MpnHPhiNode_pnNIdealLoopTree__pnIBoolNode__; text: .text%__1cMTailJumpNodeGOpcode6kM_i_; text: .text%__1cCosHSolarisVcleanup_interruptible6FpnKJavaThread__v_; @@ -6795,7 +4406,6 @@ text: .text%__1cMdivD_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%JVM_IsSupportedJNIVersion; text: .text%JVM_LoadLibrary; text: .text%JVM_Sleep; -text: .text%__1cNReservedSpaceKinitialize6MLLipc_v_; text: .text%__1cHOrLNodeLbottom_type6kM_pknEType__; text: .text%__1cOstackSlotIOperFscale6kM_i_; text: .text%__1cLConvD2FNodeLbottom_type6kM_pknEType__; @@ -6804,7 +4414,6 @@ text: .text%jint_cmp: parse2.o; text: .text%__1cOstackSlotIOperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cLloadSSINodeErule6kM_I_; text: .text%__1cLConvI2DNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cVMoveF2I_reg_stackNodePoper_input_base6kM_I_; text: .text%__1cLConvL2FNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cIDivDNodeJideal_reg6kM_I_; text: .text%__1cRandI_rReg_memNodeFreloc6kM_i_; @@ -6814,7 +4423,6 @@ text: .text%__1cPPerfLongVariant2t6MnJCounterNS_pkcnIPerfDataFUnits_n0CLVariabil text: .text%jni_MonitorExit: jni.o; text: .text%jni_MonitorEnter: jni.o; text: .text%__1cHciKlass2t6MnLKlassHandle_pnIciSymbol__v_; -text: .text%__1cPciInstanceKlassbDcompute_shared_is_initialized6M_i_; text: .text%__1cNGrowableArray4CpnIPerfData__Praw_at_put_grow6Mirk14_v_; text: .text%__1cFciEnvOrecord_failure6Mpkc_v_; text: .text%__1cMciArrayKlassRbase_element_type6M_pnGciType__; @@ -6822,14 +4430,11 @@ text: .text%__1cLConvL2DNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cOstackSlotDOperFscale6kM_i_; text: .text%__1cOstackSlotDOperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_; text: .text%__1cOcmovI_regUNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cKReturnNodeUdepends_only_on_test6kM_i_; text: .text%__1cNcmovL_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cTconvD2F_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIDivDNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cTconvF2I_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cTconvL2F_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cMsubD_immNodeJnum_opnds6kM_I_; -text: .text%__1cVMoveL2D_reg_stackNodeJnum_opnds6kM_I_; text: .text%__1cRaddI_mem_rRegNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cNTemplateTableH_return6FnITosState__v_; text: .text%__1cNTemplateTableHif_icmp6Fn0AJCondition__v_; @@ -6838,16 +4443,10 @@ text: .text%__1cTconvL2D_reg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cXpartialSubtypeCheckNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNSharedRuntimeEdrem6Fdd_d_; text: .text%__1cRaddI_rReg_immNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cMloadConDNodeFclone6kM_pnENode__; text: .text%__1cScompP_rReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cKC2IAdapterXreturn_from_interpreter6M_pC_; -text: .text%__1cKC2IAdapterRsetup_stack_frame6MnFframe_pnLvframeArray__v_; -text: .text%__1cIregDOperFclone6kM_pnIMachOper__; text: .text%__1cJAssemblerGmovswl6MpnMRegisterImpl_nHAddress__v_; text: .text%__1cMsubF_memNodeErule6kM_I_; -text: .text%__1cIimmDOperFclone6kM_pnIMachOper__; text: .text%__1cOMacroAssemblerQload_signed_byte6MpnMRegisterImpl_nHAddress__i_; -text: .text%__1cKC2IAdapterSunpack_c2i_adapter6MnFframe_1pnLvframeArray__v_; text: .text%__1cNdivI_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cRMachSpillCopyNodeHsize_of6kM_I_; text: .text%__1cFframebFset_interpreter_frame_sender_sp6Mpl_v_; @@ -6861,26 +4460,15 @@ text: .text%__1cMsubD_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMmulF_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMmulF_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cCosZvm_allocation_granularity6F_i_; -text: .text%__1cJAssemblerFpopfq6M_v_; -text: .text%__1cCosOreserve_memory6FLpc_1_; text: .text%Unsafe_ObjectFieldOffset; -text: .text%__1cUParallelScavengeHeapEkind6M_nNCollectedHeapEName__; -text: .text%__1cKMemoryPool2t6Mpkcn0AIPoolType_LLii_v_; text: .text%__1cNSpaceCounters2t6MpkciLpnMMutableSpace_pnSGenerationCounters__v_; text: .text%__1cMNativeLookupTbase_library_lookup6Fpkc22_pC_; -text: .text%__1cMaddF_memNodeRis_cisc_alternate6kM_i_; text: .text%__1cOcompiledVFrameUresolve_monitor_lock6kMnILocation__pnJBasicLock__; -text: .text%__1cTconvD2I_reg_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cQjava_lang_ThreadKset_daemon6FpnHoopDesc__v_; text: .text%__1cKCompiledICSset_to_megamorphic6MpnICallInfo_nJBytecodesECode_pnGThread__v_; -text: .text%__1cNReservedSpaceKfirst_part6MLii_0_; text: .text%__1cNCellTypeStateImake_any6Fi_0_; text: .text%__1cMorL_rRegNodeQuse_cisc_RegMask6M_v_; text: .text%__1cNTemplateTableFaload6Fi_v_; -text: .text%__1cISubFNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cMnegF_regNodeJnum_opnds6kM_I_; -text: .text%__1cINegDNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cKCompiledICOis_megamorphic6kM_i_; text: .text%__1cXNativeSignatureIteratorJdo_double6M_v_; text: .text%__1cISubDNodeGadd_id6kM_pknEType__; text: .text%__1cSInterpreterRuntimeZSignatureHandlerGeneratorLpass_double6M_v_; @@ -6893,47 +4481,30 @@ text: .text%__1cLMoveL2DNodeLbottom_type6kM_pknEType__; text: .text%__1cZCompiledArgumentOopFinderDset6MinJBasicType__v_; text: .text%__1cNstoreImmPNodeFreloc6kM_i_; text: .text%__1cNSharedRuntimeVhandle_ic_miss_helper6FpnKJavaThread_pnGThread__nMmethodHandle__; -text: .text%__1cLOptoRuntimebBhandle_wrong_method_ic_miss6FpnKJavaThread__pC_; text: .text%__1cKJavaThreadUremove_monitor_chunk6MpnMMonitorChunk__v_; text: .text%__1cKJavaThreadRadd_monitor_chunk6MpnMMonitorChunk__v_; text: .text%__1cNReservedSpace2t6ML_v_; text: .text%__1cPPerfDataManagerUcreate_long_variable6FnJCounterNS_pkcnIPerfDataFUnits_pnUPerfLongSampleHelper_pnGThread__pnQPerfLongVariable__; -text: .text%__1cNmulL_rRegNodeMcisc_version6Mi_pnIMachNode__; -text: .text%__1cNmulI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cTGeneratePairingInfoOreport_results6kM_i_; text: .text%Unsafe_GetNativeByte; text: .text%__1cbEJvmtiDynamicCodeEventCollector2T6M_v_; text: .text%__1cFframebLprevious_monitor_in_interpreter_frame6kMpnPBasicObjectLock__2_; text: .text%__1cbEJvmtiDynamicCodeEventCollector2t6M_v_; -text: .text%__1cOMacroAssemblerQload_signed_word6MpnMRegisterImpl_nHAddress__i_; -text: .text%__1cQOopMapCacheEntryPfill_for_native6M_v_; text: .text%__1cFStateP_sub_Op_ConvD2I6MpknENode__v_; -text: .text%__1cJAssemblerGpushfq6M_v_; text: .text%__1cKVtableStubRpd_code_alignment6F_i_; text: .text%__1cJAssemblerDorl6MpnMRegisterImpl_2_v_; -text: .text%__1cIDivFNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cINegDNodeJideal_reg6kM_I_; -text: .text%__1cODeoptimizationZtrap_state_set_recompiled6Fii_i_; -text: .text%__1cPshrL_rReg_1NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cTconvF2D_reg_memNodeIpipeline6kM_pknIPipeline__; text: .text%__1cKklassKlassOset_alloc_size6MI_v_; text: .text%__1cNandI_rRegNodeIpipeline6kM_pknIPipeline__; text: .text%__1cTMaskFillerForNative2t6MnMmethodHandle_pLi_v_; text: .text%__1cMsubF_memNodeHtwo_adr6kM_I_; text: .text%__1cINegFNodeLbottom_type6kM_pknEType__; -text: .text%__1cRaddL_rReg_memNodeZcheck_for_anti_dependence6kM_i_; -text: .text%__1cLVtableStubsLcreate_stub6FiipnNmethodOopDesc__pC_; text: .text%__1cMmulL_memNodeFreloc6kM_i_; -text: .text%__1cLVtableStubsGlookup6Fiii_pnKVtableStub__; text: .text%__1cMMonitorValue2t6MpnTDebugInfoReadStream__v_; text: .text%__1cFStateM_sub_Op_NegD6MpknENode__v_; text: .text%__1cOtailjmpIndNodePoper_input_base6kM_I_; -text: .text%__1cNStubGeneratorYgenerate_throw_exception6MpkcpCi_3_; -text: .text%__1cISubDNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cPPerfDataManagerKname_space6Fpkc2i_pc_; -text: .text%__1cLVtableStubsOis_entry_point6FpC_i_; text: .text%__1cNstoreImmPNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cHRetNodeJnum_opnds6kM_I_; text: .text%__1cIDivINodeJideal_reg6kM_I_; text: .text%__1cRInvocationCounterDdef6Fn0AFState_ipFnMmethodHandle_pnGThread__pC_v_; text: .text%__1cMNativeLookupNlong_jni_name6FnMmethodHandle__pc_; @@ -6944,7 +4515,6 @@ text: .text%__1cOGenerateOopMapTret_jump_targets_do6MpnOBytecodeStream_pFp0ipi_v text: .text%__1cOClassPathEntry2t6M_v_; text: .text%__1cMorL_rRegNodeHtwo_adr6kM_I_; text: .text%__1cOMacroAssemblerNpop_CPU_state6M_v_; -text: .text%__1cMmulF_memNodeRis_cisc_alternate6kM_i_; text: .text%__1cOMacroAssemblerOpush_CPU_state6M_v_; text: .text%__1cOMacroAssemblerNpop_FPU_state6M_v_; text: .text%__1cOMacroAssemblerOpush_FPU_state6M_v_; @@ -6955,8 +4525,6 @@ text: .text%__1cTconvL2D_reg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cOMacroAssemblerSstore_check_part_16MpnMRegisterImpl__v_; text: .text%__1cRaddL_rReg_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMaddF_memNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cRClassPathZipEntry2t6Mppvpc_v_; -text: .text%__1cNTemplateTableOprepare_invoke6FpnMRegisterImpl_2inJBytecodesECode__v_; text: .text%__1cVMoveF2I_reg_stackNodeErule6kM_I_; text: .text%__1cJAssemblerEandq6MpnMRegisterImpl_2_v_; text: .text%__1cFParsePdo_lookupswitch6M_v_; @@ -6967,19 +4535,11 @@ text: .text%__1cJloadFNodeIpipeline6kM_pknIPipeline__; text: .text%__1cRComputeEntryStackJdo_double6M_v_; text: .text%__1cMaddD_regNodeHtwo_adr6kM_I_; text: .text%__1cLConvD2FNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cNTemplateTablebAload_invoke_cp_cache_entry6FipnMRegisterImpl_22ii_v_; -text: .text%__1cNTemplateTableZload_field_cp_cache_entry6FipnMRegisterImpl_22i_v_; text: .text%__1cJAssemblerEcmpb6MnHAddress_i_v_; text: .text%__1cCosGsignal6Fipv_1_; -text: .text%__1cLClassLoaderSget_canonical_path6Fpc1i_i_; -text: .text%__1cLClassLoaderXcreate_class_path_entry6FpcnEstat_ppnOClassPathEntry__v_; text: .text%__1cMsubD_immNodeHtwo_adr6kM_I_; -text: .text%__1cLklassVtableTis_miranda_entry_at6Mi_i_; text: .text%__1cKPSScavengeZclean_up_failed_promotion6F_v_; -text: .text%__1cNTemplateTableJfloat_cmp6Fii_v_; text: .text%JVM_Available; -text: .text%__1cJAssemblerHucomiss6MpnRFloatRegisterImpl_2_v_; -text: .text%__1cZInterpreterMacroAssemblerRprofile_checkcast6MipnMRegisterImpl__v_; text: .text%__1cIAddDNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cJAssemblerFimulq6MpnMRegisterImpl_2_v_; text: .text%__1cIRetTableUfind_jsrs_for_target6Mi_pnNRetTableEntry__; @@ -6992,73 +4552,44 @@ text: .text%__1cNTemplateTableGlstore6Fi_v_; text: .text%__1cNRegisterSaverTsave_live_registers6FpnOMacroAssembler_ipi_pnGOopMap__; text: .text%__1cNTemplateTableGistore6Fi_v_; text: .text%__1cIRetTableHadd_jsr6Mii_v_; -text: .text%__1cMincL_memNodeHtwo_adr6kM_I_; text: .text%__1cKPSYoungGenOobject_iterate6MpnNObjectClosure__v_; -text: .text%__1cNGrowableArray4CpnLmarkOopDesc__2t6Mii_v_; -text: .text%__1cUCompressedReadStreamJread_long6M_x_; text: .text%__1cISubDNodeJideal_reg6kM_I_; -text: .text%__1cWNonPrintingResourceObj2n6FLnLResourceObjPallocation_type__pv_; text: .text%__1cNTemplateTableFdload6Fi_v_; text: .text%__1cNTemplateTableFfload6Fi_v_; -text: .text%__1cPaddress_of_flag6FnXCommandLineFlagWithType__pnEFlag__: globals.o; text: .text%__1cNTemplateTableFlload6Fi_v_; text: .text%__1cNTemplateTableFiload6Fi_v_; text: .text%__1cMmulI_memNodePoper_input_base6kM_I_; -text: .text%__1cOcompL_rRegNodeMcisc_version6Mi_pnIMachNode__; text: .text%__1cNGrowableArray4CpnLmarkOopDesc__Uclear_and_deallocate6M_v_; text: .text%__1cMLinkResolverbBlookup_method_in_interfaces6FrnMmethodHandle_nLKlassHandle_nMsymbolHandle_4pnGThread__v_; -text: .text%__1cOcompI_rRegNodeFclone6kM_pnENode__; -text: .text%__1cRsubI_rReg_memNodeFclone6kM_pnENode__; -text: .text%__1cLcastP2LNodeFclone6kM_pnENode__; text: .text%__1cKExceptionsK_throw_oop6FpnGThread_pkcipnHoopDesc__v_; text: .text%__1cRaddL_rReg_memNodeErule6kM_I_; text: .text%__1cOMacroAssemblerLstore_check6MpnMRegisterImpl__v_; -text: .text%__1cOsalI_mem_1NodeHtwo_adr6kM_I_; text: .text%__1cHRetNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cVMoveL2D_reg_stackNodeHtwo_adr6kM_I_; -text: .text%__1cRaddL_mem_rRegNodeHtwo_adr6kM_I_; -text: .text%__1cJloadPNodeFclone6kM_pnENode__; -text: .text%__1cJloadBNodeFclone6kM_pnENode__; text: .text%__1cRaddL_rReg_memNodeHtwo_adr6kM_I_; text: .text%__1cMmulF_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cMaddF_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cJAssemblerEmovb6MnHAddress_i_v_; -text: .text%__1cIAddDNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%Unsafe_AllocateMemory; text: .text%__1cVMoveF2I_reg_stackNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cJAssemblerHfxrstor6MnHAddress__v_; text: .text%__1cJAssemblerGfxsave6MnHAddress__v_; -text: .text%__1cHCompilePget_invoke_name6M_pnIciSymbol__; text: .text%__1cJAssemblerEsetb6Mn0AJCondition_pnMRegisterImpl__v_; -text: .text%__1cNxorI_rRegNodeMcisc_version6Mi_pnIMachNode__; -text: .text%__1cMVM_OperationNdoit_prologue6M_i_; text: .text%__1cNGCTaskManagerGthread6MI_pnMGCTaskThread__; text: .text%__1cRConstantLongValue2t6MpnTDebugInfoReadStream__v_; -text: .text%__1cRConstantLongValueQis_constant_long6kM_i_; -text: .text%__1cKScopeValuePis_constant_oop6kM_i_; -text: .text%__1cKScopeValueSis_constant_double6kM_i_; text: .text%__1cMmulD_memNodeHtwo_adr6kM_I_; -text: .text%__1cVMoveF2I_reg_stackNodeHtwo_adr6kM_I_; text: .text%jni_CallStaticObjectMethod: jni.o; text: .text%__1cNcmovL_memNodeHtwo_adr6kM_I_; text: .text%__1cFStateM_sub_Op_AddD6MpknENode__v_; text: .text%__1cMmulI_memNodeMideal_Opcode6kM_i_; text: .text%__1cScompL_rReg_memNodeFreloc6kM_i_; text: .text%__1cLloadSSINodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNGrowableArray4CpnIPerfData__2t6Mii_v_; -text: .text%__1cOCompilerThreadSis_Compiler_thread6kM_i_; text: .text%__1cTjava_lang_ThrowableLset_message6FpnHoopDesc_2_v_; text: .text%__1cMPerfDataList2T6M_v_; -text: .text%__1cLVtableStubsFenter6FiiipnKVtableStub__v_; text: .text%__1cMmulI_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cOcmovD_regUNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNCompileBrokerUmake_compiler_thread6FpkcpnMCompileQdDueue_pnQCompilerCounters_pnGThread__pnOCompilerThread__; text: .text%__1cNnegI_rRegNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cbCAbstractInterpreterGeneratorbHgenerate_exception_handler_common6Mpkc2i_pC_; -text: .text%__1cSCommandLineFlagsExKis_default6FnPCommandLineFlag__i_; text: .text%__1cJAssemblerEnegl6MpnMRegisterImpl__v_; -text: .text%__1cUConstantOopReadValuePis_constant_oop6kM_i_; -text: .text%__1cHMatcherNlogDSupported6F_ki_; text: .text%__1cOGenerateOopMapRdo_multianewarray6Mii_v_; text: .text%__1cLconvI2BNodeIpipeline6kM_pknIPipeline__; text: .text%__1cUPSGenerationCounters2t6MpkciipnOPSVirtualSpace__v_; @@ -7066,86 +4597,59 @@ text: .text%__1cMPerfDataList2t6Mi_v_; text: .text%__1cFStateP_sub_Op_ConvI2D6MpknENode__v_; text: .text%__1cQCompilerCounters2t6MpkcipnGThread__v_; text: .text%__1cJCodeCachebCmake_marked_nmethods_zombies6F_v_; -text: .text%__1cNVM_DeoptimizeEname6kM_pkc_; text: .text%__1cNTemplateTableHcall_VM6FpnMRegisterImpl_pC2_v_; text: .text%__1cHThreadsbFdeoptimized_wrt_marked_nmethods6F_v_; -text: .text%__1cSCommandLineFlagsExJboolAtPut6FnXCommandLineFlagWithType_i_v_; -text: .text%__1cMmulI_memNodeJnum_opnds6kM_I_; text: .text%__1cFStateM_sub_Op_CmpF6MpknENode__v_; text: .text%__1cODeoptimizationVdeoptimize_dependents6F_i_; -text: .text%__1cOtailjmpIndNodeGpinned6kM_i_; -text: .text%__1cQshrL_rReg_CLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJAssemblerGmovzbl6MpnMRegisterImpl_2_v_; text: .text%__1cILogDNodeJideal_reg6kM_I_; -text: .text%__1cMmulI_memNodeRis_cisc_alternate6kM_i_; text: .text%__1cRaddL_mem_rRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMincL_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cFStateO_sub_Op_Conv2B6MpknENode__v_; text: .text%__1cNcmovL_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%jni_CallStaticObjectMethodV: jni.o; -text: .text%__1cMOopTaskQdDueueKinitialize6M_v_; text: .text%__1cMmulD_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cMOopTaskQdDueue2t6M_v_; -text: .text%__1cOLibraryCallKitbBinline_native_currentThread6M_i_; text: .text%__1cNMemoryManager2t6M_v_; text: .text%__1cMaddF_immNodeKconst_size6kM_i_; text: .text%__1cVMoveL2D_reg_stackNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cOLibraryCallKitSinline_math_native6MnMvmIntrinsicsCID__i_; text: .text%__1cFciEnvbNArrayIndexOutOfBoundsException_instance6M_pnKciInstance__; text: .text%__1cMsubD_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMmulI_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMaddF_immNodeFreloc6kM_i_; text: .text%__1cMaddD_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cOCompilerThreadbCis_hidden_from_external_view6kM_i_; -text: .text%__1cNReservedSpaceJlast_part6ML_0_; text: .text%__1cMnegF_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMaddD_immNodeFreloc6kM_i_; text: .text%jni_IsInstanceOf: jni.o; text: .text%__1cMaddD_immNodeKconst_size6kM_i_; text: .text%jni_Throw: jni.o; -text: .text%__1cRmulI_rReg_immNodeMcisc_version6Mi_pnIMachNode__; text: .text%__1cOsalI_mem_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cSPSPromotionManager2t6M_v_; -text: .text%__1cFKlassUoop_is_objArrayKlass6kM_i_; text: .text%__1cOMacroAssemblerLstore_check6MpnMRegisterImpl_nHAddress__v_; text: .text%__1cOLibraryCallKitXgenerate_current_thread6MrpnENode__2_; text: .text%__1cMsubF_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cJAssemblerFmovss6MpnRFloatRegisterImpl_2_v_; text: .text%JVM_GetLastErrorString; -text: .text%__1cJAssemblerFmovsd6MpnRFloatRegisterImpl_2_v_; text: .text%__1cZInterpreterMacroAssemblerTprofile_switch_case6MpnMRegisterImpl_22_v_; text: .text%__1cZInterpreterMacroAssemblerWprofile_switch_default6MpnMRegisterImpl__v_; text: .text%__1cFStateM_sub_Op_SubF6MpknENode__v_; -text: .text%__1cLVtableStubsScreate_vtable_stub6Fii_pnKVtableStub__; text: .text%JVM_GetInterfaceVersion; text: .text%__1cKstoreBNodeErule6kM_I_; text: .text%__1cKVtableStub2n6FLi_pv_; text: .text%__1cJAssemblerEdecq6MpnMRegisterImpl__v_; -text: .text%__1cZInterpreterMacroAssemblerUprofile_virtual_call6MpnMRegisterImpl_22_v_; text: .text%__1cOtailjmpIndNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cCosFyield6F_v_; -text: .text%__1cRaddI_mem_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOPSVirtualSpace2t6MnNReservedSpace_L_v_; -text: .text%__1cOLibraryCallKitMinline_trans6MnMvmIntrinsicsCID__i_; text: .text%Unsafe_SetMemory; text: .text%__1cCosIjvm_path6Fpci_v_; text: .text%__1cJTimeStamp2t6M_v_; text: .text%__1cZInterpreterMacroAssemblerUupdate_mdp_by_offset6MpnMRegisterImpl_2i_v_; -text: .text%__1cLconvI2BNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cSInterpreterRuntimeZSignatureHandlerGeneratorKpass_float6M_v_; text: .text%__1cISubFNodeJideal_reg6kM_I_; text: .text%__1cNGrowableArray4CpnIPerfData__Egrow6Mi_v_; text: .text%__1cMSysClassPathNreset_item_at6Mi_v_; text: .text%__1cFStateM_sub_Op_LogD6MpknENode__v_; -text: .text%__1cFTypeDFempty6kM_i_; -text: .text%__1cZInterpreterMacroAssemblerVincrement_mdp_data_at6MpnMRegisterImpl_2i_v_; -text: .text%__1cJlookupOne6FpnHJNIEnv__pkcpnGThread__pnH_jclass__: jni.o; text: .text%__1cLloadSSINodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cCosGgetenv6Fpkcpci_i_; text: .text%__1cZInterpreterMacroAssemblerLlock_object6MpnMRegisterImpl__v_; -text: .text%__1cOtypeArrayKlassQarray_klass_impl6MipnGThread__pnMklassOopDesc__; text: .text%__1cISubFNodeGadd_id6kM_pknEType__; -text: .text%__1cJArgumentsMbuild_string6Fppcpkc_v_; text: .text%__1cFStateM_sub_Op_SubD6MpknENode__v_; text: .text%JVM_RegisterSignal; text: .text%JVM_FindSignal; @@ -7156,12 +4660,10 @@ text: .text%__1cKConv2BNodeJideal_reg6kM_I_; text: .text%__1cXNativeSignatureIteratorIdo_float6M_v_; text: .text%jni_GetDoubleArrayRegion: jni.o; text: .text%__1cLloadSSDNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cVMoveF2I_reg_stackNodeJnum_opnds6kM_I_; text: .text%__1cJArgumentsObuild_jvm_args6Fpkc_v_; text: .text%__1cOLibraryCallKitMpop_math_arg6M_pnENode__; text: .text%__1cZInterpreterMacroAssemblerRgen_subtype_check6MpnMRegisterImpl_rnFLabel__v_; text: .text%__1cFStateO_sub_Op_CMoveL6MpknENode__v_; -text: .text%__1cJArgumentsMadd_property6Fpkc_i_; text: .text%__1cMVM_OperationNdoit_epilogue6M_v_; text: .text%__1cOCompilerThread2t6MpnMCompileQdDueue_pnQCompilerCounters__v_; text: .text%__1cRaddI_mem_rRegNodeFreloc6kM_i_; @@ -7169,7 +4671,6 @@ text: .text%__1cSInterpreterRuntimebKthrow_ArrayIndexOutOfBoundsException6FpnKJa text: .text%__1cVMoveF2I_reg_stackNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNTemplateTableGfconst6Fi_v_; text: .text%__1cNCompileBrokerUcompiler_thread_loop6F_v_; -text: .text%__1cOtailjmpIndNodeHtwo_adr6kM_I_; text: .text%__1cQmulI_mem_immNodeFreloc6kM_i_; text: .text%__1cNincI_rRegNodeIpipeline6kM_pknIPipeline__; text: .text%__1cNVM_DeoptimizeEdoit6M_v_; @@ -7177,104 +4678,64 @@ text: .text%__1cLMoveF2INodeLbottom_type6kM_pknEType__; text: .text%__1cUConstantOopReadValue2t6MpnTDebugInfoReadStream__v_; text: .text%__1cRaddI_mem_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMdivD_immNodeKconst_size6kM_i_; -text: .text%__1cMmulD_memNodeRis_cisc_alternate6kM_i_; text: .text%__1cQObjectStartArrayKinitialize6MnJMemRegion__v_; text: .text%__1cQObjectStartArraySset_covered_region6MnJMemRegion__v_; -text: .text%__1cMsubF_memNodeRis_cisc_alternate6kM_i_; text: .text%__1cUGcThreadCountClosureJdo_thread6MpnGThread__v_; text: .text%__1cNGrowableArray4CpnTDerivedPointerEntry__Egrow6Mi_v_; -text: .text%__1cOtailjmpIndNodeJnum_opnds6kM_I_; text: .text%__1cPGCMemoryManagerXinitialize_gc_stat_info6M_v_; text: .text%__1cPGCMemoryManager2t6M_v_; text: .text%__1cKGCStatInfo2t6Mi_v_; text: .text%__1cTMaskFillerForNativeLpass_object6M_v_; text: .text%__1cTMaskFillerForNativeJpass_long6M_v_; -text: .text%__1cJMarkSweepUAdjustPointerClosure2t6Mi_v_; text: .text%__1cCosHrealloc6FpvL_1_; text: .text%__1cCosWactive_processor_count6F_i_; -text: .text%__1cSestimate_path_freq6FpnENode__f_: loopnode.o; text: .text%__1cCosNsigexitnum_pd6F_i_; text: .text%__1cMLinkResolverbEvtable_index_of_miranda_method6FnLKlassHandle_nMsymbolHandle_2pnGThread__i_; -text: .text%__1cOLibraryCallKitVinline_fp_conversions6MnMvmIntrinsicsCID__i_; -text: .text%__1cZcatch_cleanup_intra_block6FpnENode_1pnFBlock_ii_v_: lcm.o; -text: .text%__1cCosbCis_thread_cpu_time_supported6F_i_; text: .text%__1cLklassVtableQindex_of_miranda6MpnNsymbolOopDesc_2_i_; -text: .text%__1cNdefaultStreamMhas_log_file6M_i_; -text: .text%__1cNcmovL_memNodeRis_cisc_alternate6kM_i_; -text: .text%__1cRalign_object_size6Fl_l_; -text: .text%__1cMarrayOopDescLheader_size6FnJBasicType__i_; text: .text%__1cNstoreImmBNodeErule6kM_I_; text: .text%__1cNstoreImmINodeErule6kM_I_; -text: .text%__1cLloadSSDNodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cFParseMjump_if_join6MpnENode_2_2_; text: .text%__1cKJNIHandlesQmake_weak_global6FnGHandle__pnI_jobject__; -text: .text%__1cLloadSSINodeZcheck_for_anti_dependence6kM_i_; text: .text%__1cQJNI_FastGetFieldbEgenerate_fast_get_float_field06FnJBasicType__pC_; text: .text%__1cFParseRdo_multianewarray6M_v_; -text: .text%__1cMloadConDNodeGis_Con6kM_I_; text: .text%jni_NewWeakGlobalRef: jni.o; -text: .text%__1cPfilename_to_pid6Fpkc_i_: perfMemory_solaris.o; -text: .text%__1cTis_directory_secure6Fpkc_i_: perfMemory_solaris.o; text: .text%jni_CallStaticVoidMethodV: jni.o; text: .text%jni_CallStaticBooleanMethod: jni.o; text: .text%__1cNGrowableArray4CpnNmethodOopDesc__Egrow6Mi_v_; -text: .text%__1cRInvocationCounterMreinitialize6Fi_v_; -text: .text%__1cXpartialSubtypeCheckNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cTconvF2I_reg_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cUInterpreterGeneratorVgenerate_native_entry6Mi_pC_; text: .text%__1cUInterpreterGeneratorLlock_method6M_v_; text: .text%__1cNGrowableArray4CpC_Egrow6Mi_v_; text: .text%__1cNGrowableArray4CL_Egrow6Mi_v_; -text: .text%__1cObox_handleNodeHsize_of6kM_I_; -text: .text%__1cPsarL_rReg_1NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIPSOldGenKinitialize6MnNReservedSpace_Lpkci_v_; text: .text%__1cIPSOldGenYinitialize_virtual_space6MnNReservedSpace_L_v_; text: .text%__1cIPSOldGenPinitialize_work6Mpkci_v_; -text: .text%__1cNdivI_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cbCAbstractInterpreterGeneratorTgenerate_error_exit6Mpkc_pC_; text: .text%__1cTAbstractInterpreterKinitialize6F_v_; text: .text%__1cZInterpreterMacroAssemblerLprofile_ret6MpnMRegisterImpl_2_v_; text: .text%__1cZInterpreterMacroAssemblerSprofile_final_call6MpnMRegisterImpl__v_; text: .text%__1cZInterpreterMacroAssemblerMprofile_call6MpnMRegisterImpl__v_; text: .text%__1cOPSVirtualSpace2t6M_v_; -text: .text%__1cOPSVirtualSpaceKinitialize6MnNReservedSpace_L_i_; text: .text%__1cZInterpreterMacroAssemblerSupdate_mdp_for_ret6MpnMRegisterImpl__v_; text: .text%__1cZInterpreterMacroAssemblerPset_mdp_flag_at6MpnMRegisterImpl_i_v_; text: .text%__1cZInterpreterMacroAssemblerWdispatch_only_noverify6MnITosState__v_; text: .text%__1cZInterpreterMacroAssemblerSsuper_call_VM_leaf6MpCpnMRegisterImpl__v_; text: .text%__1cKReflectionbFbasic_type_arrayklass_to_mirror6FpnMklassOopDesc_pnGThread__pnHoopDesc__; -text: .text%__1cMAdapterCache2t6M_v_; -text: .text%__1cSComputeAdapterInfoIdo_array6Mii_v_; -text: .text%__1cGatomll6Fpkcpx_i_: arguments.o; -text: .text%__1cJArgumentsRcheck_memory_size6Fxx_n0AJArgsRange__; text: .text%__1cJArgumentsVset_parallel_gc_flags6F_v_; -text: .text%__1cYalign_to_allocation_size6FL_L_: heap.o; -text: .text%__1cJArgumentsRparse_memory_size6Fpkcpxx_n0AJArgsRange__; -text: .text%__1cJArgumentsXPropertyList_unique_add6FppnOSystemProperty_pkcpc_v_; text: .text%__1cQAgentLibraryList2t6M_v_; -text: .text%__1cFKlassVoop_is_typeArrayKlass6kM_i_; text: .text%__1cMmulF_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cJAssemblerGmovsbl6MpnMRegisterImpl_2_v_; text: .text%__1cJAssemblerGmovswl6MpnMRegisterImpl_2_v_; -text: .text%__1cLOptoRuntimebDlazy_c2i_adapter_generation_C6FpnKJavaThread__pC_; -text: .text%__1cLOptoRuntimeVgenerate_handler_blob6FpCi_pnNSafepointBlob__; text: .text%__1cRaddL_mem_rRegNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cJAssemblerGmovzwl6MpnMRegisterImpl_2_v_; -text: .text%__1cJAssemblerFmovdq6MpnMRegisterImpl_pnRFloatRegisterImpl__v_; text: .text%__1cRComputeEntryStackIdo_float6M_v_; text: .text%__1cJAssemblerFcmovl6Mn0AJCondition_pnMRegisterImpl_nHAddress__v_; -text: .text%__1cSReferenceProcessor2t6MnJMemRegion_iii_v_; text: .text%__1cJAssemblerEaddl6MnHAddress_pnMRegisterImpl__v_; text: .text%__1cOGenerateOopMapTadd_to_ref_init_set6Mi_v_; text: .text%__1cJAssemblerEcmpq6MpnMRegisterImpl_i_v_; -text: .text%__1cJAssemblerHucomisd6MpnRFloatRegisterImpl_2_v_; text: .text%__1cJAssemblerFidivl6MpnMRegisterImpl__v_; text: .text%__1cJAssemblerFidivq6MpnMRegisterImpl__v_; text: .text%__1cJAssemblerEcdql6M_v_; text: .text%__1cJAssemblerEcdqq6M_v_; text: .text%__1cJAssemblerEleal6MpnMRegisterImpl_nHAddress__v_; text: .text%__1cJAssemblerDorq6MnHAddress_i_v_; -text: .text%__1cWStubGenerator_generate6FpnKCodeBuffer_i_v_; text: .text%__1cJStubQdDueue2t6MpnNStubInterface_ipnFMutex_pkc_v_; text: .text%__1cMGCTaskThreadDrun6M_v_; text: .text%__1cMGCTaskThreadFstart6M_v_; @@ -7284,12 +4745,9 @@ text: .text%__1cISubFNodeDsub6kMpknEType_3_3_; text: .text%__1cJAssemblerFxaddl6MnHAddress_pnMRegisterImpl__v_; text: .text%__1cNGCTaskManagerKset_thread6MIpnMGCTaskThread__v_; text: .text%__1cJAssemblerHldmxcsr6MnHAddress__v_; -text: .text%__1cJAssemblerFxorps6MpnRFloatRegisterImpl_2_v_; text: .text%__1cKcastPPNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cMPeriodicTask2t6ML_v_; text: .text%__1cMPeriodicTaskGenroll6M_v_; -text: .text%__1cPOopTaskQdDueueSetOregister_queue6MipnMOopTaskQdDueue__v_; -text: .text%__1cOMacroAssemblerHcall_VM6MpnMRegisterImpl_pC222i_v_; text: .text%__1cNTemplateTableHcall_VM6FpnMRegisterImpl_pC_v_; text: .text%__1cNTemplateTableHcall_VM6FpnMRegisterImpl_pC22_v_; text: .text%__1cNTemplateTableJfloat_cmp6Fi_v_; @@ -7297,14 +4755,9 @@ text: .text%__1cNTemplateTableKdouble_cmp6Fi_v_; text: .text%__1cNTemplateTableKinitialize6F_v_; text: .text%__1cNTemplateTableGlconst6Fi_v_; text: .text%__1cNTemplateTableGdconst6Fi_v_; -text: .text%__1cNTemplateTableDldc6Fi_v_; text: .text%__1cNTemplateTableHcastore6F_v_; -text: .text%__1cPdouble_quadword6Fpxxx_0_: templateTable_amd64.o; text: .text%__1cNTemplateTableKif_nullcmp6Fn0AJCondition__v_; text: .text%__1cNTemplateTableHif_acmp6Fn0AJCondition__v_; -text: .text%__1cNTemplateTableSgetfield_or_static6Fii_v_; -text: .text%__1cNTemplateTableUjvmti_post_field_mod6Fii_v_; -text: .text%__1cNTemplateTableSputfield_or_static6Fii_v_; text: .text%__1cNTemplateTableUinvokevirtual_helper6FpnMRegisterImpl_22_v_; text: .text%__1cEMIN24CL_6FTA0_0_; text: .text%__1cRCardTableModRefBSbCpar_chunk_heapword_alignment6F_L_; @@ -7312,8 +4765,6 @@ text: .text%__1cOMacroAssemblerPcorrected_idivl6MpnMRegisterImpl__i_; text: .text%__1cOMacroAssemblerPcorrected_idivq6MpnMRegisterImpl__i_; text: .text%__1cLNamedThread2t6M_v_; text: .text%__1cLNamedThreadIset_name6MpkcE_v_; -text: .text%__1cOMacroAssemblerQserialize_memory6MpnMRegisterImpl_22_v_; -text: .text%__1cIDivDNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cIDivDNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cFStatebB_sub_Op_PartialSubtypeCheck6MpknENode__v_; text: .text%__1cFStateM_sub_Op_DivI6MpknENode__v_; @@ -7322,24 +4773,17 @@ text: .text%__1cFStateP_sub_Op_ConvL2F6MpknENode__v_; text: .text%__1cFStateP_sub_Op_ConvL2D6MpknENode__v_; text: .text%__1cFStateP_sub_Op_ConvF2I6MpknENode__v_; text: .text%__1cFStateP_sub_Op_ConvD2F6MpknENode__v_; -text: .text%__1cRcheck_if_clipping6FpknKRegionNode_rpnGIfNode_5_i_: cfgnode.o; -text: .text%__1cWcheck_compare_clipping6FipnGIfNode_pnHConNode_rpnENode__i_: cfgnode.o; -text: .text%__1cIciObjectOis_array_klass6M_i_; text: .text%__1cScompP_rReg_memNodeFreloc6kM_i_; text: .text%__1cKCastPPNodeJideal_reg6kM_I_; text: .text%__1cLMoveF2INodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cFTypeDJis_finite6kM_i_; text: .text%__1cLMoveL2DNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cTconvL2D_reg_memNodeFreloc6kM_i_; text: .text%__1cMdivD_immNodeFreloc6kM_i_; text: .text%__1cMmulF_memNodeFreloc6kM_i_; text: .text%__1cMaddF_memNodeFreloc6kM_i_; -text: .text%__1cLConvF2INodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cLConvF2INodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cLConvD2FNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cOcompP_rRegNodeMcisc_version6Mi_pnIMachNode__; text: .text%__1cKciTypeFlowLStateVectorRdo_multianewarray6MpnQciBytecodeStream__v_; -text: .text%__1cMorI_rRegNodeMcisc_version6Mi_pnIMachNode__; text: .text%__1cRCollectorCounters2t6Mpkci_v_; text: .text%Unsafe_CompareAndSwapObject; text: .text%__1cNSafepointBlob2n6FLI_pv_; @@ -7347,8 +4791,6 @@ text: .text%__1cNSafepointBlobGcreate6FpnKCodeBuffer_pnJOopMapSet_i_p0_; text: .text%__1cNSafepointBlob2t6MpnKCodeBuffer_ipnJOopMapSet_i_v_; text: .text%__1cINegFNodeJideal_reg6kM_I_; text: .text%__1cMVirtualSpace2t6M_v_; -text: .text%__1cMVirtualSpaceKinitialize6MnNReservedSpace_L_i_; -text: .text%__1cHMatcherQconvL2FSupported6F_ki_; text: .text%__1cLConvD2FNodeJideal_reg6kM_I_; text: .text%__1cLConvF2INodeJideal_reg6kM_I_; text: .text%__1cLConvL2DNodeJideal_reg6kM_I_; @@ -7364,29 +4806,17 @@ text: .text%__1cJAssemblerEsubl6MpnMRegisterImpl_i_v_; text: .text%__1cJAssemblerEsubq6MnHAddress_i_v_; text: .text%__1cLOptoRuntimeIgenerate6FpnFciEnv__v_; text: .text%__1cMmulD_memNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cYSurvivorMutableSpacePool2t6MpnKPSYoungGen_pkcnKMemoryPoolIPoolType_i_v_; text: .text%__1cParrayKlassKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; -text: .text%__1cFKlassUoop_is_instanceKlass6kM_i_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: arguments.o; text: .text%__1cJArgumentsWPropertyList_get_value6FpnOSystemProperty_pkc_4_; text: .text%__1cJArgumentsFparse6FpknOJavaVMInitArgs__i_; text: .text%__1cKNoopGCTaskQcreate_on_c_heap6F_p0_; -text: .text%__1cJArgumentsbSparse_java_tool_options_environment_variable6FpnMSysClassPath_pi_i_; -text: .text%__1cWResolveOopMapConflictsOreport_results6kM_i_; -text: .text%__1cMCodeHeapPool2t6MpnICodeHeap_pkci_v_; text: .text%__1cJAssemblerFxchgl6MpnMRegisterImpl_nHAddress__v_; -text: .text%__1cJArgumentsbNparse_java_options_environment_variable6FpnMSysClassPath_pi_i_; text: .text%__1cJAssemblerFxchgq6MpnMRegisterImpl_nHAddress__v_; -text: .text%__1cJArgumentsVfinalize_vm_init_args6FpnMSysClassPath_i_i_; -text: .text%__1cJArgumentsWparse_each_vm_init_arg6FpknOJavaVMInitArgs_pnMSysClassPath_pi_i_; text: .text%__1cJArgumentsSparse_vm_init_args6FpknOJavaVMInitArgs__i_; text: .text%__1cJAssemblerIcmpxchgl6MpnMRegisterImpl_nHAddress__v_; -text: .text%__1cINegFNodeFIdeal6MpnIPhaseGVN_i_pnENode__; -text: .text%__1cJArgumentsZcheck_vm_args_consistency6F_i_; text: .text%__1cICodeHeap2t6M_v_; -text: .text%__1cJArgumentsbOparse_java_compiler_environment_variable6F_v_; text: .text%__1cHVM_ExitNset_vm_exited6F_i_; -text: .text%__1cICodeHeapHreserve6MLLL_i_; text: .text%__1cQRelocationHolder2t6M_v_; text: .text%__1cICodeHeapFclear6M_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: relocInfo.o; @@ -7395,15 +4825,12 @@ text: .text%__1cJArgumentsSset_bytecode_flags6F_v_; text: .text%__1cJArgumentsUset_ergonomics_flags6F_v_; text: .text%__1cJArgumentsbBset_cms_and_parnew_gc_flags6F_v_; text: .text%__1cJArgumentsTset_parnew_gc_flags6F_v_; -text: .text%__1cQno_shared_spaces6F_v_: arguments.o; text: .text%__1cJArgumentsMget_property6Fpkc_2_; text: .text%__1cLsymbolKlassOset_alloc_size6MI_v_; text: .text%__1cLsymbolKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_; -text: .text%__1cJArgumentsVprocess_settings_file6Fpkcii_i_; text: .text%__1cNGCTaskManagerKthreads_do6MpnNThreadClosure__v_; text: .text%__1cNGCTaskManagerKinitialize6M_v_; text: .text%__1cNGCTaskManager2t6MI_v_; -text: .text%__1cXSynchronizedGCTaskQdDueue2t6MpnLGCTaskQdDueue_pnFMutex__v_; text: .text%__1cDhpiKinitialize6F_i_; text: .text%__1cDhpiZinitialize_socket_library6F_i_; text: .text%__1cDhpiYinitialize_get_interface6FpnIvm_calls__v_; @@ -7421,74 +4848,39 @@ text: .text%__1cLicache_init6F_v_; text: .text%__1cYGCAdaptivePolicyCounters2t6MpkciipnSAdaptiveSizePolicy__v_; text: .text%__1cHVM_ExitbJwait_for_threads_in_native_to_block6F_i_; text: .text%__1cJAssemblerHstmxcsr6MnHAddress__v_; -text: .text%__1cJAssemblerFaddss6MpnRFloatRegisterImpl_nHAddress__v_; -text: .text%__1cJAssemblerFsubss6MpnRFloatRegisterImpl_2_v_; text: .text%__1cTICacheStubGeneratorVgenerate_icache_flush6MppFpCii_i_v_; text: .text%__1cMSysClassPath2t6Mpkc_v_; text: .text%__1cJArgumentsWinit_system_properties6F_v_; -text: .text%__1cJAssemblerFmulss6MpnRFloatRegisterImpl_nHAddress__v_; -text: .text%__1cJAssemblerFdivss6MpnRFloatRegisterImpl_2_v_; -text: .text%__1cJAssemblerFaddsd6MpnRFloatRegisterImpl_nHAddress__v_; text: .text%__1cFChunkbDstart_chunk_pool_cleaner_task6F_v_; -text: .text%__1cJAssemblerFsubsd6MpnRFloatRegisterImpl_2_v_; text: .text%__1cOchunkpool_init6F_v_; -text: .text%__1cJAssemblerFmulsd6MpnRFloatRegisterImpl_nHAddress__v_; -text: .text%__1cJAssemblerFdivsd6MpnRFloatRegisterImpl_2_v_; text: .text%__1cQSystemDictionarybAcompute_java_system_loader6FpnGThread__v_; -text: .text%__1cJAssemblerGsqrtsd6MpnRFloatRegisterImpl_nHAddress__v_; text: .text%__1cHVM_ExitEdoit6M_v_; -text: .text%__1cRArgumentOopFinderDset6MinJBasicType__v_; text: .text%__1cWAdjoiningVirtualSpaces2t6MnNReservedSpace_LLL_v_; text: .text%__1cUAdjoiningGenerations2t6MnNReservedSpace_LLLLLLL_v_; text: .text%__1cHOrLNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cZCompiledArgumentOopFinderRhandle_oop_offset6M_v_; -text: .text%__1cJAssemblerFxorps6MpnRFloatRegisterImpl_nHAddress__v_; -text: .text%__1cJAssemblerFxorpd6MpnRFloatRegisterImpl_2_v_; -text: .text%__1cJAssemblerFxorpd6MpnRFloatRegisterImpl_nHAddress__v_; -text: .text%__1cJAssemblerJcvtsi2ssl6MpnRFloatRegisterImpl_pnMRegisterImpl__v_; -text: .text%__1cJAssemblerJcvtsi2ssq6MpnRFloatRegisterImpl_pnMRegisterImpl__v_; -text: .text%__1cJAssemblerJcvtsi2sdl6MpnRFloatRegisterImpl_pnMRegisterImpl__v_; -text: .text%__1cFframebAoops_compiled_arguments_do6MnMsymbolHandle_ipknLRegisterMap_pnKOopClosure__v_; -text: .text%__1cJAssemblerJcvtsi2sdq6MpnRFloatRegisterImpl_pnMRegisterImpl__v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: adaptiveSizePolicy.o; -text: .text%__1cSAdaptiveSizePolicy2t6ML_v_; -text: .text%__1cFframebDoops_interpreted_arguments_do6MnMsymbolHandle_ipnKOopClosure__v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: regmask.o; -text: .text%__1cJAssemblerKcvttss2sil6MpnMRegisterImpl_pnRFloatRegisterImpl__v_; -text: .text%__1cJAssemblerKcvttss2siq6MpnMRegisterImpl_pnRFloatRegisterImpl__v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: indexSet.o; -text: .text%__1cJAssemblerKcvttsd2sil6MpnMRegisterImpl_pnRFloatRegisterImpl__v_; text: .text%__1cFframeVinterpreter_frame_mdp6kM_pC_; text: .text%__1cPvm_init_globals6F_v_; -text: .text%__1cJAssemblerKcvttsd2siq6MpnMRegisterImpl_pnRFloatRegisterImpl__v_; text: .text%__1cQSystemDictionaryKclasses_do6FpFpnMklassOopDesc__v_v_; text: .text%__1cQSystemDictionaryKmethods_do6FpFpnNmethodOopDesc__v_v_; text: .text%__1cQSystemDictionaryKinitialize6FpnGThread__v_; text: .text%__1cQSystemDictionarybCinitialize_preloaded_classes6FpnGThread__v_; -text: .text%__1cQSystemDictionarybDinitialize_basic_type_mirrors6FpnGThread__v_; -text: .text%__1cJAssemblerIcvtss2sd6MpnRFloatRegisterImpl_2_v_; -text: .text%__1cJAssemblerIcvtsd2ss6MpnRFloatRegisterImpl_2_v_; text: .text%__1cMinit_globals6F_i_; text: .text%__1cMexit_globals6F_v_; text: .text%__1cOMacroAssemblerKdecrementl6MpnMRegisterImpl_i_v_; -text: .text%__1cHVM_ExitEname6kM_pkc_; text: .text%__1cKcastPPNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: fprofiler.o; text: .text%__1cNMemoryServiceRset_universe_heap6FpnNCollectedHeap__v_; text: .text%__1cMPeriodicTask2T5B6M_v_; -text: .text%__1cMPeriodicTaskLis_enrolled6kM_i_; text: .text%__1cNMemoryServicebFadd_parallel_scavenge_heap_info6FpnUParallelScavengeHeap__v_; text: .text%__1cMPeriodicTaskJdisenroll6M_v_; text: .text%__1cSset_init_completed6F_v_; -text: .text%__1cMadapter_init6F_v_; -text: .text%__1cTI2CAdapterGeneratorKinitialize6F_v_; text: .text%__1cNMemoryServiceXadd_psYoung_memory_pool6FpnKPSYoungGen_pnNMemoryManager_4_v_; -text: .text%__1cTC2IAdapterGeneratorKinitialize6F_v_; -text: .text%__1cOstackSlotPOperFclone6kM_pnIMachOper__; -text: .text%__1cObox_handleNodeFclone6kM_pnENode__; text: .text%__1cTAbstract_VM_VersionHvm_name6F_pkc_; text: .text%__1cTAbstract_VM_VersionJvm_vendor6F_pkc_; -text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: ad_amd64_pipeline.o; text: .text%__1cSobjArrayKlassKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cNTemplateTableHcall_VM6FpnMRegisterImpl_pC222_v_; text: .text%__1cKmutex_init6F_v_; @@ -7505,7 +4897,6 @@ text: .text%__1cSinstanceKlassKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: vm_version.o; text: .text%__1cStemplateTable_init6F_v_; text: .text%__1cNTemplateTableNpd_initialize6F_v_; -text: .text%__1cSinstanceKlassKlassUoop_is_instanceKlass6kM_i_; text: .text%__1cNTemplateTableDnop6F_v_; text: .text%__1cNTemplateTableSshouldnotreachhere6F_v_; text: .text%__1cNTemplateTableLaconst_null6F_v_; @@ -7543,7 +4934,6 @@ text: .text%__1cNTemplateTableGsaload6F_v_; text: .text%__1cSReferenceProcessorMinit_statics6F_v_; text: .text%__1cXreferenceProcessor_init6F_v_; text: .text%__1cZInterpreterMacroAssemblerSsuper_call_VM_leaf6MpCpnMRegisterImpl_33_v_; -text: .text%__1cURecompilationMonitorbGstart_recompilation_monitor_task6F_v_; text: .text%__1cZInterpreterMacroAssemblerUdispatch_only_normal6MnITosState__v_; text: .text%__1cNTemplateTableHaload_06F_v_; text: .text%__1cNTemplateTableGistore6F_v_; @@ -7588,8 +4978,6 @@ text: .text%__1cNTemplateTableElrem6F_v_; text: .text%__1cNTemplateTableElshl6F_v_; text: .text%__1cNTemplateTableElshr6F_v_; text: .text%__1cNTemplateTableFlushr6F_v_; -text: .text%__1cRaddL_rReg_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cRaddL_mem_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNTemplateTableEineg6F_v_; text: .text%__1cNTemplateTableElneg6F_v_; text: .text%__1cLVtableStubsKinitialize6F_v_; @@ -7597,7 +4985,6 @@ text: .text%__1cNTemplateTableEfneg6F_v_; text: .text%__1cNTemplateTableEdneg6F_v_; text: .text%__1cNTemplateTableEiinc6F_v_; text: .text%__1cNTemplateTableJwide_iinc6F_v_; -text: .text%__1cMincL_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNTemplateTableElcmp6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: psScavenge.o; text: .text%__1cKPSScavengeKinitialize6F_v_; @@ -7612,19 +4999,12 @@ text: .text%__1cNTemplateTableMlookupswitch6F_v_; text: .text%__1cNTemplateTableRfast_linearswitch6F_v_; text: .text%__1cNTemplateTableRfast_binaryswitch6F_v_; text: .text%__1cbCAbstractInterpreterGeneratorMgenerate_all6M_v_; -text: .text%__1cbCAbstractInterpreterGeneratorbEset_entry_points_for_all_bytes6M_v_; -text: .text%__1cbCAbstractInterpreterGeneratorbCset_safepoints_for_all_bytes6M_v_; -text: .text%__1cOsalI_mem_1NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cSPSPromotionManagerKinitialize6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: memoryService.o; text: .text%__1cNTemplateTableIgetfield6Fi_v_; text: .text%__1cNTemplateTableJgetstatic6Fi_v_; -text: .text%__1cNGrowableArray4CpnNMemoryManager__2t6Mii_v_; -text: .text%__1cNGrowableArray4CpnKMemoryPool__2t6Mii_v_; text: .text%__1cNTemplateTableIputfield6Fi_v_; text: .text%__1cNTemplateTableJputstatic6Fi_v_; -text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: psPromotionLAB.o; -text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: interpreter.o; text: .text%__1cJPSPermGen2t6MnNReservedSpace_LLLLpkci_v_; text: .text%__1cXNativeSignatureIteratorHdo_byte6M_v_; text: .text%__1cIPSOldGen2t6MLLLpkci_v_; @@ -7647,7 +5027,6 @@ text: .text%__1cNTemplateTableLmonitorexit6F_v_; text: .text%__1cNTemplateTableEwide6F_v_; text: .text%__1cNTemplateTableOmultianewarray6F_v_; text: .text%__1cIPSOldGen2t6MnNReservedSpace_LLLLpkci_v_; -text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: tenuredGeneration.o; text: .text%__1cQvtableStubs_init6F_v_; text: .text%__1cQaccessFlags_init6F_v_; text: .text%__1cSInterpreterRuntimeYthrow_ClassCastException6FpnKJavaThread_pnHoopDesc__v_; @@ -7655,17 +5034,9 @@ text: .text%__1cSInterpreterRuntimeSupdate_mdp_for_ret6FpnKJavaThread_i_v_; text: .text%__1cNeventlog_init6F_v_; text: .text%__1cOMacroAssemblerGc2bool6MpnMRegisterImpl__v_; text: .text%__1cPmethodDataKlassOset_alloc_size6MI_v_; -text: .text%__1cFVTuneEexit6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: psMarkSweep.o; -text: .text%__1cTPSAlwaysTrueClosure2t6M_v_: psMarkSweep.o; text: .text%__1cXSignatureHandlerLibraryQset_handler_blob6F_pC_; -text: .text%__1cNGrowableArray4CpC_2t6Mii_v_; -text: .text%__1cNGrowableArray4CL_2t6Mii_v_; -text: .text%__1cbCAbstractInterpreterGeneratorbJgenerate_StackOverflowError_handler6M_pC_; text: .text%__1cOMacroAssemblerRsign_extend_short6MpnMRegisterImpl__v_; -text: .text%__1cbCAbstractInterpreterGeneratorbMgenerate_ArrayIndexOutOfBounds_handler6Mpkc_pC_; -text: .text%__1cbCAbstractInterpreterGeneratorbJgenerate_ClassCastException_handler6M_pC_; -text: .text%__1cGThreadWset_as_starting_thread6M_i_; text: .text%__1cLPSMarkSweepKinitialize6F_v_; text: .text%__1cbBcreate_initial_thread_group6FpnGThread__nGHandle__: thread.o; text: .text%__1cVcreate_initial_thread6FnGHandle_pnKJavaThread_pnGThread__pnHoopDesc__: thread.o; @@ -7678,12 +5049,9 @@ text: .text%__1cNWatcherThreadDrun6M_v_; text: .text%__1cNWatcherThreadFstart6F_v_; text: .text%__1cNWatcherThreadEstop6F_v_; text: .text%__1cOMacroAssemblerQsign_extend_byte6MpnMRegisterImpl__v_; -text: .text%__1cKJavaThread2t6M_v_; text: .text%__1cHRetDataJfixup_ret6MinQmethodDataHandle__pC_; -text: .text%__1cKvtune_init6F_v_; text: .text%__1cLmethodKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cbAPSGCAdaptivePolicyCounters2t6MpkciipnUPSAdaptiveSizePolicy__v_; -text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: psAdaptiveSizePolicy.o; text: .text%__1cKDictionaryKmethods_do6MpFpnNmethodOopDesc__v_v_; text: .text%__1cKDictionaryKclasses_do6MpFpnMklassOopDesc__v_v_; text: .text%__1cbCAbstractInterpreterGeneratorbFgenerate_slow_signature_handler6M_pC_; @@ -7695,20 +5063,15 @@ text: .text%__1cUInterpreterGeneratorXgenerate_accessor_entry6M_pC_; text: .text%__1cKDictionary2t6Mi_v_; text: .text%__1cJBytecodesKinitialize6F_v_; text: .text%__1cObytecodes_init6F_v_; -text: .text%__1cUPSAdaptiveSizePolicy2t6MLLLLLddI_v_; text: .text%__1cJBytecodesNpd_initialize6F_v_; text: .text%__1cHCompileRpd_compiler2_init6F_v_; text: .text%__1cKC2CompilerKinitialize6M_v_; text: .text%__1cFStateQ_sub_Op_TailJump6MpknENode__v_; -text: .text%__1cMorL_rRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cbCAbstractInterpreterGeneratorYgenerate_throw_exception6M_v_; text: .text%__1cUInterpreterGenerator2t6MpnJStubQdDueue__v_; text: .text%__1cWinvocationCounter_init6F_v_; text: .text%__1cQPlaceholderTable2t6Mi_v_; -text: .text%__1cHThreadsJcreate_vm6FpnOJavaVMInitArgs_pi_i_; text: .text%__1cFStateL_sub_Op_OrL6MpknENode__v_; text: .text%__1cFStateM_sub_Op_NegF6MpknENode__v_; -text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: ad_amd64_expand.o; text: .text%__1cQprint_statistics6F_v_; text: .text%__1cLbefore_exit6FpnKJavaThread__v_; text: .text%__1cFStateP_sub_Op_MoveL2D6MpknENode__v_; @@ -7720,7 +5083,6 @@ text: .text%__1cVjava_lang_ThreadGroupPcompute_offsets6F_v_; text: .text%__1cbIjava_lang_reflect_AccessibleObjectPcompute_offsets6F_v_; text: .text%__1cYjava_lang_reflect_MethodPcompute_offsets6F_v_; text: .text%__1cOThreadCriticalKinitialize6F_v_; -text: .text%__1cRAllocateTLSOffset6F_v_: threadLS_solaris_amd64.o; text: .text%__1cSThreadLocalStoragebCgenerate_code_for_get_thread6F_v_; text: .text%__1cYjava_lang_reflect_MethodNset_signature6FpnHoopDesc_2_v_; text: .text%__1cbDjava_lang_reflect_ConstructorPcompute_offsets6F_v_; @@ -7738,7 +5100,6 @@ text: .text%__1cLJavaClassesbAcompute_hard_coded_offsets6F_v_; text: .text%__1cLJavaClassesPcompute_offsets6F_v_; text: .text%__1cPGlobalTLABStats2t6M_v_; text: .text%__1cQjavaClasses_init6F_v_; -text: .text%__1cMTailJumpNode2t6MpnENode_22222_v_; text: .text%jni_ToReflectedMethod: jni.o; text: .text%__1cSThreadLocalStorageEinit6F_v_; text: .text%__1cNThreadServiceEinit6F_v_; @@ -7752,29 +5113,17 @@ text: .text%__1cWjni_GetFloatField_addr6F_pC_; text: .text%__1cRCardTableModRefBS2t6MnJMemRegion_i_v_; text: .text%__1cXjni_GetDoubleField_addr6F_pC_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: phase.o; -text: .text%__1cJTimeStampMmilliseconds6kM_x_; text: .text%__1cTConstantDoubleValueIwrite_on6MpnUDebugInfoWriteStream__v_; text: .text%__1cKPerfMemoryUdelete_memory_region6F_v_; text: .text%__1cKPerfMemoryUcreate_memory_region6FL_v_; text: .text%__1cRCardTableModRefBSbBct_max_alignment_constraint6F_L_; -text: .text%__1cUdelete_shared_memory6FpcL_v_: perfMemory_solaris.o; -text: .text%__1cUcreate_shared_memory6FL_pc_: perfMemory_solaris.o; text: .text%__1cOtailjmpIndNodeFreloc6kM_i_; -text: .text%__1cSmmap_create_shared6FL_pc_: perfMemory_solaris.o; text: .text%__1cETypeRInitialize_shared6FpnHCompile__v_; text: .text%__1cWconstantPoolCacheKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_; -text: .text%__1cbAcreate_sharedmem_resources6Fpkc1L_i_: perfMemory_solaris.o; text: .text%__1cWconstantPoolCacheKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; -text: .text%__1cRmake_user_tmp_dir6Fpkc_i_: perfMemory_solaris.o; -text: .text%__1cbBcleanup_sharedmem_resources6Fpkc_v_: perfMemory_solaris.o; text: .text%__1cMciArrayKlass2t6MpnIciSymbol_ipnHciKlass__v_; -text: .text%__1cLremove_file6Fpkc_v_: perfMemory_solaris.o; -text: .text%__1cWget_sharedmem_filename6Fpkci_pc_: perfMemory_solaris.o; -text: .text%__1cNget_user_name6Fi_pc_: perfMemory_solaris.o; -text: .text%__1cQget_user_tmp_dir6Fpkc_pc_: perfMemory_solaris.o; text: .text%__1cRconstantPoolKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_; text: .text%__1cFciEnvXget_or_create_exception6MrpnI_jobject_nMsymbolHandle__pnKciInstance__; -text: .text%__1cMloadConFNodeGis_Con6kM_I_; text: .text%__1cRconstantPoolKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cKPerfMemoryHdestroy6F_v_; text: .text%__1cQconstMethodKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_; @@ -7794,7 +5143,6 @@ text: .text%__1cPPerfDataManagerHdestroy6F_v_; text: .text%__1cMsubD_immNodeFreloc6kM_i_; text: .text%__1cMsubF_memNodeFreloc6kM_i_; text: .text%lookupDirectBufferClasses: jni.o; -text: .text%__1cbDinitializeDirectBufferSupport6FpnHJNIEnv___i_: jni.o; text: .text%__1cVquicken_jni_functions6F_v_; text: .text%JNI_CreateJavaVM; text: .text%__1cFParseWprofile_null_checkcast6M_v_; @@ -7813,7 +5161,6 @@ text: .text%__1cRaddL_mem_rRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMincL_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQJNI_FastGetFieldbDgenerate_fast_get_float_field6F_pC_; text: .text%__1cQJNI_FastGetFieldbEgenerate_fast_get_double_field6F_pC_; -text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: jniFastGetField_amd64.o; text: .text%__1cNcmovL_memNodeFreloc6kM_i_; text: .text%__1cKJNIHandlesKinitialize6F_v_; text: .text%__1cQjni_handles_init6F_v_; @@ -7821,34 +5168,22 @@ text: .text%JVM_InitProperties; text: .text%JVM_Halt; text: .text%JVM_MaxMemory; text: .text%JVM_GetClassDeclaredMethods; -text: .text%__1cKCMoveDNodeFIdeal6MpnIPhaseGVN_i_pnENode__; text: .text%__1cOsalI_mem_1NodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cHRetDataKis_RetData6M_i_; text: .text%JVM_InitializeSocketLibrary; text: .text%JVM_Socket; text: .text%__1cPciObjArrayKlass2t6MpnIciSymbol_pnHciKlass_i_v_; -text: .text%__1cPOopTaskQdDueueSet2t6Mi_v_; text: .text%__1cbEinitialize_converter_functions6F_v_; text: .text%JVM_SupportsCX8; text: .text%__1cUciObjArrayKlassKlassEmake6F_p0_; text: .text%__1cTcompilerOracle_init6F_v_; -text: .text%__1cOCompilerOracleRparse_from_string6Fpkc_v_; text: .text%__1cOCompilerOraclePparse_from_file6F_v_; -text: .text%__1cHcc_file6F_pkc_: compilerOracle.o; -text: .text%__1cKTypeOopPtrEmake6FnHTypePtrDPTR_i_pk0_; text: .text%__1cKTypeOopPtrFxdual6kM_pknEType__; -text: .text%__1cOCompilerOracleOread_from_line6Fpc_v_; text: .text%__1cPciObjectFactoryTinit_shared_objects6M_v_; text: .text%__1cVcompiledICHolderKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_; text: .text%__1cVcompiledICHolderKlassOset_alloc_size6MI_v_; -text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: jvmtiEnvBase.o; text: .text%__1cVcompiledICHolderKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; -text: .text%__1cNGrowableArray4CpnMJvmtiEnvBase__2t6Mii_v_; text: .text%__1cRJvmtiEventEnabled2t6M_v_; -text: .text%__1cRciArrayKlassKlassUis_array_klass_klass6M_i_; text: .text%__1cRJvmtiEventEnabledFclear6M_v_; -text: .text%__1cNGrowableArray4CpnOCompilerThread__2t6Mii_v_; -text: .text%__1cFParseNfetch_monitor6MipnENode_2_2_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: compileBroker.o; text: .text%__1cNGrowableArray4CpnIciMethod__Egrow6Mi_v_; text: .text%__1cNCompileBrokerQset_should_block6F_v_; @@ -7856,10 +5191,7 @@ text: .text%__1cUJvmtiEventControllerIvm_start6F_v_; text: .text%__1cPGenerationSizerQinitialize_flags6M_v_; text: .text%__1cUJvmtiEventControllerHvm_init6F_v_; text: .text%__1cUJvmtiEventControllerIvm_death6F_v_; -text: .text%__1cNCompileBrokerVinit_compiler_threads6Fi_v_; -text: .text%__1cUParallelScavengeHeapbCsupports_inline_contig_alloc6kM_i_; text: .text%__1cUParallelScavengeHeapItop_addr6kM_ppnIHeapWord__; -text: .text%__1cNCompileBrokerQcompilation_init6FpnQAbstractCompiler__v_; text: .text%__1cUParallelScavengeHeapIend_addr6kM_ppnIHeapWord__; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: jvmtiEventController.o; text: .text%__1cLJvmtiExportRenter_start_phase6F_v_; @@ -7868,23 +5200,19 @@ text: .text%__1cUParallelScavengeHeapNgc_threads_do6kMpnNThreadClosure__v_; text: .text%__1cUParallelScavengeHeapYpermanent_object_iterate6MpnNObjectClosure__v_; text: .text%__1cLJvmtiExportQenter_live_phase6F_v_; text: .text%__1cLJvmtiExportNpost_vm_start6F_v_; -text: .text%__1cOcompiler2_init6F_v_; text: .text%__1cLJvmtiExportTpost_vm_initialized6F_v_; text: .text%__1cLJvmtiExportNpost_vm_death6F_v_; text: .text%__1cLJvmtiExportbMtransition_pending_onload_raw_monitors6F_v_; text: .text%__1cUParallelScavengeHeapMmax_capacity6kM_L_; text: .text%__1cUJvmtiPendingMonitorsXtransition_raw_monitors6F_v_; -text: .text%__1cMaddF_regNodeMcisc_version6Mi_pnIMachNode__; text: .text%__1cUParallelScavengeHeapPpost_initialize6M_v_; text: .text%__1cUParallelScavengeHeapKinitialize6M_i_; -text: .text%__1cHoopDescLheader_size6F_i_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: compilationPolicy.o; text: .text%__1cPClassFileParserbFjava_lang_ref_Reference_fix_pre6MpnPtypeArrayHandle_nSconstantPoolHandle_pnUFieldAllocationCount_pnGThread__v_; text: .text%__1cPClassFileParserXjava_lang_Class_fix_pre6MpnOobjArrayHandle_pnUFieldAllocationCount_pnGThread__v_; text: .text%__1cPClassFileParserYjava_lang_Class_fix_post6Mpi_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: parGCAllocBuffer.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: jvmtiImpl.o; -text: .text%__1cNGrowableArray4CpnPJvmtiRawMonitor__2t6Mii_v_; text: .text%__1cNGrowableArray4CpnPJvmtiRawMonitor__Uclear_and_deallocate6M_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: jvmtiTagMap.o; text: .text%__1cRCompilationPolicyUcompleted_vm_startup6F_v_; @@ -7893,7 +5221,6 @@ text: .text%__SLIP.DELETER__C: ostream.o; text: .text%__1cWcompilationPolicy_init6F_v_; text: .text%__1cMostream_exit6F_v_; text: .text%__1cTtypeArrayKlassKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; -text: .text%__1cTtypeArrayKlassKlassVoop_is_typeArrayKlass6kM_i_; text: .text%__1cbCTwoGenerationCollectorPolicyMrem_set_name6M_nJGenRemSetEName__; text: .text%__1cTtypeArrayKlassKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_; text: .text%__1cQostream_init_log6F_v_; @@ -7902,14 +5229,12 @@ text: .text%__1cIUniverseHgenesis6FpnGThread__v_; text: .text%__1cIUniverseNfixup_mirrors6FpnGThread__v_; text: .text%__1cMostream_init6F_v_; text: .text%__1cNdefaultStreamEinit6M_v_; -text: .text%__1cIUniverseUreinitialize_itables6F_v_; text: .text%__1cKklassKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cKklassKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_; text: .text%__1cNuniverse_init6F_i_; text: .text%__1cIUniversePinitialize_heap6F_i_; text: .text%__1cLClassLoaderbBsetup_bootstrap_search_path6F_v_; text: .text%__1cOuniverse2_init6F_v_; -text: .text%__1cSuniverse_post_init6F_v_; text: .text%__1cIUniverseYcompute_base_vtable_size6F_v_; text: .text%__1cCosXnon_memory_address_word6F_pc_; text: .text%__1cCosGinit_26F_i_; @@ -7919,24 +5244,18 @@ text: .text%__1cCosHSolarisUsynchronization_init6F_v_; text: .text%Unsafe_SetNativeLong; text: .text%__1cCosHSolarisOlibthread_init6F_v_; text: .text%__1cJLoadFNodeMstore_Opcode6kM_i_; -text: .text%__1cOisT2_libthread6F_i_; text: .text%Unsafe_FreeMemory; text: .text%__1cCosHSolarisXinstall_signal_handlers6F_v_; text: .text%Unsafe_PageSize; text: .text%__1cRlwp_priocntl_init6F_i_: os_solaris.o; text: .text%__1cNpriocntl_stub6FinGidtype_iipc_l_: os_solaris.o; -text: .text%__1cCosHSolarisRmpss_sanity_check6F_v_; -text: .text%__1cOLibraryCallKitWinline_native_hashcode6Mii_i_; text: .text%__1cbCTwoGenerationCollectorPolicyQinitialize_flags6M_v_; -text: .text%__1cCosOrelease_memory6FpcL_i_; text: .text%__1cCosLsignal_wait6F_i_; text: .text%JVM_RegisterUnsafeMethods; -text: .text%__1cVcheck_pending_signals6Fi_i_: os_solaris.o; text: .text%__1cCosNsignal_notify6Fi_v_; text: .text%__1cCosOsignal_init_pd6F_v_; text: .text%__1cLClassLoaderQload_zip_library6F_v_; text: .text%__1cLClassLoaderZcreate_package_info_table6F_v_; -text: .text%__1cNmulI_rRegNodeMcisc_version6Mi_pnIMachNode__; text: .text%__1cLClassLoaderKinitialize6F_v_; text: .text%__1cLClassLoaderVcompute_Object_vtable6F_i_; text: .text%__1cCosHSolarisPinit_signal_mem6F_v_; @@ -7947,19 +5266,12 @@ text: .text%__1cCosSget_temp_directory6F_pkc_; text: .text%__1cVLoaderConstraintTable2t6Mi_v_; text: .text%__1cCosbDallocate_thread_local_storage6F_i_; text: .text%__1cOcodeCache_init6F_v_; -text: .text%__1cVverificationType_init6F_v_; -text: .text%__1cVverificationType_exit6F_v_; -text: .text%__1cQVerificationTypeKinitialize6F_v_; -text: .text%__1cQVerificationTypeIfinalize6F_v_; text: .text%__1cJCodeCacheKinitialize6F_v_; text: .text%__1cNIdealLoopTreeQsplit_outer_loop6MpnOPhaseIdealLoop__v_; text: .text%__1cKfix_parent6FpnNIdealLoopTree_1_v_: loopnode.o; text: .text%__1cCosHSolarisQsignal_sets_init6F_v_; text: .text%__1cTClassLoadingServiceEinit6F_v_; -text: .text%__1cTClassLoadingServiceVnotify_class_unloaded6FpnNinstanceKlass_i_v_; -text: .text%__1cCosScreate_main_thread6FpnGThread__i_; text: .text%__1cNIdealLoopTreeUmerge_many_backedges6MpnOPhaseIdealLoop__v_; -text: .text%__1cQcreate_os_thread6FpnGThread_I_pnIOSThread__: os_solaris.o; text: .text%__1cRLowMemoryDetectorKinitialize6F_v_; text: .text%__1cLmethodKlassOset_alloc_size6MI_v_; text: .text%__1cNExceptionBlob2n6FLI_pv_; @@ -7971,13 +5283,10 @@ text: .text%__1cQUncommonTrapBlob2t6MpnKCodeBuffer_ipnJOopMapSet_i_v_; text: .text%__1cSDeoptimizationBlob2n6FLI_pv_; text: .text%__1cSDeoptimizationBlobGcreate6FpnKCodeBuffer_pnJOopMapSet_iiii_p0_; text: .text%__1cSDeoptimizationBlob2t6MpnKCodeBuffer_ipnJOopMapSet_iiii_v_; -text: .text%__1cRLowMemoryDetectorUhas_pending_requests6F_i_; text: .text%__1cCosbDinit_system_properties_values6F_v_; text: .text%__1cCosHSolarisWinitialize_system_info6F_v_; text: .text%__1cCosPphysical_memory6F_X_; -text: .text%__1cMFastLockNodeLis_FastLock6kM_pk0_; text: .text%__1cRLowMemoryDetectorbGlow_memory_detector_thread_entry6FpnKJavaThread_pnGThread__v_; -text: .text%__1cXLowMemoryDetectorThreadbCis_hidden_from_external_view6kM_i_; text: .text%__1cSThreadLocalStorageHpd_init6F_v_; text: .text%__1cLmethodKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: machnode.o; @@ -7985,28 +5294,16 @@ text: .text%__1cPmanagement_init6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: cmsAdaptiveSizePolicy.o; text: .text%__1cKManagementEinit6F_v_; text: .text%__1cKManagementKinitialize6FpnGThread__v_; -text: .text%__1cKManagementWrecord_vm_startup_time6Fxx_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: management.o; text: .text%__1cOmarksweep_init6F_v_; -text: .text%__1cCosXis_server_class_machine6F_i_; -text: .text%__1cJMarkSweepQKeepAliveClosure2t6M_v_: markSweep.o; -text: .text%__1cNReservedSpace2t6MLLipc_v_; -text: .text%__1cJMarkSweepOIsAliveClosure2t6M_v_: markSweep.o; text: .text%__1cCosZset_memory_serialize_page6FpC_v_; -text: .text%__1cCosNset_boot_path6Fcc_i_; -text: .text%__1cJMarkSweepSFollowStackClosure2t6M_v_: markSweep.o; text: .text%__1cNReservedSpaceUpage_align_size_down6FL_L_; text: .text%__1cNReservedSpaceYallocation_align_size_up6FL_L_; -text: .text%__1cNGrowableArray4CpnKOSRAdapter__2t6Mii_v_; -text: .text%__1cXonStackReplacement_init6F_v_; -text: .text%__1cSOnStackReplacementKinitialize6F_v_; -text: .text%__1cJMarkSweepRFollowRootClosure2t6M_v_: markSweep.o; text: .text%__1cCosLinit_random6Fl_v_; text: .text%__1cHOrLNodeJideal_reg6kM_I_; text: .text%__1cOvmStructs_init6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: vmStructs.o; text: .text%__1cJvmSymbolsKinitialize6FpnGThread__v_; -text: .text%__1cJMarkSweepSMarkAndPushClosure2t6M_v_: markSweep.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: markSweep.o; text: .text%__1cQVMOperationQdDueue2t6M_v_; text: .text%__1cCosGstrdup6Fpkc_pc_; @@ -8017,13 +5314,9 @@ text: .text%__1cMsubD_immNodeKconst_size6kM_i_; text: .text%__1cTsignal_thread_entry6FpnKJavaThread_pnGThread__v_: os.o; text: .text%__1cOtailjmpIndNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cSobjArrayKlassKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_; -text: .text%__1cHMatcherVfind_callee_arguments6FpnNsymbolOopDesc_ipi_pnLOptoRegPair__; text: .text%__1cIVMThreadGcreate6F_v_; text: .text%__1cIVMThread2t6M_v_; -text: .text%__1cNSharedRuntimeUlookup_function_DD_D6FrpFpnHJNIEnv__pnH_jclass_dd_dpkc_v_; -text: .text%__1cNSharedRuntimebIinitialize_StrictMath_entry_points6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: sharedHeap.o; -text: .text%__1cTAssertIsPermClosure2t6M_v_: sharedHeap.o; text: .text%__1cIVMThreadDrun6M_v_; text: .text%__1cWResolveOopMapConflictsUdo_potential_rewrite6MpnGThread__nMmethodHandle__; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: generateOopMap.o; @@ -8031,43 +5324,25 @@ text: .text%__1cNCellTypeStateImake_top6F_0_; text: .text%__1cJAssemblerEandl6MpnMRegisterImpl_2_v_; text: .text%__1cNCellTypeStateLmake_bottom6F_0_; text: .text%__1cNcmovL_memNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cRcheck_basic_types6F_v_; -text: .text%__1cLOptoRuntimeYgenerate_arraycopy_stubs6F_v_; -text: .text%__1cSobjArrayKlassKlassUoop_is_objArrayKlass6kM_i_; text: .text%__1cNSharedRuntimebBgenerate_class_cast_message6FpnKJavaThread_pkc_pc_; -text: .text%__1cNSharedRuntimebBgenerate_class_cast_message6Fpkc2_pc_; -text: .text%__1cLOptoRuntimebPgenerate_polling_page_return_handler_blob6F_v_; text: .text%__1cIVMThreadEloop6M_v_; -text: .text%__1cLOptoRuntimebSgenerate_polling_page_safepoint_handler_blob6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: matcher.o; -text: .text%__1cLOptoRuntimeUsetup_exception_blob6F_v_; -text: .text%__1cLOptoRuntimeWfill_in_exception_blob6F_v_; text: .text%__1cNMemoryManagerbDget_code_cache_memory_manager6F_p0_; text: .text%__1cNMemoryManagerbDget_psScavenge_memory_manager6F_pnPGCMemoryManager__; text: .text%__1cNMemoryManagerbEget_psMarkSweep_memory_manager6F_pnPGCMemoryManager__; -text: .text%__1cQPSGenerationPool2t6MpnIPSOldGen_pkcnKMemoryPoolIPoolType_i_v_; text: .text%__1cJAssemblerFimull6MpnMRegisterImpl_2_v_; -text: .text%__1cLOptoRuntimebBgenerate_uncommon_trap_blob6F_v_; text: .text%__1cNSharedRuntimeTgenerate_deopt_blob6F_v_; -text: .text%__1cQPSGenerationPool2t6MpnJPSPermGen_pkcnKMemoryPoolIPoolType_i_v_; text: .text%__1cNRegisterSaverYrestore_result_registers6FpnOMacroAssembler__v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: runtimeService.o; text: .text%__1cORuntimeServiceYrecord_application_start6F_v_; text: .text%__1cJGenRemSetYmax_alignment_constraint6Fn0AEName__L_; -text: .text%__1cICarSpaceEinit6F_v_; -text: .text%__1cNcarSpace_init6F_v_; text: .text%__1cORuntimeServiceEinit6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: genCollectedHeap.o; -text: .text%__1cTAssertIsPermClosure2t6M_v_: genCollectedHeap.o; -text: .text%__1cRAlwaysTrueClosure2t6M_v_: genCollectedHeap.o; -text: .text%__1cLOptoRuntimeVhandle_exception_Type6F_pknITypeFunc__; -text: .text%__1cLOptoRuntimeSfetch_monitor_Type6F_pknITypeFunc__; text: .text%__1cJAssemblerDorl6MpnMRegisterImpl_i_v_; text: .text%__1cLStatSamplerKinitialize6F_v_; text: .text%__1cLStatSamplerGengage6F_v_; text: .text%__1cLStatSamplerJdisengage6F_v_; text: .text%__1cLStatSamplerHdestroy6F_v_; -text: .text%__1cSCommandLineFlagsExKuintxAtPut6FnXCommandLineFlagWithType_L_v_; text: .text%__1cSobjArrayKlassKlassbEallocate_system_objArray_klass6MpnGThread__pnMklassOopDesc__; text: .text%__1cLOptoRuntimeUmultianewarray5_Type6F_pknITypeFunc__; text: .text%__1cLStatSamplerbMcreate_system_property_instrumentation6FpnGThread__v_; @@ -8079,14 +5354,7 @@ text: .text%__1cJAssemblerEsarq6MpnMRegisterImpl__v_; text: .text%__1cLOptoRuntimeUmultianewarray4_Type6F_pknITypeFunc__; text: .text%__1cJAssemblerEshll6MpnMRegisterImpl__v_; text: .text%__1cJAssemblerEshlq6MpnMRegisterImpl__v_; -text: .text%__1cUEdenMutableSpacePool2t6MpnKPSYoungGen_pnMMutableSpace_pkcnKMemoryPoolIPoolType_i_v_; text: .text%__1cNStubGeneratorQgenerate_initial6M_v_; -text: .text%__1cNStubGeneratorXgenerate_atomic_add_ptr6M_pC_; -text: .text%__1cNStubGeneratorTgenerate_atomic_add6M_pC_; -text: .text%__1cNStubGeneratorbCgenerate_atomic_cmpxchg_long6M_pC_; -text: .text%__1cNStubGeneratorXgenerate_atomic_cmpxchg6M_pC_; -text: .text%__1cNStubGeneratorYgenerate_atomic_xchg_ptr6M_pC_; -text: .text%__1cNStubGeneratorUgenerate_atomic_xchg6M_pC_; text: .text%__1cNStubGeneratorYgenerate_catch_exception6M_pC_; text: .text%__1cNStubGeneratorSgenerate_call_stub6MrpC_1_; text: .text%__1cNStubGeneratorbAgenerate_forward_exception6M_pC_; @@ -8098,18 +5366,12 @@ text: .text%__1cNStubGeneratorSgenerate_f2i_fixup6M_pC_; text: .text%__1cLOptoRuntimeUmultianewarray3_Type6F_pknITypeFunc__; text: .text%__1cNStubGeneratorTgenerate_verify_oop6M_pC_; text: .text%__1cNStubGeneratorVgenerate_verify_mxcsr6M_pC_; -text: .text%__1cNStubGeneratorYgenerate_get_previous_fp6M_pC_; -text: .text%__1cNStubGeneratorbIgenerate_handler_for_unsafe_access6M_pC_; text: .text%__1cMStubRoutinesLinitialize16F_v_; text: .text%__1cMStubRoutinesLinitialize26F_v_; text: .text%__1cSstubRoutines_init16F_v_; text: .text%__1cSstubRoutines_init26F_v_; text: .text%__1cLMoveL2DNodeJideal_reg6kM_I_; -text: .text%__1cNGrowableArray4CpnTDerivedPointerEntry__2t6Mii_v_; text: .text%__1cLMoveF2INodeJideal_reg6kM_I_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: oopMap.o; -text: .text%__1cNGrowableArray4CpnHMonitor__2t6Mii_v_; text: .text%__1cLOptoRuntimeUmultianewarray2_Type6F_pknITypeFunc__; -text: .text%__1cLOptoRuntimeUmultianewarray1_Type6F_pknITypeFunc__; -text: .text%__1cQDoNothingClosure2t6M_v_: oopMap.o; text: .text%__1cJAssemblerEshrl6MpnMRegisterImpl__v_; diff --git a/hotspot/make/solaris/makefiles/reorder_TIERED_i486 b/hotspot/make/solaris/makefiles/reorder_TIERED_i486 index 4edb5a22610..89ac4da3beb 100644 --- a/hotspot/make/solaris/makefiles/reorder_TIERED_i486 +++ b/hotspot/make/solaris/makefiles/reorder_TIERED_i486 @@ -2,7 +2,6 @@ data = R0x2000; text = LOAD ?RXO; -text: .text%__1cNinstanceKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cQIndexSetIteratorQadvance_and_next6M_I_; text: .text%__1cNSharedRuntimeElrem6Fxx_x_; text: .text%__1cCosOjavaTimeMillis6F_x_; @@ -19,7 +18,6 @@ text: .text%__1cDLRGOcompute_degree6kMr0_i_; text: .text%__1cIIndexSetWalloc_block_containing6MI_pn0AIBitBlock__; text: .text%__1cENodeEjvms6kM_pnIJVMState__; text: .text%__1cHRegMaskJis_bound16kM_i_; -text: .text%__1cNobjArrayKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cETypeDcmp6Fkpk03_i_; text: .text%__1cHRegMaskJis_bound26kM_i_; text: .text%__1cHRegMaskESize6kM_I_; @@ -36,8 +34,6 @@ text: .text%__1cENodeHadd_req6Mp0_v_; text: .text%__1cKTypeOopPtrFklass6kM_pnHciKlass__: type.o; text: .text%__1cMPhaseChaitinTinterfere_with_live6MIpnIIndexSet__v_; text: .text%__1cETypeFuhash6Fkpk0_i_; -text: .text%__1cOlower_pressure6FpnDLRG_IpnFBlock_pI4_v_: ifg.o; -text: .text%__1cMget_live_bit6Fpii_i_: buildOopMap.o; text: .text%__1cMPhaseChaitinLskip_copies6MpnENode__2_; text: .text%__1cICallNodeKmatch_edge6kMI_I_; text: .text%__1cHPhiNodeGOpcode6kM_i_; @@ -47,15 +43,12 @@ text: .text%__1cIPhaseIFGQeffective_degree6kMI_i_; text: .text%__1cIUniverseMnon_oop_word6F_pv_; text: .text%__1cIPhaseIFGLremove_node6MI_pnIIndexSet__; text: .text%__1cIPhaseIFGJre_insert6MI_v_; -text: .text%__1cJraw_score6Fdd_d_: chaitin.o; text: .text%__1cDLRGFscore6kM_d_; text: .text%__1cETypeIhashcons6M_pk0_; text: .text%__1cPClassFileStreamGget_u26MpnGThread__H_; text: .text%__1cENodeEhash6kM_I_; text: .text%__1cHNTarjanEEVAL6M_p0_; text: .text%__1cMMachCallNodeKin_RegMask6kMI_rknHRegMask__; -text: .text%__1cMset_live_bit6Fpii_v_: buildOopMap.o; -text: .text%__1cOPhaseIdealLoopUbuild_loop_late_post6MpnENode_pk0_v_; text: .text%__1cIProjNodeGOpcode6kM_i_; text: .text%__1cNobjArrayKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cNobjArrayKlassToop_follow_contents6MpnHoopDesc__v_; @@ -64,7 +57,6 @@ text: .text%__1cDfh16FI_i_; text: .text%__1cNIdealLoopTreeJis_member6kMpk0_i_; text: .text%__1cIConINodeGOpcode6kM_i_; text: .text%__1cGIfNodeGOpcode6kM_i_; -text: .text%__1cOtypeArrayKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cHTypePtrEhash6kM_i_; text: .text%__1cENode2t6MI_v_; text: .text%JVM_ArrayCopy; @@ -79,11 +71,9 @@ text: .text%__1cKIfTrueNodeGOpcode6kM_i_; text: .text%__1cIAddPNodeGOpcode6kM_i_; text: .text%__1cPDictionaryEntrybDprotection_domain_set_oops_do6MpnKOopClosure__v_: dictionary.o; text: .text%__1cHTypeIntEhash6kM_i_; -text: .text%__1cSPSPromotionManagerUflush_prefetch_queue6M_v_: psPromotionManager.o; text: .text%__1cMMachProjNodeLbottom_type6kM_pknEType__; text: .text%__1cMPhaseIterGVNNtransform_old6MpnENode__2_; text: .text%__1cMMachProjNodeGOpcode6kM_i_; -text: .text%__1cMclr_live_bit6Fpii_v_: buildOopMap.o; text: .text%__1cJCProjNodeNis_block_proj6kM_pknENode__: cfgnode.o; text: .text%__1cJPhaseLiveGgetset6MpnFBlock__pnIIndexSet__; text: .text%__1cHConNodeGOpcode6kM_i_; @@ -223,7 +213,6 @@ text: .text%__1cFframeYinterpreter_frame_method6kM_pnNmethodOopDesc__; text: .text%__1cENodeHdel_req6MI_v_; text: .text%__1cETypeEhash6kM_i_; text: .text%__1cLSymbolTableGlookup6FpkcipnGThread__pnNsymbolOopDesc__; -text: .text%__1cKoopFactoryKnew_symbol6FpkcipnGThread__pnNsymbolOopDesc__; text: .text%__1cIHaltNodeGOpcode6kM_i_; text: .text%__1cMPhaseIterGVNZremove_globally_dead_node6MpnENode__v_; text: .text%__1cIParmNodeGOpcode6kM_i_; @@ -310,7 +299,6 @@ text: .text%__1cHMatcherKmatch_tree6MpknENode__pnIMachNode__; text: .text%__1cIIndexSetSpopulate_free_list6F_v_; text: .text%__1cMloadConINodeLout_RegMask6kM_rknHRegMask__; text: .text%JVM_ReleaseUTF; -text: .text%__1cKutf8_write6FpCH_0_: utf8.o; text: .text%__1cKNode_ArrayGremove6MI_v_; text: .text%__1cKRegionNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cMPhaseIterGVNMsubsume_node6MpnENode_2_v_; @@ -359,7 +347,6 @@ text: .text%__1cHPhiNodeHsize_of6kM_I_: cfgnode.o; text: .text%__1cJTypeTupleGfields6FI_ppknEType__; text: .text%__1cMPhaseChaitinFUnion6MpknENode_3_v_; text: .text%__1cKRegionNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cLrecord_bias6FpknIPhaseIFG_ii_v_: coalesce.o; text: .text%__1cMPhaseChaitinSget_spillcopy_wide6MpnENode_2I_2_; text: .text%__1cKNativeCallLdestination6kM_pC_; text: .text%__1cICallNodeIIdentity6MpnOPhaseTransform__pnENode__: callnode.o; @@ -415,7 +402,6 @@ text: .text%__1cNmethodOopDescLresult_type6kM_nJBasicType__; text: .text%__1cFStateM_sub_Op_ConI6MpknENode__v_; text: .text%__1cNRelocIteratorKset_limits6MpC1_v_; text: .text%__1cIsplit_if6FpnGIfNode_pnMPhaseIterGVN__pnENode__: ifnode.o; -text: .text%__1cTremove_useless_bool6FpnGIfNode_pnIPhaseGVN__pnENode__: ifnode.o; text: .text%__1cJeRegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cSInterpreterRuntimeJanewarray6FpnKJavaThread_pnTconstantPoolOopDesc_ii_v_; text: .text%__1cHAddNodeEhash6kM_I_; @@ -478,7 +464,6 @@ text: .text%__1cMMergeMemNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cLMachNopNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cKRegionNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cMObjectLocker2T6M_v_; -text: .text%__1cWConstantPoolCacheEntryRset_initial_state6Mi_v_; text: .text%__1cOPhaseIdealLoopOidom_no_update6kMpnENode__2_: loopTransform.o; text: .text%__1cRmethodDataOopDescPinitialize_data6MpnOBytecodeStream_i_i_; text: .text%__1cRmethodDataOopDescTbytecode_cell_count6FnJBytecodesECode__i_; @@ -516,7 +501,6 @@ text: .text%__1cMLinkResolverYlookup_method_in_klasses6FrnMmethodHandle_nLKlassH text: .text%__1cMMergeMemNodePset_base_memory6MpnENode__v_; text: .text%__1cNLoadKlassNodeGOpcode6kM_i_; text: .text%__1cKTypeRawPtrEhash6kM_i_; -text: .text%__1cIciObjectIencoding6M_pnI_jobject__; text: .text%__1cPPerfLongVariantGsample6M_v_; text: .text%__1cIAndINodeGOpcode6kM_i_; text: .text%__1cVCompressedWriteStream2t6Mi_v_; @@ -552,7 +536,6 @@ text: .text%__1cCosMvm_page_size6F_i_; text: .text%__1cENodeDcmp6kMrk0_I_; text: .text%__1cNloadRangeNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateM_sub_Op_RegI6MpknENode__v_; -text: .text%__1cFKlassNlookup_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cFStateM_sub_Op_AddP6MpknENode__v_; text: .text%__1cIGraphKitMsaved_ex_oop6FpnNSafePointNode__pnENode__; text: .text%__1cIciObjectJset_ident6MI_v_; @@ -654,7 +637,6 @@ text: .text%__1cFParseFBlockRsuccessor_for_bci6Mi_p1_; text: .text%JVM_CurrentThread; text: .text%__1cKBranchDataKcell_count6M_i_: ciMethodData.o; text: .text%__1cLOopMapCacheIentry_at6kMi_pnQOopMapCacheEntry__; -text: .text%__1cHOopFlowEmake6FpnFArena_i_p0_; text: .text%__1cOGenerateOopMapKcheck_type6MnNCellTypeState_1_v_; text: .text%__1cMMergeMemNodeNgrow_to_match6Mpk0_v_; text: .text%__1cHTypeIntFxdual6kM_pknEType__; @@ -734,8 +716,6 @@ text: .text%__1cWconstantPoolCacheKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cWconstantPoolCacheKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cFframebFinterpreter_frame_monitor_begin6kM_pnPBasicObjectLock__; text: .text%__1cGGCTask2t6M_v_; -text: .text%__1cETypeFwiden6kMpk0_2_: type.o; -text: .text%__1cIAddPNodeQmach_bottom_type6FpknIMachNode__pknEType__; text: .text%__1cJLoadBNodeGOpcode6kM_i_; text: .text%__1cOPhaseIdealLoopGspinup6MpnENode_2222pnLsmall_cache__2_; text: .text%__1cPCountedLoopNodeGOpcode6kM_i_; @@ -762,8 +742,6 @@ text: .text%__1cNSignatureInfoJdo_object6Mii_v_: bytecode.o; text: .text%__1cHCompileKTracePhase2T6M_v_; text: .text%__1cILoadNodeHsize_of6kM_I_; text: .text%__1cVjava_lang_ClassLoaderbBnon_reflection_class_loader6FpnHoopDesc__2_; -text: .text%__1cFciEnvYget_method_by_index_impl6MpnPciInstanceKlass_inJBytecodesECode__pnIciMethod__; -text: .text%__1cFciEnvTget_method_by_index6MpnPciInstanceKlass_inJBytecodesECode__pnIciMethod__; text: .text%__1cFciEnvNlookup_method6MpnNinstanceKlass_2pnNsymbolOopDesc_4nJBytecodesECode__pnNmethodOopDesc__; text: .text%__1cNCatchProjNodeLbottom_type6kM_pknEType__: cfgnode.o; text: .text%__1cNCatchProjNodeHsize_of6kM_I_: cfgnode.o; @@ -838,7 +816,6 @@ text: .text%__1cCosEfree6Fpv_v_; text: .text%__1cKInlineTreeJcallee_at6kMipnIciMethod__p0_; text: .text%__1cQSystemDictionarybCfind_instance_or_array_klass6FnMsymbolHandle_nGHandle_2pnGThread__pnMklassOopDesc__; text: .text%__1cMVirtualSpaceOcommitted_size6kM_I_; -text: .text%__1cNinstanceKlassSlookup_osr_nmethod6kMkpnNmethodOopDesc_i_pnHnmethod__; text: .text%__1cGRFrame2t6MnFframe_pnKJavaThread_kp0_v_; text: .text%__1cYCallStaticJavaDirectNodeFreloc6kM_i_; text: .text%__1cKciTypeFlowLStateVectorJcopy_into6kMp1_v_; @@ -847,7 +824,6 @@ text: .text%__1cKciTypeFlowQadd_to_work_list6Mpn0AFBlock__v_; text: .text%__1cKciTypeFlowOwork_list_next6M_pn0AFBlock__; text: .text%__1cKciTypeFlowKflow_block6Mpn0AFBlock_pn0ALStateVector_pn0AGJsrSet__v_; text: .text%__1cWConstantPoolCacheEntryKset_method6MnJBytecodesECode_nMmethodHandle_i_v_; -text: .text%__1cFframeRoops_code_blob_do6MpnKOopClosure_pknLRegisterMap__v_; text: .text%__1cLOptoRuntimeSuncommon_trap_Type6F_pknITypeFunc__; text: .text%__1cIHaltNode2t6MpnENode_2_v_; text: .text%__1cLPCTableNodeLbottom_type6kM_pknEType__; @@ -887,12 +863,10 @@ text: .text%__1cRindIndexScaleOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cOGenerateOopMapFppush6MpnNCellTypeState__v_; text: .text%__1cIConLNodeGOpcode6kM_i_; text: .text%__1cQSystemDictionarybOfind_constrained_instance_or_array_klass6FnMsymbolHandle_nGHandle_pnGThread__pnMklassOopDesc__; -text: .text%__1cHTypeIntFwiden6kMpknEType__3_; text: .text%__1cNCallGenerator2t6MpnIciMethod__v_; text: .text%__1cIGraphKit2t6M_v_; text: .text%__1cHMulNodeEhash6kM_I_; text: .text%__1cFStateM_sub_Op_ConP6MpknENode__v_; -text: .text%__1cIciSymbol2t6MnMsymbolHandle__v_; text: .text%__1cIAddLNodeGOpcode6kM_i_; text: .text%__1cIGraphKitNset_map_clone6MpnNSafePointNode__v_; text: .text%__1cIGraphKitOreplace_in_map6MpnENode_2_v_; @@ -917,7 +891,6 @@ text: .text%__1cIAddINodeJideal_reg6kM_I_: classes.o; text: .text%__1cOPhaseIdealLoopIsink_use6MpnENode_2_v_; text: .text%__1cKMemoryPoolYrecord_peak_memory_usage6M_v_; text: .text%__1cNinstanceKlassKlink_class6MpnGThread__v_; -text: .text%__1cTStackWalkCompPolicyRcompilation_level6MnMmethodHandle_i_i_; text: .text%__1cKMemBarNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cNinstanceKlassPinitialize_impl6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cTconstantPoolOopDescbBbasic_type_for_signature_at6Mi_nJBasicType__; @@ -935,8 +908,6 @@ text: .text%__1cISubINodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cKReturnNodeKmatch_edge6kMI_I_; text: .text%__1cKReturnNodeGOpcode6kM_i_; text: .text%__1cKHandleAreaHoops_do6MpnKOopClosure__v_; -text: .text%__1cNchunk_oops_do6FpnKOopClosure_pnFChunk_pc_I_: handles.o; -text: .text%__1cGThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cKstorePNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cLStringTableGintern6FpnNsymbolOopDesc_pnGThread__pnHoopDesc__; text: .text%__1cNsymbolOopDescKas_unicode6kMri_pH_; @@ -964,7 +935,6 @@ text: .text%__1cPmethodDataKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cPmethodDataKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cRMachNullCheckNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cICodeHeapLheader_size6F_I_; -text: .text%__1cKJavaThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cJTypeTupleKmake_range6FpnLciSignature__pk0_; text: .text%__1cJStoreNodeSIdeal_masked_input6MpnIPhaseGVN_I_pnENode__; text: .text%__1cIAddINodeIadd_ring6kMpknEType_3_3_; @@ -1003,7 +973,6 @@ text: .text%__1cQCallLeafNoFPNodeGOpcode6kM_i_; text: .text%__1cIciMethodTcall_profile_at_bci6Mi_nNciCallProfile__; text: .text%__1cRInterpretedRFrame2t6MnFframe_pnKJavaThread_kpnGRFrame__v_; text: .text%__1cJAssemblerEmovl6MpnMRegisterImpl_nHAddress__v_; -text: .text%__1cPBytecode_invokeFindex6kM_i_; text: .text%__1cFParseHdo_call6M_v_; text: .text%__1cIGraphKitWround_double_arguments6MpnIciMethod__v_; text: .text%__1cIGraphKitTround_double_result6MpnIciMethod__v_; @@ -1057,12 +1026,10 @@ text: .text%__1cLOpaque1NodeGOpcode6kM_i_; text: .text%__1cSObjectSynchronizerJslow_exit6FpnHoopDesc_pnJBasicLock_pnGThread__v_; text: .text%__1cbBopt_virtual_call_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; text: .text%__1cLnaxRegPOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cbAjni_check_async_exceptions6FpnKJavaThread__v_: jni.o; text: .text%__1cKciTypeFlowLStateVectorStype_meet_internal6FpnGciType_3p0_3_; text: .text%__1cJFieldTypeSskip_optional_size6FpnNsymbolOopDesc_pi_v_; text: .text%__1cQjmpCon_shortNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cSobjArrayKlassKlassIoop_size6kMpnHoopDesc__i_: objArrayKlassKlass.o; -text: .text%__1cIGraphKitTset_all_memory_call6MpnENode__v_; text: .text%__1cJloadSNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKjmpDirNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIBoolNodeDcmp6kMrknENode__I_; @@ -1090,7 +1057,6 @@ text: .text%__1cXPhaseAggressiveCoalesceYinsert_copy_with_overlap6MpnFBlock_pnEN text: .text%__1cJAssemblerKemit_arith6MiipnMRegisterImpl_i_v_; text: .text%__1cFStateN_sub_Op_LoadP6MpknENode__v_; text: .text%__1cTconstantPoolOopDescbDresolve_string_constants_impl6FnSconstantPoolHandle_pnGThread__v_; -text: .text%__1cNCompileBrokerOcompile_method6FnMmethodHandle_i1ipkcpnGThread__pnHnmethod__; text: .text%__1cJloadINodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cFArenaRdestruct_contents6M_v_; text: .text%__1cFStateM_sub_Op_CmpI6MpknENode__v_; @@ -1098,7 +1064,6 @@ text: .text%__1cIAddPNodeJideal_reg6kM_I_: classes.o; text: .text%__1cJAssemblerDjcc6Mn0AJCondition_rnFLabel_nJrelocInfoJrelocType__v_; text: .text%__1cHi2sNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cOGenerateOopMapJdo_method6Miiii_v_; -text: .text%__1cLSymbolTableFprobe6Fpkci_pnNsymbolOopDesc__; text: .text%__1cNdecI_eRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIciObjectFklass6M_pnHciKlass__; text: .text%__1cQPSGenerationPoolQget_memory_usage6M_nLMemoryUsage__; @@ -1106,7 +1071,6 @@ text: .text%__1cLRShiftLNodeGOpcode6kM_i_; text: .text%__1cKMemBarNodeFmatch6MpknIProjNode_pknHMatcher__pnENode__; text: .text%__1cMURShiftLNodeGOpcode6kM_i_; text: .text%__1cIMulINodeGOpcode6kM_i_; -text: .text%__1cPBytecode_invokeJsignature6kM_pnNsymbolOopDesc__; text: .text%__1cIConDNodeGOpcode6kM_i_; text: .text%__1cNSignatureInfoGdo_int6M_v_: bytecode.o; text: .text%__1cFframebGinterpreter_callee_receiver_addr6MnMsymbolHandle__ppnHoopDesc__; @@ -1138,13 +1102,11 @@ text: .text%__1cPStatSamplerTaskEtask6M_v_: statSampler.o; text: .text%__1cMPeriodicTaskMtime_to_wait6F_I_: thread.o; text: .text%jni_GetByteArrayRegion: jni.o; text: .text%__1cQPlaceholderTableKfind_entry6MiInMsymbolHandle_nGHandle__pnNsymbolOopDesc__; -text: .text%__1cKBufferBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cKstorePNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cFStateP_sub_Op_LShiftI6MpknENode__v_; text: .text%jni_GetArrayLength: jni.o; text: .text%__1cICodeHeapIcapacity6kM_I_; text: .text%__1cMCodeHeapPoolQget_memory_usage6M_nLMemoryUsage__; -text: .text%__1cKMemoryPoolImax_size6kM_I_: memoryPool.o; text: .text%__1cMCodeHeapPoolNused_in_bytes6M_I_: memoryPool.o; text: .text%__1cIPipelinePoperand_latency6kMIpk0_I_; text: .text%__1cIMachOperEtype6kM_pknEType__; @@ -1221,19 +1183,16 @@ text: .text%__1cPJavaCallWrapper2t6MnMmethodHandle_nGHandle_pnJJavaValue_pnGThre text: .text%__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_; text: .text%__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_; text: .text%__1cRJavaCallArgumentsKparameters6M_pi_; -text: .text%__1cRruntime_type_from6FpnJJavaValue__nJBasicType__: javaCalls.o; text: .text%__1cTAbstractInterpreterbFsize_top_interpreter_activation6FpnNmethodOopDesc__i_; text: .text%__1cJMultiNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cPJavaCallWrapper2T6M_v_; text: .text%__1cITypeFuncFxdual6kM_pknEType__; -text: .text%__1cKInlineTree2t6MpnHCompile_pk0pnIciMethod_pnIJVMState_if_v_; text: .text%__1cMLinkResolverXresolve_klass_no_update6FrnLKlassHandle_nSconstantPoolHandle_ipnGThread__v_; text: .text%__1cHciField2t6MpnPciInstanceKlass_i_v_; text: .text%__1cTconstantPoolOopDescbCklass_ref_at_if_loaded_check6FnSconstantPoolHandle_ipnGThread__pnMklassOopDesc__; text: .text%__1cNloadKlassNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cOGenerateOopMapCpp6MpnNCellTypeState_2_v_; text: .text%__1cSObjectSynchronizerXidentity_hash_value_for6FnGHandle__i_; -text: .text%__1cQjava_lang_StringGlength6FpnHoopDesc__i_; text: .text%__1cHoopDescSslow_identity_hash6M_i_; text: .text%__1cIMulINodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cGciType2t6MnLKlassHandle__v_; @@ -1242,8 +1201,6 @@ text: .text%__1cLRShiftINodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cKInlineTreeYcompute_callee_frequency6kMi_f_; text: .text%__1cKInlineTreebCbuild_inline_tree_for_callee6MpnIciMethod_pnIJVMState_i_p0_; text: .text%__1cIciMethodbBinterpreter_call_site_count6Mi_i_; -text: .text%__1cHnmethodHoops_do6MpnKOopClosure__v_; -text: .text%__1cJGC_lockerNlock_critical6FpnKJavaThread__v_: jni.o; text: .text%__1cJAssemblerElock6M_v_; text: .text%__1cFKlassTarray_klass_or_null6Mi_pnMklassOopDesc__; text: .text%__1cRandI_eReg_immNodeLout_RegMask6kM_rknHRegMask__; @@ -1265,12 +1222,10 @@ text: .text%__1cSInterpreterRuntimeMmonitorenter6FpnKJavaThread_pnPBasicObjectLo text: .text%__1cPciInstanceKlass2t6MnLKlassHandle__v_; text: .text%jni_GetPrimitiveArrayCritical: jni.o; text: .text%jni_ReleasePrimitiveArrayCritical: jni.o; -text: .text%__1cWConstantPoolCacheEntryPbytecode_number6FnJBytecodesECode__i_: cpCacheOop.o; text: .text%__1cOMethodLivenessKBasicBlockIload_two6Mi_v_; text: .text%__1cMCreateExNodeJideal_reg6kM_I_: classes.o; text: .text%__1cFArena2t6M_v_; text: .text%__1cHMulNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cLsymbolKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cMCreateExNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cSInterpreterRuntimeLmonitorexit6FpnKJavaThread_pnPBasicObjectLock__v_; text: .text%__1cIJVMState2t6Mi_v_; @@ -1284,9 +1239,7 @@ text: .text%__1cEDict2T6M_v_; text: .text%__1cNCatchProjNodeDcmp6kMrknENode__I_; text: .text%__1cSCountedLoopEndNodeKstride_con6kM_i_; text: .text%__1cRmethodDataOopDescKmileage_of6FpnNmethodOopDesc__i_; -text: .text%__1cQconstMethodKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cHCompileXin_preserve_stack_slots6M_I_; -text: .text%__1cLmethodKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cKTypeRawPtrFxmeet6kMpknEType__3_; text: .text%__1cTJvmtiEventCollectorYunset_jvmti_thread_state6M_v_; text: .text%__1cbGJvmtiVMObjectAllocEventCollector2T6M_v_; @@ -1298,7 +1251,6 @@ text: .text%__1cFStateM_sub_Op_CmpU6MpknENode__v_; text: .text%__1cSPSKeepAliveClosureGdo_oop6MppnHoopDesc__v_: psScavenge.o; text: .text%__1cFTypeDEmake6Fd_pk0_; text: .text%jni_IsSameObject: jni.o; -text: .text%__1cRCompilationPolicybIreset_counter_for_invocation_event6MnMmethodHandle__v_; text: .text%__1cKMemoryPoolHoops_do6MpnKOopClosure__v_; text: .text%__1cNstoreImmBNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cJloadPNodeIpipeline6kM_pknIPipeline__; @@ -1351,7 +1303,6 @@ text: .text%__1cNstoreImmBNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cOGenerateOopMapIdo_field6Miiii_v_; text: .text%__1cOGenerateOopMapRsigchar_to_effect6McipnNCellTypeState__2_; text: .text%__1cJAssemblerFtestl6MpnMRegisterImpl_2_v_; -text: .text%__1cIGraphKitZset_results_for_java_call6MpnMCallJavaNode__pnENode__; text: .text%JVM_GetMethodIxModifiers; text: .text%__1cNSCMemProjNodeGOpcode6kM_i_; text: .text%__1cJleaP8NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -1363,8 +1314,6 @@ text: .text%__1cFStateM_sub_Op_RegL6MpknENode__v_; text: .text%__1cRMachNullCheckNodeLout_RegMask6kM_rknHRegMask__: machnode.o; text: .text%__1cRshrI_eReg_immNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cScompP_mem_eRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cFciEnvbAget_constant_by_index_impl6MpnPciInstanceKlass_i_nKciConstant__; -text: .text%__1cFciEnvVget_constant_by_index6MpnPciInstanceKlass_i_nKciConstant__; text: .text%__1cLLShiftLNodeGOpcode6kM_i_; text: .text%__1cTciConstantPoolCacheGinsert6Mipv_v_; text: .text%__1cSobjArrayKlassKlassToop_adjust_pointers6MpnHoopDesc__i_; @@ -1376,7 +1325,6 @@ text: .text%__1cUreloc_java_to_interp6F_I_; text: .text%__1cTsize_java_to_interp6F_I_; text: .text%__1cKstoreINodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cScompU_eReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cIGraphKitTcreate_and_xform_if6MpnENode_2ff_pnGIfNode__: graphKit.o; text: .text%__1cSCallLeafDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQComputeCallStackHdo_void6M_v_: generateOopMap.o; text: .text%__1cHciField2t6MpnPfieldDescriptor__v_; @@ -1401,11 +1349,9 @@ text: .text%__1cFParseQarray_addressing6MnJBasicType_ippknEType__pnENode__; text: .text%__1cHCompileSregister_intrinsic6MpnNCallGenerator__v_; text: .text%__1cMeADXRegLOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cRcmpFastUnlockNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cXcopy_u2_with_conversion6FpH0i_v_: classFileParser.o; text: .text%__1cPClassFileParserYparse_checked_exceptions6MpHInSconstantPoolHandle_pnGThread__1_; text: .text%__1cMLinkResolverbCresolve_special_call_or_null6FnLKlassHandle_nMsymbolHandle_21_nMmethodHandle__; text: .text%__1cPciInstanceKlassLfind_method6MpnIciSymbol_2_pnIciMethod__; -text: .text%__1cNCallGeneratorPfor_direct_call6FpnIciMethod__p0_; text: .text%__1cTDirectCallGeneratorIgenerate6MpnIJVMState__2_; text: .text%__1cMWarmCallInfoLalways_cold6F_p0_; text: .text%__1cFciEnvRfind_system_klass6MpnIciSymbol__pnHciKlass__; @@ -1444,10 +1390,7 @@ text: .text%__1cNloadKlassNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cIGraphKitPpush_pair_local6Mi_v_: parse2.o; text: .text%__1cNMemoryServiceXtrack_memory_pool_usage6FpnKMemoryPool__v_; text: .text%__1cMLinkResolverUresolve_invokestatic6FrnICallInfo_nSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cKklassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cXcmpL_reg_flags_LTGENodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNinstanceKlassScopy_static_fields6MpnSPSPromotionManager__v_; -text: .text%__1cSinstanceKlassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cKoopFactoryYnew_permanent_shortArray6FipnGThread__pnQtypeArrayOopDesc__; text: .text%__1cFStateR_sub_Op_LoadRange6MpknENode__v_; text: .text%__1cOcompU_eRegNodeIpipeline6kM_pknIPipeline__; @@ -1466,8 +1409,6 @@ text: .text%__1cIGraphKitTuse_exception_state6MpnNSafePointNode__pnENode__; text: .text%__1cKstoreINodeFreloc6kM_i_; text: .text%__1cRCardTableModRefBSPdirty_MemRegion6MnJMemRegion__v_; text: .text%__1cPcheckCastPPNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cTStackWalkCompPolicyYmethod_back_branch_event6MnMmethodHandle_iipnGThread__v_; -text: .text%__1cRCompilationPolicybJreset_counter_for_back_branch_event6MnMmethodHandle__v_; text: .text%__1cKciTypeFlowHdo_flow6M_v_; text: .text%__1cKciTypeFlowKmap_blocks6M_v_; text: .text%__1cKciTypeFlowKflow_types6M_v_; @@ -1509,14 +1450,12 @@ text: .text%__1cJrelocInfoKset_format6Mi_v_; text: .text%__1cPfieldDescriptorRint_initial_value6kM_i_; text: .text%__1cJTimeStampSticks_since_update6kM_x_; text: .text%__1cISubLNodeGOpcode6kM_i_; -text: .text%__1cRconstantPoolKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cICodeBlobMset_oop_maps6MpnJOopMapSet__v_; text: .text%__1cJCodeCacheIallocate6Fi_pnICodeBlob__; text: .text%__1cQVMOperationQdDueueSqueue_remove_front6Mi_pnMVM_Operation__; text: .text%__1cMorI_eRegNodeQuse_cisc_RegMask6M_v_; text: .text%__1cScompI_eReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cVAdaptivePaddedAverageGsample6Mf_v_; -text: .text%__1cNPrefetchQdDueueFclear6M_v_: psPromotionManager.o; text: .text%__1cSPSPromotionManagerFreset6M_v_; text: .text%__1cSPSPromotionManagerKflush_labs6M_v_; text: .text%__1cJloadSNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -1608,10 +1547,8 @@ text: .text%__1cKDictionaryJnew_entry6MIpnMklassOopDesc_pnHoopDesc__pnPDictionar text: .text%__1cIAndINodeKadd_opcode6kM_i_: classes.o; text: .text%__1cIAndINodeKmul_opcode6kM_i_: classes.o; text: .text%__1cRandI_eReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cRshrI_eReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJLoadSNodeJideal_reg6kM_I_: classes.o; text: .text%__1cLProfileDataPpost_initialize6MpnOBytecodeStream_pnRmethodDataOopDesc__v_: ciMethodData.o; -text: .text%__1cRaddI_eReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOPhaseIdealLoopMdominated_by6MpnENode_2_v_; text: .text%__1cPRoundDoubleNodeGOpcode6kM_i_; text: .text%__1cRsarI_eReg_immNodeLout_RegMask6kM_rknHRegMask__; @@ -1619,7 +1556,6 @@ text: .text%__1cJAssemblerEandl6MpnMRegisterImpl_i_v_; text: .text%__1cLklassVtableQfill_in_mirandas6Mri_v_; text: .text%__1cCosXthread_local_storage_at6Fi_pv_; text: .text%__1cSThreadLocalStoragePget_thread_slow6F_pnGThread__; -text: .text%__1cQinstanceRefKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cLregFPR1OperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cNstoreImmBNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKstoreINodeOmemory_operand6kM_pknIMachOper__; @@ -1640,8 +1576,6 @@ text: .text%__1cPClassFileStream2t6MpCipc_v_; text: .text%__1cNinstanceKlassSprocess_interfaces6MpnGThread__v_; text: .text%__1cNinstanceKlassQinit_implementor6M_v_; text: .text%__1cNinstanceKlassbBdo_local_static_fields_impl6FnTinstanceKlassHandle_pFpnPfieldDescriptor_pnGThread__v5_v_; -text: .text%__1cSinstanceKlassKlassXallocate_instance_klass6MiiiinNReferenceType_pnGThread__pnMklassOopDesc__; -text: .text%__1cKoopFactoryRnew_instanceKlass6FiiiinNReferenceType_pnGThread__pnMklassOopDesc__; text: .text%__1cLklassVtableQget_num_mirandas6FpnMklassOopDesc_pnPobjArrayOopDesc_4_i_; text: .text%__1cLklassItableZsetup_itable_offset_table6FnTinstanceKlassHandle__v_; text: .text%__1cIUniverseTflush_dependents_on6FnTinstanceKlassHandle__v_; @@ -1649,7 +1583,6 @@ text: .text%__1cJCodeCachebKnumber_of_nmethods_with_dependencies6F_i_; text: .text%__1cPClassFileParserbBparse_constant_pool_entries6MnSconstantPoolHandle_ipnGThread__v_; text: .text%__1cQSystemDictionaryQadd_to_hierarchy6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cNinstanceKlassWdo_local_static_fields6MpFpnPfieldDescriptor_pnGThread__v4_v_; -text: .text%__1cPClassFileParserUcompute_oop_map_size6MnTinstanceKlassHandle_ii_i_; text: .text%__1cPClassFileParserVset_precomputed_flags6MnTinstanceKlassHandle__v_; text: .text%__1cPClassFileParserTparse_constant_pool6MpnGThread__nSconstantPoolHandle__; text: .text%__1cPClassFileParserbDcompute_transitive_interfaces6MnTinstanceKlassHandle_nOobjArrayHandle_pnGThread__2_; @@ -1664,8 +1597,6 @@ text: .text%__1cNinstanceKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__p text: .text%__1cSThreadProfilerMark2T6M_v_; text: .text%__1cJEventMark2t6MpkcE_v_: classLoader.o; text: .text%__1cSThreadProfilerMark2t6Mn0AGRegion__v_; -text: .text%__1cFVTuneOend_class_load6F_v_; -text: .text%__1cFVTuneQstart_class_load6F_v_; text: .text%__1cLClassLoaderOload_classfile6FnMsymbolHandle_pnGThread__nTinstanceKlassHandle__; text: .text%__1cQSystemDictionaryRfind_shared_class6FnMsymbolHandle__pnMklassOopDesc__; text: .text%__1cQSystemDictionaryRload_shared_class6FnMsymbolHandle_nGHandle_pnGThread__nTinstanceKlassHandle__; @@ -1704,7 +1635,6 @@ text: .text%__1cNmulL_eRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cYciExceptionHandlerStreamPcount_remaining6M_i_; text: .text%__1cJLoadLNodeJideal_reg6kM_I_: classes.o; text: .text%__1cPshrI_eReg_1NodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cWconstantPoolCacheKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cYmulI_imm_RShift_highNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cUBytecode_tableswitchOdest_offset_at6kMi_i_; text: .text%__1cSObjectSynchronizerJnotifyall6FnGHandle_pnGThread__v_; @@ -1731,9 +1661,6 @@ text: .text%__1cIXorINodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cNSafepointBlobbDpreserve_callee_argument_oops6MnFframe_pknLRegisterMap_pnKOopClosure__v_: codeBlob.o; text: .text%__1cKManagementJtimestamp6F_x_; text: .text%__1cIPSOldGenPupdate_counters6M_v_; -text: .text%__1cNSharedRuntimebOraw_exception_handler_for_return_address6FpC_1_; -text: .text%__1cNSharedRuntimebKexception_handler_for_return_address6FpC_1_; -text: .text%__1cNaddI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cHOrINodeGadd_id6kM_pknEType__: classes.o; text: .text%signalHandler; text: .text%JVM_handle_solaris_signal; @@ -1800,7 +1727,6 @@ text: .text%__1cFKlassTarray_klass_or_null6M_pnMklassOopDesc__; text: .text%__1cNdecI_eRegNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cICodeHeapLmerge_right6MpnJFreeBlock__v_; text: .text%__1cIregDOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cNsubI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIPhaseIFGYCompute_Effective_Degree6M_v_; text: .text%__1cMPhaseChaitinISimplify6M_v_; text: .text%__1cMPhaseChaitinGSelect6M_I_; @@ -1809,7 +1735,6 @@ text: .text%__1cJScopeDescJstream_at6kMi_pnTDebugInfoReadStream__; text: .text%__1cLOptoRuntimeJstub_name6FpC_pkc_; text: .text%__1cSvframeStreamCommonZsecurity_get_caller_frame6Mi_v_; text: .text%__1cENodeHrm_prec6MI_v_; -text: .text%__1cUjni_invoke_nonstatic6FpnHJNIEnv__pnJJavaValue_pnI_jobject_nLJNICallType_pnK_jmethodID_pnSJNI_ArgumentPusher_pnGThread__v_: jni.o; text: .text%__1cWflagsReg_long_EQdDNEOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cKciTypeFlowPflow_exceptions6MpnNGrowableArray4Cpn0AFBlock___pnNGrowableArray4CpnPciInstanceKlass___pn0ALStateVector__v_; text: .text%__1cXmembar_release_lockNodeIadr_type6kM_pknHTypePtr__; @@ -1820,7 +1745,6 @@ text: .text%__1cMPhaseChaitinZcompress_uf_map_for_nodes6M_v_; text: .text%__1cZPhaseConservativeCoalesceGverify6M_v_; text: .text%__1cHTypePtrFxmeet6kMpknEType__3_; text: .text%__1cSsafePoint_pollNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cJScopeDesc2t6MpknHnmethod_i_v_; text: .text%__1cOcompiledVFrame2t6MpknFframe_pknLRegisterMap_pnKJavaThread_pnJScopeDesc__v_; text: .text%__1cNSignatureInfoHdo_long6M_v_: bytecode.o; text: .text%__1cXvirtual_call_RelocationJfirst_oop6M_pC_; @@ -1844,7 +1768,6 @@ text: .text%__1cWflagsReg_long_LEGTOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cSThreadLocalStorageTpd_getTlsAccessMode6F_n0AQpd_tlsAccessMode__; text: .text%__1cOMacroAssemblerKget_thread6MpnMRegisterImpl__v_; text: .text%__1cLRethrowNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cRcmpFastUnlockNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIGraphKitNshared_unlock6MpnENode_2_v_; text: .text%__1cNSafePointNodeLpop_monitor6M_v_; text: .text%__1cLOptoRuntimebAcomplete_monitor_exit_Type6F_pknITypeFunc__; @@ -1877,7 +1800,6 @@ text: .text%__1cNobjArrayKlassIallocate6MipnGThread__pnPobjArrayOopDesc__; text: .text%__1cMeBCXRegLOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cRsubI_eReg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cIJumpDataPpost_initialize6MpnOBytecodeStream_pnRmethodDataOopDesc__v_; -text: .text%__1cMalloc_object6FpnH_jclass_pnGThread__pnPinstanceOopDesc__: jni.o; text: .text%__1cHOrINodeJideal_reg6kM_I_: classes.o; text: .text%__1cKTypeRawPtrEmake6FnHTypePtrDPTR__pk0_; text: .text%__1cKTypeAryPtrQcast_to_ptr_type6kMnHTypePtrDPTR__pknEType__; @@ -1900,7 +1822,6 @@ text: .text%__1cYinternal_word_RelocationLunpack_data6M_v_; text: .text%__1cMorI_eRegNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%jni_NewObject: jni.o; text: .text%__1cMTailCallNodeKmatch_edge6kMI_I_; -text: .text%__1cIciMethodRinstructions_size6M_i_; text: .text%__1cKStoreFNodeGOpcode6kM_i_; text: .text%__1cFStateO_sub_Op_StoreC6MpknENode__v_; text: .text%__1cFciEnvKcompile_id6M_I_; @@ -1939,7 +1860,6 @@ text: .text%__1cXmembar_release_lockNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__ text: .text%__1cXcmpL_reg_flags_LTGENodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cJloadBNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cMLinkResolverOresolve_method6FrnMmethodHandle_rnLKlassHandle_nSconstantPoolHandle_ipnGThread__v_; -text: .text%__1cNincI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJloadLNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cNandL_eRegNodeQuse_cisc_RegMask6M_v_; text: .text%__1cSciExceptionHandlerLcatch_klass6M_pnPciInstanceKlass__; @@ -1958,8 +1878,6 @@ text: .text%jni_NewGlobalRef: jni.o; text: .text%__1cKPSYoungGenRcapacity_in_bytes6kM_I_; text: .text%__1cMVirtualSpaceNreserved_size6kM_I_; text: .text%__1cHNTarjanIsetdepth6MIpI_v_; -text: .text%__1cOPhaseIdealLoopPbuild_loop_late6MrnJVectorSet_rnJNode_List_rnKNode_Stack_pk0_v_; -text: .text%__1cOPhaseIdealLoopQbuild_loop_early6MrnJVectorSet_rnJNode_List_rnKNode_Stack_pk0_v_; text: .text%__1cOPhaseIdealLoopKDominators6M_v_; text: .text%__1cHNTarjanDDFS6Fp0rnJVectorSet_pnOPhaseIdealLoop_pI_i_; text: .text%__1cOPhaseIdealLoopRinit_dom_lca_tags6M_v_; @@ -1994,7 +1912,6 @@ text: .text%__1cICmpDNodeGOpcode6kM_i_; text: .text%__1cLRuntimeStubbDpreserve_callee_argument_oops6MnFframe_pknLRegisterMap_pnKOopClosure__v_: codeBlob.o; text: .text%__1cNDispatchTableJset_entry6MirnKEntryPoint__v_; text: .text%__1cNmethodOopDescVclear_native_function6M_v_; -text: .text%__1cFframeLnmethods_do6M_v_; text: .text%__1cJLoadBNodeJideal_reg6kM_I_: classes.o; text: .text%__1cSSetupItableClosureEdoit6MpnMklassOopDesc_i_v_: klassVtable.o; text: .text%__1cLeAXRegIOperKin_RegMask6kMi_pknHRegMask__; @@ -2010,7 +1927,6 @@ text: .text%jni_DeleteGlobalRef: jni.o; text: .text%__1cOPhaseIdealLoopLdo_split_if6MpnENode__v_; text: .text%__1cRsubI_eReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNaddI_eRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cKTypeOopPtrSmake_from_constant6FpnIciObject__pk0_; text: .text%__1cMURShiftLNodeLbottom_type6kM_pknEType__: classes.o; text: .text%jni_GetObjectArrayElement: jni.o; text: .text%__1cQSystemDictionaryRpreloaded_oops_do6FpnKOopClosure__v_; @@ -2023,7 +1939,6 @@ text: .text%__1cQVMOperationQdDueueHoops_do6MpnKOopClosure__v_; text: .text%__1cKManagementHoops_do6FpnKOopClosure__v_; text: .text%__1cSObjectSynchronizerHoops_do6FpnKOopClosure__v_; text: .text%__1cKJNIHandlesHoops_do6FpnKOopClosure__v_; -text: .text%__1cIVMThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cbGJvmtiVMObjectAllocEventCollectorXoops_do_for_all_threads6FpnKOopClosure__v_; text: .text%__1cQPlaceholderTableHoops_do6MpnKOopClosure__v_; text: .text%__1cKJNIHandlesMweak_oops_do6FpnRBoolObjectClosure_pnKOopClosure__v_; @@ -2040,7 +1955,6 @@ text: .text%__1cIAndLNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%jio_vsnprintf; text: .text%__1cLRethrowNodeEhash6kM_I_: classes.o; text: .text%__1cWCallLeafNoFPDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cRsalI_eReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cRsalI_eReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cJAssemblerDjmp6MnHAddress__v_; text: .text%jio_snprintf; @@ -2057,8 +1971,6 @@ text: .text%__1cRLowMemoryDetectorRdetect_low_memory6F_v_; text: .text%__1cbAPSGCAdaptivePolicyCountersbBupdate_counters_from_policy6M_v_; text: .text%__1cWThreadLocalAllocBufferQresize_all_tlabs6F_v_; text: .text%__1cUParallelScavengeHeapbFaccumulate_statistics_all_tlabs6M_v_; -text: .text%__1cPGCMemoryManagerIgc_begin6M_v_; -text: .text%__1cPGCMemoryManagerGgc_end6M_v_; text: .text%__1cNMemoryServiceStrack_memory_usage6F_v_; text: .text%__1cXTraceMemoryManagerStats2T6M_v_; text: .text%__1cQSystemDictionaryHoops_do6FpnKOopClosure__v_; @@ -2094,7 +2006,6 @@ text: .text%__1cORuntimeServiceWrecord_safepoint_begin6F_v_; text: .text%__1cSObjectSynchronizerVdeflate_idle_monitors6F_v_; text: .text%__1cJloadFNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMCounterDecayFdecay6F_v_; -text: .text%__1cONMethodSweeperFsweep6F_v_; text: .text%__1cRInlineCacheBufferUupdate_inline_caches6F_v_; text: .text%__1cUSafepointSynchronizeDend6F_v_; text: .text%__1cORuntimeServiceUrecord_safepoint_end6F_v_; @@ -2241,7 +2152,6 @@ text: .text%__1cFStateM_sub_Op_ConL6MpknENode__v_; text: .text%__1cSmembar_acquireNodeIadr_type6kM_pknHTypePtr__; text: .text%__1cHRetNodeFreloc6kM_i_; text: .text%__1cIConFNodeGOpcode6kM_i_; -text: .text%__1cLRuntimeStubHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cJCodeCacheNalive_nmethod6FpnICodeBlob__pnHnmethod__; text: .text%__1cQLibraryIntrinsicIgenerate6MpnIJVMState__2_; text: .text%__1cOcompP_eRegNodeLout_RegMask6kM_rknHRegMask__; @@ -2249,9 +2159,7 @@ text: .text%__1cFStateM_sub_Op_CmpL6MpknENode__v_; text: .text%__1cKCompiledICSset_ic_destination6MpC_v_; text: .text%__1cLConvL2INodeJideal_reg6kM_I_: classes.o; text: .text%__1cZInterpreterMacroAssemblerNdispatch_next6MnITosState_i_v_; -text: .text%__1cPshlI_eReg_1NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cSmembar_releaseNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cNdecI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNandL_eRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNdecI_eRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cJLoadDNodeGOpcode6kM_i_; @@ -2267,13 +2175,9 @@ text: .text%__1cXmembar_acquire_lockNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRxorI_eReg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cFStateR_sub_Op_SafePoint6MpknENode__v_; text: .text%__1cMciMethodDataStrap_recompiled_at6MpnLProfileData__i_; -text: .text%__1cSsafePoint_pollNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cSsafePoint_pollNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cSsafePoint_pollNodeFreloc6kM_i_; -text: .text%__1cKCodeBuffer2t6MpCi_v_; text: .text%__1cNandI_eRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cRandI_eReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cHi2sNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cHi2sNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cFStateL_sub_Op_OrI6MpknENode__v_; text: .text%JVM_GetClassNameUTF; @@ -2311,14 +2215,12 @@ text: .text%__1cTshrL_eReg_32_63NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cLOptoRuntimebBcomplete_monitor_enter_Type6F_pknITypeFunc__; text: .text%__1cIMaxINodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cFStateQ_sub_Op_FastLock6MpknENode__v_; -text: .text%__1cPcmpFastLockNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIGraphKitLshared_lock6MpnENode__pnMFastLockNode__; text: .text%__1cQjava_lang_ThreadGthread6FpnHoopDesc__pnKJavaThread__; text: .text%__1cEUTF8Ounicode_length6Fpkc_i_; text: .text%__1cPCallRuntimeNodeGOpcode6kM_i_; text: .text%__1cFParseFBlockMadd_new_path6M_i_; text: .text%JVM_FindClassFromClass; -text: .text%__1cOmangle_name_on6FpnMoutputStream_pnNsymbolOopDesc_ii_v_: nativeLookup.o; text: .text%__1cIMulINodeGmul_id6kM_pknEType__: classes.o; text: .text%__1cPshlI_eReg_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cbDjava_lang_reflect_ConstructorFclazz6FpnHoopDesc__2_; @@ -2327,8 +2229,6 @@ text: .text%__1cbDjava_lang_reflect_ConstructorPparameter_types6FpnHoopDesc__2_; text: .text%__1cbDjava_lang_reflect_ConstructorEslot6FpnHoopDesc__i_; text: .text%__1cLConvI2LNodeJideal_reg6kM_I_: classes.o; text: .text%__1cKReflectionSinvoke_constructor6FpnHoopDesc_nOobjArrayHandle_pnGThread__2_; -text: .text%__1cMorI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cOmangle_name_on6FpnMoutputStream_pnNsymbolOopDesc__v_: nativeLookup.o; text: .text%__1cMtlsLoadPNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cYmulI_imm_RShift_highNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cFParseFBlockNstack_type_at6kMi_pknEType__; @@ -2361,12 +2261,10 @@ text: .text%__1cQjava_lang_StringXcreate_oop_from_unicode6FpHipnGThread__pnHoopD text: .text%__1cJAssemblerEmovl6MpnMRegisterImpl_i_v_; text: .text%__1cXmembar_acquire_lockNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMMergeMemNodeIadr_type6kM_pknHTypePtr__: memnode.o; -text: .text%__1cITypeLongFwiden6kMpknEType__3_; text: .text%__1cIModINodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cQjava_lang_StringTcreate_oop_from_str6FpkcpnGThread__pnHoopDesc__; text: .text%__1cKoopFactoryNnew_charArray6FpkcpnGThread__pnQtypeArrayOopDesc__; text: .text%__1cScompP_mem_eRegNodeFreloc6kM_i_; -text: .text%__1cMadjust_check6FpnENode_11iipnMPhaseIterGVN__v_: ifnode.o; text: .text%__1cNtestU_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateP_sub_Op_ConvI2L6MpknENode__v_; text: .text%__1cJScopeDescGsender6kM_p0_; @@ -2443,7 +2341,6 @@ text: .text%__1cNmaxI_eRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateM_sub_Op_AddL6MpknENode__v_; text: .text%__1cJAssemblerEsubl6MpnMRegisterImpl_i_v_; text: .text%__1cFForteNregister_stub6FpkcpC3_v_; -text: .text%__1cFVTuneNregister_stub6FpkcpC3_v_; text: .text%__1cENodeEgetd6kM_d_; text: .text%__1cFStateM_sub_Op_AndL6MpknENode__v_; text: .text%__1cKConv2BNodeGOpcode6kM_i_; @@ -2483,16 +2380,13 @@ text: .text%__1cNCompileBrokerScollect_statistics6FpnOCompilerThread_nMelapsedTi text: .text%__1cLConvI2FNodeGOpcode6kM_i_; text: .text%__1cQComputeCallStackIdo_short6M_v_: generateOopMap.o; text: .text%__1cICodeHeapMinsert_after6MpnJFreeBlock_2_v_; -text: .text%__1cHnmFlagsFclear6M_v_; text: .text%__1cHnmethodQcopy_scopes_data6MpCi_v_; text: .text%__1cVExceptionHandlerTableHcopy_to6MpnHnmethod__v_; text: .text%__1cHnmethod2n6FIi_pv_; text: .text%__1cWImplicitExceptionTableHcopy_to6MpnHnmethod__v_; -text: .text%__1cFVTuneOcreate_nmethod6FpnHnmethod__v_; text: .text%__1cFciEnvVnum_inlined_bytecodes6kM_i_; text: .text%__1cJCodeCacheGcommit6FpnICodeBlob__v_; text: .text%__1cYDebugInformationRecorderHcopy_to6MpnHnmethod__v_; -text: .text%__1cLOopRecorderHcopy_to6MpnICodeBlob__v_; text: .text%__1cQorI_eReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cHCompileUremove_useless_nodes6MrnQUnique_Node_List__v_; text: .text%__1cIciMethodRbuild_method_data6MnMmethodHandle__v_; @@ -2511,7 +2405,6 @@ text: .text%__1cIPhaseCCPHanalyze6M_v_; text: .text%__1cIPhaseCCPMdo_transform6M_v_; text: .text%__1cHCompileNreturn_values6MpnIJVMState__v_; text: .text%__1cKInlineTreeWbuild_inline_tree_root6F_p0_; -text: .text%__1cbAfinal_graph_reshaping_walk6FrnKNode_Stack_pnENode_rnUFinal_Reshape_Counts__v_: compile.o; text: .text%__1cIPhaseCCPJtransform6MpnENode__2_; text: .text%__1cHCompileLFinish_Warm6M_v_; text: .text%__1cMPhaseIterGVN2t6Mp0_v_; @@ -2535,7 +2428,6 @@ text: .text%__1cXSignatureHandlerLibraryKinitialize6F_v_; text: .text%__1cXSignatureHandlerLibraryDadd6FnMmethodHandle__v_; text: .text%__1cIAddFNodeGOpcode6kM_i_; text: .text%__1cJAssemblerFffree6Mi_v_; -text: .text%__1cKExceptionsG_throw6FpnGThread_pkcinGHandle__v_; text: .text%__1cQjava_lang_StringPcreate_from_str6FpkcpnGThread__nGHandle__; text: .text%__1cOGenerateOopMapIppop_any6Mi_v_; text: .text%__1cXroundDouble_mem_regNodeLout_RegMask6kM_rknHRegMask__; @@ -2551,7 +2443,6 @@ text: .text%__1cCosLelapsedTime6F_d_; text: .text%__1cKJavaThreadZsecurity_get_caller_class6Mi_pnMklassOopDesc__; text: .text%jni_GetStringUTFChars: jni.o; text: .text%jni_ReleaseStringUTFChars; -text: .text%__1cNloadConI0NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cSInterpreterRuntimeXthrow_pending_exception6FpnKJavaThread__v_; text: .text%__1cXcmpL_reg_flags_LEGTNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cOClearArrayNodeIIdentity6MpnOPhaseTransform__pnENode__; @@ -2572,18 +2463,14 @@ text: .text%__1cFParsebLincrement_and_test_invocation_counter6Mi_v_; text: .text%__1cQsalI_eReg_CLNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cSshrL_eReg_1_31NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cJleaP8NodeIpipeline6kM_pknIPipeline__; -text: .text%__1cXcmpL_reg_flags_LTGENodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cNcmpL_LTGENodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cFParsePmerge_exception6Mi_v_; text: .text%__1cFStateS_sub_Op_ClearArray6MpknENode__v_; text: .text%__1cMrep_stosNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cMrep_stosNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOcompI_eRegNodeIpipeline6kM_pknIPipeline__; text: .text%__1cFTypeFEmake6Ff_pk0_; text: .text%__1cKstoreLNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cSInterpreterRuntimeOmultianewarray6FpnKJavaThread_pi_v_; text: .text%__1cIDivINodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cPmethodDataKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cLStrCompNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cXJNI_ArgumentPusherVaArgHget_int6M_v_: jni.o; text: .text%__1cNtestP_regNodeIpipeline6kM_pknIPipeline__; @@ -2602,11 +2489,8 @@ text: .text%__1cJJavaCallsMcall_special6FpnJJavaValue_nGHandle_nLKlassHandle_nMs text: .text%__1cFParseLdo_newarray6MnJBasicType__v_; text: .text%__1cSsafePoint_pollNodeIpipeline6kM_pknIPipeline__; text: .text%__1cKstoreLNodeFreloc6kM_i_; -text: .text%__1cGThreadLnmethods_do6M_v_; text: .text%__1cPRoundDoubleNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cCosTnative_java_library6F_pv_; -text: .text%__1cQjava_lang_StringFvalue6FpnHoopDesc__pnQtypeArrayOopDesc__; -text: .text%__1cQjava_lang_StringGoffset6FpnHoopDesc__i_; text: .text%__1cIModLNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cScompP_eReg_immNodeIpipeline6kM_pknIPipeline__; text: .text%__1cQjava_lang_StringScreate_from_symbol6FnMsymbolHandle_pnGThread__nGHandle__; @@ -2615,13 +2499,11 @@ text: .text%__1cRmulI_eReg_immNodeQuse_cisc_RegMask6M_v_; text: .text%__1cCosYprint_jni_name_suffix_on6FpnMoutputStream_i_v_; text: .text%__1cCosYprint_jni_name_prefix_on6FpnMoutputStream_i_v_; text: .text%__1cJJavaCallsMcall_special6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_53pnGThread__v_; -text: .text%__1cVlookup_special_native6Fpc_pC_: nativeLookup.o; text: .text%__1cPciObjArrayKlassGloader6M_pnHoopDesc__: ciObjArrayKlass.o; text: .text%__1cPDictionaryEntryVadd_protection_domain6MpnHoopDesc__v_; text: .text%__1cRxorI_eReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQSystemDictionarybAvalidate_protection_domain6FnTinstanceKlassHandle_nGHandle_2pnGThread__v_; text: .text%__1cKDictionaryVadd_protection_domain6MiInTinstanceKlassHandle_nGHandle_2pnGThread__v_; -text: .text%__1cPshrI_eReg_1NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cKarrayKlassbBcomplete_create_array_klass6FnQarrayKlassHandle_nLKlassHandle_pnGThread__v_; text: .text%__1cKarrayKlassXbase_create_array_klass6FrknKKlass_vtbl_inLKlassHandle_pnGThread__nQarrayKlassHandle__; text: .text%__1cIPerfLong2t6MnJCounterNS_pkcnIPerfDataFUnits_n0CLVariability__v_; @@ -2642,7 +2524,6 @@ text: .text%__1cPfieldDescriptorSlong_initial_value6kM_x_; text: .text%__1cRsubI_eReg_memNodeFreloc6kM_i_; text: .text%__1cKstoreBNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cJLoadPNodeMstore_Opcode6kM_i_: classes.o; -text: .text%__1cKJavaThreadLnmethods_do6M_v_; text: .text%__1cXvirtual_call_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; text: .text%__1cNcmovI_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cZCallDynamicJavaDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -2651,17 +2532,14 @@ text: .text%__1cOGenerateOopMapXreplace_all_CTS_matches6MnNCellTypeState_1_v_; text: .text%__1cNstoreImmINodeFreloc6kM_i_; text: .text%__1cNobjArrayKlassYcompute_secondary_supers6MipnGThread__pnPobjArrayOopDesc__; text: .text%__1cRsarI_eReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cRsarI_eReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cWCallLeafNoFPDirectNodeFreloc6kM_i_; text: .text%__1cNobjArrayKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: objArrayKlass.o; text: .text%jni_GetStringCritical: jni.o; text: .text%jni_ReleaseStringCritical: jni.o; text: .text%__1cPciObjArrayKlass2t6MnLKlassHandle__v_; -text: .text%__1cPsarI_eReg_1NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cPsarI_eReg_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPconvF2D_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cPPerfDataManagerMcounter_name6Fpkc2_pc_; -text: .text%__1cRaddL_eReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cHCompileSrethrow_exceptions6MpnIJVMState__v_; text: .text%__1cLRethrowNodeJideal_reg6kM_I_: classes.o; text: .text%__1cURethrowExceptionNodeLout_RegMask6kM_rknHRegMask__; @@ -2682,9 +2560,7 @@ text: .text%__1cFParseTprofile_switch_case6Mi_v_; text: .text%__1cKJavaThreadLgc_epilogue6M_v_; text: .text%__1cFParseOmerge_new_path6Mi_v_; text: .text%__1cFParseSjump_switch_ranges6MpnENode_pnLSwitchRange_4i_v_; -text: .text%__1cNxorI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%jni_NewByteArray: jni.o; -text: .text%__1cNmulL_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cMstoreSSINodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKReflectionTget_parameter_types6FnMmethodHandle_ippnHoopDesc_pnGThread__nOobjArrayHandle__; text: .text%__1cNmethodOopDescbGresolved_checked_exceptions_impl6Fp0pnGThread__nOobjArrayHandle__; @@ -2698,13 +2574,11 @@ text: .text%__1cPstoreImmI16NodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cOcmpD_cc_P6NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRandI_eReg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cNObjectMonitorHRecycle6M_v_; -text: .text%__1cNandL_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cFBlockNset_next_call6MpnENode_rnJVectorSet_rnLBlock_Array__v_; text: .text%__1cJloadSNodeIpipeline6kM_pknIPipeline__; text: .text%__1cSInterpreterRuntimeZSignatureHandlerGeneratorEmove6Mii_v_; text: .text%__1cENode2t6Mp0111111_v_; text: .text%__1cFStateP_sub_Op_RShiftL6MpknENode__v_; -text: .text%__1cMloadConLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIAddDNodeGOpcode6kM_i_; text: .text%__1cNmodL_eRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKarrayKlassTallocate_arrayArray6MiipnGThread__pnPobjArrayOopDesc__; @@ -2729,8 +2603,6 @@ text: .text%__1cPshrI_eReg_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%jni_GetFieldID: jni.o; text: .text%jni_IsAssignableFrom: jni.o; text: .text%__1cNnegI_eRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cNnegI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cSobjArrayKlassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cFParseWcheck_interpreter_type6MpnENode_pknEType_rpnNSafePointNode__2_; text: .text%__1cJAssemblerEaddl6MnHAddress_i_v_; text: .text%__1cTsarL_eReg_32_63NodeLout_RegMask6kM_rknHRegMask__; @@ -2745,9 +2617,7 @@ text: .text%__1cFStateX_sub_Op_CompareAndSwapL6MpknENode__v_; text: .text%__1cSloadL_volatileNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cNtestU_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cSloadL_volatileNodeFreloc6kM_i_; -text: .text%__1cTcompareAndSwapLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cISubLNodeGadd_id6kM_pknEType__: classes.o; -text: .text%__1cFframeVnmethods_code_blob_do6M_v_; text: .text%__1cOPhaseIdealLoopUpeeled_dom_test_elim6MpnNIdealLoopTree_rnJNode_List__v_; text: .text%__1cJAssemblerDhlt6M_v_; text: .text%__1cYcmpL_zero_flags_LEGTNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -2761,11 +2631,8 @@ text: .text%jni_SetBooleanField: jni.o; text: .text%__1cTconvD2I_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateT_sub_Op_ThreadLocal6MpknENode__v_; text: .text%__1cNTemplateTableDdef6FnJBytecodesECode_inITosState_3pF_vc_v_; -text: .text%__1cMtlsLoadPNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIciObject2t6MpnHciKlass__v_; text: .text%__1cSInterpreterRuntimeZSignatureHandlerGeneratorDbox6Mii_v_; -text: .text%__1cKsplit_once6FpnMPhaseIterGVN_pnENode_333_v_: cfgnode.o; -text: .text%__1cYmulI_imm_RShift_highNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cPRoundDoubleNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cKloadUBNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMURShiftLNodeJideal_reg6kM_I_: classes.o; @@ -2775,8 +2642,6 @@ text: .text%__1cPClassFileParserbBcheck_illegal_static_method6FnTinstanceKlassHa text: .text%__1cGciType2t6MpnHciKlass__v_; text: .text%__1cHciKlass2t6MpnIciSymbol_p0_v_; text: .text%__1cIciMethodRinterpreter_entry6M_pC_; -text: .text%__1cXjvm_define_class_common6FpnHJNIEnv__pkcpnI_jobject_pkWi53pnGThread__pnH_jclass__: jvm.o; -text: .text%__1cQSystemDictionaryTresolve_from_stream6FnMsymbolHandle_nGHandle_2pnPClassFileStream_pnGThread__pnMklassOopDesc__; text: .text%__1cUciInstanceKlassKlassEmake6F_p0_; text: .text%__1cLLShiftLNodeJideal_reg6kM_I_: classes.o; text: .text%__1cIciSymbolHbyte_at6Mi_i_; @@ -2785,12 +2650,10 @@ text: .text%__1cZCallDynamicJavaDirectNodeKmethod_set6Mi_v_; text: .text%__1cIModINodeJideal_reg6kM_I_: classes.o; text: .text%__1cSTailCalljmpIndNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cXMachCallDynamicJavaNodePret_addr_offset6M_i_; -text: .text%__1cNcmpL_EQdDNENodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOGenerateOopMapOdo_monitorexit6Mi_v_; text: .text%__1cOGenerateOopMapLmonitor_pop6M_nNCellTypeState__; text: .text%__1cJJavaCallsLcall_static6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnRJavaCallArguments_pnGThread__v_; text: .text%__1cOmulIS_eRegNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cSalign_to_page_size6FI_I_: heap.o; text: .text%__1cKExceptionsK_throw_msg6FpnGThread_pkcinMsymbolHandle_4nGHandle_6_v_; text: .text%__1cKExceptionsK_throw_msg6FpnGThread_pkcipnNsymbolOopDesc_4_v_; text: .text%__1cPciInstanceKlassYprotection_domain_handle6M_pnI_jobject__; @@ -2810,7 +2673,6 @@ text: .text%__1cJMarkSweepSFollowStackClosureHdo_void6M_v_: markSweep.o; text: .text%__1cPICStubInterfaceRcode_size_to_size6kMi_i_: icBuffer.o; text: .text%__1cPICStubInterfaceKinitialize6MpnEStub_i_v_: icBuffer.o; text: .text%__1cSleaP_eReg_immINodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNcmpL_LEGTNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cFStateQ_sub_Op_URShiftL6MpknENode__v_; text: .text%__1cIModLNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cJAssemblerEcmpl6MpnMRegisterImpl_i_v_; @@ -2844,10 +2706,8 @@ text: .text%__1cIMulINodeKmul_opcode6kM_i_: classes.o; text: .text%__1cNsubL_eRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cVCallRuntimeDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cODeoptimizationVtrap_state_has_reason6Fii_i_; -text: .text%__1cNaddL_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJloadBNodeIpipeline6kM_pknIPipeline__; text: .text%__1cRmulI_eReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cS__ieee754_rem_pio26Fdpd_i_: sharedRuntimeTrig.o; text: .text%__1cSThreadLocalStorageNpd_set_thread6FpnGThread__v_; text: .text%__1cSThreadLocalStorageKset_thread6FpnGThread__v_; text: .text%__1cSThreadLocalStoragebBget_thread_via_cache_slowly6FIi_pnGThread__; @@ -2870,7 +2730,6 @@ text: .text%__1cICmpDNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cIDivDNodeGOpcode6kM_i_; text: .text%__1cHCompileQgrow_alias_types6M_v_; text: .text%JVM_GetClassCPTypes; -text: .text%__1cUverify_byte_codes_fn6F_pv_: verifier.o; text: .text%JVM_GetClassMethodsCount; text: .text%JVM_GetClassCPEntriesCount; text: .text%JVM_GetClassFieldsCount; @@ -2878,7 +2737,6 @@ text: .text%__1cKstoreBNodeFreloc6kM_i_; text: .text%__1cPconvI2F_SSFNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQjava_lang_ThreadKset_thread6FpnHoopDesc_pnKJavaThread__v_; text: .text%__1cMdecI_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cPconvI2L_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOMacroAssemblerKverify_FPU6Mipkc_v_; text: .text%__1cJLoadFNodeJideal_reg6kM_I_: classes.o; text: .text%__1cMloadConDNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -2920,7 +2778,6 @@ text: .text%__1cRandL_eReg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cMloadConFNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateM_sub_Op_MinI6MpknENode__v_; text: .text%__1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_5pnGThread__v_; -text: .text%__1cNminI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cFMutex2T6M_v_; text: .text%lwp_mutex_destroy: os_solaris.o; text: .text%__1cHMonitor2T6M_v_; @@ -2942,7 +2799,6 @@ text: .text%__1cXroundDouble_mem_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__ text: .text%__1cJCodeCacheFfirst6F_pnICodeBlob__; text: .text%__1cNaddP_eRegNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cICodeHeapLfirst_block6kM_pnJHeapBlock__; -text: .text%__1cXcmpL_reg_flags_LEGTNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cPciObjectFactoryPinsert_non_perm6Mrpn0ANNonPermObject_pnHoopDesc_pnIciObject__v_; text: .text%__1cKloadUBNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cISubDNodeGOpcode6kM_i_; @@ -2951,7 +2807,6 @@ text: .text%__1cSObjectSynchronizerGnotify6FnGHandle_pnGThread__v_; text: .text%__1cOcmpD_cc_P6NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLConvD2FNodeGOpcode6kM_i_; text: .text%__1cTmembar_volatileNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cSshrL_eReg_1_31NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%JVM_MonitorNotify; text: .text%__1cFParseNdo_instanceof6M_v_; text: .text%__1cJAssemblerEshrl6MpnMRegisterImpl_i_v_; @@ -2967,7 +2822,6 @@ text: .text%__1cYjava_lang_reflect_MethodWset_annotation_default6FpnHoopDesc_2_v text: .text%__1cZCallDynamicJavaDirectNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIMulFNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cFStateN_sub_Op_LoadF6MpknENode__v_; -text: .text%__1cNandI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cWPredictedCallGeneratorIgenerate6MpnIJVMState__2_; text: .text%__1cYjava_lang_reflect_MethodGcreate6FpnGThread__nGHandle__; text: .text%__1cYjava_lang_reflect_MethodJset_clazz6FpnHoopDesc_2_v_; @@ -2985,7 +2839,6 @@ text: .text%__1cINegDNodeGOpcode6kM_i_; text: .text%__1cNCallGeneratorRfor_uncommon_trap6FpnIciMethod_nODeoptimizationLDeoptReason_n0CLDeoptAction__p0_; text: .text%__1cNmodI_eRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cFStateP_sub_Op_LShiftL6MpknENode__v_; -text: .text%__1cNmodI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cLConvI2DNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cIGraphKitJpush_pair6MpnENode__v_: callGenerator.o; text: .text%__1cZUncommonTrapCallGeneratorIgenerate6MpnIJVMState__2_; @@ -2995,9 +2848,7 @@ text: .text%__1cJAssemblerFfld_d6MnHAddress__v_; text: .text%__1cJloadFNodeFreloc6kM_i_; text: .text%__1cMincI_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cVCallRuntimeDirectNodeKmethod_set6Mi_v_; -text: .text%__1cRaddI_eReg_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOGenerateOopMapKinit_state6M_v_; -text: .text%__1cNSafepointBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cOGenerateOopMapTmark_reachable_code6M_v_; text: .text%__1cOGenerateOopMapPinitialize_vars6M_v_; text: .text%__1cNinstanceKlassSregister_finalizer6FpnPinstanceOopDesc_pnGThread__2_; @@ -3013,7 +2864,6 @@ text: .text%__1cMmulD_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQjava_lang_SystemSin_offset_in_bytes6F_i_; text: .text%__1cJAssemblerEaddl6MpnMRegisterImpl_nHAddress__v_; text: .text%__1cQjava_lang_SystemTout_offset_in_bytes6F_i_; -text: .text%__1cIBytecodeIset_code6MnJBytecodesECode__v_; text: .text%__1cNmulI_eRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIRetTableRcompute_ret_table6MnMmethodHandle__v_; text: .text%__1cOGenerateOopMapLcompute_map6MpnGThread__v_; @@ -3032,7 +2882,6 @@ text: .text%__1cQjava_lang_ThreadMset_priority6FpnHoopDesc_nOThreadPriority__v_; text: .text%__1cIMulDNodeImul_ring6kMpknEType_3_3_; text: .text%__1cOmulF24_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cOGenerateOopMapPdo_monitorenter6Mi_v_; -text: .text%__1cRjni_invoke_static6FpnHJNIEnv__pnJJavaValue_pnI_jobject_nLJNICallType_pnK_jmethodID_pnSJNI_ArgumentPusher_pnGThread__v_: jni.o; text: .text%__1cOjmpLoopEndNodeJlabel_set6MrnFLabel_I_v_; text: .text%__1cOjmpLoopEndNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cOGenerateOopMapMmonitor_push6MnNCellTypeState__v_; @@ -3054,7 +2903,6 @@ text: .text%__1cNinstanceKlassYremove_dependent_nmethod6MpnHnmethod__v_; text: .text%__1cNsubI_eRegNodeIpipeline6kM_pknIPipeline__; text: .text%__1cTcmovII_reg_LEGTNodeQuse_cisc_RegMask6M_v_; text: .text%__1cJAssemblerFfld_s6MnHAddress__v_; -text: .text%__1cVscale_to_lwp_priority6Fiii_i_: os_solaris.o; text: .text%__1cNxorI_eRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cJMemRegionMintersection6kMk0_0_; text: .text%__1cMincI_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -3098,7 +2946,6 @@ text: .text%jni_NewObjectArray: jni.o; text: .text%__1cKCompiledICKcached_oop6kM_pnHoopDesc__; text: .text%__1cFStateM_sub_Op_MulI6MpknENode__v_; text: .text%__1cCosPpd_start_thread6FpnGThread__v_; -text: .text%__1cNsubL_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cPRoundDoubleNodeJideal_reg6kM_I_: classes.o; text: .text%__1cXjava_lang_reflect_FieldIset_slot6FpnHoopDesc_i_v_; text: .text%__1cKReflectionInew_type6FnMsymbolHandle_nLKlassHandle_pnGThread__nGHandle__; @@ -3144,9 +2991,7 @@ text: .text%jni_GetFloatArrayRegion: jni.o; text: .text%__1cKJavaThreadDrun6M_v_; text: .text%__1cKJavaThreadRthread_main_inner6M_v_; text: .text%__1cKReflectionbFbasic_type_mirror_to_basic_type6FpnHoopDesc_pnGThread__nJBasicType__; -text: .text%__1cM__kernel_cos6Fdd_d_: sharedRuntimeTrig.o; text: .text%__1cJAssemblerFcmovl6Mn0AJCondition_pnMRegisterImpl_3_v_; -text: .text%__1cM__kernel_sin6Fddi_d_: sharedRuntimeTrig.o; text: .text%__1cSleaP_eReg_immINodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cOPhaseIdealLoopJclone_iff6MpnHPhiNode_pnNIdealLoopTree__pnIBoolNode__; text: .text%__1cGThreadFstart6Fp0_v_; @@ -3154,7 +2999,6 @@ text: .text%__1cNSharedRuntimeEdsin6Fd_d_; text: .text%__1cNSharedRuntimeEdcos6Fd_d_; text: .text%jni_CallStaticVoidMethod: jni.o; text: .text%__1cPPerfDataManagerTcreate_long_counter6FnJCounterNS_pkcnIPerfDataFUnits_xpnGThread__pnPPerfLongCounter__; -text: .text%__1cSshlL_eReg_1_31NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNsymbolOopDescWas_klass_external_name6kM_pkc_; text: .text%__1cNdecI_eRegNodeIpipeline6kM_pknIPipeline__; text: .text%__1cTconvF2I_reg_regNodeLout_RegMask6kM_rknHRegMask__; @@ -3165,7 +3009,6 @@ text: .text%JVM_IsArrayClass; text: .text%__1cHTypePtrFxdual6kM_pknEType__; text: .text%__1cSMachBreakpointNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cQshrI_eReg_CLNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cRmulI_eReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%JVM_GetClassName; text: .text%__1cSsarL_eReg_1_31NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cLStringTableGintern6FpkcpnGThread__pnHoopDesc__; @@ -3184,7 +3027,6 @@ text: .text%__1cJArrayDataKcell_count6M_i_: ciMethodData.o; text: .text%JVM_Open; text: .text%__1cQjava_lang_ThreadIpriority6FpnHoopDesc__nOThreadPriority__; text: .text%__1cQjava_lang_ThreadJstackSize6FpnHoopDesc__x_; -text: .text%__1cYcmpL_zero_flags_EQdDNENodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNObjectMonitorJnotifyAll6MpnGThread__v_; text: .text%__1cNPerfByteArray2t6MnJCounterNS_pkcnIPerfDataFUnits_n0CLVariability_i_v_; text: .text%JVM_StartThread; @@ -3192,9 +3034,7 @@ text: .text%__1cQComputeCallStackIdo_array6Mii_v_: generateOopMap.o; text: .text%__1cMthread_entry6FpnKJavaThread_pnGThread__v_: jvm.o; text: .text%__1cOMacroAssemblerKnull_check6MpnMRegisterImpl_i_v_; text: .text%__1cGICStubLdestination6kM_pC_; -text: .text%__1cYcmpL_zero_flags_LEGTNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cLConvD2INodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cRxorI_eReg_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cRInlineCacheBufferVic_buffer_entry_point6FpC_1_; text: .text%__1cKJavaThreadHprepare6MpnI_jobject_nOThreadPriority__v_; text: .text%jni_GetStaticObjectField: jni.o; @@ -3250,13 +3090,11 @@ text: .text%__1cFStateO_sub_Op_StoreF6MpknENode__v_; text: .text%__1cQaddD_reg_immNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cTsarL_eReg_32_63NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%jni_CallObjectMethod: jni.o; -text: .text%__1cNaddP_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNaddP_eRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLOptoRuntimeMrethrow_Type6F_pknITypeFunc__; text: .text%__1cMstoreSSPNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cRandI_eReg_memNodeFreloc6kM_i_; text: .text%__1cRCardTableModRefBSPclear_MemRegion6MnJMemRegion__v_; -text: .text%__1cHThreadsHoops_do6FpnKOopClosure__v_; text: .text%__1cRInlineCacheBufferLnew_ic_stub6F_pnGICStub__; text: .text%__1cRInlineCacheBufferWcreate_transition_stub6FpnKCompiledIC_pnHoopDesc_pC_v_; text: .text%__1cRInlineCacheBufferXassemble_ic_buffer_code6FpCpnHoopDesc_1_v_; @@ -3276,7 +3114,6 @@ text: .text%__1cMsubD_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%JVM_MonitorNotifyAll; text: .text%__1cLConvI2FNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cKConv2BNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cNmaxI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cSvframeArrayElementDbci6kM_i_; text: .text%__1cIDivDNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cMloadConFNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -3289,15 +3126,12 @@ text: .text%__1cXJNI_ArgumentPusherVaArgJget_float6M_v_: jni.o; text: .text%__1cTcmovII_reg_LTGENodeQuse_cisc_RegMask6M_v_; text: .text%__1cSPerfStringConstant2t6MnJCounterNS_pkc3_v_; text: .text%__1cIMulDNodeGmul_id6kM_pknEType__: classes.o; -text: .text%__1cQorI_eReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cPPerfDataManagerWcreate_string_constant6FnJCounterNS_pkc3pnGThread__pnSPerfStringConstant__; text: .text%__1cOMacroAssemblerFleave6M_v_; text: .text%JVM_GetInheritedAccessControlContext; text: .text%JVM_NativePath; text: .text%__1cQjava_lang_ThreadbGinherited_access_control_context6FpnHoopDesc__2_; text: .text%__1cVLoaderConstraintTableJnew_entry6MIpnNsymbolOopDesc_pnMklassOopDesc_ii_pnVLoaderConstraintEntry__; -text: .text%__1cVloadConL_low_onlyNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cQsalI_eReg_CLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cFStateT_sub_Op_CallRuntime6MpknENode__v_; text: .text%__1cCosXnon_memory_address_word6F_pc_; text: .text%__1cQsalI_eReg_CLNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -3307,7 +3141,6 @@ text: .text%__1cNandI_eRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cVCallRuntimeDirectNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cOmulF24_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cRandL_eReg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cTshrL_eReg_32_63NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOaddF24_regNodeQuse_cisc_RegMask6M_v_; text: .text%__1cNcmovP_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cKCompiledICOset_cached_oop6MpnHoopDesc__v_; @@ -3319,7 +3152,6 @@ text: .text%__1cKCompiledICMstub_address6kM_pC_; text: .text%__1cZInterpreterMacroAssemblerUupdate_mdp_by_offset6MpnMRegisterImpl_i_v_; text: .text%__1cKstoreFNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cSaddD_reg_roundNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cMdecI_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cPciInstanceKlassLjava_mirror6M_pnKciInstance__; text: .text%__1cISubDNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cKReflectionTunbox_for_primitive6FpnHoopDesc_pnGjvalue_pnGThread__nJBasicType__; @@ -3342,13 +3174,11 @@ text: .text%__1cLConvI2DNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cQsalL_eReg_CLNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cNSafePointNodeQpeek_monitor_obj6kM_pnENode__; text: .text%__1cVcompiledICHolderKlassToop_adjust_pointers6MpnHoopDesc__i_; -text: .text%__1cHnmethodbAmake_not_entrant_or_zombie6Mi_v_; text: .text%__1cPoldgetTimeNanos6F_x_: os_solaris.o; text: .text%__1cVcompiledICHolderKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cIDivLNodeJideal_reg6kM_I_: classes.o; text: .text%__1cNTemplateTableDdef6FnJBytecodesECode_inITosState_3pFn0AJOperation__v4_v_; text: .text%__1cYinternal_word_RelocationGtarget6M_pC_; -text: .text%__1cRxorI_eReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJAssemblerEsarl6MpnMRegisterImpl_i_v_; text: .text%__1cIModLNodeJideal_reg6kM_I_: classes.o; text: .text%__1cFParsePdo_monitor_exit6M_v_; @@ -3368,7 +3198,6 @@ text: .text%__1cFParseMdo_anewarray6M_v_; text: .text%__1cJLoadDNodeJideal_reg6kM_I_: classes.o; text: .text%__1cXjava_lang_reflect_FieldFclazz6FpnHoopDesc__2_; text: .text%__1cMsubD_regNodeQuse_cisc_RegMask6M_v_; -text: .text%__1cOcmpD_cc_P6NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cTcmovII_reg_EQdDNENodeQuse_cisc_RegMask6M_v_; text: .text%__1cFStateM_sub_Op_CmpD6MpknENode__v_; text: .text%__1cXjava_lang_reflect_FieldJmodifiers6FpnHoopDesc__i_; @@ -3391,7 +3220,6 @@ text: .text%__1cKEntryPoint2t6M_v_; text: .text%__1cKstoreINodeIpipeline6kM_pknIPipeline__; text: .text%__1cXcmpL_reg_flags_LTGENodeIpipeline6kM_pknIPipeline__; text: .text%__1cSMachBreakpointNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cQshrI_eReg_CLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cKemit_break6FrnKCodeBuffer__v_; text: .text%__1cQshrI_eReg_CLNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIciMethodVget_osr_flow_analysis6Mi_pnKciTypeFlow__; @@ -3443,7 +3271,6 @@ text: .text%__1cOcompiledVFrameImonitors6kM_pnNGrowableArray4CpnLMonitorInfo____ text: .text%__1cRsubL_eReg_memNodeFreloc6kM_i_; text: .text%__1cMTailJumpNodeKmatch_edge6kMI_I_; text: .text%__1cFStateP_sub_Op_ConvF2D6MpknENode__v_; -text: .text%__1cNdivL_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNinstanceKlassPadd_osr_nmethod6MpnHnmethod__v_; text: .text%__1cHThreadsbMis_supported_jni_version_including_1_16Fi_C_; text: .text%__1cFStateM_sub_Op_DivL6MpknENode__v_; @@ -3458,7 +3285,6 @@ text: .text%__1cNmodI_eRegNodeIpipeline6kM_pknIPipeline__; text: .text%__1cLStrCompNodeJideal_reg6kM_I_: classes.o; text: .text%__1cJAssemblerGfrstor6MnHAddress__v_; text: .text%JVM_GetCPFieldModifiers; -text: .text%__1cSUnsafe_DefineClass6FpnHJNIEnv__pnI_jstring_pnL_jbyteArray_iipnI_jobject_7_pnH_jclass__: unsafe.o; text: .text%__1cJBasicLockHmove_to6MpnHoopDesc_p0_v_; text: .text%__1cSObjectSynchronizerOinflate_helper6FpnHoopDesc__pnNObjectMonitor__: synchronizer.o; text: .text%__1cSdivD_reg_roundNodeLout_RegMask6kM_rknHRegMask__; @@ -3480,15 +3306,10 @@ text: .text%__1cLPSMarkSweepRmark_sweep_phase46F_v_; text: .text%__1cYjava_lang_reflect_MethodPparameter_types6FpnHoopDesc__2_; text: .text%__1cLPSMarkSweepbAreset_millis_since_last_gc6F_v_; text: .text%__1cUPSAdaptiveSizePolicyUmajor_collection_end6MInHGCCauseFCause__v_; -text: .text%__1cSDeoptimizationBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cJCodeCacheLgc_epilogue6F_v_; text: .text%__1cJMarkSweepNrestore_marks6F_v_; -text: .text%__1cQUncommonTrapBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cNExceptionBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cYinternal_word_RelocationFvalue6M_pC_: relocInfo.o; text: .text%__1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_533pnGThread__v_; -text: .text%__1cJCodeCacheHoops_do6FpnKOopClosure__v_; -text: .text%__1cMset_property6FnGHandle_pkc2pnGThread__v_: jvm.o; text: .text%__1cJCodeCacheLgc_prologue6F_v_; text: .text%__1cHJNIEnv_JNewObject6MpnH_jclass_pnK_jmethodID_E_pnI_jobject__: jni.o; text: .text%__1cLPSMarkSweepPallocate_stacks6F_v_; @@ -3501,7 +3322,6 @@ text: .text%__1cMincI_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cUPSAdaptiveSizePolicyWmajor_collection_begin6M_v_; text: .text%__1cJMarkSweepMadjust_marks6F_v_; text: .text%__1cJMarkSweepXfollow_weak_klass_links6F_v_; -text: .text%__1cNmodL_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%jni_AllocObject: jni.o; text: .text%__1cPcmpFastLockNodeIpipeline6kM_pknIPipeline__; text: .text%__1cQSystemDictionaryYalways_strong_classes_do6FpnKOopClosure__v_; @@ -3512,7 +3332,6 @@ text: .text%__1cUPSMarkSweepDecoratorbHset_destination_decorator_tenured6F_v_; text: .text%JVM_InvokeMethod; text: .text%__1cQSystemDictionaryValways_strong_oops_do6FpnKOopClosure__v_; text: .text%__1cFKlassWcompute_modifier_flags6kMpnGThread__i_; -text: .text%__1cHThreadsLnmethods_do6F_v_; text: .text%__1cIPSOldGenKprecompact6M_v_; text: .text%__1cHThreadsLgc_epilogue6F_v_; text: .text%__1cHThreadsLgc_prologue6F_v_; @@ -3522,9 +3341,7 @@ text: .text%__1cHi2bNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQSystemDictionaryPplaceholders_do6FpnKOopClosure__v_; text: .text%__1cFStateM_sub_Op_ModL6MpknENode__v_; text: .text%__1cJPSPermGenKprecompact6M_v_; -text: .text%__1cHi2bNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cTleaPIdxScaleOffNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cMincI_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cKDictionaryYalways_strong_classes_do6MpnKOopClosure__v_; text: .text%__1cNTemplateTableMlocals_index6FpnMRegisterImpl_i_v_; text: .text%__1cNTemplateTableDdef6FnJBytecodesECode_inITosState_3pFn0AJCondition__v4_v_; @@ -3533,7 +3350,6 @@ text: .text%__1cOaddF24_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNcmovI_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cJStubQdDueueMremove_first6Mi_v_; text: .text%__1cSsarL_eReg_1_31NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cNloadConL0NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%JVM_NewArray; text: .text%__1cLConvF2INodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cOcmpF_cc_P6NodeLout_RegMask6kM_rknHRegMask__; @@ -3545,7 +3361,6 @@ text: .text%__1cNTemplateTableHconvert6F_v_; text: .text%__1cZInterpreterMacroAssemblerNunlock_object6MpnMRegisterImpl__v_; text: .text%__1cSmulF24_reg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIDivDNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cTconvD2I_reg_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIMulFNodeJideal_reg6kM_I_: classes.o; text: .text%__1cFStateP_sub_Op_ConvD2I6MpknENode__v_; text: .text%__1cLMoveF2INodeGOpcode6kM_i_; @@ -3575,13 +3390,11 @@ text: .text%JVM_GetSystemPackage; text: .text%__1cLStatSamplerTget_system_property6FpkcpnGThread__2_; text: .text%__1cPconvL2D_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cXPartialSubtypeCheckNodeLbottom_type6kM_pknEType__: classes.o; -text: .text%__1cOresolve_symbol6Fpkc_pC_: os_solaris.o; text: .text%__1cPMultiBranchDataPpost_initialize6MpnOBytecodeStream_pnRmethodDataOopDesc__v_; text: .text%JVM_RawMonitorCreate; text: .text%__1cQConstantIntValue2t6MpnTDebugInfoReadStream__v_; text: .text%__1cOMacroAssemblerTset_last_Java_frame6MpnMRegisterImpl_22pC_v_; text: .text%__1cOMacroAssemblerRcall_VM_leaf_base6MpCi_v_; -text: .text%__1cSstring_compareNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cISubFNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cFStateP_sub_Op_StrComp6MpknENode__v_; text: .text%__1cFStateP_sub_Op_ConvI2F6MpknENode__v_; @@ -3599,13 +3412,10 @@ text: .text%__1cQinstanceRefKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread text: .text%__1cLvframeArrayPunpack_to_stack6MrnFframe_i_v_; text: .text%__1cLvframeArrayZdeallocate_monitor_chunks6M_v_; text: .text%__1cOstoreF_immNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cVcompiledICHolderKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cNcmovI_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cImulINodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cQsalL_eReg_CLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%Unsafe_CompareAndSwapInt; text: .text%__1cZInterpreterMacroAssemblerPset_mdp_data_at6MpnMRegisterImpl_i2_v_; -text: .text%__1cRsubI_eReg_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cQsalL_eReg_CLNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMsubD_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMnegD_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -3634,7 +3444,6 @@ text: .text%__1cODeoptimizationYfetch_unroll_info_helper6FpnKJavaThread__pn0ALUn text: .text%__1cOMacroAssemblerFenter6M_v_; text: .text%Unsafe_GetNativeByte; text: .text%__1cOMacroAssemblerNpop_FPU_state6M_v_; -text: .text%__1cTsarL_eReg_32_63NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cPconvL2F_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKCMoveLNodeGOpcode6kM_i_; text: .text%JVM_NanoTime; @@ -3657,10 +3466,8 @@ text: .text%__1cFStateP_sub_Op_ConvI2D6MpknENode__v_; text: .text%__1cJAssemblerEmovw6MnHAddress_pnMRegisterImpl__v_; text: .text%__1cQshrL_eReg_CLNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cFStateM_sub_Op_AddF6MpknENode__v_; -text: .text%__1cParrayKlassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%jint_cmp: parse2.o; text: .text%__1cJAssemblerExorl6MpnMRegisterImpl_i_v_; -text: .text%__1cPBytecode_invokeLresult_type6kMpnGThread__nJBasicType__; text: .text%jni_CallVoidMethod: jni.o; text: .text%__1cOsubF24_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cOstoreF_immNodeOmemory_operand6kM_pknIMachOper__; @@ -3683,7 +3490,6 @@ text: .text%__1cPmovI_nocopyNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cJAssemblerFfwait6M_v_; text: .text%__1cJAssemblerKrepne_scan6M_v_; text: .text%__1cNRegisterSaverWrestore_live_registers6FpnOMacroAssembler__v_; -text: .text%__1cRandL_eReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNcmovL_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cZInterpreterMacroAssemblerMdispatch_via6MnITosState_ppC_v_; text: .text%__1cImulINodeOmemory_operand6kM_pknIMachOper__; @@ -3702,12 +3508,10 @@ text: .text%__1cJCmpF3NodeGOpcode6kM_i_; text: .text%__1cIAddDNodeIIdentity6MpnOPhaseTransform__pnENode__: classes.o; text: .text%__1cJAssemblerFtestb6MpnMRegisterImpl_i_v_; text: .text%__1cNTemplateTableQfast_accessfield6FnITosState__v_; -text: .text%__1cOmulIS_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%Unsafe_StaticFieldBaseFromField; text: .text%__1cNTemplateTableZjvmti_post_fast_field_mod6F_v_; text: .text%__1cNTemplateTablePfast_storefield6FnITosState__v_; text: .text%Unsafe_StaticFieldOffset; -text: .text%__1cNTemplateTableXresolve_cache_and_index6FipnMRegisterImpl_2_v_; text: .text%Unsafe_GetObjectVolatile; text: .text%__1cHnmethodFflush6M_v_; text: .text%__1cHnmethodSflush_dependencies6MpnRBoolObjectClosure__v_; @@ -3717,7 +3521,6 @@ text: .text%__1cQciTypeArrayKlass2t6MnLKlassHandle__v_; text: .text%__1cNaddP_eRegNodeIpipeline6kM_pknIPipeline__; text: .text%__1cIMachOperNbase_position6kM_i_; text: .text%__1cZInterpreterMacroAssemblerGf2ieee6M_v_; -text: .text%__1cFVTuneOdelete_nmethod6FpnHnmethod__v_; text: .text%Unsafe_EnsureClassInitialized; text: .text%__1cIciSymbolHas_utf86M_pkc_; text: .text%__1cOtypeArrayKlassNexternal_name6FnJBasicType__pkc_; @@ -3728,7 +3531,6 @@ text: .text%__1cIciMethodMnative_entry6M_pC_; text: .text%__1cNdivI_eRegNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cJAssemblerHfincstp6M_v_; text: .text%__1cETypeFxdual6kM_pk0_; -text: .text%__1cQorI_eReg_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOMacroAssemblerEfpop6M_v_; text: .text%__1cLOptoRuntimeTmultianewarray_Type6Fi_pknITypeFunc__; text: .text%__1cOGenerateOopMapGdo_jsr6Mi_v_; @@ -3741,7 +3543,6 @@ text: .text%jni_RegisterNatives: jni.o; text: .text%__1cSmulF24_reg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cSaddF24_reg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%JVM_GetClassDeclaredFields; -text: .text%stat: os_solaris.o; text: .text%JVM_IsSameClassPackage; text: .text%__1cCosMuser_handler6F_pv_; text: .text%__1cQSystemDictionaryPresolve_or_null6FnMsymbolHandle_pnGThread__pnMklassOopDesc__; @@ -3793,9 +3594,7 @@ text: .text%JVM_LoadLibrary; text: .text%JVM_IsSupportedJNIVersion; text: .text%__1cOstoreF_immNodeFreloc6kM_i_; text: .text%__1cPPerfLongVariant2t6MnJCounterNS_pkcnIPerfDataFUnits_n0CLVariability_pnUPerfLongSampleHelper__v_; -text: .text%__1cNmulI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJAssemblerGfild_d6MnHAddress__v_; -text: .text%__1cRmulI_imm_highNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%Unsafe_ObjectFieldOffset; text: .text%__1cRaddL_eReg_memNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cJAssemblerEincl6MnHAddress__v_; @@ -3835,20 +3634,14 @@ text: .text%__1cHnmethodbJcontinuation_for_implicit_exception6MpC_1_; text: .text%__1cWImplicitExceptionTable2t6MpknHnmethod__v_; text: .text%__1cPPerfDataManagerUcreate_long_variable6FnJCounterNS_pkcnIPerfDataFUnits_pnUPerfLongSampleHelper_pnGThread__pnQPerfLongVariable__; text: .text%__1cKExceptionsK_throw_oop6FpnGThread_pkcipnHoopDesc__v_; -text: .text%__1cNdivI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cLVtableStubsPstub_containing6FpC_pnKVtableStub__; text: .text%__1cMNativeLookupTbase_library_lookup6Fpkc22_pC_; text: .text%__1cFStateP_sub_Op_ConvF2I6MpknENode__v_; -text: .text%__1cODeoptimizationYreset_invocation_counter6FpnJScopeDesc_i_v_; text: .text%__1cQshrL_eReg_CLNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cTconvF2I_reg_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNCellTypeStateImake_any6Fi_0_: generateOopMap.o; text: .text%__1cJAssemblerEmovb6MnHAddress_i_v_; text: .text%__1cPPerfDataManagerKname_space6Fpkc2i_pc_; -text: .text%__1cTshlL_eReg_32_63NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cWImplicitExceptionTableCat6kMI_I_; -text: .text%__1cQshrL_eReg_CLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cSsarL_eReg_1_31NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJAssemblerFfinit6M_v_; text: .text%__1cFParseRjump_if_true_fork6MpnGIfNode_ii_v_; text: .text%__1cKVtableStubRpd_code_alignment6F_i_; @@ -3889,7 +3682,6 @@ text: .text%__1cIRetTableHadd_jsr6Mii_v_; text: .text%__1cNTemplateTableFfload6Fi_v_; text: .text%__1cNTemplateTableFlload6Fi_v_; text: .text%__1cNcmovI_memNodeFreloc6kM_i_; -text: .text%__1cPaddress_of_flag6FnXCommandLineFlagWithType__pnEFlag__: globals.o; text: .text%__1cNTemplateTableFiload6Fi_v_; text: .text%__1cOGenerateOopMapTret_jump_targets_do6MpnOBytecodeStream_pFp0ipi_vi4_v_; text: .text%__1cNdivI_eRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -3951,14 +3743,11 @@ text: .text%__1cQCompilerCounters2t6MpkcipnGThread__v_; text: .text%__1cJAssemblerEandl6MpnMRegisterImpl_2_v_; text: .text%__1cNCompileBrokerUmake_compiler_thread6FpkcpnMCompileQdDueue_pnQCompilerCounters_pnGThread__pnOCompilerThread__; text: .text%__1cNCompileBrokerUcompiler_thread_loop6F_v_; -text: .text%__1cOcmpF_cc_P6NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJAssemblerEcdql6M_v_; text: .text%__1cUInterpreterGeneratorbDgenerate_stack_overflow_check6M_v_; text: .text%__1cRCardTableModRefBSbCfind_covering_region_by_base6MpnIHeapWord__i_; -text: .text%__1cIci2bNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cRCardTableModRefBSbAlargest_prev_committed_end6kMi_pnIHeapWord__; text: .text%__1cMSysClassPathNreset_item_at6Mi_v_: arguments.o; -text: .text%__1cLconvI2BNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cFStateM_sub_Op_CmpF6MpknENode__v_; text: .text%__1cRCardTableModRefBSVresize_covered_region6MnJMemRegion__v_; text: .text%__1cJAssemblerDorl6MpnMRegisterImpl_nHAddress__v_; @@ -3973,7 +3762,6 @@ text: .text%__1cOtailjmpIndNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cVcompiler_thread_entry6FpnKJavaThread_pnGThread__v_: thread.o; text: .text%__1cOCompilerThread2t6MpnMCompileQdDueue_pnQCompilerCounters__v_; text: .text%__1cNSafepointBlob2t6MpnKCodeBuffer_ipnJOopMapSet_i_v_; -text: .text%__1cJlookupOne6FpnHJNIEnv__pkcpnGThread__pnH_jclass__: jni.o; text: .text%__1cUPSGenerationCounters2t6MpkciipnOPSVirtualSpace__v_; text: .text%__1cNSafepointBlob2n6FII_pv_; text: .text%__1cQmulD_reg_memNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -3992,7 +3780,6 @@ text: .text%__1cPmovP_nocopyNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%jni_CallStaticObjectMethodV: jni.o; text: .text%__1cIci2bNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cZInterpreterMacroAssemblerRgen_subtype_check6MpnMRegisterImpl_rnFLabel__v_; -text: .text%__1cRaddI_mem_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%JVM_Available; text: .text%__1cCosIjvm_path6Fpci_v_; text: .text%__1cZInterpreterMacroAssemblerUupdate_mdp_by_offset6MpnMRegisterImpl_2i_v_; @@ -4032,7 +3819,6 @@ text: .text%__1cFStateL_sub_Op_OrL6MpknENode__v_; text: .text%__1cFStateM_sub_Op_SubF6MpknENode__v_; text: .text%__1cMPeriodicTaskGenroll6M_v_; text: .text%__1cMPeriodicTask2t6MI_v_; -text: .text%__1cSestimate_path_freq6FpnENode__f_: loopnode.o; text: .text%__1cFStateP_sub_Op_MoveL2D6MpknENode__v_; text: .text%__1cNincI_eRegNodeIpipeline6kM_pknIPipeline__; text: .text%__1cNTemplateTableHcastore6F_v_; @@ -4068,17 +3854,13 @@ text: .text%__1cHnmethodVinvalidate_osr_method6M_v_; text: .text%__1cQAgentLibraryList2t6M_v_: arguments.o; text: .text%__1cJAssemblerEmovb6MpnMRegisterImpl_nHAddress__v_; text: .text%__1cLklassVtableQindex_of_miranda6MpnNsymbolOopDesc_2_i_; -text: .text%__1cPconvL2D_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cPconvD2F_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNmulI_eRegNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cINegFNodeJideal_reg6kM_I_: classes.o; text: .text%__1cSInterpreterRuntimeMat_safepoint6FpnKJavaThread__v_; text: .text%__1cOGenerateOopMapTadd_to_ref_init_set6Mi_v_; text: .text%__1cIPSOldGenOgen_size_limit6M_I_; text: .text%__1cIPSOldGenGresize6MI_v_; -text: .text%__1cQorl_eReg_immNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNciMethodKlassEmake6F_p0_; -text: .text%__1cPconvL2F_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cUParallelScavengeHeapItop_addr6kM_ppnIHeapWord__: parallelScavengeHeap.o; text: .text%__1cIciMethod2t6MpnPciInstanceKlass_pnIciSymbol_4_v_; text: .text%__1cMGCTaskThread2t6MpnNGCTaskManager_II_v_; @@ -4086,13 +3868,10 @@ text: .text%__1cMGCTaskThreadFstart6M_v_; text: .text%__1cMGCTaskThreadDrun6M_v_; text: .text%__1cJLoadFNodeMstore_Opcode6kM_i_: classes.o; text: .text%__1cUInterpreterGeneratorLlock_method6M_v_; -text: .text%__1cXpartialSubtypeCheckNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cISubFNodeJideal_reg6kM_I_: classes.o; text: .text%__1cISubFNodeGadd_id6kM_pknEType__: classes.o; text: .text%__1cIPSOldGenPinitialize_work6Mpkci_v_; -text: .text%lstat: perfMemory_solaris.o; text: .text%__1cRComputeEntryStackHdo_long6M_v_: generateOopMap.o; -text: .text%__1cPfilename_to_pid6Fpkc_l_: perfMemory_solaris.o; text: .text%Unsafe_CompareAndSwapObject; text: .text%__1cJCodeCachebGmake_marked_nmethods_not_entrant6F_v_; text: .text%__1cZInterpreterMacroAssemblerSsuper_call_VM_leaf6MpCpnMRegisterImpl__v_; @@ -4198,7 +3977,6 @@ text: .text%__1cIVMThreadDrun6M_v_; text: .text%__1cSThreadLocalStoragebCgenerate_code_for_get_thread6F_v_; text: .text%__1cTtypeArrayKlassKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cKTypeOopPtrFxdual6kM_pknEType__; -text: .text%__1cKTypeOopPtrEmake6FnHTypePtrDPTR_i_pk0_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: vm_version.o; text: .text%__1cKVM_VersionWget_processor_features6F_v_; text: .text%__1cKVM_VersionKinitialize6F_v_; @@ -4239,9 +4017,7 @@ text: .text%__1cbAcall_initializeSystemClass6FpnGThread__v_: thread.o; text: .text%__1cWreset_vm_info_property6FpnGThread__v_: thread.o; text: .text%JVM_RegisterUnsafeMethods; text: .text%__1cQvtableStubs_init6F_v_; -text: .text%__1cFVTuneEexit6F_v_; text: .text%__1cTtypeArrayKlassKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: typeArrayKlassKlass.o; -text: .text%__1cKvtune_init6F_v_; text: .text%__1cIUniversePcheck_alignment6FIIpkc_v_; text: .text%__1cSinstanceKlassKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cFJNIidKdeallocate6Fp0_v_; @@ -4292,7 +4068,6 @@ text: .text%__1cNCellTypeStateImake_top6F_0_: generateOopMap.o; text: .text%__1cWResolveOopMapConflictsUdo_potential_rewrite6MpnGThread__nMmethodHandle__; text: .text%__1cJGenRemSetYmax_alignment_constraint6Fn0AEName__I_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: genCollectedHeap.o; -text: .text%__1cTAssertIsPermClosure2t6M_v_: genCollectedHeap.o; text: .text%__1cKNoopGCTaskQcreate_on_c_heap6F_p0_; text: .text%__1cNGCTaskManagerKthreads_do6MpnNThreadClosure__v_; text: .text%__1cNGCTaskManagerKinitialize6M_v_; @@ -4398,9 +4173,6 @@ text: .text%__1cHi2sNodeIpipeline6kM_pknIPipeline__; text: .text%__1cHi2bNodeIpipeline6kM_pknIPipeline__; text: .text%__1cKstoreBNodeIpipeline6kM_pknIPipeline__; text: .text%__1cOtailjmpIndNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cRaddL_eReg_memNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cLconvP2BNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; -text: .text%__1cIcp2bNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cTconvI2F_SSF_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cQmulD_reg_memNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cOtailjmpIndNodeFreloc6kM_i_; @@ -4410,7 +4182,6 @@ text: .text%__1cQaccessFlags_init6F_v_; text: .text%__1cPconvI2L_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cJArgumentsbBset_cms_and_parnew_gc_flags6F_v_; text: .text%__1cJArgumentsTset_parnew_gc_flags6F_v_; -text: .text%__1cQno_shared_spaces6F_v_: arguments.o; text: .text%__1cJArgumentsMget_property6Fpkc_2_; text: .text%__1cMSysClassPathQadd_jars_to_path6Fpcpkc_1_; text: .text%__1cMSysClassPathPexpand_endorsed6M_v_; @@ -4446,13 +4217,11 @@ text: .text%__1cQconstMethodKlassOset_alloc_size6MI_v_: constMethodKlass.o; text: .text%__1cQconstMethodKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cTcompilerOracle_init6F_v_; text: .text%__1cOCompilerOraclePparse_from_file6F_v_; -text: .text%__1cHcc_file6F_pkc_: compilerOracle.o; text: .text%__1cVcompiledICHolderKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: compiledICHolderKlass.o; text: .text%__1cVcompiledICHolderKlassOset_alloc_size6MI_v_: compiledICHolderKlass.o; text: .text%__1cVcompiledICHolderKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: compileBroker.o; text: .text%__1cNCompileBrokerQset_should_block6F_v_; -text: .text%__1cNCompileBrokerVinit_compiler_threads6Fi_v_; text: .text%__1cSDeoptimizationBlobGcreate6FpnKCodeBuffer_pnJOopMapSet_iiii_p0_; text: .text%__1cRCardTableModRefBSbBct_max_alignment_constraint6F_I_; text: .text%__1cRCardTableModRefBS2t6MnJMemRegion_i_v_; @@ -4508,20 +4277,13 @@ text: .text%__1cLStatSamplerJdisengage6F_v_; text: .text%__1cLStatSamplerGengage6F_v_; text: .text%__1cLStatSamplerKinitialize6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: sharedHeap.o; -text: .text%__1cTAssertIsPermClosure2t6M_v_: sharedHeap.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: psMarkSweep.o; -text: .text%__1cTPSAlwaysTrueClosure2t6M_v_: psMarkSweep.o; text: .text%__1cLPSMarkSweepKinitialize6F_v_; text: .text%__1cbAPSGCAdaptivePolicyCounters2t6MpkciipnUPSAdaptiveSizePolicy__v_; text: .text%__1cQPlaceholderTable2t6Mi_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: phase.o; text: .text%__1cKPerfMemoryUdelete_memory_region6F_v_; text: .text%__1cKPerfMemoryUcreate_memory_region6FI_v_; -text: .text%__1cUdelete_shared_memory6FpcI_v_: perfMemory_solaris.o; -text: .text%__1cUcreate_shared_memory6FI_pc_: perfMemory_solaris.o; -text: .text%__1cSmmap_create_shared6FI_pc_: perfMemory_solaris.o; -text: .text%__1cbAcreate_sharedmem_resources6Fpkc1I_i_: perfMemory_solaris.o; -text: .text%__1cbBcleanup_sharedmem_resources6Fpkc_v_: perfMemory_solaris.o; text: .text%__1cIPSOldGen2t6MnNReservedSpace_IIIIpkci_v_; text: .text%__1cSReferenceProcessorMinit_statics6F_v_; text: .text%__1cXreferenceProcessor_init6F_v_; @@ -4602,7 +4364,6 @@ text: .text%__1cMPeriodicTask2T5B6M_v_; text: .text%__1cQSystemDictionarybCinitialize_preloaded_classes6FpnGThread__v_; text: .text%__1cQSystemDictionaryKinitialize6FpnGThread__v_; text: .text%__1cQSystemDictionaryKclasses_do6FpFpnMklassOopDesc__v_v_; -text: .text%__1cLremove_file6Fpkc_v_: perfMemory_solaris.o; text: .text%__1cNMemoryServicebFadd_parallel_scavenge_heap_info6FpnUParallelScavengeHeap__v_; text: .text%__1cNMemoryServiceRset_universe_heap6FpnNCollectedHeap__v_; text: .text%__1cNMemoryManagerbEget_psMarkSweep_memory_manager6F_pnPGCMemoryManager__; @@ -4610,11 +4371,6 @@ text: .text%__1cNMemoryManagerbDget_psScavenge_memory_manager6F_pnPGCMemoryManag text: .text%__1cNMemoryManagerbDget_code_cache_memory_manager6F_p0_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: matcher.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: markSweep.o; -text: .text%__1cJMarkSweepSMarkAndPushClosure2t6M_v_: markSweep.o; -text: .text%__1cJMarkSweepRFollowRootClosure2t6M_v_: markSweep.o; -text: .text%__1cJMarkSweepSFollowStackClosure2t6M_v_: markSweep.o; -text: .text%__1cJMarkSweepOIsAliveClosure2t6M_v_: markSweep.o; -text: .text%__1cJMarkSweepQKeepAliveClosure2t6M_v_: markSweep.o; text: .text%__1cOmarksweep_init6F_v_; text: .text%__1cNMemoryServiceXadd_psYoung_memory_pool6FpnKPSYoungGen_pnNMemoryManager_4_v_; text: .text%__1cKmutex_init6F_v_; @@ -4666,9 +4422,6 @@ text: .text%__1cCosEinit6F_v_; text: .text%__1cCosHSolarisUsynchronization_init6F_v_; text: .text%__1cCosHSolarisOlibthread_init6F_v_; text: .text%__1cUParallelScavengeHeapYpermanent_object_iterate6MpnNObjectClosure__v_; -text: .text%__1cWget_sharedmem_filename6Fpkci_pc_: perfMemory_solaris.o; -text: .text%__1cNget_user_name6Fl_pc_: perfMemory_solaris.o; -text: .text%__1cQget_user_tmp_dir6Fpkc_pc_: perfMemory_solaris.o; text: .text%__1cKPerfMemoryHdestroy6F_v_; text: .text%__1cKPerfMemoryKinitialize6F_v_; text: .text%__1cPperfMemory_exit6F_v_; @@ -4689,7 +4442,6 @@ text: .text%__1cCosXterminate_signal_thread6F_v_; text: .text%__1cCosLsignal_init6F_v_; text: .text%__1cTsignal_thread_entry6FpnKJavaThread_pnGThread__v_: os.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: oopMap.o; -text: .text%__1cQDoNothingClosure2t6M_v_: oopMap.o; text: .text%__1cSobjArrayKlassKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: objArrayKlassKlass.o; text: .text%__1cSobjArrayKlassKlassbEallocate_system_objArray_klass6MpnGThread__pnMklassOopDesc__; text: .text%__1cSobjArrayKlassKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; @@ -4703,7 +4455,6 @@ text: .text%__1cCosHSolarisPinit_signal_mem6F_v_; text: .text%__1cCosSget_temp_directory6F_pkc_; text: .text%__1cCosbDallocate_thread_local_storage6F_i_; text: .text%__1cCosHSolarisQsignal_sets_init6F_v_; -text: .text%__1cQcreate_os_thread6FpnGThread_I_pnIOSThread__: os_solaris.o; text: .text%__1cCosbDinit_system_properties_values6F_v_; text: .text%__1cCosHSolarisWinitialize_system_info6F_v_; text: .text%__1cCosPphysical_memory6F_X_; diff --git a/hotspot/make/solaris/makefiles/reorder_TIERED_sparc b/hotspot/make/solaris/makefiles/reorder_TIERED_sparc index 15c03b78514..08abc3b4377 100644 --- a/hotspot/make/solaris/makefiles/reorder_TIERED_sparc +++ b/hotspot/make/solaris/makefiles/reorder_TIERED_sparc @@ -4,7 +4,6 @@ text = LOAD ?RXO; text: .text%__1cCosOjavaTimeMillis6F_x_; text: .text%__1cQIndexSetIteratorQadvance_and_next6M_I_; -text: .text%__1cNinstanceKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cNinstanceKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cNinstanceKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cOtypeArrayKlassToop_adjust_pointers6MpnHoopDesc__i_; @@ -33,7 +32,6 @@ text: .text%__1cETypeFuhash6Fkpk0_i_; text: .text%__1cQIndexSetIteratorEnext6M_I_: chaitin.o; text: .text%__1cENodeIout_grow6MI_v_; text: .text%__1cOloadConI13NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cNobjArrayKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cENodeHadd_req6Mp0_v_; text: .text%__1cJMarkSweepUAdjustPointerClosureGdo_oop6MppnHoopDesc__v_: markSweep.o; text: .text%__1cNobjArrayKlassToop_follow_contents6MpnHoopDesc__v_; @@ -45,7 +43,6 @@ text: .text%__1cHPhiNodeGOpcode6kM_i_; text: .text%__1cKbranchNodeNis_block_proj6kM_pknENode__: ad_sparc_misc.o; text: .text%__1cIProjNodeGOpcode6kM_i_; text: .text%__1cETypeIhashcons6M_pk0_; -text: .text%__1cOPhaseIdealLoopUbuild_loop_late_post6MpnENode_pk0_v_; text: .text%__1cMPhaseChaitinTinterfere_with_live6MIpnIIndexSet__v_; text: .text%__1cWNode_Backward_IteratorEnext6M_pnENode__; text: .text%__1cNIdealLoopTreeJis_member6kMpk0_i_; @@ -154,7 +151,6 @@ text: .text%__1cETypeFxmeet6kMpk0_2_; text: .text%__1cILRG_ListGextend6MII_v_; text: .text%__1cJVectorSet2F6kMI_i_; text: .text%__1cENodeQIdeal_DU_postCCP6MpnIPhaseCCP__p0_; -text: .text%__1cOtypeArrayKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cIProjNodeEhash6kM_I_; text: .text%__1cIAddINodeGOpcode6kM_i_; text: .text%__1cIIndexSet2t6Mp0_v_; @@ -168,7 +164,6 @@ text: .text%__1cICmpPNodeGOpcode6kM_i_; text: .text%__1cKNode_ArrayGremove6MI_v_; text: .text%__1cHPhiNodeEhash6kM_I_; text: .text%__1cLSymbolTableGlookup6FpkcipnGThread__pnNsymbolOopDesc__; -text: .text%__1cKoopFactoryKnew_symbol6FpkcipnGThread__pnNsymbolOopDesc__; text: .text%__1cKmethodOperJnum_edges6kM_I_: ad_sparc.o; text: .text%__1cJStartNodeLbottom_type6kM_pknEType__; text: .text%__1cHTypeIntFxmeet6kMpknEType__3_; @@ -502,7 +497,6 @@ text: .text%__1cNObjectMonitorFenter6MpnGThread__v_; text: .text%__1cENodeKreplace_by6Mp0_v_; text: .text%__1cSObjectSynchronizerJslow_exit6FpnHoopDesc_pnJBasicLock_pnGThread__v_; text: .text%__1cMMergeMemNodePiteration_setup6Mpk0_v_; -text: .text%__1cFKlassNlookup_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cKDictionaryEfind6MiInMsymbolHandle_nGHandle_2pnGThread__pnMklassOopDesc__; text: .text%__1cRMachSpillCopyNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cKRegionNodeIIdentity6MpnOPhaseTransform__pnENode__; @@ -605,7 +599,6 @@ text: .text%__1cMTypeKlassPtrEhash6kM_i_; text: .text%__1cMCallLeafNodeGOpcode6kM_i_; text: .text%__1cSCallLeafDirectNodeIpipeline6kM_pknIPipeline__; text: .text%__1cHPhiNodeEmake6FpnENode_2pknEType_pknHTypePtr__p0_; -text: .text%__1cIAddPNodeQmach_bottom_type6FpknIMachNode__pknEType__; text: .text%__1cOcompU_iRegNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cJiRegLOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cNflagsRegPOperKin_RegMask6kMi_pknHRegMask__; @@ -640,7 +633,6 @@ text: .text%__1cJStartNodeGOpcode6kM_i_; text: .text%__1cQregF_to_stkINodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cENodeDcmp6kMrk0_I_; text: .text%__1cHTypeIntFxdual6kM_pknEType__; -text: .text%__1cIciObjectIencoding6M_pnI_jobject__; text: .text%__1cMmerge_region6FpnKRegionNode_pnIPhaseGVN__pnENode__: cfgnode.o; text: .text%__1cJAssemblerOpatched_branch6Fiii_i_; text: .text%__1cJAssemblerSbranch_destination6Fii_i_; @@ -738,10 +730,7 @@ text: .text%__1cMLinkResolverOresolve_invoke6FrnICallInfo_nGHandle_nSconstantPoo text: .text%__1cIBoolNodeJideal_reg6kM_I_: subnode.o; text: .text%__1cHCmpNodeJideal_reg6kM_I_: classes.o; text: .text%__1cRloadConP_pollNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cETypeFwiden6kMpk0_2_: type.o; text: .text%__1cLstoreI0NodeIpipeline6kM_pknIPipeline__; -text: .text%__1cFciEnvTget_method_by_index6MpnPciInstanceKlass_inJBytecodesECode__pnIciMethod__; -text: .text%__1cFciEnvYget_method_by_index_impl6MpnPciInstanceKlass_inJBytecodesECode__pnIciMethod__; text: .text%__1cMloadConPNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFciEnvNlookup_method6MpnNinstanceKlass_2pnNsymbolOopDesc_4nJBytecodesECode__pnNmethodOopDesc__; text: .text%__1cKDictionaryKfind_class6MiInMsymbolHandle_nGHandle__pnMklassOopDesc__; @@ -755,7 +744,6 @@ text: .text%__1cSInterpreterRuntimeMmonitorenter6FpnKJavaThread_pnPBasicObjectLo text: .text%__1cSInterpreterRuntimePresolve_get_put6FpnKJavaThread_nJBytecodesECode__v_; text: .text%__1cQsubI_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cXmembar_acquire_lockNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cQaddP_reg_regNodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; text: .text%__1cPCountedLoopNodeGOpcode6kM_i_; text: .text%__1cSInterpreterRuntimeLmonitorexit6FpnKJavaThread_pnPBasicObjectLock__v_; text: .text%__1cIAndLNodeGOpcode6kM_i_; @@ -826,7 +814,6 @@ text: .text%__1cURethrowExceptionNodeNis_block_proj6kM_pknENode__: ad_sparc_misc text: .text%__1cQSystemDictionarybOfind_constrained_instance_or_array_klass6FnMsymbolHandle_nGHandle_pnGThread__pnMklassOopDesc__; text: .text%__1cQsubI_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cJloadBNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cIciSymbol2t6MnMsymbolHandle__v_; text: .text%__1cQaddP_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKmethodOperGmethod6kM_i_: ad_sparc.o; text: .text%__1cFKlassIsubklass6kM_p0_; @@ -946,7 +933,6 @@ text: .text%__1cIGraphKitOreplace_in_map6MpnENode_2_v_; text: .text%__1cNinstanceKlassLfind_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cHCompileKTracePhase2T6M_v_; text: .text%__1cMPhaseChaitinLclone_projs6MpnFBlock_IpnENode_4rI_i_; -text: .text%__1cNinstanceKlassSlookup_osr_nmethod6kMkpnNmethodOopDesc_i_pnHnmethod__; text: .text%__1cIJVMState2t6MpnIciMethod_p0_v_; text: .text%__1cIHaltNode2t6MpnENode_2_v_; text: .text%__1cLOptoRuntimeSuncommon_trap_Type6F_pknITypeFunc__; @@ -954,7 +940,6 @@ text: .text%__1cJloadLNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cSsafePoint_pollNodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cINodeHashJhash_find6MpknENode__p1_; text: .text%__1cQmulL_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cSaddP_reg_imm13NodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; text: .text%__1cOMethodLivenessKBasicBlock2t6Mp0ii_v_; text: .text%__1cOMethodLivenessKBasicBlockQcompute_gen_kill6MpnIciMethod__v_; text: .text%__1cOGenerateOopMapFppush6MpnNCellTypeState__v_; @@ -987,7 +972,6 @@ text: .text%__1cFParseHdo_call6M_v_; text: .text%__1cNloadConP0NodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cHMulNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cMPhaseIterGVNJtransform6MpnENode__2_; -text: .text%__1cHTypeIntFwiden6kMpknEType__3_; text: .text%__1cSsafePoint_pollNodeIpipeline6kM_pknIPipeline__; text: .text%__1cJloadSNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cKarrayKlassLobject_size6kMi_i_; @@ -1019,7 +1003,6 @@ text: .text%__1cIBoolNodeHsize_of6kM_I_; text: .text%__1cSobjArrayKlassKlassIoop_size6kMpnHoopDesc__i_: objArrayKlassKlass.o; text: .text%__1cPcompP_iRegPNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cJloadPNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cPBytecode_invokeJsignature6kM_pnNsymbolOopDesc__; text: .text%__1cFframebGinterpreter_callee_receiver_addr6MnMsymbolHandle__ppnHoopDesc__; text: .text%__1cNSignatureInfoGdo_int6M_v_: bytecode.o; text: .text%__1cOstackSlotLOperKin_RegMask6kMi_pknHRegMask__; @@ -1038,9 +1021,7 @@ text: .text%__1cMloadConINodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cGIfNodeHsize_of6kM_I_: classes.o; text: .text%__1cPconvL2I_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cIimmLOperJconstantL6kM_x_: ad_sparc_clone.o; -text: .text%__1cTStackWalkCompPolicyRcompilation_level6MnMmethodHandle_i_i_; text: .text%jni_GetByteArrayRegion: jni.o; -text: .text%__1cIGraphKitTset_all_memory_call6MpnENode__v_; text: .text%__1cSHighResTimeSamplerLtake_sample6M_x_: statSampler.o; text: .text%__1cHCompileFstart6kM_pnJStartNode__; text: .text%__1cPStatSamplerTaskEtask6M_v_: statSampler.o; @@ -1082,7 +1063,6 @@ text: .text%__1cXinitialize_static_field6FpnPfieldDescriptor_pnGThread__v_: clas text: .text%__1cURethrowExceptionNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cOJNIHandleBlockOallocate_block6FpnGThread__p0_; text: .text%__1cNSignatureInfoHdo_bool6M_v_: bytecode.o; -text: .text%__1cKBufferBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cSandI_reg_imm13NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cIAddINodeIadd_ring6kMpknEType_3_3_; text: .text%__1cLTypeInstPtrQcast_to_ptr_type6kMnHTypePtrDPTR__pknEType__; @@ -1095,7 +1075,6 @@ text: .text%__1cPorI_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cLRethrowNodeGOpcode6kM_i_; text: .text%__1cJloadSNodeIpipeline6kM_pknIPipeline__; text: .text%__1cICodeHeapIcapacity6kM_I_; -text: .text%__1cKMemoryPoolImax_size6kM_I_: memoryPool.o; text: .text%__1cMCodeHeapPoolNused_in_bytes6M_I_: memoryPool.o; text: .text%__1cPcmpFastLockNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cMCodeHeapPoolQget_memory_usage6M_nLMemoryUsage__; @@ -1136,7 +1115,6 @@ text: .text%__1cJloadSNodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cIJumpDataKcell_count6M_i_: ciMethodData.o; text: .text%__1cObranchConPNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cITypeFuncFxdual6kM_pknEType__; -text: .text%__1cQjava_lang_StringGlength6FpnHoopDesc__i_; text: .text%__1cFStateM_sub_Op_CmpI6MpknENode__v_; text: .text%__1cJcmpOpOperFccode6kM_i_: ad_sparc_clone.o; text: .text%__1cGciType2t6MnLKlassHandle__v_; @@ -1200,7 +1178,6 @@ text: .text%__1cQmulL_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cLstoreP0NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cLRethrowNodeKmatch_edge6kMI_I_; text: .text%__1cFTypeFEhash6kM_i_; -text: .text%__1cHnmethodHoops_do6MpnKOopClosure__v_; text: .text%__1cFStateM_sub_Op_AddI6MpknENode__v_; text: .text%__1cOParseGeneratorIgenerate6MpnIJVMState__2_; text: .text%__1cFParseQcreate_entry_map6M_pnNSafePointNode__; @@ -1213,17 +1190,13 @@ text: .text%__1cFParsePdo_method_entry6M_v_; text: .text%__1cNCallGeneratorKfor_inline6FpnIciMethod_f_p0_; text: .text%__1cbGJvmtiVMObjectAllocEventCollector2t6M_v_; text: .text%__1cbGJvmtiVMObjectAllocEventCollector2T6M_v_; -text: .text%__1cQconstMethodKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cRciVirtualCallDataOtranslate_from6MpnLProfileData__v_; text: .text%jni_IsSameObject: jni.o; text: .text%__1cMloadConINodeIpipeline6kM_pknIPipeline__; text: .text%__1cNbranchConNodeJlabel_set6MrnFLabel_I_v_; text: .text%__1cNbranchConNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQandL_reg_regNodeErule6kM_I_: ad_sparc_misc.o; -text: .text%__1cLmethodKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cLsymbolKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cIciObjectFklass6M_pnHciKlass__; -text: .text%__1cLSymbolTableFprobe6Fpkci_pnNsymbolOopDesc__; text: .text%__1cPThreadLocalNodeGOpcode6kM_i_; text: .text%__1cZPhaseConservativeCoalesceKupdate_ifg6MIIpnIIndexSet_2_v_; text: .text%__1cZPhaseConservativeCoalesceMunion_helper6MpnENode_2II222pnFBlock_I_v_; @@ -1244,7 +1217,6 @@ text: .text%__1cRshrP_reg_imm5NodeIpipeline6kM_pknIPipeline__; text: .text%__1cQandI_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cIciMethodbBinterpreter_call_site_count6Mi_i_; text: .text%__1cGBitMapIset_from6M0_v_; -text: .text%__1cNCompileBrokerOcompile_method6FnMmethodHandle_i1ipkcpnGThread__pnHnmethod__; text: .text%__1cTconstantPoolOopDescbDresolve_string_constants_impl6FnSconstantPoolHandle_pnGThread__v_; text: .text%__1cHSubNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cFChunk2n6FII_pv_; @@ -1278,7 +1250,6 @@ text: .text%__1cNCatchProjNodeDcmp6kMrknENode__I_; text: .text%__1cKTypeOopPtrEhash6kM_i_; text: .text%__1cIMinINodeGOpcode6kM_i_; text: .text%__1cMURShiftINodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cFframeRoops_code_blob_do6MpnKOopClosure_pknLRegisterMap__v_; text: .text%__1cKTypeRawPtrFxmeet6kMpknEType__3_; text: .text%JVM_GetMethodIxModifiers; text: .text%__1cIMulLNodeLbottom_type6kM_pknEType__: classes.o; @@ -1325,7 +1296,6 @@ text: .text%__1cSconvI2D_helperNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cPClassFileStreamHskip_u26MipnGThread__v_; text: .text%__1cUcompI_iReg_imm13NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cOMacroAssemblerNverify_thread6M_v_; -text: .text%__1cIGraphKitZset_results_for_java_call6MpnMCallJavaNode__pnENode__; text: .text%__1cSbranchCon_longNodeIpipeline6kM_pknIPipeline__; text: .text%__1cHnmethodVcleanup_inline_caches6M_v_; text: .text%__1cTciConstantPoolCacheGinsert6Mipv_v_; @@ -1356,12 +1326,9 @@ text: .text%__1cKoopFactoryTnew_system_objArray6FipnGThread__pnPobjArrayOopDesc_ text: .text%__1cbDcatch_cleanup_find_cloned_def6FpnFBlock_pnENode_1rnLBlock_Array_i_3_: lcm.o; text: .text%__1cQxorI_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cKstoreLNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cFciEnvVget_constant_by_index6MpnPciInstanceKlass_i_nKciConstant__; -text: .text%__1cFciEnvbAget_constant_by_index_impl6MpnPciInstanceKlass_i_nKciConstant__; text: .text%__1cOClearArrayNodeKmatch_edge6kMI_I_; text: .text%__1cPconvL2I_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cJloadSNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cKJavaThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cSFixupMirrorClosureJdo_object6MpnHoopDesc__v_: universe.o; text: .text%__1cFStateP_sub_Op_LShiftI6MpknENode__v_; text: .text%__1cQandL_reg_regNodeLout_RegMask6kM_rknHRegMask__; @@ -1387,7 +1354,6 @@ text: .text%__1cOAbstractICacheQinvalidate_range6FpCi_v_; text: .text%__1cKstorePNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIMaxINodeGOpcode6kM_i_; text: .text%__1cTDirectCallGeneratorIgenerate6MpnIJVMState__2_; -text: .text%__1cNCallGeneratorPfor_direct_call6FpnIciMethod__p0_; text: .text%__1cMWarmCallInfoLalways_cold6F_p0_; text: .text%__1cIimmDOperJconstantD6kM_d_: ad_sparc_clone.o; text: .text%__1cIPhaseIFGEinit6MI_v_; @@ -1512,7 +1478,6 @@ text: .text%__1cPciObjectFactoryMvm_symbol_at6Fi_pnIciSymbol__; text: .text%__1cKDictionaryJadd_klass6MnMsymbolHandle_nGHandle_nLKlassHandle__v_; text: .text%__1cVshrL_reg_imm6_L2INodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cZCallDynamicJavaDirectNodePoper_input_base6kM_I_: ad_sparc_misc.o; -text: .text%__1cIGraphKitTcreate_and_xform_if6MpnENode_2ff_pnGIfNode__: graphKit.o; text: .text%__1cWImplicitExceptionTableGappend6MII_v_; text: .text%__1cRMachNullCheckNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLProfileDataPpost_initialize6MpnOBytecodeStream_pnRmethodDataOopDesc__v_: ciMethodData.o; @@ -1534,14 +1499,12 @@ text: .text%__1cFKlassMset_subklass6MpnMklassOopDesc__v_; text: .text%__1cOGenerateOopMapLmerge_state6Fp0ipi_v_; text: .text%__1cMTypeKlassPtrFxdual6kM_pknEType__; text: .text%__1cQSystemDictionaryVdefine_instance_class6FnTinstanceKlassHandle_pnGThread__v_; -text: .text%__1cSinstanceKlassKlassXallocate_instance_klass6MiiiinNReferenceType_pnGThread__pnMklassOopDesc__; text: .text%__1cPClassFileParserbBcheck_final_method_override6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cJCodeCachebKnumber_of_nmethods_with_dependencies6F_i_; text: .text%__1cNinstanceKlassQinit_implementor6M_v_; text: .text%__1cPClassFileStream2t6MpCipc_v_; text: .text%__1cNinstanceKlassSprocess_interfaces6MpnGThread__v_; text: .text%__1cNinstanceKlassYcompute_secondary_supers6MipnGThread__pnPobjArrayOopDesc__; -text: .text%__1cKoopFactoryRnew_instanceKlass6FiiiinNReferenceType_pnGThread__pnMklassOopDesc__; text: .text%__1cNinstanceKlassWdo_local_static_fields6MpFpnPfieldDescriptor_pnGThread__v4_v_; text: .text%__1cPClassFileParserMsort_methods6MnOobjArrayHandle_111pnGThread__nPtypeArrayHandle__; text: .text%__1cFKlassKsuperklass6kM_pnNinstanceKlass__; @@ -1561,22 +1524,17 @@ text: .text%__1cISubINodeJideal_reg6kM_I_: classes.o; text: .text%__1cNinstanceKlassOset_alloc_size6MI_v_: instanceKlass.o; text: .text%__1cNinstanceKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: instanceKlass.o; text: .text%__1cHMemNodeHsize_of6kM_I_; -text: .text%__1cFVTuneQstart_class_load6F_v_; text: .text%__1cSThreadProfilerMark2T6M_v_; -text: .text%__1cFVTuneOend_class_load6F_v_; text: .text%__1cLClassLoaderOload_classfile6FnMsymbolHandle_pnGThread__nTinstanceKlassHandle__; text: .text%__1cJEventMark2t6MpkcE_v_: classLoader.o; text: .text%__1cSThreadProfilerMark2t6Mn0AGRegion__v_; text: .text%__1cQSystemDictionaryRload_shared_class6FnTinstanceKlassHandle_nGHandle_pnGThread__1_; -text: .text%__1cKklassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cPClassFileParserbKparse_classfile_sourcefile_attribute6MnSconstantPoolHandle_nTinstanceKlassHandle_pnGThread__v_; text: .text%__1cQmodI_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cLRShiftINodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cKCMoveINodeGOpcode6kM_i_; text: .text%__1cLLShiftLNodeGOpcode6kM_i_; text: .text%__1cYcompareAndSwapL_boolNodeErule6kM_I_: ad_sparc_misc.o; -text: .text%__1cSinstanceKlassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cNinstanceKlassScopy_static_fields6MpnSPSPromotionManager__v_; text: .text%__1cMtlsLoadPNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateQ_sub_Op_URShiftI6MpknENode__v_; text: .text%__1cKcmpOpUOperGnegate6M_v_: ad_sparc_clone.o; @@ -1626,7 +1584,6 @@ text: .text%__1cTOopMapForCacheEntryZfill_stackmap_for_opcodes6MpnOBytecodeStrea text: .text%__1cSaddL_reg_imm13NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQshrL_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cKstoreLNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cNSharedRuntimebKexception_handler_for_return_address6FpC_1_; text: .text%__1cILoopNodeHsize_of6kM_I_: classes.o; text: .text%__1cHMatcherLfind_shared6MpnENode__v_; text: .text%__1cJStartNodeHsize_of6kM_I_; @@ -1643,8 +1600,6 @@ text: .text%__1cRcompL_reg_conNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cMLinkResolverbHlookup_instance_method_in_klasses6FrnMmethodHandle_nLKlassHandle_nMsymbolHandle_4pnGThread__v_; text: .text%__1cMnegF_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cNSharedRuntimebWnative_method_throw_unsatisfied_link_error_entry6F_pC_; -text: .text%__1cTStackWalkCompPolicyYmethod_back_branch_event6MnMmethodHandle_iipnGThread__v_; -text: .text%__1cRCompilationPolicybJreset_counter_for_back_branch_event6MnMmethodHandle__v_; text: .text%__1cOMethodLivenessQcompute_liveness6M_v_; text: .text%__1cOMethodLiveness2t6MpnFArena_pnIciMethod__v_; text: .text%__1cOMethodLivenessNinit_gen_kill6M_v_; @@ -1654,7 +1609,6 @@ text: .text%__1cIGraphKitHopt_iff6MpnENode_2_2_; text: .text%__1cLRShiftINodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cJTimeStampGupdate6M_v_; text: .text%__1cRmethodDataOopDescKmileage_of6FpnNmethodOopDesc__i_; -text: .text%__1cWconstantPoolCacheKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cMloadConDNodeIpipeline6kM_pknIPipeline__; text: .text%__1cFParseQarray_addressing6MnJBasicType_ippknEType__pnENode__; text: .text%__1cNloadConP0NodeLout_RegMask6kM_rknHRegMask__; @@ -1673,7 +1627,6 @@ text: .text%__1cWstatic_call_RelocationEtype6M_nJrelocInfoJrelocType__: relocInf text: .text%__1cNflagsRegLOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cYciExceptionHandlerStreamPcount_remaining6M_i_; text: .text%__1cFParseXcatch_inline_exceptions6MpnNSafePointNode__v_; -text: .text%__1cRconstantPoolKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cNobjArrayKlassKcopy_array6MpnMarrayOopDesc_i2iipnGThread__v_; text: .text%__1cKcmpOpUOperNgreater_equal6kM_i_: ad_sparc_clone.o; text: .text%JVM_GetFieldIxModifiers; @@ -1698,7 +1651,6 @@ text: .text%__1cKo0RegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cIregDOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cNmethodOopDescTverified_code_entry6M_pC_; text: .text%__1cNSharedRuntimeXfind_callee_info_helper6FpnKJavaThread_rnMvframeStream_rnJBytecodesECode_rnICallInfo_pnGThread__nGHandle__; -text: .text%__1cPBytecode_invokeFindex6kM_i_; text: .text%__1cLRethrowNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cSPSKeepAliveClosureGdo_oop6MppnHoopDesc__v_: psScavenge.o; text: .text%__1cFParseFBlockRsuccessor_for_bci6Mi_p1_; @@ -1736,7 +1688,6 @@ text: .text%__1cJCodeCacheMfind_nmethod6Fpv_pnHnmethod__; text: .text%__1cOPhaseIdealLoopMdominated_by6MpnENode_2_v_; text: .text%__1cQshlI_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cFParseNthrow_to_exit6MpnNSafePointNode__v_; -text: .text%__1cQinstanceRefKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cVConstantOopWriteValueIwrite_on6MpnUDebugInfoWriteStream__v_; text: .text%__1cJVectorSetGslamin6Mrk0_v_; text: .text%JVM_Clone; @@ -1772,7 +1723,6 @@ text: .text%__1cXmembar_release_lockNodeIadr_type6kM_pknHTypePtr__; text: .text%__1cJNode_ListEyank6MpnENode__v_; text: .text%__1cMPhaseChaitinISimplify6M_v_; text: .text%__1cNIdealLoopTreeIset_nest6MI_i_; -text: .text%__1cSCallLeafDirectNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIMulLNodeImul_ring6kMpknEType_3_3_; text: .text%__1cMStartOSRNodeGOpcode6kM_i_; text: .text%__1cSCallLeafDirectNodeLout_RegMask6kM_rknHRegMask__; @@ -1792,7 +1742,6 @@ text: .text%__1cSMemBarVolatileNodeGOpcode6kM_i_; text: .text%__1cLstoreB0NodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cRshrI_reg_imm5NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQjava_lang_StringOas_utf8_string6FpnHoopDesc__pc_; -text: .text%__1cRcmpFastUnlockNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNSafePointNodeLpop_monitor6M_v_; text: .text%__1cMPhaseChaitinVfind_base_for_derived6MppnENode_2rI_2_; text: .text%__1cLOptoRuntimebAcomplete_monitor_exit_Type6F_pknITypeFunc__; @@ -1824,8 +1773,6 @@ text: .text%__1cOGenerateOopMapGdo_ldc6Mii_v_; text: .text%__1cJCMoveNodeLis_cmove_id6FpnOPhaseTransform_pnENode_44pnIBoolNode__4_; text: .text%__1cKTypeAryPtrQcast_to_ptr_type6kMnHTypePtrDPTR__pknEType__; text: .text%__1cOPhaseIdealLoopKDominators6M_v_; -text: .text%__1cOPhaseIdealLoopPbuild_loop_late6MrnJVectorSet_rnJNode_List_rnKNode_Stack_pk0_v_; -text: .text%__1cOPhaseIdealLoopQbuild_loop_early6MrnJVectorSet_rnJNode_List_rnKNode_Stack_pk0_v_; text: .text%jni_NewGlobalRef: jni.o; text: .text%__1cTciConstantPoolCache2t6MpnFArena_i_v_; text: .text%__1cIAndINodeJideal_reg6kM_I_: classes.o; @@ -1981,10 +1928,8 @@ text: .text%__1cFciEnvKcompile_id6M_I_; text: .text%__1cPmethodDataKlassIallocate6MnMmethodHandle_pnGThread__pnRmethodDataOopDesc__; text: .text%__1cKoopFactoryOnew_methodData6FnMmethodHandle_pnGThread__pnRmethodDataOopDesc__; text: .text%__1cIAndLNodeJideal_reg6kM_I_: classes.o; -text: .text%__1cKCodeBuffer2t6MpCi_v_; text: .text%__1cVshrL_reg_imm6_L2INodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cLConvL2INodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cIciMethodRinstructions_size6M_i_; text: .text%__1cSmulI_reg_imm13NodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cCosXthread_local_storage_at6Fi_pv_; text: .text%__1cMindIndexOperNconstant_disp6kM_i_: ad_sparc.o; @@ -2013,7 +1958,6 @@ text: .text%__1cLOpaque2NodeLbottom_type6kM_pknEType__: connode.o; text: .text%__1cSconvI2D_helperNodeIpipeline6kM_pknIPipeline__; text: .text%__1cUPSGenerationCountersKupdate_all6M_v_: psGenerationCounters.o; text: .text%__1cQComputeCallStackHdo_long6M_v_: generateOopMap.o; -text: .text%__1cKTypeOopPtrSmake_from_constant6FpnIciObject__pk0_; text: .text%__1cQregP_to_stkPNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cOGenerateOopMapHppstore6MpnNCellTypeState_i_v_; text: .text%__1cJTimeStampSticks_since_update6kM_x_; @@ -2038,7 +1982,6 @@ text: .text%__1cIXorINodeGadd_id6kM_pknEType__: classes.o; text: .text%__1cFStateM_sub_Op_AndI6MpknENode__v_; text: .text%__1cVshrL_reg_imm6_L2INodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKcmpOpFOperJnum_edges6kM_I_: ad_sparc_clone.o; -text: .text%__1cLRuntimeStubHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cTmembar_volatileNodeIpipeline6kM_pknIPipeline__; text: .text%__1cJloadFNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateL_sub_Op_OrI6MpknENode__v_; @@ -2066,7 +2009,6 @@ text: .text%__1cJttyLockerbCbreak_tty_lock_for_safepoint6Fi_v_; text: .text%__1cSmembar_acquireNodeIadr_type6kM_pknHTypePtr__; text: .text%__1cPorI_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIPhaseCFGOinsert_goto_at6MII_v_; -text: .text%__1cITypeLongFwiden6kMpknEType__3_; text: .text%__1cSThreadLocalStoragePget_thread_slow6F_pnGThread__; text: .text%__1cPCallRuntimeNodeGOpcode6kM_i_; text: .text%__1cJcmpOpOperNgreater_equal6kM_i_: ad_sparc_clone.o; @@ -2097,7 +2039,6 @@ text: .text%__1cSTailCalljmpIndNodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cKstoreLNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cGIfNodeMdominated_by6MpnENode_pnMPhaseIterGVN__v_; text: .text%__1cOcompiledVFrame2t6MpknFframe_pknLRegisterMap_pnKJavaThread_pnJScopeDesc__v_; -text: .text%__1cJScopeDesc2t6MpknHnmethod_i_v_; text: .text%__1cQshlI_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cOGenerateOopMapJdo_astore6Mi_v_; text: .text%__1cbFunnecessary_membar_volatileNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; @@ -2127,7 +2068,6 @@ text: .text%__1cLBoxLockNode2t6Mi_v_; text: .text%__1cPconvF2D_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cLOptoRuntimebBcomplete_monitor_enter_Type6F_pknITypeFunc__; text: .text%__1cIGraphKitLshared_lock6MpnENode__pnMFastLockNode__; -text: .text%__1cPcmpFastLockNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNloadConP0NodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cRorI_reg_imm13NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cKcmpOpUOperEless6kM_i_: ad_sparc_clone.o; @@ -2135,7 +2075,6 @@ text: .text%__1cQaddF_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cRLowMemoryDetectorWdetect_after_gc_memory6FpnKMemoryPool__v_; text: .text%lwp_mutex_init: os_solaris.o; text: .text%__1cRsubI_zero_regNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cFframeLnmethods_do6M_v_; text: .text%__1cQjava_lang_ThreadGthread6FpnHoopDesc__pnKJavaThread__; text: .text%__1cQnotemp_iRegIOperEtype6kM_pknEType__: ad_sparc.o; text: .text%__1cITemplateIbytecode6kM_nJBytecodesECode__; @@ -2178,7 +2117,6 @@ text: .text%__1cKManagementJtimestamp6F_x_; text: .text%__1cIPSOldGenPupdate_counters6M_v_; text: .text%__1cQshrI_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cFForteNregister_stub6FpkcpC3_v_; -text: .text%__1cFVTuneNregister_stub6FpkcpC3_v_; text: .text%__1cNinstanceKlassbFlookup_method_in_all_interfaces6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cTloadL_unalignedNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cJloadLNodeOmemory_operand6kM_pknIMachOper__; @@ -2249,11 +2187,9 @@ text: .text%__1cSmembar_acquireNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cYDebugInformationRecorderHcopy_to6MpnHnmethod__v_; text: .text%__1cVExceptionHandlerTableHcopy_to6MpnHnmethod__v_; text: .text%__1cJCodeCacheGcommit6FpnICodeBlob__v_; -text: .text%__1cFVTuneOcreate_nmethod6FpnHnmethod__v_; text: .text%__1cHnmethodQcopy_scopes_data6MpCi_v_; text: .text%__1cFciEnvVnum_inlined_bytecodes6kM_i_; text: .text%__1cWImplicitExceptionTableHcopy_to6MpnHnmethod__v_; -text: .text%__1cLOopRecorderHcopy_to6MpnICodeBlob__v_; text: .text%__1cIciMethodRbuild_method_data6M_v_; text: .text%__1cHCompileIOptimize6M_v_; text: .text%__1cHCompileLFinish_Warm6M_v_; @@ -2365,7 +2301,6 @@ text: .text%__1cQmulF_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cQxorI_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cWCallLeafNoFPDirectNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cLcmpD_ccNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cWCallLeafNoFPDirectNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJloadINodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cbBopt_virtual_call_RelocationLstatic_stub6M_pC_; text: .text%__1cNTemplateTableDdef6FnJBytecodesECode_inITosState_3pFi_vi_v_; @@ -2392,8 +2327,6 @@ text: .text%__1cSandI_reg_imm13NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIimmLOperJnum_edges6kM_I_: ad_sparc_clone.o; text: .text%__1cFParseOmerge_new_path6Mi_v_; text: .text%__1cQregP_to_stkPNodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; -text: .text%__1cQjava_lang_StringGoffset6FpnHoopDesc__i_; -text: .text%__1cQjava_lang_StringFvalue6FpnHoopDesc__pnQtypeArrayOopDesc__; text: .text%__1cQjava_lang_StringScreate_from_symbol6FnMsymbolHandle_pnGThread__nGHandle__; text: .text%__1cSmembar_releaseNodeLout_RegMask6kM_rknHRegMask__; text: .text%jni_NewByteArray: jni.o; @@ -2402,7 +2335,6 @@ text: .text%__1cJJavaCallsMcall_special6FpnJJavaValue_nGHandle_nLKlassHandle_nMs text: .text%__1cQSystemDictionarybAvalidate_protection_domain6FnTinstanceKlassHandle_nGHandle_2pnGThread__v_; text: .text%__1cKDictionaryVadd_protection_domain6MiInTinstanceKlassHandle_nGHandle_2pnGThread__v_; text: .text%__1cFParseLdo_newarray6MnJBasicType__v_; -text: .text%__1cPmethodDataKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cNmethodOopDescKklass_name6kM_pnNsymbolOopDesc__; text: .text%__1cSconvI2D_helperNodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cLstoreP0NodeLout_RegMask6kM_rknHRegMask__; @@ -2454,7 +2386,6 @@ text: .text%__1cJScopeDescGsender6kM_p0_; text: .text%__1cSxorI_reg_imm13NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cOcompiledVFrameGsender6kM_pnGvframe__; text: .text%__1cZInterpreterMacroAssemblerDpop6MnITosState__v_; -text: .text%__1cGThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cQPlaceholderTableHoops_do6MpnKOopClosure__v_; text: .text%__1cXJvmtiCurrentBreakpointsHoops_do6FpnKOopClosure__v_; text: .text%__1cNMemoryServiceHoops_do6FpnKOopClosure__v_; @@ -2462,7 +2393,6 @@ text: .text%__1cNThreadServiceHoops_do6FpnKOopClosure__v_; text: .text%__1cKJNIHandlesHoops_do6FpnKOopClosure__v_; text: .text%__1cQSystemDictionaryRpreloaded_oops_do6FpnKOopClosure__v_; text: .text%__1cLJvmtiExportHoops_do6FpnKOopClosure__v_; -text: .text%__1cIVMThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cKJNIHandlesMweak_oops_do6FpnRBoolObjectClosure_pnKOopClosure__v_; text: .text%__1cSObjectSynchronizerHoops_do6FpnKOopClosure__v_; text: .text%__1cMFlatProfilerHoops_do6FpnKOopClosure__v_; @@ -2510,8 +2440,6 @@ text: .text%__1cMTypeKlassPtrFxmeet6kMpknEType__3_; text: .text%__1cKPSYoungGenPupdate_counters6M_v_; text: .text%__1cWThreadLocalAllocBufferbFaccumulate_statistics_before_gc6F_v_; text: .text%__1cWThreadLocalAllocBufferQresize_all_tlabs6F_v_; -text: .text%__1cPGCMemoryManagerIgc_begin6M_v_; -text: .text%__1cPGCMemoryManagerGgc_end6M_v_; text: .text%__1cRLowMemoryDetectorRdetect_low_memory6F_v_; text: .text%__1cNMemoryServiceStrack_memory_usage6F_v_; text: .text%__1cbAPSGCAdaptivePolicyCountersPupdate_counters6M_v_; @@ -2527,7 +2455,6 @@ text: .text%__1cORuntimeServicebDrecord_safepoint_synchronized6F_v_; text: .text%__1cQaddF_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cUSafepointSynchronizeFbegin6F_v_; text: .text%__1cKarrayKlassTallocate_arrayArray6MiipnGThread__pnPobjArrayOopDesc__; -text: .text%__1cONMethodSweeperFsweep6F_v_; text: .text%__1cCosbAmake_polling_page_readable6F_v_; text: .text%__1cUSafepointSynchronizeDend6F_v_; text: .text%__1cOcmovII_immNodeErule6kM_I_: ad_sparc_misc.o; @@ -2539,7 +2466,6 @@ text: .text%JVM_GetCallerClass; text: .text%__1cNSignatureInfoHdo_byte6M_v_: bytecode.o; text: .text%__1cOcmovPP_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cKstoreBNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cSobjArrayKlassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cLstoreC0NodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cTloadL_unalignedNodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cICmpFNodeGOpcode6kM_i_; @@ -2551,7 +2477,6 @@ text: .text%jni_IsAssignableFrom: jni.o; text: .text%jni_GetFieldID: jni.o; text: .text%__1cJLoadPNodeMstore_Opcode6kM_i_: classes.o; text: .text%__1cLstoreB0NodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cZInterpreterMacroAssemblerbAget_cache_and_index_at_bcp6MpnMRegisterImpl_2i_v_; text: .text%__1cHTypeAryFxdual6kM_pknEType__; text: .text%__1cMtlsLoadPNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIVMThreadHexecute6FpnMVM_Operation__v_; @@ -2626,9 +2551,7 @@ text: .text%__1cJloadSNodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cRloadConP_pollNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNObjectMonitorHRecycle6M_v_; text: .text%__1cNSharedRuntimeSfind_callee_method6FpnKJavaThread_pnGThread__nMmethodHandle__; -text: .text%__1cMloadConLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJloadDNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cQSystemDictionaryTresolve_from_stream6FnMsymbolHandle_nGHandle_2pnPClassFileStream_pnGThread__pnMklassOopDesc__; text: .text%__1cQstkI_to_regFNodeIpipeline6kM_pknIPipeline__; text: .text%__1cQregP_to_stkPNodeIpipeline6kM_pknIPipeline__; text: .text%__1cZInterpreterMacroAssemblerFpop_i6MpnMRegisterImpl__v_; @@ -2636,7 +2559,6 @@ text: .text%__1cIMaxINodeGadd_id6kM_pknEType__: classes.o; text: .text%__1cNSharedRuntimeTreresolve_call_site6FpnKJavaThread_pnGThread__nMmethodHandle__; text: .text%__1cYcompareAndSwapL_boolNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNSCMemProjNodeJideal_reg6kM_I_: classes.o; -text: .text%__1cYcompareAndSwapL_boolNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIProjNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIPSOldGenMmax_gen_size6M_I_: psOldGen.o; text: .text%__1cKExceptionsK_throw_msg6FpnGThread_pkcipnNsymbolOopDesc_4_v_; @@ -2855,7 +2777,6 @@ text: .text%__1cOstackSlotPOperEtype6kM_pknEType__: ad_sparc.o; text: .text%jni_GetMethodID: jni.o; text: .text%__1cQshlL_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIMulINodeJideal_reg6kM_I_: classes.o; -text: .text%__1cNminI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cRshlI_reg_imm5NodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cOloadConL13NodeIpipeline6kM_pknIPipeline__; text: .text%__1cNObjectMonitorGnotify6MpnGThread__v_; @@ -2877,7 +2798,6 @@ text: .text%__1cQcmovI_reg_ltNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNloadConL0NodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cKo1RegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cSsubL_reg_reg_1NodeIpipeline6kM_pknIPipeline__; -text: .text%__1cIBytecodeIset_code6MnJBytecodesECode__v_; text: .text%__1cQshrL_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cRsarL_reg_imm6NodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cJloadFNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -2948,7 +2868,6 @@ text: .text%__1cFStateM_sub_Op_SubL6MpknENode__v_; text: .text%__1cKCompiledICMstub_address6kM_pC_; text: .text%__1cJvmSymbolsOsignature_type6FpnNsymbolOopDesc__nJBasicType__; text: .text%__1cQsubL_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cQmodI_reg_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cISubDNodeGOpcode6kM_i_; text: .text%__1cQmodI_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPfieldDescriptorLannotations6kM_pnQtypeArrayOopDesc__; @@ -2986,7 +2905,6 @@ text: .text%__1cRtestI_reg_immNodeIpipeline6kM_pknIPipeline__; text: .text%__1cJMemRegionMintersection6kMk0_0_; text: .text%__1cKJavaThread2t6MpFp0pnGThread__vI_v_; text: .text%__1cKJavaThreadDrun6M_v_; -text: .text%__1cNSafepointBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cPjava_lang_ClassOprimitive_type6FpnHoopDesc__nJBasicType__; text: .text%JVM_IsArrayClass; text: .text%jni_CallStaticVoidMethod: jni.o; @@ -3017,14 +2935,12 @@ text: .text%__1cXNativeSignatureIteratorGdo_int6M_v_: interpreterRT_sparc.o; text: .text%__1cINodeHashEgrow6M_v_; text: .text%__1cOGenerateOopMapPdo_monitorenter6Mi_v_; text: .text%__1cOcmovPP_regNodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; -text: .text%__1cMloadConDNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIMaxINodeIadd_ring6kMpknEType_3_3_; text: .text%__1cJloadSNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cOGenerateOopMapLcompute_map6MpnGThread__v_; text: .text%__1cLConvF2DNodeLbottom_type6kM_pknEType__: classes.o; text: .text%JVM_Open; text: .text%__1cRInvocationCounterFreset6M_v_; -text: .text%__1cRCompilationPolicybIreset_counter_for_invocation_event6MnMmethodHandle__v_; text: .text%__1cOGenerateOopMap2t6MnMmethodHandle__v_; text: .text%__1cOGenerateOopMapRdo_interpretation6M_v_; text: .text%__1cIRetTableRcompute_ret_table6MnMmethodHandle__v_; @@ -3144,7 +3060,6 @@ text: .text%__1cLstoreF0NodeIpipeline6kM_pknIPipeline__; text: .text%__1cIMinINodeIadd_ring6kMpknEType_3_3_; text: .text%JVM_GetInheritedAccessControlContext; text: .text%__1cPPerfDataManagerWcreate_string_constant6FnJCounterNS_pkc3pnGThread__pnSPerfStringConstant__; -text: .text%__1cNmaxI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%JVM_NativePath; text: .text%__1cOMacroAssemblerNflush_windows6M_v_; text: .text%__1cSsubD_regD_regDNodeIpipeline6kM_pknIPipeline__; @@ -3157,13 +3072,11 @@ text: .text%__1cVinline_cache_regPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cKstorePNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cQObjectStartArrayFreset6M_v_; text: .text%__1cPconvI2D_memNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cHThreadsHoops_do6FpnKOopClosure__v_; text: .text%__1cQaddD_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cLConvF2INodeGOpcode6kM_i_; text: .text%__1cVCallRuntimeDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cJHashtableGunlink6MpnRBoolObjectClosure__v_; text: .text%__1cIPSOldGenPadjust_pointers6M_v_; -text: .text%__1cVCallRuntimeDirectNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOcmovPI_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cIPSOldGenHcompact6M_v_; text: .text%__1cMtlsLoadPNodeEsize6kMpnNPhaseRegAlloc__I_; @@ -3177,7 +3090,6 @@ text: .text%__1cOcmovLL_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%jni_GetStaticMethodID: jni.o; text: .text%__1cZInterpreterMacroAssemblerUupdate_mdp_by_offset6MipnMRegisterImpl__v_; text: .text%__1cRtestI_reg_immNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cHnmethodbAmake_not_entrant_or_zombie6Mi_v_; text: .text%__1cPconvF2D_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cOPhaseIdealLoopKdo_peeling6MpnNIdealLoopTree_rnJNode_List__v_; text: .text%__1cOcmovLL_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; @@ -3290,7 +3202,6 @@ text: .text%__1cINegDNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cLConvI2FNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cOcmovLL_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRorI_reg_imm13NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cTloadL_unalignedNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cTloadL_unalignedNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cKloadUBNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cXconvI2D_regDHi_regDNodeIpipeline6kM_pknIPipeline__; @@ -3371,7 +3282,6 @@ text: .text%__1cYjava_lang_reflect_MethodEslot6FpnHoopDesc__i_; text: .text%__1cYjava_lang_reflect_MethodFclazz6FpnHoopDesc__2_; text: .text%__1cYinternal_word_RelocationGtarget6M_pC_; text: .text%__1cJStubQdDueueKremove_all6M_v_; -text: .text%__1cMloadConFNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cPconvI2D_memNodeIpipeline6kM_pknIPipeline__; text: .text%__1cPorL_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cZInterpreterMacroAssemblerLindex_check6MpnMRegisterImpl_2i22_v_; @@ -3405,12 +3315,10 @@ text: .text%__1cSInterpreterRuntimeQcreate_exception6FpnKJavaThread_pc3_v_; text: .text%__1cQComputeCallStackIdo_array6Mii_v_: generateOopMap.o; text: .text%__1cKPSYoungGenKprecompact6M_v_; text: .text%__1cXjava_lang_reflect_FieldEslot6FpnHoopDesc__i_; -text: .text%__1cSconvD2I_helperNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cMnegF_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cHThreadsLgc_prologue6F_v_; text: .text%__1cHThreadsLgc_epilogue6F_v_; text: .text%__1cPconvI2L_regNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cPconvD2I_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJJavaCallsLcall_static6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4nGHandle_pnGThread__v_; text: .text%__1cUParallelScavengeHeapHcollect6MnHGCCauseFCause__v_; text: .text%__1cRCardTableModRefBSFclear6MnJMemRegion__v_; @@ -3449,10 +3357,6 @@ text: .text%__1cKPSYoungGenHcompact6M_v_; text: .text%JVM_GetSystemPackage; text: .text%__1cPfieldDescriptorTfloat_initial_value6kM_f_; text: .text%__1cKPSYoungGenPadjust_pointers6M_v_; -text: .text%__1cQUncommonTrapBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cSDeoptimizationBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cNExceptionBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cJCodeCacheHoops_do6FpnKOopClosure__v_; text: .text%__1cJCodeCacheLgc_prologue6F_v_; text: .text%__1cJCodeCacheLgc_epilogue6F_v_; text: .text%__1cIXorINodeIadd_ring6kMpknEType_3_3_; @@ -3508,16 +3412,13 @@ text: .text%__1cSstring_compareNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%jni_GetEnv; text: .text%__1cJloadDNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cQstkI_to_regINodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cSstring_compareNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cXNativeSignatureIteratorHdo_bool6M_v_: interpreterRT_sparc.o; text: .text%Unsafe_GetNativeByte; text: .text%JVM_NanoTime; text: .text%__1cCosNjavaTimeNanos6F_x_; text: .text%__1cOMacroAssemblerOrestore_thread6MkpnMRegisterImpl__v_; -text: .text%__1cVcompiledICHolderKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cQandL_reg_regNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cIimmFOperJnum_edges6kM_I_: ad_sparc_clone.o; -text: .text%__1cHThreadsLnmethods_do6F_v_; text: .text%__1cKcmpOpFOperGnegate6M_v_: ad_sparc_clone.o; text: .text%__1cICodeBlobFflush6M_v_; text: .text%__1cFParseMdo_anewarray6M_v_; @@ -3537,8 +3438,6 @@ text: .text%__1cHnmethodSflush_dependencies6MpnRBoolObjectClosure__v_; text: .text%__1cKo2RegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cQregI_to_stkINodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cbCAbstractInterpreterGeneratorVgenerate_method_entry6MnTAbstractInterpreterKMethodKind__pC_; -text: .text%__1cParrayKlassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cFVTuneOdelete_nmethod6FpnHnmethod__v_; text: .text%__1cWloadConI_x43300000NodeIpipeline6kM_pknIPipeline__; text: .text%__1cFParseQdo_monitor_enter6M_v_; text: .text%__1cPorL_reg_regNodeIpipeline6kM_pknIPipeline__; @@ -3547,13 +3446,11 @@ text: .text%JVM_FindPrimitiveClass; text: .text%__1cVMoveL2D_stack_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cNTemplateTableEiop26Fn0AJOperation__v_; text: .text%__1cZInterpreterMacroAssemblerMdispatch_via6MnITosState_ppC_v_; -text: .text%__1cSmodL_reg_imm13NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cRshrI_reg_imm5NodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cJJavaCallsLcall_static6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnGThread__v_; text: .text%__1cSsubL_reg_reg_2NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cUmulL_reg_imm13_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIDivDNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cPconvI2F_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNinstanceKlassUfind_interface_field6kMpnNsymbolOopDesc_2pnPfieldDescriptor__pnMklassOopDesc__; text: .text%__1cOstackSlotFOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cUdivL_reg_imm13_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -3561,7 +3458,6 @@ text: .text%__1cRSignatureIteratorHiterate6M_v_; text: .text%__1cOcmovLL_regNodeHtwo_adr6kM_I_: ad_sparc_misc.o; text: .text%__1cJname2type6Fpkc_nJBasicType__; text: .text%__1cSmulL_reg_imm13NodeIpipeline6kM_pknIPipeline__; -text: .text%__1cPBytecode_invokeLresult_type6kMpnGThread__nJBasicType__; text: .text%__1cOloadConL13NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cKcmpOpFOperHgreater6kM_i_: ad_sparc_clone.o; text: .text%__1cIDivDNodeJideal_reg6kM_I_: classes.o; @@ -3589,7 +3485,6 @@ text: .text%__1cNTemplateTableQfast_accessfield6FnITosState__v_; text: .text%__1cKCompiledICSset_to_megamorphic6MpnICallInfo_nJBytecodesECode_pnGThread__v_; text: .text%Unsafe_StaticFieldOffset; text: .text%__1cQmulI_reg_regNodeHsize_of6kM_I_: ad_sparc_misc.o; -text: .text%__1cNTemplateTableXresolve_cache_and_index6FipnMRegisterImpl_2_v_; text: .text%__1cQaddI_reg_regNodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cOcmovLI_regNodeHtwo_adr6kM_I_: ad_sparc_misc.o; text: .text%JVM_GetClassContext; @@ -3725,7 +3620,6 @@ text: .text%__1cQmulD_reg_regNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%Unsafe_AllocateMemory; text: .text%__1cSandL_reg_imm13NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%JVM_GetLastErrorString; -text: .text%__1cQmodL_reg_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNTemplateTableElop26Fn0AJOperation__v_; text: .text%__1cQjava_lang_ThreadKset_daemon6FpnHoopDesc__v_; text: .text%__1cNTemplateTableEfop26Fn0AJOperation__v_; @@ -3738,7 +3632,6 @@ text: .text%__1cNTemplateTableGlstore6Fi_v_; text: .text%__1cLConvF2INodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cIciMethod2t6MpnPciInstanceKlass_pnIciSymbol_4_v_; text: .text%__1cRcompL_reg_regNodeHsize_of6kM_I_: ad_sparc_misc.o; -text: .text%__1cLconvI2BNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cLConvD2FNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cSconvD2I_helperNodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cRsubI_zero_regNodeHsize_of6kM_I_: ad_sparc_misc.o; @@ -3775,7 +3668,6 @@ text: .text%__1cOMacroAssemblerMcall_VM_leaf6MpnMRegisterImpl_pC22_v_; text: .text%__1cOMacroAssemblerMcall_VM_leaf6MpnMRegisterImpl_pC2_v_; text: .text%__1cTjava_lang_ThrowableLset_message6FpnHoopDesc_2_v_; text: .text%__1cOGenerateOopMapTret_jump_targets_do6MpnOBytecodeStream_pFp0ipi_vi4_v_; -text: .text%__1cPconvI2D_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%Unsafe_SetMemory; text: .text%__1cKstfSSFNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cZInterpreterMacroAssemblerOthrow_if_not_x6MnJAssemblerJCondition_pCpnMRegisterImpl__v_; @@ -3798,7 +3690,6 @@ text: .text%__1cRMachSpillCopyNodeHsize_of6kM_I_: ad_sparc.o; text: .text%__1cQCompilerCounters2t6MpkcipnGThread__v_; text: .text%__1cOGenerateOopMapRdo_multianewarray6Mii_v_; text: .text%__1cNCompileBrokerUcompiler_thread_loop6F_v_; -text: .text%__1cbFpartialSubtypeCheck_vs_zeroNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%jni_CallStaticObjectMethodV: jni.o; text: .text%__1cNTemplateTableMfast_xaccess6FnITosState__v_; text: .text%__1cJMemRegionFminus6kMk0_0_; @@ -3857,13 +3748,10 @@ text: .text%__1cLstoreF0NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cZInterpreterMacroAssemblerWprofile_switch_default6MpnMRegisterImpl__v_; text: .text%__1cTAbstract_VM_VersionOvm_info_string6F_pkc_; text: .text%__1cJStubQdDueue2t6MpnNStubInterface_ipnFMutex_pkc_v_; -text: .text%__1cSconvF2I_helperNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cHThreadsbFdeoptimized_wrt_marked_nmethods6F_v_; -text: .text%__1cbAconvL2D_reg_slow_fxtofNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOstackSlotFOperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o; text: .text%__1cOstackSlotFOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o; text: .text%__1cOstackSlotFOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o; -text: .text%__1cPconvF2I_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNTemplateTableGlconst6Fi_v_; text: .text%__1cLstoreC0NodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cMPeriodicTaskGenroll6M_v_; @@ -3913,7 +3801,6 @@ text: .text%__1cLMoveF2INodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cLOptoRuntimeIl2f_Type6F_pknITypeFunc__; text: .text%__1cOMacroAssemblerUcalc_mem_param_words6MpnMRegisterImpl_2_v_; text: .text%__1cZInterpreterMacroAssemblerLprofile_ret6MnITosState_pnMRegisterImpl_3_v_; -text: .text%__1cZInterpreterMacroAssemblerUprofile_virtual_call6MpnMRegisterImpl_2_v_; text: .text%__1cZInterpreterMacroAssemblerMprofile_call6MpnMRegisterImpl__v_; text: .text%__1cLklassVtableQindex_of_miranda6MpnNsymbolOopDesc_2_i_; text: .text%__1cZInterpreterMacroAssemblerSupdate_mdp_for_ret6MnITosState_pnMRegisterImpl__v_; @@ -4001,16 +3888,13 @@ text: .text%__1cSThreadLocalStorageHpd_init6F_v_; text: .text%__1cVMoveF2I_stack_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cVMoveL2D_stack_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cWinvocationCounter_init6F_v_; -text: .text%__1cKTypeOopPtrEmake6FnHTypePtrDPTR_i_pk0_; text: .text%__1cKTypeOopPtrFxdual6kM_pknEType__; text: .text%__1cFParseMjump_if_join6MpnENode_2_2_; text: .text%__1cSinstanceKlassKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cSinstanceKlassKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: instanceKlassKlass.o; -text: .text%__1cLconvP2BNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cETypeRInitialize_shared6FpnHCompile__v_; text: .text%__1cQinstanceRefKlassZupdate_nonstatic_oop_maps6FpnMklassOopDesc__v_; text: .text%__1cVInterfaceSupport_init6F_v_; -text: .text%__1cZInterpreterMacroAssemblerSsuper_call_VM_leaf6MpnMRegisterImpl_pC2_v_; text: .text%__1cPGenerationSizerQinitialize_flags6M_v_: parallelScavengeHeap.o; text: .text%__1cZInterpreterMacroAssemblerPdispatch_normal6MnITosState__v_; text: .text%__1cJTimeStampMmilliseconds6kM_x_; @@ -4103,11 +3987,9 @@ text: .text%__1cLmethodKlassOset_alloc_size6MI_v_: methodKlass.o; text: .text%__1cQvtableStubs_init6F_v_; text: .text%__1cKi0RegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cKg1RegPOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cFVTuneEexit6F_v_; text: .text%__1cLmethodKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: methodKlass.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: methodLiveness.o; text: .text%__1cMMutableSpaceOobject_iterate6MpnNObjectClosure__v_; -text: .text%__1cKvtune_init6F_v_; text: .text%__1cKmutex_init6F_v_; text: .text%__1cQaccessFlags_init6F_v_; text: .text%__1cOMacroAssemblerMcall_VM_leaf6MpnMRegisterImpl_pC222_v_; @@ -4440,7 +4322,6 @@ text: .text%__1cNTemplateTableLtableswitch6F_v_; text: .text%__1cNTemplateTableMlookupswitch6F_v_; text: .text%__1cNTemplateTableRfast_linearswitch6F_v_; text: .text%__1cNTemplateTableRfast_binaryswitch6F_v_; -text: .text%__1cNCompileBrokerVinit_compiler_threads6Fi_v_; text: .text%__1cJPSPermGen2t6MnNReservedSpace_IIIIpkci_v_; text: .text%__1cNCompileBrokerQset_should_block6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: compileBroker.o; diff --git a/hotspot/make/solaris/makefiles/reorder_TIERED_sparcv9 b/hotspot/make/solaris/makefiles/reorder_TIERED_sparcv9 index 15c03b78514..cc44a252232 100644 --- a/hotspot/make/solaris/makefiles/reorder_TIERED_sparcv9 +++ b/hotspot/make/solaris/makefiles/reorder_TIERED_sparcv9 @@ -2,9 +2,7 @@ data = R0x2000; text = LOAD ?RXO; -text: .text%__1cCosOjavaTimeMillis6F_x_; text: .text%__1cQIndexSetIteratorQadvance_and_next6M_I_; -text: .text%__1cNinstanceKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cNinstanceKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cNinstanceKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cOtypeArrayKlassToop_adjust_pointers6MpnHoopDesc__i_; @@ -18,11 +16,9 @@ text: .text%__1cENodeHlatency6MI_I_; text: .text%__1cHRegMaskJis_bound16kM_i_; text: .text%__1cDff16FI_i_; text: .text%__1cHRegMaskESize6kM_I_; -text: .text%__1cXresource_allocate_bytes6FI_pc_; text: .text%__1cENodeIpipeline6kM_pknIPipeline__; text: .text%__1cJVectorSet2R6MI_rnDSet__; text: .text%__1cHRegMaskJis_bound26kM_i_; -text: .text%__1cNSharedRuntimeElmul6Fxx_x_; text: .text%__1cIMachNodeGOpcode6kM_i_; text: .text%__1cJiRegIOperEtype6kM_pknEType__: ad_sparc.o; text: .text%__1cIIndexSetKinitialize6MI_v_; @@ -33,7 +29,6 @@ text: .text%__1cETypeFuhash6Fkpk0_i_; text: .text%__1cQIndexSetIteratorEnext6M_I_: chaitin.o; text: .text%__1cENodeIout_grow6MI_v_; text: .text%__1cOloadConI13NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cNobjArrayKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cENodeHadd_req6Mp0_v_; text: .text%__1cJMarkSweepUAdjustPointerClosureGdo_oop6MppnHoopDesc__v_: markSweep.o; text: .text%__1cNobjArrayKlassToop_follow_contents6MpnHoopDesc__v_; @@ -45,7 +40,6 @@ text: .text%__1cHPhiNodeGOpcode6kM_i_; text: .text%__1cKbranchNodeNis_block_proj6kM_pknENode__: ad_sparc_misc.o; text: .text%__1cIProjNodeGOpcode6kM_i_; text: .text%__1cETypeIhashcons6M_pk0_; -text: .text%__1cOPhaseIdealLoopUbuild_loop_late_post6MpnENode_pk0_v_; text: .text%__1cMPhaseChaitinTinterfere_with_live6MIpnIIndexSet__v_; text: .text%__1cWNode_Backward_IteratorEnext6M_pnENode__; text: .text%__1cNIdealLoopTreeJis_member6kMpk0_i_; @@ -56,7 +50,6 @@ text: .text%__1cOPhaseIdealLoopYsplit_if_with_blocks_pre6MpnENode__2_; text: .text%__1cOPhaseIdealLoopZsplit_if_with_blocks_post6MpnENode__v_; text: .text%__1cIUniverseMnon_oop_word6F_pv_; text: .text%__1cDLRGOcompute_degree6kMr0_i_; -text: .text%__1cFArenaIArealloc6MpvII_1_; text: .text%__1cIConINodeGOpcode6kM_i_; text: .text%__1cETypeEmeet6kMpk0_2_; text: .text%__1cENode2t6MI_v_; @@ -91,7 +84,6 @@ text: .text%__1cOPhaseIdealLoopEsort6MpnNIdealLoopTree_2_2_; text: .text%__1cMMachProjNodeLbottom_type6kM_pknEType__; text: .text%JVM_ArrayCopy; text: .text%__1cOtypeArrayKlassKcopy_array6MpnMarrayOopDesc_i2iipnGThread__v_; -text: .text%__1cNSharedRuntimeDl2f6Fx_f_; text: .text%__1cPjava_lang_ClassLas_klassOop6FpnHoopDesc__pnMklassOopDesc__; text: .text%__1cHConNodeGOpcode6kM_i_; text: .text%__1cMPhaseIterGVNWadd_users_to_worklist06MpnENode__v_; @@ -129,7 +121,6 @@ text: .text%__1cMMachProjNodeLout_RegMask6kM_rknHRegMask__: classes.o; text: .text%__1cRMachSpillCopyNodeKin_RegMask6kMI_rknHRegMask__: ad_sparc.o; text: .text%__1cbAfinal_graph_reshaping_impl6FpnENode_rnUFinal_Reshape_Counts__v_: compile.o; text: .text%__1cOtypeArrayKlassIallocate6MipnGThread__pnQtypeArrayOopDesc__; -text: .text%__1cUParallelScavengeHeapVlarge_typearray_limit6M_I_: parallelScavengeHeap.o; text: .text%__1cIPhaseCCPOtransform_once6MpnENode__2_; text: .text%__1cGciTypeEmake6FnJBasicType__p0_; text: .text%__1cKoopFactoryNnew_typeArray6FnJBasicType_ipnGThread__pnQtypeArrayOopDesc__; @@ -154,7 +145,6 @@ text: .text%__1cETypeFxmeet6kMpk0_2_; text: .text%__1cILRG_ListGextend6MII_v_; text: .text%__1cJVectorSet2F6kMI_i_; text: .text%__1cENodeQIdeal_DU_postCCP6MpnIPhaseCCP__p0_; -text: .text%__1cOtypeArrayKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cIProjNodeEhash6kM_I_; text: .text%__1cIAddINodeGOpcode6kM_i_; text: .text%__1cIIndexSet2t6Mp0_v_; @@ -168,7 +158,6 @@ text: .text%__1cICmpPNodeGOpcode6kM_i_; text: .text%__1cKNode_ArrayGremove6MI_v_; text: .text%__1cHPhiNodeEhash6kM_I_; text: .text%__1cLSymbolTableGlookup6FpkcipnGThread__pnNsymbolOopDesc__; -text: .text%__1cKoopFactoryKnew_symbol6FpkcipnGThread__pnNsymbolOopDesc__; text: .text%__1cKmethodOperJnum_edges6kM_I_: ad_sparc.o; text: .text%__1cJStartNodeLbottom_type6kM_pknEType__; text: .text%__1cHTypeIntFxmeet6kMpknEType__3_; @@ -206,11 +195,7 @@ text: .text%__1cKSchedulingPAddNodeToBundle6MpnENode_pknFBlock__v_; text: .text%__1cICallNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cTconstantPoolOopDescNklass_at_impl6FnSconstantPoolHandle_ipnGThread__pnMklassOopDesc__; text: .text%__1cJLoadPNodeGOpcode6kM_i_; -text: .text%__1cMMutableSpaceIallocate6MI_pnIHeapWord__; -text: .text%__1cJPSPermGenSallocate_permanent6MI_pnIHeapWord__; -text: .text%__1cUParallelScavengeHeapWpermanent_mem_allocate6MI_pnIHeapWord__; text: .text%__1cIMachNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cMMutableSpaceMcas_allocate6MI_pnIHeapWord__; text: .text%__1cNflagsRegPOperEtype6kM_pknEType__: ad_sparc.o; text: .text%__1cHPhiNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cMMachTypeNodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; @@ -235,7 +220,6 @@ text: .text%__1cICmpUNodeGOpcode6kM_i_; text: .text%__1cOPhaseIdealLoopbIdom_lca_for_get_late_ctrl_internal6MpnENode_22_2_; text: .text%__1cXPipeline_Use_Cycle_MaskCOr6Mrk0_v_; text: .text%__1cILoadNodeEhash6kM_I_; -text: .text%__1cKTypeAryPtrKadd_offset6kMi_pknHTypePtr__; text: .text%__1cKHandleMarkKinitialize6MpnGThread__v_; text: .text%__1cKHandleMark2T6M_v_; text: .text%__1cZPhaseConservativeCoalesceIcoalesce6MpnFBlock__v_; @@ -263,7 +247,6 @@ text: .text%__1cJMultiNodeIproj_out6kMI_pnIProjNode__; text: .text%__1cPindOffset13OperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cUcompI_iReg_imm13NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cODataRelocationJset_value6MpC_v_: relocInfo.o; -text: .text%__1cKRelocationRpd_set_data_value6MpCi_v_; text: .text%__1cKCastPPNodeGOpcode6kM_i_; text: .text%__1cOoop_RelocationFvalue6M_pC_: relocInfo.o; text: .text%__1cOoop_RelocationGoffset6M_i_: relocInfo.o; @@ -284,7 +267,6 @@ text: .text%__1cNbranchConNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cOoop_RelocationSfix_oop_relocation6M_v_; text: .text%__1cRSignatureIteratorSiterate_parameters6M_v_; text: .text%__1cIAddPNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cGBitMap2t6MpII_v_; text: .text%__1cPClassFileStreamGget_u46MpnGThread__I_; text: .text%__1cMMachCallNodeLbottom_type6kM_pknEType__; text: .text%__1cFParsePdo_one_bytecode6M_v_; @@ -292,7 +274,6 @@ text: .text%__1cFParseNdo_exceptions6M_v_; text: .text%__1cHPhiNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cHMatcherKmatch_tree6MpknENode__pnIMachNode__; text: .text%__1cMPhaseIterGVNKis_IterGVN6M_p0_: phaseX.o; -text: .text%__1cKimmI13OperIconstant6kM_i_: ad_sparc_clone.o; text: .text%__1cCosVcurrent_stack_pointer6F_pC_; text: .text%__1cEDict2F6kMpkv_pv_; text: .text%__1cKRegionNodeLbottom_type6kM_pknEType__: classes.o; @@ -320,7 +301,6 @@ text: .text%__1cRSignatureIteratorSiterate_returntype6M_v_; text: .text%__1cSaddP_reg_imm13NodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cIMachNodeHtwo_adr6kM_I_: ad_sparc.o; text: .text%__1cNSafePointNodeHsize_of6kM_I_; -text: .text%__1cLTypeInstPtrKadd_offset6kMi_pknHTypePtr__; text: .text%__1cHCmpNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cPcheckCastPPNodeIpipeline6kM_pknIPipeline__; text: .text%__1cNLoadRangeNodeGOpcode6kM_i_; @@ -371,9 +351,7 @@ text: .text%__1cRshlI_reg_imm5NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cIMachOperDreg6kMpnNPhaseRegAlloc_pknENode__i_; text: .text%__1cNPhaseCoalesceRcombine_these_two6MpnENode_2_v_; text: .text%__1cKcmpOpPOperJnum_edges6kM_I_: ad_sparc_clone.o; -text: .text%__1cKTypeRawPtrKadd_offset6kMi_pknHTypePtr__; text: .text%__1cMloadConINodeErule6kM_I_: ad_sparc_misc.o; -text: .text%__1cFArenaEgrow6MI_pv_; text: .text%__1cMPhaseChaitinLinsert_proj6MpnFBlock_IpnENode_I_v_; text: .text%__1cILoadNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cJStoreNodeLbottom_type6kM_pknEType__; @@ -383,7 +361,6 @@ text: .text%__1cQaddP_reg_regNodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cIHaltNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cPCheckCastPPNodeGOpcode6kM_i_; text: .text%__1cKStorePNodeGOpcode6kM_i_; -text: .text%__1cKRelocationLunpack_data6M_v_: relocInfo.o; text: .text%__1cNflagsRegUOperEtype6kM_pknEType__: ad_sparc.o; text: .text%__1cNinstanceKlassGvtable6kM_pnLklassVtable__; text: .text%__1cPcheckCastPPNodeHtwo_adr6kM_I_: ad_sparc_misc.o; @@ -465,7 +442,6 @@ text: .text%__1cFChunkJnext_chop6M_v_; text: .text%__1cMMergeMemNodeEhash6kM_I_; text: .text%__1cKSchedulingbFComputeRegisterAntidependencies6MpnFBlock__v_; text: .text%__1cKSchedulingPComputeUseCount6MpknFBlock__v_; -text: .text%__1cHTypePtrHget_con6kM_i_; text: .text%__1cNinstanceKlassRprotection_domain6M_pnHoopDesc__: instanceKlass.o; text: .text%__1cIMachNodePcompute_padding6kMi_i_: ad_sparc.o; text: .text%__1cIMachNodeSalignment_required6kM_i_: ad_sparc.o; @@ -477,13 +453,10 @@ text: .text%__1cObranchConUNodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cFBlockJfind_node6kMpknENode__I_; text: .text%__1cUArgumentSizeComputerDset6MinJBasicType__v_: frame.o; text: .text%__1cHCmpNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cNCollectedHeapXallocate_from_tlab_slow6FpnGThread_I_pnIHeapWord__; text: .text%__1cWThreadLocalAllocBufferXclear_before_allocation6M_v_; text: .text%__1cHTypePtrEhash6kM_i_; text: .text%__1cNinstanceKlassRallocate_instance6MpnGThread__pnPinstanceOopDesc__; text: .text%__1cSObjectSynchronizerKslow_enter6FnGHandle_pnJBasicLock_pnGThread__v_; -text: .text%__1cWThreadLocalAllocBufferEfill6MpnIHeapWord_2I_v_; -text: .text%__1cUParallelScavengeHeapRallocate_new_tlab6MI_pnIHeapWord__; text: .text%__1cYNoJvmtiVMObjectAllocMark2t6M_v_; text: .text%__1cYNoJvmtiVMObjectAllocMark2T6M_v_; text: .text%__1cFBlockLfind_remove6MpknENode__v_; @@ -502,7 +475,6 @@ text: .text%__1cNObjectMonitorFenter6MpnGThread__v_; text: .text%__1cENodeKreplace_by6Mp0_v_; text: .text%__1cSObjectSynchronizerJslow_exit6FpnHoopDesc_pnJBasicLock_pnGThread__v_; text: .text%__1cMMergeMemNodePiteration_setup6Mpk0_v_; -text: .text%__1cFKlassNlookup_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cKDictionaryEfind6MiInMsymbolHandle_nGHandle_2pnGThread__pnMklassOopDesc__; text: .text%__1cRMachSpillCopyNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cKRegionNodeIIdentity6MpnOPhaseTransform__pnENode__; @@ -513,8 +485,6 @@ text: .text%__1cIGraphKitJclone_map6M_pnNSafePointNode__; text: .text%__1cKIfTrueNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cRMemBarReleaseNodeGOpcode6kM_i_; text: .text%__1cKbranchNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cIMachOperIconstant6kM_i_; -text: .text%__1cWMutableSpaceUsedHelperLtake_sample6M_x_: spaceCounters.o; text: .text%__1cGPcDescHreal_pc6kMpknHnmethod__pC_; text: .text%__1cRPSOldPromotionLABFflush6M_v_; text: .text%__1cTconstantPoolOopDescMklass_ref_at6MipnGThread__pnMklassOopDesc__; @@ -526,7 +496,6 @@ text: .text%__1cKTypeRawPtrEhash6kM_i_; text: .text%__1cIBoolNodeKmatch_edge6kMI_I_: subnode.o; text: .text%__1cMMergeMemNodePset_base_memory6MpnENode__v_; text: .text%__1cLIfFalseNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cCosPelapsed_counter6F_x_; text: .text%__1cGBitMapOset_difference6M0_v_; text: .text%__1cNSafePointNodeEjvms6kM_pnIJVMState__: callnode.o; text: .text%__1cOoop_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; @@ -534,7 +503,6 @@ text: .text%__1cMMergeMemNodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%JVM_GetMethodIxLocalsCount; text: .text%__1cNloadRangeNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%JVM_CurrentThread; -text: .text%__1cENodeHget_ptr6kM_i_; text: .text%__1cRcmpFastUnlockNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cIAndINodeGOpcode6kM_i_; text: .text%__1cPClassFileParserYverify_legal_method_name6MnMsymbolHandle_pnGThread__v_; @@ -569,7 +537,6 @@ text: .text%__1cQaddP_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cQaddP_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cMLinkResolverZcheck_klass_accessability6FnLKlassHandle_1pnGThread__v_; text: .text%__1cIJVMStateIof_depth6kMi_p0_; -text: .text%__1cNSharedRuntimeElrem6Fxx_x_; text: .text%__1cRconstantPoolKlassIoop_size6kMpnHoopDesc__i_; text: .text%__1cMciMethodDataLbci_to_data6Mi_pnLProfileData__; text: .text%__1cRMemBarAcquireNodeGOpcode6kM_i_; @@ -579,7 +546,6 @@ text: .text%__1cObranchConUNodeIpipeline6kM_pknIPipeline__; text: .text%__1cJVectorSet2t6MpnFArena__v_; text: .text%__1cKTypeAryPtrFxmeet6kMpknEType__3_; text: .text%__1cVcompP_iRegP_imm13NodeErule6kM_I_: ad_sparc_misc.o; -text: .text%__1cRSignatureIteratorSiterate_parameters6MX_v_; text: .text%__1cICallNodeFmatch6MpknIProjNode_pknHMatcher__pnENode__; text: .text%__1cJTraceTime2T6M_v_; text: .text%__1cITypeNodeFValue6kMpnOPhaseTransform__pknEType__; @@ -605,7 +571,6 @@ text: .text%__1cMTypeKlassPtrEhash6kM_i_; text: .text%__1cMCallLeafNodeGOpcode6kM_i_; text: .text%__1cSCallLeafDirectNodeIpipeline6kM_pknIPipeline__; text: .text%__1cHPhiNodeEmake6FpnENode_2pknEType_pknHTypePtr__p0_; -text: .text%__1cIAddPNodeQmach_bottom_type6FpknIMachNode__pknEType__; text: .text%__1cOcompU_iRegNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cJiRegLOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cNflagsRegPOperKin_RegMask6kMi_pknHRegMask__; @@ -640,7 +605,6 @@ text: .text%__1cJStartNodeGOpcode6kM_i_; text: .text%__1cQregF_to_stkINodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cENodeDcmp6kMrk0_I_; text: .text%__1cHTypeIntFxdual6kM_pknEType__; -text: .text%__1cIciObjectIencoding6M_pnI_jobject__; text: .text%__1cMmerge_region6FpnKRegionNode_pnIPhaseGVN__pnENode__: cfgnode.o; text: .text%__1cJAssemblerOpatched_branch6Fiii_i_; text: .text%__1cJAssemblerSbranch_destination6Fii_i_; @@ -653,7 +617,6 @@ text: .text%__1cWMachCallStaticJavaNodePret_addr_offset6M_i_; text: .text%__1cITypeFuncEmake6FpknJTypeTuple_3_pk0_; text: .text%__1cMloadConDNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cSCallLeafDirectNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cKTypeOopPtrHget_con6kM_i_; text: .text%__1cQsubI_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cIRootNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cJloadLNodeErule6kM_I_: ad_sparc_misc.o; @@ -729,7 +692,6 @@ text: .text%__1cOGenerateOopMapEpush6MnNCellTypeState__v_; text: .text%__1cJloadSNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cKStoreCNodeGOpcode6kM_i_; text: .text%__1cOGenerateOopMapRdo_exception_edge6MpnOBytecodeStream__v_; -text: .text%__1cMstringStreamFwrite6MpkcI_v_; text: .text%__1cOGenerateOopMapDpop6M_nNCellTypeState__; text: .text%__1cHRetNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cPcmpFastLockNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; @@ -738,10 +700,7 @@ text: .text%__1cMLinkResolverOresolve_invoke6FrnICallInfo_nGHandle_nSconstantPoo text: .text%__1cIBoolNodeJideal_reg6kM_I_: subnode.o; text: .text%__1cHCmpNodeJideal_reg6kM_I_: classes.o; text: .text%__1cRloadConP_pollNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cETypeFwiden6kMpk0_2_: type.o; text: .text%__1cLstoreI0NodeIpipeline6kM_pknIPipeline__; -text: .text%__1cFciEnvTget_method_by_index6MpnPciInstanceKlass_inJBytecodesECode__pnIciMethod__; -text: .text%__1cFciEnvYget_method_by_index_impl6MpnPciInstanceKlass_inJBytecodesECode__pnIciMethod__; text: .text%__1cMloadConPNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFciEnvNlookup_method6MpnNinstanceKlass_2pnNsymbolOopDesc_4nJBytecodesECode__pnNmethodOopDesc__; text: .text%__1cKDictionaryKfind_class6MiInMsymbolHandle_nGHandle__pnMklassOopDesc__; @@ -755,7 +714,6 @@ text: .text%__1cSInterpreterRuntimeMmonitorenter6FpnKJavaThread_pnPBasicObjectLo text: .text%__1cSInterpreterRuntimePresolve_get_put6FpnKJavaThread_nJBytecodesECode__v_; text: .text%__1cQsubI_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cXmembar_acquire_lockNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cQaddP_reg_regNodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; text: .text%__1cPCountedLoopNodeGOpcode6kM_i_; text: .text%__1cSInterpreterRuntimeLmonitorexit6FpnKJavaThread_pnPBasicObjectLock__v_; text: .text%__1cIAndLNodeGOpcode6kM_i_; @@ -765,13 +723,10 @@ text: .text%__1cVjava_lang_ClassLoaderbBnon_reflection_class_loader6FpnHoopDesc_ text: .text%__1cFParseFBlockKinit_graph6Mp0_v_; text: .text%__1cMTypeKlassPtrEmake6FnHTypePtrDPTR_pnHciKlass_i_pk0_; text: .text%__1cKRelocationLspec_simple6FnJrelocInfoJrelocType__nQRelocationHolder__; -text: .text%__1cCosGmalloc6FI_pv_; text: .text%__1cSInterpreterRuntimeOresolve_invoke6FpnKJavaThread_nJBytecodesECode__v_; text: .text%__1cIGraphKitTadd_exception_state6MpnNSafePointNode__v_; -text: .text%__1cIimmPOperIconstant6kM_i_: ad_sparc_clone.o; text: .text%__1cIregDOperEtype6kM_pknEType__: ad_sparc.o; text: .text%__1cKstoreINodeIpipeline6kM_pknIPipeline__; -text: .text%__1cICodeHeapLheader_size6F_I_; text: .text%__1cWConstantPoolCacheEntryKset_method6MnJBytecodesECode_nMmethodHandle_i_v_; text: .text%__1cNloadRangeNodeIpipeline6kM_pknIPipeline__; text: .text%__1cFParseMdo_one_block6M_v_; @@ -794,7 +749,6 @@ text: .text%__1cHMatcherKmatch_sfpt6MpnNSafePointNode__pnIMachNode__; text: .text%__1cMFastLockNodeGOpcode6kM_i_; text: .text%__1cLConvL2INodeGOpcode6kM_i_; text: .text%__1cIXorINodeGOpcode6kM_i_; -text: .text%__1cMVirtualSpaceOcommitted_size6kM_I_; text: .text%__1cOcompU_iRegNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cPorI_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cKTypeAryPtrFklass6kM_pnHciKlass__; @@ -812,23 +766,17 @@ text: .text%__1cPcompP_iRegPNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cPsp_ptr_RegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cPClassFileParserbCverify_legal_field_signature6MnMsymbolHandle_1pnGThread__v_; text: .text%__1cPClassFileParserXverify_legal_field_name6MnMsymbolHandle_pnGThread__v_; -text: .text%__1cRshrP_reg_imm5NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cLBoxLockNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cITypeLongEmake6Fxxi_pk0_; text: .text%__1cNloadKlassNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%JVM_GetCPMethodNameUTF; text: .text%__1cMtlsLoadPNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cLstoreB0NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cIimmIOperIconstant6kM_i_: ad_sparc_clone.o; -text: .text%__1cNSharedRuntimeEldiv6Fxx_x_; text: .text%__1cHBitDataKcell_count6M_i_: ciMethodData.o; text: .text%__1cURethrowExceptionNodeNis_block_proj6kM_pknENode__: ad_sparc_misc.o; text: .text%__1cQSystemDictionarybOfind_constrained_instance_or_array_klass6FnMsymbolHandle_nGHandle_pnGThread__pnMklassOopDesc__; text: .text%__1cQsubI_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cJloadBNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cIciSymbol2t6MnMsymbolHandle__v_; text: .text%__1cQaddP_reg_regNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cKmethodOperGmethod6kM_i_: ad_sparc.o; text: .text%__1cFKlassIsubklass6kM_p0_; text: .text%__1cNinstanceKlassbBallocate_permanent_instance6MpnGThread__pnPinstanceOopDesc__; text: .text%__1cXInterpreterFrameClosureJoffset_do6Mi_v_: frame.o; @@ -885,7 +833,6 @@ text: .text%__1cIConLNodeGOpcode6kM_i_; text: .text%JVM_GetCPFieldSignatureUTF; text: .text%__1cENodeLnonnull_req6kM_p0_; text: .text%__1cYCallStaticJavaDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cYCallStaticJavaDirectNodeKmethod_set6Mi_v_; text: .text%__1cMelapsedTimerFstart6M_v_; text: .text%__1cMelapsedTimerEstop6M_v_; text: .text%__1cMURShiftINodeLbottom_type6kM_pknEType__: classes.o; @@ -946,7 +893,6 @@ text: .text%__1cIGraphKitOreplace_in_map6MpnENode_2_v_; text: .text%__1cNinstanceKlassLfind_method6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cHCompileKTracePhase2T6M_v_; text: .text%__1cMPhaseChaitinLclone_projs6MpnFBlock_IpnENode_4rI_i_; -text: .text%__1cNinstanceKlassSlookup_osr_nmethod6kMkpnNmethodOopDesc_i_pnHnmethod__; text: .text%__1cIJVMState2t6MpnIciMethod_p0_v_; text: .text%__1cIHaltNode2t6MpnENode_2_v_; text: .text%__1cLOptoRuntimeSuncommon_trap_Type6F_pknITypeFunc__; @@ -954,7 +900,6 @@ text: .text%__1cJloadLNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cSsafePoint_pollNodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cINodeHashJhash_find6MpknENode__p1_; text: .text%__1cQmulL_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cSaddP_reg_imm13NodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; text: .text%__1cOMethodLivenessKBasicBlock2t6Mp0ii_v_; text: .text%__1cOMethodLivenessKBasicBlockQcompute_gen_kill6MpnIciMethod__v_; text: .text%__1cOGenerateOopMapFppush6MpnNCellTypeState__v_; @@ -966,7 +911,6 @@ text: .text%__1cTCreateExceptionNodeIpipeline6kM_pknIPipeline__; text: .text%__1cLstoreB0NodeIpipeline6kM_pknIPipeline__; text: .text%__1cMtlsLoadPNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cLBoxLockNodeKin_RegMask6kMI_rknHRegMask__; -text: .text%__1cITypeLongEmake6Fx_pk0_; text: .text%__1cHciFieldPinitialize_from6MpnPfieldDescriptor__v_; text: .text%__1cKimmI13OperJnum_edges6kM_I_: ad_sparc_clone.o; text: .text%__1cJloadBNodeIpipeline6kM_pknIPipeline__; @@ -987,7 +931,6 @@ text: .text%__1cFParseHdo_call6M_v_; text: .text%__1cNloadConP0NodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cHMulNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cMPhaseIterGVNJtransform6MpnENode__2_; -text: .text%__1cHTypeIntFwiden6kMpknEType__3_; text: .text%__1cSsafePoint_pollNodeIpipeline6kM_pknIPipeline__; text: .text%__1cJloadSNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cKarrayKlassLobject_size6kMi_i_; @@ -1019,36 +962,26 @@ text: .text%__1cIBoolNodeHsize_of6kM_I_; text: .text%__1cSobjArrayKlassKlassIoop_size6kMpnHoopDesc__i_: objArrayKlassKlass.o; text: .text%__1cPcompP_iRegPNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cJloadPNodeOmemory_operand6kM_pknIMachOper__; -text: .text%__1cPBytecode_invokeJsignature6kM_pnNsymbolOopDesc__; text: .text%__1cFframebGinterpreter_callee_receiver_addr6MnMsymbolHandle__ppnHoopDesc__; text: .text%__1cNSignatureInfoGdo_int6M_v_: bytecode.o; text: .text%__1cOstackSlotLOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cKInlineTreeMok_to_inline6MpnIciMethod_pnIJVMState_rnNciCallProfile_pnMWarmCallInfo__8_; text: .text%__1cOGenerateOopMapbAget_basic_block_containing6kMi_pnKBasicBlock__; -text: .text%__1cICodeHeapSallocated_capacity6kM_I_; -text: .text%__1cICHeapObj2n6FI_pv_; text: .text%__1cQsubL_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cWCallLeafNoFPDirectNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cFTypeDEhash6kM_i_; -text: .text%__1cKTypeRawPtrHget_con6kM_i_; text: .text%__1cJStartNodeFmatch6MpknIProjNode_pknHMatcher__pnENode__; text: .text%jni_ExceptionOccurred: jni.o; text: .text%__1cKciTypeFlowLStateVectorStype_meet_internal6FpnGciType_3p0_3_; text: .text%__1cMloadConINodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cGIfNodeHsize_of6kM_I_: classes.o; text: .text%__1cPconvL2I_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cIimmLOperJconstantL6kM_x_: ad_sparc_clone.o; -text: .text%__1cTStackWalkCompPolicyRcompilation_level6MnMmethodHandle_i_i_; text: .text%jni_GetByteArrayRegion: jni.o; -text: .text%__1cIGraphKitTset_all_memory_call6MpnENode__v_; -text: .text%__1cSHighResTimeSamplerLtake_sample6M_x_: statSampler.o; text: .text%__1cHCompileFstart6kM_pnJStartNode__; text: .text%__1cPStatSamplerTaskEtask6M_v_: statSampler.o; -text: .text%__1cMPeriodicTaskOreal_time_tick6FI_v_; text: .text%__1cQPlaceholderTableKfind_entry6MiInMsymbolHandle_nGHandle__pnNsymbolOopDesc__; text: .text%__1cIParmNodeJideal_reg6kM_I_; text: .text%__1cQandL_reg_regNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cIMachNodeRget_base_and_disp6kMrirpknHTypePtr__pknENode__; text: .text%__1cQSystemDictionarybBresolve_array_class_or_null6FnMsymbolHandle_nGHandle_2pnGThread__pnMklassOopDesc__; text: .text%__1cIregFOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cRbranchLoopEndNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; @@ -1072,7 +1005,6 @@ text: .text%__1cUcompU_iReg_imm13NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%JVM_RawMonitorEnter; text: .text%JVM_RawMonitorExit; text: .text%__1cOMachReturnNodeKin_RegMask6kMI_rknHRegMask__; -text: .text%__1cMTypeKlassPtrKadd_offset6kMi_pknHTypePtr__; text: .text%__1cWShouldNotReachHereNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPcmpFastLockNodeIpipeline6kM_pknIPipeline__; text: .text%__1cETypeRget_typeflow_type6FpnGciType__pk0_; @@ -1082,7 +1014,6 @@ text: .text%__1cXinitialize_static_field6FpnPfieldDescriptor_pnGThread__v_: clas text: .text%__1cURethrowExceptionNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cOJNIHandleBlockOallocate_block6FpnGThread__p0_; text: .text%__1cNSignatureInfoHdo_bool6M_v_: bytecode.o; -text: .text%__1cKBufferBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cSandI_reg_imm13NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cIAddINodeIadd_ring6kMpknEType_3_3_; text: .text%__1cLTypeInstPtrQcast_to_ptr_type6kMnHTypePtrDPTR__pknEType__; @@ -1094,16 +1025,10 @@ text: .text%__1cNLoadKlassNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cPorI_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cLRethrowNodeGOpcode6kM_i_; text: .text%__1cJloadSNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cICodeHeapIcapacity6kM_I_; -text: .text%__1cKMemoryPoolImax_size6kM_I_: memoryPool.o; -text: .text%__1cMCodeHeapPoolNused_in_bytes6M_I_: memoryPool.o; text: .text%__1cPcmpFastLockNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cMCodeHeapPoolQget_memory_usage6M_nLMemoryUsage__; text: .text%__1cFArena2T6M_v_; text: .text%__1cKMemBarNodeFmatch6MpknIProjNode_pknHMatcher__pnENode__; -text: .text%__1cOCallRelocationFvalue6M_pC_: relocInfo.o; -text: .text%__1cHoopDescSslow_identity_hash6M_i_; -text: .text%__1cSObjectSynchronizerXidentity_hash_value_for6FnGHandle__i_; text: .text%__1cLPCTableNodeEhash6kM_I_; text: .text%__1cHConNodeLout_RegMask6kM_rknHRegMask__: classes.o; text: .text%__1cXPhaseAggressiveCoalesceYinsert_copy_with_overlap6MpnFBlock_pnENode_II_v_; @@ -1136,7 +1061,6 @@ text: .text%__1cJloadSNodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cIJumpDataKcell_count6M_i_: ciMethodData.o; text: .text%__1cObranchConPNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cITypeFuncFxdual6kM_pknEType__; -text: .text%__1cQjava_lang_StringGlength6FpnHoopDesc__i_; text: .text%__1cFStateM_sub_Op_CmpI6MpknENode__v_; text: .text%__1cJcmpOpOperFccode6kM_i_: ad_sparc_clone.o; text: .text%__1cGciType2t6MnLKlassHandle__v_; @@ -1175,7 +1099,6 @@ text: .text%jni_ReleasePrimitiveArrayCritical: jni.o; text: .text%__1cPconvI2L_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cNMemoryServiceXtrack_memory_pool_usage6FpnKMemoryPool__v_; text: .text%__1cSmembar_releaseNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cJimmU5OperIconstant6kM_i_: ad_sparc_clone.o; text: .text%__1cPciInstanceKlass2t6MnLKlassHandle__v_; text: .text%__1cLOpaque1NodeEhash6kM_I_; text: .text%__1cJStoreNodeZIdeal_sign_extended_input6MpnIPhaseGVN_i_pnENode__; @@ -1200,11 +1123,9 @@ text: .text%__1cQmulL_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cLstoreP0NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cLRethrowNodeKmatch_edge6kMI_I_; text: .text%__1cFTypeFEhash6kM_i_; -text: .text%__1cHnmethodHoops_do6MpnKOopClosure__v_; text: .text%__1cFStateM_sub_Op_AddI6MpknENode__v_; text: .text%__1cOParseGeneratorIgenerate6MpnIJVMState__2_; text: .text%__1cFParseQcreate_entry_map6M_pnNSafePointNode__; -text: .text%__1cFArenaEused6kM_I_; text: .text%__1cFParseLbuild_exits6M_v_; text: .text%__1cFParseIdo_exits6M_v_; text: .text%__1cFParse2t6MpnIJVMState_pnIciMethod_f_v_; @@ -1213,17 +1134,13 @@ text: .text%__1cFParsePdo_method_entry6M_v_; text: .text%__1cNCallGeneratorKfor_inline6FpnIciMethod_f_p0_; text: .text%__1cbGJvmtiVMObjectAllocEventCollector2t6M_v_; text: .text%__1cbGJvmtiVMObjectAllocEventCollector2T6M_v_; -text: .text%__1cQconstMethodKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cRciVirtualCallDataOtranslate_from6MpnLProfileData__v_; text: .text%jni_IsSameObject: jni.o; text: .text%__1cMloadConINodeIpipeline6kM_pknIPipeline__; text: .text%__1cNbranchConNodeJlabel_set6MrnFLabel_I_v_; text: .text%__1cNbranchConNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQandL_reg_regNodeErule6kM_I_: ad_sparc_misc.o; -text: .text%__1cLmethodKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cLsymbolKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cIciObjectFklass6M_pnHciKlass__; -text: .text%__1cLSymbolTableFprobe6Fpkci_pnNsymbolOopDesc__; text: .text%__1cPThreadLocalNodeGOpcode6kM_i_; text: .text%__1cZPhaseConservativeCoalesceKupdate_ifg6MIIpnIIndexSet_2_v_; text: .text%__1cZPhaseConservativeCoalesceMunion_helper6MpnENode_2II222pnFBlock_I_v_; @@ -1240,14 +1157,11 @@ text: .text%__1cKCastPPNodeQIdeal_DU_postCCP6MpnIPhaseCCP__pnENode__; text: .text%__1cKstorePNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cOPhaseIdealLoopOsplit_thru_phi6MpnENode_2i_2_; text: .text%__1cENodeGOpcode6kM_i_; -text: .text%__1cRshrP_reg_imm5NodeIpipeline6kM_pknIPipeline__; text: .text%__1cQandI_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cIciMethodbBinterpreter_call_site_count6Mi_i_; text: .text%__1cGBitMapIset_from6M0_v_; -text: .text%__1cNCompileBrokerOcompile_method6FnMmethodHandle_i1ipkcpnGThread__pnHnmethod__; text: .text%__1cTconstantPoolOopDescbDresolve_string_constants_impl6FnSconstantPoolHandle_pnGThread__v_; text: .text%__1cHSubNodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cFChunk2n6FII_pv_; text: .text%__1cTCallDynamicJavaNodeGOpcode6kM_i_; text: .text%__1cKstoreBNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cILoadNodeDcmp6kMrknENode__I_; @@ -1261,7 +1175,6 @@ text: .text%__1cHOrINodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cFframeLreal_sender6kMpnLRegisterMap__0_; text: .text%__1cGRFrameGcaller6M_p0_; text: .text%__1cPCheckCastPPNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cRshrP_reg_imm5NodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_; text: .text%__1cXmembar_release_lockNodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; text: .text%__1cJloadINodeOmemory_operand6kM_pknIMachOper__; @@ -1278,7 +1191,6 @@ text: .text%__1cNCatchProjNodeDcmp6kMrknENode__I_; text: .text%__1cKTypeOopPtrEhash6kM_i_; text: .text%__1cIMinINodeGOpcode6kM_i_; text: .text%__1cMURShiftINodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cFframeRoops_code_blob_do6MpnKOopClosure_pknLRegisterMap__v_; text: .text%__1cKTypeRawPtrFxmeet6kMpknEType__3_; text: .text%JVM_GetMethodIxModifiers; text: .text%__1cIMulLNodeLbottom_type6kM_pknEType__: classes.o; @@ -1289,8 +1201,6 @@ text: .text%JVM_IsInterface; text: .text%__1cPorI_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIDivINodeGOpcode6kM_i_; text: .text%__1cOGenerateOopMapTmerge_state_into_bb6MpnKBasicBlock__v_; -text: .text%__1cICodeHeapIallocate6MI_pv_; -text: .text%__1cICodeHeapPsearch_freelist6MI_pnJFreeBlock__; text: .text%__1cLOpaque1NodeLbottom_type6kM_pknEType__: connode.o; text: .text%__1cNloadRangeNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cLRShiftLNodeGOpcode6kM_i_; @@ -1315,7 +1225,6 @@ text: .text%__1cParrayKlassKlassToop_adjust_pointers6MpnHoopDesc__i_; text: .text%__1cParrayKlassKlassToop_follow_contents6MpnHoopDesc__v_; text: .text%__1cIGraphKitYcombine_exception_states6MpnNSafePointNode_2_v_; text: .text%__1cQmulL_reg_regNodeErule6kM_I_: ad_sparc_misc.o; -text: .text%__1cRshrP_reg_imm5NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cSconstMethodOopDescYchecked_exceptions_start6kM_pnXCheckedExceptionElement__; text: .text%__1cPClassFileParserYparse_checked_exceptions6MpHInSconstantPoolHandle_pnGThread__1_; text: .text%__1cKstoreLNodePoper_input_base6kM_I_: ad_sparc_misc.o; @@ -1325,7 +1234,6 @@ text: .text%__1cSconvI2D_helperNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cPClassFileStreamHskip_u26MipnGThread__v_; text: .text%__1cUcompI_iReg_imm13NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cOMacroAssemblerNverify_thread6M_v_; -text: .text%__1cIGraphKitZset_results_for_java_call6MpnMCallJavaNode__pnENode__; text: .text%__1cSbranchCon_longNodeIpipeline6kM_pknIPipeline__; text: .text%__1cHnmethodVcleanup_inline_caches6M_v_; text: .text%__1cTciConstantPoolCacheGinsert6Mipv_v_; @@ -1356,12 +1264,9 @@ text: .text%__1cKoopFactoryTnew_system_objArray6FipnGThread__pnPobjArrayOopDesc_ text: .text%__1cbDcatch_cleanup_find_cloned_def6FpnFBlock_pnENode_1rnLBlock_Array_i_3_: lcm.o; text: .text%__1cQxorI_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cKstoreLNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cFciEnvVget_constant_by_index6MpnPciInstanceKlass_i_nKciConstant__; -text: .text%__1cFciEnvbAget_constant_by_index_impl6MpnPciInstanceKlass_i_nKciConstant__; text: .text%__1cOClearArrayNodeKmatch_edge6kMI_I_; text: .text%__1cPconvL2I_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cJloadSNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cKJavaThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cSFixupMirrorClosureJdo_object6MpnHoopDesc__v_: universe.o; text: .text%__1cFStateP_sub_Op_LShiftI6MpknENode__v_; text: .text%__1cQandL_reg_regNodeLout_RegMask6kM_rknHRegMask__; @@ -1381,13 +1286,11 @@ text: .text%__1cRshlL_reg_imm6NodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cQandI_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cSandI_reg_imm13NodeIpipeline6kM_pknIPipeline__; text: .text%__1cRCardTableModRefBSPdirty_MemRegion6MnJMemRegion__v_; -text: .text%__1cZresource_reallocate_bytes6FpcII_0_; text: .text%__1cLConvL2INodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cOAbstractICacheQinvalidate_range6FpCi_v_; text: .text%__1cKstorePNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIMaxINodeGOpcode6kM_i_; text: .text%__1cTDirectCallGeneratorIgenerate6MpnIJVMState__2_; -text: .text%__1cNCallGeneratorPfor_direct_call6FpnIciMethod__p0_; text: .text%__1cMWarmCallInfoLalways_cold6F_p0_; text: .text%__1cIimmDOperJconstantD6kM_d_: ad_sparc_clone.o; text: .text%__1cIPhaseIFGEinit6MI_v_; @@ -1415,7 +1318,6 @@ text: .text%__1cJloadPNodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cMoutputStream2t6Mi_v_; text: .text%__1cMstringStreamJas_string6M_pc_; text: .text%__1cMstringStream2T6M_v_; -text: .text%__1cMstringStream2t6MI_v_; text: .text%__1cIGraphKitMreset_memory6M_pnENode__; text: .text%__1cZCallDynamicJavaDirectNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cKstorePNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -1472,7 +1374,6 @@ text: .text%__1cSInterpreterRuntimebFexception_handler_for_exception6FpnKJavaThr text: .text%__1cOPhaseIdealLoopPis_counted_loop6MpnENode_pnNIdealLoopTree__2_; text: .text%__1cQComputeCallStackHdo_void6M_v_: generateOopMap.o; text: .text%__1cFKlassRinitialize_supers6MpnMklassOopDesc_pnGThread__v_; -text: .text%__1cKKlass_vtbl2n6FIrnLKlassHandle_ipnGThread__pv_; text: .text%__1cFKlassVbase_create_klass_oop6FrnLKlassHandle_irknKKlass_vtbl_pnGThread__pnMklassOopDesc__; text: .text%__1cQjava_lang_StringLutf8_length6FpnHoopDesc__i_; text: .text%jni_GetStringUTFLength: jni.o; @@ -1494,7 +1395,6 @@ text: .text%__1cQjava_lang_StringRas_unicode_string6FpnHoopDesc_ri_pH_; text: .text%JVM_InternString; text: .text%__1cLStringTableGintern6FpnHoopDesc_pnGThread__2_; text: .text%__1cCosGrandom6F_l_; -text: .text%__1cKimmP13OperIconstant6kM_i_: ad_sparc_clone.o; text: .text%__1cVcompP_iRegP_imm13NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cKoopFactoryXnew_permanent_byteArray6FipnGThread__pnQtypeArrayOopDesc__; text: .text%__1cRcompL_reg_regNodeIpipeline6kM_pknIPipeline__; @@ -1512,7 +1412,6 @@ text: .text%__1cPciObjectFactoryMvm_symbol_at6Fi_pnIciSymbol__; text: .text%__1cKDictionaryJadd_klass6MnMsymbolHandle_nGHandle_nLKlassHandle__v_; text: .text%__1cVshrL_reg_imm6_L2INodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cZCallDynamicJavaDirectNodePoper_input_base6kM_I_: ad_sparc_misc.o; -text: .text%__1cIGraphKitTcreate_and_xform_if6MpnENode_2ff_pnGIfNode__: graphKit.o; text: .text%__1cWImplicitExceptionTableGappend6MII_v_; text: .text%__1cRMachNullCheckNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLProfileDataPpost_initialize6MpnOBytecodeStream_pnRmethodDataOopDesc__v_: ciMethodData.o; @@ -1534,14 +1433,12 @@ text: .text%__1cFKlassMset_subklass6MpnMklassOopDesc__v_; text: .text%__1cOGenerateOopMapLmerge_state6Fp0ipi_v_; text: .text%__1cMTypeKlassPtrFxdual6kM_pknEType__; text: .text%__1cQSystemDictionaryVdefine_instance_class6FnTinstanceKlassHandle_pnGThread__v_; -text: .text%__1cSinstanceKlassKlassXallocate_instance_klass6MiiiinNReferenceType_pnGThread__pnMklassOopDesc__; text: .text%__1cPClassFileParserbBcheck_final_method_override6FnTinstanceKlassHandle_pnGThread__v_; text: .text%__1cJCodeCachebKnumber_of_nmethods_with_dependencies6F_i_; text: .text%__1cNinstanceKlassQinit_implementor6M_v_; text: .text%__1cPClassFileStream2t6MpCipc_v_; text: .text%__1cNinstanceKlassSprocess_interfaces6MpnGThread__v_; text: .text%__1cNinstanceKlassYcompute_secondary_supers6MipnGThread__pnPobjArrayOopDesc__; -text: .text%__1cKoopFactoryRnew_instanceKlass6FiiiinNReferenceType_pnGThread__pnMklassOopDesc__; text: .text%__1cNinstanceKlassWdo_local_static_fields6MpFpnPfieldDescriptor_pnGThread__v4_v_; text: .text%__1cPClassFileParserMsort_methods6MnOobjArrayHandle_111pnGThread__nPtypeArrayHandle__; text: .text%__1cFKlassKsuperklass6kM_pnNinstanceKlass__; @@ -1561,22 +1458,17 @@ text: .text%__1cISubINodeJideal_reg6kM_I_: classes.o; text: .text%__1cNinstanceKlassOset_alloc_size6MI_v_: instanceKlass.o; text: .text%__1cNinstanceKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: instanceKlass.o; text: .text%__1cHMemNodeHsize_of6kM_I_; -text: .text%__1cFVTuneQstart_class_load6F_v_; text: .text%__1cSThreadProfilerMark2T6M_v_; -text: .text%__1cFVTuneOend_class_load6F_v_; text: .text%__1cLClassLoaderOload_classfile6FnMsymbolHandle_pnGThread__nTinstanceKlassHandle__; text: .text%__1cJEventMark2t6MpkcE_v_: classLoader.o; text: .text%__1cSThreadProfilerMark2t6Mn0AGRegion__v_; text: .text%__1cQSystemDictionaryRload_shared_class6FnTinstanceKlassHandle_nGHandle_pnGThread__1_; -text: .text%__1cKklassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cPClassFileParserbKparse_classfile_sourcefile_attribute6MnSconstantPoolHandle_nTinstanceKlassHandle_pnGThread__v_; text: .text%__1cQmodI_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cLRShiftINodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cKCMoveINodeGOpcode6kM_i_; text: .text%__1cLLShiftLNodeGOpcode6kM_i_; text: .text%__1cYcompareAndSwapL_boolNodeErule6kM_I_: ad_sparc_misc.o; -text: .text%__1cSinstanceKlassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cNinstanceKlassScopy_static_fields6MpnSPSPromotionManager__v_; text: .text%__1cMtlsLoadPNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateQ_sub_Op_URShiftI6MpknENode__v_; text: .text%__1cKcmpOpUOperGnegate6M_v_: ad_sparc_clone.o; @@ -1619,14 +1511,12 @@ text: .text%__1cLklassItableTcompute_itable_size6FnOobjArrayHandle__i_; text: .text%__1cQandI_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIXorINodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cRmethodDataOopDescLbci_to_data6Mi_pnLProfileData__; -text: .text%__1cFframeZinterpreter_frame_set_bcx6Mi_v_; text: .text%__1cMnegF_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cLstoreI0NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cTOopMapForCacheEntryZfill_stackmap_for_opcodes6MpnOBytecodeStream_pnNCellTypeState_4i_v_; text: .text%__1cSaddL_reg_imm13NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQshrL_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cKstoreLNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cNSharedRuntimebKexception_handler_for_return_address6FpC_1_; text: .text%__1cILoopNodeHsize_of6kM_I_: classes.o; text: .text%__1cHMatcherLfind_shared6MpnENode__v_; text: .text%__1cJStartNodeHsize_of6kM_I_; @@ -1643,8 +1533,6 @@ text: .text%__1cRcompL_reg_conNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cMLinkResolverbHlookup_instance_method_in_klasses6FrnMmethodHandle_nLKlassHandle_nMsymbolHandle_4pnGThread__v_; text: .text%__1cMnegF_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cNSharedRuntimebWnative_method_throw_unsatisfied_link_error_entry6F_pC_; -text: .text%__1cTStackWalkCompPolicyYmethod_back_branch_event6MnMmethodHandle_iipnGThread__v_; -text: .text%__1cRCompilationPolicybJreset_counter_for_back_branch_event6MnMmethodHandle__v_; text: .text%__1cOMethodLivenessQcompute_liveness6M_v_; text: .text%__1cOMethodLiveness2t6MpnFArena_pnIciMethod__v_; text: .text%__1cOMethodLivenessNinit_gen_kill6M_v_; @@ -1654,7 +1542,6 @@ text: .text%__1cIGraphKitHopt_iff6MpnENode_2_2_; text: .text%__1cLRShiftINodeIIdentity6MpnOPhaseTransform__pnENode__; text: .text%__1cJTimeStampGupdate6M_v_; text: .text%__1cRmethodDataOopDescKmileage_of6FpnNmethodOopDesc__i_; -text: .text%__1cWconstantPoolCacheKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cMloadConDNodeIpipeline6kM_pknIPipeline__; text: .text%__1cFParseQarray_addressing6MnJBasicType_ippknEType__pnENode__; text: .text%__1cNloadConP0NodeLout_RegMask6kM_rknHRegMask__; @@ -1666,14 +1553,11 @@ text: .text%__1cQcmovI_reg_ltNodeIpipeline6kM_pknIPipeline__; text: .text%__1cRsubI_zero_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cJcmpOpOperFequal6kM_i_: ad_sparc_clone.o; text: .text%__1cHCompilebAvarargs_C_out_slots_killed6kM_I_; -text: .text%__1cXJNI_ArgumentPusherVaArgHiterate6MX_v_: jni.o; -text: .text%__1cbBjava_lang_ref_SoftReferenceFclock6F_x_; text: .text%__1cOPhaseIdealLoopQset_subtree_ctrl6MpnENode__v_; text: .text%__1cWstatic_call_RelocationEtype6M_nJrelocInfoJrelocType__: relocInfo.o; text: .text%__1cNflagsRegLOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cYciExceptionHandlerStreamPcount_remaining6M_i_; text: .text%__1cFParseXcatch_inline_exceptions6MpnNSafePointNode__v_; -text: .text%__1cRconstantPoolKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cNobjArrayKlassKcopy_array6MpnMarrayOopDesc_i2iipnGThread__v_; text: .text%__1cKcmpOpUOperNgreater_equal6kM_i_: ad_sparc_clone.o; text: .text%JVM_GetFieldIxModifiers; @@ -1698,7 +1582,6 @@ text: .text%__1cKo0RegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cIregDOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cNmethodOopDescTverified_code_entry6M_pC_; text: .text%__1cNSharedRuntimeXfind_callee_info_helper6FpnKJavaThread_rnMvframeStream_rnJBytecodesECode_rnICallInfo_pnGThread__nGHandle__; -text: .text%__1cPBytecode_invokeFindex6kM_i_; text: .text%__1cLRethrowNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cSPSKeepAliveClosureGdo_oop6MppnHoopDesc__v_: psScavenge.o; text: .text%__1cFParseFBlockRsuccessor_for_bci6Mi_p1_; @@ -1724,7 +1607,6 @@ text: .text%__1cLMachNopNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cOPhaseIdealLoopNreorg_offsets6MpnNIdealLoopTree__v_; text: .text%__1cRshrL_reg_imm6NodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cNmethodOopDescVset_signature_handler6MpC_v_; -text: .text%__1cbBjava_lang_ref_SoftReferenceJtimestamp6FpnHoopDesc__x_; text: .text%__1cPcompP_iRegPNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cSxorI_reg_imm13NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cOPhaseIdealLoopRsplit_thru_region6MpnENode_2_2_; @@ -1736,7 +1618,6 @@ text: .text%__1cJCodeCacheMfind_nmethod6Fpv_pnHnmethod__; text: .text%__1cOPhaseIdealLoopMdominated_by6MpnENode_2_v_; text: .text%__1cQshlI_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cFParseNthrow_to_exit6MpnNSafePointNode__v_; -text: .text%__1cQinstanceRefKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cVConstantOopWriteValueIwrite_on6MpnUDebugInfoWriteStream__v_; text: .text%__1cJVectorSetGslamin6Mrk0_v_; text: .text%JVM_Clone; @@ -1772,7 +1653,6 @@ text: .text%__1cXmembar_release_lockNodeIadr_type6kM_pknHTypePtr__; text: .text%__1cJNode_ListEyank6MpnENode__v_; text: .text%__1cMPhaseChaitinISimplify6M_v_; text: .text%__1cNIdealLoopTreeIset_nest6MI_i_; -text: .text%__1cSCallLeafDirectNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIMulLNodeImul_ring6kMpknEType_3_3_; text: .text%__1cMStartOSRNodeGOpcode6kM_i_; text: .text%__1cSCallLeafDirectNodeLout_RegMask6kM_rknHRegMask__; @@ -1792,7 +1672,6 @@ text: .text%__1cSMemBarVolatileNodeGOpcode6kM_i_; text: .text%__1cLstoreB0NodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cRshrI_reg_imm5NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQjava_lang_StringOas_utf8_string6FpnHoopDesc__pc_; -text: .text%__1cRcmpFastUnlockNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNSafePointNodeLpop_monitor6M_v_; text: .text%__1cMPhaseChaitinVfind_base_for_derived6MppnENode_2rI_2_; text: .text%__1cLOptoRuntimebAcomplete_monitor_exit_Type6F_pknITypeFunc__; @@ -1813,7 +1692,6 @@ text: .text%__1cMindirectOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o text: .text%__1cMindirectOperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o; text: .text%__1cNSafePointNodeMpush_monitor6MpknMFastLockNode__v_; text: .text%__1cSCallLeafDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cSCallLeafDirectNodeKmethod_set6Mi_v_; text: .text%__1cIDivINodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cJLoadBNodeJideal_reg6kM_I_: classes.o; text: .text%__1cJloadBNodeOmemory_operand6kM_pknIMachOper__; @@ -1824,8 +1702,6 @@ text: .text%__1cOGenerateOopMapGdo_ldc6Mii_v_; text: .text%__1cJCMoveNodeLis_cmove_id6FpnOPhaseTransform_pnENode_44pnIBoolNode__4_; text: .text%__1cKTypeAryPtrQcast_to_ptr_type6kMnHTypePtrDPTR__pknEType__; text: .text%__1cOPhaseIdealLoopKDominators6M_v_; -text: .text%__1cOPhaseIdealLoopPbuild_loop_late6MrnJVectorSet_rnJNode_List_rnKNode_Stack_pk0_v_; -text: .text%__1cOPhaseIdealLoopQbuild_loop_early6MrnJVectorSet_rnJNode_List_rnKNode_Stack_pk0_v_; text: .text%jni_NewGlobalRef: jni.o; text: .text%__1cTciConstantPoolCache2t6MpnFArena_i_v_; text: .text%__1cIAndINodeJideal_reg6kM_I_: classes.o; @@ -1838,7 +1714,6 @@ text: .text%__1cZPhaseConservativeCoalesceGverify6M_v_; text: .text%__1cRcmpFastUnlockNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQshlI_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cXmembar_release_lockNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cKPSYoungGenNused_in_bytes6kM_I_; text: .text%__1cOMachEpilogNodeIpipeline6kM_pknIPipeline__; text: .text%__1cKCompiledICSset_to_monomorphic6MrknOCompiledICInfo__v_; text: .text%__1cJloadFNodeIpipeline6kM_pknIPipeline__; @@ -1851,8 +1726,6 @@ text: .text%JVM_FillInStackTrace; text: .text%__1cKJavaThreadGactive6F_p0_; text: .text%__1cKstoreFNodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cQjava_lang_StringOchar_converter6FnGHandle_HHpnGThread__1_; -text: .text%__1cMVirtualSpaceNreserved_size6kM_I_; -text: .text%__1cICodeHeapMmax_capacity6kM_I_; text: .text%__1cRsubI_zero_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cHTypePtrFxmeet6kMpknEType__3_; text: .text%__1cNflagsRegFOperEtype6kM_pknEType__: ad_sparc.o; @@ -1860,7 +1733,6 @@ text: .text%__1cIMinINodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cFParseWensure_phis_everywhere6M_v_; text: .text%__1cLRethrowNodeEhash6kM_I_: classes.o; text: .text%__1cIDivLNodeGOpcode6kM_i_; -text: .text%__1cPlocal_vsnprintf6FpcIpkcpv_i_; text: .text%__1cNDispatchTableJset_entry6MirnKEntryPoint__v_; text: .text%__1cNmethodOopDescVclear_native_function6M_v_; text: .text%__1cOloadConL13NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; @@ -1933,7 +1805,6 @@ text: .text%__1cIPhaseCFGQGlobalCodeMotion6MrnHMatcher_IrnJNode_List__v_; text: .text%__1cHMatcherTFixup_Save_On_Entry6M_v_; text: .text%__1cHMatcherPinit_spill_mask6MpnENode__v_; text: .text%__1cHCompileICode_Gen6M_v_; -text: .text%__1cFArena2t6MI_v_; text: .text%__1cUDebugInfoWriteStream2t6MpnYDebugInformationRecorder_i_v_; text: .text%__1cHMatcherVinit_first_stack_mask6M_v_; text: .text%__1cFArenaNmove_contents6Mp0_1_; @@ -1972,7 +1843,6 @@ text: .text%__1cRsubI_zero_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cHRetNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIConDNodeGOpcode6kM_i_; text: .text%__1cObranchConFNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cTresource_free_bytes6FpcI_v_; text: .text%__1cNmethodOopDescbDbuild_interpreter_method_data6FnMmethodHandle_pnGThread__v_; text: .text%__1cRcompL_reg_conNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cNMemoryManagerHoops_do6MpnKOopClosure__v_; @@ -1981,10 +1851,8 @@ text: .text%__1cFciEnvKcompile_id6M_I_; text: .text%__1cPmethodDataKlassIallocate6MnMmethodHandle_pnGThread__pnRmethodDataOopDesc__; text: .text%__1cKoopFactoryOnew_methodData6FnMmethodHandle_pnGThread__pnRmethodDataOopDesc__; text: .text%__1cIAndLNodeJideal_reg6kM_I_: classes.o; -text: .text%__1cKCodeBuffer2t6MpCi_v_; text: .text%__1cVshrL_reg_imm6_L2INodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cLConvL2INodeIIdentity6MpnOPhaseTransform__pnENode__; -text: .text%__1cIciMethodRinstructions_size6M_i_; text: .text%__1cSmulI_reg_imm13NodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cCosXthread_local_storage_at6Fi_pv_; text: .text%__1cMindIndexOperNconstant_disp6kM_i_: ad_sparc.o; @@ -2013,10 +1881,8 @@ text: .text%__1cLOpaque2NodeLbottom_type6kM_pknEType__: connode.o; text: .text%__1cSconvI2D_helperNodeIpipeline6kM_pknIPipeline__; text: .text%__1cUPSGenerationCountersKupdate_all6M_v_: psGenerationCounters.o; text: .text%__1cQComputeCallStackHdo_long6M_v_: generateOopMap.o; -text: .text%__1cKTypeOopPtrSmake_from_constant6FpnIciObject__pk0_; text: .text%__1cQregP_to_stkPNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cOGenerateOopMapHppstore6MpnNCellTypeState_i_v_; -text: .text%__1cJTimeStampSticks_since_update6kM_x_; text: .text%__1cQmodI_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cIMulINodeImul_ring6kMpknEType_3_3_; text: .text%__1cURethrowExceptionNodeIpipeline6kM_pknIPipeline__; @@ -2027,18 +1893,15 @@ text: .text%__1cSaddI_reg_imm13NodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cIModINodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cKklassKlassIoop_size6kMpnHoopDesc__i_; text: .text%__1cJcmpOpOperHgreater6kM_i_: ad_sparc_clone.o; -text: .text%__1cJimmL0OperJconstantL6kM_x_: ad_sparc_clone.o; text: .text%__1cJimmI0OperJnum_edges6kM_I_: ad_sparc_clone.o; text: .text%__1cFStateM_sub_Op_ConL6MpknENode__v_; text: .text%__1cOloadConL13NodeErule6kM_I_: ad_sparc_misc.o; -text: .text%__1cNObjectMonitorHis_busy6kM_i_; text: .text%JVM_GetClassNameUTF; text: .text%__1cKloadUBNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cIXorINodeGadd_id6kM_pknEType__: classes.o; text: .text%__1cFStateM_sub_Op_AndI6MpknENode__v_; text: .text%__1cVshrL_reg_imm6_L2INodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cKcmpOpFOperJnum_edges6kM_I_: ad_sparc_clone.o; -text: .text%__1cLRuntimeStubHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cTmembar_volatileNodeIpipeline6kM_pknIPipeline__; text: .text%__1cJloadFNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cFStateL_sub_Op_OrI6MpknENode__v_; @@ -2059,14 +1922,11 @@ text: .text%__1cNloadConL0NodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; text: .text%__1cFTypeFEmake6Ff_pk0_; text: .text%__1cIimmFOperJconstantF6kM_f_: ad_sparc_clone.o; text: .text%__1cEUTF8Ounicode_length6Fpkc_i_; -text: .text%__1cCosRcurrent_thread_id6F_i_; text: .text%__1cUSafepointSynchronizeFblock6FpnKJavaThread__v_; text: .text%__1cOGenerateOopMapJppdupswap6Mipkc_v_; -text: .text%__1cJttyLockerbCbreak_tty_lock_for_safepoint6Fi_v_; text: .text%__1cSmembar_acquireNodeIadr_type6kM_pknHTypePtr__; text: .text%__1cPorI_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIPhaseCFGOinsert_goto_at6MII_v_; -text: .text%__1cITypeLongFwiden6kMpknEType__3_; text: .text%__1cSThreadLocalStoragePget_thread_slow6F_pnGThread__; text: .text%__1cPCallRuntimeNodeGOpcode6kM_i_; text: .text%__1cJcmpOpOperNgreater_equal6kM_i_: ad_sparc_clone.o; @@ -2074,7 +1934,6 @@ text: .text%__1cMindIndexOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o text: .text%__1cMindIndexOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o; text: .text%__1cMindIndexOperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o; text: .text%JVM_FindClassFromClass; -text: .text%__1cRshrP_reg_imm5NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cObranchConFNodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cQshrI_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cbDjava_lang_reflect_ConstructorFclazz6FpnHoopDesc__2_; @@ -2092,12 +1951,10 @@ text: .text%__1cSciExceptionHandlerLcatch_klass6M_pnPciInstanceKlass__; text: .text%__1cMloadConFNodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; text: .text%__1cKcmpOpPOperNgreater_equal6kM_i_: ad_sparc_clone.o; text: .text%__1cLRShiftLNodeLbottom_type6kM_pknEType__: classes.o; -text: .text%__1cKimmL13OperJconstantL6kM_x_: ad_sparc_clone.o; text: .text%__1cSTailCalljmpIndNodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cKstoreLNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cGIfNodeMdominated_by6MpnENode_pnMPhaseIterGVN__v_; text: .text%__1cOcompiledVFrame2t6MpknFframe_pknLRegisterMap_pnKJavaThread_pnJScopeDesc__v_; -text: .text%__1cJScopeDesc2t6MpknHnmethod_i_v_; text: .text%__1cQshlI_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cOGenerateOopMapJdo_astore6Mi_v_; text: .text%__1cbFunnecessary_membar_volatileNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; @@ -2127,7 +1984,6 @@ text: .text%__1cLBoxLockNode2t6Mi_v_; text: .text%__1cPconvF2D_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cLOptoRuntimebBcomplete_monitor_enter_Type6F_pknITypeFunc__; text: .text%__1cIGraphKitLshared_lock6MpnENode__pnMFastLockNode__; -text: .text%__1cPcmpFastLockNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNloadConP0NodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cRorI_reg_imm13NodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cKcmpOpUOperEless6kM_i_: ad_sparc_clone.o; @@ -2135,7 +1991,6 @@ text: .text%__1cQaddF_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cRLowMemoryDetectorWdetect_after_gc_memory6FpnKMemoryPool__v_; text: .text%lwp_mutex_init: os_solaris.o; text: .text%__1cRsubI_zero_regNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cFframeLnmethods_do6M_v_; text: .text%__1cQjava_lang_ThreadGthread6FpnHoopDesc__pnKJavaThread__; text: .text%__1cQnotemp_iRegIOperEtype6kM_pknEType__: ad_sparc.o; text: .text%__1cITemplateIbytecode6kM_nJBytecodesECode__; @@ -2174,11 +2029,9 @@ text: .text%jni_GetObjectClass: jni.o; text: .text%__1cSxorI_reg_imm13NodeIpipeline6kM_pknIPipeline__; text: .text%__1cOMacroAssemblerFalign6Mi_v_; text: .text%__1cRappend_interfaces6FnOobjArrayHandle_ripnPobjArrayOopDesc__v_; -text: .text%__1cKManagementJtimestamp6F_x_; text: .text%__1cIPSOldGenPupdate_counters6M_v_; text: .text%__1cQshrI_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cFForteNregister_stub6FpkcpC3_v_; -text: .text%__1cFVTuneNregister_stub6FpkcpC3_v_; text: .text%__1cNinstanceKlassbFlookup_method_in_all_interfaces6kMpnNsymbolOopDesc_2_pnNmethodOopDesc__; text: .text%__1cTloadL_unalignedNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cJloadLNodeOmemory_operand6kM_pknIMachOper__; @@ -2222,7 +2075,6 @@ text: .text%__1cMLinkResolverXresolve_invokeinterface6FrnICallInfo_nGHandle_nSco text: .text%__1cKC2CompilerOcompile_method6MpnFciEnv_pnIciMethod_i_v_; text: .text%JVM_GetClassLoader; text: .text%__1cNCompileBrokerZinvoke_compiler_on_method6FpnLCompileTask__v_; -text: .text%__1cCosRelapsed_frequency6F_x_; text: .text%__1cFStateP_sub_Op_ConvL2I6MpknENode__v_; text: .text%__1cOPhaseIdealLoopLdo_split_if6MpnENode__v_; text: .text%__1cLAccessFlagsRatomic_clear_bits6Mi_v_; @@ -2249,11 +2101,9 @@ text: .text%__1cSmembar_acquireNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cYDebugInformationRecorderHcopy_to6MpnHnmethod__v_; text: .text%__1cVExceptionHandlerTableHcopy_to6MpnHnmethod__v_; text: .text%__1cJCodeCacheGcommit6FpnICodeBlob__v_; -text: .text%__1cFVTuneOcreate_nmethod6FpnHnmethod__v_; text: .text%__1cHnmethodQcopy_scopes_data6MpCi_v_; text: .text%__1cFciEnvVnum_inlined_bytecodes6kM_i_; text: .text%__1cWImplicitExceptionTableHcopy_to6MpnHnmethod__v_; -text: .text%__1cLOopRecorderHcopy_to6MpnICodeBlob__v_; text: .text%__1cIciMethodRbuild_method_data6M_v_; text: .text%__1cHCompileIOptimize6M_v_; text: .text%__1cHCompileLFinish_Warm6M_v_; @@ -2287,7 +2137,6 @@ text: .text%__1cTmembar_volatileNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cNloadConL0NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQComputeCallStackGdo_int6M_v_: generateOopMap.o; text: .text%__1cXmembar_acquire_lockNodeIadr_type6kM_pknHTypePtr__; -text: .text%__1cKPSYoungGenRcapacity_in_bytes6kM_I_; text: .text%__1cNSafepointBlobbDpreserve_callee_argument_oops6MnFframe_pknLRegisterMap_pnKOopClosure__v_: codeBlob.o; text: .text%__1cOloadConI13NodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cJloadSNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -2299,7 +2148,6 @@ text: .text%__1cNSignatureInfoIdo_short6M_v_: bytecode.o; text: .text%__1cLBoxLockNodeDcmp6kMrknENode__I_; text: .text%__1cSCompiledStaticCallSset_to_interpreted6MnMmethodHandle_pC_v_; text: .text%__1cSCompiledStaticCallJfind_stub6M_pC_; -text: .text%__1cRNativeMovConstRegIset_data6Mi_v_; text: .text%__1cFParsebLincrement_and_test_invocation_counter6Mi_v_; text: .text%__1cSsafePoint_pollNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMTailCallNodeGOpcode6kM_i_; @@ -2325,7 +2173,6 @@ text: .text%__1cKScopeValueJread_from6FpnTDebugInfoReadStream__p0_; text: .text%__1cKPerfMemoryMmark_updated6F_v_; text: .text%__1cSobjArrayKlassKlassbCallocate_objArray_klass_impl6FnYobjArrayKlassKlassHandle_inLKlassHandle_pnGThread__pnMklassOopDesc__; text: .text%__1cIPerfData2t6MnJCounterNS_pkcn0AFUnits_n0ALVariability__v_; -text: .text%__1cKPerfMemoryFalloc6FI_pc_; text: .text%__1cLStrCompNodeKmatch_edge6kMI_I_; text: .text%__1cQmulL_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cILocation2t6MpnTDebugInfoReadStream__v_; @@ -2359,13 +2206,11 @@ text: .text%__1cXJNI_ArgumentPusherVaArgHget_int6M_v_: jni.o; text: .text%__1cRbranchLoopEndNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cQaddF_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cKcmpOpUOperHgreater6kM_i_: ad_sparc_clone.o; -text: .text%__1cUParallelScavengeHeapEused6kM_I_; text: .text%__1cIDivINodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cQmulF_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cQxorI_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cWCallLeafNoFPDirectNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cLcmpD_ccNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cWCallLeafNoFPDirectNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJloadINodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cbBopt_virtual_call_RelocationLstatic_stub6M_pC_; text: .text%__1cNTemplateTableDdef6FnJBytecodesECode_inITosState_3pFi_vi_v_; @@ -2392,8 +2237,6 @@ text: .text%__1cSandI_reg_imm13NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIimmLOperJnum_edges6kM_I_: ad_sparc_clone.o; text: .text%__1cFParseOmerge_new_path6Mi_v_; text: .text%__1cQregP_to_stkPNodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; -text: .text%__1cQjava_lang_StringGoffset6FpnHoopDesc__i_; -text: .text%__1cQjava_lang_StringFvalue6FpnHoopDesc__pnQtypeArrayOopDesc__; text: .text%__1cQjava_lang_StringScreate_from_symbol6FnMsymbolHandle_pnGThread__nGHandle__; text: .text%__1cSmembar_releaseNodeLout_RegMask6kM_rknHRegMask__; text: .text%jni_NewByteArray: jni.o; @@ -2402,7 +2245,6 @@ text: .text%__1cJJavaCallsMcall_special6FpnJJavaValue_nGHandle_nLKlassHandle_nMs text: .text%__1cQSystemDictionarybAvalidate_protection_domain6FnTinstanceKlassHandle_nGHandle_2pnGThread__v_; text: .text%__1cKDictionaryVadd_protection_domain6MiInTinstanceKlassHandle_nGHandle_2pnGThread__v_; text: .text%__1cFParseLdo_newarray6MnJBasicType__v_; -text: .text%__1cPmethodDataKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cNmethodOopDescKklass_name6kM_pnNsymbolOopDesc__; text: .text%__1cSconvI2D_helperNodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cLstoreP0NodeLout_RegMask6kM_rknHRegMask__; @@ -2427,7 +2269,6 @@ text: .text%__1cSmulI_reg_imm13NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cZInterpreterMacroAssemblerZget_2_byte_integer_at_bcp6MipnMRegisterImpl_2n0ALsignedOrNot_n0AKsetCCOrNot__v_; text: .text%__1cQcmovI_reg_gtNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cURethrowExceptionNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cPfieldDescriptorSlong_initial_value6kM_x_; text: .text%__1cISubLNodeDsub6kMpknEType_3_3_; text: .text%__1cPciObjArrayKlass2t6MnLKlassHandle__v_; text: .text%__1cJLoadINodeMstore_Opcode6kM_i_: classes.o; @@ -2443,7 +2284,6 @@ text: .text%__1cJCMoveNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%jni_GetStringCritical: jni.o; text: .text%__1cHciKlassSsuper_check_offset6M_I_; text: .text%__1cPciObjArrayKlassGloader6M_pnHoopDesc__: ciObjArrayKlass.o; -text: .text%__1cWCallLeafNoFPDirectNodeKmethod_set6Mi_v_; text: .text%__1cWCallLeafNoFPDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIDivLNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cPICStubInterfaceRcode_size_to_size6kMi_i_: icBuffer.o; @@ -2454,7 +2294,6 @@ text: .text%__1cJScopeDescGsender6kM_p0_; text: .text%__1cSxorI_reg_imm13NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cOcompiledVFrameGsender6kM_pnGvframe__; text: .text%__1cZInterpreterMacroAssemblerDpop6MnITosState__v_; -text: .text%__1cGThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cQPlaceholderTableHoops_do6MpnKOopClosure__v_; text: .text%__1cXJvmtiCurrentBreakpointsHoops_do6FpnKOopClosure__v_; text: .text%__1cNMemoryServiceHoops_do6FpnKOopClosure__v_; @@ -2462,7 +2301,6 @@ text: .text%__1cNThreadServiceHoops_do6FpnKOopClosure__v_; text: .text%__1cKJNIHandlesHoops_do6FpnKOopClosure__v_; text: .text%__1cQSystemDictionaryRpreloaded_oops_do6FpnKOopClosure__v_; text: .text%__1cLJvmtiExportHoops_do6FpnKOopClosure__v_; -text: .text%__1cIVMThreadHoops_do6MpnKOopClosure__v_; text: .text%__1cKJNIHandlesMweak_oops_do6FpnRBoolObjectClosure_pnKOopClosure__v_; text: .text%__1cSObjectSynchronizerHoops_do6FpnKOopClosure__v_; text: .text%__1cMFlatProfilerHoops_do6FpnKOopClosure__v_; @@ -2481,7 +2319,6 @@ text: .text%__1cOCompiledRFrameKtop_method6kM_nMmethodHandle__: rframe.o; text: .text%__1cKReflectionTget_parameter_types6FnMmethodHandle_ippnHoopDesc_pnGThread__nOobjArrayHandle__; text: .text%__1cRtestI_reg_immNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cOcmovIL_immNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cJimmU6OperIconstant6kM_i_: ad_sparc_clone.o; text: .text%__1cHRegMask2t6M_v_: matcher.o; text: .text%__1cOGenerateOopMapIcopy_cts6MpnNCellTypeState_2_i_; text: .text%__1cNObjectMonitorGEnterI6MpnGThread__v_; @@ -2494,7 +2331,6 @@ text: .text%__1cXvirtual_call_RelocationEtype6M_nJrelocInfoJrelocType__: relocIn text: .text%__1cPPerfDataManagerMcounter_name6Fpkc2_pc_; text: .text%__1cIModLNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cMloadConFNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cbBjava_lang_ref_SoftReferenceJset_clock6Fx_v_; text: .text%__1cbAPSGCAdaptivePolicyCountersbBupdate_counters_from_policy6M_v_; text: .text%__1cXTraceMemoryManagerStats2T6M_v_; text: .text%__1cQSystemDictionaryHoops_do6FpnKOopClosure__v_; @@ -2510,8 +2346,6 @@ text: .text%__1cMTypeKlassPtrFxmeet6kMpknEType__3_; text: .text%__1cKPSYoungGenPupdate_counters6M_v_; text: .text%__1cWThreadLocalAllocBufferbFaccumulate_statistics_before_gc6F_v_; text: .text%__1cWThreadLocalAllocBufferQresize_all_tlabs6F_v_; -text: .text%__1cPGCMemoryManagerIgc_begin6M_v_; -text: .text%__1cPGCMemoryManagerGgc_end6M_v_; text: .text%__1cRLowMemoryDetectorRdetect_low_memory6F_v_; text: .text%__1cNMemoryServiceStrack_memory_usage6F_v_; text: .text%__1cbAPSGCAdaptivePolicyCountersPupdate_counters6M_v_; @@ -2527,19 +2361,16 @@ text: .text%__1cORuntimeServicebDrecord_safepoint_synchronized6F_v_; text: .text%__1cQaddF_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cUSafepointSynchronizeFbegin6F_v_; text: .text%__1cKarrayKlassTallocate_arrayArray6MiipnGThread__pnPobjArrayOopDesc__; -text: .text%__1cONMethodSweeperFsweep6F_v_; text: .text%__1cCosbAmake_polling_page_readable6F_v_; text: .text%__1cUSafepointSynchronizeDend6F_v_; text: .text%__1cOcmovII_immNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cORuntimeServiceUrecord_safepoint_end6F_v_; -text: .text%__1cKimmU13OperIconstant6kM_i_: ad_sparc_clone.o; text: .text%__1cQshlL_reg_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cUcompU_iReg_imm13NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%JVM_GetCallerClass; text: .text%__1cNSignatureInfoHdo_byte6M_v_: bytecode.o; text: .text%__1cOcmovPP_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cKstoreBNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cSobjArrayKlassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cLstoreC0NodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cTloadL_unalignedNodePoper_input_base6kM_I_: ad_sparc_misc.o; text: .text%__1cICmpFNodeGOpcode6kM_i_; @@ -2551,7 +2382,6 @@ text: .text%jni_IsAssignableFrom: jni.o; text: .text%jni_GetFieldID: jni.o; text: .text%__1cJLoadPNodeMstore_Opcode6kM_i_: classes.o; text: .text%__1cLstoreB0NodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cZInterpreterMacroAssemblerbAget_cache_and_index_at_bcp6MpnMRegisterImpl_2i_v_; text: .text%__1cHTypeAryFxdual6kM_pknEType__; text: .text%__1cMtlsLoadPNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIVMThreadHexecute6FpnMVM_Operation__v_; @@ -2582,9 +2412,6 @@ text: .text%__1cZSerialOldToYoungRootsTaskFdo_it6MpnNGCTaskManager_I_v_; text: .text%__1cQinstanceRefKlassZacquire_pending_list_lock6FpnJBasicLock__v_; text: .text%__1cZSerialOldToYoungRootsTaskEname6M_pc_: psTasks.o; text: .text%__1cKPSYoungGenLswap_spaces6M_v_; -text: .text%__1cUParallelScavengeHeapQresize_young_gen6MII_v_; -text: .text%__1cKPSYoungGenGresize6MII_v_; -text: .text%__1cKPSYoungGenNresize_spaces6MII_v_; text: .text%__1cSPSPromotionManagerbBvm_thread_promotion_manager6F_p0_; text: .text%__1cUWaitForBarrierGCTaskIwait_for6M_v_; text: .text%__1cPVM_GC_OperationNdoit_epilogue6M_v_; @@ -2626,9 +2453,7 @@ text: .text%__1cJloadSNodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cRloadConP_pollNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNObjectMonitorHRecycle6M_v_; text: .text%__1cNSharedRuntimeSfind_callee_method6FpnKJavaThread_pnGThread__nMmethodHandle__; -text: .text%__1cMloadConLNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJloadDNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; -text: .text%__1cQSystemDictionaryTresolve_from_stream6FnMsymbolHandle_nGHandle_2pnPClassFileStream_pnGThread__pnMklassOopDesc__; text: .text%__1cQstkI_to_regFNodeIpipeline6kM_pknIPipeline__; text: .text%__1cQregP_to_stkPNodeIpipeline6kM_pknIPipeline__; text: .text%__1cZInterpreterMacroAssemblerFpop_i6MpnMRegisterImpl__v_; @@ -2636,9 +2461,7 @@ text: .text%__1cIMaxINodeGadd_id6kM_pknEType__: classes.o; text: .text%__1cNSharedRuntimeTreresolve_call_site6FpnKJavaThread_pnGThread__nMmethodHandle__; text: .text%__1cYcompareAndSwapL_boolNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNSCMemProjNodeJideal_reg6kM_I_: classes.o; -text: .text%__1cYcompareAndSwapL_boolNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIProjNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cIPSOldGenMmax_gen_size6M_I_: psOldGen.o; text: .text%__1cKExceptionsK_throw_msg6FpnGThread_pkcipnNsymbolOopDesc_4_v_; text: .text%__1cSdivL_reg_imm13NodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cbDVM_ParallelGCFailedAllocationEdoit6M_v_; @@ -2659,7 +2482,6 @@ text: .text%__1cPstoreI_FregNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cKCMovePNodeGOpcode6kM_i_; text: .text%__1cLstoreC0NodeIpipeline6kM_pknIPipeline__; text: .text%JVM_MonitorWait; -text: .text%__1cSObjectSynchronizerEwait6FnGHandle_xpnGThread__v_; text: .text%__1cIAddLNodeIadd_ring6kMpknEType_3_3_; text: .text%__1cHciKlass2t6MpnIciSymbol_p0_v_; text: .text%__1cGciType2t6MpnHciKlass__v_; @@ -2678,7 +2500,6 @@ text: .text%__1cIciSymbolHbyte_at6Mi_i_; text: .text%__1cKCompiledICSset_ic_destination6MpC_v_; text: .text%__1cQaddD_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cCosTset_native_priority6FpnGThread_i_nIOSReturn__; -text: .text%__1cPPerfDataManagerUcreate_long_variable6FnJCounterNS_pkcnIPerfDataFUnits_xpnGThread__pnQPerfLongVariable__; text: .text%__1cQset_lwp_priority6Fiii_i_; text: .text%__1cQjava_lang_StringTcreate_oop_from_str6FpkcpnGThread__pnHoopDesc__; text: .text%jni_NewStringUTF: jni.o; @@ -2689,7 +2510,6 @@ text: .text%__1cSbranchCon_longNodeGnegate6M_v_: ad_sparc_misc.o; text: .text%__1cKcmpOpUOperKless_equal6kM_i_: ad_sparc_clone.o; text: .text%__1cPciInstanceKlassNloader_handle6M_pnI_jobject__; text: .text%__1cPciInstanceKlassYprotection_domain_handle6M_pnI_jobject__; -text: .text%__1cUParallelScavengeHeapIcapacity6kM_I_; text: .text%__1cNmethodOopDescKjmethod_id6M_pnK_jmethodID__; text: .text%__1cSsubL_reg_reg_2NodeIpipeline6kM_pknIPipeline__; text: .text%JVM_DefineClassWithSource; @@ -2705,7 +2525,6 @@ text: .text%__1cOcmovPP_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cSThreadLocalStorageSset_thread_in_slot6FpnGThread__v_; text: .text%get_thread; text: .text%__1cKstoreCNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cSThreadLocalStoragebBget_thread_via_cache_slowly6FIi_pnGThread__; text: .text%__1cSThreadLocalStorageKset_thread6FpnGThread__v_; text: .text%jni_CallIntMethod: jni.o; text: .text%__1cSThreadLocalStorageNpd_set_thread6FpnGThread__v_; @@ -2735,7 +2554,6 @@ text: .text%__1cQregI_to_stkINodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cQmulF_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cJJavaCallsLcall_static6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4nGHandle_5pnGThread__v_; text: .text%__1cXSignatureHandlerLibraryOpd_set_handler6FpC_v_; -text: .text%__1cSInterpreterRuntimeZSignatureHandlerGeneratorIgenerate6MX_v_; text: .text%JVM_IsPrimitiveClass; text: .text%__1cJimmU6OperJnum_edges6kM_I_: ad_sparc_clone.o; text: .text%__1cOPhaseIdealLoopUpeeled_dom_test_elim6MpnNIdealLoopTree_rnJNode_List__v_; @@ -2758,7 +2576,6 @@ text: .text%__1cKReflectionPnew_constructor6FnMmethodHandle_pnGThread__pnHoopDes text: .text%__1cOcmovII_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cSdivL_reg_imm13NodeIpipeline6kM_pknIPipeline__; text: .text%__1cTloadL_unalignedNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cNSharedRuntimeDd2l6Fd_x_; text: .text%__1cJStubQdDueueRrequest_committed6Mi_pnEStub__; text: .text%__1cRInlineCacheBufferRic_stub_code_size6F_i_; text: .text%__1cFStateP_sub_Op_RShiftL6MpknENode__v_; @@ -2808,7 +2625,6 @@ text: .text%__1cJloadINodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cSdivL_reg_imm13NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRloadConP_pollNodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cIModINodeJideal_reg6kM_I_: classes.o; -text: .text%__1cZCallDynamicJavaDirectNodeKmethod_set6Mi_v_; text: .text%__1cZCallDynamicJavaDirectNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cSconvD2I_helperNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cZCallDynamicJavaDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -2846,7 +2662,6 @@ text: .text%__1cYjava_lang_reflect_MethodWset_annotation_default6FpnHoopDesc_2_v text: .text%__1cYjava_lang_reflect_MethodTset_parameter_types6FpnHoopDesc_2_v_; text: .text%__1cYjava_lang_reflect_MethodTset_exception_types6FpnHoopDesc_2_v_; text: .text%__1cYjava_lang_reflect_MethodNset_modifiers6FpnHoopDesc_i_v_; -text: .text%__1cOimmI_32_63OperIconstant6kM_i_: ad_sparc_clone.o; text: .text%__1cYjava_lang_reflect_MethodIset_name6FpnHoopDesc_2_v_; text: .text%__1cbFpartialSubtypeCheck_vs_zeroNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cSsubL_reg_reg_2NodeLout_RegMask6kM_rknHRegMask__; @@ -2855,7 +2670,6 @@ text: .text%__1cOstackSlotPOperEtype6kM_pknEType__: ad_sparc.o; text: .text%jni_GetMethodID: jni.o; text: .text%__1cQshlL_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cIMulINodeJideal_reg6kM_I_: classes.o; -text: .text%__1cNminI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cRshlI_reg_imm5NodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cOloadConL13NodeIpipeline6kM_pknIPipeline__; text: .text%__1cNObjectMonitorGnotify6MpnGThread__v_; @@ -2877,7 +2691,6 @@ text: .text%__1cQcmovI_reg_ltNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cNloadConL0NodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cKo1RegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cSsubL_reg_reg_1NodeIpipeline6kM_pknIPipeline__; -text: .text%__1cIBytecodeIset_code6MnJBytecodesECode__v_; text: .text%__1cQshrL_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cRsarL_reg_imm6NodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cJloadFNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -2921,7 +2734,6 @@ text: .text%__1cGThread2t6M_v_; text: .text%__1cCosHSolarisPhotspot_sigmask6FpnGThread__v_; text: .text%__1cCosHSolarisVinit_thread_fpu_state6F_v_; text: .text%__1cFTypeFFxmeet6kMpknEType__3_; -text: .text%__1cCosScurrent_stack_size6F_I_; text: .text%__1cIOSThreadNpd_initialize6M_v_; text: .text%__1cCosScurrent_stack_base6F_pC_; text: .text%__1cIOSThread2t6MpFpv_i1_v_; @@ -2948,7 +2760,6 @@ text: .text%__1cFStateM_sub_Op_SubL6MpknENode__v_; text: .text%__1cKCompiledICMstub_address6kM_pC_; text: .text%__1cJvmSymbolsOsignature_type6FpnNsymbolOopDesc__nJBasicType__; text: .text%__1cQsubL_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cQmodI_reg_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cISubDNodeGOpcode6kM_i_; text: .text%__1cQmodI_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPfieldDescriptorLannotations6kM_pnQtypeArrayOopDesc__; @@ -2984,13 +2795,10 @@ text: .text%__1cJMarkSweepMfollow_stack6F_v_; text: .text%__1cNimmP_pollOperJnum_edges6kM_I_: ad_sparc_clone.o; text: .text%__1cRtestI_reg_immNodeIpipeline6kM_pknIPipeline__; text: .text%__1cJMemRegionMintersection6kMk0_0_; -text: .text%__1cKJavaThread2t6MpFp0pnGThread__vI_v_; text: .text%__1cKJavaThreadDrun6M_v_; -text: .text%__1cNSafepointBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; text: .text%__1cPjava_lang_ClassOprimitive_type6FpnHoopDesc__nJBasicType__; text: .text%JVM_IsArrayClass; text: .text%jni_CallStaticVoidMethod: jni.o; -text: .text%__1cPPerfDataManagerTcreate_long_counter6FnJCounterNS_pkcnIPerfDataFUnits_xpnGThread__pnPPerfLongCounter__; text: .text%__1cLConvF2DNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cNsymbolOopDescWas_klass_external_name6kM_pkc_; text: .text%__1cHnmethodbDpreserve_callee_argument_oops6MnFframe_pknLRegisterMap_pnKOopClosure__v_; @@ -3017,14 +2825,12 @@ text: .text%__1cXNativeSignatureIteratorGdo_int6M_v_: interpreterRT_sparc.o; text: .text%__1cINodeHashEgrow6M_v_; text: .text%__1cOGenerateOopMapPdo_monitorenter6Mi_v_; text: .text%__1cOcmovPP_regNodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; -text: .text%__1cMloadConDNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cIMaxINodeIadd_ring6kMpknEType_3_3_; text: .text%__1cJloadSNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cOGenerateOopMapLcompute_map6MpnGThread__v_; text: .text%__1cLConvF2DNodeLbottom_type6kM_pknEType__: classes.o; text: .text%JVM_Open; text: .text%__1cRInvocationCounterFreset6M_v_; -text: .text%__1cRCompilationPolicybIreset_counter_for_invocation_event6MnMmethodHandle__v_; text: .text%__1cOGenerateOopMap2t6MnMmethodHandle__v_; text: .text%__1cOGenerateOopMapRdo_interpretation6M_v_; text: .text%__1cIRetTableRcompute_ret_table6MnMmethodHandle__v_; @@ -3042,7 +2848,6 @@ text: .text%__1cIGraphKitSprecision_rounding6MpnENode__2_; text: .text%__1cNPerfByteArray2t6MnJCounterNS_pkcnIPerfDataFUnits_n0CLVariability_i_v_; text: .text%__1cIGraphKitRcreate_and_map_if6MpnENode_2ff_pnGIfNode__: generateOptoStub.o; text: .text%__1cQjava_lang_ThreadIpriority6FpnHoopDesc__nOThreadPriority__; -text: .text%__1cQjava_lang_ThreadJstackSize6FpnHoopDesc__x_; text: .text%__1cMLinkResolverYresolve_interface_method6FrnMmethodHandle_rnLKlassHandle_nSconstantPoolHandle_ipnGThread__v_; text: .text%__1cKJavaThreadHprepare6MpnI_jobject_nOThreadPriority__v_; text: .text%__1cTLoadD_unalignedNodeGOpcode6kM_i_; @@ -3077,7 +2882,6 @@ text: .text%__1cSTailCalljmpIndNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cOGenerateOopMapEppop6MpnNCellTypeState__v_; text: .text%__1cSTailCalljmpIndNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cQsubF_reg_regNodeIpipeline6kM_pknIPipeline__; -text: .text%__1cRNativeMovConstRegEdata6kM_i_; text: .text%__1cbFunnecessary_membar_volatileNodeLbottom_type6kM_pknEType__: ad_sparc_misc.o; text: .text%__1cLcmpF_ccNodeIpipeline6kM_pknIPipeline__; text: .text%__1cNObjectMonitorJnotifyAll6MpnGThread__v_; @@ -3144,7 +2948,6 @@ text: .text%__1cLstoreF0NodeIpipeline6kM_pknIPipeline__; text: .text%__1cIMinINodeIadd_ring6kMpknEType_3_3_; text: .text%JVM_GetInheritedAccessControlContext; text: .text%__1cPPerfDataManagerWcreate_string_constant6FnJCounterNS_pkc3pnGThread__pnSPerfStringConstant__; -text: .text%__1cNmaxI_eRegNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%JVM_NativePath; text: .text%__1cOMacroAssemblerNflush_windows6M_v_; text: .text%__1cSsubD_regD_regDNodeIpipeline6kM_pknIPipeline__; @@ -3157,19 +2960,15 @@ text: .text%__1cVinline_cache_regPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cKstorePNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cQObjectStartArrayFreset6M_v_; text: .text%__1cPconvI2D_memNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cHThreadsHoops_do6FpnKOopClosure__v_; text: .text%__1cQaddD_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cLConvF2INodeGOpcode6kM_i_; text: .text%__1cVCallRuntimeDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cJHashtableGunlink6MpnRBoolObjectClosure__v_; text: .text%__1cIPSOldGenPadjust_pointers6M_v_; -text: .text%__1cVCallRuntimeDirectNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOcmovPI_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cIPSOldGenHcompact6M_v_; text: .text%__1cMtlsLoadPNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cLcmpF_ccNodeErule6kM_I_: ad_sparc_misc.o; -text: .text%__1cVCallRuntimeDirectNodeKmethod_set6Mi_v_; -text: .text%__1cKimmI11OperIconstant6kM_i_: ad_sparc_clone.o; text: .text%__1cQcmovI_reg_gtNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cLstoreP0NodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cOcmovIF_regNodeErule6kM_I_: ad_sparc_misc.o; @@ -3177,7 +2976,6 @@ text: .text%__1cOcmovLL_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%jni_GetStaticMethodID: jni.o; text: .text%__1cZInterpreterMacroAssemblerUupdate_mdp_by_offset6MipnMRegisterImpl__v_; text: .text%__1cRtestI_reg_immNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cHnmethodbAmake_not_entrant_or_zombie6Mi_v_; text: .text%__1cPconvF2D_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cOPhaseIdealLoopKdo_peeling6MpnNIdealLoopTree_rnJNode_List__v_; text: .text%__1cOcmovLL_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; @@ -3210,7 +3008,6 @@ text: .text%__1cSaddD_regD_regDNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cSaddP_reg_imm13NodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cXconvI2D_regDHi_regDNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cKstoreFNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cPPerfDataManagerUcreate_long_constant6FnJCounterNS_pkcnIPerfDataFUnits_xpnGThread__pnQPerfLongConstant__; text: .text%__1cOMacroAssemblerNget_vm_result6MpnMRegisterImpl__v_; text: .text%__1cQsubF_reg_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cZInterpreterMacroAssemblerbIcompute_extra_locals_size_in_bytes6MpnMRegisterImpl_22_v_; @@ -3250,7 +3047,6 @@ text: .text%__1cQsubF_reg_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%jni_NewObjectV: jni.o; text: .text%__1cOcmovLI_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cPciInstanceKlassLjava_mirror6M_pnKciInstance__; -text: .text%__1cCosHSolarisKmmap_chunk6FpcIii_2_; text: .text%__1cXPartialSubtypeCheckNodeLbottom_type6kM_pknEType__: classes.o; text: .text%jni_EnsureLocalCapacity; text: .text%__1cLstoreI0NodeOmemory_operand6kM_pknIMachOper__; @@ -3278,7 +3074,6 @@ text: .text%__1cLcmpD_ccNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cJloadLNodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cISubDNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cZInterpreterMacroAssemblerUprofile_taken_branch6MpnMRegisterImpl_2_v_; -text: .text%__1cLResourceObj2n6FIn0APallocation_type__pv_; text: .text%__1cNSafePointNodeQpeek_monitor_box6kM_pnENode__; text: .text%__1cFTypeFFxdual6kM_pknEType__; text: .text%__1cICmpFNodeFValue6kMpnOPhaseTransform__pknEType__; @@ -3290,7 +3085,6 @@ text: .text%__1cINegDNodeLbottom_type6kM_pknEType__: classes.o; text: .text%__1cLConvI2FNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cOcmovLL_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cRorI_reg_imm13NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cTloadL_unalignedNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cTloadL_unalignedNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cKloadUBNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cXconvI2D_regDHi_regDNodeIpipeline6kM_pknIPipeline__; @@ -3320,7 +3114,6 @@ text: .text%__1cMTailJumpNodeKmatch_edge6kMI_I_; text: .text%__1cWloadConI_x41f00000NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cODeoptimizationbJupdate_method_data_from_interpreter6FnQmethodDataHandle_ii_v_; text: .text%__1cIimmDOperJnum_edges6kM_I_: ad_sparc_clone.o; -text: .text%__1cFframeZinterpreter_frame_set_mdx6Mi_v_; text: .text%__1cOstackSlotLOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o; text: .text%__1cOstackSlotLOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o; text: .text%__1cTloadD_unalignedNodeErule6kM_I_: ad_sparc_misc.o; @@ -3371,7 +3164,6 @@ text: .text%__1cYjava_lang_reflect_MethodEslot6FpnHoopDesc__i_; text: .text%__1cYjava_lang_reflect_MethodFclazz6FpnHoopDesc__2_; text: .text%__1cYinternal_word_RelocationGtarget6M_pC_; text: .text%__1cJStubQdDueueKremove_all6M_v_; -text: .text%__1cMloadConFNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cPconvI2D_memNodeIpipeline6kM_pknIPipeline__; text: .text%__1cPorL_reg_regNodeMideal_Opcode6kM_i_: ad_sparc_misc.o; text: .text%__1cZInterpreterMacroAssemblerLindex_check6MpnMRegisterImpl_2i22_v_; @@ -3405,12 +3197,10 @@ text: .text%__1cSInterpreterRuntimeQcreate_exception6FpnKJavaThread_pc3_v_; text: .text%__1cQComputeCallStackIdo_array6Mii_v_: generateOopMap.o; text: .text%__1cKPSYoungGenKprecompact6M_v_; text: .text%__1cXjava_lang_reflect_FieldEslot6FpnHoopDesc__i_; -text: .text%__1cSconvD2I_helperNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cMnegF_regNodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cHThreadsLgc_prologue6F_v_; text: .text%__1cHThreadsLgc_epilogue6F_v_; text: .text%__1cPconvI2L_regNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cPconvD2I_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cJJavaCallsLcall_static6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4nGHandle_pnGThread__v_; text: .text%__1cUParallelScavengeHeapHcollect6MnHGCCauseFCause__v_; text: .text%__1cRCardTableModRefBSFclear6MnJMemRegion__v_; @@ -3441,18 +3231,12 @@ text: .text%__1cUPSMarkSweepDecoratorbIset_destination_decorator_perm_gen6F_v_; text: .text%__1cUPSMarkSweepDecoratorbHset_destination_decorator_tenured6F_v_; text: .text%__1cKDictionaryYalways_strong_classes_do6MpnKOopClosure__v_; text: .text%__1cQmulL_reg_regNodeEsize6kMpnNPhaseRegAlloc__I_; -text: .text%__1cUPSAdaptiveSizePolicyUmajor_collection_end6MInHGCCauseFCause__v_; text: .text%__1cUPSAdaptiveSizePolicyWmajor_collection_begin6M_v_; text: .text%__1cIUniverseWupdate_heap_info_at_gc6F_v_; -text: .text%__1cJPSPermGenQcompute_new_size6MI_v_; text: .text%__1cKPSYoungGenHcompact6M_v_; text: .text%JVM_GetSystemPackage; text: .text%__1cPfieldDescriptorTfloat_initial_value6kM_f_; text: .text%__1cKPSYoungGenPadjust_pointers6M_v_; -text: .text%__1cQUncommonTrapBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cSDeoptimizationBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cNExceptionBlobHoops_do6MpnKOopClosure__v_: codeBlob.o; -text: .text%__1cJCodeCacheHoops_do6FpnKOopClosure__v_; text: .text%__1cJCodeCacheLgc_prologue6F_v_; text: .text%__1cJCodeCacheLgc_epilogue6F_v_; text: .text%__1cIXorINodeIadd_ring6kMpknEType_3_3_; @@ -3508,16 +3292,12 @@ text: .text%__1cSstring_compareNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%jni_GetEnv; text: .text%__1cJloadDNodeOmemory_operand6kM_pknIMachOper__; text: .text%__1cQstkI_to_regINodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cSstring_compareNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cXNativeSignatureIteratorHdo_bool6M_v_: interpreterRT_sparc.o; text: .text%Unsafe_GetNativeByte; text: .text%JVM_NanoTime; -text: .text%__1cCosNjavaTimeNanos6F_x_; text: .text%__1cOMacroAssemblerOrestore_thread6MkpnMRegisterImpl__v_; -text: .text%__1cVcompiledICHolderKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; text: .text%__1cQandL_reg_regNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cIimmFOperJnum_edges6kM_I_: ad_sparc_clone.o; -text: .text%__1cHThreadsLnmethods_do6F_v_; text: .text%__1cKcmpOpFOperGnegate6M_v_: ad_sparc_clone.o; text: .text%__1cICodeBlobFflush6M_v_; text: .text%__1cFParseMdo_anewarray6M_v_; @@ -3537,8 +3317,6 @@ text: .text%__1cHnmethodSflush_dependencies6MpnRBoolObjectClosure__v_; text: .text%__1cKo2RegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cQregI_to_stkINodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cbCAbstractInterpreterGeneratorVgenerate_method_entry6MnTAbstractInterpreterKMethodKind__pC_; -text: .text%__1cParrayKlassKlassRoop_copy_contents6MpnSPSPromotionManager_pnHoopDesc__v_; -text: .text%__1cFVTuneOdelete_nmethod6FpnHnmethod__v_; text: .text%__1cWloadConI_x43300000NodeIpipeline6kM_pknIPipeline__; text: .text%__1cFParseQdo_monitor_enter6M_v_; text: .text%__1cPorL_reg_regNodeIpipeline6kM_pknIPipeline__; @@ -3547,13 +3325,11 @@ text: .text%JVM_FindPrimitiveClass; text: .text%__1cVMoveL2D_stack_regNodeIpipeline6kM_pknIPipeline__; text: .text%__1cNTemplateTableEiop26Fn0AJOperation__v_; text: .text%__1cZInterpreterMacroAssemblerMdispatch_via6MnITosState_ppC_v_; -text: .text%__1cSmodL_reg_imm13NodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cRshrI_reg_imm5NodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cJJavaCallsLcall_static6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnGThread__v_; text: .text%__1cSsubL_reg_reg_2NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cUmulL_reg_imm13_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cIDivDNodeFValue6kMpnOPhaseTransform__pknEType__; -text: .text%__1cPconvI2F_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNinstanceKlassUfind_interface_field6kMpnNsymbolOopDesc_2pnPfieldDescriptor__pnMklassOopDesc__; text: .text%__1cOstackSlotFOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cUdivL_reg_imm13_1NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; @@ -3561,7 +3337,6 @@ text: .text%__1cRSignatureIteratorHiterate6M_v_; text: .text%__1cOcmovLL_regNodeHtwo_adr6kM_I_: ad_sparc_misc.o; text: .text%__1cJname2type6Fpkc_nJBasicType__; text: .text%__1cSmulL_reg_imm13NodeIpipeline6kM_pknIPipeline__; -text: .text%__1cPBytecode_invokeLresult_type6kMpnGThread__nJBasicType__; text: .text%__1cOloadConL13NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cKcmpOpFOperHgreater6kM_i_: ad_sparc_clone.o; text: .text%__1cIDivDNodeJideal_reg6kM_I_: classes.o; @@ -3569,7 +3344,6 @@ text: .text%__1cOMacroAssemblerKget_thread6M_v_; text: .text%__1cOcmovDF_regNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cOcmovIF_immNodeHtwo_adr6kM_I_: ad_sparc_misc.o; text: .text%__1cSconvI2F_helperNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cKVtableStub2n6FIi_pv_; text: .text%__1cbEJvmtiDynamicCodeEventCollector2T6M_v_; text: .text%__1cOtypeArrayKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: typeArrayKlass.o; text: .text%__1cPconvD2F_regNodeHsize_of6kM_I_: ad_sparc_misc.o; @@ -3589,7 +3363,6 @@ text: .text%__1cNTemplateTableQfast_accessfield6FnITosState__v_; text: .text%__1cKCompiledICSset_to_megamorphic6MpnICallInfo_nJBytecodesECode_pnGThread__v_; text: .text%Unsafe_StaticFieldOffset; text: .text%__1cQmulI_reg_regNodeHsize_of6kM_I_: ad_sparc_misc.o; -text: .text%__1cNTemplateTableXresolve_cache_and_index6FipnMRegisterImpl_2_v_; text: .text%__1cQaddI_reg_regNodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cOcmovLI_regNodeHtwo_adr6kM_I_: ad_sparc_misc.o; text: .text%JVM_GetClassContext; @@ -3685,7 +3458,6 @@ text: .text%__1cLConvL2DNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cULinearLeastSquareFit2t6MI_v_; text: .text%__1cQdivL_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cPciObjectFactoryTget_unloaded_method6MpnPciInstanceKlass_pnIciSymbol_4_pnIciMethod__; -text: .text%__1cNReservedSpace2t6MI_v_; text: .text%__1cSCardTableExtensionVresize_covered_region6MnJMemRegion__v_; text: .text%__1cOloadI_fregNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cRCardTableModRefBSVresize_covered_region6MnJMemRegion__v_; @@ -3705,7 +3477,6 @@ text: .text%__1cOLibraryCallKitXgenerate_current_thread6MrpnENode__2_; text: .text%__1cOMacroAssemblerEfneg6MnRFloatRegisterImplFWidth_p13_v_; text: .text%__1cXNativeSignatureIteratorJdo_double6M_v_: interpreterRT_sparc.o; text: .text%__1cRtestI_reg_immNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; -text: .text%__1cNSpaceCounters2t6MpkciIpnMMutableSpace_pnSGenerationCounters__v_; text: .text%__1cLcmpF_ccNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cMNativeLookupTbase_library_lookup6Fpkc22_pC_; text: .text%jni_SetObjectField: jni.o; @@ -3725,7 +3496,6 @@ text: .text%__1cQmulD_reg_regNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%Unsafe_AllocateMemory; text: .text%__1cSandL_reg_imm13NodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%JVM_GetLastErrorString; -text: .text%__1cQmodL_reg_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNTemplateTableElop26Fn0AJOperation__v_; text: .text%__1cQjava_lang_ThreadKset_daemon6FpnHoopDesc__v_; text: .text%__1cNTemplateTableEfop26Fn0AJOperation__v_; @@ -3738,7 +3508,6 @@ text: .text%__1cNTemplateTableGlstore6Fi_v_; text: .text%__1cLConvF2INodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cIciMethod2t6MpnPciInstanceKlass_pnIciSymbol_4_v_; text: .text%__1cRcompL_reg_regNodeHsize_of6kM_I_: ad_sparc_misc.o; -text: .text%__1cLconvI2BNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cLConvD2FNodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cSconvD2I_helperNodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cRsubI_zero_regNodeHsize_of6kM_I_: ad_sparc_misc.o; @@ -3775,12 +3544,10 @@ text: .text%__1cOMacroAssemblerMcall_VM_leaf6MpnMRegisterImpl_pC22_v_; text: .text%__1cOMacroAssemblerMcall_VM_leaf6MpnMRegisterImpl_pC2_v_; text: .text%__1cTjava_lang_ThrowableLset_message6FpnHoopDesc_2_v_; text: .text%__1cOGenerateOopMapTret_jump_targets_do6MpnOBytecodeStream_pFp0ipi_vi4_v_; -text: .text%__1cPconvI2D_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%Unsafe_SetMemory; text: .text%__1cKstfSSFNodeErule6kM_I_: ad_sparc_misc.o; text: .text%__1cZInterpreterMacroAssemblerOthrow_if_not_x6MnJAssemblerJCondition_pCpnMRegisterImpl__v_; text: .text%__1cVMoveF2I_stack_regNodeLout_RegMask6kM_rknHRegMask__; -text: .text%__1cHTypePtrKadd_offset6kMi_pk0_; text: .text%__1cOcmovLI_regNodeHsize_of6kM_I_: ad_sparc_misc.o; text: .text%__1cNloadConL0NodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cOcmovPI_regNodeEsize6kMpnNPhaseRegAlloc__I_; @@ -3798,7 +3565,6 @@ text: .text%__1cRMachSpillCopyNodeHsize_of6kM_I_: ad_sparc.o; text: .text%__1cQCompilerCounters2t6MpkcipnGThread__v_; text: .text%__1cOGenerateOopMapRdo_multianewarray6Mii_v_; text: .text%__1cNCompileBrokerUcompiler_thread_loop6F_v_; -text: .text%__1cbFpartialSubtypeCheck_vs_zeroNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%jni_CallStaticObjectMethodV: jni.o; text: .text%__1cNTemplateTableMfast_xaccess6FnITosState__v_; text: .text%__1cJMemRegionFminus6kMk0_0_; @@ -3836,12 +3602,10 @@ text: .text%__1cGThreadbArecord_stack_base_and_size6M_v_; text: .text%__1cNTemplateTableHcall_VM6FpnMRegisterImpl_pC2_v_; text: .text%JVM_RegisterSignal; text: .text%JVM_FindSignal; -text: .text%__1cTMaskFillerForNative2t6MnMmethodHandle_pIi_v_: oopMapCache.o; text: .text%jio_vsnprintf; text: .text%__1cQshrL_reg_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cZInterpreterMacroAssemblerTprofile_switch_case6MpnMRegisterImpl_222_v_; text: .text%__1cOCompilerThread2t6MpnMCompileQdDueue_pnQCompilerCounters__v_; -text: .text%__1cOPSVirtualSpace2t6MnNReservedSpace_I_v_; text: .text%__1cVcompiler_thread_entry6FpnKJavaThread_pnGThread__v_: thread.o; text: .text%__1cNIdealLoopTreeUmerge_many_backedges6MpnOPhaseIdealLoop__v_; text: .text%__1cODeoptimizationLUnrollBlock2T6M_v_; @@ -3857,17 +3621,13 @@ text: .text%__1cLstoreF0NodeLout_RegMask6kM_rknHRegMask__; text: .text%__1cZInterpreterMacroAssemblerWprofile_switch_default6MpnMRegisterImpl__v_; text: .text%__1cTAbstract_VM_VersionOvm_info_string6F_pkc_; text: .text%__1cJStubQdDueue2t6MpnNStubInterface_ipnFMutex_pkc_v_; -text: .text%__1cSconvF2I_helperNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cHThreadsbFdeoptimized_wrt_marked_nmethods6F_v_; -text: .text%__1cbAconvL2D_reg_slow_fxtofNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cOstackSlotFOperEdisp6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o; text: .text%__1cOstackSlotFOperEbase6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o; text: .text%__1cOstackSlotFOperFindex6kMpnNPhaseRegAlloc_pknENode_i_i_: ad_sparc.o; -text: .text%__1cPconvF2I_regNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cNTemplateTableGlconst6Fi_v_; text: .text%__1cLstoreC0NodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cMPeriodicTaskGenroll6M_v_; -text: .text%__1cMPeriodicTask2t6MI_v_; text: .text%__1cNTemplateTableHcastore6F_v_; text: .text%Unsafe_CompareAndSwapObject; text: .text%__1cLNamedThread2t6M_v_; @@ -3913,7 +3673,6 @@ text: .text%__1cLMoveF2INodeFValue6kMpnOPhaseTransform__pknEType__; text: .text%__1cLOptoRuntimeIl2f_Type6F_pknITypeFunc__; text: .text%__1cOMacroAssemblerUcalc_mem_param_words6MpnMRegisterImpl_2_v_; text: .text%__1cZInterpreterMacroAssemblerLprofile_ret6MnITosState_pnMRegisterImpl_3_v_; -text: .text%__1cZInterpreterMacroAssemblerUprofile_virtual_call6MpnMRegisterImpl_2_v_; text: .text%__1cZInterpreterMacroAssemblerMprofile_call6MpnMRegisterImpl__v_; text: .text%__1cLklassVtableQindex_of_miranda6MpnNsymbolOopDesc_2_i_; text: .text%__1cZInterpreterMacroAssemblerSupdate_mdp_for_ret6MnITosState_pnMRegisterImpl__v_; @@ -3922,7 +3681,6 @@ text: .text%__1cUInterpreterGeneratorLlock_method6M_v_; text: .text%__1cZInterpreterMacroAssemblerOthrow_if_not_26MpCpnMRegisterImpl_rnFLabel__v_; text: .text%__1cZInterpreterMacroAssemblerQthrow_if_not_1_x6MnJAssemblerJCondition_rnFLabel__v_; text: .text%__1cZInterpreterMacroAssemblerZget_4_byte_integer_at_bcp6MipnMRegisterImpl_2n0AKsetCCOrNot__v_; -text: .text%__1cCosHrealloc6FpvI_1_; text: .text%__1cODeoptimizationVdeoptimize_dependents6F_i_; text: .text%__1cFStateO_sub_Op_CMoveL6MpknENode__v_; text: .text%__1cZInterpreterMacroAssemblerRaccess_local_long6MpnMRegisterImpl_2_v_; @@ -4001,19 +3759,15 @@ text: .text%__1cSThreadLocalStorageHpd_init6F_v_; text: .text%__1cVMoveF2I_stack_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cVMoveL2D_stack_regNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; text: .text%__1cWinvocationCounter_init6F_v_; -text: .text%__1cKTypeOopPtrEmake6FnHTypePtrDPTR_i_pk0_; text: .text%__1cKTypeOopPtrFxdual6kM_pknEType__; text: .text%__1cFParseMjump_if_join6MpnENode_2_2_; text: .text%__1cSinstanceKlassKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cSinstanceKlassKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: instanceKlassKlass.o; -text: .text%__1cLconvP2BNodeGExpand6MpnFState_rnJNode_List__pnIMachNode__; text: .text%__1cETypeRInitialize_shared6FpnHCompile__v_; text: .text%__1cQinstanceRefKlassZupdate_nonstatic_oop_maps6FpnMklassOopDesc__v_; text: .text%__1cVInterfaceSupport_init6F_v_; -text: .text%__1cZInterpreterMacroAssemblerSsuper_call_VM_leaf6MpnMRegisterImpl_pC2_v_; text: .text%__1cPGenerationSizerQinitialize_flags6M_v_: parallelScavengeHeap.o; text: .text%__1cZInterpreterMacroAssemblerPdispatch_normal6MnITosState__v_; -text: .text%__1cJTimeStampMmilliseconds6kM_x_; text: .text%__1cDhpiZinitialize_socket_library6F_i_; text: .text%__1cDhpiYinitialize_get_interface6FpnIvm_calls__v_; text: .text%__1cWInlineCacheBuffer_init6F_v_; @@ -4030,14 +3784,12 @@ text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: ad_sparc_expand.o; text: .text%__1cMexit_globals6F_v_; text: .text%__1cSset_init_completed6F_v_; text: .text%__1cNinstanceKlassZrelease_C_heap_structures6M_v_; -text: .text%__1cJTimeStampJupdate_to6Mx_v_; text: .text%__1cUParallelScavengeHeapItop_addr6kM_ppnIHeapWord__: parallelScavengeHeap.o; text: .text%__1cCosHSolarisXinstall_signal_handlers6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: interp_masm_sparc.o; text: .text%__1cQinterpreter_init6F_v_; text: .text%__1cbCAbstractInterpreterGenerator2t6MpnJStubQdDueue__v_; text: .text%__1cRlwp_priocntl_init6F_i_: os_solaris.o; -text: .text%__1cNpriocntl_stub6FinGidtype_lipc_l_: os_solaris.o; text: .text%__1cbCAbstractInterpreterGeneratorMgenerate_all6M_v_; text: .text%__1cCosLsignal_wait6F_i_; text: .text%__1cCosNsignal_notify6Fi_v_; @@ -4050,7 +3802,6 @@ text: .text%__1cUParallelScavengeHeapEheap6F_p0_; text: .text%__1cUParallelScavengeHeapNgc_threads_do6kMpnNThreadClosure__v_; text: .text%__1cUParallelScavengeHeapYpermanent_object_iterate6MpnNObjectClosure__v_; text: .text%__1cKcmpOpFOperNgreater_equal6kM_i_: ad_sparc_clone.o; -text: .text%__1cUParallelScavengeHeapMmax_capacity6kM_I_; text: .text%__1cUParallelScavengeHeapPpost_initialize6M_v_; text: .text%__1cUParallelScavengeHeapKinitialize6M_i_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: parGCAllocBuffer.o; @@ -4067,8 +3818,6 @@ text: .text%__1cVjni_GetLongField_addr6F_pC_; text: .text%__1cNIdealLoopTreeQsplit_outer_loop6MpnOPhaseIdealLoop__v_; text: .text%__1cRLowMemoryDetectorKinitialize6F_v_; text: .text%__1cRLowMemoryDetectorbGlow_memory_detector_thread_entry6FpnKJavaThread_pnGThread__v_; -text: .text%__1cNReservedSpaceUpage_align_size_down6FI_I_; -text: .text%__1cNReservedSpaceYallocation_align_size_up6FI_I_; text: .text%__1cTloadL_unalignedNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: machnode.o; text: .text%__1cPmanagement_init6F_v_; @@ -4076,7 +3825,6 @@ text: .text%__1cOvmStructs_init6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: vmStructs.o; text: .text%__1cJvmSymbolsKinitialize6FpnGThread__v_; text: .text%__1cKManagementKinitialize6FpnGThread__v_; -text: .text%__1cKManagementWrecord_vm_startup_time6Fxx_v_; text: .text%__1cIVMThreadGcreate6F_v_; text: .text%__1cIVMThreadDrun6M_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: management.o; @@ -4103,11 +3851,9 @@ text: .text%__1cLmethodKlassOset_alloc_size6MI_v_: methodKlass.o; text: .text%__1cQvtableStubs_init6F_v_; text: .text%__1cKi0RegPOperKin_RegMask6kMi_pknHRegMask__; text: .text%__1cKg1RegPOperKin_RegMask6kMi_pknHRegMask__; -text: .text%__1cFVTuneEexit6F_v_; text: .text%__1cLmethodKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: methodKlass.o; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: methodLiveness.o; text: .text%__1cMMutableSpaceOobject_iterate6MpnNObjectClosure__v_; -text: .text%__1cKvtune_init6F_v_; text: .text%__1cKmutex_init6F_v_; text: .text%__1cQaccessFlags_init6F_v_; text: .text%__1cOMacroAssemblerMcall_VM_leaf6MpnMRegisterImpl_pC222_v_; @@ -4136,7 +3882,6 @@ text: .text%__1cQJNI_FastGetFieldbDgenerate_fast_get_short_field6F_pC_; text: .text%__1cQJNI_FastGetFieldbBgenerate_fast_get_int_field6F_pC_; text: .text%__1cQJNI_FastGetFieldbCgenerate_fast_get_long_field6F_pC_; text: .text%__1cTtypeArrayKlassKlassSallocate_permanent6kMrnLKlassHandle_ipnGThread__pv_: typeArrayKlassKlass.o; -text: .text%__1cIUniversePcheck_alignment6FIIpkc_v_; text: .text%__1cIUniverseHgenesis6FpnGThread__v_; text: .text%__1cVquicken_jni_functions6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: oopMap.o; @@ -4222,7 +3967,6 @@ text: .text%__1cJBytecodesNpd_initialize6F_v_; text: .text%__1cHCompileRpd_compiler2_init6F_v_; text: .text%__1cKC2CompilerKinitialize6M_v_; text: .text%__1cRCardTableModRefBS2t6MnJMemRegion_i_v_; -text: .text%__1cRCardTableModRefBSbBct_max_alignment_constraint6F_I_; text: .text%__1cMciArrayKlass2t6MpnIciSymbol_ipnHciKlass__v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: relocInfo.o; text: .text%__1cMciKlassKlassEmake6F_p0_; @@ -4267,13 +4011,9 @@ text: .text%__1cNTemplateTableDnop6F_v_; text: .text%__1cNTemplateTableSshouldnotreachhere6F_v_; text: .text%__1cNTemplateTableLaconst_null6F_v_; text: .text%__1cKPSYoungGenbCreset_survivors_after_shrink6M_v_; -text: .text%__1cKPSYoungGenQlimit_gen_shrink6MI_I_; -text: .text%__1cKPSYoungGenRavailable_to_live6M_I_; text: .text%__1cSDeoptimizationBlobGcreate6FpnKCodeBuffer_pnJOopMapSet_iiii_p0_; text: .text%__1cLOptoRuntimeUmultianewarray2_Type6F_pknITypeFunc__; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: ad_sparc_pipeline.o; -text: .text%__1cUAdjoiningGenerations2t6MnNReservedSpace_IIIIIII_v_; -text: .text%__1cWAdjoiningVirtualSpaces2t6MnNReservedSpace_III_v_; text: .text%__1cOchunkpool_init6F_v_; text: .text%__1cFChunkbDstart_chunk_pool_cleaner_task6F_v_; text: .text%__1cJArgumentsWinit_system_properties6F_v_; @@ -4367,7 +4107,6 @@ text: .text%__1cNGCTaskManagerKinitialize6M_v_; text: .text%__1cNGCTaskManagerKthreads_do6MpnNThreadClosure__v_; text: .text%__1cPPerfDataManagerHdestroy6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: genCollectedHeap.o; -text: .text%__1cJGenRemSetYmax_alignment_constraint6Fn0AEName__I_; text: .text%__1cWResolveOopMapConflictsUdo_potential_rewrite6MpnGThread__nMmethodHandle__; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: generateOopMap.o; text: .text%__1cOThreadCriticalKinitialize6F_v_; @@ -4389,7 +4128,6 @@ text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: fprofiler.o; text: .text%__1cFframeVinterpreter_frame_mdp6kM_pC_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: phase.o; text: .text%__1cKPerfMemoryUdelete_memory_region6F_v_; -text: .text%__1cKPerfMemoryUcreate_memory_region6FI_v_; text: .text%__1cbBcleanup_sharedmem_resources6Fpkc_v_: perfMemory_solaris.o; text: .text%__1cPperfMemory_exit6F_v_; text: .text%__1cPperfMemory_init6F_v_; @@ -4420,9 +4158,6 @@ text: .text%__1cNTemplateTableGcaload6F_v_; text: .text%__1cNTemplateTableMfast_icaload6F_v_; text: .text%__1cNTemplateTableGsaload6F_v_; text: .text%__1cKPSYoungGenPinitialize_work6M_v_; -text: .text%__1cKPSYoungGenKinitialize6MnNReservedSpace_I_v_; -text: .text%__1cKPSYoungGenYinitialize_virtual_space6MnNReservedSpace_I_v_; -text: .text%__1cKPSYoungGen2t6MIII_v_; text: .text%__1cNTemplateTableHaload_06F_v_; text: .text%__1cNTemplateTableGistore6F_v_; text: .text%__1cNTemplateTableGlstore6F_v_; @@ -4440,15 +4175,10 @@ text: .text%__1cNTemplateTableLtableswitch6F_v_; text: .text%__1cNTemplateTableMlookupswitch6F_v_; text: .text%__1cNTemplateTableRfast_linearswitch6F_v_; text: .text%__1cNTemplateTableRfast_binaryswitch6F_v_; -text: .text%__1cNCompileBrokerVinit_compiler_threads6Fi_v_; -text: .text%__1cJPSPermGen2t6MnNReservedSpace_IIIIpkci_v_; text: .text%__1cNCompileBrokerQset_should_block6F_v_; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: compileBroker.o; text: .text%__1cNTemplateTableIgetfield6Fi_v_; text: .text%__1cNTemplateTableJgetstatic6Fi_v_; -text: .text%__1cIPSOldGenKinitialize6MnNReservedSpace_Ipkci_v_; -text: .text%__1cIPSOldGen2t6MIIIpkci_v_; -text: .text%__1cIPSOldGen2t6MnNReservedSpace_IIIIpkci_v_; text: .text%__1cVcompiledICHolderKlassMcreate_klass6FpnGThread__pnMklassOopDesc__; text: .text%__1cU__STATIC_CONSTRUCTOR6F_v_: psMarkSweep.o; text: .text%__1cNTemplateTableIputfield6Fi_v_; diff --git a/hotspot/make/solaris/makefiles/rules.make b/hotspot/make/solaris/makefiles/rules.make index e9e87365f57..baafe9c4fd0 100644 --- a/hotspot/make/solaris/makefiles/rules.make +++ b/hotspot/make/solaris/makefiles/rules.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. # 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,14 +151,14 @@ ifdef LP64 %.o: %.cpp @echo Compiling $< $(QUIETLY) $(REMOVE_TARGET) - $(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE) + $(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -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)) + $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \ + $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)) endif %.o: %.s diff --git a/hotspot/make/solaris/makefiles/saproc.make b/hotspot/make/solaris/makefiles/saproc.make index 99661ce6b22..f94a9b4270d 100644 --- a/hotspot/make/solaris/makefiles/saproc.make +++ b/hotspot/make/solaris/makefiles/saproc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # 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,10 +44,9 @@ DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC) # if $(AGENT_DIR) does not exist, we don't build SA -checkAndBuildSA: - $(QUIETLY) if [ -d $(AGENT_DIR) ] ; then \ - $(MAKE) -f vm.make $(LIBSAPROC); \ - fi +ifneq ($(wildcard $(AGENT_DIR)),) + BUILDLIBSAPROC = $(LIBSAPROC) +endif SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) @@ -75,10 +74,10 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) -ldl -ldemangle -lthread -lc [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); } -install_saproc: checkAndBuildSA +install_saproc: $(BULDLIBSAPROC) $(QUIETLY) if [ -f $(LIBSAPROC) ] ; then \ echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \ cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \ fi -.PHONY: checkAndBuildSA install_saproc +.PHONY: install_saproc diff --git a/hotspot/make/solaris/makefiles/sparcWorks.make b/hotspot/make/solaris/makefiles/sparcWorks.make index 34b279b7266..b3b0d514570 100644 --- a/hotspot/make/solaris/makefiles/sparcWorks.make +++ b/hotspot/make/solaris/makefiles/sparcWorks.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. # 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,9 +51,9 @@ ifeq ($(JRE_RELEASE_VER),1.6.0) VALIDATED_COMPILER_REVS := 5.8 VALIDATED_C_COMPILER_REVS := 5.8 else - # Validated compilers for JDK7 are SS12 (5.9) or SS12 update 1 (5.10) - VALIDATED_COMPILER_REVS := 5.9 5.10 - VALIDATED_C_COMPILER_REVS := 5.9 5.10 + # Validated compiler for JDK7 is SS12 update 1 + patches (5.10) + VALIDATED_COMPILER_REVS := 5.10 + VALIDATED_C_COMPILER_REVS := 5.10 endif # Warning messages about not using the above validated versions @@ -145,7 +145,15 @@ OPT_CFLAGS/SLOWER=-xO3 OPT_CFLAGS/O2=-xO2 OPT_CFLAGS/NOOPT=-xO1 -################################################# +# Flags for creating the dependency files. +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) +DEPFLAGS = -xMMD -xMF $(DEP_DIR)/$(@:%=%.d) +endif + +# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. +CFLAGS += -DDONT_USE_PRECOMPILED_HEADER + +################################################ # Begin current (>=5.9) Forte compiler options # ################################################# diff --git a/hotspot/make/solaris/makefiles/sparcv9.make b/hotspot/make/solaris/makefiles/sparcv9.make index af8f0f082c2..ae2fad447f9 100644 --- a/hotspot/make/solaris/makefiles/sparcv9.make +++ b/hotspot/make/solaris/makefiles/sparcv9.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # 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,6 @@ # # -Obj_Files += solaris_sparc.o ASFLAGS += $(AS_ARCHFLAG) ifeq ("${Platform_compiler}", "sparcWorks") diff --git a/hotspot/make/solaris/makefiles/top.make b/hotspot/make/solaris/makefiles/top.make index 1cc8ad11fdf..b0505e77aae 100644 --- a/hotspot/make/solaris/makefiles/top.make +++ b/hotspot/make/solaris/makefiles/top.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. # 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,7 @@ # -generate sa-jdi.jar (JDI binding to core files) # It assumes the following flags are set: -# CFLAGS Platform_file, Src_Dirs, SYSDEFS, AOUT, Jvm_Obj_Files +# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Jvm_Obj_Files # -- D. Ungar (5/97) from a file by Bill Bush @@ -44,42 +44,7 @@ VM = $(GAMMADIR)/src/share/vm Plat_File = $(Platform_file) CDG = cd $(GENERATED); -# Pick up MakeDeps' sources and definitions -include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/makedeps.make -MakeDepsClass = MakeDeps.class -MakeDeps = $(RUN.JAVA) -classpath . MakeDeps - -Include_DBs/GC = $(VM)/includeDB_gc \ - $(VM)/includeDB_gc_parallel \ - $(VM)/gc_implementation/includeDB_gc_parallelScavenge \ - $(VM)/gc_implementation/includeDB_gc_concurrentMarkSweep \ - $(VM)/gc_implementation/includeDB_gc_parNew \ - $(VM)/gc_implementation/includeDB_gc_g1 \ - $(VM)/gc_implementation/includeDB_gc_serial \ - $(VM)/gc_implementation/includeDB_gc_shared - - -Include_DBs/KERNEL = $(VM)/includeDB_core $(VM)/includeDB_gc \ - $(VM)/gc_implementation/includeDB_gc_serial \ - $(VM)/includeDB_jvmti \ - $(VM)/includeDB_compiler1 - -Include_DBs/CORE = $(VM)/includeDB_core $(Include_DBs/GC) \ - $(VM)/includeDB_jvmti \ - $(VM)/includeDB_features -Include_DBs/COMPILER1 = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 -Include_DBs/COMPILER2 = $(Include_DBs/CORE) $(VM)/includeDB_compiler2 -Include_DBs/TIERED = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 \ - $(VM)/includeDB_compiler2 - -Include_DBs = $(Include_DBs/$(TYPE)) - -Cached_plat = platform.current -Cached_db = includeDB.current - -Incremental_Lists =$(GENERATED)/$(Cached_db) -# list generation also creates $(GENERATED)/$(Cached_plat) - +Cached_plat = $(GENERATED)/platform.current AD_Dir = $(GENERATED)/adfiles ADLC = $(AD_Dir)/adlc @@ -98,7 +63,7 @@ adjust-mflags = $(GENERATED)/adjust-mflags MFLAGS-adjusted = -r `$(adjust-mflags) "$(MFLAGS)" "$(HOTSPOT_BUILD_JOBS)"` -# default target: make makeDeps, update lists, make vm +# default target: update lists, make vm # done in stages to force sequential order with parallel make # @@ -106,38 +71,18 @@ default: vm_build_preliminaries the_vm @echo All done. # This is an explicit dependency for the sake of parallel makes. -vm_build_preliminaries: checks $(Incremental_Lists) $(AD_Files_If_Required) jvmti_stuff sa_stuff +vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff sa_stuff @# We need a null action here, so implicit rules don't get consulted. -# make makeDeps: (and zap the cached db files to force a nonincremental run) - -$(GENERATED)/$(MakeDepsClass): $(MakeDepsSources) - @$(COMPILE.JAVAC) -classpath $(GAMMADIR)/src/share/tools/MakeDeps -d $(GENERATED) $(MakeDepsSources) - @echo Removing $(Incremental_Lists) to force regeneration. - @rm -f $(Incremental_Lists) - @$(CDG) echo >$(Cached_plat) - -# make incremental_lists, if cached files out of date, run makeDeps - -$(Incremental_Lists): $(Include_DBs) $(Plat_File) $(GENERATED)/$(MakeDepsClass) - $(CDG) cat $(Include_DBs) > includeDB - $(CDG) if [ ! -r incls ] ; then \ - mkdir incls ; \ - fi - $(CDG) $(MakeDeps) diffs UnixPlatform $(Cached_plat) $(Cached_db) $(Plat_File) includeDB $(MakeDepsOptions) - $(CDG) cp includeDB $(Cached_db) - $(CDG) cp $(Plat_File) $(Cached_plat) - -# symbolic target for command lines -lists: $(Incremental_Lists) - @: lists are now up to date +$(Cached_plat): $(Plat_File) + $(CDG) cp $(Plat_File) $(Cached_plat) # make AD files as necessary -ad_stuff: $(Incremental_Lists) $(adjust-mflags) +ad_stuff: $(Cached_plat) $(adjust-mflags) @$(MAKE) -f adlc.make $(MFLAGS-adjusted) # generate JVMTI files from the spec -jvmti_stuff: $(Incremental_Lists) $(adjust-mflags) +jvmti_stuff: $(Cached_plat) $(adjust-mflags) @$(MAKE) -f jvmti.make $(MFLAGS-adjusted) # generate SA jar files and native header @@ -172,7 +117,6 @@ install: the_vm # this should force everything to be rebuilt clean: rm -f $(GENERATED)/*.class - $(MAKE) $(MFLAGS) $(GENERATED)/$(MakeDepsClass) $(MAKE) -f vm.make $(MFLAGS) clean # just in case it doesn't, this should do it diff --git a/hotspot/make/solaris/makefiles/vm.make b/hotspot/make/solaris/makefiles/vm.make index 7289c72f950..9728b1dc43c 100644 --- a/hotspot/make/solaris/makefiles/vm.make +++ b/hotspot/make/solaris/makefiles/vm.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. # 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,23 +35,23 @@ default: build # Defs GENERATED = ../generated +DEP_DIR = $(GENERATED)/dependencies -# read a generated file defining the set of .o's and the .o .h dependencies -include $(GENERATED)/Dependencies +# reads the generated files defining the set of .o's and the .o .h dependencies +-include $(DEP_DIR)/*.d # read machine-specific adjustments (%%% should do this via buildtree.make?) include $(MAKEFILES_DIR)/$(BUILDARCH).make # set VPATH so make knows where to look for source files -# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm -# The incls directory contains generated header file lists for inclusion. +# Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm # The adfiles directory contains ad_.[ch]pp. # The jvmtifiles directory contains jvmti*.[ch]pp -Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls -VPATH += $(Src_Dirs_V:%=%:) +Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles +VPATH += $(Src_Dirs_V:%=%:) # set INCLUDES for C preprocessor -Src_Dirs_I = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED) +Src_Dirs_I += $(GENERATED) INCLUDES += $(Src_Dirs_I:%=-I%) ifeq (${VERSION}, debug) @@ -106,19 +106,23 @@ ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1) # Not sure what the 'designed for' comment is referring too above. # The order may not be too significant anymore, but I have placed this # older libm before libCrun, just to make sure it's found and used first. -LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc +LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc -ldemangle else ifeq ($(COMPILER_REV_NUMERIC), 502) # SC6.1 has it's own libm.so: specifying anything else provokes a name conflict. -LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor +LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor -ldemangle else -LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor +LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor -ldemangle endif # 502 endif # 505 else -LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc +LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc -ldemangle endif # sparcWorks +ifeq ("${Platform_arch}", "sparc") +LIBS += -lkstat +endif + # By default, link the *.o into the library, not the executable. LINK_INTO$(LINK_INTO) = LIBJVM @@ -135,6 +139,64 @@ JVM = jvm LIBJVM = lib$(JVM).so LIBJVM_G = lib$(JVM)$(G_SUFFIX).so +CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)) +CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm +CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm +CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm +CORE_PATHS += $(GENERATED)/jvmtifiles + +COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1 + +COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto +COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt +COMPILER2_PATHS += $(GENERATED)/adfiles + +# Include dirs per type. +Src_Dirs/CORE := $(CORE_PATHS) +Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS) +Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS) +Src_Dirs/TIERED := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS) +Src_Dirs/ZERO := $(CORE_PATHS) +Src_Dirs/SHARK := $(CORE_PATHS) +Src_Dirs := $(Src_Dirs/$(TYPE)) + +COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\* +COMPILER1_SPECIFIC_FILES := c1_\* +SHARK_SPECIFIC_FILES := shark +ZERO_SPECIFIC_FILES := zero + +# Always exclude these. +Src_Files_EXCLUDE := dtrace jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp + +# Exclude per type. +Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp +Src_Files_EXCLUDE/COMPILER1 := $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp +Src_Files_EXCLUDE/COMPILER2 := $(COMPILER1_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) +Src_Files_EXCLUDE/TIERED := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) +Src_Files_EXCLUDE/ZERO := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp +Src_Files_EXCLUDE/SHARK := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) + +Src_Files_EXCLUDE += $(Src_Files_EXCLUDE/$(TYPE)) + +# Special handling of arch model. +ifeq ($(Platform_arch_model), x86_32) +Src_Files_EXCLUDE += \*x86_64\* +endif +ifeq ($(Platform_arch_model), x86_64) +Src_Files_EXCLUDE += \*x86_32\* +endif + +# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE. +define findsrc + $(notdir $(shell find $(1)/. ! -name . -prune \ + -a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \ + -a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \))) +endef + +Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e))) + +Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files)))) + JVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS) vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES)) @@ -205,7 +267,7 @@ include $(MAKEFILES_DIR)/saproc.make #---------------------------------------------------------------------- -build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) checkAndBuildSA dtraceCheck +build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) $(BUILDLIBSAPROC) dtraceCheck install: install_jvm install_jsig install_saproc diff --git a/hotspot/make/windows/README b/hotspot/make/windows/README deleted file mode 100644 index 2f966374fab..00000000000 --- a/hotspot/make/windows/README +++ /dev/null @@ -1,212 +0,0 @@ -Copyright (c) 2007 Oracle and/or its affiliates. All rights reserved. -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - -This code is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License version 2 only, as -published by the Free Software Foundation. - -This code is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -version 2 for more details (a copy is included in the LICENSE file that -accompanied this code). - -You should have received a copy of the GNU General Public License version -2 along with this work; if not, write to the Free Software Foundation, -Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - -Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -or visit www.oracle.com if you need additional information or have any -questions. - -________________________________________________________________________________ - -__Introduction__________________________________________________________________ - -This readme file should provide all the information needed to build -the HotSpot VM for Windows 95/Windows NT from its teamware workspace. -It is intended as a starting point for people who want to learn how -to work with the current HotSpot source workspace and who need to -build the VM locally. It is not intended as a tutorial for licensees. - -Last update: 03/28/05 - - -__Platform______________________________________________________________________ - -The VM builds under the following platforms: -- Windows NT 4.0 on Intel x486 or greater -- x486 PC (or greater), 32MByte or more - - -__Tools_________________________________________________________________________ - -For building/testing the following tools need to be available: -- Microsoft Visual C++ 6.0 (with nmake version 1.62.7022 or greater) -- MKS Toolkit 6.1 or greater - see: /net/reinstall/export/vol0/pc-archive/software/mks6.1 (NFS) - or: \\reinstall\pc-archive\software\mks6.1 (NT) - - -__JDK___________________________________________________________________________ - -The workspace works with the following version of the JDK: -(NOTE: these are out of date) -- JDK1.2FCS "V" build - see: /usr/local/java/jdk1.2/win32 - -and the following version(s) of HotJava: -- hjb1.1.4 -- hjb1.1.5 - see /usr/local/java/hjb1.1.x/win32 - - -__Environment variables_________________________________________________________ - -The following environment variables need to be set up for the IDE -build process. For batch builds these do not need to be set. - -HotSpotMksHome points to the (NFS or PC-local) directory where the MKS - executables (like sh.exe and grep.exe) are installed - -Optionally you may set the following variables in your environment and they -will be picked up by the create.bat script used to generate the vm.vcproj files. -See the section on building within MS Developer Studio for more details. - -HotSpotWorkSpace points to the (NFS) directory where the workspace is located -HotSpotBuildSpace points to the (PC-local) directory where the vm is built -HotSpotReleaseBinDest points to the (NFS or PC-local) directory where the product DLL is - written -HotSpotDebugBinDest points to the (NFS or PC-local) directory where the debug DLL is - written - -NOTE: For both batch and IDE builds, java and javac must be in your -PATH, and the versions found by default must work. (If this turns out -to be a problem, we can define HotSpotJava and HotSpotJavaC for -bootstrapping...) - -__Building the JVM from the command line________________________________________ - -1) choose a directory in which you want to build the vm - (the build process will create a subdirectory) - -2) To build the 'core' version (debug || optimized) - %HotSpotWorkSpace%\build\windows\build core %HotSpotWorkSpace% - To build the 'compiler2' version (debug || optimized) - %HotSpotWorkSpace%\build\windows\build compiler2 %HotSpotWorkSpace% - - where is a full path to a JDK in which bin/java and - bin/javac are present and working. - -3) If you have problems with building, first try: - vcvars32 (sets path for VC++) - -4) In addition to jvm.dll, the Serviceability Agent (SA) based JDI connector - and command line tools are built if dbgeng.h and dbgeng.lib - can be located, and BUILD_WIN_SA=1 is specified. We look for dbgeng.h here: - $(MSVCDIR)\PlatformSDK\Include - $(SYSTEMROOT)\..\Program Files\Microsoft SDK\include - - The first directory is part of Visual Studio VC .NET 2003. - The second is used on Windows-amd64. - - -__Building the JVM from within MS Developer Studio______________________________ - -0) Set environment variables as described above - -1) Run the following script: - %HotSpotWorkSpace%\build\windows\create { } - where type is one of core, compiler1, compiler2. If you leave off the - " " part, the script expects to find their - values in the HotSpotWorkSpace, HotSpotBuildSpace, HotSpotReleaseBinDest, and HotSpotDebugBinDest environment - variables. The resulting vm.vcproj does not depend on these values in the environment. - - This will populate the build space with the appropriate makefiles - and run nmake in it. This builds and runs makedeps, which now - generates the appropriate vm.vcproj into the build space. It also - builds and runs adlc. - - To regenerate the .incl and .dsp files after changing the include - databases, just run nmake in the build space. - - The build process now relies on java and javac. For the IDE builds, - the full path to a JDK (in which bin/java and bin/javac are present - and working) can be specified either explicitly with the - ALT_BOOTDIR environment variable (like the JDK build process), via - the JDK build's default BOOTDIR environment variable, via JAVA_HOME, - or implicitly via the PATH. - - (Note that there are now many more command line options to MakeDeps - on the Windows platform than before. These have been bundled into - makefiles/makedeps.make, but it is still necessary to keep this in - sync with the batch makefiles, in vm/generated.) - - If you have problems with building (i.e,. finding nmake), first try: - vcvars32 (sets path for VC++) - -2) Double-click the vm.vcproj file in the %HotSpotBuildSpace% directory - to open MS Developer Studio. - -3) build desired or all versions: - menu Build -> Batch Build... -> Build (or Rebuild All) - -4) jvm.dll is in the %HotSpotReleaseBinDest% or %HotSpotDebugBinDest% directory - depending on which configuration you built (release or debug). - -Note: do not edit any of the files (especially the vm.vcproj file) in the -build space, since they are all either autogenerated or copied from -the work space. If necessary, modify the original Makefiles in -%HotSpotWorkSpace%\build\windows\projectfiles, or the shared -makedeps arguments in -%HotSpotWorkSpace%\build\windows\makefiles\makedeps.make. - -Note that it appears that some options set in the IDE (for example, -the default executable) show up not in the .dsp file, but in the .opt -file, so the automatic regeneration of the .dsp file should not -destroy the project settings. However, makedeps.make should be edited -to supply per-file compiler options. - -To build adlc from within the IDE for debugging purposes: - -1) in MS Developer Studio, open ADLCompiler.dsw: - menu File -> Open Workspace... - select & double-click ADLCompiler.dsw - -2) rebuild all (debug mode is enough) - menu Build -> Rebuild All (make sure Win32 Debug version is selected) - - -__Testing the VM________________________________________________________________ - -To test the VM using the Tonga Testsuite, use testlook. testlook is a very -simple testing framework on top of Tonga which allows us to use one (Tonga) -test file, that can be extended with attributes. - -1) copy %HotSpotWorkSpace%\test\testlook.bat onto PC (preferably - %HotSpotBuildSpace%\bin, which should ideally be in the path) - -2) run testlook or testlook help for details - -3) to run testlook you need to have Tonga mounted: - net use T: \\tapas\export1\psqe - - -__HotJava under HotSpot_________________________________________________________ - -To run HotJava, use the .bat file %HotSpotWorkSpace%\test\h.bat. Copy -it into %HotSpotBuildSpace%/ (which ideally is in the path) and run -HotJava: h java (e.g., h java_g -Xint). - - -__Preferred directory setup under Windows NT____________________________________ - -Within the HotSpot group we are using the following directory setup: - -D:\jdk1.2 - where we install the JDK - -The following drives are mounted for testing/putbacks/etc.: - -net use T: \\tapas\export1\psqe -net use Y: \\rschmidt\GammaBase -net use Z: \\animorphic\animorphic diff --git a/hotspot/make/windows/build.bat b/hotspot/make/windows/build.bat index f40b2654a5e..ee0a6b058d2 100644 --- a/hotspot/make/windows/build.bat +++ b/hotspot/make/windows/build.bat @@ -1,6 +1,6 @@ @echo off REM -REM Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. +REM Copyright (c) 1997, 2010, Oracle and/or its affiliates. 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 1c502ca1eb3..8e50a4f077f 100644 --- a/hotspot/make/windows/build.make +++ b/hotspot/make/windows/build.make @@ -74,9 +74,11 @@ BUILDARCH=ia64 !if "$(BUILDARCH)" != "ia64" !ifndef CC_INTERP +!ifndef FORCE_TIERED FORCE_TIERED=1 !endif !endif +!endif !if "$(BUILDARCH)" == "amd64" Platform_arch=x86 @@ -100,7 +102,7 @@ VARIANT_TEXT=Core !if "$(Variant)" == "compiler1" VARIANT_TEXT=Client !elseif "$(Variant)" == "compiler2" -!ifdef FORCE_TIERED +!if "$(FORCE_TIERED)" == "1" VARIANT_TEXT=Server realVariant=tiered !else diff --git a/hotspot/make/windows/build_vm_def.sh b/hotspot/make/windows/build_vm_def.sh index 5eae61ce390..9c9593b4a7f 100644 --- a/hotspot/make/windows/build_vm_def.sh +++ b/hotspot/make/windows/build_vm_def.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. # 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,6 +45,9 @@ fi echo "EXPORTS" > vm1.def AWK="$MKS_HOME/awk.exe" +if [ ! -e $AWK ]; then + AWK="$MKS_HOME/gawk.exe" +fi GREP="$MKS_HOME/grep.exe" SORT="$MKS_HOME/sort.exe" UNIQ="$MKS_HOME/uniq.exe" @@ -57,7 +60,7 @@ if [ "x$1" != "x" ]; then LINK_VER="$1" fi -if [ "x$LINK_VER" != "x800" -a "x$LINK_VER" != "x900" ]; then +if [ "x$LINK_VER" != "x800" -a "x$LINK_VER" != "x900" -a "x$LINK_VER" != "x1000" ]; then $DUMPBIN /symbols *.obj | "$GREP" "??_7.*@@6B@" | "$GREP" -v "type_info" | "$AWK" '{print $7}' | "$SORT" | "$UNIQ" > vm2.def else # Can't use pipes when calling cl.exe or link.exe from IDE. Using transit file vm3.def diff --git a/hotspot/make/windows/create.bat b/hotspot/make/windows/create.bat index 172f706f15b..4592d8becfe 100644 --- a/hotspot/make/windows/create.bat +++ b/hotspot/make/windows/create.bat @@ -1,6 +1,6 @@ @echo off REM -REM Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. +REM Copyright (c) 1999, 2010, Oracle and/or its affiliates. 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 @@ -26,11 +26,8 @@ REM REM This is the interactive build setup script (as opposed to the batch REM build execution script). It creates $HotSpotBuildSpace if necessary, REM copies the appropriate files out of $HotSpotWorkSpace into it, and -REM builds and runs MakeDeps in it. This has the side-effect of creating +REM builds and runs ProjectCreator in it. This has the side-effect of creating REM the vm.vcproj file in the buildspace, which is then used in Visual C++. -REM -REM The generated project file depends upon the include databases. If -REM those are changed then MakeDeps is rerun. REM REM Since we don't have uname and we could be cross-compiling, @@ -39,6 +36,20 @@ REM REM Note: Running this batch file from the Windows command shell requires REM that "grep" be accessible on the PATH. An MKS install does this. REM + +cl 2>NUL >NUL +if %errorlevel% == 0 goto nexttest +echo Make sure cl.exe is in your PATH before running this script. +goto end + +:nexttest +grep -V 2>NUL >NUL +if %errorlevel% == 0 goto testit +echo Make sure grep.exe is in your PATH before running this script. Either cygwin or MKS should work. +goto end + + +:testit cl 2>&1 | grep "IA-64" >NUL if %errorlevel% == 0 goto isia64 cl 2>&1 | grep "AMD64" >NUL @@ -47,37 +58,40 @@ set ARCH=x86 set BUILDARCH=i486 set Platform_arch=x86 set Platform_arch_model=x86_32 -goto end +goto done :amd64 set ARCH=x86 set BUILDARCH=amd64 set Platform_arch=x86 set Platform_arch_model=x86_64 -goto end +goto done :isia64 set ARCH=ia64 set BUILDARCH=ia64 set Platform_arch=ia64 set Platform_arch_model=ia64 -:end +:done setlocal if "%1" == "" goto usage -if not "%4" == "" goto usage +if not "%2" == "" goto usage + +REM Set HotSpotWorkSpace to the directy two steps above this script +for %%i in ("%~dp0..") do ( set HotSpotWorkSpace=%%~dpi) +set HotSpotBuildRoot=%HotSpotWorkSpace%build +set HotSpotBuildSpace=%HotSpotBuildRoot%\vs +set HotSpotJDKDist=%1 -set HotSpotWorkSpace=%1 -set HotSpotBuildSpace=%2 -set HotSpotJDKDist=%3 REM figure out MSC version for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i echo ************************************************************** -set ProjectFile=vm.vcproj +set ProjectFile=jvm.vcproj if "%MSC_VER%" == "1200" ( -set ProjectFile=vm.dsp +set ProjectFile=jvm.dsp echo Will generate VC6 project {unsupported} ) else ( if "%MSC_VER%" == "1400" ( @@ -86,10 +100,16 @@ echo Will generate VC8 {Visual Studio 2005} if "%MSC_VER%" == "1500" ( echo Will generate VC9 {Visual Studio 2008} ) else ( +if "%MSC_VER%" == "1600" ( +echo Detected Visual Studio 2010, but +echo will generate VC9 {Visual Studio 2008} +echo Use conversion wizard in VS 2010. +) else ( echo Will generate VC7 project {Visual Studio 2003 .NET} ) ) ) +) echo %ProjectFile% echo ************************************************************** @@ -121,6 +141,8 @@ goto usage :test3 if not "%HOTSPOTMKSHOME%" == "" goto makedir +if exist c:\cygwin\bin set HOTSPOTMKSHOME=c:\cygwin\bin +if not "%HOTSPOTMKSHOME%" == "" goto makedir echo Warning: please set variable HOTSPOTMKSHOME to place where echo your MKS/Cygwin installation is echo. @@ -136,21 +158,24 @@ echo HotSpotJDKDist=%HotSpotJDKDist% REM This is now safe to do. :copyfiles for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( -if NOT EXIST %HotSpotBuildSpace%\%%i mkdir %HotSpotBuildSpace%\%%i -copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\ > NUL +if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated +copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL ) REM force regneration of ProjectFile if exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile% for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( - -echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make +echo -- %%i -- +echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.make -echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make +echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make echo. >> %HotSpotBuildSpace%\%%i\local.make +echo Variant=%%i >> %HotSpotBuildSpace%\%%i\local.make +echo WorkSpace=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make +echo HOTSPOTBUILDROOT=%HotSpotBuildRoot% >> %HotSpotBuildSpace%\%%i\local.make echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.make echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.make echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.make @@ -158,28 +183,36 @@ echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.m echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make -REM build config specific stuff +for /D %%j in (debug, fastdebug, product) do ( +if NOT EXIST %HotSpotBuildSpace%\%%i\%%j mkdir %HotSpotBuildSpace%\%%i\%%j +) -pushd %HotSpotBuildSpace%\%%i +pushd %HotSpotBuildSpace%\%%i\generated nmake /nologo popd + ) +pushd %HotSpotBuildRoot% + +REM It doesn't matter which variant we use here, "compiler1" is as good as any of the others - we need the common variables +nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile LOCAL_MAKE=%HotSpotBuildSpace%\compiler1\local.make %HotSpotBuildRoot%/%ProjectFile% + +popd + goto end :usage -echo Usage: create HotSpotWorkSpace HotSpotBuildSpace HotSpotJDKDist +echo Usage: create HotSpotJDKDist echo. -echo This is the interactive build setup script (as opposed to the batch -echo build execution script). It creates HotSpotBuildSpace if necessary, -echo copies the appropriate files out of HotSpotWorkSpace into it, and -echo builds and runs MakeDeps in it. This has the side-effect of creating +echo This is the VS build setup script (as opposed to the batch +echo build execution script). It creates a build directory if necessary, +echo copies the appropriate files out of the workspace into it, and +echo builds and runs ProjectCreator in it. This has the side-effect of creating echo the %ProjectFile% file in the build space, which is then used in Visual C++. -echo The HotSpotJDKDist defines place where JVM binaries should be placed. -echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection. echo. -echo The generated project file depends upon the include databases. If -echo those are changed then MakeDeps is rerun. +echo The HotSpotJDKDist defines the JDK that should be used when running the JVM. +echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection. echo. echo NOTE that it is now NOT safe to modify any of the files in the build echo space, since they may be overwritten whenever this script is run or diff --git a/hotspot/make/windows/create_obj_files.sh b/hotspot/make/windows/create_obj_files.sh new file mode 100644 index 00000000000..52ae0bb785c --- /dev/null +++ b/hotspot/make/windows/create_obj_files.sh @@ -0,0 +1,128 @@ +# +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# + +set -e + +# Note that we currently do not have a way to set HotSpotMksHome in +# the batch build, but so far this has not seemed to be a problem. The +# reason this environment variable is necessary is that it seems that +# Windows truncates very long PATHs when executing shells like MKS's +# sh, and it has been found that sometimes `which sh` fails. + +if [ "x$HotSpotMksHome" != "x" ]; then + TOOL_DIR="$HotSpotMksHome" +else + # HotSpotMksHome is not set so use the directory that contains "sh". + # This works with both MKS and Cygwin. + SH=`which sh` + TOOL_DIR=`dirname "$SH"` +fi + +DIRNAME="$TOOL_DIR/dirname" +FIND="$TOOL_DIR/find" + +TYPE=$1 +Platform_arch=$2 +Platform_arch_model=$3 +Platform_os_family=windows +Platform_os_arch=windows_$Platform_arch + +WorkSpace=$4 +GENERATED=$5 + +BASE_PATHS="` $FIND ${WorkSpace}/src/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)`" +BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/share/vm/gc_implementation/shared" +BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/os/${Platform_os_family}/vm" +BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/cpu/${Platform_arch}/vm" +BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/os_cpu/${Platform_os_arch}/vm" +BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles" + +CORE_PATHS="${BASE_PATHS}" +# shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS. +CORE_PATHS="${CORE_PATHS} `$FIND ${WorkSpace}/src/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`" + +COMPILER1_PATHS="${WorkSpace}/src/share/vm/c1" + +COMPILER2_PATHS="${WorkSpace}/src/share/vm/opto" +COMPILER2_PATHS="${COMPILER2_PATHS} ${WorkSpace}/src/share/vm/libadt" +COMPILER2_PATHS="${COMPILER2_PATHS} ${GENERATED}/adfiles" + +# Include dirs per type. +case "${TYPE}" in + "core") Src_Dirs="${CORE_PATHS}" ;; + "kernel") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS}" ;; + "compiler1") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS}" ;; + "compiler2") Src_Dirs="${CORE_PATHS} ${COMPILER2_PATHS}" ;; + "tiered") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;; + "zero") Src_Dirs="${CORE_PATHS}" ;; + "shark") Src_Dirs="${CORE_PATHS}" ;; +esac + +COMPILER2_SPECIFIC_FILES="opto libadt bcEscapeAnalyzer.cpp chaitin* c2_* runtime_*" +COMPILER1_SPECIFIC_FILES="c1_*" +SHARK_SPECIFIC_FILES="shark" +ZERO_SPECIFIC_FILES="zero" + +# These files need to be excluded when building the kernel target. +KERNEL_EXCLUDED_FILES="attachListener.cpp attachListener_windows.cpp dump.cpp dump_${Platform_arch_model}.cpp forte.cpp fprofiler.cpp heapDumper.cpp heapInspection.cpp jniCheck.cpp jvmtiCodeBlobEvents.cpp jvmtiExtensions.cpp jvmtiImpl.cpp jvmtiRawMonitor.cpp jvmtiTagMap.cpp jvmtiTrace.cpp restore.cpp serialize.cpp vmStructs.cpp g1MemoryPool.cpp psMemoryPool.cpp gcAdaptivePolicyCounters.cpp concurrentGCThread.cpp mutableNUMASpace.cpp allocationStats.cpp gSpaceCounters.cpp immutableSpace.cpp mutableSpace.cpp spaceCounters.cpp yieldingWorkgroup.cpp" + +# Always exclude these. +Src_Files_EXCLUDE="jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp" + +# Exclude per type. +case "${TYPE}" in + "core") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;; + "kernel") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ${KERNEL_EXCLUDED_FILES} ciTypeFlow.cpp" ;; + "compiler1") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;; + "compiler2") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;; + "tiered") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;; + "zero") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;; + "shark") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES}" ;; +esac + +# Special handling of arch model. +case "${Platform_arch_model}" in + "x86_32") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} *x86_64*" ;; + "x86_64") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} *x86_32*" ;; +esac + +# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE. +function findsrc { + $FIND ${1}/. ! -name . -prune \ + -a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \ + -a \! \( -name ${Src_Files_EXCLUDE// / -o -name } \) \ + | sed 's/.*\/\(.*\)/\1/'; +} + +Src_Files= +for e in ${Src_Dirs}; do + Src_Files="${Src_Files}`findsrc ${e}` " +done + +Obj_Files= +for e in ${Src_Files}; do + Obj_Files="${Obj_Files}${e%\.[!.]*}.obj " +done + +echo Obj_Files=${Obj_Files} diff --git a/hotspot/make/windows/get_msc_ver.sh b/hotspot/make/windows/get_msc_ver.sh index 0cea6d99b85..339e92b2f71 100644 --- a/hotspot/make/windows/get_msc_ver.sh +++ b/hotspot/make/windows/get_msc_ver.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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 c7519da4955..d03e73373ea 100644 --- a/hotspot/make/windows/makefiles/adlc.make +++ b/hotspot/make/windows/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # 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,6 @@ # # -!include $(WorkSpace)/make/windows/makefiles/compile.make # Rules for building adlc.exe @@ -46,27 +45,16 @@ ADLCFLAGS=-q -T -D_LP64 ADLCFLAGS=-q -T -U_LP64 !endif -CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE +ADLC_CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE CPP_INCLUDE_DIRS=\ - /I "..\generated" \ - /I "$(WorkSpace)\src\share\vm\compiler" \ - /I "$(WorkSpace)\src\share\vm\code" \ - /I "$(WorkSpace)\src\share\vm\interpreter" \ - /I "$(WorkSpace)\src\share\vm\classfile" \ - /I "$(WorkSpace)\src\share\vm\asm" \ - /I "$(WorkSpace)\src\share\vm\memory" \ - /I "$(WorkSpace)\src\share\vm\oops" \ - /I "$(WorkSpace)\src\share\vm\prims" \ - /I "$(WorkSpace)\src\share\vm\runtime" \ - /I "$(WorkSpace)\src\share\vm\utilities" \ - /I "$(WorkSpace)\src\share\vm\libadt" \ - /I "$(WorkSpace)\src\share\vm\opto" \ - /I "$(WorkSpace)\src\os\windows\vm" \ + /I "..\generated" \ + /I "$(WorkSpace)\src\share\vm" \ + /I "$(WorkSpace)\src\os\windows\vm" \ /I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm" -# NOTE! If you add any files here, you must also update GENERATED_NAMES_IN_INCL -# and MakeDepsIDEOptions in makedeps.make. +# NOTE! If you add any files here, you must also update GENERATED_NAMES_IN_DIR +# and ProjectCreatorIDEOptions in projectcreator.make. GENERATED_NAMES=\ ad_$(Platform_arch_model).cpp \ ad_$(Platform_arch_model).hpp \ @@ -81,24 +69,24 @@ GENERATED_NAMES=\ dfa_$(Platform_arch_model).cpp # NOTE! This must be kept in sync with GENERATED_NAMES -GENERATED_NAMES_IN_INCL=\ - incls/ad_$(Platform_arch_model).cpp \ - incls/ad_$(Platform_arch_model).hpp \ - incls/ad_$(Platform_arch_model)_clone.cpp \ - incls/ad_$(Platform_arch_model)_expand.cpp \ - incls/ad_$(Platform_arch_model)_format.cpp \ - incls/ad_$(Platform_arch_model)_gen.cpp \ - incls/ad_$(Platform_arch_model)_misc.cpp \ - incls/ad_$(Platform_arch_model)_peephole.cpp \ - incls/ad_$(Platform_arch_model)_pipeline.cpp \ - incls/adGlobals_$(Platform_arch_model).hpp \ - incls/dfa_$(Platform_arch_model).cpp +GENERATED_NAMES_IN_DIR=\ + $(AdlcOutDir)\ad_$(Platform_arch_model).cpp \ + $(AdlcOutDir)\ad_$(Platform_arch_model).hpp \ + $(AdlcOutDir)\ad_$(Platform_arch_model)_clone.cpp \ + $(AdlcOutDir)\ad_$(Platform_arch_model)_expand.cpp \ + $(AdlcOutDir)\ad_$(Platform_arch_model)_format.cpp \ + $(AdlcOutDir)\ad_$(Platform_arch_model)_gen.cpp \ + $(AdlcOutDir)\ad_$(Platform_arch_model)_misc.cpp \ + $(AdlcOutDir)\ad_$(Platform_arch_model)_peephole.cpp \ + $(AdlcOutDir)\ad_$(Platform_arch_model)_pipeline.cpp \ + $(AdlcOutDir)\adGlobals_$(Platform_arch_model).hpp \ + $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp {$(WorkSpace)\src\share\vm\adlc}.cpp.obj:: - $(CPP) $(CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $< + $(CPP) $(ADLC_CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $< {$(WorkSpace)\src\share\vm\opto}.cpp.obj:: - $(CPP) $(CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $< + $(CPP) $(ADLC_CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $< adlc.exe: main.obj adlparse.obj archDesc.obj arena.obj dfa.obj dict2.obj filebuff.obj \ forms.obj formsopt.obj formssel.obj opcodes.obj output_c.obj output_h.obj @@ -110,10 +98,12 @@ adlc.exe: main.obj adlparse.obj archDesc.obj arena.obj dfa.obj dict2.obj filebuf $(MT) /manifest $@.manifest /outputresource:$@;#1 !endif -$(GENERATED_NAMES_IN_INCL): $(Platform_arch_model).ad adlc.exe includeDB.current +$(GENERATED_NAMES_IN_DIR): $(Platform_arch_model).ad adlc.exe rm -f $(GENERATED_NAMES) + if exist $(AdlcOutDir) rmdir /s /q $(AdlcOutDir) + mkdir $(AdlcOutDir) $(ADLC) $(ADLCFLAGS) $(Platform_arch_model).ad - mv $(GENERATED_NAMES) incls/ + mv $(GENERATED_NAMES) $(AdlcOutDir)/ $(Platform_arch_model).ad: $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad $(WorkSpace)/src/os_cpu/windows_$(Platform_arch)/vm/windows_$(Platform_arch_model).ad rm -f $(Platform_arch_model).ad diff --git a/hotspot/make/windows/makefiles/compile.make b/hotspot/make/windows/makefiles/compile.make index 7d7cb8642c3..47d924418b2 100644 --- a/hotspot/make/windows/makefiles/compile.make +++ b/hotspot/make/windows/makefiles/compile.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -80,6 +80,20 @@ CPP_FLAGS=$(CPP_FLAGS) /D "IA32" CPP=ARCH_ERROR !endif +CPP_FLAGS=$(CPP_FLAGS) /D "WIN32" /D "_WINDOWS" + +# Must specify this for sharedRuntimeTrig.cpp +CPP_FLAGS=$(CPP_FLAGS) /D "VM_LITTLE_ENDIAN" + +# Used for platform dispatching +CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_FAMILY_windows +CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_$(Platform_arch) +CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_MODEL_$(Platform_arch_model) +CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_windows_$(Platform_arch) +CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model) +CPP_FLAGS=$(CPP_FLAGS) /D TARGET_COMPILER_visCPP + + # MSC_VER is a 4 digit number that tells us what compiler is being used # and is generated when the local.make file is created by build.make # via the script get_msc_ver.sh @@ -138,7 +152,7 @@ MS_RUNTIME_OPTION = /MTd /D "_DEBUG" !endif # Always add the _STATIC_CPPLIB flag -STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB +STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB MS_RUNTIME_OPTION = $(MS_RUNTIME_OPTION) $(STATIC_CPPLIB_OPTION) CPP_FLAGS=$(CPP_FLAGS) $(MS_RUNTIME_OPTION) diff --git a/hotspot/make/windows/makefiles/debug.make b/hotspot/make/windows/makefiles/debug.make index 893a252d522..32d4f46e91d 100644 --- a/hotspot/make/windows/makefiles/debug.make +++ b/hotspot/make/windows/makefiles/debug.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. # 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,7 +28,12 @@ AOUT=$(HS_FNAME) SAWINDBG=sawindbg.dll GENERATED=../generated -default:: _build_pch_file.obj $(AOUT) checkAndBuildSA +# Allow the user to turn off precompiled headers from the command line. +!if "$(USE_PRECOMPILED_HEADER)" != "0" +BUILD_PCH_FILE=_build_pch_file.obj +!endif + +default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA !include ../local.make !include compile.make @@ -38,15 +43,15 @@ CPP_FLAGS=$(CPP_FLAGS) $(DEBUG_OPT_OPTION) !include $(WorkSpace)/make/windows/makefiles/vm.make !include local.make -!include $(GENERATED)/Dependencies - HS_BUILD_ID=$(HS_BUILD_VER)-debug # Force resources to be rebuilt every time $(Res_Files): FORCE -$(AOUT): $(Res_Files) $(Obj_Files) +vm.def: $(Obj_Files) sh $(WorkSpace)/make/windows/build_vm_def.sh + +$(AOUT): $(Res_Files) $(Obj_Files) vm.def $(LINK) @<< $(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files) << @@ -59,3 +64,4 @@ $(AOUT): $(Res_Files) $(Obj_Files) !include $(WorkSpace)/make/windows/makefiles/shared.make !include $(WorkSpace)/make/windows/makefiles/sa.make +!include $(WorkSpace)/make/windows/makefiles/launcher.make diff --git a/hotspot/make/windows/makefiles/defs.make b/hotspot/make/windows/makefiles/defs.make index b126c702a7d..ded87af7b46 100644 --- a/hotspot/make/windows/makefiles/defs.make +++ b/hotspot/make/windows/makefiles/defs.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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 4b59010cbe6..b9e828b7483 100644 --- a/hotspot/make/windows/makefiles/fastdebug.make +++ b/hotspot/make/windows/makefiles/fastdebug.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # 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,7 +28,12 @@ AOUT=$(HS_FNAME) SAWINDBG=sawindbg.dll GENERATED=../generated -default:: _build_pch_file.obj $(AOUT) checkAndBuildSA +# Allow the user to turn off precompiled headers from the command line. +!if "$(USE_PRECOMPILED_HEADER)" != "0" +BUILD_PCH_FILE=_build_pch_file.obj +!endif + +default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA !include ../local.make !include compile.make @@ -38,15 +43,15 @@ CPP_FLAGS=$(CPP_FLAGS) $(FASTDEBUG_OPT_OPTION) !include $(WorkSpace)/make/windows/makefiles/vm.make !include local.make -!include $(GENERATED)/Dependencies - HS_BUILD_ID=$(HS_BUILD_VER)-fastdebug # Force resources to be rebuilt every time $(Res_Files): FORCE -$(AOUT): $(Res_Files) $(Obj_Files) +vm.def: $(Obj_Files) sh $(WorkSpace)/make/windows/build_vm_def.sh + +$(AOUT): $(Res_Files) $(Obj_Files) vm.def $(LINK) @<< $(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files) << @@ -57,6 +62,6 @@ $(AOUT): $(Res_Files) $(Obj_Files) $(MT) /manifest $@.manifest /outputresource:$@;#2 !endif - !include $(WorkSpace)/make/windows/makefiles/shared.make !include $(WorkSpace)/make/windows/makefiles/sa.make +!include $(WorkSpace)/make/windows/makefiles/launcher.make diff --git a/hotspot/make/windows/makefiles/generated.make b/hotspot/make/windows/makefiles/generated.make index 47d3bd8b78b..d5add4b030f 100644 --- a/hotspot/make/windows/makefiles/generated.make +++ b/hotspot/make/windows/makefiles/generated.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # 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 @@ # !include ../local.make -!include $(WorkSpace)/make/windows/makefiles/makedeps.make +!include $(WorkSpace)/make/windows/makefiles/projectcreator.make !include local.make # Pick up rules for building JVMTI (JSR-163) @@ -33,68 +33,25 @@ JvmtiOutDir=jvmtifiles # Pick up rules for building SA !include $(WorkSpace)/make/windows/makefiles/sa.make +AdlcOutDir=adfiles + !if ("$(Variant)" == "compiler2") || ("$(Variant)" == "tiered") -default:: includeDB.current Dependencies incls/ad_$(Platform_arch_model).cpp incls/dfa_$(Platform_arch_model).cpp $(JvmtiGeneratedFiles) +default:: $(AdlcOutDir)/ad_$(Platform_arch_model).cpp $(AdlcOutDir)/dfa_$(Platform_arch_model).cpp $(JvmtiGeneratedFiles) buildobjfiles !else -default:: includeDB.current Dependencies $(JvmtiGeneratedFiles) +default:: $(JvmtiGeneratedFiles) buildobjfiles !endif -# core plus serial gc -IncludeDBs_base=$(WorkSpace)/src/share/vm/includeDB_core \ - $(WorkSpace)/src/share/vm/includeDB_jvmti \ - $(WorkSpace)/src/share/vm/includeDB_gc \ - $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_serial +buildobjfiles: + @ sh $(WorkSpace)/make/windows/create_obj_files.sh $(Variant) $(Platform_arch) $(Platform_arch_model) $(WorkSpace) . > objfiles.make -# parallel gc -IncludeDBs_gc= $(WorkSpace)/src/share/vm/includeDB_gc_parallel \ - $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge \ - $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_shared \ - $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_parNew \ - $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep \ - $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_g1 - -IncludeDBs_core=$(IncludeDBs_base) $(IncludeDBs_gc) \ - $(WorkSpace)/src/share/vm/includeDB_features - -!if "$(Variant)" == "core" -IncludeDBs=$(IncludeDBs_core) -!endif - -!if "$(Variant)" == "kernel" -IncludeDBs=$(IncludeDBs_base) $(WorkSpace)/src/share/vm/includeDB_compiler1 -!endif - -!if "$(Variant)" == "compiler1" -IncludeDBs=$(IncludeDBs_core) $(WorkSpace)/src/share/vm/includeDB_compiler1 -!endif - - -!if "$(Variant)" == "compiler2" -IncludeDBs=$(IncludeDBs_core) $(WorkSpace)/src/share/vm/includeDB_compiler2 -!endif - -!if "$(Variant)" == "tiered" -IncludeDBs=$(IncludeDBs_core) $(WorkSpace)/src/share/vm/includeDB_compiler1 \ - $(WorkSpace)/src/share/vm/includeDB_compiler2 -!endif - -# Note we don't generate a Visual C++ project file using MakeDeps for -# the batch build. -includeDB.current Dependencies: classes/MakeDeps.class $(IncludeDBs) - cat $(IncludeDBs) > includeDB - if exist incls rmdir /s /q incls - mkdir incls - $(RUN_JAVA) -Djava.class.path=classes MakeDeps WinGammaPlatform$(VcVersion) $(WorkSpace)/make/windows/platform_$(BUILDARCH) includeDB $(MakeDepsOptions) - rm -f includeDB.current - cp includeDB includeDB.current - -classes/MakeDeps.class: $(MakeDepsSources) +classes/ProjectCreator.class: $(ProjectCreatorSources) if exist classes rmdir /s /q classes mkdir classes - $(COMPILE_JAVAC) -classpath $(WorkSpace)\src\share\tools\MakeDeps -d classes $(MakeDepsSources) + $(COMPILE_JAVAC) -classpath $(WorkSpace)\src\share\tools\ProjectCreator -d classes $(ProjectCreatorSources) !if ("$(Variant)" == "compiler2") || ("$(Variant)" == "tiered") +!include $(WorkSpace)/make/windows/makefiles/compile.make !include $(WorkSpace)/make/windows/makefiles/adlc.make !endif diff --git a/hotspot/make/windows/makefiles/launcher.make b/hotspot/make/windows/makefiles/launcher.make new file mode 100644 index 00000000000..ddee8e2139b --- /dev/null +++ b/hotspot/make/windows/makefiles/launcher.make @@ -0,0 +1,71 @@ +# +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# + + +LAUNCHER_FLAGS=$(CPP_FLAGS) $(ARCHFLAG) \ + /D FULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ + /D JDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \ + /D JDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \ + /D GAMMA \ + /D LAUNCHER_TYPE=\"gamma\" \ + /D _CRT_SECURE_NO_WARNINGS \ + /D _CRT_SECURE_NO_DEPRECATE \ + /D LINK_INTO_LIBJVM \ + /I $(WorkSpace)\src\os\windows\launcher \ + /I $(WorkSpace)\src\share\tools\launcher \ + /I $(WorkSpace)\src\share\vm\prims \ + /I $(WorkSpace)\src\share\vm \ + /I $(WorkSpace)\src\cpu\$(Platform_arch)\vm \ + /I $(WorkSpace)\src\os\windows\vm + +LINK_FLAGS=/manifest $(HS_INTERNAL_NAME).lib kernel32.lib user32.lib /nologo /machine:$(MACHINE) /map /debug /subsystem:console + +!if "$(COMPILER_NAME)" == "VS2005" +# This VS2005 compiler has /GS as a default and requires bufferoverflowU.lib +# on the link command line, otherwise we get missing __security_check_cookie +# externals at link time. Even with /GS-, you need bufferoverflowU.lib. +BUFFEROVERFLOWLIB = bufferoverflowU.lib +LINK_FLAGS = $(LINK_FLAGS) $(BUFFEROVERFLOWLIB) +!endif + +LAUNCHERDIR = $(WorkSpace)/src/os/windows/launcher +LAUNCHERDIR_SHARE = $(WorkSpace)/src/share/tools/launcher + +OUTDIR = launcher + +{$(LAUNCHERDIR)}.c{$(OUTDIR)}.obj: + -mkdir $(OUTDIR) 2>NUL >NUL + $(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $< + +{$(LAUNCHERDIR_SHARE)}.c{$(OUTDIR)}.obj: + -mkdir $(OUTDIR) 2>NUL >NUL + $(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $< + +$(OUTDIR)\*.obj: $(LAUNCHERDIR)\*.c $(LAUNCHERDIR)\*.h $(LAUNCHERDIR_SHARE)\*.c $(LAUNCHERDIR_SHARE)\*.h + +launcher: $(OUTDIR)\java.obj $(OUTDIR)\java_md.obj $(OUTDIR)\jli_util.obj + echo $(JAVA_HOME) > jdkpath.txt + $(LINK) $(LINK_FLAGS) /out:hotspot.exe $** + + diff --git a/hotspot/make/windows/makefiles/makedeps.make b/hotspot/make/windows/makefiles/makedeps.make deleted file mode 100644 index a25d3a18708..00000000000 --- a/hotspot/make/windows/makefiles/makedeps.make +++ /dev/null @@ -1,177 +0,0 @@ -# -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -!include $(WorkSpace)/make/windows/makefiles/rules.make - -# This is used externally by both batch and IDE builds, so can't -# reference any of the HOTSPOTWORKSPACE, HOTSPOTBUILDSPACE, -# HOTSPOTRELEASEBINDEST, or HOTSPOTDEBUGBINDEST environment variables. -# -# NOTE: unfortunately the MakeDepsSources list must be kept -# synchronized between this and the Solaris version -# (make/solaris/makefiles/makedeps.make). - -MakeDepsSources=\ - $(WorkSpace)\src\share\tools\MakeDeps\Database.java \ - $(WorkSpace)\src\share\tools\MakeDeps\DirectoryTree.java \ - $(WorkSpace)\src\share\tools\MakeDeps\DirectoryTreeNode.java \ - $(WorkSpace)\src\share\tools\MakeDeps\FileFormatException.java \ - $(WorkSpace)\src\share\tools\MakeDeps\FileList.java \ - $(WorkSpace)\src\share\tools\MakeDeps\FileName.java \ - $(WorkSpace)\src\share\tools\MakeDeps\Macro.java \ - $(WorkSpace)\src\share\tools\MakeDeps\MacroDefinitions.java \ - $(WorkSpace)\src\share\tools\MakeDeps\MakeDeps.java \ - $(WorkSpace)\src\share\tools\MakeDeps\MetroWerksMacPlatform.java \ - $(WorkSpace)\src\share\tools\MakeDeps\Platform.java \ - $(WorkSpace)\src\share\tools\MakeDeps\UnixPlatform.java \ - $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatform.java \ - $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatformVC6.java \ - $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatformVC7.java \ - $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatformVC8.java \ - $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatformVC9.java \ - $(WorkSpace)\src\share\tools\MakeDeps\Util.java \ - $(WorkSpace)\src\share\tools\MakeDeps\BuildConfig.java \ - $(WorkSpace)\src\share\tools\MakeDeps\ArgsParser.java - -# This is only used internally -MakeDepsIncludesPRIVATE=\ - -relativeInclude src\share\vm\c1 \ - -relativeInclude src\share\vm\compiler \ - -relativeInclude src\share\vm\code \ - -relativeInclude src\share\vm\interpreter \ - -relativeInclude src\share\vm\ci \ - -relativeInclude src\share\vm\classfile \ - -relativeInclude src\share\vm\gc_implementation\parallelScavenge \ - -relativeInclude src\share\vm\gc_implementation\shared \ - -relativeInclude src\share\vm\gc_implementation\parNew \ - -relativeInclude src\share\vm\gc_implementation\concurrentMarkSweep \ - -relativeInclude src\share\vm\gc_implementation\g1 \ - -relativeInclude src\share\vm\gc_interface \ - -relativeInclude src\share\vm\asm \ - -relativeInclude src\share\vm\memory \ - -relativeInclude src\share\vm\oops \ - -relativeInclude src\share\vm\prims \ - -relativeInclude src\share\vm\runtime \ - -relativeInclude src\share\vm\services \ - -relativeInclude src\share\vm\utilities \ - -relativeInclude src\share\vm\libadt \ - -relativeInclude src\share\vm\opto \ - -relativeInclude src\os\windows\vm \ - -relativeInclude src\os_cpu\windows_$(Platform_arch)\vm \ - -relativeInclude src\cpu\$(Platform_arch)\vm - -# This is referenced externally by both the IDE and batch builds -MakeDepsOptions= - -# This is used externally, but only by the IDE builds, so we can -# reference environment variables which aren't defined in the batch -# build process. - -MakeDepsIDEOptions = \ - -useToGeneratePch java.cpp \ - -disablePch os_windows.cpp \ - -disablePch os_windows_$(Platform_arch).cpp \ - -disablePch osThread_windows.cpp \ - -disablePch bytecodeInterpreter.cpp \ - -disablePch bytecodeInterpreterWithChecks.cpp \ - -disablePch getThread_windows_$(Platform_arch).cpp \ - -disablePch_compiler2 opcodes.cpp - -# Common options for the IDE builds for core, c1, and c2 -MakeDepsIDEOptions=\ - $(MakeDepsIDEOptions) \ - -sourceBase $(HOTSPOTWORKSPACE) \ - -buildBase $(HOTSPOTBUILDSPACE)\%f\%b \ - -startAt src \ - -compiler $(VcVersion) \ - -projectFileName $(HOTSPOTBUILDSPACE)\$(ProjectFile) \ - -jdkTargetRoot $(HOTSPOTJDKDIST) \ - -define ALIGN_STACK_FRAMES \ - -define VM_LITTLE_ENDIAN \ - -additionalFile includeDB_compiler1 \ - -additionalFile includeDB_compiler2 \ - -additionalFile includeDB_core \ - -additionalFile includeDB_features \ - -additionalFile includeDB_jvmti \ - -additionalFile includeDB_gc \ - -additionalFile includeDB_gc_parallel \ - -additionalFile includeDB_gc_parallelScavenge \ - -additionalFile includeDB_gc_concurrentMarkSweep \ - -additionalFile includeDB_gc_g1 \ - -additionalFile includeDB_gc_parNew \ - -additionalFile includeDB_gc_shared \ - -additionalFile includeDB_gc_serial \ - -additionalGeneratedFile $(HOTSPOTBUILDSPACE)\%f\%b vm.def \ - -prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LINK_VER)" \ - $(MakeDepsIncludesPRIVATE) - -# Add in build-specific options -!if "$(BUILDARCH)" == "i486" -MakeDepsIDEOptions=$(MakeDepsIDEOptions) -define IA32 -!endif - -################################################## -# JKERNEL specific options -################################################## -MakeDepsIDEOptions=$(MakeDepsIDEOptions) \ - -define_kernel KERNEL \ - -################################################## -# Client(C1) compiler specific options -################################################## -MakeDepsIDEOptions=$(MakeDepsIDEOptions) \ - -define_compiler1 COMPILER1 \ - -################################################## -# Server(C2) compiler specific options -################################################## -#NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make. -MakeDepsIDEOptions=$(MakeDepsIDEOptions) \ - -define_compiler2 COMPILER2 \ - -absoluteInclude_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls \ - -additionalFile_compiler2 $(Platform_arch_model).ad \ - -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model).cpp \ - -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model).hpp \ - -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_clone.cpp \ - -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_expand.cpp \ - -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_format.cpp \ - -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_gen.cpp \ - -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_misc.cpp \ - -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_peephole.cpp \ - -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_pipeline.cpp \ - -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls adGlobals_$(Platform_arch_model).hpp \ - -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls dfa_$(Platform_arch_model).cpp - -# Add in the jvmti (JSR-163) options -# NOTE: do not pull in jvmtiEnvRecommended.cpp. This file is generated -# so the programmer can diff it with jvmtiEnv.cpp to be sure the -# code merge was done correctly (@see jvmti.make and jvmtiEnvFill.java). -# If so, they would then check it in as a new version of jvmtiEnv.cpp. -MakeDepsIDEOptions=$(MakeDepsIDEOptions) \ - -absoluteInclude $(HOTSPOTBUILDSPACE)/jvmtifiles \ - -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles jvmtiEnv.hpp \ - -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles jvmtiEnter.cpp \ - -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles jvmtiEnterTrace.cpp \ - -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles jvmti.h \ - -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles bytecodeInterpreterWithChecks.cpp diff --git a/hotspot/make/windows/makefiles/product.make b/hotspot/make/windows/makefiles/product.make index 537791e6338..182f1f2518c 100644 --- a/hotspot/make/windows/makefiles/product.make +++ b/hotspot/make/windows/makefiles/product.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # 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,12 @@ HS_FNAME=$(HS_INTERNAL_NAME).dll AOUT=$(HS_FNAME) GENERATED=../generated -default:: _build_pch_file.obj $(AOUT) checkAndBuildSA +# Allow the user to turn off precompiled headers from the command line. +!if "$(USE_PRECOMPILED_HEADER)" != "0" +BUILD_PCH_FILE=_build_pch_file.obj +!endif + +default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA !include ../local.make !include compile.make @@ -41,8 +46,6 @@ RC_FLAGS=$(RC_FLAGS) /D "NDEBUG" !include $(WorkSpace)/make/windows/makefiles/vm.make !include local.make -!include $(GENERATED)/Dependencies - HS_BUILD_ID=$(HS_BUILD_VER) # Force resources to be rebuilt every time @@ -55,8 +58,10 @@ $(AOUT): $(Res_Files) $(Obj_Files) $(LINK_FLAGS) /out:$@ /implib:$*.lib $(Obj_Files) $(Res_Files) << !else -$(AOUT): $(Res_Files) $(Obj_Files) +vm.def: $(Obj_Files) sh $(WorkSpace)/make/windows/build_vm_def.sh + +$(AOUT): $(Res_Files) $(Obj_Files) vm.def $(LINK) @<< $(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files) << @@ -70,3 +75,4 @@ $(AOUT): $(Res_Files) $(Obj_Files) !include $(WorkSpace)/make/windows/makefiles/shared.make !include $(WorkSpace)/make/windows/makefiles/sa.make +!include $(WorkSpace)/make/windows/makefiles/launcher.make diff --git a/hotspot/make/windows/makefiles/projectcreator.make b/hotspot/make/windows/makefiles/projectcreator.make new file mode 100644 index 00000000000..1dc307f9545 --- /dev/null +++ b/hotspot/make/windows/makefiles/projectcreator.make @@ -0,0 +1,235 @@ +# +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# + +!include $(WorkSpace)/make/windows/makefiles/rules.make + +# This is used externally by both batch and IDE builds, so can't +# reference any of the HOTSPOTWORKSPACE, HOTSPOTBUILDSPACE, +# HOTSPOTRELEASEBINDEST, or HOTSPOTDEBUGBINDEST environment variables. +# +# NOTE: unfortunately the ProjectCreatorSources list must be kept +# synchronized between this and the Solaris version +# (make/solaris/makefiles/projectcreator.make). + +ProjectCreatorSources=\ + $(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTree.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTreeNode.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\FileFormatException.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\Macro.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\MacroDefinitions.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\ProjectCreator.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatform.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC6.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC7.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC8.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC9.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\Util.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\BuildConfig.java \ + $(WorkSpace)\src\share\tools\ProjectCreator\ArgsParser.java + +# This is only used internally +ProjectCreatorIncludesPRIVATE=\ + -relativeInclude src\share\vm \ + -relativeInclude src\share\vm\prims \ + -relativeInclude src\os\windows\vm \ + -relativeInclude src\os_cpu\windows_$(Platform_arch)\vm \ + -relativeInclude src\cpu\$(Platform_arch)\vm \ + -absoluteInclude $(HOTSPOTBUILDSPACE)/%f/generated \ + -ignorePath $(HOTSPOTBUILDSPACE)/%f/generated \ + -ignorePath src\share\vm\adlc \ + -ignorePath src\share\vm\shark + +# This is referenced externally by both the IDE and batch builds +ProjectCreatorOptions= + +# This is used externally, but only by the IDE builds, so we can +# reference environment variables which aren't defined in the batch +# build process. + +ProjectCreatorIDEOptions = \ + -useToGeneratePch java.cpp \ + -disablePch os_windows.cpp \ + -disablePch os_windows_$(Platform_arch).cpp \ + -disablePch osThread_windows.cpp \ + -disablePch bytecodeInterpreter.cpp \ + -disablePch bytecodeInterpreterWithChecks.cpp \ + -disablePch getThread_windows_$(Platform_arch).cpp \ + -disablePch_compiler2 opcodes.cpp + +# Common options for the IDE builds for core, c1, and c2 +ProjectCreatorIDEOptions=\ + $(ProjectCreatorIDEOptions) \ + -sourceBase $(HOTSPOTWORKSPACE) \ + -buildBase $(HOTSPOTBUILDSPACE)\%f\%b \ + -startAt src \ + -compiler $(VcVersion) \ + -projectFileName $(HOTSPOTBUILDROOT)\$(ProjectFile) \ + -jdkTargetRoot $(HOTSPOTJDKDIST) \ + -define ALIGN_STACK_FRAMES \ + -define VM_LITTLE_ENDIAN \ + -prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LINK_VER)" \ + -postbuild "" "Building hotspot.exe..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) nmake -f $(HOTSPOTWORKSPACE)\make\windows\projectfiles\common\Makefile LOCAL_MAKE=$(HOTSPOTBUILDSPACE)\%f\local.make JAVA_HOME=$(HOTSPOTJDKDIST) launcher" \ + -ignoreFile jsig.c \ + -ignoreFile jvmtiEnvRecommended.cpp \ + -ignoreFile jvmtiEnvStub.cpp \ + -ignoreFile globalDefinitions_gcc.hpp \ + -ignoreFile globalDefinitions_sparcWorks.hpp \ + -ignoreFile version.rc \ + -ignoreFile Xusage.txt \ + -define TARGET_ARCH_x86 \ + -define TARGET_OS_ARCH_windows_x86 \ + -define TARGET_OS_FAMILY_windows \ + -define TARGET_COMPILER_visCPP \ + $(ProjectCreatorIncludesPRIVATE) + +# Add in build-specific options +!if "$(BUILDARCH)" == "i486" +ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ + -define IA32 \ + -ignorePath x86_64 \ + -define TARGET_ARCH_MODEL_x86_32 +!else +ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ + -ignorePath x86_32 \ + -define TARGET_ARCH_MODEL_x86_64 +!endif + +ProjectCreatorIDEOptionsIgnoreCompiler1=\ + -ignorePath_TARGET c1_ + +ProjectCreatorIDEOptionsIgnoreCompiler2=\ + -ignorePath_TARGET src/share/vm/opto \ + -ignorePath_TARGET src/share/vm/libadt \ + -ignorePath_TARGET adfiles \ + -ignoreFile_TARGET bcEscapeAnalyzer.cpp \ + -ignoreFile_TARGET bcEscapeAnalyzer.hpp \ + -ignorePath_TARGET chaitin \ + -ignorePath_TARGET c2_ \ + -ignorePath_TARGET runtime_ \ + -ignoreFile_TARGET ciTypeFlow.cpp \ + -ignoreFile_TARGET ciTypeFlow.hpp \ + -ignoreFile_TARGET $(Platform_arch_model).ad + +################################################## +# Without compiler(core) specific options +################################################## +ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ +$(ProjectCreatorIDEOptionsIgnoreCompiler1:TARGET=core) \ +$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=core) + +################################################## +# JKERNEL specific options +################################################## +ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ + -define_kernel KERNEL \ +$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=kernel) \ + -ignorePath_kernel src/share/vm/gc_implementation/parallelScavenge \ + -ignorePath_kernel src/share/vm/gc_implementation/parNew \ + -ignorePath_kernel src/share/vm/gc_implementation/concurrentMarkSweep \ + -ignorePath_kernel src/share/vm/gc_implementation/g1 \ + -ignoreFile_kernel attachListener.cpp \ + -ignoreFile_kernel attachListener_windows.cpp \ + -ignoreFile_kernel dump.cpp \ + -ignoreFile_kernel dump_$(Platform_arch_model).cpp \ + -ignoreFile_kernel forte.cpp \ + -ignoreFile_kernel fprofiler.cpp \ + -ignoreFile_kernel heapDumper.cpp \ + -ignoreFile_kernel heapInspection.cpp \ + -ignoreFile_kernel jniCheck.cpp \ + -ignoreFile_kernel jvmtiCodeBlobEvents.cpp \ + -ignoreFile_kernel jvmtiExtensions.cpp \ + -ignoreFile_kernel jvmtiImpl.cpp \ + -ignoreFile_kernel jvmtiRawMonitor.cpp \ + -ignoreFile_kernel jvmtiTagMap.cpp \ + -ignoreFile_kernel jvmtiTrace.cpp \ + -ignoreFile_kernel jvmtiTrace.hpp \ + -ignoreFile_kernel restore.cpp \ + -ignoreFile_kernel serialize.cpp \ + -ignoreFile_kernel vmStructs.cpp \ + -ignoreFile_kernel g1MemoryPool.cpp \ + -ignoreFile_kernel g1MemoryPool.hpp \ + -ignoreFile_kernel psMemoryPool.cpp \ + -ignoreFile_kernel psMemoryPool.hpp \ + -ignoreFile_kernel gcAdaptivePolicyCounters.cpp \ + -ignoreFile_kernel concurrentGCThread.cpp \ + -ignoreFile_kernel mutableNUMASpace.cpp \ + -ignoreFile_kernel ciTypeFlow.cpp \ + -ignoreFile_kernel ciTypeFlow.hpp \ + -ignoreFile_kernel oop.pcgc.inline.hpp \ + -ignoreFile_kernel oop.psgc.inline.hpp \ + -ignoreFile_kernel allocationStats.cpp \ + -ignoreFile_kernel allocationStats.hpp \ + -ignoreFile_kernel concurrentGCThread.hpp \ + -ignoreFile_kernel gSpaceCounters.cpp \ + -ignoreFile_kernel gSpaceCounters.hpp \ + -ignoreFile_kernel gcAdaptivePolicyCounters.hpp \ + -ignoreFile_kernel immutableSpace.cpp \ + -ignoreFile_kernel mutableNUMASpace.hpp \ + -ignoreFile_kernel mutableSpace.cpp \ + -ignoreFile_kernel spaceCounters.cpp \ + -ignoreFile_kernel spaceCounters.hpp \ + -ignoreFile_kernel yieldingWorkgroup.cpp \ + -ignoreFile_kernel yieldingWorkgroup.hpp \ + -ignorePath_kernel vmStructs_ \ + -ignoreFile_kernel $(Platform_arch_model).ad \ + -additionalFile_kernel gcTaskManager.hpp + +################################################## +# Client(C1) compiler specific options +################################################## +ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ + -define_compiler1 COMPILER1 \ +$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1) + +################################################## +# Server(C2) compiler specific options +################################################## +#NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make. +ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ + -define_compiler2 COMPILER2 \ + -additionalFile_compiler2 $(Platform_arch_model).ad \ + -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model).cpp \ + -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model).hpp \ + -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_clone.cpp \ + -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_expand.cpp \ + -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_format.cpp \ + -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_gen.cpp \ + -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_misc.cpp \ + -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_peephole.cpp \ + -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_pipeline.cpp \ + -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles adGlobals_$(Platform_arch_model).hpp \ + -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles dfa_$(Platform_arch_model).cpp \ + $(ProjectCreatorIDEOptionsIgnoreCompiler1:TARGET=compiler2) + +# Add in the jvmti (JSR-163) options +# NOTE: do not pull in jvmtiEnvRecommended.cpp. This file is generated +# so the programmer can diff it with jvmtiEnv.cpp to be sure the +# code merge was done correctly (@see jvmti.make and jvmtiEnvFill.java). +# If so, they would then check it in as a new version of jvmtiEnv.cpp. +ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ + -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmtiEnv.hpp \ + -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmtiEnter.cpp \ + -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmtiEnterTrace.cpp \ + -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmti.h \ + -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles bytecodeInterpreterWithChecks.cpp diff --git a/hotspot/make/windows/makefiles/rules.make b/hotspot/make/windows/makefiles/rules.make index 6a6b379d95d..431ff3ecb85 100644 --- a/hotspot/make/windows/makefiles/rules.make +++ b/hotspot/make/windows/makefiles/rules.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. # 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 @@ BOOT_TARGET_CLASS_VERSION=6 JAVAC_FLAGS=-g -encoding ascii BOOTSTRAP_JAVAC_FLAGS=$(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION) -ProjectFile=vm.vcproj +ProjectFile=jvm.vcproj !if "$(MSC_VER)" == "1200" @@ -63,6 +63,11 @@ VcVersion=VC8 VcVersion=VC9 +!elseif "$(MSC_VER)" == "1600" + +# for compatibility - we don't yet have a ProjectCreator for VC10 +VcVersion=VC9 + !else VcVersion=VC7 diff --git a/hotspot/make/windows/makefiles/sanity.make b/hotspot/make/windows/makefiles/sanity.make index f874416d728..99f98d7e206 100644 --- a/hotspot/make/windows/makefiles/sanity.make +++ b/hotspot/make/windows/makefiles/sanity.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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 0f4cd002ca1..69ff1a7e780 100644 --- a/hotspot/make/windows/makefiles/vm.make +++ b/hotspot/make/windows/makefiles/vm.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. # 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,8 @@ # Resource file containing VERSIONINFO Res_Files=.\version.res +!include ..\generated\objfiles.make + !ifdef RELEASE !ifdef DEVELOP CPP_FLAGS=$(CPP_FLAGS) /D "DEBUG" @@ -69,10 +71,7 @@ CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_BUILD_TARGET=\"$(BUILD_FLAVOR)\"" CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_BUILD_USER=\"$(BuildUser)\"" CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_VM_DISTRO=\"$(HOTSPOT_VM_DISTRO)\"" -CPP_FLAGS=$(CPP_FLAGS) /D "WIN32" /D "_WINDOWS" $(CPP_INCLUDE_DIRS) - -# Must specify this for sharedRuntimeTrig.cpp -CPP_FLAGS=$(CPP_FLAGS) /D "VM_LITTLE_ENDIAN" +CPP_FLAGS=$(CPP_FLAGS) $(CPP_INCLUDE_DIRS) # Define that so jni.h is on correct side CPP_FLAGS=$(CPP_FLAGS) /D "_JNI_IMPLEMENTATION_" @@ -94,6 +93,8 @@ AGCT_EXPORT=/export:AsyncGetCallTrace !endif !endif +# If you modify exports below please do the corresponding changes in +# src/share/tools/ProjectCreator/WinGammaPlatformVC7.java LINK_FLAGS=$(LINK_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 \ /export:JNI_GetDefaultJavaVMInitArgs \ /export:JNI_CreateJavaVM \ @@ -111,37 +112,24 @@ LINK_FLAGS=$(LINK_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 \ /export:JVM_InitAgentProperties CPP_INCLUDE_DIRS=\ - /I "..\generated" \ - /I "..\generated\jvmtifiles" \ - /I "$(WorkSpace)\src\share\vm\c1" \ - /I "$(WorkSpace)\src\share\vm\compiler" \ - /I "$(WorkSpace)\src\share\vm\code" \ - /I "$(WorkSpace)\src\share\vm\interpreter" \ - /I "$(WorkSpace)\src\share\vm\ci" \ - /I "$(WorkSpace)\src\share\vm\classfile" \ - /I "$(WorkSpace)\src\share\vm\gc_implementation\parallelScavenge"\ - /I "$(WorkSpace)\src\share\vm\gc_implementation\shared"\ - /I "$(WorkSpace)\src\share\vm\gc_implementation\parNew"\ - /I "$(WorkSpace)\src\share\vm\gc_implementation\concurrentMarkSweep"\ - /I "$(WorkSpace)\src\share\vm\gc_implementation\g1"\ - /I "$(WorkSpace)\src\share\vm\gc_interface"\ - /I "$(WorkSpace)\src\share\vm\asm" \ - /I "$(WorkSpace)\src\share\vm\memory" \ - /I "$(WorkSpace)\src\share\vm\oops" \ - /I "$(WorkSpace)\src\share\vm\prims" \ - /I "$(WorkSpace)\src\share\vm\runtime" \ - /I "$(WorkSpace)\src\share\vm\services" \ - /I "$(WorkSpace)\src\share\vm\utilities" \ - /I "$(WorkSpace)\src\share\vm\libadt" \ - /I "$(WorkSpace)\src\share\vm\opto" \ - /I "$(WorkSpace)\src\os\windows\vm" \ + /I "..\generated" \ + /I "$(WorkSpace)\src\share\vm" \ + /I "$(WorkSpace)\src\share\vm\prims" \ + /I "$(WorkSpace)\src\os\windows\vm" \ /I "$(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm" \ /I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm" -CPP_USE_PCH=/Fp"vm.pch" /Yu"incls/_precompiled.incl" +CPP_DONT_USE_PCH=/D DONT_USE_PRECOMPILED_HEADER + +!if "$(USE_PRECOMPILED_HEADER)" != "0" +CPP_USE_PCH=/Fp"vm.pch" /Yu"precompiled.hpp" +!else +CPP_USE_PCH=$(CPP_DONT_USE_PCH) +!endif # Where to find the source code for the virtual machine -VM_PATH=../generated/incls +VM_PATH=../generated +VM_PATH=$(VM_PATH);../generated/adfiles VM_PATH=$(VM_PATH);../generated/jvmtifiles VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/c1 VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/compiler @@ -173,31 +161,31 @@ VM_PATH={$(VM_PATH)} # Special case files not using precompiled header files. c1_RInfo_$(Platform_arch).obj: $(WorkSpace)\src\cpu\$(Platform_arch)\vm\c1_RInfo_$(Platform_arch).cpp - $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\cpu\$(Platform_arch)\vm\c1_RInfo_$(Platform_arch).cpp + $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\cpu\$(Platform_arch)\vm\c1_RInfo_$(Platform_arch).cpp os_windows.obj: $(WorkSpace)\src\os\windows\vm\os_windows.cpp - $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os\windows\vm\os_windows.cpp + $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os\windows\vm\os_windows.cpp os_windows_$(Platform_arch).obj: $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\os_windows_$(Platform_arch).cpp - $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\os_windows_$(Platform_arch).cpp + $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\os_windows_$(Platform_arch).cpp osThread_windows.obj: $(WorkSpace)\src\os\windows\vm\osThread_windows.cpp - $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os\windows\vm\osThread_windows.cpp + $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os\windows\vm\osThread_windows.cpp conditionVar_windows.obj: $(WorkSpace)\src\os\windows\vm\conditionVar_windows.cpp - $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os\windows\vm\conditionVar_windows.cpp + $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os\windows\vm\conditionVar_windows.cpp getThread_windows_$(Platform_arch).obj: $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\getThread_windows_$(Platform_arch).cpp - $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\getThread_windows_$(Platform_arch).cpp + $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\getThread_windows_$(Platform_arch).cpp opcodes.obj: $(WorkSpace)\src\share\vm\opto\opcodes.cpp - $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\share\vm\opto\opcodes.cpp + $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\share\vm\opto\opcodes.cpp bytecodeInterpreter.obj: $(WorkSpace)\src\share\vm\interpreter\bytecodeInterpreter.cpp - $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\share\vm\interpreter\bytecodeInterpreter.cpp + $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\share\vm\interpreter\bytecodeInterpreter.cpp bytecodeInterpreterWithChecks.obj: ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp - $(CPP) $(CPP_FLAGS) /c ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp + $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp # Default rules for the Virtual Machine {$(WorkSpace)\src\share\vm\c1}.cpp.obj:: @@ -280,11 +268,14 @@ bytecodeInterpreterWithChecks.obj: ..\generated\jvmtifiles\bytecodeInterpreterWi {..\generated\incls}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< +{..\generated\adfiles}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + {..\generated\jvmtifiles}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< default:: _build_pch_file.obj: - @echo #include "incls/_precompiled.incl" > ../generated/_build_pch_file.cpp - $(CPP) $(CPP_FLAGS) /Fp"vm.pch" /Yc"incls/_precompiled.incl" /c ../generated/_build_pch_file.cpp + @echo #include "precompiled.hpp" > ../generated/_build_pch_file.cpp + $(CPP) $(CPP_FLAGS) /Fp"vm.pch" /Yc"precompiled.hpp" /c ../generated/_build_pch_file.cpp diff --git a/hotspot/make/windows/projectfiles/common/Makefile b/hotspot/make/windows/projectfiles/common/Makefile index 038cb280b2f..8d55b9097f9 100644 --- a/hotspot/make/windows/projectfiles/common/Makefile +++ b/hotspot/make/windows/projectfiles/common/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # 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,6 +22,11 @@ # # +!ifdef LOCAL_MAKE +!include $(LOCAL_MAKE) +!endif + + WorkSpace=$(HOTSPOTWORKSPACE) !ifdef ALT_BOOTDIR @@ -32,74 +37,39 @@ BootStrapDir=$(BOOTDIR) !else !ifdef JAVA_HOME BootStrapDir=$(JAVA_HOME) +!else +!ifdef HOTSPOTJDKDIST +BootStrapDir=$(HOTSPOTJDKDIST) +!endif !endif !endif !endif -!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/makedeps.make + + +!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/projectcreator.make +!include $(WorkSpace)/make/windows/makefiles/compile.make # Pick up rules for building JVMTI (JSR-163) -JvmtiOutDir=$(HOTSPOTBUILDSPACE)\jvmtifiles +JvmtiOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\jvmtifiles !include $(HOTSPOTWORKSPACE)/make/windows/makefiles/jvmti.make Platform=$(HOTSPOTWORKSPACE)/make/windows/platform_$(BUILDARCH) -default:: $(AdditionalTargets) $(JvmtiGeneratedFiles) - -IncludeDBs_base=$(HOTSPOTWORKSPACE)/src/share/vm/includeDB_core \ - $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_jvmti \ - $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_gc \ - $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_serial - -# Parallel gc files -IncludeDBs_gc=$(HOTSPOTWORKSPACE)/src/share/vm/includeDB_gc_parallel \ - $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_shared \ - $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_parNew \ - $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge \ - $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep \ - $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_g1 - - -IncludeDBs_kernel =$(IncludeDBs_base) \ - $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler1 - -IncludeDBs_core =$(IncludeDBs_base) $(IncludeDBs_gc) \ - $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_features - -IncludeDBs_compiler1=$(IncludeDBs_core) \ - $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler1 - -IncludeDBs_compiler2=$(IncludeDBs_core) \ - $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler2 - -IncludeDBs_tiered=$(IncludeDBs_core) \ - $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler1 \ - $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler2 - - -!if "$(Variant)" == "compiler1" -IncludeDBs = $(IncludeDBs_compiler1) -!endif - !if "$(Variant)" == "compiler2" -IncludeDBs = $(IncludeDBs_compiler2) # Pick up rules for building adlc !include $(HOTSPOTWORKSPACE)/make/windows/makefiles/adlc.make !endif !if "$(Variant)" == "tiered" -IncludeDBs = $(IncludeDBs_tiered) # Pick up rules for building adlc !include $(HOTSPOTWORKSPACE)/make/windows/makefiles/adlc.make !endif -!if "$(Variant)" == "core" -IncludeDBs = $(IncludeDBs_core) -!endif +HS_INTERNAL_NAME=jvm +!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/launcher.make -!if "$(Variant)" == "kernel" -IncludeDBs = $(IncludeDBs_kernel) -!endif +default:: $(AdditionalTargets) $(JvmtiGeneratedFiles) !include $(HOTSPOTWORKSPACE)/make/hotspot_version @@ -108,7 +78,11 @@ HOTSPOT_RELEASE_VERSION="$(HOTSPOT_RELEASE_VERSION)" !else HOTSPOT_RELEASE_VERSION="$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER)" !endif +!if "$(USER_RELEASE_SUFFIX)" != "" +HOTSPOT_BUILD_VERSION$(HOTSPOT_BUILD_VERSION) = internal-$(USER_RELEASE_SUFFIX) +!else HOTSPOT_BUILD_VERSION$(HOTSPOT_BUILD_VERSION) = internal +!endif !if "$(HOTSPOT_BUILD_VERSION)" != "" HOTSPOT_RELEASE_VERSION="$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)" !endif @@ -130,55 +104,22 @@ HOTSPOT_VM_DISTRO="OpenJDK" !endif !endif -MakeDepsIDEOptions = $(MakeDepsIDEOptions) \ - -includeDB_kernel $(HOTSPOTBUILDSPACE)\includeDB_kernel \ - -includeDB_core $(HOTSPOTBUILDSPACE)\includeDB_core \ - -includeDB_compiler1 $(HOTSPOTBUILDSPACE)\includeDB_compiler1 \ - -includeDB_compiler2 $(HOTSPOTBUILDSPACE)\includeDB_compiler2 \ - -includeDB_tiered $(HOTSPOTBUILDSPACE)\includeDB_tiered \ +ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) \ -platform $(Platform) \ -define HOTSPOT_RELEASE_VERSION=\\\"$(HOTSPOT_RELEASE_VERSION)\\\" \ -define JRE_RELEASE_VERSION=\\\"$(JRE_RELEASE_VERSION)\\\" \ -define HOTSPOT_VM_DISTRO=\\\"$(HOTSPOT_VM_DISTRO)\\\" -incls: - @mkdir incls - -includeDB.current $(ProjectFile) Dependencies: local.make $(HOTSPOTBUILDSPACE)/classes/MakeDeps.class \ - $(IncludeDBs) incls - @rm -f includeDB $(HOTSPOTBUILDSPACE)\includeDB_kernel \ - $(HOTSPOTBUILDSPACE)\includeDB_core \ - $(HOTSPOTBUILDSPACE)\includeDB_compiler1 \ - $(HOTSPOTBUILDSPACE)\includeDB_compiler2 \ - $(HOTSPOTBUILDSPACE)\includeDB_tiered - @cat $(IncludeDBs_kernel) > $(HOTSPOTBUILDSPACE)\includeDB_kernel - @cat $(IncludeDBs_core) > $(HOTSPOTBUILDSPACE)\includeDB_core - @cat $(IncludeDBs_compiler1) > $(HOTSPOTBUILDSPACE)\includeDB_compiler1 - @cat $(IncludeDBs_compiler2) > $(HOTSPOTBUILDSPACE)\includeDB_compiler2 - @cat $(IncludeDBs_tiered) > $(HOTSPOTBUILDSPACE)\includeDB_tiered - @echo java.cpp jni.h > includeDB - @$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes MakeDeps diffs WinGammaPlatform$(VcVersion) \ - $(Platform) includeDB.current $(Platform) includeDB $(MakeDepsOptions) $(MakeDepsIDEOptions) - @rm -f includeDB.current - @cp includeDB includeDB.current - -lists: $(HOTSPOTBUILDSPACE)/classes/MakeDeps.class FORCE - @if exist incls rmdir /s /q incls - @rm -f includeDB - @cat $(IncludeDBs) > includeDB - @mkdir incls - @$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes MakeDeps WinGammaPlatform$(VcVersion) \ - $(Platform) includeDB $(MakeDepsOptions) $(MakeDepsIDEOptions) - @rm -f includeDB.current - @cp includeDB includeDB.current +$(HOTSPOTBUILDROOT)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class + @$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes ProjectCreator WinGammaPlatform$(VcVersion) $(ProjectCreatorIDEOptions) clean: - @rm -rf incls $(HOTSPOTBUILDSPACE)/classes - @rm -f includeDB includeDB.current $(ProjectFile) Dependencies + @rm -rf $(HOTSPOTBUILDSPACE)/classes + @rm -r ../$(ProjectFile) -$(HOTSPOTBUILDSPACE)/classes/MakeDeps.class: $(MakeDepsSources) +$(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class: $(ProjectCreatorSources) @if exist $(HOTSPOTBUILDSPACE)\classes rmdir /s /q $(HOTSPOTBUILDSPACE)\classes @mkdir $(HOTSPOTBUILDSPACE)\classes - @$(COMPILE_JAVAC) -classpath $(HOTSPOTWORKSPACE)\src\share\tools\MakeDeps -d $(HOTSPOTBUILDSPACE)/classes $(MakeDepsSources) + @$(COMPILE_JAVAC) -classpath $(HOTSPOTWORKSPACE)\src\share\tools\ProjectCreator -d $(HOTSPOTBUILDSPACE)/classes $(ProjectCreatorSources) FORCE: diff --git a/hotspot/make/windows/projectfiles/compiler1/Makefile b/hotspot/make/windows/projectfiles/compiler1/Makefile index 83c3897f735..183a27647dd 100644 --- a/hotspot/make/windows/projectfiles/compiler1/Makefile +++ b/hotspot/make/windows/projectfiles/compiler1/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # 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,6 @@ # # -Variant=compiler1 -!include local.make +!include ../local.make !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile diff --git a/hotspot/make/windows/projectfiles/compiler1/vm.def b/hotspot/make/windows/projectfiles/compiler1/vm.def index 7811a1fc9bb..b450e81fd01 100644 --- a/hotspot/make/windows/projectfiles/compiler1/vm.def +++ b/hotspot/make/windows/projectfiles/compiler1/vm.def @@ -2,6 +2,6 @@ ; This .DEF file is a placeholder for one which is automatically ; generated during the build process. See ; make\windows\build_vm_def.sh and -; make\windows\makefiles\makedeps.make (esp. the "-prelink" +; make\windows\makefiles\projectcreator.make (esp. the "-prelink" ; options). ; diff --git a/hotspot/make/windows/projectfiles/compiler2/Makefile b/hotspot/make/windows/projectfiles/compiler2/Makefile index 49f96eb7f11..1df97d232a8 100644 --- a/hotspot/make/windows/projectfiles/compiler2/Makefile +++ b/hotspot/make/windows/projectfiles/compiler2/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. # 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,8 +22,8 @@ # # -Variant=compiler2 -!include local.make -AdditionalTargets=incls/ad_$(Platform_arch_model).cpp incls/dfa_$(Platform_arch_model).cpp +!include ../local.make +AdlcOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\adfiles +AdditionalTargets=$(AdlcOutDir)\ad_$(Platform_arch_model).cpp $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile diff --git a/hotspot/make/windows/projectfiles/compiler2/vm.def b/hotspot/make/windows/projectfiles/compiler2/vm.def index 7811a1fc9bb..b450e81fd01 100644 --- a/hotspot/make/windows/projectfiles/compiler2/vm.def +++ b/hotspot/make/windows/projectfiles/compiler2/vm.def @@ -2,6 +2,6 @@ ; This .DEF file is a placeholder for one which is automatically ; generated during the build process. See ; make\windows\build_vm_def.sh and -; make\windows\makefiles\makedeps.make (esp. the "-prelink" +; make\windows\makefiles\projectcreator.make (esp. the "-prelink" ; options). ; diff --git a/hotspot/make/windows/projectfiles/core/Makefile b/hotspot/make/windows/projectfiles/core/Makefile index 27ea55ff1a2..5b23a8467cb 100644 --- a/hotspot/make/windows/projectfiles/core/Makefile +++ b/hotspot/make/windows/projectfiles/core/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. # 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,6 @@ # # -Variant=core -!include local.make +!include ../local.make !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile diff --git a/hotspot/make/windows/projectfiles/core/vm.def b/hotspot/make/windows/projectfiles/core/vm.def index 7811a1fc9bb..b450e81fd01 100644 --- a/hotspot/make/windows/projectfiles/core/vm.def +++ b/hotspot/make/windows/projectfiles/core/vm.def @@ -2,6 +2,6 @@ ; This .DEF file is a placeholder for one which is automatically ; generated during the build process. See ; make\windows\build_vm_def.sh and -; make\windows\makefiles\makedeps.make (esp. the "-prelink" +; make\windows\makefiles\projectcreator.make (esp. the "-prelink" ; options). ; diff --git a/hotspot/make/windows/projectfiles/kernel/Makefile b/hotspot/make/windows/projectfiles/kernel/Makefile index e18305a67b3..bb231fca6c8 100644 --- a/hotspot/make/windows/projectfiles/kernel/Makefile +++ b/hotspot/make/windows/projectfiles/kernel/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010 Oracle and/or its affiliates. All rights reserved. # 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,6 @@ # # -Variant=compiler1 -!include local.make +!include ../local.make !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile diff --git a/hotspot/make/windows/projectfiles/kernel/vm.def b/hotspot/make/windows/projectfiles/kernel/vm.def index 7811a1fc9bb..b450e81fd01 100644 --- a/hotspot/make/windows/projectfiles/kernel/vm.def +++ b/hotspot/make/windows/projectfiles/kernel/vm.def @@ -2,6 +2,6 @@ ; This .DEF file is a placeholder for one which is automatically ; generated during the build process. See ; make\windows\build_vm_def.sh and -; make\windows\makefiles\makedeps.make (esp. the "-prelink" +; make\windows\makefiles\projectcreator.make (esp. the "-prelink" ; options). ; diff --git a/hotspot/make/windows/projectfiles/tiered/Makefile b/hotspot/make/windows/projectfiles/tiered/Makefile index b513759ad7b..5398cb99d46 100644 --- a/hotspot/make/windows/projectfiles/tiered/Makefile +++ b/hotspot/make/windows/projectfiles/tiered/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # 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,8 +22,8 @@ # # -Variant=tiered -!include local.make -AdditionalTargets=incls/ad_$(Platform_arch_model).cpp incls/dfa_$(Platform_arch_model).cpp +!include ../local.make +AdlcOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\adfiles +AdditionalTargets=$(AdlcOutDir)\ad_$(Platform_arch_model).cpp $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile diff --git a/hotspot/make/windows/projectfiles/tiered/vm.def b/hotspot/make/windows/projectfiles/tiered/vm.def index 7811a1fc9bb..b450e81fd01 100644 --- a/hotspot/make/windows/projectfiles/tiered/vm.def +++ b/hotspot/make/windows/projectfiles/tiered/vm.def @@ -2,6 +2,6 @@ ; This .DEF file is a placeholder for one which is automatically ; generated during the build process. See ; make\windows\build_vm_def.sh and -; make\windows\makefiles\makedeps.make (esp. the "-prelink" +; make\windows\makefiles\projectcreator.make (esp. the "-prelink" ; options). ; diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp index e84e92a41c7..f1c39036251 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,25 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_assembler_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_sparc.inline.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "interpreter/interpreter.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "memory/resourceArea.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/objectMonitor.hpp" +#include "runtime/os.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#ifndef SERIALGC +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" +#include "gc_implementation/g1/heapRegion.hpp" +#endif // Convert the raw encoding form into the form expected by the // constructor for Address. @@ -893,10 +910,10 @@ void MacroAssembler::verify_thread() { #if defined(COMPILER2) && !defined(_LP64) // Save & restore possible 64-bit Long arguments in G-regs sllx(L0,32,G2); // Move old high G1 bits high in G2 - sllx(G1, 0,G1); // Clear current high G1 bits + srl(G1, 0,G1); // Clear current high G1 bits or3 (G1,G2,G1); // Recover 64-bit G1 sllx(L6,32,G2); // Move old high G4 bits high in G2 - sllx(G4, 0,G4); // Clear current high G4 bits + srl(G4, 0,G4); // Clear current high G4 bits or3 (G4,G2,G4); // Recover 64-bit G4 #endif restore(O0, 0, G2_thread); @@ -1311,37 +1328,38 @@ void MacroAssembler::patchable_sethi(const AddressLiteral& addrlit, Register d) } -int MacroAssembler::size_of_sethi(address a, bool worst_case) { +int MacroAssembler::insts_for_sethi(address a, bool worst_case) { #ifdef _LP64 - if (worst_case) return 7; - intptr_t iaddr = (intptr_t)a; - int hi32 = (int)(iaddr >> 32); - int lo32 = (int)(iaddr); - int inst_count; - if (hi32 == 0 && lo32 >= 0) - inst_count = 1; - else if (hi32 == -1) - inst_count = 2; + if (worst_case) return 7; + intptr_t iaddr = (intptr_t) a; + int msb32 = (int) (iaddr >> 32); + int lsb32 = (int) (iaddr); + int count; + if (msb32 == 0 && lsb32 >= 0) + count = 1; + else if (msb32 == -1) + count = 2; else { - inst_count = 2; - if ( hi32 & 0x3ff ) - inst_count++; - if ( lo32 & 0xFFFFFC00 ) { - if( (lo32 >> 20) & 0xfff ) inst_count += 2; - if( (lo32 >> 10) & 0x3ff ) inst_count += 2; + count = 2; + if (msb32 & 0x3ff) + count++; + if (lsb32 & 0xFFFFFC00 ) { + if ((lsb32 >> 20) & 0xfff) count += 2; + if ((lsb32 >> 10) & 0x3ff) count += 2; } } - return BytesPerInstWord * inst_count; + return count; #else - return BytesPerInstWord; + return 1; #endif } -int MacroAssembler::worst_case_size_of_set() { - return size_of_sethi(NULL, true) + 1; +int MacroAssembler::worst_case_insts_for_set() { + return insts_for_sethi(NULL, true) + 1; } +// Keep in sync with MacroAssembler::insts_for_internal_set void MacroAssembler::internal_set(const AddressLiteral& addrlit, Register d, bool ForceRelocatable) { intptr_t value = addrlit.value(); @@ -1363,6 +1381,23 @@ void MacroAssembler::internal_set(const AddressLiteral& addrlit, Register d, boo } } +// Keep in sync with MacroAssembler::internal_set +int MacroAssembler::insts_for_internal_set(intptr_t value) { + // can optimize + if (-4096 <= value && value <= 4095) { + return 1; + } + if (inv_hi22(hi22(value)) == value) { + return insts_for_sethi((address) value); + } + int count = insts_for_sethi((address) value); + AddressLiteral al(value); + if (al.low10() != 0) { + count++; + } + return count; +} + void MacroAssembler::set(const AddressLiteral& al, Register d) { internal_set(al, d, false); } @@ -1427,6 +1462,45 @@ void MacroAssembler::set64(jlong value, Register d, Register tmp) { } } +int MacroAssembler::insts_for_set64(jlong value) { + v9_dep(); + + int hi = (int) (value >> 32); + int lo = (int) (value & ~0); + int count = 0; + + // (Matcher::isSimpleConstant64 knows about the following optimizations.) + if (Assembler::is_simm13(lo) && value == lo) { + count++; + } else if (hi == 0) { + count++; + if (low10(lo) != 0) + count++; + } + else if (hi == -1) { + count += 2; + } + else if (lo == 0) { + if (Assembler::is_simm13(hi)) { + count++; + } else { + count++; + if (low10(hi) != 0) + count++; + } + count++; + } + else { + count += 2; + if (low10(hi) != 0) + count++; + if (low10(lo) != 0) + count++; + count += 2; + } + return count; +} + // compute size in bytes of sparc frame, given // number of extraWords int MacroAssembler::total_frame_size_in_bytes(int extraWords) { @@ -3094,11 +3168,10 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass, void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_reg, Register temp_reg, Label& wrong_method_type) { - if (UseCompressedOops) unimplemented("coop"); // field accesses must decode assert_different_registers(mtype_reg, mh_reg, temp_reg); // compare method type against that of the receiver RegisterOrConstant mhtype_offset = delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg); - ld_ptr(mh_reg, mhtype_offset, temp_reg); + load_heap_oop(mh_reg, mhtype_offset, temp_reg); cmp(temp_reg, mtype_reg); br(Assembler::notEqual, false, Assembler::pn, wrong_method_type); delayed()->nop(); @@ -3112,16 +3185,15 @@ void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_re void MacroAssembler::load_method_handle_vmslots(Register vmslots_reg, Register mh_reg, Register temp_reg) { assert_different_registers(vmslots_reg, mh_reg, temp_reg); - if (UseCompressedOops) unimplemented("coop"); // field accesses must decode // load mh.type.form.vmslots if (java_dyn_MethodHandle::vmslots_offset_in_bytes() != 0) { // hoist vmslots into every mh to avoid dependent load chain - ld( Address(mh_reg, delayed_value(java_dyn_MethodHandle::vmslots_offset_in_bytes, temp_reg)), vmslots_reg); + ld( Address(mh_reg, delayed_value(java_dyn_MethodHandle::vmslots_offset_in_bytes, temp_reg)), vmslots_reg); } else { Register temp2_reg = vmslots_reg; - ld_ptr(Address(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)), temp2_reg); - ld_ptr(Address(temp2_reg, delayed_value(java_dyn_MethodType::form_offset_in_bytes, temp_reg)), temp2_reg); - ld( Address(temp2_reg, delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)), vmslots_reg); + load_heap_oop(Address(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)), temp2_reg); + load_heap_oop(Address(temp2_reg, delayed_value(java_dyn_MethodType::form_offset_in_bytes, temp_reg)), temp2_reg); + ld( Address(temp2_reg, delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)), vmslots_reg); } } @@ -3130,9 +3202,8 @@ void MacroAssembler::jump_to_method_handle_entry(Register mh_reg, Register temp_ assert(mh_reg == G3_method_handle, "caller must put MH object in G3"); assert_different_registers(mh_reg, temp_reg); - if (UseCompressedOops) unimplemented("coop"); // field accesses must decode - // pick out the interpreted side of the handler + // NOTE: vmentry is not an oop! ld_ptr(mh_reg, delayed_value(java_dyn_MethodHandle::vmentry_offset_in_bytes, temp_reg), temp_reg); // off we go... @@ -4031,11 +4102,15 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case store_klass(t2, top); verify_oop(top); + ld_ptr(G2_thread, in_bytes(JavaThread::tlab_start_offset()), t1); + sub(top, t1, t1); // size of tlab's allocated portion + incr_allocated_bytes(t1, 0, t2); + // refill the tlab with an eden allocation bind(do_refill); ld_ptr(G2_thread, in_bytes(JavaThread::tlab_size_offset()), t1); sll_ptr(t1, LogHeapWordSize, t1); - // add object_size ?? + // allocate new tlab, address returned in top eden_allocate(top, t1, 0, t2, t3, slow_case); st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_start_offset())); @@ -4063,6 +4138,22 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case delayed()->nop(); } +void MacroAssembler::incr_allocated_bytes(Register var_size_in_bytes, + int con_size_in_bytes, + Register t1) { + // Bump total bytes allocated by this thread + assert(t1->is_global(), "must be global reg"); // so all 64 bits are saved on a context switch + assert_different_registers(var_size_in_bytes, t1); + // v8 support has gone the way of the dodo + ldx(G2_thread, in_bytes(JavaThread::allocated_bytes_offset()), t1); + if (var_size_in_bytes->is_valid()) { + add(t1, var_size_in_bytes, t1); + } else { + add(t1, con_size_in_bytes, t1); + } + stx(t1, G2_thread, in_bytes(JavaThread::allocated_bytes_offset())); +} + Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) { switch (cond) { // Note some conditions are synonyms for others @@ -4653,6 +4744,11 @@ void MacroAssembler::load_heap_oop(Register s1, int simm13a, Register d) { } } +void MacroAssembler::load_heap_oop(Register s1, RegisterOrConstant s2, Register d) { + if (s2.is_constant()) load_heap_oop(s1, s2.as_constant(), d); + else load_heap_oop(s1, s2.as_register(), d); +} + void MacroAssembler::store_heap_oop(Register d, Register s1, Register s2) { if (UseCompressedOops) { assert(s1 != d && s2 != d, "not enough registers"); diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp index 4592ed81fea..296305664cc 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_ASSEMBLER_SPARC_HPP +#define CPU_SPARC_VM_ASSEMBLER_SPARC_HPP + class BiasedLockingCounters; // promises that the system will not use traps 16-31 @@ -825,6 +828,12 @@ class Assembler : public AbstractAssembler { // test if -4096 <= x <= 4095 static bool is_simm13(int x) { return is_simm(x, 13); } + // test if label is in simm16 range in words (wdisp16). + bool is_in_wdisp16_range(Label& L) { + intptr_t d = intptr_t(pc()) - intptr_t(target(L)); + return is_simm(d, 18); + } + enum ASIs { // page 72, v9 ASI_PRIMARY = 0x80, ASI_PRIMARY_LITTLE = 0x88 @@ -1120,7 +1129,7 @@ public: inline void add(Register s1, int simm13a, Register d, relocInfo::relocType rtype = relocInfo::none); inline void add(Register s1, int simm13a, Register d, RelocationHolder const& rspec); inline void add(Register s1, RegisterOrConstant s2, Register d, int offset = 0); - inline void add(const Address& a, Register d, int offset = 0) { add( a.base(), a.disp() + offset, d, a.rspec(offset)); } + inline void add(const Address& a, Register d, int offset = 0); void addcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } void addcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } @@ -1612,6 +1621,10 @@ public: void sub( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | rs2(s2) ); } void sub( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + + // Note: offset is added to s2. + inline void sub(Register s1, RegisterOrConstant s2, Register d, int offset = 0); + void subcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | rs2(s2) ); } void subcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } void subc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(subc_op3 ) | rs1(s1) | rs2(s2) ); } @@ -1789,6 +1802,7 @@ class MacroAssembler: public Assembler { // branches that use right instruction for v8 vs. v9 inline void br( Condition c, bool a, Predict p, address d, relocInfo::relocType rt = relocInfo::none ); inline void br( Condition c, bool a, Predict p, Label& L ); + inline void fb( Condition c, bool a, Predict p, address d, relocInfo::relocType rt = relocInfo::none ); inline void fb( Condition c, bool a, Predict p, Label& L ); @@ -1870,20 +1884,24 @@ public: void sethi(const AddressLiteral& addrlit, Register d); void patchable_sethi(const AddressLiteral& addrlit, Register d); - // compute the size of a sethi/set - static int size_of_sethi( address a, bool worst_case = false ); - static int worst_case_size_of_set(); + // compute the number of instructions for a sethi/set + static int insts_for_sethi( address a, bool worst_case = false ); + static int worst_case_insts_for_set(); // set may be either setsw or setuw (high 32 bits may be zero or sign) private: void internal_set(const AddressLiteral& al, Register d, bool ForceRelocatable); + static int insts_for_internal_set(intptr_t value); public: void set(const AddressLiteral& addrlit, Register d); void set(intptr_t value, Register d); void set(address addr, Register d, RelocationHolder const& rspec); + static int insts_for_set(intptr_t value) { return insts_for_internal_set(value); } + void patchable_set(const AddressLiteral& addrlit, Register d); void patchable_set(intptr_t value, Register d); void set64(jlong value, Register d, Register tmp); + static int insts_for_set64(jlong value); // sign-extend 32 to 64 inline void signx( Register s, Register d ) { sra( s, G0, d); } @@ -2103,6 +2121,7 @@ public: void load_heap_oop(const Address& s, Register d); void load_heap_oop(Register s1, Register s2, Register d); void load_heap_oop(Register s1, int simm13a, Register d); + void load_heap_oop(Register s1, RegisterOrConstant s2, Register d); void store_heap_oop(Register d, Register s1, Register s2); void store_heap_oop(Register d, Register s1, int simm13a); void store_heap_oop(Register d, const Address& a, int offset = 0); @@ -2225,7 +2244,7 @@ public: void stop(const char* msg); // prints msg, dumps registers and stops execution void warn(const char* msg); // prints msg, but don't stop void untested(const char* what = ""); - void unimplemented(const char* what = "") { char* b = new char[1024]; sprintf(b, "unimplemented: %s", what); stop(b); } + void unimplemented(const char* what = "") { char* b = new char[1024]; jio_snprintf(b, 1024, "unimplemented: %s", what); stop(b); } void should_not_reach_here() { stop("should not reach here"); } void print_CPU_state(); @@ -2370,6 +2389,7 @@ public: Label& slow_case // continuation point if fast allocation fails ); void tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case); + void incr_allocated_bytes(Register var_size_in_bytes, int con_size_in_bytes, Register t1); // interface method calling void lookup_interface_method(Register recv_klass, @@ -2493,3 +2513,5 @@ class SkipIfEqual : public StackObj { // On RISC, there's no benefit to verifying instruction boundaries. inline bool AbstractAssembler::pd_check_instruction_mark() { return false; } #endif + +#endif // CPU_SPARC_VM_ASSEMBLER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp index 88cf8f5eee0..106aa14e5b0 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP +#define CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP + +#include "asm/assembler.inline.hpp" +#include "asm/codeBuffer.hpp" +#include "code/codeCache.hpp" +#include "runtime/handles.inline.hpp" + inline void MacroAssembler::pd_patch_instruction(address branch, address target) { jint& stub_inst = *(jint*) branch; stub_inst = patched_branch(target - branch, stub_inst, 0); @@ -206,6 +214,11 @@ inline void Assembler::ld( Register s1, RegisterOrConstant s2, Register d) { ld inline void Assembler::ldd( Register s1, RegisterOrConstant s2, Register d) { ldd( Address(s1, s2), d); } // form effective addresses this way: +inline void Assembler::add(const Address& a, Register d, int offset) { + if (a.has_index()) add(a.base(), a.index(), d); + else { add(a.base(), a.disp() + offset, d, a.rspec(offset)); offset = 0; } + if (offset != 0) add(d, offset, d); +} inline void Assembler::add(Register s1, RegisterOrConstant s2, Register d, int offset) { if (s2.is_register()) add(s1, s2.as_register(), d); else { add(s1, s2.as_constant() + offset, d); offset = 0; } @@ -315,6 +328,11 @@ inline void Assembler::stcsr( int crd, Register s1, int simm13a) { v8_only(); inline void Assembler::stdcq( int crd, Register s1, Register s2) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::stdcq( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } +inline void Assembler::sub(Register s1, RegisterOrConstant s2, Register d, int offset) { + if (s2.is_register()) sub(s1, s2.as_register(), d); + else { sub(s1, s2.as_constant() + offset, d); offset = 0; } + if (offset != 0) sub(d, offset, d); +} // pp 231 @@ -817,3 +835,5 @@ inline void MacroAssembler::membar( Membar_mask_bits const7a ) { Assembler::ldstub(SP, 0, G0); } } + +#endif // CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP diff --git a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp index 9e3b78920e9..643762eca01 100644 --- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,4 +22,24 @@ * */ +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interp_masm_sparc.hpp" +#include "interpreter/bytecodeInterpreter.hpp" +#include "interpreter/bytecodeInterpreter.inline.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" + // KILL THIS FILE diff --git a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp index d339d3485e3..aad5bc7162c 100644 --- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP +#define CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP + // Platform specific for C++ based Interpreter #define LOTS_OF_REGS /* Lets interpreter use plenty of registers */ @@ -97,3 +100,5 @@ public: ((VMJavaVal64*)(addr))->d) #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \ ((VMJavaVal64*)(addr))->l) + +#endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp index 6bd42a8ec84..d9c8e66de6a 100644 --- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP +#define CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP + // Inline interpreter functions for sparc inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; } @@ -331,3 +334,5 @@ class u8_converter { } }; #endif /* ALIGN_CONVERTER */ + +#endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP diff --git a/hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp b/hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp index d8701db24d9..8874d8ca8cc 100644 --- a/hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,8 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_bytecodes_sparc.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/bytecodes.hpp" void Bytecodes::pd_initialize() { diff --git a/hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp b/hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp index b6913fa5621..f1d08b336ab 100644 --- a/hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_BYTECODES_SPARC_HPP +#define CPU_SPARC_VM_BYTECODES_SPARC_HPP + #ifdef SPARC #define NLOCALS_IN_REGS 6 #endif @@ -30,3 +33,5 @@ // Sparc specific bytecodes // (none) + +#endif // CPU_SPARC_VM_BYTECODES_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/bytes_sparc.hpp b/hotspot/src/cpu/sparc/vm/bytes_sparc.hpp index 7593326364a..67d4307ff74 100644 --- a/hotspot/src/cpu/sparc/vm/bytes_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/bytes_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef CPU_SPARC_VM_BYTES_SPARC_HPP +#define CPU_SPARC_VM_BYTES_SPARC_HPP + +#include "memory/allocation.hpp" + class Bytes: AllStatic { public: // Efficient reading and writing of unaligned unsigned data in platform-specific byte ordering @@ -155,3 +160,5 @@ class Bytes: AllStatic { // 1.15 98/10/05 16:30:21 bytes_i486.hpp // 1.17 99/06/22 16:37:35 bytes_i486.hpp //End + +#endif // CPU_SPARC_VM_BYTES_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp index 709259740f5..ee5f6afb5de 100644 --- a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp @@ -22,8 +22,18 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_CodeStubs_sparc.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_CodeStubs.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "nativeInst_sparc.hpp" +#include "runtime/sharedRuntime.hpp" +#include "vmreg_sparc.inline.hpp" +#ifndef SERIALGC +#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" +#endif #define __ ce->masm()-> @@ -32,6 +42,7 @@ RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception) , _index(index) { + assert(info != NULL, "must have info"); _info = new CodeEmitInfo(info); } @@ -423,9 +434,14 @@ void G1PreBarrierStub::emit_code(LIR_Assembler* ce) { Register pre_val_reg = pre_val()->as_register(); - ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false); - __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, - pre_val_reg, _continuation); + ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/); + if (__ is_in_wdisp16_range(_continuation)) { + __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, + pre_val_reg, _continuation); + } else { + __ cmp(pre_val_reg, G0); + __ brx(Assembler::equal, false, Assembler::pn, _continuation); + } __ delayed()->nop(); __ call(Runtime1::entry_for(Runtime1::Runtime1::g1_pre_barrier_slow_id)); @@ -451,8 +467,13 @@ void G1PostBarrierStub::emit_code(LIR_Assembler* ce) { assert(new_val()->is_register(), "Precondition."); Register addr_reg = addr()->as_pointer_register(); Register new_val_reg = new_val()->as_register(); - __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, - new_val_reg, _continuation); + if (__ is_in_wdisp16_range(_continuation)) { + __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, + new_val_reg, _continuation); + } else { + __ cmp(new_val_reg, G0); + __ brx(Assembler::equal, false, Assembler::pn, _continuation); + } __ delayed()->nop(); __ call(Runtime1::entry_for(Runtime1::Runtime1::g1_post_barrier_slow_id)); diff --git a/hotspot/src/cpu/sparc/vm/c1_Defs_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_Defs_sparc.hpp index c03873d4e65..a63e28fafe3 100644 --- a/hotspot/src/cpu/sparc/vm/c1_Defs_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c1_Defs_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_C1_DEFS_SPARC_HPP +#define CPU_SPARC_VM_C1_DEFS_SPARC_HPP + // native word offsets from memory address (big endian) enum { pd_lo_word_offset_in_bytes = BytesPerInt, @@ -65,3 +68,5 @@ enum { enum { pd_float_saved_as_double = false }; + +#endif // CPU_SPARC_VM_C1_DEFS_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp index 3a2c65d9f17..8c3a19a9e78 100644 --- a/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,4 +22,10 @@ * */ +#include "precompiled.hpp" +#include "c1/c1_FpuStackSim.hpp" +#include "c1/c1_FrameMap.hpp" +#include "utilities/array.hpp" +#include "utilities/ostream.hpp" + // No FPU stack on SPARC diff --git a/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp index 3aa967d4627..83f14968bb1 100644 --- a/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +22,10 @@ * */ +#ifndef CPU_SPARC_VM_C1_FPUSTACKSIM_SPARC_HPP +#define CPU_SPARC_VM_C1_FPUSTACKSIM_SPARC_HPP + // No FPU stack on SPARC class FpuStackSim; + +#endif // CPU_SPARC_VM_C1_FPUSTACKSIM_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp index 2bf36306771..6b9e5652ae7 100644 --- a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp @@ -22,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_FrameMap_sparc.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_LIR.hpp" +#include "runtime/sharedRuntime.hpp" +#include "vmreg_sparc.inline.hpp" const int FrameMap::pd_c_runtime_reserved_arg_size = 7; diff --git a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp index 10dfbceadd6..2304c2d0103 100644 --- a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP +#define CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP + public: enum { @@ -151,3 +154,8 @@ static bool is_caller_save_register (LIR_Opr reg); static bool is_caller_save_register (Register r); + + static int nof_caller_save_cpu_regs() { return pd_nof_caller_save_cpu_regs_frame_map; } + static int last_cpu_reg() { return pd_last_cpu_reg; } + +#endif // CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp index 143cd93f17e..15ca82f28fe 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp @@ -22,8 +22,20 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_LIRAssembler_sparc.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciArrayKlass.hpp" +#include "ci/ciInstance.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "memory/barrierSet.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "nativeInst_sparc.hpp" +#include "oops/objArrayKlass.hpp" +#include "runtime/sharedRuntime.hpp" #define __ _masm-> @@ -88,6 +100,11 @@ bool LIR_Assembler::is_single_instruction(LIR_Op* op) { return false; } + if (UseCompressedOops) { + if (dst->is_address() && !dst->is_stack() && (dst->type() == T_OBJECT || dst->type() == T_ARRAY)) return false; + if (src->is_address() && !src->is_stack() && (src->type() == T_OBJECT || src->type() == T_ARRAY)) return false; + } + if (dst->is_register()) { if (src->is_address() && Assembler::is_simm13(src->as_address_ptr()->disp())) { return !PatchALot; @@ -241,7 +258,7 @@ void LIR_Assembler::emit_string_compare(LIR_Opr left, LIR_Opr right, LIR_Opr dst int offset_offset = java_lang_String::offset_offset_in_bytes(); // first character position int count_offset = java_lang_String:: count_offset_in_bytes(); - __ ld_ptr(str0, value_offset, tmp0); + __ load_heap_oop(str0, value_offset, tmp0); __ ld(str0, offset_offset, tmp2); __ add(tmp0, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp0); __ ld(str0, count_offset, str0); @@ -250,7 +267,7 @@ void LIR_Assembler::emit_string_compare(LIR_Opr left, LIR_Opr right, LIR_Opr dst // str1 may be null add_debug_info_for_null_check_here(info); - __ ld_ptr(str1, value_offset, tmp1); + __ load_heap_oop(str1, value_offset, tmp1); __ add(tmp0, tmp2, tmp0); __ ld(str1, offset_offset, tmp2); @@ -420,7 +437,8 @@ int LIR_Assembler::emit_unwind_handler() { } if (compilation()->env()->dtrace_method_probes()) { - jobject2reg(method()->constant_encoding(), O0); + __ mov(G2_thread, O0); + jobject2reg(method()->constant_encoding(), O1); __ call(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), relocInfo::runtime_call_type); __ delayed()->nop(); } @@ -753,7 +771,7 @@ void LIR_Assembler::ic_call(LIR_OpJavaCall* op) { void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) { add_debug_info_for_null_check_here(op->info()); - __ ld_ptr(O0, oopDesc::klass_offset_in_bytes(), G3_scratch); + __ load_klass(O0, G3_scratch); if (__ is_simm13(op->vtable_offset())) { __ ld_ptr(G3_scratch, op->vtable_offset(), G5_method); } else { @@ -767,138 +785,17 @@ void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) { // the peephole pass fills the delay slot } - -// load with 32-bit displacement -int LIR_Assembler::load(Register s, int disp, Register d, BasicType ld_type, CodeEmitInfo *info) { - int load_offset = code_offset(); - if (Assembler::is_simm13(disp)) { - if (info != NULL) add_debug_info_for_null_check_here(info); - switch(ld_type) { - case T_BOOLEAN: // fall through - case T_BYTE : __ ldsb(s, disp, d); break; - case T_CHAR : __ lduh(s, disp, d); break; - case T_SHORT : __ ldsh(s, disp, d); break; - case T_INT : __ ld(s, disp, d); break; - case T_ADDRESS:// fall through - case T_ARRAY : // fall through - case T_OBJECT: __ ld_ptr(s, disp, d); break; - default : ShouldNotReachHere(); - } - } else { - __ set(disp, O7); - if (info != NULL) add_debug_info_for_null_check_here(info); - load_offset = code_offset(); - switch(ld_type) { - case T_BOOLEAN: // fall through - case T_BYTE : __ ldsb(s, O7, d); break; - case T_CHAR : __ lduh(s, O7, d); break; - case T_SHORT : __ ldsh(s, O7, d); break; - case T_INT : __ ld(s, O7, d); break; - case T_ADDRESS:// fall through - case T_ARRAY : // fall through - case T_OBJECT: __ ld_ptr(s, O7, d); break; - default : ShouldNotReachHere(); - } - } - if (ld_type == T_ARRAY || ld_type == T_OBJECT) __ verify_oop(d); - return load_offset; -} - - -// store with 32-bit displacement -void LIR_Assembler::store(Register value, Register base, int offset, BasicType type, CodeEmitInfo *info) { - if (Assembler::is_simm13(offset)) { - if (info != NULL) add_debug_info_for_null_check_here(info); - switch (type) { - case T_BOOLEAN: // fall through - case T_BYTE : __ stb(value, base, offset); break; - case T_CHAR : __ sth(value, base, offset); break; - case T_SHORT : __ sth(value, base, offset); break; - case T_INT : __ stw(value, base, offset); break; - case T_ADDRESS:// fall through - case T_ARRAY : // fall through - case T_OBJECT: __ st_ptr(value, base, offset); break; - default : ShouldNotReachHere(); - } - } else { - __ set(offset, O7); - if (info != NULL) add_debug_info_for_null_check_here(info); - switch (type) { - case T_BOOLEAN: // fall through - case T_BYTE : __ stb(value, base, O7); break; - case T_CHAR : __ sth(value, base, O7); break; - case T_SHORT : __ sth(value, base, O7); break; - case T_INT : __ stw(value, base, O7); break; - case T_ADDRESS:// fall through - case T_ARRAY : //fall through - case T_OBJECT: __ st_ptr(value, base, O7); break; - default : ShouldNotReachHere(); - } - } - // Note: Do the store before verification as the code might be patched! - if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(value); -} - - -// load float with 32-bit displacement -void LIR_Assembler::load(Register s, int disp, FloatRegister d, BasicType ld_type, CodeEmitInfo *info) { - FloatRegisterImpl::Width w; - switch(ld_type) { - case T_FLOAT : w = FloatRegisterImpl::S; break; - case T_DOUBLE: w = FloatRegisterImpl::D; break; - default : ShouldNotReachHere(); - } - - if (Assembler::is_simm13(disp)) { - if (info != NULL) add_debug_info_for_null_check_here(info); - if (disp % BytesPerLong != 0 && w == FloatRegisterImpl::D) { - __ ldf(FloatRegisterImpl::S, s, disp + BytesPerWord, d->successor()); - __ ldf(FloatRegisterImpl::S, s, disp , d); - } else { - __ ldf(w, s, disp, d); - } - } else { - __ set(disp, O7); - if (info != NULL) add_debug_info_for_null_check_here(info); - __ ldf(w, s, O7, d); - } -} - - -// store float with 32-bit displacement -void LIR_Assembler::store(FloatRegister value, Register base, int offset, BasicType type, CodeEmitInfo *info) { - FloatRegisterImpl::Width w; - switch(type) { - case T_FLOAT : w = FloatRegisterImpl::S; break; - case T_DOUBLE: w = FloatRegisterImpl::D; break; - default : ShouldNotReachHere(); - } - - if (Assembler::is_simm13(offset)) { - if (info != NULL) add_debug_info_for_null_check_here(info); - if (w == FloatRegisterImpl::D && offset % BytesPerLong != 0) { - __ stf(FloatRegisterImpl::S, value->successor(), base, offset + BytesPerWord); - __ stf(FloatRegisterImpl::S, value , base, offset); - } else { - __ stf(w, value, base, offset); - } - } else { - __ set(offset, O7); - if (info != NULL) add_debug_info_for_null_check_here(info); - __ stf(w, value, O7, base); - } -} - - -int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool unaligned) { +int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool wide, bool unaligned) { int store_offset; if (!Assembler::is_simm13(offset + (type == T_LONG) ? wordSize : 0)) { assert(!unaligned, "can't handle this"); // for offsets larger than a simm13 we setup the offset in O7 __ set(offset, O7); - store_offset = store(from_reg, base, O7, type); + store_offset = store(from_reg, base, O7, type, wide); } else { - if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(from_reg->as_register()); + if (type == T_ARRAY || type == T_OBJECT) { + __ verify_oop(from_reg->as_register()); + } store_offset = code_offset(); switch (type) { case T_BOOLEAN: // fall through @@ -921,9 +818,22 @@ int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType __ stw(from_reg->as_register_hi(), base, offset + hi_word_offset_in_bytes); #endif break; - case T_ADDRESS:// fall through + case T_ADDRESS: + __ st_ptr(from_reg->as_register(), base, offset); + break; case T_ARRAY : // fall through - case T_OBJECT: __ st_ptr(from_reg->as_register(), base, offset); break; + case T_OBJECT: + { + if (UseCompressedOops && !wide) { + __ encode_heap_oop(from_reg->as_register(), G3_scratch); + store_offset = code_offset(); + __ stw(G3_scratch, base, offset); + } else { + __ st_ptr(from_reg->as_register(), base, offset); + } + break; + } + case T_FLOAT : __ stf(FloatRegisterImpl::S, from_reg->as_float_reg(), base, offset); break; case T_DOUBLE: { @@ -945,8 +855,10 @@ int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType } -int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicType type) { - if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(from_reg->as_register()); +int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide) { + if (type == T_ARRAY || type == T_OBJECT) { + __ verify_oop(from_reg->as_register()); + } int store_offset = code_offset(); switch (type) { case T_BOOLEAN: // fall through @@ -962,9 +874,21 @@ int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicTy __ std(from_reg->as_register_hi(), base, disp); #endif break; - case T_ADDRESS:// fall through + case T_ADDRESS: + __ st_ptr(from_reg->as_register(), base, disp); + break; case T_ARRAY : // fall through - case T_OBJECT: __ st_ptr(from_reg->as_register(), base, disp); break; + case T_OBJECT: + { + if (UseCompressedOops && !wide) { + __ encode_heap_oop(from_reg->as_register(), G3_scratch); + store_offset = code_offset(); + __ stw(G3_scratch, base, disp); + } else { + __ st_ptr(from_reg->as_register(), base, disp); + } + break; + } case T_FLOAT : __ stf(FloatRegisterImpl::S, from_reg->as_float_reg(), base, disp); break; case T_DOUBLE: __ stf(FloatRegisterImpl::D, from_reg->as_double_reg(), base, disp); break; default : ShouldNotReachHere(); @@ -973,14 +897,14 @@ int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicTy } -int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool unaligned) { +int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool wide, bool unaligned) { int load_offset; if (!Assembler::is_simm13(offset + (type == T_LONG) ? wordSize : 0)) { assert(base != O7, "destroying register"); assert(!unaligned, "can't handle this"); // for offsets larger than a simm13 we setup the offset in O7 __ set(offset, O7); - load_offset = load(base, O7, to_reg, type); + load_offset = load(base, O7, to_reg, type, wide); } else { load_offset = code_offset(); switch(type) { @@ -1017,9 +941,18 @@ int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType typ #endif } break; - case T_ADDRESS:// fall through + case T_ADDRESS: __ ld_ptr(base, offset, to_reg->as_register()); break; case T_ARRAY : // fall through - case T_OBJECT: __ ld_ptr(base, offset, to_reg->as_register()); break; + case T_OBJECT: + { + if (UseCompressedOops && !wide) { + __ lduw(base, offset, to_reg->as_register()); + __ decode_heap_oop(to_reg->as_register()); + } else { + __ ld_ptr(base, offset, to_reg->as_register()); + } + break; + } case T_FLOAT: __ ldf(FloatRegisterImpl::S, base, offset, to_reg->as_float_reg()); break; case T_DOUBLE: { @@ -1035,23 +968,34 @@ int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType typ } default : ShouldNotReachHere(); } - if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(to_reg->as_register()); + if (type == T_ARRAY || type == T_OBJECT) { + __ verify_oop(to_reg->as_register()); + } } return load_offset; } -int LIR_Assembler::load(Register base, Register disp, LIR_Opr to_reg, BasicType type) { +int LIR_Assembler::load(Register base, Register disp, LIR_Opr to_reg, BasicType type, bool wide) { int load_offset = code_offset(); switch(type) { case T_BOOLEAN: // fall through - case T_BYTE : __ ldsb(base, disp, to_reg->as_register()); break; - case T_CHAR : __ lduh(base, disp, to_reg->as_register()); break; - case T_SHORT : __ ldsh(base, disp, to_reg->as_register()); break; - case T_INT : __ ld(base, disp, to_reg->as_register()); break; - case T_ADDRESS:// fall through + case T_BYTE : __ ldsb(base, disp, to_reg->as_register()); break; + case T_CHAR : __ lduh(base, disp, to_reg->as_register()); break; + case T_SHORT : __ ldsh(base, disp, to_reg->as_register()); break; + case T_INT : __ ld(base, disp, to_reg->as_register()); break; + case T_ADDRESS: __ ld_ptr(base, disp, to_reg->as_register()); break; case T_ARRAY : // fall through - case T_OBJECT: __ ld_ptr(base, disp, to_reg->as_register()); break; + case T_OBJECT: + { + if (UseCompressedOops && !wide) { + __ lduw(base, disp, to_reg->as_register()); + __ decode_heap_oop(to_reg->as_register()); + } else { + __ ld_ptr(base, disp, to_reg->as_register()); + } + break; + } case T_FLOAT: __ ldf(FloatRegisterImpl::S, base, disp, to_reg->as_float_reg()); break; case T_DOUBLE: __ ldf(FloatRegisterImpl::D, base, disp, to_reg->as_double_reg()); break; case T_LONG : @@ -1065,61 +1009,17 @@ int LIR_Assembler::load(Register base, Register disp, LIR_Opr to_reg, BasicType break; default : ShouldNotReachHere(); } - if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(to_reg->as_register()); + if (type == T_ARRAY || type == T_OBJECT) { + __ verify_oop(to_reg->as_register()); + } return load_offset; } - -// load/store with an Address -void LIR_Assembler::load(const Address& a, Register d, BasicType ld_type, CodeEmitInfo *info, int offset) { - load(a.base(), a.disp() + offset, d, ld_type, info); -} - - -void LIR_Assembler::store(Register value, const Address& dest, BasicType type, CodeEmitInfo *info, int offset) { - store(value, dest.base(), dest.disp() + offset, type, info); -} - - -// loadf/storef with an Address -void LIR_Assembler::load(const Address& a, FloatRegister d, BasicType ld_type, CodeEmitInfo *info, int offset) { - load(a.base(), a.disp() + offset, d, ld_type, info); -} - - -void LIR_Assembler::store(FloatRegister value, const Address& dest, BasicType type, CodeEmitInfo *info, int offset) { - store(value, dest.base(), dest.disp() + offset, type, info); -} - - -// load/store with an Address -void LIR_Assembler::load(LIR_Address* a, Register d, BasicType ld_type, CodeEmitInfo *info) { - load(as_Address(a), d, ld_type, info); -} - - -void LIR_Assembler::store(Register value, LIR_Address* dest, BasicType type, CodeEmitInfo *info) { - store(value, as_Address(dest), type, info); -} - - -// loadf/storef with an Address -void LIR_Assembler::load(LIR_Address* a, FloatRegister d, BasicType ld_type, CodeEmitInfo *info) { - load(as_Address(a), d, ld_type, info); -} - - -void LIR_Assembler::store(FloatRegister value, LIR_Address* dest, BasicType type, CodeEmitInfo *info) { - store(value, as_Address(dest), type, info); -} - - void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) { LIR_Const* c = src->as_constant_ptr(); switch (c->type()) { case T_INT: - case T_FLOAT: - case T_ADDRESS: { + case T_FLOAT: { Register src_reg = O7; int value = c->as_jint_bits(); if (value == 0) { @@ -1131,6 +1031,18 @@ void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) { __ stw(src_reg, addr.base(), addr.disp()); break; } + case T_ADDRESS: { + Register src_reg = O7; + int value = c->as_jint_bits(); + if (value == 0) { + src_reg = G0; + } else { + __ set(value, O7); + } + Address addr = frame_map()->address_for_slot(dest->single_stack_ix()); + __ st_ptr(src_reg, addr.base(), addr.disp()); + break; + } case T_OBJECT: { Register src_reg = O7; jobject2reg(c->as_jobject(), src_reg); @@ -1165,14 +1077,12 @@ void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) { } -void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info ) { +void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info, bool wide) { LIR_Const* c = src->as_constant_ptr(); LIR_Address* addr = dest->as_address_ptr(); Register base = addr->base()->as_pointer_register(); + int offset = -1; - if (info != NULL) { - add_debug_info_for_null_check_here(info); - } switch (c->type()) { case T_INT: case T_FLOAT: @@ -1186,10 +1096,10 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi } if (addr->index()->is_valid()) { assert(addr->disp() == 0, "must be zero"); - store(tmp, base, addr->index()->as_pointer_register(), type); + offset = store(tmp, base, addr->index()->as_pointer_register(), type, wide); } else { assert(Assembler::is_simm13(addr->disp()), "can't handle larger addresses"); - store(tmp, base, addr->disp(), type); + offset = store(tmp, base, addr->disp(), type, wide, false); } break; } @@ -1199,21 +1109,21 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi assert(Assembler::is_simm13(addr->disp()) && Assembler::is_simm13(addr->disp() + 4), "can't handle larger addresses"); - Register tmp = O7; + LIR_Opr tmp = FrameMap::O7_opr; int value_lo = c->as_jint_lo_bits(); if (value_lo == 0) { - tmp = G0; + tmp = FrameMap::G0_opr; } else { __ set(value_lo, O7); } - store(tmp, base, addr->disp() + lo_word_offset_in_bytes, T_INT); + offset = store(tmp, base, addr->disp() + lo_word_offset_in_bytes, T_INT, wide, false); int value_hi = c->as_jint_hi_bits(); if (value_hi == 0) { - tmp = G0; + tmp = FrameMap::G0_opr; } else { __ set(value_hi, O7); } - store(tmp, base, addr->disp() + hi_word_offset_in_bytes, T_INT); + offset = store(tmp, base, addr->disp() + hi_word_offset_in_bytes, T_INT, wide, false); break; } case T_OBJECT: { @@ -1228,10 +1138,10 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi // handle either reg+reg or reg+disp address if (addr->index()->is_valid()) { assert(addr->disp() == 0, "must be zero"); - store(tmp, base, addr->index()->as_pointer_register(), type); + offset = store(tmp, base, addr->index()->as_pointer_register(), type, wide); } else { assert(Assembler::is_simm13(addr->disp()), "can't handle larger addresses"); - store(tmp, base, addr->disp(), type); + offset = store(tmp, base, addr->disp(), type, wide, false); } break; @@ -1239,6 +1149,10 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi default: Unimplemented(); } + if (info != NULL) { + assert(offset != -1, "offset should've been set"); + add_debug_info_for_null_check(offset, info); + } } @@ -1323,7 +1237,7 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod assert(to_reg->is_single_cpu(), "Must be a cpu register."); __ set(const_addrlit, O7); - load(O7, 0, to_reg->as_register(), T_INT); + __ ld(O7, 0, to_reg->as_register()); } } break; @@ -1416,7 +1330,7 @@ Address LIR_Assembler::as_Address_lo(LIR_Address* addr) { void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type, - LIR_PatchCode patch_code, CodeEmitInfo* info, bool unaligned) { + LIR_PatchCode patch_code, CodeEmitInfo* info, bool wide, bool unaligned) { LIR_Address* addr = src_opr->as_address_ptr(); LIR_Opr to_reg = dest; @@ -1462,16 +1376,15 @@ void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type, assert(disp_reg != noreg || Assembler::is_simm13(disp_value), "should have set this up"); if (disp_reg == noreg) { - offset = load(src, disp_value, to_reg, type, unaligned); + offset = load(src, disp_value, to_reg, type, wide, unaligned); } else { assert(!unaligned, "can't handle this"); - offset = load(src, disp_reg, to_reg, type); + offset = load(src, disp_reg, to_reg, type, wide); } if (patch != NULL) { patching_epilog(patch, patch_code, src, info); } - if (info != NULL) add_debug_info_for_null_check(offset, info); } @@ -1505,7 +1418,7 @@ void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) { } bool unaligned = (addr.disp() - STACK_BIAS) % 8 != 0; - load(addr.base(), addr.disp(), dest, dest->type(), unaligned); + load(addr.base(), addr.disp(), dest, dest->type(), true /*wide*/, unaligned); } @@ -1517,7 +1430,7 @@ void LIR_Assembler::reg2stack(LIR_Opr from_reg, LIR_Opr dest, BasicType type, bo addr = frame_map()->address_for_slot(dest->double_stack_ix()); } bool unaligned = (addr.disp() - STACK_BIAS) % 8 != 0; - store(from_reg, addr.base(), addr.disp(), from_reg->type(), unaligned); + store(from_reg, addr.base(), addr.disp(), from_reg->type(), true /*wide*/, unaligned); } @@ -1565,7 +1478,7 @@ void LIR_Assembler::reg2reg(LIR_Opr from_reg, LIR_Opr to_reg) { void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, - bool unaligned) { + bool wide, bool unaligned) { LIR_Address* addr = dest->as_address_ptr(); Register src = addr->base()->as_pointer_register(); @@ -1609,10 +1522,10 @@ void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type, assert(disp_reg != noreg || Assembler::is_simm13(disp_value), "should have set this up"); if (disp_reg == noreg) { - offset = store(from_reg, src, disp_value, type, unaligned); + offset = store(from_reg, src, disp_value, type, wide, unaligned); } else { assert(!unaligned, "can't handle this"); - offset = store(from_reg, src, disp_reg, type); + offset = store(from_reg, src, disp_reg, type, wide); } if (patch != NULL) { @@ -1792,8 +1705,7 @@ void LIR_Assembler::comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Op } -void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result) { - +void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) { Assembler::Condition acond; switch (condition) { case lir_cond_equal: acond = Assembler::equal; break; @@ -1824,7 +1736,12 @@ void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, L ShouldNotReachHere(); } Label skip; - __ br(acond, false, Assembler::pt, skip); +#ifdef _LP64 + if (type == T_INT) { + __ br(acond, false, Assembler::pt, skip); + } else +#endif + __ brx(acond, false, Assembler::pt, skip); // checks icc on 32bit and xcc on 64bit if (opr1->is_constant() && opr1->type() == T_INT) { Register dest = result->as_register(); if (Assembler::is_simm13(opr1->as_jint())) { @@ -2171,13 +2088,13 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { // make sure src and dst are non-null and load array length if (flags & LIR_OpArrayCopy::src_null_check) { __ tst(src); - __ br(Assembler::equal, false, Assembler::pn, *stub->entry()); + __ brx(Assembler::equal, false, Assembler::pn, *stub->entry()); __ delayed()->nop(); } if (flags & LIR_OpArrayCopy::dst_null_check) { __ tst(dst); - __ br(Assembler::equal, false, Assembler::pn, *stub->entry()); + __ brx(Assembler::equal, false, Assembler::pn, *stub->entry()); __ delayed()->nop(); } @@ -2219,10 +2136,18 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { } if (flags & LIR_OpArrayCopy::type_check) { - __ ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp); - __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2); - __ cmp(tmp, tmp2); - __ br(Assembler::notEqual, false, Assembler::pt, *stub->entry()); + if (UseCompressedOops) { + // We don't need decode because we just need to compare + __ lduw(src, oopDesc::klass_offset_in_bytes(), tmp); + __ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2); + __ cmp(tmp, tmp2); + __ br(Assembler::notEqual, false, Assembler::pt, *stub->entry()); + } else { + __ ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp); + __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2); + __ cmp(tmp, tmp2); + __ brx(Assembler::notEqual, false, Assembler::pt, *stub->entry()); + } __ delayed()->nop(); } @@ -2237,20 +2162,44 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { // but not necessarily exactly of type default_type. Label known_ok, halt; jobject2reg(op->expected_type()->constant_encoding(), tmp); - __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2); - if (basic_type != T_OBJECT) { - __ cmp(tmp, tmp2); - __ br(Assembler::notEqual, false, Assembler::pn, halt); - __ delayed()->ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp2); - __ cmp(tmp, tmp2); - __ br(Assembler::equal, false, Assembler::pn, known_ok); - __ delayed()->nop(); + if (UseCompressedOops) { + // tmp holds the default type. It currently comes uncompressed after the + // load of a constant, so encode it. + __ encode_heap_oop(tmp); + // load the raw value of the dst klass, since we will be comparing + // uncompressed values directly. + __ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2); + if (basic_type != T_OBJECT) { + __ cmp(tmp, tmp2); + __ br(Assembler::notEqual, false, Assembler::pn, halt); + // load the raw value of the src klass. + __ delayed()->lduw(src, oopDesc::klass_offset_in_bytes(), tmp2); + __ cmp(tmp, tmp2); + __ br(Assembler::equal, false, Assembler::pn, known_ok); + __ delayed()->nop(); + } else { + __ cmp(tmp, tmp2); + __ br(Assembler::equal, false, Assembler::pn, known_ok); + __ delayed()->cmp(src, dst); + __ brx(Assembler::equal, false, Assembler::pn, known_ok); + __ delayed()->nop(); + } } else { - __ cmp(tmp, tmp2); - __ br(Assembler::equal, false, Assembler::pn, known_ok); - __ delayed()->cmp(src, dst); - __ br(Assembler::equal, false, Assembler::pn, known_ok); - __ delayed()->nop(); + __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2); + if (basic_type != T_OBJECT) { + __ cmp(tmp, tmp2); + __ brx(Assembler::notEqual, false, Assembler::pn, halt); + __ delayed()->ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp2); + __ cmp(tmp, tmp2); + __ brx(Assembler::equal, false, Assembler::pn, known_ok); + __ delayed()->nop(); + } else { + __ cmp(tmp, tmp2); + __ brx(Assembler::equal, false, Assembler::pn, known_ok); + __ delayed()->cmp(src, dst); + __ brx(Assembler::equal, false, Assembler::pn, known_ok); + __ delayed()->nop(); + } } __ bind(halt); __ stop("incorrect type information in arraycopy"); @@ -2458,7 +2407,7 @@ void LIR_Assembler::type_profile_helper(Register mdo, int mdo_offset_bias, Label next_test; Address recv_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - mdo_offset_bias); - load(recv_addr, tmp1, T_OBJECT); + __ ld_ptr(recv_addr, tmp1); __ br_notnull(tmp1, false, Assembler::pt, next_test); __ delayed()->nop(); __ st_ptr(recv, recv_addr); @@ -2474,11 +2423,8 @@ void LIR_Assembler::type_profile_helper(Register mdo, int mdo_offset_bias, void LIR_Assembler::setup_md_access(ciMethod* method, int bci, ciMethodData*& md, ciProfileData*& data, int& mdo_offset_bias) { - md = method->method_data(); - if (md == NULL) { - bailout("out of memory building methodDataOop"); - return; - } + md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); data = md->bci_to_data(bci); assert(data != NULL, "need data for checkcast"); assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); @@ -2550,7 +2496,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L // get object class // not a safepoint as obj null check happens earlier - load(obj, oopDesc::klass_offset_in_bytes(), klass_RInfo, T_OBJECT, NULL); + __ load_klass(obj, klass_RInfo); if (op->fast_check()) { assert_different_registers(klass_RInfo, k_RInfo); __ cmp(k_RInfo, klass_RInfo); @@ -2592,7 +2538,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L __ set(mdo_offset_bias, tmp1); __ add(mdo, tmp1, mdo); } - load(Address(obj, oopDesc::klass_offset_in_bytes()), recv, T_OBJECT); + __ load_klass(obj, recv); type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, success); // Jump over the failure case __ ba(false, *success); @@ -2661,11 +2607,12 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { __ br_null(value, false, Assembler::pn, done); __ delayed()->nop(); } - load(array, oopDesc::klass_offset_in_bytes(), k_RInfo, T_OBJECT, op->info_for_exception()); - load(value, oopDesc::klass_offset_in_bytes(), klass_RInfo, T_OBJECT, NULL); + add_debug_info_for_null_check_here(op->info_for_exception()); + __ load_klass(array, k_RInfo); + __ load_klass(value, klass_RInfo); // get instance klass - load(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc), k_RInfo, T_OBJECT, NULL); + __ ld_ptr(Address(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc)), k_RInfo); // perform the fast part of the checking logic __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, O7, success_target, failure_target, NULL); @@ -2687,7 +2634,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { __ set(mdo_offset_bias, tmp1); __ add(mdo, tmp1, mdo); } - load(Address(value, oopDesc::klass_offset_in_bytes()), recv, T_OBJECT); + __ load_klass(value, recv); type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, &done); __ ba(false, done); __ delayed()->nop(); @@ -2745,6 +2692,11 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) { #ifdef _LP64 __ mov(cmp_value_lo, t1); __ mov(new_value_lo, t2); + // perform the compare and swap operation + __ casx(addr, t1, t2); + // generate condition code - if the swap succeeded, t2 ("new value" reg) was + // overwritten with the original value in "addr" and will be equal to t1. + __ cmp(t1, t2); #else // move high and low halves of long values into single registers __ sllx(cmp_value_hi, 32, t1); // shift high half into temp reg @@ -2753,13 +2705,15 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) { __ sllx(new_value_hi, 32, t2); __ srl(new_value_lo, 0, new_value_lo); __ or3(t2, new_value_lo, t2); // t2 holds 64-bit value to swap -#endif // perform the compare and swap operation __ casx(addr, t1, t2); // generate condition code - if the swap succeeded, t2 ("new value" reg) was // overwritten with the original value in "addr" and will be equal to t1. - __ cmp(t1, t2); - + // Produce icc flag for 32bit. + __ sub(t1, t2, t2); + __ srlx(t2, 32, t1); + __ orcc(t2, t1, G0); +#endif } else if (op->code() == lir_cas_int || op->code() == lir_cas_obj) { Register addr = op->addr()->as_pointer_register(); Register cmp_value = op->cmp_value()->as_register(); @@ -2768,14 +2722,17 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) { Register t2 = op->tmp2()->as_register(); __ mov(cmp_value, t1); __ mov(new_value, t2); -#ifdef _LP64 if (op->code() == lir_cas_obj) { - __ casx(addr, t1, t2); - } else -#endif - { + if (UseCompressedOops) { + __ encode_heap_oop(t1); + __ encode_heap_oop(t2); __ cas(addr, t1, t2); + } else { + __ cas_ptr(addr, t1, t2); } + } else { + __ cas(addr, t1, t2); + } __ cmp(t1, t2); } else { Unimplemented(); @@ -2872,11 +2829,8 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { int bci = op->profiled_bci(); // Update counter for all call types - ciMethodData* md = method->method_data(); - if (md == NULL) { - bailout("out of memory building methodDataOop"); - return; - } + ciMethodData* md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(bci); assert(data->is_CounterData(), "need CounterData for calls"); assert(op->mdo()->is_single_cpu(), "mdo must be allocated"); @@ -2953,7 +2907,7 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { } } } else { - load(Address(recv, oopDesc::klass_offset_in_bytes()), recv, T_OBJECT); + __ load_klass(recv, recv); Label update_done; type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, &update_done); // Receiver did not match any saved receiver and there is no empty row for it. @@ -3147,7 +3101,7 @@ void LIR_Assembler::volatile_move_op(LIR_Opr src, LIR_Opr dest, BasicType type, } else { // use normal move for all other volatiles since they don't need // special handling to remain atomic. - move_op(src, dest, type, lir_patch_none, info, false, false); + move_op(src, dest, type, lir_patch_none, info, false, false, false); } } diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp index f6f715408e4..386159c89b8 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP +#define CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP + private: ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -37,33 +40,11 @@ // and then a load or store is emitted with ([O7] + [d]). // - // some load/store variants return the code_offset for proper positioning of debug info for null checks + int store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool wide, bool unaligned); + int store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide); - // load/store with 32 bit displacement - int load(Register s, int disp, Register d, BasicType ld_type, CodeEmitInfo* info = NULL); - void store(Register value, Register base, int offset, BasicType type, CodeEmitInfo *info = NULL); - - // loadf/storef with 32 bit displacement - void load(Register s, int disp, FloatRegister d, BasicType ld_type, CodeEmitInfo* info = NULL); - void store(FloatRegister d, Register s1, int disp, BasicType st_type, CodeEmitInfo* info = NULL); - - // convienence methods for calling load/store with an Address - void load(const Address& a, Register d, BasicType ld_type, CodeEmitInfo* info = NULL, int offset = 0); - void store(Register d, const Address& a, BasicType st_type, CodeEmitInfo* info = NULL, int offset = 0); - void load(const Address& a, FloatRegister d, BasicType ld_type, CodeEmitInfo* info = NULL, int offset = 0); - void store(FloatRegister d, const Address& a, BasicType st_type, CodeEmitInfo* info = NULL, int offset = 0); - - // convienence methods for calling load/store with an LIR_Address - void load(LIR_Address* a, Register d, BasicType ld_type, CodeEmitInfo* info = NULL); - void store(Register d, LIR_Address* a, BasicType st_type, CodeEmitInfo* info = NULL); - void load(LIR_Address* a, FloatRegister d, BasicType ld_type, CodeEmitInfo* info = NULL); - void store(FloatRegister d, LIR_Address* a, BasicType st_type, CodeEmitInfo* info = NULL); - - int store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool unaligned = false); - int store(LIR_Opr from_reg, Register base, Register disp, BasicType type); - - int load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool unaligned = false); - int load(Register base, Register disp, LIR_Opr to_reg, BasicType type); + int load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool wide, bool unaligned); + int load(Register base, Register disp, LIR_Opr to_reg, BasicType type, bool wide); void monitorexit(LIR_Opr obj_opr, LIR_Opr lock_opr, Register hdr, int monitor_no); @@ -90,3 +71,5 @@ enum { #endif // _LP64 exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(10*4), deopt_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(10*4) }; + +#endif // CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp index dbdf2027dfe..8869de5e8bd 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp @@ -22,8 +22,20 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_LIRGenerator_sparc.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_LIRGenerator.hpp" +#include "c1/c1_Runtime1.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciArray.hpp" +#include "ci/ciObjArrayKlass.hpp" +#include "ci/ciTypeArrayKlass.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "vmreg_sparc.inline.hpp" #ifdef ASSERT #define __ gen()->lir(__FILE__, __LINE__)-> @@ -311,7 +323,7 @@ void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) void LIRGenerator::do_StoreIndexed(StoreIndexed* x) { - assert(x->is_root(),""); + assert(x->is_pinned(),""); bool needs_range_check = true; bool use_length = x->length() != NULL; bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT; @@ -386,7 +398,7 @@ void LIRGenerator::do_StoreIndexed(StoreIndexed* x) { void LIRGenerator::do_MonitorEnter(MonitorEnter* x) { - assert(x->is_root(),""); + assert(x->is_pinned(),""); LIRItem obj(x->obj(), this); obj.load_item(); @@ -398,7 +410,7 @@ void LIRGenerator::do_MonitorEnter(MonitorEnter* x) { CodeEmitInfo* info_for_exception = NULL; if (x->needs_null_check()) { - info_for_exception = state_for(x, x->lock_stack_before()); + info_for_exception = state_for(x); } // this CodeEmitInfo must not have the xhandlers because here the @@ -409,7 +421,7 @@ void LIRGenerator::do_MonitorEnter(MonitorEnter* x) { void LIRGenerator::do_MonitorExit(MonitorExit* x) { - assert(x->is_root(),""); + assert(x->is_pinned(),""); LIRItem obj(x->obj(), this); obj.dont_load_item(); @@ -650,7 +662,7 @@ void LIRGenerator::do_AttemptUpdate(Intrinsic* x) { // generate conditional move of boolean result LIR_Opr result = rlock_result(x); - __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result); + __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result, T_LONG); } @@ -687,10 +699,10 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { else { ShouldNotReachHere(); } - // generate conditional move of boolean result LIR_Opr result = rlock_result(x); - __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result); + __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), + result, as_BasicType(type)); if (type == objectType) { // Write-barrier needed for Object fields. // Precise card mark since could either be object or array post_barrier(addr, val.result()); @@ -871,10 +883,11 @@ void LIRGenerator::do_NewInstance(NewInstance* x) { // This instruction can be deoptimized in the slow path : use // O0 as result register. const LIR_Opr reg = result_register_for(x->type()); - +#ifndef PRODUCT if (PrintNotLoaded && !x->klass()->is_loaded()) { - tty->print_cr(" ###class not loaded at new bci %d", x->bci()); + tty->print_cr(" ###class not loaded at new bci %d", x->printable_bci()); } +#endif CodeEmitInfo* info = state_for(x, x->state()); LIR_Opr tmp1 = FrameMap::G1_oop_opr; LIR_Opr tmp2 = FrameMap::G3_oop_opr; @@ -1018,7 +1031,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { obj.load_item(); LIR_Opr out_reg = rlock_result(x); CodeStub* stub; - CodeEmitInfo* info_for_exception = state_for(x, x->state()->copy_locks()); + CodeEmitInfo* info_for_exception = state_for(x); if (x->is_incompatible_class_change_check()) { assert(patching_info == NULL, "can't patch this"); diff --git a/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp index 92fc7e08624..e09039e7e4c 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_LinearScan_sparc.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_LinearScan.hpp" +#include "utilities/bitMap.inline.hpp" void LinearScan::allocate_fpu_stack() { // No FPU stack on SPARC diff --git a/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp index 4dfe4c5b640..ddb6f9a5bd5 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP +#define CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP + inline bool LinearScan::is_processed_reg_num(int reg_num) { return reg_num < 26 || reg_num > 31; } @@ -64,10 +67,12 @@ inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) { _first_reg = pd_first_callee_saved_reg; _last_reg = pd_last_callee_saved_reg; return true; - } else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT) { + } else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT || cur->type() == T_ADDRESS) { _first_reg = pd_first_cpu_reg; _last_reg = pd_last_allocatable_cpu_reg; return true; } return false; } + +#endif // CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp index db9ef843c7e..85eb668337c 100644 --- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp @@ -22,15 +22,25 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_MacroAssembler_sparc.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "classfile/systemDictionary.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "interpreter/interpreter.hpp" +#include "oops/arrayOop.hpp" +#include "oops/markOop.hpp" +#include "runtime/basicLock.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/os.hpp" +#include "runtime/stubRoutines.hpp" void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) { Label L; const Register temp_reg = G3_scratch; // Note: needs more testing of out-of-line vs. inline slow case verify_oop(receiver); - ld_ptr(receiver, oopDesc::klass_offset_in_bytes(), temp_reg); + load_klass(receiver, temp_reg); cmp(temp_reg, iCache); brx(Assembler::equal, true, Assembler::pt, L); delayed()->nop(); @@ -156,7 +166,7 @@ void C1_MacroAssembler::try_allocate( Register obj, // result: pointer to object after successful allocation Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise int con_size_in_bytes, // object size in bytes if known at compile time - Register t1, // temp register + Register t1, // temp register, must be global register for incr_allocated_bytes Register t2, // temp register Label& slow_case // continuation point if fast allocation fails ) { @@ -164,6 +174,7 @@ void C1_MacroAssembler::try_allocate( tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case); } else { eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case); + incr_allocated_bytes(var_size_in_bytes, con_size_in_bytes, t1); } } @@ -175,9 +186,19 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register } else { set((intx)markOopDesc::prototype(), t1); } - st_ptr(t1 , obj, oopDesc::mark_offset_in_bytes ()); - st_ptr(klass, obj, oopDesc::klass_offset_in_bytes ()); - if (len->is_valid()) st(len , obj, arrayOopDesc::length_offset_in_bytes()); + st_ptr(t1, obj, oopDesc::mark_offset_in_bytes()); + if (UseCompressedOops) { + // Save klass + mov(klass, t1); + encode_heap_oop_not_null(t1); + stw(t1, obj, oopDesc::klass_offset_in_bytes()); + } else { + st_ptr(klass, obj, oopDesc::klass_offset_in_bytes()); + } + if (len->is_valid()) st(len, obj, arrayOopDesc::length_offset_in_bytes()); + else if (UseCompressedOops) { + store_klass_gap(G0, obj); + } } @@ -194,7 +215,7 @@ void C1_MacroAssembler::initialize_body(Register base, Register index) { void C1_MacroAssembler::allocate_object( Register obj, // result: pointer to object after successful allocation Register t1, // temp register - Register t2, // temp register + Register t2, // temp register, must be a global register for try_allocate Register t3, // temp register int hdr_size, // object header size in words int obj_size, // object size in words @@ -225,7 +246,7 @@ void C1_MacroAssembler::initialize_object( Register t1, // temp register Register t2 // temp register ) { - const int hdr_size_in_bytes = instanceOopDesc::base_offset_in_bytes(); + const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize; initialize_header(obj, klass, noreg, t1, t2); diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp index 891d577ee67..c0178e5e0f8 100644 --- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_C1_MACROASSEMBLER_SPARC_HPP +#define CPU_SPARC_VM_C1_MACROASSEMBLER_SPARC_HPP + void pd_init() { /* nothing to do */ } public: @@ -84,3 +87,5 @@ // invalidates registers in this window void invalidate_registers(bool iregisters, bool lregisters, bool oregisters, Register preserve1 = noreg, Register preserve2 = noreg); + +#endif // CPU_SPARC_VM_C1_MACROASSEMBLER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp index 649e9b12388..7ce9a73b610 100644 --- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,20 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_Runtime1_sparc.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Defs.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "interpreter/interpreter.hpp" +#include "nativeInst_sparc.hpp" +#include "oops/compiledICHolderOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "register_sparc.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/signature.hpp" +#include "runtime/vframeArray.hpp" +#include "vmreg_sparc.inline.hpp" // Implementation of StubAssembler @@ -436,7 +448,9 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // get the instance size __ ld(G5_klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes(), G1_obj_size); + __ tlab_allocate(O0_obj, G1_obj_size, 0, G3_t1, slow_path); + __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2); __ verify_oop(O0_obj); __ mov(O0, I0); @@ -447,6 +461,8 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // get the instance size __ ld(G5_klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes(), G1_obj_size); __ eden_allocate(O0_obj, G1_obj_size, 0, G3_t1, G4_t2, slow_path); + __ incr_allocated_bytes(G1_obj_size, 0, G3_t1); + __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2); __ verify_oop(O0_obj); __ mov(O0, I0); @@ -561,6 +577,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ and3(G1_arr_size, ~MinObjAlignmentInBytesMask, G1_arr_size); __ eden_allocate(O0_obj, G1_arr_size, 0, G3_t1, O1_t2, slow_path); // preserves G1_arr_size + __ incr_allocated_bytes(G1_arr_size, 0, G3_t1); __ initialize_header(O0_obj, G5_klass, G4_length, G3_t1, O1_t2); __ ldub(klass_lh, G3_t1, klass_lh_header_size_offset); @@ -600,7 +617,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // load the klass and check the has finalizer flag Label register_finalizer; Register t = O1; - __ ld_ptr(O0, oopDesc::klass_offset_in_bytes(), t); + __ load_klass(O0, t); __ ld(t, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc), t); __ set(JVM_ACC_HAS_FINALIZER, G3); __ andcc(G3, t, G0); diff --git a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp index c1ca004f1ff..ef5900debf0 100644 --- a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp @@ -22,6 +22,12 @@ * */ +#ifndef CPU_SPARC_VM_C1_GLOBALS_SPARC_HPP +#define CPU_SPARC_VM_C1_GLOBALS_SPARC_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // Sets the default values for platform dependent flags used by the client compiler. // (see c1_globals.hpp) @@ -61,3 +67,5 @@ define_pd_global(bool, CSEArrayLength, true ); define_pd_global(bool, TwoOperandLIRForm, false); define_pd_global(intx, SafepointPollOffset, 0 ); + +#endif // CPU_SPARC_VM_C1_GLOBALS_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp index cb54d3ba767..0e870e63cc7 100644 --- a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp @@ -22,6 +22,12 @@ * */ +#ifndef CPU_SPARC_VM_C2_GLOBALS_SPARC_HPP +#define CPU_SPARC_VM_C2_GLOBALS_SPARC_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // Sets the default values for platform dependent flags used by the server compiler. // (see c2_globals.hpp). Alpha-sorted. @@ -88,3 +94,5 @@ define_pd_global(uintx,MaxPermSize, ScaleForWordSize(64*M)); // Ergonomics related flags define_pd_global(bool, NeverActAsServerClassMachine, false); + +#endif // CPU_SPARC_VM_C2_GLOBALS_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp b/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp index b82f89017e1..685a39dbf0f 100644 --- a/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c2_init_sparc.cpp.incl" +#include "precompiled.hpp" +#include "opto/compile.hpp" +#include "opto/node.hpp" // processor dependent initialization for sparc diff --git a/hotspot/src/cpu/sparc/vm/codeBuffer_sparc.hpp b/hotspot/src/cpu/sparc/vm/codeBuffer_sparc.hpp index 258ff281e7e..f1a371acf1e 100644 --- a/hotspot/src/cpu/sparc/vm/codeBuffer_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/codeBuffer_sparc.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_CODEBUFFER_SPARC_HPP +#define CPU_SPARC_VM_CODEBUFFER_SPARC_HPP + private: void pd_initialize() {} @@ -32,3 +35,5 @@ public: bool is_backward_branch(Label& L) { return L.is_bound() && insts_end() <= locator_address(L.loc()); } + +#endif // CPU_SPARC_VM_CODEBUFFER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/copy_sparc.hpp b/hotspot/src/cpu/sparc/vm/copy_sparc.hpp index e082ab8a687..0267d25a670 100644 --- a/hotspot/src/cpu/sparc/vm/copy_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/copy_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_COPY_SPARC_HPP +#define CPU_SPARC_VM_COPY_SPARC_HPP + // Inline functions for memory copy and fill. static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) { @@ -186,3 +189,5 @@ static void pd_zero_to_words(HeapWord* tohw, size_t count) { static void pd_zero_to_bytes(void* to, size_t count) { (void)memset(to, 0, count); } + +#endif // CPU_SPARC_VM_COPY_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp index 271f7b2729f..2dc68c74f63 100644 --- a/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP +#define CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP + static address frame_manager_return; static address frame_manager_sync_return; @@ -32,3 +35,5 @@ void generate_compute_interpreter_state(const Register state, const Register prev_state, bool native); + +#endif // CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp index c048ba34098..8cae2273632 100644 --- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,32 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_cppInterpreter_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/cppInterpreter.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/arguments.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/timer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" +#ifdef SHARK +#include "shark/shark_globals.hpp" +#endif #ifdef CC_INTERP diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp index 381ecc06abf..3d613f36a02 100644 --- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP +#define CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP + // Size of interpreter code. Increase if too small. Interpreter will // fail with a guarantee ("not enough space for interpreter generation"); // if too small. @@ -37,3 +40,5 @@ #else const static int InterpreterCodeSize = 180 * K; #endif + +#endif // CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/debug_sparc.cpp b/hotspot/src/cpu/sparc/vm/debug_sparc.cpp index 2958a5238ce..76441c0ceb0 100644 --- a/hotspot/src/cpu/sparc/vm/debug_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/debug_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,14 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_debug_sparc.cpp.incl" +#include "precompiled.hpp" +#include "code/codeCache.hpp" +#include "code/nmethod.hpp" +#include "runtime/frame.hpp" +#include "runtime/init.hpp" +#include "runtime/os.hpp" +#include "utilities/debug.hpp" +#include "utilities/top.hpp" #ifndef PRODUCT diff --git a/hotspot/src/cpu/sparc/vm/depChecker_sparc.cpp b/hotspot/src/cpu/sparc/vm/depChecker_sparc.cpp index 296a6c877b3..abb0243a2f6 100644 --- a/hotspot/src/cpu/sparc/vm/depChecker_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/depChecker_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_depChecker_sparc.cpp.incl" +#include "precompiled.hpp" +#include "compiler/disassembler.hpp" +#include "depChecker_sparc.hpp" // Nothing to do on Sparc diff --git a/hotspot/src/cpu/sparc/vm/depChecker_sparc.hpp b/hotspot/src/cpu/sparc/vm/depChecker_sparc.hpp index e484d8d7609..6e275437fae 100644 --- a/hotspot/src/cpu/sparc/vm/depChecker_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/depChecker_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,4 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_DEPCHECKER_SPARC_HPP +#define CPU_SPARC_VM_DEPCHECKER_SPARC_HPP + // Nothing to do on Sparc + +#endif // CPU_SPARC_VM_DEPCHECKER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp index caa6bd2a9a4..761d0e3810e 100644 --- a/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP +#define CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP + static int pd_instruction_alignment() { return sizeof(int); } @@ -30,3 +33,5 @@ return (VM_Version::v9_instructions_work()? (VM_Version::v8_instructions_work()? "" : "v9only") : "v8only"); } + +#endif // CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/dump_sparc.cpp b/hotspot/src/cpu/sparc/vm/dump_sparc.cpp index 60f3e1388fd..5bfa1cebffd 100644 --- a/hotspot/src/cpu/sparc/vm/dump_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/dump_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_dump_sparc.cpp.incl" +#include "precompiled.hpp" +#include "assembler_sparc.inline.hpp" +#include "memory/compactingPermGenGen.hpp" +#include "memory/generation.inline.hpp" +#include "memory/space.inline.hpp" diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp index 1ee91aedae0..e6fa47a5b75 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp @@ -22,8 +22,24 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_frame_sparc.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "memory/resourceArea.hpp" +#include "oops/markOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/monitorChunk.hpp" +#include "runtime/signature.hpp" +#include "runtime/stubCodeGenerator.hpp" +#include "runtime/stubRoutines.hpp" +#include "vmreg_sparc.inline.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#include "runtime/vframeArray.hpp" +#endif void RegisterMap::pd_clear() { if (_thread->has_last_Java_frame()) { diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp index 15a07f8492f..ed30d40e284 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp @@ -22,6 +22,12 @@ * */ +#ifndef CPU_SPARC_VM_FRAME_SPARC_HPP +#define CPU_SPARC_VM_FRAME_SPARC_HPP + +#include "runtime/synchronizer.hpp" +#include "utilities/top.hpp" + // A frame represents a physical stack frame (an activation). Frames can be // C or Java frames, and the Java frames can be interpreted or compiled. // In contrast, vframes represent source-level activations, so that one physical frame @@ -309,3 +315,5 @@ return reg->is_out() || reg->is_global(); #endif } + +#endif // CPU_SPARC_VM_FRAME_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp index 8fa763f095e..3a8bc79b823 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP +#define CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP + // Inline functions for SPARC frames: // Constructors @@ -295,3 +298,5 @@ inline oop frame::saved_oop_result(RegisterMap* map) const { inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) { *((oop*) map->location(O0->as_VMReg())) = obj; } + +#endif // CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP diff --git a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp index 21d41d73012..e90896c4919 100644 --- a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 @@ * */ +#ifndef CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP +#define CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP + // Size of Sparc Instructions const int BytesPerInstWord = 4; const int StackAlignmentInBytes = (2*wordSize); + +#endif // CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp index 2478ed38415..1854475a5a9 100644 --- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef CPU_SPARC_VM_GLOBALS_SPARC_HPP +#define CPU_SPARC_VM_GLOBALS_SPARC_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // Sets the default values for platform dependent flags used by the runtime system. // (see globals.hpp) @@ -62,3 +68,7 @@ define_pd_global(intx, PreInflateSpin, 40); // Determined by running desi define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); + +define_pd_global(bool, UseMembar, false); + +#endif // CPU_SPARC_VM_GLOBALS_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp b/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp index d192084face..6327cc7a554 100644 --- a/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_icBuffer_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_sparc.inline.hpp" +#include "code/icBuffer.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "interpreter/bytecodes.hpp" +#include "memory/resourceArea.hpp" +#include "nativeInst_sparc.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.inline2.hpp" int InlineCacheBuffer::ic_stub_code_size() { #ifdef _LP64 diff --git a/hotspot/src/cpu/sparc/vm/icache_sparc.cpp b/hotspot/src/cpu/sparc/vm/icache_sparc.cpp index 40ab79bc767..af7a4c09b01 100644 --- a/hotspot/src/cpu/sparc/vm/icache_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/icache_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_icache_sparc.cpp.incl" +#include "precompiled.hpp" +#include "assembler_sparc.inline.hpp" +#include "runtime/icache.hpp" #define __ _masm-> diff --git a/hotspot/src/cpu/sparc/vm/icache_sparc.hpp b/hotspot/src/cpu/sparc/vm/icache_sparc.hpp index e0b7579d9de..e3b5bad7aa1 100644 --- a/hotspot/src/cpu/sparc/vm/icache_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/icache_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_ICACHE_SPARC_HPP +#define CPU_SPARC_VM_ICACHE_SPARC_HPP + // Interface for updating the instruction cache. Whenever the VM modifies // code, part of the processor instruction cache potentially has to be flushed. @@ -36,3 +39,5 @@ class ICache : public AbstractICache { // Use default implementation }; + +#endif // CPU_SPARC_VM_ICACHE_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp index 91c3bc09fa0..ea17d6f574e 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp @@ -22,8 +22,26 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_interp_masm_sparc.cpp.incl" +#include "precompiled.hpp" +#include "interp_masm_sparc.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "oops/arrayOop.hpp" +#include "oops/markOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiRedefineClassesTrace.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/basicLock.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/sharedRuntime.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif #ifndef CC_INTERP #ifndef FAST_DISPATCH diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp index b893f9413a1..835dcac6836 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp @@ -22,6 +22,12 @@ * */ +#ifndef CPU_SPARC_VM_INTERP_MASM_SPARC_HPP +#define CPU_SPARC_VM_INTERP_MASM_SPARC_HPP + +#include "assembler_sparc.inline.hpp" +#include "interpreter/invocationCounter.hpp" + // This file specializes the assember with interpreter-specific macros REGISTER_DECLARATION( Register, Otos_i , O0); // tos for ints, etc @@ -327,3 +333,5 @@ class InterpreterMacroAssembler: public MacroAssembler { void restore_return_value(TosState state, bool is_native_call); }; + +#endif // CPU_SPARC_VM_INTERP_MASM_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp index 2478f089acf..ce3c3d48f69 100644 --- a/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP +#define CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP + friend class AbstractInterpreterGenerator; private: @@ -39,3 +42,5 @@ void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); void generate_counter_overflow(Label& Lcontinue); + +#endif // CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp index fb95f8ad4a3..bc7d556d517 100644 --- a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp @@ -22,8 +22,17 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_interpreterRT_sparc.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/universe.inline.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/icache.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/signature.hpp" #define __ _masm-> diff --git a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.hpp b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.hpp index 97f861cf37b..6d90042c013 100644 --- a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef CPU_SPARC_VM_INTERPRETERRT_SPARC_HPP +#define CPU_SPARC_VM_INTERPRETERRT_SPARC_HPP + +#include "memory/allocation.hpp" + static int binary_search(int key, LookupswitchPair* array, int n); static address iload (JavaThread* thread); @@ -54,3 +59,5 @@ class SignatureHandlerGenerator: public NativeSignatureIterator { // Code generation void generate( uint64_t fingerprint ); }; + +#endif // CPU_SPARC_VM_INTERPRETERRT_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp index e22ecde84db..503fb67d1dc 100644 --- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp @@ -22,8 +22,32 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_interpreter_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateTable.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/arguments.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/timer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp index 2f3bb3f6fa8..bc38d6e882f 100644 --- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_INTERPRETER_SPARC_HPP +#define CPU_SPARC_VM_INTERPRETER_SPARC_HPP + public: static int expr_offset_in_bytes(int i) { return stackElementSize * i + wordSize; } @@ -34,3 +37,5 @@ assert(i <= 0, "local direction already negated"); return stackElementWords * i; } + +#endif // CPU_SPARC_VM_INTERPRETER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp b/hotspot/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp index f9607f8fede..1b4b3bf2ffc 100644 --- a/hotspot/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_JAVAFRAMEANCHOR_SPARC_HPP +#define CPU_SPARC_VM_JAVAFRAMEANCHOR_SPARC_HPP + private: volatile int _flags; @@ -97,3 +100,5 @@ private: _flags |= flushed; OrderAccess::fence(); } + +#endif // CPU_SPARC_VM_JAVAFRAMEANCHOR_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp b/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp index f390efff1b9..e31fa87b3aa 100644 --- a/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp @@ -22,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_jniFastGetField_sparc.cpp.incl" +#include "precompiled.hpp" +#include "assembler_sparc.inline.hpp" +#include "memory/resourceArea.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm_misc.hpp" +#include "runtime/safepoint.hpp" // TSO ensures that loads are blocking and ordered with respect to // to earlier loads, so we don't need LoadLoad membars. diff --git a/hotspot/src/cpu/sparc/vm/jniTypes_sparc.hpp b/hotspot/src/cpu/sparc/vm/jniTypes_sparc.hpp index 1c91caac29f..9c3049141fd 100644 --- a/hotspot/src/cpu/sparc/vm/jniTypes_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/jniTypes_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef CPU_SPARC_VM_JNITYPES_SPARC_HPP +#define CPU_SPARC_VM_JNITYPES_SPARC_HPP + +#include "memory/allocation.hpp" +#include "oops/oop.hpp" +#include "prims/jni.h" + // This file holds platform-dependent routines used to write primitive jni // types to the array of arguments passed into JavaCalls::call @@ -106,3 +113,5 @@ public: #endif }; + +#endif // CPU_SPARC_VM_JNITYPES_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/jni_sparc.h b/hotspot/src/cpu/sparc/vm/jni_sparc.h index 9bb86a05c7e..9712dfc9d0d 100644 --- a/hotspot/src/cpu/sparc/vm/jni_sparc.h +++ b/hotspot/src/cpu/sparc/vm/jni_sparc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/methodHandles_sparc.cpp b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp index 887bfd63e63..2fb2e56d8b3 100644 --- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp @@ -22,11 +22,21 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_methodHandles_sparc.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "memory/allocation.inline.hpp" +#include "prims/methodHandles.hpp" #define __ _masm-> +#ifdef PRODUCT +#define BLOCK_COMMENT(str) /* nothing */ +#else +#define BLOCK_COMMENT(str) __ block_comment(str) +#endif + +#define BIND(label) bind(label); BLOCK_COMMENT(#label ":") + address MethodHandleEntry::start_compiled_entry(MacroAssembler* _masm, address interpreted_entry) { // Just before the actual machine code entry point, allocate space @@ -62,17 +72,29 @@ MethodHandleEntry* MethodHandleEntry::finish_compiled_entry(MacroAssembler* _mas // Code generation address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* _masm) { - // I5_savedSP: sender SP (must preserve) + // I5_savedSP/O5_savedSP: sender SP (must preserve) // G4 (Gargs): incoming argument list (must preserve) - // G5_method: invoke methodOop; becomes method type. + // G5_method: invoke methodOop // G3_method_handle: receiver method handle (must load from sp[MethodTypeForm.vmslots]) - // O0, O1: garbage temps, blown away - Register O0_argslot = O0; + // O0, O1, O2, O3, O4: garbage temps, blown away + Register O0_mtype = O0; Register O1_scratch = O1; + Register O2_scratch = O2; + Register O3_scratch = O3; + Register O4_argslot = O4; + Register O4_argbase = O4; // emit WrongMethodType path first, to enable back-branch from main path Label wrong_method_type; __ bind(wrong_method_type); + Label invoke_generic_slow_path; + assert(methodOopDesc::intrinsic_id_size_in_bytes() == sizeof(u1), "");; + __ ldub(Address(G5_method, methodOopDesc::intrinsic_id_offset_in_bytes()), O1_scratch); + __ cmp(O1_scratch, (int) vmIntrinsics::_invokeExact); + __ brx(Assembler::notEqual, false, Assembler::pt, invoke_generic_slow_path); + __ delayed()->nop(); + __ mov(O0_mtype, G5_method_type); // required by throw_WrongMethodType + // mov(G3_method_handle, G3_method_handle); // already in this register __ jump_to(AddressLiteral(Interpreter::throw_WrongMethodType_entry()), O1_scratch); __ delayed()->nop(); @@ -80,23 +102,74 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* __ align(CodeEntryAlignment); address entry_point = __ pc(); - // fetch the MethodType from the method handle into G5_method_type + // fetch the MethodType from the method handle { Register tem = G5_method; - assert(tem == G5_method_type, "yes, it's the same register"); for (jint* pchase = methodOopDesc::method_type_offsets_chain(); (*pchase) != -1; pchase++) { - __ ld_ptr(Address(tem, *pchase), G5_method_type); + __ ld_ptr(Address(tem, *pchase), O0_mtype); + tem = O0_mtype; // in case there is another indirection } } // given the MethodType, find out where the MH argument is buried - __ ld_ptr(Address(G5_method_type, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, O1_scratch)), O0_argslot); - __ ldsw( Address(O0_argslot, __ delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, O1_scratch)), O0_argslot); - __ ld_ptr(__ argument_address(O0_argslot), G3_method_handle); + __ load_heap_oop(Address(O0_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, O1_scratch)), O4_argslot); + __ ldsw( Address(O4_argslot, __ delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, O1_scratch)), O4_argslot); + __ add(Gargs, __ argument_offset(O4_argslot, 1), O4_argbase); + // Note: argument_address uses its input as a scratch register! + __ ld_ptr(Address(O4_argbase, -Interpreter::stackElementSize), G3_method_handle); - __ check_method_handle_type(G5_method_type, G3_method_handle, O1_scratch, wrong_method_type); + trace_method_handle(_masm, "invokeExact"); + + __ check_method_handle_type(O0_mtype, G3_method_handle, O1_scratch, wrong_method_type); __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); + // for invokeGeneric (only), apply argument and result conversions on the fly + __ bind(invoke_generic_slow_path); +#ifdef ASSERT + { Label L; + __ ldub(Address(G5_method, methodOopDesc::intrinsic_id_offset_in_bytes()), O1_scratch); + __ cmp(O1_scratch, (int) vmIntrinsics::_invokeGeneric); + __ brx(Assembler::equal, false, Assembler::pt, L); + __ delayed()->nop(); + __ stop("bad methodOop::intrinsic_id"); + __ bind(L); + } +#endif //ASSERT + + // make room on the stack for another pointer: + insert_arg_slots(_masm, 2 * stack_move_unit(), _INSERT_REF_MASK, O4_argbase, O1_scratch, O2_scratch, O3_scratch); + // load up an adapter from the calling type (Java weaves this) + Register O2_form = O2_scratch; + Register O3_adapter = O3_scratch; + __ load_heap_oop(Address(O0_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, O1_scratch)), O2_form); + // load_heap_oop(Address(O2_form, __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter); + // deal with old JDK versions: + __ add( Address(O2_form, __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter); + __ cmp(O3_adapter, O2_form); + Label sorry_no_invoke_generic; + __ brx(Assembler::lessUnsigned, false, Assembler::pn, sorry_no_invoke_generic); + __ delayed()->nop(); + + __ load_heap_oop(Address(O3_adapter, 0), O3_adapter); + __ tst(O3_adapter); + __ brx(Assembler::zero, false, Assembler::pn, sorry_no_invoke_generic); + __ delayed()->nop(); + __ st_ptr(O3_adapter, Address(O4_argbase, 1 * Interpreter::stackElementSize)); + // As a trusted first argument, pass the type being called, so the adapter knows + // the actual types of the arguments and return values. + // (Generic invokers are shared among form-families of method-type.) + __ st_ptr(O0_mtype, Address(O4_argbase, 0 * Interpreter::stackElementSize)); + // FIXME: assert that O3_adapter is of the right method-type. + __ mov(O3_adapter, G3_method_handle); + trace_method_handle(_masm, "invokeGeneric"); + __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); + + __ bind(sorry_no_invoke_generic); // no invokeGeneric implementation available! + __ mov(O0_mtype, G5_method_type); // required by throw_WrongMethodType + // mov(G3_method_handle, G3_method_handle); // already in this register + __ jump_to(AddressLiteral(Interpreter::throw_WrongMethodType_entry()), O1_scratch); + __ delayed()->nop(); + return entry_point; } @@ -105,6 +178,7 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* static void verify_argslot(MacroAssembler* _masm, Register argslot_reg, Register temp_reg, const char* error_message) { // Verify that argslot lies within (Gargs, FP]. Label L_ok, L_bad; + BLOCK_COMMENT("{ verify_argslot"); #ifdef _LP64 __ add(FP, STACK_BIAS, temp_reg); __ cmp(argslot_reg, temp_reg); @@ -119,6 +193,7 @@ static void verify_argslot(MacroAssembler* _masm, Register argslot_reg, Register __ bind(L_bad); __ stop(error_message); __ bind(L_ok); + BLOCK_COMMENT("} verify_argslot"); } #endif @@ -175,6 +250,7 @@ void MethodHandles::insert_arg_slots(MacroAssembler* _masm, // for (temp = sp + size; temp < argslot; temp++) // temp[-size] = temp[0] // argslot -= size; + BLOCK_COMMENT("insert_arg_slots {"); RegisterOrConstant offset = __ regcon_sll_ptr(arg_slots, LogBytesPerWord, temp3_reg); // Keep the stack pointer 2*wordSize aligned. @@ -187,7 +263,7 @@ void MethodHandles::insert_arg_slots(MacroAssembler* _masm, { Label loop; - __ bind(loop); + __ BIND(loop); // pull one word down each time through the loop __ ld_ptr(Address(temp_reg, 0), temp2_reg); __ st_ptr(temp2_reg, Address(temp_reg, offset)); @@ -199,6 +275,7 @@ void MethodHandles::insert_arg_slots(MacroAssembler* _masm, // Now move the argslot down, to point to the opened-up space. __ add(argslot_reg, offset, argslot_reg); + BLOCK_COMMENT("} insert_arg_slots"); } @@ -235,6 +312,7 @@ void MethodHandles::remove_arg_slots(MacroAssembler* _masm, } #endif // ASSERT + BLOCK_COMMENT("remove_arg_slots {"); // Pull up everything shallower than argslot. // Then remove the excess space on the stack. // The stacked return address gets pulled up with everything else. @@ -246,7 +324,7 @@ void MethodHandles::remove_arg_slots(MacroAssembler* _masm, __ sub(argslot_reg, wordSize, temp_reg); // source pointer for copy { Label loop; - __ bind(loop); + __ BIND(loop); // pull one word up each time through the loop __ ld_ptr(Address(temp_reg, 0), temp2_reg); __ st_ptr(temp2_reg, Address(temp_reg, offset)); @@ -265,29 +343,35 @@ void MethodHandles::remove_arg_slots(MacroAssembler* _masm, const int TwoWordAlignmentMask = right_n_bits(LogBytesPerWord + 1); RegisterOrConstant masked_offset = __ regcon_andn_ptr(offset, TwoWordAlignmentMask, temp_reg); __ add(SP, masked_offset, SP); + BLOCK_COMMENT("} remove_arg_slots"); } #ifndef PRODUCT extern "C" void print_method_handle(oop mh); void trace_method_handle_stub(const char* adaptername, - oop mh) { -#if 0 - intptr_t* entry_sp, - intptr_t* saved_sp, - intptr_t* saved_bp) { - // called as a leaf from native code: do not block the JVM! - intptr_t* last_sp = (intptr_t*) saved_bp[frame::interpreter_frame_last_sp_offset]; - intptr_t* base_sp = (intptr_t*) saved_bp[frame::interpreter_frame_monitor_block_top_offset]; - printf("MH %s mh="INTPTR_FORMAT" sp=("INTPTR_FORMAT"+"INTX_FORMAT") stack_size="INTX_FORMAT" bp="INTPTR_FORMAT"\n", - adaptername, (intptr_t)mh, (intptr_t)entry_sp, (intptr_t)(saved_sp - entry_sp), (intptr_t)(base_sp - last_sp), (intptr_t)saved_bp); - if (last_sp != saved_sp) - printf("*** last_sp="INTPTR_FORMAT"\n", (intptr_t)last_sp); -#endif - + oopDesc* mh) { printf("MH %s mh="INTPTR_FORMAT"\n", adaptername, (intptr_t) mh); print_method_handle(mh); } +void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adaptername) { + if (!TraceMethodHandles) return; + BLOCK_COMMENT("trace_method_handle {"); + // save: Gargs, O5_savedSP + __ save_frame(16); + __ set((intptr_t) adaptername, O0); + __ mov(G3_method_handle, O1); + __ mov(G3_method_handle, L3); + __ mov(Gargs, L4); + __ mov(G5_method_type, L5); + __ call_VM_leaf(L7, CAST_FROM_FN_PTR(address, trace_method_handle_stub)); + + __ mov(L3, G3_method_handle); + __ mov(L4, Gargs); + __ mov(L5, G5_method_type); + __ restore(); + BLOCK_COMMENT("} trace_method_handle"); +} #endif // PRODUCT // which conversion op types are implemented here? @@ -311,18 +395,23 @@ int MethodHandles::adapter_conversion_ops_supported_mask() { // // Generate an "entry" field for a method handle. // This determines how the method handle will respond to calls. -void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek) { +void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek, TRAPS) { // Here is the register state during an interpreted call, // as set up by generate_method_handle_interpreter_entry(): // - G5: garbage temp (was MethodHandle.invoke methodOop, unused) // - G3: receiver method handle // - O5_savedSP: sender SP (must preserve) - Register O0_argslot = O0; - Register O1_scratch = O1; - Register O2_scratch = O2; - Register O3_scratch = O3; - Register G5_index = G5; + const Register O0_argslot = O0; + const Register O1_scratch = O1; + const Register O2_scratch = O2; + const Register O3_scratch = O3; + const Register G5_index = G5; + + // Argument registers for _raise_exception. + const Register O0_code = O0; + const Register O1_actual = O1; + const Register O2_required = O2; guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets"); @@ -348,72 +437,50 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan } address interp_entry = __ pc(); - if (UseCompressedOops) __ unimplemented("UseCompressedOops"); -#ifndef PRODUCT - if (TraceMethodHandles) { - // save: Gargs, O5_savedSP - __ save(SP, -16*wordSize, SP); - __ set((intptr_t) entry_name(ek), O0); - __ mov(G3_method_handle, O1); - __ call_VM_leaf(Lscratch, CAST_FROM_FN_PTR(address, trace_method_handle_stub)); - __ restore(SP, 16*wordSize, SP); - } -#endif // PRODUCT + trace_method_handle(_masm, entry_name(ek)); switch ((int) ek) { case _raise_exception: { // Not a real MH entry, but rather shared code for raising an - // exception. Extra local arguments are passed in scratch - // registers, as required type in O3, failing object (or NULL) - // in O2, failing bytecode type in O1. + // exception. Since we use a C2I adapter to set up the + // interpreter state, arguments are expected in compiler + // argument registers. + methodHandle mh(raise_exception_method()); + address c2i_entry = methodOopDesc::make_adapters(mh, CATCH); __ mov(O5_savedSP, SP); // Cut the stack back to where the caller started. - // Push arguments as if coming from the interpreter. - Register O0_scratch = O0_argslot; - int stackElementSize = Interpreter::stackElementSize; - - // Make space on the stack for the arguments and set Gargs - // correctly. - __ sub(SP, 4*stackElementSize, SP); // Keep stack aligned. - __ add(SP, (frame::varargs_offset)*wordSize - 1*Interpreter::stackElementSize + STACK_BIAS + BytesPerWord, Gargs); - - // void raiseException(int code, Object actual, Object required) - __ st( O1_scratch, Address(Gargs, 2*stackElementSize)); // code - __ st_ptr(O2_scratch, Address(Gargs, 1*stackElementSize)); // actual - __ st_ptr(O3_scratch, Address(Gargs, 0*stackElementSize)); // required - - Label no_method; + Label L_no_method; // FIXME: fill in _raise_exception_method with a suitable sun.dyn method __ set(AddressLiteral((address) &_raise_exception_method), G5_method); __ ld_ptr(Address(G5_method, 0), G5_method); __ tst(G5_method); - __ brx(Assembler::zero, false, Assembler::pn, no_method); + __ brx(Assembler::zero, false, Assembler::pn, L_no_method); __ delayed()->nop(); - int jobject_oop_offset = 0; + const int jobject_oop_offset = 0; __ ld_ptr(Address(G5_method, jobject_oop_offset), G5_method); __ tst(G5_method); - __ brx(Assembler::zero, false, Assembler::pn, no_method); + __ brx(Assembler::zero, false, Assembler::pn, L_no_method); __ delayed()->nop(); __ verify_oop(G5_method); - __ jump_indirect_to(G5_method_fie, O1_scratch); + __ jump_to(AddressLiteral(c2i_entry), O3_scratch); __ delayed()->nop(); // If we get here, the Java runtime did not do its job of creating the exception. // Do something that is at least causes a valid throw from the interpreter. - __ bind(no_method); - __ unimplemented("_raise_exception no method"); + __ bind(L_no_method); + __ unimplemented("call throw_WrongMethodType_entry"); } break; case _invokestatic_mh: case _invokespecial_mh: { - __ ld_ptr(G3_mh_vmtarget, G5_method); // target is a methodOop + __ load_heap_oop(G3_mh_vmtarget, G5_method); // target is a methodOop __ verify_oop(G5_method); // Same as TemplateTable::invokestatic or invokespecial, // minus the CP setup and profiling: @@ -468,7 +535,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan // minus the CP setup and profiling: __ load_method_handle_vmslots(O0_argslot, G3_method_handle, O1_scratch); Register O1_intf = O1_scratch; - __ ld_ptr(G3_mh_vmtarget, O1_intf); + __ load_heap_oop(G3_mh_vmtarget, O1_intf); __ ldsw(G3_dmh_vmindex, G5_index); __ ld_ptr(__ argument_address(O0_argslot, -1), G3_method_handle); __ null_check(G3_method_handle, oopDesc::klass_offset_in_bytes()); @@ -496,10 +563,10 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan // Throw an exception. // For historical reasons, it will be IncompatibleClassChangeError. __ unimplemented("not tested yet"); - __ ld_ptr(Address(O1_intf, java_mirror_offset), O3_scratch); // required interface - __ mov(O0_klass, O2_scratch); // bad receiver - __ jump_to(AddressLiteral(from_interpreted_entry(_raise_exception)), O0_argslot); - __ delayed()->mov(Bytecodes::_invokeinterface, O1_scratch); // who is complaining? + __ ld_ptr(Address(O1_intf, java_mirror_offset), O2_required); // required interface + __ mov( O0_klass, O1_actual); // bad receiver + __ jump_to(AddressLiteral(from_interpreted_entry(_raise_exception)), O3_scratch); + __ delayed()->mov(Bytecodes::_invokeinterface, O0_code); // who is complaining? } break; @@ -523,7 +590,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan insert_arg_slots(_masm, arg_slots * stack_move_unit(), arg_mask, O0_argslot, O1_scratch, O2_scratch, G5_index); // Store bound argument into the new stack slot: - __ ld_ptr(G3_bmh_argument, O1_scratch); + __ load_heap_oop(G3_bmh_argument, O1_scratch); if (arg_type == T_OBJECT) { __ st_ptr(O1_scratch, Address(O0_argslot, 0)); } else { @@ -541,12 +608,12 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan } if (direct_to_method) { - __ ld_ptr(G3_mh_vmtarget, G5_method); // target is a methodOop + __ load_heap_oop(G3_mh_vmtarget, G5_method); // target is a methodOop __ verify_oop(G5_method); __ jump_indirect_to(G5_method_fie, O1_scratch); __ delayed()->nop(); } else { - __ ld_ptr(G3_mh_vmtarget, G3_method_handle); // target is a methodOop + __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); // target is a methodOop __ verify_oop(G3_method_handle); __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); } @@ -556,7 +623,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan case _adapter_retype_only: case _adapter_retype_raw: // Immediately jump to the next MH layer: - __ ld_ptr(G3_mh_vmtarget, G3_method_handle); + __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); // This is OK when all parameter types widen. // It is also OK when a return type narrows. @@ -572,8 +639,8 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan Address vmarg = __ argument_address(O0_argslot); // What class are we casting to? - __ ld_ptr(G3_amh_argument, G5_klass); // This is a Class object! - __ ld_ptr(Address(G5_klass, java_lang_Class::klass_offset_in_bytes()), G5_klass); + __ load_heap_oop(G3_amh_argument, G5_klass); // This is a Class object! + __ load_heap_oop(Address(G5_klass, java_lang_Class::klass_offset_in_bytes()), G5_klass); Label done; __ ld_ptr(vmarg, O1_scratch); @@ -589,15 +656,14 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan __ check_klass_subtype(O1_scratch, G5_klass, O0_argslot, O2_scratch, done); // If we get here, the type check failed! - __ ldsw(G3_amh_vmargslot, O0_argslot); // reload argslot field - __ ld_ptr(G3_amh_argument, O3_scratch); // required class - __ ld_ptr(vmarg, O2_scratch); // bad object - __ jump_to(AddressLiteral(from_interpreted_entry(_raise_exception)), O0_argslot); - __ delayed()->mov(Bytecodes::_checkcast, O1_scratch); // who is complaining? + __ load_heap_oop(G3_amh_argument, O2_required); // required class + __ ld_ptr( vmarg, O1_actual); // bad object + __ jump_to(AddressLiteral(from_interpreted_entry(_raise_exception)), O3_scratch); + __ delayed()->mov(Bytecodes::_checkcast, O0_code); // who is complaining? __ bind(done); // Get the new MH: - __ ld_ptr(G3_mh_vmtarget, G3_method_handle); + __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); } break; @@ -615,16 +681,34 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan { // Perform an in-place conversion to int or an int subword. __ ldsw(G3_amh_vmargslot, O0_argslot); - Address vmarg = __ argument_address(O0_argslot); Address value; + Address vmarg = __ argument_address(O0_argslot); bool value_left_justified = false; switch (ek) { case _adapter_opt_i2i: - case _adapter_opt_l2i: - __ unimplemented(entry_name(ek)); value = vmarg; break; + case _adapter_opt_l2i: + { + // just delete the extra slot +#ifdef _LP64 + // In V9, longs are given 2 64-bit slots in the interpreter, but the + // data is passed in only 1 slot. + // Keep the second slot. + __ add(Gargs, __ argument_offset(O0_argslot, -1), O0_argslot); + remove_arg_slots(_masm, -stack_move_unit(), O0_argslot, O1_scratch, O2_scratch, O3_scratch); + value = Address(O0_argslot, 4); // Get least-significant 32-bit of 64-bit value. + vmarg = Address(O0_argslot, Interpreter::stackElementSize); +#else + // Keep the first slot. + __ add(Gargs, __ argument_offset(O0_argslot), O0_argslot); + remove_arg_slots(_masm, -stack_move_unit(), O0_argslot, O1_scratch, O2_scratch, O3_scratch); + value = Address(O0_argslot, 0); + vmarg = value; +#endif + } + break; case _adapter_opt_unboxi: { // Load the value up from the heap. @@ -676,7 +760,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan __ st(O1_scratch, vmarg); // Get the new MH: - __ ld_ptr(G3_mh_vmtarget, G3_method_handle); + __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); } break; @@ -721,7 +805,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan ShouldNotReachHere(); } - __ ld_ptr(G3_mh_vmtarget, G3_method_handle); + __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); } break; @@ -851,7 +935,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan } } - __ ld_ptr(G3_mh_vmtarget, G3_method_handle); + __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); } break; @@ -895,7 +979,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan __ brx(Assembler::less, false, Assembler::pt, loop); __ delayed()->nop(); // FILLME - __ ld_ptr(G3_mh_vmtarget, G3_method_handle); + __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); } break; @@ -913,7 +997,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan remove_arg_slots(_masm, G5_stack_move, O0_argslot, O1_scratch, O2_scratch, O3_scratch); - __ ld_ptr(G3_mh_vmtarget, G3_method_handle); + __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); } break; diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp index 3c578c95e1f..d38c979fa87 100644 --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp @@ -22,8 +22,18 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_nativeInst_sparc.cpp.incl" +#include "precompiled.hpp" +#include "assembler_sparc.inline.hpp" +#include "memory/resourceArea.hpp" +#include "nativeInst_sparc.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "utilities/ostream.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif bool NativeInstruction::is_dtrace_trap() { diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp index b5d2aac6dec..3ecb6d93720 100644 --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,15 @@ * */ +#ifndef CPU_SPARC_VM_NATIVEINST_SPARC_HPP +#define CPU_SPARC_VM_NATIVEINST_SPARC_HPP + +#include "asm/assembler.hpp" +#include "memory/allocation.hpp" +#include "runtime/icache.hpp" +#include "runtime/os.hpp" +#include "utilities/top.hpp" + // We have interface for the following instructions: // - NativeInstruction // - - NativeCall @@ -913,3 +922,5 @@ class NativeIllegalInstruction: public NativeInstruction { // Insert illegal opcode as specific address static void insert(address code_pos); }; + +#endif // CPU_SPARC_VM_NATIVEINST_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp b/hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp index 79a9456fc9c..0ce8294663f 100644 --- a/hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_REGISTERMAP_SPARC_HPP +#define CPU_SPARC_VM_REGISTERMAP_SPARC_HPP + // machine-dependent implemention for register maps friend class frame; @@ -51,3 +54,5 @@ void shift_individual_registers(); // When popping out of compiled frames, we make all IRegs disappear. void make_integer_regs_unsaved() { _location_valid[0] = 0; } + +#endif // CPU_SPARC_VM_REGISTERMAP_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp b/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp index a726217fd0a..03d08ddfa35 100644 --- a/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp @@ -25,8 +25,11 @@ // make sure the defines don't screw up the declarations later on in this file #define DONT_USE_REGISTER_DEFINES -#include "incls/_precompiled.incl" -#include "incls/_register_definitions_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "asm/register.hpp" +#include "interp_masm_sparc.hpp" +#include "register_sparc.hpp" REGISTER_DEFINITION(Register, noreg); diff --git a/hotspot/src/cpu/sparc/vm/register_sparc.cpp b/hotspot/src/cpu/sparc/vm/register_sparc.cpp index bf6f872b44f..4ed28c6a0b5 100644 --- a/hotspot/src/cpu/sparc/vm/register_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/register_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,8 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_register_sparc.cpp.incl" +#include "precompiled.hpp" +#include "register_sparc.hpp" const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers << 1; const int ConcreteRegisterImpl::max_fpr = ConcreteRegisterImpl::max_gpr + FloatRegisterImpl::number_of_registers; diff --git a/hotspot/src/cpu/sparc/vm/register_sparc.hpp b/hotspot/src/cpu/sparc/vm/register_sparc.hpp index 3f1eb90285e..945866e539f 100644 --- a/hotspot/src/cpu/sparc/vm/register_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/register_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef CPU_SPARC_VM_REGISTER_SPARC_HPP +#define CPU_SPARC_VM_REGISTER_SPARC_HPP + +#include "asm/register.hpp" +#include "vm_version_sparc.hpp" + // forward declaration class Address; class VMRegImpl; @@ -440,3 +446,5 @@ class QuadFloatRegisterImpl { return as_FloatRegister( ((encoding & 1) << 5) | (encoding & 0x1c) ); } }; + +#endif // CPU_SPARC_VM_REGISTER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp index a96f6a674a8..d2cefd35d55 100644 --- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_relocInfo_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.inline.hpp" +#include "assembler_sparc.inline.hpp" +#include "code/relocInfo.hpp" +#include "nativeInst_sparc.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/safepoint.hpp" void Relocation::pd_set_data_value(address x, intptr_t o) { NativeInstruction* ip = nativeInstruction_at(addr()); diff --git a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp index 626e117a49f..a2d3b2c3928 100644 --- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_RELOCINFO_SPARC_HPP +#define CPU_SPARC_VM_RELOCINFO_SPARC_HPP + // machine-dependent parts of class relocInfo private: enum { @@ -49,3 +52,5 @@ // 1.8 99/06/22 16:37:50 relocInfo_i486.hpp // 1.9 99/07/16 11:12:11 relocInfo_i486.hpp //End + +#endif // CPU_SPARC_VM_RELOCINFO_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp b/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp index e6f641e26b7..560e67a2113 100644 --- a/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp @@ -22,8 +22,22 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_runtime_sparc.cpp.incl" +#include "precompiled.hpp" +#ifdef COMPILER2 +#include "asm/assembler.hpp" +#include "assembler_sparc.inline.hpp" +#include "classfile/systemDictionary.hpp" +#include "code/vmreg.hpp" +#include "interpreter/interpreter.hpp" +#include "nativeInst_sparc.hpp" +#include "opto/runtime.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/globalDefinitions.hpp" +#include "vmreg_sparc.inline.hpp" +#endif #define __ masm-> diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index bae042e8f66..751b512084d 100644 --- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp @@ -22,8 +22,28 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_sharedRuntime_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_sparc.inline.hpp" +#include "code/debugInfoRec.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "interpreter/interpreter.hpp" +#include "oops/compiledICHolderOop.hpp" +#include "prims/jvmtiRedefineClassesTrace.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/vframeArray.hpp" +#include "vmreg_sparc.inline.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif +#ifdef SHARK +#include "compiler/compileBroker.hpp" +#include "shark/sharkCompiler.hpp" +#endif #define __ masm-> diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index fc18cf0ee3c..25117f205b2 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -667,6 +667,20 @@ intptr_t get_offset_from_base_2(const MachNode* n, const TypePtr* atype, int dis return offset; } +static inline jdouble replicate_immI(int con, int count, int width) { + // Load a constant replicated "count" times with width "width" + int bit_width = width * 8; + jlong elt_val = con; + elt_val &= (((jlong) 1) << bit_width) - 1; // mask off sign bits + jlong val = elt_val; + for (int i = 0; i < count - 1; i++) { + val <<= bit_width; + val |= elt_val; + } + jdouble dval = *((jdouble*) &val); // coerce to double type + return dval; +} + // Standard Sparc opcode form2 field breakdown static inline void emit2_19(CodeBuffer &cbuf, int f30, int f29, int f25, int f22, int f20, int f19, int f0 ) { f0 &= (1<<19)-1; // Mask displacement to 19 bits @@ -1007,6 +1021,90 @@ void emit_lo(CodeBuffer &cbuf, int val) { } void emit_hi(CodeBuffer &cbuf, int val) { } +//============================================================================= +const bool Matcher::constant_table_absolute_addressing = false; +const RegMask& MachConstantBaseNode::_out_RegMask = PTR_REG_mask; + +void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const { + Compile* C = ra_->C; + Compile::ConstantTable& constant_table = C->constant_table(); + MacroAssembler _masm(&cbuf); + + Register r = as_Register(ra_->get_encode(this)); + CodeSection* cs = __ code()->consts(); + int consts_size = cs->align_at_start(cs->size()); + + if (UseRDPCForConstantTableBase) { + // For the following RDPC logic to work correctly the consts + // section must be allocated right before the insts section. This + // assert checks for that. The layout and the SECT_* constants + // are defined in src/share/vm/asm/codeBuffer.hpp. + assert(CodeBuffer::SECT_CONSTS + 1 == CodeBuffer::SECT_INSTS, "must be"); + int offset = __ offset(); + int disp; + + // If the displacement from the current PC to the constant table + // base fits into simm13 we set the constant table base to the + // current PC. + if (__ is_simm13(-(consts_size + offset))) { + constant_table.set_table_base_offset(-(consts_size + offset)); + disp = 0; + } else { + // If the offset of the top constant (last entry in the table) + // fits into simm13 we set the constant table base to the actual + // table base. + if (__ is_simm13(constant_table.top_offset())) { + constant_table.set_table_base_offset(0); + disp = consts_size + offset; + } else { + // Otherwise we set the constant table base in the middle of the + // constant table. + int half_consts_size = consts_size / 2; + assert(half_consts_size * 2 == consts_size, "sanity"); + constant_table.set_table_base_offset(-half_consts_size); // table base offset gets added to the load displacement. + disp = half_consts_size + offset; + } + } + + __ rdpc(r); + + if (disp != 0) { + assert(r != O7, "need temporary"); + __ sub(r, __ ensure_simm13_or_reg(disp, O7), r); + } + } + else { + // Materialize the constant table base. + assert(constant_table.size() == consts_size, err_msg("must be: %d == %d", constant_table.size(), consts_size)); + address baseaddr = cs->start() + -(constant_table.table_base_offset()); + RelocationHolder rspec = internal_word_Relocation::spec(baseaddr); + AddressLiteral base(baseaddr, rspec); + __ set(base, r); + } +} + +uint MachConstantBaseNode::size(PhaseRegAlloc*) const { + if (UseRDPCForConstantTableBase) { + // This is really the worst case but generally it's only 1 instruction. + return (1 /*rdpc*/ + 1 /*sub*/ + MacroAssembler::worst_case_insts_for_set()) * BytesPerInstWord; + } else { + return MacroAssembler::worst_case_insts_for_set() * BytesPerInstWord; + } +} + +#ifndef PRODUCT +void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const { + char reg[128]; + ra_->dump_register(this, reg); + if (UseRDPCForConstantTableBase) { + st->print("RDPC %s\t! constant table base", reg); + } else { + st->print("SET &constanttable,%s\t! constant table base", reg); + } +} +#endif + + //============================================================================= #ifndef PRODUCT @@ -1142,7 +1240,7 @@ const Pipeline * MachEpilogNode::pipeline() const { int MachEpilogNode::safepoint_offset() const { assert( do_polling(), "no return for this epilog node"); - return MacroAssembler::size_of_sethi(os::get_polling_page()); + return MacroAssembler::insts_for_sethi(os::get_polling_page()) * BytesPerInstWord; } //============================================================================= @@ -1843,6 +1941,12 @@ bool Matcher::is_spillable_arg( int reg ) { return can_be_java_arg(reg); } +bool Matcher::use_asm_for_ldiv_by_con( jlong divisor ) { + // Use hardware SDIVX instruction when it is + // faster than a code which use multiply. + return VM_Version::has_fast_idiv(); +} + // Register for DIVI projection of divmodI RegMask Matcher::divI_proj_mask() { ShouldNotReachHere(); @@ -2241,25 +2345,6 @@ encode %{ __ delayed()->nop(); %} - enc_class jump_enc( iRegX switch_val, o7RegI table) %{ - MacroAssembler _masm(&cbuf); - - Register switch_reg = as_Register($switch_val$$reg); - Register table_reg = O7; - - address table_base = __ address_table_constant(_index2label); - RelocationHolder rspec = internal_word_Relocation::spec(table_base); - - // Move table address into a register. - __ set(table_base, table_reg, rspec); - - // Jump to base address + switch value - __ ld_ptr(table_reg, switch_reg, table_reg); - __ jmp(table_reg, G0); - __ delayed()->nop(); - - %} - enc_class enc_ba( Label labl ) %{ MacroAssembler _masm(&cbuf); Label &L = *($labl$$label); @@ -2378,20 +2463,6 @@ encode %{ cbuf.insts()->emit_int32(op); %} - // Utility encoding for loading a 64 bit Pointer into a register - // The 64 bit pointer is stored in the generated code stream - enc_class SetPtr( immP src, iRegP rd ) %{ - Register dest = reg_to_register_object($rd$$reg); - MacroAssembler _masm(&cbuf); - // [RGV] This next line should be generated from ADLC - if ( _opnds[1]->constant_is_oop() ) { - intptr_t val = $src$$constant; - __ set_oop_constant((jobject)val, dest); - } else { // non-oop pointers, e.g. card mark base, heap top - __ set($src$$constant, dest); - } - %} - enc_class Set13( immI13 src, iRegI rd ) %{ emit3_simm13( cbuf, Assembler::arith_op, $rd$$reg, Assembler::or_op3, 0, $src$$constant ); %} @@ -2405,10 +2476,6 @@ encode %{ __ set($src$$constant, reg_to_register_object($rd$$reg)); %} - enc_class SetNull( iRegI rd ) %{ - emit3_simm13( cbuf, Assembler::arith_op, $rd$$reg, Assembler::or_op3, 0, 0 ); - %} - enc_class call_epilog %{ if( VerifyStackAtCalls ) { MacroAssembler _masm(&cbuf); @@ -2772,35 +2839,6 @@ enc_class Fast_Unlock(iRegP oop, iRegP box, o7RegP scratch, iRegP scratch2) %{ __ float_cmp( $primary, -1, Fsrc1, Fsrc2, Rdst); %} - enc_class LdImmL (immL src, iRegL dst, o7RegL tmp) %{ // Load Immediate - MacroAssembler _masm(&cbuf); - Register dest = reg_to_register_object($dst$$reg); - Register temp = reg_to_register_object($tmp$$reg); - __ set64( $src$$constant, dest, temp ); - %} - - enc_class LdReplImmI(immI src, regD dst, o7RegP tmp, int count, int width) %{ - // Load a constant replicated "count" times with width "width" - int bit_width = $width$$constant * 8; - jlong elt_val = $src$$constant; - elt_val &= (((jlong)1) << bit_width) - 1; // mask off sign bits - jlong val = elt_val; - for (int i = 0; i < $count$$constant - 1; i++) { - val <<= bit_width; - val |= elt_val; - } - jdouble dval = *(jdouble*)&val; // coerce to double type - MacroAssembler _masm(&cbuf); - address double_address = __ double_constant(dval); - RelocationHolder rspec = internal_word_Relocation::spec(double_address); - AddressLiteral addrlit(double_address, rspec); - - __ sethi(addrlit, $tmp$$Register); - // XXX This is a quick fix for 6833573. - //__ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec); - __ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), as_DoubleFloatRegister($dst$$reg), rspec); - %} - // Compiler ensures base is doubleword aligned and cnt is count of doublewords enc_class enc_Clear_Array(iRegX cnt, iRegP base, iRegX temp) %{ MacroAssembler _masm(&cbuf); @@ -3515,6 +3553,42 @@ operand immP() %{ interface(CONST_INTER); %} +#ifdef _LP64 +// Pointer Immediate: 64-bit +operand immP_set() %{ + predicate(!VM_Version::is_niagara_plus()); + match(ConP); + + op_cost(5); + // formats are generated automatically for constants and base registers + format %{ %} + interface(CONST_INTER); +%} + +// Pointer Immediate: 64-bit +// From Niagara2 processors on a load should be better than materializing. +operand immP_load() %{ + predicate(VM_Version::is_niagara_plus() && (n->bottom_type()->isa_oop_ptr() || (MacroAssembler::insts_for_set(n->get_ptr()) > 3))); + match(ConP); + + op_cost(5); + // formats are generated automatically for constants and base registers + format %{ %} + interface(CONST_INTER); +%} + +// Pointer Immediate: 64-bit +operand immP_no_oop_cheap() %{ + predicate(VM_Version::is_niagara_plus() && !n->bottom_type()->isa_oop_ptr() && (MacroAssembler::insts_for_set(n->get_ptr()) <= 3)); + match(ConP); + + op_cost(5); + // formats are generated automatically for constants and base registers + format %{ %} + interface(CONST_INTER); +%} +#endif + operand immP13() %{ predicate((-4096 < n->get_ptr()) && (n->get_ptr() <= 4095)); match(ConP); @@ -3610,6 +3684,26 @@ operand immL_32bits() %{ interface(CONST_INTER); %} +// Long Immediate: cheap (materialize in <= 3 instructions) +operand immL_cheap() %{ + predicate(!VM_Version::is_niagara_plus() || MacroAssembler::insts_for_set64(n->get_long()) <= 3); + match(ConL); + op_cost(0); + + format %{ %} + interface(CONST_INTER); +%} + +// Long Immediate: expensive (materialize in > 3 instructions) +operand immL_expensive() %{ + predicate(VM_Version::is_niagara_plus() && MacroAssembler::insts_for_set64(n->get_long()) > 3); + match(ConL); + op_cost(0); + + format %{ %} + interface(CONST_INTER); +%} + // Double Immediate operand immD() %{ match(ConD); @@ -5975,25 +6069,69 @@ instruct loadConI13( iRegI dst, immI13 src ) %{ ins_pipe(ialu_imm); %} -instruct loadConP(iRegP dst, immP src) %{ - match(Set dst src); +#ifndef _LP64 +instruct loadConP(iRegP dst, immP con) %{ + match(Set dst con); ins_cost(DEFAULT_COST * 3/2); - format %{ "SET $src,$dst\t!ptr" %} - // This rule does not use "expand" unlike loadConI because then - // the result type is not known to be an Oop. An ADLC - // enhancement will be needed to make that work - not worth it! - - ins_encode( SetPtr( src, dst ) ); + format %{ "SET $con,$dst\t!ptr" %} + ins_encode %{ + // [RGV] This next line should be generated from ADLC + if (_opnds[1]->constant_is_oop()) { + intptr_t val = $con$$constant; + __ set_oop_constant((jobject) val, $dst$$Register); + } else { // non-oop pointers, e.g. card mark base, heap top + __ set($con$$constant, $dst$$Register); + } + %} ins_pipe(loadConP); - %} +#else +instruct loadConP_set(iRegP dst, immP_set con) %{ + match(Set dst con); + ins_cost(DEFAULT_COST * 3/2); + format %{ "SET $con,$dst\t! ptr" %} + ins_encode %{ + // [RGV] This next line should be generated from ADLC + if (_opnds[1]->constant_is_oop()) { + intptr_t val = $con$$constant; + __ set_oop_constant((jobject) val, $dst$$Register); + } else { // non-oop pointers, e.g. card mark base, heap top + __ set($con$$constant, $dst$$Register); + } + %} + ins_pipe(loadConP); +%} + +instruct loadConP_load(iRegP dst, immP_load con) %{ + match(Set dst con); + ins_cost(MEMORY_REF_COST); + format %{ "LD [$constanttablebase + $constantoffset],$dst\t! load from constant table: ptr=$con" %} + ins_encode %{ + RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $dst$$Register); + __ ld_ptr($constanttablebase, con_offset, $dst$$Register); + %} + ins_pipe(loadConP); +%} + +instruct loadConP_no_oop_cheap(iRegP dst, immP_no_oop_cheap con) %{ + match(Set dst con); + ins_cost(DEFAULT_COST * 3/2); + format %{ "SET $con,$dst\t! non-oop ptr" %} + ins_encode %{ + __ set($con$$constant, $dst$$Register); + %} + ins_pipe(loadConP); +%} +#endif // _LP64 instruct loadConP0(iRegP dst, immP0 src) %{ match(Set dst src); size(4); format %{ "CLR $dst\t!ptr" %} - ins_encode( SetNull( dst ) ); + ins_encode %{ + __ clr($dst$$Register); + %} ins_pipe(ialu_imm); %} @@ -6013,7 +6151,9 @@ instruct loadConN0(iRegN dst, immN0 src) %{ size(4); format %{ "CLR $dst\t! compressed NULL ptr" %} - ins_encode( SetNull( dst ) ); + ins_encode %{ + __ clr($dst$$Register); + %} ins_pipe(ialu_imm); %} @@ -6028,13 +6168,27 @@ instruct loadConN(iRegN dst, immN src) %{ ins_pipe(ialu_hi_lo_reg); %} -instruct loadConL(iRegL dst, immL src, o7RegL tmp) %{ - // %%% maybe this should work like loadConD - match(Set dst src); +// Materialize long value (predicated by immL_cheap). +instruct loadConL_set64(iRegL dst, immL_cheap con, o7RegL tmp) %{ + match(Set dst con); effect(KILL tmp); - ins_cost(DEFAULT_COST * 4); - format %{ "SET64 $src,$dst KILL $tmp\t! long" %} - ins_encode( LdImmL(src, dst, tmp) ); + ins_cost(DEFAULT_COST * 3); + format %{ "SET64 $con,$dst KILL $tmp\t! cheap long" %} + ins_encode %{ + __ set64($con$$constant, $dst$$Register, $tmp$$Register); + %} + ins_pipe(loadConL); +%} + +// Load long value from constant table (predicated by immL_expensive). +instruct loadConL_ldx(iRegL dst, immL_expensive con) %{ + match(Set dst con); + ins_cost(MEMORY_REF_COST); + format %{ "LDX [$constanttablebase + $constantoffset],$dst\t! load from constant table: long=$con" %} + ins_encode %{ + RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $dst$$Register); + __ ldx($constanttablebase, con_offset, $dst$$Register); + %} ins_pipe(loadConL); %} @@ -6057,50 +6211,26 @@ instruct loadConL13( iRegL dst, immL13 src ) %{ ins_pipe(ialu_imm); %} -instruct loadConF(regF dst, immF src, o7RegP tmp) %{ - match(Set dst src); +instruct loadConF(regF dst, immF con, o7RegI tmp) %{ + match(Set dst con); effect(KILL tmp); - -#ifdef _LP64 - size(8*4); -#else - size(2*4); -#endif - - format %{ "SETHI hi(&$src),$tmp\t!get float $src from table\n\t" - "LDF [$tmp+lo(&$src)],$dst" %} + format %{ "LDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: float=$con" %} ins_encode %{ - address float_address = __ float_constant($src$$constant); - RelocationHolder rspec = internal_word_Relocation::spec(float_address); - AddressLiteral addrlit(float_address, rspec); - - __ sethi(addrlit, $tmp$$Register); - __ ldf(FloatRegisterImpl::S, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec); + RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $tmp$$Register); + __ ldf(FloatRegisterImpl::S, $constanttablebase, con_offset, $dst$$FloatRegister); %} ins_pipe(loadConFD); %} -instruct loadConD(regD dst, immD src, o7RegP tmp) %{ - match(Set dst src); +instruct loadConD(regD dst, immD con, o7RegI tmp) %{ + match(Set dst con); effect(KILL tmp); - -#ifdef _LP64 - size(8*4); -#else - size(2*4); -#endif - - format %{ "SETHI hi(&$src),$tmp\t!get double $src from table\n\t" - "LDDF [$tmp+lo(&$src)],$dst" %} + format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: double=$con" %} ins_encode %{ - address double_address = __ double_constant($src$$constant); - RelocationHolder rspec = internal_word_Relocation::spec(double_address); - AddressLiteral addrlit(double_address, rspec); - - __ sethi(addrlit, $tmp$$Register); // XXX This is a quick fix for 6833573. - //__ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec); - __ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), as_DoubleFloatRegister($dst$$reg), rspec); + //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset($con), $dst$$FloatRegister); + RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $tmp$$Register); + __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg)); %} ins_pipe(loadConFD); %} @@ -8552,16 +8682,16 @@ instruct Repl8B_reg(stackSlotD dst, iRegI src) %{ %} // Replicate scalar constant to packed byte values in Double register -instruct Repl8B_immI(regD dst, immI13 src, o7RegP tmp) %{ - match(Set dst (Replicate8B src)); -#ifdef _LP64 - size(36); -#else - size(8); -#endif - format %{ "SETHI hi(&Repl8($src)),$tmp\t!get Repl8B($src) from table\n\t" - "LDDF [$tmp+lo(&Repl8($src))],$dst" %} - ins_encode( LdReplImmI(src, dst, tmp, (8), (1)) ); +instruct Repl8B_immI(regD dst, immI13 con, o7RegI tmp) %{ + match(Set dst (Replicate8B con)); + effect(KILL tmp); + format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl8B($con)" %} + ins_encode %{ + // XXX This is a quick fix for 6833573. + //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 8, 1)), $dst$$FloatRegister); + RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 8, 1)), $tmp$$Register); + __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg)); + %} ins_pipe(loadConFD); %} @@ -8588,16 +8718,16 @@ instruct Repl4C_reg(stackSlotD dst, iRegI src) %{ %} // Replicate scalar constant to packed char values in Double register -instruct Repl4C_immI(regD dst, immI src, o7RegP tmp) %{ - match(Set dst (Replicate4C src)); -#ifdef _LP64 - size(36); -#else - size(8); -#endif - format %{ "SETHI hi(&Repl4($src)),$tmp\t!get Repl4C($src) from table\n\t" - "LDDF [$tmp+lo(&Repl4($src))],$dst" %} - ins_encode( LdReplImmI(src, dst, tmp, (4), (2)) ); +instruct Repl4C_immI(regD dst, immI con, o7RegI tmp) %{ + match(Set dst (Replicate4C con)); + effect(KILL tmp); + format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl4C($con)" %} + ins_encode %{ + // XXX This is a quick fix for 6833573. + //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 4, 2)), $dst$$FloatRegister); + RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 4, 2)), $tmp$$Register); + __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg)); + %} ins_pipe(loadConFD); %} @@ -8624,16 +8754,16 @@ instruct Repl4S_reg(stackSlotD dst, iRegI src) %{ %} // Replicate scalar constant to packed short values in Double register -instruct Repl4S_immI(regD dst, immI src, o7RegP tmp) %{ - match(Set dst (Replicate4S src)); -#ifdef _LP64 - size(36); -#else - size(8); -#endif - format %{ "SETHI hi(&Repl4($src)),$tmp\t!get Repl4S($src) from table\n\t" - "LDDF [$tmp+lo(&Repl4($src))],$dst" %} - ins_encode( LdReplImmI(src, dst, tmp, (4), (2)) ); +instruct Repl4S_immI(regD dst, immI con, o7RegI tmp) %{ + match(Set dst (Replicate4S con)); + effect(KILL tmp); + format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl4S($con)" %} + ins_encode %{ + // XXX This is a quick fix for 6833573. + //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 4, 2)), $dst$$FloatRegister); + RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 4, 2)), $tmp$$Register); + __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg)); + %} ins_pipe(loadConFD); %} @@ -8658,16 +8788,16 @@ instruct Repl2I_reg(stackSlotD dst, iRegI src) %{ %} // Replicate scalar zero constant to packed int values in Double register -instruct Repl2I_immI(regD dst, immI src, o7RegP tmp) %{ - match(Set dst (Replicate2I src)); -#ifdef _LP64 - size(36); -#else - size(8); -#endif - format %{ "SETHI hi(&Repl2($src)),$tmp\t!get Repl2I($src) from table\n\t" - "LDDF [$tmp+lo(&Repl2($src))],$dst" %} - ins_encode( LdReplImmI(src, dst, tmp, (2), (4)) ); +instruct Repl2I_immI(regD dst, immI con, o7RegI tmp) %{ + match(Set dst (Replicate2I con)); + effect(KILL tmp); + format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl2I($con)" %} + ins_encode %{ + // XXX This is a quick fix for 6833573. + //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 2, 4)), $dst$$FloatRegister); + RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 2, 4)), $tmp$$Register); + __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg)); + %} ins_pipe(loadConFD); %} @@ -8923,12 +9053,27 @@ instruct jumpXtnd(iRegX switch_val, o7RegI table) %{ ins_cost(350); - format %{ "SETHI [hi(table_base)],O7\n\t" - "ADD O7, lo(table_base), O7\n\t" - "LD [O7+$switch_val], O7\n\t" + format %{ "ADD $constanttablebase, $constantoffset, O7\n\t" + "LD [O7 + $switch_val], O7\n\t" "JUMP O7" %} - ins_encode( jump_enc( switch_val, table) ); + ins_encode %{ + // Calculate table address into a register. + Register table_reg; + Register label_reg = O7; + if (constant_offset() == 0) { + table_reg = $constanttablebase; + } else { + table_reg = O7; + RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset, O7); + __ add($constanttablebase, con_offset, table_reg); + } + + // Jump to base address + switch value + __ ld_ptr(table_reg, $switch_val$$Register, label_reg); + __ jmp(label_reg, G0); + __ delayed()->nop(); + %} ins_pc_relative(1); ins_pipe(ialu_reg_reg); %} @@ -9510,16 +9655,16 @@ instruct countLeadingZerosI(iRegI dst, iRegI src, iRegI tmp, flagsReg cr) %{ Register Rdst = $dst$$Register; Register Rsrc = $src$$Register; Register Rtmp = $tmp$$Register; - __ srl(Rsrc, 1, Rtmp); - __ srl(Rsrc, 0, Rdst); + __ srl(Rsrc, 1, Rtmp); + __ srl(Rsrc, 0, Rdst); __ or3(Rdst, Rtmp, Rdst); - __ srl(Rdst, 2, Rtmp); + __ srl(Rdst, 2, Rtmp); __ or3(Rdst, Rtmp, Rdst); - __ srl(Rdst, 4, Rtmp); + __ srl(Rdst, 4, Rtmp); __ or3(Rdst, Rtmp, Rdst); - __ srl(Rdst, 8, Rtmp); + __ srl(Rdst, 8, Rtmp); __ or3(Rdst, Rtmp, Rdst); - __ srl(Rdst, 16, Rtmp); + __ srl(Rdst, 16, Rtmp); __ or3(Rdst, Rtmp, Rdst); __ popc(Rdst, Rdst); __ mov(BitsPerInt, Rtmp); @@ -9528,7 +9673,7 @@ instruct countLeadingZerosI(iRegI dst, iRegI src, iRegI tmp, flagsReg cr) %{ ins_pipe(ialu_reg); %} -instruct countLeadingZerosL(iRegI dst, iRegL src, iRegL tmp, flagsReg cr) %{ +instruct countLeadingZerosL(iRegIsafe dst, iRegL src, iRegL tmp, flagsReg cr) %{ predicate(UsePopCountInstruction); // See Matcher::match_rule_supported match(Set dst (CountLeadingZerosL src)); effect(TEMP dst, TEMP tmp, KILL cr); @@ -9559,18 +9704,18 @@ instruct countLeadingZerosL(iRegI dst, iRegL src, iRegL tmp, flagsReg cr) %{ Register Rdst = $dst$$Register; Register Rsrc = $src$$Register; Register Rtmp = $tmp$$Register; - __ srlx(Rsrc, 1, Rtmp); - __ or3(Rsrc, Rtmp, Rdst); - __ srlx(Rdst, 2, Rtmp); - __ or3(Rdst, Rtmp, Rdst); - __ srlx(Rdst, 4, Rtmp); - __ or3(Rdst, Rtmp, Rdst); - __ srlx(Rdst, 8, Rtmp); - __ or3(Rdst, Rtmp, Rdst); - __ srlx(Rdst, 16, Rtmp); - __ or3(Rdst, Rtmp, Rdst); - __ srlx(Rdst, 32, Rtmp); - __ or3(Rdst, Rtmp, Rdst); + __ srlx(Rsrc, 1, Rtmp); + __ or3( Rsrc, Rtmp, Rdst); + __ srlx(Rdst, 2, Rtmp); + __ or3( Rdst, Rtmp, Rdst); + __ srlx(Rdst, 4, Rtmp); + __ or3( Rdst, Rtmp, Rdst); + __ srlx(Rdst, 8, Rtmp); + __ or3( Rdst, Rtmp, Rdst); + __ srlx(Rdst, 16, Rtmp); + __ or3( Rdst, Rtmp, Rdst); + __ srlx(Rdst, 32, Rtmp); + __ or3( Rdst, Rtmp, Rdst); __ popc(Rdst, Rdst); __ mov(BitsPerLong, Rtmp); __ sub(Rtmp, Rdst, Rdst); diff --git a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp index 7c64ab30fd5..7bb56140d61 100644 --- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp @@ -22,8 +22,31 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stubGenerator_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_sparc.inline.hpp" +#include "interpreter/interpreter.hpp" +#include "nativeInst_sparc.hpp" +#include "oops/instanceOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/oop.inline.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubCodeGenerator.hpp" +#include "runtime/stubRoutines.hpp" +#include "utilities/top.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif // Declaration and definition of StubGenerator (no .hpp file). // For a more detailed description of the stub routine structure @@ -2586,6 +2609,8 @@ class StubGenerator: public StubCodeGenerator { __ restore(); #endif + assert_clean_int(O2_count, G1); // Make sure 'count' is clean int. + #ifdef ASSERT // caller guarantees that the arrays really are different // otherwise, we would have to make conjoint checks @@ -2600,8 +2625,6 @@ class StubGenerator: public StubCodeGenerator { } #endif //ASSERT - assert_clean_int(O2_count, G1); // Make sure 'count' is clean int. - checkcast_copy_entry = __ pc(); // caller can pass a 64-bit byte count here (from generic stub) BLOCK_COMMENT("Entry:"); diff --git a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp index 162f6469d5b..68785abfc73 100644 --- a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stubRoutines_sparc.cpp.incl" +#include "precompiled.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/stubRoutines.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif // Implementation of the platform-specific part of StubRoutines - for // a description of how to extend it, see the stubRoutines.hpp file. diff --git a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp index e02789d2530..11350f2d400 100644 --- a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_STUBROUTINES_SPARC_HPP +#define CPU_SPARC_VM_STUBROUTINES_SPARC_HPP + // This file holds the platform specific parts of the StubRoutines // definition. See stubRoutines.hpp for a description on how to // extend it. @@ -43,7 +46,7 @@ enum /* platform_dependent_constants */ { // MethodHandles adapters enum method_handles_platform_dependent_constants { - method_handles_adapters_code_size = 12000 + method_handles_adapters_code_size = 15000 }; class Sparc { @@ -100,3 +103,5 @@ class Sparc { static address partial_subtype_check() { return _partial_subtype_check; } }; + +#endif // CPU_SPARC_VM_STUBROUTINES_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp index 1519d3ea1f2..73b0f1478b5 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ +#ifndef CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP +#define CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP + protected: void generate_fixed_frame(bool native_call); // template interpreter only void generate_stack_overflow_check(Register Rframe_size, Register Rscratch, Register Rscratch2); + +#endif // CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index cc05ddb7e96..80e3a759d1d 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -22,8 +22,28 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_templateInterpreter_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateTable.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/arguments.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/timer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" #ifndef CC_INTERP #ifndef FAST_DISPATCH diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp index 5770131e1df..9b6cd216fbb 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP +#define CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP + protected: @@ -38,3 +41,5 @@ #else const static int InterpreterCodeSize = 180 * K; #endif + +#endif // CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index b144985f132..6bfaccd64e3 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,18 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_templateTable_sparc.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateTable.hpp" +#include "memory/universe.inline.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/oop.inline.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" #ifndef CC_INTERP #define __ _masm-> @@ -341,6 +351,26 @@ void TemplateTable::fast_aldc(bool wide) { resolve_cache_and_index(f1_oop, Otos_i, Rcache, Rscratch, wide ? sizeof(u2) : sizeof(u1)); __ verify_oop(Otos_i); + + Label L_done; + const Register Rcon_klass = G3_scratch; // same as Rcache + const Register Rarray_klass = G4_scratch; // same as Rscratch + __ load_klass(Otos_i, Rcon_klass); + AddressLiteral array_klass_addr((address)Universe::systemObjArrayKlassObj_addr()); + __ load_contents(array_klass_addr, Rarray_klass); + __ cmp(Rarray_klass, Rcon_klass); + __ brx(Assembler::notEqual, false, Assembler::pt, L_done); + __ delayed()->nop(); + __ ld(Address(Otos_i, arrayOopDesc::length_offset_in_bytes()), Rcon_klass); + __ tst(Rcon_klass); + __ brx(Assembler::zero, true, Assembler::pt, L_done); + __ delayed()->clr(Otos_i); // executed only if branch is taken + + // Load the exception from the system-array which wraps it: + __ load_heap_oop(Otos_i, arrayOopDesc::base_offset_in_bytes(T_OBJECT), Otos_i); + __ throw_if_not_x(Assembler::never, Interpreter::throw_exception_entry(), G3_scratch); + + __ bind(L_done); } void TemplateTable::ldc2_w() { @@ -3273,7 +3303,7 @@ void TemplateTable::invokedynamic(int byte_no) { __ sll(Rret, LogBytesPerWord, Rret); __ ld_ptr(Rtemp, Rret, Rret); // get return address - __ ld_ptr(G5_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, Rscratch), G3_method_handle); + __ load_heap_oop(G5_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, Rscratch), G3_method_handle); __ null_check(G3_method_handle); // Adjust Rret first so Llast_SP can be same as Rret @@ -3363,21 +3393,21 @@ void TemplateTable::_new() { __ delayed()->st_ptr(RnewTopValue, G2_thread, in_bytes(JavaThread::tlab_top_offset())); if (allow_shared_alloc) { - // Check if tlab should be discarded (refill_waste_limit >= free) - __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset()), RtlabWasteLimitValue); - __ sub(RendValue, RoldTopValue, RfreeValue); + // Check if tlab should be discarded (refill_waste_limit >= free) + __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset()), RtlabWasteLimitValue); + __ sub(RendValue, RoldTopValue, RfreeValue); #ifdef _LP64 - __ srlx(RfreeValue, LogHeapWordSize, RfreeValue); + __ srlx(RfreeValue, LogHeapWordSize, RfreeValue); #else - __ srl(RfreeValue, LogHeapWordSize, RfreeValue); + __ srl(RfreeValue, LogHeapWordSize, RfreeValue); #endif - __ cmp(RtlabWasteLimitValue, RfreeValue); - __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, slow_case); // tlab waste is small - __ delayed()->nop(); + __ cmp(RtlabWasteLimitValue, RfreeValue); + __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, slow_case); // tlab waste is small + __ delayed()->nop(); - // increment waste limit to prevent getting stuck on this slow path - __ add(RtlabWasteLimitValue, ThreadLocalAllocBuffer::refill_waste_limit_increment(), RtlabWasteLimitValue); - __ st_ptr(RtlabWasteLimitValue, G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset())); + // increment waste limit to prevent getting stuck on this slow path + __ add(RtlabWasteLimitValue, ThreadLocalAllocBuffer::refill_waste_limit_increment(), RtlabWasteLimitValue); + __ st_ptr(RtlabWasteLimitValue, G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset())); } else { // No allocation in the shared eden. __ br(Assembler::always, false, Assembler::pt, slow_case); @@ -3415,6 +3445,9 @@ void TemplateTable::_new() { __ cmp(RoldTopValue, RnewTopValue); __ brx(Assembler::notEqual, false, Assembler::pn, retry); __ delayed()->nop(); + + // bump total bytes allocated by this thread + __ incr_allocated_bytes(Roffset, 0, G1_scratch); } if (UseTLAB || Universe::heap()->supports_inline_contig_alloc()) { diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.hpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.hpp index cf82ef4e827..35c8ca1c59b 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_TEMPLATETABLE_SPARC_HPP +#define CPU_SPARC_VM_TEMPLATETABLE_SPARC_HPP + // helper function static void invokevfinal_helper(Register Rcache, Register Rret); static void invokeinterface_object_method(Register RklassOop, Register Rcall, @@ -29,3 +32,5 @@ Register Rflags); static void generate_vtable_call(Register Rrecv, Register Rindex, Register Rret); static void volatile_barrier(Assembler::Membar_mask_bits order_constraint); + +#endif // CPU_SPARC_VM_TEMPLATETABLE_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp b/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp index 47db8d52f0d..8103a6395b7 100644 --- a/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP +#define CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP + // These are the CPU-specific fields, types and integer // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. @@ -97,3 +100,5 @@ /* 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 must */ /* be present there) */ + +#endif // CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index ca8a0ddafa8..6db8c7ad1ce 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 (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,18 +22,22 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_vm_version_sparc.cpp.incl" +#include "precompiled.hpp" +#include "assembler_sparc.inline.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/java.hpp" +#include "runtime/stubCodeGenerator.hpp" +#include "vm_version_sparc.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "os_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "os_solaris.inline.hpp" +#endif int VM_Version::_features = VM_Version::unknown_m; const char* VM_Version::_features_str = ""; -bool VM_Version::is_niagara1_plus() { - // This is a placeholder until the real test is determined. - return is_niagara1() && - (os::processor_count() > maximum_niagara1_processor_count()); -} - void VM_Version::initialize() { _features = determine_features(); PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes(); @@ -59,11 +63,21 @@ void VM_Version::initialize() { _supports_cx8 = has_v9(); - if (is_niagara1()) { + if (is_niagara()) { // Indirect branch is the same cost as direct if (FLAG_IS_DEFAULT(UseInlineCaches)) { FLAG_SET_DEFAULT(UseInlineCaches, false); } + // Align loops on a single instruction boundary. + if (FLAG_IS_DEFAULT(OptoLoopAlignment)) { + FLAG_SET_DEFAULT(OptoLoopAlignment, 4); + } + // When using CMS, we cannot use memset() in BOT updates because + // the sun4v/CMT version in libc_psr uses BIS which exposes + // "phantom zeros" to concurrent readers. See 6948537. + if (FLAG_IS_DEFAULT(UseMemSetInBOT) && UseConcMarkSweepGC) { + FLAG_SET_DEFAULT(UseMemSetInBOT, false); + } #ifdef _LP64 // 32-bit oops don't make sense for the 64-bit VM on sparc // since the 32-bit VM has the same registers and smaller objects. @@ -79,8 +93,9 @@ void VM_Version::initialize() { if (FLAG_IS_DEFAULT(InteriorEntryAlignment)) { FLAG_SET_DEFAULT(InteriorEntryAlignment, 4); } - if (is_niagara1_plus()) { - if (AllocatePrefetchStyle > 0 && FLAG_IS_DEFAULT(AllocatePrefetchStyle)) { + if (is_niagara_plus()) { + if (has_blk_init() && AllocatePrefetchStyle > 0 && + FLAG_IS_DEFAULT(AllocatePrefetchStyle)) { // Use BIS instruction for allocation prefetch. FLAG_SET_DEFAULT(AllocatePrefetchStyle, 3); if (FLAG_IS_DEFAULT(AllocatePrefetchDistance)) { @@ -94,15 +109,6 @@ void VM_Version::initialize() { } } #endif - if (FLAG_IS_DEFAULT(OptoLoopAlignment)) { - FLAG_SET_DEFAULT(OptoLoopAlignment, 4); - } - // When using CMS, we cannot use memset() in BOT updates because - // the sun4v/CMT version in libc_psr uses BIS which exposes - // "phantom zeros" to concurrent readers. See 6948537. - if (FLAG_IS_DEFAULT(UseMemSetInBOT) && UseConcMarkSweepGC) { - FLAG_SET_DEFAULT(UseMemSetInBOT, false); - } } // Use hardware population count instruction if available. @@ -118,16 +124,19 @@ void VM_Version::initialize() { #endif char buf[512]; - jio_snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s%s%s%s", + jio_snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", (has_v8() ? ", has_v8" : ""), (has_v9() ? ", has_v9" : ""), (has_hardware_popc() ? ", popc" : ""), (has_vis1() ? ", has_vis1" : ""), (has_vis2() ? ", has_vis2" : ""), + (has_vis3() ? ", has_vis3" : ""), + (has_blk_init() ? ", has_blk_init" : ""), (is_ultra3() ? ", is_ultra3" : ""), (is_sun4v() ? ", is_sun4v" : ""), - (is_niagara1() ? ", is_niagara1" : ""), - (is_niagara1_plus() ? ", is_niagara1_plus" : ""), + (is_niagara() ? ", is_niagara" : ""), + (is_niagara_plus() ? ", is_niagara_plus" : ""), + (is_sparc64() ? ", is_sparc64" : ""), (!has_hardware_mul32() ? ", no-mul32" : ""), (!has_hardware_div32() ? ", no-div32" : ""), (!has_hardware_fsmuld() ? ", no-fsmuld" : "")); @@ -177,17 +186,18 @@ int VM_Version::determine_features() { warning("Cannot recognize SPARC version. Default to V9"); } - if (UseNiagaraInstrs) { - if (is_niagara1(features)) { + assert(is_T_family(features) == is_niagara(features), "Niagara should be T series"); + if (UseNiagaraInstrs) { // Force code generation for Niagara + if (is_T_family(features)) { // Happy to accomodate... } else { NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Version is Forced-Niagara");) - features = niagara1_m; + features |= T_family_m; } } else { - if (is_niagara1(features) && !FLAG_IS_DEFAULT(UseNiagaraInstrs)) { + if (is_T_family(features) && !FLAG_IS_DEFAULT(UseNiagaraInstrs)) { NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Version is Forced-Not-Niagara");) - features &= ~niagara1_unique_m; + features &= ~(T_family_m | T1_model_m); } else { // Happy to accomodate... } @@ -209,7 +219,7 @@ void VM_Version::revert() { unsigned int VM_Version::calc_parallel_worker_threads() { unsigned int result; - if (is_niagara1_plus()) { + if (is_niagara_plus()) { result = nof_parallel_worker_threads(5, 16, 8); } else { result = nof_parallel_worker_threads(5, 8, 8); diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp index e8234967995..c83d2de9920 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 (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef CPU_SPARC_VM_VM_VERSION_SPARC_HPP +#define CPU_SPARC_VM_VM_VERSION_SPARC_HPP + +#include "runtime/globals_extension.hpp" +#include "runtime/vm_version.hpp" + class VM_Version: public Abstract_VM_Version { protected: enum Feature_Flag { @@ -33,7 +39,14 @@ protected: v9_instructions = 5, vis1_instructions = 6, vis2_instructions = 7, - sun4v_instructions = 8 + sun4v_instructions = 8, + blk_init_instructions = 9, + fmaf_instructions = 10, + fmau_instructions = 11, + vis3_instructions = 12, + sparc64_family = 13, + T_family = 14, + T1_model = 15 }; enum Feature_Flag_Set { @@ -49,6 +62,13 @@ protected: vis1_instructions_m = 1 << vis1_instructions, vis2_instructions_m = 1 << vis2_instructions, sun4v_m = 1 << sun4v_instructions, + blk_init_instructions_m = 1 << blk_init_instructions, + fmaf_instructions_m = 1 << fmaf_instructions, + fmau_instructions_m = 1 << fmau_instructions, + vis3_instructions_m = 1 << vis3_instructions, + sparc64_family_m = 1 << sparc64_family, + T_family_m = 1 << T_family, + T1_model_m = 1 << T1_model, generic_v8_m = v8_instructions_m | hardware_mul32_m | hardware_div32_m | hardware_fsmuld_m, generic_v9_m = generic_v8_m | v9_instructions_m, @@ -66,12 +86,15 @@ protected: static int determine_features(); static int platform_features(int features); - static bool is_niagara1(int features) { return (features & sun4v_m) != 0; } + // Returns true if the platform is in the niagara line (T series) + static bool is_T_family(int features) { return (features & T_family_m) != 0; } + static bool is_niagara() { return is_T_family(_features); } + DEBUG_ONLY( static bool is_niagara(int features) { return (features & sun4v_m) != 0; } ) + + // Returns true if it is niagara1 (T1). + static bool is_T1_model(int features) { return is_T_family(features) && ((features & T1_model_m) != 0); } static int maximum_niagara1_processor_count() { return 32; } - // Returns true if the platform is in the niagara line and - // newer than the niagara1. - static bool is_niagara1_plus(); public: // Initialization @@ -86,15 +109,22 @@ public: static bool has_hardware_popc() { return (_features & hardware_popc_m) != 0; } static bool has_vis1() { return (_features & vis1_instructions_m) != 0; } static bool has_vis2() { return (_features & vis2_instructions_m) != 0; } + static bool has_vis3() { return (_features & vis3_instructions_m) != 0; } + static bool has_blk_init() { return (_features & blk_init_instructions_m) != 0; } static bool supports_compare_and_exchange() { return has_v9(); } static bool is_ultra3() { return (_features & ultra3_m) == ultra3_m; } static bool is_sun4v() { return (_features & sun4v_m) != 0; } - static bool is_niagara1() { return is_niagara1(_features); } + // Returns true if the platform is in the niagara line (T series) + // and newer than the niagara1. + static bool is_niagara_plus() { return is_T_family(_features) && !is_T1_model(_features); } + // Fujitsu SPARC64 + static bool is_sparc64() { return (_features & sparc64_family_m) != 0; } - static bool has_fast_fxtof() { return has_v9() && !is_ultra3(); } + static bool has_fast_fxtof() { return is_niagara() || is_sparc64() || has_v9() && !is_ultra3(); } + static bool has_fast_idiv() { return is_niagara_plus() || is_sparc64(); } static const char* cpu_features() { return _features_str; } @@ -144,3 +174,5 @@ public: // Calculates the number of parallel threads static unsigned int calc_parallel_worker_threads(); }; + +#endif // CPU_SPARC_VM_VM_VERSION_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.cpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.cpp index 1693ea297b6..470f354bf46 100644 --- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_vmreg_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "code/vmreg.hpp" diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp index 6234fdd6f85..ce8cb4c3d3a 100644 --- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ +#ifndef CPU_SPARC_VM_VMREG_SPARC_HPP +#define CPU_SPARC_VM_VMREG_SPARC_HPP + bool is_Register(); Register as_Register(); bool is_FloatRegister(); FloatRegister as_FloatRegister(); + +#endif // CPU_SPARC_VM_VMREG_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp index fa92eea8e12..993216fc12d 100644 --- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP +#define CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP + inline VMReg RegisterImpl::as_VMReg() { if( this==noreg ) return VMRegImpl::Bad(); return VMRegImpl::as_VMReg(encoding() << 1 ); @@ -60,3 +63,5 @@ inline bool VMRegImpl::is_concrete() { assert(false, "what register?"); return false; } + +#endif // CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP diff --git a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp index 2932cfc42b2..9c040216e06 100644 --- a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,19 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_vtableStubs_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_sparc.inline.hpp" +#include "code/vtableStubs.hpp" +#include "interp_masm_sparc.hpp" +#include "memory/resourceArea.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/klassVtable.hpp" +#include "runtime/sharedRuntime.hpp" +#include "vmreg_sparc.inline.hpp" +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif // machine-dependent part of VtableStubs: create vtableStub of correct size and // initialize its code diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index 4f43327d304..4c87f23cd13 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,24 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_assembler_x86.cpp.incl" +#include "precompiled.hpp" +#include "assembler_x86.inline.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "interpreter/interpreter.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "memory/resourceArea.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/objectMonitor.hpp" +#include "runtime/os.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#ifndef SERIALGC +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" +#include "gc_implementation/g1/heapRegion.hpp" +#endif // Implementation of AddressLiteral @@ -804,7 +820,20 @@ void Assembler::emit_farith(int b1, int b2, int i) { } -// Now the Assembler instruction (identical for 32/64 bits) +// Now the Assembler instructions (identical for 32/64 bits) + +void Assembler::adcl(Address dst, int32_t imm32) { + InstructionMark im(this); + prefix(dst); + emit_arith_operand(0x81, rdx, dst, imm32); +} + +void Assembler::adcl(Address dst, Register src) { + InstructionMark im(this); + prefix(dst, src); + emit_byte(0x11); + emit_operand(src, dst); +} void Assembler::adcl(Register dst, int32_t imm32) { prefix(dst); @@ -1275,6 +1304,12 @@ void Assembler::idivl(Register src) { emit_byte(0xF8 | encode); } +void Assembler::divl(Register src) { // Unsigned + int encode = prefix_and_encode(src->encoding()); + emit_byte(0xF7); + emit_byte(0xF0 | encode); +} + void Assembler::imull(Register dst, Register src) { int encode = prefix_and_encode(dst->encoding(), src->encoding()); emit_byte(0x0F); @@ -1288,7 +1323,7 @@ void Assembler::imull(Register dst, Register src, int value) { if (is8bit(value)) { emit_byte(0x6B); emit_byte(0xC0 | encode); - emit_byte(value); + emit_byte(value & 0xFF); } else { emit_byte(0x69); emit_byte(0xC0 | encode); @@ -2173,9 +2208,7 @@ void Assembler::notl(Register dst) { void Assembler::orl(Address dst, int32_t imm32) { InstructionMark im(this); prefix(dst); - emit_byte(0x81); - emit_operand(rcx, dst, 4); - emit_long(imm32); + emit_arith_operand(0x81, rcx, dst, imm32); } void Assembler::orl(Register dst, int32_t imm32) { @@ -2183,7 +2216,6 @@ void Assembler::orl(Register dst, int32_t imm32) { emit_arith(0x81, 0xC8, dst, imm32); } - void Assembler::orl(Register dst, Address src) { InstructionMark im(this); prefix(src, dst); @@ -2191,7 +2223,6 @@ void Assembler::orl(Register dst, Address src) { emit_operand(dst, src); } - void Assembler::orl(Register dst, Register src) { (void) prefix_and_encode(dst->encoding(), src->encoding()); emit_arith(0x0B, 0xC0, dst, src); @@ -2627,6 +2658,37 @@ void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) { emit_byte(0xC0 | encode); } +void Assembler::sqrtsd(XMMRegister dst, Address src) { + NOT_LP64(assert(VM_Version::supports_sse2(), "")); + InstructionMark im(this); + emit_byte(0xF2); + prefix(src, dst); + emit_byte(0x0F); + emit_byte(0x51); + emit_operand(dst, src); +} + +void Assembler::sqrtss(XMMRegister dst, XMMRegister src) { + // HMM Table D-1 says sse2 + // NOT_LP64(assert(VM_Version::supports_sse(), "")); + NOT_LP64(assert(VM_Version::supports_sse2(), "")); + emit_byte(0xF3); + int encode = prefix_and_encode(dst->encoding(), src->encoding()); + emit_byte(0x0F); + emit_byte(0x51); + emit_byte(0xC0 | encode); +} + +void Assembler::sqrtss(XMMRegister dst, Address src) { + NOT_LP64(assert(VM_Version::supports_sse2(), "")); + InstructionMark im(this); + emit_byte(0xF3); + prefix(src, dst); + emit_byte(0x0F); + emit_byte(0x51); + emit_operand(dst, src); +} + void Assembler::stmxcsr( Address dst) { NOT_LP64(assert(VM_Version::supports_sse(), "")); InstructionMark im(this); @@ -2639,20 +2701,7 @@ void Assembler::stmxcsr( Address dst) { void Assembler::subl(Address dst, int32_t imm32) { InstructionMark im(this); prefix(dst); - if (is8bit(imm32)) { - emit_byte(0x83); - emit_operand(rbp, dst, 1); - emit_byte(imm32 & 0xFF); - } else { - emit_byte(0x81); - emit_operand(rbp, dst, 4); - emit_long(imm32); - } -} - -void Assembler::subl(Register dst, int32_t imm32) { - prefix(dst); - emit_arith(0x81, 0xE8, dst, imm32); + emit_arith_operand(0x81, rbp, dst, imm32); } void Assembler::subl(Address dst, Register src) { @@ -2662,6 +2711,11 @@ void Assembler::subl(Address dst, Register src) { emit_operand(src, dst); } +void Assembler::subl(Register dst, int32_t imm32) { + prefix(dst); + emit_arith(0x81, 0xE8, dst, imm32); +} + void Assembler::subl(Register dst, Address src) { InstructionMark im(this); prefix(src, dst); @@ -3903,7 +3957,7 @@ void Assembler::imulq(Register dst, Register src, int value) { if (is8bit(value)) { emit_byte(0x6B); emit_byte(0xC0 | encode); - emit_byte(value); + emit_byte(value & 0xFF); } else { emit_byte(0x69); emit_byte(0xC0 | encode); @@ -4280,6 +4334,7 @@ void Assembler::sarq(Register dst) { emit_byte(0xD3); emit_byte(0xF8 | encode); } + void Assembler::sbbq(Address dst, int32_t imm32) { InstructionMark im(this); prefixq(dst); @@ -4336,33 +4391,10 @@ void Assembler::shrq(Register dst) { emit_byte(0xE8 | encode); } -void Assembler::sqrtsd(XMMRegister dst, Address src) { - NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionMark im(this); - emit_byte(0xF2); - prefix(src, dst); - emit_byte(0x0F); - emit_byte(0x51); - emit_operand(dst, src); -} - void Assembler::subq(Address dst, int32_t imm32) { InstructionMark im(this); prefixq(dst); - if (is8bit(imm32)) { - emit_byte(0x83); - emit_operand(rbp, dst, 1); - emit_byte(imm32 & 0xFF); - } else { - emit_byte(0x81); - emit_operand(rbp, dst, 4); - emit_long(imm32); - } -} - -void Assembler::subq(Register dst, int32_t imm32) { - (void) prefixq_and_encode(dst->encoding()); - emit_arith(0x81, 0xE8, dst, imm32); + emit_arith_operand(0x81, rbp, dst, imm32); } void Assembler::subq(Address dst, Register src) { @@ -4372,6 +4404,11 @@ void Assembler::subq(Address dst, Register src) { emit_operand(src, dst); } +void Assembler::subq(Register dst, int32_t imm32) { + (void) prefixq_and_encode(dst->encoding()); + emit_arith(0x81, 0xE8, dst, imm32); +} + void Assembler::subq(Register dst, Address src) { InstructionMark im(this); prefixq(src, dst); @@ -4907,10 +4944,6 @@ void MacroAssembler::movptr(Address dst, intptr_t src) { } -void MacroAssembler::movsd(XMMRegister dst, AddressLiteral src) { - movsd(dst, as_Address(src)); -} - void MacroAssembler::pop_callee_saved_registers() { pop(rcx); pop(rdx); @@ -5516,17 +5549,14 @@ void MacroAssembler::stop(const char* msg) { } void MacroAssembler::warn(const char* msg) { - push(r12); - movq(r12, rsp); + push(rsp); andq(rsp, -16); // align stack as required by push_CPU_state and call push_CPU_state(); // keeps alignment at 16 bytes lea(c_rarg0, ExternalAddress((address) msg)); call_VM_leaf(CAST_FROM_FN_PTR(address, warning), c_rarg0); pop_CPU_state(); - - movq(rsp, r12); - pop(r12); + pop(rsp); } #ifndef PRODUCT @@ -5838,6 +5868,10 @@ void MacroAssembler::call_VM_base(Register oop_result, // debugging support assert(number_of_arguments >= 0 , "cannot have negative number of arguments"); LP64_ONLY(assert(java_thread == r15_thread, "unexpected register")); +#ifdef ASSERT + LP64_ONLY(if (UseCompressedOops) verify_heapbase("call_VM_base");) +#endif // ASSERT + assert(java_thread != oop_result , "cannot use the same register for java_thread & oop_result"); assert(java_thread != last_java_sp, "cannot use the same register for java_thread & last_java_sp"); @@ -7096,9 +7130,9 @@ void MacroAssembler::tlab_allocate(Register obj, } // Preserves rbx, and rdx. -void MacroAssembler::tlab_refill(Label& retry, - Label& try_eden, - Label& slow_case) { +Register MacroAssembler::tlab_refill(Label& retry, + Label& try_eden, + Label& slow_case) { Register top = rax; Register t1 = rcx; Register t2 = rsi; @@ -7145,7 +7179,7 @@ void MacroAssembler::tlab_refill(Label& retry, // if tlab is currently allocated (top or end != null) then // fill [top, end + alignment_reserve) with array object - testptr (top, top); + testptr(top, top); jcc(Assembler::zero, do_refill); // set up the mark word @@ -7157,16 +7191,20 @@ void MacroAssembler::tlab_refill(Label& retry, movl(Address(top, arrayOopDesc::length_offset_in_bytes()), t1); // set klass to intArrayKlass // dubious reloc why not an oop reloc? - movptr(t1, ExternalAddress((address) Universe::intArrayKlassObj_addr())); + 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); + movptr(t1, top); + subptr(t1, Address(thread_reg, in_bytes(JavaThread::tlab_start_offset()))); + incr_allocated_bytes(thread_reg, t1, 0); + // refill the tlab with an eden allocation bind(do_refill); movptr(t1, Address(thread_reg, in_bytes(JavaThread::tlab_size_offset()))); shlptr(t1, LogHeapWordSize); - // add object_size ?? + // allocate new tlab, address returned in top eden_allocate(top, t1, 0, t2, slow_case); // Check that t1 was preserved in eden_allocate. @@ -7194,6 +7232,34 @@ void MacroAssembler::tlab_refill(Label& retry, movptr(Address(thread_reg, in_bytes(JavaThread::tlab_end_offset())), top); verify_tlab(); jmp(retry); + + return thread_reg; // for use by caller +} + +void MacroAssembler::incr_allocated_bytes(Register thread, + Register var_size_in_bytes, + int con_size_in_bytes, + Register t1) { +#ifdef _LP64 + if (var_size_in_bytes->is_valid()) { + addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes); + } else { + addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes); + } +#else + if (!thread->is_valid()) { + assert(t1->is_valid(), "need temp reg"); + thread = t1; + get_thread(thread); + } + + if (var_size_in_bytes->is_valid()) { + addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes); + } else { + addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes); + } + adcl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())+4), 0); +#endif } static const double pi_4 = 0.7853981633974483; @@ -7709,9 +7775,14 @@ RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_ad void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_reg, Register temp_reg, Label& wrong_method_type) { - if (UseCompressedOops) unimplemented(); // field accesses must decode + Address type_addr(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)); // compare method type against that of the receiver - cmpptr(mtype_reg, Address(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg))); + if (UseCompressedOops) { + load_heap_oop(temp_reg, type_addr); + cmpptr(mtype_reg, temp_reg); + } else { + cmpptr(mtype_reg, type_addr); + } jcc(Assembler::notEqual, wrong_method_type); } @@ -7723,15 +7794,14 @@ void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_re void MacroAssembler::load_method_handle_vmslots(Register vmslots_reg, Register mh_reg, Register temp_reg) { assert_different_registers(vmslots_reg, mh_reg, temp_reg); - if (UseCompressedOops) unimplemented(); // field accesses must decode // load mh.type.form.vmslots if (java_dyn_MethodHandle::vmslots_offset_in_bytes() != 0) { // hoist vmslots into every mh to avoid dependent load chain movl(vmslots_reg, Address(mh_reg, delayed_value(java_dyn_MethodHandle::vmslots_offset_in_bytes, temp_reg))); } else { Register temp2_reg = vmslots_reg; - movptr(temp2_reg, Address(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg))); - movptr(temp2_reg, Address(temp2_reg, delayed_value(java_dyn_MethodType::form_offset_in_bytes, temp_reg))); + load_heap_oop(temp2_reg, Address(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg))); + load_heap_oop(temp2_reg, Address(temp2_reg, delayed_value(java_dyn_MethodType::form_offset_in_bytes, temp_reg))); movl(vmslots_reg, Address(temp2_reg, delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, temp_reg))); } } @@ -7745,9 +7815,8 @@ void MacroAssembler::jump_to_method_handle_entry(Register mh_reg, Register temp_ assert(mh_reg == rcx, "caller must put MH object in rcx"); assert_different_registers(mh_reg, temp_reg); - if (UseCompressedOops) unimplemented(); // field accesses must decode - // pick out the interpreted side of the handler + // NOTE: vmentry is not an oop! movptr(temp_reg, Address(mh_reg, delayed_value(java_dyn_MethodHandle::vmentry_offset_in_bytes, temp_reg))); // off we go... @@ -8238,6 +8307,40 @@ void MacroAssembler::store_klass(Register dst, Register src) { movptr(Address(dst, oopDesc::klass_offset_in_bytes()), src); } +void MacroAssembler::load_heap_oop(Register dst, Address src) { +#ifdef _LP64 + if (UseCompressedOops) { + movl(dst, src); + decode_heap_oop(dst); + } else +#endif + movptr(dst, src); +} + +void MacroAssembler::store_heap_oop(Address dst, Register src) { +#ifdef _LP64 + if (UseCompressedOops) { + assert(!dst.uses(src), "not enough registers"); + encode_heap_oop(src); + movl(dst, src); + } else +#endif + movptr(dst, src); +} + +// Used for storing NULLs. +void MacroAssembler::store_heap_oop_null(Address dst) { +#ifdef _LP64 + if (UseCompressedOops) { + movl(dst, (int32_t)NULL_WORD); + } else { + movslq(dst, (int32_t)NULL_WORD); + } +#else + movl(dst, (int32_t)NULL_WORD); +#endif +} + #ifdef _LP64 void MacroAssembler::store_klass_gap(Register dst, Register src) { if (UseCompressedOops) { @@ -8246,34 +8349,6 @@ void MacroAssembler::store_klass_gap(Register dst, Register src) { } } -void MacroAssembler::load_heap_oop(Register dst, Address src) { - if (UseCompressedOops) { - movl(dst, src); - decode_heap_oop(dst); - } else { - movq(dst, src); - } -} - -void MacroAssembler::store_heap_oop(Address dst, Register src) { - if (UseCompressedOops) { - assert(!dst.uses(src), "not enough registers"); - encode_heap_oop(src); - movl(dst, src); - } else { - movq(dst, src); - } -} - -// Used for storing NULLs. -void MacroAssembler::store_heap_oop_null(Address dst) { - if (UseCompressedOops) { - movl(dst, (int32_t)NULL_WORD); - } else { - movslq(dst, (int32_t)NULL_WORD); - } -} - #ifdef ASSERT void MacroAssembler::verify_heapbase(const char* msg) { assert (UseCompressedOops, "should be compressed"); diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index c9b25e02f19..a1a8a96dee6 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_ASSEMBLER_X86_HPP +#define CPU_X86_VM_ASSEMBLER_X86_HPP + class BiasedLockingCounters; // Contains all the definitions needed for x86 assembly code generation. @@ -132,6 +135,7 @@ REGISTER_DECLARATION(Register, r15_thread, r15); // callee-saved // Using noreg ensures if the dead code is incorrectly live and executed it // will cause an assertion failure #define rscratch1 noreg +#define rscratch2 noreg #endif // _LP64 @@ -670,12 +674,14 @@ private: // Utilities #ifdef _LP64 - static bool is_simm(int64_t x, int nbits) { return -( CONST64(1) << (nbits-1) ) <= x && x < ( CONST64(1) << (nbits-1) ); } + static bool is_simm(int64_t x, int nbits) { return -(CONST64(1) << (nbits-1)) <= x && + x < (CONST64(1) << (nbits-1)); } static bool is_simm32(int64_t x) { return x == (int64_t)(int32_t)x; } #else - static bool is_simm(int32_t x, int nbits) { return -( 1 << (nbits-1) ) <= x && x < ( 1 << (nbits-1) ); } + static bool is_simm(int32_t x, int nbits) { return -(1 << (nbits-1)) <= x && + x < (1 << (nbits-1)); } static bool is_simm32(int32_t x) { return true; } -#endif // LP64 +#endif // _LP64 // Generic instructions // Does 32bit or 64bit as needed for the platform. In some sense these @@ -701,7 +707,6 @@ private: void push(void* v); void pop(void* v); - // These do register sized moves/scans void rep_mov(); void rep_set(); @@ -712,6 +717,8 @@ private: // Vanilla instructions in lexical order + void adcl(Address dst, int32_t imm32); + void adcl(Address dst, Register src); void adcl(Register dst, int32_t imm32); void adcl(Register dst, Address src); void adcl(Register dst, Register src); @@ -720,7 +727,6 @@ private: void adcq(Register dst, Address src); void adcq(Register dst, Register src); - void addl(Address dst, int32_t imm32); void addl(Address dst, Register src); void addl(Register dst, int32_t imm32); @@ -733,7 +739,6 @@ private: void addq(Register dst, Address src); void addq(Register dst, Register src); - void addr_nop_4(); void addr_nop_5(); void addr_nop_7(); @@ -755,7 +760,6 @@ private: void andq(Register dst, Address src); void andq(Register dst, Register src); - // Bitwise Logical AND of Packed Double-Precision Floating-Point Values void andpd(XMMRegister dst, Address src); void andpd(XMMRegister dst, XMMRegister src); @@ -1011,6 +1015,7 @@ private: void hlt(); void idivl(Register src); + void divl(Register src); // Unsigned division void idivq(Register src); @@ -1146,7 +1151,7 @@ private: #ifdef _LP64 void movq(Register dst, Register src); void movq(Register dst, Address src); - void movq(Address dst, Register src); + void movq(Address dst, Register src); #endif void movq(Address dst, MMXRegister src ); @@ -1172,7 +1177,7 @@ private: void movsbq(Register dst, Register src); // Move signed 32bit immediate to 64bit extending sign - void movslq(Address dst, int32_t imm64); + void movslq(Address dst, int32_t imm64); void movslq(Register dst, int32_t imm64); void movslq(Register dst, Address src); @@ -1348,6 +1353,10 @@ private: void sqrtsd(XMMRegister dst, Address src); void sqrtsd(XMMRegister dst, XMMRegister src); + // Compute Square Root of Scalar Single-Precision Floating-Point Value + void sqrtss(XMMRegister dst, Address src); + void sqrtss(XMMRegister dst, XMMRegister src); + void std() { emit_byte(0xfd); } void stmxcsr( Address dst ); @@ -1682,24 +1691,24 @@ class MacroAssembler: public Assembler { void load_klass(Register dst, Register src); void store_klass(Register dst, Register src); + void load_heap_oop(Register dst, Address src); + void store_heap_oop(Address dst, Register src); + + // Used for storing NULL. All other oop constants should be + // stored using routines that take a jobject. + void store_heap_oop_null(Address dst); + void load_prototype_header(Register dst, Register src); #ifdef _LP64 void store_klass_gap(Register dst, Register src); - void load_heap_oop(Register dst, Address src); - void store_heap_oop(Address dst, Register src); - // This dummy is to prevent a call to store_heap_oop from // converting a zero (like NULL) into a Register by giving // the compiler two choices it can't resolve void store_heap_oop(Address dst, void* dummy); - // Used for storing NULL. All other oop constants should be - // stored using routines that take a jobject. - void store_heap_oop_null(Address dst); - void encode_heap_oop(Register r); void decode_heap_oop(Register r); void encode_heap_oop_not_null(Register r); @@ -1848,7 +1857,10 @@ class MacroAssembler: public Assembler { Register t2, // temp register Label& slow_case // continuation point if fast allocation fails ); - void tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case); + Register tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case); // returns TLS address + void incr_allocated_bytes(Register thread, + Register var_size_in_bytes, int con_size_in_bytes, + Register t1 = noreg); // interface method calling void lookup_interface_method(Register recv_klass, @@ -1927,7 +1939,7 @@ class MacroAssembler: public Assembler { void untested() { stop("untested"); } - void unimplemented(const char* what = "") { char* b = new char[1024]; jio_snprintf(b, sizeof(b), "unimplemented: %s", what); stop(b); } + void unimplemented(const char* what = "") { char* b = new char[1024]; jio_snprintf(b, 1024, "unimplemented: %s", what); stop(b); } void should_not_reach_here() { stop("should not reach here"); } @@ -2120,6 +2132,9 @@ class MacroAssembler: public Assembler { void comisd(XMMRegister dst, Address src) { Assembler::comisd(dst, src); } void comisd(XMMRegister dst, AddressLiteral src); + void fadd_s(Address src) { Assembler::fadd_s(src); } + void fadd_s(AddressLiteral src) { Assembler::fadd_s(as_Address(src)); } + void fldcw(Address src) { Assembler::fldcw(src); } void fldcw(AddressLiteral src); @@ -2133,6 +2148,9 @@ class MacroAssembler: public Assembler { void fld_x(Address src) { Assembler::fld_x(src); } void fld_x(AddressLiteral src); + void fmul_s(Address src) { Assembler::fmul_s(src); } + void fmul_s(AddressLiteral src) { Assembler::fmul_s(as_Address(src)); } + void ldmxcsr(Address src) { Assembler::ldmxcsr(src); } void ldmxcsr(AddressLiteral src); @@ -2149,10 +2167,50 @@ private: public: + void addsd(XMMRegister dst, XMMRegister src) { Assembler::addsd(dst, src); } + void addsd(XMMRegister dst, Address src) { Assembler::addsd(dst, src); } + void addsd(XMMRegister dst, AddressLiteral src) { Assembler::addsd(dst, as_Address(src)); } + + void addss(XMMRegister dst, XMMRegister src) { Assembler::addss(dst, src); } + void addss(XMMRegister dst, Address src) { Assembler::addss(dst, src); } + void addss(XMMRegister dst, AddressLiteral src) { Assembler::addss(dst, as_Address(src)); } + + void divsd(XMMRegister dst, XMMRegister src) { Assembler::divsd(dst, src); } + void divsd(XMMRegister dst, Address src) { Assembler::divsd(dst, src); } + void divsd(XMMRegister dst, AddressLiteral src) { Assembler::divsd(dst, as_Address(src)); } + + void divss(XMMRegister dst, XMMRegister src) { Assembler::divss(dst, src); } + void divss(XMMRegister dst, Address src) { Assembler::divss(dst, src); } + void divss(XMMRegister dst, AddressLiteral src) { Assembler::divss(dst, as_Address(src)); } + void movsd(XMMRegister dst, XMMRegister src) { Assembler::movsd(dst, src); } void movsd(Address dst, XMMRegister src) { Assembler::movsd(dst, src); } void movsd(XMMRegister dst, Address src) { Assembler::movsd(dst, src); } - void movsd(XMMRegister dst, AddressLiteral src); + void movsd(XMMRegister dst, AddressLiteral src) { Assembler::movsd(dst, as_Address(src)); } + + void mulsd(XMMRegister dst, XMMRegister src) { Assembler::mulsd(dst, src); } + void mulsd(XMMRegister dst, Address src) { Assembler::mulsd(dst, src); } + void mulsd(XMMRegister dst, AddressLiteral src) { Assembler::mulsd(dst, as_Address(src)); } + + void mulss(XMMRegister dst, XMMRegister src) { Assembler::mulss(dst, src); } + void mulss(XMMRegister dst, Address src) { Assembler::mulss(dst, src); } + void mulss(XMMRegister dst, AddressLiteral src) { Assembler::mulss(dst, as_Address(src)); } + + void sqrtsd(XMMRegister dst, XMMRegister src) { Assembler::sqrtsd(dst, src); } + void sqrtsd(XMMRegister dst, Address src) { Assembler::sqrtsd(dst, src); } + void sqrtsd(XMMRegister dst, AddressLiteral src) { Assembler::sqrtsd(dst, as_Address(src)); } + + void sqrtss(XMMRegister dst, XMMRegister src) { Assembler::sqrtss(dst, src); } + void sqrtss(XMMRegister dst, Address src) { Assembler::sqrtss(dst, src); } + void sqrtss(XMMRegister dst, AddressLiteral src) { Assembler::sqrtss(dst, as_Address(src)); } + + void subsd(XMMRegister dst, XMMRegister src) { Assembler::subsd(dst, src); } + void subsd(XMMRegister dst, Address src) { Assembler::subsd(dst, src); } + void subsd(XMMRegister dst, AddressLiteral src) { Assembler::subsd(dst, as_Address(src)); } + + void subss(XMMRegister dst, XMMRegister src) { Assembler::subss(dst, src); } + void subss(XMMRegister dst, Address src) { Assembler::subss(dst, src); } + void subss(XMMRegister dst, AddressLiteral src) { Assembler::subss(dst, as_Address(src)); } void ucomiss(XMMRegister dst, XMMRegister src) { Assembler::ucomiss(dst, src); } void ucomiss(XMMRegister dst, Address src) { Assembler::ucomiss(dst, src); } @@ -2272,3 +2330,5 @@ class SkipIfEqual { #ifdef ASSERT inline bool AbstractAssembler::pd_check_instruction_mark() { return true; } #endif + +#endif // CPU_X86_VM_ASSEMBLER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.inline.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.inline.hpp index 1198dad1e58..125bf3ffff0 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef CPU_X86_VM_ASSEMBLER_X86_INLINE_HPP +#define CPU_X86_VM_ASSEMBLER_X86_INLINE_HPP + +#include "asm/assembler.inline.hpp" +#include "asm/codeBuffer.hpp" +#include "code/codeCache.hpp" +#include "runtime/handles.inline.hpp" + inline void MacroAssembler::pd_patch_instruction(address branch, address target) { unsigned char op = branch[0]; assert(op == 0xE8 /* call */ || @@ -85,3 +93,5 @@ inline void Assembler::emit_long64(jlong x) { code_section()->set_end(_code_pos); } #endif // _LP64 + +#endif // CPU_X86_VM_ASSEMBLER_X86_INLINE_HPP diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp index bb6fe1e1d59..5e606224fac 100644 --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp +++ b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,30 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_bytecodeInterpreter_x86.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interpreter/bytecodeInterpreter.hpp" +#include "interpreter/bytecodeInterpreter.inline.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" +#ifdef TARGET_ARCH_MODEL_x86_32 +# include "interp_masm_x86_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_x86_64 +# include "interp_masm_x86_64.hpp" +#endif #ifdef CC_INTERP diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp index 00343c045b3..e4eaa751286 100644 --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp +++ b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP +#define CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP + // Platform specific for C++ based Interpreter private: @@ -108,3 +111,5 @@ inline intptr_t* sender_sp() { ((VMJavaVal64*)(addr))->d) #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \ ((VMJavaVal64*)(addr))->l) + +#endif // CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp index 1c5616aa352..4f60b455801 100644 --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP +#define CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP + // Inline interpreter functions for IA32 inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; } @@ -278,3 +281,5 @@ inline jshort BytecodeInterpreter::VMint2Short(jint val) { inline jbyte BytecodeInterpreter::VMint2Byte(jint val) { return (jbyte) val; } + +#endif // CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP diff --git a/hotspot/src/cpu/x86/vm/bytecodes_x86.cpp b/hotspot/src/cpu/x86/vm/bytecodes_x86.cpp index d9ddba8dd38..4e6993548c9 100644 --- a/hotspot/src/cpu/x86/vm/bytecodes_x86.cpp +++ b/hotspot/src/cpu/x86/vm/bytecodes_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,8 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_bytecodes_x86.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/bytecodes.hpp" void Bytecodes::pd_initialize() { diff --git a/hotspot/src/cpu/x86/vm/bytecodes_x86.hpp b/hotspot/src/cpu/x86/vm/bytecodes_x86.hpp index aab08d90b42..e21c16a09ae 100644 --- a/hotspot/src/cpu/x86/vm/bytecodes_x86.hpp +++ b/hotspot/src/cpu/x86/vm/bytecodes_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,4 +22,9 @@ * */ +#ifndef CPU_X86_VM_BYTECODES_X86_HPP +#define CPU_X86_VM_BYTECODES_X86_HPP + // No i486 specific bytecodes + +#endif // CPU_X86_VM_BYTECODES_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/bytes_x86.hpp b/hotspot/src/cpu/x86/vm/bytes_x86.hpp index d62120c7041..ac096dc3737 100644 --- a/hotspot/src/cpu/x86/vm/bytes_x86.hpp +++ b/hotspot/src/cpu/x86/vm/bytes_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef CPU_X86_VM_BYTES_X86_HPP +#define CPU_X86_VM_BYTES_X86_HPP + +#include "memory/allocation.hpp" + class Bytes: AllStatic { private: #ifndef AMD64 @@ -67,4 +72,15 @@ class Bytes: AllStatic { // The following header contains the implementations of swap_u2, swap_u4, and swap_u8[_base] -#include "incls/_bytes_pd.inline.hpp.incl" +#ifdef TARGET_OS_ARCH_linux_x86 +# include "bytes_linux_x86.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_solaris_x86 +# include "bytes_solaris_x86.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_windows_x86 +# include "bytes_windows_x86.inline.hpp" +#endif + + +#endif // CPU_X86_VM_BYTES_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp index 42269daf59e..62088bd100e 100644 --- a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp @@ -22,8 +22,18 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_CodeStubs_x86.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_CodeStubs.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "nativeInst_x86.hpp" +#include "runtime/sharedRuntime.hpp" +#include "vmreg_x86.inline.hpp" +#ifndef SERIALGC +#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" +#endif #define __ ce->masm()-> @@ -83,7 +93,8 @@ RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception) , _index(index) { - _info = info == NULL ? NULL : new CodeEmitInfo(info); + assert(info != NULL, "must have info"); + _info = new CodeEmitInfo(info); } @@ -472,7 +483,7 @@ void G1PreBarrierStub::emit_code(LIR_Assembler* ce) { Register pre_val_reg = pre_val()->as_register(); - ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false); + ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/); __ cmpptr(pre_val_reg, (int32_t) NULL_WORD); __ jcc(Assembler::equal, _continuation); @@ -498,7 +509,7 @@ void G1PostBarrierStub::emit_code(LIR_Assembler* ce) { Register new_val_reg = new_val()->as_register(); __ cmpptr(new_val_reg, (int32_t) NULL_WORD); __ jcc(Assembler::equal, _continuation); - ce->store_parameter(addr()->as_register(), 0); + ce->store_parameter(addr()->as_pointer_register(), 0); __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_post_barrier_slow_id))); __ jmp(_continuation); } diff --git a/hotspot/src/cpu/x86/vm/c1_Defs_x86.hpp b/hotspot/src/cpu/x86/vm/c1_Defs_x86.hpp index 2fd08e2140b..dab876adc8a 100644 --- a/hotspot/src/cpu/x86/vm/c1_Defs_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_Defs_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_C1_DEFS_X86_HPP +#define CPU_X86_VM_C1_DEFS_X86_HPP + // native word offsets from memory address (little endian) enum { pd_lo_word_offset_in_bytes = 0, @@ -58,8 +61,8 @@ enum { pd_nof_xmm_regs_linearscan = pd_nof_xmm_regs_frame_map, // number of registers visible to linear scan pd_first_cpu_reg = 0, pd_last_cpu_reg = NOT_LP64(5) LP64_ONLY(11), - pd_first_byte_reg = 2, - pd_last_byte_reg = 5, + pd_first_byte_reg = NOT_LP64(2) LP64_ONLY(0), + pd_last_byte_reg = NOT_LP64(5) LP64_ONLY(11), pd_first_fpu_reg = pd_nof_cpu_regs_frame_map, pd_last_fpu_reg = pd_first_fpu_reg + 7, pd_first_xmm_reg = pd_nof_cpu_regs_frame_map + pd_nof_fpu_regs_frame_map, @@ -71,3 +74,5 @@ enum { enum { pd_float_saved_as_double = true }; + +#endif // CPU_X86_VM_C1_DEFS_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.cpp b/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.cpp index f8ce059955d..3fbd57c5ca3 100644 --- a/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_FpuStackSim_x86.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_FpuStackSim.hpp" +#include "c1/c1_FrameMap.hpp" +#include "utilities/array.hpp" +#include "utilities/ostream.hpp" //-------------------------------------------------------- // FpuStackSim diff --git a/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.hpp b/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.hpp index 29dabd254be..ae1e0d5904d 100644 --- a/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_C1_FPUSTACKSIM_X86_HPP +#define CPU_X86_VM_C1_FPUSTACKSIM_X86_HPP + // Simulates the FPU stack and maintains mapping [fpu-register -> stack offset] // FPU registers are described as numbers from 0..nof_fpu_regs-1 @@ -65,3 +68,5 @@ class FpuStackSim VALUE_OBJ_CLASS_SPEC { void print() PRODUCT_RETURN; }; + +#endif // CPU_X86_VM_C1_FPUSTACKSIM_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp index 20e78c242c5..52f42977f71 100644 --- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp @@ -22,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_FrameMap_x86.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_LIR.hpp" +#include "runtime/sharedRuntime.hpp" +#include "vmreg_x86.inline.hpp" const int FrameMap::pd_c_runtime_reserved_arg_size = 0; @@ -155,9 +158,11 @@ void FrameMap::initialize() { map_register( 6, r8); r8_opr = LIR_OprFact::single_cpu(6); map_register( 7, r9); r9_opr = LIR_OprFact::single_cpu(7); map_register( 8, r11); r11_opr = LIR_OprFact::single_cpu(8); - map_register( 9, r12); r12_opr = LIR_OprFact::single_cpu(9); - map_register(10, r13); r13_opr = LIR_OprFact::single_cpu(10); - map_register(11, r14); r14_opr = LIR_OprFact::single_cpu(11); + map_register( 9, r13); r13_opr = LIR_OprFact::single_cpu(9); + map_register(10, r14); r14_opr = LIR_OprFact::single_cpu(10); + // r12 is allocated conditionally. With compressed oops it holds + // the heapbase value and is not visible to the allocator. + map_register(11, r12); r12_opr = LIR_OprFact::single_cpu(11); // The unallocatable registers are at the end map_register(12, r10); r10_opr = LIR_OprFact::single_cpu(12); map_register(13, r15); r15_opr = LIR_OprFact::single_cpu(13); @@ -188,9 +193,9 @@ void FrameMap::initialize() { _caller_save_cpu_regs[6] = r8_opr; _caller_save_cpu_regs[7] = r9_opr; _caller_save_cpu_regs[8] = r11_opr; - _caller_save_cpu_regs[9] = r12_opr; - _caller_save_cpu_regs[10] = r13_opr; - _caller_save_cpu_regs[11] = r14_opr; + _caller_save_cpu_regs[9] = r13_opr; + _caller_save_cpu_regs[10] = r14_opr; + _caller_save_cpu_regs[11] = r12_opr; #endif // _LP64 diff --git a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp index c479663ca6e..642701c2831 100644 --- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_C1_FRAMEMAP_X86_HPP +#define CPU_X86_VM_C1_FRAMEMAP_X86_HPP + // On i486 the frame looks as follows: // // +-----------------------------+---------+----------------------------------------+----------------+----------- @@ -126,3 +129,16 @@ assert(i >= 0 && i < nof_caller_save_xmm_regs, "out of bounds"); return _caller_save_xmm_regs[i]; } + + static int adjust_reg_range(int range) { + // Reduce the number of available regs (to free r12) in case of compressed oops + if (UseCompressedOops) return range - 1; + return range; + } + + static int nof_caller_save_cpu_regs() { return adjust_reg_range(pd_nof_caller_save_cpu_regs_frame_map); } + static int last_cpu_reg() { return adjust_reg_range(pd_last_cpu_reg); } + static int last_byte_reg() { return adjust_reg_range(pd_last_byte_reg); } + +#endif // CPU_X86_VM_C1_FRAMEMAP_X86_HPP + diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index 3af7df224e6..f3ba0a2ce02 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -22,8 +22,20 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_LIRAssembler_x86.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciArrayKlass.hpp" +#include "ci/ciInstance.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "memory/barrierSet.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "nativeInst_x86.hpp" +#include "oops/objArrayKlass.hpp" +#include "runtime/sharedRuntime.hpp" // These masks are used to provide 128-bit aligned bitmasks to the XMM @@ -331,8 +343,8 @@ int LIR_Assembler::check_icache() { Register receiver = FrameMap::receiver_opr->as_register(); Register ic_klass = IC_Klass; const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9); - - if (!VerifyOops) { + const bool do_post_padding = VerifyOops || UseCompressedOops; + if (!do_post_padding) { // insert some nops so that the verified entry point is aligned on CodeEntryAlignment while ((__ offset() + ic_cmp_size) % CodeEntryAlignment != 0) { __ nop(); @@ -340,8 +352,8 @@ int LIR_Assembler::check_icache() { } int offset = __ offset(); __ inline_cache_check(receiver, IC_Klass); - assert(__ offset() % CodeEntryAlignment == 0 || VerifyOops, "alignment must be correct"); - if (VerifyOops) { + assert(__ offset() % CodeEntryAlignment == 0 || do_post_padding, "alignment must be correct"); + if (do_post_padding) { // force alignment after the cache check. // It's been verified to be aligned if !VerifyOops __ align(CodeEntryAlignment); @@ -488,7 +500,9 @@ int LIR_Assembler::emit_unwind_handler() { } if (compilation()->env()->dtrace_method_probes()) { - __ movoop(Address(rsp, 0), method()->constant_encoding()); + __ get_thread(rax); + __ movptr(Address(rsp, 0), rax); + __ movoop(Address(rsp, sizeof(void*)), method()->constant_encoding()); __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit))); } @@ -545,16 +559,16 @@ void LIR_Assembler::emit_string_compare(LIR_Opr arg0, LIR_Opr arg1, LIR_Opr dst, __ movptr (rax, arg1->as_register()); // Get addresses of first characters from both Strings - __ movptr (rsi, Address(rax, java_lang_String::value_offset_in_bytes())); - __ movptr (rcx, Address(rax, java_lang_String::offset_offset_in_bytes())); - __ lea (rsi, Address(rsi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR))); + __ load_heap_oop(rsi, Address(rax, java_lang_String::value_offset_in_bytes())); + __ movptr (rcx, Address(rax, java_lang_String::offset_offset_in_bytes())); + __ lea (rsi, Address(rsi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR))); // rbx, may be NULL add_debug_info_for_null_check_here(info); - __ movptr (rdi, Address(rbx, java_lang_String::value_offset_in_bytes())); - __ movptr (rcx, Address(rbx, java_lang_String::offset_offset_in_bytes())); - __ lea (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR))); + __ load_heap_oop(rdi, Address(rbx, java_lang_String::value_offset_in_bytes())); + __ movptr (rcx, Address(rbx, java_lang_String::offset_offset_in_bytes())); + __ lea (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR))); // compute minimum length (in rax) and difference of lengths (on top of stack) if (VM_Version::supports_cmov()) { @@ -682,13 +696,18 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod LIR_Const* c = src->as_constant_ptr(); switch (c->type()) { - case T_INT: - case T_ADDRESS: { + case T_INT: { assert(patch_code == lir_patch_none, "no patching handled here"); __ movl(dest->as_register(), c->as_jint()); break; } + case T_ADDRESS: { + assert(patch_code == lir_patch_none, "no patching handled here"); + __ movptr(dest->as_register(), c->as_jint()); + break; + } + case T_LONG: { assert(patch_code == lir_patch_none, "no patching handled here"); #ifdef _LP64 @@ -766,10 +785,13 @@ void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) { switch (c->type()) { case T_INT: // fall through case T_FLOAT: - case T_ADDRESS: __ movl(frame_map()->address_for_slot(dest->single_stack_ix()), c->as_jint_bits()); break; + case T_ADDRESS: + __ movptr(frame_map()->address_for_slot(dest->single_stack_ix()), c->as_jint_bits()); + break; + case T_OBJECT: __ movoop(frame_map()->address_for_slot(dest->single_stack_ix()), c->as_jobject()); break; @@ -792,7 +814,7 @@ void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) { } } -void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info ) { +void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info, bool wide) { assert(src->is_constant(), "should not call otherwise"); assert(dest->is_address(), "should not call otherwise"); LIR_Const* c = src->as_constant_ptr(); @@ -802,14 +824,21 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi switch (type) { case T_INT: // fall through case T_FLOAT: - case T_ADDRESS: __ movl(as_Address(addr), c->as_jint_bits()); break; + case T_ADDRESS: + __ movptr(as_Address(addr), c->as_jint_bits()); + break; + case T_OBJECT: // fall through case T_ARRAY: if (c->as_jobject() == NULL) { - __ movptr(as_Address(addr), NULL_WORD); + if (UseCompressedOops && !wide) { + __ movl(as_Address(addr), (int32_t)NULL_WORD); + } else { + __ movptr(as_Address(addr), NULL_WORD); + } } else { if (is_literal_address(addr)) { ShouldNotReachHere(); @@ -817,8 +846,14 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi } else { #ifdef _LP64 __ movoop(rscratch1, c->as_jobject()); - null_check_here = code_offset(); - __ movptr(as_Address_lo(addr), rscratch1); + if (UseCompressedOops && !wide) { + __ encode_heap_oop(rscratch1); + null_check_here = code_offset(); + __ movl(as_Address_lo(addr), rscratch1); + } else { + null_check_here = code_offset(); + __ movptr(as_Address_lo(addr), rscratch1); + } #else __ movoop(as_Address(addr), c->as_jobject()); #endif @@ -995,22 +1030,28 @@ void LIR_Assembler::reg2stack(LIR_Opr src, LIR_Opr dest, BasicType type, bool po } -void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool /* unaligned */) { +void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool wide, bool /* unaligned */) { LIR_Address* to_addr = dest->as_address_ptr(); PatchingStub* patch = NULL; + Register compressed_src = rscratch1; if (type == T_ARRAY || type == T_OBJECT) { __ verify_oop(src->as_register()); +#ifdef _LP64 + if (UseCompressedOops && !wide) { + __ movptr(compressed_src, src->as_register()); + __ encode_heap_oop(compressed_src); + } +#endif } + if (patch_code != lir_patch_none) { patch = new PatchingStub(_masm, PatchingStub::access_field_id); Address toa = as_Address(to_addr); assert(toa.disp() != 0, "must have"); } - if (info != NULL) { - add_debug_info_for_null_check_here(info); - } + int null_check_here = code_offset(); switch (type) { case T_FLOAT: { if (src->is_single_xmm()) { @@ -1036,13 +1077,17 @@ void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch break; } - case T_ADDRESS: // fall through case T_ARRAY: // fall through case T_OBJECT: // fall through -#ifdef _LP64 + if (UseCompressedOops && !wide) { + __ movl(as_Address(to_addr), compressed_src); + } else { + __ movptr(as_Address(to_addr), src->as_register()); + } + break; + case T_ADDRESS: __ movptr(as_Address(to_addr), src->as_register()); break; -#endif // _LP64 case T_INT: __ movl(as_Address(to_addr), src->as_register()); break; @@ -1099,6 +1144,9 @@ void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch default: ShouldNotReachHere(); } + if (info != NULL) { + add_debug_info_for_null_check(null_check_here, info); + } if (patch_code != lir_patch_none) { patching_epilog(patch, patch_code, to_addr->base()->as_register(), info); @@ -1182,7 +1230,7 @@ void LIR_Assembler::stack2stack(LIR_Opr src, LIR_Opr dest, BasicType type) { } -void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool /* unaligned */) { +void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool wide, bool /* unaligned */) { assert(src->is_address(), "should not call otherwise"); assert(dest->is_register(), "should not call otherwise"); @@ -1236,13 +1284,18 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch break; } - case T_ADDRESS: // fall through case T_OBJECT: // fall through case T_ARRAY: // fall through -#ifdef _LP64 + if (UseCompressedOops && !wide) { + __ movl(dest->as_register(), from_addr); + } else { + __ movptr(dest->as_register(), from_addr); + } + break; + + case T_ADDRESS: __ movptr(dest->as_register(), from_addr); break; -#endif // _L64 case T_INT: __ movl(dest->as_register(), from_addr); break; @@ -1337,6 +1390,11 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch } if (type == T_ARRAY || type == T_OBJECT) { +#ifdef _LP64 + if (UseCompressedOops && !wide) { + __ decode_heap_oop(dest->as_register()); + } +#endif __ verify_oop(dest->as_register()); } } @@ -1658,11 +1716,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L ciMethod* method = op->profiled_method(); assert(method != NULL, "Should have method"); int bci = op->profiled_bci(); - md = method->method_data(); - if (md == NULL) { - bailout("out of memory building methodDataOop"); - return; - } + md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); data = md->bci_to_data(bci); assert(data != NULL, "need data for type check"); assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); @@ -1676,7 +1731,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L } else if (obj == klass_RInfo) { klass_RInfo = dst; } - if (k->is_loaded()) { + if (k->is_loaded() && !UseCompressedOops) { select_different_registers(obj, dst, k_RInfo, klass_RInfo); } else { Rtmp1 = op->tmp3()->as_register(); @@ -1713,21 +1768,26 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L if (op->fast_check()) { // get object class // not a safepoint as obj null check happens earlier - if (k->is_loaded()) { #ifdef _LP64 - __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes())); -#else - __ cmpoop(Address(obj, oopDesc::klass_offset_in_bytes()), k->constant_encoding()); -#endif // _LP64 + if (UseCompressedOops) { + __ load_klass(Rtmp1, obj); + __ cmpptr(k_RInfo, Rtmp1); } else { __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes())); } +#else + if (k->is_loaded()) { + __ cmpoop(Address(obj, oopDesc::klass_offset_in_bytes()), k->constant_encoding()); + } else { + __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes())); + } +#endif __ jcc(Assembler::notEqual, *failure_target); // successful cast, fall through to profile or jump } else { // get object class // not a safepoint as obj null check happens earlier - __ movptr(klass_RInfo, Address(obj, oopDesc::klass_offset_in_bytes())); + __ load_klass(klass_RInfo, obj); if (k->is_loaded()) { // See if we get an immediate positive hit #ifdef _LP64 @@ -1782,7 +1842,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L Register mdo = klass_RInfo, recv = k_RInfo; __ bind(profile_cast_success); __ movoop(mdo, md->constant_encoding()); - __ movptr(recv, Address(obj, oopDesc::klass_offset_in_bytes())); + __ load_klass(recv, obj); Label update_done; type_profile_helper(mdo, md, data, recv, success); __ jmp(*success); @@ -1816,11 +1876,8 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { ciMethod* method = op->profiled_method(); assert(method != NULL, "Should have method"); int bci = op->profiled_bci(); - md = method->method_data(); - if (md == NULL) { - bailout("out of memory building methodDataOop"); - return; - } + md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); data = md->bci_to_data(bci); assert(data != NULL, "need data for type check"); assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); @@ -1846,10 +1903,10 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { } add_debug_info_for_null_check_here(op->info_for_exception()); - __ movptr(k_RInfo, Address(array, oopDesc::klass_offset_in_bytes())); - __ movptr(klass_RInfo, Address(value, oopDesc::klass_offset_in_bytes())); + __ load_klass(k_RInfo, array); + __ load_klass(klass_RInfo, value); - // get instance klass + // get instance klass (it's already uncompressed) __ movptr(k_RInfo, Address(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc))); // perform the fast part of the checking logic __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, NULL); @@ -1868,7 +1925,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { Register mdo = klass_RInfo, recv = k_RInfo; __ bind(profile_cast_success); __ movoop(mdo, md->constant_encoding()); - __ movptr(recv, Address(value, oopDesc::klass_offset_in_bytes())); + __ load_klass(recv, value); Label update_done; type_profile_helper(mdo, md, data, recv, &done); __ jmpb(done); @@ -1932,15 +1989,32 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) { assert(cmpval != newval, "cmp and new values must be in different registers"); assert(cmpval != addr, "cmp and addr must be in different registers"); assert(newval != addr, "new value and addr must be in different registers"); - if (os::is_MP()) { - __ lock(); - } + if ( op->code() == lir_cas_obj) { - __ cmpxchgptr(newval, Address(addr, 0)); - } else if (op->code() == lir_cas_int) { - __ cmpxchgl(newval, Address(addr, 0)); +#ifdef _LP64 + if (UseCompressedOops) { + __ encode_heap_oop(cmpval); + __ mov(rscratch1, newval); + __ encode_heap_oop(rscratch1); + if (os::is_MP()) { + __ lock(); + } + // cmpval (rax) is implicitly used by this instruction + __ cmpxchgl(rscratch1, Address(addr, 0)); + } else +#endif + { + if (os::is_MP()) { + __ lock(); + } + __ cmpxchgptr(newval, Address(addr, 0)); + } } else { - LP64_ONLY(__ cmpxchgq(newval, Address(addr, 0))); + assert(op->code() == lir_cas_int, "lir_cas_int expected"); + if (os::is_MP()) { + __ lock(); + } + __ cmpxchgl(newval, Address(addr, 0)); } #ifdef _LP64 } else if (op->code() == lir_cas_long) { @@ -1962,7 +2036,7 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) { } } -void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result) { +void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) { Assembler::Condition acond, ncond; switch (condition) { case lir_cond_equal: acond = Assembler::equal; ncond = Assembler::notEqual; break; @@ -3181,8 +3255,13 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { } if (flags & LIR_OpArrayCopy::type_check) { - __ movptr(tmp, src_klass_addr); - __ cmpptr(tmp, dst_klass_addr); + if (UseCompressedOops) { + __ movl(tmp, src_klass_addr); + __ cmpl(tmp, dst_klass_addr); + } else { + __ movptr(tmp, src_klass_addr); + __ cmpptr(tmp, dst_klass_addr); + } __ jcc(Assembler::notEqual, *stub->entry()); } @@ -3197,13 +3276,23 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { // but not necessarily exactly of type default_type. Label known_ok, halt; __ movoop(tmp, default_type->constant_encoding()); +#ifdef _LP64 + if (UseCompressedOops) { + __ encode_heap_oop(tmp); + } +#endif + if (basic_type != T_OBJECT) { - __ cmpptr(tmp, dst_klass_addr); + + if (UseCompressedOops) __ cmpl(tmp, dst_klass_addr); + else __ cmpptr(tmp, dst_klass_addr); __ jcc(Assembler::notEqual, halt); - __ cmpptr(tmp, src_klass_addr); + if (UseCompressedOops) __ cmpl(tmp, src_klass_addr); + else __ cmpptr(tmp, src_klass_addr); __ jcc(Assembler::equal, known_ok); } else { - __ cmpptr(tmp, dst_klass_addr); + if (UseCompressedOops) __ cmpl(tmp, dst_klass_addr); + else __ cmpptr(tmp, dst_klass_addr); __ jcc(Assembler::equal, known_ok); __ cmpptr(src, dst); __ jcc(Assembler::equal, known_ok); @@ -3277,11 +3366,8 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { int bci = op->profiled_bci(); // Update counter for all call types - ciMethodData* md = method->method_data(); - if (md == NULL) { - bailout("out of memory building methodDataOop"); - return; - } + ciMethodData* md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(bci); assert(data->is_CounterData(), "need CounterData for calls"); assert(op->mdo()->is_single_cpu(), "mdo must be allocated"); @@ -3332,7 +3418,7 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { } } } else { - __ movptr(recv, Address(recv, oopDesc::klass_offset_in_bytes())); + __ load_klass(recv, recv); Label update_done; type_profile_helper(mdo, md, data, recv, &update_done); // Receiver did not match any saved receiver and there is no empty row for it. diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.hpp index f1b0ed88021..daccb39e0f2 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP +#define CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP + private: Address::ScaleFactor array_element_size(BasicType type) const; @@ -56,3 +59,5 @@ public: exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(175), deopt_handler_size = NOT_LP64(10) LP64_ONLY(17) }; + +#endif // CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index 05df6bda708..cdea66f3866 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -22,8 +22,20 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_LIRGenerator_x86.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_LIRGenerator.hpp" +#include "c1/c1_Runtime1.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciArray.hpp" +#include "ci/ciObjArrayKlass.hpp" +#include "ci/ciTypeArrayKlass.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "vmreg_x86.inline.hpp" #ifdef ASSERT #define __ gen()->lir(__FILE__, __LINE__)-> @@ -107,7 +119,7 @@ bool LIRGenerator::can_store_as_constant(Value v, BasicType type) const { return false; } Constant* c = v->as_Constant(); - if (c && c->state() == NULL) { + if (c && c->state_before() == NULL) { // constants of any type can be stored directly, except for // unloaded object constants. return true; @@ -250,7 +262,7 @@ void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) void LIRGenerator::do_StoreIndexed(StoreIndexed* x) { - assert(x->is_root(),""); + assert(x->is_pinned(),""); bool needs_range_check = true; bool use_length = x->length() != NULL; bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT; @@ -325,7 +337,7 @@ void LIRGenerator::do_StoreIndexed(StoreIndexed* x) { void LIRGenerator::do_MonitorEnter(MonitorEnter* x) { - assert(x->is_root(),""); + assert(x->is_pinned(),""); LIRItem obj(x->obj(), this); obj.load_item(); @@ -341,7 +353,7 @@ void LIRGenerator::do_MonitorEnter(MonitorEnter* x) { CodeEmitInfo* info_for_exception = NULL; if (x->needs_null_check()) { - info_for_exception = state_for(x, x->lock_stack_before()); + info_for_exception = state_for(x); } // this CodeEmitInfo must not have the xhandlers because here the // object is already locked (xhandlers expect object to be unlocked) @@ -352,7 +364,7 @@ void LIRGenerator::do_MonitorEnter(MonitorEnter* x) { void LIRGenerator::do_MonitorExit(MonitorExit* x) { - assert(x->is_root(),""); + assert(x->is_pinned(),""); LIRItem obj(x->obj(), this); obj.dont_load_item(); @@ -729,7 +741,7 @@ void LIRGenerator::do_AttemptUpdate(Intrinsic* x) { // generate conditional move of boolean result LIR_Opr result = rlock_result(x); - __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result); + __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result, T_LONG); } @@ -798,7 +810,8 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { // generate conditional move of boolean result LIR_Opr result = rlock_result(x); - __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result); + __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), + result, as_BasicType(type)); if (type == objectType) { // Write-barrier needed for Object fields. // Seems to be precise post_barrier(addr, val.result()); @@ -862,6 +875,10 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { void LIRGenerator::do_ArrayCopy(Intrinsic* x) { assert(x->number_of_arguments() == 5, "wrong type"); + + // Make all state_for calls early since they can emit code + CodeEmitInfo* info = state_for(x, x->state()); + LIRItem src(x->argument_at(0), this); LIRItem src_pos(x->argument_at(1), this); LIRItem dst(x->argument_at(2), this); @@ -904,7 +921,6 @@ void LIRGenerator::do_ArrayCopy(Intrinsic* x) { ciArrayKlass* expected_type; arraycopy_helper(x, &flags, &expected_type); - CodeEmitInfo* info = state_for(x, x->state()); // we may want to have stack (deoptimization?) __ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(), length.result(), tmp, expected_type, flags, info); // does add_safepoint } @@ -984,9 +1000,11 @@ void LIRGenerator::do_Convert(Convert* x) { void LIRGenerator::do_NewInstance(NewInstance* x) { +#ifndef PRODUCT if (PrintNotLoaded && !x->klass()->is_loaded()) { - tty->print_cr(" ###class not loaded at new bci %d", x->bci()); + tty->print_cr(" ###class not loaded at new bci %d", x->printable_bci()); } +#endif CodeEmitInfo* info = state_for(x, x->state()); LIR_Opr reg = result_register_for(x->type()); LIR_Opr klass_reg = new_register(objectType); @@ -1127,7 +1145,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { obj.load_item(); // info for exceptions - CodeEmitInfo* info_for_exception = state_for(x, x->state()->copy_locks()); + CodeEmitInfo* info_for_exception = state_for(x); CodeStub* stub; if (x->is_incompatible_class_change_check()) { @@ -1137,9 +1155,12 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); } LIR_Opr reg = rlock_result(x); + LIR_Opr tmp3 = LIR_OprFact::illegalOpr; + if (!x->klass()->is_loaded() || UseCompressedOops) { + tmp3 = new_register(objectType); + } __ checkcast(reg, obj.result(), x->klass(), - new_register(objectType), new_register(objectType), - !x->klass()->is_loaded() ? new_register(objectType) : LIR_OprFact::illegalOpr, + new_register(objectType), new_register(objectType), tmp3, x->direct_compare(), info_for_exception, patching_info, stub, x->profiled_method(), x->profiled_bci()); } @@ -1156,9 +1177,12 @@ void LIRGenerator::do_InstanceOf(InstanceOf* x) { patching_info = state_for(x, x->state_before()); } obj.load_item(); + LIR_Opr tmp3 = LIR_OprFact::illegalOpr; + if (!x->klass()->is_loaded() || UseCompressedOops) { + tmp3 = new_register(objectType); + } __ instanceof(reg, obj.result(), x->klass(), - new_register(objectType), new_register(objectType), - !x->klass()->is_loaded() ? new_register(objectType) : LIR_OprFact::illegalOpr, + new_register(objectType), new_register(objectType), tmp3, x->direct_compare(), patching_info, x->profiled_method(), x->profiled_bci()); } diff --git a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp index f1d005d6ace..0c19851b31f 100644 --- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_LinearScan_x86.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_LinearScan.hpp" +#include "utilities/bitMap.inline.hpp" //---------------------------------------------------------------------- diff --git a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp index 814d25eaf1a..efb2002fd65 100644 --- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,24 +22,26 @@ * */ +#ifndef CPU_X86_VM_C1_LINEARSCAN_X86_HPP +#define CPU_X86_VM_C1_LINEARSCAN_X86_HPP + inline bool LinearScan::is_processed_reg_num(int reg_num) { #ifndef _LP64 // rsp and rbp (numbers 6 ancd 7) are ignored assert(FrameMap::rsp_opr->cpu_regnr() == 6, "wrong assumption below"); assert(FrameMap::rbp_opr->cpu_regnr() == 7, "wrong assumption below"); assert(reg_num >= 0, "invalid reg_num"); - - return reg_num < 6 || reg_num > 7; #else - // rsp and rbp, r10, r15 (numbers 6 ancd 7) are ignored + // rsp and rbp, r10, r15 (numbers [12,15]) are ignored + // r12 (number 11) is conditional on compressed oops. + assert(FrameMap::r12_opr->cpu_regnr() == 11, "wrong assumption below"); assert(FrameMap::r10_opr->cpu_regnr() == 12, "wrong assumption below"); assert(FrameMap::r15_opr->cpu_regnr() == 13, "wrong assumption below"); assert(FrameMap::rsp_opr->cpu_regnrLo() == 14, "wrong assumption below"); assert(FrameMap::rbp_opr->cpu_regnrLo() == 15, "wrong assumption below"); assert(reg_num >= 0, "invalid reg_num"); - - return reg_num < 12 || reg_num > 15; #endif // _LP64 + return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map; } inline int LinearScan::num_physical_regs(BasicType type) { @@ -101,7 +103,7 @@ inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) { if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::byte_reg)) { assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only"); _first_reg = pd_first_byte_reg; - _last_reg = pd_last_byte_reg; + _last_reg = FrameMap::last_byte_reg(); return true; } else if ((UseSSE >= 1 && cur->type() == T_FLOAT) || (UseSSE >= 2 && cur->type() == T_DOUBLE)) { _first_reg = pd_first_xmm_reg; @@ -185,3 +187,5 @@ class FpuStackAllocator VALUE_OBJ_CLASS_SPEC { FpuStackAllocator(Compilation* compilation, LinearScan* allocator); void allocate(); }; + +#endif // CPU_X86_VM_C1_LINEARSCAN_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp index b3d8c1f2e66..d386a99a096 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 (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,18 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_MacroAssembler_x86.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "classfile/systemDictionary.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "interpreter/interpreter.hpp" +#include "oops/arrayOop.hpp" +#include "oops/markOop.hpp" +#include "runtime/basicLock.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/os.hpp" +#include "runtime/stubRoutines.hpp" int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr, Register scratch, Label& slow_case) { const int aligned_mask = BytesPerWord -1; @@ -131,6 +141,7 @@ void C1_MacroAssembler::try_allocate(Register obj, Register var_size_in_bytes, i tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case); } else { eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case); + incr_allocated_bytes(noreg, var_size_in_bytes, con_size_in_bytes, t1); } } @@ -145,11 +156,26 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register // This assumes that all prototype bits fit in an int32_t movptr(Address(obj, oopDesc::mark_offset_in_bytes ()), (int32_t)(intptr_t)markOopDesc::prototype()); } +#ifdef _LP64 + if (UseCompressedOops) { // Take care not to kill klass + movptr(t1, klass); + encode_heap_oop_not_null(t1); + movl(Address(obj, oopDesc::klass_offset_in_bytes()), t1); + } else +#endif + { + movptr(Address(obj, oopDesc::klass_offset_in_bytes()), klass); + } - movptr(Address(obj, oopDesc::klass_offset_in_bytes()), klass); if (len->is_valid()) { movl(Address(obj, arrayOopDesc::length_offset_in_bytes()), len); } +#ifdef _LP64 + else if (UseCompressedOops) { + xorptr(t1, t1); + store_klass_gap(obj, t1); + } +#endif } @@ -209,7 +235,7 @@ void C1_MacroAssembler::initialize_body(Register obj, Register len_in_bytes, int void C1_MacroAssembler::allocate_object(Register obj, Register t1, Register t2, int header_size, int object_size, Register klass, Label& slow_case) { assert(obj == rax, "obj must be in rax, for cmpxchg"); - assert(obj != t1 && obj != t2 && t1 != t2, "registers must be different"); // XXX really? + assert_different_registers(obj, t1, t2); // XXX really? assert(header_size >= 0 && object_size >= header_size, "illegal sizes"); try_allocate(obj, noreg, object_size * BytesPerWord, t1, t2, slow_case); @@ -220,7 +246,7 @@ void C1_MacroAssembler::allocate_object(Register obj, Register t1, Register t2, void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2) { assert((con_size_in_bytes & MinObjAlignmentInBytesMask) == 0, "con_size_in_bytes is not multiple of alignment"); - const int hdr_size_in_bytes = instanceOopDesc::base_offset_in_bytes(); + const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize; initialize_header(obj, klass, noreg, t1, t2); @@ -307,13 +333,19 @@ void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) { // check against inline cache assert(!MacroAssembler::needs_explicit_null_check(oopDesc::klass_offset_in_bytes()), "must add explicit null check"); int start_offset = offset(); - cmpptr(iCache, Address(receiver, oopDesc::klass_offset_in_bytes())); + + if (UseCompressedOops) { + load_klass(rscratch1, receiver); + cmpptr(rscratch1, iCache); + } else { + cmpptr(iCache, Address(receiver, oopDesc::klass_offset_in_bytes())); + } // if icache check fails, then jump to runtime routine // Note: RECEIVER must still contain the receiver! jump_cc(Assembler::notEqual, RuntimeAddress(SharedRuntime::get_ic_miss_stub())); const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9); - assert(offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry"); + assert(UseCompressedOops || offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry"); } diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp index 56765a34f85..c53937c78a0 100644 --- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_C1_MACROASSEMBLER_X86_HPP +#define CPU_X86_VM_C1_MACROASSEMBLER_X86_HPP + // C1_MacroAssembler contains high-level macros for C1 private: @@ -113,3 +116,5 @@ } void invalidate_registers(bool inv_rax, bool inv_rbx, bool inv_rcx, bool inv_rdx, bool inv_rsi, bool inv_rdi) PRODUCT_RETURN; + +#endif // CPU_X86_VM_C1_MACROASSEMBLER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp index 9c9341038ec..0a56804258d 100644 --- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,20 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_Runtime1_x86.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Defs.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "interpreter/interpreter.hpp" +#include "nativeInst_x86.hpp" +#include "oops/compiledICHolderOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "register_x86.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/signature.hpp" +#include "runtime/vframeArray.hpp" +#include "vmreg_x86.inline.hpp" // Implementation of StubAssembler @@ -965,7 +977,6 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // verify that that there is really a valid exception in rax, __ verify_not_null_oop(exception_oop); - oop_maps = new OopMapSet(); OopMap* oop_map = generate_oop_map(sasm, 1); generate_handle_exception(sasm, oop_maps, oop_map); @@ -1025,13 +1036,16 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // if we got here then the TLAB allocation failed, so try // refilling the TLAB or allocating directly from eden. Label retry_tlab, try_eden; - __ tlab_refill(retry_tlab, try_eden, slow_path); // does not destroy rdx (klass) + const Register thread = + __ tlab_refill(retry_tlab, try_eden, slow_path); // does not destroy rdx (klass), returns rdi __ bind(retry_tlab); // get the instance size (size is postive so movl is fine for 64bit) __ movl(obj_size, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); + __ tlab_allocate(obj, obj_size, 0, t1, t2, slow_path); + __ initialize_object(obj, klass, obj_size, 0, t1, t2); __ verify_oop(obj); __ pop(rbx); @@ -1041,7 +1055,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ bind(try_eden); // get the instance size (size is postive so movl is fine for 64bit) __ movl(obj_size, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); + __ eden_allocate(obj, obj_size, 0, t1, slow_path); + __ incr_allocated_bytes(thread, obj_size, 0); + __ initialize_object(obj, klass, obj_size, 0, t1, t2); __ verify_oop(obj); __ pop(rbx); @@ -1131,12 +1148,13 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // if we got here then the TLAB allocation failed, so try // refilling the TLAB or allocating directly from eden. Label retry_tlab, try_eden; - __ tlab_refill(retry_tlab, try_eden, slow_path); // preserves rbx, & rdx + const Register thread = + __ tlab_refill(retry_tlab, try_eden, slow_path); // preserves rbx & rdx, returns rdi __ bind(retry_tlab); // get the allocation size: round_up(hdr + length << (layout_helper & 0x1F)) - // since size is postive movl does right thing on 64bit + // since size is positive movl does right thing on 64bit __ movl(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); // since size is postive movl does right thing on 64bit __ movl(arr_size, length); @@ -1163,7 +1181,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ bind(try_eden); // get the allocation size: round_up(hdr + length << (layout_helper & 0x1F)) - // since size is postive movl does right thing on 64bit + // since size is positive movl does right thing on 64bit __ movl(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); // since size is postive movl does right thing on 64bit __ movl(arr_size, length); @@ -1176,6 +1194,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ andptr(arr_size, ~MinObjAlignmentInBytesMask); __ eden_allocate(obj, arr_size, 0, t1, slow_path); // preserves arr_size + __ incr_allocated_bytes(thread, arr_size, 0); __ initialize_header(obj, klass, length, t1, t2); __ movb(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes() + (Klass::_lh_header_size_shift / BitsPerByte))); @@ -1249,7 +1268,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // load the klass and check the has finalizer flag Label register_finalizer; Register t = rsi; - __ movptr(t, Address(rax, oopDesc::klass_offset_in_bytes())); + __ load_klass(t, rax); __ movl(t, Address(t, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc))); __ testl(t, JVM_ACC_HAS_FINALIZER); __ jcc(Assembler::notZero, register_finalizer); diff --git a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp index f3700f33c7b..d6a5cc45c10 100644 --- a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp @@ -22,6 +22,12 @@ * */ +#ifndef CPU_X86_VM_C1_GLOBALS_X86_HPP +#define CPU_X86_VM_C1_GLOBALS_X86_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // Sets the default values for platform dependent flags used by the client compiler. // (see c1_globals.hpp) @@ -60,3 +66,5 @@ define_pd_global(bool, CSEArrayLength, false); define_pd_global(bool, TwoOperandLIRForm, true ); define_pd_global(intx, SafepointPollOffset, 256 ); + +#endif // CPU_X86_VM_C1_GLOBALS_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp index ae3029c4064..f41d722b42f 100644 --- a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp @@ -22,6 +22,12 @@ * */ +#ifndef CPU_X86_VM_C2_GLOBALS_X86_HPP +#define CPU_X86_VM_C2_GLOBALS_X86_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // Sets the default values for platform dependent flags used by the server compiler. // (see c2_globals.hpp). Alpha-sorted. @@ -87,3 +93,5 @@ define_pd_global(uintx,MaxPermSize, ScaleForWordSize(64*M)); // Ergonomics related flags define_pd_global(bool, NeverActAsServerClassMachine, false); + +#endif // CPU_X86_VM_C2_GLOBALS_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/c2_init_x86.cpp b/hotspot/src/cpu/x86/vm/c2_init_x86.cpp index 2d54e39c3d0..286fec21376 100644 --- a/hotspot/src/cpu/x86/vm/c2_init_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c2_init_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c2_init_x86.cpp.incl" +#include "precompiled.hpp" +#include "opto/compile.hpp" +#include "opto/node.hpp" // processor dependent initialization for i486 diff --git a/hotspot/src/cpu/x86/vm/codeBuffer_x86.hpp b/hotspot/src/cpu/x86/vm/codeBuffer_x86.hpp index 3b304a2b031..7f20314ffca 100644 --- a/hotspot/src/cpu/x86/vm/codeBuffer_x86.hpp +++ b/hotspot/src/cpu/x86/vm/codeBuffer_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ +#ifndef CPU_X86_VM_CODEBUFFER_X86_HPP +#define CPU_X86_VM_CODEBUFFER_X86_HPP + private: void pd_initialize() {} public: void flush_bundle(bool start_new_bundle) {} + +#endif // CPU_X86_VM_CODEBUFFER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/copy_x86.hpp b/hotspot/src/cpu/x86/vm/copy_x86.hpp index 32229c5a695..dbadb0e9f9e 100644 --- a/hotspot/src/cpu/x86/vm/copy_x86.hpp +++ b/hotspot/src/cpu/x86/vm/copy_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,22 @@ * */ +#ifndef CPU_X86_VM_COPY_X86_HPP +#define CPU_X86_VM_COPY_X86_HPP + // Inline functions for memory copy and fill. // Contains inline asm implementations -#include "incls/_copy_pd.inline.hpp.incl" +#ifdef TARGET_OS_ARCH_linux_x86 +# include "copy_linux_x86.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_solaris_x86 +# include "copy_solaris_x86.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_windows_x86 +# include "copy_windows_x86.inline.hpp" +#endif + static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) { #ifdef AMD64 @@ -58,3 +70,5 @@ static void pd_zero_to_words(HeapWord* tohw, size_t count) { static void pd_zero_to_bytes(void* to, size_t count) { (void)memset(to, 0, count); } + +#endif // CPU_X86_VM_COPY_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp index a6d1596911c..8f5bdd7d4ab 100644 --- a/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp +++ b/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP +#define CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP + protected: #if 0 @@ -45,3 +48,5 @@ const Register prev_state, const Register sender_sp, bool native); // C++ interpreter only + +#endif // CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp index e68219ec2cb..936bde4d811 100644 --- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp +++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,32 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_cppInterpreter_x86.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/cppInterpreter.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/arguments.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/timer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" +#ifdef SHARK +#include "shark/shark_globals.hpp" +#endif #ifdef CC_INTERP diff --git a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp index 6fda06cb3fe..797fcebe385 100644 --- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp +++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_CPPINTERPRETER_X86_HPP +#define CPU_X86_VM_CPPINTERPRETER_X86_HPP + protected: @@ -31,3 +34,5 @@ // Run with +PrintInterpreter to get the VM to print out the size. // Max size with JVMTI const static int InterpreterCodeSize = 168 * 1024; + +#endif // CPU_X86_VM_CPPINTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/debug_x86.cpp b/hotspot/src/cpu/x86/vm/debug_x86.cpp index 0169c28395e..b128439ef23 100644 --- a/hotspot/src/cpu/x86/vm/debug_x86.cpp +++ b/hotspot/src/cpu/x86/vm/debug_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,13 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_debug_x86.cpp.incl" +#include "precompiled.hpp" +#include "code/codeCache.hpp" +#include "code/nmethod.hpp" +#include "runtime/frame.hpp" +#include "runtime/init.hpp" +#include "runtime/os.hpp" +#include "utilities/debug.hpp" +#include "utilities/top.hpp" void pd_ps(frame f) {} diff --git a/hotspot/src/cpu/x86/vm/depChecker_x86.cpp b/hotspot/src/cpu/x86/vm/depChecker_x86.cpp index 9277100d15f..f00d6453137 100644 --- a/hotspot/src/cpu/x86/vm/depChecker_x86.cpp +++ b/hotspot/src/cpu/x86/vm/depChecker_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_depChecker_x86.cpp.incl" +#include "precompiled.hpp" +#include "compiler/disassembler.hpp" +#include "depChecker_x86.hpp" // Nothing to do on i486 diff --git a/hotspot/src/cpu/x86/vm/depChecker_x86.hpp b/hotspot/src/cpu/x86/vm/depChecker_x86.hpp index a9aeec14d8a..5654bbd12d4 100644 --- a/hotspot/src/cpu/x86/vm/depChecker_x86.hpp +++ b/hotspot/src/cpu/x86/vm/depChecker_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,4 +22,9 @@ * */ +#ifndef CPU_X86_VM_DEPCHECKER_X86_HPP +#define CPU_X86_VM_DEPCHECKER_X86_HPP + // Nothing to do on i486 + +#endif // CPU_X86_VM_DEPCHECKER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/disassembler_x86.hpp b/hotspot/src/cpu/x86/vm/disassembler_x86.hpp index d597da8bbe2..a3b74bac422 100644 --- a/hotspot/src/cpu/x86/vm/disassembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/disassembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_DISASSEMBLER_X86_HPP +#define CPU_X86_VM_DISASSEMBLER_X86_HPP + static int pd_instruction_alignment() { return 1; } @@ -29,3 +32,5 @@ static const char* pd_cpu_opts() { return ""; } + +#endif // CPU_X86_VM_DISASSEMBLER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/dump_x86_32.cpp b/hotspot/src/cpu/x86/vm/dump_x86_32.cpp index 057d47db1e8..a9e9ff0d91f 100644 --- a/hotspot/src/cpu/x86/vm/dump_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/dump_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_dump_x86_32.cpp.incl" +#include "precompiled.hpp" +#include "assembler_x86.inline.hpp" +#include "memory/compactingPermGenGen.hpp" +#include "memory/generation.inline.hpp" +#include "memory/space.inline.hpp" diff --git a/hotspot/src/cpu/x86/vm/dump_x86_64.cpp b/hotspot/src/cpu/x86/vm/dump_x86_64.cpp index cc3a4ade2d2..b74d2ed72d0 100644 --- a/hotspot/src/cpu/x86/vm/dump_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/dump_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_dump_x86_64.cpp.incl" +#include "precompiled.hpp" +#include "assembler_x86.inline.hpp" +#include "memory/compactingPermGenGen.hpp" +#include "memory/generation.inline.hpp" +#include "memory/space.inline.hpp" diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index a41ff1dbe3a..8f1585fb9fc 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -22,8 +22,24 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_frame_x86.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "memory/resourceArea.hpp" +#include "oops/markOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/monitorChunk.hpp" +#include "runtime/signature.hpp" +#include "runtime/stubCodeGenerator.hpp" +#include "runtime/stubRoutines.hpp" +#include "vmreg_x86.inline.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#include "runtime/vframeArray.hpp" +#endif #ifdef ASSERT void RegisterMap::check_location_valid() { diff --git a/hotspot/src/cpu/x86/vm/frame_x86.hpp b/hotspot/src/cpu/x86/vm/frame_x86.hpp index 8bb73797ba4..d949e250c59 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef CPU_X86_VM_FRAME_X86_HPP +#define CPU_X86_VM_FRAME_X86_HPP + +#include "runtime/synchronizer.hpp" +#include "utilities/top.hpp" + // A frame represents a physical stack frame (an activation). Frames can be // C or Java frames, and the Java frames can be interpreted or compiled. // In contrast, vframes represent source-level activations, so that one physical frame @@ -199,3 +205,5 @@ #ifdef CC_INTERP inline interpreterState get_interpreterState() const; #endif // CC_INTERP + +#endif // CPU_X86_VM_FRAME_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp index 0f4881c2b9a..bb9ac15cb31 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_FRAME_X86_INLINE_HPP +#define CPU_X86_VM_FRAME_X86_INLINE_HPP + // Inline functions for Intel frames: // Constructors: @@ -296,3 +299,5 @@ inline oop frame::saved_oop_result(RegisterMap* map) const { inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) { *((oop*) map->location(rax->as_VMReg())) = obj; } + +#endif // CPU_X86_VM_FRAME_X86_INLINE_HPP diff --git a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp index 3a339086201..1c032e632b2 100644 --- a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,4 +22,9 @@ * */ +#ifndef CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP +#define CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP + const int StackAlignmentInBytes = 16; + +#endif // CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index 307762d866b..41917378b56 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef CPU_X86_VM_GLOBALS_X86_HPP +#define CPU_X86_VM_GLOBALS_X86_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // Sets the default values for platform dependent flags used by the runtime system. // (see globals.hpp) @@ -63,3 +69,7 @@ define_pd_global(intx, PreInflateSpin, 10); define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); + +define_pd_global(bool, UseMembar, false); + +#endif // CPU_X86_VM_GLOBALS_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp b/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp index a21a764d625..992a67947cf 100644 --- a/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp +++ b/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_icBuffer_x86.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_x86.inline.hpp" +#include "code/icBuffer.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "interpreter/bytecodes.hpp" +#include "memory/resourceArea.hpp" +#include "nativeInst_x86.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.inline2.hpp" int InlineCacheBuffer::ic_stub_code_size() { return NativeMovConstReg::instruction_size + diff --git a/hotspot/src/cpu/x86/vm/icache_x86.cpp b/hotspot/src/cpu/x86/vm/icache_x86.cpp index a03d9a32945..91d4f4da1c1 100644 --- a/hotspot/src/cpu/x86/vm/icache_x86.cpp +++ b/hotspot/src/cpu/x86/vm/icache_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_icache_x86.cpp.incl" +#include "precompiled.hpp" +#include "assembler_x86.inline.hpp" +#include "runtime/icache.hpp" #define __ _masm-> diff --git a/hotspot/src/cpu/x86/vm/icache_x86.hpp b/hotspot/src/cpu/x86/vm/icache_x86.hpp index 3c446979d87..e02b1031073 100644 --- a/hotspot/src/cpu/x86/vm/icache_x86.hpp +++ b/hotspot/src/cpu/x86/vm/icache_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_ICACHE_X86_HPP +#define CPU_X86_VM_ICACHE_X86_HPP + // Interface for updating the instruction cache. Whenever the VM modifies // code, part of the processor instruction cache potentially has to be flushed. @@ -53,3 +56,5 @@ class ICache : public AbstractICache { }; #endif // AMD64 }; + +#endif // CPU_X86_VM_ICACHE_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp index 013c6c03739..6cc321b5576 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp @@ -22,8 +22,29 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_interp_masm_x86_32.cpp.incl" +#include "precompiled.hpp" +#include "interp_masm_x86_32.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "oops/arrayOop.hpp" +#include "oops/markOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiRedefineClassesTrace.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/basicLock.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/sharedRuntime.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif // Implementation of InterpreterMacroAssembler diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp index 600f0566f7d..404b4d5723b 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp @@ -22,6 +22,12 @@ * */ +#ifndef CPU_X86_VM_INTERP_MASM_X86_32_HPP +#define CPU_X86_VM_INTERP_MASM_X86_32_HPP + +#include "assembler_x86.inline.hpp" +#include "interpreter/invocationCounter.hpp" + // This file specializes the assember with interpreter-specific macros @@ -227,3 +233,5 @@ class InterpreterMacroAssembler: public MacroAssembler { void notify_method_exit(TosState state, NotifyMethodExitMode mode); }; + +#endif // CPU_X86_VM_INTERP_MASM_X86_32_HPP 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 6392742aac5..a156d24d66a 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp @@ -22,8 +22,29 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_interp_masm_x86_64.cpp.incl" +#include "precompiled.hpp" +#include "interp_masm_x86_64.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "oops/arrayOop.hpp" +#include "oops/markOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiRedefineClassesTrace.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/basicLock.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/sharedRuntime.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif // Implementation of InterpreterMacroAssembler @@ -428,10 +449,9 @@ void InterpreterMacroAssembler::jump_from_interpreted(Register method, Register // JVMTI events, such as single-stepping, are implemented partly by avoiding running // compiled code in threads for which the event is enabled. Check here for // interp_only_mode if these events CAN be enabled. - get_thread(temp); // interp_only is an int, on little endian it is sufficient to test the byte only - // Is a cmpl faster (ce - cmpb(Address(temp, JavaThread::interp_only_mode_offset()), 0); + // Is a cmpl faster? + cmpb(Address(r15_thread, JavaThread::interp_only_mode_offset()), 0); jcc(Assembler::zero, run_compiled_code); jmp(Address(method, methodOopDesc::interpreter_entry_offset())); bind(run_compiled_code); diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp index 6f485952580..62539a73548 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp @@ -22,6 +22,12 @@ * */ +#ifndef CPU_X86_VM_INTERP_MASM_X86_64_HPP +#define CPU_X86_VM_INTERP_MASM_X86_64_HPP + +#include "assembler_x86.inline.hpp" +#include "interpreter/invocationCounter.hpp" + // This file specializes the assember with interpreter-specific macros @@ -243,3 +249,5 @@ class InterpreterMacroAssembler: public MacroAssembler { void notify_method_entry(); void notify_method_exit(TosState state, NotifyMethodExitMode mode); }; + +#endif // CPU_X86_VM_INTERP_MASM_X86_64_HPP diff --git a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp index e12ab0c850a..7f92fbd15c5 100644 --- a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp +++ b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP +#define CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP + // Generation of Interpreter // @@ -41,3 +44,5 @@ void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); void generate_counter_overflow(Label* do_continue); + +#endif // CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/interpreterRT_x86.hpp b/hotspot/src/cpu/x86/vm/interpreterRT_x86.hpp index debe9c5c379..f35f0122d43 100644 --- a/hotspot/src/cpu/x86/vm/interpreterRT_x86.hpp +++ b/hotspot/src/cpu/x86/vm/interpreterRT_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef CPU_X86_VM_INTERPRETERRT_X86_HPP +#define CPU_X86_VM_INTERPRETERRT_X86_HPP + +#include "memory/allocation.hpp" + // native method calls class SignatureHandlerGenerator: public NativeSignatureIterator { @@ -72,3 +77,5 @@ class SignatureHandlerGenerator: public NativeSignatureIterator { static Register to(); static Register temp(); }; + +#endif // CPU_X86_VM_INTERPRETERRT_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp index ab70515a69f..05b3ded09e1 100644 --- a/hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp @@ -22,8 +22,17 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_interpreterRT_x86_32.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/universe.inline.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/icache.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/signature.hpp" #define __ _masm-> diff --git a/hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp index 1a362b7b9bf..c3a1f5413d1 100644 --- a/hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp @@ -22,8 +22,17 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_interpreterRT_x86_64.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/universe.inline.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/icache.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/signature.hpp" #define __ _masm-> diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86.hpp b/hotspot/src/cpu/x86/vm/interpreter_x86.hpp index 7c0cd214ff9..105a4038ced 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86.hpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_INTERPRETER_X86_HPP +#define CPU_X86_VM_INTERPRETER_X86_HPP + public: // Sentinel placed in the code for interpreter returns so @@ -44,3 +47,5 @@ assert(i <= 0, "local direction already negated"); return stackElementWords * i; } + +#endif // CPU_X86_VM_INTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp index 0dc6ffab9a2..d5424c63c58 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp @@ -22,8 +22,32 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_interpreter_x86_32.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateTable.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/arguments.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/timer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif #define __ _masm-> diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp index 4c221d9e97e..373379663a8 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 (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,32 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_interpreter_x86_64.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateTable.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/arguments.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/timer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif #define __ _masm-> diff --git a/hotspot/src/cpu/x86/vm/javaFrameAnchor_x86.hpp b/hotspot/src/cpu/x86/vm/javaFrameAnchor_x86.hpp index d78bead14cb..77298e53770 100644 --- a/hotspot/src/cpu/x86/vm/javaFrameAnchor_x86.hpp +++ b/hotspot/src/cpu/x86/vm/javaFrameAnchor_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_JAVAFRAMEANCHOR_X86_HPP +#define CPU_X86_VM_JAVAFRAMEANCHOR_X86_HPP + private: // FP value associated with _last_Java_sp: @@ -79,3 +82,5 @@ public: intptr_t* last_Java_fp(void) { return _last_Java_fp; } // Assert (last_Java_sp == NULL || fp == NULL) void set_last_Java_fp(intptr_t* fp) { _last_Java_fp = fp; } + +#endif // CPU_X86_VM_JAVAFRAMEANCHOR_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp index 0a63657dcb4..57edd9b195b 100644 --- a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp @@ -22,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_jniFastGetField_x86_32.cpp.incl" +#include "precompiled.hpp" +#include "assembler_x86.inline.hpp" +#include "memory/resourceArea.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm_misc.hpp" +#include "runtime/safepoint.hpp" #define __ masm-> diff --git a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp index f07ae42e1a8..8b0d2e6fa6f 100644 --- a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp @@ -22,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_jniFastGetField_x86_64.cpp.incl" +#include "precompiled.hpp" +#include "assembler_x86.inline.hpp" +#include "memory/resourceArea.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm_misc.hpp" +#include "runtime/safepoint.hpp" #define __ masm-> diff --git a/hotspot/src/cpu/x86/vm/jniTypes_x86.hpp b/hotspot/src/cpu/x86/vm/jniTypes_x86.hpp index d858ad136ef..170cd6e3adc 100644 --- a/hotspot/src/cpu/x86/vm/jniTypes_x86.hpp +++ b/hotspot/src/cpu/x86/vm/jniTypes_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef CPU_X86_VM_JNITYPES_X86_HPP +#define CPU_X86_VM_JNITYPES_X86_HPP + +#include "memory/allocation.hpp" +#include "oops/oop.hpp" +#include "prims/jni.h" + // This file holds platform-dependent routines used to write primitive jni // types to the array of arguments passed into JavaCalls::call @@ -122,3 +129,5 @@ public: static inline jdouble get_double(intptr_t *from) { return *(jdouble *)(from + _JNI_SLOT_OFFSET); } #undef _JNI_SLOT_OFFSET }; + +#endif // CPU_X86_VM_JNITYPES_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/jni_x86.h b/hotspot/src/cpu/x86/vm/jni_x86.h index 887afbdd099..c6d322f2b24 100644 --- a/hotspot/src/cpu/x86/vm/jni_x86.h +++ b/hotspot/src/cpu/x86/vm/jni_x86.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/methodHandles_x86.cpp b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp index e8cd888cd71..f92beb4839f 100644 --- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp +++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp @@ -22,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_methodHandles_x86.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "memory/allocation.inline.hpp" +#include "prims/methodHandles.hpp" #define __ _masm-> @@ -123,11 +125,9 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* } // given the MethodType, find out where the MH argument is buried - __ movptr(rdx_temp, Address(rax_mtype, - __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, rdi_temp))); + __ load_heap_oop(rdx_temp, Address(rax_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, rdi_temp))); Register rdx_vmslots = rdx_temp; - __ movl(rdx_vmslots, Address(rdx_temp, - __ delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, rdi_temp))); + __ movl(rdx_vmslots, Address(rdx_temp, __ delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, rdi_temp))); __ movptr(rcx_recv, __ argument_address(rdx_vmslots)); trace_method_handle(_masm, "invokeExact"); @@ -154,20 +154,18 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* rcx_argslot, rbx_temp, rdx_temp); // load up an adapter from the calling type (Java weaves this) - __ movptr(rdx_temp, Address(rax_mtype, - __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, rdi_temp))); + __ load_heap_oop(rdx_temp, Address(rax_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, rdi_temp))); Register rdx_adapter = rdx_temp; - // movptr(rdx_adapter, Address(rdx_temp, java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes())); + // __ load_heap_oop(rdx_adapter, Address(rdx_temp, java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes())); // deal with old JDK versions: - __ lea(rdi_temp, Address(rdx_temp, - __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, rdi_temp))); + __ lea(rdi_temp, Address(rdx_temp, __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, rdi_temp))); __ cmpptr(rdi_temp, rdx_temp); Label sorry_no_invoke_generic; - __ jccb(Assembler::below, sorry_no_invoke_generic); + __ jcc(Assembler::below, sorry_no_invoke_generic); - __ movptr(rdx_adapter, Address(rdi_temp, 0)); + __ load_heap_oop(rdx_adapter, Address(rdi_temp, 0)); __ testptr(rdx_adapter, rdx_adapter); - __ jccb(Assembler::zero, sorry_no_invoke_generic); + __ jcc(Assembler::zero, sorry_no_invoke_generic); __ movptr(Address(rcx_argslot, 1 * Interpreter::stackElementSize), rdx_adapter); // As a trusted first argument, pass the type being called, so the adapter knows // the actual types of the arguments and return values. @@ -346,7 +344,7 @@ void trace_method_handle_stub(const char* adaptername, if (stack_dump_count > 64) stack_dump_count = 48; for (i = 0; i < stack_dump_count; i += 4) { printf(" dump at SP[%d] "INTPTR_FORMAT": "INTPTR_FORMAT" "INTPTR_FORMAT" "INTPTR_FORMAT" "INTPTR_FORMAT"\n", - i, &entry_sp[i+0], entry_sp[i+0], entry_sp[i+1], entry_sp[i+2], entry_sp[i+3]); + i, (intptr_t) &entry_sp[i+0], entry_sp[i+0], entry_sp[i+1], entry_sp[i+2], entry_sp[i+3]); } print_method_handle(mh); } @@ -387,9 +385,12 @@ int MethodHandles::adapter_conversion_ops_supported_mask() { // FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS. } +//------------------------------------------------------------------------------ +// MethodHandles::generate_method_handle_stub +// // Generate an "entry" field for a method handle. // This determines how the method handle will respond to calls. -void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek) { +void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek, TRAPS) { // Here is the register state during an interpreted call, // as set up by generate_method_handle_interpreter_entry(): // - rbx: garbage temp (was MethodHandle.invoke methodOop, unused) @@ -398,14 +399,21 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan // - rsi/r13: sender SP (must preserve; see prepare_to_jump_from_interpreted) // - rdx: garbage temp, can blow away - Register rcx_recv = rcx; - Register rax_argslot = rax; - Register rbx_temp = rbx; - Register rdx_temp = rdx; + const Register rcx_recv = rcx; + const Register rax_argslot = rax; + const Register rbx_temp = rbx; + const Register rdx_temp = rdx; // This guy is set up by prepare_to_jump_from_interpreted (from interpreted calls) // and gen_c2i_adapter (from compiled calls): - Register saved_last_sp = LP64_ONLY(r13) NOT_LP64(rsi); + const Register saved_last_sp = LP64_ONLY(r13) NOT_LP64(rsi); + + // Argument registers for _raise_exception. + // 32-bit: Pass first two oop/int args in registers ECX and EDX. + const Register rarg0_code = LP64_ONLY(j_rarg0) NOT_LP64(rcx); + const Register rarg1_actual = LP64_ONLY(j_rarg1) NOT_LP64(rdx); + const Register rarg2_required = LP64_ONLY(j_rarg2) NOT_LP64(rdi); + assert_different_registers(rarg0_code, rarg1_actual, rarg2_required, saved_last_sp); guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets"); @@ -431,7 +439,6 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan } address interp_entry = __ pc(); - if (UseCompressedOops) __ unimplemented("UseCompressedOops"); trace_method_handle(_masm, entry_name(ek)); @@ -440,47 +447,41 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan switch ((int) ek) { case _raise_exception: { - // Not a real MH entry, but rather shared code for raising an exception. - // Extra local arguments are pushed on stack, as required type at TOS+8, - // failing object (or NULL) at TOS+4, failing bytecode type at TOS. - // Beyond those local arguments are the PC, of course. - Register rdx_code = rdx_temp; - Register rcx_fail = rcx_recv; - Register rax_want = rax_argslot; - Register rdi_pc = rdi; - __ pop(rdx_code); // TOS+0 - __ pop(rcx_fail); // TOS+4 - __ pop(rax_want); // TOS+8 - __ pop(rdi_pc); // caller PC + // Not a real MH entry, but rather shared code for raising an + // exception. Since we use a C2I adapter to set up the + // interpreter state, arguments are expected in compiler + // argument registers. + methodHandle mh(raise_exception_method()); + address c2i_entry = methodOopDesc::make_adapters(mh, CHECK); - __ mov(rsp, rsi); // cut the stack back to where the caller started - - // Repush the arguments as if coming from the interpreter. - __ push(rdx_code); - __ push(rcx_fail); - __ push(rax_want); + const Register rdi_pc = rax; + __ pop(rdi_pc); // caller PC + __ mov(rsp, saved_last_sp); // cut the stack back to where the caller started Register rbx_method = rbx_temp; - Label no_method; + Label L_no_method; // FIXME: fill in _raise_exception_method with a suitable sun.dyn method __ movptr(rbx_method, ExternalAddress((address) &_raise_exception_method)); __ testptr(rbx_method, rbx_method); - __ jccb(Assembler::zero, no_method); - int jobject_oop_offset = 0; + __ jccb(Assembler::zero, L_no_method); + + const int jobject_oop_offset = 0; __ movptr(rbx_method, Address(rbx_method, jobject_oop_offset)); // dereference the jobject __ testptr(rbx_method, rbx_method); - __ jccb(Assembler::zero, no_method); + __ jccb(Assembler::zero, L_no_method); __ verify_oop(rbx_method); - __ push(rdi_pc); // and restore caller PC - __ jmp(rbx_method_fie); + + // 32-bit: push remaining arguments as if coming from the compiler. + NOT_LP64(__ push(rarg2_required)); + + __ push(rdi_pc); // restore caller PC + __ jump(ExternalAddress(c2i_entry)); // do C2I transition // If we get here, the Java runtime did not do its job of creating the exception. // Do something that is at least causes a valid throw from the interpreter. - __ bind(no_method); - __ pop(rax_want); - __ pop(rcx_fail); - __ push(rax_want); - __ push(rcx_fail); + __ bind(L_no_method); + __ push(rarg2_required); + __ push(rarg1_actual); __ jump(ExternalAddress(Interpreter::throw_WrongMethodType_entry())); } break; @@ -489,7 +490,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan case _invokespecial_mh: { Register rbx_method = rbx_temp; - __ movptr(rbx_method, rcx_mh_vmtarget); // target is a methodOop + __ load_heap_oop(rbx_method, rcx_mh_vmtarget); // target is a methodOop __ verify_oop(rbx_method); // same as TemplateTable::invokestatic or invokespecial, // minus the CP setup and profiling: @@ -546,8 +547,8 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan __ load_method_handle_vmslots(rax_argslot, rcx_recv, rdx_temp); Register rdx_intf = rdx_temp; Register rbx_index = rbx_temp; - __ movptr(rdx_intf, rcx_mh_vmtarget); - __ movl(rbx_index, rcx_dmh_vmindex); + __ load_heap_oop(rdx_intf, rcx_mh_vmtarget); + __ movl(rbx_index, rcx_dmh_vmindex); __ movptr(rcx_recv, __ argument_address(rax_argslot, -1)); __ null_check(rcx_recv, oopDesc::klass_offset_in_bytes()); @@ -575,9 +576,11 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan __ bind(no_such_interface); // Throw an exception. // For historical reasons, it will be IncompatibleClassChangeError. - __ pushptr(Address(rdx_intf, java_mirror_offset)); // required interface - __ push(rcx_recv); // bad receiver - __ push((int)Bytecodes::_invokeinterface); // who is complaining? + __ mov(rbx_temp, rcx_recv); // rarg2_required might be RCX + assert_different_registers(rarg2_required, rbx_temp); + __ movptr(rarg2_required, Address(rdx_intf, java_mirror_offset)); // required interface + __ mov( rarg1_actual, rbx_temp); // bad receiver + __ movl( rarg0_code, (int) Bytecodes::_invokeinterface); // who is complaining? __ jump(ExternalAddress(from_interpreted_entry(_raise_exception))); } break; @@ -602,7 +605,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan rax_argslot, rbx_temp, rdx_temp); // store bound argument into the new stack slot: - __ movptr(rbx_temp, rcx_bmh_argument); + __ load_heap_oop(rbx_temp, rcx_bmh_argument); Address prim_value_addr(rbx_temp, java_lang_boxing_object::value_offset_in_bytes(arg_type)); if (arg_type == T_OBJECT) { __ movptr(Address(rax_argslot, 0), rbx_temp); @@ -620,11 +623,11 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan if (direct_to_method) { Register rbx_method = rbx_temp; - __ movptr(rbx_method, rcx_mh_vmtarget); + __ load_heap_oop(rbx_method, rcx_mh_vmtarget); __ verify_oop(rbx_method); __ jmp(rbx_method_fie); } else { - __ movptr(rcx_recv, rcx_mh_vmtarget); + __ load_heap_oop(rcx_recv, rcx_mh_vmtarget); __ verify_oop(rcx_recv); __ jump_to_method_handle_entry(rcx_recv, rdx_temp); } @@ -634,7 +637,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan case _adapter_retype_only: case _adapter_retype_raw: // immediately jump to the next MH layer: - __ movptr(rcx_recv, rcx_mh_vmtarget); + __ load_heap_oop(rcx_recv, rcx_mh_vmtarget); __ verify_oop(rcx_recv); __ jump_to_method_handle_entry(rcx_recv, rdx_temp); // This is OK when all parameter types widen. @@ -651,13 +654,13 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan vmarg = __ argument_address(rax_argslot); // What class are we casting to? - __ movptr(rbx_klass, rcx_amh_argument); // this is a Class object! - __ movptr(rbx_klass, Address(rbx_klass, java_lang_Class::klass_offset_in_bytes())); + __ load_heap_oop(rbx_klass, rcx_amh_argument); // this is a Class object! + __ load_heap_oop(rbx_klass, Address(rbx_klass, java_lang_Class::klass_offset_in_bytes())); Label done; __ movptr(rdx_temp, vmarg); __ testptr(rdx_temp, rdx_temp); - __ jccb(Assembler::zero, done); // no cast if null + __ jcc(Assembler::zero, done); // no cast if null __ load_klass(rdx_temp, rdx_temp); // live at this point: @@ -672,14 +675,15 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan __ movl(rax_argslot, rcx_amh_vmargslot); // reload argslot field __ movptr(rdx_temp, vmarg); - __ pushptr(rcx_amh_argument); // required class - __ push(rdx_temp); // bad object - __ push((int)Bytecodes::_checkcast); // who is complaining? + assert_different_registers(rarg2_required, rdx_temp); + __ load_heap_oop(rarg2_required, rcx_amh_argument); // required class + __ mov( rarg1_actual, rdx_temp); // bad object + __ movl( rarg0_code, (int) Bytecodes::_checkcast); // who is complaining? __ jump(ExternalAddress(from_interpreted_entry(_raise_exception))); __ bind(done); // get the new MH: - __ movptr(rcx_recv, rcx_mh_vmtarget); + __ load_heap_oop(rcx_recv, rcx_mh_vmtarget); __ jump_to_method_handle_entry(rcx_recv, rdx_temp); } break; @@ -741,7 +745,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan assert(CONV_VMINFO_SHIFT == 0, "preshifted"); // get the new MH: - __ movptr(rcx_recv, rcx_mh_vmtarget); + __ load_heap_oop(rcx_recv, rcx_mh_vmtarget); // (now we are done with the old MH) // original 32-bit vmdata word must be of this form: @@ -816,7 +820,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan ShouldNotReachHere(); } - __ movptr(rcx_recv, rcx_mh_vmtarget); + __ load_heap_oop(rcx_recv, rcx_mh_vmtarget); __ jump_to_method_handle_entry(rcx_recv, rdx_temp); } break; @@ -858,7 +862,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan rax_argslot, rbx_temp, rdx_temp); } - __ movptr(rcx_recv, rcx_mh_vmtarget); + __ load_heap_oop(rcx_recv, rcx_mh_vmtarget); __ jump_to_method_handle_entry(rcx_recv, rdx_temp); } break; @@ -969,7 +973,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan } } - __ movptr(rcx_recv, rcx_mh_vmtarget); + __ load_heap_oop(rcx_recv, rcx_mh_vmtarget); __ jump_to_method_handle_entry(rcx_recv, rdx_temp); } break; @@ -1029,7 +1033,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan __ pop(rdi); // restore temp - __ movptr(rcx_recv, rcx_mh_vmtarget); + __ load_heap_oop(rcx_recv, rcx_mh_vmtarget); __ jump_to_method_handle_entry(rcx_recv, rdx_temp); } break; @@ -1052,7 +1056,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan __ pop(rdi); // restore temp - __ movptr(rcx_recv, rcx_mh_vmtarget); + __ load_heap_oop(rcx_recv, rcx_mh_vmtarget); __ jump_to_method_handle_entry(rcx_recv, rdx_temp); } break; @@ -1103,8 +1107,8 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan // Check the array type. Register rbx_klass = rbx_temp; - __ movptr(rbx_klass, rcx_amh_argument); // this is a Class object! - __ movptr(rbx_klass, Address(rbx_klass, java_lang_Class::klass_offset_in_bytes())); + __ load_heap_oop(rbx_klass, rcx_amh_argument); // this is a Class object! + __ load_heap_oop(rbx_klass, Address(rbx_klass, java_lang_Class::klass_offset_in_bytes())); Label ok_array_klass, bad_array_klass, bad_array_length; __ check_klass_subtype(rdx_array_klass, rbx_klass, rdi, ok_array_klass); @@ -1186,21 +1190,23 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan // Arguments are spread. Move to next method handle. UNPUSH_RSI_RDI; - __ movptr(rcx_recv, rcx_mh_vmtarget); + __ load_heap_oop(rcx_recv, rcx_mh_vmtarget); __ jump_to_method_handle_entry(rcx_recv, rdx_temp); __ bind(bad_array_klass); UNPUSH_RSI_RDI; - __ pushptr(Address(rdx_array_klass, java_mirror_offset)); // required type - __ pushptr(vmarg); // bad array - __ push((int)Bytecodes::_aaload); // who is complaining? + assert(!vmarg.uses(rarg2_required), "must be different registers"); + __ movptr(rarg2_required, Address(rdx_array_klass, java_mirror_offset)); // required type + __ movptr(rarg1_actual, vmarg); // bad array + __ movl( rarg0_code, (int) Bytecodes::_aaload); // who is complaining? __ jump(ExternalAddress(from_interpreted_entry(_raise_exception))); __ bind(bad_array_length); UNPUSH_RSI_RDI; - __ push(rcx_recv); // AMH requiring a certain length - __ pushptr(vmarg); // bad array - __ push((int)Bytecodes::_arraylength); // who is complaining? + assert(!vmarg.uses(rarg2_required), "must be different registers"); + __ mov (rarg2_required, rcx_recv); // AMH requiring a certain length + __ movptr(rarg1_actual, vmarg); // bad array + __ movl( rarg0_code, (int) Bytecodes::_arraylength); // who is complaining? __ jump(ExternalAddress(from_interpreted_entry(_raise_exception))); #undef UNPUSH_RSI_RDI diff --git a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp index 1c68f604864..7ec07737f61 100644 --- a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp +++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,18 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_nativeInst_x86.cpp.incl" +#include "precompiled.hpp" +#include "assembler_x86.inline.hpp" +#include "memory/resourceArea.hpp" +#include "nativeInst_x86.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "utilities/ostream.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif void NativeInstruction::wrote(int offset) { ICache::invalidate_word(addr_at(offset)); diff --git a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp index b99aacab5fd..d41bcccdb31 100644 --- a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp +++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,15 @@ * */ +#ifndef CPU_X86_VM_NATIVEINST_X86_HPP +#define CPU_X86_VM_NATIVEINST_X86_HPP + +#include "asm/assembler.hpp" +#include "memory/allocation.hpp" +#include "runtime/icache.hpp" +#include "runtime/os.hpp" +#include "utilities/top.hpp" + // We have interfaces for the following instructions: // - NativeInstruction // - - NativeCall @@ -547,3 +556,5 @@ inline bool NativeInstruction::is_mov_literal64() { return false; #endif // AMD64 } + +#endif // CPU_X86_VM_NATIVEINST_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/registerMap_x86.hpp b/hotspot/src/cpu/x86/vm/registerMap_x86.hpp index 7087589a160..5d91b1ba755 100644 --- a/hotspot/src/cpu/x86/vm/registerMap_x86.hpp +++ b/hotspot/src/cpu/x86/vm/registerMap_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_REGISTERMAP_X86_HPP +#define CPU_X86_VM_REGISTERMAP_X86_HPP + // machine-dependent implemention for register maps friend class frame; @@ -37,3 +40,5 @@ void pd_clear() {} void pd_initialize() {} void pd_initialize_from(const RegisterMap* map) {} + +#endif // CPU_X86_VM_REGISTERMAP_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp b/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp index ee19fdd26cc..f1fd229b96b 100644 --- a/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp +++ b/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp @@ -22,8 +22,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_register_definitions_x86.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "asm/register.hpp" +#include "register_x86.hpp" +#ifdef TARGET_ARCH_MODEL_x86_32 +# include "interp_masm_x86_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_x86_64 +# include "interp_masm_x86_64.hpp" +#endif REGISTER_DEFINITION(Register, noreg); REGISTER_DEFINITION(Register, rax); diff --git a/hotspot/src/cpu/x86/vm/register_x86.cpp b/hotspot/src/cpu/x86/vm/register_x86.cpp index c5ada7d9a93..a6301eafe4d 100644 --- a/hotspot/src/cpu/x86/vm/register_x86.cpp +++ b/hotspot/src/cpu/x86/vm/register_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_register_x86.cpp.incl" +#include "precompiled.hpp" +#include "register_x86.hpp" + #ifndef AMD64 const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers; #else diff --git a/hotspot/src/cpu/x86/vm/register_x86.hpp b/hotspot/src/cpu/x86/vm/register_x86.hpp index 846f65a8cef..2f4cd0dcac6 100644 --- a/hotspot/src/cpu/x86/vm/register_x86.hpp +++ b/hotspot/src/cpu/x86/vm/register_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef CPU_X86_VM_REGISTER_X86_HPP +#define CPU_X86_VM_REGISTER_X86_HPP + +#include "asm/register.hpp" +#include "vm_version_x86.hpp" + class VMRegImpl; typedef VMRegImpl* VMReg; @@ -219,3 +225,5 @@ class ConcreteRegisterImpl : public AbstractRegisterImpl { static const int max_xmm; }; + +#endif // CPU_X86_VM_REGISTER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp b/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp index 0c49edf39e8..97e3645bd3c 100644 --- a/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp +++ b/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_relocInfo_x86.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.inline.hpp" +#include "assembler_x86.inline.hpp" +#include "code/relocInfo.hpp" +#include "nativeInst_x86.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/safepoint.hpp" void Relocation::pd_set_data_value(address x, intptr_t o) { diff --git a/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp b/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp index a27e4698cc9..32855b343c2 100644 --- a/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp +++ b/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_RELOCINFO_X86_HPP +#define CPU_X86_VM_RELOCINFO_X86_HPP + // machine-dependent parts of class relocInfo private: enum { @@ -36,3 +39,5 @@ format_width = 2 #endif }; + +#endif // CPU_X86_VM_RELOCINFO_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp b/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp index 9a32a67fe74..a541fa213c3 100644 --- a/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp @@ -22,9 +22,23 @@ * */ +#include "precompiled.hpp" +#ifdef COMPILER2 +#include "asm/assembler.hpp" +#include "assembler_x86.inline.hpp" +#include "classfile/systemDictionary.hpp" +#include "code/vmreg.hpp" +#include "interpreter/interpreter.hpp" +#include "nativeInst_x86.hpp" +#include "opto/runtime.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/globalDefinitions.hpp" +#include "vmreg_x86.inline.hpp" +#endif -#include "incls/_precompiled.incl" -#include "incls/_runtime_x86_32.cpp.incl" #define __ masm-> diff --git a/hotspot/src/cpu/x86/vm/runtime_x86_64.cpp b/hotspot/src/cpu/x86/vm/runtime_x86_64.cpp index 79fa77e62c0..8f53518bb4b 100644 --- a/hotspot/src/cpu/x86/vm/runtime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/runtime_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,23 @@ * */ -#include "incls/_precompiled.incl" +#include "precompiled.hpp" +#ifdef COMPILER2 +#include "asm/assembler.hpp" +#include "assembler_x86.inline.hpp" +#include "classfile/systemDictionary.hpp" +#include "code/vmreg.hpp" +#include "interpreter/interpreter.hpp" +#include "nativeInst_x86.hpp" +#include "opto/runtime.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/globalDefinitions.hpp" +#include "vmreg_x86.inline.hpp" +#endif + // This file should really contain the code for generating the OptoRuntime // exception_blob. However that code uses SimpleRuntimeFrame which only diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index 847e68fda37..5a34d46314c 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -22,8 +22,24 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_sharedRuntime_x86_32.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_x86.inline.hpp" +#include "code/debugInfoRec.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "interpreter/interpreter.hpp" +#include "oops/compiledICHolderOop.hpp" +#include "prims/jvmtiRedefineClassesTrace.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/vframeArray.hpp" +#include "vmreg_x86.inline.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif #define __ masm-> #ifdef COMPILER2 diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index 4f679636492..e3455dea520 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -22,8 +22,24 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_sharedRuntime_x86_64.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_x86.inline.hpp" +#include "code/debugInfoRec.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "interpreter/interpreter.hpp" +#include "oops/compiledICHolderOop.hpp" +#include "prims/jvmtiRedefineClassesTrace.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/vframeArray.hpp" +#include "vmreg_x86.inline.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif DeoptimizationBlob *SharedRuntime::_deopt_blob; #ifdef COMPILER2 diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 9a7c6a022da..c3cf3f84835 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -22,8 +22,34 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stubGenerator_x86_32.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_x86.inline.hpp" +#include "interpreter/interpreter.hpp" +#include "nativeInst_x86.hpp" +#include "oops/instanceOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/oop.inline.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubCodeGenerator.hpp" +#include "runtime/stubRoutines.hpp" +#include "utilities/top.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif // Declaration and definition of StubGenerator (no .hpp file). // For a more detailed description of the stub routine structure diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index 57d3b5147d4..3d5bcc99bfb 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -22,8 +22,34 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stubGenerator_x86_64.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_x86.inline.hpp" +#include "interpreter/interpreter.hpp" +#include "nativeInst_x86.hpp" +#include "oops/instanceOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/oop.inline.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubCodeGenerator.hpp" +#include "runtime/stubRoutines.hpp" +#include "utilities/top.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif // Declaration and definition of StubGenerator (no .hpp file). // For a more detailed description of the stub routine structure @@ -2171,9 +2197,6 @@ class StubGenerator: public StubCodeGenerator { __ enter(); // required for proper stackwalking of RuntimeStub frame - checkcast_copy_entry = __ pc(); - BLOCK_COMMENT("Entry:"); - #ifdef ASSERT // caller guarantees that the arrays really are different // otherwise, we would have to make conjoint checks @@ -2184,26 +2207,28 @@ class StubGenerator: public StubCodeGenerator { } #endif //ASSERT - // allocate spill slots for r13, r14 - enum { - saved_r13_offset, - saved_r14_offset, - saved_rbp_offset, - saved_rip_offset, - saved_rarg0_offset - }; - __ subptr(rsp, saved_rbp_offset * wordSize); - __ movptr(Address(rsp, saved_r13_offset * wordSize), r13); - __ movptr(Address(rsp, saved_r14_offset * wordSize), r14); setup_arg_regs(4); // from => rdi, to => rsi, length => rdx // ckoff => rcx, ckval => r8 // r9 and r10 may be used to save non-volatile registers #ifdef _WIN64 // last argument (#4) is on stack on Win64 - const int ckval_offset = saved_rarg0_offset + 4; - __ movptr(ckval, Address(rsp, ckval_offset * wordSize)); + __ movptr(ckval, Address(rsp, 6 * wordSize)); #endif + // Caller of this entry point must set up the argument registers. + checkcast_copy_entry = __ pc(); + BLOCK_COMMENT("Entry:"); + + // allocate spill slots for r13, r14 + enum { + saved_r13_offset, + saved_r14_offset, + saved_rbp_offset + }; + __ subptr(rsp, saved_rbp_offset * wordSize); + __ movptr(Address(rsp, saved_r13_offset * wordSize), r13); + __ movptr(Address(rsp, saved_r14_offset * wordSize), r14); + // check that int operands are properly extended to size_t assert_clean_int(length, rax); assert_clean_int(ckoff, rax); @@ -2417,11 +2442,10 @@ class StubGenerator: public StubCodeGenerator { const Register src_pos = c_rarg1; // source position const Register dst = c_rarg2; // destination array oop const Register dst_pos = c_rarg3; // destination position - // elements count is on stack on Win64 -#ifdef _WIN64 -#define C_RARG4 Address(rsp, 6 * wordSize) +#ifndef _WIN64 + const Register length = c_rarg4; #else -#define C_RARG4 c_rarg4 + const Address length(rsp, 6 * wordSize); // elements count is on stack on Win64 #endif { int modulus = CodeEntryAlignment; @@ -2488,27 +2512,27 @@ class StubGenerator: public StubCodeGenerator { // registers used as temp const Register r11_length = r11; // elements count to copy const Register r10_src_klass = r10; // array klass - const Register r9_dst_klass = r9; // dest array klass // if (length < 0) return -1; - __ movl(r11_length, C_RARG4); // length (elements count, 32-bits value) + __ movl(r11_length, length); // length (elements count, 32-bits value) __ testl(r11_length, r11_length); __ jccb(Assembler::negative, L_failed_0); __ load_klass(r10_src_klass, src); #ifdef ASSERT // assert(src->klass() != NULL); - BLOCK_COMMENT("assert klasses not null"); - { Label L1, L2; + { + BLOCK_COMMENT("assert klasses not null {"); + Label L1, L2; __ testptr(r10_src_klass, r10_src_klass); __ jcc(Assembler::notZero, L2); // it is broken if klass is NULL __ bind(L1); __ stop("broken null klass"); __ bind(L2); - __ load_klass(r9_dst_klass, dst); - __ cmpq(r9_dst_klass, 0); + __ load_klass(rax, dst); + __ cmpq(rax, 0); __ jcc(Assembler::equal, L1); // this would be broken also - BLOCK_COMMENT("assert done"); + BLOCK_COMMENT("} assert klasses not null done"); } #endif @@ -2520,34 +2544,36 @@ class StubGenerator: public StubCodeGenerator { // array_tag: typeArray = 0x3, objArray = 0x2, non-array = 0x0 // - int lh_offset = klassOopDesc::header_size() * HeapWordSize + - Klass::layout_helper_offset_in_bytes(); - - const Register rax_lh = rax; // layout helper - - __ movl(rax_lh, Address(r10_src_klass, lh_offset)); + const int lh_offset = klassOopDesc::header_size() * HeapWordSize + + Klass::layout_helper_offset_in_bytes(); // Handle objArrays completely differently... - jint objArray_lh = Klass::array_layout_helper(T_OBJECT); - __ cmpl(rax_lh, objArray_lh); + const jint objArray_lh = Klass::array_layout_helper(T_OBJECT); + __ cmpl(Address(r10_src_klass, lh_offset), objArray_lh); __ jcc(Assembler::equal, L_objArray); // if (src->klass() != dst->klass()) return -1; - __ load_klass(r9_dst_klass, dst); - __ cmpq(r10_src_klass, r9_dst_klass); + __ load_klass(rax, dst); + __ cmpq(r10_src_klass, rax); __ jcc(Assembler::notEqual, L_failed); + const Register rax_lh = rax; // layout helper + __ movl(rax_lh, Address(r10_src_klass, lh_offset)); + // if (!src->is_Array()) return -1; __ cmpl(rax_lh, Klass::_lh_neutral_value); __ jcc(Assembler::greaterEqual, L_failed); // At this point, it is known to be a typeArray (array_tag 0x3). #ifdef ASSERT - { Label L; + { + BLOCK_COMMENT("assert primitive array {"); + Label L; __ cmpl(rax_lh, (Klass::_lh_array_tag_type_value << Klass::_lh_array_tag_shift)); __ jcc(Assembler::greaterEqual, L); __ stop("must be a primitive array"); __ bind(L); + BLOCK_COMMENT("} assert primitive array done"); } #endif @@ -2605,11 +2631,14 @@ class StubGenerator: public StubCodeGenerator { __ BIND(L_copy_longs); #ifdef ASSERT - { Label L; + { + BLOCK_COMMENT("assert long copy {"); + Label L; __ cmpl(rax_elsize, LogBytesPerLong); __ jcc(Assembler::equal, L); __ stop("must be long copy, but elsize is wrong"); __ bind(L); + BLOCK_COMMENT("} assert long copy done"); } #endif __ lea(from, Address(src, src_pos, Address::times_8, 0));// src_addr @@ -2619,12 +2648,12 @@ class StubGenerator: public StubCodeGenerator { // objArrayKlass __ BIND(L_objArray); - // live at this point: r10_src_klass, src[_pos], dst[_pos] + // live at this point: r10_src_klass, r11_length, src[_pos], dst[_pos] Label L_plain_copy, L_checkcast_copy; // test array classes for subtyping - __ load_klass(r9_dst_klass, dst); - __ cmpq(r10_src_klass, r9_dst_klass); // usual case is exact equality + __ load_klass(rax, dst); + __ cmpq(r10_src_klass, rax); // usual case is exact equality __ jcc(Assembler::notEqual, L_checkcast_copy); // Identically typed arrays can be copied without element-wise checks. @@ -2640,41 +2669,33 @@ class StubGenerator: public StubCodeGenerator { __ jump(RuntimeAddress(oop_copy_entry)); __ BIND(L_checkcast_copy); - // live at this point: r10_src_klass, !r11_length + // live at this point: r10_src_klass, r11_length, rax (dst_klass) { - // assert(r11_length == C_RARG4); // will reload from here - Register r11_dst_klass = r11; - __ load_klass(r11_dst_klass, dst); - // Before looking at dst.length, make sure dst is also an objArray. - __ cmpl(Address(r11_dst_klass, lh_offset), objArray_lh); + __ cmpl(Address(rax, lh_offset), objArray_lh); __ jcc(Assembler::notEqual, L_failed); // It is safe to examine both src.length and dst.length. -#ifndef _WIN64 - arraycopy_range_checks(src, src_pos, dst, dst_pos, C_RARG4, - rax, L_failed); -#else - __ movl(r11_length, C_RARG4); // reload arraycopy_range_checks(src, src_pos, dst, dst_pos, r11_length, rax, L_failed); + + const Register r11_dst_klass = r11; __ load_klass(r11_dst_klass, dst); // reload -#endif // Marshal the base address arguments now, freeing registers. __ lea(from, Address(src, src_pos, TIMES_OOP, arrayOopDesc::base_offset_in_bytes(T_OBJECT))); __ lea(to, Address(dst, dst_pos, TIMES_OOP, arrayOopDesc::base_offset_in_bytes(T_OBJECT))); - __ movl(count, C_RARG4); // length (reloaded) + __ movl(count, length); // length (reloaded) Register sco_temp = c_rarg3; // this register is free now assert_different_registers(from, to, count, sco_temp, r11_dst_klass, r10_src_klass); assert_clean_int(count, sco_temp); // Generate the type check. - int sco_offset = (klassOopDesc::header_size() * HeapWordSize + - Klass::super_check_offset_offset_in_bytes()); + const int sco_offset = (klassOopDesc::header_size() * HeapWordSize + + Klass::super_check_offset_offset_in_bytes()); __ movl(sco_temp, Address(r11_dst_klass, sco_offset)); assert_clean_int(sco_temp, rax); generate_type_check(r10_src_klass, sco_temp, r11_dst_klass, L_plain_copy); @@ -2683,12 +2704,14 @@ class StubGenerator: public StubCodeGenerator { int ek_offset = (klassOopDesc::header_size() * HeapWordSize + objArrayKlass::element_klass_offset_in_bytes()); __ movptr(r11_dst_klass, Address(r11_dst_klass, ek_offset)); - __ movl(sco_temp, Address(r11_dst_klass, sco_offset)); + __ movl( sco_temp, Address(r11_dst_klass, sco_offset)); assert_clean_int(sco_temp, rax); // the checkcast_copy loop needs two extra arguments: assert(c_rarg3 == sco_temp, "#3 already in place"); - __ movptr(C_RARG4, r11_dst_klass); // dst.klass.element_klass + // Set up arguments for checkcast_copy_entry. + setup_arg_regs(4); + __ movptr(r8, r11_dst_klass); // dst.klass.element_klass, r8 is c_rarg4 on Linux/Solaris __ jump(RuntimeAddress(checkcast_copy_entry)); } @@ -2701,8 +2724,6 @@ class StubGenerator: public StubCodeGenerator { return start; } -#undef length_arg - void generate_arraycopy_stubs() { // Call the conjoint generation methods immediately after // the disjoint ones so that short branches from the former diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp index baf766d4df2..a04b3f29a1a 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,19 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stubRoutines_x86_32.cpp.incl" +#include "precompiled.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/stubRoutines.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif // Implementation of the platform-specific part of StubRoutines - for // a description of how to extend it, see the stubRoutines.hpp file. diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp index cfbd52fde9f..0a78618e1b0 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_STUBROUTINES_X86_32_HPP +#define CPU_X86_VM_STUBROUTINES_X86_32_HPP + // This file holds the platform specific parts of the StubRoutines // definition. See stubRoutines.hpp for a description on how to // extend it. @@ -60,3 +63,5 @@ class x86 { static bool returns_to_call_stub(address return_pc) { return (return_pc == _call_stub_return_address) || return_pc == x86::get_call_stub_compiled_return(); } + +#endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp index c0588a322a4..caab63bfc1c 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,19 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stubRoutines_x86_64.cpp.incl" +#include "precompiled.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/stubRoutines.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif // Implementation of the platform-specific part of StubRoutines - for // a description of how to extend it, see the stubRoutines.hpp file. diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp index 393d868d903..b1726caa692 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_STUBROUTINES_X86_64_HPP +#define CPU_X86_VM_STUBROUTINES_X86_64_HPP + // This file holds the platform specific parts of the StubRoutines // definition. See stubRoutines.hpp for a description on how to // extend it. @@ -35,7 +38,7 @@ enum platform_dependent_constants { // MethodHandles adapters enum method_handles_platform_dependent_constants { - method_handles_adapters_code_size = 26000 + method_handles_adapters_code_size = 40000 }; class x86 { @@ -113,3 +116,5 @@ class x86 { return _mxcsr_std; } }; + +#endif // CPU_X86_VM_STUBROUTINES_X86_64_HPP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp index bcec7e124a2..60e95057cef 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ +#ifndef CPU_X86_VM_TEMPLATEINTERPRETERGENERATOR_X86_HPP +#define CPU_X86_VM_TEMPLATEINTERPRETERGENERATOR_X86_HPP + protected: void generate_fixed_frame(bool native_call); // address generate_asm_interpreter_entry(bool synchronized); + +#endif // CPU_X86_VM_TEMPLATEINTERPRETERGENERATOR_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp index a0e22b6af00..c828c90fba1 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp @@ -22,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP +#define CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP + protected: @@ -35,3 +38,5 @@ #else const static int InterpreterCodeSize = 168 * 1024; #endif // AMD64 + +#endif // CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp index 513263486ec..ee518b31405 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp @@ -22,8 +22,28 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_templateInterpreter_x86_32.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateTable.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/arguments.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/timer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" #define __ _masm-> diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp index b39c7f8575d..2d7aa60cfca 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp @@ -22,8 +22,28 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_interpreter_x86_64.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateTable.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/arguments.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/timer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" #define __ _masm-> @@ -1049,7 +1069,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { // runtime call by hand. // __ mov(c_rarg0, r15_thread); - __ mov(r12, rsp); // remember sp + __ mov(r12, rsp); // remember sp (can only use r12 if not using call_VM) __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows __ andptr(rsp, -16); // align stack as required by ABI __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, JavaThread::check_special_condition_for_native_trans))); @@ -1096,7 +1116,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { __ jcc(Assembler::notEqual, no_reguard); __ pusha(); // XXX only save smashed registers - __ mov(r12, rsp); // remember sp + __ mov(r12, rsp); // remember sp (can only use r12 if not using call_VM) __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows __ andptr(rsp, -16); // align stack as required by ABI __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::reguard_yellow_pages))); @@ -1887,7 +1907,7 @@ void TemplateInterpreterGenerator::trace_bytecode(Template* t) { assert(Interpreter::trace_code(t->tos_in()) != NULL, "entry must have been generated"); - __ mov(r12, rsp); // remember sp + __ mov(r12, rsp); // remember sp (can only use r12 if not using call_VM) __ andptr(rsp, -16); // align stack as required by ABI __ call(RuntimeAddress(Interpreter::trace_code(t->tos_in()))); __ mov(rsp, r12); // restore sp diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp index 5da242409c0..345b5f62c5e 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 (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,18 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_templateTable_x86_32.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateTable.hpp" +#include "memory/universe.inline.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/oop.inline.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" #ifndef CC_INTERP #define __ _masm-> @@ -399,6 +409,23 @@ void TemplateTable::fast_aldc(bool wide) { if (VerifyOops) { __ verify_oop(rax); } + + Label L_done, L_throw_exception; + const Register con_klass_temp = rcx; // same as Rcache + __ movptr(con_klass_temp, Address(rax, oopDesc::klass_offset_in_bytes())); + __ cmpptr(con_klass_temp, ExternalAddress((address)Universe::systemObjArrayKlassObj_addr())); + __ jcc(Assembler::notEqual, L_done); + __ cmpl(Address(rax, arrayOopDesc::length_offset_in_bytes()), 0); + __ jcc(Assembler::notEqual, L_throw_exception); + __ xorptr(rax, rax); + __ jmp(L_done); + + // Load the exception from the system-array which wraps it: + __ bind(L_throw_exception); + __ movptr(rax, Address(rax, arrayOopDesc::base_offset_in_bytes(T_OBJECT))); + __ jump(ExternalAddress(Interpreter::throw_exception_entry())); + + __ bind(L_done); } void TemplateTable::ldc2_w() { @@ -3111,19 +3138,22 @@ void TemplateTable::invokedynamic(int byte_no) { // rax: CallSite object (f1) // rbx: unused (f2) + // rcx: receiver address // rdx: flags (unused) + Register rax_callsite = rax; + Register rcx_method_handle = rcx; + if (ProfileInterpreter) { - Label L; // %%% should make a type profile for any invokedynamic that takes a ref argument // profile this call __ profile_call(rsi); } - __ movptr(rcx, Address(rax, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, rcx))); - __ null_check(rcx); + __ movptr(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, rcx))); + __ null_check(rcx_method_handle); __ prepare_to_jump_from_interpreted(); - __ jump_to_method_handle_entry(rcx, rdx); + __ jump_to_method_handle_entry(rcx_method_handle, rdx); } //---------------------------------------------------------------------------------------------------- @@ -3173,10 +3203,12 @@ void TemplateTable::_new() { const bool allow_shared_alloc = Universe::heap()->supports_inline_contig_alloc() && !CMSIncrementalMode; - if (UseTLAB) { - const Register thread = rcx; - + const Register thread = rcx; + if (UseTLAB || allow_shared_alloc) { __ get_thread(thread); + } + + if (UseTLAB) { __ movptr(rax, Address(thread, in_bytes(JavaThread::tlab_top_offset()))); __ lea(rbx, Address(rax, rdx, Address::times_1)); __ cmpptr(rbx, Address(thread, in_bytes(JavaThread::tlab_end_offset()))); @@ -3217,6 +3249,8 @@ void TemplateTable::_new() { // if someone beat us on the allocation, try again, otherwise continue __ jcc(Assembler::notEqual, retry); + + __ incr_allocated_bytes(thread, rdx, 0); } if (UseTLAB || Universe::heap()->supports_inline_contig_alloc()) { @@ -3226,12 +3260,12 @@ void TemplateTable::_new() { __ decrement(rdx, sizeof(oopDesc)); __ jcc(Assembler::zero, initialize_header); - // Initialize topmost object field, divide rdx by 8, check if odd and - // test if zero. + // Initialize topmost object field, divide rdx by 8, check if odd and + // test if zero. __ xorl(rcx, rcx); // use zero reg to clear memory (shorter code) __ shrl(rdx, LogBytesPerLong); // divide by 2*oopSize and set carry flag if odd - // rdx must have been multiple of 8 + // rdx must have been multiple of 8 #ifdef ASSERT // make sure rdx was multiple of 8 Label L; diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp index 39652a59271..05293afe878 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_TEMPLATETABLE_X86_32_HPP +#define CPU_X86_VM_TEMPLATETABLE_X86_32_HPP + static void prepare_invoke(Register method, Register index, int byte_no); static void invokevirtual_helper(Register index, Register recv, Register flags); @@ -30,3 +33,5 @@ // Helpers static void index_check(Register array, Register index); static void index_check_without_pop(Register array, Register index); + +#endif // CPU_X86_VM_TEMPLATETABLE_X86_32_HPP diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp index 4f46e9f800d..cd45253d592 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 (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,18 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_templateTable_x86_64.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateTable.hpp" +#include "memory/universe.inline.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/oop.inline.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" #ifndef CC_INTERP @@ -413,6 +423,25 @@ void TemplateTable::fast_aldc(bool wide) { if (VerifyOops) { __ verify_oop(rax); } + + Label L_done, L_throw_exception; + const Register con_klass_temp = rcx; // same as cache + const Register array_klass_temp = rdx; // same as index + __ movptr(con_klass_temp, Address(rax, oopDesc::klass_offset_in_bytes())); + __ lea(array_klass_temp, ExternalAddress((address)Universe::systemObjArrayKlassObj_addr())); + __ cmpptr(con_klass_temp, Address(array_klass_temp, 0)); + __ jcc(Assembler::notEqual, L_done); + __ cmpl(Address(rax, arrayOopDesc::length_offset_in_bytes()), 0); + __ jcc(Assembler::notEqual, L_throw_exception); + __ xorptr(rax, rax); + __ jmp(L_done); + + // Load the exception from the system-array which wraps it: + __ bind(L_throw_exception); + __ movptr(rax, Address(rax, arrayOopDesc::base_offset_in_bytes(T_OBJECT))); + __ jump(ExternalAddress(Interpreter::throw_exception_entry())); + + __ bind(L_done); } void TemplateTable::ldc2_w() { @@ -2733,7 +2762,7 @@ void TemplateTable::fast_accessfield(TosState state) { // access constant pool cache entry __ get_cache_entry_pointer_at_bcp(c_rarg2, rcx, 1); __ verify_oop(rax); - __ mov(r12, rax); // save object pointer before call_VM() clobbers it + __ push_ptr(rax); // save object pointer before call_VM() clobbers it __ mov(c_rarg1, rax); // c_rarg1: object pointer copied above // c_rarg2: cache entry pointer @@ -2741,8 +2770,7 @@ void TemplateTable::fast_accessfield(TosState state) { CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_access), c_rarg1, c_rarg2); - __ mov(rax, r12); // restore object pointer - __ reinit_heapbase(); + __ pop_ptr(rax); // restore object pointer __ bind(L1); } @@ -3120,17 +3148,19 @@ void TemplateTable::invokedynamic(int byte_no) { // rcx: receiver address // rdx: flags (unused) + Register rax_callsite = rax; + Register rcx_method_handle = rcx; + if (ProfileInterpreter) { - Label L; // %%% should make a type profile for any invokedynamic that takes a ref argument // profile this call __ profile_call(r13); } - __ movptr(rcx, Address(rax, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, rcx))); - __ null_check(rcx); + __ load_heap_oop(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, rcx))); + __ null_check(rcx_method_handle); __ prepare_to_jump_from_interpreted(); - __ jump_to_method_handle_entry(rcx, rdx); + __ jump_to_method_handle_entry(rcx_method_handle, rdx); } @@ -3236,6 +3266,8 @@ void TemplateTable::_new() { // if someone beat us on the allocation, try again, otherwise continue __ jcc(Assembler::notEqual, retry); + + __ incr_allocated_bytes(r15_thread, rdx, 0); } if (UseTLAB || Universe::heap()->supports_inline_contig_alloc()) { @@ -3334,10 +3366,7 @@ void TemplateTable::checkcast() { JVM_CONSTANT_Class); __ jcc(Assembler::equal, quicked); __ push(atos); // save receiver for result, and for GC - __ mov(r12, rcx); // save rcx XXX call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - __ movq(rcx, r12); // restore rcx XXX - __ reinit_heapbase(); __ pop_ptr(rdx); // restore receiver __ jmpb(resolved); @@ -3391,11 +3420,9 @@ void TemplateTable::instanceof() { __ jcc(Assembler::equal, quicked); __ push(atos); // save receiver for result, and for GC - __ mov(r12, rcx); // save rcx call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); - __ movq(rcx, r12); // restore rcx - __ reinit_heapbase(); __ pop_ptr(rdx); // restore receiver + __ verify_oop(rdx); __ load_klass(rdx, rdx); __ jmpb(resolved); diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp index fce09f5c4f1..922e49542e6 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_TEMPLATETABLE_X86_64_HPP +#define CPU_X86_VM_TEMPLATETABLE_X86_64_HPP + static void prepare_invoke(Register method, Register index, int byte_no); static void invokevirtual_helper(Register index, Register recv, Register flags); @@ -30,3 +33,5 @@ // Helpers static void index_check(Register array, Register index); static void index_check_without_pop(Register array, Register index); + +#endif // CPU_X86_VM_TEMPLATETABLE_X86_64_HPP diff --git a/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp b/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp index bb3c3b68db4..8dddc9c3e1d 100644 --- a/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_VMSTRUCTS_X86_HPP +#define CPU_X86_VM_VMSTRUCTS_X86_HPP + // These are the CPU-specific fields, types and integer // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. @@ -60,3 +63,5 @@ /* 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 must */ /* be present there) */ + +#endif // CPU_X86_VM_VMSTRUCTS_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index 887e71b79e7..df40c5638b7 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -22,8 +22,21 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_vm_version_x86.cpp.incl" +#include "precompiled.hpp" +#include "assembler_x86.inline.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/java.hpp" +#include "runtime/stubCodeGenerator.hpp" +#include "vm_version_x86.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "os_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "os_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "os_windows.inline.hpp" +#endif int VM_Version::_cpu; diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp index 5cbfda1bc62..6f23cb0cada 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp @@ -22,6 +22,12 @@ * */ +#ifndef CPU_X86_VM_VM_VERSION_X86_HPP +#define CPU_X86_VM_VM_VERSION_X86_HPP + +#include "runtime/globals_extension.hpp" +#include "runtime/vm_version.hpp" + class VM_Version : public Abstract_VM_Version { public: // cpuid result register layouts. These are all unions of a uint32_t @@ -446,6 +452,10 @@ public: static bool supports_lzcnt() { return (_cpuFeatures & CPU_LZCNT) != 0; } static bool supports_sse4a() { return (_cpuFeatures & CPU_SSE4A) != 0; } + // Intel Core and newer cpus have fast IDIV instruction (excluding Atom). + static bool has_fast_idiv() { return is_intel() && cpu_family() == 6 && + supports_sse3() && _model != 0x1C; } + static bool supports_compare_and_exchange() { return true; } static const char* cpu_features() { return _features_str; } @@ -516,3 +526,5 @@ public: return count >= 0 ? count : 1; } }; + +#endif // CPU_X86_VM_VM_VERSION_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.cpp b/hotspot/src/cpu/x86/vm/vmreg_x86.cpp index 88f775c81b8..a0bfe6e69c1 100644 --- a/hotspot/src/cpu/x86/vm/vmreg_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vmreg_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_vmreg_x86.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "code/vmreg.hpp" diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp index 7195f3e1c36..38d47dccfc3 100644 --- a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_VMREG_X86_HPP +#define CPU_X86_VM_VMREG_X86_HPP + bool is_Register(); Register as_Register(); @@ -30,3 +33,5 @@ bool is_XMMRegister(); XMMRegister as_XMMRegister(); + +#endif // CPU_X86_VM_VMREG_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp index 8de4d0ea13d..88201bd3d83 100644 --- a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_X86_VM_VMREG_X86_INLINE_HPP +#define CPU_X86_VM_VMREG_X86_INLINE_HPP + inline VMReg RegisterImpl::as_VMReg() { if( this==noreg ) return VMRegImpl::Bad(); #ifdef AMD64 @@ -82,3 +85,5 @@ inline bool VMRegImpl::is_concrete() { #endif // AMD64 return is_even(value()); } + +#endif // CPU_X86_VM_VMREG_X86_INLINE_HPP diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp index e6fe9dd381b..1517ca30bf3 100644 --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,19 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_vtableStubs_x86_32.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_x86.inline.hpp" +#include "code/vtableStubs.hpp" +#include "interp_masm_x86_32.hpp" +#include "memory/resourceArea.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/klassVtable.hpp" +#include "runtime/sharedRuntime.hpp" +#include "vmreg_x86.inline.hpp" +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif // machine-dependent part of VtableStubs: create VtableStub of correct size and // initialize its code diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp index 6a27f4fdeef..f12d85aa787 100644 --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp @@ -22,8 +22,19 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_vtableStubs_x86_64.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_x86.inline.hpp" +#include "code/vtableStubs.hpp" +#include "interp_masm_x86_64.hpp" +#include "memory/resourceArea.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/klassVtable.hpp" +#include "runtime/sharedRuntime.hpp" +#include "vmreg_x86.inline.hpp" +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif // machine-dependent part of VtableStubs: create VtableStub of correct size and // initialize its code diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index b2efb1099b2..b73bcda7fa9 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -506,6 +506,25 @@ void encode_CopyXD( CodeBuffer &cbuf, int dst_encoding, int src_encoding ) { } +//============================================================================= +const bool Matcher::constant_table_absolute_addressing = true; +const RegMask& MachConstantBaseNode::_out_RegMask = RegMask::Empty; + +void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const { + // Empty encoding +} + +uint MachConstantBaseNode::size(PhaseRegAlloc* ra_) const { + return 0; +} + +#ifndef PRODUCT +void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const { + st->print("# MachConstantBaseNode (empty encoding)"); +} +#endif + + //============================================================================= #ifndef PRODUCT void MachPrologNode::format( PhaseRegAlloc *ra_, outputStream* st ) const { @@ -1320,29 +1339,6 @@ int emit_deopt_handler(CodeBuffer& cbuf) { } -static void emit_double_constant(CodeBuffer& cbuf, double x) { - int mark = cbuf.insts()->mark_off(); - MacroAssembler _masm(&cbuf); - address double_address = __ double_constant(x); - cbuf.insts()->set_mark_off(mark); // preserve mark across masm shift - emit_d32_reloc(cbuf, - (int)double_address, - internal_word_Relocation::spec(double_address), - RELOC_DISP32); -} - -static void emit_float_constant(CodeBuffer& cbuf, float x) { - int mark = cbuf.insts()->mark_off(); - MacroAssembler _masm(&cbuf); - address float_address = __ float_constant(x); - cbuf.insts()->set_mark_off(mark); // preserve mark across masm shift - emit_d32_reloc(cbuf, - (int)float_address, - internal_word_Relocation::spec(float_address), - RELOC_DISP32); -} - - const bool Matcher::match_rule_supported(int opcode) { if (!has_match_rule(opcode)) return false; @@ -1354,22 +1350,6 @@ int Matcher::regnum_to_fpu_offset(int regnum) { return regnum - 32; // The FP registers are in the second chunk } -bool is_positive_zero_float(jfloat f) { - return jint_cast(f) == jint_cast(0.0F); -} - -bool is_positive_one_float(jfloat f) { - return jint_cast(f) == jint_cast(1.0F); -} - -bool is_positive_zero_double(jdouble d) { - return jlong_cast(d) == jlong_cast(0.0); -} - -bool is_positive_one_double(jdouble d) { - return jlong_cast(d) == jlong_cast(1.0); -} - // This is UltraSparc specific, true just means we have fast l2f conversion const bool Matcher::convL2FSupported(void) { return true; @@ -1508,6 +1488,16 @@ bool Matcher::is_spillable_arg( int reg ) { return can_be_java_arg(reg); } +bool Matcher::use_asm_for_ldiv_by_con( jlong divisor ) { + // Use hardware integer DIV instruction when + // it is faster than a code which use multiply. + // Only when constant divisor fits into 32 bit + // (min_jint is excluded to get only correct + // positive 32 bit values from negative). + return VM_Version::has_fast_idiv() && + (divisor == (int)divisor && divisor != min_jint); +} + // Register for DIVI projection of divmodI RegMask Matcher::divI_proj_mask() { return EAX_REG_mask; @@ -1546,6 +1536,9 @@ bool is_operand_hi32_zero(Node* n) { return true; } } + if (opc == Op_ConL && (n->get_long() & 0xFFFFFFFF00000000LL) == 0LL) { + return true; + } return false; } @@ -2023,67 +2016,6 @@ encode %{ %} - enc_class LdImmD (immD src) %{ // Load Immediate - if( is_positive_zero_double($src$$constant)) { - // FLDZ - emit_opcode(cbuf,0xD9); - emit_opcode(cbuf,0xEE); - } else if( is_positive_one_double($src$$constant)) { - // FLD1 - emit_opcode(cbuf,0xD9); - emit_opcode(cbuf,0xE8); - } else { - emit_opcode(cbuf,0xDD); - emit_rm(cbuf, 0x0, 0x0, 0x5); - emit_double_constant(cbuf, $src$$constant); - } - %} - - - enc_class LdImmF (immF src) %{ // Load Immediate - if( is_positive_zero_float($src$$constant)) { - emit_opcode(cbuf,0xD9); - emit_opcode(cbuf,0xEE); - } else if( is_positive_one_float($src$$constant)) { - emit_opcode(cbuf,0xD9); - emit_opcode(cbuf,0xE8); - } else { - $$$emit8$primary; - // Load immediate does not have a zero or sign extended version - // for 8-bit immediates - // First load to TOS, then move to dst - emit_rm(cbuf, 0x0, 0x0, 0x5); - emit_float_constant(cbuf, $src$$constant); - } - %} - - enc_class LdImmX (regX dst, immXF con) %{ // Load Immediate - emit_rm(cbuf, 0x0, $dst$$reg, 0x5); - emit_float_constant(cbuf, $con$$constant); - %} - - enc_class LdImmXD (regXD dst, immXD con) %{ // Load Immediate - emit_rm(cbuf, 0x0, $dst$$reg, 0x5); - emit_double_constant(cbuf, $con$$constant); - %} - - enc_class load_conXD (regXD dst, immXD con) %{ // Load double constant - // UseXmmLoadAndClearUpper ? movsd(dst, con) : movlpd(dst, con) - emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0xF2 : 0x66); - emit_opcode(cbuf, 0x0F); - emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0x10 : 0x12); - emit_rm(cbuf, 0x0, $dst$$reg, 0x5); - emit_double_constant(cbuf, $con$$constant); - %} - - enc_class Opc_MemImm_F(immF src) %{ - cbuf.set_insts_mark(); - $$$emit8$primary; - emit_rm(cbuf, 0x0, $secondary, 0x5); - emit_float_constant(cbuf, $src$$constant); - %} - - enc_class MovI2X_reg(regX dst, eRegI src) %{ emit_opcode(cbuf, 0x66 ); // MOVD dst,src emit_opcode(cbuf, 0x0F ); @@ -2309,9 +2241,11 @@ encode %{ enc_class move_long_big_shift_sign( eRegL dst, immI_32_63 cnt ) %{ emit_opcode( cbuf, 0x8B ); // Move emit_rm(cbuf, 0x3, $dst$$reg, HIGH_FROM_LOW($dst$$reg)); - emit_d8(cbuf,$primary); - emit_rm(cbuf, 0x3, $secondary, $dst$$reg); - emit_d8(cbuf,$cnt$$constant-32); + if( $cnt$$constant > 32 ) { // Shift, if not by zero + emit_d8(cbuf,$primary); + emit_rm(cbuf, 0x3, $secondary, $dst$$reg); + emit_d8(cbuf,$cnt$$constant-32); + } emit_d8(cbuf,$primary); emit_rm(cbuf, 0x3, $secondary, HIGH_FROM_LOW($dst$$reg)); emit_d8(cbuf,31); @@ -4786,7 +4720,7 @@ operand immD0() %{ interface(CONST_INTER); %} -// Double Immediate +// Double Immediate one operand immD1() %{ predicate( UseSSE<=1 && n->getd() == 1.0 ); match(ConD); @@ -4829,7 +4763,17 @@ operand immXD0() %{ // Float Immediate zero operand immF0() %{ - predicate( UseSSE == 0 && n->getf() == 0.0 ); + predicate(UseSSE == 0 && n->getf() == 0.0F); + match(ConF); + + op_cost(5); + format %{ %} + interface(CONST_INTER); +%} + +// Float Immediate one +operand immF1() %{ + predicate(UseSSE == 0 && n->getf() == 1.0F); match(ConF); op_cost(5); @@ -7200,24 +7144,53 @@ instruct loadConL0(eRegL dst, immL0 src, eFlagsReg cr) %{ %} // The instruction usage is guarded by predicate in operand immF(). -instruct loadConF(regF dst, immF src) %{ - match(Set dst src); +instruct loadConF(regF dst, immF con) %{ + match(Set dst con); ins_cost(125); - - format %{ "FLD_S ST,$src\n\t" + format %{ "FLD_S ST,[$constantaddress]\t# load from constant table: float=$con\n\t" "FSTP $dst" %} - opcode(0xD9, 0x00); /* D9 /0 */ - ins_encode(LdImmF(src), Pop_Reg_F(dst) ); - ins_pipe( fpu_reg_con ); + ins_encode %{ + __ fld_s($constantaddress($con)); + __ fstp_d($dst$$reg); + %} + ins_pipe(fpu_reg_con); +%} + +// The instruction usage is guarded by predicate in operand immF0(). +instruct loadConF0(regF dst, immF0 con) %{ + match(Set dst con); + ins_cost(125); + format %{ "FLDZ ST\n\t" + "FSTP $dst" %} + ins_encode %{ + __ fldz(); + __ fstp_d($dst$$reg); + %} + ins_pipe(fpu_reg_con); +%} + +// The instruction usage is guarded by predicate in operand immF1(). +instruct loadConF1(regF dst, immF1 con) %{ + match(Set dst con); + ins_cost(125); + format %{ "FLD1 ST\n\t" + "FSTP $dst" %} + ins_encode %{ + __ fld1(); + __ fstp_d($dst$$reg); + %} + ins_pipe(fpu_reg_con); %} // The instruction usage is guarded by predicate in operand immXF(). instruct loadConX(regX dst, immXF con) %{ match(Set dst con); ins_cost(125); - format %{ "MOVSS $dst,[$con]" %} - ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x10), LdImmX(dst, con)); - ins_pipe( pipe_slow ); + format %{ "MOVSS $dst,[$constantaddress]\t# load from constant table: float=$con" %} + ins_encode %{ + __ movflt($dst$$XMMRegister, $constantaddress($con)); + %} + ins_pipe(pipe_slow); %} // The instruction usage is guarded by predicate in operand immXF0(). @@ -7225,28 +7198,63 @@ instruct loadConX0(regX dst, immXF0 src) %{ match(Set dst src); ins_cost(100); format %{ "XORPS $dst,$dst\t# float 0.0" %} - ins_encode( Opcode(0x0F), Opcode(0x57), RegReg(dst,dst)); - ins_pipe( pipe_slow ); + ins_encode %{ + __ xorps($dst$$XMMRegister, $dst$$XMMRegister); + %} + ins_pipe(pipe_slow); %} // The instruction usage is guarded by predicate in operand immD(). -instruct loadConD(regD dst, immD src) %{ - match(Set dst src); +instruct loadConD(regD dst, immD con) %{ + match(Set dst con); ins_cost(125); - format %{ "FLD_D ST,$src\n\t" + format %{ "FLD_D ST,[$constantaddress]\t# load from constant table: double=$con\n\t" "FSTP $dst" %} - ins_encode(LdImmD(src), Pop_Reg_D(dst) ); - ins_pipe( fpu_reg_con ); + ins_encode %{ + __ fld_d($constantaddress($con)); + __ fstp_d($dst$$reg); + %} + ins_pipe(fpu_reg_con); +%} + +// The instruction usage is guarded by predicate in operand immD0(). +instruct loadConD0(regD dst, immD0 con) %{ + match(Set dst con); + ins_cost(125); + + format %{ "FLDZ ST\n\t" + "FSTP $dst" %} + ins_encode %{ + __ fldz(); + __ fstp_d($dst$$reg); + %} + ins_pipe(fpu_reg_con); +%} + +// The instruction usage is guarded by predicate in operand immD1(). +instruct loadConD1(regD dst, immD1 con) %{ + match(Set dst con); + ins_cost(125); + + format %{ "FLD1 ST\n\t" + "FSTP $dst" %} + ins_encode %{ + __ fld1(); + __ fstp_d($dst$$reg); + %} + ins_pipe(fpu_reg_con); %} // The instruction usage is guarded by predicate in operand immXD(). instruct loadConXD(regXD dst, immXD con) %{ match(Set dst con); ins_cost(125); - format %{ "MOVSD $dst,[$con]" %} - ins_encode(load_conXD(dst, con)); - ins_pipe( pipe_slow ); + format %{ "MOVSD $dst,[$constantaddress]\t# load from constant table: double=$con" %} + ins_encode %{ + __ movdbl($dst$$XMMRegister, $constantaddress($con)); + %} + ins_pipe(pipe_slow); %} // The instruction usage is guarded by predicate in operand immXD0(). @@ -8842,6 +8850,144 @@ instruct modL_eReg( eADXRegL dst, eRegL src1, eRegL src2, eFlagsReg cr, eCXRegI ins_pipe( pipe_slow ); %} +// Divide Register Long (no special case since divisor != -1) +instruct divL_eReg_imm32( eADXRegL dst, immL32 imm, eRegI tmp, eRegI tmp2, eFlagsReg cr ) %{ + match(Set dst (DivL dst imm)); + effect( TEMP tmp, TEMP tmp2, KILL cr ); + ins_cost(1000); + format %{ "MOV $tmp,abs($imm) # ldiv EDX:EAX,$imm\n\t" + "XOR $tmp2,$tmp2\n\t" + "CMP $tmp,EDX\n\t" + "JA,s fast\n\t" + "MOV $tmp2,EAX\n\t" + "MOV EAX,EDX\n\t" + "MOV EDX,0\n\t" + "JLE,s pos\n\t" + "LNEG EAX : $tmp2\n\t" + "DIV $tmp # unsigned division\n\t" + "XCHG EAX,$tmp2\n\t" + "DIV $tmp\n\t" + "LNEG $tmp2 : EAX\n\t" + "JMP,s done\n" + "pos:\n\t" + "DIV $tmp\n\t" + "XCHG EAX,$tmp2\n" + "fast:\n\t" + "DIV $tmp\n" + "done:\n\t" + "MOV EDX,$tmp2\n\t" + "NEG EDX:EAX # if $imm < 0" %} + ins_encode %{ + int con = (int)$imm$$constant; + assert(con != 0 && con != -1 && con != min_jint, "wrong divisor"); + int pcon = (con > 0) ? con : -con; + Label Lfast, Lpos, Ldone; + + __ movl($tmp$$Register, pcon); + __ xorl($tmp2$$Register,$tmp2$$Register); + __ cmpl($tmp$$Register, HIGH_FROM_LOW($dst$$Register)); + __ jccb(Assembler::above, Lfast); // result fits into 32 bit + + __ movl($tmp2$$Register, $dst$$Register); // save + __ movl($dst$$Register, HIGH_FROM_LOW($dst$$Register)); + __ movl(HIGH_FROM_LOW($dst$$Register),0); // preserve flags + __ jccb(Assembler::lessEqual, Lpos); // result is positive + + // Negative dividend. + // convert value to positive to use unsigned division + __ lneg($dst$$Register, $tmp2$$Register); + __ divl($tmp$$Register); + __ xchgl($dst$$Register, $tmp2$$Register); + __ divl($tmp$$Register); + // revert result back to negative + __ lneg($tmp2$$Register, $dst$$Register); + __ jmpb(Ldone); + + __ bind(Lpos); + __ divl($tmp$$Register); // Use unsigned division + __ xchgl($dst$$Register, $tmp2$$Register); + // Fallthrow for final divide, tmp2 has 32 bit hi result + + __ bind(Lfast); + // fast path: src is positive + __ divl($tmp$$Register); // Use unsigned division + + __ bind(Ldone); + __ movl(HIGH_FROM_LOW($dst$$Register),$tmp2$$Register); + if (con < 0) { + __ lneg(HIGH_FROM_LOW($dst$$Register), $dst$$Register); + } + %} + ins_pipe( pipe_slow ); +%} + +// Remainder Register Long (remainder fit into 32 bits) +instruct modL_eReg_imm32( eADXRegL dst, immL32 imm, eRegI tmp, eRegI tmp2, eFlagsReg cr ) %{ + match(Set dst (ModL dst imm)); + effect( TEMP tmp, TEMP tmp2, KILL cr ); + ins_cost(1000); + format %{ "MOV $tmp,abs($imm) # lrem EDX:EAX,$imm\n\t" + "CMP $tmp,EDX\n\t" + "JA,s fast\n\t" + "MOV $tmp2,EAX\n\t" + "MOV EAX,EDX\n\t" + "MOV EDX,0\n\t" + "JLE,s pos\n\t" + "LNEG EAX : $tmp2\n\t" + "DIV $tmp # unsigned division\n\t" + "MOV EAX,$tmp2\n\t" + "DIV $tmp\n\t" + "NEG EDX\n\t" + "JMP,s done\n" + "pos:\n\t" + "DIV $tmp\n\t" + "MOV EAX,$tmp2\n" + "fast:\n\t" + "DIV $tmp\n" + "done:\n\t" + "MOV EAX,EDX\n\t" + "SAR EDX,31\n\t" %} + ins_encode %{ + int con = (int)$imm$$constant; + assert(con != 0 && con != -1 && con != min_jint, "wrong divisor"); + int pcon = (con > 0) ? con : -con; + Label Lfast, Lpos, Ldone; + + __ movl($tmp$$Register, pcon); + __ cmpl($tmp$$Register, HIGH_FROM_LOW($dst$$Register)); + __ jccb(Assembler::above, Lfast); // src is positive and result fits into 32 bit + + __ movl($tmp2$$Register, $dst$$Register); // save + __ movl($dst$$Register, HIGH_FROM_LOW($dst$$Register)); + __ movl(HIGH_FROM_LOW($dst$$Register),0); // preserve flags + __ jccb(Assembler::lessEqual, Lpos); // result is positive + + // Negative dividend. + // convert value to positive to use unsigned division + __ lneg($dst$$Register, $tmp2$$Register); + __ divl($tmp$$Register); + __ movl($dst$$Register, $tmp2$$Register); + __ divl($tmp$$Register); + // revert remainder back to negative + __ negl(HIGH_FROM_LOW($dst$$Register)); + __ jmpb(Ldone); + + __ bind(Lpos); + __ divl($tmp$$Register); + __ movl($dst$$Register, $tmp2$$Register); + + __ bind(Lfast); + // fast path: src is positive + __ divl($tmp$$Register); + + __ bind(Ldone); + __ movl($dst$$Register, HIGH_FROM_LOW($dst$$Register)); + __ sarl(HIGH_FROM_LOW($dst$$Register), 31); // result sign + + %} + ins_pipe( pipe_slow ); +%} + // Integer Shift Instructions // Shift Left by one instruct shlI_eReg_1(eRegI dst, immI1 shift, eFlagsReg cr) %{ @@ -10150,41 +10296,45 @@ instruct addD_mem_reg(memory dst, regD src) %{ ins_pipe( fpu_reg_mem ); %} -instruct addD_reg_imm1(regD dst, immD1 src) %{ +instruct addD_reg_imm1(regD dst, immD1 con) %{ predicate(UseSSE<=1); - match(Set dst (AddD dst src)); + match(Set dst (AddD dst con)); ins_cost(125); format %{ "FLD1\n\t" "DADDp $dst,ST" %} - opcode(0xDE, 0x00); - ins_encode( LdImmD(src), - OpcP, RegOpc(dst) ); - ins_pipe( fpu_reg ); + ins_encode %{ + __ fld1(); + __ faddp($dst$$reg); + %} + ins_pipe(fpu_reg); %} -instruct addD_reg_imm(regD dst, immD src) %{ +instruct addD_reg_imm(regD dst, immD con) %{ predicate(UseSSE<=1 && _kids[1]->_leaf->getd() != 0.0 && _kids[1]->_leaf->getd() != 1.0 ); - match(Set dst (AddD dst src)); + match(Set dst (AddD dst con)); ins_cost(200); - format %{ "FLD_D [$src]\n\t" + format %{ "FLD_D [$constantaddress]\t# load from constant table: double=$con\n\t" "DADDp $dst,ST" %} - opcode(0xDE, 0x00); /* DE /0 */ - ins_encode( LdImmD(src), - OpcP, RegOpc(dst)); - ins_pipe( fpu_reg_mem ); + ins_encode %{ + __ fld_d($constantaddress($con)); + __ faddp($dst$$reg); + %} + ins_pipe(fpu_reg_mem); %} instruct addD_reg_imm_round(stackSlotD dst, regD src, immD con) %{ predicate(UseSSE<=1 && _kids[0]->_kids[1]->_leaf->getd() != 0.0 && _kids[0]->_kids[1]->_leaf->getd() != 1.0 ); match(Set dst (RoundDouble (AddD src con))); ins_cost(200); - format %{ "FLD_D [$con]\n\t" + format %{ "FLD_D [$constantaddress]\t# load from constant table: double=$con\n\t" "DADD ST,$src\n\t" "FSTP_D $dst\t# D-round" %} - opcode(0xD8, 0x00); /* D8 /0 */ - ins_encode( LdImmD(con), - OpcP, RegOpc(src), Pop_Mem_D(dst)); - ins_pipe( fpu_mem_reg_con ); + ins_encode %{ + __ fld_d($constantaddress($con)); + __ fadd($src$$reg); + __ fstp_d(Address(rsp, $dst$$disp)); + %} + ins_pipe(fpu_mem_reg_con); %} // Add two double precision floating point values in xmm @@ -10199,9 +10349,11 @@ instruct addXD_reg(regXD dst, regXD src) %{ instruct addXD_imm(regXD dst, immXD con) %{ predicate(UseSSE>=2); match(Set dst (AddD dst con)); - format %{ "ADDSD $dst,[$con]" %} - ins_encode( Opcode(0xF2), Opcode(0x0F), Opcode(0x58), LdImmXD(dst, con) ); - ins_pipe( pipe_slow ); + format %{ "ADDSD $dst,[$constantaddress]\t# load from constant table: double=$con" %} + ins_encode %{ + __ addsd($dst$$XMMRegister, $constantaddress($con)); + %} + ins_pipe(pipe_slow); %} instruct addXD_mem(regXD dst, memory mem) %{ @@ -10224,9 +10376,11 @@ instruct subXD_reg(regXD dst, regXD src) %{ instruct subXD_imm(regXD dst, immXD con) %{ predicate(UseSSE>=2); match(Set dst (SubD dst con)); - format %{ "SUBSD $dst,[$con]" %} - ins_encode( Opcode(0xF2), Opcode(0x0F), Opcode(0x5C), LdImmXD(dst, con) ); - ins_pipe( pipe_slow ); + format %{ "SUBSD $dst,[$constantaddress]\t# load from constant table: double=$con" %} + ins_encode %{ + __ subsd($dst$$XMMRegister, $constantaddress($con)); + %} + ins_pipe(pipe_slow); %} instruct subXD_mem(regXD dst, memory mem) %{ @@ -10249,9 +10403,11 @@ instruct mulXD_reg(regXD dst, regXD src) %{ instruct mulXD_imm(regXD dst, immXD con) %{ predicate(UseSSE>=2); match(Set dst (MulD dst con)); - format %{ "MULSD $dst,[$con]" %} - ins_encode( Opcode(0xF2), Opcode(0x0F), Opcode(0x59), LdImmXD(dst, con) ); - ins_pipe( pipe_slow ); + format %{ "MULSD $dst,[$constantaddress]\t# load from constant table: double=$con" %} + ins_encode %{ + __ mulsd($dst$$XMMRegister, $constantaddress($con)); + %} + ins_pipe(pipe_slow); %} instruct mulXD_mem(regXD dst, memory mem) %{ @@ -10275,9 +10431,11 @@ instruct divXD_reg(regXD dst, regXD src) %{ instruct divXD_imm(regXD dst, immXD con) %{ predicate(UseSSE>=2); match(Set dst (DivD dst con)); - format %{ "DIVSD $dst,[$con]" %} - ins_encode( Opcode(0xF2), Opcode(0x0F), Opcode(0x5E), LdImmXD(dst, con)); - ins_pipe( pipe_slow ); + format %{ "DIVSD $dst,[$constantaddress]\t# load from constant table: double=$con" %} + ins_encode %{ + __ divsd($dst$$XMMRegister, $constantaddress($con)); + %} + ins_pipe(pipe_slow); %} instruct divXD_mem(regXD dst, memory mem) %{ @@ -10328,16 +10486,17 @@ instruct strictfp_mulD_reg(regDPR1 dst, regnotDPR1 src) %{ ins_pipe( fpu_reg_reg ); %} -instruct mulD_reg_imm(regD dst, immD src) %{ +instruct mulD_reg_imm(regD dst, immD con) %{ predicate( UseSSE<=1 && _kids[1]->_leaf->getd() != 0.0 && _kids[1]->_leaf->getd() != 1.0 ); - match(Set dst (MulD dst src)); + match(Set dst (MulD dst con)); ins_cost(200); - format %{ "FLD_D [$src]\n\t" + format %{ "FLD_D [$constantaddress]\t# load from constant table: double=$con\n\t" "DMULp $dst,ST" %} - opcode(0xDE, 0x1); /* DE /1 */ - ins_encode( LdImmD(src), - OpcP, RegOpc(dst) ); - ins_pipe( fpu_reg_mem ); + ins_encode %{ + __ fld_d($constantaddress($con)); + __ fmulp($dst$$reg); + %} + ins_pipe(fpu_reg_mem); %} @@ -11071,9 +11230,11 @@ instruct addX_reg(regX dst, regX src) %{ instruct addX_imm(regX dst, immXF con) %{ predicate(UseSSE>=1); match(Set dst (AddF dst con)); - format %{ "ADDSS $dst,[$con]" %} - ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x58), LdImmX(dst, con) ); - ins_pipe( pipe_slow ); + format %{ "ADDSS $dst,[$constantaddress]\t# load from constant table: float=$con" %} + ins_encode %{ + __ addss($dst$$XMMRegister, $constantaddress($con)); + %} + ins_pipe(pipe_slow); %} instruct addX_mem(regX dst, memory mem) %{ @@ -11096,9 +11257,11 @@ instruct subX_reg(regX dst, regX src) %{ instruct subX_imm(regX dst, immXF con) %{ predicate(UseSSE>=1); match(Set dst (SubF dst con)); - format %{ "SUBSS $dst,[$con]" %} - ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x5C), LdImmX(dst, con) ); - ins_pipe( pipe_slow ); + format %{ "SUBSS $dst,[$constantaddress]\t# load from constant table: float=$con" %} + ins_encode %{ + __ subss($dst$$XMMRegister, $constantaddress($con)); + %} + ins_pipe(pipe_slow); %} instruct subX_mem(regX dst, memory mem) %{ @@ -11121,9 +11284,11 @@ instruct mulX_reg(regX dst, regX src) %{ instruct mulX_imm(regX dst, immXF con) %{ predicate(UseSSE>=1); match(Set dst (MulF dst con)); - format %{ "MULSS $dst,[$con]" %} - ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x59), LdImmX(dst, con) ); - ins_pipe( pipe_slow ); + format %{ "MULSS $dst,[$constantaddress]\t# load from constant table: float=$con" %} + ins_encode %{ + __ mulss($dst$$XMMRegister, $constantaddress($con)); + %} + ins_pipe(pipe_slow); %} instruct mulX_mem(regX dst, memory mem) %{ @@ -11146,9 +11311,11 @@ instruct divX_reg(regX dst, regX src) %{ instruct divX_imm(regX dst, immXF con) %{ predicate(UseSSE>=1); match(Set dst (DivF dst con)); - format %{ "DIVSS $dst,[$con]" %} - ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x5E), LdImmX(dst, con) ); - ins_pipe( pipe_slow ); + format %{ "DIVSS $dst,[$constantaddress]\t# load from constant table: float=$con" %} + ins_encode %{ + __ divss($dst$$XMMRegister, $constantaddress($con)); + %} + ins_pipe(pipe_slow); %} instruct divX_mem(regX dst, memory mem) %{ @@ -11303,31 +11470,33 @@ instruct addF24_mem_mem(stackSlotF dst, memory src1, memory src2) %{ // Spill to obtain 24-bit precision -instruct addF24_reg_imm(stackSlotF dst, regF src1, immF src2) %{ +instruct addF24_reg_imm(stackSlotF dst, regF src, immF con) %{ predicate(UseSSE==0 && Compile::current()->select_24_bit_instr()); - match(Set dst (AddF src1 src2)); - format %{ "FLD $src1\n\t" - "FADD $src2\n\t" + match(Set dst (AddF src con)); + format %{ "FLD $src\n\t" + "FADD_S [$constantaddress]\t# load from constant table: float=$con\n\t" "FSTP_S $dst" %} - opcode(0xD8, 0x00); /* D8 /0 */ - ins_encode( Push_Reg_F(src1), - Opc_MemImm_F(src2), - Pop_Mem_F(dst)); - ins_pipe( fpu_mem_reg_con ); + ins_encode %{ + __ fld_s($src$$reg - 1); // FLD ST(i-1) + __ fadd_s($constantaddress($con)); + __ fstp_s(Address(rsp, $dst$$disp)); + %} + ins_pipe(fpu_mem_reg_con); %} // // This instruction does not round to 24-bits -instruct addF_reg_imm(regF dst, regF src1, immF src2) %{ +instruct addF_reg_imm(regF dst, regF src, immF con) %{ predicate(UseSSE==0 && !Compile::current()->select_24_bit_instr()); - match(Set dst (AddF src1 src2)); - format %{ "FLD $src1\n\t" - "FADD $src2\n\t" - "FSTP_S $dst" %} - opcode(0xD8, 0x00); /* D8 /0 */ - ins_encode( Push_Reg_F(src1), - Opc_MemImm_F(src2), - Pop_Reg_F(dst)); - ins_pipe( fpu_reg_reg_con ); + match(Set dst (AddF src con)); + format %{ "FLD $src\n\t" + "FADD_S [$constantaddress]\t# load from constant table: float=$con\n\t" + "FSTP $dst" %} + ins_encode %{ + __ fld_s($src$$reg - 1); // FLD ST(i-1) + __ fadd_s($constantaddress($con)); + __ fstp_d($dst$$reg); + %} + ins_pipe(fpu_reg_reg_con); %} // Spill to obtain 24-bit precision @@ -11406,29 +11575,35 @@ instruct mulF24_mem_mem(stackSlotF dst, memory src1, memory src2) %{ %} // Spill to obtain 24-bit precision -instruct mulF24_reg_imm(stackSlotF dst, regF src1, immF src2) %{ +instruct mulF24_reg_imm(stackSlotF dst, regF src, immF con) %{ predicate(UseSSE==0 && Compile::current()->select_24_bit_instr()); - match(Set dst (MulF src1 src2)); + match(Set dst (MulF src con)); - format %{ "FMULc $dst,$src1,$src2" %} - opcode(0xD8, 0x1); /* D8 /1*/ - ins_encode( Push_Reg_F(src1), - Opc_MemImm_F(src2), - Pop_Mem_F(dst)); - ins_pipe( fpu_mem_reg_con ); + format %{ "FLD $src\n\t" + "FMUL_S [$constantaddress]\t# load from constant table: float=$con\n\t" + "FSTP_S $dst" %} + ins_encode %{ + __ fld_s($src$$reg - 1); // FLD ST(i-1) + __ fmul_s($constantaddress($con)); + __ fstp_s(Address(rsp, $dst$$disp)); + %} + ins_pipe(fpu_mem_reg_con); %} // // This instruction does not round to 24-bits -instruct mulF_reg_imm(regF dst, regF src1, immF src2) %{ +instruct mulF_reg_imm(regF dst, regF src, immF con) %{ predicate(UseSSE==0 && !Compile::current()->select_24_bit_instr()); - match(Set dst (MulF src1 src2)); + match(Set dst (MulF src con)); - format %{ "FMULc $dst. $src1, $src2" %} - opcode(0xD8, 0x1); /* D8 /1*/ - ins_encode( Push_Reg_F(src1), - Opc_MemImm_F(src2), - Pop_Reg_F(dst)); - ins_pipe( fpu_reg_reg_con ); + format %{ "FLD $src\n\t" + "FMUL_S [$constantaddress]\t# load from constant table: float=$con\n\t" + "FSTP $dst" %} + ins_encode %{ + __ fld_s($src$$reg - 1); // FLD ST(i-1) + __ fmul_s($constantaddress($con)); + __ fstp_d($dst$$reg); + %} + ins_pipe(fpu_reg_reg_con); %} @@ -12786,16 +12961,11 @@ instruct maxI_eReg(eRegI dst, eRegI src, eFlagsReg flags) %{ instruct jumpXtnd(eRegI switch_val) %{ match(Jump switch_val); ins_cost(350); - - format %{ "JMP [table_base](,$switch_val,1)\n\t" %} - + format %{ "JMP [$constantaddress](,$switch_val,1)\n\t" %} ins_encode %{ - address table_base = __ address_table_constant(_index2label); - // Jump to Address(table_base + switch_reg) - InternalAddress table(table_base); Address index(noreg, $switch_val$$Register, Address::times_1); - __ jump(ArrayAddress(table, index)); + __ jump(ArrayAddress($constantaddress, index)); %} ins_pc_relative(1); ins_pipe(pipe_jmp); diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index b0f73012f5f..e007ce96cc8 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -832,6 +832,25 @@ void encode_CopyXD( CodeBuffer &cbuf, int dst_encoding, int src_encoding ) { } +//============================================================================= +const bool Matcher::constant_table_absolute_addressing = true; +const RegMask& MachConstantBaseNode::_out_RegMask = RegMask::Empty; + +void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const { + // Empty encoding +} + +uint MachConstantBaseNode::size(PhaseRegAlloc* ra_) const { + return 0; +} + +#ifndef PRODUCT +void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const { + st->print("# MachConstantBaseNode (empty encoding)"); +} +#endif + + //============================================================================= #ifndef PRODUCT void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const @@ -1922,28 +1941,6 @@ int emit_deopt_handler(CodeBuffer& cbuf) return offset; } -static void emit_double_constant(CodeBuffer& cbuf, double x) { - int mark = cbuf.insts()->mark_off(); - MacroAssembler _masm(&cbuf); - address double_address = __ double_constant(x); - cbuf.insts()->set_mark_off(mark); // preserve mark across masm shift - emit_d32_reloc(cbuf, - (int) (double_address - cbuf.insts_end() - 4), - internal_word_Relocation::spec(double_address), - RELOC_DISP32); -} - -static void emit_float_constant(CodeBuffer& cbuf, float x) { - int mark = cbuf.insts()->mark_off(); - MacroAssembler _masm(&cbuf); - address float_address = __ float_constant(x); - cbuf.insts()->set_mark_off(mark); // preserve mark across masm shift - emit_d32_reloc(cbuf, - (int) (float_address - cbuf.insts_end() - 4), - internal_word_Relocation::spec(float_address), - RELOC_DISP32); -} - const bool Matcher::match_rule_supported(int opcode) { if (!has_match_rule(opcode)) @@ -2065,6 +2062,13 @@ bool Matcher::is_spillable_arg(int reg) return can_be_java_arg(reg); } +bool Matcher::use_asm_for_ldiv_by_con( jlong divisor ) { + // In 64 bit mode a code which use multiply when + // devisor is constant is faster than hardware + // DIV instruction (it uses MulHiL). + return false; +} + // Register for DIVI projection of divmodI RegMask Matcher::divI_proj_mask() { return INT_RAX_REG_mask; @@ -2782,43 +2786,6 @@ encode %{ } %} - enc_class load_immF(regF dst, immF con) - %{ - // XXX reg_mem doesn't support RIP-relative addressing yet - emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101 - emit_float_constant(cbuf, $con$$constant); - %} - - enc_class load_immD(regD dst, immD con) - %{ - // XXX reg_mem doesn't support RIP-relative addressing yet - emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101 - emit_double_constant(cbuf, $con$$constant); - %} - - enc_class load_conF (regF dst, immF con) %{ // Load float constant - emit_opcode(cbuf, 0xF3); - if ($dst$$reg >= 8) { - emit_opcode(cbuf, Assembler::REX_R); - } - emit_opcode(cbuf, 0x0F); - emit_opcode(cbuf, 0x10); - emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101 - emit_float_constant(cbuf, $con$$constant); - %} - - enc_class load_conD (regD dst, immD con) %{ // Load double constant - // UseXmmLoadAndClearUpper ? movsd(dst, con) : movlpd(dst, con) - emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0xF2 : 0x66); - if ($dst$$reg >= 8) { - emit_opcode(cbuf, Assembler::REX_R); - } - emit_opcode(cbuf, 0x0F); - emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0x10 : 0x12); - emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101 - emit_double_constant(cbuf, $con$$constant); - %} - // Encode a reg-reg copy. If it is useless, then empty encoding. enc_class enc_copy(rRegI dst, rRegI src) %{ @@ -2919,63 +2886,6 @@ encode %{ emit_d32(cbuf, 0x00); %} - enc_class jump_enc(rRegL switch_val, rRegI dest) %{ - MacroAssembler masm(&cbuf); - - Register switch_reg = as_Register($switch_val$$reg); - Register dest_reg = as_Register($dest$$reg); - address table_base = masm.address_table_constant(_index2label); - - // We could use jump(ArrayAddress) except that the macro assembler needs to use r10 - // to do that and the compiler is using that register as one it can allocate. - // So we build it all by hand. - // Address index(noreg, switch_reg, Address::times_1); - // ArrayAddress dispatch(table, index); - - Address dispatch(dest_reg, switch_reg, Address::times_1); - - masm.lea(dest_reg, InternalAddress(table_base)); - masm.jmp(dispatch); - %} - - enc_class jump_enc_addr(rRegL switch_val, immI2 shift, immL32 offset, rRegI dest) %{ - MacroAssembler masm(&cbuf); - - Register switch_reg = as_Register($switch_val$$reg); - Register dest_reg = as_Register($dest$$reg); - address table_base = masm.address_table_constant(_index2label); - - // We could use jump(ArrayAddress) except that the macro assembler needs to use r10 - // to do that and the compiler is using that register as one it can allocate. - // So we build it all by hand. - // Address index(noreg, switch_reg, (Address::ScaleFactor)$shift$$constant, (int)$offset$$constant); - // ArrayAddress dispatch(table, index); - - Address dispatch(dest_reg, switch_reg, (Address::ScaleFactor)$shift$$constant, (int)$offset$$constant); - - masm.lea(dest_reg, InternalAddress(table_base)); - masm.jmp(dispatch); - %} - - enc_class jump_enc_offset(rRegL switch_val, immI2 shift, rRegI dest) %{ - MacroAssembler masm(&cbuf); - - Register switch_reg = as_Register($switch_val$$reg); - Register dest_reg = as_Register($dest$$reg); - address table_base = masm.address_table_constant(_index2label); - - // We could use jump(ArrayAddress) except that the macro assembler needs to use r10 - // to do that and the compiler is using that register as one it can allocate. - // So we build it all by hand. - // Address index(noreg, switch_reg, (Address::ScaleFactor)$shift$$constant); - // ArrayAddress dispatch(table, index); - - Address dispatch(dest_reg, switch_reg, (Address::ScaleFactor)$shift$$constant); - masm.lea(dest_reg, InternalAddress(table_base)); - masm.jmp(dispatch); - - %} - enc_class lock_prefix() %{ if (os::is_MP()) { @@ -6634,12 +6544,11 @@ instruct loadConL32(rRegL dst, immL32 src) ins_pipe(ialu_reg); %} -instruct loadConP(rRegP dst, immP src) -%{ - match(Set dst src); +instruct loadConP(rRegP dst, immP con) %{ + match(Set dst con); - format %{ "movq $dst, $src\t# ptr" %} - ins_encode(load_immP(dst, src)); + format %{ "movq $dst, $con\t# ptr" %} + ins_encode(load_immP(dst, con)); ins_pipe(ialu_reg_fat); // XXX %} @@ -6666,13 +6575,13 @@ instruct loadConP31(rRegP dst, immP31 src, rFlagsReg cr) ins_pipe(ialu_reg); %} -instruct loadConF(regF dst, immF src) -%{ - match(Set dst src); +instruct loadConF(regF dst, immF con) %{ + match(Set dst con); ins_cost(125); - - format %{ "movss $dst, [$src]" %} - ins_encode(load_conF(dst, src)); + format %{ "movss $dst, [$constantaddress]\t# load from constant table: float=$con" %} + ins_encode %{ + __ movflt($dst$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -6714,13 +6623,13 @@ instruct loadConF0(regF dst, immF0 src) %} // Use the same format since predicate() can not be used here. -instruct loadConD(regD dst, immD src) -%{ - match(Set dst src); +instruct loadConD(regD dst, immD con) %{ + match(Set dst con); ins_cost(125); - - format %{ "movsd $dst, [$src]" %} - ins_encode(load_conD(dst, src)); + format %{ "movsd $dst, [$constantaddress]\t# load from constant table: double=$con" %} + ins_encode %{ + __ movdbl($dst$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -7349,43 +7258,6 @@ instruct bytes_reverse_short(rRegI dst) %{ ins_pipe( ialu_reg ); %} -instruct loadI_reversed(rRegI dst, memory src) %{ - match(Set dst (ReverseBytesI (LoadI src))); - - format %{ "bswap_movl $dst, $src" %} - opcode(0x8B, 0x0F, 0xC8); /* Opcode 8B 0F C8 */ - ins_encode(REX_reg_mem(dst, src), OpcP, reg_mem(dst, src), REX_reg(dst), OpcS, opc3_reg(dst)); - ins_pipe( ialu_reg_mem ); -%} - -instruct loadL_reversed(rRegL dst, memory src) %{ - match(Set dst (ReverseBytesL (LoadL src))); - - format %{ "bswap_movq $dst, $src" %} - opcode(0x8B, 0x0F, 0xC8); /* Opcode 8B 0F C8 */ - ins_encode(REX_reg_mem_wide(dst, src), OpcP, reg_mem(dst, src), REX_reg_wide(dst), OpcS, opc3_reg(dst)); - ins_pipe( ialu_reg_mem ); -%} - -instruct storeI_reversed(memory dst, rRegI src) %{ - match(Set dst (StoreI dst (ReverseBytesI src))); - - format %{ "movl_bswap $dst, $src" %} - opcode(0x0F, 0xC8, 0x89); /* Opcode 0F C8 89 */ - ins_encode( REX_reg(src), OpcP, opc2_reg(src), REX_reg_mem(src, dst), OpcT, reg_mem(src, dst) ); - ins_pipe( ialu_mem_reg ); -%} - -instruct storeL_reversed(memory dst, rRegL src) %{ - match(Set dst (StoreL dst (ReverseBytesL src))); - - format %{ "movq_bswap $dst, $src" %} - opcode(0x0F, 0xC8, 0x89); /* Opcode 0F C8 89 */ - ins_encode( REX_reg_wide(src), OpcP, opc2_reg(src), REX_reg_mem_wide(src, dst), OpcT, reg_mem(src, dst) ); - ins_pipe( ialu_mem_reg ); -%} - - //---------- Zeros Count Instructions ------------------------------------------ instruct countLeadingZerosI(rRegI dst, rRegI src, rFlagsReg cr) %{ @@ -7724,9 +7596,18 @@ instruct jumpXtnd_offset(rRegL switch_val, immI2 shift, rRegI dest) %{ predicate(false); effect(TEMP dest); - format %{ "leaq $dest, table_base\n\t" + format %{ "leaq $dest, [$constantaddress]\n\t" "jmp [$dest + $switch_val << $shift]\n\t" %} - ins_encode(jump_enc_offset(switch_val, shift, dest)); + ins_encode %{ + // We could use jump(ArrayAddress) except that the macro assembler needs to use r10 + // to do that and the compiler is using that register as one it can allocate. + // So we build it all by hand. + // Address index(noreg, switch_reg, (Address::ScaleFactor)$shift$$constant); + // ArrayAddress dispatch(table, index); + Address dispatch($dest$$Register, $switch_val$$Register, (Address::ScaleFactor) $shift$$constant); + __ lea($dest$$Register, $constantaddress); + __ jmp(dispatch); + %} ins_pipe(pipe_jmp); ins_pc_relative(1); %} @@ -7736,9 +7617,18 @@ instruct jumpXtnd_addr(rRegL switch_val, immI2 shift, immL32 offset, rRegI dest) ins_cost(350); effect(TEMP dest); - format %{ "leaq $dest, table_base\n\t" + format %{ "leaq $dest, [$constantaddress]\n\t" "jmp [$dest + $switch_val << $shift + $offset]\n\t" %} - ins_encode(jump_enc_addr(switch_val, shift, offset, dest)); + ins_encode %{ + // We could use jump(ArrayAddress) except that the macro assembler needs to use r10 + // to do that and the compiler is using that register as one it can allocate. + // So we build it all by hand. + // Address index(noreg, switch_reg, (Address::ScaleFactor) $shift$$constant, (int) $offset$$constant); + // ArrayAddress dispatch(table, index); + Address dispatch($dest$$Register, $switch_val$$Register, (Address::ScaleFactor) $shift$$constant, (int) $offset$$constant); + __ lea($dest$$Register, $constantaddress); + __ jmp(dispatch); + %} ins_pipe(pipe_jmp); ins_pc_relative(1); %} @@ -7748,9 +7638,18 @@ instruct jumpXtnd(rRegL switch_val, rRegI dest) %{ ins_cost(350); effect(TEMP dest); - format %{ "leaq $dest, table_base\n\t" + format %{ "leaq $dest, [$constantaddress]\n\t" "jmp [$dest + $switch_val]\n\t" %} - ins_encode(jump_enc(switch_val, dest)); + ins_encode %{ + // We could use jump(ArrayAddress) except that the macro assembler needs to use r10 + // to do that and the compiler is using that register as one it can allocate. + // So we build it all by hand. + // Address index(noreg, switch_reg, Address::times_1); + // ArrayAddress dispatch(table, index); + Address dispatch($dest$$Register, $switch_val$$Register, Address::times_1); + __ lea($dest$$Register, $constantaddress); + __ jmp(dispatch); + %} ins_pipe(pipe_jmp); ins_pc_relative(1); %} @@ -10406,30 +10305,36 @@ instruct cmpF_cc_memCF(rFlagsRegUCF cr, regF src1, memory src2) %{ ins_pipe(pipe_slow); %} -instruct cmpF_cc_imm(rFlagsRegU cr, regF src1, immF src2) -%{ - match(Set cr (CmpF src1 src2)); +instruct cmpF_cc_imm(rFlagsRegU cr, regF src, immF con) %{ + match(Set cr (CmpF src con)); ins_cost(145); - format %{ "ucomiss $src1, $src2\n\t" + format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con\n\t" "jnp,s exit\n\t" "pushfq\t# saw NaN, set CF\n\t" "andq [rsp], #0xffffff2b\n\t" "popfq\n" "exit: nop\t# avoid branch to branch" %} - opcode(0x0F, 0x2E); - ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, load_immF(src1, src2), - cmpfp_fixup); + ins_encode %{ + Label L_exit; + __ ucomiss($src$$XMMRegister, $constantaddress($con)); + __ jcc(Assembler::noParity, L_exit); + __ pushf(); + __ andq(rsp, 0xffffff2b); + __ popf(); + __ bind(L_exit); + __ nop(); + %} ins_pipe(pipe_slow); %} -instruct cmpF_cc_immCF(rFlagsRegUCF cr, regF src1, immF src2) %{ - match(Set cr (CmpF src1 src2)); - +instruct cmpF_cc_immCF(rFlagsRegUCF cr, regF src, immF con) %{ + match(Set cr (CmpF src con)); ins_cost(100); - format %{ "ucomiss $src1, $src2" %} - opcode(0x0F, 0x2E); - ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, load_immF(src1, src2)); + format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con" %} + ins_encode %{ + __ ucomiss($src$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -10488,30 +10393,36 @@ instruct cmpD_cc_memCF(rFlagsRegUCF cr, regD src1, memory src2) %{ ins_pipe(pipe_slow); %} -instruct cmpD_cc_imm(rFlagsRegU cr, regD src1, immD src2) -%{ - match(Set cr (CmpD src1 src2)); +instruct cmpD_cc_imm(rFlagsRegU cr, regD src, immD con) %{ + match(Set cr (CmpD src con)); ins_cost(145); - format %{ "ucomisd $src1, [$src2]\n\t" + format %{ "ucomisd $src, [$constantaddress]\t# load from constant table: double=$con\n\t" "jnp,s exit\n\t" "pushfq\t# saw NaN, set CF\n\t" "andq [rsp], #0xffffff2b\n\t" "popfq\n" "exit: nop\t# avoid branch to branch" %} - opcode(0x66, 0x0F, 0x2E); - ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, load_immD(src1, src2), - cmpfp_fixup); + ins_encode %{ + Label L_exit; + __ ucomisd($src$$XMMRegister, $constantaddress($con)); + __ jcc(Assembler::noParity, L_exit); + __ pushf(); + __ andq(rsp, 0xffffff2b); + __ popf(); + __ bind(L_exit); + __ nop(); + %} ins_pipe(pipe_slow); %} -instruct cmpD_cc_immCF(rFlagsRegUCF cr, regD src1, immD src2) %{ - match(Set cr (CmpD src1 src2)); - +instruct cmpD_cc_immCF(rFlagsRegUCF cr, regD src, immD con) %{ + match(Set cr (CmpD src con)); ins_cost(100); - format %{ "ucomisd $src1, [$src2]" %} - opcode(0x66, 0x0F, 0x2E); - ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, load_immD(src1, src2)); + format %{ "ucomisd $src, [$constantaddress]\t# load from constant table: double=$con" %} + ins_encode %{ + __ ucomisd($src$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -10558,23 +10469,29 @@ instruct cmpF_mem(rRegI dst, regF src1, memory src2, rFlagsReg cr) %} // Compare into -1,0,1 -instruct cmpF_imm(rRegI dst, regF src1, immF src2, rFlagsReg cr) -%{ - match(Set dst (CmpF3 src1 src2)); +instruct cmpF_imm(rRegI dst, regF src, immF con, rFlagsReg cr) %{ + match(Set dst (CmpF3 src con)); effect(KILL cr); ins_cost(275); - format %{ "ucomiss $src1, [$src2]\n\t" + format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con\n\t" "movl $dst, #-1\n\t" "jp,s done\n\t" "jb,s done\n\t" "setne $dst\n\t" "movzbl $dst, $dst\n" "done:" %} - - opcode(0x0F, 0x2E); - ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, load_immF(src1, src2), - cmpfp3(dst)); + ins_encode %{ + Label L_done; + Register Rdst = $dst$$Register; + __ ucomiss($src$$XMMRegister, $constantaddress($con)); + __ movl(Rdst, -1); + __ jcc(Assembler::parity, L_done); + __ jcc(Assembler::below, L_done); + __ setb(Assembler::notEqual, Rdst); + __ movzbl(Rdst, Rdst); + __ bind(L_done); + %} ins_pipe(pipe_slow); %} @@ -10621,23 +10538,29 @@ instruct cmpD_mem(rRegI dst, regD src1, memory src2, rFlagsReg cr) %} // Compare into -1,0,1 -instruct cmpD_imm(rRegI dst, regD src1, immD src2, rFlagsReg cr) -%{ - match(Set dst (CmpD3 src1 src2)); +instruct cmpD_imm(rRegI dst, regD src, immD con, rFlagsReg cr) %{ + match(Set dst (CmpD3 src con)); effect(KILL cr); ins_cost(275); - format %{ "ucomisd $src1, [$src2]\n\t" + format %{ "ucomisd $src, [$constantaddress]\t# load from constant table: double=$con\n\t" "movl $dst, #-1\n\t" "jp,s done\n\t" "jb,s done\n\t" "setne $dst\n\t" "movzbl $dst, $dst\n" "done:" %} - - opcode(0x66, 0x0F, 0x2E); - ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, load_immD(src1, src2), - cmpfp3(dst)); + ins_encode %{ + Register Rdst = $dst$$Register; + Label L_done; + __ ucomisd($src$$XMMRegister, $constantaddress($con)); + __ movl(Rdst, -1); + __ jcc(Assembler::parity, L_done); + __ jcc(Assembler::below, L_done); + __ setb(Assembler::notEqual, Rdst); + __ movzbl(Rdst, Rdst); + __ bind(L_done); + %} ins_pipe(pipe_slow); %} @@ -10663,14 +10586,13 @@ instruct addF_mem(regF dst, memory src) ins_pipe(pipe_slow); %} -instruct addF_imm(regF dst, immF src) -%{ - match(Set dst (AddF dst src)); - - format %{ "addss $dst, [$src]" %} +instruct addF_imm(regF dst, immF con) %{ + match(Set dst (AddF dst con)); + format %{ "addss $dst, [$constantaddress]\t# load from constant table: float=$con" %} ins_cost(150); // XXX - opcode(0xF3, 0x0F, 0x58); - ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src)); + ins_encode %{ + __ addss($dst$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -10696,14 +10618,13 @@ instruct addD_mem(regD dst, memory src) ins_pipe(pipe_slow); %} -instruct addD_imm(regD dst, immD src) -%{ - match(Set dst (AddD dst src)); - - format %{ "addsd $dst, [$src]" %} +instruct addD_imm(regD dst, immD con) %{ + match(Set dst (AddD dst con)); + format %{ "addsd $dst, [$constantaddress]\t# load from constant table: double=$con" %} ins_cost(150); // XXX - opcode(0xF2, 0x0F, 0x58); - ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src)); + ins_encode %{ + __ addsd($dst$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -10729,14 +10650,13 @@ instruct subF_mem(regF dst, memory src) ins_pipe(pipe_slow); %} -instruct subF_imm(regF dst, immF src) -%{ - match(Set dst (SubF dst src)); - - format %{ "subss $dst, [$src]" %} +instruct subF_imm(regF dst, immF con) %{ + match(Set dst (SubF dst con)); + format %{ "subss $dst, [$constantaddress]\t# load from constant table: float=$con" %} ins_cost(150); // XXX - opcode(0xF3, 0x0F, 0x5C); - ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src)); + ins_encode %{ + __ subss($dst$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -10762,14 +10682,13 @@ instruct subD_mem(regD dst, memory src) ins_pipe(pipe_slow); %} -instruct subD_imm(regD dst, immD src) -%{ - match(Set dst (SubD dst src)); - - format %{ "subsd $dst, [$src]" %} +instruct subD_imm(regD dst, immD con) %{ + match(Set dst (SubD dst con)); + format %{ "subsd $dst, [$constantaddress]\t# load from constant table: double=$con" %} ins_cost(150); // XXX - opcode(0xF2, 0x0F, 0x5C); - ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src)); + ins_encode %{ + __ subsd($dst$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -10795,14 +10714,13 @@ instruct mulF_mem(regF dst, memory src) ins_pipe(pipe_slow); %} -instruct mulF_imm(regF dst, immF src) -%{ - match(Set dst (MulF dst src)); - - format %{ "mulss $dst, [$src]" %} +instruct mulF_imm(regF dst, immF con) %{ + match(Set dst (MulF dst con)); + format %{ "mulss $dst, [$constantaddress]\t# load from constant table: float=$con" %} ins_cost(150); // XXX - opcode(0xF3, 0x0F, 0x59); - ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src)); + ins_encode %{ + __ mulss($dst$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -10828,14 +10746,13 @@ instruct mulD_mem(regD dst, memory src) ins_pipe(pipe_slow); %} -instruct mulD_imm(regD dst, immD src) -%{ - match(Set dst (MulD dst src)); - - format %{ "mulsd $dst, [$src]" %} +instruct mulD_imm(regD dst, immD con) %{ + match(Set dst (MulD dst con)); + format %{ "mulsd $dst, [$constantaddress]\t# load from constant table: double=$con" %} ins_cost(150); // XXX - opcode(0xF2, 0x0F, 0x59); - ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src)); + ins_encode %{ + __ mulsd($dst$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -10861,14 +10778,13 @@ instruct divF_mem(regF dst, memory src) ins_pipe(pipe_slow); %} -instruct divF_imm(regF dst, immF src) -%{ - match(Set dst (DivF dst src)); - - format %{ "divss $dst, [$src]" %} +instruct divF_imm(regF dst, immF con) %{ + match(Set dst (DivF dst con)); + format %{ "divss $dst, [$constantaddress]\t# load from constant table: float=$con" %} ins_cost(150); // XXX - opcode(0xF3, 0x0F, 0x5E); - ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src)); + ins_encode %{ + __ divss($dst$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -10894,14 +10810,13 @@ instruct divD_mem(regD dst, memory src) ins_pipe(pipe_slow); %} -instruct divD_imm(regD dst, immD src) -%{ - match(Set dst (DivD dst src)); - - format %{ "divsd $dst, [$src]" %} +instruct divD_imm(regD dst, immD con) %{ + match(Set dst (DivD dst con)); + format %{ "divsd $dst, [$constantaddress]\t# load from constant table: double=$con" %} ins_cost(150); // XXX - opcode(0xF2, 0x0F, 0x5E); - ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src)); + ins_encode %{ + __ divsd($dst$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -10927,14 +10842,13 @@ instruct sqrtF_mem(regF dst, memory src) ins_pipe(pipe_slow); %} -instruct sqrtF_imm(regF dst, immF src) -%{ - match(Set dst (ConvD2F (SqrtD (ConvF2D src)))); - - format %{ "sqrtss $dst, [$src]" %} +instruct sqrtF_imm(regF dst, immF con) %{ + match(Set dst (ConvD2F (SqrtD (ConvF2D con)))); + format %{ "sqrtss $dst, [$constantaddress]\t# load from constant table: float=$con" %} ins_cost(150); // XXX - opcode(0xF3, 0x0F, 0x51); - ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src)); + ins_encode %{ + __ sqrtss($dst$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} @@ -10960,14 +10874,13 @@ instruct sqrtD_mem(regD dst, memory src) ins_pipe(pipe_slow); %} -instruct sqrtD_imm(regD dst, immD src) -%{ - match(Set dst (SqrtD src)); - - format %{ "sqrtsd $dst, [$src]" %} +instruct sqrtD_imm(regD dst, immD con) %{ + match(Set dst (SqrtD con)); + format %{ "sqrtsd $dst, [$constantaddress]\t# load from constant table: double=$con" %} ins_cost(150); // XXX - opcode(0xF2, 0x0F, 0x51); - ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src)); + ins_encode %{ + __ sqrtsd($dst$$XMMRegister, $constantaddress($con)); + %} ins_pipe(pipe_slow); %} diff --git a/hotspot/src/cpu/zero/vm/assembler_zero.cpp b/hotspot/src/cpu/zero/vm/assembler_zero.cpp index a748d4009c2..a3e36276415 100644 --- a/hotspot/src/cpu/zero/vm/assembler_zero.cpp +++ b/hotspot/src/cpu/zero/vm/assembler_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,24 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_assembler_zero.cpp.incl" +#include "precompiled.hpp" +#include "assembler_zero.inline.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "interpreter/interpreter.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "memory/resourceArea.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/objectMonitor.hpp" +#include "runtime/os.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#ifndef SERIALGC +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" +#include "gc_implementation/g1/heapRegion.hpp" +#endif int AbstractAssembler::code_fill_byte() { return 0; diff --git a/hotspot/src/cpu/zero/vm/assembler_zero.hpp b/hotspot/src/cpu/zero/vm/assembler_zero.hpp index ec7ac47920e..2cc25a73aa0 100644 --- a/hotspot/src/cpu/zero/vm/assembler_zero.hpp +++ b/hotspot/src/cpu/zero/vm/assembler_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_ASSEMBLER_ZERO_HPP +#define CPU_ZERO_VM_ASSEMBLER_ZERO_HPP + // In normal, CPU-specific ports of HotSpot these two classes are used // for generating assembly language. We don't do any of this in zero, // of course, but we do sneak entry points around in CodeBuffers so we @@ -62,3 +65,5 @@ inline bool AbstractAssembler::pd_check_instruction_mark() { address ShouldNotCallThisStub(); address ShouldNotCallThisEntry(); + +#endif // CPU_ZERO_VM_ASSEMBLER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/assembler_zero.inline.hpp b/hotspot/src/cpu/zero/vm/assembler_zero.inline.hpp index 1e7f6703a71..274ded2a097 100644 --- a/hotspot/src/cpu/zero/vm/assembler_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/assembler_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,14 @@ * */ +#ifndef CPU_ZERO_VM_ASSEMBLER_ZERO_INLINE_HPP +#define CPU_ZERO_VM_ASSEMBLER_ZERO_INLINE_HPP + +#include "asm/assembler.inline.hpp" +#include "asm/codeBuffer.hpp" +#include "code/codeCache.hpp" +#include "runtime/handles.inline.hpp" + // This file is intentionally empty + +#endif // CPU_ZERO_VM_ASSEMBLER_ZERO_INLINE_HPP diff --git a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp index 0ef2c5db186..1dc891231bb 100644 --- a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2008 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,25 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_cppInterpreter_zero.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interp_masm_zero.hpp" +#include "interpreter/bytecodeInterpreter.hpp" +#include "interpreter/bytecodeInterpreter.inline.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" #ifdef CC_INTERP diff --git a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp index 49da4359d25..1980be2ba5c 100644 --- a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp +++ b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_HPP +#define CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_HPP + // Platform specific for C++ based Interpreter #if defined(PPC) || defined(SPARC) || defined(IA64) @@ -146,3 +149,5 @@ ((VMJavaVal64*)(addr))->d) #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \ ((VMJavaVal64*)(addr))->l) + +#endif // CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp index a35809f0a5b..6a32ea6a39f 100644 --- a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP +#define CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP + // Inline interpreter functions for zero inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { @@ -299,3 +302,5 @@ inline jshort BytecodeInterpreter::VMint2Short(jint val) { inline jbyte BytecodeInterpreter::VMint2Byte(jint val) { return (jbyte) val; } + +#endif // CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP diff --git a/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp b/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp index 0655291158d..e3f801f400a 100644 --- a/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp +++ b/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,8 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_bytecodes_zero.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/bytecodes.hpp" void Bytecodes::pd_initialize() { // No zero specific initialization diff --git a/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp b/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp index 1e7f6703a71..f214bb74512 100644 --- a/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp +++ b/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_BYTECODES_ZERO_HPP +#define CPU_ZERO_VM_BYTECODES_ZERO_HPP + // This file is intentionally empty + +#endif // CPU_ZERO_VM_BYTECODES_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/bytes_zero.hpp b/hotspot/src/cpu/zero/vm/bytes_zero.hpp index 5bd0254c481..39caaeabcc3 100644 --- a/hotspot/src/cpu/zero/vm/bytes_zero.hpp +++ b/hotspot/src/cpu/zero/vm/bytes_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,11 @@ * */ +#ifndef CPU_ZERO_VM_BYTES_ZERO_HPP +#define CPU_ZERO_VM_BYTES_ZERO_HPP + +#include "memory/allocation.hpp" + typedef union unaligned { u4 u; u2 us; @@ -160,5 +165,10 @@ class Bytes: AllStatic { #ifdef VM_LITTLE_ENDIAN // The following header contains the implementations of swap_u2, // swap_u4, and swap_u8 -#include "incls/_bytes_pd.inline.hpp.incl" +#ifdef TARGET_OS_ARCH_linux_zero +# include "bytes_linux_zero.inline.hpp" +#endif + #endif // VM_LITTLE_ENDIAN + +#endif // CPU_ZERO_VM_BYTES_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/codeBuffer_zero.hpp b/hotspot/src/cpu/zero/vm/codeBuffer_zero.hpp index c3348ba8cd0..7837f9a239c 100644 --- a/hotspot/src/cpu/zero/vm/codeBuffer_zero.hpp +++ b/hotspot/src/cpu/zero/vm/codeBuffer_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,5 +23,10 @@ * */ +#ifndef CPU_ZERO_VM_CODEBUFFER_ZERO_HPP +#define CPU_ZERO_VM_CODEBUFFER_ZERO_HPP + private: void pd_initialize() {} + +#endif // CPU_ZERO_VM_CODEBUFFER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/copy_zero.hpp b/hotspot/src/cpu/zero/vm/copy_zero.hpp index 971d45d05c0..1837e2b98eb 100644 --- a/hotspot/src/cpu/zero/vm/copy_zero.hpp +++ b/hotspot/src/cpu/zero/vm/copy_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_COPY_ZERO_HPP +#define CPU_ZERO_VM_COPY_ZERO_HPP + // Inline functions for memory copy and fill. static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) { @@ -176,3 +179,5 @@ static void pd_zero_to_words(HeapWord* tohw, size_t count) { static void pd_zero_to_bytes(void* to, size_t count) { memset(to, 0, count); } + +#endif // CPU_ZERO_VM_COPY_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp index 78bacdfa2b4..ff61306c760 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP +#define CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP + protected: MacroAssembler* assembler() const { return _masm; @@ -35,3 +38,5 @@ entry->set_entry_point(entry_point); return (address) entry; } + +#endif // CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 3d55bbecd37..1c945f22dd4 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,33 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_cppInterpreter_zero.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/cppInterpreter.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/arguments.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/timer.hpp" +#include "runtime/vframeArray.hpp" +#include "stack_zero.inline.hpp" +#include "utilities/debug.hpp" +#ifdef SHARK +#include "shark/shark_globals.hpp" +#endif #ifdef CC_INTERP diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp index 9c101e91382..26f0e0414c8 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_CPPINTERPRETER_ZERO_HPP +#define CPU_ZERO_VM_CPPINTERPRETER_ZERO_HPP + protected: // Size of interpreter code const static int InterpreterCodeSize = 6 * K; @@ -41,3 +44,5 @@ private: // Fast result type determination static BasicType result_type_of(methodOop method); + +#endif // CPU_ZERO_VM_CPPINTERPRETER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/debug_zero.cpp b/hotspot/src/cpu/zero/vm/debug_zero.cpp index 062198e52f5..19d00e33cdc 100644 --- a/hotspot/src/cpu/zero/vm/debug_zero.cpp +++ b/hotspot/src/cpu/zero/vm/debug_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,14 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_debug_zero.cpp.incl" +#include "precompiled.hpp" +#include "code/codeCache.hpp" +#include "code/nmethod.hpp" +#include "runtime/frame.hpp" +#include "runtime/init.hpp" +#include "runtime/os.hpp" +#include "utilities/debug.hpp" +#include "utilities/top.hpp" void pd_ps(frame f) { ShouldNotCallThis(); diff --git a/hotspot/src/cpu/zero/vm/depChecker_zero.cpp b/hotspot/src/cpu/zero/vm/depChecker_zero.cpp index 1e7f6703a71..fcc514141e5 100644 --- a/hotspot/src/cpu/zero/vm/depChecker_zero.cpp +++ b/hotspot/src/cpu/zero/vm/depChecker_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,8 @@ * */ +#include "precompiled.hpp" +#include "compiler/disassembler.hpp" +#include "depChecker_zero.hpp" + // This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/depChecker_zero.hpp b/hotspot/src/cpu/zero/vm/depChecker_zero.hpp index 1e7f6703a71..cf5a401c4a8 100644 --- a/hotspot/src/cpu/zero/vm/depChecker_zero.hpp +++ b/hotspot/src/cpu/zero/vm/depChecker_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_DEPCHECKER_ZERO_HPP +#define CPU_ZERO_VM_DEPCHECKER_ZERO_HPP + // This file is intentionally empty + +#endif // CPU_ZERO_VM_DEPCHECKER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/disassembler_zero.cpp b/hotspot/src/cpu/zero/vm/disassembler_zero.cpp index 1e7f6703a71..944a52f5dd9 100644 --- a/hotspot/src/cpu/zero/vm/disassembler_zero.cpp +++ b/hotspot/src/cpu/zero/vm/disassembler_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,6 @@ * */ +#include "precompiled.hpp" + // This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/disassembler_zero.hpp b/hotspot/src/cpu/zero/vm/disassembler_zero.hpp index c488cf8e765..889b91330e6 100644 --- a/hotspot/src/cpu/zero/vm/disassembler_zero.hpp +++ b/hotspot/src/cpu/zero/vm/disassembler_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_DISASSEMBLER_ZERO_HPP +#define CPU_ZERO_VM_DISASSEMBLER_ZERO_HPP + static int pd_instruction_alignment() { return 1; } @@ -30,3 +33,5 @@ static const char* pd_cpu_opts() { return ""; } + +#endif // CPU_ZERO_VM_DISASSEMBLER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/dump_zero.cpp b/hotspot/src/cpu/zero/vm/dump_zero.cpp index 5ff4d60d59f..c9f341bdc05 100644 --- a/hotspot/src/cpu/zero/vm/dump_zero.cpp +++ b/hotspot/src/cpu/zero/vm/dump_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_dump_zero.cpp.incl" +#include "precompiled.hpp" +#include "assembler_zero.inline.hpp" +#include "memory/compactingPermGenGen.hpp" +#include "memory/generation.inline.hpp" +#include "memory/space.inline.hpp" void CompactingPermGenGen::generate_vtable_methods(void** vtbl_list, void** vtable, diff --git a/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp b/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp index 95643f906a9..434b11adf1f 100644 --- a/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp +++ b/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,12 @@ * */ +#ifndef CPU_ZERO_VM_ENTRYFRAME_ZERO_HPP +#define CPU_ZERO_VM_ENTRYFRAME_ZERO_HPP + +#include "runtime/javaCalls.hpp" +#include "stack_zero.hpp" + // | ... | // +--------------------+ ------------------ // | parameter n-1 | low addresses @@ -63,3 +69,5 @@ class EntryFrame : public ZeroFrame { char* valuebuf, int buflen) const; }; + +#endif // CPU_ZERO_VM_ENTRYFRAME_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/entry_zero.hpp b/hotspot/src/cpu/zero/vm/entry_zero.hpp index ed7dff57720..78e25a6757d 100644 --- a/hotspot/src/cpu/zero/vm/entry_zero.hpp +++ b/hotspot/src/cpu/zero/vm/entry_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_ENTRY_ZERO_HPP +#define CPU_ZERO_VM_ENTRY_ZERO_HPP + class ZeroEntry { public: ZeroEntry() { @@ -72,3 +75,5 @@ class ZeroEntry { return byte_offset_of(ZeroEntry, _entry_point); } }; + +#endif // CPU_ZERO_VM_ENTRY_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/fakeStubFrame_zero.hpp b/hotspot/src/cpu/zero/vm/fakeStubFrame_zero.hpp index ccaf9f5bb71..b7a3b01ca80 100644 --- a/hotspot/src/cpu/zero/vm/fakeStubFrame_zero.hpp +++ b/hotspot/src/cpu/zero/vm/fakeStubFrame_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,11 @@ * */ +#ifndef CPU_ZERO_VM_FAKESTUBFRAME_ZERO_HPP +#define CPU_ZERO_VM_FAKESTUBFRAME_ZERO_HPP + +#include "stack_zero.hpp" + // | ... | // +--------------------+ ------------------ // | frame_type | low addresses @@ -51,3 +56,5 @@ class FakeStubFrame : public ZeroFrame { char* valuebuf, int buflen) const {} }; + +#endif // CPU_ZERO_VM_FAKESTUBFRAME_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/frame_zero.cpp b/hotspot/src/cpu/zero/vm/frame_zero.cpp index cc68ec905e6..a1e5ea6cfa1 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.cpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,26 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_frame_zero.cpp.incl" +#include "precompiled.hpp" +#include "code/scopeDesc.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "memory/resourceArea.hpp" +#include "oops/markOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/monitorChunk.hpp" +#include "runtime/signature.hpp" +#include "runtime/stubCodeGenerator.hpp" +#include "runtime/stubRoutines.hpp" +#include "vmreg_zero.inline.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#include "runtime/vframeArray.hpp" +#endif #ifdef ASSERT void RegisterMap::check_location_valid() { diff --git a/hotspot/src/cpu/zero/vm/frame_zero.hpp b/hotspot/src/cpu/zero/vm/frame_zero.hpp index f70e8d44148..56f0a1716b0 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.hpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,12 @@ * */ +#ifndef CPU_ZERO_VM_FRAME_ZERO_HPP +#define CPU_ZERO_VM_FRAME_ZERO_HPP + +#include "runtime/synchronizer.hpp" +#include "utilities/top.hpp" + // A frame represents a physical stack frame on the Zero stack. public: @@ -72,3 +78,5 @@ outputStream* st, char* buf, int buflen) const; + +#endif // CPU_ZERO_VM_FRAME_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp index 50fda705ad9..9ad237de945 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP +#define CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP + // Constructors inline frame::frame() { @@ -149,3 +152,5 @@ inline intptr_t* frame::unextended_sp() const { else return (intptr_t *) -1; } + +#endif // CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP diff --git a/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp b/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp index 2ab140aa4c5..ceb010f3cc8 100644 --- a/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp +++ b/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_GLOBALDEFINITIONS_ZERO_HPP +#define CPU_ZERO_VM_GLOBALDEFINITIONS_ZERO_HPP + #include + +#endif // CPU_ZERO_VM_GLOBALDEFINITIONS_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/globals_zero.hpp b/hotspot/src/cpu/zero/vm/globals_zero.hpp index f9d1635cb4c..88c7d0888df 100644 --- a/hotspot/src/cpu/zero/vm/globals_zero.hpp +++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,12 @@ * */ +#ifndef CPU_ZERO_VM_GLOBALS_ZERO_HPP +#define CPU_ZERO_VM_GLOBALS_ZERO_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // Set the default values for platform dependent flags used by the // runtime system. See globals.hpp for details of what they do. @@ -45,3 +51,7 @@ define_pd_global(intx, StackShadowPages, 5 LP64_ONLY(+1) DEBUG_ONLY(+3)); define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); + +define_pd_global(bool, UseMembar, false); + +#endif // CPU_ZERO_VM_GLOBALS_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp index 3291c387dba..85e9f729140 100644 --- a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp +++ b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_icBuffer_zero.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_zero.inline.hpp" +#include "code/icBuffer.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "interpreter/bytecodes.hpp" +#include "memory/resourceArea.hpp" +#include "nativeInst_zero.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.inline2.hpp" int InlineCacheBuffer::ic_stub_code_size() { // NB set this once the functions below are implemented diff --git a/hotspot/src/cpu/zero/vm/icache_zero.cpp b/hotspot/src/cpu/zero/vm/icache_zero.cpp index 5253ff55e7a..b37465016dd 100644 --- a/hotspot/src/cpu/zero/vm/icache_zero.cpp +++ b/hotspot/src/cpu/zero/vm/icache_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_icache_zero.cpp.incl" +#include "precompiled.hpp" +#include "assembler_zero.inline.hpp" +#include "runtime/icache.hpp" void ICacheStubGenerator::generate_icache_flush( ICache::flush_icache_stub_t* flush_icache_stub) { diff --git a/hotspot/src/cpu/zero/vm/icache_zero.hpp b/hotspot/src/cpu/zero/vm/icache_zero.hpp index 7dd2bcb79e3..2383d211e2e 100644 --- a/hotspot/src/cpu/zero/vm/icache_zero.hpp +++ b/hotspot/src/cpu/zero/vm/icache_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_ICACHE_ZERO_HPP +#define CPU_ZERO_VM_ICACHE_ZERO_HPP + // Interface for updating the instruction cache. Whenever the VM // modifies code, part of the processor instruction cache potentially // has to be flushed. This implementation is empty: Zero never deals @@ -34,3 +37,5 @@ class ICache : public AbstractICache { static void invalidate_word(address addr) {} static void invalidate_range(address start, int nbytes) {} }; + +#endif // CPU_ZERO_VM_ICACHE_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp b/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp index 1e7f6703a71..8b470ebcee7 100644 --- a/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp +++ b/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,22 @@ * */ +#include "precompiled.hpp" +#include "interp_masm_zero.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "oops/arrayOop.hpp" +#include "oops/markOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiRedefineClassesTrace.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/basicLock.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/sharedRuntime.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif + // This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp b/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp index 75b9be05e04..493f0b7909d 100644 --- a/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp +++ b/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,12 @@ * */ +#ifndef CPU_ZERO_VM_INTERP_MASM_ZERO_HPP +#define CPU_ZERO_VM_INTERP_MASM_ZERO_HPP + +#include "assembler_zero.inline.hpp" +#include "interpreter/invocationCounter.hpp" + // This file specializes the assember with interpreter-specific macros class InterpreterMacroAssembler : public MacroAssembler { @@ -36,3 +42,5 @@ class InterpreterMacroAssembler : public MacroAssembler { ShouldNotCallThis(); } }; + +#endif // CPU_ZERO_VM_INTERP_MASM_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp b/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp index e0f3a5eac76..0e2b7888077 100644 --- a/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp +++ b/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,14 @@ * */ +#ifndef CPU_ZERO_VM_INTERPRETERFRAME_ZERO_HPP +#define CPU_ZERO_VM_INTERPRETERFRAME_ZERO_HPP + +#include "interpreter/bytecodeInterpreter.hpp" +#include "oops/methodOop.hpp" +#include "runtime/thread.hpp" +#include "stack_zero.hpp" + #ifdef CC_INTERP // | ... | // +--------------------+ ------------------ @@ -71,3 +79,5 @@ class InterpreterFrame : public ZeroFrame { int buflen) const; }; #endif // CC_INTERP + +#endif // CPU_ZERO_VM_INTERPRETERFRAME_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp index 2f0ce7ad11e..fe9acbf7595 100644 --- a/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp +++ b/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP +#define CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP + // Generation of Interpreter // friend class AbstractInterpreterGenerator; @@ -35,3 +38,5 @@ address generate_empty_entry(); address generate_accessor_entry(); address generate_method_handle_entry(); + +#endif // CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp b/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp index c8c50a47aa1..785645ac77e 100644 --- a/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp +++ b/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,18 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_interpreterRT_zero.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/universe.inline.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/icache.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/signature.hpp" +#include "stack_zero.inline.hpp" void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_int() { push(T_INT); diff --git a/hotspot/src/cpu/zero/vm/interpreterRT_zero.hpp b/hotspot/src/cpu/zero/vm/interpreterRT_zero.hpp index 692450210a5..6330dd4fe4b 100644 --- a/hotspot/src/cpu/zero/vm/interpreterRT_zero.hpp +++ b/hotspot/src/cpu/zero/vm/interpreterRT_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,11 @@ * */ +#ifndef CPU_ZERO_VM_INTERPRETERRT_ZERO_HPP +#define CPU_ZERO_VM_INTERPRETERRT_ZERO_HPP + +#include "memory/allocation.hpp" + class SignatureHandler { public: static SignatureHandler *from_handlerAddr(address handlerAddr) { @@ -92,15 +97,15 @@ class SignatureHandlerGenerator : public SignatureHandlerGeneratorBase { public: SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) - : SignatureHandlerGeneratorBase(method, (ffi_cif *) buffer->code_end()), + : SignatureHandlerGeneratorBase(method, (ffi_cif *) buffer->insts_end()), _cb(buffer) { - _cb->set_code_end((address) (cif() + 1)); + _cb->set_insts_end((address) (cif() + 1)); } private: void push(intptr_t value) { - intptr_t *dst = (intptr_t *) _cb->code_end(); - _cb->set_code_end((address) (dst + 1)); + intptr_t *dst = (intptr_t *) _cb->insts_end(); + _cb->set_insts_end((address) (dst + 1)); *dst = value; } }; @@ -125,3 +130,5 @@ class SlowSignatureHandlerGenerator : public SignatureHandlerGeneratorBase { return (SignatureHandler *) cif(); } }; + +#endif // CPU_ZERO_VM_INTERPRETERRT_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp index a74cef8ae01..027d372a2f6 100644 --- a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,32 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_interpreter_zero.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateTable.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/arguments.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/timer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif address AbstractInterpreterGenerator::generate_slow_signature_handler() { _masm->advance(1); diff --git a/hotspot/src/cpu/zero/vm/interpreter_zero.hpp b/hotspot/src/cpu/zero/vm/interpreter_zero.hpp index 192fe210391..b7b0f1d8b32 100644 --- a/hotspot/src/cpu/zero/vm/interpreter_zero.hpp +++ b/hotspot/src/cpu/zero/vm/interpreter_zero.hpp @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_INTERPRETER_ZERO_HPP +#define CPU_ZERO_VM_INTERPRETER_ZERO_HPP + public: static void invoke_method(methodOop method, address entry_point, TRAPS) { ((ZeroEntry *) entry_point)->invoke(method, THREAD); @@ -47,3 +50,5 @@ assert(i <= 0, "local direction already negated"); return stackElementWords * i; } + +#endif // CPU_ZERO_VM_INTERPRETER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/javaFrameAnchor_zero.hpp b/hotspot/src/cpu/zero/vm/javaFrameAnchor_zero.hpp index 0763790b64e..275fcf53dca 100644 --- a/hotspot/src/cpu/zero/vm/javaFrameAnchor_zero.hpp +++ b/hotspot/src/cpu/zero/vm/javaFrameAnchor_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_JAVAFRAMEANCHOR_ZERO_HPP +#define CPU_ZERO_VM_JAVAFRAMEANCHOR_ZERO_HPP + private: ZeroFrame* volatile _last_Java_fp; @@ -89,3 +92,5 @@ static ByteSize last_Java_fp_offset() { return byte_offset_of(JavaFrameAnchor, _last_Java_fp); } + +#endif // CPU_ZERO_VM_JAVAFRAMEANCHOR_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/jniFastGetField_zero.cpp b/hotspot/src/cpu/zero/vm/jniFastGetField_zero.cpp index 1d089430b97..d37ed807b69 100644 --- a/hotspot/src/cpu/zero/vm/jniFastGetField_zero.cpp +++ b/hotspot/src/cpu/zero/vm/jniFastGetField_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,12 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_jniFastGetField_zero.cpp.incl" +#include "precompiled.hpp" +#include "assembler_zero.inline.hpp" +#include "memory/resourceArea.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm_misc.hpp" +#include "runtime/safepoint.hpp" address JNI_FastGetField::generate_fast_get_boolean_field() { return (address) -1; diff --git a/hotspot/src/cpu/zero/vm/jniTypes_zero.hpp b/hotspot/src/cpu/zero/vm/jniTypes_zero.hpp index 0ee26a77215..766b5e1d6bc 100644 --- a/hotspot/src/cpu/zero/vm/jniTypes_zero.hpp +++ b/hotspot/src/cpu/zero/vm/jniTypes_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef CPU_ZERO_VM_JNITYPES_ZERO_HPP +#define CPU_ZERO_VM_JNITYPES_ZERO_HPP + +#include "memory/allocation.hpp" +#include "oops/oop.hpp" +#include "prims/jni.h" + // This file holds platform-dependent routines used to write primitive jni // types to the array of arguments passed into JavaCalls::call @@ -106,3 +113,5 @@ public: #endif }; + +#endif // CPU_ZERO_VM_JNITYPES_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/jni_zero.h b/hotspot/src/cpu/zero/vm/jni_zero.h index e814a9e1c9c..0e21634dff6 100644 --- a/hotspot/src/cpu/zero/vm/jni_zero.h +++ b/hotspot/src/cpu/zero/vm/jni_zero.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp b/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp index fa6e675f93f..b76b2a7c2f9 100644 --- a/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp +++ b/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_methodHandles_zero.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "memory/allocation.inline.hpp" +#include "prims/methodHandles.hpp" int MethodHandles::adapter_conversion_ops_supported_mask() { ShouldNotCallThis(); diff --git a/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp b/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp index 60fb24f2d1d..98a2121a8da 100644 --- a/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp +++ b/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2008 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,18 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_nativeInst_zero.cpp.incl" +#include "precompiled.hpp" +#include "assembler_zero.inline.hpp" +#include "memory/resourceArea.hpp" +#include "nativeInst_zero.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "utilities/ostream.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif // This method is called by nmethod::make_not_entrant_or_zombie to // insert a jump to SharedRuntime::get_handle_wrong_method_stub() diff --git a/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp b/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp index 005574dff28..16d1d3f0dee 100644 --- a/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp +++ b/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,15 @@ * */ +#ifndef CPU_ZERO_VM_NATIVEINST_ZERO_HPP +#define CPU_ZERO_VM_NATIVEINST_ZERO_HPP + +#include "asm/assembler.hpp" +#include "memory/allocation.hpp" +#include "runtime/icache.hpp" +#include "runtime/os.hpp" +#include "utilities/top.hpp" + // We have interfaces for the following instructions: // - NativeInstruction // - - NativeCall @@ -183,3 +192,5 @@ class NativeGeneralJump : public NativeInstruction { inline NativeGeneralJump* nativeGeneralJump_at(address address) { ShouldNotCallThis(); } + +#endif // CPU_ZERO_VM_NATIVEINST_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/registerMap_zero.hpp b/hotspot/src/cpu/zero/vm/registerMap_zero.hpp index 64a6b65afae..6c9e0e6827b 100644 --- a/hotspot/src/cpu/zero/vm/registerMap_zero.hpp +++ b/hotspot/src/cpu/zero/vm/registerMap_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef CPU_ZERO_VM_REGISTERMAP_ZERO_HPP +#define CPU_ZERO_VM_REGISTERMAP_ZERO_HPP + // machine-dependent implemention for register maps friend class frame; @@ -37,3 +40,5 @@ void pd_clear() {} void pd_initialize() {} void pd_initialize_from(const RegisterMap* map) {} + +#endif // CPU_ZERO_VM_REGISTERMAP_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp b/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp index 1e7f6703a71..4ed89fe2b28 100644 --- a/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp +++ b/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,10 @@ * */ +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "asm/register.hpp" +#include "interp_masm_zero.hpp" +#include "register_zero.hpp" + // This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/register_zero.cpp b/hotspot/src/cpu/zero/vm/register_zero.cpp index ddea3c248ff..31bee7baf78 100644 --- a/hotspot/src/cpu/zero/vm/register_zero.cpp +++ b/hotspot/src/cpu/zero/vm/register_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,8 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_register_zero.cpp.incl" +#include "precompiled.hpp" +#include "register_zero.hpp" const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers; const int ConcreteRegisterImpl::max_fpr = diff --git a/hotspot/src/cpu/zero/vm/register_zero.hpp b/hotspot/src/cpu/zero/vm/register_zero.hpp index 65f5ca6eda9..0bcc7638248 100644 --- a/hotspot/src/cpu/zero/vm/register_zero.hpp +++ b/hotspot/src/cpu/zero/vm/register_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,12 @@ * */ +#ifndef CPU_ZERO_VM_REGISTER_ZERO_HPP +#define CPU_ZERO_VM_REGISTER_ZERO_HPP + +#include "asm/register.hpp" +#include "vm_version_zero.hpp" + class VMRegImpl; typedef VMRegImpl* VMReg; @@ -108,3 +114,5 @@ class ConcreteRegisterImpl : public AbstractRegisterImpl { }; CONSTANT_REGISTER_DECLARATION(Register, noreg, (-1)); + +#endif // CPU_ZERO_VM_REGISTER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp b/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp index 637d9c799d8..e04acad8fd0 100644 --- a/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp +++ b/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,13 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_relocInfo_zero.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.inline.hpp" +#include "assembler_zero.inline.hpp" +#include "code/relocInfo.hpp" +#include "nativeInst_zero.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/safepoint.hpp" void Relocation::pd_set_data_value(address x, intptr_t o) { ShouldNotCallThis(); diff --git a/hotspot/src/cpu/zero/vm/relocInfo_zero.hpp b/hotspot/src/cpu/zero/vm/relocInfo_zero.hpp index 6abcb888152..75cf0eaf9af 100644 --- a/hotspot/src/cpu/zero/vm/relocInfo_zero.hpp +++ b/hotspot/src/cpu/zero/vm/relocInfo_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_RELOCINFO_ZERO_HPP +#define CPU_ZERO_VM_RELOCINFO_ZERO_HPP + // machine-dependent parts of class relocInfo private: enum { @@ -30,3 +33,5 @@ offset_unit = 1, format_width = 1 }; + +#endif // CPU_ZERO_VM_RELOCINFO_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp b/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp index 2fa914482eb..b88c5e810f6 100644 --- a/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp +++ b/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,28 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_sharedRuntime_zero.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_zero.inline.hpp" +#include "code/debugInfoRec.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "interpreter/interpreter.hpp" +#include "oops/compiledICHolderOop.hpp" +#include "prims/jvmtiRedefineClassesTrace.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/vframeArray.hpp" +#include "vmreg_zero.inline.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif +#ifdef SHARK +#include "compiler/compileBroker.hpp" +#include "shark/sharkCompiler.hpp" +#endif DeoptimizationBlob *SharedRuntime::_deopt_blob; SafepointBlob *SharedRuntime::_polling_page_safepoint_handler_blob; diff --git a/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp b/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp index 4cea6594d32..0dd4b0a52d7 100644 --- a/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp +++ b/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,12 @@ * */ +#ifndef CPU_ZERO_VM_SHARKFRAME_ZERO_HPP +#define CPU_ZERO_VM_SHARKFRAME_ZERO_HPP + +#include "oops/methodOop.hpp" +#include "stack_zero.hpp" + // | ... | // +--------------------+ ------------------ // | stack slot n-1 | low addresses @@ -77,3 +83,5 @@ class SharkFrame : public ZeroFrame { char* valuebuf, int buflen) const; }; + +#endif // CPU_ZERO_VM_SHARKFRAME_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp b/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp index 30151973840..32a2646139f 100644 --- a/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp +++ b/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_SHARK_GLOBALS_ZERO_HPP +#define CPU_ZERO_VM_SHARK_GLOBALS_ZERO_HPP + // Set the default values for platform dependent flags used by the // Shark compiler. See globals.hpp for details of what they do. @@ -60,3 +63,5 @@ define_pd_global(uintx, MaxPermSize, 64*M ); define_pd_global(bool, NeverActAsServerClassMachine, true ); define_pd_global(uint64_t, MaxRAM, 1ULL*G); define_pd_global(bool, CICompileOSR, true ); + +#endif // CPU_ZERO_VM_SHARK_GLOBALS_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/stack_zero.cpp b/hotspot/src/cpu/zero/vm/stack_zero.cpp index 59e94978baf..f1b31cc95ae 100644 --- a/hotspot/src/cpu/zero/vm/stack_zero.cpp +++ b/hotspot/src/cpu/zero/vm/stack_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stack_zero.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "stack_zero.hpp" +#include "stack_zero.inline.hpp" int ZeroStack::suggest_size(Thread *thread) const { assert(needs_setup(), "already set up"); diff --git a/hotspot/src/cpu/zero/vm/stack_zero.hpp b/hotspot/src/cpu/zero/vm/stack_zero.hpp index 304944aa1a2..5f34b7c1cb7 100644 --- a/hotspot/src/cpu/zero/vm/stack_zero.hpp +++ b/hotspot/src/cpu/zero/vm/stack_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,11 @@ * */ +#ifndef CPU_ZERO_VM_STACK_ZERO_HPP +#define CPU_ZERO_VM_STACK_ZERO_HPP + +#include "utilities/sizes.hpp" + class ZeroStack { private: intptr_t *_base; // the last available word @@ -217,3 +222,5 @@ class ZeroFrame { char* fieldbuf, int buflen) const; }; + +#endif // CPU_ZERO_VM_STACK_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp b/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp index 516312f436a..f0387bb7bfd 100644 --- a/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,12 @@ * */ +#ifndef CPU_ZERO_VM_STACK_ZERO_INLINE_HPP +#define CPU_ZERO_VM_STACK_ZERO_INLINE_HPP + +#include "runtime/thread.hpp" +#include "stack_zero.hpp" + // This function should match SharkStack::CreateStackOverflowCheck inline void ZeroStack::overflow_check(int required_words, TRAPS) { // Check the Zero stack @@ -46,3 +52,5 @@ inline int ZeroStack::abi_stack_available(Thread *thread) const { int stack_free = thread->stack_size() - stack_used; return stack_free - shadow_pages_size(); } + +#endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP diff --git a/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp b/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp index ada26e089bc..77d23a4ffb7 100644 --- a/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp +++ b/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,29 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stubGenerator_zero.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_zero.inline.hpp" +#include "interpreter/interpreter.hpp" +#include "nativeInst_zero.hpp" +#include "oops/instanceOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/oop.inline.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubCodeGenerator.hpp" +#include "runtime/stubRoutines.hpp" +#include "stack_zero.inline.hpp" +#include "utilities/top.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif // Declaration and definition of StubGenerator (no .hpp file). // For a more detailed description of the stub routine structure diff --git a/hotspot/src/cpu/zero/vm/stubRoutines_zero.cpp b/hotspot/src/cpu/zero/vm/stubRoutines_zero.cpp index ba92c3b9324..4a8c7cb9329 100644 --- a/hotspot/src/cpu/zero/vm/stubRoutines_zero.cpp +++ b/hotspot/src/cpu/zero/vm/stubRoutines_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,13 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stubRoutines_zero.cpp.incl" +#include "precompiled.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/stubRoutines.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif #ifdef IA32 address StubRoutines::x86::_call_stub_compiled_return = NULL; diff --git a/hotspot/src/cpu/zero/vm/stubRoutines_zero.hpp b/hotspot/src/cpu/zero/vm/stubRoutines_zero.hpp index b088f548a36..d4d521b4bc4 100644 --- a/hotspot/src/cpu/zero/vm/stubRoutines_zero.hpp +++ b/hotspot/src/cpu/zero/vm/stubRoutines_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_STUBROUTINES_ZERO_HPP +#define CPU_ZERO_VM_STUBROUTINES_ZERO_HPP + // This file holds the platform specific parts of the StubRoutines // definition. See stubRoutines.hpp for a description on how to // extend it. @@ -53,3 +56,5 @@ static address _call_stub_compiled_return; }; #endif // IA32 + +#endif // CPU_ZERO_VM_STUBROUTINES_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp index 1e7f6703a71..1747bc6ea26 100644 --- a/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp +++ b/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_TEMPLATEINTERPRETERGENERATOR_ZERO_HPP +#define CPU_ZERO_VM_TEMPLATEINTERPRETERGENERATOR_ZERO_HPP + // This file is intentionally empty + +#endif // CPU_ZERO_VM_TEMPLATEINTERPRETERGENERATOR_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp index 1e7f6703a71..53486a3907b 100644 --- a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,27 @@ * */ +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateTable.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/jvmtiThreadState.hpp" +#include "runtime/arguments.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/timer.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/debug.hpp" + // This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp b/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp index 1e7f6703a71..fb0e266a3a9 100644 --- a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp +++ b/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_TEMPLATEINTERPRETER_ZERO_HPP +#define CPU_ZERO_VM_TEMPLATEINTERPRETER_ZERO_HPP + // This file is intentionally empty + +#endif // CPU_ZERO_VM_TEMPLATEINTERPRETER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/templateTable_zero.cpp b/hotspot/src/cpu/zero/vm/templateTable_zero.cpp index 1e7f6703a71..e5fb7b17f7a 100644 --- a/hotspot/src/cpu/zero/vm/templateTable_zero.cpp +++ b/hotspot/src/cpu/zero/vm/templateTable_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,17 @@ * */ +#include "precompiled.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateTable.hpp" +#include "memory/universe.inline.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/oop.inline.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" + // This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/templateTable_zero.hpp b/hotspot/src/cpu/zero/vm/templateTable_zero.hpp index 1e7f6703a71..6fc38560522 100644 --- a/hotspot/src/cpu/zero/vm/templateTable_zero.hpp +++ b/hotspot/src/cpu/zero/vm/templateTable_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_TEMPLATETABLE_ZERO_HPP +#define CPU_ZERO_VM_TEMPLATETABLE_ZERO_HPP + // This file is intentionally empty + +#endif // CPU_ZERO_VM_TEMPLATETABLE_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp b/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp index 872d37fcc25..1b3815a0a2c 100644 --- a/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp +++ b/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_VMSTRUCTS_ZERO_HPP +#define CPU_ZERO_VM_VMSTRUCTS_ZERO_HPP + // These are the CPU-specific fields, types and integer // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. @@ -50,3 +53,5 @@ /* 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 must */ /* be present there) */ + +#endif // CPU_ZERO_VM_VMSTRUCTS_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/vm_version_zero.cpp b/hotspot/src/cpu/zero/vm/vm_version_zero.cpp index 1e7f6703a71..87ff88be5ae 100644 --- a/hotspot/src/cpu/zero/vm/vm_version_zero.cpp +++ b/hotspot/src/cpu/zero/vm/vm_version_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,14 @@ * */ +#include "precompiled.hpp" +#include "assembler_zero.inline.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/java.hpp" +#include "runtime/stubCodeGenerator.hpp" +#include "vm_version_zero.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "os_linux.inline.hpp" +#endif + // This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/vm_version_zero.hpp b/hotspot/src/cpu/zero/vm/vm_version_zero.hpp index c16ab5ddc71..78109b933f4 100644 --- a/hotspot/src/cpu/zero/vm/vm_version_zero.hpp +++ b/hotspot/src/cpu/zero/vm/vm_version_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,9 +23,17 @@ * */ +#ifndef CPU_ZERO_VM_VM_VERSION_ZERO_HPP +#define CPU_ZERO_VM_VM_VERSION_ZERO_HPP + +#include "runtime/globals_extension.hpp" +#include "runtime/vm_version.hpp" + class VM_Version : public Abstract_VM_Version { public: static const char* cpu_features() { return ""; } }; + +#endif // CPU_ZERO_VM_VM_VERSION_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/vmreg_zero.cpp b/hotspot/src/cpu/zero/vm/vmreg_zero.cpp index 8385cb976dc..a5181cf8f53 100644 --- a/hotspot/src/cpu/zero/vm/vmreg_zero.cpp +++ b/hotspot/src/cpu/zero/vm/vmreg_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_vmreg_zero.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "code/vmreg.hpp" void VMRegImpl::set_regName() { int i = 0; diff --git a/hotspot/src/cpu/zero/vm/vmreg_zero.hpp b/hotspot/src/cpu/zero/vm/vmreg_zero.hpp index 6234fdd6f85..60354a11ca0 100644 --- a/hotspot/src/cpu/zero/vm/vmreg_zero.hpp +++ b/hotspot/src/cpu/zero/vm/vmreg_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ +#ifndef CPU_ZERO_VM_VMREG_ZERO_HPP +#define CPU_ZERO_VM_VMREG_ZERO_HPP + bool is_Register(); Register as_Register(); bool is_FloatRegister(); FloatRegister as_FloatRegister(); + +#endif // CPU_ZERO_VM_VMREG_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/vmreg_zero.inline.hpp b/hotspot/src/cpu/zero/vm/vmreg_zero.inline.hpp index 56c7b8712ce..0c771062a25 100644 --- a/hotspot/src/cpu/zero/vm/vmreg_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/vmreg_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef CPU_ZERO_VM_VMREG_ZERO_INLINE_HPP +#define CPU_ZERO_VM_VMREG_ZERO_INLINE_HPP + inline VMReg RegisterImpl::as_VMReg() { return VMRegImpl::as_VMReg(encoding()); } @@ -30,3 +33,5 @@ inline VMReg RegisterImpl::as_VMReg() { inline VMReg FloatRegisterImpl::as_VMReg() { return VMRegImpl::as_VMReg(encoding() + ConcreteRegisterImpl::max_gpr); } + +#endif // CPU_ZERO_VM_VMREG_ZERO_INLINE_HPP diff --git a/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp b/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp index 13605d9362d..e4ea32e44c1 100644 --- a/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp +++ b/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,19 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_vtableStubs_zero.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_zero.inline.hpp" +#include "code/vtableStubs.hpp" +#include "interp_masm_zero.hpp" +#include "memory/resourceArea.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/klassVtable.hpp" +#include "runtime/sharedRuntime.hpp" +#include "vmreg_zero.inline.hpp" +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { ShouldNotCallThis(); diff --git a/hotspot/src/os/linux/launcher/java.h b/hotspot/src/os/linux/launcher/java.h deleted file mode 100644 index 88b0ccb541d..00000000000 --- a/hotspot/src/os/linux/launcher/java.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -/* - * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK, - * search "GAMMA" for gamma specific changes. - */ - -#ifndef _JAVA_H_ -#define _JAVA_H_ - -/* - * Get system specific defines. - */ -#include "jni.h" -#include "java_md.h" - -/* - * Pointers to the needed JNI invocation API, initialized by LoadJavaVM. - */ -typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args); -typedef jint (JNICALL *GetDefaultJavaVMInitArgs_t)(void *args); - -typedef struct { - CreateJavaVM_t CreateJavaVM; - GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs; -} InvocationFunctions; - -/* - * Prototypes for launcher functions in the system specific java_md.c. - */ - -jboolean -LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn); - -void -GetXUsagePath(char *buf, jint bufsize); - -jboolean -GetApplicationHome(char *buf, jint bufsize); - -const char * -GetArch(); - -void CreateExecutionEnvironment(int *_argc, - char ***_argv, - char jrepath[], - jint so_jrepath, - char jvmpath[], - jint so_jvmpath, - char **original_argv); - -/* - * Report an error message to stderr or a window as appropriate. The - * flag always is set to JNI_TRUE if message is to be reported to both - * strerr and windows and set to JNI_FALSE if the message should only - * be sent to a window. - */ -void ReportErrorMessage(char * message, jboolean always); -void ReportErrorMessage2(char * format, char * string, jboolean always); - -/* - * Report an exception which terminates the vm to stderr or a window - * as appropriate. - */ -void ReportExceptionDescription(JNIEnv * env); - -jboolean RemovableMachineDependentOption(char * option); -void PrintMachineDependentOptions(); - -/* - * Functions defined in java.c and used in java_md.c. - */ -jint ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative); -char *CheckJvmType(int *argc, char ***argv, jboolean speculative); -void* MemAlloc(size_t size); - -/* - * Make launcher spit debug output. - */ -extern jboolean _launcher_debug; -/* - * This allows for finding classes from the VM's bootstrap class loader - * directly, FindClass uses the application class loader internally, this will - * cause unnecessary searching of the classpath for the required classes. - */ -typedef jclass (JNICALL FindClassFromBootLoader_t(JNIEnv *env, - const char *name, - jboolean throwError)); - -jclass FindBootStrapClass(JNIEnv *env, const char *classname); - -#endif /* _JAVA_H_ */ diff --git a/hotspot/src/os/linux/vm/attachListener_linux.cpp b/hotspot/src/os/linux/vm/attachListener_linux.cpp index 837410ab3bd..5b9c7294995 100644 --- a/hotspot/src/os/linux/vm/attachListener_linux.cpp +++ b/hotspot/src/os/linux/vm/attachListener_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_attachListener_linux.cpp.incl" +#include "precompiled.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/os.hpp" +#include "services/attachListener.hpp" +#include "services/dtraceAttacher.hpp" #include #include @@ -176,10 +179,10 @@ int LinuxAttachListener::init() { int n = snprintf(path, UNIX_PATH_MAX, "%s/.java_pid%d", os::get_temp_directory(), os::current_process_id()); - if (n <= (int)UNIX_PATH_MAX) { + if (n < (int)UNIX_PATH_MAX) { n = snprintf(initial_path, UNIX_PATH_MAX, "%s.tmp", path); } - if (n > (int)UNIX_PATH_MAX) { + if (n >= (int)UNIX_PATH_MAX) { return -1; } diff --git a/hotspot/src/os/linux/vm/c1_globals_linux.hpp b/hotspot/src/os/linux/vm/c1_globals_linux.hpp index 301d169c178..0507898060a 100644 --- a/hotspot/src/os/linux/vm/c1_globals_linux.hpp +++ b/hotspot/src/os/linux/vm/c1_globals_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,15 @@ * */ +#ifndef OS_LINUX_VM_C1_GLOBALS_LINUX_HPP +#define OS_LINUX_VM_C1_GLOBALS_LINUX_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // // Sets the default values for operating system dependent flags used by the // client compiler. (see c1_globals.hpp) // + +#endif // OS_LINUX_VM_C1_GLOBALS_LINUX_HPP diff --git a/hotspot/src/os/linux/vm/c2_globals_linux.hpp b/hotspot/src/os/linux/vm/c2_globals_linux.hpp index b14af55c55c..d81638946c4 100644 --- a/hotspot/src/os/linux/vm/c2_globals_linux.hpp +++ b/hotspot/src/os/linux/vm/c2_globals_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,15 @@ * */ +#ifndef OS_LINUX_VM_C2_GLOBALS_LINUX_HPP +#define OS_LINUX_VM_C2_GLOBALS_LINUX_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // // Sets the default values for operating system dependent flags used by the // server compiler. (see c2_globals.hpp) // + +#endif // OS_LINUX_VM_C2_GLOBALS_LINUX_HPP diff --git a/hotspot/src/os/linux/vm/chaitin_linux.cpp b/hotspot/src/os/linux/vm/chaitin_linux.cpp index 461ad342c53..e4925644dbc 100644 --- a/hotspot/src/os/linux/vm/chaitin_linux.cpp +++ b/hotspot/src/os/linux/vm/chaitin_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_chaitin_linux.cpp.incl" +#include "precompiled.hpp" +#include "opto/chaitin.hpp" +#include "opto/machnode.hpp" void PhaseRegAlloc::pd_preallocate_hook() { // no action diff --git a/hotspot/src/os/linux/vm/objectMonitor_linux.cpp b/hotspot/src/os/linux/vm/decoder_linux.cpp similarity index 58% rename from hotspot/src/os/linux/vm/objectMonitor_linux.cpp rename to hotspot/src/os/linux/vm/decoder_linux.cpp index 4e7878d22fe..88da33b65b3 100644 --- a/hotspot/src/os/linux/vm/objectMonitor_linux.cpp +++ b/hotspot/src/os/linux/vm/decoder_linux.cpp @@ -1,6 +1,5 @@ - /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,3 +21,25 @@ * questions. * */ + +#include "prims/jvm.h" +#include "utilities/decoder.hpp" + +#include + +bool Decoder::demangle(const char* symbol, char *buf, int buflen) { + int status; + char* result; + size_t size = (size_t)buflen; + + // Don't pass buf to __cxa_demangle. In case of the 'buf' is too small, + // __cxa_demangle will call system "realloc" for additional memory, which + // may use different malloc/realloc mechanism that allocates 'buf'. + if ((result = abi::__cxa_demangle(symbol, NULL, NULL, &status)) != NULL) { + jio_snprintf(buf, buflen, "%s", result); + // call c library's free + ::free(result); + return true; + } + return false; +} diff --git a/hotspot/src/os/linux/vm/dtraceJSDT_linux.cpp b/hotspot/src/os/linux/vm/dtraceJSDT_linux.cpp index a7be2486e13..0f340fb5730 100644 --- a/hotspot/src/os/linux/vm/dtraceJSDT_linux.cpp +++ b/hotspot/src/os/linux/vm/dtraceJSDT_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_dtraceJSDT_linux.cpp.incl" +#include "precompiled.hpp" +#include "classfile/javaClasses.hpp" +#include "code/codeBlob.hpp" +#include "memory/allocation.hpp" +#include "prims/jvm.h" +#include "runtime/dtraceJSDT.hpp" +#include "runtime/jniHandles.hpp" +#include "runtime/os.hpp" +#include "runtime/signature.hpp" +#include "utilities/globalDefinitions.hpp" int DTraceJSDT::pd_activate( void* baseAddress, jstring module, diff --git a/hotspot/src/os/linux/vm/globals_linux.hpp b/hotspot/src/os/linux/vm/globals_linux.hpp index 75b31373703..cd74589e40c 100644 --- a/hotspot/src/os/linux/vm/globals_linux.hpp +++ b/hotspot/src/os/linux/vm/globals_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_LINUX_VM_GLOBALS_LINUX_HPP +#define OS_LINUX_VM_GLOBALS_LINUX_HPP + // // Defines Linux specific flags. They are not available on other platforms. // @@ -42,3 +45,5 @@ define_pd_global(bool, UseLargePages, false); define_pd_global(bool, UseLargePagesIndividualAllocation, false); define_pd_global(bool, UseOSErrorReporting, false); define_pd_global(bool, UseThreadPriorities, true) ; + +#endif // OS_LINUX_VM_GLOBALS_LINUX_HPP diff --git a/hotspot/src/os/linux/vm/hpi_linux.cpp b/hotspot/src/os/linux/vm/hpi_linux.cpp deleted file mode 100644 index 04bec5d2db0..00000000000 --- a/hotspot/src/os/linux/vm/hpi_linux.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -# include "incls/_precompiled.incl" -# include "incls/_hpi_linux.cpp.incl" - -# include -# include - -typedef jint (JNICALL *init_t)(GetInterfaceFunc *, void *); - -void hpi::initialize_get_interface(vm_calls_t *callbacks) { - char buf[JVM_MAXPATHLEN]; - void *hpi_handle; - GetInterfaceFunc& getintf = _get_interface; - jint (JNICALL * DLL_Initialize)(GetInterfaceFunc *, void *); - - if (HPILibPath && HPILibPath[0]) { - strncpy(buf, HPILibPath, JVM_MAXPATHLEN - 1); - buf[JVM_MAXPATHLEN - 1] = '\0'; - } else { - const char *thread_type = "native_threads"; - - os::jvm_path(buf, JVM_MAXPATHLEN); - -#ifdef PRODUCT - const char * hpi_lib = "/libhpi.so"; -#else - char * ptr = strrchr(buf, '/'); - assert(strstr(ptr, "/libjvm") == ptr, "invalid library name"); - const char * hpi_lib = strstr(ptr, "_g") ? "/libhpi_g.so" : "/libhpi.so"; -#endif - - *(strrchr(buf, '/')) = '\0'; /* get rid of /libjvm.so */ - char* p = strrchr(buf, '/'); - if (p != NULL) p[1] = '\0'; /* get rid of hotspot */ - strcat(buf, thread_type); - strcat(buf, hpi_lib); - } - - if (TraceHPI) tty->print_cr("Loading HPI %s ", buf); -#ifdef SPARC - // On 64-bit Ubuntu Sparc RTLD_NOW leads to unresolved deps in libpthread.so -# define OPEN_MODE RTLD_LAZY -#else - // We use RTLD_NOW because of bug 4032715 -# define OPEN_MODE RTLD_NOW -#endif - hpi_handle = dlopen(buf, OPEN_MODE); -#undef OPEN_MODE - - if (hpi_handle == NULL) { - if (TraceHPI) tty->print_cr("HPI dlopen failed: %s", dlerror()); - return; - } - DLL_Initialize = CAST_TO_FN_PTR(jint (JNICALL *)(GetInterfaceFunc *, void *), - dlsym(hpi_handle, "DLL_Initialize")); - if (TraceHPI && DLL_Initialize == NULL) tty->print_cr("HPI dlsym of DLL_Initialize failed: %s", dlerror()); - if (DLL_Initialize == NULL || - (*DLL_Initialize)(&getintf, callbacks) < 0) { - if (TraceHPI) tty->print_cr("HPI DLL_Initialize failed"); - return; - } - if (TraceHPI) tty->print_cr("HPI loaded successfully"); -} diff --git a/hotspot/src/os/linux/vm/hpi_linux.hpp b/hotspot/src/os/linux/vm/hpi_linux.hpp deleted file mode 100644 index 5e0daf8e722..00000000000 --- a/hotspot/src/os/linux/vm/hpi_linux.hpp +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -// -// Because the interruptible IO has been dropped for HotSpot/Linux, -// the following HPI interface is very different from HotSparc. -// - -#include -#include -#include -#include -#include - -// HPI_FileInterface - -inline int hpi::close(int fd) { - return ::close(fd); -} - -inline size_t hpi::read(int fd, void *buf, unsigned int nBytes) { - size_t res; - RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res); - return res; -} - -inline size_t hpi::write(int fd, const void *buf, unsigned int nBytes) { - size_t res; - RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res); - return res; -} - - -// HPI_SocketInterface - -inline int hpi::socket_close(int fd) { - return ::close(fd); -} - -inline int hpi::socket(int domain, int type, int protocol) { - return ::socket(domain, type, protocol); -} - -inline int hpi::recv(int fd, char *buf, int nBytes, int flags) { - RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, (unsigned int) flags)); -} - -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; - - gettimeofday(&t, NULL); - prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000; - - for(;;) { - struct pollfd pfd; - - pfd.fd = fd; - pfd.events = POLLIN | POLLERR; - - int res = ::poll(&pfd, 1, timeout); - - if (res == OS_ERR && errno == EINTR) { - - // On Linux any value < 0 means "forever" - - if(timeout >= 0) { - gettimeofday(&t, NULL); - newtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000; - timeout -= newtime - prevtime; - if(timeout <= 0) - return OS_OK; - prevtime = newtime; - } - } else - return res; - } -} - -inline int hpi::listen(int fd, int count) { - return ::listen(fd, count); -} - -inline int hpi::connect(int fd, struct sockaddr *him, int len) { - RESTARTABLE_RETURN_INT(::connect(fd, him, len)); -} - -inline int hpi::accept(int fd, struct sockaddr *him, int *len) { - // This cast is from int to unsigned int on linux. Since we - // only pass the parameter "len" around the vm and don't try to - // fetch it's value, this cast is safe for now. The java.net group - // may need and want to change this interface someday if socklen_t goes - // to 64 bits on some platform that we support. - // Linux doc says this can't return EINTR, unlike accept() on Solaris - - return ::accept(fd, him, (socklen_t *)len); -} - -inline int hpi::recvfrom(int fd, char *buf, int nBytes, int flags, - sockaddr *from, int *fromlen) { - RESTARTABLE_RETURN_INT(::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen)); -} - -inline int hpi::sendto(int fd, char *buf, int len, int flags, - struct sockaddr *to, int tolen) { - RESTARTABLE_RETURN_INT(::sendto(fd, buf, len, (unsigned int) flags, to, tolen)); -} - -inline int hpi::socket_available(int fd, jint *pbytes) { - // Linux doc says EINTR not returned, unlike Solaris - int ret = ::ioctl(fd, FIONREAD, pbytes); - - //%% note ioctl can return 0 when successful, JVM_SocketAvailable - // is expected to return 0 on failure and 1 on success to the jdk. - return (ret < 0) ? 0 : 1; -} - - -// following methods have been updated to avoid problems in -// hpi's sockets calls based on sys_api_td.c (JDK1.3) - -/* -HPIDECL(socket_shutdown, "socket_shutdown", _socket, SocketShutdown, - int, "%d", - (int fd, int howto), - ("fd = %d, howto = %d", fd, howto), - (fd, howto)); - */ -inline int hpi::socket_shutdown(int fd, int howto){ - return ::shutdown(fd, howto); -} - -/* -HPIDECL(bind, "bind", _socket, Bind, - int, "%d", - (int fd, struct sockaddr *him, int len), - ("fd = %d, him = %p, len = %d", - fd, him, len), - (fd, him, len)); -*/ -inline int hpi::bind(int fd, struct sockaddr *him, int len){ - return ::bind(fd, him, len); -} - -/* -HPIDECL(get_sock_name, "get_sock_name", _socket, GetSocketName, - int, "%d", - (int fd, struct sockaddr *him, int *len), - ("fd = %d, him = %p, len = %p", - fd, him, len), - (fd, him, len)); - */ -inline int hpi::get_sock_name(int fd, struct sockaddr *him, int *len){ - return ::getsockname(fd, him, (socklen_t *)len); -} - -/* -HPIDECL(get_host_name, "get_host_name", _socket, GetHostName, int, "%d", - (char *hostname, int namelen), - ("hostname = %p, namelen = %d", - hostname, namelen), - (hostname, namelen)); - */ -inline int hpi::get_host_name(char* name, int namelen){ - return ::gethostname(name, namelen); -} - -/* -HPIDECL(get_sock_opt, "get_sock_opt", _socket, SocketGetOption, int, "%d", - (int fd, int level, int optname, char *optval, int* optlen), - ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %p", - fd, level, optname, optval, optlen), - (fd, level, optname, optval, optlen)); - */ -inline int hpi::get_sock_opt(int fd, int level, int optname, - char *optval, int* optlen){ - return ::getsockopt(fd, level, optname, optval, (socklen_t *)optlen); -} - -/* -HPIDECL(set_sock_opt, "set_sock_opt", _socket, SocketSetOption, int, "%d", - (int fd, int level, int optname, const char *optval, int optlen), - ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %d", - fd, level, optname, optval, optlen), - (fd, level, optname, optval, optlen)); - */ -inline int hpi::set_sock_opt(int fd, int level, int optname, - const char *optval, int optlen){ - return ::setsockopt(fd, level, optname, optval, optlen); -} - - -// Reconciliation History -// hpi_solaris.hpp 1.9 99/08/30 16:31:23 -// End diff --git a/hotspot/src/os/linux/vm/interfaceSupport_linux.hpp b/hotspot/src/os/linux/vm/interfaceSupport_linux.hpp index acc096be80f..5ea58c3b945 100644 --- a/hotspot/src/os/linux/vm/interfaceSupport_linux.hpp +++ b/hotspot/src/os/linux/vm/interfaceSupport_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ +#ifndef OS_LINUX_VM_INTERFACESUPPORT_LINUX_HPP +#define OS_LINUX_VM_INTERFACESUPPORT_LINUX_HPP + // Contains inlined functions for class InterfaceSupport static inline void serialize_memory(JavaThread *thread) { os::write_memory_serialize_page(thread); } + +#endif // OS_LINUX_VM_INTERFACESUPPORT_LINUX_HPP diff --git a/hotspot/src/os/linux/vm/jsig.c b/hotspot/src/os/linux/vm/jsig.c index 638b5e70ec5..13ddb668341 100644 --- a/hotspot/src/os/linux/vm/jsig.c +++ b/hotspot/src/os/linux/vm/jsig.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/jvm_linux.cpp b/hotspot/src/os/linux/vm/jvm_linux.cpp index 0d1615eb1f2..ea5bf2d36c7 100644 --- a/hotspot/src/os/linux/vm/jvm_linux.cpp +++ b/hotspot/src/os/linux/vm/jvm_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_jvm_linux.cpp.incl" +#include "precompiled.hpp" +#include "prims/jvm.h" +#include "runtime/interfaceSupport.hpp" +#include "runtime/osThread.hpp" #include diff --git a/hotspot/src/os/linux/vm/jvm_linux.h b/hotspot/src/os/linux/vm/jvm_linux.h index 63ef30353c6..795fec11337 100644 --- a/hotspot/src/os/linux/vm/jvm_linux.h +++ b/hotspot/src/os/linux/vm/jvm_linux.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_LINUX_VM_JVM_LINUX_H +#define OS_LINUX_VM_JVM_LINUX_H + /* // HotSpot integration note: // @@ -95,3 +98,5 @@ // Reconciliation History // jvm_solaris.h 1.6 99/06/22 16:38:47 // End + +#endif // OS_LINUX_VM_JVM_LINUX_H diff --git a/hotspot/src/os/linux/vm/mutex_linux.cpp b/hotspot/src/os/linux/vm/mutex_linux.cpp index 3cc4bbd4239..864aca7e86a 100644 --- a/hotspot/src/os/linux/vm/mutex_linux.cpp +++ b/hotspot/src/os/linux/vm/mutex_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_mutex_linux.cpp.incl" +#include "precompiled.hpp" +#include "mutex_linux.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/mutex.hpp" +#include "thread_linux.inline.hpp" +#include "utilities/events.hpp" // put OS-includes here # include diff --git a/hotspot/src/os/linux/vm/mutex_linux.inline.hpp b/hotspot/src/os/linux/vm/mutex_linux.inline.hpp index 87c6a3701ec..cde6dfe428b 100644 --- a/hotspot/src/os/linux/vm/mutex_linux.inline.hpp +++ b/hotspot/src/os/linux/vm/mutex_linux.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,16 @@ * */ +#ifndef OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP +#define OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP + +#include "os_linux.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "thread_linux.inline.hpp" + // Reconciliation History // mutex_solaris.inline.hpp 1.5 99/06/22 16:38:49 // End + +#endif // OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP diff --git a/hotspot/src/os/linux/vm/objectMonitor_linux.inline.hpp b/hotspot/src/os/linux/vm/objectMonitor_linux.inline.hpp deleted file mode 100644 index 2e84f688281..00000000000 --- a/hotspot/src/os/linux/vm/objectMonitor_linux.inline.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ diff --git a/hotspot/src/os/linux/vm/osThread_linux.cpp b/hotspot/src/os/linux/vm/osThread_linux.cpp index 6a387225e29..f4ec9f78faa 100644 --- a/hotspot/src/os/linux/vm/osThread_linux.cpp +++ b/hotspot/src/os/linux/vm/osThread_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,23 @@ * */ -// do not include precompiled header file -# include "incls/_osThread_linux.cpp.incl" +// no precompiled headers +#include "runtime/atomic.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/os.hpp" +#include "runtime/osThread.hpp" +#include "runtime/safepoint.hpp" +#include "runtime/vmThread.hpp" +#ifdef TARGET_ARCH_x86 +# include "assembler_x86.inline.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "assembler_sparc.inline.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "assembler_zero.inline.hpp" +#endif void OSThread::pd_initialize() { diff --git a/hotspot/src/os/linux/vm/osThread_linux.hpp b/hotspot/src/os/linux/vm/osThread_linux.hpp index 389e4a8722c..22945135b78 100644 --- a/hotspot/src/os/linux/vm/osThread_linux.hpp +++ b/hotspot/src/os/linux/vm/osThread_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_LINUX_VM_OSTHREAD_LINUX_HPP +#define OS_LINUX_VM_OSTHREAD_LINUX_HPP + private: int _thread_type; @@ -139,3 +142,5 @@ private: // Reconciliation History // osThread_solaris.hpp 1.24 99/08/27 13:11:54 // End + +#endif // OS_LINUX_VM_OSTHREAD_LINUX_HPP diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index e3e117eb5fb..330e347a7e5 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +24,64 @@ # define __STDC_FORMAT_MACROS -// do not include precompiled header file -# include "incls/_os_linux.cpp.incl" +// no precompiled headers +#include "classfile/classLoader.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "compiler/compileBroker.hpp" +#include "interpreter/interpreter.hpp" +#include "jvm_linux.h" +#include "memory/allocation.inline.hpp" +#include "memory/filemap.hpp" +#include "mutex_linux.inline.hpp" +#include "oops/oop.inline.hpp" +#include "os_share_linux.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm.h" +#include "prims/jvm_misc.hpp" +#include "runtime/arguments.hpp" +#include "runtime/extendedPC.hpp" +#include "runtime/globals.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/objectMonitor.hpp" +#include "runtime/osThread.hpp" +#include "runtime/perfMemory.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/statSampler.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/threadCritical.hpp" +#include "runtime/timer.hpp" +#include "services/attachListener.hpp" +#include "services/runtimeService.hpp" +#include "thread_linux.inline.hpp" +#include "utilities/decoder.hpp" +#include "utilities/defaultStream.hpp" +#include "utilities/events.hpp" +#include "utilities/growableArray.hpp" +#include "utilities/vmError.hpp" +#ifdef TARGET_ARCH_x86 +# include "assembler_x86.inline.hpp" +# include "nativeInst_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "assembler_sparc.inline.hpp" +# include "nativeInst_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "assembler_zero.inline.hpp" +# include "nativeInst_zero.hpp" +#endif +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif // put OS-includes here # include @@ -59,6 +115,7 @@ # include # include # include +# include #define MAX_PATH (2 * K) @@ -827,8 +884,10 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) { switch (thr_type) { case os::java_thread: - // Java threads use ThreadStackSize which default value can be changed with the flag -Xss - if (JavaThread::stack_size_at_create() > 0) stack_size = JavaThread::stack_size_at_create(); + // Java threads use ThreadStackSize which default value can be + // changed with the flag -Xss + assert (JavaThread::stack_size_at_create() > 0, "this should be set"); + stack_size = JavaThread::stack_size_at_create(); break; case os::compiler_thread: if (CompilerThreadStackSize > 0) { @@ -1507,6 +1566,24 @@ void os::die() { // unused on linux for now. void os::set_error_file(const char *logfile) {} + +// This method is a copy of JDK's sysGetLastErrorString +// from src/solaris/hpi/src/system_md.c + +size_t os::lasterror(char *buf, size_t len) { + + if (errno == 0) return 0; + + const char *s = ::strerror(errno); + size_t n = ::strlen(s); + if (n >= len) { + n = len - 1; + } + ::strncpy(buf, s, n); + buf[n] = '\0'; + return n; +} + intx os::current_thread_id() { return (intx)pthread_self(); } int os::current_process_id() { @@ -1613,14 +1690,23 @@ bool os::dll_address_to_function_name(address addr, char *buf, Dl_info dlinfo; if (dladdr((void*)addr, &dlinfo) && dlinfo.dli_sname != NULL) { - if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname); - if (offset) *offset = addr - (address)dlinfo.dli_saddr; + if (buf != NULL) { + if(!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) { + jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname); + } + } + if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr; return true; - } else { - if (buf) buf[0] = '\0'; - if (offset) *offset = -1; - return false; + } else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) { + if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase), + dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) { + return true; + } } + + if (buf != NULL) buf[0] = '\0'; + if (offset != NULL) *offset = -1; + return false; } struct _address_to_library_name { @@ -1871,19 +1957,19 @@ void* os::dll_lookup(void* handle, const char* name) { } -bool _print_ascii_file(const char* filename, outputStream* st) { - int fd = open(filename, O_RDONLY); +static bool _print_ascii_file(const char* filename, outputStream* st) { + int fd = ::open(filename, O_RDONLY); if (fd == -1) { return false; } char buf[32]; int bytes; - while ((bytes = read(fd, buf, sizeof(buf))) > 0) { + while ((bytes = ::read(fd, buf, sizeof(buf))) > 0) { st->print_raw(buf, bytes); } - close(fd); + ::close(fd); return true; } @@ -2161,8 +2247,6 @@ void os::jvm_path(char *buf, jint buflen) { // Use current module name "libjvm[_g].so" instead of // "libjvm"debug_only("_g")".so" since for fastdebug version // we should have "libjvm.so" but debug_only("_g") adds "_g"! - // It is used when we are choosing the HPI library's name - // "libhpi[_g].so" in hpi::initialize_get_interface(). len = strlen(buf); snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p); } else { @@ -2346,18 +2430,18 @@ void linux_wrap_code(char* base, size_t size) { os::get_temp_directory(), os::current_process_id(), num); unlink(buf); - int fd = open(buf, O_CREAT | O_RDWR, S_IRWXU); + int fd = ::open(buf, O_CREAT | O_RDWR, S_IRWXU); if (fd != -1) { - off_t rv = lseek(fd, size-2, SEEK_SET); + off_t rv = ::lseek(fd, size-2, SEEK_SET); if (rv != (off_t)-1) { - if (write(fd, "", 1) == 1) { + if (::write(fd, "", 1) == 1) { mmap(base, size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE, fd, 0); } } - close(fd); + ::close(fd); unlink(buf); } } @@ -3922,12 +4006,21 @@ jint os::init_2(void) Linux::signal_sets_init(); Linux::install_signal_handlers(); + // Check minimum allowable stack size for thread creation and to initialize + // the java system classes, including StackOverflowError - depends on page + // size. Add a page for compiler2 recursion in main thread. + // Add in 2*BytesPerWord times page size to account for VM stack during + // class initialization depending on 32 or 64 bit VM. + os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed, + (size_t)(StackYellowPages+StackRedPages+StackShadowPages+ + 2*BytesPerWord COMPILER2_PRESENT(+1)) * Linux::page_size()); + size_t threadStackSizeInBytes = ThreadStackSize * K; if (threadStackSizeInBytes != 0 && - threadStackSizeInBytes < Linux::min_stack_allowed) { + threadStackSizeInBytes < os::Linux::min_stack_allowed) { tty->print_cr("\nThe stack size specified is too small, " "Specify at least %dk", - Linux::min_stack_allowed / K); + os::Linux::min_stack_allowed/ K); return JNI_ERR; } @@ -3980,13 +4073,6 @@ jint os::init_2(void) // Initialize lock used to serialize thread creation (see os::create_thread) Linux::set_createThread_lock(new Mutex(Mutex::leaf, "createThread_lock", false)); - // Initialize HPI. - jint hpi_result = hpi::initialize(); - if (hpi_result != JNI_OK) { - tty->print_cr("There was an error trying to initialize the HPI library."); - return hpi_result; - } - // at-exit methods are called in the reverse order of their registration. // atexit functions are called on return from main or as a result of a // call to exit(3C). There can be only 32 of these functions registered @@ -4184,7 +4270,7 @@ int os::stat(const char *path, struct stat *sbuf) { errno = ENAMETOOLONG; return -1; } - hpi::native_path(strcpy(pathbuf, path)); + os::native_path(strcpy(pathbuf, path)); return ::stat(pathbuf, sbuf); } @@ -4216,6 +4302,85 @@ bool os::dir_is_empty(const char* path) { return result; } +// This code originates from JDK's sysOpen and open64_w +// from src/solaris/hpi/src/system_md.c + +#ifndef O_DELETE +#define O_DELETE 0x10000 +#endif + +// Open a file. Unlink the file immediately after open returns +// if the specified oflag has the O_DELETE flag set. +// O_DELETE is used only in j2se/src/share/native/java/util/zip/ZipFile.c + +int os::open(const char *path, int oflag, int mode) { + + if (strlen(path) > MAX_PATH - 1) { + errno = ENAMETOOLONG; + return -1; + } + int fd; + int o_delete = (oflag & O_DELETE); + oflag = oflag & ~O_DELETE; + + fd = ::open64(path, oflag, mode); + if (fd == -1) return -1; + + //If the open succeeded, the file might still be a directory + { + struct stat64 buf64; + int ret = ::fstat64(fd, &buf64); + int st_mode = buf64.st_mode; + + if (ret != -1) { + if ((st_mode & S_IFMT) == S_IFDIR) { + errno = EISDIR; + ::close(fd); + return -1; + } + } else { + ::close(fd); + return -1; + } + } + + /* + * All file descriptors that are opened in the JVM and not + * specifically destined for a subprocess should have the + * close-on-exec flag set. If we don't set it, then careless 3rd + * party native code might fork and exec without closing all + * appropriate file descriptors (e.g. as we do in closeDescriptors in + * UNIXProcess.c), and this in turn might: + * + * - cause end-of-file to fail to be detected on some file + * descriptors, resulting in mysterious hangs, or + * + * - might cause an fopen in the subprocess to fail on a system + * suffering from bug 1085341. + * + * (Yes, the default setting of the close-on-exec flag is a Unix + * design flaw) + * + * See: + * 1085341: 32-bit stdio routines should support file descriptors >255 + * 4843136: (process) pipe file descriptor from Runtime.exec not being closed + * 6339493: (process) Runtime.exec does not close all file descriptors on Solaris 9 + */ +#ifdef FD_CLOEXEC + { + int flags = ::fcntl(fd, F_GETFD); + if (flags != -1) + ::fcntl(fd, F_SETFD, flags | FD_CLOEXEC); + } +#endif + + if (o_delete != 0) { + ::unlink(path); + } + return fd; +} + + // create binary file, rewriting existing file if required int os::create_binary_file(const char* path, bool rewrite_existing) { int oflags = O_WRONLY | O_CREAT; @@ -4235,6 +4400,49 @@ jlong os::seek_to_file_offset(int fd, jlong offset) { return (jlong)::lseek64(fd, (off64_t)offset, SEEK_SET); } +// This code originates from JDK's sysAvailable +// from src/solaris/hpi/src/native_threads/src/sys_api_td.c + +int os::available(int fd, jlong *bytes) { + jlong cur, end; + int mode; + struct stat64 buf64; + + if (::fstat64(fd, &buf64) >= 0) { + mode = buf64.st_mode; + if (S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) { + /* + * XXX: is the following call interruptible? If so, this might + * need to go through the INTERRUPT_IO() wrapper as for other + * blocking, interruptible calls in this file. + */ + int n; + if (::ioctl(fd, FIONREAD, &n) >= 0) { + *bytes = n; + return 1; + } + } + } + if ((cur = ::lseek64(fd, 0L, SEEK_CUR)) == -1) { + return 0; + } else if ((end = ::lseek64(fd, 0L, SEEK_END)) == -1) { + return 0; + } else if (::lseek64(fd, cur, SEEK_SET) == -1) { + return 0; + } + *bytes = end - cur; + return 1; +} + +int os::socket_available(int fd, jint *pbytes) { + // Linux doc says EINTR not returned, unlike Solaris + int ret = ::ioctl(fd, FIONREAD, pbytes); + + //%% note ioctl can return 0 when successful, JVM_SocketAvailable + // is expected to return 0 on failure and 1 on success to the jdk. + return (ret < 0) ? 0 : 1; +} + // Map a block of memory. char* os::map_memory(int fd, const char* file_name, size_t file_offset, char *addr, size_t bytes, bool read_only, @@ -4461,7 +4669,7 @@ void os::pause() { int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (fd != -1) { struct stat buf; - close(fd); + ::close(fd); while (::stat(filename, &buf) == 0) { (void)::poll(NULL, 0, 100); } @@ -4839,7 +5047,7 @@ void Parker::park(bool isAbsolute, jlong time) { // Next, demultiplex/decode time arguments timespec absTime; - if (time < 0) { // don't wait at all + if (time < 0 || (isAbsolute && time == 0) ) { // don't wait at all return; } if (time > 0) { diff --git a/hotspot/src/os/linux/vm/os_linux.hpp b/hotspot/src/os/linux/vm/os_linux.hpp index 15b2c1efc69..18803ac3496 100644 --- a/hotspot/src/os/linux/vm/os_linux.hpp +++ b/hotspot/src/os/linux/vm/os_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_LINUX_VM_OS_LINUX_HPP +#define OS_LINUX_VM_OS_LINUX_HPP + // Linux_OS defines the interface to Linux operating systems /* pthread_getattr_np comes with LinuxThreads-0.9-7 on RedHat 7.1 */ @@ -328,3 +331,5 @@ class PlatformParker : public CHeapObj { assert_status(status == 0, status, "mutex_init"); } } ; + +#endif // OS_LINUX_VM_OS_LINUX_HPP diff --git a/hotspot/src/os/linux/vm/os_linux.inline.hpp b/hotspot/src/os/linux/vm/os_linux.inline.hpp index 035465da8c7..9af7e789764 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 (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,31 @@ * */ +#ifndef OS_LINUX_VM_OS_LINUX_INLINE_HPP +#define OS_LINUX_VM_OS_LINUX_INLINE_HPP + +#include "runtime/atomic.hpp" +#include "runtime/os.hpp" +#ifdef TARGET_OS_ARCH_linux_x86 +# include "atomic_linux_x86.inline.hpp" +# include "orderAccess_linux_x86.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_sparc +# include "atomic_linux_sparc.inline.hpp" +# include "orderAccess_linux_sparc.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_zero +# include "atomic_linux_zero.inline.hpp" +# include "orderAccess_linux_zero.inline.hpp" +#endif + +// System includes + +#include +#include +#include +#include + inline void* os::thread_local_storage_at(int index) { return pthread_getspecific((pthread_key_t)index); } @@ -75,6 +100,12 @@ inline void os::split_reserved_memory(char *base, size_t size, inline void os::bang_stack_shadow_pages() { } +inline void os::dll_unload(void *lib) { + ::dlclose(lib); +} + +inline const int os::default_file_open_flags() { return 0;} + inline DIR* os::opendir(const char* dirname) { assert(dirname != NULL, "just checking"); @@ -86,6 +117,22 @@ inline int os::readdir_buf_size(const char *path) return NAME_MAX + sizeof(dirent) + 1; } +inline jlong os::lseek(int fd, jlong offset, int whence) { + return (jlong) ::lseek64(fd, offset, whence); +} + +inline int os::fsync(int fd) { + return ::fsync(fd); +} + +inline char* os::native_path(char *path) { + return path; +} + +inline int os::ftruncate(int fd, jlong length) { + return ::ftruncate64(fd, length); +} + inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) { dirent* p; @@ -103,9 +150,8 @@ inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) return p; } -inline int os::closedir(DIR *dirp) -{ - assert(dirp != NULL, "just checking"); +inline int os::closedir(DIR *dirp) { + assert(dirp != NULL, "argument is NULL"); return ::closedir(dirp); } @@ -123,3 +169,130 @@ inline int os::closedir(DIR *dirp) inline bool os::numa_has_static_binding() { return true; } inline bool os::numa_has_group_homing() { return false; } + +inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) { + size_t res; + RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res); + return res; +} + +inline size_t os::write(int fd, const void *buf, unsigned int nBytes) { + size_t res; + RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res); + return res; +} + +inline int os::close(int fd) { + return ::close(fd); +} + +inline int os::socket_close(int fd) { + return ::close(fd); +} + +inline int os::socket(int domain, int type, int protocol) { + return ::socket(domain, type, protocol); +} + +inline int os::recv(int fd, char *buf, int nBytes, int flags) { + RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, (unsigned int) flags)); +} + +inline int os::send(int fd, char *buf, int nBytes, int flags) { + RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, (unsigned int) flags)); +} + +inline int os::raw_send(int fd, char *buf, int nBytes, int flags) { + return os::send(fd, buf, nBytes, flags); +} + +inline int os::timeout(int fd, long timeout) { + julong prevtime,newtime; + struct timeval t; + + gettimeofday(&t, NULL); + prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000; + + for(;;) { + struct pollfd pfd; + + pfd.fd = fd; + pfd.events = POLLIN | POLLERR; + + int res = ::poll(&pfd, 1, timeout); + + if (res == OS_ERR && errno == EINTR) { + + // On Linux any value < 0 means "forever" + + if(timeout >= 0) { + gettimeofday(&t, NULL); + newtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000; + timeout -= newtime - prevtime; + if(timeout <= 0) + return OS_OK; + prevtime = newtime; + } + } else + return res; + } +} + +inline int os::listen(int fd, int count) { + return ::listen(fd, count); +} + +inline int os::connect(int fd, struct sockaddr *him, int len) { + RESTARTABLE_RETURN_INT(::connect(fd, him, len)); +} + +inline int os::accept(int fd, struct sockaddr *him, int *len) { + // This cast is from int to unsigned int on linux. Since we + // only pass the parameter "len" around the vm and don't try to + // fetch it's value, this cast is safe for now. The java.net group + // may need and want to change this interface someday if socklen_t goes + // to 64 bits on some platform that we support. + // Linux doc says this can't return EINTR, unlike accept() on Solaris + + return ::accept(fd, him, (socklen_t *)len); +} + +inline int os::recvfrom(int fd, char *buf, int nBytes, int flags, + sockaddr *from, int *fromlen) { + RESTARTABLE_RETURN_INT(::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen)); +} + +inline int os::sendto(int fd, char *buf, int len, int flags, + struct sockaddr *to, int tolen) { + RESTARTABLE_RETURN_INT(::sendto(fd, buf, len, (unsigned int) flags, to, tolen)); +} + +inline int os::socket_shutdown(int fd, int howto){ + return ::shutdown(fd, howto); +} + +inline int os::bind(int fd, struct sockaddr *him, int len){ + return ::bind(fd, him, len); +} + +inline int os::get_sock_name(int fd, struct sockaddr *him, int *len){ + return ::getsockname(fd, him, (socklen_t *)len); +} + +inline int os::get_host_name(char* name, int namelen){ + return ::gethostname(name, namelen); +} + +inline struct hostent* os::get_host_by_name(char* name) { + return ::gethostbyname(name); +} +inline int os::get_sock_opt(int fd, int level, int optname, + char *optval, int* optlen){ + return ::getsockopt(fd, level, optname, optval, (socklen_t *)optlen); +} + +inline int os::set_sock_opt(int fd, int level, int optname, + const char *optval, int optlen){ + return ::setsockopt(fd, level, optname, optval, optlen); +} +#endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP diff --git a/hotspot/src/os/linux/vm/os_share_linux.hpp b/hotspot/src/os/linux/vm/os_share_linux.hpp index 5b9d5321c02..7cc2635980a 100644 --- a/hotspot/src/os/linux/vm/os_share_linux.hpp +++ b/hotspot/src/os/linux/vm/os_share_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_LINUX_VM_OS_SHARE_LINUX_HPP +#define OS_LINUX_VM_OS_SHARE_LINUX_HPP + // misc void signalHandler(int, siginfo_t*, ucontext_t*); void handle_unexpected_exception(Thread* thread, int sig, siginfo_t* info, address pc, address adjusted_pc); @@ -30,3 +33,5 @@ void continue_with_dump(void); #endif #define PROCFILE_LENGTH 128 + +#endif // OS_LINUX_VM_OS_SHARE_LINUX_HPP diff --git a/hotspot/src/os/linux/vm/perfMemory_linux.cpp b/hotspot/src/os/linux/vm/perfMemory_linux.cpp index da5e0d643b7..1cd430cfbc7 100644 --- a/hotspot/src/os/linux/vm/perfMemory_linux.cpp +++ b/hotspot/src/os/linux/vm/perfMemory_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,15 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_perfMemory_linux.cpp.incl" +#include "precompiled.hpp" +#include "classfile/vmSymbols.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" +#include "os_linux.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/perfMemory.hpp" +#include "utilities/exceptions.hpp" // put OS-includes here # include @@ -628,7 +635,29 @@ static int create_sharedmem_resources(const char* dirname, const char* filename, return -1; } - return fd; + // Verify that we have enough disk space for this file. + // We'll get random SIGBUS crashes on memory accesses if + // we don't. + + for (size_t seekpos = 0; seekpos < size; seekpos += os::vm_page_size()) { + int zero_int = 0; + result = (int)os::seek_to_file_offset(fd, (jlong)(seekpos)); + if (result == -1 ) break; + RESTARTABLE(::write(fd, &zero_int, 1), result); + if (result != 1) { + if (errno == ENOSPC) { + warning("Insufficient space for shared memory file:\n %s\nTry using the -Djava.io.tmpdir= option to select an alternate temp location.\n", filename); + } + break; + } + } + + if (result != -1) { + return fd; + } else { + RESTARTABLE(::close(fd), result); + return -1; + } } // open the shared memory file for the given user and vmid. returns diff --git a/hotspot/src/os/linux/vm/stubRoutines_linux.cpp b/hotspot/src/os/linux/vm/stubRoutines_linux.cpp index c705716dc56..3723a0f7dfa 100644 --- a/hotspot/src/os/linux/vm/stubRoutines_linux.cpp +++ b/hotspot/src/os/linux/vm/stubRoutines_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +22,7 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stubRoutines_linux.cpp.incl" +#include "precompiled.hpp" +#include "runtime/os.hpp" +#include "runtime/stubRoutines.hpp" + diff --git a/hotspot/src/os/linux/vm/threadCritical_linux.cpp b/hotspot/src/os/linux/vm/threadCritical_linux.cpp index 526352ce910..b1d9ab2aa44 100644 --- a/hotspot/src/os/linux/vm/threadCritical_linux.cpp +++ b/hotspot/src/os/linux/vm/threadCritical_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_threadCritical_linux.cpp.incl" +#include "precompiled.hpp" +#include "runtime/threadCritical.hpp" +#include "thread_linux.inline.hpp" // put OS-includes here # include diff --git a/hotspot/src/os/linux/vm/thread_linux.inline.hpp b/hotspot/src/os/linux/vm/thread_linux.inline.hpp index 5367a569e0d..f09ed2877ef 100644 --- a/hotspot/src/os/linux/vm/thread_linux.inline.hpp +++ b/hotspot/src/os/linux/vm/thread_linux.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,31 @@ * */ +#ifndef OS_LINUX_VM_THREAD_LINUX_INLINE_HPP +#define OS_LINUX_VM_THREAD_LINUX_INLINE_HPP + +#include "runtime/atomic.hpp" +#include "runtime/prefetch.hpp" +#include "runtime/thread.hpp" +#include "runtime/threadLocalStorage.hpp" +#ifdef TARGET_OS_ARCH_linux_x86 +# include "atomic_linux_x86.inline.hpp" +# include "orderAccess_linux_x86.inline.hpp" +# include "prefetch_linux_x86.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_sparc +# include "atomic_linux_sparc.inline.hpp" +# include "orderAccess_linux_sparc.inline.hpp" +# include "prefetch_linux_sparc.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_zero +# include "atomic_linux_zero.inline.hpp" +# include "orderAccess_linux_zero.inline.hpp" +# include "prefetch_linux_zero.inline.hpp" +#endif + // Contains inlined functions for class Thread and ThreadLocalStorage inline void ThreadLocalStorage::pd_invalidate_all() {} // nothing to do + +#endif // OS_LINUX_VM_THREAD_LINUX_INLINE_HPP diff --git a/hotspot/src/os/linux/vm/vmError_linux.cpp b/hotspot/src/os/linux/vm/vmError_linux.cpp index 8e73d288634..8ec6ca04c25 100644 --- a/hotspot/src/os/linux/vm/vmError_linux.cpp +++ b/hotspot/src/os/linux/vm/vmError_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_vmError_linux.cpp.incl" +#include "precompiled.hpp" +#include "runtime/arguments.hpp" +#include "runtime/os.hpp" +#include "runtime/thread.hpp" +#include "utilities/vmError.hpp" #include #include @@ -41,11 +44,11 @@ void VMError::show_message_box(char *buf, int buflen) { jio_snprintf(p, buflen - len, "\n\n" "Do you want to debug the problem?\n\n" - "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " INTX_FORMAT "\n" + "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " INTX_FORMAT " (" INTPTR_FORMAT ")\n" "Enter 'yes' to launch gdb automatically (PATH must include gdb)\n" "Otherwise, press RETURN to abort...", os::current_process_id(), os::current_process_id(), - os::current_thread_id()); + os::current_thread_id(), os::current_thread_id()); yes = os::message_box("Unexpected Error", buf); diff --git a/hotspot/src/os/linux/launcher/java_md.c b/hotspot/src/os/posix/launcher/java_md.c similarity index 88% rename from hotspot/src/os/linux/launcher/java_md.c rename to hotspot/src/os/posix/launcher/java_md.c index 3308ff62df3..3ee0f20a77d 100644 --- a/hotspot/src/os/linux/launcher/java_md.c +++ b/hotspot/src/os/posix/launcher/java_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ * */ -/* - * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK, - * search "GAMMA" for gamma specific changes. - */ #include "java.h" #include @@ -45,64 +41,42 @@ #include "version_comp.h" #endif +#ifdef __linux__ +#include +#else +#include +#endif + #define JVM_DLL "libjvm.so" #define JAVA_DLL "libjava.so" #ifndef GAMMA /* launcher.make defines ARCH */ - /* * If a processor / os combination has the ability to run binaries of * two data models and cohabitation of jre/jdk bits with both data * models is supported, then DUAL_MODE is defined. When DUAL_MODE is * defined, the architecture names for the narrow and wide version of - * the architecture are defined in BIG_ARCH and SMALL_ARCH. Currently + * the architecture are defined in LIBARCH64NAME and LIBARCH32NAME. Currently * only Solaris on sparc/sparcv9 and i586/amd64 is DUAL_MODE; linux * i586/amd64 could be defined as DUAL_MODE but that is not the * current policy. */ -#ifdef _LP64 - -# ifdef ia64 -# define ARCH "ia64" -# elif defined(amd64) -# define ARCH "amd64" -# elif defined(__sparc) -# define ARCH "sparcv9" -# else -# define ARCH "unknown" /* unknown 64-bit architecture */ -# endif - -#else /* 32-bit data model */ - -# ifdef i586 -# define ARCH "i386" -# elif defined(__sparc) -# define ARCH "sparc" -# elif defined(arm) -# define ARCH "arm" -# elif defined(PPC) -# define ARCH "ppc" -# endif - -#endif /* _LP64 */ +#ifndef LIBARCHNAME +# error "The macro LIBARCHNAME was not defined on the compile line" +#endif #ifdef __sun # define DUAL_MODE -# ifdef __sparc -# define BIG_ARCH "sparcv9" -# define SMALL_ARCH "sparc" -# else -# define BIG_ARCH "amd64" -# define SMALL_ARCH "i386" +# ifndef LIBARCH32NAME +# error "The macro LIBARCH32NAME was not defined on the compile line" +# endif +# ifndef LIBARCH64NAME +# error "The macro LIBARCH64NAME was not defined on the compile line" # endif # include # include # include -#else -# ifndef ARCH -# include -# endif #endif #endif /* ifndef GAMMA */ @@ -111,7 +85,6 @@ extern char **environ; #ifndef GAMMA - /* * A collection of useful strings. One should think of these as #define * entries, but actual strings can be more efficient (with many compilers). @@ -124,7 +97,7 @@ static const char *system_dir = "/usr/jdk"; static const char *user_dir = "/jdk"; #endif -#endif /* ifndef GAMMA */ +#endif /* ifndef GAMMA */ /* * Flowchart of launcher execs and options processing on unix @@ -196,23 +169,13 @@ static jboolean GetJVMPath(const char *jrepath, const char *jvmtype, char *jvmpath, jint jvmpathsize, char * arch); static jboolean GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative); +#ifndef GAMMA const char * GetArch() { - static char *arch = NULL; - static char buf[12]; - if (arch) { - return arch; - } - -#ifdef ARCH - strcpy(buf, ARCH); -#else - sysinfo(SI_ARCHITECTURE, buf, sizeof(buf)); -#endif - arch = buf; - return arch; + return LIBARCHNAME; } +#endif /* ifndef GAMMA */ void CreateExecutionEnvironment(int *_argcp, @@ -287,7 +250,7 @@ CreateExecutionEnvironment(int *_argcp, { /* open new scope to declare local variables */ int i; - newargv = (char **)MemAlloc((argc+1) * sizeof(*newargv)); + newargv = (char **)JLI_MemAlloc((argc+1) * sizeof(*newargv)); newargv[newargc++] = argv[0]; /* scan for data model arguments and remove from argument list; @@ -358,7 +321,7 @@ CreateExecutionEnvironment(int *_argcp, #ifdef DUAL_MODE if (running != wanted) { /* Find out where the JRE is that we will be using. */ - if (!GetJREPath(jrepath, so_jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), JNI_TRUE)) { + if (!GetJREPath(jrepath, so_jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), JNI_TRUE)) { goto EndDataModelSpeculate; } @@ -366,14 +329,14 @@ CreateExecutionEnvironment(int *_argcp, * Read in jvm.cfg for target data model and process vm * selection options. */ - if (ReadKnownVMs(jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), JNI_TRUE) < 1) { + if (ReadKnownVMs(jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), JNI_TRUE) < 1) { goto EndDataModelSpeculate; } jvmpath[0] = '\0'; jvmtype = CheckJvmType(_argcp, _argvp, JNI_TRUE); /* exec child can do error checking on the existence of the path */ jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, - ((wanted==64)?BIG_ARCH:SMALL_ARCH)); + ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME)); } EndDataModelSpeculate: /* give up and let other code report error message */ @@ -388,8 +351,8 @@ CreateExecutionEnvironment(int *_argcp, * We will set the LD_LIBRARY_PATH as follows: * * o $JVMPATH (directory portion only) - * o $JRE/lib/$ARCH - * o $JRE/../lib/$ARCH + * o $JRE/lib/$LIBARCHNAME + * o $JRE/../lib/$LIBARCHNAME * * followed by the user's previous effective LD_LIBRARY_PATH, if * any. @@ -483,8 +446,8 @@ CreateExecutionEnvironment(int *_argcp, /* runpath contains current effective LD_LIBRARY_PATH setting */ - jvmpath = strdup(jvmpath); - new_runpath = MemAlloc( ((runpath!=NULL)?strlen(runpath):0) + + jvmpath = JLI_StringDup(jvmpath); + new_runpath = JLI_MemAlloc( ((runpath!=NULL)?strlen(runpath):0) + 2*strlen(jrepath) + 2*strlen(arch) + strlen(jvmpath) + 52); newpath = new_runpath + strlen("LD_LIBRARY_PATH="); @@ -500,7 +463,7 @@ CreateExecutionEnvironment(int *_argcp, *lastslash = '\0'; - /* jvmpath, ((running != wanted)?((wanted==64)?"/"BIG_ARCH:"/.."):""), */ + /* jvmpath, ((running != wanted)?((wanted==64)?"/"LIBARCH64NAME:"/.."):""), */ sprintf(new_runpath, "LD_LIBRARY_PATH=" "%s:" @@ -508,8 +471,8 @@ CreateExecutionEnvironment(int *_argcp, "%s/../lib/%s", jvmpath, #ifdef DUAL_MODE - jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), - jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH) + jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), + jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME) #else jrepath, arch, jrepath, arch @@ -576,7 +539,7 @@ CreateExecutionEnvironment(int *_argcp, * executable must be updated accordingly; the executable name * and directory the executable resides in are separate. In the * case of 32 => 64, the new bits are assumed to reside in, e.g. - * "olddir/BIGARCH/execname"; in the case of 64 => 32, + * "olddir/LIBARCH64NAME/execname"; in the case of 64 => 32, * the bits are assumed to be in "olddir/../execname". For example, * * olddir/sparcv9/execname @@ -586,19 +549,21 @@ CreateExecutionEnvironment(int *_argcp, */ if (running != wanted) { - char *oldexec = strcpy(MemAlloc(strlen(execname) + 1), execname); + char *oldexec = strcpy(JLI_MemAlloc(strlen(execname) + 1), execname); char *olddir = oldexec; char *oldbase = strrchr(oldexec, '/'); - newexec = MemAlloc(strlen(execname) + 20); + newexec = JLI_MemAlloc(strlen(execname) + 20); *oldbase++ = 0; sprintf(newexec, "%s/%s/%s", olddir, - ((wanted==64) ? BIG_ARCH : ".."), oldbase); + ((wanted==64) ? LIBARCH64NAME : ".."), oldbase); argv[0] = newexec; } #endif + (void)fflush(stdout); + (void)fflush(stderr); execve(newexec, argv, newenvp); perror("execve()"); @@ -630,12 +595,14 @@ CreateExecutionEnvironment(int *_argcp, #else /* ifndef GAMMA */ - /* gamma launcher is simpler in that it doesn't handle VM flavors, data */ - /* model, LD_LIBRARY_PATH, etc. Assuming everything is set-up correctly */ - /* all we need to do here is to return correct path names. See also */ - /* GetJVMPath() and GetApplicationHome(). */ + /* + * gamma launcher is simpler in that it doesn't handle VM flavors, data + * model, LD_LIBRARY_PATH, etc. Assuming everything is set-up correctly + * all we need to do here is to return correct path names. See also + * GetJVMPath() and GetApplicationHome(). + */ - { char *arch = (char *)GetArch(); /* like sparc or sparcv9 */ + { char *arch = (char *) ARCH; /* like sparc or sparcv9 */ char *p; if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) { @@ -669,9 +636,11 @@ GetJVMPath(const char *jrepath, const char *jvmtype, sprintf(jvmpath, "%s/lib/%s/%s/" JVM_DLL, jrepath, arch, jvmtype); } #else - /* For gamma launcher, JVM is either built-in or in the same directory. */ - /* Either way we return "/libjvm.so" where is the */ - /* directory where gamma launcher is located. */ + /* + * For gamma launcher, JVM is either built-in or in the same directory. + * Either way we return "/libjvm.so" where is the + * directory where gamma launcher is located. + */ char *p; @@ -684,7 +653,7 @@ GetJVMPath(const char *jrepath, const char *jvmtype, /* this case shouldn't happen */ snprintf(jvmpath, jvmpathsize, "%s", JVM_DLL); } -#endif +#endif /* ifndef GAMMA */ if (_launcher_debug) printf("Does `%s' exist ... ", jvmpath); @@ -742,7 +711,7 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn) ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs; return JNI_TRUE; #else - Dl_info dlinfo; + Dl_info dlinfo; void *libjvm; if (_launcher_debug) { @@ -813,24 +782,7 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn) error: fprintf(stderr, "Error: failed %s, because %s\n", jvmpath, dlerror()); return JNI_FALSE; -#endif /* GAMMA */ -} - -/* - * Get the path to the file that has the usage message for -X options. - */ -void -GetXUsagePath(char *buf, jint bufsize) -{ - static const char Xusage_txt[] = "/Xusage.txt"; - Dl_info dlinfo; - - /* we use RTLD_NOW because of problems with ld.so.1 and green threads */ - dladdr(dlsym(dlopen(JVM_DLL, RTLD_NOW), "JNI_CreateJavaVM"), &dlinfo); - strncpy(buf, (char *)dlinfo.dli_fname, bufsize - sizeof(Xusage_txt)); - - buf[bufsize-1] = '\0'; - strcpy(strrchr(buf, '/'), Xusage_txt); +#endif /* ifndef GAMMA */ } /* @@ -860,13 +812,13 @@ GetApplicationHome(char *buf, jint bufsize) #ifdef GAMMA { - /* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */ - char* java_home_var = getenv("JAVA_HOME"); - if (java_home_var == NULL) { - printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n"); - return JNI_FALSE; - } - snprintf(buf, bufsize, "%s", java_home_var); + /* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */ + char* java_home_var = getenv("JAVA_HOME"); + if (java_home_var == NULL) { + printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n"); + return JNI_FALSE; + } + snprintf(buf, bufsize, "%s", java_home_var); } #else if (strrchr(buf, '/') == 0) { @@ -885,7 +837,7 @@ GetApplicationHome(char *buf, jint bufsize) return JNI_FALSE; } *(strrchr(buf, '/')) = '\0'; /* bin */ -#endif /* GAMMA */ +#endif /* ifndef GAMMA */ return JNI_TRUE; } @@ -915,7 +867,7 @@ Resolve(char *indir, char *cmd) if ((strlen(indir) + strlen(cmd) + 1) > PATH_MAX) return 0; sprintf(name, "%s%c%s", indir, FILE_SEPARATOR, cmd); if (!ProgramExists(name)) return 0; - real = MemAlloc(PATH_MAX + 2); + real = JLI_MemAlloc(PATH_MAX + 2); if (!realpath(name, real)) strcpy(real, name); return real; @@ -948,7 +900,7 @@ FindExecName(char *program) /* from search path? */ path = getenv("PATH"); if (!path || !*path) path = "."; - tmp_path = MemAlloc(strlen(path) + 2); + tmp_path = JLI_MemAlloc(strlen(path) + 2); strcpy(tmp_path, path); for (f=tmp_path; *f && result==0; ) { @@ -967,7 +919,7 @@ FindExecName(char *program) if (result != 0) break; } - free(tmp_path); + JLI_MemFree(tmp_path); return result; } @@ -1000,11 +952,11 @@ SetExecname(char **argv) { Dl_info dlinfo; if (dladdr((void*)&SetExecname, &dlinfo)) { - char *resolved = (char*)MemAlloc(PATH_MAX+1); + char *resolved = (char*)JLI_MemAlloc(PATH_MAX+1); if (resolved != NULL) { exec_path = realpath(dlinfo.dli_fname, resolved); if (exec_path == NULL) { - free(resolved); + JLI_MemFree(resolved); } } } @@ -1016,7 +968,7 @@ SetExecname(char **argv) int len = readlink(self, buf, PATH_MAX); if (len >= 0) { buf[len] = '\0'; /* readlink doesn't nul terminate */ - exec_path = strdup(buf); + exec_path = JLI_StringDup(buf); } } #else /* !__sun && !__linux */ @@ -1091,8 +1043,7 @@ void PrintMachineDependentOptions() { return; } -#ifndef GAMMA /* gamma launcher does not have ergonomics */ - +#ifndef GAMMA /* * The following methods (down to ServerClassMachine()) answer * the question about whether a machine is a "server-class" @@ -1164,7 +1115,7 @@ solaris_sparc_ServerClassMachine(void) { } } if (_launcher_debug) { - printf("solaris_" ARCH "_ServerClassMachine: %s\n", + printf("solaris_" LIBARCHNAME "_ServerClassMachine: %s\n", (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE")); } return result; @@ -1262,7 +1213,6 @@ get_cpuid(uint32_t arg, uint32_t value_of_edx = 0; __asm__ volatile (/* Instructions */ /* ebx is callee-save, so push it */ - /* even though it's in the clobbers section */ " pushl %%ebx \n" " movl %4, %%eax \n" " cpuid \n" @@ -1281,7 +1231,7 @@ get_cpuid(uint32_t arg, : /* Inputs */ "m" (arg) : /* Clobbers */ - "%eax", "%ebx", "%ecx", "%edx" + "%eax", "%ecx", "%edx" ); *eaxp = value_of_eax; *ebxp = value_of_ebx; @@ -1461,7 +1411,7 @@ solaris_i586_ServerClassMachine(void) { } } if (_launcher_debug) { - printf("solaris_" ARCH "_ServerClassMachine: %s\n", + printf("solaris_" LIBARCHNAME "_ServerClassMachine: %s\n", (result == JNI_TRUE ? "true" : "false")); } return result; @@ -1494,7 +1444,7 @@ linux_i586_ServerClassMachine(void) { } } if (_launcher_debug) { - printf("linux_" ARCH "_ServerClassMachine: %s\n", + printf("linux_" LIBARCHNAME "_ServerClassMachine: %s\n", (result == JNI_TRUE ? "true" : "false")); } return result; @@ -1506,7 +1456,11 @@ linux_i586_ServerClassMachine(void) { jboolean ServerClassMachine(void) { jboolean result = JNI_FALSE; -#if defined(__sun) && defined(__sparc) +#if defined(NEVER_ACT_AS_SERVER_CLASS_MACHINE) + result = JNI_FALSE; +#elif defined(ALWAYS_ACT_AS_SERVER_CLASS_MACHINE) + result = JNI_TRUE; +#elif defined(__sun) && defined(__sparc) result = solaris_sparc_ServerClassMachine(); #elif defined(__sun) && defined(i586) result = solaris_i586_ServerClassMachine(); @@ -1521,10 +1475,6 @@ ServerClassMachine(void) { return result; } -#endif /* ifndef GAMMA */ - -#ifndef GAMMA /* gamma launcher does not choose JDK/JRE/JVM */ - /* * Since using the file system as a registry is a bit risky, perform * additional sanity checks on the identified directory to validate @@ -1591,13 +1541,13 @@ static char else if (strncmp(dp->d_name, "j2sdk", 5) == 0) offset = 5; if (offset > 0) { - if ((acceptable_release(dp->d_name + offset, + if ((JLI_AcceptableRelease(dp->d_name + offset, info->jre_version)) && CheckSanity(dirname, dp->d_name)) - if ((best == NULL) || (exact_version_id( + if ((best == NULL) || (JLI_ExactVersionId( dp->d_name + offset, best + best_offset) > 0)) { if (best != NULL) - free(best); - best = strdup(dp->d_name); + JLI_MemFree(best); + best = JLI_StringDup(dp->d_name); best_offset = offset; } } @@ -1607,9 +1557,9 @@ static char if (best == NULL) return (NULL); else { - ret_str = MemAlloc(strlen(dirname) + strlen(best) + 2); + ret_str = JLI_MemAlloc(strlen(dirname) + strlen(best) + 2); ret_str = strcat(strcat(strcpy(ret_str, dirname), "/"), best); - free(best); + JLI_MemFree(best); return (ret_str); } } @@ -1636,16 +1586,17 @@ LocateJRE(manifest_info* info) * Start by getting JAVA_VERSION_PATH */ if (info->jre_restrict_search) - path = strdup(system_dir); + path = JLI_StringDup(system_dir); else if ((path = getenv("JAVA_VERSION_PATH")) != NULL) - path = strdup(path); + path = JLI_StringDup(path); else if ((home = getenv("HOME")) != NULL) { - path = (char *)MemAlloc(strlen(home) + 13); + path = (char *)JLI_MemAlloc(strlen(home) + strlen(system_dir) + + strlen(user_dir) + 2); path = strcat(strcat(strcat(strcpy(path, home), user_dir), ":"), system_dir); } else - path = strdup(system_dir); + path = JLI_StringDup(system_dir); /* * Step through each directory on the path. Terminate the scan with @@ -1662,7 +1613,7 @@ LocateJRE(manifest_info* info) if (dp != NULL) dp++; } - free(path); + JLI_MemFree(path); return (target); } @@ -1740,16 +1691,19 @@ ExecJRE(char *jre, char **argv) argv[0] = progname; if (_launcher_debug) { int i; - printf("execv(\"%s\"", wanted); - for (i = 0; argv[i] != NULL; i++) - printf(", \"%s\"", argv[i]); - printf(")\n"); + printf("ReExec Command: %s (%s)\n", wanted, argv[0]); + printf("ReExec Args:"); + for (i = 1; argv[i] != NULL; i++) + printf(" %s", argv[i]); + printf("\n"); } + (void)fflush(stdout); + (void)fflush(stderr); execv(wanted, argv); + perror("execv()"); fprintf(stderr, "Exec of %s failed\n", wanted); exit(1); } - #endif /* ifndef GAMMA */ /* @@ -1830,23 +1784,92 @@ UnsetEnv(char *name) { return(borrowed_unsetenv(name)); } -/* - * The implementation for finding classes from the bootstrap - * class loader, refer to java.h - */ -static FindClassFromBootLoader_t *findBootClass = NULL; -jclass -FindBootStrapClass(JNIEnv *env, const char* classname) -{ - if (findBootClass == NULL) { - findBootClass = (FindClassFromBootLoader_t *)dlsym(RTLD_DEFAULT, - "JVM_FindClassFromBootLoader"); - if (findBootClass == NULL) { - fprintf(stderr, "Error: could load method JVM_FindClassFromBootLoader"); - return NULL; - } - } - return findBootClass(env, classname, JNI_FALSE); +/* --- Splash Screen shared library support --- */ + +static const char* SPLASHSCREEN_SO = "libsplashscreen.so"; + +static void* hSplashLib = NULL; + +void* SplashProcAddress(const char* name) { + if (!hSplashLib) { + hSplashLib = dlopen(SPLASHSCREEN_SO, RTLD_LAZY | RTLD_GLOBAL); + } + if (hSplashLib) { + void* sym = dlsym(hSplashLib, name); + return sym; + } else { + return NULL; + } } +void SplashFreeLibrary() { + if (hSplashLib) { + dlclose(hSplashLib); + hSplashLib = NULL; + } +} + +const char * +jlong_format_specifier() { + return "%lld"; +} + +/* + * Block current thread and continue execution in a new thread + */ +int +ContinueInNewThread(int (JNICALL *continuation)(void *), jlong stack_size, void * args) { + int rslt; +#ifdef __linux__ + pthread_t tid; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); + + if (stack_size > 0) { + pthread_attr_setstacksize(&attr, stack_size); + } + + if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) { + void * tmp; + pthread_join(tid, &tmp); + rslt = (int)(intptr_t)tmp; + } else { + /* + * Continue execution in current thread if for some reason (e.g. out of + * memory/LWP) a new thread can't be created. This will likely fail + * later in continuation as JNI_CreateJavaVM needs to create quite a + * few new threads, anyway, just give it a try.. + */ + rslt = continuation(args); + } + + pthread_attr_destroy(&attr); +#else + thread_t tid; + long flags = 0; + if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) { + void * tmp; + thr_join(tid, NULL, &tmp); + rslt = (int)(intptr_t)tmp; + } else { + /* See above. Continue in current thread if thr_create() failed */ + rslt = continuation(args); + } +#endif + return rslt; +} + +/* Coarse estimation of number of digits assuming the worst case is a 64-bit pid. */ +#define MAX_PID_STR_SZ 20 + +void SetJavaLauncherPlatformProps() { + /* Linux only */ +#ifdef __linux__ + const char *substr = "-Dsun.java.launcher.pid="; + char *pid_prop_str = (char *)JLI_MemAlloc(strlen(substr) + MAX_PID_STR_SZ + 1); + sprintf(pid_prop_str, "%s%d", substr, getpid()); + AddOption(pid_prop_str, NULL); +#endif +} diff --git a/hotspot/src/os/solaris/launcher/java_md.h b/hotspot/src/os/posix/launcher/java_md.h similarity index 89% rename from hotspot/src/os/solaris/launcher/java_md.h rename to hotspot/src/os/posix/launcher/java_md.h index 9b025060341..ed36fd1af67 100644 --- a/hotspot/src/os/solaris/launcher/java_md.h +++ b/hotspot/src/os/posix/launcher/java_md.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ * */ -/* - * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK, - * search "GAMMA" for gamma specific changes. - */ - #ifndef JAVA_MD_H #define JAVA_MD_H @@ -36,10 +31,12 @@ #ifndef GAMMA #include "manifest_info.h" #endif +#include "jli_util.h" #define PATH_SEPARATOR ':' #define FILESEP "/" #define FILE_SEPARATOR '/' +#define IS_FILE_SEPARATOR(c) ((c) == '/') #ifndef MAXNAMELEN #define MAXNAMELEN PATH_MAX #endif @@ -71,7 +68,7 @@ * Function prototypes. */ #ifndef GAMMA -char *LocateJRE(manifest_info* info); +char *LocateJRE(manifest_info *info); void ExecJRE(char *jre, char **argv); #endif int UnsetEnv(char *name); diff --git a/hotspot/src/os/posix/launcher/launcher.script b/hotspot/src/os/posix/launcher/launcher.script new file mode 100644 index 00000000000..22ed66b9c2f --- /dev/null +++ b/hotspot/src/os/posix/launcher/launcher.script @@ -0,0 +1,212 @@ +#!/bin/bash + +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. + + +# This script launches HotSpot. +# +# If the first parameter is either "-gdb" or "-gud", HotSpot will be +# launched inside gdb. "-gud" means "open an Emacs window and run gdb +# inside Emacs". +# +# If the first parameter is "-dbx", HotSpot will be launched inside dbx. +# +# If the first parameter is "-valgrind", HotSpot will be launched +# inside Valgrind (http://valgrind.kde.org) using the Memcheck skin, +# and with memory leak detection enabled. This currently (2005jan19) +# requires at least Valgrind 2.3.0. -Xmx16m will also be passed as +# the first parameter to HotSpot, since lowering HotSpot's memory +# consumption makes execution inside of Valgrind *a lot* faster. +# + + +# +# User changeable parameters ------------------------------------------------ +# + +# This is the name of the gdb binary to use +if [ ! "$GDB" ] +then + GDB=gdb +fi + +# This is the name of the gdb binary to use +if [ ! "$DBX" ] +then + DBX=dbx +fi + +# This is the name of the Valgrind binary to use +if [ ! "$VALGRIND" ] +then + VALGRIND=valgrind +fi + +# This is the name of Emacs for running GUD +EMACS=emacs + +# +# End of user changeable parameters ----------------------------------------- +# + +# Make sure the paths are fully specified, i.e. they must begin with /. +SCRIPT=$(cd $(dirname $0) && pwd)/$(basename $0) +RUNDIR=$(pwd) + +# Look whether the user wants to run inside gdb +case "$1" in + -gdb) + MODE=gdb + shift + ;; + -gud) + MODE=gud + shift + ;; + -dbx) + MODE=dbx + shift + ;; + -valgrind) + MODE=valgrind + shift + ;; + *) + MODE=run + ;; +esac + +# Find out the absolute path to this script +MYDIR=$(cd $(dirname $SCRIPT) && pwd) + +JDK= +if [ "${ALT_JAVA_HOME}" = "" ]; then + source ${MYDIR}/jdkpath.sh +else + JDK=${ALT_JAVA_HOME%%/jre}; +fi + +if [ "${JDK}" = "" ]; then + echo Failed to find JDK. ALT_JAVA_HOME is not set or ./jdkpath.sh is empty or not found. + exit 1 +fi + +# We will set the LD_LIBRARY_PATH as follows: +# o $JVMPATH (directory portion only) +# o $JRE/lib/$ARCH +# followed by the user's previous effective LD_LIBRARY_PATH, if +# any. +JRE=$JDK/jre +JAVA_HOME=$JDK +ARCH=@@LIBARCH@@ + +# Find out the absolute path to this script +MYDIR=$(cd $(dirname $SCRIPT) && pwd) + +SBP=${MYDIR}:${JRE}/lib/${ARCH} + +# Set up a suitable LD_LIBRARY_PATH + +if [ -z "$LD_LIBRARY_PATH" ] +then + LD_LIBRARY_PATH="$SBP" +else + LD_LIBRARY_PATH="$SBP:$LD_LIBRARY_PATH" +fi + +export LD_LIBRARY_PATH +export JAVA_HOME + +JPARMS="$@ $JAVA_ARGS"; + +# Locate the gamma development launcher +LAUNCHER=${MYDIR}/gamma +if [ ! -x $LAUNCHER ] ; then + echo Error: Cannot find the gamma development launcher \"$LAUNCHER\" + exit 1 +fi + +GDBSRCDIR=$MYDIR +BASEDIR=$(cd $MYDIR/../../.. && pwd) + +init_gdb() { +# Create a gdb script in case we should run inside gdb + GDBSCR=/tmp/hsl.$$ + rm -f $GDBSCR + cat >>$GDBSCR <= 22.1 + case $($EMACS -version 2> /dev/null) in + *GNU\ Emacs\ 2[23]*) + emacs_gud_cmd="gdba" + emacs_gud_args="--annotate=3" + ;; + *) + emacs_gud_cmd="gdb" + emacs_gud_args= + ;; + esac + $EMACS --eval "($emacs_gud_cmd \"$GDB $emacs_gud_args -x $GDBSCR\")"; + rm -f $GDBSCR + ;; + dbx) + $DBX -s $MYDIR/.dbxrc $LAUNCHER $JPARAMS + ;; + valgrind) + echo Warning: Defaulting to 16Mb heap to make Valgrind run faster, use -Xmx for larger heap + echo + $VALGRIND --tool=memcheck --leak-check=yes --num-callers=50 $LAUNCHER -Xmx16m $JPARMS + ;; + run) + LD_PRELOAD=$PRELOADING exec $LAUNCHER $JPARMS + ;; + *) + echo Error: Internal error, unknown launch mode \"$MODE\" + exit 1 + ;; +esac +RETVAL=$? +exit $RETVAL diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp index d60d0bb6469..632a2126394 100644 --- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp +++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp @@ -38,9 +38,22 @@ #define protected public #include -#include "incls/_precompiled.incl" -#include "incls/_vmStructs.cpp.incl" - +#include "code/codeBlob.hpp" +#include "code/nmethod.hpp" +#include "code/pcDesc.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "memory/heap.hpp" +#include "memory/memRegion.hpp" +#include "memory/universe.hpp" +#include "oops/constMethodOop.hpp" +#include "oops/klass.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.hpp" +#include "oops/symbolOop.hpp" +#include "runtime/virtualspace.hpp" +#include "runtime/vmStructs.hpp" +#include "utilities/accessFlags.hpp" +#include "utilities/globalDefinitions.hpp" #ifdef COMPILER1 #if defined(DEBUG) || defined(FASTDEBUG) diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.h b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.h index eb425828673..99146f12c3b 100644 --- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.h +++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H +#define OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H + #include #include @@ -36,3 +39,5 @@ extern "C" { void gen_prologue(GEN_variant gen_var); void gen_epilogue(GEN_variant gen_var); } + +#endif // OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c b/hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c index d253c74a383..4cd8ebfb49e 100644 --- a/hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c +++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/hotspot.d b/hotspot/src/os/solaris/dtrace/hotspot.d index 08cf99ad303..1f7d51b8cec 100644 --- a/hotspot/src/os/solaris/dtrace/hotspot.d +++ b/hotspot/src/os/solaris/dtrace/hotspot.d @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/jvm_dtrace.c b/hotspot/src/os/solaris/dtrace/jvm_dtrace.c index 81884196397..fd0c4333cba 100644 --- a/hotspot/src/os/solaris/dtrace/jvm_dtrace.c +++ b/hotspot/src/os/solaris/dtrace/jvm_dtrace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/jvm_dtrace.h b/hotspot/src/os/solaris/dtrace/jvm_dtrace.h index ba1cebc7724..edc6dbdfc3b 100644 --- a/hotspot/src/os/solaris/dtrace/jvm_dtrace.h +++ b/hotspot/src/os/solaris/dtrace/jvm_dtrace.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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.h b/hotspot/src/os/solaris/dtrace/libjvm_db.h index 2893646236a..d1c5a5ee074 100644 --- a/hotspot/src/os/solaris/dtrace/libjvm_db.h +++ b/hotspot/src/os/solaris/dtrace/libjvm_db.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_SOLARIS_DTRACE_LIBJVM_DB_H +#define OS_SOLARIS_DTRACE_LIBJVM_DB_H + #include #ifdef __cplusplus @@ -61,3 +64,5 @@ void Jagent_destroy(jvm_agent_t *J); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ + +#endif // OS_SOLARIS_DTRACE_LIBJVM_DB_H diff --git a/hotspot/src/os/solaris/launcher/java.c b/hotspot/src/os/solaris/launcher/java.c deleted file mode 100644 index d62f8dd5d43..00000000000 --- a/hotspot/src/os/solaris/launcher/java.c +++ /dev/null @@ -1,1842 +0,0 @@ -/* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -/* - * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK, - * search "GAMMA" for gamma specific changes. - * - * GAMMA: gamma launcher is much simpler than regular java launcher in that - * JVM is either statically linked in or it is installed in the - * same directory where the launcher exists, so we don't have to - * worry about choosing the right JVM based on command line flag, jar - * file and/or ergonomics. Intead of removing unused logic from source - * they are commented out with #ifndef GAMMA, hopefully it'll be easier - * to maintain this file in sync with regular JDK launcher. - */ - -/* - * Shared source for 'java' command line tool. - * - * If JAVA_ARGS is defined, then acts as a launcher for applications. For - * instance, the JDK command line tools such as javac and javadoc (see - * makefiles for more details) are built with this program. Any arguments - * prefixed with '-J' will be passed directly to the 'java' command. - */ - -#ifdef GAMMA -# ifdef JAVA_ARGS -# error Do NOT define JAVA_ARGS when building gamma launcher -# endif -# if !defined(LINK_INTO_AOUT) && !defined(LINK_INTO_LIBJVM) -# error Either LINK_INTO_AOUT or LINK_INTO_LIBJVM must be defined -# endif -#endif - -/* - * One job of the launcher is to remove command line options which the - * vm does not understand and will not process. These options include - * options which select which style of vm is run (e.g. -client and - * -server) as well as options which select the data model to use. - * Additionally, for tools which invoke an underlying vm "-J-foo" - * options are turned into "-foo" options to the vm. This option - * filtering is handled in a number of places in the launcher, some of - * it in machine-dependent code. In this file, the function - * CheckJVMType removes vm style options and TranslateDashJArgs - * removes "-J" prefixes. On unix platforms, the - * CreateExecutionEnvironment function from the unix java_md.c file - * processes and removes -d options. However, in case - * CreateExecutionEnvironment does not need to exec because - * LD_LIBRARY_PATH is set acceptably and the data model does not need - * to be changed, ParseArguments will screen out the redundant -d - * options and prevent them from being passed to the vm; this is done - * by using the machine-dependent call - * RemovableMachineDependentOption. - */ - -#include -#include -#include - -#include -#include "java.h" - -#ifndef GAMMA -#include "manifest_info.h" -#include "version_comp.h" -#endif - -#ifndef FULL_VERSION -#define FULL_VERSION JDK_MAJOR_VERSION "." JDK_MINOR_VERSION -#endif - -/* - * The following environment variable is used to influence the behavior - * of the jre exec'd through the SelectVersion routine. The command line - * options which specify the version are not passed to the exec'd version, - * because that jre may be an older version which wouldn't recognize them. - * This environment variable is known to this (and later) version and serves - * to suppress the version selection code. This is not only for efficiency, - * but also for correctness, since any command line options have been - * removed which would cause any value found in the manifest to be used. - * This would be incorrect because the command line options are defined - * to take precedence. - * - * The value associated with this environment variable is the MainClass - * name from within the executable jar file (if any). This is strictly a - * performance enhancement to avoid re-reading the jar file manifest. - * - * A NOTE TO DEVELOPERS: For performance reasons it is important that - * the program image remain relatively small until after SelectVersion - * CreateExecutionEnvironment have finished their possibly recursive - * processing. Watch everything, but resist all temptations to use Java - * interfaces. - */ -#define ENV_ENTRY "_JAVA_VERSION_SET" - -static jboolean printVersion = JNI_FALSE; /* print and exit */ -static jboolean showVersion = JNI_FALSE; /* print but continue */ -static char *progname; -jboolean _launcher_debug = JNI_FALSE; - -/* - * List of VM options to be specified when the VM is created. - */ -static JavaVMOption *options; -static int numOptions, maxOptions; - -/* - * Prototypes for functions internal to launcher. - */ -static void AddOption(char *str, void *info); -static void SetClassPath(char *s); -static void SelectVersion(int argc, char **argv, char **main_class); -static jboolean ParseArguments(int *pargc, char ***pargv, char **pjarfile, - char **pclassname, int *pret); -static jboolean InitializeJVM(JavaVM **pvm, JNIEnv **penv, - InvocationFunctions *ifn); -static jstring NewPlatformString(JNIEnv *env, char *s); -static jobjectArray NewPlatformStringArray(JNIEnv *env, char **strv, int strc); -static jclass LoadClass(JNIEnv *env, char *name); -static jstring GetMainClassName(JNIEnv *env, char *jarname); -static void SetJavaCommandLineProp(char* classname, char* jarfile, int argc, char** argv); -#ifdef GAMMA -static void SetJavaLauncherProp(void); -#endif - -#ifdef JAVA_ARGS -static void TranslateDashJArgs(int *pargc, char ***pargv); -static jboolean AddApplicationOptions(void); -#endif - -static void PrintJavaVersion(JNIEnv *env); -static void PrintUsage(void); -static jint PrintXUsage(void); - -static void SetPaths(int argc, char **argv); - -/* Maximum supported entries from jvm.cfg. */ -#define INIT_MAX_KNOWN_VMS 10 -/* Values for vmdesc.flag */ -#define VM_UNKNOWN -1 -#define VM_KNOWN 0 -#define VM_ALIASED_TO 1 -#define VM_WARN 2 -#define VM_ERROR 3 -#define VM_IF_SERVER_CLASS 4 -#define VM_IGNORE 5 -struct vmdesc { - char *name; - int flag; - char *alias; - char *server_class; -}; -static struct vmdesc *knownVMs = NULL; -static int knownVMsCount = 0; -static int knownVMsLimit = 0; - -static void GrowKnownVMs(); -static int KnownVMIndex(const char* name); -static void FreeKnownVMs(); - -jboolean ServerClassMachine(); - -/* flag which if set suppresses error messages from the launcher */ -static int noExitErrorMessage = 0; - -/* - * Entry point. - */ -int -main(int argc, char ** argv) -{ - JavaVM *vm = 0; - JNIEnv *env = 0; - char *jarfile = 0; - char *classname = 0; - char *s = 0; - char *main_class = NULL; - jstring mainClassName; - jclass mainClass; - jmethodID mainID; - jobjectArray mainArgs; - int ret; - InvocationFunctions ifn; - jlong start, end; - char jrepath[MAXPATHLEN], jvmpath[MAXPATHLEN]; - char ** original_argv = argv; - - /* - * Error message to print or display; by default the message will - * only be displayed in a window. - */ - char * message = "Fatal exception occurred. Program will exit."; - jboolean messageDest = JNI_FALSE; - - if (getenv("_JAVA_LAUNCHER_DEBUG") != 0) { - _launcher_debug = JNI_TRUE; - printf("----_JAVA_LAUNCHER_DEBUG----\n"); - } - -#ifndef GAMMA - /* - * Make sure the specified version of the JRE is running. - * - * There are three things to note about the SelectVersion() routine: - * 1) If the version running isn't correct, this routine doesn't - * return (either the correct version has been exec'd or an error - * was issued). - * 2) Argc and Argv in this scope are *not* altered by this routine. - * It is the responsibility of subsequent code to ignore the - * arguments handled by this routine. - * 3) As a side-effect, the variable "main_class" is guaranteed to - * be set (if it should ever be set). This isn't exactly the - * poster child for structured programming, but it is a small - * price to pay for not processing a jar file operand twice. - * (Note: This side effect has been disabled. See comment on - * bugid 5030265 below.) - */ - SelectVersion(argc, argv, &main_class); -#endif /* ifndef GAMMA */ - - /* copy original argv */ - { - int i; - original_argv = (char**)MemAlloc(sizeof(char*)*(argc+1)); - for(i = 0; i < argc+1; i++) - original_argv[i] = argv[i]; - } - - CreateExecutionEnvironment(&argc, &argv, - jrepath, sizeof(jrepath), - jvmpath, sizeof(jvmpath), - original_argv); - ifn.CreateJavaVM = 0; - ifn.GetDefaultJavaVMInitArgs = 0; - - if (_launcher_debug) - start = CounterGet(); - if (!LoadJavaVM(jvmpath, &ifn)) { - exit(6); - } - if (_launcher_debug) { - end = CounterGet(); - printf("%ld micro seconds to LoadJavaVM\n", - (long)(jint)Counter2Micros(end-start)); - } - -#ifdef JAVA_ARGS /* javac, jar and friends. */ - progname = "java"; -#else /* java, oldjava, javaw and friends */ -#ifdef PROGNAME - progname = PROGNAME; -#else - progname = *argv; - if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) { - progname = s + 1; - } -#endif /* PROGNAME */ -#endif /* JAVA_ARGS */ - ++argv; - --argc; - -#ifdef JAVA_ARGS - /* Preprocess wrapper arguments */ - TranslateDashJArgs(&argc, &argv); - if (!AddApplicationOptions()) { - exit(1); - } -#endif - - /* Set default CLASSPATH */ - if ((s = getenv("CLASSPATH")) == 0) { - s = "."; - } -#ifndef JAVA_ARGS - SetClassPath(s); -#endif - - /* - * Parse command line options; if the return value of - * ParseArguments is false, the program should exit. - */ - if (!ParseArguments(&argc, &argv, &jarfile, &classname, &ret)) { - exit(ret); - } - - /* Override class path if -jar flag was specified */ - if (jarfile != 0) { - SetClassPath(jarfile); - } - - /* set the -Dsun.java.command pseudo property */ - SetJavaCommandLineProp(classname, jarfile, argc, argv); - -#ifdef GAMMA - /* Set the -Dsun.java.launcher pseudo property */ - SetJavaLauncherProp(); -#endif - - /* - * Done with all command line processing and potential re-execs so - * clean up the environment. - */ - (void)UnsetEnv(ENV_ENTRY); - - /* Initialize the virtual machine */ - - if (_launcher_debug) - start = CounterGet(); - if (!InitializeJVM(&vm, &env, &ifn)) { - ReportErrorMessage("Could not create the Java virtual machine.", - JNI_TRUE); - exit(1); - } - - if (printVersion || showVersion) { - PrintJavaVersion(env); - if ((*env)->ExceptionOccurred(env)) { - ReportExceptionDescription(env); - goto leave; - } - if (printVersion) { - ret = 0; - message = NULL; - goto leave; - } - if (showVersion) { - fprintf(stderr, "\n"); - } - } - - /* If the user specified neither a class name nor a JAR file */ - if (jarfile == 0 && classname == 0) { - PrintUsage(); - message = NULL; - goto leave; - } - -#ifndef GAMMA - FreeKnownVMs(); /* after last possible PrintUsage() */ -#endif - - if (_launcher_debug) { - end = CounterGet(); - printf("%ld micro seconds to InitializeJVM\n", - (long)(jint)Counter2Micros(end-start)); - } - - /* At this stage, argc/argv have the applications' arguments */ - if (_launcher_debug) { - int i = 0; - printf("Main-Class is '%s'\n", classname ? classname : ""); - printf("Apps' argc is %d\n", argc); - for (; i < argc; i++) { - printf(" argv[%2d] = '%s'\n", i, argv[i]); - } - } - - ret = 1; - - /* - * Get the application's main class. - * - * See bugid 5030265. The Main-Class name has already been parsed - * from the manifest, but not parsed properly for UTF-8 support. - * Hence the code here ignores the value previously extracted and - * uses the pre-existing code to reextract the value. This is - * possibly an end of release cycle expedient. However, it has - * also been discovered that passing some character sets through - * the environment has "strange" behavior on some variants of - * Windows. Hence, maybe the manifest parsing code local to the - * launcher should never be enhanced. - * - * Hence, future work should either: - * 1) Correct the local parsing code and verify that the - * Main-Class attribute gets properly passed through - * all environments, - * 2) Remove the vestages of maintaining main_class through - * the environment (and remove these comments). - */ - if (jarfile != 0) { - mainClassName = GetMainClassName(env, jarfile); - if ((*env)->ExceptionOccurred(env)) { - ReportExceptionDescription(env); - goto leave; - } - if (mainClassName == NULL) { - const char * format = "Failed to load Main-Class manifest " - "attribute from\n%s"; - message = (char*)MemAlloc((strlen(format) + strlen(jarfile)) * - sizeof(char)); - sprintf(message, format, jarfile); - messageDest = JNI_TRUE; - goto leave; - } - classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0); - if (classname == NULL) { - ReportExceptionDescription(env); - goto leave; - } - mainClass = LoadClass(env, classname); - if(mainClass == NULL) { /* exception occurred */ - ReportExceptionDescription(env); - message = "Could not find the main class. Program will exit."; - goto leave; - } - (*env)->ReleaseStringUTFChars(env, mainClassName, classname); - } else { - mainClassName = NewPlatformString(env, classname); - if (mainClassName == NULL) { - const char * format = "Failed to load Main Class: %s"; - message = (char *)MemAlloc((strlen(format) + strlen(classname)) * - sizeof(char) ); - sprintf(message, format, classname); - messageDest = JNI_TRUE; - goto leave; - } - classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0); - if (classname == NULL) { - ReportExceptionDescription(env); - goto leave; - } - mainClass = LoadClass(env, classname); - if(mainClass == NULL) { /* exception occurred */ - ReportExceptionDescription(env); - message = "Could not find the main class. Program will exit."; - goto leave; - } - (*env)->ReleaseStringUTFChars(env, mainClassName, classname); - } - - /* Get the application's main method */ - mainID = (*env)->GetStaticMethodID(env, mainClass, "main", - "([Ljava/lang/String;)V"); - if (mainID == NULL) { - if ((*env)->ExceptionOccurred(env)) { - ReportExceptionDescription(env); - } else { - message = "No main method found in specified class."; - messageDest = JNI_TRUE; - } - goto leave; - } - - { /* Make sure the main method is public */ - jint mods; - jmethodID mid; - jobject obj = (*env)->ToReflectedMethod(env, mainClass, - mainID, JNI_TRUE); - - if( obj == NULL) { /* exception occurred */ - ReportExceptionDescription(env); - goto leave; - } - - mid = - (*env)->GetMethodID(env, - (*env)->GetObjectClass(env, obj), - "getModifiers", "()I"); - if ((*env)->ExceptionOccurred(env)) { - ReportExceptionDescription(env); - goto leave; - } - - mods = (*env)->CallIntMethod(env, obj, mid); - if ((mods & 1) == 0) { /* if (!Modifier.isPublic(mods)) ... */ - message = "Main method not public."; - messageDest = JNI_TRUE; - goto leave; - } - } - - /* Build argument array */ - mainArgs = NewPlatformStringArray(env, argv, argc); - if (mainArgs == NULL) { - ReportExceptionDescription(env); - goto leave; - } - - /* Invoke main method. */ - (*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs); - - /* - * The launcher's exit code (in the absence of calls to - * System.exit) will be non-zero if main threw an exception. - */ - ret = (*env)->ExceptionOccurred(env) == NULL ? 0 : 1; - - /* - * Detach the main thread so that it appears to have ended when - * the application's main method exits. This will invoke the - * uncaught exception handler machinery if main threw an - * exception. An uncaught exception handler cannot change the - * launcher's return code except by calling System.exit. - */ - if ((*vm)->DetachCurrentThread(vm) != 0) { - message = "Could not detach main thread."; - messageDest = JNI_TRUE; - ret = 1; - goto leave; - } - - message = NULL; - - leave: - /* - * Wait for all non-daemon threads to end, then destroy the VM. - * This will actually create a trivial new Java waiter thread - * named "DestroyJavaVM", but this will be seen as a different - * thread from the one that executed main, even though they are - * the same C thread. This allows mainThread.join() and - * mainThread.isAlive() to work as expected. - */ - (*vm)->DestroyJavaVM(vm); - - if(message != NULL && !noExitErrorMessage) - ReportErrorMessage(message, messageDest); - return ret; -} - - -#ifndef GAMMA -/* - * Checks the command line options to find which JVM type was - * specified. If no command line option was given for the JVM type, - * the default type is used. The environment variable - * JDK_ALTERNATE_VM and the command line option -XXaltjvm= are also - * checked as ways of specifying which JVM type to invoke. - */ -char * -CheckJvmType(int *pargc, char ***argv, jboolean speculative) { - int i, argi; - int argc; - char **newArgv; - int newArgvIdx = 0; - int isVMType; - int jvmidx = -1; - char *jvmtype = getenv("JDK_ALTERNATE_VM"); - - argc = *pargc; - - /* To make things simpler we always copy the argv array */ - newArgv = MemAlloc((argc + 1) * sizeof(char *)); - - /* The program name is always present */ - newArgv[newArgvIdx++] = (*argv)[0]; - - for (argi = 1; argi < argc; argi++) { - char *arg = (*argv)[argi]; - isVMType = 0; - -#ifdef JAVA_ARGS - if (arg[0] != '-') { - newArgv[newArgvIdx++] = arg; - continue; - } -#else - if (strcmp(arg, "-classpath") == 0 || - strcmp(arg, "-cp") == 0) { - newArgv[newArgvIdx++] = arg; - argi++; - if (argi < argc) { - newArgv[newArgvIdx++] = (*argv)[argi]; - } - continue; - } - if (arg[0] != '-') break; -#endif - - /* Did the user pass an explicit VM type? */ - i = KnownVMIndex(arg); - if (i >= 0) { - jvmtype = knownVMs[jvmidx = i].name + 1; /* skip the - */ - isVMType = 1; - *pargc = *pargc - 1; - } - - /* Did the user specify an "alternate" VM? */ - else if (strncmp(arg, "-XXaltjvm=", 10) == 0 || strncmp(arg, "-J-XXaltjvm=", 12) == 0) { - isVMType = 1; - jvmtype = arg+((arg[1]=='X')? 10 : 12); - jvmidx = -1; - } - - if (!isVMType) { - newArgv[newArgvIdx++] = arg; - } - } - - /* - * Finish copying the arguments if we aborted the above loop. - * NOTE that if we aborted via "break" then we did NOT copy the - * last argument above, and in addition argi will be less than - * argc. - */ - while (argi < argc) { - newArgv[newArgvIdx++] = (*argv)[argi]; - argi++; - } - - /* argv is null-terminated */ - newArgv[newArgvIdx] = 0; - - /* Copy back argv */ - *argv = newArgv; - *pargc = newArgvIdx; - - /* use the default VM type if not specified (no alias processing) */ - if (jvmtype == NULL) { - char* result = knownVMs[0].name+1; - /* Use a different VM type if we are on a server class machine? */ - if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) && - (ServerClassMachine() == JNI_TRUE)) { - result = knownVMs[0].server_class+1; - } - if (_launcher_debug) { - printf("Default VM: %s\n", result); - } - return result; - } - - /* if using an alternate VM, no alias processing */ - if (jvmidx < 0) - return jvmtype; - - /* Resolve aliases first */ - { - int loopCount = 0; - while (knownVMs[jvmidx].flag == VM_ALIASED_TO) { - int nextIdx = KnownVMIndex(knownVMs[jvmidx].alias); - - if (loopCount > knownVMsCount) { - if (!speculative) { - ReportErrorMessage("Error: Corrupt jvm.cfg file; cycle in alias list.", - JNI_TRUE); - exit(1); - } else { - return "ERROR"; - /* break; */ - } - } - - if (nextIdx < 0) { - if (!speculative) { - ReportErrorMessage2("Error: Unable to resolve VM alias %s", - knownVMs[jvmidx].alias, JNI_TRUE); - exit(1); - } else { - return "ERROR"; - } - } - jvmidx = nextIdx; - jvmtype = knownVMs[jvmidx].name+1; - loopCount++; - } - } - - switch (knownVMs[jvmidx].flag) { - case VM_WARN: - if (!speculative) { - fprintf(stderr, "Warning: %s VM not supported; %s VM will be used\n", - jvmtype, knownVMs[0].name + 1); - } - /* fall through */ - case VM_IGNORE: - jvmtype = knownVMs[jvmidx=0].name + 1; - /* fall through */ - case VM_KNOWN: - break; - case VM_ERROR: - if (!speculative) { - ReportErrorMessage2("Error: %s VM not supported", jvmtype, JNI_TRUE); - exit(1); - } else { - return "ERROR"; - } - } - - return jvmtype; -} -#endif /* ifndef GAMMA */ - -/* - * Adds a new VM option with the given given name and value. - */ -static void -AddOption(char *str, void *info) -{ - /* - * Expand options array if needed to accommodate at least one more - * VM option. - */ - if (numOptions >= maxOptions) { - if (options == 0) { - maxOptions = 4; - options = MemAlloc(maxOptions * sizeof(JavaVMOption)); - } else { - JavaVMOption *tmp; - maxOptions *= 2; - tmp = MemAlloc(maxOptions * sizeof(JavaVMOption)); - memcpy(tmp, options, numOptions * sizeof(JavaVMOption)); - free(options); - options = tmp; - } - } - options[numOptions].optionString = str; - options[numOptions++].extraInfo = info; -} - -static void -SetClassPath(char *s) -{ - char *def = MemAlloc(strlen(s) + 40); - sprintf(def, "-Djava.class.path=%s", s); - AddOption(def, NULL); -} - -#ifndef GAMMA -/* - * The SelectVersion() routine ensures that an appropriate version of - * the JRE is running. The specification for the appropriate version - * is obtained from either the manifest of a jar file (preferred) or - * from command line options. - */ -static void -SelectVersion(int argc, char **argv, char **main_class) -{ - char *arg; - char **new_argv; - char **new_argp; - char *operand; - char *version = NULL; - char *jre = NULL; - int jarflag = 0; - int restrict_search = -1; /* -1 implies not known */ - manifest_info info; - char env_entry[MAXNAMELEN + 24] = ENV_ENTRY "="; - char *env_in; - int res; - - /* - * If the version has already been selected, set *main_class - * with the value passed through the environment (if any) and - * simply return. - */ - if ((env_in = getenv(ENV_ENTRY)) != NULL) { - if (*env_in != '\0') - *main_class = strdup(env_in); - return; - } - - /* - * Scan through the arguments for options relevant to multiple JRE - * support. For reference, the command line syntax is defined as: - * - * SYNOPSIS - * java [options] class [argument...] - * - * java [options] -jar file.jar [argument...] - * - * As the scan is performed, make a copy of the argument list with - * the version specification options (new to 1.5) removed, so that - * a version less than 1.5 can be exec'd. - */ - new_argv = MemAlloc((argc + 1) * sizeof(char*)); - new_argv[0] = argv[0]; - new_argp = &new_argv[1]; - argc--; - argv++; - while ((arg = *argv) != 0 && *arg == '-') { - if (strncmp(arg, "-version:", 9) == 0) { - version = arg + 9; - } else if (strcmp(arg, "-jre-restrict-search") == 0) { - restrict_search = 1; - } else if (strcmp(arg, "-no-jre-restrict-search") == 0) { - restrict_search = 0; - } else { - if (strcmp(arg, "-jar") == 0) - jarflag = 1; - /* deal with "unfortunate" classpath syntax */ - if ((strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) && - (argc >= 2)) { - *new_argp++ = arg; - argc--; - argv++; - arg = *argv; - } - *new_argp++ = arg; - } - argc--; - argv++; - } - if (argc <= 0) { /* No operand? Possibly legit with -[full]version */ - operand = NULL; - } else { - argc--; - *new_argp++ = operand = *argv++; - } - while (argc-- > 0) /* Copy over [argument...] */ - *new_argp++ = *argv++; - *new_argp = NULL; - - /* - * If there is a jar file, read the manifest. If the jarfile can't be - * read, the manifest can't be read from the jar file, or the manifest - * is corrupt, issue the appropriate error messages and exit. - * - * Even if there isn't a jar file, construct a manifest_info structure - * containing the command line information. It's a convenient way to carry - * this data around. - */ - if (jarflag && operand) { - if ((res = parse_manifest(operand, &info)) != 0) { - if (res == -1) - ReportErrorMessage2("Unable to access jarfile %s", - operand, JNI_TRUE); - else - ReportErrorMessage2("Invalid or corrupt jarfile %s", - operand, JNI_TRUE); - exit(1); - } - } else { - info.manifest_version = NULL; - info.main_class = NULL; - info.jre_version = NULL; - info.jre_restrict_search = 0; - } - - /* - * The JRE-Version and JRE-Restrict-Search values (if any) from the - * manifest are overwritten by any specified on the command line. - */ - if (version != NULL) - info.jre_version = version; - if (restrict_search != -1) - info.jre_restrict_search = restrict_search; - - /* - * "Valid" returns (other than unrecoverable errors) follow. Set - * main_class as a side-effect of this routine. - */ - if (info.main_class != NULL) - *main_class = strdup(info.main_class); - - /* - * If no version selection information is found either on the command - * line or in the manifest, simply return. - */ - if (info.jre_version == NULL) { - free_manifest(); - free(new_argv); - return; - } - - /* - * Check for correct syntax of the version specification (JSR 56). - */ - if (!valid_version_string(info.jre_version)) { - ReportErrorMessage2("Syntax error in version specification \"%s\"", - info.jre_version, JNI_TRUE); - exit(1); - } - - /* - * Find the appropriate JVM on the system. Just to be as forgiving as - * possible, if the standard algorithms don't locate an appropriate - * jre, check to see if the one running will satisfy the requirements. - * This can happen on systems which haven't been set-up for multiple - * JRE support. - */ - jre = LocateJRE(&info); - if (_launcher_debug) - printf("JRE-Version = %s, JRE-Restrict-Search = %s Selected = %s\n", - (info.jre_version?info.jre_version:"null"), - (info.jre_restrict_search?"true":"false"), (jre?jre:"null")); - if (jre == NULL) { - if (acceptable_release(FULL_VERSION, info.jre_version)) { - free_manifest(); - free(new_argv); - return; - } else { - ReportErrorMessage2( - "Unable to locate JRE meeting specification \"%s\"", - info.jre_version, JNI_TRUE); - exit(1); - } - } - - /* - * If I'm not the chosen one, exec the chosen one. Returning from - * ExecJRE indicates that I am indeed the chosen one. - * - * The private environment variable _JAVA_VERSION_SET is used to - * prevent the chosen one from re-reading the manifest file and - * using the values found within to override the (potential) command - * line flags stripped from argv (because the target may not - * understand them). Passing the MainClass value is an optimization - * to avoid locating, expanding and parsing the manifest extra - * times. - */ - if (info.main_class != NULL) - (void)strcat(env_entry, info.main_class); - (void)putenv(env_entry); - ExecJRE(jre, new_argv); - free_manifest(); - free(new_argv); - return; -} -#endif /* ifndef GAMMA */ - -/* - * Parses command line arguments. Returns JNI_FALSE if launcher - * should exit without starting vm (e.g. certain version and usage - * options); returns JNI_TRUE if vm needs to be started to process - * given options. *pret (the launcher process return value) is set to - * 0 for a normal exit. - */ -static jboolean -ParseArguments(int *pargc, char ***pargv, char **pjarfile, - char **pclassname, int *pret) -{ - int argc = *pargc; - char **argv = *pargv; - jboolean jarflag = JNI_FALSE; - char *arg; - - *pret = 1; - while ((arg = *argv) != 0 && *arg == '-') { - argv++; --argc; - if (strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) { - if (argc < 1) { - ReportErrorMessage2("%s requires class path specification", - arg, JNI_TRUE); - PrintUsage(); - return JNI_FALSE; - } - SetClassPath(*argv); - argv++; --argc; - } else if (strcmp(arg, "-jar") == 0) { - jarflag = JNI_TRUE; - } else if (strcmp(arg, "-help") == 0 || - strcmp(arg, "-h") == 0 || - strcmp(arg, "-?") == 0) { - PrintUsage(); - *pret = 0; - return JNI_FALSE; - } else if (strcmp(arg, "-version") == 0) { - printVersion = JNI_TRUE; - return JNI_TRUE; - } else if (strcmp(arg, "-showversion") == 0) { - showVersion = JNI_TRUE; - } else if (strcmp(arg, "-X") == 0) { - *pret = PrintXUsage(); - return JNI_FALSE; -/* - * The following case provide backward compatibility with old-style - * command line options. - */ - } else if (strcmp(arg, "-fullversion") == 0) { - fprintf(stderr, "%s full version \"%s\"\n", progname, - FULL_VERSION); - *pret = 0; - return JNI_FALSE; - } else if (strcmp(arg, "-verbosegc") == 0) { - AddOption("-verbose:gc", NULL); - } else if (strcmp(arg, "-t") == 0) { - AddOption("-Xt", NULL); - } else if (strcmp(arg, "-tm") == 0) { - AddOption("-Xtm", NULL); - } else if (strcmp(arg, "-debug") == 0) { - AddOption("-Xdebug", NULL); - } else if (strcmp(arg, "-noclassgc") == 0) { - AddOption("-Xnoclassgc", NULL); - } else if (strcmp(arg, "-Xfuture") == 0) { - AddOption("-Xverify:all", NULL); - } else if (strcmp(arg, "-verify") == 0) { - AddOption("-Xverify:all", NULL); - } else if (strcmp(arg, "-verifyremote") == 0) { - AddOption("-Xverify:remote", NULL); - } else if (strcmp(arg, "-noverify") == 0) { - AddOption("-Xverify:none", NULL); - } else if (strcmp(arg, "-XXsuppressExitMessage") == 0) { - noExitErrorMessage = 1; - } else if (strncmp(arg, "-prof", 5) == 0) { - char *p = arg + 5; - char *tmp = MemAlloc(strlen(arg) + 50); - if (*p) { - sprintf(tmp, "-Xrunhprof:cpu=old,file=%s", p + 1); - } else { - sprintf(tmp, "-Xrunhprof:cpu=old,file=java.prof"); - } - AddOption(tmp, NULL); - } else if (strncmp(arg, "-ss", 3) == 0 || - strncmp(arg, "-oss", 4) == 0 || - strncmp(arg, "-ms", 3) == 0 || - strncmp(arg, "-mx", 3) == 0) { - char *tmp = MemAlloc(strlen(arg) + 6); - sprintf(tmp, "-X%s", arg + 1); /* skip '-' */ - AddOption(tmp, NULL); - } else if (strcmp(arg, "-checksource") == 0 || - strcmp(arg, "-cs") == 0 || - strcmp(arg, "-noasyncgc") == 0) { - /* No longer supported */ - fprintf(stderr, - "Warning: %s option is no longer supported.\n", - arg); - } else if (strncmp(arg, "-version:", 9) == 0 || - strcmp(arg, "-no-jre-restrict-search") == 0 || - strcmp(arg, "-jre-restrict-search") == 0) { - ; /* Ignore machine independent options already handled */ - } else if (RemovableMachineDependentOption(arg) ) { - ; /* Do not pass option to vm. */ - } - else { - AddOption(arg, NULL); - } - } - - if (--argc >= 0) { - if (jarflag) { - *pjarfile = *argv++; - *pclassname = 0; - } else { - *pjarfile = 0; - *pclassname = *argv++; - } - *pargc = argc; - *pargv = argv; - } - - return JNI_TRUE; -} - -/* - * Initializes the Java Virtual Machine. Also frees options array when - * finished. - */ -static jboolean -InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn) -{ - JavaVMInitArgs args; - jint r; - - memset(&args, 0, sizeof(args)); - args.version = JNI_VERSION_1_2; - args.nOptions = numOptions; - args.options = options; - args.ignoreUnrecognized = JNI_FALSE; - - if (_launcher_debug) { - int i = 0; - printf("JavaVM args:\n "); - printf("version 0x%08lx, ", (long)args.version); - printf("ignoreUnrecognized is %s, ", - args.ignoreUnrecognized ? "JNI_TRUE" : "JNI_FALSE"); - printf("nOptions is %ld\n", (long)args.nOptions); - for (i = 0; i < numOptions; i++) - printf(" option[%2d] = '%s'\n", - i, args.options[i].optionString); - } - - r = ifn->CreateJavaVM(pvm, (void **)penv, &args); - free(options); - return r == JNI_OK; -} - - -#define NULL_CHECK0(e) if ((e) == 0) return 0 -#define NULL_CHECK(e) if ((e) == 0) return - -/* - * Returns a pointer to a block of at least 'size' bytes of memory. - * Prints error message and exits if the memory could not be allocated. - */ -void * -MemAlloc(size_t size) -{ - void *p = malloc(size); - if (p == 0) { - perror("malloc"); - exit(1); - } - return p; -} - -static jstring platformEncoding = NULL; -static jstring getPlatformEncoding(JNIEnv *env) { - if (platformEncoding == NULL) { - jstring propname = (*env)->NewStringUTF(env, "sun.jnu.encoding"); - if (propname) { - jclass cls; - jmethodID mid; - NULL_CHECK0 (cls = FindBootStrapClass(env, "java/lang/System")); - NULL_CHECK0 (mid = (*env)->GetStaticMethodID( - env, cls, - "getProperty", - "(Ljava/lang/String;)Ljava/lang/String;")); - platformEncoding = (*env)->CallStaticObjectMethod ( - env, cls, mid, propname); - } - } - return platformEncoding; -} - -static jboolean isEncodingSupported(JNIEnv *env, jstring enc) { - jclass cls; - jmethodID mid; - NULL_CHECK0 (cls = FindBootStrapClass(env, "java/nio/charset/Charset")); - NULL_CHECK0 (mid = (*env)->GetStaticMethodID( - env, cls, - "isSupported", - "(Ljava/lang/String;)Z")); - return (jboolean)(*env)->CallStaticObjectMethod (env, cls, mid, enc); -} - -/* - * Returns a new Java string object for the specified platform string. - */ -static jstring -NewPlatformString(JNIEnv *env, char *s) -{ - int len = (int)strlen(s); - jclass cls; - jmethodID mid; - jbyteArray ary; - jstring enc; - - if (s == NULL) - return 0; - enc = getPlatformEncoding(env); - - ary = (*env)->NewByteArray(env, len); - if (ary != 0) { - jstring str = 0; - (*env)->SetByteArrayRegion(env, ary, 0, len, (jbyte *)s); - if (!(*env)->ExceptionOccurred(env)) { -#ifdef GAMMA - /* We support running JVM with older JDK, so here we have to deal */ - /* with the case that sun.jnu.encoding is undefined (enc == NULL) */ - if (enc != NULL && isEncodingSupported(env, enc) == JNI_TRUE) { -#else - if (isEncodingSupported(env, enc) == JNI_TRUE) { -#endif - NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String")); - NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "", - "([BLjava/lang/String;)V")); - str = (*env)->NewObject(env, cls, mid, ary, enc); - } else { - /*If the encoding specified in sun.jnu.encoding is not - endorsed by "Charset.isSupported" we have to fall back - to use String(byte[]) explicitly here without specifying - the encoding name, in which the StringCoding class will - pickup the iso-8859-1 as the fallback converter for us. - */ - NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String")); - NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "", - "([B)V")); - str = (*env)->NewObject(env, cls, mid, ary); - } - (*env)->DeleteLocalRef(env, ary); - return str; - } - } - return 0; -} - -/* - * Returns a new array of Java string objects for the specified - * array of platform strings. - */ -static jobjectArray -NewPlatformStringArray(JNIEnv *env, char **strv, int strc) -{ - jarray cls; - jarray ary; - int i; - - NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String")); - NULL_CHECK0(ary = (*env)->NewObjectArray(env, strc, cls, 0)); - for (i = 0; i < strc; i++) { - jstring str = NewPlatformString(env, *strv++); - NULL_CHECK0(str); - (*env)->SetObjectArrayElement(env, ary, i, str); - (*env)->DeleteLocalRef(env, str); - } - return ary; -} - -/* - * Loads a class, convert the '.' to '/'. - */ -static jclass -LoadClass(JNIEnv *env, char *name) -{ - char *buf = MemAlloc(strlen(name) + 1); - char *s = buf, *t = name, c; - jclass cls; - jlong start, end; - - if (_launcher_debug) - start = CounterGet(); - - do { - c = *t++; - *s++ = (c == '.') ? '/' : c; - } while (c != '\0'); - // use the application class loader for the main-class - cls = (*env)->FindClass(env, buf); - free(buf); - - if (_launcher_debug) { - end = CounterGet(); - printf("%ld micro seconds to load main class\n", - (long)(jint)Counter2Micros(end-start)); - printf("----_JAVA_LAUNCHER_DEBUG----\n"); - } - - return cls; -} - - -/* - * Returns the main class name for the specified jar file. - */ -static jstring -GetMainClassName(JNIEnv *env, char *jarname) -{ -#define MAIN_CLASS "Main-Class" - jclass cls; - jmethodID mid; - jobject jar, man, attr; - jstring str, result = 0; - - NULL_CHECK0(cls = FindBootStrapClass(env, "java/util/jar/JarFile")); - NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "", - "(Ljava/lang/String;)V")); - NULL_CHECK0(str = NewPlatformString(env, jarname)); - NULL_CHECK0(jar = (*env)->NewObject(env, cls, mid, str)); - NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "getManifest", - "()Ljava/util/jar/Manifest;")); - man = (*env)->CallObjectMethod(env, jar, mid); - if (man != 0) { - NULL_CHECK0(mid = (*env)->GetMethodID(env, - (*env)->GetObjectClass(env, man), - "getMainAttributes", - "()Ljava/util/jar/Attributes;")); - attr = (*env)->CallObjectMethod(env, man, mid); - if (attr != 0) { - NULL_CHECK0(mid = (*env)->GetMethodID(env, - (*env)->GetObjectClass(env, attr), - "getValue", - "(Ljava/lang/String;)Ljava/lang/String;")); - NULL_CHECK0(str = NewPlatformString(env, MAIN_CLASS)); - result = (*env)->CallObjectMethod(env, attr, mid, str); - } - } - return result; -} - -#ifdef JAVA_ARGS -static char *java_args[] = JAVA_ARGS; -static char *app_classpath[] = APP_CLASSPATH; - -/* - * For tools convert 'javac -J-ms32m' to 'java -ms32m ...' - */ -static void -TranslateDashJArgs(int *pargc, char ***pargv) -{ - const int NUM_ARGS = (sizeof(java_args) / sizeof(char *)); - int argc = *pargc; - char **argv = *pargv; - int nargc = argc + NUM_ARGS; - char **nargv = MemAlloc((nargc + 1) * sizeof(char *)); - int i; - - *pargc = nargc; - *pargv = nargv; - - /* Copy the VM arguments (i.e. prefixed with -J) */ - for (i = 0; i < NUM_ARGS; i++) { - char *arg = java_args[i]; - if (arg[0] == '-' && arg[1] == 'J') { - *nargv++ = arg + 2; - } - } - - for (i = 0; i < argc; i++) { - char *arg = argv[i]; - if (arg[0] == '-' && arg[1] == 'J') { - if (arg[2] == '\0') { - ReportErrorMessage("Error: the -J option should not be " - "followed by a space.", JNI_TRUE); - exit(1); - } - *nargv++ = arg + 2; - } - } - - /* Copy the rest of the arguments */ - for (i = 0; i < NUM_ARGS; i++) { - char *arg = java_args[i]; - if (arg[0] != '-' || arg[1] != 'J') { - *nargv++ = arg; - } - } - for (i = 0; i < argc; i++) { - char *arg = argv[i]; - if (arg[0] != '-' || arg[1] != 'J') { - *nargv++ = arg; - } - } - *nargv = 0; -} - -/* - * For our tools, we try to add 3 VM options: - * -Denv.class.path= - * -Dapplication.home= - * -Djava.class.path= - * is the user's setting of CLASSPATH -- for instance the user - * tells javac where to find binary classes through this environment - * variable. Notice that users will be able to compile against our - * tools classes (sun.tools.javac.Main) only if they explicitly add - * tools.jar to CLASSPATH. - * is the directory where the application is installed. - * is the classpath to where our apps' classfiles are. - */ -static jboolean -AddApplicationOptions() -{ - const int NUM_APP_CLASSPATH = (sizeof(app_classpath) / sizeof(char *)); - char *s, *envcp, *appcp, *apphome; - char home[MAXPATHLEN]; /* application home */ - char separator[] = { PATH_SEPARATOR, '\0' }; - int size, i; - int strlenHome; - - s = getenv("CLASSPATH"); - if (s) { - /* 40 for -Denv.class.path= */ - envcp = (char *)MemAlloc(strlen(s) + 40); - sprintf(envcp, "-Denv.class.path=%s", s); - AddOption(envcp, NULL); - } - - if (!GetApplicationHome(home, sizeof(home))) { - ReportErrorMessage("Can't determine application home", JNI_TRUE); - return JNI_FALSE; - } - - /* 40 for '-Dapplication.home=' */ - apphome = (char *)MemAlloc(strlen(home) + 40); - sprintf(apphome, "-Dapplication.home=%s", home); - AddOption(apphome, NULL); - - /* How big is the application's classpath? */ - size = 40; /* 40: "-Djava.class.path=" */ - strlenHome = (int)strlen(home); - for (i = 0; i < NUM_APP_CLASSPATH; i++) { - size += strlenHome + (int)strlen(app_classpath[i]) + 1; /* 1: separator */ - } - appcp = (char *)MemAlloc(size + 1); - strcpy(appcp, "-Djava.class.path="); - for (i = 0; i < NUM_APP_CLASSPATH; i++) { - strcat(appcp, home); /* c:\program files\myapp */ - strcat(appcp, app_classpath[i]); /* \lib\myapp.jar */ - strcat(appcp, separator); /* ; */ - } - appcp[strlen(appcp)-1] = '\0'; /* remove trailing path separator */ - AddOption(appcp, NULL); - return JNI_TRUE; -} -#endif - -/* - * inject the -Dsun.java.command pseudo property into the args structure - * this pseudo property is used in the HotSpot VM to expose the - * Java class name and arguments to the main method to the VM. The - * HotSpot VM uses this pseudo property to store the Java class name - * (or jar file name) and the arguments to the class's main method - * to the instrumentation memory region. The sun.java.command pseudo - * property is not exported by HotSpot to the Java layer. - */ -void -SetJavaCommandLineProp(char *classname, char *jarfile, - int argc, char **argv) -{ - - int i = 0; - size_t len = 0; - char* javaCommand = NULL; - char* dashDstr = "-Dsun.java.command="; - - if (classname == NULL && jarfile == NULL) { - /* unexpected, one of these should be set. just return without - * setting the property - */ - return; - } - - /* if the class name is not set, then use the jarfile name */ - if (classname == NULL) { - classname = jarfile; - } - - /* determine the amount of memory to allocate assuming - * the individual components will be space separated - */ - len = strlen(classname); - for (i = 0; i < argc; i++) { - len += strlen(argv[i]) + 1; - } - - /* allocate the memory */ - javaCommand = (char*) MemAlloc(len + strlen(dashDstr) + 1); - - /* build the -D string */ - *javaCommand = '\0'; - strcat(javaCommand, dashDstr); - strcat(javaCommand, classname); - - for (i = 0; i < argc; i++) { - /* the components of the string are space separated. In - * the case of embedded white space, the relationship of - * the white space separated components to their true - * positional arguments will be ambiguous. This issue may - * be addressed in a future release. - */ - strcat(javaCommand, " "); - strcat(javaCommand, argv[i]); - } - - AddOption(javaCommand, NULL); -} - -/* - * JVM wants to know launcher type, so tell it. - */ -#ifdef GAMMA -void SetJavaLauncherProp() { - AddOption("-Dsun.java.launcher=" LAUNCHER_TYPE, NULL); -} -#endif - -/* - * Prints the version information from the java.version and other properties. - */ -static void -PrintJavaVersion(JNIEnv *env) -{ - jclass ver; - jmethodID print; - - NULL_CHECK(ver = FindBootStrapClass(env, "sun/misc/Version")); - NULL_CHECK(print = (*env)->GetStaticMethodID(env, ver, "print", "()V")); - - (*env)->CallStaticVoidMethod(env, ver, print); -} - -/* - * Prints default usage message. - */ -static void -PrintUsage(void) -{ - int i; - - fprintf(stdout, - "Usage: %s [-options] class [args...]\n" - " (to execute a class)\n" - " or %s [-options] -jar jarfile [args...]\n" - " (to execute a jar file)\n" - "\n" - "where options include:\n", - progname, - progname); - -#ifndef GAMMA - PrintMachineDependentOptions(); - - if ((knownVMs[0].flag == VM_KNOWN) || - (knownVMs[0].flag == VM_IF_SERVER_CLASS)) { - fprintf(stdout, " %s\t to select the \"%s\" VM\n", - knownVMs[0].name, knownVMs[0].name+1); - } - for (i=1; i\n" -" -classpath \n" -" A %c separated list of directories, JAR archives,\n" -" and ZIP archives to search for class files.\n" -" -D=\n" -" set a system property\n" -" -verbose[:class|gc|jni]\n" -" enable verbose output\n" -" -version print product version and exit\n" -" -version:\n" -" require the specified version to run\n" -" -showversion print product version and continue\n" -" -jre-restrict-search | -jre-no-restrict-search\n" -" include/exclude user private JREs in the version search\n" -" -? -help print this help message\n" -" -X print help on non-standard options\n" -" -ea[:...|:]\n" -" -enableassertions[:...|:]\n" -" enable assertions\n" -" -da[:...|:]\n" -" -disableassertions[:...|:]\n" -" disable assertions\n" -" -esa | -enablesystemassertions\n" -" enable system assertions\n" -" -dsa | -disablesystemassertions\n" -" disable system assertions\n" -" -agentlib:[=]\n" -" load native agent library , e.g. -agentlib:hprof\n" -" see also, -agentlib:jdwp=help and -agentlib:hprof=help\n" -" -agentpath:[=]\n" -" load native agent library by full pathname\n" -" -javaagent:[=]\n" -" load Java programming language agent, see java.lang.instrument\n" - - ,PATH_SEPARATOR); -} - -/* - * Print usage message for -X options. - */ -static jint -PrintXUsage(void) -{ - char path[MAXPATHLEN]; - char buf[128]; - size_t n; - FILE *fp; - - GetXUsagePath(path, sizeof(path)); - fp = fopen(path, "r"); - if (fp == 0) { - fprintf(stderr, "Can't open %s\n", path); - return 1; - } - while ((n = fread(buf, 1, sizeof(buf), fp)) != 0) { - fwrite(buf, 1, n, stdout); - } - fclose(fp); - return 0; -} - -#ifndef GAMMA - -/* - * Read the jvm.cfg file and fill the knownJVMs[] array. - * - * The functionality of the jvm.cfg file is subject to change without - * notice and the mechanism will be removed in the future. - * - * The lexical structure of the jvm.cfg file is as follows: - * - * jvmcfg := { vmLine } - * vmLine := knownLine - * | aliasLine - * | warnLine - * | ignoreLine - * | errorLine - * | predicateLine - * | commentLine - * knownLine := flag "KNOWN" EOL - * warnLine := flag "WARN" EOL - * ignoreLine := flag "IGNORE" EOL - * errorLine := flag "ERROR" EOL - * aliasLine := flag "ALIASED_TO" flag EOL - * predicateLine := flag "IF_SERVER_CLASS" flag EOL - * commentLine := "#" text EOL - * flag := "-" identifier - * - * The semantics are that when someone specifies a flag on the command line: - * - if the flag appears on a knownLine, then the identifier is used as - * the name of the directory holding the JVM library (the name of the JVM). - * - if the flag appears as the first flag on an aliasLine, the identifier - * of the second flag is used as the name of the JVM. - * - if the flag appears on a warnLine, the identifier is used as the - * name of the JVM, but a warning is generated. - * - if the flag appears on an ignoreLine, the identifier is recognized as the - * name of a JVM, but the identifier is ignored and the default vm used - * - if the flag appears on an errorLine, an error is generated. - * - if the flag appears as the first flag on a predicateLine, and - * the machine on which you are running passes the predicate indicated, - * then the identifier of the second flag is used as the name of the JVM, - * otherwise the identifier of the first flag is used as the name of the JVM. - * If no flag is given on the command line, the first vmLine of the jvm.cfg - * file determines the name of the JVM. - * PredicateLines are only interpreted on first vmLine of a jvm.cfg file, - * since they only make sense if someone hasn't specified the name of the - * JVM on the command line. - * - * The intent of the jvm.cfg file is to allow several JVM libraries to - * be installed in different subdirectories of a single JRE installation, - * for space-savings and convenience in testing. - * The intent is explicitly not to provide a full aliasing or predicate - * mechanism. - */ -jint -ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative) -{ - FILE *jvmCfg; - char jvmCfgName[MAXPATHLEN+20]; - char line[MAXPATHLEN+20]; - int cnt = 0; - int lineno = 0; - jlong start, end; - int vmType; - char *tmpPtr; - char *altVMName; - char *serverClassVMName; - static char *whiteSpace = " \t"; - if (_launcher_debug) { - start = CounterGet(); - } - - strcpy(jvmCfgName, jrepath); - strcat(jvmCfgName, FILESEP "lib" FILESEP); - strcat(jvmCfgName, arch); - strcat(jvmCfgName, FILESEP "jvm.cfg"); - - jvmCfg = fopen(jvmCfgName, "r"); - if (jvmCfg == NULL) { - if (!speculative) { - ReportErrorMessage2("Error: could not open `%s'", jvmCfgName, - JNI_TRUE); - exit(1); - } else { - return -1; - } - } - while (fgets(line, sizeof(line), jvmCfg) != NULL) { - vmType = VM_UNKNOWN; - lineno++; - if (line[0] == '#') - continue; - if (line[0] != '-') { - fprintf(stderr, "Warning: no leading - on line %d of `%s'\n", - lineno, jvmCfgName); - } - if (cnt >= knownVMsLimit) { - GrowKnownVMs(cnt); - } - line[strlen(line)-1] = '\0'; /* remove trailing newline */ - tmpPtr = line + strcspn(line, whiteSpace); - if (*tmpPtr == 0) { - fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n", - lineno, jvmCfgName); - } else { - /* Null-terminate this string for strdup below */ - *tmpPtr++ = 0; - tmpPtr += strspn(tmpPtr, whiteSpace); - if (*tmpPtr == 0) { - fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n", - lineno, jvmCfgName); - } else { - if (!strncmp(tmpPtr, "KNOWN", strlen("KNOWN"))) { - vmType = VM_KNOWN; - } else if (!strncmp(tmpPtr, "ALIASED_TO", strlen("ALIASED_TO"))) { - tmpPtr += strcspn(tmpPtr, whiteSpace); - if (*tmpPtr != 0) { - tmpPtr += strspn(tmpPtr, whiteSpace); - } - if (*tmpPtr == 0) { - fprintf(stderr, "Warning: missing VM alias on line %d of `%s'\n", - lineno, jvmCfgName); - } else { - /* Null terminate altVMName */ - altVMName = tmpPtr; - tmpPtr += strcspn(tmpPtr, whiteSpace); - *tmpPtr = 0; - vmType = VM_ALIASED_TO; - } - } else if (!strncmp(tmpPtr, "WARN", strlen("WARN"))) { - vmType = VM_WARN; - } else if (!strncmp(tmpPtr, "IGNORE", strlen("IGNORE"))) { - vmType = VM_IGNORE; - } else if (!strncmp(tmpPtr, "ERROR", strlen("ERROR"))) { - vmType = VM_ERROR; - } else if (!strncmp(tmpPtr, - "IF_SERVER_CLASS", - strlen("IF_SERVER_CLASS"))) { - tmpPtr += strcspn(tmpPtr, whiteSpace); - if (*tmpPtr != 0) { - tmpPtr += strspn(tmpPtr, whiteSpace); - } - if (*tmpPtr == 0) { - fprintf(stderr, "Warning: missing server class VM on line %d of `%s'\n", - lineno, jvmCfgName); - } else { - /* Null terminate server class VM name */ - serverClassVMName = tmpPtr; - tmpPtr += strcspn(tmpPtr, whiteSpace); - *tmpPtr = 0; - vmType = VM_IF_SERVER_CLASS; - } - } else { - fprintf(stderr, "Warning: unknown VM type on line %d of `%s'\n", - lineno, &jvmCfgName[0]); - vmType = VM_KNOWN; - } - } - } - - if (_launcher_debug) - printf("jvm.cfg[%d] = ->%s<-\n", cnt, line); - if (vmType != VM_UNKNOWN) { - knownVMs[cnt].name = strdup(line); - knownVMs[cnt].flag = vmType; - switch (vmType) { - default: - break; - case VM_ALIASED_TO: - knownVMs[cnt].alias = strdup(altVMName); - if (_launcher_debug) { - printf(" name: %s vmType: %s alias: %s\n", - knownVMs[cnt].name, "VM_ALIASED_TO", knownVMs[cnt].alias); - } - break; - case VM_IF_SERVER_CLASS: - knownVMs[cnt].server_class = strdup(serverClassVMName); - if (_launcher_debug) { - printf(" name: %s vmType: %s server_class: %s\n", - knownVMs[cnt].name, "VM_IF_SERVER_CLASS", knownVMs[cnt].server_class); - } - break; - } - cnt++; - } - } - fclose(jvmCfg); - knownVMsCount = cnt; - - if (_launcher_debug) { - end = CounterGet(); - printf("%ld micro seconds to parse jvm.cfg\n", - (long)(jint)Counter2Micros(end-start)); - } - - return cnt; -} - - -static void -GrowKnownVMs(int minimum) -{ - struct vmdesc* newKnownVMs; - int newMax; - - newMax = (knownVMsLimit == 0 ? INIT_MAX_KNOWN_VMS : (2 * knownVMsLimit)); - if (newMax <= minimum) { - newMax = minimum; - } - newKnownVMs = (struct vmdesc*) MemAlloc(newMax * sizeof(struct vmdesc)); - if (knownVMs != NULL) { - memcpy(newKnownVMs, knownVMs, knownVMsLimit * sizeof(struct vmdesc)); - } - free(knownVMs); - knownVMs = newKnownVMs; - knownVMsLimit = newMax; -} - - -/* Returns index of VM or -1 if not found */ -static int -KnownVMIndex(const char* name) -{ - int i; - if (strncmp(name, "-J", 2) == 0) name += 2; - for (i = 0; i < knownVMsCount; i++) { - if (!strcmp(name, knownVMs[i].name)) { - return i; - } - } - return -1; -} - -static void -FreeKnownVMs() -{ - int i; - for (i = 0; i < knownVMsCount; i++) { - free(knownVMs[i].name); - knownVMs[i].name = NULL; - } - free(knownVMs); -} - -#endif /* ifndef GAMMA */ diff --git a/hotspot/src/os/solaris/launcher/java_md.c b/hotspot/src/os/solaris/launcher/java_md.c deleted file mode 100644 index 5c62b6450aa..00000000000 --- a/hotspot/src/os/solaris/launcher/java_md.c +++ /dev/null @@ -1,1849 +0,0 @@ -/* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -/* - * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK, - * search "GAMMA" for gamma specific changes. - */ - -#include "java.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef GAMMA -#include "manifest_info.h" -#include "version_comp.h" -#endif - -#define JVM_DLL "libjvm.so" -#define JAVA_DLL "libjava.so" - -#ifndef GAMMA /* launcher.make defines ARCH */ - -/* - * If a processor / os combination has the ability to run binaries of - * two data models and cohabitation of jre/jdk bits with both data - * models is supported, then DUAL_MODE is defined. When DUAL_MODE is - * defined, the architecture names for the narrow and wide version of - * the architecture are defined in BIG_ARCH and SMALL_ARCH. Currently - * only Solaris on sparc/sparcv9 and i586/amd64 is DUAL_MODE; linux - * i586/amd64 could be defined as DUAL_MODE but that is not the - * current policy. - */ - -#ifdef _LP64 - -# ifdef ia64 -# define ARCH "ia64" -# elif defined(amd64) -# define ARCH "amd64" -# elif defined(__sparc) -# define ARCH "sparcv9" -# else -# define ARCH "unknown" /* unknown 64-bit architecture */ -# endif - -#else /* 32-bit data model */ - -# ifdef i586 -# define ARCH "i386" -# elif defined(__sparc) -# define ARCH "sparc" -# endif - -#endif /* _LP64 */ - -#ifdef __sun -# define DUAL_MODE -# ifdef __sparc -# define BIG_ARCH "sparcv9" -# define SMALL_ARCH "sparc" -# else -# define BIG_ARCH "amd64" -# define SMALL_ARCH "i386" -# endif -# include -# include -# include -#else -# ifndef ARCH -# include -# endif -#endif - -#endif /* ifndef GAMMA */ - -/* pointer to environment */ -extern char **environ; - -#ifndef GAMMA - -/* - * A collection of useful strings. One should think of these as #define - * entries, but actual strings can be more efficient (with many compilers). - */ -#ifdef __linux__ -static const char *system_dir = "/usr/java"; -static const char *user_dir = "/java"; -#else /* Solaris */ -static const char *system_dir = "/usr/jdk"; -static const char *user_dir = "/jdk"; -#endif - -#endif /* ifndef GAMMA */ - -/* - * Flowchart of launcher execs and options processing on unix - * - * The selection of the proper vm shared library to open depends on - * several classes of command line options, including vm "flavor" - * options (-client, -server) and the data model options, -d32 and - * -d64, as well as a version specification which may have come from - * the command line or from the manifest of an executable jar file. - * The vm selection options are not passed to the running - * virtual machine; they must be screened out by the launcher. - * - * The version specification (if any) is processed first by the - * platform independent routine SelectVersion. This may result in - * the exec of the specified launcher version. - * - * Typically, the launcher execs at least once to ensure a suitable - * LD_LIBRARY_PATH is in effect for the process. The first exec - * screens out all the data model options; leaving the choice of data - * model implicit in the binary selected to run. However, in case no - * exec is done, the data model options are screened out before the vm - * is invoked. - * - * incoming argv ------------------------------ - * | | - * \|/ | - * CheckJVMType | - * (removes -client, -server, etc.) | - * \|/ - * CreateExecutionEnvironment - * (removes -d32 and -d64, - * determines desired data model, - * sets up LD_LIBRARY_PATH, - * and exec's) - * | - * -------------------------------------------- - * | - * \|/ - * exec child 1 incoming argv ----------------- - * | | - * \|/ | - * CheckJVMType | - * (removes -client, -server, etc.) | - * | \|/ - * | CreateExecutionEnvironment - * | (verifies desired data model - * | is running and acceptable - * | LD_LIBRARY_PATH; - * | no-op in child) - * | - * \|/ - * TranslateDashJArgs... - * (Prepare to pass args to vm) - * | - * | - * | - * \|/ - * ParseArguments - * (ignores -d32 and -d64, - * processes version options, - * creates argument list for vm, - * etc.) - * - */ - -static char *SetExecname(char **argv); -static char * GetExecname(); -static jboolean GetJVMPath(const char *jrepath, const char *jvmtype, - char *jvmpath, jint jvmpathsize, char * arch); -static jboolean GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative); - -const char * -GetArch() -{ - static char *arch = NULL; - static char buf[12]; - if (arch) { - return arch; - } - -#ifdef ARCH - strcpy(buf, ARCH); -#else - sysinfo(SI_ARCHITECTURE, buf, sizeof(buf)); -#endif - arch = buf; - return arch; -} - -void -CreateExecutionEnvironment(int *_argcp, - char ***_argvp, - char jrepath[], - jint so_jrepath, - char jvmpath[], - jint so_jvmpath, - char **original_argv) { - /* - * First, determine if we are running the desired data model. If we - * are running the desired data model, all the error messages - * associated with calling GetJREPath, ReadKnownVMs, etc. should be - * output. However, if we are not running the desired data model, - * some of the errors should be suppressed since it is more - * informative to issue an error message based on whether or not the - * os/processor combination has dual mode capabilities. - */ - - char *execname = NULL; - int original_argc = *_argcp; - jboolean jvmpathExists; - - /* Compute the name of the executable */ - execname = SetExecname(*_argvp); - -#ifndef GAMMA - /* Set the LD_LIBRARY_PATH environment variable, check data model - flags, and exec process, if needed */ - { - char *arch = (char *)GetArch(); /* like sparc or sparcv9 */ - char * jvmtype = NULL; - int argc = *_argcp; - char **argv = original_argv; - - char *runpath = NULL; /* existing effective LD_LIBRARY_PATH - setting */ - - int running = /* What data model is being ILP32 => - 32 bit vm; LP64 => 64 bit vm */ -#ifdef _LP64 - 64; -#else - 32; -#endif - - int wanted = running; /* What data mode is being - asked for? Current model is - fine unless another model - is asked for */ - - char* new_runpath = NULL; /* desired new LD_LIBRARY_PATH string */ - char* newpath = NULL; /* path on new LD_LIBRARY_PATH */ - char* lastslash = NULL; - - char** newenvp = NULL; /* current environment */ - - char** newargv = NULL; - int newargc = 0; -#ifdef __sun - char* dmpath = NULL; /* data model specific LD_LIBRARY_PATH, - Solaris only */ -#endif - - /* - * Starting in 1.5, all unix platforms accept the -d32 and -d64 - * options. On platforms where only one data-model is supported - * (e.g. ia-64 Linux), using the flag for the other data model is - * an error and will terminate the program. - */ - - { /* open new scope to declare local variables */ - int i; - - newargv = (char **)MemAlloc((argc+1) * sizeof(*newargv)); - newargv[newargc++] = argv[0]; - - /* scan for data model arguments and remove from argument list; - last occurrence determines desired data model */ - for (i=1; i < argc; i++) { - - if (strcmp(argv[i], "-J-d64") == 0 || strcmp(argv[i], "-d64") == 0) { - wanted = 64; - continue; - } - if (strcmp(argv[i], "-J-d32") == 0 || strcmp(argv[i], "-d32") == 0) { - wanted = 32; - continue; - } - newargv[newargc++] = argv[i]; - -#ifdef JAVA_ARGS - if (argv[i][0] != '-') - continue; -#else - if (strcmp(argv[i], "-classpath") == 0 || strcmp(argv[i], "-cp") == 0) { - i++; - if (i >= argc) break; - newargv[newargc++] = argv[i]; - continue; - } - if (argv[i][0] != '-') { i++; break; } -#endif - } - - /* copy rest of args [i .. argc) */ - while (i < argc) { - newargv[newargc++] = argv[i++]; - } - newargv[newargc] = NULL; - - /* - * newargv has all proper arguments here - */ - - argc = newargc; - argv = newargv; - } - - /* If the data model is not changing, it is an error if the - jvmpath does not exist */ - if (wanted == running) { - /* Find out where the JRE is that we will be using. */ - if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) { - fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n"); - exit(2); - } - - /* Find the specified JVM type */ - if (ReadKnownVMs(jrepath, arch, JNI_FALSE) < 1) { - fprintf(stderr, "Error: no known VMs. (check for corrupt jvm.cfg file)\n"); - exit(1); - } - - jvmpath[0] = '\0'; - jvmtype = CheckJvmType(_argcp, _argvp, JNI_FALSE); - - if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch )) { - fprintf(stderr, "Error: no `%s' JVM at `%s'.\n", jvmtype, jvmpath); - exit(4); - } - } else { /* do the same speculatively or exit */ -#ifdef DUAL_MODE - if (running != wanted) { - /* Find out where the JRE is that we will be using. */ - if (!GetJREPath(jrepath, so_jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), JNI_TRUE)) { - goto EndDataModelSpeculate; - } - - /* - * Read in jvm.cfg for target data model and process vm - * selection options. - */ - if (ReadKnownVMs(jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), JNI_TRUE) < 1) { - goto EndDataModelSpeculate; - } - jvmpath[0] = '\0'; - jvmtype = CheckJvmType(_argcp, _argvp, JNI_TRUE); - /* exec child can do error checking on the existence of the path */ - jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, - ((wanted==64)?BIG_ARCH:SMALL_ARCH)); - - } - EndDataModelSpeculate: /* give up and let other code report error message */ - ; -#else - fprintf(stderr, "Running a %d-bit JVM is not supported on this platform.\n", wanted); - exit(1); -#endif - } - - /* - * We will set the LD_LIBRARY_PATH as follows: - * - * o $JVMPATH (directory portion only) - * o $JRE/lib/$ARCH - * o $JRE/../lib/$ARCH - * - * followed by the user's previous effective LD_LIBRARY_PATH, if - * any. - */ - -#ifdef __sun - /* - * Starting in Solaris 7, ld.so.1 supports three LD_LIBRARY_PATH - * variables: - * - * 1. LD_LIBRARY_PATH -- used for 32 and 64 bit searches if - * data-model specific variables are not set. - * - * 2. LD_LIBRARY_PATH_64 -- overrides and replaces LD_LIBRARY_PATH - * for 64-bit binaries. - * - * 3. LD_LIBRARY_PATH_32 -- overrides and replaces LD_LIBRARY_PATH - * for 32-bit binaries. - * - * The vm uses LD_LIBRARY_PATH to set the java.library.path system - * property. To shield the vm from the complication of multiple - * LD_LIBRARY_PATH variables, if the appropriate data model - * specific variable is set, we will act as if LD_LIBRARY_PATH had - * the value of the data model specific variant and the data model - * specific variant will be unset. Note that the variable for the - * *wanted* data model must be used (if it is set), not simply the - * current running data model. - */ - - switch(wanted) { - case 0: - if(running == 32) { - dmpath = getenv("LD_LIBRARY_PATH_32"); - wanted = 32; - } - else { - dmpath = getenv("LD_LIBRARY_PATH_64"); - wanted = 64; - } - break; - - case 32: - dmpath = getenv("LD_LIBRARY_PATH_32"); - break; - - case 64: - dmpath = getenv("LD_LIBRARY_PATH_64"); - break; - - default: - fprintf(stderr, "Improper value at line %d.", __LINE__); - exit(1); /* unknown value in wanted */ - break; - } - - /* - * If dmpath is NULL, the relevant data model specific variable is - * not set and normal LD_LIBRARY_PATH should be used. - */ - if( dmpath == NULL) { - runpath = getenv("LD_LIBRARY_PATH"); - } - else { - runpath = dmpath; - } -#else - /* - * If not on Solaris, assume only a single LD_LIBRARY_PATH - * variable. - */ - runpath = getenv("LD_LIBRARY_PATH"); -#endif /* __sun */ - -#ifdef __linux - /* - * On linux, if a binary is running as sgid or suid, glibc sets - * LD_LIBRARY_PATH to the empty string for security purposes. (In - * contrast, on Solaris the LD_LIBRARY_PATH variable for a - * privileged binary does not lose its settings; but the dynamic - * linker does apply more scrutiny to the path.) The launcher uses - * the value of LD_LIBRARY_PATH to prevent an exec loop. - * Therefore, if we are running sgid or suid, this function's - * setting of LD_LIBRARY_PATH will be ineffective and we should - * return from the function now. Getting the right libraries to - * be found must be handled through other mechanisms. - */ - if((getgid() != getegid()) || (getuid() != geteuid()) ) { - return; - } -#endif - - /* runpath contains current effective LD_LIBRARY_PATH setting */ - - jvmpath = strdup(jvmpath); - new_runpath = MemAlloc( ((runpath!=NULL)?strlen(runpath):0) + - 2*strlen(jrepath) + 2*strlen(arch) + - strlen(jvmpath) + 52); - newpath = new_runpath + strlen("LD_LIBRARY_PATH="); - - - /* - * Create desired LD_LIBRARY_PATH value for target data model. - */ - { - /* remove the name of the .so from the JVM path */ - lastslash = strrchr(jvmpath, '/'); - if (lastslash) - *lastslash = '\0'; - - - /* jvmpath, ((running != wanted)?((wanted==64)?"/"BIG_ARCH:"/.."):""), */ - - sprintf(new_runpath, "LD_LIBRARY_PATH=" - "%s:" - "%s/lib/%s:" - "%s/../lib/%s", - jvmpath, -#ifdef DUAL_MODE - jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), - jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH) -#else - jrepath, arch, - jrepath, arch -#endif - ); - - - /* - * Check to make sure that the prefix of the current path is the - * desired environment variable setting. - */ - if (runpath != NULL && - strncmp(newpath, runpath, strlen(newpath))==0 && - (runpath[strlen(newpath)] == 0 || runpath[strlen(newpath)] == ':') && - (running == wanted) /* data model does not have to be changed */ -#ifdef __sun - && (dmpath == NULL) /* data model specific variables not set */ -#endif - ) { - - return; - - } - } - - /* - * Place the desired environment setting onto the prefix of - * LD_LIBRARY_PATH. Note that this prevents any possible infinite - * loop of execv() because we test for the prefix, above. - */ - if (runpath != 0) { - strcat(new_runpath, ":"); - strcat(new_runpath, runpath); - } - - if( putenv(new_runpath) != 0) { - exit(1); /* problem allocating memory; LD_LIBRARY_PATH not set - properly */ - } - - /* - * Unix systems document that they look at LD_LIBRARY_PATH only - * once at startup, so we have to re-exec the current executable - * to get the changed environment variable to have an effect. - */ - -#ifdef __sun - /* - * If dmpath is not NULL, remove the data model specific string - * in the environment for the exec'ed child. - */ - - if( dmpath != NULL) - (void)UnsetEnv((wanted==32)?"LD_LIBRARY_PATH_32":"LD_LIBRARY_PATH_64"); -#endif - - newenvp = environ; - - { - char *newexec = execname; -#ifdef DUAL_MODE - /* - * If the data model is being changed, the path to the - * executable must be updated accordingly; the executable name - * and directory the executable resides in are separate. In the - * case of 32 => 64, the new bits are assumed to reside in, e.g. - * "olddir/BIGARCH/execname"; in the case of 64 => 32, - * the bits are assumed to be in "olddir/../execname". For example, - * - * olddir/sparcv9/execname - * olddir/amd64/execname - * - * for Solaris SPARC and Linux amd64, respectively. - */ - - if (running != wanted) { - char *oldexec = strcpy(MemAlloc(strlen(execname) + 1), execname); - char *olddir = oldexec; - char *oldbase = strrchr(oldexec, '/'); - - - newexec = MemAlloc(strlen(execname) + 20); - *oldbase++ = 0; - sprintf(newexec, "%s/%s/%s", olddir, - ((wanted==64) ? BIG_ARCH : ".."), oldbase); - argv[0] = newexec; - } -#endif - - execve(newexec, argv, newenvp); - perror("execve()"); - - fprintf(stderr, "Error trying to exec %s.\n", newexec); - fprintf(stderr, "Check if file exists and permissions are set correctly.\n"); - -#ifdef DUAL_MODE - if (running != wanted) { - fprintf(stderr, "Failed to start a %d-bit JVM process from a %d-bit JVM.\n", - wanted, running); -# ifdef __sun - -# ifdef __sparc - fprintf(stderr, "Verify all necessary J2SE components have been installed.\n" ); - fprintf(stderr, - "(Solaris SPARC 64-bit components must be installed after 32-bit components.)\n" ); -# else - fprintf(stderr, "Either 64-bit processes are not supported by this platform\n"); - fprintf(stderr, "or the 64-bit components have not been installed.\n"); -# endif - } -# endif -#endif - - } - - exit(1); - } - -#else /* ifndef GAMMA */ - - /* gamma launcher is simpler in that it doesn't handle VM flavors, data */ - /* model, LD_LIBRARY_PATH, etc. Assuming everything is set-up correctly */ - /* all we need to do here is to return correct path names. See also */ - /* GetJVMPath() and GetApplicationHome(). */ - - { char *arch = (char *)GetArch(); /* like sparc or sparcv9 */ - char *p; - - if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) { - fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n"); - exit(2); - } - - if (!GetJVMPath(jrepath, NULL, jvmpath, so_jvmpath, arch )) { - fprintf(stderr, "Error: no JVM at `%s'.\n", jvmpath); - exit(4); - } - } - -#endif /* ifndef GAMMA */ -} - - -/* - * On Solaris VM choosing is done by the launcher (java.c). - */ -static jboolean -GetJVMPath(const char *jrepath, const char *jvmtype, - char *jvmpath, jint jvmpathsize, char * arch) -{ - struct stat s; - -#ifndef GAMMA - if (strchr(jvmtype, '/')) { - sprintf(jvmpath, "%s/" JVM_DLL, jvmtype); - } else { - sprintf(jvmpath, "%s/lib/%s/%s/" JVM_DLL, jrepath, arch, jvmtype); - } -#else - /* For gamma launcher, JVM is either built-in or in the same directory. */ - /* Either way we return "/libjvm.so" where is the */ - /* directory where gamma launcher is located. */ - - char *p; - - snprintf(jvmpath, jvmpathsize, "%s", GetExecname()); - p = strrchr(jvmpath, '/'); - if (p) { - /* replace executable name with libjvm.so */ - snprintf(p + 1, jvmpathsize - (p + 1 - jvmpath), "%s", JVM_DLL); - } else { - /* this case shouldn't happen */ - snprintf(jvmpath, jvmpathsize, "%s", JVM_DLL); - } -#endif - - if (_launcher_debug) - printf("Does `%s' exist ... ", jvmpath); - - if (stat(jvmpath, &s) == 0) { - if (_launcher_debug) - printf("yes.\n"); - return JNI_TRUE; - } else { - if (_launcher_debug) - printf("no.\n"); - return JNI_FALSE; - } -} - -/* - * Find path to JRE based on .exe's location or registry settings. - */ -static jboolean -GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative) -{ - char libjava[MAXPATHLEN]; - - if (GetApplicationHome(path, pathsize)) { - /* Is JRE co-located with the application? */ - sprintf(libjava, "%s/lib/%s/" JAVA_DLL, path, arch); - if (access(libjava, F_OK) == 0) { - goto found; - } - - /* Does the app ship a private JRE in /jre directory? */ - sprintf(libjava, "%s/jre/lib/%s/" JAVA_DLL, path, arch); - if (access(libjava, F_OK) == 0) { - strcat(path, "/jre"); - goto found; - } - } - - if (!speculative) - fprintf(stderr, "Error: could not find " JAVA_DLL "\n"); - return JNI_FALSE; - - found: - if (_launcher_debug) - printf("JRE path is %s\n", path); - return JNI_TRUE; -} - -jboolean -LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn) -{ -#ifdef GAMMA - /* JVM is directly linked with gamma launcher; no dlopen() */ - ifn->CreateJavaVM = JNI_CreateJavaVM; - ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs; - return JNI_TRUE; -#else - Dl_info dlinfo; - void *libjvm; - - if (_launcher_debug) { - printf("JVM path is %s\n", jvmpath); - } - - libjvm = dlopen(jvmpath, RTLD_NOW + RTLD_GLOBAL); - if (libjvm == NULL) { -#if defined(__sparc) && !defined(_LP64) /* i.e. 32-bit sparc */ - FILE * fp; - Elf32_Ehdr elf_head; - int count; - int location; - - fp = fopen(jvmpath, "r"); - if(fp == NULL) - goto error; - - /* read in elf header */ - count = fread((void*)(&elf_head), sizeof(Elf32_Ehdr), 1, fp); - fclose(fp); - if(count < 1) - goto error; - - /* - * Check for running a server vm (compiled with -xarch=v8plus) - * on a stock v8 processor. In this case, the machine type in - * the elf header would not be included the architecture list - * provided by the isalist command, which is turn is gotten from - * sysinfo. This case cannot occur on 64-bit hardware and thus - * does not have to be checked for in binaries with an LP64 data - * model. - */ - if(elf_head.e_machine == EM_SPARC32PLUS) { - char buf[257]; /* recommended buffer size from sysinfo man - page */ - long length; - char* location; - - length = sysinfo(SI_ISALIST, buf, 257); - if(length > 0) { - location = strstr(buf, "sparcv8plus "); - if(location == NULL) { - fprintf(stderr, "SPARC V8 processor detected; Server compiler requires V9 or better.\n"); - fprintf(stderr, "Use Client compiler on V8 processors.\n"); - fprintf(stderr, "Could not create the Java virtual machine.\n"); - return JNI_FALSE; - } - } - } -#endif - fprintf(stderr, "dl failure on line %d", __LINE__); - goto error; - } - - ifn->CreateJavaVM = (CreateJavaVM_t) - dlsym(libjvm, "JNI_CreateJavaVM"); - if (ifn->CreateJavaVM == NULL) - goto error; - - ifn->GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t) - dlsym(libjvm, "JNI_GetDefaultJavaVMInitArgs"); - if (ifn->GetDefaultJavaVMInitArgs == NULL) - goto error; - - return JNI_TRUE; - -error: - fprintf(stderr, "Error: failed %s, because %s\n", jvmpath, dlerror()); - return JNI_FALSE; -#endif /* GAMMA */ -} - -/* - * Get the path to the file that has the usage message for -X options. - */ -void -GetXUsagePath(char *buf, jint bufsize) -{ - static const char Xusage_txt[] = "/Xusage.txt"; - Dl_info dlinfo; - - /* we use RTLD_NOW because of problems with ld.so.1 and green threads */ - dladdr(dlsym(dlopen(JVM_DLL, RTLD_NOW), "JNI_CreateJavaVM"), &dlinfo); - strncpy(buf, (char *)dlinfo.dli_fname, bufsize - sizeof(Xusage_txt)); - - buf[bufsize-1] = '\0'; - strcpy(strrchr(buf, '/'), Xusage_txt); -} - -/* - * If app is "/foo/bin/javac", or "/foo/bin/sparcv9/javac" then put - * "/foo" into buf. - */ -jboolean -GetApplicationHome(char *buf, jint bufsize) -{ -#ifdef __linux__ - char *execname = GetExecname(); - if (execname) { - strncpy(buf, execname, bufsize-1); - buf[bufsize-1] = '\0'; - } else { - return JNI_FALSE; - } -#else - Dl_info dlinfo; - - dladdr((void *)GetApplicationHome, &dlinfo); - if (realpath(dlinfo.dli_fname, buf) == NULL) { - fprintf(stderr, "Error: realpath(`%s') failed.\n", dlinfo.dli_fname); - return JNI_FALSE; - } -#endif - -#ifdef GAMMA - { - /* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */ - char* java_home_var = getenv("JAVA_HOME"); - if (java_home_var == NULL) { - printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n"); - return JNI_FALSE; - } - snprintf(buf, bufsize, "%s", java_home_var); - } -#else - if (strrchr(buf, '/') == 0) { - buf[0] = '\0'; - return JNI_FALSE; - } - *(strrchr(buf, '/')) = '\0'; /* executable file */ - if (strlen(buf) < 4 || strrchr(buf, '/') == 0) { - buf[0] = '\0'; - return JNI_FALSE; - } - if (strcmp("/bin", buf + strlen(buf) - 4) != 0) - *(strrchr(buf, '/')) = '\0'; /* sparcv9 or amd64 */ - if (strlen(buf) < 4 || strcmp("/bin", buf + strlen(buf) - 4) != 0) { - buf[0] = '\0'; - return JNI_FALSE; - } - *(strrchr(buf, '/')) = '\0'; /* bin */ -#endif /* GAMMA */ - - return JNI_TRUE; -} - - -/* - * Return true if the named program exists - */ -static int -ProgramExists(char *name) -{ - struct stat sb; - if (stat(name, &sb) != 0) return 0; - if (S_ISDIR(sb.st_mode)) return 0; - return (sb.st_mode & S_IEXEC) != 0; -} - - -/* - * Find a command in a directory, returning the path. - */ -static char * -Resolve(char *indir, char *cmd) -{ - char name[PATH_MAX + 2], *real; - - if ((strlen(indir) + strlen(cmd) + 1) > PATH_MAX) return 0; - sprintf(name, "%s%c%s", indir, FILE_SEPARATOR, cmd); - if (!ProgramExists(name)) return 0; - real = MemAlloc(PATH_MAX + 2); - if (!realpath(name, real)) - strcpy(real, name); - return real; -} - - -/* - * Find a path for the executable - */ -static char * -FindExecName(char *program) -{ - char cwdbuf[PATH_MAX+2]; - char *path; - char *tmp_path; - char *f; - char *result = NULL; - - /* absolute path? */ - if (*program == FILE_SEPARATOR || - (FILE_SEPARATOR=='\\' && strrchr(program, ':'))) - return Resolve("", program+1); - - /* relative path? */ - if (strrchr(program, FILE_SEPARATOR) != 0) { - char buf[PATH_MAX+2]; - return Resolve(getcwd(cwdbuf, sizeof(cwdbuf)), program); - } - - /* from search path? */ - path = getenv("PATH"); - if (!path || !*path) path = "."; - tmp_path = MemAlloc(strlen(path) + 2); - strcpy(tmp_path, path); - - for (f=tmp_path; *f && result==0; ) { - char *s = f; - while (*f && (*f != PATH_SEPARATOR)) ++f; - if (*f) *f++ = 0; - if (*s == FILE_SEPARATOR) - result = Resolve(s, program); - else { - /* relative path element */ - char dir[2*PATH_MAX]; - sprintf(dir, "%s%c%s", getcwd(cwdbuf, sizeof(cwdbuf)), - FILE_SEPARATOR, s); - result = Resolve(dir, program); - } - if (result != 0) break; - } - - free(tmp_path); - return result; -} - - -/* Store the name of the executable once computed */ -static char *execname = NULL; - -/* - * Compute the name of the executable - * - * In order to re-exec securely we need the absolute path of the - * executable. On Solaris getexecname(3c) may not return an absolute - * path so we use dladdr to get the filename of the executable and - * then use realpath to derive an absolute path. From Solaris 9 - * onwards the filename returned in DL_info structure from dladdr is - * an absolute pathname so technically realpath isn't required. - * On Linux we read the executable name from /proc/self/exe. - * As a fallback, and for platforms other than Solaris and Linux, - * we use FindExecName to compute the executable name. - */ -static char * -SetExecname(char **argv) -{ - char* exec_path = NULL; - - if (execname != NULL) /* Already determined */ - return (execname); - -#if defined(__sun) - { - Dl_info dlinfo; - if (dladdr((void*)&SetExecname, &dlinfo)) { - char *resolved = (char*)MemAlloc(PATH_MAX+1); - if (resolved != NULL) { - exec_path = realpath(dlinfo.dli_fname, resolved); - if (exec_path == NULL) { - free(resolved); - } - } - } - } -#elif defined(__linux__) - { - const char* self = "/proc/self/exe"; - char buf[PATH_MAX+1]; - int len = readlink(self, buf, PATH_MAX); - if (len >= 0) { - buf[len] = '\0'; /* readlink doesn't nul terminate */ - exec_path = strdup(buf); - } - } -#else /* !__sun && !__linux */ - { - /* Not implemented */ - } -#endif - - if (exec_path == NULL) { - exec_path = FindExecName(argv[0]); - } - execname = exec_path; - return exec_path; -} - -/* - * Return the name of the executable. Used in java_md.c to find the JRE area. - */ -static char * -GetExecname() { - return execname; -} - -void ReportErrorMessage(char * message, jboolean always) { - if (always) { - fprintf(stderr, "%s\n", message); - } -} - -void ReportErrorMessage2(char * format, char * string, jboolean always) { - if (always) { - fprintf(stderr, format, string); - fprintf(stderr, "\n"); - } -} - -void ReportExceptionDescription(JNIEnv * env) { - (*env)->ExceptionDescribe(env); -} - -/* - * Return JNI_TRUE for an option string that has no effect but should - * _not_ be passed on to the vm; return JNI_FALSE otherwise. On - * Solaris SPARC, this screening needs to be done if: - * 1) LD_LIBRARY_PATH does _not_ need to be reset and - * 2) -d32 or -d64 is passed to a binary with a matching data model - * (the exec in SetLibraryPath removes -d options and points the - * exec to the proper binary). When this exec is not done, these options - * would end up getting passed onto the vm. - */ -jboolean RemovableMachineDependentOption(char * option) { - /* - * Unconditionally remove both -d32 and -d64 options since only - * the last such options has an effect; e.g. - * java -d32 -d64 -d32 -version - * is equivalent to - * java -d32 -version - */ - - if( (strcmp(option, "-d32") == 0 ) || - (strcmp(option, "-d64") == 0 )) - return JNI_TRUE; - else - return JNI_FALSE; -} - -void PrintMachineDependentOptions() { - fprintf(stdout, - " -d32 use a 32-bit data model if available\n" - "\n" - " -d64 use a 64-bit data model if available\n"); - return; -} - -#ifndef GAMMA /* gamma launcher does not have ergonomics */ - -/* - * The following methods (down to ServerClassMachine()) answer - * the question about whether a machine is a "server-class" - * machine. A server-class machine is loosely defined as one - * with 2 or more processors and 2 gigabytes or more physical - * memory. The definition of a processor is a physical package, - * not a hyperthreaded chip masquerading as a multi-processor. - * The definition of memory is also somewhat fuzzy, since x86 - * machines seem not to report all the memory in their DIMMs, we - * think because of memory mapping of graphics cards, etc. - * - * This code is somewhat more confused with #ifdef's than we'd - * like because this file is used by both Solaris and Linux - * platforms, and so needs to be parameterized for SPARC and - * i586 hardware. The other Linux platforms (amd64 and ia64) - * don't even ask this question, because they only come with - * server JVMs. */ - -# define KB (1024UL) -# define MB (1024UL * KB) -# define GB (1024UL * MB) - -/* Compute physical memory by asking the OS */ -uint64_t -physical_memory(void) { - const uint64_t pages = (uint64_t) sysconf(_SC_PHYS_PAGES); - const uint64_t page_size = (uint64_t) sysconf(_SC_PAGESIZE); - const uint64_t result = pages * page_size; -# define UINT64_FORMAT "%" PRIu64 - - if (_launcher_debug) { - printf("pages: " UINT64_FORMAT - " page_size: " UINT64_FORMAT - " physical memory: " UINT64_FORMAT " (%.3fGB)\n", - pages, page_size, result, result / (double) GB); - } - return result; -} - -#if defined(__sun) && defined(__sparc) - -/* Methods for solaris-sparc: these are easy. */ - -/* Ask the OS how many processors there are. */ -unsigned long -physical_processors(void) { - const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF); - - if (_launcher_debug) { - printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors); - } - return sys_processors; -} - -/* The solaris-sparc version of the "server-class" predicate. */ -jboolean -solaris_sparc_ServerClassMachine(void) { - jboolean result = JNI_FALSE; - /* How big is a server class machine? */ - const unsigned long server_processors = 2UL; - const uint64_t server_memory = 2UL * GB; - const uint64_t actual_memory = physical_memory(); - - /* Is this a server class machine? */ - if (actual_memory >= server_memory) { - const unsigned long actual_processors = physical_processors(); - if (actual_processors >= server_processors) { - result = JNI_TRUE; - } - } - if (_launcher_debug) { - printf("solaris_" ARCH "_ServerClassMachine: %s\n", - (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE")); - } - return result; -} - -#endif /* __sun && __sparc */ - -#if defined(__sun) && defined(i586) - -/* - * A utility method for asking the CPU about itself. - * There's a corresponding version of linux-i586 - * because the compilers are different. - */ -void -get_cpuid(uint32_t arg, - uint32_t* eaxp, - uint32_t* ebxp, - uint32_t* ecxp, - uint32_t* edxp) { -#ifdef _LP64 - asm( - /* rbx is a callee-saved register */ - " movq %rbx, %r11 \n" - /* rdx and rcx are 3rd and 4th argument registers */ - " movq %rdx, %r10 \n" - " movq %rcx, %r9 \n" - " movl %edi, %eax \n" - " cpuid \n" - " movl %eax, (%rsi)\n" - " movl %ebx, (%r10)\n" - " movl %ecx, (%r9) \n" - " movl %edx, (%r8) \n" - /* Restore rbx */ - " movq %r11, %rbx"); -#else - /* EBX is a callee-saved register */ - asm(" pushl %ebx"); - /* Need ESI for storing through arguments */ - asm(" pushl %esi"); - asm(" movl 8(%ebp), %eax \n" - " cpuid \n" - " movl 12(%ebp), %esi \n" - " movl %eax, (%esi) \n" - " movl 16(%ebp), %esi \n" - " movl %ebx, (%esi) \n" - " movl 20(%ebp), %esi \n" - " movl %ecx, (%esi) \n" - " movl 24(%ebp), %esi \n" - " movl %edx, (%esi) "); - /* Restore ESI and EBX */ - asm(" popl %esi"); - /* Restore EBX */ - asm(" popl %ebx"); -#endif -} - -#endif /* __sun && i586 */ - -#if defined(__linux__) && defined(i586) - -/* - * A utility method for asking the CPU about itself. - * There's a corresponding version of solaris-i586 - * because the compilers are different. - */ -void -get_cpuid(uint32_t arg, - uint32_t* eaxp, - uint32_t* ebxp, - uint32_t* ecxp, - uint32_t* edxp) { -#ifdef _LP64 - __asm__ volatile (/* Instructions */ - " movl %4, %%eax \n" - " cpuid \n" - " movl %%eax, (%0)\n" - " movl %%ebx, (%1)\n" - " movl %%ecx, (%2)\n" - " movl %%edx, (%3)\n" - : /* Outputs */ - : /* Inputs */ - "r" (eaxp), - "r" (ebxp), - "r" (ecxp), - "r" (edxp), - "r" (arg) - : /* Clobbers */ - "%rax", "%rbx", "%rcx", "%rdx", "memory" - ); -#else - uint32_t value_of_eax = 0; - uint32_t value_of_ebx = 0; - uint32_t value_of_ecx = 0; - uint32_t value_of_edx = 0; - __asm__ volatile (/* Instructions */ - /* ebx is callee-save, so push it */ - /* even though it's in the clobbers section */ - " pushl %%ebx \n" - " movl %4, %%eax \n" - " cpuid \n" - " movl %%eax, %0 \n" - " movl %%ebx, %1 \n" - " movl %%ecx, %2 \n" - " movl %%edx, %3 \n" - /* restore ebx */ - " popl %%ebx \n" - - : /* Outputs */ - "=m" (value_of_eax), - "=m" (value_of_ebx), - "=m" (value_of_ecx), - "=m" (value_of_edx) - : /* Inputs */ - "m" (arg) - : /* Clobbers */ - "%eax", "%ebx", "%ecx", "%edx" - ); - *eaxp = value_of_eax; - *ebxp = value_of_ebx; - *ecxp = value_of_ecx; - *edxp = value_of_edx; -#endif -} - -#endif /* __linux__ && i586 */ - -#ifdef i586 -/* - * Routines shared by solaris-i586 and linux-i586. - */ - -enum HyperThreadingSupport_enum { - hts_supported = 1, - hts_too_soon_to_tell = 0, - hts_not_supported = -1, - hts_not_pentium4 = -2, - hts_not_intel = -3 -}; -typedef enum HyperThreadingSupport_enum HyperThreadingSupport; - -/* Determine if hyperthreading is supported */ -HyperThreadingSupport -hyperthreading_support(void) { - HyperThreadingSupport result = hts_too_soon_to_tell; - /* Bits 11 through 8 is family processor id */ -# define FAMILY_ID_SHIFT 8 -# define FAMILY_ID_MASK 0xf - /* Bits 23 through 20 is extended family processor id */ -# define EXT_FAMILY_ID_SHIFT 20 -# define EXT_FAMILY_ID_MASK 0xf - /* Pentium 4 family processor id */ -# define PENTIUM4_FAMILY_ID 0xf - /* Bit 28 indicates Hyper-Threading Technology support */ -# define HT_BIT_SHIFT 28 -# define HT_BIT_MASK 1 - uint32_t vendor_id[3] = { 0U, 0U, 0U }; - uint32_t value_of_eax = 0U; - uint32_t value_of_edx = 0U; - uint32_t dummy = 0U; - - /* Yes, this is supposed to be [0], [2], [1] */ - get_cpuid(0, &dummy, &vendor_id[0], &vendor_id[2], &vendor_id[1]); - if (_launcher_debug) { - printf("vendor: %c %c %c %c %c %c %c %c %c %c %c %c \n", - ((vendor_id[0] >> 0) & 0xff), - ((vendor_id[0] >> 8) & 0xff), - ((vendor_id[0] >> 16) & 0xff), - ((vendor_id[0] >> 24) & 0xff), - ((vendor_id[1] >> 0) & 0xff), - ((vendor_id[1] >> 8) & 0xff), - ((vendor_id[1] >> 16) & 0xff), - ((vendor_id[1] >> 24) & 0xff), - ((vendor_id[2] >> 0) & 0xff), - ((vendor_id[2] >> 8) & 0xff), - ((vendor_id[2] >> 16) & 0xff), - ((vendor_id[2] >> 24) & 0xff)); - } - get_cpuid(1, &value_of_eax, &dummy, &dummy, &value_of_edx); - if (_launcher_debug) { - printf("value_of_eax: 0x%x value_of_edx: 0x%x\n", - value_of_eax, value_of_edx); - } - if ((((value_of_eax >> FAMILY_ID_SHIFT) & FAMILY_ID_MASK) == PENTIUM4_FAMILY_ID) || - (((value_of_eax >> EXT_FAMILY_ID_SHIFT) & EXT_FAMILY_ID_MASK) != 0)) { - if ((((vendor_id[0] >> 0) & 0xff) == 'G') && - (((vendor_id[0] >> 8) & 0xff) == 'e') && - (((vendor_id[0] >> 16) & 0xff) == 'n') && - (((vendor_id[0] >> 24) & 0xff) == 'u') && - (((vendor_id[1] >> 0) & 0xff) == 'i') && - (((vendor_id[1] >> 8) & 0xff) == 'n') && - (((vendor_id[1] >> 16) & 0xff) == 'e') && - (((vendor_id[1] >> 24) & 0xff) == 'I') && - (((vendor_id[2] >> 0) & 0xff) == 'n') && - (((vendor_id[2] >> 8) & 0xff) == 't') && - (((vendor_id[2] >> 16) & 0xff) == 'e') && - (((vendor_id[2] >> 24) & 0xff) == 'l')) { - if (((value_of_edx >> HT_BIT_SHIFT) & HT_BIT_MASK) == HT_BIT_MASK) { - if (_launcher_debug) { - printf("Hyperthreading supported\n"); - } - result = hts_supported; - } else { - if (_launcher_debug) { - printf("Hyperthreading not supported\n"); - } - result = hts_not_supported; - } - } else { - if (_launcher_debug) { - printf("Not GenuineIntel\n"); - } - result = hts_not_intel; - } - } else { - if (_launcher_debug) { - printf("not Pentium 4 or extended\n"); - } - result = hts_not_pentium4; - } - return result; -} - -/* Determine how many logical processors there are per CPU */ -unsigned int -logical_processors_per_package(void) { - /* - * After CPUID with EAX==1, register EBX bits 23 through 16 - * indicate the number of logical processors per package - */ -# define NUM_LOGICAL_SHIFT 16 -# define NUM_LOGICAL_MASK 0xff - unsigned int result = 1U; - const HyperThreadingSupport hyperthreading = hyperthreading_support(); - - if (hyperthreading == hts_supported) { - uint32_t value_of_ebx = 0U; - uint32_t dummy = 0U; - - get_cpuid(1, &dummy, &value_of_ebx, &dummy, &dummy); - result = (value_of_ebx >> NUM_LOGICAL_SHIFT) & NUM_LOGICAL_MASK; - if (_launcher_debug) { - printf("logical processors per package: %u\n", result); - } - } - return result; -} - -/* Compute the number of physical processors, not logical processors */ -unsigned long -physical_processors(void) { - const long sys_processors = sysconf(_SC_NPROCESSORS_CONF); - unsigned long result = sys_processors; - - if (_launcher_debug) { - printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors); - } - if (sys_processors > 1) { - unsigned int logical_processors = logical_processors_per_package(); - if (logical_processors > 1) { - result = (unsigned long) sys_processors / logical_processors; - } - } - if (_launcher_debug) { - printf("physical processors: %lu\n", result); - } - return result; -} - -#endif /* i586 */ - -#if defined(__sun) && defined(i586) - -/* The definition of a server-class machine for solaris-i586/amd64 */ -jboolean -solaris_i586_ServerClassMachine(void) { - jboolean result = JNI_FALSE; - /* How big is a server class machine? */ - const unsigned long server_processors = 2UL; - const uint64_t server_memory = 2UL * GB; - /* - * We seem not to get our full complement of memory. - * We allow some part (1/8?) of the memory to be "missing", - * based on the sizes of DIMMs, and maybe graphics cards. - */ - const uint64_t missing_memory = 256UL * MB; - const uint64_t actual_memory = physical_memory(); - - /* Is this a server class machine? */ - if (actual_memory >= (server_memory - missing_memory)) { - const unsigned long actual_processors = physical_processors(); - if (actual_processors >= server_processors) { - result = JNI_TRUE; - } - } - if (_launcher_debug) { - printf("solaris_" ARCH "_ServerClassMachine: %s\n", - (result == JNI_TRUE ? "true" : "false")); - } - return result; -} - -#endif /* __sun && i586 */ - -#if defined(__linux__) && defined(i586) - -/* The definition of a server-class machine for linux-i586 */ -jboolean -linux_i586_ServerClassMachine(void) { - jboolean result = JNI_FALSE; - /* How big is a server class machine? */ - const unsigned long server_processors = 2UL; - const uint64_t server_memory = 2UL * GB; - /* - * We seem not to get our full complement of memory. - * We allow some part (1/8?) of the memory to be "missing", - * based on the sizes of DIMMs, and maybe graphics cards. - */ - const uint64_t missing_memory = 256UL * MB; - const uint64_t actual_memory = physical_memory(); - - /* Is this a server class machine? */ - if (actual_memory >= (server_memory - missing_memory)) { - const unsigned long actual_processors = physical_processors(); - if (actual_processors >= server_processors) { - result = JNI_TRUE; - } - } - if (_launcher_debug) { - printf("linux_" ARCH "_ServerClassMachine: %s\n", - (result == JNI_TRUE ? "true" : "false")); - } - return result; -} - -#endif /* __linux__ && i586 */ - -/* Dispatch to the platform-specific definition of "server-class" */ -jboolean -ServerClassMachine(void) { - jboolean result = JNI_FALSE; -#if defined(__sun) && defined(__sparc) - result = solaris_sparc_ServerClassMachine(); -#elif defined(__sun) && defined(i586) - result = solaris_i586_ServerClassMachine(); -#elif defined(__linux__) && defined(i586) - result = linux_i586_ServerClassMachine(); -#else - if (_launcher_debug) { - printf("ServerClassMachine: returns default value of %s\n", - (result == JNI_TRUE ? "true" : "false")); - } -#endif - return result; -} - -#endif /* ifndef GAMMA */ - -#ifndef GAMMA /* gamma launcher does not choose JDK/JRE/JVM */ - -/* - * Since using the file system as a registry is a bit risky, perform - * additional sanity checks on the identified directory to validate - * it as a valid jre/sdk. - * - * Return 0 if the tests fail; otherwise return non-zero (true). - * - * Note that checking for anything more than the existence of an - * executable object at bin/java relative to the path being checked - * will break the regression tests. - */ -static int -CheckSanity(char *path, char *dir) -{ - char buffer[PATH_MAX]; - - if (strlen(path) + strlen(dir) + 11 > PATH_MAX) - return (0); /* Silently reject "impossibly" long paths */ - - (void)strcat(strcat(strcat(strcpy(buffer, path), "/"), dir), "/bin/java"); - return ((access(buffer, X_OK) == 0) ? 1 : 0); -} - -/* - * Determine if there is an acceptable JRE in the directory dirname. - * Upon locating the "best" one, return a fully qualified path to - * it. "Best" is defined as the most advanced JRE meeting the - * constraints contained in the manifest_info. If no JRE in this - * directory meets the constraints, return NULL. - * - * Note that we don't check for errors in reading the directory - * (which would be done by checking errno). This is because it - * doesn't matter if we get an error reading the directory, or - * we just don't find anything interesting in the directory. We - * just return NULL in either case. - * - * The historical names of j2sdk and j2re were changed to jdk and - * jre respecively as part of the 1.5 rebranding effort. Since the - * former names are legacy on Linux, they must be recognized for - * all time. Fortunately, this is a minor cost. - */ -static char -*ProcessDir(manifest_info *info, char *dirname) -{ - DIR *dirp; - struct dirent *dp; - char *best = NULL; - int offset; - int best_offset = 0; - char *ret_str = NULL; - char buffer[PATH_MAX]; - - if ((dirp = opendir(dirname)) == NULL) - return (NULL); - - do { - if ((dp = readdir(dirp)) != NULL) { - offset = 0; - if ((strncmp(dp->d_name, "jre", 3) == 0) || - (strncmp(dp->d_name, "jdk", 3) == 0)) - offset = 3; - else if (strncmp(dp->d_name, "j2re", 4) == 0) - offset = 4; - else if (strncmp(dp->d_name, "j2sdk", 5) == 0) - offset = 5; - if (offset > 0) { - if ((acceptable_release(dp->d_name + offset, - info->jre_version)) && CheckSanity(dirname, dp->d_name)) - if ((best == NULL) || (exact_version_id( - dp->d_name + offset, best + best_offset) > 0)) { - if (best != NULL) - free(best); - best = strdup(dp->d_name); - best_offset = offset; - } - } - } - } while (dp != NULL); - (void) closedir(dirp); - if (best == NULL) - return (NULL); - else { - ret_str = MemAlloc(strlen(dirname) + strlen(best) + 2); - ret_str = strcat(strcat(strcpy(ret_str, dirname), "/"), best); - free(best); - return (ret_str); - } -} - -/* - * This is the global entry point. It examines the host for the optimal - * JRE to be used by scanning a set of directories. The set of directories - * is platform dependent and can be overridden by the environment - * variable JAVA_VERSION_PATH. - * - * This routine itself simply determines the set of appropriate - * directories before passing control onto ProcessDir(). - */ -char* -LocateJRE(manifest_info* info) -{ - char *path; - char *home; - char *target = NULL; - char *dp; - char *cp; - - /* - * Start by getting JAVA_VERSION_PATH - */ - if (info->jre_restrict_search) - path = strdup(system_dir); - else if ((path = getenv("JAVA_VERSION_PATH")) != NULL) - path = strdup(path); - else - if ((home = getenv("HOME")) != NULL) { - path = (char *)MemAlloc(strlen(home) + 13); - path = strcat(strcat(strcat(strcpy(path, home), - user_dir), ":"), system_dir); - } else - path = strdup(system_dir); - - /* - * Step through each directory on the path. Terminate the scan with - * the first directory with an acceptable JRE. - */ - cp = dp = path; - while (dp != NULL) { - cp = strchr(dp, (int)':'); - if (cp != NULL) - *cp = (char)NULL; - if ((target = ProcessDir(info, dp)) != NULL) - break; - dp = cp; - if (dp != NULL) - dp++; - } - free(path); - return (target); -} - -/* - * Given a path to a jre to execute, this routine checks if this process - * is indeed that jre. If not, it exec's that jre. - * - * We want to actually check the paths rather than just the version string - * built into the executable, so that given version specification (and - * JAVA_VERSION_PATH) will yield the exact same Java environment, regardless - * of the version of the arbitrary launcher we start with. - */ -void -ExecJRE(char *jre, char **argv) -{ - char wanted[PATH_MAX]; - char *execname; - char *progname; - - /* - * Resolve the real path to the directory containing the selected JRE. - */ - if (realpath(jre, wanted) == NULL) { - fprintf(stderr, "Unable to resolve %s\n", jre); - exit(1); - } - - /* - * Resolve the real path to the currently running launcher. - */ - execname = SetExecname(argv); - if (execname == NULL) { - fprintf(stderr, "Unable to resolve current executable\n"); - exit(1); - } - - /* - * If the path to the selected JRE directory is a match to the initial - * portion of the path to the currently executing JRE, we have a winner! - * If so, just return. - */ - if (strncmp(wanted, execname, strlen(wanted)) == 0) - return; /* I am the droid you were looking for */ - - /* - * If this isn't the selected version, exec the selected version. - */ -#ifdef JAVA_ARGS /* javac, jar and friends. */ - progname = "java"; -#else /* java, oldjava, javaw and friends */ -#ifdef PROGNAME - progname = PROGNAME; -#else - progname = *argv; - if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) { - progname = s + 1; - } -#endif /* PROGNAME */ -#endif /* JAVA_ARGS */ - - /* - * This should never happen (because of the selection code in SelectJRE), - * but check for "impossibly" long path names just because buffer overruns - * can be so deadly. - */ - if (strlen(wanted) + strlen(progname) + 6 > PATH_MAX) { - fprintf(stderr, "Path length exceeds maximum length (PATH_MAX)\n"); - exit(1); - } - - /* - * Construct the path and exec it. - */ - (void)strcat(strcat(wanted, "/bin/"), progname); - argv[0] = progname; - if (_launcher_debug) { - int i; - printf("execv(\"%s\"", wanted); - for (i = 0; argv[i] != NULL; i++) - printf(", \"%s\"", argv[i]); - printf(")\n"); - } - execv(wanted, argv); - fprintf(stderr, "Exec of %s failed\n", wanted); - exit(1); -} - -#endif /* ifndef GAMMA */ - -/* - * "Borrowed" from Solaris 10 where the unsetenv() function is being added - * to libc thanks to SUSv3 (Standard Unix Specification, version 3). As - * such, in the fullness of time this will appear in libc on all relevant - * Solaris/Linux platforms and maybe even the Windows platform. At that - * time, this stub can be removed. - * - * This implementation removes the environment locking for multithreaded - * applications. (We don't have access to these mutexes within libc and - * the launcher isn't multithreaded.) Note that what remains is platform - * independent, because it only relies on attributes that a POSIX environment - * defines. - * - * Returns 0 on success, -1 on failure. - * - * Also removed was the setting of errno. The only value of errno set - * was EINVAL ("Invalid Argument"). - */ - -/* - * s1(environ) is name=value - * s2(name) is name(not the form of name=value). - * if names match, return value of 1, else return 0 - */ -static int -match_noeq(const char *s1, const char *s2) -{ - while (*s1 == *s2++) { - if (*s1++ == '=') - return (1); - } - if (*s1 == '=' && s2[-1] == '\0') - return (1); - return (0); -} - -/* - * added for SUSv3 standard - * - * Delete entry from environ. - * Do not free() memory! Other threads may be using it. - * Keep it around forever. - */ -static int -borrowed_unsetenv(const char *name) -{ - long idx; /* index into environ */ - - if (name == NULL || *name == '\0' || - strchr(name, '=') != NULL) { - return (-1); - } - - for (idx = 0; environ[idx] != NULL; idx++) { - if (match_noeq(environ[idx], name)) - break; - } - if (environ[idx] == NULL) { - /* name not found but still a success */ - return (0); - } - /* squeeze up one entry */ - do { - environ[idx] = environ[idx+1]; - } while (environ[++idx] != NULL); - - return (0); -} -/* --- End of "borrowed" code --- */ - -/* - * Wrapper for unsetenv() function. - */ -int -UnsetEnv(char *name) -{ - return(borrowed_unsetenv(name)); -} - -/* - * The implementation for finding classes from the bootstrap - * class loader, refer to java.h - */ -static FindClassFromBootLoader_t *findBootClass = NULL; - -jclass -FindBootStrapClass(JNIEnv *env, const char* classname) -{ - if (findBootClass == NULL) { - findBootClass = (FindClassFromBootLoader_t *)dlsym(RTLD_DEFAULT, - "JVM_FindClassFromBootLoader"); - if (findBootClass == NULL) { - fprintf(stderr, "Error: could not load method JVM_FindClassFromBootLoader"); - return NULL; - } - } - return findBootClass(env, classname, JNI_FALSE); -} - diff --git a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp index 9ae81cb53d5..b56a32a40af 100644 --- a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp +++ b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_attachListener_solaris.cpp.incl" +#include "precompiled.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/os.hpp" +#include "services/attachListener.hpp" +#include "services/dtraceAttacher.hpp" #include #include diff --git a/hotspot/src/os/solaris/vm/c1_globals_solaris.hpp b/hotspot/src/os/solaris/vm/c1_globals_solaris.hpp index 301d169c178..ad2075dbc10 100644 --- a/hotspot/src/os/solaris/vm/c1_globals_solaris.hpp +++ b/hotspot/src/os/solaris/vm/c1_globals_solaris.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,15 @@ * */ +#ifndef OS_SOLARIS_VM_C1_GLOBALS_SOLARIS_HPP +#define OS_SOLARIS_VM_C1_GLOBALS_SOLARIS_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // // Sets the default values for operating system dependent flags used by the // client compiler. (see c1_globals.hpp) // + +#endif // OS_SOLARIS_VM_C1_GLOBALS_SOLARIS_HPP diff --git a/hotspot/src/os/solaris/vm/c2_globals_solaris.hpp b/hotspot/src/os/solaris/vm/c2_globals_solaris.hpp index b14af55c55c..9909831d983 100644 --- a/hotspot/src/os/solaris/vm/c2_globals_solaris.hpp +++ b/hotspot/src/os/solaris/vm/c2_globals_solaris.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,15 @@ * */ +#ifndef OS_SOLARIS_VM_C2_GLOBALS_SOLARIS_HPP +#define OS_SOLARIS_VM_C2_GLOBALS_SOLARIS_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // // Sets the default values for operating system dependent flags used by the // server compiler. (see c2_globals.hpp) // + +#endif // OS_SOLARIS_VM_C2_GLOBALS_SOLARIS_HPP diff --git a/hotspot/src/os/solaris/vm/chaitin_solaris.cpp b/hotspot/src/os/solaris/vm/chaitin_solaris.cpp index 9d61ae5dae6..92a437f9683 100644 --- a/hotspot/src/os/solaris/vm/chaitin_solaris.cpp +++ b/hotspot/src/os/solaris/vm/chaitin_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_chaitin_solaris.cpp.incl" +#include "precompiled.hpp" +#include "opto/chaitin.hpp" +#include "opto/machnode.hpp" void PhaseRegAlloc::pd_preallocate_hook() { // no action diff --git a/hotspot/src/os/linux/vm/objectMonitor_linux.hpp b/hotspot/src/os/solaris/vm/decoder_solaris.cpp similarity index 80% rename from hotspot/src/os/linux/vm/objectMonitor_linux.hpp rename to hotspot/src/os/solaris/vm/decoder_solaris.cpp index 663dd38a8a9..a7b4b51fb6a 100644 --- a/hotspot/src/os/linux/vm/objectMonitor_linux.hpp +++ b/hotspot/src/os/solaris/vm/decoder_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,4 +22,10 @@ * */ - private: +#include "utilities/decoder.hpp" + +#include + +bool Decoder::demangle(const char* symbol, char *buf, int buflen) { + return !cplus_demangle(symbol, buf, (size_t)buflen); +} diff --git a/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp b/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp index 856c8fcfcfd..fb901a1ed2e 100644 --- a/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp +++ b/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_dtraceJSDT_solaris.cpp.incl" +#include "precompiled.hpp" +#include "classfile/javaClasses.hpp" +#include "code/codeBlob.hpp" +#include "memory/allocation.hpp" +#include "prims/jvm.h" +#include "runtime/dtraceJSDT.hpp" +#include "runtime/jniHandles.hpp" +#include "runtime/os.hpp" +#include "runtime/signature.hpp" +#include "utilities/globalDefinitions.hpp" #ifdef HAVE_DTRACE_H diff --git a/hotspot/src/os/solaris/vm/globals_solaris.hpp b/hotspot/src/os/solaris/vm/globals_solaris.hpp index 4d0c9eddda2..a567a357e16 100644 --- a/hotspot/src/os/solaris/vm/globals_solaris.hpp +++ b/hotspot/src/os/solaris/vm/globals_solaris.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_SOLARIS_VM_GLOBALS_SOLARIS_HPP +#define OS_SOLARIS_VM_GLOBALS_SOLARIS_HPP + // // Defines Solaris specific flags. They are not available on other platforms. // @@ -47,3 +50,5 @@ define_pd_global(bool, UseLargePages, true); define_pd_global(bool, UseLargePagesIndividualAllocation, false); define_pd_global(bool, UseOSErrorReporting, false); define_pd_global(bool, UseThreadPriorities, false); + +#endif // OS_SOLARIS_VM_GLOBALS_SOLARIS_HPP diff --git a/hotspot/src/os/solaris/vm/hpi_solaris.cpp b/hotspot/src/os/solaris/vm/hpi_solaris.cpp deleted file mode 100644 index ad50b085728..00000000000 --- a/hotspot/src/os/solaris/vm/hpi_solaris.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -# include "incls/_precompiled.incl" -# include "incls/_hpi_solaris.cpp.incl" - -# include -# include - -typedef jint (JNICALL *init_t)(GetInterfaceFunc *, void *); - -void hpi::initialize_get_interface(vm_calls_t *callbacks) -{ - char buf[JVM_MAXPATHLEN]; - void *hpi_handle; - GetInterfaceFunc& getintf = _get_interface; - jint (JNICALL * DLL_Initialize)(GetInterfaceFunc *, void *); - - if (HPILibPath && HPILibPath[0]) { - strncpy(buf, HPILibPath, JVM_MAXPATHLEN - 1); - buf[JVM_MAXPATHLEN - 1] = '\0'; - } else { - const char *thread_type = "native_threads"; - - os::jvm_path(buf, JVM_MAXPATHLEN); - -#ifdef PRODUCT - const char * hpi_lib = "/libhpi.so"; -#else - char * ptr = strrchr(buf, '/'); - assert(strstr(ptr, "/libjvm") == ptr, "invalid library name"); - const char * hpi_lib = strstr(ptr, "_g") ? "/libhpi_g.so" : "/libhpi.so"; -#endif - - *(strrchr(buf, '/')) = '\0'; /* get rid of /libjvm.so */ - char* p = strrchr(buf, '/'); - if (p != NULL) p[1] = '\0'; /* get rid of hotspot */ - strcat(buf, thread_type); - strcat(buf, hpi_lib); - } - /* we use RTLD_NOW because of bug 4032715 */ - if (TraceHPI) tty->print_cr("Loading HPI %s ", buf); - hpi_handle = dlopen(buf, RTLD_NOW); - if (hpi_handle == NULL) { - if (TraceHPI) tty->print_cr("HPI dlopen failed: %s", dlerror()); - return; - } - DLL_Initialize = CAST_TO_FN_PTR(jint (JNICALL *)(GetInterfaceFunc *, void *), - dlsym(hpi_handle, "DLL_Initialize")); - if (TraceHPI && DLL_Initialize == NULL) tty->print_cr("HPI dlsym of DLL_Initialize failed: %s", dlerror()); - if (DLL_Initialize == NULL || - (*DLL_Initialize)(&getintf, callbacks) < 0) { - if (TraceHPI) tty->print_cr("HPI DLL_Initialize failed"); - return; - } - if (TraceHPI) tty->print_cr("HPI loaded successfully"); -} diff --git a/hotspot/src/os/solaris/vm/hpi_solaris.hpp b/hotspot/src/os/solaris/vm/hpi_solaris.hpp deleted file mode 100644 index bd171a79a1e..00000000000 --- a/hotspot/src/os/solaris/vm/hpi_solaris.hpp +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -// -// Parts of the HPI interface for which the HotSparc does not use the -// HPI (because the interruptible IO mechanims used are different). -// - -#include -#include -#include -#include -#include -#include - -// HPI_FileInterface - -// Many system calls can be interrupted by signals and must be restarted. -// Restart support was added without disturbing the extent of thread -// interruption support. - -inline int hpi::close(int fd) { - RESTARTABLE_RETURN_INT(::close(fd)); -} - -inline size_t hpi::read(int fd, void *buf, unsigned int nBytes) { - INTERRUPTIBLE_RETURN_INT(::read(fd, buf, nBytes), os::Solaris::clear_interrupted); -} - -inline size_t hpi::write(int fd, const void *buf, unsigned int nBytes) { - INTERRUPTIBLE_RETURN_INT(::write(fd, buf, nBytes), os::Solaris::clear_interrupted); -} - - -// HPI_SocketInterface - -inline int hpi::socket_close(int fd) { - RESTARTABLE_RETURN_INT(::close(fd)); -} - -inline int hpi::socket(int domain, int type, int protocol) { - return ::socket(domain, type, protocol); -} - -inline int hpi::recv(int fd, char *buf, int nBytes, int flags) { - INTERRUPTIBLE_RETURN_INT(::recv(fd, buf, nBytes, flags), os::Solaris::clear_interrupted); -} - -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 -// "wait forever" value. - -inline int hpi::timeout(int fd, long timeout) { - int res; - struct timeval t; - julong prevtime, newtime; - static const char* aNull = 0; - - struct pollfd pfd; - pfd.fd = fd; - pfd.events = POLLIN; - - gettimeofday(&t, &aNull); - prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000; - - for(;;) { - INTERRUPTIBLE_NORESTART(::poll(&pfd, 1, timeout), res, os::Solaris::clear_interrupted); - if(res == OS_ERR && errno == EINTR) { - if(timeout != -1) { - gettimeofday(&t, &aNull); - newtime = ((julong)t.tv_sec * 1000) + t.tv_usec /1000; - timeout -= newtime - prevtime; - if(timeout <= 0) - return OS_OK; - prevtime = newtime; - } - } else - return res; - } -} - -inline int hpi::listen(int fd, int count) { - if (fd < 0) - return OS_ERR; - - return ::listen(fd, count); -} - -inline int -hpi::connect(int fd, struct sockaddr *him, int len) { - do { - int _result; - INTERRUPTIBLE_NORESTART(::connect(fd, him, len), _result, - os::Solaris::clear_interrupted); - - // Depending on when thread interruption is reset, _result could be - // one of two values when errno == EINTR - - if (((_result == OS_INTRPT) || (_result == OS_ERR)) && (errno == EINTR)) { - /* restarting a connect() changes its errno semantics */ - INTERRUPTIBLE(::connect(fd, him, len), _result, - os::Solaris::clear_interrupted); - /* undo these changes */ - if (_result == OS_ERR) { - if (errno == EALREADY) errno = EINPROGRESS; /* fall through */ - else if (errno == EISCONN) { errno = 0; return OS_OK; } - } - } - return _result; - } while(false); -} - -inline int hpi::accept(int fd, struct sockaddr *him, int *len) { - if (fd < 0) - return OS_ERR; - INTERRUPTIBLE_RETURN_INT((int)::accept(fd, him, (socklen_t*) len), os::Solaris::clear_interrupted); -} - -inline int hpi::recvfrom(int fd, char *buf, int nBytes, int flags, - sockaddr *from, int *fromlen) { - //%%note jvm_r11 - INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen), os::Solaris::clear_interrupted); -} - -inline int hpi::sendto(int fd, char *buf, int len, int flags, - struct sockaddr *to, int tolen) { - //%%note jvm_r11 - INTERRUPTIBLE_RETURN_INT((int)::sendto(fd, buf, len, (unsigned int) flags, to, tolen),os::Solaris::clear_interrupted); -} - -inline int hpi::socket_available(int fd, jint *pbytes) { - if (fd < 0) - return OS_OK; - - int ret; - - RESTARTABLE(::ioctl(fd, FIONREAD, pbytes), ret); - - //%% note ioctl can return 0 when successful, JVM_SocketAvailable - // is expected to return 0 on failure and 1 on success to the jdk. - - return (ret == OS_ERR) ? 0 : 1; -} - - -/* -HPIDECL(socket_shutdown, "socket_shutdown", _socket, SocketShutdown, - int, "%d", - (int fd, int howto), - ("fd = %d, howto = %d", fd, howto), - (fd, howto)); - */ -inline int hpi::socket_shutdown(int fd, int howto){ - return ::shutdown(fd, howto); -} - -/* -HPIDECL(bind, "bind", _socket, Bind, - int, "%d", - (int fd, struct sockaddr *him, int len), - ("fd = %d, him = %p, len = %d", - fd, him, len), - (fd, him, len)); -*/ -inline int hpi::bind(int fd, struct sockaddr *him, int len){ - INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),os::Solaris::clear_interrupted); -} - -/* -HPIDECL(get_sock_name, "get_sock_name", _socket, GetSocketName, - int, "%d", - (int fd, struct sockaddr *him, int *len), - ("fd = %d, him = %p, len = %p", - fd, him, len), - (fd, him, len)); - */ -inline int hpi::get_sock_name(int fd, struct sockaddr *him, int *len){ - return ::getsockname(fd, him, (socklen_t*) len); -} - -/* -HPIDECL(get_host_name, "get_host_name", _socket, GetHostName, int, "%d", - (char *hostname, int namelen), - ("hostname = %p, namelen = %d", - hostname, namelen), - (hostname, namelen)); - */ -inline int hpi::get_host_name(char* name, int namelen){ - return ::gethostname(name, namelen); -} - -/* -HPIDECL(get_sock_opt, "get_sock_opt", _socket, SocketGetOption, int, "%d", - (int fd, int level, int optname, char *optval, int* optlen), - ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %p", - fd, level, optname, optval, optlen), - (fd, level, optname, optval, optlen)); - */ -inline int hpi::get_sock_opt(int fd, int level, int optname, - char *optval, int* optlen){ - return ::getsockopt(fd, level, optname, optval, (socklen_t*) optlen); -} - -/* -HPIDECL(set_sock_opt, "set_sock_opt", _socket, SocketSetOption, int, "%d", - (int fd, int level, int optname, const char *optval, int optlen), - ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %d", - fd, level, optname, optval, optlen), - (fd, level, optname, optval, optlen)); - */ -inline int hpi::set_sock_opt(int fd, int level, int optname, - const char *optval, int optlen){ - return ::setsockopt(fd, level, optname, optval, optlen); -} - -//Reconciliation History -// 1.3 98/10/21 18:17:14 hpi_win32.hpp -// 1.6 99/06/28 11:01:36 hpi_win32.hpp -//End diff --git a/hotspot/src/os/solaris/vm/interfaceSupport_solaris.hpp b/hotspot/src/os/solaris/vm/interfaceSupport_solaris.hpp index acc096be80f..4332d428184 100644 --- a/hotspot/src/os/solaris/vm/interfaceSupport_solaris.hpp +++ b/hotspot/src/os/solaris/vm/interfaceSupport_solaris.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ +#ifndef OS_SOLARIS_VM_INTERFACESUPPORT_SOLARIS_HPP +#define OS_SOLARIS_VM_INTERFACESUPPORT_SOLARIS_HPP + // Contains inlined functions for class InterfaceSupport static inline void serialize_memory(JavaThread *thread) { os::write_memory_serialize_page(thread); } + +#endif // OS_SOLARIS_VM_INTERFACESUPPORT_SOLARIS_HPP diff --git a/hotspot/src/os/solaris/vm/jsig.c b/hotspot/src/os/solaris/vm/jsig.c index bf1a25ca184..3c509159a2d 100644 --- a/hotspot/src/os/solaris/vm/jsig.c +++ b/hotspot/src/os/solaris/vm/jsig.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/jvm_solaris.cpp b/hotspot/src/os/solaris/vm/jvm_solaris.cpp index 00981bbbb23..2f5ccb3bb17 100644 --- a/hotspot/src/os/solaris/vm/jvm_solaris.cpp +++ b/hotspot/src/os/solaris/vm/jvm_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_jvm_solaris.cpp.incl" +#include "precompiled.hpp" +#include "prims/jvm.h" +#include "runtime/interfaceSupport.hpp" +#include "runtime/osThread.hpp" #include diff --git a/hotspot/src/os/solaris/vm/jvm_solaris.h b/hotspot/src/os/solaris/vm/jvm_solaris.h index 50d6a95e073..1513c16e8f9 100644 --- a/hotspot/src/os/solaris/vm/jvm_solaris.h +++ b/hotspot/src/os/solaris/vm/jvm_solaris.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_SOLARIS_VM_JVM_SOLARIS_H +#define OS_SOLARIS_VM_JVM_SOLARIS_H + /* // HotSpot integration note: // @@ -98,3 +101,5 @@ #define JSIG_VERSION_1_4_1 0x30140100 #endif /* JVM_MD_H */ + +#endif // OS_SOLARIS_VM_JVM_SOLARIS_H diff --git a/hotspot/src/os/solaris/vm/mutex_solaris.cpp b/hotspot/src/os/solaris/vm/mutex_solaris.cpp index 97649c37b6f..30be73721c6 100644 --- a/hotspot/src/os/solaris/vm/mutex_solaris.cpp +++ b/hotspot/src/os/solaris/vm/mutex_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_mutex_solaris.cpp.incl" +#include "precompiled.hpp" +#include "mutex_solaris.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/mutex.hpp" +#include "thread_solaris.inline.hpp" +#include "utilities/events.hpp" // Solaris-specific include, therefore not in includeDB_* # include "os_share_solaris.hpp" diff --git a/hotspot/src/os/solaris/vm/mutex_solaris.inline.hpp b/hotspot/src/os/solaris/vm/mutex_solaris.inline.hpp index 44565f567be..00e91a79449 100644 --- a/hotspot/src/os/solaris/vm/mutex_solaris.inline.hpp +++ b/hotspot/src/os/solaris/vm/mutex_solaris.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,3 +21,12 @@ * questions. * */ + +#ifndef OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP +#define OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP + +#include "os_solaris.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "thread_solaris.inline.hpp" + +#endif // OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP diff --git a/hotspot/src/os/solaris/vm/objectMonitor_solaris.cpp b/hotspot/src/os/solaris/vm/objectMonitor_solaris.cpp deleted file mode 100644 index 07fe1598f87..00000000000 --- a/hotspot/src/os/solaris/vm/objectMonitor_solaris.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ diff --git a/hotspot/src/os/solaris/vm/objectMonitor_solaris.inline.hpp b/hotspot/src/os/solaris/vm/objectMonitor_solaris.inline.hpp deleted file mode 100644 index 07fe1598f87..00000000000 --- a/hotspot/src/os/solaris/vm/objectMonitor_solaris.inline.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ diff --git a/hotspot/src/os/solaris/vm/osThread_solaris.cpp b/hotspot/src/os/solaris/vm/osThread_solaris.cpp index e0209cfc4e6..937ae5cbbcf 100644 --- a/hotspot/src/os/solaris/vm/osThread_solaris.cpp +++ b/hotspot/src/os/solaris/vm/osThread_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,21 @@ * */ -// do not include precompiled header file -# include "incls/_osThread_solaris.cpp.incl" +// no precompiled headers +#include "runtime/atomic.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/os.hpp" +#include "runtime/osThread.hpp" +#include "runtime/safepoint.hpp" +#include "runtime/vmThread.hpp" +#ifdef TARGET_ARCH_x86 +# include "assembler_x86.inline.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "assembler_sparc.inline.hpp" +#endif + # include // *************************************************************** diff --git a/hotspot/src/os/solaris/vm/osThread_solaris.hpp b/hotspot/src/os/solaris/vm/osThread_solaris.hpp index 2d358de1380..07742ac8e40 100644 --- a/hotspot/src/os/solaris/vm/osThread_solaris.hpp +++ b/hotspot/src/os/solaris/vm/osThread_solaris.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP +#define OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP + // This is embedded via include into the class OSThread private: @@ -149,3 +152,5 @@ private: void pd_initialize(); void pd_destroy(); + +#endif // OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP diff --git a/hotspot/src/os/solaris/vm/os_share_solaris.hpp b/hotspot/src/os/solaris/vm/os_share_solaris.hpp index 67416054f67..a7c1ce8c0ee 100644 --- a/hotspot/src/os/solaris/vm/os_share_solaris.hpp +++ b/hotspot/src/os/solaris/vm/os_share_solaris.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_SOLARIS_VM_OS_SHARE_SOLARIS_HPP +#define OS_SOLARIS_VM_OS_SHARE_SOLARIS_HPP + // Defines the interfaces to Solaris operating systems that vary across platforms @@ -65,3 +68,5 @@ extern "C" void _mark_fpu_nosave() ; #endif #define PROCFILE_LENGTH 128 + +#endif // OS_SOLARIS_VM_OS_SHARE_SOLARIS_HPP diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 0245d6f609d..f6f816cf3ad 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * 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,12 +22,65 @@ * */ -// do not include precompiled header file -# include "incls/_os_solaris.cpp.incl" +// no precompiled headers +#include "classfile/classLoader.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "compiler/compileBroker.hpp" +#include "interpreter/interpreter.hpp" +#include "jvm_solaris.h" +#include "memory/allocation.inline.hpp" +#include "memory/filemap.hpp" +#include "mutex_solaris.inline.hpp" +#include "oops/oop.inline.hpp" +#include "os_share_solaris.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm.h" +#include "prims/jvm_misc.hpp" +#include "runtime/arguments.hpp" +#include "runtime/extendedPC.hpp" +#include "runtime/globals.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/objectMonitor.hpp" +#include "runtime/osThread.hpp" +#include "runtime/perfMemory.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/statSampler.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/threadCritical.hpp" +#include "runtime/timer.hpp" +#include "services/attachListener.hpp" +#include "services/runtimeService.hpp" +#include "thread_solaris.inline.hpp" +#include "utilities/decoder.hpp" +#include "utilities/defaultStream.hpp" +#include "utilities/events.hpp" +#include "utilities/growableArray.hpp" +#include "utilities/vmError.hpp" +#ifdef TARGET_ARCH_x86 +# include "assembler_x86.inline.hpp" +# include "nativeInst_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "assembler_sparc.inline.hpp" +# include "nativeInst_sparc.hpp" +#endif +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif // put OS-includes here # include # include +# include # include # include # include @@ -63,6 +116,7 @@ # include # include # include +# include # define _STRUCTURED_PROC 1 // this gets us the new structured proc interfaces of 5.6 & later # include // see comment in @@ -167,6 +221,9 @@ int prio_policy1[MaxPriority+1] = { -99999, 0, 16, 32, 48, 64, // System parameters used internally static clock_t clock_tics_per_sec = 100; +// Track if we have called enable_extended_FILE_stdio (on Solaris 10u4+) +static bool enabled_extended_FILE_stdio = false; + // For diagnostics to print a message once. see run_periodic_checks static bool check_addr0_done = false; static sigset_t check_signal_done; @@ -226,7 +283,7 @@ Thread* ThreadLocalStorage::get_thread_via_cache_slowly(uintptr_t raw_id, is_error_reported(), "sp must be inside of selected thread stack"); - thread->_self_raw_id = raw_id; // mark for quick retrieval + thread->set_self_raw_id(raw_id); // mark for quick retrieval _get_thread_cache[ index ] = thread; } return thread; @@ -334,7 +391,7 @@ struct tm* os::localtime_pd(const time_t* clock, struct tm* res) { // The saved state is used to restore the thread to // its former state whether or not an interrupt is received. // Used by classloader os::read -// hpi calls skip this layer and stay in _thread_in_native +// os::restartable_read calls skip this layer and stay in _thread_in_native void os::Solaris::setup_interruptible(JavaThread* thread) { @@ -1419,6 +1476,13 @@ sigset_t* os::Solaris::allowdebug_blocked_signals() { return &allowdebug_blocked_sigs; } + +void _handle_uncaught_cxx_exception() { + VMError err("An uncaught C++ exception"); + err.report_and_die(); +} + + // First crack at OS-specific initialization, from inside the new thread. void os::initialize_thread() { int r = thr_main() ; @@ -1508,6 +1572,7 @@ void os::initialize_thread() { // use the dynamic check for T2 libthread. os::Solaris::init_thread_fpu_state(); + std::set_terminate(_handle_uncaught_cxx_exception); } @@ -1698,13 +1763,13 @@ bool os::getTimesSecs(double* process_real_time, bool os::supports_vtime() { return true; } bool os::enable_vtime() { - int fd = open("/proc/self/ctl", O_WRONLY); + int fd = ::open("/proc/self/ctl", O_WRONLY); if (fd == -1) return false; long cmd[] = { PCSET, PR_MSACCT }; - int res = write(fd, cmd, sizeof(long) * 2); - close(fd); + int res = ::write(fd, cmd, sizeof(long) * 2); + ::close(fd); if (res != sizeof(long) * 2) return false; @@ -1712,13 +1777,13 @@ bool os::enable_vtime() { } bool os::vtime_enabled() { - int fd = open("/proc/self/status", O_RDONLY); + int fd = ::open("/proc/self/status", O_RDONLY); if (fd == -1) return false; pstatus_t status; - int res = read(fd, (void*) &status, sizeof(pstatus_t)); - close(fd); + int res = os::read(fd, (void*) &status, sizeof(pstatus_t)); + ::close(fd); if (res != sizeof(pstatus_t)) return false; @@ -1834,7 +1899,6 @@ static bool file_exists(const char* filename) { void os::dll_build_name(char* buffer, size_t buflen, const char* pname, const char* fname) { - // Copied from libhpi const size_t pnamelen = pname ? strlen(pname) : 0; // Quietly truncate on buffer overflow. Should be an error. @@ -1915,27 +1979,42 @@ bool os::dll_address_to_function_name(address addr, char *buf, Sym * info; if (dladdr1_func((void *)addr, &dlinfo, (void **)&info, RTLD_DL_SYMENT)) { - if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname); - if (offset) *offset = addr - (address)dlinfo.dli_saddr; - - // check if the returned symbol really covers addr - return ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr); - } else { - if (buf) buf[0] = '\0'; - if (offset) *offset = -1; - return false; + if ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr) { + if (buf != NULL) { + if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) + jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname); + } + if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr; + return true; + } } + if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) { + if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase), + dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) { + return true; + } + } + if (buf != NULL) buf[0] = '\0'; + if (offset != NULL) *offset = -1; + return false; } else { // no, only dladdr is available - if(dladdr((void *)addr, &dlinfo)) { - if (buf) jio_snprintf(buf, buflen, dlinfo.dli_sname); - if (offset) *offset = addr - (address)dlinfo.dli_saddr; + if (dladdr((void *)addr, &dlinfo)) { + if (buf != NULL) { + if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) + jio_snprintf(buf, buflen, dlinfo.dli_sname); + } + if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr; + return true; + } else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) { + if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase), + dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) { return true; - } else { - if (buf) buf[0] = '\0'; - if (offset) *offset = -1; - return false; + } } + if (buf != NULL) buf[0] = '\0'; + if (offset != NULL) *offset = -1; + return false; } } @@ -2130,20 +2209,29 @@ void* os::dll_lookup(void* handle, const char* name) { return dlsym(handle, name); } +int os::stat(const char *path, struct stat *sbuf) { + char pathbuf[MAX_PATH]; + if (strlen(path) > MAX_PATH - 1) { + errno = ENAMETOOLONG; + return -1; + } + os::native_path(strcpy(pathbuf, path)); + return ::stat(pathbuf, sbuf); +} -bool _print_ascii_file(const char* filename, outputStream* st) { - int fd = open(filename, O_RDONLY); +static bool _print_ascii_file(const char* filename, outputStream* st) { + int fd = ::open(filename, O_RDONLY); if (fd == -1) { return false; } char buf[32]; int bytes; - while ((bytes = read(fd, buf, sizeof(buf))) > 0) { + while ((bytes = ::read(fd, buf, sizeof(buf))) > 0) { st->print_raw(buf, bytes); } - close(fd); + ::close(fd); return true; } @@ -2206,10 +2294,10 @@ void os::print_os_info(outputStream* st) { static bool check_addr0(outputStream* st) { jboolean status = false; - int fd = open("/proc/self/map",O_RDONLY); + int fd = ::open("/proc/self/map",O_RDONLY); if (fd >= 0) { prmap_t p; - while(read(fd, &p, sizeof(p)) > 0) { + while(::read(fd, &p, sizeof(p)) > 0) { if (p.pr_vaddr == 0x0) { st->print("Warning: Address: 0x%x, Size: %dK, ",p.pr_vaddr, p.pr_size/1024, p.pr_mapname); st->print("Mapped file: %s, ", p.pr_mapname[0] == '\0' ? "None" : p.pr_mapname); @@ -2220,7 +2308,7 @@ static bool check_addr0(outputStream* st) { st->cr(); status = true; } - close(fd); + ::close(fd); } } return status; @@ -2468,8 +2556,6 @@ void os::jvm_path(char *buf, jint buflen) { // Use current module name "libjvm[_g].so" instead of // "libjvm"debug_only("_g")".so" since for fastdebug version // we should have "libjvm.so" but debug_only("_g") adds "_g"! - // It is used when we are choosing the HPI library's name - // "libhpi[_g].so" in hpi::initialize_get_interface(). len = strlen(buf); snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p); } else { @@ -2493,6 +2579,23 @@ void os::print_jni_name_suffix_on(outputStream* st, int args_size) { // no suffix required } +// This method is a copy of JDK's sysGetLastErrorString +// from src/solaris/hpi/src/system_md.c + +size_t os::lasterror(char *buf, size_t len) { + + if (errno == 0) return 0; + + const char *s = ::strerror(errno); + size_t n = ::strlen(s); + if (n >= len) { + n = len - 1; + } + ::strncpy(buf, s, n); + buf[n] = '\0'; + return n; +} + // sun.misc.Signal @@ -2987,7 +3090,7 @@ char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) { if (addr == NULL) { jio_snprintf(buf, sizeof(buf), ": %s", strerror(err)); } - warning("attempt_reserve_memory_at: couldn't reserve %d bytes at " + warning("attempt_reserve_memory_at: couldn't reserve " SIZE_FORMAT " bytes at " PTR_FORMAT ": reserve_memory_helper returned " PTR_FORMAT "%s", bytes, requested_addr, addr, buf); } @@ -3375,7 +3478,12 @@ static int os_sleep(jlong millis, bool interruptible) { // INTERRUPTIBLE_NORESTART_VM_ALWAYS returns res == OS_INTRPT for // thread.Interrupt. - if((res == OS_ERR) && (errno == EINTR)) { + // See c/r 6751923. Poll can return 0 before time + // has elapsed if time is set via clock_settime (as NTP does). + // res == 0 if poll timed out (see man poll RETURN VALUES) + // using the logic below checks that we really did + // sleep at least "millis" if not we'll sleep again. + if( ( res == 0 ) || ((res == OS_ERR) && (errno == EINTR))) { newtime = getTimeMillis(); assert(newtime >= prevtime, "time moving backwards"); /* Doing prevtime and newtime in microseconds doesn't help precision, @@ -3397,6 +3505,10 @@ size_t os::read(int fd, void *buf, unsigned int nBytes) { INTERRUPTIBLE_RETURN_INT_VM(::read(fd, buf, nBytes), os::Solaris::clear_interrupted); } +size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) { + INTERRUPTIBLE_RETURN_INT(::read(fd, buf, nBytes), os::Solaris::clear_interrupted); +} + int os::sleep(Thread* thread, jlong millis, bool interruptible) { assert(thread == Thread::current(), "thread consistency check"); @@ -4566,16 +4678,16 @@ bool isT2_libthread() { #define ADR(x) ((uintptr_t)(x)) #define LWPINDEX(ary,ix) ((lwpstatus_t *)(((ary)->pr_entsize * (ix)) + (ADR((ary) + 1)))) - lwpFile = open("/proc/self/lstatus", O_RDONLY, 0); + lwpFile = ::open("/proc/self/lstatus", O_RDONLY, 0); if (lwpFile < 0) { if (ThreadPriorityVerbose) warning ("Couldn't open /proc/self/lstatus\n"); return false; } lwpSize = 16*1024; for (;;) { - lseek (lwpFile, 0, SEEK_SET); + ::lseek64 (lwpFile, 0, SEEK_SET); lwpArray = (prheader_t *)NEW_C_HEAP_ARRAY(char, lwpSize); - if (read(lwpFile, lwpArray, lwpSize) < 0) { + if (::read(lwpFile, lwpArray, lwpSize) < 0) { if (ThreadPriorityVerbose) warning("Error reading /proc/self/lstatus\n"); break; } @@ -4596,7 +4708,7 @@ bool isT2_libthread() { } FREE_C_HEAP_ARRAY(char, lwpArray); - close (lwpFile); + ::close (lwpFile); if (ThreadPriorityVerbose) { if (isT2) tty->print_cr("We are running with a T2 libthread\n"); else tty->print_cr("We are not running with a T2 libthread\n"); @@ -4792,7 +4904,7 @@ void os::init(void) { // if we need them. Solaris::misc_sym_init(); - int fd = open("/dev/zero", O_RDWR); + int fd = ::open("/dev/zero", O_RDWR); if (fd < 0) { fatal(err_msg("os::init: cannot open /dev/zero (%s)", strerror(errno))); } else { @@ -4878,18 +4990,17 @@ jint os::init_2(void) { // Check minimum allowable stack size for thread creation and to initialize // the java system classes, including StackOverflowError - depends on page // size. Add a page for compiler2 recursion in main thread. - // Add in BytesPerWord times page size to account for VM stack during + // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. - guarantee((Solaris::min_stack_allowed >= - (StackYellowPages+StackRedPages+StackShadowPages+BytesPerWord - COMPILER2_PRESENT(+1)) * page_size), - "need to increase Solaris::min_stack_allowed on this platform"); + os::Solaris::min_stack_allowed = MAX2(os::Solaris::min_stack_allowed, + (size_t)(StackYellowPages+StackRedPages+StackShadowPages+ + 2*BytesPerWord COMPILER2_PRESENT(+1)) * page_size); size_t threadStackSizeInBytes = ThreadStackSize * K; if (threadStackSizeInBytes != 0 && - threadStackSizeInBytes < Solaris::min_stack_allowed) { + threadStackSizeInBytes < os::Solaris::min_stack_allowed) { tty->print_cr("\nThe stack size specified is too small, Specify at least %dk", - Solaris::min_stack_allowed/K); + os::Solaris::min_stack_allowed/K); return JNI_ERR; } @@ -4963,13 +5074,6 @@ jint os::init_2(void) { } } - // Initialize HPI. - jint hpi_result = hpi::initialize(); - if (hpi_result != JNI_OK) { - tty->print_cr("There was an error trying to initialize the HPI library."); - return hpi_result; - } - // Calculate theoretical max. size of Threads to guard gainst // artifical out-of-memory situations, where all available address- // space has been reserved by thread stacks. Default stack size is 1Mb. @@ -5029,17 +5133,6 @@ void os::make_polling_page_readable(void) { // OS interface. -int os::stat(const char *path, struct stat *sbuf) { - char pathbuf[MAX_PATH]; - if (strlen(path) > MAX_PATH - 1) { - errno = ENAMETOOLONG; - return -1; - } - hpi::native_path(strcpy(pathbuf, path)); - return ::stat(pathbuf, sbuf); -} - - bool os::check_heap(bool force) { return true; } typedef int (*vsnprintf_t)(char* buf, size_t count, const char* fmt, va_list argptr); @@ -5084,6 +5177,125 @@ bool os::dir_is_empty(const char* path) { return result; } +// This code originates from JDK's sysOpen and open64_w +// from src/solaris/hpi/src/system_md.c + +#ifndef O_DELETE +#define O_DELETE 0x10000 +#endif + +// Open a file. Unlink the file immediately after open returns +// if the specified oflag has the O_DELETE flag set. +// O_DELETE is used only in j2se/src/share/native/java/util/zip/ZipFile.c + +int os::open(const char *path, int oflag, int mode) { + if (strlen(path) > MAX_PATH - 1) { + errno = ENAMETOOLONG; + return -1; + } + int fd; + int o_delete = (oflag & O_DELETE); + oflag = oflag & ~O_DELETE; + + fd = ::open64(path, oflag, mode); + if (fd == -1) return -1; + + //If the open succeeded, the file might still be a directory + { + struct stat64 buf64; + int ret = ::fstat64(fd, &buf64); + int st_mode = buf64.st_mode; + + if (ret != -1) { + if ((st_mode & S_IFMT) == S_IFDIR) { + errno = EISDIR; + ::close(fd); + return -1; + } + } else { + ::close(fd); + return -1; + } + } + /* + * 32-bit Solaris systems suffer from: + * + * - an historical default soft limit of 256 per-process file + * descriptors that is too low for many Java programs. + * + * - a design flaw where file descriptors created using stdio + * fopen must be less than 256, _even_ when the first limit above + * has been raised. This can cause calls to fopen (but not calls to + * open, for example) to fail mysteriously, perhaps in 3rd party + * native code (although the JDK itself uses fopen). One can hardly + * criticize them for using this most standard of all functions. + * + * We attempt to make everything work anyways by: + * + * - raising the soft limit on per-process file descriptors beyond + * 256 + * + * - As of Solaris 10u4, we can request that Solaris raise the 256 + * stdio fopen limit by calling function enable_extended_FILE_stdio. + * This is done in init_2 and recorded in enabled_extended_FILE_stdio + * + * - If we are stuck on an old (pre 10u4) Solaris system, we can + * workaround the bug by remapping non-stdio file descriptors below + * 256 to ones beyond 256, which is done below. + * + * See: + * 1085341: 32-bit stdio routines should support file descriptors >255 + * 6533291: Work around 32-bit Solaris stdio limit of 256 open files + * 6431278: Netbeans crash on 32 bit Solaris: need to call + * enable_extended_FILE_stdio() in VM initialisation + * Giri Mandalika's blog + * http://technopark02.blogspot.com/2005_05_01_archive.html + */ +#ifndef _LP64 + if ((!enabled_extended_FILE_stdio) && fd < 256) { + int newfd = ::fcntl(fd, F_DUPFD, 256); + if (newfd != -1) { + ::close(fd); + fd = newfd; + } + } +#endif // 32-bit Solaris + /* + * All file descriptors that are opened in the JVM and not + * specifically destined for a subprocess should have the + * close-on-exec flag set. If we don't set it, then careless 3rd + * party native code might fork and exec without closing all + * appropriate file descriptors (e.g. as we do in closeDescriptors in + * UNIXProcess.c), and this in turn might: + * + * - cause end-of-file to fail to be detected on some file + * descriptors, resulting in mysterious hangs, or + * + * - might cause an fopen in the subprocess to fail on a system + * suffering from bug 1085341. + * + * (Yes, the default setting of the close-on-exec flag is a Unix + * design flaw) + * + * See: + * 1085341: 32-bit stdio routines should support file descriptors >255 + * 4843136: (process) pipe file descriptor from Runtime.exec not being closed + * 6339493: (process) Runtime.exec does not close all file descriptors on Solaris 9 + */ +#ifdef FD_CLOEXEC + { + int flags = ::fcntl(fd, F_GETFD); + if (flags != -1) + ::fcntl(fd, F_SETFD, flags | FD_CLOEXEC); + } +#endif + + if (o_delete != 0) { + ::unlink(path); + } + return fd; +} + // create binary file, rewriting existing file if required int os::create_binary_file(const char* path, bool rewrite_existing) { int oflags = O_WRONLY | O_CREAT; @@ -5103,6 +5315,55 @@ jlong os::seek_to_file_offset(int fd, jlong offset) { return (jlong)::lseek64(fd, (off64_t)offset, SEEK_SET); } +jlong os::lseek(int fd, jlong offset, int whence) { + return (jlong) ::lseek64(fd, offset, whence); +} + +char * os::native_path(char *path) { + return path; +} + +int os::ftruncate(int fd, jlong length) { + return ::ftruncate64(fd, length); +} + +int os::fsync(int fd) { + RESTARTABLE_RETURN_INT(::fsync(fd)); +} + +int os::available(int fd, jlong *bytes) { + jlong cur, end; + int mode; + struct stat64 buf64; + + if (::fstat64(fd, &buf64) >= 0) { + mode = buf64.st_mode; + if (S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) { + /* + * XXX: is the following call interruptible? If so, this might + * need to go through the INTERRUPT_IO() wrapper as for other + * blocking, interruptible calls in this file. + */ + int n,ioctl_return; + + INTERRUPTIBLE(::ioctl(fd, FIONREAD, &n),ioctl_return,os::Solaris::clear_interrupted); + if (ioctl_return>= 0) { + *bytes = n; + return 1; + } + } + } + if ((cur = ::lseek64(fd, 0L, SEEK_CUR)) == -1) { + return 0; + } else if ((end = ::lseek64(fd, 0L, SEEK_END)) == -1) { + return 0; + } else if (::lseek64(fd, cur, SEEK_SET) == -1) { + return 0; + } + *bytes = end - cur; + return 1; +} + // Map a block of memory. char* os::map_memory(int fd, const char* file_name, size_t file_offset, char *addr, size_t bytes, bool read_only, @@ -5161,7 +5422,7 @@ void os::pause() { int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (fd != -1) { struct stat buf; - close(fd); + ::close(fd); while (::stat(filename, &buf) == 0) { (void)::poll(NULL, 0, 100); } @@ -5358,16 +5619,16 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) { sprintf(proc_name, "/proc/%d/lwp/%d/lwpusage", getpid(), thread->osthread()->lwp_id()); - fd = open(proc_name, O_RDONLY); + fd = ::open(proc_name, O_RDONLY); if ( fd == -1 ) return -1; do { - count = pread(fd, + count = ::pread(fd, (void *)&prusage.pr_utime, thr_time_size, thr_time_off); } while (count < 0 && errno == EINTR); - close(fd); + ::close(fd); if ( count < 0 ) return -1; if (user_sys_cpu_time) { @@ -5837,7 +6098,7 @@ void Parker::park(bool isAbsolute, jlong time) { // First, demultiplex/decode time arguments timespec absTime; - if (time < 0) { // don't wait at all + if (time < 0 || (isAbsolute && time == 0) ) { // don't wait at all return; } if (time > 0) { @@ -6039,4 +6300,127 @@ bool os::is_headless_jre() { return true; } +size_t os::write(int fd, const void *buf, unsigned int nBytes) { + INTERRUPTIBLE_RETURN_INT(::write(fd, buf, nBytes), os::Solaris::clear_interrupted); +} + +int os::close(int fd) { + RESTARTABLE_RETURN_INT(::close(fd)); +} + +int os::socket_close(int fd) { + RESTARTABLE_RETURN_INT(::close(fd)); +} + +int os::recv(int fd, char *buf, int nBytes, int flags) { + INTERRUPTIBLE_RETURN_INT(::recv(fd, buf, nBytes, flags), os::Solaris::clear_interrupted); +} + + +int os::send(int fd, char *buf, int nBytes, int flags) { + INTERRUPTIBLE_RETURN_INT(::send(fd, buf, nBytes, flags), os::Solaris::clear_interrupted); +} + +int os::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 +// "wait forever" value. + +int os::timeout(int fd, long timeout) { + int res; + struct timeval t; + julong prevtime, newtime; + static const char* aNull = 0; + struct pollfd pfd; + pfd.fd = fd; + pfd.events = POLLIN; + + gettimeofday(&t, &aNull); + prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000; + + for(;;) { + INTERRUPTIBLE_NORESTART(::poll(&pfd, 1, timeout), res, os::Solaris::clear_interrupted); + if(res == OS_ERR && errno == EINTR) { + if(timeout != -1) { + gettimeofday(&t, &aNull); + newtime = ((julong)t.tv_sec * 1000) + t.tv_usec /1000; + timeout -= newtime - prevtime; + if(timeout <= 0) + return OS_OK; + prevtime = newtime; + } + } else return res; + } +} + +int os::connect(int fd, struct sockaddr *him, int len) { + int _result; + INTERRUPTIBLE_NORESTART(::connect(fd, him, len), _result, + os::Solaris::clear_interrupted); + + // Depending on when thread interruption is reset, _result could be + // one of two values when errno == EINTR + + if (((_result == OS_INTRPT) || (_result == OS_ERR)) + && (errno == EINTR)) { + /* restarting a connect() changes its errno semantics */ + INTERRUPTIBLE(::connect(fd, him, len), _result, + os::Solaris::clear_interrupted); + /* undo these changes */ + if (_result == OS_ERR) { + if (errno == EALREADY) { + errno = EINPROGRESS; /* fall through */ + } else if (errno == EISCONN) { + errno = 0; + return OS_OK; + } + } + } + return _result; + } + +int os::accept(int fd, struct sockaddr *him, int *len) { + if (fd < 0) + return OS_ERR; + INTERRUPTIBLE_RETURN_INT((int)::accept(fd, him,\ + (socklen_t*) len), os::Solaris::clear_interrupted); + } + +int os::recvfrom(int fd, char *buf, int nBytes, int flags, + sockaddr *from, int *fromlen) { + //%%note jvm_r11 + INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes,\ + flags, from, fromlen), os::Solaris::clear_interrupted); +} + +int os::sendto(int fd, char *buf, int len, int flags, + struct sockaddr *to, int tolen) { + //%%note jvm_r11 + INTERRUPTIBLE_RETURN_INT((int)::sendto(fd, buf, len, flags,\ + to, tolen), os::Solaris::clear_interrupted); +} + +int os::socket_available(int fd, jint *pbytes) { + if (fd < 0) + return OS_OK; + + int ret; + + RESTARTABLE(::ioctl(fd, FIONREAD, pbytes), ret); + + //%% note ioctl can return 0 when successful, JVM_SocketAvailable + // is expected to return 0 on failure and 1 on success to the jdk. + + return (ret == OS_ERR) ? 0 : 1; +} + + +int os::bind(int fd, struct sockaddr *him, int len) { + INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),\ + os::Solaris::clear_interrupted); +} diff --git a/hotspot/src/os/solaris/vm/os_solaris.hpp b/hotspot/src/os/solaris/vm/os_solaris.hpp index 07f7c75159f..991cf021082 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.hpp +++ b/hotspot/src/os/solaris/vm/os_solaris.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_SOLARIS_VM_OS_SOLARIS_HPP +#define OS_SOLARIS_VM_OS_SOLARIS_HPP + // Solaris_OS defines the interface to Solaris operating systems class Solaris { @@ -394,3 +397,5 @@ class PlatformParker : public CHeapObj { assert_status(status == 0, status, "mutex_init"); } } ; + +#endif // OS_SOLARIS_VM_OS_SOLARIS_HPP diff --git a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp index 99f5e1aaa79..b1e42a52dcf 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 (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,30 @@ * */ +#ifndef OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP +#define OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP + +#include "runtime/atomic.hpp" +#include "runtime/os.hpp" +#ifdef TARGET_OS_ARCH_solaris_x86 +# include "atomic_solaris_x86.inline.hpp" +# include "orderAccess_solaris_x86.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_solaris_sparc +# include "atomic_solaris_sparc.inline.hpp" +# include "orderAccess_solaris_sparc.inline.hpp" +#endif + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include + inline const char* os::file_separator() { return "/"; } inline const char* os::line_separator() { return "\n"; } inline const char* os::path_separator() { return ":"; } @@ -55,21 +79,19 @@ inline void os::split_reserved_memory(char *base, size_t size, // Bang the shadow pages if they need to be touched to be mapped. inline void os::bang_stack_shadow_pages() { } +inline void os::dll_unload(void *lib) { ::dlclose(lib); } -inline DIR* os::opendir(const char* dirname) -{ +inline DIR* os::opendir(const char* dirname) { assert(dirname != NULL, "just checking"); return ::opendir(dirname); } -inline int os::readdir_buf_size(const char *path) -{ +inline int os::readdir_buf_size(const char *path) { int size = pathconf(path, _PC_NAME_MAX); return (size < 0 ? MAXPATHLEN : size) + sizeof(dirent) + 1; } -inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) -{ +inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) { assert(dirp != NULL, "just checking"); #if defined(_LP64) || defined(_GNU_SOURCE) dirent* p; @@ -85,9 +107,8 @@ inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) #endif // defined(_LP64) || defined(_GNU_SOURCE) } -inline int os::closedir(DIR *dirp) -{ - assert(dirp != NULL, "just checking"); +inline int os::closedir(DIR *dirp) { + assert(dirp != NULL, "argument is NULL"); return ::closedir(dirp); } @@ -207,3 +228,39 @@ do { \ inline bool os::numa_has_static_binding() { return false; } inline bool os::numa_has_group_homing() { return true; } + +inline int os::socket(int domain, int type, int protocol) { + return ::socket(domain, type, protocol); +} + +inline int os::listen(int fd, int count) { + if (fd < 0) return OS_ERR; + + return ::listen(fd, count); +} + +inline int os::socket_shutdown(int fd, int howto){ + return ::shutdown(fd, howto); +} + +inline int os::get_sock_name(int fd, struct sockaddr *him, int *len){ + return ::getsockname(fd, him, (socklen_t*) len); +} + +inline int os::get_host_name(char* name, int namelen){ + return ::gethostname(name, namelen); +} + +inline struct hostent* os::get_host_by_name(char* name) { + return ::gethostbyname(name); +} +inline int os::get_sock_opt(int fd, int level, int optname, + char *optval, int* optlen){ + return ::getsockopt(fd, level, optname, optval, (socklen_t*) optlen); +} + +inline int os::set_sock_opt(int fd, int level, int optname, + const char *optval, int optlen){ + return ::setsockopt(fd, level, optname, optval, optlen); +} +#endif // OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP diff --git a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp index dad0bf353c7..1d1ff260cd8 100644 --- a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp +++ b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,15 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_perfMemory_solaris.cpp.incl" +#include "precompiled.hpp" +#include "classfile/vmSymbols.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" +#include "os_solaris.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/perfMemory.hpp" +#include "utilities/exceptions.hpp" // put OS-includes here # include diff --git a/hotspot/src/os/solaris/vm/stubRoutines_solaris.cpp b/hotspot/src/os/solaris/vm/stubRoutines_solaris.cpp index f827ec7115d..3723a0f7dfa 100644 --- a/hotspot/src/os/solaris/vm/stubRoutines_solaris.cpp +++ b/hotspot/src/os/solaris/vm/stubRoutines_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +22,7 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stubRoutines_solaris.cpp.incl" +#include "precompiled.hpp" +#include "runtime/os.hpp" +#include "runtime/stubRoutines.hpp" + diff --git a/hotspot/src/os/solaris/vm/threadCritical_solaris.cpp b/hotspot/src/os/solaris/vm/threadCritical_solaris.cpp index d629f3da7f3..b658183c2f3 100644 --- a/hotspot/src/os/solaris/vm/threadCritical_solaris.cpp +++ b/hotspot/src/os/solaris/vm/threadCritical_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_threadCritical_solaris.cpp.incl" +#include "precompiled.hpp" +#include "runtime/threadCritical.hpp" +#include "thread_solaris.inline.hpp" // OS-includes here #include diff --git a/hotspot/src/os/solaris/vm/thread_solaris.inline.hpp b/hotspot/src/os/solaris/vm/thread_solaris.inline.hpp index fb0ee5f0f7e..903be9ddc1d 100644 --- a/hotspot/src/os/solaris/vm/thread_solaris.inline.hpp +++ b/hotspot/src/os/solaris/vm/thread_solaris.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,24 @@ * */ +#ifndef OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP +#define OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP + +#include "runtime/atomic.hpp" +#include "runtime/prefetch.hpp" +#include "runtime/thread.hpp" +#include "runtime/threadLocalStorage.hpp" +#ifdef TARGET_OS_ARCH_solaris_x86 +# include "atomic_solaris_x86.inline.hpp" +# include "orderAccess_solaris_x86.inline.hpp" +# include "prefetch_solaris_x86.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_solaris_sparc +# include "atomic_solaris_sparc.inline.hpp" +# include "orderAccess_solaris_sparc.inline.hpp" +# include "prefetch_solaris_sparc.inline.hpp" +#endif + // Thread::current is "hot" it's called > 128K times in the 1st 500 msecs of // startup. // ThreadLocalStorage::thread is warm -- it's called > 16K times in the same @@ -35,11 +53,13 @@ inline Thread* ThreadLocalStorage::thread() { uintptr_t raw = pd_raw_thread_id(); int ix = pd_cache_index(raw); - Thread *Candidate = ThreadLocalStorage::_get_thread_cache[ix]; - if (Candidate->_self_raw_id == raw) { + Thread* candidate = ThreadLocalStorage::_get_thread_cache[ix]; + if (candidate->self_raw_id() == raw) { // hit - return Candidate; + return candidate; } else { return ThreadLocalStorage::get_thread_via_cache_slowly(raw, ix); } } + +#endif // OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP diff --git a/hotspot/src/os/solaris/vm/vmError_solaris.cpp b/hotspot/src/os/solaris/vm/vmError_solaris.cpp index 65026a85488..6f3f5b06fe6 100644 --- a/hotspot/src/os/solaris/vm/vmError_solaris.cpp +++ b/hotspot/src/os/solaris/vm/vmError_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_vmError_solaris.cpp.incl" +#include "precompiled.hpp" +#include "runtime/arguments.hpp" +#include "runtime/os.hpp" +#include "runtime/thread.hpp" +#include "utilities/vmError.hpp" #include #include diff --git a/hotspot/src/os/windows/launcher/java_md.c b/hotspot/src/os/windows/launcher/java_md.c new file mode 100644 index 00000000000..2fde40ad205 --- /dev/null +++ b/hotspot/src/os/windows/launcher/java_md.c @@ -0,0 +1,1512 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "java.h" +#ifndef GAMMA +#include "version_comp.h" +#endif + +#define JVM_DLL "jvm.dll" +#define JAVA_DLL "java.dll" +#define CRT_DLL "msvcr71.dll" + +/* + * Prototypes. + */ +static jboolean GetPublicJREHome(char *path, jint pathsize); +static jboolean GetJVMPath(const char *jrepath, const char *jvmtype, + char *jvmpath, jint jvmpathsize); +static jboolean GetJREPath(char *path, jint pathsize); +static void EnsureJreInstallation(const char *jrepath); + +/* We supports warmup for UI stack that is performed in parallel + * to VM initialization. + * This helps to improve startup of UI application as warmup phase + * might be long due to initialization of OS or hardware resources. + * It is not CPU bound and therefore it does not interfere with VM init. + * Obviously such warmup only has sense for UI apps and therefore it needs + * to be explicitly requested by passing -Dsun.awt.warmup=true property + * (this is always the case for plugin/javaws). + * + * Implementation launches new thread after VM starts and use it to perform + * warmup code (platform dependent). + * This thread is later reused as AWT toolkit thread as graphics toolkit + * often assume that they are used from the same thread they were launched on. + * + * At the moment we only support warmup for D3D. It only possible on windows + * and only if other flags do not prohibit this (e.g. OpenGL support requested). + */ +#undef ENABLE_AWT_PRELOAD +#ifndef JAVA_ARGS /* turn off AWT preloading for javac, jar, etc */ + #ifdef _X86_ /* for now disable AWT preloading for 64bit */ + #define ENABLE_AWT_PRELOAD + #endif +#endif + +#ifdef ENABLE_AWT_PRELOAD +/* "AWT was preloaded" flag; + * Turned on by AWTPreload(). + */ +int awtPreloaded = 0; + +/* Calls a function with the name specified. + * The function must be int(*fn)(void). + */ +int AWTPreload(const char *funcName); +/* Stops AWT preloading. */ +void AWTPreloadStop(); + +/* D3D preloading */ +/* -1: not initialized; 0: OFF, 1: ON */ +int awtPreloadD3D = -1; +/* Command line parameter to swith D3D preloading on. */ +#define PARAM_PRELOAD_D3D "-Dsun.awt.warmup" +/* D3D/OpenGL management parameters (may disable D3D preloading) */ +#define PARAM_NODDRAW "-Dsun.java2d.noddraw" +#define PARAM_D3D "-Dsun.java2d.d3d" +#define PARAM_OPENGL "-Dsun.java2d.opengl" +/* funtion in awt.dll (src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp) */ +#define D3D_PRELOAD_FUNC "preloadD3D" + + +/* Extracts value of a parameter with the specified name + * from command line argument (returns pointer in the argument). + * Returns NULL if the argument does not contains the parameter. + * e.g.: + * GetParamValue("theParam", "theParam=value") returns pointer to "value". + */ +const char * GetParamValue(const char *paramName, const char *arg) { + int nameLen = strlen(paramName); + if (strncmp(paramName, arg, nameLen) == 0) { + // arg[nameLen] is valid (may contain final NULL) + if (arg[nameLen] == '=') { + return arg + nameLen + 1; + } + } + return NULL; +} + +/* Checks if commandline argument contains property specified + * and analyze it as boolean property (true/false). + * Returns -1 if the argument does not contain the parameter; + * Returns 1 if the argument contains the parameter and its value is "true"; + * Returns 0 if the argument contains the parameter and its value is "false". + */ +int GetBoolParamValue(const char *paramName, const char *arg) { + const char * paramValue = GetParamValue(paramName, arg); + if (paramValue != NULL) { + if (stricmp(paramValue, "true") == 0) { + return 1; + } + if (stricmp(paramValue, "false") == 0) { + return 0; + } + } + return -1; +} +#endif /* ENABLE_AWT_PRELOAD */ + + +const char * +GetArch() +{ + +#ifdef _M_AMD64 + return "amd64"; +#elif defined(_M_IA64) + return "ia64"; +#else + return "i386"; +#endif +} + +/* + * + */ +void +CreateExecutionEnvironment(int *_argc, + char ***_argv, + char jrepath[], + jint so_jrepath, + char jvmpath[], + jint so_jvmpath, + char **original_argv) { +#ifndef GAMMA + char * jvmtype; + + /* Find out where the JRE is that we will be using. */ + if (!GetJREPath(jrepath, so_jrepath)) { + ReportErrorMessage("Error: could not find Java SE Runtime Environment.", + JNI_TRUE); + exit(2); + } + + /* Do this before we read jvm.cfg */ + EnsureJreInstallation(jrepath); + + /* Find the specified JVM type */ + if (ReadKnownVMs(jrepath, (char*)GetArch(), JNI_FALSE) < 1) { + ReportErrorMessage("Error: no known VMs. (check for corrupt jvm.cfg file)", + JNI_TRUE); + exit(1); + } + jvmtype = CheckJvmType(_argc, _argv, JNI_FALSE); + + jvmpath[0] = '\0'; + if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath)) { + char * message=NULL; + const char * format = "Error: no `%s' JVM at `%s'."; + message = (char *)JLI_MemAlloc((strlen(format)+strlen(jvmtype)+ + strlen(jvmpath)) * sizeof(char)); + sprintf(message,format, jvmtype, jvmpath); + ReportErrorMessage(message, JNI_TRUE); + exit(4); + } + /* If we got here, jvmpath has been correctly initialized. */ + +#else /* ifndef GAMMA */ + + /* + * gamma launcher is simpler in that it doesn't handle VM flavors, data + * model, etc. Assuming everything is set-up correctly + * all we need to do here is to return correct path names. See also + * GetJVMPath() and GetApplicationHome(). + */ + + { + if (!GetJREPath(jrepath, so_jrepath) ) { + ReportErrorMessage("Error: could not find Java SE Runtime Environment.", + JNI_TRUE); + exit(2); + } + + if (!GetJVMPath(jrepath, NULL, jvmpath, so_jvmpath)) { + char * message=NULL; + const char * format = "Error: no JVM at `%s'."; + message = (char *)JLI_MemAlloc((strlen(format)+ + strlen(jvmpath)) * sizeof(char)); + sprintf(message, format, jvmpath); + ReportErrorMessage(message, JNI_TRUE); + exit(4); + } + } + +#endif /* ifndef GAMMA */ + +} + + +static jboolean +LoadMSVCRT() +{ + // Only do this once + static int loaded = 0; + char crtpath[MAXPATHLEN]; + + if (!loaded) { + /* + * The Microsoft C Runtime Library needs to be loaded first. A copy is + * assumed to be present in the "JRE path" directory. If it is not found + * there (or "JRE path" fails to resolve), skip the explicit load and let + * nature take its course, which is likely to be a failure to execute. + */ + if (GetJREPath(crtpath, MAXPATHLEN)) { + (void)strcat(crtpath, "\\bin\\" CRT_DLL); /* Add crt dll */ + if (_launcher_debug) { + printf("CRT path is %s\n", crtpath); + } + if (_access(crtpath, 0) == 0) { + if (LoadLibrary(crtpath) == 0) { + ReportErrorMessage2("Error loading: %s", crtpath, JNI_TRUE); + return JNI_FALSE; + } + } + } + loaded = 1; + } + return JNI_TRUE; +} + +/* + * The preJVMStart is a function in the jkernel.dll, which + * performs the final step of synthesizing back the decomposed + * modules (partial install) to the full JRE. Any tool which + * uses the JRE must peform this step to ensure the complete synthesis. + * The EnsureJreInstallation function calls preJVMStart based on + * the conditions outlined below, noting that the operation + * will fail silently if any of conditions are not met. + * NOTE: this call must be made before jvm.dll is loaded, or jvm.cfg + * is read, since jvm.cfg will be modified by the preJVMStart. + * 1. Are we on a supported platform. + * 2. Find the location of the JRE or the Kernel JRE. + * 3. check existence of JREHOME/lib/bundles + * 4. check jkernel.dll and invoke the entry-point + */ +typedef VOID (WINAPI *PREJVMSTART)(); + +static void +EnsureJreInstallation(const char* jrepath) +{ + HINSTANCE handle; + char tmpbuf[MAXPATHLEN]; + PREJVMSTART PreJVMStart; + struct stat s; + + /* 32 bit windows only please */ + if (strcmp(GetArch(), "i386") != 0 ) { + if (_launcher_debug) { + printf("EnsureJreInstallation:unsupported platform\n"); + } + return; + } + /* Does our bundle directory exist ? */ + strcpy(tmpbuf, jrepath); + strcat(tmpbuf, "\\lib\\bundles"); + if (stat(tmpbuf, &s) != 0) { + if (_launcher_debug) { + printf("EnsureJreInstallation:<%s>:not found\n", tmpbuf); + } + return; + } + /* Does our jkernel dll exist ? */ + strcpy(tmpbuf, jrepath); + strcat(tmpbuf, "\\bin\\jkernel.dll"); + if (stat(tmpbuf, &s) != 0) { + if (_launcher_debug) { + printf("EnsureJreInstallation:<%s>:not found\n", tmpbuf); + } + return; + } + /* The Microsoft C Runtime Library needs to be loaded first. */ + if (!LoadMSVCRT()) { + if (_launcher_debug) { + printf("EnsureJreInstallation:could not load C runtime DLL\n"); + } + return; + } + /* Load the jkernel.dll */ + if ((handle = LoadLibrary(tmpbuf)) == 0) { + if (_launcher_debug) { + printf("EnsureJreInstallation:%s:load failed\n", tmpbuf); + } + return; + } + /* Get the function address */ + PreJVMStart = (PREJVMSTART)GetProcAddress(handle, "preJVMStart"); + if (PreJVMStart == NULL) { + if (_launcher_debug) { + printf("EnsureJreInstallation:preJVMStart:function lookup failed\n"); + } + FreeLibrary(handle); + return; + } + PreJVMStart(); + if (_launcher_debug) { + printf("EnsureJreInstallation:preJVMStart:called\n"); + } + FreeLibrary(handle); + return; +} + +/* + * Find path to JRE based on .exe's location or registry settings. + */ +jboolean +GetJREPath(char *path, jint pathsize) +{ + char javadll[MAXPATHLEN]; + struct stat s; + + if (GetApplicationHome(path, pathsize)) { + /* Is JRE co-located with the application? */ + sprintf(javadll, "%s\\bin\\" JAVA_DLL, path); + if (stat(javadll, &s) == 0) { + goto found; + } + + /* Does this app ship a private JRE in \jre directory? */ + sprintf(javadll, "%s\\jre\\bin\\" JAVA_DLL, path); + if (stat(javadll, &s) == 0) { + strcat(path, "\\jre"); + goto found; + } + } + +#ifndef GAMMA + /* Look for a public JRE on this machine. */ + if (GetPublicJREHome(path, pathsize)) { + goto found; + } +#endif + + fprintf(stderr, "Error: could not find " JAVA_DLL "\n"); + return JNI_FALSE; + + found: + if (_launcher_debug) + printf("JRE path is %s\n", path); + return JNI_TRUE; +} + +/* + * Given a JRE location and a JVM type, construct what the name the + * JVM shared library will be. Return true, if such a library + * exists, false otherwise. + */ +static jboolean +GetJVMPath(const char *jrepath, const char *jvmtype, + char *jvmpath, jint jvmpathsize) +{ + struct stat s; + +#ifndef GAMMA + if (strchr(jvmtype, '/') || strchr(jvmtype, '\\')) { + sprintf(jvmpath, "%s\\" JVM_DLL, jvmtype); + } else { + sprintf(jvmpath, "%s\\bin\\%s\\" JVM_DLL, jrepath, jvmtype); + } +#else + /* + * For gamma launcher, JVM is either built-in or in the same directory. + * Either way we return "/jvm.dll" where is the + * directory where gamma launcher is located. + */ + + char *p; + GetModuleFileName(0, jvmpath, jvmpathsize); + + p = strrchr(jvmpath, '\\'); + if (p) { + /* replace executable name with libjvm.so */ + snprintf(p + 1, jvmpathsize - (p + 1 - jvmpath), "%s", JVM_DLL); + } else { + /* this case shouldn't happen */ + snprintf(jvmpath, jvmpathsize, "%s", JVM_DLL); + } +#endif /* ifndef GAMMA */ + + if (stat(jvmpath, &s) == 0) { + return JNI_TRUE; + } else { + return JNI_FALSE; + } +} + +/* + * Load a jvm from "jvmpath" and initialize the invocation functions. + */ +jboolean +LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn) +{ +#ifdef GAMMA + /* JVM is directly linked with gamma launcher; no Loadlibrary() */ + ifn->CreateJavaVM = JNI_CreateJavaVM; + ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs; + return JNI_TRUE; +#else + HINSTANCE handle; + + if (_launcher_debug) { + printf("JVM path is %s\n", jvmpath); + } + + /* The Microsoft C Runtime Library needs to be loaded first. */ + LoadMSVCRT(); + + /* Load the Java VM DLL */ + if ((handle = LoadLibrary(jvmpath)) == 0) { + ReportErrorMessage2("Error loading: %s", (char *)jvmpath, JNI_TRUE); + return JNI_FALSE; + } + + /* Now get the function addresses */ + ifn->CreateJavaVM = + (void *)GetProcAddress(handle, "JNI_CreateJavaVM"); + ifn->GetDefaultJavaVMInitArgs = + (void *)GetProcAddress(handle, "JNI_GetDefaultJavaVMInitArgs"); + if (ifn->CreateJavaVM == 0 || ifn->GetDefaultJavaVMInitArgs == 0) { + ReportErrorMessage2("Error: can't find JNI interfaces in: %s", + (char *)jvmpath, JNI_TRUE); + return JNI_FALSE; + } + + return JNI_TRUE; +#endif /* ifndef GAMMA */ +} + +/* + * If app is "c:\foo\bin\javac", then put "c:\foo" into buf. + */ +jboolean +GetApplicationHome(char *buf, jint bufsize) +{ +#ifndef GAMMA + char *cp; + GetModuleFileName(0, buf, bufsize); + *strrchr(buf, '\\') = '\0'; /* remove .exe file name */ + if ((cp = strrchr(buf, '\\')) == 0) { + /* This happens if the application is in a drive root, and + * there is no bin directory. */ + buf[0] = '\0'; + return JNI_FALSE; + } + *cp = '\0'; /* remove the bin\ part */ + return JNI_TRUE; + +#else /* ifndef GAMMA */ + + char env[MAXPATHLEN + 1]; + + /* gamma launcher uses ALT_JAVA_HOME environment variable or jdkpath.txt file to find JDK/JRE */ + + if (getenv("ALT_JAVA_HOME") != NULL) { + snprintf(buf, bufsize, "%s", getenv("ALT_JAVA_HOME")); + } + else { + char path[MAXPATHLEN + 1]; + char* p; + int len; + FILE* fp; + + // find the path to the currect executable + len = GetModuleFileName(NULL, path, MAXPATHLEN + 1); + if (len == 0 || len > MAXPATHLEN) { + printf("Could not get directory of current executable."); + return JNI_FALSE; + } + // remove last path component ("hotspot.exe") + p = strrchr(path, '\\'); + if (p == NULL) { + printf("Could not parse directory of current executable.\n"); + return JNI_FALSE; + } + *p = '\0'; + + // open jdkpath.txt and read JAVA_HOME from it + if (strlen(path) + strlen("\\jdkpath.txt") + 1 >= MAXPATHLEN) { + printf("Path too long: %s\n", path); + return JNI_FALSE; + } + strcat(path, "\\jdkpath.txt"); + fp = fopen(path, "r"); + if (fp == NULL) { + printf("Could not open file %s to get path to JDK.\n", path); + return JNI_FALSE; + } + + if (fgets(buf, bufsize, fp) == NULL) { + printf("Could not read from file %s to get path to JDK.\n", path); + fclose(fp); + return JNI_FALSE; + } + // trim the buffer + p = buf + strlen(buf) - 1; + while(isspace(*p)) { + *p = '\0'; + p--; + } + fclose(fp); + } + + _snprintf(env, MAXPATHLEN, "JAVA_HOME=%s", buf); + _putenv(env); + + return JNI_TRUE; +#endif /* ifndef GAMMA */ +} + +#ifdef JAVAW +__declspec(dllimport) char **__initenv; + +int WINAPI +WinMain(HINSTANCE inst, HINSTANCE previnst, LPSTR cmdline, int cmdshow) +{ + int ret; + + __initenv = _environ; + ret = main(__argc, __argv); + + return ret; +} +#endif + +#ifndef GAMMA + +/* + * Helpers to look in the registry for a public JRE. + */ + /* Same for 1.5.0, 1.5.1, 1.5.2 etc. */ +#define DOTRELEASE JDK_MAJOR_VERSION "." JDK_MINOR_VERSION +#define JRE_KEY "Software\\JavaSoft\\Java Runtime Environment" + +static jboolean +GetStringFromRegistry(HKEY key, const char *name, char *buf, jint bufsize) +{ + DWORD type, size; + + if (RegQueryValueEx(key, name, 0, &type, 0, &size) == 0 + && type == REG_SZ + && (size < (unsigned int)bufsize)) { + if (RegQueryValueEx(key, name, 0, 0, buf, &size) == 0) { + return JNI_TRUE; + } + } + return JNI_FALSE; +} + +static jboolean +GetPublicJREHome(char *buf, jint bufsize) +{ + HKEY key, subkey; + char version[MAXPATHLEN]; + + /* + * Note: There is a very similar implementation of the following + * registry reading code in the Windows java control panel (javacp.cpl). + * If there are bugs here, a similar bug probably exists there. Hence, + * changes here require inspection there. + */ + + /* Find the current version of the JRE */ + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, JRE_KEY, 0, KEY_READ, &key) != 0) { + fprintf(stderr, "Error opening registry key '" JRE_KEY "'\n"); + return JNI_FALSE; + } + + if (!GetStringFromRegistry(key, "CurrentVersion", + version, sizeof(version))) { + fprintf(stderr, "Failed reading value of registry key:\n\t" + JRE_KEY "\\CurrentVersion\n"); + RegCloseKey(key); + return JNI_FALSE; + } + + if (strcmp(version, DOTRELEASE) != 0) { + fprintf(stderr, "Registry key '" JRE_KEY "\\CurrentVersion'\nhas " + "value '%s', but '" DOTRELEASE "' is required.\n", version); + RegCloseKey(key); + return JNI_FALSE; + } + + /* Find directory where the current version is installed. */ + if (RegOpenKeyEx(key, version, 0, KEY_READ, &subkey) != 0) { + fprintf(stderr, "Error opening registry key '" + JRE_KEY "\\%s'\n", version); + RegCloseKey(key); + return JNI_FALSE; + } + + if (!GetStringFromRegistry(subkey, "JavaHome", buf, bufsize)) { + fprintf(stderr, "Failed reading value of registry key:\n\t" + JRE_KEY "\\%s\\JavaHome\n", version); + RegCloseKey(key); + RegCloseKey(subkey); + return JNI_FALSE; + } + + if (_launcher_debug) { + char micro[MAXPATHLEN]; + if (!GetStringFromRegistry(subkey, "MicroVersion", micro, + sizeof(micro))) { + printf("Warning: Can't read MicroVersion\n"); + micro[0] = '\0'; + } + printf("Version major.minor.micro = %s.%s\n", version, micro); + } + + RegCloseKey(key); + RegCloseKey(subkey); + return JNI_TRUE; +} + +#endif /* ifndef GAMMA */ + +/* + * Support for doing cheap, accurate interval timing. + */ +static jboolean counterAvailable = JNI_FALSE; +static jboolean counterInitialized = JNI_FALSE; +static LARGE_INTEGER counterFrequency; + +jlong CounterGet() +{ + LARGE_INTEGER count; + + if (!counterInitialized) { + counterAvailable = QueryPerformanceFrequency(&counterFrequency); + counterInitialized = JNI_TRUE; + } + if (!counterAvailable) { + return 0; + } + QueryPerformanceCounter(&count); + return (jlong)(count.QuadPart); +} + +jlong Counter2Micros(jlong counts) +{ + if (!counterAvailable || !counterInitialized) { + return 0; + } + return (counts * 1000 * 1000)/counterFrequency.QuadPart; +} + +void ReportErrorMessage(char * message, jboolean always) { +#ifdef JAVAW + if (message != NULL) { + MessageBox(NULL, message, "Java Virtual Machine Launcher", + (MB_OK|MB_ICONSTOP|MB_APPLMODAL)); + } +#else + if (always) { + fprintf(stderr, "%s\n", message); + } +#endif +} + +void ReportErrorMessage2(char * format, char * string, jboolean always) { + /* + * The format argument must be a printf format string with one %s + * argument, which is passed the string argument. + */ +#ifdef JAVAW + size_t size; + char * message; + size = strlen(format) + strlen(string); + message = (char*)JLI_MemAlloc(size*sizeof(char)); + sprintf(message, (const char *)format, string); + + if (message != NULL) { + MessageBox(NULL, message, "Java Virtual Machine Launcher", + (MB_OK|MB_ICONSTOP|MB_APPLMODAL)); + JLI_MemFree(message); + } +#else + if (always) { + fprintf(stderr, (const char *)format, string); + fprintf(stderr, "\n"); + } +#endif +} + +/* + * As ReportErrorMessage2 (above) except the system message (if any) + * associated with this error is written to a second %s format specifier + * in the format argument. + */ +void ReportSysErrorMessage2(char * format, char * string, jboolean always) { + int save_errno = errno; + DWORD errval; + int freeit = 0; + char *errtext = NULL; + + if ((errval = GetLastError()) != 0) { /* Platform SDK / DOS Error */ + int n = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM| + FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_ALLOCATE_BUFFER, + NULL, errval, 0, (LPTSTR)&errtext, 0, NULL); + if (errtext == NULL || n == 0) { /* Paranoia check */ + errtext = ""; + n = 0; + } else { + freeit = 1; + if (n > 2) { /* Drop final CR, LF */ + if (errtext[n - 1] == '\n') n--; + if (errtext[n - 1] == '\r') n--; + errtext[n] = '\0'; + } + } + } else /* C runtime error that has no corresponding DOS error code */ + errtext = strerror(save_errno); + +#ifdef JAVAW + { + size_t size; + char * message; + size = strlen(format) + strlen(string) + strlen(errtext); + message = (char*)JLI_MemAlloc(size*sizeof(char)); + sprintf(message, (const char *)format, string, errtext); + + if (message != NULL) { + MessageBox(NULL, message, "Java Virtual Machine Launcher", + (MB_OK|MB_ICONSTOP|MB_APPLMODAL)); + JLI_MemFree(message); + } + } +#else + if (always) { + fprintf(stderr, (const char *)format, string, errtext); + fprintf(stderr, "\n"); + } +#endif + if (freeit) + (void)LocalFree((HLOCAL)errtext); +} + +void ReportExceptionDescription(JNIEnv * env) { +#ifdef JAVAW + /* + * This code should be replaced by code which opens a window with + * the exception detail message. + */ + (*env)->ExceptionDescribe(env); +#else + (*env)->ExceptionDescribe(env); +#endif +} + + +/* + * Return JNI_TRUE for an option string that has no effect but should + * _not_ be passed on to the vm; return JNI_FALSE otherwise. On + * windows, there are no options that should be screened in this + * manner. + */ +jboolean RemovableMachineDependentOption(char * option) { +#ifdef ENABLE_AWT_PRELOAD + if (awtPreloadD3D < 0) { + /* Tests the command line parameter only if not set yet. */ + if (GetBoolParamValue(PARAM_PRELOAD_D3D, option) == 1) { + awtPreloadD3D = 1; + } + } + if (awtPreloadD3D != 0) { + /* Don't test the command line parameters if already disabled. */ + if (GetBoolParamValue(PARAM_NODDRAW, option) == 1 + || GetBoolParamValue(PARAM_D3D, option) == 0 + || GetBoolParamValue(PARAM_OPENGL, option) == 1) + { + awtPreloadD3D = 0; + } + } +#endif /* ENABLE_AWT_PRELOAD */ + + return JNI_FALSE; +} + +void PrintMachineDependentOptions() { + return; +} + +#ifndef GAMMA + +jboolean +ServerClassMachine() { + jboolean result = JNI_FALSE; +#if defined(NEVER_ACT_AS_SERVER_CLASS_MACHINE) + result = JNI_FALSE; +#elif defined(ALWAYS_ACT_AS_SERVER_CLASS_MACHINE) + result = JNI_TRUE; +#endif + return result; +} + +/* + * Determine if there is an acceptable JRE in the registry directory top_key. + * Upon locating the "best" one, return a fully qualified path to it. + * "Best" is defined as the most advanced JRE meeting the constraints + * contained in the manifest_info. If no JRE in this directory meets the + * constraints, return NULL. + * + * It doesn't matter if we get an error reading the registry, or we just + * don't find anything interesting in the directory. We just return NULL + * in either case. + */ +static char * +ProcessDir(manifest_info* info, HKEY top_key) { + DWORD index = 0; + HKEY ver_key; + char name[MAXNAMELEN]; + int len; + char *best = NULL; + + /* + * Enumerate "/SOFTWARE/JavaSoft/Java Runtime Environment" + * searching for the best available version. + */ + while (RegEnumKey(top_key, index, name, MAXNAMELEN) == ERROR_SUCCESS) { + index++; + if (JLI_AcceptableRelease(name, info->jre_version)) + if ((best == NULL) || (JLI_ExactVersionId(name, best) > 0)) { + if (best != NULL) + JLI_MemFree(best); + best = JLI_StringDup(name); + } + } + + /* + * Extract "JavaHome" from the "best" registry directory and return + * that path. If no appropriate version was located, or there is an + * error in extracting the "JavaHome" string, return null. + */ + if (best == NULL) + return (NULL); + else { + if (RegOpenKeyEx(top_key, best, 0, KEY_READ, &ver_key) + != ERROR_SUCCESS) { + JLI_MemFree(best); + if (ver_key != NULL) + RegCloseKey(ver_key); + return (NULL); + } + JLI_MemFree(best); + len = MAXNAMELEN; + if (RegQueryValueEx(ver_key, "JavaHome", NULL, NULL, (LPBYTE)name, &len) + != ERROR_SUCCESS) { + if (ver_key != NULL) + RegCloseKey(ver_key); + return (NULL); + } + if (ver_key != NULL) + RegCloseKey(ver_key); + return (JLI_StringDup(name)); + } +} + +/* + * This is the global entry point. It examines the host for the optimal + * JRE to be used by scanning a set of registry entries. This set of entries + * is hardwired on Windows as "Software\JavaSoft\Java Runtime Environment" + * under the set of roots "{ HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE }". + * + * This routine simply opens each of these registry directories before passing + * control onto ProcessDir(). + */ +char * +LocateJRE(manifest_info* info) { + HKEY key = NULL; + char *path; + int key_index; + HKEY root_keys[2] = { HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE }; + + for (key_index = 0; key_index <= 1; key_index++) { + if (RegOpenKeyEx(root_keys[key_index], JRE_KEY, 0, KEY_READ, &key) + == ERROR_SUCCESS) + if ((path = ProcessDir(info, key)) != NULL) { + if (key != NULL) + RegCloseKey(key); + return (path); + } + if (key != NULL) + RegCloseKey(key); + } + return NULL; +} + + +/* + * Local helper routine to isolate a single token (option or argument) + * from the command line. + * + * This routine accepts a pointer to a character pointer. The first + * token (as defined by MSDN command-line argument syntax) is isolated + * from that string. + * + * Upon return, the input character pointer pointed to by the parameter s + * is updated to point to the remainding, unscanned, portion of the string, + * or to a null character if the entire string has been consummed. + * + * This function returns a pointer to a null-terminated string which + * contains the isolated first token, or to the null character if no + * token could be isolated. + * + * Note the side effect of modifying the input string s by the insertion + * of a null character, making it two strings. + * + * See "Parsing C Command-Line Arguments" in the MSDN Library for the + * parsing rule details. The rule summary from that specification is: + * + * * Arguments are delimited by white space, which is either a space or a tab. + * + * * A string surrounded by double quotation marks is interpreted as a single + * argument, regardless of white space contained within. A quoted string can + * be embedded in an argument. Note that the caret (^) is not recognized as + * an escape character or delimiter. + * + * * A double quotation mark preceded by a backslash, \", is interpreted as a + * literal double quotation mark ("). + * + * * Backslashes are interpreted literally, unless they immediately precede a + * double quotation mark. + * + * * If an even number of backslashes is followed by a double quotation mark, + * then one backslash (\) is placed in the argv array for every pair of + * backslashes (\\), and the double quotation mark (") is interpreted as a + * string delimiter. + * + * * If an odd number of backslashes is followed by a double quotation mark, + * then one backslash (\) is placed in the argv array for every pair of + * backslashes (\\) and the double quotation mark is interpreted as an + * escape sequence by the remaining backslash, causing a literal double + * quotation mark (") to be placed in argv. + */ +static char* +nextarg(char** s) { + char *p = *s; + char *head; + int slashes = 0; + int inquote = 0; + + /* + * Strip leading whitespace, which MSDN defines as only space or tab. + * (Hence, no locale specific "isspace" here.) + */ + while (*p != (char)0 && (*p == ' ' || *p == '\t')) + p++; + head = p; /* Save the start of the token to return */ + + /* + * Isolate a token from the command line. + */ + while (*p != (char)0 && (inquote || !(*p == ' ' || *p == '\t'))) { + if (*p == '\\' && *(p+1) == '"' && slashes % 2 == 0) + p++; + else if (*p == '"') + inquote = !inquote; + slashes = (*p++ == '\\') ? slashes + 1 : 0; + } + + /* + * If the token isolated isn't already terminated in a "char zero", + * then replace the whitespace character with one and move to the + * next character. + */ + if (*p != (char)0) + *p++ = (char)0; + + /* + * Update the parameter to point to the head of the remaining string + * reflecting the command line and return a pointer to the leading + * token which was isolated from the command line. + */ + *s = p; + return (head); +} + +/* + * Local helper routine to return a string equivalent to the input string + * s, but with quotes removed so the result is a string as would be found + * in argv[]. The returned string should be freed by a call to JLI_MemFree(). + * + * The rules for quoting (and escaped quotes) are: + * + * 1 A double quotation mark preceded by a backslash, \", is interpreted as a + * literal double quotation mark ("). + * + * 2 Backslashes are interpreted literally, unless they immediately precede a + * double quotation mark. + * + * 3 If an even number of backslashes is followed by a double quotation mark, + * then one backslash (\) is placed in the argv array for every pair of + * backslashes (\\), and the double quotation mark (") is interpreted as a + * string delimiter. + * + * 4 If an odd number of backslashes is followed by a double quotation mark, + * then one backslash (\) is placed in the argv array for every pair of + * backslashes (\\) and the double quotation mark is interpreted as an + * escape sequence by the remaining backslash, causing a literal double + * quotation mark (") to be placed in argv. + */ +static char* +unquote(const char *s) { + const char *p = s; /* Pointer to the tail of the original string */ + char *un = (char*)JLI_MemAlloc(strlen(s) + 1); /* Ptr to unquoted string */ + char *pun = un; /* Pointer to the tail of the unquoted string */ + + while (*p != '\0') { + if (*p == '"') { + p++; + } else if (*p == '\\') { + const char *q = p + strspn(p,"\\"); + if (*q == '"') + do { + *pun++ = '\\'; + p += 2; + } while (*p == '\\' && p < q); + else + while (p < q) + *pun++ = *p++; + } else { + *pun++ = *p++; + } + } + *pun = '\0'; + return un; +} + +/* + * Given a path to a jre to execute, this routine checks if this process + * is indeed that jre. If not, it exec's that jre. + * + * We want to actually check the paths rather than just the version string + * built into the executable, so that given version specification will yield + * the exact same Java environment, regardless of the version of the arbitrary + * launcher we start with. + */ +void +ExecJRE(char *jre, char **argv) { + int len; + char *progname; + char path[MAXPATHLEN + 1]; + + /* + * Determine the executable we are building (or in the rare case, running). + */ +#ifdef JAVA_ARGS /* javac, jar and friends. */ + progname = "java"; +#else /* java, oldjava, javaw and friends */ +#ifdef PROGNAME + progname = PROGNAME; +#else + { + char *s; + progname = *argv; + if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) { + progname = s + 1; + } + } +#endif /* PROGNAME */ +#endif /* JAVA_ARGS */ + + /* + * Resolve the real path to the currently running launcher. + */ + len = GetModuleFileName(NULL, path, MAXPATHLEN + 1); + if (len == 0 || len > MAXPATHLEN) { + ReportSysErrorMessage2( + "Unable to resolve path to current %s executable: %s", + progname, JNI_TRUE); + exit(1); + } + + if (_launcher_debug) { + printf("ExecJRE: old: %s\n", path); + printf("ExecJRE: new: %s\n", jre); + } + + /* + * If the path to the selected JRE directory is a match to the initial + * portion of the path to the currently executing JRE, we have a winner! + * If so, just return. (strnicmp() is the Windows equiv. of strncasecmp().) + */ + if (strnicmp(jre, path, strlen(jre)) == 0) + return; /* I am the droid you were looking for */ + + /* + * If this isn't the selected version, exec the selected version. + */ + (void)strcat(strcat(strcpy(path, jre), "\\bin\\"), progname); + (void)strcat(path, ".exe"); + + /* + * Although Windows has an execv() entrypoint, it doesn't actually + * overlay a process: it can only create a new process and terminate + * the old process. Therefore, any processes waiting on the initial + * process wake up and they shouldn't. Hence, a chain of pseudo-zombie + * processes must be retained to maintain the proper wait semantics. + * Fortunately the image size of the launcher isn't too large at this + * time. + * + * If it weren't for this semantic flaw, the code below would be ... + * + * execv(path, argv); + * ReportErrorMessage2("Exec of %s failed\n", path, JNI_TRUE); + * exit(1); + * + * The incorrect exec semantics could be addressed by: + * + * exit((int)spawnv(_P_WAIT, path, argv)); + * + * Unfortunately, a bug in Windows spawn/exec impementation prevents + * this from completely working. All the Windows POSIX process creation + * interfaces are implemented as wrappers around the native Windows + * function CreateProcess(). CreateProcess() takes a single string + * to specify command line options and arguments, so the POSIX routine + * wrappers build a single string from the argv[] array and in the + * process, any quoting information is lost. + * + * The solution to this to get the original command line, to process it + * to remove the new multiple JRE options (if any) as was done for argv + * in the common SelectVersion() routine and finally to pass it directly + * to the native CreateProcess() Windows process control interface. + */ + { + char *cmdline; + char *p; + char *np; + char *ocl; + char *ccl; + char *unquoted; + DWORD exitCode; + STARTUPINFO si; + PROCESS_INFORMATION pi; + + /* + * The following code block gets and processes the original command + * line, replacing the argv[0] equivalent in the command line with + * the path to the new executable and removing the appropriate + * Multiple JRE support options. Note that similar logic exists + * in the platform independent SelectVersion routine, but is + * replicated here due to the syntax of CreateProcess(). + * + * The magic "+ 4" characters added to the command line length are + * 2 possible quotes around the path (argv[0]), a space after the + * path and a terminating null character. + */ + ocl = GetCommandLine(); + np = ccl = JLI_StringDup(ocl); + p = nextarg(&np); /* Discard argv[0] */ + cmdline = (char *)JLI_MemAlloc(strlen(path) + strlen(np) + 4); + if (strchr(path, (int)' ') == NULL && strchr(path, (int)'\t') == NULL) + cmdline = strcpy(cmdline, path); + else + cmdline = strcat(strcat(strcpy(cmdline, "\""), path), "\""); + + while (*np != (char)0) { /* While more command-line */ + p = nextarg(&np); + if (*p != (char)0) { /* If a token was isolated */ + unquoted = unquote(p); + if (*unquoted == '-') { /* Looks like an option */ + if (strcmp(unquoted, "-classpath") == 0 || + strcmp(unquoted, "-cp") == 0) { /* Unique cp syntax */ + cmdline = strcat(strcat(cmdline, " "), p); + p = nextarg(&np); + if (*p != (char)0) /* If a token was isolated */ + cmdline = strcat(strcat(cmdline, " "), p); + } else if (strncmp(unquoted, "-version:", 9) != 0 && + strcmp(unquoted, "-jre-restrict-search") != 0 && + strcmp(unquoted, "-no-jre-restrict-search") != 0) { + cmdline = strcat(strcat(cmdline, " "), p); + } + } else { /* End of options */ + cmdline = strcat(strcat(cmdline, " "), p); + cmdline = strcat(strcat(cmdline, " "), np); + JLI_MemFree((void *)unquoted); + break; + } + JLI_MemFree((void *)unquoted); + } + } + JLI_MemFree((void *)ccl); + + if (_launcher_debug) { + np = ccl = JLI_StringDup(cmdline); + p = nextarg(&np); + printf("ReExec Command: %s (%s)\n", path, p); + printf("ReExec Args: %s\n", np); + JLI_MemFree((void *)ccl); + } + (void)fflush(stdout); + (void)fflush(stderr); + + /* + * The following code is modeled after a model presented in the + * Microsoft Technical Article "Moving Unix Applications to + * Windows NT" (March 6, 1994) and "Creating Processes" on MSDN + * (Februrary 2005). It approximates UNIX spawn semantics with + * the parent waiting for termination of the child. + */ + memset(&si, 0, sizeof(si)); + si.cb =sizeof(STARTUPINFO); + memset(&pi, 0, sizeof(pi)); + + if (!CreateProcess((LPCTSTR)path, /* executable name */ + (LPTSTR)cmdline, /* command line */ + (LPSECURITY_ATTRIBUTES)NULL, /* process security attr. */ + (LPSECURITY_ATTRIBUTES)NULL, /* thread security attr. */ + (BOOL)TRUE, /* inherits system handles */ + (DWORD)0, /* creation flags */ + (LPVOID)NULL, /* environment block */ + (LPCTSTR)NULL, /* current directory */ + (LPSTARTUPINFO)&si, /* (in) startup information */ + (LPPROCESS_INFORMATION)&pi)) { /* (out) process information */ + ReportSysErrorMessage2("CreateProcess(%s, ...) failed: %s", + path, JNI_TRUE); + exit(1); + } + + if (WaitForSingleObject(pi.hProcess, INFINITE) != WAIT_FAILED) { + if (GetExitCodeProcess(pi.hProcess, &exitCode) == FALSE) + exitCode = 1; + } else { + ReportErrorMessage("WaitForSingleObject() failed.", JNI_TRUE); + exitCode = 1; + } + + CloseHandle(pi.hThread); + CloseHandle(pi.hProcess); + + exit(exitCode); + } + +} + +#endif /* ifndef GAMMA */ + + +/* + * Wrapper for platform dependent unsetenv function. + */ +int +UnsetEnv(char *name) +{ + int ret; + char *buf = JLI_MemAlloc(strlen(name) + 2); + buf = strcat(strcpy(buf, name), "="); + ret = _putenv(buf); + JLI_MemFree(buf); + return (ret); +} + +/* --- Splash Screen shared library support --- */ + +static const char* SPLASHSCREEN_SO = "\\bin\\splashscreen.dll"; + +static HMODULE hSplashLib = NULL; + +void* SplashProcAddress(const char* name) { + char libraryPath[MAXPATHLEN]; /* some extra space for strcat'ing SPLASHSCREEN_SO */ + + if (!GetJREPath(libraryPath, MAXPATHLEN)) { + return NULL; + } + if (strlen(libraryPath)+strlen(SPLASHSCREEN_SO) >= MAXPATHLEN) { + return NULL; + } + strcat(libraryPath, SPLASHSCREEN_SO); + + if (!hSplashLib) { + hSplashLib = LoadLibrary(libraryPath); + } + if (hSplashLib) { + return GetProcAddress(hSplashLib, name); + } else { + return NULL; + } +} + +void SplashFreeLibrary() { + if (hSplashLib) { + FreeLibrary(hSplashLib); + hSplashLib = NULL; + } +} + +const char * +jlong_format_specifier() { + return "%I64d"; +} + +/* + * Block current thread and continue execution in a new thread + */ +int +ContinueInNewThread(int (JNICALL *continuation)(void *), jlong stack_size, void * args) { + int rslt = 0; + unsigned thread_id; + +#ifndef STACK_SIZE_PARAM_IS_A_RESERVATION +#define STACK_SIZE_PARAM_IS_A_RESERVATION (0x10000) +#endif + + /* + * STACK_SIZE_PARAM_IS_A_RESERVATION is what we want, but it's not + * supported on older version of Windows. Try first with the flag; and + * if that fails try again without the flag. See MSDN document or HotSpot + * source (os_win32.cpp) for details. + */ + HANDLE thread_handle = + (HANDLE)_beginthreadex(NULL, + (unsigned)stack_size, + continuation, + args, + STACK_SIZE_PARAM_IS_A_RESERVATION, + &thread_id); + if (thread_handle == NULL) { + thread_handle = + (HANDLE)_beginthreadex(NULL, + (unsigned)stack_size, + continuation, + args, + 0, + &thread_id); + } + + /* AWT preloading (AFTER main thread start) */ +#ifdef ENABLE_AWT_PRELOAD + /* D3D preloading */ + if (awtPreloadD3D != 0) { + char *envValue; + /* D3D routines checks env.var J2D_D3D if no appropriate + * command line params was specified + */ + envValue = getenv("J2D_D3D"); + if (envValue != NULL && stricmp(envValue, "false") == 0) { + awtPreloadD3D = 0; + } + /* Test that AWT preloading isn't disabled by J2D_D3D_PRELOAD env.var */ + envValue = getenv("J2D_D3D_PRELOAD"); + if (envValue != NULL && stricmp(envValue, "false") == 0) { + awtPreloadD3D = 0; + } + if (awtPreloadD3D < 0) { + /* If awtPreloadD3D is still undefined (-1), test + * if it is turned on by J2D_D3D_PRELOAD env.var. + * By default it's turned OFF. + */ + awtPreloadD3D = 0; + if (envValue != NULL && stricmp(envValue, "true") == 0) { + awtPreloadD3D = 1; + } + } + } + if (awtPreloadD3D) { + AWTPreload(D3D_PRELOAD_FUNC); + } +#endif /* ENABLE_AWT_PRELOAD */ + + if (thread_handle) { + WaitForSingleObject(thread_handle, INFINITE); + GetExitCodeThread(thread_handle, &rslt); + CloseHandle(thread_handle); + } else { + rslt = continuation(args); + } + +#ifdef ENABLE_AWT_PRELOAD + if (awtPreloaded) { + AWTPreloadStop(); + } +#endif /* ENABLE_AWT_PRELOAD */ + + return rslt; +} + +/* Linux only, empty on windows. */ +void SetJavaLauncherPlatformProps() {} + + +//============================== +// AWT preloading +#ifdef ENABLE_AWT_PRELOAD + +typedef int FnPreloadStart(void); +typedef void FnPreloadStop(void); +static FnPreloadStop *fnPreloadStop = NULL; +static HMODULE hPreloadAwt = NULL; + +/* + * Starts AWT preloading + */ +int AWTPreload(const char *funcName) +{ + int result = -1; + + // load AWT library once (if several preload function should be called) + if (hPreloadAwt == NULL) { + // awt.dll is not loaded yet + char libraryPath[MAXPATHLEN]; + int jrePathLen = 0; + HMODULE hJava = NULL; + HMODULE hVerify = NULL; + + while (1) { + // awt.dll depends on jvm.dll & java.dll; + // jvm.dll is already loaded, so we need only java.dll; + // java.dll depends on MSVCRT lib & verify.dll. + if (!GetJREPath(libraryPath, MAXPATHLEN)) { + break; + } + + // save path length + jrePathLen = strlen(libraryPath); + + // load msvcrt 1st + LoadMSVCRT(); + + // load verify.dll + strcat(libraryPath, "\\bin\\verify.dll"); + hVerify = LoadLibrary(libraryPath); + if (hVerify == NULL) { + break; + } + + // restore jrePath + libraryPath[jrePathLen] = 0; + // load java.dll + strcat(libraryPath, "\\bin\\" JAVA_DLL); + hJava = LoadLibrary(libraryPath); + if (hJava == NULL) { + break; + } + + // restore jrePath + libraryPath[jrePathLen] = 0; + // load awt.dll + strcat(libraryPath, "\\bin\\awt.dll"); + hPreloadAwt = LoadLibrary(libraryPath); + if (hPreloadAwt == NULL) { + break; + } + + // get "preloadStop" func ptr + fnPreloadStop = (FnPreloadStop *)GetProcAddress(hPreloadAwt, "preloadStop"); + + break; + } + } + + if (hPreloadAwt != NULL) { + FnPreloadStart *fnInit = (FnPreloadStart *)GetProcAddress(hPreloadAwt, funcName); + if (fnInit != NULL) { + // don't forget to stop preloading + awtPreloaded = 1; + + result = fnInit(); + } + } + + return result; +} + +/* + * Terminates AWT preloading + */ +void AWTPreloadStop() { + if (fnPreloadStop != NULL) { + fnPreloadStop(); + } +} + +#endif /* ENABLE_AWT_PRELOAD */ diff --git a/hotspot/src/os/linux/launcher/java_md.h b/hotspot/src/os/windows/launcher/java_md.h similarity index 66% rename from hotspot/src/os/linux/launcher/java_md.h rename to hotspot/src/os/windows/launcher/java_md.h index 237a6526839..111be1ee13a 100644 --- a/hotspot/src/os/linux/launcher/java_md.h +++ b/hotspot/src/os/windows/launcher/java_md.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,31 @@ * */ -/* - * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK, - * search "GAMMA" for gamma specific changes. - */ - #ifndef JAVA_MD_H #define JAVA_MD_H -#include -#include -#include +#include +#include +#include #ifndef GAMMA #include "manifest_info.h" #endif +#include "jli_util.h" -#define PATH_SEPARATOR ':' -#define FILESEP "/" -#define FILE_SEPARATOR '/' -#ifndef MAXNAMELEN -#define MAXNAMELEN PATH_MAX +#ifdef GAMMA +#define stricmp _stricmp +#define strnicmp _strnicmp +#define snprintf _snprintf +#define strdup _strdup #endif +#define PATH_SEPARATOR ';' +#define FILESEP "\\" +#define FILE_SEPARATOR '\\' +#define IS_FILE_SEPARATOR(c) ((c) == '\\' || (c) == '/') +#define MAXPATHLEN MAX_PATH +#define MAXNAMELEN MAX_PATH + #ifdef JAVA_ARGS /* * ApplicationHome is prepended to each of these entries; the resulting @@ -51,27 +54,26 @@ * value of -cp option to the launcher. */ #ifndef APP_CLASSPATH -#define APP_CLASSPATH { "/lib/tools.jar", "/classes" } +#define APP_CLASSPATH { "\\lib\\tools.jar", "\\classes" } #endif #endif -#ifdef HAVE_GETHRTIME /* * Support for doing cheap, accurate interval timing. */ -#include -#define CounterGet() (gethrtime()/1000) -#define Counter2Micros(counts) (counts) -#else -#define CounterGet() (0) -#define Counter2Micros(counts) (1) -#endif /* HAVE_GETHRTIME */ +extern jlong CounterGet(void); +extern jlong Counter2Micros(jlong counts); + +#ifdef JAVAW +#define main _main +extern int _main(int argc, char **argv); +#endif /* * Function prototypes. */ #ifndef GAMMA -char *LocateJRE(manifest_info* info); +char *LocateJRE(manifest_info *info); void ExecJRE(char *jre, char **argv); #endif int UnsetEnv(char *name); diff --git a/hotspot/src/os/windows/vm/attachListener_windows.cpp b/hotspot/src/os/windows/vm/attachListener_windows.cpp index 28295f9a74e..1d5857f1c2f 100644 --- a/hotspot/src/os/windows/vm/attachListener_windows.cpp +++ b/hotspot/src/os/windows/vm/attachListener_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_attachListener_windows.cpp.incl" +#include "precompiled.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/os.hpp" +#include "services/attachListener.hpp" +#include "services/dtraceAttacher.hpp" #include #include // SIGBREAK diff --git a/hotspot/src/os/windows/vm/c1_globals_windows.hpp b/hotspot/src/os/windows/vm/c1_globals_windows.hpp index 301d169c178..41789768d3d 100644 --- a/hotspot/src/os/windows/vm/c1_globals_windows.hpp +++ b/hotspot/src/os/windows/vm/c1_globals_windows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,15 @@ * */ +#ifndef OS_WINDOWS_VM_C1_GLOBALS_WINDOWS_HPP +#define OS_WINDOWS_VM_C1_GLOBALS_WINDOWS_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // // Sets the default values for operating system dependent flags used by the // client compiler. (see c1_globals.hpp) // + +#endif // OS_WINDOWS_VM_C1_GLOBALS_WINDOWS_HPP diff --git a/hotspot/src/os/windows/vm/c2_globals_windows.hpp b/hotspot/src/os/windows/vm/c2_globals_windows.hpp index b14af55c55c..a79fbdc7bda 100644 --- a/hotspot/src/os/windows/vm/c2_globals_windows.hpp +++ b/hotspot/src/os/windows/vm/c2_globals_windows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,15 @@ * */ +#ifndef OS_WINDOWS_VM_C2_GLOBALS_WINDOWS_HPP +#define OS_WINDOWS_VM_C2_GLOBALS_WINDOWS_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + // // Sets the default values for operating system dependent flags used by the // server compiler. (see c2_globals.hpp) // + +#endif // OS_WINDOWS_VM_C2_GLOBALS_WINDOWS_HPP diff --git a/hotspot/src/os/windows/vm/chaitin_windows.cpp b/hotspot/src/os/windows/vm/chaitin_windows.cpp index a459b992e17..bae10b3b5c4 100644 --- a/hotspot/src/os/windows/vm/chaitin_windows.cpp +++ b/hotspot/src/os/windows/vm/chaitin_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_chaitin_windows.cpp.incl" +#include "precompiled.hpp" +#include "opto/chaitin.hpp" +#include "opto/machnode.hpp" // Disallow the use of the frame pointer (EBP) for implicit null exceptions // on win95/98. If we do not do this, the OS gets confused and gives a stack diff --git a/hotspot/src/os/windows/vm/decoder_windows.cpp b/hotspot/src/os/windows/vm/decoder_windows.cpp new file mode 100644 index 00000000000..c4eaf35c69a --- /dev/null +++ b/hotspot/src/os/windows/vm/decoder_windows.cpp @@ -0,0 +1,123 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "prims/jvm.h" +#include "utilities/decoder.hpp" + +HMODULE Decoder::_dbghelp_handle = NULL; +bool Decoder::_can_decode_in_vm = false; +pfn_SymGetSymFromAddr64 Decoder::_pfnSymGetSymFromAddr64 = NULL; +pfn_UndecorateSymbolName Decoder::_pfnUndecorateSymbolName = NULL; + +void Decoder::initialize() { + if (!_initialized) { + _initialized = true; + + HMODULE handle = ::LoadLibrary("dbghelp.dll"); + if (!handle) { + _decoder_status = helper_not_found; + return; + } + + _dbghelp_handle = handle; + + pfn_SymSetOptions _pfnSymSetOptions = (pfn_SymSetOptions)::GetProcAddress(handle, "SymSetOptions"); + pfn_SymInitialize _pfnSymInitialize = (pfn_SymInitialize)::GetProcAddress(handle, "SymInitialize"); + _pfnSymGetSymFromAddr64 = (pfn_SymGetSymFromAddr64)::GetProcAddress(handle, "SymGetSymFromAddr64"); + _pfnUndecorateSymbolName = (pfn_UndecorateSymbolName)GetProcAddress(handle, "UnDecorateSymbolName"); + + if (_pfnSymSetOptions == NULL || _pfnSymInitialize == NULL || _pfnSymGetSymFromAddr64 == NULL) { + _pfnSymGetSymFromAddr64 = NULL; + _pfnUndecorateSymbolName = NULL; + ::FreeLibrary(handle); + _dbghelp_handle = NULL; + _decoder_status = helper_func_error; + return; + } + + _pfnSymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS); + if (!_pfnSymInitialize(GetCurrentProcess(), NULL, TRUE)) { + _pfnSymGetSymFromAddr64 = NULL; + _pfnUndecorateSymbolName = NULL; + ::FreeLibrary(handle); + _dbghelp_handle = NULL; + _decoder_status = helper_init_error; + return; + } + + // find out if jvm.dll contains private symbols, by decoding + // current function and comparing the result + address addr = (address)Decoder::initialize; + char buf[MAX_PATH]; + if (decode(addr, buf, sizeof(buf), NULL) == no_error) { + _can_decode_in_vm = !strcmp(buf, "Decoder::initialize"); + } + } +} + +void Decoder::uninitialize() { + assert(_initialized, "Decoder not yet initialized"); + _pfnSymGetSymFromAddr64 = NULL; + _pfnUndecorateSymbolName = NULL; + if (_dbghelp_handle != NULL) { + ::FreeLibrary(_dbghelp_handle); + } + _initialized = false; +} + +bool Decoder::can_decode_C_frame_in_vm() { + initialize(); + return _can_decode_in_vm; +} + + +Decoder::decoder_status Decoder::decode(address addr, char *buf, int buflen, int *offset) { + assert(_initialized, "Decoder not yet initialized"); + if (_pfnSymGetSymFromAddr64 != NULL) { + PIMAGEHLP_SYMBOL64 pSymbol; + char symbolInfo[MAX_PATH + sizeof(IMAGEHLP_SYMBOL64)]; + pSymbol = (PIMAGEHLP_SYMBOL64)symbolInfo; + pSymbol->MaxNameLength = MAX_PATH; + pSymbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64); + DWORD64 displacement; + if (_pfnSymGetSymFromAddr64(::GetCurrentProcess(), (DWORD64)addr, &displacement, pSymbol)) { + if (buf != NULL) { + if (!demangle(pSymbol->Name, buf, buflen)) { + jio_snprintf(buf, buflen, "%s", pSymbol->Name); + } + } + if (offset != NULL) *offset = (int)displacement; + return no_error; + } + } + return helper_not_found; +} + +bool Decoder::demangle(const char* symbol, char *buf, int buflen) { + assert(_initialized, "Decoder not yet initialized"); + return _pfnUndecorateSymbolName != NULL && + _pfnUndecorateSymbolName(symbol, buf, buflen, UNDNAME_COMPLETE); +} + diff --git a/hotspot/src/os/windows/vm/dtraceJSDT_windows.cpp b/hotspot/src/os/windows/vm/dtraceJSDT_windows.cpp index aad6296c72d..0f340fb5730 100644 --- a/hotspot/src/os/windows/vm/dtraceJSDT_windows.cpp +++ b/hotspot/src/os/windows/vm/dtraceJSDT_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_dtraceJSDT_windows.cpp.incl" +#include "precompiled.hpp" +#include "classfile/javaClasses.hpp" +#include "code/codeBlob.hpp" +#include "memory/allocation.hpp" +#include "prims/jvm.h" +#include "runtime/dtraceJSDT.hpp" +#include "runtime/jniHandles.hpp" +#include "runtime/os.hpp" +#include "runtime/signature.hpp" +#include "utilities/globalDefinitions.hpp" int DTraceJSDT::pd_activate( void* baseAddress, jstring module, diff --git a/hotspot/src/os/windows/vm/globals_windows.hpp b/hotspot/src/os/windows/vm/globals_windows.hpp index 52f7d602b01..1860375c03e 100644 --- a/hotspot/src/os/windows/vm/globals_windows.hpp +++ b/hotspot/src/os/windows/vm/globals_windows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_WINDOWS_VM_GLOBALS_WINDOWS_HPP +#define OS_WINDOWS_VM_GLOBALS_WINDOWS_HPP + // // Defines Windows specific flags. They are not available on other platforms. // @@ -40,3 +43,5 @@ define_pd_global(bool, UseLargePages, false); define_pd_global(bool, UseLargePagesIndividualAllocation, true); define_pd_global(bool, UseOSErrorReporting, false); // for now. define_pd_global(bool, UseThreadPriorities, true) ; + +#endif // OS_WINDOWS_VM_GLOBALS_WINDOWS_HPP diff --git a/hotspot/src/os/windows/vm/hpi_windows.cpp b/hotspot/src/os/windows/vm/hpi_windows.cpp deleted file mode 100644 index 2e78fc27148..00000000000 --- a/hotspot/src/os/windows/vm/hpi_windows.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -# include "incls/_precompiled.incl" -# include "incls/_hpi_windows.cpp.incl" - -typedef jint (JNICALL *init_t)(GetInterfaceFunc *, void *); - -void hpi::initialize_get_interface(vm_calls_t *callbacks) -{ - // Build name of HPI. - char lib_name[JVM_MAXPATHLEN]; - - if (HPILibPath && HPILibPath[0]) { - strncpy(lib_name, HPILibPath, JVM_MAXPATHLEN - 1); - lib_name[JVM_MAXPATHLEN - 1] = '\0'; - } else { - os::jvm_path(lib_name, sizeof lib_name); - -#ifdef PRODUCT - const char *hpi_lib = "\\hpi.dll"; -#else - char *ptr = strrchr(lib_name, '\\'); - // On Win98 GetModuleFileName() returns the path in the upper case. - assert(_strnicmp(ptr, "\\jvm",4) == 0, "invalid library name"); - const char *hpi_lib = (_strnicmp(ptr, "\\jvm_g",6) == 0) ? "\\hpi_g.dll" : "\\hpi.dll"; -#endif - - *(::strrchr(lib_name, '\\')) = '\0'; /* get rid of "\\jvm.dll" */ - char *p = ::strrchr(lib_name, '\\'); - if (p != NULL) *p = '\0'; /* get rid of "\\hotspot" */ - strcat(lib_name, hpi_lib); - } - - // Load it. - if (TraceHPI) tty->print_cr("Loading HPI %s ", lib_name); - HINSTANCE lib_handle = LoadLibrary(lib_name); - if (lib_handle == NULL) { - if (TraceHPI) tty->print_cr("LoadLibrary failed, code = %d", GetLastError()); - return; - } - - // Find hpi initializer. - init_t initer = (init_t)GetProcAddress(lib_handle, "DLL_Initialize"); - if (initer == NULL) { - if (TraceHPI) tty->print_cr("GetProcAddress failed, errcode = %d", GetLastError()); - return; - } - - // Call initializer. - jint init_result = (*initer)(&_get_interface, callbacks); - if (init_result < 0) { - if (TraceHPI) tty->print_cr("DLL_Initialize failed, returned %ld", init_result); - return; - } - - if (TraceHPI) tty->print_cr("success"); - return; -} diff --git a/hotspot/src/os/windows/vm/hpi_windows.hpp b/hotspot/src/os/windows/vm/hpi_windows.hpp deleted file mode 100644 index 3d94b4e553f..00000000000 --- a/hotspot/src/os/windows/vm/hpi_windows.hpp +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -// Win32 delegates these to the HPI. Solaris provides its own -// implementation without using the HPI (for Interrupitble I/O). - -// HPI_FileInterface - -HPIDECL(close, "close", _file, Close, int, "%d", - (int fd), - ("fd = %d", fd), - (fd)); - -HPIDECL(read, "read", _file, Read, size_t, "%ld", - (int fd, void *buf, unsigned int nBytes), - ("fd = %d, buf = %p, nBytes = %u", fd, buf, nBytes), - (fd, buf, nBytes)); - -HPIDECL(write, "write", _file, Write, size_t, "%ld", - (int fd, const void *buf, unsigned int nBytes), - ("fd = %d, buf = %p, nBytes = %u", fd, buf, nBytes), - (fd, buf, nBytes)); - - -// HPI_SocketInterface - -HPIDECL(socket_close, "socket_close", _socket, Close, int, "%d", - (int fd), - ("fd = %d", fd), - (fd)); - -HPIDECL(socket_available, "socket_available", _socket, Available, - int, "%d", - (int fd, jint *pbytes), - ("fd = %d, pbytes = %p", fd, pbytes), - (fd, pbytes)); - -HPIDECL(socket, "socket", _socket, Socket, int, "%d", - (int domain, int type, int protocol), - ("domain = %d, type = %d, protocol = %d", domain, type, protocol), - (domain, type, protocol)); - -HPIDECL(listen, "listen", _socket, Listen, int, "%d", - (int fd, int count), - ("fd = %d, count = %d", fd, count), - (fd, count)); - -HPIDECL(connect, "connect", _socket, Connect, int, "%d", - (int fd, struct sockaddr *him, int len), - ("fd = %d, him = %p, len = %d", fd, him, len), - (fd, him, len)); - -HPIDECL(accept, "accept", _socket, Accept, int, "%d", - (int fd, struct sockaddr *him, int *len), - ("fd = %d, him = %p, len = %p", fd, him, len), - (fd, him, len)); - -HPIDECL(sendto, "sendto", _socket, SendTo, int, "%d", - (int fd, char *buf, int len, int flags, - struct sockaddr *to, int tolen), - ("fd = %d, buf = %p, len = %d, flags = %d, to = %p, tolen = %d", - fd, buf, len, flags, to, tolen), - (fd, buf, len, flags, to, tolen)); - -HPIDECL(recvfrom, "recvfrom", _socket, RecvFrom, int, "%d", - (int fd, char *buf, int nbytes, int flags, - struct sockaddr *from, int *fromlen), - ("fd = %d, buf = %p, len = %d, flags = %d, frm = %p, frmlen = %d", - fd, buf, nbytes, flags, from, fromlen), - (fd, buf, nbytes, flags, from, fromlen)); - -HPIDECL(recv, "recv", _socket, Recv, int, "%d", - (int fd, char *buf, int nBytes, int flags), - ("fd = %d, buf = %p, nBytes = %d, flags = %d", - fd, buf, nBytes, flags), - (fd, buf, nBytes, flags)); - -HPIDECL(send, "send", _socket, Send, int, "%d", - (int fd, char *buf, int nBytes, int flags), - ("fd = %d, buf = %p, nBytes = %d, flags = %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), - (fd, timeout)); - -HPIDECL(get_host_by_name, "get_host_by_name", _socket, GetHostByName, - struct hostent *, "(struct hostent *)%p", - (char *name), - ("%s", name), - (name)); - -HPIDECL(socket_shutdown, "socket_shutdown", _socket, SocketShutdown, - int, "%d", - (int fd, int howto), - ("fd = %d, howto = %d", fd, howto), - (fd, howto)); - -HPIDECL(bind, "bind", _socket, Bind, - int, "%d", - (int fd, struct sockaddr *him, int len), - ("fd = %d, him = %p, len = %d", - fd, him, len), - (fd, him, len)); - -HPIDECL(get_sock_name, "get_sock_name", _socket, GetSocketName, - int, "%d", - (int fd, struct sockaddr *him, int *len), - ("fd = %d, him = %p, len = %p", - fd, him, len), - (fd, him, len)); - -HPIDECL(get_host_name, "get_host_name", _socket, GetHostName, int, "%d", - (char *hostname, int namelen), - ("hostname = %p, namelen = %d", - hostname, namelen), - (hostname, namelen)); - -HPIDECL(get_host_by_addr, "get_host_by_addr", _socket, GetHostByAddr, - struct hostent *, "(struct hostent *)%p", - (const char* name, int len, int type), - ("name = %p, len = %d, type = %d", - name, len, type), - (name, len, type)); - -HPIDECL(get_sock_opt, "get_sock_opt", _socket, SocketGetOption, int, "%d", - (int fd, int level, int optname, char *optval, int* optlen), - ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %p", - fd, level, optname, optval, optlen), - (fd, level, optname, optval, optlen)); - -HPIDECL(set_sock_opt, "set_sock_opt", _socket, SocketSetOption, int, "%d", - (int fd, int level, int optname, const char *optval, int optlen), - ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %d", - fd, level, optname, optval, optlen), - (fd, level, optname, optval, optlen)); - -HPIDECL(get_proto_by_name, "get_proto_by_name", _socket, GetProtoByName, - struct protoent *, "(struct protoent *)%p", - (char* name), - ("name = %p", - name), - (name)); diff --git a/hotspot/src/os/windows/vm/interfaceSupport_windows.hpp b/hotspot/src/os/windows/vm/interfaceSupport_windows.hpp index 3e5a6bfc1d1..96236542972 100644 --- a/hotspot/src/os/windows/vm/interfaceSupport_windows.hpp +++ b/hotspot/src/os/windows/vm/interfaceSupport_windows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_WINDOWS_VM_INTERFACESUPPORT_WINDOWS_HPP +#define OS_WINDOWS_VM_INTERFACESUPPORT_WINDOWS_HPP + // Contains inlined functions for class InterfaceSupport static inline void serialize_memory(JavaThread *thread) { @@ -39,3 +42,5 @@ static inline void serialize_memory(JavaThread *thread) { serialize_fault_filter((_EXCEPTION_POINTERS*)_exception_info())) {} } + +#endif // OS_WINDOWS_VM_INTERFACESUPPORT_WINDOWS_HPP diff --git a/hotspot/src/os/windows/vm/jvm_windows.cpp b/hotspot/src/os/windows/vm/jvm_windows.cpp index d0d171b2327..d6a299a239c 100644 --- a/hotspot/src/os/windows/vm/jvm_windows.cpp +++ b/hotspot/src/os/windows/vm/jvm_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_jvm_windows.cpp.incl" +#include "precompiled.hpp" +#include "prims/jvm.h" +#include "runtime/interfaceSupport.hpp" +#include "runtime/osThread.hpp" #include diff --git a/hotspot/src/os/windows/vm/jvm_windows.h b/hotspot/src/os/windows/vm/jvm_windows.h index 47999961b84..6cb292ba974 100644 --- a/hotspot/src/os/windows/vm/jvm_windows.h +++ b/hotspot/src/os/windows/vm/jvm_windows.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/mutex_windows.cpp b/hotspot/src/os/windows/vm/mutex_windows.cpp index 7ba6b0aba7c..66f018dd4a9 100644 --- a/hotspot/src/os/windows/vm/mutex_windows.cpp +++ b/hotspot/src/os/windows/vm/mutex_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_mutex_windows.cpp.incl" +#include "precompiled.hpp" +#include "mutex_windows.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/mutex.hpp" +#include "thread_windows.inline.hpp" +#include "utilities/events.hpp" // put OS-includes here # include diff --git a/hotspot/src/os/windows/vm/mutex_windows.inline.hpp b/hotspot/src/os/windows/vm/mutex_windows.inline.hpp index b9c7bfabc31..ddc082279fb 100644 --- a/hotspot/src/os/windows/vm/mutex_windows.inline.hpp +++ b/hotspot/src/os/windows/vm/mutex_windows.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,3 +21,12 @@ * questions. * */ + +#ifndef OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP +#define OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP + +#include "os_windows.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "thread_windows.inline.hpp" + +#endif // OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP diff --git a/hotspot/src/os/windows/vm/objectMonitor_windows.hpp b/hotspot/src/os/windows/vm/objectMonitor_windows.hpp deleted file mode 100644 index 0b4fc2f7138..00000000000 --- a/hotspot/src/os/windows/vm/objectMonitor_windows.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - - private: diff --git a/hotspot/src/os/windows/vm/objectMonitor_windows.inline.hpp b/hotspot/src/os/windows/vm/objectMonitor_windows.inline.hpp deleted file mode 100644 index 07fe1598f87..00000000000 --- a/hotspot/src/os/windows/vm/objectMonitor_windows.inline.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ diff --git a/hotspot/src/os/windows/vm/osThread_windows.cpp b/hotspot/src/os/windows/vm/osThread_windows.cpp index 7aaffc1b272..005643aa67a 100644 --- a/hotspot/src/os/windows/vm/osThread_windows.cpp +++ b/hotspot/src/os/windows/vm/osThread_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,17 @@ * */ -#include "incls/_osThread_windows.cpp.incl" +// no precompiled headers +#include "runtime/atomic.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/os.hpp" +#include "runtime/osThread.hpp" +#include "runtime/safepoint.hpp" +#include "runtime/vmThread.hpp" +#ifdef TARGET_ARCH_x86 +# include "assembler_x86.inline.hpp" +#endif void OSThread::pd_initialize() { set_thread_handle(NULL); diff --git a/hotspot/src/os/windows/vm/osThread_windows.hpp b/hotspot/src/os/windows/vm/osThread_windows.hpp index 37cdfaba147..1df8925c7a7 100644 --- a/hotspot/src/os/windows/vm/osThread_windows.hpp +++ b/hotspot/src/os/windows/vm/osThread_windows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP +#define OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP + typedef void* HANDLE; private: @@ -64,3 +67,5 @@ typedef void* HANDLE; private: void pd_initialize(); void pd_destroy(); + +#endif // OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP diff --git a/hotspot/src/os/windows/vm/os_share_windows.hpp b/hotspot/src/os/windows/vm/os_share_windows.hpp index e157ace8e6c..447fc9438c4 100644 --- a/hotspot/src/os/windows/vm/os_share_windows.hpp +++ b/hotspot/src/os/windows/vm/os_share_windows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,4 +22,9 @@ * */ +#ifndef OS_WINDOWS_VM_OS_SHARE_WINDOWS_HPP +#define OS_WINDOWS_VM_OS_SHARE_WINDOWS_HPP + // Defines the interfaces to Windows operating system that vary across platforms + +#endif // OS_WINDOWS_VM_OS_SHARE_WINDOWS_HPP diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index f2b7eedcb5e..0422063c50e 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * CopyrighT (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,56 @@ #define _WIN32_WINNT 0x500 #endif -// do not include precompiled header file -# include "incls/_os_windows.cpp.incl" +// no precompiled headers +#include "classfile/classLoader.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "compiler/compileBroker.hpp" +#include "interpreter/interpreter.hpp" +#include "jvm_windows.h" +#include "memory/allocation.inline.hpp" +#include "memory/filemap.hpp" +#include "mutex_windows.inline.hpp" +#include "oops/oop.inline.hpp" +#include "os_share_windows.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm.h" +#include "prims/jvm_misc.hpp" +#include "runtime/arguments.hpp" +#include "runtime/extendedPC.hpp" +#include "runtime/globals.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/objectMonitor.hpp" +#include "runtime/osThread.hpp" +#include "runtime/perfMemory.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/statSampler.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/threadCritical.hpp" +#include "runtime/timer.hpp" +#include "services/attachListener.hpp" +#include "services/runtimeService.hpp" +#include "thread_windows.inline.hpp" +#include "utilities/decoder.hpp" +#include "utilities/defaultStream.hpp" +#include "utilities/events.hpp" +#include "utilities/growableArray.hpp" +#include "utilities/vmError.hpp" +#ifdef TARGET_ARCH_x86 +# include "assembler_x86.inline.hpp" +# include "nativeInst_x86.hpp" +#endif +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif #ifdef _DEBUG #include @@ -996,8 +1044,6 @@ os::closedir(DIR *dirp) return 0; } -const char* os::dll_file_extension() { return ".dll"; } - const char* os::get_temp_directory() { const char *prop = Arguments::get_property("java.io.tmpdir"); if (prop != 0) return prop; @@ -1019,7 +1065,6 @@ static bool file_exists(const char* filename) { void os::dll_build_name(char *buffer, size_t buflen, const char* pname, const char* fname) { - // Copied from libhpi const size_t pnamelen = pname ? strlen(pname) : 0; const char c = (pnamelen > 0) ? pname[pnamelen-1] : 0; @@ -1321,19 +1366,14 @@ bool os::dll_address_to_library_name(address addr, char* buf, bool os::dll_address_to_function_name(address addr, char *buf, int buflen, int *offset) { - // Unimplemented on Windows - in order to use SymGetSymFromAddr(), - // we need to initialize imagehlp/dbghelp, then load symbol table - // for every module. That's too much work to do after a fatal error. - // For an example on how to implement this function, see 1.4.2. - if (offset) *offset = -1; - if (buf) buf[0] = '\0'; + if (Decoder::decode(addr, buf, buflen, offset) == Decoder::no_error) { + return true; + } + if (offset != NULL) *offset = -1; + if (buf != NULL) buf[0] = '\0'; return false; } -void* os::dll_lookup(void* handle, const char* name) { - return GetProcAddress((HMODULE)handle, name); -} - // save the start and end address of jvm.dll into param[0] and param[1] static int _locate_jvm_dll(int pid, char* mod_fname, address base_addr, unsigned size, void * param) { @@ -1668,7 +1708,34 @@ void os::jvm_path(char *buf, jint buflen) { return; } + buf[0] = '\0'; + if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) { + // Support for the gamma launcher. Check for an + // JAVA_HOME environment variable + // and fix up the path so it looks like + // libjvm.so is installed there (append a fake suffix + // hotspot/libjvm.so). + char* java_home_var = ::getenv("JAVA_HOME"); + if (java_home_var != NULL && java_home_var[0] != 0) { + + strncpy(buf, java_home_var, buflen); + + // determine if this is a legacy image or modules image + // modules image doesn't have "jre" subdirectory + size_t len = strlen(buf); + char* jrebin_p = buf + len; + jio_snprintf(jrebin_p, buflen-len, "\\jre\\bin\\"); + if (0 != _access(buf, 0)) { + jio_snprintf(jrebin_p, buflen-len, "\\bin\\"); + } + len = strlen(buf); + jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll"); + } + } + + if(buf[0] == '\0') { GetModuleFileName(vm_lib_handle, buf, buflen); + } strcpy(saved_jvm_path, buf); } @@ -1686,6 +1753,44 @@ void os::print_jni_name_suffix_on(outputStream* st, int args_size) { #endif } +// This method is a copy of JDK's sysGetLastErrorString +// from src/windows/hpi/src/system_md.c + +size_t os::lasterror(char *buf, size_t len) { + long errval; + + if ((errval = GetLastError()) != 0) { + /* DOS error */ + int n = (int)FormatMessage( + FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + errval, + 0, + buf, + (DWORD)len, + NULL); + if (n > 3) { + /* Drop final '.', CR, LF */ + if (buf[n - 1] == '\n') n--; + if (buf[n - 1] == '\r') n--; + if (buf[n - 1] == '.') n--; + buf[n] = '\0'; + } + return n; + } + + if (errno != 0) { + /* C runtime error that has no corresponding DOS error code */ + const char *s = strerror(errno); + size_t n = strlen(s); + if (n >= len) n = len - 1; + strncpy(buf, s, n); + buf[n] = '\0'; + return n; + } + return 0; +} + // sun.misc.Signal // NOTE that this is a workaround for an apparent kernel bug where if // a signal handler for SIGBREAK is installed then that signal handler @@ -1899,6 +2004,16 @@ struct siglabel { int number; }; +// All Visual C++ exceptions thrown from code generated by the Microsoft Visual +// C++ compiler contain this error code. Because this is a compiler-generated +// error, the code is not listed in the Win32 API header files. +// The code is actually a cryptic mnemonic device, with the initial "E" +// standing for "exception" and the final 3 bytes (0x6D7363) representing the +// ASCII values of "msc". + +#define EXCEPTION_UNCAUGHT_CXX_EXCEPTION 0xE06D7363 + + struct siglabel exceptlabels[] = { def_excpt(EXCEPTION_ACCESS_VIOLATION), def_excpt(EXCEPTION_DATATYPE_MISALIGNMENT), @@ -1923,6 +2038,7 @@ struct siglabel exceptlabels[] = { def_excpt(EXCEPTION_INVALID_DISPOSITION), def_excpt(EXCEPTION_GUARD_PAGE), def_excpt(EXCEPTION_INVALID_HANDLE), + def_excpt(EXCEPTION_UNCAUGHT_CXX_EXCEPTION), NULL, 0 }; @@ -2156,7 +2272,6 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { } } - if (t != NULL && t->is_Java_thread()) { JavaThread* thread = (JavaThread*) t; bool in_java = thread->thread_state() == _thread_in_Java; @@ -2360,8 +2475,9 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { } // switch } #ifndef _WIN64 - if ((thread->thread_state() == _thread_in_Java) || - (thread->thread_state() == _thread_in_native) ) + if (((thread->thread_state() == _thread_in_Java) || + (thread->thread_state() == _thread_in_native)) && + exception_code != EXCEPTION_UNCAUGHT_CXX_EXCEPTION) { LONG result=Handle_FLT_Exception(exceptionInfo); if (result==EXCEPTION_CONTINUE_EXECUTION) return result; @@ -2385,6 +2501,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { case EXCEPTION_ILLEGAL_INSTRUCTION_2: case EXCEPTION_INT_OVERFLOW: case EXCEPTION_INT_DIVIDE_BY_ZERO: + case EXCEPTION_UNCAUGHT_CXX_EXCEPTION: { report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord, exceptionInfo->ContextRecord); } @@ -2893,10 +3010,6 @@ void os::pd_start_thread(Thread* thread) { assert(ret != SYS_THREAD_ERROR, "StartThread failed"); // should propagate back } -size_t os::read(int fd, void *buf, unsigned int nBytes) { - return ::read(fd, buf, nBytes); -} - class HighResolutionInterval { // The default timer resolution seems to be 10 milliseconds. // (Where is this written down?) @@ -3311,7 +3424,6 @@ extern "C" { } } - // this is called _after_ the global arguments have been parsed jint os::init_2(void) { // Allocate a single page and mark it as readable for safepoint polling @@ -3376,10 +3488,6 @@ jint os::init_2(void) { #endif } - // Initialize HPI. - jint hpi_result = hpi::initialize(); - if (hpi_result != JNI_OK) { return hpi_result; } - // If stack_commit_size is 0, windows will reserve the default size, // but only commit a small portion of it. size_t stack_commit_size = round_to(ThreadStackSize*K, os::vm_page_size()); @@ -3390,6 +3498,21 @@ jint os::init_2(void) { actual_reserve_size = default_reserve_size; } + // Check minimum allowable stack size for thread creation and to initialize + // the java system classes, including StackOverflowError - depends on page + // size. Add a page for compiler2 recursion in main thread. + // Add in 2*BytesPerWord times page size to account for VM stack during + // class initialization depending on 32 or 64 bit VM. + size_t min_stack_allowed = + (size_t)(StackYellowPages+StackRedPages+StackShadowPages+ + 2*BytesPerWord COMPILER2_PRESENT(+1)) * os::vm_page_size(); + if (actual_reserve_size < min_stack_allowed) { + tty->print_cr("\nThe stack size specified is too small, " + "Specify at least %dk", + min_stack_allowed / K); + return JNI_ERR; + } + JavaThread::set_stack_size_at_create(stack_commit_size); // Calculate theoretical max. size of Threads to guard gainst artifical @@ -3469,7 +3592,7 @@ int os::stat(const char *path, struct stat *sbuf) { errno = ENAMETOOLONG; return -1; } - hpi::native_path(strcpy(pathbuf, path)); + os::native_path(strcpy(pathbuf, path)); int ret = ::stat(pathbuf, sbuf); if (sbuf != NULL && UseUTCFileTimestamp) { // Fix for 6539723. st_mtime returned from stat() is dependent on @@ -3613,6 +3736,20 @@ bool os::dont_yield() { return DontYieldALot; } +// This method is a slightly reworked copy of JDK's sysOpen +// from src/windows/hpi/src/sys_api_md.c + +int os::open(const char *path, int oflag, int mode) { + char pathbuf[MAX_PATH]; + + if (strlen(path) > MAX_PATH - 1) { + errno = ENAMETOOLONG; + return -1; + } + os::native_path(strcpy(pathbuf, path)); + return ::open(pathbuf, oflag | O_BINARY | O_NOINHERIT, mode); +} + // Is a (classpath) directory empty? bool os::dir_is_empty(const char* path) { WIN32_FIND_DATA fd; @@ -3644,6 +3781,297 @@ jlong os::seek_to_file_offset(int fd, jlong offset) { } +jlong os::lseek(int fd, jlong offset, int whence) { + return (jlong) ::_lseeki64(fd, offset, whence); +} + +// This method is a slightly reworked copy of JDK's sysNativePath +// from src/windows/hpi/src/path_md.c + +/* Convert a pathname to native format. On win32, this involves forcing all + separators to be '\\' rather than '/' (both are legal inputs, but Win95 + sometimes rejects '/') and removing redundant separators. The input path is + assumed to have been converted into the character encoding used by the local + system. Because this might be a double-byte encoding, care is taken to + treat double-byte lead characters correctly. + + This procedure modifies the given path in place, as the result is never + longer than the original. There is no error return; this operation always + succeeds. */ +char * os::native_path(char *path) { + char *src = path, *dst = path, *end = path; + char *colon = NULL; /* If a drive specifier is found, this will + point to the colon following the drive + letter */ + + /* Assumption: '/', '\\', ':', and drive letters are never lead bytes */ + assert(((!::IsDBCSLeadByte('/')) + && (!::IsDBCSLeadByte('\\')) + && (!::IsDBCSLeadByte(':'))), + "Illegal lead byte"); + + /* Check for leading separators */ +#define isfilesep(c) ((c) == '/' || (c) == '\\') + while (isfilesep(*src)) { + src++; + } + + if (::isalpha(*src) && !::IsDBCSLeadByte(*src) && src[1] == ':') { + /* Remove leading separators if followed by drive specifier. This + hack is necessary to support file URLs containing drive + specifiers (e.g., "file://c:/path"). As a side effect, + "/c:/path" can be used as an alternative to "c:/path". */ + *dst++ = *src++; + colon = dst; + *dst++ = ':'; + src++; + } else { + src = path; + if (isfilesep(src[0]) && isfilesep(src[1])) { + /* UNC pathname: Retain first separator; leave src pointed at + second separator so that further separators will be collapsed + into the second separator. The result will be a pathname + beginning with "\\\\" followed (most likely) by a host name. */ + src = dst = path + 1; + path[0] = '\\'; /* Force first separator to '\\' */ + } + } + + end = dst; + + /* Remove redundant separators from remainder of path, forcing all + separators to be '\\' rather than '/'. Also, single byte space + characters are removed from the end of the path because those + are not legal ending characters on this operating system. + */ + while (*src != '\0') { + if (isfilesep(*src)) { + *dst++ = '\\'; src++; + while (isfilesep(*src)) src++; + if (*src == '\0') { + /* Check for trailing separator */ + end = dst; + if (colon == dst - 2) break; /* "z:\\" */ + if (dst == path + 1) break; /* "\\" */ + if (dst == path + 2 && isfilesep(path[0])) { + /* "\\\\" is not collapsed to "\\" because "\\\\" marks the + beginning of a UNC pathname. Even though it is not, by + itself, a valid UNC pathname, we leave it as is in order + to be consistent with the path canonicalizer as well + as the win32 APIs, which treat this case as an invalid + UNC pathname rather than as an alias for the root + directory of the current drive. */ + break; + } + end = --dst; /* Path does not denote a root directory, so + remove trailing separator */ + break; + } + end = dst; + } else { + if (::IsDBCSLeadByte(*src)) { /* Copy a double-byte character */ + *dst++ = *src++; + if (*src) *dst++ = *src++; + end = dst; + } else { /* Copy a single-byte character */ + char c = *src++; + *dst++ = c; + /* Space is not a legal ending character */ + if (c != ' ') end = dst; + } + } + } + + *end = '\0'; + + /* For "z:", add "." to work around a bug in the C runtime library */ + if (colon == dst - 1) { + path[2] = '.'; + path[3] = '\0'; + } + + #ifdef DEBUG + jio_fprintf(stderr, "sysNativePath: %s\n", path); + #endif DEBUG + return path; +} + +// This code is a copy of JDK's sysSetLength +// from src/windows/hpi/src/sys_api_md.c + +int os::ftruncate(int fd, jlong length) { + HANDLE h = (HANDLE)::_get_osfhandle(fd); + long high = (long)(length >> 32); + DWORD ret; + + if (h == (HANDLE)(-1)) { + return -1; + } + + ret = ::SetFilePointer(h, (long)(length), &high, FILE_BEGIN); + if ((ret == 0xFFFFFFFF) && (::GetLastError() != NO_ERROR)) { + return -1; + } + + if (::SetEndOfFile(h) == FALSE) { + return -1; + } + + return 0; +} + + +// This code is a copy of JDK's sysSync +// from src/windows/hpi/src/sys_api_md.c +// except for the legacy workaround for a bug in Win 98 + +int os::fsync(int fd) { + HANDLE handle = (HANDLE)::_get_osfhandle(fd); + + if ( (!::FlushFileBuffers(handle)) && + (GetLastError() != ERROR_ACCESS_DENIED) ) { + /* from winerror.h */ + return -1; + } + return 0; +} + +static int nonSeekAvailable(int, long *); +static int stdinAvailable(int, long *); + +#define S_ISCHR(mode) (((mode) & _S_IFCHR) == _S_IFCHR) +#define S_ISFIFO(mode) (((mode) & _S_IFIFO) == _S_IFIFO) + +// This code is a copy of JDK's sysAvailable +// from src/windows/hpi/src/sys_api_md.c + +int os::available(int fd, jlong *bytes) { + jlong cur, end; + struct _stati64 stbuf64; + + if (::_fstati64(fd, &stbuf64) >= 0) { + int mode = stbuf64.st_mode; + if (S_ISCHR(mode) || S_ISFIFO(mode)) { + int ret; + long lpbytes; + if (fd == 0) { + ret = stdinAvailable(fd, &lpbytes); + } else { + ret = nonSeekAvailable(fd, &lpbytes); + } + (*bytes) = (jlong)(lpbytes); + return ret; + } + if ((cur = ::_lseeki64(fd, 0L, SEEK_CUR)) == -1) { + return FALSE; + } else if ((end = ::_lseeki64(fd, 0L, SEEK_END)) == -1) { + return FALSE; + } else if (::_lseeki64(fd, cur, SEEK_SET) == -1) { + return FALSE; + } + *bytes = end - cur; + return TRUE; + } else { + return FALSE; + } +} + +// This code is a copy of JDK's nonSeekAvailable +// from src/windows/hpi/src/sys_api_md.c + +static int nonSeekAvailable(int fd, long *pbytes) { + /* This is used for available on non-seekable devices + * (like both named and anonymous pipes, such as pipes + * connected to an exec'd process). + * Standard Input is a special case. + * + */ + HANDLE han; + + if ((han = (HANDLE) ::_get_osfhandle(fd)) == (HANDLE)(-1)) { + return FALSE; + } + + if (! ::PeekNamedPipe(han, NULL, 0, NULL, (LPDWORD)pbytes, NULL)) { + /* PeekNamedPipe fails when at EOF. In that case we + * simply make *pbytes = 0 which is consistent with the + * behavior we get on Solaris when an fd is at EOF. + * The only alternative is to raise an Exception, + * which isn't really warranted. + */ + if (::GetLastError() != ERROR_BROKEN_PIPE) { + return FALSE; + } + *pbytes = 0; + } + return TRUE; +} + +#define MAX_INPUT_EVENTS 2000 + +// This code is a copy of JDK's stdinAvailable +// from src/windows/hpi/src/sys_api_md.c + +static int stdinAvailable(int fd, long *pbytes) { + HANDLE han; + DWORD numEventsRead = 0; /* Number of events read from buffer */ + DWORD numEvents = 0; /* Number of events in buffer */ + DWORD i = 0; /* Loop index */ + DWORD curLength = 0; /* Position marker */ + DWORD actualLength = 0; /* Number of bytes readable */ + BOOL error = FALSE; /* Error holder */ + INPUT_RECORD *lpBuffer; /* Pointer to records of input events */ + + if ((han = ::GetStdHandle(STD_INPUT_HANDLE)) == INVALID_HANDLE_VALUE) { + return FALSE; + } + + /* Construct an array of input records in the console buffer */ + error = ::GetNumberOfConsoleInputEvents(han, &numEvents); + if (error == 0) { + return nonSeekAvailable(fd, pbytes); + } + + /* lpBuffer must fit into 64K or else PeekConsoleInput fails */ + if (numEvents > MAX_INPUT_EVENTS) { + numEvents = MAX_INPUT_EVENTS; + } + + lpBuffer = (INPUT_RECORD *)os::malloc(numEvents * sizeof(INPUT_RECORD)); + if (lpBuffer == NULL) { + return FALSE; + } + + error = ::PeekConsoleInput(han, lpBuffer, numEvents, &numEventsRead); + if (error == 0) { + os::free(lpBuffer); + return FALSE; + } + + /* Examine input records for the number of bytes available */ + for(i=0; ibKeyDown == TRUE) { + CHAR *keyPressed = (CHAR *) &(keyRecord->uChar); + curLength++; + if (*keyPressed == '\r') { + actualLength = curLength; + } + } + } + } + + if(lpBuffer != NULL) { + os::free(lpBuffer); + } + + *pbytes = (long) actualLength; + return TRUE; +} + // Map a block of memory. char* os::map_memory(int fd, const char* file_name, size_t file_offset, char *addr, size_t bytes, bool read_only, @@ -3809,7 +4237,7 @@ void os::pause() { int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (fd != -1) { struct stat buf; - close(fd); + ::close(fd); while (::stat(filename, &buf) == 0) { Sleep(100); } @@ -3992,7 +4420,7 @@ void Parker::park(bool isAbsolute, jlong time) { if (time < 0) { // don't wait return; } - else if (time == 0) { + else if (time == 0 && !isAbsolute) { time = INFINITE; } else if (isAbsolute) { @@ -4170,3 +4598,164 @@ static int getLastErrorString(char *buf, size_t len) // We don't build a headless jre for Windows bool os::is_headless_jre() { return false; } +// OS_SocketInterface +// Not used on Windows + +// OS_SocketInterface +typedef struct hostent * (PASCAL FAR *ws2_ifn_ptr_t)(...); +ws2_ifn_ptr_t *get_host_by_name_fn = NULL; + +typedef CRITICAL_SECTION mutex_t; +#define mutexInit(m) InitializeCriticalSection(m) +#define mutexDestroy(m) DeleteCriticalSection(m) +#define mutexLock(m) EnterCriticalSection(m) +#define mutexUnlock(m) LeaveCriticalSection(m) + +static bool sockfnptrs_initialized = FALSE; +static mutex_t sockFnTableMutex; + +/* is Winsock2 loaded? better to be explicit than to rely on sockfnptrs */ +static bool winsock2Available = FALSE; + + +static void initSockFnTable() { + int (PASCAL FAR* WSAStartupPtr)(WORD, LPWSADATA); + WSADATA wsadata; + + ::mutexInit(&sockFnTableMutex); + ::mutexLock(&sockFnTableMutex); + + if (sockfnptrs_initialized == FALSE) { + HMODULE hWinsock; + + /* try to load Winsock2, and if that fails, load Winsock */ + hWinsock = ::LoadLibrary("ws2_32.dll"); + + if (hWinsock == NULL) { + jio_fprintf(stderr, "Could not load Winsock 2 (error: %d)\n", + ::GetLastError()); + return; + } + + /* If we loaded a DLL, then we might as well initialize it. */ + WSAStartupPtr = (int (PASCAL FAR *)(WORD, LPWSADATA)) + ::GetProcAddress(hWinsock, "WSAStartup"); + + if (WSAStartupPtr(MAKEWORD(1,1), &wsadata) != 0) { + jio_fprintf(stderr, "Could not initialize Winsock\n"); + } + + get_host_by_name_fn + = (ws2_ifn_ptr_t*) GetProcAddress(hWinsock, "gethostbyname"); + } + + assert(get_host_by_name_fn != NULL, + "gethostbyname function not found"); + sockfnptrs_initialized = TRUE; + ::mutexUnlock(&sockFnTableMutex); +} + +struct hostent* os::get_host_by_name(char* name) { + if (!sockfnptrs_initialized) { + initSockFnTable(); + } + + assert(sockfnptrs_initialized == TRUE && get_host_by_name_fn != NULL, + "sockfnptrs is not initialized or pointer to gethostbyname function is NULL"); + return (*get_host_by_name_fn)(name); +} + + +int os::socket_close(int fd) { + ShouldNotReachHere(); + return 0; +} + +int os::socket_available(int fd, jint *pbytes) { + ShouldNotReachHere(); + return 0; +} + +int os::socket(int domain, int type, int protocol) { + ShouldNotReachHere(); + return 0; +} + +int os::listen(int fd, int count) { + ShouldNotReachHere(); + return 0; +} + +int os::connect(int fd, struct sockaddr *him, int len) { + ShouldNotReachHere(); + return 0; +} + +int os::accept(int fd, struct sockaddr *him, int *len) { + ShouldNotReachHere(); + return 0; +} + +int os::sendto(int fd, char *buf, int len, int flags, + struct sockaddr *to, int tolen) { + ShouldNotReachHere(); + return 0; +} + +int os::recvfrom(int fd, char *buf, int nBytes, int flags, + sockaddr *from, int *fromlen) { + ShouldNotReachHere(); + return 0; +} + +int os::recv(int fd, char *buf, int nBytes, int flags) { + ShouldNotReachHere(); + return 0; +} + +int os::send(int fd, char *buf, int nBytes, int flags) { + ShouldNotReachHere(); + return 0; +} + +int os::raw_send(int fd, char *buf, int nBytes, int flags) { + ShouldNotReachHere(); + return 0; +} + +int os::timeout(int fd, long timeout) { + ShouldNotReachHere(); + return 0; +} + +int os::get_host_name(char* name, int namelen) { + ShouldNotReachHere(); + return 0; +} + +int os::socket_shutdown(int fd, int howto) { + ShouldNotReachHere(); + return 0; +} + +int os::bind(int fd, struct sockaddr *him, int len) { + ShouldNotReachHere(); + return 0; +} + +int os::get_sock_name(int fd, struct sockaddr *him, int *len) { + ShouldNotReachHere(); + return 0; +} + +int os::get_sock_opt(int fd, int level, int optname, + char *optval, int* optlen) { + ShouldNotReachHere(); + return 0; +} + +int os::set_sock_opt(int fd, int level, int optname, + const char *optval, int optlen) { + ShouldNotReachHere(); + return 0; +} diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp index eacf1f8a1e8..ddc7e203657 100644 --- a/hotspot/src/os/windows/vm/os_windows.hpp +++ b/hotspot/src/os/windows/vm/os_windows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_WINDOWS_VM_OS_WINDOWS_HPP +#define OS_WINDOWS_VM_OS_WINDOWS_HPP + // Win32_OS defines the interface to windows operating systems class win32 { @@ -124,3 +127,5 @@ class PlatformParker : public CHeapObj { } } ; + +#endif // OS_WINDOWS_VM_OS_WINDOWS_HPP diff --git a/hotspot/src/os/windows/vm/os_windows.inline.hpp b/hotspot/src/os/windows/vm/os_windows.inline.hpp index 8c709b29fa9..cee281fada7 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 (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,18 +22,39 @@ * */ +#ifndef OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP +#define OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP + +#include "runtime/atomic.hpp" +#include "runtime/os.hpp" +#ifdef TARGET_OS_ARCH_windows_x86 +# include "atomic_windows_x86.inline.hpp" +# include "orderAccess_windows_x86.inline.hpp" +#endif + inline const char* os::file_separator() { return "\\"; } inline const char* os::line_separator() { return "\r\n"; } inline const char* os::path_separator() { return ";"; } +inline const char* os::dll_file_extension() { return ".dll"; } inline const char* os::jlong_format_specifier() { return "%I64d"; } inline const char* os::julong_format_specifier() { return "%I64u"; } +inline const int os::default_file_open_flags() { return O_BINARY | O_NOINHERIT;} + // File names are case-insensitive on windows only inline int os::file_name_strcmp(const char* s, const char* t) { return _stricmp(s, t); } +inline void os::dll_unload(void *lib) { + ::FreeLibrary((HMODULE)lib); +} + +inline void* os::dll_lookup(void *lib, const char *name) { + return (void*)::GetProcAddress((HMODULE)lib, name); +} + // Used to improve time-sharing on some systems inline void os::loop_breaker(int attempts) {} @@ -72,3 +93,20 @@ inline void os::bang_stack_shadow_pages() { inline bool os::numa_has_static_binding() { return true; } inline bool os::numa_has_group_homing() { return false; } + +inline size_t os::read(int fd, void *buf, unsigned int nBytes) { + return ::read(fd, buf, nBytes); +} + +inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) { + return ::read(fd, buf, nBytes); +} + +inline size_t os::write(int fd, const void *buf, unsigned int nBytes) { + return ::write(fd, buf, nBytes); +} + +inline int os::close(int fd) { + return ::close(fd); +} +#endif // OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP diff --git a/hotspot/src/os/windows/vm/perfMemory_windows.cpp b/hotspot/src/os/windows/vm/perfMemory_windows.cpp index 7274df0ccb7..fbccc3c89fa 100644 --- a/hotspot/src/os/windows/vm/perfMemory_windows.cpp +++ b/hotspot/src/os/windows/vm/perfMemory_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,15 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_perfMemory_windows.cpp.incl" +#include "precompiled.hpp" +#include "classfile/vmSymbols.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" +#include "os_windows.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/perfMemory.hpp" +#include "utilities/exceptions.hpp" #include #include @@ -889,6 +896,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD, DWORD newACLsize = aclinfo.AclBytesInUse + (sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) * ace_count; for (int i = 0; i < ace_count; i++) { + assert(aces[i].pSid != 0, "pSid should not be 0"); newACLsize += GetLengthSid(aces[i].pSid); } @@ -1084,6 +1092,9 @@ static LPSECURITY_ATTRIBUTES make_user_everybody_admin_security_attr( aces[0].pSid = get_user_sid(GetCurrentProcess()); aces[0].mask = umask; + if (aces[0].pSid == 0) + return NULL; + // get the well known SID for BUILTIN\Administrators PSID administratorsSid = NULL; SID_IDENTIFIER_AUTHORITY SIDAuthAdministrators = SECURITY_NT_AUTHORITY; diff --git a/hotspot/src/os/windows/vm/stubRoutines_windows.cpp b/hotspot/src/os/windows/vm/stubRoutines_windows.cpp index 4721d8275ce..3723a0f7dfa 100644 --- a/hotspot/src/os/windows/vm/stubRoutines_windows.cpp +++ b/hotspot/src/os/windows/vm/stubRoutines_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +22,7 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stubRoutines_windows.cpp.incl" +#include "precompiled.hpp" +#include "runtime/os.hpp" +#include "runtime/stubRoutines.hpp" + diff --git a/hotspot/src/os/windows/vm/threadCritical_windows.cpp b/hotspot/src/os/windows/vm/threadCritical_windows.cpp index e638ce8252e..4a498e07e29 100644 --- a/hotspot/src/os/windows/vm/threadCritical_windows.cpp +++ b/hotspot/src/os/windows/vm/threadCritical_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_threadCritical_windows.cpp.incl" +#include "precompiled.hpp" +#include "runtime/threadCritical.hpp" +#include "thread_windows.inline.hpp" // OS-includes here # include diff --git a/hotspot/src/os/windows/vm/thread_windows.inline.hpp b/hotspot/src/os/windows/vm/thread_windows.inline.hpp index ade19efc009..9fe391574cc 100644 --- a/hotspot/src/os/windows/vm/thread_windows.inline.hpp +++ b/hotspot/src/os/windows/vm/thread_windows.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,21 @@ * */ +#ifndef OS_WINDOWS_VM_THREAD_WINDOWS_INLINE_HPP +#define OS_WINDOWS_VM_THREAD_WINDOWS_INLINE_HPP + +#include "runtime/atomic.hpp" +#include "runtime/prefetch.hpp" +#include "runtime/thread.hpp" +#include "runtime/threadLocalStorage.hpp" +#ifdef TARGET_OS_ARCH_windows_x86 +# include "atomic_windows_x86.inline.hpp" +# include "orderAccess_windows_x86.inline.hpp" +# include "prefetch_windows_x86.inline.hpp" +#endif + // Contains inlined functions for class Thread and ThreadLocalStorage inline void ThreadLocalStorage::pd_invalidate_all() { return; } + +#endif // OS_WINDOWS_VM_THREAD_WINDOWS_INLINE_HPP diff --git a/hotspot/src/os/windows/vm/vmError_windows.cpp b/hotspot/src/os/windows/vm/vmError_windows.cpp index 468c6935537..7a4b96b2a47 100644 --- a/hotspot/src/os/windows/vm/vmError_windows.cpp +++ b/hotspot/src/os/windows/vm/vmError_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_vmError_windows.cpp.incl" +#include "precompiled.hpp" +#include "runtime/arguments.hpp" +#include "runtime/os.hpp" +#include "runtime/thread.hpp" +#include "utilities/vmError.hpp" void VMError::show_message_box(char *buf, int buflen) { 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 342352bf8f1..20a5c5886dc 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 (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_assembler_linux_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_sparc.inline.hpp" +#include "runtime/os.hpp" +#include "runtime/threadLocalStorage.hpp" #include 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 b084e07f8c0..648543eadb8 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 (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP +#define OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP + +#include "orderAccess_linux_sparc.inline.hpp" +#include "runtime/atomic.hpp" +#include "runtime/os.hpp" +#include "vm_version_sparc.hpp" + // Implementation of class atomic inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; } @@ -204,3 +212,5 @@ inline intptr_t Atomic::cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t* inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value) { return (void*)cmpxchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest, (intptr_t)compare_value); } + +#endif // OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP 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 e67d0d42fde..b0b8c07fe8f 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 (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP +#define OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP + // // Sets the default values for platform dependent flags used by the // runtime system. (see globals.hpp) @@ -34,3 +37,5 @@ define_pd_global(intx, CompilerThreadStackSize, 0); define_pd_global(uintx, HeapBaseMinAddress, 4*G); // Only used on 64 bit Windows platforms define_pd_global(bool, UseVectoredExceptions, false); + +#endif // OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP 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 2770baaabef..6833c1f4e61 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 @@ -22,6 +22,12 @@ * */ +#ifndef OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP +#define OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP + +#include "runtime/orderAccess.hpp" +#include "vm_version_sparc.hpp" + // Implementation of class OrderAccess. // Assume TSO. @@ -100,3 +106,5 @@ inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) inline void OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { *p = v; fence(); } inline void OrderAccess::release_store_ptr_fence(volatile void* p, void* v) { *(void* volatile *)p = v; fence(); } + +#endif // OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP 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 b01fac31c8d..e759e7d8dea 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 (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +22,43 @@ * */ -// do not include precompiled header file +// no precompiled headers +#include "assembler_sparc.inline.hpp" +#include "classfile/classLoader.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "interpreter/interpreter.hpp" +#include "jvm_linux.h" +#include "memory/allocation.inline.hpp" +#include "mutex_linux.inline.hpp" +#include "nativeInst_sparc.hpp" +#include "os_share_linux.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm.h" +#include "prims/jvm_misc.hpp" +#include "runtime/arguments.hpp" +#include "runtime/extendedPC.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/osThread.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/timer.hpp" +#include "thread_linux.inline.hpp" +#include "utilities/events.hpp" +#include "utilities/vmError.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif -#include "incls/_os_linux_sparc.cpp.incl" // Linux/Sparc has rather obscure naming of registers in sigcontext // different between 32 and 64 bits @@ -200,6 +234,18 @@ void os::print_context(outputStream *st, void *context) { sigcontext* sc = (sigcontext*)context; st->print_cr("Registers:"); + st->print_cr(" G1=" INTPTR_FORMAT " G2=" INTPTR_FORMAT + " G3=" INTPTR_FORMAT " G4=" INTPTR_FORMAT, + SIG_REGS(sc).u_regs[CON_G1], + SIG_REGS(sc).u_regs[CON_G2], + SIG_REGS(sc).u_regs[CON_G3], + SIG_REGS(sc).u_regs[CON_G4]); + st->print_cr(" G5=" INTPTR_FORMAT " G6=" INTPTR_FORMAT + " G7=" INTPTR_FORMAT " Y=" INTPTR_FORMAT, + SIG_REGS(sc).u_regs[CON_G5], + SIG_REGS(sc).u_regs[CON_G6], + SIG_REGS(sc).u_regs[CON_G7], + SIG_REGS(sc).y); st->print_cr(" O0=" INTPTR_FORMAT " O1=" INTPTR_FORMAT " O2=" INTPTR_FORMAT " O3=" INTPTR_FORMAT, SIG_REGS(sc).u_regs[CON_O0], @@ -213,18 +259,32 @@ void os::print_context(outputStream *st, void *context) { SIG_REGS(sc).u_regs[CON_O6], SIG_REGS(sc).u_regs[CON_O7]); - st->print_cr(" G1=" INTPTR_FORMAT " G2=" INTPTR_FORMAT - " G3=" INTPTR_FORMAT " G4=" INTPTR_FORMAT, - SIG_REGS(sc).u_regs[CON_G1], - SIG_REGS(sc).u_regs[CON_G2], - SIG_REGS(sc).u_regs[CON_G3], - SIG_REGS(sc).u_regs[CON_G4]); - st->print_cr(" G5=" INTPTR_FORMAT " G6=" INTPTR_FORMAT - " G7=" INTPTR_FORMAT " Y=" INTPTR_FORMAT, - SIG_REGS(sc).u_regs[CON_G5], - SIG_REGS(sc).u_regs[CON_G6], - SIG_REGS(sc).u_regs[CON_G7], - SIG_REGS(sc).y); + + intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc); + st->print_cr(" L0=" INTPTR_FORMAT " L1=" INTPTR_FORMAT + " L2=" INTPTR_FORMAT " L3=" INTPTR_FORMAT, + sp[L0->sp_offset_in_saved_window()], + sp[L1->sp_offset_in_saved_window()], + sp[L2->sp_offset_in_saved_window()], + sp[L3->sp_offset_in_saved_window()]); + st->print_cr(" L4=" INTPTR_FORMAT " L5=" INTPTR_FORMAT + " L6=" INTPTR_FORMAT " L7=" INTPTR_FORMAT, + sp[L4->sp_offset_in_saved_window()], + sp[L5->sp_offset_in_saved_window()], + sp[L6->sp_offset_in_saved_window()], + sp[L7->sp_offset_in_saved_window()]); + st->print_cr(" I0=" INTPTR_FORMAT " I1=" INTPTR_FORMAT + " I2=" INTPTR_FORMAT " I3=" INTPTR_FORMAT, + sp[I0->sp_offset_in_saved_window()], + sp[I1->sp_offset_in_saved_window()], + sp[I2->sp_offset_in_saved_window()], + sp[I3->sp_offset_in_saved_window()]); + st->print_cr(" I4=" INTPTR_FORMAT " I5=" INTPTR_FORMAT + " I6=" INTPTR_FORMAT " I7=" INTPTR_FORMAT, + sp[I4->sp_offset_in_saved_window()], + sp[I5->sp_offset_in_saved_window()], + sp[I6->sp_offset_in_saved_window()], + sp[I7->sp_offset_in_saved_window()]); st->print_cr(" PC=" INTPTR_FORMAT " nPC=" INTPTR_FORMAT, SIG_PC(sc), @@ -232,7 +292,6 @@ void os::print_context(outputStream *st, void *context) { st->cr(); st->cr(); - intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc); st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", sp); print_hex_dump(st, (address)sp, (address)(sp + 32), sizeof(intptr_t)); st->cr(); @@ -242,7 +301,58 @@ void os::print_context(outputStream *st, void *context) { // this at the end, and hope for the best. address pc = os::Linux::ucontext_get_pc(uc); st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc); - print_hex_dump(st, pc - 16, pc + 16, sizeof(char)); + print_hex_dump(st, pc - 32, pc + 32, sizeof(char)); +} + + +void os::print_register_info(outputStream *st, void *context) { + if (context == NULL) return; + + ucontext_t *uc = (ucontext_t*)context; + intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc); + + st->print_cr("Register to memory mapping:"); + st->cr(); + + // this is only for the "general purpose" registers + st->print("G1="); print_location(st, SIG_REGS(sc).u_regs[CON__G1]); + st->print("G2="); print_location(st, SIG_REGS(sc).u_regs[CON__G2]); + st->print("G3="); print_location(st, SIG_REGS(sc).u_regs[CON__G3]); + st->print("G4="); print_location(st, SIG_REGS(sc).u_regs[CON__G4]); + st->print("G5="); print_location(st, SIG_REGS(sc).u_regs[CON__G5]); + st->print("G6="); print_location(st, SIG_REGS(sc).u_regs[CON__G6]); + st->print("G7="); print_location(st, SIG_REGS(sc).u_regs[CON__G7]); + st->cr(); + + st->print("O0="); print_location(st, SIG_REGS(sc).u_regs[CON__O0]); + st->print("O1="); print_location(st, SIG_REGS(sc).u_regs[CON__O1]); + st->print("O2="); print_location(st, SIG_REGS(sc).u_regs[CON__O2]); + st->print("O3="); print_location(st, SIG_REGS(sc).u_regs[CON__O3]); + st->print("O4="); print_location(st, SIG_REGS(sc).u_regs[CON__O4]); + st->print("O5="); print_location(st, SIG_REGS(sc).u_regs[CON__O5]); + st->print("O6="); print_location(st, SIG_REGS(sc).u_regs[CON__O6]); + st->print("O7="); print_location(st, SIG_REGS(sc).u_regs[CON__O7]); + st->cr(); + + st->print("L0="); print_location(st, sp[L0->sp_offset_in_saved_window()]); + st->print("L1="); print_location(st, sp[L1->sp_offset_in_saved_window()]); + st->print("L2="); print_location(st, sp[L2->sp_offset_in_saved_window()]); + st->print("L3="); print_location(st, sp[L3->sp_offset_in_saved_window()]); + st->print("L4="); print_location(st, sp[L4->sp_offset_in_saved_window()]); + st->print("L5="); print_location(st, sp[L5->sp_offset_in_saved_window()]); + st->print("L6="); print_location(st, sp[L6->sp_offset_in_saved_window()]); + st->print("L7="); print_location(st, sp[L7->sp_offset_in_saved_window()]); + st->cr(); + + st->print("I0="); print_location(st, sp[I0->sp_offset_in_saved_window()]); + st->print("I1="); print_location(st, sp[I1->sp_offset_in_saved_window()]); + st->print("I2="); print_location(st, sp[I2->sp_offset_in_saved_window()]); + st->print("I3="); print_location(st, sp[I3->sp_offset_in_saved_window()]); + st->print("I4="); print_location(st, sp[I4->sp_offset_in_saved_window()]); + st->print("I5="); print_location(st, sp[I5->sp_offset_in_saved_window()]); + st->print("I6="); print_location(st, sp[I6->sp_offset_in_saved_window()]); + st->print("I7="); print_location(st, sp[I7->sp_offset_in_saved_window()]); + st->cr(); } 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 7b3ef847e85..22d9cf0d88e 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 (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_LINUX_SPARC_VM_OS_LINUX_SPARC_HPP +#define OS_CPU_LINUX_SPARC_VM_OS_LINUX_SPARC_HPP + // // NOTE: we are back in class os here, not Linux // @@ -42,3 +45,5 @@ // Used to register dynamic code cache area with the OS // Note: Currently only used in 64 bit Windows implementations static bool register_code_area(char *low, char *high) { return true; } + +#endif // OS_CPU_LINUX_SPARC_VM_OS_LINUX_SPARC_HPP 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 14af8a71528..edc472f7506 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 (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef OS_CPU_LINUX_SPARC_VM_PREFETCH_LINUX_SPARC_INLINE_HPP +#define OS_CPU_LINUX_SPARC_VM_PREFETCH_LINUX_SPARC_INLINE_HPP + +#include "runtime/prefetch.hpp" + #if defined(COMPILER2) || defined(_LP64) inline void Prefetch::read(void *loc, intx interval) { @@ -38,3 +43,5 @@ inline void Prefetch::read (void *loc, intx interval) {} inline void Prefetch::write(void *loc, intx interval) {} #endif + +#endif // OS_CPU_LINUX_SPARC_VM_PREFETCH_LINUX_SPARC_INLINE_HPP 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 2031f5a4683..d2ae5ca9f24 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 (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_threadLS_linux_sparc.cpp.incl" +#include "precompiled.hpp" +#include "runtime/threadLocalStorage.hpp" +#include "thread_linux.inline.hpp" void ThreadLocalStorage::generate_code_for_get_thread() { } 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 cc4a46ffea4..0584108833a 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 (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 @@ * */ +#ifndef OS_CPU_LINUX_SPARC_VM_THREADLS_LINUX_SPARC_HPP +#define OS_CPU_LINUX_SPARC_VM_THREADLS_LINUX_SPARC_HPP + public: static Thread* thread() { return (Thread*) os::thread_local_storage_at(thread_index()); } + +#endif // OS_CPU_LINUX_SPARC_VM_THREADLS_LINUX_SPARC_HPP 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 7b44e39eee7..8f3eaa3e540 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 (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_thread_linux_sparc.cpp.incl" +#include "precompiled.hpp" +#include "runtime/frame.inline.hpp" +#include "thread_linux.inline.hpp" // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF 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 ddf7ad83ab7..a3174b579ea 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 (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_LINUX_SPARC_VM_THREAD_LINUX_SPARC_HPP +#define OS_CPU_LINUX_SPARC_VM_THREAD_LINUX_SPARC_HPP + private: void pd_initialize() { @@ -96,3 +99,5 @@ public: static bool register_stack_overflow() { return false; } static void enable_register_stack_guard() {} static void disable_register_stack_guard() {} + +#endif // OS_CPU_LINUX_SPARC_VM_THREAD_LINUX_SPARC_HPP 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 f2f1a83f636..4b0a3e63a29 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 (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_LINUX_SPARC_VM_VMSTRUCTS_LINUX_SPARC_HPP +#define OS_CPU_LINUX_SPARC_VM_VMSTRUCTS_LINUX_SPARC_HPP + // These are the OS and CPU-specific fields, types and integer // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. @@ -67,3 +70,5 @@ \ /* This must be the last entry, and must be present */ \ last_entry() + +#endif // OS_CPU_LINUX_SPARC_VM_VMSTRUCTS_LINUX_SPARC_HPP 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 519286881d0..c3d244d987d 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 (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_vm_version_linux_sparc.cpp.incl" +#include "precompiled.hpp" +#include "runtime/os.hpp" +#include "vm_version_sparc.hpp" static bool detect_niagara() { char cpu[128]; diff --git a/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp index fc42b00c3e3..5cd94107507 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_assembler_linux_x86.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_x86.inline.hpp" +#include "runtime/os.hpp" +#include "runtime/threadLocalStorage.hpp" #ifndef _LP64 void MacroAssembler::int3() { diff --git a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp index c58865aca4d..7a89e56e107 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP +#define OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP + +#include "orderAccess_linux_x86.inline.hpp" +#include "runtime/atomic.hpp" +#include "runtime/os.hpp" +#include "vm_version_x86.hpp" + // Implementation of class atomic inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; } @@ -193,3 +201,5 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* return (void*)cmpxchg((jint)exchange_value, (volatile jint*)dest, (jint)compare_value); } #endif // AMD64 + +#endif // OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP 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 33d26d07860..93cb9882263 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 (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_LINUX_X86_VM_BYTES_LINUX_X86_INLINE_HPP +#define OS_CPU_LINUX_X86_VM_BYTES_LINUX_X86_INLINE_HPP + #include // Efficient swapping of data bytes from Java byte @@ -83,3 +86,5 @@ inline u8 Bytes::swap_u8(u8 x) { return swap_u8_base(*(u4*)&x, *(((u4*)&x)+1)); } #endif // !AMD64 + +#endif // OS_CPU_LINUX_X86_VM_BYTES_LINUX_X86_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_x86/vm/copy_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/copy_linux_x86.inline.hpp index 5829e1a64a1..175019b8644 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/copy_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/copy_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP +#define OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP + static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) { #ifdef AMD64 (void)memmove(to, from, count * HeapWordSize); @@ -302,3 +305,5 @@ static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) pd_conjoint_oops_atomic((oop*)from, (oop*)to, count); #endif // AMD64 } + +#endif // OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp index 8a531a8a2fe..7ca61f27fac 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp @@ -22,6 +22,9 @@ * */ +#ifndef OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP +#define OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP + // Sets the default values for platform dependent flags used by the runtime system. // (see globals.hpp) @@ -45,3 +48,5 @@ define_pd_global(uintx,JVMInvokeMethodSlack, 8192); define_pd_global(uintx,HeapBaseMinAddress, 2*G); // Only used on 64 bit Windows platforms define_pd_global(bool, UseVectoredExceptions, false); + +#endif // OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP diff --git a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s b/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s index ff315197949..819293c8faa 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s +++ b/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE 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/orderAccess_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp index d487ece69a3..9adf947ad37 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp @@ -22,6 +22,12 @@ * */ +#ifndef OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP +#define OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP + +#include "runtime/orderAccess.hpp" +#include "vm_version_x86.hpp" + // Implementation of class OrderAccess. inline void OrderAccess::loadload() { acquire(); } @@ -204,3 +210,5 @@ inline void OrderAccess::release_store_ptr_fence(volatile void* p, void* release_store_fence((volatile jint*)p, (jint)v); #endif // AMD64 } + +#endif // OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP 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 29b93ec6dd4..f657dfec2d6 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 (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,42 @@ * */ -// do not include precompiled header file -# include "incls/_os_linux_x86.cpp.incl" +// no precompiled headers +#include "assembler_x86.inline.hpp" +#include "classfile/classLoader.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "interpreter/interpreter.hpp" +#include "jvm_linux.h" +#include "memory/allocation.inline.hpp" +#include "mutex_linux.inline.hpp" +#include "nativeInst_x86.hpp" +#include "os_share_linux.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm.h" +#include "prims/jvm_misc.hpp" +#include "runtime/arguments.hpp" +#include "runtime/extendedPC.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/osThread.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/timer.hpp" +#include "thread_linux.inline.hpp" +#include "utilities/events.hpp" +#include "utilities/vmError.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif // put OS-includes here # include @@ -718,11 +752,6 @@ void os::print_context(outputStream *st, void *context) { ucontext_t *uc = (ucontext_t*)context; st->print_cr("Registers:"); - - // this is horrendously verbose but the layout of the registers in the - // context does not match how we defined our abstract Register set, so - // we can't just iterate through the gregs area - #ifdef AMD64 st->print( "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]); st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]); @@ -745,68 +774,11 @@ void os::print_context(outputStream *st, void *context) { st->print(", R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]); st->cr(); st->print( "RIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RIP]); - st->print(", EFL=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]); + st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]); st->print(", CSGSFS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_CSGSFS]); st->print(", ERR=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ERR]); st->cr(); st->print(" TRAPNO=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_TRAPNO]); - - st->cr(); - st->cr(); - - st->print_cr("Register to memory mapping:"); - st->cr(); - - // this is only for the "general purpose" registers - - st->print_cr("RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]); - print_location(st, uc->uc_mcontext.gregs[REG_RAX]); - st->cr(); - st->print_cr("RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]); - print_location(st, uc->uc_mcontext.gregs[REG_RBX]); - st->cr(); - st->print_cr("RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]); - print_location(st, uc->uc_mcontext.gregs[REG_RCX]); - st->cr(); - st->print_cr("RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]); - print_location(st, uc->uc_mcontext.gregs[REG_RDX]); - st->cr(); - st->print_cr("RSP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSP]); - print_location(st, uc->uc_mcontext.gregs[REG_RSP]); - st->cr(); - st->print_cr("RBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBP]); - print_location(st, uc->uc_mcontext.gregs[REG_RBP]); - st->cr(); - st->print_cr("RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]); - print_location(st, uc->uc_mcontext.gregs[REG_RSI]); - st->cr(); - st->print_cr("RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]); - print_location(st, uc->uc_mcontext.gregs[REG_RDI]); - st->cr(); - st->print_cr("R8 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]); - print_location(st, uc->uc_mcontext.gregs[REG_R8]); - st->cr(); - st->print_cr("R9 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]); - print_location(st, uc->uc_mcontext.gregs[REG_R9]); - st->cr(); - st->print_cr("R10=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R10]); - print_location(st, uc->uc_mcontext.gregs[REG_R10]); - st->cr(); - st->print_cr("R11=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R11]); - print_location(st, uc->uc_mcontext.gregs[REG_R11]); - st->cr(); - st->print_cr("R12=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R12]); - print_location(st, uc->uc_mcontext.gregs[REG_R12]); - st->cr(); - st->print_cr("R13=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R13]); - print_location(st, uc->uc_mcontext.gregs[REG_R13]); - st->cr(); - st->print_cr("R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]); - print_location(st, uc->uc_mcontext.gregs[REG_R14]); - st->cr(); - st->print_cr("R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]); - print_location(st, uc->uc_mcontext.gregs[REG_R15]); - #else st->print( "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]); st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]); @@ -819,41 +791,8 @@ void os::print_context(outputStream *st, void *context) { st->print(", EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDI]); st->cr(); st->print( "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EIP]); - st->print(", CR2=" INTPTR_FORMAT, uc->uc_mcontext.cr2); st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]); - - st->cr(); - st->cr(); - - st->print_cr("Register to memory mapping:"); - st->cr(); - - // this is only for the "general purpose" registers - - st->print_cr("EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]); - print_location(st, uc->uc_mcontext.gregs[REG_EAX]); - st->cr(); - st->print_cr("EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]); - print_location(st, uc->uc_mcontext.gregs[REG_EBX]); - st->cr(); - st->print_cr("ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ECX]); - print_location(st, uc->uc_mcontext.gregs[REG_ECX]); - st->cr(); - st->print_cr("EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDX]); - print_location(st, uc->uc_mcontext.gregs[REG_EDX]); - st->cr(); - st->print_cr("ESP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ESP]); - print_location(st, uc->uc_mcontext.gregs[REG_ESP]); - st->cr(); - st->print_cr("EBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBP]); - print_location(st, uc->uc_mcontext.gregs[REG_EBP]); - st->cr(); - st->print_cr("ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ESI]); - print_location(st, uc->uc_mcontext.gregs[REG_ESI]); - st->cr(); - st->print_cr("EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDI]); - print_location(st, uc->uc_mcontext.gregs[REG_EDI]); - + st->print(", CR2=" INTPTR_FORMAT, uc->uc_mcontext.cr2); #endif // AMD64 st->cr(); st->cr(); @@ -868,7 +807,52 @@ void os::print_context(outputStream *st, void *context) { // this at the end, and hope for the best. address pc = os::Linux::ucontext_get_pc(uc); st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc); - print_hex_dump(st, pc - 16, pc + 16, sizeof(char)); + print_hex_dump(st, pc - 32, pc + 32, sizeof(char)); +} + +void os::print_register_info(outputStream *st, void *context) { + if (context == NULL) return; + + ucontext_t *uc = (ucontext_t*)context; + + st->print_cr("Register to memory mapping:"); + st->cr(); + + // this is horrendously verbose but the layout of the registers in the + // context does not match how we defined our abstract Register set, so + // we can't just iterate through the gregs area + + // this is only for the "general purpose" registers + +#ifdef AMD64 + st->print("RAX="); print_location(st, uc->uc_mcontext.gregs[REG_RAX]); + st->print("RBX="); print_location(st, uc->uc_mcontext.gregs[REG_RBX]); + st->print("RCX="); print_location(st, uc->uc_mcontext.gregs[REG_RCX]); + st->print("RDX="); print_location(st, uc->uc_mcontext.gregs[REG_RDX]); + st->print("RSP="); print_location(st, uc->uc_mcontext.gregs[REG_RSP]); + st->print("RBP="); print_location(st, uc->uc_mcontext.gregs[REG_RBP]); + st->print("RSI="); print_location(st, uc->uc_mcontext.gregs[REG_RSI]); + st->print("RDI="); print_location(st, uc->uc_mcontext.gregs[REG_RDI]); + st->print("R8 ="); print_location(st, uc->uc_mcontext.gregs[REG_R8]); + st->print("R9 ="); print_location(st, uc->uc_mcontext.gregs[REG_R9]); + st->print("R10="); print_location(st, uc->uc_mcontext.gregs[REG_R10]); + st->print("R11="); print_location(st, uc->uc_mcontext.gregs[REG_R11]); + st->print("R12="); print_location(st, uc->uc_mcontext.gregs[REG_R12]); + st->print("R13="); print_location(st, uc->uc_mcontext.gregs[REG_R13]); + st->print("R14="); print_location(st, uc->uc_mcontext.gregs[REG_R14]); + st->print("R15="); print_location(st, uc->uc_mcontext.gregs[REG_R15]); +#else + st->print("EAX="); print_location(st, uc->uc_mcontext.gregs[REG_EAX]); + st->print("EBX="); print_location(st, uc->uc_mcontext.gregs[REG_EBX]); + st->print("ECX="); print_location(st, uc->uc_mcontext.gregs[REG_ECX]); + st->print("EDX="); print_location(st, uc->uc_mcontext.gregs[REG_EDX]); + st->print("ESP="); print_location(st, uc->uc_mcontext.gregs[REG_ESP]); + st->print("EBP="); print_location(st, uc->uc_mcontext.gregs[REG_EBP]); + st->print("ESI="); print_location(st, uc->uc_mcontext.gregs[REG_ESI]); + st->print("EDI="); print_location(st, uc->uc_mcontext.gregs[REG_EDI]); +#endif // AMD64 + + st->cr(); } void os::setup_fpu() { diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp index fe5d35788a6..64954d480f8 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_LINUX_X86_VM_OS_LINUX_X86_HPP +#define OS_CPU_LINUX_X86_VM_OS_LINUX_X86_HPP + static void setup_fpu(); static bool supports_sse(); @@ -30,3 +33,5 @@ // Used to register dynamic code cache area with the OS // Note: Currently only used in 64 bit Windows implementations static bool register_code_area(char *low, char *high) { return true; } + +#endif // OS_CPU_LINUX_X86_VM_OS_LINUX_X86_HPP diff --git a/hotspot/src/os_cpu/linux_x86/vm/prefetch_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/prefetch_linux_x86.inline.hpp index 0499df081b2..ba1cf32aacb 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/prefetch_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/prefetch_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef OS_CPU_LINUX_X86_VM_PREFETCH_LINUX_X86_INLINE_HPP +#define OS_CPU_LINUX_X86_VM_PREFETCH_LINUX_X86_INLINE_HPP + +#include "runtime/prefetch.hpp" + inline void Prefetch::read (void *loc, intx interval) { #ifdef AMD64 @@ -38,3 +43,5 @@ inline void Prefetch::write(void *loc, intx interval) { #endif // AMD64 } + +#endif // OS_CPU_LINUX_X86_VM_PREFETCH_LINUX_X86_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp index 5b84568714e..66340de7d7b 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_threadLS_linux_x86.cpp.incl" +#include "precompiled.hpp" +#include "runtime/threadLocalStorage.hpp" +#include "thread_linux.inline.hpp" // Map stack pointer (%esp) to thread pointer for faster TLS access // diff --git a/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp index 2b1cb07dd62..55da9c0ca7b 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_LINUX_X86_VM_THREADLS_LINUX_X86_HPP +#define OS_CPU_LINUX_X86_VM_THREADLS_LINUX_X86_HPP + // Processor dependent parts of ThreadLocalStorage #ifndef AMD64 @@ -47,3 +50,5 @@ public: return _sp_map[sp >> PAGE_SHIFT]; #endif // AMD64 } + +#endif // OS_CPU_LINUX_X86_VM_THREADLS_LINUX_X86_HPP diff --git a/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp index b3089810813..3f04c773003 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_thread_linux_x86.cpp.incl" +#include "precompiled.hpp" +#include "runtime/frame.inline.hpp" +#include "thread_linux.inline.hpp" // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF diff --git a/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp index 31eb0d05187..7a7d222521f 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_LINUX_X86_VM_THREAD_LINUX_X86_HPP +#define OS_CPU_LINUX_X86_VM_THREAD_LINUX_X86_HPP + private: void pd_initialize() { _anchor.clear(); @@ -63,3 +66,5 @@ static bool register_stack_overflow() { return false; } static void enable_register_stack_guard() {} static void disable_register_stack_guard() {} + +#endif // OS_CPU_LINUX_X86_VM_THREAD_LINUX_X86_HPP diff --git a/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp index 1057ec8afe3..c54cb1d729d 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_LINUX_X86_VM_VMSTRUCTS_LINUX_X86_HPP +#define OS_CPU_LINUX_X86_VM_VMSTRUCTS_LINUX_X86_HPP + // These are the OS and CPU-specific fields, types and integer // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. @@ -58,3 +61,5 @@ \ /* This must be the last entry, and must be present */ \ last_entry() + +#endif // OS_CPU_LINUX_X86_VM_VMSTRUCTS_LINUX_X86_HPP diff --git a/hotspot/src/os_cpu/linux_x86/vm/vm_version_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/vm_version_linux_x86.cpp index 4ca3fc8c12b..f1a3c3a0b88 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/vm_version_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/vm_version_linux_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +22,7 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_vm_version_linux_x86.cpp.incl" +#include "precompiled.hpp" +#include "runtime/os.hpp" +#include "vm_version_x86.hpp" + diff --git a/hotspot/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp index 1e7f6703a71..ec56a35cd6b 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp +++ b/hotspot/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,10 @@ * */ +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_zero.inline.hpp" +#include "runtime/os.hpp" +#include "runtime/threadLocalStorage.hpp" + // This file is intentionally empty diff --git a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp index f4b7d0c57be..fcada2aa417 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,14 @@ * */ +#ifndef OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP +#define OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP + +#include "orderAccess_linux_zero.inline.hpp" +#include "runtime/atomic.hpp" +#include "runtime/os.hpp" +#include "vm_version_zero.hpp" + // Implementation of class atomic #ifdef M68K @@ -291,3 +299,5 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, (volatile intptr_t*) dest, (intptr_t) compare_value); } + +#endif // OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp index f427b9193d3..707cba2d057 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_LINUX_ZERO_VM_BYTES_LINUX_ZERO_INLINE_HPP +#define OS_CPU_LINUX_ZERO_VM_BYTES_LINUX_ZERO_INLINE_HPP + // Efficient swapping of data bytes from Java byte // ordering to native byte ordering and vice versa. @@ -38,3 +41,5 @@ inline u4 Bytes::swap_u4(u4 x) { inline u8 Bytes::swap_u8(u8 x) { return bswap_64(x); } + +#endif // OS_CPU_LINUX_ZERO_VM_BYTES_LINUX_ZERO_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp index 06ce1a20d58..f12bec98636 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP +#define OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP + // // Set the default values for platform dependent flags used by the // runtime system. See globals.hpp for details of what they do. @@ -42,3 +45,5 @@ define_pd_global(uintx, JVMInvokeMethodSlack, 8192); define_pd_global(bool, UseVectoredExceptions, false); // Only used on 64 bit platforms define_pd_global(uintx, HeapBaseMinAddress, 2*G); + +#endif // OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP diff --git a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp index c54883b888c..773fd643ab7 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,12 @@ * */ +#ifndef OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP +#define OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP + +#include "runtime/orderAccess.hpp" +#include "vm_version_zero.hpp" + #ifdef ARM /* @@ -165,3 +171,5 @@ inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) inline void OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { release_store_ptr(p, v); fence(); } inline void OrderAccess::release_store_ptr_fence(volatile void* p, void* v) { release_store_ptr(p, v); fence(); } + +#endif // OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp index fd78628b3eb..40e15e2f4f8 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,42 @@ * */ -// do not include precompiled header file -#include "incls/_os_linux_zero.cpp.incl" +// no precompiled headers +#include "assembler_zero.inline.hpp" +#include "classfile/classLoader.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "interpreter/interpreter.hpp" +#include "jvm_linux.h" +#include "memory/allocation.inline.hpp" +#include "mutex_linux.inline.hpp" +#include "nativeInst_zero.hpp" +#include "os_share_linux.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm.h" +#include "prims/jvm_misc.hpp" +#include "runtime/arguments.hpp" +#include "runtime/extendedPC.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/osThread.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/timer.hpp" +#include "thread_linux.inline.hpp" +#include "utilities/events.hpp" +#include "utilities/vmError.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif address os::current_stack_pointer() { address dummy = (address) &dummy; @@ -370,6 +404,10 @@ void os::print_context(outputStream* st, void* context) { ShouldNotCallThis(); } +void os::print_register_info(outputStream *st, void *context) { + ShouldNotCallThis(); +} + ///////////////////////////////////////////////////////////////////////////// // Stubs for things that would be in linux_zero.s if it existed. // You probably want to disassemble these monkeys to check they're ok. diff --git a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp index 84c87f8073b..1d4576679d3 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP +#define OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP + static void setup_fpu() {} static bool is_allocatable(size_t bytes); @@ -49,3 +52,5 @@ *(jlong *) dst = *(jlong *) src; #endif } + +#endif // OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP diff --git a/hotspot/src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp index 346a6079808..e34fef0b85d 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,15 @@ * */ +#ifndef OS_CPU_LINUX_ZERO_VM_PREFETCH_LINUX_ZERO_INLINE_HPP +#define OS_CPU_LINUX_ZERO_VM_PREFETCH_LINUX_ZERO_INLINE_HPP + +#include "runtime/prefetch.hpp" + inline void Prefetch::read(void* loc, intx interval) { } inline void Prefetch::write(void* loc, intx interval) { } + +#endif // OS_CPU_LINUX_ZERO_VM_PREFETCH_LINUX_ZERO_INLINE_HPP diff --git a/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp index 6dc339d700a..0981ea5dd61 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp +++ b/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_threadLS_linux_zero.cpp.incl" +#include "precompiled.hpp" +#include "runtime/threadLocalStorage.hpp" +#include "thread_linux.inline.hpp" void ThreadLocalStorage::generate_code_for_get_thread() { // nothing to do diff --git a/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp index 260602df149..3fd4ccf973f 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +22,14 @@ * */ +#ifndef OS_CPU_LINUX_ZERO_VM_THREADLS_LINUX_ZERO_HPP +#define OS_CPU_LINUX_ZERO_VM_THREADLS_LINUX_ZERO_HPP + // Processor dependent parts of ThreadLocalStorage public: static Thread* thread() { return (Thread*) os::thread_local_storage_at(thread_index()); } + +#endif // OS_CPU_LINUX_ZERO_VM_THREADLS_LINUX_ZERO_HPP diff --git a/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp index 8551eafce62..9c1b7336c63 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp +++ b/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,8 +23,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_thread_linux_zero.cpp.incl" +#include "precompiled.hpp" +#include "runtime/frame.inline.hpp" +#include "thread_linux.inline.hpp" void JavaThread::cache_global_variables() { // nothing to do diff --git a/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp index 086bceea99e..39f77f858d0 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef OS_CPU_LINUX_ZERO_VM_THREAD_LINUX_ZERO_HPP +#define OS_CPU_LINUX_ZERO_VM_THREAD_LINUX_ZERO_HPP + private: ZeroStack _zero_stack; ZeroFrame* _top_zero_frame; @@ -114,3 +117,5 @@ static bool register_stack_overflow() { return false; } static void enable_register_stack_guard() {} static void disable_register_stack_guard() {} + +#endif // OS_CPU_LINUX_ZERO_VM_THREAD_LINUX_ZERO_HPP diff --git a/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp index 007ecfcaf85..46c7912c372 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,6 +23,9 @@ * */ +#ifndef OS_CPU_LINUX_ZERO_VM_VMSTRUCTS_LINUX_ZERO_HPP +#define OS_CPU_LINUX_ZERO_VM_VMSTRUCTS_LINUX_ZERO_HPP + // These are the OS and CPU-specific fields, types and integer // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. @@ -43,3 +46,5 @@ #define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \ /* This must be the last entry, and must be present */ \ last_entry() + +#endif // OS_CPU_LINUX_ZERO_VM_VMSTRUCTS_LINUX_ZERO_HPP diff --git a/hotspot/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp index 1e7f6703a71..f2ca79f388c 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp +++ b/hotspot/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -23,4 +23,8 @@ * */ +#include "precompiled.hpp" +#include "runtime/os.hpp" +#include "vm_version_zero.hpp" + // This file is intentionally empty 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 92fb4a45263..5e9eaa12a31 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_assembler_solaris_sparc.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_sparc.inline.hpp" +#include "runtime/os.hpp" +#include "runtime/threadLocalStorage.hpp" #include // For trap numbers #include // For V8 compatibility diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp index 1931e6114c0..006962519ac 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP +#define OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP + +#include "orderAccess_solaris_sparc.inline.hpp" +#include "runtime/atomic.hpp" +#include "runtime/os.hpp" +#include "vm_version_sparc.hpp" + // Implementation of class atomic inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; } @@ -342,3 +350,5 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* #endif // _LP64 || COMPILER2 #endif // _GNU_SOURCE + +#endif // OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp index f9e43a77b59..febba7cd211 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_SOLARIS_SPARC_VM_GLOBALS_SOLARIS_SPARC_HPP +#define OS_CPU_SOLARIS_SPARC_VM_GLOBALS_SOLARIS_SPARC_HPP + // // Sets the default values for platform dependent flags used by the runtime system. // (see globals.hpp) @@ -36,3 +39,5 @@ define_pd_global(uintx, HeapBaseMinAddress, 4*G); define_pd_global(bool, UseVectoredExceptions, false); + +#endif // OS_CPU_SOLARIS_SPARC_VM_GLOBALS_SOLARIS_SPARC_HPP diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp index 6075e010687..bb732bd6b16 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp @@ -22,6 +22,12 @@ * */ +#ifndef OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP +#define OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP + +#include "runtime/orderAccess.hpp" +#include "vm_version_sparc.hpp" + // Implementation of class OrderAccess. // Assume TSO. @@ -124,3 +130,5 @@ inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) inline void OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { *p = v; fence(); } inline void OrderAccess::release_store_ptr_fence(volatile void* p, void* v) { *(void* volatile *)p = v; fence(); } + +#endif // OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp index 91ae05ace11..3b83be3ebba 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 +22,46 @@ * */ -// do not include precompiled header file +// no precompiled headers +#include "assembler_sparc.inline.hpp" +#include "classfile/classLoader.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "interpreter/interpreter.hpp" +#include "jvm_solaris.h" +#include "memory/allocation.inline.hpp" +#include "mutex_solaris.inline.hpp" +#include "nativeInst_sparc.hpp" +#include "os_share_solaris.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm.h" +#include "prims/jvm_misc.hpp" +#include "runtime/arguments.hpp" +#include "runtime/extendedPC.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/osThread.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/timer.hpp" +#include "thread_solaris.inline.hpp" +#include "utilities/events.hpp" +#include "utilities/vmError.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif + # include // needed first to avoid name collision for "std" with SC 5.0 -# include "incls/_os_solaris_sparc.cpp.incl" - // put OS-includes here # include # include @@ -254,17 +288,17 @@ static int threadgetstate(thread_t tid, int *flags, lwpid_t *lwp, stack_t *ss, g if (*flags == TRS_LWPID) { sprintf(lwpstatusfile, "/proc/%d/lwp/%d/lwpstatus", getpid(), *lwp); - if ((lwpfd = open(lwpstatusfile, O_RDONLY)) < 0) { + if ((lwpfd = ::open(lwpstatusfile, O_RDONLY)) < 0) { perror("thr_mutator_status: open lwpstatus"); return (EINVAL); } if (pread(lwpfd, lwpstatus, sizeof (lwpstatus_t), (off_t)0) != sizeof (lwpstatus_t)) { perror("thr_mutator_status: read lwpstatus"); - (void) close(lwpfd); + (void) ::close(lwpfd); return (EINVAL); } - (void) close(lwpfd); + (void) ::close(lwpfd); } return (0); } @@ -540,12 +574,24 @@ int JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, int abort_ pc = (address) uc->uc_mcontext.gregs[REG_PC]; } + // Sometimes the register windows are not properly flushed. + if(uc->uc_mcontext.gwins != NULL) { + ::handle_unflushed_register_windows(uc->uc_mcontext.gwins); + } + // unmask current signal sigset_t newset; sigemptyset(&newset); sigaddset(&newset, sig); sigprocmask(SIG_UNBLOCK, &newset, NULL); + // Determine which sort of error to throw. Out of swap may signal + // on the thread stack, which could get a mapping error when touched. + address addr = (address) info->si_addr; + if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) { + vm_exit_out_of_memory(0, "Out of swap space to map in thread stack."); + } + VMError err(t, sig, pc, info, ucVoid); err.report_and_die(); @@ -558,6 +604,18 @@ void os::print_context(outputStream *st, void *context) { ucontext_t *uc = (ucontext_t*)context; st->print_cr("Registers:"); + st->print_cr(" G1=" INTPTR_FORMAT " G2=" INTPTR_FORMAT + " G3=" INTPTR_FORMAT " G4=" INTPTR_FORMAT, + uc->uc_mcontext.gregs[REG_G1], + uc->uc_mcontext.gregs[REG_G2], + uc->uc_mcontext.gregs[REG_G3], + uc->uc_mcontext.gregs[REG_G4]); + st->print_cr(" G5=" INTPTR_FORMAT " G6=" INTPTR_FORMAT + " G7=" INTPTR_FORMAT " Y=" INTPTR_FORMAT, + uc->uc_mcontext.gregs[REG_G5], + uc->uc_mcontext.gregs[REG_G6], + uc->uc_mcontext.gregs[REG_G7], + uc->uc_mcontext.gregs[REG_Y]); st->print_cr(" O0=" INTPTR_FORMAT " O1=" INTPTR_FORMAT " O2=" INTPTR_FORMAT " O3=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O0], @@ -571,81 +629,39 @@ void os::print_context(outputStream *st, void *context) { uc->uc_mcontext.gregs[REG_O6], uc->uc_mcontext.gregs[REG_O7]); - st->print_cr(" G1=" INTPTR_FORMAT " G2=" INTPTR_FORMAT - " G3=" INTPTR_FORMAT " G4=" INTPTR_FORMAT, - uc->uc_mcontext.gregs[REG_G1], - uc->uc_mcontext.gregs[REG_G2], - uc->uc_mcontext.gregs[REG_G3], - uc->uc_mcontext.gregs[REG_G4]); - st->print_cr(" G5=" INTPTR_FORMAT " G6=" INTPTR_FORMAT - " G7=" INTPTR_FORMAT " Y=" INTPTR_FORMAT, - uc->uc_mcontext.gregs[REG_G5], - uc->uc_mcontext.gregs[REG_G6], - uc->uc_mcontext.gregs[REG_G7], - uc->uc_mcontext.gregs[REG_Y]); + + intptr_t *sp = (intptr_t *)os::Solaris::ucontext_get_sp(uc); + st->print_cr(" L0=" INTPTR_FORMAT " L1=" INTPTR_FORMAT + " L2=" INTPTR_FORMAT " L3=" INTPTR_FORMAT, + sp[L0->sp_offset_in_saved_window()], + sp[L1->sp_offset_in_saved_window()], + sp[L2->sp_offset_in_saved_window()], + sp[L3->sp_offset_in_saved_window()]); + st->print_cr(" L4=" INTPTR_FORMAT " L5=" INTPTR_FORMAT + " L6=" INTPTR_FORMAT " L7=" INTPTR_FORMAT, + sp[L4->sp_offset_in_saved_window()], + sp[L5->sp_offset_in_saved_window()], + sp[L6->sp_offset_in_saved_window()], + sp[L7->sp_offset_in_saved_window()]); + st->print_cr(" I0=" INTPTR_FORMAT " I1=" INTPTR_FORMAT + " I2=" INTPTR_FORMAT " I3=" INTPTR_FORMAT, + sp[I0->sp_offset_in_saved_window()], + sp[I1->sp_offset_in_saved_window()], + sp[I2->sp_offset_in_saved_window()], + sp[I3->sp_offset_in_saved_window()]); + st->print_cr(" I4=" INTPTR_FORMAT " I5=" INTPTR_FORMAT + " I6=" INTPTR_FORMAT " I7=" INTPTR_FORMAT, + sp[I4->sp_offset_in_saved_window()], + sp[I5->sp_offset_in_saved_window()], + sp[I6->sp_offset_in_saved_window()], + sp[I7->sp_offset_in_saved_window()]); st->print_cr(" PC=" INTPTR_FORMAT " nPC=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_PC], uc->uc_mcontext.gregs[REG_nPC]); - st->cr(); st->cr(); - st->print_cr("Register to memory mapping:"); - st->cr(); - - // this is only for the "general purpose" registers - - st->print_cr("O0=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O0]); - print_location(st, uc->uc_mcontext.gregs[REG_O0]); - st->cr(); - st->print_cr("O1=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O1]); - print_location(st, uc->uc_mcontext.gregs[REG_O1]); - st->cr(); - st->print_cr("O2=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O2]); - print_location(st, uc->uc_mcontext.gregs[REG_O2]); - st->cr(); - st->print_cr("O3=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O3]); - print_location(st, uc->uc_mcontext.gregs[REG_O3]); - st->cr(); - st->print_cr("O4=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O4]); - print_location(st, uc->uc_mcontext.gregs[REG_O4]); - st->cr(); - st->print_cr("O5=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O5]); - print_location(st, uc->uc_mcontext.gregs[REG_O5]); - st->cr(); - st->print_cr("O6=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O6]); - print_location(st, uc->uc_mcontext.gregs[REG_O6]); - st->cr(); - st->print_cr("O7=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O7]); - print_location(st, uc->uc_mcontext.gregs[REG_O7]); - st->cr(); - - st->print_cr("G1=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G1]); - print_location(st, uc->uc_mcontext.gregs[REG_G1]); - st->cr(); - st->print_cr("G2=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G2]); - print_location(st, uc->uc_mcontext.gregs[REG_G2]); - st->cr(); - st->print_cr("G3=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G3]); - print_location(st, uc->uc_mcontext.gregs[REG_G3]); - st->cr(); - st->print_cr("G4=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G4]); - print_location(st, uc->uc_mcontext.gregs[REG_G4]); - st->cr(); - st->print_cr("G5=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G5]); - print_location(st, uc->uc_mcontext.gregs[REG_G5]); - st->cr(); - st->print_cr("G6=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G6]); - print_location(st, uc->uc_mcontext.gregs[REG_G6]); - st->cr(); - st->print_cr("G7=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G7]); - print_location(st, uc->uc_mcontext.gregs[REG_G7]); - - st->cr(); - st->cr(); - - intptr_t *sp = (intptr_t *)os::Solaris::ucontext_get_sp(uc); st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", sp); print_hex_dump(st, (address)sp, (address)(sp + 32), sizeof(intptr_t)); st->cr(); @@ -656,7 +672,57 @@ void os::print_context(outputStream *st, void *context) { ExtendedPC epc = os::Solaris::ucontext_get_ExtendedPC(uc); address pc = epc.pc(); st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc); - print_hex_dump(st, pc - 16, pc + 16, sizeof(char)); + print_hex_dump(st, pc - 32, pc + 32, sizeof(char)); +} + +void os::print_register_info(outputStream *st, void *context) { + if (context == NULL) return; + + ucontext_t *uc = (ucontext_t*)context; + intptr_t *sp = (intptr_t *)os::Solaris::ucontext_get_sp(uc); + + st->print_cr("Register to memory mapping:"); + st->cr(); + + // this is only for the "general purpose" registers + st->print("G1="); print_location(st, uc->uc_mcontext.gregs[REG_G1]); + st->print("G2="); print_location(st, uc->uc_mcontext.gregs[REG_G2]); + st->print("G3="); print_location(st, uc->uc_mcontext.gregs[REG_G3]); + st->print("G4="); print_location(st, uc->uc_mcontext.gregs[REG_G4]); + st->print("G5="); print_location(st, uc->uc_mcontext.gregs[REG_G5]); + st->print("G6="); print_location(st, uc->uc_mcontext.gregs[REG_G6]); + st->print("G7="); print_location(st, uc->uc_mcontext.gregs[REG_G7]); + st->cr(); + + st->print("O0="); print_location(st, uc->uc_mcontext.gregs[REG_O0]); + st->print("O1="); print_location(st, uc->uc_mcontext.gregs[REG_O1]); + st->print("O2="); print_location(st, uc->uc_mcontext.gregs[REG_O2]); + st->print("O3="); print_location(st, uc->uc_mcontext.gregs[REG_O3]); + st->print("O4="); print_location(st, uc->uc_mcontext.gregs[REG_O4]); + st->print("O5="); print_location(st, uc->uc_mcontext.gregs[REG_O5]); + st->print("O6="); print_location(st, uc->uc_mcontext.gregs[REG_O6]); + st->print("O7="); print_location(st, uc->uc_mcontext.gregs[REG_O7]); + st->cr(); + + st->print("L0="); print_location(st, sp[L0->sp_offset_in_saved_window()]); + st->print("L1="); print_location(st, sp[L1->sp_offset_in_saved_window()]); + st->print("L2="); print_location(st, sp[L2->sp_offset_in_saved_window()]); + st->print("L3="); print_location(st, sp[L3->sp_offset_in_saved_window()]); + st->print("L4="); print_location(st, sp[L4->sp_offset_in_saved_window()]); + st->print("L5="); print_location(st, sp[L5->sp_offset_in_saved_window()]); + st->print("L6="); print_location(st, sp[L6->sp_offset_in_saved_window()]); + st->print("L7="); print_location(st, sp[L7->sp_offset_in_saved_window()]); + st->cr(); + + st->print("I0="); print_location(st, sp[I0->sp_offset_in_saved_window()]); + st->print("I1="); print_location(st, sp[I1->sp_offset_in_saved_window()]); + st->print("I2="); print_location(st, sp[I2->sp_offset_in_saved_window()]); + st->print("I3="); print_location(st, sp[I3->sp_offset_in_saved_window()]); + st->print("I4="); print_location(st, sp[I4->sp_offset_in_saved_window()]); + st->print("I5="); print_location(st, sp[I5->sp_offset_in_saved_window()]); + st->print("I6="); print_location(st, sp[I6->sp_offset_in_saved_window()]); + st->print("I7="); print_location(st, sp[I7->sp_offset_in_saved_window()]); + st->cr(); } void os::Solaris::init_thread_fpu_state(void) { diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp index 9d9e6192f48..59bd417b470 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_SOLARIS_SPARC_VM_OS_SOLARIS_SPARC_HPP +#define OS_CPU_SOLARIS_SPARC_VM_OS_SOLARIS_SPARC_HPP + // // NOTE: we are back in class os here, not Solaris // @@ -42,3 +45,5 @@ // Used to register dynamic code cache area with the OS // Note: Currently only used in 64 bit Windows implementations static bool register_code_area(char *low, char *high) { return true; } + +#endif // OS_CPU_SOLARIS_SPARC_VM_OS_SOLARIS_SPARC_HPP diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/prefetch_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/prefetch_solaris_sparc.inline.hpp index cd8cddecbc6..70729176433 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/prefetch_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/prefetch_solaris_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef OS_CPU_SOLARIS_SPARC_VM_PREFETCH_SOLARIS_SPARC_INLINE_HPP +#define OS_CPU_SOLARIS_SPARC_VM_PREFETCH_SOLARIS_SPARC_INLINE_HPP + +#include "runtime/prefetch.hpp" + #if defined(COMPILER2) || defined(_LP64) // For Sun Studio inplementation is in solaris_sparc.il @@ -56,3 +61,5 @@ inline void Prefetch::read (void *loc, intx interval) {} inline void Prefetch::write(void *loc, intx interval) {} #endif // defined(COMPILER2) || defined(_LP64) + +#endif // OS_CPU_SOLARIS_SPARC_VM_PREFETCH_SOLARIS_SPARC_INLINE_HPP diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp index 92cccf36ec6..178808ffb3f 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,13 +22,15 @@ * */ +#include "precompiled.hpp" +#include "runtime/threadLocalStorage.hpp" +#include "thread_solaris.inline.hpp" + // Provides an entry point we can link against and // a buffer we can emit code into. The buffer is // filled by ThreadLocalStorage::generate_code_for_get_thread // and called from ThreadLocalStorage::thread() -#include "incls/_precompiled.incl" -#include "incls/_threadLS_solaris_sparc.cpp.incl" #include // The portable TLS mechanism (get_thread_via_cache) is enough on SPARC. diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.hpp index 9d78f743e51..98a8fc58c31 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_SOLARIS_SPARC_VM_THREADLS_SOLARIS_SPARC_HPP +#define OS_CPU_SOLARIS_SPARC_VM_THREADLS_SOLARIS_SPARC_HPP + public: // Java Thread - force inlining static inline Thread* thread() ; @@ -64,3 +67,5 @@ public: uintptr_t ix = (int) (((raw_id >> 9) ^ (raw_id >> 20)) % _pd_cache_size); return ix; } + +#endif // OS_CPU_SOLARIS_SPARC_VM_THREADLS_SOLARIS_SPARC_HPP 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 84efd5e76d1..f622943fedb 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 (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_thread_solaris_sparc.cpp.incl" +#include "precompiled.hpp" +#include "runtime/frame.inline.hpp" +#include "thread_solaris.inline.hpp" // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.hpp index 4f8ab325bd9..1cd0709b6e3 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,6 +21,9 @@ * questions. * */ + +#ifndef OS_CPU_SOLARIS_SPARC_VM_THREAD_SOLARIS_SPARC_HPP +#define OS_CPU_SOLARIS_SPARC_VM_THREAD_SOLARIS_SPARC_HPP private: void pd_initialize() { @@ -95,3 +98,5 @@ public: static bool register_stack_overflow() { return false; } static void enable_register_stack_guard() {} static void disable_register_stack_guard() {} + +#endif // OS_CPU_SOLARIS_SPARC_VM_THREAD_SOLARIS_SPARC_HPP diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp index 182a7184831..710e3369042 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_SOLARIS_SPARC_VM_VMSTRUCTS_SOLARIS_SPARC_HPP +#define OS_CPU_SOLARIS_SPARC_VM_VMSTRUCTS_SOLARIS_SPARC_HPP + // These are the OS and CPU-specific fields, types and integer // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. @@ -65,3 +68,5 @@ \ /* This must be the last entry, and must be present */ \ last_entry() + +#endif // OS_CPU_SOLARIS_SPARC_VM_VMSTRUCTS_SOLARIS_SPARC_HPP diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp index cb7b44a0f08..855e9a965f1 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 +22,14 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_vm_version_solaris_sparc.cpp.incl" +#include "precompiled.hpp" +#include "runtime/os.hpp" +#include "vm_version_sparc.hpp" # include # include # include +# include // We need to keep these here as long as we have to build on Solaris // versions before 10. @@ -65,10 +67,6 @@ int VM_Version::platform_features(int features) { // getisax(2), SI_ARCHITECTURE_32, and SI_ARCHITECTURE_64 are // supported on Solaris 10 and later. if (os::Solaris::supports_getisax()) { -#ifndef PRODUCT - if (PrintMiscellaneous && Verbose) - tty->print_cr("getisax(2) supported."); -#endif // Check 32-bit architecture. do_sysinfo(SI_ARCHITECTURE_32, "sparc", &features, v8_instructions_m); @@ -81,6 +79,11 @@ int VM_Version::platform_features(int features) { uint_t avn = os::Solaris::getisax(&av, 1); assert(avn == 1, "should only return one av"); +#ifndef PRODUCT + if (PrintMiscellaneous && Verbose) + tty->print_cr("getisax(2) returned: " PTR32_FORMAT, av); +#endif + if (av & AV_SPARC_MUL32) features |= hardware_mul32_m; if (av & AV_SPARC_DIV32) features |= hardware_div32_m; if (av & AV_SPARC_FSMULD) features |= hardware_fsmuld_m; @@ -88,11 +91,34 @@ int VM_Version::platform_features(int features) { if (av & AV_SPARC_POPC) features |= hardware_popc_m; if (av & AV_SPARC_VIS) features |= vis1_instructions_m; if (av & AV_SPARC_VIS2) features |= vis2_instructions_m; + + // Next values are not defined before Solaris 10 + // but Solaris 8 is used for jdk6 update builds. +#ifndef AV_SPARC_ASI_BLK_INIT +#define AV_SPARC_ASI_BLK_INIT 0x0080 /* ASI_BLK_INIT_xxx ASI */ +#endif + if (av & AV_SPARC_ASI_BLK_INIT) features |= blk_init_instructions_m; + +#ifndef AV_SPARC_FMAF +#define AV_SPARC_FMAF 0x0100 /* Fused Multiply-Add */ +#endif + if (av & AV_SPARC_FMAF) features |= fmaf_instructions_m; + +#ifndef AV_SPARC_FMAU +#define AV_SPARC_FMAU 0x0200 /* Unfused Multiply-Add */ +#endif + if (av & AV_SPARC_FMAU) features |= fmau_instructions_m; + +#ifndef AV_SPARC_VIS3 +#define AV_SPARC_VIS3 0x0400 /* VIS3 instruction set extensions */ +#endif + if (av & AV_SPARC_VIS3) features |= vis3_instructions_m; + } else { // getisax(2) failed, use the old legacy code. #ifndef PRODUCT if (PrintMiscellaneous && Verbose) - tty->print_cr("getisax(2) not supported."); + tty->print_cr("getisax(2) is not supported."); #endif char tmp; @@ -127,5 +153,59 @@ int VM_Version::platform_features(int features) { // Determine the machine type. do_sysinfo(SI_MACHINE, "sun4v", &features, sun4v_m); + { + // Using kstat to determine the machine type. + kstat_ctl_t* kc = kstat_open(); + kstat_t* ksp = kstat_lookup(kc, (char*)"cpu_info", -1, NULL); + const char* implementation = "UNKNOWN"; + if (ksp != NULL) { + if (kstat_read(kc, ksp, NULL) != -1 && ksp->ks_data != NULL) { + kstat_named_t* knm = (kstat_named_t *)ksp->ks_data; + for (int i = 0; i < ksp->ks_ndata; i++) { + if (strcmp((const char*)&(knm[i].name),"implementation") == 0) { +#ifndef KSTAT_DATA_STRING +#define KSTAT_DATA_STRING 9 +#endif + if (knm[i].data_type == KSTAT_DATA_CHAR) { + // VM is running on Solaris 8 which does not have value.str. + implementation = &(knm[i].value.c[0]); + } else if (knm[i].data_type == KSTAT_DATA_STRING) { + // VM is running on Solaris 10. +#ifndef KSTAT_NAMED_STR_PTR + // Solaris 8 was used to build VM, define the structure it misses. + struct str_t { + union { + char *ptr; /* NULL-term string */ + char __pad[8]; /* 64-bit padding */ + } addr; + uint32_t len; /* # bytes for strlen + '\0' */ + }; +#define KSTAT_NAMED_STR_PTR(knptr) (( (str_t*)&((knptr)->value) )->addr.ptr) +#endif + implementation = KSTAT_NAMED_STR_PTR(&knm[i]); + } +#ifndef PRODUCT + if (PrintMiscellaneous && Verbose) { + tty->print_cr("cpu_info.implementation: %s", implementation); + } +#endif + if (strncmp(implementation, "SPARC64", 7) == 0) { + features |= sparc64_family_m; + } else if (strncmp(implementation, "UltraSPARC-T", 12) == 0) { + features |= T_family_m; + if (strncmp(implementation, "UltraSPARC-T1", 13) == 0) { + features |= T1_model_m; + } + } + break; + } + } // for( + } + } + assert(strcmp(implementation, "UNKNOWN") != 0, + "unknown cpu info (changed kstat interface?)"); + kstat_close(kc); + } + return features; } diff --git a/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp index bb782860f64..d1cd12f2803 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_assembler_solaris_x86.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_x86.inline.hpp" +#include "runtime/os.hpp" +#include "runtime/threadLocalStorage.hpp" void MacroAssembler::int3() { diff --git a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp index 240a8de5c1d..a4b04606b9a 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP +#define OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP + +#include "orderAccess_solaris_x86.inline.hpp" +#include "runtime/atomic.hpp" +#include "runtime/os.hpp" +#include "vm_version_x86.hpp" + inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; } inline void Atomic::store (jshort store_value, jshort* dest) { *dest = store_value; } inline void Atomic::store (jint store_value, jint* dest) { *dest = store_value; } @@ -245,3 +253,5 @@ extern "C" { #undef LOCK_IF_MP #endif // _GNU_SOURCE + +#endif // OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP diff --git a/hotspot/src/os_cpu/solaris_x86/vm/bytes_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/bytes_solaris_x86.inline.hpp index 075986d2159..58620e59fd7 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/bytes_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/bytes_solaris_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_SOLARIS_X86_VM_BYTES_SOLARIS_X86_INLINE_HPP +#define OS_CPU_SOLARIS_X86_VM_BYTES_SOLARIS_X86_INLINE_HPP + // For Sun Studio - implementation is in solaris_i486.il. // For gcc - implementation is just below. extern "C" u2 _raw_swap_u2(u2 x); @@ -109,3 +112,5 @@ extern "C" { #endif // AMD64 } #endif //_GNU_SOURCE + +#endif // OS_CPU_SOLARIS_X86_VM_BYTES_SOLARIS_X86_INLINE_HPP diff --git a/hotspot/src/os_cpu/solaris_x86/vm/copy_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/copy_solaris_x86.inline.hpp index a78ef6fe311..4d3790d504f 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/copy_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/copy_solaris_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_SOLARIS_X86_VM_COPY_SOLARIS_X86_INLINE_HPP +#define OS_CPU_SOLARIS_X86_VM_COPY_SOLARIS_X86_INLINE_HPP + static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) { (void)memmove(to, from, count * HeapWordSize); } @@ -136,3 +139,5 @@ static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) _Copy_arrayof_conjoint_jints(from, to, count); #endif // AMD64 } + +#endif // OS_CPU_SOLARIS_X86_VM_COPY_SOLARIS_X86_INLINE_HPP diff --git a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp index 36fd38fcc4d..0bbe0acba0c 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp @@ -22,6 +22,9 @@ * */ +#ifndef OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP +#define OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP + // Sets the default values for platform dependent flags used by the runtime system. // (see globals.hpp) @@ -44,3 +47,5 @@ define_pd_global(intx, CompilerThreadStackSize, 0); define_pd_global(uintx,HeapBaseMinAddress, 256*M); // Only used on 64 bit Windows platforms define_pd_global(bool, UseVectoredExceptions, false); + +#endif // OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP diff --git a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp index 84c1ce9238d..a4894c8f89a 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp @@ -22,6 +22,12 @@ * */ +#ifndef OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP +#define OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP + +#include "runtime/orderAccess.hpp" +#include "vm_version_x86.hpp" + // Implementation of class OrderAccess. // For Sun Studio - implementation is in solaris_i486.il. @@ -127,3 +133,5 @@ inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) inline void OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { *p = v; fence(); } inline void OrderAccess::release_store_ptr_fence(volatile void* p, void* v) { *(void* volatile *)p = v; fence(); } + +#endif // OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP 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 a80374a0095..d9bb0eb58c3 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 @@ -22,8 +22,42 @@ * */ -// do not include precompiled header file -# include "incls/_os_solaris_x86.cpp.incl" +// no precompiled headers +#include "assembler_x86.inline.hpp" +#include "classfile/classLoader.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "interpreter/interpreter.hpp" +#include "jvm_solaris.h" +#include "memory/allocation.inline.hpp" +#include "mutex_solaris.inline.hpp" +#include "nativeInst_x86.hpp" +#include "os_share_solaris.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm.h" +#include "prims/jvm_misc.hpp" +#include "runtime/arguments.hpp" +#include "runtime/extendedPC.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/osThread.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/timer.hpp" +#include "thread_solaris.inline.hpp" +#include "utilities/events.hpp" +#include "utilities/vmError.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif // put OS-includes here # include @@ -708,6 +742,13 @@ int JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, int abort_ sigaddset(&newset, sig); sigprocmask(SIG_UNBLOCK, &newset, NULL); + // Determine which sort of error to throw. Out of swap may signal + // on the thread stack, which could get a mapping error when touched. + address addr = (address) info->si_addr; + if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) { + vm_exit_out_of_memory(0, "Out of swap space to map in thread stack."); + } + VMError err(t, sig, pc, info, ucVoid); err.report_and_die(); @@ -719,11 +760,6 @@ void os::print_context(outputStream *st, void *context) { ucontext_t *uc = (ucontext_t*)context; st->print_cr("Registers:"); - - // this is horrendously verbose but the layout of the registers in the - // context does not match how we defined our abstract Register set, so - // we can't just iterate through the gregs area - #ifdef AMD64 st->print( "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]); st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]); @@ -735,8 +771,8 @@ void os::print_context(outputStream *st, void *context) { st->print(", RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]); st->print(", RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]); st->cr(); - st->print( "R8=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]); - st->print(", R9=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]); + st->print( "R8 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]); + st->print(", R9 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]); st->print(", R10=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R10]); st->print(", R11=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R11]); st->cr(); @@ -747,63 +783,6 @@ void os::print_context(outputStream *st, void *context) { st->cr(); st->print( "RIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RIP]); st->print(", RFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RFL]); - - st->cr(); - st->cr(); - - st->print_cr("Register to memory mapping:"); - st->cr(); - - // this is only for the "general purpose" registers - - st->print_cr("RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]); - print_location(st, uc->uc_mcontext.gregs[REG_RAX]); - st->cr(); - st->print_cr("RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]); - print_location(st, uc->uc_mcontext.gregs[REG_RBX]); - st->cr(); - st->print_cr("RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]); - print_location(st, uc->uc_mcontext.gregs[REG_RCX]); - st->cr(); - st->print_cr("RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]); - print_location(st, uc->uc_mcontext.gregs[REG_RDX]); - st->cr(); - st->print_cr("RSP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSP]); - print_location(st, uc->uc_mcontext.gregs[REG_RSP]); - st->cr(); - st->print_cr("RBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBP]); - print_location(st, uc->uc_mcontext.gregs[REG_RSP]); - st->cr(); - st->print_cr("RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]); - print_location(st, uc->uc_mcontext.gregs[REG_RSI]); - st->cr(); - st->print_cr("RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]); - print_location(st, uc->uc_mcontext.gregs[REG_RDI]); - st->cr(); - st->print_cr("R8 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]); - print_location(st, uc->uc_mcontext.gregs[REG_R8]); - st->cr(); - st->print_cr("R9 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]); - print_location(st, uc->uc_mcontext.gregs[REG_R9]); - st->cr(); - st->print_cr("R10=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R10]); - print_location(st, uc->uc_mcontext.gregs[REG_R10]); - st->cr(); - st->print_cr("R11=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R11]); - print_location(st, uc->uc_mcontext.gregs[REG_R11]); - st->cr(); - st->print_cr("R12=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R12]); - print_location(st, uc->uc_mcontext.gregs[REG_R12]); - st->cr(); - st->print_cr("R13=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R13]); - print_location(st, uc->uc_mcontext.gregs[REG_R13]); - st->cr(); - st->print_cr("R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]); - print_location(st, uc->uc_mcontext.gregs[REG_R14]); - st->cr(); - st->print_cr("R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]); - print_location(st, uc->uc_mcontext.gregs[REG_R15]); - #else st->print( "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EAX]); st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBX]); @@ -817,39 +796,6 @@ void os::print_context(outputStream *st, void *context) { st->cr(); st->print( "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EIP]); st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EFL]); - - st->cr(); - st->cr(); - - st->print_cr("Register to memory mapping:"); - st->cr(); - - // this is only for the "general purpose" registers - - st->print_cr("EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EAX]); - print_location(st, uc->uc_mcontext.gregs[EAX]); - st->cr(); - st->print_cr("EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBX]); - print_location(st, uc->uc_mcontext.gregs[EBX]); - st->cr(); - st->print_cr("ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[ECX]); - print_location(st, uc->uc_mcontext.gregs[ECX]); - st->cr(); - st->print_cr("EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EDX]); - print_location(st, uc->uc_mcontext.gregs[EDX]); - st->cr(); - st->print_cr("ESP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[UESP]); - print_location(st, uc->uc_mcontext.gregs[UESP]); - st->cr(); - st->print_cr("EBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBP]); - print_location(st, uc->uc_mcontext.gregs[EBP]); - st->cr(); - st->print_cr("ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[ESI]); - print_location(st, uc->uc_mcontext.gregs[ESI]); - st->cr(); - st->print_cr("EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EDI]); - print_location(st, uc->uc_mcontext.gregs[EDI]); - #endif // AMD64 st->cr(); st->cr(); @@ -865,7 +811,52 @@ void os::print_context(outputStream *st, void *context) { ExtendedPC epc = os::Solaris::ucontext_get_ExtendedPC(uc); address pc = epc.pc(); st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc); - print_hex_dump(st, pc - 16, pc + 16, sizeof(char)); + print_hex_dump(st, pc - 32, pc + 32, sizeof(char)); +} + +void os::print_register_info(outputStream *st, void *context) { + if (context == NULL) return; + + ucontext_t *uc = (ucontext_t*)context; + + st->print_cr("Register to memory mapping:"); + st->cr(); + + // this is horrendously verbose but the layout of the registers in the + // context does not match how we defined our abstract Register set, so + // we can't just iterate through the gregs area + + // this is only for the "general purpose" registers + +#ifdef AMD64 + st->print("RAX="); print_location(st, uc->uc_mcontext.gregs[REG_RAX]); + st->print("RBX="); print_location(st, uc->uc_mcontext.gregs[REG_RBX]); + st->print("RCX="); print_location(st, uc->uc_mcontext.gregs[REG_RCX]); + st->print("RDX="); print_location(st, uc->uc_mcontext.gregs[REG_RDX]); + st->print("RSP="); print_location(st, uc->uc_mcontext.gregs[REG_RSP]); + st->print("RBP="); print_location(st, uc->uc_mcontext.gregs[REG_RBP]); + st->print("RSI="); print_location(st, uc->uc_mcontext.gregs[REG_RSI]); + st->print("RDI="); print_location(st, uc->uc_mcontext.gregs[REG_RDI]); + st->print("R8 ="); print_location(st, uc->uc_mcontext.gregs[REG_R8]); + st->print("R9 ="); print_location(st, uc->uc_mcontext.gregs[REG_R9]); + st->print("R10="); print_location(st, uc->uc_mcontext.gregs[REG_R10]); + st->print("R11="); print_location(st, uc->uc_mcontext.gregs[REG_R11]); + st->print("R12="); print_location(st, uc->uc_mcontext.gregs[REG_R12]); + st->print("R13="); print_location(st, uc->uc_mcontext.gregs[REG_R13]); + st->print("R14="); print_location(st, uc->uc_mcontext.gregs[REG_R14]); + st->print("R15="); print_location(st, uc->uc_mcontext.gregs[REG_R15]); +#else + st->print("EAX="); print_location(st, uc->uc_mcontext.gregs[EAX]); + st->print("EBX="); print_location(st, uc->uc_mcontext.gregs[EBX]); + st->print("ECX="); print_location(st, uc->uc_mcontext.gregs[ECX]); + st->print("EDX="); print_location(st, uc->uc_mcontext.gregs[EDX]); + st->print("ESP="); print_location(st, uc->uc_mcontext.gregs[UESP]); + st->print("EBP="); print_location(st, uc->uc_mcontext.gregs[EBP]); + st->print("ESI="); print_location(st, uc->uc_mcontext.gregs[ESI]); + st->print("EDI="); print_location(st, uc->uc_mcontext.gregs[EDI]); +#endif + + st->cr(); } diff --git a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp index fb714bb9680..5841fb3eb59 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_SOLARIS_X86_VM_OS_SOLARIS_X86_HPP +#define OS_CPU_SOLARIS_X86_VM_OS_SOLARIS_X86_HPP + // // NOTE: we are back in class os here, not Solaris // @@ -48,3 +51,5 @@ // Used to register dynamic code cache area with the OS // Note: Currently only used in 64 bit Windows implementations static bool register_code_area(char *low, char *high) { return true; } + +#endif // OS_CPU_SOLARIS_X86_VM_OS_SOLARIS_X86_HPP diff --git a/hotspot/src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.hpp index f481c0be39e..a83b6f6d659 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef OS_CPU_SOLARIS_X86_VM_PREFETCH_SOLARIS_X86_INLINE_HPP +#define OS_CPU_SOLARIS_X86_VM_PREFETCH_SOLARIS_X86_INLINE_HPP + +#include "runtime/prefetch.hpp" + extern "C" { void _Prefetch_read (void *loc, intx interval); void _Prefetch_write(void *loc, intx interval); @@ -39,3 +44,5 @@ inline void Prefetch::write(void *loc, intx interval) { _Prefetch_write(loc, interval); #endif // AMD64 } + +#endif // OS_CPU_SOLARIS_X86_VM_PREFETCH_SOLARIS_X86_INLINE_HPP diff --git a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.il b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.il index 99b19a313ad..be111f4322e 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.il +++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.il @@ -1,5 +1,5 @@ // -// Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE 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/solaris_x86_32.s b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s index 6219a698d66..1fac3b25f11 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s +++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s @@ -1,5 +1,5 @@ // -// Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE 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/solaris_x86_64.il b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.il index 9b66b3652a1..b260375b164 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.il +++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.il @@ -1,5 +1,5 @@ // -// Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE 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/threadLS_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp index 978d22d4fa6..439a09c9583 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_threadLS_solaris_x86.cpp.incl" +#include "precompiled.hpp" +#include "runtime/threadLocalStorage.hpp" +#include "thread_solaris.inline.hpp" #ifdef AMD64 extern "C" Thread* fs_load(ptrdiff_t tlsOffset); diff --git a/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp index 6150f9f52ae..05a9e7c25dd 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_SOLARIS_X86_VM_THREADLS_SOLARIS_X86_HPP +#define OS_CPU_SOLARIS_X86_VM_THREADLS_SOLARIS_X86_HPP + // Processor dependent parts of ThreadLocalStorage private: @@ -78,3 +81,5 @@ public: // Java Thread static inline Thread* thread(); + +#endif // OS_CPU_SOLARIS_X86_VM_THREADLS_SOLARIS_X86_HPP 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 fa308d54630..b1f785ada9e 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 (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_thread_solaris_x86.cpp.incl" +#include "precompiled.hpp" +#include "runtime/frame.inline.hpp" +#include "thread_solaris.inline.hpp" // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF diff --git a/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp index e44a83df685..d9665d3925c 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_SOLARIS_X86_VM_THREAD_SOLARIS_X86_HPP +#define OS_CPU_SOLARIS_X86_VM_THREAD_SOLARIS_X86_HPP + private: void pd_initialize() { _anchor.clear(); } @@ -57,3 +60,5 @@ static bool register_stack_overflow() { return false; } static void enable_register_stack_guard() {} static void disable_register_stack_guard() {} + +#endif // OS_CPU_SOLARIS_X86_VM_THREAD_SOLARIS_X86_HPP diff --git a/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp index 83575234d05..76338956021 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_SOLARIS_X86_VM_VMSTRUCTS_SOLARIS_X86_HPP +#define OS_CPU_SOLARIS_X86_VM_VMSTRUCTS_SOLARIS_X86_HPP + // These are the OS and CPU-specific fields, types and integer // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. @@ -57,3 +60,5 @@ \ /* This must be the last entry, and must be present */ \ last_entry() + +#endif // OS_CPU_SOLARIS_X86_VM_VMSTRUCTS_SOLARIS_X86_HPP diff --git a/hotspot/src/os_cpu/solaris_x86/vm/vm_version_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/vm_version_solaris_x86.cpp index ee79c6c6189..f1a3c3a0b88 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/vm_version_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/vm_version_solaris_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +22,7 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_vm_version_solaris_x86.cpp.incl" +#include "precompiled.hpp" +#include "runtime/os.hpp" +#include "vm_version_x86.hpp" + diff --git a/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp index 3573d495e76..55e5053387d 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp +++ b/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_assembler_windows_x86.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "assembler_x86.inline.hpp" +#include "runtime/os.hpp" +#include "runtime/threadLocalStorage.hpp" void MacroAssembler::int3() { diff --git a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp index 462c498f3d4..7c26cb61051 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP +#define OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP + +#include "orderAccess_windows_x86.inline.hpp" +#include "runtime/atomic.hpp" +#include "runtime/os.hpp" +#include "vm_version_x86.hpp" + // The following alternative implementations are needed because // Windows 95 doesn't support (some of) the corresponding Windows NT // calls. Furthermore, these versions allow inlining in the caller. @@ -249,3 +257,5 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* #endif // AMD64 #pragma warning(default: 4035) // Enables warnings reporting missing return statement + +#endif // OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP diff --git a/hotspot/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp index b1ea58b3892..49a79e40974 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_WINDOWS_X86_VM_BYTES_WINDOWS_X86_INLINE_HPP +#define OS_CPU_WINDOWS_X86_VM_BYTES_WINDOWS_X86_INLINE_HPP + #pragma warning(disable: 4035) // Disable warning 4035: no return value // Efficient swapping of data bytes from Java byte @@ -80,3 +83,5 @@ inline u8 Bytes::swap_u8(u8 x) { #endif // AMD64 #pragma warning(default: 4035) // Enable warning 4035: no return value + +#endif // OS_CPU_WINDOWS_X86_VM_BYTES_WINDOWS_X86_INLINE_HPP diff --git a/hotspot/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp index 68a3359d405..f39b7a0a520 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP +#define OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP + static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) { (void)memmove(to, from, count * HeapWordSize); } @@ -164,3 +167,5 @@ static void pd_arrayof_conjoint_jlongs(HeapWord* from, HeapWord* to, size_t coun static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) { pd_conjoint_oops_atomic((oop*)from, (oop*)to, count); } + +#endif // OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP diff --git a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp index 146c1c3e92f..9363190eb25 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP +#define OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP + // Sets the default values for platform dependent flags used by the runtime system. // (see globals.hpp) @@ -46,3 +49,5 @@ define_pd_global(uintx, JVMInvokeMethodSlack, 8192); define_pd_global(uintx, HeapBaseMinAddress, 2*G); // Only used on 64 bit Windows platforms define_pd_global(bool, UseVectoredExceptions, false); + +#endif // OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP diff --git a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp index 1ccddc4d397..b47753bf656 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp @@ -22,6 +22,12 @@ * */ +#ifndef OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP +#define OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP + +#include "runtime/orderAccess.hpp" +#include "vm_version_x86.hpp" + #pragma warning(disable: 4035) // Disables warnings reporting missing return statement // Implementation of class OrderAccess. @@ -208,3 +214,5 @@ inline void OrderAccess::release_store_ptr_fence(volatile void* p, void* } #pragma warning(default: 4035) // Enables warnings reporting missing return statement + +#endif // OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP diff --git a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp index cc32675875f..960ceab665a 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp +++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp @@ -22,8 +22,43 @@ * */ -// do not include precompiled header file -# include "incls/_os_windows_x86.cpp.incl" +// no precompiled headers +#include "assembler_x86.inline.hpp" +#include "classfile/classLoader.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/icBuffer.hpp" +#include "code/vtableStubs.hpp" +#include "interpreter/interpreter.hpp" +#include "jvm_windows.h" +#include "memory/allocation.inline.hpp" +#include "mutex_windows.inline.hpp" +#include "nativeInst_x86.hpp" +#include "os_share_windows.hpp" +#include "prims/jniFastGetField.hpp" +#include "prims/jvm.h" +#include "prims/jvm_misc.hpp" +#include "runtime/arguments.hpp" +#include "runtime/extendedPC.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/osThread.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/timer.hpp" +#include "thread_windows.inline.hpp" +#include "utilities/events.hpp" +#include "utilities/vmError.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif + # include "unwind_windows_x86.hpp" #undef REG_SP #undef REG_FP @@ -387,8 +422,8 @@ void os::print_context(outputStream *st, void *context) { st->print(", RSI=" INTPTR_FORMAT, uc->Rsi); st->print(", RDI=" INTPTR_FORMAT, uc->Rdi); st->cr(); - st->print( "R8=" INTPTR_FORMAT, uc->R8); - st->print(", R9=" INTPTR_FORMAT, uc->R9); + st->print( "R8 =" INTPTR_FORMAT, uc->R8); + st->print(", R9 =" INTPTR_FORMAT, uc->R9); st->print(", R10=" INTPTR_FORMAT, uc->R10); st->print(", R11=" INTPTR_FORMAT, uc->R11); st->cr(); @@ -399,62 +434,6 @@ void os::print_context(outputStream *st, void *context) { st->cr(); st->print( "RIP=" INTPTR_FORMAT, uc->Rip); st->print(", EFLAGS=" INTPTR_FORMAT, uc->EFlags); - - st->cr(); - st->cr(); - - st->print_cr("Register to memory mapping:"); - st->cr(); - - // this is only for the "general purpose" registers - - st->print_cr("RAX=" INTPTR_FORMAT, uc->Rax); - print_location(st, uc->Rax); - st->cr(); - st->print_cr("RBX=" INTPTR_FORMAT, uc->Rbx); - print_location(st, uc->Rbx); - st->cr(); - st->print_cr("RCX=" INTPTR_FORMAT, uc->Rcx); - print_location(st, uc->Rcx); - st->cr(); - st->print_cr("RDX=" INTPTR_FORMAT, uc->Rdx); - print_location(st, uc->Rdx); - st->cr(); - st->print_cr("RSP=" INTPTR_FORMAT, uc->Rsp); - print_location(st, uc->Rsp); - st->cr(); - st->print_cr("RBP=" INTPTR_FORMAT, uc->Rbp); - print_location(st, uc->Rbp); - st->cr(); - st->print_cr("RSI=" INTPTR_FORMAT, uc->Rsi); - print_location(st, uc->Rsi); - st->cr(); - st->print_cr("RDI=" INTPTR_FORMAT, uc->Rdi); - print_location(st, uc->Rdi); - st->cr(); - st->print_cr("R8 =" INTPTR_FORMAT, uc->R8); - print_location(st, uc->R8); - st->cr(); - st->print_cr("R9 =" INTPTR_FORMAT, uc->R9); - print_location(st, uc->R9); - st->cr(); - st->print_cr("R10=" INTPTR_FORMAT, uc->R10); - print_location(st, uc->R10); - st->cr(); - st->print_cr("R11=" INTPTR_FORMAT, uc->R11); - print_location(st, uc->R11); - st->cr(); - st->print_cr("R12=" INTPTR_FORMAT, uc->R12); - print_location(st, uc->R12); - st->cr(); - st->print_cr("R13=" INTPTR_FORMAT, uc->R13); - print_location(st, uc->R13); - st->cr(); - st->print_cr("R14=" INTPTR_FORMAT, uc->R14); - print_location(st, uc->R14); - st->cr(); - st->print_cr("R15=" INTPTR_FORMAT, uc->R15); - print_location(st, uc->R15); #else st->print( "EAX=" INTPTR_FORMAT, uc->Eax); st->print(", EBX=" INTPTR_FORMAT, uc->Ebx); @@ -468,38 +447,6 @@ void os::print_context(outputStream *st, void *context) { st->cr(); st->print( "EIP=" INTPTR_FORMAT, uc->Eip); st->print(", EFLAGS=" INTPTR_FORMAT, uc->EFlags); - - st->cr(); - st->cr(); - - st->print_cr("Register to memory mapping:"); - st->cr(); - - // this is only for the "general purpose" registers - - st->print_cr("EAX=" INTPTR_FORMAT, uc->Eax); - print_location(st, uc->Eax); - st->cr(); - st->print_cr("EBX=" INTPTR_FORMAT, uc->Ebx); - print_location(st, uc->Ebx); - st->cr(); - st->print_cr("ECX=" INTPTR_FORMAT, uc->Ecx); - print_location(st, uc->Ecx); - st->cr(); - st->print_cr("EDX=" INTPTR_FORMAT, uc->Edx); - print_location(st, uc->Edx); - st->cr(); - st->print_cr("ESP=" INTPTR_FORMAT, uc->Esp); - print_location(st, uc->Esp); - st->cr(); - st->print_cr("EBP=" INTPTR_FORMAT, uc->Ebp); - print_location(st, uc->Ebp); - st->cr(); - st->print_cr("ESI=" INTPTR_FORMAT, uc->Esi); - print_location(st, uc->Esi); - st->cr(); - st->print_cr("EDI=" INTPTR_FORMAT, uc->Edi); - print_location(st, uc->Edi); #endif // AMD64 st->cr(); st->cr(); @@ -514,7 +461,49 @@ void os::print_context(outputStream *st, void *context) { // this at the end, and hope for the best. address pc = (address)uc->REG_PC; st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc); - print_hex_dump(st, pc - 16, pc + 16, sizeof(char)); + print_hex_dump(st, pc - 32, pc + 32, sizeof(char)); + st->cr(); +} + + +void os::print_register_info(outputStream *st, void *context) { + if (context == NULL) return; + + CONTEXT* uc = (CONTEXT*)context; + + st->print_cr("Register to memory mapping:"); + st->cr(); + + // this is only for the "general purpose" registers + +#ifdef AMD64 + st->print("RAX="); print_location(st, uc->Rax); + st->print("RBX="); print_location(st, uc->Rbx); + st->print("RCX="); print_location(st, uc->Rcx); + st->print("RDX="); print_location(st, uc->Rdx); + st->print("RSP="); print_location(st, uc->Rsp); + st->print("RBP="); print_location(st, uc->Rbp); + st->print("RSI="); print_location(st, uc->Rsi); + st->print("RDI="); print_location(st, uc->Rdi); + st->print("R8 ="); print_location(st, uc->R8); + st->print("R9 ="); print_location(st, uc->R9); + st->print("R10="); print_location(st, uc->R10); + st->print("R11="); print_location(st, uc->R11); + st->print("R12="); print_location(st, uc->R12); + st->print("R13="); print_location(st, uc->R13); + st->print("R14="); print_location(st, uc->R14); + st->print("R15="); print_location(st, uc->R15); +#else + st->print("EAX="); print_location(st, uc->Eax); + st->print("EBX="); print_location(st, uc->Ebx); + st->print("ECX="); print_location(st, uc->Ecx); + st->print("EDX="); print_location(st, uc->Edx); + st->print("ESP="); print_location(st, uc->Esp); + st->print("EBP="); print_location(st, uc->Ebp); + st->print("ESI="); print_location(st, uc->Esi); + st->print("EDI="); print_location(st, uc->Edi); +#endif + st->cr(); } diff --git a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp index e5dcc78bdfc..e7c3303c0f7 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_WINDOWS_X86_VM_OS_WINDOWS_X86_HPP +#define OS_CPU_WINDOWS_X86_VM_OS_WINDOWS_X86_HPP + // // NOTE: we are back in class os here, not win32 // @@ -56,3 +59,5 @@ static bool supports_sse() { return true; } static bool register_code_area(char *low, char *high); + +#endif // OS_CPU_WINDOWS_X86_VM_OS_WINDOWS_X86_HPP diff --git a/hotspot/src/os_cpu/windows_x86/vm/prefetch_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/prefetch_windows_x86.inline.hpp index 5294ec7d9bf..a09c1947755 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/prefetch_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/prefetch_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +22,12 @@ * */ +#ifndef OS_CPU_WINDOWS_X86_VM_PREFETCH_WINDOWS_X86_INLINE_HPP +#define OS_CPU_WINDOWS_X86_VM_PREFETCH_WINDOWS_X86_INLINE_HPP + +#include "runtime/prefetch.hpp" + inline void Prefetch::read (void *loc, intx interval) {} inline void Prefetch::write(void *loc, intx interval) {} + +#endif // OS_CPU_WINDOWS_X86_VM_PREFETCH_WINDOWS_X86_INLINE_HPP diff --git a/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp index 103730575a7..9bb8b4ad7ab 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp +++ b/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 +22,15 @@ * */ +#include "precompiled.hpp" +#include "runtime/threadLocalStorage.hpp" +#include "thread_windows.inline.hpp" + // Provides an entry point we can link against and // a buffer we can emit code into. The buffer is // filled by ThreadLocalStorage::generate_code_for_get_thread // and called from ThreadLocalStorage::thread() -#include "incls/_precompiled.incl" -#include "incls/_threadLS_windows_x86.cpp.incl" - int ThreadLocalStorage::_thread_ptr_offset = 0; static void call_wrapper_dummy() {} diff --git a/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.hpp index edb7fa18a3f..a764d7376f5 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_WINDOWS_X86_VM_THREADLS_WINDOWS_X86_HPP +#define OS_CPU_WINDOWS_X86_VM_THREADLS_WINDOWS_X86_HPP + // Processor dependent parts of ThreadLocalStorage protected: @@ -42,3 +45,5 @@ public: static inline void set_thread_ptr_offset( int offset ) { _thread_ptr_offset = offset; } static inline int get_thread_ptr_offset() { return _thread_ptr_offset; } + +#endif // OS_CPU_WINDOWS_X86_VM_THREADLS_WINDOWS_X86_HPP diff --git a/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp index 7334845c3d9..6f8c4b84ac5 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp +++ b/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_thread_windows_x86.cpp.incl" +#include "precompiled.hpp" +#include "runtime/frame.inline.hpp" +#include "thread_windows.inline.hpp" // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF diff --git a/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp index 11e018068a0..1199a3c5b45 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_WINDOWS_X86_VM_THREAD_WINDOWS_X86_HPP +#define OS_CPU_WINDOWS_X86_VM_THREAD_WINDOWS_X86_HPP + private: void pd_initialize() { _anchor.clear(); @@ -60,3 +63,5 @@ static bool register_stack_overflow() { return false; } static void enable_register_stack_guard() {} static void disable_register_stack_guard() {} + +#endif // OS_CPU_WINDOWS_X86_VM_THREAD_WINDOWS_X86_HPP diff --git a/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp index 9ad977224f4..6762bf2308a 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_WINDOWS_X86_VM_UNWIND_WINDOWS_X86_HPP +#define OS_CPU_WINDOWS_X86_VM_UNWIND_WINDOWS_X86_HPP + #ifdef AMD64 typedef unsigned char UBYTE; @@ -81,3 +84,5 @@ typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) ( #endif #endif // AMD64 + +#endif // OS_CPU_WINDOWS_X86_VM_UNWIND_WINDOWS_X86_HPP diff --git a/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp index 765b2423949..6df1f7226fa 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef OS_CPU_WINDOWS_X86_VM_VMSTRUCTS_WINDOWS_X86_HPP +#define OS_CPU_WINDOWS_X86_VM_VMSTRUCTS_WINDOWS_X86_HPP + // These are the OS and CPU-specific fields, types and integer // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. @@ -52,3 +55,5 @@ \ /* This must be the last entry, and must be present */ \ last_entry() + +#endif // OS_CPU_WINDOWS_X86_VM_VMSTRUCTS_WINDOWS_X86_HPP diff --git a/hotspot/src/os_cpu/windows_x86/vm/vm_version_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/vm_version_windows_x86.cpp index d88236783ac..f1a3c3a0b88 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/vm_version_windows_x86.cpp +++ b/hotspot/src/os_cpu/windows_x86/vm/vm_version_windows_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +22,7 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_vm_version_windows_x86.cpp.incl" +#include "precompiled.hpp" +#include "runtime/os.hpp" +#include "vm_version_x86.hpp" + diff --git a/hotspot/src/share/tools/MakeDeps/Database.java b/hotspot/src/share/tools/MakeDeps/Database.java deleted file mode 100644 index 2a19c29f082..00000000000 --- a/hotspot/src/share/tools/MakeDeps/Database.java +++ /dev/null @@ -1,552 +0,0 @@ -/* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -import java.io.*; -import java.util.*; - -public class Database { - private MacroDefinitions macros; - // allFiles is kept in lexicographically sorted order. See get(). - private FileList allFiles; - // files that have implicit dependency on platform files - // e.g. os.hpp: os_.hpp os_.hpp but only - // recorded if the platform file was seen. - private FileList platformFiles; - 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 boolean missingOk; - private Platform plat; - /** These allow you to specify files not in the include database - which are prepended and appended to the file list, allowing - you to have well-known functions at the start and end of the - text segment (allows us to find out in a portable fashion - whether the current PC is in VM code or not upon a crash) */ - private String firstFile; - private String lastFile; - - public Database(Platform plat, long t) { - this.plat = plat; - macros = new MacroDefinitions(); - allFiles = new FileList("allFiles", plat); - platformFiles = new FileList("platformFiles", plat); - outerFiles = new FileList("outerFiles", plat); - indivIncludes = new FileList("IndivIncludes", plat); - grandInclude = new FileList(plat.getGIFileTemplate().nameOfList(), plat); - platformDepFiles = new HashMap(); - - threshold = t; - nOuterFiles = 0; - missingOk = false; - firstFile = null; - lastFile = null; - }; - - public FileList getAllFiles() { - return allFiles; - } - - public Iterator getMacros() { - return macros.getMacros(); - } - - public void canBeMissing() { - missingOk = true; - } - - public boolean hfileIsInGrandInclude(FileList hfile, FileList cfile) { - return ((hfile.getCount() >= threshold) && (cfile.getUseGrandInclude())); - } - - /** These allow you to specify files not in the include database - which are prepended and appended to the file list, allowing - you to have well-known functions at the start and end of the - text segment (allows us to find out in a portable fashion - whether the current PC is in VM code or not upon a crash) */ - public void setFirstFile(String fileName) { - firstFile = fileName; - } - - public void setLastFile(String fileName) { - lastFile = fileName; - } - - public void get(String platFileName, String dbFileName) - throws FileFormatException, IOException, FileNotFoundException { - macros.readFrom(platFileName, missingOk); - - BufferedReader reader = null; - try { - reader = new BufferedReader(new FileReader(dbFileName)); - } catch (FileNotFoundException e) { - if (missingOk) { - return; - } else { - throw(e); - } - } - System.out.println("\treading database: " + dbFileName); - String line; - int lineNo = 0; - do { - line = reader.readLine(); - lineNo++; - if (line != null) { - StreamTokenizer tokenizer = - new StreamTokenizer(new StringReader(line)); - tokenizer.slashSlashComments(true); - tokenizer.wordChars('_', '_'); - tokenizer.wordChars('<', '>'); - // NOTE: if we didn't have to do this line by line, - // we could trivially recognize C-style comments as - // well. - // tokenizer.slashStarComments(true); - int numTok = 0; - int res; - String unexpandedIncluder = null; - String unexpandedIncludee = null; - do { - res = tokenizer.nextToken(); - if (res != StreamTokenizer.TT_EOF) { - if (numTok == 0) { - unexpandedIncluder = tokenizer.sval; - } else if (numTok == 1) { - unexpandedIncludee = tokenizer.sval; - } else { - throw new FileFormatException( - "invalid line: \"" + line + - "\". Error position: line " + lineNo - ); - } - numTok++; - } - } while (res != StreamTokenizer.TT_EOF); - - if ((numTok != 0) && (numTok != 2)) { - throw new FileFormatException( - "invalid line: \"" + line + - "\". Error position: line " + lineNo - ); - } - - if (numTok == 2) { - // Non-empty line - String includer = macros.expand(unexpandedIncluder); - String includee = macros.expand(unexpandedIncludee); - - if (includee.equals(plat.generatePlatformDependentInclude())) { - MacroDefinitions localExpander = macros.copy(); - MacroDefinitions localExpander2 = macros.copy(); - localExpander.setAllMacroBodiesTo("pd"); - localExpander2.setAllMacroBodiesTo(""); - - // unexpanded_includer e.g. thread_.hpp - // thread_solaris_i486.hpp -> _thread_pd.hpp.incl - - FileName pdName = - plat.getInclFileTemplate().copyStem( - localExpander.expand(unexpandedIncluder) - ); - - // derive generic name from platform specific name - // e.g. os_.hpp => os.hpp. We enforce the - // restriction (imperfectly) noted in includeDB_core - // that platform specific files will have an underscore - // preceding the macro invocation. - - // First expand macro as null string. - - String newIncluder_temp = - localExpander2.expand(unexpandedIncluder); - - // Now find "_." and remove the underscore. - - String newIncluder = ""; - - int len = newIncluder_temp.length(); - int count = 0; - - for ( int i = 0; i < len - 1 ; i++ ) { - if (newIncluder_temp.charAt(i) == '_' && newIncluder_temp.charAt(i+1) == '.') { - count++; - } else { - newIncluder += newIncluder_temp.charAt(i); - } - } - newIncluder += newIncluder_temp.charAt(len-1); - - if (count != 1) { - throw new FileFormatException( - "Unexpected filename format for platform dependent file.\nline: \"" + line + - "\".\nError position: line " + lineNo - ); - } - - 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 - - p = platformFiles.listForFile(newIncluder); - - // if this list is empty then this is 1st - // occurance of a platform dependent file and - // we need a new version of the include file. - // Otherwise we just append to the current - // file. - - PrintWriter pdFile = - new PrintWriter( - new FileWriter(pdName.dirPreStemSuff(), - !p.isEmpty()) - ); - pdFile.println("# include \"" + includer + "\""); - pdFile.close(); - - // Add the platform specific file to the list - // for this generic file. - - FileList q = allFiles.listForFile(includer); - p.addIfAbsent(q); - } else { - FileList p = allFiles.listForFile(includer); - if (isOuterFile(includer)) - outerFiles.addIfAbsent(p); - - if (includee.equals(plat.noGrandInclude())) { - p.setUseGrandInclude(false); - } else { - FileList q = allFiles.listForFile(includee); - p.addIfAbsent(q); - } - } - } - } - } while (line != null); - reader.close(); - - // Keep allFiles in well-known order so we can easily determine - // whether the known files are the same - allFiles.sortByName(); - - // Add first and last files differently to prevent a mistake - // in ordering in the include databases from breaking the - // error reporting in the VM. - if (firstFile != null) { - FileList p = allFiles.listForFile(firstFile); - allFiles.setFirstFile(p); - outerFiles.setFirstFile(p); - } - - if (lastFile != null) { - FileList p = allFiles.listForFile(lastFile); - allFiles.setLastFile(p); - outerFiles.setLastFile(p); - } - } - - public void compute() { - System.out.println("\tcomputing closures\n"); - // build both indiv and grand results - for (Iterator iter = outerFiles.iterator(); iter.hasNext(); ) { - indivIncludes.add(((FileList) iter.next()).doCFile()); - ++nOuterFiles; - } - - if (!plat.haveGrandInclude()) - return; // nothing in grand include - - // count how many times each include is included & add em to grand - for (Iterator iter = indivIncludes.iterator(); iter.hasNext(); ) { - FileList indivInclude = (FileList) iter.next(); - if (!indivInclude.getUseGrandInclude()) { - continue; // do not bump count if my files cannot be - // in grand include - } - indivInclude.doFiles(grandInclude); // put em on - // grand_include list - for (Iterator incListIter = indivInclude.iterator(); - incListIter.hasNext(); ) { - ((FileList) incListIter.next()).incrementCount(); - } - } - } - - // Not sure this is necessary in Java - public void verify() { - for (Iterator iter = indivIncludes.iterator(); iter.hasNext(); ) { - if (iter.next() == null) { - plat.abort(); - } - } - } - - public void put() throws IOException { - writeIndividualIncludes(); - - if (plat.haveGrandInclude()) - writeGrandInclude(); - - writeGrandUnixMakefile(); - } - - private void writeIndividualIncludes() throws IOException { - System.out.println("\twriting individual include files\n"); - - for (Iterator iter = indivIncludes.iterator(); iter.hasNext(); ) { - FileList list = (FileList) iter.next(); - System.out.println("\tcreating " + list.getName()); - list.putInclFile(this); - } - } - - private void writeGrandInclude() throws IOException { - System.out.println("\twriting grand include file\n"); - PrintWriter inclFile = - new PrintWriter(new FileWriter(plat.getGIFileTemplate().dirPreStemSuff())); - plat.writeGIPragma(inclFile); - for (Iterator iter = grandInclude.iterator(); iter.hasNext(); ) { - FileList list = (FileList) iter.next(); - if (list.getCount() >= threshold) { - inclFile.println("# include \"" + - plat.getGIFileTemplate().getInvDir() + - list.getName() + - "\""); - } - } - inclFile.println(); - inclFile.close(); - } - - private void writeGrandUnixMakefile() throws IOException { - if (!plat.writeDeps()) - return; - - System.out.println("\twriting dependencies file\n"); - PrintWriter gd = - new PrintWriter(new FileWriter( - plat.getGDFileTemplate().dirPreStemSuff()) - ); - gd.println("# generated by makeDeps"); - gd.println(); - - - // HACK ALERT. The compilation of ad_ files is very slow. - // We want to start compiling them as early as possible. The compilation - // order on unix is dependent on the order we emit files here. - // By sorting the output before emitting it, we expect - // that ad_ will be compiled early. - boolean shouldSortObjFiles = true; - - if (shouldSortObjFiles) { - ArrayList sortList = new ArrayList(); - - // We need to preserve the ordering of the first and last items - // in outerFiles. - int size = outerFiles.size() - 1; - String firstName = removeSuffixFrom(((FileList)outerFiles.get(0)).getName()); - String lastName = removeSuffixFrom(((FileList)outerFiles.get(size)).getName()); - - for (int i=1; i= threshold) { - 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(); - - gd.println("DTraced_Files = \\"); - for (Iterator iter = outerFiles.iterator(); iter.hasNext(); ) { - FileList anOuterFile = (FileList) iter.next(); - - if (anOuterFile.hasListForFile("dtrace.hpp")) { - String stemName = removeSuffixFrom(anOuterFile.getName()); - gd.println(stemName + plat.objFileSuffix() + " \\"); - } - } - gd.println(); - gd.println(); - - { - // write each dependency - - for (Iterator iter = indivIncludes.iterator(); iter.hasNext(); ) { - - FileList anII = (FileList) iter.next(); - - String stemName = removeSuffixFrom(anII.getName()); - String inclFileName = - plat.getInclFileTemplate().copyStem(anII.getName()). - preStemSuff(); - - gd.println(stemName + plat.objFileSuffix() + " " + - stemName + plat.asmFileSuffix() + ": \\"); - - printDependentOn(gd, anII.getName()); - // this gets the include file that includes all that - // this file needs (first level) since nested includes - // are skipped to avoid cycles. - printDependentOn(gd, inclFileName); - - if ( plat.haveGrandInclude() ) { - printDependentOn(gd, - plat.getGIFileTemplate().preStemSuff()); - } - - for (Iterator iiIter = anII.iterator(); iiIter.hasNext(); ) { - FileList hfile = (FileList) iiIter.next(); - if (!hfileIsInGrandInclude(hfile, anII) || - plat.writeDependenciesOnHFilesFromGI()) { - printDependentOn(gd, hfile.getName()); - } - if (platformFiles.hasListForFile(hfile.getName())) { - FileList p = - platformFiles.listForFile(hfile.getName());; - for (Iterator hiIter = p.iterator(); - hiIter.hasNext(); ) { - FileList hi2 = (FileList) hiIter.next(); - if (!hfileIsInGrandInclude(hi2, p)) { - printDependentOn(gd, hi2.getName()); - } - } - } - } - - if (plat.includeGIDependencies() - && anII.getUseGrandInclude()) { - gd.println(" $(Precompiled_Files) \\"); - } - gd.println(); - gd.println(); - } - } - - gd.close(); - } - - public void putDiffs(Database previous) throws IOException { - System.out.println("\tupdating output files\n"); - - if (!indivIncludes.compareLists(previous.indivIncludes) - || !grandInclude.compareLists(previous.grandInclude)) { - System.out.println("The order of .c or .s has changed, or " + - "the grand include file has changed."); - put(); - return; - } - - Iterator curIter = indivIncludes.iterator(); - Iterator prevIter = previous.indivIncludes.iterator(); - - try { - while (curIter.hasNext()) { - FileList newCFileList = (FileList) curIter.next(); - FileList prevCFileList = (FileList) prevIter.next(); - if (!newCFileList.compareLists(prevCFileList)) { - System.out.println("\tupdating " + newCFileList.getName()); - newCFileList.putInclFile(this); - } - } - } - catch (Exception e) { - throw new InternalError("assertion failure: cur and prev " + - "database lists changed unexpectedly."); - } - - writeGrandUnixMakefile(); - } - - private void printDependentOn(PrintWriter gd, String name) { - gd.print(" "); - gd.print(plat.dependentPrefix() + name); - } - - private boolean isOuterFile(String s) { - int len = s.length(); - String[] suffixes = plat.outerSuffixes(); - for (int i = 0; i < suffixes.length; i++) { - String suffix = suffixes[i]; - int suffLen = suffix.length(); - if ((len >= suffLen) && - (plat.fileNameStringEquality(s.substring(len - suffLen), - suffix))) { - return true; - } - } - return false; - } - - private String removeSuffixFrom(String s) { - int idx = s.lastIndexOf('.'); - if (idx <= 0) - plat.abort(); - return s.substring(0, idx); - } -} diff --git a/hotspot/src/share/tools/MakeDeps/FileList.java b/hotspot/src/share/tools/MakeDeps/FileList.java deleted file mode 100644 index 633d9bf1804..00000000000 --- a/hotspot/src/share/tools/MakeDeps/FileList.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -import java.io.*; -import java.util.*; - -/** This class implements the java.util.List interface as well as - providing functionality specific to keeping track of lists of - files. See the documentation for the Database class to see how - these are used. Each FileList must only contain other FileLists - (although that is not currently enforced in the mutators). */ - -public class FileList extends Vector { - private String name; // (also the file name) - private boolean beenHere; - private boolean mayBeCycle; - private boolean isCycle; - /** Put in list because a file can refuse to */ - private boolean useGrandInclude; - private String platformDependentInclude; - private int count; - private Platform plat; - - public FileList(String n, Platform plat) { - super(); - this.plat = plat; - beenHere = mayBeCycle = isCycle = false; - platformDependentInclude = null; - name = n; - count = 0; - useGrandInclude = plat.haveGrandInclude(); - } - - // Change definition of equality from AbstractList so remove() works properly - public boolean equals(Object o) { - return ((Object) this) == o; - } - - // Necessary accessors - public String getName() { - return name; - } - - public void setPlatformDependentInclude(String arg) { - platformDependentInclude = arg; - } - - public String getPlatformDependentInclude() { - return platformDependentInclude; - } - - public boolean getUseGrandInclude() { - return useGrandInclude; - } - - public void setUseGrandInclude(boolean arg) { - useGrandInclude = arg; - } - - public void incrementCount() { - count++; - } - - public int getCount() { - return count; - } - - public FileList listForFile(String fileName) { - for (Iterator iter = iterator(); iter.hasNext(); ) { - FileList fl = (FileList) iter.next(); - if (plat.fileNameStringEquality(fl.name, fileName)) { - plat.fileNamePortabilityCheck(fl.name, fileName); - return fl; - } - } - plat.fileNamePortabilityCheck(fileName); - FileList newList = new FileList(fileName, plat); - add(newList); - return newList; - } - - public boolean hasListForFile(String fileName) { - for (Iterator iter = iterator(); iter.hasNext(); ) { - FileList fl = (FileList) iter.next(); - if (plat.fileNameStringEquality(fl.name, fileName)) { - plat.fileNamePortabilityCheck(fl.name, fileName); - return true; - } - } - return false; - } - - public boolean compareLists(FileList s) { - Iterator myIter = iterator(); - Iterator hisIter = s.iterator(); - - while (myIter.hasNext() && - hisIter.hasNext()) { - // crude: order dependent - FileList myElement = (FileList) myIter.next(); - FileList hisElement = (FileList) hisIter.next(); - if (!plat.fileNameStringEquality(myElement.name, - hisElement.name)) { - return false; - } - } - - if (myIter.hasNext() != hisIter.hasNext()) { - // One ended earlier - return false; - } - - return true; - } - - public void addIfAbsent(FileList s) { - for (Iterator iter = iterator(); iter.hasNext(); ) { - if (iter.next() == s) { - return; - } - } - add(s); - } - - public void sortByName() { - Collections.sort(this, new Comparator() { - public int compare(Object o1, Object o2) { - FileList fl1 = (FileList) o1; - FileList fl2 = (FileList) o2; - return fl1.getName().compareTo(fl2.getName()); - } - }); - } - - public void setFirstFile(FileList s) { - // Remove the file list if it's already here - remove(s); - add(0, s); - } - - public void setLastFile(FileList s) { - // Remove the file list if it's already here - remove(s); - add(s); - } - - public boolean doFiles(FileList s) { - boolean result = true; - for (Iterator iter = iterator(); iter.hasNext(); ) { - FileList h = (FileList) iter.next(); - if (h.platformDependentInclude != null) { - System.err.println("Error: the source for " + - h.platformDependentInclude + - " is " + h.name + "."); - System.err.println("\tIt shouldn't be included directly by " + - name + "."); - h.platformDependentInclude = null; // report once per file - result = false; - } - h.doHFile(s); - } - return result; - } - - public void traceCycle(FileList s) { - if (isCycle) // already traced - return; - isCycle = true; - System.err.println("\ttracing cycle for " + name); - // FIXME: must return status in caller routine - // exitCode = 1; - for (Iterator iter = iterator(); iter.hasNext(); ) { - FileList q = (FileList) iter.next(); - if (q.mayBeCycle) { - if (s == q) { - plat.fatalError("\tend of cycle for " + s.getName()); - } else { - q.traceCycle(s); - } - } - } - } - - public void doHFile(FileList s) { - if (beenHere) { - if (mayBeCycle) { - traceCycle(this); - } - return; - } - beenHere = true; - mayBeCycle = true; - doFiles(s); - mayBeCycle = false; - s.add(this); - } - - public FileList doCFile() { - FileList s = new FileList(name, plat); - s.useGrandInclude = useGrandInclude; // propagate this - doFiles(s); - for (Iterator iter = s.iterator(); iter.hasNext(); ) { - FileList l = (FileList) iter.next(); - l.beenHere = false; - } - return s; - } - - /** if .h file is included thresh times, put it in the grand - include file */ - public void putInclFile(Database db) - throws IOException { - boolean needline = true; - FileName inclName = plat.getInclFileTemplate().copyStem(name); - PrintWriter inclFile = - new PrintWriter(new FileWriter(inclName.dirPreStemSuff())); - if (plat.haveGrandInclude() && plat.includeGIInEachIncl()) { - inclFile.println("# include \"" + - plat.getGIFileTemplate().dirPreStemAltSuff() + - "\""); - needline = false; - } - for (Iterator iter = iterator(); iter.hasNext(); ) { - FileList hfile = (FileList) iter.next(); - if (!db.hfileIsInGrandInclude(hfile, this)) { - inclFile.println("# include \"" + - plat.getInclFileTemplate().getInvDir() + - hfile.name + - "\""); - needline = false; - } - } - - // Solaris C++ in strict mode warns about empty files - - if(needline) { - inclFile.println(); - } - - inclFile.close(); - } -} diff --git a/hotspot/src/share/tools/MakeDeps/FileName.java b/hotspot/src/share/tools/MakeDeps/FileName.java deleted file mode 100644 index eebda0e058e..00000000000 --- a/hotspot/src/share/tools/MakeDeps/FileName.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -public class FileName { - private String dir; - private String prefix; - private String stem; - private String suffix; - private String inverseDir; - private String altSuffix; - - private String dpss; - private String psa; - private String dpsa; - private String pss; - - private Platform plat; - - /** None of the passed strings may be null. */ - - public FileName(Platform plat, String dir, String prefix, - String stem, String suffix, - String inverseDir, String altSuffix) { - if ((dir == null) || - (prefix == null) || - (stem == null) || - (suffix == null) || - (inverseDir == null) || - (altSuffix == null)) { - throw new NullPointerException("All arguments must be non-null"); - } - - this.plat = plat; - - this.dir = dir; - this.prefix = prefix; - this.stem = stem; - this.suffix = suffix; - this.inverseDir = inverseDir; - this.altSuffix = altSuffix; - - pss = prefix + stem + suffix; - dpss = dir + prefix + stem + suffix; - psa = prefix + stem + altSuffix; - dpsa = dir + prefix + stem + altSuffix; - - checkLength(plat); - } - - public void checkLength(Platform p) { - int len; - String s; - int suffLen = suffix.length(); - int altSuffLen = altSuffix.length(); - if (suffLen >= altSuffLen) { - len = suffLen; - s = suffix; - } else { - len = altSuffLen; - s = altSuffix; - } - len += prefix.length() + stem.length(); - int lim = p.fileNameLengthLimit(); - if (len > lim) { - p.fatalError(prefix + stem + s + " is too long: " + - len + " >= " + lim); - } - } - - public String dirPreStemSuff() { - return dpss; - } - - public String preStemSuff() { - return pss; - } - - public String dirPreStemAltSuff() { - return dpsa; - } - - public String preStemAltSuff() { - return psa; - } - - public FileName copyStem(String newStem) { - return new FileName(plat, dir, prefix, newStem, - suffix, inverseDir, altSuffix); - } - - String nameOfList() { - return stem; - } - - String getInvDir() { - return inverseDir; - } -} diff --git a/hotspot/src/share/tools/MakeDeps/MakeDeps.java b/hotspot/src/share/tools/MakeDeps/MakeDeps.java deleted file mode 100644 index c18edcf1469..00000000000 --- a/hotspot/src/share/tools/MakeDeps/MakeDeps.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -// This program reads an include file database. -// The database should cover each self .c and .h file, -// but not files in /usr/include -// The database consists of pairs of nonblank words, where the first word is -// the filename that needs to include the file named by the second word. -// For each .c file, this program generates a fooIncludes.h file that -// the .c file may include to include all the needed files in the right order. -// It also generates a foo.dep file to include in the makefile. -// Finally it detects cycles, and can work with two files, an old and a new one. -// To incrementally write out only needed files after a small change. -// -// Based on a suggestion by Roland Conybeare, algorithm suggested by Craig -// Chambers, written by David Ungar, 3/1/89. -// Added PREFIX, {DEP/INC}_DIR, smaller dep output 10/92 -Urs - -// Add something for precompiled headers - -// To handle different platforms, I am introducing a platform file. -// The platform file contains lines like: -// os = svr4 -// -// Then, when processing the includeDB file, a token such as -// gets replaced by svr4. -- dmu 3/25/97 - -// Modified to centralize Dependencies to speed up make -- dmu 5/97 - -public class MakeDeps { - - public static void usage() { - System.out.println("usage:"); - System.out.println("\tmakeDeps platform-name platform-file database-file [MakeDeps args] [platform args]"); - System.out.println("\tmakeDeps diffs platform-name old-platform-file old-database-file new-platform-file new-database-file [MakeDeps args] [platform args]"); - System.out.println("where platform-name is the name of a platform MakeDeps supports"); - System.out.println("(currently \"WinGammaPlatform\" or \"UnixPlatform\")"); - System.out.println("MakeDeps options:"); - System.out.println(" -firstFile [filename]: Specify the first file in link order (i.e.,"); - System.out.println(" to have a well-known function at the start of the output file)"); - System.out.println(" -lastFile [filename]: Specify the last file in link order (i.e.,"); - System.out.println(" to have a well-known function at the end of the output file)"); - System.err.println("WinGammaPlatform platform-specific options:"); - System.err.println(" -sourceBase "); - System.err.println(" -dspFileName "); - System.err.println(" -envVar "); - System.err.println(" -dllLoc "); - System.err.println(" If any of the above are specified, "+ - "they must all be."); - System.err.println(" Additional, optional arguments, which can be " + - "specified multiple times:"); - System.err.println(" -absoluteInclude "); - System.err.println(" -relativeInclude "); - System.err.println(" -define "); - System.err.println(" -perFileLine "); - System.err.println(" -conditionalPerFileLine "); - System.err.println(" (NOTE: To work around a bug in nmake, where " + - "you can't have a '#' character in a quoted " + - "string, all of the lines outputted have \"#\"" + - "prepended)"); - System.err.println(" -startAt "); - System.err.println(" -ignoreFile "); - System.err.println(" -additionalFile "); - System.err.println(" -additionalGeneratedFile " + - ""); - System.err.println(" -prelink :"); - System.err.println(" Generate a set of prelink commands for the given BUILD"); - System.err.println(" (\"Debug\" or \"Release\"). The prelink description and commands"); - System.err.println(" are both quoted strings."); - System.err.println(" Default includes: \".\""); - System.err.println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\""); - } - - public static void main(String[] args) { - try { - if (args.length < 3) { - usage(); - System.exit(1); - } - - int argc = 0; - boolean diffMode = false; - if (args[argc].equals("diffs")) { - diffMode = true; - ++argc; - } - - String platformName = args[argc++]; - Class platformClass = Class.forName(platformName); - - String plat1 = null; - String db1 = null; - String plat2 = null; - String db2 = null; - - String firstFile = null; - String lastFile = null; - - int numOptionalArgs = - (diffMode ? (args.length - 6) : (args.length - 3)); - if (numOptionalArgs < 0) { - usage(); - System.exit(1); - } - - plat1 = args[argc++]; - db1 = args[argc++]; - - if (diffMode) { - plat2 = args[argc++]; - db2 = args[argc++]; - } - - // argc now points at start of optional arguments, if any - - try { - boolean gotOne = true; - while (gotOne && (argc < args.length - 1)) { - gotOne = false; - String arg = args[argc]; - if (arg.equals("-firstFile")) { - firstFile = args[argc + 1]; - argc += 2; - gotOne = true; - } else if (arg.equals("-lastFile")) { - lastFile = args[argc + 1]; - argc += 2; - gotOne = true; - } - } - } - catch (Exception e) { - e.printStackTrace(); - usage(); - System.exit(1); - } - - Platform platform = (Platform) platformClass.newInstance(); - platform.setupFileTemplates(); - long t = platform.defaultGrandIncludeThreshold(); - - String[] platformArgs = null; - int numPlatformArgs = args.length - argc; - if (numPlatformArgs > 0) { - platformArgs = new String[numPlatformArgs]; - int offset = argc; - while (argc < args.length) { - platformArgs[argc - offset] = args[argc]; - ++argc; - } - } - - // If you want to change the threshold, change the default - // "grand include" threshold in Platform.java, or override - // it in the platform-specific file like UnixPlatform.java - - Database previous = new Database(platform, t); - Database current = new Database(platform, t); - - previous.canBeMissing(); - - if (firstFile != null) { - previous.setFirstFile(firstFile); - current.setFirstFile(firstFile); - } - if (lastFile != null) { - previous.setLastFile(lastFile); - current.setLastFile(lastFile); - } - - if (diffMode) { - System.out.println("Old database:"); - previous.get(plat1, db1); - previous.compute(); - System.out.println("New database:"); - current.get(plat2, db2); - current.compute(); - System.out.println("Deltas:"); - current.putDiffs(previous); - } else { - System.out.println("New database:"); - current.get(plat1, db1); - current.compute(); - current.put(); - } - - if (platformArgs != null) { - // Allow the platform to write platform-specific files - platform.writePlatformSpecificFiles(previous, current, - platformArgs); - } - } - catch (Exception e) { - e.printStackTrace(); - System.exit(1); - } - } -} diff --git a/hotspot/src/share/tools/MakeDeps/MetroWerksMacPlatform.java b/hotspot/src/share/tools/MakeDeps/MetroWerksMacPlatform.java deleted file mode 100644 index 72e1dd0de71..00000000000 --- a/hotspot/src/share/tools/MakeDeps/MetroWerksMacPlatform.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -import java.io.*; - -public class MetroWerksMacPlatform extends Platform { - public void setupFileTemplates() { - inclFileTemplate = new FileName(this, - ":incls:", "_", "", ".incl", "", "" - ); - giFileTemplate = new FileName(this, - "", "", "precompiledHeader", ".pch", "", "" - ); - gdFileTemplate = dummyFileTemplate; - } - - private static String[] suffixes = { ".cpp", ".c", ".s" }; - - public String[] outerSuffixes() { - return suffixes; - } - - public boolean includeGIInEachIncl() { - return true; - } - - public int defaultGrandIncludeThreshold() { - return 150; - } - - public void writeGIPragma(PrintWriter out) { - out.println("#pragma precompile_target \"" + - giFileTemplate.preStemAltSuff() + - "\""); - out.println(); - } - - public String objFileSuffix() { - throw new RuntimeException("Unimplemented in original makeDeps"); - } - - public String asmFileSuffix() { - throw new RuntimeException("Unimplemented in original makeDeps"); - } - - public String dependentPrefix() { - throw new RuntimeException("Unimplemented in original makeDeps"); - } -} diff --git a/hotspot/src/share/tools/MakeDeps/Platform.java b/hotspot/src/share/tools/MakeDeps/Platform.java deleted file mode 100644 index dce85a7667e..00000000000 --- a/hotspot/src/share/tools/MakeDeps/Platform.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -/** Defines what must be specified for each platform. This class must - have a no-arg constructor. */ - -import java.io.*; - -public abstract class Platform { - /** file name templates capture naming conventions */ - protected FileName dummyFileTemplate = - new FileName(this, "", "", "", "", "", ""); - - // The next three must be instantiated in subclasses' constructors - - /** An incl file is produced per .c file and contains all the - includes it needs */ - protected FileName inclFileTemplate; - - /** A GI (grand-include) file has any file used more than N times - for precompiled headers */ - protected FileName giFileTemplate; - - /** A GD (grand-dependencies) file that tells Unix make all the - .o's needed for linking and the include dependencies */ - protected FileName gdFileTemplate; - - // Accessors - public FileName getInclFileTemplate() { - return inclFileTemplate; - } - - public FileName getGIFileTemplate() { - return giFileTemplate; - } - - public FileName getGDFileTemplate() { - return gdFileTemplate; - } - - // an incl file is the file included by each.c file that includes - // all needed header files - - public abstract void setupFileTemplates(); - public abstract String[] outerSuffixes(); - - /** empty file name -> no grand include file */ - public boolean haveGrandInclude() { - return (giFileTemplate.nameOfList().length() > 0); - } - - public boolean writeDeps() { - return (gdFileTemplate.nameOfList().length() > 0); - } - - /**

    A gi file is the grand-include file. It includes in one - file any file that is included more than a certain number of - times.

    - -

    It is used for precompiled header files.

    - -

    It has a source name, that is the file that this program - generates, and a compiled name; that is the file that is - included by other files.

    - -

    Some platforms have this program actually explictly - include the preprocessed gi file-- see includeGIInEachIncl(). -

    - -

    Also, some platforms need a pragma in the GI file.

    */ - public boolean includeGIInEachIncl() { - return false; - } - - /** For some platforms, e.g. Solaris, include the grand-include - dependencies in the makefile. For others, e.g. Windows, do - not. */ - public boolean includeGIDependencies() { - return false; - } - - /** Should C/C++ source file be dependent on a file included - into the grand-include file. */ - public boolean writeDependenciesOnHFilesFromGI() { - return false; - } - - /** Default implementation does nothing */ - public void writeGIPragma(PrintWriter out) { - } - - /** A line with a filename and the noGrandInclude string means - that this file cannot use the precompiled header. */ - public String noGrandInclude() { - return "no_precompiled_headers"; - } - - /** A line with a filename and the - generatePlatformDependentInclude means that an include file - for the header file must be generated. This file generated include - file is directly included by the non-platform dependent include file - (e.g os.hpp includes _os_pd.hpp.incl. So while we notice files that - are directly dependent on non-platform dependent files from the database - we must infer the dependence on platform specific files to generate correct - dependences on the platform specific files. */ - public String generatePlatformDependentInclude() { - return "generate_platform_dependent_include"; - } - - /** Prefix and suffix strings for emitting Makefile rules */ - public abstract String objFileSuffix(); - public abstract String asmFileSuffix(); - public abstract String dependentPrefix(); - - // Exit routines: - - /** Abort means an internal error */ - public void abort() { - throw new RuntimeException("Internal error"); - } - - /** fatalError is used by clients to stop the system */ - public void fatalError(String msg) { - System.err.println(msg); - System.exit(1); - } - - /** Default implementation performs case-sensitive comparison */ - public boolean fileNameStringEquality(String s1, String s2) { - return s1.equals(s2); - } - - public void fileNamePortabilityCheck(String name) { - if (Character.isUpperCase(name.charAt(0))) { - fatalError("Error: for the sake of portability we have chosen\n" + - "to avoid files starting with an uppercase letter.\n" + - "Please rename " + name + "."); - } - } - - public void fileNamePortabilityCheck(String name, String matchingName) { - if (!name.equals(matchingName)) { - fatalError("Error: file " + name + " also appears as " + - matchingName + ". Case must be consistent for " + - "portability."); - } - } - - /** max is 31 on mac, so warn */ - public int fileNameLengthLimit() { - return 45; - } - - public int defaultGrandIncludeThreshold() { - return 30; - } - - /** Not very general, but this is a way to get platform-specific - files to be written. Default implementation does nothing. */ - public void writePlatformSpecificFiles(Database previousDB, - Database currentDB, String[] args) - throws IllegalArgumentException, IOException { - } -} diff --git a/hotspot/src/share/tools/MakeDeps/UnixPlatform.java b/hotspot/src/share/tools/MakeDeps/UnixPlatform.java deleted file mode 100644 index 3b449cc0b4f..00000000000 --- a/hotspot/src/share/tools/MakeDeps/UnixPlatform.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -public class UnixPlatform extends Platform { - public void setupFileTemplates() { - inclFileTemplate = new FileName(this, - "incls/", "_", "", ".incl", "", "" - ); - giFileTemplate = new FileName(this, - "incls/", "", "_precompiled", ".incl", "", "" - ); - gdFileTemplate = new FileName(this, - "", "", "Dependencies", "", "", "" - ); - } - - private static String[] suffixes = { ".cpp", ".c", ".s" }; - - public String[] outerSuffixes() { - return suffixes; - } - - public String objFileSuffix() { - return ".o"; - } - - public String asmFileSuffix() { - return ".i"; - } - - public String dependentPrefix() { - return ""; - } - - /** Do not change this; unless you fix things so precompiled - header files get translated into make dependencies. - Ungar */ - public int defaultGrandIncludeThreshold() { - if (System.getProperty("USE_PRECOMPILED_HEADER") != null) - return 30; - else - return 1 << 30; - } - - /** For Unix make, include the dependencies for precompiled header - files. */ - public boolean includeGIDependencies() { - return false; - } - - /** Should C/C++ source file be dependent on a file included - into the grand-include file. - On Unix with precompiled headers we don't want each file to be - dependent on grand-include file. Instead each C/C++ source file - is depended on each own set of files, and recompiled only when - files from this set are changed. */ - public boolean writeDependenciesOnHFilesFromGI() { - return System.getProperty("USE_PRECOMPILED_HEADER") != null; - } -} diff --git a/hotspot/src/share/tools/MakeDeps/ArgsParser.java b/hotspot/src/share/tools/ProjectCreator/ArgsParser.java similarity index 96% rename from hotspot/src/share/tools/MakeDeps/ArgsParser.java rename to hotspot/src/share/tools/ProjectCreator/ArgsParser.java index 167a6cacc37..ca5d0a337f1 100644 --- a/hotspot/src/share/tools/MakeDeps/ArgsParser.java +++ b/hotspot/src/share/tools/ProjectCreator/ArgsParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/tools/MakeDeps/BuildConfig.java b/hotspot/src/share/tools/ProjectCreator/BuildConfig.java similarity index 80% rename from hotspot/src/share/tools/MakeDeps/BuildConfig.java rename to hotspot/src/share/tools/ProjectCreator/BuildConfig.java index b68d4103082..6e97b28f1e6 100644 --- a/hotspot/src/share/tools/MakeDeps/BuildConfig.java +++ b/hotspot/src/share/tools/ProjectCreator/BuildConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -import java.util.*; import java.io.File; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Vector; class BuildConfig { Hashtable vars; @@ -48,13 +51,15 @@ class BuildConfig { if (vars == null) vars = new Hashtable(); String flavourBuild = flavour + "_" + build; + System.out.println(); + System.out.println(flavourBuild); + put("Name", getCI().makeCfgName(flavourBuild)); put("Flavour", flavour); put("Build", build); // ones mentioned above were needed to expand format String buildBase = expandFormat(getFieldString(null, "BuildBase")); - String jdkDir = getFieldString(null, "JdkTargetRoot"); String sourceBase = getFieldString(null, "SourceBase"); String outDir = buildBase; @@ -62,7 +67,7 @@ class BuildConfig { put("OutputDir", outDir); put("SourceBase", sourceBase); put("BuildBase", buildBase); - put("OutputDll", jdkDir + Util.sep + outDll); + put("OutputDll", outDir + Util.sep + outDll); context = new String [] {flavourBuild, flavour, build, null}; } @@ -71,7 +76,7 @@ class BuildConfig { initDefaultDefines(defines); initDefaultCompilerFlags(includes); initDefaultLinkerFlags(); - handleDB((String)getFieldInContext("IncludeDB")); + handleDB(); } @@ -110,12 +115,12 @@ class BuildConfig { } - Vector getPreferredPaths(Database currentDB) { + Vector getPreferredPaths(MacroDefinitions macros) { Vector preferredPaths = new Vector(); // In the case of multiple files with the same name in // different subdirectories, prefer the versions specified in // the platform file as the "os_family" and "arch" macros. - for (Iterator iter = currentDB.getMacros(); iter.hasNext(); ) { + for (Iterator iter = macros.getMacros(); iter.hasNext(); ) { Macro macro = (Macro) iter.next(); if (macro.name.equals("os_family") || macro.name.equals("arch")) { @@ -129,39 +134,36 @@ class BuildConfig { } - void handleDB(String dbFile) { + void handleDB() { WinGammaPlatform platform = (WinGammaPlatform)getField(null, "PlatformObject"); - Database db = new Database(platform, platform.defaultGrandIncludeThreshold()); + File incls = new File(get("OutputDir")+Util.sep+"incls"); + + incls.mkdirs(); + + MacroDefinitions macros = new MacroDefinitions(); try { - File incls = new File(get("OutputDir")+Util.sep+"incls"); - FileName oldInclTempl = platform.getInclFileTemplate(); - FileName oldGITempl = platform.getGIFileTemplate(); - FileName oldGDTempl = platform.getGDFileTemplate(); - - platform.setInclFileTemplate(new FileName(platform, incls.getPath()+Util.sep, - "_", "", ".incl", "", "")); - platform.setGIFileTemplate(new FileName(platform, incls.getPath()+Util.sep, - "", "_precompiled", ".incl", "", "")); - - incls.mkdirs(); - - db.get(getFieldString(null, "Platform"), dbFile); - db.compute(); - - db.put(); - - //platform.setInclFileTemplate(oldInclTempl); - //platform.setGIFileTemplate(oldInclTempl); + macros.readFrom(getFieldString(null, "Platform"), false); } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("cannot do db: "+e); + throw new RuntimeException(e); } - putSpecificField("AllFilesHash", computeAllFiles(platform, db)); + putSpecificField("AllFilesHash", computeAllFiles(platform, macros)); } + private boolean matchesIgnoredPath(String prefixedName) { + Vector rv = new Vector(); + collectRelevantVectors(rv, "IgnorePath"); + for (Iterator i = rv.iterator(); i.hasNext(); ) { + String pathPart = (String) i.next(); + if (prefixedName.contains(Util.normalize(pathPart))) { + return true; + } + } + return false; + } + void addAll(Iterator i, Hashtable hash, WinGammaPlatform platform, DirectoryTree tree, Vector preferredPaths, Vector filesNotFound, Vector filesDuplicate) { @@ -175,7 +177,10 @@ class BuildConfig { filesNotFound, filesDuplicate); if (prefixedName != null) { - addTo(hash, Util.normalize(prefixedName), fileName); + prefixedName = Util.normalize(prefixedName); + if (!matchesIgnoredPath(prefixedName)) { + addTo(hash, prefixedName, fileName); + } } } } @@ -185,23 +190,28 @@ class BuildConfig { ht.put(expandFormat(key), expandFormat(value)); } - Hashtable computeAllFiles(WinGammaPlatform platform, Database db) { + Hashtable computeAllFiles(WinGammaPlatform platform, MacroDefinitions macros) { Hashtable rv = new Hashtable(); DirectoryTree tree = getSourceTree(get("SourceBase"), getFieldString(null, "StartAt")); - Vector preferredPaths = getPreferredPaths(db); + Vector preferredPaths = getPreferredPaths(macros); // Hold errors until end Vector filesNotFound = new Vector(); Vector filesDuplicate = new Vector(); + Vector includedFiles = new Vector(); // find all files - Vector dbFiles = new Vector(); - for (Iterator i=db.getAllFiles().iterator(); i.hasNext(); ) { - FileList fl = (FileList) i.next(); - dbFiles.add(fl.getName()); + Vector dirs = getSourceIncludes(); + for (Iterator i = dirs.iterator(); i.hasNext(); ) { + String dir = (String)i.next(); + DirectoryTree subtree = getSourceTree(dir, null); + for (Iterator fi = subtree.getFileIterator(); fi.hasNext(); ) { + String name = ((File)fi.next()).getName(); + includedFiles.add(name); + } } - addAll(dbFiles.iterator(), rv, + addAll(includedFiles.iterator(), rv, platform, tree, preferredPaths, filesNotFound, filesDuplicate); @@ -356,11 +366,15 @@ class BuildConfig { Vector getIncludes() { Vector rv = new Vector(); - // for generated includes - rv.add(get("OutputDir")); - collectRelevantVectors(rv, "AbsoluteInclude"); + rv.addAll(getSourceIncludes()); + + return rv; + } + + private Vector getSourceIncludes() { + Vector rv = new Vector(); Vector ri = new Vector(); String sourceBase = getFieldString(null, "SourceBase"); collectRelevantVectors(ri, "RelativeInclude"); @@ -368,7 +382,6 @@ class BuildConfig { String f = (String)i.next(); rv.add(sourceBase + Util.sep + f); } - return rv; } @@ -381,12 +394,10 @@ class BuildConfig { cfg.startsWith("compiler2"))); } - // Filters out the IncludeDB statement, which is the only command- - // line argument we explicitly specialize for the tiered build + // Filters out the IgnoreFile and IgnorePaths since they are + // handled specially for tiered builds. static boolean appliesToTieredBuild(String cfg, String key) { - return (appliesToTieredBuild(cfg) && - (key != null && - !key.equals("IncludeDB"))); + return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore")); } static String getTieredBuildCfg(String cfg) { @@ -441,7 +452,7 @@ class BuildConfig { static void putFieldHash(String cfg, String field, String name, Object val) { putFieldHashImpl(cfg, field, name, val); - if (appliesToTieredBuild(cfg)) { + if (appliesToTieredBuild(cfg, field)) { putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val); } } @@ -459,7 +470,7 @@ class BuildConfig { static void addFieldVector(String cfg, String field, String element) { addFieldVectorImpl(cfg, field, element); - if (appliesToTieredBuild(cfg)) { + if (appliesToTieredBuild(cfg, field)) { addFieldVectorImpl(getTieredBuildCfg(cfg), field, element); } } @@ -528,68 +539,75 @@ abstract class GenericDebugConfig extends BuildConfig { } } -class C1DebugConfig extends GenericDebugConfig { +abstract class GenericDebugNonKernelConfig extends GenericDebugConfig { + protected void init(Vector includes, Vector defines) { + super.init(includes, defines); + getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags")); + } +} + +class C1DebugConfig extends GenericDebugNonKernelConfig { String getOptFlag() { return getCI().getNoOptFlag(); } C1DebugConfig() { - initNames("compiler1", "debug", "fastdebug\\jre\\bin\\client\\jvm.dll"); + initNames("compiler1", "debug", "jvm.dll"); init(getIncludes(), getDefines()); } } -class C1FastDebugConfig extends GenericDebugConfig { +class C1FastDebugConfig extends GenericDebugNonKernelConfig { String getOptFlag() { return getCI().getOptFlag(); } C1FastDebugConfig() { - initNames("compiler1", "fastdebug", "fastdebug\\jre\\bin\\client\\jvm.dll"); + initNames("compiler1", "fastdebug", "jvm.dll"); init(getIncludes(), getDefines()); } } -class C2DebugConfig extends GenericDebugConfig { +class C2DebugConfig extends GenericDebugNonKernelConfig { String getOptFlag() { return getCI().getNoOptFlag(); } C2DebugConfig() { - initNames("compiler2", "debug", "fastdebug\\jre\\bin\\server\\jvm.dll"); + initNames("compiler2", "debug", "jvm.dll"); init(getIncludes(), getDefines()); } } -class C2FastDebugConfig extends GenericDebugConfig { +class C2FastDebugConfig extends GenericDebugNonKernelConfig { String getOptFlag() { return getCI().getOptFlag(); } C2FastDebugConfig() { - initNames("compiler2", "fastdebug", "fastdebug\\jre\\bin\\server\\jvm.dll"); + initNames("compiler2", "fastdebug", "jvm.dll"); init(getIncludes(), getDefines()); } } -class TieredDebugConfig extends GenericDebugConfig { +class TieredDebugConfig extends GenericDebugNonKernelConfig { String getOptFlag() { return getCI().getNoOptFlag(); } TieredDebugConfig() { - initNames("tiered", "debug", "fastdebug\\jre\\bin\\server\\jvm.dll"); + initNames("tiered", "debug", "jvm.dll"); init(getIncludes(), getDefines()); } } -class TieredFastDebugConfig extends GenericDebugConfig { +class TieredFastDebugConfig extends GenericDebugNonKernelConfig { String getOptFlag() { return getCI().getOptFlag(); } TieredFastDebugConfig() { - initNames("tiered", "fastdebug", "fastdebug\\jre\\bin\\server\\jvm.dll"); + initNames("tiered", "fastdebug", "jvm.dll"); init(getIncludes(), getDefines()); } } @@ -609,45 +627,45 @@ abstract class ProductConfig extends BuildConfig { class C1ProductConfig extends ProductConfig { C1ProductConfig() { - initNames("compiler1", "product", "jre\\bin\\client\\jvm.dll"); + initNames("compiler1", "product", "jvm.dll"); init(getIncludes(), getDefines()); } } class C2ProductConfig extends ProductConfig { C2ProductConfig() { - initNames("compiler2", "product", "jre\\bin\\server\\jvm.dll"); + initNames("compiler2", "product", "jvm.dll"); init(getIncludes(), getDefines()); } } class TieredProductConfig extends ProductConfig { TieredProductConfig() { - initNames("tiered", "product", "jre\\bin\\server\\jvm.dll"); + initNames("tiered", "product", "jvm.dll"); init(getIncludes(), getDefines()); } } -class CoreDebugConfig extends GenericDebugConfig { +class CoreDebugConfig extends GenericDebugNonKernelConfig { String getOptFlag() { return getCI().getNoOptFlag(); } CoreDebugConfig() { - initNames("core", "debug", "fastdebug\\jre\\bin\\core\\jvm.dll"); + initNames("core", "debug", "jvm.dll"); init(getIncludes(), getDefines()); } } -class CoreFastDebugConfig extends GenericDebugConfig { +class CoreFastDebugConfig extends GenericDebugNonKernelConfig { String getOptFlag() { return getCI().getOptFlag(); } CoreFastDebugConfig() { - initNames("core", "fastdebug", "fastdebug\\jre\\bin\\core\\jvm.dll"); + initNames("core", "fastdebug", "jvm.dll"); init(getIncludes(), getDefines()); } } @@ -655,7 +673,7 @@ class CoreFastDebugConfig extends GenericDebugConfig { class CoreProductConfig extends ProductConfig { CoreProductConfig() { - initNames("core", "product", "jre\\bin\\core\\jvm.dll"); + initNames("core", "product", "jvm.dll"); init(getIncludes(), getDefines()); } } @@ -666,7 +684,7 @@ class KernelDebugConfig extends GenericDebugConfig { } KernelDebugConfig() { - initNames("kernel", "debug", "fastdebug\\jre\\bin\\kernel\\jvm.dll"); + initNames("kernel", "debug", "jvm.dll"); init(getIncludes(), getDefines()); } } @@ -678,7 +696,7 @@ class KernelFastDebugConfig extends GenericDebugConfig { } KernelFastDebugConfig() { - initNames("kernel", "fastdebug", "fastdebug\\jre\\bin\\kernel\\jvm.dll"); + initNames("kernel", "fastdebug", "jvm.dll"); init(getIncludes(), getDefines()); } } @@ -686,7 +704,7 @@ class KernelFastDebugConfig extends GenericDebugConfig { class KernelProductConfig extends ProductConfig { KernelProductConfig() { - initNames("kernel", "product", "jre\\bin\\kernel\\jvm.dll"); + initNames("kernel", "product", "jvm.dll"); init(getIncludes(), getDefines()); } } @@ -695,6 +713,7 @@ abstract class CompilerInterface { abstract Vector getBaseLinkerFlags(String outDir, String outDll); abstract Vector getDebugCompilerFlags(String opt); abstract Vector getDebugLinkerFlags(); + abstract void getAdditionalNonKernelLinkerFlags(Vector rv); abstract Vector getProductCompilerFlags(); abstract Vector getProductLinkerFlags(); abstract String getOptFlag(); @@ -704,4 +723,14 @@ abstract class CompilerInterface { void addAttr(Vector receiver, String attr, String value) { receiver.add(attr); receiver.add(value); } + void extAttr(Vector receiver, String attr, String value) { + int attr_pos=receiver.indexOf(attr) ; + if ( attr_pos == -1) { + // If attr IS NOT present in the Vector - add it + receiver.add(attr); receiver.add(value); + } else { + // If attr IS present in the Vector - append value to it + receiver.set(attr_pos+1,receiver.get(attr_pos+1)+value); + } + } } diff --git a/hotspot/src/share/tools/MakeDeps/DirectoryTree.java b/hotspot/src/share/tools/ProjectCreator/DirectoryTree.java similarity index 87% rename from hotspot/src/share/tools/MakeDeps/DirectoryTree.java rename to hotspot/src/share/tools/ProjectCreator/DirectoryTree.java index acdc08da738..7bfbc6a8ed8 100644 --- a/hotspot/src/share/tools/MakeDeps/DirectoryTree.java +++ b/hotspot/src/share/tools/ProjectCreator/DirectoryTree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,19 +47,49 @@ public class DirectoryTree { verbose = false; } - /** Takes an absolute path to the root directory of this - DirectoryTree. Throws IllegalArgumentException if the given - string represents a plain file or nonexistent directory. */ - - public DirectoryTree(String baseDirectory) { - this(); - readDirectory(baseDirectory); - } - public void addSubdirToIgnore(String subdir) { subdirsToIgnore.add(subdir); } + private class FileIterator implements Iterator { + private Vector nodes = new Vector(); + + public FileIterator(Node rootNode) { + nodes.add(rootNode); + prune(); + } + public boolean hasNext() { + return nodes.size() > 0; + } + public Object next() { + Node last = (Node)nodes.remove(nodes.size() - 1); + prune(); + return new File(last.getName()); + } + + public void remove() { + throw new RuntimeException(); + } + + private void prune() { + while (nodes.size() > 0) { + Node last = (Node)nodes.get(nodes.size() - 1); + + if (last.isDirectory()) { + nodes.remove(nodes.size() - 1); + nodes.addAll(last.children); + } else { + // Is at file + return; + } + } + } + } + + public Iterator getFileIterator() { + return new FileIterator(rootNode); + } + /** Output "."'s to System.out as directories are read. Defaults to false. */ public void setVerbose(boolean newValue) { @@ -80,7 +110,7 @@ public class DirectoryTree { public void readDirectory(String baseDirectory) throws IllegalArgumentException { - File root = new File(baseDirectory); + File root = new File(Util.normalize(baseDirectory)); if (!root.isDirectory()) { throw new IllegalArgumentException("baseDirectory \"" + baseDirectory + diff --git a/hotspot/src/share/tools/MakeDeps/DirectoryTreeNode.java b/hotspot/src/share/tools/ProjectCreator/DirectoryTreeNode.java similarity index 94% rename from hotspot/src/share/tools/MakeDeps/DirectoryTreeNode.java rename to hotspot/src/share/tools/ProjectCreator/DirectoryTreeNode.java index f540e128775..f198dc24b52 100644 --- a/hotspot/src/share/tools/MakeDeps/DirectoryTreeNode.java +++ b/hotspot/src/share/tools/ProjectCreator/DirectoryTreeNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/tools/MakeDeps/FileFormatException.java b/hotspot/src/share/tools/ProjectCreator/FileFormatException.java similarity index 93% rename from hotspot/src/share/tools/MakeDeps/FileFormatException.java rename to hotspot/src/share/tools/ProjectCreator/FileFormatException.java index 1ce8b9e6dc6..f16f0b2adca 100644 --- a/hotspot/src/share/tools/MakeDeps/FileFormatException.java +++ b/hotspot/src/share/tools/ProjectCreator/FileFormatException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/tools/MakeDeps/Macro.java b/hotspot/src/share/tools/ProjectCreator/Macro.java similarity index 92% rename from hotspot/src/share/tools/MakeDeps/Macro.java rename to hotspot/src/share/tools/ProjectCreator/Macro.java index 2b9ed67c7ad..43309ab24da 100644 --- a/hotspot/src/share/tools/MakeDeps/Macro.java +++ b/hotspot/src/share/tools/ProjectCreator/Macro.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/tools/MakeDeps/MacroDefinitions.java b/hotspot/src/share/tools/ProjectCreator/MacroDefinitions.java similarity index 61% rename from hotspot/src/share/tools/MakeDeps/MacroDefinitions.java rename to hotspot/src/share/tools/ProjectCreator/MacroDefinitions.java index 727a0c4a9c5..9ed801ac95d 100644 --- a/hotspot/src/share/tools/MakeDeps/MacroDefinitions.java +++ b/hotspot/src/share/tools/ProjectCreator/MacroDefinitions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ public class MacroDefinitions { macros = new Vector(); } - private String lookup(String name) throws NoSuchElementException { - for (Iterator iter = macros.iterator(); iter.hasNext(); ) { - Macro macro = (Macro) iter.next(); - if (macro.name.equals(name)) { - return macro.contents; - } - } - throw new NoSuchElementException(name); - } - public void addMacro(String name, String contents) { Macro macro = new Macro(); macro.name = name; @@ -155,102 +145,10 @@ public class MacroDefinitions { reader.close(); } - /** Throws IllegalArgumentException if passed token is illegally - formatted */ - public String expand(String token) - throws IllegalArgumentException { - // the token may contain one or more 's - - String out = ""; - - // emacs lingo - int mark = 0; - int point = 0; - - int len = token.length(); - - if (len == 0) - return out; - - do { - // Scan "point" forward until hitting either the end of - // the string or the beginning of a macro - if (token.charAt(point) == '<') { - // Append (point - mark) to out - if ((point - mark) != 0) { - out += token.substring(mark, point); - } - mark = point + 1; - // Scan forward from point for right bracket - point++; - while ((point < len) && - (token.charAt(point) != '>')) { - point++; - } - if (point == len) { - throw new IllegalArgumentException( - "Could not find right angle-bracket in token " + token - ); - } - String name = token.substring(mark, point); - if (name == null) { - throw new IllegalArgumentException( - "Empty macro in token " + token - ); - } - try { - String contents = lookup(name); - out += contents; - point++; - mark = point; - } catch (NoSuchElementException e) { - throw new IllegalArgumentException( - "Unknown macro " + name + " in token " + token - ); - } - } else { - point++; - } - } while (point != len); - - if (mark != point) { - out += token.substring(mark, point); - } - - return out; - } - - public MacroDefinitions copy() { - MacroDefinitions ret = new MacroDefinitions(); - for (Iterator iter = macros.iterator(); - iter.hasNext(); ) { - Macro orig = (Macro) iter.next(); - Macro macro = new Macro(); - macro.name = orig.name; - macro.contents = orig.contents; - ret.macros.add(macro); - } - return ret; - } - - public void setAllMacroBodiesTo(String s) { - for (Iterator iter = macros.iterator(); - iter.hasNext(); ) { - Macro macro = (Macro) iter.next(); - macro.contents = s; - } - } - /** This returns an Iterator of Macros. You should not mutate the returned Macro objects or use the Iterator to remove macros. */ public Iterator getMacros() { return macros.iterator(); } - - private void error(String text) throws FileFormatException { - throw new FileFormatException( - "Expected \"macroname = value\", but found: " + text - ); - } } diff --git a/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java b/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java new file mode 100644 index 00000000000..5203c5a36ed --- /dev/null +++ b/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +public class ProjectCreator { + + public static void usage() { + System.out.println("ProjectCreator options:"); + System.err.println("WinGammaPlatform platform-specific options:"); + System.err.println(" -sourceBase "); + System.err.println(" -dspFileName "); + System.err.println(" -envVar "); + System.err.println(" -dllLoc "); + System.err.println(" If any of the above are specified, "+ + "they must all be."); + System.err.println(" Additional, optional arguments, which can be " + + "specified multiple times:"); + System.err.println(" -absoluteInclude "); + System.err.println(" -relativeInclude "); + System.err.println(" -define "); + System.err.println(" -perFileLine "); + System.err.println(" -conditionalPerFileLine "); + System.err.println(" (NOTE: To work around a bug in nmake, where " + + "you can't have a '#' character in a quoted " + + "string, all of the lines outputted have \"#\"" + + "prepended)"); + System.err.println(" -startAt "); + System.err.println(" -ignoreFile "); + System.err.println(" -additionalFile "); + System.err.println(" -additionalGeneratedFile " + + ""); + System.err.println(" -prelink :"); + System.err.println(" Generate a set of prelink commands for the given BUILD"); + System.err.println(" (\"Debug\" or \"Release\"). The prelink description and commands"); + System.err.println(" are both quoted strings."); + System.err.println(" Default includes: \".\""); + System.err.println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\""); + } + + public static void main(String[] args) { + try { + if (args.length < 3) { + usage(); + System.exit(1); + } + + String platformName = args[0]; + Class platformClass = Class.forName(platformName); + WinGammaPlatform platform = (WinGammaPlatform) platformClass.newInstance(); + + String[] platformArgs = new String[args.length - 1]; + System.arraycopy(args, 1, platformArgs, 0, platformArgs.length); + + // Allow the platform to write platform-specific files + platform.createVcproj(platformArgs); + } + catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + } +} diff --git a/hotspot/src/share/tools/MakeDeps/Util.java b/hotspot/src/share/tools/ProjectCreator/Util.java similarity index 96% rename from hotspot/src/share/tools/MakeDeps/Util.java rename to hotspot/src/share/tools/ProjectCreator/Util.java index e9a44d8d34d..e44b4f09c34 100644 --- a/hotspot/src/share/tools/MakeDeps/Util.java +++ b/hotspot/src/share/tools/ProjectCreator/Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/tools/MakeDeps/WinGammaPlatform.java b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java similarity index 88% rename from hotspot/src/share/tools/MakeDeps/WinGammaPlatform.java rename to hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java index 1c136bdbf39..a2416f50be7 100644 --- a/hotspot/src/share/tools/MakeDeps/WinGammaPlatform.java +++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,15 @@ * */ -import java.io.*; -import java.util.*; +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.TreeSet; +import java.util.Vector; abstract class HsArgHandler extends ArgHandler { static final int STRING = 1; @@ -117,40 +124,7 @@ class HsArgRule extends ArgRuleSpecific { } -public abstract class WinGammaPlatform extends Platform { - public void setupFileTemplates() { - inclFileTemplate = new FileName(this, - "incls\\", "_", "", ".incl", "", "" - ); - giFileTemplate = new FileName(this, - "incls\\", "", "_precompiled", ".incl", "", "" - ); - gdFileTemplate = new FileName(this, - "", "", "Dependencies", "", "", "" - ); - } - - private static String[] suffixes = { ".cpp", ".c" }; - - public String[] outerSuffixes() { - return suffixes; - } - - public String objFileSuffix() { - return ".obj"; - } - - public String asmFileSuffix() { - return ".i"; - } - - public String dependentPrefix() { - return "$(VM_PATH)"; - } - - public boolean includeGIInEachIncl() { - return false; - } +public abstract class WinGammaPlatform { public boolean fileNameStringEquality(String s1, String s2) { return s1.equalsIgnoreCase(s2); @@ -176,8 +150,7 @@ public abstract class WinGammaPlatform extends Platform { "#define (flag) (value))>"); System.err.println(" -startAt "); System.err.println(" -additionalFile "); + "which should show up in project file>"); System.err.println(" -additionalGeneratedFile " + ""); @@ -301,27 +274,6 @@ public abstract class WinGammaPlatform extends Platform { return name; } - protected boolean databaseAllFilesEqual(Database previousDB, - Database currentDB) { - Iterator i1 = previousDB.getAllFiles().iterator(); - Iterator i2 = currentDB.getAllFiles().iterator(); - - while (i1.hasNext() && i2.hasNext()) { - FileList fl1 = (FileList) i1.next(); - FileList fl2 = (FileList) i2.next(); - if (!fl1.getName().equals(fl2.getName())) { - return false; - } - } - - if (i1.hasNext() != i2.hasNext()) { - // Different lengths - return false; - } - - return true; - } - protected String envVarPrefixedFileName(String fileName, int sourceBaseLen, DirectoryTree tree, @@ -374,8 +326,7 @@ public abstract class WinGammaPlatform extends Platform { protected abstract String getProjectExt(); - public void writePlatformSpecificFiles(Database previousDB, - Database currentDB, String[] args) + public void createVcproj(String[] args) throws IllegalArgumentException, IOException { parseArguments(args); @@ -383,16 +334,6 @@ public abstract class WinGammaPlatform extends Platform { String projectFileName = BuildConfig.getFieldString(null, "ProjectFileName"); String ext = getProjectExt(); - // Compare contents of allFiles of previousDB and includeDB. - // If these haven't changed, then skip writing the .vcproj file. - if (false && databaseAllFilesEqual(previousDB, currentDB) && - new File(projectFileName).exists()) { - System.out.println( - " Databases unchanged; skipping overwrite of "+ext+" file." - ); - return; - } - String projectName = getProjectName(projectFileName, ext); writeProjectFile(projectFileName, projectName, createAllConfigs()); @@ -407,24 +348,27 @@ public abstract class WinGammaPlatform extends Platform { } - void setInclFileTemplate(FileName val) { - this.inclFileTemplate = val; - } - - void setGIFileTemplate(FileName val) { - this.giFileTemplate = val; - } - - void parseArguments(String[] args) { new ArgsParser(args, new ArgRule[] { - new HsArgRule("-sourceBase", - "SourceBase", - " (Did you set the HotSpotWorkSpace environment variable?)", - HsArgHandler.STRING - ), + new ArgRule("-sourceBase", + new HsArgHandler() { + public void handle(ArgIterator it) { + String cfg = getCfg(it.get()); + if (nextNotKey(it)) { + String sb = (String) it.get(); + if (sb.endsWith(Util.sep)) { + sb = sb.substring(0, sb.length() - 1); + } + BuildConfig.putField(cfg, "SourceBase", sb); + it.next(); + } else { + empty("-sourceBase", null); + } + } + } + ), new HsArgRule("-buildBase", "BuildBase", @@ -551,6 +495,12 @@ public abstract class WinGammaPlatform extends Platform { HsArgHandler.HASH ), + new HsArgRule("-ignorePath", + "IgnorePath", + null, + HsArgHandler.VECTOR + ), + new HsArgRule("-additionalFile", "AdditionalFile", null, @@ -565,9 +515,6 @@ public abstract class WinGammaPlatform extends Platform { String dir = it.get(); if (nextNotKey(it)) { String fileName = it.get(); - // we ignore files that we know are generated, so we coudn't - // find them in sources - BuildConfig.putFieldHash(cfg, "IgnoreFile", fileName, "1"); BuildConfig.putFieldHash(cfg, "AdditionalGeneratedFile", Util.normalize(dir + Util.sep + fileName), fileName); @@ -580,17 +527,10 @@ public abstract class WinGammaPlatform extends Platform { } ), - new HsArgRule("-includeDB", - "IncludeDB", - null, - HsArgHandler.STRING - ), - new ArgRule("-prelink", new HsArgHandler() { public void handle(ArgIterator it) { if (nextNotKey(it)) { - String build = it.get(); if (nextNotKey(it)) { String description = it.get(); if (nextNotKey(it)) { @@ -606,7 +546,28 @@ public abstract class WinGammaPlatform extends Platform { empty(null, "** Error: wrong number of args to -prelink"); } } - ) + ), + + new ArgRule("-postbuild", + new HsArgHandler() { + public void handle(ArgIterator it) { + if (nextNotKey(it)) { + if (nextNotKey(it)) { + String description = it.get(); + if (nextNotKey(it)) { + String command = it.get(); + BuildConfig.putField(null, "PostbuildDescription", description); + BuildConfig.putField(null, "PostbuildCommand", command); + it.next(); + return; + } + } + } + + empty(null, "** Error: wrong number of args to -postbuild"); + } + } + ), }, new ArgHandler() { public void handle(ArgIterator it) { @@ -696,10 +657,6 @@ public abstract class WinGammaPlatform extends Platform { public int compareTo(Object o) { FileInfo oo = (FileInfo)o; - // Don't squelch identical short file names where the full - // paths are different - if (!attr.shortName.equals(oo.attr.shortName)) - return attr.shortName.compareTo(oo.attr.shortName); return full.compareTo(oo.full); } diff --git a/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC6.java b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java similarity index 98% rename from hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC6.java rename to hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java index f394b3c5062..6e59d78673b 100644 --- a/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC6.java +++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -260,6 +260,8 @@ class CompilerInterfaceVC6 extends CompilerInterface { return rv; } + void getAdditionalNonKernelLinkerFlags(Vector rv) {} + Vector getProductCompilerFlags() { Vector rv = new Vector(); diff --git a/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java similarity index 76% rename from hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java rename to hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java index fffff8bd907..dad8ed6d108 100644 --- a/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java +++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -import java.io.*; -import java.util.*; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.TreeSet; +import java.util.Vector; public class WinGammaPlatformVC7 extends WinGammaPlatform { @@ -104,7 +109,9 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform { boolean match(FileInfo fi) { - return fi.full.regionMatches(true, baseLen, dir, 0, dirLen); + int lastSlashIndex = fi.full.lastIndexOf('/'); + String fullDir = fi.full.substring(0, lastSlashIndex); + return fullDir.endsWith(dir); } } @@ -160,6 +167,25 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform { } + class SpecificPathFilter extends NameFilter { + String pats[]; + + SpecificPathFilter(String fname, String[] pats) { + this.fname = fname; + this.pats = pats; + } + + boolean match(FileInfo fi) { + for (int i=0; i files) { Vector rv = new Vector(); String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/"); - ContainerFilter rt = new ContainerFilter("Runtime"); - rt.add(new DirectoryFilter("share/vm/prims", sbase)); - rt.add(new DirectoryFilter("share/vm/runtime", sbase)); - rt.add(new DirectoryFilter("share/vm/oops", sbase)); - rv.add(rt); + String currentDir = ""; + DirectoryFilter container = null; + for(FileInfo fileInfo : files) { - ContainerFilter gc = new ContainerFilter("GC"); - gc.add(new DirectoryFilter("share/vm/memory", sbase)); - gc.add(new DirectoryFilter("share/vm/gc_interface", sbase)); + if (!fileInfo.full.startsWith(sbase)) { + continue; + } - ContainerFilter gc_impl = new ContainerFilter("Implementations"); - gc_impl.add(new DirectoryFilter("CMS", - "share/vm/gc_implementation/concurrentMarkSweep", - sbase)); - gc_impl.add(new DirectoryFilter("Parallel Scavenge", - "share/vm/gc_implementation/parallelScavenge", - sbase)); - gc_impl.add(new DirectoryFilter("Shared", - "share/vm/gc_implementation/shared", - sbase)); - // for all leftovers - gc_impl.add(new DirectoryFilter("Misc", - "share/vm/gc_implementation", - sbase)); + int lastSlash = fileInfo.full.lastIndexOf('/'); + String dir = fileInfo.full.substring(sbase.length(), lastSlash); + if(dir.equals("share/vm")) { + // skip files directly in share/vm - should only be precompiled.hpp which is handled below + continue; + } + if (!dir.equals(currentDir)) { + currentDir = dir; + if (container != null) { + rv.add(container); + } - gc.add(gc_impl); - rv.add(gc); + // remove "share/vm/" from names + String name = dir; + if (dir.startsWith("share/vm/")) { + name = dir.substring("share/vm/".length(), dir.length()); + } + container = new DirectoryFilter(name, dir, sbase); + } + } + if (container != null) { + rv.add(container); + } - rv.add(new DirectoryFilter("C1", "share/vm/c1", sbase)); + ContainerFilter generated = new ContainerFilter("Generated"); + ContainerFilter c1Generated = new ContainerFilter("C1"); + c1Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler1/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); + c1Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler1/generated/jvmtifiles/.*"})); + generated.add(c1Generated); + ContainerFilter c2Generated = new ContainerFilter("C2"); + c2Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler2/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); + c2Generated.add(new SpecificPathFilter("adfiles", new String[] {".*compiler2/generated/adfiles/.*"})); + c2Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler2/generated/jvmtifiles/.*"})); + generated.add(c2Generated); + ContainerFilter coreGenerated = new ContainerFilter("Core"); + coreGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*core/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); + coreGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*core/generated/jvmtifiles/.*"})); + generated.add(coreGenerated); + ContainerFilter tieredGenerated = new ContainerFilter("Tiered"); + tieredGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*tiered/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); + tieredGenerated.add(new SpecificPathFilter("adfiles", new String[] {".*tiered/generated/adfiles/.*"})); + tieredGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*tiered/generated/jvmtifiles/.*"})); + generated.add(tieredGenerated); + ContainerFilter kernelGenerated = new ContainerFilter("Kernel"); + kernelGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*kernel/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"})); + kernelGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*kernel/generated/jvmtifiles/.*"})); + generated.add(kernelGenerated); + rv.add(generated); - ContainerFilter c2 = new ContainerFilter("C2"); - //c2.add(new DirectoryFilter("share/vm/adlc", sbase)); - c2.add(new DirectoryFilter("share/vm/opto", sbase)); - c2.add(new SpecificNameFilter("Generated", new String[] {"^ad_.+", "^dfa_.+", "^adGlobals.+"})); - rv.add(c2); - - ContainerFilter comp = new ContainerFilter("Compiler Common"); - comp.add(new DirectoryFilter("share/vm/asm", sbase)); - comp.add(new DirectoryFilter("share/vm/ci", sbase)); - comp.add(new DirectoryFilter("share/vm/code", sbase)); - comp.add(new DirectoryFilter("share/vm/compiler", sbase)); - rv.add(comp); - - rv.add(new DirectoryFilter("Interpreter", - "share/vm/interpreter", - sbase)); - - ContainerFilter misc = new ContainerFilter("Misc"); - //misc.add(new DirectoryFilter("share/vm/launch", sbase)); - misc.add(new DirectoryFilter("share/vm/libadt", sbase)); - misc.add(new DirectoryFilter("share/vm/services", sbase)); - misc.add(new DirectoryFilter("share/vm/utilities", sbase)); - rv.add(misc); - - rv.add(new DirectoryFilter("os_cpu", sbase)); - - rv.add(new DirectoryFilter("cpu", sbase)); - - rv.add(new DirectoryFilter("os", sbase)); - - rv.add(new SpecificNameFilter("JVMTI Generated", new String[] {"^jvmti.+"})); - - rv.add(new SpecificNameFilter("C++ Interpreter Generated", new String[] {"^bytecodeInterpreterWithChecks.+"})); - - rv.add(new SpecificNameFilter("Include DBs", new String[] {"^includeDB_.+"})); + rv.add(new SpecificNameFilter("Precompiled Header", new String[] {"precompiled.hpp"})); // this one is to catch files not caught by other filters //rv.add(new TypeFilter("Header Files", new String[] {"h", "hpp", "hxx", "hm", "inl", "fi", "fd"})); @@ -361,7 +380,6 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform { "Name", cfg, "ExcludedFromBuild", "TRUE" }); - tag("Tool", new String[] {"Name", "VCCLCompilerTool"}); endTag("FileConfiguration"); } @@ -405,7 +423,11 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform { tag("Tool", new String[] { - "Name", "VCPostBuildEventTool" + "Name", "VCPostBuildEventTool", + "Description", BuildConfig.getFieldString(null, "PostbuildDescription"), + //Caution: String.replace(String,String) is available from JDK5 onwards only + "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PostbuildCommand").replace + ("\t", " ")) } ); @@ -433,33 +455,6 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform { "Culture", "1033" } ); - tag("Tool", - new String[] { - "Name", "VCWebServiceProxyGeneratorTool" - } - ); - - tag ("Tool", - new String[] { - "Name", "VCXMLDataGeneratorTool" - } - ); - - tag("Tool", - new String[] { - "Name", "VCWebDeploymentTool" - } - ); - tag("Tool", - new String[] { - "Name", "VCManagedWrapperGeneratorTool" - } - ); - tag("Tool", - new String[] { - "Name", "VCAuxiliaryManagedWrapperGeneratorTool" - } - ); tag("Tool", new String[] { @@ -489,7 +484,10 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform { printWriter.println(); for (int i=0; i options. However, in case @@ -79,12 +79,14 @@ #include #include +#include #include "java.h" - #ifndef GAMMA #include "manifest_info.h" #include "version_comp.h" +#include "splashscreen.h" #endif +#include "wildcard.h" #ifndef FULL_VERSION #define FULL_VERSION JDK_MAJOR_VERSION "." JDK_MINOR_VERSION @@ -114,11 +116,27 @@ */ #define ENV_ENTRY "_JAVA_VERSION_SET" +#ifndef GAMMA +#define SPLASH_FILE_ENV_ENTRY "_JAVA_SPLASH_FILE" +#define SPLASH_JAR_ENV_ENTRY "_JAVA_SPLASH_JAR" +#endif + static jboolean printVersion = JNI_FALSE; /* print and exit */ static jboolean showVersion = JNI_FALSE; /* print but continue */ static char *progname; jboolean _launcher_debug = JNI_FALSE; +#ifndef GAMMA +/* + * Entries for splash screen environment variables. + * putenv is performed in SelectVersion. We need + * them in memory until UnsetEnv, so they are made static + * global instead of auto local. + */ +static char* splash_file_entry = NULL; +static char* splash_jar_entry = NULL; +#endif + /* * List of VM options to be specified when the VM is created. */ @@ -128,11 +146,10 @@ static int numOptions, maxOptions; /* * Prototypes for functions internal to launcher. */ -static void AddOption(char *str, void *info); -static void SetClassPath(char *s); +static void SetClassPath(const char *s); static void SelectVersion(int argc, char **argv, char **main_class); static jboolean ParseArguments(int *pargc, char ***pargv, char **pjarfile, - char **pclassname, int *pret); + char **pclassname, int *pret, const char *jvmpath); static jboolean InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn); static jstring NewPlatformString(JNIEnv *env, char *s); @@ -140,21 +157,21 @@ static jobjectArray NewPlatformStringArray(JNIEnv *env, char **strv, int strc); static jclass LoadClass(JNIEnv *env, char *name); static jstring GetMainClassName(JNIEnv *env, char *jarname); static void SetJavaCommandLineProp(char* classname, char* jarfile, int argc, char** argv); -#ifdef GAMMA static void SetJavaLauncherProp(void); -#endif #ifdef JAVA_ARGS -static void TranslateDashJArgs(int *pargc, char ***pargv); +static void TranslateApplicationArgs(int *pargc, char ***pargv); static jboolean AddApplicationOptions(void); #endif static void PrintJavaVersion(JNIEnv *env); static void PrintUsage(void); -static jint PrintXUsage(void); +static jint PrintXUsage(const char *jvmpath); static void SetPaths(int argc, char **argv); +#ifndef GAMMA + /* Maximum supported entries from jvm.cfg. */ #define INIT_MAX_KNOWN_VMS 10 /* Values for vmdesc.flag */ @@ -178,41 +195,47 @@ static int knownVMsLimit = 0; static void GrowKnownVMs(); static int KnownVMIndex(const char* name); static void FreeKnownVMs(); +static void ShowSplashScreen(); + +#endif /* ifndef GAMMA */ jboolean ServerClassMachine(); /* flag which if set suppresses error messages from the launcher */ static int noExitErrorMessage = 0; +/* + * Running Java code in primordial thread caused many problems. We will + * create a new thread to invoke JVM. See 6316197 for more information. + */ +static jlong threadStackSize = 0; /* stack size of the new thread */ + +int JNICALL JavaMain(void * args); /* entry point */ + +struct JavaMainArgs { + int argc; + char ** argv; + char * jarfile; + char * classname; + InvocationFunctions ifn; +}; + /* * Entry point. */ int main(int argc, char ** argv) { - JavaVM *vm = 0; - JNIEnv *env = 0; char *jarfile = 0; char *classname = 0; char *s = 0; char *main_class = NULL; - jstring mainClassName; - jclass mainClass; - jmethodID mainID; - jobjectArray mainArgs; int ret; InvocationFunctions ifn; jlong start, end; char jrepath[MAXPATHLEN], jvmpath[MAXPATHLEN]; char ** original_argv = argv; - /* - * Error message to print or display; by default the message will - * only be displayed in a window. - */ - char * message = "Fatal exception occurred. Program will exit."; - jboolean messageDest = JNI_FALSE; - if (getenv("_JAVA_LAUNCHER_DEBUG") != 0) { _launcher_debug = JNI_TRUE; printf("----_JAVA_LAUNCHER_DEBUG----\n"); @@ -242,7 +265,7 @@ main(int argc, char ** argv) /* copy original argv */ { int i; - original_argv = (char**)MemAlloc(sizeof(char*)*(argc+1)); + original_argv = (char**)JLI_MemAlloc(sizeof(char*)*(argc+1)); for(i = 0; i < argc+1; i++) original_argv[i] = argv[i]; } @@ -251,6 +274,9 @@ main(int argc, char ** argv) jrepath, sizeof(jrepath), jvmpath, sizeof(jvmpath), original_argv); + + printf("Using java runtime at: %s\n", jrepath); + ifn.CreateJavaVM = 0; ifn.GetDefaultJavaVMInitArgs = 0; @@ -282,7 +308,7 @@ main(int argc, char ** argv) #ifdef JAVA_ARGS /* Preprocess wrapper arguments */ - TranslateDashJArgs(&argc, &argv); + TranslateApplicationArgs(&argc, &argv); if (!AddApplicationOptions()) { exit(1); } @@ -300,7 +326,7 @@ main(int argc, char ** argv) * Parse command line options; if the return value of * ParseArguments is false, the program should exit. */ - if (!ParseArguments(&argc, &argv, &jarfile, &classname, &ret)) { + if (!ParseArguments(&argc, &argv, &jarfile, &classname, &ret, jvmpath)) { exit(ret); } @@ -312,9 +338,15 @@ main(int argc, char ** argv) /* set the -Dsun.java.command pseudo property */ SetJavaCommandLineProp(classname, jarfile, argc, argv); -#ifdef GAMMA /* Set the -Dsun.java.launcher pseudo property */ SetJavaLauncherProp(); + + /* set the -Dsun.java.launcher.* platform properties */ + SetJavaLauncherPlatformProps(); + +#ifndef GAMMA + /* Show the splash screen if needed */ + ShowSplashScreen(); #endif /* @@ -322,6 +354,67 @@ main(int argc, char ** argv) * clean up the environment. */ (void)UnsetEnv(ENV_ENTRY); +#ifndef GAMMA + (void)UnsetEnv(SPLASH_FILE_ENV_ENTRY); + (void)UnsetEnv(SPLASH_JAR_ENV_ENTRY); + + JLI_MemFree(splash_jar_entry); + JLI_MemFree(splash_file_entry); +#endif + + /* + * If user doesn't specify stack size, check if VM has a preference. + * Note that HotSpot no longer supports JNI_VERSION_1_1 but it will + * return its default stack size through the init args structure. + */ + if (threadStackSize == 0) { + struct JDK1_1InitArgs args1_1; + memset((void*)&args1_1, 0, sizeof(args1_1)); + args1_1.version = JNI_VERSION_1_1; + ifn.GetDefaultJavaVMInitArgs(&args1_1); /* ignore return value */ + if (args1_1.javaStackSize > 0) { + threadStackSize = args1_1.javaStackSize; + } + } + + { /* Create a new thread to create JVM and invoke main method */ + struct JavaMainArgs args; + + args.argc = argc; + args.argv = argv; + args.jarfile = jarfile; + args.classname = classname; + args.ifn = ifn; + + return ContinueInNewThread(JavaMain, threadStackSize, (void*)&args); + } +} + +int JNICALL +JavaMain(void * _args) +{ + struct JavaMainArgs *args = (struct JavaMainArgs *)_args; + int argc = args->argc; + char **argv = args->argv; + char *jarfile = args->jarfile; + char *classname = args->classname; + InvocationFunctions ifn = args->ifn; + + JavaVM *vm = 0; + JNIEnv *env = 0; + jstring mainClassName; + jclass mainClass; + jmethodID mainID; + jobjectArray mainArgs; + int ret = 0; + jlong start, end; + + /* + * Error message to print or display; by default the message will + * only be displayed in a window. + */ + char * message = "Fatal exception occurred. Program will exit."; + jboolean messageDest = JNI_FALSE; /* Initialize the virtual machine */ @@ -407,7 +500,7 @@ main(int argc, char ** argv) if (mainClassName == NULL) { const char * format = "Failed to load Main-Class manifest " "attribute from\n%s"; - message = (char*)MemAlloc((strlen(format) + strlen(jarfile)) * + message = (char*)JLI_MemAlloc((strlen(format) + strlen(jarfile)) * sizeof(char)); sprintf(message, format, jarfile); messageDest = JNI_TRUE; @@ -419,9 +512,13 @@ main(int argc, char ** argv) goto leave; } mainClass = LoadClass(env, classname); - if(mainClass == NULL) { /* exception occurred */ + if(mainClass == NULL) { /* exception occured */ + const char * format = "Could not find the main class: %s. Program will exit."; ReportExceptionDescription(env); - message = "Could not find the main class. Program will exit."; + message = (char *)JLI_MemAlloc((strlen(format) + + strlen(classname)) * sizeof(char) ); + messageDest = JNI_TRUE; + sprintf(message, format, classname); goto leave; } (*env)->ReleaseStringUTFChars(env, mainClassName, classname); @@ -429,7 +526,7 @@ main(int argc, char ** argv) mainClassName = NewPlatformString(env, classname); if (mainClassName == NULL) { const char * format = "Failed to load Main Class: %s"; - message = (char *)MemAlloc((strlen(format) + strlen(classname)) * + message = (char *)JLI_MemAlloc((strlen(format) + strlen(classname)) * sizeof(char) ); sprintf(message, format, classname); messageDest = JNI_TRUE; @@ -441,9 +538,13 @@ main(int argc, char ** argv) goto leave; } mainClass = LoadClass(env, classname); - if(mainClass == NULL) { /* exception occurred */ + if(mainClass == NULL) { /* exception occured */ + const char * format = "Could not find the main class: %s. Program will exit."; ReportExceptionDescription(env); - message = "Could not find the main class. Program will exit."; + message = (char *)JLI_MemAlloc((strlen(format) + + strlen(classname)) * sizeof(char) ); + messageDest = JNI_TRUE; + sprintf(message, format, classname); goto leave; } (*env)->ReleaseStringUTFChars(env, mainClassName, classname); @@ -538,7 +639,6 @@ main(int argc, char ** argv) return ret; } - #ifndef GAMMA /* * Checks the command line options to find which JVM type was @@ -560,7 +660,7 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) { argc = *pargc; /* To make things simpler we always copy the argv array */ - newArgv = MemAlloc((argc + 1) * sizeof(char *)); + newArgv = JLI_MemAlloc((argc + 1) * sizeof(char *)); /* The program name is always present */ newArgv[newArgvIdx++] = (*argv)[0]; @@ -700,10 +800,51 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) { } #endif /* ifndef GAMMA */ +# define KB (1024UL) +# define MB (1024UL * KB) +# define GB (1024UL * MB) + +/* copied from HotSpot function "atomll()" */ +static int +parse_stack_size(const char *s, jlong *result) { + jlong n = 0; + int args_read = sscanf(s, jlong_format_specifier(), &n); + if (args_read != 1) { + return 0; + } + while (*s != '\0' && *s >= '0' && *s <= '9') { + s++; + } + // 4705540: illegal if more characters are found after the first non-digit + if (strlen(s) > 1) { + return 0; + } + switch (*s) { + case 'T': case 't': + *result = n * GB * KB; + return 1; + case 'G': case 'g': + *result = n * GB; + return 1; + case 'M': case 'm': + *result = n * MB; + return 1; + case 'K': case 'k': + *result = n * KB; + return 1; + case '\0': + *result = n; + return 1; + default: + /* Create JVM with default stack and let VM handle malformed -Xss string*/ + return 0; + } +} + /* * Adds a new VM option with the given given name and value. */ -static void +void AddOption(char *str, void *info) { /* @@ -713,24 +854,33 @@ AddOption(char *str, void *info) if (numOptions >= maxOptions) { if (options == 0) { maxOptions = 4; - options = MemAlloc(maxOptions * sizeof(JavaVMOption)); + options = JLI_MemAlloc(maxOptions * sizeof(JavaVMOption)); } else { JavaVMOption *tmp; maxOptions *= 2; - tmp = MemAlloc(maxOptions * sizeof(JavaVMOption)); + tmp = JLI_MemAlloc(maxOptions * sizeof(JavaVMOption)); memcpy(tmp, options, numOptions * sizeof(JavaVMOption)); - free(options); + JLI_MemFree(options); options = tmp; } } options[numOptions].optionString = str; options[numOptions++].extraInfo = info; + + if (strncmp(str, "-Xss", 4) == 0) { + jlong tmp; + if (parse_stack_size(str + 4, &tmp)) { + threadStackSize = tmp; + } + } } static void -SetClassPath(char *s) +SetClassPath(const char *s) { - char *def = MemAlloc(strlen(s) + 40); + char *def; + s = JLI_WildcardExpandClasspath(s); + def = JLI_MemAlloc(strlen(s) + 40); sprintf(def, "-Djava.class.path=%s", s); AddOption(def, NULL); } @@ -741,6 +891,8 @@ SetClassPath(char *s) * the JRE is running. The specification for the appropriate version * is obtained from either the manifest of a jar file (preferred) or * from command line options. + * The routine also parses splash screen command line options and + * passes on their values in private environment variables. */ static void SelectVersion(int argc, char **argv, char **main_class) @@ -752,9 +904,12 @@ SelectVersion(int argc, char **argv, char **main_class) char *version = NULL; char *jre = NULL; int jarflag = 0; + int headlessflag = 0; int restrict_search = -1; /* -1 implies not known */ manifest_info info; char env_entry[MAXNAMELEN + 24] = ENV_ENTRY "="; + char *splash_file_name = NULL; + char *splash_jar_name = NULL; char *env_in; int res; @@ -765,7 +920,7 @@ SelectVersion(int argc, char **argv, char **main_class) */ if ((env_in = getenv(ENV_ENTRY)) != NULL) { if (*env_in != '\0') - *main_class = strdup(env_in); + *main_class = JLI_StringDup(env_in); return; } @@ -781,8 +936,13 @@ SelectVersion(int argc, char **argv, char **main_class) * As the scan is performed, make a copy of the argument list with * the version specification options (new to 1.5) removed, so that * a version less than 1.5 can be exec'd. + * + * Note that due to the syntax of the native Windows interface + * CreateProcess(), processing similar to the following exists in + * the Windows platform specific routine ExecJRE (in java_md.c). + * Changes here should be reproduced there. */ - new_argv = MemAlloc((argc + 1) * sizeof(char*)); + new_argv = JLI_MemAlloc((argc + 1) * sizeof(char*)); new_argv[0] = argv[0]; new_argp = &new_argv[1]; argc--; @@ -805,6 +965,18 @@ SelectVersion(int argc, char **argv, char **main_class) argv++; arg = *argv; } + + /* + * Checking for headless toolkit option in the some way as AWT does: + * "true" means true and any other value means false + */ + if (strcmp(arg, "-Djava.awt.headless=true") == 0) { + headlessflag = 1; + } else if (strncmp(arg, "-Djava.awt.headless=", 20) == 0) { + headlessflag = 0; + } else if (strncmp(arg, "-splash:", 8) == 0) { + splash_file_name = arg+8; + } *new_argp++ = arg; } argc--; @@ -830,7 +1002,7 @@ SelectVersion(int argc, char **argv, char **main_class) * this data around. */ if (jarflag && operand) { - if ((res = parse_manifest(operand, &info)) != 0) { + if ((res = JLI_ParseManifest(operand, &info)) != 0) { if (res == -1) ReportErrorMessage2("Unable to access jarfile %s", operand, JNI_TRUE); @@ -839,6 +1011,17 @@ SelectVersion(int argc, char **argv, char **main_class) operand, JNI_TRUE); exit(1); } + + /* + * Command line splash screen option should have precedence + * over the manifest, so the manifest data is used only if + * splash_file_name has not been initialized above during command + * line parsing + */ + if (!headlessflag && !splash_file_name && info.splashscreen_image_file_name) { + splash_file_name = info.splashscreen_image_file_name; + splash_jar_name = operand; + } } else { info.manifest_version = NULL; info.main_class = NULL; @@ -846,6 +1029,22 @@ SelectVersion(int argc, char **argv, char **main_class) info.jre_restrict_search = 0; } + /* + * Passing on splash screen info in environment variables + */ + if (splash_file_name && !headlessflag) { + char* splash_file_entry = JLI_MemAlloc(strlen(SPLASH_FILE_ENV_ENTRY "=")+strlen(splash_file_name)+1); + strcpy(splash_file_entry, SPLASH_FILE_ENV_ENTRY "="); + strcat(splash_file_entry, splash_file_name); + putenv(splash_file_entry); + } + if (splash_jar_name && !headlessflag) { + char* splash_jar_entry = JLI_MemAlloc(strlen(SPLASH_JAR_ENV_ENTRY "=")+strlen(splash_jar_name)+1); + strcpy(splash_jar_entry, SPLASH_JAR_ENV_ENTRY "="); + strcat(splash_jar_entry, splash_jar_name); + putenv(splash_jar_entry); + } + /* * The JRE-Version and JRE-Restrict-Search values (if any) from the * manifest are overwritten by any specified on the command line. @@ -860,22 +1059,22 @@ SelectVersion(int argc, char **argv, char **main_class) * main_class as a side-effect of this routine. */ if (info.main_class != NULL) - *main_class = strdup(info.main_class); + *main_class = JLI_StringDup(info.main_class); /* * If no version selection information is found either on the command * line or in the manifest, simply return. */ if (info.jre_version == NULL) { - free_manifest(); - free(new_argv); + JLI_FreeManifest(); + JLI_MemFree(new_argv); return; } /* * Check for correct syntax of the version specification (JSR 56). */ - if (!valid_version_string(info.jre_version)) { + if (!JLI_ValidVersionString(info.jre_version)) { ReportErrorMessage2("Syntax error in version specification \"%s\"", info.jre_version, JNI_TRUE); exit(1); @@ -894,9 +1093,9 @@ SelectVersion(int argc, char **argv, char **main_class) (info.jre_version?info.jre_version:"null"), (info.jre_restrict_search?"true":"false"), (jre?jre:"null")); if (jre == NULL) { - if (acceptable_release(FULL_VERSION, info.jre_version)) { - free_manifest(); - free(new_argv); + if (JLI_AcceptableRelease(FULL_VERSION, info.jre_version)) { + JLI_FreeManifest(); + JLI_MemFree(new_argv); return; } else { ReportErrorMessage2( @@ -918,12 +1117,18 @@ SelectVersion(int argc, char **argv, char **main_class) * to avoid locating, expanding and parsing the manifest extra * times. */ - if (info.main_class != NULL) - (void)strcat(env_entry, info.main_class); + if (info.main_class != NULL) { + if (strlen(info.main_class) <= MAXNAMELEN) { + (void)strcat(env_entry, info.main_class); + } else { + ReportErrorMessage("Error: main-class: attribute exceeds system limits\n", JNI_TRUE); + exit(1); + } + } (void)putenv(env_entry); ExecJRE(jre, new_argv); - free_manifest(); - free(new_argv); + JLI_FreeManifest(); + JLI_MemFree(new_argv); return; } #endif /* ifndef GAMMA */ @@ -937,7 +1142,7 @@ SelectVersion(int argc, char **argv, char **main_class) */ static jboolean ParseArguments(int *pargc, char ***pargv, char **pjarfile, - char **pclassname, int *pret) + char **pclassname, int *pret, const char *jvmpath) { int argc = *pargc; char **argv = *pargv; @@ -970,7 +1175,7 @@ ParseArguments(int *pargc, char ***pargv, char **pjarfile, } else if (strcmp(arg, "-showversion") == 0) { showVersion = JNI_TRUE; } else if (strcmp(arg, "-X") == 0) { - *pret = PrintXUsage(); + *pret = PrintXUsage(jvmpath); return JNI_FALSE; /* * The following case provide backward compatibility with old-style @@ -1003,7 +1208,7 @@ ParseArguments(int *pargc, char ***pargv, char **pjarfile, noExitErrorMessage = 1; } else if (strncmp(arg, "-prof", 5) == 0) { char *p = arg + 5; - char *tmp = MemAlloc(strlen(arg) + 50); + char *tmp = JLI_MemAlloc(strlen(arg) + 50); if (*p) { sprintf(tmp, "-Xrunhprof:cpu=old,file=%s", p + 1); } else { @@ -1014,7 +1219,7 @@ ParseArguments(int *pargc, char ***pargv, char **pjarfile, strncmp(arg, "-oss", 4) == 0 || strncmp(arg, "-ms", 3) == 0 || strncmp(arg, "-mx", 3) == 0) { - char *tmp = MemAlloc(strlen(arg) + 6); + char *tmp = JLI_MemAlloc(strlen(arg) + 6); sprintf(tmp, "-X%s", arg + 1); /* skip '-' */ AddOption(tmp, NULL); } else if (strcmp(arg, "-checksource") == 0 || @@ -1026,7 +1231,8 @@ ParseArguments(int *pargc, char ***pargv, char **pjarfile, arg); } else if (strncmp(arg, "-version:", 9) == 0 || strcmp(arg, "-no-jre-restrict-search") == 0 || - strcmp(arg, "-jre-restrict-search") == 0) { + strcmp(arg, "-jre-restrict-search") == 0 || + strncmp(arg, "-splash:", 8) == 0) { ; /* Ignore machine independent options already handled */ } else if (RemovableMachineDependentOption(arg) ) { ; /* Do not pass option to vm. */ @@ -1080,7 +1286,7 @@ InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn) } r = ifn->CreateJavaVM(pvm, (void **)penv, &args); - free(options); + JLI_MemFree(options); return r == JNI_OK; } @@ -1088,21 +1294,6 @@ InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn) #define NULL_CHECK0(e) if ((e) == 0) return 0 #define NULL_CHECK(e) if ((e) == 0) return -/* - * Returns a pointer to a block of at least 'size' bytes of memory. - * Prints error message and exits if the memory could not be allocated. - */ -void * -MemAlloc(size_t size) -{ - void *p = malloc(size); - if (p == 0) { - perror("malloc"); - exit(1); - } - return p; -} - static jstring platformEncoding = NULL; static jstring getPlatformEncoding(JNIEnv *env) { if (platformEncoding == NULL) { @@ -1110,7 +1301,7 @@ static jstring getPlatformEncoding(JNIEnv *env) { if (propname) { jclass cls; jmethodID mid; - NULL_CHECK0 (cls = FindBootStrapClass(env, "java/lang/System")); + NULL_CHECK0 (cls = (*env)->FindClass(env, "java/lang/System")); NULL_CHECK0 (mid = (*env)->GetStaticMethodID( env, cls, "getProperty", @@ -1125,12 +1316,12 @@ static jstring getPlatformEncoding(JNIEnv *env) { static jboolean isEncodingSupported(JNIEnv *env, jstring enc) { jclass cls; jmethodID mid; - NULL_CHECK0 (cls = FindBootStrapClass(env, "java/nio/charset/Charset")); + NULL_CHECK0 (cls = (*env)->FindClass(env, "java/nio/charset/Charset")); NULL_CHECK0 (mid = (*env)->GetStaticMethodID( env, cls, "isSupported", "(Ljava/lang/String;)Z")); - return (*env)->CallStaticBooleanMethod (env, cls, mid, enc); + return (*env)->CallStaticBooleanMethod(env, cls, mid, enc); } /* @@ -1154,14 +1345,8 @@ NewPlatformString(JNIEnv *env, char *s) jstring str = 0; (*env)->SetByteArrayRegion(env, ary, 0, len, (jbyte *)s); if (!(*env)->ExceptionOccurred(env)) { -#ifdef GAMMA - /* We support running JVM with older JDK, so here we have to deal */ - /* with the case that sun.jnu.encoding is undefined (enc == NULL) */ - if (enc != NULL && isEncodingSupported(env, enc) == JNI_TRUE) { -#else if (isEncodingSupported(env, enc) == JNI_TRUE) { -#endif - NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String")); + NULL_CHECK0(cls = (*env)->FindClass(env, "java/lang/String")); NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "", "([BLjava/lang/String;)V")); str = (*env)->NewObject(env, cls, mid, ary, enc); @@ -1172,7 +1357,7 @@ NewPlatformString(JNIEnv *env, char *s) the encoding name, in which the StringCoding class will pickup the iso-8859-1 as the fallback converter for us. */ - NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String")); + NULL_CHECK0(cls = (*env)->FindClass(env, "java/lang/String")); NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "", "([B)V")); str = (*env)->NewObject(env, cls, mid, ary); @@ -1195,7 +1380,7 @@ NewPlatformStringArray(JNIEnv *env, char **strv, int strc) jarray ary; int i; - NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String")); + NULL_CHECK0(cls = (*env)->FindClass(env, "java/lang/String")); NULL_CHECK0(ary = (*env)->NewObjectArray(env, strc, cls, 0)); for (i = 0; i < strc; i++) { jstring str = NewPlatformString(env, *strv++); @@ -1212,7 +1397,7 @@ NewPlatformStringArray(JNIEnv *env, char **strv, int strc) static jclass LoadClass(JNIEnv *env, char *name) { - char *buf = MemAlloc(strlen(name) + 1); + char *buf = JLI_MemAlloc(strlen(name) + 1); char *s = buf, *t = name, c; jclass cls; jlong start, end; @@ -1224,9 +1409,8 @@ LoadClass(JNIEnv *env, char *name) c = *t++; *s++ = (c == '.') ? '/' : c; } while (c != '\0'); - // use the application class loader for main-class cls = (*env)->FindClass(env, buf); - free(buf); + JLI_MemFree(buf); if (_launcher_debug) { end = CounterGet(); @@ -1251,7 +1435,7 @@ GetMainClassName(JNIEnv *env, char *jarname) jobject jar, man, attr; jstring str, result = 0; - NULL_CHECK0(cls = FindBootStrapClass(env, "java/util/jar/JarFile")); + NULL_CHECK0(cls = (*env)->FindClass(env, "java/util/jar/JarFile")); NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "", "(Ljava/lang/String;)V")); NULL_CHECK0(str = NewPlatformString(env, jarname)); @@ -1282,16 +1466,18 @@ static char *java_args[] = JAVA_ARGS; static char *app_classpath[] = APP_CLASSPATH; /* - * For tools convert 'javac -J-ms32m' to 'java -ms32m ...' + * For tools, convert command line args thus: + * javac -cp foo:foo/"*" -J-ms32m ... + * java -ms32m -cp JLI_WildcardExpandClasspath(foo:foo/"*") ... */ static void -TranslateDashJArgs(int *pargc, char ***pargv) +TranslateApplicationArgs(int *pargc, char ***pargv) { const int NUM_ARGS = (sizeof(java_args) / sizeof(char *)); int argc = *pargc; char **argv = *pargv; int nargc = argc + NUM_ARGS; - char **nargv = MemAlloc((nargc + 1) * sizeof(char *)); + char **nargv = JLI_MemAlloc((nargc + 1) * sizeof(char *)); int i; *pargc = nargc; @@ -1326,9 +1512,22 @@ TranslateDashJArgs(int *pargc, char ***pargv) } for (i = 0; i < argc; i++) { char *arg = argv[i]; - if (arg[0] != '-' || arg[1] != 'J') { - *nargv++ = arg; + if (arg[0] == '-') { + if (arg[1] == 'J') + continue; +#ifdef EXPAND_CLASSPATH_WILDCARDS + if (arg[1] == 'c' + && (strcmp(arg, "-cp") == 0 || + strcmp(arg, "-classpath") == 0) + && i < argc - 1) { + *nargv++ = arg; + *nargv++ = (char *) JLI_WildcardExpandClasspath(argv[i+1]); + i++; + continue; + } +#endif } + *nargv++ = arg; } *nargv = 0; } @@ -1350,18 +1549,21 @@ static jboolean AddApplicationOptions() { const int NUM_APP_CLASSPATH = (sizeof(app_classpath) / sizeof(char *)); - char *s, *envcp, *appcp, *apphome; + char *envcp, *appcp, *apphome; char home[MAXPATHLEN]; /* application home */ char separator[] = { PATH_SEPARATOR, '\0' }; int size, i; int strlenHome; - s = getenv("CLASSPATH"); - if (s) { - /* 40 for -Denv.class.path= */ - envcp = (char *)MemAlloc(strlen(s) + 40); - sprintf(envcp, "-Denv.class.path=%s", s); - AddOption(envcp, NULL); + { + const char *s = getenv("CLASSPATH"); + if (s) { + s = (char *) JLI_WildcardExpandClasspath(s); + /* 40 for -Denv.class.path= */ + envcp = (char *)JLI_MemAlloc(strlen(s) + 40); + sprintf(envcp, "-Denv.class.path=%s", s); + AddOption(envcp, NULL); + } } if (!GetApplicationHome(home, sizeof(home))) { @@ -1370,7 +1572,7 @@ AddApplicationOptions() } /* 40 for '-Dapplication.home=' */ - apphome = (char *)MemAlloc(strlen(home) + 40); + apphome = (char *)JLI_MemAlloc(strlen(home) + 40); sprintf(apphome, "-Dapplication.home=%s", home); AddOption(apphome, NULL); @@ -1380,7 +1582,7 @@ AddApplicationOptions() for (i = 0; i < NUM_APP_CLASSPATH; i++) { size += strlenHome + (int)strlen(app_classpath[i]) + 1; /* 1: separator */ } - appcp = (char *)MemAlloc(size + 1); + appcp = (char *)JLI_MemAlloc(size + 1); strcpy(appcp, "-Djava.class.path="); for (i = 0; i < NUM_APP_CLASSPATH; i++) { strcat(appcp, home); /* c:\program files\myapp */ @@ -1391,7 +1593,7 @@ AddApplicationOptions() AddOption(appcp, NULL); return JNI_TRUE; } -#endif +#endif /* JAVA_ARGS */ /* * inject the -Dsun.java.command pseudo property into the args structure @@ -1433,7 +1635,7 @@ SetJavaCommandLineProp(char *classname, char *jarfile, } /* allocate the memory */ - javaCommand = (char*) MemAlloc(len + strlen(dashDstr) + 1); + javaCommand = (char*) JLI_MemAlloc(len + strlen(dashDstr) + 1); /* build the -D string */ *javaCommand = '\0'; @@ -1455,13 +1657,12 @@ SetJavaCommandLineProp(char *classname, char *jarfile, } /* - * JVM wants to know launcher type, so tell it. + * JVM would like to know if it's created by a standard Sun launcher, or by + * user native application, the following property indicates the former. */ -#ifdef GAMMA void SetJavaLauncherProp() { AddOption("-Dsun.java.launcher=" LAUNCHER_TYPE, NULL); } -#endif /* * Prints the version information from the java.version and other properties. @@ -1472,7 +1673,7 @@ PrintJavaVersion(JNIEnv *env) jclass ver; jmethodID print; - NULL_CHECK(ver = FindBootStrapClass(env, "sun/misc/Version")); + NULL_CHECK(ver = (*env)->FindClass(env, "sun/misc/Version")); NULL_CHECK(print = (*env)->GetStaticMethodID(env, ver, "print", "()V")); (*env)->CallStaticVoidMethod(env, ver, print); @@ -1484,7 +1685,9 @@ PrintJavaVersion(JNIEnv *env) static void PrintUsage(void) { +#ifndef GAMMA int i; +#endif fprintf(stdout, "Usage: %s [-options] class [args...]\n" @@ -1515,7 +1718,6 @@ PrintUsage(void) "the \"%s\" VM [deprecated]\n", knownVMs[i].name, knownVMs[i].alias+1); } - /* The first known VM is the default */ { const char* defaultVM = knownVMs[0].name+1; @@ -1568,6 +1770,8 @@ PrintUsage(void) " load native agent library by full pathname\n" " -javaagent:[=]\n" " load Java programming language agent, see java.lang.instrument\n" +" -splash:\n" +" show splash screen with specified image\n" ,PATH_SEPARATOR); } @@ -1576,14 +1780,21 @@ PrintUsage(void) * Print usage message for -X options. */ static jint -PrintXUsage(void) +PrintXUsage(const char *jvmpath) { - char path[MAXPATHLEN]; + /* + A 32 bit cushion to prevent buffer overrun, noting that + fopen(3C) may fail if the buffer exceeds MAXPATHLEN. + */ + char path[MAXPATHLEN+32]; char buf[128]; size_t n; FILE *fp; + static const char Xusage_txt[] = "/Xusage.txt"; - GetXUsagePath(path, sizeof(path)); + strcpy(path, jvmpath); + /* Note the FILE_SEPARATOR is platform dependent */ + strcpy(strrchr(path, FILE_SEPARATOR), Xusage_txt); fp = fopen(path, "r"); if (fp == 0) { fprintf(stderr, "Can't open %s\n", path); @@ -1597,7 +1808,6 @@ PrintXUsage(void) } #ifndef GAMMA - /* * Read the jvm.cfg file and fill the knownJVMs[] array. * @@ -1660,8 +1870,8 @@ ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative) jlong start, end; int vmType; char *tmpPtr; - char *altVMName; - char *serverClassVMName; + char *altVMName = NULL; + char *serverClassVMName = NULL; static char *whiteSpace = " \t"; if (_launcher_debug) { start = CounterGet(); @@ -1700,7 +1910,7 @@ ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative) fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n", lineno, jvmCfgName); } else { - /* Null-terminate this string for strdup below */ + /* Null-terminate this string for JLI_StringDup below */ *tmpPtr++ = 0; tmpPtr += strspn(tmpPtr, whiteSpace); if (*tmpPtr == 0) { @@ -1758,20 +1968,20 @@ ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative) if (_launcher_debug) printf("jvm.cfg[%d] = ->%s<-\n", cnt, line); if (vmType != VM_UNKNOWN) { - knownVMs[cnt].name = strdup(line); + knownVMs[cnt].name = JLI_StringDup(line); knownVMs[cnt].flag = vmType; switch (vmType) { default: break; case VM_ALIASED_TO: - knownVMs[cnt].alias = strdup(altVMName); + knownVMs[cnt].alias = JLI_StringDup(altVMName); if (_launcher_debug) { printf(" name: %s vmType: %s alias: %s\n", knownVMs[cnt].name, "VM_ALIASED_TO", knownVMs[cnt].alias); } break; case VM_IF_SERVER_CLASS: - knownVMs[cnt].server_class = strdup(serverClassVMName); + knownVMs[cnt].server_class = JLI_StringDup(serverClassVMName); if (_launcher_debug) { printf(" name: %s vmType: %s server_class: %s\n", knownVMs[cnt].name, "VM_IF_SERVER_CLASS", knownVMs[cnt].server_class); @@ -1804,11 +2014,11 @@ GrowKnownVMs(int minimum) if (newMax <= minimum) { newMax = minimum; } - newKnownVMs = (struct vmdesc*) MemAlloc(newMax * sizeof(struct vmdesc)); + newKnownVMs = (struct vmdesc*) JLI_MemAlloc(newMax * sizeof(struct vmdesc)); if (knownVMs != NULL) { memcpy(newKnownVMs, knownVMs, knownVMsLimit * sizeof(struct vmdesc)); } - free(knownVMs); + JLI_MemFree(knownVMs); knownVMs = newKnownVMs; knownVMsLimit = newMax; } @@ -1833,10 +2043,38 @@ FreeKnownVMs() { int i; for (i = 0; i < knownVMsCount; i++) { - free(knownVMs[i].name); + JLI_MemFree(knownVMs[i].name); knownVMs[i].name = NULL; } - free(knownVMs); + JLI_MemFree(knownVMs); +} + + +/* + * Displays the splash screen according to the jar file name + * and image file names stored in environment variables + */ +static void +ShowSplashScreen() +{ + const char *jar_name = getenv(SPLASH_JAR_ENV_ENTRY); + const char *file_name = getenv(SPLASH_FILE_ENV_ENTRY); + int data_size; + void *image_data; + if (jar_name) { + image_data = JLI_JarUnpackFile(jar_name, file_name, &data_size); + if (image_data) { + DoSplashInit(); + DoSplashLoadMemory(image_data, data_size); + JLI_MemFree(image_data); + } + } else if (file_name) { + DoSplashInit(); + DoSplashLoadFile(file_name); + } else { + return; + } + DoSplashSetFileJarName(file_name, jar_name); } #endif /* ifndef GAMMA */ diff --git a/hotspot/src/os/solaris/launcher/java.h b/hotspot/src/share/tools/launcher/java.h similarity index 81% rename from hotspot/src/os/solaris/launcher/java.h rename to hotspot/src/share/tools/launcher/java.h index 488e1376eab..97fba2184f7 100644 --- a/hotspot/src/os/solaris/launcher/java.h +++ b/hotspot/src/share/tools/launcher/java.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ * */ -/* - * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK, - * search "GAMMA" for gamma specific changes. - */ #ifndef _JAVA_H_ #define _JAVA_H_ @@ -35,6 +31,7 @@ */ #include "jni.h" #include "java_md.h" +#include "jli_util.h" /* * Pointers to the needed JNI invocation API, initialized by LoadJavaVM. @@ -89,27 +86,26 @@ void ReportExceptionDescription(JNIEnv * env); jboolean RemovableMachineDependentOption(char * option); void PrintMachineDependentOptions(); +const char *jlong_format_specifier(); +/* + * Block current thread and continue execution in new thread + */ +int ContinueInNewThread(int (JNICALL *continuation)(void *), + jlong stack_size, void * args); + +/* sun.java.launcher.* platform properties. */ +void SetJavaLauncherPlatformProps(void); + /* * Functions defined in java.c and used in java_md.c. */ jint ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative); char *CheckJvmType(int *argc, char ***argv, jboolean speculative); -void* MemAlloc(size_t size); +void AddOption(char *str, void *info); /* * Make launcher spit debug output. */ extern jboolean _launcher_debug; -/* - * This allows for finding classes from the VM's bootstrap class loader - * directly, FindClass uses the application class loader internally, this will - * cause unnecessary searching of the classpath for the required classes. - */ -typedef jclass (JNICALL FindClassFromBootLoader_t(JNIEnv *env, - const char *name, - jboolean throwError)); - -jclass FindBootStrapClass(JNIEnv *env, const char *classname); - #endif /* _JAVA_H_ */ diff --git a/hotspot/src/share/tools/launcher/jli_util.c b/hotspot/src/share/tools/launcher/jli_util.c new file mode 100644 index 00000000000..36b164e3d37 --- /dev/null +++ b/hotspot/src/share/tools/launcher/jli_util.c @@ -0,0 +1,89 @@ + +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include +#include +#include "jli_util.h" + +#ifdef GAMMA +#ifdef TARGET_OS_FAMILY_windows +#define strdup _strdup +#endif +#endif + +/* + * Returns a pointer to a block of at least 'size' bytes of memory. + * Prints error message and exits if the memory could not be allocated. + */ +void * +JLI_MemAlloc(size_t size) +{ + void *p = malloc(size); + if (p == 0) { + perror("malloc"); + exit(1); + } + return p; +} + +/* + * Equivalent to realloc(size). + * Prints error message and exits if the memory could not be reallocated. + */ +void * +JLI_MemRealloc(void *ptr, size_t size) +{ + void *p = realloc(ptr, size); + if (p == 0) { + perror("realloc"); + exit(1); + } + return p; +} + +/* + * Wrapper over strdup(3C) which prints an error message and exits if memory + * could not be allocated. + */ +char * +JLI_StringDup(const char *s1) +{ + char *s = strdup(s1); + if (s == NULL) { + perror("strdup"); + exit(1); + } + return s; +} + +/* + * Very equivalent to free(ptr). + * Here to maintain pairing with the above routines. + */ +void +JLI_MemFree(void *ptr) +{ + free(ptr); +} diff --git a/hotspot/src/os/windows/vm/objectMonitor_windows.cpp b/hotspot/src/share/tools/launcher/jli_util.h similarity index 76% rename from hotspot/src/os/windows/vm/objectMonitor_windows.cpp rename to hotspot/src/share/tools/launcher/jli_util.h index 0410186f51f..535f7c482c1 100644 --- a/hotspot/src/os/windows/vm/objectMonitor_windows.cpp +++ b/hotspot/src/share/tools/launcher/jli_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,4 +22,14 @@ * */ -#include "incls/_precompiled.incl" +#ifndef _JLI_UTIL_H +#define _JLI_UTIL_H + +#include + +void *JLI_MemAlloc(size_t size); +void *JLI_MemRealloc(void *ptr, size_t size); +char *JLI_StringDup(const char *s1); +void JLI_MemFree(void *ptr); + +#endif /* _JLI_UTIL_H */ diff --git a/hotspot/src/share/tools/launcher/wildcard.c b/hotspot/src/share/tools/launcher/wildcard.c new file mode 100644 index 00000000000..26a66566cdb --- /dev/null +++ b/hotspot/src/share/tools/launcher/wildcard.c @@ -0,0 +1,494 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * Class-Path Wildcards + * + * The syntax for wildcards is a single asterisk. The class path + * foo/"*", e.g., loads all jar files in the directory named foo. + * (This requires careful quotation when used in shell scripts.) + * + * Only files whose names end in .jar or .JAR are matched. + * Files whose names end in .zip, or which have a particular + * magic number, regardless of filename extension, are not + * matched. + * + * Files are considered regardless of whether or not they are + * "hidden" in the UNIX sense, i.e., have names beginning with '.'. + * + * A wildcard only matches jar files, not class files in the same + * directory. If you want to load both class files and jar files from + * a single directory foo then you can say foo:foo/"*", or foo/"*":foo + * if you want the jar files to take precedence. + * + * Subdirectories are not searched recursively, i.e., foo/"*" only + * looks for jar files in foo, not in foo/bar, foo/baz, etc. + * + * Expansion of wildcards is done early, prior to the invocation of a + * program's main method, rather than late, during the class-loading + * process itself. Each element of the input class path containing a + * wildcard is replaced by the (possibly empty) sequence of elements + * generated by enumerating the jar files in the named directory. If + * the directory foo contains a.jar, b.jar, and c.jar, + * e.g., then the class path foo/"*" is expanded into + * foo/a.jar:foo/b.jar:foo/c.jar, and that string would be the value + * of the system property java.class.path. + * + * The order in which the jar files in a directory are enumerated in + * the expanded class path is not specified and may vary from platform + * to platform and even from moment to moment on the same machine. A + * well-constructed application should not depend upon any particular + * order. If a specific order is required then the jar files can be + * enumerated explicitly in the class path. + * + * The CLASSPATH environment variable is not treated any differently + * from the -classpath (equiv. -cp) command-line option, + * i.e. wildcards are honored in all these cases. + * + * Class-path wildcards are not honored in the Class-Path jar-manifest + * header. + * + * Class-path wildcards are honored not only by the Java launcher but + * also by most other command-line tools that accept class paths, and + * in particular by javac and javadoc. + * + * Class-path wildcards are not honored in any other kind of path, and + * especially not in the bootstrap class path, which is a mere + * artifact of our implementation and not something that developers + * should use. + * + * Classpath wildcards are only expanded in the Java launcher code, + * supporting the use of wildcards on the command line and in the + * CLASSPATH environment variable. We do not support the use of + * wildcards by applications that embed the JVM. + */ + +#include +#include +#include +#include +#include +#include "java.h" /* Strictly for PATH_SEPARATOR/FILE_SEPARATOR */ +#include "jli_util.h" + +#ifdef _WIN32 +#include +#else /* Unix */ +#include +#include +#endif /* Unix */ + +static int +exists(const char* filename) +{ +#ifdef _WIN32 + return _access(filename, 0) == 0; +#else + return access(filename, F_OK) == 0; +#endif +} + +#define NEW_(TYPE) ((TYPE) JLI_MemAlloc(sizeof(struct TYPE##_))) + +/* + * Wildcard directory iteration. + * WildcardIterator_for(wildcard) returns an iterator. + * Each call to that iterator's next() method returns the basename + * of an entry in the wildcard's directory. The basename's memory + * belongs to the iterator. The caller is responsible for prepending + * the directory name and file separator, if necessary. + * When done with the iterator, call the close method to clean up. + */ +typedef struct WildcardIterator_* WildcardIterator; + +#ifdef _WIN32 +struct WildcardIterator_ +{ + HANDLE handle; + char *firstFile; /* Stupid FindFirstFile...FindNextFile */ +}; + +static WildcardIterator +WildcardIterator_for(const char *wildcard) +{ + WIN32_FIND_DATA find_data; + WildcardIterator it = NEW_(WildcardIterator); + HANDLE handle = FindFirstFile(wildcard, &find_data); + if (handle == INVALID_HANDLE_VALUE) + return NULL; + it->handle = handle; + it->firstFile = find_data.cFileName; + return it; +} + +static char * +WildcardIterator_next(WildcardIterator it) +{ + WIN32_FIND_DATA find_data; + if (it->firstFile != NULL) { + char *firstFile = it->firstFile; + it->firstFile = NULL; + return firstFile; + } + return FindNextFile(it->handle, &find_data) + ? find_data.cFileName : NULL; +} + +static void +WildcardIterator_close(WildcardIterator it) +{ + if (it) { + FindClose(it->handle); + JLI_MemFree(it->firstFile); + JLI_MemFree(it); + } +} + +#else /* Unix */ +struct WildcardIterator_ +{ + DIR *dir; +}; + +static WildcardIterator +WildcardIterator_for(const char *wildcard) +{ + DIR *dir; + int wildlen = strlen(wildcard); + if (wildlen < 2) { + dir = opendir("."); + } else { + char *dirname = JLI_StringDup(wildcard); + dirname[wildlen - 1] = '\0'; + dir = opendir(dirname); + JLI_MemFree(dirname); + } + if (dir == NULL) + return NULL; + else { + WildcardIterator it = NEW_(WildcardIterator); + it->dir = dir; + return it; + } +} + +static char * +WildcardIterator_next(WildcardIterator it) +{ + struct dirent* dirp = readdir(it->dir); + return dirp ? dirp->d_name : NULL; +} + +static void +WildcardIterator_close(WildcardIterator it) +{ + if (it) { + closedir(it->dir); + JLI_MemFree(it); + } +} +#endif /* Unix */ + +static int +equal(const char *s1, const char *s2) +{ + return strcmp(s1, s2) == 0; +} + +/* + * FileList ADT - a dynamic list of C filenames + */ +struct FileList_ +{ + char **files; + int size; + int capacity; +}; +typedef struct FileList_ *FileList; + +static FileList +FileList_new(int capacity) +{ + FileList fl = NEW_(FileList); + fl->capacity = capacity; + fl->files = (char **) JLI_MemAlloc(capacity * sizeof(fl->files[0])); + fl->size = 0; + return fl; +} + +#ifdef DEBUG_WILDCARD +static void +FileList_print(FileList fl) +{ + int i; + putchar('['); + for (i = 0; i < fl->size; i++) { + if (i > 0) printf(", "); + printf("\"%s\"",fl->files[i]); + } + putchar(']'); +} +#endif + +static void +FileList_free(FileList fl) +{ + if (fl) { + if (fl->files) { + int i; + for (i = 0; i < fl->size; i++) + JLI_MemFree(fl->files[i]); + JLI_MemFree(fl->files); + } + JLI_MemFree(fl); + } +} + +static void +FileList_ensureCapacity(FileList fl, int capacity) +{ + if (fl->capacity < capacity) { + while (fl->capacity < capacity) + fl->capacity *= 2; + fl->files = JLI_MemRealloc(fl->files, + fl->capacity * sizeof(fl->files[0])); + } +} + +static void +FileList_add(FileList fl, char *file) +{ + FileList_ensureCapacity(fl, fl->size+1); + fl->files[fl->size++] = file; +} + +static void +FileList_addSubstring(FileList fl, const char *beg, int len) +{ + char *filename = (char *) JLI_MemAlloc(len+1); + memcpy(filename, beg, len); + filename[len] = '\0'; + FileList_ensureCapacity(fl, fl->size+1); + fl->files[fl->size++] = filename; +} + +static char * +FileList_join(FileList fl, char sep) +{ + int i; + int size; + char *path; + char *p; + for (i = 0, size = 1; i < fl->size; i++) + size += strlen(fl->files[i]) + 1; + + path = JLI_MemAlloc(size); + + for (i = 0, p = path; i < fl->size; i++) { + int len = strlen(fl->files[i]); + if (i > 0) *p++ = sep; + memcpy(p, fl->files[i], len); + p += len; + } + *p = '\0'; + + return path; +} + +static FileList +FileList_split(const char *path, char sep) +{ + const char *p, *q; + int len = strlen(path); + int count; + FileList fl; + for (count = 1, p = path; p < path + len; p++) + count += (*p == sep); + fl = FileList_new(count); + for (p = path;;) { + for (q = p; q <= path + len; q++) { + if (*q == sep || *q == '\0') { + FileList_addSubstring(fl, p, q - p); + if (*q == '\0') + return fl; + p = q + 1; + } + } + } +} + +static int +isJarFileName(const char *filename) +{ + int len = strlen(filename); + return (len >= 4) && + (filename[len - 4] == '.') && + (equal(filename + len - 3, "jar") || + equal(filename + len - 3, "JAR")) && + /* Paranoia: Maybe filename is "DIR:foo.jar" */ + (strchr(filename, PATH_SEPARATOR) == NULL); +} + +static char * +wildcardConcat(const char *wildcard, const char *basename) +{ + int wildlen = strlen(wildcard); + int baselen = strlen(basename); + char *filename = (char *) JLI_MemAlloc(wildlen + baselen); + /* Replace the trailing '*' with basename */ + memcpy(filename, wildcard, wildlen-1); + memcpy(filename+wildlen-1, basename, baselen+1); + return filename; +} + +static FileList +wildcardFileList(const char *wildcard) +{ + const char *basename; + FileList fl = FileList_new(16); + WildcardIterator it = WildcardIterator_for(wildcard); + if (it == NULL) + return NULL; + while ((basename = WildcardIterator_next(it)) != NULL) + if (isJarFileName(basename)) + FileList_add(fl, wildcardConcat(wildcard, basename)); + WildcardIterator_close(it); + return fl; +} + +static int +isWildcard(const char *filename) +{ + int len = strlen(filename); + return (len > 0) && + (filename[len - 1] == '*') && + (len == 1 || IS_FILE_SEPARATOR(filename[len - 2])) && + (! exists(filename)); +} + +static void +FileList_expandWildcards(FileList fl) +{ + int i, j; + for (i = 0; i < fl->size; i++) { + if (isWildcard(fl->files[i])) { + FileList expanded = wildcardFileList(fl->files[i]); + if (expanded != NULL && expanded->size > 0) { + JLI_MemFree(fl->files[i]); + FileList_ensureCapacity(fl, fl->size + expanded->size); + for (j = fl->size - 1; j >= i+1; j--) + fl->files[j+expanded->size-1] = fl->files[j]; + for (j = 0; j < expanded->size; j++) + fl->files[i+j] = expanded->files[j]; + i += expanded->size - 1; + fl->size += expanded->size - 1; + /* fl expropriates expanded's elements. */ + expanded->size = 0; + } + FileList_free(expanded); + } + } +} + +const char * +JLI_WildcardExpandClasspath(const char *classpath) +{ + char *expanded; + FileList fl; + + if (strchr(classpath, '*') == NULL) + return classpath; + fl = FileList_split(classpath, PATH_SEPARATOR); + FileList_expandWildcards(fl); + expanded = FileList_join(fl, PATH_SEPARATOR); + FileList_free(fl); + if (getenv("_JAVA_LAUNCHER_DEBUG") != 0) + printf("Expanded wildcards:\n" + " before: \"%s\"\n" + " after : \"%s\"\n", + classpath, expanded); + return expanded; +} + +#ifdef DEBUG_WILDCARD +static void +wildcardExpandArgv(const char ***argv) +{ + int i; + for (i = 0; (*argv)[i]; i++) { + if (equal((*argv)[i], "-cp") || + equal((*argv)[i], "-classpath")) { + i++; + (*argv)[i] = wildcardExpandClasspath((*argv)[i]); + } + } +} + +static void +debugPrintArgv(char *argv[]) +{ + int i; + putchar('['); + for (i = 0; argv[i]; i++) { + if (i > 0) printf(", "); + printf("\"%s\"", argv[i]); + } + printf("]\n"); +} + +int +main(int argc, char *argv[]) +{ + argv[0] = "java"; + wildcardExpandArgv((const char***)&argv); + debugPrintArgv(argv); + /* execvp("java", argv); */ + return 0; +} +#endif /* DEBUG_WILDCARD */ + +/* Cute little perl prototype implementation.... + +my $sep = ($^O =~ /^(Windows|cygwin)/) ? ";" : ":"; + +sub expand($) { + opendir DIR, $_[0] or return $_[0]; + join $sep, map {"$_[0]/$_"} grep {/\.(jar|JAR)$/} readdir DIR; +} + +sub munge($) { + join $sep, + map {(! -r $_ and s/[\/\\]+\*$//) ? expand $_ : $_} split $sep, $_[0]; +} + +for (my $i = 0; $i < @ARGV - 1; $i++) { + $ARGV[$i+1] = munge $ARGV[$i+1] if $ARGV[$i] =~ /^-c(p|lasspath)$/; +} + +$ENV{CLASSPATH} = munge $ENV{CLASSPATH} if exists $ENV{CLASSPATH}; +@ARGV = ("java", @ARGV); +print "@ARGV\n"; +exec @ARGV; + +*/ diff --git a/hotspot/src/os/solaris/vm/objectMonitor_solaris.hpp b/hotspot/src/share/tools/launcher/wildcard.h similarity index 77% rename from hotspot/src/os/solaris/vm/objectMonitor_solaris.hpp rename to hotspot/src/share/tools/launcher/wildcard.h index 0b4fc2f7138..5cdd9312cd4 100644 --- a/hotspot/src/os/solaris/vm/objectMonitor_solaris.hpp +++ b/hotspot/src/share/tools/launcher/wildcard.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,4 +22,13 @@ * */ - private: +#ifndef WILDCARD_H_ +#define WILDCARD_H_ + +#ifdef EXPAND_CLASSPATH_WILDCARDS +const char *JLI_WildcardExpandClasspath(const char *classpath); +#else +#define JLI_WildcardExpandClasspath(s) (s) +#endif + +#endif /* include guard */ diff --git a/hotspot/src/share/vm/adlc/adlc.hpp b/hotspot/src/share/vm/adlc/adlc.hpp index cbc735d27a8..3e00570f1e8 100644 --- a/hotspot/src/share/vm/adlc/adlc.hpp +++ b/hotspot/src/share/vm/adlc/adlc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_ADLC_ADLC_HPP +#define SHARE_VM_ADLC_ADLC_HPP + // // Standard include file for ADLC parser // @@ -77,18 +80,19 @@ typedef unsigned int uintptr_t; #define uint32 unsigned int #define uint unsigned int +// VM components +#include "opto/opcodes.hpp" + // Macros // Debugging note: Put a breakpoint on "abort". #undef assert #define assert(cond, msg) { if (!(cond)) { fprintf(stderr, "assert fails %s %d: %s\n", __FILE__, __LINE__, msg); abort(); }} +#undef max #define max(a, b) (((a)>(b)) ? (a) : (b)) -// VM components -#include "opcodes.hpp" - // ADLC components #include "arena.hpp" -#include "adlcVMDeps.hpp" +#include "opto/adlcVMDeps.hpp" #include "filebuff.hpp" #include "dict2.hpp" #include "forms.hpp" @@ -101,3 +105,5 @@ typedef unsigned int uintptr_t; // could have a backpointer to the AD but it's too complicated to pass // it everywhere it needs to be available. extern ArchDesc* globalAD; + +#endif // SHARE_VM_ADLC_ADLC_HPP diff --git a/hotspot/src/share/vm/adlc/adlparse.cpp b/hotspot/src/share/vm/adlc/adlparse.cpp index 4294471564b..c2d9ee0ab48 100644 --- a/hotspot/src/share/vm/adlc/adlparse.cpp +++ b/hotspot/src/share/vm/adlc/adlparse.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,7 +95,7 @@ void ADLParser::parse() { if (ident == NULL) { // Empty line continue; // Get the next line } - if (!strcmp(ident, "instruct")) instr_parse(); + if (!strcmp(ident, "instruct")) instr_parse(); else if (!strcmp(ident, "operand")) oper_parse(); else if (!strcmp(ident, "opclass")) opclass_parse(); else if (!strcmp(ident, "ins_attrib")) ins_attr_parse(); @@ -216,24 +216,23 @@ void ADLParser::instr_parse(void) { else if (!strcmp(ident, "encode")) { parse_err(SYNERR, "Instructions specify ins_encode, not encode\n"); } - else if (!strcmp(ident, "ins_encode")) - instr->_insencode = ins_encode_parse(*instr); - else if (!strcmp(ident, "opcode")) instr->_opcode = opcode_parse(instr); - else if (!strcmp(ident, "size")) instr->_size = size_parse(instr); - else if (!strcmp(ident, "effect")) effect_parse(instr); - else if (!strcmp(ident, "expand")) instr->_exprule = expand_parse(instr); - else if (!strcmp(ident, "rewrite")) instr->_rewrule = rewrite_parse(); + else if (!strcmp(ident, "ins_encode")) ins_encode_parse(*instr); + else if (!strcmp(ident, "opcode")) instr->_opcode = opcode_parse(instr); + else if (!strcmp(ident, "size")) instr->_size = size_parse(instr); + else if (!strcmp(ident, "effect")) effect_parse(instr); + else if (!strcmp(ident, "expand")) instr->_exprule = expand_parse(instr); + else if (!strcmp(ident, "rewrite")) instr->_rewrule = rewrite_parse(); else if (!strcmp(ident, "constraint")) { parse_err(SYNERR, "Instructions do not specify a constraint\n"); } else if (!strcmp(ident, "construct")) { parse_err(SYNERR, "Instructions do not specify a construct\n"); } - else if (!strcmp(ident, "format")) instr->_format = format_parse(); + else if (!strcmp(ident, "format")) instr->_format = format_parse(); else if (!strcmp(ident, "interface")) { parse_err(SYNERR, "Instructions do not specify an interface\n"); } - else if (!strcmp(ident, "ins_pipe")) ins_pipe_parse(*instr); + else if (!strcmp(ident, "ins_pipe")) ins_pipe_parse(*instr); else { // Done with staticly defined parts of instruction definition // Check identifier to see if it is the name of an attribute const Form *form = _globalNames[ident]; @@ -323,7 +322,8 @@ void ADLParser::adjust_set_rule(InstructForm *instr) { const char *optype2 = NULL; // Can not have additional base operands in right side of match! if ( ! right->base_operand( position, _globalNames, result2, name2, optype2) ) { - assert( instr->_predicate == NULL, "ADLC does not support instruction chain rules with predicates"); + if (instr->_predicate != NULL) + parse_err(SYNERR, "ADLC does not support instruction chain rules with predicates"); // Chain from input _ideal_operand_type_, // Needed for shared roots of match-trees ChainList *lst = (ChainList *)_AD._chainRules[optype]; @@ -935,9 +935,9 @@ void ADLParser::enc_class_parse_block(EncClass* encoding, char* ec_name) { // (2) // If we are at a replacement variable, // copy it and record in EncClass - if ( _curchar == '$' ) { + if (_curchar == '$') { // Found replacement Variable - char *rep_var = get_rep_var_ident_dup(); + char* rep_var = get_rep_var_ident_dup(); // Add flag to _strings list indicating we should check _rep_vars encoding->add_rep_var(rep_var); } @@ -2774,47 +2774,122 @@ Predicate *ADLParser::pred_parse(void) { //------------------------------ins_encode_parse_block------------------------- // Parse the block form of ins_encode. See ins_encode_parse for more details -InsEncode *ADLParser::ins_encode_parse_block(InstructForm &inst) { +void ADLParser::ins_encode_parse_block(InstructForm& inst) { // Create a new encoding name based on the name of the instruction // definition, which should be unique. - const char * prefix = "__enc_"; - char* ec_name = (char*)malloc(strlen(inst._ident) + strlen(prefix) + 1); + const char* prefix = "__ins_encode_"; + char* ec_name = (char*) malloc(strlen(inst._ident) + strlen(prefix) + 1); sprintf(ec_name, "%s%s", prefix, inst._ident); assert(_AD._encode->encClass(ec_name) == NULL, "shouldn't already exist"); - EncClass *encoding = _AD._encode->add_EncClass(ec_name); + EncClass* encoding = _AD._encode->add_EncClass(ec_name); encoding->_linenum = linenum(); // synthesize the arguments list for the enc_class from the // arguments to the instruct definition. - const char * param = NULL; + const char* param = NULL; inst._parameters.reset(); while ((param = inst._parameters.iter()) != NULL) { - OperandForm *opForm = (OperandForm*)inst._localNames[param]; + OperandForm* opForm = (OperandForm*) inst._localNames[param]; encoding->add_parameter(opForm->_ident, param); } - // Add the prologue to create the MacroAssembler - encoding->add_code("\n" - " // Define a MacroAssembler instance for use by the encoding. The\n" - " // name is chosen to match the __ idiom used for assembly in other\n" - " // parts of hotspot and assumes the existence of the standard\n" - " // #define __ _masm.\n" - " MacroAssembler _masm(&cbuf);\n"); + // Define a MacroAssembler instance for use by the encoding. The + // name is chosen to match the __ idiom used for assembly in other + // parts of hotspot and assumes the existence of the standard + // #define __ _masm. + encoding->add_code(" MacroAssembler _masm(&cbuf);\n"); // Parse the following %{ }% block - enc_class_parse_block(encoding, ec_name); + ins_encode_parse_block_impl(inst, encoding, ec_name); // Build an encoding rule which invokes the encoding rule we just // created, passing all arguments that we received. - InsEncode *encrule = new InsEncode(); // Encode class for instruction - NameAndList *params = encrule->add_encode(ec_name); + InsEncode* encrule = new InsEncode(); // Encode class for instruction + NameAndList* params = encrule->add_encode(ec_name); inst._parameters.reset(); while ((param = inst._parameters.iter()) != NULL) { params->add_entry(param); } - return encrule; + // Set encode class of this instruction. + inst._insencode = encrule; +} + + +void ADLParser::ins_encode_parse_block_impl(InstructForm& inst, EncClass* encoding, char* ec_name) { + skipws_no_preproc(); // Skip leading whitespace + // Prepend location descriptor, for debugging; cf. ADLParser::find_cpp_block + if (_AD._adlocation_debug) { + encoding->add_code(get_line_string()); + } + + // Collect the parts of the encode description + // (1) strings that are passed through to output + // (2) replacement/substitution variable, preceeded by a '$' + while ((_curchar != '%') && (*(_ptr+1) != '}')) { + + // (1) + // Check if there is a string to pass through to output + char *start = _ptr; // Record start of the next string + while ((_curchar != '$') && ((_curchar != '%') || (*(_ptr+1) != '}')) ) { + // If at the start of a comment, skip past it + if( (_curchar == '/') && ((*(_ptr+1) == '/') || (*(_ptr+1) == '*')) ) { + skipws_no_preproc(); + } else { + // ELSE advance to the next character, or start of the next line + next_char_or_line(); + } + } + // If a string was found, terminate it and record in EncClass + if (start != _ptr) { + *_ptr = '\0'; // Terminate the string + encoding->add_code(start); + } + + // (2) + // If we are at a replacement variable, + // copy it and record in EncClass + if (_curchar == '$') { + // Found replacement Variable + char* rep_var = get_rep_var_ident_dup(); + + // Add flag to _strings list indicating we should check _rep_vars + encoding->add_rep_var(rep_var); + + skipws(); + + // Check if this instruct is a MachConstantNode. + if (strcmp(rep_var, "constanttablebase") == 0) { + // This instruct is a MachConstantNode. + inst.set_is_mach_constant(true); + + if (_curchar == '(') { + parse_err(SYNERR, "constanttablebase in instruct %s cannot have an argument (only constantaddress and constantoffset)", ec_name); + return; + } + } + else if ((strcmp(rep_var, "constantaddress") == 0) || + (strcmp(rep_var, "constantoffset") == 0)) { + // This instruct is a MachConstantNode. + inst.set_is_mach_constant(true); + + // If the constant keyword has an argument, parse it. + if (_curchar == '(') constant_parse(inst); + } + } + } // end while part of format description + next_char(); // Skip '%' + next_char(); // Skip '}' + + skipws(); + + if (_AD._adlocation_debug) { + encoding->add_code(end_line_marker()); + } + + // Debug Stuff + if (_AD._adl_debug > 1) fprintf(stderr, "EncodingClass Form: %s\n", ec_name); } @@ -2838,7 +2913,7 @@ InsEncode *ADLParser::ins_encode_parse_block(InstructForm &inst) { // // making it more compact to take advantage of the MacroAssembler and // placing the assembly closer to it's use by instructions. -InsEncode *ADLParser::ins_encode_parse(InstructForm &inst) { +void ADLParser::ins_encode_parse(InstructForm& inst) { // Parse encode class name skipws(); // Skip whitespace @@ -2849,11 +2924,12 @@ InsEncode *ADLParser::ins_encode_parse(InstructForm &inst) { next_char(); // Skip '{' // Parse the block form of ins_encode - return ins_encode_parse_block(inst); + ins_encode_parse_block(inst); + return; } parse_err(SYNERR, "missing '%%{' or '(' in ins_encode definition\n"); - return NULL; + return; } next_char(); // move past '(' skipws(); @@ -2866,7 +2942,7 @@ InsEncode *ADLParser::ins_encode_parse(InstructForm &inst) { ec_name = get_ident(); if (ec_name == NULL) { parse_err(SYNERR, "Invalid encode class name after 'ins_encode('.\n"); - return NULL; + return; } // Check that encoding is defined in the encode section EncClass *encode_class = _AD._encode->encClass(ec_name); @@ -2898,7 +2974,7 @@ InsEncode *ADLParser::ins_encode_parse(InstructForm &inst) { (Opcode::as_opcode_type(param) == Opcode::NOT_AN_OPCODE) && ((_AD._register == NULL ) || (_AD._register->getRegDef(param) == NULL)) ) { parse_err(SYNERR, "Using non-locally defined parameter %s for encoding %s.\n", param, ec_name); - return NULL; + return; } params->add_entry(param); @@ -2915,7 +2991,7 @@ InsEncode *ADLParser::ins_encode_parse(InstructForm &inst) { // Only ',' or ')' are valid after a parameter name parse_err(SYNERR, "expected ',' or ')' after parameter %s.\n", ec_name); - return NULL; + return; } } else { @@ -2923,11 +2999,11 @@ InsEncode *ADLParser::ins_encode_parse(InstructForm &inst) { // Did not find a parameter if (_curchar == ',') { parse_err(SYNERR, "Expected encode parameter before ',' in encoding %s.\n", ec_name); - return NULL; + return; } if (_curchar != ')') { parse_err(SYNERR, "Expected ')' after encode parameters.\n"); - return NULL; + return; } } } // WHILE loop collecting parameters @@ -2944,7 +3020,7 @@ InsEncode *ADLParser::ins_encode_parse(InstructForm &inst) { else if ( _curchar != ')' ) { // If not a ',' then only a ')' is allowed parse_err(SYNERR, "Expected ')' after encoding %s.\n", ec_name); - return NULL; + return; } // Check for ',' separating parameters @@ -2956,14 +3032,14 @@ InsEncode *ADLParser::ins_encode_parse(InstructForm &inst) { } // done parsing ins_encode methods and their parameters if (_curchar != ')') { parse_err(SYNERR, "Missing ')' at end of ins_encode description.\n"); - return NULL; + return; } next_char(); // move past ')' skipws(); // Skip leading whitespace if ( _curchar != ';' ) { parse_err(SYNERR, "Missing ';' at end of ins_encode.\n"); - return NULL; + return; } next_char(); // move past ';' skipws(); // be friendly to oper_parse() @@ -2971,7 +3047,113 @@ InsEncode *ADLParser::ins_encode_parse(InstructForm &inst) { // Debug Stuff if (_AD._adl_debug > 1) fprintf(stderr,"Instruction Encode: %s\n", ec_name); - return encrule; + // Set encode class of this instruction. + inst._insencode = encrule; +} + + +//------------------------------constant_parse--------------------------------- +// Parse a constant expression. +void ADLParser::constant_parse(InstructForm& inst) { + // Create a new encoding name based on the name of the instruction + // definition, which should be unique. + const char* prefix = "__constant_"; + char* ec_name = (char*) malloc(strlen(inst._ident) + strlen(prefix) + 1); + sprintf(ec_name, "%s%s", prefix, inst._ident); + + assert(_AD._encode->encClass(ec_name) == NULL, "shouldn't already exist"); + EncClass* encoding = _AD._encode->add_EncClass(ec_name); + encoding->_linenum = linenum(); + + // synthesize the arguments list for the enc_class from the + // arguments to the instruct definition. + const char* param = NULL; + inst._parameters.reset(); + while ((param = inst._parameters.iter()) != NULL) { + OperandForm* opForm = (OperandForm*) inst._localNames[param]; + encoding->add_parameter(opForm->_ident, param); + } + + // Parse the following ( ) expression. + constant_parse_expression(encoding, ec_name); + + // Build an encoding rule which invokes the encoding rule we just + // created, passing all arguments that we received. + InsEncode* encrule = new InsEncode(); // Encode class for instruction + NameAndList* params = encrule->add_encode(ec_name); + inst._parameters.reset(); + while ((param = inst._parameters.iter()) != NULL) { + params->add_entry(param); + } + + // Set encode class of this instruction. + inst._constant = encrule; +} + + +//------------------------------constant_parse_expression---------------------- +void ADLParser::constant_parse_expression(EncClass* encoding, char* ec_name) { + skipws(); + + // Prepend location descriptor, for debugging; cf. ADLParser::find_cpp_block + if (_AD._adlocation_debug) { + encoding->add_code(get_line_string()); + } + + // Start code line. + encoding->add_code(" _constant = C->constant_table().add"); + + // Parse everything in ( ) expression. + encoding->add_code("("); + next_char(); // Skip '(' + int parens_depth = 1; + + // Collect the parts of the constant expression. + // (1) strings that are passed through to output + // (2) replacement/substitution variable, preceeded by a '$' + while (parens_depth > 0) { + if (_curchar == '(') { + parens_depth++; + encoding->add_code("("); + next_char(); + } + else if (_curchar == ')') { + parens_depth--; + encoding->add_code(")"); + next_char(); + } + else { + // (1) + // Check if there is a string to pass through to output + char *start = _ptr; // Record start of the next string + while ((_curchar != '$') && (_curchar != '(') && (_curchar != ')')) { + next_char(); + } + // If a string was found, terminate it and record in EncClass + if (start != _ptr) { + *_ptr = '\0'; // Terminate the string + encoding->add_code(start); + } + + // (2) + // If we are at a replacement variable, copy it and record in EncClass. + if (_curchar == '$') { + // Found replacement Variable + char* rep_var = get_rep_var_ident_dup(); + encoding->add_rep_var(rep_var); + } + } + } + + // Finish code line. + encoding->add_code(";"); + + if (_AD._adlocation_debug) { + encoding->add_code(end_line_marker()); + } + + // Debug Stuff + if (_AD._adl_debug > 1) fprintf(stderr, "EncodingClass Form: %s\n", ec_name); } diff --git a/hotspot/src/share/vm/adlc/adlparse.hpp b/hotspot/src/share/vm/adlc/adlparse.hpp index ffeb336d074..ee33b88ef8e 100644 --- a/hotspot/src/share/vm/adlc/adlparse.hpp +++ b/hotspot/src/share/vm/adlc/adlparse.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_ADLC_ADLPARSE_HPP +#define SHARE_VM_ADLC_ADLPARSE_HPP + // ADLPARSE.HPP - Definitions for Architecture Description Language Parser // Authors: Chris Vick and Mike Paleczny @@ -153,8 +156,13 @@ protected: Attribute *attr_parse(char *ident);// Parse instr/operand attribute rule // Parse instruction encode rule - InsEncode *ins_encode_parse(InstructForm &inst); - InsEncode *ins_encode_parse_block(InstructForm &inst); + void ins_encode_parse(InstructForm &inst); + void ins_encode_parse_block(InstructForm &inst); + void ins_encode_parse_block_impl(InstructForm& inst, EncClass* encoding, char* ec_name); + + void constant_parse(InstructForm& inst); + void constant_parse_expression(EncClass* encoding, char* ec_name); + Opcode *opcode_parse(InstructForm *insr); // Parse instruction opcode char *size_parse(InstructForm *insr); // Parse instruction size Interface *interface_parse(); // Parse operand interface rule @@ -277,3 +285,5 @@ public: static bool equivalent_expressions(const char* str1, const char* str2); static void trim(char* &token); // trim leading & trailing spaces }; + +#endif // SHARE_VM_ADLC_ADLPARSE_HPP diff --git a/hotspot/src/share/vm/adlc/archDesc.cpp b/hotspot/src/share/vm/adlc/archDesc.cpp index 263f9e6e342..e751b54db0a 100644 --- a/hotspot/src/share/vm/adlc/archDesc.cpp +++ b/hotspot/src/share/vm/adlc/archDesc.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it @@ -1038,22 +1038,38 @@ void ArchDesc::addSunCopyright(char* legal, int size, FILE *fp) { fprintf(fp,"\n"); } -//---------------------------machineDependentIncludes-------------------------- -// output #include declarations for machine specific files -void ArchDesc::machineDependentIncludes(ADLFILE &adlfile) { - const char *basename = adlfile._name; - const char *cp; - for (cp = basename; *cp; cp++) - if (*cp == '/') basename = cp+1; +//---------------------------addIncludeGuardStart-------------------------- +// output the start of an include guard. +void ArchDesc::addIncludeGuardStart(ADLFILE &adlfile, const char* guardString) { // Build #include lines fprintf(adlfile._fp, "\n"); - fprintf(adlfile._fp, "#include \"incls/_precompiled.incl\"\n"); - fprintf(adlfile._fp, "#include \"incls/_%s.incl\"\n",basename); + fprintf(adlfile._fp, "#ifndef %s\n", guardString); + fprintf(adlfile._fp, "#define %s\n", guardString); fprintf(adlfile._fp, "\n"); } +//---------------------------addIncludeGuardEnd-------------------------- +// output the end of an include guard. +void ArchDesc::addIncludeGuardEnd(ADLFILE &adlfile, const char* guardString) { + // Build #include lines + fprintf(adlfile._fp, "\n"); + fprintf(adlfile._fp, "#endif // %s\n", guardString); + +} + +//---------------------------addInclude-------------------------- +// output the #include line for this file. +void ArchDesc::addInclude(ADLFILE &adlfile, const char* fileName) { + fprintf(adlfile._fp, "#include \"%s\"\n", fileName); + +} + +void ArchDesc::addInclude(ADLFILE &adlfile, const char* includeDir, const char* fileName) { + fprintf(adlfile._fp, "#include \"%s/%s\"\n", includeDir, fileName); + +} //---------------------------addPreprocessorChecks----------------------------- // Output C preprocessor code to verify the backend compilation environment. diff --git a/hotspot/src/share/vm/adlc/archDesc.hpp b/hotspot/src/share/vm/adlc/archDesc.hpp index 1904d1d368e..ad8f454be5a 100644 --- a/hotspot/src/share/vm/adlc/archDesc.hpp +++ b/hotspot/src/share/vm/adlc/archDesc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_ADLC_ARCHDESC_HPP +#define SHARE_VM_ADLC_ARCHDESC_HPP + // Definitions for Error Flags #define WARN 0 #define SYNERR 1 @@ -123,7 +126,6 @@ private: void chain_rule(FILE *fp, const char *indent, const char *ideal, const Expr *icost, const char *irule, Dict &operands_chained_from, ProductionState &status); - void chain_rule_c(FILE *fp, char *indent, char *ideal, char *irule); // %%%%% TODO: remove this void expand_opclass(FILE *fp, const char *indent, const Expr *cost, const char *result_type, ProductionState &status); Expr *calc_cost(FILE *fp, const char *spaces, MatchList &mList, ProductionState &status); @@ -274,8 +276,13 @@ public: // output SUN copyright info void addSunCopyright(char* legal, int size, FILE *fp); - // output #include declarations for machine specific files - void machineDependentIncludes(ADLFILE &adlfile); + // output the start of an include guard. + void addIncludeGuardStart(ADLFILE &adlfile, const char* guardString); + // output the end of an include guard. + void addIncludeGuardEnd(ADLFILE &adlfile, const char* guardString); + // output the #include line for this file. + void addInclude(ADLFILE &adlfile, const char* fileName); + void addInclude(ADLFILE &adlfile, const char* includeDir, const char* fileName); // Output C preprocessor code to verify the backend compilation environment. void addPreprocessorChecks(FILE *fp); // Output C source and header (source_hpp) blocks. @@ -293,13 +300,18 @@ public: void buildMachNodeGenerator(FILE *fp_cpp); // Generator for Expand methods for instructions with expand rules - void defineExpand(FILE *fp, InstructForm *node); + void defineExpand (FILE *fp, InstructForm *node); // Generator for Peephole methods for instructions with peephole rules - void definePeephole(FILE *fp, InstructForm *node); + void definePeephole (FILE *fp, InstructForm *node); // Generator for Size methods for instructions - void defineSize(FILE *fp, InstructForm &node); + void defineSize (FILE *fp, InstructForm &node); + +public: + // Generator for EvalConstantValue methods for instructions + void defineEvalConstant(FILE *fp, InstructForm &node); // Generator for Emit methods for instructions - void defineEmit(FILE *fp, InstructForm &node); + void defineEmit (FILE *fp, InstructForm &node); + // Define a MachOper encode method void define_oper_interface(FILE *fp, OperandForm &oper, FormDict &globals, const char *name, const char *encoding); @@ -387,3 +399,5 @@ public: // Allow derived class to output name and position specific info virtual void record_position(OutputMap::position place, int index) {} }; + +#endif // SHARE_VM_ADLC_ARCHDESC_HPP diff --git a/hotspot/src/share/vm/adlc/arena.cpp b/hotspot/src/share/vm/adlc/arena.cpp index d8330fe8c8a..b8bb1a0bd8f 100644 --- a/hotspot/src/share/vm/adlc/arena.cpp +++ b/hotspot/src/share/vm/adlc/arena.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/arena.hpp b/hotspot/src/share/vm/adlc/arena.hpp index 2975165dc6c..a92857e1311 100644 --- a/hotspot/src/share/vm/adlc/arena.hpp +++ b/hotspot/src/share/vm/adlc/arena.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_ADLC_ARENA_HPP +#define SHARE_VM_ADLC_ARENA_HPP + // All classes in the virtual machine must be subclassed // by one of the following allocation classes: // @@ -155,3 +158,5 @@ public: size_t size_in_bytes() const { return _size_in_bytes; } void set_size_in_bytes(size_t size) { _size_in_bytes = size; } }; + +#endif // SHARE_VM_ADLC_ARENA_HPP diff --git a/hotspot/src/share/vm/adlc/dfa.cpp b/hotspot/src/share/vm/adlc/dfa.cpp index 4f65a8fe0e7..5333c152cea 100644 --- a/hotspot/src/share/vm/adlc/dfa.cpp +++ b/hotspot/src/share/vm/adlc/dfa.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/dict2.cpp b/hotspot/src/share/vm/adlc/dict2.cpp index 3d0b783db5b..22ec13d2c38 100644 --- a/hotspot/src/share/vm/adlc/dict2.cpp +++ b/hotspot/src/share/vm/adlc/dict2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ #define MAXID 20 static char initflag = 0; // True after 1st initialization static char shft[MAXID] = {1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6}; -static short xsum[MAXID + 1]; +static short xsum[MAXID]; //------------------------------bucket--------------------------------------- class bucket { @@ -66,7 +66,7 @@ void Dict::init() { // Precompute table of null character hashes if( !initflag ) { // Not initializated yet? xsum[0] = (1<> 1); // Hash key, un-modulo'd table size } diff --git a/hotspot/src/share/vm/adlc/dict2.hpp b/hotspot/src/share/vm/adlc/dict2.hpp index 08b1695d1d7..1d0d22aa0f6 100644 --- a/hotspot/src/share/vm/adlc/dict2.hpp +++ b/hotspot/src/share/vm/adlc/dict2.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#ifndef _DICT_ -#define _DICT_ +#ifndef SHARE_VM_ADLC_DICT2_HPP +#define SHARE_VM_ADLC_DICT2_HPP + // Dictionaries - An Abstract Data Type @@ -117,4 +118,4 @@ class DictI { int test(void) { return _i<_d->_size;} // Test for end of iteration }; -#endif // _DICT_ +#endif // SHARE_VM_ADLC_DICT2_HPP diff --git a/hotspot/src/share/vm/adlc/filebuff.cpp b/hotspot/src/share/vm/adlc/filebuff.cpp index 6c86c5634a0..5f54d724638 100644 --- a/hotspot/src/share/vm/adlc/filebuff.cpp +++ b/hotspot/src/share/vm/adlc/filebuff.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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 e5b1747f37a..3d8bdad8fe0 100644 --- a/hotspot/src/share/vm/adlc/filebuff.hpp +++ b/hotspot/src/share/vm/adlc/filebuff.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_ADLC_FILEBUFF_HPP +#define SHARE_VM_ADLC_FILEBUFF_HPP + // FILEBUFF.HPP - Definitions for parser file buffering routines #include @@ -99,3 +102,5 @@ class FileBuffRegion { void print(ostream&); friend ostream& operator<< (ostream&, FileBuffRegion&); }; + +#endif // SHARE_VM_ADLC_FILEBUFF_HPP diff --git a/hotspot/src/share/vm/adlc/forms.cpp b/hotspot/src/share/vm/adlc/forms.cpp index bdd35fd2adf..5e05a841ed9 100644 --- a/hotspot/src/share/vm/adlc/forms.cpp +++ b/hotspot/src/share/vm/adlc/forms.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/forms.hpp b/hotspot/src/share/vm/adlc/forms.hpp index 03e4eb172ae..3132c6a3f92 100644 --- a/hotspot/src/share/vm/adlc/forms.hpp +++ b/hotspot/src/share/vm/adlc/forms.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_ADLC_FORMS_HPP +#define SHARE_VM_ADLC_FORMS_HPP + // FORMS.HPP - ADL Parser Generic and Utility Forms Classes #define TRUE 1 @@ -588,3 +591,5 @@ public: void print_asserts(FILE *fp); void dump(); }; + +#endif // SHARE_VM_ADLC_FORMS_HPP diff --git a/hotspot/src/share/vm/adlc/formsopt.cpp b/hotspot/src/share/vm/adlc/formsopt.cpp index 7aa4052192a..e9287538511 100644 --- a/hotspot/src/share/vm/adlc/formsopt.cpp +++ b/hotspot/src/share/vm/adlc/formsopt.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE 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/formsopt.hpp b/hotspot/src/share/vm/adlc/formsopt.hpp index 9bf2af65054..2c0cad506e3 100644 --- a/hotspot/src/share/vm/adlc/formsopt.hpp +++ b/hotspot/src/share/vm/adlc/formsopt.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_ADLC_FORMSOPT_HPP +#define SHARE_VM_ADLC_FORMSOPT_HPP + // FORMSOPT.HPP - ADL Parser Target Specific Optimization Forms Classes // Class List @@ -546,3 +549,5 @@ public: void dump(); void output(FILE *fp); }; + +#endif // SHARE_VM_ADLC_FORMSOPT_HPP diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index 5011b505c16..c659cdb881d 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -30,11 +30,14 @@ InstructForm::InstructForm(const char *id, bool ideal_only) : _ident(id), _ideal_only(ideal_only), _localNames(cmpstr, hashstr, Form::arena), - _effects(cmpstr, hashstr, Form::arena) { + _effects(cmpstr, hashstr, Form::arena), + _is_mach_constant(false) +{ _ftype = Form::INS; _matrule = NULL; _insencode = NULL; + _constant = NULL; _opcode = NULL; _size = NULL; _attribs = NULL; @@ -58,11 +61,14 @@ InstructForm::InstructForm(const char *id, bool ideal_only) InstructForm::InstructForm(const char *id, InstructForm *instr, MatchRule *rule) : _ident(id), _ideal_only(false), _localNames(instr->_localNames), - _effects(instr->_effects) { + _effects(instr->_effects), + _is_mach_constant(false) +{ _ftype = Form::INS; _matrule = rule; _insencode = instr->_insencode; + _constant = instr->_constant; _opcode = instr->_opcode; _size = instr->_size; _attribs = instr->_attribs; @@ -1094,6 +1100,9 @@ const char *InstructForm::mach_base_class(FormDict &globals) const { else if (is_ideal_nop()) { return "MachNopNode"; } + else if (is_mach_constant()) { + return "MachConstantNode"; + } else if (captures_bottom_type(globals)) { return "MachTypeNode"; } else { @@ -1190,6 +1199,21 @@ bool InstructForm::check_branch_variant(ArchDesc &AD, InstructForm *short_branch // // Generate the format call for the replacement variable void InstructForm::rep_var_format(FILE *fp, const char *rep_var) { + // Handle special constant table variables. + if (strcmp(rep_var, "constanttablebase") == 0) { + fprintf(fp, "char reg[128]; ra->dump_register(in(mach_constant_base_node_input()), reg);\n"); + fprintf(fp, "st->print(\"%%s\");\n"); + return; + } + if (strcmp(rep_var, "constantoffset") == 0) { + fprintf(fp, "st->print(\"#%%d\", constant_offset());\n"); + return; + } + if (strcmp(rep_var, "constantaddress") == 0) { + fprintf(fp, "st->print(\"constant table base + #%%d\", constant_offset());\n"); + return; + } + // Find replacement variable's type const Form *form = _localNames[rep_var]; if (form == NULL) { @@ -1348,6 +1372,7 @@ void InstructForm::output(FILE *fp) { fprintf(fp,"\nInstruction: %s\n", (_ident?_ident:"")); if (_matrule) _matrule->output(fp); if (_insencode) _insencode->output(fp); + if (_constant) _constant->output(fp); if (_opcode) _opcode->output(fp); if (_attribs) _attribs->output(fp); if (_predicate) _predicate->output(fp); diff --git a/hotspot/src/share/vm/adlc/formssel.hpp b/hotspot/src/share/vm/adlc/formssel.hpp index 4c05285a8c8..88ba702672c 100644 --- a/hotspot/src/share/vm/adlc/formssel.hpp +++ b/hotspot/src/share/vm/adlc/formssel.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_ADLC_FORMSSEL_HPP +#define SHARE_VM_ADLC_FORMSSEL_HPP + // FORMSSEL.HPP - ADL Parser Instruction Selection Forms Classes // Class List @@ -71,15 +74,16 @@ class ArchDesc; //------------------------------InstructForm----------------------------------- class InstructForm : public Form { private: - bool _ideal_only; // Not a user-defined instruction + bool _ideal_only; // Not a user-defined instruction // Members used for tracking CISC-spilling - uint _cisc_spill_operand;// Which operand may cisc-spill + uint _cisc_spill_operand;// Which operand may cisc-spill void set_cisc_spill_operand(uint op_index) { _cisc_spill_operand = op_index; } - bool _is_cisc_alternate; + bool _is_cisc_alternate; InstructForm *_cisc_spill_alternate;// cisc possible replacement const char *_cisc_reg_mask_name; InstructForm *_short_branch_form; bool _is_short_branch; + bool _is_mach_constant; // true if Node is a MachConstantNode uint _alignment; public: @@ -91,6 +95,7 @@ public: Opcode *_opcode; // Encoding of the opcode for instruction char *_size; // Size of instruction InsEncode *_insencode; // Encoding class instruction belongs to + InsEncode *_constant; // Encoding class constant value belongs to Attribute *_attribs; // List of Attribute rules Predicate *_predicate; // Predicate test for this instruction FormDict _effects; // Dictionary of effect rules @@ -248,6 +253,9 @@ public: bool is_short_branch() { return _is_short_branch; } void set_short_branch(bool val) { _is_short_branch = val; } + bool is_mach_constant() const { return _is_mach_constant; } + void set_is_mach_constant(bool x) { _is_mach_constant = x; } + InstructForm *short_branch_form() { return _short_branch_form; } bool has_short_branch_form() { return _short_branch_form != NULL; } // Output short branch prototypes and method bodies @@ -1062,3 +1070,5 @@ public: void dump(); void output(FILE *fp); }; + +#endif // SHARE_VM_ADLC_FORMSSEL_HPP diff --git a/hotspot/src/share/vm/adlc/main.cpp b/hotspot/src/share/vm/adlc/main.cpp index 4aaa5e393e5..3d74a4f02f9 100644 --- a/hotspot/src/share/vm/adlc/main.cpp +++ b/hotspot/src/share/vm/adlc/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,17 @@ static int get_legal_text(FileBuff &fbuf, char **legal_text); // Get pointer to ArchDesc* globalAD = NULL; // global reference to Architecture Description object +const char* get_basename(const char* filename) { + const char *basename = filename; + const char *cp; + for (cp = basename; *cp; cp++) { + if (*cp == '/') { + basename = cp+1; + } + } + return basename; +} + //------------------------------main------------------------------------------- int main(int argc, char *argv[]) { @@ -193,16 +204,69 @@ int main(int argc, char *argv[]) AD.addSunCopyright(legal_text, legal_sz, AD._CPP_PIPELINE_file._fp); // .cpp AD.addSunCopyright(legal_text, legal_sz, AD._VM_file._fp); // .hpp AD.addSunCopyright(legal_text, legal_sz, AD._DFA_file._fp); // .cpp + // Add include guards for all .hpp files + AD.addIncludeGuardStart(AD._HPP_file, "GENERATED_ADFILES_AD_HPP"); // .hpp + AD.addIncludeGuardStart(AD._VM_file, "GENERATED_ADFILES_ADGLOBALS_HPP"); // .hpp + // Add includes + AD.addInclude(AD._CPP_file, "precompiled.hpp"); + AD.addInclude(AD._CPP_file, "adfiles", get_basename(AD._VM_file._name)); + AD.addInclude(AD._CPP_file, "adfiles", get_basename(AD._HPP_file._name)); + AD.addInclude(AD._CPP_file, "memory/allocation.inline.hpp"); + AD.addInclude(AD._CPP_file, "asm/assembler.hpp"); + AD.addInclude(AD._CPP_file, "code/vmreg.hpp"); + AD.addInclude(AD._CPP_file, "gc_interface/collectedHeap.inline.hpp"); + AD.addInclude(AD._CPP_file, "oops/compiledICHolderOop.hpp"); + AD.addInclude(AD._CPP_file, "oops/markOop.hpp"); + AD.addInclude(AD._CPP_file, "oops/methodOop.hpp"); + AD.addInclude(AD._CPP_file, "oops/oop.inline.hpp"); + AD.addInclude(AD._CPP_file, "oops/oop.inline2.hpp"); + AD.addInclude(AD._CPP_file, "opto/cfgnode.hpp"); + AD.addInclude(AD._CPP_file, "opto/locknode.hpp"); + AD.addInclude(AD._CPP_file, "opto/opcodes.hpp"); + AD.addInclude(AD._CPP_file, "opto/regalloc.hpp"); + AD.addInclude(AD._CPP_file, "opto/regmask.hpp"); + AD.addInclude(AD._CPP_file, "opto/runtime.hpp"); + AD.addInclude(AD._CPP_file, "runtime/biasedLocking.hpp"); + AD.addInclude(AD._CPP_file, "runtime/sharedRuntime.hpp"); + AD.addInclude(AD._CPP_file, "runtime/stubRoutines.hpp"); + AD.addInclude(AD._CPP_file, "utilities/growableArray.hpp"); +#ifdef TARGET_ARCH_x86 + AD.addInclude(AD._CPP_file, "assembler_x86.inline.hpp"); + AD.addInclude(AD._CPP_file, "nativeInst_x86.hpp"); + AD.addInclude(AD._CPP_file, "vmreg_x86.inline.hpp"); +#endif +#ifdef TARGET_ARCH_sparc + AD.addInclude(AD._CPP_file, "assembler_sparc.inline.hpp"); + AD.addInclude(AD._CPP_file, "nativeInst_sparc.hpp"); + AD.addInclude(AD._CPP_file, "vmreg_sparc.inline.hpp"); +#endif + AD.addInclude(AD._HPP_file, "memory/allocation.hpp"); + AD.addInclude(AD._HPP_file, "opto/machnode.hpp"); + AD.addInclude(AD._HPP_file, "opto/node.hpp"); + AD.addInclude(AD._HPP_file, "opto/regalloc.hpp"); + AD.addInclude(AD._HPP_file, "opto/subnode.hpp"); + AD.addInclude(AD._CPP_CLONE_file, "precompiled.hpp"); + AD.addInclude(AD._CPP_CLONE_file, "adfiles", get_basename(AD._HPP_file._name)); + AD.addInclude(AD._CPP_EXPAND_file, "precompiled.hpp"); + AD.addInclude(AD._CPP_EXPAND_file, "adfiles", get_basename(AD._HPP_file._name)); + AD.addInclude(AD._CPP_FORMAT_file, "precompiled.hpp"); + AD.addInclude(AD._CPP_FORMAT_file, "adfiles", get_basename(AD._HPP_file._name)); + AD.addInclude(AD._CPP_GEN_file, "precompiled.hpp"); + AD.addInclude(AD._CPP_GEN_file, "adfiles", get_basename(AD._HPP_file._name)); + AD.addInclude(AD._CPP_GEN_file, "opto/cfgnode.hpp"); + AD.addInclude(AD._CPP_GEN_file, "opto/locknode.hpp"); + AD.addInclude(AD._CPP_MISC_file, "precompiled.hpp"); + AD.addInclude(AD._CPP_MISC_file, "adfiles", get_basename(AD._HPP_file._name)); + AD.addInclude(AD._CPP_PEEPHOLE_file, "precompiled.hpp"); + AD.addInclude(AD._CPP_PEEPHOLE_file, "adfiles", get_basename(AD._HPP_file._name)); + AD.addInclude(AD._CPP_PIPELINE_file, "precompiled.hpp"); + AD.addInclude(AD._CPP_PIPELINE_file, "adfiles", get_basename(AD._HPP_file._name)); + AD.addInclude(AD._DFA_file, "precompiled.hpp"); + AD.addInclude(AD._DFA_file, "adfiles", get_basename(AD._HPP_file._name)); + AD.addInclude(AD._DFA_file, "opto/matcher.hpp"); + AD.addInclude(AD._DFA_file, "opto/opcodes.hpp"); // Make sure each .cpp file starts with include lines: // files declaring and defining generators for Mach* Objects (hpp,cpp) - AD.machineDependentIncludes(AD._CPP_file); // .cpp - AD.machineDependentIncludes(AD._CPP_CLONE_file); // .cpp - AD.machineDependentIncludes(AD._CPP_EXPAND_file); // .cpp - AD.machineDependentIncludes(AD._CPP_FORMAT_file); // .cpp - AD.machineDependentIncludes(AD._CPP_GEN_file); // .cpp - AD.machineDependentIncludes(AD._CPP_MISC_file); // .cpp - AD.machineDependentIncludes(AD._CPP_PEEPHOLE_file); // .cpp - AD.machineDependentIncludes(AD._CPP_PIPELINE_file); // .cpp // Generate the result files: // enumerations, class definitions, object generators, and the DFA // file containing enumeration of machine operands & instructions (hpp) @@ -244,8 +308,10 @@ int main(int argc, char *argv[]) AD.addPreprocessorChecks(AD._CPP_PIPELINE_file._fp); // .cpp // define the finite automata that selects lowest cost production - AD.machineDependentIncludes(AD._DFA_file); // .cpp AD.buildDFA(AD._DFA_file._fp); + // Add include guards for all .hpp files + AD.addIncludeGuardEnd(AD._HPP_file, "GENERATED_ADFILES_AD_HPP"); // .hpp + AD.addIncludeGuardEnd(AD._VM_file, "GENERATED_ADFILES_ADGLOBALS_HPP"); // .hpp AD.close_files(0); // Close all input/output files diff --git a/hotspot/src/share/vm/adlc/output_c.cpp b/hotspot/src/share/vm/adlc/output_c.cpp index 75cdcacb997..776c486f179 100644 --- a/hotspot/src/share/vm/adlc/output_c.cpp +++ b/hotspot/src/share/vm/adlc/output_c.cpp @@ -1496,8 +1496,8 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) { unsigned i; // Generate Expand function header - fprintf(fp,"MachNode *%sNode::Expand(State *state, Node_List &proj_list, Node* mem) {\n", node->_ident); - fprintf(fp,"Compile* C = Compile::current();\n"); + fprintf(fp, "MachNode* %sNode::Expand(State* state, Node_List& proj_list, Node* mem) {\n", node->_ident); + fprintf(fp, " Compile* C = Compile::current();\n"); // Generate expand code if( node->expands() ) { const char *opid; @@ -1818,6 +1818,12 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) { } } + // If the node is a MachConstantNode, insert the MachConstantBaseNode edge. + // NOTE: this edge must be the last input (see MachConstantNode::mach_constant_base_node_input). + if (node->is_mach_constant()) { + fprintf(fp," add_req(C->mach_constant_base_node());\n"); + } + fprintf(fp,"\n"); if( node->expands() ) { fprintf(fp," return result;\n"); @@ -1924,7 +1930,17 @@ public: // No state needed. assert( _opclass == NULL, "'primary', 'secondary' and 'tertiary' don't follow operand."); - } else { + } + else if ((strcmp(rep_var, "constanttablebase") == 0) || + (strcmp(rep_var, "constantoffset") == 0) || + (strcmp(rep_var, "constantaddress") == 0)) { + if (!_inst.is_mach_constant()) { + _AD.syntax_err(_encoding._linenum, + "Replacement variable %s not allowed in instruct %s (only in MachConstantNode).\n", + rep_var, _encoding._name); + } + } + else { // Lookup its position in parameter list int param_no = _encoding.rep_var_index(rep_var); if ( param_no == -1 ) { @@ -2380,6 +2396,15 @@ private: rep_var, _inst._ident, _encoding._name); } } + else if (strcmp(rep_var, "constanttablebase") == 0) { + fprintf(_fp, "as_Register(ra_->get_encode(in(mach_constant_base_node_input())))"); + } + else if (strcmp(rep_var, "constantoffset") == 0) { + fprintf(_fp, "constant_offset()"); + } + else if (strcmp(rep_var, "constantaddress") == 0) { + fprintf(_fp, "InternalAddress(__ code()->consts()->start() + constant_offset())"); + } else { // Lookup its position in parameter list int param_no = _encoding.rep_var_index(rep_var); @@ -2465,37 +2490,39 @@ void ArchDesc::defineSize(FILE *fp, InstructForm &inst) { fprintf(fp,"}\n"); } -void ArchDesc::defineEmit(FILE *fp, InstructForm &inst) { - InsEncode *ins_encode = inst._insencode; +// defineEmit ----------------------------------------------------------------- +void ArchDesc::defineEmit(FILE* fp, InstructForm& inst) { + InsEncode* encode = inst._insencode; // (1) // Output instruction's emit prototype - fprintf(fp,"void %sNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {\n", - inst._ident); + fprintf(fp, "void %sNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {\n", inst._ident); // If user did not define an encode section, // provide stub that does not generate any machine code. - if( (_encode == NULL) || (ins_encode == NULL) ) { + if( (_encode == NULL) || (encode == NULL) ) { fprintf(fp, " // User did not define an encode section.\n"); - fprintf(fp,"}\n"); + fprintf(fp, "}\n"); return; } // Save current instruction's starting address (helps with relocation). - fprintf(fp, " cbuf.set_insts_mark();\n"); + fprintf(fp, " cbuf.set_insts_mark();\n"); - // // // idx0 is only needed for syntactic purposes and only by "storeSSI" - // fprintf( fp, " unsigned idx0 = 0;\n"); + // For MachConstantNodes which are ideal jump nodes, fill the jump table. + if (inst.is_mach_constant() && inst.is_ideal_jump()) { + fprintf(fp, " ra_->C->constant_table().fill_jump_table(cbuf, (MachConstantNode*) this, _index2label);\n"); + } // Output each operand's offset into the array of registers. - inst.index_temps( fp, _globalNames ); + inst.index_temps(fp, _globalNames); // Output this instruction's encodings const char *ec_name; bool user_defined = false; - ins_encode->reset(); - while ( (ec_name = ins_encode->encode_class_iter()) != NULL ) { - fprintf(fp, " {"); + encode->reset(); + while ((ec_name = encode->encode_class_iter()) != NULL) { + fprintf(fp, " {\n"); // Output user-defined encoding user_defined = true; @@ -2507,25 +2534,25 @@ void ArchDesc::defineEmit(FILE *fp, InstructForm &inst) { abort(); } - if (ins_encode->current_encoding_num_args() != encoding->num_args()) { - globalAD->syntax_err(ins_encode->_linenum, "In %s: passing %d arguments to %s but expecting %d", - inst._ident, ins_encode->current_encoding_num_args(), + if (encode->current_encoding_num_args() != encoding->num_args()) { + globalAD->syntax_err(encode->_linenum, "In %s: passing %d arguments to %s but expecting %d", + inst._ident, encode->current_encoding_num_args(), ec_name, encoding->num_args()); } - DefineEmitState pending(fp, *this, *encoding, *ins_encode, inst ); + DefineEmitState pending(fp, *this, *encoding, *encode, inst); encoding->_code.reset(); encoding->_rep_vars.reset(); // Process list of user-defined strings, // and occurrences of replacement variables. // Replacement Vars are pushed into a list and then output - while ( (ec_code = encoding->_code.iter()) != NULL ) { - if ( ! encoding->_code.is_signal( ec_code ) ) { + while ((ec_code = encoding->_code.iter()) != NULL) { + if (!encoding->_code.is_signal(ec_code)) { // Emit pending code pending.emit(); pending.clear(); // Emit this code section - fprintf(fp,"%s", ec_code); + fprintf(fp, "%s", ec_code); } else { // A replacement variable or one of its subfields // Obtain replacement variable from list @@ -2536,7 +2563,7 @@ void ArchDesc::defineEmit(FILE *fp, InstructForm &inst) { // Emit pending code pending.emit(); pending.clear(); - fprintf(fp, "}\n"); + fprintf(fp, " }\n"); } // end while instruction's encodings // Check if user stated which encoding to user @@ -2545,7 +2572,86 @@ void ArchDesc::defineEmit(FILE *fp, InstructForm &inst) { } // (3) and (4) - fprintf(fp,"}\n"); + fprintf(fp, "}\n"); +} + +// defineEvalConstant --------------------------------------------------------- +void ArchDesc::defineEvalConstant(FILE* fp, InstructForm& inst) { + InsEncode* encode = inst._constant; + + // (1) + // Output instruction's emit prototype + fprintf(fp, "void %sNode::eval_constant(Compile* C) {\n", inst._ident); + + // For ideal jump nodes, allocate a jump table. + if (inst.is_ideal_jump()) { + fprintf(fp, " _constant = C->constant_table().allocate_jump_table(this);\n"); + } + + // If user did not define an encode section, + // provide stub that does not generate any machine code. + if ((_encode == NULL) || (encode == NULL)) { + fprintf(fp, " // User did not define an encode section.\n"); + fprintf(fp, "}\n"); + return; + } + + // Output this instruction's encodings + const char *ec_name; + bool user_defined = false; + encode->reset(); + while ((ec_name = encode->encode_class_iter()) != NULL) { + fprintf(fp, " {\n"); + // Output user-defined encoding + user_defined = true; + + const char *ec_code = NULL; + const char *ec_rep_var = NULL; + EncClass *encoding = _encode->encClass(ec_name); + if (encoding == NULL) { + fprintf(stderr, "User did not define contents of this encode_class: %s\n", ec_name); + abort(); + } + + if (encode->current_encoding_num_args() != encoding->num_args()) { + globalAD->syntax_err(encode->_linenum, "In %s: passing %d arguments to %s but expecting %d", + inst._ident, encode->current_encoding_num_args(), + ec_name, encoding->num_args()); + } + + DefineEmitState pending(fp, *this, *encoding, *encode, inst); + encoding->_code.reset(); + encoding->_rep_vars.reset(); + // Process list of user-defined strings, + // and occurrences of replacement variables. + // Replacement Vars are pushed into a list and then output + while ((ec_code = encoding->_code.iter()) != NULL) { + if (!encoding->_code.is_signal(ec_code)) { + // Emit pending code + pending.emit(); + pending.clear(); + // Emit this code section + fprintf(fp, "%s", ec_code); + } else { + // A replacement variable or one of its subfields + // Obtain replacement variable from list + ec_rep_var = encoding->_rep_vars.iter(); + pending.add_rep_var(ec_rep_var); + } + } + // Emit pending code + pending.emit(); + pending.clear(); + fprintf(fp, " }\n"); + } // end while instruction's encodings + + // Check if user stated which encoding to user + if (user_defined == false) { + fprintf(fp, " // User did not define which encode class to use.\n"); + } + + // (3) and (4) + fprintf(fp, "}\n"); } // --------------------------------------------------------------------------- @@ -2952,6 +3058,7 @@ void ArchDesc::defineClasses(FILE *fp) { // If there are multiple defs/kills, or an explicit expand rule, build rule if( instr->expands() || instr->needs_projections() || instr->has_temps() || + instr->is_mach_constant() || instr->_matrule != NULL && instr->num_opnds() != instr->num_unique_opnds() ) defineExpand(_CPP_EXPAND_file._fp, instr); @@ -3032,8 +3139,9 @@ void ArchDesc::defineClasses(FILE *fp) { // Ensure this is a machine-world instruction if ( instr->ideal_only() ) continue; - if (instr->_insencode) defineEmit(fp, *instr); - if (instr->_size) defineSize(fp, *instr); + if (instr->_insencode) defineEmit (fp, *instr); + if (instr->is_mach_constant()) defineEvalConstant(fp, *instr); + if (instr->_size) defineSize (fp, *instr); // side-call to generate output that used to be in the header file: extern void gen_inst_format(FILE *fp, FormDict &globals, InstructForm &oper, bool for_c_file); diff --git a/hotspot/src/share/vm/adlc/output_h.cpp b/hotspot/src/share/vm/adlc/output_h.cpp index 1bae8b1fd33..08e8ca6bf69 100644 --- a/hotspot/src/share/vm/adlc/output_h.cpp +++ b/hotspot/src/share/vm/adlc/output_h.cpp @@ -1550,7 +1550,12 @@ void ArchDesc::declareClasses(FILE *fp) { } // virtual functions for encode and format - // + + // Virtual function for evaluating the constant. + if (instr->is_mach_constant()) { + fprintf(fp," virtual void eval_constant(Compile* C);\n"); + } + // Output the opcode function and the encode function here using the // encoding class information in the _insencode slot. if ( instr->_insencode ) { @@ -1559,7 +1564,7 @@ void ArchDesc::declareClasses(FILE *fp) { // virtual function for getting the size of an instruction if ( instr->_size ) { - fprintf(fp," virtual uint size(PhaseRegAlloc *ra_) const;\n"); + fprintf(fp," virtual uint size(PhaseRegAlloc *ra_) const;\n"); } // Return the top-level ideal opcode. @@ -1752,6 +1757,7 @@ void ArchDesc::declareClasses(FILE *fp) { // Virtual methods which are only generated to override base class if( instr->expands() || instr->needs_projections() || instr->has_temps() || + instr->is_mach_constant() || instr->_matrule != NULL && instr->num_opnds() != instr->num_unique_opnds() ) { fprintf(fp," virtual MachNode *Expand(State *state, Node_List &proj_list, Node* mem);\n"); @@ -1780,24 +1786,6 @@ void ArchDesc::declareClasses(FILE *fp) { // Declare short branch methods, if applicable instr->declare_short_branch_methods(fp); - // Instructions containing a constant that will be entered into the - // float/double table redefine the base virtual function -#ifdef SPARC - // Sparc doubles entries in the constant table require more space for - // alignment. (expires 9/98) - int table_entries = (3 * instr->num_consts( _globalNames, Form::idealD )) - + instr->num_consts( _globalNames, Form::idealF ); -#else - int table_entries = instr->num_consts( _globalNames, Form::idealD ) - + instr->num_consts( _globalNames, Form::idealF ); -#endif - if( table_entries != 0 ) { - fprintf(fp," virtual int const_size() const {"); - fprintf(fp, " return %d;", table_entries); - fprintf(fp, " }\n"); - } - - // See if there is an "ins_pipe" declaration for this instruction if (instr->_ins_pipe) { fprintf(fp," static const Pipeline *pipeline_class();\n"); diff --git a/hotspot/src/share/vm/asm/assembler.cpp b/hotspot/src/share/vm/asm/assembler.cpp index 4eaa7fc36a1..e4e890931f5 100644 --- a/hotspot/src/share/vm/asm/assembler.cpp +++ b/hotspot/src/share/vm/asm/assembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,21 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_assembler.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "asm/assembler.inline.hpp" +#include "asm/codeBuffer.hpp" +#include "runtime/icache.hpp" +#include "runtime/os.hpp" +#ifdef TARGET_ARCH_x86 +# include "assembler_x86.inline.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "assembler_sparc.inline.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "assembler_zero.inline.hpp" +#endif // Implementation of AbstractAssembler diff --git a/hotspot/src/share/vm/asm/assembler.hpp b/hotspot/src/share/vm/asm/assembler.hpp index d6a31e2e5aa..0b3544e695f 100644 --- a/hotspot/src/share/vm/asm/assembler.hpp +++ b/hotspot/src/share/vm/asm/assembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,28 @@ * */ +#ifndef SHARE_VM_ASM_ASSEMBLER_HPP +#define SHARE_VM_ASM_ASSEMBLER_HPP + +#include "code/oopRecorder.hpp" +#include "code/relocInfo.hpp" +#include "memory/allocation.hpp" +#include "utilities/debug.hpp" +#include "utilities/growableArray.hpp" +#include "utilities/top.hpp" +#ifdef TARGET_ARCH_x86 +# include "register_x86.hpp" +# include "vm_version_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "register_sparc.hpp" +# include "vm_version_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "register_zero.hpp" +# include "vm_version_zero.hpp" +#endif + // This file contains platform-independent assembler declarations. class CodeBuffer; @@ -270,7 +292,16 @@ class AbstractAssembler : public ResourceObj { address start_a_const(int required_space, int required_align = sizeof(double)); void end_a_const(); - // fp constants support + // constants support + address long_constant(jlong c) { + address ptr = start_a_const(sizeof(c), sizeof(c)); + if (ptr != NULL) { + *(jlong*)ptr = c; + _code_pos = ptr + sizeof(c); + end_a_const(); + } + return ptr; + } address double_constant(jdouble c) { address ptr = start_a_const(sizeof(c), sizeof(c)); if (ptr != NULL) { @@ -289,6 +320,15 @@ class AbstractAssembler : public ResourceObj { } return ptr; } + address address_constant(address c) { + address ptr = start_a_const(sizeof(c), sizeof(c)); + if (ptr != NULL) { + *(address*)ptr = c; + _code_pos = ptr + sizeof(c); + end_a_const(); + } + return ptr; + } address address_constant(address c, RelocationHolder const& rspec) { address ptr = start_a_const(sizeof(c), sizeof(c)); if (ptr != NULL) { @@ -299,8 +339,6 @@ class AbstractAssembler : public ResourceObj { } return ptr; } - inline address address_constant(Label& L); - inline address address_table_constant(GrowableArray label); // Bootstrapping aid to cope with delayed determination of constants. // Returns a static address which will eventually contain the constant. @@ -348,4 +386,15 @@ class AbstractAssembler : public ResourceObj { #endif // PRODUCT }; -#include "incls/_assembler_pd.hpp.incl" +#ifdef TARGET_ARCH_x86 +# include "assembler_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "assembler_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "assembler_zero.hpp" +#endif + + +#endif // SHARE_VM_ASM_ASSEMBLER_HPP diff --git a/hotspot/src/share/vm/asm/assembler.inline.hpp b/hotspot/src/share/vm/asm/assembler.inline.hpp index 043e49ad780..6eede4445ca 100644 --- a/hotspot/src/share/vm/asm/assembler.inline.hpp +++ b/hotspot/src/share/vm/asm/assembler.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_ASM_ASSEMBLER_INLINE_HPP +#define SHARE_VM_ASM_ASSEMBLER_INLINE_HPP + +#include "asm/assembler.hpp" +#include "asm/codeBuffer.hpp" +#include "compiler/disassembler.hpp" +#include "runtime/threadLocalStorage.hpp" + inline void AbstractAssembler::sync() { CodeSection* cs = code_section(); guarantee(cs->start() == _code_begin, "must not shift code buffer"); @@ -106,30 +114,4 @@ inline void Label::bind_loc(int pos, int sect) { bind_loc(CodeBuffer::locator(pos, sect)); } -address AbstractAssembler::address_constant(Label& L) { - address c = NULL; - address ptr = start_a_const(sizeof(c), sizeof(c)); - if (ptr != NULL) { - relocate(Relocation::spec_simple(relocInfo::internal_word_type)); - *(address*)ptr = c = code_section()->target(L, ptr); - _code_pos = ptr + sizeof(c); - end_a_const(); - } - return ptr; -} - -address AbstractAssembler::address_table_constant(GrowableArray labels) { - int addressSize = sizeof(address); - int sizeLabel = addressSize * labels.length(); - address ptr = start_a_const(sizeLabel, addressSize); - - if (ptr != NULL) { - address *labelLoc = (address*)ptr; - for (int i=0; i < labels.length(); i++) { - emit_address(code_section()->target(*labels.at(i), (address)&labelLoc[i])); - code_section()->relocate((address)&labelLoc[i], relocInfo::internal_word_type); - } - end_a_const(); - } - return ptr; -} +#endif // SHARE_VM_ASM_ASSEMBLER_INLINE_HPP diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp index d7e4bb54d3b..f2d9bbc9087 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.cpp +++ b/hotspot/src/share/vm/asm/codeBuffer.cpp @@ -22,8 +22,10 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_codeBuffer.cpp.incl" +#include "precompiled.hpp" +#include "asm/codeBuffer.hpp" +#include "compiler/disassembler.hpp" +#include "utilities/copy.hpp" // The structure of a CodeSection: // @@ -129,6 +131,7 @@ CodeBuffer::~CodeBuffer() { #ifdef ASSERT // Save allocation type to execute assert in ~ResourceObj() // which is called after this destructor. + assert(_default_oop_recorder.allocated_on_stack(), "should be embedded object"); ResourceObj::allocation_type at = _default_oop_recorder.get_allocation_type(); Copy::fill_to_bytes(this, sizeof(*this), badResourceValue); ResourceObj::set_allocation_type((address)(&_default_oop_recorder), at); diff --git a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp index 16880dcfadd..8ab664d4963 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.hpp +++ b/hotspot/src/share/vm/asm/codeBuffer.hpp @@ -22,6 +22,13 @@ * */ +#ifndef SHARE_VM_ASM_CODEBUFFER_HPP +#define SHARE_VM_ASM_CODEBUFFER_HPP + +#include "asm/assembler.hpp" +#include "code/oopRecorder.hpp" +#include "code/relocInfo.hpp" + class CodeComments; class AbstractAssembler; class MacroAssembler; @@ -168,8 +175,8 @@ class CodeSection VALUE_OBJ_CLASS_SPEC { bool allocates(address pc) const { return pc >= _start && pc < _limit; } bool allocates2(address pc) const { return pc >= _start && pc <= _limit; } - void set_end(address pc) { assert(allocates2(pc),""); _end = pc; } - void set_mark(address pc) { assert(contains2(pc),"not in codeBuffer"); + void set_end(address pc) { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " PTR_FORMAT " <= " PTR_FORMAT " <= " PTR_FORMAT, _start, pc, _limit)); _end = pc; } + void set_mark(address pc) { assert(contains2(pc), "not in codeBuffer"); _mark = pc; } void set_mark_off(int offset) { assert(contains2(offset+_start),"not in codeBuffer"); _mark = offset + _start; } @@ -550,7 +557,16 @@ class CodeBuffer: public StackObj { // The following header contains architecture-specific implementations - #include "incls/_codeBuffer_pd.hpp.incl" +#ifdef TARGET_ARCH_x86 +# include "codeBuffer_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "codeBuffer_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "codeBuffer_zero.hpp" +#endif + }; @@ -562,3 +578,5 @@ inline bool CodeSection::maybe_expand_to_ensure_remaining(csize_t amount) { if (remaining() < amount) { _outer->expand(this, amount); return true; } return false; } + +#endif // SHARE_VM_ASM_CODEBUFFER_HPP diff --git a/hotspot/src/share/vm/asm/register.cpp b/hotspot/src/share/vm/asm/register.cpp index f491150e7e2..85da369ca20 100644 --- a/hotspot/src/share/vm/asm/register.cpp +++ b/hotspot/src/share/vm/asm/register.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,8 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_register.cpp.incl" +#include "precompiled.hpp" +#include "asm/register.hpp" // Intentionally left blank diff --git a/hotspot/src/share/vm/asm/register.hpp b/hotspot/src/share/vm/asm/register.hpp index a142d057592..48179211f3f 100644 --- a/hotspot/src/share/vm/asm/register.hpp +++ b/hotspot/src/share/vm/asm/register.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_ASM_REGISTER_HPP +#define SHARE_VM_ASM_REGISTER_HPP + +#include "utilities/top.hpp" + // Use AbstractRegister as shortcut class AbstractRegisterImpl; typedef AbstractRegisterImpl* AbstractRegister; @@ -209,3 +214,5 @@ inline void assert_different_registers( "registers must be different" ); } + +#endif // SHARE_VM_ASM_REGISTER_HPP diff --git a/hotspot/src/share/vm/c1/c1_CFGPrinter.cpp b/hotspot/src/share/vm/c1/c1_CFGPrinter.cpp index 4a72b166f90..4964ebd683e 100644 --- a/hotspot/src/share/vm/c1/c1_CFGPrinter.cpp +++ b/hotspot/src/share/vm/c1/c1_CFGPrinter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_CFGPrinter.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_CFGPrinter.hpp" +#include "c1/c1_IR.hpp" +#include "c1/c1_InstructionPrinter.hpp" +#include "c1/c1_LIR.hpp" +#include "c1/c1_LinearScan.hpp" +#include "c1/c1_ValueStack.hpp" #ifndef PRODUCT @@ -174,31 +179,6 @@ void CFGPrinterOutput::print_state(BlockBegin* block) { int index; Value value; - if (state->stack_size() > 0) { - print_begin("stack"); - print("size %d", state->stack_size()); - - for_each_stack_value(state, index, value) { - ip.print_phi(index, value, block); - print_operand(value); - output()->cr(); - } - - print_end("stack"); - } - - if (state->locks_size() > 0) { - print_begin("locks"); - print("size %d", state->locks_size()); - - for_each_lock_value(state, index, value) { - ip.print_phi(index, value, block); - print_operand(value); - output()->cr(); - } - print_end("locks"); - } - for_each_state(state) { print_begin("locals"); print("size %d", state->locals_size()); @@ -210,6 +190,33 @@ void CFGPrinterOutput::print_state(BlockBegin* block) { output()->cr(); } print_end("locals"); + + if (state->stack_size() > 0) { + print_begin("stack"); + print("size %d", state->stack_size()); + print("method \"%s\"", method_name(state->scope()->method())); + + for_each_stack_value(state, index, value) { + ip.print_phi(index, value, block); + print_operand(value); + output()->cr(); + } + + print_end("stack"); + } + + if (state->locks_size() > 0) { + print_begin("locks"); + print("size %d", state->locks_size()); + print("method \"%s\"", method_name(state->scope()->method())); + + for_each_lock_value(state, index, value) { + ip.print_phi(index, value, block); + print_operand(value); + output()->cr(); + } + print_end("locks"); + } } print_end("states"); @@ -230,7 +237,8 @@ void CFGPrinterOutput::print_HIR(Value instr) { if (instr->is_pinned()) { output()->put('.'); } - output()->print("%d %d ", instr->bci(), instr->use_count()); + + output()->print("%d %d ", instr->printable_bci(), instr->use_count()); print_operand(instr); @@ -271,7 +279,7 @@ void CFGPrinterOutput::print_block(BlockBegin* block) { print("name \"B%d\"", block->block_id()); print("from_bci %d", block->bci()); - print("to_bci %d", (block->end() == NULL ? -1 : block->end()->bci())); + print("to_bci %d", (block->end() == NULL ? -1 : block->end()->printable_bci())); output()->indent(); output()->print("predecessors "); diff --git a/hotspot/src/share/vm/c1/c1_CFGPrinter.hpp b/hotspot/src/share/vm/c1/c1_CFGPrinter.hpp index a8bf09420ea..1cdde1186b2 100644 --- a/hotspot/src/share/vm/c1/c1_CFGPrinter.hpp +++ b/hotspot/src/share/vm/c1/c1_CFGPrinter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_C1_C1_CFGPRINTER_HPP +#define SHARE_VM_C1_C1_CFGPRINTER_HPP + +#include "c1/c1_Compilation.hpp" +#include "c1/c1_Instruction.hpp" + #ifndef PRODUCT // This is a utility class used for recording the results of a @@ -44,3 +50,5 @@ public: }; #endif + +#endif // SHARE_VM_C1_C1_CFGPRINTER_HPP diff --git a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp index ec89b0edd06..56a254c7748 100644 --- a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp +++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp @@ -22,8 +22,12 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_Canonicalizer.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Canonicalizer.hpp" +#include "c1/c1_InstructionPrinter.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciArray.hpp" +#include "runtime/sharedRuntime.hpp" class PrintValueVisitor: public ValueVisitor { @@ -205,7 +209,7 @@ void Canonicalizer::do_StoreField (StoreField* x) { // limit this optimization to current block if (value != NULL && in_current_block(conv)) { set_canonical(new StoreField(x->obj(), x->offset(), x->field(), value, x->is_static(), - x->lock_stack(), x->state_before(), x->is_loaded(), x->is_initialized())); + x->state_before(), x->is_loaded(), x->is_initialized())); return; } } @@ -256,7 +260,7 @@ void Canonicalizer::do_StoreIndexed (StoreIndexed* x) { // limit this optimization to current block if (value != NULL && in_current_block(conv)) { set_canonical(new StoreIndexed(x->array(), x->index(), x->length(), - x->elt_type(), value, x->lock_stack())); + x->elt_type(), value, x->state_before())); return; } } @@ -667,7 +671,7 @@ void Canonicalizer::do_If(If* x) { } } set_canonical(canon); - set_bci(cmp->bci()); + set_bci(cmp->state_before()->bci()); } } } else if (l->as_InstanceOf() != NULL) { @@ -685,7 +689,7 @@ void Canonicalizer::do_If(If* x) { set_canonical(new Goto(is_inst_sux, x->state_before(), x->is_safepoint())); } else { // successors differ => simplify to: IfInstanceOf - set_canonical(new IfInstanceOf(inst->klass(), inst->obj(), true, inst->bci(), is_inst_sux, no_inst_sux)); + set_canonical(new IfInstanceOf(inst->klass(), inst->obj(), true, inst->state_before()->bci(), is_inst_sux, no_inst_sux)); } } } else if (rt == objectNull && (l->as_NewInstance() || l->as_NewArray())) { diff --git a/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp b/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp index a25a4bd238c..e784fc953a2 100644 --- a/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp +++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp @@ -22,6 +22,11 @@ * */ +#ifndef SHARE_VM_C1_C1_CANONICALIZER_HPP +#define SHARE_VM_C1_C1_CANONICALIZER_HPP + +#include "c1/c1_Instruction.hpp" + class Canonicalizer: InstructionVisitor { private: Compilation *_compilation; @@ -98,3 +103,5 @@ class Canonicalizer: InstructionVisitor { virtual void do_ProfileCall (ProfileCall* x); virtual void do_ProfileInvoke (ProfileInvoke* x); }; + +#endif // SHARE_VM_C1_C1_CANONICALIZER_HPP diff --git a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp index d8a8ed6bcb7..7579b0cfebc 100644 --- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp +++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp @@ -22,6 +22,16 @@ * */ +#ifndef SHARE_VM_C1_C1_CODESTUBS_HPP +#define SHARE_VM_C1_C1_CODESTUBS_HPP + +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_IR.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_LIR.hpp" +#include "c1/c1_Runtime1.hpp" +#include "utilities/array.hpp" + class CodeEmitInfo; class LIR_Assembler; class LIR_OpVisitState; @@ -586,3 +596,5 @@ class G1PostBarrierStub: public CodeStub { #endif // SERIALGC ////////////////////////////////////////////////////////////////////////////////////////// + +#endif // SHARE_VM_C1_C1_CODESTUBS_HPP diff --git a/hotspot/src/share/vm/c1/c1_Compilation.cpp b/hotspot/src/share/vm/c1/c1_Compilation.cpp index b1dd7e20158..88dc8c7d0d5 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.cpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp @@ -22,8 +22,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_Compilation.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_CFGPrinter.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_IR.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_LinearScan.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_ValueMap.hpp" +#include "c1/c1_ValueStack.hpp" +#include "code/debugInfoRec.hpp" typedef enum { @@ -237,7 +245,7 @@ void Compilation::emit_code_epilog(LIR_Assembler* assembler) { } -void Compilation::setup_code_buffer(CodeBuffer* code, int call_stub_estimate) { +bool Compilation::setup_code_buffer(CodeBuffer* code, int call_stub_estimate) { // Preinitialize the consts section to some large size: int locs_buffer_size = 20 * (relocInfo::length_limit + sizeof(relocInfo)); char* locs_buffer = NEW_RESOURCE_ARRAY(char, locs_buffer_size); @@ -245,15 +253,20 @@ void Compilation::setup_code_buffer(CodeBuffer* code, int call_stub_estimate) { locs_buffer_size / sizeof(relocInfo)); code->initialize_consts_size(Compilation::desired_max_constant_size()); // Call stubs + two deopt handlers (regular and MH) + exception handler - code->initialize_stubs_size((call_stub_estimate * LIR_Assembler::call_stub_size) + - LIR_Assembler::exception_handler_size + - 2 * LIR_Assembler::deopt_handler_size); + int stub_size = (call_stub_estimate * LIR_Assembler::call_stub_size) + + LIR_Assembler::exception_handler_size + + (2 * LIR_Assembler::deopt_handler_size); + if (stub_size >= code->insts_capacity()) return false; + code->initialize_stubs_size(stub_size); + return true; } int Compilation::emit_code_body() { // emit code - setup_code_buffer(code(), allocator()->num_calls()); + if (!setup_code_buffer(code(), allocator()->num_calls())) { + BAILOUT_("size requested greater than avail code buffer size", 0); + } code()->initialize_oop_recorder(env()->oop_recorder()); _masm = new C1_MacroAssembler(code()); @@ -290,8 +303,8 @@ int Compilation::compile_java_method() { CHECK_BAILOUT_(no_frame_size); - if (is_profiling()) { - method()->build_method_data(); + if (is_profiling() && !method()->ensure_method_data()) { + BAILOUT_("mdo allocation failed", no_frame_size); } { @@ -471,9 +484,16 @@ Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* metho _exception_info_list = new ExceptionInfoList(); _implicit_exception_table.set_size(0); compile_method(); - if (is_profiling() && _would_profile) { - ciMethodData *md = method->method_data(); - assert (md != NULL, "Should have MDO"); + if (bailed_out()) { + _env->record_method_not_compilable(bailout_msg(), !TieredCompilation); + if (is_profiling()) { + // Compilation failed, create MDO, which would signal the interpreter + // to start profiling on its own. + _method->ensure_method_data(); + } + } else if (is_profiling() && _would_profile) { + ciMethodData *md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); md->set_would_profile(_would_profile); } } diff --git a/hotspot/src/share/vm/c1/c1_Compilation.hpp b/hotspot/src/share/vm/c1/c1_Compilation.hpp index a66db089173..0d0fe1d3017 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.hpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.hpp @@ -22,7 +22,13 @@ * */ -class BlockBegin; +#ifndef SHARE_VM_C1_C1_COMPILATION_HPP +#define SHARE_VM_C1_C1_COMPILATION_HPP + +#include "ci/ciEnv.hpp" +#include "code/exceptionHandlerTable.hpp" +#include "memory/resourceArea.hpp" + class CompilationResourceObj; class XHandlers; class ExceptionInfo; @@ -179,18 +185,14 @@ class Compilation: public StackObj { return (int) NMethodSizeLimit; // default 256K or 512K #else // conditional branches on PPC are restricted to 16 bit signed - return MAX2((unsigned int)NMethodSizeLimit,32*K); + return MIN2((unsigned int)NMethodSizeLimit,32*K); #endif } static int desired_max_constant_size() { -#ifndef PPC - return (int) NMethodSizeLimit / 10; // about 25K -#else - return (MAX2((unsigned int)NMethodSizeLimit, 32*K)) / 10; -#endif + return desired_max_code_buffer_size() / 10; } - static void setup_code_buffer(CodeBuffer* cb, int call_stub_estimate); + static bool setup_code_buffer(CodeBuffer* cb, int call_stub_estimate); // timers static void print_timers(); @@ -290,3 +292,5 @@ class ExceptionInfo: public CompilationResourceObj { int pco() { return _pco; } XHandlers* exception_handlers() { return _exception_handlers; } }; + +#endif // SHARE_VM_C1_C1_COMPILATION_HPP diff --git a/hotspot/src/share/vm/c1/c1_Compiler.cpp b/hotspot/src/share/vm/c1/c1_Compiler.cpp index 958a080c80a..41b5eb572e6 100644 --- a/hotspot/src/share/vm/c1/c1_Compiler.cpp +++ b/hotspot/src/share/vm/c1/c1_Compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,25 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_Compiler.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_Compiler.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_GraphBuilder.hpp" +#include "c1/c1_LinearScan.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "c1/c1_ValueType.hpp" +#include "compiler/compileBroker.hpp" +#include "compiler/compilerOracle.hpp" +#include "interpreter/linkResolver.hpp" +#include "memory/allocation.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/resourceArea.hpp" +#include "prims/nativeLookup.hpp" +#include "runtime/arguments.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/sharedRuntime.hpp" volatile int Compiler::_runtimes = uninitialized; diff --git a/hotspot/src/share/vm/c1/c1_Compiler.hpp b/hotspot/src/share/vm/c1/c1_Compiler.hpp index 43eb204f755..9702a15ee4b 100644 --- a/hotspot/src/share/vm/c1/c1_Compiler.hpp +++ b/hotspot/src/share/vm/c1/c1_Compiler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_C1_C1_COMPILER_HPP +#define SHARE_VM_C1_C1_COMPILER_HPP + +#include "compiler/abstractCompiler.hpp" + // There is one instance of the Compiler per CompilerThread. class Compiler: public AbstractCompiler { @@ -61,3 +66,5 @@ class Compiler: public AbstractCompiler { // Print compilation timers and statistics virtual void print_timers(); }; + +#endif // SHARE_VM_C1_C1_COMPILER_HPP diff --git a/hotspot/src/share/vm/c1/c1_Defs.cpp b/hotspot/src/share/vm/c1/c1_Defs.cpp index 6b3277e7e3a..db581c9a908 100644 --- a/hotspot/src/share/vm/c1/c1_Defs.cpp +++ b/hotspot/src/share/vm/c1/c1_Defs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +22,6 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_Defs.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Defs.hpp" + diff --git a/hotspot/src/share/vm/c1/c1_Defs.hpp b/hotspot/src/share/vm/c1/c1_Defs.hpp index a2295a6da25..7f964c09ac6 100644 --- a/hotspot/src/share/vm/c1/c1_Defs.hpp +++ b/hotspot/src/share/vm/c1/c1_Defs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,20 @@ * */ +#ifndef SHARE_VM_C1_C1_DEFS_HPP +#define SHARE_VM_C1_C1_DEFS_HPP + +#include "utilities/globalDefinitions.hpp" +#ifdef TARGET_ARCH_x86 +# include "register_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "register_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "register_zero.hpp" +#endif + // set frame size and return address offset to these values in blobs // (if the compiled frame uses ebp as link pointer on IA; otherwise, // the frame size must be fixed) @@ -30,7 +44,13 @@ enum { }; -# include "incls/_c1_Defs_pd.hpp.incl" +#ifdef TARGET_ARCH_x86 +# include "c1_Defs_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "c1_Defs_sparc.hpp" +#endif + // native word offsets from memory address enum { @@ -49,3 +69,5 @@ enum { enum { float_saved_as_double = pd_float_saved_as_double }; + +#endif // SHARE_VM_C1_C1_DEFS_HPP diff --git a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp index 223c747eefe..a84d8a15269 100644 --- a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp +++ b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,22 @@ * */ +#ifndef SHARE_VM_C1_C1_FPUSTACKSIM_HPP +#define SHARE_VM_C1_C1_FPUSTACKSIM_HPP + +#include "c1/c1_FrameMap.hpp" +#include "memory/allocation.hpp" + // Provides location for forward declaration of this class, which is // only implemented on Intel class FpuStackSim; -# include "incls/_c1_FpuStackSim_pd.hpp.incl" // platform dependent declarations +#ifdef TARGET_ARCH_x86 +# include "c1_FpuStackSim_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "c1_FpuStackSim_sparc.hpp" +#endif + + +#endif // SHARE_VM_C1_C1_FPUSTACKSIM_HPP diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.cpp b/hotspot/src/share/vm/c1/c1_FrameMap.cpp index 139572dd138..5b10b966db1 100644 --- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp +++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,19 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_FrameMap.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_LIR.hpp" +#include "runtime/sharedRuntime.hpp" +#ifdef TARGET_ARCH_x86 +# include "vmreg_x86.inline.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "vmreg_sparc.inline.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "vmreg_zero.inline.hpp" +#endif @@ -81,7 +92,7 @@ CallingConvention* FrameMap::java_calling_convention(const BasicTypeArray* signa if (opr->is_address()) { LIR_Address* addr = opr->as_address_ptr(); assert(addr->disp() == (int)addr->disp(), "out of range value"); - out_preserve = MAX2(out_preserve, (intptr_t)addr->disp() / 4); + out_preserve = MAX2(out_preserve, (intptr_t)(addr->disp() - STACK_BIAS) / 4); } i += type2size[t]; } @@ -132,7 +143,7 @@ CallingConvention* FrameMap::c_calling_convention(const BasicTypeArray* signatur args->append(opr); if (opr->is_address()) { LIR_Address* addr = opr->as_address_ptr(); - out_preserve = MAX2(out_preserve, (intptr_t)addr->disp() / 4); + out_preserve = MAX2(out_preserve, (intptr_t)(addr->disp() - STACK_BIAS) / 4); } i += type2size[t]; } diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.hpp b/hotspot/src/share/vm/c1/c1_FrameMap.hpp index 4a229d6bf7e..c112ad54006 100644 --- a/hotspot/src/share/vm/c1/c1_FrameMap.hpp +++ b/hotspot/src/share/vm/c1/c1_FrameMap.hpp @@ -22,6 +22,18 @@ * */ +#ifndef SHARE_VM_C1_C1_FRAMEMAP_HPP +#define SHARE_VM_C1_C1_FRAMEMAP_HPP + +#include "asm/assembler.hpp" +#include "c1/c1_Defs.hpp" +#include "c1/c1_LIR.hpp" +#include "code/vmreg.hpp" +#include "memory/allocation.hpp" +#include "runtime/frame.hpp" +#include "runtime/synchronizer.hpp" +#include "utilities/globalDefinitions.hpp" + class ciMethod; class CallingConvention; class BasicTypeArray; @@ -64,13 +76,19 @@ class FrameMap : public CompilationResourceObj { nof_cpu_regs_reg_alloc = pd_nof_cpu_regs_reg_alloc, nof_fpu_regs_reg_alloc = pd_nof_fpu_regs_reg_alloc, - nof_caller_save_cpu_regs = pd_nof_caller_save_cpu_regs_frame_map, - nof_caller_save_fpu_regs = pd_nof_caller_save_fpu_regs_frame_map, + max_nof_caller_save_cpu_regs = pd_nof_caller_save_cpu_regs_frame_map, + nof_caller_save_fpu_regs = pd_nof_caller_save_fpu_regs_frame_map, spill_slot_size_in_bytes = 4 }; -# include "incls/_c1_FrameMap_pd.hpp.incl" // platform dependent declarations +#ifdef TARGET_ARCH_x86 +# include "c1_FrameMap_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "c1_FrameMap_sparc.hpp" +#endif + friend class LIR_OprDesc; @@ -79,7 +97,7 @@ class FrameMap : public CompilationResourceObj { static Register _cpu_rnr2reg [nof_cpu_regs]; static int _cpu_reg2rnr [nof_cpu_regs]; - static LIR_Opr _caller_save_cpu_regs [nof_caller_save_cpu_regs]; + static LIR_Opr _caller_save_cpu_regs [max_nof_caller_save_cpu_regs]; static LIR_Opr _caller_save_fpu_regs [nof_caller_save_fpu_regs]; int _framesize; @@ -225,7 +243,7 @@ class FrameMap : public CompilationResourceObj { VMReg regname(LIR_Opr opr) const; static LIR_Opr caller_save_cpu_reg_at(int i) { - assert(i >= 0 && i < nof_caller_save_cpu_regs, "out of bounds"); + assert(i >= 0 && i < max_nof_caller_save_cpu_regs, "out of bounds"); return _caller_save_cpu_regs[i]; } @@ -266,3 +284,5 @@ class CallingConvention: public ResourceObj { } #endif // PRODUCT }; + +#endif // SHARE_VM_C1_C1_FRAMEMAP_HPP diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 5b7b7045aa2..1aa2cc00a54 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -22,8 +22,17 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_GraphBuilder.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_CFGPrinter.hpp" +#include "c1/c1_Canonicalizer.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_GraphBuilder.hpp" +#include "c1/c1_InstructionPrinter.hpp" +#include "ci/ciField.hpp" +#include "ci/ciKlass.hpp" +#include "interpreter/bytecode.hpp" +#include "runtime/sharedRuntime.hpp" +#include "utilities/bitMap.inline.hpp" class BlockListBuilder VALUE_OBJ_CLASS_SPEC { private: @@ -659,7 +668,6 @@ GraphBuilder::ScopeData::ScopeData(ScopeData* parent) , _jsr_xhandlers(NULL) , _caller_stack_size(-1) , _continuation(NULL) - , _continuation_state(NULL) , _num_returns(0) , _cleanup_block(NULL) , _cleanup_return_prev(NULL) @@ -795,14 +803,6 @@ void GraphBuilder::sort_top_into_worklist(BlockList* worklist, BlockBegin* top) if (i >= -1) worklist->at_put(i + 1, top); } -int GraphBuilder::ScopeData::caller_stack_size() const { - ValueStack* state = scope()->caller_state(); - if (state == NULL) { - return 0; - } - return state->stack_size(); -} - BlockBegin* GraphBuilder::ScopeData::remove_from_work_list() { if (is_work_list_empty()) { @@ -880,7 +880,7 @@ void GraphBuilder::load_constant() { ciObject* obj = con.as_object(); if (!obj->is_loaded() || (PatchALot && obj->klass() != ciEnv::current()->String_klass())) { - patch_state = state()->copy(); + patch_state = copy_state_before(); t = new ObjectConstant(obj); } else { assert(!obj->is_klass(), "must be java_mirror of klass"); @@ -902,7 +902,8 @@ void GraphBuilder::load_constant() { void GraphBuilder::load_local(ValueType* type, int index) { - Value x = state()->load_local(index); + Value x = state()->local_at(index); + assert(x != NULL && !x->type()->is_illegal(), "access of illegal local variable"); push(type, x); } @@ -942,19 +943,21 @@ void GraphBuilder::store_local(ValueStack* state, Value x, ValueType* type, int void GraphBuilder::load_indexed(BasicType type) { + ValueStack* state_before = copy_state_for_exception(); Value index = ipop(); Value array = apop(); Value length = NULL; if (CSEArrayLength || (array->as_AccessField() && array->as_AccessField()->field()->is_constant()) || (array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant())) { - length = append(new ArrayLength(array, lock_stack())); + length = append(new ArrayLength(array, state_before)); } - push(as_ValueType(type), append(new LoadIndexed(array, index, length, type, lock_stack()))); + push(as_ValueType(type), append(new LoadIndexed(array, index, length, type, state_before))); } void GraphBuilder::store_indexed(BasicType type) { + ValueStack* state_before = copy_state_for_exception(); Value value = pop(as_ValueType(type)); Value index = ipop(); Value array = apop(); @@ -962,9 +965,9 @@ void GraphBuilder::store_indexed(BasicType type) { if (CSEArrayLength || (array->as_AccessField() && array->as_AccessField()->field()->is_constant()) || (array->as_NewArray() && array->as_NewArray()->length() && array->as_NewArray()->length()->type()->is_constant())) { - length = append(new ArrayLength(array, lock_stack())); + length = append(new ArrayLength(array, state_before)); } - StoreIndexed* result = new StoreIndexed(array, index, length, type, value, lock_stack()); + StoreIndexed* result = new StoreIndexed(array, index, length, type, value, state_before); append(result); _memory->store_value(value); @@ -1063,12 +1066,12 @@ void GraphBuilder::stack_op(Bytecodes::Code code) { } -void GraphBuilder::arithmetic_op(ValueType* type, Bytecodes::Code code, ValueStack* stack) { +void GraphBuilder::arithmetic_op(ValueType* type, Bytecodes::Code code, ValueStack* state_before) { Value y = pop(type); Value x = pop(type); // NOTE: strictfp can be queried from current method since we don't // inline methods with differing strictfp bits - Value res = new ArithmeticOp(code, x, y, method()->is_strict(), stack); + Value res = new ArithmeticOp(code, x, y, method()->is_strict(), state_before); // Note: currently single-precision floating-point rounding on Intel is handled at the LIRGenerator level res = append(res); if (method()->is_strict()) { @@ -1132,7 +1135,7 @@ void GraphBuilder::logic_op(ValueType* type, Bytecodes::Code code) { void GraphBuilder::compare_op(ValueType* type, Bytecodes::Code code) { - ValueStack* state_before = state()->copy(); + ValueStack* state_before = copy_state_before(); Value y = pop(type); Value x = pop(type); ipush(append(new CompareOp(code, x, y, state_before))); @@ -1217,7 +1220,7 @@ void GraphBuilder::if_node(Value x, If::Condition cond, Value y, ValueStack* sta void GraphBuilder::if_zero(ValueType* type, If::Condition cond) { Value y = append(new Constant(intZero)); - ValueStack* state_before = state()->copy(); + ValueStack* state_before = copy_state_before(); Value x = ipop(); if_node(x, cond, y, state_before); } @@ -1225,14 +1228,14 @@ void GraphBuilder::if_zero(ValueType* type, If::Condition cond) { void GraphBuilder::if_null(ValueType* type, If::Condition cond) { Value y = append(new Constant(objectNull)); - ValueStack* state_before = state()->copy(); + ValueStack* state_before = copy_state_before(); Value x = apop(); if_node(x, cond, y, state_before); } void GraphBuilder::if_same(ValueType* type, If::Condition cond) { - ValueStack* state_before = state()->copy(); + ValueStack* state_before = copy_state_before(); Value y = pop(type); Value x = pop(type); if_node(x, cond, y, state_before); @@ -1282,7 +1285,7 @@ void GraphBuilder::table_switch() { BlockBegin* tsux = block_at(bci() + switch_->dest_offset_at(0)); BlockBegin* fsux = block_at(bci() + switch_->default_offset()); bool is_bb = tsux->bci() < bci() || fsux->bci() < bci(); - ValueStack* state_before = is_bb ? state() : NULL; + ValueStack* state_before = is_bb ? copy_state_before() : NULL; append(new If(ipop(), If::eql, true, key, tsux, fsux, state_before, is_bb)); } else { // collect successors @@ -1295,7 +1298,7 @@ void GraphBuilder::table_switch() { } // add default successor sux->at_put(i, block_at(bci() + switch_->default_offset())); - ValueStack* state_before = has_bb ? state() : NULL; + ValueStack* state_before = has_bb ? copy_state_before() : NULL; append(new TableSwitch(ipop(), sux, switch_->low_key(), state_before, has_bb)); } } @@ -1314,7 +1317,7 @@ void GraphBuilder::lookup_switch() { BlockBegin* tsux = block_at(bci() + pair->offset()); BlockBegin* fsux = block_at(bci() + switch_->default_offset()); bool is_bb = tsux->bci() < bci() || fsux->bci() < bci(); - ValueStack* state_before = is_bb ? state() : NULL; + ValueStack* state_before = is_bb ? copy_state_before() : NULL; append(new If(ipop(), If::eql, true, key, tsux, fsux, state_before, is_bb)); } else { // collect successors & keys @@ -1330,7 +1333,7 @@ void GraphBuilder::lookup_switch() { } // add default successor sux->at_put(i, block_at(bci() + switch_->default_offset())); - ValueStack* state_before = has_bb ? state() : NULL; + ValueStack* state_before = has_bb ? copy_state_before() : NULL; append(new LookupSwitch(ipop(), sux, keys, state_before, has_bb)); } } @@ -1340,7 +1343,7 @@ void GraphBuilder::call_register_finalizer() { // the registration on return. // Gather some type information about the receiver - Value receiver = state()->load_local(0); + Value receiver = state()->local_at(0); assert(receiver != NULL, "must have a receiver"); ciType* declared_type = receiver->declared_type(); ciType* exact_type = receiver->exact_type(); @@ -1373,10 +1376,11 @@ void GraphBuilder::call_register_finalizer() { if (needs_check) { // Perform the registration of finalizable objects. + ValueStack* state_before = copy_state_for_exception(); load_local(objectType, 0); append_split(new Intrinsic(voidType, vmIntrinsics::_Object_init, state()->pop_arguments(1), - true, lock_stack(), true)); + true, state_before, true)); } } @@ -1395,12 +1399,14 @@ void GraphBuilder::method_return(Value x) { // If the inlined method is synchronized, the monitor must be // released before we jump to the continuation block. if (method()->is_synchronized()) { - int i = state()->caller_state()->locks_size(); - assert(state()->locks_size() == i + 1, "receiver must be locked here"); - monitorexit(state()->lock_at(i), SynchronizationEntryBCI); + assert(state()->locks_size() == 1, "receiver must be locked here"); + monitorexit(state()->lock_at(0), SynchronizationEntryBCI); } - state()->truncate_stack(caller_stack_size()); + // State at end of inlined method is the state of the caller + // without the method parameters on stack, including the + // return value, if any, of the inlined method on operand stack. + set_state(state()->caller_state()->copy_for_parsing()); if (x != NULL) { state()->push(x->type(), x); } @@ -1412,14 +1418,6 @@ void GraphBuilder::method_return(Value x) { set_inline_cleanup_info(_block, _last, state()); } - // State at end of inlined method is the state of the caller - // without the method parameters on stack, including the - // return value, if any, of the inlined method on operand stack. - set_state(scope_data()->continuation_state()->copy()); - if (x) { - state()->push(x->type(), x); - } - // The current bci() is in the wrong scope, so use the bci() of // the continuation point. append_with_bci(goto_callee, scope_data()->continuation()->bci()); @@ -1455,11 +1453,11 @@ void GraphBuilder::access_field(Bytecodes::Code code) { field->will_link(method()->holder(), code); const bool is_initialized = is_loaded && holder->is_initialized(); - ValueStack* state_copy = NULL; + ValueStack* state_before = NULL; if (!is_initialized || PatchALot) { // save state before instruction for debug info when // deoptimization happens during patching - state_copy = state()->copy(); + state_before = copy_state_before(); } Value obj = NULL; @@ -1468,9 +1466,9 @@ void GraphBuilder::access_field(Bytecodes::Code code) { // fully initialized and resolved in this constant pool. The will_link test // above essentially checks if this class is resolved in this constant pool // so, the is_initialized flag should be suffiect. - if (state_copy != NULL) { + if (state_before != NULL) { // build a patching constant - obj = new Constant(new ClassConstant(holder), state_copy); + obj = new Constant(new ClassConstant(holder), state_before); } else { obj = new Constant(new ClassConstant(holder)); } @@ -1499,25 +1497,32 @@ void GraphBuilder::access_field(Bytecodes::Code code) { } if (constant != NULL) { push(type, append(constant)); - state_copy = NULL; // Not a potential deoptimization point (see set_state_before logic below) } else { + if (state_before == NULL) { + state_before = copy_state_for_exception(); + } push(type, append(new LoadField(append(obj), offset, field, true, - lock_stack(), state_copy, is_loaded, is_initialized))); + state_before, is_loaded, is_initialized))); } break; } case Bytecodes::_putstatic: { Value val = pop(type); - append(new StoreField(append(obj), offset, field, val, true, lock_stack(), state_copy, is_loaded, is_initialized)); + if (state_before == NULL) { + state_before = copy_state_for_exception(); + } + append(new StoreField(append(obj), offset, field, val, true, state_before, is_loaded, is_initialized)); } break; case Bytecodes::_getfield : { - LoadField* load = new LoadField(apop(), offset, field, false, lock_stack(), state_copy, is_loaded, true); + if (state_before == NULL) { + state_before = copy_state_for_exception(); + } + LoadField* load = new LoadField(apop(), offset, field, false, state_before, is_loaded, true); Value replacement = is_loaded ? _memory->load(load) : load; if (replacement != load) { - assert(replacement->bci() != -99 || replacement->as_Phi() || replacement->as_Local(), - "should already by linked"); + assert(replacement->is_linked() || !replacement->can_be_linked(), "should already by linked"); push(type, replacement); } else { push(type, append(load)); @@ -1527,7 +1532,10 @@ void GraphBuilder::access_field(Bytecodes::Code code) { case Bytecodes::_putfield : { Value val = pop(type); - StoreField* store = new StoreField(apop(), offset, field, val, false, lock_stack(), state_copy, is_loaded, true); + if (state_before == NULL) { + state_before = copy_state_for_exception(); + } + StoreField* store = new StoreField(apop(), offset, field, val, false, state_before, is_loaded, true); if (is_loaded) store = _memory->store(store); if (store != NULL) { append(store); @@ -1647,7 +1655,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) { actual_recv = target->holder(); // insert a check it's really the expected class. - CheckCast* c = new CheckCast(klass, receiver, NULL); + CheckCast* c = new CheckCast(klass, receiver, copy_state_for_exception()); c->set_incompatible_class_change_check(); c->set_direct_compare(klass->is_final()); append_split(c); @@ -1732,7 +1740,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) { // We require the debug info to be the "state before" because // invokedynamics may deoptimize. - ValueStack* state_before = is_invokedynamic ? state()->copy() : NULL; + ValueStack* state_before = is_invokedynamic ? copy_state_before() : copy_state_exhandling(); Values* args = state()->pop_arguments(target->arg_size_no_receiver()); Value recv = has_receiver ? apop() : NULL; @@ -1795,24 +1803,26 @@ void GraphBuilder::invoke(Bytecodes::Code code) { void GraphBuilder::new_instance(int klass_index) { + ValueStack* state_before = copy_state_exhandling(); bool will_link; ciKlass* klass = stream()->get_klass(will_link); assert(klass->is_instance_klass(), "must be an instance klass"); - NewInstance* new_instance = new NewInstance(klass->as_instance_klass()); + NewInstance* new_instance = new NewInstance(klass->as_instance_klass(), state_before); _memory->new_instance(new_instance); apush(append_split(new_instance)); } void GraphBuilder::new_type_array() { - apush(append_split(new NewTypeArray(ipop(), (BasicType)stream()->get_index()))); + ValueStack* state_before = copy_state_exhandling(); + apush(append_split(new NewTypeArray(ipop(), (BasicType)stream()->get_index(), state_before))); } void GraphBuilder::new_object_array() { bool will_link; ciKlass* klass = stream()->get_klass(will_link); - ValueStack* state_before = !klass->is_loaded() || PatchALot ? state()->copy() : NULL; + ValueStack* state_before = !klass->is_loaded() || PatchALot ? copy_state_before() : copy_state_exhandling(); NewArray* n = new NewObjectArray(klass, ipop(), state_before); apush(append_split(n)); } @@ -1838,7 +1848,7 @@ bool GraphBuilder::direct_compare(ciKlass* k) { void GraphBuilder::check_cast(int klass_index) { bool will_link; ciKlass* klass = stream()->get_klass(will_link); - ValueStack* state_before = !klass->is_loaded() || PatchALot ? state()->copy() : NULL; + ValueStack* state_before = !klass->is_loaded() || PatchALot ? copy_state_before() : copy_state_for_exception(); CheckCast* c = new CheckCast(klass, apop(), state_before); apush(append_split(c)); c->set_direct_compare(direct_compare(klass)); @@ -1859,7 +1869,7 @@ void GraphBuilder::check_cast(int klass_index) { void GraphBuilder::instance_of(int klass_index) { bool will_link; ciKlass* klass = stream()->get_klass(will_link); - ValueStack* state_before = !klass->is_loaded() || PatchALot ? state()->copy() : NULL; + ValueStack* state_before = !klass->is_loaded() || PatchALot ? copy_state_before() : copy_state_exhandling(); InstanceOf* i = new InstanceOf(klass, apop(), state_before); ipush(append_split(i)); i->set_direct_compare(direct_compare(klass)); @@ -1879,25 +1889,13 @@ void GraphBuilder::instance_of(int klass_index) { void GraphBuilder::monitorenter(Value x, int bci) { // save state before locking in case of deoptimization after a NullPointerException - ValueStack* lock_stack_before = lock_stack(); - append_with_bci(new MonitorEnter(x, state()->lock(scope(), x), lock_stack_before), bci); + ValueStack* state_before = copy_state_for_exception_with_bci(bci); + append_with_bci(new MonitorEnter(x, state()->lock(x), state_before), bci); kill_all(); } void GraphBuilder::monitorexit(Value x, int bci) { - // Note: the comment below is only relevant for the case where we do - // not deoptimize due to asynchronous exceptions (!(DeoptC1 && - // DeoptOnAsyncException), which is not used anymore) - - // Note: Potentially, the monitor state in an exception handler - // can be wrong due to wrong 'initialization' of the handler - // via a wrong asynchronous exception path. This can happen, - // if the exception handler range for asynchronous exceptions - // is too long (see also java bug 4327029, and comment in - // GraphBuilder::handle_exception()). This may cause 'under- - // flow' of the monitor stack => bailout instead. - if (state()->locks_size() < 1) BAILOUT("monitor stack underflow"); append_with_bci(new MonitorExit(x, state()->unlock()), bci); kill_all(); } @@ -1906,7 +1904,7 @@ void GraphBuilder::monitorexit(Value x, int bci) { void GraphBuilder::new_multi_array(int dimensions) { bool will_link; ciKlass* klass = stream()->get_klass(will_link); - ValueStack* state_before = !klass->is_loaded() || PatchALot ? state()->copy() : NULL; + ValueStack* state_before = !klass->is_loaded() || PatchALot ? copy_state_before() : copy_state_exhandling(); Values* dims = new Values(dimensions, NULL); // fill in all dimensions @@ -1921,8 +1919,10 @@ void GraphBuilder::new_multi_array(int dimensions) { void GraphBuilder::throw_op(int bci) { // We require that the debug info for a Throw be the "state before" // the Throw (i.e., exception oop is still on TOS) - ValueStack* state_before = state()->copy(); + ValueStack* state_before = copy_state_before_with_bci(bci); Throw* t = new Throw(apop(), state_before); + // operand stack not needed after a throw + state()->truncate_stack(0); append_with_bci(t, bci); } @@ -1947,60 +1947,62 @@ Value GraphBuilder::round_fp(Value fp_value) { Instruction* GraphBuilder::append_with_bci(Instruction* instr, int bci) { Canonicalizer canon(compilation(), instr, bci); Instruction* i1 = canon.canonical(); - if (i1->bci() != -99) { + if (i1->is_linked() || !i1->can_be_linked()) { // Canonicalizer returned an instruction which was already // appended so simply return it. return i1; - } else if (UseLocalValueNumbering) { + } + + if (UseLocalValueNumbering) { // Lookup the instruction in the ValueMap and add it to the map if // it's not found. Instruction* i2 = vmap()->find_insert(i1); if (i2 != i1) { // found an entry in the value map, so just return it. - assert(i2->bci() != -1, "should already be linked"); + assert(i2->is_linked(), "should already be linked"); return i2; } ValueNumberingEffects vne(vmap()); i1->visit(&vne); } - if (i1->as_Phi() == NULL && i1->as_Local() == NULL) { - // i1 was not eliminated => append it - assert(i1->next() == NULL, "shouldn't already be linked"); - _last = _last->set_next(i1, canon.bci()); - if (++_instruction_count >= InstructionCountCutoff - && !bailed_out()) { - // set the bailout state but complete normal processing. We - // might do a little more work before noticing the bailout so we - // want processing to continue normally until it's noticed. - bailout("Method and/or inlining is too large"); - } + // i1 was not eliminated => append it + assert(i1->next() == NULL, "shouldn't already be linked"); + _last = _last->set_next(i1, canon.bci()); + + if (++_instruction_count >= InstructionCountCutoff && !bailed_out()) { + // set the bailout state but complete normal processing. We + // might do a little more work before noticing the bailout so we + // want processing to continue normally until it's noticed. + bailout("Method and/or inlining is too large"); + } #ifndef PRODUCT - if (PrintIRDuringConstruction) { - InstructionPrinter ip; - ip.print_line(i1); - if (Verbose) { - state()->print(); - } + if (PrintIRDuringConstruction) { + InstructionPrinter ip; + ip.print_line(i1); + if (Verbose) { + state()->print(); } + } #endif - assert(_last == i1, "adjust code below"); - StateSplit* s = i1->as_StateSplit(); - if (s != NULL && i1->as_BlockEnd() == NULL) { - if (EliminateFieldAccess) { - Intrinsic* intrinsic = s->as_Intrinsic(); - if (s->as_Invoke() != NULL || (intrinsic && !intrinsic->preserves_state())) { - _memory->kill(); - } + + // save state after modification of operand stack for StateSplit instructions + StateSplit* s = i1->as_StateSplit(); + if (s != NULL) { + if (EliminateFieldAccess) { + Intrinsic* intrinsic = s->as_Intrinsic(); + if (s->as_Invoke() != NULL || (intrinsic && !intrinsic->preserves_state())) { + _memory->kill(); } - s->set_state(state()->copy()); - } - // set up exception handlers for this instruction if necessary - if (i1->can_trap()) { - assert(exception_state() != NULL || !has_handler(), "must have setup exception state"); - i1->set_exception_handlers(handle_exception(bci)); } + s->set_state(state()->copy(ValueStack::StateAfter, canon.bci())); + } + + // set up exception handlers for this instruction if necessary + if (i1->can_trap()) { + i1->set_exception_handlers(handle_exception(i1)); + assert(i1->exception_state() != NULL || !i1->needs_exception_state() || bailed_out(), "handle_exception must set exception state"); } return i1; } @@ -2032,26 +2034,30 @@ void GraphBuilder::null_check(Value value) { } } } - append(new NullCheck(value, lock_stack())); + append(new NullCheck(value, copy_state_for_exception())); } -XHandlers* GraphBuilder::handle_exception(int cur_bci) { - // fast path if it is guaranteed that no exception handlers are present - if (!has_handler()) { - // TODO: check if return NULL is possible (avoids empty lists) +XHandlers* GraphBuilder::handle_exception(Instruction* instruction) { + if (!has_handler() && (!instruction->needs_exception_state() || instruction->exception_state() != NULL)) { + assert(instruction->exception_state() == NULL + || instruction->exception_state()->kind() == ValueStack::EmptyExceptionState + || (instruction->exception_state()->kind() == ValueStack::ExceptionState && _compilation->env()->jvmti_can_access_local_variables()), + "exception_state should be of exception kind"); return new XHandlers(); } XHandlers* exception_handlers = new XHandlers(); ScopeData* cur_scope_data = scope_data(); - ValueStack* s = exception_state(); + ValueStack* cur_state = instruction->state_before(); + ValueStack* prev_state = NULL; int scope_count = 0; - assert(s != NULL, "exception state must be set"); + assert(cur_state != NULL, "state_before must be set"); do { - assert(cur_scope_data->scope() == s->scope(), "scopes do not match"); + int cur_bci = cur_state->bci(); + assert(cur_scope_data->scope() == cur_state->scope(), "scopes do not match"); assert(cur_bci == SynchronizationEntryBCI || cur_bci == cur_scope_data->stream()->cur_bci(), "invalid bci"); // join with all potential exception handlers @@ -2075,10 +2081,15 @@ XHandlers* GraphBuilder::handle_exception(int cur_bci) { // previously this was a BAILOUT, but this is not necessary // now because asynchronous exceptions are not handled this way. - assert(entry->state() == NULL || s->locks_size() == entry->state()->locks_size(), "locks do not match"); + assert(entry->state() == NULL || cur_state->total_locks_size() == entry->state()->total_locks_size(), "locks do not match"); // xhandler start with an empty expression stack - s->truncate_stack(cur_scope_data->caller_stack_size()); + if (cur_state->stack_size() != 0) { + cur_state = cur_state->copy(ValueStack::ExceptionState, cur_state->bci()); + } + if (instruction->exception_state() == NULL) { + instruction->set_exception_state(cur_state); + } // Note: Usually this join must work. However, very // complicated jsr-ret structures where we don't ret from @@ -2087,12 +2098,12 @@ XHandlers* GraphBuilder::handle_exception(int cur_bci) { // The only test case we've seen so far which exhibits this // problem is caught by the infinite recursion test in // GraphBuilder::jsr() if the join doesn't work. - if (!entry->try_merge(s)) { + if (!entry->try_merge(cur_state)) { BAILOUT_("error while joining with exception handler, prob. due to complicated jsr/rets", exception_handlers); } // add current state for correct handling of phi functions at begin of xhandler - int phi_operand = entry->add_exception_state(s); + int phi_operand = entry->add_exception_state(cur_state); // add entry to the list of xhandlers of this block _block->add_exception_handler(entry); @@ -2119,26 +2130,39 @@ XHandlers* GraphBuilder::handle_exception(int cur_bci) { } } + if (exception_handlers->length() == 0) { + // This scope and all callees do not handle exceptions, so the local + // variables of this scope are not needed. However, the scope itself is + // required for a correct exception stack trace -> clear out the locals. + if (_compilation->env()->jvmti_can_access_local_variables()) { + cur_state = cur_state->copy(ValueStack::ExceptionState, cur_state->bci()); + } else { + cur_state = cur_state->copy(ValueStack::EmptyExceptionState, cur_state->bci()); + } + if (prev_state != NULL) { + prev_state->set_caller_state(cur_state); + } + if (instruction->exception_state() == NULL) { + instruction->set_exception_state(cur_state); + } + } + // Set up iteration for next time. // If parsing a jsr, do not grab exception handlers from the // parent scopes for this method (already got them, and they // needed to be cloned) - if (cur_scope_data->parsing_jsr()) { - IRScope* tmp_scope = cur_scope_data->scope(); - while (cur_scope_data->parent() != NULL && - cur_scope_data->parent()->scope() == tmp_scope) { - cur_scope_data = cur_scope_data->parent(); - } - } - if (cur_scope_data != NULL) { - if (cur_scope_data->parent() != NULL) { - // must use pop_scope instead of caller_state to preserve all monitors - s = s->pop_scope(); - } - cur_bci = cur_scope_data->scope()->caller_bci(); + + while (cur_scope_data->parsing_jsr()) { cur_scope_data = cur_scope_data->parent(); - scope_count++; } + + assert(cur_scope_data->scope() == cur_state->scope(), "scopes do not match"); + assert(cur_state->locks_size() == 0 || cur_state->locks_size() == 1, "unlocking must be done in a catchall exception handler"); + + prev_state = cur_state; + cur_state = cur_state->caller_state(); + cur_scope_data = cur_scope_data->parent(); + scope_count++; } while (cur_scope_data != NULL); return exception_handlers; @@ -2243,14 +2267,10 @@ void PhiSimplifier::block_do(BlockBegin* b) { ); ValueStack* state = b->state()->caller_state(); - int index; - Value value; - for_each_state(state) { - for_each_local_value(state, index, value) { - Phi* phi = value->as_Phi(); - assert(phi == NULL || phi->block() != b, "must not have phi function to simplify in caller state"); - } - } + for_each_state_value(state, value, + Phi* phi = value->as_Phi(); + assert(phi == NULL || phi->block() != b, "must not have phi function to simplify in caller state"); + ); #endif } @@ -2265,7 +2285,7 @@ void GraphBuilder::connect_to_end(BlockBegin* beg) { // setup iteration kill_all(); _block = beg; - _state = beg->state()->copy(); + _state = beg->state()->copy_for_parsing(); _last = beg; iterate_bytecodes_for_block(beg->bci()); } @@ -2301,14 +2321,7 @@ BlockEnd* GraphBuilder::iterate_bytecodes_for_block(int bci) { while (!bailed_out() && last()->as_BlockEnd() == NULL && (code = stream()->next()) != ciBytecodeStream::EOBC() && (block_at(s.cur_bci()) == NULL || block_at(s.cur_bci()) == block())) { - - if (has_handler() && can_trap(method(), code)) { - // copy the state because it is modified before handle_exception is called - set_exception_state(state()->copy()); - } else { - // handle_exception is not called for this bytecode - set_exception_state(NULL); - } + assert(state()->kind() == ValueStack::Parsing, "invalid state kind"); // Check for active jsr during OSR compilation if (compilation()->is_osr_compile() @@ -2433,12 +2446,12 @@ BlockEnd* GraphBuilder::iterate_bytecodes_for_block(int bci) { case Bytecodes::_lmul : arithmetic_op(longType , code); break; case Bytecodes::_fmul : arithmetic_op(floatType , code); break; case Bytecodes::_dmul : arithmetic_op(doubleType, code); break; - case Bytecodes::_idiv : arithmetic_op(intType , code, lock_stack()); break; - case Bytecodes::_ldiv : arithmetic_op(longType , code, lock_stack()); break; + case Bytecodes::_idiv : arithmetic_op(intType , code, copy_state_for_exception()); break; + case Bytecodes::_ldiv : arithmetic_op(longType , code, copy_state_for_exception()); break; case Bytecodes::_fdiv : arithmetic_op(floatType , code); break; case Bytecodes::_ddiv : arithmetic_op(doubleType, code); break; - case Bytecodes::_irem : arithmetic_op(intType , code, lock_stack()); break; - case Bytecodes::_lrem : arithmetic_op(longType , code, lock_stack()); break; + case Bytecodes::_irem : arithmetic_op(intType , code, copy_state_for_exception()); break; + case Bytecodes::_lrem : arithmetic_op(longType , code, copy_state_for_exception()); break; case Bytecodes::_frem : arithmetic_op(floatType , code); break; case Bytecodes::_drem : arithmetic_op(doubleType, code); break; case Bytecodes::_ineg : negate_op(intType ); break; @@ -2515,11 +2528,10 @@ BlockEnd* GraphBuilder::iterate_bytecodes_for_block(int bci) { case Bytecodes::_new : new_instance(s.get_index_u2()); break; case Bytecodes::_newarray : new_type_array(); break; case Bytecodes::_anewarray : new_object_array(); break; - case Bytecodes::_arraylength : ipush(append(new ArrayLength(apop(), lock_stack()))); break; + case Bytecodes::_arraylength : { ValueStack* state_before = copy_state_for_exception(); ipush(append(new ArrayLength(apop(), state_before))); break; } case Bytecodes::_athrow : throw_op(s.cur_bci()); break; case Bytecodes::_checkcast : check_cast(s.get_index_u2()); break; case Bytecodes::_instanceof : instance_of(s.get_index_u2()); break; - // Note: we do not have special handling for the monitorenter bytecode if DeoptC1 && DeoptOnAsyncException case Bytecodes::_monitorenter : monitorenter(apop(), s.cur_bci()); break; case Bytecodes::_monitorexit : monitorexit (apop(), s.cur_bci()); break; case Bytecodes::_wide : ShouldNotReachHere(); break; @@ -2546,28 +2558,22 @@ BlockEnd* GraphBuilder::iterate_bytecodes_for_block(int bci) { if (end == NULL) { // all blocks must end with a BlockEnd instruction => add a Goto end = new Goto(block_at(s.cur_bci()), false); - _last = _last->set_next(end, prev_bci); + append(end); } assert(end == last()->as_BlockEnd(), "inconsistency"); - // if the method terminates, we don't need the stack anymore - if (end->as_Return() != NULL) { - state()->clear_stack(); - } else if (end->as_Throw() != NULL) { - // May have exception handler in caller scopes - state()->truncate_stack(scope()->lock_stack_size()); - } + assert(end->state() != NULL, "state must already be present"); + assert(end->as_Return() == NULL || end->as_Throw() == NULL || end->state()->stack_size() == 0, "stack not needed for return and throw"); // connect to begin & set state // NOTE that inlining may have changed the block we are parsing block()->set_end(end); - end->set_state(state()); // propagate state for (int i = end->number_of_sux() - 1; i >= 0; i--) { BlockBegin* sux = end->sux_at(i); assert(sux->is_predecessor(block()), "predecessor missing"); // be careful, bailout if bytecodes are strange - if (!sux->try_merge(state())) BAILOUT_("block join failed", NULL); + if (!sux->try_merge(end->state())) BAILOUT_("block join failed", NULL); scope_data()->add_to_work_list(end->sux_at(i)); } @@ -2605,7 +2611,6 @@ void GraphBuilder::iterate_all_blocks(bool start_in_current_block_for_inlining) bool GraphBuilder::_can_trap [Bytecodes::number_of_java_codes]; -bool GraphBuilder::_is_async[Bytecodes::number_of_java_codes]; void GraphBuilder::initialize() { // the following bytecodes are assumed to potentially @@ -2657,67 +2662,14 @@ void GraphBuilder::initialize() { , Bytecodes::_multianewarray }; - // the following bytecodes are assumed to potentially - // throw asynchronous exceptions in compiled code due - // to safepoints (note: these entries could be merged - // with the can_trap_list - however, we need to know - // which ones are asynchronous for now - see also the - // comment in GraphBuilder::handle_exception) - Bytecodes::Code is_async_list[] = - { Bytecodes::_ifeq - , Bytecodes::_ifne - , Bytecodes::_iflt - , Bytecodes::_ifge - , Bytecodes::_ifgt - , Bytecodes::_ifle - , Bytecodes::_if_icmpeq - , Bytecodes::_if_icmpne - , Bytecodes::_if_icmplt - , Bytecodes::_if_icmpge - , Bytecodes::_if_icmpgt - , Bytecodes::_if_icmple - , Bytecodes::_if_acmpeq - , Bytecodes::_if_acmpne - , Bytecodes::_goto - , Bytecodes::_jsr - , Bytecodes::_ret - , Bytecodes::_tableswitch - , Bytecodes::_lookupswitch - , Bytecodes::_ireturn - , Bytecodes::_lreturn - , Bytecodes::_freturn - , Bytecodes::_dreturn - , Bytecodes::_areturn - , Bytecodes::_return - , Bytecodes::_ifnull - , Bytecodes::_ifnonnull - , Bytecodes::_goto_w - , Bytecodes::_jsr_w - }; - // inititialize trap tables for (int i = 0; i < Bytecodes::number_of_java_codes; i++) { _can_trap[i] = false; - _is_async[i] = false; } // set standard trap info for (uint j = 0; j < ARRAY_SIZE(can_trap_list); j++) { _can_trap[can_trap_list[j]] = true; } - - // We now deoptimize if an asynchronous exception is thrown. This - // considerably cleans up corner case issues related to javac's - // incorrect exception handler ranges for async exceptions and - // allows us to precisely analyze the types of exceptions from - // certain bytecodes. - if (!(DeoptC1 && DeoptOnAsyncException)) { - // set asynchronous trap info - for (uint k = 0; k < ARRAY_SIZE(is_async_list); k++) { - assert(!_can_trap[is_async_list[k]], "can_trap_list and is_async_list should be disjoint"); - _can_trap[is_async_list[k]] = true; - _is_async[is_async_list[k]] = true; - } - } } @@ -2733,7 +2685,7 @@ BlockBegin* GraphBuilder::header_block(BlockBegin* entry, BlockBegin::Flag f, Va h->set_end(g); h->set(f); // setup header block end state - ValueStack* s = state->copy(); // can use copy since stack is empty (=> no phis) + ValueStack* s = state->copy(ValueStack::StateAfter, entry->bci()); // can use copy since stack is empty (=> no phis) assert(s->stack_is_empty(), "must have empty stack at entry point"); g->set_state(s); return h; @@ -2768,8 +2720,8 @@ BlockBegin* GraphBuilder::setup_start_block(int osr_bci, BlockBegin* std_entry, start->set_next(base, 0); start->set_end(base); // create & setup state for start block - start->set_state(state->copy()); - base->set_state(state->copy()); + start->set_state(state->copy(ValueStack::StateAfter, std_entry->bci())); + base->set_state(state->copy(ValueStack::StateAfter, std_entry->bci())); if (base->std_entry()->state() == NULL) { // setup states for header blocks @@ -2803,6 +2755,7 @@ void GraphBuilder::setup_osr_entry_block() { kill_all(); _block = _osr_entry; _state = _osr_entry->state()->copy(); + assert(_state->bci() == osr_bci, "mismatch"); _last = _osr_entry; Value e = append(new OsrEntry()); e->set_needs_null_check(false); @@ -2842,7 +2795,7 @@ void GraphBuilder::setup_osr_entry_block() { get = append(new UnsafeGetRaw(as_BasicType(local->type()), e, append(new Constant(new IntConstant(offset))), 0, - true)); + true /*unaligned*/, true /*wide*/)); } _state->store_local(index, get); } @@ -2852,7 +2805,6 @@ void GraphBuilder::setup_osr_entry_block() { assert(state->caller_state() == NULL, "should be top scope"); state->clear_locals(); Goto* g = new Goto(target, false); - g->set_state(_state->copy()); append(g); _osr_entry->set_end(g); target->merge(_osr_entry->end()->state()); @@ -2862,7 +2814,7 @@ void GraphBuilder::setup_osr_entry_block() { ValueStack* GraphBuilder::state_at_entry() { - ValueStack* state = new ValueStack(scope(), method()->max_locals(), method()->max_stack()); + ValueStack* state = new ValueStack(scope(), NULL); // Set up locals for receiver int idx = 0; @@ -2886,7 +2838,7 @@ ValueStack* GraphBuilder::state_at_entry() { // lock synchronized method if (method()->is_synchronized()) { - state->lock(scope(), NULL); + state->lock(NULL); } return state; @@ -2895,7 +2847,6 @@ ValueStack* GraphBuilder::state_at_entry() { GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope) : _scope_data(NULL) - , _exception_state(NULL) , _instruction_count(0) , _osr_entry(NULL) , _memory(new MemoryBuffer()) @@ -2919,7 +2870,6 @@ GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope) // complete graph _vmap = new ValueMap(); - scope->compute_lock_stack_size(); switch (scope->method()->intrinsic_id()) { case vmIntrinsics::_dabs : // fall through case vmIntrinsics::_dsqrt : // fall through @@ -2945,7 +2895,7 @@ GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope) // setup the initial block state _block = start_block; - _state = start_block->state()->copy(); + _state = start_block->state()->copy_for_parsing(); _last = start_block; load_local(doubleType, 0); @@ -2957,7 +2907,6 @@ GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope) // connect the begin and end blocks and we're all done. BlockEnd* end = last()->as_BlockEnd(); block()->set_end(end); - end->set_state(state()); break; } default: @@ -2988,13 +2937,38 @@ GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope) } -ValueStack* GraphBuilder::lock_stack() { - // return a new ValueStack representing just the current lock stack - // (for debug info at safepoints in exception throwing or handling) - ValueStack* new_stack = state()->copy_locks(); - return new_stack; +ValueStack* GraphBuilder::copy_state_before() { + return copy_state_before_with_bci(bci()); } +ValueStack* GraphBuilder::copy_state_exhandling() { + return copy_state_exhandling_with_bci(bci()); +} + +ValueStack* GraphBuilder::copy_state_for_exception() { + return copy_state_for_exception_with_bci(bci()); +} + +ValueStack* GraphBuilder::copy_state_before_with_bci(int bci) { + return state()->copy(ValueStack::StateBefore, bci); +} + +ValueStack* GraphBuilder::copy_state_exhandling_with_bci(int bci) { + if (!has_handler()) return NULL; + return state()->copy(ValueStack::StateBefore, bci); +} + +ValueStack* GraphBuilder::copy_state_for_exception_with_bci(int bci) { + ValueStack* s = copy_state_exhandling_with_bci(bci); + if (s == NULL) { + if (_compilation->env()->jvmti_can_access_local_variables()) { + s = state()->copy(ValueStack::ExceptionState, bci); + } else { + s = state()->copy(ValueStack::EmptyExceptionState, bci); + } + } + return s; +} int GraphBuilder::recursive_inline_level(ciMethod* cur_callee) const { int recur_level = 0; @@ -3177,9 +3151,9 @@ bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) { // create intrinsic node const bool has_receiver = !callee->is_static(); ValueType* result_type = as_ValueType(callee->return_type()); + ValueStack* state_before = copy_state_for_exception(); Values* args = state()->pop_arguments(callee->arg_size()); - ValueStack* locks = lock_stack(); if (is_profiling()) { // Don't profile in the special case where the root method @@ -3198,7 +3172,7 @@ bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) { } } - Intrinsic* result = new Intrinsic(result_type, id, args, has_receiver, lock_stack(), + Intrinsic* result = new Intrinsic(result_type, id, args, has_receiver, state_before, preserves_state, cantrap); // append instruction & push result Value value = append_split(result); @@ -3236,10 +3210,9 @@ bool GraphBuilder::try_inline_jsr(int jsr_dest_bci) { assert(jsr_start_block != NULL, "jsr start block must exist"); assert(!jsr_start_block->is_set(BlockBegin::was_visited_flag), "should not have visited jsr yet"); Goto* goto_sub = new Goto(jsr_start_block, false); - goto_sub->set_state(state()); // Must copy state to avoid wrong sharing when parsing bytecodes assert(jsr_start_block->state() == NULL, "should have fresh jsr starting block"); - jsr_start_block->set_state(state()->copy()); + jsr_start_block->set_state(copy_state_before_with_bci(jsr_dest_bci)); append(goto_sub); _block->set_end(goto_sub); _last = _block = jsr_start_block; @@ -3290,7 +3263,6 @@ bool GraphBuilder::try_inline_jsr(int jsr_dest_bci) { void GraphBuilder::inline_sync_entry(Value lock, BlockBegin* sync_handler) { assert(lock != NULL && sync_handler != NULL, "lock or handler missing"); - set_exception_state(state()->copy()); monitorenter(lock, SynchronizationEntryBCI); assert(_last->as_MonitorEnter() != NULL, "monitor enter expected"); _last->set_needs_null_check(false); @@ -3332,7 +3304,7 @@ void GraphBuilder::fill_sync_handler(Value lock, BlockBegin* sync_handler, bool int bci = SynchronizationEntryBCI; if (lock) { assert(state()->locks_size() > 0 && state()->lock_at(state()->locks_size() - 1) == lock, "lock is missing"); - if (lock->bci() == -99) { + if (!lock->is_linked()) { lock = append_with_bci(lock, -1); } @@ -3342,21 +3314,17 @@ void GraphBuilder::fill_sync_handler(Value lock, BlockBegin* sync_handler, bool // exit the context of the synchronized method if (!default_handler) { pop_scope(); - _state = _state->copy(); - bci = _state->scope()->caller_bci(); - _state = _state->pop_scope()->copy(); + bci = _state->caller_state()->bci(); + _state = _state->caller_state()->copy_for_parsing(); } } // perform the throw as if at the the call site apush(exception); - - set_exception_state(state()->copy()); throw_op(bci); BlockEnd* end = last()->as_BlockEnd(); block()->set_end(end); - end->set_state(state()); _block = orig_block; _state = orig_state; @@ -3409,6 +3377,9 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known) { INLINE_BAILOUT("total inlining greater than DesiredMethodLimit"); } + if (is_profiling() && !callee->ensure_method_data()) { + INLINE_BAILOUT("mdo allocation failed"); + } #ifndef PRODUCT // printing if (PrintInlining) { @@ -3446,7 +3417,7 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known) { profile_call(recv, holder_known ? callee->holder() : NULL); } if (profile_inlined_calls()) { - profile_invocation(callee, state(), 0); + profile_invocation(callee, copy_state_before()); } } @@ -3487,7 +3458,7 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known) { // Pass parameters into callee state: add assignments // note: this will also ensure that all arguments are computed before being passed ValueStack* callee_state = state(); - ValueStack* caller_state = scope()->caller_state(); + ValueStack* caller_state = state()->caller_state(); { int i = args_base; while (i < caller_state->stack_size()) { const int par_no = i - args_base; @@ -3502,16 +3473,7 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known) { // Note that we preserve locals state in case we can use it later // (see use of pop_scope() below) caller_state->truncate_stack(args_base); - callee_state->truncate_stack(args_base); - - // Setup state that is used at returns form the inlined method. - // This is essentially the state of the continuation block, - // but without the return value on stack, if any, this will - // be pushed at the return instruction (see method_return). - scope_data()->set_continuation_state(caller_state->copy()); - - // Compute lock stack size for callee scope now that args have been passed - scope()->compute_lock_stack_size(); + assert(callee_state->stack_size() == 0, "callee stack must be empty"); Value lock; BlockBegin* sync_handler; @@ -3520,11 +3482,8 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known) { if (callee->is_synchronized()) { lock = callee->is_static() ? append(new Constant(new InstanceConstant(callee->holder()->java_mirror()))) : state()->local_at(0); - sync_handler = new BlockBegin(-1); + sync_handler = new BlockBegin(SynchronizationEntryBCI); inline_sync_entry(lock, sync_handler); - - // recompute the lock stack size - scope()->compute_lock_stack_size(); } @@ -3532,7 +3491,6 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known) { if (callee_start_block != NULL) { assert(callee_start_block->is_set(BlockBegin::parser_loop_header_flag), "must be loop header"); Goto* goto_callee = new Goto(callee_start_block, false); - goto_callee->set_state(state()); // The state for this goto is in the scope of the callee, so use // the entry bci for the callee instead of the call site bci. append_with_bci(goto_callee, 0); @@ -3579,7 +3537,7 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known) { && block() == orig_block && block() == inline_cleanup_block()) { _last = inline_cleanup_return_prev(); - _state = inline_cleanup_state()->pop_scope(); + _state = inline_cleanup_state(); } else if (continuation_preds == cont->number_of_preds()) { // Inlining caused that the instructions after the invoke in the // caller are not reachable any more. So skip filling this block @@ -3645,8 +3603,7 @@ void GraphBuilder::push_scope(ciMethod* callee, BlockBegin* continuation) { blb.bci2block()->at_put(0, NULL); } - callee_scope->set_caller_state(state()); - set_state(state()->push_scope(callee_scope)); + set_state(new ValueStack(callee_scope, state()->copy(ValueStack::CallerState, bci()))); ScopeData* data = new ScopeData(scope_data()); data->set_scope(callee_scope); @@ -3670,10 +3627,6 @@ void GraphBuilder::push_scope_for_jsr(BlockBegin* jsr_continuation, int jsr_dest data->set_scope(scope()); data->setup_jsr_xhandlers(); data->set_continuation(continuation()); - if (continuation() != NULL) { - assert(continuation_state() != NULL, ""); - data->set_continuation_state(continuation_state()->copy()); - } data->set_jsr_continuation(jsr_continuation); _scope_data = data; } @@ -3768,6 +3721,7 @@ bool GraphBuilder::append_unsafe_prefetch(ciMethod* callee, bool is_static, bool void GraphBuilder::append_unsafe_CAS(ciMethod* callee) { + ValueStack* state_before = copy_state_for_exception(); ValueType* result_type = as_ValueType(callee->return_type()); assert(result_type->is_int(), "int result"); Values* args = state()->pop_arguments(callee->arg_size()); @@ -3796,7 +3750,7 @@ void GraphBuilder::append_unsafe_CAS(ciMethod* callee) { // know which ones so mark the state as no preserved. This will // cause CSE to invalidate memory across it. bool preserves_state = false; - Intrinsic* result = new Intrinsic(result_type, callee->intrinsic_id(), args, false, lock_stack(), preserves_state); + Intrinsic* result = new Intrinsic(result_type, callee->intrinsic_id(), args, false, state_before, preserves_state); append_split(result); push(result_type, result); compilation()->set_has_unsafe_access(true); @@ -3838,6 +3792,6 @@ void GraphBuilder::profile_call(Value recv, ciKlass* known_holder) { append(new ProfileCall(method(), bci(), recv, known_holder)); } -void GraphBuilder::profile_invocation(ciMethod* callee, ValueStack* state, int bci) { - append(new ProfileInvoke(callee, state, bci)); +void GraphBuilder::profile_invocation(ciMethod* callee, ValueStack* state) { + append(new ProfileInvoke(callee, state)); } diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp index 1a6c6f28d22..b41d94721ac 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp @@ -22,6 +22,16 @@ * */ +#ifndef SHARE_VM_C1_C1_GRAPHBUILDER_HPP +#define SHARE_VM_C1_C1_GRAPHBUILDER_HPP + +#include "c1/c1_IR.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_ValueMap.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciMethodData.hpp" +#include "ci/ciStreams.hpp" + class MemoryBuffer; class GraphBuilder VALUE_OBJ_CLASS_SPEC { @@ -58,9 +68,6 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { // BlockEnds. BlockBegin* _continuation; - // Without return value of inlined method on stack - ValueStack* _continuation_state; - // Was this ScopeData created only for the parsing and inlining of // a jsr? bool _parsing_jsr; @@ -125,14 +132,10 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { void set_stream(ciBytecodeStream* stream) { _stream = stream; } intx max_inline_size() const { return _max_inline_size; } - int caller_stack_size() const; BlockBegin* continuation() const { return _continuation; } void set_continuation(BlockBegin* cont) { _continuation = cont; } - ValueStack* continuation_state() const { return _continuation_state; } - void set_continuation_state(ValueStack* s) { _continuation_state = s; } - // Indicates whether this ScopeData was pushed only for the // parsing and inlining of a jsr bool parsing_jsr() const { return _parsing_jsr; } @@ -163,7 +166,6 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { // for all GraphBuilders static bool _can_trap[Bytecodes::number_of_java_codes]; - static bool _is_async[Bytecodes::number_of_java_codes]; // for each instance of GraphBuilder ScopeData* _scope_data; // Per-scope data; used for inlining @@ -179,7 +181,6 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { // for each call to connect_to_end; can also be set by inliner BlockBegin* _block; // the current block ValueStack* _state; // the current execution state - ValueStack* _exception_state; // state that will be used by handle_exception Instruction* _last; // the last instruction added bool _skip_block; // skip processing of the rest of this block @@ -194,8 +195,6 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { ValueStack* state() const { return _state; } void set_state(ValueStack* state) { _state = state; } IRScope* scope() const { return scope_data()->scope(); } - ValueStack* exception_state() const { return _exception_state; } - void set_exception_state(ValueStack* s) { _exception_state = s; } ciMethod* method() const { return scope()->method(); } ciBytecodeStream* stream() const { return scope_data()->stream(); } Instruction* last() const { return _last; } @@ -230,7 +229,7 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { void load_indexed (BasicType type); void store_indexed(BasicType type); void stack_op(Bytecodes::Code code); - void arithmetic_op(ValueType* type, Bytecodes::Code code, ValueStack* lock_stack = NULL); + void arithmetic_op(ValueType* type, Bytecodes::Code code, ValueStack* state_before = NULL); void negate_op(ValueType* type); void shift_op(ValueType* type, Bytecodes::Code code); void logic_op(ValueType* type, Bytecodes::Code code); @@ -267,12 +266,8 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { Instruction* append_split(StateSplit* instr); // other helpers - static bool is_async(Bytecodes::Code code) { - assert(0 <= code && code < Bytecodes::number_of_java_codes, "illegal bytecode"); - return _is_async[code]; - } BlockBegin* block_at(int bci) { return scope_data()->block_at(bci); } - XHandlers* handle_exception(int bci); + XHandlers* handle_exception(Instruction* instruction); void connect_to_end(BlockBegin* beg); void null_check(Value value); void eliminate_redundant_phis(BlockBegin* start); @@ -283,7 +278,28 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { void kill_all(); - ValueStack* lock_stack(); + // use of state copy routines (try to minimize unnecessary state + // object allocations): + + // - if the instruction unconditionally needs a full copy of the + // state (for patching for example), then use copy_state_before* + + // - if the instruction needs a full copy of the state only for + // handler generation (Instruction::needs_exception_state() returns + // false) then use copy_state_exhandling* + + // - if the instruction needs either a full copy of the state for + // handler generation and a least a minimal copy of the state (as + // returned by Instruction::exception_state()) for debug info + // generation (that is when Instruction::needs_exception_state() + // returns true) then use copy_state_for_exception* + + ValueStack* copy_state_before_with_bci(int bci); + ValueStack* copy_state_before(); + ValueStack* copy_state_exhandling_with_bci(int bci); + ValueStack* copy_state_exhandling(); + ValueStack* copy_state_for_exception_with_bci(int bci); + ValueStack* copy_state_for_exception(); // // Inlining support @@ -292,9 +308,7 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { // accessors bool parsing_jsr() const { return scope_data()->parsing_jsr(); } BlockBegin* continuation() const { return scope_data()->continuation(); } - ValueStack* continuation_state() const { return scope_data()->continuation_state(); } BlockBegin* jsr_continuation() const { return scope_data()->jsr_continuation(); } - int caller_stack_size() const { return scope_data()->caller_stack_size(); } void set_continuation(BlockBegin* continuation) { scope_data()->set_continuation(continuation); } void set_inline_cleanup_info(BlockBegin* block, Instruction* return_prev, @@ -343,7 +357,7 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { NOT_PRODUCT(void print_inline_result(ciMethod* callee, bool res);) void profile_call(Value recv, ciKlass* predicted_holder); - void profile_invocation(ciMethod* inlinee, ValueStack* state, int bci); + void profile_invocation(ciMethod* inlinee, ValueStack* state); // Shortcuts to profiling control. bool is_profiling() { return _compilation->is_profiling(); } @@ -374,3 +388,5 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { BlockBegin* start() const { return _start; } }; + +#endif // SHARE_VM_C1_C1_GRAPHBUILDER_HPP diff --git a/hotspot/src/share/vm/c1/c1_IR.cpp b/hotspot/src/share/vm/c1/c1_IR.cpp index cb5e2098ece..917fc5bd5db 100644 --- a/hotspot/src/share/vm/c1/c1_IR.cpp +++ b/hotspot/src/share/vm/c1/c1_IR.cpp @@ -22,8 +22,14 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_IR.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_GraphBuilder.hpp" +#include "c1/c1_IR.hpp" +#include "c1/c1_InstructionPrinter.hpp" +#include "c1/c1_Optimizer.hpp" +#include "utilities/bitMap.inline.hpp" // Implementation of XHandlers @@ -116,24 +122,6 @@ bool XHandler::equals(XHandler* other) const { // Implementation of IRScope - -BlockBegin* IRScope::header_block(BlockBegin* entry, BlockBegin::Flag f, ValueStack* state) { - if (entry == NULL) return NULL; - assert(entry->is_set(f), "entry/flag mismatch"); - // create header block - BlockBegin* h = new BlockBegin(entry->bci()); - BlockEnd* g = new Goto(entry, false); - h->set_next(g, entry->bci()); - h->set_end(g); - h->set(f); - // setup header block end state - ValueStack* s = state->copy(); // can use copy since stack is empty (=> no phis) - assert(s->stack_is_empty(), "must have empty stack at entry point"); - g->set_state(s); - return h; -} - - BlockBegin* IRScope::build_graph(Compilation* compilation, int osr_bci) { GraphBuilder gm(compilation, this); NOT_PRODUCT(if (PrintValueNumbering && Verbose) gm.print_stats()); @@ -145,12 +133,9 @@ BlockBegin* IRScope::build_graph(Compilation* compilation, int osr_bci) { IRScope::IRScope(Compilation* compilation, IRScope* caller, int caller_bci, ciMethod* method, int osr_bci, bool create_graph) : _callees(2) , _compilation(compilation) -, _lock_stack_size(-1) , _requires_phi_function(method->max_locals()) { _caller = caller; - _caller_bci = caller == NULL ? -1 : caller_bci; - _caller_state = NULL; // Must be set later if needed _level = caller == NULL ? 0 : caller->level() + 1; _method = method; _xhandlers = new XHandlers(method); @@ -182,32 +167,6 @@ int IRScope::max_stack() const { } -void IRScope::compute_lock_stack_size() { - if (!InlineMethodsWithExceptionHandlers) { - _lock_stack_size = 0; - return; - } - - // Figure out whether we have to preserve expression stack elements - // for parent scopes, and if so, how many - IRScope* cur_scope = this; - while (cur_scope != NULL && !cur_scope->xhandlers()->has_handlers()) { - cur_scope = cur_scope->caller(); - } - _lock_stack_size = (cur_scope == NULL ? 0 : - (cur_scope->caller_state() == NULL ? 0 : - cur_scope->caller_state()->stack_size())); -} - -int IRScope::top_scope_bci() const { - assert(!is_top_scope(), "no correct answer for top scope possible"); - const IRScope* scope = this; - while (!scope->caller()->is_top_scope()) { - scope = scope->caller(); - } - return scope->caller_bci(); -} - bool IRScopeDebugInfo::should_reexecute() { ciMethod* cur_method = scope()->method(); int cur_bci = bci(); @@ -222,37 +181,24 @@ bool IRScopeDebugInfo::should_reexecute() { // Implementation of CodeEmitInfo // Stack must be NON-null -CodeEmitInfo::CodeEmitInfo(int bci, ValueStack* stack, XHandlers* exception_handlers) +CodeEmitInfo::CodeEmitInfo(ValueStack* stack, XHandlers* exception_handlers) : _scope(stack->scope()) - , _bci(bci) , _scope_debug_info(NULL) , _oop_map(NULL) , _stack(stack) , _exception_handlers(exception_handlers) - , _next(NULL) - , _id(-1) , _is_method_handle_invoke(false) { assert(_stack != NULL, "must be non null"); - assert(_bci == SynchronizationEntryBCI || Bytecodes::is_defined(scope()->method()->java_code_at_bci(_bci)), "make sure bci points at a real bytecode"); } -CodeEmitInfo::CodeEmitInfo(CodeEmitInfo* info, bool lock_stack_only) +CodeEmitInfo::CodeEmitInfo(CodeEmitInfo* info, ValueStack* stack) : _scope(info->_scope) , _exception_handlers(NULL) - , _bci(info->_bci) , _scope_debug_info(NULL) , _oop_map(NULL) + , _stack(stack == NULL ? info->_stack : stack) , _is_method_handle_invoke(info->_is_method_handle_invoke) { - if (lock_stack_only) { - if (info->_stack != NULL) { - _stack = info->_stack->copy_locks(); - } else { - _stack = NULL; - } - } else { - _stack = info->_stack; - } // deep copy of exception handlers if (info->_exception_handlers != NULL) { @@ -273,8 +219,6 @@ void CodeEmitInfo::add_register_oop(LIR_Opr opr) { assert(_oop_map != NULL, "oop map must already exist"); assert(opr->is_single_cpu(), "should not call otherwise"); - int frame_size = frame_map()->framesize(); - int arg_count = frame_map()->oop_map_arg_count(); VMReg name = frame_map()->regname(opr); _oop_map->set_oop(name); } @@ -383,8 +327,7 @@ class UseCountComputer: public ValueVisitor, BlockClosure { void visit(Value* n) { // Local instructions and Phis for expression stack values at the // start of basic blocks are not added to the instruction list - if ((*n)->bci() == -99 && (*n)->as_Local() == NULL && - (*n)->as_Phi() == NULL) { + if (!(*n)->is_linked() && (*n)->can_be_linked()) { assert(false, "a node was not appended to the graph"); Compilation::current()->bailout("a node was not appended to the graph"); } @@ -561,7 +504,12 @@ ComputeLinearScanOrder::ComputeLinearScanOrder(Compilation* c, BlockBegin* start count_edges(start_block, NULL); if (compilation()->is_profiling()) { - compilation()->method()->method_data()->set_compilation_stats(_num_loops, _num_blocks); + ciMethod *method = compilation()->method(); + if (!method->is_accessor()) { + ciMethodData* md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); + md->set_compilation_stats(_num_loops, _num_blocks); + } } if (_num_loops > 0) { @@ -1338,7 +1286,7 @@ void SubstitutionResolver::block_do(BlockBegin* block) { // need to remove this instruction from the instruction stream if (n->subst() != n) { assert(last != NULL, "must have last"); - last->set_next(n->next(), n->next()->bci()); + last->set_next(n->next()); } else { last = n; } diff --git a/hotspot/src/share/vm/c1/c1_IR.hpp b/hotspot/src/share/vm/c1/c1_IR.hpp index 05ef1789f85..217774f575f 100644 --- a/hotspot/src/share/vm/c1/c1_IR.hpp +++ b/hotspot/src/share/vm/c1/c1_IR.hpp @@ -22,6 +22,15 @@ * */ +#ifndef SHARE_VM_C1_C1_IR_HPP +#define SHARE_VM_C1_C1_IR_HPP + +#include "c1/c1_Instruction.hpp" +#include "ci/ciExceptionHandler.hpp" +#include "ci/ciMethod.hpp" +#include "ci/ciStreams.hpp" +#include "memory/allocation.hpp" + // An XHandler is a C1 internal description for an exception handler class XHandler: public CompilationResourceObj { @@ -132,8 +141,6 @@ class IRScope: public CompilationResourceObj { // hierarchy Compilation* _compilation; // the current compilation IRScope* _caller; // the caller scope, or NULL - int _caller_bci; // the caller bci of the corresponding (inlined) invoke, or < 0 - ValueStack* _caller_state; // the caller state, or NULL int _level; // the inlining level ciMethod* _method; // the corresponding method IRScopeList _callees; // the inlined method scopes @@ -144,15 +151,9 @@ class IRScope: public CompilationResourceObj { bool _monitor_pairing_ok; // the monitor pairing info BlockBegin* _start; // the start block, successsors are method entries - // lock stack management - int _lock_stack_size; // number of expression stack elements which, if present, - // must be spilled to the stack because of exception - // handling inside inlined methods - BitMap _requires_phi_function; // bit is set if phi functions at loop headers are necessary for a local variable // helper functions - BlockBegin* header_block(BlockBegin* entry, BlockBegin::Flag f, ValueStack* state); BlockBegin* build_graph(Compilation* compilation, int osr_bci); public: @@ -162,33 +163,16 @@ class IRScope: public CompilationResourceObj { // accessors Compilation* compilation() const { return _compilation; } IRScope* caller() const { return _caller; } - int caller_bci() const { return _caller_bci; } - ValueStack* caller_state() const { return _caller_state; } int level() const { return _level; } ciMethod* method() const { return _method; } int max_stack() const; // NOTE: expensive - int lock_stack_size() const { - assert(_lock_stack_size != -1, "uninitialized"); - return _lock_stack_size; - } BitMap& requires_phi_function() { return _requires_phi_function; } - // mutators - // Needed because caller state is not ready at time of IRScope construction - void set_caller_state(ValueStack* state) { _caller_state = state; } - // Needed because caller state changes after IRScope construction. - // Computes number of expression stack elements whose state must be - // preserved in the case of an exception; these may be seen by - // caller scopes. Zero when inlining of methods containing exception - // handlers is disabled, otherwise a conservative approximation. - void compute_lock_stack_size(); - // hierarchy bool is_top_scope() const { return _caller == NULL; } void add_callee(IRScope* callee) { _callees.append(callee); } int number_of_callees() const { return _callees.length(); } IRScope* callee_no(int i) const { return _callees.at(i); } - int top_scope_bci() const; // accessors, graph bool is_valid() const { return start() != NULL; } @@ -266,9 +250,6 @@ class CodeEmitInfo: public CompilationResourceObj { XHandlers* _exception_handlers; OopMap* _oop_map; ValueStack* _stack; // used by deoptimization (contains also monitors - int _bci; - CodeEmitInfo* _next; - int _id; bool _is_method_handle_invoke; // true if the associated call site is a MethodHandle call site. FrameMap* frame_map() const { return scope()->compilation()->frame_map(); } @@ -277,23 +258,10 @@ class CodeEmitInfo: public CompilationResourceObj { public: // use scope from ValueStack - CodeEmitInfo(int bci, ValueStack* stack, XHandlers* exception_handlers); - - // used by natives - CodeEmitInfo(IRScope* scope, int bci) - : _scope(scope) - , _bci(bci) - , _oop_map(NULL) - , _scope_debug_info(NULL) - , _stack(NULL) - , _exception_handlers(NULL) - , _next(NULL) - , _id(-1) - , _is_method_handle_invoke(false) { - } + CodeEmitInfo(ValueStack* stack, XHandlers* exception_handlers); // make a copy - CodeEmitInfo(CodeEmitInfo* info, bool lock_stack_only = false); + CodeEmitInfo(CodeEmitInfo* info, ValueStack* stack = NULL); // accessors OopMap* oop_map() { return _oop_map; } @@ -301,17 +269,10 @@ class CodeEmitInfo: public CompilationResourceObj { IRScope* scope() const { return _scope; } XHandlers* exception_handlers() const { return _exception_handlers; } ValueStack* stack() const { return _stack; } - int bci() const { return _bci; } void add_register_oop(LIR_Opr opr); void record_debug_info(DebugInformationRecorder* recorder, int pc_offset); - CodeEmitInfo* next() const { return _next; } - void set_next(CodeEmitInfo* next) { _next = next; } - - int id() const { return _id; } - void set_id(int id) { _id = id; } - bool is_method_handle_invoke() const { return _is_method_handle_invoke; } void set_is_method_handle_invoke(bool x) { _is_method_handle_invoke = x; } }; @@ -385,3 +346,5 @@ class SubstitutionResolver: public BlockClosure, ValueVisitor { virtual void block_do(BlockBegin* block); }; + +#endif // SHARE_VM_C1_C1_IR_HPP diff --git a/hotspot/src/share/vm/c1/c1_Instruction.cpp b/hotspot/src/share/vm/c1/c1_Instruction.cpp index e0728b2f304..7f578cb054f 100644 --- a/hotspot/src/share/vm/c1/c1_Instruction.cpp +++ b/hotspot/src/share/vm/c1/c1_Instruction.cpp @@ -22,20 +22,18 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_Instruction.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_IR.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_InstructionPrinter.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciObjArrayKlass.hpp" +#include "ci/ciTypeArrayKlass.hpp" // Implementation of Instruction -#ifdef ASSERT -void Instruction::create_hi_word() { - assert(type()->is_double_word() && _hi_word == NULL, "only double word has high word"); - _hi_word = new HiWord(this); -} -#endif - Instruction::Condition Instruction::mirror(Condition cond) { switch (cond) { case eql: return eql; @@ -63,6 +61,15 @@ Instruction::Condition Instruction::negate(Condition cond) { return eql; } +void Instruction::update_exception_state(ValueStack* state) { + if (state != NULL && (state->kind() == ValueStack::EmptyExceptionState || state->kind() == ValueStack::ExceptionState)) { + assert(state->kind() == ValueStack::EmptyExceptionState || Compilation::current()->env()->jvmti_can_access_local_variables(), "unexpected state kind"); + _exception_state = state; + } else { + _exception_state = NULL; + } +} + Instruction* Instruction::prev(BlockBegin* block) { Instruction* p = NULL; @@ -75,7 +82,24 @@ Instruction* Instruction::prev(BlockBegin* block) { } +void Instruction::state_values_do(ValueVisitor* f) { + if (state_before() != NULL) { + state_before()->values_do(f); + } + if (exception_state() != NULL){ + exception_state()->values_do(f); + } +} + + #ifndef PRODUCT +void Instruction::check_state(ValueStack* state) { + if (state != NULL) { + state->verify(); + } +} + + void Instruction::print() { InstructionPrinter ip; print(ip); @@ -190,35 +214,6 @@ ciType* CheckCast::exact_type() const { return NULL; } - -void ArithmeticOp::other_values_do(ValueVisitor* f) { - if (lock_stack() != NULL) lock_stack()->values_do(f); -} - -void NullCheck::other_values_do(ValueVisitor* f) { - lock_stack()->values_do(f); -} - -void AccessArray::other_values_do(ValueVisitor* f) { - if (lock_stack() != NULL) lock_stack()->values_do(f); -} - - -// Implementation of AccessField - -void AccessField::other_values_do(ValueVisitor* f) { - if (state_before() != NULL) state_before()->values_do(f); - if (lock_stack() != NULL) lock_stack()->values_do(f); -} - - -// Implementation of StoreIndexed - -IRScope* StoreIndexed::scope() const { - return lock_stack()->scope(); -} - - // Implementation of ArithmeticOp bool ArithmeticOp::is_commutative() const { @@ -266,13 +261,6 @@ bool LogicOp::is_commutative() const { } -// Implementation of CompareOp - -void CompareOp::other_values_do(ValueVisitor* f) { - if (state_before() != NULL) state_before()->values_do(f); -} - - // Implementation of IfOp bool IfOp::is_commutative() const { @@ -301,6 +289,7 @@ IRScope* StateSplit::scope() const { void StateSplit::state_values_do(ValueVisitor* f) { + Instruction::state_values_do(f); if (state() != NULL) state()->values_do(f); } @@ -316,30 +305,17 @@ void BlockBegin::state_values_do(ValueVisitor* f) { } -void MonitorEnter::state_values_do(ValueVisitor* f) { - StateSplit::state_values_do(f); - _lock_stack_before->values_do(f); -} - - -void Intrinsic::state_values_do(ValueVisitor* f) { - StateSplit::state_values_do(f); - if (lock_stack() != NULL) lock_stack()->values_do(f); -} - - // Implementation of Invoke Invoke::Invoke(Bytecodes::Code code, ValueType* result_type, Value recv, Values* args, int vtable_index, ciMethod* target, ValueStack* state_before) - : StateSplit(result_type) + : StateSplit(result_type, state_before) , _code(code) , _recv(recv) , _args(args) , _vtable_index(vtable_index) , _target(target) - , _state_before(state_before) { set_flag(TargetIsLoadedFlag, target->is_loaded()); set_flag(TargetIsFinalFlag, target_is_loaded() && target->is_final_method()); @@ -376,7 +352,7 @@ void Invoke::state_values_do(ValueVisitor* f) { // Implementation of Contant intx Constant::hash() const { - if (_state == NULL) { + if (state_before() == NULL) { switch (type()->tag()) { case intTag: return HASH2(name(), type()->as_IntConstant()->value()); @@ -444,28 +420,26 @@ bool Constant::is_equal(Value v) const { return false; } - -BlockBegin* Constant::compare(Instruction::Condition cond, Value right, - BlockBegin* true_sux, BlockBegin* false_sux) { +Constant::CompareResult Constant::compare(Instruction::Condition cond, Value right) const { Constant* rc = right->as_Constant(); // other is not a constant - if (rc == NULL) return NULL; + if (rc == NULL) return not_comparable; ValueType* lt = type(); ValueType* rt = rc->type(); // different types - if (lt->base() != rt->base()) return NULL; + if (lt->base() != rt->base()) return not_comparable; switch (lt->tag()) { case intTag: { int x = lt->as_IntConstant()->value(); int y = rt->as_IntConstant()->value(); switch (cond) { - case If::eql: return x == y ? true_sux : false_sux; - case If::neq: return x != y ? true_sux : false_sux; - case If::lss: return x < y ? true_sux : false_sux; - case If::leq: return x <= y ? true_sux : false_sux; - case If::gtr: return x > y ? true_sux : false_sux; - case If::geq: return x >= y ? true_sux : false_sux; + case If::eql: return x == y ? cond_true : cond_false; + case If::neq: return x != y ? cond_true : cond_false; + case If::lss: return x < y ? cond_true : cond_false; + case If::leq: return x <= y ? cond_true : cond_false; + case If::gtr: return x > y ? cond_true : cond_false; + case If::geq: return x >= y ? cond_true : cond_false; } break; } @@ -473,12 +447,12 @@ BlockBegin* Constant::compare(Instruction::Condition cond, Value right, jlong x = lt->as_LongConstant()->value(); jlong y = rt->as_LongConstant()->value(); switch (cond) { - case If::eql: return x == y ? true_sux : false_sux; - case If::neq: return x != y ? true_sux : false_sux; - case If::lss: return x < y ? true_sux : false_sux; - case If::leq: return x <= y ? true_sux : false_sux; - case If::gtr: return x > y ? true_sux : false_sux; - case If::geq: return x >= y ? true_sux : false_sux; + case If::eql: return x == y ? cond_true : cond_false; + case If::neq: return x != y ? cond_true : cond_false; + case If::lss: return x < y ? cond_true : cond_false; + case If::leq: return x <= y ? cond_true : cond_false; + case If::gtr: return x > y ? cond_true : cond_false; + case If::geq: return x >= y ? cond_true : cond_false; } break; } @@ -488,33 +462,14 @@ BlockBegin* Constant::compare(Instruction::Condition cond, Value right, assert(xvalue != NULL && yvalue != NULL, "not constants"); if (xvalue->is_loaded() && yvalue->is_loaded()) { switch (cond) { - case If::eql: return xvalue == yvalue ? true_sux : false_sux; - case If::neq: return xvalue != yvalue ? true_sux : false_sux; + case If::eql: return xvalue == yvalue ? cond_true : cond_false; + case If::neq: return xvalue != yvalue ? cond_true : cond_false; } } break; } } - return NULL; -} - - -void Constant::other_values_do(ValueVisitor* f) { - if (state() != NULL) state()->values_do(f); -} - - -// Implementation of NewArray - -void NewArray::other_values_do(ValueVisitor* f) { - if (state_before() != NULL) state_before()->values_do(f); -} - - -// Implementation of TypeCheck - -void TypeCheck::other_values_do(ValueVisitor* f) { - if (state_before() != NULL) state_before()->values_do(f); + return not_comparable; } @@ -604,23 +559,14 @@ void BlockBegin::substitute_sux(BlockBegin* old_sux, BlockBegin* new_sux) { // of the inserted block, without recomputing the values of the other blocks // in the CFG. Therefore the value of "depth_first_number" in BlockBegin becomes meaningless. BlockBegin* BlockBegin::insert_block_between(BlockBegin* sux) { - // Try to make the bci close to a block with a single pred or sux, - // since this make the block layout algorithm work better. - int bci = -1; - if (sux->number_of_preds() == 1) { - bci = sux->bci(); - } else { - bci = end()->bci(); - } - - BlockBegin* new_sux = new BlockBegin(bci); + BlockBegin* new_sux = new BlockBegin(-99); // mark this block (special treatment when block order is computed) new_sux->set(critical_edge_split_flag); // This goto is not a safepoint. Goto* e = new Goto(sux, false); - new_sux->set_next(e, bci); + new_sux->set_next(e, end()->state()->bci()); new_sux->set_end(e); // setup states ValueStack* s = end()->state(); @@ -763,7 +709,7 @@ bool BlockBegin::try_merge(ValueStack* new_state) { } // copy state because it is altered - new_state = new_state->copy(); + new_state = new_state->copy(ValueStack::BlockBeginState, bci()); // Use method liveness to invalidate dead locals MethodLivenessResult liveness = new_state->scope()->method()->liveness_at_bci(bci()); @@ -800,19 +746,9 @@ bool BlockBegin::try_merge(ValueStack* new_state) { // initialize state of block set_state(new_state); - } else if (existing_state->is_same_across_scopes(new_state)) { + } else if (existing_state->is_same(new_state)) { TRACE_PHI(tty->print_cr("exisiting state found")); - // Inlining may cause the local state not to match up, so walk up - // the new state until we get to the same scope as the - // existing and then start processing from there. - while (existing_state->scope() != new_state->scope()) { - new_state = new_state->caller_state(); - assert(new_state != NULL, "could not match up scopes"); - - assert(false, "check if this is necessary"); - } - assert(existing_state->scope() == new_state->scope(), "not matching"); assert(existing_state->locals_size() == new_state->locals_size(), "not matching"); assert(existing_state->stack_size() == new_state->stack_size(), "not matching"); @@ -969,11 +905,6 @@ void BlockEnd::substitute_sux(BlockBegin* old_sux, BlockBegin* new_sux) { } -void BlockEnd::other_values_do(ValueVisitor* f) { - if (state_before() != NULL) state_before()->values_do(f); -} - - // Implementation of Phi // Normal phi functions take their operands from the last instruction of the @@ -1006,11 +937,6 @@ int Phi::operand_count() const { } -// Implementation of Throw - -void Throw::state_values_do(ValueVisitor* f) { - BlockEnd::state_values_do(f); -} void ProfileInvoke::state_values_do(ValueVisitor* f) { if (state() != NULL) state()->values_do(f); diff --git a/hotspot/src/share/vm/c1/c1_Instruction.hpp b/hotspot/src/share/vm/c1/c1_Instruction.hpp index 52b2f84a76f..63b30819c7f 100644 --- a/hotspot/src/share/vm/c1/c1_Instruction.hpp +++ b/hotspot/src/share/vm/c1/c1_Instruction.hpp @@ -22,6 +22,14 @@ * */ +#ifndef SHARE_VM_C1_C1_INSTRUCTION_HPP +#define SHARE_VM_C1_C1_INSTRUCTION_HPP + +#include "c1/c1_Compilation.hpp" +#include "c1/c1_LIR.hpp" +#include "c1/c1_ValueType.hpp" +#include "ci/ciField.hpp" + // Predefined classes class ciField; class ValueStack; @@ -38,7 +46,6 @@ typedef LIR_OprDesc* LIR_Opr; // serve factoring. class Instruction; -class HiWord; class Phi; class Local; class Constant; @@ -149,7 +156,6 @@ class BlockList: public _BlockList { class InstructionVisitor: public StackObj { public: - void do_HiWord (HiWord* x) { ShouldNotReachHere(); } virtual void do_Phi (Phi* x) = 0; virtual void do_Local (Local* x) = 0; virtual void do_Constant (Constant* x) = 0; @@ -272,7 +278,9 @@ class InstructionVisitor: public StackObj { class Instruction: public CompilationResourceObj { private: int _id; // the unique instruction id - int _bci; // the instruction bci +#ifndef PRODUCT + int _printable_bci; // the bci of the instruction for printing +#endif int _use_count; // the number of instructions refering to this value (w/o prev/next); only roots can have use count = 0 or > 1 int _pin_state; // set of PinReason describing the reason for pinning ValueType* _type; // the instruction value type @@ -281,17 +289,18 @@ class Instruction: public CompilationResourceObj { LIR_Opr _operand; // LIR specific information unsigned int _flags; // Flag bits + ValueStack* _state_before; // Copy of state with input operands still on stack (or NULL) + ValueStack* _exception_state; // Copy of state for exception handling XHandlers* _exception_handlers; // Flat list of exception handlers covering this instruction -#ifdef ASSERT - HiWord* _hi_word; -#endif - friend class UseCountComputer; friend class BlockBegin; + void update_exception_state(ValueStack* state); + + bool has_printable_bci() const { return NOT_PRODUCT(_printable_bci != -99) PRODUCT_ONLY(false); } + protected: - void set_bci(int bci) { assert(bci == SynchronizationEntryBCI || bci >= 0, "illegal bci"); _bci = bci; } void set_type(ValueType* type) { assert(type != NULL, "type must exist"); _type = type; @@ -325,6 +334,7 @@ class Instruction: public CompilationResourceObj { NeedsPatchingFlag, ThrowIncompatibleClassChangeErrorFlag, ProfileMDOFlag, + IsLinkedInBlockFlag, InstructionLastFlag }; @@ -356,31 +366,31 @@ class Instruction: public CompilationResourceObj { } // creation - Instruction(ValueType* type, bool type_is_constant = false, bool create_hi = true) - : _bci(-99) - , _use_count(0) + Instruction(ValueType* type, ValueStack* state_before = NULL, bool type_is_constant = false) + : _use_count(0) +#ifndef PRODUCT + , _printable_bci(-99) +#endif , _pin_state(0) , _type(type) , _next(NULL) , _subst(NULL) , _flags(0) , _operand(LIR_OprFact::illegalOpr) + , _state_before(state_before) , _exception_handlers(NULL) -#ifdef ASSERT - , _hi_word(NULL) -#endif { + check_state(state_before); assert(type != NULL && (!type->is_constant() || type_is_constant), "type must exist"); -#ifdef ASSERT - if (create_hi && type->is_double_word()) { - create_hi_word(); - } -#endif + update_exception_state(_state_before); } // accessors int id() const { return _id; } - int bci() const { return _bci; } +#ifndef PRODUCT + int printable_bci() const { assert(has_printable_bci(), "_printable_bci should have been set"); return _printable_bci; } + void set_printable_bci(int bci) { NOT_PRODUCT(_printable_bci = bci;) } +#endif int use_count() const { return _use_count; } int pin_state() const { return _pin_state; } bool is_pinned() const { return _pin_state != 0 || PinAllInstructions; } @@ -393,9 +403,13 @@ class Instruction: public CompilationResourceObj { void set_needs_null_check(bool f) { set_flag(NeedsNullCheckFlag, f); } bool needs_null_check() const { return check_flag(NeedsNullCheckFlag); } + bool is_linked() const { return check_flag(IsLinkedInBlockFlag); } + bool can_be_linked() { return as_Local() == NULL && as_Phi() == NULL; } bool has_uses() const { return use_count() > 0; } - bool is_root() const { return is_pinned() || use_count() > 1; } + ValueStack* state_before() const { return _state_before; } + ValueStack* exception_state() const { return _exception_state; } + virtual bool needs_exception_state() const { return true; } XHandlers* exception_handlers() const { return _exception_handlers; } // manipulation @@ -403,19 +417,25 @@ class Instruction: public CompilationResourceObj { void pin() { _pin_state |= PinUnknown; } // DANGEROUS: only used by EliminateStores void unpin(PinReason reason) { assert((reason & PinUnknown) == 0, "can't unpin unknown state"); _pin_state &= ~reason; } - virtual void set_lock_stack(ValueStack* l) { /* do nothing*/ } - virtual ValueStack* lock_stack() const { return NULL; } - Instruction* set_next(Instruction* next, int bci) { - if (next != NULL) { - assert(as_BlockEnd() == NULL, "BlockEnd instructions must have no next"); - assert(next->as_Phi() == NULL && next->as_Local() == NULL, "shouldn't link these instructions into list"); - next->set_bci(bci); - } + Instruction* set_next(Instruction* next) { + assert(next->has_printable_bci(), "_printable_bci should have been set"); + assert(next != NULL, "must not be NULL"); + assert(as_BlockEnd() == NULL, "BlockEnd instructions must have no next"); + assert(next->can_be_linked(), "shouldn't link these instructions into list"); + + next->set_flag(Instruction::IsLinkedInBlockFlag, true); _next = next; return next; } + Instruction* set_next(Instruction* next, int bci) { +#ifndef PRODUCT + next->set_printable_bci(bci); +#endif + return set_next(next); + } + void set_subst(Instruction* subst) { assert(subst == NULL || type()->base() == subst->type()->base() || @@ -423,14 +443,7 @@ class Instruction: public CompilationResourceObj { _subst = subst; } void set_exception_handlers(XHandlers *xhandlers) { _exception_handlers = xhandlers; } - -#ifdef ASSERT - // HiWord is used for debugging and is allocated early to avoid - // allocation at inconvenient points - HiWord* hi_word() { return _hi_word; } - void create_hi_word(); -#endif - + void set_exception_state(ValueStack* s) { check_state(s); _exception_state = s; } // machine-specifics void set_operand(LIR_Opr operand) { assert(operand != LIR_OprFact::illegalOpr, "operand must exist"); _operand = operand; } @@ -438,8 +451,7 @@ class Instruction: public CompilationResourceObj { // generic virtual Instruction* as_Instruction() { return this; } // to satisfy HASHING1 macro - virtual HiWord* as_HiWord() { return NULL; } - virtual Phi* as_Phi() { return NULL; } + virtual Phi* as_Phi() { return NULL; } virtual Local* as_Local() { return NULL; } virtual Constant* as_Constant() { return NULL; } virtual AccessField* as_AccessField() { return NULL; } @@ -493,7 +505,7 @@ class Instruction: public CompilationResourceObj { virtual bool can_trap() const { return false; } virtual void input_values_do(ValueVisitor* f) = 0; - virtual void state_values_do(ValueVisitor* f) { /* usually no state - override on demand */ } + virtual void state_values_do(ValueVisitor* f); virtual void other_values_do(ValueVisitor* f) { /* usually no other - override on demand */ } void values_do(ValueVisitor* f) { input_values_do(f); state_values_do(f); other_values_do(f); } @@ -505,6 +517,7 @@ class Instruction: public CompilationResourceObj { HASHING1(Instruction, false, id()) // hashing disabled by default // debugging + static void check_state(ValueStack* state) PRODUCT_RETURN; void print() PRODUCT_RETURN; void print_line() PRODUCT_RETURN; void print(InstructionPrinter& ip) PRODUCT_RETURN; @@ -541,40 +554,6 @@ class AssertValues: public ValueVisitor { #endif // ASSERT -// A HiWord occupies the 'high word' of a 2-word -// expression stack entry. Hi & lo words must be -// paired on the expression stack (otherwise the -// bytecode sequence is illegal). Note that 'hi' -// refers to the IR expression stack format and -// does *not* imply a machine word ordering. No -// HiWords are used in optimized mode for speed, -// but NULL pointers are used instead. - -LEAF(HiWord, Instruction) - private: - Value _lo_word; - - public: - // creation - HiWord(Value lo_word) - : Instruction(illegalType, false, false), - _lo_word(lo_word) { - // hi-words are also allowed for illegal lo-words - assert(lo_word->type()->is_double_word() || lo_word->type()->is_illegal(), - "HiWord must be used for 2-word values only"); - } - - // accessors - Value lo_word() const { return _lo_word->subst(); } - - // for invalidating of HiWords - void make_illegal() { set_type(illegalType); } - - // generic - virtual void input_values_do(ValueVisitor* f) { ShouldNotReachHere(); } -}; - - // A Phi is a phi function in the sense of SSA form. It stands for // the value of a local variable at the beginning of a join block. // A Phi consists of n operands, one for every incoming branch. @@ -656,37 +635,47 @@ LEAF(Local, Instruction) LEAF(Constant, Instruction) - ValueStack* _state; - public: // creation Constant(ValueType* type): - Instruction(type, true) - , _state(NULL) { + Instruction(type, NULL, true) + { assert(type->is_constant(), "must be a constant"); } - Constant(ValueType* type, ValueStack* state): - Instruction(type, true) - , _state(state) { - assert(state != NULL, "only used for constants which need patching"); + Constant(ValueType* type, ValueStack* state_before): + Instruction(type, state_before, true) + { + assert(state_before != NULL, "only used for constants which need patching"); assert(type->is_constant(), "must be a constant"); // since it's patching it needs to be pinned pin(); } - ValueStack* state() const { return _state; } - - // generic - virtual bool can_trap() const { return state() != NULL; } + virtual bool can_trap() const { return state_before() != NULL; } virtual void input_values_do(ValueVisitor* f) { /* no values */ } - virtual void other_values_do(ValueVisitor* f); virtual intx hash() const; virtual bool is_equal(Value v) const; - virtual BlockBegin* compare(Instruction::Condition condition, Value right, - BlockBegin* true_sux, BlockBegin* false_sux); + + enum CompareResult { not_comparable = -1, cond_false, cond_true }; + + virtual CompareResult compare(Instruction::Condition condition, Value right) const; + BlockBegin* compare(Instruction::Condition cond, Value right, + BlockBegin* true_sux, BlockBegin* false_sux) const { + switch (compare(cond, right)) { + case not_comparable: + return NULL; + case cond_false: + return false_sux; + case cond_true: + return true_sux; + default: + ShouldNotReachHere(); + return NULL; + } + } }; @@ -695,20 +684,16 @@ BASE(AccessField, Instruction) Value _obj; int _offset; ciField* _field; - ValueStack* _state_before; // state is set only for unloaded or uninitialized fields - ValueStack* _lock_stack; // contains lock and scope information NullCheck* _explicit_null_check; // For explicit null check elimination public: // creation - AccessField(Value obj, int offset, ciField* field, bool is_static, ValueStack* lock_stack, + AccessField(Value obj, int offset, ciField* field, bool is_static, ValueStack* state_before, bool is_loaded, bool is_initialized) - : Instruction(as_ValueType(field->type()->basic_type())) + : Instruction(as_ValueType(field->type()->basic_type()), state_before) , _obj(obj) , _offset(offset) , _field(field) - , _lock_stack(lock_stack) - , _state_before(state_before) , _explicit_null_check(NULL) { set_needs_null_check(!is_static); @@ -734,13 +719,11 @@ BASE(AccessField, Instruction) bool is_static() const { return check_flag(IsStaticFlag); } bool is_loaded() const { return check_flag(IsLoadedFlag); } bool is_initialized() const { return check_flag(IsInitializedFlag); } - ValueStack* state_before() const { return _state_before; } - ValueStack* lock_stack() const { return _lock_stack; } NullCheck* explicit_null_check() const { return _explicit_null_check; } bool needs_patching() const { return check_flag(NeedsPatchingFlag); } // manipulation - void set_lock_stack(ValueStack* l) { _lock_stack = l; } + // Under certain circumstances, if a previous NullCheck instruction // proved the target object non-null, we can eliminate the explicit // null check and do an implicit one, simply specifying the debug @@ -751,16 +734,15 @@ BASE(AccessField, Instruction) // generic virtual bool can_trap() const { return needs_null_check() || needs_patching(); } virtual void input_values_do(ValueVisitor* f) { f->visit(&_obj); } - virtual void other_values_do(ValueVisitor* f); }; LEAF(LoadField, AccessField) public: // creation - LoadField(Value obj, int offset, ciField* field, bool is_static, ValueStack* lock_stack, + LoadField(Value obj, int offset, ciField* field, bool is_static, ValueStack* state_before, bool is_loaded, bool is_initialized) - : AccessField(obj, offset, field, is_static, lock_stack, state_before, is_loaded, is_initialized) + : AccessField(obj, offset, field, is_static, state_before, is_loaded, is_initialized) {} ciType* declared_type() const; @@ -777,9 +759,9 @@ LEAF(StoreField, AccessField) public: // creation - StoreField(Value obj, int offset, ciField* field, Value value, bool is_static, ValueStack* lock_stack, + StoreField(Value obj, int offset, ciField* field, Value value, bool is_static, ValueStack* state_before, bool is_loaded, bool is_initialized) - : AccessField(obj, offset, field, is_static, lock_stack, state_before, is_loaded, is_initialized) + : AccessField(obj, offset, field, is_static, state_before, is_loaded, is_initialized) , _value(value) { set_flag(NeedsWriteBarrierFlag, as_ValueType(field_type())->is_object()); @@ -799,29 +781,23 @@ LEAF(StoreField, AccessField) BASE(AccessArray, Instruction) private: Value _array; - ValueStack* _lock_stack; public: // creation - AccessArray(ValueType* type, Value array, ValueStack* lock_stack) - : Instruction(type) + AccessArray(ValueType* type, Value array, ValueStack* state_before) + : Instruction(type, state_before) , _array(array) - , _lock_stack(lock_stack) { + { set_needs_null_check(true); ASSERT_VALUES pin(); // instruction with side effect (null exception or range check throwing) } Value array() const { return _array; } - ValueStack* lock_stack() const { return _lock_stack; } - - // setters - void set_lock_stack(ValueStack* l) { _lock_stack = l; } // generic virtual bool can_trap() const { return needs_null_check(); } virtual void input_values_do(ValueVisitor* f) { f->visit(&_array); } - virtual void other_values_do(ValueVisitor* f); }; @@ -831,8 +807,8 @@ LEAF(ArrayLength, AccessArray) public: // creation - ArrayLength(Value array, ValueStack* lock_stack) - : AccessArray(intType, array, lock_stack) + ArrayLength(Value array, ValueStack* state_before) + : AccessArray(intType, array, state_before) , _explicit_null_check(NULL) {} // accessors @@ -855,8 +831,8 @@ BASE(AccessIndexed, AccessArray) public: // creation - AccessIndexed(Value array, Value index, Value length, BasicType elt_type, ValueStack* lock_stack) - : AccessArray(as_ValueType(elt_type), array, lock_stack) + AccessIndexed(Value array, Value index, Value length, BasicType elt_type, ValueStack* state_before) + : AccessArray(as_ValueType(elt_type), array, state_before) , _index(index) , _length(length) , _elt_type(elt_type) @@ -883,8 +859,8 @@ LEAF(LoadIndexed, AccessIndexed) public: // creation - LoadIndexed(Value array, Value index, Value length, BasicType elt_type, ValueStack* lock_stack) - : AccessIndexed(array, index, length, elt_type, lock_stack) + LoadIndexed(Value array, Value index, Value length, BasicType elt_type, ValueStack* state_before) + : AccessIndexed(array, index, length, elt_type, state_before) , _explicit_null_check(NULL) {} // accessors @@ -910,8 +886,8 @@ LEAF(StoreIndexed, AccessIndexed) int _profiled_bci; public: // creation - StoreIndexed(Value array, Value index, Value length, BasicType elt_type, Value value, ValueStack* lock_stack) - : AccessIndexed(array, index, length, elt_type, lock_stack) + StoreIndexed(Value array, Value index, Value length, BasicType elt_type, Value value, ValueStack* state_before) + : AccessIndexed(array, index, length, elt_type, state_before) , _value(value), _profiled_method(NULL), _profiled_bci(0) { set_flag(NeedsWriteBarrierFlag, (as_ValueType(elt_type)->is_object())); @@ -922,7 +898,6 @@ LEAF(StoreIndexed, AccessIndexed) // accessors Value value() const { return _value; } - IRScope* scope() const; // the state's scope bool needs_write_barrier() const { return check_flag(NeedsWriteBarrierFlag); } bool needs_store_check() const { return check_flag(NeedsStoreCheckFlag); } // Helpers for methodDataOop profiling @@ -963,7 +938,12 @@ BASE(Op2, Instruction) public: // creation - Op2(ValueType* type, Bytecodes::Code op, Value x, Value y) : Instruction(type), _op(op), _x(x), _y(y) { + Op2(ValueType* type, Bytecodes::Code op, Value x, Value y, ValueStack* state_before = NULL) + : Instruction(type, state_before) + , _op(op) + , _x(x) + , _y(y) + { ASSERT_VALUES } @@ -985,28 +965,21 @@ BASE(Op2, Instruction) LEAF(ArithmeticOp, Op2) - private: - ValueStack* _lock_stack; // used only for division operations public: // creation - ArithmeticOp(Bytecodes::Code op, Value x, Value y, bool is_strictfp, ValueStack* lock_stack) - : Op2(x->type()->meet(y->type()), op, x, y) - , _lock_stack(lock_stack) { + ArithmeticOp(Bytecodes::Code op, Value x, Value y, bool is_strictfp, ValueStack* state_before) + : Op2(x->type()->meet(y->type()), op, x, y, state_before) + { set_flag(IsStrictfpFlag, is_strictfp); if (can_trap()) pin(); } // accessors - ValueStack* lock_stack() const { return _lock_stack; } bool is_strictfp() const { return check_flag(IsStrictfpFlag); } - // setters - void set_lock_stack(ValueStack* l) { _lock_stack = l; } - // generic virtual bool is_commutative() const; virtual bool can_trap() const; - virtual void other_values_do(ValueVisitor* f); HASHING3(Op2, true, op(), x()->subst(), y()->subst()) }; @@ -1033,21 +1006,14 @@ LEAF(LogicOp, Op2) LEAF(CompareOp, Op2) - private: - ValueStack* _state_before; // for deoptimization, when canonicalizing public: // creation CompareOp(Bytecodes::Code op, Value x, Value y, ValueStack* state_before) - : Op2(intType, op, x, y) - , _state_before(state_before) + : Op2(intType, op, x, y, state_before) {} - // accessors - ValueStack* state_before() const { return _state_before; } - // generic HASHING3(Op2, true, op(), x()->subst(), y()->subst()) - virtual void other_values_do(ValueVisitor* f); }; @@ -1103,11 +1069,13 @@ LEAF(Convert, Instruction) LEAF(NullCheck, Instruction) private: Value _obj; - ValueStack* _lock_stack; public: // creation - NullCheck(Value obj, ValueStack* lock_stack) : Instruction(obj->type()->base()), _obj(obj), _lock_stack(lock_stack) { + NullCheck(Value obj, ValueStack* state_before) + : Instruction(obj->type()->base(), state_before) + , _obj(obj) + { ASSERT_VALUES set_can_trap(true); assert(_obj->type()->is_object(), "null check must be applied to objects only"); @@ -1116,16 +1084,13 @@ LEAF(NullCheck, Instruction) // accessors Value obj() const { return _obj; } - ValueStack* lock_stack() const { return _lock_stack; } // setters - void set_lock_stack(ValueStack* l) { _lock_stack = l; } void set_can_trap(bool can_trap) { set_flag(CanTrapFlag, can_trap); } // generic virtual bool can_trap() const { return check_flag(CanTrapFlag); /* null-check elimination sets to false */ } virtual void input_values_do(ValueVisitor* f) { f->visit(&_obj); } - virtual void other_values_do(ValueVisitor* f); HASHING1(NullCheck, true, obj()->subst()) }; @@ -1139,7 +1104,10 @@ BASE(StateSplit, Instruction) public: // creation - StateSplit(ValueType* type) : Instruction(type), _state(NULL) { + StateSplit(ValueType* type, ValueStack* state_before = NULL) + : Instruction(type, state_before) + , _state(NULL) + { pin(PinStateSplitConstructor); } @@ -1148,7 +1116,7 @@ BASE(StateSplit, Instruction) IRScope* scope() const; // the state's scope // manipulation - void set_state(ValueStack* state) { _state = state; } + void set_state(ValueStack* state) { assert(_state == NULL, "overwriting existing state"); check_state(state); _state = state; } // generic virtual void input_values_do(ValueVisitor* f) { /* no values */ } @@ -1164,7 +1132,6 @@ LEAF(Invoke, StateSplit) BasicTypeList* _signature; int _vtable_index; ciMethod* _target; - ValueStack* _state_before; // Required for deoptimization. public: // creation @@ -1180,7 +1147,6 @@ LEAF(Invoke, StateSplit) int vtable_index() const { return _vtable_index; } BasicTypeList* signature() const { return _signature; } ciMethod* target() const { return _target; } - ValueStack* state_before() const { return _state_before; } // Returns false if target is not loaded bool target_is_final() const { return check_flag(TargetIsFinalFlag); } @@ -1191,6 +1157,8 @@ LEAF(Invoke, StateSplit) // JSR 292 support bool is_invokedynamic() const { return code() == Bytecodes::_invokedynamic; } + virtual bool needs_exception_state() const { return false; } + // generic virtual bool can_trap() const { return true; } virtual void input_values_do(ValueVisitor* f) { @@ -1208,11 +1176,16 @@ LEAF(NewInstance, StateSplit) public: // creation - NewInstance(ciInstanceKlass* klass) : StateSplit(instanceType), _klass(klass) {} + NewInstance(ciInstanceKlass* klass, ValueStack* state_before) + : StateSplit(instanceType, state_before) + , _klass(klass) + {} // accessors ciInstanceKlass* klass() const { return _klass; } + virtual bool needs_exception_state() const { return false; } + // generic virtual bool can_trap() const { return true; } ciType* exact_type() const; @@ -1222,22 +1195,24 @@ LEAF(NewInstance, StateSplit) BASE(NewArray, StateSplit) private: Value _length; - ValueStack* _state_before; public: // creation - NewArray(Value length, ValueStack* state_before) : StateSplit(objectType), _length(length), _state_before(state_before) { + NewArray(Value length, ValueStack* state_before) + : StateSplit(objectType, state_before) + , _length(length) + { // Do not ASSERT_VALUES since length is NULL for NewMultiArray } // accessors - ValueStack* state_before() const { return _state_before; } Value length() const { return _length; } + virtual bool needs_exception_state() const { return false; } + // generic virtual bool can_trap() const { return true; } virtual void input_values_do(ValueVisitor* f) { StateSplit::input_values_do(f); f->visit(&_length); } - virtual void other_values_do(ValueVisitor* f); }; @@ -1247,7 +1222,10 @@ LEAF(NewTypeArray, NewArray) public: // creation - NewTypeArray(Value length, BasicType elt_type) : NewArray(length, NULL), _elt_type(elt_type) {} + NewTypeArray(Value length, BasicType elt_type, ValueStack* state_before) + : NewArray(length, state_before) + , _elt_type(elt_type) + {} // accessors BasicType elt_type() const { return _elt_type; } @@ -1303,7 +1281,6 @@ BASE(TypeCheck, StateSplit) private: ciKlass* _klass; Value _obj; - ValueStack* _state_before; ciMethod* _profiled_method; int _profiled_bci; @@ -1311,14 +1288,13 @@ BASE(TypeCheck, StateSplit) public: // creation TypeCheck(ciKlass* klass, Value obj, ValueType* type, ValueStack* state_before) - : StateSplit(type), _klass(klass), _obj(obj), _state_before(state_before), + : StateSplit(type, state_before), _klass(klass), _obj(obj), _profiled_method(NULL), _profiled_bci(0) { ASSERT_VALUES set_direct_compare(false); } // accessors - ValueStack* state_before() const { return _state_before; } ciKlass* klass() const { return _klass; } Value obj() const { return _obj; } bool is_loaded() const { return klass() != NULL; } @@ -1330,7 +1306,6 @@ BASE(TypeCheck, StateSplit) // generic virtual bool can_trap() const { return true; } virtual void input_values_do(ValueVisitor* f) { StateSplit::input_values_do(f); f->visit(&_obj); } - virtual void other_values_do(ValueVisitor* f); // Helpers for methodDataOop profiling void set_should_profile(bool value) { set_flag(ProfileMDOFlag, value); } @@ -1364,6 +1339,8 @@ LEAF(InstanceOf, TypeCheck) public: // creation InstanceOf(ciKlass* klass, Value obj, ValueStack* state_before) : TypeCheck(klass, obj, intType, state_before) {} + + virtual bool needs_exception_state() const { return false; } }; @@ -1374,8 +1351,8 @@ BASE(AccessMonitor, StateSplit) public: // creation - AccessMonitor(Value obj, int monitor_no) - : StateSplit(illegalType) + AccessMonitor(Value obj, int monitor_no, ValueStack* state_before = NULL) + : StateSplit(illegalType, state_before) , _obj(obj) , _monitor_no(monitor_no) { @@ -1393,22 +1370,14 @@ BASE(AccessMonitor, StateSplit) LEAF(MonitorEnter, AccessMonitor) - private: - ValueStack* _lock_stack_before; - public: // creation - MonitorEnter(Value obj, int monitor_no, ValueStack* lock_stack_before) - : AccessMonitor(obj, monitor_no) - , _lock_stack_before(lock_stack_before) + MonitorEnter(Value obj, int monitor_no, ValueStack* state_before) + : AccessMonitor(obj, monitor_no, state_before) { ASSERT_VALUES } - // accessors - ValueStack* lock_stack_before() const { return _lock_stack_before; } - virtual void state_values_do(ValueVisitor* f); - // generic virtual bool can_trap() const { return true; } }; @@ -1417,7 +1386,11 @@ LEAF(MonitorEnter, AccessMonitor) LEAF(MonitorExit, AccessMonitor) public: // creation - MonitorExit(Value obj, int monitor_no) : AccessMonitor(obj, monitor_no) {} + MonitorExit(Value obj, int monitor_no) + : AccessMonitor(obj, monitor_no, NULL) + { + ASSERT_VALUES + } }; @@ -1425,7 +1398,6 @@ LEAF(Intrinsic, StateSplit) private: vmIntrinsics::ID _id; Values* _args; - ValueStack* _lock_stack; Value _recv; public: @@ -1440,13 +1412,12 @@ LEAF(Intrinsic, StateSplit) vmIntrinsics::ID id, Values* args, bool has_receiver, - ValueStack* lock_stack, + ValueStack* state_before, bool preserves_state, bool cantrap = true) - : StateSplit(type) + : StateSplit(type, state_before) , _id(id) , _args(args) - , _lock_stack(lock_stack) , _recv(NULL) { assert(args != NULL, "args must exist"); @@ -1468,7 +1439,6 @@ LEAF(Intrinsic, StateSplit) vmIntrinsics::ID id() const { return _id; } int number_of_arguments() const { return _args->length(); } Value argument_at(int i) const { return _args->at(i); } - ValueStack* lock_stack() const { return _lock_stack; } bool has_receiver() const { return (_recv != NULL); } Value receiver() const { assert(has_receiver(), "must have receiver"); return _recv; } @@ -1480,8 +1450,6 @@ LEAF(Intrinsic, StateSplit) StateSplit::input_values_do(f); for (int i = 0; i < _args->length(); i++) f->visit(_args->adr_at(i)); } - virtual void state_values_do(ValueVisitor* f); - }; @@ -1490,6 +1458,7 @@ class LIR_List; LEAF(BlockBegin, StateSplit) private: int _block_id; // the unique block id + int _bci; // start-bci of block int _depth_first_number; // number of this block in a depth-first ordering int _linear_scan_number; // number of this block in linear-scan ordering int _loop_depth; // the loop nesting level of this block @@ -1546,6 +1515,7 @@ LEAF(BlockBegin, StateSplit) // creation BlockBegin(int bci) : StateSplit(illegalType) + , _bci(bci) , _depth_first_number(-1) , _linear_scan_number(-1) , _loop_depth(0) @@ -1570,11 +1540,14 @@ LEAF(BlockBegin, StateSplit) , _total_preds(0) , _stores_to_locals() { - set_bci(bci); +#ifndef PRODUCT + set_printable_bci(bci); +#endif } // accessors int block_id() const { return _block_id; } + int bci() const { return _bci; } BlockList* successors() { return &_successors; } BlockBegin* dominator() const { return _dominator; } int loop_depth() const { return _loop_depth; } @@ -1596,7 +1569,6 @@ LEAF(BlockBegin, StateSplit) BitMap& stores_to_locals() { return _stores_to_locals; } // manipulation - void set_bci(int bci) { Instruction::set_bci(bci); } void set_dominator(BlockBegin* dom) { _dominator = dom; } void set_loop_depth(int d) { _loop_depth = d; } void set_depth_first_number(int dfn) { _depth_first_number = dfn; } @@ -1694,7 +1666,6 @@ BASE(BlockEnd, StateSplit) private: BlockBegin* _begin; BlockList* _sux; - ValueStack* _state_before; protected: BlockList* sux() const { return _sux; } @@ -1710,24 +1681,20 @@ BASE(BlockEnd, StateSplit) public: // creation BlockEnd(ValueType* type, ValueStack* state_before, bool is_safepoint) - : StateSplit(type) + : StateSplit(type, state_before) , _begin(NULL) , _sux(NULL) - , _state_before(state_before) { + { set_flag(IsSafepointFlag, is_safepoint); } // accessors - ValueStack* state_before() const { return _state_before; } bool is_safepoint() const { return check_flag(IsSafepointFlag); } BlockBegin* begin() const { return _begin; } // manipulation void set_begin(BlockBegin* begin); - // generic - virtual void other_values_do(ValueVisitor* f); - // successors int number_of_sux() const { return _sux != NULL ? _sux->length() : 0; } BlockBegin* sux_at(int i) const { return _sux->at(i); } @@ -1919,6 +1886,8 @@ BASE(Switch, BlockEnd) Value tag() const { return _tag; } int length() const { return number_of_sux() - 1; } + virtual bool needs_exception_state() const { return false; } + // generic virtual void input_values_do(ValueVisitor* f) { BlockEnd::input_values_do(f); f->visit(&_tag); } }; @@ -1996,7 +1965,6 @@ LEAF(Throw, BlockEnd) // generic virtual bool can_trap() const { return true; } virtual void input_values_do(ValueVisitor* f) { BlockEnd::input_values_do(f); f->visit(&_exception); } - virtual void state_values_do(ValueVisitor* f); }; @@ -2022,9 +1990,9 @@ LEAF(OsrEntry, Instruction) public: // creation #ifdef _LP64 - OsrEntry() : Instruction(longType, false) { pin(); } + OsrEntry() : Instruction(longType) { pin(); } #else - OsrEntry() : Instruction(intType, false) { pin(); } + OsrEntry() : Instruction(intType) { pin(); } #endif // generic @@ -2036,7 +2004,7 @@ LEAF(OsrEntry, Instruction) LEAF(ExceptionObject, Instruction) public: // creation - ExceptionObject() : Instruction(objectType, false) { + ExceptionObject() : Instruction(objectType) { pin(); } @@ -2091,7 +2059,6 @@ BASE(UnsafeOp, Instruction) // generic virtual void input_values_do(ValueVisitor* f) { } - virtual void other_values_do(ValueVisitor* f) { } }; @@ -2143,20 +2110,23 @@ BASE(UnsafeRawOp, UnsafeOp) LEAF(UnsafeGetRaw, UnsafeRawOp) private: - bool _may_be_unaligned; // For OSREntry + bool _may_be_unaligned, _is_wide; // For OSREntry public: - UnsafeGetRaw(BasicType basic_type, Value addr, bool may_be_unaligned) + UnsafeGetRaw(BasicType basic_type, Value addr, bool may_be_unaligned, bool is_wide = false) : UnsafeRawOp(basic_type, addr, false) { _may_be_unaligned = may_be_unaligned; + _is_wide = is_wide; } - UnsafeGetRaw(BasicType basic_type, Value base, Value index, int log2_scale, bool may_be_unaligned) + UnsafeGetRaw(BasicType basic_type, Value base, Value index, int log2_scale, bool may_be_unaligned, bool is_wide = false) : UnsafeRawOp(basic_type, base, index, log2_scale, false) { _may_be_unaligned = may_be_unaligned; + _is_wide = is_wide; } - bool may_be_unaligned() { return _may_be_unaligned; } + bool may_be_unaligned() { return _may_be_unaligned; } + bool is_wide() { return _is_wide; } }; @@ -2303,13 +2273,11 @@ LEAF(ProfileInvoke, Instruction) private: ciMethod* _inlinee; ValueStack* _state; - int _bci_of_invoke; public: - ProfileInvoke(ciMethod* inlinee, ValueStack* state, int bci) + ProfileInvoke(ciMethod* inlinee, ValueStack* state) : Instruction(voidType) , _inlinee(inlinee) - , _bci_of_invoke(bci) , _state(state) { // The ProfileInvoke has side-effects and must occur precisely where located QQQ??? @@ -2318,7 +2286,6 @@ LEAF(ProfileInvoke, Instruction) ciMethod* inlinee() { return _inlinee; } ValueStack* state() { return _state; } - int bci_of_invoke() { return _bci_of_invoke; } virtual void input_values_do(ValueVisitor*) {} virtual void state_values_do(ValueVisitor*); }; @@ -2347,3 +2314,5 @@ inline BlockBegin* BlockBegin::sux_at(int i) const { assert(_end == inline void BlockBegin::add_successor(BlockBegin* sux) { assert(_end == NULL, "Would create mismatch with successors of BlockEnd"); _successors.append(sux); } #undef ASSERT_VALUES + +#endif // SHARE_VM_C1_C1_INSTRUCTION_HPP diff --git a/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp b/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp index 84e7b6fb897..1b9930cb215 100644 --- a/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp +++ b/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp @@ -22,8 +22,12 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_InstructionPrinter.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_InstructionPrinter.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciArray.hpp" +#include "ci/ciInstance.hpp" +#include "ci/ciObject.hpp" #ifndef PRODUCT @@ -316,7 +320,7 @@ void InstructionPrinter::print_head() { void InstructionPrinter::print_line(Instruction* instr) { // print instruction data on one line if (instr->is_pinned()) output()->put('.'); - fill_to(bci_pos ); output()->print("%d", instr->bci()); + fill_to(bci_pos ); output()->print("%d", instr->printable_bci()); fill_to(use_pos ); output()->print("%d", instr->use_count()); fill_to(temp_pos ); print_temp(instr); fill_to(instr_pos); print_instr(instr); @@ -569,7 +573,7 @@ void InstructionPrinter::do_BlockBegin(BlockBegin* x) { if (printed_flag) output()->print(") "); // print block bci range - output()->print("[%d, %d]", x->bci(), (end == NULL ? -1 : end->bci())); + output()->print("[%d, %d]", x->bci(), (end == NULL ? -1 : end->printable_bci())); // print block successors if (end != NULL && end->number_of_sux() > 0) { diff --git a/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp b/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp index 340c16237b5..3f3921e31ae 100644 --- a/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp +++ b/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp @@ -22,6 +22,13 @@ * */ +#ifndef SHARE_VM_C1_C1_INSTRUCTIONPRINTER_HPP +#define SHARE_VM_C1_C1_INSTRUCTIONPRINTER_HPP + +#include "c1/c1_IR.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_Runtime1.hpp" + #ifndef PRODUCT class InstructionPrinter: public InstructionVisitor { private: @@ -126,3 +133,5 @@ class InstructionPrinter: public InstructionVisitor { virtual void do_ProfileInvoke (ProfileInvoke* x); }; #endif // PRODUCT + +#endif // SHARE_VM_C1_C1_INSTRUCTIONPRINTER_HPP diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp index 3b04fc45dc5..bce59a55d9d 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.cpp +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -22,8 +22,13 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_LIR.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_InstructionPrinter.hpp" +#include "c1/c1_LIR.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciInstance.hpp" +#include "runtime/sharedRuntime.hpp" Register LIR_OprDesc::as_register() const { return FrameMap::cpu_rnr2reg(cpu_regnr()); @@ -211,6 +216,7 @@ void LIR_OprDesc::validate_type() const { case T_BYTE: case T_SHORT: case T_INT: + case T_ADDRESS: case T_OBJECT: case T_ARRAY: assert((kind_field() == cpu_register || kind_field() == stack_value) && @@ -1519,7 +1525,7 @@ static void print_block(BlockBegin* x) { if (x->is_set(BlockBegin::linear_scan_loop_end_flag)) tty->print("le "); // print block bci range - tty->print("[%d, %d] ", x->bci(), (end == NULL ? -1 : end->bci())); + tty->print("[%d, %d] ", x->bci(), (end == NULL ? -1 : end->printable_bci())); // print predecessors and successors if (x->number_of_preds() > 0) { @@ -1575,7 +1581,7 @@ void LIR_Op::print_on(outputStream* out) const { } out->print(name()); out->print(" "); print_instr(out); - if (info() != NULL) out->print(" [bci:%d]", info()->bci()); + if (info() != NULL) out->print(" [bci:%d]", info()->stack()->bci()); #ifdef ASSERT if (Verbose && _file != NULL) { out->print(" (%s:%d)", _file, _line); @@ -1736,6 +1742,8 @@ const char * LIR_Op1::name() const { return "unaligned move"; case lir_move_volatile: return "volatile_move"; + case lir_move_wide: + return "wide_move"; default: ShouldNotReachHere(); return "illegal_op"; @@ -1780,7 +1788,7 @@ void LIR_OpBranch::print_instr(outputStream* out) const { out->print("["); stub()->print_name(out); out->print(": 0x%x]", stub()); - if (stub()->info() != NULL) out->print(" [bci:%d]", stub()->info()->bci()); + if (stub()->info() != NULL) out->print(" [bci:%d]", stub()->info()->stack()->bci()); } else { out->print("[label:0x%x] ", label()); } @@ -1895,7 +1903,7 @@ void LIR_OpTypeCheck::print_instr(outputStream* out) const { tmp2()->print(out); out->print(" "); tmp3()->print(out); out->print(" "); result_opr()->print(out); out->print(" "); - if (info_for_exception() != NULL) out->print(" [bci:%d]", info_for_exception()->bci()); + if (info_for_exception() != NULL) out->print(" [bci:%d]", info_for_exception()->stack()->bci()); } diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp index 44393aa8fb3..50bf4c4e9ba 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.hpp +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp @@ -22,6 +22,11 @@ * */ +#ifndef SHARE_VM_C1_C1_LIR_HPP +#define SHARE_VM_C1_C1_LIR_HPP + +#include "c1/c1_ValueType.hpp" + class BlockBegin; class BlockList; class LIR_Assembler; @@ -280,7 +285,7 @@ class LIR_OprDesc: public CompilationResourceObj { , int_type = 1 << type_shift , long_type = 2 << type_shift , object_type = 3 << type_shift - , pointer_type = 4 << type_shift + , address_type = 4 << type_shift , float_type = 5 << type_shift , double_type = 6 << type_shift }; @@ -303,6 +308,7 @@ class LIR_OprDesc: public CompilationResourceObj { case T_BYTE: case T_SHORT: case T_INT: + case T_ADDRESS: case T_OBJECT: case T_ARRAY: return single_size; @@ -456,6 +462,7 @@ inline LIR_OprDesc::OprType as_OprType(BasicType type) { case T_DOUBLE: return LIR_OprDesc::double_type; case T_OBJECT: case T_ARRAY: return LIR_OprDesc::object_type; + case T_ADDRESS: return LIR_OprDesc::address_type; case T_ILLEGAL: // fall through default: ShouldNotReachHere(); return LIR_OprDesc::unknown_type; } @@ -468,6 +475,7 @@ inline BasicType as_BasicType(LIR_OprDesc::OprType t) { case LIR_OprDesc::float_type: return T_FLOAT; case LIR_OprDesc::double_type: return T_DOUBLE; case LIR_OprDesc::object_type: return T_OBJECT; + case LIR_OprDesc::address_type: return T_ADDRESS; case LIR_OprDesc::unknown_type: // fall through default: ShouldNotReachHere(); return T_ILLEGAL; } @@ -550,8 +558,24 @@ class LIR_OprFact: public AllStatic { static LIR_Opr illegalOpr; - static LIR_Opr single_cpu(int reg) { return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | LIR_OprDesc::int_type | LIR_OprDesc::cpu_register | LIR_OprDesc::single_size); } - static LIR_Opr single_cpu_oop(int reg) { return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | LIR_OprDesc::object_type | LIR_OprDesc::cpu_register | LIR_OprDesc::single_size); } + static LIR_Opr single_cpu(int reg) { + return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | + LIR_OprDesc::int_type | + LIR_OprDesc::cpu_register | + LIR_OprDesc::single_size); + } + static LIR_Opr single_cpu_oop(int reg) { + return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | + LIR_OprDesc::object_type | + LIR_OprDesc::cpu_register | + LIR_OprDesc::single_size); + } + static LIR_Opr single_cpu_address(int reg) { + return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | + LIR_OprDesc::address_type | + LIR_OprDesc::cpu_register | + LIR_OprDesc::single_size); + } static LIR_Opr double_cpu(int reg1, int reg2) { LP64_ONLY(assert(reg1 == reg2, "must be identical")); return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) | @@ -633,6 +657,14 @@ class LIR_OprFact: public AllStatic { LIR_OprDesc::virtual_mask); break; + case T_ADDRESS: + res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | + LIR_OprDesc::address_type | + LIR_OprDesc::cpu_register | + LIR_OprDesc::single_size | + LIR_OprDesc::virtual_mask); + break; + case T_LONG: res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | LIR_OprDesc::long_type | @@ -721,6 +753,13 @@ class LIR_OprFact: public AllStatic { LIR_OprDesc::single_size); break; + case T_ADDRESS: + res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | + LIR_OprDesc::address_type | + LIR_OprDesc::stack_value | + LIR_OprDesc::single_size); + break; + case T_LONG: res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | LIR_OprDesc::long_type | @@ -946,6 +985,7 @@ enum LIR_MoveKind { lir_move_normal, lir_move_volatile, lir_move_unaligned, + lir_move_wide, lir_move_max_flag }; @@ -1528,15 +1568,16 @@ class LIR_Op2: public LIR_Op { assert(code == lir_cmp, "code check"); } - LIR_Op2(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result) + LIR_Op2(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) : LIR_Op(code, result, NULL) , _opr1(opr1) , _opr2(opr2) - , _type(T_ILLEGAL) + , _type(type) , _condition(condition) , _fpu_stack_size(0) , _tmp(LIR_OprFact::illegalOpr) { assert(code == lir_cmove, "code check"); + assert(type != T_ILLEGAL, "cmove should have type"); } LIR_Op2(LIR_Code code, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result = LIR_OprFact::illegalOpr, @@ -1893,7 +1934,20 @@ class LIR_List: public CompilationResourceObj { void move(LIR_Opr src, LIR_Opr dst, CodeEmitInfo* info = NULL) { append(new LIR_Op1(lir_move, src, dst, dst->type(), lir_patch_none, info)); } void move(LIR_Address* src, LIR_Opr dst, CodeEmitInfo* info = NULL) { append(new LIR_Op1(lir_move, LIR_OprFact::address(src), dst, src->type(), lir_patch_none, info)); } void move(LIR_Opr src, LIR_Address* dst, CodeEmitInfo* info = NULL) { append(new LIR_Op1(lir_move, src, LIR_OprFact::address(dst), dst->type(), lir_patch_none, info)); } - + void move_wide(LIR_Address* src, LIR_Opr dst, CodeEmitInfo* info = NULL) { + if (UseCompressedOops) { + append(new LIR_Op1(lir_move, LIR_OprFact::address(src), dst, src->type(), lir_patch_none, info, lir_move_wide)); + } else { + move(src, dst, info); + } + } + void move_wide(LIR_Opr src, LIR_Address* dst, CodeEmitInfo* info = NULL) { + if (UseCompressedOops) { + append(new LIR_Op1(lir_move, src, LIR_OprFact::address(dst), dst->type(), lir_patch_none, info, lir_move_wide)); + } else { + move(src, dst, info); + } + } void volatile_move(LIR_Opr src, LIR_Opr dst, BasicType type, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none) { append(new LIR_Op1(lir_move, src, dst, type, patch_code, info, lir_move_volatile)); } void oop2reg (jobject o, LIR_Opr reg) { append(new LIR_Op1(lir_move, LIR_OprFact::oopConst(o), reg)); } @@ -1940,8 +1994,8 @@ class LIR_List: public CompilationResourceObj { void cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info); void cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Address* addr, CodeEmitInfo* info); - void cmove(LIR_Condition condition, LIR_Opr src1, LIR_Opr src2, LIR_Opr dst) { - append(new LIR_Op2(lir_cmove, condition, src1, src2, dst)); + void cmove(LIR_Condition condition, LIR_Opr src1, LIR_Opr src2, LIR_Opr dst, BasicType type) { + append(new LIR_Op2(lir_cmove, condition, src1, src2, dst, type)); } void cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, @@ -2248,3 +2302,5 @@ class LIR_OpVisitState: public StackObj { inline LIR_Opr LIR_OprDesc::illegalOpr() { return LIR_OprFact::illegalOpr; }; + +#endif // SHARE_VM_C1_C1_LIR_HPP diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp index de2a1a9f21d..1b57ea2f095 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp @@ -22,8 +22,26 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_LIRAssembler.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_InstructionPrinter.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciInstance.hpp" +#ifdef TARGET_ARCH_x86 +# include "nativeInst_x86.hpp" +# include "vmreg_x86.inline.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "nativeInst_sparc.hpp" +# include "vmreg_sparc.inline.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "nativeInst_zero.hpp" +# include "vmreg_zero.inline.hpp" +#endif void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) { @@ -35,7 +53,7 @@ void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_cod append_patching_stub(patch); #ifdef ASSERT - Bytecodes::Code code = info->scope()->method()->java_code_at_bci(info->bci()); + Bytecodes::Code code = info->scope()->method()->java_code_at_bci(info->stack()->bci()); if (patch->id() == PatchingStub::access_field_id) { switch (code) { case Bytecodes::_putstatic: @@ -221,7 +239,7 @@ void LIR_Assembler::emit_block(BlockBegin* block) { #ifndef PRODUCT if (CommentedAssembly) { stringStream st; - st.print_cr(" block B%d [%d, %d]", block->block_id(), block->bci(), block->end()->bci()); + st.print_cr(" block B%d [%d, %d]", block->block_id(), block->bci(), block->end()->printable_bci()); _masm->block_comment(st.as_string()); } #endif @@ -312,7 +330,7 @@ void LIR_Assembler::add_call_info(int pc_offset, CodeEmitInfo* cinfo) { static ValueStack* debug_info(Instruction* ins) { StateSplit* ss = ins->as_StateSplit(); if (ss != NULL) return ss->state(); - return ins->lock_stack(); + return ins->state_before(); } void LIR_Assembler::process_debug_info(LIR_Op* op) { @@ -327,8 +345,7 @@ void LIR_Assembler::process_debug_info(LIR_Op* op) { if (vstack == NULL) return; if (_pending_non_safepoint != NULL) { // Got some old debug info. Get rid of it. - if (_pending_non_safepoint->bci() == src->bci() && - debug_info(_pending_non_safepoint) == vstack) { + if (debug_info(_pending_non_safepoint) == vstack) { _pending_non_safepoint_offset = pc_offset; return; } @@ -358,7 +375,7 @@ static ValueStack* nth_oldest(ValueStack* s, int n, int& bci_result) { ValueStack* tc = t->caller_state(); if (tc == NULL) return s; t = tc; - bci_result = s->scope()->caller_bci(); + bci_result = tc->bci(); s = s->caller_state(); } } @@ -366,7 +383,7 @@ static ValueStack* nth_oldest(ValueStack* s, int n, int& bci_result) { void LIR_Assembler::record_non_safepoint_debug_info() { int pc_offset = _pending_non_safepoint_offset; ValueStack* vstack = debug_info(_pending_non_safepoint); - int bci = _pending_non_safepoint->bci(); + int bci = vstack->bci(); DebugInformationRecorder* debug_info = compilation()->debug_info_recorder(); assert(debug_info->recording_non_safepoints(), "sanity"); @@ -380,7 +397,7 @@ void LIR_Assembler::record_non_safepoint_debug_info() { if (s == NULL) break; IRScope* scope = s->scope(); //Always pass false for reexecute since these ScopeDescs are never used for deopt - debug_info->describe_scope(pc_offset, scope->method(), s_bci, false/*reexecute*/); + debug_info->describe_scope(pc_offset, scope->method(), s->bci(), false/*reexecute*/); } debug_info->end_non_safepoint(pc_offset); @@ -472,7 +489,9 @@ void LIR_Assembler::emit_op1(LIR_Op1* op) { volatile_move_op(op->in_opr(), op->result_opr(), op->type(), op->info()); } else { move_op(op->in_opr(), op->result_opr(), op->type(), - op->patch_code(), op->info(), op->pop_fpu_stack(), op->move_kind() == lir_move_unaligned); + op->patch_code(), op->info(), op->pop_fpu_stack(), + op->move_kind() == lir_move_unaligned, + op->move_kind() == lir_move_wide); } break; @@ -666,7 +685,7 @@ void LIR_Assembler::emit_op2(LIR_Op2* op) { break; case lir_cmove: - cmove(op->condition(), op->in_opr1(), op->in_opr2(), op->result_opr()); + cmove(op->condition(), op->in_opr1(), op->in_opr2(), op->result_opr(), op->type()); break; case lir_shl: @@ -741,7 +760,7 @@ void LIR_Assembler::roundfp_op(LIR_Opr src, LIR_Opr tmp, LIR_Opr dest, bool pop_ } -void LIR_Assembler::move_op(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool unaligned) { +void LIR_Assembler::move_op(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool unaligned, bool wide) { if (src->is_register()) { if (dest->is_register()) { assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here"); @@ -750,7 +769,7 @@ void LIR_Assembler::move_op(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here"); reg2stack(src, dest, type, pop_fpu_stack); } else if (dest->is_address()) { - reg2mem(src, dest, type, patch_code, info, pop_fpu_stack, unaligned); + reg2mem(src, dest, type, patch_code, info, pop_fpu_stack, wide, unaligned); } else { ShouldNotReachHere(); } @@ -773,13 +792,13 @@ void LIR_Assembler::move_op(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch const2stack(src, dest); } else if (dest->is_address()) { assert(patch_code == lir_patch_none, "no patching allowed here"); - const2mem(src, dest, type, info); + const2mem(src, dest, type, info, wide); } else { ShouldNotReachHere(); } } else if (src->is_address()) { - mem2reg(src, dest, type, patch_code, info, unaligned); + mem2reg(src, dest, type, patch_code, info, wide, unaligned); } else { ShouldNotReachHere(); diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp index a195cd135bf..bb18c253eb5 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp @@ -22,6 +22,14 @@ * */ +#ifndef SHARE_VM_C1_C1_LIRASSEMBLER_HPP +#define SHARE_VM_C1_C1_LIRASSEMBLER_HPP + +#include "c1/c1_CodeStubs.hpp" +#include "ci/ciMethodData.hpp" +#include "oops/methodDataOop.hpp" +#include "utilities/top.hpp" + class Compilation; class ScopeValue; class BarrierSet; @@ -157,15 +165,17 @@ class LIR_Assembler: public CompilationResourceObj { void const2reg (LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_code, CodeEmitInfo* info); void const2stack(LIR_Opr src, LIR_Opr dest); - void const2mem (LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info); + void const2mem (LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info, bool wide); void reg2stack (LIR_Opr src, LIR_Opr dest, BasicType type, bool pop_fpu_stack); void reg2reg (LIR_Opr src, LIR_Opr dest); - void reg2mem (LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool unaligned); + void reg2mem (LIR_Opr src, LIR_Opr dest, BasicType type, + LIR_PatchCode patch_code, CodeEmitInfo* info, + bool pop_fpu_stack, bool wide, bool unaligned); void stack2reg (LIR_Opr src, LIR_Opr dest, BasicType type); void stack2stack(LIR_Opr src, LIR_Opr dest, BasicType type); void mem2reg (LIR_Opr src, LIR_Opr dest, BasicType type, - LIR_PatchCode patch_code = lir_patch_none, - CodeEmitInfo* info = NULL, bool unaligned = false); + LIR_PatchCode patch_code, + CodeEmitInfo* info, bool wide, bool unaligned); void prefetchr (LIR_Opr src); void prefetchw (LIR_Opr src); @@ -203,11 +213,11 @@ class LIR_Assembler: public CompilationResourceObj { void roundfp_op(LIR_Opr src, LIR_Opr tmp, LIR_Opr dest, bool pop_fpu_stack); void move_op(LIR_Opr src, LIR_Opr result, BasicType type, - LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool unaligned); + LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool unaligned, bool wide); void volatile_move_op(LIR_Opr src, LIR_Opr result, BasicType type, CodeEmitInfo* info); void comp_mem_op(LIR_Opr src, LIR_Opr result, BasicType type, CodeEmitInfo* info); // info set for null exceptions void comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr result, LIR_Op2* op); - void cmove(LIR_Condition code, LIR_Opr left, LIR_Opr right, LIR_Opr result); + void cmove(LIR_Condition code, LIR_Opr left, LIR_Opr right, LIR_Opr result, BasicType type); void call( LIR_OpJavaCall* op, relocInfo::relocType rtype); void ic_call( LIR_OpJavaCall* op); @@ -236,5 +246,13 @@ class LIR_Assembler: public CompilationResourceObj { void verify_oop_map(CodeEmitInfo* info); - #include "incls/_c1_LIRAssembler_pd.hpp.incl" +#ifdef TARGET_ARCH_x86 +# include "c1_LIRAssembler_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "c1_LIRAssembler_sparc.hpp" +#endif + }; + +#endif // SHARE_VM_C1_C1_LIRASSEMBLER_HPP diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index e519cfcfb1d..8dc579d0dcc 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -22,8 +22,22 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_LIRGenerator.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_LIRGenerator.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciArrayKlass.hpp" +#include "ci/ciCPCache.hpp" +#include "ci/ciInstance.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "utilities/bitMap.inline.hpp" +#ifndef SERIALGC +#include "gc_implementation/g1/heapRegion.hpp" +#endif #ifdef ASSERT #define __ gen()->lir(__FILE__, __LINE__)-> @@ -386,18 +400,26 @@ void LIRGenerator::walk(Value instr) { CodeEmitInfo* LIRGenerator::state_for(Instruction* x, ValueStack* state, bool ignore_xhandler) { - int index; - Value value; - for_each_stack_value(state, index, value) { - assert(value->subst() == value, "missed substition"); - if (!value->is_pinned() && value->as_Constant() == NULL && value->as_Local() == NULL) { - walk(value); - assert(value->operand()->is_valid(), "must be evaluated now"); - } - } + assert(state != NULL, "state must be defined"); + ValueStack* s = state; - int bci = x->bci(); for_each_state(s) { + if (s->kind() == ValueStack::EmptyExceptionState) { + assert(s->stack_size() == 0 && s->locals_size() == 0 && (s->locks_size() == 0 || s->locks_size() == 1), "state must be empty"); + continue; + } + + int index; + Value value; + for_each_stack_value(s, index, value) { + assert(value->subst() == value, "missed substitution"); + if (!value->is_pinned() && value->as_Constant() == NULL && value->as_Local() == NULL) { + walk(value); + assert(value->operand()->is_valid(), "must be evaluated now"); + } + } + + int bci = s->bci(); IRScope* scope = s->scope(); ciMethod* method = scope->method(); @@ -428,15 +450,14 @@ CodeEmitInfo* LIRGenerator::state_for(Instruction* x, ValueStack* state, bool ig } } } - bci = scope->caller_bci(); } - return new CodeEmitInfo(x->bci(), state, ignore_xhandler ? NULL : x->exception_handlers()); + return new CodeEmitInfo(state, ignore_xhandler ? NULL : x->exception_handlers()); } CodeEmitInfo* LIRGenerator::state_for(Instruction* x) { - return state_for(x, x->lock_stack()); + return state_for(x, x->exception_state()); } @@ -815,11 +836,8 @@ void LIRGenerator::profile_branch(If* if_instr, If::Condition cond) { if (if_instr->should_profile()) { ciMethod* method = if_instr->profiled_method(); assert(method != NULL, "method should be set if branch is profiled"); - ciMethodData* md = method->method_data(); - if (md == NULL) { - bailout("out of memory building methodDataOop"); - return; - } + ciMethodData* md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(if_instr->profiled_bci()); assert(data != NULL, "must have profiling data"); assert(data->is_BranchData(), "need BranchData for two-way branches"); @@ -838,16 +856,16 @@ void LIRGenerator::profile_branch(If* if_instr, If::Condition cond) { __ cmove(lir_cond(cond), LIR_OprFact::intptrConst(taken_count_offset), LIR_OprFact::intptrConst(not_taken_count_offset), - data_offset_reg); + data_offset_reg, as_BasicType(if_instr->x()->type())); // MDO cells are intptr_t, so the data_reg width is arch-dependent. LIR_Opr data_reg = new_pointer_register(); LIR_Address* data_addr = new LIR_Address(md_reg, data_offset_reg, data_reg->type()); - __ move(LIR_OprFact::address(data_addr), data_reg); + __ move(data_addr, data_reg); // Use leal instead of add to avoid destroying condition codes on x86 LIR_Address* fake_incr_value = new LIR_Address(data_reg, DataLayout::counter_increment, T_INT); __ leal(LIR_OprFact::address(fake_incr_value), data_reg); - __ move(data_reg, LIR_OprFact::address(data_addr)); + __ move(data_reg, data_addr); } } @@ -900,18 +918,14 @@ void LIRGenerator::move_to_phi(ValueStack* cur_state) { Value sux_value; int index; + assert(cur_state->scope() == sux_state->scope(), "not matching"); + assert(cur_state->locals_size() == sux_state->locals_size(), "not matching"); + assert(cur_state->stack_size() == sux_state->stack_size(), "not matching"); + for_each_stack_value(sux_state, index, sux_value) { move_to_phi(&resolver, cur_state->stack_at(index), sux_value); } - // Inlining may cause the local state not to match up, so walk up - // the caller state until we get to the same scope as the - // successor and then start processing from there. - while (cur_state->scope() != sux_state->scope()) { - cur_state = cur_state->caller_state(); - assert(cur_state != NULL, "scopes don't match up"); - } - for_each_local_value(sux_state, index, sux_value) { move_to_phi(&resolver, cur_state->local_at(index), sux_value); } @@ -936,7 +950,6 @@ LIR_Opr LIRGenerator::new_register(BasicType type) { } } _virtual_register_number += 1; - if (type == T_ADDRESS) type = T_INT; return LIR_OprFact::virtual_register(vreg, type); } @@ -993,12 +1006,12 @@ void LIRGenerator::do_ExceptionObject(ExceptionObject* x) { operand_for_instruction(phi)); LIR_Opr thread_reg = getThreadPointer(); - __ move(new LIR_Address(thread_reg, in_bytes(JavaThread::exception_oop_offset()), T_OBJECT), - exceptionOopOpr()); - __ move(LIR_OprFact::oopConst(NULL), - new LIR_Address(thread_reg, in_bytes(JavaThread::exception_oop_offset()), T_OBJECT)); - __ move(LIR_OprFact::oopConst(NULL), - new LIR_Address(thread_reg, in_bytes(JavaThread::exception_pc_offset()), T_OBJECT)); + __ move_wide(new LIR_Address(thread_reg, in_bytes(JavaThread::exception_oop_offset()), T_OBJECT), + exceptionOopOpr()); + __ move_wide(LIR_OprFact::oopConst(NULL), + new LIR_Address(thread_reg, in_bytes(JavaThread::exception_oop_offset()), T_OBJECT)); + __ move_wide(LIR_OprFact::oopConst(NULL), + new LIR_Address(thread_reg, in_bytes(JavaThread::exception_pc_offset()), T_OBJECT)); LIR_Opr result = new_register(T_OBJECT); __ move(exceptionOopOpr(), result); @@ -1024,10 +1037,10 @@ void LIRGenerator::do_Phi(Phi* x) { // Code for a constant is generated lazily unless the constant is frequently used and can't be inlined. void LIRGenerator::do_Constant(Constant* x) { - if (x->state() != NULL) { + if (x->state_before() != NULL) { // Any constant with a ValueStack requires patching so emit the patch here LIR_Opr reg = rlock_result(x); - CodeEmitInfo* info = state_for(x, x->state()); + CodeEmitInfo* info = state_for(x, x->state_before()); __ oop2reg_patch(NULL, reg, info); } else if (x->use_count() > 1 && !can_inline_as_constant(x)) { if (!x->is_pinned()) { @@ -1069,7 +1082,7 @@ void LIRGenerator::do_IfInstanceOf(IfInstanceOf* x) { void LIRGenerator::do_Return(Return* x) { if (compilation()->env()->dtrace_method_probes()) { BasicTypeList signature; - signature.append(T_INT); // thread + signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT)); // thread signature.append(T_OBJECT); // methodOop LIR_OprList* args = new LIR_OprList(); args->append(getThreadPointer()); @@ -1103,11 +1116,11 @@ void LIRGenerator::do_getClass(Intrinsic* x) { // need to perform the null check on the rcvr CodeEmitInfo* info = NULL; if (x->needs_null_check()) { - info = state_for(x, x->state()->copy_locks()); + info = state_for(x); } __ move(new LIR_Address(rcvr.result(), oopDesc::klass_offset_in_bytes(), T_OBJECT), result, info); - __ move(new LIR_Address(result, Klass::java_mirror_offset_in_bytes() + - klassOopDesc::klass_part_offset_in_bytes(), T_OBJECT), result); + __ move_wide(new LIR_Address(result, Klass::java_mirror_offset_in_bytes() + + klassOopDesc::klass_part_offset_in_bytes(), T_OBJECT), result); } @@ -1115,7 +1128,7 @@ void LIRGenerator::do_getClass(Intrinsic* x) { void LIRGenerator::do_currentThread(Intrinsic* x) { assert(x->number_of_arguments() == 0, "wrong type"); LIR_Opr reg = rlock_result(x); - __ load(new LIR_Address(getThreadPointer(), in_bytes(JavaThread::threadObj_offset()), T_OBJECT), reg); + __ move_wide(new LIR_Address(getThreadPointer(), in_bytes(JavaThread::threadObj_offset()), T_OBJECT), reg); } @@ -1482,7 +1495,7 @@ void LIRGenerator::do_StoreField(StoreField* x) { } else if (x->needs_null_check()) { NullCheck* nc = x->explicit_null_check(); if (nc == NULL) { - info = state_for(x, x->lock_stack()); + info = state_for(x); } else { info = state_for(nc); } @@ -1510,10 +1523,12 @@ void LIRGenerator::do_StoreField(StoreField* x) { set_no_result(x); +#ifndef PRODUCT if (PrintNotLoaded && needs_patching) { tty->print_cr(" ###class not loaded at store_%s bci %d", - x->is_static() ? "static" : "field", x->bci()); + x->is_static() ? "static" : "field", x->printable_bci()); } +#endif if (x->needs_null_check() && (needs_patching || @@ -1576,7 +1591,7 @@ void LIRGenerator::do_LoadField(LoadField* x) { } else if (x->needs_null_check()) { NullCheck* nc = x->explicit_null_check(); if (nc == NULL) { - info = state_for(x, x->lock_stack()); + info = state_for(x); } else { info = state_for(nc); } @@ -1586,10 +1601,12 @@ void LIRGenerator::do_LoadField(LoadField* x) { object.load_item(); +#ifndef PRODUCT if (PrintNotLoaded && needs_patching) { tty->print_cr(" ###class not loaded at load_%s bci %d", - x->is_static() ? "static" : "field", x->bci()); + x->is_static() ? "static" : "field", x->printable_bci()); } +#endif if (x->needs_null_check() && (needs_patching || @@ -1782,7 +1799,7 @@ void LIRGenerator::do_Throw(Throw* x) { if (GenerateCompilerNullChecks && (x->exception()->as_NewInstance() == NULL && x->exception()->as_ExceptionObject() == NULL)) { // if the exception object wasn't created using new then it might be null. - __ null_check(exception_opr, new CodeEmitInfo(info, true)); + __ null_check(exception_opr, new CodeEmitInfo(info, x->state()->copy(ValueStack::ExceptionState, x->state()->bci()))); } if (compilation()->env()->jvmti_can_post_on_exceptions()) { @@ -1888,7 +1905,11 @@ void LIRGenerator::do_UnsafeGetRaw(UnsafeGetRaw* x) { if (x->may_be_unaligned() && (dst_type == T_LONG || dst_type == T_DOUBLE)) { __ unaligned_move(addr, reg); } else { - __ move(addr, reg); + if (dst_type == T_OBJECT && x->is_wide()) { + __ move_wide(addr, reg); + } else { + __ move(addr, reg); + } } } @@ -2128,7 +2149,6 @@ void LIRGenerator::do_TableSwitch(TableSwitch* x) { int lo_key = x->lo_key(); int hi_key = x->hi_key(); int len = x->length(); - CodeEmitInfo* info = state_for(x, x->state()); LIR_Opr value = tag.result(); if (UseTableRanges) { do_SwitchRanges(create_lookup_ranges(x), value, x->default_sux()); @@ -2187,7 +2207,7 @@ void LIRGenerator::do_Goto(Goto* x) { // increment backedge counter if needed CodeEmitInfo* info = state_for(x, state); - increment_backedge_counter(info, info->bci()); + increment_backedge_counter(info, info->stack()->bci()); CodeEmitInfo* safepoint_info = state_for(x, state); __ safepoint(safepoint_poll_register(), safepoint_info); } @@ -2196,11 +2216,8 @@ void LIRGenerator::do_Goto(Goto* x) { if (x->should_profile()) { ciMethod* method = x->profiled_method(); assert(method != NULL, "method should be set if branch is profiled"); - ciMethodData* md = method->method_data(); - if (md == NULL) { - bailout("out of memory building methodDataOop"); - return; - } + ciMethodData* md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(x->profiled_bci()); assert(data != NULL, "must have profiling data"); int offset; @@ -2268,7 +2285,7 @@ void LIRGenerator::do_Base(Base* x) { if (compilation()->env()->dtrace_method_probes()) { BasicTypeList signature; - signature.append(T_INT); // thread + signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT)); // thread signature.append(T_OBJECT); // methodOop LIR_OprList* args = new LIR_OprList(); args->append(getThreadPointer()); @@ -2294,7 +2311,7 @@ void LIRGenerator::do_Base(Base* x) { LIR_Opr lock = new_register(T_INT); __ load_stack_address_monitor(0, lock); - CodeEmitInfo* info = new CodeEmitInfo(SynchronizationEntryBCI, scope()->start()->state(), NULL); + CodeEmitInfo* info = new CodeEmitInfo(scope()->start()->state()->copy(ValueStack::StateBefore, SynchronizationEntryBCI), NULL); CodeStub* slow_path = new MonitorEnterStub(obj, lock, info); // receiver is guaranteed non-NULL so don't need CodeEmitInfo @@ -2304,7 +2321,7 @@ void LIRGenerator::do_Base(Base* x) { // increment invocation counters if needed if (!method()->is_accessor()) { // Accessors do not have MDOs, so no counting. - CodeEmitInfo* info = new CodeEmitInfo(InvocationEntryBci, scope()->start()->state(), NULL); + CodeEmitInfo* info = new CodeEmitInfo(scope()->start()->state()->copy(ValueStack::StateBefore, SynchronizationEntryBCI), NULL); increment_invocation_counter(info); } @@ -2333,11 +2350,14 @@ void LIRGenerator::invoke_load_arguments(Invoke* x, LIRItemList* args, const LIR } else { LIR_Address* addr = loc->as_address_ptr(); param->load_for_store(addr->type()); - if (addr->type() == T_LONG || addr->type() == T_DOUBLE) { - __ unaligned_move(param->result(), addr); - } else { - __ move(param->result(), addr); - } + if (addr->type() == T_OBJECT) { + __ move_wide(param->result(), addr); + } else + if (addr->type() == T_LONG || addr->type() == T_DOUBLE) { + __ unaligned_move(param->result(), addr); + } else { + __ move(param->result(), addr); + } } } @@ -2349,7 +2369,7 @@ void LIRGenerator::invoke_load_arguments(Invoke* x, LIRItemList* args, const LIR } else { assert(loc->is_address(), "just checking"); receiver->load_for_store(T_OBJECT); - __ move(receiver->result(), loc); + __ move_wide(receiver->result(), loc->as_address_ptr()); } } } @@ -2464,7 +2484,7 @@ void LIRGenerator::do_Invoke(Invoke* x) { break; case Bytecodes::_invokedynamic: { ciBytecodeStream bcs(x->scope()->method()); - bcs.force_bci(x->bci()); + bcs.force_bci(x->state()->bci()); assert(bcs.cur_bc() == Bytecodes::_invokedynamic, "wrong stream"); ciCPCache* cpcache = bcs.get_cpcache(); @@ -2571,7 +2591,7 @@ void LIRGenerator::do_IfOp(IfOp* x) { LIR_Opr reg = rlock_result(x); __ cmp(lir_cond(x->cond()), left.result(), right.result()); - __ cmove(lir_cond(x->cond()), t_val.result(), f_val.result(), reg); + __ cmove(lir_cond(x->cond()), t_val.result(), f_val.result(), reg, as_BasicType(x->x()->type())); } @@ -2697,7 +2717,9 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info, } else if (level == CompLevel_full_profile) { offset = in_bytes(backedge ? methodDataOopDesc::backedge_counter_offset() : methodDataOopDesc::invocation_counter_offset()); - __ oop2reg(method->method_data()->constant_encoding(), counter_holder); + ciMethodData* md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); + __ oop2reg(md->constant_encoding(), counter_holder); meth = new_register(T_OBJECT); __ oop2reg(method->constant_encoding(), meth); } else { @@ -2829,4 +2851,3 @@ LIR_Opr LIRGenerator::call_runtime(BasicTypeArray* signature, LIRItemList* args, } return result; } - diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp index f1c53941aaf..96b6b1c1995 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp @@ -22,6 +22,14 @@ * */ +#ifndef SHARE_VM_C1_C1_LIRGENERATOR_HPP +#define SHARE_VM_C1_C1_LIRGENERATOR_HPP + +#include "c1/c1_Instruction.hpp" +#include "c1/c1_LIR.hpp" +#include "ci/ciMethodData.hpp" +#include "utilities/sizes.hpp" + // The classes responsible for code emission and register allocation @@ -596,3 +604,5 @@ class LIRItem: public CompilationResourceObj { jdouble get_jdouble_constant() const; jint get_address_constant() const; }; + +#endif // SHARE_VM_C1_C1_LIRGENERATOR_HPP diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index b5adb2db479..7419f9e8fac 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -22,8 +22,25 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_LinearScan.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_CFGPrinter.hpp" +#include "c1/c1_CodeStubs.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_IR.hpp" +#include "c1/c1_LIRGenerator.hpp" +#include "c1/c1_LinearScan.hpp" +#include "c1/c1_ValueStack.hpp" +#include "utilities/bitMap.inline.hpp" +#ifdef TARGET_ARCH_x86 +# include "vmreg_x86.inline.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "vmreg_sparc.inline.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "vmreg_zero.inline.hpp" +#endif #ifndef PRODUCT @@ -73,6 +90,7 @@ LinearScan::LinearScan(IR* ir, LIRGenerator* gen, FrameMap* frame_map) , _intervals(0) // initialized later with correct length , _new_intervals_from_allocation(new IntervalList()) , _sorted_intervals(NULL) + , _needs_full_resort(false) , _lir_ops(0) // initialized later with correct length , _block_of_op(0) // initialized later with correct length , _has_info(0) @@ -1256,7 +1274,7 @@ void LinearScan::build_intervals() { int caller_save_registers[LinearScan::nof_regs]; int i; - for (i = 0; i < FrameMap::nof_caller_save_cpu_regs; i++) { + for (i = 0; i < FrameMap::nof_caller_save_cpu_regs(); i++) { LIR_Opr opr = FrameMap::caller_save_cpu_reg_at(i); assert(opr->is_valid() && opr->is_register(), "FrameMap should not return invalid operands"); assert(reg_numHi(opr) == -1, "missing addition of range for hi-register"); @@ -1503,6 +1521,14 @@ void LinearScan::create_unhandled_lists(Interval** list1, Interval** list2, bool void LinearScan::sort_intervals_before_allocation() { TIME_LINEAR_SCAN(timer_sort_intervals_before); + if (_needs_full_resort) { + // There is no known reason why this should occur but just in case... + assert(false, "should never occur"); + // Re-sort existing interval list because an Interval::from() has changed + _sorted_intervals->sort(interval_cmp); + _needs_full_resort = false; + } + IntervalList* unsorted_list = &_intervals; int unsorted_len = unsorted_list->length(); int sorted_len = 0; @@ -1542,11 +1568,18 @@ void LinearScan::sort_intervals_before_allocation() { } } _sorted_intervals = sorted_list; + assert(is_sorted(_sorted_intervals), "intervals unsorted"); } void LinearScan::sort_intervals_after_allocation() { TIME_LINEAR_SCAN(timer_sort_intervals_after); + if (_needs_full_resort) { + // Re-sort existing interval list because an Interval::from() has changed + _sorted_intervals->sort(interval_cmp); + _needs_full_resort = false; + } + IntervalArray* old_list = _sorted_intervals; IntervalList* new_list = _new_intervals_from_allocation; int old_len = old_list->length(); @@ -1554,6 +1587,7 @@ void LinearScan::sort_intervals_after_allocation() { if (new_len == 0) { // no intervals have been added during allocation, so sorted list is already up to date + assert(is_sorted(_sorted_intervals), "intervals unsorted"); return; } @@ -1576,6 +1610,7 @@ void LinearScan::sort_intervals_after_allocation() { } _sorted_intervals = combined_list; + assert(is_sorted(_sorted_intervals), "intervals unsorted"); } @@ -1808,6 +1843,8 @@ void LinearScan::resolve_exception_entry(BlockBegin* block, int reg_num, MoveRes interval = interval->split(from_op_id); interval->assign_reg(reg, regHi); append_interval(interval); + } else { + _needs_full_resort = true; } assert(interval->from() == from_op_id, "must be true now"); @@ -2018,6 +2055,12 @@ LIR_Opr LinearScan::calc_operand_for_interval(const Interval* interval) { return LIR_OprFact::single_cpu_oop(assigned_reg); } + case T_ADDRESS: { + assert(assigned_reg >= pd_first_cpu_reg && assigned_reg <= pd_last_cpu_reg, "no cpu register"); + assert(interval->assigned_regHi() == any_reg, "must not have hi register"); + return LIR_OprFact::single_cpu_address(assigned_reg); + } + #ifdef __SOFTFP__ case T_FLOAT: // fall through #endif // __SOFTFP__ @@ -2268,8 +2311,8 @@ void assert_equal(IRScopeDebugInfo* d1, IRScopeDebugInfo* d2) { } void check_stack_depth(CodeEmitInfo* info, int stack_end) { - if (info->bci() != SynchronizationEntryBCI && !info->scope()->method()->is_native()) { - Bytecodes::Code code = info->scope()->method()->java_code_at_bci(info->bci()); + if (info->stack()->bci() != SynchronizationEntryBCI && !info->scope()->method()->is_native()) { + Bytecodes::Code code = info->scope()->method()->java_code_at_bci(info->stack()->bci()); switch (code) { case Bytecodes::_ifnull : // fall through case Bytecodes::_ifnonnull : // fall through @@ -2373,7 +2416,7 @@ OopMap* LinearScan::compute_oop_map(IntervalWalker* iw, LIR_Op* op, CodeEmitInfo // add oops from lock stack assert(info->stack() != NULL, "CodeEmitInfo must always have a stack"); - int locks_count = info->stack()->locks_size(); + int locks_count = info->stack()->total_locks_size(); for (int i = 0; i < locks_count; i++) { map->set_oop(frame_map()->monitor_object_regname(i)); } @@ -2756,19 +2799,13 @@ int LinearScan::append_scope_value(int op_id, Value value, GrowableArraycaller_state(); + ValueStack* caller_state = cur_state->caller_state(); if (caller_state != NULL) { // process recursively to compute outermost scope first - stack_begin = caller_state->stack_size(); - locks_begin = caller_state->locks_size(); - caller_debug_info = compute_debug_info_for_scope(op_id, cur_scope->caller(), caller_state, innermost_state, cur_scope->caller_bci(), stack_begin, locks_begin); - } else { - stack_begin = 0; - locks_begin = 0; + caller_debug_info = compute_debug_info_for_scope(op_id, cur_scope->caller(), caller_state, innermost_state); } // initialize these to null. @@ -2779,7 +2816,7 @@ IRScopeDebugInfo* LinearScan::compute_debug_info_for_scope(int op_id, IRScope* c GrowableArray* monitors = NULL; // describe local variable values - int nof_locals = cur_scope->method()->max_locals(); + int nof_locals = cur_state->locals_size(); if (nof_locals > 0) { locals = new GrowableArray(nof_locals); @@ -2794,45 +2831,41 @@ IRScopeDebugInfo* LinearScan::compute_debug_info_for_scope(int op_id, IRScope* c } assert(locals->length() == cur_scope->method()->max_locals(), "wrong number of locals"); assert(locals->length() == cur_state->locals_size(), "wrong number of locals"); + } else if (cur_scope->method()->max_locals() > 0) { + assert(cur_state->kind() == ValueStack::EmptyExceptionState, "should be"); + nof_locals = cur_scope->method()->max_locals(); + locals = new GrowableArray(nof_locals); + for(int i = 0; i < nof_locals; i++) { + locals->append(&_illegal_value); + } } - // describe expression stack - // - // When we inline methods containing exception handlers, the - // "lock_stacks" are changed to preserve expression stack values - // in caller scopes when exception handlers are present. This - // can cause callee stacks to be smaller than caller stacks. - if (stack_end > innermost_state->stack_size()) { - stack_end = innermost_state->stack_size(); - } - - - - int nof_stack = stack_end - stack_begin; + int nof_stack = cur_state->stack_size(); if (nof_stack > 0) { expressions = new GrowableArray(nof_stack); - int pos = stack_begin; - while (pos < stack_end) { - Value expression = innermost_state->stack_at_inc(pos); + int pos = 0; + while (pos < nof_stack) { + Value expression = cur_state->stack_at_inc(pos); append_scope_value(op_id, expression, expressions); - assert(expressions->length() + stack_begin == pos, "must match"); + assert(expressions->length() == pos, "must match"); } + assert(expressions->length() == cur_state->stack_size(), "wrong number of stack entries"); } // describe monitors - assert(locks_begin <= locks_end, "error in scope iteration"); - int nof_locks = locks_end - locks_begin; + int nof_locks = cur_state->locks_size(); if (nof_locks > 0) { + int lock_offset = cur_state->caller_state() != NULL ? cur_state->caller_state()->total_locks_size() : 0; monitors = new GrowableArray(nof_locks); - for (int i = locks_begin; i < locks_end; i++) { - monitors->append(location_for_monitor_index(i)); + for (int i = 0; i < nof_locks; i++) { + monitors->append(location_for_monitor_index(lock_offset + i)); } } - return new IRScopeDebugInfo(cur_scope, cur_bci, locals, expressions, monitors, caller_debug_info); + return new IRScopeDebugInfo(cur_scope, cur_state->bci(), locals, expressions, monitors, caller_debug_info); } @@ -2844,17 +2877,14 @@ void LinearScan::compute_debug_info(CodeEmitInfo* info, int op_id) { assert(innermost_scope != NULL && innermost_state != NULL, "why is it missing?"); - int stack_end = innermost_state->stack_size(); - int locks_end = innermost_state->locks_size(); - - DEBUG_ONLY(check_stack_depth(info, stack_end)); + DEBUG_ONLY(check_stack_depth(info, innermost_state->stack_size())); if (info->_scope_debug_info == NULL) { // compute debug information - info->_scope_debug_info = compute_debug_info_for_scope(op_id, innermost_scope, innermost_state, innermost_state, info->bci(), stack_end, locks_end); + info->_scope_debug_info = compute_debug_info_for_scope(op_id, innermost_scope, innermost_state, innermost_state); } else { // debug information already set. Check that it is correct from the current point of view - DEBUG_ONLY(assert_equal(info->_scope_debug_info, compute_debug_info_for_scope(op_id, innermost_scope, innermost_state, innermost_state, info->bci(), stack_end, locks_end))); + DEBUG_ONLY(assert_equal(info->_scope_debug_info, compute_debug_info_for_scope(op_id, innermost_scope, innermost_state, innermost_state))); } } @@ -3547,7 +3577,7 @@ void RegisterVerifier::process_operations(LIR_List* ops, IntervalList* input_sta // invalidate all caller save registers at calls if (visitor.has_call()) { - for (j = 0; j < FrameMap::nof_caller_save_cpu_regs; j++) { + for (j = 0; j < FrameMap::nof_caller_save_cpu_regs(); j++) { state_put(input_state, reg_num(FrameMap::caller_save_cpu_reg_at(j)), NULL); } for (j = 0; j < FrameMap::nof_caller_save_fpu_regs; j++) { @@ -4482,7 +4512,8 @@ void Interval::print(outputStream* out) const { } } else { type_name = type2name(type()); - if (assigned_reg() != -1) { + if (assigned_reg() != -1 && + (LinearScan::num_physical_regs(type()) == 1 || assigned_regHi() != -1)) { opr = LinearScan::calc_operand_for_interval(this); } } @@ -5586,7 +5617,7 @@ void LinearScanWalker::init_vars_for_alloc(Interval* cur) { _last_reg = pd_last_fpu_reg; } else { _first_reg = pd_first_cpu_reg; - _last_reg = pd_last_cpu_reg; + _last_reg = FrameMap::last_cpu_reg(); } assert(0 <= _first_reg && _first_reg < LinearScan::nof_regs, "out of range"); diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.hpp b/hotspot/src/share/vm/c1/c1_LinearScan.hpp index 9d5b2171e52..018570f9c56 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.hpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#ifndef SHARE_VM_C1_C1_LINEARSCAN_HPP +#define SHARE_VM_C1_C1_LINEARSCAN_HPP + +#include "c1/c1_FpuStackSim.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_IR.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_LIR.hpp" +#include "c1/c1_LIRGenerator.hpp" + class DebugInfoCache; class FpuStackAllocator; class IRScopeDebugInfo; @@ -138,6 +148,7 @@ class LinearScan : public CompilationResourceObj { IntervalList _intervals; // mapping from register number to interval IntervalList* _new_intervals_from_allocation; // list with all intervals created during allocation when an existing interval is split IntervalArray* _sorted_intervals; // intervals sorted by Interval::from() + bool _needs_full_resort; // set to true if an Interval::from() is changed and _sorted_intervals must be resorted LIR_OpArray _lir_ops; // mapping from LIR_Op id to LIR_Op node BlockBeginArray _block_of_op; // mapping from LIR_Op id to the BlockBegin containing this instruction @@ -346,7 +357,7 @@ class LinearScan : public CompilationResourceObj { int append_scope_value_for_operand(LIR_Opr opr, GrowableArray* scope_values); int append_scope_value(int op_id, Value value, GrowableArray* scope_values); - IRScopeDebugInfo* compute_debug_info_for_scope(int op_id, IRScope* cur_scope, ValueStack* cur_state, ValueStack* innermost_state, int cur_bci, int stack_end, int locks_end); + IRScopeDebugInfo* compute_debug_info_for_scope(int op_id, IRScope* cur_scope, ValueStack* cur_state, ValueStack* innermost_state); void compute_debug_info(CodeEmitInfo* info, int op_id); void assign_reg_num(LIR_OpList* instructions, IntervalWalker* iw); @@ -955,4 +966,12 @@ class LinearScanTimers : public StackObj { // Pick up platform-dependent implementation details -# include "incls/_c1_LinearScan_pd.hpp.incl" +#ifdef TARGET_ARCH_x86 +# include "c1_LinearScan_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "c1_LinearScan_sparc.hpp" +#endif + + +#endif // SHARE_VM_C1_C1_LINEARSCAN_HPP diff --git a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp index d0a93795c92..41ee336343e 100644 --- a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp +++ b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp @@ -22,6 +22,20 @@ * */ +#ifndef SHARE_VM_C1_C1_MACROASSEMBLER_HPP +#define SHARE_VM_C1_C1_MACROASSEMBLER_HPP + +#include "asm/assembler.hpp" +#ifdef TARGET_ARCH_x86 +# include "assembler_x86.inline.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "assembler_sparc.inline.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "assembler_zero.inline.hpp" +#endif + class CodeEmitInfo; class C1_MacroAssembler: public MacroAssembler { @@ -41,7 +55,13 @@ class C1_MacroAssembler: public MacroAssembler { void verify_stack_oop(int offset) PRODUCT_RETURN; void verify_not_null_oop(Register r) PRODUCT_RETURN; -#include "incls/_c1_MacroAssembler_pd.hpp.incl" +#ifdef TARGET_ARCH_x86 +# include "c1_MacroAssembler_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "c1_MacroAssembler_sparc.hpp" +#endif + }; @@ -80,3 +100,5 @@ class StubAssembler: public C1_MacroAssembler { int call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1, Register arg2); int call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1, Register arg2, Register arg3); }; + +#endif // SHARE_VM_C1_C1_MACROASSEMBLER_HPP diff --git a/hotspot/src/share/vm/c1/c1_Optimizer.cpp b/hotspot/src/share/vm/c1/c1_Optimizer.cpp index d3d51cedb09..b4da85cc4ff 100644 --- a/hotspot/src/share/vm/c1/c1_Optimizer.cpp +++ b/hotspot/src/share/vm/c1/c1_Optimizer.cpp @@ -22,8 +22,13 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_Optimizer.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Canonicalizer.hpp" +#include "c1/c1_Optimizer.hpp" +#include "c1/c1_ValueMap.hpp" +#include "c1/c1_ValueSet.hpp" +#include "c1/c1_ValueStack.hpp" +#include "utilities/bitMap.inline.hpp" define_array(ValueSetArray, ValueSet*); define_stack(ValueSetList, ValueSetArray); @@ -38,18 +43,20 @@ class CE_Eliminator: public BlockClosure { private: IR* _hir; int _cee_count; // the number of CEs successfully eliminated + int _ifop_count; // the number of IfOps successfully simplified int _has_substitution; public: - CE_Eliminator(IR* hir) : _cee_count(0), _hir(hir) { + CE_Eliminator(IR* hir) : _cee_count(0), _ifop_count(0), _hir(hir) { _has_substitution = false; _hir->iterate_preorder(this); if (_has_substitution) { - // substituted some phis so resolve the substitution + // substituted some ifops/phis, so resolve the substitution SubstitutionResolver sr(_hir); } } int cee_count() const { return _cee_count; } + int ifop_count() const { return _ifop_count; } void adjust_exception_edges(BlockBegin* block, BlockBegin* sux) { int e = sux->number_of_exception_handlers(); @@ -68,155 +75,214 @@ class CE_Eliminator: public BlockClosure { } } - virtual void block_do(BlockBegin* block) { - // 1) find conditional expression - // check if block ends with an If - If* if_ = block->end()->as_If(); - if (if_ == NULL) return; + virtual void block_do(BlockBegin* block); - // check if If works on int or object types - // (we cannot handle If's working on long, float or doubles yet, - // since IfOp doesn't support them - these If's show up if cmp - // operations followed by If's are eliminated) - ValueType* if_type = if_->x()->type(); - if (!if_type->is_int() && !if_type->is_object()) return; - - BlockBegin* t_block = if_->tsux(); - BlockBegin* f_block = if_->fsux(); - Instruction* t_cur = t_block->next(); - Instruction* f_cur = f_block->next(); - - // one Constant may be present between BlockBegin and BlockEnd - Value t_const = NULL; - Value f_const = NULL; - if (t_cur->as_Constant() != NULL && !t_cur->can_trap()) { - t_const = t_cur; - t_cur = t_cur->next(); - } - if (f_cur->as_Constant() != NULL && !f_cur->can_trap()) { - f_const = f_cur; - f_cur = f_cur->next(); - } - - // check if both branches end with a goto - Goto* t_goto = t_cur->as_Goto(); - if (t_goto == NULL) return; - Goto* f_goto = f_cur->as_Goto(); - if (f_goto == NULL) return; - - // check if both gotos merge into the same block - BlockBegin* sux = t_goto->default_sux(); - if (sux != f_goto->default_sux()) return; - - // check if at least one word was pushed on sux_state - ValueStack* sux_state = sux->state(); - if (sux_state->stack_size() <= if_->state()->stack_size()) return; - - // check if phi function is present at end of successor stack and that - // only this phi was pushed on the stack - Value sux_phi = sux_state->stack_at(if_->state()->stack_size()); - if (sux_phi == NULL || sux_phi->as_Phi() == NULL || sux_phi->as_Phi()->block() != sux) return; - if (sux_phi->type()->size() != sux_state->stack_size() - if_->state()->stack_size()) return; - - // get the values that were pushed in the true- and false-branch - Value t_value = t_goto->state()->stack_at(if_->state()->stack_size()); - Value f_value = f_goto->state()->stack_at(if_->state()->stack_size()); - - // backend does not support floats - assert(t_value->type()->base() == f_value->type()->base(), "incompatible types"); - if (t_value->type()->is_float_kind()) return; - - // check that successor has no other phi functions but sux_phi - // this can happen when t_block or f_block contained additonal stores to local variables - // that are no longer represented by explicit instructions - for_each_phi_fun(sux, phi, - if (phi != sux_phi) return; - ); - // true and false blocks can't have phis - for_each_phi_fun(t_block, phi, return; ); - for_each_phi_fun(f_block, phi, return; ); - - // 2) substitute conditional expression - // with an IfOp followed by a Goto - // cut if_ away and get node before - Instruction* cur_end = if_->prev(block); - int bci = if_->bci(); - - // append constants of true- and false-block if necessary - // clone constants because original block must not be destroyed - assert((t_value != f_const && f_value != t_const) || t_const == f_const, "mismatch"); - if (t_value == t_const) { - t_value = new Constant(t_const->type()); - cur_end = cur_end->set_next(t_value, bci); - } - if (f_value == f_const) { - f_value = new Constant(f_const->type()); - cur_end = cur_end->set_next(f_value, bci); - } - - // it is very unlikely that the condition can be statically decided - // (this was checked previously by the Canonicalizer), so always - // append IfOp - Value result = new IfOp(if_->x(), if_->cond(), if_->y(), t_value, f_value); - cur_end = cur_end->set_next(result, bci); - - // append Goto to successor - ValueStack* state_before = if_->is_safepoint() ? if_->state_before() : NULL; - Goto* goto_ = new Goto(sux, state_before, if_->is_safepoint() || t_goto->is_safepoint() || f_goto->is_safepoint()); - - // prepare state for Goto - ValueStack* goto_state = if_->state(); - while (sux_state->scope() != goto_state->scope()) { - goto_state = goto_state->pop_scope(); - assert(goto_state != NULL, "states do not match up"); - } - goto_state = goto_state->copy(); - goto_state->push(result->type(), result); - assert(goto_state->is_same_across_scopes(sux_state), "states must match now"); - goto_->set_state(goto_state); - - // Steal the bci for the goto from the sux - cur_end = cur_end->set_next(goto_, sux->bci()); - - // Adjust control flow graph - BlockBegin::disconnect_edge(block, t_block); - BlockBegin::disconnect_edge(block, f_block); - if (t_block->number_of_preds() == 0) { - BlockBegin::disconnect_edge(t_block, sux); - } - adjust_exception_edges(block, t_block); - if (f_block->number_of_preds() == 0) { - BlockBegin::disconnect_edge(f_block, sux); - } - adjust_exception_edges(block, f_block); - - // update block end - block->set_end(goto_); - - // substitute the phi if possible - if (sux_phi->as_Phi()->operand_count() == 1) { - assert(sux_phi->as_Phi()->operand_at(0) == result, "screwed up phi"); - sux_phi->set_subst(result); - _has_substitution = true; - } - - // 3) successfully eliminated a conditional expression - _cee_count++; - if (PrintCEE) { - tty->print_cr("%d. CEE in B%d (B%d B%d)", cee_count(), block->block_id(), t_block->block_id(), f_block->block_id()); - } - - _hir->verify(); - } + private: + Value make_ifop(Value x, Instruction::Condition cond, Value y, Value tval, Value fval); }; +void CE_Eliminator::block_do(BlockBegin* block) { + // 1) find conditional expression + // check if block ends with an If + If* if_ = block->end()->as_If(); + if (if_ == NULL) return; + + // check if If works on int or object types + // (we cannot handle If's working on long, float or doubles yet, + // since IfOp doesn't support them - these If's show up if cmp + // operations followed by If's are eliminated) + ValueType* if_type = if_->x()->type(); + if (!if_type->is_int() && !if_type->is_object()) return; + + BlockBegin* t_block = if_->tsux(); + BlockBegin* f_block = if_->fsux(); + Instruction* t_cur = t_block->next(); + Instruction* f_cur = f_block->next(); + + // one Constant may be present between BlockBegin and BlockEnd + Value t_const = NULL; + Value f_const = NULL; + if (t_cur->as_Constant() != NULL && !t_cur->can_trap()) { + t_const = t_cur; + t_cur = t_cur->next(); + } + if (f_cur->as_Constant() != NULL && !f_cur->can_trap()) { + f_const = f_cur; + f_cur = f_cur->next(); + } + + // check if both branches end with a goto + Goto* t_goto = t_cur->as_Goto(); + if (t_goto == NULL) return; + Goto* f_goto = f_cur->as_Goto(); + if (f_goto == NULL) return; + + // check if both gotos merge into the same block + BlockBegin* sux = t_goto->default_sux(); + if (sux != f_goto->default_sux()) return; + + // check if at least one word was pushed on sux_state + ValueStack* sux_state = sux->state(); + if (sux_state->stack_size() <= if_->state()->stack_size()) return; + + // check if phi function is present at end of successor stack and that + // only this phi was pushed on the stack + Value sux_phi = sux_state->stack_at(if_->state()->stack_size()); + if (sux_phi == NULL || sux_phi->as_Phi() == NULL || sux_phi->as_Phi()->block() != sux) return; + if (sux_phi->type()->size() != sux_state->stack_size() - if_->state()->stack_size()) return; + + // get the values that were pushed in the true- and false-branch + Value t_value = t_goto->state()->stack_at(if_->state()->stack_size()); + Value f_value = f_goto->state()->stack_at(if_->state()->stack_size()); + + // backend does not support floats + assert(t_value->type()->base() == f_value->type()->base(), "incompatible types"); + if (t_value->type()->is_float_kind()) return; + + // check that successor has no other phi functions but sux_phi + // this can happen when t_block or f_block contained additonal stores to local variables + // that are no longer represented by explicit instructions + for_each_phi_fun(sux, phi, + if (phi != sux_phi) return; + ); + // true and false blocks can't have phis + for_each_phi_fun(t_block, phi, return; ); + for_each_phi_fun(f_block, phi, return; ); + + // 2) substitute conditional expression + // with an IfOp followed by a Goto + // cut if_ away and get node before + Instruction* cur_end = if_->prev(block); + + // append constants of true- and false-block if necessary + // clone constants because original block must not be destroyed + assert((t_value != f_const && f_value != t_const) || t_const == f_const, "mismatch"); + if (t_value == t_const) { + t_value = new Constant(t_const->type()); + NOT_PRODUCT(t_value->set_printable_bci(if_->printable_bci())); + cur_end = cur_end->set_next(t_value); + } + if (f_value == f_const) { + f_value = new Constant(f_const->type()); + NOT_PRODUCT(f_value->set_printable_bci(if_->printable_bci())); + cur_end = cur_end->set_next(f_value); + } + + Value result = make_ifop(if_->x(), if_->cond(), if_->y(), t_value, f_value); + assert(result != NULL, "make_ifop must return a non-null instruction"); + if (!result->is_linked() && result->can_be_linked()) { + NOT_PRODUCT(result->set_printable_bci(if_->printable_bci())); + cur_end = cur_end->set_next(result); + } + + // append Goto to successor + ValueStack* state_before = if_->is_safepoint() ? if_->state_before() : NULL; + Goto* goto_ = new Goto(sux, state_before, if_->is_safepoint() || t_goto->is_safepoint() || f_goto->is_safepoint()); + + // prepare state for Goto + ValueStack* goto_state = if_->state(); + while (sux_state->scope() != goto_state->scope()) { + goto_state = goto_state->caller_state(); + assert(goto_state != NULL, "states do not match up"); + } + goto_state = goto_state->copy(ValueStack::StateAfter, goto_state->bci()); + goto_state->push(result->type(), result); + assert(goto_state->is_same(sux_state), "states must match now"); + goto_->set_state(goto_state); + + cur_end = cur_end->set_next(goto_, goto_state->bci()); + + // Adjust control flow graph + BlockBegin::disconnect_edge(block, t_block); + BlockBegin::disconnect_edge(block, f_block); + if (t_block->number_of_preds() == 0) { + BlockBegin::disconnect_edge(t_block, sux); + } + adjust_exception_edges(block, t_block); + if (f_block->number_of_preds() == 0) { + BlockBegin::disconnect_edge(f_block, sux); + } + adjust_exception_edges(block, f_block); + + // update block end + block->set_end(goto_); + + // substitute the phi if possible + if (sux_phi->as_Phi()->operand_count() == 1) { + assert(sux_phi->as_Phi()->operand_at(0) == result, "screwed up phi"); + sux_phi->set_subst(result); + _has_substitution = true; + } + + // 3) successfully eliminated a conditional expression + _cee_count++; + if (PrintCEE) { + tty->print_cr("%d. CEE in B%d (B%d B%d)", cee_count(), block->block_id(), t_block->block_id(), f_block->block_id()); + tty->print_cr("%d. IfOp in B%d", ifop_count(), block->block_id()); + } + + _hir->verify(); +} + +Value CE_Eliminator::make_ifop(Value x, Instruction::Condition cond, Value y, Value tval, Value fval) { + if (!OptimizeIfOps) { + return new IfOp(x, cond, y, tval, fval); + } + + tval = tval->subst(); + fval = fval->subst(); + if (tval == fval) { + _ifop_count++; + return tval; + } + + x = x->subst(); + y = y->subst(); + + Constant* y_const = y->as_Constant(); + if (y_const != NULL) { + IfOp* x_ifop = x->as_IfOp(); + if (x_ifop != NULL) { // x is an ifop, y is a constant + Constant* x_tval_const = x_ifop->tval()->subst()->as_Constant(); + Constant* x_fval_const = x_ifop->fval()->subst()->as_Constant(); + + if (x_tval_const != NULL && x_fval_const != NULL) { + Instruction::Condition x_ifop_cond = x_ifop->cond(); + + Constant::CompareResult t_compare_res = x_tval_const->compare(cond, y_const); + Constant::CompareResult f_compare_res = x_fval_const->compare(cond, y_const); + + guarantee(t_compare_res != Constant::not_comparable && f_compare_res != Constant::not_comparable, "incomparable constants in IfOp"); + + Value new_tval = t_compare_res == Constant::cond_true ? tval : fval; + Value new_fval = f_compare_res == Constant::cond_true ? tval : fval; + + _ifop_count++; + if (new_tval == new_fval) { + return new_tval; + } else { + return new IfOp(x_ifop->x(), x_ifop_cond, x_ifop->y(), new_tval, new_fval); + } + } + } else { + Constant* x_const = x->as_Constant(); + if (x_const != NULL) { // x and y are constants + Constant::CompareResult x_compare_res = x_const->compare(cond, y_const); + guarantee(x_compare_res != Constant::not_comparable, "incomparable constants in IfOp"); + + _ifop_count++; + return x_compare_res == Constant::cond_true ? tval : fval; + } + } + } + return new IfOp(x, cond, y, tval, fval); +} void Optimizer::eliminate_conditional_expressions() { // find conditional expressions & replace them with IfOps CE_Eliminator ce(ir()); } - class BlockMerger: public BlockClosure { private: IR* _hir; @@ -251,10 +317,8 @@ class BlockMerger: public BlockClosure { // no phi functions must be present at beginning of sux ValueStack* sux_state = sux->state(); ValueStack* end_state = end->state(); - while (end_state->scope() != sux_state->scope()) { - // match up inlining level - end_state = end_state->pop_scope(); - } + + assert(end_state->scope() == sux_state->scope(), "scopes must match"); assert(end_state->stack_size() == sux_state->stack_size(), "stack not equal"); assert(end_state->locals_size() == sux_state->locals_size(), "locals not equal"); @@ -273,7 +337,7 @@ class BlockMerger: public BlockClosure { Instruction* prev = end->prev(block); Instruction* next = sux->next(); assert(prev->as_BlockEnd() == NULL, "must not be a BlockEnd"); - prev->set_next(next, next->bci()); + prev->set_next(next); sux->disconnect_from_graph(); block->set_end(sux->end()); // add exception handlers of deleted block, if any @@ -337,7 +401,8 @@ class BlockMerger: public BlockClosure { newif->set_state(if_->state()->copy()); assert(prev->next() == if_, "must be guaranteed by above search"); - prev->set_next(newif, if_->bci()); + NOT_PRODUCT(newif->set_printable_bci(if_->printable_bci())); + prev->set_next(newif); block->set_end(newif); _merge_count++; @@ -705,7 +770,7 @@ void NullCheckEliminator::iterate_one(BlockBegin* block) { // visiting instructions which are references in other blocks or // visiting instructions more than once. mark_visitable(instr); - if (instr->is_root() || instr->can_trap() || (instr->as_NullCheck() != NULL)) { + if (instr->is_pinned() || instr->can_trap() || (instr->as_NullCheck() != NULL)) { mark_visited(instr); instr->input_values_do(this); instr->visit(&_visitor); diff --git a/hotspot/src/share/vm/c1/c1_Optimizer.hpp b/hotspot/src/share/vm/c1/c1_Optimizer.hpp index 49e7aa598cd..f984158102e 100644 --- a/hotspot/src/share/vm/c1/c1_Optimizer.hpp +++ b/hotspot/src/share/vm/c1/c1_Optimizer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_C1_C1_OPTIMIZER_HPP +#define SHARE_VM_C1_C1_OPTIMIZER_HPP + +#include "c1/c1_IR.hpp" +#include "c1/c1_Instruction.hpp" +#include "memory/allocation.hpp" + class Optimizer VALUE_OBJ_CLASS_SPEC { private: IR* _ir; @@ -35,3 +42,5 @@ class Optimizer VALUE_OBJ_CLASS_SPEC { void eliminate_blocks(); void eliminate_null_checks(); }; + +#endif // SHARE_VM_C1_C1_OPTIMIZER_HPP diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index df05521d050..89cb28c38af 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -22,8 +22,41 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_Runtime1.cpp.incl" +#include "precompiled.hpp" +#include "asm/codeBuffer.hpp" +#include "c1/c1_CodeStubs.hpp" +#include "c1/c1_Defs.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/codeBlob.hpp" +#include "code/compiledIC.hpp" +#include "code/pcDesc.hpp" +#include "code/scopeDesc.hpp" +#include "code/vtableStubs.hpp" +#include "compiler/disassembler.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "interpreter/bytecode.hpp" +#include "interpreter/interpreter.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/barrierSet.hpp" +#include "memory/oopFactory.hpp" +#include "memory/resourceArea.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/compilationPolicy.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/threadCritical.hpp" +#include "runtime/vframe.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/copy.hpp" +#include "utilities/events.hpp" // Implementation of StubAssembler @@ -107,7 +140,6 @@ static void deopt_caller() { RegisterMap reg_map(thread, false); frame runtime_frame = thread->last_frame(); frame caller_frame = runtime_frame.sender(®_map); - // bypass VM_DeoptimizeFrame and deoptimize the frame directly Deoptimization::deoptimize_frame(thread, caller_frame.id()); assert(caller_is_deopted(), "Must be deoptimized"); } @@ -368,8 +400,7 @@ JRT_BLOCK_ENTRY(address, Runtime1::counter_overflow(JavaThread* thread, int bci, if (osr_nm != NULL) { RegisterMap map(thread, false); frame fr = thread->last_frame().sender(&map); - VM_DeoptimizeFrame deopt(thread, fr.id()); - VMThread::execute(&deopt); + Deoptimization::deoptimize_frame(thread, fr.id()); } JRT_BLOCK_END return NULL; @@ -441,8 +472,8 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // We don't really want to deoptimize the nmethod itself since we // can actually continue in the exception handler ourselves but I // don't see an easy way to have the desired effect. - VM_DeoptimizeFrame deopt(thread, caller_frame.id()); - VMThread::execute(&deopt); + Deoptimization::deoptimize_frame(thread, caller_frame.id()); + assert(caller_is_deopted(), "Must be deoptimized"); return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); } @@ -835,8 +866,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i nm->make_not_entrant(); } - VM_DeoptimizeFrame deopt(thread, caller_frame.id()); - VMThread::execute(&deopt); + Deoptimization::deoptimize_frame(thread, caller_frame.id()); // Return to the now deoptimized frame. } @@ -1144,7 +1174,7 @@ JRT_LEAF(int, Runtime1::arraycopy(oopDesc* src, int src_pos, oopDesc* dst, int d memmove(dst_addr, src_addr, length << l2es); return ac_ok; } else if (src->is_objArray() && dst->is_objArray()) { - if (UseCompressedOops) { // will need for tiered + if (UseCompressedOops) { narrowOop *src_addr = objArrayOop(src)->obj_at_addr(src_pos); narrowOop *dst_addr = objArrayOop(dst)->obj_at_addr(dst_pos); return obj_arraycopy_work(src, src_addr, dst, dst_addr, length); @@ -1180,10 +1210,11 @@ JRT_LEAF(void, Runtime1::oop_arraycopy(HeapWord* src, HeapWord* dst, int num)) assert(bs->has_write_ref_array_pre_opt(), "For pre-barrier as well."); if (UseCompressedOops) { bs->write_ref_array_pre((narrowOop*)dst, num); + Copy::conjoint_oops_atomic((narrowOop*) src, (narrowOop*) dst, num); } else { bs->write_ref_array_pre((oop*)dst, num); + Copy::conjoint_oops_atomic((oop*) src, (oop*) dst, num); } - Copy::conjoint_oops_atomic((oop*) src, (oop*) dst, num); bs->write_ref_array(dst, num); JRT_END diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.hpp b/hotspot/src/share/vm/c1/c1_Runtime1.hpp index 38571439c9b..c6ef0d516b8 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.hpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.hpp @@ -22,6 +22,15 @@ * */ +#ifndef SHARE_VM_C1_C1_RUNTIME1_HPP +#define SHARE_VM_C1_C1_RUNTIME1_HPP + +#include "c1/c1_FrameMap.hpp" +#include "code/stubs.hpp" +#include "interpreter/interpreter.hpp" +#include "memory/allocation.hpp" +#include "runtime/deoptimization.hpp" + class StubAssembler; // The Runtime1 holds all assembly stubs and VM @@ -174,3 +183,5 @@ class Runtime1: public AllStatic { static void print_statistics() PRODUCT_RETURN; }; + +#endif // SHARE_VM_C1_C1_RUNTIME1_HPP diff --git a/hotspot/src/share/vm/c1/c1_ValueMap.cpp b/hotspot/src/share/vm/c1/c1_ValueMap.cpp index 90530bcd1de..aa2bf5af549 100644 --- a/hotspot/src/share/vm/c1/c1_ValueMap.cpp +++ b/hotspot/src/share/vm/c1/c1_ValueMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_ValueMap.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_Canonicalizer.hpp" +#include "c1/c1_IR.hpp" +#include "c1/c1_ValueMap.hpp" +#include "utilities/bitMap.inline.hpp" #ifndef PRODUCT diff --git a/hotspot/src/share/vm/c1/c1_ValueMap.hpp b/hotspot/src/share/vm/c1/c1_ValueMap.hpp index 0bf25f031bb..9359abda10a 100644 --- a/hotspot/src/share/vm/c1/c1_ValueMap.hpp +++ b/hotspot/src/share/vm/c1/c1_ValueMap.hpp @@ -22,6 +22,13 @@ * */ +#ifndef SHARE_VM_C1_C1_VALUEMAP_HPP +#define SHARE_VM_C1_C1_VALUEMAP_HPP + +#include "c1/c1_Instruction.hpp" +#include "c1/c1_ValueSet.hpp" +#include "memory/allocation.hpp" + class ValueMapEntry: public CompilationResourceObj { private: intx _hash; @@ -226,3 +233,5 @@ class GlobalValueNumbering: public ValueNumberingVisitor { // main entry point that performs global value numbering GlobalValueNumbering(IR* ir); }; + +#endif // SHARE_VM_C1_C1_VALUEMAP_HPP diff --git a/hotspot/src/share/vm/c1/c1_ValueSet.cpp b/hotspot/src/share/vm/c1/c1_ValueSet.cpp index 7309601645e..6cb1c31d0a7 100644 --- a/hotspot/src/share/vm/c1/c1_ValueSet.cpp +++ b/hotspot/src/share/vm/c1/c1_ValueSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +22,6 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_ValueSet.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_ValueSet.hpp" + diff --git a/hotspot/src/share/vm/c1/c1_ValueSet.hpp b/hotspot/src/share/vm/c1/c1_ValueSet.hpp index 48f27fa655c..2e8dd095d11 100644 --- a/hotspot/src/share/vm/c1/c1_ValueSet.hpp +++ b/hotspot/src/share/vm/c1/c1_ValueSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_C1_C1_VALUESET_HPP +#define SHARE_VM_C1_C1_VALUESET_HPP + +#include "c1/c1_Instruction.hpp" +#include "memory/allocation.hpp" +#include "utilities/bitMap.inline.hpp" + // A ValueSet is a simple abstraction on top of a BitMap representing // a set of Instructions. Currently it assumes that the number of // instructions is fixed during its lifetime; should make it @@ -93,3 +100,5 @@ inline void ValueSet::set_from(ValueSet* other) { inline bool ValueSet::equals(ValueSet* other) { return _map.is_same(other->_map); } + +#endif // SHARE_VM_C1_C1_VALUESET_HPP diff --git a/hotspot/src/share/vm/c1/c1_ValueStack.cpp b/hotspot/src/share/vm/c1/c1_ValueStack.cpp index 261176507b3..1ffad1de836 100644 --- a/hotspot/src/share/vm/c1/c1_ValueStack.cpp +++ b/hotspot/src/share/vm/c1/c1_ValueStack.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,61 +22,68 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_c1_ValueStack.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_IR.hpp" +#include "c1/c1_InstructionPrinter.hpp" +#include "c1/c1_ValueStack.hpp" // Implementation of ValueStack -ValueStack::ValueStack(IRScope* scope, int locals_size, int max_stack_size) +ValueStack::ValueStack(IRScope* scope, ValueStack* caller_state) : _scope(scope) -, _locals(locals_size, NULL) -, _stack(max_stack_size) -, _lock_stack(false) -, _locks(1) +, _caller_state(caller_state) +, _bci(-99) +, _kind(Parsing) +, _locals(scope->method()->max_locals(), NULL) +, _stack(scope->method()->max_stack()) +, _locks() { - assert(scope != NULL, "scope must exist"); -} - -ValueStack* ValueStack::copy() { - ValueStack* s = new ValueStack(scope(), locals_size(), max_stack_size()); - s->_stack.appendAll(&_stack); - s->_locks.appendAll(&_locks); - s->replace_locals(this); - return s; + verify(); } -ValueStack* ValueStack::copy_locks() { - int sz = scope()->lock_stack_size(); - if (stack_size() == 0) { - sz = 0; +ValueStack::ValueStack(ValueStack* copy_from, Kind kind, int bci) + : _scope(copy_from->scope()) + , _caller_state(copy_from->caller_state()) + , _bci(bci) + , _kind(kind) + , _locals() + , _stack() + , _locks(copy_from->locks_size()) +{ + assert(kind != EmptyExceptionState || !Compilation::current()->env()->jvmti_can_access_local_variables(), "need locals"); + if (kind != EmptyExceptionState) { + // only allocate space if we need to copy the locals-array + _locals = Values(copy_from->locals_size()); + _locals.appendAll(©_from->_locals); } - ValueStack* s = new ValueStack(scope(), locals_size(), sz); - s->_lock_stack = true; - s->_locks.appendAll(&_locks); - s->replace_locals(this); - if (sz > 0) { - assert(sz <= stack_size(), "lock stack underflow"); - for (int i = 0; i < sz; i++) { - s->_stack.append(_stack[i]); + + if (kind != ExceptionState && kind != EmptyExceptionState) { + if (kind == Parsing) { + // stack will be modified, so reserve enough space to avoid resizing + _stack = Values(scope()->method()->max_stack()); + } else { + // stack will not be modified, so do not waste space + _stack = Values(copy_from->stack_size()); } + _stack.appendAll(©_from->_stack); } - return s; + + _locks.appendAll(©_from->_locks); + + verify(); } + bool ValueStack::is_same(ValueStack* s) { - assert(s != NULL, "state must exist"); - assert(scope () == s->scope (), "scopes must correspond"); - assert(locals_size() == s->locals_size(), "locals sizes must correspond"); - return is_same_across_scopes(s); -} + if (scope() != s->scope()) return false; + if (caller_state() != s->caller_state()) return false; + if (locals_size() != s->locals_size()) return false; + if (stack_size() != s->stack_size()) return false; + if (locks_size() != s->locks_size()) return false; -bool ValueStack::is_same_across_scopes(ValueStack* s) { - assert(s != NULL, "state must exist"); - assert(stack_size () == s->stack_size (), "stack sizes must correspond"); - assert(locks_size () == s->locks_size (), "locks sizes must correspond"); // compare each stack element with the corresponding stack element of s int index; Value value; @@ -89,12 +96,6 @@ bool ValueStack::is_same_across_scopes(ValueStack* s) { return true; } - -ValueStack* ValueStack::caller_state() const { - return scope()->caller_state(); -} - - void ValueStack::clear_locals() { for (int i = _locals.length() - 1; i >= 0; i--) { _locals.at_put(i, NULL); @@ -102,13 +103,6 @@ void ValueStack::clear_locals() { } -void ValueStack::replace_locals(ValueStack* with) { - assert(locals_size() == with->locals_size(), "number of locals must match"); - for (int i = locals_size() - 1; i >= 0; i--) { - _locals.at_put(i, with->_locals.at(i)); - } -} - void ValueStack::pin_stack_for_linear_scan() { for_each_state_value(this, v, if (v->as_Constant() == NULL && v->as_Local() == NULL) { @@ -123,33 +117,25 @@ void ValueStack::apply(Values list, ValueVisitor* f) { for (int i = 0; i < list.length(); i++) { Value* va = list.adr_at(i); Value v0 = *va; - if (v0 != NULL) { - if (!v0->type()->is_illegal()) { - assert(v0->as_HiWord() == NULL, "should never see HiWord during traversal"); - f->visit(va); + if (v0 != NULL && !v0->type()->is_illegal()) { + f->visit(va); #ifdef ASSERT - Value v1 = *va; - if (v0 != v1) { - assert(v1->type()->is_illegal() || v0->type()->tag() == v1->type()->tag(), "types must match"); - if (v0->type()->is_double_word()) { - list.at_put(i + 1, v0->hi_word()); - } - } + Value v1 = *va; + assert(v1->type()->is_illegal() || v0->type()->tag() == v1->type()->tag(), "types must match"); + assert(!v1->type()->is_double_word() || list.at(i + 1) == NULL, "hi-word of doubleword value must be NULL"); #endif - if (v0->type()->is_double_word()) i++; - } + if (v0->type()->is_double_word()) i++; } } } void ValueStack::values_do(ValueVisitor* f) { - apply(_stack, f); - apply(_locks, f); - ValueStack* state = this; for_each_state(state) { apply(state->_locals, f); + apply(state->_stack, f); + apply(state->_locks, f); } } @@ -164,52 +150,26 @@ Values* ValueStack::pop_arguments(int argument_size) { } -int ValueStack::lock(IRScope* scope, Value obj) { +int ValueStack::total_locks_size() const { + int num_locks = 0; + const ValueStack* state = this; + for_each_state(state) { + num_locks += state->locks_size(); + } + return num_locks; +} + +int ValueStack::lock(Value obj) { _locks.push(obj); - scope->set_min_number_of_locks(locks_size()); - return locks_size() - 1; + int num_locks = total_locks_size(); + scope()->set_min_number_of_locks(num_locks); + return num_locks - 1; } int ValueStack::unlock() { _locks.pop(); - return locks_size(); -} - - -ValueStack* ValueStack::push_scope(IRScope* scope) { - assert(scope->caller() == _scope, "scopes must have caller/callee relationship"); - ValueStack* res = new ValueStack(scope, - scope->method()->max_locals(), - max_stack_size() + scope->method()->max_stack()); - // Preserves stack and monitors. - res->_stack.appendAll(&_stack); - res->_locks.appendAll(&_locks); - assert(res->_stack.size() <= res->max_stack_size(), "stack overflow"); - return res; -} - - -ValueStack* ValueStack::pop_scope() { - assert(_scope->caller() != NULL, "scope must have caller"); - IRScope* scope = _scope->caller(); - int max_stack = max_stack_size() - _scope->method()->max_stack(); - assert(max_stack >= 0, "stack underflow"); - ValueStack* res = new ValueStack(scope, - scope->method()->max_locals(), - max_stack); - // Preserves stack and monitors. Restores local and store state from caller scope. - res->_stack.appendAll(&_stack); - res->_locks.appendAll(&_locks); - ValueStack* caller = caller_state(); - if (caller != NULL) { - for (int i = 0; i < caller->_locals.length(); i++) { - res->_locals.at_put(i, caller->_locals.at(i)); - } - assert(res->_locals.length() == res->scope()->method()->max_locals(), "just checking"); - } - assert(res->_stack.size() <= res->max_stack_size(), "stack overflow"); - return res; + return total_locks_size(); } @@ -220,11 +180,7 @@ void ValueStack::setup_phi_for_stack(BlockBegin* b, int index) { Value phi = new Phi(t, b, -index - 1); _stack[index] = phi; -#ifdef ASSERT - if (t->is_double_word()) { - _stack[index + 1] = phi->hi_word(); - } -#endif + assert(!t->is_double_word() || _stack.at(index + 1) == NULL, "hi-word of doubleword value must be NULL"); } void ValueStack::setup_phi_for_local(BlockBegin* b, int index) { @@ -236,7 +192,9 @@ void ValueStack::setup_phi_for_local(BlockBegin* b, int index) { } #ifndef PRODUCT + void ValueStack::print() { + scope()->method()->print_name(); if (stack_is_empty()) { tty->print_cr("empty stack"); } else { @@ -244,18 +202,20 @@ void ValueStack::print() { for (int i = 0; i < stack_size();) { Value t = stack_at_inc(i); tty->print("%2d ", i); + tty->print("%c%d ", t->type()->tchar(), t->id()); ip.print_instr(t); tty->cr(); } } if (!no_active_locks()) { InstructionPrinter ip; - for (int i = 0; i < locks_size(); i--) { + for (int i = 0; i < locks_size(); i++) { Value t = lock_at(i); tty->print("lock %2d ", i); if (t == NULL) { tty->print("this"); } else { + tty->print("%c%d ", t->type()->tchar(), t->id()); ip.print_instr(t); } tty->cr(); @@ -270,16 +230,55 @@ void ValueStack::print() { tty->print("null"); i ++; } else { + tty->print("%c%d ", l->type()->tchar(), l->id()); ip.print_instr(l); if (l->type()->is_illegal() || l->type()->is_single_word()) i ++; else i += 2; } tty->cr(); } } + + if (caller_state() != NULL) { + caller_state()->print(); + } } void ValueStack::verify() { - Unimplemented(); + assert(scope() != NULL, "scope must exist"); + if (caller_state() != NULL) { + assert(caller_state()->scope() == scope()->caller(), "invalid caller scope"); + caller_state()->verify(); + } + + if (kind() == Parsing) { + assert(bci() == -99, "bci not defined during parsing"); + } else { + assert(bci() >= -1, "bci out of range"); + assert(bci() < scope()->method()->code_size(), "bci out of range"); + assert(bci() == SynchronizationEntryBCI || Bytecodes::is_defined(scope()->method()->java_code_at_bci(bci())), "make sure bci points at a real bytecode"); + assert(scope()->method()->liveness_at_bci(bci()).is_valid(), "liveness at bci must be valid"); + } + + int i; + for (i = 0; i < stack_size(); i++) { + Value v = _stack.at(i); + if (v == NULL) { + assert(_stack.at(i - 1)->type()->is_double_word(), "only hi-words are NULL on stack"); + } else if (v->type()->is_double_word()) { + assert(_stack.at(i + 1) == NULL, "hi-word must be NULL"); + } + } + + for (i = 0; i < locals_size(); i++) { + Value v = _locals.at(i); + if (v != NULL && v->type()->is_double_word()) { + assert(_locals.at(i + 1) == NULL, "hi-word must be NULL"); + } + } + + for_each_state_value(this, v, + assert(v != NULL, "just test if state-iteration succeeds"); + ); } #endif // PRODUCT diff --git a/hotspot/src/share/vm/c1/c1_ValueStack.hpp b/hotspot/src/share/vm/c1/c1_ValueStack.hpp index 9e254bf0dcd..a775eba7e20 100644 --- a/hotspot/src/share/vm/c1/c1_ValueStack.hpp +++ b/hotspot/src/share/vm/c1/c1_ValueStack.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,29 @@ * */ +#ifndef SHARE_VM_C1_C1_VALUESTACK_HPP +#define SHARE_VM_C1_C1_VALUESTACK_HPP + +#include "c1/c1_Instruction.hpp" + class ValueStack: public CompilationResourceObj { + public: + enum Kind { + Parsing, // During abstract interpretation in GraphBuilder + CallerState, // Caller state when inlining + StateBefore, // Before before execution of instruction + StateAfter, // After execution of instruction + ExceptionState, // Exception handling of instruction + EmptyExceptionState, // Exception handling of instructions not covered by an xhandler + BlockBeginState // State of BlockBegin instruction with phi functions of this block + }; + private: IRScope* _scope; // the enclosing scope - bool _lock_stack; // indicates that this ValueStack is for an exception site + ValueStack* _caller_state; + int _bci; + Kind _kind; + Values _locals; // the locals Values _stack; // the expression stack Values _locks; // the monitor stack (holding the locked values) @@ -36,100 +55,84 @@ class ValueStack: public CompilationResourceObj { } Value check(ValueTag tag, Value t, Value h) { - assert(h->as_HiWord()->lo_word() == t, "incorrect stack pair"); + assert(h == NULL, "hi-word of doubleword value must be NULL"); return check(tag, t); } // helper routine static void apply(Values list, ValueVisitor* f); + // for simplified copying + ValueStack(ValueStack* copy_from, Kind kind, int bci); + public: // creation - ValueStack(IRScope* scope, int locals_size, int max_stack_size); + ValueStack(IRScope* scope, ValueStack* caller_state); + + ValueStack* copy() { return new ValueStack(this, _kind, _bci); } + ValueStack* copy(Kind new_kind, int new_bci) { return new ValueStack(this, new_kind, new_bci); } + ValueStack* copy_for_parsing() { return new ValueStack(this, Parsing, -99); } + + void set_caller_state(ValueStack* s) { + assert(kind() == EmptyExceptionState || + (Compilation::current()->env()->jvmti_can_access_local_variables() && kind() == ExceptionState), + "only EmptyExceptionStates can be modified"); + _caller_state = s; + } - // merging - ValueStack* copy(); // returns a copy of this w/ cleared locals - ValueStack* copy_locks(); // returns a copy of this w/ cleared locals and stack - // Note that when inlining of methods with exception - // handlers is enabled, this stack may have a - // non-empty expression stack (size defined by - // scope()->lock_stack_size()) bool is_same(ValueStack* s); // returns true if this & s's types match (w/o checking locals) - bool is_same_across_scopes(ValueStack* s); // same as is_same but returns true even if stacks are in different scopes (used for block merging w/inlining) // accessors IRScope* scope() const { return _scope; } - bool is_lock_stack() const { return _lock_stack; } + ValueStack* caller_state() const { return _caller_state; } + int bci() const { return _bci; } + Kind kind() const { return _kind; } + int locals_size() const { return _locals.length(); } int stack_size() const { return _stack.length(); } int locks_size() const { return _locks.length(); } - int max_stack_size() const { return _stack.capacity(); } bool stack_is_empty() const { return _stack.is_empty(); } bool no_active_locks() const { return _locks.is_empty(); } - ValueStack* caller_state() const; + int total_locks_size() const; // locals access void clear_locals(); // sets all locals to NULL; - // Kill local i. Also kill local i+1 if i was a long or double. void invalidate_local(int i) { - Value x = _locals.at(i); - if (x != NULL && x->type()->is_double_word()) { - assert(_locals.at(i + 1)->as_HiWord()->lo_word() == x, "locals inconsistent"); - _locals.at_put(i + 1, NULL); - } + assert(_locals.at(i)->type()->is_single_word() || + _locals.at(i + 1) == NULL, "hi-word of doubleword value must be NULL"); _locals.at_put(i, NULL); } - - Value load_local(int i) const { + Value local_at(int i) const { Value x = _locals.at(i); - if (x != NULL && x->type()->is_illegal()) return NULL; - assert(x == NULL || x->as_HiWord() == NULL, "index points to hi word"); - assert(x == NULL || x->type()->is_illegal() || x->type()->is_single_word() || x == _locals.at(i+1)->as_HiWord()->lo_word(), "locals inconsistent"); + assert(x == NULL || x->type()->is_single_word() || + _locals.at(i + 1) == NULL, "hi-word of doubleword value must be NULL"); return x; } - Value local_at(int i) const { return _locals.at(i); } - - // Store x into local i. void store_local(int i, Value x) { - // Kill the old value - invalidate_local(i); - _locals.at_put(i, x); - - // Writing a double word can kill other locals - if (x != NULL && x->type()->is_double_word()) { - // If x + i was the start of a double word local then kill i + 2. - Value x2 = _locals.at(i + 1); - if (x2 != NULL && x2->type()->is_double_word()) { - _locals.at_put(i + 2, NULL); - } - - // If x is a double word local, also update i + 1. -#ifdef ASSERT - _locals.at_put(i + 1, x->hi_word()); -#else - _locals.at_put(i + 1, NULL); -#endif - } - // If x - 1 was the start of a double word local then kill i - 1. + // When overwriting local i, check if i - 1 was the start of a + // double word local and kill it. if (i > 0) { Value prev = _locals.at(i - 1); if (prev != NULL && prev->type()->is_double_word()) { _locals.at_put(i - 1, NULL); } } - } - void replace_locals(ValueStack* with); + _locals.at_put(i, x); + if (x->type()->is_double_word()) { + // hi-word of doubleword value is always NULL + _locals.at_put(i + 1, NULL); + } + } // stack access Value stack_at(int i) const { Value x = _stack.at(i); - assert(x->as_HiWord() == NULL, "index points to hi word"); assert(x->type()->is_single_word() || - x->subst() == _stack.at(i+1)->as_HiWord()->lo_word(), "stack inconsistent"); + _stack.at(i + 1) == NULL, "hi-word of doubleword value must be NULL"); return x; } @@ -146,7 +149,6 @@ class ValueStack: public CompilationResourceObj { void values_do(ValueVisitor* f); // untyped manipulation (for dup_x1, etc.) - void clear_stack() { _stack.clear(); } void truncate_stack(int size) { _stack.trunc_to(size); } void raw_push(Value t) { _stack.push(t); } Value raw_pop() { return _stack.pop(); } @@ -156,15 +158,8 @@ class ValueStack: public CompilationResourceObj { void fpush(Value t) { _stack.push(check(floatTag , t)); } void apush(Value t) { _stack.push(check(objectTag , t)); } void rpush(Value t) { _stack.push(check(addressTag, t)); } -#ifdef ASSERT - // in debug mode, use HiWord for 2-word values - void lpush(Value t) { _stack.push(check(longTag , t)); _stack.push(new HiWord(t)); } - void dpush(Value t) { _stack.push(check(doubleTag , t)); _stack.push(new HiWord(t)); } -#else - // in optimized mode, use NULL for 2-word values void lpush(Value t) { _stack.push(check(longTag , t)); _stack.push(NULL); } void dpush(Value t) { _stack.push(check(doubleTag , t)); _stack.push(NULL); } -#endif // ASSERT void push(ValueType* type, Value t) { switch (type->tag()) { @@ -182,15 +177,8 @@ class ValueStack: public CompilationResourceObj { Value fpop() { return check(floatTag , _stack.pop()); } Value apop() { return check(objectTag , _stack.pop()); } Value rpop() { return check(addressTag, _stack.pop()); } -#ifdef ASSERT - // in debug mode, check for HiWord consistency Value lpop() { Value h = _stack.pop(); return check(longTag , _stack.pop(), h); } Value dpop() { Value h = _stack.pop(); return check(doubleTag, _stack.pop(), h); } -#else - // in optimized mode, ignore HiWord since it is NULL - Value lpop() { _stack.pop(); return check(longTag , _stack.pop()); } - Value dpop() { _stack.pop(); return check(doubleTag, _stack.pop()); } -#endif // ASSERT Value pop(ValueType* type) { switch (type->tag()) { @@ -208,16 +196,10 @@ class ValueStack: public CompilationResourceObj { Values* pop_arguments(int argument_size); // locks access - int lock (IRScope* scope, Value obj); + int lock (Value obj); int unlock(); Value lock_at(int i) const { return _locks.at(i); } - // Inlining support - ValueStack* push_scope(IRScope* scope); // "Push" new scope, returning new resulting stack - // Preserves stack and locks, destroys locals - ValueStack* pop_scope(); // "Pop" topmost scope, returning new resulting stack - // Preserves stack and locks, destroys locals - // SSA form IR support void setup_phi_for_stack(BlockBegin* b, int index); void setup_phi_for_local(BlockBegin* b, int index); @@ -298,16 +280,18 @@ class ValueStack: public CompilationResourceObj { { \ int cur_index; \ ValueStack* cur_state = v_state; \ - Value v_value; \ - { \ - for_each_stack_value(cur_state, cur_index, v_value) { \ - v_code; \ - } \ - } \ + Value v_value; \ for_each_state(cur_state) { \ - for_each_local_value(cur_state, cur_index, v_value) { \ - v_code; \ + { \ + for_each_local_value(cur_state, cur_index, v_value) { \ + v_code; \ + } \ } \ + { \ + for_each_stack_value(cur_state, cur_index, v_value) { \ + v_code; \ + } \ + } \ } \ } @@ -343,3 +327,5 @@ class ValueStack: public CompilationResourceObj { } \ } \ } + +#endif // SHARE_VM_C1_C1_VALUESTACK_HPP diff --git a/hotspot/src/share/vm/c1/c1_ValueType.cpp b/hotspot/src/share/vm/c1/c1_ValueType.cpp index 24a2083d07c..c0c2ca6631d 100644 --- a/hotspot/src/share/vm/c1/c1_ValueType.cpp +++ b/hotspot/src/share/vm/c1/c1_ValueType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_ValueType.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_ValueType.hpp" +#include "ci/ciArray.hpp" +#include "ci/ciInstance.hpp" +#include "ci/ciNullObject.hpp" // predefined types diff --git a/hotspot/src/share/vm/c1/c1_ValueType.hpp b/hotspot/src/share/vm/c1/c1_ValueType.hpp index 3098114cf95..d82eae607d3 100644 --- a/hotspot/src/share/vm/c1/c1_ValueType.hpp +++ b/hotspot/src/share/vm/c1/c1_ValueType.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_C1_C1_VALUETYPE_HPP +#define SHARE_VM_C1_C1_VALUETYPE_HPP + +#include "c1/c1_Compilation.hpp" +#include "ci/ciConstant.hpp" + // type hierarchy class ValueType; class VoidType; @@ -419,3 +425,5 @@ ValueType* as_ValueType(ciConstant value); BasicType as_BasicType(ValueType* type); inline ValueType* as_ValueType(ciType* type) { return as_ValueType(type->basic_type()); } + +#endif // SHARE_VM_C1_C1_VALUETYPE_HPP diff --git a/hotspot/src/share/vm/c1/c1_globals.cpp b/hotspot/src/share/vm/c1/c1_globals.cpp index 20b5746984e..a611f033ee6 100644 --- a/hotspot/src/share/vm/c1/c1_globals.cpp +++ b/hotspot/src/share/vm/c1/c1_globals.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_c1_globals.cpp.incl" +#include "precompiled.hpp" +#include "c1/c1_globals.hpp" C1_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, MATERIALIZE_NOTPRODUCT_FLAG) diff --git a/hotspot/src/share/vm/c1/c1_globals.hpp b/hotspot/src/share/vm/c1/c1_globals.hpp index 25633a63832..9b4db1c0f9f 100644 --- a/hotspot/src/share/vm/c1/c1_globals.hpp +++ b/hotspot/src/share/vm/c1/c1_globals.hpp @@ -22,6 +22,26 @@ * */ +#ifndef SHARE_VM_C1_C1_GLOBALS_HPP +#define SHARE_VM_C1_C1_GLOBALS_HPP + +#include "runtime/globals.hpp" +#ifdef TARGET_ARCH_x86 +# include "c1_globals_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "c1_globals_sparc.hpp" +#endif +#ifdef TARGET_OS_FAMILY_linux +# include "c1_globals_linux.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "c1_globals_solaris.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "c1_globals_windows.hpp" +#endif + // // Defines all global flags used by the client compiler. // @@ -75,6 +95,9 @@ develop(bool, SelectivePhiFunctions, true, \ "create phi functions at loop headers only when necessary") \ \ + develop(bool, OptimizeIfOps, true, \ + "Optimize multiple IfOps") \ + \ develop(bool, DoCEE, true, \ "Do Conditional Expression Elimination to simplify CFG") \ \ @@ -216,9 +239,6 @@ develop(bool, DeoptC1, true, \ "Use deoptimization in C1") \ \ - develop(bool, DeoptOnAsyncException, true, \ - "Deoptimize upon Thread.stop(); improves precision of IR") \ - \ develop(bool, PrintBailouts, false, \ "Print bailout and its reason") \ \ @@ -303,6 +323,7 @@ // Read default values for c1 globals -// #include "incls/_c1_globals_pd.hpp.incl" C1_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_NOTPRODUCT_FLAG) + +#endif // SHARE_VM_C1_C1_GLOBALS_HPP diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp index 143101dae68..acf3bfaad4c 100644 --- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp +++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +22,15 @@ * */ +#include "precompiled.hpp" +#include "ci/bcEscapeAnalyzer.hpp" +#include "ci/ciConstant.hpp" +#include "ci/ciField.hpp" +#include "ci/ciMethodBlocks.hpp" +#include "ci/ciStreams.hpp" +#include "interpreter/bytecode.hpp" +#include "utilities/bitMap.inline.hpp" -#include "incls/_precompiled.incl" -#include "incls/_bcEscapeAnalyzer.cpp.incl" #ifndef PRODUCT diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp index 5e61112c7ab..a16213d4260 100644 --- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp +++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,18 @@ * */ +#ifndef SHARE_VM_CI_BCESCAPEANALYZER_HPP +#define SHARE_VM_CI_BCESCAPEANALYZER_HPP + +#ifdef COMPILER2 +#include "ci/ciMethod.hpp" +#include "ci/ciMethodData.hpp" +#include "code/dependencies.hpp" +#include "libadt/vectset.hpp" +#include "memory/allocation.hpp" +#include "utilities/growableArray.hpp" +#endif + // This class implements a fast, conservative analysis of effect of methods // on the escape state of their arguments. The analysis is at the bytecode // level. @@ -147,3 +159,5 @@ class BCEscapeAnalyzer : public ResourceObj { void dump(); #endif }; + +#endif // SHARE_VM_CI_BCESCAPEANALYZER_HPP diff --git a/hotspot/src/share/vm/ci/ciArray.cpp b/hotspot/src/share/vm/ci/ciArray.cpp index 76ada073c42..584b1aeb50f 100644 --- a/hotspot/src/share/vm/ci/ciArray.cpp +++ b/hotspot/src/share/vm/ci/ciArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciArray.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciArray.hpp" +#include "ci/ciKlass.hpp" +#include "ci/ciUtilities.hpp" // ciArray // diff --git a/hotspot/src/share/vm/ci/ciArray.hpp b/hotspot/src/share/vm/ci/ciArray.hpp index afa582817b0..440e407a510 100644 --- a/hotspot/src/share/vm/ci/ciArray.hpp +++ b/hotspot/src/share/vm/ci/ciArray.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_CI_CIARRAY_HPP +#define SHARE_VM_CI_CIARRAY_HPP + +#include "ci/ciObject.hpp" +#include "oops/arrayOop.hpp" +#include "oops/objArrayOop.hpp" +#include "oops/typeArrayOop.hpp" + // ciArray // // This class represents an arrayOop in the HotSpot virtual @@ -50,3 +58,5 @@ public: bool is_array() { return true; } bool is_java_object() { return true; } }; + +#endif // SHARE_VM_CI_CIARRAY_HPP diff --git a/hotspot/src/share/vm/ci/ciArrayKlass.cpp b/hotspot/src/share/vm/ci/ciArrayKlass.cpp index 15a2a290259..ef2c7a47354 100644 --- a/hotspot/src/share/vm/ci/ciArrayKlass.cpp +++ b/hotspot/src/share/vm/ci/ciArrayKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciArrayKlass.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciArrayKlass.hpp" +#include "ci/ciObjArrayKlass.hpp" +#include "ci/ciTypeArrayKlass.hpp" +#include "ci/ciUtilities.hpp" // ciArrayKlass // diff --git a/hotspot/src/share/vm/ci/ciArrayKlass.hpp b/hotspot/src/share/vm/ci/ciArrayKlass.hpp index 5f9478517a4..98b005156a5 100644 --- a/hotspot/src/share/vm/ci/ciArrayKlass.hpp +++ b/hotspot/src/share/vm/ci/ciArrayKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_CI_CIARRAYKLASS_HPP +#define SHARE_VM_CI_CIARRAYKLASS_HPP + +#include "ci/ciKlass.hpp" + // ciArrayKlass // // This class, and its subclasses represent klassOops in the @@ -57,3 +62,5 @@ public: static ciArrayKlass* make(ciType* element_type); }; + +#endif // SHARE_VM_CI_CIARRAYKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciArrayKlassKlass.hpp b/hotspot/src/share/vm/ci/ciArrayKlassKlass.hpp index 0e5ffb94501..1c5c73408a8 100644 --- a/hotspot/src/share/vm/ci/ciArrayKlassKlass.hpp +++ b/hotspot/src/share/vm/ci/ciArrayKlassKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_CI_CIARRAYKLASSKLASS_HPP +#define SHARE_VM_CI_CIARRAYKLASSKLASS_HPP + +#include "ci/ciKlassKlass.hpp" + // ciArrayKlassKlass // // This class represents a klassOop in the HotSpot virtual machine @@ -41,3 +46,5 @@ public: // What kind of ciObject is this? bool is_array_klass_klass() { return true; } }; + +#endif // SHARE_VM_CI_CIARRAYKLASSKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciCPCache.cpp b/hotspot/src/share/vm/ci/ciCPCache.cpp index 84357432012..0396c2a8784 100644 --- a/hotspot/src/share/vm/ci/ciCPCache.cpp +++ b/hotspot/src/share/vm/ci/ciCPCache.cpp @@ -22,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciCPCache.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciCPCache.hpp" +#include "ci/ciUtilities.hpp" +#include "oops/cpCacheOop.hpp" // ciCPCache diff --git a/hotspot/src/share/vm/ci/ciCPCache.hpp b/hotspot/src/share/vm/ci/ciCPCache.hpp index 89579ae482d..165ce3de637 100644 --- a/hotspot/src/share/vm/ci/ciCPCache.hpp +++ b/hotspot/src/share/vm/ci/ciCPCache.hpp @@ -22,6 +22,13 @@ * */ +#ifndef SHARE_VM_CI_CICPCACHE_HPP +#define SHARE_VM_CI_CICPCACHE_HPP + +#include "ci/ciClassList.hpp" +#include "ci/ciObject.hpp" +#include "oops/cpCacheOop.hpp" + // ciCPCache // // This class represents a constant pool cache. @@ -57,3 +64,5 @@ public: void print(); }; + +#endif // SHARE_VM_CI_CICPCACHE_HPP diff --git a/hotspot/src/share/vm/ci/ciCallProfile.hpp b/hotspot/src/share/vm/ci/ciCallProfile.hpp index 613da7e06f2..f9d10ed16b5 100644 --- a/hotspot/src/share/vm/ci/ciCallProfile.hpp +++ b/hotspot/src/share/vm/ci/ciCallProfile.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CI_CICALLPROFILE_HPP +#define SHARE_VM_CI_CICALLPROFILE_HPP + +#include "ci/ciClassList.hpp" +#include "memory/allocation.hpp" + // ciCallProfile // // This class is used to determine the frequently called method @@ -73,3 +79,5 @@ public: return _receiver[i]; } }; + +#endif // SHARE_VM_CI_CICALLPROFILE_HPP diff --git a/hotspot/src/share/vm/ci/ciCallSite.cpp b/hotspot/src/share/vm/ci/ciCallSite.cpp index f7755b0124d..849d8d58563 100644 --- a/hotspot/src/share/vm/ci/ciCallSite.cpp +++ b/hotspot/src/share/vm/ci/ciCallSite.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciCallSite.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciCallSite.hpp" +#include "ci/ciUtilities.hpp" // ciCallSite diff --git a/hotspot/src/share/vm/ci/ciCallSite.hpp b/hotspot/src/share/vm/ci/ciCallSite.hpp index 27c40c1a942..6a92e686120 100644 --- a/hotspot/src/share/vm/ci/ciCallSite.hpp +++ b/hotspot/src/share/vm/ci/ciCallSite.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_CI_CICALLSITE_HPP +#define SHARE_VM_CI_CICALLSITE_HPP + +#include "ci/ciInstance.hpp" + // ciCallSite // // The class represents a java.dyn.CallSite object. @@ -37,3 +42,5 @@ public: void print(); }; + +#endif // SHARE_VM_CI_CICALLSITE_HPP diff --git a/hotspot/src/share/vm/ci/ciClassList.hpp b/hotspot/src/share/vm/ci/ciClassList.hpp index 0354968c6a9..d9c3f75b2ba 100644 --- a/hotspot/src/share/vm/ci/ciClassList.hpp +++ b/hotspot/src/share/vm/ci/ciClassList.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_CI_CICLASSLIST_HPP +#define SHARE_VM_CI_CICLASSLIST_HPP + class ciEnv; class ciObjectFactory; class ciConstantPoolCache; @@ -118,3 +121,5 @@ friend class ciInstanceKlassKlass; \ friend class ciArrayKlassKlass; \ friend class ciObjArrayKlassKlass; \ friend class ciTypeArrayKlassKlass; + +#endif // SHARE_VM_CI_CICLASSLIST_HPP diff --git a/hotspot/src/share/vm/ci/ciConstant.cpp b/hotspot/src/share/vm/ci/ciConstant.cpp index 3b828b75ff2..4955a088ffa 100644 --- a/hotspot/src/share/vm/ci/ciConstant.cpp +++ b/hotspot/src/share/vm/ci/ciConstant.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciConstant.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciConstant.hpp" +#include "ci/ciUtilities.hpp" +#include "memory/allocation.hpp" +#include "memory/allocation.inline.hpp" // ciConstant // diff --git a/hotspot/src/share/vm/ci/ciConstant.hpp b/hotspot/src/share/vm/ci/ciConstant.hpp index 1bc22badcd2..f217faa24b0 100644 --- a/hotspot/src/share/vm/ci/ciConstant.hpp +++ b/hotspot/src/share/vm/ci/ciConstant.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CI_CICONSTANT_HPP +#define SHARE_VM_CI_CICONSTANT_HPP + +#include "ci/ciClassList.hpp" +#include "ci/ciNullObject.hpp" + // ciConstant // // This class represents a constant value. @@ -110,3 +116,5 @@ public: // Debugging output void print(); }; + +#endif // SHARE_VM_CI_CICONSTANT_HPP diff --git a/hotspot/src/share/vm/ci/ciConstantPoolCache.cpp b/hotspot/src/share/vm/ci/ciConstantPoolCache.cpp index f179bfa0c84..a277e421a32 100644 --- a/hotspot/src/share/vm/ci/ciConstantPoolCache.cpp +++ b/hotspot/src/share/vm/ci/ciConstantPoolCache.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciConstantPoolCache.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciConstantPoolCache.hpp" +#include "ci/ciUtilities.hpp" +#include "memory/allocation.hpp" +#include "memory/allocation.inline.hpp" // ciConstantPoolCache // diff --git a/hotspot/src/share/vm/ci/ciConstantPoolCache.hpp b/hotspot/src/share/vm/ci/ciConstantPoolCache.hpp index ed4e4f155ef..baa33eb1fe8 100644 --- a/hotspot/src/share/vm/ci/ciConstantPoolCache.hpp +++ b/hotspot/src/share/vm/ci/ciConstantPoolCache.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CI_CICONSTANTPOOLCACHE_HPP +#define SHARE_VM_CI_CICONSTANTPOOLCACHE_HPP + +#include "memory/resourceArea.hpp" +#include "utilities/growableArray.hpp" + // ciConstantPoolCache // // The class caches indexed constant pool lookups. @@ -45,3 +51,5 @@ public: void print(); }; + +#endif // SHARE_VM_CI_CICONSTANTPOOLCACHE_HPP diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp index 51682101382..eab8de7670d 100644 --- a/hotspot/src/share/vm/ci/ciEnv.cpp +++ b/hotspot/src/share/vm/ci/ciEnv.cpp @@ -22,8 +22,44 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciEnv.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciConstant.hpp" +#include "ci/ciEnv.hpp" +#include "ci/ciField.hpp" +#include "ci/ciInstance.hpp" +#include "ci/ciInstanceKlass.hpp" +#include "ci/ciInstanceKlassKlass.hpp" +#include "ci/ciMethod.hpp" +#include "ci/ciNullObject.hpp" +#include "ci/ciObjArrayKlassKlass.hpp" +#include "ci/ciTypeArrayKlassKlass.hpp" +#include "ci/ciUtilities.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/scopeDesc.hpp" +#include "compiler/compileBroker.hpp" +#include "compiler/compileLog.hpp" +#include "compiler/compilerOracle.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "interpreter/linkResolver.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/oopFactory.hpp" +#include "memory/universe.inline.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.inline2.hpp" +#include "prims/jvmtiExport.hpp" +#include "runtime/init.hpp" +#include "runtime/reflection.hpp" +#include "runtime/sharedRuntime.hpp" +#include "utilities/dtrace.hpp" +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif +#ifdef COMPILER2 +#include "opto/runtime.hpp" +#endif // ciEnv // diff --git a/hotspot/src/share/vm/ci/ciEnv.hpp b/hotspot/src/share/vm/ci/ciEnv.hpp index 045dc6f60f7..98431e57a8b 100644 --- a/hotspot/src/share/vm/ci/ciEnv.hpp +++ b/hotspot/src/share/vm/ci/ciEnv.hpp @@ -22,6 +22,18 @@ * */ +#ifndef SHARE_VM_CI_CIENV_HPP +#define SHARE_VM_CI_CIENV_HPP + +#include "ci/ciClassList.hpp" +#include "ci/ciObjectFactory.hpp" +#include "classfile/systemDictionary.hpp" +#include "code/debugInfoRec.hpp" +#include "code/dependencies.hpp" +#include "code/exceptionHandlerTable.hpp" +#include "compiler/oopMap.hpp" +#include "runtime/thread.hpp" + class CompileTask; // ciEnv @@ -384,3 +396,5 @@ public: void record_method_not_compilable(const char* reason, bool all_tiers = true); void record_out_of_memory_failure(); }; + +#endif // SHARE_VM_CI_CIENV_HPP diff --git a/hotspot/src/share/vm/ci/ciExceptionHandler.cpp b/hotspot/src/share/vm/ci/ciExceptionHandler.cpp index 8e0966df7a4..16ae6a7498c 100644 --- a/hotspot/src/share/vm/ci/ciExceptionHandler.cpp +++ b/hotspot/src/share/vm/ci/ciExceptionHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciExceptionHandler.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciExceptionHandler.hpp" +#include "ci/ciUtilities.hpp" // ciExceptionHandler // diff --git a/hotspot/src/share/vm/ci/ciExceptionHandler.hpp b/hotspot/src/share/vm/ci/ciExceptionHandler.hpp index c70557322dc..aae74e7c3d7 100644 --- a/hotspot/src/share/vm/ci/ciExceptionHandler.hpp +++ b/hotspot/src/share/vm/ci/ciExceptionHandler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CI_CIEXCEPTIONHANDLER_HPP +#define SHARE_VM_CI_CIEXCEPTIONHANDLER_HPP + +#include "ci/ciClassList.hpp" +#include "ci/ciInstanceKlass.hpp" + // ciExceptionHandler // // This class represents an exception handler for a method. @@ -73,3 +79,5 @@ public: void print(); }; + +#endif // SHARE_VM_CI_CIEXCEPTIONHANDLER_HPP diff --git a/hotspot/src/share/vm/ci/ciField.cpp b/hotspot/src/share/vm/ci/ciField.cpp index 9851d9e2576..8045b423871 100644 --- a/hotspot/src/share/vm/ci/ciField.cpp +++ b/hotspot/src/share/vm/ci/ciField.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,17 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciField.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciField.hpp" +#include "ci/ciInstanceKlass.hpp" +#include "ci/ciUtilities.hpp" +#include "classfile/systemDictionary.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "interpreter/linkResolver.hpp" +#include "memory/universe.inline.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.inline2.hpp" +#include "runtime/fieldDescriptor.hpp" // ciField // diff --git a/hotspot/src/share/vm/ci/ciField.hpp b/hotspot/src/share/vm/ci/ciField.hpp index 0df81b508e4..6406ddeac86 100644 --- a/hotspot/src/share/vm/ci/ciField.hpp +++ b/hotspot/src/share/vm/ci/ciField.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_CI_CIFIELD_HPP +#define SHARE_VM_CI_CIFIELD_HPP + +#include "ci/ciClassList.hpp" +#include "ci/ciConstant.hpp" +#include "ci/ciFlags.hpp" +#include "ci/ciInstance.hpp" + // ciField // // This class represents the result of a field lookup in the VM. @@ -174,3 +182,5 @@ public: void print(); void print_name_on(outputStream* st); }; + +#endif // SHARE_VM_CI_CIFIELD_HPP diff --git a/hotspot/src/share/vm/ci/ciFlags.cpp b/hotspot/src/share/vm/ci/ciFlags.cpp index 5a313ae12a5..bbbb69e1538 100644 --- a/hotspot/src/share/vm/ci/ciFlags.cpp +++ b/hotspot/src/share/vm/ci/ciFlags.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,8 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciFlags.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciFlags.hpp" // ciFlags // diff --git a/hotspot/src/share/vm/ci/ciFlags.hpp b/hotspot/src/share/vm/ci/ciFlags.hpp index 260e4ee741c..6dc50d25a60 100644 --- a/hotspot/src/share/vm/ci/ciFlags.hpp +++ b/hotspot/src/share/vm/ci/ciFlags.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_CI_CIFLAGS_HPP +#define SHARE_VM_CI_CIFLAGS_HPP + +#include "ci/ciClassList.hpp" +#include "memory/allocation.hpp" +#include "prims/jvm.h" +#include "utilities/accessFlags.hpp" + // ciFlags // // This class represents klass or method flags. @@ -59,3 +67,5 @@ public: void print_member_flags(outputStream* st = tty); void print(outputStream* st = tty); }; + +#endif // SHARE_VM_CI_CIFLAGS_HPP diff --git a/hotspot/src/share/vm/ci/ciInstance.cpp b/hotspot/src/share/vm/ci/ciInstance.cpp index 19e757e467d..ae7b6d20e2c 100644 --- a/hotspot/src/share/vm/ci/ciInstance.cpp +++ b/hotspot/src/share/vm/ci/ciInstance.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,14 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciInstance.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciConstant.hpp" +#include "ci/ciField.hpp" +#include "ci/ciInstance.hpp" +#include "ci/ciInstanceKlass.hpp" +#include "ci/ciUtilities.hpp" +#include "classfile/systemDictionary.hpp" +#include "oops/oop.inline.hpp" // ciInstance // diff --git a/hotspot/src/share/vm/ci/ciInstance.hpp b/hotspot/src/share/vm/ci/ciInstance.hpp index aed32773b27..1579402d9e6 100644 --- a/hotspot/src/share/vm/ci/ciInstance.hpp +++ b/hotspot/src/share/vm/ci/ciInstance.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CI_CIINSTANCE_HPP +#define SHARE_VM_CI_CIINSTANCE_HPP + +#include "ci/ciObject.hpp" +#include "oops/instanceOop.hpp" + // ciInstance // // This class represents an instanceOop in the HotSpot virtual @@ -59,3 +65,5 @@ public: // Constant value of a field at the specified offset. ciConstant field_value_by_offset(int field_offset); }; + +#endif // SHARE_VM_CI_CIINSTANCE_HPP diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp index cd75fd52409..8b9eeafd0d0 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp @@ -22,8 +22,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciInstanceKlass.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciField.hpp" +#include "ci/ciInstance.hpp" +#include "ci/ciInstanceKlass.hpp" +#include "ci/ciUtilities.hpp" +#include "classfile/systemDictionary.hpp" +#include "memory/allocation.hpp" +#include "memory/allocation.inline.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/fieldDescriptor.hpp" // ciInstanceKlass // @@ -471,7 +479,7 @@ int ciInstanceKlass::compute_nonstatic_fields() { ciField* field = fields->at(i); int offset = field->offset_in_bytes(); int size = (field->_type == NULL) ? heapOopSize : field->size_in_bytes(); - assert(last_offset <= offset, "no field overlap"); + assert(last_offset <= offset, err_msg("no field overlap: %d <= %d", last_offset, offset)); if (last_offset > (int)sizeof(oopDesc)) assert((offset - last_offset) < BytesPerLong, "no big holes"); // Note: Two consecutive T_BYTE fields will be separated by wordSize-1 @@ -564,7 +572,7 @@ bool ciInstanceKlass::is_leaf_type() { // This is OK, since any dependencies we decide to assert // will be checked later under the Compile_lock. ciInstanceKlass* ciInstanceKlass::implementor(int n) { - if (n > implementors_limit) { + if (n >= implementors_limit) { return NULL; } ciInstanceKlass* impl = _implementors[n]; diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp index f81ca4f481e..05ecf87a1e2 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp @@ -22,6 +22,15 @@ * */ +#ifndef SHARE_VM_CI_CIINSTANCEKLASS_HPP +#define SHARE_VM_CI_CIINSTANCEKLASS_HPP + +#include "ci/ciConstantPoolCache.hpp" +#include "ci/ciFlags.hpp" +#include "ci/ciInstanceKlassKlass.hpp" +#include "ci/ciKlass.hpp" +#include "ci/ciSymbol.hpp" + // ciInstanceKlass // // This class represents a klassOop in the HotSpot virtual machine @@ -215,3 +224,5 @@ public: bool is_instance_klass() { return true; } bool is_java_klass() { return true; } }; + +#endif // SHARE_VM_CI_CIINSTANCEKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciInstanceKlassKlass.cpp b/hotspot/src/share/vm/ci/ciInstanceKlassKlass.cpp index 8e1d1a53478..642b1bc6dbd 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlassKlass.cpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlassKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciInstanceKlassKlass.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciInstanceKlassKlass.hpp" +#include "ci/ciUtilities.hpp" // ciInstanceKlassKlass // diff --git a/hotspot/src/share/vm/ci/ciInstanceKlassKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlassKlass.hpp index 22e86cb10f5..2ca44f9273b 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlassKlass.hpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlassKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_CI_CIINSTANCEKLASSKLASS_HPP +#define SHARE_VM_CI_CIINSTANCEKLASSKLASS_HPP + +#include "ci/ciKlassKlass.hpp" + // ciInstanceKlassKlass // // This class represents a klassOop in the HotSpot virtual machine @@ -48,3 +53,5 @@ public: // Return the distinguished ciInstanceKlassKlass instance. static ciInstanceKlassKlass* make(); }; + +#endif // SHARE_VM_CI_CIINSTANCEKLASSKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciKlass.cpp b/hotspot/src/share/vm/ci/ciKlass.cpp index 85989616f1e..1adf63fd1e5 100644 --- a/hotspot/src/share/vm/ci/ciKlass.cpp +++ b/hotspot/src/share/vm/ci/ciKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciKlass.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciKlass.hpp" +#include "ci/ciSymbol.hpp" +#include "ci/ciUtilities.hpp" +#include "oops/oop.inline.hpp" // ciKlass // diff --git a/hotspot/src/share/vm/ci/ciKlass.hpp b/hotspot/src/share/vm/ci/ciKlass.hpp index 7336f299477..a32a08eb7ef 100644 --- a/hotspot/src/share/vm/ci/ciKlass.hpp +++ b/hotspot/src/share/vm/ci/ciKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CI_CIKLASS_HPP +#define SHARE_VM_CI_CIKLASS_HPP + +#include "ci/ciType.hpp" +#include "oops/klassOop.hpp" + // ciKlass // // This class and its subclasses represent klassOops in the @@ -117,3 +123,5 @@ public: void print_name_on(outputStream* st); }; + +#endif // SHARE_VM_CI_CIKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciKlassKlass.cpp b/hotspot/src/share/vm/ci/ciKlassKlass.cpp index a9d838497d5..d1f241e9ca6 100644 --- a/hotspot/src/share/vm/ci/ciKlassKlass.cpp +++ b/hotspot/src/share/vm/ci/ciKlassKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciKlassKlass.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciKlassKlass.hpp" +#include "ci/ciUtilities.hpp" // ciKlassKlass // diff --git a/hotspot/src/share/vm/ci/ciKlassKlass.hpp b/hotspot/src/share/vm/ci/ciKlassKlass.hpp index c03ee76a176..d8bf220222b 100644 --- a/hotspot/src/share/vm/ci/ciKlassKlass.hpp +++ b/hotspot/src/share/vm/ci/ciKlassKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CI_CIKLASSKLASS_HPP +#define SHARE_VM_CI_CIKLASSKLASS_HPP + +#include "ci/ciKlass.hpp" +#include "ci/ciSymbol.hpp" + // ciKlassKlass // // This class represents a klassOop in the HotSpot virtual machine @@ -49,3 +55,5 @@ public: // Return the distinguished ciKlassKlass instance. static ciKlassKlass* make(); }; + +#endif // SHARE_VM_CI_CIKLASSKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp index 5b09d03a1e5..d1d86923f41 100644 --- a/hotspot/src/share/vm/ci/ciMethod.cpp +++ b/hotspot/src/share/vm/ci/ciMethod.cpp @@ -22,8 +22,41 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciMethod.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciCallProfile.hpp" +#include "ci/ciExceptionHandler.hpp" +#include "ci/ciInstanceKlass.hpp" +#include "ci/ciMethod.hpp" +#include "ci/ciMethodBlocks.hpp" +#include "ci/ciMethodData.hpp" +#include "ci/ciMethodKlass.hpp" +#include "ci/ciStreams.hpp" +#include "ci/ciSymbol.hpp" +#include "ci/ciUtilities.hpp" +#include "classfile/systemDictionary.hpp" +#include "compiler/abstractCompiler.hpp" +#include "compiler/compilerOracle.hpp" +#include "compiler/methodLiveness.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/linkResolver.hpp" +#include "interpreter/oopMapCache.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/resourceArea.hpp" +#include "oops/generateOopMap.hpp" +#include "oops/oop.inline.hpp" +#include "prims/nativeLookup.hpp" +#include "runtime/deoptimization.hpp" +#include "utilities/bitMap.inline.hpp" +#include "utilities/xmlstream.hpp" +#ifdef COMPILER2 +#include "ci/bcEscapeAnalyzer.hpp" +#include "ci/ciTypeFlow.hpp" +#include "oops/methodOop.hpp" +#endif +#ifdef SHARK +#include "ci/ciTypeFlow.hpp" +#include "oops/methodOop.hpp" +#endif // ciMethod // @@ -735,7 +768,11 @@ int ciMethod::scale_count(int count, float prof_factor) { // Return true if the method is an instance of one of the two // signature-polymorphic MethodHandle methods, invokeExact or invokeGeneric. bool ciMethod::is_method_handle_invoke() const { - if (!is_loaded()) return false; + if (!is_loaded()) { + bool flag = (holder()->name() == ciSymbol::java_dyn_MethodHandle() && + methodOopDesc::is_method_handle_invoke_name(name()->sid())); + return flag; + } VM_ENTRY_MARK; return get_methodOop()->is_method_handle_invoke(); } @@ -760,12 +797,13 @@ ciInstance* ciMethod::method_handle_type() { // ------------------------------------------------------------------ -// ciMethod::build_method_data +// ciMethod::ensure_method_data // // Generate new methodDataOop objects at compile time. -void ciMethod::build_method_data(methodHandle h_m) { +// Return true if allocation was successful or no MDO is required. +bool ciMethod::ensure_method_data(methodHandle h_m) { EXCEPTION_CONTEXT; - if (is_native() || is_abstract() || h_m()->is_accessor()) return; + if (is_native() || is_abstract() || h_m()->is_accessor()) return true; if (h_m()->method_data() == NULL) { methodOopDesc::build_interpreter_method_data(h_m, THREAD); if (HAS_PENDING_EXCEPTION) { @@ -775,18 +813,22 @@ void ciMethod::build_method_data(methodHandle h_m) { if (h_m()->method_data() != NULL) { _method_data = CURRENT_ENV->get_object(h_m()->method_data())->as_method_data(); _method_data->load_data(); + return true; } else { _method_data = CURRENT_ENV->get_empty_methodData(); + return false; } } // public, retroactive version -void ciMethod::build_method_data() { +bool ciMethod::ensure_method_data() { + bool result = true; if (_method_data == NULL || _method_data->is_empty()) { GUARDED_VM_ENTRY({ - build_method_data(get_methodOop()); + result = ensure_method_data(get_methodOop()); }); } + return result; } @@ -802,11 +844,6 @@ ciMethodData* ciMethod::method_data() { Thread* my_thread = JavaThread::current(); methodHandle h_m(my_thread, get_methodOop()); - // Create an MDO for the inlinee - if (TieredCompilation && is_c1_compile(env->comp_level())) { - build_method_data(h_m); - } - if (h_m()->method_data() != NULL) { _method_data = CURRENT_ENV->get_object(h_m()->method_data())->as_method_data(); _method_data->load_data(); @@ -817,6 +854,15 @@ ciMethodData* ciMethod::method_data() { } +// ------------------------------------------------------------------ +// ciMethod::method_data_or_null +// Returns a pointer to ciMethodData if MDO exists on the VM side, +// NULL otherwise. +ciMethodData* ciMethod::method_data_or_null() { + ciMethodData *md = method_data(); + if (md->is_empty()) return NULL; + return md; +} // ------------------------------------------------------------------ // ciMethod::will_link @@ -975,7 +1021,7 @@ int ciMethod::instructions_size(int comp_level) { GUARDED_VM_ENTRY( nmethod* code = get_methodOop()->code(); if (code != NULL && (comp_level == CompLevel_any || comp_level == code->comp_level())) { - return code->code_end() - code->verified_entry_point(); + return code->insts_end() - code->verified_entry_point(); } return 0; ) diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp index abf53ca0742..63d4bdc7c37 100644 --- a/hotspot/src/share/vm/ci/ciMethod.hpp +++ b/hotspot/src/share/vm/ci/ciMethod.hpp @@ -22,6 +22,17 @@ * */ +#ifndef SHARE_VM_CI_CIMETHOD_HPP +#define SHARE_VM_CI_CIMETHOD_HPP + +#include "ci/ciFlags.hpp" +#include "ci/ciInstanceKlass.hpp" +#include "ci/ciObject.hpp" +#include "ci/ciSignature.hpp" +#include "compiler/methodLiveness.hpp" +#include "prims/methodHandles.hpp" +#include "utilities/bitMap.hpp" + class ciMethodBlocks; class MethodLiveness; class BitMap; @@ -95,7 +106,7 @@ class ciMethod : public ciObject { void check_is_loaded() const { assert(is_loaded(), "not loaded"); } - void build_method_data(methodHandle h_m); + bool ensure_method_data(methodHandle h_m); void code_at_put(int bci, Bytecodes::Code code) { Bytecodes::check(code); @@ -110,6 +121,7 @@ class ciMethod : public ciObject { ciSymbol* name() const { return _name; } ciInstanceKlass* holder() const { return _holder; } ciMethodData* method_data(); + ciMethodData* method_data_or_null(); // Signature information. ciSignature* signature() const { return _signature; } @@ -219,7 +231,7 @@ class ciMethod : public ciObject { bool has_unloaded_classes_in_signature(); bool is_klass_loaded(int refinfo_index, bool must_be_resolved) const; bool check_call(int refinfo_index, bool is_static) const; - void build_method_data(); // make sure it exists in the VM also + bool ensure_method_data(); // make sure it exists in the VM also int scale_count(int count, float prof_factor = 1.); // make MDO count commensurate with IIC // JSR 292 support @@ -269,3 +281,5 @@ class ciMethod : public ciObject { return MethodHandles::decode_method(get_oop(), receiver_limit_oop, flags); } }; + +#endif // SHARE_VM_CI_CIMETHOD_HPP diff --git a/hotspot/src/share/vm/ci/ciMethodBlocks.cpp b/hotspot/src/share/vm/ci/ciMethodBlocks.cpp index 36bfa813a18..e54f94c72b4 100644 --- a/hotspot/src/share/vm/ci/ciMethodBlocks.cpp +++ b/hotspot/src/share/vm/ci/ciMethodBlocks.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciMethodBlocks.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciMethodBlocks.hpp" +#include "ci/ciStreams.hpp" +#include "interpreter/bytecode.hpp" +#include "utilities/copy.hpp" // ciMethodBlocks diff --git a/hotspot/src/share/vm/ci/ciMethodBlocks.hpp b/hotspot/src/share/vm/ci/ciMethodBlocks.hpp index a1f1ebba6a4..784c6a7266d 100644 --- a/hotspot/src/share/vm/ci/ciMethodBlocks.hpp +++ b/hotspot/src/share/vm/ci/ciMethodBlocks.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_CI_CIMETHODBLOCKS_HPP +#define SHARE_VM_CI_CIMETHODBLOCKS_HPP + +#include "ci/ciMethod.hpp" +#include "memory/resourceArea.hpp" +#include "utilities/growableArray.hpp" + class ciBlock; @@ -121,3 +128,5 @@ public: void print_on(outputStream* st) const PRODUCT_RETURN; #endif }; + +#endif // SHARE_VM_CI_CIMETHODBLOCKS_HPP diff --git a/hotspot/src/share/vm/ci/ciMethodData.cpp b/hotspot/src/share/vm/ci/ciMethodData.cpp index 7bc50901d81..8456160b109 100644 --- a/hotspot/src/share/vm/ci/ciMethodData.cpp +++ b/hotspot/src/share/vm/ci/ciMethodData.cpp @@ -22,8 +22,13 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciMethodData.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciMethodData.hpp" +#include "ci/ciUtilities.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/deoptimization.hpp" +#include "utilities/copy.hpp" // ciMethodData diff --git a/hotspot/src/share/vm/ci/ciMethodData.hpp b/hotspot/src/share/vm/ci/ciMethodData.hpp index 3930e88393e..d84b2c83f17 100644 --- a/hotspot/src/share/vm/ci/ciMethodData.hpp +++ b/hotspot/src/share/vm/ci/ciMethodData.hpp @@ -22,6 +22,16 @@ * */ +#ifndef SHARE_VM_CI_CIMETHODDATA_HPP +#define SHARE_VM_CI_CIMETHODDATA_HPP + +#include "ci/ciClassList.hpp" +#include "ci/ciKlass.hpp" +#include "ci/ciObject.hpp" +#include "ci/ciUtilities.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/oop.inline.hpp" + class ciBitData; class ciCounterData; class ciJumpData; @@ -311,3 +321,5 @@ public: void print_data_on(outputStream* st); #endif }; + +#endif // SHARE_VM_CI_CIMETHODDATA_HPP diff --git a/hotspot/src/share/vm/ci/ciMethodHandle.cpp b/hotspot/src/share/vm/ci/ciMethodHandle.cpp index 816e257557c..c8e7cf18142 100644 --- a/hotspot/src/share/vm/ci/ciMethodHandle.cpp +++ b/hotspot/src/share/vm/ci/ciMethodHandle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciMethodHandle.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciClassList.hpp" +#include "ci/ciInstance.hpp" +#include "ci/ciMethodHandle.hpp" +#include "ci/ciUtilities.hpp" +#include "prims/methodHandleWalk.hpp" +#include "prims/methodHandles.hpp" // ciMethodHandle diff --git a/hotspot/src/share/vm/ci/ciMethodHandle.hpp b/hotspot/src/share/vm/ci/ciMethodHandle.hpp index 2128ba0bda4..7573bffb9a5 100644 --- a/hotspot/src/share/vm/ci/ciMethodHandle.hpp +++ b/hotspot/src/share/vm/ci/ciMethodHandle.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CI_CIMETHODHANDLE_HPP +#define SHARE_VM_CI_CIMETHODHANDLE_HPP + +#include "ci/ciInstance.hpp" +#include "prims/methodHandles.hpp" + // ciMethodHandle // // The class represents a java.dyn.MethodHandle object. @@ -54,3 +60,5 @@ public: return get_adapter(true); } }; + +#endif // SHARE_VM_CI_CIMETHODHANDLE_HPP diff --git a/hotspot/src/share/vm/ci/ciMethodKlass.cpp b/hotspot/src/share/vm/ci/ciMethodKlass.cpp index 5d46cdde527..b72f2ce97cd 100644 --- a/hotspot/src/share/vm/ci/ciMethodKlass.cpp +++ b/hotspot/src/share/vm/ci/ciMethodKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciMethodKlass.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciMethodKlass.hpp" +#include "ci/ciUtilities.hpp" // ciMethodKlass // diff --git a/hotspot/src/share/vm/ci/ciMethodKlass.hpp b/hotspot/src/share/vm/ci/ciMethodKlass.hpp index 03987d045a2..691f2ba78b1 100644 --- a/hotspot/src/share/vm/ci/ciMethodKlass.hpp +++ b/hotspot/src/share/vm/ci/ciMethodKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CI_CIMETHODKLASS_HPP +#define SHARE_VM_CI_CIMETHODKLASS_HPP + +#include "ci/ciKlass.hpp" +#include "ci/ciSymbol.hpp" + // ciMethodKlass // // This class represents a klassOop in the HotSpot virtual machine @@ -46,3 +52,5 @@ public: // Return the distinguished ciMethodKlass instance. static ciMethodKlass* make(); }; + +#endif // SHARE_VM_CI_CIMETHODKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciNullObject.cpp b/hotspot/src/share/vm/ci/ciNullObject.cpp index 7ed9cc66d0b..30e3f1e8937 100644 --- a/hotspot/src/share/vm/ci/ciNullObject.cpp +++ b/hotspot/src/share/vm/ci/ciNullObject.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,8 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciNullObject.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciNullObject.hpp" // ciNullObject // diff --git a/hotspot/src/share/vm/ci/ciNullObject.hpp b/hotspot/src/share/vm/ci/ciNullObject.hpp index 7bf5d04bf70..23879a1dfc2 100644 --- a/hotspot/src/share/vm/ci/ciNullObject.hpp +++ b/hotspot/src/share/vm/ci/ciNullObject.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_CI_CINULLOBJECT_HPP +#define SHARE_VM_CI_CINULLOBJECT_HPP + +#include "ci/ciClassList.hpp" +#include "ci/ciObject.hpp" +#include "ci/ciUtilities.hpp" + // ciNullObject // // This class represents a null reference in the VM. @@ -47,3 +54,5 @@ public: // Get the distinguished instance of this klass. static ciNullObject* make(); }; + +#endif // SHARE_VM_CI_CINULLOBJECT_HPP diff --git a/hotspot/src/share/vm/ci/ciObjArray.cpp b/hotspot/src/share/vm/ci/ciObjArray.cpp index 233848ad847..fc2b31eeb31 100644 --- a/hotspot/src/share/vm/ci/ciObjArray.cpp +++ b/hotspot/src/share/vm/ci/ciObjArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciObjArray.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciNullObject.hpp" +#include "ci/ciObjArray.hpp" +#include "ci/ciUtilities.hpp" +#include "oops/objArrayOop.hpp" // ciObjArray // diff --git a/hotspot/src/share/vm/ci/ciObjArray.hpp b/hotspot/src/share/vm/ci/ciObjArray.hpp index 1a2d2082205..6a3abc55164 100644 --- a/hotspot/src/share/vm/ci/ciObjArray.hpp +++ b/hotspot/src/share/vm/ci/ciObjArray.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_CI_CIOBJARRAY_HPP +#define SHARE_VM_CI_CIOBJARRAY_HPP + +#include "ci/ciArray.hpp" +#include "ci/ciClassList.hpp" +#include "oops/objArrayOop.hpp" + // ciObjArray // // This class represents a ObjArrayOop in the HotSpot virtual @@ -46,3 +53,5 @@ public: ciObject* obj_at(int index); }; + +#endif // SHARE_VM_CI_CIOBJARRAY_HPP diff --git a/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp b/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp index 085e4cfaf8d..c04d31b4df4 100644 --- a/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp +++ b/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciObjArrayKlass.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciInstanceKlass.hpp" +#include "ci/ciObjArrayKlass.hpp" +#include "ci/ciObjArrayKlassKlass.hpp" +#include "ci/ciSymbol.hpp" +#include "ci/ciUtilities.hpp" +#include "oops/objArrayKlass.hpp" // ciObjArrayKlass // diff --git a/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp b/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp index e8c95788055..2f199593e55 100644 --- a/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp +++ b/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_CI_CIOBJARRAYKLASS_HPP +#define SHARE_VM_CI_CIOBJARRAYKLASS_HPP + +#include "ci/ciArrayKlass.hpp" + // ciObjArrayKlass // // This class represents a klassOop in the HotSpot virtual machine @@ -69,3 +74,5 @@ public: static ciObjArrayKlass* make(ciKlass* element_klass); }; + +#endif // SHARE_VM_CI_CIOBJARRAYKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciObjArrayKlassKlass.cpp b/hotspot/src/share/vm/ci/ciObjArrayKlassKlass.cpp index 3eb1d524535..8df71655596 100644 --- a/hotspot/src/share/vm/ci/ciObjArrayKlassKlass.cpp +++ b/hotspot/src/share/vm/ci/ciObjArrayKlassKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciObjArrayKlassKlass.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciObjArrayKlassKlass.hpp" +#include "ci/ciUtilities.hpp" // ciObjArrayKlassKlass // diff --git a/hotspot/src/share/vm/ci/ciObjArrayKlassKlass.hpp b/hotspot/src/share/vm/ci/ciObjArrayKlassKlass.hpp index 4da72e94c7f..537f50af2fd 100644 --- a/hotspot/src/share/vm/ci/ciObjArrayKlassKlass.hpp +++ b/hotspot/src/share/vm/ci/ciObjArrayKlassKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_CI_CIOBJARRAYKLASSKLASS_HPP +#define SHARE_VM_CI_CIOBJARRAYKLASSKLASS_HPP + +#include "ci/ciArrayKlassKlass.hpp" + // ciObjArrayKlassKlass // // This class represents a klassOop in the HotSpot virtual machine @@ -48,3 +53,5 @@ public: // Return the distinguished ciObjArrayKlassKlass instance. static ciObjArrayKlassKlass* make(); }; + +#endif // SHARE_VM_CI_CIOBJARRAYKLASSKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciObject.cpp b/hotspot/src/share/vm/ci/ciObject.cpp index 16e9101978f..a4eb9439e1f 100644 --- a/hotspot/src/share/vm/ci/ciObject.cpp +++ b/hotspot/src/share/vm/ci/ciObject.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciObject.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciObject.hpp" +#include "ci/ciUtilities.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "oops/oop.inline2.hpp" // ciObject // diff --git a/hotspot/src/share/vm/ci/ciObject.hpp b/hotspot/src/share/vm/ci/ciObject.hpp index 5f12c596852..e3a85a1235c 100644 --- a/hotspot/src/share/vm/ci/ciObject.hpp +++ b/hotspot/src/share/vm/ci/ciObject.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_CI_CIOBJECT_HPP +#define SHARE_VM_CI_CIOBJECT_HPP + +#include "ci/ciClassList.hpp" +#include "memory/allocation.hpp" +#include "runtime/handles.hpp" +#include "runtime/jniHandles.hpp" + // ciObject // // This class represents an oop in the HotSpot virtual machine. @@ -291,3 +299,5 @@ public: // Print debugging output about the oop this ciObject represents. void print_oop(outputStream* st = tty); }; + +#endif // SHARE_VM_CI_CIOBJECT_HPP diff --git a/hotspot/src/share/vm/ci/ciObjectFactory.cpp b/hotspot/src/share/vm/ci/ciObjectFactory.cpp index 776fdbd88a9..abc5408af49 100644 --- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp +++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,33 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciObjectFactory.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciCPCache.hpp" +#include "ci/ciCallSite.hpp" +#include "ci/ciInstance.hpp" +#include "ci/ciInstanceKlass.hpp" +#include "ci/ciInstanceKlassKlass.hpp" +#include "ci/ciMethod.hpp" +#include "ci/ciMethodData.hpp" +#include "ci/ciMethodHandle.hpp" +#include "ci/ciMethodKlass.hpp" +#include "ci/ciNullObject.hpp" +#include "ci/ciObjArray.hpp" +#include "ci/ciObjArrayKlass.hpp" +#include "ci/ciObjArrayKlassKlass.hpp" +#include "ci/ciObjectFactory.hpp" +#include "ci/ciSymbol.hpp" +#include "ci/ciSymbolKlass.hpp" +#include "ci/ciTypeArray.hpp" +#include "ci/ciTypeArrayKlass.hpp" +#include "ci/ciTypeArrayKlassKlass.hpp" +#include "ci/ciUtilities.hpp" +#include "classfile/systemDictionary.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "memory/allocation.inline.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.inline2.hpp" +#include "runtime/fieldType.hpp" // ciObjectFactory // diff --git a/hotspot/src/share/vm/ci/ciObjectFactory.hpp b/hotspot/src/share/vm/ci/ciObjectFactory.hpp index 4ea01d9e1ef..280f7214491 100644 --- a/hotspot/src/share/vm/ci/ciObjectFactory.hpp +++ b/hotspot/src/share/vm/ci/ciObjectFactory.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_CI_CIOBJECTFACTORY_HPP +#define SHARE_VM_CI_CIOBJECTFACTORY_HPP + +#include "ci/ciClassList.hpp" +#include "ci/ciObject.hpp" +#include "utilities/growableArray.hpp" + // ciObjectFactory // // This class handles requests for the creation of new instances @@ -123,3 +130,5 @@ public: void print_contents(); void print(); }; + +#endif // SHARE_VM_CI_CIOBJECTFACTORY_HPP diff --git a/hotspot/src/share/vm/ci/ciSignature.cpp b/hotspot/src/share/vm/ci/ciSignature.cpp index bf73809c359..738e28d7cac 100644 --- a/hotspot/src/share/vm/ci/ciSignature.cpp +++ b/hotspot/src/share/vm/ci/ciSignature.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,12 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciSignature.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciSignature.hpp" +#include "ci/ciUtilities.hpp" +#include "memory/allocation.inline.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/signature.hpp" // ciSignature // diff --git a/hotspot/src/share/vm/ci/ciSignature.hpp b/hotspot/src/share/vm/ci/ciSignature.hpp index 0be657f92d4..700daaad603 100644 --- a/hotspot/src/share/vm/ci/ciSignature.hpp +++ b/hotspot/src/share/vm/ci/ciSignature.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_CI_CISIGNATURE_HPP +#define SHARE_VM_CI_CISIGNATURE_HPP + +#include "ci/ciClassList.hpp" +#include "ci/ciSymbol.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/growableArray.hpp" + // ciSignature // // This class represents the signature of a method. @@ -54,3 +62,5 @@ public: void print_signature(); void print(); }; + +#endif // SHARE_VM_CI_CISIGNATURE_HPP diff --git a/hotspot/src/share/vm/ci/ciStreams.cpp b/hotspot/src/share/vm/ci/ciStreams.cpp index 5b0586b205b..a93f40c0fcc 100644 --- a/hotspot/src/share/vm/ci/ciStreams.cpp +++ b/hotspot/src/share/vm/ci/ciStreams.cpp @@ -22,8 +22,13 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciStreams.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciCPCache.hpp" +#include "ci/ciCallSite.hpp" +#include "ci/ciConstant.hpp" +#include "ci/ciField.hpp" +#include "ci/ciStreams.hpp" +#include "ci/ciUtilities.hpp" // ciExceptionHandlerStream // diff --git a/hotspot/src/share/vm/ci/ciStreams.hpp b/hotspot/src/share/vm/ci/ciStreams.hpp index e126eddfa9f..78ff279811e 100644 --- a/hotspot/src/share/vm/ci/ciStreams.hpp +++ b/hotspot/src/share/vm/ci/ciStreams.hpp @@ -22,6 +22,15 @@ * */ +#ifndef SHARE_VM_CI_CISTREAMS_HPP +#define SHARE_VM_CI_CISTREAMS_HPP + +#include "ci/ciClassList.hpp" +#include "ci/ciExceptionHandler.hpp" +#include "ci/ciInstanceKlass.hpp" +#include "ci/ciMethod.hpp" +#include "interpreter/bytecode.hpp" + // ciBytecodeStream // // The class is used to iterate over the bytecodes of a method. @@ -397,3 +406,5 @@ public: return _method->_exception_handlers[_pos]; } }; + +#endif // SHARE_VM_CI_CISTREAMS_HPP diff --git a/hotspot/src/share/vm/ci/ciSymbol.cpp b/hotspot/src/share/vm/ci/ciSymbol.cpp index b48deee2702..08cc704b747 100644 --- a/hotspot/src/share/vm/ci/ciSymbol.cpp +++ b/hotspot/src/share/vm/ci/ciSymbol.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciSymbol.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciSymbol.hpp" +#include "ci/ciUtilities.hpp" +#include "memory/oopFactory.hpp" // ------------------------------------------------------------------ // ciSymbol::ciSymbol diff --git a/hotspot/src/share/vm/ci/ciSymbol.hpp b/hotspot/src/share/vm/ci/ciSymbol.hpp index 4c163ab6b0a..6664934a2e7 100644 --- a/hotspot/src/share/vm/ci/ciSymbol.hpp +++ b/hotspot/src/share/vm/ci/ciSymbol.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_CI_CISYMBOL_HPP +#define SHARE_VM_CI_CISYMBOL_HPP + +#include "ci/ciObject.hpp" +#include "ci/ciObjectFactory.hpp" +#include "classfile/vmSymbols.hpp" +#include "oops/symbolOop.hpp" + // ciSymbol // // This class represents a symbolOop in the HotSpot virtual @@ -89,3 +97,5 @@ public: VM_SYMBOLS_DO(CI_SYMBOL_DECLARE, CI_SYMBOL_DECLARE) #undef CI_SYMBOL_DECLARE }; + +#endif // SHARE_VM_CI_CISYMBOL_HPP diff --git a/hotspot/src/share/vm/ci/ciSymbolKlass.cpp b/hotspot/src/share/vm/ci/ciSymbolKlass.cpp index f7de2d67011..1fb67e1a320 100644 --- a/hotspot/src/share/vm/ci/ciSymbolKlass.cpp +++ b/hotspot/src/share/vm/ci/ciSymbolKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciSymbolKlass.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciSymbolKlass.hpp" +#include "ci/ciUtilities.hpp" // ciSymbolKlass // diff --git a/hotspot/src/share/vm/ci/ciSymbolKlass.hpp b/hotspot/src/share/vm/ci/ciSymbolKlass.hpp index 995cceead68..604a7be1884 100644 --- a/hotspot/src/share/vm/ci/ciSymbolKlass.hpp +++ b/hotspot/src/share/vm/ci/ciSymbolKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CI_CISYMBOLKLASS_HPP +#define SHARE_VM_CI_CISYMBOLKLASS_HPP + +#include "ci/ciKlass.hpp" +#include "ci/ciSymbol.hpp" + // ciSymbolKlass // // This class represents a klassOop in the HotSpot virtual machine @@ -50,3 +56,5 @@ public: // Return the distinguished ciSymbolKlass instance. static ciSymbolKlass* make(); }; + +#endif // SHARE_VM_CI_CISYMBOLKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciType.cpp b/hotspot/src/share/vm/ci/ciType.cpp index c00348cf86d..4aa100ccd1a 100644 --- a/hotspot/src/share/vm/ci/ciType.cpp +++ b/hotspot/src/share/vm/ci/ciType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciType.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciType.hpp" +#include "ci/ciUtilities.hpp" +#include "classfile/systemDictionary.hpp" +#include "oops/oop.inline.hpp" ciType* ciType::_basic_types[T_CONFLICT+1]; diff --git a/hotspot/src/share/vm/ci/ciType.hpp b/hotspot/src/share/vm/ci/ciType.hpp index 70d9e877401..916bcf4614f 100644 --- a/hotspot/src/share/vm/ci/ciType.hpp +++ b/hotspot/src/share/vm/ci/ciType.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CI_CITYPE_HPP +#define SHARE_VM_CI_CITYPE_HPP + +#include "ci/ciObject.hpp" +#include "oops/klassOop.hpp" + // ciType // // This class represents either a class (T_OBJECT), array (T_ARRAY), @@ -106,3 +112,5 @@ public: static ciReturnAddress* make(int bci); }; + +#endif // SHARE_VM_CI_CITYPE_HPP diff --git a/hotspot/src/share/vm/ci/ciTypeArray.cpp b/hotspot/src/share/vm/ci/ciTypeArray.cpp index fe50e0707ab..d4a6eff6f41 100644 --- a/hotspot/src/share/vm/ci/ciTypeArray.cpp +++ b/hotspot/src/share/vm/ci/ciTypeArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciTypeArray.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciTypeArray.hpp" +#include "ci/ciUtilities.hpp" // ciTypeArray // diff --git a/hotspot/src/share/vm/ci/ciTypeArray.hpp b/hotspot/src/share/vm/ci/ciTypeArray.hpp index 101205d06d0..80a767d91ee 100644 --- a/hotspot/src/share/vm/ci/ciTypeArray.hpp +++ b/hotspot/src/share/vm/ci/ciTypeArray.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_CI_CITYPEARRAY_HPP +#define SHARE_VM_CI_CITYPEARRAY_HPP + +#include "ci/ciArray.hpp" +#include "ci/ciClassList.hpp" +#include "oops/typeArrayOop.hpp" + // ciTypeArray // // This class represents a typeArrayOop in the HotSpot virtual @@ -50,3 +57,5 @@ public: jchar char_at(int index); }; + +#endif // SHARE_VM_CI_CITYPEARRAY_HPP diff --git a/hotspot/src/share/vm/ci/ciTypeArrayKlass.cpp b/hotspot/src/share/vm/ci/ciTypeArrayKlass.cpp index 3d197602e37..ca0c5cfd1d1 100644 --- a/hotspot/src/share/vm/ci/ciTypeArrayKlass.cpp +++ b/hotspot/src/share/vm/ci/ciTypeArrayKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciTypeArrayKlass.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciTypeArrayKlass.hpp" +#include "ci/ciUtilities.hpp" // ciTypeArrayKlass // diff --git a/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp b/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp index c7c41776275..22df4b975b9 100644 --- a/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp +++ b/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_CI_CITYPEARRAYKLASS_HPP +#define SHARE_VM_CI_CITYPEARRAYKLASS_HPP + +#include "ci/ciArrayKlass.hpp" + // ciTypeArrayKlass // // This class represents a klassOop in the HotSpot virtual machine @@ -53,3 +58,5 @@ public: // Make an array klass corresponding to the specified primitive type. static ciTypeArrayKlass* make(BasicType type); }; + +#endif // SHARE_VM_CI_CITYPEARRAYKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciTypeArrayKlassKlass.cpp b/hotspot/src/share/vm/ci/ciTypeArrayKlassKlass.cpp index 960e85c3776..41048ce78e4 100644 --- a/hotspot/src/share/vm/ci/ciTypeArrayKlassKlass.cpp +++ b/hotspot/src/share/vm/ci/ciTypeArrayKlassKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciTypeArrayKlassKlass.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciTypeArrayKlassKlass.hpp" +#include "ci/ciUtilities.hpp" // ciTypeArrayKlassKlass // diff --git a/hotspot/src/share/vm/ci/ciTypeArrayKlassKlass.hpp b/hotspot/src/share/vm/ci/ciTypeArrayKlassKlass.hpp index 8fdb91b3ef1..b99a968d641 100644 --- a/hotspot/src/share/vm/ci/ciTypeArrayKlassKlass.hpp +++ b/hotspot/src/share/vm/ci/ciTypeArrayKlassKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_CI_CITYPEARRAYKLASSKLASS_HPP +#define SHARE_VM_CI_CITYPEARRAYKLASSKLASS_HPP + +#include "ci/ciArrayKlassKlass.hpp" + // ciTypeArrayKlassKlass // // This class represents a klassOop in the HotSpot virtual machine @@ -49,3 +54,5 @@ public: // Return the distinguished ciTypeArrayKlassKlass instance. static ciTypeArrayKlassKlass* make(); }; + +#endif // SHARE_VM_CI_CITYPEARRAYKLASSKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciTypeFlow.cpp b/hotspot/src/share/vm/ci/ciTypeFlow.cpp index 3071856b948..d8af850f185 100644 --- a/hotspot/src/share/vm/ci/ciTypeFlow.cpp +++ b/hotspot/src/share/vm/ci/ciTypeFlow.cpp @@ -22,8 +22,21 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciTypeFlow.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciConstant.hpp" +#include "ci/ciField.hpp" +#include "ci/ciMethod.hpp" +#include "ci/ciMethodData.hpp" +#include "ci/ciObjArrayKlass.hpp" +#include "ci/ciStreams.hpp" +#include "ci/ciTypeArrayKlass.hpp" +#include "ci/ciTypeFlow.hpp" +#include "compiler/compileLog.hpp" +#include "interpreter/bytecode.hpp" +#include "interpreter/bytecodes.hpp" +#include "memory/allocation.inline.hpp" +#include "runtime/deoptimization.hpp" +#include "utilities/growableArray.hpp" // ciTypeFlow::JsrSet // @@ -1945,7 +1958,7 @@ ciTypeFlow::ciTypeFlow(ciEnv* env, ciMethod* method, int osr_bci) { _has_irreducible_entry = false; _osr_bci = osr_bci; _failure_reason = NULL; - assert(start_bci() >= 0 && start_bci() < code_size() , "correct osr_bci argument"); + assert(0 <= start_bci() && start_bci() < code_size() , err_msg("correct osr_bci argument: 0 <= %d < %d", start_bci(), code_size())); _work_list = NULL; _ciblock_count = _methodBlocks->num_blocks(); diff --git a/hotspot/src/share/vm/ci/ciTypeFlow.hpp b/hotspot/src/share/vm/ci/ciTypeFlow.hpp index 26828a57897..e83487d1937 100644 --- a/hotspot/src/share/vm/ci/ciTypeFlow.hpp +++ b/hotspot/src/share/vm/ci/ciTypeFlow.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,20 @@ * */ +#ifndef SHARE_VM_CI_CITYPEFLOW_HPP +#define SHARE_VM_CI_CITYPEFLOW_HPP + +#ifdef COMPILER2 +#include "ci/ciEnv.hpp" +#include "ci/ciKlass.hpp" +#include "ci/ciMethodBlocks.hpp" +#endif +#ifdef SHARK +#include "ci/ciEnv.hpp" +#include "ci/ciKlass.hpp" +#include "ci/ciMethodBlocks.hpp" +#endif + class ciTypeFlow : public ResourceObj { private: @@ -924,3 +938,5 @@ public: void rpo_print_on(outputStream* st) const PRODUCT_RETURN; }; + +#endif // SHARE_VM_CI_CITYPEFLOW_HPP diff --git a/hotspot/src/share/vm/ci/ciUtilities.cpp b/hotspot/src/share/vm/ci/ciUtilities.cpp index 09ac80ecbb3..f64f7efb376 100644 --- a/hotspot/src/share/vm/ci/ciUtilities.cpp +++ b/hotspot/src/share/vm/ci/ciUtilities.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,8 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_ciUtilities.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciUtilities.hpp" // ciUtilities // diff --git a/hotspot/src/share/vm/ci/ciUtilities.hpp b/hotspot/src/share/vm/ci/ciUtilities.hpp index e1357500ff2..9788f77a734 100644 --- a/hotspot/src/share/vm/ci/ciUtilities.hpp +++ b/hotspot/src/share/vm/ci/ciUtilities.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CI_CIUTILITIES_HPP +#define SHARE_VM_CI_CIUTILITIES_HPP + +#include "ci/ciEnv.hpp" +#include "runtime/interfaceSupport.hpp" + // The following routines and definitions are used internally in the // compiler interface. @@ -104,3 +110,5 @@ inline const char* bool_to_str(bool b) { const char* basictype_to_str(BasicType t); const char basictype_to_char(BasicType t); + +#endif // SHARE_VM_CI_CIUTILITIES_HPP diff --git a/hotspot/src/share/vm/ci/compilerInterface.hpp b/hotspot/src/share/vm/ci/compilerInterface.hpp index fe843d5a104..b5db53c0e42 100644 --- a/hotspot/src/share/vm/ci/compilerInterface.hpp +++ b/hotspot/src/share/vm/ci/compilerInterface.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +22,39 @@ * */ +#ifndef SHARE_VM_CI_COMPILERINTERFACE_HPP +#define SHARE_VM_CI_COMPILERINTERFACE_HPP + +#include "ci/ciArray.hpp" +#include "ci/ciArrayKlass.hpp" +#include "ci/ciArrayKlassKlass.hpp" +#include "ci/ciCallProfile.hpp" +#include "ci/ciConstant.hpp" +#include "ci/ciEnv.hpp" +#include "ci/ciExceptionHandler.hpp" +#include "ci/ciField.hpp" +#include "ci/ciFlags.hpp" +#include "ci/ciInstance.hpp" +#include "ci/ciInstanceKlass.hpp" +#include "ci/ciInstanceKlassKlass.hpp" +#include "ci/ciKlass.hpp" +#include "ci/ciKlassKlass.hpp" +#include "ci/ciMethod.hpp" +#include "ci/ciMethodKlass.hpp" +#include "ci/ciNullObject.hpp" +#include "ci/ciObjArray.hpp" +#include "ci/ciObjArrayKlass.hpp" +#include "ci/ciObjArrayKlassKlass.hpp" +#include "ci/ciObject.hpp" +#include "ci/ciSignature.hpp" +#include "ci/ciStreams.hpp" +#include "ci/ciSymbol.hpp" +#include "ci/ciSymbolKlass.hpp" +#include "ci/ciTypeArray.hpp" +#include "ci/ciTypeArrayKlass.hpp" +#include "ci/ciTypeArrayKlassKlass.hpp" + // This is a dummy file used for including the complete // compiler interface. + +#endif // SHARE_VM_CI_COMPILERINTERFACE_HPP diff --git a/hotspot/src/share/vm/classfile/classFileError.cpp b/hotspot/src/share/vm/classfile/classFileError.cpp index c5f465e7678..80aa37af9fb 100644 --- a/hotspot/src/share/vm/classfile/classFileError.cpp +++ b/hotspot/src/share/vm/classfile/classFileError.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_classFileError.cpp.incl" +#include "precompiled.hpp" +#include "classfile/classFileParser.hpp" +#include "classfile/stackMapTable.hpp" +#include "classfile/verifier.hpp" // Keep these in a separate file to prevent inlining diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 36085a754f8..3779fc7d67a 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,34 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_classFileParser.cpp.incl" +#include "precompiled.hpp" +#include "classfile/classFileParser.hpp" +#include "classfile/classLoader.hpp" +#include "classfile/javaClasses.hpp" +#include "classfile/symbolTable.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/verificationType.hpp" +#include "classfile/verifier.hpp" +#include "classfile/vmSymbols.hpp" +#include "memory/allocation.hpp" +#include "memory/gcLocker.hpp" +#include "memory/oopFactory.hpp" +#include "memory/universe.inline.hpp" +#include "oops/constantPoolOop.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/klass.inline.hpp" +#include "oops/klassOop.hpp" +#include "oops/klassVtable.hpp" +#include "oops/methodOop.hpp" +#include "oops/symbolOop.hpp" +#include "prims/jvmtiExport.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/perfData.hpp" +#include "runtime/reflection.hpp" +#include "runtime/signature.hpp" +#include "runtime/timer.hpp" +#include "services/classLoadingService.hpp" +#include "services/threadService.hpp" // We generally try to create the oops directly when parsing, rather than // allocating temporary data structures and copying the bytes twice. A @@ -141,6 +167,7 @@ void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int len ShouldNotReachHere(); } break; + case JVM_CONSTANT_InvokeDynamicTrans : // this tag appears only in old classfiles case JVM_CONSTANT_InvokeDynamic : { if (!EnableInvokeDynamic || @@ -151,10 +178,20 @@ void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int len "Class file version does not support constant tag %u in class file %s"), tag, CHECK); } - cfs->guarantee_more(5, CHECK); // bsm_index, name_and_type_index, tag/access_flags - u2 bootstrap_method_index = cfs->get_u2_fast(); + cfs->guarantee_more(5, CHECK); // bsm_index, nt, tag/access_flags + u2 bootstrap_specifier_index = cfs->get_u2_fast(); u2 name_and_type_index = cfs->get_u2_fast(); - cp->invoke_dynamic_at_put(index, bootstrap_method_index, name_and_type_index); + if (tag == JVM_CONSTANT_InvokeDynamicTrans) { + if (!AllowTransitionalJSR292) + classfile_parse_error( + "This JVM does not support transitional InvokeDynamic tag %u in class file %s", + tag, CHECK); + cp->invoke_dynamic_trans_at_put(index, bootstrap_specifier_index, name_and_type_index); + break; + } + if (_max_bootstrap_specifier_index < (int) bootstrap_specifier_index) + _max_bootstrap_specifier_index = (int) bootstrap_specifier_index; // collect for later + cp->invoke_dynamic_at_put(index, bootstrap_specifier_index, name_and_type_index); } break; case JVM_CONSTANT_Integer : @@ -290,7 +327,8 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) { // first verification pass - validate cross references and fixup class and string constants for (index = 1; index < length; index++) { // Index 0 is unused - switch (cp->tag_at(index).value()) { + jbyte tag = cp->tag_at(index).value(); + switch (tag) { case JVM_CONSTANT_Class : ShouldNotReachHere(); // Only JVM_CONSTANT_ClassIndex should be present break; @@ -431,22 +469,24 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) { ref_index, CHECK_(nullHandle)); } break; + case JVM_CONSTANT_InvokeDynamicTrans : case JVM_CONSTANT_InvokeDynamic : { - int bootstrap_method_ref_index = cp->invoke_dynamic_bootstrap_method_ref_index_at(index); int name_and_type_ref_index = cp->invoke_dynamic_name_and_type_ref_index_at(index); - check_property((bootstrap_method_ref_index == 0 && AllowTransitionalJSR292) - || - (valid_cp_range(bootstrap_method_ref_index, length) && - cp->tag_at(bootstrap_method_ref_index).is_method_handle()), - "Invalid constant pool index %u in class file %s", - bootstrap_method_ref_index, - CHECK_(nullHandle)); check_property(valid_cp_range(name_and_type_ref_index, length) && cp->tag_at(name_and_type_ref_index).is_name_and_type(), "Invalid constant pool index %u in class file %s", name_and_type_ref_index, CHECK_(nullHandle)); + if (tag == JVM_CONSTANT_InvokeDynamicTrans) { + int bootstrap_method_ref_index = cp->invoke_dynamic_bootstrap_method_ref_index_at(index); + check_property(valid_cp_range(bootstrap_method_ref_index, length) && + cp->tag_at(bootstrap_method_ref_index).is_method_handle(), + "Invalid constant pool index %u in class file %s", + bootstrap_method_ref_index, + CHECK_(nullHandle)); + } + // bootstrap specifier index must be checked later, when BootstrapMethods attr is available break; } default: @@ -2304,6 +2344,78 @@ void ClassFileParser::parse_classfile_signature_attribute(constantPoolHandle cp, k->set_generic_signature(cp->symbol_at(signature_index)); } +void ClassFileParser::parse_classfile_bootstrap_methods_attribute(constantPoolHandle cp, instanceKlassHandle k, + u4 attribute_byte_length, TRAPS) { + ClassFileStream* cfs = stream(); + u1* current_start = cfs->current(); + + cfs->guarantee_more(2, CHECK); // length + int attribute_array_length = cfs->get_u2_fast(); + + guarantee_property(_max_bootstrap_specifier_index < attribute_array_length, + "Short length on BootstrapMethods in class file %s", + CHECK); + + // The attribute contains a counted array of counted tuples of shorts, + // represending bootstrap specifiers: + // length*{bootstrap_method_index, argument_count*{argument_index}} + int operand_count = (attribute_byte_length - sizeof(u2)) / sizeof(u2); + // operand_count = number of shorts in attr, except for leading length + + // The attribute is copied into a short[] array. + // The array begins with a series of short[2] pairs, one for each tuple. + int index_size = (attribute_array_length * 2); + + typeArrayOop operands_oop = oopFactory::new_permanent_intArray(index_size + operand_count, CHECK); + typeArrayHandle operands(THREAD, operands_oop); + operands_oop = NULL; // tidy + + int operand_fill_index = index_size; + int cp_size = cp->length(); + + for (int n = 0; n < attribute_array_length; n++) { + // Store a 32-bit offset into the header of the operand array. + assert(constantPoolOopDesc::operand_offset_at(operands(), n) == 0, ""); + constantPoolOopDesc::operand_offset_at_put(operands(), n, operand_fill_index); + + // Read a bootstrap specifier. + cfs->guarantee_more(sizeof(u2) * 2, CHECK); // bsm, argc + u2 bootstrap_method_index = cfs->get_u2_fast(); + u2 argument_count = cfs->get_u2_fast(); + check_property( + valid_cp_range(bootstrap_method_index, cp_size) && + cp->tag_at(bootstrap_method_index).is_method_handle(), + "bootstrap_method_index %u has bad constant type in class file %s", + bootstrap_method_index, + CHECK); + operands->short_at_put(operand_fill_index++, bootstrap_method_index); + operands->short_at_put(operand_fill_index++, argument_count); + + cfs->guarantee_more(sizeof(u2) * argument_count, CHECK); // argv[argc] + for (int j = 0; j < argument_count; j++) { + u2 argument_index = cfs->get_u2_fast(); + check_property( + valid_cp_range(argument_index, cp_size) && + cp->tag_at(argument_index).is_loadable_constant(), + "argument_index %u has bad constant type in class file %s", + argument_index, + CHECK); + operands->short_at_put(operand_fill_index++, argument_index); + } + } + + assert(operand_fill_index == operands()->length(), "exact fill"); + assert(constantPoolOopDesc::operand_array_length(operands()) == attribute_array_length, "correct decode"); + + u1* current_end = cfs->current(); + guarantee_property(current_end == current_start + attribute_byte_length, + "Bad length on BootstrapMethods in class file %s", + CHECK); + + cp->set_operands(operands()); +} + + void ClassFileParser::parse_classfile_attributes(constantPoolHandle cp, instanceKlassHandle k, TRAPS) { ClassFileStream* cfs = stream(); // Set inner classes attribute to default sentinel @@ -2313,6 +2425,7 @@ void ClassFileParser::parse_classfile_attributes(constantPoolHandle cp, instance bool parsed_sourcefile_attribute = false; bool parsed_innerclasses_attribute = false; bool parsed_enclosingmethod_attribute = false; + bool parsed_bootstrap_methods_attribute = false; u1* runtime_visible_annotations = NULL; int runtime_visible_annotations_length = 0; u1* runtime_invisible_annotations = NULL; @@ -2411,6 +2524,12 @@ void ClassFileParser::parse_classfile_attributes(constantPoolHandle cp, instance classfile_parse_error("Invalid or out-of-bounds method index in EnclosingMethod attribute in class file %s", CHECK); } k->set_enclosing_method_indices(class_index, method_index); + } else if (tag == vmSymbols::tag_bootstrap_methods() && + _major_version >= Verifier::INVOKEDYNAMIC_MAJOR_VERSION) { + if (parsed_bootstrap_methods_attribute) + classfile_parse_error("Multiple BootstrapMethods attributes in class file %s", CHECK); + parsed_bootstrap_methods_attribute = true; + parse_classfile_bootstrap_methods_attribute(cp, k, attribute_length, CHECK); } else { // Unknown attribute cfs->skip_u1(attribute_length, CHECK); @@ -2426,6 +2545,11 @@ void ClassFileParser::parse_classfile_attributes(constantPoolHandle cp, instance runtime_invisible_annotations_length, CHECK); k->set_class_annotations(annotations()); + + if (_max_bootstrap_specifier_index >= 0) { + guarantee_property(parsed_bootstrap_methods_attribute, + "Missing BootstrapMethods attribute in class file %s", CHECK); + } } @@ -2505,18 +2629,6 @@ void ClassFileParser::java_lang_ref_Reference_fix_pre(typeArrayHandle* fields_pt // the check for the "discovered" field should issue a warning if // the field is not found. For 1.6 this code should be issue a // fatal error if the "discovered" field is not found. - // - // Increment fac.nonstatic_oop_count so that the start of the - // next type of non-static oops leaves room for the fake oop. - // Do not increment next_nonstatic_oop_offset so that the - // fake oop is place after the java.lang.ref.Reference oop - // fields. - // - // Check the fields in java.lang.ref.Reference for the "discovered" - // field. If it is not present, artifically create a field for it. - // This allows this VM to run on early JDK where the field is not - // present. - // // Increment fac.nonstatic_oop_count so that the start of the // next type of non-static oops leaves room for the fake oop. @@ -2663,7 +2775,7 @@ void ClassFileParser::java_lang_Class_fix_post(int* next_nonstatic_oop_offset_pt // Force MethodHandle.vmentry to be an unmanaged pointer. // There is no way for a classfile to express this, so we must help it. void ClassFileParser::java_dyn_MethodHandle_fix_pre(constantPoolHandle cp, - typeArrayHandle* fields_ptr, + typeArrayHandle fields, FieldAllocationCount *fac_ptr, TRAPS) { // Add fake fields for java.dyn.MethodHandle instances @@ -2687,39 +2799,45 @@ void ClassFileParser::java_dyn_MethodHandle_fix_pre(constantPoolHandle cp, THROW_MSG(vmSymbols::java_lang_VirtualMachineError(), "missing I or J signature (for vmentry) in java.dyn.MethodHandle"); + // Find vmentry field and change the signature. bool found_vmentry = false; - - const int n = (*fields_ptr)()->length(); - for (int i = 0; i < n; i += instanceKlass::next_offset) { - int name_index = (*fields_ptr)->ushort_at(i + instanceKlass::name_index_offset); - int sig_index = (*fields_ptr)->ushort_at(i + instanceKlass::signature_index_offset); - int acc_flags = (*fields_ptr)->ushort_at(i + instanceKlass::access_flags_offset); + for (int i = 0; i < fields->length(); i += instanceKlass::next_offset) { + int name_index = fields->ushort_at(i + instanceKlass::name_index_offset); + int sig_index = fields->ushort_at(i + instanceKlass::signature_index_offset); + int acc_flags = fields->ushort_at(i + instanceKlass::access_flags_offset); symbolOop f_name = cp->symbol_at(name_index); symbolOop f_sig = cp->symbol_at(sig_index); - if (f_sig == vmSymbols::byte_signature() && - f_name == vmSymbols::vmentry_name() && - (acc_flags & JVM_ACC_STATIC) == 0) { - // Adjust the field type from byte to an unmanaged pointer. - assert(fac_ptr->nonstatic_byte_count > 0, ""); - fac_ptr->nonstatic_byte_count -= 1; - (*fields_ptr)->ushort_at_put(i + instanceKlass::signature_index_offset, - word_sig_index); - fac_ptr->nonstatic_word_count += 1; - FieldAllocationType atype = (FieldAllocationType) (*fields_ptr)->ushort_at(i + instanceKlass::low_offset); - assert(atype == NONSTATIC_BYTE, ""); - FieldAllocationType new_atype = NONSTATIC_WORD; - (*fields_ptr)->ushort_at_put(i + instanceKlass::low_offset, new_atype); + if (f_name == vmSymbols::vmentry_name() && (acc_flags & JVM_ACC_STATIC) == 0) { + if (f_sig == vmSymbols::machine_word_signature()) { + // If the signature of vmentry is already changed, we're done. + found_vmentry = true; + break; + } + else if (f_sig == vmSymbols::byte_signature()) { + // Adjust the field type from byte to an unmanaged pointer. + assert(fac_ptr->nonstatic_byte_count > 0, ""); + fac_ptr->nonstatic_byte_count -= 1; - found_vmentry = true; - break; + fields->ushort_at_put(i + instanceKlass::signature_index_offset, word_sig_index); + assert(wordSize == longSize || wordSize == jintSize, "ILP32 or LP64"); + if (wordSize == longSize) fac_ptr->nonstatic_double_count += 1; + else fac_ptr->nonstatic_word_count += 1; + + FieldAllocationType atype = (FieldAllocationType) fields->ushort_at(i + instanceKlass::low_offset); + assert(atype == NONSTATIC_BYTE, ""); + FieldAllocationType new_atype = (wordSize == longSize) ? NONSTATIC_DOUBLE : NONSTATIC_WORD; + fields->ushort_at_put(i + instanceKlass::low_offset, new_atype); + + found_vmentry = true; + break; + } } } if (!found_vmentry) THROW_MSG(vmSymbols::java_lang_VirtualMachineError(), "missing vmentry byte field in java.dyn.MethodHandle"); - } @@ -2749,6 +2867,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, PerfClassTraceTime::PARSE_CLASS); _has_finalizer = _has_empty_finalizer = _has_vanilla_constructor = false; + _max_bootstrap_specifier_index = -1; if (JvmtiExport::should_post_class_file_load_hook()) { unsigned char* ptr = cfs->buffer(); @@ -3080,7 +3199,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, // adjust the vmentry field declaration in java.dyn.MethodHandle if (EnableMethodHandles && class_name() == vmSymbols::sun_dyn_MethodHandleImpl() && class_loader.is_null()) { - java_dyn_MethodHandle_fix_pre(cp, &fields, &fac, CHECK_(nullHandle)); + java_dyn_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle)); } // Add a fake "discovered" field if it is not present @@ -4307,20 +4426,21 @@ int ClassFileParser::verify_legal_method_signature(symbolHandle name, symbolHand } -// Unqualified names may not contain the characters '.', ';', or '/'. -// Method names also may not contain the characters '<' or '>', unless or . -// Note that method names may not be or in this method. -// Because these names have been checked as special cases before calling this method -// in verify_legal_method_name. -bool ClassFileParser::verify_unqualified_name(char* name, unsigned int length, int type) { +// Unqualified names may not contain the characters '.', ';', '[', or '/'. +// Method names also may not contain the characters '<' or '>', unless +// or . Note that method names may not be or in this +// method. Because these names have been checked as special cases before +// calling this method in verify_legal_method_name. +bool ClassFileParser::verify_unqualified_name( + char* name, unsigned int length, int type) { jchar ch; for (char* p = name; p != name + length; ) { ch = *p; if (ch < 128) { p++; - if (ch == '.' || ch == ';') { - return false; // do not permit '.' or ';' + if (ch == '.' || ch == ';' || ch == '[' ) { + return false; // do not permit '.', ';', or '[' } if (type != LegalClass && ch == '/') { return false; // do not permit '/' unless it's class name diff --git a/hotspot/src/share/vm/classfile/classFileParser.hpp b/hotspot/src/share/vm/classfile/classFileParser.hpp index 6bb45809303..f0926978353 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.hpp +++ b/hotspot/src/share/vm/classfile/classFileParser.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#ifndef SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP +#define SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP + +#include "classfile/classFileStream.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" +#include "oops/typeArrayOop.hpp" +#include "runtime/handles.inline.hpp" +#include "utilities/accessFlags.hpp" + // Parser for for .class files // // The bytes describing the class file structure is read from a Stream object @@ -40,6 +50,8 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC { bool _has_empty_finalizer; bool _has_vanilla_constructor; + int _max_bootstrap_specifier_index; + enum { fixed_buffer_size = 128 }; u_char linenumbertable_buffer[fixed_buffer_size]; @@ -117,6 +129,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC { void parse_classfile_attributes(constantPoolHandle cp, instanceKlassHandle k, TRAPS); void parse_classfile_synthetic_attribute(constantPoolHandle cp, instanceKlassHandle k, TRAPS); void parse_classfile_signature_attribute(constantPoolHandle cp, instanceKlassHandle k, TRAPS); + void parse_classfile_bootstrap_methods_attribute(constantPoolHandle cp, instanceKlassHandle k, u4 attribute_length, TRAPS); // Annotations handling typeArrayHandle assemble_annotations(u1* runtime_visible_annotations, @@ -151,7 +164,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC { // Adjust the field allocation counts for java.dyn.MethodHandle to add // a fake address (void*) field. void java_dyn_MethodHandle_fix_pre(constantPoolHandle cp, - typeArrayHandle* fields_ptr, + typeArrayHandle fields, FieldAllocationCount *fac_ptr, TRAPS); // Format checker methods @@ -283,3 +296,5 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC { static void check_final_method_override(instanceKlassHandle this_klass, TRAPS); static void check_illegal_static_method(instanceKlassHandle this_klass, TRAPS); }; + +#endif // SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP diff --git a/hotspot/src/share/vm/classfile/classFileStream.cpp b/hotspot/src/share/vm/classfile/classFileStream.cpp index 9f563049594..19d3e82af42 100644 --- a/hotspot/src/share/vm/classfile/classFileStream.cpp +++ b/hotspot/src/share/vm/classfile/classFileStream.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_classFileStream.cpp.incl" +#include "precompiled.hpp" +#include "classfile/classFileStream.hpp" +#include "classfile/vmSymbols.hpp" void ClassFileStream::truncated_file_error(TRAPS) { THROW_MSG(vmSymbols::java_lang_ClassFormatError(), "Truncated class file"); diff --git a/hotspot/src/share/vm/classfile/classFileStream.hpp b/hotspot/src/share/vm/classfile/classFileStream.hpp index d9a61f84d6d..dfadb7b00db 100644 --- a/hotspot/src/share/vm/classfile/classFileStream.hpp +++ b/hotspot/src/share/vm/classfile/classFileStream.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,20 @@ * */ +#ifndef SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP +#define SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP + +#include "utilities/top.hpp" +#ifdef TARGET_ARCH_x86 +# include "bytes_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "bytes_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "bytes_zero.hpp" +#endif + // Input stream for reading .class file // // The entire input stream is present in a buffer allocated by the caller. @@ -116,3 +130,5 @@ class ClassFileStream: public ResourceObj { // Tells whether eos is reached bool at_eos() const { return _current == _buffer_end; } }; + +#endif // SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp index 1495e87726f..00231243233 100644 --- a/hotspot/src/share/vm/classfile/classLoader.cpp +++ b/hotspot/src/share/vm/classfile/classLoader.cpp @@ -22,8 +22,52 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_classLoader.cpp.incl" +#include "precompiled.hpp" +#include "classfile/classFileParser.hpp" +#include "classfile/classFileStream.hpp" +#include "classfile/classLoader.hpp" +#include "classfile/javaClasses.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "compiler/compileBroker.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "interpreter/bytecodeStream.hpp" +#include "interpreter/oopMapCache.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/generation.hpp" +#include "memory/oopFactory.hpp" +#include "memory/universe.inline.hpp" +#include "oops/constantPoolKlass.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/instanceRefKlass.hpp" +#include "oops/oop.inline.hpp" +#include "oops/symbolOop.hpp" +#include "prims/jvm_misc.hpp" +#include "runtime/arguments.hpp" +#include "runtime/compilationPolicy.hpp" +#include "runtime/fprofiler.hpp" +#include "runtime/handles.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/init.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/threadCritical.hpp" +#include "runtime/timer.hpp" +#include "services/management.hpp" +#include "services/threadService.hpp" +#include "utilities/events.hpp" +#include "utilities/hashtable.hpp" +#include "utilities/hashtable.inline.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "os_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "os_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "os_windows.inline.hpp" +#endif // Entry points in zip.dll for loading zip/jar file entries @@ -160,13 +204,13 @@ ClassFileStream* ClassPathDirEntry::open_stream(const char* name) { struct stat st; if (os::stat(path, &st) == 0) { // found file, open it - int file_handle = hpi::open(path, 0, 0); + int file_handle = os::open(path, 0, 0); if (file_handle != -1) { // read contents into resource array u1* buffer = NEW_RESOURCE_ARRAY(u1, st.st_size); size_t num_read = os::read(file_handle, (char*) buffer, st.st_size); // close file - hpi::close(file_handle); + os::close(file_handle); // construct ClassFileStream if (num_read == (size_t)st.st_size) { if (UsePerfData) { @@ -559,18 +603,18 @@ void ClassLoader::load_zip_library() { // Load zip library char path[JVM_MAXPATHLEN]; char ebuf[1024]; - hpi::dll_build_name(path, sizeof(path), Arguments::get_dll_dir(), "zip"); - void* handle = hpi::dll_load(path, ebuf, sizeof ebuf); + os::dll_build_name(path, sizeof(path), Arguments::get_dll_dir(), "zip"); + void* handle = os::dll_load(path, ebuf, sizeof ebuf); if (handle == NULL) { vm_exit_during_initialization("Unable to load ZIP library", path); } // Lookup zip entry points - ZipOpen = CAST_TO_FN_PTR(ZipOpen_t, hpi::dll_lookup(handle, "ZIP_Open")); - ZipClose = CAST_TO_FN_PTR(ZipClose_t, hpi::dll_lookup(handle, "ZIP_Close")); - FindEntry = CAST_TO_FN_PTR(FindEntry_t, hpi::dll_lookup(handle, "ZIP_FindEntry")); - ReadEntry = CAST_TO_FN_PTR(ReadEntry_t, hpi::dll_lookup(handle, "ZIP_ReadEntry")); - ReadMappedEntry = CAST_TO_FN_PTR(ReadMappedEntry_t, hpi::dll_lookup(handle, "ZIP_ReadMappedEntry")); - GetNextEntry = CAST_TO_FN_PTR(GetNextEntry_t, hpi::dll_lookup(handle, "ZIP_GetNextEntry")); + ZipOpen = CAST_TO_FN_PTR(ZipOpen_t, os::dll_lookup(handle, "ZIP_Open")); + ZipClose = CAST_TO_FN_PTR(ZipClose_t, os::dll_lookup(handle, "ZIP_Close")); + FindEntry = CAST_TO_FN_PTR(FindEntry_t, os::dll_lookup(handle, "ZIP_FindEntry")); + ReadEntry = CAST_TO_FN_PTR(ReadEntry_t, os::dll_lookup(handle, "ZIP_ReadEntry")); + ReadMappedEntry = CAST_TO_FN_PTR(ReadMappedEntry_t, os::dll_lookup(handle, "ZIP_ReadMappedEntry")); + GetNextEntry = CAST_TO_FN_PTR(GetNextEntry_t, os::dll_lookup(handle, "ZIP_GetNextEntry")); // ZIP_Close is not exported on Windows in JDK5.0 so don't abort if ZIP_Close is NULL if (ZipOpen == NULL || FindEntry == NULL || ReadEntry == NULL || GetNextEntry == NULL) { @@ -579,7 +623,7 @@ void ClassLoader::load_zip_library() { // Lookup canonicalize entry in libjava.dll void *javalib_handle = os::native_java_library(); - CanonicalizeEntry = CAST_TO_FN_PTR(canonicalize_fn_t, hpi::dll_lookup(javalib_handle, "Canonicalize")); + CanonicalizeEntry = CAST_TO_FN_PTR(canonicalize_fn_t, os::dll_lookup(javalib_handle, "Canonicalize")); // This lookup only works on 1.3. Do not check for non-null here } @@ -1028,7 +1072,7 @@ bool ClassLoader::get_canonical_path(char* orig, char* out, int len) { assert(orig != NULL && out != NULL && len > 0, "bad arguments"); if (CanonicalizeEntry != NULL) { JNIEnv* env = JavaThread::current()->jni_environment(); - if ((CanonicalizeEntry)(env, hpi::native_path(orig), out, len) < 0) { + if ((CanonicalizeEntry)(env, os::native_path(orig), out, len) < 0) { return false; } } else { diff --git a/hotspot/src/share/vm/classfile/classLoader.hpp b/hotspot/src/share/vm/classfile/classLoader.hpp index ad4f967c662..3c6b215f994 100644 --- a/hotspot/src/share/vm/classfile/classLoader.hpp +++ b/hotspot/src/share/vm/classfile/classLoader.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CLASSFILE_CLASSLOADER_HPP +#define SHARE_VM_CLASSFILE_CLASSLOADER_HPP + +#include "classfile/classFileParser.hpp" +#include "runtime/perfData.hpp" + // The VM class loader. #include @@ -456,3 +462,5 @@ class PerfClassTraceTime { } }; + +#endif // SHARE_VM_CLASSFILE_CLASSLOADER_HPP diff --git a/hotspot/src/share/vm/classfile/dictionary.cpp b/hotspot/src/share/vm/classfile/dictionary.cpp index 155a51cb5f5..cff89e66a36 100644 --- a/hotspot/src/share/vm/classfile/dictionary.cpp +++ b/hotspot/src/share/vm/classfile/dictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_dictionary.cpp.incl" +#include "precompiled.hpp" +#include "classfile/dictionary.hpp" +#include "classfile/systemDictionary.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiRedefineClassesTrace.hpp" +#include "services/classLoadingService.hpp" +#include "utilities/hashtable.inline.hpp" DictionaryEntry* Dictionary::_current_class_entry = NULL; diff --git a/hotspot/src/share/vm/classfile/dictionary.hpp b/hotspot/src/share/vm/classfile/dictionary.hpp index 53c4001bc9b..bc6a009b511 100644 --- a/hotspot/src/share/vm/classfile/dictionary.hpp +++ b/hotspot/src/share/vm/classfile/dictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_CLASSFILE_DICTIONARY_HPP +#define SHARE_VM_CLASSFILE_DICTIONARY_HPP + +#include "classfile/systemDictionary.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/oop.hpp" +#include "utilities/hashtable.hpp" + class DictionaryEntry; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -336,3 +344,5 @@ public: void verify(); }; + +#endif // SHARE_VM_CLASSFILE_DICTIONARY_HPP diff --git a/hotspot/src/share/vm/classfile/javaAssertions.cpp b/hotspot/src/share/vm/classfile/javaAssertions.cpp index 4315f8cc704..0c64222cb60 100644 --- a/hotspot/src/share/vm/classfile/javaAssertions.cpp +++ b/hotspot/src/share/vm/classfile/javaAssertions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,15 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_javaAssertions.cpp.incl" +#include "precompiled.hpp" +#include "classfile/javaAssertions.hpp" +#include "classfile/javaClasses.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/oopFactory.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" bool JavaAssertions::_userDefault = false; bool JavaAssertions::_sysDefault = false; diff --git a/hotspot/src/share/vm/classfile/javaAssertions.hpp b/hotspot/src/share/vm/classfile/javaAssertions.hpp index a11f2e5d9aa..b0fb21a2d07 100644 --- a/hotspot/src/share/vm/classfile/javaAssertions.hpp +++ b/hotspot/src/share/vm/classfile/javaAssertions.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_CLASSFILE_JAVAASSERTIONS_HPP +#define SHARE_VM_CLASSFILE_JAVAASSERTIONS_HPP + +#include "oops/objArrayOop.hpp" +#include "oops/typeArrayOop.hpp" +#include "utilities/exceptions.hpp" +#include "utilities/ostream.hpp" + class JavaAssertions: AllStatic { public: static inline bool userClassDefault(); @@ -95,3 +103,5 @@ inline void JavaAssertions::setSystemClassDefault(bool enabled) { tty->print_cr("JavaAssertions::setSystemClassDefault(%d)", enabled); _sysDefault = enabled; } + +#endif // SHARE_VM_CLASSFILE_JAVAASSERTIONS_HPP diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index fd9e42d7169..8eee5de5448 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,39 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_javaClasses.cpp.incl" +#include "precompiled.hpp" +#include "classfile/javaClasses.hpp" +#include "classfile/symbolTable.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/debugInfo.hpp" +#include "code/pcDesc.hpp" +#include "interpreter/interpreter.hpp" +#include "memory/oopFactory.hpp" +#include "memory/resourceArea.hpp" +#include "memory/universe.inline.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/klass.hpp" +#include "oops/klassOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/symbolOop.hpp" +#include "oops/typeArrayOop.hpp" +#include "runtime/fieldDescriptor.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/safepoint.hpp" +#include "runtime/vframe.hpp" +#include "utilities/preserveException.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif static bool find_field(instanceKlass* ik, symbolOop name_symbol, symbolOop signature_symbol, @@ -151,7 +182,7 @@ Handle java_lang_String::create_from_platform_dependent_str(const char* str, TRA if (_to_java_string_fn == NULL) { void *lib_handle = os::native_java_library(); - _to_java_string_fn = CAST_TO_FN_PTR(to_java_string_fn_t, hpi::dll_lookup(lib_handle, "NewStringPlatform")); + _to_java_string_fn = CAST_TO_FN_PTR(to_java_string_fn_t, os::dll_lookup(lib_handle, "NewStringPlatform")); if (_to_java_string_fn == NULL) { fatal("NewStringPlatform missing"); } @@ -176,7 +207,7 @@ char* java_lang_String::as_platform_dependent_str(Handle java_string, TRAPS) { if (_to_platform_string_fn == NULL) { void *lib_handle = os::native_java_library(); - _to_platform_string_fn = CAST_TO_FN_PTR(to_platform_string_fn_t, hpi::dll_lookup(lib_handle, "GetStringPlatformChars")); + _to_platform_string_fn = CAST_TO_FN_PTR(to_platform_string_fn_t, os::dll_lookup(lib_handle, "GetStringPlatformChars")); if (_to_platform_string_fn == NULL) { fatal("GetStringPlatformChars missing"); } @@ -282,6 +313,14 @@ char* java_lang_String::as_utf8_string(oop java_string) { return UNICODE::as_utf8(position, length); } +char* java_lang_String::as_utf8_string(oop java_string, char* buf, int buflen) { + typeArrayOop value = java_lang_String::value(java_string); + int offset = java_lang_String::offset(java_string); + int length = java_lang_String::length(java_string); + jchar* position = (length == 0) ? NULL : value->char_at_addr(offset); + return UNICODE::as_utf8(position, length, buf, buflen); +} + char* java_lang_String::as_utf8_string(oop java_string, int start, int len) { typeArrayOop value = java_lang_String::value(java_string); int offset = java_lang_String::offset(java_string); diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 7cd03c1d468..bb65db96158 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,15 @@ * */ +#ifndef SHARE_VM_CLASSFILE_JAVACLASSES_HPP +#define SHARE_VM_CLASSFILE_JAVACLASSES_HPP + +#include "classfile/systemDictionary.hpp" +#include "jvmtifiles/jvmti.h" +#include "oops/oop.hpp" +#include "runtime/os.hpp" +#include "utilities/utf8.hpp" + // Interface for manipulating the basic Java classes. // // All dependencies on layout of actual Java classes should be kept here. @@ -95,6 +104,7 @@ class java_lang_String : AllStatic { // String converters static char* as_utf8_string(oop java_string); + static char* as_utf8_string(oop java_string, char* buf, int buflen); static char* as_utf8_string(oop java_string, int start, int len); static char* as_platform_dependent_str(Handle java_string, TRAPS); static jchar* as_unicode_string(oop java_string, int& length); @@ -1271,3 +1281,5 @@ class JavaClasses : AllStatic { static void compute_offsets(); static void check_offsets() PRODUCT_RETURN; }; + +#endif // SHARE_VM_CLASSFILE_JAVACLASSES_HPP diff --git a/hotspot/src/share/vm/classfile/loaderConstraints.cpp b/hotspot/src/share/vm/classfile/loaderConstraints.cpp index 9f03cec609e..cd608191169 100644 --- a/hotspot/src/share/vm/classfile/loaderConstraints.cpp +++ b/hotspot/src/share/vm/classfile/loaderConstraints.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_loaderConstraints.cpp.incl" +#include "precompiled.hpp" +#include "classfile/loaderConstraints.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/safepoint.hpp" +#include "utilities/hashtable.inline.hpp" LoaderConstraintTable::LoaderConstraintTable(int nof_buckets) : Hashtable(nof_buckets, sizeof(LoaderConstraintEntry)) {}; diff --git a/hotspot/src/share/vm/classfile/loaderConstraints.hpp b/hotspot/src/share/vm/classfile/loaderConstraints.hpp index 001469d72c7..c6dd29ae639 100644 --- a/hotspot/src/share/vm/classfile/loaderConstraints.hpp +++ b/hotspot/src/share/vm/classfile/loaderConstraints.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_CLASSFILE_LOADERCONSTRAINTS_HPP +#define SHARE_VM_CLASSFILE_LOADERCONSTRAINTS_HPP + +#include "classfile/dictionary.hpp" +#include "classfile/placeholders.hpp" +#include "utilities/hashtable.hpp" + class LoaderConstraintEntry; class LoaderConstraintTable : public Hashtable { @@ -130,3 +137,5 @@ public: void set_loader(int i, oop p) { _loaders[i] = p; } }; + +#endif // SHARE_VM_CLASSFILE_LOADERCONSTRAINTS_HPP diff --git a/hotspot/src/share/vm/classfile/placeholders.cpp b/hotspot/src/share/vm/classfile/placeholders.cpp index beda19481c1..6deba4f1bc3 100644 --- a/hotspot/src/share/vm/classfile/placeholders.cpp +++ b/hotspot/src/share/vm/classfile/placeholders.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_placeholders.cpp.incl" +#include "precompiled.hpp" +#include "classfile/placeholders.hpp" +#include "classfile/systemDictionary.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/fieldType.hpp" +#include "utilities/hashtable.inline.hpp" // Placeholder methods diff --git a/hotspot/src/share/vm/classfile/placeholders.hpp b/hotspot/src/share/vm/classfile/placeholders.hpp index e0aa4da4f28..82c7aaffff8 100644 --- a/hotspot/src/share/vm/classfile/placeholders.hpp +++ b/hotspot/src/share/vm/classfile/placeholders.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CLASSFILE_PLACEHOLDERS_HPP +#define SHARE_VM_CLASSFILE_PLACEHOLDERS_HPP + +#include "runtime/thread.hpp" +#include "utilities/hashtable.hpp" + class PlaceholderEntry; // Placeholder objects. These represent classes currently @@ -329,3 +335,5 @@ class PlaceholderEntry : public HashtableEntry { void print() const PRODUCT_RETURN; void verify() const; }; + +#endif // SHARE_VM_CLASSFILE_PLACEHOLDERS_HPP diff --git a/hotspot/src/share/vm/classfile/resolutionErrors.cpp b/hotspot/src/share/vm/classfile/resolutionErrors.cpp index 1ebd22e1620..1de360541ad 100644 --- a/hotspot/src/share/vm/classfile/resolutionErrors.cpp +++ b/hotspot/src/share/vm/classfile/resolutionErrors.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_resolutionErrors.cpp.incl" +#include "precompiled.hpp" +#include "classfile/resolutionErrors.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/safepoint.hpp" +#include "utilities/hashtable.inline.hpp" // add new entry to the table void ResolutionErrorTable::add_entry(int index, unsigned int hash, diff --git a/hotspot/src/share/vm/classfile/resolutionErrors.hpp b/hotspot/src/share/vm/classfile/resolutionErrors.hpp index 84676228537..03786afd59b 100644 --- a/hotspot/src/share/vm/classfile/resolutionErrors.hpp +++ b/hotspot/src/share/vm/classfile/resolutionErrors.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CLASSFILE_RESOLUTIONERRORS_HPP +#define SHARE_VM_CLASSFILE_RESOLUTIONERRORS_HPP + +#include "oops/constantPoolOop.hpp" +#include "utilities/hashtable.hpp" + class ResolutionErrorEntry; // ResolutionError objects are used to record errors encountered during @@ -97,3 +103,5 @@ class ResolutionErrorEntry : public HashtableEntry { // GC support void oops_do(OopClosure* blk); }; + +#endif // SHARE_VM_CLASSFILE_RESOLUTIONERRORS_HPP diff --git a/hotspot/src/share/vm/classfile/stackMapFrame.cpp b/hotspot/src/share/vm/classfile/stackMapFrame.cpp index d473755a532..702d4f2578b 100644 --- a/hotspot/src/share/vm/classfile/stackMapFrame.cpp +++ b/hotspot/src/share/vm/classfile/stackMapFrame.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,14 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_stackMapFrame.cpp.incl" +#include "precompiled.hpp" +#include "classfile/stackMapFrame.hpp" +#include "classfile/verifier.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" +#include "oops/symbolOop.hpp" +#include "runtime/handles.inline.hpp" +#include "utilities/globalDefinitions.hpp" StackMapFrame::StackMapFrame(u2 max_locals, u2 max_stack, ClassVerifier* v) : _offset(0), _locals_size(0), _stack_size(0), _flags(0), diff --git a/hotspot/src/share/vm/classfile/stackMapFrame.hpp b/hotspot/src/share/vm/classfile/stackMapFrame.hpp index deb5b01649b..5a21fbea5d6 100644 --- a/hotspot/src/share/vm/classfile/stackMapFrame.hpp +++ b/hotspot/src/share/vm/classfile/stackMapFrame.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#ifndef SHARE_VM_CLASSFILE_STACKMAPFRAME_HPP +#define SHARE_VM_CLASSFILE_STACKMAPFRAME_HPP + +#include "classfile/verificationType.hpp" +#include "classfile/verifier.hpp" +#include "oops/methodOop.hpp" +#include "runtime/handles.hpp" +#include "runtime/signature.hpp" +#include "utilities/exceptions.hpp" + // A StackMapFrame represents one frame in the stack map attribute. enum { @@ -224,3 +234,5 @@ class StackMapFrame : public ResourceObj { // Debugging void print() const PRODUCT_RETURN; }; + +#endif // SHARE_VM_CLASSFILE_STACKMAPFRAME_HPP diff --git a/hotspot/src/share/vm/classfile/stackMapTable.cpp b/hotspot/src/share/vm/classfile/stackMapTable.cpp index e34fc5948aa..ae0b10f8d5d 100644 --- a/hotspot/src/share/vm/classfile/stackMapTable.cpp +++ b/hotspot/src/share/vm/classfile/stackMapTable.cpp @@ -22,8 +22,13 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_stackMapTable.cpp.incl" +#include "precompiled.hpp" +#include "classfile/stackMapTable.hpp" +#include "classfile/verifier.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/fieldType.hpp" +#include "runtime/handles.inline.hpp" StackMapTable::StackMapTable(StackMapReader* reader, StackMapFrame* init_frame, u2 max_locals, u2 max_stack, diff --git a/hotspot/src/share/vm/classfile/stackMapTable.hpp b/hotspot/src/share/vm/classfile/stackMapTable.hpp index 59898233190..96115b40e15 100644 --- a/hotspot/src/share/vm/classfile/stackMapTable.hpp +++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,24 @@ * */ +#ifndef SHARE_VM_CLASSFILE_STACKMAPTABLE_HPP +#define SHARE_VM_CLASSFILE_STACKMAPTABLE_HPP + +#include "classfile/stackMapFrame.hpp" +#include "memory/allocation.hpp" +#include "oops/constantPoolOop.hpp" +#include "oops/methodOop.hpp" +#include "utilities/globalDefinitions.hpp" +#ifdef TARGET_ARCH_x86 +# include "bytes_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "bytes_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "bytes_zero.hpp" +#endif + class StackMapReader; // StackMapTable class is the StackMap table used by type checker @@ -159,3 +177,5 @@ class StackMapReader : StackObj { } } }; + +#endif // SHARE_VM_CLASSFILE_STACKMAPTABLE_HPP diff --git a/hotspot/src/share/vm/classfile/stackMapTableFormat.hpp b/hotspot/src/share/vm/classfile/stackMapTableFormat.hpp new file mode 100644 index 00000000000..b8a4b4268e4 --- /dev/null +++ b/hotspot/src/share/vm/classfile/stackMapTableFormat.hpp @@ -0,0 +1,923 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_CLASSFILE_STACKMAPTABLEFORMAT_HPP +#define SHARE_VM_CLASSFILE_STACKMAPTABLEFORMAT_HPP + +#include "classfile/verificationType.hpp" + +// These classes represent the stack-map substructures described in the JVMS +// (hence the non-conforming naming scheme). + +// These classes work with the types in their compressed form in-place (as they +// would appear in the classfile). No virtual methods or fields allowed. + +class verification_type_info { + private: + // u1 tag + // u2 cpool_index || u2 bci (for ITEM_Object & ITEM_Uninitailized only) + + address tag_addr() const { return (address)this; } + address cpool_index_addr() const { return tag_addr() + sizeof(u1); } + address bci_addr() const { return cpool_index_addr(); } + + protected: + // No constructors - should be 'private', but GCC issues a warning if it is + verification_type_info() {} + verification_type_info(const verification_type_info&) {} + + public: + + static verification_type_info* at(address addr) { + return (verification_type_info*)addr; + } + + static verification_type_info* create_at(address addr, u1 tag) { + verification_type_info* vti = (verification_type_info*)addr; + vti->set_tag(tag); + return vti; + } + + static verification_type_info* create_object_at(address addr, u2 cp_idx) { + verification_type_info* vti = (verification_type_info*)addr; + vti->set_tag(ITEM_Object); + vti->set_cpool_index(cp_idx); + return vti; + } + + static verification_type_info* create_uninit_at(address addr, u2 bci) { + verification_type_info* vti = (verification_type_info*)addr; + vti->set_tag(ITEM_Uninitialized); + vti->set_bci(bci); + return vti; + } + + static size_t calculate_size(u1 tag) { + if (tag == ITEM_Object || tag == ITEM_Uninitialized) { + return sizeof(u1) + sizeof(u2); + } else { + return sizeof(u1); + } + } + + static size_t max_size() { return sizeof(u1) + sizeof(u2); } + + u1 tag() const { return *(u1*)tag_addr(); } + void set_tag(u1 tag) { *((u1*)tag_addr()) = tag; } + + bool is_object() const { return tag() == ITEM_Object; } + bool is_uninitialized() const { return tag() == ITEM_Uninitialized; } + + u2 cpool_index() const { + assert(is_object(), "This type has no cp_index"); + return Bytes::get_Java_u2(cpool_index_addr()); + } + void set_cpool_index(u2 idx) { + assert(is_object(), "This type has no cp_index"); + Bytes::put_Java_u2(cpool_index_addr(), idx); + } + + u2 bci() const { + assert(is_uninitialized(), "This type has no bci"); + return Bytes::get_Java_u2(bci_addr()); + } + + void set_bci(u2 bci) { + assert(is_uninitialized(), "This type has no bci"); + Bytes::put_Java_u2(bci_addr(), bci); + } + + void copy_from(verification_type_info* from) { + set_tag(from->tag()); + if (from->is_object()) { + set_cpool_index(from->cpool_index()); + } else if (from->is_uninitialized()) { + set_bci(from->bci()); + } + } + + size_t size() const { + return calculate_size(tag()); + } + + verification_type_info* next() { + return (verification_type_info*)((address)this + size()); + } + + // This method is used when reading unverified data in order to ensure + // that we don't read past a particular memory limit. It returns false + // if any part of the data structure is outside the specified memory bounds. + bool verify(address start, address end) { + return ((address)this >= start && + (address)this < end && + (bci_addr() + sizeof(u2) <= end || + !is_object() && !is_uninitialized())); + } + +#ifdef ASSERT + void print_on(outputStream* st) { + switch (tag()) { + case ITEM_Top: st->print("Top"); break; + case ITEM_Integer: st->print("Integer"); break; + case ITEM_Float: st->print("Float"); break; + case ITEM_Double: st->print("Double"); break; + case ITEM_Long: st->print("Long"); break; + case ITEM_Null: st->print("Null"); break; + case ITEM_UninitializedThis: + st->print("UninitializedThis"); break; + case ITEM_Uninitialized: + st->print("Uninitialized[#%d]", bci()); break; + case ITEM_Object: + st->print("Object[#%d]", cpool_index()); break; + default: + assert(false, "Bad verification_type_info"); + } + } +#endif +}; + +#define FOR_EACH_STACKMAP_FRAME_TYPE(macro, arg1, arg2) \ + macro(same_frame, arg1, arg2) \ + macro(same_frame_extended, arg1, arg2) \ + macro(same_frame_1_stack_item_frame, arg1, arg2) \ + macro(same_frame_1_stack_item_extended, arg1, arg2) \ + macro(chop_frame, arg1, arg2) \ + macro(append_frame, arg1, arg2) \ + macro(full_frame, arg1, arg2) + +#define SM_FORWARD_DECL(type, arg1, arg2) class type; +FOR_EACH_STACKMAP_FRAME_TYPE(SM_FORWARD_DECL, x, x) +#undef SM_FORWARD_DECL + +class stack_map_frame { + protected: + address frame_type_addr() const { return (address)this; } + + // No constructors - should be 'private', but GCC issues a warning if it is + stack_map_frame() {} + stack_map_frame(const stack_map_frame&) {} + + public: + + static stack_map_frame* at(address addr) { + return (stack_map_frame*)addr; + } + + stack_map_frame* next() const { + return at((address)this + size()); + } + + u1 frame_type() const { return *(u1*)frame_type_addr(); } + void set_frame_type(u1 type) { *((u1*)frame_type_addr()) = type; } + + // pseudo-virtual methods + inline size_t size() const; + inline int offset_delta() const; + inline void set_offset_delta(int offset_delta); + inline int number_of_types() const; // number of types contained in the frame + inline verification_type_info* types() const; // pointer to first type + inline bool is_valid_offset(int offset_delta) const; + + // This method must be used when reading unverified data in order to ensure + // that we don't read past a particular memory limit. It returns false + // if any part of the data structure is outside the specified memory bounds. + inline bool verify(address start, address end) const; +#ifdef ASSERT + inline void print_on(outputStream* st) const; +#endif + + // Create as_xxx and is_xxx methods for the subtypes +#define FRAME_TYPE_DECL(stackmap_frame_type, arg1, arg2) \ + inline stackmap_frame_type* as_##stackmap_frame_type() const; \ + bool is_##stackmap_frame_type() { \ + return as_##stackmap_frame_type() != NULL; \ + } + + FOR_EACH_STACKMAP_FRAME_TYPE(FRAME_TYPE_DECL, x, x) +#undef FRAME_TYPE_DECL +}; + +class same_frame : public stack_map_frame { + private: + static int frame_type_to_offset_delta(u1 frame_type) { + return frame_type + 1; } + static u1 offset_delta_to_frame_type(int offset_delta) { + return (u1)(offset_delta - 1); } + + public: + + static bool is_frame_type(u1 tag) { + return tag < 64; + } + + static same_frame* at(address addr) { + assert(is_frame_type(*addr), "Wrong frame id"); + return (same_frame*)addr; + } + + static same_frame* create_at(address addr, int offset_delta) { + same_frame* sm = (same_frame*)addr; + sm->set_offset_delta(offset_delta); + return sm; + } + + static size_t calculate_size() { return sizeof(u1); } + + size_t size() const { return calculate_size(); } + int offset_delta() const { return frame_type_to_offset_delta(frame_type()); } + + void set_offset_delta(int offset_delta) { + assert(offset_delta <= 64, "Offset too large for same_frame"); + set_frame_type(offset_delta_to_frame_type(offset_delta)); + } + + int number_of_types() const { return 0; } + verification_type_info* types() const { return NULL; } + + bool is_valid_offset(int offset_delta) const { + return is_frame_type(offset_delta_to_frame_type(offset_delta)); + } + + bool verify_subtype(address start, address end) const { + return true; + } + +#ifdef ASSERT + void print_on(outputStream* st) const { + st->print("same_frame(%d)", offset_delta()); + } +#endif +}; + +class same_frame_extended : public stack_map_frame { + private: + enum { _frame_id = 251 }; + address offset_delta_addr() const { return frame_type_addr() + sizeof(u1); } + + public: + static bool is_frame_type(u1 tag) { + return tag == _frame_id; + } + + static same_frame_extended* at(address addr) { + assert(is_frame_type(*addr), "Wrong frame type"); + return (same_frame_extended*)addr; + } + + static same_frame_extended* create_at(address addr, u2 offset_delta) { + same_frame_extended* sm = (same_frame_extended*)addr; + sm->set_frame_type(_frame_id); + sm->set_offset_delta(offset_delta); + return sm; + } + + static size_t calculate_size() { return sizeof(u1) + sizeof(u2); } + + size_t size() const { return calculate_size(); } + int offset_delta() const { + return Bytes::get_Java_u2(offset_delta_addr()) + 1; + } + + void set_offset_delta(int offset_delta) { + Bytes::put_Java_u2(offset_delta_addr(), offset_delta - 1); + } + + int number_of_types() const { return 0; } + verification_type_info* types() const { return NULL; } + bool is_valid_offset(int offset) const { return true; } + + bool verify_subtype(address start, address end) const { + return frame_type_addr() + size() <= end; + } + +#ifdef ASSERT + void print_on(outputStream* st) const { + st->print("same_frame_extended(%d)", offset_delta()); + } +#endif +}; + +class same_frame_1_stack_item_frame : public stack_map_frame { + private: + address type_addr() const { return frame_type_addr() + sizeof(u1); } + + static int frame_type_to_offset_delta(u1 frame_type) { + return frame_type - 63; } + static u1 offset_delta_to_frame_type(int offset_delta) { + return (u1)(offset_delta + 63); } + + public: + static bool is_frame_type(u1 tag) { + return tag >= 64 && tag < 128; + } + + static same_frame_1_stack_item_frame* at(address addr) { + assert(is_frame_type(*addr), "Wrong frame id"); + return (same_frame_1_stack_item_frame*)addr; + } + + static same_frame_1_stack_item_frame* create_at( + address addr, int offset_delta, verification_type_info* vti) { + same_frame_1_stack_item_frame* sm = (same_frame_1_stack_item_frame*)addr; + sm->set_offset_delta(offset_delta); + if (vti != NULL) { + sm->set_type(vti); + } + return sm; + } + + static size_t calculate_size(verification_type_info* vti) { + return sizeof(u1) + vti->size(); + } + + static size_t max_size() { + return sizeof(u1) + verification_type_info::max_size(); + } + + size_t size() const { return calculate_size(types()); } + int offset_delta() const { return frame_type_to_offset_delta(frame_type()); } + + void set_offset_delta(int offset_delta) { + assert(offset_delta > 0 && offset_delta <= 64, + "Offset too large for this frame type"); + set_frame_type(offset_delta_to_frame_type(offset_delta)); + } + + void set_type(verification_type_info* vti) { + verification_type_info* cur = types(); + cur->copy_from(vti); + } + + int number_of_types() const { return 1; } + verification_type_info* types() const { + return verification_type_info::at(type_addr()); + } + + bool is_valid_offset(int offset_delta) const { + return is_frame_type(offset_delta_to_frame_type(offset_delta)); + } + + bool verify_subtype(address start, address end) const { + return types()->verify(start, end); + } + +#ifdef ASSERT + void print_on(outputStream* st) const { + st->print("same_frame_1_stack_item_frame(%d,", offset_delta()); + types()->print_on(st); + st->print(")"); + } +#endif +}; + +class same_frame_1_stack_item_extended : public stack_map_frame { + private: + address offset_delta_addr() const { return frame_type_addr() + sizeof(u1); } + address type_addr() const { return offset_delta_addr() + sizeof(u2); } + + enum { _frame_id = 247 }; + + public: + static bool is_frame_type(u1 tag) { + return tag == _frame_id; + } + + static same_frame_1_stack_item_extended* at(address addr) { + assert(is_frame_type(*addr), "Wrong frame id"); + return (same_frame_1_stack_item_extended*)addr; + } + + static same_frame_1_stack_item_extended* create_at( + address addr, int offset_delta, verification_type_info* vti) { + same_frame_1_stack_item_extended* sm = + (same_frame_1_stack_item_extended*)addr; + sm->set_frame_type(_frame_id); + sm->set_offset_delta(offset_delta); + if (vti != NULL) { + sm->set_type(vti); + } + return sm; + } + + static size_t calculate_size(verification_type_info* vti) { + return sizeof(u1) + sizeof(u2) + vti->size(); + } + + size_t size() const { return calculate_size(types()); } + int offset_delta() const { + return Bytes::get_Java_u2(offset_delta_addr()) + 1; + } + + void set_offset_delta(int offset_delta) { + Bytes::put_Java_u2(offset_delta_addr(), offset_delta - 1); + } + + void set_type(verification_type_info* vti) { + verification_type_info* cur = types(); + cur->copy_from(vti); + } + + int number_of_types() const { return 1; } + verification_type_info* types() const { + return verification_type_info::at(type_addr()); + } + bool is_valid_offset(int offset) { return true; } + + bool verify_subtype(address start, address end) const { + return type_addr() < end && types()->verify(start, end); + } + +#ifdef ASSERT + void print_on(outputStream* st) const { + st->print("same_frame_1_stack_item_extended(%d,", offset_delta()); + types()->print_on(st); + st->print(")"); + } +#endif +}; + +class chop_frame : public stack_map_frame { + private: + address offset_delta_addr() const { return frame_type_addr() + sizeof(u1); } + + static int frame_type_to_chops(u1 frame_type) { + int chop = 251 - frame_type; + return chop; + } + + static u1 chops_to_frame_type(int chop) { + return 251 - chop; + } + + public: + static bool is_frame_type(u1 tag) { + return frame_type_to_chops(tag) > 0 && frame_type_to_chops(tag) < 4; + } + + static chop_frame* at(address addr) { + assert(is_frame_type(*addr), "Wrong frame id"); + return (chop_frame*)addr; + } + + static chop_frame* create_at(address addr, int offset_delta, int chops) { + chop_frame* sm = (chop_frame*)addr; + sm->set_chops(chops); + sm->set_offset_delta(offset_delta); + return sm; + } + + static size_t calculate_size() { + return sizeof(u1) + sizeof(u2); + } + + size_t size() const { return calculate_size(); } + int offset_delta() const { + return Bytes::get_Java_u2(offset_delta_addr()) + 1; + } + void set_offset_delta(int offset_delta) { + Bytes::put_Java_u2(offset_delta_addr(), offset_delta - 1); + } + + int chops() const { + int chops = frame_type_to_chops(frame_type()); + assert(chops > 0 && chops < 4, "Invalid number of chops in frame"); + return chops; + } + void set_chops(int chops) { + assert(chops > 0 && chops <= 3, "Bad number of chops"); + set_frame_type(chops_to_frame_type(chops)); + } + + int number_of_types() const { return 0; } + verification_type_info* types() const { return NULL; } + bool is_valid_offset(int offset) { return true; } + + bool verify_subtype(address start, address end) const { + return frame_type_addr() + size() <= end; + } + +#ifdef ASSERT + void print_on(outputStream* st) const { + st->print("chop_frame(%d,%d)", offset_delta(), chops()); + } +#endif +}; + +class append_frame : public stack_map_frame { + private: + address offset_delta_addr() const { return frame_type_addr() + sizeof(u1); } + address types_addr() const { return offset_delta_addr() + sizeof(u2); } + + static int frame_type_to_appends(u1 frame_type) { + int append = frame_type - 251; + return append; + } + + static u1 appends_to_frame_type(int appends) { + assert(appends > 0 && appends < 4, "Invalid append amount"); + return 251 + appends; + } + + public: + static bool is_frame_type(u1 tag) { + return frame_type_to_appends(tag) > 0 && frame_type_to_appends(tag) < 4; + } + + static append_frame* at(address addr) { + assert(is_frame_type(*addr), "Wrong frame id"); + return (append_frame*)addr; + } + + static append_frame* create_at( + address addr, int offset_delta, int appends, + verification_type_info* types) { + append_frame* sm = (append_frame*)addr; + sm->set_appends(appends); + sm->set_offset_delta(offset_delta); + if (types != NULL) { + verification_type_info* cur = sm->types(); + for (int i = 0; i < appends; ++i) { + cur->copy_from(types); + cur = cur->next(); + types = types->next(); + } + } + return sm; + } + + static size_t calculate_size(int appends, verification_type_info* types) { + size_t sz = sizeof(u1) + sizeof(u2); + for (int i = 0; i < appends; ++i) { + sz += types->size(); + types = types->next(); + } + return sz; + } + + static size_t max_size() { + return sizeof(u1) + sizeof(u2) + 3 * verification_type_info::max_size(); + } + + size_t size() const { return calculate_size(number_of_types(), types()); } + int offset_delta() const { + return Bytes::get_Java_u2(offset_delta_addr()) + 1; + } + + void set_offset_delta(int offset_delta) { + Bytes::put_Java_u2(offset_delta_addr(), offset_delta - 1); + } + + void set_appends(int appends) { + assert(appends > 0 && appends < 4, "Bad number of appends"); + set_frame_type(appends_to_frame_type(appends)); + } + + int number_of_types() const { + int appends = frame_type_to_appends(frame_type()); + assert(appends > 0 && appends < 4, "Invalid number of appends in frame"); + return appends; + } + verification_type_info* types() const { + return verification_type_info::at(types_addr()); + } + bool is_valid_offset(int offset) const { return true; } + + bool verify_subtype(address start, address end) const { + verification_type_info* vti = types(); + if ((address)vti < end && vti->verify(start, end)) { + int nof = number_of_types(); + vti = vti->next(); + if (nof < 2 || vti->verify(start, end)) { + vti = vti->next(); + if (nof < 3 || vti->verify(start, end)) { + return true; + } + } + } + return false; + } + +#ifdef ASSERT + void print_on(outputStream* st) const { + st->print("append_frame(%d,", offset_delta()); + verification_type_info* vti = types(); + for (int i = 0; i < number_of_types(); ++i) { + vti->print_on(st); + if (i != number_of_types() - 1) { + st->print(","); + } + vti = vti->next(); + } + st->print(")"); + } +#endif +}; + +class full_frame : public stack_map_frame { + private: + address offset_delta_addr() const { return frame_type_addr() + sizeof(u1); } + address num_locals_addr() const { return offset_delta_addr() + sizeof(u2); } + address locals_addr() const { return num_locals_addr() + sizeof(u2); } + address stack_slots_addr(address end_of_locals) const { + return end_of_locals; } + address stack_addr(address end_of_locals) const { + return stack_slots_addr(end_of_locals) + sizeof(u2); } + + enum { _frame_id = 255 }; + + public: + static bool is_frame_type(u1 tag) { + return tag == _frame_id; + } + + static full_frame* at(address addr) { + assert(is_frame_type(*addr), "Wrong frame id"); + return (full_frame*)addr; + } + + static full_frame* create_at( + address addr, int offset_delta, int num_locals, + verification_type_info* locals, + int stack_slots, verification_type_info* stack) { + full_frame* sm = (full_frame*)addr; + sm->set_frame_type(_frame_id); + sm->set_offset_delta(offset_delta); + sm->set_num_locals(num_locals); + if (locals != NULL) { + verification_type_info* cur = sm->locals(); + for (int i = 0; i < num_locals; ++i) { + cur->copy_from(locals); + cur = cur->next(); + locals = locals->next(); + } + address end_of_locals = (address)cur; + sm->set_stack_slots(end_of_locals, stack_slots); + cur = sm->stack(end_of_locals); + for (int i = 0; i < stack_slots; ++i) { + cur->copy_from(stack); + cur = cur->next(); + stack = stack->next(); + } + } + return sm; + } + + static size_t calculate_size( + int num_locals, verification_type_info* locals, + int stack_slots, verification_type_info* stack) { + size_t sz = sizeof(u1) + sizeof(u2) + sizeof(u2) + sizeof(u2); + verification_type_info* vti = locals; + for (int i = 0; i < num_locals; ++i) { + sz += vti->size(); + vti = vti->next(); + } + vti = stack; + for (int i = 0; i < stack_slots; ++i) { + sz += vti->size(); + vti = vti->next(); + } + return sz; + } + + static size_t max_size(int locals, int stack) { + return sizeof(u1) + 3 * sizeof(u2) + + (locals + stack) * verification_type_info::max_size(); + } + + size_t size() const { + address eol = end_of_locals(); + return calculate_size(num_locals(), locals(), stack_slots(eol), stack(eol)); + } + + int offset_delta() const { + return Bytes::get_Java_u2(offset_delta_addr()) + 1; + } + int num_locals() const { return Bytes::get_Java_u2(num_locals_addr()); } + verification_type_info* locals() const { + return verification_type_info::at(locals_addr()); + } + address end_of_locals() const { + verification_type_info* vti = locals(); + for (int i = 0; i < num_locals(); ++i) { + vti = vti->next(); + } + return (address)vti; + } + int stack_slots(address end_of_locals) const { + return Bytes::get_Java_u2(stack_slots_addr(end_of_locals)); + } + verification_type_info* stack(address end_of_locals) const { + return verification_type_info::at(stack_addr(end_of_locals)); + } + + void set_offset_delta(int offset_delta) { + Bytes::put_Java_u2(offset_delta_addr(), offset_delta - 1); + } + void set_num_locals(int num_locals) { + Bytes::put_Java_u2(num_locals_addr(), num_locals); + } + void set_stack_slots(address end_of_locals, int stack_slots) { + Bytes::put_Java_u2(stack_slots_addr(end_of_locals), stack_slots); + } + + // These return only the locals. Extra processing is required for stack + // types of full frames. + int number_of_types() const { return num_locals(); } + verification_type_info* types() const { return locals(); } + bool is_valid_offset(int offset) { return true; } + + bool verify_subtype(address start, address end) const { + verification_type_info* vti = types(); + if ((address)vti >= end) { + return false; + } + int count = number_of_types(); + for (int i = 0; i < count; ++i) { + if (!vti->verify(start, end)) { + return false; + } + vti = vti->next(); + } + address eol = (address)vti; + if (eol + sizeof(u2) > end) { + return false; + } + count = stack_slots(eol); + vti = stack(eol); + for (int i = 0; i < stack_slots(eol); ++i) { + if (!vti->verify(start, end)) { + return false; + } + vti = vti->next(); + } + return true; + } + +#ifdef ASSERT + void print_on(outputStream* st) const { + st->print("full_frame(%d,{", offset_delta()); + verification_type_info* vti = locals(); + for (int i = 0; i < num_locals(); ++i) { + vti->print_on(st); + if (i != num_locals() - 1) { + st->print(","); + } + vti = vti->next(); + } + st->print("},{"); + address end_of_locals = (address)vti; + vti = stack(end_of_locals); + int ss = stack_slots(end_of_locals); + for (int i = 0; i < ss; ++i) { + vti->print_on(st); + if (i != ss - 1) { + st->print(","); + } + vti = vti->next(); + } + st->print("})"); + } +#endif +}; + +#define VIRTUAL_DISPATCH(stack_frame_type, func_name, args) \ + stack_frame_type* item_##stack_frame_type = as_##stack_frame_type(); \ + if (item_##stack_frame_type != NULL) { \ + return item_##stack_frame_type->func_name args; \ + } + +#define VOID_VIRTUAL_DISPATCH(stack_frame_type, func_name, args) \ + stack_frame_type* item_##stack_frame_type = as_##stack_frame_type(); \ + if (item_##stack_frame_type != NULL) { \ + item_##stack_frame_type->func_name args; \ + return; \ + } + +size_t stack_map_frame::size() const { + FOR_EACH_STACKMAP_FRAME_TYPE(VIRTUAL_DISPATCH, size, ()); + return 0; +} + +int stack_map_frame::offset_delta() const { + FOR_EACH_STACKMAP_FRAME_TYPE(VIRTUAL_DISPATCH, offset_delta, ()); + return 0; +} + +void stack_map_frame::set_offset_delta(int offset_delta) { + FOR_EACH_STACKMAP_FRAME_TYPE( + VOID_VIRTUAL_DISPATCH, set_offset_delta, (offset_delta)); +} + +int stack_map_frame::number_of_types() const { + FOR_EACH_STACKMAP_FRAME_TYPE(VIRTUAL_DISPATCH, number_of_types, ()); + return 0; +} + +verification_type_info* stack_map_frame::types() const { + FOR_EACH_STACKMAP_FRAME_TYPE(VIRTUAL_DISPATCH, types, ()); + return NULL; +} + +bool stack_map_frame::is_valid_offset(int offset) const { + FOR_EACH_STACKMAP_FRAME_TYPE(VIRTUAL_DISPATCH, is_valid_offset, (offset)); + return true; +} + +bool stack_map_frame::verify(address start, address end) const { + if (frame_type_addr() >= start && frame_type_addr() < end) { + FOR_EACH_STACKMAP_FRAME_TYPE( + VIRTUAL_DISPATCH, verify_subtype, (start, end)); + } + return false; +} + +#ifdef ASSERT +void stack_map_frame::print_on(outputStream* st) const { + FOR_EACH_STACKMAP_FRAME_TYPE(VOID_VIRTUAL_DISPATCH, print_on, (st)); +} +#endif + +#undef VIRTUAL_DISPATCH +#undef VOID_VIRTUAL_DISPATCH + +#define AS_SUBTYPE_DEF(stack_frame_type, arg1, arg2) \ +stack_frame_type* stack_map_frame::as_##stack_frame_type() const { \ + if (stack_frame_type::is_frame_type(frame_type())) { \ + return (stack_frame_type*)this; \ + } else { \ + return NULL; \ + } \ +} + +FOR_EACH_STACKMAP_FRAME_TYPE(AS_SUBTYPE_DEF, x, x) +#undef AS_SUBTYPE_DEF + +class stack_map_table_attribute { + private: + address name_index_addr() const { + return (address)this; } + address attribute_length_addr() const { + return name_index_addr() + sizeof(u2); } + address number_of_entries_addr() const { + return attribute_length_addr() + sizeof(u4); } + address entries_addr() const { + return number_of_entries_addr() + sizeof(u2); } + + protected: + // No constructors - should be 'private', but GCC issues a warning if it is + stack_map_table_attribute() {} + stack_map_table_attribute(const stack_map_table_attribute&) {} + + public: + + static stack_map_table_attribute* at(address addr) { + return (stack_map_table_attribute*)addr; + } + + u2 name_index() const { + return Bytes::get_Java_u2(name_index_addr()); } + u4 attribute_length() const { + return Bytes::get_Java_u4(attribute_length_addr()); } + u2 number_of_entries() const { + return Bytes::get_Java_u2(number_of_entries_addr()); } + stack_map_frame* entries() const { + return stack_map_frame::at(entries_addr()); + } + + static size_t header_size() { + return sizeof(u2) + sizeof(u4); + } + + void set_name_index(u2 idx) { + Bytes::put_Java_u2(name_index_addr(), idx); + } + void set_attribute_length(u4 len) { + Bytes::put_Java_u4(attribute_length_addr(), len); + } + void set_number_of_entries(u2 num) { + Bytes::put_Java_u2(number_of_entries_addr(), num); + } +}; + +#endif // SHARE_VM_CLASSFILE_STACKMAPTABLEFORMAT_HPP diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp index 68bc4beca4d..fd54f4d26bc 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.cpp +++ b/hotspot/src/share/vm/classfile/symbolTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,18 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_symbolTable.cpp.incl" +#include "precompiled.hpp" +#include "classfile/javaClasses.hpp" +#include "classfile/symbolTable.hpp" +#include "classfile/systemDictionary.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "memory/filemap.hpp" +#include "memory/gcLocker.inline.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.inline2.hpp" +#include "oops/symbolKlass.hpp" +#include "runtime/mutexLocker.hpp" +#include "utilities/hashtable.inline.hpp" // -------------------------------------------------------------------------- diff --git a/hotspot/src/share/vm/classfile/symbolTable.hpp b/hotspot/src/share/vm/classfile/symbolTable.hpp index 40e67c12573..8444b4f9de5 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.hpp +++ b/hotspot/src/share/vm/classfile/symbolTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_CLASSFILE_SYMBOLTABLE_HPP +#define SHARE_VM_CLASSFILE_SYMBOLTABLE_HPP + +#include "memory/allocation.inline.hpp" +#include "oops/symbolOop.hpp" +#include "utilities/hashtable.hpp" + // The symbol table holds all symbolOops and corresponding interned strings. // symbolOops and literal strings should be canonicalized. // @@ -222,3 +229,5 @@ public: ((BasicHashtable*)the_table())->reverse(); } }; + +#endif // SHARE_VM_CLASSFILE_SYMBOLTABLE_HPP diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp index b9ba2062dda..5716e87163e 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,16 +22,45 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_systemDictionary.cpp.incl" +#include "precompiled.hpp" +#include "classfile/dictionary.hpp" +#include "classfile/javaClasses.hpp" +#include "classfile/loaderConstraints.hpp" +#include "classfile/placeholders.hpp" +#include "classfile/resolutionErrors.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "interpreter/bytecodeStream.hpp" +#include "interpreter/interpreter.hpp" +#include "memory/gcLocker.hpp" +#include "memory/oopFactory.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/instanceRefKlass.hpp" +#include "oops/klass.inline.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.inline2.hpp" +#include "oops/typeArrayKlass.hpp" +#include "prims/jvmtiEnvBase.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/fieldType.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/signature.hpp" +#include "services/classLoadingService.hpp" +#include "services/threadService.hpp" -Dictionary* SystemDictionary::_dictionary = NULL; -PlaceholderTable* SystemDictionary::_placeholders = NULL; -Dictionary* SystemDictionary::_shared_dictionary = NULL; -LoaderConstraintTable* SystemDictionary::_loader_constraints = NULL; -ResolutionErrorTable* SystemDictionary::_resolution_errors = NULL; -SymbolPropertyTable* SystemDictionary::_invoke_method_table = NULL; +Dictionary* SystemDictionary::_dictionary = NULL; +PlaceholderTable* SystemDictionary::_placeholders = NULL; +Dictionary* SystemDictionary::_shared_dictionary = NULL; +LoaderConstraintTable* SystemDictionary::_loader_constraints = NULL; +ResolutionErrorTable* SystemDictionary::_resolution_errors = NULL; +SymbolPropertyTable* SystemDictionary::_invoke_method_table = NULL; int SystemDictionary::_number_of_modifications = 0; @@ -1727,8 +1756,7 @@ void SystemDictionary::always_strong_classes_do(OopClosure* blk) { placeholders_do(blk); // Visit extra methods - if (invoke_method_table() != NULL) - invoke_method_table()->oops_do(blk); + invoke_method_table()->oops_do(blk); // Loader constraints. We must keep the symbolOop used in the name alive. constraints()->always_strong_classes_do(blk); @@ -1766,8 +1794,7 @@ void SystemDictionary::oops_do(OopClosure* f) { dictionary()->oops_do(f); // Visit extra methods - if (invoke_method_table() != NULL) - invoke_method_table()->oops_do(f); + invoke_method_table()->oops_do(f); // Partially loaded classes placeholders()->oops_do(f); @@ -1841,8 +1868,7 @@ void SystemDictionary::placeholders_do(void f(symbolOop, oop)) { void SystemDictionary::methods_do(void f(methodOop)) { dictionary()->methods_do(f); - if (invoke_method_table() != NULL) - invoke_method_table()->methods_do(f); + invoke_method_table()->methods_do(f); } // ---------------------------------------------------------------------------- @@ -1870,12 +1896,12 @@ void SystemDictionary::initialize(TRAPS) { // Allocate arrays assert(dictionary() == NULL, "SystemDictionary should only be initialized once"); - _dictionary = new Dictionary(_nof_buckets); - _placeholders = new PlaceholderTable(_nof_buckets); + _dictionary = new Dictionary(_nof_buckets); + _placeholders = new PlaceholderTable(_nof_buckets); _number_of_modifications = 0; - _loader_constraints = new LoaderConstraintTable(_loader_constraint_size); - _resolution_errors = new ResolutionErrorTable(_resolution_error_size); - // _invoke_method_table is allocated lazily in find_method_handle_invoke() + _loader_constraints = new LoaderConstraintTable(_loader_constraint_size); + _resolution_errors = new ResolutionErrorTable(_resolution_error_size); + _invoke_method_table = new SymbolPropertyTable(_invoke_method_size); // Allocate private object used as system class loader lock _system_loader_lock_obj = oopFactory::new_system_objArray(0, CHECK); @@ -1984,7 +2010,7 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) { scan = WKID(meth_group_end+1); } WKID indy_group_start = WK_KLASS_ENUM_NAME(Linkage_klass); - WKID indy_group_end = WK_KLASS_ENUM_NAME(InvokeDynamic_klass); + WKID indy_group_end = WK_KLASS_ENUM_NAME(CallSite_klass); initialize_wk_klasses_until(indy_group_start, scan, CHECK); if (EnableInvokeDynamic) { initialize_wk_klasses_through(indy_group_end, scan, CHECK); @@ -2346,10 +2372,6 @@ methodOop SystemDictionary::find_method_handle_invoke(symbolHandle name, KlassHandle accessing_klass, TRAPS) { if (!EnableMethodHandles) return NULL; - if (invoke_method_table() == NULL) { - // create this side table lazily - _invoke_method_table = new SymbolPropertyTable(_invoke_method_size); - } vmSymbols::SID name_id = vmSymbols::find_sid(name()); assert(name_id != vmSymbols::NO_SID, "must be a known name"); unsigned int hash = invoke_method_table()->compute_hash(signature, name_id); @@ -2562,7 +2584,9 @@ Handle SystemDictionary::make_dynamic_call_site(Handle bootstrap_method, } Handle SystemDictionary::find_bootstrap_method(methodHandle caller_method, int caller_bci, - int cache_index, TRAPS) { + int cache_index, + Handle& argument_info_result, + TRAPS) { Handle empty; constantPoolHandle pool; @@ -2576,7 +2600,7 @@ Handle SystemDictionary::find_bootstrap_method(methodHandle caller_method, int c constantTag tag = pool->tag_at(constant_pool_index); if (tag.is_invoke_dynamic()) { - // JVM_CONSTANT_InvokeDynamic is an ordered pair of [bootm, name&type] + // JVM_CONSTANT_InvokeDynamic is an ordered pair of [bootm, name&type], plus optional arguments // The bootm, being a JVM_CONSTANT_MethodHandle, has its own cache entry. int bsm_index = pool->invoke_dynamic_bootstrap_method_ref_index_at(constant_pool_index); if (bsm_index != 0) { @@ -2592,9 +2616,38 @@ Handle SystemDictionary::find_bootstrap_method(methodHandle caller_method, int c tty->print_cr("bootstrap method for "PTR_FORMAT" at %d retrieved as "PTR_FORMAT":", (intptr_t) caller_method(), caller_bci, (intptr_t) bsm_oop); } - assert(bsm_oop->is_oop() - && java_dyn_MethodHandle::is_instance(bsm_oop), "must be sane"); - return Handle(THREAD, bsm_oop); + assert(bsm_oop->is_oop(), "must be sane"); + // caller must verify that it is of type MethodHandle + Handle bsm(THREAD, bsm_oop); + bsm_oop = NULL; // safety + + // Extract the optional static arguments. + Handle argument_info; // either null, or one arg, or Object[]{arg...} + int argc = pool->invoke_dynamic_argument_count_at(constant_pool_index); + if (TraceInvokeDynamic) { + tty->print_cr("find_bootstrap_method: [%d/%d] CONSTANT_InvokeDynamic: %d[%d]", + constant_pool_index, cache_index, bsm_index, argc); + } + if (argc > 0) { + objArrayHandle arg_array; + if (argc > 1) { + objArrayOop arg_array_oop = oopFactory::new_objArray(SystemDictionary::Object_klass(), argc, CHECK_(empty)); + arg_array = objArrayHandle(THREAD, arg_array_oop); + argument_info = arg_array; + } + for (int arg_i = 0; arg_i < argc; arg_i++) { + int arg_index = pool->invoke_dynamic_argument_index_at(constant_pool_index, arg_i); + oop arg_oop = pool->resolve_possibly_cached_constant_at(arg_index, CHECK_(empty)); + if (arg_array.is_null()) { + argument_info = Handle(THREAD, arg_oop); + } else { + arg_array->obj_at_put(arg_i, arg_oop); + } + } + } + + argument_info_result = argument_info; // return argument_info to caller + return bsm; } // else null BSM; fall through } else if (tag.is_name_and_type()) { @@ -2607,14 +2660,14 @@ Handle SystemDictionary::find_bootstrap_method(methodHandle caller_method, int c // Fall through to pick up the per-class bootstrap method. // This mechanism may go away in the PFD. assert(AllowTransitionalJSR292, "else the verifier should have stopped us already"); + argument_info_result = empty; // return no argument_info to caller oop bsm_oop = instanceKlass::cast(caller_method->method_holder())->bootstrap_method(); if (bsm_oop != NULL) { if (TraceMethodHandles) { tty->print_cr("bootstrap method for "PTR_FORMAT" registered as "PTR_FORMAT":", (intptr_t) caller_method(), (intptr_t) bsm_oop); } - assert(bsm_oop->is_oop() - && java_dyn_MethodHandle::is_instance(bsm_oop), "must be sane"); + assert(bsm_oop->is_oop(), "must be sane"); return Handle(THREAD, bsm_oop); } diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp index 8d51a8a7561..a83c8d55120 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.hpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp @@ -22,6 +22,17 @@ * */ +#ifndef SHARE_VM_CLASSFILE_SYSTEMDICTIONARY_HPP +#define SHARE_VM_CLASSFILE_SYSTEMDICTIONARY_HPP + +#include "classfile/classFileStream.hpp" +#include "classfile/classLoader.hpp" +#include "oops/objArrayOop.hpp" +#include "oops/symbolOop.hpp" +#include "runtime/java.hpp" +#include "runtime/reflectionUtils.hpp" +#include "utilities/hashtable.hpp" + // The system dictionary stores all loaded classes and maps: // // [class name,class loader] -> class i.e. [symbolOop,oop] -> klassOop @@ -145,8 +156,7 @@ class SymbolPropertyTable; template(WrongMethodTypeException_klass, java_dyn_WrongMethodTypeException, Opt) \ template(Linkage_klass, java_dyn_Linkage, Opt) \ template(CallSite_klass, java_dyn_CallSite, Opt) \ - template(InvokeDynamic_klass, java_dyn_InvokeDynamic, Opt) \ - /* Note: MethodHandle must be first, and InvokeDynamic last in group */ \ + /* Note: MethodHandle must be first, and CallSite last in group */ \ \ template(StringBuffer_klass, java_lang_StringBuffer, Pre) \ template(StringBuilder_klass, java_lang_StringBuilder, Pre) \ @@ -496,6 +506,7 @@ public: static Handle find_bootstrap_method(methodHandle caller_method, int caller_bci, // N.B. must be an invokedynamic int cache_index, // must be corresponding main_entry + Handle &argument_info_result, // static BSM arguments, if any TRAPS); // Utility for printing loader "name" as part of tracing constraints @@ -671,3 +682,5 @@ public: static KlassHandle box_klass(BasicType t); }; + +#endif // SHARE_VM_CLASSFILE_SYSTEMDICTIONARY_HPP diff --git a/hotspot/src/share/vm/classfile/verificationType.cpp b/hotspot/src/share/vm/classfile/verificationType.cpp index 4a60b789451..7a2612a1224 100644 --- a/hotspot/src/share/vm/classfile/verificationType.cpp +++ b/hotspot/src/share/vm/classfile/verificationType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_verificationType.cpp.incl" +#include "precompiled.hpp" +#include "classfile/symbolTable.hpp" +#include "classfile/verificationType.hpp" VerificationType VerificationType::from_tag(u1 tag) { switch (tag) { diff --git a/hotspot/src/share/vm/classfile/verificationType.hpp b/hotspot/src/share/vm/classfile/verificationType.hpp index db3a8097002..8163d966e5a 100644 --- a/hotspot/src/share/vm/classfile/verificationType.hpp +++ b/hotspot/src/share/vm/classfile/verificationType.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,17 @@ * */ +#ifndef SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP +#define SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP + +#include "classfile/systemDictionary.hpp" +#include "memory/allocation.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/oop.inline.hpp" +#include "oops/symbolOop.hpp" +#include "runtime/handles.hpp" +#include "runtime/signature.hpp" + enum { // As specifed in the JVM spec ITEM_Top = 0, @@ -303,3 +314,5 @@ class VerificationType VALUE_OBJ_CLASS_SPEC { bool is_reference_assignable_from( const VerificationType&, instanceKlassHandle, TRAPS) const; }; + +#endif // SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index 6f2fd206381..2690ac3f7bf 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -22,8 +22,35 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_verifier.cpp.incl" +#include "precompiled.hpp" +#include "classfile/classFileStream.hpp" +#include "classfile/javaClasses.hpp" +#include "classfile/stackMapTable.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/verifier.hpp" +#include "classfile/vmSymbols.hpp" +#include "interpreter/bytecodeStream.hpp" +#include "memory/oopFactory.hpp" +#include "memory/resourceArea.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/oop.inline.hpp" +#include "oops/typeArrayOop.hpp" +#include "prims/jvm.h" +#include "runtime/fieldDescriptor.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/orderAccess.hpp" +#include "runtime/os.hpp" +#ifdef TARGET_ARCH_x86 +# include "bytes_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "bytes_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "bytes_zero.hpp" +#endif #define NOFAILOVER_MAJOR_VERSION 51 @@ -41,11 +68,11 @@ static volatile jint _is_new_verify_byte_codes_fn = (jint) true; static void* verify_byte_codes_fn() { if (_verify_byte_codes_fn == NULL) { void *lib_handle = os::native_java_library(); - void *func = hpi::dll_lookup(lib_handle, "VerifyClassCodesForMajorVersion"); + void *func = os::dll_lookup(lib_handle, "VerifyClassCodesForMajorVersion"); OrderAccess::release_store_ptr(&_verify_byte_codes_fn, func); if (func == NULL) { OrderAccess::release_store(&_is_new_verify_byte_codes_fn, false); - func = hpi::dll_lookup(lib_handle, "VerifyClassCodes"); + func = os::dll_lookup(lib_handle, "VerifyClassCodes"); OrderAccess::release_store_ptr(&_verify_byte_codes_fn, func); } } @@ -247,6 +274,10 @@ ClassVerifier::ClassVerifier( ClassVerifier::~ClassVerifier() { } +VerificationType ClassVerifier::object_type() const { + return VerificationType::reference_type(vmSymbols::java_lang_Object()); +} + void ClassVerifier::verify_class(TRAPS) { if (_verify_verbose) { tty->print_cr("Verifying class %s with new format", @@ -726,8 +757,7 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) { } no_control_flow = false; break; case Bytecodes::_aastore : - type = current_frame.pop_stack( - VerificationType::reference_check(), CHECK_VERIFY(this)); + type = current_frame.pop_stack(object_type(), CHECK_VERIFY(this)); type2 = current_frame.pop_stack( VerificationType::integer_type(), CHECK_VERIFY(this)); atype = current_frame.pop_stack( @@ -1232,8 +1262,7 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) { { index = bcs.get_index_u2(); verify_cp_class_type(index, cp, CHECK_VERIFY(this)); - current_frame.pop_stack( - VerificationType::reference_check(), CHECK_VERIFY(this)); + current_frame.pop_stack(object_type(), CHECK_VERIFY(this)); VerificationType klass_type = cp_index_to_type( index, cp, CHECK_VERIFY(this)); current_frame.push_stack(klass_type, CHECK_VERIFY(this)); @@ -1242,8 +1271,7 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) { case Bytecodes::_instanceof : { index = bcs.get_index_u2(); verify_cp_class_type(index, cp, CHECK_VERIFY(this)); - current_frame.pop_stack( - VerificationType::reference_check(), CHECK_VERIFY(this)); + current_frame.pop_stack(object_type(), CHECK_VERIFY(this)); current_frame.push_stack( VerificationType::integer_type(), CHECK_VERIFY(this)); no_control_flow = false; break; @@ -1610,9 +1638,7 @@ void ClassVerifier::verify_ldc( verify_cp_type(index, cp, types, CHECK_VERIFY(this)); } if (tag.is_string() && cp->is_pseudo_string_at(index)) { - current_frame->push_stack( - VerificationType::reference_type( - vmSymbols::java_lang_Object()), CHECK_VERIFY(this)); + current_frame->push_stack(object_type(), CHECK_VERIFY(this)); } else if (tag.is_string() || tag.is_unresolved_string()) { current_frame->push_stack( VerificationType::reference_type( @@ -1909,7 +1935,7 @@ void ClassVerifier::verify_invoke_instructions( unsigned int types = (opcode == Bytecodes::_invokeinterface ? 1 << JVM_CONSTANT_InterfaceMethodref : opcode == Bytecodes::_invokedynamic - ? (1 << JVM_CONSTANT_NameAndType + ? ((AllowTransitionalJSR292 ? 1 << JVM_CONSTANT_NameAndType : 0) |1 << JVM_CONSTANT_InvokeDynamic) : 1 << JVM_CONSTANT_Methodref); verify_cp_type(index, cp, types, CHECK_VERIFY(this)); diff --git a/hotspot/src/share/vm/classfile/verifier.hpp b/hotspot/src/share/vm/classfile/verifier.hpp index de6487ffc08..c3ef4670602 100644 --- a/hotspot/src/share/vm/classfile/verifier.hpp +++ b/hotspot/src/share/vm/classfile/verifier.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#ifndef SHARE_VM_CLASSFILE_VERIFIER_HPP +#define SHARE_VM_CLASSFILE_VERIFIER_HPP + +#include "classfile/verificationType.hpp" +#include "memory/gcLocker.hpp" +#include "oops/klass.hpp" +#include "oops/methodOop.hpp" +#include "runtime/handles.hpp" +#include "utilities/exceptions.hpp" + // The verifier class class Verifier : AllStatic { public: @@ -157,6 +167,8 @@ class ClassVerifier : public StackObj { bool name_in_supers(symbolOop ref_name, instanceKlassHandle current); + VerificationType object_type() const; + instanceKlassHandle _klass; // the class being verified methodHandle _method; // current method being verified VerificationType _this_type; // the verification type of the current class @@ -252,3 +264,5 @@ inline int ClassVerifier::change_sig_to_verificationType( return 1; } } + +#endif // SHARE_VM_CLASSFILE_VERIFIER_HPP diff --git a/hotspot/src/share/vm/classfile/vmSymbols.cpp b/hotspot/src/share/vm/classfile/vmSymbols.cpp index bba078fe3c0..c0138c40874 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.cpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_vmSymbols.cpp.incl" +#include "precompiled.hpp" +#include "classfile/vmSymbols.hpp" +#include "memory/oopFactory.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "utilities/xmlstream.hpp" symbolOop vmSymbols::_symbols[vmSymbols::SID_LIMIT]; diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index cc88ad71fd1..59168b8c544 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -22,6 +22,11 @@ * */ +#ifndef SHARE_VM_CLASSFILE_VMSYMBOLS_HPP +#define SHARE_VM_CLASSFILE_VMSYMBOLS_HPP + +#include "oops/symbolOop.hpp" + // The classes vmSymbols and vmSymbolHandles are a name spaces for fast lookup of // symbols commonly used in the VM. The first class return a symbolOop, while the // second class returns a SymbolHandle. The underlying data structure is shared @@ -127,6 +132,7 @@ template(tag_runtime_invisible_parameter_annotations,"RuntimeInvisibleParameterAnnotations") \ template(tag_annotation_default, "AnnotationDefault") \ template(tag_enclosing_method, "EnclosingMethod") \ + template(tag_bootstrap_methods, "BootstrapMethods") \ \ /* exception klasses: at least all exceptions thrown by the VM have entries here */ \ template(java_lang_ArithmeticException, "java/lang/ArithmeticException") \ @@ -1112,3 +1118,5 @@ public: // Raw conversion: static ID for_raw_conversion(BasicType src, BasicType dest); }; + +#endif // SHARE_VM_CLASSFILE_VMSYMBOLS_HPP diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp index 823eedd498d..81d09f5cc5c 100644 --- a/hotspot/src/share/vm/code/codeBlob.cpp +++ b/hotspot/src/share/vm/code/codeBlob.cpp @@ -22,8 +22,35 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_codeBlob.cpp.incl" +#include "precompiled.hpp" +#include "code/codeBlob.hpp" +#include "code/codeCache.hpp" +#include "code/relocInfo.hpp" +#include "compiler/disassembler.hpp" +#include "interpreter/bytecode.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/heap.hpp" +#include "oops/oop.inline.hpp" +#include "prims/forte.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/safepoint.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/vframe.hpp" +#include "services/memoryService.hpp" +#ifdef TARGET_ARCH_x86 +# include "nativeInst_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "nativeInst_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "nativeInst_zero.hpp" +#endif +#ifdef COMPILER1 +#include "c1/c1_Runtime1.hpp" +#endif unsigned int align_code_offset(int offset) { // align the size to CodeEntryAlignment diff --git a/hotspot/src/share/vm/code/codeBlob.hpp b/hotspot/src/share/vm/code/codeBlob.hpp index 9b08c3dc880..61e64882d43 100644 --- a/hotspot/src/share/vm/code/codeBlob.hpp +++ b/hotspot/src/share/vm/code/codeBlob.hpp @@ -22,6 +22,14 @@ * */ +#ifndef SHARE_VM_CODE_CODEBLOB_HPP +#define SHARE_VM_CODE_CODEBLOB_HPP + +#include "asm/codeBuffer.hpp" +#include "compiler/oopMap.hpp" +#include "runtime/frame.hpp" +#include "runtime/handles.hpp" + // CodeBlob - superclass for all entries in the CodeCache. // // Suptypes are: @@ -499,3 +507,5 @@ class SafepointBlob: public SingletonBlob { // Typing bool is_safepoint_stub() const { return true; } }; + +#endif // SHARE_VM_CODE_CODEBLOB_HPP diff --git a/hotspot/src/share/vm/code/codeCache.cpp b/hotspot/src/share/vm/code/codeCache.cpp index b02f142ccfc..db35aea6e19 100644 --- a/hotspot/src/share/vm/code/codeCache.cpp +++ b/hotspot/src/share/vm/code/codeCache.cpp @@ -22,8 +22,26 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_codeCache.cpp.incl" +#include "precompiled.hpp" +#include "code/codeBlob.hpp" +#include "code/codeCache.hpp" +#include "code/dependencies.hpp" +#include "code/nmethod.hpp" +#include "code/pcDesc.hpp" +#include "gc_implementation/shared/markSweep.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/gcLocker.hpp" +#include "memory/iterator.hpp" +#include "memory/resourceArea.hpp" +#include "oops/methodOop.hpp" +#include "oops/objArrayOop.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/icache.hpp" +#include "runtime/java.hpp" +#include "runtime/mutexLocker.hpp" +#include "services/memoryService.hpp" +#include "utilities/xmlstream.hpp" // Helper class for printing in CodeCache @@ -914,3 +932,16 @@ void CodeCache::print() { } #endif // PRODUCT + +void CodeCache::print_bounds(outputStream* st) { + st->print_cr("Code Cache [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", + _heap->low_boundary(), + _heap->high(), + _heap->high_boundary()); + st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT + " adapters=" UINT32_FORMAT " free_code_cache=" SIZE_FORMAT + " largest_free_block=" SIZE_FORMAT, + CodeCache::nof_blobs(), CodeCache::nof_nmethods(), + CodeCache::nof_adapters(), CodeCache::unallocated_capacity(), + CodeCache::largest_free_block()); +} diff --git a/hotspot/src/share/vm/code/codeCache.hpp b/hotspot/src/share/vm/code/codeCache.hpp index 8c63cd6efb2..df8de7f3f2d 100644 --- a/hotspot/src/share/vm/code/codeCache.hpp +++ b/hotspot/src/share/vm/code/codeCache.hpp @@ -22,6 +22,15 @@ * */ +#ifndef SHARE_VM_CODE_CODECACHE_HPP +#define SHARE_VM_CODE_CODECACHE_HPP + +#include "code/codeBlob.hpp" +#include "memory/allocation.hpp" +#include "memory/heap.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/oopsHierarchy.hpp" + // The CodeCache implements the code cache for various pieces of generated // code, e.g., compiled java methods, runtime stubs, transition frames, etc. // The entries in the CodeCache are all CodeBlob's. @@ -137,6 +146,7 @@ class CodeCache : AllStatic { static void print_internals(); static void verify(); // verifies the code cache static void print_trace(const char* event, CodeBlob* cb, int size = 0) PRODUCT_RETURN; + static void print_bounds(outputStream* st); // Prints a summary of the bounds of the code cache // The full limits of the codeCache static address low_bound() { return (address) _heap->low_boundary(); } @@ -148,6 +158,7 @@ class CodeCache : AllStatic { static size_t capacity() { return _heap->capacity(); } static size_t max_capacity() { return _heap->max_capacity(); } static size_t unallocated_capacity() { return _heap->unallocated_capacity(); } + static size_t largest_free_block() { return _heap->largest_free_block(); } static bool needs_flushing() { return unallocated_capacity() < CodeCacheFlushingMinimumFreeSpace; } static bool needs_cache_clean() { return _needs_cache_clean; } @@ -172,3 +183,5 @@ class CodeCache : AllStatic { // tells how many nmethods have dependencies static int number_of_nmethods_with_dependencies(); }; + +#endif // SHARE_VM_CODE_CODECACHE_HPP diff --git a/hotspot/src/share/vm/code/compiledIC.cpp b/hotspot/src/share/vm/code/compiledIC.cpp index d2c8e2752ef..b8e0f2821c3 100644 --- a/hotspot/src/share/vm/code/compiledIC.cpp +++ b/hotspot/src/share/vm/code/compiledIC.cpp @@ -22,8 +22,23 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_compiledIC.cpp.incl" +#include "precompiled.hpp" +#include "classfile/systemDictionary.hpp" +#include "code/codeCache.hpp" +#include "code/compiledIC.hpp" +#include "code/icBuffer.hpp" +#include "code/nmethod.hpp" +#include "code/vtableStubs.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/linkResolver.hpp" +#include "memory/oopFactory.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "oops/symbolOop.hpp" +#include "runtime/icache.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "utilities/events.hpp" // Every time a compiled IC is changed or its type is being accessed, diff --git a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp index b97b3ea56d6..a5524ca164c 100644 --- a/hotspot/src/share/vm/code/compiledIC.hpp +++ b/hotspot/src/share/vm/code/compiledIC.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,23 @@ * */ +#ifndef SHARE_VM_CODE_COMPILEDIC_HPP +#define SHARE_VM_CODE_COMPILEDIC_HPP + +#include "interpreter/linkResolver.hpp" +#include "oops/compiledICHolderKlass.hpp" +#include "oops/compiledICHolderOop.hpp" +#include "oops/klassOop.hpp" +#ifdef TARGET_ARCH_x86 +# include "nativeInst_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "nativeInst_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "nativeInst_zero.hpp" +#endif + //----------------------------------------------------------------------------- // The CompiledIC represents a compiled inline cache. // @@ -239,3 +256,5 @@ inline CompiledStaticCall* compiledStaticCall_at(address native_call) { inline CompiledStaticCall* compiledStaticCall_at(Relocation* call_site) { return compiledStaticCall_at(call_site->addr()); } + +#endif // SHARE_VM_CODE_COMPILEDIC_HPP diff --git a/hotspot/src/share/vm/code/compressedStream.cpp b/hotspot/src/share/vm/code/compressedStream.cpp index d2f51e5f3a2..1d5cb341372 100644 --- a/hotspot/src/share/vm/code/compressedStream.cpp +++ b/hotspot/src/share/vm/code/compressedStream.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_compressedStream.cpp.incl" +#include "precompiled.hpp" +#include "code/compressedStream.hpp" +#include "utilities/ostream.hpp" // 32-bit one-to-one sign encoding taken from Pack200 // converts leading sign bits into leading zeroes with trailing sign bit @@ -196,6 +197,7 @@ void CompressedWriteStream::write_int_mb(jint value) { // compiler stack overflow is fixed. #if _MSC_VER >=1400 && !defined(_WIN64) #pragma optimize("", off) +#pragma warning(disable: 4748) #endif // generator for an "interesting" set of critical values @@ -275,6 +277,7 @@ void test_compressed_stream(int trace) { } #if _MSC_VER >=1400 && !defined(_WIN64) +#pragma warning(default: 4748) #pragma optimize("", on) #endif diff --git a/hotspot/src/share/vm/code/compressedStream.hpp b/hotspot/src/share/vm/code/compressedStream.hpp index db9f8869203..fd5aafc9124 100644 --- a/hotspot/src/share/vm/code/compressedStream.hpp +++ b/hotspot/src/share/vm/code/compressedStream.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_CODE_COMPRESSEDSTREAM_HPP +#define SHARE_VM_CODE_COMPRESSEDSTREAM_HPP + +#include "memory/allocation.hpp" + // Simple interface for filing out and filing in basic types // Used for writing out and reading in debugging information. @@ -118,3 +123,5 @@ class CompressedWriteStream : public CompressedStream { void write_double(jdouble value); // write_int(reverse_int()) void write_long(jlong value); // write_signed_int() }; + +#endif // SHARE_VM_CODE_COMPRESSEDSTREAM_HPP diff --git a/hotspot/src/share/vm/code/debugInfo.cpp b/hotspot/src/share/vm/code/debugInfo.cpp index a3cd7db4ede..04504722eab 100644 --- a/hotspot/src/share/vm/code/debugInfo.cpp +++ b/hotspot/src/share/vm/code/debugInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_debugInfo.cpp.incl" +#include "precompiled.hpp" +#include "code/debugInfo.hpp" +#include "code/debugInfoRec.hpp" +#include "code/nmethod.hpp" +#include "runtime/handles.inline.hpp" // Comstructors diff --git a/hotspot/src/share/vm/code/debugInfo.hpp b/hotspot/src/share/vm/code/debugInfo.hpp index 3506b7caaad..eed747717f9 100644 --- a/hotspot/src/share/vm/code/debugInfo.hpp +++ b/hotspot/src/share/vm/code/debugInfo.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#ifndef SHARE_VM_CODE_DEBUGINFO_HPP +#define SHARE_VM_CODE_DEBUGINFO_HPP + +#include "code/compressedStream.hpp" +#include "code/location.hpp" +#include "code/nmethod.hpp" +#include "code/oopRecorder.hpp" +#include "runtime/stackValue.hpp" +#include "utilities/growableArray.hpp" + // Classes used for serializing debugging information. // These abstractions are introducted to provide symmetric // read and write operations. @@ -270,3 +280,5 @@ class DebugInfoWriteStream : public CompressedWriteStream { void write_handle(jobject h); void write_bci(int bci) { write_int(bci - InvocationEntryBci); } }; + +#endif // SHARE_VM_CODE_DEBUGINFO_HPP diff --git a/hotspot/src/share/vm/code/debugInfoRec.cpp b/hotspot/src/share/vm/code/debugInfoRec.cpp index 042503fa3c5..bc8bd55c80a 100644 --- a/hotspot/src/share/vm/code/debugInfoRec.cpp +++ b/hotspot/src/share/vm/code/debugInfoRec.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_debugInfoRec.cpp.incl" +#include "precompiled.hpp" +#include "code/debugInfoRec.hpp" +#include "code/scopeDesc.hpp" +#include "prims/jvmtiExport.hpp" // Private definition. // There is one DIR_Chunk for each scope and values array. diff --git a/hotspot/src/share/vm/code/debugInfoRec.hpp b/hotspot/src/share/vm/code/debugInfoRec.hpp index 83db4d0f934..758e7dad193 100644 --- a/hotspot/src/share/vm/code/debugInfoRec.hpp +++ b/hotspot/src/share/vm/code/debugInfoRec.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,19 @@ * */ +#ifndef SHARE_VM_CODE_DEBUGINFOREC_HPP +#define SHARE_VM_CODE_DEBUGINFOREC_HPP + +#include "ci/ciClassList.hpp" +#include "ci/ciInstanceKlass.hpp" +#include "ci/ciMethod.hpp" +#include "code/debugInfo.hpp" +#include "code/location.hpp" +#include "code/pcDesc.hpp" +#include "compiler/oopMap.hpp" +#include "oops/oop.hpp" +#include "utilities/growableArray.hpp" + //** The DebugInformationRecorder collects debugging information // for a compiled method. // Debugging information is used for: @@ -183,3 +196,5 @@ class DebugInformationRecorder: public ResourceObj { public: enum { serialized_null = 0 }; }; + +#endif // SHARE_VM_CODE_DEBUGINFOREC_HPP diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp index 811448801f9..6b564b286e4 100644 --- a/hotspot/src/share/vm/code/dependencies.cpp +++ b/hotspot/src/share/vm/code/dependencies.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_dependencies.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciArrayKlass.hpp" +#include "ci/ciEnv.hpp" +#include "ci/ciKlass.hpp" +#include "ci/ciMethod.hpp" +#include "code/dependencies.hpp" +#include "compiler/compileLog.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "utilities/copy.hpp" #ifdef ASSERT diff --git a/hotspot/src/share/vm/code/dependencies.hpp b/hotspot/src/share/vm/code/dependencies.hpp index bd8547d79cc..770e7f743bd 100644 --- a/hotspot/src/share/vm/code/dependencies.hpp +++ b/hotspot/src/share/vm/code/dependencies.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_CODE_DEPENDENCIES_HPP +#define SHARE_VM_CODE_DEPENDENCIES_HPP + +#include "ci/ciKlass.hpp" +#include "code/compressedStream.hpp" +#include "code/nmethod.hpp" +#include "utilities/growableArray.hpp" + //** Dependencies represent assertions (approximate invariants) within // the class hierarchy. An example is an assertion that a given // method is not overridden; another example is that a type has only @@ -550,3 +558,5 @@ class DepChange : public StackObj { void print(); }; + +#endif // SHARE_VM_CODE_DEPENDENCIES_HPP diff --git a/hotspot/src/share/vm/code/exceptionHandlerTable.cpp b/hotspot/src/share/vm/code/exceptionHandlerTable.cpp index 12cc9cdf7bf..9e259008287 100644 --- a/hotspot/src/share/vm/code/exceptionHandlerTable.cpp +++ b/hotspot/src/share/vm/code/exceptionHandlerTable.cpp @@ -22,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_exceptionHandlerTable.cpp.incl" +#include "precompiled.hpp" +#include "code/exceptionHandlerTable.hpp" +#include "code/nmethod.hpp" +#include "memory/allocation.inline.hpp" void ExceptionHandlerTable::add_entry(HandlerTableEntry entry) { _nesting.check(); diff --git a/hotspot/src/share/vm/code/exceptionHandlerTable.hpp b/hotspot/src/share/vm/code/exceptionHandlerTable.hpp index 3c5332fbea3..20801c3f034 100644 --- a/hotspot/src/share/vm/code/exceptionHandlerTable.hpp +++ b/hotspot/src/share/vm/code/exceptionHandlerTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CODE_EXCEPTIONHANDLERTABLE_HPP +#define SHARE_VM_CODE_EXCEPTIONHANDLERTABLE_HPP + +#include "memory/allocation.hpp" +#include "oops/methodOop.hpp" + // A HandlerTableEntry describes an individual entry of a subtable // of ExceptionHandlerTable. An entry consists of a pair(bci, pco), // where bci is the exception handler bci, and pco is the pc offset @@ -154,3 +160,5 @@ public: void print(address base) const; void verify(nmethod *nm) const; }; + +#endif // SHARE_VM_CODE_EXCEPTIONHANDLERTABLE_HPP diff --git a/hotspot/src/share/vm/code/icBuffer.cpp b/hotspot/src/share/vm/code/icBuffer.cpp index d4b13d4e347..d36f9109efa 100644 --- a/hotspot/src/share/vm/code/icBuffer.cpp +++ b/hotspot/src/share/vm/code/icBuffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,30 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_icBuffer.cpp.incl" +#include "precompiled.hpp" +#include "code/compiledIC.hpp" +#include "code/icBuffer.hpp" +#include "code/nmethod.hpp" +#include "code/scopeDesc.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/linkResolver.hpp" +#include "memory/resourceArea.hpp" +#include "memory/universe.inline.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.inline2.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/stubRoutines.hpp" +#ifdef TARGET_ARCH_x86 +# include "assembler_x86.inline.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "assembler_sparc.inline.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "assembler_zero.inline.hpp" +#endif DEF_STUB_INTERFACE(ICStub); diff --git a/hotspot/src/share/vm/code/icBuffer.hpp b/hotspot/src/share/vm/code/icBuffer.hpp index 02a4a0ebbf2..9ab7d9c621a 100644 --- a/hotspot/src/share/vm/code/icBuffer.hpp +++ b/hotspot/src/share/vm/code/icBuffer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_CODE_ICBUFFER_HPP +#define SHARE_VM_CODE_ICBUFFER_HPP + +#include "code/stubs.hpp" +#include "interpreter/bytecodes.hpp" +#include "memory/allocation.hpp" + // // For CompiledIC's: // @@ -126,3 +133,5 @@ class InlineCacheBuffer: public AllStatic { static address ic_destination_for(CompiledIC *ic); static oop cached_oop_for(CompiledIC *ic); }; + +#endif // SHARE_VM_CODE_ICBUFFER_HPP diff --git a/hotspot/src/share/vm/code/location.cpp b/hotspot/src/share/vm/code/location.cpp index 9374e08c707..605af19c7fc 100644 --- a/hotspot/src/share/vm/code/location.cpp +++ b/hotspot/src/share/vm/code/location.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_location.cpp.incl" +#include "precompiled.hpp" +#include "code/debugInfo.hpp" +#include "code/location.hpp" void Location::print_on(outputStream* st) const { if(type() == invalid) { diff --git a/hotspot/src/share/vm/code/location.hpp b/hotspot/src/share/vm/code/location.hpp index 18134adb651..86155b9e495 100644 --- a/hotspot/src/share/vm/code/location.hpp +++ b/hotspot/src/share/vm/code/location.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_CODE_LOCATION_HPP +#define SHARE_VM_CODE_LOCATION_HPP + +#include "asm/assembler.hpp" +#include "code/vmreg.hpp" +#include "memory/allocation.hpp" + // A Location describes a concrete machine variable location // (such as integer or floating point register or a stack-held // variable). Used when generating debug-information for nmethods. @@ -113,3 +120,5 @@ class Location VALUE_OBJ_CLASS_SPEC { // check static bool legal_offset_in_bytes(int offset_in_bytes); }; + +#endif // SHARE_VM_CODE_LOCATION_HPP diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 9da564d277e..98bad3ca098 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -22,8 +22,26 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_nmethod.cpp.incl" +#include "precompiled.hpp" +#include "code/codeCache.hpp" +#include "code/compiledIC.hpp" +#include "code/nmethod.hpp" +#include "code/scopeDesc.hpp" +#include "compiler/abstractCompiler.hpp" +#include "compiler/compileLog.hpp" +#include "compiler/compilerOracle.hpp" +#include "compiler/disassembler.hpp" +#include "interpreter/bytecode.hpp" +#include "oops/methodDataOop.hpp" +#include "prims/jvmtiRedefineClassesTrace.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/sweeper.hpp" +#include "utilities/dtrace.hpp" +#include "utilities/events.hpp" +#include "utilities/xmlstream.hpp" +#ifdef SHARK +#include "shark/sharkCompiler.hpp" +#endif #ifdef DTRACE_ENABLED @@ -601,8 +619,8 @@ nmethod::nmethod( OopMapSet* oop_maps ) : CodeBlob("native nmethod", code_buffer, sizeof(nmethod), nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps), - _compiled_synchronized_native_basic_lock_owner_sp_offset(basic_lock_owner_sp_offset), - _compiled_synchronized_native_basic_lock_sp_offset(basic_lock_sp_offset) + _native_receiver_sp_offset(basic_lock_owner_sp_offset), + _native_basic_lock_sp_offset(basic_lock_sp_offset) { { debug_only(No_Safepoint_Verifier nsv;) @@ -678,8 +696,8 @@ nmethod::nmethod( int frame_size) : CodeBlob("dtrace nmethod", code_buffer, sizeof(nmethod), nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, NULL), - _compiled_synchronized_native_basic_lock_owner_sp_offset(in_ByteSize(-1)), - _compiled_synchronized_native_basic_lock_sp_offset(in_ByteSize(-1)) + _native_receiver_sp_offset(in_ByteSize(-1)), + _native_basic_lock_sp_offset(in_ByteSize(-1)) { { debug_only(No_Safepoint_Verifier nsv;) @@ -772,8 +790,8 @@ nmethod::nmethod( ) : CodeBlob("nmethod", code_buffer, sizeof(nmethod), nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps), - _compiled_synchronized_native_basic_lock_owner_sp_offset(in_ByteSize(-1)), - _compiled_synchronized_native_basic_lock_sp_offset(in_ByteSize(-1)) + _native_receiver_sp_offset(in_ByteSize(-1)), + _native_basic_lock_sp_offset(in_ByteSize(-1)) { assert(debug_info->oop_recorder() == code_buffer->oop_recorder(), "shared OR"); { @@ -793,9 +811,11 @@ nmethod::nmethod( _stub_offset = content_offset() + code_buffer->total_offset_of(code_buffer->stubs()); // Exception handler and deopt handler are in the stub section + assert(offsets->value(CodeOffsets::Exceptions) != -1, "must be set"); + assert(offsets->value(CodeOffsets::Deopt ) != -1, "must be set"); _exception_offset = _stub_offset + offsets->value(CodeOffsets::Exceptions); _deoptimize_offset = _stub_offset + offsets->value(CodeOffsets::Deopt); - if (has_method_handle_invokes()) { + if (offsets->value(CodeOffsets::DeoptMH) != -1) { _deoptimize_mh_offset = _stub_offset + offsets->value(CodeOffsets::DeoptMH); } else { _deoptimize_mh_offset = -1; @@ -1421,7 +1441,7 @@ void nmethod::flush() { } #ifdef SHARK - ((SharkCompiler *) compiler())->free_compiled_method(instructions_begin()); + ((SharkCompiler *) compiler())->free_compiled_method(insts_begin()); #endif // SHARK ((CodeBlob*)(this))->flush(); @@ -1891,6 +1911,7 @@ void nmethod::copy_scopes_pcs(PcDesc* pcs, int count) { break; } } + assert(has_method_handle_invokes() == (_deoptimize_mh_offset != -1), "must have deopt mh handler"); int size = count * sizeof(PcDesc); assert(scopes_pcs_size() >= size, "oob"); diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 52a09c91029..5fa91f46f89 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -22,6 +22,12 @@ * */ +#ifndef SHARE_VM_CODE_NMETHOD_HPP +#define SHARE_VM_CODE_NMETHOD_HPP + +#include "code/codeBlob.hpp" +#include "code/pcDesc.hpp" + // This class is used internally by nmethods, to cache // exception/pc/handler information. @@ -204,7 +210,7 @@ class nmethod : public CodeBlob { ExceptionCache *_exception_cache; PcDescCache _pc_desc_cache; - // These are only used for compiled synchronized native methods to + // These are used for compiled synchronized native methods to // locate the owner and stack slot for the BasicLock so that we can // properly revoke the bias of the owner if necessary. They are // needed because there is no debug information for compiled native @@ -214,8 +220,10 @@ class nmethod : public CodeBlob { // sharing between platforms. Note that currently biased locking // will never cause Class instances to be biased but this code // handles the static synchronized case as well. - ByteSize _compiled_synchronized_native_basic_lock_owner_sp_offset; - ByteSize _compiled_synchronized_native_basic_lock_sp_offset; + // JVMTI's GetLocalInstance() also uses these offsets to find the receiver + // for non-static native wrapper frames. + ByteSize _native_receiver_sp_offset; + ByteSize _native_basic_lock_sp_offset; friend class nmethodLocker; @@ -670,11 +678,11 @@ public: bool is_patchable_at(address instr_address); // UseBiasedLocking support - ByteSize compiled_synchronized_native_basic_lock_owner_sp_offset() { - return _compiled_synchronized_native_basic_lock_owner_sp_offset; + ByteSize native_receiver_sp_offset() { + return _native_receiver_sp_offset; } - ByteSize compiled_synchronized_native_basic_lock_sp_offset() { - return _compiled_synchronized_native_basic_lock_sp_offset; + ByteSize native_basic_lock_sp_offset() { + return _native_basic_lock_sp_offset; } // support for code generation @@ -704,3 +712,5 @@ class nmethodLocker : public StackObj { lock_nmethod(_nm); } }; + +#endif // SHARE_VM_CODE_NMETHOD_HPP diff --git a/hotspot/src/share/vm/code/oopRecorder.cpp b/hotspot/src/share/vm/code/oopRecorder.cpp index 7688079b1f4..1381c0da06c 100644 --- a/hotspot/src/share/vm/code/oopRecorder.cpp +++ b/hotspot/src/share/vm/code/oopRecorder.cpp @@ -22,8 +22,10 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_oopRecorder.cpp.incl" +#include "precompiled.hpp" +#include "code/oopRecorder.hpp" +#include "memory/allocation.inline.hpp" +#include "oops/oop.inline.hpp" #ifdef ASSERT int OopRecorder::_find_index_calls = 0; diff --git a/hotspot/src/share/vm/code/oopRecorder.hpp b/hotspot/src/share/vm/code/oopRecorder.hpp index fda4d290514..0322241fabe 100644 --- a/hotspot/src/share/vm/code/oopRecorder.hpp +++ b/hotspot/src/share/vm/code/oopRecorder.hpp @@ -22,6 +22,12 @@ * */ +#ifndef SHARE_VM_CODE_OOPRECORDER_HPP +#define SHARE_VM_CODE_OOPRECORDER_HPP + +#include "runtime/handles.hpp" +#include "utilities/growableArray.hpp" + // Recording and retrieval of oop relocations in compiled code. class CodeBlob; @@ -134,3 +140,5 @@ class OopRecorder : public ResourceObj { static int _find_index_calls, _hit_indexes, _missed_indexes; #endif }; + +#endif // SHARE_VM_CODE_OOPRECORDER_HPP diff --git a/hotspot/src/share/vm/code/pcDesc.cpp b/hotspot/src/share/vm/code/pcDesc.cpp index b8a9eb47543..7e217998d5c 100644 --- a/hotspot/src/share/vm/code/pcDesc.cpp +++ b/hotspot/src/share/vm/code/pcDesc.cpp @@ -22,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_pcDesc.cpp.incl" +#include "precompiled.hpp" +#include "code/debugInfoRec.hpp" +#include "code/nmethod.hpp" +#include "code/pcDesc.hpp" +#include "code/scopeDesc.hpp" +#include "memory/resourceArea.hpp" PcDesc::PcDesc(int pc_offset, int scope_decode_offset, int obj_decode_offset) { assert(sizeof(PcDescFlags) <= 4, "occupies more than a word"); diff --git a/hotspot/src/share/vm/code/pcDesc.hpp b/hotspot/src/share/vm/code/pcDesc.hpp index 43184d481d8..99a6e4c8ef5 100644 --- a/hotspot/src/share/vm/code/pcDesc.hpp +++ b/hotspot/src/share/vm/code/pcDesc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_CODE_PCDESC_HPP +#define SHARE_VM_CODE_PCDESC_HPP + +#include "memory/allocation.hpp" + // PcDescs map a physical PC (given as offset from start of nmethod) to // the corresponding source scope and byte code index. @@ -86,3 +91,5 @@ class PcDesc VALUE_OBJ_CLASS_SPEC { void print(nmethod* code); bool verify(nmethod* code); }; + +#endif // SHARE_VM_CODE_PCDESC_HPP diff --git a/hotspot/src/share/vm/code/relocInfo.cpp b/hotspot/src/share/vm/code/relocInfo.cpp index a21f34642e4..fa63dc7d827 100644 --- a/hotspot/src/share/vm/code/relocInfo.cpp +++ b/hotspot/src/share/vm/code/relocInfo.cpp @@ -22,8 +22,25 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_relocInfo.cpp.incl" +#include "precompiled.hpp" +#include "code/compiledIC.hpp" +#include "code/nmethod.hpp" +#include "code/relocInfo.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/stubCodeGenerator.hpp" +#include "utilities/copy.hpp" +#ifdef TARGET_ARCH_x86 +# include "assembler_x86.inline.hpp" +# include "nativeInst_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "assembler_sparc.inline.hpp" +# include "nativeInst_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "assembler_zero.inline.hpp" +# include "nativeInst_zero.hpp" +#endif const RelocationHolder RelocationHolder::none; // its type is relocInfo::none @@ -1076,8 +1093,8 @@ void RelocIterator::print_current() { tty->print_cr("(no relocs)"); return; } - tty->print("relocInfo@" INTPTR_FORMAT " [type=%d(%s) addr=" INTPTR_FORMAT, - _current, type(), reloc_type_string((relocInfo::relocType) type()), _addr); + tty->print("relocInfo@" INTPTR_FORMAT " [type=%d(%s) addr=" INTPTR_FORMAT " offset=%d", + _current, type(), reloc_type_string((relocInfo::relocType) type()), _addr, _current->addr_offset()); if (current()->format() != 0) tty->print(" format=%d", current()->format()); if (datalen() == 1) { diff --git a/hotspot/src/share/vm/code/relocInfo.hpp b/hotspot/src/share/vm/code/relocInfo.hpp index 116a097f395..c3c4468a71f 100644 --- a/hotspot/src/share/vm/code/relocInfo.hpp +++ b/hotspot/src/share/vm/code/relocInfo.hpp @@ -22,6 +22,12 @@ * */ +#ifndef SHARE_VM_CODE_RELOCINFO_HPP +#define SHARE_VM_CODE_RELOCINFO_HPP + +#include "memory/allocation.hpp" +#include "utilities/top.hpp" + // Types in this file: // relocInfo // One element of an array of halfwords encoding compressed relocations. @@ -415,7 +421,16 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { static void remove_reloc_info_for_address(RelocIterator *itr, address pc, relocType old_type); // Machine dependent stuff - #include "incls/_relocInfo_pd.hpp.incl" +#ifdef TARGET_ARCH_x86 +# include "relocInfo_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "relocInfo_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "relocInfo_zero.hpp" +#endif + protected: // Derived constant, based on format_width which is PD: @@ -1325,3 +1340,5 @@ class PatchingRelocIterator : public RelocIterator { ~PatchingRelocIterator() { postpass(); } }; + +#endif // SHARE_VM_CODE_RELOCINFO_HPP diff --git a/hotspot/src/share/vm/code/scopeDesc.cpp b/hotspot/src/share/vm/code/scopeDesc.cpp index 9eb1e888e38..b8c2e2d1f4d 100644 --- a/hotspot/src/share/vm/code/scopeDesc.cpp +++ b/hotspot/src/share/vm/code/scopeDesc.cpp @@ -22,8 +22,13 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_scopeDesc.cpp.incl" +#include "precompiled.hpp" +#include "code/debugInfoRec.hpp" +#include "code/pcDesc.hpp" +#include "code/scopeDesc.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop) { diff --git a/hotspot/src/share/vm/code/scopeDesc.hpp b/hotspot/src/share/vm/code/scopeDesc.hpp index 5bff5757d14..2129702eeb2 100644 --- a/hotspot/src/share/vm/code/scopeDesc.hpp +++ b/hotspot/src/share/vm/code/scopeDesc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_CODE_SCOPEDESC_HPP +#define SHARE_VM_CODE_SCOPEDESC_HPP + +#include "code/debugInfo.hpp" +#include "code/pcDesc.hpp" +#include "oops/methodOop.hpp" +#include "utilities/growableArray.hpp" + // SimpleScopeDesc is used when all you need to extract from // a given pc,nmethod pair is a methodOop and a bci. This is // quite a bit faster than allocating a full ScopeDesc, but @@ -125,3 +133,5 @@ class ScopeDesc : public ResourceObj { void print_value_on(outputStream* st) const; #endif }; + +#endif // SHARE_VM_CODE_SCOPEDESC_HPP diff --git a/hotspot/src/share/vm/code/stubs.cpp b/hotspot/src/share/vm/code/stubs.cpp index 7272f467334..124c0a64068 100644 --- a/hotspot/src/share/vm/code/stubs.cpp +++ b/hotspot/src/share/vm/code/stubs.cpp @@ -22,8 +22,12 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_stubs.cpp.incl" +#include "precompiled.hpp" +#include "code/codeBlob.hpp" +#include "code/stubs.hpp" +#include "memory/allocation.inline.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/mutexLocker.hpp" // Implementation of StubQueue diff --git a/hotspot/src/share/vm/code/stubs.hpp b/hotspot/src/share/vm/code/stubs.hpp index d231ba1e719..ed5380f6e04 100644 --- a/hotspot/src/share/vm/code/stubs.hpp +++ b/hotspot/src/share/vm/code/stubs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,20 @@ * */ +#ifndef SHARE_VM_CODE_STUBS_HPP +#define SHARE_VM_CODE_STUBS_HPP + +#include "memory/allocation.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "os_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "os_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "os_windows.inline.hpp" +#endif + // The classes in this file provide a simple framework for the // management of little pieces of machine code - or stubs - // created on the fly and frequently discarded. In this frame- @@ -206,3 +220,5 @@ class StubQueue: public CHeapObj { void verify(); // verifies the stub queue void print(); // prints information about the stub queue }; + +#endif // SHARE_VM_CODE_STUBS_HPP diff --git a/hotspot/src/share/vm/code/vmreg.cpp b/hotspot/src/share/vm/code/vmreg.cpp index dd927bb9f8e..dd5945503b2 100644 --- a/hotspot/src/share/vm/code/vmreg.cpp +++ b/hotspot/src/share/vm/code/vmreg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_vmreg.cpp.incl" +#include "precompiled.hpp" +#include "asm/assembler.hpp" +#include "code/vmreg.hpp" // First VMReg value that could refer to a stack slot VMReg VMRegImpl::stack0 = (VMReg)(intptr_t)((ConcreteRegisterImpl::number_of_registers + 1) & ~1); diff --git a/hotspot/src/share/vm/code/vmreg.hpp b/hotspot/src/share/vm/code/vmreg.hpp index 6bd1fbd4ab5..1be8ea2f8da 100644 --- a/hotspot/src/share/vm/code/vmreg.hpp +++ b/hotspot/src/share/vm/code/vmreg.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,37 @@ * */ +#ifndef SHARE_VM_CODE_VMREG_HPP +#define SHARE_VM_CODE_VMREG_HPP + +#include "memory/allocation.hpp" +#include "utilities/globalDefinitions.hpp" +#ifdef TARGET_ARCH_x86 +# include "register_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "register_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "register_zero.hpp" +#endif +#ifdef COMPILER2 +#include "opto/adlcVMDeps.hpp" +#include "utilities/ostream.hpp" +#ifdef TARGET_ARCH_MODEL_x86_32 +# include "adfiles/adGlobals_x86_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_x86_64 +# include "adfiles/adGlobals_x86_64.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_sparc +# include "adfiles/adGlobals_sparc.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_zero +# include "adfiles/adGlobals_zero.hpp" +#endif +#endif + //------------------------------VMReg------------------------------------------ // The VM uses 'unwarped' stack slots; the compiler uses 'warped' stack slots. // Register numbers below VMRegImpl::stack0 are the same for both. Register @@ -124,7 +155,16 @@ public: static void set_regName(); -#include "incls/_vmreg_pd.hpp.incl" +#ifdef TARGET_ARCH_x86 +# include "vmreg_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "vmreg_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "vmreg_zero.hpp" +#endif + }; @@ -181,3 +221,5 @@ public: VMRegPair(VMReg f) { _second = VMRegImpl::Bad(); _first = f; } VMRegPair() { _second = VMRegImpl::Bad(); _first = VMRegImpl::Bad(); } }; + +#endif // SHARE_VM_CODE_VMREG_HPP diff --git a/hotspot/src/share/vm/code/vtableStubs.cpp b/hotspot/src/share/vm/code/vtableStubs.cpp index e85a8732ff5..ec2881314cf 100644 --- a/hotspot/src/share/vm/code/vtableStubs.cpp +++ b/hotspot/src/share/vm/code/vtableStubs.cpp @@ -22,8 +22,22 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_vtableStubs.cpp.incl" +#include "precompiled.hpp" +#include "code/vtableStubs.hpp" +#include "compiler/disassembler.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/resourceArea.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/klassVtable.hpp" +#include "oops/oop.inline.hpp" +#include "prims/forte.hpp" +#include "prims/jvmtiExport.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/sharedRuntime.hpp" +#ifdef COMPILER2 +#include "opto/matcher.hpp" +#endif // ----------------------------------------------------------------------------------------- // Implementation of VtableStub diff --git a/hotspot/src/share/vm/code/vtableStubs.hpp b/hotspot/src/share/vm/code/vtableStubs.hpp index e74582f98bf..82caf1193fe 100644 --- a/hotspot/src/share/vm/code/vtableStubs.hpp +++ b/hotspot/src/share/vm/code/vtableStubs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_CODE_VTABLESTUBS_HPP +#define SHARE_VM_CODE_VTABLESTUBS_HPP + +#include "code/vmreg.hpp" +#include "memory/allocation.hpp" + // A VtableStub holds an individual code stub for a pair (vtable index, #args) for either itables or vtables // There's a one-to-one relationship between a VtableStub and such a pair. @@ -121,3 +127,5 @@ class VtableStubs : AllStatic { static int number_of_vtable_stubs() { return _number_of_vtable_stubs; } static void initialize(); }; + +#endif // SHARE_VM_CODE_VTABLESTUBS_HPP diff --git a/hotspot/src/share/vm/compiler/abstractCompiler.cpp b/hotspot/src/share/vm/compiler/abstractCompiler.cpp index 893ad7e3ae5..942c168e512 100644 --- a/hotspot/src/share/vm/compiler/abstractCompiler.cpp +++ b/hotspot/src/share/vm/compiler/abstractCompiler.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it @@ -21,9 +21,10 @@ // questions. // -#include "incls/_precompiled.incl" -#include "incls/_abstractCompiler.cpp.incl" +#include "precompiled.hpp" +#include "compiler/abstractCompiler.hpp" +#include "runtime/mutexLocker.hpp" void AbstractCompiler::initialize_runtimes(initializer f, volatile int* state) { if (*state != initialized) { @@ -32,6 +33,7 @@ void AbstractCompiler::initialize_runtimes(initializer f, volatile int* state) { bool do_initialization = false; { ThreadInVMfromNative tv(thread); + ResetNoHandleMark rnhm; MutexLocker only_one(CompileThread_lock, thread); if ( *state == uninitialized) { do_initialization = true; @@ -52,6 +54,7 @@ void AbstractCompiler::initialize_runtimes(initializer f, volatile int* state) { // To in_vm so we can use the lock ThreadInVMfromNative tv(thread); + ResetNoHandleMark rnhm; MutexLocker only_one(CompileThread_lock, thread); assert(*state == initializing, "wrong state"); *state = initialized; diff --git a/hotspot/src/share/vm/compiler/abstractCompiler.hpp b/hotspot/src/share/vm/compiler/abstractCompiler.hpp index 720ded6ebe9..380dfe7bda0 100644 --- a/hotspot/src/share/vm/compiler/abstractCompiler.hpp +++ b/hotspot/src/share/vm/compiler/abstractCompiler.hpp @@ -22,6 +22,11 @@ * */ +#ifndef SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP +#define SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP + +#include "ci/compilerInterface.hpp" + typedef void (*initializer)(void); class AbstractCompiler : public CHeapObj { @@ -88,3 +93,5 @@ class AbstractCompiler : public CHeapObj { ShouldNotReachHere(); } }; + +#endif // SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index 213ea0cc48c..7c432b42241 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -22,8 +22,37 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_compileBroker.cpp.incl" +#include "precompiled.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" +#include "compiler/compileBroker.hpp" +#include "compiler/compileLog.hpp" +#include "compiler/compilerOracle.hpp" +#include "interpreter/linkResolver.hpp" +#include "memory/allocation.inline.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/nativeLookup.hpp" +#include "runtime/arguments.hpp" +#include "runtime/compilationPolicy.hpp" +#include "runtime/init.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/os.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/sweeper.hpp" +#include "utilities/dtrace.hpp" +#ifdef COMPILER1 +#include "c1/c1_Compiler.hpp" +#endif +#ifdef COMPILER2 +#include "opto/c2compiler.hpp" +#endif +#ifdef SHARK +#include "shark/sharkCompiler.hpp" +#endif #ifdef DTRACE_ENABLED @@ -522,6 +551,7 @@ CompilerCounters::CompilerCounters(const char* thread_name, int instance, TRAPS) void CompileBroker::compilation_init() { _last_method_compiled[0] = '\0'; +#ifndef SHARK // Set the interface to the current compiler(s). int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple); int c2_count = CompilationPolicy::policy()->compiler_count(CompLevel_full_optimization); @@ -537,13 +567,12 @@ void CompileBroker::compilation_init() { } #endif // COMPILER2 -#ifdef SHARK -#if defined(COMPILER1) || defined(COMPILER2) -#error "Can't use COMPILER1 or COMPILER2 with shark" -#endif - _compilers[0] = new SharkCompiler(); - _compilers[1] = _compilers[0]; -#endif +#else // SHARK + int c1_count = 0; + int c2_count = 1; + + _compilers[1] = new SharkCompiler(); +#endif // SHARK // Initialize the CompileTask free list _task_free_list = NULL; @@ -1535,7 +1564,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { //assert(false, "compiler should always document failure"); // The compiler elected, without comment, not to register a result. // Do not attempt further compilations of this method. - ci_env.record_method_not_compilable("compile failed"); + ci_env.record_method_not_compilable("compile failed", !TieredCompilation); } if (ci_env.failing()) { @@ -1544,15 +1573,8 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { if (PrintCompilation) { const char* reason = ci_env.failure_reason(); if (compilable == ciEnv::MethodCompilable_not_at_tier) { - if (is_highest_tier_compile(ci_env.comp_level())) { - // Already at highest tier, promote to not compilable. - compilable = ciEnv::MethodCompilable_never; - } else { tty->print_cr("%3d COMPILE SKIPPED: %s (retry at different tier)", compile_id, reason); - } - } - - if (compilable == ciEnv::MethodCompilable_never) { + } else if (compilable == ciEnv::MethodCompilable_never) { tty->print_cr("%3d COMPILE SKIPPED: %s (not retryable)", compile_id, reason); } else if (compilable == ciEnv::MethodCompilable) { tty->print_cr("%3d COMPILE SKIPPED: %s", compile_id, reason); diff --git a/hotspot/src/share/vm/compiler/compileBroker.hpp b/hotspot/src/share/vm/compiler/compileBroker.hpp index e0845fb89b0..515bfb4052e 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.hpp +++ b/hotspot/src/share/vm/compiler/compileBroker.hpp @@ -22,6 +22,13 @@ * */ +#ifndef SHARE_VM_COMPILER_COMPILEBROKER_HPP +#define SHARE_VM_COMPILER_COMPILEBROKER_HPP + +#include "ci/compilerInterface.hpp" +#include "compiler/abstractCompiler.hpp" +#include "runtime/perfData.hpp" + class nmethod; class nmethodLocker; @@ -380,3 +387,5 @@ class CompileBroker: AllStatic { static void print_compiler_threads_on(outputStream* st); }; + +#endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP diff --git a/hotspot/src/share/vm/compiler/compileLog.cpp b/hotspot/src/share/vm/compiler/compileLog.cpp index 0aae000f617..a306117f965 100644 --- a/hotspot/src/share/vm/compiler/compileLog.cpp +++ b/hotspot/src/share/vm/compiler/compileLog.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_compileLog.cpp.incl" +#include "precompiled.hpp" +#include "ci/ciMethod.hpp" +#include "compiler/compileLog.hpp" +#include "memory/allocation.inline.hpp" +#include "oops/methodOop.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/os.hpp" CompileLog* CompileLog::_first = NULL; diff --git a/hotspot/src/share/vm/compiler/compileLog.hpp b/hotspot/src/share/vm/compiler/compileLog.hpp index 5d1ed80e4cb..8e7b4512289 100644 --- a/hotspot/src/share/vm/compiler/compileLog.hpp +++ b/hotspot/src/share/vm/compiler/compileLog.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_COMPILER_COMPILELOG_HPP +#define SHARE_VM_COMPILER_COMPILELOG_HPP + +#include "utilities/xmlstream.hpp" + class ciObject; class ciSymbol; @@ -75,3 +80,5 @@ class CompileLog : public xmlStream { static void finish_log(outputStream* out); static void finish_log_on_error(outputStream* out, char *buf, int buflen); }; + +#endif // SHARE_VM_COMPILER_COMPILELOG_HPP diff --git a/hotspot/src/share/vm/compiler/compilerOracle.cpp b/hotspot/src/share/vm/compiler/compilerOracle.cpp index 888f188de60..31464896198 100644 --- a/hotspot/src/share/vm/compiler/compilerOracle.cpp +++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,17 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_compilerOracle.cpp.incl" +#include "precompiled.hpp" +#include "compiler/compilerOracle.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/oopFactory.hpp" +#include "memory/resourceArea.hpp" +#include "oops/klass.hpp" +#include "oops/methodOop.hpp" +#include "oops/oop.inline.hpp" +#include "oops/symbolOop.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/jniHandles.hpp" class MethodMatcher : public CHeapObj { public: @@ -323,7 +332,7 @@ static OracleCommand parse_command_name(const char * line, int* bytes_read) { "command_names size mismatch"); *bytes_read = 0; - char command[32]; + char command[33]; int result = sscanf(line, "%32[a-z]%n", command, bytes_read); for (uint i = 0; i < ARRAY_SIZE(command_names); i++) { if (strcmp(command, command_names[i]) == 0) { @@ -461,6 +470,12 @@ void CompilerOracle::parse_from_line(char* line) { OracleCommand command = parse_command_name(line, &bytes_read); line += bytes_read; + if (command == UnknownCommand) { + tty->print_cr("CompilerOracle: unrecognized line"); + tty->print_cr(" \"%s\"", original_line); + return; + } + if (command == QuietCommand) { _quiet = true; return; @@ -489,7 +504,7 @@ void CompilerOracle::parse_from_line(char* line) { line += bytes_read; // there might be a signature following the method. // signatures always begin with ( so match that by hand - if (1 == sscanf(line, "%*[ \t](%254[);/" RANGEBASE "]%n", sig + 1, &bytes_read)) { + if (1 == sscanf(line, "%*[ \t](%254[[);/" RANGEBASE "]%n", sig + 1, &bytes_read)) { sig[0] = '('; line += bytes_read; signature = oopFactory::new_symbol_handle(sig, CHECK); diff --git a/hotspot/src/share/vm/compiler/compilerOracle.hpp b/hotspot/src/share/vm/compiler/compilerOracle.hpp index 2d79230b104..fd5b0fbcc19 100644 --- a/hotspot/src/share/vm/compiler/compilerOracle.hpp +++ b/hotspot/src/share/vm/compiler/compilerOracle.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_COMPILER_COMPILERORACLE_HPP +#define SHARE_VM_COMPILER_COMPILERORACLE_HPP + +#include "memory/allocation.hpp" +#include "oops/oopsHierarchy.hpp" + // CompilerOracle is an interface for turning on and off compilation // for some methods @@ -66,3 +72,5 @@ class CompilerOracle : AllStatic { static void append_comment_to_file(const char* message); static void append_exclude_to_file(methodHandle method); }; + +#endif // SHARE_VM_COMPILER_COMPILERORACLE_HPP diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp index 175d874da8c..f81ce0e686b 100644 --- a/hotspot/src/share/vm/compiler/disassembler.cpp +++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -22,8 +22,28 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_disassembler.cpp.incl" +#include "precompiled.hpp" +#include "classfile/javaClasses.hpp" +#include "code/codeCache.hpp" +#include "compiler/disassembler.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "runtime/fprofiler.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/stubCodeGenerator.hpp" +#include "runtime/stubRoutines.hpp" +#ifdef TARGET_ARCH_x86 +# include "depChecker_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "depChecker_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "depChecker_zero.hpp" +#endif +#ifdef SHARK +#include "shark/sharkEntry.hpp" +#endif void* Disassembler::_library = NULL; bool Disassembler::_tried_to_load_library = false; @@ -63,17 +83,17 @@ bool Disassembler::load_library() { // Find the disassembler next to libjvm.so. strcpy(&buf[jvm_offset], hsdis_library_name); strcat(&buf[jvm_offset], os::dll_file_extension()); - _library = hpi::dll_load(buf, ebuf, sizeof ebuf); + _library = os::dll_load(buf, ebuf, sizeof ebuf); } if (_library == NULL) { // Try a free-floating lookup. strcpy(&buf[0], hsdis_library_name); strcat(&buf[0], os::dll_file_extension()); - _library = hpi::dll_load(buf, ebuf, sizeof ebuf); + _library = os::dll_load(buf, ebuf, sizeof ebuf); } if (_library != NULL) { _decode_instructions = CAST_TO_FN_PTR(Disassembler::decode_func, - hpi::dll_lookup(_library, decode_instructions_name)); + os::dll_lookup(_library, decode_instructions_name)); } _tried_to_load_library = true; if (_decode_instructions == NULL) { @@ -446,5 +466,18 @@ void Disassembler::decode(nmethod* nm, outputStream* st) { env.set_total_ticks(total_bucket_count); } + // Print constant table. + if (nm->consts_size() > 0) { + nm->print_nmethod_labels(env.output(), nm->consts_begin()); + int offset = 0; + for (address p = nm->consts_begin(); p < nm->consts_end(); p += 4, offset += 4) { + if ((offset % 8) == 0) { + env.output()->print_cr(" " INTPTR_FORMAT " (offset: %4d): " PTR32_FORMAT " " PTR64_FORMAT, (intptr_t) p, offset, *((int32_t*) p), *((int64_t*) p)); + } else { + env.output()->print_cr(" " INTPTR_FORMAT " (offset: %4d): " PTR32_FORMAT, (intptr_t) p, offset, *((int32_t*) p)); + } + } + } + env.decode_instructions(p, end); } diff --git a/hotspot/src/share/vm/compiler/disassembler.hpp b/hotspot/src/share/vm/compiler/disassembler.hpp index faee0401a55..f954109228a 100644 --- a/hotspot/src/share/vm/compiler/disassembler.hpp +++ b/hotspot/src/share/vm/compiler/disassembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,20 @@ * */ +#ifndef SHARE_VM_COMPILER_DISASSEMBLER_HPP +#define SHARE_VM_COMPILER_DISASSEMBLER_HPP + +#include "runtime/globals.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "os_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "os_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "os_windows.inline.hpp" +#endif + class decode_env; // The disassembler prints out assembly code annotated @@ -47,7 +61,16 @@ class Disassembler { static bool load_library(); // Machine dependent stuff - #include "incls/_disassembler_pd.hpp.incl" +#ifdef TARGET_ARCH_x86 +# include "disassembler_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "disassembler_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "disassembler_zero.hpp" +#endif + public: static bool can_decode() { @@ -57,3 +80,5 @@ class Disassembler { static void decode(nmethod* nm, outputStream* st = NULL); static void decode(address begin, address end, outputStream* st = NULL); }; + +#endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP diff --git a/hotspot/src/share/vm/compiler/methodLiveness.cpp b/hotspot/src/share/vm/compiler/methodLiveness.cpp index f9f8a3d0df0..42450ec10ea 100644 --- a/hotspot/src/share/vm/compiler/methodLiveness.cpp +++ b/hotspot/src/share/vm/compiler/methodLiveness.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#include "precompiled.hpp" +#include "ci/ciMethod.hpp" +#include "ci/ciMethodBlocks.hpp" +#include "ci/ciStreams.hpp" +#include "compiler/methodLiveness.hpp" +#include "interpreter/bytecode.hpp" +#include "interpreter/bytecodes.hpp" +#include "memory/allocation.inline.hpp" +#include "utilities/bitMap.inline.hpp" + // The MethodLiveness class performs a simple liveness analysis on a method // in order to decide which locals are live (that is, will be used again) at // a particular bytecode index (bci). @@ -60,9 +70,6 @@ // analysis. -# include "incls/_precompiled.incl" -# include "incls/_methodLiveness.cpp.incl" - //-------------------------------------------------------------------------- // The BitCounter class is used for counting the number of bits set in // some BitMap. It is only used when collecting liveness statistics. diff --git a/hotspot/src/share/vm/compiler/methodLiveness.hpp b/hotspot/src/share/vm/compiler/methodLiveness.hpp index f7785119742..0a63d2a19dd 100644 --- a/hotspot/src/share/vm/compiler/methodLiveness.hpp +++ b/hotspot/src/share/vm/compiler/methodLiveness.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_COMPILER_METHODLIVENESS_HPP +#define SHARE_VM_COMPILER_METHODLIVENESS_HPP + +#include "utilities/bitMap.hpp" +#include "utilities/growableArray.hpp" + class ciMethod; class MethodLivenessResult : public BitMap { @@ -269,3 +275,5 @@ class MethodLiveness : public ResourceObj { static void print_times() PRODUCT_RETURN; }; + +#endif // SHARE_VM_COMPILER_METHODLIVENESS_HPP diff --git a/hotspot/src/share/vm/compiler/oopMap.cpp b/hotspot/src/share/vm/compiler/oopMap.cpp index cb8e69690a9..5edd26a4440 100644 --- a/hotspot/src/share/vm/compiler/oopMap.cpp +++ b/hotspot/src/share/vm/compiler/oopMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,20 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_oopMap.cpp.incl" +#include "precompiled.hpp" +#include "code/codeBlob.hpp" +#include "code/codeCache.hpp" +#include "code/nmethod.hpp" +#include "code/scopeDesc.hpp" +#include "compiler/oopMap.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/signature.hpp" +#ifdef COMPILER1 +#include "c1/c1_Defs.hpp" +#endif // OopMapStream diff --git a/hotspot/src/share/vm/compiler/oopMap.hpp b/hotspot/src/share/vm/compiler/oopMap.hpp index c179d2b34ff..0a73fc5c6bc 100644 --- a/hotspot/src/share/vm/compiler/oopMap.hpp +++ b/hotspot/src/share/vm/compiler/oopMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_COMPILER_OOPMAP_HPP +#define SHARE_VM_COMPILER_OOPMAP_HPP + +#include "code/compressedStream.hpp" +#include "code/vmreg.hpp" +#include "memory/allocation.hpp" +#include "utilities/growableArray.hpp" + // Interface for generating the frame map for compiled code. A frame map // describes for a specific pc whether each register and frame stack slot is: // Oop - A GC root for current frame @@ -315,3 +323,5 @@ class DerivedPointerTableDeactivate: public StackObj { } }; #endif // COMPILER2 + +#endif // SHARE_VM_COMPILER_OOPMAP_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp index 5455523a96e..63afa40defe 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 (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_binaryTreeDictionary.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp" +#include "gc_implementation/shared/allocationStats.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "memory/space.inline.hpp" +#include "runtime/globals.hpp" +#include "utilities/ostream.hpp" //////////////////////////////////////////////////////////////////////////////// // A binary tree based search structure for free blocks. diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp index 05c7f90dca3..f06f8d38548 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 (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_BINARYTREEDICTIONARY_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_BINARYTREEDICTIONARY_HPP + +#include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp" +#include "gc_implementation/concurrentMarkSweep/freeList.hpp" + /* * A binary tree based search structure for free blocks. * This is currently used in the Concurrent Mark&Sweep implementation. @@ -286,3 +292,5 @@ class BinaryTreeDictionary: public FreeBlockDictionary { void verify() const; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_BINARYTREEDICTIONARY_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp index e93e4250974..5bee77ef239 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,9 +21,22 @@ * questions. * */ -#include "incls/_precompiled.incl" -#include "incls/_cmsAdaptiveSizePolicy.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp" +#include "gc_implementation/shared/gcStats.hpp" +#include "memory/defNewGeneration.hpp" +#include "memory/genCollectedHeap.hpp" +#include "runtime/thread.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "os_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "os_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "os_windows.inline.hpp" +#endif elapsedTimer CMSAdaptiveSizePolicy::_concurrent_timer; elapsedTimer CMSAdaptiveSizePolicy::_STW_timer; diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp index 9c4ac46c695..ec418e689b5 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSADAPTIVESIZEPOLICY_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSADAPTIVESIZEPOLICY_HPP + +#include "gc_implementation/shared/adaptiveSizePolicy.hpp" +#include "runtime/timer.hpp" + // This class keeps statistical information and computes the // size of the heap for the concurrent mark sweep collector. // @@ -467,3 +473,5 @@ class CMSAdaptiveSizePolicy : public AdaptiveSizePolicy { // Printing support virtual bool print_adaptive_size_policy_on(outputStream* st) const; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSADAPTIVESIZEPOLICY_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp index 78c9dc11103..cbe5953a365 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,34 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_cmsCollectorPolicy.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp" +#include "gc_implementation/parNew/parNewGeneration.hpp" +#include "gc_implementation/shared/gcPolicyCounters.hpp" +#include "gc_implementation/shared/vmGCOperations.hpp" +#include "memory/cardTableRS.hpp" +#include "memory/collectorPolicy.hpp" +#include "memory/gcLocker.inline.hpp" +#include "memory/genCollectedHeap.hpp" +#include "memory/generationSpec.hpp" +#include "memory/space.hpp" +#include "memory/universe.hpp" +#include "runtime/arguments.hpp" +#include "runtime/globals_extension.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/java.hpp" +#include "runtime/vmThread.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif // // ConcurrentMarkSweepPolicy methods @@ -39,7 +65,7 @@ void ConcurrentMarkSweepPolicy::initialize_generations() { if (_generations == NULL) vm_exit_during_initialization("Unable to allocate gen spec"); - if (UseParNewGC && ParallelGCThreads > 0) { + if (ParNewGeneration::in_use()) { if (UseAdaptiveSizePolicy) { _generations[0] = new GenerationSpec(Generation::ASParNew, _initial_gen0_size, _max_gen0_size); @@ -79,7 +105,7 @@ void ConcurrentMarkSweepPolicy::initialize_size_policy(size_t init_eden_size, void ConcurrentMarkSweepPolicy::initialize_gc_policy_counters() { // initialize the policy counters - 2 collectors, 3 generations - if (UseParNewGC && ParallelGCThreads > 0) { + if (ParNewGeneration::in_use()) { _gc_policy_counters = new GCPolicyCounters("ParNew:CMS", 2, 3); } else { @@ -102,7 +128,7 @@ void ASConcurrentMarkSweepPolicy::initialize_gc_policy_counters() { assert(size_policy() != NULL, "A size policy is required"); // initialize the policy counters - 2 collectors, 3 generations - if (UseParNewGC && ParallelGCThreads > 0) { + if (ParNewGeneration::in_use()) { _gc_policy_counters = new CMSGCAdaptivePolicyCounters("ParNew:CMS", 2, 3, size_policy()); } diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp index 28a7980a7d6..1483bca13eb 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp @@ -22,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSCOLLECTORPOLICY_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSCOLLECTORPOLICY_HPP + +#include "memory/collectorPolicy.hpp" + class ConcurrentMarkSweepPolicy : public TwoGenerationCollectorPolicy { protected: void initialize_generations(); @@ -55,3 +60,5 @@ class ASConcurrentMarkSweepPolicy : public ConcurrentMarkSweepPolicy { return CollectorPolicy::ASConcurrentMarkSweepPolicyKind; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSCOLLECTORPOLICY_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp index 08b24387e7a..8e633b65f15 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_cmsGCAdaptivePolicyCounters.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp" +#include "memory/resourceArea.hpp" CMSGCAdaptivePolicyCounters::CMSGCAdaptivePolicyCounters(const char* name_arg, int collectors, diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp index 0d33c63b356..3fe7d136f23 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP + +#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp" +#include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp" +#include "gc_implementation/shared/gcStats.hpp" +#include "runtime/perfData.hpp" + // CMSGCAdaptivePolicyCounters is a holder class for performance counters // that track the data and decisions for the ergonomics policy for the // concurrent mark sweep collector @@ -298,3 +306,5 @@ class CMSGCAdaptivePolicyCounters : public GCAdaptivePolicyCounters { return GCPolicyCounters::CMSGCAdaptivePolicyCountersKind; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.cpp index 04f0a565753..b6243b73724 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_cmsLockVerifier.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" +#include "runtime/vmThread.hpp" ///////////// Locking verification specific to CMS ////////////// // Much like "assert_lock_strong()", except that it relaxes the diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp index 605ec2a041c..632ecc2636a 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSLOCKVERIFIER_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSLOCKVERIFIER_HPP + +#include "runtime/mutex.hpp" + ///////////// Locking verification specific to CMS ////////////// // Much like "assert_lock_strong()", except // that it relaxes the assertion somewhat for the parallel GC case, where @@ -38,3 +43,5 @@ class CMSLockVerifier: AllStatic { assert_locked(lock, NULL); } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSLOCKVERIFIER_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp index 8af73e2ea81..1223fa8872b 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP + +#include "memory/genOopClosures.hpp" + ///////////////////////////////////////////////////////////////// // Closures used by ConcurrentMarkSweepGeneration's collector ///////////////////////////////////////////////////////////////// @@ -427,3 +432,5 @@ class CMSParKeepAliveClosure: public Par_KlassRememberingOopClosure { inline void do_oop_nv(oop* p) { CMSParKeepAliveClosure::do_oop_work(p); } inline void do_oop_nv(narrowOop* p) { CMSParKeepAliveClosure::do_oop_work(p); } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp index 9179ff7b89e..a66c5cb24d8 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP + +#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp" + // Trim our work_queue so its length is below max at return inline void Par_MarkRefsIntoAndScanClosure::trim_queue(uint max) { while (_work_queue->size() > max) { @@ -74,3 +80,5 @@ inline void PushOrMarkClosure::do_yield_check() { inline void Par_PushOrMarkClosure::do_yield_check() { _parent->do_yield_check(); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.cpp index 9d5929d0c81..bdcbb467c8b 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,19 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_cmsPermGen.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp" +#include "gc_implementation/shared/cSpaceCounters.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "memory/blockOffsetTable.inline.hpp" +#include "memory/compactPermGen.hpp" +#include "memory/genCollectedHeap.hpp" +#include "memory/generation.inline.hpp" +#include "memory/permGen.hpp" +#include "memory/universe.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/java.hpp" CMSPermGen::CMSPermGen(ReservedSpace rs, size_t initial_byte_size, CardTableRS* ct, @@ -50,6 +61,18 @@ HeapWord* CMSPermGen::mem_allocate(size_t size) { } } +HeapWord* CMSPermGen::request_expand_and_allocate(Generation* gen, + size_t size, + GCCause::Cause prev_cause /* ignored */) { + HeapWord* obj = gen->expand_and_allocate(size, false); + if (gen->capacity() >= _capacity_expansion_limit) { + set_capacity_expansion_limit(gen->capacity() + MaxPermHeapExpansion); + assert(((ConcurrentMarkSweepGeneration*)gen)->should_concurrent_collect(), + "Should kick off a collection if one not in progress"); + } + return obj; +} + void CMSPermGen::compute_new_size() { _gen->compute_new_size(); } diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.hpp index 3c9d9f7f767..6d464f7170d 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSPERMGEN_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSPERMGEN_HPP + +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp" +#include "memory/permGen.hpp" + class CardTableRS; // fwd decl class ConcurrentMarkSweepGeneration; @@ -33,6 +39,10 @@ class CMSPermGen: public PermGen { // The "generation" view. ConcurrentMarkSweepGeneration* _gen; + // Override default implementation from PermGen + virtual HeapWord* request_expand_and_allocate(Generation* gen, size_t size, + GCCause::Cause prev_cause); + public: CMSPermGen(ReservedSpace rs, size_t initial_byte_size, CardTableRS* ct, FreeBlockDictionary::DictionaryChoice); @@ -71,3 +81,5 @@ public: bool must_be_youngest() const { return false; } bool must_be_oldest() const { return false; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSPERMGEN_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp index 7c1d13de3f8..953456f5ca2 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @@ -22,8 +22,25 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_compactibleFreeListSpace.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp" +#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" +#include "gc_implementation/shared/liveRange.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/blockOffsetTable.inline.hpp" +#include "memory/resourceArea.hpp" +#include "memory/universe.inline.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/globals.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/init.hpp" +#include "runtime/java.hpp" +#include "runtime/vmThread.hpp" +#include "utilities/copy.hpp" ///////////////////////////////////////////////////////////////////////// //// CompactibleFreeListSpace @@ -124,7 +141,8 @@ CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs, checkFreeListConsistency(); // Initialize locks for parallel case. - if (ParallelGCThreads > 0) { + + if (CollectedHeap::use_parallel_gc_threads()) { for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { _indexedFreeListParLocks[i] = new Mutex(Mutex::leaf - 1, // == ExpandHeap_lock - 1 "a freelist par lock", @@ -1071,7 +1089,8 @@ bool CompactibleFreeListSpace::block_is_obj(const HeapWord* p) const { // at address below "p" in finding the object that contains "p" // 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"); + // assert(CollectedHeap::use_parallel_gc_threads() || _bt.block_start(p) == p, + // "Should be a block boundary"); if (FreeChunk::indicatesFreeChunk(p)) return false; klassOop k = oop(p)->klass_or_null(); if (k != NULL) { @@ -1091,7 +1110,9 @@ bool CompactibleFreeListSpace::block_is_obj(const HeapWord* p) const { // perm_gen_verify_bit_map where we store the "deadness" information if // we did not sweep the perm gen in the most recent previous GC cycle. bool CompactibleFreeListSpace::obj_is_alive(const HeapWord* p) const { - assert (block_is_obj(p), "The address should point to an object"); + assert(SafepointSynchronize::is_at_safepoint() || !is_init_completed(), + "Else races are possible"); + assert(block_is_obj(p), "The address should point to an object"); // If we're sweeping, we use object liveness information from the main bit map // for both perm gen and old gen. @@ -1100,9 +1121,14 @@ bool CompactibleFreeListSpace::obj_is_alive(const HeapWord* p) const { // main marking bit map (live_map below) is locked, // OR we're in other phases and perm_gen_verify_bit_map (dead_map below) // is stable, because it's mutated only in the sweeping phase. + // NOTE: This method is also used by jmap where, if class unloading is + // off, the results can return "false" for legitimate perm objects, + // when we are not in the midst of a sweeping phase, which can result + // in jmap not reporting certain perm gen objects. This will be moot + // if/when the perm gen goes away in the future. if (_collector->abstract_state() == CMSCollector::Sweeping) { CMSBitMap* live_map = _collector->markBitMap(); - return live_map->isMarked((HeapWord*) p); + return live_map->par_isMarked((HeapWord*) p); } else { // If we're not currently sweeping and we haven't swept the perm gen in // the previous concurrent cycle then we may have dead but unswept objects @@ -2264,7 +2290,7 @@ void CompactibleFreeListSpace::split(size_t from, size_t to1) { } void CompactibleFreeListSpace::print() const { - Space::print_on(tty); + print_on(tty); } void CompactibleFreeListSpace::prepare_for_verify() { @@ -2932,7 +2958,9 @@ initialize_sequential_subtasks_for_rescan(int n_threads) { "n_tasks calculation incorrect"); SequentialSubTasksDone* pst = conc_par_seq_tasks(); assert(!pst->valid(), "Clobbering existing data?"); - pst->set_par_threads(n_threads); + // Sets the condition for completion of the subtask (how many threads + // need to finish in order to be done). + pst->set_n_threads(n_threads); pst->set_n_tasks((int)n_tasks); } @@ -2972,6 +3000,8 @@ initialize_sequential_subtasks_for_marking(int n_threads, "n_tasks calculation incorrect"); SequentialSubTasksDone* pst = conc_par_seq_tasks(); assert(!pst->valid(), "Clobbering existing data?"); - pst->set_par_threads(n_threads); + // Sets the condition for completion of the subtask (how many threads + // need to finish in order to be done). + pst->set_n_threads(n_threads); pst->set_n_tasks((int)n_tasks); } diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp index 6d67e941161..f00f6b2926b 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp @@ -22,6 +22,15 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_COMPACTIBLEFREELISTSPACE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_COMPACTIBLEFREELISTSPACE_HPP + +#include "gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp" +#include "gc_implementation/concurrentMarkSweep/freeList.hpp" +#include "gc_implementation/concurrentMarkSweep/promotionInfo.hpp" +#include "memory/blockOffsetTable.inline.hpp" +#include "memory/space.hpp" + // Classes in support of keeping track of promotions into a non-Contiguous // space, in this case a CompactibleFreeListSpace. @@ -646,3 +655,5 @@ size_t PromotionInfo::refillSize() const { * CMSSpoolBlockSize); return CompactibleFreeListSpace::adjustObjectSize(sz); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_COMPACTIBLEFREELISTSPACE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp index aab22dacf17..36a070a1826 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @@ -22,8 +22,39 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_concurrentMarkSweepGeneration.cpp.incl" +#include "precompiled.hpp" +#include "classfile/symbolTable.hpp" +#include "classfile/systemDictionary.hpp" +#include "code/codeCache.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp" +#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" +#include "gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp" +#include "gc_implementation/parNew/parNewGeneration.hpp" +#include "gc_implementation/shared/collectorCounters.hpp" +#include "gc_implementation/shared/isGCActiveMark.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "memory/cardTableRS.hpp" +#include "memory/collectorPolicy.hpp" +#include "memory/gcLocker.inline.hpp" +#include "memory/genCollectedHeap.hpp" +#include "memory/genMarkSweep.hpp" +#include "memory/genOopClosures.inline.hpp" +#include "memory/iterator.hpp" +#include "memory/referencePolicy.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "runtime/globals_extension.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/java.hpp" +#include "runtime/vmThread.hpp" +#include "services/memoryService.hpp" +#include "services/runtimeService.hpp" // statics CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL; @@ -195,7 +226,7 @@ ConcurrentMarkSweepGeneration::ConcurrentMarkSweepGeneration( "Offset of FreeChunk::_prev within FreeChunk must match" " that of OopDesc::_klass within OopDesc"); ) - if (ParallelGCThreads > 0) { + if (CollectedHeap::use_parallel_gc_threads()) { typedef CMSParGCThreadState* CMSParGCThreadStatePtr; _par_gc_thread_states = NEW_C_HEAP_ARRAY(CMSParGCThreadStatePtr, ParallelGCThreads); @@ -354,12 +385,8 @@ void CMSStats::adjust_cms_free_adjustment_factor(bool fail, size_t free) { double CMSStats::time_until_cms_gen_full() const { size_t cms_free = _cms_gen->cmsSpace()->free(); GenCollectedHeap* gch = GenCollectedHeap::heap(); - size_t expected_promotion = gch->get_gen(0)->capacity(); - if (HandlePromotionFailure) { - expected_promotion = MIN2( - (size_t) _cms_gen->gc_stats()->avg_promoted()->padded_average(), - expected_promotion); - } + size_t expected_promotion = MIN2(gch->get_gen(0)->capacity(), + (size_t) _cms_gen->gc_stats()->avg_promoted()->padded_average()); if (cms_free > expected_promotion) { // Start a cms collection if there isn't enough space to promote // for the next minor collection. Use the padded average as @@ -540,8 +567,6 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen, _is_alive_closure(_span, &_markBitMap), _restart_addr(NULL), _overflow_list(NULL), - _preserved_oop_stack(NULL), - _preserved_mark_stack(NULL), _stats(cmsGen), _eden_chunk_array(NULL), // may be set in ctor body _eden_chunk_capacity(0), // -- ditto -- @@ -616,7 +641,7 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen, } // Support for multi-threaded concurrent phases - if (ParallelGCThreads > 0 && CMSConcurrentMTEnabled) { + if (CollectedHeap::use_parallel_gc_threads() && CMSConcurrentMTEnabled) { if (FLAG_IS_DEFAULT(ConcGCThreads)) { // just for now FLAG_SET_DEFAULT(ConcGCThreads, (ParallelGCThreads + 3)/4); @@ -628,6 +653,8 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen, warning("GC/CMS: _conc_workers allocation failure: " "forcing -CMSConcurrentMTEnabled"); CMSConcurrentMTEnabled = false; + } else { + _conc_workers->initialize_workers(); } } else { CMSConcurrentMTEnabled = false; @@ -865,57 +892,18 @@ size_t ConcurrentMarkSweepGeneration::max_available() const { return free() + _virtual_space.uncommitted_size(); } -bool ConcurrentMarkSweepGeneration::promotion_attempt_is_safe( - size_t max_promotion_in_bytes, - bool younger_handles_promotion_failure) const { - - // This is the most conservative test. Full promotion is - // guaranteed if this is used. The multiplicative factor is to - // account for the worst case "dilatation". - double adjusted_max_promo_bytes = _dilatation_factor * max_promotion_in_bytes; - if (adjusted_max_promo_bytes > (double)max_uintx) { // larger than size_t - adjusted_max_promo_bytes = (double)max_uintx; +bool ConcurrentMarkSweepGeneration::promotion_attempt_is_safe(size_t max_promotion_in_bytes) const { + size_t available = max_available(); + size_t av_promo = (size_t)gc_stats()->avg_promoted()->padded_average(); + bool res = (available >= av_promo) || (available >= max_promotion_in_bytes); + if (Verbose && PrintGCDetails) { + gclog_or_tty->print_cr( + "CMS: promo attempt is%s safe: available("SIZE_FORMAT") %s av_promo("SIZE_FORMAT")," + "max_promo("SIZE_FORMAT")", + res? "":" not", available, res? ">=":"<", + av_promo, max_promotion_in_bytes); } - bool result = (max_contiguous_available() >= (size_t)adjusted_max_promo_bytes); - - if (younger_handles_promotion_failure && !result) { - // Full promotion is not guaranteed because fragmentation - // of the cms generation can prevent the full promotion. - result = (max_available() >= (size_t)adjusted_max_promo_bytes); - - if (!result) { - // With promotion failure handling the test for the ability - // to support the promotion does not have to be guaranteed. - // Use an average of the amount promoted. - result = max_available() >= (size_t) - gc_stats()->avg_promoted()->padded_average(); - if (PrintGC && Verbose && result) { - gclog_or_tty->print_cr( - "\nConcurrentMarkSweepGeneration::promotion_attempt_is_safe" - " max_available: " SIZE_FORMAT - " avg_promoted: " SIZE_FORMAT, - max_available(), (size_t) - gc_stats()->avg_promoted()->padded_average()); - } - } else { - if (PrintGC && Verbose) { - gclog_or_tty->print_cr( - "\nConcurrentMarkSweepGeneration::promotion_attempt_is_safe" - " max_available: " SIZE_FORMAT - " adj_max_promo_bytes: " SIZE_FORMAT, - max_available(), (size_t)adjusted_max_promo_bytes); - } - } - } else { - if (PrintGC && Verbose) { - gclog_or_tty->print_cr( - "\nConcurrentMarkSweepGeneration::promotion_attempt_is_safe" - " contiguous_available: " SIZE_FORMAT - " adj_max_promo_bytes: " SIZE_FORMAT, - max_contiguous_available(), (size_t)adjusted_max_promo_bytes); - } - } - return result; + return res; } // At a promotion failure dump information on block layout in heap @@ -936,7 +924,7 @@ void ConcurrentMarkSweepGeneration::reset_after_compaction() { // along with all the other pointers into the heap but // compaction is expected to be a rare event with // a heap using cms so don't do it without seeing the need. - if (ParallelGCThreads > 0) { + if (CollectedHeap::use_parallel_gc_threads()) { for (uint i = 0; i < ParallelGCThreads; i++) { _par_gc_thread_states[i]->promo.reset(); } @@ -1574,8 +1562,8 @@ bool CMSCollector::shouldConcurrentCollect() { GenCollectedHeap* gch = GenCollectedHeap::heap(); assert(gch->collector_policy()->is_two_generation_policy(), "You may want to check the correctness of the following"); - if (gch->incremental_collection_will_fail()) { - if (PrintGCDetails && Verbose) { + if (gch->incremental_collection_will_fail(true /* consult_young */)) { + if (Verbose && PrintGCDetails) { gclog_or_tty->print("CMSCollector: collect because incremental collection will fail "); } return true; @@ -1939,7 +1927,7 @@ void CMSCollector::decide_foreground_collection_type( "You may want to check the correctness of the following"); // Inform cms gen if this was due to partial collection failing. // The CMS gen may use this fact to determine its expansion policy. - if (gch->incremental_collection_will_fail()) { + if (gch->incremental_collection_will_fail(false /* don't consult_young */)) { assert(!_cmsGen->incremental_collection_failed(), "Should have been noticed, reacted to and cleared"); _cmsGen->set_incremental_collection_failed(); @@ -1948,7 +1936,7 @@ void CMSCollector::decide_foreground_collection_type( UseCMSCompactAtFullCollection && ((_full_gcs_since_conc_gc >= CMSFullGCsBeforeCompaction) || GCCause::is_user_requested_gc(gch->gc_cause()) || - gch->incremental_collection_will_fail()); + gch->incremental_collection_will_fail(true /* consult_young */)); *should_start_over = false; if (clear_all_soft_refs && !*should_compact) { // We are about to do a last ditch collection attempt @@ -2630,7 +2618,8 @@ void CMSCollector::gc_prologue(bool full) { // Should call gc_prologue_work() for all cms gens we are responsible for bool registerClosure = _collectorState >= Marking && _collectorState < Sweeping; - ModUnionClosure* muc = ParallelGCThreads > 0 ? &_modUnionClosurePar + ModUnionClosure* muc = CollectedHeap::use_parallel_gc_threads() ? + &_modUnionClosurePar : &_modUnionClosure; _cmsGen->gc_prologue_work(full, registerClosure, muc); _permGen->gc_prologue_work(full, registerClosure, muc); @@ -2731,7 +2720,7 @@ void ConcurrentMarkSweepGeneration::gc_epilogue(bool full) { collector()->gc_epilogue(full); // Also reset promotion tracking in par gc thread states. - if (ParallelGCThreads > 0) { + if (CollectedHeap::use_parallel_gc_threads()) { for (uint i = 0; i < ParallelGCThreads; i++) { _par_gc_thread_states[i]->promo.stopTrackingPromotions(i); } @@ -3263,6 +3252,7 @@ HeapWord* ConcurrentMarkSweepGeneration::expand_and_allocate(size_t word_size, bool tlab, bool parallel) { + CMSSynchronousYieldRequest yr; assert(!tlab, "Can't deal with TLAB allocation"); MutexLockerEx x(freelistLock(), Mutex::_no_safepoint_check_flag); expand(word_size*HeapWordSize, MinHeapDeltaBytes, @@ -3709,35 +3699,42 @@ class CMSConcMarkingTask; class CMSConcMarkingTerminator: public ParallelTaskTerminator { CMSCollector* _collector; CMSConcMarkingTask* _task; - bool _yield; - protected: - virtual void yield(); public: + virtual void yield(); + // "n_threads" is the number of threads to be terminated. // "queue_set" is a set of work queues of other threads. // "collector" is the CMS collector associated with this task terminator. // "yield" indicates whether we need the gang as a whole to yield. - CMSConcMarkingTerminator(int n_threads, TaskQueueSetSuper* queue_set, - CMSCollector* collector, bool yield) : + CMSConcMarkingTerminator(int n_threads, TaskQueueSetSuper* queue_set, CMSCollector* collector) : ParallelTaskTerminator(n_threads, queue_set), - _collector(collector), - _yield(yield) { } + _collector(collector) { } void set_task(CMSConcMarkingTask* task) { _task = task; } }; +class CMSConcMarkingTerminatorTerminator: public TerminatorTerminator { + CMSConcMarkingTask* _task; + public: + bool should_exit_termination(); + void set_task(CMSConcMarkingTask* task) { + _task = task; + } +}; + // MT Concurrent Marking Task class CMSConcMarkingTask: public YieldingFlexibleGangTask { CMSCollector* _collector; - YieldingFlexibleWorkGang* _workers; // the whole gang int _n_workers; // requested/desired # workers bool _asynch; bool _result; CompactibleFreeListSpace* _cms_space; CompactibleFreeListSpace* _perm_space; - HeapWord* _global_finger; + char _pad_front[64]; // padding to ... + HeapWord* _global_finger; // ... avoid sharing cache line + char _pad_back[64]; HeapWord* _restart_addr; // Exposed here for yielding support @@ -3745,28 +3742,30 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask { // The per thread work queues, available here for stealing OopTaskQueueSet* _task_queues; + + // Termination (and yielding) support CMSConcMarkingTerminator _term; + CMSConcMarkingTerminatorTerminator _term_term; public: CMSConcMarkingTask(CMSCollector* collector, CompactibleFreeListSpace* cms_space, CompactibleFreeListSpace* perm_space, - bool asynch, int n_workers, + bool asynch, YieldingFlexibleWorkGang* workers, OopTaskQueueSet* task_queues): YieldingFlexibleGangTask("Concurrent marking done multi-threaded"), _collector(collector), _cms_space(cms_space), _perm_space(perm_space), - _asynch(asynch), _n_workers(n_workers), _result(true), - _workers(workers), _task_queues(task_queues), - _term(n_workers, task_queues, _collector, asynch), + _asynch(asynch), _n_workers(0), _result(true), + _task_queues(task_queues), + _term(_n_workers, task_queues, _collector), _bit_map_lock(collector->bitMapLock()) { - assert(n_workers <= workers->total_workers(), - "Else termination won't work correctly today"); // XXX FIX ME! - _requested_size = n_workers; + _requested_size = _n_workers; _term.set_task(this); + _term_term.set_task(this); assert(_cms_space->bottom() < _perm_space->bottom(), "Finger incorrectly initialized below"); _restart_addr = _global_finger = _cms_space->bottom(); @@ -3781,7 +3780,16 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask { CMSConcMarkingTerminator* terminator() { return &_term; } + virtual void set_for_termination(int active_workers) { + terminator()->reset_for_reuse(active_workers); + } + void work(int i); + bool should_yield() { + return ConcurrentMarkSweepThread::should_yield() + && !_collector->foregroundGCIsActive() + && _asynch; + } virtual void coordinator_yield(); // stuff done by coordinator bool result() { return _result; } @@ -3803,10 +3811,17 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask { void bump_global_finger(HeapWord* f); }; +bool CMSConcMarkingTerminatorTerminator::should_exit_termination() { + assert(_task != NULL, "Error"); + return _task->yielding(); + // Note that we do not need the disjunct || _task->should_yield() above + // because we want terminating threads to yield only if the task + // is already in the midst of yielding, which happens only after at least one + // thread has yielded. +} + void CMSConcMarkingTerminator::yield() { - if (ConcurrentMarkSweepThread::should_yield() && - !_collector->foregroundGCIsActive() && - _yield) { + if (_task->should_yield()) { _task->yield(); } else { ParallelTaskTerminator::yield(); @@ -4031,6 +4046,7 @@ void CMSConcMarkingTask::do_scan_and_mark(int i, CompactibleFreeListSpace* sp) { class Par_ConcMarkingClosure: public Par_KlassRememberingOopClosure { private: + CMSConcMarkingTask* _task; MemRegion _span; CMSBitMap* _bit_map; CMSMarkStack* _overflow_stack; @@ -4038,11 +4054,12 @@ class Par_ConcMarkingClosure: public Par_KlassRememberingOopClosure { protected: DO_OOP_WORK_DEFN public: - Par_ConcMarkingClosure(CMSCollector* collector, OopTaskQueue* work_queue, + Par_ConcMarkingClosure(CMSCollector* collector, CMSConcMarkingTask* task, OopTaskQueue* work_queue, CMSBitMap* bit_map, CMSMarkStack* overflow_stack, CMSMarkStack* revisit_stack): Par_KlassRememberingOopClosure(collector, NULL, revisit_stack), - _span(_collector->_span), + _task(task), + _span(collector->_span), _work_queue(work_queue), _bit_map(bit_map), _overflow_stack(overflow_stack) @@ -4051,6 +4068,11 @@ class Par_ConcMarkingClosure: public Par_KlassRememberingOopClosure { virtual void do_oop(narrowOop* p); void trim_queue(size_t max); void handle_stack_overflow(HeapWord* lost); + void do_yield_check() { + if (_task->should_yield()) { + _task->yield(); + } + } }; // Grey object scanning during work stealing phase -- @@ -4094,6 +4116,7 @@ void Par_ConcMarkingClosure::do_oop(oop obj) { handle_stack_overflow(addr); } } // Else, some other thread got there first + do_yield_check(); } } @@ -4109,6 +4132,7 @@ void Par_ConcMarkingClosure::trim_queue(size_t max) { assert(_span.contains((HeapWord*)new_oop), "Not in span"); assert(new_oop->is_parsable(), "Should be parsable"); new_oop->oop_iterate(this); // do_oop() above + do_yield_check(); } } } @@ -4136,7 +4160,7 @@ void CMSConcMarkingTask::do_work_steal(int i) { CMSMarkStack* ovflw = &(_collector->_markStack); CMSMarkStack* revisit = &(_collector->_revisitStack); int* seed = _collector->hash_seed(i); - Par_ConcMarkingClosure cl(_collector, work_q, bm, ovflw, revisit); + Par_ConcMarkingClosure cl(_collector, this, work_q, bm, ovflw, revisit); while (true) { cl.trim_queue(0); assert(work_q->size() == 0, "Should have been emptied above"); @@ -4149,9 +4173,11 @@ void CMSConcMarkingTask::do_work_steal(int i) { assert(obj_to_scan->is_oop(), "Should be an oop"); assert(bm->isMarked((HeapWord*)obj_to_scan), "Grey object"); obj_to_scan->oop_iterate(&cl); - } else if (terminator()->offer_termination()) { + } else if (terminator()->offer_termination(&_term_term)) { assert(work_q->size() == 0, "Impossible!"); break; + } else if (yielding() || should_yield()) { + yield(); } } } @@ -4220,9 +4246,12 @@ bool CMSCollector::do_marking_mt(bool asynch) { CompactibleFreeListSpace* cms_space = _cmsGen->cmsSpace(); CompactibleFreeListSpace* perm_space = _permGen->cmsSpace(); - CMSConcMarkingTask tsk(this, cms_space, perm_space, - asynch, num_workers /* number requested XXX */, - conc_workers(), task_queues()); + CMSConcMarkingTask tsk(this, + cms_space, + perm_space, + asynch, + conc_workers(), + task_queues()); // Since the actual number of workers we get may be different // from the number we requested above, do we need to do anything different @@ -4326,6 +4355,10 @@ void CMSCollector::preclean() { verify_overflow_empty(); _abort_preclean = false; if (CMSPrecleaningEnabled) { + // Precleaning is currently not MT but the reference processor + // may be set for MT. Disable it temporarily here. + ReferenceProcessor* rp = ref_processor(); + ReferenceProcessorMTProcMutator z(rp, false); _eden_chunk_index = 0; size_t used = get_eden_used(); size_t capacity = get_eden_capacity(); @@ -4918,7 +4951,7 @@ void CMSCollector::checkpointRootsFinalWork(bool asynch, // dirtied since the first checkpoint in this GC cycle and prior to // the most recent young generation GC, minus those cleaned up by the // concurrent precleaning. - if (CMSParallelRemarkEnabled && ParallelGCThreads > 0) { + if (CMSParallelRemarkEnabled && CollectedHeap::use_parallel_gc_threads()) { TraceTime t("Rescan (parallel) ", PrintGCDetails, false, gclog_or_tty); do_remark_parallel(); } else { @@ -5012,7 +5045,6 @@ void CMSCollector::checkpointRootsFinalWork(bool asynch, // Parallel remark task class CMSParRemarkTask: public AbstractGangTask { CMSCollector* _collector; - WorkGang* _workers; int _n_workers; CompactibleFreeListSpace* _cms_space; CompactibleFreeListSpace* _perm_space; @@ -5025,21 +5057,21 @@ class CMSParRemarkTask: public AbstractGangTask { CMSParRemarkTask(CMSCollector* collector, CompactibleFreeListSpace* cms_space, CompactibleFreeListSpace* perm_space, - int n_workers, WorkGang* workers, + int n_workers, FlexibleWorkGang* workers, OopTaskQueueSet* task_queues): AbstractGangTask("Rescan roots and grey objects in parallel"), _collector(collector), _cms_space(cms_space), _perm_space(perm_space), _n_workers(n_workers), - _workers(workers), _task_queues(task_queues), - _term(workers->total_workers(), task_queues) { } + _term(n_workers, task_queues) { } OopTaskQueueSet* task_queues() { return _task_queues; } OopTaskQueue* work_queue(int i) { return task_queues()->queue(i); } ParallelTaskTerminator* terminator() { return &_term; } + int n_workers() { return _n_workers; } void work(int i); @@ -5057,6 +5089,11 @@ class CMSParRemarkTask: public AbstractGangTask { void do_work_steal(int i, Par_MarkRefsIntoAndScanClosure* cl, int* seed); }; +// work_queue(i) is passed to the closure +// Par_MarkRefsIntoAndScanClosure. The "i" parameter +// also is passed to do_dirty_card_rescan_tasks() and to +// do_work_steal() to select the i-th task_queue. + void CMSParRemarkTask::work(int i) { elapsedTimer _timer; ResourceMark rm; @@ -5128,6 +5165,7 @@ void CMSParRemarkTask::work(int i) { // Do the rescan tasks for each of the two spaces // (cms_space and perm_space) in turn. + // "i" is passed to select the "i-th" task_queue do_dirty_card_rescan_tasks(_cms_space, i, &par_mrias_cl); do_dirty_card_rescan_tasks(_perm_space, i, &par_mrias_cl); _timer.stop(); @@ -5150,6 +5188,7 @@ void CMSParRemarkTask::work(int i) { } } +// Note that parameter "i" is not used. void CMSParRemarkTask::do_young_space_rescan(int i, Par_MarkRefsIntoAndScanClosure* cl, ContiguousSpace* space, @@ -5309,8 +5348,13 @@ CMSParRemarkTask::do_work_steal(int i, Par_MarkRefsIntoAndScanClosure* cl, size_t num_from_overflow_list = MIN2((size_t)(work_q->max_elems() - work_q->size())/4, (size_t)ParGCDesiredObjsFromOverflowList); // Now check if there's any work in the overflow list + // Passing ParallelGCThreads as the third parameter, no_of_gc_threads, + // only affects the number of attempts made to get work from the + // overflow list and does not affect the number of workers. Just + // pass ParallelGCThreads so this behavior is unchanged. if (_collector->par_take_from_overflow_list(num_from_overflow_list, - work_q)) { + work_q, + ParallelGCThreads)) { // found something in global overflow list; // not yet ready to go stealing work from others. // We'd like to assert(work_q->size() != 0, ...) @@ -5367,11 +5411,12 @@ void CMSCollector::reset_survivor_plab_arrays() { // Merge the per-thread plab arrays into the global survivor chunk // array which will provide the partitioning of the survivor space // for CMS rescan. -void CMSCollector::merge_survivor_plab_arrays(ContiguousSpace* surv) { +void CMSCollector::merge_survivor_plab_arrays(ContiguousSpace* surv, + int no_of_gc_threads) { assert(_survivor_plab_array != NULL, "Error"); assert(_survivor_chunk_array != NULL, "Error"); assert(_collectorState == FinalMarking, "Error"); - for (uint j = 0; j < ParallelGCThreads; j++) { + for (int j = 0; j < no_of_gc_threads; j++) { _cursor[j] = 0; } HeapWord* top = surv->top(); @@ -5379,7 +5424,7 @@ void CMSCollector::merge_survivor_plab_arrays(ContiguousSpace* surv) { for (i = 0; i < _survivor_chunk_capacity; i++) { // all sca entries HeapWord* min_val = top; // Higher than any PLAB address uint min_tid = 0; // position of min_val this round - for (uint j = 0; j < ParallelGCThreads; j++) { + for (int j = 0; j < no_of_gc_threads; j++) { ChunkArray* cur_sca = &_survivor_plab_array[j]; if (_cursor[j] == cur_sca->end()) { continue; @@ -5413,7 +5458,7 @@ void CMSCollector::merge_survivor_plab_arrays(ContiguousSpace* surv) { // Verify that we used up all the recorded entries #ifdef ASSERT size_t total = 0; - for (uint j = 0; j < ParallelGCThreads; j++) { + for (int j = 0; j < no_of_gc_threads; j++) { assert(_cursor[j] == _survivor_plab_array[j].end(), "Ctl pt invariant"); total += _cursor[j]; } @@ -5448,13 +5493,15 @@ initialize_sequential_subtasks_for_young_gen_rescan(int n_threads) { // Each valid entry in [0, _eden_chunk_index) represents a task. size_t n_tasks = _eden_chunk_index + 1; assert(n_tasks == 1 || _eden_chunk_array != NULL, "Error"); - pst->set_par_threads(n_threads); + // Sets the condition for completion of the subtask (how many threads + // need to finish in order to be done). + pst->set_n_threads(n_threads); pst->set_n_tasks((int)n_tasks); } // Merge the survivor plab arrays into _survivor_chunk_array if (_survivor_plab_array != NULL) { - merge_survivor_plab_arrays(dng->from()); + merge_survivor_plab_arrays(dng->from(), n_threads); } else { assert(_survivor_chunk_index == 0, "Error"); } @@ -5463,7 +5510,9 @@ initialize_sequential_subtasks_for_young_gen_rescan(int n_threads) { { SequentialSubTasksDone* pst = dng->to()->par_seq_tasks(); assert(!pst->valid(), "Clobbering existing data?"); - pst->set_par_threads(n_threads); + // Sets the condition for completion of the subtask (how many threads + // need to finish in order to be done). + pst->set_n_threads(n_threads); pst->set_n_tasks(1); assert(pst->valid(), "Error"); } @@ -5474,7 +5523,9 @@ initialize_sequential_subtasks_for_young_gen_rescan(int n_threads) { assert(!pst->valid(), "Clobbering existing data?"); size_t n_tasks = _survivor_chunk_index + 1; assert(n_tasks == 1 || _survivor_chunk_array != NULL, "Error"); - pst->set_par_threads(n_threads); + // Sets the condition for completion of the subtask (how many threads + // need to finish in order to be done). + pst->set_n_threads(n_threads); pst->set_n_tasks((int)n_tasks); assert(pst->valid(), "Error"); } @@ -5483,7 +5534,7 @@ initialize_sequential_subtasks_for_young_gen_rescan(int n_threads) { // Parallel version of remark void CMSCollector::do_remark_parallel() { GenCollectedHeap* gch = GenCollectedHeap::heap(); - WorkGang* workers = gch->workers(); + FlexibleWorkGang* workers = gch->workers(); assert(workers != NULL, "Need parallel worker threads."); int n_workers = workers->total_workers(); CompactibleFreeListSpace* cms_space = _cmsGen->cmsSpace(); @@ -5636,13 +5687,11 @@ void CMSCollector::do_remark_non_parallel() { //////////////////////////////////////////////////////// // Parallel Reference Processing Task Proxy Class //////////////////////////////////////////////////////// -class CMSRefProcTaskProxy: public AbstractGangTask { +class CMSRefProcTaskProxy: public AbstractGangTaskWOopQueues { typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask; CMSCollector* _collector; CMSBitMap* _mark_bit_map; const MemRegion _span; - OopTaskQueueSet* _task_queues; - ParallelTaskTerminator _term; ProcessTask& _task; public: @@ -5650,24 +5699,21 @@ public: CMSCollector* collector, const MemRegion& span, CMSBitMap* mark_bit_map, - int total_workers, + AbstractWorkGang* workers, OopTaskQueueSet* task_queues): - AbstractGangTask("Process referents by policy in parallel"), + AbstractGangTaskWOopQueues("Process referents by policy in parallel", + task_queues), _task(task), - _collector(collector), _span(span), _mark_bit_map(mark_bit_map), - _task_queues(task_queues), - _term(total_workers, task_queues) + _collector(collector), _span(span), _mark_bit_map(mark_bit_map) { assert(_collector->_span.equals(_span) && !_span.is_empty(), "Inconsistency in _span"); } - OopTaskQueueSet* task_queues() { return _task_queues; } + OopTaskQueueSet* task_queues() { return queues(); } OopTaskQueue* work_queue(int i) { return task_queues()->queue(i); } - ParallelTaskTerminator* terminator() { return &_term; } - void do_work_steal(int i, CMSParDrainMarkingStackClosure* drain, CMSParKeepAliveClosure* keep_alive, @@ -5739,8 +5785,13 @@ void CMSRefProcTaskProxy::do_work_steal(int i, size_t num_from_overflow_list = MIN2((size_t)(work_q->max_elems() - work_q->size())/4, (size_t)ParGCDesiredObjsFromOverflowList); // Now check if there's any work in the overflow list + // Passing ParallelGCThreads as the third parameter, no_of_gc_threads, + // only affects the number of attempts made to get work from the + // overflow list and does not affect the number of workers. Just + // pass ParallelGCThreads so this behavior is unchanged. if (_collector->par_take_from_overflow_list(num_from_overflow_list, - work_q)) { + work_q, + ParallelGCThreads)) { // Found something in global overflow list; // not yet ready to go stealing work from others. // We'd like to assert(work_q->size() != 0, ...) @@ -5773,13 +5824,12 @@ void CMSRefProcTaskProxy::do_work_steal(int i, void CMSRefProcTaskExecutor::execute(ProcessTask& task) { GenCollectedHeap* gch = GenCollectedHeap::heap(); - WorkGang* workers = gch->workers(); + FlexibleWorkGang* workers = gch->workers(); assert(workers != NULL, "Need parallel worker threads."); - int n_workers = workers->total_workers(); CMSRefProcTaskProxy rp_task(task, &_collector, _collector.ref_processor()->span(), _collector.markBitMap(), - n_workers, _collector.task_queues()); + workers, _collector.task_queues()); workers->run_task(&rp_task); } @@ -5787,7 +5837,7 @@ void CMSRefProcTaskExecutor::execute(EnqueueTask& task) { GenCollectedHeap* gch = GenCollectedHeap::heap(); - WorkGang* workers = gch->workers(); + FlexibleWorkGang* workers = gch->workers(); assert(workers != NULL, "Need parallel worker threads."); CMSRefEnqueueTaskProxy enq_task(task); workers->run_task(&enq_task); @@ -5814,6 +5864,14 @@ void CMSCollector::refProcessingWork(bool asynch, bool clear_all_soft_refs) { { TraceTime t("weak refs processing", PrintGCDetails, false, gclog_or_tty); if (rp->processing_is_mt()) { + // Set the degree of MT here. If the discovery is done MT, there + // may have been a different number of threads doing the discovery + // and a different number of discovered lists may have Ref objects. + // That is OK as long as the Reference lists are balanced (see + // balance_all_queues() and balance_queues()). + + + rp->set_mt_degree(ParallelGCThreads); CMSRefProcTaskExecutor task_executor(*this); rp->process_discovered_references(&_is_alive_closure, &cmsKeepAliveClosure, @@ -5874,6 +5932,7 @@ void CMSCollector::refProcessingWork(bool asynch, bool clear_all_soft_refs) { rp->set_enqueuing_is_done(true); if (rp->processing_is_mt()) { + rp->balance_all_queues(); CMSRefProcTaskExecutor task_executor(*this); rp->enqueue_discovered_references(&task_executor); } else { @@ -6020,23 +6079,14 @@ void CMSCollector::sweep(bool asynch) { assert(_collectorState == Resizing, "Change of collector state to" " Resizing must be done under the freelistLocks (plural)"); - // Now that sweeping has been completed, if the GCH's - // incremental_collection_will_fail flag is set, clear it, + // Now that sweeping has been completed, we clear + // the incremental_collection_failed flag, // thus inviting a younger gen collection to promote into // this generation. If such a promotion may still fail, // the flag will be set again when a young collection is // attempted. - // I think the incremental_collection_will_fail flag's use - // is specific to a 2 generation collection policy, so i'll - // assert that that's the configuration we are operating within. - // The use of the flag can and should be generalized appropriately - // in the future to deal with a general n-generation system. - GenCollectedHeap* gch = GenCollectedHeap::heap(); - assert(gch->collector_policy()->is_two_generation_policy(), - "Resetting of incremental_collection_will_fail flag" - " may be incorrect otherwise"); - gch->clear_incremental_collection_will_fail(); + gch->clear_incremental_collection_failed(); // Worth retrying as fresh space may have been freed up gch->update_full_collections_completed(_collection_count_start); } @@ -8708,7 +8758,8 @@ bool CMSCollector::take_from_overflow_list(size_t num, CMSMarkStack* stack) { // similar changes might be needed. // CR 6797058 has been filed to consolidate the common code. bool CMSCollector::par_take_from_overflow_list(size_t num, - OopTaskQueue* work_q) { + OopTaskQueue* work_q, + int no_of_gc_threads) { assert(work_q->size() == 0, "First empty local work queue"); assert(num < work_q->max_elems(), "Can't bite more than we can chew"); if (_overflow_list == NULL) { @@ -8717,7 +8768,9 @@ bool CMSCollector::par_take_from_overflow_list(size_t num, // Grab the entire list; we'll put back a suffix oop prefix = (oop)Atomic::xchg_ptr(BUSY, &_overflow_list); Thread* tid = Thread::current(); - size_t CMSOverflowSpinCount = (size_t)ParallelGCThreads; + // Before "no_of_gc_threads" was introduced CMSOverflowSpinCount was + // set to ParallelGCThreads. + size_t CMSOverflowSpinCount = (size_t) no_of_gc_threads; // was ParallelGCThreads; size_t sleep_time_millis = MAX2((size_t)1, num/100); // If the list is busy, we spin for a short while, // sleeping between attempts to get the list. @@ -8867,23 +8920,10 @@ void CMSCollector::par_push_on_overflow_list(oop p) { // failures where possible, thus, incrementally hardening the VM // in such low resource situations. void CMSCollector::preserve_mark_work(oop p, markOop m) { - if (_preserved_oop_stack == NULL) { - assert(_preserved_mark_stack == NULL, - "bijection with preserved_oop_stack"); - // Allocate the stacks - _preserved_oop_stack = new (ResourceObj::C_HEAP) - GrowableArray(PreserveMarkStackSize, true); - _preserved_mark_stack = new (ResourceObj::C_HEAP) - GrowableArray(PreserveMarkStackSize, true); - if (_preserved_oop_stack == NULL || _preserved_mark_stack == NULL) { - vm_exit_out_of_memory(2* PreserveMarkStackSize * sizeof(oop) /* punt */, - "Preserved Mark/Oop Stack for CMS (C-heap)"); - } - } - _preserved_oop_stack->push(p); - _preserved_mark_stack->push(m); + _preserved_oop_stack.push(p); + _preserved_mark_stack.push(m); assert(m == p->mark(), "Mark word changed"); - assert(_preserved_oop_stack->length() == _preserved_mark_stack->length(), + assert(_preserved_oop_stack.size() == _preserved_mark_stack.size(), "bijection"); } @@ -8925,42 +8965,30 @@ void CMSCollector::par_preserve_mark_if_necessary(oop p) { // effect on performance so great that this will // likely just be in the noise anyway. void CMSCollector::restore_preserved_marks_if_any() { - if (_preserved_oop_stack == NULL) { - assert(_preserved_mark_stack == NULL, - "bijection with preserved_oop_stack"); - return; - } - assert(SafepointSynchronize::is_at_safepoint(), "world should be stopped"); assert(Thread::current()->is_ConcurrentGC_thread() || Thread::current()->is_VM_thread(), "should be single-threaded"); + assert(_preserved_oop_stack.size() == _preserved_mark_stack.size(), + "bijection"); - int length = _preserved_oop_stack->length(); - assert(_preserved_mark_stack->length() == length, "bijection"); - for (int i = 0; i < length; i++) { - oop p = _preserved_oop_stack->at(i); + while (!_preserved_oop_stack.is_empty()) { + oop p = _preserved_oop_stack.pop(); assert(p->is_oop(), "Should be an oop"); assert(_span.contains(p), "oop should be in _span"); assert(p->mark() == markOopDesc::prototype(), "Set when taken from overflow list"); - markOop m = _preserved_mark_stack->at(i); + markOop m = _preserved_mark_stack.pop(); p->set_mark(m); } - _preserved_mark_stack->clear(); - _preserved_oop_stack->clear(); - assert(_preserved_mark_stack->is_empty() && - _preserved_oop_stack->is_empty(), + assert(_preserved_mark_stack.is_empty() && _preserved_oop_stack.is_empty(), "stacks were cleared above"); } #ifndef PRODUCT bool CMSCollector::no_preserved_marks() const { - return ( ( _preserved_mark_stack == NULL - && _preserved_oop_stack == NULL) - || ( _preserved_mark_stack->is_empty() - && _preserved_oop_stack->is_empty())); + return _preserved_mark_stack.is_empty() && _preserved_oop_stack.is_empty(); } #endif @@ -9256,4 +9284,3 @@ TraceCMSMemoryManagerStats::TraceCMSMemoryManagerStats(): TraceMemoryManagerStat true /* recordGCEndTime */, true /* countCollection */ ); } - diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp index 3302d78a906..118380ddd5d 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp @@ -22,6 +22,22 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP + +#include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp" +#include "gc_implementation/shared/gSpaceCounters.hpp" +#include "gc_implementation/shared/gcStats.hpp" +#include "gc_implementation/shared/generationCounters.hpp" +#include "memory/generation.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/virtualspace.hpp" +#include "services/memoryService.hpp" +#include "utilities/bitMap.inline.hpp" +#include "utilities/stack.inline.hpp" +#include "utilities/taskqueue.hpp" +#include "utilities/yieldingWorkgroup.hpp" + // ConcurrentMarkSweepGeneration is in support of a concurrent // mark-sweep old generation in the Detlefs-Printezis--Boehm-Demers-Schenker // style. We assume, for now, that this generation is always the @@ -537,8 +553,8 @@ class CMSCollector: public CHeapObj { // The following array-pair keeps track of mark words // displaced for accomodating overflow list above. // This code will likely be revisited under RFE#4922830. - GrowableArray* _preserved_oop_stack; - GrowableArray* _preserved_mark_stack; + Stack _preserved_oop_stack; + Stack _preserved_mark_stack; int* _hash_seed; @@ -729,7 +745,9 @@ class CMSCollector: public CHeapObj { // Support for marking stack overflow handling bool take_from_overflow_list(size_t num, CMSMarkStack* to_stack); - bool par_take_from_overflow_list(size_t num, OopTaskQueue* to_work_q); + bool par_take_from_overflow_list(size_t num, + OopTaskQueue* to_work_q, + int no_of_gc_threads); void push_on_overflow_list(oop p); void par_push_on_overflow_list(oop p); // the following is, obviously, not, in general, "MT-stable" @@ -768,7 +786,7 @@ class CMSCollector: public CHeapObj { void abortable_preclean(); // Preclean while looking for possible abort void initialize_sequential_subtasks_for_young_gen_rescan(int i); // Helper function for above; merge-sorts the per-thread plab samples - void merge_survivor_plab_arrays(ContiguousSpace* surv); + void merge_survivor_plab_arrays(ContiguousSpace* surv, int no_of_gc_threads); // Resets (i.e. clears) the per-thread plab sample vectors void reset_survivor_plab_arrays(); @@ -1183,8 +1201,7 @@ class ConcurrentMarkSweepGeneration: public CardGeneration { virtual void par_promote_alloc_done(int thread_num); virtual void par_oop_since_save_marks_iterate_done(int thread_num); - virtual bool promotion_attempt_is_safe(size_t promotion_in_bytes, - bool younger_handles_promotion_failure) const; + virtual bool promotion_attempt_is_safe(size_t promotion_in_bytes) const; // Inform this (non-young) generation that a promotion failure was // encountered during a collection of a younger generation that @@ -1881,3 +1898,5 @@ class TraceCMSMemoryManagerStats : public TraceMemoryManagerStats { TraceCMSMemoryManagerStats(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP 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 19acc1b9307..6751b94ce6c 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 (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP + +#include "gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp" +#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" +#include "gc_implementation/shared/gcUtil.hpp" +#include "memory/defNewGeneration.hpp" + inline void CMSBitMap::clear_all() { assert_locked(); // CMS bitmaps are usually cover large memory regions @@ -277,7 +287,7 @@ inline bool CMSCollector::should_abort_preclean() const { // scavenge is done or foreground GC wants to take over collection return _collectorState == AbortablePreclean && (_abort_preclean || _foregroundGCIsActive || - GenCollectedHeap::heap()->incremental_collection_will_fail()); + GenCollectedHeap::heap()->incremental_collection_will_fail(true /* consult_young */)); } inline size_t CMSCollector::get_eden_used() const { @@ -505,3 +515,5 @@ inline void ModUnionClosurePar::do_MemRegion(MemRegion mr) { CardTableModRefBS::card_size /* bytes */)); _t->par_mark_range(mr2); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp index f0033815bcd..c69af2c14be 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,20 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_concurrentMarkSweepThread.cpp.incl" +#include "precompiled.hpp" +#include "classfile/systemDictionary.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" +#include "memory/genCollectedHeap.hpp" +#include "oops/instanceRefKlass.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/init.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/os.hpp" +#include "runtime/vmThread.hpp" // ======= Concurrent Mark Sweep Thread ======== @@ -272,12 +284,16 @@ void ConcurrentMarkSweepThread::desynchronize(bool is_cms_thread) { } } -// Wait until the next synchronous GC or a timeout, whichever is earlier. -void ConcurrentMarkSweepThread::wait_on_cms_lock(long t) { +// Wait until the next synchronous GC, a concurrent full gc request, +// or a timeout, whichever is earlier. +void ConcurrentMarkSweepThread::wait_on_cms_lock(long t_millis) { MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag); + if (_should_terminate || _collector->_full_gc_requested) { + return; + } set_CMS_flag(CMS_cms_wants_token); // to provoke notifies - CGC_lock->wait(Mutex::_no_safepoint_check_flag, t); + CGC_lock->wait(Mutex::_no_safepoint_check_flag, t_millis); clear_CMS_flag(CMS_cms_wants_token); assert(!CMS_flag_is_set(CMS_cms_has_token | CMS_cms_wants_token), "Should not be set"); @@ -289,7 +305,8 @@ void ConcurrentMarkSweepThread::sleepBeforeNextCycle() { icms_wait(); return; } else { - // Wait until the next synchronous GC or a timeout, whichever is earlier + // Wait until the next synchronous GC, a concurrent full gc + // request or a timeout, whichever is earlier. wait_on_cms_lock(CMSWaitDuration); } // Check if we should start a CMS collection cycle diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp index e83573ca0c0..f47901d361c 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,21 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPTHREAD_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPTHREAD_HPP + +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp" +#include "gc_implementation/shared/concurrentGCThread.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif + class ConcurrentMarkSweepGeneration; class CMSCollector; @@ -120,27 +135,49 @@ class ConcurrentMarkSweepThread: public ConcurrentGCThread { } // Wait on CMS lock until the next synchronous GC - // or given timeout, whichever is earlier. - void wait_on_cms_lock(long t); // milliseconds + // or given timeout, whichever is earlier. A timeout value + // of 0 indicates that there is no upper bound on the wait time. + // A concurrent full gc request terminates the wait. + void wait_on_cms_lock(long t_millis); - // The CMS thread will yield during the work portion of it's cycle + // The CMS thread will yield during the work portion of its cycle // only when requested to. Both synchronous and asychronous requests - // are provided. A synchronous request is used for young gen - // collections and direct allocations. The requesting thread increments - // pending_yields at the beginning of an operation, and decrements it when - // the operation is completed. The CMS thread yields when pending_yields - // is positive. An asynchronous request is used by iCMS in the stop_icms() - // operation. A single yield satisfies the outstanding asynch yield requests. - // The requesting thread increments both pending_yields and pending_decrements. - // After yielding, the CMS thread decrements both by the amount in - // pending_decrements. + // are provided: + // (1) A synchronous request is used for young gen collections and + // for direct allocations. The requesting thread increments + // _pending_yields at the beginning of an operation, and decrements + // _pending_yields when that operation is completed. + // In turn, the CMS thread yields when _pending_yields is positive, + // and continues to yield until the value reverts to 0. + // (2) An asynchronous request, on the other hand, is used by iCMS + // for the stop_icms() operation. A single yield satisfies all of + // the outstanding asynch yield requests, of which there may + // occasionally be several in close succession. To accomplish + // this, an asynch-requesting thread atomically increments both + // _pending_yields and _pending_decrements. An asynchr requesting + // thread does not wait and "acknowledge" completion of an operation + // and deregister the request, like the synchronous version described + // above does. In turn, after yielding, the CMS thread decrements both + // _pending_yields and _pending_decrements by the value seen in + // _pending_decrements before the decrement. + // NOTE: The above scheme is isomorphic to having two request counters, + // one for async requests and one for sync requests, and for the CMS thread + // to check the sum of the two counters to decide whether it should yield + // and to clear only the async counter when it yields. However, it turns out + // to be more efficient for CMS code to just check a single counter + // _pending_yields that holds the sum (of both sync and async requests), and + // a second counter _pending_decrements that only holds the async requests, + // for greater efficiency, since in a typical CMS run, there are many more + // pontential (i.e. static) yield points than there are actual + // (i.e. dynamic) yields because of requests, which are few and far between. + // // Note that, while "_pending_yields >= _pending_decrements" is an invariant, // we cannot easily test that invariant, since the counters are manipulated via // atomic instructions without explicit locking and we cannot read // the two counters atomically together: one suggestion is to // use (for example) 16-bit counters so as to be able to read the // two counters atomically even on 32-bit platforms. Notice that - // the second assert in acknowledge_yield_request() does indeed + // the second assert in acknowledge_yield_request() below does indeed // check a form of the above invariant, albeit indirectly. static void increment_pending_yields() { @@ -152,6 +189,7 @@ class ConcurrentMarkSweepThread: public ConcurrentGCThread { assert(_pending_yields >= 0, "can't be negative"); } static void asynchronous_yield_request() { + assert(CMSIncrementalMode, "Currently only used w/iCMS"); increment_pending_yields(); Atomic::inc(&_pending_decrements); assert(_pending_decrements >= 0, "can't be negative"); @@ -159,6 +197,7 @@ class ConcurrentMarkSweepThread: public ConcurrentGCThread { static void acknowledge_yield_request() { jint decrement = _pending_decrements; if (decrement > 0) { + assert(CMSIncrementalMode, "Currently only used w/iCMS"); // Order important to preserve: _pending_yields >= _pending_decrements Atomic::add(-decrement, &_pending_decrements); Atomic::add(-decrement, &_pending_yields); @@ -195,7 +234,7 @@ inline void ConcurrentMarkSweepThread::trace_state(const char* desc) { } } -// For scoped increment/decrement of yield requests +// For scoped increment/decrement of (synchronous) yield requests class CMSSynchronousYieldRequest: public StackObj { public: CMSSynchronousYieldRequest() { @@ -227,3 +266,5 @@ class CMSLoopCountWarn: public StackObj { } } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPTHREAD_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.cpp index c03423d0507..1c1b3ffe5bb 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,17 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_freeBlockDictionary.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif #ifndef PRODUCT Mutex* FreeBlockDictionary::par_lock() const { diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp index a3ec74e314f..538662028df 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 (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,17 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREEBLOCKDICTIONARY_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREEBLOCKDICTIONARY_HPP + +#include "gc_implementation/concurrentMarkSweep/freeChunk.hpp" +#include "memory/allocation.hpp" +#include "memory/memRegion.hpp" +#include "runtime/mutex.hpp" +#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/ostream.hpp" + // A FreeBlockDictionary is an abstract superclass that will allow // a number of alternative implementations in the future. class FreeBlockDictionary: public CHeapObj { @@ -88,3 +99,5 @@ class FreeBlockDictionary: public CHeapObj { void set_par_lock(Mutex* lock) PRODUCT_RETURN; void verify_par_locked() const PRODUCT_RETURN; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREEBLOCKDICTIONARY_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp index af5ec88d02d..84702b6400f 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 (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_freeChunk.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp" +#include "utilities/copy.hpp" #ifndef PRODUCT diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp index 760fabf434e..e1ac702a22c 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp @@ -22,6 +22,17 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREECHUNK_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREECHUNK_HPP + +#include "memory/allocation.hpp" +#include "memory/memRegion.hpp" +#include "oops/markOop.hpp" +#include "runtime/mutex.hpp" +#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/ostream.hpp" + // // Free block maintenance for Concurrent Mark Sweep Generation // @@ -141,3 +152,5 @@ class FreeChunk VALUE_OBJ_CLASS_SPEC { extern size_t MinChunkSize; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREECHUNK_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp index eebd8bb332f..4956475428e 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 (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_freeList.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp" +#include "gc_implementation/concurrentMarkSweep/freeList.hpp" +#include "memory/sharedHeap.hpp" +#include "runtime/globals.hpp" +#include "runtime/mutex.hpp" +#include "runtime/vmThread.hpp" // Free list. A FreeList is used to access a linked list of chunks // of space in the heap. The head and tail are maintained so that diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp index fddc42110bd..44afe8e56a8 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 (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREELIST_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREELIST_HPP + +#include "gc_implementation/shared/allocationStats.hpp" + class CompactibleFreeListSpace; // A class for maintaining a free list of FreeChunk's. The FreeList @@ -326,3 +331,5 @@ class FreeList VALUE_OBJ_CLASS_SPEC { static void print_labels_on(outputStream* st, const char* c); void print_on(outputStream* st, const char* c = NULL) const; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_FREELIST_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp index fda8624babd..6fa109a53b3 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp @@ -22,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_promotionInfo.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp" +#include "gc_implementation/concurrentMarkSweep/promotionInfo.hpp" +#include "oops/markOop.inline.hpp" +#include "oops/oop.inline.hpp" ///////////////////////////////////////////////////////////////////////// //// PromotionInfo diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.hpp index 99051934c36..463c33bb889 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.hpp @@ -22,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_PROMOTIONINFO_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_PROMOTIONINFO_HPP + +#include "gc_implementation/concurrentMarkSweep/freeChunk.hpp" +#include "memory/allocation.hpp" + // Forward declarations class CompactibleFreeListSpace; @@ -204,3 +210,5 @@ class PromotionInfo VALUE_OBJ_CLASS_SPEC { void print_statistics(uint worker_id) const; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_PROMOTIONINFO_HPP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp index bf5188ba74c..12c86b44d02 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,9 +21,15 @@ * questions. * */ -# include "incls/_precompiled.incl" -# include "incls/_vmCMSOperations.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" +#include "gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp" +#include "gc_implementation/shared/isGCActiveMark.hpp" +#include "memory/gcLocker.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "utilities/dtrace.hpp" HS_DTRACE_PROBE_DECL(hs_private, cms__initmark__begin); HS_DTRACE_PROBE_DECL(hs_private, cms__initmark__end); diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp index d76e600343c..8c2fc490a2f 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMCMSOPERATIONS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMCMSOPERATIONS_HPP + +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp" +#include "gc_implementation/shared/vmGCOperations.hpp" +#include "gc_interface/gcCause.hpp" +#include "runtime/vm_operations.hpp" + // The VM_CMS_Operation is slightly different from // a VM_GC_Operation -- and would not have subclassed easily // to VM_GC_Operation without several changes to VM_GC_Operation. @@ -136,3 +144,5 @@ class VM_GenCollectFullConcurrent: public VM_GC_Operation { virtual bool is_cheap_allocated() const { return false; } virtual bool evaluate_at_safepoint() const; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMCMSOPERATIONS_HPP 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 1b6d74b5825..34460c19d87 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMSTRUCTS_CMS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMSTRUCTS_CMS_HPP + #define VM_STRUCTS_CMS(nonstatic_field, \ volatile_nonstatic_field, \ static_field) \ @@ -78,3 +81,5 @@ #define VM_INT_CONSTANTS_CMS(declare_constant) \ declare_constant(Generation::ConcurrentMarkSweep) \ declare_constant(PermGen::ConcurrentMarkSweep) + +#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMSTRUCTS_CMS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp b/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp index 8d259aa78a1..1ceca1734c5 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_BUFFERINGOOPCLOSURE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_BUFFERINGOOPCLOSURE_HPP + +#include "memory/genOopClosures.hpp" +#include "memory/generation.hpp" +#include "runtime/os.hpp" +#include "utilities/taskqueue.hpp" + // A BufferingOops closure tries to separate out the cost of finding roots // from the cost of applying closures to them. It maintains an array of // ref-containing locations. Until the array is full, applying the closure @@ -201,3 +209,5 @@ public: _hr_curr(_hr_buffer), _closure_app_seconds(0.0) { } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_BUFFERINGOOPCLOSURE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp index 1cbb86c0371..585ff2d3468 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_collectionSetChooser.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/collectionSetChooser.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1CollectorPolicy.hpp" +#include "memory/space.inline.hpp" CSetChooserCache::CSetChooserCache() { for (int i = 0; i < CacheLength; ++i) diff --git a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp index 5ba54e6f801..04ceba27921 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_COLLECTIONSETCHOOSER_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_COLLECTIONSETCHOOSER_HPP + +#include "gc_implementation/g1/heapRegion.hpp" +#include "utilities/growableArray.hpp" + // We need to sort heap regions by collection desirability. class CSetChooserCache VALUE_OBJ_CLASS_SPEC { @@ -136,3 +142,5 @@ public: #endif }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_COLLECTIONSETCHOOSER_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp index e144aa7cc86..d26530323d2 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp @@ -22,8 +22,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_concurrentG1Refine.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/concurrentG1Refine.hpp" +#include "gc_implementation/g1/concurrentG1RefineThread.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1CollectorPolicy.hpp" +#include "gc_implementation/g1/g1RemSet.hpp" +#include "gc_implementation/g1/heapRegionSeq.inline.hpp" +#include "memory/space.inline.hpp" +#include "runtime/atomic.hpp" +#include "utilities/copy.hpp" // Possible sizes for the card counts cache: odd primes that roughly double in size. // (See jvmtiTagMap.cpp). diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp index f5c3653f888..50ea5e9e6f6 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp @@ -22,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINE_HPP + +#include "memory/allocation.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "runtime/thread.hpp" +#include "utilities/globalDefinitions.hpp" + // Forward decl class ConcurrentG1RefineThread; class G1RemSet; @@ -223,3 +231,5 @@ class ConcurrentG1Refine: public CHeapObj { int thread_threshold_step() const { return _thread_threshold_step; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp index 109cad554c0..2e87ca700e9 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp @@ -22,8 +22,14 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_concurrentG1RefineThread.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/concurrentG1Refine.hpp" +#include "gc_implementation/g1/concurrentG1RefineThread.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1CollectorPolicy.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/mutexLocker.hpp" ConcurrentG1RefineThread:: ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread *next, diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp index 46cdbd1224f..971fe2f91cc 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINETHREAD_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINETHREAD_HPP + +#include "gc_implementation/shared/concurrentGCThread.hpp" + // Forward Decl. class ConcurrentG1Refine; @@ -84,3 +89,5 @@ public: // shutdown void stop(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINETHREAD_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp index 4dd197ebd27..d1989d4a24e 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,21 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_concurrentMark.cpp.incl" +#include "precompiled.hpp" +#include "classfile/symbolTable.hpp" +#include "gc_implementation/g1/concurrentMark.hpp" +#include "gc_implementation/g1/concurrentMarkThread.inline.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1CollectorPolicy.hpp" +#include "gc_implementation/g1/g1RemSet.hpp" +#include "gc_implementation/g1/heapRegionRemSet.hpp" +#include "gc_implementation/g1/heapRegionSeq.inline.hpp" +#include "memory/genOopClosures.inline.hpp" +#include "memory/referencePolicy.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/java.hpp" // // CMS Bit Map Wrapper @@ -278,15 +291,16 @@ CMRegionStack::~CMRegionStack() { if (_base != NULL) FREE_C_HEAP_ARRAY(oop, _base); } -void CMRegionStack::push(MemRegion mr) { +void CMRegionStack::push_lock_free(MemRegion mr) { assert(mr.word_size() > 0, "Precondition"); while (true) { - if (isFull()) { + jint index = _index; + + if (index >= _capacity) { _overflow = true; return; } // Otherwise... - jint index = _index; jint next_index = index+1; jint res = Atomic::cmpxchg(next_index, &_index, index); if (res == index) { @@ -297,19 +311,17 @@ void CMRegionStack::push(MemRegion mr) { } } -// Currently we do not call this at all. Normally we would call it -// during the concurrent marking / remark phases but we now call -// the lock-based version instead. But we might want to resurrect this -// code in the future. So, we'll leave it here commented out. -#if 0 -MemRegion CMRegionStack::pop() { +// Lock-free pop of the region stack. Called during the concurrent +// marking / remark phases. Should only be called in tandem with +// other lock-free pops. +MemRegion CMRegionStack::pop_lock_free() { while (true) { - // Otherwise... jint index = _index; if (index == 0) { return MemRegion(); } + // Otherwise... jint next_index = index-1; jint res = Atomic::cmpxchg(next_index, &_index, index); if (res == index) { @@ -326,7 +338,11 @@ MemRegion CMRegionStack::pop() { // Otherwise, we need to try again. } } -#endif // 0 + +#if 0 +// The routines that manipulate the region stack with a lock are +// not currently used. They should be retained, however, as a +// diagnostic aid. void CMRegionStack::push_with_lock(MemRegion mr) { assert(mr.word_size() > 0, "Precondition"); @@ -361,6 +377,7 @@ MemRegion CMRegionStack::pop_with_lock() { } } } +#endif bool CMRegionStack::invalidate_entries_into_cset() { bool result = false; @@ -583,10 +600,13 @@ ConcurrentMark::ConcurrentMark(ReservedSpace rs, #endif guarantee(parallel_marking_threads() > 0, "peace of mind"); - _parallel_workers = new WorkGang("G1 Parallel Marking Threads", - (int) parallel_marking_threads(), false, true); - if (_parallel_workers == NULL) + _parallel_workers = new FlexibleWorkGang("G1 Parallel Marking Threads", + (int) _parallel_marking_threads, false, true); + if (_parallel_workers == NULL) { vm_exit_during_initialization("Failed necessary allocation."); + } else { + _parallel_workers->initialize_workers(); + } } // so that the call below can read a sensible value @@ -645,8 +665,9 @@ void ConcurrentMark::reset() { // We do reset all of them, since different phases will use // different number of active threads. So, it's easiest to have all // of them ready. - for (int i = 0; i < (int) _max_task_num; ++i) + for (int i = 0; i < (int) _max_task_num; ++i) { _tasks[i]->reset(_nextMarkBitMap); + } // we need this to make sure that the flag is on during the evac // pause with initial mark piggy-backed @@ -985,7 +1006,7 @@ void ConcurrentMark::grayRegionIfNecessary(MemRegion mr) { "below the finger, pushing it", mr.start(), mr.end()); - if (!region_stack_push(mr)) { + if (!region_stack_push_lock_free(mr)) { if (verbose_low()) gclog_or_tty->print_cr("[global] region stack has overflown."); } @@ -1030,6 +1051,7 @@ public: void work(int worker_i) { assert(Thread::current()->is_ConcurrentGC_thread(), "this should only be done by a conc GC thread"); + ResourceMark rm; double start_vtime = os::elapsedVTime(); @@ -1451,7 +1473,7 @@ public: _bm, _g1h->concurrent_mark(), _region_bm, _card_bm); calccl.no_yield(); - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { _g1h->heap_region_par_iterate_chunked(&calccl, i, HeapRegion::FinalCountClaimValue); } else { @@ -1531,7 +1553,7 @@ public: G1NoteEndOfConcMarkClosure g1_note_end(_g1h, &_par_cleanup_thread_state[i]->list, i); - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { _g1h->heap_region_par_iterate_chunked(&g1_note_end, i, HeapRegion::NoteEndClaimValue); } else { @@ -1575,7 +1597,7 @@ public: {} void work(int i) { - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { _g1rs->scrub_par(_region_bm, _card_bm, i, HeapRegion::ScrubRemSetClaimValue); } else { @@ -1647,7 +1669,7 @@ void ConcurrentMark::cleanup() { // Do counting once more with the world stopped for good measure. G1ParFinalCountTask g1_par_count_task(g1h, nextMarkBitMap(), &_region_bm, &_card_bm); - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { assert(g1h->check_heap_region_claim_values( HeapRegion::InitialClaimValue), "sanity check"); @@ -1695,7 +1717,7 @@ void ConcurrentMark::cleanup() { // Note end of marking in all heap regions. double note_end_start = os::elapsedTime(); G1ParNoteEndTask g1_par_note_end_task(g1h, _par_cleanup_thread_state); - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { int n_workers = g1h->workers()->total_workers(); g1h->set_par_threads(n_workers); g1h->workers()->run_task(&g1_par_note_end_task); @@ -1720,7 +1742,7 @@ void ConcurrentMark::cleanup() { if (G1ScrubRemSets) { double rs_scrub_start = os::elapsedTime(); G1ParScrubRemSetTask g1_par_scrub_rs_task(g1h, &_region_bm, &_card_bm); - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { int n_workers = g1h->workers()->total_workers(); g1h->set_par_threads(n_workers); g1h->workers()->run_task(&g1_par_scrub_rs_task); @@ -1803,23 +1825,11 @@ void ConcurrentMark::completeCleanup() { } } - -class G1CMIsAliveClosure: public BoolObjectClosure { - G1CollectedHeap* _g1; - public: - G1CMIsAliveClosure(G1CollectedHeap* g1) : - _g1(g1) - {} - - void do_object(oop obj) { - assert(false, "not to be invoked"); - } - bool do_object_b(oop obj) { - HeapWord* addr = (HeapWord*)obj; - return addr != NULL && - (!_g1->is_in_g1_reserved(addr) || !_g1->is_obj_ill(obj)); - } -}; +bool G1CMIsAliveClosure::do_object_b(oop obj) { + HeapWord* addr = (HeapWord*)obj; + return addr != NULL && + (!_g1->is_in_g1_reserved(addr) || !_g1->is_obj_ill(obj)); +} class G1CMKeepAliveClosure: public OopClosure { G1CollectedHeap* _g1; @@ -1867,20 +1877,22 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { G1CollectedHeap* g1h = G1CollectedHeap::heap(); ReferenceProcessor* rp = g1h->ref_processor(); + // See the comment in G1CollectedHeap::ref_processing_init() + // about how reference processing currently works in G1. + // Process weak references. rp->setup_policy(clear_all_soft_refs); assert(_markStack.isEmpty(), "mark stack should be empty"); - G1CMIsAliveClosure g1IsAliveClosure (g1h); - G1CMKeepAliveClosure g1KeepAliveClosure(g1h, this, nextMarkBitMap()); + G1CMIsAliveClosure g1_is_alive(g1h); + G1CMKeepAliveClosure g1_keep_alive(g1h, this, nextMarkBitMap()); G1CMDrainMarkingStackClosure - g1DrainMarkingStackClosure(nextMarkBitMap(), &_markStack, - &g1KeepAliveClosure); + g1_drain_mark_stack(nextMarkBitMap(), &_markStack, &g1_keep_alive); // XXXYYY Also: copy the parallel ref processing code from CMS. - rp->process_discovered_references(&g1IsAliveClosure, - &g1KeepAliveClosure, - &g1DrainMarkingStackClosure, + rp->process_discovered_references(&g1_is_alive, + &g1_keep_alive, + &g1_drain_mark_stack, NULL); assert(_markStack.overflow() || _markStack.isEmpty(), "mark stack should be empty (unless it overflowed)"); @@ -1893,8 +1905,8 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { assert(!rp->discovery_enabled(), "should have been disabled"); // Now clean up stale oops in SymbolTable and StringTable - SymbolTable::unlink(&g1IsAliveClosure); - StringTable::unlink(&g1IsAliveClosure); + SymbolTable::unlink(&g1_is_alive); + StringTable::unlink(&g1_is_alive); } void ConcurrentMark::swapMarkBitMaps() { @@ -1934,7 +1946,7 @@ void ConcurrentMark::checkpointRootsFinalWork() { g1h->ensure_parsability(false); - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { G1CollectedHeap::StrongRootsScope srs(g1h); // this is remark, so we'll use up all available threads int active_workers = ParallelGCThreads; @@ -2330,6 +2342,39 @@ ConcurrentMark::claim_region(int task_num) { return NULL; } +bool ConcurrentMark::invalidate_aborted_regions_in_cset() { + bool result = false; + for (int i = 0; i < (int)_max_task_num; ++i) { + CMTask* the_task = _tasks[i]; + MemRegion mr = the_task->aborted_region(); + if (mr.start() != NULL) { + assert(mr.end() != NULL, "invariant"); + assert(mr.word_size() > 0, "invariant"); + HeapRegion* hr = _g1h->heap_region_containing(mr.start()); + assert(hr != NULL, "invariant"); + if (hr->in_collection_set()) { + // The region points into the collection set + the_task->set_aborted_region(MemRegion()); + result = true; + } + } + } + return result; +} + +bool ConcurrentMark::has_aborted_regions() { + for (int i = 0; i < (int)_max_task_num; ++i) { + CMTask* the_task = _tasks[i]; + MemRegion mr = the_task->aborted_region(); + if (mr.start() != NULL) { + assert(mr.end() != NULL, "invariant"); + assert(mr.word_size() > 0, "invariant"); + return true; + } + } + return false; +} + void ConcurrentMark::oops_do(OopClosure* cl) { if (_markStack.size() > 0 && verbose_low()) gclog_or_tty->print_cr("[global] scanning the global marking stack, " @@ -2348,13 +2393,22 @@ void ConcurrentMark::oops_do(OopClosure* cl) { queue->oops_do(cl); } - // finally, invalidate any entries that in the region stack that + // Invalidate any entries, that are in the region stack, that // point into the collection set if (_regionStack.invalidate_entries_into_cset()) { // otherwise, any gray objects copied during the evacuation pause // might not be visited. assert(_should_gray_objects, "invariant"); } + + // Invalidate any aborted regions, recorded in the individual CM + // tasks, that point into the collection set. + if (invalidate_aborted_regions_in_cset()) { + // otherwise, any gray objects copied during the evacuation pause + // might not be visited. + assert(_should_gray_objects, "invariant"); + } + } void ConcurrentMark::clear_marking_state() { @@ -2368,6 +2422,8 @@ void ConcurrentMark::clear_marking_state() { for (int i = 0; i < (int)_max_task_num; ++i) { OopTaskQueue* queue = _task_queues->queue(i); queue->set_empty(); + // Clear any partial regions from the CMTasks + _tasks[i]->clear_aborted_region(); } } @@ -2635,7 +2691,7 @@ void ConcurrentMark::newCSet() { // irrespective whether all collection set regions are below the // finger, if the region stack is not empty. This is expected to be // a rare case, so I don't think it's necessary to be smarted about it. - if (!region_stack_empty()) + if (!region_stack_empty() || has_aborted_regions()) _should_gray_objects = true; } @@ -2654,8 +2710,9 @@ void ConcurrentMark::abort() { _nextMarkBitMap->clearAll(); // Empty mark stack clear_marking_state(); - for (int i = 0; i < (int)_max_task_num; ++i) + for (int i = 0; i < (int)_max_task_num; ++i) { _tasks[i]->clear_region_fields(); + } _has_aborted = true; SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); @@ -2852,7 +2909,11 @@ public: CMOopClosure(G1CollectedHeap* g1h, ConcurrentMark* cm, CMTask* task) - : _g1h(g1h), _cm(cm), _task(task) { } + : _g1h(g1h), _cm(cm), _task(task) + { + _ref_processor = g1h->ref_processor(); + assert(_ref_processor != NULL, "should not be NULL"); + } }; void CMTask::setup_for_region(HeapRegion* hr) { @@ -2933,6 +2994,7 @@ void CMTask::reset(CMBitMap* nextMarkBitMap) { _nextMarkBitMap = nextMarkBitMap; clear_region_fields(); + assert(_aborted_region.is_empty(), "should have been cleared"); _calls = 0; _elapsed_time_ms = 0.0; @@ -3369,14 +3431,14 @@ void CMTask::drain_satb_buffers() { CMObjectClosure oc(this); SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); - if (ParallelGCThreads > 0) + if (G1CollectedHeap::use_parallel_gc_threads()) satb_mq_set.set_par_closure(_task_id, &oc); else satb_mq_set.set_closure(&oc); // This keeps claiming and applying the closure to completed buffers // until we run out of buffers or we need to abort. - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { while (!has_aborted() && satb_mq_set.par_apply_closure_to_completed_buffer(_task_id)) { if (_cm->verbose_medium()) @@ -3396,7 +3458,7 @@ void CMTask::drain_satb_buffers() { if (!concurrent() && !has_aborted()) { // We should only do this during remark. - if (ParallelGCThreads > 0) + if (G1CollectedHeap::use_parallel_gc_threads()) satb_mq_set.par_iterate_closure_all_threads(_task_id); else satb_mq_set.iterate_closure_all_threads(); @@ -3408,7 +3470,7 @@ void CMTask::drain_satb_buffers() { concurrent() || satb_mq_set.completed_buffers_num() == 0, "invariant"); - if (ParallelGCThreads > 0) + if (G1CollectedHeap::use_parallel_gc_threads()) satb_mq_set.set_par_closure(_task_id, NULL); else satb_mq_set.set_closure(NULL); @@ -3425,20 +3487,32 @@ void CMTask::drain_region_stack(BitMapClosure* bc) { assert(_region_finger == NULL, "it should be NULL when we're not scanning a region"); - if (!_cm->region_stack_empty()) { + if (!_cm->region_stack_empty() || !_aborted_region.is_empty()) { if (_cm->verbose_low()) gclog_or_tty->print_cr("[%d] draining region stack, size = %d", _task_id, _cm->region_stack_size()); - MemRegion mr = _cm->region_stack_pop_with_lock(); - // it returns MemRegion() if the pop fails - statsOnly(if (mr.start() != NULL) ++_region_stack_pops ); + MemRegion mr; + + if (!_aborted_region.is_empty()) { + mr = _aborted_region; + _aborted_region = MemRegion(); + + if (_cm->verbose_low()) + gclog_or_tty->print_cr("[%d] scanning aborted region [ " PTR_FORMAT ", " PTR_FORMAT " )", + _task_id, mr.start(), mr.end()); + } else { + mr = _cm->region_stack_pop_lock_free(); + // it returns MemRegion() if the pop fails + statsOnly(if (mr.start() != NULL) ++_region_stack_pops ); + } while (mr.start() != NULL) { if (_cm->verbose_medium()) gclog_or_tty->print_cr("[%d] we are scanning region " "["PTR_FORMAT", "PTR_FORMAT")", _task_id, mr.start(), mr.end()); + assert(mr.end() <= _cm->finger(), "otherwise the region shouldn't be on the stack"); assert(!mr.is_empty(), "Only non-empty regions live on the region stack"); @@ -3451,7 +3525,7 @@ void CMTask::drain_region_stack(BitMapClosure* bc) { if (has_aborted()) mr = MemRegion(); else { - mr = _cm->region_stack_pop_with_lock(); + mr = _cm->region_stack_pop_lock_free(); // it returns MemRegion() if the pop fails statsOnly(if (mr.start() != NULL) ++_region_stack_pops ); } @@ -3465,6 +3539,10 @@ void CMTask::drain_region_stack(BitMapClosure* bc) { // have definitely set _region_finger to something non-null. assert(_region_finger != NULL, "invariant"); + // Make sure that any previously aborted region has been + // cleared. + assert(_aborted_region.is_empty(), "aborted region not cleared"); + // The iteration was actually aborted. So now _region_finger // points to the address of the object we last scanned. If we // leave it there, when we restart this task, we will rescan @@ -3477,14 +3555,14 @@ void CMTask::drain_region_stack(BitMapClosure* bc) { if (!newRegion.is_empty()) { if (_cm->verbose_low()) { - gclog_or_tty->print_cr("[%d] pushing unscanned region" - "[" PTR_FORMAT "," PTR_FORMAT ") on region stack", + gclog_or_tty->print_cr("[%d] recording unscanned region" + "[" PTR_FORMAT "," PTR_FORMAT ") in CMTask", _task_id, newRegion.start(), newRegion.end()); } - // Now push the part of the region we didn't scan on the - // region stack to make sure a task scans it later. - _cm->region_stack_push_with_lock(newRegion); + // Now record the part of the region we didn't scan to + // make sure this task scans it later. + _aborted_region = newRegion; } // break from while mr = MemRegion(); @@ -3654,6 +3732,8 @@ void CMTask::do_marking_step(double time_target_ms) { assert(concurrent() || _cm->region_stack_empty(), "the region stack should have been cleared before remark"); + assert(concurrent() || !_cm->has_aborted_regions(), + "aborted regions should have been cleared before remark"); assert(_region_finger == NULL, "this should be non-null only when a region is being scanned"); @@ -3943,6 +4023,7 @@ void CMTask::do_marking_step(double time_target_ms) { // that, if a condition is false, we can immediately find out // which one. guarantee(_cm->out_of_regions(), "only way to reach here"); + guarantee(_aborted_region.is_empty(), "only way to reach here"); guarantee(_cm->region_stack_empty(), "only way to reach here"); guarantee(_cm->mark_stack_empty(), "only way to reach here"); guarantee(_task_queue->size() == 0, "only way to reach here"); @@ -4042,7 +4123,8 @@ CMTask::CMTask(int task_id, _nextMarkBitMap(NULL), _hash_seed(17), _task_queue(task_queue), _task_queues(task_queues), - _oop_closure(NULL) { + _oop_closure(NULL), + _aborted_region(MemRegion()) { guarantee(task_queue != NULL, "invariant"); guarantee(task_queues != NULL, "invariant"); diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp index 6791ebcedd9..f02d6f049fa 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp @@ -22,11 +22,36 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP + +#include "gc_implementation/g1/heapRegion.hpp" +#include "utilities/taskqueue.hpp" + class G1CollectedHeap; class CMTask; typedef GenericTaskQueue CMTaskQueue; typedef GenericTaskQueueSet CMTaskQueueSet; +// Closure used by CM during concurrent reference discovery +// and reference processing (during remarking) to determine +// if a particular object is alive. It is primarily used +// to determine if referents of discovered reference objects +// are alive. An instance is also embedded into the +// reference processor as the _is_alive_non_header field +class G1CMIsAliveClosure: public BoolObjectClosure { + G1CollectedHeap* _g1; + public: + G1CMIsAliveClosure(G1CollectedHeap* g1) : + _g1(g1) + {} + + void do_object(oop obj) { + ShouldNotCallThis(); + } + bool do_object_b(oop obj); +}; + // A generic CM bit map. This is essentially a wrapper around the BitMap // class, with one bit per (1<<_shifter) HeapWords. @@ -250,21 +275,23 @@ public: // This is lock-free; assumes that it will only be called in parallel // with other "push" operations (no pops). - void push(MemRegion mr); - -#if 0 - // This is currently not used. See the comment in the .cpp file. + void push_lock_free(MemRegion mr); // Lock-free; assumes that it will only be called in parallel // with other "pop" operations (no pushes). - MemRegion pop(); -#endif // 0 + MemRegion pop_lock_free(); + +#if 0 + // The routines that manipulate the region stack with a lock are + // not currently used. They should be retained, however, as a + // diagnostic aid. // These two are the implementations that use a lock. They can be // called concurrently with each other but they should not be called // concurrently with the lock-free versions (push() / pop()). void push_with_lock(MemRegion mr); MemRegion pop_with_lock(); +#endif bool isEmpty() { return _index == 0; } bool isFull() { return _index == _capacity; } @@ -398,6 +425,7 @@ protected: volatile bool _concurrent; // set at the end of a Full GC so that marking aborts volatile bool _has_aborted; + // used when remark aborts due to an overflow to indicate that // another concurrent marking phase should start volatile bool _restart_for_overflow; @@ -548,23 +576,30 @@ public: bool mark_stack_overflow() { return _markStack.overflow(); } bool mark_stack_empty() { return _markStack.isEmpty(); } - // Manipulation of the region stack - bool region_stack_push(MemRegion mr) { + // (Lock-free) Manipulation of the region stack + bool region_stack_push_lock_free(MemRegion mr) { // Currently we only call the lock-free version during evacuation // pauses. assert(SafepointSynchronize::is_at_safepoint(), "world should be stopped"); - _regionStack.push(mr); + _regionStack.push_lock_free(mr); if (_regionStack.overflow()) { set_has_overflown(); return false; } return true; } + + // Lock-free version of region-stack pop. Should only be + // called in tandem with other lock-free pops. + MemRegion region_stack_pop_lock_free() { + return _regionStack.pop_lock_free(); + } + #if 0 - // Currently this is not used. See the comment in the .cpp file. - MemRegion region_stack_pop() { return _regionStack.pop(); } -#endif // 0 + // The routines that manipulate the region stack with a lock are + // not currently used. They should be retained, however, as a + // diagnostic aid. bool region_stack_push_with_lock(MemRegion mr) { // Currently we only call the lock-based version during either @@ -579,6 +614,7 @@ public: } return true; } + MemRegion region_stack_pop_with_lock() { // Currently we only call the lock-based version during either // concurrent marking or remark. @@ -587,11 +623,21 @@ public: return _regionStack.pop_with_lock(); } +#endif int region_stack_size() { return _regionStack.size(); } bool region_stack_overflow() { return _regionStack.overflow(); } bool region_stack_empty() { return _regionStack.isEmpty(); } + // Iterate over any regions that were aborted while draining the + // region stack (any such regions are saved in the corresponding + // CMTask) and invalidate (i.e. assign to the empty MemRegion()) + // any regions that point into the collection set. + bool invalidate_aborted_regions_in_cset(); + + // Returns true if there are any aborted memory regions. + bool has_aborted_regions(); + bool concurrent_marking_in_progress() { return _concurrent_marking_in_progress; } @@ -856,6 +902,15 @@ private: // stack. HeapWord* _region_finger; + // If we abort while scanning a region we record the remaining + // unscanned portion and check this field when marking restarts. + // This avoids having to push on the region stack while other + // marking threads may still be popping regions. + // If we were to push the unscanned portion directly to the + // region stack then we would need to using locking versions + // of the push and pop operations. + MemRegion _aborted_region; + // the number of words this task has scanned size_t _words_scanned; // When _words_scanned reaches this limit, the regular clock is @@ -1012,6 +1067,15 @@ public: void clear_has_aborted() { _has_aborted = false; } bool claimed() { return _claimed; } + // Support routines for the partially scanned region that may be + // recorded as a result of aborting while draining the CMRegionStack + MemRegion aborted_region() { return _aborted_region; } + void set_aborted_region(MemRegion mr) + { _aborted_region = mr; } + + // Clears any recorded partially scanned region + void clear_aborted_region() { set_aborted_region(MemRegion()); } + void set_oop_closure(OopClosure* oop_closure) { _oop_closure = oop_closure; } @@ -1081,3 +1145,5 @@ public: void increase_objs_found_on_bitmap() { ++_objs_found_on_bitmap; } #endif // _MARKING_STATS_ }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp index 88d9e01d0ab..6eedf71a267 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,14 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_concurrentMarkThread.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/concurrentMarkThread.inline.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1CollectorPolicy.hpp" +#include "gc_implementation/g1/g1MMUTracker.hpp" +#include "gc_implementation/g1/vm_operations_g1.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/vmThread.hpp" // ======= Concurrent Mark Thread ======== @@ -271,7 +277,9 @@ void ConcurrentMarkThread::run() { // completed. This will also notify the FullGCCount_lock in case a // Java thread is waiting for a full GC to happen (e.g., it // called System.gc() with +ExplicitGCInvokesConcurrent). - g1->increment_full_collections_completed(true /* outer */); + _sts.join(); + g1->increment_full_collections_completed(true /* concurrent */); + _sts.leave(); } assert(_should_terminate, "just checking"); @@ -303,9 +311,10 @@ void ConcurrentMarkThread::print_on(outputStream* st) const { } void ConcurrentMarkThread::sleepBeforeNextCycle() { - clear_in_progress(); // We join here because we don't want to do the "shouldConcurrentMark()" // below while the world is otherwise stopped. + assert(!in_progress(), "should have been cleared"); + MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag); while (!started()) { CGC_lock->wait(Mutex::_no_safepoint_check_flag); diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp index c6480c90dc0..84bdb590ea2 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARKTHREAD_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARKTHREAD_HPP + +#include "gc_implementation/shared/concurrentGCThread.hpp" + // The Concurrent Mark GC Thread (could be several in the future). // This is copied from the Concurrent Mark Sweep GC Thread // Still under construction. @@ -69,12 +74,12 @@ class ConcurrentMarkThread: public ConcurrentGCThread { ConcurrentMark* cm() { return _cm; } - void set_started() { _started = true; } - void clear_started() { _started = false; } + void set_started() { assert(!_in_progress, "cycle in progress"); _started = true; } + void clear_started() { assert(_in_progress, "must be starting a cycle"); _started = false; } bool started() { return _started; } - void set_in_progress() { _in_progress = true; } - void clear_in_progress() { _in_progress = false; } + void set_in_progress() { assert(_started, "must be starting a cycle"); _in_progress = true; } + void clear_in_progress() { assert(!_started, "must not be starting a new cycle"); _in_progress = false; } bool in_progress() { return _in_progress; } // This flag returns true from the moment a marking cycle is @@ -93,3 +98,5 @@ class ConcurrentMarkThread: public ConcurrentGCThread { // shutdown void stop(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARKTHREAD_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.inline.hpp index b23b6f7f93b..320daf9b8d3 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARKTHREAD_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARKTHREAD_INLINE_HPP + +#include "gc_implementation/g1/concurrentMark.hpp" +#include "gc_implementation/g1/concurrentMarkThread.hpp" + // Total virtual time so far. inline double ConcurrentMarkThread::vtime_accum() { return _vtime_accum + _cm->all_task_accum_vtime(); @@ -31,3 +37,5 @@ inline double ConcurrentMarkThread::vtime_accum() { inline double ConcurrentMarkThread::vtime_mark_accum() { return _vtime_mark_accum + _cm->all_task_accum_vtime(); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARKTHREAD_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentZFThread.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentZFThread.cpp index 323fc82999e..425d67fcd56 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentZFThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentZFThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_concurrentZFThread.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/concurrentZFThread.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/heapRegion.hpp" +#include "memory/space.inline.hpp" +#include "runtime/mutexLocker.hpp" +#include "utilities/copy.hpp" // ======= Concurrent Zero-Fill Thread ======== diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp index 770aa09171c..34731c96242 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTZFTHREAD_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTZFTHREAD_HPP + +#include "gc_implementation/shared/concurrentGCThread.hpp" + // The Concurrent ZF Thread. Performs concurrent zero-filling. class ConcurrentZFThread: public ConcurrentGCThread { @@ -82,3 +87,5 @@ class ConcurrentZFThread: public ConcurrentGCThread { static void print_summary_info(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTZFTHREAD_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp index c8100c4770e..2a7f5138049 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp @@ -22,8 +22,23 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_dirtyCardQueue.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/dirtyCardQueue.hpp" +#include "gc_implementation/g1/heapRegionRemSet.hpp" +#include "runtime/atomic.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/safepoint.hpp" +#include "runtime/thread.hpp" +#include "utilities/workgroup.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif bool DirtyCardQueue::apply_closure(CardTableEntryClosure* cl, bool consume, diff --git a/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp b/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp index 524c0c25681..88d47dbe16b 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp @@ -22,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_DIRTYCARDQUEUE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_DIRTYCARDQUEUE_HPP + +#include "gc_implementation/g1/ptrQueue.hpp" +#include "memory/allocation.hpp" + class FreeIdSet; // A closure class for processing card table entries. Note that we don't @@ -37,11 +43,10 @@ public: class DirtyCardQueue: public PtrQueue { public: DirtyCardQueue(PtrQueueSet* qset_, bool perm = false) : - PtrQueue(qset_, perm) - { - // Dirty card queues are always active. - _active = true; - } + // Dirty card queues are always active, so we create them with their + // active field set to true. + PtrQueue(qset_, perm, true /* active */) { } + // Apply the closure to all elements, and reset the index to make the // buffer empty. If a closure application returns "false", return // "false" immediately, halting the iteration. If "consume" is true, @@ -169,3 +174,5 @@ public: } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_DIRTYCARDQUEUE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp index 106c521698a..270e1fa3d62 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_g1BlockOffsetTable.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp" +#include "memory/space.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/java.hpp" ////////////////////////////////////////////////////////////////////// // G1BlockOffsetSharedArray @@ -175,7 +178,7 @@ G1BlockOffsetArray::set_remainder_to_point_to_start_incl(size_t start_card, size } assert(start_card > _array->index_for(_bottom), "Cannot be first card"); assert(_array->offset_array(start_card-1) <= N_words, - "Offset card has an unexpected value"); + "Offset card has an unexpected value"); size_t start_card_for_region = start_card; u_char offset = max_jubyte; for (int i = 0; i < BlockOffsetArray::N_powers; i++) { @@ -577,6 +580,16 @@ void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_ #endif } +void +G1BlockOffsetArray::set_for_starts_humongous(HeapWord* new_end) { + assert(_end == new_end, "_end should have already been updated"); + + // The first BOT entry should have offset 0. + _array->set_offset_array(_array->index_for(_bottom), 0); + // The rest should point to the first one. + set_remainder_to_point_to_start(_bottom + N_words, new_end); +} + ////////////////////////////////////////////////////////////////////// // G1BlockOffsetArrayContigSpace ////////////////////////////////////////////////////////////////////// @@ -626,3 +639,12 @@ void G1BlockOffsetArrayContigSpace::zero_bottom_entry() { "Precondition of call"); _array->set_offset_array(bottom_index, 0); } + +void +G1BlockOffsetArrayContigSpace::set_for_starts_humongous(HeapWord* new_end) { + G1BlockOffsetArray::set_for_starts_humongous(new_end); + + // Make sure _next_offset_threshold and _next_offset_index point to new_end. + _next_offset_threshold = new_end; + _next_offset_index = _array->index_for(new_end); +} diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp index 7ce92971839..82568dddd8c 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_HPP + +#include "memory/memRegion.hpp" +#include "runtime/virtualspace.hpp" +#include "utilities/globalDefinitions.hpp" + // The CollectedHeap type requires subtypes to implement a method // "block_start". For some subtypes, notably generational // systems using card-table-based write barriers, the efficiency of this @@ -436,6 +443,8 @@ public: } void check_all_cards(size_t left_card, size_t right_card) const; + + virtual void set_for_starts_humongous(HeapWord* new_end); }; // A subtype of BlockOffsetArray that takes advantage of the fact @@ -484,4 +493,8 @@ class G1BlockOffsetArrayContigSpace: public G1BlockOffsetArray { HeapWord* block_start_unsafe(const void* addr); HeapWord* block_start_unsafe_const(const void* addr) const; + + virtual void set_for_starts_humongous(HeapWord* new_end); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp index 08ede99bfb4..e246e93b1c2 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_INLINE_HPP + +#include "gc_implementation/g1/g1BlockOffsetTable.hpp" +#include "memory/space.hpp" + inline HeapWord* G1BlockOffsetTable::block_start(const void* addr) { if (addr >= _bottom && addr < _end) { return block_start_unsafe(addr); @@ -151,3 +157,5 @@ inline void G1BlockOffsetArray::freed(HeapWord* blk_start, HeapWord* blk_end) { inline void G1BlockOffsetArray::freed(HeapWord* blk, size_t size) { freed(blk, blk + size); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index 07425538987..030aecade77 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -22,8 +22,29 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_g1CollectedHeap.cpp.incl" +#include "precompiled.hpp" +#include "code/icBuffer.hpp" +#include "gc_implementation/g1/bufferingOopClosure.hpp" +#include "gc_implementation/g1/concurrentG1Refine.hpp" +#include "gc_implementation/g1/concurrentG1RefineThread.hpp" +#include "gc_implementation/g1/concurrentMarkThread.inline.hpp" +#include "gc_implementation/g1/concurrentZFThread.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1CollectorPolicy.hpp" +#include "gc_implementation/g1/g1MarkSweep.hpp" +#include "gc_implementation/g1/g1OopClosures.inline.hpp" +#include "gc_implementation/g1/g1RemSet.inline.hpp" +#include "gc_implementation/g1/heapRegionRemSet.hpp" +#include "gc_implementation/g1/heapRegionSeq.inline.hpp" +#include "gc_implementation/g1/vm_operations_g1.hpp" +#include "gc_implementation/shared/isGCActiveMark.hpp" +#include "memory/gcLocker.inline.hpp" +#include "memory/genOopClosures.inline.hpp" +#include "memory/generationSpec.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.pcgc.inline.hpp" +#include "runtime/aprofiler.hpp" +#include "runtime/vmThread.hpp" size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0; @@ -37,10 +58,11 @@ size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0; // INVARIANTS/NOTES // // All allocation activity covered by the G1CollectedHeap interface is -// serialized by acquiring the HeapLock. This happens in -// mem_allocate_work, which all such allocation functions call. -// (Note that this does not apply to TLAB allocation, which is not part -// of this interface: it is done by clients of this interface.) +// serialized by acquiring the HeapLock. This happens in mem_allocate +// and allocate_new_tlab, which are the "entry" points to the +// allocation code from the rest of the JVM. (Note that this does not +// apply to TLAB allocation, which is not part of this interface: it +// is done by clients of this interface.) // Local to this file. @@ -515,18 +537,20 @@ HeapRegion* G1CollectedHeap::newAllocRegionWithExpansion(int purpose, // If could fit into free regions w/o expansion, try. // Otherwise, if can expand, do so. // Otherwise, if using ex regions might help, try with ex given back. -HeapWord* G1CollectedHeap::humongousObjAllocate(size_t word_size) { +HeapWord* G1CollectedHeap::humongous_obj_allocate(size_t word_size) { + assert_heap_locked_or_at_safepoint(); assert(regions_accounted_for(), "Region leakage!"); - // We can't allocate H regions while cleanupComplete is running, since - // some of the regions we find to be empty might not yet be added to the - // unclean list. (If we're already at a safepoint, this call is - // unnecessary, not to mention wrong.) - if (!SafepointSynchronize::is_at_safepoint()) + // We can't allocate humongous regions while cleanupComplete is + // running, since some of the regions we find to be empty might not + // yet be added to the unclean list. If we're already at a + // safepoint, this call is unnecessary, not to mention wrong. + if (!SafepointSynchronize::is_at_safepoint()) { wait_for_cleanup_complete(); + } size_t num_regions = - round_to(word_size, HeapRegion::GrainWords) / HeapRegion::GrainWords; + round_to(word_size, HeapRegion::GrainWords) / HeapRegion::GrainWords; // Special case if < one region??? @@ -577,153 +601,494 @@ HeapWord* G1CollectedHeap::humongousObjAllocate(size_t word_size) { return res; } +void +G1CollectedHeap::retire_cur_alloc_region(HeapRegion* cur_alloc_region) { + // The cleanup operation might update _summary_bytes_used + // concurrently with this method. So, right now, if we don't wait + // for it to complete, updates to _summary_bytes_used might get + // lost. This will be resolved in the near future when the operation + // of the free region list is revamped as part of CR 6977804. + wait_for_cleanup_complete(); + + retire_cur_alloc_region_common(cur_alloc_region); + assert(_cur_alloc_region == NULL, "post-condition"); +} + +// See the comment in the .hpp file about the locking protocol and +// assumptions of this method (and other related ones). HeapWord* -G1CollectedHeap::attempt_allocation_slow(size_t word_size, - bool permit_collection_pause) { - HeapWord* res = NULL; - HeapRegion* allocated_young_region = NULL; +G1CollectedHeap::replace_cur_alloc_region_and_allocate(size_t word_size, + bool at_safepoint, + bool do_dirtying, + bool can_expand) { + assert_heap_locked_or_at_safepoint(); + assert(_cur_alloc_region == NULL, + "replace_cur_alloc_region_and_allocate() should only be called " + "after retiring the previous current alloc region"); + assert(SafepointSynchronize::is_at_safepoint() == at_safepoint, + "at_safepoint and is_at_safepoint() should be a tautology"); + assert(!can_expand || g1_policy()->can_expand_young_list(), + "we should not call this method with can_expand == true if " + "we are not allowed to expand the young gen"); - assert( SafepointSynchronize::is_at_safepoint() || - Heap_lock->owned_by_self(), "pre condition of the call" ); - - if (isHumongous(word_size)) { - // Allocation of a humongous object can, in a sense, complete a - // partial region, if the previous alloc was also humongous, and - // caused the test below to succeed. - if (permit_collection_pause) - do_collection_pause_if_appropriate(word_size); - res = humongousObjAllocate(word_size); - assert(_cur_alloc_region == NULL - || !_cur_alloc_region->isHumongous(), - "Prevent a regression of this bug."); - - } else { - // We may have concurrent cleanup working at the time. Wait for it - // to complete. In the future we would probably want to make the - // concurrent cleanup truly concurrent by decoupling it from the - // allocation. - if (!SafepointSynchronize::is_at_safepoint()) + if (can_expand || !g1_policy()->is_young_list_full()) { + if (!at_safepoint) { + // The cleanup operation might update _summary_bytes_used + // concurrently with this method. So, right now, if we don't + // wait for it to complete, updates to _summary_bytes_used might + // get lost. This will be resolved in the near future when the + // operation of the free region list is revamped as part of + // CR 6977804. If we're already at a safepoint, this call is + // unnecessary, not to mention wrong. wait_for_cleanup_complete(); - // If we do a collection pause, this will be reset to a non-NULL - // value. If we don't, nulling here ensures that we allocate a new - // region below. - if (_cur_alloc_region != NULL) { - // We're finished with the _cur_alloc_region. - // As we're builing (at least the young portion) of the collection - // set incrementally we'll add the current allocation region to - // the collection set here. - if (_cur_alloc_region->is_young()) { - g1_policy()->add_region_to_incremental_cset_lhs(_cur_alloc_region); - } - _summary_bytes_used += _cur_alloc_region->used(); - _cur_alloc_region = NULL; } - assert(_cur_alloc_region == NULL, "Invariant."); - // Completion of a heap region is perhaps a good point at which to do - // a collection pause. - if (permit_collection_pause) - do_collection_pause_if_appropriate(word_size); - // Make sure we have an allocation region available. - if (_cur_alloc_region == NULL) { - if (!SafepointSynchronize::is_at_safepoint()) - wait_for_cleanup_complete(); - bool next_is_young = should_set_young_locked(); - // If the next region is not young, make sure it's zero-filled. - _cur_alloc_region = newAllocRegion(word_size, !next_is_young); - if (_cur_alloc_region != NULL) { - _summary_bytes_used -= _cur_alloc_region->used(); - if (next_is_young) { - set_region_short_lived_locked(_cur_alloc_region); - allocated_young_region = _cur_alloc_region; + + HeapRegion* new_cur_alloc_region = newAllocRegion(word_size, + false /* zero_filled */); + if (new_cur_alloc_region != NULL) { + assert(new_cur_alloc_region->is_empty(), + "the newly-allocated region should be empty, " + "as right now we only allocate new regions out of the free list"); + g1_policy()->update_region_num(true /* next_is_young */); + _summary_bytes_used -= new_cur_alloc_region->used(); + set_region_short_lived_locked(new_cur_alloc_region); + + assert(!new_cur_alloc_region->isHumongous(), + "Catch a regression of this bug."); + + // We need to ensure that the stores to _cur_alloc_region and, + // subsequently, to top do not float above the setting of the + // young type. + OrderAccess::storestore(); + + // Now allocate out of the new current alloc region. We could + // have re-used allocate_from_cur_alloc_region() but its + // operation is slightly different to what we need here. First, + // allocate_from_cur_alloc_region() is only called outside a + // safepoint and will always unlock the Heap_lock if it returns + // a non-NULL result. Second, it assumes that the current alloc + // region is what's already assigned in _cur_alloc_region. What + // we want here is to actually do the allocation first before we + // assign the new region to _cur_alloc_region. This ordering is + // not currently important, but it will be essential when we + // change the code to support CAS allocation in the future (see + // CR 6994297). + // + // This allocate method does BOT updates and we don't need them in + // the young generation. This will be fixed in the near future by + // CR 6994297. + HeapWord* result = new_cur_alloc_region->allocate(word_size); + assert(result != NULL, "we just allocate out of an empty region " + "so allocation should have been successful"); + assert(is_in(result), "result should be in the heap"); + + _cur_alloc_region = new_cur_alloc_region; + + if (!at_safepoint) { + Heap_lock->unlock(); + } + + // do the dirtying, if necessary, after we release the Heap_lock + if (do_dirtying) { + dirty_young_block(result, word_size); + } + return result; + } + } + + assert(_cur_alloc_region == NULL, "we failed to allocate a new current " + "alloc region, it should still be NULL"); + assert_heap_locked_or_at_safepoint(); + return NULL; +} + +// See the comment in the .hpp file about the locking protocol and +// assumptions of this method (and other related ones). +HeapWord* +G1CollectedHeap::attempt_allocation_slow(size_t word_size) { + assert_heap_locked_and_not_at_safepoint(); + assert(!isHumongous(word_size), "attempt_allocation_slow() should not be " + "used for humongous allocations"); + + // We will loop while succeeded is false, which means that we tried + // to do a collection, but the VM op did not succeed. So, when we + // exit the loop, either one of the allocation attempts was + // successful, or we succeeded in doing the VM op but which was + // unable to allocate after the collection. + for (int try_count = 1; /* we'll return or break */; try_count += 1) { + bool succeeded = true; + + { + // We may have concurrent cleanup working at the time. Wait for + // it to complete. In the future we would probably want to make + // the concurrent cleanup truly concurrent by decoupling it from + // the allocation. This will happen in the near future as part + // of CR 6977804 which will revamp the operation of the free + // region list. The fact that wait_for_cleanup_complete() will + // do a wait() means that we'll give up the Heap_lock. So, it's + // possible that when we exit wait_for_cleanup_complete() we + // might be able to allocate successfully (since somebody else + // might have done a collection meanwhile). So, we'll attempt to + // allocate again, just in case. When we make cleanup truly + // concurrent with allocation, we should remove this allocation + // attempt as it's redundant (we only reach here after an + // allocation attempt has been unsuccessful). + wait_for_cleanup_complete(); + HeapWord* result = attempt_allocation(word_size); + if (result != NULL) { + assert_heap_not_locked(); + return result; + } + } + + if (GC_locker::is_active_and_needs_gc()) { + // We are locked out of GC because of the GC locker. We can + // allocate a new region only if we can expand the young gen. + + if (g1_policy()->can_expand_young_list()) { + // Yes, we are allowed to expand the young gen. Let's try to + // allocate a new current alloc region. + + HeapWord* result = + replace_cur_alloc_region_and_allocate(word_size, + false, /* at_safepoint */ + true, /* do_dirtying */ + true /* can_expand */); + if (result != NULL) { + assert_heap_not_locked(); + return result; } } - } - assert(_cur_alloc_region == NULL || !_cur_alloc_region->isHumongous(), - "Prevent a regression of this bug."); + // We could not expand the young gen further (or we could but we + // failed to allocate a new region). We'll stall until the GC + // locker forces a GC. - // Now retry the allocation. - if (_cur_alloc_region != NULL) { - if (allocated_young_region != NULL) { - // We need to ensure that the store to top does not - // float above the setting of the young type. - OrderAccess::storestore(); + // If this thread is not in a jni critical section, we stall + // the requestor until the critical section has cleared and + // GC allowed. When the critical section clears, a GC is + // initiated by the last thread exiting the critical section; so + // we retry the allocation sequence from the beginning of the loop, + // rather than causing more, now probably unnecessary, GC attempts. + JavaThread* jthr = JavaThread::current(); + assert(jthr != NULL, "sanity"); + if (!jthr->in_critical()) { + MutexUnlocker mul(Heap_lock); + GC_locker::stall_until_clear(); + + // We'll then fall off the end of the ("if GC locker active") + // if-statement and retry the allocation further down in the + // loop. + } else { + if (CheckJNICalls) { + fatal("Possible deadlock due to allocating while" + " in jni critical section"); + } + return NULL; } - res = _cur_alloc_region->allocate(word_size); - } - } + } else { + // We are not locked out. So, let's try to do a GC. The VM op + // will retry the allocation before it completes. - // NOTE: fails frequently in PRT - assert(regions_accounted_for(), "Region leakage!"); + // Read the GC count while holding the Heap_lock + unsigned int gc_count_before = SharedHeap::heap()->total_collections(); - if (res != NULL) { - if (!SafepointSynchronize::is_at_safepoint()) { - assert( permit_collection_pause, "invariant" ); - assert( Heap_lock->owned_by_self(), "invariant" ); Heap_lock->unlock(); + + HeapWord* result = + do_collection_pause(word_size, gc_count_before, &succeeded); + assert_heap_not_locked(); + if (result != NULL) { + assert(succeeded, "the VM op should have succeeded"); + + // Allocations that take place on VM operations do not do any + // card dirtying and we have to do it here. + dirty_young_block(result, word_size); + return result; + } + + Heap_lock->lock(); } - if (allocated_young_region != NULL) { - HeapRegion* hr = allocated_young_region; - HeapWord* bottom = hr->bottom(); - HeapWord* end = hr->end(); - MemRegion mr(bottom, end); - ((CardTableModRefBS*)_g1h->barrier_set())->dirty(mr); + assert_heap_locked(); + + // We can reach here when we were unsuccessful in doing a GC, + // because another thread beat us to it, or because we were locked + // out of GC due to the GC locker. In either case a new alloc + // region might be available so we will retry the allocation. + HeapWord* result = attempt_allocation(word_size); + if (result != NULL) { + assert_heap_not_locked(); + return result; + } + + // So far our attempts to allocate failed. The only time we'll go + // around the loop and try again is if we tried to do a GC and the + // VM op that we tried to schedule was not successful because + // another thread beat us to it. If that happened it's possible + // that by the time we grabbed the Heap_lock again and tried to + // allocate other threads filled up the young generation, which + // means that the allocation attempt after the GC also failed. So, + // it's worth trying to schedule another GC pause. + if (succeeded) { + break; + } + + // Give a warning if we seem to be looping forever. + if ((QueuedAllocationWarningCount > 0) && + (try_count % QueuedAllocationWarningCount == 0)) { + warning("G1CollectedHeap::attempt_allocation_slow() " + "retries %d times", try_count); } } - assert( SafepointSynchronize::is_at_safepoint() || - (res == NULL && Heap_lock->owned_by_self()) || - (res != NULL && !Heap_lock->owned_by_self()), - "post condition of the call" ); + assert_heap_locked(); + return NULL; +} - return res; +// See the comment in the .hpp file about the locking protocol and +// assumptions of this method (and other related ones). +HeapWord* +G1CollectedHeap::attempt_allocation_humongous(size_t word_size, + bool at_safepoint) { + // This is the method that will allocate a humongous object. All + // allocation paths that attempt to allocate a humongous object + // should eventually reach here. Currently, the only paths are from + // mem_allocate() and attempt_allocation_at_safepoint(). + assert_heap_locked_or_at_safepoint(); + assert(isHumongous(word_size), "attempt_allocation_humongous() " + "should only be used for humongous allocations"); + assert(SafepointSynchronize::is_at_safepoint() == at_safepoint, + "at_safepoint and is_at_safepoint() should be a tautology"); + + HeapWord* result = NULL; + + // We will loop while succeeded is false, which means that we tried + // to do a collection, but the VM op did not succeed. So, when we + // exit the loop, either one of the allocation attempts was + // successful, or we succeeded in doing the VM op but which was + // unable to allocate after the collection. + for (int try_count = 1; /* we'll return or break */; try_count += 1) { + bool succeeded = true; + + // Given that humongous objects are not allocated in young + // regions, we'll first try to do the allocation without doing a + // collection hoping that there's enough space in the heap. + result = humongous_obj_allocate(word_size); + assert(_cur_alloc_region == NULL || !_cur_alloc_region->isHumongous(), + "catch a regression of this bug."); + if (result != NULL) { + if (!at_safepoint) { + // If we're not at a safepoint, unlock the Heap_lock. + Heap_lock->unlock(); + } + return result; + } + + // If we failed to allocate the humongous object, we should try to + // do a collection pause (if we're allowed) in case it reclaims + // enough space for the allocation to succeed after the pause. + if (!at_safepoint) { + // Read the GC count while holding the Heap_lock + unsigned int gc_count_before = SharedHeap::heap()->total_collections(); + + // If we're allowed to do a collection we're not at a + // safepoint, so it is safe to unlock the Heap_lock. + Heap_lock->unlock(); + + result = do_collection_pause(word_size, gc_count_before, &succeeded); + assert_heap_not_locked(); + if (result != NULL) { + assert(succeeded, "the VM op should have succeeded"); + return result; + } + + // If we get here, the VM operation either did not succeed + // (i.e., another thread beat us to it) or it succeeded but + // failed to allocate the object. + + // If we're allowed to do a collection we're not at a + // safepoint, so it is safe to lock the Heap_lock. + Heap_lock->lock(); + } + + assert(result == NULL, "otherwise we should have exited the loop earlier"); + + // So far our attempts to allocate failed. The only time we'll go + // around the loop and try again is if we tried to do a GC and the + // VM op that we tried to schedule was not successful because + // another thread beat us to it. That way it's possible that some + // space was freed up by the thread that successfully scheduled a + // GC. So it's worth trying to allocate again. + if (succeeded) { + break; + } + + // Give a warning if we seem to be looping forever. + if ((QueuedAllocationWarningCount > 0) && + (try_count % QueuedAllocationWarningCount == 0)) { + warning("G1CollectedHeap::attempt_allocation_humongous " + "retries %d times", try_count); + } + } + + assert_heap_locked_or_at_safepoint(); + return NULL; +} + +HeapWord* G1CollectedHeap::attempt_allocation_at_safepoint(size_t word_size, + bool expect_null_cur_alloc_region) { + assert_at_safepoint(); + assert(_cur_alloc_region == NULL || !expect_null_cur_alloc_region, + err_msg("the current alloc region was unexpectedly found " + "to be non-NULL, cur alloc region: "PTR_FORMAT" " + "expect_null_cur_alloc_region: %d word_size: "SIZE_FORMAT, + _cur_alloc_region, expect_null_cur_alloc_region, word_size)); + + if (!isHumongous(word_size)) { + if (!expect_null_cur_alloc_region) { + HeapRegion* cur_alloc_region = _cur_alloc_region; + if (cur_alloc_region != NULL) { + // This allocate method does BOT updates and we don't need them in + // the young generation. This will be fixed in the near future by + // CR 6994297. + HeapWord* result = cur_alloc_region->allocate(word_size); + if (result != NULL) { + assert(is_in(result), "result should be in the heap"); + + // We will not do any dirtying here. This is guaranteed to be + // called during a safepoint and the thread that scheduled the + // pause will do the dirtying if we return a non-NULL result. + return result; + } + + retire_cur_alloc_region_common(cur_alloc_region); + } + } + + assert(_cur_alloc_region == NULL, + "at this point we should have no cur alloc region"); + return replace_cur_alloc_region_and_allocate(word_size, + true, /* at_safepoint */ + false /* do_dirtying */, + false /* can_expand */); + } else { + return attempt_allocation_humongous(word_size, + true /* at_safepoint */); + } + + ShouldNotReachHere(); +} + +HeapWord* G1CollectedHeap::allocate_new_tlab(size_t word_size) { + assert_heap_not_locked_and_not_at_safepoint(); + assert(!isHumongous(word_size), "we do not allow TLABs of humongous size"); + + Heap_lock->lock(); + + // First attempt: try allocating out of the current alloc region or + // after replacing the current alloc region. + HeapWord* result = attempt_allocation(word_size); + if (result != NULL) { + assert_heap_not_locked(); + return result; + } + + assert_heap_locked(); + + // Second attempt: go into the even slower path where we might + // try to schedule a collection. + result = attempt_allocation_slow(word_size); + if (result != NULL) { + assert_heap_not_locked(); + return result; + } + + assert_heap_locked(); + Heap_lock->unlock(); + return NULL; } HeapWord* G1CollectedHeap::mem_allocate(size_t word_size, bool is_noref, bool is_tlab, - bool* gc_overhead_limit_was_exceeded) { - debug_only(check_for_valid_allocation_state()); - assert(no_gc_in_progress(), "Allocation during gc not allowed"); - HeapWord* result = NULL; + bool* gc_overhead_limit_was_exceeded) { + assert_heap_not_locked_and_not_at_safepoint(); + assert(!is_tlab, "mem_allocate() this should not be called directly " + "to allocate TLABs"); // Loop until the allocation is satisified, // or unsatisfied after GC. - for (int try_count = 1; /* return or throw */; try_count += 1) { - int gc_count_before; + for (int try_count = 1; /* we'll return */; try_count += 1) { + unsigned int gc_count_before; { Heap_lock->lock(); - result = attempt_allocation(word_size); - if (result != NULL) { - // attempt_allocation should have unlocked the heap lock - assert(is_in(result), "result not in heap"); - return result; + + if (!isHumongous(word_size)) { + // First attempt: try allocating out of the current alloc + // region or after replacing the current alloc region. + HeapWord* result = attempt_allocation(word_size); + if (result != NULL) { + assert_heap_not_locked(); + return result; + } + + assert_heap_locked(); + + // Second attempt: go into the even slower path where we might + // try to schedule a collection. + result = attempt_allocation_slow(word_size); + if (result != NULL) { + assert_heap_not_locked(); + return result; + } + } else { + HeapWord* result = attempt_allocation_humongous(word_size, + false /* at_safepoint */); + if (result != NULL) { + assert_heap_not_locked(); + return result; + } } + + assert_heap_locked(); // Read the gc count while the heap lock is held. gc_count_before = SharedHeap::heap()->total_collections(); + // We cannot be at a safepoint, so it is safe to unlock the Heap_lock Heap_lock->unlock(); } // Create the garbage collection operation... - VM_G1CollectForAllocation op(word_size, - gc_count_before); - + VM_G1CollectForAllocation op(gc_count_before, word_size); // ...and get the VM thread to execute it. VMThread::execute(&op); - if (op.prologue_succeeded()) { - result = op.result(); - assert(result == NULL || is_in(result), "result not in heap"); + + assert_heap_not_locked(); + if (op.prologue_succeeded() && op.pause_succeeded()) { + // If the operation was successful we'll return the result even + // if it is NULL. If the allocation attempt failed immediately + // after a Full GC, it's unlikely we'll be able to allocate now. + HeapWord* result = op.result(); + if (result != NULL && !isHumongous(word_size)) { + // Allocations that take place on VM operations do not do any + // card dirtying and we have to do it here. We only have to do + // this for non-humongous allocations, though. + dirty_young_block(result, word_size); + } return result; + } else { + assert(op.result() == NULL, + "the result should be NULL if the VM op did not succeed"); } // Give a warning if we seem to be looping forever. if ((QueuedAllocationWarningCount > 0) && (try_count % QueuedAllocationWarningCount == 0)) { - warning("G1CollectedHeap::mem_allocate_work retries %d times", - try_count); + warning("G1CollectedHeap::mem_allocate retries %d times", try_count); } } + + ShouldNotReachHere(); } void G1CollectedHeap::abandon_cur_alloc_region() { @@ -791,10 +1156,11 @@ class RebuildRSOutOfRegionClosure: public HeapRegionClosure { int _worker_i; public: RebuildRSOutOfRegionClosure(G1CollectedHeap* g1, int worker_i = 0) : - _cl(g1->g1_rem_set()->as_HRInto_G1RemSet(), worker_i), + _cl(g1->g1_rem_set(), worker_i), _worker_i(worker_i), _g1h(g1) { } + bool doHeapRegion(HeapRegion* r) { if (!r->continuesHumongous()) { _cl.set_from(r); @@ -819,13 +1185,14 @@ public: } }; -void G1CollectedHeap::do_collection(bool explicit_gc, +bool G1CollectedHeap::do_collection(bool explicit_gc, bool clear_all_soft_refs, size_t word_size) { if (GC_locker::check_active_before_gc()) { - return; // GC is disabled (e.g. JNI GetXXXCritical operation) + return false; } + DTraceGCProbeMarker gc_probe_marker(true /* full */); ResourceMark rm; if (PrintHeapAtGC) { @@ -890,7 +1257,7 @@ void G1CollectedHeap::do_collection(bool explicit_gc, abandon_cur_alloc_region(); abandon_gc_alloc_regions(); assert(_cur_alloc_region == NULL, "Invariant."); - g1_rem_set()->as_HRInto_G1RemSet()->cleanupHRRS(); + g1_rem_set()->cleanupHRRS(); tear_down_region_lists(); set_used_regions_to_need_zero_fill(); @@ -907,6 +1274,9 @@ void G1CollectedHeap::do_collection(bool explicit_gc, g1_policy()->set_full_young_gcs(true); } + // See the comment in G1CollectedHeap::ref_processing_init() about + // how reference processing currently works in G1. + // Temporarily make reference _discovery_ single threaded (non-MT). ReferenceProcessorMTMutator rp_disc_ser(ref_processor(), false); @@ -961,7 +1331,8 @@ void G1CollectedHeap::do_collection(bool explicit_gc, } // Rebuild remembered sets of all regions. - if (ParallelGCThreads > 0) { + + if (G1CollectedHeap::use_parallel_gc_threads()) { ParRebuildRSTask rebuild_rs_task(this); assert(check_heap_region_claim_values( HeapRegion::InitialClaimValue), "sanity check"); @@ -1019,17 +1390,24 @@ void G1CollectedHeap::do_collection(bool explicit_gc, } // Update the number of full collections that have been completed. - increment_full_collections_completed(false /* outer */); + increment_full_collections_completed(false /* concurrent */); if (PrintHeapAtGC) { Universe::print_heap_after_gc(); } + + return true; } void G1CollectedHeap::do_full_collection(bool clear_all_soft_refs) { - do_collection(true, /* explicit_gc */ - clear_all_soft_refs, - 0 /* word_size */); + // do_collection() will return whether it succeeded in performing + // the GC. Currently, there is no facility on the + // do_full_collection() API to notify the caller than the collection + // did not succeed (e.g., because it was locked out by the GC + // locker). So, right now, we'll ignore the return value. + bool dummy = do_collection(true, /* explicit_gc */ + clear_all_soft_refs, + 0 /* word_size */); } // This code is mostly copied from TenuredGeneration. @@ -1152,46 +1530,74 @@ resize_if_necessary_after_full_collection(size_t word_size) { HeapWord* -G1CollectedHeap::satisfy_failed_allocation(size_t word_size) { - HeapWord* result = NULL; +G1CollectedHeap::satisfy_failed_allocation(size_t word_size, + bool* succeeded) { + assert(SafepointSynchronize::is_at_safepoint(), + "satisfy_failed_allocation() should only be called at a safepoint"); + assert(Thread::current()->is_VM_thread(), + "satisfy_failed_allocation() should only be called by the VM thread"); + + *succeeded = true; + // Let's attempt the allocation first. + HeapWord* result = attempt_allocation_at_safepoint(word_size, + false /* expect_null_cur_alloc_region */); + if (result != NULL) { + assert(*succeeded, "sanity"); + return result; + } // In a G1 heap, we're supposed to keep allocation from failing by // incremental pauses. Therefore, at least for now, we'll favor // expansion over collection. (This might change in the future if we can // do something smarter than full collection to satisfy a failed alloc.) - result = expand_and_allocate(word_size); if (result != NULL) { - assert(is_in(result), "result not in heap"); + assert(*succeeded, "sanity"); return result; } - // OK, I guess we have to try collection. - - do_collection(false, false, word_size); - - result = attempt_allocation(word_size, /*permit_collection_pause*/false); + // Expansion didn't work, we'll try to do a Full GC. + bool gc_succeeded = do_collection(false, /* explicit_gc */ + false, /* clear_all_soft_refs */ + word_size); + if (!gc_succeeded) { + *succeeded = false; + return NULL; + } + // Retry the allocation + result = attempt_allocation_at_safepoint(word_size, + true /* expect_null_cur_alloc_region */); if (result != NULL) { - assert(is_in(result), "result not in heap"); + assert(*succeeded, "sanity"); return result; } - // Try collecting soft references. - do_collection(false, true, word_size); - result = attempt_allocation(word_size, /*permit_collection_pause*/false); + // Then, try a Full GC that will collect all soft references. + gc_succeeded = do_collection(false, /* explicit_gc */ + true, /* clear_all_soft_refs */ + word_size); + if (!gc_succeeded) { + *succeeded = false; + return NULL; + } + + // Retry the allocation once more + result = attempt_allocation_at_safepoint(word_size, + true /* expect_null_cur_alloc_region */); if (result != NULL) { - assert(is_in(result), "result not in heap"); + assert(*succeeded, "sanity"); return result; } assert(!collector_policy()->should_clear_all_soft_refs(), - "Flag should have been handled and cleared prior to this point"); + "Flag should have been handled and cleared prior to this point"); // What else? We might try synchronous finalization later. If the total // space available is large enough for the allocation, then a more // complete compaction phase than we've tried so far might be // appropriate. + assert(*succeeded, "sanity"); return NULL; } @@ -1201,14 +1607,20 @@ G1CollectedHeap::satisfy_failed_allocation(size_t word_size) { // allocated block, or else "NULL". HeapWord* G1CollectedHeap::expand_and_allocate(size_t word_size) { + assert(SafepointSynchronize::is_at_safepoint(), + "expand_and_allocate() should only be called at a safepoint"); + assert(Thread::current()->is_VM_thread(), + "expand_and_allocate() should only be called by the VM thread"); + size_t expand_bytes = word_size * HeapWordSize; if (expand_bytes < MinHeapDeltaBytes) { expand_bytes = MinHeapDeltaBytes; } expand(expand_bytes); assert(regions_accounted_for(), "Region leakage!"); - HeapWord* result = attempt_allocation(word_size, false /* permit_collection_pause */); - return result; + + return attempt_allocation_at_safepoint(word_size, + false /* expect_null_cur_alloc_region */); } size_t G1CollectedHeap::free_region_if_totally_empty(HeapRegion* hr) { @@ -1357,6 +1769,7 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : _g1_policy(policy_), _dirty_card_queue_set(false), _into_cset_dirty_card_queue_set(false), + _is_alive_closure(this), _ref_processor(NULL), _process_strong_tasks(new SubTasksDone(G1H_PS_NumElements)), _bot_shared(NULL), @@ -1505,15 +1918,11 @@ jint G1CollectedHeap::initialize() { } // Also create a G1 rem set. - if (G1UseHRIntoRS) { - if (mr_bs()->is_a(BarrierSet::CardTableModRef)) { - _g1_rem_set = new HRInto_G1RemSet(this, (CardTableModRefBS*)mr_bs()); - } else { - vm_exit_during_initialization("G1 requires a cardtable mod ref bs."); - return JNI_ENOMEM; - } + if (mr_bs()->is_a(BarrierSet::CardTableModRef)) { + _g1_rem_set = new G1RemSet(this, (CardTableModRefBS*)mr_bs()); } else { - _g1_rem_set = new StupidG1RemSet(this); + vm_exit_during_initialization("G1 requires a cardtable mod ref bs."); + return JNI_ENOMEM; } // Carve out the G1 part of the heap. @@ -1630,14 +2039,32 @@ jint G1CollectedHeap::initialize() { } void G1CollectedHeap::ref_processing_init() { + // Reference processing in G1 currently works as follows: + // + // * There is only one reference processor instance that + // 'spans' the entire heap. It is created by the code + // below. + // * Reference discovery is not enabled during an incremental + // pause (see 6484982). + // * Discoverered refs are not enqueued nor are they processed + // during an incremental pause (see 6484982). + // * Reference discovery is enabled at initial marking. + // * Reference discovery is disabled and the discovered + // references processed etc during remarking. + // * Reference discovery is MT (see below). + // * Reference discovery requires a barrier (see below). + // * Reference processing is currently not MT (see 6608385). + // * A full GC enables (non-MT) reference discovery and + // processes any discovered references. + SharedHeap::ref_processing_init(); MemRegion mr = reserved_region(); _ref_processor = ReferenceProcessor::create_ref_processor( mr, // span false, // Reference discovery is not atomic - // (though it shouldn't matter here.) true, // mt_discovery - NULL, // is alive closure: need to fill this in for efficiency + &_is_alive_closure, // is alive closure + // for efficiency ParallelGCThreads, ParallelRefProcEnabled, true); // Setting next fields of discovered @@ -1752,9 +2179,14 @@ bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) { (cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent)); } -void G1CollectedHeap::increment_full_collections_completed(bool outer) { +void G1CollectedHeap::increment_full_collections_completed(bool concurrent) { MonitorLockerEx x(FullGCCount_lock, Mutex::_no_safepoint_check_flag); + // We assume that if concurrent == true, then the caller is a + // concurrent thread that was joined the Suspendible Thread + // Set. If there's ever a cheap way to check this, we should add an + // assert here. + // We have already incremented _total_full_collections at the start // of the GC, so total_full_collections() represents how many full // collections have been started. @@ -1768,22 +2200,31 @@ void G1CollectedHeap::increment_full_collections_completed(bool outer) { // behind the number of full collections started. // This is the case for the inner caller, i.e. a Full GC. - assert(outer || + assert(concurrent || (full_collections_started == _full_collections_completed + 1) || (full_collections_started == _full_collections_completed + 2), - err_msg("for inner caller: full_collections_started = %u " + err_msg("for inner caller (Full GC): full_collections_started = %u " "is inconsistent with _full_collections_completed = %u", full_collections_started, _full_collections_completed)); // This is the case for the outer caller, i.e. the concurrent cycle. - assert(!outer || + assert(!concurrent || (full_collections_started == _full_collections_completed + 1), - err_msg("for outer caller: full_collections_started = %u " + err_msg("for outer caller (concurrent cycle): " + "full_collections_started = %u " "is inconsistent with _full_collections_completed = %u", full_collections_started, _full_collections_completed)); _full_collections_completed += 1; + // We need to clear the "in_progress" flag in the CM thread before + // we wake up any waiters (especially when ExplicitInvokesConcurrent + // is set) so that if a waiter requests another System.gc() it doesn't + // incorrectly see that a marking cyle is still in progress. + if (concurrent) { + _cmThread->clear_in_progress(); + } + // This notify_all() will ensure that a thread that called // System.gc() with (with ExplicitGCInvokesConcurrent set or not) // and it's waiting for a full GC to finish will be woken up. It is @@ -1815,21 +2256,25 @@ void G1CollectedHeap::collect(GCCause::Cause cause) { unsigned int full_gc_count_before; { MutexLocker ml(Heap_lock); + + // Don't want to do a GC until cleanup is completed. This + // limitation will be removed in the near future when the + // operation of the free region list is revamped as part of + // CR 6977804. + wait_for_cleanup_complete(); + // Read the GC count while holding the Heap_lock gc_count_before = SharedHeap::heap()->total_collections(); full_gc_count_before = SharedHeap::heap()->total_full_collections(); - - // Don't want to do a GC until cleanup is completed. - wait_for_cleanup_complete(); - - // We give up heap lock; VMThread::execute gets it back below } if (should_do_concurrent_full_gc(cause)) { // Schedule an initial-mark evacuation pause that will start a - // concurrent cycle. + // concurrent cycle. We're setting word_size to 0 which means that + // we are not requesting a post-GC allocation. VM_G1IncCollectionPause op(gc_count_before, - true, /* should_initiate_conc_mark */ + 0, /* word_size */ + true, /* should_initiate_conc_mark */ g1_policy()->max_pause_time_ms(), cause); VMThread::execute(&op); @@ -1837,8 +2282,10 @@ void G1CollectedHeap::collect(GCCause::Cause cause) { if (cause == GCCause::_gc_locker DEBUG_ONLY(|| cause == GCCause::_scavenge_alot)) { - // Schedule a standard evacuation pause. + // Schedule a standard evacuation pause. We're setting word_size + // to 0 which means that we are not requesting a post-GC allocation. VM_G1IncCollectionPause op(gc_count_before, + 0, /* word_size */ false, /* should_initiate_conc_mark */ g1_policy()->max_pause_time_ms(), cause); @@ -1960,7 +2407,7 @@ G1CollectedHeap::heap_region_par_iterate_chunked(HeapRegionClosure* cl, int worker, jint claim_value) { const size_t regions = n_regions(); - const size_t worker_num = (ParallelGCThreads > 0 ? ParallelGCThreads : 1); + const size_t worker_num = (G1CollectedHeap::use_parallel_gc_threads() ? ParallelGCThreads : 1); // try to spread out the starting points of the workers const size_t start_index = regions / worker_num * (size_t) worker; @@ -2194,14 +2641,6 @@ size_t G1CollectedHeap::unsafe_max_tlab_alloc(Thread* ignored) const { } } -HeapWord* G1CollectedHeap::allocate_new_tlab(size_t word_size) { - assert(!isHumongous(word_size), - err_msg("a TLAB should not be of humongous size, " - "word_size = "SIZE_FORMAT, word_size)); - bool dummy; - return G1CollectedHeap::mem_allocate(word_size, false, true, &dummy); -} - bool G1CollectedHeap::allocs_are_zero_filled() { return false; } @@ -2527,7 +2966,7 @@ void G1CollectedHeap::print_on_extended(outputStream* st) const { } void G1CollectedHeap::print_gc_threads_on(outputStream* st) const { - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { workers()->print_worker_threads_on(st); } @@ -2543,7 +2982,7 @@ void G1CollectedHeap::print_gc_threads_on(outputStream* st) const { } void G1CollectedHeap::gc_threads_do(ThreadClosure* tc) const { - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { workers()->threads_do(tc); } tc->do_thread(_cmThread); @@ -2606,27 +3045,26 @@ void G1CollectedHeap::gc_epilogue(bool full /* Ignored */) { // always_do_update_barrier = true; } -void G1CollectedHeap::do_collection_pause() { - assert(Heap_lock->owned_by_self(), "we assume we'reholding the Heap_lock"); - - // Read the GC count while holding the Heap_lock - // we need to do this _before_ wait_for_cleanup_complete(), to - // ensure that we do not give up the heap lock and potentially - // pick up the wrong count - unsigned int gc_count_before = SharedHeap::heap()->total_collections(); - - // Don't want to do a GC pause while cleanup is being completed! - wait_for_cleanup_complete(); - +HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size, + unsigned int gc_count_before, + bool* succeeded) { + assert_heap_not_locked_and_not_at_safepoint(); g1_policy()->record_stop_world_start(); - { - MutexUnlocker mu(Heap_lock); // give up heap lock, execute gets it back - VM_G1IncCollectionPause op(gc_count_before, - false, /* should_initiate_conc_mark */ - g1_policy()->max_pause_time_ms(), - GCCause::_g1_inc_collection_pause); - VMThread::execute(&op); - } + VM_G1IncCollectionPause op(gc_count_before, + word_size, + false, /* should_initiate_conc_mark */ + g1_policy()->max_pause_time_ms(), + GCCause::_g1_inc_collection_pause); + VMThread::execute(&op); + + HeapWord* result = op.result(); + bool ret_succeeded = op.prologue_succeeded() && op.pause_succeeded(); + assert(result == NULL || ret_succeeded, + "the result should be NULL if the VM did not succeed"); + *succeeded = ret_succeeded; + + assert_heap_not_locked(); + return result; } void @@ -2697,8 +3135,7 @@ size_t G1CollectedHeap::max_pending_card_num() { } size_t G1CollectedHeap::cards_scanned() { - HRInto_G1RemSet* g1_rset = (HRInto_G1RemSet*) g1_rem_set(); - return g1_rset->cardsScanned(); + return g1_rem_set()->cardsScanned(); } void @@ -2771,19 +3208,20 @@ void G1CollectedHeap::reset_taskqueue_stats() { } #endif // TASKQUEUE_STATS -void +bool G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { if (GC_locker::check_active_before_gc()) { - return; // GC is disabled (e.g. JNI GetXXXCritical operation) + return false; } + DTraceGCProbeMarker gc_probe_marker(false /* full */); + ResourceMark rm; + if (PrintHeapAtGC) { Universe::print_heap_before_gc(); } { - ResourceMark rm; - // This call will decide whether this pause is an initial-mark // pause. If it is, during_initial_mark_pause() will return true // for the duration of this pause. @@ -2845,6 +3283,9 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { COMPILER2_PRESENT(DerivedPointerTable::clear()); + // Please see comment in G1CollectedHeap::ref_processing_init() + // to see how reference processing currently works in G1. + // // We want to turn off ref discovery, if necessary, and turn it back on // on again later if we do. XXX Dubious: why is discovery disabled? bool was_enabled = ref_processor()->discovery_enabled(); @@ -3042,6 +3483,8 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { (total_collections() % G1SummarizeRSetStatsPeriod == 0)) { g1_rem_set()->print_summary_info(); } + + return true; } size_t G1CollectedHeap::desired_plab_sz(GCAllocPurpose purpose) @@ -3083,7 +3526,7 @@ void G1CollectedHeap::set_gc_alloc_region(int purpose, HeapRegion* r) { if (r != NULL) { r_used = r->used(); - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { // need to take the lock to guard against two threads calling // get_gc_alloc_region concurrently (very unlikely but...) MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); @@ -3272,6 +3715,7 @@ void G1CollectedHeap::release_gc_alloc_regions(bool totally) { // untag the GC alloc regions and tear down the GC alloc region // list. It's desirable that no regions are tagged as GC alloc // outside GCs. + forget_alloc_region_list(); // The current alloc regions contain objs that have survived @@ -3335,19 +3779,6 @@ void G1CollectedHeap::finalize_for_evac_failure() { // *** Sequential G1 Evacuation -HeapWord* G1CollectedHeap::allocate_during_gc(GCAllocPurpose purpose, size_t word_size) { - HeapRegion* alloc_region = _gc_alloc_regions[purpose]; - // let the caller handle alloc failure - if (alloc_region == NULL) return NULL; - assert(isHumongous(word_size) || !alloc_region->isHumongous(), - "Either the object is humongous or the region isn't"); - HeapWord* block = alloc_region->allocate(word_size); - if (block == NULL) { - block = allocate_during_gc_slow(purpose, alloc_region, false, word_size); - } - return block; -} - class G1IsAliveClosure: public BoolObjectClosure { G1CollectedHeap* _g1; public: @@ -3529,8 +3960,6 @@ void G1CollectedHeap::remove_self_forwarding_pointers() { // Now restore saved marks, if any. if (_objs_with_preserved_marks != NULL) { assert(_preserved_marks_of_objs != NULL, "Both or none."); - assert(_objs_with_preserved_marks->length() == - _preserved_marks_of_objs->length(), "Both or none."); guarantee(_objs_with_preserved_marks->length() == _preserved_marks_of_objs->length(), "Both or none."); for (int i = 0; i < _objs_with_preserved_marks->length(); i++) { @@ -3625,7 +4054,10 @@ void G1CollectedHeap::handle_evacuation_failure_common(oop old, markOop m) { } void G1CollectedHeap::preserve_mark_if_necessary(oop obj, markOop m) { - if (m != markOopDesc::prototype()) { + assert(evacuation_failed(), "Oversaving!"); + // We want to call the "for_promotion_failure" version only in the + // case of a promotion failure. + if (m->must_be_preserved_for_promotion_failure(obj)) { if (_objs_with_preserved_marks == NULL) { assert(_preserved_marks_of_objs == NULL, "Both or none."); _objs_with_preserved_marks = @@ -3841,6 +4273,54 @@ G1ParScanThreadState::print_termination_stats(int i, undo_waste() * HeapWordSize / K); } +#ifdef ASSERT +bool G1ParScanThreadState::verify_ref(narrowOop* ref) const { + assert(ref != NULL, "invariant"); + assert(UseCompressedOops, "sanity"); + assert(!has_partial_array_mask(ref), err_msg("ref=" PTR_FORMAT, ref)); + oop p = oopDesc::load_decode_heap_oop(ref); + assert(_g1h->is_in_g1_reserved(p), + err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, intptr_t(p))); + return true; +} + +bool G1ParScanThreadState::verify_ref(oop* ref) const { + assert(ref != NULL, "invariant"); + if (has_partial_array_mask(ref)) { + // Must be in the collection set--it's already been copied. + oop p = clear_partial_array_mask(ref); + assert(_g1h->obj_in_cs(p), + err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, intptr_t(p))); + } else { + oop p = oopDesc::load_decode_heap_oop(ref); + assert(_g1h->is_in_g1_reserved(p), + err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, intptr_t(p))); + } + return true; +} + +bool G1ParScanThreadState::verify_task(StarTask ref) const { + if (ref.is_narrow()) { + return verify_ref((narrowOop*) ref); + } else { + return verify_ref((oop*) ref); + } +} +#endif // ASSERT + +void G1ParScanThreadState::trim_queue() { + StarTask ref; + do { + // Drain the overflow stack first, so other threads can steal. + while (refs()->pop_overflow(ref)) { + deal_with_reference(ref); + } + while (refs()->pop_local(ref)) { + deal_with_reference(ref); + } + } while (!refs()->is_empty()); +} + G1ParClosureSuper::G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : _g1(g1), _g1_rem(_g1->g1_rem_set()), _cm(_g1->concurrent_mark()), _par_scan_state(par_scan_state) { } @@ -4043,39 +4523,44 @@ public: : _g1h(g1h), _par_scan_state(par_scan_state), _queues(queues), _terminator(terminator) {} - void do_void() { - G1ParScanThreadState* pss = par_scan_state(); - while (true) { - pss->trim_queue(); + void do_void(); - StarTask stolen_task; - if (queues()->steal(pss->queue_num(), pss->hash_seed(), stolen_task)) { - // slightly paranoid tests; I'm trying to catch potential - // problems before we go into push_on_queue to know where the - // problem is coming from - assert((oop*)stolen_task != NULL, "Error"); - if (stolen_task.is_narrow()) { - assert(UseCompressedOops, "Error"); - narrowOop* p = (narrowOop*) stolen_task; - assert(has_partial_array_mask(p) || - _g1h->is_in_g1_reserved(oopDesc::load_decode_heap_oop(p)), "Error"); - pss->push_on_queue(p); - } else { - oop* p = (oop*) stolen_task; - assert(has_partial_array_mask(p) || _g1h->is_in_g1_reserved(*p), "Error"); - pss->push_on_queue(p); - } - continue; - } - pss->start_term_time(); - if (terminator()->offer_termination()) break; - pss->end_term_time(); - } - pss->end_term_time(); - pss->retire_alloc_buffers(); - } +private: + inline bool offer_termination(); }; +bool G1ParEvacuateFollowersClosure::offer_termination() { + G1ParScanThreadState* const pss = par_scan_state(); + pss->start_term_time(); + const bool res = terminator()->offer_termination(); + pss->end_term_time(); + return res; +} + +void G1ParEvacuateFollowersClosure::do_void() { + StarTask stolen_task; + G1ParScanThreadState* const pss = par_scan_state(); + pss->trim_queue(); + + do { + while (queues()->steal(pss->queue_num(), pss->hash_seed(), stolen_task)) { + assert(pss->verify_task(stolen_task), "sanity"); + if (stolen_task.is_narrow()) { + pss->deal_with_reference((narrowOop*) stolen_task); + } else { + pss->deal_with_reference((oop*) stolen_task); + } + + // We've just processed a reference and we might have made + // available new entries on the queues. So we have to make sure + // we drain the queues as necessary. + pss->trim_queue(); + } + } while (!offer_termination()); + + pss->retire_alloc_buffers(); +} + class G1ParTask : public AbstractGangTask { protected: G1CollectedHeap* _g1h; @@ -4173,8 +4658,7 @@ public: pss.print_termination_stats(i); } - assert(pss.refs_to_scan() == 0, "Task queue should be empty"); - assert(pss.overflowed_refs_to_scan() == 0, "Overflow queue should be empty"); + assert(pss.refs()->is_empty(), "should be empty"); double end_time_ms = os::elapsedTime() * 1000.0; _g1h->g1_policy()->record_gc_worker_end_time(i, end_time_ms); } @@ -4182,6 +4666,8 @@ public: // *** Common G1 Evacuation Stuff +// This method is run in a GC worker. + void G1CollectedHeap:: g1_process_strong_roots(bool collecting_perm_gen, @@ -4236,6 +4722,10 @@ g1_process_strong_roots(bool collecting_perm_gen, } // Finish with the ref_processor roots. if (!_process_strong_tasks->is_task_claimed(G1H_PS_refProcessor_oops_do)) { + // We need to treat the discovered reference lists as roots and + // keep entries (which are added by the marking threads) on them + // live until they can be processed at the end of marking. + ref_processor()->weak_oops_do(scan_non_heap_roots); ref_processor()->oops_do(scan_non_heap_roots); } g1_policy()->record_collection_pause_end_G1_strong_roots(); @@ -4259,7 +4749,7 @@ public: }; void G1CollectedHeap::save_marks() { - if (ParallelGCThreads == 0) { + if (!CollectedHeap::use_parallel_gc_threads()) { SaveMarksClosure sm; heap_region_iterate(&sm); } @@ -4284,7 +4774,7 @@ void G1CollectedHeap::evacuate_collection_set() { assert(dirty_card_queue_set().completed_buffers_num() == 0, "Should be empty"); double start_par = os::elapsedTime(); - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { // The individual threads will set their evac-failure closures. StrongRootsScope srs(this); if (ParallelGCVerbose) G1ParScanThreadState::print_termination_stats_hdr(); @@ -4301,6 +4791,11 @@ void G1CollectedHeap::evacuate_collection_set() { // on individual heap regions when we allocate from // them in parallel, so this seems like the correct place for this. retire_all_alloc_regions(); + + // Weak root processing. + // Note: when JSR 292 is enabled and code blobs can contain + // non-perm oops then we will need to process the code blobs + // here too. { G1IsAliveClosure is_alive(this); G1KeepAliveClosure keep_alive(this); @@ -4545,12 +5040,6 @@ void G1CollectedHeap::cleanUpCardTable() { #endif } -void G1CollectedHeap::do_collection_pause_if_appropriate(size_t word_size) { - if (g1_policy()->should_do_collection_pause(word_size)) { - do_collection_pause(); - } -} - void G1CollectedHeap::free_collection_set(HeapRegion* cs_head) { double young_time_ms = 0.0; double non_young_time_ms = 0.0; @@ -4709,6 +5198,7 @@ void G1CollectedHeap::set_unclean_regions_coming_locked(bool b) { } void G1CollectedHeap::wait_for_cleanup_complete() { + assert_not_at_safepoint(); MutexLockerEx x(Cleanup_mon); wait_for_cleanup_complete_locked(); } @@ -5013,13 +5503,6 @@ size_t G1CollectedHeap::count_free_regions_list() { return n + m; } -bool G1CollectedHeap::should_set_young_locked() { - assert(heap_lock_held_for_gc(), - "the heap lock should already be held by or for this thread"); - return (g1_policy()->in_young_gc_mode() && - g1_policy()->should_add_next_region_to_young_list()); -} - void G1CollectedHeap::set_region_short_lived_locked(HeapRegion* hr) { assert(heap_lock_held_for_gc(), "the heap lock should already be held by or for this thread"); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index a342d698d3b..0cec92564fe 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -22,6 +22,17 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_HPP + +#include "gc_implementation/g1/concurrentMark.hpp" +#include "gc_implementation/g1/g1RemSet.hpp" +#include "gc_implementation/g1/heapRegion.hpp" +#include "gc_implementation/parNew/parGCAllocBuffer.hpp" +#include "memory/barrierSet.hpp" +#include "memory/memRegion.hpp" +#include "memory/sharedHeap.hpp" + // A "G1CollectedHeap" is an implementation of a java heap for HotSpot. // It uses the "Garbage First" heap organization and algorithm, which // may combine concurrent marking with parallel, incremental compaction of @@ -279,6 +290,63 @@ private: // started is maintained in _total_full_collections in CollectedHeap. volatile unsigned int _full_collections_completed; + // These are macros so that, if the assert fires, we get the correct + // line number, file, etc. + +#define heap_locking_asserts_err_msg(__extra_message) \ + err_msg("%s : Heap_lock %slocked, %sat a safepoint", \ + (__extra_message), \ + (!Heap_lock->owned_by_self()) ? "NOT " : "", \ + (!SafepointSynchronize::is_at_safepoint()) ? "NOT " : "") + +#define assert_heap_locked() \ + do { \ + assert(Heap_lock->owned_by_self(), \ + heap_locking_asserts_err_msg("should be holding the Heap_lock")); \ + } while (0) + +#define assert_heap_locked_or_at_safepoint() \ + do { \ + assert(Heap_lock->owned_by_self() || \ + SafepointSynchronize::is_at_safepoint(), \ + heap_locking_asserts_err_msg("should be holding the Heap_lock or " \ + "should be at a safepoint")); \ + } while (0) + +#define assert_heap_locked_and_not_at_safepoint() \ + do { \ + assert(Heap_lock->owned_by_self() && \ + !SafepointSynchronize::is_at_safepoint(), \ + heap_locking_asserts_err_msg("should be holding the Heap_lock and " \ + "should not be at a safepoint")); \ + } while (0) + +#define assert_heap_not_locked() \ + do { \ + assert(!Heap_lock->owned_by_self(), \ + heap_locking_asserts_err_msg("should not be holding the Heap_lock")); \ + } while (0) + +#define assert_heap_not_locked_and_not_at_safepoint() \ + do { \ + assert(!Heap_lock->owned_by_self() && \ + !SafepointSynchronize::is_at_safepoint(), \ + heap_locking_asserts_err_msg("should not be holding the Heap_lock and " \ + "should not be at a safepoint")); \ + } while (0) + +#define assert_at_safepoint() \ + do { \ + assert(SafepointSynchronize::is_at_safepoint(), \ + heap_locking_asserts_err_msg("should be at a safepoint")); \ + } while (0) + +#define assert_not_at_safepoint() \ + do { \ + assert(!SafepointSynchronize::is_at_safepoint(), \ + heap_locking_asserts_err_msg("should not be at a safepoint")); \ + } while (0) + protected: // Returns "true" iff none of the gc alloc regions have any allocations @@ -318,31 +386,165 @@ protected: // Attempt to allocate an object of the given (very large) "word_size". // Returns "NULL" on failure. - virtual HeapWord* humongousObjAllocate(size_t word_size); + virtual HeapWord* humongous_obj_allocate(size_t word_size); - // If possible, allocate a block of the given word_size, else return "NULL". - // Returning NULL will trigger GC or heap expansion. - // These two methods have rather awkward pre- and - // post-conditions. If they are called outside a safepoint, then - // they assume that the caller is holding the heap lock. Upon return - // they release the heap lock, if they are returning a non-NULL - // value. attempt_allocation_slow() also dirties the cards of a - // newly-allocated young region after it releases the heap - // lock. This change in interface was the neatest way to achieve - // this card dirtying without affecting mem_allocate(), which is a - // more frequently called method. We tried two or three different - // approaches, but they were even more hacky. - HeapWord* attempt_allocation(size_t word_size, - bool permit_collection_pause = true); + // The following two methods, allocate_new_tlab() and + // mem_allocate(), are the two main entry points from the runtime + // into the G1's allocation routines. They have the following + // assumptions: + // + // * They should both be called outside safepoints. + // + // * They should both be called without holding the Heap_lock. + // + // * All allocation requests for new TLABs should go to + // allocate_new_tlab(). + // + // * All non-TLAB allocation requests should go to mem_allocate() + // and mem_allocate() should never be called with is_tlab == true. + // + // * If the GC locker is active we currently stall until we can + // allocate a new young region. This will be changed in the + // near future (see CR 6994056). + // + // * If either call cannot satisfy the allocation request using the + // current allocating region, they will try to get a new one. If + // this fails, they will attempt to do an evacuation pause and + // retry the allocation. + // + // * If all allocation attempts fail, even after trying to schedule + // an evacuation pause, allocate_new_tlab() will return NULL, + // whereas mem_allocate() will attempt a heap expansion and/or + // schedule a Full GC. + // + // * We do not allow humongous-sized TLABs. So, allocate_new_tlab + // should never be called with word_size being humongous. All + // humongous allocation requests should go to mem_allocate() which + // will satisfy them with a special path. - HeapWord* attempt_allocation_slow(size_t word_size, - bool permit_collection_pause = true); + virtual HeapWord* allocate_new_tlab(size_t word_size); + + virtual HeapWord* mem_allocate(size_t word_size, + bool is_noref, + bool is_tlab, /* expected to be false */ + bool* gc_overhead_limit_was_exceeded); + + // The following methods, allocate_from_cur_allocation_region(), + // attempt_allocation(), replace_cur_alloc_region_and_allocate(), + // attempt_allocation_slow(), and attempt_allocation_humongous() + // have very awkward pre- and post-conditions with respect to + // locking: + // + // If they are called outside a safepoint they assume the caller + // holds the Heap_lock when it calls them. However, on exit they + // will release the Heap_lock if they return a non-NULL result, but + // keep holding the Heap_lock if they return a NULL result. The + // reason for this is that we need to dirty the cards that span + // allocated blocks on young regions to avoid having to take the + // slow path of the write barrier (for performance reasons we don't + // update RSets for references whose source is a young region, so we + // don't need to look at dirty cards on young regions). But, doing + // this card dirtying while holding the Heap_lock can be a + // scalability bottleneck, especially given that some allocation + // requests might be of non-trivial size (and the larger the region + // size is, the fewer allocations requests will be considered + // humongous, as the humongous size limit is a fraction of the + // region size). So, when one of these calls succeeds in allocating + // a block it does the card dirtying after it releases the Heap_lock + // which is why it will return without holding it. + // + // The above assymetry is the reason why locking / unlocking is done + // explicitly (i.e., with Heap_lock->lock() and + // Heap_lock->unlocked()) instead of using MutexLocker and + // MutexUnlocker objects. The latter would ensure that the lock is + // unlocked / re-locked at every possible exit out of the basic + // block. However, we only want that action to happen in selected + // places. + // + // Further, if the above methods are called during a safepoint, then + // naturally there's no assumption about the Heap_lock being held or + // there's no attempt to unlock it. The parameter at_safepoint + // indicates whether the call is made during a safepoint or not (as + // an optimization, to avoid reading the global flag with + // SafepointSynchronize::is_at_safepoint()). + // + // The methods share these parameters: + // + // * word_size : the size of the allocation request in words + // * at_safepoint : whether the call is done at a safepoint; this + // also determines whether a GC is permitted + // (at_safepoint == false) or not (at_safepoint == true) + // * do_dirtying : whether the method should dirty the allocated + // block before returning + // + // They all return either the address of the block, if they + // successfully manage to allocate it, or NULL. + + // It tries to satisfy an allocation request out of the current + // allocating region, which is passed as a parameter. It assumes + // that the caller has checked that the current allocating region is + // not NULL. Given that the caller has to check the current + // allocating region for at least NULL, it might as well pass it as + // the first parameter so that the method doesn't have to read it + // from the _cur_alloc_region field again. + inline HeapWord* allocate_from_cur_alloc_region(HeapRegion* cur_alloc_region, + size_t word_size); + + // It attempts to allocate out of the current alloc region. If that + // fails, it retires the current alloc region (if there is one), + // tries to get a new one and retries the allocation. + inline HeapWord* attempt_allocation(size_t word_size); + + // It assumes that the current alloc region has been retired and + // tries to allocate a new one. If it's successful, it performs the + // allocation out of the new current alloc region and updates + // _cur_alloc_region. Normally, it would try to allocate a new + // region if the young gen is not full, unless can_expand is true in + // which case it would always try to allocate a new region. + HeapWord* replace_cur_alloc_region_and_allocate(size_t word_size, + bool at_safepoint, + bool do_dirtying, + bool can_expand); + + // The slow path when we are unable to allocate a new current alloc + // region to satisfy an allocation request (i.e., when + // attempt_allocation() fails). It will try to do an evacuation + // pause, which might stall due to the GC locker, and retry the + // allocation attempt when appropriate. + HeapWord* attempt_allocation_slow(size_t word_size); + + // The method that tries to satisfy a humongous allocation + // request. If it cannot satisfy it it will try to do an evacuation + // pause to perhaps reclaim enough space to be able to satisfy the + // allocation request afterwards. + HeapWord* attempt_allocation_humongous(size_t word_size, + bool at_safepoint); + + // It does the common work when we are retiring the current alloc region. + inline void retire_cur_alloc_region_common(HeapRegion* cur_alloc_region); + + // It retires the current alloc region, which is passed as a + // parameter (since, typically, the caller is already holding on to + // it). It sets _cur_alloc_region to NULL. + void retire_cur_alloc_region(HeapRegion* cur_alloc_region); + + // It attempts to do an allocation immediately before or after an + // evacuation pause and can only be called by the VM thread. It has + // slightly different assumptions that the ones before (i.e., + // assumes that the current alloc region has been retired). + HeapWord* attempt_allocation_at_safepoint(size_t word_size, + bool expect_null_cur_alloc_region); + + // It dirties the cards that cover the block so that so that the post + // write barrier never queues anything when updating objects on this + // block. It is assumed (and in fact we assert) that the block + // belongs to a young region. + inline void dirty_young_block(HeapWord* start, size_t word_size); // Allocate blocks during garbage collection. Will ensure an // allocation region, either by picking one or expanding the // heap, and then allocate a block of the given size. The block // may not be a humongous - it must fit into a single heap region. - HeapWord* allocate_during_gc(GCAllocPurpose purpose, size_t word_size); HeapWord* par_allocate_during_gc(GCAllocPurpose purpose, size_t word_size); HeapWord* allocate_during_gc_slow(GCAllocPurpose purpose, @@ -359,12 +561,14 @@ protected: void retire_alloc_region(HeapRegion* alloc_region, bool par); // - if explicit_gc is true, the GC is for a System.gc() or a heap - // inspection request and should collect the entire heap - // - if clear_all_soft_refs is true, all soft references are cleared - // during the GC + // inspection request and should collect the entire heap + // - if clear_all_soft_refs is true, all soft references should be + // cleared during the GC // - if explicit_gc is false, word_size describes the allocation that - // the GC should attempt (at least) to satisfy - void do_collection(bool explicit_gc, + // the GC should attempt (at least) to satisfy + // - it returns false if it is unable to do the collection due to the + // GC locker being active, true otherwise + bool do_collection(bool explicit_gc, bool clear_all_soft_refs, size_t word_size); @@ -380,13 +584,13 @@ protected: // Callback from VM_G1CollectForAllocation operation. // This function does everything necessary/possible to satisfy a // failed allocation request (including collection, expansion, etc.) - HeapWord* satisfy_failed_allocation(size_t word_size); + HeapWord* satisfy_failed_allocation(size_t word_size, bool* succeeded); // Attempting to expand the heap sufficiently // to support an allocation of the given "word_size". If // successful, perform the allocation and return the address of the // allocated block, or else "NULL". - virtual HeapWord* expand_and_allocate(size_t word_size); + HeapWord* expand_and_allocate(size_t word_size); public: // Expand the garbage-first heap by at least the given size (in bytes!). @@ -439,16 +643,16 @@ public: // can happen in a nested fashion, i.e., we start a concurrent // cycle, a Full GC happens half-way through it which ends first, // and then the cycle notices that a Full GC happened and ends - // too. The outer parameter is a boolean to help us do a bit tighter - // consistency checking in the method. If outer is false, the caller - // is the inner caller in the nesting (i.e., the Full GC). If outer - // is true, the caller is the outer caller in this nesting (i.e., - // the concurrent cycle). Further nesting is not currently - // supported. The end of the this call also notifies the - // FullGCCount_lock in case a Java thread is waiting for a full GC - // to happen (e.g., it called System.gc() with + // too. The concurrent parameter is a boolean to help us do a bit + // tighter consistency checking in the method. If concurrent is + // false, the caller is the inner caller in the nesting (i.e., the + // Full GC). If concurrent is true, the caller is the outer caller + // in this nesting (i.e., the concurrent cycle). Further nesting is + // not currently supported. The end of the this call also notifies + // the FullGCCount_lock in case a Java thread is waiting for a full + // GC to happen (e.g., it called System.gc() with // +ExplicitGCInvokesConcurrent). - void increment_full_collections_completed(bool outer); + void increment_full_collections_completed(bool concurrent); unsigned int full_collections_completed() { return _full_collections_completed; @@ -467,21 +671,27 @@ protected: void reset_taskqueue_stats(); #endif // TASKQUEUE_STATS - // Do an incremental collection: identify a collection set, and evacuate - // its live objects elsewhere. - virtual void do_collection_pause(); + // Schedule the VM operation that will do an evacuation pause to + // satisfy an allocation request of word_size. *succeeded will + // return whether the VM operation was successful (it did do an + // evacuation pause) or not (another thread beat us to it or the GC + // locker was active). Given that we should not be holding the + // Heap_lock when we enter this method, we will pass the + // gc_count_before (i.e., total_collections()) as a parameter since + // it has to be read while holding the Heap_lock. Currently, both + // methods that call do_collection_pause() release the Heap_lock + // before the call, so it's easy to read gc_count_before just before. + HeapWord* do_collection_pause(size_t word_size, + unsigned int gc_count_before, + bool* succeeded); // The guts of the incremental collection pause, executed by the vm - // thread. - virtual void do_collection_pause_at_safepoint(double target_pause_time_ms); + // thread. It returns false if it is unable to do the collection due + // to the GC locker being active, true otherwise + bool do_collection_pause_at_safepoint(double target_pause_time_ms); // Actually do the work of evacuating the collection set. - virtual void evacuate_collection_set(); - - // If this is an appropriate right time, do a collection pause. - // The "word_size" argument, if non-zero, indicates the size of an - // allocation request that is prompting this query. - void do_collection_pause_if_appropriate(size_t word_size); + void evacuate_collection_set(); // The g1 remembered set of the heap. G1RemSet* _g1_rem_set; @@ -639,6 +849,12 @@ protected: void print_gc_alloc_regions(); #endif // !PRODUCT + // Instance of the concurrent mark is_alive closure for embedding + // into the reference processor as the is_alive_non_header. This + // prevents unnecessary additions to the discovered lists during + // concurrent discovery. + G1CMIsAliveClosure _is_alive_closure; + // ("Weak") Reference processing support ReferenceProcessor* _ref_processor; @@ -656,6 +872,9 @@ protected: bool _unclean_regions_coming; public: + + SubTasksDone* process_strong_tasks() { return _process_strong_tasks; } + void set_refine_cte_cl_concurrency(bool concurrent); RefToScanQueue *task_queue(int i) const; @@ -680,11 +899,11 @@ public: // specified by the policy object. jint initialize(); - void ref_processing_init(); + virtual void ref_processing_init(); void set_par_threads(int t) { SharedHeap::set_par_threads(t); - _process_strong_tasks->set_par_threads(t); + _process_strong_tasks->set_n_threads(t); } virtual CollectedHeap::Name kind() const { @@ -748,11 +967,6 @@ public: #endif // PRODUCT // These virtual functions do the actual allocation. - virtual HeapWord* mem_allocate(size_t word_size, - bool is_noref, - bool is_tlab, - bool* gc_overhead_limit_was_exceeded); - // Some heaps may offer a contiguous region for shared non-blocking // allocation, via inlined code (by exporting the address of the top and // end fields defining the extent of the contiguous allocation region.) @@ -1032,7 +1246,6 @@ public: virtual bool supports_tlab_allocation() const; virtual size_t tlab_capacity(Thread* thr) const; virtual size_t unsafe_max_tlab_alloc(Thread* thr) const; - virtual HeapWord* allocate_new_tlab(size_t word_size); // Can a compiler initialize a new object without store barriers? // This permission only extends from the creation of a new object @@ -1172,7 +1385,6 @@ public: static G1CollectedHeap* heap(); void empty_young_list(); - bool should_set_young_locked(); void set_region_short_lived_locked(HeapRegion* hr); // add appropriate methods for any other surv rate groups @@ -1325,8 +1537,6 @@ public: protected: size_t _max_heap_capacity; -// debug_only(static void check_for_valid_allocation_state();) - public: // Temporary: call to mark things unimplemented for the G1 heap (e.g., // MemoryService). In productization, we can make this assert false @@ -1648,49 +1858,17 @@ public: size_t alloc_buffer_waste() const { return _alloc_buffer_waste; } size_t undo_waste() const { return _undo_waste; } - template void push_on_queue(T* ref) { - assert(ref != NULL, "invariant"); - assert(has_partial_array_mask(ref) || - _g1h->is_in_g1_reserved(oopDesc::load_decode_heap_oop(ref)), "invariant"); #ifdef ASSERT - if (has_partial_array_mask(ref)) { - oop p = clear_partial_array_mask(ref); - // Verify that we point into the CS - assert(_g1h->obj_in_cs(p), "Should be in CS"); - } -#endif + bool verify_ref(narrowOop* ref) const; + bool verify_ref(oop* ref) const; + bool verify_task(StarTask ref) const; +#endif // ASSERT + + template void push_on_queue(T* ref) { + assert(verify_ref(ref), "sanity"); refs()->push(ref); } - void pop_from_queue(StarTask& ref) { - if (refs()->pop_local(ref)) { - assert((oop*)ref != NULL, "pop_local() returned true"); - assert(UseCompressedOops || !ref.is_narrow(), "Error"); - assert(has_partial_array_mask((oop*)ref) || - _g1h->is_in_g1_reserved(ref.is_narrow() ? oopDesc::load_decode_heap_oop((narrowOop*)ref) - : oopDesc::load_decode_heap_oop((oop*)ref)), - "invariant"); - } else { - StarTask null_task; - ref = null_task; - } - } - - void pop_from_overflow_queue(StarTask& ref) { - StarTask new_ref; - refs()->pop_overflow(new_ref); - assert((oop*)new_ref != NULL, "pop() from a local non-empty stack"); - assert(UseCompressedOops || !new_ref.is_narrow(), "Error"); - assert(has_partial_array_mask((oop*)new_ref) || - _g1h->is_in_g1_reserved(new_ref.is_narrow() ? oopDesc::load_decode_heap_oop((narrowOop*)new_ref) - : oopDesc::load_decode_heap_oop((oop*)new_ref)), - "invariant"); - ref = new_ref; - } - - int refs_to_scan() { return refs()->size(); } - int overflowed_refs_to_scan() { return refs()->overflow_stack()->length(); } - template void update_rs(HeapRegion* from, T* p, int tid) { if (G1DeferredRSUpdate) { deferred_rs_update(from, p, tid); @@ -1801,7 +1979,6 @@ public: } } -private: template void deal_with_reference(T* ref_to_scan) { if (has_partial_array_mask(ref_to_scan)) { _partial_scan_cl->do_oop_nv(ref_to_scan); @@ -1815,59 +1992,17 @@ private: } } -public: - void trim_queue() { - // I've replicated the loop twice, first to drain the overflow - // queue, second to drain the task queue. This is better than - // having a single loop, which checks both conditions and, inside - // it, either pops the overflow queue or the task queue, as each - // loop is tighter. Also, the decision to drain the overflow queue - // first is not arbitrary, as the overflow queue is not visible - // to the other workers, whereas the task queue is. So, we want to - // drain the "invisible" entries first, while allowing the other - // workers to potentially steal the "visible" entries. - - while (refs_to_scan() > 0 || overflowed_refs_to_scan() > 0) { - while (overflowed_refs_to_scan() > 0) { - StarTask ref_to_scan; - assert((oop*)ref_to_scan == NULL, "Constructed above"); - pop_from_overflow_queue(ref_to_scan); - // We shouldn't have pushed it on the queue if it was not - // pointing into the CSet. - assert((oop*)ref_to_scan != NULL, "Follows from inner loop invariant"); - if (ref_to_scan.is_narrow()) { - assert(UseCompressedOops, "Error"); - narrowOop* p = (narrowOop*)ref_to_scan; - assert(!has_partial_array_mask(p) && - _g1h->is_in_g1_reserved(oopDesc::load_decode_heap_oop(p)), "sanity"); - deal_with_reference(p); - } else { - oop* p = (oop*)ref_to_scan; - assert((has_partial_array_mask(p) && _g1h->is_in_g1_reserved(clear_partial_array_mask(p))) || - _g1h->is_in_g1_reserved(oopDesc::load_decode_heap_oop(p)), "sanity"); - deal_with_reference(p); - } - } - - while (refs_to_scan() > 0) { - StarTask ref_to_scan; - assert((oop*)ref_to_scan == NULL, "Constructed above"); - pop_from_queue(ref_to_scan); - if ((oop*)ref_to_scan != NULL) { - if (ref_to_scan.is_narrow()) { - assert(UseCompressedOops, "Error"); - narrowOop* p = (narrowOop*)ref_to_scan; - assert(!has_partial_array_mask(p) && - _g1h->is_in_g1_reserved(oopDesc::load_decode_heap_oop(p)), "sanity"); - deal_with_reference(p); - } else { - oop* p = (oop*)ref_to_scan; - assert((has_partial_array_mask(p) && _g1h->obj_in_cs(clear_partial_array_mask(p))) || - _g1h->is_in_g1_reserved(oopDesc::load_decode_heap_oop(p)), "sanity"); - deal_with_reference(p); - } - } - } + void deal_with_reference(StarTask ref) { + assert(verify_task(ref), "sanity"); + if (ref.is_narrow()) { + deal_with_reference((narrowOop*)ref); + } else { + deal_with_reference((oop*)ref); } } + +public: + void trim_queue(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp index c4eb0388417..85812877f87 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,15 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP + +#include "gc_implementation/g1/concurrentMark.hpp" +#include "gc_implementation/g1/g1CollectedHeap.hpp" +#include "gc_implementation/g1/g1CollectorPolicy.hpp" +#include "gc_implementation/g1/heapRegionSeq.hpp" +#include "utilities/taskqueue.hpp" + // Inline functions for G1CollectedHeap inline HeapRegion* @@ -50,37 +59,115 @@ inline bool G1CollectedHeap::obj_in_cs(oop obj) { return r != NULL && r->in_collection_set(); } -inline HeapWord* G1CollectedHeap::attempt_allocation(size_t word_size, - bool permit_collection_pause) { - HeapWord* res = NULL; +// See the comment in the .hpp file about the locking protocol and +// assumptions of this method (and other related ones). +inline HeapWord* +G1CollectedHeap::allocate_from_cur_alloc_region(HeapRegion* cur_alloc_region, + size_t word_size) { + assert_heap_locked_and_not_at_safepoint(); + assert(cur_alloc_region != NULL, "pre-condition of the method"); + assert(cur_alloc_region == _cur_alloc_region, "pre-condition of the method"); + assert(cur_alloc_region->is_young(), + "we only support young current alloc regions"); + assert(!isHumongous(word_size), "allocate_from_cur_alloc_region() " + "should not be used for humongous allocations"); + assert(!cur_alloc_region->isHumongous(), "Catch a regression of this bug."); - assert( SafepointSynchronize::is_at_safepoint() || - Heap_lock->owned_by_self(), "pre-condition of the call" ); + assert(!cur_alloc_region->is_empty(), + err_msg("region ["PTR_FORMAT","PTR_FORMAT"] should not be empty", + cur_alloc_region->bottom(), cur_alloc_region->end())); + // This allocate method does BOT updates and we don't need them in + // the young generation. This will be fixed in the near future by + // CR 6994297. + HeapWord* result = cur_alloc_region->allocate(word_size); + if (result != NULL) { + assert(is_in(result), "result should be in the heap"); + Heap_lock->unlock(); - // All humongous allocation requests should go through the slow path in - // attempt_allocation_slow(). - if (!isHumongous(word_size) && _cur_alloc_region != NULL) { - // If this allocation causes a region to become non empty, - // then we need to update our free_regions count. - - if (_cur_alloc_region->is_empty()) { - res = _cur_alloc_region->allocate(word_size); - if (res != NULL) - _free_regions--; - } else { - res = _cur_alloc_region->allocate(word_size); - } - - if (res != NULL) { - if (!SafepointSynchronize::is_at_safepoint()) { - assert( Heap_lock->owned_by_self(), "invariant" ); - Heap_lock->unlock(); - } - return res; - } + // Do the dirtying after we release the Heap_lock. + dirty_young_block(result, word_size); + return result; } - // attempt_allocation_slow will also unlock the heap lock when appropriate. - return attempt_allocation_slow(word_size, permit_collection_pause); + + assert_heap_locked(); + return NULL; +} + +// See the comment in the .hpp file about the locking protocol and +// assumptions of this method (and other related ones). +inline HeapWord* +G1CollectedHeap::attempt_allocation(size_t word_size) { + assert_heap_locked_and_not_at_safepoint(); + assert(!isHumongous(word_size), "attempt_allocation() should not be called " + "for humongous allocation requests"); + + HeapRegion* cur_alloc_region = _cur_alloc_region; + if (cur_alloc_region != NULL) { + HeapWord* result = allocate_from_cur_alloc_region(cur_alloc_region, + word_size); + if (result != NULL) { + assert_heap_not_locked(); + return result; + } + + assert_heap_locked(); + + // Since we couldn't successfully allocate into it, retire the + // current alloc region. + retire_cur_alloc_region(cur_alloc_region); + } + + // Try to get a new region and allocate out of it + HeapWord* result = replace_cur_alloc_region_and_allocate(word_size, + false, /* at_safepoint */ + true, /* do_dirtying */ + false /* can_expand */); + if (result != NULL) { + assert_heap_not_locked(); + return result; + } + + assert_heap_locked(); + return NULL; +} + +inline void +G1CollectedHeap::retire_cur_alloc_region_common(HeapRegion* cur_alloc_region) { + assert_heap_locked_or_at_safepoint(); + assert(cur_alloc_region != NULL && cur_alloc_region == _cur_alloc_region, + "pre-condition of the call"); + assert(cur_alloc_region->is_young(), + "we only support young current alloc regions"); + + // The region is guaranteed to be young + g1_policy()->add_region_to_incremental_cset_lhs(cur_alloc_region); + _summary_bytes_used += cur_alloc_region->used(); + _cur_alloc_region = NULL; +} + +// It dirties the cards that cover the block so that so that the post +// write barrier never queues anything when updating objects on this +// block. It is assumed (and in fact we assert) that the block +// belongs to a young region. +inline void +G1CollectedHeap::dirty_young_block(HeapWord* start, size_t word_size) { + assert_heap_not_locked(); + + // Assign the containing region to containing_hr so that we don't + // have to keep calling heap_region_containing_raw() in the + // asserts below. + DEBUG_ONLY(HeapRegion* containing_hr = heap_region_containing_raw(start);) + assert(containing_hr != NULL && start != NULL && word_size > 0, + "pre-condition"); + assert(containing_hr->is_in(start), "it should contain start"); + assert(containing_hr->is_young(), "it should be young"); + assert(!containing_hr->isHumongous(), "it should not be humongous"); + + HeapWord* end = start + word_size; + assert(containing_hr->is_in(end - 1), "it should also contain end - 1"); + + MemRegion mr(start, end); + ((CardTableModRefBS*)_g1h->barrier_set())->dirty(mr); } inline RefToScanQueue* G1CollectedHeap::task_queue(int i) const { @@ -94,3 +181,5 @@ inline bool G1CollectedHeap::isMarkedPrev(oop obj) const { inline bool G1CollectedHeap::isMarkedNext(oop obj) const { return _cm->nextMarkBitMap()->isMarked((HeapWord *)obj); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp index 4f8e5d1520a..59f790c7225 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @@ -22,8 +22,18 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_g1CollectorPolicy.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/concurrentG1Refine.hpp" +#include "gc_implementation/g1/concurrentMark.hpp" +#include "gc_implementation/g1/concurrentMarkThread.inline.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1CollectorPolicy.hpp" +#include "gc_implementation/g1/heapRegionRemSet.hpp" +#include "gc_implementation/shared/gcPolicyCounters.hpp" +#include "runtime/arguments.hpp" +#include "runtime/java.hpp" +#include "runtime/mutexLocker.hpp" +#include "utilities/debug.hpp" #define PREDICTIONS_VERBOSE 0 @@ -72,7 +82,10 @@ static double non_young_other_cost_per_region_ms_defaults[] = { // G1CollectorPolicy::G1CollectorPolicy() : - _parallel_gc_threads((ParallelGCThreads > 0) ? ParallelGCThreads : 1), + _parallel_gc_threads(G1CollectedHeap::use_parallel_gc_threads() + ? ParallelGCThreads : 1), + + _n_pauses(0), _recent_CH_strong_roots_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)), _recent_G1_strong_roots_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)), @@ -445,8 +458,8 @@ void G1CollectorPolicy::calculate_young_list_min_length() { double now_sec = os::elapsedTime(); double when_ms = _mmu_tracker->when_max_gc_sec(now_sec) * 1000.0; double alloc_rate_ms = predict_alloc_rate_ms(); - int min_regions = (int) ceil(alloc_rate_ms * when_ms); - int current_region_num = (int) _g1->young_list()->length(); + size_t min_regions = (size_t) ceil(alloc_rate_ms * when_ms); + size_t current_region_num = _g1->young_list()->length(); _young_list_min_length = min_regions + current_region_num; } } @@ -460,9 +473,13 @@ void G1CollectorPolicy::calculate_young_list_target_length() { _young_list_target_length = _young_list_fixed_length; else _young_list_target_length = _young_list_fixed_length / 2; - - _young_list_target_length = MAX2(_young_list_target_length, (size_t)1); } + + // Make sure we allow the application to allocate at least one + // region before we need to do a collection again. + size_t min_length = _g1->young_list()->length() + 1; + _young_list_target_length = MAX2(_young_list_target_length, min_length); + calculate_max_gc_locker_expansion(); calculate_survivors_policy(); } @@ -555,7 +572,7 @@ void G1CollectorPolicy::calculate_young_list_target_length(size_t rs_lengths) { // we should have at least one region in the target young length _young_list_target_length = - MAX2((size_t) 1, final_young_length + _recorded_survivor_regions); + final_young_length + _recorded_survivor_regions; // let's keep an eye of how long we spend on this calculation // right now, I assume that we'll print it when we need it; we @@ -604,8 +621,7 @@ void G1CollectorPolicy::calculate_young_list_target_length(size_t rs_lengths) { _young_list_min_length); #endif // TRACE_CALC_YOUNG_LENGTH // we'll do the pause as soon as possible by choosing the minimum - _young_list_target_length = - MAX2(_young_list_min_length, (size_t) 1); + _young_list_target_length = _young_list_min_length; } _rs_lengths_prediction = rs_lengths; @@ -788,7 +804,7 @@ void G1CollectorPolicy::record_full_collection_end() { _survivor_surv_rate_group->reset(); calculate_young_list_min_length(); calculate_young_list_target_length(); - } +} void G1CollectorPolicy::record_before_bytes(size_t bytes) { _bytes_in_to_space_before_gc += bytes; @@ -811,9 +827,9 @@ void G1CollectorPolicy::record_collection_pause_start(double start_time_sec, gclog_or_tty->print(" (%s)", full_young_gcs() ? "young" : "partial"); } - assert(_g1->used_regions() == _g1->recalculate_used_regions(), - "sanity"); - assert(_g1->used() == _g1->recalculate_used(), "sanity"); + assert(_g1->used() == _g1->recalculate_used(), + err_msg("sanity, used: "SIZE_FORMAT" recalculate_used: "SIZE_FORMAT, + _g1->used(), _g1->recalculate_used())); double s_w_t_ms = (start_time_sec - _stop_world_start) * 1000.0; _all_stop_world_times_ms->add(s_w_t_ms); @@ -1073,7 +1089,7 @@ void G1CollectorPolicy::print_stats (int level, } double G1CollectorPolicy::avg_value (double* data) { - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { double ret = 0.0; for (uint i = 0; i < ParallelGCThreads; ++i) ret += data[i]; @@ -1084,7 +1100,7 @@ double G1CollectorPolicy::avg_value (double* data) { } double G1CollectorPolicy::max_value (double* data) { - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { double ret = data[0]; for (uint i = 1; i < ParallelGCThreads; ++i) if (data[i] > ret) @@ -1096,7 +1112,7 @@ double G1CollectorPolicy::max_value (double* data) { } double G1CollectorPolicy::sum_of_values (double* data) { - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { double sum = 0.0; for (uint i = 0; i < ParallelGCThreads; i++) sum += data[i]; @@ -1110,7 +1126,7 @@ double G1CollectorPolicy::max_sum (double* data1, double* data2) { double ret = data1[0] + data2[0]; - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { for (uint i = 1; i < ParallelGCThreads; ++i) { double data = data1[i] + data2[i]; if (data > ret) @@ -1126,7 +1142,7 @@ double G1CollectorPolicy::max_sum (double* data1, void G1CollectorPolicy::record_collection_pause_end() { double end_time_sec = os::elapsedTime(); double elapsed_ms = _last_pause_time_ms; - bool parallel = ParallelGCThreads > 0; + bool parallel = G1CollectedHeap::use_parallel_gc_threads(); double evac_ms = (end_time_sec - _cur_G1_strong_roots_end_sec) * 1000.0; size_t rs_size = _cur_collection_pause_used_regions_at_start - collection_set_size(); @@ -1941,7 +1957,7 @@ G1CollectorPolicy::recent_avg_survival_fraction_work(TruncatedSeq* surviving, // Further, we're now always doing parallel collection. But I'm still // leaving this here as a placeholder for a more precise assertion later. // (DLD, 10/05.) - assert((true || ParallelGCThreads > 0) || + assert((true || G1CollectedHeap::use_parallel_gc_threads()) || _g1->evacuation_failed() || recent_survival_rate <= 1.0, "Or bad frac"); return recent_survival_rate; @@ -1961,7 +1977,7 @@ G1CollectorPolicy::last_survival_fraction_work(TruncatedSeq* surviving, // Further, we're now always doing parallel collection. But I'm still // leaving this here as a placeholder for a more precise assertion later. // (DLD, 10/05.) - assert((true || ParallelGCThreads > 0) || + assert((true || G1CollectedHeap::use_parallel_gc_threads()) || last_survival_rate <= 1.0, "Or bad frac"); return last_survival_rate; } else { @@ -2121,7 +2137,7 @@ void G1CollectorPolicy::check_other_times(int level, } void G1CollectorPolicy::print_summary(PauseSummary* summary) const { - bool parallel = ParallelGCThreads > 0; + bool parallel = G1CollectedHeap::use_parallel_gc_threads(); MainBodySummary* body_summary = summary->main_body_summary(); if (summary->get_total_seq()->num() > 0) { print_summary_sd(0, "Evacuation Pauses", summary->get_total_seq()); @@ -2253,24 +2269,13 @@ void G1CollectorPolicy::print_yg_surv_rate_info() const { #endif // PRODUCT } -bool -G1CollectorPolicy::should_add_next_region_to_young_list() { - assert(in_young_gc_mode(), "should be in young GC mode"); - bool ret; - size_t young_list_length = _g1->young_list()->length(); - size_t young_list_max_length = _young_list_target_length; - if (G1FixedEdenSize) { - young_list_max_length -= _max_survivor_regions; - } - if (young_list_length < young_list_max_length) { - ret = true; +void +G1CollectorPolicy::update_region_num(bool young) { + if (young) { ++_region_num_young; } else { - ret = false; ++_region_num_tenured; } - - return ret; } #ifndef PRODUCT @@ -2297,6 +2302,21 @@ size_t G1CollectorPolicy::max_regions(int purpose) { }; } +void G1CollectorPolicy::calculate_max_gc_locker_expansion() { + size_t expansion_region_num = 0; + if (GCLockerEdenExpansionPercent > 0) { + double perc = (double) GCLockerEdenExpansionPercent / 100.0; + double expansion_region_num_d = perc * (double) _young_list_target_length; + // We use ceiling so that if expansion_region_num_d is > 0.0 (but + // less than 1.0) we'll get 1. + expansion_region_num = (size_t) ceil(expansion_region_num_d); + } else { + assert(expansion_region_num == 0, "sanity"); + } + _young_list_max_length = _young_list_target_length + expansion_region_num; + assert(_young_list_target_length <= _young_list_max_length, "post-condition"); +} + // Calculates survivor space parameters. void G1CollectorPolicy::calculate_survivors_policy() { @@ -2314,32 +2334,6 @@ void G1CollectorPolicy::calculate_survivors_policy() } } -bool -G1CollectorPolicy_BestRegionsFirst::should_do_collection_pause(size_t - word_size) { - assert(_g1->regions_accounted_for(), "Region leakage!"); - double max_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0; - - size_t young_list_length = _g1->young_list()->length(); - size_t young_list_max_length = _young_list_target_length; - if (G1FixedEdenSize) { - young_list_max_length -= _max_survivor_regions; - } - bool reached_target_length = young_list_length >= young_list_max_length; - - if (in_young_gc_mode()) { - if (reached_target_length) { - assert( young_list_length > 0 && _g1->young_list()->length() > 0, - "invariant" ); - return true; - } - } else { - guarantee( false, "should not reach here" ); - } - - return false; -} - #ifndef PRODUCT class HRSortIndexIsOKClosure: public HeapRegionClosure { CollectionSetChooser* _chooser; @@ -2559,7 +2553,7 @@ record_concurrent_mark_cleanup_end(size_t freed_bytes, gclog_or_tty->print_cr(" clear marked regions + work1: %8.3f ms.", (clear_marked_end - start)*1000.0); } - if (ParallelGCThreads > 0) { + if (G1CollectedHeap::use_parallel_gc_threads()) { const size_t OverpartitionFactor = 4; const size_t MinWorkUnit = 8; const size_t WorkUnit = diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp index 33ee6ebc446..f7375d6a48e 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp @@ -22,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTORPOLICY_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTORPOLICY_HPP + +#include "gc_implementation/g1/collectionSetChooser.hpp" +#include "gc_implementation/g1/g1MMUTracker.hpp" +#include "memory/collectorPolicy.hpp" + // A G1CollectorPolicy makes policy decisions that determine the // characteristics of the collector. Examples include: // * choice of collection set. @@ -189,6 +196,10 @@ protected: size_t _young_list_target_length; size_t _young_list_fixed_length; + // The max number of regions we can extend the eden by while the GC + // locker is active. This should be >= _young_list_target_length; + size_t _young_list_max_length; + size_t _young_cset_length; bool _last_young_gc_full; @@ -986,11 +997,6 @@ public: void record_before_bytes(size_t bytes); void record_after_bytes(size_t bytes); - // Returns "true" if this is a good time to do a collection pause. - // The "word_size" argument, if non-zero, indicates the size of an - // allocation request that is prompting this query. - virtual bool should_do_collection_pause(size_t word_size) = 0; - // Choose a new collection set. Marks the chosen regions as being // "in_collection_set", and links them together. The head and number of // the collection set are available via access methods. @@ -1109,7 +1115,25 @@ public: // do that for any other surv rate groups } - bool should_add_next_region_to_young_list(); + bool is_young_list_full() { + size_t young_list_length = _g1->young_list()->length(); + size_t young_list_target_length = _young_list_target_length; + if (G1FixedEdenSize) { + young_list_target_length -= _max_survivor_regions; + } + return young_list_length >= young_list_target_length; + } + + bool can_expand_young_list() { + size_t young_list_length = _g1->young_list()->length(); + size_t young_list_max_length = _young_list_max_length; + if (G1FixedEdenSize) { + young_list_max_length -= _max_survivor_regions; + } + return young_list_length < young_list_max_length; + } + + void update_region_num(bool young); bool in_young_gc_mode() { return _in_young_gc_mode; @@ -1220,6 +1244,8 @@ public: _survivors_age_table.merge_par(age_table); } + void calculate_max_gc_locker_expansion(); + // Calculates survivor space parameters. void calculate_survivors_policy(); @@ -1263,7 +1289,6 @@ public: _collectionSetChooser = new CollectionSetChooser(); } void record_collection_pause_end(); - bool should_do_collection_pause(size_t word_size); // This is not needed any more, after the CSet choosing code was // changed to use the pause prediction work. But let's leave the // hook in just in case. @@ -1287,3 +1312,5 @@ inline double variance(int n, double sum_of_squares, double sum) { // Local Variables: *** // c-indentation-style: gnu *** // End: *** + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTORPOLICY_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.cpp index a83d9c750c7..2943c83151a 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_g1MMUTracker.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/g1MMUTracker.hpp" +#include "runtime/mutexLocker.hpp" +#include "utilities/ostream.hpp" #define _DISABLE_MMU 0 diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.hpp index 269affbea9c..a13c62eb782 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1MMUTRACKER_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1MMUTRACKER_HPP + +#include "memory/allocation.hpp" +#include "utilities/debug.hpp" + // Keeps track of the GC work and decides when it is OK to do GC work // and for how long so that the MMU invariants are maintained. @@ -127,3 +133,5 @@ public: virtual double longest_pause(double current_time); virtual double when_sec(double current_time, double pause_time); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1MMUTRACKER_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp index 465f7d17161..765ef8bc62f 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp @@ -22,8 +22,30 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_g1MarkSweep.cpp.incl" +#include "precompiled.hpp" +#include "classfile/javaClasses.hpp" +#include "classfile/symbolTable.hpp" +#include "classfile/systemDictionary.hpp" +#include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" +#include "code/icBuffer.hpp" +#include "gc_implementation/g1/g1MarkSweep.hpp" +#include "memory/gcLocker.hpp" +#include "memory/genCollectedHeap.hpp" +#include "memory/modRefBarrierSet.hpp" +#include "memory/referencePolicy.hpp" +#include "memory/space.hpp" +#include "oops/instanceRefKlass.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "runtime/aprofiler.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/fprofiler.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/thread.hpp" +#include "runtime/vmThread.hpp" +#include "utilities/copy.hpp" +#include "utilities/events.hpp" class HeapRegion; @@ -101,22 +123,6 @@ void G1MarkSweep::allocate_stacks() { GenMarkSweep::_preserved_count_max = 0; GenMarkSweep::_preserved_marks = NULL; GenMarkSweep::_preserved_count = 0; - GenMarkSweep::_preserved_mark_stack = NULL; - GenMarkSweep::_preserved_oop_stack = NULL; - - GenMarkSweep::_marking_stack = - new (ResourceObj::C_HEAP) GrowableArray(4000, true); - GenMarkSweep::_objarray_stack = - new (ResourceObj::C_HEAP) GrowableArray(50, true); - - int size = SystemDictionary::number_of_classes() * 2; - GenMarkSweep::_revisit_klass_stack = - new (ResourceObj::C_HEAP) GrowableArray(size, true); - // (#klass/k)^2 for k ~ 10 appears a better fit, but this will have to do - // for now until we have a chance to work out a more optimal setting. - GenMarkSweep::_revisit_mdo_stack = - new (ResourceObj::C_HEAP) GrowableArray(size*2, true); - } void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading, @@ -145,7 +151,7 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading, // Follow system dictionary roots and unload classes bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive); - assert(GenMarkSweep::_marking_stack->is_empty(), + assert(GenMarkSweep::_marking_stack.is_empty(), "stack should be empty by now"); // Follow code cache roots (has to be done after system dictionary, @@ -157,19 +163,19 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading, // Update subklass/sibling/implementor links of live klasses GenMarkSweep::follow_weak_klass_links(); - assert(GenMarkSweep::_marking_stack->is_empty(), + assert(GenMarkSweep::_marking_stack.is_empty(), "stack should be empty by now"); // Visit memoized MDO's and clear any unmarked weak refs GenMarkSweep::follow_mdo_weak_refs(); - assert(GenMarkSweep::_marking_stack->is_empty(), "just drained"); + assert(GenMarkSweep::_marking_stack.is_empty(), "just drained"); // Visit symbol and interned string tables and delete unmarked oops SymbolTable::unlink(&GenMarkSweep::is_alive); StringTable::unlink(&GenMarkSweep::is_alive); - assert(GenMarkSweep::_marking_stack->is_empty(), + assert(GenMarkSweep::_marking_stack.is_empty(), "stack should be empty by now"); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp index 125d69dfd0a..c49bc19398a 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,19 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1MARKSWEEP_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1MARKSWEEP_HPP + +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/heapRegion.hpp" +#include "memory/genMarkSweep.hpp" +#include "memory/generation.hpp" +#include "memory/universe.hpp" +#include "oops/markOop.hpp" +#include "oops/oop.hpp" +#include "runtime/timer.hpp" +#include "utilities/growableArray.hpp" + class ReferenceProcessor; // G1MarkSweep takes care of global mark-compact garbage collection for a @@ -55,3 +68,5 @@ class G1MarkSweep : AllStatic { static void allocate_stacks(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1MARKSWEEP_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp index 2aef2518734..26e25f4f61b 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_HPP + class HeapRegion; class G1CollectedHeap; class G1RemSet; -class HRInto_G1RemSet; -class G1RemSet; class ConcurrentMark; class DirtyCardToOopClosure; class CMBitMap; @@ -212,3 +213,5 @@ public: bool do_header() { return false; } int out_of_region() { return _out_of_region; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp index 28ec22b04f3..c223336af89 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp @@ -22,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_INLINE_HPP + +#include "gc_implementation/g1/concurrentMark.hpp" +#include "gc_implementation/g1/g1CollectedHeap.hpp" +#include "gc_implementation/g1/g1OopClosures.hpp" +#include "gc_implementation/g1/g1RemSet.hpp" + /* * This really ought to be an inline function, but apparently the C++ * compiler sometimes sees fit to ignore inline declarations. Sigh. @@ -121,3 +129,5 @@ template inline void G1ParPushHeapRSClosure::do_oop_nv(T* p) { } } + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp index 19ec341f980..622028c402d 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp @@ -22,8 +22,19 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_g1RemSet.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/bufferingOopClosure.hpp" +#include "gc_implementation/g1/concurrentG1Refine.hpp" +#include "gc_implementation/g1/concurrentG1RefineThread.hpp" +#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1CollectorPolicy.hpp" +#include "gc_implementation/g1/g1OopClosures.inline.hpp" +#include "gc_implementation/g1/g1RemSet.inline.hpp" +#include "gc_implementation/g1/heapRegionSeq.inline.hpp" +#include "memory/iterator.hpp" +#include "oops/oop.inline.hpp" +#include "utilities/intHisto.hpp" #define CARD_REPEAT_HISTO 0 @@ -97,13 +108,6 @@ public: } }; -void -StupidG1RemSet::oops_into_collection_set_do(OopsInHeapRegionClosure* oc, - int worker_i) { - IntoCSRegionClosure rc(_g1, oc); - _g1->heap_region_iterate(&rc); -} - class VerifyRSCleanCardOopClosure: public OopClosure { G1CollectedHeap* _g1; public: @@ -119,10 +123,10 @@ public: } }; -HRInto_G1RemSet::HRInto_G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs) - : G1RemSet(g1), _ct_bs(ct_bs), _g1p(_g1->g1_policy()), +G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs) + : _g1(g1), _conc_refine_cards(0), + _ct_bs(ct_bs), _g1p(_g1->g1_policy()), _cg1r(g1->concurrent_g1_refine()), - _traversal_in_progress(false), _cset_rs_update_cl(NULL), _cards_scanned(NULL), _total_cards_scanned(0) { @@ -134,7 +138,7 @@ HRInto_G1RemSet::HRInto_G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs) } } -HRInto_G1RemSet::~HRInto_G1RemSet() { +G1RemSet::~G1RemSet() { delete _seq_task; for (uint i = 0; i < n_workers(); i++) { assert(_cset_rs_update_cl[i] == NULL, "it should be"); @@ -277,7 +281,7 @@ public: // p threads // Then thread t will start at region t * floor (n/p) -HeapRegion* HRInto_G1RemSet::calculateStartRegion(int worker_i) { +HeapRegion* G1RemSet::calculateStartRegion(int worker_i) { HeapRegion* result = _g1p->collection_set(); if (ParallelGCThreads > 0) { size_t cs_size = _g1p->collection_set_size(); @@ -290,7 +294,7 @@ HeapRegion* HRInto_G1RemSet::calculateStartRegion(int worker_i) { return result; } -void HRInto_G1RemSet::scanRS(OopsInHeapRegionClosure* oc, int worker_i) { +void G1RemSet::scanRS(OopsInHeapRegionClosure* oc, int worker_i) { double rs_time_start = os::elapsedTime(); HeapRegion *startRegion = calculateStartRegion(worker_i); @@ -340,7 +344,7 @@ public: } }; -void HRInto_G1RemSet::updateRS(DirtyCardQueue* into_cset_dcq, int worker_i) { +void G1RemSet::updateRS(DirtyCardQueue* into_cset_dcq, int worker_i) { double start = os::elapsedTime(); // Apply the given closure to all remaining log entries. RefineRecordRefsIntoCSCardTableEntryClosure into_cset_update_rs_cl(_g1, into_cset_dcq); @@ -439,12 +443,11 @@ public: } }; -void HRInto_G1RemSet::cleanupHRRS() { +void G1RemSet::cleanupHRRS() { HeapRegionRemSet::cleanup(); } -void -HRInto_G1RemSet::oops_into_collection_set_do(OopsInHeapRegionClosure* oc, +void G1RemSet::oops_into_collection_set_do(OopsInHeapRegionClosure* oc, int worker_i) { #if CARD_REPEAT_HISTO ct_freq_update_histo_and_reset(); @@ -508,8 +511,7 @@ HRInto_G1RemSet::oops_into_collection_set_do(OopsInHeapRegionClosure* oc, _cset_rs_update_cl[worker_i] = NULL; } -void HRInto_G1RemSet:: -prepare_for_oops_into_collection_set_do() { +void G1RemSet::prepare_for_oops_into_collection_set_do() { #if G1_REM_SET_LOGGING PrintRSClosure cl; _g1->collection_set_iterate(&cl); @@ -520,10 +522,8 @@ prepare_for_oops_into_collection_set_do() { DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); dcqs.concatenate_logs(); - assert(!_traversal_in_progress, "Invariant between iterations."); - set_traversal(true); if (ParallelGCThreads > 0) { - _seq_task->set_par_threads((int)n_workers()); + _seq_task->set_n_threads((int)n_workers()); } guarantee( _cards_scanned == NULL, "invariant" ); _cards_scanned = NEW_C_HEAP_ARRAY(size_t, n_workers()); @@ -547,9 +547,6 @@ class cleanUpIteratorsClosure : public HeapRegionClosure { // through the oops which coincide with that card. It scans the reference // fields in each oop; when it finds an oop that points into the collection // set, the RSet for the region containing the referenced object is updated. -// Note: _par_traversal_in_progress in the G1RemSet must be FALSE; otherwise -// the UpdateRSetImmediate closure will cause cards to be enqueued on to -// the DCQS that we're iterating over, causing an infinite loop. class UpdateRSetCardTableEntryIntoCSetClosure: public CardTableEntryClosure { G1CollectedHeap* _g1; CardTableModRefBS* _ct_bs; @@ -581,7 +578,7 @@ public: // RSet updating, // * the post-write barrier shouldn't be logging updates to young // regions (but there is a situation where this can happen - see - // the comment in HRInto_G1RemSet::concurrentRefineOneCard below - + // the comment in G1RemSet::concurrentRefineOneCard below - // that should not be applicable here), and // * during actual RSet updating, the filtering of cards in young // regions in HeapRegion::oops_on_card_seq_iterate_careful is @@ -601,7 +598,7 @@ public: } }; -void HRInto_G1RemSet::cleanup_after_oops_into_collection_set_do() { +void G1RemSet::cleanup_after_oops_into_collection_set_do() { guarantee( _cards_scanned != NULL, "invariant" ); _total_cards_scanned = 0; for (uint i = 0; i < n_workers(); ++i) @@ -619,8 +616,6 @@ void HRInto_G1RemSet::cleanup_after_oops_into_collection_set_do() { // Set all cards back to clean. _g1->cleanUpCardTable(); - set_traversal(false); - DirtyCardQueueSet& into_cset_dcqs = _g1->into_cset_dirty_card_queue_set(); int into_cset_n_buffers = into_cset_dcqs.completed_buffers_num(); @@ -653,21 +648,8 @@ void HRInto_G1RemSet::cleanup_after_oops_into_collection_set_do() { assert(_g1->into_cset_dirty_card_queue_set().completed_buffers_num() == 0, "all buffers should be freed"); _g1->into_cset_dirty_card_queue_set().clear_n_completed_buffers(); - - assert(!_traversal_in_progress, "Invariant between iterations."); } -class UpdateRSObjectClosure: public ObjectClosure { - UpdateRSOopClosure* _update_rs_oop_cl; -public: - UpdateRSObjectClosure(UpdateRSOopClosure* update_rs_oop_cl) : - _update_rs_oop_cl(update_rs_oop_cl) {} - void do_object(oop obj) { - obj->oop_iterate(_update_rs_oop_cl); - } - -}; - class ScrubRSClosure: public HeapRegionClosure { G1CollectedHeap* _g1h; BitMap* _region_bm; @@ -692,12 +674,12 @@ public: } }; -void HRInto_G1RemSet::scrub(BitMap* region_bm, BitMap* card_bm) { +void G1RemSet::scrub(BitMap* region_bm, BitMap* card_bm) { ScrubRSClosure scrub_cl(region_bm, card_bm); _g1->heap_region_iterate(&scrub_cl); } -void HRInto_G1RemSet::scrub_par(BitMap* region_bm, BitMap* card_bm, +void G1RemSet::scrub_par(BitMap* region_bm, BitMap* card_bm, int worker_num, int claim_val) { ScrubRSClosure scrub_cl(region_bm, card_bm); _g1->heap_region_par_iterate_chunked(&scrub_cl, worker_num, claim_val); @@ -741,7 +723,7 @@ public: virtual void do_oop(narrowOop* p) { do_oop_nv(p); } }; -bool HRInto_G1RemSet::concurrentRefineOneCard_impl(jbyte* card_ptr, int worker_i, +bool G1RemSet::concurrentRefineOneCard_impl(jbyte* card_ptr, int worker_i, bool check_for_refs_into_cset) { // Construct the region representing the card. HeapWord* start = _ct_bs->addr_for(card_ptr); @@ -757,7 +739,12 @@ bool HRInto_G1RemSet::concurrentRefineOneCard_impl(jbyte* card_ptr, int worker_i ct_freq_note_card(_ct_bs->index_for(start)); #endif - UpdateRSOopClosure update_rs_oop_cl(this, worker_i); + assert(!check_for_refs_into_cset || _cset_rs_update_cl[worker_i] != NULL, "sanity"); + UpdateRSOrPushRefOopClosure update_rs_oop_cl(_g1, + _g1->g1_rem_set(), + _cset_rs_update_cl[worker_i], + check_for_refs_into_cset, + worker_i); update_rs_oop_cl.set_from(r); TriggerClosure trigger_cl; @@ -820,7 +807,7 @@ bool HRInto_G1RemSet::concurrentRefineOneCard_impl(jbyte* card_ptr, int worker_i return trigger_cl.value(); } -bool HRInto_G1RemSet::concurrentRefineOneCard(jbyte* card_ptr, int worker_i, +bool G1RemSet::concurrentRefineOneCard(jbyte* card_ptr, int worker_i, bool check_for_refs_into_cset) { // If the card is no longer dirty, nothing to do. if (*card_ptr != CardTableModRefBS::dirty_card_val()) { @@ -995,7 +982,7 @@ public: } }; -void HRInto_G1RemSet::print_summary_info() { +void G1RemSet::print_summary_info() { G1CollectedHeap* g1 = G1CollectedHeap::heap(); #if CARD_REPEAT_HISTO @@ -1029,30 +1016,26 @@ void HRInto_G1RemSet::print_summary_info() { g1->concurrent_g1_refine()->threads_do(&p); gclog_or_tty->print_cr(""); - if (G1UseHRIntoRS) { - HRRSStatsIter blk; - g1->heap_region_iterate(&blk); - gclog_or_tty->print_cr(" Total heap region rem set sizes = " SIZE_FORMAT "K." - " Max = " SIZE_FORMAT "K.", - blk.total_mem_sz()/K, blk.max_mem_sz()/K); - gclog_or_tty->print_cr(" Static structures = " SIZE_FORMAT "K," - " free_lists = " SIZE_FORMAT "K.", - HeapRegionRemSet::static_mem_size()/K, - HeapRegionRemSet::fl_mem_size()/K); - gclog_or_tty->print_cr(" %d occupied cards represented.", - blk.occupied()); - gclog_or_tty->print_cr(" Max sz region = [" PTR_FORMAT ", " PTR_FORMAT " )" - ", cap = " SIZE_FORMAT "K, occ = " SIZE_FORMAT "K.", - blk.max_mem_sz_region()->bottom(), blk.max_mem_sz_region()->end(), - (blk.max_mem_sz_region()->rem_set()->mem_size() + K - 1)/K, - (blk.max_mem_sz_region()->rem_set()->occupied() + K - 1)/K); - gclog_or_tty->print_cr(" Did %d coarsenings.", - HeapRegionRemSet::n_coarsenings()); - - } + HRRSStatsIter blk; + g1->heap_region_iterate(&blk); + gclog_or_tty->print_cr(" Total heap region rem set sizes = " SIZE_FORMAT "K." + " Max = " SIZE_FORMAT "K.", + blk.total_mem_sz()/K, blk.max_mem_sz()/K); + gclog_or_tty->print_cr(" Static structures = " SIZE_FORMAT "K," + " free_lists = " SIZE_FORMAT "K.", + HeapRegionRemSet::static_mem_size()/K, + HeapRegionRemSet::fl_mem_size()/K); + gclog_or_tty->print_cr(" %d occupied cards represented.", + blk.occupied()); + gclog_or_tty->print_cr(" Max sz region = [" PTR_FORMAT ", " PTR_FORMAT " )" + ", cap = " SIZE_FORMAT "K, occ = " SIZE_FORMAT "K.", + blk.max_mem_sz_region()->bottom(), blk.max_mem_sz_region()->end(), + (blk.max_mem_sz_region()->rem_set()->mem_size() + K - 1)/K, + (blk.max_mem_sz_region()->rem_set()->occupied() + K - 1)/K); + gclog_or_tty->print_cr(" Did %d coarsenings.", HeapRegionRemSet::n_coarsenings()); } -void HRInto_G1RemSet::prepare_for_verify() { +void G1RemSet::prepare_for_verify() { if (G1HRRSFlushLogBuffersOnVerify && (VerifyBeforeGC || VerifyAfterGC) && !_g1->full_collection()) { diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp index fcb5ecd76cf..adb87a05efb 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp @@ -22,112 +22,26 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_HPP + // A G1RemSet provides ways of iterating over pointers into a selected // collection set. class G1CollectedHeap; class CardTableModRefBarrierSet; -class HRInto_G1RemSet; class ConcurrentG1Refine; +// A G1RemSet in which each heap region has a rem set that records the +// external heap references into it. Uses a mod ref bs to track updates, +// so that they can be used to update the individual region remsets. + class G1RemSet: public CHeapObj { protected: G1CollectedHeap* _g1; unsigned _conc_refine_cards; size_t n_workers(); -public: - G1RemSet(G1CollectedHeap* g1) : - _g1(g1), _conc_refine_cards(0) - {} - - // Invoke "blk->do_oop" on all pointers into the CS in object in regions - // outside the CS (having invoked "blk->set_region" to set the "from" - // region correctly beforehand.) The "worker_i" param is for the - // parallel case where the number of the worker thread calling this - // function can be helpful in partitioning the work to be done. It - // should be the same as the "i" passed to the calling thread's - // work(i) function. In the sequential case this param will be ingored. - virtual void oops_into_collection_set_do(OopsInHeapRegionClosure* blk, - int worker_i) = 0; - - // Prepare for and cleanup after an oops_into_collection_set_do - // call. Must call each of these once before and after (in sequential - // code) any threads call oops into collection set do. (This offers an - // opportunity to sequential setup and teardown of structures needed by a - // parallel iteration over the CS's RS.) - virtual void prepare_for_oops_into_collection_set_do() = 0; - virtual void cleanup_after_oops_into_collection_set_do() = 0; - - // If "this" is of the given subtype, return "this", else "NULL". - virtual HRInto_G1RemSet* as_HRInto_G1RemSet() { return NULL; } - - // Record, if necessary, the fact that *p (where "p" is in region "from", - // and is, a fortiori, required to be non-NULL) has changed to its new value. - virtual void write_ref(HeapRegion* from, oop* p) = 0; - virtual void write_ref(HeapRegion* from, narrowOop* p) = 0; - virtual void par_write_ref(HeapRegion* from, oop* p, int tid) = 0; - virtual void par_write_ref(HeapRegion* from, narrowOop* p, int tid) = 0; - - // Requires "region_bm" and "card_bm" to be bitmaps with 1 bit per region - // or card, respectively, such that a region or card with a corresponding - // 0 bit contains no part of any live object. Eliminates any remembered - // set entries that correspond to dead heap ranges. - virtual void scrub(BitMap* region_bm, BitMap* card_bm) = 0; - // Like the above, but assumes is called in parallel: "worker_num" is the - // parallel thread id of the current thread, and "claim_val" is the - // value that should be used to claim heap regions. - virtual void scrub_par(BitMap* region_bm, BitMap* card_bm, - int worker_num, int claim_val) = 0; - - // Refine the card corresponding to "card_ptr". If "sts" is non-NULL, - // join and leave around parts that must be atomic wrt GC. (NULL means - // being done at a safepoint.) - // With some implementations of this routine, when check_for_refs_into_cset - // is true, a true result may be returned if the given card contains oops - // that have references into the current collection set. - virtual bool concurrentRefineOneCard(jbyte* card_ptr, int worker_i, - bool check_for_refs_into_cset) { - return false; - } - - // Print any relevant summary info. - virtual void print_summary_info() {} - - // Prepare remebered set for verification. - virtual void prepare_for_verify() {}; -}; - - -// The simplest possible G1RemSet: iterates over all objects in non-CS -// regions, searching for pointers into the CS. -class StupidG1RemSet: public G1RemSet { -public: - StupidG1RemSet(G1CollectedHeap* g1) : G1RemSet(g1) {} - - void oops_into_collection_set_do(OopsInHeapRegionClosure* blk, - int worker_i); - - void prepare_for_oops_into_collection_set_do() {} - void cleanup_after_oops_into_collection_set_do() {} - - // Nothing is necessary in the version below. - void write_ref(HeapRegion* from, oop* p) {} - void write_ref(HeapRegion* from, narrowOop* p) {} - void par_write_ref(HeapRegion* from, oop* p, int tid) {} - void par_write_ref(HeapRegion* from, narrowOop* p, int tid) {} - - void scrub(BitMap* region_bm, BitMap* card_bm) {} - void scrub_par(BitMap* region_bm, BitMap* card_bm, - int worker_num, int claim_val) {} - -}; - -// A G1RemSet in which each heap region has a rem set that records the -// external heap references into it. Uses a mod ref bs to track updates, -// so that they can be used to update the individual region remsets. - -class HRInto_G1RemSet: public G1RemSet { protected: enum SomePrivateConstants { UpdateRStoMergeSync = 0, @@ -148,11 +62,6 @@ protected: size_t* _cards_scanned; size_t _total_cards_scanned; - // _traversal_in_progress is "true" iff a traversal is in progress. - - bool _traversal_in_progress; - void set_traversal(bool b) { _traversal_in_progress = b; } - // Used for caching the closure that is responsible for scanning // references into the collection set. OopsInHeapRegionClosure** _cset_rs_update_cl; @@ -165,71 +74,71 @@ protected: bool concurrentRefineOneCard_impl(jbyte* card_ptr, int worker_i, bool check_for_refs_into_cset); -protected: - template void write_ref_nv(HeapRegion* from, T* p); - template void par_write_ref_nv(HeapRegion* from, T* p, int tid); - public: // This is called to reset dual hash tables after the gc pause // is finished and the initial hash table is no longer being // scanned. void cleanupHRRS(); - HRInto_G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs); - ~HRInto_G1RemSet(); + G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs); + ~G1RemSet(); + // Invoke "blk->do_oop" on all pointers into the CS in objects in regions + // outside the CS (having invoked "blk->set_region" to set the "from" + // region correctly beforehand.) The "worker_i" param is for the + // parallel case where the number of the worker thread calling this + // function can be helpful in partitioning the work to be done. It + // should be the same as the "i" passed to the calling thread's + // work(i) function. In the sequential case this param will be ingored. void oops_into_collection_set_do(OopsInHeapRegionClosure* blk, int worker_i); + // Prepare for and cleanup after an oops_into_collection_set_do + // call. Must call each of these once before and after (in sequential + // code) any threads call oops_into_collection_set_do. (This offers an + // opportunity to sequential setup and teardown of structures needed by a + // parallel iteration over the CS's RS.) void prepare_for_oops_into_collection_set_do(); void cleanup_after_oops_into_collection_set_do(); - void scanRS(OopsInHeapRegionClosure* oc, int worker_i); - template void scanNewRefsRS_work(OopsInHeapRegionClosure* oc, int worker_i); - void scanNewRefsRS(OopsInHeapRegionClosure* oc, int worker_i) { - if (UseCompressedOops) { - scanNewRefsRS_work(oc, worker_i); - } else { - scanNewRefsRS_work(oc, worker_i); - } - } - void updateRS(DirtyCardQueue* into_cset_dcq, int worker_i); - HeapRegion* calculateStartRegion(int i); - HRInto_G1RemSet* as_HRInto_G1RemSet() { return this; } + void scanRS(OopsInHeapRegionClosure* oc, int worker_i); + void updateRS(DirtyCardQueue* into_cset_dcq, int worker_i); + + HeapRegion* calculateStartRegion(int i); CardTableModRefBS* ct_bs() { return _ct_bs; } size_t cardsScanned() { return _total_cards_scanned; } // Record, if necessary, the fact that *p (where "p" is in region "from", // which is required to be non-NULL) has changed to a new non-NULL value. - // [Below the virtual version calls a non-virtual protected - // workhorse that is templatified for narrow vs wide oop.] - inline void write_ref(HeapRegion* from, oop* p) { - write_ref_nv(from, p); - } - inline void write_ref(HeapRegion* from, narrowOop* p) { - write_ref_nv(from, p); - } - inline void par_write_ref(HeapRegion* from, oop* p, int tid) { - par_write_ref_nv(from, p, tid); - } - inline void par_write_ref(HeapRegion* from, narrowOop* p, int tid) { - par_write_ref_nv(from, p, tid); - } - - bool self_forwarded(oop obj); + template void write_ref(HeapRegion* from, T* p); + template void par_write_ref(HeapRegion* from, T* p, int tid); + // Requires "region_bm" and "card_bm" to be bitmaps with 1 bit per region + // or card, respectively, such that a region or card with a corresponding + // 0 bit contains no part of any live object. Eliminates any remembered + // set entries that correspond to dead heap ranges. void scrub(BitMap* region_bm, BitMap* card_bm); + + // Like the above, but assumes is called in parallel: "worker_num" is the + // parallel thread id of the current thread, and "claim_val" is the + // value that should be used to claim heap regions. void scrub_par(BitMap* region_bm, BitMap* card_bm, int worker_num, int claim_val); - // If check_for_refs_into_cset is true then a true result is returned - // if the card contains oops that have references into the current - // collection set. + // Refine the card corresponding to "card_ptr". If "sts" is non-NULL, + // join and leave around parts that must be atomic wrt GC. (NULL means + // being done at a safepoint.) + // If check_for_refs_into_cset is true, a true result is returned + // if the given card contains oops that have references into the + // current collection set. virtual bool concurrentRefineOneCard(jbyte* card_ptr, int worker_i, bool check_for_refs_into_cset); + // Print any relevant summary info. virtual void print_summary_info(); + + // Prepare remembered set for verification. virtual void prepare_for_verify(); }; @@ -250,16 +159,15 @@ public: class UpdateRSOopClosure: public OopClosure { HeapRegion* _from; - HRInto_G1RemSet* _rs; + G1RemSet* _rs; int _worker_i; template void do_oop_work(T* p); public: - UpdateRSOopClosure(HRInto_G1RemSet* rs, int worker_i = 0) : - _from(NULL), _rs(rs), _worker_i(worker_i) { - guarantee(_rs != NULL, "Requires an HRIntoG1RemSet"); - } + UpdateRSOopClosure(G1RemSet* rs, int worker_i = 0) : + _from(NULL), _rs(rs), _worker_i(worker_i) + {} void set_from(HeapRegion* from) { assert(from != NULL, "from region must be non-NULL"); @@ -286,3 +194,45 @@ public: virtual void do_oop(narrowOop* p) { do_oop_work(p); } virtual void do_oop( oop* p) { do_oop_work(p); } }; + +class UpdateRSOrPushRefOopClosure: public OopClosure { + G1CollectedHeap* _g1; + G1RemSet* _g1_rem_set; + HeapRegion* _from; + OopsInHeapRegionClosure* _push_ref_cl; + bool _record_refs_into_cset; + int _worker_i; + + template void do_oop_work(T* p); + +public: + UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h, + G1RemSet* rs, + OopsInHeapRegionClosure* push_ref_cl, + bool record_refs_into_cset, + int worker_i = 0) : + _g1(g1h), + _g1_rem_set(rs), + _from(NULL), + _record_refs_into_cset(record_refs_into_cset), + _push_ref_cl(push_ref_cl), + _worker_i(worker_i) { } + + void set_from(HeapRegion* from) { + assert(from != NULL, "from region must be non-NULL"); + _from = from; + } + + bool self_forwarded(oop obj) { + bool result = (obj->is_forwarded() && (obj->forwardee()== obj)); + return result; + } + + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } + + bool apply_to_weak_ref_discovered_field() { return true; } +}; + + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp index ce64065527b..ded66d0aa54 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp @@ -22,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_INLINE_HPP + +#include "gc_implementation/g1/g1RemSet.hpp" +#include "gc_implementation/g1/heapRegionRemSet.hpp" +#include "oops/oop.inline.hpp" + inline size_t G1RemSet::n_workers() { if (_g1->workers() != NULL) { return _g1->workers()->total_workers(); @@ -30,16 +37,13 @@ inline size_t G1RemSet::n_workers() { } } -template inline void HRInto_G1RemSet::write_ref_nv(HeapRegion* from, T* p) { - par_write_ref_nv(from, p, 0); +template +inline void G1RemSet::write_ref(HeapRegion* from, T* p) { + par_write_ref(from, p, 0); } -inline bool HRInto_G1RemSet::self_forwarded(oop obj) { - bool result = (obj->is_forwarded() && (obj->forwardee()== obj)); - return result; -} - -template inline void HRInto_G1RemSet::par_write_ref_nv(HeapRegion* from, T* p, int tid) { +template +inline void G1RemSet::par_write_ref(HeapRegion* from, T* p, int tid) { oop obj = oopDesc::load_decode_heap_oop(p); #ifdef ASSERT // can't do because of races @@ -60,43 +64,26 @@ template inline void HRInto_G1RemSet::par_write_ref_nv(HeapRegion* fro assert(from == NULL || from->is_in_reserved(p), "p is not in from"); HeapRegion* to = _g1->heap_region_containing(obj); - // The test below could be optimized by applying a bit op to to and from. - if (to != NULL && from != NULL && from != to) { - // The _traversal_in_progress flag is true during the collection pause, - // false during the evacuation failure handling. This should avoid a - // potential loop if we were to add the card containing 'p' to the DCQS - // that's used to regenerate the remembered sets for the collection set, - // in the event of an evacuation failure, here. The UpdateRSImmediate - // closure will eventally call this routine. - if (_traversal_in_progress && - to->in_collection_set() && !self_forwarded(obj)) { - - assert(_cset_rs_update_cl[tid] != NULL, "should have been set already"); - _cset_rs_update_cl[tid]->do_oop(p); - - // Deferred updates to the CSet are either discarded (in the normal case), - // or processed (if an evacuation failure occurs) at the end - // of the collection. - // See HRInto_G1RemSet::cleanup_after_oops_into_collection_set_do(). - } else { + if (to != NULL && from != to) { #if G1_REM_SET_LOGGING - gclog_or_tty->print_cr("Adding " PTR_FORMAT " (" PTR_FORMAT ") to RS" - " for region [" PTR_FORMAT ", " PTR_FORMAT ")", - p, obj, - to->bottom(), to->end()); + gclog_or_tty->print_cr("Adding " PTR_FORMAT " (" PTR_FORMAT ") to RS" + " for region [" PTR_FORMAT ", " PTR_FORMAT ")", + p, obj, + to->bottom(), to->end()); #endif - assert(to->rem_set() != NULL, "Need per-region 'into' remsets."); - to->rem_set()->add_reference(p, tid); - } + assert(to->rem_set() != NULL, "Need per-region 'into' remsets."); + to->rem_set()->add_reference(p, tid); } } -template inline void UpdateRSOopClosure::do_oop_work(T* p) { +template +inline void UpdateRSOopClosure::do_oop_work(T* p) { assert(_from != NULL, "from region must be non-NULL"); _rs->par_write_ref(_from, p, _worker_i); } -template inline void UpdateRSetImmediate::do_oop_work(T* p) { +template +inline void UpdateRSetImmediate::do_oop_work(T* p) { assert(_from->is_in_reserved(p), "paranoia"); T heap_oop = oopDesc::load_heap_oop(p); if (!oopDesc::is_null(heap_oop) && !_from->is_survivor()) { @@ -104,3 +91,66 @@ template inline void UpdateRSetImmediate::do_oop_work(T* p) { } } +template +inline void UpdateRSOrPushRefOopClosure::do_oop_work(T* p) { + oop obj = oopDesc::load_decode_heap_oop(p); +#ifdef ASSERT + // can't do because of races + // assert(obj == NULL || obj->is_oop(), "expected an oop"); + + // Do the safe subset of is_oop + if (obj != NULL) { +#ifdef CHECK_UNHANDLED_OOPS + oopDesc* o = obj.obj(); +#else + oopDesc* o = obj; +#endif // CHECK_UNHANDLED_OOPS + assert((intptr_t)o % MinObjAlignmentInBytes == 0, "not oop aligned"); + assert(Universe::heap()->is_in_reserved(obj), "must be in heap"); + } +#endif // ASSERT + + assert(_from != NULL, "from region must be non-NULL"); + + HeapRegion* to = _g1->heap_region_containing(obj); + if (to != NULL && _from != to) { + // The _record_refs_into_cset flag is true during the RSet + // updating part of an evacuation pause. It is false at all + // other times: + // * rebuilding the rembered sets after a full GC + // * during concurrent refinement. + // * updating the remembered sets of regions in the collection + // set in the event of an evacuation failure (when deferred + // updates are enabled). + + if (_record_refs_into_cset && to->in_collection_set()) { + // We are recording references that point into the collection + // set and this particular reference does exactly that... + // If the referenced object has already been forwarded + // to itself, we are handling an evacuation failure and + // we have already visited/tried to copy this object + // there is no need to retry. + if (!self_forwarded(obj)) { + assert(_push_ref_cl != NULL, "should not be null"); + // Push the reference in the refs queue of the G1ParScanThreadState + // instance for this worker thread. + _push_ref_cl->do_oop(p); + } + + // Deferred updates to the CSet are either discarded (in the normal case), + // or processed (if an evacuation failure occurs) at the end + // of the collection. + // See G1RemSet::cleanup_after_oops_into_collection_set_do(). + } else { + // We either don't care about pushing references that point into the + // collection set (i.e. we're not during an evacuation pause) _or_ + // the reference doesn't point into the collection set. Either way + // we add the reference directly to the RSet of the region containing + // the referenced object. + _g1_rem_set->par_write_ref(_from, p, _worker_i); + } + } +} + + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp index eea9ade89bf..8145aa9fce0 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,21 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_g1SATBCardTableModRefBS.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" +#include "gc_implementation/g1/heapRegion.hpp" +#include "gc_implementation/g1/satbQueue.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/thread.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap, int max_covered_regions) : diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp index 8d128a8bd30..4e4e5d7bded 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP + +#include "memory/cardTableModRefBS.hpp" +#include "memory/memRegion.hpp" +#include "oops/oop.inline.hpp" + #ifndef SERIALGC class DirtyCardQueueSet; @@ -115,3 +122,5 @@ class G1SATBCardTableLoggingModRefBS: public G1SATBCardTableModRefBS { #endif // SERIALGC + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.cpp index fa6a98582dd..af7405df214 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,8 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_g1_globals.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/g1_globals.hpp" G1_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, \ MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, \ diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp index 0abac8a1855..e9d908e4be2 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp @@ -22,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1_GLOBALS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1_GLOBALS_HPP + +#include "runtime/globals.hpp" + // // Defines all globals flags used by the garbage-first compiler. // @@ -40,9 +45,6 @@ develop(intx, G1PolicyVerbose, 0, \ "The verbosity level on G1 policy decisions") \ \ - develop(bool, G1UseHRIntoRS, true, \ - "Determines whether the 'advanced' HR Into rem set is used.") \ - \ develop(intx, G1MarkingVerboseLevel, 0, \ "Level (0-4) of verboseness of the marking code") \ \ @@ -285,3 +287,5 @@ " controls whether G1 allows the RICM optimization") G1_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG, DECLARE_MANAGEABLE_FLAG, DECLARE_PRODUCT_RW_FLAG) + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1_GLOBALS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp index 8c3dab9febb..60780036700 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP + // The following OopClosure types get specialized versions of // "oop_oop_iterate" that invoke the closures' do_oop methods // non-virtually, using a mechanism defined in this file. Extend these @@ -63,3 +66,5 @@ class FilterAndMarkInHeapRegionAndIntoCSClosure; #endif #define FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f) + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp index 58b55123aae..ab022668384 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp @@ -22,8 +22,17 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_heapRegion.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/concurrentZFThread.hpp" +#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1OopClosures.inline.hpp" +#include "gc_implementation/g1/heapRegion.inline.hpp" +#include "gc_implementation/g1/heapRegionRemSet.hpp" +#include "gc_implementation/g1/heapRegionSeq.inline.hpp" +#include "memory/genOopClosures.inline.hpp" +#include "memory/iterator.hpp" +#include "oops/oop.inline.hpp" int HeapRegion::LogOfHRGrainBytes = 0; int HeapRegion::LogOfHRGrainWords = 0; @@ -377,10 +386,26 @@ void HeapRegion::calc_gc_efficiency() { } // -void HeapRegion::set_startsHumongous() { +void HeapRegion::set_startsHumongous(HeapWord* new_end) { + assert(end() == _orig_end, + "Should be normal before the humongous object allocation"); + assert(top() == bottom(), "should be empty"); + _humongous_type = StartsHumongous; _humongous_start_region = this; - assert(end() == _orig_end, "Should be normal before alloc."); + + set_end(new_end); + _offsets.set_for_starts_humongous(new_end); +} + +void HeapRegion::set_continuesHumongous(HeapRegion* start) { + assert(end() == _orig_end, + "Should be normal before the humongous object allocation"); + assert(top() == bottom(), "should be empty"); + assert(start->startsHumongous(), "pre-condition"); + + _humongous_type = ContinuesHumongous; + _humongous_start_region = start; } bool HeapRegion::claimHeapRegion(jint claimValue) { @@ -500,23 +525,6 @@ CompactibleSpace* HeapRegion::next_compaction_space() const { return blk.result(); } -void HeapRegion::set_continuesHumongous(HeapRegion* start) { - // The order is important here. - start->add_continuingHumongousRegion(this); - _humongous_type = ContinuesHumongous; - _humongous_start_region = start; -} - -void HeapRegion::add_continuingHumongousRegion(HeapRegion* cont) { - // Must join the blocks of the current H region seq with the block of the - // added region. - offsets()->join_blocks(bottom(), cont->bottom()); - arrayOop obj = (arrayOop)(bottom()); - obj->set_length((int) (obj->length() + cont->capacity()/jintSize)); - set_end(cont->end()); - set_top(cont->end()); -} - void HeapRegion::save_marks() { set_saved_mark(); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp index 42e96bbfb50..f11c6a3a3ec 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp @@ -22,6 +22,17 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP + +#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp" +#include "gc_implementation/g1/g1_specialized_oop_closures.hpp" +#include "gc_implementation/g1/survRateGroup.hpp" +#include "gc_implementation/shared/ageTable.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "memory/space.inline.hpp" +#include "memory/watermark.hpp" + #ifndef SERIALGC // A HeapRegion is the smallest piece of a G1CollectedHeap that @@ -395,14 +406,12 @@ class HeapRegion: public G1OffsetTableContigSpace { // Causes the current region to represent a humongous object spanning "n" // regions. - virtual void set_startsHumongous(); + void set_startsHumongous(HeapWord* new_end); // The regions that continue a humongous sequence should be added using // this method, in increasing address order. void set_continuesHumongous(HeapRegion* start); - void add_continuingHumongousRegion(HeapRegion* cont); - // If the region has a remembered set, return a pointer to it. HeapRegionRemSet* rem_set() const { return _rem_set; @@ -733,13 +742,6 @@ class HeapRegion: public G1OffsetTableContigSpace { FilterOutOfRegionClosure* cl, bool filter_young); - // The region "mr" is entirely in "this", and starts and ends at block - // boundaries. The caller declares that all the contained blocks are - // coalesced into one. - void declare_filled_region_to_BOT(MemRegion mr) { - _offsets.single_block(mr.start(), mr.end()); - } - // A version of block start that is guaranteed to find *some* block // boundary at or before "p", but does not object iteration, and may // therefore be used safely when the heap is unparseable. @@ -954,3 +956,5 @@ public: // End: *** #endif // SERIALGC + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp index f8ca7c81e6c..3750bdae37c 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_INLINE_HPP + inline HeapWord* G1OffsetTableContigSpace::allocate(size_t size) { HeapWord* res = ContiguousSpace::allocate(size); if (res != NULL) { @@ -58,3 +61,5 @@ inline HeapWord* G1OffsetTableContigSpace::block_start_const(const void* p) const { return _offsets.block_start_const(p); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp index c4c87327484..dde8255cd99 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_heapRegionRemSet.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/concurrentG1Refine.hpp" +#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/heapRegionRemSet.hpp" +#include "gc_implementation/g1/heapRegionSeq.inline.hpp" +#include "memory/allocation.hpp" +#include "memory/space.inline.hpp" +#include "utilities/bitMap.inline.hpp" +#include "utilities/globalDefinitions.hpp" #define HRRS_VERBOSE 0 @@ -1159,9 +1167,7 @@ HeapRegionRemSetIterator() : _hrrs(NULL), _g1h(G1CollectedHeap::heap()), _bosa(NULL), - _sparse_iter(size_t(G1CollectedHeap::heap()->reserved_region().start()) - >> CardTableModRefBS::card_shift) -{} + _sparse_iter() { } void HeapRegionRemSetIterator::initialize(const HeapRegionRemSet* hrrs) { _hrrs = hrrs; diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp index 741dea5f217..62378db5788 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONREMSET_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONREMSET_HPP + +#include "gc_implementation/g1/sparsePRT.hpp" + // Remembered set for a heap region. Represent a set of "cards" that // contain pointers into the owner heap region. Cards are defined somewhat // abstractly, in terms of what the "BlockOffsetTable" in use can parse. @@ -426,3 +431,5 @@ public: }; #endif + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONREMSET_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp index b71cf1918c9..336ba21c4f2 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_heapRegionSeq.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/heapRegionSeq.hpp" +#include "memory/allocation.hpp" // Local to this file. @@ -91,34 +93,118 @@ HeapRegionSeq::alloc_obj_from_region_index(int ind, size_t word_size) { } if (sumSizes >= word_size) { _alloc_search_start = cur; - // Mark the allocated regions as allocated. + + // We need to initialize the region(s) we just discovered. This is + // a bit tricky given that it can happen concurrently with + // refinement threads refining cards on these regions and + // potentially wanting to refine the BOT as they are scanning + // those cards (this can happen shortly after a cleanup; see CR + // 6991377). So we have to set up the region(s) carefully and in + // a specific order. + + // Currently, allocs_are_zero_filled() returns false. The zero + // filling infrastructure will be going away soon (see CR 6977804). + // So no need to do anything else here. bool zf = G1CollectedHeap::heap()->allocs_are_zero_filled(); + assert(!zf, "not supported"); + + // This will be the "starts humongous" region. HeapRegion* first_hr = _regions.at(first); - for (int i = first; i < cur; i++) { - HeapRegion* hr = _regions.at(i); - if (zf) - hr->ensure_zero_filled(); + { + MutexLockerEx x(ZF_mon, Mutex::_no_safepoint_check_flag); + first_hr->set_zero_fill_allocated(); + } + // The header of the new object will be placed at the bottom of + // the first region. + HeapWord* new_obj = first_hr->bottom(); + // This will be the new end of the first region in the series that + // should also match the end of the last region in the seriers. + // (Note: sumSizes = "region size" x "number of regions we found"). + HeapWord* new_end = new_obj + sumSizes; + // This will be the new top of the first region that will reflect + // this allocation. + HeapWord* new_top = new_obj + word_size; + + // First, we need to zero the header of the space that we will be + // allocating. When we update top further down, some refinement + // threads might try to scan the region. By zeroing the header we + // ensure that any thread that will try to scan the region will + // come across the zero klass word and bail out. + // + // NOTE: It would not have been correct to have used + // CollectedHeap::fill_with_object() and make the space look like + // an int array. The thread that is doing the allocation will + // later update the object header to a potentially different array + // type and, for a very short period of time, the klass and length + // fields will be inconsistent. This could cause a refinement + // thread to calculate the object size incorrectly. + Copy::fill_to_words(new_obj, oopDesc::header_size(), 0); + + // We will set up the first region as "starts humongous". This + // will also update the BOT covering all the regions to reflect + // that there is a single object that starts at the bottom of the + // first region. + first_hr->set_startsHumongous(new_end); + + // Then, if there are any, we will set up the "continues + // humongous" regions. + HeapRegion* hr = NULL; + for (int i = first + 1; i < cur; ++i) { + hr = _regions.at(i); { MutexLockerEx x(ZF_mon, Mutex::_no_safepoint_check_flag); hr->set_zero_fill_allocated(); } - size_t sz = hr->capacity() / HeapWordSize; - HeapWord* tmp = hr->allocate(sz); - assert(tmp != NULL, "Humongous allocation failure"); - MemRegion mr = MemRegion(tmp, sz); - CollectedHeap::fill_with_object(mr); - hr->declare_filled_region_to_BOT(mr); - if (i == first) { - first_hr->set_startsHumongous(); + hr->set_continuesHumongous(first_hr); + } + // If we have "continues humongous" regions (hr != NULL), then the + // end of the last one should match new_end. + assert(hr == NULL || hr->end() == new_end, "sanity"); + + // Up to this point no concurrent thread would have been able to + // do any scanning on any region in this series. All the top + // fields still point to bottom, so the intersection between + // [bottom,top] and [card_start,card_end] will be empty. Before we + // update the top fields, we'll do a storestore to make sure that + // no thread sees the update to top before the zeroing of the + // object header and the BOT initialization. + OrderAccess::storestore(); + + // Now that the BOT and the object header have been initialized, + // we can update top of the "starts humongous" region. + assert(first_hr->bottom() < new_top && new_top <= first_hr->end(), + "new_top should be in this region"); + first_hr->set_top(new_top); + + // Now, we will update the top fields of the "continues humongous" + // regions. The reason we need to do this is that, otherwise, + // these regions would look empty and this will confuse parts of + // G1. For example, the code that looks for a consecutive number + // of empty regions will consider them empty and try to + // re-allocate them. We can extend is_empty() to also include + // !continuesHumongous(), but it is easier to just update the top + // fields here. + hr = NULL; + for (int i = first + 1; i < cur; ++i) { + hr = _regions.at(i); + if ((i + 1) == cur) { + // last continues humongous region + assert(hr->bottom() < new_top && new_top <= hr->end(), + "new_top should fall on this region"); + hr->set_top(new_top); } else { - assert(i > first, "sanity"); - hr->set_continuesHumongous(first_hr); + // not last one + assert(new_top > hr->end(), "new_top should be above this region"); + hr->set_top(hr->end()); } } - HeapWord* first_hr_bot = first_hr->bottom(); - HeapWord* obj_end = first_hr_bot + word_size; - first_hr->set_top(obj_end); - return first_hr_bot; + // If we have continues humongous regions (hr != NULL), then the + // end of the last one should match new_end and its top should + // match new_top. + assert(hr == NULL || + (hr->end() == new_end && hr->top() == new_top), "sanity"); + + return new_obj; } else { // If we started from the beginning, we want to know why we can't alloc. return NULL; diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp index 6d2e5669b12..1a75a25301e 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP + +#include "gc_implementation/g1/heapRegion.hpp" +#include "utilities/growableArray.hpp" + class HeapRegion; class HeapRegionClosure; @@ -108,3 +114,5 @@ class HeapRegionSeq: public CHeapObj { void print_empty_runs(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp index 71c7c724cec..55adbdeded8 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_INLINE_HPP + +#include "gc_implementation/g1/heapRegionSeq.hpp" + inline HeapRegion* HeapRegionSeq::addr_to_region(const void* addr) { assert(_seq_bottom != NULL, "bad _seq_bottom in addr_to_region"); if ((char*) addr >= _seq_bottom) { @@ -38,3 +43,5 @@ inline HeapRegion* HeapRegionSeq::addr_to_region(const void* addr) { } return NULL; } + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp index bc531241a2c..dac9fc36415 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,21 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_ptrQueue.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/ptrQueue.hpp" +#include "memory/allocation.hpp" +#include "memory/allocation.inline.hpp" +#include "runtime/mutex.hpp" +#include "runtime/mutexLocker.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif PtrQueue::PtrQueue(PtrQueueSet* qset_, bool perm, bool active) : _qset(qset_), _buf(NULL), _index(0), _active(active), diff --git a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp index bbd4788e89f..d5a128240d8 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_PTRQUEUE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_PTRQUEUE_HPP + +#include "memory/allocation.hpp" +#include "utilities/sizes.hpp" + // There are various techniques that require threads to be able to log // addresses. For example, a generational write barrier might log // the addresses of modified old-generation objects. This type supports @@ -89,6 +95,10 @@ public: return _buf == NULL ? 0 : _sz - _index; } + bool is_empty() { + return _buf == NULL || _sz == _index; + } + // Set the "active" property of the queue to "b". An enqueue to an // inactive thread is a no-op. Setting a queue to inactive resets its // log to the empty state. @@ -289,3 +299,5 @@ public: // Notify the consumer if the number of buffers crossed the threshold void notify_if_necessary(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_PTRQUEUE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp index d3181a61f02..b6b15e13469 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_satbQueue.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/satbQueue.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/sharedHeap.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/thread.hpp" void ObjPtrQueue::apply_closure(ObjectClosure* cl) { if (_buf != NULL) { diff --git a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp index 49f824463e9..a183642368c 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_SATBQUEUE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_SATBQUEUE_HPP + +#include "gc_implementation/g1/ptrQueue.hpp" + class ObjectClosure; class JavaThread; @@ -29,7 +34,12 @@ class JavaThread; class ObjPtrQueue: public PtrQueue { public: ObjPtrQueue(PtrQueueSet* qset_, bool perm = false) : - PtrQueue(qset_, perm, qset_->is_active()) { } + // SATB queues are only active during marking cycles. We create + // them with their active field set to false. If a thread is + // created during a cycle and its SATB queue needs to be activated + // before the thread starts running, we'll need to set its active + // field to true. This is done in JavaThread::initialize_queues(). + PtrQueue(qset_, perm, false /* active */) { } // Apply the closure to all elements, and reset the index to make the // buffer empty. void apply_closure(ObjectClosure* cl); @@ -108,3 +118,5 @@ public: void abandon_partial_marking(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_SATBQUEUE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp index 5bc3ab29c70..042ca86c6d9 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,14 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_sparsePRT.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/heapRegion.hpp" +#include "gc_implementation/g1/heapRegionRemSet.hpp" +#include "gc_implementation/g1/sparsePRT.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "memory/space.inline.hpp" +#include "runtime/mutexLocker.hpp" #define SPARSE_PRT_VERBOSE 0 @@ -308,7 +314,7 @@ void RSHashTable::add_entry(SparsePRTEntry* e) { assert(e2->num_valid_cards() > 0, "Postcondition."); } -CardIdx_t /* RSHashTable:: */ RSHashTableIter::find_first_card_in_list() { +CardIdx_t RSHashTableIter::find_first_card_in_list() { CardIdx_t res; while (_bl_ind != RSHashTable::NullEntry) { res = _rsht->entry(_bl_ind)->card(0); @@ -322,14 +328,11 @@ CardIdx_t /* RSHashTable:: */ RSHashTableIter::find_first_card_in_list() { return SparsePRTEntry::NullEntry; } -size_t /* RSHashTable:: */ RSHashTableIter::compute_card_ind(CardIdx_t ci) { - return - _heap_bot_card_ind - + (_rsht->entry(_bl_ind)->r_ind() * HeapRegion::CardsPerRegion) - + ci; +size_t RSHashTableIter::compute_card_ind(CardIdx_t ci) { + return (_rsht->entry(_bl_ind)->r_ind() * HeapRegion::CardsPerRegion) + ci; } -bool /* RSHashTable:: */ RSHashTableIter::has_next(size_t& card_index) { +bool RSHashTableIter::has_next(size_t& card_index) { _card_ind++; CardIdx_t ci; if (_card_ind < SparsePRTEntry::cards_num() && diff --git a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp index 7812ac4fb53..86e1789dbe4 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_SPARSEPRT_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_SPARSEPRT_HPP + +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/heapRegion.hpp" +#include "memory/allocation.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "runtime/mutex.hpp" +#include "utilities/globalDefinitions.hpp" + // Sparse remembered set for a heap region (the "owning" region). Maps // indices of other regions to short sequences of cards in the other region // that might contain pointers into the owner region. @@ -169,7 +179,6 @@ class RSHashTableIter VALUE_OBJ_CLASS_SPEC { int _bl_ind; // [-1, 0.._rsht->_capacity) short _card_ind; // [0..SparsePRTEntry::cards_num()) RSHashTable* _rsht; - size_t _heap_bot_card_ind; // If the bucket list pointed to by _bl_ind contains a card, sets // _bl_ind to the index of that entry, and returns the card. @@ -183,13 +192,11 @@ class RSHashTableIter VALUE_OBJ_CLASS_SPEC { size_t compute_card_ind(CardIdx_t ci); public: - RSHashTableIter(size_t heap_bot_card_ind) : + RSHashTableIter() : _tbl_ind(RSHashTable::NullEntry), _bl_ind(RSHashTable::NullEntry), _card_ind((SparsePRTEntry::cards_num() - 1)), - _rsht(NULL), - _heap_bot_card_ind(heap_bot_card_ind) - {} + _rsht(NULL) {} void init(RSHashTable* rsht) { _rsht = rsht; @@ -280,20 +287,11 @@ public: bool contains_card(RegionIdx_t region_id, CardIdx_t card_index) const { return _next->contains_card(region_id, card_index); } - -#if 0 - void verify_is_cleared(); - void print(); -#endif }; -class SparsePRTIter: public /* RSHashTable:: */RSHashTableIter { +class SparsePRTIter: public RSHashTableIter { public: - SparsePRTIter(size_t heap_bot_card_ind) : - /* RSHashTable:: */RSHashTableIter(heap_bot_card_ind) - {} - void init(const SparsePRT* sprt) { RSHashTableIter::init(sprt->cur()); } @@ -301,3 +299,5 @@ public: return RSHashTableIter::has_next(card_index); } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_SPARSEPRT_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.cpp b/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.cpp index b471b7bfc04..a3bbb692d94 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.cpp @@ -22,8 +22,12 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_survRateGroup.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1CollectorPolicy.hpp" +#include "gc_implementation/g1/heapRegion.hpp" +#include "gc_implementation/g1/survRateGroup.hpp" +#include "memory/allocation.hpp" SurvRateGroup::SurvRateGroup(G1CollectorPolicy* g1p, const char* name, diff --git a/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.hpp b/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.hpp index cc4c9eb0b4f..c9617f2ed2e 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.hpp @@ -22,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_SURVRATEGROUP_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_SURVRATEGROUP_HPP + +#include "utilities/numberSeq.hpp" + class G1CollectorPolicy; class SurvRateGroup : public CHeapObj { @@ -92,3 +97,5 @@ public: void print_surv_rate_summary(); #endif // PRODUCT }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_SURVRATEGROUP_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp index 575e6781786..1ceeead58ff 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 +22,27 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_vm_operations_g1.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1CollectorPolicy.hpp" +#include "gc_implementation/g1/vm_operations_g1.hpp" +#include "gc_implementation/shared/isGCActiveMark.hpp" +#include "gc_implementation/g1/vm_operations_g1.hpp" +#include "runtime/interfaceSupport.hpp" + +VM_G1CollectForAllocation::VM_G1CollectForAllocation( + unsigned int gc_count_before, + size_t word_size) + : VM_G1OperationWithAllocRequest(gc_count_before, word_size) { + guarantee(word_size > 0, "an allocation should always be requested"); +} void VM_G1CollectForAllocation::doit() { JvmtiGCForAllocationMarker jgcm; G1CollectedHeap* g1h = G1CollectedHeap::heap(); - _res = g1h->satisfy_failed_allocation(_size); - assert(g1h->is_in_or_null(_res), "result not in heap"); + _result = g1h->satisfy_failed_allocation(_word_size, &_pause_succeeded); + assert(_result == NULL || _pause_succeeded, + "if we get back a result, the pause should have succeeded"); } void VM_G1CollectFull::doit() { @@ -39,6 +52,25 @@ void VM_G1CollectFull::doit() { g1h->do_full_collection(false /* clear_all_soft_refs */); } +VM_G1IncCollectionPause::VM_G1IncCollectionPause( + unsigned int gc_count_before, + size_t word_size, + bool should_initiate_conc_mark, + double target_pause_time_ms, + GCCause::Cause gc_cause) + : VM_G1OperationWithAllocRequest(gc_count_before, word_size), + _should_initiate_conc_mark(should_initiate_conc_mark), + _target_pause_time_ms(target_pause_time_ms), + _full_collections_completed_before(0) { + guarantee(target_pause_time_ms > 0.0, + err_msg("target_pause_time_ms = %1.6lf should be positive", + target_pause_time_ms)); + guarantee(word_size == 0 || gc_cause == GCCause::_g1_inc_collection_pause, + "we can only request an allocation if the GC cause is for " + "an incremental GC pause"); + _gc_cause = gc_cause; +} + void VM_G1IncCollectionPause::doit() { JvmtiGCForAllocationMarker jgcm; G1CollectedHeap* g1h = G1CollectedHeap::heap(); @@ -47,6 +79,18 @@ void VM_G1IncCollectionPause::doit() { (_gc_cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent)), "only a GC locker or a System.gc() induced GC should start a cycle"); + if (_word_size > 0) { + // An allocation has been requested. So, try to do that first. + _result = g1h->attempt_allocation_at_safepoint(_word_size, + false /* expect_null_cur_alloc_region */); + if (_result != NULL) { + // If we can successfully allocate before we actually do the + // pause then we will consider this pause successful. + _pause_succeeded = true; + return; + } + } + GCCauseSetter x(g1h, _gc_cause); if (_should_initiate_conc_mark) { // It's safer to read full_collections_completed() here, given @@ -59,7 +103,16 @@ void VM_G1IncCollectionPause::doit() { // will do so if one is not already in progress. bool res = g1h->g1_policy()->force_initial_mark_if_outside_cycle(); } - g1h->do_collection_pause_at_safepoint(_target_pause_time_ms); + + _pause_succeeded = + g1h->do_collection_pause_at_safepoint(_target_pause_time_ms); + if (_pause_succeeded && _word_size > 0) { + // An allocation had been requested. + _result = g1h->attempt_allocation_at_safepoint(_word_size, + true /* expect_null_cur_alloc_region */); + } else { + assert(_result == NULL, "invariant"); + } } void VM_G1IncCollectionPause::doit_epilogue() { diff --git a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp index d05beac9ea1..1fc31d51dc4 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,23 +22,42 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_VM_OPERATIONS_G1_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_VM_OPERATIONS_G1_HPP + +#include "gc_implementation/shared/vmGCOperations.hpp" + // VM_operations for the G1 collector. // VM_GC_Operation: // - VM_CGC_Operation // - VM_G1CollectFull -// - VM_G1CollectForAllocation -// - VM_G1IncCollectionPause -// - VM_G1PopRegionCollectionPause +// - VM_G1OperationWithAllocRequest +// - VM_G1CollectForAllocation +// - VM_G1IncCollectionPause + +class VM_G1OperationWithAllocRequest: public VM_GC_Operation { +protected: + size_t _word_size; + HeapWord* _result; + bool _pause_succeeded; + +public: + VM_G1OperationWithAllocRequest(unsigned int gc_count_before, + size_t word_size) + : VM_GC_Operation(gc_count_before), + _word_size(word_size), _result(NULL), _pause_succeeded(false) { } + HeapWord* result() { return _result; } + bool pause_succeeded() { return _pause_succeeded; } +}; class VM_G1CollectFull: public VM_GC_Operation { - public: +public: VM_G1CollectFull(unsigned int gc_count_before, unsigned int full_gc_count_before, GCCause::Cause cause) : VM_GC_Operation(gc_count_before, full_gc_count_before) { _gc_cause = cause; } - ~VM_G1CollectFull() {} virtual VMOp_Type type() const { return VMOp_G1CollectFull; } virtual void doit(); virtual const char* name() const { @@ -46,45 +65,28 @@ class VM_G1CollectFull: public VM_GC_Operation { } }; -class VM_G1CollectForAllocation: public VM_GC_Operation { - private: - HeapWord* _res; - size_t _size; // size of object to be allocated - public: - VM_G1CollectForAllocation(size_t size, int gc_count_before) - : VM_GC_Operation(gc_count_before) { - _size = size; - _res = NULL; - } - ~VM_G1CollectForAllocation() {} +class VM_G1CollectForAllocation: public VM_G1OperationWithAllocRequest { +public: + VM_G1CollectForAllocation(unsigned int gc_count_before, + size_t word_size); virtual VMOp_Type type() const { return VMOp_G1CollectForAllocation; } virtual void doit(); virtual const char* name() const { return "garbage-first collection to satisfy allocation"; } - HeapWord* result() { return _res; } }; -class VM_G1IncCollectionPause: public VM_GC_Operation { +class VM_G1IncCollectionPause: public VM_G1OperationWithAllocRequest { private: - bool _should_initiate_conc_mark; - double _target_pause_time_ms; + bool _should_initiate_conc_mark; + double _target_pause_time_ms; unsigned int _full_collections_completed_before; public: VM_G1IncCollectionPause(unsigned int gc_count_before, + size_t word_size, bool should_initiate_conc_mark, double target_pause_time_ms, - GCCause::Cause cause) - : VM_GC_Operation(gc_count_before), - _full_collections_completed_before(0), - _should_initiate_conc_mark(should_initiate_conc_mark), - _target_pause_time_ms(target_pause_time_ms) { - guarantee(target_pause_time_ms > 0.0, - err_msg("target_pause_time_ms = %1.6lf should be positive", - target_pause_time_ms)); - - _gc_cause = cause; - } + GCCause::Cause gc_cause); virtual VMOp_Type type() const { return VMOp_G1IncCollectionPause; } virtual void doit(); virtual void doit_epilogue(); @@ -98,14 +100,9 @@ public: class VM_CGC_Operation: public VM_Operation { VoidClosure* _cl; const char* _printGCMessage; - public: - VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg) : - _cl(cl), - _printGCMessage(printGCMsg) - {} - - ~VM_CGC_Operation() {} - +public: + VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg) + : _cl(cl), _printGCMessage(printGCMsg) { } virtual VMOp_Type type() const { return VMOp_CGC_Operation; } virtual void doit(); virtual bool doit_prologue(); @@ -114,3 +111,5 @@ class VM_CGC_Operation: public VM_Operation { return "concurrent gc"; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_VM_OPERATIONS_G1_HPP diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep b/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep deleted file mode 100644 index 6efae46edd1..00000000000 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep +++ /dev/null @@ -1,257 +0,0 @@ -// -// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps! - -binaryTreeDictionary.cpp allocationStats.hpp -binaryTreeDictionary.cpp binaryTreeDictionary.hpp -binaryTreeDictionary.cpp globals.hpp -binaryTreeDictionary.cpp ostream.hpp -binaryTreeDictionary.cpp space.inline.hpp -binaryTreeDictionary.cpp spaceDecorator.hpp - -binaryTreeDictionary.hpp freeBlockDictionary.hpp -binaryTreeDictionary.hpp freeList.hpp - -blockOffsetTable.inline.hpp concurrentMarkSweepGeneration.hpp - -cmsAdaptiveSizePolicy.cpp cmsAdaptiveSizePolicy.hpp -cmsAdaptiveSizePolicy.cpp defNewGeneration.hpp -cmsAdaptiveSizePolicy.cpp gcStats.hpp -cmsAdaptiveSizePolicy.cpp genCollectedHeap.hpp -cmsAdaptiveSizePolicy.cpp thread.hpp -cmsAdaptiveSizePolicy.cpp os_.inline.hpp - -cmsAdaptiveSizePolicy.hpp adaptiveSizePolicy.hpp -cmsAdaptiveSizePolicy.hpp timer.hpp - -cmsCollectorPolicy.cpp arguments.hpp -cmsCollectorPolicy.cpp cardTableRS.hpp -cmsCollectorPolicy.cpp cmsAdaptiveSizePolicy.hpp -cmsCollectorPolicy.cpp cmsGCAdaptivePolicyCounters.hpp -cmsCollectorPolicy.cpp cmsCollectorPolicy.hpp -cmsCollectorPolicy.cpp collectorPolicy.hpp -cmsCollectorPolicy.cpp gcLocker.inline.hpp -cmsCollectorPolicy.cpp genCollectedHeap.hpp -cmsCollectorPolicy.cpp gcPolicyCounters.hpp -cmsCollectorPolicy.cpp generationSpec.hpp -cmsCollectorPolicy.cpp globals_extension.hpp -cmsCollectorPolicy.cpp handles.inline.hpp -cmsCollectorPolicy.cpp java.hpp -cmsCollectorPolicy.cpp parNewGeneration.hpp -cmsCollectorPolicy.cpp space.hpp -cmsCollectorPolicy.cpp thread_.inline.hpp -cmsCollectorPolicy.cpp universe.hpp -cmsCollectorPolicy.cpp vmGCOperations.hpp -cmsCollectorPolicy.cpp vmThread.hpp - -cmsCollectorPolicy.hpp collectorPolicy.hpp - -cmsGCAdaptivePolicyCounters.cpp cmsGCAdaptivePolicyCounters.hpp -cmsGCAdaptivePolicyCounters.cpp resourceArea.hpp - -cmsGCAdaptivePolicyCounters.hpp cmsAdaptiveSizePolicy.hpp -cmsGCAdaptivePolicyCounters.hpp gcAdaptivePolicyCounters.hpp -cmsGCAdaptivePolicyCounters.hpp gcStats.hpp -cmsGCAdaptivePolicyCounters.hpp perfData.hpp - -cmsLockVerifier.cpp cmsLockVerifier.hpp -cmsLockVerifier.cpp concurrentMarkSweepThread.hpp -cmsLockVerifier.cpp vmThread.hpp - -cmsLockVerifier.hpp mutex.hpp - -cmsOopClosures.hpp genOopClosures.hpp - -cmsOopClosures.inline.hpp cmsOopClosures.hpp -cmsOopClosures.inline.hpp concurrentMarkSweepGeneration.hpp - -cmsPermGen.cpp blockOffsetTable.inline.hpp -cmsPermGen.cpp cSpaceCounters.hpp -cmsPermGen.cpp cmsPermGen.hpp -cmsPermGen.cpp collectedHeap.inline.hpp -cmsPermGen.cpp compactPermGen.hpp -cmsPermGen.cpp concurrentMarkSweepGeneration.inline.hpp -cmsPermGen.cpp genCollectedHeap.hpp -cmsPermGen.cpp generation.inline.hpp -cmsPermGen.cpp java.hpp -cmsPermGen.cpp oop.inline.hpp -cmsPermGen.cpp permGen.hpp -cmsPermGen.cpp universe.hpp - -cmsPermGen.hpp concurrentMarkSweepGeneration.hpp -cmsPermGen.hpp permGen.hpp - -compactibleFreeListSpace.cpp allocation.inline.hpp -compactibleFreeListSpace.cpp blockOffsetTable.inline.hpp -compactibleFreeListSpace.cpp cmsLockVerifier.hpp -compactibleFreeListSpace.cpp collectedHeap.hpp -compactibleFreeListSpace.cpp compactibleFreeListSpace.hpp -compactibleFreeListSpace.cpp concurrentMarkSweepGeneration.inline.hpp -compactibleFreeListSpace.cpp concurrentMarkSweepThread.hpp -compactibleFreeListSpace.cpp copy.hpp -compactibleFreeListSpace.cpp globals.hpp -compactibleFreeListSpace.cpp handles.inline.hpp -compactibleFreeListSpace.cpp init.hpp -compactibleFreeListSpace.cpp java.hpp -compactibleFreeListSpace.cpp liveRange.hpp -compactibleFreeListSpace.cpp oop.inline.hpp -compactibleFreeListSpace.cpp resourceArea.hpp -compactibleFreeListSpace.cpp spaceDecorator.hpp -compactibleFreeListSpace.cpp universe.inline.hpp -compactibleFreeListSpace.cpp vmThread.hpp - -compactibleFreeListSpace.hpp binaryTreeDictionary.hpp -compactibleFreeListSpace.hpp blockOffsetTable.inline.hpp -compactibleFreeListSpace.hpp freeList.hpp -compactibleFreeListSpace.hpp promotionInfo.hpp -compactibleFreeListSpace.hpp space.hpp - -compactingPermGenGen.cpp concurrentMarkSweepGeneration.inline.hpp - -concurrentMarkSweepGeneration.cpp cardTableRS.hpp -concurrentMarkSweepGeneration.cpp cmsAdaptiveSizePolicy.hpp -concurrentMarkSweepGeneration.cpp cmsCollectorPolicy.hpp -concurrentMarkSweepGeneration.cpp cmsGCAdaptivePolicyCounters.hpp -concurrentMarkSweepGeneration.cpp cmsOopClosures.inline.hpp -concurrentMarkSweepGeneration.cpp codeCache.hpp -concurrentMarkSweepGeneration.cpp collectedHeap.inline.hpp -concurrentMarkSweepGeneration.cpp collectorCounters.hpp -concurrentMarkSweepGeneration.cpp collectorPolicy.hpp -concurrentMarkSweepGeneration.cpp compactibleFreeListSpace.hpp -concurrentMarkSweepGeneration.cpp concurrentMarkSweepGeneration.inline.hpp -concurrentMarkSweepGeneration.cpp concurrentMarkSweepThread.hpp -concurrentMarkSweepGeneration.cpp gcLocker.inline.hpp -concurrentMarkSweepGeneration.cpp genCollectedHeap.hpp -concurrentMarkSweepGeneration.cpp genMarkSweep.hpp -concurrentMarkSweepGeneration.cpp genOopClosures.inline.hpp -concurrentMarkSweepGeneration.cpp globals_extension.hpp -concurrentMarkSweepGeneration.cpp handles.inline.hpp -concurrentMarkSweepGeneration.cpp isGCActiveMark.hpp -concurrentMarkSweepGeneration.cpp iterator.hpp -concurrentMarkSweepGeneration.cpp java.hpp -concurrentMarkSweepGeneration.cpp jvmtiExport.hpp -concurrentMarkSweepGeneration.cpp memoryService.hpp -concurrentMarkSweepGeneration.cpp oop.inline.hpp -concurrentMarkSweepGeneration.cpp parNewGeneration.hpp -concurrentMarkSweepGeneration.cpp referencePolicy.hpp -concurrentMarkSweepGeneration.cpp resourceArea.hpp -concurrentMarkSweepGeneration.cpp runtimeService.hpp -concurrentMarkSweepGeneration.cpp symbolTable.hpp -concurrentMarkSweepGeneration.cpp systemDictionary.hpp -concurrentMarkSweepGeneration.cpp vmCMSOperations.hpp -concurrentMarkSweepGeneration.cpp vmThread.hpp - -concurrentMarkSweepGeneration.hpp bitMap.inline.hpp -concurrentMarkSweepGeneration.hpp freeBlockDictionary.hpp -concurrentMarkSweepGeneration.hpp gSpaceCounters.hpp -concurrentMarkSweepGeneration.hpp gcStats.hpp -concurrentMarkSweepGeneration.hpp generation.hpp -concurrentMarkSweepGeneration.hpp generationCounters.hpp -concurrentMarkSweepGeneration.hpp memoryService.hpp -concurrentMarkSweepGeneration.hpp mutexLocker.hpp -concurrentMarkSweepGeneration.hpp taskqueue.hpp -concurrentMarkSweepGeneration.hpp virtualspace.hpp -concurrentMarkSweepGeneration.hpp yieldingWorkgroup.hpp - -concurrentMarkSweepGeneration.inline.hpp cmsLockVerifier.hpp -concurrentMarkSweepGeneration.inline.hpp compactibleFreeListSpace.hpp -concurrentMarkSweepGeneration.inline.hpp concurrentMarkSweepGeneration.hpp -concurrentMarkSweepGeneration.inline.hpp concurrentMarkSweepThread.hpp -concurrentMarkSweepGeneration.inline.hpp defNewGeneration.hpp -concurrentMarkSweepGeneration.inline.hpp gcUtil.hpp - -concurrentMarkSweepThread.cpp concurrentMarkSweepGeneration.inline.hpp -concurrentMarkSweepThread.cpp concurrentMarkSweepThread.hpp -concurrentMarkSweepThread.cpp genCollectedHeap.hpp -concurrentMarkSweepThread.cpp init.hpp -concurrentMarkSweepThread.cpp instanceRefKlass.hpp -concurrentMarkSweepThread.cpp interfaceSupport.hpp -concurrentMarkSweepThread.cpp java.hpp -concurrentMarkSweepThread.cpp javaCalls.hpp -concurrentMarkSweepThread.cpp mutexLocker.hpp -concurrentMarkSweepThread.cpp oop.inline.hpp -concurrentMarkSweepThread.cpp os.hpp -concurrentMarkSweepThread.cpp systemDictionary.hpp -concurrentMarkSweepThread.cpp vmThread.hpp - -concurrentMarkSweepThread.hpp concurrentGCThread.hpp -concurrentMarkSweepThread.hpp concurrentMarkSweepGeneration.hpp -concurrentMarkSweepThread.hpp thread_.inline.hpp - -freeBlockDictionary.cpp freeBlockDictionary.hpp -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 -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 -freeList.cpp mutex.hpp -freeList.cpp sharedHeap.hpp -freeList.cpp vmThread.hpp - -freeList.hpp allocationStats.hpp - -promotionInfo.cpp compactibleFreeListSpace.hpp -promotionInfo.cpp markOop.inline.hpp -promotionInfo.cpp oop.inline.hpp -promotionInfo.cpp promotionInfo.hpp - -promotionInfo.hpp allocation.hpp -promotionInfo.hpp freeChunk.hpp - -vmCMSOperations.cpp concurrentMarkSweepGeneration.inline.hpp -vmCMSOperations.cpp concurrentMarkSweepThread.hpp -vmCMSOperations.cpp dtrace.hpp -vmCMSOperations.cpp gcLocker.inline.hpp -vmCMSOperations.cpp isGCActiveMark.hpp -vmCMSOperations.cpp interfaceSupport.hpp -vmCMSOperations.cpp vmCMSOperations.hpp - -vmCMSOperations.hpp concurrentMarkSweepGeneration.hpp -vmCMSOperations.hpp gcCause.hpp -vmCMSOperations.hpp vm_operations.hpp -vmCMSOperations.hpp vmGCOperations.hpp - -yieldingWorkgroup.cpp yieldingWorkgroup.hpp - -yieldingWorkgroup.hpp workgroup.hpp diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_g1 b/hotspot/src/share/vm/gc_implementation/includeDB_gc_g1 deleted file mode 100644 index d1476972275..00000000000 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_g1 +++ /dev/null @@ -1,373 +0,0 @@ -// -// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps! - -bufferingOopClosure.hpp genOopClosures.hpp -bufferingOopClosure.hpp generation.hpp -bufferingOopClosure.hpp os.hpp -bufferingOopClosure.hpp taskqueue.hpp - -cardTableRS.cpp concurrentMark.hpp -cardTableRS.cpp g1SATBCardTableModRefBS.hpp - -collectionSetChooser.cpp g1CollectedHeap.inline.hpp -collectionSetChooser.cpp g1CollectorPolicy.hpp -collectionSetChooser.cpp collectionSetChooser.hpp -collectionSetChooser.cpp space.inline.hpp - -collectionSetChooser.hpp heapRegion.hpp -collectionSetChooser.hpp growableArray.hpp - -concurrentG1Refine.cpp atomic.hpp -concurrentG1Refine.cpp concurrentG1Refine.hpp -concurrentG1Refine.cpp concurrentG1RefineThread.hpp -concurrentG1Refine.cpp copy.hpp -concurrentG1Refine.cpp g1CollectedHeap.inline.hpp -concurrentG1Refine.cpp g1CollectorPolicy.hpp -concurrentG1Refine.cpp g1RemSet.hpp -concurrentG1Refine.cpp space.inline.hpp -concurrentG1Refine.cpp heapRegionSeq.inline.hpp - -concurrentG1Refine.hpp globalDefinitions.hpp -concurrentG1Refine.hpp allocation.hpp -concurrentG1Refine.hpp cardTableModRefBS.hpp -concurrentG1Refine.hpp thread.hpp - -concurrentG1RefineThread.cpp concurrentG1Refine.hpp -concurrentG1RefineThread.cpp concurrentG1RefineThread.hpp -concurrentG1RefineThread.cpp g1CollectedHeap.inline.hpp -concurrentG1RefineThread.cpp g1CollectorPolicy.hpp -concurrentG1RefineThread.cpp handles.inline.hpp -concurrentG1RefineThread.cpp mutexLocker.hpp -concurrentG1RefineThread.cpp resourceArea.hpp - -concurrentG1RefineThread.hpp concurrentGCThread.hpp - -concurrentMark.cpp concurrentMark.hpp -concurrentMark.cpp concurrentMarkThread.inline.hpp -concurrentMark.cpp g1CollectedHeap.inline.hpp -concurrentMark.cpp g1CollectorPolicy.hpp -concurrentMark.cpp g1RemSet.hpp -concurrentMark.cpp genOopClosures.inline.hpp -concurrentMark.cpp heapRegionRemSet.hpp -concurrentMark.cpp heapRegionSeq.inline.hpp -concurrentMark.cpp handles.inline.hpp -concurrentMark.cpp java.hpp -concurrentMark.cpp oop.inline.hpp -concurrentMark.cpp referencePolicy.hpp -concurrentMark.cpp resourceArea.hpp -concurrentMark.cpp symbolTable.hpp - -concurrentMark.hpp heapRegion.hpp -concurrentMark.hpp taskqueue.hpp - -concurrentMarkThread.cpp concurrentMarkThread.inline.hpp -concurrentMarkThread.cpp g1CollectedHeap.inline.hpp -concurrentMarkThread.cpp g1CollectorPolicy.hpp -concurrentMarkThread.cpp g1MMUTracker.hpp -concurrentMarkThread.cpp resourceArea.hpp -concurrentMarkThread.cpp vm_operations_g1.hpp -concurrentMarkThread.cpp vmThread.hpp - -concurrentMarkThread.hpp concurrentGCThread.hpp - -concurrentMarkThread.inline.hpp concurrentMark.hpp -concurrentMarkThread.inline.hpp concurrentMarkThread.hpp - -concurrentZFThread.cpp concurrentZFThread.hpp -concurrentZFThread.cpp heapRegion.hpp -concurrentZFThread.cpp g1CollectedHeap.inline.hpp -concurrentZFThread.cpp copy.hpp -concurrentZFThread.cpp mutexLocker.hpp -concurrentZFThread.cpp space.inline.hpp - -concurrentZFThread.hpp concurrentGCThread.hpp - -dirtyCardQueue.cpp atomic.hpp -dirtyCardQueue.cpp dirtyCardQueue.hpp -dirtyCardQueue.cpp heapRegionRemSet.hpp -dirtyCardQueue.cpp mutexLocker.hpp -dirtyCardQueue.cpp safepoint.hpp -dirtyCardQueue.cpp thread.hpp -dirtyCardQueue.cpp thread_.inline.hpp -dirtyCardQueue.cpp workgroup.hpp - -dirtyCardQueue.hpp allocation.hpp -dirtyCardQueue.hpp ptrQueue.hpp - -g1BlockOffsetTable.cpp g1BlockOffsetTable.inline.hpp -g1BlockOffsetTable.cpp java.hpp -g1BlockOffsetTable.cpp oop.inline.hpp -g1BlockOffsetTable.cpp space.hpp - -g1BlockOffsetTable.hpp globalDefinitions.hpp -g1BlockOffsetTable.hpp memRegion.hpp -g1BlockOffsetTable.hpp virtualspace.hpp - -g1BlockOffsetTable.inline.hpp g1BlockOffsetTable.hpp -g1BlockOffsetTable.inline.hpp space.hpp - -g1CollectedHeap.cpp aprofiler.hpp -g1CollectedHeap.cpp bufferingOopClosure.hpp -g1CollectedHeap.cpp concurrentG1Refine.hpp -g1CollectedHeap.cpp concurrentG1RefineThread.hpp -g1CollectedHeap.cpp concurrentMarkThread.inline.hpp -g1CollectedHeap.cpp concurrentZFThread.hpp -g1CollectedHeap.cpp g1CollectedHeap.inline.hpp -g1CollectedHeap.cpp g1CollectorPolicy.hpp -g1CollectedHeap.cpp g1MarkSweep.hpp -g1CollectedHeap.cpp g1RemSet.inline.hpp -g1CollectedHeap.cpp g1OopClosures.inline.hpp -g1CollectedHeap.cpp genOopClosures.inline.hpp -g1CollectedHeap.cpp gcLocker.inline.hpp -g1CollectedHeap.cpp generationSpec.hpp -g1CollectedHeap.cpp heapRegionRemSet.hpp -g1CollectedHeap.cpp heapRegionSeq.inline.hpp -g1CollectedHeap.cpp icBuffer.hpp -g1CollectedHeap.cpp isGCActiveMark.hpp -g1CollectedHeap.cpp oop.inline.hpp -g1CollectedHeap.cpp oop.pcgc.inline.hpp -g1CollectedHeap.cpp vm_operations_g1.hpp -g1CollectedHeap.cpp vmThread.hpp - -g1CollectedHeap.hpp barrierSet.hpp -g1CollectedHeap.hpp g1RemSet.hpp -g1CollectedHeap.hpp heapRegion.hpp -g1CollectedHeap.hpp memRegion.hpp -g1CollectedHeap.hpp parGCAllocBuffer.hpp -g1CollectedHeap.hpp sharedHeap.hpp - -g1CollectedHeap.inline.hpp concurrentMark.hpp -g1CollectedHeap.inline.hpp g1CollectedHeap.hpp -g1CollectedHeap.inline.hpp heapRegionSeq.hpp -g1CollectedHeap.inline.hpp taskqueue.hpp - -g1CollectorPolicy.cpp arguments.hpp -g1CollectorPolicy.cpp concurrentG1Refine.hpp -g1CollectorPolicy.cpp concurrentMark.hpp -g1CollectorPolicy.cpp concurrentMarkThread.inline.hpp -g1CollectorPolicy.cpp debug.hpp -g1CollectorPolicy.cpp java.hpp -g1CollectorPolicy.cpp g1CollectedHeap.inline.hpp -g1CollectorPolicy.cpp g1CollectorPolicy.hpp -g1CollectorPolicy.cpp heapRegionRemSet.hpp -g1CollectorPolicy.cpp mutexLocker.hpp -g1CollectorPolicy.cpp gcPolicyCounters.hpp - -g1CollectorPolicy.hpp collectorPolicy.hpp -g1CollectorPolicy.hpp collectionSetChooser.hpp -g1CollectorPolicy.hpp g1MMUTracker.hpp - -g1_globals.cpp g1_globals.hpp - -g1_globals.hpp globals.hpp - -globals.cpp g1_globals.hpp -top.hpp g1_globals.hpp - -g1MarkSweep.cpp aprofiler.hpp -g1MarkSweep.cpp biasedLocking.hpp -g1MarkSweep.cpp codeCache.hpp -g1MarkSweep.cpp events.hpp -g1MarkSweep.cpp fprofiler.hpp -g1MarkSweep.hpp g1CollectedHeap.inline.hpp -g1MarkSweep.cpp g1MarkSweep.hpp -g1MarkSweep.cpp gcLocker.hpp -g1MarkSweep.cpp genCollectedHeap.hpp -g1MarkSweep.hpp heapRegion.hpp -g1MarkSweep.cpp icBuffer.hpp -g1MarkSweep.cpp instanceRefKlass.hpp -g1MarkSweep.cpp javaClasses.hpp -g1MarkSweep.cpp jvmtiExport.hpp -g1MarkSweep.cpp copy.hpp -g1MarkSweep.cpp modRefBarrierSet.hpp -g1MarkSweep.cpp oop.inline.hpp -g1MarkSweep.cpp referencePolicy.hpp -g1MarkSweep.cpp space.hpp -g1MarkSweep.cpp symbolTable.hpp -g1MarkSweep.cpp synchronizer.hpp -g1MarkSweep.cpp systemDictionary.hpp -g1MarkSweep.cpp thread.hpp -g1MarkSweep.cpp vmSymbols.hpp -g1MarkSweep.cpp vmThread.hpp - -g1MarkSweep.hpp generation.hpp -g1MarkSweep.hpp growableArray.hpp -g1MarkSweep.hpp markOop.hpp -g1MarkSweep.hpp genMarkSweep.hpp -g1MarkSweep.hpp oop.hpp -g1MarkSweep.hpp timer.hpp -g1MarkSweep.hpp universe.hpp - -g1MemoryPool.cpp heapRegion.hpp -g1MemoryPool.cpp g1CollectedHeap.inline.hpp -g1MemoryPool.cpp g1CollectedHeap.hpp -g1MemoryPool.cpp g1CollectorPolicy.hpp -g1MemoryPool.cpp g1MemoryPool.hpp - -g1MemoryPool.hpp memoryUsage.hpp -g1MemoryPool.hpp memoryPool.hpp - -g1OopClosures.inline.hpp concurrentMark.hpp -g1OopClosures.inline.hpp g1OopClosures.hpp -g1OopClosures.inline.hpp g1CollectedHeap.hpp -g1OopClosures.inline.hpp g1RemSet.hpp - -g1MMUTracker.cpp g1MMUTracker.hpp -g1MMUTracker.cpp ostream.hpp -g1MMUTracker.cpp mutexLocker.hpp - -g1MMUTracker.hpp debug.hpp -g1MMUTracker.hpp allocation.hpp - -g1RemSet.cpp bufferingOopClosure.hpp -g1RemSet.cpp concurrentG1Refine.hpp -g1RemSet.cpp concurrentG1RefineThread.hpp -g1RemSet.cpp g1BlockOffsetTable.inline.hpp -g1RemSet.cpp g1CollectedHeap.inline.hpp -g1RemSet.cpp g1CollectorPolicy.hpp -g1RemSet.cpp g1RemSet.inline.hpp -g1RemSet.cpp g1OopClosures.inline.hpp -g1RemSet.cpp heapRegionSeq.inline.hpp -g1RemSet.cpp intHisto.hpp -g1RemSet.cpp iterator.hpp -g1RemSet.cpp oop.inline.hpp - -g1RemSet.inline.hpp oop.inline.hpp -g1RemSet.inline.hpp g1RemSet.hpp -g1RemSet.inline.hpp heapRegionRemSet.hpp - -g1SATBCardTableModRefBS.cpp g1SATBCardTableModRefBS.hpp -g1SATBCardTableModRefBS.cpp heapRegion.hpp -g1SATBCardTableModRefBS.cpp mutexLocker.hpp -g1SATBCardTableModRefBS.cpp thread.hpp -g1SATBCardTableModRefBS.cpp thread_.inline.hpp -g1SATBCardTableModRefBS.cpp satbQueue.hpp - -g1SATBCardTableModRefBS.hpp oop.inline.hpp -g1SATBCardTableModRefBS.hpp cardTableModRefBS.hpp -g1SATBCardTableModRefBS.hpp memRegion.hpp - -heapRegion.cpp concurrentZFThread.hpp -heapRegion.cpp g1BlockOffsetTable.inline.hpp -heapRegion.cpp g1CollectedHeap.inline.hpp -heapRegion.cpp g1OopClosures.inline.hpp -heapRegion.cpp genOopClosures.inline.hpp -heapRegion.cpp heapRegion.inline.hpp -heapRegion.cpp heapRegionRemSet.hpp -heapRegion.cpp heapRegionSeq.inline.hpp -heapRegion.cpp iterator.hpp -heapRegion.cpp oop.inline.hpp - -heapRegion.hpp space.inline.hpp -heapRegion.hpp spaceDecorator.hpp -heapRegion.hpp g1BlockOffsetTable.inline.hpp -heapRegion.hpp watermark.hpp -heapRegion.hpp g1_specialized_oop_closures.hpp -heapRegion.hpp survRateGroup.hpp -heapRegion.hpp ageTable.hpp - -heapRegionRemSet.hpp sparsePRT.hpp - -heapRegionRemSet.cpp allocation.hpp -heapRegionRemSet.cpp bitMap.inline.hpp -heapRegionRemSet.cpp concurrentG1Refine.hpp -heapRegionRemSet.cpp g1BlockOffsetTable.inline.hpp -heapRegionRemSet.cpp g1CollectedHeap.inline.hpp -heapRegionRemSet.cpp heapRegionRemSet.hpp -heapRegionRemSet.cpp heapRegionSeq.inline.hpp -heapRegionRemSet.cpp globalDefinitions.hpp -heapRegionRemSet.cpp space.inline.hpp - -heapRegionSeq.cpp allocation.hpp -heapRegionSeq.cpp g1CollectedHeap.inline.hpp -heapRegionSeq.cpp heapRegionSeq.hpp - -heapRegionSeq.hpp growableArray.hpp -heapRegionSeq.hpp heapRegion.hpp - -heapRegionSeq.inline.hpp heapRegionSeq.hpp - -klass.hpp g1OopClosures.hpp - -memoryService.cpp g1MemoryPool.hpp - -ptrQueue.cpp allocation.hpp -ptrQueue.cpp allocation.inline.hpp -ptrQueue.cpp mutex.hpp -ptrQueue.cpp mutexLocker.hpp -ptrQueue.cpp ptrQueue.hpp -ptrQueue.cpp thread_.inline.hpp - -ptrQueue.hpp allocation.hpp -ptrQueue.hpp sizes.hpp - -ptrQueue.inline.hpp ptrQueue.hpp - -satbQueue.cpp allocation.inline.hpp -satbQueue.cpp mutexLocker.hpp -satbQueue.cpp satbQueue.hpp -satbQueue.cpp sharedHeap.hpp -satbQueue.cpp thread.hpp - -satbQueue.hpp ptrQueue.hpp - -sparsePRT.cpp allocation.inline.hpp -sparsePRT.cpp cardTableModRefBS.hpp -sparsePRT.cpp heapRegion.hpp -sparsePRT.cpp heapRegionRemSet.hpp -sparsePRT.cpp mutexLocker.hpp -sparsePRT.cpp sparsePRT.hpp -sparsePRT.cpp space.inline.hpp - -sparsePRT.hpp allocation.hpp -sparsePRT.hpp cardTableModRefBS.hpp -sparsePRT.hpp globalDefinitions.hpp -sparsePRT.hpp g1CollectedHeap.inline.hpp -sparsePRT.hpp heapRegion.hpp -sparsePRT.hpp mutex.hpp - -specialized_oop_closures.hpp g1_specialized_oop_closures.hpp - -survRateGroup.hpp numberSeq.hpp - -survRateGroup.cpp allocation.hpp -survRateGroup.cpp g1CollectedHeap.inline.hpp -survRateGroup.cpp g1CollectorPolicy.hpp -survRateGroup.cpp heapRegion.hpp -survRateGroup.cpp survRateGroup.hpp - -thread.cpp concurrentMarkThread.inline.hpp - -universe.cpp g1CollectedHeap.inline.hpp -universe.cpp g1CollectorPolicy.hpp - -vm_operations_g1.hpp vmGCOperations.hpp - -vm_operations_g1.cpp vm_operations_g1.hpp -vm_operations_g1.cpp g1CollectedHeap.inline.hpp -vm_operations_g1.cpp g1CollectorPolicy.hpp -vm_operations_g1.cpp interfaceSupport.hpp -vm_operations_g1.cpp isGCActiveMark.hpp diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew b/hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew deleted file mode 100644 index 32808d28de3..00000000000 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew +++ /dev/null @@ -1,92 +0,0 @@ -// -// Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -asParNewGeneration.hpp adaptiveSizePolicy.hpp -asParNewGeneration.hpp parNewGeneration.hpp - -asParNewGeneration.cpp asParNewGeneration.hpp -asParNewGeneration.cpp cmsAdaptiveSizePolicy.hpp -asParNewGeneration.cpp cmsGCAdaptivePolicyCounters.hpp -asParNewGeneration.cpp defNewGeneration.inline.hpp -asParNewGeneration.cpp markOop.inline.hpp -asParNewGeneration.cpp markSweep.inline.hpp -asParNewGeneration.cpp oop.pcgc.inline.hpp -asParNewGeneration.cpp parNewGeneration.hpp -asParNewGeneration.cpp referencePolicy.hpp -asParNewGeneration.cpp spaceDecorator.hpp - -parCardTableModRefBS.cpp allocation.inline.hpp -parCardTableModRefBS.cpp cardTableModRefBS.hpp -parCardTableModRefBS.cpp cardTableRS.hpp -parCardTableModRefBS.cpp java.hpp -parCardTableModRefBS.cpp mutexLocker.hpp -parCardTableModRefBS.cpp sharedHeap.hpp -parCardTableModRefBS.cpp space.inline.hpp -parCardTableModRefBS.cpp universe.hpp -parCardTableModRefBS.cpp virtualspace.hpp - -parGCAllocBuffer.cpp arrayOop.hpp -parGCAllocBuffer.cpp oop.inline.hpp -parGCAllocBuffer.cpp parGCAllocBuffer.hpp -parGCAllocBuffer.cpp sharedHeap.hpp - -parGCAllocBuffer.hpp allocation.hpp -parGCAllocBuffer.hpp globalDefinitions.hpp -parGCAllocBuffer.hpp threadLocalAllocBuffer.hpp - -parNewGeneration.cpp adaptiveSizePolicy.hpp -parNewGeneration.cpp ageTable.hpp -parNewGeneration.cpp concurrentMarkSweepGeneration.hpp -parNewGeneration.cpp copy.hpp -parNewGeneration.cpp defNewGeneration.inline.hpp -parNewGeneration.cpp genCollectedHeap.hpp -parNewGeneration.cpp genOopClosures.inline.hpp -parNewGeneration.cpp generation.hpp -parNewGeneration.cpp generation.inline.hpp -parNewGeneration.cpp globalDefinitions.hpp -parNewGeneration.cpp handles.hpp -parNewGeneration.cpp handles.inline.hpp -parNewGeneration.cpp java.hpp -parNewGeneration.cpp objArrayOop.hpp -parNewGeneration.cpp oop.inline.hpp -parNewGeneration.cpp oop.pcgc.inline.hpp -parNewGeneration.cpp parGCAllocBuffer.hpp -parNewGeneration.cpp parNewGeneration.hpp -parNewGeneration.cpp parOopClosures.inline.hpp -parNewGeneration.cpp referencePolicy.hpp -parNewGeneration.cpp resourceArea.hpp -parNewGeneration.cpp sharedHeap.hpp -parNewGeneration.cpp space.hpp -parNewGeneration.cpp spaceDecorator.hpp -parNewGeneration.cpp thread.hpp -parNewGeneration.cpp workgroup.hpp - -parNewGeneration.hpp defNewGeneration.hpp -parNewGeneration.hpp parGCAllocBuffer.hpp -parNewGeneration.hpp taskqueue.hpp - -parOopClosures.hpp genOopClosures.hpp - -parOopClosures.inline.hpp parNewGeneration.hpp -parOopClosures.inline.hpp parOopClosures.hpp diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge b/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge deleted file mode 100644 index 83eae5eebe7..00000000000 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge +++ /dev/null @@ -1,459 +0,0 @@ -// -// Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps! - - -adjoiningGenerations.hpp adjoiningVirtualSpaces.hpp -adjoiningGenerations.hpp asPSOldGen.hpp -adjoiningGenerations.hpp asPSYoungGen.hpp -adjoiningGenerations.hpp psPermGen.hpp - -adjoiningGenerations.cpp adjoiningGenerations.hpp -adjoiningGenerations.cpp adjoiningVirtualSpaces.hpp -adjoiningGenerations.cpp parallelScavengeHeap.hpp -adjoiningGenerations.cpp psPermGen.hpp - -adjoiningVirtualSpaces.hpp psVirtualspace.hpp - -adjoiningVirtualSpaces.cpp java.hpp -adjoiningVirtualSpaces.cpp adjoiningVirtualSpaces.hpp - -asPSOldGen.hpp generationCounters.hpp -asPSOldGen.hpp mutableSpace.hpp -asPSOldGen.hpp objectStartArray.hpp -asPSOldGen.hpp psVirtualspace.hpp -asPSOldGen.hpp spaceCounters.hpp -asPSOldGen.hpp psOldGen.hpp - -asPSOldGen.cpp psAdaptiveSizePolicy.hpp -asPSOldGen.cpp cardTableModRefBS.hpp -asPSOldGen.cpp java.hpp -asPSOldGen.cpp oop.inline.hpp -asPSOldGen.cpp parallelScavengeHeap.hpp -asPSOldGen.cpp psMarkSweepDecorator.hpp -asPSOldGen.cpp asPSOldGen.hpp - -asPSYoungGen.hpp generationCounters.hpp -asPSYoungGen.hpp mutableSpace.hpp -asPSYoungGen.hpp objectStartArray.hpp -asPSYoungGen.hpp spaceCounters.hpp -asPSYoungGen.hpp psVirtualspace.hpp -asPSYoungGen.hpp psYoungGen.hpp -asPSYoungGen.hpp spaceDecorator.hpp - -asPSYoungGen.cpp gcUtil.hpp -asPSYoungGen.cpp java.hpp -asPSYoungGen.cpp oop.inline.hpp -asPSYoungGen.cpp parallelScavengeHeap.hpp -asPSYoungGen.cpp psMarkSweepDecorator.hpp -asPSYoungGen.cpp psScavenge.hpp -asPSYoungGen.cpp asPSYoungGen.hpp -asPSYoungGen.cpp psYoungGen.hpp -asPSYoungGen.cpp spaceDecorator.hpp - -cardTableExtension.cpp cardTableExtension.hpp -cardTableExtension.cpp gcTaskManager.hpp -cardTableExtension.cpp oop.inline.hpp -cardTableExtension.cpp oop.psgc.inline.hpp -cardTableExtension.cpp parallelScavengeHeap.hpp -cardTableExtension.cpp psTasks.hpp -cardTableExtension.cpp psYoungGen.hpp - -cardTableExtension.hpp cardTableModRefBS.hpp - -gcTaskManager.hpp mutex.hpp -gcTaskManager.hpp growableArray.hpp - -gcTaskManager.cpp allocation.hpp -gcTaskManager.cpp allocation.inline.hpp -gcTaskManager.cpp gcTaskManager.hpp -gcTaskManager.cpp gcTaskThread.hpp -gcTaskManager.cpp mutex.hpp -gcTaskManager.cpp mutexLocker.hpp - -gcTaskThread.hpp thread.hpp - -gcTaskThread.cpp allocation.hpp -gcTaskThread.cpp allocation.inline.hpp -gcTaskThread.cpp gcTaskManager.hpp -gcTaskThread.cpp gcTaskThread.hpp -gcTaskThread.cpp handles.hpp -gcTaskThread.cpp handles.inline.hpp -gcTaskThread.cpp os.hpp -gcTaskThread.cpp resourceArea.hpp -gcTaskThread.cpp thread.hpp - -generationSizer.hpp collectorPolicy.hpp - -objectStartArray.cpp allocation.inline.hpp -objectStartArray.cpp cardTableModRefBS.hpp -objectStartArray.cpp java.hpp -objectStartArray.cpp objectStartArray.hpp -objectStartArray.cpp oop.inline.hpp - -objectStartArray.hpp allocation.hpp -objectStartArray.hpp memRegion.hpp -objectStartArray.hpp oop.hpp -objectStartArray.hpp psVirtualspace.hpp - -parallelScavengeHeap.cpp adjoiningGenerations.hpp -parallelScavengeHeap.cpp adjoiningVirtualSpaces.hpp -parallelScavengeHeap.cpp cardTableExtension.hpp -parallelScavengeHeap.cpp gcLocker.inline.hpp -parallelScavengeHeap.cpp gcTaskManager.hpp -parallelScavengeHeap.cpp generationSizer.hpp -parallelScavengeHeap.cpp handles.inline.hpp -parallelScavengeHeap.cpp java.hpp -parallelScavengeHeap.cpp oop.inline.hpp -parallelScavengeHeap.cpp parallelScavengeHeap.inline.hpp -parallelScavengeHeap.cpp psAdaptiveSizePolicy.hpp -parallelScavengeHeap.cpp psMarkSweep.hpp -parallelScavengeHeap.cpp psParallelCompact.hpp -parallelScavengeHeap.cpp psPromotionManager.hpp -parallelScavengeHeap.cpp psScavenge.hpp -parallelScavengeHeap.cpp vmThread.hpp -parallelScavengeHeap.cpp vmPSOperations.hpp - -parallelScavengeHeap.inline.hpp parallelScavengeHeap.hpp -parallelScavengeHeap.inline.hpp psMarkSweep.hpp -parallelScavengeHeap.inline.hpp psParallelCompact.hpp -parallelScavengeHeap.inline.hpp psScavenge.hpp - -parallelScavengeHeap.hpp collectedHeap.inline.hpp -parallelScavengeHeap.hpp objectStartArray.hpp -parallelScavengeHeap.hpp gcPolicyCounters.hpp -parallelScavengeHeap.hpp psGCAdaptivePolicyCounters.hpp -parallelScavengeHeap.hpp psOldGen.hpp -parallelScavengeHeap.hpp psPermGen.hpp -parallelScavengeHeap.hpp psYoungGen.hpp -parallelScavengeHeap.hpp ostream.hpp - -parMarkBitMap.cpp bitMap.inline.hpp -parMarkBitMap.cpp oop.inline.hpp -parMarkBitMap.cpp os.hpp -parMarkBitMap.cpp os_.inline.hpp -parMarkBitMap.cpp parMarkBitMap.hpp -parMarkBitMap.cpp parMarkBitMap.inline.hpp -parMarkBitMap.cpp psParallelCompact.hpp - -parMarkBitMap.hpp bitMap.inline.hpp -parMarkBitMap.hpp psVirtualspace.hpp - -psAdaptiveSizePolicy.cpp collectorPolicy.hpp -psAdaptiveSizePolicy.cpp gcPolicyCounters.hpp -psAdaptiveSizePolicy.cpp gcCause.hpp -psAdaptiveSizePolicy.cpp generationSizer.hpp -psAdaptiveSizePolicy.cpp psAdaptiveSizePolicy.hpp -psAdaptiveSizePolicy.cpp psGCAdaptivePolicyCounters.hpp -psAdaptiveSizePolicy.cpp psScavenge.hpp -psAdaptiveSizePolicy.cpp timer.hpp -psAdaptiveSizePolicy.cpp top.hpp - -psAdaptiveSizePolicy.hpp gcCause.hpp -psAdaptiveSizePolicy.hpp gcStats.hpp -psAdaptiveSizePolicy.hpp gcUtil.hpp -psAdaptiveSizePolicy.hpp adaptiveSizePolicy.hpp - -psCompactionManager.cpp gcTaskManager.hpp -psCompactionManager.cpp objArrayKlass.inline.hpp -psCompactionManager.cpp objectStartArray.hpp -psCompactionManager.cpp oop.hpp -psCompactionManager.cpp oop.inline.hpp -psCompactionManager.cpp oop.pcgc.inline.hpp -psCompactionManager.cpp parallelScavengeHeap.hpp -psCompactionManager.cpp parMarkBitMap.hpp -psCompactionManager.cpp psParallelCompact.hpp -psCompactionManager.cpp psCompactionManager.hpp -psCompactionManager.cpp psOldGen.hpp -psCompactionManager.cpp systemDictionary.hpp - -psCompactionManager.hpp allocation.hpp -psCompactionManager.hpp taskqueue.hpp - -psCompactionManager.inline.hpp psCompactionManager.hpp -psCompactionManager.inline.hpp psParallelCompact.hpp - -psGCAdaptivePolicyCounters.hpp gcAdaptivePolicyCounters.hpp -psGCAdaptivePolicyCounters.hpp gcPolicyCounters.hpp -psGCAdaptivePolicyCounters.hpp psAdaptiveSizePolicy.hpp - -psGCAdaptivePolicyCounters.cpp arguments.hpp -psGCAdaptivePolicyCounters.cpp resourceArea.hpp -psGCAdaptivePolicyCounters.cpp psGCAdaptivePolicyCounters.hpp - -psGenerationCounters.cpp psGenerationCounters.hpp -psGenerationCounters.cpp resourceArea.hpp - -psGenerationCounters.hpp generationCounters.hpp -psGenerationCounters.hpp perfData.hpp -psGenerationCounters.hpp psVirtualspace.hpp - -psMarkSweep.cpp psAdaptiveSizePolicy.hpp -psMarkSweep.cpp biasedLocking.hpp -psMarkSweep.cpp codeCache.hpp -psMarkSweep.cpp events.hpp -psMarkSweep.cpp fprofiler.hpp -psMarkSweep.cpp gcCause.hpp -psMarkSweep.cpp gcLocker.inline.hpp -psMarkSweep.cpp generationSizer.hpp -psMarkSweep.cpp isGCActiveMark.hpp -psMarkSweep.cpp oop.inline.hpp -psMarkSweep.cpp memoryService.hpp -psMarkSweep.cpp management.hpp -psMarkSweep.cpp parallelScavengeHeap.hpp -psMarkSweep.cpp psMarkSweep.hpp -psMarkSweep.cpp psMarkSweepDecorator.hpp -psMarkSweep.cpp psOldGen.hpp -psMarkSweep.cpp psPermGen.hpp -psMarkSweep.cpp psScavenge.hpp -psMarkSweep.cpp psYoungGen.hpp -psMarkSweep.cpp referencePolicy.hpp -psMarkSweep.cpp referenceProcessor.hpp -psMarkSweep.cpp safepoint.hpp -psMarkSweep.cpp spaceDecorator.hpp -psMarkSweep.cpp symbolTable.hpp -psMarkSweep.cpp systemDictionary.hpp -psMarkSweep.cpp vmThread.hpp - -psMarkSweep.hpp markSweep.inline.hpp -psMarkSweep.hpp collectorCounters.hpp - -psMarkSweepDecorator.cpp liveRange.hpp -psMarkSweepDecorator.cpp markSweep.inline.hpp -psMarkSweepDecorator.cpp objectStartArray.hpp -psMarkSweepDecorator.cpp oop.inline.hpp -psMarkSweepDecorator.cpp parallelScavengeHeap.hpp -psMarkSweepDecorator.cpp psMarkSweep.hpp -psMarkSweepDecorator.cpp psMarkSweepDecorator.hpp -psMarkSweepDecorator.cpp spaceDecorator.hpp -psMarkSweepDecorator.cpp systemDictionary.hpp - -psMarkSweepDecorator.hpp mutableSpace.hpp - -psParallelCompact.cpp psAdaptiveSizePolicy.hpp -psParallelCompact.cpp codeCache.hpp -psParallelCompact.cpp events.hpp -psParallelCompact.cpp fprofiler.hpp -psParallelCompact.cpp gcCause.hpp -psParallelCompact.cpp gcLocker.inline.hpp -psParallelCompact.cpp gcTaskManager.hpp -psParallelCompact.cpp generationSizer.hpp -psParallelCompact.cpp isGCActiveMark.hpp -psParallelCompact.cpp management.hpp -psParallelCompact.cpp memoryService.hpp -psParallelCompact.cpp methodDataOop.hpp -psParallelCompact.cpp oop.inline.hpp -psParallelCompact.cpp oop.pcgc.inline.hpp -psParallelCompact.cpp parallelScavengeHeap.inline.hpp -psParallelCompact.cpp pcTasks.hpp -psParallelCompact.cpp psMarkSweep.hpp -psParallelCompact.cpp psMarkSweepDecorator.hpp -psParallelCompact.cpp psCompactionManager.inline.hpp -psParallelCompact.cpp psPromotionManager.inline.hpp -psParallelCompact.cpp psOldGen.hpp -psParallelCompact.cpp psParallelCompact.hpp -psParallelCompact.cpp psPermGen.hpp -psParallelCompact.cpp psScavenge.hpp -psParallelCompact.cpp psYoungGen.hpp -psParallelCompact.cpp referencePolicy.hpp -psParallelCompact.cpp referenceProcessor.hpp -psParallelCompact.cpp safepoint.hpp -psParallelCompact.cpp symbolTable.hpp -psParallelCompact.cpp systemDictionary.hpp -psParallelCompact.cpp vmThread.hpp - -psParallelCompact.hpp collectorCounters.hpp -psParallelCompact.hpp markSweep.hpp -psParallelCompact.hpp mutableSpace.hpp -psParallelCompact.hpp objectStartArray.hpp -psParallelCompact.hpp oop.hpp -psParallelCompact.hpp parMarkBitMap.hpp -psParallelCompact.hpp psCompactionManager.hpp -psParallelCompact.hpp sharedHeap.hpp - -psOldGen.cpp psAdaptiveSizePolicy.hpp -psOldGen.cpp cardTableModRefBS.hpp -psOldGen.cpp gcLocker.inline.hpp -psOldGen.cpp java.hpp -psOldGen.cpp oop.inline.hpp -psOldGen.cpp parallelScavengeHeap.hpp -psOldGen.cpp psMarkSweepDecorator.hpp -psOldGen.cpp psOldGen.hpp -psOldGen.cpp spaceDecorator.hpp - -psOldGen.hpp psGenerationCounters.hpp -psOldGen.hpp mutableSpace.hpp -psOldGen.hpp objectStartArray.hpp -psOldGen.hpp psVirtualspace.hpp -psOldGen.hpp safepoint.hpp -psOldGen.hpp spaceCounters.hpp - -psPermGen.cpp gcUtil.hpp -psPermGen.cpp markOop.inline.hpp -psPermGen.cpp markSweep.inline.hpp -psPermGen.cpp parallelScavengeHeap.hpp -psPermGen.cpp psMarkSweepDecorator.hpp -psPermGen.cpp psParallelCompact.hpp -psPermGen.cpp psPermGen.hpp - -psPermGen.hpp psOldGen.hpp - -psPromotionManager.cpp memRegion.hpp -psPromotionManager.cpp mutableSpace.hpp -psPromotionManager.cpp oop.inline.hpp -psPromotionManager.cpp oop.psgc.inline.hpp -psPromotionManager.cpp parallelScavengeHeap.hpp -psPromotionManager.cpp psOldGen.hpp -psPromotionManager.cpp psPromotionManager.inline.hpp -psPromotionManager.cpp psScavenge.inline.hpp - -psPromotionManager.hpp allocation.hpp -psPromotionManager.hpp psPromotionLAB.hpp -psPromotionManager.hpp taskqueue.hpp - -psPromotionManager.inline.hpp psPromotionManager.hpp -psPromotionManager.inline.hpp psScavenge.hpp - -psPromotionLAB.cpp mutableSpace.hpp -psPromotionLAB.cpp oop.inline.hpp -psPromotionLAB.cpp parallelScavengeHeap.hpp -psPromotionLAB.cpp psPromotionLAB.hpp - -psPromotionLAB.hpp allocation.hpp -psPromotionLAB.hpp objectStartArray.hpp - -psScavenge.cpp psAdaptiveSizePolicy.hpp -psScavenge.cpp biasedLocking.hpp -psScavenge.cpp cardTableExtension.hpp -psScavenge.cpp collectorPolicy.hpp -psScavenge.cpp fprofiler.hpp -psScavenge.cpp gcCause.hpp -psScavenge.cpp gcLocker.inline.hpp -psScavenge.cpp gcTaskManager.hpp -psScavenge.cpp generationSizer.hpp -psScavenge.cpp handles.inline.hpp -psScavenge.cpp isGCActiveMark.hpp -psScavenge.cpp oop.inline.hpp -psScavenge.cpp oop.psgc.inline.hpp -psScavenge.cpp memoryService.hpp -psScavenge.cpp parallelScavengeHeap.hpp -psScavenge.cpp psMarkSweep.hpp -psScavenge.cpp psParallelCompact.hpp -psScavenge.cpp psScavenge.inline.hpp -psScavenge.cpp psTasks.hpp -psScavenge.cpp referencePolicy.hpp -psScavenge.cpp referenceProcessor.hpp -psScavenge.cpp resourceArea.hpp -psScavenge.cpp spaceDecorator.hpp -psScavenge.cpp threadCritical.hpp -psScavenge.cpp vmThread.hpp -psScavenge.cpp vm_operations.hpp - -psScavenge.hpp allocation.hpp -psScavenge.hpp cardTableExtension.hpp -psScavenge.hpp collectorCounters.hpp -psScavenge.hpp oop.hpp -psScavenge.hpp psVirtualspace.hpp - -psScavenge.inline.hpp cardTableExtension.hpp -psScavenge.inline.hpp parallelScavengeHeap.hpp -psScavenge.inline.hpp psPromotionManager.hpp -psScavenge.inline.hpp psScavenge.hpp - -pcTasks.cpp codeCache.hpp -pcTasks.cpp collectedHeap.hpp -pcTasks.cpp fprofiler.hpp -pcTasks.cpp jniHandles.hpp -pcTasks.cpp jvmtiExport.hpp -pcTasks.cpp management.hpp -pcTasks.cpp objArrayKlass.inline.hpp -pcTasks.cpp psParallelCompact.hpp -pcTasks.cpp pcTasks.hpp -pcTasks.cpp oop.inline.hpp -pcTasks.cpp oop.pcgc.inline.hpp -pcTasks.cpp systemDictionary.hpp -pcTasks.cpp thread.hpp -pcTasks.cpp universe.hpp -pcTasks.cpp vmThread.hpp - -pcTasks.hpp gcTaskManager.hpp -pcTasks.hpp psTasks.hpp - -psTasks.cpp cardTableExtension.hpp -psTasks.cpp codeCache.hpp -psTasks.cpp fprofiler.hpp -psTasks.cpp gcTaskManager.hpp -psTasks.cpp iterator.hpp -psTasks.cpp management.hpp -psTasks.cpp oop.inline.hpp -psTasks.cpp oop.psgc.inline.hpp -psTasks.cpp psMarkSweep.hpp -psTasks.cpp psPromotionManager.hpp -psTasks.cpp psPromotionManager.inline.hpp -psTasks.cpp psScavenge.hpp -psTasks.cpp psTasks.hpp -psTasks.cpp systemDictionary.hpp -psTasks.cpp taskqueue.hpp -psTasks.cpp thread.hpp -psTasks.cpp universe.hpp -psTasks.cpp vmThread.hpp - -psTasks.hpp allocation.hpp -psTasks.hpp growableArray.hpp - -psVirtualspace.hpp virtualspace.hpp - -psVirtualspace.cpp os.hpp -psVirtualspace.cpp os_.inline.hpp -psVirtualspace.cpp psVirtualspace.hpp -psVirtualspace.cpp virtualspace.hpp - -psYoungGen.cpp gcUtil.hpp -psYoungGen.cpp java.hpp -psYoungGen.cpp oop.inline.hpp -psYoungGen.cpp parallelScavengeHeap.hpp -psYoungGen.cpp psMarkSweepDecorator.hpp -psYoungGen.cpp psScavenge.hpp -psYoungGen.cpp psYoungGen.hpp -psYoungGen.cpp mutableNUMASpace.hpp -psYoungGen.cpp spaceDecorator.hpp - -psYoungGen.hpp psGenerationCounters.hpp -psYoungGen.hpp mutableSpace.hpp -psYoungGen.hpp objectStartArray.hpp -psYoungGen.hpp spaceCounters.hpp -psYoungGen.hpp psVirtualspace.hpp - -vmPSOperations.cpp dtrace.hpp -vmPSOperations.cpp parallelScavengeHeap.inline.hpp -vmPSOperations.cpp gcLocker.inline.hpp -vmPSOperations.cpp psMarkSweep.hpp -vmPSOperations.cpp psScavenge.hpp -vmPSOperations.cpp psScavenge.inline.hpp -vmPSOperations.cpp vmPSOperations.hpp - -vmPSOperations.hpp gcCause.hpp -vmPSOperations.hpp parallelScavengeHeap.hpp -vmPSOperations.hpp vmGCOperations.hpp diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_serial b/hotspot/src/share/vm/gc_implementation/includeDB_gc_serial deleted file mode 100644 index ef4508a1540..00000000000 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_serial +++ /dev/null @@ -1,125 +0,0 @@ -// -// Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -adaptiveSizePolicy.hpp collectedHeap.hpp -adaptiveSizePolicy.hpp gcCause.hpp -adaptiveSizePolicy.hpp gcUtil.hpp -adaptiveSizePolicy.hpp allocation.hpp -adaptiveSizePolicy.hpp universe.hpp - -adaptiveSizePolicy.cpp adaptiveSizePolicy.hpp -adaptiveSizePolicy.cpp collectorPolicy.hpp -adaptiveSizePolicy.cpp gcCause.hpp -adaptiveSizePolicy.cpp ostream.hpp -adaptiveSizePolicy.cpp timer.hpp - -ageTable.cpp ageTable.hpp -ageTable.cpp collectorPolicy.hpp -ageTable.cpp copy.hpp -ageTable.cpp gcPolicyCounters.hpp -ageTable.cpp resourceArea.hpp -ageTable.cpp sharedHeap.hpp - -ageTable.hpp markOop.hpp -ageTable.hpp oop.hpp -ageTable.hpp perfData.hpp - -collectorCounters.cpp collectorCounters.hpp -collectorCounters.cpp resourceArea.hpp - -collectorCounters.hpp perfData.hpp - -cSpaceCounters.cpp resourceArea.hpp -cSpaceCounters.cpp cSpaceCounters.hpp - -cSpaceCounters.hpp space.inline.hpp -cSpaceCounters.hpp perfData.hpp -cSpaceCounters.hpp generationCounters.hpp - -gcPolicyCounters.cpp resourceArea.hpp -gcPolicyCounters.cpp gcPolicyCounters.hpp - -gcPolicyCounters.hpp perfData.hpp - -gcStats.cpp gcStats.hpp -gcStats.cpp gcUtil.hpp - -gcStats.hpp gcUtil.hpp - -gcUtil.cpp gcUtil.hpp - -gcUtil.hpp allocation.hpp -gcUtil.hpp debug.hpp -gcUtil.hpp globalDefinitions.hpp -gcUtil.hpp ostream.hpp -gcUtil.hpp timer.hpp - -generationCounters.cpp generationCounters.hpp -generationCounters.cpp resourceArea.hpp - -generationCounters.hpp perfData.hpp -generationCounters.hpp virtualspace.hpp - -immutableSpace.hpp iterator.hpp - -liveRange.hpp copy.hpp -liveRange.hpp memRegion.hpp - -markSweep.cpp collectedHeap.inline.hpp -markSweep.cpp markSweep.inline.hpp -markSweep.cpp oop.inline.hpp - -markSweep.hpp growableArray.hpp -markSweep.hpp markOop.hpp -markSweep.hpp oop.hpp -markSweep.hpp timer.hpp -markSweep.hpp universe.hpp - -markSweep.inline.hpp collectedHeap.hpp -markSweep.inline.hpp markSweep.hpp - -mutableSpace.hpp immutableSpace.hpp -mutableSpace.hpp memRegion.hpp -mutableSpace.hpp copy.hpp - -vmGCOperations.cpp vmGCOperations.hpp -vmGCOperations.cpp dtrace.hpp -vmGCOperations.cpp classLoader.hpp -vmGCOperations.cpp gcLocker.inline.hpp -vmGCOperations.cpp genCollectedHeap.hpp -vmGCOperations.cpp handles.inline.hpp -vmGCOperations.cpp init.hpp -vmGCOperations.cpp instanceKlass.hpp -vmGCOperations.cpp instanceRefKlass.hpp -vmGCOperations.cpp interfaceSupport.hpp -vmGCOperations.cpp javaClasses.hpp -vmGCOperations.cpp jvmtiExport.hpp -vmGCOperations.cpp oopFactory.hpp -vmGCOperations.cpp preserveException.hpp - -vmGCOperations.hpp vm_operations.hpp -vmGCOperations.hpp heapInspection.hpp -vmGCOperations.hpp handles.hpp -vmGCOperations.hpp jniHandles.hpp -vmGCOperations.hpp synchronizer.hpp diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_shared b/hotspot/src/share/vm/gc_implementation/includeDB_gc_shared deleted file mode 100644 index 91e5876b8fe..00000000000 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_shared +++ /dev/null @@ -1,90 +0,0 @@ -// -// Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps! - -concurrentGCThread.cpp concurrentGCThread.hpp -concurrentGCThread.cpp init.hpp -concurrentGCThread.cpp instanceRefKlass.hpp -concurrentGCThread.cpp interfaceSupport.hpp -concurrentGCThread.cpp java.hpp -concurrentGCThread.cpp javaCalls.hpp -concurrentGCThread.cpp oop.inline.hpp -concurrentGCThread.cpp systemDictionary.hpp - -concurrentGCThread.hpp thread.hpp - -allocationStats.cpp allocationStats.hpp -allocationStats.cpp ostream.hpp - -allocationStats.hpp allocation.hpp -allocationStats.hpp gcUtil.hpp -allocationStats.hpp globalDefinitions.hpp - -gcAdaptivePolicyCounters.hpp adaptiveSizePolicy.hpp -gcAdaptivePolicyCounters.hpp gcPolicyCounters.hpp - -gcAdaptivePolicyCounters.cpp resourceArea.hpp -gcAdaptivePolicyCounters.cpp gcAdaptivePolicyCounters.hpp - -gSpaceCounters.cpp generation.hpp -gSpaceCounters.cpp resourceArea.hpp -gSpaceCounters.cpp gSpaceCounters.hpp - -gSpaceCounters.hpp generation.hpp -gSpaceCounters.hpp perfData.hpp -gSpaceCounters.hpp generationCounters.hpp - -immutableSpace.cpp immutableSpace.hpp -immutableSpace.cpp oop.inline.hpp -immutableSpace.cpp universe.hpp - -isGCActiveMark.hpp parallelScavengeHeap.hpp - -markSweep.inline.hpp psParallelCompact.hpp - -mutableNUMASpace.cpp mutableNUMASpace.hpp -mutableNUMASpace.cpp oop.inline.hpp -mutableNUMASpace.cpp sharedHeap.hpp -mutableNUMASpace.cpp spaceDecorator.hpp -mutableNUMASpace.cpp thread_.inline.hpp - -mutableNUMASpace.hpp mutableSpace.hpp -mutableNUMASpace.hpp gcUtil.hpp - -mutableSpace.cpp mutableSpace.hpp -mutableSpace.cpp oop.inline.hpp -mutableSpace.cpp safepoint.hpp -mutableSpace.cpp spaceDecorator.hpp -mutableSpace.cpp thread.hpp - -spaceCounters.cpp resourceArea.hpp -spaceCounters.cpp spaceCounters.hpp - -spaceCounters.hpp immutableSpace.hpp -spaceCounters.hpp mutableSpace.hpp -spaceCounters.hpp perfData.hpp -spaceCounters.hpp generationCounters.hpp - -vmGCOperations.cpp g1CollectedHeap.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 868ff816575..a18933356a7 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 (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,17 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_asParNewGeneration.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp" +#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp" +#include "gc_implementation/parNew/asParNewGeneration.hpp" +#include "gc_implementation/parNew/parNewGeneration.hpp" +#include "gc_implementation/shared/markSweep.inline.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "memory/defNewGeneration.inline.hpp" +#include "memory/referencePolicy.hpp" +#include "oops/markOop.inline.hpp" +#include "oops/oop.pcgc.inline.hpp" ASParNewGeneration::ASParNewGeneration(ReservedSpace rs, size_t initial_byte_size, diff --git a/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp b/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp index 2a8a24a0e33..70646fe9b08 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP + +#include "gc_implementation/parNew/parNewGeneration.hpp" +#include "gc_implementation/shared/adaptiveSizePolicy.hpp" + // A Generation that does parallel young-gen collection extended // for adaptive size policy. @@ -88,3 +94,5 @@ class ASParNewGeneration: public ParNewGeneration { // Space boundary invariant checker void space_invariants() PRODUCT_RETURN; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp index 740bef3a801..d3b054c59ac 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010 Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_parCardTableModRefBS.cpp.incl" +#include "precompiled.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "memory/cardTableRS.hpp" +#include "memory/sharedHeap.hpp" +#include "memory/space.inline.hpp" +#include "memory/universe.hpp" +#include "runtime/java.hpp" +#include "runtime/mutexLocker.hpp" +#include "runtime/virtualspace.hpp" void CardTableModRefBS::par_non_clean_card_iterate_work(Space* sp, MemRegion mr, DirtyCardToOopClosure* dcto_cl, @@ -44,7 +52,7 @@ void CardTableModRefBS::par_non_clean_card_iterate_work(Space* sp, MemRegion mr, int n_strides = n_threads * StridesPerThread; SequentialSubTasksDone* pst = sp->par_seq_tasks(); - pst->set_par_threads(n_threads); + pst->set_n_threads(n_threads); pst->set_n_tasks(n_strides); int stride = 0; diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.cpp index ef5c22c79bf..466d2f63225 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 (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_parGCAllocBuffer.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parNew/parGCAllocBuffer.hpp" +#include "memory/sharedHeap.hpp" +#include "oops/arrayOop.hpp" +#include "oops/oop.inline.hpp" ParGCAllocBuffer::ParGCAllocBuffer(size_t desired_plab_sz_) : _word_sz(desired_plab_sz_), _bottom(NULL), _top(NULL), diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp index b4a5b0a625f..6d1504a8653 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 (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP + +#include "memory/allocation.hpp" +#include "memory/blockOffsetTable.hpp" +#include "memory/threadLocalAllocBuffer.hpp" +#include "utilities/globalDefinitions.hpp" + // Forward decl. class PLABStats; @@ -237,3 +245,5 @@ public: return MemRegion(_top, _true_end); } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp index e31e2854664..d8d1ae9b4bf 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp @@ -22,8 +22,33 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_parNewGeneration.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp" +#include "gc_implementation/parNew/parGCAllocBuffer.hpp" +#include "gc_implementation/parNew/parNewGeneration.hpp" +#include "gc_implementation/parNew/parOopClosures.inline.hpp" +#include "gc_implementation/shared/adaptiveSizePolicy.hpp" +#include "gc_implementation/shared/ageTable.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "memory/defNewGeneration.inline.hpp" +#include "memory/genCollectedHeap.hpp" +#include "memory/genOopClosures.inline.hpp" +#include "memory/generation.hpp" +#include "memory/generation.inline.hpp" +#include "memory/referencePolicy.hpp" +#include "memory/resourceArea.hpp" +#include "memory/sharedHeap.hpp" +#include "memory/space.hpp" +#include "oops/objArrayOop.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.pcgc.inline.hpp" +#include "runtime/handles.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/java.hpp" +#include "runtime/thread.hpp" +#include "utilities/copy.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/workgroup.hpp" #ifdef _MSC_VER #pragma warning( push ) @@ -34,12 +59,12 @@ ParScanThreadState::ParScanThreadState(Space* to_space_, Generation* old_gen_, int thread_num_, ObjToScanQueueSet* work_queue_set_, - GrowableArray** overflow_stack_set_, + Stack* overflow_stacks_, size_t desired_plab_sz_, ParallelTaskTerminator& term_) : _to_space(to_space_), _old_gen(old_gen_), _young_gen(gen_), _thread_num(thread_num_), _work_queue(work_queue_set_->queue(thread_num_)), _to_space_full(false), - _overflow_stack(overflow_stack_set_[thread_num_]), + _overflow_stack(overflow_stacks_ ? overflow_stacks_ + thread_num_ : NULL), _ageTable(false), // false ==> not the global age table, no perf data. _to_space_alloc_buffer(desired_plab_sz_), _to_space_closure(gen_, this), _old_gen_closure(gen_, this), @@ -159,11 +184,12 @@ bool ParScanThreadState::take_from_overflow_stack() { assert(ParGCUseLocalOverflow, "Else should not call"); assert(young_gen()->overflow_list() == NULL, "Error"); ObjToScanQueue* queue = work_queue(); - GrowableArray* of_stack = overflow_stack(); - uint num_overflow_elems = of_stack->length(); - uint num_take_elems = MIN2(MIN2((queue->max_elems() - queue->size())/4, - (juint)ParGCDesiredObjsFromOverflowList), - num_overflow_elems); + Stack* const of_stack = overflow_stack(); + const size_t num_overflow_elems = of_stack->size(); + const size_t space_available = queue->max_elems() - queue->size(); + const size_t num_take_elems = MIN3(space_available / 4, + ParGCDesiredObjsFromOverflowList, + num_overflow_elems); // Transfer the most recent num_take_elems from the overflow // stack to our work queue. for (size_t i = 0; i != num_take_elems; i++) { @@ -271,7 +297,7 @@ public: ParNewGeneration& gen, Generation& old_gen, ObjToScanQueueSet& queue_set, - GrowableArray** overflow_stacks_, + Stack* overflow_stacks_, size_t desired_plab_sz, ParallelTaskTerminator& term); @@ -302,17 +328,19 @@ private: ParScanThreadStateSet::ParScanThreadStateSet( int num_threads, Space& to_space, ParNewGeneration& gen, Generation& old_gen, ObjToScanQueueSet& queue_set, - GrowableArray** overflow_stack_set_, + Stack* overflow_stacks, size_t desired_plab_sz, ParallelTaskTerminator& term) : ResourceArray(sizeof(ParScanThreadState), num_threads), _gen(gen), _next_gen(old_gen), _term(term) { assert(num_threads > 0, "sanity check!"); + assert(ParGCUseLocalOverflow == (overflow_stacks != NULL), + "overflow_stack allocation mismatch"); // Initialize states. for (int i = 0; i < num_threads; ++i) { new ((ParScanThreadState*)_data + i) ParScanThreadState(&to_space, &gen, &old_gen, i, &queue_set, - overflow_stack_set_, desired_plab_sz, term); + overflow_stacks, desired_plab_sz, term); } } @@ -596,14 +624,11 @@ ParNewGeneration(ReservedSpace rs, size_t initial_byte_size, int level) for (uint i2 = 0; i2 < ParallelGCThreads; i2++) _task_queues->queue(i2)->initialize(); - _overflow_stacks = NEW_C_HEAP_ARRAY(GrowableArray*, ParallelGCThreads); - guarantee(_overflow_stacks != NULL, "Overflow stack set allocation failure"); - for (uint i = 0; i < ParallelGCThreads; i++) { - if (ParGCUseLocalOverflow) { - _overflow_stacks[i] = new (ResourceObj::C_HEAP) GrowableArray(512, true); - guarantee(_overflow_stacks[i] != NULL, "Overflow Stack allocation failure."); - } else { - _overflow_stacks[i] = NULL; + _overflow_stacks = NULL; + if (ParGCUseLocalOverflow) { + _overflow_stacks = NEW_C_HEAP_ARRAY(Stack, ParallelGCThreads); + for (size_t i = 0; i < ParallelGCThreads; ++i) { + new (_overflow_stacks + i) Stack(); } } @@ -846,7 +871,7 @@ void ParNewGeneration::collect(bool full, // from this generation, pass on collection; let the next generation // do it. if (!collection_attempt_is_safe()) { - gch->set_incremental_collection_will_fail(); + gch->set_incremental_collection_failed(); // slight lie, in that we did not even attempt one return; } assert(to()->is_empty(), "Else not collection_attempt_is_safe"); @@ -935,14 +960,9 @@ void ParNewGeneration::collect(bool full, assert(to()->is_empty(), "to space should be empty now"); } else { - assert(HandlePromotionFailure, - "Should only be here if promotion failure handling is on"); - if (_promo_failure_scan_stack != NULL) { - // Can be non-null because of reference processing. - // Free stack with its elements. - delete _promo_failure_scan_stack; - _promo_failure_scan_stack = NULL; - } + assert(_promo_failure_scan_stack.is_empty(), "post condition"); + _promo_failure_scan_stack.clear(true); // Clear cached segments. + remove_forwarding_pointers(); if (PrintGCDetails) { gclog_or_tty->print(" (promotion failed)"); @@ -950,7 +970,7 @@ void ParNewGeneration::collect(bool full, // All the spaces are in play for mark-sweep. swap_spaces(); // Make life simpler for CMS || rescan; see 6483690. from()->set_next_compaction_space(to()); - gch->set_incremental_collection_will_fail(); + gch->set_incremental_collection_failed(); // Inform the next generation that a promotion failure occurred. _next_gen->promotion_failure_occurred(); @@ -1038,10 +1058,11 @@ bool ParNewGeneration::is_legal_forward_ptr(oop p) { #endif void ParNewGeneration::preserve_mark_if_necessary(oop obj, markOop m) { - if ((m != markOopDesc::prototype()) && - (!UseBiasedLocking || (m != markOopDesc::biased_locking_prototype()))) { + if (m->must_be_preserved_for_promotion_failure(obj)) { + // We should really have separate per-worker stacks, rather + // than use locking of a common pair of stacks. MutexLocker ml(ParGCRareEvent_lock); - DefNewGeneration::preserve_mark_if_necessary(obj, m); + preserve_mark(obj, m); } } @@ -1095,11 +1116,6 @@ oop ParNewGeneration::copy_to_survivor_space_avoiding_promotion_undo( old, m, sz); if (new_obj == NULL) { - if (!HandlePromotionFailure) { - // A failed promotion likely means the MaxLiveObjectEvacuationRatio flag - // is incorrectly set. In any case, its seriously wrong to be here! - vm_exit_out_of_memory(sz*wordSize, "promotion"); - } // promotion failed, forward to self _promotion_failed = true; new_obj = old; @@ -1209,12 +1225,6 @@ oop ParNewGeneration::copy_to_survivor_space_with_undo( old, m, sz); if (new_obj == NULL) { - if (!HandlePromotionFailure) { - // A failed promotion likely means the MaxLiveObjectEvacuationRatio - // flag is incorrectly set. In any case, its seriously wrong to be - // here! - vm_exit_out_of_memory(sz*wordSize, "promotion"); - } // promotion failed, forward to self forward_ptr = old->forward_to_atomic(old); new_obj = old; @@ -1397,8 +1407,8 @@ bool ParNewGeneration::take_from_overflow_list_work(ParScanThreadState* par_scan size_t objsFromOverflow = MIN2((size_t)(work_q->max_elems() - work_q->size())/4, (size_t)ParGCDesiredObjsFromOverflowList); - assert(par_scan_state->overflow_stack() == NULL, "Error"); assert(!UseCompressedOops, "Error"); + assert(par_scan_state->overflow_stack() == NULL, "Error"); if (_overflow_list == NULL) return false; // Otherwise, there was something there; try claiming the list. @@ -1533,3 +1543,7 @@ void ParNewGeneration::ref_processor_init() const char* ParNewGeneration::name() const { return "par new generation"; } + +bool ParNewGeneration::in_use() { + return UseParNewGC && ParallelGCThreads > 0; +} diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp index a3090ebf452..296eb8254b9 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp @@ -22,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP + +#include "gc_implementation/parNew/parGCAllocBuffer.hpp" +#include "memory/defNewGeneration.hpp" +#include "utilities/taskqueue.hpp" + class ChunkArray; class ParScanWithoutBarrierClosure; class ParScanWithBarrierClosure; @@ -52,7 +59,7 @@ class ParScanThreadState { friend class ParScanThreadStateSet; private: ObjToScanQueue *_work_queue; - GrowableArray* _overflow_stack; + Stack* const _overflow_stack; ParGCAllocBuffer _to_space_alloc_buffer; @@ -120,7 +127,7 @@ class ParScanThreadState { ParScanThreadState(Space* to_space_, ParNewGeneration* gen_, Generation* old_gen_, int thread_num_, ObjToScanQueueSet* work_queue_set_, - GrowableArray** overflow_stack_set_, + Stack* overflow_stacks_, size_t desired_plab_sz_, ParallelTaskTerminator& term_); @@ -144,7 +151,7 @@ class ParScanThreadState { void trim_queues(int max_size); // Private overflow stack usage - GrowableArray* overflow_stack() { return _overflow_stack; } + Stack* overflow_stack() { return _overflow_stack; } bool take_from_overflow_stack(); void push_on_overflow_stack(oop p); @@ -301,7 +308,7 @@ class ParNewGeneration: public DefNewGeneration { ObjToScanQueueSet* _task_queues; // Per-worker-thread local overflow stacks - GrowableArray** _overflow_stacks; + Stack* _overflow_stacks; // Desired size of survivor space plab's PLABStats _plab_stats; @@ -350,6 +357,8 @@ class ParNewGeneration: public DefNewGeneration { delete _task_queues; } + static bool in_use(); + virtual void ref_processor_init(); virtual Generation::Name kind() { return Generation::ParNew; } virtual const char* name() const; @@ -420,3 +429,5 @@ class ParNewGeneration: public DefNewGeneration { DEBUG_ONLY(static bool is_legal_forward_ptr(oop p);) }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.hpp index c6a2543d0f5..747868fc5f5 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.hpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.hpp @@ -22,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP + +#include "memory/genOopClosures.hpp" + // Closures for ParNewGeneration class ParScanThreadState; @@ -141,3 +146,5 @@ class ParEvacuateFollowersClosure: public VoidClosure { ParallelTaskTerminator* terminator_); virtual void do_void(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp index a540321fffa..c9c50b3f6a3 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_INLINE_HPP + +#include "gc_implementation/parNew/parNewGeneration.hpp" +#include "gc_implementation/parNew/parOopClosures.hpp" +#include "memory/cardTableRS.hpp" + template inline void ParScanWeakRefClosure::do_oop_work(T* p) { assert (!oopDesc::is_null(*p), "null weak reference?"); oop obj = oopDesc::load_decode_heap_oop_not_null(p); @@ -107,3 +114,5 @@ inline void ParScanWithBarrierClosure::do_oop_nv(narrowOop* p) { ParScanClosure: inline void ParScanWithoutBarrierClosure::do_oop_nv(oop* p) { ParScanClosure::do_oop_work(p, false, false); } inline void ParScanWithoutBarrierClosure::do_oop_nv(narrowOop* p) { ParScanClosure::do_oop_work(p, false, false); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parNew/vmStructs_parNew.hpp b/hotspot/src/share/vm/gc_implementation/parNew/vmStructs_parNew.hpp index 2e198c689d8..c07f084c0e4 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/vmStructs_parNew.hpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/vmStructs_parNew.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_VMSTRUCTS_PARNEW_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_VMSTRUCTS_PARNEW_HPP + #define VM_TYPES_PARNEW(declare_type) \ declare_type(ParNewGeneration, DefNewGeneration) #define VM_INT_CONSTANTS_PARNEW(declare_constant) \ declare_constant(Generation::ParNew) + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_VMSTRUCTS_PARNEW_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp index ab94cf21930..06f0f34e0de 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_adjoiningGenerations.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/adjoiningGenerations.hpp" +#include "gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psPermGen.hpp" // If boundary moving is being used, create the young gen and old // gen with ASPSYoungGen and ASPSOldGen, respectively. Revert to diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp index aec8430d839..77fe9e022e5 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGGENERATIONS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGGENERATIONS_HPP + +#include "gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp" +#include "gc_implementation/parallelScavenge/asPSOldGen.hpp" +#include "gc_implementation/parallelScavenge/asPSYoungGen.hpp" +#include "gc_implementation/parallelScavenge/psPermGen.hpp" + // Contains two generations that both use an AdjoiningVirtualSpaces. // The two generations are adjacent in the reserved space for the @@ -75,3 +83,5 @@ class AdjoiningGenerations : public CHeapObj { // for the adjoining generations. size_t reserved_byte_size(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGGENERATIONS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp index 7a3baf407b0..e21f7a7a6e4 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_adjoiningVirtualSpaces.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp" +#include "runtime/java.hpp" AdjoiningVirtualSpaces::AdjoiningVirtualSpaces(ReservedSpace rs, size_t min_low_byte_size, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp index a8ff87acd91..ed860c204a0 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGVIRTUALSPACES_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGVIRTUALSPACES_HPP + +#include "gc_implementation/parallelScavenge/psVirtualspace.hpp" + // Contains two virtual spaces that each can individually span // most of the reserved region but committed parts of which @@ -106,3 +111,5 @@ class AdjoiningVirtualSpaces { size_t init_low_byte_size, size_t init_high_byte_size); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ADJOININGVIRTUALSPACES_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp index 2edd3025864..0c12e98bea4 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,14 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_asPSOldGen.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/asPSOldGen.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/java.hpp" // Whereas PSOldGen takes the maximum size of the generation // (which doesn't change in the case of PSOldGen) as a parameter, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp index 60ed93cd8fd..3de4f9793a6 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ASPSOLDGEN_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ASPSOLDGEN_HPP + +#include "gc_implementation/parallelScavenge/objectStartArray.hpp" +#include "gc_implementation/parallelScavenge/psOldGen.hpp" +#include "gc_implementation/parallelScavenge/psVirtualspace.hpp" +#include "gc_implementation/shared/generationCounters.hpp" +#include "gc_implementation/shared/mutableSpace.hpp" +#include "gc_implementation/shared/spaceCounters.hpp" + class ASPSOldGen : public PSOldGen { friend class VMStructs; size_t _gen_size_limit; // Largest size the generation's reserved size @@ -55,3 +65,5 @@ class ASPSOldGen : public PSOldGen { // Debugging support virtual const char* short_name() const { return "ASPSOldGen"; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ASPSOLDGEN_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp index 8edd351fc8c..73b63043b71 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 (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_asPSYoungGen.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/asPSYoungGen.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.hpp" +#include "gc_implementation/parallelScavenge/psYoungGen.hpp" +#include "gc_implementation/shared/gcUtil.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/java.hpp" ASPSYoungGen::ASPSYoungGen(size_t init_byte_size, size_t minimum_byte_size, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.hpp index 6f56c3d60aa..6f5409239c7 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,17 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ASPSYOUNGGEN_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ASPSYOUNGGEN_HPP + +#include "gc_implementation/parallelScavenge/objectStartArray.hpp" +#include "gc_implementation/parallelScavenge/psVirtualspace.hpp" +#include "gc_implementation/parallelScavenge/psYoungGen.hpp" +#include "gc_implementation/shared/generationCounters.hpp" +#include "gc_implementation/shared/mutableSpace.hpp" +#include "gc_implementation/shared/spaceCounters.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" + class ASPSYoungGen : public PSYoungGen { friend class VMStructs; private: @@ -62,3 +73,5 @@ class ASPSYoungGen : public PSYoungGen { // Printing support virtual const char* short_name() const { return "ASPSYoungGen"; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_ASPSYOUNGGEN_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp index e9da8d5fa66..5b06d3126f6 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp @@ -22,8 +22,14 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_cardTableExtension.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/cardTableExtension.hpp" +#include "gc_implementation/parallelScavenge/gcTaskManager.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psTasks.hpp" +#include "gc_implementation/parallelScavenge/psYoungGen.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.psgc.inline.hpp" // Checks an individual oop for missing precise marks. Mark // may be either dirty or newgen. diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp index 90243a72106..00d6673e1b0 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp @@ -22,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_CARDTABLEEXTENSION_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_CARDTABLEEXTENSION_HPP + +#include "memory/cardTableModRefBS.hpp" + class MutableSpace; class ObjectStartArray; class PSPromotionManager; @@ -108,3 +113,5 @@ class CardTableExtension : public CardTableModRefBS { #endif // ASSERT }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_CARDTABLEEXTENSION_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp index 9b596d84134..c4c5120410f 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,13 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_gcTaskManager.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/gcTaskManager.hpp" +#include "gc_implementation/parallelScavenge/gcTaskThread.hpp" +#include "memory/allocation.hpp" +#include "memory/allocation.inline.hpp" +#include "runtime/mutex.hpp" +#include "runtime/mutexLocker.hpp" // // GCTask diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.hpp index 6976bf4b182..3bd3af1e306 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKMANAGER_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKMANAGER_HPP + +#include "runtime/mutex.hpp" +#include "utilities/growableArray.hpp" + // // The GCTaskManager is a queue of GCTasks, and accessors // to allow the queue to be accessed from many threads. @@ -636,3 +642,5 @@ private: return _freelist; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKMANAGER_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp index 28651a15bce..41c90f9ece7 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_gcTaskThread.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/gcTaskManager.hpp" +#include "gc_implementation/parallelScavenge/gcTaskThread.hpp" +#include "memory/allocation.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/handles.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/os.hpp" +#include "runtime/thread.hpp" GCTaskThread::GCTaskThread(GCTaskManager* manager, uint which, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.hpp index 6968a6d9698..7fc907bf0c7 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKTHREAD_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKTHREAD_HPP + +#include "runtime/thread.hpp" + // Forward declarations of classes defined here. class GCTaskThread; class GCTaskTimeStamp; @@ -97,3 +102,5 @@ class GCTaskTimeStamp : public CHeapObj void set_exit_time(jlong time) { _exit_time = time; } void set_name(char* name) { _name = name; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKTHREAD_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp index 9aa85924281..854b09ac5be 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 (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GENERATIONSIZER_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GENERATIONSIZER_HPP + +#include "memory/collectorPolicy.hpp" + // There is a nice batch of tested generation sizing code in // TwoGenerationCollectorPolicy. Lets reuse it! @@ -67,3 +72,5 @@ class GenerationSizer : public TwoGenerationCollectorPolicy { size_t perm_gen_size() { return PermSize; } size_t max_perm_gen_size() { return MaxPermSize; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GENERATIONSIZER_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp index e697b31a0cd..1b80839213d 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_objectStartArray.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/objectStartArray.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/java.hpp" void ObjectStartArray::initialize(MemRegion reserved_region) { // We're based on the assumption that we use the same diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp index dcf6fc35535..cea680b58b1 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_OBJECTSTARTARRAY_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_OBJECTSTARTARRAY_HPP + +#include "gc_implementation/parallelScavenge/psVirtualspace.hpp" +#include "memory/allocation.hpp" +#include "memory/memRegion.hpp" +#include "oops/oop.hpp" + // // This class can be used to locate the beginning of an object in the // covered region. @@ -160,3 +168,5 @@ class ObjectStartArray : public CHeapObj { // "start", the method will return true. bool object_starts_in_range(HeapWord* start_addr, HeapWord* end_addr) const; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_OBJECTSTARTARRAY_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp index e8963cb8eb7..f43fffce1b7 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 (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,22 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_parMarkBitMap.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp" +#include "gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/os.hpp" +#include "utilities/bitMap.inline.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "os_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "os_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "os_windows.inline.hpp" +#endif bool ParMarkBitMap::initialize(MemRegion covered_region) diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp index 02376bf2a4a..e6a07310dbf 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP + +#include "memory/memRegion.hpp" +#include "gc_implementation/parallelScavenge/psVirtualspace.hpp" +#include "utilities/bitMap.inline.hpp" + class oopDesc; class ParMarkBitMapClosure; @@ -426,3 +433,5 @@ inline void ParMarkBitMap::verify_addr(HeapWord* addr) const { assert(addr <= region_start() + region_size(), "addr too big"); } #endif // #ifdef ASSERT + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp index aea032efb19..e7f1dfa5470 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,15 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_INLINE_HPP + +#include "oops/oop.hpp" + inline bool ParMarkBitMap::mark_obj(oop obj) { return mark_obj(obj, obj->size()); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp index b3fe8fd36ae..5eebf243751 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp @@ -22,8 +22,25 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_parallelScavengeHeap.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/adjoiningGenerations.hpp" +#include "gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp" +#include "gc_implementation/parallelScavenge/cardTableExtension.hpp" +#include "gc_implementation/parallelScavenge/gcTaskManager.hpp" +#include "gc_implementation/parallelScavenge/generationSizer.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp" +#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweep.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#include "gc_implementation/parallelScavenge/psPromotionManager.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.hpp" +#include "gc_implementation/parallelScavenge/vmPSOperations.hpp" +#include "memory/gcLocker.inline.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/java.hpp" +#include "runtime/vmThread.hpp" +#include "utilities/vmError.hpp" PSYoungGen* ParallelScavengeHeap::_young_gen = NULL; PSOldGen* ParallelScavengeHeap::_old_gen = NULL; @@ -805,7 +822,8 @@ HeapWord* ParallelScavengeHeap::block_start(const void* addr) const { if (young_gen()->is_in_reserved(addr)) { assert(young_gen()->is_in(addr), "addr should be in allocated part of young gen"); - if (Debugging) return NULL; // called from find() in debug.cpp + // called from os::print_location by find or VMError + if (Debugging || VMError::fatal_error_in_progress()) return NULL; Unimplemented(); } else if (old_gen()->is_in_reserved(addr)) { assert(old_gen()->is_in(addr), diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp index e8f25be68fe..44f6640d0ae 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp @@ -22,6 +22,18 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_HPP + +#include "gc_implementation/parallelScavenge/objectStartArray.hpp" +#include "gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp" +#include "gc_implementation/parallelScavenge/psOldGen.hpp" +#include "gc_implementation/parallelScavenge/psPermGen.hpp" +#include "gc_implementation/parallelScavenge/psYoungGen.hpp" +#include "gc_implementation/shared/gcPolicyCounters.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "utilities/ostream.hpp" + class AdjoiningGenerations; class GCTaskManager; class PSAdaptiveSizePolicy; @@ -263,3 +275,5 @@ inline size_t ParallelScavengeHeap::set_alignment(size_t& var, size_t val) var = round_to(val, intra_heap_alignment()); return var; } + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp index 182b5054565..092a0392d3b 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_INLINE_HPP + +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweep.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.hpp" + inline size_t ParallelScavengeHeap::total_invocations() { return UseParallelOldGC ? PSParallelCompact::total_invocations() : @@ -49,3 +57,5 @@ inline bool ParallelScavengeHeap::is_in_young(oop p) { inline bool ParallelScavengeHeap::is_in_old_or_perm(oop p) { return old_gen()->is_in_reserved(p) || perm_gen()->is_in_reserved(p); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp index c7415706adf..2054dc4a36c 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 (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,22 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_pcTasks.cpp.incl" +#include "precompiled.hpp" +#include "classfile/systemDictionary.hpp" +#include "code/codeCache.hpp" +#include "gc_implementation/parallelScavenge/pcTasks.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "memory/universe.hpp" +#include "oops/objArrayKlass.inline.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.pcgc.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "runtime/fprofiler.hpp" +#include "runtime/jniHandles.hpp" +#include "runtime/thread.hpp" +#include "runtime/vmThread.hpp" +#include "services/management.hpp" // // ThreadRootsMarkingTask @@ -59,8 +73,6 @@ void MarkFromRootsTask::do_it(GCTaskManager* manager, uint which) { PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty)); ParCompactionManager* cm = ParCompactionManager::gc_thread_compaction_manager(which); - assert(cm->stacks_have_been_allocated(), - "Stack space has not been allocated"); PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm); switch (_root_type) { @@ -119,7 +131,6 @@ void MarkFromRootsTask::do_it(GCTaskManager* manager, uint which) { // Do the real work cm->follow_marking_stacks(); - // cm->deallocate_stacks(); } @@ -135,8 +146,6 @@ void RefProcTaskProxy::do_it(GCTaskManager* manager, uint which) PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty)); ParCompactionManager* cm = ParCompactionManager::gc_thread_compaction_manager(which); - assert(cm->stacks_have_been_allocated(), - "Stack space has not been allocated"); PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm); PSParallelCompact::FollowStackClosure follow_stack_closure(cm); _rp_task.work(_work_id, *PSParallelCompact::is_alive_closure(), diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp index 1d67062f8c4..fd6ee5e76e8 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP + +#include "gc_implementation/parallelScavenge/gcTaskManager.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#include "gc_implementation/parallelScavenge/psTasks.hpp" + // Tasks for parallel compaction of the old generation // @@ -242,7 +249,13 @@ class UpdateDensePrefixTask : public GCTask { // class DrainStacksCompactionTask : public GCTask { + uint _stack_index; + uint stack_index() { return _stack_index; } public: + DrainStacksCompactionTask(uint stack_index) : GCTask(), + _stack_index(stack_index) {}; char* name() { return (char *)"drain-region-task"; } virtual void do_it(GCTaskManager* manager, uint which); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp index 643129e8a3c..1ac281813a5 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp @@ -22,8 +22,16 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_psAdaptiveSizePolicy.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/generationSizer.hpp" +#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" +#include "gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.hpp" +#include "gc_implementation/shared/gcPolicyCounters.hpp" +#include "gc_interface/gcCause.hpp" +#include "memory/collectorPolicy.hpp" +#include "runtime/timer.hpp" +#include "utilities/top.hpp" #include diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp index a178ee06a27..e5e4e4ce9a9 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp @@ -22,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSADAPTIVESIZEPOLICY_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSADAPTIVESIZEPOLICY_HPP + +#include "gc_implementation/shared/adaptiveSizePolicy.hpp" +#include "gc_implementation/shared/gcStats.hpp" +#include "gc_implementation/shared/gcUtil.hpp" +#include "gc_interface/gcCause.hpp" + // This class keeps statistical information and computes the // optimal free space for both the young and old generation // based on current application characteristics (based on gc cost @@ -384,3 +392,5 @@ class PSAdaptiveSizePolicy : public AdaptiveSizePolicy { // Printing support virtual bool print_adaptive_size_policy_on(outputStream* st) const; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSADAPTIVESIZEPOLICY_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp index a42bbaba412..24b9ddea001 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp @@ -22,8 +22,20 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_psCompactionManager.cpp.incl" +#include "precompiled.hpp" +#include "classfile/systemDictionary.hpp" +#include "gc_implementation/parallelScavenge/gcTaskManager.hpp" +#include "gc_implementation/parallelScavenge/objectStartArray.hpp" +#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psCompactionManager.hpp" +#include "gc_implementation/parallelScavenge/psOldGen.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#include "oops/objArrayKlass.inline.hpp" +#include "oops/oop.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.pcgc.inline.hpp" +#include "utilities/stack.inline.hpp" PSOldGen* ParCompactionManager::_old_gen = NULL; ParCompactionManager** ParCompactionManager::_manager_array = NULL; @@ -46,23 +58,6 @@ ParCompactionManager::ParCompactionManager() : marking_stack()->initialize(); _objarray_stack.initialize(); region_stack()->initialize(); - - // Note that _revisit_klass_stack is allocated out of the - // C heap (as opposed to out of ResourceArena). - int size = - (SystemDictionary::number_of_classes() * 2) * 2 / ParallelGCThreads; - _revisit_klass_stack = new (ResourceObj::C_HEAP) GrowableArray(size, true); - // From some experiments (#klass/k)^2 for k = 10 seems a better fit, but this will - // have to do for now until we are able to investigate a more optimal setting. - _revisit_mdo_stack = new (ResourceObj::C_HEAP) GrowableArray(size*2, true); -} - -ParCompactionManager::~ParCompactionManager() { - delete _revisit_klass_stack; - delete _revisit_mdo_stack; - // _manager_array and _stack_array are statics - // shared with all instances of ParCompactionManager - // should not be deallocated. } void ParCompactionManager::initialize(ParMarkBitMap* mbm) { @@ -134,9 +129,9 @@ ParCompactionManager::gc_thread_compaction_manager(int index) { } void ParCompactionManager::reset() { - for(uint i=0; irevisit_klass_stack()->clear(); - manager_array(i)->revisit_mdo_stack()->clear(); + for(uint i = 0; i < ParallelGCThreads + 1; i++) { + assert(manager_array(i)->revisit_klass_stack()->is_empty(), "sanity"); + assert(manager_array(i)->revisit_mdo_stack()->is_empty(), "sanity"); } } @@ -178,10 +173,3 @@ void ParCompactionManager::drain_region_stacks() { } } while (!region_stack()->is_empty()); } - -#ifdef ASSERT -bool ParCompactionManager::stacks_have_been_allocated() { - return (revisit_klass_stack()->data_addr() != NULL && - revisit_mdo_stack()->data_addr() != NULL); -} -#endif diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp index 101f19dc46d..cbf1b7d0301 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp @@ -22,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_HPP + +#include "memory/allocation.hpp" +#include "utilities/stack.hpp" +#include "utilities/taskqueue.hpp" + // Move to some global location #define HAS_BEEN_MOVED 0x1501d01d // End move to some global location @@ -80,10 +87,9 @@ private: // type of TaskQueue. RegionTaskQueue _region_stack; -#if 1 // does this happen enough to need a per thread stack? - GrowableArray* _revisit_klass_stack; - GrowableArray* _revisit_mdo_stack; -#endif + Stack _revisit_klass_stack; + Stack _revisit_mdo_stack; + static ParMarkBitMap* _mark_bitmap; Action _action; @@ -113,10 +119,7 @@ private: inline static ParCompactionManager* manager_array(int index); ParCompactionManager(); - ~ParCompactionManager(); - void allocate_stacks(); - void deallocate_stacks(); ParMarkBitMap* mark_bitmap() { return _mark_bitmap; } // Take actions in preparation for a compaction. @@ -129,11 +132,8 @@ private: bool should_verify_only(); bool should_reset_only(); -#if 1 - // Probably stays as a growable array - GrowableArray* revisit_klass_stack() { return _revisit_klass_stack; } - GrowableArray* revisit_mdo_stack() { return _revisit_mdo_stack; } -#endif + Stack* revisit_klass_stack() { return &_revisit_klass_stack; } + Stack* revisit_mdo_stack() { return &_revisit_mdo_stack; } // Save for later processing. Must not fail. inline void push(oop obj) { _marking_stack.push(obj); } @@ -162,10 +162,6 @@ private: // Process tasks remaining on any stack void drain_region_stacks(); - // Debugging support -#ifdef ASSERT - bool stacks_have_been_allocated(); -#endif }; inline ParCompactionManager* ParCompactionManager::manager_array(int index) { @@ -178,3 +174,5 @@ inline ParCompactionManager* ParCompactionManager::manager_array(int index) { bool ParCompactionManager::marking_stacks_empty() const { return _marking_stack.is_empty() && _objarray_stack.is_empty(); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp index 1894cb5e7f5..6cf76353d9c 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp @@ -22,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP + +#include "gc_implementation/parallelScavenge/psCompactionManager.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" + void ParCompactionManager::push_objarray(oop obj, size_t index) { ObjArrayTask task(obj, index); @@ -39,3 +45,5 @@ void ParCompactionManager::push_region(size_t index) #endif region_stack()->push(index); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp index 092c8fbf135..7e5bc9aab9a 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp @@ -22,8 +22,10 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_psGCAdaptivePolicyCounters.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/arguments.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp index 53ea94417e8..c6839705625 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp @@ -22,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGCADAPTIVEPOLICYCOUNTERS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGCADAPTIVEPOLICYCOUNTERS_HPP + +#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" +#include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp" +#include "gc_implementation/shared/gcPolicyCounters.hpp" + // PSGCAdaptivePolicyCounters is a holder class for performance counters // that track the data and decisions for the ergonomics policy for the // parallel scavenge collector. @@ -200,3 +207,5 @@ class PSGCAdaptivePolicyCounters : public GCAdaptivePolicyCounters { return GCPolicyCounters::PSGCAdaptivePolicyCountersKind; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGCADAPTIVEPOLICYCOUNTERS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.cpp index 85438c88d38..67378de145e 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_psGenerationCounters.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/psGenerationCounters.hpp" +#include "memory/resourceArea.hpp" PSGenerationCounters::PSGenerationCounters(const char* name, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.hpp index 065129d327a..a86677956a8 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGENERATIONCOUNTERS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGENERATIONCOUNTERS_HPP + +#include "gc_implementation/parallelScavenge/psVirtualspace.hpp" +#include "gc_implementation/shared/generationCounters.hpp" +#include "runtime/perfData.hpp" + // A PSGenerationCounter is a holder class for performance counters // that track a generation @@ -41,3 +48,5 @@ class PSGenerationCounters: public GenerationCounters { _current_size->set_value(_ps_virtual_space->committed_size()); } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSGENERATIONCOUNTERS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp index 9006652c092..3efa4ceaeae 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp @@ -22,8 +22,34 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_psMarkSweep.cpp.incl" +#include "precompiled.hpp" +#include "classfile/symbolTable.hpp" +#include "classfile/systemDictionary.hpp" +#include "code/codeCache.hpp" +#include "gc_implementation/parallelScavenge/generationSizer.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweep.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp" +#include "gc_implementation/parallelScavenge/psOldGen.hpp" +#include "gc_implementation/parallelScavenge/psPermGen.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.hpp" +#include "gc_implementation/parallelScavenge/psYoungGen.hpp" +#include "gc_implementation/shared/isGCActiveMark.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "gc_interface/gcCause.hpp" +#include "memory/gcLocker.inline.hpp" +#include "memory/referencePolicy.hpp" +#include "memory/referenceProcessor.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/fprofiler.hpp" +#include "runtime/safepoint.hpp" +#include "runtime/vmThread.hpp" +#include "services/management.hpp" +#include "services/memoryService.hpp" +#include "utilities/events.hpp" +#include "utilities/stack.inline.hpp" elapsedTimer PSMarkSweep::_accumulated_time; unsigned int PSMarkSweep::_total_invocations = 0; @@ -466,33 +492,16 @@ void PSMarkSweep::allocate_stacks() { _preserved_count_max = pointer_delta(to_space->end(), to_space->top(), sizeof(jbyte)); // Now divide by the size of a PreservedMark _preserved_count_max /= sizeof(PreservedMark); - - _preserved_mark_stack = NULL; - _preserved_oop_stack = NULL; - - _marking_stack = new (ResourceObj::C_HEAP) GrowableArray(4000, true); - _objarray_stack = new (ResourceObj::C_HEAP) GrowableArray(50, true); - - int size = SystemDictionary::number_of_classes() * 2; - _revisit_klass_stack = new (ResourceObj::C_HEAP) GrowableArray(size, true); - // (#klass/k)^2, for k ~ 10 appears a better setting, but this will have to do for - // now until we investigate a more optimal setting. - _revisit_mdo_stack = new (ResourceObj::C_HEAP) GrowableArray(size*2, true); } void PSMarkSweep::deallocate_stacks() { - if (_preserved_oop_stack) { - delete _preserved_mark_stack; - _preserved_mark_stack = NULL; - delete _preserved_oop_stack; - _preserved_oop_stack = NULL; - } - - delete _marking_stack; - delete _objarray_stack; - delete _revisit_klass_stack; - delete _revisit_mdo_stack; + _preserved_mark_stack.clear(true); + _preserved_oop_stack.clear(true); + _marking_stack.clear(); + _objarray_stack.clear(true); + _revisit_klass_stack.clear(true); + _revisit_mdo_stack.clear(true); } void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { @@ -542,17 +551,17 @@ void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { // Update subklass/sibling/implementor links of live klasses follow_weak_klass_links(); - assert(_marking_stack->is_empty(), "just drained"); + assert(_marking_stack.is_empty(), "just drained"); // Visit memoized mdo's and clear unmarked weak refs follow_mdo_weak_refs(); - assert(_marking_stack->is_empty(), "just drained"); + assert(_marking_stack.is_empty(), "just drained"); // Visit symbol and interned string tables and delete unmarked oops SymbolTable::unlink(is_alive_closure()); StringTable::unlink(is_alive_closure()); - assert(_marking_stack->is_empty(), "stack should be empty by now"); + assert(_marking_stack.is_empty(), "stack should be empty by now"); } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp index 551a63f6f4d..832b1674203 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP + +#include "gc_implementation/shared/collectorCounters.hpp" +#include "gc_implementation/shared/markSweep.inline.hpp" +#include "utilities/stack.hpp" + class PSAdaptiveSizePolicy; class PSYoungGen; class PSOldGen; @@ -83,3 +90,5 @@ class PSMarkSweep : public MarkSweep { // Time since last full gc (in milliseconds) static jlong millis_since_last_gc(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp index 8cdad2a7004..ade35fa4a6c 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 (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_psMarkSweepDecorator.cpp.incl" +#include "precompiled.hpp" +#include "classfile/systemDictionary.hpp" +#include "gc_implementation/parallelScavenge/objectStartArray.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweep.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp" +#include "gc_implementation/shared/liveRange.hpp" +#include "gc_implementation/shared/markSweep.inline.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "oops/oop.inline.hpp" PSMarkSweepDecorator* PSMarkSweepDecorator::_destination_decorator = NULL; diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp index 45a9d96eeb0..9d721d61bc4 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEPDECORATOR_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEPDECORATOR_HPP + +#include "gc_implementation/shared/mutableSpace.hpp" + // // A PSMarkSweepDecorator is used to add "ParallelScavenge" style mark sweep operations // to a MutableSpace. @@ -73,3 +78,5 @@ class PSMarkSweepDecorator: public CHeapObj { void precompact(); void compact(bool mangle_free_space); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEPDECORATOR_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp index 3898e2a8d89..df0865ee392 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_psOldGen.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp" +#include "gc_implementation/parallelScavenge/psOldGen.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "memory/gcLocker.inline.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/java.hpp" inline const char* PSOldGen::select_name() { return UseParallelOldGC ? "ParOldGen" : "PSOldGen"; diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp index 27360a1cbc8..0d9cdd75ddd 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSOLDGEN_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSOLDGEN_HPP + +#include "gc_implementation/parallelScavenge/objectStartArray.hpp" +#include "gc_implementation/parallelScavenge/psGenerationCounters.hpp" +#include "gc_implementation/parallelScavenge/psVirtualspace.hpp" +#include "gc_implementation/shared/mutableSpace.hpp" +#include "gc_implementation/shared/spaceCounters.hpp" +#include "runtime/safepoint.hpp" + class PSMarkSweepDecorator; class PSOldGen : public CHeapObj { @@ -190,3 +200,5 @@ class PSOldGen : public CHeapObj { // Save the tops of all spaces for later use during mangling. void record_spaces_top() PRODUCT_RETURN; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSOLDGEN_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp index ac7b23575bb..79e269dc7f3 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @@ -22,8 +22,39 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_psParallelCompact.cpp.incl" +#include "precompiled.hpp" +#include "classfile/symbolTable.hpp" +#include "classfile/systemDictionary.hpp" +#include "code/codeCache.hpp" +#include "gc_implementation/parallelScavenge/gcTaskManager.hpp" +#include "gc_implementation/parallelScavenge/generationSizer.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp" +#include "gc_implementation/parallelScavenge/pcTasks.hpp" +#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" +#include "gc_implementation/parallelScavenge/psCompactionManager.inline.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweep.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp" +#include "gc_implementation/parallelScavenge/psOldGen.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#include "gc_implementation/parallelScavenge/psPermGen.hpp" +#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.hpp" +#include "gc_implementation/parallelScavenge/psYoungGen.hpp" +#include "gc_implementation/shared/isGCActiveMark.hpp" +#include "gc_interface/gcCause.hpp" +#include "memory/gcLocker.inline.hpp" +#include "memory/referencePolicy.hpp" +#include "memory/referenceProcessor.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.pcgc.inline.hpp" +#include "runtime/fprofiler.hpp" +#include "runtime/safepoint.hpp" +#include "runtime/vmThread.hpp" +#include "services/management.hpp" +#include "services/memoryService.hpp" +#include "utilities/events.hpp" +#include "utilities/stack.inline.hpp" #include @@ -2170,6 +2201,16 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { heap->update_counters(); } +#ifdef ASSERT + for (size_t i = 0; i < ParallelGCThreads + 1; ++i) { + ParCompactionManager* const cm = + ParCompactionManager::manager_array(int(i)); + assert(cm->marking_stack()->is_empty(), "should be empty"); + assert(cm->region_stack()->is_empty(), "should be empty"); + assert(cm->revisit_klass_stack()->is_empty(), "should be empty"); + } +#endif // ASSERT + if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification gclog_or_tty->print(" VerifyAfterGC:"); @@ -2449,7 +2490,7 @@ void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q, const unsigned int task_count = MAX2(parallel_gc_threads, 1U); for (unsigned int j = 0; j < task_count; j++) { - q->enqueue(new DrainStacksCompactionTask()); + q->enqueue(new DrainStacksCompactionTask(j)); } // Find all regions that are available (can be filled immediately) and @@ -2711,21 +2752,22 @@ PSParallelCompact::follow_weak_klass_links() { // All klasses on the revisit stack are marked at this point. // Update and follow all subklass, sibling and implementor links. if (PrintRevisitStats) { - gclog_or_tty->print_cr("#classes in system dictionary = %d", SystemDictionary::number_of_classes()); + gclog_or_tty->print_cr("#classes in system dictionary = %d", + SystemDictionary::number_of_classes()); } for (uint i = 0; i < ParallelGCThreads + 1; i++) { ParCompactionManager* cm = ParCompactionManager::manager_array(i); KeepAliveClosure keep_alive_closure(cm); - int length = cm->revisit_klass_stack()->length(); + Stack* const rks = cm->revisit_klass_stack(); if (PrintRevisitStats) { - gclog_or_tty->print_cr("Revisit klass stack[%d] length = %d", i, length); + gclog_or_tty->print_cr("Revisit klass stack[%u] length = " SIZE_FORMAT, + i, rks->size()); } - for (int j = 0; j < length; j++) { - cm->revisit_klass_stack()->at(j)->follow_weak_klass_links( - is_alive_closure(), - &keep_alive_closure); + while (!rks->is_empty()) { + Klass* const k = rks->pop(); + k->follow_weak_klass_links(is_alive_closure(), &keep_alive_closure); } - // revisit_klass_stack is cleared in reset() + cm->follow_marking_stacks(); } } @@ -2744,19 +2786,20 @@ void PSParallelCompact::follow_mdo_weak_refs() { // we can visit and clear any weak references from MDO's which // we memoized during the strong marking phase. if (PrintRevisitStats) { - gclog_or_tty->print_cr("#classes in system dictionary = %d", SystemDictionary::number_of_classes()); + gclog_or_tty->print_cr("#classes in system dictionary = %d", + SystemDictionary::number_of_classes()); } for (uint i = 0; i < ParallelGCThreads + 1; i++) { ParCompactionManager* cm = ParCompactionManager::manager_array(i); - GrowableArray* rms = cm->revisit_mdo_stack(); - int length = rms->length(); + Stack* rms = cm->revisit_mdo_stack(); if (PrintRevisitStats) { - gclog_or_tty->print_cr("Revisit MDO stack[%d] length = %d", i, length); + gclog_or_tty->print_cr("Revisit MDO stack[%u] size = " SIZE_FORMAT, + i, rms->size()); } - for (int j = 0; j < length; j++) { - rms->at(j)->follow_weak_refs(is_alive_closure()); + while (!rms->is_empty()) { + rms->pop()->follow_weak_refs(is_alive_closure()); } - // revisit_mdo_stack is cleared in reset() + cm->follow_marking_stacks(); } } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp index 1d3ade7794a..e69730202d5 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp @@ -22,6 +22,18 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP + +#include "gc_implementation/parallelScavenge/objectStartArray.hpp" +#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp" +#include "gc_implementation/parallelScavenge/psCompactionManager.hpp" +#include "gc_implementation/shared/collectorCounters.hpp" +#include "gc_implementation/shared/markSweep.hpp" +#include "gc_implementation/shared/mutableSpace.hpp" +#include "memory/sharedHeap.hpp" +#include "oops/oop.hpp" + class ParallelScavengeHeap; class PSAdaptiveSizePolicy; class PSYoungGen; @@ -1514,3 +1526,5 @@ public: private: ObjectStartArray* const _start_array; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp index 1224f224516..60fea316595 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,14 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_psPermGen.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#include "gc_implementation/parallelScavenge/psPermGen.hpp" +#include "gc_implementation/shared/gcUtil.hpp" +#include "gc_implementation/shared/markSweep.inline.hpp" +#include "oops/markOop.inline.hpp" PSPermGen::PSPermGen(ReservedSpace rs, size_t alignment, size_t initial_size, size_t min_size, size_t max_size, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.hpp index 43eedc6dd3b..7a890fc8d14 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPermGen.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPERMGEN_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPERMGEN_HPP + +#include "gc_implementation/parallelScavenge/psOldGen.hpp" + class AdaptivePaddedAverage; class PSPermGen : public PSOldGen { @@ -51,3 +56,5 @@ class PSPermGen : public PSOldGen { virtual const char* name() const { return "PSPermGen"; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPERMGEN_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp index 3331a1fcab1..3569ed7b63d 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 (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_psPromotionLAB.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psPromotionLAB.hpp" +#include "gc_implementation/shared/mutableSpace.hpp" +#include "oops/oop.inline.hpp" size_t PSPromotionLAB::filler_header_size; diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp index 6e7e05c593e..bed0c0cdeeb 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 (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONLAB_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONLAB_HPP + +#include "gc_implementation/parallelScavenge/objectStartArray.hpp" +#include "memory/allocation.hpp" + // // PSPromotionLAB is a parallel scavenge promotion lab. This class acts very // much like a MutableSpace. We couldn't embed a MutableSpace, though, as @@ -140,3 +146,5 @@ class PSOldPromotionLAB : public PSPromotionLAB { debug_only(virtual bool lab_is_valid(MemRegion lab)); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONLAB_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp index 1e73d11d1e3..8379004f636 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp @@ -22,8 +22,15 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_psPromotionManager.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psOldGen.hpp" +#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +#include "gc_implementation/shared/mutableSpace.hpp" +#include "memory/memRegion.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.psgc.inline.hpp" PSPromotionManager** PSPromotionManager::_manager_array = NULL; OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL; @@ -185,7 +192,6 @@ void PSPromotionManager::reset() { void PSPromotionManager::drain_stacks_depth(bool totally_drain) { - assert(claimed_stack_depth()->overflow_stack() != NULL, "invariant"); totally_drain = totally_drain || _totally_drain; #ifdef ASSERT diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp index aa14478d480..80c09d9131c 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp @@ -22,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP + +#include "gc_implementation/parallelScavenge/psPromotionLAB.hpp" +#include "memory/allocation.hpp" +#include "utilities/taskqueue.hpp" + // // psPromotionManager is used by a single thread to manage object survival // during a scavenge. The promotion manager contains thread local data only. @@ -191,3 +198,5 @@ class PSPromotionManager : public CHeapObj { TASKQUEUE_STATS_ONLY(inline void record_steal(StarTask& p);) }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP 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 decc5e99a46..eae7eaded83 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp @@ -22,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP + +#include "gc_implementation/parallelScavenge/psPromotionManager.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.hpp" + inline PSPromotionManager* PSPromotionManager::manager_array(int index) { assert(_manager_array != NULL, "access of NULL manager_array"); assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access"); @@ -77,3 +83,5 @@ void PSPromotionManager::record_steal(StarTask& p) { } } #endif // TASKQUEUE_STATS + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp index 0ea076812b0..f87db47e7cb 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp @@ -22,9 +22,35 @@ * */ +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/cardTableExtension.hpp" +#include "gc_implementation/parallelScavenge/gcTaskManager.hpp" +#include "gc_implementation/parallelScavenge/generationSizer.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweep.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +#include "gc_implementation/parallelScavenge/psTasks.hpp" +#include "gc_implementation/shared/isGCActiveMark.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "gc_interface/gcCause.hpp" +#include "memory/collectorPolicy.hpp" +#include "memory/gcLocker.inline.hpp" +#include "memory/referencePolicy.hpp" +#include "memory/referenceProcessor.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.psgc.inline.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/fprofiler.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/threadCritical.hpp" +#include "runtime/vmThread.hpp" +#include "runtime/vm_operations.hpp" +#include "services/memoryService.hpp" +#include "utilities/stack.inline.hpp" -# include "incls/_precompiled.incl" -# include "incls/_psScavenge.cpp.incl" HeapWord* PSScavenge::_to_space_top_before_gc = NULL; int PSScavenge::_consecutive_skipped_scavenges = 0; @@ -34,9 +60,10 @@ bool PSScavenge::_survivor_overflow = false; int PSScavenge::_tenuring_threshold = 0; HeapWord* PSScavenge::_young_generation_boundary = NULL; elapsedTimer PSScavenge::_accumulated_time; -GrowableArray* PSScavenge::_preserved_mark_stack = NULL; -GrowableArray* PSScavenge::_preserved_oop_stack = NULL; +Stack PSScavenge::_preserved_mark_stack; +Stack PSScavenge::_preserved_oop_stack; CollectorCounters* PSScavenge::_counters = NULL; +bool PSScavenge::_promotion_failed = false; // Define before use class PSIsAliveClosure: public BoolObjectClosure { @@ -223,6 +250,9 @@ bool PSScavenge::invoke_no_policy() { assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread"); + assert(_preserved_mark_stack.is_empty(), "should be empty"); + assert(_preserved_oop_stack.is_empty(), "should be empty"); + TimeStamp scavenge_entry; TimeStamp scavenge_midpoint; TimeStamp scavenge_exit; @@ -636,24 +666,20 @@ void PSScavenge::clean_up_failed_promotion() { young_gen->object_iterate(&unforward_closure); if (PrintGC && Verbose) { - gclog_or_tty->print_cr("Restoring %d marks", - _preserved_oop_stack->length()); + gclog_or_tty->print_cr("Restoring %d marks", _preserved_oop_stack.size()); } // Restore any saved marks. - for (int i=0; i < _preserved_oop_stack->length(); i++) { - oop obj = _preserved_oop_stack->at(i); - markOop mark = _preserved_mark_stack->at(i); + while (!_preserved_oop_stack.is_empty()) { + oop obj = _preserved_oop_stack.pop(); + markOop mark = _preserved_mark_stack.pop(); obj->set_mark(mark); } - // Deallocate the preserved mark and oop stacks. - // The stacks were allocated as CHeap objects, so - // we must call delete to prevent mem leaks. - delete _preserved_mark_stack; - _preserved_mark_stack = NULL; - delete _preserved_oop_stack; - _preserved_oop_stack = NULL; + // Clear the preserved mark and oop stack caches. + _preserved_mark_stack.clear(true); + _preserved_oop_stack.clear(true); + _promotion_failed = false; } // Reset the PromotionFailureALot counters. @@ -661,27 +687,18 @@ void PSScavenge::clean_up_failed_promotion() { } // This method is called whenever an attempt to promote an object -// fails. Some markOops will need preserving, some will not. Note +// fails. Some markOops will need preservation, some will not. Note // that the entire eden is traversed after a failed promotion, with // all forwarded headers replaced by the default markOop. This means // it is not neccessary to preserve most markOops. void PSScavenge::oop_promotion_failed(oop obj, markOop obj_mark) { - if (_preserved_mark_stack == NULL) { - ThreadCritical tc; // Lock and retest - if (_preserved_mark_stack == NULL) { - assert(_preserved_oop_stack == NULL, "Sanity"); - _preserved_mark_stack = new (ResourceObj::C_HEAP) GrowableArray(40, true); - _preserved_oop_stack = new (ResourceObj::C_HEAP) GrowableArray(40, true); - } - } - - // Because we must hold the ThreadCritical lock before using - // the stacks, we should be safe from observing partial allocations, - // which are also guarded by the ThreadCritical lock. + _promotion_failed = true; if (obj_mark->must_be_preserved_for_promotion_failure(obj)) { + // Should use per-worker private stakcs hetre rather than + // locking a common pair of stacks. ThreadCritical tc; - _preserved_oop_stack->push(obj); - _preserved_mark_stack->push(obj_mark); + _preserved_oop_stack.push(obj); + _preserved_mark_stack.push(obj_mark); } } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp index f41372bb0d4..f3e65a16689 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 (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_HPP + +#include "gc_implementation/parallelScavenge/cardTableExtension.hpp" +#include "gc_implementation/parallelScavenge/psVirtualspace.hpp" +#include "gc_implementation/shared/collectorCounters.hpp" +#include "memory/allocation.hpp" +#include "oops/oop.hpp" +#include "utilities/stack.hpp" + class GCTaskManager; class GCTaskQueue; class OopStack; @@ -61,9 +71,10 @@ class PSScavenge: AllStatic { static HeapWord* _young_generation_boundary; // The lowest address possible for the young_gen. // This is used to decide if an oop should be scavenged, // cards should be marked, etc. - static GrowableArray* _preserved_mark_stack; // List of marks to be restored after failed promotion - static GrowableArray* _preserved_oop_stack; // List of oops that need their mark restored. + static Stack _preserved_mark_stack; // List of marks to be restored after failed promotion + static Stack _preserved_oop_stack; // List of oops that need their mark restored. static CollectorCounters* _counters; // collector performance counters + static bool _promotion_failed; static void clean_up_failed_promotion(); @@ -79,8 +90,7 @@ class PSScavenge: AllStatic { // Accessors static int tenuring_threshold() { return _tenuring_threshold; } static elapsedTimer* accumulated_time() { return &_accumulated_time; } - static bool promotion_failed() - { return _preserved_mark_stack != NULL; } + static bool promotion_failed() { return _promotion_failed; } static int consecutive_skipped_scavenges() { return _consecutive_skipped_scavenges; } @@ -135,3 +145,5 @@ class PSScavenge: AllStatic { return result; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_HPP 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 3de87882fa5..5e67cf061ea 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 (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_INLINE_HPP + +#include "gc_implementation/parallelScavenge/cardTableExtension.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psPromotionManager.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.hpp" + inline void PSScavenge::save_to_space_top_before_gc() { ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); _to_space_top_before_gc = heap->young_gen()->to_space()->top(); @@ -77,3 +85,5 @@ inline void PSScavenge::copy_and_push_safe_barrier(PSPromotionManager* pm, } } } + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp index 11774d941f1..5b38abb59f3 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp @@ -22,8 +22,25 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_psTasks.cpp.incl" +#include "precompiled.hpp" +#include "classfile/systemDictionary.hpp" +#include "code/codeCache.hpp" +#include "gc_implementation/parallelScavenge/cardTableExtension.hpp" +#include "gc_implementation/parallelScavenge/gcTaskManager.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweep.hpp" +#include "gc_implementation/parallelScavenge/psPromotionManager.hpp" +#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.hpp" +#include "gc_implementation/parallelScavenge/psTasks.hpp" +#include "memory/iterator.hpp" +#include "memory/universe.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oop.psgc.inline.hpp" +#include "runtime/fprofiler.hpp" +#include "runtime/thread.hpp" +#include "runtime/vmThread.hpp" +#include "services/management.hpp" +#include "utilities/taskqueue.hpp" // // ScavengeRootsTask diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp index 3e60cc4f1b3..7ae5b21cb38 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP + +#include "memory/allocation.hpp" +#include "utilities/growableArray.hpp" + // // psTasks.hpp is a collection of GCTasks used by the // parallelScavenge collector. @@ -144,3 +150,5 @@ class OldToYoungRootsTask : public GCTask { virtual void do_it(GCTaskManager* manager, uint which); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp index 0368449dabb..8eba8939764 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,19 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_psVirtualspace.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/psVirtualspace.hpp" +#include "runtime/os.hpp" +#include "runtime/virtualspace.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "os_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "os_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "os_windows.inline.hpp" +#endif // PSVirtualSpace diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp index 583cc2558e1..da452cab0dc 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSVIRTUALSPACE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSVIRTUALSPACE_HPP + +#include "runtime/virtualspace.hpp" + // VirtualSpace for the parallel scavenge collector. // // VirtualSpace is data structure for committing a previously reserved address @@ -173,3 +178,5 @@ inline void PSVirtualSpace::set_committed(char* low_addr, char* high_addr) { _committed_low_addr = low_addr; _committed_high_addr = high_addr; } + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSVIRTUALSPACE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp index 4fda98889e8..b5e6462e746 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 (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,16 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_psYoungGen.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.hpp" +#include "gc_implementation/parallelScavenge/psYoungGen.hpp" +#include "gc_implementation/shared/gcUtil.hpp" +#include "gc_implementation/shared/mutableNUMASpace.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/java.hpp" PSYoungGen::PSYoungGen(size_t initial_size, size_t min_size, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp index 20809b39925..3d4c566378e 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,15 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSYOUNGGEN_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSYOUNGGEN_HPP + +#include "gc_implementation/parallelScavenge/objectStartArray.hpp" +#include "gc_implementation/parallelScavenge/psGenerationCounters.hpp" +#include "gc_implementation/parallelScavenge/psVirtualspace.hpp" +#include "gc_implementation/shared/mutableSpace.hpp" +#include "gc_implementation/shared/spaceCounters.hpp" + class PSMarkSweepDecorator; class PSYoungGen : public CHeapObj { @@ -188,3 +197,5 @@ class PSYoungGen : public CHeapObj { void record_spaces_top() PRODUCT_RETURN; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSYOUNGGEN_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp index 1b86df65083..453c791621b 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,14 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_vmPSOperations.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp" +#include "gc_implementation/parallelScavenge/psMarkSweep.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.hpp" +#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" +#include "gc_implementation/parallelScavenge/vmPSOperations.hpp" +#include "memory/gcLocker.inline.hpp" +#include "utilities/dtrace.hpp" // The following methods are used by the parallel scavenge collector VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp index e408a4e64c7..500a0db071a 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_VMPSOPERATIONS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_VMPSOPERATIONS_HPP + +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/shared/vmGCOperations.hpp" +#include "gc_interface/gcCause.hpp" + class VM_ParallelGCFailedAllocation: public VM_GC_Operation { private: size_t _size; @@ -63,3 +70,5 @@ class VM_ParallelGCSystemGC: public VM_GC_Operation { virtual VMOp_Type type() const { return VMOp_ParallelGCSystemGC; } virtual void doit(); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_VMPSOPERATIONS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp index 37090149550..bd8a393da18 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,9 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_VMSTRUCTS_PARALLELGC_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_VMSTRUCTS_PARALLELGC_HPP + #define VM_STRUCTS_PARALLELGC(nonstatic_field, \ static_field) \ \ @@ -93,3 +96,5 @@ declare_toplevel_type(ASPSOldGen*) \ declare_toplevel_type(PSPermGen*) \ declare_toplevel_type(ParallelScavengeHeap*) + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_VMSTRUCTS_PARALLELGC_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp b/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp index 60f2f1fd6da..4c933f85b09 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp @@ -21,9 +21,13 @@ * questions. * */ -#include "incls/_precompiled.incl" -#include "incls/_adaptiveSizePolicy.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/shared/adaptiveSizePolicy.hpp" +#include "gc_interface/gcCause.hpp" +#include "memory/collectorPolicy.hpp" +#include "runtime/timer.hpp" +#include "utilities/ostream.hpp" elapsedTimer AdaptiveSizePolicy::_minor_timer; elapsedTimer AdaptiveSizePolicy::_major_timer; diff --git a/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp b/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp index 6bf9da53b72..4822eb4bf89 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp @@ -22,6 +22,15 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_ADAPTIVESIZEPOLICY_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_ADAPTIVESIZEPOLICY_HPP + +#include "gc_implementation/shared/gcUtil.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "gc_interface/gcCause.hpp" +#include "memory/allocation.hpp" +#include "memory/universe.hpp" + // This class keeps statistical information and computes the // size of the heap. @@ -503,3 +512,5 @@ class AdaptiveSizePolicyOutput : StackObj { } } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_ADAPTIVESIZEPOLICY_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/ageTable.cpp b/hotspot/src/share/vm/gc_implementation/shared/ageTable.cpp index 189be92e80e..bc74db8f777 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/ageTable.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/ageTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 +22,17 @@ * */ +#include "precompiled.hpp" +#include "gc_implementation/shared/ageTable.hpp" +#include "gc_implementation/shared/gcPolicyCounters.hpp" +#include "memory/collectorPolicy.hpp" +#include "memory/resourceArea.hpp" +#include "memory/sharedHeap.hpp" +#include "utilities/copy.hpp" + /* Copyright (c) 1992-2009 Oracle and/or its affiliates, and Stanford University. See the LICENSE file for license information. */ -# include "incls/_precompiled.incl" -# include "incls/_ageTable.cpp.incl" - ageTable::ageTable(bool global) { clear(); diff --git a/hotspot/src/share/vm/gc_implementation/shared/ageTable.hpp b/hotspot/src/share/vm/gc_implementation/shared/ageTable.hpp index 5343e884405..d763157e4f2 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/ageTable.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/ageTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_AGETABLE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_AGETABLE_HPP + +#include "oops/markOop.hpp" +#include "oops/oop.hpp" +#include "runtime/perfData.hpp" + /* Copyright (c) 1992-2009 Oracle and/or its affiliates, and Stanford University. See the LICENSE file for license information. */ @@ -64,3 +71,5 @@ class ageTable VALUE_OBJ_CLASS_SPEC { private: PerfVariable* _perf_sizes[table_size]; }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_AGETABLE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp index 67dcac43b9a..c24fc3bbf1a 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 (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_allocationStats.cpp.incl" +#include "precompiled.hpp" +#ifndef SERIALGC +#include "gc_implementation/shared/allocationStats.hpp" +#include "utilities/ostream.hpp" +#endif // Technically this should be derived from machine speed, and // ideally it would be dynamically adjusted. diff --git a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp index 0ecf83e4cc8..b2d410ad617 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 (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,15 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_ALLOCATIONSTATS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_ALLOCATIONSTATS_HPP + +#ifndef SERIALGC +#include "gc_implementation/shared/gcUtil.hpp" +#include "memory/allocation.hpp" +#include "utilities/globalDefinitions.hpp" +#endif + class AllocationStats VALUE_OBJ_CLASS_SPEC { // A duration threshold (in ms) used to filter // possibly unreliable samples. @@ -157,3 +166,5 @@ class AllocationStats VALUE_OBJ_CLASS_SPEC { void set_returnedBytes(size_t v) { _returnedBytes = v; } ) }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_ALLOCATIONSTATS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp b/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp index e947845a782..e6820723007 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_cSpaceCounters.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/shared/cSpaceCounters.hpp" +#include "memory/resourceArea.hpp" CSpaceCounters::CSpaceCounters(const char* name, int ordinal, size_t max_size, ContiguousSpace* s, GenerationCounters* gc) : diff --git a/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.hpp b/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.hpp index 202968c61b6..d4a860eb842 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP + +#include "gc_implementation/shared/generationCounters.hpp" +#include "memory/space.inline.hpp" +#include "runtime/perfData.hpp" + // A CSpaceCounters is a holder class for performance counters // that track a space; @@ -75,3 +82,5 @@ class ContiguousSpaceUsedHelper : public PerfLongSampleHelper { return _space->used(); } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/collectorCounters.cpp b/hotspot/src/share/vm/gc_implementation/shared/collectorCounters.cpp index 83549a1919a..91dad5e66e1 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/collectorCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/collectorCounters.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_collectorCounters.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/shared/collectorCounters.hpp" +#include "memory/resourceArea.hpp" CollectorCounters::CollectorCounters(const char* name, int ordinal) { diff --git a/hotspot/src/share/vm/gc_implementation/shared/collectorCounters.hpp b/hotspot/src/share/vm/gc_implementation/shared/collectorCounters.hpp index 8713c8ff254..b793f7b24db 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/collectorCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/collectorCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_COLLECTORCOUNTERS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_COLLECTORCOUNTERS_HPP + +#include "runtime/perfData.hpp" + // CollectorCounters is a holder class for performance counters // that track a collector @@ -78,3 +83,5 @@ class TraceCollectorStats: public PerfTraceTimedEvent { if (UsePerfData) _c->last_exit_counter()->set_value(os::elapsed_counter()); } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_COLLECTORCOUNTERS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp index 65643f818b5..594e70abaa3 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,17 @@ * */ -// CopyrightVersion 1.2 +#include "precompiled.hpp" +#include "classfile/systemDictionary.hpp" +#include "gc_implementation/shared/concurrentGCThread.hpp" +#include "oops/instanceRefKlass.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/init.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/java.hpp" +#include "runtime/javaCalls.hpp" -# include "incls/_precompiled.incl" -# include "incls/_concurrentGCThread.cpp.incl" +// CopyrightVersion 1.2 int ConcurrentGCThread::_CGC_flag = CGC_nil; @@ -185,7 +192,7 @@ SurrogateLockerThread* SurrogateLockerThread::make(TRAPS) { instanceKlassHandle klass (THREAD, k); instanceHandle thread_oop = klass->allocate_instance_handle(CHECK_NULL); - const char thread_name[] = "Surrogate Locker Thread (CMS)"; + const char thread_name[] = "Surrogate Locker Thread (Concurrent GC)"; Handle string = java_lang_String::create_from_str(thread_name, CHECK_NULL); // Initialize thread_oop to put it into the system threadGroup diff --git a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp index f1cf29a8d3e..4f347b64fe7 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_CONCURRENTGCTHREAD_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_CONCURRENTGCTHREAD_HPP + +#ifndef SERIALGC +#include "runtime/thread.hpp" +#endif + class VoidClosure; // A SuspendibleThreadSet is (obviously) a set of threads that can be @@ -165,3 +172,5 @@ class SurrogateLockerThread: public JavaThread { void manipulatePLL(SLT_msg_type msg); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_CONCURRENTGCTHREAD_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp b/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp index bc9561e44d7..3d95950e834 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_gSpaceCounters.cpp.incl" +#include "precompiled.hpp" +#ifndef SERIALGC +#include "gc_implementation/shared/gSpaceCounters.hpp" +#include "memory/generation.hpp" +#include "memory/resourceArea.hpp" +#endif GSpaceCounters::GSpaceCounters(const char* name, int ordinal, size_t max_size, Generation* g, GenerationCounters* gc, diff --git a/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp b/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp index ed06ba75b61..85764c4f743 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,15 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GSPACECOUNTERS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GSPACECOUNTERS_HPP + +#ifndef SERIALGC +#include "gc_implementation/shared/generationCounters.hpp" +#include "memory/generation.hpp" +#include "runtime/perfData.hpp" +#endif + // A GSpaceCounter is a holder class for performance counters // that track a space; @@ -100,3 +109,5 @@ class GenerationUsedHelper : public PerfLongSampleHelper { return _gen->used(); } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GSPACECOUNTERS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.cpp b/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.cpp index 4a86761f7d6..fe4e8c35f62 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_gcAdaptivePolicyCounters.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp" +#include "memory/resourceArea.hpp" // This class keeps statistical information and computes the // size of the heap. diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp b/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp index 927caa43f0f..30e78244ac4 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCADAPTIVEPOLICYCOUNTERS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCADAPTIVEPOLICYCOUNTERS_HPP + +#ifndef SERIALGC +#include "gc_implementation/shared/adaptiveSizePolicy.hpp" +#include "gc_implementation/shared/gcPolicyCounters.hpp" +#endif + // This class keeps statistical information and computes the // size of the heap. @@ -222,3 +230,5 @@ class GCAdaptivePolicyCounters : public GCPolicyCounters { return GCPolicyCounters::GCAdaptivePolicyCountersKind; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCADAPTIVEPOLICYCOUNTERS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcPolicyCounters.cpp b/hotspot/src/share/vm/gc_implementation/shared/gcPolicyCounters.cpp index 00d15d38b28..23a710b97a6 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcPolicyCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcPolicyCounters.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_gcPolicyCounters.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/shared/gcPolicyCounters.hpp" +#include "memory/resourceArea.hpp" GCPolicyCounters::GCPolicyCounters(const char* name, int collectors, int generations) { diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcPolicyCounters.hpp b/hotspot/src/share/vm/gc_implementation/shared/gcPolicyCounters.hpp index 9c0670b3920..6d4494c0f4d 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcPolicyCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcPolicyCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCPOLICYCOUNTERS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCPOLICYCOUNTERS_HPP + +#include "runtime/perfData.hpp" + // GCPolicyCounters is a holder class for performance counters // that track a generation @@ -69,3 +74,5 @@ class GCPolicyCounters: public CHeapObj { return GCPolicyCounters::GCPolicyCountersKind; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCPOLICYCOUNTERS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcStats.cpp b/hotspot/src/share/vm/gc_implementation/shared/gcStats.cpp index ef65825e96a..faef280f632 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcStats.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcStats.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_gcStats.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/shared/gcStats.hpp" +#include "gc_implementation/shared/gcUtil.hpp" GCStats::GCStats() { _avg_promoted = new AdaptivePaddedNoZeroDevAverage( diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcStats.hpp b/hotspot/src/share/vm/gc_implementation/shared/gcStats.hpp index d99c84f958a..070300e9b1a 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcStats.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcStats.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCSTATS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCSTATS_HPP + +#include "gc_implementation/shared/gcUtil.hpp" + class GCStats : public CHeapObj { protected: // Avg amount promoted; used for avoiding promotion undo @@ -61,3 +66,5 @@ class CMSGCStats : public GCStats { return CMSGCStatsKind; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCSTATS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp index 4380641f3d5..267f73d3b99 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,8 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_gcUtil.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/shared/gcUtil.hpp" // Catch-all file for utility classes diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp index 97bd68313f8..8dd3258de0a 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,15 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCUTIL_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCUTIL_HPP + +#include "memory/allocation.hpp" +#include "runtime/timer.hpp" +#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/ostream.hpp" + // Catch-all file for utility classes // A weighted average maintains a running, weighted average @@ -206,3 +215,5 @@ class GCPauseTimer : StackObj { _timer->start(); } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCUTIL_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/generationCounters.cpp b/hotspot/src/share/vm/gc_implementation/shared/generationCounters.cpp index 143bf5b9680..4548189335c 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/generationCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/generationCounters.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,9 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_generationCounters.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/shared/generationCounters.hpp" +#include "memory/resourceArea.hpp" GenerationCounters::GenerationCounters(const char* name, diff --git a/hotspot/src/share/vm/gc_implementation/shared/generationCounters.hpp b/hotspot/src/share/vm/gc_implementation/shared/generationCounters.hpp index 4b1479945f2..4fd05e493dc 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/generationCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/generationCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP + +#include "runtime/perfData.hpp" +#include "runtime/virtualspace.hpp" + // A GenerationCounter is a holder class for performance counters // that track a generation @@ -60,3 +66,5 @@ class GenerationCounters: public CHeapObj { const char* name_space() const { return _name_space; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp b/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp index b09e7ef26b1..de081655685 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 (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,12 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_immutableSpace.cpp.incl" +#include "precompiled.hpp" +#ifndef SERIALGC +#include "gc_implementation/shared/immutableSpace.hpp" +#include "memory/universe.hpp" +#include "oops/oop.inline.hpp" +#endif void ImmutableSpace::initialize(MemRegion mr) { HeapWord* bottom = mr.start(); diff --git a/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.hpp b/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.hpp index 0c71e8e983b..bc5c1bd13b0 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 (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_IMMUTABLESPACE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_IMMUTABLESPACE_HPP + +#include "memory/iterator.hpp" + // An ImmutableSpace is a viewport into a contiguous range // (or subrange) of previously allocated objects. @@ -62,3 +67,5 @@ class ImmutableSpace: public CHeapObj { virtual void print_short() const PRODUCT_RETURN; virtual void verify(bool allow_dirty); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_IMMUTABLESPACE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp b/hotspot/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp index e7354d3767f..4d36417244c 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_ISGCACTIVEMARK_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_ISGCACTIVEMARK_HPP + +#ifndef SERIALGC +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#endif + // This class provides a method for block structured setting of the // _is_gc_active state without requiring accessors in CollectedHeap @@ -39,3 +46,5 @@ class IsGCActiveMark : public StackObj { heap->_is_gc_active = false; } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_ISGCACTIVEMARK_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/liveRange.hpp b/hotspot/src/share/vm/gc_implementation/shared/liveRange.hpp index d876f2467cf..1cf300a620a 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/liveRange.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/liveRange.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_LIVERANGE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_LIVERANGE_HPP + +#include "memory/memRegion.hpp" +#include "utilities/copy.hpp" + // This is a shared helper class used during phase 3 and 4 to move all the objects // Dead regions in a Space are linked together to keep track of the live regions // so that the live data can be traversed quickly without having to look at each @@ -46,3 +52,5 @@ public: Copy::aligned_conjoint_words(start(), destination, word_size()); } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_LIVERANGE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp index e6f1deec687..a72c715c0e3 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 (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,16 +22,21 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_markSweep.cpp.incl" +#include "precompiled.hpp" +#include "compiler/compileBroker.hpp" +#include "gc_implementation/shared/markSweep.inline.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/objArrayKlass.inline.hpp" +#include "oops/oop.inline.hpp" -GrowableArray* MarkSweep::_marking_stack = NULL; -GrowableArray* MarkSweep::_objarray_stack = NULL; -GrowableArray* MarkSweep::_revisit_klass_stack = NULL; -GrowableArray* MarkSweep::_revisit_mdo_stack = NULL; +Stack MarkSweep::_marking_stack; +Stack MarkSweep::_revisit_mdo_stack; +Stack MarkSweep::_revisit_klass_stack; +Stack MarkSweep::_objarray_stack; -GrowableArray* MarkSweep::_preserved_oop_stack = NULL; -GrowableArray* MarkSweep::_preserved_mark_stack= NULL; +Stack MarkSweep::_preserved_oop_stack; +Stack MarkSweep::_preserved_mark_stack; size_t MarkSweep::_preserved_count = 0; size_t MarkSweep::_preserved_count_max = 0; PreservedMark* MarkSweep::_preserved_marks = NULL; @@ -58,37 +63,42 @@ GrowableArray * MarkSweep::_last_gc_live_oops_size = NULL; #endif void MarkSweep::revisit_weak_klass_link(Klass* k) { - _revisit_klass_stack->push(k); + _revisit_klass_stack.push(k); } void MarkSweep::follow_weak_klass_links() { // All klasses on the revisit stack are marked at this point. // Update and follow all subklass, sibling and implementor links. if (PrintRevisitStats) { - gclog_or_tty->print_cr("#classes in system dictionary = %d", SystemDictionary::number_of_classes()); - gclog_or_tty->print_cr("Revisit klass stack length = %d", _revisit_klass_stack->length()); + gclog_or_tty->print_cr("#classes in system dictionary = %d", + SystemDictionary::number_of_classes()); + gclog_or_tty->print_cr("Revisit klass stack size = " SIZE_FORMAT, + _revisit_klass_stack.size()); } - for (int i = 0; i < _revisit_klass_stack->length(); i++) { - _revisit_klass_stack->at(i)->follow_weak_klass_links(&is_alive,&keep_alive); + while (!_revisit_klass_stack.is_empty()) { + Klass* const k = _revisit_klass_stack.pop(); + k->follow_weak_klass_links(&is_alive, &keep_alive); } follow_stack(); } void MarkSweep::revisit_mdo(DataLayout* p) { - _revisit_mdo_stack->push(p); + _revisit_mdo_stack.push(p); } void MarkSweep::follow_mdo_weak_refs() { // All strongly reachable oops have been marked at this point; // we can visit and clear any weak references from MDO's which // we memoized during the strong marking phase. - assert(_marking_stack->is_empty(), "Marking stack should be empty"); + assert(_marking_stack.is_empty(), "Marking stack should be empty"); if (PrintRevisitStats) { - gclog_or_tty->print_cr("#classes in system dictionary = %d", SystemDictionary::number_of_classes()); - gclog_or_tty->print_cr("Revisit MDO stack length = %d", _revisit_mdo_stack->length()); + gclog_or_tty->print_cr("#classes in system dictionary = %d", + SystemDictionary::number_of_classes()); + gclog_or_tty->print_cr("Revisit MDO stack size = " SIZE_FORMAT, + _revisit_mdo_stack.size()); } - for (int i = 0; i < _revisit_mdo_stack->length(); i++) { - _revisit_mdo_stack->at(i)->follow_weak_refs(&is_alive); + while (!_revisit_mdo_stack.is_empty()) { + _revisit_mdo_stack.pop()->follow_weak_refs(&is_alive); } follow_stack(); } @@ -106,41 +116,37 @@ void MarkSweep::MarkAndPushClosure::do_oop(narrowOop* p) { mark_and_push(p); } void MarkSweep::follow_stack() { do { - while (!_marking_stack->is_empty()) { - oop obj = _marking_stack->pop(); + while (!_marking_stack.is_empty()) { + oop obj = _marking_stack.pop(); assert (obj->is_gc_marked(), "p must be marked"); obj->follow_contents(); } // Process ObjArrays one at a time to avoid marking stack bloat. - if (!_objarray_stack->is_empty()) { - ObjArrayTask task = _objarray_stack->pop(); + if (!_objarray_stack.is_empty()) { + ObjArrayTask task = _objarray_stack.pop(); objArrayKlass* const k = (objArrayKlass*)task.obj()->blueprint(); k->oop_follow_contents(task.obj(), task.index()); } - } while (!_marking_stack->is_empty() || !_objarray_stack->is_empty()); + } while (!_marking_stack.is_empty() || !_objarray_stack.is_empty()); } MarkSweep::FollowStackClosure MarkSweep::follow_stack_closure; void MarkSweep::FollowStackClosure::do_void() { follow_stack(); } -// We preserve the mark which should be replaced at the end and the location that it -// will go. Note that the object that this markOop belongs to isn't currently at that -// address but it will be after phase4 +// We preserve the mark which should be replaced at the end and the location +// that it will go. Note that the object that this markOop belongs to isn't +// currently at that address but it will be after phase4 void MarkSweep::preserve_mark(oop obj, markOop mark) { - // we try to store preserved marks in the to space of the new generation since this - // is storage which should be available. Most of the time this should be sufficient - // space for the marks we need to preserve but if it isn't we fall back in using - // GrowableArrays to keep track of the overflow. + // We try to store preserved marks in the to space of the new generation since + // this is storage which should be available. Most of the time this should be + // sufficient space for the marks we need to preserve but if it isn't we fall + // back to using Stacks to keep track of the overflow. if (_preserved_count < _preserved_count_max) { _preserved_marks[_preserved_count++].init(obj, mark); } else { - if (_preserved_mark_stack == NULL) { - _preserved_mark_stack = new (ResourceObj::C_HEAP) GrowableArray(40, true); - _preserved_oop_stack = new (ResourceObj::C_HEAP) GrowableArray(40, true); - } - _preserved_mark_stack->push(mark); - _preserved_oop_stack->push(obj); + _preserved_mark_stack.push(mark); + _preserved_oop_stack.push(obj); } } @@ -151,8 +157,7 @@ void MarkSweep::AdjustPointerClosure::do_oop(oop* p) { adjust_pointer(p, _ void MarkSweep::AdjustPointerClosure::do_oop(narrowOop* p) { adjust_pointer(p, _is_root); } void MarkSweep::adjust_marks() { - assert(_preserved_oop_stack == NULL || - _preserved_oop_stack->length() == _preserved_mark_stack->length(), + assert( _preserved_oop_stack.size() == _preserved_mark_stack.size(), "inconsistent preserved oop stacks"); // adjust the oops we saved earlier @@ -161,21 +166,19 @@ void MarkSweep::adjust_marks() { } // deal with the overflow stack - if (_preserved_oop_stack) { - for (int i = 0; i < _preserved_oop_stack->length(); i++) { - oop* p = _preserved_oop_stack->adr_at(i); - adjust_pointer(p); - } + StackIterator iter(_preserved_oop_stack); + while (!iter.is_empty()) { + oop* p = iter.next_addr(); + adjust_pointer(p); } } void MarkSweep::restore_marks() { - assert(_preserved_oop_stack == NULL || - _preserved_oop_stack->length() == _preserved_mark_stack->length(), + assert(_preserved_oop_stack.size() == _preserved_mark_stack.size(), "inconsistent preserved oop stacks"); if (PrintGC && Verbose) { - gclog_or_tty->print_cr("Restoring %d marks", _preserved_count + - (_preserved_oop_stack ? _preserved_oop_stack->length() : 0)); + gclog_or_tty->print_cr("Restoring %d marks", + _preserved_count + _preserved_oop_stack.size()); } // restore the marks we saved earlier @@ -184,12 +187,10 @@ void MarkSweep::restore_marks() { } // deal with the overflow - if (_preserved_oop_stack) { - for (int i = 0; i < _preserved_oop_stack->length(); i++) { - oop obj = _preserved_oop_stack->at(i); - markOop mark = _preserved_mark_stack->at(i); - obj->set_mark(mark); - } + while (!_preserved_oop_stack.is_empty()) { + oop obj = _preserved_oop_stack.pop(); + markOop mark = _preserved_mark_stack.pop(); + obj->set_mark(mark); } } diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp index add0a966d86..b9aa6354748 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 (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,18 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP + +#include "gc_interface/collectedHeap.hpp" +#include "memory/universe.hpp" +#include "oops/markOop.hpp" +#include "oops/oop.hpp" +#include "runtime/timer.hpp" +#include "utilities/growableArray.hpp" +#include "utilities/stack.hpp" +#include "utilities/taskqueue.hpp" + class ReferenceProcessor; class DataLayout; @@ -104,23 +116,22 @@ class MarkSweep : AllStatic { friend class KeepAliveClosure; friend class VM_MarkSweep; friend void marksweep_init(); - friend class DataLayout; // // Vars // protected: // Traversal stacks used during phase1 - static GrowableArray* _marking_stack; - static GrowableArray* _objarray_stack; + static Stack _marking_stack; + static Stack _objarray_stack; // Stack for live klasses to revisit at end of marking phase - static GrowableArray* _revisit_klass_stack; + static Stack _revisit_klass_stack; // Set (stack) of MDO's to revisit at end of marking phase - static GrowableArray* _revisit_mdo_stack; + static Stack _revisit_mdo_stack; // Space for storing/restoring mark word - static GrowableArray* _preserved_mark_stack; - static GrowableArray* _preserved_oop_stack; + static Stack _preserved_mark_stack; + static Stack _preserved_oop_stack; static size_t _preserved_count; static size_t _preserved_count_max; static PreservedMark* _preserved_marks; @@ -249,3 +260,5 @@ public: _obj->set_mark(_mark); } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP 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 7570a9c097a..3381f8cb80a 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 (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_INLINE_HPP + +#include "gc_implementation/shared/markSweep.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "utilities/stack.inline.hpp" +#ifndef SERIALGC +#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#endif + inline void MarkSweep::mark_object(oop obj) { // some marks may contain information we need to preserve so we store them away // and overwrite the mark. We'll restore it at the end of markSweep. @@ -72,7 +82,7 @@ template inline void MarkSweep::mark_and_push(T* p) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); if (!obj->mark()->is_marked()) { mark_object(obj); - _marking_stack->push(obj); + _marking_stack.push(obj); } } } @@ -80,7 +90,7 @@ template inline void MarkSweep::mark_and_push(T* p) { void MarkSweep::push_objarray(oop obj, size_t index) { ObjArrayTask task(obj, index); assert(task.is_valid(), "bad ObjArrayTask"); - _objarray_stack->push(task); + _objarray_stack.push(task); } template inline void MarkSweep::adjust_pointer(T* p, bool isroot) { @@ -115,3 +125,5 @@ template inline void MarkSweep::KeepAliveClosure::do_oop_work(T* p) { #endif mark_and_push(p); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp index 22cace7a2ab..aacaf3553ad 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 (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,20 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_mutableNUMASpace.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/shared/mutableNUMASpace.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "memory/sharedHeap.hpp" +#include "oops/oop.inline.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment) { diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp index fed86886c26..7b70e6e29d9 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 (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,14 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLENUMASPACE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLENUMASPACE_HPP + +#ifndef SERIALGC +#include "gc_implementation/shared/gcUtil.hpp" +#include "gc_implementation/shared/mutableSpace.hpp" +#endif + /* * The NUMA-aware allocator (MutableNUMASpace) is basically a modification * of MutableSpace which preserves interfaces but implements different @@ -221,3 +229,5 @@ class MutableNUMASpace : public MutableSpace { virtual void set_top(HeapWord* value); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLENUMASPACE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp index 4fc51132a7c..41f63658252 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 (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,14 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_mutableSpace.cpp.incl" +#include "precompiled.hpp" +#ifndef SERIALGC +#include "gc_implementation/shared/mutableSpace.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/safepoint.hpp" +#include "runtime/thread.hpp" +#endif MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _top(NULL), _alignment(alignment) { assert(MutableSpace::alignment() >= 0 && diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp index 25f6ae63c6d..01fb23f050f 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 (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLESPACE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLESPACE_HPP + +#include "gc_implementation/shared/immutableSpace.hpp" +#include "memory/memRegion.hpp" +#include "utilities/copy.hpp" + // A MutableSpace is a subtype of ImmutableSpace that supports the // concept of allocation. This includes the concepts that a space may // be only partially full, and the querry methods that go with such @@ -136,3 +143,5 @@ class MutableSpace: public ImmutableSpace { virtual void print_short_on(outputStream* st) const; virtual void verify(bool allow_dirty); }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLESPACE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp b/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp index 0cd25818658..a5815c921cd 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_spaceCounters.cpp.incl" +#include "precompiled.hpp" +#ifndef SERIALGC +#include "gc_implementation/shared/spaceCounters.hpp" +#include "memory/resourceArea.hpp" +#endif SpaceCounters::SpaceCounters(const char* name, int ordinal, size_t max_size, MutableSpace* m, GenerationCounters* gc) : diff --git a/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp b/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp index 0f032bdf6f3..f75a9f26c1e 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,16 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_SPACECOUNTERS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_SPACECOUNTERS_HPP + +#ifndef SERIALGC +#include "gc_implementation/shared/generationCounters.hpp" +#include "gc_implementation/shared/immutableSpace.hpp" +#include "gc_implementation/shared/mutableSpace.hpp" +#include "runtime/perfData.hpp" +#endif + // A SpaceCounter is a holder class for performance counters // that track a space; @@ -75,3 +85,5 @@ class MutableSpaceUsedHelper: public PerfLongSampleHelper { return _m->used_in_bytes(); } }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_SPACECOUNTERS_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.cpp b/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.cpp index 83addff319a..2de5846ab1b 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,10 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_spaceDecorator.cpp.incl" +#include "precompiled.hpp" +#include "gc_implementation/shared/spaceDecorator.hpp" +#include "memory/space.inline.hpp" +#include "utilities/copy.hpp" // Catch-all file for utility classes diff --git a/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.hpp b/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.hpp index e5b923038a0..c41a5eb591b 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,13 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_SPACEDECORATOR_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_SPACEDECORATOR_HPP + +#include "gc_implementation/shared/mutableSpace.hpp" +#include "memory/space.hpp" +#include "utilities/globalDefinitions.hpp" + class SpaceDecorator: public AllStatic { public: // Initialization flags. @@ -139,3 +146,5 @@ class MutableSpaceMangler: public SpaceMangler { public: MutableSpaceMangler(MutableSpace* sp) : SpaceMangler(), _sp(sp) {} }; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_SPACEDECORATOR_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp index 7575e03ac43..350d6dbacb6 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 (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,9 +21,25 @@ * questions. * */ -# include "incls/_precompiled.incl" -# include "incls/_vmGCOperations.cpp.incl" +#include "precompiled.hpp" +#include "classfile/classLoader.hpp" +#include "classfile/javaClasses.hpp" +#include "gc_implementation/shared/vmGCOperations.hpp" +#include "memory/gcLocker.inline.hpp" +#include "memory/genCollectedHeap.hpp" +#include "memory/oopFactory.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/instanceRefKlass.hpp" +#include "prims/jvmtiExport.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/init.hpp" +#include "runtime/interfaceSupport.hpp" +#include "utilities/dtrace.hpp" +#include "utilities/preserveException.hpp" +#ifndef SERIALGC +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#endif HS_DTRACE_PROBE_DECL1(hotspot, gc__begin, bool); HS_DTRACE_PROBE_DECL(hotspot, gc__end); diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp index b3a202902a5..c7ee95f445b 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp @@ -22,6 +22,15 @@ * */ +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP + +#include "memory/heapInspection.hpp" +#include "runtime/handles.hpp" +#include "runtime/jniHandles.hpp" +#include "runtime/synchronizer.hpp" +#include "runtime/vm_operations.hpp" + // The following class hierarchy represents // a set of operations (VM_Operation) related to GC. // @@ -199,3 +208,16 @@ class VM_GenCollectForPermanentAllocation: public VM_GC_Operation { virtual void doit(); HeapWord* result() const { return _res; } }; + +class DTraceGCProbeMarker : public StackObj { +public: + DTraceGCProbeMarker(bool full) { + VM_GC_Operation::notify_gc_begin(full); + } + + ~DTraceGCProbeMarker() { + VM_GC_Operation::notify_gc_end(); + } +}; + +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp index 6fd9f0228c8..83a6777b7e2 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,23 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_collectedHeap.cpp.incl" +#include "precompiled.hpp" +#include "classfile/systemDictionary.hpp" +#include "gc_implementation/shared/vmGCOperations.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "gc_interface/collectedHeap.inline.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/init.hpp" +#include "services/heapDumper.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif #ifdef ASSERT @@ -34,7 +49,9 @@ size_t CollectedHeap::_filler_array_max_size = 0; // Memory state functions. -CollectedHeap::CollectedHeap() + +CollectedHeap::CollectedHeap() : _n_par_threads(0) + { const size_t max_len = size_t(arrayOopDesc::max_array_length(T_INT)); const size_t elements_per_word = HeapWordSize / sizeof(jint); diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp index c30989af6ce..c6070afb63c 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp @@ -22,6 +22,16 @@ * */ +#ifndef SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_HPP +#define SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_HPP + +#include "gc_interface/gcCause.hpp" +#include "memory/allocation.hpp" +#include "memory/barrierSet.hpp" +#include "runtime/handles.hpp" +#include "runtime/perfData.hpp" +#include "runtime/safepoint.hpp" + // A "CollectedHeap" is an implementation of a java heap for HotSpot. This // is an abstract class: there may be many different kinds of heaps. This // class defines the functions that a heap must implement, and contains @@ -59,6 +69,8 @@ class CollectedHeap : public CHeapObj { MemRegion _reserved; BarrierSet* _barrier_set; bool _is_gc_active; + int _n_par_threads; + unsigned int _total_collections; // ... started unsigned int _total_full_collections; // ... started NOT_PRODUCT(volatile size_t _promotion_failure_alot_count;) @@ -293,6 +305,12 @@ class CollectedHeap : public CHeapObj { } GCCause::Cause gc_cause() { return _gc_cause; } + // Number of threads currently working on GC tasks. + int n_par_threads() { return _n_par_threads; } + + // May be overridden to set additional parallelism. + virtual void set_par_threads(int t) { _n_par_threads = t; }; + // Preload classes into the shared portion of the heap, and then dump // that data to a file so that it can be loaded directly by another // VM (then terminate). @@ -606,6 +624,14 @@ class CollectedHeap : public CHeapObj { return (CIFireOOMAt > 1 && _fire_out_of_memory_count >= CIFireOOMAt); } #endif + + public: + // This is a convenience method that is used in cases where + // the actual number of GC worker threads is not pertinent but + // only whether there more than 0. Use of this method helps + // reduce the occurrence of ParallelGCThreads to uses where the + // actual number may be germane. + static bool use_parallel_gc_threads() { return ParallelGCThreads > 0; } }; // Class to set and reset the GC cause for a CollectedHeap. @@ -628,3 +654,5 @@ class GCCauseSetter : StackObj { _heap->set_gc_cause(_previous_cause); } }; + +#endif // SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_HPP diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp index 630ad4232b7..73f54d98130 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 (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,28 @@ * */ +#ifndef SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_INLINE_HPP +#define SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_INLINE_HPP + +#include "gc_interface/collectedHeap.hpp" +#include "memory/threadLocalAllocBuffer.inline.hpp" +#include "memory/universe.hpp" +#include "oops/arrayOop.hpp" +#include "prims/jvmtiExport.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/thread.hpp" +#include "services/lowMemoryDetector.hpp" +#include "utilities/copy.hpp" +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif + // Inline allocation implementations. void CollectedHeap::post_allocation_setup_common(KlassHandle klass, @@ -131,6 +153,7 @@ HeapWord* CollectedHeap::common_mem_allocate_noinit(size_t size, bool is_noref, check_for_non_bad_heap_word_value(result, size)); assert(!HAS_PENDING_EXCEPTION, "Unexpected exception, will result in uninitialized storage"); + THREAD->incr_allocated_bytes(size * HeapWordSize); return result; } @@ -368,3 +391,5 @@ inline void CollectedHeap::reset_promotion_should_fail() { reset_promotion_should_fail(&_promotion_failure_alot_count); } #endif // #ifndef PRODUCT + +#endif // SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_interface/gcCause.cpp b/hotspot/src/share/vm/gc_interface/gcCause.cpp index e96f55a86ee..5868cd9c958 100644 --- a/hotspot/src/share/vm/gc_interface/gcCause.cpp +++ b/hotspot/src/share/vm/gc_interface/gcCause.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,8 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_gcCause.cpp.incl" +#include "precompiled.hpp" +#include "gc_interface/gcCause.hpp" const char* GCCause::to_string(GCCause::Cause cause) { switch (cause) { diff --git a/hotspot/src/share/vm/gc_interface/gcCause.hpp b/hotspot/src/share/vm/gc_interface/gcCause.hpp index 6734afcb73b..af40d989350 100644 --- a/hotspot/src/share/vm/gc_interface/gcCause.hpp +++ b/hotspot/src/share/vm/gc_interface/gcCause.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,11 @@ * */ +#ifndef SHARE_VM_GC_INTERFACE_GCCAUSE_HPP +#define SHARE_VM_GC_INTERFACE_GCCAUSE_HPP + +#include "memory/allocation.hpp" + // // This class exposes implementation details of the various // collector(s), and we need to be very careful with it. If @@ -83,3 +88,5 @@ class GCCause : public AllStatic { // Return true if the GCCause is for a full collection. static bool is_for_full_collection(GCCause::Cause cause) PRODUCT_RETURN0; }; + +#endif // SHARE_VM_GC_INTERFACE_GCCAUSE_HPP diff --git a/hotspot/src/share/vm/includeDB_compiler1 b/hotspot/src/share/vm/includeDB_compiler1 deleted file mode 100644 index 18ff024df70..00000000000 --- a/hotspot/src/share/vm/includeDB_compiler1 +++ /dev/null @@ -1,450 +0,0 @@ -// -// Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// - -// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps! - -allocation.hpp c1_globals.hpp - -c1_CFGPrinter.cpp c1_CFGPrinter.hpp -c1_CFGPrinter.cpp c1_IR.hpp -c1_CFGPrinter.cpp c1_InstructionPrinter.hpp -c1_CFGPrinter.cpp c1_LIR.hpp -c1_CFGPrinter.cpp c1_LinearScan.hpp -c1_CFGPrinter.cpp c1_ValueStack.hpp - -c1_CFGPrinter.hpp c1_Compilation.hpp -c1_CFGPrinter.hpp c1_Instruction.hpp - -cardTableModRefBS.cpp c1_LIR.hpp -cardTableModRefBS.cpp c1_LIRGenerator.hpp - -c1_Canonicalizer.cpp c1_Canonicalizer.hpp -c1_Canonicalizer.cpp c1_InstructionPrinter.hpp -c1_Canonicalizer.cpp ciArray.hpp -c1_Canonicalizer.cpp sharedRuntime.hpp - -c1_Canonicalizer.hpp c1_Instruction.hpp - -c1_CodeStubs.hpp array.hpp -c1_CodeStubs.hpp c1_FrameMap.hpp -c1_CodeStubs.hpp c1_IR.hpp -c1_CodeStubs.hpp c1_Instruction.hpp -c1_CodeStubs.hpp c1_LIR.hpp -c1_CodeStubs.hpp c1_Runtime1.hpp - -c1_CodeStubs_.cpp c1_CodeStubs.hpp -c1_CodeStubs_.cpp c1_FrameMap.hpp -c1_CodeStubs_.cpp c1_LIRAssembler.hpp -c1_CodeStubs_.cpp c1_MacroAssembler.hpp -c1_CodeStubs_.cpp c1_Runtime1.hpp -c1_CodeStubs_.cpp g1SATBCardTableModRefBS.hpp -c1_CodeStubs_.cpp nativeInst_.hpp -c1_CodeStubs_.cpp sharedRuntime.hpp -c1_CodeStubs_.cpp vmreg_.inline.hpp - -c1_Compilation.cpp c1_CFGPrinter.hpp -c1_Compilation.cpp c1_Compilation.hpp -c1_Compilation.cpp c1_IR.hpp -c1_Compilation.cpp c1_LIRAssembler.hpp -c1_Compilation.cpp c1_LinearScan.hpp -c1_Compilation.cpp c1_MacroAssembler.hpp -c1_Compilation.cpp c1_ValueMap.hpp -c1_Compilation.cpp c1_ValueStack.hpp -c1_Compilation.cpp debugInfoRec.hpp -c1_Compilation.hpp ciEnv.hpp -c1_Compilation.hpp exceptionHandlerTable.hpp -c1_Compilation.hpp resourceArea.hpp - -c1_Compiler.cpp allocation.hpp -c1_Compiler.cpp allocation.inline.hpp -c1_Compiler.cpp arguments.hpp -c1_Compiler.cpp c1_Compilation.hpp -c1_Compiler.cpp c1_Compiler.hpp -c1_Compiler.cpp c1_FrameMap.hpp -c1_Compiler.cpp c1_GraphBuilder.hpp -c1_Compiler.cpp c1_LinearScan.hpp -c1_Compiler.cpp c1_MacroAssembler.hpp -c1_Compiler.cpp c1_Runtime1.hpp -c1_Compiler.cpp c1_ValueType.hpp -c1_Compiler.cpp compileBroker.hpp -c1_Compiler.cpp compilerOracle.hpp -c1_Compiler.cpp interfaceSupport.hpp -c1_Compiler.cpp linkResolver.hpp -c1_Compiler.cpp nativeLookup.hpp -c1_Compiler.cpp resourceArea.hpp -c1_Compiler.cpp sharedRuntime.hpp - -c1_Compiler.hpp abstractCompiler.hpp - -c1_Defs.cpp c1_Defs.hpp - -c1_Defs.hpp globalDefinitions.hpp -c1_Defs.hpp register_.hpp - -c1_Defs_.hpp generate_platform_dependent_include - -c1_FpuStackSim.hpp allocation.hpp -c1_FpuStackSim.hpp c1_FrameMap.hpp - -c1_FpuStackSim_.cpp array.hpp -c1_FpuStackSim_.cpp c1_FpuStackSim.hpp -c1_FpuStackSim_.cpp c1_FrameMap.hpp -c1_FpuStackSim_.cpp ostream.hpp - -c1_FpuStackSim_.hpp generate_platform_dependent_include - -c1_FrameMap.cpp c1_FrameMap.hpp -c1_FrameMap.cpp c1_LIR.hpp -c1_FrameMap.cpp sharedRuntime.hpp -c1_FrameMap.cpp vmreg_.inline.hpp - -c1_FrameMap.hpp allocation.hpp -c1_FrameMap.hpp assembler.hpp -c1_FrameMap.hpp c1_Defs.hpp -c1_FrameMap.hpp c1_LIR.hpp -c1_FrameMap.hpp frame.hpp -c1_FrameMap.hpp globalDefinitions.hpp -c1_FrameMap.hpp synchronizer.hpp -c1_FrameMap.hpp vmreg.hpp - -c1_FrameMap_.cpp c1_FrameMap.hpp -c1_FrameMap_.cpp c1_LIR.hpp -c1_FrameMap_.cpp sharedRuntime.hpp -c1_FrameMap_.cpp vmreg_.inline.hpp - -c1_FrameMap_.hpp generate_platform_dependent_include - -c1_globals.cpp c1_globals.hpp - -c1_globals.hpp c1_globals_.hpp -c1_globals.hpp c1_globals_.hpp -c1_globals.hpp globals.hpp - -c1_globals_.hpp globalDefinitions.hpp -c1_globals_.hpp macros.hpp - -c1_globals_.hpp globalDefinitions.hpp -c1_globals_.hpp macros.hpp - -c1_GraphBuilder.cpp bitMap.inline.hpp -c1_GraphBuilder.cpp bytecode.hpp -c1_GraphBuilder.cpp c1_CFGPrinter.hpp -c1_GraphBuilder.cpp c1_Canonicalizer.hpp -c1_GraphBuilder.cpp c1_Compilation.hpp -c1_GraphBuilder.cpp c1_GraphBuilder.hpp -c1_GraphBuilder.cpp c1_InstructionPrinter.hpp -c1_GraphBuilder.cpp ciField.hpp -c1_GraphBuilder.cpp ciKlass.hpp -c1_GraphBuilder.cpp sharedRuntime.hpp - -c1_GraphBuilder.hpp c1_IR.hpp -c1_GraphBuilder.hpp c1_Instruction.hpp -c1_GraphBuilder.hpp c1_ValueMap.hpp -c1_GraphBuilder.hpp c1_ValueStack.hpp -c1_GraphBuilder.hpp ciMethodData.hpp -c1_GraphBuilder.hpp ciStreams.hpp - -c1_IR.cpp bitMap.inline.hpp -c1_IR.cpp c1_Compilation.hpp -c1_IR.cpp c1_FrameMap.hpp -c1_IR.cpp c1_GraphBuilder.hpp -c1_IR.cpp c1_IR.hpp -c1_IR.cpp c1_InstructionPrinter.hpp -c1_IR.cpp c1_Optimizer.hpp - -c1_IR.hpp allocation.hpp -c1_IR.hpp c1_Instruction.hpp -c1_IR.hpp ciExceptionHandler.hpp -c1_IR.hpp ciMethod.hpp -c1_IR.hpp ciStreams.hpp - -c1_Instruction.cpp c1_IR.hpp -c1_Instruction.cpp c1_Instruction.hpp -c1_Instruction.cpp c1_InstructionPrinter.hpp -c1_Instruction.cpp c1_ValueStack.hpp -c1_Instruction.cpp ciObjArrayKlass.hpp -c1_Instruction.cpp ciTypeArrayKlass.hpp - -c1_Instruction.hpp c1_Compilation.hpp -c1_Instruction.hpp c1_LIR.hpp -c1_Instruction.hpp c1_ValueType.hpp -c1_Instruction.hpp ciField.hpp - -c1_InstructionPrinter.cpp c1_InstructionPrinter.hpp -c1_InstructionPrinter.cpp c1_ValueStack.hpp -c1_InstructionPrinter.cpp ciArray.hpp -c1_InstructionPrinter.cpp ciInstance.hpp -c1_InstructionPrinter.cpp ciObject.hpp - -c1_InstructionPrinter.hpp c1_IR.hpp -c1_InstructionPrinter.hpp c1_Instruction.hpp -c1_InstructionPrinter.hpp c1_Runtime1.hpp - -c1_LIR.cpp c1_InstructionPrinter.hpp -c1_LIR.cpp c1_LIR.hpp -c1_LIR.cpp c1_LIRAssembler.hpp -c1_LIR.cpp ciInstance.hpp -c1_LIR.cpp sharedRuntime.hpp - -c1_LIR.hpp c1_ValueType.hpp - -c1_LIRAssembler.cpp c1_Compilation.hpp -c1_LIRAssembler.cpp c1_Instruction.hpp -c1_LIRAssembler.cpp c1_InstructionPrinter.hpp -c1_LIRAssembler.cpp c1_LIRAssembler.hpp -c1_LIRAssembler.cpp c1_MacroAssembler.hpp -c1_LIRAssembler.cpp c1_ValueStack.hpp -c1_LIRAssembler.cpp ciInstance.hpp -c1_LIRAssembler.cpp nativeInst_.hpp -c1_LIRAssembler.cpp vmreg_.inline.hpp - -c1_LIRAssembler.hpp c1_CodeStubs.hpp -c1_LIRAssembler.hpp ciMethodData.hpp -c1_LIRAssembler.hpp methodDataOop.hpp -c1_LIRAssembler.hpp top.hpp - -c1_LIRAssembler_.cpp barrierSet.hpp -c1_LIRAssembler_.cpp c1_Compilation.hpp -c1_LIRAssembler_.cpp c1_LIRAssembler.hpp -c1_LIRAssembler_.cpp c1_MacroAssembler.hpp -c1_LIRAssembler_.cpp c1_Runtime1.hpp -c1_LIRAssembler_.cpp c1_ValueStack.hpp -c1_LIRAssembler_.cpp cardTableModRefBS.hpp -c1_LIRAssembler_.cpp ciArrayKlass.hpp -c1_LIRAssembler_.cpp ciInstance.hpp -c1_LIRAssembler_.cpp collectedHeap.hpp -c1_LIRAssembler_.cpp nativeInst_.hpp -c1_LIRAssembler_.cpp objArrayKlass.hpp -c1_LIRAssembler_.cpp sharedRuntime.hpp - -c1_LIRAssembler_.hpp generate_platform_dependent_include - -c1_LIRGenerator.cpp bitMap.inline.hpp -c1_LIRGenerator.cpp c1_Compilation.hpp -c1_LIRGenerator.cpp c1_FrameMap.hpp -c1_LIRGenerator.cpp c1_Instruction.hpp -c1_LIRGenerator.cpp c1_LIRAssembler.hpp -c1_LIRGenerator.cpp c1_LIRGenerator.hpp -c1_LIRGenerator.cpp c1_ValueStack.hpp -c1_LIRGenerator.cpp ciArrayKlass.hpp -c1_LIRGenerator.cpp ciCPCache.hpp -c1_LIRGenerator.cpp ciInstance.hpp -c1_LIRGenerator.cpp heapRegion.hpp -c1_LIRGenerator.cpp sharedRuntime.hpp -c1_LIRGenerator.cpp stubRoutines.hpp - -c1_LIRGenerator.hpp c1_Instruction.hpp -c1_LIRGenerator.hpp c1_LIR.hpp -c1_LIRGenerator.hpp ciMethodData.hpp -c1_LIRGenerator.hpp sizes.hpp - -c1_LIRGenerator_.cpp c1_Compilation.hpp -c1_LIRGenerator_.cpp c1_FrameMap.hpp -c1_LIRGenerator_.cpp c1_Instruction.hpp -c1_LIRGenerator_.cpp c1_LIRAssembler.hpp -c1_LIRGenerator_.cpp c1_LIRGenerator.hpp -c1_LIRGenerator_.cpp c1_Runtime1.hpp -c1_LIRGenerator_.cpp c1_ValueStack.hpp -c1_LIRGenerator_.cpp ciArray.hpp -c1_LIRGenerator_.cpp ciObjArrayKlass.hpp -c1_LIRGenerator_.cpp ciTypeArrayKlass.hpp -c1_LIRGenerator_.cpp sharedRuntime.hpp -c1_LIRGenerator_.cpp vmreg_.inline.hpp -c1_LIRGenerator_.cpp stubRoutines.hpp - - -c1_LinearScan.cpp bitMap.inline.hpp -c1_LinearScan.cpp c1_CFGPrinter.hpp -c1_LinearScan.cpp c1_CodeStubs.hpp -c1_LinearScan.cpp c1_Compilation.hpp -c1_LinearScan.cpp c1_FrameMap.hpp -c1_LinearScan.cpp c1_IR.hpp -c1_LinearScan.cpp c1_LIRGenerator.hpp -c1_LinearScan.cpp c1_LinearScan.hpp -c1_LinearScan.cpp c1_ValueStack.hpp -c1_LinearScan.cpp vmreg_.inline.hpp - -c1_LinearScan.hpp c1_FpuStackSim.hpp -c1_LinearScan.hpp c1_FrameMap.hpp -c1_LinearScan.hpp c1_IR.hpp -c1_LinearScan.hpp c1_Instruction.hpp -c1_LinearScan.hpp c1_LIR.hpp -c1_LinearScan.hpp c1_LIRGenerator.hpp - -c1_LinearScan_.cpp bitMap.inline.hpp -c1_LinearScan_.cpp c1_Instruction.hpp -c1_LinearScan_.cpp c1_LinearScan.hpp - -c1_LinearScan_.hpp generate_platform_dependent_include - -c1_MacroAssembler.hpp assembler.hpp -c1_MacroAssembler.hpp assembler_.inline.hpp - -c1_MacroAssembler_.cpp arrayOop.hpp -c1_MacroAssembler_.cpp biasedLocking.hpp -c1_MacroAssembler_.cpp c1_MacroAssembler.hpp -c1_MacroAssembler_.cpp c1_Runtime1.hpp -c1_MacroAssembler_.cpp collectedHeap.hpp -c1_MacroAssembler_.cpp interpreter.hpp -c1_MacroAssembler_.cpp markOop.hpp -c1_MacroAssembler_.cpp os.hpp -c1_MacroAssembler_.cpp stubRoutines.hpp -c1_MacroAssembler_.cpp synchronizer.hpp -c1_MacroAssembler_.cpp systemDictionary.hpp - -c1_MacroAssembler_.hpp generate_platform_dependent_include - -c1_Optimizer.cpp bitMap.inline.hpp -c1_Optimizer.cpp c1_Canonicalizer.hpp -c1_Optimizer.cpp c1_Optimizer.hpp -c1_Optimizer.cpp c1_ValueMap.hpp -c1_Optimizer.cpp c1_ValueSet.hpp -c1_Optimizer.cpp c1_ValueStack.hpp - -c1_Optimizer.hpp allocation.hpp -c1_Optimizer.hpp c1_IR.hpp -c1_Optimizer.hpp c1_Instruction.hpp - -c1_Runtime1.cpp allocation.inline.hpp -c1_Runtime1.cpp barrierSet.hpp -c1_Runtime1.cpp biasedLocking.hpp -c1_Runtime1.cpp bytecode.hpp -c1_Runtime1.cpp c1_CodeStubs.hpp -c1_Runtime1.cpp c1_Defs.hpp -c1_Runtime1.cpp c1_FrameMap.hpp -c1_Runtime1.cpp c1_LIRAssembler.hpp -c1_Runtime1.cpp c1_MacroAssembler.hpp -c1_Runtime1.cpp c1_Runtime1.hpp -c1_Runtime1.cpp codeBlob.hpp -c1_Runtime1.cpp codeBuffer.hpp -c1_Runtime1.cpp collectedHeap.hpp -c1_Runtime1.cpp compilationPolicy.hpp -c1_Runtime1.cpp compiledIC.hpp -c1_Runtime1.cpp copy.hpp -c1_Runtime1.cpp disassembler.hpp -c1_Runtime1.cpp events.hpp -c1_Runtime1.cpp interfaceSupport.hpp -c1_Runtime1.cpp interpreter.hpp -c1_Runtime1.cpp javaCalls.hpp -c1_Runtime1.cpp objArrayKlass.hpp -c1_Runtime1.cpp oop.inline.hpp -c1_Runtime1.cpp oopFactory.hpp -c1_Runtime1.cpp pcDesc.hpp -c1_Runtime1.cpp resourceArea.hpp -c1_Runtime1.cpp scopeDesc.hpp -c1_Runtime1.cpp sharedRuntime.hpp -c1_Runtime1.cpp systemDictionary.hpp -c1_Runtime1.cpp threadCritical.hpp -c1_Runtime1.cpp vframe.hpp -c1_Runtime1.cpp vframeArray.hpp -c1_Runtime1.cpp vmSymbols.hpp -c1_Runtime1.cpp vtableStubs.hpp - -c1_Runtime1.hpp allocation.hpp -c1_Runtime1.hpp c1_FrameMap.hpp -c1_Runtime1.hpp deoptimization.hpp -c1_Runtime1.hpp interpreter.hpp -c1_Runtime1.hpp stubs.hpp - -c1_Runtime1_.cpp c1_Defs.hpp -c1_Runtime1_.cpp c1_MacroAssembler.hpp -c1_Runtime1_.cpp c1_Runtime1.hpp -c1_Runtime1_.cpp compiledICHolderOop.hpp -c1_Runtime1_.cpp interpreter.hpp -c1_Runtime1_.cpp jvmtiExport.hpp -c1_Runtime1_.cpp nativeInst_.hpp -c1_Runtime1_.cpp oop.inline.hpp -c1_Runtime1_.cpp register_.hpp -c1_Runtime1_.cpp sharedRuntime.hpp -c1_Runtime1_.cpp signature.hpp -c1_Runtime1_.cpp vframeArray.hpp -c1_Runtime1_.cpp vmreg_.inline.hpp - -c1_ValueMap.cpp bitMap.inline.hpp -c1_ValueMap.cpp c1_Canonicalizer.hpp -c1_ValueMap.cpp c1_IR.hpp -c1_ValueMap.cpp c1_ValueMap.hpp - -c1_ValueMap.hpp allocation.hpp -c1_ValueMap.hpp c1_Instruction.hpp -c1_ValueMap.hpp c1_ValueSet.hpp - -c1_ValueSet.cpp c1_ValueSet.hpp - -c1_ValueSet.hpp allocation.hpp -c1_ValueSet.hpp bitMap.inline.hpp -c1_ValueSet.hpp c1_Instruction.hpp - -c1_ValueStack.cpp c1_IR.hpp -c1_ValueStack.cpp c1_InstructionPrinter.hpp -c1_ValueStack.cpp c1_ValueStack.hpp - -c1_ValueStack.hpp c1_Instruction.hpp -c1_ValueType.cpp c1_ValueType.hpp -c1_ValueType.cpp ciArray.hpp -c1_ValueType.cpp ciInstance.hpp -c1_ValueType.cpp ciNullObject.hpp - -c1_ValueType.hpp c1_Compilation.hpp -c1_ValueType.hpp ciConstant.hpp - -ciEnv.cpp c1_Runtime1.hpp - -codeBlob.cpp c1_Runtime1.hpp - -compileBroker.cpp c1_Compiler.hpp - -frame_.cpp c1_Runtime1.hpp -frame_.cpp vframeArray.hpp - -globals.cpp c1_globals.hpp - -globals.hpp c1_globals_.hpp -globals.hpp c1_globals_.hpp - -instanceKlass.cpp c1_Compiler.hpp - -interpreter_.cpp c1_Runtime1.hpp - -java.cpp c1_Compiler.hpp -java.cpp c1_Runtime1.hpp - -nativeInst_.cpp c1_Runtime1.hpp - -oopMap.cpp c1_Defs.hpp - -os_.cpp c1_Runtime1.hpp - -os_.cpp c1_Runtime1.hpp - -safepoint.cpp c1_globals.hpp - -sharedRuntime.cpp c1_Runtime1.hpp - -sharedRuntime_.cpp c1_Runtime1.hpp - -thread.cpp c1_Compiler.hpp - -top.hpp c1_globals.hpp - -vmStructs.hpp c1_Runtime1.hpp diff --git a/hotspot/src/share/vm/includeDB_compiler2 b/hotspot/src/share/vm/includeDB_compiler2 deleted file mode 100644 index 59e1794a873..00000000000 --- a/hotspot/src/share/vm/includeDB_compiler2 +++ /dev/null @@ -1,1164 +0,0 @@ -// -// Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -ad_.cpp adGlobals_.hpp -ad_.cpp ad_.hpp -ad_.cpp allocation.inline.hpp -ad_.cpp assembler.hpp -ad_.cpp assembler_.inline.hpp -ad_.cpp biasedLocking.hpp -ad_.cpp cfgnode.hpp -ad_.cpp collectedHeap.inline.hpp -ad_.cpp compiledICHolderOop.hpp -ad_.cpp growableArray.hpp -ad_.cpp locknode.hpp -ad_.cpp markOop.hpp -ad_.cpp methodOop.hpp -ad_.cpp nativeInst_.hpp -ad_.cpp oop.inline.hpp -ad_.cpp oop.inline2.hpp -ad_.cpp opcodes.hpp -ad_.cpp regalloc.hpp -ad_.cpp regmask.hpp -ad_.cpp runtime.hpp -ad_.cpp sharedRuntime.hpp -ad_.cpp stubRoutines.hpp -ad_.cpp vmreg.hpp -ad_.cpp vmreg_.inline.hpp - -ad_.hpp addnode.hpp -ad_.hpp machnode.hpp -ad_.hpp matcher.hpp -ad_.hpp opcodes.hpp -ad_.hpp regalloc.hpp -ad_.hpp resourceArea.hpp -ad_.hpp subnode.hpp -ad_.hpp vectornode.hpp - -ad__clone.cpp ad_.hpp - -ad__expand.cpp ad_.hpp - -ad__format.cpp ad_.hpp - -ad__gen.cpp ad_.hpp -ad__gen.cpp cfgnode.hpp -ad__gen.cpp locknode.hpp - -ad__misc.cpp ad_.hpp - -ad__peephole.cpp ad_.hpp - -ad__pipeline.cpp ad_.hpp - -addnode.cpp addnode.hpp -addnode.cpp allocation.inline.hpp -addnode.cpp cfgnode.hpp -addnode.cpp connode.hpp -addnode.cpp machnode.hpp -addnode.cpp mulnode.hpp -addnode.cpp phaseX.hpp -addnode.cpp subnode.hpp - -addnode.hpp node.hpp -addnode.hpp opcodes.hpp -addnode.hpp type.hpp - -adlcVMDeps.hpp allocation.hpp - -allocation.hpp c2_globals.hpp - -bcEscapeAnalyzer.cpp bcEscapeAnalyzer.hpp -bcEscapeAnalyzer.cpp bitMap.inline.hpp -bcEscapeAnalyzer.cpp bytecode.hpp -bcEscapeAnalyzer.cpp ciConstant.hpp -bcEscapeAnalyzer.cpp ciField.hpp -bcEscapeAnalyzer.cpp ciMethodBlocks.hpp -bcEscapeAnalyzer.cpp ciStreams.hpp - -bcEscapeAnalyzer.hpp allocation.hpp -bcEscapeAnalyzer.hpp ciMethod.hpp -bcEscapeAnalyzer.hpp ciMethodData.hpp -bcEscapeAnalyzer.hpp dependencies.hpp -bcEscapeAnalyzer.hpp growableArray.hpp -bcEscapeAnalyzer.hpp vectset.hpp - -block.cpp allocation.inline.hpp -block.cpp block.hpp -block.cpp cfgnode.hpp -block.cpp chaitin.hpp -block.cpp copy.hpp -block.cpp loopnode.hpp -block.cpp machnode.hpp -block.cpp matcher.hpp -block.cpp opcodes.hpp -block.cpp rootnode.hpp -block.cpp vectset.hpp - -block.hpp multnode.hpp -block.hpp node.hpp -block.hpp phase.hpp - -buildOopMap.cpp addnode.hpp -buildOopMap.cpp callnode.hpp -buildOopMap.cpp compile.hpp -buildOopMap.cpp machnode.hpp -buildOopMap.cpp matcher.hpp -buildOopMap.cpp oopMap.hpp -buildOopMap.cpp phase.hpp -buildOopMap.cpp regalloc.hpp -buildOopMap.cpp rootnode.hpp -buildOopMap.cpp vmreg_.inline.hpp - -bytecodeInfo.cpp callGenerator.hpp -bytecodeInfo.cpp compileLog.hpp -bytecodeInfo.cpp handles.inline.hpp -bytecodeInfo.cpp linkResolver.hpp -bytecodeInfo.cpp objArrayKlass.hpp -bytecodeInfo.cpp parse.hpp -bytecodeInfo.cpp systemDictionary.hpp -bytecodeInfo.cpp vmSymbols.hpp - -bytecodeInterpreter.hpp methodDataOop.hpp - -c2_globals.cpp c2_globals.hpp - -c2_globals.hpp c2_globals_.hpp -c2_globals.hpp c2_globals_.hpp -c2_globals.hpp globals.hpp - -c2_globals_.hpp globalDefinitions.hpp -c2_globals_.hpp macros.hpp - -c2_globals_.hpp globalDefinitions.hpp -c2_globals_.hpp macros.hpp - -c2_init_.cpp compile.hpp -c2_init_.cpp node.hpp - -c2compiler.cpp ad_.hpp -c2compiler.cpp c2compiler.hpp -c2compiler.cpp runtime.hpp - -c2compiler.hpp abstractCompiler.hpp - -callGenerator.cpp addnode.hpp -callGenerator.cpp bcEscapeAnalyzer.hpp -callGenerator.cpp callGenerator.hpp -callGenerator.cpp callnode.hpp -callGenerator.cpp cfgnode.hpp -callGenerator.cpp compileLog.hpp -callGenerator.cpp connode.hpp -callGenerator.cpp ciCPCache.hpp -callGenerator.cpp ciMethodHandle.hpp -callGenerator.cpp javaClasses.hpp -callGenerator.cpp parse.hpp -callGenerator.cpp rootnode.hpp -callGenerator.cpp runtime.hpp -callGenerator.cpp subnode.hpp - -callGenerator.hpp callnode.hpp -callGenerator.hpp compile.hpp -callGenerator.hpp deoptimization.hpp -callGenerator.hpp type.hpp - -callnode.cpp callnode.hpp -callnode.cpp bcEscapeAnalyzer.hpp -callnode.cpp escape.hpp -callnode.cpp locknode.hpp -callnode.cpp machnode.hpp -callnode.cpp matcher.hpp -callnode.cpp oopMap.hpp -callnode.cpp parse.hpp -callnode.cpp regalloc.hpp -callnode.cpp regmask.hpp -callnode.cpp rootnode.hpp -callnode.cpp runtime.hpp - -callnode.hpp connode.hpp -callnode.hpp mulnode.hpp -callnode.hpp multnode.hpp -callnode.hpp opcodes.hpp -callnode.hpp phaseX.hpp -callnode.hpp type.hpp - -cfgnode.cpp addnode.hpp -cfgnode.cpp allocation.inline.hpp -cfgnode.cpp cfgnode.hpp -cfgnode.cpp connode.hpp -cfgnode.cpp loopnode.hpp -cfgnode.cpp machnode.hpp -cfgnode.cpp mulnode.hpp -cfgnode.cpp objArrayKlass.hpp -cfgnode.cpp phaseX.hpp -cfgnode.cpp regmask.hpp -cfgnode.cpp runtime.hpp -cfgnode.cpp subnode.hpp -cfgnode.cpp systemDictionary.hpp - -cfgnode.hpp multnode.hpp -cfgnode.hpp node.hpp -cfgnode.hpp opcodes.hpp -cfgnode.hpp type.hpp - -chaitin.cpp addnode.hpp -chaitin.cpp allocation.inline.hpp -chaitin.cpp block.hpp -chaitin.cpp callnode.hpp -chaitin.cpp cfgnode.hpp -chaitin.cpp chaitin.hpp -chaitin.cpp coalesce.hpp -chaitin.cpp compileLog.hpp -chaitin.cpp connode.hpp -chaitin.cpp indexSet.hpp -chaitin.cpp machnode.hpp -chaitin.cpp memnode.hpp -chaitin.cpp oopMap.hpp -chaitin.cpp opcodes.hpp -chaitin.cpp rootnode.hpp - -chaitin.hpp connode.hpp -chaitin.hpp live.hpp -chaitin.hpp matcher.hpp -chaitin.hpp phase.hpp -chaitin.hpp port.hpp -chaitin.hpp regalloc.hpp -chaitin.hpp regmask.hpp -chaitin.hpp resourceArea.hpp -chaitin.hpp vmreg.hpp - -chaitin_.cpp chaitin.hpp -chaitin_.cpp machnode.hpp - -ciEnv.cpp compileLog.hpp -ciEnv.cpp runtime.hpp - -ciMethod.cpp bcEscapeAnalyzer.hpp -ciMethod.cpp ciTypeFlow.hpp -ciMethod.cpp methodOop.hpp - -ciTypeFlow.cpp allocation.inline.hpp -ciTypeFlow.cpp bytecode.hpp -ciTypeFlow.cpp bytecodes.hpp -ciTypeFlow.cpp ciConstant.hpp -ciTypeFlow.cpp ciField.hpp -ciTypeFlow.cpp ciMethod.hpp -ciTypeFlow.cpp ciMethodData.hpp -ciTypeFlow.cpp ciObjArrayKlass.hpp -ciTypeFlow.cpp ciStreams.hpp -ciTypeFlow.cpp ciTypeArrayKlass.hpp -ciTypeFlow.cpp ciTypeFlow.hpp -ciTypeFlow.cpp compileLog.hpp -ciTypeFlow.cpp deoptimization.hpp -ciTypeFlow.cpp growableArray.hpp - -ciTypeFlow.hpp ciEnv.hpp -ciTypeFlow.hpp ciKlass.hpp -ciTypeFlow.hpp ciMethodBlocks.hpp - -classes.cpp addnode.hpp -classes.cpp callnode.hpp -classes.cpp cfgnode.hpp -classes.cpp connode.hpp -classes.cpp divnode.hpp -classes.cpp locknode.hpp -classes.cpp loopnode.hpp -classes.cpp machnode.hpp -classes.cpp memnode.hpp -classes.cpp mulnode.hpp -classes.cpp multnode.hpp -classes.cpp node.hpp -classes.cpp rootnode.hpp -classes.cpp subnode.hpp -classes.cpp vectornode.hpp - -classes.hpp top.hpp - -coalesce.cpp allocation.inline.hpp -coalesce.cpp block.hpp -coalesce.cpp cfgnode.hpp -coalesce.cpp chaitin.hpp -coalesce.cpp coalesce.hpp -coalesce.cpp connode.hpp -coalesce.cpp indexSet.hpp -coalesce.cpp machnode.hpp -coalesce.cpp matcher.hpp -coalesce.cpp regmask.hpp - -coalesce.hpp phase.hpp - -compile.cpp ad_.hpp -compile.cpp addnode.hpp -compile.cpp arguments.hpp -compile.cpp assembler.hpp -compile.cpp block.hpp -compile.cpp c2compiler.hpp -compile.cpp callGenerator.hpp -compile.cpp callnode.hpp -compile.cpp cfgnode.hpp -compile.cpp chaitin.hpp -compile.cpp compile.hpp -compile.cpp compileLog.hpp -compile.cpp connode.hpp -compile.cpp copy.hpp -compile.cpp divnode.hpp -compile.cpp escape.hpp -compile.cpp exceptionHandlerTable.hpp -compile.cpp loopnode.hpp -compile.cpp machnode.hpp -compile.cpp macro.hpp -compile.cpp matcher.hpp -compile.cpp memnode.hpp -compile.cpp mulnode.hpp -compile.cpp nmethod.hpp -compile.cpp node.hpp -compile.cpp oopMap.hpp -compile.cpp opcodes.hpp -compile.cpp output.hpp -compile.cpp parse.hpp -compile.cpp phaseX.hpp -compile.cpp rootnode.hpp -compile.cpp runtime.hpp -compile.cpp signature.hpp -compile.cpp stringopts.hpp -compile.cpp stubRoutines.hpp -compile.cpp systemDictionary.hpp -compile.cpp timer.hpp -compile.cpp type.hpp -compile.cpp vectornode.hpp - -compile.hpp codeBuffer.hpp -compile.hpp compilerInterface.hpp -compile.hpp compilerOracle.hpp -compile.hpp debugInfoRec.hpp -compile.hpp deoptimization.hpp -compile.hpp dict.hpp -compile.hpp exceptionHandlerTable.hpp -compile.hpp idealGraphPrinter.hpp -compile.hpp phase.hpp -compile.hpp port.hpp -compile.hpp regmask.hpp -compile.hpp resourceArea.hpp -compile.hpp vectset.hpp -compile.hpp vmThread.hpp - -compileBroker.cpp c2compiler.hpp - -connode.cpp addnode.hpp -connode.cpp allocation.inline.hpp -connode.cpp compile.hpp -connode.cpp connode.hpp -connode.cpp machnode.hpp -connode.cpp matcher.hpp -connode.cpp memnode.hpp -connode.cpp phaseX.hpp -connode.cpp sharedRuntime.hpp -connode.cpp subnode.hpp - -connode.hpp node.hpp -connode.hpp opcodes.hpp -connode.hpp type.hpp - -deoptimization.cpp ad_.hpp - -dfa_.cpp ad_.hpp -dfa_.cpp matcher.hpp -dfa_.cpp opcodes.hpp - -dict.cpp allocation.inline.hpp -dict.cpp dict.hpp -dict.cpp resourceArea.hpp -dict.cpp thread.hpp - -dict.hpp port.hpp - -divnode.cpp addnode.hpp -divnode.cpp allocation.inline.hpp -divnode.cpp connode.hpp -divnode.cpp divnode.hpp -divnode.cpp machnode.hpp -divnode.cpp matcher.hpp -divnode.cpp mulnode.hpp -divnode.cpp phaseX.hpp -divnode.cpp subnode.hpp - -divnode.hpp multnode.hpp -divnode.hpp node.hpp -divnode.hpp opcodes.hpp -divnode.hpp type.hpp - -doCall.cpp addnode.hpp -doCall.cpp callGenerator.hpp -doCall.cpp ciCallSite.hpp -doCall.cpp ciCPCache.hpp -doCall.cpp ciMethodHandle.hpp -doCall.cpp cfgnode.hpp -doCall.cpp compileLog.hpp -doCall.cpp linkResolver.hpp -doCall.cpp mulnode.hpp -doCall.cpp nativeLookup.hpp -doCall.cpp parse.hpp -doCall.cpp rootnode.hpp -doCall.cpp runtime.hpp -doCall.cpp sharedRuntime.hpp -doCall.cpp subnode.hpp -doCall.cpp vmSymbols.hpp - -domgraph.cpp allocation.hpp -domgraph.cpp block.hpp -domgraph.cpp machnode.hpp -domgraph.cpp phaseX.hpp -domgraph.cpp rootnode.hpp -domgraph.cpp vectset.hpp - -escape.cpp allocation.hpp -escape.cpp bcEscapeAnalyzer.hpp -escape.cpp c2compiler.hpp -escape.cpp callnode.hpp -escape.cpp cfgnode.hpp -escape.cpp compile.hpp -escape.cpp escape.hpp -escape.cpp phaseX.hpp -escape.cpp rootnode.hpp -escape.cpp vectset.hpp - -escape.hpp addnode.hpp -escape.hpp growableArray.hpp -escape.hpp node.hpp - -frame.hpp adGlobals_.hpp - -gcm.cpp ad_.hpp -gcm.cpp allocation.inline.hpp -gcm.cpp block.hpp -gcm.cpp c2compiler.hpp -gcm.cpp callnode.hpp -gcm.cpp cfgnode.hpp -gcm.cpp deoptimization.hpp -gcm.cpp machnode.hpp -gcm.cpp opcodes.hpp -gcm.cpp phaseX.hpp -gcm.cpp rootnode.hpp -gcm.cpp runtime.hpp -gcm.cpp vectset.hpp - -generateOptoStub.cpp addnode.hpp -generateOptoStub.cpp callnode.hpp -generateOptoStub.cpp cfgnode.hpp -generateOptoStub.cpp compile.hpp -generateOptoStub.cpp connode.hpp -generateOptoStub.cpp locknode.hpp -generateOptoStub.cpp memnode.hpp -generateOptoStub.cpp mulnode.hpp -generateOptoStub.cpp node.hpp -generateOptoStub.cpp parse.hpp -generateOptoStub.cpp phaseX.hpp -generateOptoStub.cpp rootnode.hpp -generateOptoStub.cpp runtime.hpp -generateOptoStub.cpp type.hpp - -globals.hpp c2_globals_.hpp -globals.hpp c2_globals_.hpp - -globals.cpp c2_globals.hpp - -graphKit.cpp addnode.hpp -graphKit.cpp barrierSet.hpp -graphKit.cpp cardTableModRefBS.hpp -graphKit.cpp g1SATBCardTableModRefBS.hpp -graphKit.cpp collectedHeap.hpp -graphKit.cpp compileLog.hpp -graphKit.cpp deoptimization.hpp -graphKit.cpp graphKit.hpp -graphKit.cpp heapRegion.hpp -graphKit.cpp idealKit.hpp -graphKit.cpp locknode.hpp -graphKit.cpp machnode.hpp -graphKit.cpp parse.hpp -graphKit.cpp rootnode.hpp -graphKit.cpp runtime.hpp -graphKit.cpp sharedRuntime.hpp - -graphKit.hpp addnode.hpp -graphKit.hpp callnode.hpp -graphKit.hpp cfgnode.hpp -graphKit.hpp ciEnv.hpp -graphKit.hpp ciMethodData.hpp -graphKit.hpp divnode.hpp -graphKit.hpp compile.hpp -graphKit.hpp deoptimization.hpp -graphKit.hpp phaseX.hpp -graphKit.hpp mulnode.hpp -graphKit.hpp subnode.hpp -graphKit.hpp type.hpp - -idealKit.cpp addnode.hpp -idealKit.cpp callnode.hpp -idealKit.cpp cfgnode.hpp -idealKit.cpp idealKit.hpp -idealKit.cpp runtime.hpp - -idealKit.hpp addnode.hpp -idealKit.hpp cfgnode.hpp -idealKit.hpp connode.hpp -idealKit.hpp divnode.hpp -idealKit.hpp mulnode.hpp -idealKit.hpp phaseX.hpp -idealKit.hpp subnode.hpp -idealKit.hpp type.hpp - -ifg.cpp addnode.hpp -ifg.cpp allocation.inline.hpp -ifg.cpp block.hpp -ifg.cpp callnode.hpp -ifg.cpp cfgnode.hpp -ifg.cpp chaitin.hpp -ifg.cpp coalesce.hpp -ifg.cpp connode.hpp -ifg.cpp indexSet.hpp -ifg.cpp machnode.hpp -ifg.cpp memnode.hpp -ifg.cpp oopMap.hpp -ifg.cpp opcodes.hpp - -ifnode.cpp addnode.hpp -ifnode.cpp allocation.inline.hpp -ifnode.cpp cfgnode.hpp -ifnode.cpp connode.hpp -ifnode.cpp phaseX.hpp -ifnode.cpp runtime.hpp -ifnode.cpp subnode.hpp - -indexSet.cpp allocation.inline.hpp -indexSet.cpp chaitin.hpp -indexSet.cpp compile.hpp -indexSet.cpp indexSet.hpp -indexSet.cpp regmask.hpp - -indexSet.hpp allocation.hpp -indexSet.hpp compile.hpp -indexSet.hpp regmask.hpp -indexSet.hpp resourceArea.hpp - -interpreterRuntime.cpp runtime.hpp - -java.cpp compile.hpp -java.cpp compiledIC.hpp -java.cpp indexSet.hpp -java.cpp methodLiveness.hpp -java.cpp runtime.hpp - -lcm.cpp ad_.hpp -lcm.cpp allocation.inline.hpp -lcm.cpp block.hpp -lcm.cpp c2compiler.hpp -lcm.cpp callnode.hpp -lcm.cpp cfgnode.hpp -lcm.cpp machnode.hpp -lcm.cpp runtime.hpp - -library_call.cpp addnode.hpp -library_call.cpp callGenerator.hpp -library_call.cpp cfgnode.hpp -library_call.cpp compileLog.hpp -library_call.cpp idealKit.hpp -library_call.cpp mulnode.hpp -library_call.cpp nativeLookup.hpp -library_call.cpp objArrayKlass.hpp -library_call.cpp parse.hpp -library_call.cpp runtime.hpp -library_call.cpp sharedRuntime.hpp -library_call.cpp subnode.hpp -library_call.cpp systemDictionary.hpp -library_call.cpp vmSymbols.hpp - -live.cpp allocation.inline.hpp -live.cpp callnode.hpp -live.cpp chaitin.hpp -live.cpp live.hpp -live.cpp machnode.hpp - -live.hpp block.hpp -live.hpp indexSet.hpp -live.hpp phase.hpp -live.hpp port.hpp -live.hpp regmask.hpp -live.hpp vectset.hpp - -locknode.cpp locknode.hpp -locknode.cpp parse.hpp -locknode.cpp rootnode.hpp -locknode.cpp runtime.hpp - -locknode.hpp ad_.hpp -locknode.hpp node.hpp -locknode.hpp opcodes.hpp -locknode.hpp subnode.hpp - -loopTransform.cpp addnode.hpp -loopTransform.cpp allocation.inline.hpp -loopTransform.cpp callnode.hpp -loopTransform.cpp connode.hpp -loopTransform.cpp compileLog.hpp -loopTransform.cpp divnode.hpp -loopTransform.cpp loopnode.hpp -loopTransform.cpp mulnode.hpp -loopTransform.cpp rootnode.hpp -loopTransform.cpp runtime.hpp -loopTransform.cpp subnode.hpp - -loopUnswitch.cpp allocation.inline.hpp -loopUnswitch.cpp connode.hpp -loopUnswitch.cpp loopnode.hpp -loopUnswitch.cpp rootnode.hpp - -loopnode.cpp addnode.hpp -loopnode.cpp allocation.inline.hpp -loopnode.cpp callnode.hpp -loopnode.cpp ciMethodData.hpp -loopnode.cpp compileLog.hpp -loopnode.cpp connode.hpp -loopnode.cpp divnode.hpp -loopnode.cpp loopnode.hpp -loopnode.cpp mulnode.hpp -loopnode.cpp rootnode.hpp -loopnode.cpp superword.hpp -loopnode.cpp vectset.hpp - -loopnode.hpp cfgnode.hpp -loopnode.hpp multnode.hpp -loopnode.hpp phaseX.hpp -loopnode.hpp subnode.hpp -loopnode.hpp type.hpp - -loopopts.cpp addnode.hpp -loopopts.cpp allocation.inline.hpp -loopopts.cpp connode.hpp -loopopts.cpp divnode.hpp -loopopts.cpp loopnode.hpp -loopopts.cpp mulnode.hpp -loopopts.cpp rootnode.hpp -loopopts.cpp subnode.hpp - -machnode.cpp collectedHeap.hpp -machnode.cpp machnode.hpp -machnode.cpp regalloc.hpp - -machnode.hpp callnode.hpp -machnode.hpp matcher.hpp -machnode.hpp multnode.hpp -machnode.hpp node.hpp -machnode.hpp regmask.hpp - -macro.cpp addnode.hpp -macro.cpp callnode.hpp -macro.cpp cfgnode.hpp -macro.cpp compile.hpp -macro.cpp compileLog.hpp -macro.cpp connode.hpp -macro.cpp locknode.hpp -macro.cpp loopnode.hpp -macro.cpp macro.hpp -macro.cpp memnode.hpp -macro.cpp node.hpp -macro.cpp phaseX.hpp -macro.cpp rootnode.hpp -macro.cpp runtime.hpp -macro.cpp sharedRuntime.hpp -macro.cpp subnode.hpp -macro.cpp type.hpp -macro.cpp vectset.hpp -macro.hpp phase.hpp - -matcher.cpp ad_.hpp -matcher.cpp addnode.hpp -matcher.cpp allocation.inline.hpp -matcher.cpp atomic.hpp -matcher.cpp callnode.hpp -matcher.cpp connode.hpp -matcher.cpp hpi.hpp -matcher.cpp matcher.hpp -matcher.cpp memnode.hpp -matcher.cpp opcodes.hpp -matcher.cpp os.hpp -matcher.cpp regmask.hpp -matcher.cpp rootnode.hpp -matcher.cpp runtime.hpp -matcher.cpp type.hpp - -matcher.hpp node.hpp -matcher.hpp phaseX.hpp -matcher.hpp regmask.hpp -matcher.hpp resourceArea.hpp -matcher.hpp vectset.hpp - -memnode.cpp addnode.hpp -memnode.cpp allocation.inline.hpp -memnode.cpp cfgnode.hpp -memnode.cpp compile.hpp -memnode.cpp compileLog.hpp -memnode.cpp connode.hpp -memnode.cpp loopnode.hpp -memnode.cpp machnode.hpp -memnode.cpp matcher.hpp -memnode.cpp memnode.hpp -memnode.cpp mulnode.hpp -memnode.cpp objArrayKlass.hpp -memnode.cpp phaseX.hpp -memnode.cpp regmask.hpp -memnode.cpp systemDictionary.hpp - -memnode.hpp multnode.hpp -memnode.hpp node.hpp -memnode.hpp opcodes.hpp -memnode.hpp type.hpp - -methodLiveness.cpp allocation.inline.hpp -methodLiveness.cpp bytecode.hpp -methodLiveness.cpp bytecodes.hpp -methodLiveness.cpp ciStreams.hpp -methodLiveness.cpp methodLiveness.hpp - -methodLiveness.hpp bitMap.hpp -methodLiveness.hpp growableArray.hpp - -mulnode.cpp addnode.hpp -mulnode.cpp allocation.inline.hpp -mulnode.cpp connode.hpp -mulnode.cpp memnode.hpp -mulnode.cpp mulnode.hpp -mulnode.cpp phaseX.hpp -mulnode.cpp subnode.hpp - -mulnode.hpp node.hpp -mulnode.hpp opcodes.hpp -mulnode.hpp type.hpp - -multnode.cpp matcher.hpp -multnode.cpp multnode.hpp -multnode.cpp opcodes.hpp -multnode.cpp phaseX.hpp -multnode.cpp regmask.hpp -multnode.cpp type.hpp - -multnode.hpp node.hpp - -node.cpp allocation.inline.hpp -node.cpp cfgnode.hpp -node.cpp connode.hpp -node.cpp copy.hpp -node.cpp machnode.hpp -node.cpp matcher.hpp -node.cpp node.hpp -node.cpp opcodes.hpp -node.cpp regmask.hpp -node.cpp type.hpp -node.cpp vectset.hpp - -node.hpp compile.hpp -node.hpp port.hpp -node.hpp type.hpp -node.hpp vectset.hpp - -opcodes.cpp classes.hpp -opcodes.cpp globalDefinitions.hpp -opcodes.cpp no_precompiled_headers - -os_.cpp runtime.hpp - -os_.cpp runtime.hpp - -output.cpp allocation.inline.hpp -output.cpp assembler.inline.hpp -output.cpp callnode.hpp -output.cpp cfgnode.hpp -output.cpp compileBroker.hpp -output.cpp debugInfo.hpp -output.cpp debugInfoRec.hpp -output.cpp handles.inline.hpp -output.cpp locknode.hpp -output.cpp machnode.hpp -output.cpp oopMap.hpp -output.cpp output.hpp -output.cpp regalloc.hpp -output.cpp runtime.hpp -output.cpp subnode.hpp -output.cpp type.hpp -output.cpp xmlstream.hpp - -output.hpp ad_.hpp -output.hpp block.hpp -output.hpp node.hpp - -parse.hpp ciMethodData.hpp -parse.hpp ciTypeFlow.hpp -parse.hpp generateOopMap.hpp -parse.hpp graphKit.hpp -parse.hpp methodLiveness.hpp -parse.hpp subnode.hpp -parse.hpp vectset.hpp - -parse1.cpp addnode.hpp -parse1.cpp arguments.hpp -parse1.cpp compileLog.hpp -parse1.cpp copy.hpp -parse1.cpp handles.inline.hpp -parse1.cpp linkResolver.hpp -parse1.cpp locknode.hpp -parse1.cpp memnode.hpp -parse1.cpp methodOop.hpp -parse1.cpp parse.hpp -parse1.cpp rootnode.hpp -parse1.cpp runtime.hpp -parse1.cpp sharedRuntime.hpp - -parse2.cpp addnode.hpp -parse2.cpp ciMethodData.hpp -parse2.cpp compileLog.hpp -parse2.cpp deoptimization.hpp -parse2.cpp divnode.hpp -parse2.cpp linkResolver.hpp -parse2.cpp matcher.hpp -parse2.cpp memnode.hpp -parse2.cpp mulnode.hpp -parse2.cpp parse.hpp -parse2.cpp runtime.hpp -parse2.cpp sharedRuntime.hpp -parse2.cpp systemDictionary.hpp -parse2.cpp universe.inline.hpp -parse2.cpp vmSymbols.hpp - -parse3.cpp addnode.hpp -parse3.cpp compileLog.hpp -parse3.cpp deoptimization.hpp -parse3.cpp handles.inline.hpp -parse3.cpp linkResolver.hpp -parse3.cpp memnode.hpp -parse3.cpp objArrayKlass.hpp -parse3.cpp parse.hpp -parse3.cpp rootnode.hpp -parse3.cpp runtime.hpp -parse3.cpp subnode.hpp -parse3.cpp universe.inline.hpp - -parseHelper.cpp addnode.hpp -parseHelper.cpp compileLog.hpp -parseHelper.cpp memnode.hpp -parseHelper.cpp mulnode.hpp -parseHelper.cpp objArrayKlass.hpp -parseHelper.cpp parse.hpp -parseHelper.cpp rootnode.hpp -parseHelper.cpp runtime.hpp -parseHelper.cpp sharedRuntime.hpp -parseHelper.cpp systemDictionary.hpp - -phase.cpp compile.hpp -phase.cpp compileBroker.hpp -phase.cpp nmethod.hpp -phase.cpp node.hpp -phase.cpp phase.hpp - -phase.hpp port.hpp -phase.hpp timer.hpp - -phaseX.cpp allocation.inline.hpp -phaseX.cpp block.hpp -phaseX.cpp callnode.hpp -phaseX.cpp cfgnode.hpp -phaseX.cpp connode.hpp -phaseX.cpp loopnode.hpp -phaseX.cpp machnode.hpp -phaseX.cpp opcodes.hpp -phaseX.cpp phaseX.hpp -phaseX.cpp regalloc.hpp -phaseX.cpp rootnode.hpp - -phaseX.hpp dict.hpp -phaseX.hpp memnode.hpp -phaseX.hpp node.hpp -phaseX.hpp phase.hpp -phaseX.hpp resourceArea.hpp -phaseX.hpp type.hpp -phaseX.hpp vectset.hpp - -port.cpp port.hpp - -port.hpp top.hpp - -postaloc.cpp allocation.inline.hpp -postaloc.cpp chaitin.hpp -postaloc.cpp machnode.hpp - -reg_split.cpp addnode.hpp -reg_split.cpp allocation.inline.hpp -reg_split.cpp callnode.hpp -reg_split.cpp c2compiler.hpp -reg_split.cpp cfgnode.hpp -reg_split.cpp chaitin.hpp -reg_split.cpp loopnode.hpp -reg_split.cpp machnode.hpp -reg_split.cpp vectset.hpp - -regalloc.cpp regalloc.hpp - -regalloc.hpp block.hpp -regalloc.hpp matcher.hpp -regalloc.hpp phase.hpp -regalloc.hpp vmreg.hpp - -regmask.cpp ad_.hpp -regmask.cpp compile.hpp -regmask.cpp regmask.hpp - -regmask.hpp adGlobals_.hpp -regmask.hpp optoreg.hpp -regmask.hpp port.hpp -regmask.hpp vmreg.hpp - -rootnode.cpp allocation.inline.hpp -rootnode.cpp callnode.hpp -rootnode.cpp cfgnode.hpp -rootnode.cpp phaseX.hpp -rootnode.cpp regmask.hpp -rootnode.cpp rootnode.hpp -rootnode.cpp subnode.hpp -rootnode.cpp type.hpp - -rootnode.hpp loopnode.hpp - -runtime.cpp ad_.hpp -runtime.cpp addnode.hpp -runtime.cpp barrierSet.hpp -runtime.cpp bytecode.hpp -runtime.cpp callnode.hpp -runtime.cpp cfgnode.hpp -runtime.cpp collectedHeap.hpp -runtime.cpp compileBroker.hpp -runtime.cpp compiledIC.hpp -runtime.cpp compilerOracle.hpp -runtime.cpp connode.hpp -runtime.cpp copy.hpp -runtime.cpp fprofiler.hpp -runtime.cpp g1SATBCardTableModRefBS.hpp -runtime.cpp gcLocker.inline.hpp -runtime.cpp graphKit.hpp -runtime.cpp handles.inline.hpp -runtime.cpp heapRegion.hpp -runtime.cpp icBuffer.hpp -runtime.cpp interfaceSupport.hpp -runtime.cpp interpreter.hpp -runtime.cpp javaCalls.hpp -runtime.cpp linkResolver.hpp -runtime.cpp machnode.hpp -runtime.cpp matcher.hpp -runtime.cpp memnode.hpp -runtime.cpp mulnode.hpp -runtime.cpp nmethod.hpp -runtime.cpp objArrayKlass.hpp -runtime.cpp oop.inline.hpp -runtime.cpp oopFactory.hpp -runtime.cpp oopMap.hpp -runtime.cpp pcDesc.hpp -runtime.cpp preserveException.hpp -runtime.cpp runtime.hpp -runtime.cpp scopeDesc.hpp -runtime.cpp sharedRuntime.hpp -runtime.cpp signature.hpp -runtime.cpp subnode.hpp -runtime.cpp systemDictionary.hpp -runtime.cpp threadCritical.hpp -runtime.cpp vframe.hpp -runtime.cpp vframeArray.hpp -runtime.cpp vframe_hp.hpp -runtime.cpp vmSymbols.hpp -runtime.cpp vtableStubs.hpp - -runtime.hpp biasedLocking.hpp -runtime.hpp codeBlob.hpp -runtime.hpp deoptimization.hpp -runtime.hpp machnode.hpp -runtime.hpp type.hpp -runtime.hpp vframe.hpp - -runtime_.cpp adGlobals_.hpp -runtime_.cpp ad_.hpp -runtime_.cpp assembler.hpp -runtime_.cpp assembler_.inline.hpp -runtime_.cpp globalDefinitions.hpp -runtime_.cpp interfaceSupport.hpp -runtime_.cpp interpreter.hpp -runtime_.cpp nativeInst_.hpp -runtime_.cpp runtime.hpp -runtime_.cpp sharedRuntime.hpp -runtime_.cpp stubRoutines.hpp -runtime_.cpp systemDictionary.hpp -runtime_.cpp vframeArray.hpp -runtime_.cpp vmreg.hpp -runtime_.cpp vmreg_.inline.hpp - -set.cpp allocation.inline.hpp -set.cpp set.hpp - -set.hpp allocation.hpp -set.hpp port.hpp - -sharedRuntime_.cpp runtime.hpp - -split_if.cpp allocation.inline.hpp -split_if.cpp callnode.hpp -split_if.cpp connode.hpp -split_if.cpp loopnode.hpp - -stringopts.hpp phaseX.hpp -stringopts.hpp node.hpp - -stringopts.cpp addnode.hpp -stringopts.cpp callnode.hpp -stringopts.cpp callGenerator.hpp -stringopts.cpp compileLog.hpp -stringopts.cpp divnode.hpp -stringopts.cpp idealKit.hpp -stringopts.cpp graphKit.hpp -stringopts.cpp rootnode.hpp -stringopts.cpp runtime.hpp -stringopts.cpp subnode.hpp -stringopts.cpp stringopts.hpp - -stubGenerator_.cpp runtime.hpp - -stubRoutines.cpp runtime.hpp - -subnode.cpp addnode.hpp -subnode.cpp allocation.inline.hpp -subnode.cpp callnode.hpp -subnode.cpp cfgnode.hpp -subnode.cpp compileLog.hpp -subnode.cpp connode.hpp -subnode.cpp loopnode.hpp -subnode.cpp matcher.hpp -subnode.cpp mulnode.hpp -subnode.cpp opcodes.hpp -subnode.cpp phaseX.hpp -subnode.cpp sharedRuntime.hpp -subnode.cpp subnode.hpp - -subnode.hpp node.hpp -subnode.hpp opcodes.hpp -subnode.hpp type.hpp - -superword.cpp addnode.hpp -superword.cpp allocation.inline.hpp -superword.cpp callnode.hpp -superword.cpp compileLog.hpp -superword.cpp divnode.hpp -superword.cpp matcher.hpp -superword.cpp memnode.hpp -superword.cpp mulnode.hpp -superword.cpp opcodes.hpp -superword.cpp superword.hpp -superword.cpp vectornode.hpp -superword.cpp vectset.hpp - -superword.hpp connode.hpp -superword.hpp growableArray.hpp -superword.hpp loopnode.hpp -superword.hpp node.hpp -superword.hpp phaseX.hpp -superword.hpp vectornode.hpp - -thread.cpp c2compiler.hpp - -top.hpp c2_globals.hpp - -type.cpp ciTypeFlow.hpp -type.cpp compileLog.hpp -type.cpp dict.hpp -type.cpp gcLocker.hpp -type.cpp instanceKlass.hpp -type.cpp klassKlass.hpp -type.cpp matcher.hpp -type.cpp node.hpp -type.cpp objArrayKlass.hpp -type.cpp oopFactory.hpp -type.cpp opcodes.hpp -type.cpp resourceArea.hpp -type.cpp symbolTable.hpp -type.cpp systemDictionary.hpp -type.cpp type.hpp -type.cpp typeArrayKlass.hpp - -type.hpp adlcVMDeps.hpp -type.hpp handles.hpp -type.hpp port.hpp - -vectornode.cpp allocation.inline.hpp -vectornode.cpp connode.hpp -vectornode.cpp vectornode.hpp - -vectornode.hpp matcher.hpp -vectornode.hpp memnode.hpp -vectornode.hpp node.hpp -vectornode.hpp opcodes.hpp - -vectset.cpp allocation.inline.hpp -vectset.cpp vectset.hpp - -vectset.hpp set.hpp - -vframeArray.cpp runtime.hpp - -vframe_hp.cpp matcher.hpp - -vmStructs.cpp adGlobals_.hpp -vmStructs.cpp matcher.hpp - -vmreg.hpp adGlobals_.hpp -vmreg.hpp adlcVMDeps.hpp -vmreg.hpp ostream.hpp - -vtableStubs.cpp matcher.hpp - -vtableStubs_.cpp ad_.hpp -vtableStubs_.cpp runtime.hpp - -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 -idealGraphPrinter.cpp machnode.hpp -idealGraphPrinter.cpp parse.hpp -idealGraphPrinter.cpp threadCritical.hpp - -compile.cpp idealGraphPrinter.hpp -thread.cpp idealGraphPrinter.hpp -phaseX.cpp idealGraphPrinter.hpp -parse2.cpp idealGraphPrinter.hpp -parse1.cpp idealGraphPrinter.hpp -matcher.cpp idealGraphPrinter.hpp -loopnode.cpp idealGraphPrinter.hpp -chaitin.cpp idealGraphPrinter.hpp diff --git a/hotspot/src/share/vm/includeDB_core b/hotspot/src/share/vm/includeDB_core deleted file mode 100644 index faf7843fcb2..00000000000 --- a/hotspot/src/share/vm/includeDB_core +++ /dev/null @@ -1,4757 +0,0 @@ -// -// Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps! - - -// includeDB format: -// a comment starts with '// ' and goes to the end of the line -// anything else is a pair of filenames. The line "x.cpp y.hpp" means -// "x.cpp must include y.hpp". Similarly, "y.hpp z.hpp" means "any file including -// y.hpp must also include z.hpp, and z.hpp must be included before y.hpp". -// -// Style hint: we try to keep the entries ordered alphabetically, both -// globally (left-hand sides) and within a given file (right-hand sides) -// -// To avoid unnecessary conflicts with the work of other programmers, -// do not delete, move, or reformat pre-existing lines. Do not attempt -// to "optimize" this file incrementally. -// -// ============ Platform dependent include files =========== -// -// Some header files occur in clusters. Header files which depend -// on the token "generate_platform_dependent_include" are included -// directly by other header files, and should not be explicitly declared -// as dependencies. Header files named H.inline.hpp generally contain -// bodies for inline functions declared in H.hpp. -// -// NOTE: Files that use the token "generate_platform_dependent_include" -// are expected to contain macro references like , , ... and -// makedeps has a dependency on these platform files looking like: -// foo_.trailing_string -// (where "trailing_string" can be any legal filename strings but typically -// is "hpp" or "inline.hpp"). -// -// The dependency in makedeps (and enforced) is that an underscore -// will precedure the macro invocation. Note that this restriction -// is only enforced on filenames that have the dependency token -// "generate_platform_dependent_include" so other files using macro -// expansion (typically .cpp files) have no requirement to have -// an underscore precede the macro although this is encouraged for -// readibility. -// -// ======= Circular dependencies and inline functions ========== -// -// (Sometimes, circular dependencies prevent complex function bodies -// from being defined directly in H.hpp. In such cases, a client S.cpp -// of H.hpp must always declare a dependency on H.inline.hpp, which in -// turn will declare a dependency on H.hpp. If by some mischance S.cpp -// declares a dependency on H.hpp, the compiler may complain about missing -// inline function bodies, or (perhaps) the program may fail to link. -// The solution is to have S.cpp depend on H.inline.hpp instead of H.hpp. -// -// Generally, if in response to a source code change the compiler -// issues an error in a file F (which may be either a header or a -// source file), you should consider if the error arises from a missing -// class definition C. If that is the case, find the header file H which -// contains C (often, H=C.hpp, but you may have to search for C's definition). -// Then, add a line to the includeDB file as appropriate. -// -// -// Here are some typical compiler errors that may require changes to includeDB. -// (Messages are taken from Sun's SPARC compiler.) -// -// "klassVtable.cpp", line 96: Error: No_GC_Verifier is not defined. -// Source code: -// No_GC_Verifier no_gc; -// -// The problem is that the class name No_GC_Verifier is not declared, -// so the compiler is confused by the syntax. The solution: -// klassVtable.cpp gcLocker.hpp -// -// Sometimes the compiler has only partial knowledge about a class: -// "privilegedStack.cpp", line 60: Error: cast is not a member of instanceKlass. -// Source code: -// if (_protection_domain != instanceKlass::cast(method->method_holder())->protection_domain()) return false; -// -// Here, instanceKlass is known to the compiler as a type, because of a -// forward declaration somewhere ("class instanceKlass;"). The problem -// is that the compiler has not seen the body of instanceKlass, and so it -// complains that it does not know about "instanceKlass::cast". Solution: -// privilegedStack.cpp instanceKlass.hpp -// -// Here's another example of a missing declaration: -// "privilegedStack.cpp", line 111: Error: The function AllocateHeap must have a prototype. -// Source code: -// _array = NEW_C_HEAP_ARRAY(PrivilegedElement, initial_size); -// -// The problem is that the macro call expands to use a heap function -// which is defined (for technical reasons) in a different file. Solution: -// privilegedStack.cpp allocation.inline.hpp -// The macro is defined in allocation.hpp, while the function is -// defined (as an inline) in allocation.inline.hpp. Generally, if you -// find you need a header H.hpp, and there is also a header -// H.inline.hpp use the latter, because it contains inline definitions -// you will require. - -abstractCompiler.cpp abstractCompiler.hpp -abstractCompiler.cpp mutexLocker.hpp - -abstractCompiler.hpp compilerInterface.hpp - -abstractInterpreter.hpp bytecodes.hpp -abstractInterpreter.hpp interp_masm_.hpp -abstractInterpreter.hpp stubs.hpp -abstractInterpreter.hpp thread_.inline.hpp -abstractInterpreter.hpp top.hpp -abstractInterpreter.hpp vmThread.hpp - -accessFlags.cpp accessFlags.hpp -accessFlags.cpp oop.inline.hpp -accessFlags.cpp os_.inline.hpp - -accessFlags.hpp jvm.h -accessFlags.hpp top.hpp - -allocation.cpp allocation.hpp -allocation.cpp allocation.inline.hpp -allocation.cpp os.hpp -allocation.cpp os_.inline.hpp -allocation.cpp ostream.hpp -allocation.cpp resourceArea.hpp -allocation.cpp task.hpp -allocation.cpp threadCritical.hpp - -allocation.hpp globalDefinitions.hpp -allocation.hpp globals.hpp - -allocation.inline.hpp os.hpp - -aprofiler.cpp aprofiler.hpp -aprofiler.cpp collectedHeap.inline.hpp -aprofiler.cpp oop.inline.hpp -aprofiler.cpp oop.inline2.hpp -aprofiler.cpp permGen.hpp -aprofiler.cpp resourceArea.hpp -aprofiler.cpp space.hpp -aprofiler.cpp systemDictionary.hpp - -aprofiler.hpp allocation.hpp -aprofiler.hpp klass.hpp -aprofiler.hpp klassOop.hpp -aprofiler.hpp top.hpp -aprofiler.hpp universe.hpp - -arguments.cpp allocation.inline.hpp -arguments.cpp arguments.hpp -arguments.cpp cardTableRS.hpp -arguments.cpp compilerOracle.hpp -arguments.cpp defaultStream.hpp -arguments.cpp globals_extension.hpp -arguments.cpp java.hpp -arguments.cpp javaAssertions.hpp -arguments.cpp jvmtiExport.hpp -arguments.cpp management.hpp -arguments.cpp oop.inline.hpp -arguments.cpp os_.inline.hpp -arguments.cpp referenceProcessor.hpp -arguments.cpp taskqueue.hpp -arguments.cpp universe.inline.hpp -arguments.cpp vm_version_.hpp - -arguments.hpp java.hpp -arguments.hpp perfData.hpp -arguments.hpp top.hpp - -array.cpp array.hpp -array.cpp resourceArea.hpp -array.cpp thread_.inline.hpp - -array.hpp allocation.hpp -array.hpp allocation.inline.hpp - -arrayKlass.cpp arrayKlass.hpp -arrayKlass.cpp arrayKlassKlass.hpp -arrayKlass.cpp arrayOop.hpp -arrayKlass.cpp collectedHeap.inline.hpp -arrayKlass.cpp gcLocker.hpp -arrayKlass.cpp instanceKlass.hpp -arrayKlass.cpp javaClasses.hpp -arrayKlass.cpp jvmti.h -arrayKlass.cpp objArrayOop.hpp -arrayKlass.cpp oop.inline.hpp -arrayKlass.cpp systemDictionary.hpp -arrayKlass.cpp universe.inline.hpp -arrayKlass.cpp vmSymbols.hpp - -arrayKlass.hpp klass.hpp -arrayKlass.hpp klassOop.hpp -arrayKlass.hpp klassVtable.hpp -arrayKlass.hpp universe.hpp - -arrayKlassKlass.cpp arrayKlassKlass.hpp -arrayKlassKlass.cpp handles.inline.hpp -arrayKlassKlass.cpp javaClasses.hpp -arrayKlassKlass.cpp markSweep.inline.hpp -arrayKlassKlass.cpp oop.inline.hpp - -arrayKlassKlass.hpp arrayKlass.hpp -arrayKlassKlass.hpp klassKlass.hpp - -arrayOop.cpp arrayOop.hpp -arrayOop.cpp objArrayOop.hpp -arrayOop.cpp oop.inline.hpp -arrayOop.cpp symbolOop.hpp - -arrayOop.hpp oop.hpp -arrayOop.hpp universe.inline.hpp - -assembler.cpp assembler.hpp -assembler.cpp assembler.inline.hpp -assembler.cpp assembler_.inline.hpp -assembler.cpp codeBuffer.hpp -assembler.cpp icache.hpp -assembler.cpp os.hpp - -assembler.hpp allocation.hpp -assembler.hpp debug.hpp -assembler.hpp growableArray.hpp -assembler.hpp oopRecorder.hpp -assembler.hpp register_.hpp -assembler.hpp relocInfo.hpp -assembler.hpp top.hpp -assembler.hpp vm_version_.hpp - -assembler.inline.hpp assembler.hpp -assembler.inline.hpp codeBuffer.hpp -assembler.inline.hpp disassembler.hpp -assembler.inline.hpp threadLocalStorage.hpp - -assembler_.cpp assembler_.inline.hpp -assembler_.cpp biasedLocking.hpp -assembler_.cpp cardTableModRefBS.hpp -assembler_.cpp collectedHeap.inline.hpp -assembler_.cpp interfaceSupport.hpp -assembler_.cpp interpreter.hpp -assembler_.cpp methodHandles.hpp -assembler_.cpp objectMonitor.hpp -assembler_.cpp os.hpp -assembler_.cpp resourceArea.hpp -assembler_.cpp sharedRuntime.hpp -assembler_.cpp stubRoutines.hpp - -assembler_.hpp generate_platform_dependent_include - -assembler_.inline.hpp assembler.inline.hpp -assembler_.inline.hpp codeBuffer.hpp -assembler_.inline.hpp codeCache.hpp -assembler_.inline.hpp handles.inline.hpp - -assembler_.cpp assembler.hpp -assembler_.cpp assembler_.inline.hpp -assembler_.cpp os.hpp -assembler_.cpp threadLocalStorage.hpp - -atomic.cpp atomic.hpp -atomic.cpp atomic_.inline.hpp -atomic.cpp os_.inline.hpp - -atomic.hpp allocation.hpp - -atomic_.inline.hpp atomic.hpp -atomic_.inline.hpp os.hpp -atomic_.inline.hpp vm_version_.hpp -atomic_.inline.hpp orderAccess_.inline.hpp - -// attachListener is jck optional, put cpp deps in includeDB_features - -attachListener.hpp allocation.hpp -attachListener.hpp debug.hpp -attachListener.hpp ostream.hpp - -barrierSet.cpp barrierSet.inline.hpp -barrierSet.cpp collectedHeap.hpp -barrierSet.cpp universe.hpp - -barrierSet.hpp memRegion.hpp -barrierSet.hpp oopsHierarchy.hpp - -barrierSet.inline.hpp barrierSet.hpp -barrierSet.inline.hpp cardTableModRefBS.hpp - -biasedLocking.cpp biasedLocking.hpp -biasedLocking.cpp klass.inline.hpp -biasedLocking.cpp markOop.hpp -biasedLocking.cpp synchronizer.hpp -biasedLocking.cpp task.hpp -biasedLocking.cpp vframe.hpp -biasedLocking.cpp vmThread.hpp -biasedLocking.cpp vm_operations.hpp - -biasedLocking.hpp growableArray.hpp -biasedLocking.hpp handles.hpp - -bitMap.cpp allocation.inline.hpp -bitMap.cpp bitMap.inline.hpp -bitMap.cpp copy.hpp -bitMap.cpp os_.inline.hpp - -bitMap.hpp allocation.hpp -bitMap.hpp top.hpp - -bitMap.inline.hpp atomic.hpp -bitMap.inline.hpp bitMap.hpp - -blockOffsetTable.cpp blockOffsetTable.inline.hpp -blockOffsetTable.cpp collectedHeap.inline.hpp -blockOffsetTable.cpp iterator.hpp -blockOffsetTable.cpp java.hpp -blockOffsetTable.cpp oop.inline.hpp -blockOffsetTable.cpp space.inline.hpp -blockOffsetTable.cpp universe.hpp - -blockOffsetTable.hpp globalDefinitions.hpp -blockOffsetTable.hpp memRegion.hpp -blockOffsetTable.hpp virtualspace.hpp - -blockOffsetTable.inline.hpp blockOffsetTable.hpp -blockOffsetTable.inline.hpp safepoint.hpp -blockOffsetTable.inline.hpp space.hpp - -bytecode.cpp bytecode.hpp -bytecode.cpp constantPoolOop.hpp -bytecode.cpp fieldType.hpp -bytecode.cpp handles.inline.hpp -bytecode.cpp linkResolver.hpp -bytecode.cpp oop.inline.hpp -bytecode.cpp safepoint.hpp -bytecode.cpp signature.hpp - -bytecode.hpp allocation.hpp -bytecode.hpp bytecodes.hpp -bytecode.hpp bytes_.hpp -bytecode.hpp methodOop.hpp - -bytecodeHistogram.cpp bytecodeHistogram.hpp -bytecodeHistogram.cpp growableArray.hpp -bytecodeHistogram.cpp os.hpp -bytecodeHistogram.cpp resourceArea.hpp - -bytecodeHistogram.hpp allocation.hpp -bytecodeHistogram.hpp bytecodes.hpp - -bytecodeInterpreter.cpp no_precompiled_headers -bytecodeInterpreter.cpp bytecodeHistogram.hpp -bytecodeInterpreter.cpp bytecodeInterpreter.hpp -bytecodeInterpreter.cpp bytecodeInterpreter.inline.hpp -bytecodeInterpreter.cpp cardTableModRefBS.hpp -bytecodeInterpreter.cpp collectedHeap.hpp -bytecodeInterpreter.cpp exceptions.hpp -bytecodeInterpreter.cpp frame.inline.hpp -bytecodeInterpreter.cpp handles.inline.hpp -bytecodeInterpreter.cpp interfaceSupport.hpp -bytecodeInterpreter.cpp interpreterRuntime.hpp -bytecodeInterpreter.cpp interpreter.hpp -bytecodeInterpreter.cpp jvmtiExport.hpp -bytecodeInterpreter.cpp objArrayKlass.hpp -bytecodeInterpreter.cpp oop.inline.hpp -bytecodeInterpreter.cpp orderAccess_.inline.hpp -bytecodeInterpreter.cpp resourceArea.hpp -bytecodeInterpreter.cpp sharedRuntime.hpp -bytecodeInterpreter.cpp threadCritical.hpp -bytecodeInterpreter.cpp vmSymbols.hpp - -bytecodeInterpreter_.cpp assembler.hpp -bytecodeInterpreter_.cpp bytecodeInterpreter.hpp -bytecodeInterpreter_.cpp bytecodeInterpreter.inline.hpp -bytecodeInterpreter_.cpp debug.hpp -bytecodeInterpreter_.cpp deoptimization.hpp -bytecodeInterpreter_.cpp frame.inline.hpp -bytecodeInterpreter_.cpp interp_masm_.hpp -bytecodeInterpreter_.cpp interpreterRuntime.hpp -bytecodeInterpreter_.cpp interpreter.hpp -bytecodeInterpreter_.cpp jvmtiExport.hpp -bytecodeInterpreter_.cpp jvmtiThreadState.hpp -bytecodeInterpreter_.cpp methodDataOop.hpp -bytecodeInterpreter_.cpp methodOop.hpp -bytecodeInterpreter_.cpp oop.inline.hpp -bytecodeInterpreter_.cpp sharedRuntime.hpp -bytecodeInterpreter_.cpp stubRoutines.hpp -bytecodeInterpreter_.cpp synchronizer.hpp -bytecodeInterpreter_.cpp vframeArray.hpp - -bytecodeInterpreterWithChecks.cpp bytecodeInterpreter.cpp - -bytecodeInterpreter.hpp allocation.hpp -bytecodeInterpreter.hpp bytes_.hpp -bytecodeInterpreter.hpp frame.hpp -bytecodeInterpreter.hpp globalDefinitions.hpp -bytecodeInterpreter.hpp globals.hpp -bytecodeInterpreter.hpp methodDataOop.hpp -bytecodeInterpreter.hpp methodOop.hpp -bytecodeInterpreter.hpp synchronizer.hpp - -bytecodeInterpreter.inline.hpp bytecodeInterpreter.hpp -bytecodeInterpreter.inline.hpp stubRoutines.hpp - -bytecodeInterpreter_.hpp generate_platform_dependent_include - -bytecodeInterpreter_.inline.hpp generate_platform_dependent_include - -bytecodeStream.cpp bytecodeStream.hpp -bytecodeStream.cpp bytecodes.hpp - -bytecodeStream.hpp allocation.hpp -bytecodeStream.hpp bytecode.hpp -bytecodeStream.hpp bytes_.hpp -bytecodeStream.hpp methodOop.hpp - -bytecodeTracer.cpp bytecodeHistogram.hpp -bytecodeTracer.cpp bytecodeTracer.hpp -bytecodeTracer.cpp bytecodes.hpp -bytecodeTracer.cpp interpreter.hpp -bytecodeTracer.cpp interpreterRuntime.hpp -bytecodeTracer.cpp methodDataOop.hpp -bytecodeTracer.cpp methodOop.hpp -bytecodeTracer.cpp mutexLocker.hpp -bytecodeTracer.cpp resourceArea.hpp -bytecodeTracer.cpp timer.hpp - -bytecodeTracer.hpp allocation.hpp - -bytecodes.cpp bytecodes.hpp -bytecodes.cpp bytes_.hpp -bytecodes.cpp methodOop.hpp -bytecodes.cpp resourceArea.hpp - -bytecodes.hpp allocation.hpp -bytecodes.hpp top.hpp - -bytecodes_.cpp bytecodes.hpp - -bytecodes_.hpp generate_platform_dependent_include - -bytes_.hpp allocation.hpp - -bytes_.inline.hpp generate_platform_dependent_include - -cardTableModRefBS.cpp allocation.inline.hpp -cardTableModRefBS.cpp cardTableModRefBS.hpp -cardTableModRefBS.cpp cardTableRS.hpp -cardTableModRefBS.cpp java.hpp -cardTableModRefBS.cpp mutexLocker.hpp -cardTableModRefBS.cpp sharedHeap.hpp -cardTableModRefBS.cpp space.hpp -cardTableModRefBS.cpp space.inline.hpp -cardTableModRefBS.cpp universe.hpp -cardTableModRefBS.cpp virtualspace.hpp - -cardTableModRefBS.hpp modRefBarrierSet.hpp -cardTableModRefBS.hpp oop.hpp -cardTableModRefBS.hpp oop.inline2.hpp - -cardTableRS.cpp allocation.inline.hpp -cardTableRS.cpp cardTableRS.hpp -cardTableRS.cpp genCollectedHeap.hpp -cardTableRS.cpp generation.hpp -cardTableRS.cpp java.hpp -cardTableRS.cpp oop.inline.hpp -cardTableRS.cpp os.hpp -cardTableRS.cpp space.hpp - -cardTableRS.hpp cardTableModRefBS.hpp -cardTableRS.hpp genRemSet.hpp -cardTableRS.hpp memRegion.hpp - -ciArray.cpp ciArray.hpp -ciArray.cpp ciKlass.hpp -ciArray.cpp ciUtilities.hpp - -ciArray.hpp arrayOop.hpp -ciArray.hpp ciObject.hpp -ciArray.hpp objArrayOop.hpp -ciArray.hpp typeArrayOop.hpp - -ciArrayKlass.cpp ciArrayKlass.hpp -ciArrayKlass.cpp ciObjArrayKlass.hpp -ciArrayKlass.cpp ciTypeArrayKlass.hpp -ciArrayKlass.cpp ciUtilities.hpp - -ciArrayKlass.hpp ciKlass.hpp - -ciArrayKlassKlass.hpp ciKlassKlass.hpp - -ciCallProfile.hpp ciClassList.hpp - -ciCallSite.cpp ciCallSite.hpp -ciCallSite.cpp ciUtilities.hpp - -ciCallSite.hpp ciInstance.hpp - -ciConstant.cpp allocation.hpp -ciConstant.cpp allocation.inline.hpp -ciConstant.cpp ciConstant.hpp -ciConstant.cpp ciUtilities.hpp - -ciConstant.hpp ciClassList.hpp -ciConstant.hpp ciNullObject.hpp - -ciConstantPoolCache.cpp allocation.hpp -ciConstantPoolCache.cpp allocation.inline.hpp -ciConstantPoolCache.cpp ciConstantPoolCache.hpp -ciConstantPoolCache.cpp ciUtilities.hpp - -ciConstantPoolCache.hpp growableArray.hpp -ciConstantPoolCache.hpp resourceArea.hpp - -ciCPCache.cpp cpCacheOop.hpp -ciCPCache.cpp ciCPCache.hpp -ciCPCache.cpp ciUtilities.hpp - -ciCPCache.hpp ciClassList.hpp -ciCPCache.hpp ciObject.hpp -ciCPCache.hpp cpCacheOop.hpp - -ciEnv.cpp allocation.inline.hpp -ciEnv.cpp ciConstant.hpp -ciEnv.cpp ciEnv.hpp -ciEnv.cpp ciField.hpp -ciEnv.cpp ciInstance.hpp -ciEnv.cpp ciInstanceKlass.hpp -ciEnv.cpp ciInstanceKlassKlass.hpp -ciEnv.cpp ciMethod.hpp -ciEnv.cpp ciNullObject.hpp -ciEnv.cpp ciObjArrayKlassKlass.hpp -ciEnv.cpp ciTypeArrayKlassKlass.hpp -ciEnv.cpp ciUtilities.hpp -ciEnv.cpp collectedHeap.inline.hpp -ciEnv.cpp compileBroker.hpp -ciEnv.cpp compileLog.hpp -ciEnv.cpp compilerOracle.hpp -ciEnv.cpp dtrace.hpp -ciEnv.cpp init.hpp -ciEnv.cpp jvmtiExport.hpp -ciEnv.cpp linkResolver.hpp -ciEnv.cpp methodDataOop.hpp -ciEnv.cpp objArrayKlass.hpp -ciEnv.cpp oop.inline.hpp -ciEnv.cpp oop.inline2.hpp -ciEnv.cpp oopFactory.hpp -ciEnv.cpp reflection.hpp -ciEnv.cpp scopeDesc.hpp -ciEnv.cpp sharedRuntime.hpp -ciEnv.cpp systemDictionary.hpp -ciEnv.cpp universe.inline.hpp -ciEnv.cpp vmSymbols.hpp - -ciEnv.hpp ciClassList.hpp -ciEnv.hpp ciObjectFactory.hpp -ciEnv.hpp debugInfoRec.hpp -ciEnv.hpp dependencies.hpp -ciEnv.hpp exceptionHandlerTable.hpp -ciEnv.hpp oopMap.hpp -ciEnv.hpp systemDictionary.hpp -ciEnv.hpp thread.hpp - -ciExceptionHandler.cpp ciExceptionHandler.hpp -ciExceptionHandler.cpp ciUtilities.hpp - -ciExceptionHandler.hpp ciClassList.hpp -ciExceptionHandler.hpp ciInstanceKlass.hpp - -ciField.cpp ciField.hpp -ciField.cpp ciInstanceKlass.hpp -ciField.cpp ciUtilities.hpp -ciField.cpp collectedHeap.inline.hpp -ciField.cpp fieldDescriptor.hpp -ciField.cpp linkResolver.hpp -ciField.cpp oop.inline.hpp -ciField.cpp oop.inline2.hpp -ciField.cpp systemDictionary.hpp -ciField.cpp universe.inline.hpp - -ciField.hpp ciClassList.hpp -ciField.hpp ciConstant.hpp -ciField.hpp ciFlags.hpp -ciField.hpp ciInstance.hpp - -ciFlags.cpp ciFlags.hpp - -ciFlags.hpp accessFlags.hpp -ciFlags.hpp allocation.hpp -ciFlags.hpp ciClassList.hpp -ciFlags.hpp jvm.h - -ciInstance.cpp ciConstant.hpp -ciInstance.cpp ciField.hpp -ciInstance.cpp ciInstance.hpp -ciInstance.cpp ciInstanceKlass.hpp -ciInstance.cpp ciUtilities.hpp -ciInstance.cpp oop.inline.hpp -ciInstance.cpp systemDictionary.hpp - -ciInstance.hpp ciObject.hpp -ciInstance.hpp instanceOop.hpp - -ciInstanceKlass.cpp allocation.hpp -ciInstanceKlass.cpp allocation.inline.hpp -ciInstanceKlass.cpp ciField.hpp -ciInstanceKlass.cpp ciInstance.hpp -ciInstanceKlass.cpp ciInstanceKlass.hpp -ciInstanceKlass.cpp ciUtilities.hpp -ciInstanceKlass.cpp fieldDescriptor.hpp -ciInstanceKlass.cpp oop.inline.hpp -ciInstanceKlass.cpp systemDictionary.hpp - -ciInstanceKlass.hpp ciConstantPoolCache.hpp -ciInstanceKlass.hpp ciFlags.hpp -ciInstanceKlass.hpp ciInstanceKlassKlass.hpp -ciInstanceKlass.hpp ciKlass.hpp -ciInstanceKlass.hpp ciSymbol.hpp - -ciInstanceKlassKlass.cpp ciInstanceKlassKlass.hpp -ciInstanceKlassKlass.cpp ciUtilities.hpp - -ciInstanceKlassKlass.hpp ciKlassKlass.hpp - -ciKlass.cpp ciKlass.hpp -ciKlass.cpp ciSymbol.hpp -ciKlass.cpp ciUtilities.hpp -ciKlass.cpp oop.inline.hpp - -ciKlass.hpp ciType.hpp -ciKlass.hpp klassOop.hpp - -ciKlassKlass.cpp ciKlassKlass.hpp -ciKlassKlass.cpp ciUtilities.hpp - -ciKlassKlass.hpp ciKlass.hpp -ciKlassKlass.hpp ciSymbol.hpp - -ciMethod.cpp abstractCompiler.hpp -ciMethod.cpp allocation.inline.hpp -ciMethod.cpp bitMap.inline.hpp -ciMethod.cpp ciCallProfile.hpp -ciMethod.cpp ciExceptionHandler.hpp -ciMethod.cpp ciInstanceKlass.hpp -ciMethod.cpp ciMethod.hpp -ciMethod.cpp ciMethodBlocks.hpp -ciMethod.cpp ciMethodData.hpp -ciMethod.cpp ciMethodKlass.hpp -ciMethod.cpp ciStreams.hpp -ciMethod.cpp ciSymbol.hpp -ciMethod.cpp ciUtilities.hpp -ciMethod.cpp compilerOracle.hpp -ciMethod.cpp deoptimization.hpp -ciMethod.cpp generateOopMap.hpp -ciMethod.cpp interpreter.hpp -ciMethod.cpp linkResolver.hpp -ciMethod.cpp methodLiveness.hpp -ciMethod.cpp nativeLookup.hpp -ciMethod.cpp oop.inline.hpp -ciMethod.cpp oopMapCache.hpp -ciMethod.cpp resourceArea.hpp -ciMethod.cpp systemDictionary.hpp -ciMethod.cpp xmlstream.hpp - -ciMethod.hpp bitMap.hpp -ciMethod.hpp ciFlags.hpp -ciMethod.hpp ciInstanceKlass.hpp -ciMethod.hpp ciObject.hpp -ciMethod.hpp ciSignature.hpp -ciMethod.hpp methodHandles.hpp -ciMethod.hpp methodLiveness.hpp - -ciMethodBlocks.cpp bytecode.hpp -ciMethodBlocks.cpp ciMethodBlocks.hpp -ciMethodBlocks.cpp ciStreams.hpp -ciMethodBlocks.cpp copy.hpp - -ciMethodBlocks.hpp ciMethod.hpp -ciMethodBlocks.hpp growableArray.hpp -ciMethodBlocks.hpp resourceArea.hpp - -ciMethodData.cpp allocation.inline.hpp -ciMethodData.cpp ciMethodData.hpp -ciMethodData.cpp ciUtilities.hpp -ciMethodData.cpp copy.hpp -ciMethodData.cpp deoptimization.hpp -ciMethodData.cpp resourceArea.hpp - -ciMethodData.hpp ciClassList.hpp -ciMethodData.hpp ciKlass.hpp -ciMethodData.hpp ciObject.hpp -ciMethodData.hpp ciUtilities.hpp -ciMethodData.hpp methodDataOop.hpp -ciMethodData.hpp oop.inline.hpp - -ciMethodKlass.cpp ciMethodKlass.hpp -ciMethodKlass.cpp ciUtilities.hpp - -ciMethodKlass.hpp ciKlass.hpp -ciMethodKlass.hpp ciSymbol.hpp - -ciMethodHandle.cpp ciClassList.hpp -ciMethodHandle.cpp ciInstance.hpp -ciMethodHandle.cpp ciMethodHandle.hpp -ciMethodHandle.cpp ciUtilities.hpp -ciMethodHandle.cpp methodHandles.hpp -ciMethodHandle.cpp methodHandleWalk.hpp - -ciMethodHandle.hpp methodHandles.hpp - -ciNullObject.cpp ciNullObject.hpp - -ciNullObject.hpp ciClassList.hpp -ciNullObject.hpp ciObject.hpp -ciNullObject.hpp ciUtilities.hpp - -ciObjArray.hpp ciArray.hpp -ciObjArray.hpp ciClassList.hpp -ciObjArray.hpp objArrayOop.hpp - -ciObjArray.cpp ciObjArray.hpp -ciObjArray.cpp ciNullObject.hpp -ciObjArray.cpp ciUtilities.hpp -ciObjArray.cpp objArrayOop.hpp - -ciObjArray.cpp ciObjArray.hpp -ciObjArray.cpp ciNullObject.hpp -ciObjArray.cpp ciUtilities.hpp -ciObjArray.cpp objArrayOop.hpp - -ciObjArrayKlass.cpp ciInstanceKlass.hpp -ciObjArrayKlass.cpp ciObjArrayKlass.hpp -ciObjArrayKlass.cpp ciObjArrayKlassKlass.hpp -ciObjArrayKlass.cpp ciSymbol.hpp -ciObjArrayKlass.cpp ciUtilities.hpp -ciObjArrayKlass.cpp objArrayKlass.hpp - -ciObjArrayKlass.hpp ciArrayKlass.hpp - -ciObjArrayKlassKlass.cpp ciObjArrayKlassKlass.hpp -ciObjArrayKlassKlass.cpp ciUtilities.hpp - -ciObjArrayKlassKlass.hpp ciArrayKlassKlass.hpp - -ciObject.cpp ciObject.hpp -ciObject.cpp ciUtilities.hpp -ciObject.cpp collectedHeap.inline.hpp -ciObject.cpp oop.inline2.hpp - -ciObject.hpp allocation.hpp -ciObject.hpp ciClassList.hpp -ciObject.hpp handles.hpp -ciObject.hpp jniHandles.hpp - -ciObjectFactory.cpp allocation.inline.hpp -ciObjectFactory.cpp ciCallSite.hpp -ciObjectFactory.cpp ciCPCache.hpp -ciObjectFactory.cpp ciInstance.hpp -ciObjectFactory.cpp ciInstanceKlass.hpp -ciObjectFactory.cpp ciInstanceKlassKlass.hpp -ciObjectFactory.cpp ciMethod.hpp -ciObjectFactory.cpp ciMethodData.hpp -ciObjectFactory.cpp ciMethodHandle.hpp -ciObjectFactory.cpp ciMethodKlass.hpp -ciObjectFactory.cpp ciNullObject.hpp -ciObjectFactory.cpp ciObjArray.hpp -ciObjectFactory.cpp ciObjArrayKlass.hpp -ciObjectFactory.cpp ciObjArrayKlassKlass.hpp -ciObjectFactory.cpp ciObjectFactory.hpp -ciObjectFactory.cpp ciSymbol.hpp -ciObjectFactory.cpp ciSymbolKlass.hpp -ciObjectFactory.cpp ciTypeArray.hpp -ciObjectFactory.cpp ciTypeArrayKlass.hpp -ciObjectFactory.cpp ciTypeArrayKlassKlass.hpp -ciObjectFactory.cpp ciUtilities.hpp -ciObjectFactory.cpp collectedHeap.inline.hpp -ciObjectFactory.cpp fieldType.hpp -ciObjectFactory.cpp oop.inline.hpp -ciObjectFactory.cpp oop.inline2.hpp -ciObjectFactory.cpp systemDictionary.hpp - -ciObjectFactory.hpp ciClassList.hpp -ciObjectFactory.hpp ciObject.hpp -ciObjectFactory.hpp growableArray.hpp - -ciSignature.cpp allocation.inline.hpp -ciSignature.cpp ciSignature.hpp -ciSignature.cpp ciUtilities.hpp -ciSignature.cpp oop.inline.hpp -ciSignature.cpp signature.hpp - -ciSignature.hpp ciClassList.hpp -ciSignature.hpp ciSymbol.hpp -ciSignature.hpp globalDefinitions.hpp -ciSignature.hpp growableArray.hpp - -ciStreams.cpp ciCallSite.hpp -ciStreams.cpp ciConstant.hpp -ciStreams.cpp ciCPCache.hpp -ciStreams.cpp ciField.hpp -ciStreams.cpp ciStreams.hpp -ciStreams.cpp ciUtilities.hpp - -ciStreams.hpp bytecode.hpp -ciStreams.hpp ciClassList.hpp -ciStreams.hpp ciExceptionHandler.hpp -ciStreams.hpp ciInstanceKlass.hpp -ciStreams.hpp ciMethod.hpp - -ciSymbol.cpp ciSymbol.hpp -ciSymbol.cpp ciUtilities.hpp -ciSymbol.cpp oopFactory.hpp - -ciSymbol.hpp ciObject.hpp -ciSymbol.hpp ciObjectFactory.hpp -ciSymbol.hpp symbolOop.hpp -ciSymbol.hpp vmSymbols.hpp - -ciSymbolKlass.cpp ciSymbolKlass.hpp -ciSymbolKlass.cpp ciUtilities.hpp - -ciSymbolKlass.hpp ciKlass.hpp -ciSymbolKlass.hpp ciSymbol.hpp - -ciType.cpp ciType.hpp -ciType.cpp ciUtilities.hpp -ciType.cpp oop.inline.hpp -ciType.cpp systemDictionary.hpp - -ciType.hpp ciObject.hpp -ciType.hpp klassOop.hpp - -ciTypeArray.cpp ciTypeArray.hpp -ciTypeArray.cpp ciUtilities.hpp - -ciTypeArray.hpp ciArray.hpp -ciTypeArray.hpp ciClassList.hpp -ciTypeArray.hpp typeArrayOop.hpp - -ciTypeArrayKlass.cpp ciTypeArrayKlass.hpp -ciTypeArrayKlass.cpp ciUtilities.hpp - -ciTypeArrayKlass.hpp ciArrayKlass.hpp - -ciTypeArrayKlassKlass.cpp ciTypeArrayKlassKlass.hpp -ciTypeArrayKlassKlass.cpp ciUtilities.hpp - -ciTypeArrayKlassKlass.hpp ciArrayKlassKlass.hpp - -ciUtilities.cpp ciUtilities.hpp - -ciUtilities.hpp ciEnv.hpp -ciUtilities.hpp interfaceSupport.hpp - -classFileError.cpp classFileParser.hpp -classFileError.cpp stackMapTable.hpp -classFileError.cpp verifier.hpp - -classFileParser.cpp allocation.hpp -classFileParser.cpp classFileParser.hpp -classFileParser.cpp classLoader.hpp -classFileParser.cpp classLoadingService.hpp -classFileParser.cpp constantPoolOop.hpp -classFileParser.cpp gcLocker.hpp -classFileParser.cpp instanceKlass.hpp -classFileParser.cpp javaCalls.hpp -classFileParser.cpp javaClasses.hpp -classFileParser.cpp jvmtiExport.hpp -classFileParser.cpp klass.inline.hpp -classFileParser.cpp klassOop.hpp -classFileParser.cpp klassVtable.hpp -classFileParser.cpp methodOop.hpp -classFileParser.cpp oopFactory.hpp -classFileParser.cpp perfData.hpp -classFileParser.cpp reflection.hpp -classFileParser.cpp signature.hpp -classFileParser.cpp symbolOop.hpp -classFileParser.cpp symbolTable.hpp -classFileParser.cpp systemDictionary.hpp -classFileParser.cpp threadService.hpp -classFileParser.cpp timer.hpp -classFileParser.cpp universe.inline.hpp -classFileParser.cpp verificationType.hpp -classFileParser.cpp verifier.hpp -classFileParser.cpp vmSymbols.hpp - -classFileParser.hpp accessFlags.hpp -classFileParser.hpp classFileStream.hpp -classFileParser.hpp handles.inline.hpp -classFileParser.hpp oop.inline.hpp -classFileParser.hpp resourceArea.hpp -classFileParser.hpp typeArrayOop.hpp - -classFileStream.cpp classFileStream.hpp -classFileStream.cpp vmSymbols.hpp - -classFileStream.hpp bytes_.hpp -classFileStream.hpp top.hpp - -classLoader.cpp allocation.inline.hpp -classLoader.cpp arguments.hpp -classLoader.cpp bytecodeStream.hpp -classLoader.cpp classFileParser.hpp -classLoader.cpp classFileStream.hpp -classLoader.cpp classLoader.hpp -classLoader.cpp collectedHeap.inline.hpp -classLoader.cpp compilationPolicy.hpp -classLoader.cpp compileBroker.hpp -classLoader.cpp constantPoolKlass.hpp -classLoader.cpp events.hpp -classLoader.cpp fprofiler.hpp -classLoader.cpp generation.hpp -classLoader.cpp handles.hpp -classLoader.cpp handles.inline.hpp -classLoader.cpp hashtable.hpp -classLoader.cpp hashtable.inline.hpp -classLoader.cpp hpi.hpp -classLoader.cpp hpi_.hpp -classLoader.cpp init.hpp -classLoader.cpp instanceKlass.hpp -classLoader.cpp instanceRefKlass.hpp -classLoader.cpp interfaceSupport.hpp -classLoader.cpp java.hpp -classLoader.cpp javaCalls.hpp -classLoader.cpp javaClasses.hpp -classLoader.cpp jvm_misc.hpp -classLoader.cpp management.hpp -classLoader.cpp oop.inline.hpp -classLoader.cpp oopFactory.hpp -classLoader.cpp oopMapCache.hpp -classLoader.cpp os_.inline.hpp -classLoader.cpp symbolOop.hpp -classLoader.cpp systemDictionary.hpp -classLoader.cpp threadCritical.hpp -classLoader.cpp threadService.hpp -classLoader.cpp timer.hpp -classLoader.cpp universe.inline.hpp -classLoader.cpp vmSymbols.hpp - -classLoader.hpp classFileParser.hpp -classLoader.hpp perfData.hpp - -classLoadingService.cpp allocation.hpp -classLoadingService.cpp classLoadingService.hpp -classLoadingService.cpp dtrace.hpp -classLoadingService.cpp memoryService.hpp -classLoadingService.cpp mutexLocker.hpp -classLoadingService.cpp oop.inline.hpp -classLoadingService.cpp systemDictionary.hpp -classLoadingService.cpp universe.hpp - -classLoadingService.hpp growableArray.hpp -classLoadingService.hpp handles.hpp -classLoadingService.hpp perfData.hpp - -classify.cpp classify.hpp -classify.cpp systemDictionary.hpp - -classify.hpp oop.inline.hpp - -codeBlob.cpp allocation.inline.hpp -codeBlob.cpp bytecode.hpp -codeBlob.cpp codeBlob.hpp -codeBlob.cpp codeCache.hpp -codeBlob.cpp disassembler.hpp -codeBlob.cpp forte.hpp -codeBlob.cpp handles.inline.hpp -codeBlob.cpp heap.hpp -codeBlob.cpp interfaceSupport.hpp -codeBlob.cpp memoryService.hpp -codeBlob.cpp mutexLocker.hpp -codeBlob.cpp nativeInst_.hpp -codeBlob.cpp oop.inline.hpp -codeBlob.cpp relocInfo.hpp -codeBlob.cpp safepoint.hpp -codeBlob.cpp sharedRuntime.hpp -codeBlob.cpp vframe.hpp - -codeBlob.hpp codeBuffer.hpp -codeBlob.hpp frame.hpp -codeBlob.hpp handles.hpp -codeBlob.hpp oopMap.hpp - -codeBuffer.cpp codeBuffer.hpp -codeBuffer.cpp copy.hpp -codeBuffer.cpp disassembler.hpp - -codeBuffer.hpp assembler.hpp -codeBuffer.hpp oopRecorder.hpp -codeBuffer.hpp relocInfo.hpp - -codeBuffer_.hpp generate_platform_dependent_include - -codeCache.cpp allocation.inline.hpp -codeCache.cpp codeBlob.hpp -codeCache.cpp codeCache.hpp -codeCache.cpp dependencies.hpp -codeCache.cpp gcLocker.hpp -codeCache.cpp handles.inline.hpp -codeCache.cpp icache.hpp -codeCache.cpp iterator.hpp -codeCache.cpp java.hpp -codeCache.cpp markSweep.hpp -codeCache.cpp memoryService.hpp -codeCache.cpp methodOop.hpp -codeCache.cpp mutexLocker.hpp -codeCache.cpp nmethod.hpp -codeCache.cpp objArrayOop.hpp -codeCache.cpp oop.inline.hpp -codeCache.cpp pcDesc.hpp -codeCache.cpp resourceArea.hpp -codeCache.cpp xmlstream.hpp - -codeCache.hpp allocation.hpp -codeCache.hpp codeBlob.hpp -codeCache.hpp heap.hpp -codeCache.hpp instanceKlass.hpp -codeCache.hpp oopsHierarchy.hpp - -collectorPolicy.cpp adaptiveSizePolicy.hpp -collectorPolicy.cpp arguments.hpp -collectorPolicy.cpp cardTableRS.hpp -collectorPolicy.cpp collectorPolicy.hpp -collectorPolicy.cpp gcLocker.inline.hpp -collectorPolicy.cpp genCollectedHeap.hpp -collectorPolicy.cpp gcPolicyCounters.hpp -collectorPolicy.cpp generationSpec.hpp -collectorPolicy.cpp globals_extension.hpp -collectorPolicy.cpp handles.inline.hpp -collectorPolicy.cpp java.hpp -collectorPolicy.cpp space.hpp -collectorPolicy.cpp thread_.inline.hpp -collectorPolicy.cpp universe.hpp -collectorPolicy.cpp vmGCOperations.hpp -collectorPolicy.cpp vmThread.hpp - -collectorPolicy.hpp barrierSet.hpp -collectorPolicy.hpp genRemSet.hpp -collectorPolicy.hpp permGen.hpp - -compactPermGen.hpp generation.hpp -compactPermGen.hpp permGen.hpp - -compactingPermGenGen.cpp compactingPermGenGen.hpp -compactingPermGenGen.cpp filemap.hpp -compactingPermGenGen.cpp genOopClosures.inline.hpp -compactingPermGenGen.cpp generation.inline.hpp -compactingPermGenGen.cpp generationSpec.hpp -compactingPermGenGen.cpp java.hpp -compactingPermGenGen.cpp oop.inline.hpp -compactingPermGenGen.cpp symbolTable.hpp -compactingPermGenGen.cpp systemDictionary.hpp - -compactingPermGenGen.hpp generationCounters.hpp -compactingPermGenGen.hpp space.hpp - -compilationPolicy.cpp compilationPolicy.hpp -compilationPolicy.cpp compiledIC.hpp -compilationPolicy.cpp compilerOracle.hpp -compilationPolicy.cpp events.hpp -compilationPolicy.cpp frame.hpp -compilationPolicy.cpp globalDefinitions.hpp -compilationPolicy.cpp handles.inline.hpp -compilationPolicy.cpp interpreter.hpp -compilationPolicy.cpp methodDataOop.hpp -compilationPolicy.cpp methodOop.hpp -compilationPolicy.cpp nativeLookup.hpp -compilationPolicy.cpp nmethod.hpp -compilationPolicy.cpp oop.inline.hpp -compilationPolicy.cpp rframe.hpp -compilationPolicy.cpp scopeDesc.hpp -compilationPolicy.cpp simpleThresholdPolicy.hpp -compilationPolicy.cpp stubRoutines.hpp -compilationPolicy.cpp thread.hpp -compilationPolicy.cpp timer.hpp -compilationPolicy.cpp vframe.hpp -compilationPolicy.cpp vm_operations.hpp - -compilationPolicy.hpp allocation.hpp -compilationPolicy.hpp compileBroker.hpp -compilationPolicy.hpp growableArray.hpp -compilationPolicy.hpp nmethod.hpp -compilationPolicy.hpp vm_operations.hpp - -compileBroker.cpp allocation.inline.hpp -compileBroker.cpp arguments.hpp -compileBroker.cpp codeCache.hpp -compileBroker.cpp compilationPolicy.hpp -compileBroker.cpp compileBroker.hpp -compileBroker.cpp compileLog.hpp -compileBroker.cpp compilerOracle.hpp -compileBroker.cpp dtrace.hpp -compileBroker.cpp init.hpp -compileBroker.cpp interfaceSupport.hpp -compileBroker.cpp javaCalls.hpp -compileBroker.cpp linkResolver.hpp -compileBroker.cpp methodDataOop.hpp -compileBroker.cpp methodOop.hpp -compileBroker.cpp nativeLookup.hpp -compileBroker.cpp oop.inline.hpp -compileBroker.cpp os.hpp -compileBroker.cpp sharedRuntime.hpp -compileBroker.cpp sweeper.hpp -compileBroker.cpp systemDictionary.hpp -compileBroker.cpp vmSymbols.hpp - -compileBroker.hpp abstractCompiler.hpp -compileBroker.hpp compilerInterface.hpp -compileBroker.hpp perfData.hpp - -compileLog.cpp allocation.inline.hpp -compileLog.cpp ciMethod.hpp -compileLog.cpp compileLog.hpp -compileLog.cpp methodOop.hpp -compileLog.cpp mutexLocker.hpp -compileLog.cpp os.hpp - -compileLog.hpp xmlstream.hpp - -compiledIC.cpp codeCache.hpp -compiledIC.cpp compiledIC.hpp -compiledIC.cpp events.hpp -compiledIC.cpp icBuffer.hpp -compiledIC.cpp icache.hpp -compiledIC.cpp interpreter.hpp -compiledIC.cpp linkResolver.hpp -compiledIC.cpp methodOop.hpp -compiledIC.cpp nmethod.hpp -compiledIC.cpp oop.inline.hpp -compiledIC.cpp oopFactory.hpp -compiledIC.cpp sharedRuntime.hpp -compiledIC.cpp stubRoutines.hpp -compiledIC.cpp symbolOop.hpp -compiledIC.cpp systemDictionary.hpp -compiledIC.cpp vtableStubs.hpp - -compiledIC.hpp compiledICHolderKlass.hpp -compiledIC.hpp compiledICHolderOop.hpp -compiledIC.hpp klassOop.hpp -compiledIC.hpp linkResolver.hpp -compiledIC.hpp nativeInst_.hpp - -compiledICHolderKlass.cpp collectedHeap.hpp -compiledICHolderKlass.cpp collectedHeap.inline.hpp -compiledICHolderKlass.cpp compiledICHolderKlass.hpp -compiledICHolderKlass.cpp handles.inline.hpp -compiledICHolderKlass.cpp javaClasses.hpp -compiledICHolderKlass.cpp markSweep.inline.hpp -compiledICHolderKlass.cpp oop.inline.hpp -compiledICHolderKlass.cpp oop.inline2.hpp -compiledICHolderKlass.cpp permGen.hpp -compiledICHolderKlass.cpp universe.inline.hpp - -compiledICHolderKlass.hpp compiledICHolderOop.hpp -compiledICHolderKlass.hpp klass.hpp -compiledICHolderKlass.hpp methodOop.hpp - -compiledICHolderOop.cpp compiledICHolderOop.hpp - -compiledICHolderOop.hpp oop.hpp - -compilerInterface.hpp ciArray.hpp -compilerInterface.hpp ciArrayKlass.hpp -compilerInterface.hpp ciArrayKlassKlass.hpp -compilerInterface.hpp ciCallProfile.hpp -compilerInterface.hpp ciConstant.hpp -compilerInterface.hpp ciEnv.hpp -compilerInterface.hpp ciExceptionHandler.hpp -compilerInterface.hpp ciField.hpp -compilerInterface.hpp ciFlags.hpp -compilerInterface.hpp ciInstance.hpp -compilerInterface.hpp ciInstanceKlass.hpp -compilerInterface.hpp ciInstanceKlassKlass.hpp -compilerInterface.hpp ciKlass.hpp -compilerInterface.hpp ciKlassKlass.hpp -compilerInterface.hpp ciMethod.hpp -compilerInterface.hpp ciMethodKlass.hpp -compilerInterface.hpp ciNullObject.hpp -compilerInterface.hpp ciObjArray.hpp -compilerInterface.hpp ciObjArrayKlass.hpp -compilerInterface.hpp ciObjArrayKlassKlass.hpp -compilerInterface.hpp ciObject.hpp -compilerInterface.hpp ciSignature.hpp -compilerInterface.hpp ciStreams.hpp -compilerInterface.hpp ciSymbol.hpp -compilerInterface.hpp ciSymbolKlass.hpp -compilerInterface.hpp ciTypeArray.hpp -compilerInterface.hpp ciTypeArrayKlass.hpp -compilerInterface.hpp ciTypeArrayKlassKlass.hpp - -compilerOracle.cpp allocation.inline.hpp -compilerOracle.cpp compilerOracle.hpp -compilerOracle.cpp handles.inline.hpp -compilerOracle.cpp jniHandles.hpp -compilerOracle.cpp klass.hpp -compilerOracle.cpp methodOop.hpp -compilerOracle.cpp oop.inline.hpp -compilerOracle.cpp oopFactory.hpp -compilerOracle.cpp resourceArea.hpp -compilerOracle.cpp symbolOop.hpp - -compilerOracle.hpp allocation.hpp -compilerOracle.hpp oopsHierarchy.hpp - -compressedStream.cpp compressedStream.hpp -compressedStream.cpp ostream.hpp - -compressedStream.hpp allocation.hpp - -constMethodKlass.cpp constMethodKlass.hpp -constMethodKlass.cpp constMethodOop.hpp -constMethodKlass.cpp gcLocker.hpp -constMethodKlass.cpp handles.inline.hpp -constMethodKlass.cpp interpreter.hpp -constMethodKlass.cpp markSweep.inline.hpp -constMethodKlass.cpp oop.inline.hpp -constMethodKlass.cpp oop.inline2.hpp -constMethodKlass.cpp resourceArea.hpp - -constMethodKlass.hpp oop.hpp -constMethodKlass.hpp klass.hpp -constMethodKlass.hpp orderAccess.hpp - -constMethodOop.cpp constMethodOop.hpp -constMethodOop.cpp methodOop.hpp - -constMethodOop.hpp oop.hpp -constMethodOop.hpp typeArrayOop.hpp - -constantPoolKlass.cpp collectedHeap.inline.hpp -constantPoolKlass.cpp constantPoolKlass.hpp -constantPoolKlass.cpp constantPoolOop.hpp -constantPoolKlass.cpp handles.inline.hpp -constantPoolKlass.cpp javaClasses.hpp -constantPoolKlass.cpp markSweep.inline.hpp -constantPoolKlass.cpp oop.inline.hpp -constantPoolKlass.cpp oop.inline2.hpp -constantPoolKlass.cpp oopFactory.hpp -constantPoolKlass.cpp permGen.hpp -constantPoolKlass.cpp symbolOop.hpp -constantPoolKlass.cpp thread_.inline.hpp -constantPoolKlass.cpp universe.inline.hpp - -constantPoolKlass.hpp arrayKlass.hpp -constantPoolKlass.hpp instanceKlass.hpp - -constantPoolOop.cpp constantPoolOop.hpp -constantPoolOop.cpp fieldType.hpp -constantPoolOop.cpp init.hpp -constantPoolOop.cpp instanceKlass.hpp -constantPoolOop.cpp javaClasses.hpp -constantPoolOop.cpp linkResolver.hpp -constantPoolOop.cpp objArrayKlass.hpp -constantPoolOop.cpp oop.inline.hpp -constantPoolOop.cpp signature.hpp -constantPoolOop.cpp symbolTable.hpp -constantPoolOop.cpp systemDictionary.hpp -constantPoolOop.cpp universe.inline.hpp -constantPoolOop.cpp vframe.hpp -constantPoolOop.cpp vmSymbols.hpp - -constantPoolOop.hpp arrayOop.hpp -constantPoolOop.hpp bytes_.hpp -constantPoolOop.hpp constantTag.hpp -constantPoolOop.hpp cpCacheOop.hpp -constantPoolOop.hpp typeArrayOop.hpp - -constantTag.cpp constantTag.hpp - -constantTag.hpp jvm.h -constantTag.hpp top.hpp - -copy.cpp copy.hpp -copy.cpp sharedRuntime.hpp - -copy.hpp stubRoutines.hpp - -copy_.hpp generate_platform_dependent_include - -copy_.inline.hpp generate_platform_dependent_include - -cpCacheKlass.cpp bytecodes.hpp -cpCacheKlass.cpp collectedHeap.hpp -cpCacheKlass.cpp constantPoolOop.hpp -cpCacheKlass.cpp cpCacheKlass.hpp -cpCacheKlass.cpp genOopClosures.inline.hpp -cpCacheKlass.cpp handles.inline.hpp -cpCacheKlass.cpp javaClasses.hpp -cpCacheKlass.cpp markSweep.inline.hpp -cpCacheKlass.cpp oop.inline.hpp -cpCacheKlass.cpp permGen.hpp - -cpCacheKlass.hpp arrayKlass.hpp -cpCacheKlass.hpp cpCacheOop.hpp -cpCacheKlass.hpp instanceKlass.hpp - -cpCacheOop.cpp cpCacheOop.hpp -cpCacheOop.cpp handles.inline.hpp -cpCacheOop.cpp interpreter.hpp -cpCacheOop.cpp jvmtiRedefineClassesTrace.hpp -cpCacheOop.cpp markSweep.inline.hpp -cpCacheOop.cpp objArrayOop.hpp -cpCacheOop.cpp oop.inline.hpp -cpCacheOop.cpp rewriter.hpp -cpCacheOop.cpp universe.inline.hpp - -cpCacheOop.hpp allocation.hpp -cpCacheOop.hpp array.hpp -cpCacheOop.hpp arrayOop.hpp -cpCacheOop.hpp bytecodes.hpp - -cppInterpreter.cpp bytecodeInterpreter.hpp -cppInterpreter.cpp interpreter.hpp -cppInterpreter.cpp interpreterGenerator.hpp -cppInterpreter.cpp interpreterRuntime.hpp - -cppInterpreter.hpp abstractInterpreter.hpp - -cppInterpreter_.cpp arguments.hpp -cppInterpreter_.cpp arrayOop.hpp -cppInterpreter_.cpp assembler.hpp -cppInterpreter_.cpp bytecodeHistogram.hpp -cppInterpreter_.cpp debug.hpp -cppInterpreter_.cpp deoptimization.hpp -cppInterpreter_.cpp frame.inline.hpp -cppInterpreter_.cpp interfaceSupport.hpp -cppInterpreter_.cpp interpreterRuntime.hpp -cppInterpreter_.cpp interpreter.hpp -cppInterpreter_.cpp interpreterGenerator.hpp -cppInterpreter_.cpp jvmtiExport.hpp -cppInterpreter_.cpp jvmtiThreadState.hpp -cppInterpreter_.cpp methodDataOop.hpp -cppInterpreter_.cpp methodOop.hpp -cppInterpreter_.cpp oop.inline.hpp -cppInterpreter_.cpp sharedRuntime.hpp -cppInterpreter_.cpp stubRoutines.hpp -cppInterpreter_.cpp synchronizer.hpp -cppInterpreter_.cpp cppInterpreter.hpp -cppInterpreter_.cpp timer.hpp -cppInterpreter_.cpp vframeArray.hpp - -cppInterpreter_.hpp generate_platform_dependent_include - -cppInterpreterGenerator_.hpp generate_platform_dependent_include - -debug.cpp arguments.hpp -debug.cpp bytecodeHistogram.hpp -debug.cpp codeCache.hpp -debug.cpp collectedHeap.hpp -debug.cpp compileBroker.hpp -debug.cpp defaultStream.hpp -debug.cpp disassembler.hpp -debug.cpp events.hpp -debug.cpp frame.hpp -debug.cpp heapDumper.hpp -debug.cpp icBuffer.hpp -debug.cpp interpreter.hpp -debug.cpp java.hpp -debug.cpp markSweep.hpp -debug.cpp nmethod.hpp -debug.cpp oop.inline.hpp -debug.cpp os_.inline.hpp -debug.cpp privilegedStack.hpp -debug.cpp resourceArea.hpp -debug.cpp sharedRuntime.hpp -debug.cpp stubCodeGenerator.hpp -debug.cpp stubRoutines.hpp -debug.cpp systemDictionary.hpp -debug.cpp thread_.inline.hpp -debug.cpp top.hpp -debug.cpp universe.hpp -debug.cpp vframe.hpp -debug.cpp vmError.hpp -debug.cpp vtableStubs.hpp - -debug.hpp globalDefinitions.hpp - -debugInfo.cpp debugInfo.hpp -debugInfo.cpp debugInfoRec.hpp -debugInfo.cpp handles.inline.hpp -debugInfo.cpp nmethod.hpp - -debugInfo.hpp compressedStream.hpp -debugInfo.hpp growableArray.hpp -debugInfo.hpp location.hpp -debugInfo.hpp nmethod.hpp -debugInfo.hpp oopRecorder.hpp -debugInfo.hpp stackValue.hpp - -debugInfoRec.cpp debugInfoRec.hpp -debugInfoRec.cpp jvmtiExport.hpp -debugInfoRec.cpp scopeDesc.hpp - -debugInfoRec.hpp ciClassList.hpp -debugInfoRec.hpp ciInstanceKlass.hpp -debugInfoRec.hpp ciMethod.hpp -debugInfoRec.hpp debugInfo.hpp -debugInfoRec.hpp growableArray.hpp -debugInfoRec.hpp location.hpp -debugInfoRec.hpp oop.hpp -debugInfoRec.hpp oopMap.hpp -debugInfoRec.hpp pcDesc.hpp - -debug_.cpp codeCache.hpp -debug_.cpp debug.hpp -debug_.cpp frame.hpp -debug_.cpp init.hpp -debug_.cpp nmethod.hpp -debug_.cpp os.hpp -debug_.cpp top.hpp - -defNewGeneration.cpp collectorCounters.hpp -defNewGeneration.cpp copy.hpp -defNewGeneration.cpp defNewGeneration.inline.hpp -defNewGeneration.cpp gcLocker.inline.hpp -defNewGeneration.cpp gcPolicyCounters.hpp -defNewGeneration.cpp genCollectedHeap.hpp -defNewGeneration.cpp genOopClosures.inline.hpp -defNewGeneration.cpp generationSpec.hpp -defNewGeneration.cpp instanceRefKlass.hpp -defNewGeneration.cpp iterator.hpp -defNewGeneration.cpp java.hpp -defNewGeneration.cpp oop.inline.hpp -defNewGeneration.cpp referencePolicy.hpp -defNewGeneration.cpp space.inline.hpp -defNewGeneration.cpp spaceDecorator.hpp -defNewGeneration.cpp thread_.inline.hpp - -defNewGeneration.hpp ageTable.hpp -defNewGeneration.hpp cSpaceCounters.hpp -defNewGeneration.hpp generation.inline.hpp -defNewGeneration.hpp generationCounters.hpp - -defNewGeneration.inline.hpp cardTableRS.hpp -defNewGeneration.inline.hpp defNewGeneration.hpp -defNewGeneration.inline.hpp space.hpp - -defaultStream.hpp xmlstream.hpp - -deoptimization.cpp allocation.inline.hpp -deoptimization.cpp biasedLocking.hpp -deoptimization.cpp bytecode.hpp -deoptimization.cpp compilationPolicy.hpp -deoptimization.cpp debugInfoRec.hpp -deoptimization.cpp deoptimization.hpp -deoptimization.cpp events.hpp -deoptimization.cpp interfaceSupport.hpp -deoptimization.cpp interpreter.hpp -deoptimization.cpp jvmtiThreadState.hpp -deoptimization.cpp methodOop.hpp -deoptimization.cpp nmethod.hpp -deoptimization.cpp oop.inline.hpp -deoptimization.cpp oopFactory.hpp -deoptimization.cpp oopMapCache.hpp -deoptimization.cpp pcDesc.hpp -deoptimization.cpp resourceArea.hpp -deoptimization.cpp scopeDesc.hpp -deoptimization.cpp sharedRuntime.hpp -deoptimization.cpp signature.hpp -deoptimization.cpp stubRoutines.hpp -deoptimization.cpp systemDictionary.hpp -deoptimization.cpp thread.hpp -deoptimization.cpp vframe.hpp -deoptimization.cpp vframeArray.hpp -deoptimization.cpp vframe_hp.hpp -deoptimization.cpp vmreg_.inline.hpp -deoptimization.cpp xmlstream.hpp - -deoptimization.hpp allocation.hpp -deoptimization.hpp frame.inline.hpp - -depChecker_.cpp depChecker_.hpp -depChecker_.cpp disassembler.hpp -depChecker_.cpp hpi.hpp - -dependencies.cpp ciArrayKlass.hpp -dependencies.cpp ciEnv.hpp -dependencies.cpp ciKlass.hpp -dependencies.cpp ciMethod.hpp -dependencies.cpp compileLog.hpp -dependencies.cpp copy.hpp -dependencies.cpp dependencies.hpp -dependencies.cpp handles.inline.hpp -dependencies.cpp oop.inline.hpp - -dependencies.hpp ciKlass.hpp -dependencies.hpp compressedStream.hpp -dependencies.hpp growableArray.hpp -dependencies.hpp nmethod.hpp - -dictionary.cpp classLoadingService.hpp -dictionary.cpp dictionary.hpp -dictionary.cpp hashtable.inline.hpp -dictionary.cpp jvmtiRedefineClassesTrace.hpp -dictionary.cpp oop.inline.hpp -dictionary.cpp systemDictionary.hpp - -dictionary.hpp hashtable.hpp -dictionary.hpp instanceKlass.hpp -dictionary.hpp oop.hpp -dictionary.hpp systemDictionary.hpp - -disassembler_.hpp generate_platform_dependent_include - -disassembler.cpp cardTableModRefBS.hpp -disassembler.cpp codeCache.hpp -disassembler.cpp collectedHeap.hpp -disassembler.cpp depChecker_.hpp -disassembler.cpp disassembler.hpp -disassembler.cpp fprofiler.hpp -disassembler.cpp handles.inline.hpp -disassembler.cpp hpi.hpp -disassembler.cpp javaClasses.hpp -disassembler.cpp stubCodeGenerator.hpp -disassembler.cpp stubRoutines.hpp - -disassembler.hpp globals.hpp -disassembler.hpp os_.inline.hpp - -dtraceAttacher.cpp codeCache.hpp -dtraceAttacher.cpp deoptimization.hpp -dtraceAttacher.cpp dtraceAttacher.hpp -dtraceAttacher.cpp resourceArea.hpp -dtraceAttacher.cpp vmThread.hpp -dtraceAttacher.cpp vm_operations.hpp - -dtraceJSDT.cpp allocation.hpp -dtraceJSDT.cpp codeBlob.hpp -dtraceJSDT.cpp dtraceJSDT.hpp -dtraceJSDT.cpp exceptions.hpp -dtraceJSDT.cpp globalDefinitions.hpp -dtraceJSDT.cpp javaClasses.hpp -dtraceJSDT.cpp jniHandles.hpp -dtraceJSDT.cpp jvm.h -dtraceJSDT.cpp os.hpp -dtraceJSDT.cpp utf8.hpp - -dtraceJSDT.hpp nativeInst_.hpp -dtraceJSDT.hpp nmethod.hpp - -dtraceJSDT_.cpp allocation.hpp -dtraceJSDT_.cpp codeBlob.hpp -dtraceJSDT_.cpp dtraceJSDT.hpp -dtraceJSDT_.cpp globalDefinitions.hpp -dtraceJSDT_.cpp javaClasses.hpp -dtraceJSDT_.cpp jniHandles.hpp -dtraceJSDT_.cpp jvm.h -dtraceJSDT_.cpp os.hpp -dtraceJSDT_.cpp signature.hpp - -// dump is jck optional, put cpp deps in includeDB_features - -events.cpp allocation.inline.hpp -events.cpp events.hpp -events.cpp mutexLocker.hpp -events.cpp osThread.hpp -events.cpp threadLocalStorage.hpp -events.cpp thread_.inline.hpp -events.cpp timer.hpp - -events.hpp allocation.hpp -events.hpp top.hpp - -evmCompat.cpp debug.hpp - -exceptionHandlerTable.cpp allocation.inline.hpp -exceptionHandlerTable.cpp exceptionHandlerTable.hpp -exceptionHandlerTable.cpp nmethod.hpp - -exceptionHandlerTable.hpp allocation.hpp -exceptionHandlerTable.hpp methodOop.hpp - -exceptions.cpp compileBroker.hpp -exceptions.cpp events.hpp -exceptions.cpp exceptions.hpp -exceptions.cpp init.hpp -exceptions.cpp java.hpp -exceptions.cpp javaCalls.hpp -exceptions.cpp oop.inline.hpp -exceptions.cpp systemDictionary.hpp -exceptions.cpp threadCritical.hpp -exceptions.cpp thread_.inline.hpp -exceptions.cpp vmSymbols.hpp - -exceptions.hpp allocation.hpp -exceptions.hpp oopsHierarchy.hpp -exceptions.hpp sizes.hpp - -fieldDescriptor.cpp fieldDescriptor.hpp -fieldDescriptor.cpp handles.inline.hpp -fieldDescriptor.cpp instanceKlass.hpp -fieldDescriptor.cpp resourceArea.hpp -fieldDescriptor.cpp signature.hpp -fieldDescriptor.cpp systemDictionary.hpp -fieldDescriptor.cpp universe.inline.hpp -fieldDescriptor.cpp vmSymbols.hpp - -fieldDescriptor.hpp accessFlags.hpp -fieldDescriptor.hpp constantPoolOop.hpp -fieldDescriptor.hpp constantTag.hpp -fieldDescriptor.hpp fieldType.hpp -fieldDescriptor.hpp klassOop.hpp -fieldDescriptor.hpp oop.inline.hpp -fieldDescriptor.hpp symbolOop.hpp - -fieldType.cpp fieldType.hpp -fieldType.cpp oop.inline.hpp -fieldType.cpp oopFactory.hpp -fieldType.cpp signature.hpp -fieldType.cpp systemDictionary.hpp -fieldType.cpp typeArrayKlass.hpp - -fieldType.hpp allocation.hpp -fieldType.hpp symbolOop.hpp - -filemap.cpp arguments.hpp -filemap.cpp classLoader.hpp -filemap.cpp defaultStream.hpp -filemap.cpp filemap.hpp -filemap.cpp hpi_.hpp -filemap.cpp java.hpp -filemap.cpp os.hpp -filemap.cpp symbolTable.hpp - -filemap.hpp compactingPermGenGen.hpp -filemap.hpp space.hpp - -// forte is jck optional, put cpp deps in includeDB_features -// fprofiler is jck optional, put cpp deps in includeDB_features - -fprofiler.hpp thread_.inline.hpp -fprofiler.hpp timer.hpp - -frame.cpp collectedHeap.inline.hpp -frame.cpp frame.inline.hpp -frame.cpp handles.inline.hpp -frame.cpp interpreter.hpp -frame.cpp javaCalls.hpp -frame.cpp markOop.hpp -frame.cpp methodDataOop.hpp -frame.cpp methodOop.hpp -frame.cpp monitorChunk.hpp -frame.cpp nativeInst_.hpp -frame.cpp oop.inline.hpp -frame.cpp oop.inline2.hpp -frame.cpp oopMapCache.hpp -frame.cpp resourceArea.hpp -frame.cpp sharedRuntime.hpp -frame.cpp signature.hpp -frame.cpp stubCodeGenerator.hpp -frame.cpp stubRoutines.hpp -frame.cpp universe.inline.hpp - -frame.hpp assembler.hpp -frame.hpp methodOop.hpp -frame.hpp monitorChunk.hpp -frame.hpp registerMap.hpp -frame.hpp synchronizer.hpp -frame.hpp top.hpp - -frame.inline.hpp bytecodeInterpreter.hpp -frame.inline.hpp bytecodeInterpreter.inline.hpp -frame.inline.hpp frame.hpp -frame.inline.hpp interpreter.hpp -frame.inline.hpp jniTypes_.hpp -frame.inline.hpp methodOop.hpp -frame.inline.hpp signature.hpp - -frame_.cpp frame.inline.hpp -frame_.cpp handles.inline.hpp -frame_.cpp interpreter.hpp -frame_.cpp javaCalls.hpp -frame_.cpp markOop.hpp -frame_.cpp methodOop.hpp -frame_.cpp monitorChunk.hpp -frame_.cpp oop.inline.hpp -frame_.cpp resourceArea.hpp -frame_.cpp signature.hpp -frame_.cpp stubCodeGenerator.hpp -frame_.cpp stubRoutines.hpp -frame_.cpp vmreg_.inline.hpp - -frame_.hpp generate_platform_dependent_include -frame_.hpp synchronizer.hpp -frame_.hpp top.hpp - -frame_.inline.hpp generate_platform_dependent_include - -gcLocker.cpp gcLocker.inline.hpp -gcLocker.cpp sharedHeap.hpp -gcLocker.cpp resourceArea.hpp - -gcLocker.hpp collectedHeap.hpp -gcLocker.hpp genCollectedHeap.hpp -gcLocker.hpp oop.hpp -gcLocker.hpp os_.inline.hpp -gcLocker.hpp thread_.inline.hpp -gcLocker.hpp universe.hpp - -gcLocker.inline.hpp gcLocker.hpp - -genCollectedHeap.cpp aprofiler.hpp -genCollectedHeap.cpp biasedLocking.hpp -genCollectedHeap.cpp collectedHeap.inline.hpp -genCollectedHeap.cpp collectorCounters.hpp -genCollectedHeap.cpp compactPermGen.hpp -genCollectedHeap.cpp filemap.hpp -genCollectedHeap.cpp fprofiler.hpp -genCollectedHeap.cpp gcLocker.inline.hpp -genCollectedHeap.cpp genCollectedHeap.hpp -genCollectedHeap.cpp genOopClosures.inline.hpp -genCollectedHeap.cpp generation.inline.hpp -genCollectedHeap.cpp generationSpec.hpp -genCollectedHeap.cpp handles.hpp -genCollectedHeap.cpp handles.inline.hpp -genCollectedHeap.cpp icBuffer.hpp -genCollectedHeap.cpp java.hpp -genCollectedHeap.cpp memoryService.hpp -genCollectedHeap.cpp oop.inline.hpp -genCollectedHeap.cpp oop.inline2.hpp -genCollectedHeap.cpp permGen.hpp -genCollectedHeap.cpp resourceArea.hpp -genCollectedHeap.cpp sharedHeap.hpp -genCollectedHeap.cpp space.hpp -genCollectedHeap.cpp symbolTable.hpp -genCollectedHeap.cpp systemDictionary.hpp -genCollectedHeap.cpp vmError.hpp -genCollectedHeap.cpp vmGCOperations.hpp -genCollectedHeap.cpp vmSymbols.hpp -genCollectedHeap.cpp vmThread.hpp -genCollectedHeap.cpp workgroup.hpp - -genCollectedHeap.hpp adaptiveSizePolicy.hpp -genCollectedHeap.hpp collectorPolicy.hpp -genCollectedHeap.hpp generation.hpp -genCollectedHeap.hpp sharedHeap.hpp - -genMarkSweep.cpp codeCache.hpp -genMarkSweep.cpp collectedHeap.inline.hpp -genMarkSweep.cpp copy.hpp -genMarkSweep.cpp events.hpp -genMarkSweep.cpp fprofiler.hpp -genMarkSweep.cpp genCollectedHeap.hpp -genMarkSweep.cpp genMarkSweep.hpp -genMarkSweep.cpp genOopClosures.inline.hpp -genMarkSweep.cpp generation.inline.hpp -genMarkSweep.cpp handles.inline.hpp -genMarkSweep.cpp icBuffer.hpp -genMarkSweep.cpp instanceRefKlass.hpp -genMarkSweep.cpp javaClasses.hpp -genMarkSweep.cpp jvmtiExport.hpp -genMarkSweep.cpp modRefBarrierSet.hpp -genMarkSweep.cpp oop.inline.hpp -genMarkSweep.cpp referencePolicy.hpp -genMarkSweep.cpp space.hpp -genMarkSweep.cpp symbolTable.hpp -genMarkSweep.cpp synchronizer.hpp -genMarkSweep.cpp systemDictionary.hpp -genMarkSweep.cpp thread_.inline.hpp -genMarkSweep.cpp vmSymbols.hpp -genMarkSweep.cpp vmThread.hpp - -genMarkSweep.hpp markSweep.hpp - -genOopClosures.hpp iterator.hpp -genOopClosures.hpp oop.hpp - -genOopClosures.inline.hpp cardTableRS.hpp -genOopClosures.inline.hpp defNewGeneration.hpp -genOopClosures.inline.hpp genCollectedHeap.hpp -genOopClosures.inline.hpp genOopClosures.hpp -genOopClosures.inline.hpp genRemSet.hpp -genOopClosures.inline.hpp generation.hpp -genOopClosures.inline.hpp sharedHeap.hpp -genOopClosures.inline.hpp space.hpp - -genRemSet.cpp cardTableRS.hpp -genRemSet.cpp genRemSet.hpp - -genRemSet.hpp oop.hpp - -generateOopMap.cpp bitMap.inline.hpp -generateOopMap.cpp bytecodeStream.hpp -generateOopMap.cpp generateOopMap.hpp -generateOopMap.cpp handles.inline.hpp -generateOopMap.cpp java.hpp -generateOopMap.cpp oop.inline.hpp -generateOopMap.cpp relocator.hpp -generateOopMap.cpp symbolOop.hpp - -generateOopMap.hpp allocation.inline.hpp -generateOopMap.hpp bytecodeStream.hpp -generateOopMap.hpp methodOop.hpp -generateOopMap.hpp oopsHierarchy.hpp -generateOopMap.hpp signature.hpp -generateOopMap.hpp universe.inline.hpp - -generation.cpp allocation.inline.hpp -generation.cpp blockOffsetTable.inline.hpp -generation.cpp cardTableRS.hpp -generation.cpp collectedHeap.inline.hpp -generation.cpp copy.hpp -generation.cpp events.hpp -generation.cpp gcLocker.inline.hpp -generation.cpp genCollectedHeap.hpp -generation.cpp genMarkSweep.hpp -generation.cpp genOopClosures.hpp -generation.cpp genOopClosures.inline.hpp -generation.cpp generation.hpp -generation.cpp generation.inline.hpp -generation.cpp java.hpp -generation.cpp oop.inline.hpp -generation.cpp spaceDecorator.hpp -generation.cpp space.inline.hpp - -generation.hpp allocation.hpp -generation.hpp collectorCounters.hpp -generation.hpp memRegion.hpp -generation.hpp mutex.hpp -generation.hpp perfData.hpp -generation.hpp referenceProcessor.hpp -generation.hpp universe.hpp -generation.hpp virtualspace.hpp -generation.hpp watermark.hpp - -generation.inline.hpp genCollectedHeap.hpp -generation.inline.hpp generation.hpp -generation.inline.hpp space.hpp - -genOopClosures.hpp oop.hpp - -generationSpec.cpp compactPermGen.hpp -generationSpec.cpp defNewGeneration.hpp -generationSpec.cpp filemap.hpp -generationSpec.cpp genRemSet.hpp -generationSpec.cpp generationSpec.hpp -generationSpec.cpp java.hpp -generationSpec.cpp tenuredGeneration.hpp - -generationSpec.hpp generation.hpp -generationSpec.hpp permGen.hpp - -globalDefinitions.cpp globalDefinitions.hpp -globalDefinitions.cpp os.hpp -globalDefinitions.cpp top.hpp - -globalDefinitions.hpp globalDefinitions_.hpp -globalDefinitions.hpp macros.hpp - -globalDefinitions_.hpp generate_platform_dependent_include - -globalDefinitions_.hpp jni.h - -globals.cpp allocation.inline.hpp -globals.cpp arguments.hpp -globals.cpp globals.hpp -globals.cpp globals_extension.hpp -globals.cpp oop.inline.hpp -globals.cpp ostream.hpp -globals.cpp top.hpp - -globals.hpp debug.hpp -globals.hpp globals_.hpp -globals.hpp globals_.hpp -globals.hpp globals_.hpp - -globals_extension.hpp globals.hpp -globals_extension.hpp top.hpp - -growableArray.cpp growableArray.hpp -growableArray.cpp resourceArea.hpp -growableArray.cpp thread_.inline.hpp - -growableArray.hpp allocation.hpp -growableArray.hpp allocation.inline.hpp -growableArray.hpp debug.hpp -growableArray.hpp globalDefinitions.hpp -growableArray.hpp top.hpp - -handles.cpp allocation.inline.hpp -handles.cpp handles.inline.hpp -handles.cpp oop.inline.hpp -handles.cpp os_.inline.hpp -handles.cpp thread_.inline.hpp - -handles.hpp klass.hpp -handles.hpp klassOop.hpp -handles.hpp top.hpp - -handles.inline.hpp handles.hpp -handles.inline.hpp thread_.inline.hpp - -hashtable.cpp allocation.inline.hpp -hashtable.cpp dtrace.hpp -hashtable.cpp hashtable.hpp -hashtable.cpp hashtable.inline.hpp -hashtable.cpp oop.inline.hpp -hashtable.cpp resourceArea.hpp -hashtable.cpp safepoint.hpp - -hashtable.hpp allocation.hpp -hashtable.hpp handles.hpp -hashtable.hpp oop.hpp -hashtable.hpp symbolOop.hpp - -hashtable.inline.hpp allocation.inline.hpp -hashtable.inline.hpp hashtable.hpp - -heap.cpp heap.hpp -heap.cpp oop.inline.hpp -heap.cpp os.hpp - -heap.hpp allocation.hpp -heap.hpp virtualspace.hpp - -// heapDumper is jck optional, put cpp deps in includeDB_features - -heapDumper.hpp allocation.hpp -heapDumper.hpp klassOop.hpp -heapDumper.hpp oop.hpp -heapDumper.hpp os.hpp - -// heapInspection is jck optional, put cpp deps in includeDB_features - -heapInspection.hpp allocation.inline.hpp -heapInspection.hpp oop.inline.hpp - -histogram.cpp histogram.hpp -histogram.cpp oop.inline.hpp - -histogram.hpp allocation.hpp -histogram.hpp growableArray.hpp -histogram.hpp os.hpp -histogram.hpp os_.inline.hpp - -hpi.cpp hpi.hpp -hpi.cpp jvm.h - -hpi.hpp globalDefinitions.hpp -hpi.hpp hpi_imported.h -hpi.hpp os.hpp -hpi.hpp top.hpp - -hpi_.cpp hpi.hpp -hpi_.cpp oop.inline.hpp -hpi_.cpp os.hpp - -hpi_imported.h jni.h - -icBuffer.cpp assembler_.inline.hpp -icBuffer.cpp collectedHeap.inline.hpp -icBuffer.cpp compiledIC.hpp -icBuffer.cpp icBuffer.hpp -icBuffer.cpp interpreter.hpp -icBuffer.cpp linkResolver.hpp -icBuffer.cpp methodOop.hpp -icBuffer.cpp mutexLocker.hpp -icBuffer.cpp nmethod.hpp -icBuffer.cpp oop.inline.hpp -icBuffer.cpp oop.inline2.hpp -icBuffer.cpp resourceArea.hpp -icBuffer.cpp scopeDesc.hpp -icBuffer.cpp stubRoutines.hpp -icBuffer.cpp universe.inline.hpp - -icBuffer.hpp allocation.hpp -icBuffer.hpp bytecodes.hpp -icBuffer.hpp stubs.hpp - -icBuffer_.cpp assembler.hpp -icBuffer_.cpp assembler_.inline.hpp -icBuffer_.cpp bytecodes.hpp -icBuffer_.cpp collectedHeap.inline.hpp -icBuffer_.cpp icBuffer.hpp -icBuffer_.cpp nativeInst_.hpp -icBuffer_.cpp oop.inline.hpp -icBuffer_.cpp oop.inline2.hpp -icBuffer_.cpp resourceArea.hpp - -icache.cpp icache.hpp -icache.cpp resourceArea.hpp - -icache.hpp allocation.hpp -icache.hpp stubCodeGenerator.hpp - -icache_.cpp assembler_.inline.hpp -icache_.cpp icache.hpp - -icache_.hpp generate_platform_dependent_include - -init.cpp bytecodes.hpp -init.cpp collectedHeap.hpp -init.cpp handles.inline.hpp -init.cpp icBuffer.hpp -init.cpp icache.hpp -init.cpp init.hpp -init.cpp methodHandles.hpp -init.cpp safepoint.hpp -init.cpp sharedRuntime.hpp -init.cpp universe.hpp - -init.hpp top.hpp - -instanceKlass.cpp collectedHeap.inline.hpp -instanceKlass.cpp compileBroker.hpp -instanceKlass.cpp dtrace.hpp -instanceKlass.cpp fieldDescriptor.hpp -instanceKlass.cpp genOopClosures.inline.hpp -instanceKlass.cpp handles.inline.hpp -instanceKlass.cpp instanceKlass.hpp -instanceKlass.cpp instanceOop.hpp -instanceKlass.cpp javaCalls.hpp -instanceKlass.cpp javaClasses.hpp -instanceKlass.cpp jvmti.h -instanceKlass.cpp jvmtiExport.hpp -instanceKlass.cpp jvmtiRedefineClassesTrace.hpp -instanceKlass.cpp markSweep.inline.hpp -instanceKlass.cpp methodOop.hpp -instanceKlass.cpp mutexLocker.hpp -instanceKlass.cpp objArrayKlassKlass.hpp -instanceKlass.cpp oop.inline.hpp -instanceKlass.cpp oopFactory.hpp -instanceKlass.cpp oopMapCache.hpp -instanceKlass.cpp permGen.hpp -instanceKlass.cpp rewriter.hpp -instanceKlass.cpp symbolOop.hpp -instanceKlass.cpp systemDictionary.hpp -instanceKlass.cpp threadService.hpp -instanceKlass.cpp thread_.inline.hpp -instanceKlass.cpp verifier.hpp -instanceKlass.cpp vmSymbols.hpp - -instanceKlass.hpp accessFlags.hpp -instanceKlass.hpp bitMap.inline.hpp -instanceKlass.hpp constMethodOop.hpp -instanceKlass.hpp constantPoolOop.hpp -instanceKlass.hpp handles.hpp -instanceKlass.hpp instanceOop.hpp -instanceKlass.hpp klassOop.hpp -instanceKlass.hpp klassVtable.hpp -instanceKlass.hpp objArrayOop.hpp -instanceKlass.hpp os.hpp - -instanceKlassKlass.cpp collectedHeap.inline.hpp -instanceKlassKlass.cpp constantPoolOop.hpp -instanceKlassKlass.cpp fieldDescriptor.hpp -instanceKlassKlass.cpp gcLocker.hpp -instanceKlassKlass.cpp instanceKlass.hpp -instanceKlassKlass.cpp instanceKlassKlass.hpp -instanceKlassKlass.cpp instanceRefKlass.hpp -instanceKlassKlass.cpp javaClasses.hpp -instanceKlassKlass.cpp jvmtiExport.hpp -instanceKlassKlass.cpp markSweep.inline.hpp -instanceKlassKlass.cpp objArrayKlassKlass.hpp -instanceKlassKlass.cpp objArrayOop.hpp -instanceKlassKlass.cpp oop.inline.hpp -instanceKlassKlass.cpp oop.inline2.hpp -instanceKlassKlass.cpp oopMapCache.hpp -instanceKlassKlass.cpp symbolOop.hpp -instanceKlassKlass.cpp systemDictionary.hpp -instanceKlassKlass.cpp typeArrayOop.hpp - -instanceKlassKlass.hpp klassKlass.hpp - -instanceOop.cpp instanceOop.hpp - -instanceOop.hpp oop.hpp - -instanceRefKlass.cpp collectedHeap.hpp -instanceRefKlass.cpp collectedHeap.inline.hpp -instanceRefKlass.cpp genCollectedHeap.hpp -instanceRefKlass.cpp genOopClosures.inline.hpp -instanceRefKlass.cpp instanceRefKlass.hpp -instanceRefKlass.cpp javaClasses.hpp -instanceRefKlass.cpp markSweep.inline.hpp -instanceRefKlass.cpp oop.inline.hpp -instanceRefKlass.cpp preserveException.hpp -instanceRefKlass.cpp systemDictionary.hpp - -instanceRefKlass.hpp instanceKlass.hpp - -interfaceSupport.cpp collectedHeap.hpp -interfaceSupport.cpp collectedHeap.inline.hpp -interfaceSupport.cpp genCollectedHeap.hpp -interfaceSupport.cpp init.hpp -interfaceSupport.cpp interfaceSupport.hpp -interfaceSupport.cpp markSweep.hpp -interfaceSupport.cpp preserveException.hpp -interfaceSupport.cpp resourceArea.hpp -interfaceSupport.cpp threadLocalStorage.hpp -interfaceSupport.cpp vframe.hpp - -interfaceSupport.hpp gcLocker.hpp -interfaceSupport.hpp globalDefinitions.hpp -interfaceSupport.hpp handles.inline.hpp -interfaceSupport.hpp mutexLocker.hpp -interfaceSupport.hpp orderAccess.hpp -interfaceSupport.hpp os.hpp -interfaceSupport.hpp preserveException.hpp -interfaceSupport.hpp safepoint.hpp -interfaceSupport.hpp thread_.inline.hpp -interfaceSupport.hpp top.hpp -interfaceSupport.hpp vmThread.hpp - -interfaceSupport_.hpp generate_platform_dependent_include - -interp_masm_.cpp arrayOop.hpp -interp_masm_.cpp biasedLocking.hpp -interp_masm_.cpp interp_masm_.hpp -interp_masm_.cpp interpreterRuntime.hpp -interp_masm_.cpp interpreter.hpp -interp_masm_.cpp jvmtiExport.hpp -interp_masm_.cpp jvmtiRedefineClassesTrace.hpp -interp_masm_.cpp jvmtiThreadState.hpp -interp_masm_.cpp markOop.hpp -interp_masm_.cpp methodDataOop.hpp -interp_masm_.cpp methodOop.hpp -interp_masm_.cpp sharedRuntime.hpp -interp_masm_.cpp synchronizer.hpp -interp_masm_.cpp thread_.inline.hpp - -interp_masm_.hpp assembler_.inline.hpp -interp_masm_.hpp invocationCounter.hpp - -interpreter.cpp allocation.inline.hpp -interpreter.cpp arrayOop.hpp -interpreter.cpp assembler.hpp -interpreter.cpp bytecodeHistogram.hpp -interpreter.cpp bytecodeInterpreter.hpp -interpreter.cpp forte.hpp -interpreter.cpp handles.inline.hpp -interpreter.cpp interpreter.hpp -interpreter.cpp interpreterRuntime.hpp -interpreter.cpp interpreter.hpp -interpreter.cpp jvmtiExport.hpp -interpreter.cpp methodDataOop.hpp -interpreter.cpp methodOop.hpp -interpreter.cpp oop.inline.hpp -interpreter.cpp resourceArea.hpp -interpreter.cpp sharedRuntime.hpp -interpreter.cpp stubRoutines.hpp -interpreter.cpp templateTable.hpp -interpreter.cpp timer.hpp - -interpreter.hpp cppInterpreter.hpp -interpreter.hpp stubs.hpp -interpreter.hpp templateInterpreter.hpp - -interpreterRT_.cpp allocation.inline.hpp -interpreterRT_.cpp handles.inline.hpp -interpreterRT_.cpp icache.hpp -interpreterRT_.cpp interfaceSupport.hpp -interpreterRT_.cpp interpreterRuntime.hpp -interpreterRT_.cpp interpreter.hpp -interpreterRT_.cpp methodOop.hpp -interpreterRT_.cpp oop.inline.hpp -interpreterRT_.cpp signature.hpp -interpreterRT_.cpp universe.inline.hpp - -interpreterRT_.hpp allocation.hpp -interpreterRT_.hpp generate_platform_dependent_include - -interpreterRuntime.cpp biasedLocking.hpp -interpreterRuntime.cpp collectedHeap.hpp -interpreterRuntime.cpp compileBroker.hpp -interpreterRuntime.cpp compilationPolicy.hpp -interpreterRuntime.cpp constantPoolOop.hpp -interpreterRuntime.cpp cpCacheOop.hpp -interpreterRuntime.cpp deoptimization.hpp -interpreterRuntime.cpp events.hpp -interpreterRuntime.cpp fieldDescriptor.hpp -interpreterRuntime.cpp handles.inline.hpp -interpreterRuntime.cpp instanceKlass.hpp -interpreterRuntime.cpp interfaceSupport.hpp -interpreterRuntime.cpp interpreterRuntime.hpp -interpreterRuntime.cpp interpreter.hpp -interpreterRuntime.cpp java.hpp -interpreterRuntime.cpp jfieldIDWorkaround.hpp -interpreterRuntime.cpp jvmtiExport.hpp -interpreterRuntime.cpp linkResolver.hpp -interpreterRuntime.cpp methodDataOop.hpp -interpreterRuntime.cpp nativeLookup.hpp -interpreterRuntime.cpp objArrayKlass.hpp -interpreterRuntime.cpp oop.inline.hpp -interpreterRuntime.cpp oopFactory.hpp -interpreterRuntime.cpp osThread.hpp -interpreterRuntime.cpp sharedRuntime.hpp -interpreterRuntime.cpp stubRoutines.hpp -interpreterRuntime.cpp symbolOop.hpp -interpreterRuntime.cpp synchronizer.hpp -interpreterRuntime.cpp systemDictionary.hpp -interpreterRuntime.cpp templateTable.hpp -interpreterRuntime.cpp threadCritical.hpp -interpreterRuntime.cpp universe.inline.hpp -interpreterRuntime.cpp vmSymbols.hpp -interpreterRuntime.cpp vm_version_.hpp - -interpreterRuntime.hpp bytecode.hpp -interpreterRuntime.hpp frame.inline.hpp -interpreterRuntime.hpp linkResolver.hpp -interpreterRuntime.hpp methodOop.hpp -interpreterRuntime.hpp signature.hpp -interpreterRuntime.hpp thread_.inline.hpp -interpreterRuntime.hpp top.hpp -interpreterRuntime.hpp universe.hpp - -interpreter_.cpp arguments.hpp -interpreter_.cpp arrayOop.hpp -interpreter_.cpp assembler.hpp -interpreter_.cpp bytecodeHistogram.hpp -interpreter_.cpp debug.hpp -interpreter_.cpp deoptimization.hpp -interpreter_.cpp frame.inline.hpp -interpreter_.cpp interpreterRuntime.hpp -interpreter_.cpp interpreter.hpp -interpreter_.cpp interpreterGenerator.hpp -interpreter_.cpp jvmtiExport.hpp -interpreter_.cpp jvmtiThreadState.hpp -interpreter_.cpp methodDataOop.hpp -interpreter_.cpp methodHandles.hpp -interpreter_.cpp methodOop.hpp -interpreter_.cpp oop.inline.hpp -interpreter_.cpp sharedRuntime.hpp -interpreter_.cpp stubRoutines.hpp -interpreter_.cpp synchronizer.hpp -interpreter_.cpp templateTable.hpp -interpreter_.cpp timer.hpp -interpreter_.cpp vframeArray.hpp - -interpreter_.hpp generate_platform_dependent_include - -interpreterGenerator.hpp cppInterpreter.hpp -interpreterGenerator.hpp cppInterpreterGenerator.hpp -interpreterGenerator.hpp templateInterpreter.hpp -interpreterGenerator.hpp templateInterpreterGenerator.hpp - -interpreterGenerator_.hpp generate_platform_dependent_include - -invocationCounter.cpp frame.hpp -invocationCounter.cpp handles.inline.hpp -invocationCounter.cpp invocationCounter.hpp - -invocationCounter.hpp allocation.hpp -invocationCounter.hpp exceptions.hpp -invocationCounter.hpp handles.hpp - -intHisto.cpp intHisto.hpp - -intHisto.hpp allocation.hpp -intHisto.hpp growableArray.hpp - -iterator.cpp iterator.hpp -iterator.cpp oop.inline.hpp - -iterator.hpp allocation.hpp -iterator.hpp memRegion.hpp -iterator.hpp prefetch.hpp -iterator.hpp top.hpp - -java.cpp aprofiler.hpp -java.cpp arguments.hpp -java.cpp biasedLocking.hpp -java.cpp bytecodeHistogram.hpp -java.cpp classLoader.hpp -java.cpp codeCache.hpp -java.cpp compilationPolicy.hpp -java.cpp compileBroker.hpp -java.cpp compilerOracle.hpp -java.cpp constantPoolOop.hpp -java.cpp dtrace.hpp -java.cpp fprofiler.hpp -java.cpp genCollectedHeap.hpp -java.cpp generateOopMap.hpp -java.cpp globalDefinitions.hpp -java.cpp histogram.hpp -java.cpp init.hpp -java.cpp instanceKlass.hpp -java.cpp instanceKlassKlass.hpp -java.cpp instanceOop.hpp -java.cpp interfaceSupport.hpp -java.cpp java.hpp -java.cpp jvmtiExport.hpp -java.cpp memprofiler.hpp -java.cpp methodOop.hpp -java.cpp objArrayOop.hpp -java.cpp oop.inline.hpp -java.cpp oopFactory.hpp -java.cpp sharedRuntime.hpp -java.cpp statSampler.hpp -java.cpp symbolOop.hpp -java.cpp symbolTable.hpp -java.cpp systemDictionary.hpp -java.cpp task.hpp -java.cpp thread_.inline.hpp -java.cpp timer.hpp -java.cpp universe.hpp -java.cpp vmError.hpp -java.cpp vm_operations.hpp -java.cpp vm_version_.hpp - -java.hpp os.hpp - -javaAssertions.cpp allocation.inline.hpp -javaAssertions.cpp handles.inline.hpp -javaAssertions.cpp javaAssertions.hpp -javaAssertions.cpp javaClasses.hpp -javaAssertions.cpp oop.inline.hpp -javaAssertions.cpp oopFactory.hpp -javaAssertions.cpp systemDictionary.hpp -javaAssertions.cpp vmSymbols.hpp - -javaAssertions.hpp exceptions.hpp -javaAssertions.hpp objArrayOop.hpp -javaAssertions.hpp ostream.hpp -javaAssertions.hpp typeArrayOop.hpp - -javaCalls.cpp compilationPolicy.hpp -javaCalls.cpp compileBroker.hpp -javaCalls.cpp handles.inline.hpp -javaCalls.cpp interfaceSupport.hpp -javaCalls.cpp interpreter.hpp -javaCalls.cpp javaCalls.hpp -javaCalls.cpp jniCheck.hpp -javaCalls.cpp linkResolver.hpp -javaCalls.cpp mutexLocker.hpp -javaCalls.cpp nmethod.hpp -javaCalls.cpp oop.inline.hpp -javaCalls.cpp signature.hpp -javaCalls.cpp stubRoutines.hpp -javaCalls.cpp systemDictionary.hpp -javaCalls.cpp thread_.inline.hpp -javaCalls.cpp universe.inline.hpp -javaCalls.cpp vmSymbols.hpp -javaCalls.hpp allocation.hpp - -javaCalls.hpp handles.hpp -javaCalls.hpp javaFrameAnchor.hpp -javaCalls.hpp jniTypes_.hpp -javaCalls.hpp methodOop.hpp -javaCalls.hpp thread_.inline.hpp -javaCalls.hpp vmThread.hpp - -javaClasses.cpp debugInfo.hpp -javaClasses.cpp fieldDescriptor.hpp -javaClasses.cpp handles.inline.hpp -javaClasses.cpp instanceKlass.hpp -javaClasses.cpp interfaceSupport.hpp -javaClasses.cpp interpreter.hpp -javaClasses.cpp java.hpp -javaClasses.cpp javaCalls.hpp -javaClasses.cpp javaClasses.hpp -javaClasses.cpp klass.hpp -javaClasses.cpp klassOop.hpp -javaClasses.cpp methodOop.hpp -javaClasses.cpp oopFactory.hpp -javaClasses.cpp pcDesc.hpp -javaClasses.cpp preserveException.hpp -javaClasses.cpp resourceArea.hpp -javaClasses.cpp safepoint.hpp -javaClasses.cpp symbolOop.hpp -javaClasses.cpp symbolTable.hpp -javaClasses.cpp thread_.inline.hpp -javaClasses.cpp typeArrayOop.hpp -javaClasses.cpp universe.inline.hpp -javaClasses.cpp vframe.hpp -javaClasses.cpp vmSymbols.hpp - -javaClasses.hpp jvmti.h -javaClasses.hpp oop.hpp -javaClasses.hpp os.hpp -javaClasses.hpp systemDictionary.hpp -javaClasses.hpp utf8.hpp - -javaFrameAnchor.hpp globalDefinitions.hpp -javaFrameAnchor.hpp orderAccess_.inline.hpp - -javaFrameAnchor_.hpp generate_platform_dependent_include - -jni.cpp allocation.inline.hpp -jni.cpp classLoader.hpp -jni.cpp compilationPolicy.hpp -jni.cpp defaultStream.hpp -jni.cpp dtrace.hpp -jni.cpp events.hpp -jni.cpp fieldDescriptor.hpp -jni.cpp fprofiler.hpp -jni.cpp gcLocker.inline.hpp -jni.cpp handles.inline.hpp -jni.cpp histogram.hpp -jni.cpp instanceKlass.hpp -jni.cpp instanceOop.hpp -jni.cpp interfaceSupport.hpp -jni.cpp java.hpp -jni.cpp javaCalls.hpp -jni.cpp javaClasses.hpp -jni.cpp jfieldIDWorkaround.hpp -jni.cpp jni.h -jni.cpp jniCheck.hpp -jni.cpp jniFastGetField.hpp -jni.cpp jniTypes_.hpp -jni.cpp jvm.h -jni.cpp jvm_misc.hpp -jni.cpp jvmtiExport.hpp -jni.cpp jvmtiThreadState.hpp -jni.cpp linkResolver.hpp -jni.cpp markOop.hpp -jni.cpp methodOop.hpp -jni.cpp objArrayKlass.hpp -jni.cpp objArrayOop.hpp -jni.cpp oop.inline.hpp -jni.cpp oopFactory.hpp -jni.cpp os_.inline.hpp -jni.cpp reflection.hpp -jni.cpp runtimeService.hpp -jni.cpp sharedRuntime.hpp -jni.cpp signature.hpp -jni.cpp symbolOop.hpp -jni.cpp symbolTable.hpp -jni.cpp systemDictionary.hpp -jni.cpp thread_.inline.hpp -jni.cpp typeArrayKlass.hpp -jni.cpp typeArrayOop.hpp -jni.cpp universe.inline.hpp -jni.cpp vmSymbols.hpp -jni.cpp vm_operations.hpp - -// jniCheck is jck optional, put cpp deps in includeDB_features - -jniFastGetField.cpp jniFastGetField.hpp - -jniFastGetField.hpp allocation.hpp -jniFastGetField.hpp jvm_misc.hpp - -jniFastGetField_.cpp assembler_.inline.hpp -jniFastGetField_.cpp jniFastGetField.hpp -jniFastGetField_.cpp jvm_misc.hpp -jniFastGetField_.cpp resourceArea.hpp -jniFastGetField_.cpp safepoint.hpp - -jniHandles.cpp jniHandles.hpp -jniHandles.cpp mutexLocker.hpp -jniHandles.cpp oop.inline.hpp -jniHandles.cpp systemDictionary.hpp -jniHandles.cpp thread_.inline.hpp - -jniHandles.hpp handles.hpp -jniHandles.hpp top.hpp - -jniPeriodicChecker.cpp allocation.inline.hpp -jniPeriodicChecker.cpp jniPeriodicChecker.hpp -jniPeriodicChecker.cpp task.hpp - -jniTypes_.hpp allocation.hpp -jniTypes_.hpp jni.h -jniTypes_.hpp oop.hpp - -jni_.h generate_platform_dependent_include - -jvm.cpp arguments.hpp -jvm.cpp attachListener.hpp -jvm.cpp classLoader.hpp -jvm.cpp collectedHeap.inline.hpp -jvm.cpp copy.hpp -jvm.cpp defaultStream.hpp -jvm.cpp dtrace.hpp -jvm.cpp dtraceJSDT.hpp -jvm.cpp events.hpp -jvm.cpp handles.inline.hpp -jvm.cpp histogram.hpp -jvm.cpp hpi.hpp -jvm.cpp hpi_.hpp -jvm.cpp init.hpp -jvm.cpp instanceKlass.hpp -jvm.cpp interfaceSupport.hpp -jvm.cpp java.hpp -jvm.cpp javaAssertions.hpp -jvm.cpp javaCalls.hpp -jvm.cpp javaClasses.hpp -jvm.cpp jfieldIDWorkaround.hpp -jvm.cpp jvm.h -jvm.cpp jvm_.h -jvm.cpp jvm_misc.hpp -jvm.cpp jvmtiExport.hpp -jvm.cpp jvmtiThreadState.hpp -jvm.cpp management.hpp -jvm.cpp nativeLookup.hpp -jvm.cpp objArrayKlass.hpp -jvm.cpp oopFactory.hpp -jvm.cpp os.hpp -jvm.cpp perfData.hpp -jvm.cpp privilegedStack.hpp -jvm.cpp reflection.hpp -jvm.cpp symbolTable.hpp -jvm.cpp systemDictionary.hpp -jvm.cpp threadService.hpp -jvm.cpp top.hpp -jvm.cpp universe.inline.hpp -jvm.cpp utf8.hpp -jvm.cpp vframe.hpp -jvm.cpp vmSymbols.hpp -jvm.cpp vm_operations.hpp - -jvm.h globalDefinitions.hpp -jvm.h jni.h -jvm.h jvm_.h -jvm.h reflectionCompat.hpp - -jvm_.cpp interfaceSupport.hpp -jvm_.cpp jvm.h -jvm_.cpp osThread.hpp - -jvm_misc.hpp handles.hpp -jvm_misc.hpp jni.h - -jvmtiExport.hpp allocation.hpp -jvmtiExport.hpp globalDefinitions.hpp -jvmtiExport.hpp growableArray.hpp -jvmtiExport.hpp handles.hpp -jvmtiExport.hpp iterator.hpp -jvmtiExport.hpp jvmti.h -jvmtiExport.hpp jvmticmlr.h -jvmtiExport.hpp oop.hpp -jvmtiExport.hpp oopsHierarchy.hpp - -jvmtiThreadState.hpp allocation.hpp -jvmtiThreadState.hpp allocation.inline.hpp -jvmtiThreadState.hpp growableArray.hpp -jvmtiThreadState.hpp jvmti.h -jvmtiThreadState.hpp jvmtiEventController.hpp -jvmtiThreadState.hpp thread.hpp - -klass.cpp atomic.hpp -klass.cpp collectedHeap.inline.hpp -klass.cpp instanceKlass.hpp -klass.cpp klass.inline.hpp -klass.cpp klassOop.hpp -klass.cpp oop.inline.hpp -klass.cpp oop.inline2.hpp -klass.cpp oopFactory.hpp -klass.cpp resourceArea.hpp -klass.cpp systemDictionary.hpp -klass.cpp vmSymbols.hpp - -klass.hpp accessFlags.hpp -klass.hpp genOopClosures.hpp -klass.hpp iterator.hpp -klass.hpp klassOop.hpp -klass.hpp klassPS.hpp -klass.hpp memRegion.hpp -klass.hpp oop.hpp -klass.hpp specialized_oop_closures.hpp - -klass.inline.hpp klass.hpp -klass.inline.hpp markOop.hpp - -klassKlass.cpp collectedHeap.hpp -klassKlass.cpp collectedHeap.inline.hpp -klassKlass.cpp constantPoolKlass.hpp -klassKlass.cpp handles.inline.hpp -klassKlass.cpp instanceKlass.hpp -klassKlass.cpp instanceOop.hpp -klassKlass.cpp klassKlass.hpp -klassKlass.cpp klassOop.hpp -klassKlass.cpp markSweep.inline.hpp -klassKlass.cpp methodKlass.hpp -klassKlass.cpp objArrayKlass.hpp -klassKlass.cpp oop.inline.hpp -klassKlass.cpp oop.inline2.hpp -klassKlass.cpp oopFactory.hpp -klassKlass.cpp permGen.hpp -klassKlass.cpp symbolKlass.hpp -klassKlass.cpp symbolOop.hpp -klassKlass.cpp typeArrayKlass.hpp - -klassKlass.hpp klass.hpp -klassKlass.hpp klassOop.hpp -klassKlass.hpp oopFactory.hpp - -klassOop.cpp klassOop.hpp - -klassOop.hpp oop.hpp - -klassVtable.cpp arguments.hpp -klassVtable.cpp copy.hpp -klassVtable.cpp gcLocker.hpp -klassVtable.cpp handles.inline.hpp -klassVtable.cpp instanceKlass.hpp -klassVtable.cpp jvmtiRedefineClassesTrace.hpp -klassVtable.cpp klassOop.hpp -klassVtable.cpp klassVtable.hpp -klassVtable.cpp markSweep.inline.hpp -klassVtable.cpp methodOop.hpp -klassVtable.cpp objArrayOop.hpp -klassVtable.cpp oop.inline.hpp -klassVtable.cpp resourceArea.hpp -klassVtable.cpp systemDictionary.hpp -klassVtable.cpp universe.inline.hpp -klassVtable.cpp vmSymbols.hpp - -klassVtable.hpp allocation.hpp -klassVtable.hpp growableArray.hpp -klassVtable.hpp handles.hpp -klassVtable.hpp oopsHierarchy.hpp - -linkResolver.cpp bytecode.hpp -linkResolver.cpp collectedHeap.inline.hpp -linkResolver.cpp compilationPolicy.hpp -linkResolver.cpp compileBroker.hpp -linkResolver.cpp fieldDescriptor.hpp -linkResolver.cpp frame.inline.hpp -linkResolver.cpp handles.inline.hpp -linkResolver.cpp instanceKlass.hpp -linkResolver.cpp interpreterRuntime.hpp -linkResolver.cpp linkResolver.hpp -linkResolver.cpp methodHandles.hpp -linkResolver.cpp nativeLookup.hpp -linkResolver.cpp objArrayOop.hpp -linkResolver.cpp reflection.hpp -linkResolver.cpp resourceArea.hpp -linkResolver.cpp signature.hpp -linkResolver.cpp systemDictionary.hpp -linkResolver.cpp thread_.inline.hpp -linkResolver.cpp universe.inline.hpp -linkResolver.cpp vmSymbols.hpp -linkResolver.cpp vmThread.hpp - -linkResolver.hpp methodOop.hpp -linkResolver.hpp top.hpp - -liveRange.hpp copy.hpp - -loaderConstraints.cpp handles.inline.hpp -loaderConstraints.cpp hashtable.inline.hpp -loaderConstraints.cpp loaderConstraints.hpp -loaderConstraints.cpp oop.inline.hpp -loaderConstraints.cpp resourceArea.hpp -loaderConstraints.cpp safepoint.hpp - -loaderConstraints.hpp dictionary.hpp -loaderConstraints.hpp placeholders.hpp -loaderConstraints.hpp hashtable.hpp - -location.cpp debugInfo.hpp -location.cpp location.hpp - -location.hpp allocation.hpp -location.hpp assembler.hpp -location.hpp vmreg.hpp - -lowMemoryDetector.cpp interfaceSupport.hpp -lowMemoryDetector.cpp java.hpp -lowMemoryDetector.cpp javaCalls.hpp -lowMemoryDetector.cpp lowMemoryDetector.hpp -lowMemoryDetector.cpp management.hpp -lowMemoryDetector.cpp mutex.hpp -lowMemoryDetector.cpp mutexLocker.hpp -lowMemoryDetector.cpp oop.inline.hpp -lowMemoryDetector.cpp systemDictionary.hpp -lowMemoryDetector.cpp vmSymbols.hpp - -lowMemoryDetector.hpp allocation.hpp -lowMemoryDetector.hpp memoryPool.hpp -lowMemoryDetector.hpp memoryService.hpp - -management.cpp arguments.hpp -management.cpp classLoadingService.hpp -management.cpp compileBroker.hpp -management.cpp handles.inline.hpp -management.cpp heapDumper.hpp -management.cpp interfaceSupport.hpp -management.cpp iterator.hpp -management.cpp javaCalls.hpp -management.cpp jniHandles.hpp -management.cpp klass.hpp -management.cpp klassOop.hpp -management.cpp lowMemoryDetector.hpp -management.cpp management.hpp -management.cpp memoryManager.hpp -management.cpp memoryPool.hpp -management.cpp memoryService.hpp -management.cpp objArrayKlass.hpp -management.cpp oop.inline.hpp -management.cpp oopFactory.hpp -management.cpp os.hpp -management.cpp resourceArea.hpp -management.cpp runtimeService.hpp -management.cpp systemDictionary.hpp -management.cpp threadService.hpp - -management.hpp allocation.hpp -management.hpp handles.hpp -management.hpp jmm.h -management.hpp timer.hpp - -markOop.cpp markOop.hpp -markOop.cpp thread_.inline.hpp - -markOop.hpp oop.hpp - -markOop.inline.hpp globals.hpp -markOop.inline.hpp klass.hpp -markOop.inline.hpp klassOop.hpp -markOop.inline.hpp markOop.hpp - -markSweep.cpp compileBroker.hpp -markSweep.cpp methodDataOop.hpp -markSweep.cpp objArrayKlass.inline.hpp - -markSweep.hpp collectedHeap.hpp -markSweep.hpp taskqueue.hpp - -memRegion.cpp globals.hpp -memRegion.cpp memRegion.hpp - -memRegion.hpp allocation.hpp -memRegion.hpp debug.hpp -memRegion.hpp globalDefinitions.hpp - -memoryManager.cpp systemDictionary.hpp -memoryManager.cpp vmSymbols.hpp -memoryManager.cpp dtrace.hpp -memoryManager.cpp handles.inline.hpp -memoryManager.cpp javaCalls.hpp -memoryManager.cpp lowMemoryDetector.hpp -memoryManager.cpp management.hpp -memoryManager.cpp memoryManager.hpp -memoryManager.cpp memoryPool.hpp -memoryManager.cpp memoryService.hpp -memoryManager.cpp oop.inline.hpp - -memoryManager.hpp allocation.hpp -memoryManager.hpp memoryUsage.hpp -memoryManager.hpp timer.hpp - -memoryPool.cpp systemDictionary.hpp -memoryPool.cpp vmSymbols.hpp -memoryPool.cpp handles.inline.hpp -memoryPool.cpp javaCalls.hpp -memoryPool.cpp lowMemoryDetector.hpp -memoryPool.cpp management.hpp -memoryPool.cpp memoryManager.hpp -memoryPool.cpp memoryPool.hpp -memoryPool.cpp oop.inline.hpp - -memoryPool.hpp defNewGeneration.hpp -memoryPool.hpp heap.hpp -memoryPool.hpp memoryUsage.hpp -memoryPool.hpp mutableSpace.hpp -memoryPool.hpp space.hpp - -memoryService.cpp classLoadingService.hpp -memoryService.cpp collectorPolicy.hpp -memoryService.cpp defNewGeneration.hpp -memoryService.cpp genCollectedHeap.hpp -memoryService.cpp generation.hpp -memoryService.cpp generationSpec.hpp -memoryService.cpp growableArray.hpp -memoryService.cpp heap.hpp -memoryService.cpp javaCalls.hpp -memoryService.cpp lowMemoryDetector.hpp -memoryService.cpp management.hpp -memoryService.cpp memRegion.hpp -memoryService.cpp memoryManager.hpp -memoryService.cpp memoryPool.hpp -memoryService.cpp memoryService.hpp -memoryService.cpp mutableSpace.hpp -memoryService.cpp oop.inline.hpp -memoryService.cpp permGen.hpp -memoryService.cpp systemDictionary.hpp -memoryService.cpp tenuredGeneration.hpp -memoryService.cpp vmSymbols.hpp - -memoryService.hpp allocation.hpp -memoryService.hpp generation.hpp -memoryService.hpp handles.hpp -memoryService.hpp memoryUsage.hpp - -memoryUsage.hpp globalDefinitions.hpp - -memprofiler.cpp codeCache.hpp -memprofiler.cpp collectedHeap.inline.hpp -memprofiler.cpp generation.hpp -memprofiler.cpp handles.inline.hpp -memprofiler.cpp jniHandles.hpp -memprofiler.cpp memprofiler.hpp -memprofiler.cpp mutexLocker.hpp -memprofiler.cpp oopMapCache.hpp -memprofiler.cpp os.hpp -memprofiler.cpp permGen.hpp -memprofiler.cpp resourceArea.hpp -memprofiler.cpp systemDictionary.hpp -memprofiler.cpp task.hpp -memprofiler.cpp thread_.inline.hpp -memprofiler.cpp vmThread.hpp - -methodComparator.cpp globalDefinitions.hpp -methodComparator.cpp handles.inline.hpp -methodComparator.cpp jvmtiRedefineClassesTrace.hpp -methodComparator.cpp methodComparator.hpp -methodComparator.cpp oop.inline.hpp -methodComparator.cpp symbolOop.hpp - -methodComparator.hpp bytecodeStream.hpp -methodComparator.hpp constantPoolOop.hpp -methodComparator.hpp methodOop.hpp - -methodDataKlass.cpp collectedHeap.inline.hpp -methodDataKlass.cpp gcLocker.hpp -methodDataKlass.cpp handles.inline.hpp -methodDataKlass.cpp klassOop.hpp -methodDataKlass.cpp markSweep.inline.hpp -methodDataKlass.cpp methodDataKlass.hpp -methodDataKlass.cpp methodDataOop.hpp -methodDataKlass.cpp oop.inline.hpp -methodDataKlass.cpp oop.inline2.hpp -methodDataKlass.cpp resourceArea.hpp -methodDataKlass.cpp universe.inline.hpp - -methodDataKlass.hpp klass.hpp - -methodDataOop.cpp bytecode.hpp -methodDataOop.cpp bytecodeStream.hpp -methodDataOop.cpp compilationPolicy.hpp -methodDataOop.cpp deoptimization.hpp -methodDataOop.cpp handles.inline.hpp -methodDataOop.cpp linkResolver.hpp -methodDataOop.cpp markSweep.inline.hpp -methodDataOop.cpp methodDataOop.hpp -methodDataOop.cpp oop.inline.hpp -methodDataOop.cpp systemDictionary.hpp - -methodDataOop.hpp bytecodes.hpp -methodDataOop.hpp oop.hpp -methodDataOop.hpp orderAccess.hpp -methodDataOop.hpp universe.hpp -methodDataOop.hpp methodOop.hpp - -methodHandleWalk.hpp methodHandles.hpp - -methodHandleWalk.cpp methodHandleWalk.hpp -methodHandleWalk.cpp oopFactory.hpp -methodHandleWalk.cpp rewriter.hpp - -methodHandles.hpp frame.inline.hpp -methodHandles.hpp globals.hpp -methodHandles.hpp interfaceSupport.hpp -methodHandles.hpp javaClasses.hpp -methodHandles.hpp no_precompiled_headers -methodHandles.hpp vmSymbols.hpp - -methodHandles.cpp allocation.inline.hpp -methodHandles.cpp interpreter.hpp -methodHandles.cpp javaCalls.hpp -methodHandles.cpp methodHandles.hpp -methodHandles.cpp oopFactory.hpp -methodHandles.cpp reflection.hpp -methodHandles.cpp signature.hpp -methodHandles.cpp stubRoutines.hpp -methodHandles.cpp symbolTable.hpp - -methodHandles_.cpp allocation.inline.hpp -methodHandles_.cpp interpreter.hpp -methodHandles_.cpp methodHandles.hpp - -methodKlass.cpp collectedHeap.inline.hpp -methodKlass.cpp constMethodKlass.hpp -methodKlass.cpp gcLocker.hpp -methodKlass.cpp handles.inline.hpp -methodKlass.cpp interpreter.hpp -methodKlass.cpp javaClasses.hpp -methodKlass.cpp klassOop.hpp -methodKlass.cpp markSweep.inline.hpp -methodKlass.cpp methodDataOop.hpp -methodKlass.cpp methodKlass.hpp -methodKlass.cpp oop.inline.hpp -methodKlass.cpp oop.inline2.hpp -methodKlass.cpp resourceArea.hpp -methodKlass.cpp symbolOop.hpp -methodKlass.cpp universe.inline.hpp - -methodKlass.hpp klass.hpp -methodKlass.hpp klassOop.hpp -methodKlass.hpp methodOop.hpp - -methodLiveness.cpp allocation.inline.hpp -methodLiveness.cpp bitMap.inline.hpp -methodLiveness.cpp bytecode.hpp -methodLiveness.cpp bytecodes.hpp -methodLiveness.cpp ciMethod.hpp -methodLiveness.cpp ciMethodBlocks.hpp -methodLiveness.cpp ciStreams.hpp -methodLiveness.cpp methodLiveness.hpp - -methodLiveness.hpp bitMap.hpp -methodLiveness.hpp growableArray.hpp - -methodOop.cpp arguments.hpp -methodOop.cpp bytecodeStream.hpp -methodOop.cpp bytecodeTracer.hpp -methodOop.cpp bytecodes.hpp -methodOop.cpp collectedHeap.inline.hpp -methodOop.cpp compilationPolicy.hpp -methodOop.cpp debugInfoRec.hpp -methodOop.cpp frame.inline.hpp -methodOop.cpp gcLocker.hpp -methodOop.cpp gcTaskThread.hpp -methodOop.cpp generation.hpp -methodOop.cpp handles.inline.hpp -methodOop.cpp interpreter.hpp -methodOop.cpp jvmtiExport.hpp -methodOop.cpp klassOop.hpp -methodOop.cpp methodDataOop.hpp -methodOop.cpp methodHandleWalk.hpp -methodOop.cpp methodOop.hpp -methodOop.cpp nativeLookup.hpp -methodOop.cpp oop.inline.hpp -methodOop.cpp oopFactory.hpp -methodOop.cpp oopMapCache.hpp -methodOop.cpp relocator.hpp -methodOop.cpp sharedRuntime.hpp -methodOop.cpp signature.hpp -methodOop.cpp symbolOop.hpp -methodOop.cpp systemDictionary.hpp -methodOop.cpp xmlstream.hpp - -methodOop.hpp accessFlags.hpp -methodOop.hpp compressedStream.hpp -methodOop.hpp constMethodOop.hpp -methodOop.hpp constantPoolOop.hpp -methodOop.hpp growableArray.hpp -methodOop.hpp instanceKlass.hpp -methodOop.hpp invocationCounter.hpp -methodOop.hpp oop.hpp -methodOop.hpp oopMap.hpp -methodOop.hpp typeArrayOop.hpp -methodOop.hpp vmSymbols.hpp - -modRefBarrierSet.hpp barrierSet.hpp - -monitorChunk.cpp allocation.inline.hpp -monitorChunk.cpp monitorChunk.hpp -monitorChunk.cpp oop.inline.hpp - -monitorChunk.hpp synchronizer.hpp - -mutex.cpp events.hpp -mutex.cpp mutex.hpp -mutex.cpp mutex_.inline.hpp -mutex.cpp osThread.hpp -mutex.cpp thread_.inline.hpp - -mutex.hpp allocation.hpp -mutex.hpp histogram.hpp -mutex.hpp os.hpp - -mutexLocker.cpp mutexLocker.hpp -mutexLocker.cpp safepoint.hpp -mutexLocker.cpp threadLocalStorage.hpp -mutexLocker.cpp thread_.inline.hpp -mutexLocker.cpp vmThread.hpp - -mutexLocker.hpp allocation.hpp -mutexLocker.hpp mutex.hpp -mutexLocker.hpp os_.inline.hpp - -mutex_.cpp events.hpp -mutex_.cpp interfaceSupport.hpp -mutex_.cpp mutex.hpp -mutex_.cpp mutex_.inline.hpp -mutex_.cpp thread_.inline.hpp - -mutex_.inline.hpp interfaceSupport.hpp -mutex_.inline.hpp os_.inline.hpp -mutex_.inline.hpp thread_.inline.hpp - -nativeInst_.cpp assembler_.inline.hpp -nativeInst_.cpp handles.hpp -nativeInst_.cpp nativeInst_.hpp -nativeInst_.cpp oop.inline.hpp -nativeInst_.cpp ostream.hpp -nativeInst_.cpp resourceArea.hpp -nativeInst_.cpp sharedRuntime.hpp -nativeInst_.cpp stubRoutines.hpp - -nativeInst_.hpp allocation.hpp -nativeInst_.hpp assembler.hpp -nativeInst_.hpp icache.hpp -nativeInst_.hpp os.hpp -nativeInst_.hpp top.hpp - -nativeLookup.cpp arguments.hpp -nativeLookup.cpp handles.inline.hpp -nativeLookup.cpp hpi.hpp -nativeLookup.cpp instanceKlass.hpp -nativeLookup.cpp javaCalls.hpp -nativeLookup.cpp javaClasses.hpp -nativeLookup.cpp jvm_misc.hpp -nativeLookup.cpp methodOop.hpp -nativeLookup.cpp nativeLookup.hpp -nativeLookup.cpp oop.inline.hpp -nativeLookup.cpp oopFactory.hpp -nativeLookup.cpp os_.inline.hpp -nativeLookup.cpp resourceArea.hpp -nativeLookup.cpp sharedRuntime.hpp -nativeLookup.cpp signature.hpp -nativeLookup.cpp symbolOop.hpp -nativeLookup.cpp systemDictionary.hpp -nativeLookup.cpp universe.inline.hpp -nativeLookup.cpp vmSymbols.hpp - -nativeLookup.hpp handles.hpp -nativeLookup.hpp top.hpp - -nmethod.cpp abstractCompiler.hpp -nmethod.cpp bytecode.hpp -nmethod.cpp codeCache.hpp -nmethod.cpp compileLog.hpp -nmethod.cpp compiledIC.hpp -nmethod.cpp compilerOracle.hpp -nmethod.cpp disassembler.hpp -nmethod.cpp dtrace.hpp -nmethod.cpp events.hpp -nmethod.cpp jvmtiRedefineClassesTrace.hpp -nmethod.cpp methodDataOop.hpp -nmethod.cpp nmethod.hpp -nmethod.cpp scopeDesc.hpp -nmethod.cpp sharedRuntime.hpp -nmethod.cpp sweeper.hpp -nmethod.cpp xmlstream.hpp - -nmethod.hpp codeBlob.hpp -nmethod.hpp pcDesc.hpp - -numberSeq.cpp debug.hpp -numberSeq.cpp numberSeq.hpp -numberSeq.cpp globalDefinitions.hpp -numberSeq.cpp allocation.inline.hpp - -objArrayKlass.cpp collectedHeap.inline.hpp -objArrayKlass.cpp copy.hpp -objArrayKlass.cpp genOopClosures.inline.hpp -objArrayKlass.cpp handles.inline.hpp -objArrayKlass.cpp instanceKlass.hpp -objArrayKlass.cpp markSweep.inline.hpp -objArrayKlass.cpp mutexLocker.hpp -objArrayKlass.cpp objArrayKlass.hpp -objArrayKlass.cpp objArrayKlass.inline.hpp -objArrayKlass.cpp objArrayKlassKlass.hpp -objArrayKlass.cpp objArrayOop.hpp -objArrayKlass.cpp oop.inline.hpp -objArrayKlass.cpp oop.inline2.hpp -objArrayKlass.cpp resourceArea.hpp -objArrayKlass.cpp symbolOop.hpp -objArrayKlass.cpp systemDictionary.hpp -objArrayKlass.cpp universe.inline.hpp -objArrayKlass.cpp vmSymbols.hpp - -objArrayKlass.hpp arrayKlass.hpp -objArrayKlass.hpp instanceKlass.hpp -objArrayKlass.hpp specialized_oop_closures.hpp - -objArrayKlass.inline.hpp objArrayKlass.hpp - -objArrayKlassKlass.cpp collectedHeap.inline.hpp -objArrayKlassKlass.cpp instanceKlass.hpp -objArrayKlassKlass.cpp javaClasses.hpp -objArrayKlassKlass.cpp markSweep.inline.hpp -objArrayKlassKlass.cpp objArrayKlassKlass.hpp -objArrayKlassKlass.cpp oop.inline.hpp -objArrayKlassKlass.cpp oop.inline2.hpp -objArrayKlassKlass.cpp systemDictionary.hpp - -objArrayKlassKlass.hpp arrayKlassKlass.hpp -objArrayKlassKlass.hpp objArrayKlass.hpp - -objArrayOop.cpp objArrayKlass.hpp -objArrayOop.cpp objArrayOop.hpp -objArrayOop.cpp oop.inline.hpp - -objArrayOop.hpp arrayOop.hpp - -objectMonitor.hpp os.hpp - -objectMonitor_.cpp dtrace.hpp -objectMonitor_.cpp interfaceSupport.hpp -objectMonitor_.cpp objectMonitor.hpp -objectMonitor_.cpp objectMonitor.inline.hpp -objectMonitor_.cpp oop.inline.hpp -objectMonitor_.cpp osThread.hpp -objectMonitor_.cpp os_.inline.hpp -objectMonitor_.cpp threadService.hpp -objectMonitor_.cpp thread_.inline.hpp -objectMonitor_.cpp vmSymbols.hpp - -objectMonitor_.hpp generate_platform_dependent_include -objectMonitor_.hpp os_.inline.hpp -objectMonitor_.hpp thread_.inline.hpp -objectMonitor_.hpp top.hpp - -objectMonitor_.inline.hpp generate_platform_dependent_include - -oop.cpp copy.hpp -oop.cpp handles.inline.hpp -oop.cpp javaClasses.hpp -oop.cpp oop.inline.hpp -oop.cpp thread_.inline.hpp - -oop.hpp iterator.hpp -oop.hpp memRegion.hpp -oop.hpp specialized_oop_closures.hpp -oop.hpp top.hpp - -oop.inline.hpp ageTable.hpp -oop.inline.hpp arrayKlass.hpp -oop.inline.hpp arrayOop.hpp -oop.inline.hpp atomic.hpp -oop.inline.hpp barrierSet.inline.hpp -oop.inline.hpp bytes_.hpp -oop.inline.hpp cardTableModRefBS.hpp -oop.inline.hpp collectedHeap.inline.hpp -oop.inline.hpp compactingPermGenGen.hpp -oop.inline.hpp genCollectedHeap.hpp -oop.inline.hpp generation.hpp -oop.inline.hpp klass.hpp -oop.inline.hpp klassOop.hpp -oop.inline.hpp markOop.inline.hpp -oop.inline.hpp markSweep.inline.hpp -oop.inline.hpp oop.hpp -oop.inline.hpp os.hpp -oop.inline.hpp permGen.hpp -oop.inline.hpp specialized_oop_closures.hpp - -oop.inline2.hpp collectedHeap.hpp -oop.inline2.hpp generation.hpp -oop.inline2.hpp oop.hpp -oop.inline2.hpp permGen.hpp -oop.inline2.hpp universe.hpp - -oopFactory.cpp collectedHeap.inline.hpp -oopFactory.cpp compiledICHolderKlass.hpp -oopFactory.cpp constMethodKlass.hpp -oopFactory.cpp constantPoolKlass.hpp -oopFactory.cpp cpCacheKlass.hpp -oopFactory.cpp instanceKlass.hpp -oopFactory.cpp instanceKlassKlass.hpp -oopFactory.cpp instanceOop.hpp -oopFactory.cpp javaClasses.hpp -oopFactory.cpp klassKlass.hpp -oopFactory.cpp klassOop.hpp -oopFactory.cpp methodDataKlass.hpp -oopFactory.cpp methodKlass.hpp -oopFactory.cpp objArrayOop.hpp -oopFactory.cpp oop.inline.hpp -oopFactory.cpp oopFactory.hpp -oopFactory.cpp resourceArea.hpp -oopFactory.cpp symbolTable.hpp -oopFactory.cpp systemDictionary.hpp -oopFactory.cpp universe.inline.hpp -oopFactory.cpp vmSymbols.hpp - -oopFactory.hpp growableArray.hpp -oopFactory.hpp klassOop.hpp -oopFactory.hpp objArrayKlass.hpp -oopFactory.hpp oop.hpp -oopFactory.hpp symbolTable.hpp -oopFactory.hpp systemDictionary.hpp -oopFactory.hpp typeArrayKlass.hpp -oopFactory.hpp universe.hpp - -oopMap.cpp allocation.inline.hpp -oopMap.cpp codeBlob.hpp -oopMap.cpp codeCache.hpp -oopMap.cpp collectedHeap.hpp -oopMap.cpp frame.inline.hpp -oopMap.cpp nmethod.hpp -oopMap.cpp oopMap.hpp -oopMap.cpp resourceArea.hpp -oopMap.cpp scopeDesc.hpp -oopMap.cpp signature.hpp - -oopMap.hpp allocation.hpp -oopMapCache.cpp jvmtiRedefineClassesTrace.hpp -oopMap.hpp compressedStream.hpp -oopMap.hpp growableArray.hpp -oopMap.hpp vmreg.hpp - -oopMapCache.cpp allocation.inline.hpp -oopMapCache.cpp jvmtiRedefineClassesTrace.hpp -oopMapCache.cpp handles.inline.hpp -oopMapCache.cpp oop.inline.hpp -oopMapCache.cpp oopMapCache.hpp -oopMapCache.cpp resourceArea.hpp -oopMapCache.cpp signature.hpp - -oopMapCache.hpp generateOopMap.hpp - -oopRecorder.cpp allocation.inline.hpp -oopRecorder.cpp oop.inline.hpp -oopRecorder.cpp oopRecorder.hpp - -oopRecorder.hpp growableArray.hpp -oopRecorder.hpp handles.hpp - -oopsHierarchy.cpp collectedHeap.hpp -oopsHierarchy.cpp collectedHeap.inline.hpp -oopsHierarchy.cpp globalDefinitions.hpp -oopsHierarchy.cpp oopsHierarchy.hpp -oopsHierarchy.cpp thread.hpp -oopsHierarchy.cpp thread_.inline.hpp - -orderAccess.cpp orderAccess.hpp -orderAccess.cpp stubRoutines.hpp -orderAccess.cpp thread.hpp - -orderAccess.hpp allocation.hpp -orderAccess.hpp os.hpp - -orderAccess_.inline.hpp orderAccess.hpp - -os.cpp allocation.inline.hpp -os.cpp arguments.hpp -os.cpp attachListener.hpp -os.cpp classLoader.hpp -os.cpp defaultStream.hpp -os.cpp events.hpp -os.cpp frame.inline.hpp -os.cpp hpi.hpp -os.cpp icBuffer.hpp -os.cpp interfaceSupport.hpp -os.cpp interpreter.hpp -os.cpp java.hpp -os.cpp javaCalls.hpp -os.cpp javaClasses.hpp -os.cpp jvm.h -os.cpp jvm_misc.hpp -os.cpp mutexLocker.hpp -os.cpp oop.inline.hpp -os.cpp os.hpp -os.cpp os_.inline.hpp -os.cpp privilegedStack.hpp -os.cpp stubRoutines.hpp -os.cpp systemDictionary.hpp -os.cpp threadService.hpp -os.cpp thread_.inline.hpp -os.cpp vmGCOperations.hpp -os.cpp vmSymbols.hpp -os.cpp vtableStubs.hpp - -os.hpp atomic.hpp -os.hpp extendedPC.hpp -os.hpp handles.hpp -os.hpp jvmti.h -os.hpp top.hpp - -os_.cpp allocation.inline.hpp -os_.cpp arguments.hpp -os_.cpp assembler_.inline.hpp -os_.cpp classLoader.hpp -os_.cpp events.hpp -os_.cpp extendedPC.hpp -os_.cpp frame.inline.hpp -os_.cpp hpi.hpp -os_.cpp icBuffer.hpp -os_.cpp interfaceSupport.hpp -os_.cpp interpreter.hpp -os_.cpp java.hpp -os_.cpp javaCalls.hpp -os_.cpp jniFastGetField.hpp -os_.cpp jvm.h -os_.cpp jvm_.h -os_.cpp jvm_misc.hpp -os_.cpp mutexLocker.hpp -os_.cpp mutex_.inline.hpp -os_.cpp nativeInst_.hpp -os_.cpp no_precompiled_headers -os_.cpp osThread.hpp -os_.cpp os_share_.hpp -os_.cpp sharedRuntime.hpp -os_.cpp stubRoutines.hpp -os_.cpp systemDictionary.hpp -os_.cpp thread_.inline.hpp -os_.cpp timer.hpp -os_.cpp vmError.hpp -os_.cpp vmSymbols.hpp -os_.cpp vtableStubs.hpp - -os_.hpp generate_platform_dependent_include - -os_.cpp allocation.inline.hpp -os_.cpp arguments.hpp -os_.cpp assembler_.inline.hpp -os_.cpp attachListener.hpp -os_.cpp classLoader.hpp -os_.cpp compileBroker.hpp -os_.cpp defaultStream.hpp -os_.cpp events.hpp -os_.cpp extendedPC.hpp -os_.cpp filemap.hpp -os_.cpp globals.hpp -os_.cpp growableArray.hpp -os_.cpp hpi.hpp -os_.cpp icBuffer.hpp -os_.cpp interfaceSupport.hpp -os_.cpp interpreter.hpp -os_.cpp java.hpp -os_.cpp javaCalls.hpp -os_.cpp jniFastGetField.hpp -os_.cpp jvm.h -os_.cpp jvm_.h -os_.cpp jvm_misc.hpp -os_.cpp mutexLocker.hpp -os_.cpp mutex_.inline.hpp -os_.cpp nativeInst_.hpp -os_.cpp no_precompiled_headers -os_.cpp objectMonitor.hpp -os_.cpp objectMonitor.inline.hpp -os_.cpp oop.inline.hpp -os_.cpp osThread.hpp -os_.cpp os_share_.hpp -os_.cpp perfMemory.hpp -os_.cpp runtimeService.hpp -os_.cpp sharedRuntime.hpp -os_.cpp statSampler.hpp -os_.cpp stubRoutines.hpp -os_.cpp systemDictionary.hpp -os_.cpp threadCritical.hpp -os_.cpp thread_.inline.hpp -os_.cpp timer.hpp -os_.cpp vmError.hpp -os_.cpp vmSymbols.hpp -os_.cpp vtableStubs.hpp - -os_.hpp generate_platform_dependent_include - -os_.inline.hpp atomic.hpp -os_.inline.hpp atomic_.inline.hpp -os_.inline.hpp orderAccess_.inline.hpp -os_.inline.hpp os.hpp - -osThread.cpp oop.inline.hpp -osThread.cpp osThread.hpp - -osThread.hpp frame.hpp -osThread.hpp handles.hpp -osThread.hpp hpi.hpp -osThread.hpp javaFrameAnchor.hpp -osThread.hpp objectMonitor.hpp -osThread.hpp top.hpp - -osThread_.cpp assembler_.inline.hpp -osThread_.cpp atomic.hpp -osThread_.cpp handles.inline.hpp -osThread_.cpp mutexLocker.hpp -osThread_.cpp no_precompiled_headers -osThread_.cpp os.hpp -osThread_.cpp osThread.hpp -osThread_.cpp safepoint.hpp -osThread_.cpp vmThread.hpp - -osThread_.hpp generate_platform_dependent_include - -ostream.cpp arguments.hpp -ostream.cpp compileLog.hpp -ostream.cpp defaultStream.hpp -ostream.cpp oop.inline.hpp -ostream.cpp os_.inline.hpp -ostream.cpp hpi.hpp -ostream.cpp hpi_.hpp -ostream.cpp ostream.hpp -ostream.cpp top.hpp -ostream.cpp xmlstream.hpp - -ostream.hpp allocation.hpp -ostream.hpp timer.hpp - -pcDesc.cpp debugInfoRec.hpp -pcDesc.cpp nmethod.hpp -pcDesc.cpp pcDesc.hpp -pcDesc.cpp resourceArea.hpp -pcDesc.cpp scopeDesc.hpp - -pcDesc.hpp allocation.hpp - -perf.cpp allocation.inline.hpp -perf.cpp interfaceSupport.hpp -perf.cpp jni.h -perf.cpp jvm.h -perf.cpp oop.inline.hpp -perf.cpp perfData.hpp -perf.cpp perfMemory.hpp -perf.cpp resourceArea.hpp -perf.cpp vmSymbols.hpp - -perfData.cpp exceptions.hpp -perfData.cpp globalDefinitions.hpp -perfData.cpp handles.inline.hpp -perfData.cpp java.hpp -perfData.cpp mutex.hpp -perfData.cpp mutexLocker.hpp -perfData.cpp oop.inline.hpp -perfData.cpp os.hpp -perfData.cpp perfData.hpp -perfData.cpp vmSymbols.hpp - -perfData.hpp allocation.inline.hpp -perfData.hpp growableArray.hpp -perfData.hpp perfMemory.hpp -perfData.hpp timer.hpp - -perfMemory.cpp allocation.inline.hpp -perfMemory.cpp arguments.hpp -perfMemory.cpp globalDefinitions.hpp -perfMemory.cpp java.hpp -perfMemory.cpp mutex.hpp -perfMemory.cpp mutexLocker.hpp -perfMemory.cpp os.hpp -perfMemory.cpp perfData.hpp -perfMemory.cpp perfMemory.hpp -perfMemory.cpp statSampler.hpp - -perfMemory.hpp exceptions.hpp - -perfMemory_.cpp allocation.inline.hpp -perfMemory_.cpp exceptions.hpp -perfMemory_.cpp handles.inline.hpp -perfMemory_.cpp oop.inline.hpp -perfMemory_.cpp os_.inline.hpp -perfMemory_.cpp perfMemory.hpp -perfMemory_.cpp resourceArea.hpp -perfMemory_.cpp vmSymbols.hpp - -permGen.cpp blockOffsetTable.inline.hpp -permGen.cpp cSpaceCounters.hpp -permGen.cpp collectedHeap.inline.hpp -permGen.cpp compactPermGen.hpp -permGen.cpp genCollectedHeap.hpp -permGen.cpp generation.inline.hpp -permGen.cpp java.hpp -permGen.cpp oop.inline.hpp -permGen.cpp permGen.hpp -permGen.cpp universe.hpp -permGen.cpp gcLocker.hpp -permGen.cpp gcLocker.inline.hpp -permGen.cpp vmGCOperations.hpp -permGen.cpp vmThread.hpp - -permGen.hpp gcCause.hpp -permGen.hpp generation.hpp -permGen.hpp handles.hpp -permGen.hpp iterator.hpp -permGen.hpp virtualspace.hpp - -placeholders.cpp fieldType.hpp -placeholders.cpp hashtable.inline.hpp -placeholders.cpp oop.inline.hpp -placeholders.cpp placeholders.hpp -placeholders.cpp systemDictionary.hpp - -placeholders.hpp hashtable.hpp - -prefetch.hpp allocation.hpp - -prefetch_.inline.hpp prefetch.hpp - -preserveException.cpp handles.inline.hpp -preserveException.cpp preserveException.hpp - -preserveException.hpp handles.hpp -preserveException.hpp thread_.inline.hpp - -privilegedStack.cpp allocation.inline.hpp -privilegedStack.cpp instanceKlass.hpp -privilegedStack.cpp methodOop.hpp -privilegedStack.cpp oop.inline.hpp -privilegedStack.cpp privilegedStack.hpp -privilegedStack.cpp vframe.hpp - -privilegedStack.hpp allocation.hpp -privilegedStack.hpp growableArray.hpp -privilegedStack.hpp oopsHierarchy.hpp -privilegedStack.hpp vframe.hpp - -referencePolicy.cpp arguments.hpp -referencePolicy.cpp globals.hpp -referencePolicy.cpp javaClasses.hpp -referencePolicy.cpp referencePolicy.hpp -referencePolicy.cpp universe.hpp - -referenceProcessor.cpp collectedHeap.hpp -referenceProcessor.cpp collectedHeap.inline.hpp -referenceProcessor.cpp java.hpp -referenceProcessor.cpp javaClasses.hpp -referenceProcessor.cpp jniHandles.hpp -referenceProcessor.cpp oop.inline.hpp -referenceProcessor.cpp referencePolicy.hpp -referenceProcessor.cpp referenceProcessor.hpp -referenceProcessor.cpp systemDictionary.hpp - -referenceProcessor.hpp instanceRefKlass.hpp -referenceProcessor.hpp referencePolicy.hpp - -reflection.cpp arguments.hpp -reflection.cpp handles.inline.hpp -reflection.cpp instanceKlass.hpp -reflection.cpp javaCalls.hpp -reflection.cpp javaClasses.hpp -reflection.cpp jvm.h -reflection.cpp linkResolver.hpp -reflection.cpp methodHandleWalk.hpp -reflection.cpp objArrayKlass.hpp -reflection.cpp objArrayOop.hpp -reflection.cpp oopFactory.hpp -reflection.cpp reflection.hpp -reflection.cpp reflectionUtils.hpp -reflection.cpp resourceArea.hpp -reflection.cpp signature.hpp -reflection.cpp symbolTable.hpp -reflection.cpp systemDictionary.hpp -reflection.cpp universe.inline.hpp -reflection.cpp verifier.hpp -reflection.cpp vframe.hpp -reflection.cpp vmSymbols.hpp - -reflection.hpp accessFlags.hpp -reflection.hpp fieldDescriptor.hpp -reflection.hpp growableArray.hpp -reflection.hpp oop.hpp -reflection.hpp reflectionCompat.hpp - -reflectionUtils.cpp javaClasses.hpp -reflectionUtils.cpp reflectionUtils.hpp -reflectionUtils.cpp universe.inline.hpp - -reflectionUtils.hpp accessFlags.hpp -reflectionUtils.hpp allocation.hpp -reflectionUtils.hpp globalDefinitions.hpp -reflectionUtils.hpp handles.inline.hpp -reflectionUtils.hpp instanceKlass.hpp -reflectionUtils.hpp objArrayOop.hpp -reflectionUtils.hpp oopsHierarchy.hpp -reflectionUtils.hpp reflection.hpp - -register.cpp register.hpp - -register.hpp top.hpp - -register_.cpp register_.hpp - -register_.hpp register.hpp -register_.hpp vm_version_.hpp - -registerMap.hpp globalDefinitions.hpp -registerMap.hpp register_.hpp -registerMap.hpp vmreg.hpp - -registerMap_.hpp generate_platform_dependent_include - -register_definitions_.cpp assembler.hpp -register_definitions_.cpp interp_masm_.hpp -register_definitions_.cpp register.hpp -register_definitions_.cpp register_.hpp - -relocInfo.cpp assembler_.inline.hpp -relocInfo.cpp compiledIC.hpp -relocInfo.cpp copy.hpp -relocInfo.cpp nativeInst_.hpp -relocInfo.cpp nmethod.hpp -relocInfo.cpp relocInfo.hpp -relocInfo.cpp resourceArea.hpp -relocInfo.cpp stubCodeGenerator.hpp - -relocInfo.hpp allocation.hpp -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 - -relocInfo_.hpp generate_platform_dependent_include - -relocator.cpp bytecodes.hpp -relocator.cpp handles.inline.hpp -relocator.cpp oop.inline.hpp -relocator.cpp relocator.hpp -relocator.cpp universe.inline.hpp - -relocator.hpp bytecodes.hpp -relocator.hpp bytes_.hpp -relocator.hpp methodOop.hpp - -resolutionErrors.cpp handles.inline.hpp -resolutionErrors.cpp hashtable.inline.hpp -resolutionErrors.cpp oop.inline.hpp -resolutionErrors.cpp resolutionErrors.hpp -resolutionErrors.cpp resourceArea.hpp -resolutionErrors.cpp safepoint.hpp - -resolutionErrors.hpp constantPoolOop.hpp -resolutionErrors.hpp hashtable.hpp - -resourceArea.cpp allocation.inline.hpp -resourceArea.cpp mutexLocker.hpp -resourceArea.cpp resourceArea.hpp -resourceArea.cpp thread_.inline.hpp - -resourceArea.hpp allocation.hpp -resourceArea.hpp thread_.inline.hpp - -// restore is jck optional, put cpp deps in includeDB_features - -rewriter.cpp bytecodes.hpp -rewriter.cpp gcLocker.hpp -rewriter.cpp generateOopMap.hpp -rewriter.cpp interpreter.hpp -rewriter.cpp methodComparator.hpp -rewriter.cpp objArrayOop.hpp -rewriter.cpp oop.inline.hpp -rewriter.cpp oopFactory.hpp -rewriter.cpp resourceArea.hpp -rewriter.cpp rewriter.hpp - -rewriter.hpp allocation.hpp -rewriter.hpp growableArray.hpp -rewriter.hpp handles.inline.hpp - -rframe.cpp frame.inline.hpp -rframe.cpp interpreter.hpp -rframe.cpp oop.inline.hpp -rframe.cpp rframe.hpp -rframe.cpp symbolOop.hpp -rframe.cpp vframe.hpp -rframe.cpp vframe_hp.hpp - -rframe.hpp allocation.hpp -rframe.hpp frame.inline.hpp - -runtimeService.cpp attachListener.hpp -runtimeService.cpp classLoader.hpp -runtimeService.cpp dtrace.hpp -runtimeService.cpp exceptions.hpp -runtimeService.cpp management.hpp -runtimeService.cpp runtimeService.hpp - -runtimeService.hpp perfData.hpp -runtimeService.hpp timer.hpp - -safepoint.cpp codeCache.hpp -safepoint.cpp collectedHeap.hpp -safepoint.cpp compilationPolicy.hpp -safepoint.cpp deoptimization.hpp -safepoint.cpp events.hpp -safepoint.cpp frame.inline.hpp -safepoint.cpp icBuffer.hpp -safepoint.cpp interfaceSupport.hpp -safepoint.cpp interpreter.hpp -safepoint.cpp mutexLocker.hpp -safepoint.cpp nativeInst_.hpp -safepoint.cpp nmethod.hpp -safepoint.cpp oop.inline.hpp -safepoint.cpp osThread.hpp -safepoint.cpp pcDesc.hpp -safepoint.cpp resourceArea.hpp -safepoint.cpp runtimeService.hpp -safepoint.cpp safepoint.hpp -safepoint.cpp scopeDesc.hpp -safepoint.cpp signature.hpp -safepoint.cpp stubCodeGenerator.hpp -safepoint.cpp stubRoutines.hpp -safepoint.cpp sweeper.hpp -safepoint.cpp symbolOop.hpp -safepoint.cpp synchronizer.hpp -safepoint.cpp systemDictionary.hpp -safepoint.cpp thread_.inline.hpp -safepoint.cpp universe.inline.hpp -safepoint.cpp vmreg_.inline.hpp - -safepoint.hpp allocation.hpp -safepoint.hpp assembler.hpp -safepoint.hpp extendedPC.hpp -safepoint.hpp nmethod.hpp -safepoint.hpp os.hpp -safepoint.hpp ostream.hpp - -scopeDesc.cpp debugInfoRec.hpp -scopeDesc.cpp handles.inline.hpp -scopeDesc.cpp oop.inline.hpp -scopeDesc.cpp pcDesc.hpp -scopeDesc.cpp resourceArea.hpp -scopeDesc.cpp scopeDesc.hpp - -scopeDesc.hpp debugInfo.hpp -scopeDesc.hpp growableArray.hpp -scopeDesc.hpp methodOop.hpp -scopeDesc.hpp pcDesc.hpp - -// serialize is jck optional, put cpp deps in includeDB_features - -serviceUtil.hpp objArrayOop.hpp -serviceUtil.hpp systemDictionary.hpp - -sharedHeap.cpp codeCache.hpp -sharedHeap.cpp collectedHeap.inline.hpp -sharedHeap.cpp copy.hpp -sharedHeap.cpp fprofiler.hpp -sharedHeap.cpp java.hpp -sharedHeap.cpp management.hpp -sharedHeap.cpp oop.inline.hpp -sharedHeap.cpp sharedHeap.hpp -sharedHeap.cpp symbolTable.hpp -sharedHeap.cpp systemDictionary.hpp -sharedHeap.cpp workgroup.hpp - -sharedHeap.hpp collectedHeap.hpp -sharedHeap.hpp generation.hpp -sharedHeap.hpp permGen.hpp - -sharedRuntime.cpp abstractCompiler.hpp -sharedRuntime.cpp arguments.hpp -sharedRuntime.cpp biasedLocking.hpp -sharedRuntime.cpp compileBroker.hpp -sharedRuntime.cpp compiledIC.hpp -sharedRuntime.cpp compilerOracle.hpp -sharedRuntime.cpp copy.hpp -sharedRuntime.cpp dtrace.hpp -sharedRuntime.cpp events.hpp -sharedRuntime.cpp forte.hpp -sharedRuntime.cpp gcLocker.inline.hpp -sharedRuntime.cpp handles.inline.hpp -sharedRuntime.cpp hashtable.inline.hpp -sharedRuntime.cpp init.hpp -sharedRuntime.cpp interfaceSupport.hpp -sharedRuntime.cpp interpreterRuntime.hpp -sharedRuntime.cpp interpreter.hpp -sharedRuntime.cpp javaCalls.hpp -sharedRuntime.cpp jvmtiExport.hpp -sharedRuntime.cpp methodHandles.hpp -sharedRuntime.cpp jvmtiRedefineClassesTrace.hpp -sharedRuntime.cpp nativeInst_.hpp -sharedRuntime.cpp nativeLookup.hpp -sharedRuntime.cpp oop.inline.hpp -sharedRuntime.cpp scopeDesc.hpp -sharedRuntime.cpp sharedRuntime.hpp -sharedRuntime.cpp stubRoutines.hpp -sharedRuntime.cpp systemDictionary.hpp -sharedRuntime.cpp universe.inline.hpp -sharedRuntime.cpp vframe.hpp -sharedRuntime.cpp vframeArray.hpp -sharedRuntime.cpp vmSymbols.hpp -sharedRuntime.cpp vmreg_.inline.hpp -sharedRuntime.cpp vtableStubs.hpp -sharedRuntime.cpp xmlstream.hpp - -sharedRuntime.hpp allocation.hpp -sharedRuntime.hpp bytecodeHistogram.hpp -sharedRuntime.hpp bytecodeTracer.hpp -sharedRuntime.hpp hashtable.hpp -sharedRuntime.hpp linkResolver.hpp -sharedRuntime.hpp resourceArea.hpp -sharedRuntime.hpp threadLocalStorage.hpp - -sharedRuntime_.cpp assembler.hpp -sharedRuntime_.cpp assembler_.inline.hpp -sharedRuntime_.cpp compiledICHolderOop.hpp -sharedRuntime_.cpp debugInfoRec.hpp -sharedRuntime_.cpp icBuffer.hpp -sharedRuntime_.cpp interpreter.hpp -sharedRuntime_.cpp jvmtiRedefineClassesTrace.hpp -sharedRuntime_.cpp sharedRuntime.hpp -sharedRuntime_.cpp vframeArray.hpp -sharedRuntime_.cpp vmreg_.inline.hpp -sharedRuntime_.cpp vtableStubs.hpp - -sharedRuntimeTrans.cpp interfaceSupport.hpp -sharedRuntimeTrans.cpp jni.h -sharedRuntimeTrans.cpp sharedRuntime.hpp - -sharedRuntimeTrig.cpp interfaceSupport.hpp -sharedRuntimeTrig.cpp jni.h -sharedRuntimeTrig.cpp sharedRuntime.hpp - -signature.cpp instanceKlass.hpp -signature.cpp oop.inline.hpp -signature.cpp oopFactory.hpp -signature.cpp signature.hpp -signature.cpp symbolOop.hpp -signature.cpp symbolTable.hpp -signature.cpp systemDictionary.hpp -signature.cpp typeArrayKlass.hpp - -signature.hpp allocation.hpp -signature.hpp methodOop.hpp -signature.hpp top.hpp - -simpleThresholdPolicy.cpp arguments.hpp -simpleThresholdPolicy.cpp compileBroker.hpp -simpleThresholdPolicy.cpp resourceArea.hpp -simpleThresholdPolicy.cpp simpleThresholdPolicy.hpp -simpleThresholdPolicy.cpp simpleThresholdPolicy.inline.hpp - -simpleThresholdPolicy.hpp compilationPolicy.hpp -simpleThresholdPolicy.hpp globalDefinitions.hpp -simpleThresholdPolicy.hpp methodDataOop.hpp -simpleThresholdPolicy.hpp nmethod.hpp - -sizes.cpp sizes.hpp - -sizes.hpp allocation.hpp -sizes.hpp globalDefinitions.hpp - -space.cpp blockOffsetTable.inline.hpp -space.cpp copy.hpp -space.cpp defNewGeneration.hpp -space.cpp genCollectedHeap.hpp -space.cpp globalDefinitions.hpp -space.cpp java.hpp -space.cpp liveRange.hpp -space.cpp markSweep.hpp -space.cpp oop.inline.hpp -space.cpp oop.inline2.hpp -space.cpp safepoint.hpp -space.cpp space.hpp -space.cpp space.inline.hpp -space.cpp spaceDecorator.hpp -space.cpp systemDictionary.hpp -space.cpp universe.inline.hpp -space.cpp vmSymbols.hpp - -space.hpp allocation.hpp -space.hpp blockOffsetTable.hpp -space.hpp cardTableModRefBS.hpp -space.hpp iterator.hpp -space.hpp markOop.hpp -space.hpp memRegion.hpp -space.hpp mutexLocker.hpp -space.hpp os_.inline.hpp -space.hpp prefetch.hpp -space.hpp watermark.hpp -space.hpp workgroup.hpp - -space.inline.hpp collectedHeap.hpp -space.inline.hpp safepoint.hpp -space.inline.hpp space.hpp -space.inline.hpp universe.hpp - -spaceDecorator.hpp globalDefinitions.hpp -spaceDecorator.hpp mutableSpace.hpp -spaceDecorator.hpp space.hpp - -spaceDecorator.cpp copy.hpp -spaceDecorator.cpp spaceDecorator.hpp -spaceDecorator.cpp space.inline.hpp - -specialized_oop_closures.cpp ostream.hpp -specialized_oop_closures.cpp specialized_oop_closures.hpp - -specialized_oop_closures.hpp atomic.hpp - -stackMapFrame.cpp globalDefinitions.hpp -stackMapFrame.cpp handles.inline.hpp -stackMapFrame.cpp oop.inline.hpp -stackMapFrame.cpp resourceArea.hpp -stackMapFrame.cpp stackMapFrame.hpp -stackMapFrame.cpp symbolOop.hpp -stackMapFrame.cpp verifier.hpp - -stackMapFrame.hpp exceptions.hpp -stackMapFrame.hpp handles.hpp -stackMapFrame.hpp methodOop.hpp -stackMapFrame.hpp signature.hpp -stackMapFrame.hpp verificationType.hpp -stackMapFrame.hpp verifier.hpp - -stackMapTable.cpp fieldType.hpp -stackMapTable.cpp handles.inline.hpp -stackMapTable.cpp oop.inline.hpp -stackMapTable.cpp resourceArea.hpp -stackMapTable.cpp stackMapTable.hpp -stackMapTable.cpp verifier.hpp - -stackMapTable.hpp allocation.hpp -stackMapTable.hpp bytes_.hpp -stackMapTable.hpp constantPoolOop.hpp -stackMapTable.hpp globalDefinitions.hpp -stackMapTable.hpp methodOop.hpp -stackMapTable.hpp stackMapFrame.hpp - -stackValue.cpp debugInfo.hpp -stackValue.cpp frame.inline.hpp -stackValue.cpp handles.inline.hpp -stackValue.cpp oop.inline.hpp -stackValue.cpp stackValue.hpp - -stackValue.hpp handles.hpp -stackValue.hpp location.hpp -stackValue.hpp top.hpp - -stackValueCollection.cpp jniTypes_.hpp -stackValueCollection.cpp stackValueCollection.hpp - -stackValueCollection.hpp allocation.hpp -stackValueCollection.hpp growableArray.hpp -stackValueCollection.hpp stackValue.hpp - -statSampler.cpp allocation.inline.hpp -statSampler.cpp arguments.hpp -statSampler.cpp java.hpp -statSampler.cpp javaCalls.hpp -statSampler.cpp oop.inline.hpp -statSampler.cpp os.hpp -statSampler.cpp resourceArea.hpp -statSampler.cpp statSampler.hpp -statSampler.cpp systemDictionary.hpp -statSampler.cpp vmSymbols.hpp -statSampler.cpp vm_version_.hpp - -statSampler.hpp perfData.hpp -statSampler.hpp task.hpp - -stubCodeGenerator.cpp assembler_.inline.hpp -stubCodeGenerator.cpp disassembler.hpp -stubCodeGenerator.cpp forte.hpp -stubCodeGenerator.cpp oop.inline.hpp -stubCodeGenerator.cpp stubCodeGenerator.hpp - -stubCodeGenerator.hpp allocation.hpp -stubCodeGenerator.hpp assembler.hpp - -stubGenerator_.cpp assembler.hpp -stubGenerator_.cpp assembler_.inline.hpp -stubGenerator_.cpp frame.inline.hpp -stubGenerator_.cpp handles.inline.hpp -stubGenerator_.cpp instanceOop.hpp -stubGenerator_.cpp interpreter.hpp -stubGenerator_.cpp methodHandles.hpp -stubGenerator_.cpp methodOop.hpp -stubGenerator_.cpp nativeInst_.hpp -stubGenerator_.cpp objArrayKlass.hpp -stubGenerator_.cpp oop.inline.hpp -stubGenerator_.cpp sharedRuntime.hpp -stubGenerator_.cpp stubCodeGenerator.hpp -stubGenerator_.cpp stubRoutines.hpp -stubGenerator_.cpp thread_.inline.hpp -stubGenerator_.cpp top.hpp - -stubRoutines.cpp codeBuffer.hpp -stubRoutines.cpp copy.hpp -stubRoutines.cpp interfaceSupport.hpp -stubRoutines.cpp oop.inline.hpp -stubRoutines.cpp resourceArea.hpp -stubRoutines.cpp sharedRuntime.hpp -stubRoutines.cpp stubRoutines.hpp -stubRoutines.cpp timer.hpp - -stubRoutines.hpp allocation.hpp -stubRoutines.hpp codeBlob.hpp -stubRoutines.hpp frame.hpp -stubRoutines.hpp mutexLocker.hpp -stubRoutines.hpp nativeInst_.hpp -stubRoutines.hpp stubCodeGenerator.hpp -stubRoutines.hpp top.hpp - -stubRoutines_.cpp deoptimization.hpp -stubRoutines_.cpp frame.inline.hpp -stubRoutines_.cpp stubRoutines.hpp -stubRoutines_.cpp thread_.inline.hpp - -stubRoutines_.hpp generate_platform_dependent_include - -stubRoutines_.cpp os.hpp -stubRoutines_.cpp stubRoutines.hpp - -stubs.cpp allocation.inline.hpp -stubs.cpp codeBlob.hpp -stubs.cpp mutexLocker.hpp -stubs.cpp oop.inline.hpp -stubs.cpp stubs.hpp - -stubs.hpp allocation.hpp -stubs.hpp os_.inline.hpp - -sweeper.cpp atomic.hpp -sweeper.cpp codeCache.hpp -sweeper.cpp compilationPolicy.hpp -sweeper.cpp compileBroker.hpp -sweeper.cpp events.hpp -sweeper.cpp methodOop.hpp -sweeper.cpp mutexLocker.hpp -sweeper.cpp nmethod.hpp -sweeper.cpp os.hpp -sweeper.cpp resourceArea.hpp -sweeper.cpp sweeper.hpp -sweeper.cpp vm_operations.hpp -sweeper.cpp xmlstream.hpp - -symbolKlass.cpp gcLocker.hpp -symbolKlass.cpp handles.inline.hpp -symbolKlass.cpp oop.inline.hpp -symbolKlass.cpp symbolKlass.hpp -symbolKlass.cpp symbolOop.hpp -symbolKlass.cpp symbolTable.hpp - -symbolKlass.hpp typeArrayKlass.hpp - -symbolOop.cpp oop.inline.hpp -symbolOop.cpp symbolOop.hpp - -symbolOop.hpp typeArrayOop.hpp -symbolOop.hpp utf8.hpp - -symbolTable.cpp collectedHeap.inline.hpp -symbolTable.cpp filemap.hpp -symbolTable.cpp gcLocker.inline.hpp -symbolTable.cpp hashtable.inline.hpp -symbolTable.cpp javaClasses.hpp -symbolTable.cpp mutexLocker.hpp -symbolTable.cpp oop.inline.hpp -symbolTable.cpp oop.inline2.hpp -symbolTable.cpp symbolKlass.hpp -symbolTable.cpp symbolTable.hpp -symbolTable.cpp systemDictionary.hpp - -symbolTable.hpp allocation.inline.hpp -symbolTable.hpp hashtable.hpp -symbolTable.hpp symbolOop.hpp - -synchronizer.cpp biasedLocking.hpp -synchronizer.cpp dtrace.hpp -synchronizer.cpp events.hpp -synchronizer.cpp handles.inline.hpp -synchronizer.cpp interfaceSupport.hpp -synchronizer.cpp markOop.hpp -synchronizer.cpp mutexLocker.hpp -synchronizer.cpp objectMonitor.hpp -synchronizer.cpp objectMonitor.inline.hpp -synchronizer.cpp oop.inline.hpp -synchronizer.cpp osThread.hpp -synchronizer.cpp os_.inline.hpp -synchronizer.cpp preserveException.hpp -synchronizer.cpp resourceArea.hpp -synchronizer.cpp stubRoutines.hpp -synchronizer.cpp synchronizer.hpp -synchronizer.cpp threadService.hpp -synchronizer.cpp thread_.inline.hpp -synchronizer.cpp vmSymbols.hpp - -synchronizer.hpp handles.hpp -synchronizer.hpp markOop.hpp -synchronizer.hpp perfData.hpp -synchronizer.hpp top.hpp - -systemDictionary.cpp biasedLocking.hpp -systemDictionary.cpp bytecodeStream.hpp -systemDictionary.cpp classLoadingService.hpp -systemDictionary.cpp dictionary.hpp -systemDictionary.cpp fieldType.hpp -systemDictionary.cpp gcLocker.hpp -systemDictionary.cpp handles.inline.hpp -systemDictionary.cpp instanceKlass.hpp -systemDictionary.cpp instanceRefKlass.hpp -systemDictionary.cpp interpreter.hpp -systemDictionary.cpp java.hpp -systemDictionary.cpp javaCalls.hpp -systemDictionary.cpp javaClasses.hpp -systemDictionary.cpp jvmtiEnvBase.hpp -systemDictionary.cpp klass.inline.hpp -systemDictionary.cpp loaderConstraints.hpp -systemDictionary.cpp methodDataOop.hpp -systemDictionary.cpp methodHandles.hpp -systemDictionary.cpp mutexLocker.hpp -systemDictionary.cpp objArrayKlass.hpp -systemDictionary.cpp oop.inline.hpp -systemDictionary.cpp oop.inline2.hpp -systemDictionary.cpp oopFactory.hpp -systemDictionary.cpp placeholders.hpp -systemDictionary.cpp resolutionErrors.hpp -systemDictionary.cpp signature.hpp -systemDictionary.cpp systemDictionary.hpp -systemDictionary.cpp threadService.hpp -systemDictionary.cpp typeArrayKlass.hpp -systemDictionary.cpp vmSymbols.hpp - -systemDictionary.hpp classFileStream.hpp -systemDictionary.hpp classLoader.hpp -systemDictionary.hpp hashtable.hpp -systemDictionary.hpp java.hpp -systemDictionary.hpp objArrayOop.hpp -systemDictionary.hpp reflectionUtils.hpp -systemDictionary.hpp symbolOop.hpp - -task.cpp allocation.hpp -task.cpp init.hpp -task.cpp os_.inline.hpp -task.cpp task.hpp -task.cpp thread_.inline.hpp -task.cpp timer.hpp - -task.hpp top.hpp - -taskqueue.cpp debug.hpp -taskqueue.cpp oop.inline.hpp -taskqueue.cpp os.hpp -taskqueue.cpp taskqueue.hpp -taskqueue.cpp thread_.inline.hpp - -taskqueue.hpp allocation.hpp -taskqueue.hpp allocation.inline.hpp -taskqueue.hpp mutex.hpp -taskqueue.hpp orderAccess_.inline.hpp - -templateInterpreter.cpp interpreter.hpp -templateInterpreter.cpp interpreterGenerator.hpp -templateInterpreter.cpp interpreterRuntime.hpp -templateInterpreter.cpp templateTable.hpp - -templateInterpreter.hpp abstractInterpreter.hpp -templateInterpreter.hpp templateTable.hpp - -templateInterpreter_.cpp arguments.hpp -templateInterpreter_.cpp arrayOop.hpp -templateInterpreter_.cpp assembler.hpp -templateInterpreter_.cpp bytecodeHistogram.hpp -templateInterpreter_.cpp debug.hpp -templateInterpreter_.cpp deoptimization.hpp -templateInterpreter_.cpp frame.inline.hpp -templateInterpreter_.cpp interpreterRuntime.hpp -templateInterpreter_.cpp interpreter.hpp -templateInterpreter_.cpp interpreterGenerator.hpp -templateInterpreter_.cpp jvmtiExport.hpp -templateInterpreter_.cpp jvmtiThreadState.hpp -templateInterpreter_.cpp methodDataOop.hpp -templateInterpreter_.cpp methodOop.hpp -templateInterpreter_.cpp oop.inline.hpp -templateInterpreter_.cpp sharedRuntime.hpp -templateInterpreter_.cpp stubRoutines.hpp -templateInterpreter_.cpp synchronizer.hpp -templateInterpreter_.cpp templateTable.hpp -templateInterpreter_.cpp timer.hpp -templateInterpreter_.cpp vframeArray.hpp - -templateInterpreter_.hpp generate_platform_dependent_include - -templateInterpreterGenerator_.hpp generate_platform_dependent_include - -templateTable.cpp collectedHeap.hpp -templateTable.cpp templateTable.hpp -templateTable.cpp timer.hpp - -templateTable.hpp allocation.hpp -templateTable.hpp bytecodes.hpp -templateTable.hpp frame.hpp -templateTable.hpp interp_masm_.hpp - -templateTable_.cpp interpreterRuntime.hpp -templateTable_.cpp interpreter.hpp -templateTable_.cpp methodDataOop.hpp -templateTable_.cpp methodHandles.hpp -templateTable_.cpp objArrayKlass.hpp -templateTable_.cpp oop.inline.hpp -templateTable_.cpp sharedRuntime.hpp -templateTable_.cpp stubRoutines.hpp -templateTable_.cpp synchronizer.hpp -templateTable_.cpp templateTable.hpp -templateTable_.cpp universe.inline.hpp - -templateTable_.hpp generate_platform_dependent_include - -tenuredGeneration.cpp allocation.inline.hpp -tenuredGeneration.cpp blockOffsetTable.inline.hpp -tenuredGeneration.cpp collectorCounters.hpp -tenuredGeneration.cpp generation.inline.hpp -tenuredGeneration.cpp generationSpec.hpp -tenuredGeneration.cpp java.hpp -tenuredGeneration.cpp oop.inline.hpp -tenuredGeneration.cpp parGCAllocBuffer.hpp -tenuredGeneration.cpp space.hpp -tenuredGeneration.cpp tenuredGeneration.hpp - -tenuredGeneration.hpp cSpaceCounters.hpp -tenuredGeneration.hpp gcStats.hpp -tenuredGeneration.hpp generation.hpp -tenuredGeneration.hpp generationCounters.hpp - -thread.cpp aprofiler.hpp -thread.cpp arguments.hpp -thread.cpp attachListener.hpp -thread.cpp biasedLocking.hpp -thread.cpp classLoader.hpp -thread.cpp compileBroker.hpp -thread.cpp defaultStream.hpp -thread.cpp deoptimization.hpp -thread.cpp dtrace.hpp -thread.cpp events.hpp -thread.cpp fprofiler.hpp -thread.cpp frame.inline.hpp -thread.cpp gcTaskManager.hpp -thread.cpp hpi.hpp -thread.cpp init.hpp -thread.cpp instanceKlass.hpp -thread.cpp interfaceSupport.hpp -thread.cpp interpreter.hpp -thread.cpp interpreter.hpp -thread.cpp java.hpp -thread.cpp javaCalls.hpp -thread.cpp javaClasses.hpp -thread.cpp jniPeriodicChecker.hpp -thread.cpp jvm_misc.hpp -thread.cpp jvmtiExport.hpp -thread.cpp jvmtiThreadState.hpp -thread.cpp linkResolver.hpp -thread.cpp management.hpp -thread.cpp memprofiler.hpp -thread.cpp mutexLocker.hpp -thread.cpp objArrayOop.hpp -thread.cpp objectMonitor.hpp -thread.cpp objectMonitor.inline.hpp -thread.cpp oop.inline.hpp -thread.cpp oopFactory.hpp -thread.cpp osThread.hpp -thread.cpp os_.inline.hpp -thread.cpp preserveException.hpp -thread.cpp privilegedStack.hpp -thread.cpp safepoint.hpp -thread.cpp scopeDesc.hpp -thread.cpp sharedRuntime.hpp -thread.cpp statSampler.hpp -thread.cpp stubRoutines.hpp -thread.cpp symbolOop.hpp -thread.cpp systemDictionary.hpp -thread.cpp task.hpp -thread.cpp threadCritical.hpp -thread.cpp threadLocalStorage.hpp -thread.cpp threadService.hpp -thread.cpp thread_.inline.hpp -thread.cpp universe.inline.hpp -thread.cpp vframe.hpp -thread.cpp vframeArray.hpp -thread.cpp vframe_hp.hpp -thread.cpp vmSymbols.hpp -thread.cpp vmThread.hpp -thread.cpp vm_operations.hpp - -thread.hpp allocation.hpp -thread.hpp exceptions.hpp -thread.hpp frame.hpp -thread.hpp javaFrameAnchor.hpp -thread.hpp jni.h -thread.hpp jniHandles.hpp -thread.hpp jvmtiExport.hpp -thread.hpp mutexLocker.hpp -thread.hpp oop.hpp -thread.hpp os.hpp -thread.hpp osThread.hpp -thread.hpp safepoint.hpp -thread.hpp stubRoutines.hpp -thread.hpp threadLocalAllocBuffer.hpp -thread.hpp threadLocalStorage.hpp -thread.hpp top.hpp -thread.hpp unhandledOops.hpp - -thread_.cpp frame.inline.hpp -thread_.cpp thread_.inline.hpp - -thread_.hpp generate_platform_dependent_include - -thread_.inline.hpp atomic.hpp -thread_.inline.hpp atomic_.inline.hpp -thread_.inline.hpp orderAccess_.inline.hpp -thread_.inline.hpp prefetch.hpp -thread_.inline.hpp prefetch_.inline.hpp -thread_.inline.hpp thread.hpp -thread_.inline.hpp threadLocalStorage.hpp - -threadCritical.hpp allocation.hpp - -threadCritical_.cpp threadCritical.hpp -threadCritical_.cpp thread_.inline.hpp - -threadLS_.cpp threadLocalStorage.hpp -threadLS_.cpp thread_.inline.hpp - -threadLS_.hpp generate_platform_dependent_include - -threadLocalAllocBuffer.cpp copy.hpp -threadLocalAllocBuffer.cpp genCollectedHeap.hpp -threadLocalAllocBuffer.cpp oop.inline.hpp -threadLocalAllocBuffer.cpp resourceArea.hpp -threadLocalAllocBuffer.cpp threadLocalAllocBuffer.inline.hpp -threadLocalAllocBuffer.cpp thread_.inline.hpp -threadLocalAllocBuffer.cpp universe.inline.hpp - -threadLocalAllocBuffer.hpp gcUtil.hpp -threadLocalAllocBuffer.hpp perfData.hpp -threadLocalAllocBuffer.hpp typeArrayOop.hpp - -threadLocalAllocBuffer.inline.hpp atomic.hpp -threadLocalAllocBuffer.inline.hpp collectedHeap.hpp -threadLocalAllocBuffer.inline.hpp copy.hpp -threadLocalAllocBuffer.inline.hpp threadLocalAllocBuffer.hpp - -threadLocalStorage.cpp os_.inline.hpp -threadLocalStorage.cpp threadLocalStorage.hpp -threadLocalStorage.cpp thread_.inline.hpp - -threadLocalStorage.hpp gcUtil.hpp -threadLocalStorage.hpp os.hpp -threadLocalStorage.hpp top.hpp - -threadService.cpp allocation.hpp -threadService.cpp handles.inline.hpp -threadService.cpp heapInspection.hpp -threadService.cpp init.hpp -threadService.cpp instanceKlass.hpp -threadService.cpp oop.inline.hpp -threadService.cpp oopFactory.hpp -threadService.cpp systemDictionary.hpp -threadService.cpp thread.hpp -threadService.cpp threadService.hpp -threadService.cpp vframe.hpp -threadService.cpp vmThread.hpp -threadService.cpp vm_operations.hpp - -threadService.hpp handles.hpp -threadService.hpp init.hpp -threadService.hpp javaClasses.hpp -threadService.hpp jniHandles.hpp -threadService.hpp management.hpp -threadService.hpp objectMonitor.hpp -threadService.hpp objectMonitor.inline.hpp -threadService.hpp perfData.hpp -threadService.hpp serviceUtil.hpp - -timer.cpp oop.inline.hpp -timer.cpp os_.inline.hpp -timer.cpp ostream.hpp -timer.cpp timer.hpp - -timer.hpp globalDefinitions.hpp - -top.hpp debug.hpp -top.hpp exceptions.hpp -top.hpp globalDefinitions.hpp -top.hpp globals.hpp -top.hpp macros.hpp -top.hpp oopsHierarchy.hpp -top.hpp ostream.hpp -top.hpp sizes.hpp - -typeArrayKlass.cpp collectedHeap.hpp -typeArrayKlass.cpp collectedHeap.inline.hpp -typeArrayKlass.cpp handles.inline.hpp -typeArrayKlass.cpp instanceKlass.hpp -typeArrayKlass.cpp klassOop.hpp -typeArrayKlass.cpp objArrayKlassKlass.hpp -typeArrayKlass.cpp oop.inline.hpp -typeArrayKlass.cpp resourceArea.hpp -typeArrayKlass.cpp systemDictionary.hpp -typeArrayKlass.cpp typeArrayKlass.hpp -typeArrayKlass.cpp typeArrayOop.hpp -typeArrayKlass.cpp universe.hpp -typeArrayKlass.cpp universe.inline.hpp -typeArrayKlass.cpp vmSymbols.hpp - -typeArrayKlass.hpp arrayKlass.hpp - -typeArrayKlassKlass.cpp handles.inline.hpp -typeArrayKlassKlass.cpp javaClasses.hpp -typeArrayKlassKlass.cpp oop.inline.hpp -typeArrayKlassKlass.cpp typeArrayKlassKlass.hpp - -typeArrayKlassKlass.hpp arrayKlassKlass.hpp -typeArrayKlassKlass.hpp typeArrayKlass.hpp - -typeArrayOop.cpp oop.inline.hpp -typeArrayOop.cpp typeArrayOop.hpp - -typeArrayOop.hpp arrayOop.hpp -typeArrayOop.hpp orderAccess_.inline.hpp -typeArrayOop.hpp typeArrayKlass.hpp - -unhandledOops.cpp collectedHeap.hpp -unhandledOops.cpp gcLocker.inline.hpp -unhandledOops.cpp globalDefinitions.hpp -unhandledOops.cpp oop.inline.hpp -unhandledOops.cpp thread.hpp -unhandledOops.cpp unhandledOops.hpp -unhandledOops.cpp universe.hpp - -universe.cpp aprofiler.hpp -universe.cpp arguments.hpp -universe.cpp arrayKlassKlass.hpp -universe.cpp cardTableModRefBS.hpp -universe.cpp classLoader.hpp -universe.cpp codeCache.hpp -universe.cpp collectedHeap.inline.hpp -universe.cpp compiledICHolderKlass.hpp -universe.cpp constMethodKlass.hpp -universe.cpp constantPoolKlass.hpp -universe.cpp constantPoolOop.hpp -universe.cpp copy.hpp -universe.cpp cpCacheKlass.hpp -universe.cpp cpCacheOop.hpp -universe.cpp deoptimization.hpp -universe.cpp dependencies.hpp -universe.cpp events.hpp -universe.cpp filemap.hpp -universe.cpp fprofiler.hpp -universe.cpp gcLocker.inline.hpp -universe.cpp genCollectedHeap.hpp -universe.cpp genRemSet.hpp -universe.cpp generation.hpp -universe.cpp handles.inline.hpp -universe.cpp hashtable.inline.hpp -universe.cpp instanceKlass.hpp -universe.cpp instanceKlassKlass.hpp -universe.cpp instanceRefKlass.hpp -universe.cpp interpreter.hpp -universe.cpp java.hpp -universe.cpp javaCalls.hpp -universe.cpp javaClasses.hpp -universe.cpp jvmtiRedefineClassesTrace.hpp -universe.cpp klassKlass.hpp -universe.cpp klassOop.hpp -universe.cpp memoryService.hpp -universe.cpp methodDataKlass.hpp -universe.cpp methodKlass.hpp -universe.cpp objArrayKlassKlass.hpp -universe.cpp oop.inline.hpp -universe.cpp oopFactory.hpp -universe.cpp permGen.hpp -universe.cpp preserveException.hpp -universe.cpp sharedRuntime.hpp -universe.cpp space.hpp -universe.cpp symbolKlass.hpp -universe.cpp symbolTable.hpp -universe.cpp synchronizer.hpp -universe.cpp systemDictionary.hpp -universe.cpp thread_.inline.hpp -universe.cpp timer.hpp -universe.cpp typeArrayKlass.hpp -universe.cpp typeArrayKlassKlass.hpp -universe.cpp universe.hpp -universe.cpp universe.inline.hpp -universe.cpp vmSymbols.hpp -universe.cpp vm_operations.hpp - -universe.hpp growableArray.hpp -universe.hpp handles.hpp - -universe.inline.hpp universe.hpp - -unsafe.cpp allocation.inline.hpp -unsafe.cpp copy.hpp -unsafe.cpp dtrace.hpp -unsafe.cpp globals.hpp -unsafe.cpp interfaceSupport.hpp -unsafe.cpp jni.h -unsafe.cpp jvm.h -unsafe.cpp reflection.hpp -unsafe.cpp reflectionCompat.hpp -unsafe.cpp synchronizer.hpp -unsafe.cpp threadService.hpp -unsafe.cpp vmSymbols.hpp - -utf8.cpp utf8.hpp - -utf8.hpp allocation.hpp -utf8.hpp top.hpp - -verificationType.cpp symbolTable.hpp -verificationType.cpp verificationType.hpp - -verificationType.hpp allocation.hpp -verificationType.hpp handles.hpp -verificationType.hpp instanceKlass.hpp -verificationType.hpp oop.inline.hpp -verificationType.hpp signature.hpp -verificationType.hpp symbolOop.hpp -verificationType.hpp systemDictionary.hpp - -verifier.cpp bytecodeStream.hpp -verifier.cpp bytes_.hpp -verifier.cpp classFileStream.hpp -verifier.cpp fieldDescriptor.hpp -verifier.cpp handles.inline.hpp -verifier.cpp hpi.hpp -verifier.cpp instanceKlass.hpp -verifier.cpp interfaceSupport.hpp -verifier.cpp javaCalls.hpp -verifier.cpp javaClasses.hpp -verifier.cpp jvm.h -verifier.cpp oop.inline.hpp -verifier.cpp oopFactory.hpp -verifier.cpp orderAccess.hpp -verifier.cpp os.hpp -verifier.cpp resourceArea.hpp -verifier.cpp stackMapTable.hpp -verifier.cpp systemDictionary.hpp -verifier.cpp typeArrayOop.hpp -verifier.cpp verifier.hpp -verifier.cpp vmSymbols.hpp - -verifier.hpp exceptions.hpp -verifier.hpp gcLocker.hpp -verifier.hpp handles.hpp -verifier.hpp klass.hpp -verifier.hpp methodOop.hpp -verifier.hpp verificationType.hpp - -vframe.cpp codeCache.hpp -vframe.cpp debugInfoRec.hpp -vframe.cpp handles.inline.hpp -vframe.cpp instanceKlass.hpp -vframe.cpp interpreter.hpp -vframe.cpp javaClasses.hpp -vframe.cpp nmethod.hpp -vframe.cpp objectMonitor.hpp -vframe.cpp objectMonitor.inline.hpp -vframe.cpp oop.inline.hpp -vframe.cpp oopMapCache.hpp -vframe.cpp pcDesc.hpp -vframe.cpp resourceArea.hpp -vframe.cpp scopeDesc.hpp -vframe.cpp signature.hpp -vframe.cpp stubRoutines.hpp -vframe.cpp synchronizer.hpp -vframe.cpp systemDictionary.hpp -vframe.cpp vframe.hpp -vframe.cpp vframeArray.hpp -vframe.cpp vframe_hp.hpp -vframe.cpp vmSymbols.hpp - -vframe.hpp debugInfo.hpp -vframe.hpp debugInfoRec.hpp -vframe.hpp frame.hpp -vframe.hpp frame.inline.hpp -vframe.hpp growableArray.hpp -vframe.hpp location.hpp -vframe.hpp oop.hpp -vframe.hpp stackValue.hpp -vframe.hpp stackValueCollection.hpp - -vframeArray.cpp allocation.inline.hpp -vframeArray.cpp events.hpp -vframeArray.cpp handles.inline.hpp -vframeArray.cpp interpreter.hpp -vframeArray.cpp jvmtiThreadState.hpp -vframeArray.cpp methodDataOop.hpp -vframeArray.cpp monitorChunk.hpp -vframeArray.cpp oop.inline.hpp -vframeArray.cpp resourceArea.hpp -vframeArray.cpp sharedRuntime.hpp -vframeArray.cpp universe.inline.hpp -vframeArray.cpp vframe.hpp -vframeArray.cpp vframeArray.hpp -vframeArray.cpp vframe_hp.hpp -vframeArray.cpp vmSymbols.hpp - -vframeArray.hpp arrayOop.hpp -vframeArray.hpp deoptimization.hpp -vframeArray.hpp frame.inline.hpp -vframeArray.hpp growableArray.hpp -vframeArray.hpp monitorChunk.hpp - -vframe_hp.cpp codeCache.hpp -vframe_hp.cpp debugInfoRec.hpp -vframe_hp.cpp handles.inline.hpp -vframe_hp.cpp instanceKlass.hpp -vframe_hp.cpp interpreter.hpp -vframe_hp.cpp monitorChunk.hpp -vframe_hp.cpp nmethod.hpp -vframe_hp.cpp oop.inline.hpp -vframe_hp.cpp oopMapCache.hpp -vframe_hp.cpp pcDesc.hpp -vframe_hp.cpp scopeDesc.hpp -vframe_hp.cpp signature.hpp -vframe_hp.cpp stubRoutines.hpp -vframe_hp.cpp synchronizer.hpp -vframe_hp.cpp vframeArray.hpp -vframe_hp.cpp vframe_hp.hpp - -vframe_hp.hpp vframe.hpp - -virtualspace.cpp markOop.hpp -virtualspace.cpp oop.inline.hpp -virtualspace.cpp os_.inline.hpp -virtualspace.cpp virtualspace.hpp - -virtualspace.hpp allocation.hpp - -vmError.cpp arguments.hpp -vmError.cpp collectedHeap.hpp -vmError.cpp compileBroker.hpp -vmError.cpp debug.hpp -vmError.cpp defaultStream.hpp -vmError.cpp frame.inline.hpp -vmError.cpp init.hpp -vmError.cpp os.hpp -vmError.cpp thread.hpp -vmError.cpp top.hpp -vmError.cpp vmError.hpp -vmError.cpp vmThread.hpp -vmError.cpp vm_operations.hpp - -vmError.hpp globalDefinitions.hpp - -vmError_.cpp arguments.hpp -vmError_.cpp os.hpp -vmError_.cpp thread.hpp -vmError_.cpp vmError.hpp - -// vmStructs is jck optional, put cpp deps in includeDB_features - -vmStructs.hpp debug.hpp - -vmSymbols.cpp handles.inline.hpp -vmSymbols.cpp oop.inline.hpp -vmSymbols.cpp oopFactory.hpp -vmSymbols.cpp vmSymbols.hpp -vmSymbols.cpp xmlstream.hpp - -vmSymbols.hpp symbolOop.hpp - -vmThread.cpp collectedHeap.hpp -vmThread.cpp compileBroker.hpp -vmThread.cpp dtrace.hpp -vmThread.cpp events.hpp -vmThread.cpp interfaceSupport.hpp -vmThread.cpp methodOop.hpp -vmThread.cpp mutexLocker.hpp -vmThread.cpp oop.inline.hpp -vmThread.cpp os.hpp -vmThread.cpp resourceArea.hpp -vmThread.cpp runtimeService.hpp -vmThread.cpp thread_.inline.hpp -vmThread.cpp vmThread.hpp -vmThread.cpp vm_operations.hpp -vmThread.cpp xmlstream.hpp - -vmThread.hpp perfData.hpp -vmThread.hpp thread_.inline.hpp -vmThread.hpp vm_operations.hpp - -vm_operations.cpp arguments.hpp -vm_operations.cpp compileBroker.hpp -vm_operations.cpp compilerOracle.hpp -vm_operations.cpp deoptimization.hpp -vm_operations.cpp interfaceSupport.hpp -vm_operations.cpp isGCActiveMark.hpp -vm_operations.cpp resourceArea.hpp -vm_operations.cpp sweeper.hpp -vm_operations.cpp threadService.hpp -vm_operations.cpp thread_.inline.hpp -vm_operations.cpp vmSymbols.hpp -vm_operations.cpp vm_operations.hpp - -vm_operations.hpp allocation.hpp -vm_operations.hpp javaClasses.hpp -vm_operations.hpp oop.hpp -vm_operations.hpp thread.hpp -vm_operations.hpp top.hpp - -vm_version.cpp arguments.hpp -vm_version.cpp oop.inline.hpp -vm_version.cpp universe.hpp -vm_version.cpp vm_version_.hpp - -vm_version.hpp allocation.hpp -vm_version.hpp ostream.hpp - -vm_version_.cpp assembler_.inline.hpp -vm_version_.cpp java.hpp -vm_version_.cpp os_.inline.hpp -vm_version_.cpp resourceArea.hpp -vm_version_.cpp stubCodeGenerator.hpp -vm_version_.cpp vm_version_.hpp - -vm_version_.hpp globals_extension.hpp -vm_version_.hpp vm_version.hpp - -vm_version_.cpp os.hpp -vm_version_.cpp vm_version_.hpp - -vmreg.cpp assembler.hpp -vmreg.cpp vmreg.hpp - -vmreg.hpp allocation.hpp -vmreg.hpp globalDefinitions.hpp -vmreg.hpp register_.hpp - -vmreg_.cpp assembler.hpp -vmreg_.cpp vmreg.hpp - -vmreg_.hpp generate_platform_dependent_include - -vtableStubs.cpp allocation.inline.hpp -vtableStubs.cpp disassembler.hpp -vtableStubs.cpp forte.hpp -vtableStubs.cpp handles.inline.hpp -vtableStubs.cpp instanceKlass.hpp -vtableStubs.cpp jvmtiExport.hpp -vtableStubs.cpp klassVtable.hpp -vtableStubs.cpp oop.inline.hpp -vtableStubs.cpp mutexLocker.hpp -vtableStubs.cpp resourceArea.hpp -vtableStubs.cpp sharedRuntime.hpp -vtableStubs.cpp vtableStubs.hpp - -vtableStubs.hpp allocation.hpp - -vtableStubs_.cpp assembler.hpp -vtableStubs_.cpp assembler_.inline.hpp -vtableStubs_.cpp instanceKlass.hpp -vtableStubs_.cpp interp_masm_.hpp -vtableStubs_.cpp klassVtable.hpp -vtableStubs_.cpp resourceArea.hpp -vtableStubs_.cpp sharedRuntime.hpp -vtableStubs_.cpp vmreg_.inline.hpp -vtableStubs_.cpp vtableStubs.hpp - -watermark.hpp allocation.hpp -watermark.hpp globalDefinitions.hpp - -workgroup.cpp allocation.hpp -workgroup.cpp allocation.inline.hpp -workgroup.cpp os.hpp -workgroup.cpp workgroup.hpp - -workgroup.hpp thread_.inline.hpp - -xmlstream.cpp allocation.hpp -xmlstream.cpp allocation.inline.hpp -xmlstream.cpp deoptimization.hpp -xmlstream.cpp methodDataOop.hpp -xmlstream.cpp methodOop.hpp -xmlstream.cpp nmethod.hpp -xmlstream.cpp oop.inline.hpp -xmlstream.cpp vmThread.hpp -xmlstream.cpp xmlstream.hpp - -xmlstream.hpp handles.hpp -xmlstream.hpp ostream.hpp diff --git a/hotspot/src/share/vm/includeDB_features b/hotspot/src/share/vm/includeDB_features deleted file mode 100644 index 39e1149b06f..00000000000 --- a/hotspot/src/share/vm/includeDB_features +++ /dev/null @@ -1,325 +0,0 @@ -// -// Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -attachListener.cpp arguments.hpp -attachListener.cpp attachListener.hpp -attachListener.cpp globals.hpp -attachListener.cpp heapDumper.hpp -attachListener.cpp java.hpp -attachListener.cpp javaCalls.hpp -attachListener.cpp javaClasses.hpp -attachListener.cpp jvmtiExport.hpp -attachListener.cpp os.hpp -attachListener.cpp resourceArea.hpp -attachListener.cpp systemDictionary.hpp -attachListener.cpp vmGCOperations.hpp - -attachListener_.cpp attachListener.hpp -attachListener_.cpp dtraceAttacher.hpp -attachListener_.cpp interfaceSupport.hpp -attachListener_.cpp os.hpp - -dump.cpp classify.hpp -dump.cpp copy.hpp -dump.cpp filemap.hpp -dump.cpp javaCalls.hpp -dump.cpp javaClasses.hpp -dump.cpp loaderConstraints.hpp -dump.cpp methodDataOop.hpp -dump.cpp oop.inline.hpp -dump.cpp oopFactory.hpp -dump.cpp resourceArea.hpp -dump.cpp signature.hpp -dump.cpp spaceDecorator.hpp -dump.cpp symbolTable.hpp -dump.cpp systemDictionary.hpp -dump.cpp vmThread.hpp -dump.cpp vm_operations.hpp - -dump_.cpp assembler_.inline.hpp -dump_.cpp compactingPermGenGen.hpp -dump_.cpp generation.inline.hpp -dump_.cpp space.inline.hpp - -forte.cpp collectedHeap.inline.hpp -forte.cpp debugInfoRec.hpp -forte.cpp forte.hpp -forte.cpp oop.inline.hpp -forte.cpp oop.inline2.hpp -forte.cpp pcDesc.hpp -forte.cpp space.hpp -forte.cpp thread.hpp -forte.cpp universe.inline.hpp -forte.cpp vframe.hpp -forte.cpp vframeArray.hpp - -fprofiler.cpp allocation.inline.hpp -fprofiler.cpp classLoader.hpp -fprofiler.cpp collectedHeap.inline.hpp -fprofiler.cpp deoptimization.hpp -fprofiler.cpp fprofiler.hpp -fprofiler.cpp interpreter.hpp -fprofiler.cpp macros.hpp -fprofiler.cpp mutexLocker.hpp -fprofiler.cpp oop.inline.hpp -fprofiler.cpp oop.inline2.hpp -fprofiler.cpp stubCodeGenerator.hpp -fprofiler.cpp stubRoutines.hpp -fprofiler.cpp symbolOop.hpp -fprofiler.cpp task.hpp -fprofiler.cpp universe.inline.hpp -fprofiler.cpp vframe.hpp -fprofiler.cpp vtableStubs.hpp - -heapDumper.cpp genCollectedHeap.hpp -heapDumper.cpp heapDumper.hpp -heapDumper.cpp javaCalls.hpp -heapDumper.cpp jniHandles.hpp -heapDumper.cpp objArrayKlass.hpp -heapDumper.cpp ostream.hpp -heapDumper.cpp reflectionUtils.hpp -heapDumper.cpp symbolTable.hpp -heapDumper.cpp systemDictionary.hpp -heapDumper.cpp threadService.hpp -heapDumper.cpp universe.hpp -heapDumper.cpp vframe.hpp -heapDumper.cpp vmGCOperations.hpp -heapDumper.cpp vmSymbols.hpp -heapDumper.cpp vmThread.hpp -heapDumper.cpp vm_operations.hpp - -heapInspection.cpp collectedHeap.hpp -heapInspection.cpp genCollectedHeap.hpp -heapInspection.cpp globalDefinitions.hpp -heapInspection.cpp heapInspection.hpp -heapInspection.cpp klassOop.hpp -heapInspection.cpp os.hpp -heapInspection.cpp resourceArea.hpp - -javaCalls.cpp jniCheck.hpp - -jniCheck.cpp fieldDescriptor.hpp -jniCheck.cpp handles.hpp -jniCheck.cpp instanceKlass.hpp -jniCheck.cpp interfaceSupport.hpp -jniCheck.cpp jfieldIDWorkaround.hpp -jniCheck.cpp jni.h -jniCheck.cpp jniCheck.hpp -jniCheck.cpp jniTypes_.hpp -jniCheck.cpp jvm_misc.hpp -jniCheck.cpp oop.inline.hpp -jniCheck.cpp symbolOop.hpp -jniCheck.cpp systemDictionary.hpp -jniCheck.cpp thread.hpp -jniCheck.cpp vmSymbols.hpp - -jvmtiCodeBlobEvents.cpp codeBlob.hpp -jvmtiCodeBlobEvents.cpp codeCache.hpp -jvmtiCodeBlobEvents.cpp handles.hpp -jvmtiCodeBlobEvents.cpp handles.inline.hpp -jvmtiCodeBlobEvents.cpp jvmtiCodeBlobEvents.hpp -jvmtiCodeBlobEvents.cpp jvmtiExport.hpp -jvmtiCodeBlobEvents.cpp oop.inline.hpp -jvmtiCodeBlobEvents.cpp resourceArea.hpp -jvmtiCodeBlobEvents.cpp scopeDesc.hpp -jvmtiCodeBlobEvents.cpp vmThread.hpp - -jvmtiCodeBlobEvents.hpp jvmti.h - -jvmtiExtensions.cpp jvmtiExport.hpp -jvmtiExtensions.cpp jvmtiExtensions.hpp - -jvmtiExtensions.hpp allocation.hpp -jvmtiExtensions.hpp jvmti.h -jvmtiExtensions.hpp jvmtiEnv.hpp - -jvmtiImpl.cpp exceptions.hpp -jvmtiImpl.cpp handles.hpp -jvmtiImpl.cpp handles.inline.hpp -jvmtiImpl.cpp instanceKlass.hpp -jvmtiImpl.cpp interfaceSupport.hpp -jvmtiImpl.cpp interpreter.hpp -jvmtiImpl.cpp javaCalls.hpp -jvmtiImpl.cpp jvmtiAgentThread.hpp -jvmtiImpl.cpp jvmtiEnv.hpp -jvmtiImpl.cpp jvmtiEventController.inline.hpp -jvmtiImpl.cpp jvmtiImpl.hpp -jvmtiImpl.cpp jvmtiRedefineClasses.hpp -jvmtiImpl.cpp resourceArea.hpp -jvmtiImpl.cpp signature.hpp -jvmtiImpl.cpp systemDictionary.hpp -jvmtiImpl.cpp thread_.inline.hpp -jvmtiImpl.cpp vframe.hpp -jvmtiImpl.cpp vframe_hp.hpp -jvmtiImpl.cpp vm_operations.hpp - -jvmtiImpl.hpp jvmti.h -jvmtiImpl.hpp jvmtiEnvThreadState.hpp -jvmtiImpl.hpp jvmtiEventController.hpp -jvmtiImpl.hpp jvmtiTrace.hpp -jvmtiImpl.hpp jvmtiUtil.hpp -jvmtiImpl.hpp objArrayOop.hpp -jvmtiImpl.hpp stackValueCollection.hpp -jvmtiImpl.hpp systemDictionary.hpp -jvmtiImpl.hpp vm_operations.hpp - -jvmtiTagMap.cpp biasedLocking.hpp -jvmtiTagMap.cpp javaCalls.hpp -jvmtiTagMap.cpp jniHandles.hpp -jvmtiTagMap.cpp jvmtiEnv.hpp -jvmtiTagMap.cpp jvmtiEventController.hpp -jvmtiTagMap.cpp jvmtiEventController.inline.hpp -jvmtiTagMap.cpp jvmtiExport.hpp -jvmtiTagMap.cpp jvmtiImpl.hpp -jvmtiTagMap.cpp jvmtiTagMap.hpp -jvmtiTagMap.cpp mutex.hpp -jvmtiTagMap.cpp mutexLocker.hpp -jvmtiTagMap.cpp objArrayKlass.hpp -jvmtiTagMap.cpp oop.inline2.hpp -jvmtiTagMap.cpp reflectionUtils.hpp -jvmtiTagMap.cpp serviceUtil.hpp -jvmtiTagMap.cpp symbolTable.hpp -jvmtiTagMap.cpp systemDictionary.hpp -jvmtiTagMap.cpp vframe.hpp -jvmtiTagMap.cpp vmSymbols.hpp -jvmtiTagMap.cpp vmThread.hpp -jvmtiTagMap.cpp vm_operations.hpp - -jvmtiTagMap.hpp allocation.hpp -jvmtiTagMap.hpp collectedHeap.hpp -jvmtiTagMap.hpp genCollectedHeap.hpp -jvmtiTagMap.hpp jvmti.h -jvmtiTagMap.hpp jvmtiEnv.hpp -jvmtiTagMap.hpp universe.hpp - -jvmtiTrace.cpp jvmtiEnv.hpp -jvmtiTrace.cpp jvmtiTrace.hpp - -jvmtiTrace.hpp jvmti.h -jvmtiTrace.hpp jvmtiEnvThreadState.hpp -jvmtiTrace.hpp jvmtiEventController.hpp -jvmtiTrace.hpp jvmtiUtil.hpp -jvmtiTrace.hpp objArrayOop.hpp -jvmtiTrace.hpp stackValueCollection.hpp -jvmtiTrace.hpp systemDictionary.hpp -jvmtiTrace.hpp vm_operations.hpp - -restore.cpp filemap.hpp -restore.cpp hashtable.inline.hpp -restore.cpp oop.inline.hpp -restore.cpp symbolTable.hpp -restore.cpp systemDictionary.hpp - -serialize.cpp classify.hpp -serialize.cpp codeCache.hpp -serialize.cpp compactingPermGenGen.hpp -serialize.cpp compiledICHolderOop.hpp -serialize.cpp methodDataOop.hpp -serialize.cpp objArrayOop.hpp -serialize.cpp oop.inline.hpp -serialize.cpp symbolTable.hpp -serialize.cpp systemDictionary.hpp - -vmStructs.cpp arguments.hpp -vmStructs.cpp arrayKlass.hpp -vmStructs.cpp arrayKlassKlass.hpp -vmStructs.cpp arrayOop.hpp -vmStructs.cpp bytecodes.hpp -vmStructs.cpp bytecodeInterpreter.hpp -vmStructs.cpp cardTableRS.hpp -vmStructs.cpp codeBlob.hpp -vmStructs.cpp codeCache.hpp -vmStructs.cpp collectedHeap.hpp -vmStructs.cpp compactPermGen.hpp -vmStructs.cpp compiledICHolderKlass.hpp -vmStructs.cpp compiledICHolderOop.hpp -vmStructs.cpp compressedStream.hpp -vmStructs.cpp constMethodKlass.hpp -vmStructs.cpp constMethodOop.hpp -vmStructs.cpp constantPoolKlass.hpp -vmStructs.cpp constantPoolOop.hpp -vmStructs.cpp cpCacheKlass.hpp -vmStructs.cpp cpCacheOop.hpp -vmStructs.cpp defNewGeneration.hpp -vmStructs.cpp dictionary.hpp -vmStructs.cpp freeBlockDictionary.hpp -vmStructs.cpp genCollectedHeap.hpp -vmStructs.cpp generation.hpp -vmStructs.cpp generationSpec.hpp -vmStructs.cpp globalDefinitions.hpp -vmStructs.cpp globals.hpp -vmStructs.cpp hashtable.hpp -vmStructs.cpp heap.hpp -vmStructs.cpp immutableSpace.hpp -vmStructs.cpp instanceKlass.hpp -vmStructs.cpp instanceKlassKlass.hpp -vmStructs.cpp instanceOop.hpp -vmStructs.cpp interpreter.hpp -vmStructs.cpp java.hpp -vmStructs.cpp javaCalls.hpp -vmStructs.cpp javaClasses.hpp -vmStructs.cpp jvmtiAgentThread.hpp -vmStructs.cpp klass.hpp -vmStructs.cpp klassOop.hpp -vmStructs.cpp loaderConstraints.hpp -vmStructs.cpp location.hpp -vmStructs.cpp markOop.hpp -vmStructs.cpp markSweep.hpp -vmStructs.cpp methodDataKlass.hpp -vmStructs.cpp methodDataOop.hpp -vmStructs.cpp methodKlass.hpp -vmStructs.cpp methodOop.hpp -vmStructs.cpp mutableSpace.hpp -vmStructs.cpp nmethod.hpp -vmStructs.cpp objArrayKlass.hpp -vmStructs.cpp objArrayKlassKlass.hpp -vmStructs.cpp objArrayOop.hpp -vmStructs.cpp oop.inline.hpp -vmStructs.cpp oopMap.hpp -vmStructs.cpp pcDesc.hpp -vmStructs.cpp perfMemory.hpp -vmStructs.cpp permGen.hpp -vmStructs.cpp placeholders.hpp -vmStructs.cpp sharedRuntime.hpp -vmStructs.cpp space.hpp -vmStructs.cpp stubRoutines.hpp -vmStructs.cpp stubs.hpp -vmStructs.cpp symbolKlass.hpp -vmStructs.cpp symbolOop.hpp -vmStructs.cpp symbolTable.hpp -vmStructs.cpp systemDictionary.hpp -vmStructs.cpp tenuredGeneration.hpp -vmStructs.cpp thread_.inline.hpp -vmStructs.cpp typeArrayKlass.hpp -vmStructs.cpp typeArrayKlassKlass.hpp -vmStructs.cpp typeArrayOop.hpp -vmStructs.cpp universe.hpp -vmStructs.cpp virtualspace.hpp -vmStructs.cpp vmStructs.hpp -vmStructs.cpp vmStructs_.hpp -vmStructs.cpp vmStructs_.hpp -vmStructs.cpp vmreg.hpp -vmStructs.cpp watermark.hpp - -vmStructs.hpp debug.hpp diff --git a/hotspot/src/share/vm/includeDB_gc b/hotspot/src/share/vm/includeDB_gc deleted file mode 100644 index e47c69d48d2..00000000000 --- a/hotspot/src/share/vm/includeDB_gc +++ /dev/null @@ -1,57 +0,0 @@ -// -// Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps! - -collectedHeap.cpp collectedHeap.hpp -collectedHeap.cpp collectedHeap.inline.hpp -collectedHeap.cpp heapDumper.hpp -collectedHeap.cpp init.hpp -collectedHeap.cpp oop.inline.hpp -collectedHeap.cpp systemDictionary.hpp -collectedHeap.cpp thread_.inline.hpp -collectedHeap.cpp vmGCOperations.hpp - -collectedHeap.hpp allocation.hpp -collectedHeap.hpp barrierSet.hpp -collectedHeap.hpp gcCause.hpp -collectedHeap.hpp handles.hpp -collectedHeap.hpp perfData.hpp -collectedHeap.hpp safepoint.hpp - -collectedHeap.inline.hpp arrayOop.hpp -collectedHeap.inline.hpp collectedHeap.hpp -collectedHeap.inline.hpp copy.hpp -collectedHeap.inline.hpp jvmtiExport.hpp -collectedHeap.inline.hpp lowMemoryDetector.hpp -collectedHeap.inline.hpp sharedRuntime.hpp -collectedHeap.inline.hpp thread.hpp -collectedHeap.inline.hpp threadLocalAllocBuffer.inline.hpp -collectedHeap.inline.hpp universe.hpp -collectedHeap.inline.hpp thread_.inline.hpp -collectedHeap.inline.hpp sharedRuntime.hpp - -gcCause.hpp allocation.hpp - -gcCause.cpp gcCause.hpp diff --git a/hotspot/src/share/vm/includeDB_gc_parallel b/hotspot/src/share/vm/includeDB_gc_parallel deleted file mode 100644 index 05a7de88d02..00000000000 --- a/hotspot/src/share/vm/includeDB_gc_parallel +++ /dev/null @@ -1,184 +0,0 @@ -// -// Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// - -arguments.cpp compactibleFreeListSpace.hpp - -assembler_.cpp g1SATBCardTableModRefBS.hpp -assembler_.cpp g1CollectedHeap.inline.hpp -assembler_.cpp heapRegion.hpp - -collectorPolicy.cpp cmsAdaptiveSizePolicy.hpp -collectorPolicy.cpp cmsGCAdaptivePolicyCounters.hpp - -compiledICHolderKlass.cpp oop.pcgc.inline.hpp - -constantPoolKlass.cpp cardTableRS.hpp -constantPoolKlass.cpp oop.pcgc.inline.hpp -constantPoolKlass.cpp psPromotionManager.inline.hpp -constantPoolKlass.cpp psScavenge.inline.hpp -constantPoolKlass.cpp parOopClosures.inline.hpp - -constantPoolKlass.cpp cardTableRS.hpp -constantPoolKlass.cpp oop.pcgc.inline.hpp -constantPoolKlass.cpp psPromotionManager.inline.hpp -constantPoolKlass.cpp psScavenge.inline.hpp -constantPoolKlass.cpp parOopClosures.inline.hpp - -cpCacheKlass.cpp cardTableRS.hpp -cpCacheKlass.cpp oop.pcgc.inline.hpp -cpCacheKlass.cpp psPromotionManager.inline.hpp -cpCacheKlass.cpp psScavenge.inline.hpp -cpCacheKlass.cpp parOopClosures.inline.hpp - -genCollectedHeap.cpp concurrentMarkSweepThread.hpp -genCollectedHeap.cpp vmCMSOperations.hpp - -generationSpec.cpp asParNewGeneration.hpp -generationSpec.cpp cmsPermGen.hpp -generationSpec.cpp parNewGeneration.hpp - -heapDumper.cpp parallelScavengeHeap.hpp - -heapInspection.cpp parallelScavengeHeap.hpp - -instanceKlass.cpp heapRegionSeq.inline.hpp -instanceKlass.cpp g1CollectedHeap.inline.hpp -instanceKlass.cpp g1OopClosures.inline.hpp -instanceKlass.cpp oop.pcgc.inline.hpp -instanceKlass.cpp psPromotionManager.inline.hpp -instanceKlass.cpp psScavenge.inline.hpp -instanceKlass.cpp parOopClosures.inline.hpp - -instanceKlassKlass.cpp cardTableRS.hpp -instanceKlassKlass.cpp oop.pcgc.inline.hpp -instanceKlassKlass.cpp psPromotionManager.inline.hpp -instanceKlassKlass.cpp psScavenge.inline.hpp -instanceKlassKlass.cpp parOopClosures.inline.hpp - -instanceRefKlass.cpp heapRegionSeq.inline.hpp -instanceRefKlass.cpp g1CollectedHeap.inline.hpp -instanceRefKlass.cpp g1OopClosures.inline.hpp -instanceRefKlass.cpp oop.pcgc.inline.hpp -instanceRefKlass.cpp psPromotionManager.inline.hpp -instanceRefKlass.cpp psScavenge.inline.hpp -instanceRefKlass.cpp parOopClosures.inline.hpp - -java.cpp concurrentMarkSweepThread.hpp -java.cpp psScavenge.hpp -java.cpp psScavenge.inline.hpp - -jvmtiExport.cpp psMarkSweep.hpp - -jvmtiTagMap.cpp parallelScavengeHeap.hpp - -klassKlass.cpp oop.pcgc.inline.hpp - -klass.hpp cmsOopClosures.hpp -klass.hpp parOopClosures.hpp - -memoryPool.hpp compactibleFreeListSpace.hpp - -memoryService.cpp cmsPermGen.hpp -memoryService.cpp concurrentMarkSweepGeneration.hpp -memoryService.cpp g1CollectedHeap.inline.hpp -memoryService.cpp parNewGeneration.hpp -memoryService.cpp parallelScavengeHeap.hpp -memoryService.cpp psMemoryPool.hpp -memoryService.cpp psOldGen.hpp -memoryService.cpp psPermGen.hpp -memoryService.cpp psYoungGen.hpp - -methodDataKlass.cpp oop.pcgc.inline.hpp -methodDataKlass.cpp psScavenge.inline.hpp - -objArrayKlass.cpp heapRegionSeq.inline.hpp -objArrayKlass.cpp g1CollectedHeap.inline.hpp -objArrayKlass.cpp g1OopClosures.inline.hpp -objArrayKlass.cpp oop.pcgc.inline.hpp -objArrayKlass.cpp psCompactionManager.hpp -objArrayKlass.cpp psPromotionManager.inline.hpp -objArrayKlass.cpp psScavenge.inline.hpp -objArrayKlass.cpp parOopClosures.inline.hpp - -objArrayKlass.inline.hpp psCompactionManager.inline.hpp -objArrayKlass.inline.hpp psParallelCompact.hpp - -oop.pcgc.inline.hpp parNewGeneration.hpp -oop.pcgc.inline.hpp parallelScavengeHeap.hpp -oop.pcgc.inline.hpp psCompactionManager.hpp -oop.pcgc.inline.hpp psParallelCompact.hpp -oop.pcgc.inline.hpp psScavenge.hpp -oop.pcgc.inline.hpp psScavenge.inline.hpp - -oop.psgc.inline.hpp parallelScavengeHeap.hpp -oop.psgc.inline.hpp psScavenge.hpp -oop.psgc.inline.hpp psScavenge.inline.hpp - -psMemoryPool.cpp handles.inline.hpp -psMemoryPool.cpp javaCalls.hpp -psMemoryPool.cpp lowMemoryDetector.hpp -psMemoryPool.cpp management.hpp -psMemoryPool.cpp memoryManager.hpp -psMemoryPool.cpp oop.inline.hpp -psMemoryPool.cpp psMemoryPool.hpp -psMemoryPool.cpp psPermGen.hpp -psMemoryPool.cpp systemDictionary.hpp -psMemoryPool.cpp vmSymbols.hpp - -psMemoryPool.hpp defNewGeneration.hpp -psMemoryPool.hpp heap.hpp -psMemoryPool.hpp memoryUsage.hpp -psMemoryPool.hpp memoryPool.hpp -psMemoryPool.hpp mutableSpace.hpp -psMemoryPool.hpp psOldGen.hpp -psMemoryPool.hpp psYoungGen.hpp -psMemoryPool.hpp space.hpp - -safepoint.cpp concurrentGCThread.hpp -safepoint.cpp concurrentMarkSweepThread.hpp - -thread.cpp concurrentMarkSweepThread.hpp -thread.cpp pcTasks.hpp - -thread.hpp dirtyCardQueue.hpp -thread.hpp satbQueue.hpp - -universe.cpp parallelScavengeHeap.hpp -universe.cpp cmsCollectorPolicy.hpp -universe.cpp cmsAdaptiveSizePolicy.hpp - -vmStructs.cpp asPSOldGen.hpp -vmStructs.cpp asPSYoungGen.hpp -vmStructs.cpp cmsPermGen.hpp -vmStructs.cpp compactibleFreeListSpace.hpp -vmStructs.cpp concurrentMarkSweepGeneration.hpp -vmStructs.cpp concurrentMarkSweepThread.hpp -vmStructs.cpp parNewGeneration.hpp -vmStructs.cpp parallelScavengeHeap.hpp -vmStructs.cpp psOldGen.hpp -vmStructs.cpp psPermGen.hpp -vmStructs.cpp psVirtualspace.hpp -vmStructs.cpp psYoungGen.hpp -vmStructs.cpp vmStructs_cms.hpp -vmStructs.cpp vmStructs_parallelgc.hpp -vmStructs.cpp vmStructs_parNew.hpp diff --git a/hotspot/src/share/vm/includeDB_jvmti b/hotspot/src/share/vm/includeDB_jvmti deleted file mode 100644 index 704cf78afef..00000000000 --- a/hotspot/src/share/vm/includeDB_jvmti +++ /dev/null @@ -1,259 +0,0 @@ -// -// Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -jvmtiAgentThread.hpp jvmtiEnv.hpp - -jvmtiClassFileReconstituter.cpp bytecodeStream.hpp -jvmtiClassFileReconstituter.cpp bytes_.hpp -jvmtiClassFileReconstituter.cpp jvmtiClassFileReconstituter.hpp -jvmtiClassFileReconstituter.cpp symbolTable.hpp -jvmtiClassFileReconstituter.cpp signature.hpp - -jvmtiClassFileReconstituter.hpp jvmtiEnv.hpp - -// jvmtiCodeBlobEvents is jck optional, please put deps in includeDB_features - -jvmtiEnter.cpp jvmtiEnter.hpp -jvmtiEnter.cpp jvmtiUtil.hpp - -jvmtiEnter.hpp interfaceSupport.hpp -jvmtiEnter.hpp jvmtiEnv.hpp -jvmtiEnter.hpp jvmtiImpl.hpp -jvmtiEnter.hpp resourceArea.hpp -jvmtiEnter.hpp systemDictionary.hpp - -jvmtiEnterTrace.cpp jvmtiEnter.hpp -jvmtiEnterTrace.cpp jvmtiUtil.hpp - -jvmtiEnv.cpp arguments.hpp -jvmtiEnv.cpp bytecodeStream.hpp -jvmtiEnv.cpp cpCacheOop.hpp -jvmtiEnv.cpp deoptimization.hpp -jvmtiEnv.cpp exceptions.hpp -jvmtiEnv.cpp instanceKlass.hpp -jvmtiEnv.cpp interfaceSupport.hpp -jvmtiEnv.cpp interpreter.hpp -jvmtiEnv.cpp javaCalls.hpp -jvmtiEnv.cpp jfieldIDWorkaround.hpp -jvmtiEnv.cpp jniCheck.hpp -jvmtiEnv.cpp jvm_misc.hpp -jvmtiEnv.cpp jvmtiAgentThread.hpp -jvmtiEnv.cpp jvmtiClassFileReconstituter.hpp -jvmtiEnv.cpp jvmtiCodeBlobEvents.hpp -jvmtiEnv.cpp jvmtiEnv.hpp -jvmtiEnv.cpp jvmtiExtensions.hpp -jvmtiEnv.cpp jvmtiGetLoadedClasses.hpp -jvmtiEnv.cpp jvmtiImpl.hpp -jvmtiEnv.cpp jvmtiManageCapabilities.hpp -jvmtiEnv.cpp jvmtiRedefineClasses.hpp -jvmtiEnv.cpp jvmtiTagMap.hpp -jvmtiEnv.cpp jvmtiThreadState.inline.hpp -jvmtiEnv.cpp jvmtiUtil.hpp -jvmtiEnv.cpp objectMonitor.inline.hpp -jvmtiEnv.cpp osThread.hpp -jvmtiEnv.cpp preserveException.hpp -jvmtiEnv.cpp reflectionUtils.hpp -jvmtiEnv.cpp resourceArea.hpp -jvmtiEnv.cpp signature.hpp -jvmtiEnv.cpp systemDictionary.hpp -jvmtiEnv.cpp threadService.hpp -jvmtiEnv.cpp thread_.inline.hpp -jvmtiEnv.cpp universe.inline.hpp -jvmtiEnv.cpp vframe.hpp -jvmtiEnv.cpp vmSymbols.hpp -jvmtiEnv.cpp vmThread.hpp - -jvmtiEnv.hpp jvmtiEnvBase.hpp - -jvmtiEnvBase.cpp biasedLocking.hpp -jvmtiEnvBase.cpp interfaceSupport.hpp -jvmtiEnvBase.cpp jfieldIDWorkaround.hpp -jvmtiEnvBase.cpp jvmtiEnv.hpp -jvmtiEnvBase.cpp jvmtiEnvBase.hpp -jvmtiEnvBase.cpp jvmtiEventController.inline.hpp -jvmtiEnvBase.cpp jvmtiExtensions.hpp -jvmtiEnvBase.cpp jvmtiImpl.hpp -jvmtiEnvBase.cpp jvmtiManageCapabilities.hpp -jvmtiEnvBase.cpp jvmtiTagMap.hpp -jvmtiEnvBase.cpp jvmtiThreadState.inline.hpp -jvmtiEnvBase.cpp objArrayKlass.hpp -jvmtiEnvBase.cpp objArrayOop.hpp -jvmtiEnvBase.cpp objectMonitor.hpp -jvmtiEnvBase.cpp objectMonitor.inline.hpp -jvmtiEnvBase.cpp signature.hpp -jvmtiEnvBase.cpp systemDictionary.hpp -jvmtiEnvBase.cpp vframe.hpp -jvmtiEnvBase.cpp vframe_hp.hpp -jvmtiEnvBase.cpp vmThread.hpp -jvmtiEnvBase.cpp vm_operations.hpp - -jvmtiEnvBase.hpp classLoader.hpp -jvmtiEnvBase.hpp fieldDescriptor.hpp -jvmtiEnvBase.hpp frame.hpp -jvmtiEnvBase.hpp growableArray.hpp -jvmtiEnvBase.hpp handles.inline.hpp -jvmtiEnvBase.hpp jvmtiEnvThreadState.hpp -jvmtiEnvBase.hpp jvmtiEventController.hpp -jvmtiEnvBase.hpp jvmtiThreadState.hpp -jvmtiEnvBase.hpp thread.hpp -jvmtiEnvBase.hpp vm_operations.hpp - -jvmtiEnvThreadState.cpp handles.hpp -jvmtiEnvThreadState.cpp handles.inline.hpp -jvmtiEnvThreadState.cpp interfaceSupport.hpp -jvmtiEnvThreadState.cpp interpreter.hpp -jvmtiEnvThreadState.cpp javaCalls.hpp -jvmtiEnvThreadState.cpp jvmtiEnv.hpp -jvmtiEnvThreadState.cpp jvmtiEnvThreadState.hpp -jvmtiEnvThreadState.cpp jvmtiEventController.inline.hpp -jvmtiEnvThreadState.cpp jvmtiImpl.hpp -jvmtiEnvThreadState.cpp resourceArea.hpp -jvmtiEnvThreadState.cpp signature.hpp -jvmtiEnvThreadState.cpp systemDictionary.hpp -jvmtiEnvThreadState.cpp vframe.hpp -jvmtiEnvThreadState.cpp vm_operations.hpp - -jvmtiEnvThreadState.hpp allocation.hpp -jvmtiEnvThreadState.hpp allocation.inline.hpp -jvmtiEnvThreadState.hpp globalDefinitions.hpp -jvmtiEnvThreadState.hpp growableArray.hpp -jvmtiEnvThreadState.hpp instanceKlass.hpp -jvmtiEnvThreadState.hpp jvmti.h -jvmtiEnvThreadState.hpp jvmtiEventController.hpp - -jvmtiEventController.cpp frame.hpp -jvmtiEventController.cpp interpreter.hpp -jvmtiEventController.cpp jvmtiEnv.hpp -jvmtiEventController.cpp jvmtiEventController.hpp -jvmtiEventController.cpp jvmtiEventController.inline.hpp -jvmtiEventController.cpp jvmtiExport.hpp -jvmtiEventController.cpp jvmtiImpl.hpp -jvmtiEventController.cpp jvmtiThreadState.inline.hpp -jvmtiEventController.cpp resourceArea.hpp -jvmtiEventController.cpp thread.hpp -jvmtiEventController.cpp vframe.hpp -jvmtiEventController.cpp vframe_hp.hpp -jvmtiEventController.cpp vmThread.hpp -jvmtiEventController.cpp vm_operations.hpp - -jvmtiEventController.hpp allocation.hpp -jvmtiEventController.hpp allocation.inline.hpp -jvmtiEventController.hpp globalDefinitions.hpp -jvmtiEventController.hpp jvmti.h - -jvmtiEventController.inline.hpp jvmtiEventController.hpp -jvmtiEventController.inline.hpp jvmtiImpl.hpp -jvmtiEventController.inline.hpp jvmtiUtil.hpp - -jvmtiExport.cpp arguments.hpp -jvmtiExport.cpp attachListener.hpp -jvmtiExport.cpp handles.hpp -jvmtiExport.cpp interfaceSupport.hpp -jvmtiExport.cpp interpreter.hpp -jvmtiExport.cpp jvmtiCodeBlobEvents.hpp -jvmtiExport.cpp jvmtiEnv.hpp -jvmtiExport.cpp jvmtiEventController.hpp -jvmtiExport.cpp jvmtiEventController.inline.hpp -jvmtiExport.cpp jvmtiExport.hpp -jvmtiExport.cpp jvmtiImpl.hpp -jvmtiExport.cpp jvmtiManageCapabilities.hpp -jvmtiExport.cpp jvmtiTagMap.hpp -jvmtiExport.cpp jvmtiThreadState.inline.hpp -jvmtiExport.cpp nmethod.hpp -jvmtiExport.cpp objArrayKlass.hpp -jvmtiExport.cpp objArrayOop.hpp -jvmtiExport.cpp objectMonitor.inline.hpp -jvmtiExport.cpp pcDesc.hpp -jvmtiExport.cpp resourceArea.hpp -jvmtiExport.cpp scopeDesc.hpp -jvmtiExport.cpp serviceUtil.hpp -jvmtiExport.cpp systemDictionary.hpp -jvmtiExport.cpp thread.hpp -jvmtiExport.cpp vframe.hpp - -// jvmtiExtensions is jck optional, please put deps in includeDB_features - -jvmtiGetLoadedClasses.cpp jvmtiGetLoadedClasses.hpp -jvmtiGetLoadedClasses.cpp systemDictionary.hpp -jvmtiGetLoadedClasses.cpp thread.hpp -jvmtiGetLoadedClasses.cpp universe.inline.hpp - -jvmtiGetLoadedClasses.hpp jvmtiEnv.hpp - -// jvmtiImpl is jck optional, please put deps in includeDB_features - -jvmtiManageCapabilities.cpp jvmtiEnv.hpp -jvmtiManageCapabilities.cpp jvmtiExport.hpp -jvmtiManageCapabilities.cpp jvmtiManageCapabilities.hpp - -jvmtiManageCapabilities.hpp allocation.hpp -jvmtiManageCapabilities.hpp jvmti.h - -jvmtiRedefineClasses.cpp bitMap.inline.hpp -jvmtiRedefineClasses.cpp codeCache.hpp -jvmtiRedefineClasses.cpp deoptimization.hpp -jvmtiRedefineClasses.cpp gcLocker.hpp -jvmtiRedefineClasses.cpp jvmtiImpl.hpp -jvmtiRedefineClasses.cpp jvmtiRedefineClasses.hpp -jvmtiRedefineClasses.cpp klassVtable.hpp -jvmtiRedefineClasses.cpp methodComparator.hpp -jvmtiRedefineClasses.cpp oopMapCache.hpp -jvmtiRedefineClasses.cpp relocator.hpp -jvmtiRedefineClasses.cpp rewriter.hpp -jvmtiRedefineClasses.cpp systemDictionary.hpp -jvmtiRedefineClasses.cpp universe.inline.hpp -jvmtiRedefineClasses.cpp verifier.hpp - -jvmtiRedefineClasses.hpp jvmtiEnv.hpp -jvmtiRedefineClasses.hpp jvmtiRedefineClassesTrace.hpp -jvmtiRedefineClasses.hpp objArrayKlass.hpp -jvmtiRedefineClasses.hpp objArrayOop.hpp -jvmtiRedefineClasses.hpp oopFactory.hpp -jvmtiRedefineClasses.hpp resourceArea.hpp -jvmtiRedefineClasses.hpp vm_operations.hpp - -// jvmtiTagMap is jck optional, please put deps in includeDB_features -// jvmtiTrace is jck optional, please put deps in includeDB_features - -jvmtiThreadState.cpp gcLocker.hpp -jvmtiThreadState.cpp jvmtiEnv.hpp -jvmtiThreadState.cpp jvmtiEventController.inline.hpp -jvmtiThreadState.cpp jvmtiImpl.hpp -jvmtiThreadState.cpp jvmtiThreadState.inline.hpp -jvmtiThreadState.cpp resourceArea.hpp -jvmtiThreadState.cpp vframe.hpp - -jvmtiThreadState.inline.hpp jvmtiEnvThreadState.hpp -jvmtiThreadState.inline.hpp jvmtiThreadState.hpp - -jvmtiUtil.cpp exceptions.hpp -jvmtiUtil.cpp handles.hpp -jvmtiUtil.cpp handles.inline.hpp -jvmtiUtil.cpp interfaceSupport.hpp -jvmtiUtil.cpp jvmtiUtil.hpp -jvmtiUtil.cpp vm_operations.hpp - -jvmtiUtil.hpp jvmti.h -jvmtiUtil.hpp jvmtiEventController.hpp -jvmtiUtil.hpp resourceArea.hpp diff --git a/hotspot/src/share/vm/includeDB_shark b/hotspot/src/share/vm/includeDB_shark deleted file mode 100644 index 17e451daecd..00000000000 --- a/hotspot/src/share/vm/includeDB_shark +++ /dev/null @@ -1,371 +0,0 @@ -// -// Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. -// Copyright 2008, 2009, 2010 Red Hat, Inc. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps! - -ciMethod.cpp ciTypeFlow.hpp -ciMethod.cpp methodOop.hpp - -ciTypeFlow.cpp allocation.inline.hpp -ciTypeFlow.cpp bytecode.hpp -ciTypeFlow.cpp bytecodes.hpp -ciTypeFlow.cpp ciConstant.hpp -ciTypeFlow.cpp ciField.hpp -ciTypeFlow.cpp ciMethod.hpp -ciTypeFlow.cpp ciMethodData.hpp -ciTypeFlow.cpp ciObjArrayKlass.hpp -ciTypeFlow.cpp ciStreams.hpp -ciTypeFlow.cpp ciTypeArrayKlass.hpp -ciTypeFlow.cpp ciTypeFlow.hpp -ciTypeFlow.cpp compileLog.hpp -ciTypeFlow.cpp deoptimization.hpp -ciTypeFlow.cpp growableArray.hpp -ciTypeFlow.cpp shark_globals.hpp - -ciTypeFlow.hpp ciEnv.hpp -ciTypeFlow.hpp ciKlass.hpp -ciTypeFlow.hpp ciMethodBlocks.hpp - -cppInterpreter_.cpp shark_globals.hpp - -compileBroker.cpp sharkCompiler.hpp - -disassembler.cpp sharkEntry.hpp - -globals.hpp shark_globals_.hpp - -globals.cpp shark_globals.hpp - -llvmValue.hpp llvmHeaders.hpp -llvmValue.hpp sharkContext.hpp -llvmValue.hpp sharkType.hpp - -nmethod.cpp sharkCompiler.hpp - -sharedRuntime_.cpp compileBroker.hpp -sharedRuntime_.cpp sharkCompiler.hpp - -shark_globals.cpp shark_globals.hpp - -shark_globals.hpp shark_globals_.hpp -shark_globals.hpp globals.hpp - -sharkBlock.cpp debug.hpp -sharkBlock.cpp bytecodes.hpp -sharkBlock.cpp llvmHeaders.hpp -sharkBlock.cpp llvmValue.hpp -sharkBlock.cpp shark_globals.hpp -sharkBlock.cpp sharkBlock.hpp -sharkBlock.cpp sharkBuilder.hpp -sharkBlock.cpp sharkConstant.hpp -sharkBlock.cpp sharkState.hpp -sharkBlock.cpp sharkValue.hpp - -sharkBlock.hpp allocation.hpp -sharkBlock.hpp ciMethod.hpp -sharkBlock.hpp ciStreams.hpp -sharkBlock.hpp debug.hpp -sharkBlock.hpp llvmHeaders.hpp -sharkBlock.hpp sharkBuilder.hpp -sharkBlock.hpp sharkConstant.hpp -sharkBlock.hpp sharkInvariants.hpp -sharkBlock.hpp sharkState.hpp -sharkBlock.hpp sharkValue.hpp - -sharkBuilder.cpp ciMethod.hpp -sharkBuilder.cpp debug.hpp -sharkBuilder.cpp llvmHeaders.hpp -sharkBuilder.cpp llvmValue.hpp -sharkBuilder.cpp methodOop.hpp -sharkBuilder.cpp os.hpp -sharkBuilder.cpp resourceArea.hpp -sharkBuilder.cpp llvmHeaders.hpp -sharkBuilder.cpp sharkBuilder.hpp -sharkBuilder.cpp sharkContext.hpp -sharkBuilder.cpp sharkRuntime.hpp -sharkBuilder.cpp synchronizer.hpp -sharkBuilder.cpp thread.hpp - -sharkBuilder.hpp barrierSet.hpp -sharkBuilder.hpp cardTableModRefBS.hpp -sharkBuilder.hpp ciType.hpp -sharkBuilder.hpp debug.hpp -sharkBuilder.hpp llvmHeaders.hpp -sharkBuilder.hpp llvmValue.hpp -sharkBuilder.hpp sizes.hpp -sharkBuilder.hpp sharkCodeBuffer.hpp -sharkBuilder.hpp sharkType.hpp -sharkBuilder.hpp sharkValue.hpp -sharkBuilder.hpp sharkEntry.hpp - -sharkCacheDecache.cpp ciMethod.hpp -sharkCacheDecache.cpp debugInfoRec.hpp -sharkCacheDecache.cpp llvmValue.hpp -sharkCacheDecache.cpp sharkBuilder.hpp -sharkCacheDecache.cpp sharkCacheDecache.hpp -sharkCacheDecache.cpp sharkFunction.hpp -sharkCacheDecache.cpp sharkState.hpp - -sharkCacheDecache.hpp ciMethod.hpp -sharkCacheDecache.hpp debugInfoRec.hpp -sharkCacheDecache.hpp sharkBuilder.hpp -sharkCacheDecache.hpp sharkFunction.hpp -sharkCacheDecache.hpp sharkStateScanner.hpp - -sharkCodeBuffer.hpp allocation.hpp -sharkCodeBuffer.hpp codeBuffer.hpp -sharkCodeBuffer.hpp llvmHeaders.hpp - -sharkCompiler.cpp abstractCompiler.hpp -sharkCompiler.cpp ciEnv.hpp -sharkCompiler.cpp ciMethod.hpp -sharkCompiler.cpp debug.hpp -sharkCompiler.cpp debugInfoRec.hpp -sharkCompiler.cpp dependencies.hpp -sharkCompiler.cpp exceptionHandlerTable.hpp -sharkCompiler.cpp llvmHeaders.hpp -sharkCompiler.cpp oopMap.hpp -sharkCompiler.cpp oopRecorder.hpp -sharkCompiler.cpp shark_globals.hpp -sharkCompiler.cpp sharkBuilder.hpp -sharkCompiler.cpp sharkCodeBuffer.hpp -sharkCompiler.cpp sharkCompiler.hpp -sharkCompiler.cpp sharkContext.hpp -sharkCompiler.cpp sharkEntry.hpp -sharkCompiler.cpp sharkFunction.hpp -sharkCompiler.cpp sharkMemoryManager.hpp -sharkCompiler.cpp sharkNativeWrapper.hpp - -sharkCompiler.hpp abstractCompiler.hpp -sharkCompiler.hpp ciEnv.hpp -sharkCompiler.hpp ciMethod.hpp -sharkCompiler.hpp compileBroker.hpp -sharkCompiler.hpp llvmHeaders.hpp -sharkCompiler.hpp sharkMemoryManager.hpp - -sharkContext.cpp arrayOop.hpp -sharkContext.cpp globalDefinitions.hpp -sharkContext.cpp llvmHeaders.hpp -sharkContext.cpp oop.hpp -sharkContext.cpp sharkContext.hpp - -sharkContext.hpp llvmHeaders.hpp -sharkContext.hpp sharkCompiler.hpp - -sharkConstant.cpp ciInstance.hpp -sharkConstant.cpp ciStreams.hpp -sharkConstant.cpp sharkBuilder.hpp -sharkConstant.cpp sharkConstant.hpp -sharkConstant.cpp sharkValue.hpp - -sharkConstant.hpp allocation.hpp -sharkConstant.hpp ciStreams.hpp -sharkConstant.hpp sharkBuilder.hpp -sharkConstant.hpp sharkValue.hpp - -sharkEntry.hpp llvmHeaders.hpp - -sharkFunction.cpp allocation.hpp -sharkFunction.cpp ciTypeFlow.hpp -sharkFunction.cpp debug.hpp -sharkFunction.cpp llvmHeaders.hpp -sharkFunction.cpp llvmValue.hpp -sharkFunction.cpp shark_globals.hpp -sharkFunction.cpp sharkBuilder.hpp -sharkFunction.cpp sharkEntry.hpp -sharkFunction.cpp sharkFunction.hpp -sharkFunction.cpp sharkState.hpp -sharkFunction.cpp sharkTopLevelBlock.hpp - -sharkFunction.hpp allocation.hpp -sharkFunction.hpp ciEnv.hpp -sharkFunction.hpp ciStreams.hpp -sharkFunction.hpp ciTypeFlow.hpp -sharkFunction.hpp llvmHeaders.hpp -sharkFunction.hpp llvmValue.hpp -sharkFunction.hpp sharkBuilder.hpp -sharkFunction.hpp sharkContext.hpp -sharkFunction.hpp sharkInvariants.hpp -sharkFunction.hpp sharkStack.hpp - -sharkInliner.cpp allocation.hpp -sharkInliner.cpp bytecodes.hpp -sharkInliner.cpp ciField.hpp -sharkInliner.cpp ciMethod.hpp -sharkInliner.cpp ciStreams.hpp -sharkInliner.cpp shark_globals.hpp -sharkInliner.cpp sharkBlock.hpp -sharkInliner.cpp sharkConstant.hpp -sharkInliner.cpp sharkInliner.hpp -sharkInliner.cpp sharkIntrinsics.hpp -sharkInliner.cpp sharkState.hpp -sharkInliner.cpp sharkValue.hpp - -sharkInliner.hpp allocation.hpp -sharkInliner.hpp ciMethod.hpp -sharkInliner.hpp llvmHeaders.hpp -sharkInliner.hpp sharkState.hpp - -sharkIntrinsics.cpp ciMethod.hpp -sharkIntrinsics.cpp llvmHeaders.hpp -sharkIntrinsics.cpp shark_globals.hpp -sharkIntrinsics.cpp sharkIntrinsics.hpp -sharkIntrinsics.cpp sharkState.hpp -sharkIntrinsics.cpp sharkValue.hpp - -sharkIntrinsics.hpp allocation.hpp -sharkIntrinsics.hpp ciMethod.hpp -sharkIntrinsics.hpp llvmHeaders.hpp -sharkIntrinsics.hpp sharkState.hpp - -sharkInvariants.cpp sharkInvariants.hpp - -sharkInvariants.hpp allocation.hpp -sharkInvariants.hpp ciEnv.hpp -sharkInvariants.hpp ciMethod.hpp -sharkInvariants.hpp ciInstanceKlass.hpp -sharkInvariants.hpp ciTypeFlow.hpp -sharkInvariants.hpp debugInfoRec.hpp -sharkInvariants.hpp dependencies.hpp -sharkInvariants.hpp llvmHeaders.hpp -sharkInvariants.hpp sharkBuilder.hpp - -sharkMemoryManager.hpp llvmHeaders.hpp -sharkMemoryManager.hpp sharkEntry.hpp - -sharkMemoryManager.cpp llvmHeaders.hpp -sharkMemoryManager.cpp sharkEntry.hpp -sharkMemoryManager.cpp sharkMemoryManager.hpp - -sharkNativeWrapper.cpp llvmHeaders.hpp -sharkNativeWrapper.cpp sharkNativeWrapper.hpp -sharkNativeWrapper.cpp sharkType.hpp - -sharkNativeWrapper.hpp handles.hpp -sharkNativeWrapper.hpp llvmHeaders.hpp -sharkNativeWrapper.hpp sharkBuilder.hpp -sharkNativeWrapper.hpp sharkContext.hpp -sharkNativeWrapper.hpp sharkInvariants.hpp -sharkNativeWrapper.hpp sharkStack.hpp - -sharkRuntime.cpp biasedLocking.hpp -sharkRuntime.cpp deoptimization.hpp -sharkRuntime.cpp llvmHeaders.hpp -sharkRuntime.cpp klassOop.hpp -sharkRuntime.cpp sharkRuntime.hpp -sharkRuntime.cpp stack_.inline.hpp -sharkRuntime.cpp thread.hpp - -sharkRuntime.hpp allocation.hpp -sharkRuntime.hpp llvmHeaders.hpp -sharkRuntime.hpp llvmValue.hpp -sharkRuntime.hpp klassOop.hpp -sharkRuntime.hpp thread.hpp - -sharkStack.cpp llvmHeaders.hpp -sharkStack.cpp sharkFunction.hpp -sharkStack.cpp sharkNativeWrapper.hpp -sharkStack.cpp sharkStack.hpp -sharkStack.cpp sharkType.hpp - -sharkStack.hpp llvmHeaders.hpp -sharkStack.hpp sharkInvariants.hpp -sharkStack.hpp sharkType.hpp - -sharkState.cpp allocation.hpp -sharkState.cpp ciType.hpp -sharkState.cpp ciTypeFlow.hpp -sharkState.cpp sharkBuilder.hpp -sharkState.cpp sharkCacheDecache.hpp -sharkState.cpp sharkState.hpp -sharkState.cpp sharkTopLevelBlock.hpp -sharkState.cpp sharkType.hpp -sharkState.cpp sharkValue.hpp - -sharkState.hpp allocation.hpp -sharkState.hpp ciMethod.hpp -sharkState.hpp llvmHeaders.hpp -sharkState.hpp sharkBuilder.hpp -sharkState.hpp sharkInvariants.hpp -sharkState.hpp sharkValue.hpp - -sharkStateScanner.cpp sharkState.hpp -sharkStateScanner.cpp sharkStateScanner.hpp - -sharkStateScanner.hpp allocation.hpp -sharkStateScanner.hpp llvmHeaders.hpp -sharkStateScanner.hpp sharkFunction.hpp -sharkStateScanner.hpp sharkInvariants.hpp - -sharkTopLevelBlock.cpp allocation.hpp -sharkTopLevelBlock.cpp bytecodes.hpp -sharkTopLevelBlock.cpp ciField.hpp -sharkTopLevelBlock.cpp ciInstance.hpp -sharkTopLevelBlock.cpp ciObjArrayKlass.hpp -sharkTopLevelBlock.cpp ciStreams.hpp -sharkTopLevelBlock.cpp ciType.hpp -sharkTopLevelBlock.cpp ciTypeFlow.hpp -sharkTopLevelBlock.cpp debug.hpp -sharkTopLevelBlock.cpp deoptimization.hpp -sharkTopLevelBlock.cpp llvmHeaders.hpp -sharkTopLevelBlock.cpp llvmValue.hpp -sharkTopLevelBlock.cpp shark_globals.hpp -sharkTopLevelBlock.cpp sharkCacheDecache.hpp -sharkTopLevelBlock.cpp sharkTopLevelBlock.hpp -sharkTopLevelBlock.cpp sharkBuilder.hpp -sharkTopLevelBlock.cpp sharkConstant.hpp -sharkTopLevelBlock.cpp sharkInliner.hpp -sharkTopLevelBlock.cpp sharkState.hpp -sharkTopLevelBlock.cpp sharkValue.hpp - -sharkTopLevelBlock.hpp allocation.hpp -sharkTopLevelBlock.hpp bytecodes.hpp -sharkTopLevelBlock.hpp ciStreams.hpp -sharkTopLevelBlock.hpp ciType.hpp -sharkTopLevelBlock.hpp ciTypeFlow.hpp -sharkTopLevelBlock.hpp llvmHeaders.hpp -sharkTopLevelBlock.hpp sharkBlock.hpp -sharkTopLevelBlock.hpp sharkBuilder.hpp -sharkTopLevelBlock.hpp sharkFunction.hpp -sharkTopLevelBlock.hpp sharkState.hpp -sharkTopLevelBlock.hpp sharkValue.hpp - -sharkType.hpp allocation.hpp -sharkType.hpp ciType.hpp -sharkType.hpp globalDefinitions.hpp -sharkType.hpp llvmHeaders.hpp -sharkType.hpp sharkContext.hpp - -sharkValue.cpp ciType.hpp -sharkValue.cpp llvmHeaders.hpp -sharkValue.cpp llvmValue.hpp -sharkValue.cpp sharkBuilder.hpp -sharkValue.cpp sharkValue.hpp - -sharkValue.hpp allocation.hpp -sharkValue.hpp ciType.hpp -sharkValue.hpp llvmHeaders.hpp -sharkValue.hpp llvmValue.hpp -sharkValue.hpp sharkType.hpp diff --git a/hotspot/src/share/vm/includeDB_zero b/hotspot/src/share/vm/includeDB_zero deleted file mode 100644 index b175ddac8e4..00000000000 --- a/hotspot/src/share/vm/includeDB_zero +++ /dev/null @@ -1,68 +0,0 @@ -// -// Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. -// Copyright 2009, 2010 Red Hat, Inc. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps! - -cppInterpreter_.cpp stack_.inline.hpp - -entryFrame_.hpp javaCalls.hpp -entryFrame_.hpp stack_.hpp - -fakeStubFrame_.hpp stack_.hpp - -frame.hpp stack_.hpp - -frame.inline.hpp fakeStubFrame_.hpp -frame.inline.hpp entryFrame_.hpp -frame.inline.hpp interpreterFrame_.hpp -frame.inline.hpp sharkFrame_.hpp - -frame_.cpp interpreterRuntime.hpp -frame_.cpp scopeDesc.hpp - -interpreter.hpp entry_.hpp - -interpreterFrame_.hpp bytecodeInterpreter.hpp -interpreterFrame_.hpp methodOop.hpp -interpreterFrame_.hpp stack_.hpp -interpreterFrame_.hpp thread.hpp - -interpreterRT_.cpp stack_.inline.hpp - -sharkFrame_.hpp methodOop.hpp -sharkFrame_.hpp stack_.hpp - -stack_.hpp sizes.hpp - -stack_.inline.hpp stack_.hpp -stack_.inline.hpp thread.hpp - -stack_.cpp interpreterRuntime.hpp -stack_.cpp stack_.hpp -stack_.cpp stack_.inline.hpp - -stubGenerator_.cpp stack_.inline.hpp - -thread.hpp stack_.hpp diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index 117d4ea07da..73eae232dc9 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -22,6 +22,35 @@ * */ +#ifndef SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP +#define SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP + +#include "code/stubs.hpp" +#include "interpreter/bytecodes.hpp" +#include "runtime/vmThread.hpp" +#include "utilities/top.hpp" +#ifdef TARGET_ARCH_MODEL_x86_32 +# include "interp_masm_x86_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_x86_64 +# include "interp_masm_x86_64.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_sparc +# include "interp_masm_sparc.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_zero +# include "interp_masm_zero.hpp" +#endif +#ifdef TARGET_OS_FAMILY_linux +# include "thread_linux.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_solaris +# include "thread_solaris.inline.hpp" +#endif +#ifdef TARGET_OS_FAMILY_windows +# include "thread_windows.inline.hpp" +#endif + // This file contains the platform-independent parts // of the abstract interpreter and the abstract interpreter generator. @@ -256,3 +285,5 @@ class AbstractInterpreterGenerator: public StackObj { public: AbstractInterpreterGenerator(StubQueue* _code); }; + +#endif // SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP diff --git a/hotspot/src/share/vm/interpreter/bytecode.cpp b/hotspot/src/share/vm/interpreter/bytecode.cpp index 58f7ebe64ab..badfc322e82 100644 --- a/hotspot/src/share/vm/interpreter/bytecode.cpp +++ b/hotspot/src/share/vm/interpreter/bytecode.cpp @@ -22,8 +22,15 @@ * */ -#include "incls/_precompiled.incl" -#include "incls/_bytecode.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/bytecode.hpp" +#include "interpreter/linkResolver.hpp" +#include "oops/constantPoolOop.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/fieldType.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/safepoint.hpp" +#include "runtime/signature.hpp" // Implementation of Bytecode diff --git a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp index d172a81879a..ae27187aa14 100644 --- a/hotspot/src/share/vm/interpreter/bytecode.hpp +++ b/hotspot/src/share/vm/interpreter/bytecode.hpp @@ -22,6 +22,22 @@ * */ +#ifndef SHARE_VM_INTERPRETER_BYTECODE_HPP +#define SHARE_VM_INTERPRETER_BYTECODE_HPP + +#include "interpreter/bytecodes.hpp" +#include "memory/allocation.hpp" +#include "oops/methodOop.hpp" +#ifdef TARGET_ARCH_x86 +# include "bytes_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "bytes_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "bytes_zero.hpp" +#endif + // Base class for different kinds of abstractions working // relative to an objects 'this' pointer. @@ -431,3 +447,5 @@ inline Bytecode_loadconstant* Bytecode_loadconstant_at(methodHandle method, int DEBUG_ONLY(b->verify()); return b; } + +#endif // SHARE_VM_INTERPRETER_BYTECODE_HPP diff --git a/hotspot/src/share/vm/interpreter/bytecodeHistogram.cpp b/hotspot/src/share/vm/interpreter/bytecodeHistogram.cpp index 4e3e7621040..31fe4dacb5d 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeHistogram.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeHistogram.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,11 @@ * */ -# include "incls/_precompiled.incl" -# include "incls/_bytecodeHistogram.cpp.incl" +#include "precompiled.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/os.hpp" +#include "utilities/growableArray.hpp" // ------------------------------------------------------------------------------------------------ // Non-product code diff --git a/hotspot/src/share/vm/interpreter/bytecodeHistogram.hpp b/hotspot/src/share/vm/interpreter/bytecodeHistogram.hpp index 21e30d20940..51798d1f078 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeHistogram.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeHistogram.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_INTERPRETER_BYTECODEHISTOGRAM_HPP +#define SHARE_VM_INTERPRETER_BYTECODEHISTOGRAM_HPP + +#include "interpreter/bytecodes.hpp" +#include "memory/allocation.hpp" + // BytecodeCounter counts the number of bytecodes executed class BytecodeCounter: AllStatic { @@ -90,3 +96,5 @@ class BytecodePairHistogram: AllStatic { // Profile printing static void print(float cutoff = 0.01F) PRODUCT_RETURN; // cutoff in percent }; + +#endif // SHARE_VM_INTERPRETER_BYTECODEHISTOGRAM_HPP diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index 9581f24bc30..16ec3ff6081 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -22,10 +22,46 @@ * */ +// no precompiled headers +#include "classfile/vmSymbols.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/bytecodeInterpreter.hpp" +#include "interpreter/bytecodeInterpreter.inline.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "memory/resourceArea.hpp" +#include "oops/objArrayKlass.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/threadCritical.hpp" +#include "utilities/exceptions.hpp" +#ifdef TARGET_OS_ARCH_linux_x86 +# include "orderAccess_linux_x86.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_sparc +# include "orderAccess_linux_sparc.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_zero +# include "orderAccess_linux_zero.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_solaris_x86 +# include "orderAccess_solaris_x86.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_solaris_sparc +# include "orderAccess_solaris_sparc.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_windows_x86 +# include "orderAccess_windows_x86.inline.hpp" +#endif + // no precompiled headers -#include "incls/_bytecodeInterpreter.cpp.incl" - #ifdef CC_INTERP /* @@ -1287,12 +1323,7 @@ run: jfloat f; jdouble r; f = STACK_FLOAT(-1); -#ifdef IA64 - // IA64 gcc bug - r = ( f == 0.0f ) ? (jdouble) f : (jdouble) f + ia64_double_zero; -#else r = (jdouble) f; -#endif MORE_STACK(-1); // POP SET_STACK_DOUBLE(r, 1); UPDATE_PC_AND_TOS_AND_CONTINUE(1, 2); diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp index 086b26b7f8e..636a070d668 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp @@ -22,6 +22,26 @@ * */ +#ifndef SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_HPP +#define SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_HPP + +#include "memory/allocation.hpp" +#include "oops/methodDataOop.hpp" +#include "oops/methodOop.hpp" +#include "runtime/basicLock.hpp" +#include "runtime/frame.hpp" +#include "runtime/globals.hpp" +#include "utilities/globalDefinitions.hpp" +#ifdef TARGET_ARCH_x86 +# include "bytes_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "bytes_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "bytes_zero.hpp" +#endif + #ifdef CC_INTERP // CVM definitions find hotspot equivalents... @@ -558,8 +578,19 @@ void print(); #endif // PRODUCT // Platform fields/methods -# include "incls/_bytecodeInterpreter_pd.hpp.incl" +#ifdef TARGET_ARCH_x86 +# include "bytecodeInterpreter_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "bytecodeInterpreter_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "bytecodeInterpreter_zero.hpp" +#endif + }; // BytecodeInterpreter #endif // CC_INTERP + +#endif // SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_HPP diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp index 041d6a1453f..d0dcf6ce7b7 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +22,12 @@ * */ +#ifndef SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_INLINE_HPP +#define SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_INLINE_HPP + +#include "interpreter/bytecodeInterpreter.hpp" +#include "runtime/stubRoutines.hpp" + // This file holds platform-independent bodies of inline functions for the C++ based interpreter #ifdef CC_INTERP @@ -37,5 +43,16 @@ #endif // Platform dependent data manipulation -# include "incls/_bytecodeInterpreter_pd.inline.hpp.incl" +#ifdef TARGET_ARCH_x86 +# include "bytecodeInterpreter_x86.inline.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "bytecodeInterpreter_sparc.inline.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "bytecodeInterpreter_zero.inline.hpp" +#endif + #endif // CC_INTERP + +#endif // SHARE_VM_INTERPRETER_BYTECODEINTERPRETER_INLINE_HPP diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl b/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl index e35e5f62343..824cd917762 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl @@ -1,6 +1,6 @@ +static void test() throws Throwable { + // THE FOLLOWING LINE IS PSEUDOCODE FOR A JVM INSTRUCTION + InvokeDynamic[#bootstrapDynamic].baz("baz arg", 2, 3.14); +} private static void printArgs(Object... args) { System.out.println(java.util.Arrays.deepToString(args)); } @@ -96,18 +75,16 @@ static { Class thisClass = lookup.lookupClass(); // (who am I?) printArgs = lookup.findStatic(thisClass, "printArgs", MethodType.methodType(void.class, Object[].class)); - Linkage.registerBootstrapMethod("bootstrapDynamic"); } -private static CallSite bootstrapDynamic(Class caller, String name, MethodType type) { +private static CallSite bootstrapDynamic(MethodHandles.Lookup caller, String name, MethodType type) { // ignore caller and name, but match the type: - return new CallSite(MethodHandles.collectArguments(printArgs, type)); + return new ConstantCallSite(MethodHandles.collectArguments(printArgs, type)); } - * @see Linkage#registerBootstrapMethod(java.lang.Class, java.dyn.MethodHandle) * @author John Rose, JSR 292 EG */ -public class CallSite -{ +abstract +public class CallSite { private static final Access IMPL_TOKEN = Access.getToken(); // Fields used only by the JVM. Do not use or change. @@ -115,61 +92,47 @@ public class CallSite private int vmindex; // supplied by the JVM (BCI within calling method) // The actual payload of this call site: - private MethodHandle target; + /*package-private*/ + MethodHandle target; // Remove this field for PFD and delete deprecated methods: private MemberName calleeNameRemoveForPFD; /** - * Make a blank call site object. - * Before it is returned from a bootstrap method, this {@code CallSite} object - * must be provided with - * a target method via a call to {@link CallSite#setTarget(MethodHandle) setTarget}, - * or by a subclass override of {@link CallSite#initialTarget(Class,String,MethodType) initialTarget}. + * Make a blank call site object with the given method type. + * An initial target method is supplied which will throw + * an {@link IllegalStateException} if called. + *

    + * Before this {@code CallSite} object is returned from a bootstrap method, + * it is usually provided with a more useful target method, + * via a call to {@link CallSite#setTarget(MethodHandle) setTarget}. + * @throws NullPointerException if the proposed type is null */ - public CallSite() { + /*package-private*/ + CallSite(MethodType type) { + target = MethodHandles.invokers(type).uninitializedCallSite(); } /** * Make a blank call site object, possibly equipped with an initial target method handle. - * The initial target reference may be null, in which case the {@code CallSite} object - * must be provided with a target method via a call to {@link CallSite#setTarget}, - * or by a subclass override of {@link CallSite#initialTarget}. - * @param target the method handle which will be the initial target of the call site, or null if there is none yet + * @param target the method handle which will be the initial target of the call site + * @throws NullPointerException if the proposed target is null */ - public CallSite(MethodHandle target) { + /*package-private*/ + CallSite(MethodHandle target) { + target.type(); // null check this.target = target; } - /** @deprecated transitional form defined in EDR but removed in PFD */ - public CallSite(Class caller, String name, MethodType type) { - this.calleeNameRemoveForPFD = new MemberName(caller, name, type); - } - /** @deprecated transitional form defined in EDR but removed in PFD */ - public Class callerClass() { - MemberName callee = this.calleeNameRemoveForPFD; - return callee == null ? null : callee.getDeclaringClass(); - } - /** @deprecated transitional form defined in EDR but removed in PFD */ - public String name() { - MemberName callee = this.calleeNameRemoveForPFD; - return callee == null ? null : callee.getName(); - } - /** @deprecated transitional form defined in EDR but removed in PFD */ - public MethodType type() { - MemberName callee = this.calleeNameRemoveForPFD; - return callee == null ? (target == null ? null : target.type()) : callee.getMethodType(); - } - /** @deprecated transitional form defined in EDR but removed in PFD */ - protected MethodHandle initialTarget() { - return initialTarget(callerClass(), name(), type()); - } - - /** Report if the JVM has linked this {@code CallSite} object to a dynamic call site instruction. - * Once it is linked, it is never unlinked. + /** + * Report the type of this call site's target. + * Although targets may change, the call site's type can never change. + * The {@code setTarget} method enforces this invariant by refusing any new target that does + * not have the previous target's type. + * @return the type of the current target, which is also the type of any future target */ - private boolean isLinked() { - return vmmethod != null; + public MethodType type() { + return target.type(); } /** Called from JVM (or low-level Java code) after the BSM returns the newly created CallSite. @@ -179,67 +142,66 @@ public class CallSite MethodType type, MemberName callerMethod, int callerBCI) { - if (this.isLinked()) { + if (this.vmmethod != null) { + // FIXME throw new InvokeDynamicBootstrapError("call site has already been linked to an invokedynamic instruction"); } - MethodHandle target = this.target; - if (target == null) { - this.target = target = this.initialTarget(callerMethod.getDeclaringClass(), name, type); - } - if (!target.type().equals(type)) { + if (!this.type().equals(type)) { throw wrongTargetType(target, type); } this.vmindex = callerBCI; this.vmmethod = callerMethod; - assert(this.isLinked()); } /** - * Just after a call site is created by a bootstrap method handle, - * if the target has not been initialized by the factory method itself, - * the method {@code initialTarget} is called to produce an initial - * non-null target. (Live call sites must never have null targets.) + * Report the current linkage state of the call site, a value which may change over time. *

    - * The arguments are the same as those passed to the bootstrap method. - * Thus, a bootstrap method is free to ignore the arguments and simply - * create a "blank" {@code CallSite} object of an appropriate subclass. + * If a {@code CallSite} object is returned + * from the bootstrap method of the {@code invokedynamic} instruction, + * the {@code CallSite} is permanently bound to that instruction. + * When the {@code invokedynamic} instruction is executed, the target method + * of its associated call site object is invoked directly. + * It is as if the instruction calls {@code getTarget} and then + * calls {@link MethodHandle#invokeExact invokeExact} on the result. *

    - * If the bootstrap method itself does not initialize the call site, - * this method must be overridden, because it just raises an - * {@code InvokeDynamicBootstrapError}, which in turn causes the - * linkage of the {@code invokedynamic} instruction to terminate - * abnormally. - */ - protected MethodHandle initialTarget(Class callerClass, String name, MethodType type) { - throw new InvokeDynamicBootstrapError("target must be initialized before call site is linked: "+name+type); - } - - /** - * Report the current linkage state of the call site. (This is mutable.) - * The value may not be null after the {@code CallSite} object is returned - * from the bootstrap method of the {@code invokedynamic} instruction. - * When an {@code invokedynamic} instruction is executed, the target method - * of its associated {@code call site} object is invoked directly, - * as if via {@link MethodHandle}{@code .invoke}. - *

    - * The interactions of {@code getTarget} with memory are the same + * Unless specified differently by a subclass, + * the interactions of {@code getTarget} with memory are the same * as of a read from an ordinary variable, such as an array element or a * non-volatile, non-final field. *

    * In particular, the current thread may choose to reuse the result * of a previous read of the target from memory, and may fail to see * a recent update to the target by another thread. - * @return the current linkage state of the call site + *

    + * In a {@linkplain ConstantCallSite constant call site}, the {@code getTarget} method behaves + * like a read from a {@code final} field of the {@code CallSite}. + *

    + * In a {@linkplain VolatileCallSite volatile call site}, the {@code getTarget} method behaves + * like a read from a {@code volatile} field of the {@code CallSite}. + *

    + * This method may not be overridden by application code. + * @return the current linkage state of the call site, its target method handle + * @see ConstantCallSite + * @see VolatileCallSite * @see #setTarget */ - public MethodHandle getTarget() { + public final MethodHandle getTarget() { + return getTarget0(); + } + + /** + * Privileged implementations can override this to force final or volatile semantics on getTarget. + */ + /*package-private*/ + MethodHandle getTarget0() { return target; } /** * Set the target method of this call site. *

    - * The interactions of {@code setTarget} with memory are the same + * Unless a subclass of CallSite documents otherwise, + * the interactions of {@code setTarget} with memory are the same * as of a write to an ordinary variable, such as an array element or a * non-volatile, non-final field. *

    @@ -250,44 +212,87 @@ public class CallSite * at any given call site. * @param newTarget the new target * @throws NullPointerException if the proposed new target is null - * @throws WrongMethodTypeException if the call site is linked and the proposed new target + * @throws WrongMethodTypeException if the proposed new target * has a method type that differs from the previous target + * @throws UnsupportedOperationException if the call site is + * in fact a {@link ConstantCallSite} */ public void setTarget(MethodHandle newTarget) { - MethodType newType = newTarget.type(); // null check! - MethodHandle oldTarget = this.target; - if (oldTarget == null) { - // CallSite is not yet linked. - assert(!isLinked()); - this.target = newTarget; // might be null! - return; - } + checkTargetChange(this.target, newTarget); + setTargetNormal(newTarget); + } + + void checkTargetChange(MethodHandle oldTarget, MethodHandle newTarget) { MethodType oldType = oldTarget.type(); - if (!newTarget.type().equals(oldType)) + MethodType newType = newTarget.type(); // null check! + if (!newType.equals(oldType)) throw wrongTargetType(newTarget, oldType); - if (oldTarget != newTarget) - CallSiteImpl.setCallSiteTarget(IMPL_TOKEN, this, newTarget); } private static WrongMethodTypeException wrongTargetType(MethodHandle target, MethodType type) { - return new WrongMethodTypeException(String.valueOf(target)+target.type()+" should be of type "+type); + return new WrongMethodTypeException(String.valueOf(target)+" should be of type "+type); } - /** Produce a printed representation that displays information about this call site - * that may be useful to the human reader. + /** + * Produce a method handle equivalent to an invokedynamic instruction + * which has been linked to this call site. + *

    If this call site is a {@linkplain ConstantCallSite constant call site}, + * this method simply returns the call site's target, since that will never change. + *

    Otherwise, this method is equivalent to the following code: + *

    +     * MethodHandle getTarget, invoker, result;
    +     * getTarget = MethodHandles.lookup().bind(this, "getTarget", MethodType.methodType(MethodHandle.class));
    +     * invoker = MethodHandles.exactInvoker(this.type());
    +     * result = MethodHandles.foldArguments(invoker, getTarget)
    +     * 
    + * @return a method handle which always invokes this call site's current target */ - @Override - public String toString() { - StringBuilder buf = new StringBuilder("CallSite#"); - buf.append(hashCode()); - if (!isLinked()) - buf.append("[unlinked]"); - else - buf.append("[") - .append("from ").append(vmmethod.getDeclaringClass().getName()) - .append(" : ").append(getTarget().type()) - .append(" => ").append(getTarget()) - .append("]"); - return buf.toString(); + public final MethodHandle dynamicInvoker() { + if (this instanceof ConstantCallSite) { + return getTarget0(); // will not change dynamically + } + MethodHandle getTarget = MethodHandleImpl.bindReceiver(IMPL_TOKEN, GET_TARGET, this); + MethodHandle invoker = MethodHandles.exactInvoker(this.type()); + return MethodHandles.foldArguments(invoker, getTarget); + } + private static final MethodHandle GET_TARGET; + static { + try { + GET_TARGET = MethodHandles.Lookup.IMPL_LOOKUP. + findVirtual(CallSite.class, "getTarget", MethodType.methodType(MethodHandle.class)); + } catch (NoAccessException ignore) { + throw new InternalError(); + } + } + + /** This guy is rolled into the default target if a MethodType is supplied to the constructor. */ + /*package-private*/ + static Empty uninitializedCallSite() { + throw new IllegalStateException("uninitialized call site"); + } + + // unsafe stuff: + private static final Unsafe unsafe = Unsafe.getUnsafe(); + private static final long TARGET_OFFSET; + + static { + try { + TARGET_OFFSET = unsafe.objectFieldOffset(CallSite.class.getDeclaredField("target")); + } catch (Exception ex) { throw new Error(ex); } + } + + /*package-private*/ + void setTargetNormal(MethodHandle newTarget) { + target = newTarget; + //CallSiteImpl.setCallSiteTarget(IMPL_TOKEN, this, newTarget); + } + /*package-private*/ + MethodHandle getTargetVolatile() { + return (MethodHandle) unsafe.getObjectVolatile(this, TARGET_OFFSET); + } + /*package-private*/ + void setTargetVolatile(MethodHandle newTarget) { + unsafe.putObjectVolatile(this, TARGET_OFFSET, newTarget); + //CallSiteImpl.setCallSiteTarget(IMPL_TOKEN, this, newTarget); } } diff --git a/jdk/src/share/classes/java/dyn/ClassValue.java b/jdk/src/share/classes/java/dyn/ClassValue.java new file mode 100644 index 00000000000..7b00a727d07 --- /dev/null +++ b/jdk/src/share/classes/java/dyn/ClassValue.java @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.dyn; + +import java.util.WeakHashMap; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.lang.reflect.UndeclaredThrowableException; + +/** + * Lazily associate a computed value with (potentially) every class. + * @author John Rose, JSR 292 EG + */ +public class ClassValue { + /** + * Compute the given class's derived value for this {@code ClassValue}. + *

    + * This method will be invoked within the first thread that accesses + * the value with the {@link #get get} method. + *

    + * Normally, this method is invoked at most once per class, + * but it may be invoked again if there has been a call to + * {@link #remove remove}. + *

    + * If there is no override from a subclass, this method returns + * the result of applying the {@code ClassValue}'s {@code computeValue} + * method handle, which was supplied at construction time. + * + * @return the newly computed value associated with this {@code ClassValue}, for the given class or interface + * @throws UndeclaredThrowableException if the {@code computeValue} method handle invocation throws something other than a {@code RuntimeException} or {@code Error} + * @throws UnsupportedOperationException if the {@code computeValue} method handle is null (subclasses must override) + */ + protected T computeValue(Class type) { + if (computeValue == null) + return null; + try { + return (T) (Object) computeValue.invokeGeneric(type); + } catch (Throwable ex) { + if (ex instanceof Error) throw (Error) ex; + if (ex instanceof RuntimeException) throw (RuntimeException) ex; + throw new UndeclaredThrowableException(ex); + } + } + + private final MethodHandle computeValue; + + /** + * Creates a new class value. + * Subclasses which use this constructor must override + * the {@link #computeValue computeValue} method, + * since the default {@code computeValue} method requires a method handle, + * which this constructor does not provide. + */ + protected ClassValue() { + this.computeValue = null; + } + + /** + * Creates a new class value, whose {@link #computeValue computeValue} method + * will return the result of {@code computeValue.invokeGeneric(type)}. + * @throws NullPointerException if the method handle parameter is null + */ + public ClassValue(MethodHandle computeValue) { + computeValue.getClass(); // trigger NPE if null + this.computeValue = computeValue; + } + + /** + * Returns the value for the given class. + * If no value has yet been computed, it is obtained by + * by an invocation of the {@link #computeValue computeValue} method. + *

    + * The actual installation of the value on the class + * is performed atomically. + * At that point, if racing threads have + * computed values, one is chosen, and returned to + * all the racing threads. + * + * @return the current value associated with this {@code ClassValue}, for the given class or interface + */ + public T get(Class type) { + ClassValueMap map = getMap(type); + if (map != null) { + Object x = map.get(this); + if (x != null) { + return (T) map.unmaskNull(x); + } + } + return setComputedValue(type); + } + + /** + * Removes the associated value for the given class. + * If this value is subsequently {@linkplain #get read} for the same class, + * its value will be reinitialized by invoking its {@link #computeValue computeValue} method. + * This may result in an additional invocation of the + * {@code computeValue computeValue} method for the given class. + *

    + * If racing threads perform a combination of {@code get} and {@code remove} calls, + * the calls are serialized. + * A value produced by a call to {@code computeValue} will be discarded, if + * the corresponding {@code get} call was followed by a {@code remove} call + * before the {@code computeValue} could complete. + * In such a case, the {@code get} call will re-invoke {@code computeValue}. + */ + public void remove(Class type) { + ClassValueMap map = getMap(type); + if (map != null) { + synchronized (map) { + map.remove(this); + } + } + } + + /// Implementation... + + /** The hash code for this type is based on the identity of the object, + * and is well-dispersed for power-of-two tables. + */ + public final int hashCode() { return hashCode; } + private final int hashCode = HASH_CODES.getAndAdd(0x61c88647); + private static final AtomicInteger HASH_CODES = new AtomicInteger(); + + private static final AtomicInteger STORE_BARRIER = new AtomicInteger(); + + /** Slow path for {@link #get}. */ + private T setComputedValue(Class type) { + ClassValueMap map = getMap(type); + if (map == null) { + map = initializeMap(type); + } + T value = computeValue(type); + STORE_BARRIER.lazySet(0); + // All stores pending from computeValue are completed. + synchronized (map) { + // Warm up the table with a null entry. + map.preInitializeEntry(this); + } + STORE_BARRIER.lazySet(0); + // All stores pending from table expansion are completed. + synchronized (map) { + value = (T) map.initializeEntry(this, value); + // One might fear a possible race condition here + // if the code for map.put has flushed the write + // to map.table[*] before the writes to the Map.Entry + // are done. This is not possible, since we have + // warmed up the table with an empty entry. + } + return value; + } + + // Replace this map by a per-class slot. + private static final WeakHashMap, ClassValueMap> ROOT + = new WeakHashMap, ClassValueMap>(); + + private static ClassValueMap getMap(Class type) { + return ROOT.get(type); + } + + private static ClassValueMap initializeMap(Class type) { + synchronized (ClassValue.class) { + ClassValueMap map = ROOT.get(type); + if (map == null) + ROOT.put(type, map = new ClassValueMap()); + return map; + } + } + + static class ClassValueMap extends WeakHashMap { + /** Make sure this table contains an Entry for the given key, even if it is empty. */ + void preInitializeEntry(ClassValue key) { + if (!this.containsKey(key)) + this.put(key, null); + } + /** Make sure this table contains a non-empty Entry for the given key. */ + Object initializeEntry(ClassValue key, Object value) { + Object prior = this.get(key); + if (prior != null) { + return unmaskNull(prior); + } + this.put(key, maskNull(value)); + return value; + } + + Object maskNull(Object x) { + return x == null ? this : x; + } + Object unmaskNull(Object x) { + return x == this ? null : x; + } + } +} diff --git a/jdk/src/share/classes/java/dyn/ConstantCallSite.java b/jdk/src/share/classes/java/dyn/ConstantCallSite.java new file mode 100644 index 00000000000..585fdc712ce --- /dev/null +++ b/jdk/src/share/classes/java/dyn/ConstantCallSite.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.dyn; + +/** + * A {@code ConstantCallSite} is a {@link CallSite} whose target is permanent, and can never be changed. + * An {@code invokedynamic} instruction linked to a {@code ConstantCallSite} is permanently + * bound to the call site's target. + * @author John Rose, JSR 292 EG + */ +public class ConstantCallSite extends CallSite { + /** Create a call site with a permanent target. + * @throws NullPointerException if the proposed target is null + */ + public ConstantCallSite(MethodHandle target) { + super(target); + } + /** + * Throw an {@link UnsupportedOperationException}, because this kind of call site cannot change its target. + */ + @Override public final void setTarget(MethodHandle ignore) { + throw new UnsupportedOperationException("ConstantCallSite"); + } +} diff --git a/jdk/src/share/classes/java/dyn/InvokeDynamic.java b/jdk/src/share/classes/java/dyn/InvokeDynamic.java index 021e75a1ea7..9c3ede1ee36 100644 --- a/jdk/src/share/classes/java/dyn/InvokeDynamic.java +++ b/jdk/src/share/classes/java/dyn/InvokeDynamic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,46 +26,8 @@ package java.dyn; /** - * {@code InvokeDynamic} is a class with neither methods nor instances, - * which serves only as a syntactic marker in Java source code for - * an {@code invokedynamic} instruction. - * (See the package information for specifics on this instruction.) - *

    - * The {@code invokedynamic} instruction is incomplete without a target method. - * The target method is a property of the reified {@linkplain CallSite call site object} - * which is linked to each active {@code invokedynamic} instruction. - * The call site object is initially produced by a - * {@linkplain java.dyn.Linkage#registerBootstrapMethod(Class, MethodHandle) bootstrap method} - * associated with the class whose bytecodes include the dynamic call site. - *

    - * The type {@code InvokeDynamic} has no particular meaning as a - * class or interface supertype, or an object type; it can never be instantiated. - * Logically, it denotes a source of all dynamically typed methods. - * It may be viewed as a pure syntactic marker of static calls. - * It may be imported for ease of use. - *

    - * Here are some examples: - *

    - * Object x; String s; int i;
    - * x = InvokeDynamic.greet("world"); // greet(Ljava/lang/String;)Ljava/lang/Object;
    - * s = InvokeDynamic.<String>hail(x); // hail(Ljava/lang/Object;)Ljava/lang/String;
    - * InvokeDynamic.<void>cogito(); // cogito()V
    - * i = InvokeDynamic.<int>#"op:+"(2, 3); // "op:+"(II)I
    - * 
    - * Each of the above calls generates a single invokedynamic instruction - * with the name-and-type descriptors indicated in the comments. - * The argument types are taken directly from the actual arguments, - * while the return type is taken from the type parameter. - * (This type parameter may be a primtive, and it defaults to {@code Object}.) - * The final example uses a special syntax for uttering non-Java names. - * Any name legal to the JVM may be given between the double quotes. - * None of these calls is complete without a bootstrap method, - * which must be registered by the static initializer of the enclosing class. - * @author John Rose, JSR 292 EG + * This is a place-holder class. Some HotSpot implementations need to see it. */ -@MethodHandle.PolymorphicSignature -public final class InvokeDynamic { +final class InvokeDynamic { private InvokeDynamic() { throw new InternalError(); } // do not instantiate - - // no statically defined static methods } diff --git a/jdk/src/share/classes/java/dyn/InvokeDynamicBootstrapError.java b/jdk/src/share/classes/java/dyn/InvokeDynamicBootstrapError.java index a301dfa42bc..1fe1af02b45 100644 --- a/jdk/src/share/classes/java/dyn/InvokeDynamicBootstrapError.java +++ b/jdk/src/share/classes/java/dyn/InvokeDynamicBootstrapError.java @@ -28,15 +28,11 @@ package java.dyn; /** * Thrown to indicate that an {@code invokedynamic} instruction has * failed to find its - * {@linkplain Linkage#registerBootstrapMethod(Class, MethodHandle) bootstrap method}, + * {@linkplain BootstrapMethod bootstrap method}, * or the bootstrap method has * failed to provide a * {@linkplain CallSite} call site with a non-null {@linkplain MethodHandle target} * of the correct {@linkplain MethodType method type}. - *

    - * The bootstrap method must have been declared during a class's initialization - * by a call to one of the overloadings of - * {@link Linkage#registerBootstrapMethod registerBootstrapMethod}. * * @author John Rose, JSR 292 EG * @since 1.7 @@ -71,4 +67,16 @@ public class InvokeDynamicBootstrapError extends LinkageError { public InvokeDynamicBootstrapError(String s, Throwable cause) { super(s, cause); } + + /** + * Constructs a {@code InvokeDynamicBootstrapError} with the specified + * cause. + * + * @param cause the cause, may be {@code null}. + */ + public InvokeDynamicBootstrapError(Throwable cause) { + // cf. Throwable(Throwable cause) constructor. + super(cause == null ? null : cause.toString()); + initCause(cause); + } } diff --git a/jdk/src/share/classes/java/dyn/JavaMethodHandle.java b/jdk/src/share/classes/java/dyn/JavaMethodHandle.java deleted file mode 100644 index d8cd87a5ed5..00000000000 --- a/jdk/src/share/classes/java/dyn/JavaMethodHandle.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package java.dyn; - -import sun.dyn.Access; - -/** - * A Java method handle is a deprecated proposal for extending - * the basic method handle type with additional - * programmer defined methods and fields. - * Its behavior as a method handle is determined at instance creation time, - * by providing the new instance with an "entry point" method handle - * to handle calls. This entry point must accept a leading argument - * whose type is the Java method handle itself or a supertype, and the - * entry point is always called with the Java method handle itself as - * the first argument. This is similar to ordinary virtual methods, which also - * accept the receiver object {@code this} as an implicit leading argument. - * The {@code MethodType} of the Java method handle is the same as that - * of the entry point method handle, with the leading parameter type - * omitted. - *

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

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

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

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

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

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

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

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

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

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

    - *     abstract class AssignableMethodHandle extends JavaMethodHandle {
    - *       private final MethodHandle setter;
    - *       public MethodHandle setter() { return setter; }
    - *       public AssignableMethodHandle(String get, String set) {
    - *         super(get);
    - *         MethodType getType = this.type();
    - *         MethodType setType = getType.insertParameterType(getType.parameterCount(), getType.returnType()).changeReturnType(void.class);
    - *         this.setter = MethodHandles.publicLookup().bind(this, set, setType);
    - *       }
    - *     }
    - *     // class Main { public static void main(String... av) { ...
    - *     final Number[] stuff = { 123, 456 };
    - *     AssignableMethodHandle stuffPtr = new AssignableMethodHandle("get", "set") {
    - *         public Number get(long i)           { return stuff[(int)i]; }
    - *         public void   set(long i, Object x) {        stuff[(int)i] = x; }
    - *     }
    - *     int x = (Integer) stuffPtr.<Number>invokeExact(1L);  // 456
    - *     stuffPtr.setter().<void>invokeExact(0L, (Number) 789);  // replaces 123 with 789
    - * 
    - * @see MethodHandle - * @deprecated The JSR 292 EG intends to replace {@code JavaMethodHandle} with - * an interface-based API for mixing method handle behavior with other classes. - * @author John Rose, JSR 292 EG - */ -public abstract class JavaMethodHandle - // Note: This is an implementation inheritance hack, and will be removed - // with a JVM change which moves the required hidden behavior onto this class. - extends sun.dyn.BoundMethodHandle -{ - private static final Access IMPL_TOKEN = Access.getToken(); - - /** - * When creating a {@code JavaMethodHandle}, the actual method handle - * invocation behavior will be delegated to the specified {@code entryPoint}. - * This may be any method handle which can take the newly constructed object - * as a leading parameter. - *

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

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

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

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

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

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

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

    - * For this method's rationale, see the documentation - * for {@link #JavaMethodHandle(String,MethodType)}. - * @param entryPointName the name of the entry point method - */ - protected JavaMethodHandle(String entryPointName) { - super(entryPointName, (MethodType) null, false); - } -} diff --git a/jdk/src/share/classes/java/dyn/Linkage.java b/jdk/src/share/classes/java/dyn/Linkage.java index d65ae41c31c..aad9409abdf 100644 --- a/jdk/src/share/classes/java/dyn/Linkage.java +++ b/jdk/src/share/classes/java/dyn/Linkage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,20 +25,20 @@ package java.dyn; -import java.lang.annotation.Annotation; import java.dyn.MethodHandles.Lookup; import java.util.WeakHashMap; import sun.dyn.Access; import sun.dyn.MethodHandleImpl; +import sun.dyn.util.VerifyAccess; import sun.reflect.Reflection; -import static sun.dyn.util.VerifyAccess.checkBootstrapPrivilege; import static sun.dyn.MemberName.newIllegalArgumentException; /** - * This class consists exclusively of static methods that control - * the linkage of {@code invokedynamic} instructions, and specifically - * their reification as {@link CallSite} objects. + * CLASS WILL BE REMOVED FOR PFD: + * Static routines for controlling invokedynamic behavior. + * Replaced by non-static APIs. * @author John Rose, JSR 292 EG + * @deprecated This class will be removed in the Public Final Draft. */ public class Linkage { private static final Access IMPL_TOKEN = Access.getToken(); @@ -46,75 +46,24 @@ public class Linkage { private Linkage() {} // do not instantiate /** - * PROVISIONAL API, WORK IN PROGRESS: + * METHOD WILL BE REMOVED FOR PFD: * Register a bootstrap method to use when linking dynamic call sites within * a given caller class. - *

    - * A bootstrap method must be a method handle with a return type of {@link CallSite} - * and the following arguments: - *

      - *
    • the class containing the {@code invokedynamic} instruction, for which the bootstrap method was registered - *
    • the name of the method being invoked (a {@link String}) - *
    • the type of the method being invoked (a {@link MethodType}) - *
    • TBD optionally, an unordered array of {@link Annotation}s attached to the call site - * (Until this feature is implemented, this will always receive an empty array.) - *
    - * (TBD: The final argument type may be missing from the method handle's type. - * Additional arguments may be added in the future.) - * The bootstrap method acts as a factory method which accepts the given arguments - * and returns a {@code CallSite} object (possibly of a subclass of {@code CallSite}). - *

    - * The registration must take place exactly once, either before the class has begun - * being initialized, or from within the class's static initializer. - * Registration will fail with an exception if any of the following conditions hold: - *

      - *
    • The immediate caller of this method is in a different package than the given caller class, - * and there is a security manager, and its {@code checkPermission} call throws - * when passed {@link LinkagePermission}("registerBootstrapMethod",callerClass). - *
    • The given caller class already has a bootstrap method registered. - *
    • The given caller class is already fully initialized. - *
    • The given caller class is in the process of initialization, in another thread. - *
    - * Because of these rules, a class may install its own bootstrap method in - * a static initializer. - * @param callerClass a class that may have {@code invokedynamic} sites - * @param bootstrapMethod the method to use to bootstrap all such sites - * @exception IllegalArgumentException if the class argument is null or - * a primitive class, or if the bootstrap method is the wrong type - * @exception IllegalStateException if the class already has a bootstrap - * method, or if the its static initializer has already run - * or is already running in another thread - * @exception SecurityException if there is a security manager installed, - * and a {@link LinkagePermission} check fails for "registerBootstrapMethod" + * @deprecated Use @{@link BootstrapMethod} annotations instead. */ public static void registerBootstrapMethod(Class callerClass, MethodHandle bootstrapMethod) { Class callc = Reflection.getCallerClass(2); - checkBootstrapPrivilege(callc, callerClass, "registerBootstrapMethod"); - checkBSM(bootstrapMethod); + if (callc != null && !VerifyAccess.isSamePackage(callerClass, callc)) + throw new IllegalArgumentException("cannot set bootstrap method on "+callerClass); MethodHandleImpl.registerBootstrap(IMPL_TOKEN, callerClass, bootstrapMethod); } - static private void checkBSM(MethodHandle mh) { - if (mh == null) throw newIllegalArgumentException("null bootstrap method"); - if (mh.type() == BOOTSTRAP_METHOD_TYPE_2) - // For now, always pass an empty array for the Annotations argument - mh = MethodHandles.insertArguments(mh, BOOTSTRAP_METHOD_TYPE_2.parameterCount()-1, - (Object)NO_ANNOTATIONS); - if (mh.type() == BOOTSTRAP_METHOD_TYPE) return; - throw new WrongMethodTypeException(mh.toString()); - } - static private final Annotation[] NO_ANNOTATIONS = { }; - /** - * PROVISIONAL API, WORK IN PROGRESS: + * METHOD WILL BE REMOVED FOR PFD: * Simplified version of {@code registerBootstrapMethod} for self-registration, * to be called from a static initializer. - * Finds a static method of the required type in the - * given runtime class, and installs it on the caller class. - * @throws NoSuchMethodException if there is no such method - * @throws IllegalStateException if the caller class's static initializer - * has already run, or is already running in another thread + * @deprecated Use @{@link BootstrapMethod} annotations instead. */ public static void registerBootstrapMethod(Class runtime, String name) { @@ -123,14 +72,9 @@ public class Linkage { } /** - * PROVISIONAL API, WORK IN PROGRESS: + * METHOD WILL BE REMOVED FOR PFD: * Simplified version of {@code registerBootstrapMethod} for self-registration, - * to be called from a static initializer. - * Finds a static method of the required type in the - * caller class itself, and installs it on the caller class. - * @throws IllegalArgumentException if there is no such method - * @throws IllegalStateException if the caller class's static initializer - * has already run, or is already running in another thread + * @deprecated Use @{@link BootstrapMethod} annotations instead. */ public static void registerBootstrapMethod(String name) { @@ -142,98 +86,38 @@ public class Linkage { void registerBootstrapMethodLookup(Class callerClass, Class runtime, String name) { Lookup lookup = new Lookup(IMPL_TOKEN, callerClass); MethodHandle bootstrapMethod; - // Try both types. TBD try { - bootstrapMethod = lookup.findStatic(runtime, name, BOOTSTRAP_METHOD_TYPE_2); + bootstrapMethod = lookup.findStatic(runtime, name, BOOTSTRAP_METHOD_TYPE); } catch (NoAccessException ex) { - bootstrapMethod = null; + throw new IllegalArgumentException("no such bootstrap method in "+runtime+": "+name, ex); } - if (bootstrapMethod == null) { - try { - bootstrapMethod = lookup.findStatic(runtime, name, BOOTSTRAP_METHOD_TYPE); - } catch (NoAccessException ex) { - throw new IllegalArgumentException("no such bootstrap method in "+runtime+": "+name, ex); - } - } - checkBSM(bootstrapMethod); MethodHandleImpl.registerBootstrap(IMPL_TOKEN, callerClass, bootstrapMethod); } - /** - * PROVISIONAL API, WORK IN PROGRESS: - * Report the bootstrap method registered for a given caller class. - * Returns null if the class has never yet registered a bootstrap method. - * Only callers privileged to set the bootstrap method may inquire - * about it, because a bootstrap method is potentially a back-door entry - * point into its class. - * @exception IllegalArgumentException if the argument is null or - * a primitive class - * @exception SecurityException if there is a security manager installed, - * and the immediate caller of this method is not in the same - * package as the caller class - * and a {@link LinkagePermission} check fails for "getBootstrapMethod" - */ - public static - MethodHandle getBootstrapMethod(Class callerClass) { - Class callc = Reflection.getCallerClass(2); - checkBootstrapPrivilege(callc, callerClass, "getBootstrapMethod"); - return MethodHandleImpl.getBootstrap(IMPL_TOKEN, callerClass); - } - - /** - * PROVISIONAL API, WORK IN PROGRESS: - * The type of any bootstrap method is a three-argument method - * {@code (Class, String, MethodType)} returning a {@code CallSite}. - */ - public static final MethodType BOOTSTRAP_METHOD_TYPE + private static final MethodType BOOTSTRAP_METHOD_TYPE = MethodType.methodType(CallSite.class, Class.class, String.class, MethodType.class); - static final MethodType BOOTSTRAP_METHOD_TYPE_2 - = MethodType.methodType(CallSite.class, - Class.class, String.class, MethodType.class, - Annotation[].class); /** - * PROVISIONAL API, WORK IN PROGRESS: + * METHOD WILL BE REMOVED FOR PFD: * Invalidate all invokedynamic call sites everywhere. - *

    - * When this method returns, every invokedynamic instruction - * will invoke its bootstrap method on next call. - *

    - * It is unspecified whether call sites already known to the Java - * code will continue to be associated with invokedynamic - * instructions. If any call site is still so associated, its - * {@link CallSite#getTarget()} method is guaranteed to return null - * the invalidation operation completes. - *

    - * Invalidation operations are likely to be slow. Use them sparingly. + * @deprecated Use {@linkplain CallSite#setTarget call site target setting} + * and {@link VolatileCallSite#invalidateAll call site invalidation} instead. */ public static Object invalidateAll() { - SecurityManager security = System.getSecurityManager(); - if (security != null) { - security.checkPermission(new LinkagePermission("invalidateAll")); - } - throw new UnsupportedOperationException("NYI"); + throw new UnsupportedOperationException(); } /** - * PROVISIONAL API, WORK IN PROGRESS: + * METHOD WILL BE REMOVED FOR PFD: * Invalidate all {@code invokedynamic} call sites in the bytecodes * of any methods of the given class. - *

    - * When this method returns, every matching invokedynamic - * instruction will invoke its bootstrap method on next call. - *

    - * For additional semantics of call site invalidation, - * see {@link #invalidateAll()}. + * @deprecated Use {@linkplain CallSite#setTarget call site target setting} + * and {@link VolatileCallSite#invalidateAll call site invalidation} instead. */ public static Object invalidateCallerClass(Class callerClass) { - SecurityManager security = System.getSecurityManager(); - if (security != null) { - security.checkPermission(new LinkagePermission("invalidateAll", callerClass)); - } - throw new UnsupportedOperationException("NYI"); + throw new UnsupportedOperationException(); } } diff --git a/jdk/src/share/classes/java/dyn/LinkagePermission.java b/jdk/src/share/classes/java/dyn/LinkagePermission.java deleted file mode 100644 index 6f6dc5004eb..00000000000 --- a/jdk/src/share/classes/java/dyn/LinkagePermission.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package java.dyn; - -import java.security.*; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.StringTokenizer; - -/** - * This class is for managing runtime permission checking for - * operations performed by methods in the {@link Linkage} class. - * Like a {@link RuntimePermission}, on which it is modeled, - * a {@code LinkagePermission} contains a target name but - * no actions list; you either have the named permission - * or you don't. - *

    - * The following table lists all the possible {@code LinkagePermission} target names, - * and for each provides a description of what the permission allows - * and a discussion of the risks of granting code the permission. - *

    - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    Permission Target NameWhat the Permission AllowsRisks of Allowing this Permission
    registerBootstrapMethod.{class name}Specifying a bootstrap method for {@code invokedynamic} instructions within a class of the given nameAn attacker could attempt to attach a bootstrap method to a class which - * has just been loaded, thus gaining control of its {@code invokedynamic} calls.
    invalidateAllForce the relinking of invokedynamic call sites everywhere.This could allow an attacker to slow down the system, - * or perhaps expose timing bugs in a dynamic language implementations, - * by forcing redundant relinking operations.
    invalidateCallerClass.{class name}Force the relinking of invokedynamic call sites in the given class.See {@code invalidateAll}.
    - * - * @see java.security.RuntimePermission - * @see java.lang.SecurityManager - * - * @author John Rose, JSR 292 EG - */ - -public final class LinkagePermission extends BasicPermission { - private static final long serialVersionUID = 292L; - - /** - * Create a new LinkagePermission with the given name. - * The name is the symbolic name of the LinkagePermission, such as - * "registerBootstrapMethod", "invalidateCallerClass.*", etc. An asterisk - * may appear at the end of the name, following a ".", or by itself, to - * signify a wildcard match. - * - * @param name the name of the LinkagePermission - */ - public LinkagePermission(String name) { - super(name); - } - - /** - * Create a new LinkagePermission with the given name on the given class. - * Equivalent to {@code LinkagePermission(name+"."+clazz.getName())}. - * - * @param name the name of the LinkagePermission - * @param clazz the class affected by the permission - */ - public LinkagePermission(String name, Class clazz) { - super(name + "." + clazz.getName()); - } -} diff --git a/jdk/src/share/classes/java/dyn/MethodHandle.java b/jdk/src/share/classes/java/dyn/MethodHandle.java index 20387ca6859..25d0f807488 100644 --- a/jdk/src/share/classes/java/dyn/MethodHandle.java +++ b/jdk/src/share/classes/java/dyn/MethodHandle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,19 +36,30 @@ import static sun.dyn.MemberName.newIllegalArgumentException; // utility /** * A method handle is a typed, directly executable reference to a method, * constructor, field, or similar low-level operation, with optional - * conversion or substitution of arguments or return values. + * transformations of arguments or return values. + * These transformations are quite general, and include such patterns as + * {@linkplain #asType conversion}, + * {@linkplain #bindTo insertion}, + * {@linkplain java.dyn.MethodHandles#dropArguments deletion}, + * and {@linkplain java.dyn.MethodHandles#filterArguments substitution}. + *

    + * Note: The super-class of MethodHandle is Object. + * Any other super-class visible in the Reference Implementation + * will be removed before the Proposed Final Draft. + * Also, the final version will not include any public or + * protected constructors. *

    * Method handles are strongly typed according to signature. * They are not distinguished by method name or enclosing class. - * A method handle must be invoked under a signature which exactly matches - * the method handle's own {@link MethodType method type}. + * A method handle must be invoked under a signature which matches + * the method handle's own {@linkplain MethodType method type}. *

    - * Every method handle confesses its type via the {@code type} accessor. + * Every method handle reports its type via the {@link #type type} accessor. * The structure of this type is a series of classes, one of which is * the return type of the method (or {@code void.class} if none). *

    * Every method handle appears as an object containing a method named - * {@code invoke}, whose signature exactly matches + * {@link #invokeExact invokeExact}, whose signature exactly matches * the method handle's type. * A Java method call expression, which compiles to an * {@code invokevirtual} instruction, @@ -59,15 +70,29 @@ import static sun.dyn.MemberName.newIllegalArgumentException; // utility * (The type is specified in the {@code invokevirtual} instruction, * via a {@code CONSTANT_NameAndType} constant pool entry.) * The call looks within the receiver object for a method - * named {@code invoke} of the intended method type. + * named {@code invokeExact} of the intended method type. * The call fails with a {@link WrongMethodTypeException} - * if the method does not exist, even if there is an {@code invoke} + * if the method does not exist, even if there is an {@code invokeExact} * method of a closely similar signature. * As with other kinds * of methods in the JVM, signature matching during method linkage * is exact, and does not allow for language-level implicit conversions * such as {@code String} to {@code Object} or {@code short} to {@code int}. *

    + * Each individual method handle also contains a method named + * {@link #invokeGeneric invokeGeneric}, whose type is the same + * as {@code invokeExact}, and is therefore also reported by + * the {@link #type type} accessor. + * A call to {@code invokeGeneric} works the same as a call to + * {@code invokeExact}, if the signature specified by the caller + * exactly matches the method handle's own type. + * If there is a type mismatch, {@code invokeGeneric} attempts + * to adjust the type of the target method handle + * (as if by a call to {@link #asType asType}) + * to obtain an exactly invokable target. + * This allows a more powerful negotiation of method type + * between caller and callee. + *

    * A method handle is an unrestricted capability to call a method. * A method handle can be formed on a non-public method by a class * that has access to that method; the resulting handle can be used @@ -75,31 +100,47 @@ import static sun.dyn.MemberName.newIllegalArgumentException; // utility * checking is performed when the method handle is created, not * (as in reflection) every time it is called. Handles to non-public * methods, or in non-public classes, should generally be kept secret. - * They should not be passed to untrusted code. + * They should not be passed to untrusted code unless their use from + * the untrusted code would be harmless. *

    - * Bytecode in an extended JVM can directly call a method handle's - * {@code invoke} from an {@code invokevirtual} instruction. + * Bytecode in the JVM can directly call a method handle's + * {@code invokeExact} method from an {@code invokevirtual} instruction. * The receiver class type must be {@code MethodHandle} and the method name - * must be {@code invoke}. The signature of the invocation + * must be {@code invokeExact}. The signature of the invocation * (after resolving symbolic type names) must exactly match the method type * of the target method. + * Similarly, bytecode can directly call a method handle's {@code invokeGeneric} + * method. The signature of the invocation (after resolving symbolic type names) + * must either exactly match the method type or be a valid argument to + * the target's {@link #asType asType} method. *

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

    - * Bytecode in an extended JVM can directly obtain a method handle + * Bytecode in the JVM can directly obtain a method handle * for any accessible method from a {@code ldc} instruction - * which refers to a {@code CONSTANT_Methodref} or - * {@code CONSTANT_InterfaceMethodref} constant pool entry. + * which refers to a {@code CONSTANT_MethodHandle} constant pool entry. + * (Each such entry refers directly to a {@code CONSTANT_Methodref}, + * {@code CONSTANT_InterfaceMethodref}, or {@code CONSTANT_Fieldref} + * constant pool entry. + * For more details, see the package summary.) *

    - * All JVMs can also use a reflective API called {@code MethodHandles} + * Java code can also use a reflective API called + * {@link java.dyn.MethodHandles.Lookup MethodHandles.Lookup} * for creating and calling method handles. + * For example, a static method handle can be obtained + * from {@link java.dyn.MethodHandles.Lookup#findStatic Lookup.findStatic}. + * There are also bridge methods from Core Reflection API objects, + * such as {@link java.dyn.MethodHandles.Lookup#unreflect Lookup.ureflect}. *

    * A method reference may refer either to a static or non-static method. * In the non-static case, the method handle type includes an explicit @@ -126,10 +167,10 @@ MethodHandles.Lookup lookup = MethodHandles.lookup(); mt = MethodType.methodType(String.class, char.class, char.class); mh = lookup.findVirtual(String.class, "replace", mt); // (Ljava/lang/String;CC)Ljava/lang/String; -s = mh.<String>invokeExact("daddy",'d','n'); +s = (String) mh.invokeExact("daddy",'d','n'); assert(s.equals("nanny")); // weakly typed invocation (using MHs.invoke) -s = (String) mh.invokeVarargs("sappy", 'p', 'v'); +s = (String) mh.invokeWithArguments("sappy", 'p', 'v'); assert(s.equals("savvy")); // mt is {Object[] => List} mt = MethodType.methodType(java.util.List.class, Object[].class); @@ -145,14 +186,22 @@ assert(x.equals(java.util.Arrays.asList(1,2,3))); mt = MethodType.methodType(int.class); mh = lookup.findVirtual(java.util.List.class, "size", mt); // (Ljava/util/List;)I -i = mh.<int>invokeExact(java.util.Arrays.asList(1,2,3)); +i = (int) mh.invokeExact(java.util.Arrays.asList(1,2,3)); assert(i == 3); +mt = MethodType.methodType(void.class, String.class); +mh = lookup.findVirtual(java.io.PrintStream.class, "println", mt); +mh.invokeExact(System.out, "Hello, world."); +// (Ljava/io/PrintStream;Ljava/lang/String;)V * * Each of the above calls generates a single invokevirtual instruction * with the name {@code invoke} and the type descriptors indicated in the comments. * The argument types are taken directly from the actual arguments, - * while the return type is taken from the type parameter. - * (This type parameter may be a primitive, and it defaults to {@code Object}.) + * while the return type is taken from the cast immediately applied to the call. + * This cast may be to a primitive. + * If it is missing, the type defaults to {@code Object} if the call + * occurs in a context which uses the return value. + * If the call occurs as a statement, a cast is impossible, + * and there is no return type; the call is {@code void}. *

    * A note on generic typing: Method handles do not represent * their function types in terms of Java parameterized (generic) types, @@ -160,7 +209,7 @@ assert(i == 3); * Java types. *

      *
    1. Method types range over all possible arities, - * from no arguments to an arbitrary number of arguments. + * from no arguments to up to 255 of arguments (a limit imposed by the JVM). * Generics are not variadic, and so cannot represent this.
    2. *
    3. Method types can specify arguments of primitive types, * which Java generic types cannot range over.
    4. @@ -174,9 +223,23 @@ assert(i == 3); * merely a documentation convention. These type parameters do * not play a role in type-checking method handle invocations. *

      - * Note: Like classes and strings, method handles that correspond directly - * to fields and methods can be represented directly as constants to be - * loaded by {@code ldc} bytecodes. + * Like classes and strings, method handles that correspond to accessible + * fields, methods, and constructors can be represented directly + * in a class file's constant pool as constants to be loaded by {@code ldc} bytecodes. + * Loading such a constant causes the component classes of its type to be loaded as necessary. + *

      + * Method handles cannot be subclassed by the user. + * Implementations may (or may not) create internal subclasses of {@code MethodHandle} + * which may be visible via the {@code java.lang.Object#getClass Object.getClass} + * operation. The programmer should not draw conclusions about a method handle + * from its specific class, as the method handle class hierarchy (if any) + * may change from time to time or across implementations from different vendors. + *

      + * With respect to the Java Memory Model, any method handle will behave + * as if all of its fields are final variables. This means that any method + * handle made visible to the application will always be fully formed. + * This is true even if the method handle is published through a shared + * variables in a data race. * * @see MethodType * @see MethodHandles @@ -197,14 +260,14 @@ public abstract class MethodHandle * those methods which are signature polymorphic. */ @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD,java.lang.annotation.ElementType.TYPE}) - @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) + @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @interface PolymorphicSignature { } private MethodType type; /** * Report the type of this method handle. - * Every invocation of this method handle must exactly match this type. + * Every invocation of this method handle via {@code invokeExact} must exactly match this type. * @return the method handle type */ public final MethodType type() { @@ -212,12 +275,16 @@ public abstract class MethodHandle } /** - * The constructor for MethodHandle may only be called by privileged code. - * Subclasses may be in other packages, but must possess - * a token which they obtained from MH with a security check. - * @param token non-null object which proves access permission - * @param type type (permanently assigned) of the new method handle + * CONSTRUCTOR WILL BE REMOVED FOR PFD: + * Temporary constructor in early versions of the Reference Implementation. + * Method handle inheritance (if any) will be contained completely within + * the {@code java.dyn} package. */ + // The constructor for MethodHandle may only be called by privileged code. + // Subclasses may be in other packages, but must possess + // a token which they obtained from MH with a security check. + // @param token non-null object which proves access permission + // @param type type (permanently assigned) of the new method handle protected MethodHandle(Access token, MethodType type) { super(token); Access.check(token); @@ -239,88 +306,116 @@ public abstract class MethodHandle }); } - /** The string of a direct method handle is the simple name of its target method. - * The string of an adapter or bound method handle is the string of its - * target method handle. - * The string of a Java method handle is the string of its entry point method, - * unless the Java method handle overrides the toString method. + /** + * Returns a string representation of the method handle, + * starting with the string {@code "MethodHandle"} and + * ending with the string representation of the method handle's type. + * In other words, this method returns a string equal to the value of: + *

      +     * "MethodHandle" + type().toString()
      +     * 
      + *

      + * Note: Future releases of this API may add further information + * to the string representation. + * Therefore, the present syntax should not be parsed by applications. + * + * @return a string representation of the method handle */ @Override public String toString() { return MethodHandleImpl.getNameString(IMPL_TOKEN, this); } - //// This is the "Method Handle Kernel API" discussed at the JVM Language Summit, 9/2009. - //// Implementations here currently delegate to statics in MethodHandles. Some of those statics - //// will be deprecated. Others will be kept as "algorithms" to supply degrees of freedom - //// not present in the Kernel API. - /** - * PROVISIONAL API, WORK IN PROGRESS: * Invoke the method handle, allowing any caller signature, but requiring an exact signature match. * The signature at the call site of {@code invokeExact} must - * exactly match this method handle's {@code type}. + * exactly match this method handle's {@link #type type}. * No conversions are allowed on arguments or return values. + * @throws WrongMethodTypeException if the target's type is not identical with the caller's type signature + * @throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call */ - public final native @PolymorphicSignature R invokeExact(A... args) throws Throwable; - - // FIXME: remove this transitional form - /** @deprecated transitional form defined in EDR but removed in PFD */ - public final native @PolymorphicSignature R invoke(A... args) throws Throwable; + public final native @PolymorphicSignature Object invokeExact(Object... args) throws Throwable; /** - * PROVISIONAL API, WORK IN PROGRESS: * Invoke the method handle, allowing any caller signature, - * and performing simple conversions for arguments and return types. - * The signature at the call site of {@code invokeGeneric} must - * have the same arity as this method handle's {@code type}. - * The same conversions are allowed on arguments or return values as are supported by - * by {@link MethodHandles#convertArguments}. - * If the call site signature exactly matches this method handle's {@code type}, - * the call proceeds as if by {@link #invokeExact}. + * and optionally performing conversions for arguments and return types. + *

      + * If the call site signature exactly matches this method handle's {@link #type type}, + * the call proceeds as if by {@link #invokeExact invokeExact}. + *

      + * Otherwise, the call proceeds as if this method handle were first + * adjusted by calling {@link #asType asType} to adjust this method handle + * to the required type, and then the call proceeds as if by + * {@link #invokeExact invokeExact} on the adjusted method handle. + *

      + * There is no guarantee that the {@code asType} call is actually made. + * If the JVM can predict the results of making the call, it may perform + * adaptations directly on the caller's arguments, + * and call the target method handle according to its own exact type. + *

      + * If the method handle is equipped with a + * {@linkplain #withTypeHandler type handler}, the handler must produce + * an entry point of the call site's exact type. + * Otherwise, the signature at the call site of {@code invokeGeneric} must + * be a valid argument to the standard {@code asType} method. + * In particular, the caller must specify the same argument arity + * as the callee's type. + * @throws WrongMethodTypeException if the target's type cannot be adjusted to the caller's type signature + * @throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call */ - public final native @PolymorphicSignature R invokeGeneric(A... args) throws Throwable; - - // ?? public final native @PolymorphicSignature R invokeVarargs(A args, V[] varargs) throws Throwable; + public final native @PolymorphicSignature Object invokeGeneric(Object... args) throws Throwable; /** - * PROVISIONAL API, WORK IN PROGRESS: * Perform a varargs invocation, passing the arguments in the given array - * to the method handle, as if via {@link #invokeGeneric} from a call site + * to the method handle, as if via {@link #invokeGeneric invokeGeneric} from a call site * which mentions only the type {@code Object}, and whose arity is the length * of the argument array. *

      - * The length of the arguments array must equal the parameter count - * of the target's type. - * The arguments array is spread into separate arguments. + * Specifically, execution proceeds as if by the following steps, + * although the methods are not guaranteed to be called if the JVM + * can predict their effects. + *

        + *
      • Determine the length of the argument array as {@code N}. + * For a null reference, {@code N=0}.
      • + *
      • Determine the generic type {@code TN} of {@code N} arguments as + * as {@code TN=MethodType.genericMethodType(N)}.
      • + *
      • Force the original target method handle {@code MH0} to the + * required type, as {@code MH1 = MH0.asType(TN)}.
      • + *
      • Spread the array into {@code N} separate arguments {@code A0, ...}.
      • + *
      • Invoke the type-adjusted method handle on the unpacked arguments: + * MH1.invokeExact(A0, ...).
      • + *
      • Take the return value as an {@code Object} reference.
      • + *
      *

      - * In order to match the type of the target, the following argument + * Because of the action of the {@code asType} step, the following argument * conversions are applied as necessary: *

        *
      • reference casting *
      • unboxing + *
      • widening primitive conversions *
      - * The following conversions are not applied: - *
        - *
      • primitive conversions (e.g., {@code byte} to {@code int} - *
      • varargs conversions other than the initial spread - *
      • any application-specific conversions (e.g., string to number) - *
      + *

      * The result returned by the call is boxed if it is a primitive, * or forced to null if the return type is void. *

      * This call is equivalent to the following code: *

      -     *   MethodHandle invoker = MethodHandles.genericInvoker(this.type(), 0, true);
      -     *   Object result = invoker.invokeExact(this, arguments);
      +     * MethodHandle invoker = MethodHandles.varargsInvoker(this.type(), 0);
      +     * Object result = invoker.invokeExact(this, arguments);
            * 
      * @param arguments the arguments to pass to the target * @return the result returned by the target - * @see MethodHandles#genericInvoker + * @throws WrongMethodTypeException if the target's type cannot be adjusted to take the arguments + * @throws Throwable anything thrown by the target method invocation + * @see MethodHandles#varargsInvoker */ - public final Object invokeVarargs(Object... arguments) throws Throwable { + public final Object invokeWithArguments(Object... arguments) throws Throwable { int argc = arguments == null ? 0 : arguments.length; MethodType type = type(); + if (type.parameterCount() != argc) { + // simulate invokeGeneric + return asType(MethodType.genericMethodType(argc)).invokeWithArguments(arguments); + } if (argc <= 10) { MethodHandle invoker = MethodHandles.invokers(type).genericInvoker(); switch (argc) { @@ -364,99 +459,70 @@ public abstract class MethodHandle MethodHandle invoker = MethodHandles.invokers(type).varargsInvoker(0); return invoker.invokeExact(this, arguments); } - /** Equivalent to {@code invokeVarargs(arguments.toArray())}. */ + /** Equivalent to {@code invokeWithArguments(arguments.toArray())}. */ + public final Object invokeWithArguments(java.util.List arguments) throws Throwable { + return invokeWithArguments(arguments.toArray()); + } + @Deprecated + public final Object invokeVarargs(Object... arguments) throws Throwable { + return invokeWithArguments(arguments); + } + @Deprecated public final Object invokeVarargs(java.util.List arguments) throws Throwable { - return invokeVarargs(arguments.toArray()); + return invokeWithArguments(arguments.toArray()); } - /* --- this is intentionally NOT a javadoc yet --- - * PROVISIONAL API, WORK IN PROGRESS: - * Produce an adapter method handle which adapts the type of the - * current method handle to a new type by pairwise argument conversion. - * The original type and new type must have the same number of arguments. - * The resulting method handle is guaranteed to confess a type - * which is equal to the desired new type. - *

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

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

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

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

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

      - * This method is equivalent to {@link MethodHandles#convertArguments}. + * This method provides the crucial behavioral difference between + * {@link #invokeExact invokeExact} and {@link #invokeGeneric invokeGeneric}. The two methods + * perform the same steps when the caller's type descriptor is identical + * with the callee's, but when the types differ, {@link #invokeGeneric invokeGeneric} + * also calls {@code asType} (or some internal equivalent) in order + * to match up the caller's and callee's types. + *

      + * This method is equivalent to {@link MethodHandles#convertArguments convertArguments}, + * except for method handles produced by {@link #withTypeHandler withTypeHandler}, + * in which case the specified type handler is used for calls to {@code asType}. + *

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

      + * If the array element type differs from any of the corresponding + * argument types on original target, + * the original target is adapted to take the array elements directly, + * as if by a call to {@link #asType asType}. *

      * When called, the adapter replaces a trailing array argument * by the array's elements, each as its own argument to the target. * (The order of the arguments is preserved.) * They are converted pairwise by casting and/or unboxing - * (as if by {@link MethodHandles#convertArguments}) * to the types of the trailing parameters of the target. * Finally the target is called. * What the target eventually returns is returned unchanged by the adapter. @@ -465,54 +531,67 @@ public abstract class MethodHandle * contains exactly enough elements to provide a correct argument count * to the target method handle. * (The array may also be null when zero elements are required.) - * @param keepPosArgs the number of leading positional arguments to preserve - * @return a new method handle which spreads its final argument, + * @param arrayType usually {@code Object[]}, the type of the array argument from which to extract the spread arguments + * @param arrayLength the number of arguments to spread from an incoming array argument + * @return a new method handle which spreads its final array argument, * before calling the original method handle + * @throws IllegalArgumentException if {@code arrayType} is not an array type * @throws IllegalArgumentException if target does not have at least - * {@code keepPosArgs} parameter types + * {@code arrayLength} parameter types + * @throws WrongMethodTypeException if the implied {@code asType} call fails */ - public final MethodHandle asSpreader(int keepPosArgs) { + public final MethodHandle asSpreader(Class arrayType, int arrayLength) { + Class arrayElement = arrayType.getComponentType(); + if (arrayElement == null) throw newIllegalArgumentException("not an array type"); MethodType oldType = type(); int nargs = oldType.parameterCount(); + if (nargs < arrayLength) throw newIllegalArgumentException("bad spread array length"); + int keepPosArgs = nargs - arrayLength; MethodType newType = oldType.dropParameterTypes(keepPosArgs, nargs); - newType = newType.insertParameterTypes(keepPosArgs, Object[].class); + newType = newType.insertParameterTypes(keepPosArgs, arrayType); return MethodHandles.spreadArguments(this, newType); } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle which adapts, as its target, * the current method handle. The type of the adapter will be * the same as the type of the target, except that a single trailing - * array parameter of type {@code Object[]} is replaced by - * {@code spreadArrayArgs} parameters of type {@code Object}. + * parameter (usually of type {@code arrayType}) is replaced by + * {@code arrayLength} parameters whose type is element type of {@code arrayType}. *

      - * When called, the adapter replaces its trailing {@code spreadArrayArgs} - * arguments by a single new {@code Object} array, whose elements + * If the array type differs from the final argument type on original target, + * the original target is adapted to take the array type directly, + * as if by a call to {@link #asType asType}. + *

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

      - * (The array may also be a shared constant when {@code spreadArrayArgs} is zero.) - * @param spreadArrayArgs the number of arguments to spread from the trailing array + * (The array may also be a shared constant when {@code arrayLength} is zero.) + * @param arrayType usually {@code Object[]}, the type of the array argument which will collect the arguments + * @param arrayLength the number of arguments to collect into a new array argument * @return a new method handle which collects some trailing argument * into an array, before calling the original method handle - * @throws IllegalArgumentException if the last argument of the target - * is not {@code Object[]} - * @throws IllegalArgumentException if {@code spreadArrayArgs} is not + * @throws IllegalArgumentException if {@code arrayType} is not an array type + or {@code arrayType} is not assignable to this method handle's trailing parameter type + * @throws IllegalArgumentException if {@code arrayLength} is not * a legal array size - * @deprecated Provisional and unstable; use {@link MethodHandles#collectArguments}. + * @throws WrongMethodTypeException if the implied {@code asType} call fails */ - public final MethodHandle asCollector(int spreadArrayArgs) { + public final MethodHandle asCollector(Class arrayType, int arrayLength) { + Class arrayElement = arrayType.getComponentType(); + if (arrayElement == null) throw newIllegalArgumentException("not an array type"); MethodType oldType = type(); int nargs = oldType.parameterCount(); MethodType newType = oldType.dropParameterTypes(nargs-1, nargs); - newType = newType.insertParameterTypes(nargs-1, MethodType.genericMethodType(spreadArrayArgs).parameterArray()); + newType = newType.insertParameterTypes(nargs-1, + java.util.Collections.>nCopies(arrayLength, arrayElement)); return MethodHandles.collectArguments(this, newType); } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle which binds the given argument * to the current method handle as target. * The type of the bound handle will be @@ -533,9 +612,81 @@ public abstract class MethodHandle * leading parameter type that is a reference type * @throws ClassCastException if {@code x} cannot be converted * to the leading parameter type of the target - * @deprecated Provisional and unstable; use {@link MethodHandles#insertArguments}. + * @see MethodHandles#insertArguments */ public final MethodHandle bindTo(Object x) { return MethodHandles.insertArguments(this, 0, x); } + + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Create a new method handle with the same type as this one, + * but whose {@code asType} method invokes the given + * {@code typeHandler} on this method handle, + * instead of the standard {@code MethodHandles.convertArguments}. + *

      + * The new method handle will have the same behavior as the + * old one when invoked by {@code invokeExact}. + * For {@code invokeGeneric} calls which exactly match + * the method type, the two method handles will also + * have the same behavior. + * For other {@code invokeGeneric} calls, the {@code typeHandler} + * will control the behavior of the new method handle. + *

      + * Thus, a method handle with an {@code asType} handler can + * be configured to accept more than one arity of {@code invokeGeneric} + * call, and potentially every possible arity. + * It can also be configured to supply default values for + * optional arguments, when the caller does not specify them. + *

      + * The given method handle must take two arguments and return + * one result. The result it returns must be a method handle + * of exactly the requested type. If the result returned by + * the target is null, a {@link NullPointerException} is thrown, + * else if the type of the target does not exactly match + * the requested type, a {@link WrongMethodTypeException} is thrown. + *

      + * A method handle's type handler is not guaranteed to be called every + * time its {@code asType} or {@code invokeGeneric} method is called. + * If the implementation is faced is able to prove that an equivalent + * type handler call has already occurred (on the same two arguments), + * it may substitute the result of that previous invocation, without + * making a new invocation. Thus, type handlers should not (in general) + * perform significant side effects. + *

      + * Therefore, the type handler is invoked as if by this code: + *

      +     * MethodHandle target = this;      // original method handle
      +     * MethodHandle adapter = ...;      // adapted method handle
      +     * MethodType requestedType = ...;  // argument to asType()
      +     * if (type().equals(requestedType))
      +     *    return adapter;
      +     * MethodHandle result = (MethodHandle)
      +     *    typeHandler.invokeGeneric(target, requestedType);
      +     * if (!result.type().equals(requestedType))
      +     *    throw new WrongMethodTypeException();
      +     * return result;
      +     * 
      + *

      + * For example, here is a list-making variable-arity method handle: + *

      +MethodHandle makeEmptyList = MethodHandles.constant(List.class, Arrays.asList());
      +MethodHandle asList = lookup()
      +  .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class));
      +static MethodHandle collectingTypeHandler(MethodHandle base, MethodType newType) {
      +  return asList.asCollector(Object[].class, newType.parameterCount()).asType(newType);
      +}
      +MethodHandle collectingTypeHandler = lookup()
      +  .findStatic(lookup().lookupClass(), "collectingTypeHandler",
      +     methodType(MethodHandle.class, MethodHandle.class, MethodType.class));
      +MethodHandle makeAnyList = makeEmptyList.withTypeHandler(collectingTypeHandler);
      +
      +assertEquals("[]", makeAnyList.invokeGeneric().toString());
      +assertEquals("[1]", makeAnyList.invokeGeneric(1).toString());
      +assertEquals("[two, too]", makeAnyList.invokeGeneric("two", "too").toString());
      +     * 
      + */ + public MethodHandle withTypeHandler(MethodHandle typeHandler) { + return MethodHandles.withTypeHandler(this, typeHandler); + } } diff --git a/jdk/src/share/classes/java/dyn/MethodHandles.java b/jdk/src/share/classes/java/dyn/MethodHandles.java index ac35f88e143..d2de0c24a48 100644 --- a/jdk/src/share/classes/java/dyn/MethodHandles.java +++ b/jdk/src/share/classes/java/dyn/MethodHandles.java @@ -25,15 +25,13 @@ package java.dyn; -import java.lang.reflect.Constructor; +import java.lang.reflect.*; import sun.dyn.Access; import sun.dyn.MemberName; import sun.dyn.MethodHandleImpl; +import sun.dyn.util.ValueConversions; import sun.dyn.util.VerifyAccess; import sun.dyn.util.Wrapper; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; import java.util.List; import java.util.ArrayList; import java.util.Arrays; @@ -81,6 +79,14 @@ public class MethodHandles { * Return a {@link Lookup lookup object} which is trusted minimally. * It can only be used to create method handles to * publicly accessible fields and methods. + *

      + * As a matter of pure convention, the {@linkplain Lookup#lookupClass lookup class} + * of this lookup object will be {@link java.lang.Object}. + *

      + * The lookup class can be changed to any other class {@code C} using an expression of the form + * {@linkplain Lookup#in publicLookup().in(C.class)}. + * Since all classes have equal access to public names, + * such a change would confer no new access rights. */ public static Lookup publicLookup() { return Lookup.PUBLIC_LOOKUP; @@ -90,9 +96,10 @@ public class MethodHandles { * A lookup object is a factory for creating method handles, * when the creation requires access checking. * Method handles do not perform - * access checks when they are called; this is a major difference + * access checks when they are called, but rather when they are created. + * (This is a major difference * from reflective {@link Method}, which performs access checking - * against every caller, on every call. + * against every caller, on every call.) * Therefore, method handle access * restrictions must be enforced when a method handle is created. * The caller class against which those restrictions are enforced @@ -107,7 +114,7 @@ public class MethodHandles { * It may then use this factory to create method handles on * all of its methods, including private ones. * It may also delegate the lookup (e.g., to a metaobject protocol) - * by passing the {@code Lookup} object to other code. + * by passing the lookup object to other code. * If this other code creates method handles, they will be access * checked against the original lookup class, and not with any higher * privileges. @@ -125,27 +132,62 @@ public class MethodHandles { * It can also fail if a security manager is installed and refuses * access. In any of these cases, an exception will be * thrown from the attempted lookup. + *

      * In general, the conditions under which a method handle may be * created for a method {@code M} are exactly as restrictive as the conditions * under which the lookup class could have compiled a call to {@code M}. - * At least some of these error conditions are likely to be - * represented by checked exceptions in the final version of this API. + *

      + * In some cases, this access is obtained by the Java compiler by creating + * an wrapper method to access a private method of another class + * in the same top-level declaration. + * For example, a nested class {@code C.D} + * can access private members within other related classes such as + * {@code C}, {@code C.D.E}, or {@code C.B}, + * but the Java compiler may need to generate wrapper methods in + * those related classes. In such cases, a {@code Lookup} object on + * {@code C.E} would be unable to those private members. + * A workaround for this limitation is the {@link Lookup#in Lookup.in} method, + * which can transform a lookup on {@code C.E} into one on any of those other + * classes, without special elevation of privilege. */ public static final class Lookup { /** The class on behalf of whom the lookup is being performed. */ private final Class lookupClass; - /** The allowed sorts of members which may be looked up (public, etc.), with STRICT for package. */ + /** The allowed sorts of members which may be looked up (PUBLIC, etc.). */ private final int allowedModes; - private static final int - PUBLIC = Modifier.PUBLIC, - PACKAGE = Modifier.STRICT, - PROTECTED = Modifier.PROTECTED, - PRIVATE = Modifier.PRIVATE, - ALL_MODES = (PUBLIC | PACKAGE | PROTECTED | PRIVATE), - TRUSTED = -1; + /** A single-bit mask representing {@code public} access, + * which may contribute to the result of {@link #lookupModes lookupModes}. + * The value, {@code 0x01}, happens to be the same as the value of the + * {@code public} {@linkplain java.lang.reflect.Modifier#PUBLIC modifier bit}. + */ + public static final int PUBLIC = Modifier.PUBLIC; + + /** A single-bit mask representing {@code private} access, + * which may contribute to the result of {@link #lookupModes lookupModes}. + * The value, {@code 0x02}, happens to be the same as the value of the + * {@code private} {@linkplain java.lang.reflect.Modifier#PRIVATE modifier bit}. + */ + public static final int PRIVATE = Modifier.PRIVATE; + + /** A single-bit mask representing {@code protected} access, + * which may contribute to the result of {@link #lookupModes lookupModes}. + * The value, {@code 0x04}, happens to be the same as the value of the + * {@code protected} {@linkplain java.lang.reflect.Modifier#PROTECTED modifier bit}. + */ + public static final int PROTECTED = Modifier.PROTECTED; + + /** A single-bit mask representing {@code package} access (default access), + * which may contribute to the result of {@link #lookupModes lookupModes}. + * The value is {@code 0x08}, which does not correspond meaningfully to + * any particular {@linkplain java.lang.reflect.Modifier modifier bit}. + */ + public static final int PACKAGE = Modifier.STATIC; + + private static final int ALL_MODES = (PUBLIC | PRIVATE | PROTECTED | PACKAGE); + private static final int TRUSTED = -1; private static int fixmods(int mods) { mods &= (ALL_MODES - PACKAGE); @@ -155,8 +197,10 @@ public class MethodHandles { /** Which class is performing the lookup? It is this class against * which checks are performed for visibility and access permissions. *

      - * This value is null if and only if this lookup was produced - * by {@link MethodHandles#publicLookup}. + * The class implies a maximum level of access permission, + * but the permissions may be additionally limited by the bitmask + * {@link #lookupModes}, which controls whether non-public members + * can be accessed. */ public Class lookupClass() { return lookupClass; @@ -168,10 +212,23 @@ public class MethodHandles { } /** Which types of members can this lookup object produce? - * The result is a bit-mask of the modifier bits PUBLIC, PROTECTED, PRIVATE, and STRICT. - * The modifier bit STRICT stands in for the (non-existent) package protection mode. + * The result is a bit-mask of the bits + * {@linkplain #PUBLIC PUBLIC (0x01)}, + * {@linkplain #PRIVATE PRIVATE (0x02)}, + * {@linkplain #PROTECTED PROTECTED (0x04)}, + * and {@linkplain #PACKAGE PACKAGE (0x08)}. + *

      + * A freshly-created lookup object + * on the {@linkplain java.dyn.MethodHandles#lookup() caller's class} + * has all possible bits set, since the caller class can access all its own members. + * A lookup object on a new lookup class + * {@linkplain java.dyn.MethodHandles.Lookup#in created from a previous lookup object} + * may have some mode bits set to zero. + * The purpose of this is to restrict access via the new lookup object, + * so that it can access only names which can be reached by the original + * lookup object, and also by the new lookup class. */ - int lookupModes() { + public int lookupModes() { return allowedModes & ALL_MODES; } @@ -202,18 +259,21 @@ public class MethodHandles { /** * Create a lookup on the specified new lookup class. * The resulting object will report the specified - * class as its own {@link #lookupClass}. + * class as its own {@link #lookupClass lookupClass}. *

      * However, the resulting {@code Lookup} object is guaranteed * to have no more access capabilities than the original. - * In particular:

        + * In particular, access capabilities can be lost as follows:
          *
        • If the new lookup class differs from the old one, * protected members will not be accessible by virtue of inheritance. + * (Protected members may continue to be accessible because of package sharing.) *
        • If the new lookup class is in a different package * than the old one, protected and default (package) members will not be accessible. *
        • If the new lookup class is not within the same package member * as the old one, private members will not be accessible. - *
        • In all cases, public members will continue to be accessible. + *
        • If the new lookup class is not accessible to the old lookup class, + * then no members, not even public members, will be accessible. + * (In all other cases, public members will continue to be accessible.) *
        */ public Lookup in(Class requestedLookupClass) { @@ -227,10 +287,17 @@ public class MethodHandles { && !VerifyAccess.isSamePackage(this.lookupClass, requestedLookupClass)) { newModes &= ~(PACKAGE|PRIVATE); } + // Allow nestmate lookups to be created without special privilege: if ((newModes & PRIVATE) != 0 && !VerifyAccess.isSamePackageMember(this.lookupClass, requestedLookupClass)) { newModes &= ~PRIVATE; } + if (newModes == PUBLIC + && !VerifyAccess.isClassAccessible(requestedLookupClass, this.lookupClass)) { + // The requested class it not accessible from the lookup class. + // No permissions. + newModes = 0; + } checkUnprivilegedlookupClass(requestedLookupClass); return new Lookup(requestedLookupClass, newModes); } @@ -254,35 +321,43 @@ public class MethodHandles { throw newIllegalArgumentException("illegal lookupClass: "+lookupClass); } - /** Display the name of the class. - * If there are restrictions on the access permitted to this lookup, - * display those also. + /** + * Display the name of the class from which lookups are to be made. + * (The name is the one reported by {@link java.lang.Class#getName() Class.getName}.) + * If there are restrictions on the access permitted to this lookup, + * this is indicated by adding a suffix to the class name, consisting + * of a slash and a keyword. The keyword is chosen as follows: + *
          + *
        • If no access is allowed, the suffix is "/noaccess". + *
        • If only public access is allowed, the suffix is "/public". + *
        • If only public and package access are allowed, the suffix is "/package". + *
        • If only public, package, and private access are allowed, the suffix is "/private". + *
        + * If none of the above cases apply, it is the case that full + * access (public, package, private, and protected) is allowed. + * In this case, no suffix is added. + * This is true only of an object obtained originally from + * {@link java.dyn.MethodHandles#lookup() MethodHandles.lookup}. + * Objects created by {@link java.dyn.MethodHandles.Lookup#in() Lookup#in} + * always have restricted access, and will display a suffix. */ @Override public String toString() { - String modestr; String cname = lookupClass.getName(); switch (allowedModes) { case TRUSTED: - return "/trusted"; + return "/trusted"; // internal only case PUBLIC: - modestr = "/public"; - if (lookupClass == Object.class) - return modestr; - break; + return cname + "/public"; case PUBLIC|PACKAGE: return cname + "/package"; - case 0: // should not happen - return cname + "/empty"; + case 0: // no privileges + return cname + "/noaccess"; case ALL_MODES: return cname; + default: + return cname + "/private"; } - StringBuilder buf = new StringBuilder(cname); - if ((allowedModes & PUBLIC) != 0) buf.append("/public"); - if ((allowedModes & PACKAGE) != 0) buf.append("/package"); - if ((allowedModes & PROTECTED) != 0) buf.append("/protected"); - if ((allowedModes & PRIVATE) != 0) buf.append("/private"); - return buf.toString(); } // call this from an entry point method in Lookup with extraFrames=0. @@ -308,7 +383,6 @@ public class MethodHandles { * @param name the name of the method * @param type the type of the method * @return the desired method handle - * @exception SecurityException TBD * @exception NoAccessException if the method does not exist or access checking fails */ public @@ -324,13 +398,6 @@ public class MethodHandles { * with the receiver type (usually {@code refc}) prepended. * The method and all its argument types must be accessible to the lookup class. *

        - * (BUG NOTE: The type {@code Object} may be prepended instead - * of the receiver type, if the receiver type is not on the boot class path. - * This is due to a temporary JVM limitation, in which MethodHandle - * claims to be unable to access such classes. To work around this - * bug, use {@code convertArguments} to normalize the type of the leading - * argument to a type on the boot class path, such as {@code Object}.) - *

        * When called, the handle will treat the first argument as a receiver * and dispatch on the receiver's type to determine which method * implementation to enter. @@ -340,7 +407,6 @@ public class MethodHandles { * @param name the name of the method * @param type the type of the method, with the receiver argument omitted * @return the desired method handle - * @exception SecurityException TBD * @exception NoAccessException if the method does not exist or access checking fails */ public MethodHandle findVirtual(Class refc, String name, MethodType type) throws NoAccessException { @@ -364,7 +430,6 @@ public class MethodHandles { * @param refc the class or interface from which the method is accessed * @param type the type of the method, with the receiver argument omitted, and a void return type * @return the desired method handle - * @exception SecurityException TBD * @exception NoAccessException if the method does not exist or access checking fails */ public MethodHandle findConstructor(Class refc, MethodType type) throws NoAccessException { @@ -391,13 +456,13 @@ public class MethodHandles { * {@code invokespecial} instruction.) *

        * If the explicitly specified caller class is not identical with the - * lookup class, a security check TBD is performed. + * lookup class, or if this lookup object does not have private access + * privileges, the access fails. * @param refc the class or interface from which the method is accessed * @param name the name of the method (which must not be "<init>") * @param type the type of the method, with the receiver argument omitted * @param specialCaller the proposed calling class to perform the {@code invokespecial} * @return the desired method handle - * @exception SecurityException TBD * @exception NoAccessException if the method does not exist or access checking fails */ public MethodHandle findSpecial(Class refc, String name, MethodType type, @@ -410,7 +475,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle giving read access to a non-static field. * The type of the method handle will have a return type of the field's * value type. @@ -427,7 +491,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle giving write access to a non-static field. * The type of the method handle will have a void return type. * The method handle will take two arguments, the instance containing @@ -444,7 +507,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle giving read access to a static field. * The type of the method handle will have a return type of the field's * value type. @@ -460,7 +522,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle giving write access to a static field. * The type of the method handle will have a void return type. * The method handle will take a single @@ -497,7 +558,6 @@ public class MethodHandles { * @param name the name of the method * @param type the type of the method, with the receiver argument omitted * @return the desired method handle - * @exception SecurityException TBD * @exception NoAccessException if the method does not exist or access checking fails */ public MethodHandle bind(Object receiver, String name, MethodType type) throws NoAccessException { @@ -512,7 +572,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Make a direct method handle to m, if the lookup class has permission. * If m is non-static, the receiver argument is treated as an initial argument. * If m is virtual, overriding is respected on every call. @@ -536,7 +595,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle for a reflected method. * It will bypass checks for overriding methods on the receiver, * as if by a {@code invokespecial} instruction from within the {@code specialCaller}. @@ -561,7 +619,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle for a reflected constructor. * The type of the method handle will be that of the constructor, * with the return type changed to the declaring class. @@ -584,7 +641,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle giving read access to a reflected field. * The type of the method handle will have a return type of the field's * value type. @@ -602,7 +658,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle giving write access to a reflected field. * The type of the method handle will have a void return type. * If the field is static, the method handle will take a single @@ -621,32 +676,32 @@ public class MethodHandles { /// Helper methods, all package-private. - MemberName resolveOrFail(Class refc, String name, Class type, boolean isStatic) { + MemberName resolveOrFail(Class refc, String name, Class type, boolean isStatic) throws NoAccessException { checkSymbolicClass(refc); // do this before attempting to resolve int mods = (isStatic ? Modifier.STATIC : 0); return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), true, lookupClassOrNull()); } - MemberName resolveOrFail(Class refc, String name, MethodType type, boolean isStatic) { + MemberName resolveOrFail(Class refc, String name, MethodType type, boolean isStatic) throws NoAccessException { checkSymbolicClass(refc); // do this before attempting to resolve int mods = (isStatic ? Modifier.STATIC : 0); return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), true, lookupClassOrNull()); } MemberName resolveOrFail(Class refc, String name, MethodType type, boolean isStatic, - boolean searchSupers, Class specialCaller) { + boolean searchSupers, Class specialCaller) throws NoAccessException { checkSymbolicClass(refc); // do this before attempting to resolve int mods = (isStatic ? Modifier.STATIC : 0); return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), searchSupers, specialCaller); } - void checkSymbolicClass(Class refc) { + void checkSymbolicClass(Class refc) throws NoAccessException { Class caller = lookupClassOrNull(); if (caller != null && !VerifyAccess.isClassAccessible(refc, caller)) throw newNoAccessException("symbolic reference class is not public", new MemberName(refc), caller); } - void checkMethod(Class refc, MemberName m, boolean wantStatic) { + void checkMethod(Class refc, MemberName m, boolean wantStatic) throws NoAccessException { String message; if (m.isConstructor()) message = "expected a method, not a constructor"; @@ -659,11 +714,11 @@ public class MethodHandles { throw newNoAccessException(message, m, lookupClass()); } - void checkAccess(Class refc, MemberName m) { + void checkAccess(Class refc, MemberName m) throws NoAccessException { int allowedModes = this.allowedModes; if (allowedModes == TRUSTED) return; int mods = m.getModifiers(); - if (Modifier.isPublic(mods) && Modifier.isPublic(refc.getModifiers())) + if (Modifier.isPublic(mods) && Modifier.isPublic(refc.getModifiers()) && allowedModes != 0) return; // common case int requestedModes = fixmods(mods); // adjust 0 => PACKAGE if ((requestedModes & allowedModes) != 0 @@ -688,6 +743,8 @@ public class MethodHandles { return "access to public member failed"; // (how?) else if (allowedModes == PUBLIC) return "member is not public"; + else if (allowedModes == 0) + return "attempted member access through a non-public class"; if (Modifier.isPrivate(mods)) return "member is private"; if (Modifier.isProtected(mods)) @@ -695,24 +752,31 @@ public class MethodHandles { return "member is private to package"; } - void checkSpecialCaller(Class specialCaller) { + private static final boolean ALLOW_NESTMATE_ACCESS = false; + + void checkSpecialCaller(Class specialCaller) throws NoAccessException { if (allowedModes == TRUSTED) return; - if (!VerifyAccess.isSamePackageMember(specialCaller, lookupClass())) + if ((allowedModes & PRIVATE) == 0 + || (specialCaller != lookupClass() + && !(ALLOW_NESTMATE_ACCESS && + VerifyAccess.isSamePackageMember(specialCaller, lookupClass())))) throw newNoAccessException("no private access for invokespecial", new MemberName(specialCaller), lookupClass()); } - MethodHandle restrictProtectedReceiver(MemberName method, MethodHandle mh) { + MethodHandle restrictProtectedReceiver(MemberName method, MethodHandle mh) throws NoAccessException { // The accessing class only has the right to use a protected member // on itself or a subclass. Enforce that restriction, from JVMS 5.4.4, etc. if (!method.isProtected() || method.isStatic() || allowedModes == TRUSTED - || VerifyAccess.isSamePackageMember(method.getDeclaringClass(), lookupClass())) + || method.getDeclaringClass() == lookupClass() + || (ALLOW_NESTMATE_ACCESS && + VerifyAccess.isSamePackageMember(method.getDeclaringClass(), lookupClass()))) return mh; else return restrictReceiver(method, mh, lookupClass()); } - MethodHandle restrictReceiver(MemberName method, MethodHandle mh, Class caller) { + MethodHandle restrictReceiver(MemberName method, MethodHandle mh, Class caller) throws NoAccessException { assert(!method.isStatic()); Class defc = method.getDeclaringClass(); // receiver type of mh is too wide if (defc.isInterface() || !defc.isAssignableFrom(caller)) { @@ -747,7 +811,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle giving read access to elements of an array. * The type of the method handle will have a return type of the array's * element type. Its first argument will be the array type, @@ -762,7 +825,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle giving write access to elements of an array. * The type of the method handle will have a void return type. * Its last argument will be the array's element type. @@ -778,25 +840,6 @@ public class MethodHandles { /// method handle invocation (reflective style) /** - * @deprecated Alias for MethodHandle.invokeVarargs. - */ - @Deprecated - public static - Object invokeVarargs(MethodHandle target, Object... arguments) throws Throwable { - return target.invokeVarargs(arguments); - } - - /** - * @deprecated Alias for MethodHandle.invokeVarargs. - */ - @Deprecated - public static - Object invoke(MethodHandle target, Object... arguments) throws Throwable { - return target.invokeVarargs(arguments); - } - - /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle which will invoke any method handle of the * given type on a standard set of {@code Object} type arguments. * The resulting invoker will be a method handle with the following @@ -805,18 +848,28 @@ public class MethodHandles { *

      • a single {@code MethodHandle} target *
      • zero or more {@code Object} values (one for each argument in {@code type}) *
      - * The invoker will apply reference casts as necessary and unbox primitive arguments, - * as if by {@link #convertArguments}. + *

      + * The invoker will behave like a call to {@link MethodHandle.invokeGeneric} with + * the indicated {@code type}. + * That is, if the target is exactly of the given {@code type}, it will behave + * like {@code invokeExact}; otherwise it behave as if {@link MethodHandle.asType} + * is used to convert the target to the required {@code type}. + *

      + * The type of the returned invoker will not be the given {@code type}, but rather + * will have all parameter and return types replaced by {@code Object}. + *

      + * Before invoking its target, the invoker will apply reference casts as + * necessary and unbox and widen primitive arguments, as if by {@link #convertArguments}. * The return value of the invoker will be an {@code Object} reference, * boxing a primitive value if the original type returns a primitive, * and always null if the original type returns void. *

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

      -     * MethodHandle invoker = exactInvoker(type);
      +     * MethodHandle invoker = lookup().findVirtual(MethodHandle.class, "invokeGeneric", type);
            * MethodType genericType = type.generic();
            * genericType = genericType.insertParameterType(0, MethodHandle.class);
      -     * return convertArguments(invoker, genericType);
      +     * return invoker.asType(genericType);
            * 
      * @param type the type of target methods which the invoker will apply to * @return a method handle suitable for invoking any method handle of the given type @@ -827,9 +880,8 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle which will invoke any method handle of the - * given type on a standard set of {@code Object} type arguments + * given {@code type} on a standard set of {@code Object} type arguments * and a single trailing {@code Object[]} array. * The resulting invoker will be a method handle with the following * arguments: @@ -838,18 +890,31 @@ public class MethodHandles { *
    5. zero or more {@code Object} values (counted by {@code objectArgCount}) *
    6. an {@code Object[]} array containing more arguments * - * The invoker will spread the varargs array, apply - * reference casts as necessary, and unbox primitive arguments. + *

      + * The invoker will behave like a call to {@link MethodHandle.invokeGeneric} with + * the indicated {@code type}. + * That is, if the target is exactly of the given {@code type}, it will behave + * like {@code invokeExact}; otherwise it behave as if {@link MethodHandle.asType} + * is used to convert the target to the required {@code type}. + *

      + * The type of the returned invoker will not be the given {@code type}, but rather + * will have all parameter and return types replaced by {@code Object}, except for + * the last parameter type, which will be the array type {@code Object[]}. + *

      + * Before invoking its target, the invoker will spread the varargs array, apply + * reference casts as necessary, and unbox and widen primitive arguments. * The return value of the invoker will be an {@code Object} reference, * boxing a primitive value if the original type returns a primitive, * and always null if the original type returns void. *

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

      -     * MethodHandle invoker = exactInvoker(type);
      -     * MethodType vaType = MethodType.makeGeneric(objectArgCount, true);
      +     * MethodHandle invoker = lookup().findVirtual(MethodHandle.class, "invokeGeneric", type);
      +     * MethodType vaType = MethodType.genericMethodType(objectArgCount, true);
            * vaType = vaType.insertParameterType(0, MethodHandle.class);
      -     * return spreadArguments(invoker, vaType);
      +     * int spreadArgCount = type.parameterCount - objectArgCount;
      +     * invoker = invoker.asSpreader(Object.class, spreadArgCount);
      +     * return invoker.asType(vaType);
            * 
      * @param type the desired target type * @param objectArgCount number of fixed (non-varargs) {@code Object} arguments @@ -863,7 +928,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle which will take a invoke any method handle of the * given type. The resulting invoker will have a type which is * exactly equal to the desired type, except that it will accept @@ -871,7 +935,7 @@ public class MethodHandles { *

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

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

      This method is equivalent to the following code: - *

      -     * MethodHandle getTarget, invoker, result;
      -     * getTarget = lookup().bind(site, "getTarget", methodType(MethodHandle.class));
      -     * invoker = exactInvoker(site.type());
      -     * result = foldArguments(invoker, getTarget)
      -     * 
      - * @return a method handle which always invokes the call site's target - */ - public static - MethodHandle dynamicInvoker(CallSite site) { - MethodHandle getCSTarget = GET_TARGET; - if (getCSTarget == null) - GET_TARGET = getCSTarget = Lookup.IMPL_LOOKUP. - findVirtual(CallSite.class, "getTarget", MethodType.methodType(MethodHandle.class)); - MethodHandle getTarget = MethodHandleImpl.bindReceiver(IMPL_TOKEN, getCSTarget, site); - MethodHandle invoker = exactInvoker(site.type()); - return foldArguments(invoker, getTarget); - } - private static MethodHandle GET_TARGET = null; // link this lazily, not eagerly - static Invokers invokers(MethodType type) { return MethodTypeImpl.invokers(IMPL_TOKEN, type); } @@ -951,23 +987,23 @@ public class MethodHandles { if (t0.isPrimitive()) return Wrapper.asPrimitiveType(t1).cast(value); else - return Wrapper.OBJECT.cast(value, t1); + return Wrapper.OBJECT.convert(value, t1); } boolean prim0 = t0.isPrimitive(), prim1 = t1.isPrimitive(); if (!prim0) { // check contract with caller - Wrapper.OBJECT.cast(value, t0); + Wrapper.OBJECT.convert(value, t0); if (!prim1) { - return Wrapper.OBJECT.cast(value, t1); + return Wrapper.OBJECT.convert(value, t1); } // convert reference to primitive by unboxing Wrapper w1 = Wrapper.forPrimitiveType(t1); - return w1.cast(value, t1); + return w1.convert(value, t1); } // check contract with caller: Wrapper.asWrapperType(t0).cast(value); Wrapper w1 = Wrapper.forPrimitiveType(t1); - return w1.cast(value, t1); + return w1.convert(value, t1); } static @@ -988,7 +1024,7 @@ public class MethodHandles { * Produce a method handle which adapts the type of the * given method handle to a new type by pairwise argument conversion. * The original type and new type must have the same number of arguments. - * The resulting method handle is guaranteed to confess a type + * The resulting method handle is guaranteed to report a type * which is equal to the desired new type. *

      * If the original type and new type are equal, returns target. @@ -1000,34 +1036,21 @@ public class MethodHandles { * Given those types T0, T1, one of the following conversions is applied * if possible: *

        - *
      • If T0 and T1 are references, and T1 is not an interface type, - * then a cast to T1 is applied. + *
      • If T0 and T1 are references, then a cast to T1 is applied. * (The types do not need to be related in any particular way.) - *
      • If T0 and T1 are references, and T1 is an interface type, - * then the value of type T0 is passed as a T1 without a cast. - * (This treatment of interfaces follows the usage of the bytecode verifier.) - *
      • If T0 and T1 are primitives, then a Java casting - * conversion (JLS 5.5) is applied, if one exists. - *
      • If T0 and T1 are primitives and one is boolean, - * the boolean is treated as a one-bit unsigned integer. - * (This treatment follows the usage of the bytecode verifier.) - * A conversion from another primitive type behaves as if - * it first converts to byte, and then masks all but the low bit. + *
      • If T0 and T1 are primitives, then a Java method invocation + * conversion (JLS 5.3) is applied, if one exists. *
      • If T0 is a primitive and T1 a reference, a boxing * conversion is applied if one exists, possibly followed by - * an reference conversion to a superclass. + * a reference conversion to a superclass. * T1 must be a wrapper class or a supertype of one. - * If T1 is a wrapper class, T0 is converted if necessary - * to T1's primitive type by one of the preceding conversions. - * Otherwise, T0 is boxed, and its wrapper converted to T1. *
      • If T0 is a reference and T1 a primitive, an unboxing - * conversion is applied if one exists, possibly preceded by - * a reference conversion to a wrapper class. + * conversion will be applied at runtime, possibly followed + * by a Java method invocation conversion (JLS 5.3) + * on the primitive value. (These are the widening conversions.) * T0 must be a wrapper class or a supertype of one. - * If T0 is a wrapper class, its primitive value is converted - * if necessary to T1 by one of the preceding conversions. - * Otherwise, T0 is converted directly to the wrapper type for T1, - * which is then unboxed. + * (In the case where T0 is Object, these are the conversions + * allowed by java.lang.reflect.Method.invoke.) *
      • If the return type T1 is void, any returned value is discarded *
      • If the return type T0 is void and T1 a reference, a null value is introduced. *
      • If the return type T0 is void and T1 a primitive, a zero value is introduced. @@ -1037,26 +1060,109 @@ public class MethodHandles { * @return a method handle which delegates to {@code target} after performing * any necessary argument conversions, and arranges for any * necessary return value conversions - * @throws IllegalArgumentException if the conversion cannot be made + * @throws WrongMethodTypeException if the conversion cannot be made * @see MethodHandle#asType + * @see MethodHandles#explicitCastArguments */ public static MethodHandle convertArguments(MethodHandle target, MethodType newType) { MethodType oldType = target.type(); if (oldType.equals(newType)) return target; - MethodHandle res = MethodHandleImpl.convertArguments(IMPL_TOKEN, target, - newType, oldType, null); + MethodHandle res = null; + try { + res = MethodHandleImpl.convertArguments(IMPL_TOKEN, target, + newType, oldType, null); + } catch (IllegalArgumentException ex) { + } if (res == null) - throw newIllegalArgumentException("cannot convert to "+newType+": "+target); + throw new WrongMethodTypeException("cannot convert to "+newType+": "+target); return res; } /** - * PROVISIONAL API, WORK IN PROGRESS: + * Produce a method handle which adapts the type of the + * given method handle to a new type by pairwise argument conversion. + * The original type and new type must have the same number of arguments. + * The resulting method handle is guaranteed to report a type + * which is equal to the desired new type. + *

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

        + * The same conversions are allowed as for {@link #convertArguments convertArguments}, + * and some additional conversions are also applied if those conversions fail. + * Given types T0, T1, one of the following conversions is applied + * in addition, if the conversions specified for {@code convertArguments} + * would be insufficient: + *

          + *
        • If T0 and T1 are references, and T1 is an interface type, + * then the value of type T0 is passed as a T1 without a cast. + * (This treatment of interfaces follows the usage of the bytecode verifier.) + *
        • If T0 and T1 are primitives and one is boolean, + * the boolean is treated as a one-bit unsigned integer. + * (This treatment follows the usage of the bytecode verifier.) + * A conversion from another primitive type behaves as if + * it first converts to byte, and then masks all but the low bit. + *
        • If a primitive value would be converted by {@code convertArguments} + * using Java method invocation conversion (JLS 5.3), + * Java casting conversion (JLS 5.5) may be used also. + * This allows primitives to be narrowed as well as widened. + *
        + * @param target the method handle to invoke after arguments are retyped + * @param newType the expected type of the new method handle + * @return a method handle which delegates to {@code target} after performing + * any necessary argument conversions, and arranges for any + * necessary return value conversions + * @throws WrongMethodTypeException if the conversion cannot be made + * @see MethodHandle#asType + * @see MethodHandles#convertArguments + */ + public static + MethodHandle explicitCastArguments(MethodHandle target, MethodType newType) { + return convertArguments(target, newType); // FIXME! + } + + /* + FIXME: Reconcile javadoc with 10/22/2010 EG notes on conversion: + + Both converters arrange for their method handles to convert arguments + and return values. The conversion rules are the same for arguments + and return values, and depend only on source and target types, S and + T. The conversions allowed by castConvertArguments are a strict + superset of those performed by convertArguments. + + In all cases, if S and T are references, a simple checkcast is done. + If neither S nor T is a primitive, no attempt is made to unbox and + box. A failed conversion throws ClassCastException. + + If T is void, the value is dropped. + + For compatibility with reflection, if S is void and T is a reference, + a null value is produced. + + For compatibility with reflection, if S is a reference and T is a + primitive, S is first unboxed and then undergoes primitive conversion. + In the case of 'convertArguments', only assignment conversion is + performed (no narrowing primitive conversion). + + If S is a primitive, S is boxed, and then the above rules are applied. + If S and T are both primitives, the boxing will be undetectable; only + the primitive conversions will be apparent to the user. The key point + is that if S is a primitive type, the implementation may box it and + treat is as Object, without loss of information, or it may use a "fast + path" which does not use boxing. + + Notwithstanding the rules above, for compatibility with the verifier, + if T is an interface, it is treated as if it were Object. [KEEP THIS?] + + Also, for compatibility with the verifier, a boolean may be undergo + widening or narrowing conversion to any other primitive type. [KEEP THIS?] + */ + + /** * Produce a method handle which adapts the calling sequence of the * given method handle to a new type, by reordering the arguments. - * The resulting method handle is guaranteed to confess a type + * The resulting method handle is guaranteed to report a type * which is equal to the desired new type. *

        * The given array controls the reordering. @@ -1069,22 +1175,42 @@ public class MethodHandles { * outgoing argument will be taken from the {@code I}-th incoming * argument, where {@code I} is {@code reorder[N]}. *

        + * No argument or return value conversions are applied. + * The type of each incoming argument, as determined by {@code newType}, + * must be identical to the type of the corresponding outgoing argument + * or arguments in the target method handle. + * The return type of {@code newType} must be identical to the return + * type of the original target. + *

        * The reordering array need not specify an actual permutation. * An incoming argument will be duplicated if its index appears * more than once in the array, and an incoming argument will be dropped * if its index does not appear in the array. - *

        - * Pairwise conversions are applied as needed to arguments and return - * values, as with {@link #convertArguments}. + * As in the case of {@link #dropArguments(MethodHandle,int,List) dropArguments}, + * incoming arguments which are not mentioned in the reordering array + * are may be any type, as determined only by {@code newType}. + *

        +MethodType intfn1 = MethodType.methodType(int.class, int.class);
        +MethodType intfn2 = MethodType.methodType(int.class, int.class, int.class);
        +MethodHandle sub = ... {int x, int y => x-y} ...;
        +assert(sub.type().equals(intfn2));
        +MethodHandle sub1 = MethodHandles.permuteArguments(sub, intfn2, 0, 1);
        +MethodHandle rsub = MethodHandles.permuteArguments(sub, intfn2, 1, 0);
        +assert((int)rsub.invokeExact(1, 100) == 99);
        +MethodHandle add = ... {int x, int y => x+y} ...;
        +assert(add.type().equals(intfn2));
        +MethodHandle twice = MethodHandles.permuteArguments(add, intfn1, 0, 0);
        +assert(twice.type().equals(intfn1));
        +assert((int)twice.invokeExact(21) == 42);
        +     * 
        * @param target the method handle to invoke after arguments are reordered * @param newType the expected type of the new method handle * @param reorder a string which controls the reordering - * @return a method handle which delegates to {@code target} after performing - * any necessary argument motion and conversions, and arranges for any - * necessary return value conversions + * @return a method handle which delegates to {@code target} after it + * drops unused arguments and moves and/or duplicates the other arguments */ public static - MethodHandle permuteArguments(MethodHandle target, MethodType newType, int[] reorder) { + MethodHandle permuteArguments(MethodHandle target, MethodType newType, int... reorder) { MethodType oldType = target.type(); checkReorder(reorder, newType, oldType); return MethodHandleImpl.convertArguments(IMPL_TOKEN, target, @@ -1107,33 +1233,21 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: - * Produce a method handle which adapts the type of the - * given method handle to a new type, by spreading the final argument. - * The resulting method handle is guaranteed to confess a type - * which is equal to the desired new type. - *

        - * The final parameter type of the new type must be an array type T[]. - * This is the type of what is called the spread argument. - * All other arguments of the new type are called ordinary arguments. - *

        - * The ordinary arguments of the new type are pairwise converted - * to the initial parameter types of the old type, according to the - * rules in {@link #convertArguments}. - * Any additional arguments in the old type - * are converted from the array element type T, - * again according to the rules in {@link #convertArguments}. - * The return value is converted according likewise. - *

        - * The call verifies that the spread argument is in fact an array - * of exactly the type length, i.e., the excess number of - * arguments in the old type over the ordinary arguments in the new type. - * If there are no excess arguments, the spread argument is also - * allowed to be null. - * @param target the method handle to invoke after the argument is prepended + * METHOD WILL BE REMOVED FOR PFD: + * Equivalent to the following code: + *

        +     * int spreadPos = newType.parameterCount() - 1;
        +     * Class spreadType = newType.parameterType(spreadPos);
        +     * int spreadCount = target.type().parameterCount() - spreadPos;
        +     * MethodHandle adapter = target.asSpreader(spreadType, spreadCount);
        +     * adapter = adapter.asType(newType);
        +     * return adapter;
        +     * 
        + * @param target the method handle to invoke after argument spreading * @param newType the expected type of the new method handle - * @return a new method handle which spreads its final argument, + * @return a method handle which spreads its final argument, * before calling the original method handle + * @deprecated Use {@link MethodHandle#asSpreader} */ public static MethodHandle spreadArguments(MethodHandle target, MethodType newType) { @@ -1153,21 +1267,22 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: - * Produce a method handle which adapts the type of the - * given method handle to a new type, by collecting a series of - * trailing arguments as elements to a single argument array. - *

        - * This method may be used as an inverse to {@link #spreadArguments}. - * The final parameter type of the old type must be an array type T[], - * which is the type of what is called the spread argument. - * The trailing arguments of the new type which correspond to - * the spread argument are all converted to type T and collected - * into an array before the original method is called. - * @param target the method handle to invoke after the argument is prepended + * METHOD WILL BE REMOVED FOR PFD: + * Equivalent to the following code: + *

        +     * int collectPos = target.type().parameterCount() - 1;
        +     * Class collectType = target.type().parameterType(collectPos);
        +     * if (!collectType.isArray())  collectType = Object[].class;
        +     * int collectCount = newType.parameterCount() - collectPos;
        +     * MethodHandle adapter = target.asCollector(collectType, collectCount);
        +     * adapter = adapter.asType(newType);
        +     * return adapter;
        +     * 
        + * @param target the method handle to invoke after argument collection * @param newType the expected type of the new method handle - * @return a new method handle which collects some trailing argument + * @return a method handle which collects some trailing argument * into an array, before calling the original method handle + * @deprecated Use {@link MethodHandle#asCollector} instead. */ public static MethodHandle collectArguments(MethodHandle target, MethodType newType) { @@ -1186,7 +1301,88 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: + * Produce a method handle of the requested return type which returns the given + * constant value every time it is invoked. + *

        + * Before the method handle is returned, the passed-in value is converted to the requested type. + * If the requested type is primitive, widening primitive conversions are attempted, + * else reference conversions are attempted. + *

        The returned method handle is equivalent to {@code identity(type).bindTo(value)}, + * unless the type is {@code void}, in which case it is {@code identity(type)}. + * @param type the return type of the desired method handle + * @param value the value to return + * @return a method handle of the given return type and no arguments, which always returns the given value + * @throws WrongMethodTypeException if the value cannot be converted to the required return type + */ + public static + MethodHandle constant(Class type, Object value) { + if (type.isPrimitive()) { + if (type == void.class) return identity(type); + Wrapper w = Wrapper.forPrimitiveType(type); + return identity(type).bindTo(w.convert(value, type)); + } else { + return identity(type).bindTo(type.cast(value)); + } + } + + /** + * Produce a method handle of the requested type which returns the given + * constant value every time it is invoked. + *

        + * Before the method handle is returned, the passed-in value is converted to the requested return type, + * as if by {@link #explicitCastArguments #explicitCastArguments}. + * That is, if the return type is primitive, the value is unboxed, + * and the primitive value is widened and/or narrowed. + * Otherwise, reference conversions are attempted. + * @param type the type of the desired method handle + * @param value the value to return + * @return a method handle of the given return type and no arguments, which always returns the given value + * @throws WrongMethodTypeException if the value cannot be converted to the required return type + */ + public static + MethodHandle constant(MethodType type, Object value) { + MethodHandle target = constant(type.returnType(), value); + int len = type.parameterCount(); + if (len == 0) + return target.asType(type); + target = target.asType(type.dropParameterTypes(0, len)); + return dropArguments(target, 0, type.parameterList().subList(0, len)); + } + + /** + * Produce a method handle which returns its sole argument when invoked. + *

        The identity function for {@code void} takes no arguments and returns no values. + * @param type the type of the sole parameter and return value of the desired method handle + * @return a unary method handle which accepts and returns the given type + */ + public static + MethodHandle identity(Class type) { + return ValueConversions.identity(type); + } + + /** + * Produce a method handle of the requested type which returns its argument when invoked. + * If the return type differs from the first argument type, the argument will be + * converted as if by {@link #explicitCastArguments explicitCastArguments}. + * If there are additional arguments beyond the first, they are discarded. + *

        The identity function for {@code void} discards all its arguments. + * @param type the type of the desired method handle + * @return a method handle of the given type, which always returns its first argument + * @throws WrongMethodTypeException if the first argument cannot be converted to the required return type + */ + public static + MethodHandle identity(MethodType type) { + MethodHandle target = identity(type.returnType()); + int len = type.parameterCount(); + if (len == 1) + return explicitCastArguments(target, type); + if (len == 0) + throw new IllegalArgumentException("not enough arguments"); + target = explicitCastArguments(target, type.dropParameterTypes(1, len)); + return dropArguments(target, 1, type.parameterList().subList(1, len)); + } + + /** * Produce a method handle which calls the original method handle {@code target}, * after inserting the given argument(s) at the given position. * The formal parameters to {@code target} which will be supplied by those @@ -1206,8 +1402,9 @@ public class MethodHandles { * @param target the method handle to invoke after the argument is inserted * @param pos where to insert the argument (zero for the first) * @param values the series of arguments to insert - * @return a new method handle which inserts an additional argument, + * @return a method handle which inserts an additional argument, * before calling the original method handle + * @see MethodHandle#bindTo */ public static MethodHandle insertArguments(MethodHandle target, int pos, Object... values) { @@ -1240,14 +1437,7 @@ public class MethodHandles { return result; } - @Deprecated // "use MethodHandles.insertArguments instead" - public static - MethodHandle insertArgument(MethodHandle target, int pos, Object value) { - return insertArguments(target, pos, value); - } - /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle which calls the original method handle, * after dropping the given argument(s) at the given position. * The type of the new method handle will insert the given argument @@ -1260,22 +1450,25 @@ public class MethodHandles { *

        * Example: *

        -     *   MethodHandle cat = MethodHandles.lookup().
        -     *     findVirtual(String.class, "concat", String.class, String.class);
        -     *   System.out.println(cat.<String>invokeExact("x", "y")); // xy
        -     *   MethodHandle d0 = dropArguments(cat, 0, String.class);
        -     *   System.out.println(d0.<String>invokeExact("x", "y", "z")); // xy
        -     *   MethodHandle d1 = dropArguments(cat, 1, String.class);
        -     *   System.out.println(d1.<String>invokeExact("x", "y", "z")); // xz
        -     *   MethodHandle d2 = dropArguments(cat, 2, String.class);
        -     *   System.out.println(d2.<String>invokeExact("x", "y", "z")); // yz
        -     *   MethodHandle d12 = dropArguments(cat, 1, String.class, String.class);
        -     *   System.out.println(d12.<String>invokeExact("w", "x", "y", "z")); // wz
        +import static java.dyn.MethodHandles.*;
        +import static java.dyn.MethodType.*;
        +...
        +MethodHandle cat = lookup().findVirtual(String.class,
        +  "concat", methodType(String.class, String.class));
        +assertEquals("xy", (String) cat.invokeExact("x", "y"));
        +MethodHandle d0 = dropArguments(cat, 0, String.class);
        +assertEquals("yz", (String) d0.invokeExact("x", "y", "z"));
        +MethodHandle d1 = dropArguments(cat, 1, String.class);
        +assertEquals("xz", (String) d1.invokeExact("x", "y", "z"));
        +MethodHandle d2 = dropArguments(cat, 2, String.class);
        +assertEquals("xy", (String) d2.invokeExact("x", "y", "z"));
        +MethodHandle d12 = dropArguments(cat, 1, int.class, boolean.class);
        +assertEquals("xz", (String) d12.invokeExact("x", 12, true, "z"));
              * 
        - * @param target the method handle to invoke after the argument is dropped - * @param valueTypes the type(s) of the argument to drop - * @param pos which argument to drop (zero for the first) - * @return a new method handle which drops an argument of the given type, + * @param target the method handle to invoke after the arguments are dropped + * @param valueTypes the type(s) of the argument(s) to drop + * @param pos position of first argument to drop (zero for the leftmost) + * @return a method handle which drops arguments of the given types, * before calling the original method handle */ public static @@ -1293,23 +1486,36 @@ public class MethodHandles { return MethodHandleImpl.dropArguments(IMPL_TOKEN, target, newType, pos); } + /** + * Produce a method handle which calls the original method handle, + * after dropping the given argument(s) at the given position. + * The type of the new method handle will insert the given argument + * type(s), at that position, into the original handle's type. + * This method is equivalent to the following code: + * + * {@link #dropArguments(MethodHandle,int,List) dropArguments}(target, pos, Arrays.asList(valueTypes)) + * + * @param target the method handle to invoke after the arguments are dropped + * @param valueTypes the type(s) of the argument(s) to drop + * @param pos position of first argument to drop (zero for the leftmost) + * @return a method handle which drops arguments of the given types, + * before calling the original method handle + */ public static MethodHandle dropArguments(MethodHandle target, int pos, Class... valueTypes) { return dropArguments(target, pos, Arrays.asList(valueTypes)); } /** - * PROVISIONAL API, WORK IN PROGRESS: * Adapt a target method handle {@code target} by pre-processing * one or more of its arguments, each with its own unary filter function, * and then calling the target with each pre-processed argument * replaced by the result of its corresponding filter function. *

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

        * If a filter {@code F} applies to the {@code N}th argument of * the method handle, then {@code F} must be a method handle which @@ -1319,46 +1525,49 @@ public class MethodHandles { * The return type of {@code F} must be identical to the corresponding * parameter type of the target. *

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

        Here is pseudocode for the resulting adapter: - *

        -     * // there are N arguments in the A sequence
        -     * T target(A[N]...);
        -     * [i<N] V[i] filter[i](B[i]) = filters[i] ?: identity;
        -     * T adapter(B[N]... b) {
        -     *   A[N] a...;
        -     *   [i<N] a[i] = filter[i](b[i]);
        -     *   return target(a...);
        -     * }
        +     * Example:
        +     * 

        +import static java.dyn.MethodHandles.*;
        +import static java.dyn.MethodType.*;
        +...
        +MethodHandle cat = lookup().findVirtual(String.class,
        +  "concat", methodType(String.class, String.class));
        +MethodHandle upcase = lookup().findVirtual(String.class,
        +  "toUpperCase", methodType(String.class));
        +assertEquals("xy", (String) cat.invokeExact("x", "y"));
        +MethodHandle f0 = filterArguments(cat, 0, upcase);
        +assertEquals("Xy", (String) f0.invokeExact("x", "y")); // Xy
        +MethodHandle f1 = filterArguments(cat, 1, upcase);
        +assertEquals("xY", (String) f1.invokeExact("x", "y")); // xY
        +MethodHandle f2 = filterArguments(cat, 0, upcase, upcase);
        +assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
              * 
        * @param target the method handle to invoke after arguments are filtered + * @param pos the position of the first argument to filter * @param filters method handles to call initially on filtered arguments * @return method handle which incorporates the specified argument filtering logic - * @throws IllegalArgumentException if a non-null element of {@code filters} - * does not match a corresponding argument type of {@code target} + * @throws IllegalArgumentException if an element of {@code filters} is null or + * does not match a corresponding argument type of {@code target} as described above */ public static - MethodHandle filterArguments(MethodHandle target, MethodHandle... filters) { + MethodHandle filterArguments(MethodHandle target, int pos, MethodHandle... filters) { MethodType targetType = target.type(); MethodHandle adapter = target; MethodType adapterType = targetType; - int pos = -1, maxPos = targetType.parameterCount(); + int maxPos = targetType.parameterCount(); + int curPos = pos; for (MethodHandle filter : filters) { - pos += 1; - if (filter == null) continue; - if (pos >= maxPos) + if (curPos >= maxPos) throw newIllegalArgumentException("too many filters"); MethodType filterType = filter.type(); if (filterType.parameterCount() != 1 - || filterType.returnType() != targetType.parameterType(pos)) + || filterType.returnType() != targetType.parameterType(curPos)) throw newIllegalArgumentException("target and filter types do not match"); - adapterType = adapterType.changeParameterType(pos, filterType.parameterType(0)); - adapter = MethodHandleImpl.filterArgument(IMPL_TOKEN, adapter, pos, filter); + adapterType = adapterType.changeParameterType(curPos, filterType.parameterType(0)); + adapter = MethodHandleImpl.filterArgument(IMPL_TOKEN, adapter, curPos, filter); + curPos += 1; } MethodType midType = adapter.type(); if (midType != adapterType) @@ -1367,7 +1576,48 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: + * Adapt a target method handle {@code target} by post-processing + * its return value with a unary filter function. + *

        + * If a filter {@code F} applies to the return value of + * the target method handle, then {@code F} must be a method handle which + * takes exactly one argument. The return type of {@code F} + * replaces the return type of the target + * in the resulting adapted method handle. + * The argument type of {@code F} must be identical to the + * return type of the target. + * Example: + *

        +import static java.dyn.MethodHandles.*;
        +import static java.dyn.MethodType.*;
        +...
        +MethodHandle cat = lookup().findVirtual(String.class,
        +  "concat", methodType(String.class, String.class));
        +MethodHandle length = lookup().findVirtual(String.class,
        +  "length", methodType(int.class));
        +System.out.println((String) cat.invokeExact("x", "y")); // xy
        +MethodHandle f0 = filterReturnValue(cat, length);
        +System.out.println((int) f0.invokeExact("x", "y")); // 2
        +     * 
        + * @param target the method handle to invoke before filtering the return value + * @param filter method handle to call on the return value + * @return method handle which incorporates the specified return value filtering logic + * @throws IllegalArgumentException if {@code filter} is null or + * does not match the return type of {@code target} as described above + */ + public static + MethodHandle filterReturnValue(MethodHandle target, MethodHandle filter) { + MethodType targetType = target.type(); + MethodType filterType = filter.type(); + if (filterType.parameterCount() != 1 + || filterType.parameterType(0) != targetType.returnType()) + throw newIllegalArgumentException("target and filter types do not match"); + // FIXME: Too many nodes here. + MethodHandle returner = dropArguments(filter, 0, targetType.parameterList()); + return foldArguments(returner, exactInvoker(target.type()).bindTo(target)); + } + + /** * Adapt a target method handle {@code target} by pre-processing * some of its arguments, and then calling the target with * the result of the pre-processing, plus all original arguments. @@ -1384,10 +1634,10 @@ public class MethodHandles { * The resulting adapter is the same type as the target, except that the * initial argument type of the target is dropped. *

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

        @@ -1408,7 +1658,7 @@ public class MethodHandles { * @return method handle which incorporates the specified argument folding logic * @throws IllegalArgumentException if the first argument type of * {@code target} is not the same as {@code combiner}'s return type, - * or if the next {@code foldArgs} argument types of {@code target} + * or if the following argument types of {@code target} * are not identical with the argument types of {@code combiner} */ public static @@ -1417,6 +1667,10 @@ public class MethodHandles { MethodType combinerType = combiner.type(); int foldArgs = combinerType.parameterCount(); boolean ok = (targetType.parameterCount() >= 1 + foldArgs); + if (ok && !combinerType.parameterList().equals(targetType.parameterList().subList(1, foldArgs+1))) + ok = false; + if (ok && !combinerType.returnType().equals(targetType.parameterType(0))) + ok = false; if (!ok) throw misMatchedTypes("target and combiner types", targetType, combinerType); MethodType newType = targetType.dropParameterTypes(0, 1); @@ -1424,7 +1678,6 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Make a method handle which adapts a target method handle, * by guarding it with a test, a boolean-valued method handle. * If the guard fails, a fallback handle is called instead. @@ -1444,6 +1697,9 @@ public class MethodHandles { * return fallback(a..., b...); * } *

        + * Note that the test arguments ({@code a...} in the pseudocode) cannot + * be modified by execution of the test, and so are passed unchanged + * from the caller to the target or fallback as appropriate. * @param test method handle used for test, must return boolean * @param target method handle to call if test passes * @param fallback method handle to call if test fails @@ -1459,40 +1715,19 @@ public class MethodHandles { MethodType gtype = test.type(); MethodType ttype = target.type(); MethodType ftype = fallback.type(); - if (ttype != ftype) + if (!ttype.equals(ftype)) throw misMatchedTypes("target and fallback types", ttype, ftype); - MethodType gtype2 = ttype.changeReturnType(boolean.class); - if (gtype2 != gtype) { - if (gtype.returnType() != boolean.class) - throw newIllegalArgumentException("guard type is not a predicate "+gtype); - int gpc = gtype.parameterCount(), tpc = ttype.parameterCount(); - if (gpc < tpc) { - test = dropArguments(test, gpc, ttype.parameterList().subList(gpc, tpc)); - gtype = test.type(); - } - if (gtype2 != gtype) + if (gtype.returnType() != boolean.class) + throw newIllegalArgumentException("guard type is not a predicate "+gtype); + List> targs = ttype.parameterList(); + List> gargs = gtype.parameterList(); + if (!targs.equals(gargs)) { + int gpc = gargs.size(), tpc = targs.size(); + if (gpc >= tpc || !targs.subList(0, gpc).equals(gargs)) throw misMatchedTypes("target and test types", ttype, gtype); + test = dropArguments(test, gpc, targs.subList(gpc, tpc)); + gtype = test.type(); } - /* { - MethodHandle invoke = findVirtual(MethodHandle.class, "invoke", target.type()); - static MethodHandle choose(boolean z, MethodHandle t, MethodHandle f) { - return z ? t : f; - } - static MethodHandle compose(MethodHandle f, MethodHandle g) { - Class initargs = g.type().parameterArray(); - f = dropArguments(f, 1, initargs); // ignore 2nd copy of args - return combineArguments(f, g); - } - // choose = \z.(z ? target : fallback) - MethodHandle choose = findVirtual(MethodHandles.class, "choose", - MethodType.methodType(boolean.class, MethodHandle.class, MethodHandle.class)); - choose = appendArgument(choose, target); - choose = appendArgument(choose, fallback); - MethodHandle dispatch = compose(choose, test); - // dispatch = \(a...).(test(a...) ? target : fallback) - return combineArguments(invoke, dispatch, 0); - // return \(a...).((test(a...) ? target : fallback).invokeExact(a...)) - } */ return MethodHandleImpl.makeGuardWithTest(IMPL_TOKEN, test, target, fallback); } @@ -1501,29 +1736,38 @@ public class MethodHandles { } /** - * PROVISIONAL API, WORK IN PROGRESS: * Make a method handle which adapts a target method handle, * by running it inside an exception handler. * If the target returns normally, the adapter returns that value. * If an exception matching the specified type is thrown, the fallback * handle is called instead on the exception, plus the original arguments. *

        - * The handler must have leading parameter of {@code exType} or a supertype, - * followed by arguments which correspond (how? TBD) to - * all the parameters of the target. - * The target and handler must return the same type. + * The target and handler must have the same corresponding + * argument and return types, except that handler may omit trailing arguments + * (similarly to the predicate in {@link #guardWithTest guardWithTest}). + * Also, the handler must have an extra leading parameter of {@code exType} or a supertype. *

        Here is pseudocode for the resulting adapter: *

        -     * T target(A...);
        +     * T target(A..., B...);
              * T handler(ExType, A...);
        -     * T adapter(A... a) {
        +     * T adapter(A... a, B... b) {
              *   try {
        -     *     return target(a...);
        +     *     return target(a..., b...);
              *   } catch (ExType ex) {
              *     return handler(ex, a...);
              *   }
              * }
              * 
        + * Note that the saved arguments ({@code a...} in the pseudocode) cannot + * be modified by execution of the target, and so are passed unchanged + * from the caller to the handler, if the handler is invoked. + *

        + * The target and handler must return the same type, even if the handler + * always throws. (This might happen, for instance, because the handler + * is simulating a {@code finally} clause). + * To create such a throwing handler, compose the handler creation logic + * with {@link #throwException throwException}, + * in order to create a method handle of the correct return type. * @param target method handle to call * @param exType the type of exception which the handler will catch * @param handler method handle to call if a matching exception is thrown @@ -1537,16 +1781,23 @@ public class MethodHandles { MethodHandle catchException(MethodHandle target, Class exType, MethodHandle handler) { - MethodType targetType = target.type(); - MethodType handlerType = handler.type(); - boolean ok = (targetType.parameterCount() == - handlerType.parameterCount() - 1); -// for (int i = 0; ok && i < numExArgs; i++) { -// if (targetType.parameterType(i) != handlerType.parameterType(1+i)) -// ok = false; -// } - if (!ok) - throw newIllegalArgumentException("target and handler types do not match"); + MethodType ttype = target.type(); + MethodType htype = handler.type(); + if (htype.parameterCount() < 1 || + !htype.parameterType(0).isAssignableFrom(exType)) + throw newIllegalArgumentException("handler does not accept exception type "+exType); + if (htype.returnType() != ttype.returnType()) + throw misMatchedTypes("target and handler return types", ttype, htype); + List> targs = ttype.parameterList(); + List> hargs = htype.parameterList(); + hargs = hargs.subList(1, hargs.size()); // omit leading parameter from handler + if (!targs.equals(hargs)) { + int hpc = hargs.size(), tpc = targs.size(); + if (hpc >= tpc || !targs.subList(0, hpc).equals(hargs)) + throw misMatchedTypes("target and handler types", ttype, htype); + handler = dropArguments(handler, hpc, hargs.subList(hpc, tpc)); + htype = handler.type(); + } return MethodHandleImpl.makeGuardWithCatch(IMPL_TOKEN, target, exType, handler); } @@ -1562,4 +1813,185 @@ public class MethodHandles { MethodHandle throwException(Class returnType, Class exType) { return MethodHandleImpl.throwException(IMPL_TOKEN, MethodType.methodType(returnType, exType)); } + + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Produce a wrapper instance of the given "SAM" interface which redirects + * its calls to the given method handle. + * A SAM interface is an interface which declares a single abstract method. + * The type must be public. (No additional access checks are performed.) + *

        + * The resulting instance of the required SAM type will respond to + * invocation of the SAM type's single abstract method by calling + * the given {@code target} on the incoming arguments, + * and returning or throwing whatever the {@code target} + * returns or throws. The invocation will be as if by + * {@code target.invokeExact}. + *

        + * The method handle may throw an undeclared exception, + * which means any checked exception (or other checked throwable) + * not declared by the SAM type's single abstract method. + * If this happens, the throwable will be wrapped in an instance of + * {@link java.lang.reflect.UndeclaredThrowableException UndeclaredThrowableException} + * and thrown in that wrapped form. + *

        + * The wrapper instance is guaranteed to be of a non-public + * implementation class C in a package containing no classes + * or methods except system-defined classes and methods. + * The implementation class C will have no public supertypes + * or public methods beyond the following: + *

          + *
        • the SAM type itself and any methods in the SAM type + *
        • the supertypes of the SAM type (if any) and their methods + *
        • {@link Object} and its methods + *
        • {@link java.dyn.AsInstanceObject AsInstanceObject} and its methods
        • + *
        + *

        + * (Note: When determining the unique abstract method of a SAM interface, + * the public {@code Object} methods ({@code toString}, {@code equals}, {@code hashCode}) + * are disregarded. For example, {@link java.util.Comparator} is a SAM interface, + * even though it re-declares the {@code Object.equals} method.) + *

        + * No stable mapping is promised between the SAM type and + * the implementation class C. Over time, several implementation + * classes might be used for the same SAM type. + *

        + * This method is not guaranteed to return a distinct + * wrapper object for each separate call. If the implementation is able + * to prove that a wrapper of the required SAM type + * has already been created for a given + * method handle, or for another method handle with the + * same behavior, the implementation may return that wrapper in place of + * a new wrapper. + *

        + * This method is designed to apply to common use cases + * where a single method handle must interoperate with + * a type (class or interface) that implements a function-like + * API. Additional variations, such as SAM classes with + * private constructors, or interfaces with multiple but related + * entry points, must be covered by hand-written or automatically + * generated adapter classes. In those cases, consider implementing + * {@link java.dyn.MethodHandles.AsInstanceObject AsInstanceObject} + * in the adapters, so that generic code can extract the underlying + * method handle without knowing where the SAM adapter came from. + * @param target the method handle to invoke from the wrapper + * @param samType the desired type of the wrapper, a SAM type + * @return a correctly-typed wrapper for the given {@code target} + * @throws IllegalArgumentException if the {@code target} throws + * an undeclared exception + */ + // ISSUE: Should we delegate equals/hashCode to the targets? + // Not useful unless there is a stable equals/hashCode behavior + // for MethodHandle, but there isn't. + public static + T asInstance(final MethodHandle target, final Class samType) { + // POC implementation only; violates the above contract several ways + final Method sam = getSamMethod(samType); + if (sam == null) + throw new IllegalArgumentException("not a SAM type: "+samType.getName()); + MethodType samMT = MethodType.methodType(sam.getReturnType(), sam.getParameterTypes()); + if (!samMT.equals(target.type())) + throw new IllegalArgumentException("wrong method type: "+target+" should match "+sam); + return samType.cast(Proxy.newProxyInstance( + samType.getClassLoader(), + new Class[]{ samType, AsInstanceObject.class }, + new InvocationHandler() { + private Object getArg(String name) { + if ((Object)name == "getAsInstanceTarget") return target; + if ((Object)name == "getAsInstanceType") return samType; + throw new AssertionError(); + } + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + if (method.getDeclaringClass() == AsInstanceObject.class) + return getArg(method.getName()); + if (method.equals(sam)) + return target.invokeVarargs(args); + if (isObjectMethod(method)) + return callObjectMethod(this, method, args); + throw new InternalError(); + } + })); + } + + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Interface implemented by every object which is produced by {@link #asInstance asInstance}. + * The methods of this interface allow a caller to recover the parameters + * to {@code asInstance}. + * This allows applications to repeatedly convert between method handles + * and SAM objects, without the risk of creating unbounded delegation chains. + */ + public interface AsInstanceObject { + /** Produce or recover a target method handle which is behaviorally + * equivalent to the SAM method of this object. + */ + public MethodHandle getAsInstanceTarget(); + /** Recover the SAM type for which this object was created. + */ + public Class getAsInstanceType(); + } + + private static + boolean isObjectMethod(Method m) { + switch (m.getName()) { + case "toString": + return (m.getReturnType() == String.class + && m.getParameterTypes().length == 0); + case "hashCode": + return (m.getReturnType() == int.class + && m.getParameterTypes().length == 0); + case "equals": + return (m.getReturnType() == boolean.class + && m.getParameterTypes().length == 1 + && m.getParameterTypes()[0] == Object.class); + } + return false; + } + + private static + Object callObjectMethod(Object self, Method m, Object[] args) { + assert(isObjectMethod(m)) : m; + switch (m.getName()) { + case "toString": + return self.getClass().getName() + "@" + Integer.toHexString(self.hashCode()); + case "hashCode": + return System.identityHashCode(self); + case "equals": + return (self == args[0]); + } + return null; + } + + private static + Method getSamMethod(Class samType) { + Method sam = null; + for (Method m : samType.getMethods()) { + int mod = m.getModifiers(); + if (Modifier.isAbstract(mod)) { + if (sam != null && !isObjectMethod(sam)) + return null; // too many abstract methods + sam = m; + } + } + if (!samType.isInterface() && getSamConstructor(samType) == null) + return null; // wrong kind of constructor + return sam; + } + + private static + Constructor getSamConstructor(Class samType) { + for (Constructor c : samType.getDeclaredConstructors()) { + if (c.getParameterTypes().length == 0) { + int mod = c.getModifiers(); + if (Modifier.isPublic(mod) || Modifier.isProtected(mod)) + return c; + } + } + return null; + } + + /*non-public*/ + static MethodHandle withTypeHandler(MethodHandle target, MethodHandle typeHandler) { + return MethodHandleImpl.withTypeHandler(IMPL_TOKEN, target, typeHandler); + } } diff --git a/jdk/src/share/classes/java/dyn/MethodType.java b/jdk/src/share/classes/java/dyn/MethodType.java index c9001bd25a6..32f3a196b53 100644 --- a/jdk/src/share/classes/java/dyn/MethodType.java +++ b/jdk/src/share/classes/java/dyn/MethodType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,20 +40,45 @@ import static sun.dyn.MemberName.newIllegalArgumentException; * returned by a method handle, or the arguments and return type passed * and expected by a method handle caller. Method types must be properly * matched between a method handle and all its callers, - * and the JVM's operations enforce this matching at all times. + * and the JVM's operations enforce this matching at, specifically + * during calls to {@link MethodHandle#invokeExact} + * and {@link MethodHandle#invokeGeneric}, and during execution + * of {@code invokedynamic} instructions. *

        * The structure is a return type accompanied by any number of parameter types. - * The types (primitive, void, and reference) are represented by Class objects. + * The types (primitive, {@code void}, and reference) are represented by {@link Class} objects. + * (For ease of exposition, we treat {@code void} as if it were a type. + * In fact, it denotes the absence of a return type.) *

        - * All instances of MethodType are immutable. + * All instances of {@code MethodType} are immutable. * Two instances are completely interchangeable if they compare equal. * Equality depends on pairwise correspondence of the return and parameter types and on nothing else. *

        * This type can be created only by factory methods. * All factory methods may cache values, though caching is not guaranteed. + * Some factory methods are static, while others are virtual methods which + * modify precursor method types, e.g., by changing a selected parameter. *

        - * Note: Like classes and strings, method types can be represented directly - * as constants to be loaded by {@code ldc} bytecodes. + * Factory methods which operate on groups of parameter types + * are systematically presented in two versions, so that both Java arrays and + * Java lists can be used to work with groups of parameter types. + * The query methods {@code parameterArray} and {@code parameterList} + * also provide a choice between arrays and lists. + *

        + * {@code MethodType} objects are sometimes derived from bytecode instructions + * such as {@code invokedynamic}, specifically from the type descriptor strings associated + * with the instructions in a class file's constant pool. + *

        + * Like classes and strings, method types can also be represented directly + * in a class file's constant pool as constants. The may be loaded by an {@code ldc} + * instruction which refers to a suitable {@code CONSTANT_MethodType} constant pool entry. + * The entry refers to a {@code CONSTANT_Utf8} spelling for the descriptor string. + * For more details, see the package summary. + *

        + * When the JVM materializes a {@code MethodType} from a descriptor string, + * all classes named in the descriptor must be accessible, and will be loaded. + * (But the classes need not be initialized, as is the case with a {@code CONSTANT_Class}.) + * This loading may occur at any time before the {@code MethodType} object is first derived. * @author John Rose, JSR 292 EG */ public final @@ -106,7 +131,7 @@ class MethodType { for (Class ptype : ptypes) { ptype.equals(ptype); // null check if (ptype == void.class) - throw newIllegalArgumentException("void parameter: "+this); + throw newIllegalArgumentException("parameter type cannot be void"); } } @@ -126,10 +151,6 @@ class MethodType { MethodType methodType(Class rtype, Class[] ptypes) { return makeImpl(rtype, ptypes, false); } - @Deprecated public static - MethodType make(Class rtype, Class[] ptypes) { - return methodType(rtype, ptypes); - } /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. */ public static @@ -137,10 +158,6 @@ class MethodType { boolean notrust = false; // random List impl. could return evil ptypes array return makeImpl(rtype, ptypes.toArray(NO_PTYPES), notrust); } - @Deprecated public static - MethodType make(Class rtype, List> ptypes) { - return methodType(rtype, ptypes); - } /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * The leading parameter type is prepended to the remaining array. @@ -152,10 +169,6 @@ class MethodType { System.arraycopy(ptypes, 0, ptypes1, 1, ptypes.length); return makeImpl(rtype, ptypes1, true); } - @Deprecated public static - MethodType make(Class rtype, Class ptype0, Class... ptypes) { - return methodType(rtype, ptype0, ptypes); - } /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * The resulting method has no parameter types. @@ -164,10 +177,6 @@ class MethodType { MethodType methodType(Class rtype) { return makeImpl(rtype, NO_PTYPES, true); } - @Deprecated public static - MethodType make(Class rtype) { - return methodType(rtype); - } /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * The resulting method has the single given parameter type. @@ -176,10 +185,6 @@ class MethodType { MethodType methodType(Class rtype, Class ptype0) { return makeImpl(rtype, new Class[]{ ptype0 }, true); } - @Deprecated public static - MethodType make(Class rtype, Class ptype0) { - return methodType(rtype, ptype0); - } /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * The resulting method has the same parameter types as {@code ptypes}, @@ -189,10 +194,6 @@ class MethodType { MethodType methodType(Class rtype, MethodType ptypes) { return makeImpl(rtype, ptypes.ptypes, true); } - @Deprecated public static - MethodType make(Class rtype, MethodType ptypes) { - return methodType(rtype, ptypes); - } /** * Sole factory method to find or create an interned method type. @@ -262,10 +263,6 @@ class MethodType { } return mt; } - @Deprecated public static - MethodType makeGeneric(int objectArgCount, boolean varargs) { - return genericMethodType(objectArgCount, varargs); - } /** * All parameters and the return type will be Object. @@ -277,10 +274,6 @@ class MethodType { MethodType genericMethodType(int objectArgCount) { return genericMethodType(objectArgCount, false); } - @Deprecated public static - MethodType makeGeneric(int objectArgCount) { - return genericMethodType(objectArgCount); - } /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * @param num the index (zero-based) of the parameter type to change @@ -294,18 +287,6 @@ class MethodType { return makeImpl(rtype, nptypes, true); } - /** Convenience method for {@link #insertParameterTypes}. - * @deprecated Use {@link #insertParameterTypes} instead. - */ - @Deprecated - public MethodType insertParameterType(int num, Class nptype) { - int len = ptypes.length; - Class[] nptypes = Arrays.copyOfRange(ptypes, 0, len+1); - System.arraycopy(nptypes, num, nptypes, num+1, len-num); - nptypes[num] = nptype; - return makeImpl(rtype, nptypes, true); - } - /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * @param num the position (zero-based) of the inserted parameter type(s) * @param ptypesToInsert zero or more a new parameter types to insert into the parameter list @@ -323,6 +304,22 @@ class MethodType { return makeImpl(rtype, nptypes, true); } + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. + * @param ptypesToInsert zero or more a new parameter types to insert after the end of the parameter list + * @return the same type, except with the selected parameter(s) appended + */ + public MethodType appendParameterTypes(Class... ptypesToInsert) { + return insertParameterTypes(parameterCount(), ptypesToInsert); + } + + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. + * @param ptypesToInsert zero or more a new parameter types to insert after the end of the parameter list + * @return the same type, except with the selected parameter(s) appended + */ + public MethodType appendParameterTypes(List> ptypesToInsert) { + return insertParameterTypes(parameterCount(), ptypesToInsert); + } + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * @param num the position (zero-based) of the inserted parameter type(s) * @param ptypesToInsert zero or more a new parameter types to insert into the parameter list @@ -364,14 +361,6 @@ class MethodType { return makeImpl(rtype, nptypes, true); } - /** Convenience method for {@link #dropParameterTypes}. - * @deprecated Use {@link #dropParameterTypes} instead. - */ - @Deprecated - public MethodType dropParameterType(int num) { - return dropParameterTypes(num, num+1); - } - /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * @param nrtype a return parameter type to replace the old one with * @return the same type, except with the return type change @@ -539,7 +528,9 @@ class MethodType { * parenthesis enclosed, comma separated list of type names, * followed immediately by the return type. *

        - * If a type name is array, it the base type followed + * Each type is represented by its + * {@link java.lang.Class#getSimpleName simple name}. + * If a type name name is array, it the base type followed * by [], rather than the Class.getName of the array type. */ @Override @@ -548,35 +539,13 @@ class MethodType { sb.append("("); for (int i = 0; i < ptypes.length; i++) { if (i > 0) sb.append(","); - putName(sb, ptypes[i]); + sb.append(ptypes[i].getSimpleName()); } sb.append(")"); - putName(sb, rtype); + sb.append(rtype.getSimpleName()); return sb.toString(); } - static void putName(StringBuilder sb, Class cls) { - int brackets = 0; - while (cls.isArray()) { - cls = cls.getComponentType(); - brackets++; - } - String n = cls.getName(); - /* - if (n.startsWith("java.lang.")) { - String nb = n.substring("java.lang.".length()); - if (nb.indexOf('.') < 0) n = nb; - } else if (n.indexOf('.') < 0) { - n = "."+n; // anonymous package - } - */ - sb.append(n); - while (brackets > 0) { - sb.append("[]"); - brackets--; - } - } - /// Queries which have to do with the bytecode architecture /** The number of JVM stack slots required to invoke a method @@ -636,11 +605,11 @@ class MethodType { /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * Find or create an instance of the given method type. - * Any class or interface name embedded in the signature string + * Any class or interface name embedded in the descriptor string * will be resolved by calling {@link ClassLoader#loadClass(java.lang.String)} * on the given loader (or if it is null, on the system class loader). *

        - * Note that it is possible to build method types which cannot be + * Note that it is possible to encounter method types which cannot be * constructed by this method, because their component types are * not all reachable from a common class loader. *

        @@ -662,8 +631,11 @@ class MethodType { } /** - * Create a bytecode signature representation of the type. - * Note that this is not a strict inverse of + * Create a bytecode descriptor representation of the method type. + *

        + * Note that this is not a strict inverse of {@link #fromMethodDescriptorString}. + * Two distinct classes which share a common name but have different class loaders + * will appear identical when viewed within descriptor strings. *

        * This method is included for the benfit of applications that must * generate bytecodes that process method handles and invokedynamic. @@ -674,14 +646,4 @@ class MethodType { public String toMethodDescriptorString() { return BytecodeDescriptor.unparse(this); } - - /** Temporary alias for toMethodDescriptorString; delete after M3. */ - public String toBytecodeString() { - return toMethodDescriptorString(); - } - /** Temporary alias for fromMethodDescriptorString; delete after M3. */ - public static MethodType fromBytecodeString(String descriptor, ClassLoader loader) - throws IllegalArgumentException, TypeNotPresentException { - return fromMethodDescriptorString(descriptor, loader); - } } diff --git a/jdk/src/share/classes/java/dyn/MutableCallSite.java b/jdk/src/share/classes/java/dyn/MutableCallSite.java new file mode 100644 index 00000000000..b33c41c1a5a --- /dev/null +++ b/jdk/src/share/classes/java/dyn/MutableCallSite.java @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.dyn; + +import sun.dyn.*; +import sun.dyn.empty.Empty; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * A {@code MutableCallSite} is a {@link CallSite} whose target variable + * behaves like an ordinary field. + * An {@code invokedynamic} instruction linked to a {@code MutableCallSite} delegates + * all calls to the site's current target. + * The {@linkplain CallSite#dynamicInvoker dynamic invoker} of a mutable call site + * also delegates each call to the site's current target. + *

        + * Here is an example of a mutable call site which introduces a + * state variable into a method handle chain. + *

        +MutableCallSite name = new MutableCallSite(MethodType.methodType(String.class));
        +MethodHandle MH_name = name.dynamicInvoker();
        +MethodType MT_str2 = MethodType.methodType(String.class, String.class);
        +MethodHandle MH_upcase = MethodHandles.lookup()
        +    .findVirtual(String.class, "toUpperCase", MT_str2);
        +MethodHandle worker1 = MethodHandles.filterReturnValue(MH_name, MH_upcase);
        +name.setTarget(MethodHandles.constant(String.class, "Rocky"));
        +assertEquals("ROCKY", (String) worker1.invokeExact());
        +name.setTarget(MethodHandles.constant(String.class, "Fred"));
        +assertEquals("FRED", (String) worker1.invokeExact());
        +// (mutation can be continued indefinitely)
        + * 
        + *

        + * The same call site may be used in several places at once. + *

        +MethodHandle MH_dear = MethodHandles.lookup()
        +    .findVirtual(String.class, "concat", MT_str2).bindTo(", dear?");
        +MethodHandle worker2 = MethodHandles.filterReturnValue(MH_name, MH_dear);
        +assertEquals("Fred, dear?", (String) worker2.invokeExact());
        +name.setTarget(MethodHandles.constant(String.class, "Wilma"));
        +assertEquals("WILMA", (String) worker1.invokeExact());
        +assertEquals("Wilma, dear?", (String) worker2.invokeExact());
        + * 
        + *

        + * Non-synchronization of target values: + * A write to a mutable call site's target does not force other threads + * to become aware of the updated value. Threads which do not perform + * suitable synchronization actions relative to the updated call site + * may cache the old target value and delay their use of the new target + * value indefinitely. + * (This is a normal consequence of the Java Memory Model as applied + * to object fields.) + *

        + * The {@link #sync sync} operation provides a way to force threads + * to accept a new target value, even if there is no other synchronization. + *

        + * For target values which will be frequently updated, consider using + * a {@linkplain VolatileCallSite volatile call site} instead. + * @author John Rose, JSR 292 EG + */ +public class MutableCallSite extends CallSite { + /** + * Make a blank call site object with the given method type. + * An initial target method is supplied which will throw + * an {@link IllegalStateException} if called. + *

        + * Before this {@code CallSite} object is returned from a bootstrap method, + * it is usually provided with a more useful target method, + * via a call to {@link CallSite#setTarget(MethodHandle) setTarget}. + * @throws NullPointerException if the proposed type is null + */ + public MutableCallSite(MethodType type) { + super(type); + } + + /** + * Make a blank call site object, possibly equipped with an initial target method handle. + * @param target the method handle which will be the initial target of the call site + * @throws NullPointerException if the proposed target is null + */ + public MutableCallSite(MethodHandle target) { + super(target); + } + + /** + * Perform a synchronization operation on each call site in the given array, + * forcing all other threads to throw away any cached values previously + * loaded from the target of any of the call sites. + *

        + * This operation does not reverse any calls that have already started + * on an old target value. + * (Java supports {@linkplain java.lang.Object#wait() forward time travel} only.) + *

        + * The overall effect is to force all future readers of each call site's target + * to accept the most recently stored value. + * ("Most recently" is reckoned relative to the {@code sync} itself.) + * Conversely, the {@code sync} call may block until all readers have + * (somehow) decached all previous versions of each call site's target. + *

        + * To avoid race conditions, calls to {@code setTarget} and {@code sync} + * should generally be performed under some sort of mutual exclusion. + * Note that reader threads may observe an updated target as early + * as the {@code setTarget} call that install the value + * (and before the {@code sync} that confirms the value). + * On the other hand, reader threads may observe previous versions of + * the target until the {@code sync} call returns + * (and after the {@code setTarget} that attempts to convey the updated version). + *

        + * In terms of the Java Memory Model, this operation performs a synchronization + * action which is comparable in effect to the writing of a volatile variable + * by the current thread, and an eventual volatile read by every other thread + * that may access one of the affected call sites. + *

        + * The following effects are apparent, for each individual call site {@code S}: + *

          + *
        • A new volatile variable {@code V} is created, and written by the current thread. + * As defined by the JMM, this write is a global synchronization event. + *
        • As is normal with thread-local ordering of write events, + * every action already performed by the current thread is + * taken to happen before the volatile write to {@code V}. + * (In some implementations, this means that the current thread + * performs a global release operation.) + *
        • Specifically, the write to the current target of {@code S} is + * taken to happen before the volatile write to {@code V}. + *
        • The volatile write to {@code V} is placed + * (in an implementation specific manner) + * in the global synchronization order. + *
        • Consider an arbitrary thread {@code T} (other than the current thread). + * If {@code T} executes a synchronization action {@code A} + * after the volatile write to {@code V} (in the global synchronization order), + * it is therefore required to see either the current target + * of {@code S}, or a later write to that target, + * if it executes a read on the target of {@code S}. + * (This constraint is called "synchronization-order consistency".) + *
        • The JMM specifically allows optimizing compilers to elide + * reads or writes of variables that are known to be useless. + * Such elided reads and writes have no effect on the happens-before + * relation. Regardless of this fact, the volatile {@code V} + * will not be elided, even though its written value is + * indeterminate and its read value is not used. + *
        + * Because of the last point, the implementation behaves as if a + * volatile read of {@code V} were performed by {@code T} + * immediately after its action {@code A}. In the local ordering + * of actions in {@code T}, this read happens before any future + * read of the target of {@code S}. It is as if the + * implementation arbitrarily picked a read of {@code S}'s target + * by {@code T}, and forced a read of {@code V} to precede it, + * thereby ensuring communication of the new target value. + *

        + * As long as the constraints of the Java Memory Model are obeyed, + * implementations may delay the completion of a {@code sync} + * operation while other threads ({@code T} above) continue to + * use previous values of {@code S}'s target. + * However, implementations are (as always) encouraged to avoid + * livelock, and to eventually require all threads to take account + * of the updated target. + *

        + * This operation is likely to be expensive and should be used sparingly. + * If possible, it should be buffered for batch processing on sets of call sites. + *

        + * (This is a static method on a set of call sites, not a + * virtual method on a single call site, for performance reasons. + * Some implementations may incur a large fixed overhead cost + * for processing one or more synchronization operations, + * but a small incremental cost for each additional call site. + * In any case, this operation is likely to be costly, since + * other threads may have to be somehow interrupted + * in order to make them notice the updated target value. + * However, it may be observed that a single call to synchronize + * several sites has the same formal effect as many calls, + * each on just one of the sites.) + *

        + * Simple implementations of {@code MutableCallSite} may use + * a volatile variable for the target of a mutable call site. + * In such an implementation, the {@code sync} method can be a no-op, + * and yet it will conform to the JMM behavior documented above. + */ + public static void sync(MutableCallSite[] sites) { + STORE_BARRIER.lazySet(0); + // FIXME: NYI + } + private static final AtomicInteger STORE_BARRIER = new AtomicInteger(); +} diff --git a/jdk/src/share/classes/java/dyn/NoAccessException.java b/jdk/src/share/classes/java/dyn/NoAccessException.java index 6b2fbcebcae..89c1a52af2a 100644 --- a/jdk/src/share/classes/java/dyn/NoAccessException.java +++ b/jdk/src/share/classes/java/dyn/NoAccessException.java @@ -37,7 +37,7 @@ package java.dyn; * @author John Rose, JSR 292 EG * @since 1.7 */ -public class NoAccessException extends RuntimeException { +public class NoAccessException extends ReflectiveOperationException { private static final long serialVersionUID = 292L; /** diff --git a/jdk/src/share/classes/java/dyn/Switcher.java b/jdk/src/share/classes/java/dyn/Switcher.java new file mode 100644 index 00000000000..b0838764b44 --- /dev/null +++ b/jdk/src/share/classes/java/dyn/Switcher.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.dyn; + +/** + *

        + * A {@code Switcher} is an object which can publish state transitions to other threads. + * A switcher is initially in the valid state, but may at any time be + * changed to the invalid state. Invalidation cannot be reversed. + *

        + * A single switcher may be used to create any number of guarded method handle pairs. + * Each guarded pair is wrapped in a new method handle {@code M}, + * which is permanently associated with the switcher that created it. + * Each pair consists of a target {@code T} and a fallback {@code F}. + * While the switcher is valid, invocations to {@code M} are delegated to {@code T}. + * After it is invalidated, invocations are delegated to {@code F}. + *

        + * Invalidation is global and immediate, as if the switcher contained a + * volatile boolean variable consulted on every call to {@code M}. + * The invalidation is also permanent, which means the switcher + * can change state only once. + *

        + * Here is an example of a switcher in action: + *

        +MethodType MT_str2 = MethodType.methodType(String.class, String.class);
        +MethodHandle MH_strcat = MethodHandles.lookup()
        +    .findVirtual(String.class, "concat", MT_str2);
        +Switcher switcher = new Switcher();
        +// the following steps may be repeated to re-use the same switcher:
        +MethodHandle worker1 = strcat;
        +MethodHandle worker2 = MethodHandles.permuteArguments(strcat, MT_str2, 1, 0);
        +MethodHandle worker = switcher.guardWithTest(worker1, worker2);
        +assertEquals("method", (String) worker.invokeExact("met", "hod"));
        +switcher.invalidate();
        +assertEquals("hodmet", (String) worker.invokeExact("met", "hod"));
        + * 
        + *

        + * Implementation Note: + * A switcher behaves as if implemented on top of {@link MutableCallSite}, + * approximately as follows: + *

        +public class Switcher {
        +  private static final MethodHandle
        +    K_true  = MethodHandles.constant(boolean.class, true),
        +    K_false = MethodHandles.constant(boolean.class, false);
        +  private final MutableCallSite mcs;
        +  private final MethodHandle mcsInvoker;
        +  public Switcher() {
        +    this.mcs = new MutableCallSite(K_true);
        +    this.mcsInvoker = mcs.dynamicInvoker();
        +  }
        +  public MethodHandle guardWithTest(
        +                MethodHandle target, MethodHandle fallback) {
        +    // Note:  mcsInvoker is of type boolean().
        +    // Target and fallback may take any arguments, but must have the same type.
        +    return MethodHandles.guardWithTest(this.mcsInvoker, target, fallback);
        +  }
        +  public static void invalidateAll(Switcher[] switchers) {
        +    List mcss = new ArrayList<>();
        +    for (Switcher s : switchers)  mcss.add(s.mcs);
        +    for (MutableCallSite mcs : mcss)  mcs.setTarget(K_false);
        +    MutableCallSite.sync(mcss.toArray(new MutableCallSite[0]));
        +  }
        +}
        + * 
        + * @author Remi Forax, JSR 292 EG + */ +public class Switcher { + private static final MethodHandle + K_true = MethodHandles.constant(boolean.class, true), + K_false = MethodHandles.constant(boolean.class, false); + + private final MutableCallSite mcs; + private final MethodHandle mcsInvoker; + + /** Create a switcher. */ + public Switcher() { + this.mcs = new MutableCallSite(K_true); + this.mcsInvoker = mcs.dynamicInvoker(); + } + + /** + * Return a method handle which always delegates either to the target or the fallback. + * The method handle will delegate to the target exactly as long as the switcher is valid. + * After that, it will permanently delegate to the fallback. + *

        + * The target and fallback must be of exactly the same method type, + * and the resulting combined method handle will also be of this type. + * @see MethodHandles#guardWithTest + */ + public MethodHandle guardWithTest(MethodHandle target, MethodHandle fallback) { + if (mcs.getTarget() == K_false) + return fallback; // already invalid + return MethodHandles.guardWithTest(mcsInvoker, target, fallback); + } + + /** Set all of the given switchers into the invalid state. */ + public static void invalidateAll(Switcher[] switchers) { + MutableCallSite[] sites = new MutableCallSite[switchers.length]; + int fillp = 0; + for (Switcher switcher : switchers) { + sites[fillp++] = switcher.mcs; + switcher.mcs.setTarget(K_false); + } + MutableCallSite.sync(sites); + } +} diff --git a/jdk/src/share/classes/java/dyn/VolatileCallSite.java b/jdk/src/share/classes/java/dyn/VolatileCallSite.java new file mode 100644 index 00000000000..8c603b91915 --- /dev/null +++ b/jdk/src/share/classes/java/dyn/VolatileCallSite.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.dyn; + +import java.util.List; + +/** + * A {@code VolatileCallSite} is a {@link CallSite} whose target acts like a volatile variable. + * An {@code invokedynamic} instruction linked to a {@code VolatileCallSite} sees updates + * to its call site target immediately, even if the update occurs in another thread. + * There may be a performance penalty for such tight coupling between threads. + *

        + * Unlike {@code MutableCallSite}, there is no + * {@linkplain MutableCallSite#sync sync operation} on volatile + * call sites, since every write to a volatile variable is implicitly + * synchronized with reader threads. + *

        + * In other respects, a {@code VolatileCallSite} is interchangeable + * with {@code MutableCallSite}. + * @see MutableCallSite + * @author John Rose, JSR 292 EG + */ +public class VolatileCallSite extends CallSite { + /** Create a call site with a volatile target. + * The initial target is set to a method handle + * of the given type which will throw {@code IllegalStateException}. + * @throws NullPointerException if the proposed type is null + */ + public VolatileCallSite(MethodType type) { + super(type); + } + + /** Create a call site with a volatile target. + * The target is set to the given value. + * @throws NullPointerException if the proposed target is null + */ + public VolatileCallSite(MethodHandle target) { + super(target); + } + + /** Internal override to nominally final getTarget. */ + @Override + MethodHandle getTarget0() { + return getTargetVolatile(); + } + + /** + * Set the target method of this call site, as a volatile variable. + * Has the same effect as {@link CallSite#setTarget CallSite.setTarget}, with the additional + * effects associated with volatiles, in the Java Memory Model. + */ + @Override public void setTarget(MethodHandle newTarget) { + checkTargetChange(getTargetVolatile(), newTarget); + setTargetVolatile(newTarget); + } +} diff --git a/jdk/src/share/classes/java/dyn/package-info.java b/jdk/src/share/classes/java/dyn/package-info.java index 7a285b75d22..d2fa14ffc9f 100644 --- a/jdk/src/share/classes/java/dyn/package-info.java +++ b/jdk/src/share/classes/java/dyn/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +24,6 @@ */ /** - * PROVISIONAL API, WORK IN PROGRESS: * This package contains dynamic language support provided directly by * the Java core class libraries and virtual machine. *

        @@ -40,63 +39,106 @@ * The JVM links any such call (regardless of signature) to a dynamically * typed method handle invocation. In the case of {@code invokeGeneric}, * argument and return value conversions are applied. - * - *

      • In source code, the class {@link java.dyn.InvokeDynamic} appears to accept - * any static method invocation, of any name and any signature. - * But instead of emitting - * an {@code invokestatic} instruction for such a call, the Java compiler emits - * an {@code invokedynamic} instruction with the given name and signature. - * - *
      • When the JVM links an {@code invokedynamic} instruction, it calls the - * {@linkplain java.dyn.Linkage#registerBootstrapMethod(Class, MethodHandle) bootstrap method} - * of the containing class to obtain a {@linkplain java.dyn.CallSite call site} object through which - * the call site will link its target {@linkplain java.dyn.MethodHandle method handle}. + *
      • * *
      • The JVM bytecode format supports immediate constants of - * the classes {@link java.dyn.MethodHandle} and {@link java.dyn.MethodType}. + * the classes {@link java.dyn.MethodHandle MethodHandle} and {@link java.dyn.MethodType MethodType}. + *
      • *
      * *

      Corresponding JVM bytecode format changes

      * The following low-level information is presented here as a preview of - * changes being made to the Java Virtual Machine specification for JSR 292. + * changes being made to the Java Virtual Machine specification for JSR 292. + * This information will be incorporated in a future version of the JVM specification. * - *

      {@code invokedynamic} instruction format

      + *

      {@code invokedynamic} instruction format

      * In bytecode, an {@code invokedynamic} instruction is formatted as five bytes. * The first byte is the opcode 186 (hexadecimal {@code BA}). * The next two bytes are a constant pool index (in the same format as for the other {@code invoke} instructions). * The final two bytes are reserved for future use and required to be zero. - * The constant pool reference is to a entry with tag {@code CONSTANT_NameAndType} - * (decimal 12). It is thus not a method reference of any sort, but merely - * the method name, argument types, and return type of the dynamic call site. - * (TBD: The EG is discussing the possibility of a special constant pool entry type, - * so that other information may be added, such as a per-instruction bootstrap - * method and/or annotations.) + * The constant pool reference of an {@code invokedynamic} instruction is to a entry + * with tag {@code CONSTANT_InvokeDynamic} (decimal 18). See below for its format. + * (The tag value 17 is also temporarily allowed. See below.) + * The entry specifies the following information: + *
        + *
      • a bootstrap method (a {@link java.dyn.MethodHandle MethodHandle} constant)
      • + *
      • the dynamic invocation name (a UTF8 string)
      • + *
      • the argument and return types of the call (encoded as a signature in a UTF8 string)
      • + *
      • optionally, a sequence of additional static arguments to the bootstrap method ({@code ldc}-type constants)
      • + *
      + *

      + * Each instance of an {@code invokedynamic} instruction is called a dynamic call site. + * Multiple instances of an {@code invokedynamic} instruction can share a single + * {@code CONSTANT_InvokeDynamic} entry. + * In any case, distinct call sites always have distinct linkage state. + *

      + * A dynamic call site is originally in an unlinked state. In this state, there is + * no target method for the call site to invoke. + * A dynamic call site is linked by means of a bootstrap method, + * as described below. * - *

      constant pool entries for {@code MethodType}s

      + *

      + * (Historic Note: Some older JVMs may allow the index of a {@code CONSTANT_NameAndType} + * instead of a {@code CONSTANT_InvokeDynamic}. In earlier, obsolete versions of this API, the + * bootstrap method was specified dynamically, in a per-class basis, during class initialization.) + * + *

      constant pool entries for {@code invokedynamic} instructions

      + * If a constant pool entry has the tag {@code CONSTANT_InvokeDynamic} (decimal 18), + * it must contain exactly four more bytes after the tag. + * These bytes are interpreted as two 16-bit indexes, in the usual {@code u2} format. + * The first pair of bytes after the tag must be an index into a side table called the + * bootstrap method table, which is stored in the {@code BootstrapMethods} + * attribute as described below. + * The second pair of bytes must be an index to a {@code CONSTANT_NameAndType}. + * This table is not part of the constant pool. Instead, it is stored + * in a class attribute named {@code BootstrapMethods}, described below. + *

      + * The first index specifies a bootstrap method used by the associated dynamic call sites. + * The second index specifies the method name, argument types, and return type of the dynamic call site. + * The structure of such an entry is therefore analogous to a {@code CONSTANT_Methodref}, + * except that the bootstrap method specifier reference replaces + * the {@code CONSTANT_Class} reference of a {@code CONSTANT_Methodref} entry. + *

      + * Some older JVMs may allow an older constant pool entry tag of decimal 17. + * The format and behavior of a constant pool entry with this tag is identical to + * an entry with a tag of decimal 18, except that the first index refers directly + * to a {@code CONSTANT_MethodHandle} to use as the bootstrap method. + * This format does not require the bootstrap method table. + * + *

      + * (Note: The Proposed Final Draft of this specification is likely to support + * only the tag 18, not the tag 17.) + * + *

      constant pool entries for {@linkplain java.dyn.MethodType method types}

      * If a constant pool entry has the tag {@code CONSTANT_MethodType} (decimal 16), - * it must contain exactly two more bytes, which are an index to a {@code CONSTANT_Utf8} - * entry which represents a method type signature. The JVM will ensure that on first - * execution of an {@code ldc} instruction for this entry, a {@link java.dyn.MethodType} + * it must contain exactly two more bytes, which must be an index to a {@code CONSTANT_Utf8} + * entry which represents a method type signature. + *

      + * The JVM will ensure that on first + * execution of an {@code ldc} instruction for this entry, a {@link java.dyn.MethodType MethodType} * will be created which represents the signature. * Any classes mentioned in the {@code MethodType} will be loaded if necessary, * but not initialized. * Access checking and error reporting is performed exactly as it is for * references by {@code ldc} instructions to {@code CONSTANT_Class} constants. * - *

      constant pool entries for {@code MethodHandle}s

      + *

      constant pool entries for {@linkplain java.dyn.MethodHandle method handles}

      * If a constant pool entry has the tag {@code CONSTANT_MethodHandle} (decimal 15), * it must contain exactly three more bytes. The first byte after the tag is a subtag - * value in the range 1 through 9, and the last two are an index to a + * value which must be in the range 1 through 9, and the last two must be an index to a * {@code CONSTANT_Fieldref}, {@code CONSTANT_Methodref}, or * {@code CONSTANT_InterfaceMethodref} entry which represents a field or method * for which a method handle is to be created. + * Furthermore, the subtag value and the type of the constant index value + * must agree according to the table below. + *

      * The JVM will ensure that on first execution of an {@code ldc} instruction - * for this entry, a {@link java.dyn.MethodHandle} will be created which represents + * for this entry, a {@link java.dyn.MethodHandle MethodHandle} will be created which represents * the field or method reference, according to the specific mode implied by the subtag. *

      * As with {@code CONSTANT_Class} and {@code CONSTANT_MethodType} constants, * the {@code Class} or {@code MethodType} object which reifies the field or method's - * type is created. Any classes mentioned in this reificaiton will be loaded if necessary, + * type is created. Any classes mentioned in this reification will be loaded if necessary, * but not initialized, and access checking and error reporting performed as usual. *

      * The method handle itself will have a type and behavior determined by the subtag as follows: @@ -115,16 +157,308 @@ * * *

      - * The special names {@code } and {@code } are not allowed except for subtag 8 as shown. + * The special name {@code } is not allowed. + * The special name {@code } is not allowed except for subtag 8 as shown. *

      - * The verifier applies the same access checks and restrictions for these references as for the hypothetical + * The JVM verifier and linker apply the same access checks and restrictions for these references as for the hypothetical * bytecode instructions specified in the last column of the table. In particular, method handles to * private and protected members can be created in exactly those classes for which the corresponding * normal accesses are legal. *

      - * None of these constant types force class initialization. - * Method handles for subtags {@code REF_getStatic}, {@code REF_putStatic}, and {@code REF_invokeStatic} + * A constant may refer to a method or constructor with the {@code varargs} + * bit (hexadecimal {@code 80}) set in its modifier bitmask. + * The method handle constant produced for such a method behaves the same + * as if the {@code varargs} bit were not set. + * The argument-collecting behavior of {@code varargs} can be emulated by + * adapting the method handle constant with + * {@link java.dyn.MethodHandle#asCollector asCollector}. + * There is no provision for doing this automatically. + *

      + * Although the {@code CONSTANT_MethodHandle} and {@code CONSTANT_MethodType} constant types + * resolve class names, they do not force class initialization. + * Method handle constants for subtags {@code REF_getStatic}, {@code REF_putStatic}, and {@code REF_invokeStatic} * may force class initialization on their first invocation, just like the corresponding bytecodes. + *

      + * The rules of section 5.4.3 of the + * JVM Specification + * apply to the resolution of {@code CONSTANT_MethodType}, {@code CONSTANT_MethodHandle}, + * and {@code CONSTANT_InvokeDynamic} constants, + * by the execution of {@code invokedynamic} and {@code ldc} instructions. + * (Roughly speaking, this means that every use of a constant pool entry + * must lead to the same outcome. + * If the resoultion succeeds, the same object reference is produced + * by every subsequent execution of the same instruction. + * If the resolution of the constant causes an error to occur, + * the same error will be re-thrown on every subsequent attempt + * to use this particular constant.) + *

      + * Constants created by the resolution of these constant pool types are not necessarily + * interned. Except for {@link CONSTANT_Class} and {@link CONSTANT_String} entries, + * two distinct constant pool entries might not resolve to the same reference + * even if they contain the same symbolic reference. + * + *

      Bootstrap Methods

      + * Before the JVM can execute a dynamic call site (an {@code invokedynamic} instruction), + * the call site must first be linked. + * Linking is accomplished by calling a bootstrap method + * which is given the static information content of the call site, + * and which must produce a {@link java.dyn.MethodHandle method handle} + * that gives the behavior of the call site. + *

      + * Each {@code invokedynamic} instruction statically specifies its own + * bootstrap method as a constant pool reference. + * The constant pool reference also specifies the call site's name and type signature, + * just like {@code invokevirtual} and the other invoke instructions. + *

      + * Linking starts with resolving the constant pool entry for the + * bootstrap method, and resolving a {@link java.dyn.MethodType MethodType} object for + * the type signature of the dynamic call site. + * This resolution process may trigger class loading. + * It may therefore throw an error if a class fails to load. + * This error becomes the abnormal termination of the dynamic + * call site execution. + * Linkage does not trigger class initialization. + *

      + * Next, the bootstrap method call is started, with four or five values being stacked: + *

        + *
      • a {@code MethodHandle}, the resolved bootstrap method itself
      • + *
      • a {@code MethodHandles.Lookup}, a lookup object on the caller class in which dynamic call site occurs
      • + *
      • a {@code String}, the method name mentioned in the call site
      • + *
      • a {@code MethodType}, the resolved type signature of the call
      • + *
      • optionally, a single object representing one or more additional static arguments
      • + *
      + * The method handle is then applied to the other values as if by + * {@link java.dyn.MethodHandle#invokeGeneric invokeGeneric}. + * The returned result must be a {@link java.dyn.CallSite CallSite} (or a subclass). + * The type of the call site's target must be exactly equal to the type + * derived from the dynamic call site signature and passed to + * the bootstrap method. + * The call site then becomes permanently linked to the dynamic call site. + *

      + * As long as each bootstrap method can be correctly invoked + * by invokeGeneric, its detailed type is arbitrary. + * For example, the first argument could be {@code Object} + * instead of {@code MethodHandles.Lookup}, and the return type + * could also be {@code Object} instead of {@code CallSite}. + *

      + * As with any method handle constant, a {@code varargs} modifier bit + * on the bootstrap method is ignored. + *

      + * Note that the first argument of the bootstrap method cannot be + * a simple {@code Class} reference. (This is a change from earlier + * versions of this specification. If the caller class is needed, + * it is easy to {@linkplain java.dyn.MethodHandles.Lookup#lookupClass() extract it} + * from the {@code Lookup} object.) + *

      + * After resolution, the linkage process may fail in a variety of ways. + * All failures are reported by an {@link java.dyn.InvokeDynamicBootstrapError InvokeDynamicBootstrapError}, + * which is thrown as the abnormal termination of the dynamic call + * site execution. + * The following circumstances will cause this: + *

        + *
      • the index to the bootstrap method specifier is out of range
      • + *
      • the bootstrap method cannot be resolved
      • + *
      • the {@code MethodType} to pass to the bootstrap method cannot be resolved
      • + *
      • a static argument to the bootstrap method cannot be resolved + * (i.e., a {@code CONSTANT_Class}, {@code CONSTANT_MethodType}, + * or {@code CONSTANT_MethodHandle} argument cannot be linked)
      • + *
      • the bootstrap method has the wrong arity, + * causing {@code invokeGeneric} to throw {@code WrongMethodTypeException}
      • + *
      • the bootstrap method has a wrong argument or return type
      • + *
      • the bootstrap method invocation completes abnormally
      • + *
      • the result from the bootstrap invocation is not a reference to + * an object of type {@link java.dyn.CallSite CallSite}
      • + *
      • the target of the {@code CallSite} does not have a target of + * the expected {@code MethodType}
      • + *
      + * + *

      timing of linkage

      + * A dynamic call site is linked just before its first execution. + * The bootstrap method call implementing the linkage occurs within + * a thread that is attempting a first execution. + *

      + * If there are several such threads, the bootstrap method may be + * invoked in several threads concurrently. + * Therefore, bootstrap methods which access global application + * data must take the usual precautions against race conditions. + * In any case, every {@code invokedynamic} instruction is either + * unlinked or linked to a unique {@code CallSite} object. + *

      + * In an application which requires dynamic call sites with individually + * mutable behaviors, their bootstrap methods should produce distinct + * {@link java.dyn.CallSite CallSite} objects, one for each linkage request. + * Alternatively, an application can link a single {@code CallSite} object + * to several {@code invokedynamic} instructions, in which case + * a change to the target method will become visible at each of + * the instructions. + *

      + * If several threads simultaneously execute a bootstrap method for a single dynamic + * call site, the JVM must choose one {@code CallSite} object and install it visibly to + * all threads. Any other bootstrap method calls are allowed to complete, but their + * results are ignored, and their dynamic call site invocations proceed with the originally + * chosen target object. + * + *

      + * (Historic Note: Unlike some previous versions of this specification, + * these rules do not enable the JVM to duplicate dynamic call sites, + * or to issue “causeless” bootstrap method calls. + * Every dynamic call site transitions at most once from unlinked to linked, + * just before its first invocation.) + * + *

      the {@code BootstrapMethods} attribute

      + * Each {@code CONSTANT_InvokeDynamic} entry contains an index which references + * a bootstrap method specifier; all such specifiers are contained in a separate array. + * This array is defined by a class attribute named {@code BootstrapMethods}. + * The body of this attribute consists of a sequence of byte pairs, all interpreted as + * as 16-bit counts or constant pool indexes, in the {@code u2} format. + * The attribute body starts with a count of bootstrap method specifiers, + * which is immediately followed by the sequence of specifiers. + *

      + * Each bootstrap method specifier contains an index to a + * {@code CONSTANT_MethodHandle} constant, which is the bootstrap + * method itself. + * This is followed by a count, and then a sequence (perhaps empty) of + * indexes to additional static arguments + * for the bootstrap method. + *

      + * During class loading, the verifier must check the structure of the + * {@code BootstrapMethods} attribute. In particular, each constant + * pool index must be of the correct type. A bootstrap method index + * must refer to a {@code CONSTANT_MethodHandle} (tag 15). + * Every other index must refer to a valid operand of an + * {@code ldc_w} or {@code ldc2_w} instruction (tag 3..8 or 15..16). + * + *

      static arguments to the bootstrap method

      + * An {@code invokedynamic} instruction specifies at least three arguments + * to pass to its bootstrap method: + * The caller class (expressed as a {@link java.dyn.MethodHandles.Lookup Lookup object}, + * the name (extracted from the {@code CONSTANT_NameAndType} entry), + * and the type (also extracted from the {@code CONSTANT_NameAndType} entry). + * The {@code invokedynamic} instruction may specify additional metadata values + * to pass to its bootstrap method. + * Collectively, these values are called static arguments to the + * {@code invokedynamic} instruction, because they are used once at link + * time to determine the instruction's behavior on subsequent sets of + * dynamic arguments. + *

      + * Static arguments are used to communicate application-specific meta-data + * to the bootstrap method. + * Drawn from the constant pool, they may include references to classes, method handles, + * strings, or numeric data that may be relevant to the task of linking that particular call site. + *

      + * Static arguments are specified constant pool indexes stored in the {@code BootstrapMethods} attribute. + * Before the bootstrap method is invoked, each index is used to compute an {@code Object} + * reference to the indexed value in the constant pool. + * If the value is a primitive type, it is converted to a reference by boxing conversion. + * The valid constant pool entries are listed in this table: + * + * + * + * + * + * + * + * + * + * + * + *
      entry typeargument typeargument value
      CONSTANT_Stringjava.lang.Stringthe indexed string literal
      CONSTANT_Classjava.lang.Classthe indexed class, resolved
      CONSTANT_Integerjava.lang.Integerthe indexed int value
      CONSTANT_Longjava.lang.Longthe indexed long value
      CONSTANT_Floatjava.lang.Floatthe indexed float value
      CONSTANT_Doublejava.lang.Doublethe indexed double value
      CONSTANT_MethodHandlejava.dyn.MethodHandlethe indexed method handle constant
      CONSTANT_MethodTypejava.dyn.MethodTypethe indexed method type constant
      + *
      + *

      + * If a given {@code invokedynamic} instruction specifies no static arguments, + * the instruction's bootstrap method will be invoked on three arguments, + * conveying the instruction's caller class, name, and method type. + * If the {@code invokedynamic} instruction specifies one or more static arguments, + * a fourth argument will be passed to the bootstrap argument, + * either an {@code Object} reference to the sole extra argument (if there is one) + * or an {@code Object} array of references to all the arguments (if there are two or more), + * as if the bootstrap method is a variable-arity method. + * + * + * + * + * + * + *
      Nsample bootstrap method
      0CallSite bootstrap(Lookup caller, String name, MethodType type)
      1CallSite bootstrap(Lookup caller, String name, MethodType type, Object arg)
      2CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)
      + *
      + *

      + * The argument and return types listed here are used by the {@code invokeGeneric} + * call to the bootstrap method. + * As noted above, the actual method type of the bootstrap method can vary. + * For example, the fourth argument could be {@code MethodHandle}, + * if that is the type of the corresponding constant in + * the {@code CONSTANT_InvokeDynamic} entry. + * In that case, the {@code invokeGeneric} call will pass the extra method handle + * constant as an {@code Object}, but the type matching machinery of {@code invokeGeneric} + * will cast the reference back to {@code MethodHandle} before invoking the bootstrap method. + * (If a string constant were passed instead, by badly generated code, that cast would then fail.) + *

      + * If the fourth argument is an array, the array element type must be {@code Object}, + * since object arrays (as produced by the JVM at this point) cannot be converted + * to other array types. + *

      + * If an array is provided, it will appear to be freshly allocated. + * That is, the same array will not appear to two bootstrap method calls. + *

      + * Extra bootstrap method arguments are intended to allow language implementors + * to safely and compactly encode metadata. + * In principle, the name and extra arguments are redundant, + * since each call site could be given its own unique bootstrap method. + * Such a practice is likely to produce large class files and constant pools. + * + *

      + * PROVISIONAL API, WORK IN PROGRESS: + * (Usage Note: There is no mechanism for specifying five or more positional arguments to the bootstrap method. + * If there are two or more arguments, the Java code of the bootstrap method is required to extract them from + * a varargs-style object array. + * This design uses varargs because it anticipates some use cases where bootstrap arguments + * contribute components of variable-length structures, such as virtual function tables + * or interpreter token streams. + * Such parameters would be awkward or impossible to manage if represented + * as normal positional method arguments, + * since there would need to be one Java method per length. + * On balance, leaving out the varargs feature would cause more trouble to users than keeping it. + * Also, this design allows bootstrap methods to be called in a limited JVM stack depth. + * At both the user and JVM level, the difference between varargs and non-varargs + * calling sequences can easily be bridged via the + * {@link java.dyn.MethodHandle#asSpreader asSpreader} + * and {@link java.dyn.MethodHandle#asSpreader asCollector} methods.) + * + *

      Structure Summary

      + *
      // summary of constant and attribute structures
      +struct CONSTANT_MethodHandle_info {
      +  u1 tag = 15;
      +  u1 reference_kind;       // 1..8 (one of REF_invokeVirtual, etc.)
      +  u2 reference_index;      // index to CONSTANT_Fieldref or *Methodref
      +}
      +struct CONSTANT_MethodType_info {
      +  u1 tag = 16;
      +  u2 descriptor_index;    // index to CONSTANT_Utf8, as in NameAndType
      +}
      +struct CONSTANT_InvokeDynamic_17_info {
      +  u1 tag = 17;
      +  u2 bootstrap_method_index;   // index to CONSTANT_MethodHandle
      +  u2 name_and_type_index;      // same as for CONSTANT_Methodref, etc.
      +}
      +struct CONSTANT_InvokeDynamic_info {
      +  u1 tag = 18;
      +  u2 bootstrap_method_attr_index;  // index into BootstrapMethods_attr
      +  u2 name_and_type_index;          // index to CONSTANT_NameAndType, as in Methodref
      +}
      +struct BootstrapMethods_attr {
      + u2 name;  // CONSTANT_Utf8 = "BootstrapMethods"
      + u4 size;
      + u2 bootstrap_method_count;
      + struct bootstrap_method_specifier {
      +   u2 bootstrap_method_ref;  // index to CONSTANT_MethodHandle
      +   u2 bootstrap_argument_count;
      +   u2 bootstrap_arguments[bootstrap_argument_count];  // constant pool indexes
      + } bootstrap_methods[bootstrap_method_count];
      +}
      + * 
      + *

      + * Note: The Proposed Final Draft of JSR 292 may remove the constant tag 17, + * for the sake of simplicity. * * @author John Rose, JSR 292 EG */ diff --git a/jdk/src/share/classes/java/io/Bits.java b/jdk/src/share/classes/java/io/Bits.java index 3554c4fe268..5563e6652e4 100644 --- a/jdk/src/share/classes/java/io/Bits.java +++ b/jdk/src/share/classes/java/io/Bits.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/java/io/BufferedInputStream.java b/jdk/src/share/classes/java/io/BufferedInputStream.java index d61f74bcbd3..fcc7e702db6 100644 --- a/jdk/src/share/classes/java/io/BufferedInputStream.java +++ b/jdk/src/share/classes/java/io/BufferedInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -395,7 +395,11 @@ class BufferedInputStream extends FilterInputStream { * or an I/O error occurs. */ public synchronized int available() throws IOException { - return getInIfOpen().available() + (count - pos); + int n = count - pos; + int avail = getInIfOpen().available(); + return n > (Integer.MAX_VALUE - avail) + ? Integer.MAX_VALUE + : n + avail; } /** diff --git a/jdk/src/share/classes/java/io/ByteArrayInputStream.java b/jdk/src/share/classes/java/io/ByteArrayInputStream.java index 5cef38ddd6c..e58c6e64a64 100644 --- a/jdk/src/share/classes/java/io/ByteArrayInputStream.java +++ b/jdk/src/share/classes/java/io/ByteArrayInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -179,11 +179,14 @@ class ByteArrayInputStream extends InputStream { } else if (off < 0 || len < 0 || len > b.length - off) { throw new IndexOutOfBoundsException(); } + if (pos >= count) { return -1; } - if (pos + len > count) { - len = count - pos; + + int avail = count - pos; + if (len > avail) { + len = avail; } if (len <= 0) { return 0; @@ -206,14 +209,13 @@ class ByteArrayInputStream extends InputStream { * @return the actual number of bytes skipped. */ public synchronized long skip(long n) { - if (pos + n > count) { - n = count - pos; + long k = count - pos; + if (n < k) { + k = n < 0 ? 0 : n; } - if (n < 0) { - return 0; - } - pos += n; - return n; + + pos += k; + return k; } /** diff --git a/jdk/src/share/classes/java/io/ByteArrayOutputStream.java b/jdk/src/share/classes/java/io/ByteArrayOutputStream.java index 89ef67f4fbf..c4df675c937 100644 --- a/jdk/src/share/classes/java/io/ByteArrayOutputStream.java +++ b/jdk/src/share/classes/java/io/ByteArrayOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/java/io/Closeable.java b/jdk/src/share/classes/java/io/Closeable.java index 0fbb1217cd0..7f3cc8dcd0c 100644 --- a/jdk/src/share/classes/java/io/Closeable.java +++ b/jdk/src/share/classes/java/io/Closeable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/java/io/DeleteOnExitHook.java b/jdk/src/share/classes/java/io/DeleteOnExitHook.java index 8ad072d712f..2ce5c8e04dd 100644 --- a/jdk/src/share/classes/java/io/DeleteOnExitHook.java +++ b/jdk/src/share/classes/java/io/DeleteOnExitHook.java @@ -34,7 +34,7 @@ import java.io.File; */ class DeleteOnExitHook { - private static LinkedHashSet files = new LinkedHashSet(); + private static LinkedHashSet files = new LinkedHashSet<>(); static { // DeleteOnExitHook must be the last shutdown hook to be invoked. // Application shutdown hooks may add the first file to the @@ -71,7 +71,7 @@ class DeleteOnExitHook { files = null; } - ArrayList toBeDeleted = new ArrayList(theFiles); + ArrayList toBeDeleted = new ArrayList<>(theFiles); // reverse the list to maintain previous jdk deletion order. // Last in first deleted. diff --git a/jdk/src/share/classes/java/io/File.java b/jdk/src/share/classes/java/io/File.java index 58a4e9c1dfe..1ff3e936bae 100644 --- a/jdk/src/share/classes/java/io/File.java +++ b/jdk/src/share/classes/java/io/File.java @@ -1067,7 +1067,7 @@ public class File if ((names == null) || (filter == null)) { return names; } - List v = new ArrayList(); + List v = new ArrayList<>(); for (int i = 0 ; i < names.length ; i++) { if (filter.accept(this, names[i])) { v.add(names[i]); @@ -1158,7 +1158,7 @@ public class File public File[] listFiles(FilenameFilter filter) { String ss[] = list(); if (ss == null) return null; - ArrayList files = new ArrayList(); + ArrayList files = new ArrayList<>(); for (String s : ss) if ((filter == null) || filter.accept(this, s)) files.add(new File(s, this)); @@ -1195,7 +1195,7 @@ public class File public File[] listFiles(FileFilter filter) { String ss[] = list(); if (ss == null) return null; - ArrayList files = new ArrayList(); + ArrayList files = new ArrayList<>(); for (String s : ss) { File f = new File(s, this); if ((filter == null) || filter.accept(f)) diff --git a/jdk/src/share/classes/java/io/FileInputStream.java b/jdk/src/share/classes/java/io/FileInputStream.java index bcc43d900dd..23530c19e1f 100644 --- a/jdk/src/share/classes/java/io/FileInputStream.java +++ b/jdk/src/share/classes/java/io/FileInputStream.java @@ -56,7 +56,7 @@ class FileInputStream extends InputStream private volatile boolean closed = false; private static final ThreadLocal runningFinalize = - new ThreadLocal(); + new ThreadLocal<>(); private static boolean isRunningFinalize() { Boolean val; diff --git a/jdk/src/share/classes/java/io/FileOutputStream.java b/jdk/src/share/classes/java/io/FileOutputStream.java index 71bdee89f3b..3fe3a594fd2 100644 --- a/jdk/src/share/classes/java/io/FileOutputStream.java +++ b/jdk/src/share/classes/java/io/FileOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,12 +56,20 @@ class FileOutputStream extends OutputStream */ private final FileDescriptor fd; - private FileChannel channel= null; + /** + * True if the file is opened for append. + */ + private final boolean append; + + /** + * The associated channel, initalized lazily. + */ + private FileChannel channel; private final Object closeLock = new Object(); private volatile boolean closed = false; private static final ThreadLocal runningFinalize = - new ThreadLocal(); + new ThreadLocal<>(); private static boolean isRunningFinalize() { Boolean val; @@ -196,7 +204,9 @@ class FileOutputStream extends OutputStream if (name == null) { throw new NullPointerException(); } - fd = new FileDescriptor(); + this.fd = new FileDescriptor(); + this.append = append; + fd.incrementAndGetUseCount(); open(name, append); } @@ -232,7 +242,8 @@ class FileOutputStream extends OutputStream if (security != null) { security.checkWrite(fdObj); } - fd = fdObj; + this.fd = fdObj; + this.append = false; /* * FileDescriptor is being shared by streams. @@ -250,6 +261,15 @@ class FileOutputStream extends OutputStream private native void open(String name, boolean append) throws FileNotFoundException; + /** + * Writes the specified byte to this file output stream. + * + * @param b the byte to be written. + * @param append {@code true} if the write operation first + * advances the position to the end of file + */ + private native void write(int b, boolean append) throws IOException; + /** * Writes the specified byte to this file output stream. Implements * the write method of OutputStream. @@ -257,16 +277,21 @@ class FileOutputStream extends OutputStream * @param b the byte to be written. * @exception IOException if an I/O error occurs. */ - public native void write(int b) throws IOException; + public void write(int b) throws IOException { + write(b, append); + } /** * Writes a sub array as a sequence of bytes. * @param b the data to be written * @param off the start offset in the data * @param len the number of bytes that are written + * @param append {@code true} to first advance the position to the + * end of file * @exception IOException If an I/O error has occurred. */ - private native void writeBytes(byte b[], int off, int len) throws IOException; + private native void writeBytes(byte b[], int off, int len, boolean append) + throws IOException; /** * Writes b.length bytes from the specified byte array @@ -276,7 +301,7 @@ class FileOutputStream extends OutputStream * @exception IOException if an I/O error occurs. */ public void write(byte b[]) throws IOException { - writeBytes(b, 0, b.length); + writeBytes(b, 0, b.length, append); } /** @@ -289,7 +314,7 @@ class FileOutputStream extends OutputStream * @exception IOException if an I/O error occurs. */ public void write(byte b[], int off, int len) throws IOException { - writeBytes(b, off, len); + writeBytes(b, off, len, append); } /** @@ -372,7 +397,7 @@ class FileOutputStream extends OutputStream public FileChannel getChannel() { synchronized (this) { if (channel == null) { - channel = FileChannelImpl.open(fd, false, true, this); + channel = FileChannelImpl.open(fd, false, true, append, this); /* * Increment fd's use count. Invoking the channel's close() diff --git a/jdk/src/share/classes/java/io/FilePermission.java b/jdk/src/share/classes/java/io/FilePermission.java index be847b1041f..06b4f3bb267 100644 --- a/jdk/src/share/classes/java/io/FilePermission.java +++ b/jdk/src/share/classes/java/io/FilePermission.java @@ -725,7 +725,7 @@ implements Serializable { */ public FilePermissionCollection() { - perms = new ArrayList(); + perms = new ArrayList<>(); } /** @@ -830,7 +830,7 @@ implements Serializable { // Don't call out.defaultWriteObject() // Write out Vector - Vector permissions = new Vector(perms.size()); + Vector permissions = new Vector<>(perms.size()); synchronized (this) { permissions.addAll(perms); } @@ -853,7 +853,7 @@ implements Serializable { // Get the one we want Vector permissions = (Vector)gfields.get("permissions", null); - perms = new ArrayList(permissions.size()); + perms = new ArrayList<>(permissions.size()); perms.addAll(permissions); } } diff --git a/jdk/src/share/classes/java/io/FilterInputStream.java b/jdk/src/share/classes/java/io/FilterInputStream.java index f9b7fdcf3b0..10beaea426f 100644 --- a/jdk/src/share/classes/java/io/FilterInputStream.java +++ b/jdk/src/share/classes/java/io/FilterInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/java/io/ObjectInput.java b/jdk/src/share/classes/java/io/ObjectInput.java index 3c72518205a..bc7c26b732b 100644 --- a/jdk/src/share/classes/java/io/ObjectInput.java +++ b/jdk/src/share/classes/java/io/ObjectInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/java/io/ObjectInputStream.java b/jdk/src/share/classes/java/io/ObjectInputStream.java index 3a5c1dee080..26a764f7a1e 100644 --- a/jdk/src/share/classes/java/io/ObjectInputStream.java +++ b/jdk/src/share/classes/java/io/ObjectInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -213,7 +213,7 @@ public class ObjectInputStream /** table mapping primitive type names to corresponding class objects */ private static final HashMap> primClasses - = new HashMap>(8, 1.0F); + = new HashMap<>(8, 1.0F); static { primClasses.put("boolean", boolean.class); primClasses.put("byte", byte.class); @@ -229,11 +229,11 @@ public class ObjectInputStream private static class Caches { /** cache of subclass security audit results */ static final ConcurrentMap subclassAudits = - new ConcurrentHashMap(); + new ConcurrentHashMap<>(); /** queue for WeakReferences to audited subclasses */ static final ReferenceQueue> subclassAuditsQueue = - new ReferenceQueue>(); + new ReferenceQueue<>(); } /** filter stream for handling block data conversion */ @@ -265,7 +265,7 @@ public class ObjectInputStream * object currently being deserialized and descriptor for current class. * Null when not during readObject upcall. */ - private CallbackContext curContext; + private SerialCallbackContext curContext; /** * Creates an ObjectInputStream that reads from the specified InputStream. @@ -1798,7 +1798,7 @@ public class ObjectInputStream private void readExternalData(Externalizable obj, ObjectStreamClass desc) throws IOException { - CallbackContext oldContext = curContext; + SerialCallbackContext oldContext = curContext; curContext = null; try { boolean blocked = desc.hasBlockExternalData(); @@ -1857,10 +1857,10 @@ public class ObjectInputStream slotDesc.hasReadObjectMethod() && handles.lookupException(passHandle) == null) { - CallbackContext oldContext = curContext; + SerialCallbackContext oldContext = curContext; try { - curContext = new CallbackContext(obj, slotDesc); + curContext = new SerialCallbackContext(obj, slotDesc); bin.setBlockDataMode(true); slotDesc.invokeReadObject(obj, this); @@ -3498,49 +3498,11 @@ public class ObjectInputStream return ((int[]) array).clone(); } else if (array instanceof long[]) { return ((long[]) array).clone(); - } else if (array instanceof double[]) { - return ((double[]) array).clone(); + } else if (array instanceof short[]) { + return ((short[]) array).clone(); } else { throw new AssertionError(); } } - /** - * Context that during upcalls to class-defined readObject methods; holds - * object currently being deserialized and descriptor for current class. - * This context keeps a boolean state to indicate that defaultReadObject - * or readFields has already been invoked with this context or the class's - * readObject method has returned; if true, the getObj method throws - * NotActiveException. - */ - private static class CallbackContext { - private final Object obj; - private final ObjectStreamClass desc; - private final AtomicBoolean used = new AtomicBoolean(); - - public CallbackContext(Object obj, ObjectStreamClass desc) { - this.obj = obj; - this.desc = desc; - } - - public Object getObj() throws NotActiveException { - checkAndSetUsed(); - return obj; - } - - public ObjectStreamClass getDesc() { - return desc; - } - - private void checkAndSetUsed() throws NotActiveException { - if (!used.compareAndSet(false, true)) { - throw new NotActiveException( - "not in readObject invocation or fields already read"); - } - } - - public void setUsed() { - used.set(true); - } - } } diff --git a/jdk/src/share/classes/java/io/ObjectOutput.java b/jdk/src/share/classes/java/io/ObjectOutput.java index bf55305f388..7c2cbeb5b33 100644 --- a/jdk/src/share/classes/java/io/ObjectOutput.java +++ b/jdk/src/share/classes/java/io/ObjectOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/java/io/ObjectOutputStream.java b/jdk/src/share/classes/java/io/ObjectOutputStream.java index 3a722d43a9e..76a08f38d4d 100644 --- a/jdk/src/share/classes/java/io/ObjectOutputStream.java +++ b/jdk/src/share/classes/java/io/ObjectOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,6 +35,7 @@ import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import static java.io.ObjectStreamClass.processQueue; +import java.io.SerialCallbackContext; /** * An ObjectOutputStream writes primitive data types and graphs of Java objects @@ -164,11 +165,11 @@ public class ObjectOutputStream private static class Caches { /** cache of subclass security audit results */ static final ConcurrentMap subclassAudits = - new ConcurrentHashMap(); + new ConcurrentHashMap<>(); /** queue for WeakReferences to audited subclasses */ static final ReferenceQueue> subclassAuditsQueue = - new ReferenceQueue>(); + new ReferenceQueue<>(); } /** filter stream for handling block data conversion */ @@ -191,10 +192,12 @@ public class ObjectOutputStream private boolean enableReplace; // values below valid only during upcalls to writeObject()/writeExternal() - /** object currently being serialized */ - private Object curObj; - /** descriptor for current class (null if in writeExternal()) */ - private ObjectStreamClass curDesc; + /** + * Context during upcalls to class-defined writeObject methods; holds + * object currently being serialized and descriptor for current class. + * Null when not during writeObject upcall. + */ + private SerialCallbackContext curContext; /** current PutField object */ private PutFieldImpl curPut; @@ -426,9 +429,11 @@ public class ObjectOutputStream * OutputStream */ public void defaultWriteObject() throws IOException { - if (curObj == null || curDesc == null) { + if ( curContext == null ) { throw new NotActiveException("not in call to writeObject"); } + Object curObj = curContext.getObj(); + ObjectStreamClass curDesc = curContext.getDesc(); bout.setBlockDataMode(false); defaultWriteFields(curObj, curDesc); bout.setBlockDataMode(true); @@ -446,9 +451,11 @@ public class ObjectOutputStream */ public ObjectOutputStream.PutField putFields() throws IOException { if (curPut == null) { - if (curObj == null || curDesc == null) { + if (curContext == null) { throw new NotActiveException("not in call to writeObject"); } + Object curObj = curContext.getObj(); + ObjectStreamClass curDesc = curContext.getDesc(); curPut = new PutFieldImpl(curDesc); } return curPut; @@ -1420,17 +1427,15 @@ public class ObjectOutputStream * writeExternal() method. */ private void writeExternalData(Externalizable obj) throws IOException { - Object oldObj = curObj; - ObjectStreamClass oldDesc = curDesc; PutFieldImpl oldPut = curPut; - curObj = obj; - curDesc = null; curPut = null; if (extendedDebugInfo) { debugInfoStack.push("writeExternal data"); } + SerialCallbackContext oldContext = curContext; try { + curContext = null; if (protocol == PROTOCOL_VERSION_1) { obj.writeExternal(this); } else { @@ -1440,13 +1445,12 @@ public class ObjectOutputStream bout.writeByte(TC_ENDBLOCKDATA); } } finally { + curContext = oldContext; if (extendedDebugInfo) { debugInfoStack.pop(); } } - curObj = oldObj; - curDesc = oldDesc; curPut = oldPut; } @@ -1461,12 +1465,9 @@ public class ObjectOutputStream for (int i = 0; i < slots.length; i++) { ObjectStreamClass slotDesc = slots[i].desc; if (slotDesc.hasWriteObjectMethod()) { - Object oldObj = curObj; - ObjectStreamClass oldDesc = curDesc; PutFieldImpl oldPut = curPut; - curObj = obj; - curDesc = slotDesc; curPut = null; + SerialCallbackContext oldContext = curContext; if (extendedDebugInfo) { debugInfoStack.push( @@ -1474,18 +1475,19 @@ public class ObjectOutputStream slotDesc.getName() + "\")"); } try { + curContext = new SerialCallbackContext(obj, slotDesc); bout.setBlockDataMode(true); slotDesc.invokeWriteObject(obj, this); bout.setBlockDataMode(false); bout.writeByte(TC_ENDBLOCKDATA); } finally { + curContext.setUsed(); + curContext = oldContext; if (extendedDebugInfo) { debugInfoStack.pop(); } } - curObj = oldObj; - curDesc = oldDesc; curPut = oldPut; } else { defaultWriteFields(obj, slotDesc); @@ -2411,7 +2413,7 @@ public class ObjectOutputStream private final List stack; DebugTraceInfoStack() { - stack = new ArrayList(); + stack = new ArrayList<>(); } /** diff --git a/jdk/src/share/classes/java/io/ObjectStreamClass.java b/jdk/src/share/classes/java/io/ObjectStreamClass.java index 6b54f36f4b3..74608db0c1c 100644 --- a/jdk/src/share/classes/java/io/ObjectStreamClass.java +++ b/jdk/src/share/classes/java/io/ObjectStreamClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * 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,18 +84,18 @@ public class ObjectStreamClass implements Serializable { private static class Caches { /** cache mapping local classes -> descriptors */ static final ConcurrentMap> localDescs = - new ConcurrentHashMap>(); + new ConcurrentHashMap<>(); /** cache mapping field group/local desc pairs -> field reflectors */ static final ConcurrentMap> reflectors = - new ConcurrentHashMap>(); + new ConcurrentHashMap<>(); /** queue for WeakReferences to local classes */ private static final ReferenceQueue> localDescsQueue = - new ReferenceQueue>(); + new ReferenceQueue<>(); /** queue for WeakReferences to field reflectors keys */ private static final ReferenceQueue> reflectorsQueue = - new ReferenceQueue>(); + new ReferenceQueue<>(); } /** class associated with this descriptor (if any) */ @@ -290,7 +290,7 @@ public class ObjectStreamClass implements Serializable { EntryFuture future = null; if (entry == null) { EntryFuture newEntry = new EntryFuture(); - Reference newRef = new SoftReference(newEntry); + Reference newRef = new SoftReference<>(newEntry); do { if (ref != null) { Caches.localDescs.remove(key, ref); @@ -1130,7 +1130,7 @@ public class ObjectStreamClass implements Serializable { private ClassDataSlot[] getClassDataLayout0() throws InvalidClassException { - ArrayList slots = new ArrayList(); + ArrayList slots = new ArrayList<>(); Class start = cl, end = cl; // locate closest non-serializable superclass @@ -1566,7 +1566,7 @@ public class ObjectStreamClass implements Serializable { ObjectStreamField[] boundFields = new ObjectStreamField[serialPersistentFields.length]; - Set fieldNames = new HashSet(serialPersistentFields.length); + Set fieldNames = new HashSet<>(serialPersistentFields.length); for (int i = 0; i < serialPersistentFields.length; i++) { ObjectStreamField spf = serialPersistentFields[i]; @@ -1604,7 +1604,7 @@ public class ObjectStreamClass implements Serializable { */ private static ObjectStreamField[] getDefaultSerialFields(Class cl) { Field[] clFields = cl.getDeclaredFields(); - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); int mask = Modifier.STATIC | Modifier.TRANSIENT; for (int i = 0; i < clFields.length; i++) { @@ -1830,8 +1830,10 @@ public class ObjectStreamClass implements Serializable { private final ObjectStreamField[] fields; /** number of primitive fields */ private final int numPrimFields; - /** unsafe field keys */ - private final long[] keys; + /** unsafe field keys for reading fields - may contain dupes */ + private final long[] readKeys; + /** unsafe fields keys for writing fields - no dupes */ + private final long[] writeKeys; /** field data offsets */ private final int[] offsets; /** field type codes */ @@ -1849,16 +1851,22 @@ public class ObjectStreamClass implements Serializable { FieldReflector(ObjectStreamField[] fields) { this.fields = fields; int nfields = fields.length; - keys = new long[nfields]; + readKeys = new long[nfields]; + writeKeys = new long[nfields]; offsets = new int[nfields]; typeCodes = new char[nfields]; - ArrayList> typeList = new ArrayList>(); + ArrayList> typeList = new ArrayList<>(); + Set usedKeys = new HashSet<>(); + for (int i = 0; i < nfields; i++) { ObjectStreamField f = fields[i]; Field rf = f.getField(); - keys[i] = (rf != null) ? + long key = (rf != null) ? unsafe.objectFieldOffset(rf) : Unsafe.INVALID_FIELD_OFFSET; + readKeys[i] = key; + writeKeys[i] = usedKeys.add(key) ? + key : Unsafe.INVALID_FIELD_OFFSET; offsets[i] = f.getOffset(); typeCodes[i] = f.getTypeCode(); if (!f.isPrimitive()) { @@ -1894,7 +1902,7 @@ public class ObjectStreamClass implements Serializable { * in array should be equal to Unsafe.INVALID_FIELD_OFFSET. */ for (int i = 0; i < numPrimFields; i++) { - long key = keys[i]; + long key = readKeys[i]; int off = offsets[i]; switch (typeCodes[i]) { case 'Z': @@ -1945,7 +1953,7 @@ public class ObjectStreamClass implements Serializable { throw new NullPointerException(); } for (int i = 0; i < numPrimFields; i++) { - long key = keys[i]; + long key = writeKeys[i]; if (key == Unsafe.INVALID_FIELD_OFFSET) { continue; // discard value } @@ -2006,7 +2014,7 @@ public class ObjectStreamClass implements Serializable { switch (typeCodes[i]) { case 'L': case '[': - vals[offsets[i]] = unsafe.getObject(obj, keys[i]); + vals[offsets[i]] = unsafe.getObject(obj, readKeys[i]); break; default: @@ -2027,7 +2035,7 @@ public class ObjectStreamClass implements Serializable { throw new NullPointerException(); } for (int i = numPrimFields; i < fields.length; i++) { - long key = keys[i]; + long key = writeKeys[i]; if (key == Unsafe.INVALID_FIELD_OFFSET) { continue; // discard value } @@ -2084,7 +2092,7 @@ public class ObjectStreamClass implements Serializable { EntryFuture future = null; if (entry == null) { EntryFuture newEntry = new EntryFuture(); - Reference newRef = new SoftReference(newEntry); + Reference newRef = new SoftReference<>(newEntry); do { if (ref != null) { Caches.reflectors.remove(key, ref); diff --git a/jdk/src/share/classes/java/io/PrintStream.java b/jdk/src/share/classes/java/io/PrintStream.java index 2f4168aaf78..9ed3ff6f910 100644 --- a/jdk/src/share/classes/java/io/PrintStream.java +++ b/jdk/src/share/classes/java/io/PrintStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. * 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,9 @@ package java.io; import java.util.Formatter; import java.util.Locale; - +import java.nio.charset.Charset; +import java.nio.charset.IllegalCharsetNameException; +import java.nio.charset.UnsupportedCharsetException; /** * A PrintStream adds functionality to another output stream, @@ -56,7 +58,7 @@ public class PrintStream extends FilterOutputStream implements Appendable, Closeable { - private boolean autoFlush = false; + private final boolean autoFlush; private boolean trouble = false; private Formatter formatter; @@ -67,6 +69,60 @@ public class PrintStream extends FilterOutputStream private BufferedWriter textOut; private OutputStreamWriter charOut; + /** + * nonNull is explicitly declared here so as not to create an extra + * dependency on java.util.Objects.nonNull. PrintStream is loaded + * early during system initialization. + */ + private static T nonNull(T obj, String message) { + if (obj == null) + throw new NullPointerException(message); + return obj; + } + + /** + * Returns a charset object for the given charset name. + * @throws NullPointerException is csn is null + * @throws UnsupportedEncodingException if the charset is not supported + */ + private static Charset toCharset(String csn) + throws UnsupportedEncodingException + { + nonNull(csn, "charsetName"); + try { + return Charset.forName(csn); + } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) { + // UnsupportedEncodingException should be thrown + throw new UnsupportedEncodingException(csn); + } + } + + /* Private constructors */ + private PrintStream(boolean autoFlush, OutputStream out) { + super(out); + this.autoFlush = autoFlush; + this.charOut = new OutputStreamWriter(this); + this.textOut = new BufferedWriter(charOut); + } + + private PrintStream(boolean autoFlush, OutputStream out, Charset charset) { + super(out); + this.autoFlush = autoFlush; + this.charOut = new OutputStreamWriter(this, charset); + this.textOut = new BufferedWriter(charOut); + } + + /* Variant of the private constructor so that the given charset name + * can be verified before evaluating the OutputStream argument. Used + * by constructors creating a FileOutputStream that also take a + * charset name. + */ + private PrintStream(boolean autoFlush, Charset charset, OutputStream out) + throws UnsupportedEncodingException + { + this(autoFlush, out, charset); + } + /** * Creates a new print stream. This stream will not flush automatically. * @@ -79,27 +135,6 @@ public class PrintStream extends FilterOutputStream this(out, false); } - /* Initialization is factored into a private constructor (note the swapped - * parameters so that this one isn't confused with the public one) and a - * separate init method so that the following two public constructors can - * share code. We use a separate init method so that the constructor that - * takes an encoding will throw an NPE for a null stream before it throws - * an UnsupportedEncodingException for an unsupported encoding. - */ - - private PrintStream(boolean autoFlush, OutputStream out) - { - super(out); - if (out == null) - throw new NullPointerException("Null output stream"); - this.autoFlush = autoFlush; - } - - private void init(OutputStreamWriter osw) { - this.charOut = osw; - this.textOut = new BufferedWriter(osw); - } - /** * Creates a new print stream. * @@ -113,8 +148,7 @@ public class PrintStream extends FilterOutputStream * @see java.io.PrintWriter#PrintWriter(java.io.OutputStream, boolean) */ public PrintStream(OutputStream out, boolean autoFlush) { - this(autoFlush, out); - init(new OutputStreamWriter(this)); + this(autoFlush, nonNull(out, "Null output stream")); } /** @@ -138,8 +172,9 @@ public class PrintStream extends FilterOutputStream public PrintStream(OutputStream out, boolean autoFlush, String encoding) throws UnsupportedEncodingException { - this(autoFlush, out); - init(new OutputStreamWriter(this, encoding)); + this(autoFlush, + nonNull(out, "Null output stream"), + toCharset(encoding)); } /** @@ -171,7 +206,6 @@ public class PrintStream extends FilterOutputStream */ public PrintStream(String fileName) throws FileNotFoundException { this(false, new FileOutputStream(fileName)); - init(new OutputStreamWriter(this)); } /** @@ -210,8 +244,8 @@ public class PrintStream extends FilterOutputStream public PrintStream(String fileName, String csn) throws FileNotFoundException, UnsupportedEncodingException { - this(false, new FileOutputStream(fileName)); - init(new OutputStreamWriter(this, csn)); + // ensure charset is checked before the file is opened + this(false, toCharset(csn), new FileOutputStream(fileName)); } /** @@ -243,7 +277,6 @@ public class PrintStream extends FilterOutputStream */ public PrintStream(File file) throws FileNotFoundException { this(false, new FileOutputStream(file)); - init(new OutputStreamWriter(this)); } /** @@ -282,8 +315,8 @@ public class PrintStream extends FilterOutputStream public PrintStream(File file, String csn) throws FileNotFoundException, UnsupportedEncodingException { - this(false, new FileOutputStream(file)); - init(new OutputStreamWriter(this, csn)); + // ensure charset is checked before the file is opened + this(false, toCharset(csn), new FileOutputStream(file)); } /** Check to make sure that the stream has not been closed */ diff --git a/jdk/src/share/classes/java/io/PrintWriter.java b/jdk/src/share/classes/java/io/PrintWriter.java index afce0f89d4d..16044567065 100644 --- a/jdk/src/share/classes/java/io/PrintWriter.java +++ b/jdk/src/share/classes/java/io/PrintWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. * 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,8 +25,12 @@ package java.io; +import java.util.Objects; import java.util.Formatter; import java.util.Locale; +import java.nio.charset.Charset; +import java.nio.charset.IllegalCharsetNameException; +import java.nio.charset.UnsupportedCharsetException; /** * Prints formatted representations of objects to a text-output stream. This @@ -59,7 +63,7 @@ public class PrintWriter extends Writer { */ protected Writer out; - private boolean autoFlush = false; + private final boolean autoFlush; private boolean trouble = false; private Formatter formatter; private PrintStream psOut = null; @@ -68,7 +72,24 @@ public class PrintWriter extends Writer { * Line separator string. This is the value of the line.separator * property at the moment that the stream was created. */ - private String lineSeparator; + private final String lineSeparator; + + /** + * Returns a charset object for the given charset name. + * @throws NullPointerException is csn is null + * @throws UnsupportedEncodingException if the charset is not supported + */ + private static Charset toCharset(String csn) + throws UnsupportedEncodingException + { + Objects.nonNull(csn, "charsetName"); + try { + return Charset.forName(csn); + } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) { + // UnsupportedEncodingException should be thrown + throw new UnsupportedEncodingException(csn); + } + } /** * Creates a new PrintWriter, without automatic line flushing. @@ -164,6 +185,14 @@ public class PrintWriter extends Writer { false); } + /* Private constructor */ + private PrintWriter(Charset charset, File file) + throws FileNotFoundException + { + this(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), charset)), + false); + } + /** * Creates a new PrintWriter, without automatic line flushing, with the * specified file name and charset. This convenience constructor creates @@ -200,8 +229,7 @@ public class PrintWriter extends Writer { public PrintWriter(String fileName, String csn) throws FileNotFoundException, UnsupportedEncodingException { - this(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileName), csn)), - false); + this(toCharset(csn), new File(fileName)); } /** @@ -272,8 +300,7 @@ public class PrintWriter extends Writer { public PrintWriter(File file, String csn) throws FileNotFoundException, UnsupportedEncodingException { - this(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), csn)), - false); + this(toCharset(csn), file); } /** Checks to make sure that the stream has not been closed */ diff --git a/jdk/src/share/classes/java/io/PushbackInputStream.java b/jdk/src/share/classes/java/io/PushbackInputStream.java index 1984247e575..a0e240f1d84 100644 --- a/jdk/src/share/classes/java/io/PushbackInputStream.java +++ b/jdk/src/share/classes/java/io/PushbackInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -273,7 +273,11 @@ class PushbackInputStream extends FilterInputStream { */ public int available() throws IOException { ensureOpen(); - return (buf.length - pos) + super.available(); + int n = buf.length - pos; + int avail = super.available(); + return n > (Integer.MAX_VALUE - avail) + ? Integer.MAX_VALUE + : n + avail; } /** diff --git a/jdk/src/share/classes/java/io/SerialCallbackContext.java b/jdk/src/share/classes/java/io/SerialCallbackContext.java new file mode 100644 index 00000000000..90d022e53ea --- /dev/null +++ b/jdk/src/share/classes/java/io/SerialCallbackContext.java @@ -0,0 +1,58 @@ + /* + * %W% %E% + * + * Copyright (c) 2006, 2010 Oracle and/or its affiliates. All rights reserved. + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + */ + + package java.io; + + /** + * Context during upcalls from object stream to class-defined + * readObject/writeObject methods. + * Holds object currently being deserialized and descriptor for current class. + * + * This context keeps track of the thread it was constructed on, and allows + * only a single call of defaultReadObject, readFields, defaultWriteObject + * or writeFields which must be invoked on the same thread before the class's + * readObject/writeObject method has returned. + * If not set to the current thread, the getObj method throws NotActiveException. + */ + final class SerialCallbackContext { + private final Object obj; + private final ObjectStreamClass desc; + /** + * Thread this context is in use by. + * As this only works in one thread, we do not need to worry about thread-safety. + */ + private Thread thread; + + public SerialCallbackContext(Object obj, ObjectStreamClass desc) { + this.obj = obj; + this.desc = desc; + this.thread = Thread.currentThread(); + } + + public Object getObj() throws NotActiveException { + checkAndSetUsed(); + return obj; + } + + public ObjectStreamClass getDesc() { + return desc; + } + + private void checkAndSetUsed() throws NotActiveException { + if (thread != Thread.currentThread()) { + throw new NotActiveException( + "not in readObject invocation or fields already read"); + } + thread = null; + } + + public void setUsed() { + thread = null; + } + } + + diff --git a/jdk/src/share/classes/java/io/package.html b/jdk/src/share/classes/java/io/package.html index b2f0838bbef..1b909adac77 100644 --- a/jdk/src/share/classes/java/io/package.html +++ b/jdk/src/share/classes/java/io/package.html @@ -1,5 +1,5 @@ - - @@ -163,14 +163,14 @@ - + - @@ -183,13 +183,13 @@ @@ -253,7 +253,7 @@ - @@ -269,10 +269,10 @@ - + - - + + @@ -295,16 +295,16 @@ - - - - + + + - diff --git a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java index 050760377a5..31d9199da18 100644 --- a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java +++ b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java @@ -92,8 +92,6 @@ import javax.management.RuntimeOperationsException; * @since 1.5 */ -// Sun Microsystems, Sept. 2002: Revisited for JMX 1.2 (DF) -// @SuppressWarnings("serial") // serialVersionUID is not constant public class ModelMBeanNotificationInfo extends MBeanNotificationInfo diff --git a/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java b/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java index 6e2c08a5030..143966bad68 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 (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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 afc319edf26..f5359f9b12c 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 (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +291,24 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable if (tracing) logger.trace("connect",idstr + " getting connection..."); Object credentials = usemap.get(CREDENTIALS); - connection = getConnection(stub, credentials, checkStub); + + try { + connection = getConnection(stub, credentials, checkStub); + } catch (java.rmi.RemoteException re) { + if (jmxServiceURL != null) { + final String pro = jmxServiceURL.getProtocol(); + final String path = jmxServiceURL.getURLPath(); + + if ("rmi".equals(pro) && + path.startsWith("/jndi/iiop:")) { + MalformedURLException mfe = new MalformedURLException( + "Protocol is rmi but JNDI scheme is iiop: " + jmxServiceURL); + mfe.initCause(re); + throw mfe; + } + } + throw re; + } // Always use one of: // ClassLoader provided in Map at connect time, diff --git a/jdk/src/share/classes/javax/naming/event/EventDirContext.java b/jdk/src/share/classes/javax/naming/event/EventDirContext.java index 1e555e6dd1f..86defa1b099 100644 --- a/jdk/src/share/classes/javax/naming/event/EventDirContext.java +++ b/jdk/src/share/classes/javax/naming/event/EventDirContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/naming/ldap/Control.java b/jdk/src/share/classes/javax/naming/ldap/Control.java index b208ab00d28..b496716740f 100644 --- a/jdk/src/share/classes/javax/naming/ldap/Control.java +++ b/jdk/src/share/classes/javax/naming/ldap/Control.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/naming/ldap/ControlFactory.java b/jdk/src/share/classes/javax/naming/ldap/ControlFactory.java index e8ec6a27602..cbd9b8ab853 100644 --- a/jdk/src/share/classes/javax/naming/ldap/ControlFactory.java +++ b/jdk/src/share/classes/javax/naming/ldap/ControlFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/naming/ldap/ExtendedRequest.java b/jdk/src/share/classes/javax/naming/ldap/ExtendedRequest.java index 130205323d6..a528df5e28a 100644 --- a/jdk/src/share/classes/javax/naming/ldap/ExtendedRequest.java +++ b/jdk/src/share/classes/javax/naming/ldap/ExtendedRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/naming/ldap/ExtendedResponse.java b/jdk/src/share/classes/javax/naming/ldap/ExtendedResponse.java index 407fd927cec..576aa333246 100644 --- a/jdk/src/share/classes/javax/naming/ldap/ExtendedResponse.java +++ b/jdk/src/share/classes/javax/naming/ldap/ExtendedResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/naming/ldap/LdapName.java b/jdk/src/share/classes/javax/naming/ldap/LdapName.java index 852f544f43c..30e173fe64e 100644 --- a/jdk/src/share/classes/javax/naming/ldap/LdapName.java +++ b/jdk/src/share/classes/javax/naming/ldap/LdapName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/naming/ldap/Rdn.java b/jdk/src/share/classes/javax/naming/ldap/Rdn.java index a705fee6864..7a17b8c4bf6 100644 --- a/jdk/src/share/classes/javax/naming/ldap/Rdn.java +++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/naming/ldap/UnsolicitedNotification.java b/jdk/src/share/classes/javax/naming/ldap/UnsolicitedNotification.java index e0683441119..f0da06b4da2 100644 --- a/jdk/src/share/classes/javax/naming/ldap/UnsolicitedNotification.java +++ b/jdk/src/share/classes/javax/naming/ldap/UnsolicitedNotification.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/naming/ldap/UnsolicitedNotificationListener.java b/jdk/src/share/classes/javax/naming/ldap/UnsolicitedNotificationListener.java index 8ffdd4a0f40..c19c9b7b0cd 100644 --- a/jdk/src/share/classes/javax/naming/ldap/UnsolicitedNotificationListener.java +++ b/jdk/src/share/classes/javax/naming/ldap/UnsolicitedNotificationListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/net/SocketFactory.java b/jdk/src/share/classes/javax/net/SocketFactory.java index 3664e8e8653..2526a9090fb 100644 --- a/jdk/src/share/classes/javax/net/SocketFactory.java +++ b/jdk/src/share/classes/javax/net/SocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/net/ssl/ExtendedSSLSession.java b/jdk/src/share/classes/javax/net/ssl/ExtendedSSLSession.java new file mode 100644 index 00000000000..a9a5ed2968a --- /dev/null +++ b/jdk/src/share/classes/javax/net/ssl/ExtendedSSLSession.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.net.ssl; + +/** + * Extends the SSLSession interface to support additional + * session attributes. + * + * @since 1.7 + */ +public abstract class ExtendedSSLSession implements SSLSession { + /** + * Obtains an array of supported signature algorithms that the local side + * is willing to use. + *

      + * Note: this method is used to indicate to the peer which signature + * algorithms may be used for digital signatures in TLS 1.2. It is + * not meaningful for TLS versions prior to 1.2. + *

      + * The signature algorithm name must be a standard Java Security + * name (such as "SHA1withRSA", "SHA256withECDSA", and so on). + * See Appendix A in the + * Java Cryptography Architecture API Specification & Reference + * for information about standard algorithm names. + *

      + * Note: the local supported signature algorithms should conform to + * the algorithm constraints specified by + * {@link SSLParameters#getAlgorithmConstraints getAlgorithmConstraints()} + * method in SSLParameters. + * + * @return An array of supported signature algorithms, in descending + * order of preference. The return value is an empty array if + * no signature algorithm is supported. + * + * @see SSLParameters#getAlgorithmConstraints + */ + public abstract String[] getLocalSupportedSignatureAlgorithms(); + + /** + * Obtains an array of supported signature algorithms that the peer is + * able to use. + *

      + * Note: this method is used to indicate to the local side which signature + * algorithms may be used for digital signatures in TLS 1.2. It is + * not meaningful for TLS versions prior to 1.2. + *

      + * The signature algorithm name must be a standard Java Security + * name (such as "SHA1withRSA", "SHA256withECDSA", and so on). + * See Appendix A in the + * Java Cryptography Architecture API Specification & Reference + * for information about standard algorithm names. + * + * @return An array of supported signature algorithms, in descending + * order of preference. The return value is an empty array if + * the peer has not sent the supported signature algorithms. + * + * @see X509KeyManager + * @see X509ExtendedKeyManager + */ + public abstract String[] getPeerSupportedSignatureAlgorithms(); +} diff --git a/jdk/src/share/classes/javax/net/ssl/HttpsURLConnection.java b/jdk/src/share/classes/javax/net/ssl/HttpsURLConnection.java index e9c478fece1..6d799e3ff5f 100644 --- a/jdk/src/share/classes/javax/net/ssl/HttpsURLConnection.java +++ b/jdk/src/share/classes/javax/net/ssl/HttpsURLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -188,19 +188,8 @@ class HttpsURLConnection extends HttpURLConnection *

      * The default implementation will deny such connections. */ - private static HostnameVerifier defaultHostnameVerifier; - - /** - * Initialize the default HostnameVerifier. - */ - static { - try { - defaultHostnameVerifier = - new sun.net.www.protocol.https.DefaultHostnameVerifier(); - } catch (NoClassDefFoundError e) { - defaultHostnameVerifier = new DefaultHostnameVerifier(); - } - } + private static HostnameVerifier defaultHostnameVerifier = + new DefaultHostnameVerifier(); /* * The initial default HostnameVerifier. Should be diff --git a/jdk/src/share/classes/javax/net/ssl/SSLEngine.java b/jdk/src/share/classes/javax/net/ssl/SSLEngine.java index df3830858a6..2eea55121cb 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLEngine.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLEngine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -967,6 +967,47 @@ public abstract class SSLEngine { public abstract SSLSession getSession(); + /** + * Returns the {@code SSLSession} being constructed during a SSL/TLS + * handshake. + *

      + * TLS protocols may negotiate parameters that are needed when using + * an instance of this class, but before the {@code SSLSession} has + * been completely initialized and made available via {@code getSession}. + * For example, the list of valid signature algorithms may restrict + * the type of certificates that can used during TrustManager + * decisions, or the maximum TLS fragment packet sizes can be + * resized to better support the network environment. + *

      + * This method provides early access to the {@code SSLSession} being + * constructed. Depending on how far the handshake has progressed, + * some data may not yet be available for use. For example, if a + * remote server will be sending a Certificate chain, but that chain + * has yet not been processed, the {@code getPeerCertificates} + * method of {@code SSLSession} will throw a + * SSLPeerUnverifiedException. Once that chain has been processed, + * {@code getPeerCertificates} will return the proper value. + * + * @see SSLSocket + * @see SSLSession + * @see ExtendedSSLSession + * @see X509ExtendedKeyManager + * @see X509ExtendedTrustManager + * + * @return null if this instance is not currently handshaking, or + * if the current handshake has not progressed far enough to + * create a basic SSLSession. Otherwise, this method returns the + * {@code SSLSession} currently being negotiated. + * @throws UnsupportedOperationException if the underlying provider + * does not implement the operation. + * + * @since 1.7 + */ + public SSLSession getHandshakeSession() { + throw new UnsupportedOperationException(); + } + + /** * Initiates handshaking (initial or renegotiation) on this SSLEngine. *

      diff --git a/jdk/src/share/classes/javax/net/ssl/SSLParameters.java b/jdk/src/share/classes/javax/net/ssl/SSLParameters.java index ed8913230af..4bb20a164eb 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLParameters.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLParameters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,24 +25,29 @@ package javax.net.ssl; +import java.security.AlgorithmConstraints; + /** * Encapsulates parameters for an SSL/TLS connection. The parameters * are the list of ciphersuites to be accepted in an SSL/TLS handshake, - * the list of protocols to be allowed, and whether SSL/TLS servers should - * request or require client authentication. - * - *

      SSLParameters can be created via the constructors in this class. + * the list of protocols to be allowed, the endpoint identification + * algorithm during SSL/TLS handshaking, the algorithm constraints and + * whether SSL/TLS servers should request or require client authentication. + *

      + * SSLParameters can be created via the constructors in this class. * Objects can also be obtained using the getSSLParameters() * methods in * {@link SSLSocket#getSSLParameters SSLSocket} and + * {@link SSLServerSocket#getSSLParameters SSLServerSocket} and * {@link SSLEngine#getSSLParameters SSLEngine} or the * {@link SSLContext#getDefaultSSLParameters getDefaultSSLParameters()} and * {@link SSLContext#getSupportedSSLParameters getSupportedSSLParameters()} * methods in SSLContext. - * - *

      SSLParameters can be applied to a connection via the methods + *

      + * SSLParameters can be applied to a connection via the methods * {@link SSLSocket#setSSLParameters SSLSocket.setSSLParameters()} and - * {@link SSLEngine#setSSLParameters SSLEngine.getSSLParameters()}. + * {@link SSLServerSocket#setSSLParameters SSLServerSocket.setSSLParameters()} + * and {@link SSLEngine#setSSLParameters SSLEngine.getSSLParameters()}. * * @see SSLSocket * @see SSLEngine @@ -56,11 +61,13 @@ public class SSLParameters { private String[] protocols; private boolean wantClientAuth; private boolean needClientAuth; + private String identificationAlgorithm; + private AlgorithmConstraints algorithmConstraints; /** * Constructs SSLParameters. - * - *

      The cipherSuites and protocols values are set to null, + *

      + * The cipherSuites and protocols values are set to null, * wantClientAuth and needClientAuth are set to false. */ public SSLParameters() { @@ -69,6 +76,7 @@ public class SSLParameters { /** * Constructs SSLParameters from the specified array of ciphersuites. + *

      * Calling this constructor is equivalent to calling the no-args * constructor followed by * setCipherSuites(cipherSuites);. @@ -82,6 +90,7 @@ public class SSLParameters { /** * Constructs SSLParameters from the specified array of ciphersuites * and protocols. + *

      * Calling this constructor is equivalent to calling the no-args * constructor followed by * setCipherSuites(cipherSuites); setProtocols(protocols);. @@ -178,4 +187,71 @@ public class SSLParameters { this.needClientAuth = needClientAuth; } + /** + * Returns the cryptographic algorithm constraints. + * + * @return the cryptographic algorithm constraints, or null if the + * constraints have not been set + * + * @see #setAlgorithmConstraints(AlgorithmConstraints) + * + * @since 1.7 + */ + public AlgorithmConstraints getAlgorithmConstraints() { + return algorithmConstraints; + } + + /** + * Sets the cryptographic algorithm constraints, which will be used + * in addition to any configured by the runtime environment. + *

      + * If the constraints parameter is non-null, every + * cryptographic algorithm, key and algorithm parameters used in the + * SSL/TLS handshake must be permitted by the constraints. + * + * @param constraints the algorithm constraints (or null) + * + * @since 1.7 + */ + public void setAlgorithmConstraints(AlgorithmConstraints constraints) { + // the constraints object is immutable + this.algorithmConstraints = constraints; + } + + /** + * Gets the endpoint identification algorithm. + * + * @return the endpoint identification algorithm, or null if none + * has been set. + * + * @see X509ExtendedTrustManager + * @see #setEndpointIdentificationAlgorithm(String) + * + * @since 1.7 + */ + public String getEndpointIdentificationAlgorithm() { + return identificationAlgorithm; + } + + /** + * Sets the endpoint identification algorithm. + *

      + * If the algorithm parameter is non-null or non-empty, the + * endpoint identification/verification procedures must be handled during + * SSL/TLS handshaking. This is to prevent man-in-the-middle attacks. + * + * @param algorithm The standard string name of the endpoint + * identification algorithm (or null). See Appendix A in the + * Java Cryptography Architecture API Specification & Reference + * for information about standard algorithm names. + * + * @see X509ExtendedTrustManager + * + * @since 1.7 + */ + public void setEndpointIdentificationAlgorithm(String algorithm) { + this.identificationAlgorithm = algorithm; + } + } diff --git a/jdk/src/share/classes/javax/net/ssl/SSLServerSocket.java b/jdk/src/share/classes/javax/net/ssl/SSLServerSocket.java index 6bcb8a678e8..d5bbaaf5da5 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLServerSocket.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLServerSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,8 +56,8 @@ import java.net.*; * @since 1.4 * @author David Brownell */ -public abstract class SSLServerSocket extends ServerSocket -{ +public abstract class SSLServerSocket extends ServerSocket { + /** * Used only by subclasses. *

      @@ -449,8 +449,79 @@ public abstract class SSLServerSocket extends ServerSocket * * @return true indicates that sessions may be created; this * is the default. false indicates that an existing - * session must be resumed. + * session must be resumed * @see #setEnableSessionCreation(boolean) */ public abstract boolean getEnableSessionCreation(); + + /** + * Returns the SSLParameters in effect for newly accepted connections. + * The ciphersuites and protocols of the returned SSLParameters + * are always non-null. + * + * @return the SSLParameters in effect for newly accepted connections + * + * @see #setSSLParameters(SSLParameters) + * + * @since 1.7 + */ + public SSLParameters getSSLParameters() { + SSLParameters parameters = new SSLParameters(); + + parameters.setCipherSuites(getEnabledCipherSuites()); + parameters.setProtocols(getEnabledProtocols()); + if (getNeedClientAuth()) { + parameters.setNeedClientAuth(true); + } else if (getWantClientAuth()) { + parameters.setWantClientAuth(true); + } + + return parameters; + } + + /** + * Applies SSLParameters to newly accepted connections. + * + *

      This means: + *

        + *
      • if params.getCipherSuites() is non-null, + * setEnabledCipherSuites() is called with that value + *
      • if params.getProtocols() is non-null, + * setEnabledProtocols() is called with that value + *
      • if params.getNeedClientAuth() or + * params.getWantClientAuth() return true, + * setNeedClientAuth(true) and + * setWantClientAuth(true) are called, respectively; + * otherwise setWantClientAuth(false) is called. + *
      + * + * @param params the parameters + * @throws IllegalArgumentException if the setEnabledCipherSuites() or + * the setEnabledProtocols() call fails + * + * @see #getSSLParameters() + * + * @since 1.7 + */ + public void setSSLParameters(SSLParameters params) { + String[] s; + s = params.getCipherSuites(); + if (s != null) { + setEnabledCipherSuites(s); + } + + s = params.getProtocols(); + if (s != null) { + setEnabledProtocols(s); + } + + if (params.getNeedClientAuth()) { + setNeedClientAuth(true); + } else if (params.getWantClientAuth()) { + setWantClientAuth(true); + } else { + setWantClientAuth(false); + } + } + } diff --git a/jdk/src/share/classes/javax/net/ssl/SSLSocket.java b/jdk/src/share/classes/javax/net/ssl/SSLSocket.java index 29b69f1ccbf..b61f94a5a75 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLSocket.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -370,6 +370,51 @@ public abstract class SSLSocket extends Socket public abstract SSLSession getSession(); + /** + * Returns the {@code SSLSession} being constructed during a SSL/TLS + * handshake. + *

      + * TLS protocols may negotiate parameters that are needed when using + * an instance of this class, but before the {@code SSLSession} has + * been completely initialized and made available via {@code getSession}. + * For example, the list of valid signature algorithms may restrict + * the type of certificates that can used during TrustManager + * decisions, or the maximum TLS fragment packet sizes can be + * resized to better support the network environment. + *

      + * This method provides early access to the {@code SSLSession} being + * constructed. Depending on how far the handshake has progressed, + * some data may not yet be available for use. For example, if a + * remote server will be sending a Certificate chain, but that chain + * has yet not been processed, the {@code getPeerCertificates} + * method of {@code SSLSession} will throw a + * SSLPeerUnverifiedException. Once that chain has been processed, + * {@code getPeerCertificates} will return the proper value. + *

      + * Unlike {@link #getSession()}, this method does not initiate the + * initial handshake and does not block until handshaking is + * complete. + * + * @see SSLEngine + * @see SSLSession + * @see ExtendedSSLSession + * @see X509ExtendedKeyManager + * @see X509ExtendedTrustManager + * + * @return null if this instance is not currently handshaking, or + * if the current handshake has not progressed far enough to + * create a basic SSLSession. Otherwise, this method returns the + * {@code SSLSession} currently being negotiated. + * @throws UnsupportedOperationException if the underlying provider + * does not implement the operation. + * + * @since 1.7 + */ + public SSLSession getHandshakeSession() { + throw new UnsupportedOperationException(); + } + + /** * Registers an event listener to receive notifications that an * SSL handshake has completed on this connection. diff --git a/jdk/src/share/classes/javax/net/ssl/SSLSocketFactory.java b/jdk/src/share/classes/javax/net/ssl/SSLSocketFactory.java index a7971b5504b..f7d5e5b0a2f 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLSocketFactory.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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.net.*; import javax.net.SocketFactory; import java.io.IOException; import java.security.*; +import java.util.Locale; import sun.security.action.GetPropertyAction; @@ -50,7 +51,8 @@ public abstract class SSLSocketFactory extends SocketFactory static { String s = java.security.AccessController.doPrivileged( - new GetPropertyAction("javax.net.debug", "")).toLowerCase(); + new GetPropertyAction("javax.net.debug", "")).toLowerCase( + Locale.ENGLISH); DEBUG = s.contains("all") || s.contains("ssl"); } diff --git a/jdk/src/share/classes/javax/net/ssl/X509ExtendedTrustManager.java b/jdk/src/share/classes/javax/net/ssl/X509ExtendedTrustManager.java new file mode 100644 index 00000000000..f14489fe8ce --- /dev/null +++ b/jdk/src/share/classes/javax/net/ssl/X509ExtendedTrustManager.java @@ -0,0 +1,234 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.net.ssl; + +import java.net.Socket; +import javax.net.ssl.X509TrustManager; + +import java.security.cert.X509Certificate; +import java.security.cert.CertificateException; + +/** + * Extensions to the X509TrustManager interface to support + * SSL/TLS connection sensitive trust management. + *

      + * To prevent man-in-the-middle attacks, hostname checks can be done + * to verify that the hostname in an end-entity certificate matches the + * targeted hostname. TLS does not require such checks, but some protocols + * over TLS (such as HTTPS) do. In earlier versions of the JDK, the + * certificate chain checks were done at the SSL/TLS layer, and the hostname + * verification checks were done at the layer over TLS. This class allows + * for the checking to be done during a single call to this class. + *

      + * RFC 2830 defines the server identification specification for the "LDAPS" + * algorithm. RFC 2818 defines both the server identification and the + * client identification specification for the "HTTPS" algorithm. + * + * @see X509TrustManager + * @see HostnameVerifier + * + * @since 1.7 + */ +public abstract class X509ExtendedTrustManager implements X509TrustManager { + /** + * Given the partial or complete certificate chain provided by the + * peer, build and validate the certificate path based on the + * authentication type and ssl parameters. + *

      + * The authentication type is determined by the actual certificate + * used. For instance, if RSAPublicKey is used, the authType + * should be "RSA". Checking is case-sensitive. + *

      + * If the socket parameter is an instance of + * {@link javax.net.ssl.SSLSocket}, and the endpoint identification + * algorithm of the SSLParameters is non-empty, to prevent + * man-in-the-middle attacks, the address that the socket + * connected to should be checked against the peer's identity presented + * in the end-entity X509 certificate, as specified in the endpoint + * identification algorithm. + *

      + * If the socket parameter is an instance of + * {@link javax.net.ssl.SSLSocket}, and the algorithm constraints of the + * SSLParameters is non-null, for every certificate in the + * certification path, fields such as subject public key, the signature + * algorithm, key usage, extended key usage, etc. need to conform to the + * algorithm constraints in place on this socket. + * + * @param chain the peer certificate chain + * @param authType the key exchange algorithm used + * @param socket the socket used for this connection. This parameter + * can be null, which indicates that implementations need not check + * the ssl parameters + * @throws IllegalArgumentException if null or zero-length array is passed + * in for the chain parameter or if null or zero-length + * string is passed in for the authType parameter + * @throws CertificateException if the certificate chain is not trusted + * by this TrustManager + * + * @see SSLParameters#getEndpointIdentificationAlgorithm + * @see SSLParameters#setEndpointIdentificationAlgorithm(String) + * @see SSLParameters#getAlgorithmConstraints + * @see SSLParameters#setAlgorithmConstraints(AlgorithmConstraints) + */ + public abstract void checkClientTrusted(X509Certificate[] chain, + String authType, Socket socket) throws CertificateException; + + /** + * Given the partial or complete certificate chain provided by the + * peer, build and validate the certificate path based on the + * authentication type and ssl parameters. + *

      + * The authentication type is the key exchange algorithm portion + * of the cipher suites represented as a String, such as "RSA", + * "DHE_DSS". Note: for some exportable cipher suites, the key + * exchange algorithm is determined at run time during the + * handshake. For instance, for TLS_RSA_EXPORT_WITH_RC4_40_MD5, + * the authType should be RSA_EXPORT when an ephemeral RSA key is + * used for the key exchange, and RSA when the key from the server + * certificate is used. Checking is case-sensitive. + *

      + * If the socket parameter is an instance of + * {@link javax.net.ssl.SSLSocket}, and the endpoint identification + * algorithm of the SSLParameters is non-empty, to prevent + * man-in-the-middle attacks, the address that the socket + * connected to should be checked against the peer's identity presented + * in the end-entity X509 certificate, as specified in the endpoint + * identification algorithm. + *

      + * If the socket parameter is an instance of + * {@link javax.net.ssl.SSLSocket}, and the algorithm constraints of the + * SSLParameters is non-null, for every certificate in the + * certification path, fields such as subject public key, the signature + * algorithm, key usage, extended key usage, etc. need to conform to the + * algorithm constraints in place on this socket. + * + * @param chain the peer certificate chain + * @param authType the key exchange algorithm used + * @param socket the socket used for this connection. This parameter + * can be null, which indicates that implementations need not check + * the ssl parameters + * @throws IllegalArgumentException if null or zero-length array is passed + * in for the chain parameter or if null or zero-length + * string is passed in for the authType parameter + * @throws CertificateException if the certificate chain is not trusted + * by this TrustManager + * + * @see SSLParameters#getEndpointIdentificationAlgorithm + * @see SSLParameters#setEndpointIdentificationAlgorithm(String) + * @see SSLParameters#getAlgorithmConstraints + * @see SSLParameters#setAlgorithmConstraints(AlgorithmConstraints) + */ + public abstract void checkServerTrusted(X509Certificate[] chain, + String authType, Socket socket) throws CertificateException; + + /** + * Given the partial or complete certificate chain provided by the + * peer, build and validate the certificate path based on the + * authentication type and ssl parameters. + *

      + * The authentication type is determined by the actual certificate + * used. For instance, if RSAPublicKey is used, the authType + * should be "RSA". Checking is case-sensitive. + *

      + * If the engine parameter is available, and the endpoint + * identification algorithm of the SSLParameters is + * non-empty, to prevent man-in-the-middle attacks, the address that + * the engine connected to should be checked against + * the peer's identity presented in the end-entity X509 certificate, + * as specified in the endpoint identification algorithm. + *

      + * If the engine parameter is available, and the algorithm + * constraints of the SSLParameters is non-null, for every + * certificate in the certification path, fields such as subject public + * key, the signature algorithm, key usage, extended key usage, etc. + * need to conform to the algorithm constraints in place on this engine. + * + * @param chain the peer certificate chain + * @param authType the key exchange algorithm used + * @param engine the engine used for this connection. This parameter + * can be null, which indicates that implementations need not check + * the ssl parameters + * @throws IllegalArgumentException if null or zero-length array is passed + * in for the chain parameter or if null or zero-length + * string is passed in for the authType parameter + * @throws CertificateException if the certificate chain is not trusted + * by this TrustManager + * + * @see SSLParameters#getEndpointIdentificationAlgorithm + * @see SSLParameters#setEndpointIdentificationAlgorithm(String) + * @see SSLParameters#getAlgorithmConstraints + * @see SSLParameters#setAlgorithmConstraints(AlgorithmConstraints) + */ + public abstract void checkClientTrusted(X509Certificate[] chain, + String authType, SSLEngine engine) throws CertificateException; + + /** + * Given the partial or complete certificate chain provided by the + * peer, build and validate the certificate path based on the + * authentication type and ssl parameters. + *

      + * The authentication type is the key exchange algorithm portion + * of the cipher suites represented as a String, such as "RSA", + * "DHE_DSS". Note: for some exportable cipher suites, the key + * exchange algorithm is determined at run time during the + * handshake. For instance, for TLS_RSA_EXPORT_WITH_RC4_40_MD5, + * the authType should be RSA_EXPORT when an ephemeral RSA key is + * used for the key exchange, and RSA when the key from the server + * certificate is used. Checking is case-sensitive. + *

      + * If the engine parameter is available, and the endpoint + * identification algorithm of the SSLParameters is + * non-empty, to prevent man-in-the-middle attacks, the address that + * the engine connected to should be checked against + * the peer's identity presented in the end-entity X509 certificate, + * as specified in the endpoint identification algorithm. + *

      + * If the engine parameter is available, and the algorithm + * constraints of the SSLParameters is non-null, for every + * certificate in the certification path, fields such as subject public + * key, the signature algorithm, key usage, extended key usage, etc. + * need to conform to the algorithm constraints in place on this engine. + * + * @param chain the peer certificate chain + * @param authType the key exchange algorithm used + * @param engine the engine used for this connection. This parameter + * can be null, which indicates that implementations need not check + * the ssl parameters + * @throws IllegalArgumentException if null or zero-length array is passed + * in for the chain parameter or if null or zero-length + * string is passed in for the authType parameter + * @throws CertificateException if the certificate chain is not trusted + * by this TrustManager + * + * @see SSLParameters#getEndpointIdentificationAlgorithm + * @see SSLParameters#setEndpointIdentificationAlgorithm(String) + * @see SSLParameters#getAlgorithmConstraints + * @see SSLParameters#setAlgorithmConstraints(AlgorithmConstraints) + */ + public abstract void checkServerTrusted(X509Certificate[] chain, + String authType, SSLEngine engine) throws CertificateException; + +} diff --git a/jdk/src/share/classes/javax/print/DocFlavor.java b/jdk/src/share/classes/javax/print/DocFlavor.java index 3a250d1c592..b2bac942a7b 100644 --- a/jdk/src/share/classes/javax/print/DocFlavor.java +++ b/jdk/src/share/classes/javax/print/DocFlavor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/DialogTypeSelection.java b/jdk/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java index 1dae59a1525..4cd68bb59af 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java @@ -52,6 +52,8 @@ import javax.print.attribute.PrintRequestAttribute; public final class DialogTypeSelection extends EnumSyntax implements PrintRequestAttribute { + private static final long serialVersionUID = 7518682952133256029L; + /** * */ diff --git a/jdk/src/share/classes/javax/script/CompiledScript.java b/jdk/src/share/classes/javax/script/CompiledScript.java index da31be3bb46..4a9a4ba056c 100644 --- a/jdk/src/share/classes/javax/script/CompiledScript.java +++ b/jdk/src/share/classes/javax/script/CompiledScript.java @@ -107,7 +107,7 @@ public abstract class CompiledScript { } /** - * Returns the ScriptEngine wbose compile method created this CompiledScript. + * Returns the ScriptEngine whose compile method created this CompiledScript. * The CompiledScript will execute in this engine. * * @return The ScriptEngine that created this CompiledScript diff --git a/jdk/src/share/classes/javax/security/auth/Policy.java b/jdk/src/share/classes/javax/security/auth/Policy.java index 4b2560a8620..88264b3fc49 100644 --- a/jdk/src/share/classes/javax/security/auth/Policy.java +++ b/jdk/src/share/classes/javax/security/auth/Policy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 @@ package javax.security.auth; +import java.security.Security; +import sun.security.util.Debug; + /** *

      This is an abstract class for representing the system policy for * Subject-based authorization. A subclass implementation @@ -159,6 +162,10 @@ public abstract class Policy { private static Policy policy; private static ClassLoader contextClassLoader; + // true if a custom (not com.sun.security.auth.PolicyFile) system-wide + // policy object is set + private static boolean isCustomPolicy; + static { contextClassLoader = java.security.AccessController.doPrivileged (new java.security.PrivilegedAction() { @@ -234,10 +241,12 @@ public abstract class Policy { contextClassLoader).newInstance(); } }); + isCustomPolicy = + !finalClass.equals("com.sun.security.auth.PolicyFile"); } catch (Exception e) { throw new SecurityException (sun.security.util.ResourcesMgr.getString - ("unable to instantiate Subject-based policy")); + ("unable.to.instantiate.Subject.based.policy")); } } } @@ -265,6 +274,46 @@ public abstract class Policy { java.lang.SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(new AuthPermission("setPolicy")); Policy.policy = policy; + // all non-null policy objects are assumed to be custom + isCustomPolicy = policy != null ? true : false; + } + + /** + * Returns true if a custom (not com.sun.security.auth.PolicyFile) + * system-wide policy object has been set or installed. This method is + * called by SubjectDomainCombiner to provide backwards compatibility for + * developers that provide their own javax.security.auth.Policy + * implementations. + * + * @return true if a custom (not com.sun.security.auth.PolicyFile) + * system-wide policy object has been set; false otherwise + */ + static boolean isCustomPolicySet(Debug debug) { + if (policy != null) { + if (debug != null && isCustomPolicy) { + debug.println("Providing backwards compatibility for " + + "javax.security.auth.policy implementation: " + + policy.toString()); + } + return isCustomPolicy; + } + // check if custom policy has been set using auth.policy.provider prop + String policyClass = java.security.AccessController.doPrivileged + (new java.security.PrivilegedAction() { + public String run() { + return Security.getProperty("auth.policy.provider"); + } + }); + if (policyClass != null + && !policyClass.equals("com.sun.security.auth.PolicyFile")) { + if (debug != null) { + debug.println("Providing backwards compatibility for " + + "javax.security.auth.policy implementation: " + + policyClass); + } + return true; + } + return false; } /** diff --git a/jdk/src/share/classes/javax/security/auth/PrivateCredentialPermission.java b/jdk/src/share/classes/javax/security/auth/PrivateCredentialPermission.java index fd25008dc90..22cb6ef2d2f 100644 --- a/jdk/src/share/classes/javax/security/auth/PrivateCredentialPermission.java +++ b/jdk/src/share/classes/javax/security/auth/PrivateCredentialPermission.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -172,7 +172,7 @@ public final class PrivateCredentialPermission extends Permission { if (!"read".equalsIgnoreCase(actions)) throw new IllegalArgumentException - (ResourcesMgr.getString("actions can only be 'read'")); + (ResourcesMgr.getString("actions.can.only.be.read.")); init(name); } @@ -329,7 +329,7 @@ public final class PrivateCredentialPermission extends Permission { throw new IllegalArgumentException("invalid empty name"); } - ArrayList pList = new ArrayList(); + ArrayList pList = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(name, " ", true); String principalClass = null; String principalName = null; @@ -344,12 +344,11 @@ public final class PrivateCredentialPermission extends Permission { if (tokenizer.hasMoreTokens() == false) { MessageFormat form = new MessageFormat(ResourcesMgr.getString - ("permission name [name] syntax invalid: ")); + ("permission.name.name.syntax.invalid.")); Object[] source = {name}; throw new IllegalArgumentException (form.format(source) + ResourcesMgr.getString - ("Credential Class not followed by a " + - "Principal Class and Name")); + ("Credential.Class.not.followed.by.a.Principal.Class.and.Name")); } while (tokenizer.hasMoreTokens()) { @@ -364,11 +363,11 @@ public final class PrivateCredentialPermission extends Permission { if (tokenizer.hasMoreTokens() == false) { MessageFormat form = new MessageFormat(ResourcesMgr.getString - ("permission name [name] syntax invalid: ")); + ("permission.name.name.syntax.invalid.")); Object[] source = {name}; throw new IllegalArgumentException (form.format(source) + ResourcesMgr.getString - ("Principal Class not followed by a Principal Name")); + ("Principal.Class.not.followed.by.a.Principal.Name")); } // skip delimiter @@ -379,11 +378,11 @@ public final class PrivateCredentialPermission extends Permission { if (!principalName.startsWith("\"")) { MessageFormat form = new MessageFormat(ResourcesMgr.getString - ("permission name [name] syntax invalid: ")); + ("permission.name.name.syntax.invalid.")); Object[] source = {name}; throw new IllegalArgumentException (form.format(source) + ResourcesMgr.getString - ("Principal Name must be surrounded by quotes")); + ("Principal.Name.must.be.surrounded.by.quotes")); } if (!principalName.endsWith("\"")) { @@ -401,11 +400,11 @@ public final class PrivateCredentialPermission extends Permission { if (!principalName.endsWith("\"")) { MessageFormat form = new MessageFormat (ResourcesMgr.getString - ("permission name [name] syntax invalid: ")); + ("permission.name.name.syntax.invalid.")); Object[] source = {name}; throw new IllegalArgumentException (form.format(source) + ResourcesMgr.getString - ("Principal Name missing end quote")); + ("Principal.Name.missing.end.quote")); } } @@ -418,9 +417,7 @@ public final class PrivateCredentialPermission extends Permission { if (principalClass.equals("*") && !principalName.equals("*")) { throw new IllegalArgumentException(ResourcesMgr.getString - ("PrivateCredentialPermission Principal Class " + - "can not be a wildcard (*) value if Principal Name " + - "is not a wildcard (*) value")); + ("PrivateCredentialPermission.Principal.Class.can.not.be.a.wildcard.value.if.Principal.Name.is.not.a.wildcard.value")); } if (testing) @@ -556,8 +553,7 @@ public final class PrivateCredentialPermission extends Permission { public String toString() { MessageFormat form = new MessageFormat(ResourcesMgr.getString - ("CredOwner:\n\tPrincipal Class = class\n\t" + - "Principal Name = name")); + ("CredOwner.Principal.Class.class.Principal.Name.name")); Object[] source = {principalClass, principalName}; return (form.format(source)); } diff --git a/jdk/src/share/classes/javax/security/auth/Subject.java b/jdk/src/share/classes/javax/security/auth/Subject.java index a5d56e75a25..56e864c491c 100644 --- a/jdk/src/share/classes/javax/security/auth/Subject.java +++ b/jdk/src/share/classes/javax/security/auth/Subject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -204,7 +204,7 @@ public final class Subject implements java.io.Serializable { pubCredentials == null || privCredentials == null) throw new NullPointerException - (ResourcesMgr.getString("invalid null input(s)")); + (ResourcesMgr.getString("invalid.null.input.s.")); this.principals = Collections.synchronizedSet(new SecureSet (this, PRINCIPAL_SET, principals)); @@ -289,7 +289,7 @@ public final class Subject implements java.io.Serializable { if (acc == null) { throw new NullPointerException(ResourcesMgr.getString - ("invalid null AccessControlContext provided")); + ("invalid.null.AccessControlContext.provided")); } // return the Subject from the DomainCombiner of the provided context @@ -346,7 +346,7 @@ public final class Subject implements java.io.Serializable { } if (action == null) throw new NullPointerException - (ResourcesMgr.getString("invalid null action provided")); + (ResourcesMgr.getString("invalid.null.action.provided")); // set up the new Subject-based AccessControlContext // for doPrivileged @@ -406,7 +406,7 @@ public final class Subject implements java.io.Serializable { if (action == null) throw new NullPointerException - (ResourcesMgr.getString("invalid null action provided")); + (ResourcesMgr.getString("invalid.null.action.provided")); // set up the new Subject-based AccessControlContext for doPrivileged final AccessControlContext currentAcc = AccessController.getContext(); @@ -460,7 +460,7 @@ public final class Subject implements java.io.Serializable { if (action == null) throw new NullPointerException - (ResourcesMgr.getString("invalid null action provided")); + (ResourcesMgr.getString("invalid.null.action.provided")); // set up the new Subject-based AccessControlContext // for doPrivileged @@ -524,7 +524,7 @@ public final class Subject implements java.io.Serializable { if (action == null) throw new NullPointerException - (ResourcesMgr.getString("invalid null action provided")); + (ResourcesMgr.getString("invalid.null.action.provided")); // set up the new Subject-based AccessControlContext for doPrivileged final AccessControlContext callerAcc = @@ -603,7 +603,7 @@ public final class Subject implements java.io.Serializable { if (c == null) throw new NullPointerException - (ResourcesMgr.getString("invalid null Class provided")); + (ResourcesMgr.getString("invalid.null.Class.provided")); // always return an empty Set instead of null // so LoginModules can add to the Set if necessary @@ -697,7 +697,7 @@ public final class Subject implements java.io.Serializable { if (c == null) throw new NullPointerException - (ResourcesMgr.getString("invalid null Class provided")); + (ResourcesMgr.getString("invalid.null.Class.provided")); // always return an empty Set instead of null // so LoginModules can add to the Set if necessary @@ -742,7 +742,7 @@ public final class Subject implements java.io.Serializable { if (c == null) throw new NullPointerException - (ResourcesMgr.getString("invalid null Class provided")); + (ResourcesMgr.getString("invalid.null.Class.provided")); // always return an empty Set instead of null // so LoginModules can add to the Set if necessary @@ -832,15 +832,15 @@ public final class Subject implements java.io.Serializable { */ String toString(boolean includePrivateCredentials) { - String s = ResourcesMgr.getString("Subject:\n"); + String s = ResourcesMgr.getString("Subject."); String suffix = ""; synchronized(principals) { Iterator pI = principals.iterator(); while (pI.hasNext()) { Principal p = pI.next(); - suffix = suffix + ResourcesMgr.getString("\tPrincipal: ") + - p.toString() + ResourcesMgr.getString("\n"); + suffix = suffix + ResourcesMgr.getString(".Principal.") + + p.toString() + ResourcesMgr.getString("NEWLINE"); } } @@ -849,8 +849,8 @@ public final class Subject implements java.io.Serializable { while (pI.hasNext()) { Object o = pI.next(); suffix = suffix + - ResourcesMgr.getString("\tPublic Credential: ") + - o.toString() + ResourcesMgr.getString("\n"); + ResourcesMgr.getString(".Public.Credential.") + + o.toString() + ResourcesMgr.getString("NEWLINE"); } } @@ -861,12 +861,12 @@ public final class Subject implements java.io.Serializable { try { Object o = pI.next(); suffix += ResourcesMgr.getString - ("\tPrivate Credential: ") + + (".Private.Credential.") + o.toString() + - ResourcesMgr.getString("\n"); + ResourcesMgr.getString("NEWLINE"); } catch (SecurityException se) { suffix += ResourcesMgr.getString - ("\tPrivate Credential inaccessible\n"); + (".Private.Credential.inaccessible."); break; } } @@ -1036,7 +1036,7 @@ public final class Subject implements java.io.Serializable { if (subject.isReadOnly()) { throw new IllegalStateException(ResourcesMgr.getString - ("Subject is read-only")); + ("Subject.is.read.only")); } java.lang.SecurityManager sm = System.getSecurityManager(); @@ -1062,7 +1062,7 @@ public final class Subject implements java.io.Serializable { if (subject.isReadOnly()) { throw new IllegalStateException - (ResourcesMgr.getString("Subject is read-only")); + (ResourcesMgr.getString("Subject.is.read.only")); } java.lang.SecurityManager sm = System.getSecurityManager(); @@ -1084,9 +1084,7 @@ public final class Subject implements java.io.Serializable { case Subject.PRINCIPAL_SET: if (!(o instanceof Principal)) { throw new SecurityException(ResourcesMgr.getString - ("attempting to add an object which is not an " + - "instance of java.security.Principal to a " + - "Subject's Principal Set")); + ("attempting.to.add.an.object.which.is.not.an.instance.of.java.security.Principal.to.a.Subject.s.Principal.Set")); } break; default: @@ -1389,8 +1387,7 @@ public final class Subject implements java.io.Serializable { if (!o.getClass().isAssignableFrom(c)) { MessageFormat form = new MessageFormat(ResourcesMgr.getString - ("attempting to add an object which is not an " + - "instance of class")); + ("attempting.to.add.an.object.which.is.not.an.instance.of.class")); Object[] source = {c.toString()}; throw new SecurityException(form.format(source)); } diff --git a/jdk/src/share/classes/javax/security/auth/SubjectDomainCombiner.java b/jdk/src/share/classes/javax/security/auth/SubjectDomainCombiner.java index 00d57f6c6da..6ac38515e1c 100644 --- a/jdk/src/share/classes/javax/security/auth/SubjectDomainCombiner.java +++ b/jdk/src/share/classes/javax/security/auth/SubjectDomainCombiner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ package javax.security.auth; import java.security.AccessController; -import java.security.AccessControlContext; -import java.security.AllPermission; import java.security.Permission; import java.security.Permissions; import java.security.PermissionCollection; @@ -35,10 +33,8 @@ import java.security.Policy; import java.security.Principal; import java.security.PrivilegedAction; import java.security.ProtectionDomain; -import java.lang.ClassLoader; import java.security.Security; import java.util.Set; -import java.util.Iterator; import java.util.WeakHashMap; import java.lang.ref.WeakReference; @@ -52,7 +48,7 @@ public class SubjectDomainCombiner implements java.security.DomainCombiner { private Subject subject; private WeakKeyValueMap cachedPDs = - new WeakKeyValueMap(); + new WeakKeyValueMap<>(); private Set principalSet; private Principal[] principals; @@ -61,7 +57,8 @@ public class SubjectDomainCombiner implements java.security.DomainCombiner { "\t[SubjectDomainCombiner]"); // Note: check only at classloading time, not dynamically during combine() - private static final boolean useJavaxPolicy = compatPolicy(); + private static final boolean useJavaxPolicy = + javax.security.auth.Policy.isCustomPolicySet(debug); // Relevant only when useJavaxPolicy is true private static final boolean allowCaching = @@ -202,8 +199,8 @@ public class SubjectDomainCombiner implements java.security.DomainCombiner { return null; } - // maintain backwards compatibility for people who provide - // their own javax.security.auth.Policy implementations + // maintain backwards compatibility for developers who provide + // their own custom javax.security.auth.Policy implementations if (useJavaxPolicy) { return combineJavaxPolicy(currentDomains, assignedDomains); } @@ -476,8 +473,7 @@ public class SubjectDomainCombiner implements java.security.DomainCombiner { String s = AccessController.doPrivileged (new PrivilegedAction() { public String run() { - return java.security.Security.getProperty - ("cache.auth.policy"); + return Security.getProperty("cache.auth.policy"); } }); if (s != null) { @@ -488,29 +484,6 @@ public class SubjectDomainCombiner implements java.security.DomainCombiner { return true; } - // maintain backwards compatibility for people who provide - // their own javax.security.auth.Policy implementations - private static boolean compatPolicy() { - javax.security.auth.Policy javaxPolicy = AccessController.doPrivileged - (new PrivilegedAction() { - public javax.security.auth.Policy run() { - return javax.security.auth.Policy.getPolicy(); - } - }); - - if (!(javaxPolicy instanceof com.sun.security.auth.PolicyFile)) { - if (debug != null) { - debug.println("Providing backwards compatibility for " + - "javax.security.auth.policy implementation: " + - javaxPolicy.toString()); - } - - return true; - } else { - return false; - } - } - private static void printInputDomains(ProtectionDomain[] currentDomains, ProtectionDomain[] assignedDomains) { if (currentDomains == null || currentDomains.length == 0) { diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java b/jdk/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java index 09387897d2e..76dbf65afe0 100644 --- a/jdk/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java +++ b/jdk/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java @@ -361,7 +361,7 @@ final class KrbDelegationPermissionCollection extends PermissionCollection // Don't call out.defaultWriteObject() // Write out Vector - Vector permissions = new Vector(perms.size()); + Vector permissions = new Vector<>(perms.size()); synchronized (this) { permissions.addAll(perms); diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/ServicePermission.java b/jdk/src/share/classes/javax/security/auth/kerberos/ServicePermission.java index 98d2878154b..e9aedd09bc6 100644 --- a/jdk/src/share/classes/javax/security/auth/kerberos/ServicePermission.java +++ b/jdk/src/share/classes/javax/security/auth/kerberos/ServicePermission.java @@ -569,7 +569,7 @@ final class KrbServicePermissionCollection extends PermissionCollection // Don't call out.defaultWriteObject() // Write out Vector - Vector permissions = new Vector(perms.size()); + Vector permissions = new Vector<>(perms.size()); synchronized (this) { permissions.addAll(perms); diff --git a/jdk/src/share/classes/javax/security/auth/login/AppConfigurationEntry.java b/jdk/src/share/classes/javax/security/auth/login/AppConfigurationEntry.java index 0b02cd7e5bd..7c70d580cb9 100644 --- a/jdk/src/share/classes/javax/security/auth/login/AppConfigurationEntry.java +++ b/jdk/src/share/classes/javax/security/auth/login/AppConfigurationEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -167,7 +167,7 @@ public class AppConfigurationEntry { */ public String toString() { return (sun.security.util.ResourcesMgr.getString - ("LoginModuleControlFlag: ") + controlFlag); + ("LoginModuleControlFlag.") + controlFlag); } } } diff --git a/jdk/src/share/classes/javax/security/auth/login/LoginContext.java b/jdk/src/share/classes/javax/security/auth/login/LoginContext.java index ee46616d6a4..6fb484aa094 100644 --- a/jdk/src/share/classes/javax/security/auth/login/LoginContext.java +++ b/jdk/src/share/classes/javax/security/auth/login/LoginContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -244,7 +244,7 @@ public class LoginContext { if (name == null) throw new LoginException - (ResourcesMgr.getString("Invalid null input: name")); + (ResourcesMgr.getString("Invalid.null.input.name")); // get the Configuration if (config == null) { @@ -268,7 +268,7 @@ public class LoginContext { entries = config.getAppConfigurationEntry(OTHER); if (entries == null) { MessageFormat form = new MessageFormat(ResourcesMgr.getString - ("No LoginModules configured for name")); + ("No.LoginModules.configured.for.name")); Object[] source = {name}; throw new LoginException(form.format(source)); } @@ -382,7 +382,7 @@ public class LoginContext { init(name); if (subject == null) throw new LoginException - (ResourcesMgr.getString("invalid null Subject provided")); + (ResourcesMgr.getString("invalid.null.Subject.provided")); this.subject = subject; subjectProvided = true; loadDefaultCallbackHandler(); @@ -418,7 +418,7 @@ public class LoginContext { init(name); if (callbackHandler == null) throw new LoginException(ResourcesMgr.getString - ("invalid null CallbackHandler provided")); + ("invalid.null.CallbackHandler.provided")); this.callbackHandler = new SecureCallbackHandler (java.security.AccessController.getContext(), callbackHandler); @@ -459,7 +459,7 @@ public class LoginContext { this(name, subject); if (callbackHandler == null) throw new LoginException(ResourcesMgr.getString - ("invalid null CallbackHandler provided")); + ("invalid.null.CallbackHandler.provided")); this.callbackHandler = new SecureCallbackHandler (java.security.AccessController.getContext(), callbackHandler); @@ -633,7 +633,7 @@ public class LoginContext { public void logout() throws LoginException { if (subject == null) { throw new LoginException(ResourcesMgr.getString - ("null subject - logout called before login")); + ("null.subject.logout.called.before.login")); } if (configProvided) { @@ -811,21 +811,20 @@ public class LoginContext { } catch (NoSuchMethodException nsme) { MessageFormat form = new MessageFormat(ResourcesMgr.getString - ("unable to instantiate LoginModule, module, because " + - "it does not provide a no-argument constructor")); + ("unable.to.instantiate.LoginModule.module.because.it.does.not.provide.a.no.argument.constructor")); Object[] source = {moduleStack[i].entry.getLoginModuleName()}; throwException(null, new LoginException(form.format(source))); } catch (InstantiationException ie) { throwException(null, new LoginException(ResourcesMgr.getString - ("unable to instantiate LoginModule: ") + + ("unable.to.instantiate.LoginModule.") + ie.getMessage())); } catch (ClassNotFoundException cnfe) { throwException(null, new LoginException(ResourcesMgr.getString - ("unable to find LoginModule class: ") + + ("unable.to.find.LoginModule.class.") + cnfe.getMessage())); } catch (IllegalAccessException iae) { throwException(null, new LoginException(ResourcesMgr.getString - ("unable to access LoginModule: ") + + ("unable.to.access.LoginModule.") + iae.getMessage())); } catch (InvocationTargetException ite) { @@ -934,7 +933,7 @@ public class LoginContext { } else if (success == false) { // no module succeeded -- all modules were IGNORED throwException(new LoginException - (ResourcesMgr.getString("Login Failure: all modules ignored")), + (ResourcesMgr.getString("Login.Failure.all.modules.ignored")), null); } else { // success diff --git a/jdk/src/share/classes/javax/security/auth/x500/X500Principal.java b/jdk/src/share/classes/javax/security/auth/x500/X500Principal.java index d2966846752..5636856313c 100644 --- a/jdk/src/share/classes/javax/security/auth/x500/X500Principal.java +++ b/jdk/src/share/classes/javax/security/auth/x500/X500Principal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -155,12 +155,12 @@ public final class X500Principal implements Principal, java.io.Serializable { if (name == null) { throw new NullPointerException (sun.security.util.ResourcesMgr.getString - ("provided null name")); + ("provided.null.name")); } if (keywordMap == null) { throw new NullPointerException (sun.security.util.ResourcesMgr.getString - ("provided null keyword map")); + ("provided.null.keyword.map")); } try { @@ -391,7 +391,7 @@ public final class X500Principal implements Principal, java.io.Serializable { if (oidMap == null) { throw new NullPointerException (sun.security.util.ResourcesMgr.getString - ("provided null OID map")); + ("provided.null.OID.map")); } if (format != null) { if (format.equalsIgnoreCase(RFC1779)) { diff --git a/jdk/src/share/classes/javax/sound/midi/MidiDevice.java b/jdk/src/share/classes/javax/sound/midi/MidiDevice.java index 1e9f225d943..75d6638f681 100644 --- a/jdk/src/share/classes/javax/sound/midi/MidiDevice.java +++ b/jdk/src/share/classes/javax/sound/midi/MidiDevice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sound/midi/MidiSystem.java b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java index 8c0b5d9ebb5..b2a47dc9654 100644 --- a/jdk/src/share/classes/javax/sound/midi/MidiSystem.java +++ b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -310,7 +310,7 @@ public class MidiSystem { } else { transmitter = device.getTransmitter(); } - if (!(transmitter instanceof MidiDeviceReceiver)) { + if (!(transmitter instanceof MidiDeviceTransmitter)) { transmitter = new MidiDeviceTransmitterEnvelope(device, transmitter); } return transmitter; diff --git a/jdk/src/share/classes/javax/sound/midi/Receiver.java b/jdk/src/share/classes/javax/sound/midi/Receiver.java index 3ff16565c3c..9df0a5d7153 100644 --- a/jdk/src/share/classes/javax/sound/midi/Receiver.java +++ b/jdk/src/share/classes/javax/sound/midi/Receiver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sound/midi/Transmitter.java b/jdk/src/share/classes/javax/sound/midi/Transmitter.java index c9b173894e2..e78b800c728 100644 --- a/jdk/src/share/classes/javax/sound/midi/Transmitter.java +++ b/jdk/src/share/classes/javax/sound/midi/Transmitter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sound/sampled/AudioSystem.java b/jdk/src/share/classes/javax/sound/sampled/AudioSystem.java index d5f4e38c94e..3724cc2cdac 100644 --- a/jdk/src/share/classes/javax/sound/sampled/AudioSystem.java +++ b/jdk/src/share/classes/javax/sound/sampled/AudioSystem.java @@ -63,7 +63,7 @@ import com.sun.media.sound.JDK13Services; *

      Properties can be used to specify the default mixer * for specific line types. * Both system properties and a properties file are considered. - * In the Sun reference implementation, the properties file is + * In the Oracle reference implementation, the properties file is * "lib/sound.properties" in the JRE * directory. If a property exists both as a system property and in the * properties file, the system property takes precedence. If none is diff --git a/jdk/src/share/classes/javax/sound/sampled/Line.java b/jdk/src/share/classes/javax/sound/sampled/Line.java index 7d94243703d..dfab63470cc 100644 --- a/jdk/src/share/classes/javax/sound/sampled/Line.java +++ b/jdk/src/share/classes/javax/sound/sampled/Line.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sql/rowset/serial/SerialBlob.java b/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java index f8614e2478f..aed11246dde 100644 --- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java +++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -166,8 +166,9 @@ public class SerialBlob implements Blob, Serializable, Cloneable { length = (int)len; } - if (pos < 1 || length - pos < 0 ) { - throw new SerialException("Invalid arguments: position cannot be less that 1"); + if (pos < 1 || len - pos < 0 ) { + throw new SerialException("Invalid arguments: position cannot be " + + "less than 1 or greater than the length of the SerialBlob"); } pos--; // correct pos to array index diff --git a/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java b/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java index 0a05a01e031..5aa034f6854 100644 --- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java +++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * 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,9 +25,7 @@ package javax.sql.rowset.serial; -import java.sql.*; import java.io.*; -import java.util.Map; import java.lang.reflect.*; import javax.sql.rowset.RowSetWarning; @@ -51,7 +49,7 @@ public class SerialJavaObject implements Serializable, Cloneable { /** * Placeholder for object to be serialized. */ - private Object obj; + private final Object obj; /** @@ -64,8 +62,7 @@ public class SerialJavaObject implements Serializable, Cloneable { *

      * * @param obj the Java Object to be serialized - * @throws SerialException if the object is found - * to be unserializable + * @throws SerialException if the object is found not to be serializable */ public SerialJavaObject(Object obj) throws SerialException { @@ -74,16 +71,11 @@ public class SerialJavaObject implements Serializable, Cloneable { // get Class. Object instance should always be available - Class c = obj.getClass(); + Class c = obj.getClass(); // determine if object implements Serializable i/f - boolean serializableImpl = false; - Class[] theIf = c.getInterfaces(); - for (int i = 0; i < theIf.length; i++) { - String ifName = theIf[i].getName(); - if (ifName == "java.io.Serializable") { - serializableImpl = true; - } + if (!(obj instanceof java.io.Serializable)) { + setWarning(new RowSetWarning("Warning, the object passed to the constructor does not implement Serializable")); } // can only determine public fields (obviously). If @@ -93,22 +85,14 @@ public class SerialJavaObject implements Serializable, Cloneable { boolean anyStaticFields = false; fields = c.getFields(); - //fields = new Object[field.length]; for (int i = 0; i < fields.length; i++ ) { if ( fields[i].getModifiers() == Modifier.STATIC ) { anyStaticFields = true; } - //fields[i] = field[i].get(obj); - } - try { - if (!(serializableImpl)) { - throw new RowSetWarning("Test"); - } - } catch (RowSetWarning w) { - setWarning(w); } + if (anyStaticFields) { throw new SerialException("Located static fields in " + "object instance. Cannot serialize"); @@ -139,11 +123,8 @@ public class SerialJavaObject implements Serializable, Cloneable { */ public Field[] getFields() throws SerialException { if (fields != null) { - Class c = this.obj.getClass(); - //the following has to be commented before mustang integration - //return c.getFields(); - //the following has to be uncommented before mustang integration - return sun.reflect.misc.FieldUtil.getFields(c); + Class c = this.obj.getClass(); + return c.getFields(); } else { throw new SerialException("SerialJavaObject does not contain" + " a serialized object instance"); diff --git a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java index 4c8d6b48e0a..f3358e0fb12 100644 --- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java +++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java @@ -197,12 +197,6 @@ import javax.naming.*; */ public class SyncFactory { - /* - * The variable that represents the singleton instance - * of the SyncFactory class. - */ - private static SyncFactory syncFactory = null; - /** * Creates a new SyncFactory object, which is the singleton * instance. @@ -252,7 +246,7 @@ public class SyncFactory { /** * The Logger object to be used by the SyncFactory. */ - private static Logger rsLogger; + private static volatile Logger rsLogger; /** * */ @@ -315,27 +309,12 @@ public class SyncFactory { * @return the SyncFactory instance */ public static SyncFactory getSyncFactory() { - - // This method uses the Singleton Design Pattern - // with Double-Checked Locking Pattern for - // 1. Creating single instance of the SyncFactory - // 2. Make the class thread safe, so that at one time - // only one thread enters the synchronized block - // to instantiate. - - // if syncFactory object is already there - // don't go into synchronized block and return - // that object. - // else go into synchronized block - - if (syncFactory == null) { - synchronized (SyncFactory.class) { - if (syncFactory == null) { - syncFactory = new SyncFactory(); - } //end if - } //end synchronized block - } //end if - return syncFactory; + /* + * Using Initialization on Demand Holder idiom as + * Effective Java 2nd Edition,ITEM 71, indicates it is more performant + * than the Double-Check Locking idiom. + */ + return SyncFactoryHolder.factory; } /** @@ -435,11 +414,7 @@ public class SyncFactory { } } } - /** - * The internal boolean switch that indicates whether a JNDI - * context has been established or not. - */ - private static boolean jndiCtxEstablished = false; + /** * The internal debug switch. */ @@ -621,6 +596,7 @@ public class SyncFactory { * @param logger A Logger object instance * @throws java.lang.SecurityException if a security manager exists and its * {@code checkPermission} method denies calling {@code setLogger} + * @throws NullPointerException if the logger is null * @see SecurityManager#checkPermission */ public static void setLogger(Logger logger) { @@ -629,6 +605,10 @@ public class SyncFactory { if (sec != null) { sec.checkPermission(SET_SYNCFACTORY_PERMISSION); } + + if(logger == null){ + throw new NullPointerException("You must provide a Logger"); + } rsLogger = logger; } @@ -654,6 +634,7 @@ public class SyncFactory { * {@code checkPermission} method denies calling {@code setLogger} * @throws java.util.logging.LoggingPermission if a security manager exists and its * {@code checkPermission} method denies calling {@code setLevel} + * @throws NullPointerException if the logger is null * @see SecurityManager#checkPermission * @see LoggingPermission */ @@ -663,8 +644,12 @@ public class SyncFactory { if (sec != null) { sec.checkPermission(SET_SYNCFACTORY_PERMISSION); } + + if(logger == null){ + throw new NullPointerException("You must provide a Logger"); + } + logger.setLevel(level); rsLogger = logger; - rsLogger.setLevel(level); } /** @@ -674,11 +659,14 @@ public class SyncFactory { * @throws SyncFactoryException if no logging object has been set. */ public static Logger getLogger() throws SyncFactoryException { + + Logger result = rsLogger; // only one logger per session - if (rsLogger == null) { + if (result == null) { throw new SyncFactoryException("(SyncFactory) : No logger has been set"); } - return rsLogger; + + return result; } /** @@ -699,7 +687,7 @@ public class SyncFactory { * {@code checkPermission} method denies calling {@code setJNDIContext} * @see SecurityManager#checkPermission */ - public static void setJNDIContext(javax.naming.Context ctx) + public static synchronized void setJNDIContext(javax.naming.Context ctx) throws SyncFactoryException { SecurityManager sec = System.getSecurityManager(); if (sec != null) { @@ -709,17 +697,16 @@ public class SyncFactory { throw new SyncFactoryException("Invalid JNDI context supplied"); } ic = ctx; - jndiCtxEstablished = true; } /** - * Controls JNDI context intialization. + * Controls JNDI context initialization. * * @throws SyncFactoryException if an error occurs parsing the JNDI context */ - private static void initJNDIContext() throws SyncFactoryException { + private static synchronized void initJNDIContext() throws SyncFactoryException { - if (jndiCtxEstablished && (ic != null) && (lazyJNDICtxRefresh == false)) { + if ((ic != null) && (lazyJNDICtxRefresh == false)) { try { parseProperties(parseJNDIContext()); lazyJNDICtxRefresh = true; // touch JNDI namespace once. @@ -793,6 +780,13 @@ public class SyncFactory { enumerateBindings(bindings, properties); } } + + /** + * Lazy initialization Holder class used by {@code getSyncFactory} + */ + private static class SyncFactoryHolder { + static final SyncFactory factory = new SyncFactory(); + } } /** diff --git a/jdk/src/share/classes/javax/swing/AbstractButton.java b/jdk/src/share/classes/javax/swing/AbstractButton.java index e03c9b97107..aac3be32aa4 100644 --- a/jdk/src/share/classes/javax/swing/AbstractButton.java +++ b/jdk/src/share/classes/javax/swing/AbstractButton.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1379,6 +1379,10 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl * If true and the button has a border, * the border is painted. The default value for the * borderPainted property is true. + *

      + * Some look and feels might not support + * the borderPainted property, + * in which case they ignore this. * * @param b if true and border property is not null, * the border is painted diff --git a/jdk/src/share/classes/javax/swing/BorderFactory.java b/jdk/src/share/classes/javax/swing/BorderFactory.java index 0f53bed4560..8da7dd9579a 100644 --- a/jdk/src/share/classes/javax/swing/BorderFactory.java +++ b/jdk/src/share/classes/javax/swing/BorderFactory.java @@ -24,8 +24,10 @@ */ package javax.swing; +import java.awt.BasicStroke; import java.awt.Color; import java.awt.Font; +import java.awt.Paint; import javax.swing.border.*; /** @@ -271,7 +273,7 @@ public class BorderFactory * @since 1.7 */ public static Border createSoftBevelBorder(int type, Color highlight, Color shadow) { - return new BevelBorder(type, highlight, shadow); + return new SoftBevelBorder(type, highlight, shadow); } /** @@ -293,7 +295,7 @@ public class BorderFactory * @since 1.7 */ public static Border createSoftBevelBorder(int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) { - return new BevelBorder(type, highlightOuter, highlightInner, shadowOuter, shadowInner); + return new SoftBevelBorder(type, highlightOuter, highlightInner, shadowOuter, shadowInner); } //// EtchedBorder /////////////////////////////////////////////////////////// @@ -636,4 +638,125 @@ public class BorderFactory Icon tileIcon) { return new MatteBorder(top, left, bottom, right, tileIcon); } + +//// StrokeBorder ////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + /** + * Creates a border of the specified {@code stroke}. + * The component's foreground color will be used to render the border. + * + * @param stroke the {@link BasicStroke} object used to stroke a shape + * @return the {@code Border} object + * + * @throws NullPointerException if the specified {@code stroke} is {@code null} + * + * @since 1.7 + */ + public static Border createStrokeBorder(BasicStroke stroke) { + return new StrokeBorder(stroke); + } + + /** + * Creates a border of the specified {@code stroke} and {@code paint}. + * If the specified {@code paint} is {@code null}, + * the component's foreground color will be used to render the border. + * + * @param stroke the {@link BasicStroke} object used to stroke a shape + * @param paint the {@link Paint} object used to generate a color + * @return the {@code Border} object + * + * @throws NullPointerException if the specified {@code stroke} is {@code null} + * + * @since 1.7 + */ + public static Border createStrokeBorder(BasicStroke stroke, Paint paint) { + return new StrokeBorder(stroke, paint); + } + +//// DashedBorder ////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + private static Border sharedDashedBorder; + + /** + * Creates a dashed border of the specified {@code paint}. + * If the specified {@code paint} is {@code null}, + * the component's foreground color will be used to render the border. + * The width of a dash line is equal to {@code 1}. + * The relative length of a dash line and + * the relative spacing between dash lines are equal to {@code 1}. + * A dash line is not rounded. + * + * @param paint the {@link Paint} object used to generate a color + * @return the {@code Border} object + * + * @since 1.7 + */ + public static Border createDashedBorder(Paint paint) { + return createDashedBorder(paint, 1.0f, 1.0f, 1.0f, false); + } + + /** + * Creates a dashed border of the specified {@code paint}, + * relative {@code length}, and relative {@code spacing}. + * If the specified {@code paint} is {@code null}, + * the component's foreground color will be used to render the border. + * The width of a dash line is equal to {@code 1}. + * A dash line is not rounded. + * + * @param paint the {@link Paint} object used to generate a color + * @param length the relative length of a dash line + * @param spacing the relative spacing between dash lines + * @return the {@code Border} object + * + * @throws IllegalArgumentException if the specified {@code length} is less than {@code 1}, or + * if the specified {@code spacing} is less than {@code 0} + * @since 1.7 + */ + public static Border createDashedBorder(Paint paint, float length, float spacing) { + return createDashedBorder(paint, 1.0f, length, spacing, false); + } + + /** + * Creates a dashed border of the specified {@code paint}, {@code thickness}, + * line shape, relative {@code length}, and relative {@code spacing}. + * If the specified {@code paint} is {@code null}, + * the component's foreground color will be used to render the border. + * + * @param paint the {@link Paint} object used to generate a color + * @param thickness the width of a dash line + * @param length the relative length of a dash line + * @param spacing the relative spacing between dash lines + * @param rounded whether or not line ends should be round + * @return the {@code Border} object + * + * @throws IllegalArgumentException if the specified {@code thickness} is less than {@code 1}, or + * if the specified {@code length} is less than {@code 1}, or + * if the specified {@code spacing} is less than {@code 0} + * @since 1.7 + */ + public static Border createDashedBorder(Paint paint, float thickness, float length, float spacing, boolean rounded) { + boolean shared = !rounded && (paint == null) && (thickness == 1.0f) && (length == 1.0f) && (spacing == 1.0f); + if (shared && (sharedDashedBorder != null)) { + return sharedDashedBorder; + } + if (thickness < 1.0f) { + throw new IllegalArgumentException("thickness is less than 1"); + } + if (length < 1.0f) { + throw new IllegalArgumentException("length is less than 1"); + } + if (spacing < 0.0f) { + throw new IllegalArgumentException("spacing is less than 0"); + } + int cap = rounded ? BasicStroke.CAP_ROUND : BasicStroke.CAP_SQUARE; + int join = rounded ? BasicStroke.JOIN_ROUND : BasicStroke.JOIN_MITER; + float[] array = { thickness * (length - 1.0f), thickness * (spacing + 1.0f) }; + Border border = createStrokeBorder(new BasicStroke(thickness, cap, join, thickness * 2.0f, array, 0.0f), paint); + if (shared) { + sharedDashedBorder = border; + } + return border; + } } diff --git a/jdk/src/share/classes/javax/swing/DebugGraphics.java b/jdk/src/share/classes/javax/swing/DebugGraphics.java index 0549e231cfb..a41e9c62f55 100644 --- a/jdk/src/share/classes/javax/swing/DebugGraphics.java +++ b/jdk/src/share/classes/javax/swing/DebugGraphics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1322,13 +1322,11 @@ public class DebugGraphics extends Graphics { } String toShortString() { - StringBuffer buffer = new StringBuffer("Graphics" + (isDrawingBuffer() ? "" : "") + "(" + graphicsID + "-" + debugOptions + ")"); - return buffer.toString(); + return "Graphics" + (isDrawingBuffer() ? "" : "") + "(" + graphicsID + "-" + debugOptions + ")"; } String pointToString(int x, int y) { - StringBuffer buffer = new StringBuffer("(" + x + ", " + y + ")"); - return buffer.toString(); + return "(" + x + ", " + y + ")"; } /** Enables/disables diagnostic information about every graphics diff --git a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java index d531526265c..8ab24e56dd7 100644 --- a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java +++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -359,7 +359,22 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab f.getWidth()-1, f.getHeight()-1); } g.drawRect( newX, newY, f.getWidth()-1, f.getHeight()-1); - currentLoc = new Point (newX, newY); + /* Work around for 6635462: XOR mode may cause a SurfaceLost on first use. + * Swing doesn't expect that its XOR drawRect did + * not complete, so believes that on re-entering at + * the next update location, that there is an XOR rect + * to draw out at "currentLoc". But in fact + * its now got a new clean surface without that rect, + * so drawing it "out" in fact draws it on, leaving garbage. + * So only update/set currentLoc if the draw completed. + */ + sun.java2d.SurfaceData sData = + ((sun.java2d.SunGraphics2D)g).getSurfaceData(); + + if (!sData.isSurfaceLost()) { + currentLoc = new Point (newX, newY); + } +; g.dispose(); } } else if (dragMode == FASTER_DRAG_MODE) { @@ -412,7 +427,14 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab g.drawRect( currentBounds.x, currentBounds.y, currentBounds.width-1, currentBounds.height-1); } g.drawRect( newX, newY, newWidth-1, newHeight-1); - currentBounds = new Rectangle (newX, newY, newWidth, newHeight); + + // Work around for 6635462, see comment in dragFrame() + sun.java2d.SurfaceData sData = + ((sun.java2d.SunGraphics2D)g).getSurfaceData(); + if (!sData.isSurfaceLost()) { + currentBounds = new Rectangle (newX, newY, newWidth, newHeight); + } + g.setPaintMode(); g.dispose(); } diff --git a/jdk/src/share/classes/javax/swing/GroupLayout.java b/jdk/src/share/classes/javax/swing/GroupLayout.java index 7628076a994..ba29f7cdbdb 100644 --- a/jdk/src/share/classes/javax/swing/GroupLayout.java +++ b/jdk/src/share/classes/javax/swing/GroupLayout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 @@ public class GroupLayout implements LayoutManager2 { */ public ParallelGroup createParallelGroup(Alignment alignment, boolean resizable){ + if (alignment == null) { + throw new IllegalArgumentException("alignment must be non null"); + } + if (alignment == Alignment.BASELINE) { return new BaselineGroup(resizable); } diff --git a/jdk/src/share/classes/javax/swing/JColorChooser.java b/jdk/src/share/classes/javax/swing/JColorChooser.java index 20760ada494..05270e61c97 100644 --- a/jdk/src/share/classes/javax/swing/JColorChooser.java +++ b/jdk/src/share/classes/javax/swing/JColorChooser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/JComponent.java b/jdk/src/share/classes/javax/swing/JComponent.java index f94a797ae6c..9ef57bacadd 100644 --- a/jdk/src/share/classes/javax/swing/JComponent.java +++ b/jdk/src/share/classes/javax/swing/JComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -4734,6 +4734,8 @@ public abstract class JComponent extends Container implements Serializable, * Notifies this component that it now has a parent component. * When this method is invoked, the chain of parent components is * set up with KeyboardAction event listeners. + * This method is called by the toolkit internally and should + * not be called directly by programs. * * @see #registerKeyboardAction */ @@ -4750,6 +4752,8 @@ public abstract class JComponent extends Container implements Serializable, * Notifies this component that it no longer has a parent component. * When this method is invoked, any KeyboardActions * set up in the the chain of parent components are removed. + * This method is called by the toolkit internally and should + * not be called directly by programs. * * @see #registerKeyboardAction */ @@ -4783,21 +4787,11 @@ public abstract class JComponent extends Container implements Serializable, * @param y the y value of the dirty region * @param width the width of the dirty region * @param height the height of the dirty region + * @see #isPaintingOrigin() * @see java.awt.Component#isShowing * @see RepaintManager#addDirtyRegion */ public void repaint(long tm, int x, int y, int width, int height) { - Container p = this; - while ((p = p.getParent()) instanceof JComponent) { - JComponent jp = (JComponent) p; - if (jp.isPaintingOrigin()) { - Rectangle rectangle = SwingUtilities.convertRectangle( - this, new Rectangle(x, y, width, height), jp); - jp.repaint(tm, - rectangle.x, rectangle.y, rectangle.width, rectangle.height); - return; - } - } RepaintManager.currentManager(this).addDirtyRegion(this, x, y, width, height); } @@ -4808,6 +4802,7 @@ public abstract class JComponent extends Container implements Serializable, * currently pending events have been dispatched. * * @param r a Rectangle containing the dirty region + * @see #isPaintingOrigin() * @see java.awt.Component#isShowing * @see RepaintManager#addDirtyRegion */ @@ -4912,13 +4907,19 @@ public abstract class JComponent extends Container implements Serializable, } /** - * Returns true if a paint triggered on a child component should cause + * Returns {@code true} if a paint triggered on a child component should cause * painting to originate from this Component, or one of its ancestors. + *

      + * Calling {@link JComponent#repaint} on a Swing component will be delegated to + * the first ancestor which {@code isPaintingOrigin()} returns {@true}, + * if there are any. + *

      + * {@code JComponent} subclasses that need to be repainted when any of their + * children are repainted should override this method to return {@code true}. * - * @return true if painting should originate from this Component or - * one of its ancestors. + * @return always returns {@code false} */ - boolean isPaintingOrigin() { + protected boolean isPaintingOrigin() { return false; } diff --git a/jdk/src/share/classes/javax/swing/JDesktopPane.java b/jdk/src/share/classes/javax/swing/JDesktopPane.java index 7ad6753d5e0..579d65af3d0 100644 --- a/jdk/src/share/classes/javax/swing/JDesktopPane.java +++ b/jdk/src/share/classes/javax/swing/JDesktopPane.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/JDialog.java b/jdk/src/share/classes/javax/swing/JDialog.java index 1c8edf354ac..a4e35b66351 100644 --- a/jdk/src/share/classes/javax/swing/JDialog.java +++ b/jdk/src/share/classes/javax/swing/JDialog.java @@ -154,8 +154,8 @@ public class JDialog extends Dialog implements WindowConstants, } /** - * Creates a modeless dialog without a title with the - * specified {@code Frame} as its owner. If {@code owner} + * Creates a modeless dialog with the specified {@code Frame} + * as its owner and an empty title. If {@code owner} * is {@code null}, a shared, hidden frame will be set as the * owner of the dialog. *

      @@ -179,8 +179,8 @@ public class JDialog extends Dialog implements WindowConstants, } /** - * Creates a dialog with the specified owner {@code Frame}, modality - * and an empty title. If {@code owner} is {@code null}, + * Creates a dialog with an empty title and the specified modality and + * {@code Frame} as its owner. If {@code owner} is {@code null}, * a shared, hidden frame will be set as the owner of the dialog. *

      * This constructor sets the component's locale property to the value @@ -202,7 +202,7 @@ public class JDialog extends Dialog implements WindowConstants, * @see JComponent#getDefaultLocale */ public JDialog(Frame owner, boolean modal) { - this(owner, null, modal); + this(owner, "", modal); } /** @@ -303,10 +303,9 @@ public class JDialog extends Dialog implements WindowConstants, * @param modal specifies whether dialog blocks user input to other top-level * windows when shown. If {@code true}, the modality type property is set to * {@code DEFAULT_MODALITY_TYPE}, otherwise the dialog is modeless. - * @param gc the {@code GraphicsConfiguration} - * of the target screen device. If {@code gc} is - * {@code null}, the same - * {@code GraphicsConfiguration} as the owning Frame is used. + * @param gc the {@code GraphicsConfiguration} of the target screen device; + * if {@code null}, the default system {@code GraphicsConfiguration} + * is assumed * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()} * returns {@code true}. * @see java.awt.Dialog.ModalityType @@ -331,8 +330,8 @@ public class JDialog extends Dialog implements WindowConstants, } /** - * Creates a modeless dialog without a title with the - * specified {@code Dialog} as its owner. + * Creates a modeless dialog with the specified {@code Dialog} + * as its owner and an empty title. *

      * This constructor sets the component's locale property to the value * returned by {@code JComponent.getDefaultLocale}. @@ -349,7 +348,8 @@ public class JDialog extends Dialog implements WindowConstants, } /** - * Creates a dialog with the specified owner {@code Dialog} and modality. + * Creates a dialog with an empty title and the specified modality and + * {@code Dialog} as its owner. *

      * This constructor sets the component's locale property to the value * returned by {@code JComponent.getDefaultLocale}. @@ -370,7 +370,7 @@ public class JDialog extends Dialog implements WindowConstants, * @see JComponent#getDefaultLocale */ public JDialog(Dialog owner, boolean modal) { - this(owner, null, modal); + this(owner, "", modal); } /** @@ -441,10 +441,9 @@ public class JDialog extends Dialog implements WindowConstants, * @param modal specifies whether dialog blocks user input to other top-level * windows when shown. If {@code true}, the modality type property is set to * {@code DEFAULT_MODALITY_TYPE}, otherwise the dialog is modeless - * @param gc the {@code GraphicsConfiguration} - * of the target screen device. If {@code gc} is - * {@code null}, the same - * {@code GraphicsConfiguration} as the owning Dialog is used. + * @param gc the {@code GraphicsConfiguration} of the target screen device; + * if {@code null}, the default system {@code GraphicsConfiguration} + * is assumed * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()} * returns {@code true}. * @see java.awt.Dialog.ModalityType @@ -463,8 +462,8 @@ public class JDialog extends Dialog implements WindowConstants, } /** - * Creates a modeless dialog with the specified owner {@code Window} and - * an empty title. + * Creates a modeless dialog with the specified {@code Window} + * as its owner and an empty title. *

      * This constructor sets the component's locale property to the value * returned by {@code JComponent.getDefaultLocale}. @@ -490,8 +489,8 @@ public class JDialog extends Dialog implements WindowConstants, } /** - * Creates a dialog with the specified owner {@code Window}, modality - * and an empty title. + * Creates a dialog with an empty title and the specified modality and + * {@code Window} as its owner. *

      * This constructor sets the component's locale property to the value * returned by {@code JComponent.getDefaultLocale}. @@ -522,7 +521,7 @@ public class JDialog extends Dialog implements WindowConstants, * @since 1.6 */ public JDialog(Window owner, ModalityType modalityType) { - this(owner, null, modalityType); + this(owner, "", modalityType); } /** @@ -612,10 +611,8 @@ public class JDialog extends Dialog implements WindowConstants, * windows when shown. {@code null} value and unsupported modality * types are equivalent to {@code MODELESS} * @param gc the {@code GraphicsConfiguration} of the target screen device; - * if {@code null}, the {@code GraphicsConfiguration} from the owning - * window is used; if {@code owner} is also {@code null}, the - * system default {@code GraphicsConfiguration} is assumed - * + * if {@code null}, the default system {@code GraphicsConfiguration} + * is assumed * @throws IllegalArgumentException * if the {@code owner} is not an instance of {@link java.awt.Dialog Dialog} * or {@link java.awt.Frame Frame} diff --git a/jdk/src/share/classes/javax/swing/JEditorPane.java b/jdk/src/share/classes/javax/swing/JEditorPane.java index 79eb00a18f3..acc91080086 100644 --- a/jdk/src/share/classes/javax/swing/JEditorPane.java +++ b/jdk/src/share/classes/javax/swing/JEditorPane.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/JLayer.java b/jdk/src/share/classes/javax/swing/JLayer.java index eab0bf4ab2f..764e553fd61 100644 --- a/jdk/src/share/classes/javax/swing/JLayer.java +++ b/jdk/src/share/classes/javax/swing/JLayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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 sun.awt.AWTAccessor; import javax.swing.plaf.LayerUI; import javax.swing.border.Border; +import javax.accessibility.*; import java.awt.*; import java.awt.event.*; import java.beans.PropertyChangeEvent; @@ -149,7 +150,7 @@ import java.security.PrivilegedAction; */ public final class JLayer extends JComponent - implements Scrollable, PropertyChangeListener { + implements Scrollable, PropertyChangeListener, Accessible { private V view; // this field is necessary because JComponent.ui is transient // when layerUI is serializable @@ -321,7 +322,7 @@ public final class JLayer } /** - * A non-{@code null] border, or non-zero insets, isn't supported, to prevent the geometry + * A non-{@code null} border, or non-zero insets, isn't supported, to prevent the geometry * of this component from becoming complex enough to inhibit * subclassing of {@code LayerUI} class. To create a {@code JLayer} with a border, * add it to a {@code JPanel} that has a border. @@ -372,8 +373,12 @@ public final class JLayer * {@inheritDoc} */ public void removeAll() { - setView(null); - setGlassPane(null); + if (view != null) { + setView(null); + } + if (glassPane != null) { + setGlassPane(null); + } } /** @@ -383,7 +388,7 @@ public final class JLayer * @return true * @see JComponent#isPaintingOrigin() */ - boolean isPaintingOrigin() { + protected boolean isPaintingOrigin() { return true; } @@ -665,6 +670,22 @@ public final class JLayer } } + /** + * Gets the AccessibleContext associated with this {@code JLayer}. + * + * @return the AccessibleContext associated with this {@code JLayer}. + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJComponent() { + public AccessibleRole getAccessibleRole() { + return AccessibleRole.PANEL; + } + }; + } + return accessibleContext; + } + /** * static AWTEventListener to be shared with all AbstractLayerUIs */ diff --git a/jdk/src/share/classes/javax/swing/JList.java b/jdk/src/share/classes/javax/swing/JList.java index 46ae9142490..ad22fc38e52 100644 --- a/jdk/src/share/classes/javax/swing/JList.java +++ b/jdk/src/share/classes/javax/swing/JList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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 156b9e4fb99..8d188b95bf8 100644 --- a/jdk/src/share/classes/javax/swing/JSlider.java +++ b/jdk/src/share/classes/javax/swing/JSlider.java @@ -40,7 +40,8 @@ import java.beans.*; /** * A component that lets the user graphically select a value by sliding - * a knob within a bounded interval. + * a knob within a bounded interval. The knob is always positioned + * at the points that match integer values within the specified interval. *

      * The slider can show both * major tick marks, and minor tick marks between the major ones. The number of diff --git a/jdk/src/share/classes/javax/swing/JSplitPane.java b/jdk/src/share/classes/javax/swing/JSplitPane.java index b6956f9b498..d947329d663 100644 --- a/jdk/src/share/classes/javax/swing/JSplitPane.java +++ b/jdk/src/share/classes/javax/swing/JSplitPane.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/JTabbedPane.java b/jdk/src/share/classes/javax/swing/JTabbedPane.java index 1d548438774..6c71657781a 100644 --- a/jdk/src/share/classes/javax/swing/JTabbedPane.java +++ b/jdk/src/share/classes/javax/swing/JTabbedPane.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1443,6 +1443,10 @@ public class JTabbedPane extends JComponent * which can be null, in which case the tab's background color * will default to the background color of the tabbedpane. * An internal exception is raised if there is no tab at that index. + *

      + * It is up to the look and feel to honor this property, some may + * choose to ignore it. + * * @param index the tab index where the background should be set * @param background the color to be displayed in the tab's background * @exception IndexOutOfBoundsException if index is out of range @@ -1472,6 +1476,9 @@ public class JTabbedPane extends JComponent * null, in which case the tab's foreground color * will default to the foreground color of this tabbedpane. * An internal exception is raised if there is no tab at that index. + *

      + * It is up to the look and feel to honor this property, some may + * choose to ignore it. * * @param index the tab index where the foreground should be set * @param foreground the color to be displayed as the tab's foreground diff --git a/jdk/src/share/classes/javax/swing/JTable.java b/jdk/src/share/classes/javax/swing/JTable.java index 7842410e772..386b2a4628a 100644 --- a/jdk/src/share/classes/javax/swing/JTable.java +++ b/jdk/src/share/classes/javax/swing/JTable.java @@ -2491,7 +2491,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * The default value of this property is defined by the look * and feel implementation. *

      - * This is a JavaBeans bound property. + * This is a JavaBeans bound property. * * @param selectionForeground the Color to use in the foreground * for selected list items @@ -2529,7 +2529,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * The default value of this property is defined by the look * and feel implementation. *

      - * This is a JavaBeans bound property. + * This is a JavaBeans bound property. * * @param selectionBackground the Color to use for the background * of selected cells diff --git a/jdk/src/share/classes/javax/swing/JTextField.java b/jdk/src/share/classes/javax/swing/JTextField.java index 90e8ea69885..6451246bf3a 100644 --- a/jdk/src/share/classes/javax/swing/JTextField.java +++ b/jdk/src/share/classes/javax/swing/JTextField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/JTree.java b/jdk/src/share/classes/javax/swing/JTree.java index c99584ed341..13a40562ebe 100644 --- a/jdk/src/share/classes/javax/swing/JTree.java +++ b/jdk/src/share/classes/javax/swing/JTree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/JViewport.java b/jdk/src/share/classes/javax/swing/JViewport.java index 97dacb30b4b..80a124a41dc 100644 --- a/jdk/src/share/classes/javax/swing/JViewport.java +++ b/jdk/src/share/classes/javax/swing/JViewport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -637,14 +637,14 @@ public class JViewport extends JComponent implements Accessible } /** - * Returns true if scroll mode is a BACKINGSTORE_SCROLL_MODE to cause - * painting to originate from JViewport, or one of its - * ancestors. Otherwise returns false. + * Returns true if scroll mode is a {@code BACKINGSTORE_SCROLL_MODE} to cause + * painting to originate from {@code JViewport}, or one of its + * ancestors. Otherwise returns {@code false}. * - * @return true if if scroll mode is a BACKINGSTORE_SCROLL_MODE. + * @return true if if scroll mode is a {@code BACKINGSTORE_SCROLL_MODE}. * @see JComponent#isPaintingOrigin() */ - boolean isPaintingOrigin() { + protected boolean isPaintingOrigin() { return scrollMode == BACKINGSTORE_SCROLL_MODE; } diff --git a/jdk/src/share/classes/javax/swing/Popup.java b/jdk/src/share/classes/javax/swing/Popup.java index a77d574d72e..72f9f6af321 100644 --- a/jdk/src/share/classes/javax/swing/Popup.java +++ b/jdk/src/share/classes/javax/swing/Popup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -156,7 +156,8 @@ public class Popup { component.setLocation(ownerX, ownerY); component.getContentPane().add(contents, BorderLayout.CENTER); - contents.invalidate(); + component.invalidate(); + component.validate(); if(component.isVisible()) { // Do not call pack() if window is not visible to // avoid early native peer creation diff --git a/jdk/src/share/classes/javax/swing/RepaintManager.java b/jdk/src/share/classes/javax/swing/RepaintManager.java index d1166f90633..062d2e70b09 100644 --- a/jdk/src/share/classes/javax/swing/RepaintManager.java +++ b/jdk/src/share/classes/javax/swing/RepaintManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -438,6 +438,7 @@ public class RepaintManager * @param y Y coordinate of the region to repaint * @param w Width of the region to repaint * @param h Height of the region to repaint + * @see JComponent#isPaintingOrigin() * @see JComponent#repaint */ public void addDirtyRegion(JComponent c, int x, int y, int w, int h) @@ -447,6 +448,16 @@ public class RepaintManager delegate.addDirtyRegion(c, x, y, w, h); return; } + Container p = c; + while ((p = p.getParent()) instanceof JComponent) { + JComponent jp = (JComponent) p; + if (jp.isPaintingOrigin()) { + Rectangle rectangle = SwingUtilities.convertRectangle( + c, new Rectangle(x, y, w, h), jp); + jp.repaint(0, rectangle.x, rectangle.y, rectangle.width, rectangle.height); + return; + } + } addDirtyRegion0(c, x, y, w, h); } diff --git a/jdk/src/share/classes/javax/swing/SwingUtilities.java b/jdk/src/share/classes/javax/swing/SwingUtilities.java index a30ad8b7ae2..61dde01e93c 100644 --- a/jdk/src/share/classes/javax/swing/SwingUtilities.java +++ b/jdk/src/share/classes/javax/swing/SwingUtilities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ToolTipManager.java b/jdk/src/share/classes/javax/swing/ToolTipManager.java index ff4aa2c2ac9..4088ac3c2d5 100644 --- a/jdk/src/share/classes/javax/swing/ToolTipManager.java +++ b/jdk/src/share/classes/javax/swing/ToolTipManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/UIDefaults.java b/jdk/src/share/classes/javax/swing/UIDefaults.java index 2a9056f539b..6b98a492824 100644 --- a/jdk/src/share/classes/javax/swing/UIDefaults.java +++ b/jdk/src/share/classes/javax/swing/UIDefaults.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/border/StrokeBorder.java b/jdk/src/share/classes/javax/swing/border/StrokeBorder.java new file mode 100644 index 00000000000..b2538bae2dc --- /dev/null +++ b/jdk/src/share/classes/javax/swing/border/StrokeBorder.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package javax.swing.border; + +import java.awt.BasicStroke; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.Paint; +import java.awt.RenderingHints; +import java.awt.geom.Rectangle2D; +import java.beans.ConstructorProperties; + +/** + * A class which implements a border of an arbitrary stroke. + *

      + * Warning: + * Serialized objects of this class will not be compatible with + * future Swing releases. The current serialization support is + * appropriate for short term storage or RMI + * between applications running the same version of Swing. + * As of 1.4, support for long term storage of all JavaBeans™ + * has been added to the java.beans package. + * Please see {@link java.beans.XMLEncoder}. + * + * @author Sergey A. Malenkov + * + * @since 1.7 + */ +public class StrokeBorder extends AbstractBorder { + private final BasicStroke stroke; + private final Paint paint; + + /** + * Creates a border of the specified {@code stroke}. + * The component's foreground color will be used to render the border. + * + * @param stroke the {@link BasicStroke} object used to stroke a shape + * + * @throws NullPointerException if the specified {@code stroke} is {@code null} + */ + public StrokeBorder(BasicStroke stroke) { + this(stroke, null); + } + + /** + * Creates a border of the specified {@code stroke} and {@code paint}. + * If the specified {@code paint} is {@code null}, + * the component's foreground color will be used to render the border. + * + * @param stroke the {@link BasicStroke} object used to stroke a shape + * @param paint the {@link Paint} object used to generate a color + * + * @throws NullPointerException if the specified {@code stroke} is {@code null} + */ + @ConstructorProperties({ "stroke", "paint" }) + public StrokeBorder(BasicStroke stroke, Paint paint) { + if (stroke == null) { + throw new NullPointerException("border's stroke"); + } + this.stroke = stroke; + this.paint = paint; + } + + /** + * Paints the border for the specified component + * with the specified position and size. + * + * @param c the component for which this border is being painted + * @param g the paint graphics + * @param x the x position of the painted border + * @param y the y position of the painted border + * @param width the width of the painted border + * @param height the height of the painted border + * + * @throws NullPointerException if the specified {@code c} or {@code g} are {@code null} + */ + @Override + public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { + float size = this.stroke.getLineWidth(); + if (size > 0.0f) { + g = g.create(); + if (g instanceof Graphics2D) { + Graphics2D g2d = (Graphics2D) g; + g2d.setStroke(this.stroke); + g2d.setPaint(this.paint != null ? this.paint : c.getForeground()); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g2d.draw(new Rectangle2D.Float(x + size / 2, y + size / 2, width - size, height - size)); + } + g.dispose(); + } + } + + /** + * Reinitializes the {@code insets} parameter + * with this border's current insets. + * All insets are equal to the line width of the stroke. + * + * @param c the component for which this border insets value applies + * @param insets the {@code Insets} object to be reinitialized + * @return the reinitialized {@code insets} parameter + * + * @throws NullPointerException if the specified {@code insets} is {@code null} + */ + @Override + public Insets getBorderInsets(Component c, Insets insets) { + int size = (int) Math.ceil(this.stroke.getLineWidth()); + insets.set(size, size, size, size); + return insets; + } + + /** + * Returns the {@link BasicStroke} object used to stroke a shape + * during the border rendering. + * + * @return the {@link BasicStroke} object + */ + public BasicStroke getStroke() { + return this.stroke; + } + + /** + * Returns the {@link Paint} object used to generate a color + * during the border rendering. + * + * @return the {@link Paint} object or {@code null} + * if the {@code paint} parameter is not set + */ + public Paint getPaint() { + return this.paint; + } +} diff --git a/jdk/src/share/classes/javax/swing/border/TitledBorder.java b/jdk/src/share/classes/javax/swing/border/TitledBorder.java index 3bf385e44c1..929fbd07f5b 100644 --- a/jdk/src/share/classes/javax/swing/border/TitledBorder.java +++ b/jdk/src/share/classes/javax/swing/border/TitledBorder.java @@ -165,11 +165,11 @@ public class TitledBorder extends AbstractBorder * @param titlePosition the position for the title */ public TitledBorder(Border border, - String title, - int titleJustification, - int titlePosition) { + String title, + int titleJustification, + int titlePosition) { this(border, title, titleJustification, - titlePosition, null, null); + titlePosition, null, null); } /** @@ -183,12 +183,12 @@ public class TitledBorder extends AbstractBorder * @param titleFont the font for rendering the title */ public TitledBorder(Border border, - String title, - int titleJustification, - int titlePosition, - Font titleFont) { + String title, + int titleJustification, + int titlePosition, + Font titleFont) { this(border, title, titleJustification, - titlePosition, titleFont, null); + titlePosition, titleFont, null); } /** @@ -205,11 +205,11 @@ public class TitledBorder extends AbstractBorder */ @ConstructorProperties({"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"}) public TitledBorder(Border border, - String title, - int titleJustification, - int titlePosition, - Font titleFont, - Color titleColor) { + String title, + int titleJustification, + int titlePosition, + Font titleFont, + Color titleColor) { this.title = title; this.border = border; this.titleFont = titleFont; @@ -234,7 +234,7 @@ public class TitledBorder extends AbstractBorder * @param height the height of the painted border */ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { - Border border = getBorderUI(); + Border border = getBorder(); String title = getTitle(); if ((title != null) && !title.isEmpty()) { int edge = (border instanceof TitledBorder) ? 0 : EDGE_SPACING; @@ -347,7 +347,7 @@ public class TitledBorder extends AbstractBorder * @param insets the object to be reinitialized */ public Insets getBorderInsets(Component c, Insets insets) { - Border border = getBorderUI(); + Border border = getBorder(); if (border == null) { insets.set(0, 0, 0, 0); } @@ -402,22 +402,34 @@ public class TitledBorder extends AbstractBorder /** * Returns whether or not the border is opaque. */ - public boolean isBorderOpaque() { return false; } + public boolean isBorderOpaque() { + return false; + } /** * Returns the title of the titled border. + * + * @return the title of the titled border */ - public String getTitle() { return title; } + public String getTitle() { + return title; + } /** * Returns the border of the titled border. + * + * @return the border of the titled border */ public Border getBorder() { - return border; + return border != null + ? border + : UIManager.getBorder("TitledBorder.border"); } /** * Returns the title-position of the titled border. + * + * @return the title-position of the titled border */ public int getTitlePosition() { return titlePosition; @@ -425,20 +437,28 @@ public class TitledBorder extends AbstractBorder /** * Returns the title-justification of the titled border. + * + * @return the title-justification of the titled border */ - public int getTitleJustification() { return titleJustification; } + public int getTitleJustification() { + return titleJustification; + } /** * Returns the title-font of the titled border. + * + * @return the title-font of the titled border */ - public Font getTitleFont() { + public Font getTitleFont() { return titleFont; } /** * Returns the title-color of the titled border. + * + * @return the title-color of the titled border */ - public Color getTitleColor() { + public Color getTitleColor() { return titleColor; } @@ -447,15 +467,19 @@ public class TitledBorder extends AbstractBorder /** * Sets the title of the titled border. - * param title the title for the border + * @param title the title for the border */ - public void setTitle(String title) { this.title = title; } + public void setTitle(String title) { + this.title = title; + } /** * Sets the border of the titled border. * @param border the border */ - public void setBorder(Border border) { this.border = border; } + public void setBorder(Border border) { + this.border = border; + } /** * Sets the title-position of the titled border. @@ -482,19 +506,19 @@ public class TitledBorder extends AbstractBorder * Sets the title-justification of the titled border. * @param titleJustification the justification for the border */ - public void setTitleJustification(int titleJustification) { + public void setTitleJustification(int titleJustification) { switch (titleJustification) { - case DEFAULT_JUSTIFICATION: - case LEFT: - case CENTER: - case RIGHT: - case LEADING: - case TRAILING: - this.titleJustification = titleJustification; - break; - default: - throw new IllegalArgumentException(titleJustification + - " is not a valid title justification."); + case DEFAULT_JUSTIFICATION: + case LEFT: + case CENTER: + case RIGHT: + case LEADING: + case TRAILING: + this.titleJustification = titleJustification; + break; + default: + throw new IllegalArgumentException(titleJustification + + " is not a valid title justification."); } } @@ -518,6 +542,7 @@ public class TitledBorder extends AbstractBorder * Returns the minimum dimensions this border requires * in order to fully display the border and title. * @param c the component where this border will be drawn + * @return the {@code Dimension} object */ public Dimension getMinimumSize(Component c) { Insets insets = getBorderInsets(c); @@ -557,7 +582,7 @@ public class TitledBorder extends AbstractBorder if (height < 0) { throw new IllegalArgumentException("Height must be >= 0"); } - Border border = getBorderUI(); + Border border = getBorder(); String title = getTitle(); if ((title != null) && !title.isEmpty()) { int edge = (border instanceof TitledBorder) ? 0 : EDGE_SPACING; @@ -616,13 +641,6 @@ public class TitledBorder extends AbstractBorder return Component.BaselineResizeBehavior.OTHER; } - private Border getBorderUI() { - Border border = getBorder(); - return border != null - ? border - : UIManager.getBorder("TitledBorder.border"); - } - private int getPosition() { int position = getTitlePosition(); if (position != DEFAULT_POSITION) { diff --git a/jdk/src/share/classes/javax/swing/plaf/LayerUI.java b/jdk/src/share/classes/javax/swing/plaf/LayerUI.java index 1fb757313a4..655d9f27177 100644 --- a/jdk/src/share/classes/javax/swing/plaf/LayerUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/LayerUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -449,8 +449,8 @@ public class LayerUI /** * Configures the {@code JLayer} this {@code LayerUI} is set to. - * The default implementation registers the {@code LayerUI} - * as a property change listener for the passed {@code JLayer} component. + * The default implementation registers the passed {@code JLayer} component + * as a {@code PropertyChangeListener} for the property changes of this {@code LayerUI}. * * @param c the {@code JLayer} component where this UI delegate is being installed */ @@ -461,8 +461,8 @@ public class LayerUI /** * Reverses the configuration which was previously set * in the {@link #installUI(JComponent)} method. - * The default implementation unregisters the property change listener - * for the passed JLayer component. + * The default implementation unregisters the passed {@code JLayer} component + * as a {@code PropertyChangeListener} for the property changes of this {@code LayerUI}. * * @param c the component from which this UI delegate is being removed. */ diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java index cd7e15e7cac..40e79e876b6 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/BasicComboPopup.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java index 803e4d01bda..9e1b0567c74 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/BasicFileChooserUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java index 6e2e8157f00..3416636bd65 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 (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -141,6 +141,22 @@ public class BasicFileChooserUI extends FileChooserUI { private JPanel accessoryPanel = null; private Handler handler; + /** + * Creates a {@code BasicFileChooserUI} implementation + * for the specified component. By default + * the {@code BasicLookAndFeel} class uses + * {@code createUI} methods of all basic UIs classes + * to instantiate UIs. + * + * @param c the {@code JFileChooser} which needs a UI + * @return the {@code BasicFileChooserUI} object + * + * @see UIDefaults#getUI(JComponent) + * @since 1.7 + */ + public static ComponentUI createUI(JComponent c) { + return new BasicFileChooserUI((JFileChooser) c); + } public BasicFileChooserUI(JFileChooser b) { } 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 b451759eaaf..207284bddd4 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 (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -269,6 +269,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab "InternalFrameUI", basicPackageName + "BasicInternalFrameUI", "DesktopPaneUI", basicPackageName + "BasicDesktopPaneUI", "DesktopIconUI", basicPackageName + "BasicDesktopIconUI", + "FileChooserUI", basicPackageName + "BasicFileChooserUI", "OptionPaneUI", basicPackageName + "BasicOptionPaneUI", "PanelUI", basicPackageName + "BasicPanelUI", "ViewportUI", basicPackageName + "BasicViewportUI", diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java index 068224cd299..01f2a4539ce 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 @@ public class BasicMenuUI extends BasicMenuItemUI return getHandler(); } + protected MenuKeyListener createMenuKeyListener(JComponent c) { + return (MenuKeyListener)getHandler(); + } + public Dimension getMaximumSize(JComponent c) { if (((JMenu)menuItem).isTopLevelMenu() == true) { Dimension d = c.getPreferredSize(); @@ -397,7 +401,7 @@ public class BasicMenuUI extends BasicMenuItemUI public void stateChanged(ChangeEvent e) { } } - private class Handler extends BasicMenuItemUI.Handler { + private class Handler extends BasicMenuItemUI.Handler implements MenuKeyListener { // // PropertyChangeListener // @@ -580,5 +584,48 @@ public class BasicMenuUI extends BasicMenuItemUI } public void menuDragMouseExited(MenuDragMouseEvent e) {} public void menuDragMouseReleased(MenuDragMouseEvent e) {} + + // + // MenuKeyListener + // + /** + * Open the Menu + */ + public void menuKeyTyped(MenuKeyEvent e) { + if (!crossMenuMnemonic && BasicPopupMenuUI.getLastPopup() != null) { + // when crossMenuMnemonic is not set, we don't open a toplevel + // menu if another toplevel menu is already open + return; + } + + if (BasicPopupMenuUI.getPopups().size() != 0) { + //Fix 6939261: to return in case not on the main menu + //and has a pop-up. + //after return code will be handled in BasicPopupMenuUI.java + return; + } + + char key = Character.toLowerCase((char)menuItem.getMnemonic()); + MenuElement path[] = e.getPath(); + if (key == Character.toLowerCase(e.getKeyChar())) { + JPopupMenu popupMenu = ((JMenu)menuItem).getPopupMenu(); + ArrayList newList = new ArrayList(Arrays.asList(path)); + newList.add(popupMenu); + MenuElement subs[] = popupMenu.getSubElements(); + MenuElement sub = + BasicPopupMenuUI.findEnabledChild(subs, -1, true); + if(sub != null) { + newList.add(sub); + } + MenuSelectionManager manager = e.getMenuSelectionManager(); + MenuElement newPath[] = new MenuElement[0];; + newPath = (MenuElement[]) newList.toArray(newPath); + manager.setSelectedPath(newPath); + e.consume(); + } + } + + public void menuKeyPressed(MenuKeyEvent e) {} + public void menuKeyReleased(MenuKeyEvent e) {} } } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java index 52204916ce5..65e170a3181 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/BasicScrollPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java index 410491b9913..726b41db030 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -362,6 +362,14 @@ public class BasicScrollPaneUI * @since 1.6 */ public int getBaseline(JComponent c, int width, int height) { + if (c == null) { + throw new NullPointerException("Component must be non-null"); + } + + if (width < 0 || height < 0) { + throw new IllegalArgumentException("Width and height must be >= 0"); + } + JViewport viewport = scrollpane.getViewport(); Insets spInsets = scrollpane.getInsets(); int y = spInsets.top; 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 7611318799d..2c9b803d971 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 (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/BasicSpinnerUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java index b26f226c043..a57638e39eb 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java @@ -908,6 +908,14 @@ public class BasicSpinnerUI extends SpinnerUI int height = parent.getHeight(); Insets insets = parent.getInsets(); + + if (nextButton == null && previousButton == null) { + setBounds(editor, insets.left, insets.top, width - insets.left - insets.right, + height - insets.top - insets.bottom); + + return; + } + Dimension nextD = preferredSize(nextButton); Dimension previousD = preferredSize(previousButton); int buttonsWidth = Math.max(nextD.width, previousD.width); 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 0e9e23caff4..af901795fb4 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 (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/BasicTableHeaderUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java index 6241364b497..9d2b26d483d 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/BasicTextUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java index fa226f168a1..ba87d53f738 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/BasicViewportUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java index 7c56e24f262..70dad3c3c0d 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/MetalComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java index e7c811b0c22..3a7ef7f0d10 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/MetalScrollPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java index 8037dfcd6c3..d451613219d 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,17 +81,26 @@ public class MetalScrollPaneUI extends BasicScrollPaneUI } } - public void installListeners(JScrollPane scrollPane) { super.installListeners(scrollPane); scrollBarSwapListener = createScrollBarSwapListener(); scrollPane.addPropertyChangeListener(scrollBarSwapListener); } + /** + * {@inheritDoc} + */ + protected void uninstallListeners(JComponent c) { + super.uninstallListeners(c); + c.removePropertyChangeListener(scrollBarSwapListener); + } + /** + * @deprecated - Replaced by {@link #uninstallListeners(JComponent)} + */ + @Deprecated public void uninstallListeners(JScrollPane scrollPane) { super.uninstallListeners(scrollPane); - scrollPane.removePropertyChangeListener(scrollBarSwapListener); } diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java index 4e85abc9da7..89a28c2ae80 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java index 3d2f0936251..80d3eb15fe0 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthColorChooserUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java index 9dde7ec3f25..b85597e53be 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java index 3e0ef2e0507..45a90281f36 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthDesktopIconUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java index 8f8e918a5c2..89a15b95f63 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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 7f9a86f19e3..8548f7ff585 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 (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthEditorPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthEditorPaneUI.java index 7596e1b0b2e..dcea1406128 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthEditorPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthEditorPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthInternalFrameUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameUI.java index d5c5505df8b..0c69e05dc01 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthLabelUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java index 153cf5c3e7a..1c1927291b8 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthListUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthListUI.java index 5893dc62734..5166159d1cb 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthListUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthListUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java index 72732e80a9b..12121cc5038 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthMenuBarUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuBarUI.java index 35a5585acaf..fbec6a7e2ba 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuBarUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemUI.java index ba2a60922fe..36b6cf192cf 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthMenuUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java index 237d2e85480..6f309861ba5 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthOptionPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthOptionPaneUI.java index c7d5435cadf..696e83ae467 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthOptionPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthOptionPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthPanelUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthPanelUI.java index ad9161eabee..6e47dd2c983 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthPanelUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthPanelUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthParser.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java index 37a1893e7c4..a03e752e4c7 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthPopupMenuUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthPopupMenuUI.java index 34308da5655..cacc4a8e4cd 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthPopupMenuUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthPopupMenuUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthProgressBarUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java index 65464468095..8007ffc1b15 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthRootPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthRootPaneUI.java index f02665bbc7b..67a0a88bdc2 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthRootPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthRootPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthScrollBarUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java index 4c10ddba95b..093aeaee5f8 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthScrollPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java index 64390b21334..1b85204aac2 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthSeparatorUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSeparatorUI.java index bd5874dda27..e7baa23a5ea 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSeparatorUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSeparatorUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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 74c25ea144c..cc18a05eea5 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 (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthSpinnerUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java index 250888f0001..9b86cae4beb 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthSplitPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java index eb1f2ce9420..0a22820b7c4 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 (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthTabbedPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java index ea67ac03852..84a773ab300 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java @@ -115,10 +115,7 @@ public class SynthTabbedPaneUI extends BasicTabbedPaneUI return new SynthTabbedPaneUI(); } - private SynthTabbedPaneUI() { - } - - private boolean scrollableTabLayoutEnabled() { + private boolean scrollableTabLayoutEnabled() { return (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT); } diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java index ac3c725f3c3..201e2330633 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthTableUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java index 86321ac34e7..621be2400f4 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthTextAreaUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java index 5da522dec80..1e34237d72f 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthTextFieldUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java index 7a7cb49dba7..3d642d72069 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthTextPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java index 74d3d1d5310..eb7b2959151 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthToolBarUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java index 0b55a61f006..6fcc5d069cd 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthToolTipUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java index ee060ebd541..2caf587cbf6 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthTreeUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java index b919cc2a536..e7a684e66a7 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SynthViewportUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthViewportUI.java index c9a918141de..dc2886fb6fa 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthViewportUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthViewportUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/table/DefaultTableCellRenderer.java b/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java index 83c689f5117..518b43cafa9 100644 --- a/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java +++ b/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -186,6 +186,9 @@ public class DefaultTableCellRenderer extends JLabel */ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + if (table == null) { + return this; + } Color fg = null; Color bg = null; diff --git a/jdk/src/share/classes/javax/swing/text/DefaultCaret.java b/jdk/src/share/classes/javax/swing/text/DefaultCaret.java index bba42d258e9..7a3a2807bbb 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultCaret.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultCaret.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1334,13 +1334,13 @@ public class DefaultCaret extends Rectangle implements Caret, FocusListener, Mou && component.getClientProperty("JPasswordField.cutCopyAllowed") != Boolean.TRUE) { //fix for 4793761 - StringBuffer txt = null; + StringBuilder txt = null; char echoChar = ((JPasswordField)component).getEchoChar(); int p0 = Math.min(getDot(), getMark()); int p1 = Math.max(getDot(), getMark()); for (int i = p0; i < p1; i++) { if (txt == null) { - txt = new StringBuffer(); + txt = new StringBuilder(); } txt.append(echoChar); } @@ -1675,7 +1675,6 @@ public class DefaultCaret extends Rectangle implements Caret, FocusListener, Mou } return; } - int adjust = 0; int offset = e.getOffset(); int length = e.getLength(); int newDot = dot; @@ -1759,7 +1758,6 @@ public class DefaultCaret extends Rectangle implements Caret, FocusListener, Mou } int offs0 = e.getOffset(); int offs1 = offs0 + e.getLength(); - int adjust = 0; int newDot = dot; boolean adjustDotBias = false; int newMark = mark; diff --git a/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java b/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java index 654e460494a..ba90af7dcf2 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/text/DefaultFormatter.java b/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java index 75c3481678e..5e003b55bca 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/text/DefaultHighlighter.java b/jdk/src/share/classes/javax/swing/text/DefaultHighlighter.java index d90128b82ac..fce9e8b4869 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultHighlighter.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultHighlighter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 @@ public class DefaultHighlighter extends LayeredHighlighter { * @exception BadLocationException if the specified location is invalid */ public Object addHighlight(int p0, int p1, Highlighter.HighlightPainter p) throws BadLocationException { + if (p0 < 0) { + throw new BadLocationException("Invalid start offset", p0); + } + + if (p1 < p0) { + throw new BadLocationException("Invalid end offset", p1); + } + Document doc = component.getDocument(); HighlightInfo i = (getDrawsLayeredHighlights() && (p instanceof LayeredHighlighter.LayerPainter)) ? @@ -217,6 +225,14 @@ public class DefaultHighlighter extends LayeredHighlighter { * @exception BadLocationException if the specified location is invalid */ public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException { + if (p0 < 0) { + throw new BadLocationException("Invalid beginning of the range", p0); + } + + if (p1 < p0) { + throw new BadLocationException("Invalid end of the range", p1); + } + Document doc = component.getDocument(); if (tag instanceof LayeredHighlightInfo) { LayeredHighlightInfo lhi = (LayeredHighlightInfo)tag; diff --git a/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java b/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java index 938fd84f2b7..8552eb9514b 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -132,7 +132,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc // install the content Content c = getContent(); int n = data.length; - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < n; i++) { ElementSpec es = data[i]; if (es.getLength() > 0) { @@ -191,7 +191,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc // install the content Content c = getContent(); int n = data.length; - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < n; i++) { ElementSpec es = data[i]; if (es.getLength() > 0) { diff --git a/jdk/src/share/classes/javax/swing/text/GlyphView.java b/jdk/src/share/classes/javax/swing/text/GlyphView.java index 72487eafc2b..d73ab6f618b 100644 --- a/jdk/src/share/classes/javax/swing/text/GlyphView.java +++ b/jdk/src/share/classes/javax/swing/text/GlyphView.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/text/InternationalFormatter.java b/jdk/src/share/classes/javax/swing/text/InternationalFormatter.java index b49fed2e3ce..52331d76103 100644 --- a/jdk/src/share/classes/javax/swing/text/InternationalFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/InternationalFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ import java.text.*; import java.text.AttributedCharacterIterator.Attribute; import java.util.*; import javax.swing.*; -import javax.swing.text.*; /** * InternationalFormatter extends DefaultFormatter, @@ -875,7 +874,6 @@ public class InternationalFormatter extends DefaultFormatter { (f instanceof AttributedCharacterIterator.Attribute)) { AttributedCharacterIterator.Attribute field = (AttributedCharacterIterator.Attribute)f; - int index = 0; iterator.first(); while (iterator.getIndex() < start) { diff --git a/jdk/src/share/classes/javax/swing/text/JTextComponent.java b/jdk/src/share/classes/javax/swing/text/JTextComponent.java index f5450903b6a..eccf8a5ee7c 100644 --- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java +++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +35,7 @@ import java.util.HashMap; import java.util.Hashtable; import java.util.Enumeration; import java.util.Vector; -import java.util.Iterator; import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; import java.util.concurrent.*; @@ -4058,7 +4055,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A private static final Object KEYMAP_TABLE = new StringBuilder("JTextComponent_KeymapTable"); - private JTextComponent editor; + // // member variables used for on-the-spot input method // editing style support @@ -4748,14 +4745,14 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A processKeyEvent(ke); } } else { - StringBuffer strBuf = new StringBuffer(); + StringBuilder strBuf = new StringBuilder(); for (char c = text.current(); commitCount > 0; c = text.next(), commitCount--) { strBuf.append(c); } // map it to an ActionEvent - mapCommittedTextToAction(new String(strBuf)); + mapCommittedTextToAction(strBuf.toString()); } // Remember latest committed text end index @@ -4801,7 +4798,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A private void createComposedTextAttribute(int composedIndex, AttributedCharacterIterator text) { Document doc = getDocument(); - StringBuffer strBuf = new StringBuffer(); + StringBuilder strBuf = new StringBuilder(); // create attributed string with no attributes for (char c = text.setIndex(composedIndex); @@ -4809,7 +4806,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A strBuf.append(c); } - composedTextContent = new String(strBuf); + composedTextContent = strBuf.toString(); composedTextAttribute = new SimpleAttributeSet(); composedTextAttribute.addAttribute(StyleConstants.ComposedTextAttribute, new AttributedString(text, composedIndex, text.getEndIndex())); diff --git a/jdk/src/share/classes/javax/swing/text/MaskFormatter.java b/jdk/src/share/classes/javax/swing/text/MaskFormatter.java index b8bd70b4949..a477e610b96 100644 --- a/jdk/src/share/classes/javax/swing/text/MaskFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/MaskFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ import java.io.*; import java.text.*; import java.util.*; import javax.swing.*; -import javax.swing.text.*; /** * MaskFormatter is used to format and edit strings. The behavior @@ -385,7 +384,7 @@ public class MaskFormatter extends DefaultFormatter { */ public String valueToString(Object value) throws ParseException { String sValue = (value == null) ? "" : value.toString(); - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); String placeholder = getPlaceholder(); int[] valueCounter = { 0 }; @@ -484,7 +483,7 @@ public class MaskFormatter extends DefaultFormatter { * Invokes append on the mask characters in * mask. */ - private void append(StringBuffer result, String value, int[] index, + private void append(StringBuilder result, String value, int[] index, String placeholder, MaskCharacter[] mask) throws ParseException { for (int counter = 0, maxCounter = mask.length; @@ -611,13 +610,13 @@ public class MaskFormatter extends DefaultFormatter { * Removes the literal characters from the passed in string. */ private String stripLiteralChars(String string) { - StringBuffer sb = null; + StringBuilder sb = null; int last = 0; for (int counter = 0, max = string.length(); counter < max; counter++){ if (isLiteral(counter)) { if (sb == null) { - sb = new StringBuffer(); + sb = new StringBuilder(); if (counter > 0) { sb.append(string.substring(0, counter)); } @@ -715,10 +714,10 @@ public class MaskFormatter extends DefaultFormatter { */ boolean canReplace(ReplaceHolder rh) { // This method is rather long, but much of the burden is in - // maintaining a String and swapping to a StringBuffer only if + // maintaining a String and swapping to a StringBuilder only if // absolutely necessary. if (!getAllowsInvalid()) { - StringBuffer replace = null; + StringBuilder replace = null; String text = rh.text; int tl = (text != null) ? text.length() : 0; @@ -737,7 +736,7 @@ public class MaskFormatter extends DefaultFormatter { char aChar = text.charAt(textIndex); if (aChar != getCharacter(rh.offset + counter, aChar)) { if (replace == null) { - replace = new StringBuffer(); + replace = new StringBuilder(); if (textIndex > 0) { replace.append(text.substring(0, textIndex)); } @@ -758,7 +757,7 @@ public class MaskFormatter extends DefaultFormatter { } } else if (textIndex > 0) { - replace = new StringBuffer(max); + replace = new StringBuilder(max); replace.append(text.substring(0, textIndex)); replace.append(getLiteral(rh.offset + counter)); if (textIndex < tl) { @@ -780,7 +779,7 @@ public class MaskFormatter extends DefaultFormatter { else if (textIndex >= tl) { // placeholder if (replace == null) { - replace = new StringBuffer(); + replace = new StringBuilder(); if (text != null) { replace.append(text); } @@ -863,7 +862,7 @@ public class MaskFormatter extends DefaultFormatter { * Appends the necessary character in formatting at * index to buff. */ - public void append(StringBuffer buff, String formatting, int[] index, + public void append(StringBuilder buff, String formatting, int[] index, String placeholder) throws ParseException { boolean inString = index[0] < formatting.length(); diff --git a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java index 9a83c836234..9500dcc03b7 100644 --- a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ package javax.swing.text; import java.lang.reflect.*; import java.text.*; import java.util.*; -import javax.swing.text.*; /** * NumberFormatter subclasses InternationalFormatter @@ -132,7 +131,7 @@ public class NumberFormatter extends InternationalFormatter { DecimalFormatSymbols dfs = getDecimalFormatSymbols(); if (dfs != null) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(dfs.getCurrencySymbol()); sb.append(dfs.getDecimalSeparator()); @@ -239,13 +238,6 @@ public class NumberFormatter extends InternationalFormatter { return null; } - /** - */ - private boolean isValidInsertionCharacter(char aChar) { - return (Character.isDigit(aChar) || specialChars.indexOf(aChar) != -1); - } - - /** * Subclassed to return false if text contains in an invalid * character to insert, that is, it is not a digit @@ -402,28 +394,6 @@ public class NumberFormatter extends InternationalFormatter { return false; } - /** - * Returns true if the range offset to length identifies the only - * integer field. - */ - private boolean isOnlyIntegerField(int offset, int length) { - if (isValidMask()) { - int start = getAttributeStart(NumberFormat.Field.INTEGER); - - if (start != -1) { - AttributedCharacterIterator iterator = getIterator(); - - iterator.setIndex(start); - if (offset > start || iterator.getRunLimit( - NumberFormat.Field.INTEGER) > (offset + length)) { - return false; - } - return true; - } - } - return false; - } - /** * Invoked to toggle the sign. For this to work the value class * must have a single arg constructor that takes a String. diff --git a/jdk/src/share/classes/javax/swing/text/PlainDocument.java b/jdk/src/share/classes/javax/swing/text/PlainDocument.java index 2698cef3067..84dc6849f48 100644 --- a/jdk/src/share/classes/javax/swing/text/PlainDocument.java +++ b/jdk/src/share/classes/javax/swing/text/PlainDocument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ package javax.swing.text; import java.util.Vector; -import javax.swing.event.*; /** * A plain document that maintains no character attributes. The @@ -118,7 +117,7 @@ public class PlainDocument extends AbstractDocument { Object filterNewlines = getProperty("filterNewlines"); if ((filterNewlines instanceof Boolean) && filterNewlines.equals(Boolean.TRUE)) { if ((str != null) && (str.indexOf('\n') >= 0)) { - StringBuffer filtered = new StringBuffer(str); + StringBuilder filtered = new StringBuilder(str); int n = filtered.length(); for (int i = 0; i < n; i++) { if (filtered.charAt(i) == '\n') { @@ -204,11 +203,9 @@ public class PlainDocument extends AbstractDocument { } } if (hasBreaks) { - int rmCount = 1; removed.addElement(rmCandidate); if ((offset + length == rmOffs1) && (lastOffset != rmOffs1) && ((index+1) < lineMap.getElementCount())) { - rmCount += 1; Element e = lineMap.getElement(index+1); removed.addElement(e); rmOffs1 = e.getEndOffset(); diff --git a/jdk/src/share/classes/javax/swing/text/TabSet.java b/jdk/src/share/classes/javax/swing/text/TabSet.java index 986b9bcb320..690ca5743d5 100644 --- a/jdk/src/share/classes/javax/swing/text/TabSet.java +++ b/jdk/src/share/classes/javax/swing/text/TabSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -199,7 +199,7 @@ public class TabSet implements Serializable */ public String toString() { int tabCount = getTabCount(); - StringBuffer buffer = new StringBuffer("[ "); + StringBuilder buffer = new StringBuilder("[ "); for(int counter = 0; counter < tabCount; counter++) { if(counter > 0) diff --git a/jdk/src/share/classes/javax/swing/text/Utilities.java b/jdk/src/share/classes/javax/swing/text/Utilities.java index 394bba3edf0..704cfa02c84 100644 --- a/jdk/src/share/classes/javax/swing/text/Utilities.java +++ b/jdk/src/share/classes/javax/swing/text/Utilities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/text/WrappedPlainView.java b/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java index abdaf8d5f38..2f02a7ca956 100644 --- a/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java +++ b/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/text/html/FormView.java b/jdk/src/share/classes/javax/swing/text/html/FormView.java index 1aeb7e17ec3..c23f249fe78 100644 --- a/jdk/src/share/classes/javax/swing/text/html/FormView.java +++ b/jdk/src/share/classes/javax/swing/text/html/FormView.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -362,7 +362,7 @@ public class FormView extends ComponentView implements ActionListener { */ public void actionPerformed(ActionEvent evt) { Element element = getElement(); - StringBuffer dataBuffer = new StringBuffer(); + StringBuilder dataBuffer = new StringBuilder(); HTMLDocument doc = (HTMLDocument)getDocument(); AttributeSet attr = element.getAttributes(); @@ -508,7 +508,7 @@ public class FormView extends ComponentView implements ActionListener { */ protected void imageSubmit(String imageData) { - StringBuffer dataBuffer = new StringBuffer(); + StringBuilder dataBuffer = new StringBuilder(); Element elem = getElement(); HTMLDocument hdoc = (HTMLDocument)elem.getDocument(); getFormData(dataBuffer); @@ -589,7 +589,7 @@ public class FormView extends ComponentView implements ActionListener { * @param targetElement the element that triggered the * form submission */ - void getFormData(StringBuffer buffer) { + private void getFormData(StringBuilder buffer) { Element formE = getFormElement(); if (formE != null) { ElementIterator it = new ElementIterator(formE); @@ -623,7 +623,7 @@ public class FormView extends ComponentView implements ActionListener { * data is loaded in name/value pairs. * */ - private void loadElementDataIntoBuffer(Element elem, StringBuffer buffer) { + private void loadElementDataIntoBuffer(Element elem, StringBuilder buffer) { AttributeSet attr = elem.getAttributes(); String name = (String)attr.getAttribute(HTML.Attribute.NAME); @@ -692,29 +692,6 @@ public class FormView extends ComponentView implements ActionListener { } if (path != null && path.length() > 0) { value = path; -/* - - try { - Reader reader = new BufferedReader(new FileReader(path)); - StringBuffer buffer = new StringBuffer(); - char[] cBuff = new char[1024]; - int read; - - try { - while ((read = reader.read(cBuff)) != -1) { - buffer.append(cBuff, 0, read); - } - } catch (IOException ioe) { - buffer = null; - } - try { - reader.close(); - } catch (IOException ioe) {} - if (buffer != null) { - value = buffer.toString(); - } - } catch (IOException ioe) {} -*/ } } return value; @@ -740,7 +717,7 @@ public class FormView extends ComponentView implements ActionListener { * form element. Basically, only items that are selected * and have their name attribute set are added to the buffer. */ - private void loadSelectData(AttributeSet attr, StringBuffer buffer) { + private void loadSelectData(AttributeSet attr, StringBuilder buffer) { String name = (String)attr.getAttribute(HTML.Attribute.NAME); if (name == null) { @@ -771,7 +748,7 @@ public class FormView extends ComponentView implements ActionListener { * URLEncoder.encode() method before being added to the * buffer. */ - private void appendBuffer(StringBuffer buffer, String name, String value) { + private void appendBuffer(StringBuilder buffer, String name, String value) { if (buffer.length() > 0) { buffer.append('&'); } diff --git a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java index d489b487d27..0db69e9fd72 100644 --- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java +++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/text/html/MinimalHTMLWriter.java b/jdk/src/share/classes/javax/swing/text/html/MinimalHTMLWriter.java index 26bcaa30fba..8a69d172219 100644 --- a/jdk/src/share/classes/javax/swing/text/html/MinimalHTMLWriter.java +++ b/jdk/src/share/classes/javax/swing/text/html/MinimalHTMLWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -691,11 +691,11 @@ public class MinimalHTMLWriter extends AbstractWriter { if (styleNameMapping == null) { return style; } - StringBuffer sb = null; + StringBuilder sb = null; for (int counter = style.length() - 1; counter >= 0; counter--) { if (!isValidCharacter(style.charAt(counter))) { if (sb == null) { - sb = new StringBuffer(style); + sb = new StringBuilder(style); } sb.setCharAt(counter, 'a'); } diff --git a/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java index 47eeefe2c7d..8d5bab21515 100644 --- a/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java +++ b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -998,7 +998,7 @@ public class StyleSheet extends StyleContext { void addRule(String[] selector, AttributeSet declaration, boolean isLinked) { int n = selector.length; - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append(selector[0]); for (int counter = 1; counter < n; counter++) { sb.append(' '); diff --git a/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java b/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java index abcb05adbc1..48205eb35c5 100644 --- a/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java +++ b/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1470,7 +1470,7 @@ class Parser implements DTDConstants { */ public String parseDTDMarkup() throws IOException { - StringBuffer strBuff = new StringBuffer(); + StringBuilder strBuff = new StringBuilder(); ch = readCh(); while(true) { switch (ch) { diff --git a/jdk/src/share/classes/javax/swing/text/rtf/AbstractFilter.java b/jdk/src/share/classes/javax/swing/text/rtf/AbstractFilter.java index cdbec2a816d..618743ee627 100644 --- a/jdk/src/share/classes/javax/swing/text/rtf/AbstractFilter.java +++ b/jdk/src/share/classes/javax/swing/text/rtf/AbstractFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -160,7 +160,7 @@ abstract class AbstractFilter extends OutputStream public void write(byte[] buf, int off, int len) throws IOException { - StringBuffer accumulator = null; + StringBuilder accumulator = null; while (len > 0) { short b = (short)buf[off]; @@ -178,7 +178,7 @@ abstract class AbstractFilter extends OutputStream char ch = translationTable[b]; if (ch != (char)0) { if (accumulator == null) - accumulator = new StringBuffer(); + accumulator = new StringBuilder(); accumulator.append(ch); } } diff --git a/jdk/src/share/classes/sun/applet/Main.java b/jdk/src/share/classes/sun/applet/Main.java index 5b08a929a79..e5ef4fda3c3 100644 --- a/jdk/src/share/classes/sun/applet/Main.java +++ b/jdk/src/share/classes/sun/applet/Main.java @@ -339,7 +339,7 @@ public class Main { // Standard browser properties avProps.put("browser", "sun.applet.AppletViewer"); avProps.put("browser.version", "1.06"); - avProps.put("browser.vendor", "Sun Microsystems Inc."); + avProps.put("browser.vendor", "Oracle Corporation"); avProps.put("http.agent", "Java(tm) 2 SDK, Standard Edition v" + theVersion); // Define which packages can be extended by applets diff --git a/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer.java b/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer.java index 6c24c7f2946..015bcd3f442 100644 --- a/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer.java +++ b/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/applet/resources/MsgAppletViewer_pt_BR.java b/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_pt_BR.java new file mode 100644 index 00000000000..46846d65c53 --- /dev/null +++ b/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_pt_BR.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.applet.resources; + +import java.util.ListResourceBundle; + +public class MsgAppletViewer_pt_BR extends ListResourceBundle { + + public Object[][] getContents() { + return new Object[][] { + {"textframe.button.dismiss", "Rejeitar"}, + {"appletviewer.tool.title", "Visualizador de applet: {0}"}, + {"appletviewer.menu.applet", "Applet"}, + {"appletviewer.menuitem.restart", "Reiniciar"}, + {"appletviewer.menuitem.reload", "Recarregar"}, + {"appletviewer.menuitem.stop", "Parar"}, + {"appletviewer.menuitem.save", "Salvar..."}, + {"appletviewer.menuitem.start", "Iniciar"}, + {"appletviewer.menuitem.clone", "Clonar..."}, + {"appletviewer.menuitem.tag", "Marca..."}, + {"appletviewer.menuitem.info", "Info..."}, + {"appletviewer.menuitem.edit", "Editar"}, + {"appletviewer.menuitem.encoding", "Codifica\u00e7\u00e3o de caracteres"}, + {"appletviewer.menuitem.print", "Imprimir..."}, + {"appletviewer.menuitem.props", "Propriedades..."}, + {"appletviewer.menuitem.close", "Fechar"}, + {"appletviewer.menuitem.quit", "Sair"}, + {"appletviewer.label.hello", "Ol\u00e1..."}, + {"appletviewer.status.start", "iniciando applet..."}, + {"appletviewer.appletsave.filedialogtitle","Serializar applet no arquivo"}, + {"appletviewer.appletsave.err1", "serializando um {0} para {1}"}, + {"appletviewer.appletsave.err2", "em appletSave: {0}"}, + {"appletviewer.applettag", "Marca exibida"}, + {"appletviewer.applettag.textframe", "Marca HTML do applet"}, + {"appletviewer.appletinfo.applet", "-- sem informa\u00e7\u00f5es do applet --"}, + {"appletviewer.appletinfo.param", "-- sem informa\u00e7\u00f5es do par\u00e2metro --"}, + {"appletviewer.appletinfo.textframe", "Informa\u00e7\u00f5es do applet"}, + {"appletviewer.appletprint.fail", "Falha na impress\u00e3o."}, + {"appletviewer.appletprint.finish", "Impress\u00e3o finalizada."}, + {"appletviewer.appletprint.cancel", "Impress\u00e3o cancelada."}, + {"appletviewer.appletencoding", "Codifica\u00e7\u00e3o de caracteres: {0}"}, + {"appletviewer.parse.warning.requiresname", "Aviso: a marca requer nome do atributo."}, + {"appletviewer.parse.warning.paramoutside", "Aviso: marca fora de ... ."}, + {"appletviewer.parse.warning.applet.requirescode", "Aviso: marca requer c\u00f3digo de atributo."}, + {"appletviewer.parse.warning.applet.requiresheight", "Aviso: marca requer atributo de altura."}, + {"appletviewer.parse.warning.applet.requireswidth", "Aviso: marca requer atributo de largura."}, + {"appletviewer.parse.warning.object.requirescode", "Aviso: marca requer c\u00f3digo de atributo."}, + {"appletviewer.parse.warning.object.requiresheight", "Aviso: marca requer atributo de altura."}, + {"appletviewer.parse.warning.object.requireswidth", "Aviso: marca requer atributo de largura."}, + {"appletviewer.parse.warning.embed.requirescode", "Aviso: marca requer c\u00f3digo de atributo."}, + {"appletviewer.parse.warning.embed.requiresheight", "Aviso: marca requer atributo de altura."}, + {"appletviewer.parse.warning.embed.requireswidth", "Aviso: marca requer atributo de largura."}, + {"appletviewer.parse.warning.appnotLongersupported", "Aviso: marca n\u00e3o mais suportada, usar em seu lugar:"}, + {"appletviewer.usage", "Uso: url(s) de do visualizador de applets\n\nem que inclui:\n -debug inicia o visualizador de applet no depurador Java\n -encoding especifica a codifica\u00e7\u00e3o de caracteres usada pelos arquivos HTML\n -J passa o argumento para o int\u00e9rprete de java\n\nA op\u00e7\u00e3o -J n\u00e3o \u00e9 padr\u00e3o e est\u00e1 sujeita a altera\u00e7\u00f5es sem aviso."}, + {"appletviewer.main.err.unsupportedopt", "Op\u00e7\u00e3o n\u00e3o suportada: {0}"}, + {"appletviewer.main.err.unrecognizedarg", "Argumento n\u00e3o reconhecido: {0}"}, + {"appletviewer.main.err.dupoption", "Uso duplicado da op\u00e7\u00e3o: {0}"}, + {"appletviewer.main.err.inputfile", "Nenhum arquivo de entrada especificado."}, + {"appletviewer.main.err.badurl", "URL incorreto: {0} ( {1} )"}, + {"appletviewer.main.err.io", "Exce\u00e7\u00e3o de E/S durante a leitura: {0}"}, + {"appletviewer.main.err.readablefile", "Certifique-se de que {0} seja um arquivo e seja leg\u00edvel."}, + {"appletviewer.main.err.correcturl", "{0} \u00e9 o URL correto?"}, + {"appletviewer.main.prop.store", "Propriedades espec\u00edficas do usu\u00e1rio para AppletViewer"}, + {"appletviewer.main.err.prop.cantread", "N\u00e3o \u00e9 poss\u00edvel ler o arquivo de propriedades do usu\u00e1rio: {0}"}, + {"appletviewer.main.err.prop.cantsave", "N\u00e3o \u00e9 poss\u00edvel salvar o arquivo de propriedades do usu\u00e1rio: {0}"}, + {"appletviewer.main.warn.nosecmgr", "Aviso: desabilitando a seguran\u00e7a."}, + {"appletviewer.main.debug.cantfinddebug", "N\u00e3o \u00e9 poss\u00edvel localizar o depurador!"}, + {"appletviewer.main.debug.cantfindmain", "N\u00e3o \u00e9 poss\u00edvel localizar o m\u00e9todo principal no depurador!"}, + {"appletviewer.main.debug.exceptionindebug", "Exce\u00e7\u00e3o no depurador!"}, + {"appletviewer.main.debug.cantaccess", "N\u00e3o \u00e9 poss\u00edvel acessar o depurador!"}, + {"appletviewer.main.nosecmgr", "Aviso: SecurityManager n\u00e3o instalado!"}, + {"appletviewer.main.warning", "Aviso: nenhum applet foi iniciado. Certifique-se de que a entrada contenha uma marca ."}, + {"appletviewer.main.warn.prop.overwrite", "Aviso: substituindo temporariamente a propriedade do sistema em solicita\u00e7\u00e3o do usu\u00e1rio: chave: {0} valor antigo: {1} valor novo: {2}"}, + {"appletviewer.main.warn.cantreadprops", "Aviso: n\u00e3o \u00e9 poss\u00edvel ler o arquivo de propriedades do AppletViewer: {0} usando padr\u00f5es."}, + {"appletioexception.loadclass.throw.interrupted", "carregamento de classe interrompido: {0}"}, + {"appletioexception.loadclass.throw.notloaded", "classe n\u00e3o carregada: {0}"}, + {"appletclassloader.loadcode.verbose", "Abrindo fluxo para: {0} para obter {1}"}, + {"appletclassloader.filenotfound", "Arquivo n\u00e3o encontrado ao procurar por: {0}"}, + {"appletclassloader.fileformat", "Exce\u00e7\u00e3o de formato de arquivo ao carregar: {0}"}, + {"appletclassloader.fileioexception", "Exce\u00e7\u00e3o de E/S ao carregar: {0}"}, + {"appletclassloader.fileexception", "Exce\u00e7\u00e3o {0} ao carregar: {0}"}, + {"appletclassloader.filedeath", "{0} eliminado ao carregar: {1}"}, + {"appletclassloader.fileerror", "Erro {0} ao carregar: {1}"}, + {"appletclassloader.findclass.verbose.findclass", "{0} encontra classe {1}"}, + {"appletclassloader.findclass.verbose.openstream", "Abrindo fluxo para: {0} para obter {1}"}, + {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource do nome: {0}"}, + {"appletclassloader.getresource.verbose.found", "Recurso encontrado: {0} como um recurso do sistema"}, + {"appletclassloader.getresourceasstream.verbose", "Recurso encontrado: {0} como um recurso do sistema"}, + {"appletpanel.runloader.err", "Par\u00e2metro de c\u00f3digo ou objeto!"}, + {"appletpanel.runloader.exception", "exce\u00e7\u00e3o ao desserializar {0}"}, + {"appletpanel.destroyed", "Applet destru\u00eddo."}, + {"appletpanel.loaded", "Applet carregado."}, + {"appletpanel.started", "Applet iniciado."}, + {"appletpanel.inited", "Applet inicializado."}, + {"appletpanel.stopped", "Applet interrompido."}, + {"appletpanel.disposed", "Applet descartado."}, + {"appletpanel.nocode", "Marca APPLET ausente no par\u00e2metro CODE."}, + {"appletpanel.notfound", "carregar: classe {0} n\u00e3o encontrada."}, + {"appletpanel.nocreate", "carregar: {0} n\u00e3o pode ser instanciado."}, + {"appletpanel.noconstruct", "carregar: {0} n\u00e3o \u00e9 p\u00fablico ou n\u00e3o possui um construtor p\u00fablico."}, + {"appletpanel.death", "eliminado"}, + {"appletpanel.exception", "exce\u00e7\u00e3o: {0}."}, + {"appletpanel.exception2", "exce\u00e7\u00e3o: {0}: {1}."}, + {"appletpanel.error", "erro: {0}."}, + {"appletpanel.error2", "erro: {0}: {1}."}, + {"appletpanel.notloaded", "Inicializar: applet n\u00e3o carregado."}, + {"appletpanel.notinited", "Iniciar: applet n\u00e3o inicializado."}, + {"appletpanel.notstarted", "Parar: applet n\u00e3o iniciado."}, + {"appletpanel.notstopped", "Destruir: applet n\u00e3o interrompido."}, + {"appletpanel.notdestroyed", "Descartar: applet n\u00e3o destru\u00eddo."}, + {"appletpanel.notdisposed", "Carregar: applet n\u00e3o descartado."}, + {"appletpanel.bail", "Interrompido: salvando."}, + {"appletpanel.filenotfound", "Arquivo n\u00e3o encontrado ao procurar por: {0}"}, + {"appletpanel.fileformat", "Exce\u00e7\u00e3o de formato de arquivo ao carregar: {0}"}, + {"appletpanel.fileioexception", "Exce\u00e7\u00e3o de E/S ao carregar: {0}"}, + {"appletpanel.fileexception", "Exce\u00e7\u00e3o {0} ao carregar: {0}"}, + {"appletpanel.filedeath", "{0} eliminado ao carregar: {1}"}, + {"appletpanel.fileerror", "Erro {0} ao carregar: {1}"}, + {"appletpanel.badattribute.exception", "An\u00e1lise de HTML: valor incorreto do atributo de largura/altura"}, + {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream requer carregador n\u00e3o nulo"}, + {"appletprops.title", "Propriedades do AppletViewer"}, + {"appletprops.label.http.server", "Servidor proxy de http:"}, + {"appletprops.label.http.proxy", "Porta do proxy de http:"}, + {"appletprops.label.network", "Acesso \u00e0 rede:"}, + {"appletprops.choice.network.item.none", "Nenhum"}, + {"appletprops.choice.network.item.applethost", "Host do applet"}, + {"appletprops.choice.network.item.unrestricted", "N\u00e3o registrado"}, + {"appletprops.label.class", "Acesso \u00e0 classe:"}, + {"appletprops.choice.class.item.restricted", "Restrito"}, + {"appletprops.choice.class.item.unrestricted", "N\u00e3o registrado"}, + {"appletprops.label.unsignedapplet", "Permitir applets n\u00e3o assinados:"}, + {"appletprops.choice.unsignedapplet.no", "N\u00e3o"}, + {"appletprops.choice.unsignedapplet.yes", "Sim"}, + {"appletprops.button.apply", "Aplicar"}, + {"appletprops.button.cancel", "Cancelar"}, + {"appletprops.button.reset", "Redefinir"}, + {"appletprops.apply.exception", "Falha ao salvar propriedades: {0}"}, + /* 4066432 */ + {"appletprops.title.invalidproxy", "Entrada inv\u00e1lida"}, + {"appletprops.label.invalidproxy", "A porta do proxy deve ser um valor inteiro positivo."}, + {"appletprops.button.ok", "OK"}, + /* end 4066432 */ + {"appletprops.prop.store", "Propriedades espec\u00edficas do usu\u00e1rio para AppletViewer"}, + {"appletsecurityexception.checkcreateclassloader", "Exce\u00e7\u00e3o de seguran\u00e7a: classloader"}, + {"appletsecurityexception.checkaccess.thread", "Exce\u00e7\u00e3o de seguran\u00e7a: thread"}, + {"appletsecurityexception.checkaccess.threadgroup", "Exce\u00e7\u00e3o de seguran\u00e7a: threadgroup: {0}"}, + {"appletsecurityexception.checkexit", "Exce\u00e7\u00e3o de seguran\u00e7a: exit: {0}"}, + {"appletsecurityexception.checkexec", "Exce\u00e7\u00e3o de seguran\u00e7a: exec: {0}"}, + {"appletsecurityexception.checklink", "Exce\u00e7\u00e3o de seguran\u00e7a: link: {0}"}, + {"appletsecurityexception.checkpropsaccess", "Exce\u00e7\u00e3o de seguran\u00e7a: properties"}, + {"appletsecurityexception.checkpropsaccess.key", "Exce\u00e7\u00e3o de seguran\u00e7a: properties access {0}"}, + {"appletsecurityexception.checkread.exception1", "Exce\u00e7\u00e3o de seguran\u00e7a: {0}, {1}"}, + {"appletsecurityexception.checkread.exception2", "Exce\u00e7\u00e3o de seguran\u00e7a: file.read: {0}"}, + {"appletsecurityexception.checkread", "Exce\u00e7\u00e3o de seguran\u00e7a: file.read: {0} == {1}"}, + {"appletsecurityexception.checkwrite.exception", "Exce\u00e7\u00e3o de seguran\u00e7a: {0}, {1}"}, + {"appletsecurityexception.checkwrite", "Exce\u00e7\u00e3o de seguran\u00e7a: file.write: {0} == {1}"}, + {"appletsecurityexception.checkread.fd", "Exce\u00e7\u00e3o de seguran\u00e7a: fd.read"}, + {"appletsecurityexception.checkwrite.fd", "Exce\u00e7\u00e3o de seguran\u00e7a: fd.write"}, + {"appletsecurityexception.checklisten", "Exce\u00e7\u00e3o de seguran\u00e7a: socket.listen: {0}"}, + {"appletsecurityexception.checkaccept", "Exce\u00e7\u00e3o de seguran\u00e7a: socket.accept: {0} == {1}"}, + {"appletsecurityexception.checkconnect.networknone", "Exce\u00e7\u00e3o de seguran\u00e7a: socket.connect: {0} == {1}"}, + {"appletsecurityexception.checkconnect.networkhost1", "Exce\u00e7\u00e3o de seguran\u00e7a: n\u00e3o foi poss\u00edvel conectar a {0} com a origem de {1}."}, + {"appletsecurityexception.checkconnect.networkhost2", "Exce\u00e7\u00e3o de seguran\u00e7a: n\u00e3o foi poss\u00edvel resolver o IP para o host {0} ou para {1}. "}, + {"appletsecurityexception.checkconnect.networkhost3", "Exce\u00e7\u00e3o de seguran\u00e7a: n\u00e3o foi poss\u00edvel resolver o IP para o host {0}. Consulte a propriedade trustProxy."}, + {"appletsecurityexception.checkconnect", "Exce\u00e7\u00e3o de seguran\u00e7a: connect: {0}->{1}"}, + {"appletsecurityexception.checkpackageaccess", "Exce\u00e7\u00e3o de seguran\u00e7a: n\u00e3o \u00e9 poss\u00edvel acessar o pacote: {0}"}, + {"appletsecurityexception.checkpackagedefinition", "Exce\u00e7\u00e3o de seguran\u00e7a: n\u00e3o \u00e9 poss\u00edvel definir o pacote: {0}"}, + {"appletsecurityexception.cannotsetfactory", "Exce\u00e7\u00e3o de seguran\u00e7a: n\u00e3o \u00e9 poss\u00edvel definir a f\u00e1brica"}, + {"appletsecurityexception.checkmemberaccess", "Exce\u00e7\u00e3o de seguran\u00e7a: verificar acesso de membro"}, + {"appletsecurityexception.checkgetprintjob", "Exce\u00e7\u00e3o de seguran\u00e7a: getPrintJob"}, + {"appletsecurityexception.checksystemclipboardaccess", "Exce\u00e7\u00e3o de seguran\u00e7a: getSystemClipboard"}, + {"appletsecurityexception.checkawteventqueueaccess", "Exce\u00e7\u00e3o de seguran\u00e7a: getEventQueue"}, + {"appletsecurityexception.checksecurityaccess", "Exce\u00e7\u00e3o de seguran\u00e7a: opera\u00e7\u00e3o de seguran\u00e7a: {0}"}, + {"appletsecurityexception.getsecuritycontext.unknown", "tipo desconhecido de carregador de classe. n\u00e3o \u00e9 poss\u00edvel verificar para getContext"}, + {"appletsecurityexception.checkread.unknown", "tipo desconhecido de carregador de classe. n\u00e3o \u00e9 poss\u00edvel verificar para verifica\u00e7\u00e3o de leitura {0}"}, + {"appletsecurityexception.checkconnect.unknown", "tipo desconhecido de carregador de classe. n\u00e3o \u00e9 poss\u00edvel verificar para verifica\u00e7\u00e3o de conex\u00e3o"}, + }; + } +} diff --git a/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_zh_CN.java b/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_zh_CN.java index b13df742da2..ae1043d6590 100644 --- a/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_zh_CN.java +++ b/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_zh_CN.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class MsgAppletViewer_zh_CN extends ListResourceBundle { return new Object[][] { {"textframe.button.dismiss", "\u5173\u95ed"}, {"appletviewer.tool.title", "\u5c0f\u7a0b\u5e8f\u67e5\u770b\u5668\uff1a{0}"}, - {"appletviewer.menu.applet", "Applet"}, + {"appletviewer.menu.applet", "\u5c0f\u7a0b\u5e8f"}, {"appletviewer.menuitem.restart", "\u91cd\u65b0\u542f\u52a8"}, {"appletviewer.menuitem.reload", "\u91cd\u65b0\u8f7d\u5165"}, {"appletviewer.menuitem.stop", "\u505c\u6b62"}, diff --git a/jdk/src/share/classes/sun/awt/AWTAccessor.java b/jdk/src/share/classes/sun/awt/AWTAccessor.java index 27609806967..0e38de6df6f 100644 --- a/jdk/src/share/classes/sun/awt/AWTAccessor.java +++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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 sun.awt; import java.awt.*; +import java.awt.event.InputEvent; import java.awt.geom.Point2D; import java.awt.image.BufferedImage; @@ -222,6 +223,16 @@ public final class AWTAccessor { void processEvent(Component comp, AWTEvent e); } + /* + * An interface of accessor for the java.awt.Container class. + */ + public interface ContainerAccessor { + /** + * Validates the container unconditionally. + */ + void validateUnconditionally(Container cont); + } + /* * An interface of accessor for java.awt.Window class. */ @@ -301,6 +312,24 @@ public final class AWTAccessor { * Marks the event as posted. */ void setPosted(AWTEvent ev); + + /** + * Sets the flag on this AWTEvent indicating that it was + * generated by the system. + */ + void setSystemGenerated(AWTEvent ev); + + /** + * Indicates whether this AWTEvent was generated by the system. + */ + boolean isSystemGenerated(AWTEvent ev); + } + + public interface InputEventAccessor { + /* + * Accessor for InputEvent.getButtonDownMasks() + */ + int[] getButtonDownMasks(); } /* @@ -315,6 +344,10 @@ public final class AWTAccessor { * Gets the state of this frame. */ int getExtendedState(Frame frame); + /* + * Gets the maximized bounds of this frame. + */ + Rectangle getMaximizedBounds(Frame frame); } /* @@ -421,48 +454,19 @@ public final class AWTAccessor { } /* - * The java.awt.Component class accessor object. + * Accessor instances are initialized in the static initializers of + * corresponding AWT classes by using setters defined below. */ private static ComponentAccessor componentAccessor; - - /* - * The java.awt.Window class accessor object. - */ + private static ContainerAccessor containerAccessor; private static WindowAccessor windowAccessor; - - /* - * The java.awt.AWTEvent class accessor object. - */ private static AWTEventAccessor awtEventAccessor; - - /* - * The java.awt.Frame class accessor object. - */ + private static InputEventAccessor inputEventAccessor; private static FrameAccessor frameAccessor; - - /* - * The java.awt.KeyboardFocusManager class accessor object. - */ private static KeyboardFocusManagerAccessor kfmAccessor; - - /* - * The java.awt.MenuComponent class accessor object. - */ private static MenuComponentAccessor menuComponentAccessor; - - /* - * The java.awt.EventQueue class accessor object. - */ private static EventQueueAccessor eventQueueAccessor; - - /* - * The java.awt.PopupMenu class accessor object. - */ private static PopupMenuAccessor popupMenuAccessor; - - /* - * The java.awt.FileDialog class accessor object. - */ private static FileDialogAccessor fileDialogAccessor; /* @@ -473,7 +477,7 @@ public final class AWTAccessor { } /* - * Retrieve the accessor object for the java.awt.Window class. + * Retrieve the accessor object for the java.awt.Component class. */ public static ComponentAccessor getComponentAccessor() { if (componentAccessor == null) { @@ -483,6 +487,24 @@ public final class AWTAccessor { return componentAccessor; } + /* + * Set an accessor object for the java.awt.Container class. + */ + public static void setContainerAccessor(ContainerAccessor ca) { + containerAccessor = ca; + } + + /* + * Retrieve the accessor object for the java.awt.Container class. + */ + public static ContainerAccessor getContainerAccessor() { + if (containerAccessor == null) { + unsafe.ensureClassInitialized(Container.class); + } + + return containerAccessor; + } + /* * Set an accessor object for the java.awt.Window class. */ @@ -517,6 +539,23 @@ public final class AWTAccessor { return awtEventAccessor; } + /* + * Set an accessor object for the java.awt.event.InputEvent class. + */ + public static void setInputEventAccessor(InputEventAccessor iea) { + inputEventAccessor = iea; + } + + /* + * Retrieve the accessor object for the java.awt.event.InputEvent class. + */ + public static InputEventAccessor getInputEventAccessor() { + if (inputEventAccessor == null) { + unsafe.ensureClassInitialized(InputEvent.class); + } + return inputEventAccessor; + } + /* * Set an accessor object for the java.awt.Frame class. */ diff --git a/jdk/src/share/classes/sun/awt/EmbeddedFrame.java b/jdk/src/share/classes/sun/awt/EmbeddedFrame.java index 96b1325f8cb..344fae1d0e0 100644 --- a/jdk/src/share/classes/sun/awt/EmbeddedFrame.java +++ b/jdk/src/share/classes/sun/awt/EmbeddedFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/awt/FontConfiguration.java b/jdk/src/share/classes/sun/awt/FontConfiguration.java index a2593cc2ff5..ba8f6e56a01 100644 --- a/jdk/src/share/classes/sun/awt/FontConfiguration.java +++ b/jdk/src/share/classes/sun/awt/FontConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +37,10 @@ import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; import java.security.AccessController; import java.security.PrivilegedAction; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Hashtable; -import java.util.Iterator; import java.util.Locale; import java.util.Map.Entry; import java.util.Properties; @@ -329,6 +329,8 @@ public abstract class FontConfiguration { * tables. */ public static void saveBinary(OutputStream out) throws IOException { + sanityCheck(); + DataOutputStream dataOut = new DataOutputStream(out); writeShortTable(dataOut, head); writeShortTable(dataOut, table_scriptIDs); @@ -350,7 +352,6 @@ public abstract class FontConfiguration { if (verbose) { dump(); } - sanityCheck(); } //private static boolean loadingProperties; @@ -1343,6 +1344,11 @@ public abstract class FontConfiguration { private static short[] table_stringIDs; private static char[] table_stringTable; + /** + * Checks consistencies of complied fontconfig data. This method + * is called only at the build-time from + * build.tools.compilefontconfig.CompileFontConfig. + */ private static void sanityCheck() { int errors = 0; @@ -1358,12 +1364,20 @@ public abstract class FontConfiguration { //componentFontNameID starts from "1" for (int ii = 1; ii < table_filenames.length; ii++) { if (table_filenames[ii] == -1) { - System.out.println("\n Warning: " - + " entry is missing!!!"); - if (!osName.contains("Linux")) { + // The corresponding finename entry for a component + // font name is mandatory on Windows, but it's + // optional on Solaris and Linux. + if (osName.contains("Windows")) { + System.err.println("\n Error: entry is missing!!!"); errors++; + } else { + if (verbose && !isEmpty(table_filenames)) { + System.err.println("\n Note: 'filename' entry is undefined for \"" + + getString(table_componentFontNameIDs[ii]) + + "\""); + } } } } @@ -1382,7 +1396,7 @@ public abstract class FontConfiguration { int jj = iii * NUM_STYLES + iij; short ffid = table_scriptFonts[fid + jj]; if (ffid == 0) { - System.out.println("\n Error: <" + System.err.println("\n Error: <" + getFontName(iii) + "." + getStyleName(iij) + "." + getString(table_scriptIDs[ii]) @@ -1402,7 +1416,7 @@ public abstract class FontConfiguration { script.contains("symbol")) { continue; } - System.out.println("\nError: " + System.err.println("\nError: " + " entry is missing!!!"); @@ -1411,13 +1425,21 @@ public abstract class FontConfiguration { } } if (errors != 0) { - System.out.println("!!THERE ARE " + errors + " ERROR(S) IN " + System.err.println("!!THERE ARE " + errors + " ERROR(S) IN " + "THE FONTCONFIG FILE, PLEASE CHECK ITS CONTENT!!\n"); System.exit(1); - } } + private static boolean isEmpty(short[] a) { + for (short s : a) { + if (s != -1) { + return false; + } + } + return true; + } + //dump the fontconfig data tables private static void dump() { System.out.println("\n----Head Table------------"); @@ -1652,20 +1674,16 @@ public abstract class FontConfiguration { private static void writeShortTable(DataOutputStream out, short[] data) throws IOException { - for (int i = 0; i < data.length; i++) { - out.writeShort(data[i]); + for (short val : data) { + out.writeShort(val); } } - private static short[] toList(HashMap map) { + private static short[] toList(HashMap map) { short[] list = new short[map.size()]; - for (int i = 0; i < list.length; i++) { - list[i] = -1; - } - Iterator iterator = map.entrySet().iterator(); - while (iterator.hasNext()) { - Entry entry = (Entry )iterator.next(); - list[entry.getValue().shortValue()] = getStringID(entry.getKey()); + Arrays.fill(list, (short) -1); + for (Entry entry : map.entrySet()) { + list[entry.getValue()] = getStringID(entry.getKey()); } return list; } @@ -1763,25 +1781,19 @@ public abstract class FontConfiguration { int len = table_scriptIDs.length + scriptFonts.size() * 20; table_scriptFonts = new short[len]; - Iterator iterator = scriptAllfonts.entrySet().iterator(); - while (iterator.hasNext()) { - Entry entry = (Entry )iterator.next(); - table_scriptFonts[entry.getKey().intValue()] = (short)entry.getValue().shortValue(); + for (Entry entry : scriptAllfonts.entrySet()) { + table_scriptFonts[entry.getKey().intValue()] = entry.getValue(); } int off = table_scriptIDs.length; - iterator = scriptFonts.entrySet().iterator(); - while (iterator.hasNext()) { - Entry entry = (Entry )iterator.next(); + for (Entry entry : scriptFonts.entrySet()) { table_scriptFonts[entry.getKey().intValue()] = (short)-off; Short[] v = entry.getValue(); - int i = 0; - while (i < 20) { + for (int i = 0; i < 20; i++) { if (v[i] != null) { - table_scriptFonts[off++] = v[i].shortValue(); + table_scriptFonts[off++] = v[i]; } else { table_scriptFonts[off++] = 0; } - i++; } } @@ -1792,9 +1804,7 @@ public abstract class FontConfiguration { //(3) sequences elcID -> XXXX[1|5] -> scriptID[] head[INDEX_sequences] = (short)(head[INDEX_elcIDs] + table_elcIDs.length); table_sequences = new short[elcIDs.size() * NUM_FONTS]; - iterator = sequences.entrySet().iterator(); - while (iterator.hasNext()) { - Entry entry = (Entry )iterator.next(); + for (Entry entry : sequences.entrySet()) { //table_sequences[entry.getKey().intValue()] = (short)-off; int k = entry.getKey().intValue(); short[] v = entry.getValue(); @@ -1827,31 +1837,24 @@ public abstract class FontConfiguration { //(6)componentFontNameID -> filenameID head[INDEX_filenames] = (short)(head[INDEX_componentFontNameIDs] + table_componentFontNameIDs.length); table_filenames = new short[table_componentFontNameIDs.length]; - for (int i = 0; i < table_filenames.length; i++) { - table_filenames[i] = -1; - } - iterator = filenames.entrySet().iterator(); - while (iterator.hasNext()) { - Entry entry = (Entry )iterator.next(); - table_filenames[entry.getKey().shortValue()] = entry.getValue().shortValue(); + Arrays.fill(table_filenames, (short) -1); + + for (Entry entry : filenames.entrySet()) { + table_filenames[entry.getKey()] = entry.getValue(); } //(7)scriptID-> awtfontpath //the paths are stored as scriptID -> stringID in awtfontpahts head[INDEX_awtfontpaths] = (short)(head[INDEX_filenames] + table_filenames.length); table_awtfontpaths = new short[table_scriptIDs.length]; - iterator = awtfontpaths.entrySet().iterator(); - while (iterator.hasNext()) { - Entry entry = (Entry )iterator.next(); - table_awtfontpaths[entry.getKey().shortValue()] = entry.getValue().shortValue(); + for (Entry entry : awtfontpaths.entrySet()) { + table_awtfontpaths[entry.getKey()] = entry.getValue(); } //(8)exclusions head[INDEX_exclusions] = (short)(head[INDEX_awtfontpaths] + table_awtfontpaths.length); table_exclusions = new short[scriptIDs.size()]; - iterator = exclusions.entrySet().iterator(); - while (iterator.hasNext()) { - Entry entry = (Entry )iterator.next(); + for (Entry entry : exclusions.entrySet()) { int[] exI = entry.getValue(); char[] exC = new char[exI.length * 2]; int j = 0; @@ -1859,17 +1862,15 @@ public abstract class FontConfiguration { exC[j++] = (char) (exI[i] >> 16); exC[j++] = (char) (exI[i] & 0xffff); } - table_exclusions[entry.getKey().shortValue()] = getStringID(new String (exC)); + table_exclusions[entry.getKey()] = getStringID(new String (exC)); } //(9)proportionals head[INDEX_proportionals] = (short)(head[INDEX_exclusions] + table_exclusions.length); table_proportionals = new short[proportionals.size() * 2]; - iterator = proportionals.entrySet().iterator(); int j = 0; - while (iterator.hasNext()) { - Entry entry = (Entry )iterator.next(); - table_proportionals[j++] = entry.getKey().shortValue(); - table_proportionals[j++] = entry.getValue().shortValue(); + for (Entry entry : proportionals.entrySet()) { + table_proportionals[j++] = entry.getKey(); + table_proportionals[j++] = entry.getValue(); } //(10) see (1) for info, the only difference is "xxx.motif" @@ -1878,22 +1879,18 @@ public abstract class FontConfiguration { len = table_scriptIDs.length + scriptFontsMotif.size() * 20; table_scriptFontsMotif = new short[len]; - iterator = scriptAllfontsMotif.entrySet().iterator(); - while (iterator.hasNext()) { - Entry entry = (Entry )iterator.next(); + for (Entry entry : scriptAllfontsMotif.entrySet()) { table_scriptFontsMotif[entry.getKey().intValue()] = - (short)entry.getValue().shortValue(); + (short)entry.getValue(); } off = table_scriptIDs.length; - iterator = scriptFontsMotif.entrySet().iterator(); - while (iterator.hasNext()) { - Entry entry = (Entry )iterator.next(); + for (Entry entry : scriptFontsMotif.entrySet()) { table_scriptFontsMotif[entry.getKey().intValue()] = (short)-off; Short[] v = entry.getValue(); int i = 0; while (i < 20) { if (v[i] != null) { - table_scriptFontsMotif[off++] = v[i].shortValue(); + table_scriptFontsMotif[off++] = v[i]; } else { table_scriptFontsMotif[off++] = 0; } @@ -1907,12 +1904,10 @@ public abstract class FontConfiguration { //(11)short[] alphabeticSuffix head[INDEX_alphabeticSuffix] = (short)(head[INDEX_scriptFontsMotif] + table_scriptFontsMotif.length); table_alphabeticSuffix = new short[alphabeticSuffix.size() * 2]; - iterator = alphabeticSuffix.entrySet().iterator(); j = 0; - while (iterator.hasNext()) { - Entry entry = (Entry )iterator.next(); - table_alphabeticSuffix[j++] = entry.getKey().shortValue(); - table_alphabeticSuffix[j++] = entry.getValue().shortValue(); + for (Entry entry : alphabeticSuffix.entrySet()) { + table_alphabeticSuffix[j++] = entry.getKey(); + table_alphabeticSuffix[j++] = entry.getValue(); } //(15)short[] fallbackScriptIDs; just put the ID in head diff --git a/jdk/src/share/classes/sun/awt/HKSCS.java b/jdk/src/share/classes/sun/awt/HKSCS.java index c25df7845d9..08924208b78 100644 --- a/jdk/src/share/classes/sun/awt/HKSCS.java +++ b/jdk/src/share/classes/sun/awt/HKSCS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/awt/PlatformFont.java b/jdk/src/share/classes/sun/awt/PlatformFont.java index 666e7ad552a..74e75ac8496 100644 --- a/jdk/src/share/classes/sun/awt/PlatformFont.java +++ b/jdk/src/share/classes/sun/awt/PlatformFont.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/awt/SunToolkit.java b/jdk/src/share/classes/sun/awt/SunToolkit.java index 984cb11cc69..0442aeeaba6 100644 --- a/jdk/src/share/classes/sun/awt/SunToolkit.java +++ b/jdk/src/share/classes/sun/awt/SunToolkit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -102,26 +102,6 @@ public abstract class SunToolkit extends Toolkit public final static int MAX_BUTTONS_SUPPORTED = 20; public SunToolkit() { - /* If awt.threadgroup is set to class name the instance of - * this class is created (should be subclass of ThreadGroup) - * and EventDispatchThread is created inside of it - * - * If loaded class overrides uncaughtException instance - * handles all uncaught exception on EventDispatchThread - */ - ThreadGroup threadGroup = null; - String tgName = System.getProperty("awt.threadgroup", ""); - - if (tgName.length() != 0) { - try { - Constructor ctor = Class.forName(tgName). - getConstructor(new Class[] {String.class}); - threadGroup = (ThreadGroup)ctor.newInstance(new Object[] {"AWT-ThreadGroup"}); - } catch (Exception e) { - System.err.println("Failed loading " + tgName + ": " + e); - } - } - Runnable initEQ = new Runnable() { public void run () { EventQueue eventQueue; @@ -144,17 +124,7 @@ public abstract class SunToolkit extends Toolkit } }; - if (threadGroup != null) { - Thread eqInitThread = new Thread(threadGroup, initEQ, "EventQueue-Init"); - eqInitThread.start(); - try { - eqInitThread.join(); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } else { - initEQ.run(); - } + initEQ.run(); } public boolean useBufferPerWindow() { @@ -313,6 +283,11 @@ public abstract class SunToolkit extends Toolkit */ public static AppContext createNewAppContext() { ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); + // Create appContext before initialization of EventQueue, so all + // the calls to AppContext.getAppContext() from EventQueue ctor + // return correct values + AppContext appContext = new AppContext(threadGroup); + EventQueue eventQueue; String eqName = System.getProperty("AWT.EventQueueClass", "java.awt.EventQueue"); @@ -322,7 +297,6 @@ public abstract class SunToolkit extends Toolkit System.err.println("Failed loading " + eqName + ": " + e); eventQueue = new EventQueue(); } - AppContext appContext = new AppContext(threadGroup); appContext.put(AppContext.EVENT_QUEUE_KEY, eventQueue); PostEventQueue postEventQueue = new PostEventQueue(eventQueue); @@ -587,6 +561,12 @@ public abstract class SunToolkit extends Toolkit if (event == null) { throw new NullPointerException(); } + // All events posted via this method are system-generated. + // Placing the following call here reduces considerably the + // number of places throughout the toolkit that would + // otherwise have to be modified to precisely identify + // system-generated events. + setSystemGenerated(event); AppContext eventContext = targetToAppContext(event.getSource()); if (eventContext != null && !eventContext.equals(appContext)) { log.fine("Event posted on wrong app context : " + event); @@ -2089,6 +2069,25 @@ public abstract class SunToolkit extends Toolkit } return isInstanceOf(cls.getSuperclass(), type); } + + /////////////////////////////////////////////////////////////////////////// + // + // The following methods help set and identify whether a particular + // AWTEvent object was produced by the system or by user code. As of this + // writing the only consumer is the Java Plug-In, although this information + // could be useful to more clients and probably should be formalized in + // the public API. + // + /////////////////////////////////////////////////////////////////////////// + + public static void setSystemGenerated(AWTEvent e) { + AWTAccessor.getAWTEventAccessor().setSystemGenerated(e); + } + + public static boolean isSystemGenerated(AWTEvent e) { + return AWTAccessor.getAWTEventAccessor().isSystemGenerated(e); + } + } // class SunToolkit diff --git a/jdk/src/share/classes/sun/awt/UngrabEvent.java b/jdk/src/share/classes/sun/awt/UngrabEvent.java index e27e0406830..460a46f804e 100644 --- a/jdk/src/share/classes/sun/awt/UngrabEvent.java +++ b/jdk/src/share/classes/sun/awt/UngrabEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +40,10 @@ import java.awt.Component; *

      To listen for this event, install AWTEventListener with {@value sun.awt.SunToolkit#GRAB_EVENT_MASK} */ public class UngrabEvent extends AWTEvent { + private final static int UNGRAB_EVENT_ID = 1998; + public UngrabEvent(Component source) { - super(source, 0xffff); + super(source, UNGRAB_EVENT_ID); } public String toString() { diff --git a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java index db92e68ffd9..360bb9a63a6 100644 --- a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java +++ b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -94,6 +94,11 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, protected int dropStatus = STATUS_NONE; protected boolean dropComplete = false; + // The flag is used to monitor whether the drop action is + // handled by a user. That allows to distinct during + // which operation getTransferData() method is invoked. + boolean dropInProcess = false; + /* * global lock */ @@ -220,7 +225,7 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, SecurityManager sm = System.getSecurityManager(); try { - if (!dropComplete && sm != null) { + if (!dropInProcess && sm != null) { sm.checkSystemClipboardAccess(); } } catch (Exception e) { @@ -526,6 +531,8 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, setCurrentJVMLocalSourceTransferable(null); } + dropInProcess = true; + try { ((DropTargetListener)dt).drop(new DropTargetDropEvent(dtc, hots, @@ -538,6 +545,7 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, } else if (dropComplete == false) { dropComplete(false); } + dropInProcess = false; } } else { rejectDrop(); diff --git a/jdk/src/share/classes/sun/awt/image/BufImgSurfaceData.java b/jdk/src/share/classes/sun/awt/image/BufImgSurfaceData.java index 43ec7286620..239f8834ac5 100644 --- a/jdk/src/share/classes/sun/awt/image/BufImgSurfaceData.java +++ b/jdk/src/share/classes/sun/awt/image/BufImgSurfaceData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/awt/image/ImageRepresentation.java b/jdk/src/share/classes/sun/awt/image/ImageRepresentation.java index 5f1ef21004d..23b33212602 100644 --- a/jdk/src/share/classes/sun/awt/image/ImageRepresentation.java +++ b/jdk/src/share/classes/sun/awt/image/ImageRepresentation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/awt/image/PNGImageDecoder.java b/jdk/src/share/classes/sun/awt/image/PNGImageDecoder.java index 7b65372d961..69bb984c514 100644 --- a/jdk/src/share/classes/sun/awt/image/PNGImageDecoder.java +++ b/jdk/src/share/classes/sun/awt/image/PNGImageDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/awt/resources/awt_pt_BR.properties b/jdk/src/share/classes/sun/awt/resources/awt_pt_BR.properties new file mode 100644 index 00000000000..f7808b2ed2b --- /dev/null +++ b/jdk/src/share/classes/sun/awt/resources/awt_pt_BR.properties @@ -0,0 +1,191 @@ +# +# AWT-specific properties +# + +# Modifier names +AWT.shift=Shift +AWT.control=Ctrl +AWT.alt=Alt +AWT.meta=Meta +AWT.altGraph=Alt Graph + +# Key names +AWT.enter=Enter +AWT.backSpace=Backspace +AWT.tab=Tab +AWT.cancel=Cancelar +AWT.clear=Limpar +AWT.pause=Pausar +AWT.capsLock=Caps Lock +AWT.escape=Escape +AWT.space=Barra de espa\u00e7o +AWT.pgup=P\u00e1gina acima +AWT.pgdn=P\u00e1gina abaixo +AWT.end=Fim +AWT.home=In\u00edcio +AWT.left=Esquerda +AWT.up=Acima +AWT.right=Direita +AWT.down=Abaixo +AWT.begin=Come\u00e7ar +AWT.comma=V\u00edrgula +AWT.period=Ponto final +AWT.slash=Barra +AWT.semicolon=Ponto-e-v\u00edrgula +AWT.equals=Igual +AWT.openBracket=Abrir par\u00eantese +AWT.backSlash=Barra invertida +AWT.closeBracket=Fechar par\u00eantese +AWT.multiply=Teclado num\u00e9rico * +AWT.add=Teclado num\u00e9rico + +AWT.separator=Teclado num\u00e9rico , +AWT.separater=Teclado num\u00e9rico , +AWT.subtract=Teclado num\u00e9rico - +AWT.decimal=Teclado num\u00e9rico . +AWT.divide=Teclado num\u00e9rico / +AWT.delete=Excluir +AWT.numLock=Num Lock +AWT.scrollLock=Scroll Lock +AWT.f1=F1 +AWT.f2=F2 +AWT.f3=F3 +AWT.f4=F4 +AWT.f5=F5 +AWT.f6=F6 +AWT.f7=F7 +AWT.f8=F8 +AWT.f9=F9 +AWT.f10=F10 +AWT.f11=F11 +AWT.f12=F12 +AWT.f13=F13 +AWT.f14=F14 +AWT.f15=F15 +AWT.f16=F16 +AWT.f17=F17 +AWT.f18=F18 +AWT.f19=F19 +AWT.f20=F20 +AWT.f21=F21 +AWT.f22=F22 +AWT.f23=F23 +AWT.f24=F24 +AWT.printScreen=Imprimir tela +AWT.insert=Inserir +AWT.help=Ajuda +AWT.windows=Windows +AWT.context=Menu de contexto +AWT.backQuote=Crase +AWT.quote=Aspas +AWT.deadGrave=Acento grave +AWT.deadAcute=Acento agudo +AWT.deadCircumflex=Acento circunflexo +AWT.deadTilde=Til +AWT.deadMacron=M\u00e1cron +AWT.deadBreve=Braquia +AWT.deadAboveDot=Ponto em cima +AWT.deadDiaeresis=Trema +AWT.deadAboveRing=S\u00edmbolo do grau +AWT.deadDoubleAcute=Acento agudo duplo +AWT.deadCaron=Acento circunflexo invertido +AWT.deadCedilla=Cedilha +AWT.deadOgonek=Ogonek +AWT.deadIota=Iota +AWT.deadVoicedSound=Som sonoro +AWT.deadSemivoicedSound=Som surdo +AWT.ampersand=E comercial +AWT.asterisk=Asterisco +AWT.quoteDbl=Aspas duplas +AWT.Less=Menos +AWT.greater=Maior +AWT.braceLeft=Chave esquerda +AWT.braceRight=Chave direta +AWT.at=Arroba +AWT.colon=V\u00edrgula +AWT.circumflex=Circunflexo +AWT.dollar=D\u00f3lar +AWT.euro=Euro +AWT.exclamationMark=Ponto de exclama\u00e7\u00e3o +AWT.invertedExclamationMark=Ponto de exclama\u00e7\u00e3o invertido +AWT.leftParenthesis=Par\u00eantese esquerdo +AWT.numberSign=Sinal num\u00e9rico +AWT.plus=Mais +AWT.minus=Menos +AWT.rightParenthesis=Par\u00eantese direito +AWT.underscore=Sublinhado +AWT.final=Final +AWT.convert=Converter +AWT.noconvert=N\u00e3o converter +AWT.accept=Aceitar +AWT.modechange=Altera\u00e7\u00e3o de modo +AWT.kana=Kana +AWT.kanji=Kanji +AWT.alphanumeric=Alfanum\u00e9rico +AWT.katakana=Katakana +AWT.hiragana=Hiragana +AWT.fullWidth=Largura total +AWT.halfWidth=Meia largura +AWT.romanCharacters=Caracteres romanos +AWT.allCandidates=Todos os candidatos +AWT.previousCandidate=Candidato anterior +AWT.codeInput=Entrada de c\u00f3digo +AWT.japaneseKatakana=Katakana japon\u00eas +AWT.japaneseHiragana=Hiragana japon\u00eas +AWT.japaneseRoman=Romano japon\u00eas +AWT.kanaLock=Kana Lock +AWT.inputMethodOnOff=M\u00e9todo de entrada ativado/desativado +AWT.again=Novamente +AWT.undo=Desfazer +AWT.copy=Copiar +AWT.paste=Colar +AWT.cut=Recortar +AWT.find=Localizar +AWT.props=Props +AWT.stop=Parar +AWT.compose=Compor + +# Numeric Keypad +AWT.numpad=Teclado num\u00e9rico +AWT.unknown=Desconhecido +AWT.undefined=Indefinido + +# Predefined cursor names +AWT.DefaultCursor=Cursor padr\u00e3o +AWT.CrosshairCursor=Cursor em forma de cruz +AWT.TextCursor=Cursor de texto +AWT.WaitCursor=Cursor em forma de ampulheta +AWT.SWResizeCursor=Cursor de seta que aponta para sudoeste +AWT.SEResizeCursor=Cursor de seta que aponta para sudeste +AWT.NWResizeCursor=Cursor de seta que aponta para noroeste +AWT.NEResizeCursor=Cursor de seta que aponta para nordeste +AWT.NResizeCursor=Cursor de seta que aponta para cima +AWT.SResizeCursor=Cursor de seta que aponta para baixo +AWT.WResizeCursor=Cursor de seta que aponta \u00e0 esquerda +AWT.EResizeCursor=Cursor de seta que aponta \u00e0 direita +AWT.HandCursor=Cursor em forma de m\u00e3o +AWT.MoveCursor=Cursor de movimento +AWT.DefaultDragCursor=Cursor padr\u00e3o de arrastar +AWT.DefaultNoDropCursor=Cursor padr\u00e3o sem arrasto +AWT.DefaultDropCursor=Cursor padr\u00e3o de soltar + +# Input method related strings +AWT.CompositionWindowTitle=Janela de entrada +AWT.InputMethodSelectionMenu=Selecionar m\u00e9todo de entrada +AWT.HostInputMethodDisplayName=M\u00e9todos de entrada do sistema +AWT.InputMethodLanguage.ja=Japon\u00eas +AWT.InputMethodLanguage.ko=Coreano +AWT.InputMethodLanguage.zh=Chin\u00eas +AWT.InputMethodLanguage.zh_CN=Chin\u00eas simplificado +AWT.InputMethodLanguage.zh_TW=Chin\u00eas tradicional +AWT.InputMethodCreationFailed=N\u00e3o foi poss\u00edvel criar {0}. Raz\u00e3o: {1} + +# Property to select between on-the-spot and below-the-spot +# composition with input methods. Valid values: +# "on-the-spot", "below-the-spot". +# May be overridden from command line. +java.awt.im.style=no momento +java.awt.def.delay=30 + +# Warnings +AWT.InconsistentDLLsWarning=As opera\u00e7\u00f5es baseadas em texto podem n\u00e3o funcionar corretamente devido a um conjunto incoerente de bibliotecas de vincula\u00e7\u00e3o din\u00e2mica (DLLs) instalado no seu sistema. Para obter mais informa\u00e7\u00f5es sobre este problema e uma solu\u00e7\u00e3o recomendada, consulte as Notas de vers\u00e3o do Java(TM) 2 SDK, Standard Edition em java.sun.com. + diff --git a/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java b/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java index 61f9b3923a8..b39c4686d6c 100644 --- a/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java +++ b/jdk/src/share/classes/sun/dc/DuctusRenderingEngine.java @@ -635,6 +635,88 @@ public class DuctusRenderingEngine extends RenderingEngine { return r; } + /** + * {@inheritDoc} + */ + @Override + public AATileGenerator getAATileGenerator(double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2, + Region clip, + int bbox[]) + { + // REMIND: Deal with large coordinates! + double ldx1, ldy1, ldx2, ldy2; + boolean innerpgram = (lw1 > 0 && lw2 > 0); + + if (innerpgram) { + ldx1 = dx1 * lw1; + ldy1 = dy1 * lw1; + ldx2 = dx2 * lw2; + ldy2 = dy2 * lw2; + x -= (ldx1 + ldx2) / 2.0; + y -= (ldy1 + ldy2) / 2.0; + dx1 += ldx1; + dy1 += ldy1; + dx2 += ldx2; + dy2 += ldy2; + if (lw1 > 1 && lw2 > 1) { + // Inner parallelogram was entirely consumed by stroke... + innerpgram = false; + } + } else { + ldx1 = ldy1 = ldx2 = ldy2 = 0; + } + + Rasterizer r = getRasterizer(); + + r.setUsage(Rasterizer.EOFILL); + + r.beginPath(); + r.beginSubpath((float) x, (float) y); + r.appendLine((float) (x+dx1), (float) (y+dy1)); + r.appendLine((float) (x+dx1+dx2), (float) (y+dy1+dy2)); + r.appendLine((float) (x+dx2), (float) (y+dy2)); + r.closedSubpath(); + if (innerpgram) { + x += ldx1 + ldx2; + y += ldy1 + ldy2; + dx1 -= 2.0 * ldx1; + dy1 -= 2.0 * ldy1; + dx2 -= 2.0 * ldx2; + dy2 -= 2.0 * ldy2; + r.beginSubpath((float) x, (float) y); + r.appendLine((float) (x+dx1), (float) (y+dy1)); + r.appendLine((float) (x+dx1+dx2), (float) (y+dy1+dy2)); + r.appendLine((float) (x+dx2), (float) (y+dy2)); + r.closedSubpath(); + } + + try { + r.endPath(); + r.getAlphaBox(bbox); + clip.clipBoxToBounds(bbox); + if (bbox[0] >= bbox[2] || bbox[1] >= bbox[3]) { + dropRasterizer(r); + return null; + } + r.setOutputArea(bbox[0], bbox[1], + bbox[2] - bbox[0], + bbox[3] - bbox[1]); + } catch (PRException e) { + /* + * This exeption is thrown from the native part of the Ductus + * (only in case of a debug build) to indicate that some + * segments of the path have very large coordinates. + * See 4485298 for more info. + */ + System.err.println("DuctusRenderingEngine.getAATileGenerator: "+e); + } + + return r; + } + private void feedConsumer(PathConsumer consumer, PathIterator pi) { try { consumer.beginPath(); diff --git a/jdk/src/share/classes/sun/dyn/AdapterMethodHandle.java b/jdk/src/share/classes/sun/dyn/AdapterMethodHandle.java index fb9b7fa26c2..4766ba57df6 100644 --- a/jdk/src/share/classes/sun/dyn/AdapterMethodHandle.java +++ b/jdk/src/share/classes/sun/dyn/AdapterMethodHandle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -478,6 +478,39 @@ public class AdapterMethodHandle extends BoundMethodHandle { return new AdapterMethodHandle(target, newType, makeConv(raw ? OP_RETYPE_RAW : OP_RETYPE_ONLY)); } + static MethodHandle makeTypeHandler(Access token, + MethodHandle target, MethodHandle typeHandler) { + Access.check(token); + return new WithTypeHandler(target, typeHandler); + } + + static class WithTypeHandler extends AdapterMethodHandle { + final MethodHandle target, typeHandler; + WithTypeHandler(MethodHandle target, MethodHandle typeHandler) { + super(target, target.type(), makeConv(OP_RETYPE_ONLY)); + this.target = target; + this.typeHandler = typeHandler.asType(TYPE_HANDLER_TYPE); + } + + public MethodHandle asType(MethodType newType) { + if (this.type() == newType) + return this; + try { + MethodHandle retyped = (MethodHandle) typeHandler.invokeExact(target, newType); + // Contract: Must return the desired type, or throw WMT + if (retyped.type() != newType) + throw new WrongMethodTypeException(retyped.toString()); + return retyped; + } catch (Throwable ex) { + if (ex instanceof Error) throw (Error)ex; + if (ex instanceof RuntimeException) throw (RuntimeException)ex; + throw new RuntimeException(ex); + } + } + private static final MethodType TYPE_HANDLER_TYPE + = MethodType.methodType(MethodHandle.class, MethodHandle.class, MethodType.class); + } + /** Can a checkcast adapter validly convert the target to newType? * The JVM supports all kind of reference casts, even silly ones. */ diff --git a/jdk/src/share/classes/sun/dyn/BoundMethodHandle.java b/jdk/src/share/classes/sun/dyn/BoundMethodHandle.java index 5152187229e..0fab63f7c77 100644 --- a/jdk/src/share/classes/sun/dyn/BoundMethodHandle.java +++ b/jdk/src/share/classes/sun/dyn/BoundMethodHandle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +48,6 @@ public class BoundMethodHandle extends MethodHandle { private static final MemberName.Factory IMPL_NAMES = MemberName.getFactory(IMPL_TOKEN); // Constructors in this class *must* be package scoped or private. - // Exception: JavaMethodHandle constructors are protected. - // (The link between JMH and BMH is temporary.) /** Bind a direct MH to its receiver (or first ref. argument). * The JVM will pre-dispatch the MH if it is not already static. @@ -105,70 +103,20 @@ public class BoundMethodHandle extends MethodHandle { super(Access.TOKEN, type); this.argument = argument; this.vmargslot = vmargslot; - assert(this.getClass() == AdapterMethodHandle.class); + assert(this instanceof AdapterMethodHandle); } - /** Initialize the current object as a Java method handle, binding it + /** Initialize the current object as a self-bound method handle, binding it * as the first argument of the method handle {@code entryPoint}. * The invocation type of the resulting method handle will be the * same as {@code entryPoint}, except that the first argument * type will be dropped. */ - protected BoundMethodHandle(MethodHandle entryPoint) { - super(Access.TOKEN, entryPoint.type().dropParameterTypes(0, 1)); + protected BoundMethodHandle(Access token, MethodHandle entryPoint) { + super(token, entryPoint.type().dropParameterTypes(0, 1)); this.argument = this; // kludge; get rid of this.vmargslot = this.type().parameterSlotDepth(0); initTarget(entryPoint, 0); - assert(this instanceof JavaMethodHandle); - } - - /** Initialize the current object as a Java method handle. - */ - protected BoundMethodHandle(String entryPointName, MethodType type, boolean matchArity) { - super(Access.TOKEN, null); - MethodHandle entryPoint - = findJavaMethodHandleEntryPoint(this.getClass(), - entryPointName, type, matchArity); - MethodHandleImpl.initType(this, entryPoint.type().dropParameterTypes(0, 1)); - this.argument = this; // kludge; get rid of - this.vmargslot = this.type().parameterSlotDepth(0); - initTarget(entryPoint, 0); - assert(this instanceof JavaMethodHandle); - } - - private static - MethodHandle findJavaMethodHandleEntryPoint(Class caller, - String name, - MethodType type, - boolean matchArity) { - if (matchArity) type.getClass(); // elicit NPE - List methods = IMPL_NAMES.getMethods(caller, true, name, null, caller); - MethodType foundType = null; - MemberName foundMethod = null; - for (MemberName method : methods) { - if (method.getDeclaringClass() == MethodHandle.class) - continue; // ignore methods inherited from MH class itself - MethodType mtype = method.getMethodType(); - if (type != null && type.parameterCount() != mtype.parameterCount()) - continue; - else if (foundType == null) - foundType = mtype; - else if (foundType != mtype) - throw newIllegalArgumentException("more than one method named "+name+" in "+caller.getName()); - // discard overrides - if (foundMethod == null) - foundMethod = method; - else if (foundMethod.getDeclaringClass().isAssignableFrom(method.getDeclaringClass())) - foundMethod = method; - } - if (foundMethod == null) - throw newIllegalArgumentException("no method named "+name+" in "+caller.getName()); - MethodHandle entryPoint = MethodHandleImpl.findMethod(IMPL_TOKEN, foundMethod, true, caller); - if (type != null) { - MethodType epType = type.insertParameterTypes(0, entryPoint.type().parameterType(0)); - entryPoint = MethodHandles.convertArguments(entryPoint, epType); - } - return entryPoint; } /** Make sure the given {@code argument} can be used as {@code argnum}-th @@ -224,6 +172,11 @@ public class BoundMethodHandle extends MethodHandle { @Override public String toString() { + return MethodHandleImpl.addTypeString(baseName(), this); + } + + /** Component of toString() before the type string. */ + protected String baseName() { MethodHandle mh = this; while (mh instanceof BoundMethodHandle) { Object info = MethodHandleNatives.getTargetInfo(mh); @@ -236,12 +189,16 @@ public class BoundMethodHandle extends MethodHandle { if (name != null) return name; else - return super.toString(); // , probably + return noParens(super.toString()); // "invoke", probably } assert(mh != this); - if (mh instanceof JavaMethodHandle) - break; // access JMH.toString(), not BMH.toString() } - return mh.toString(); + return noParens(mh.toString()); + } + + private static String noParens(String str) { + int paren = str.indexOf('('); + if (paren >= 0) str = str.substring(0, paren); + return str; } } diff --git a/jdk/src/share/classes/sun/dyn/CallSiteImpl.java b/jdk/src/share/classes/sun/dyn/CallSiteImpl.java index 2e02e74ebd0..5257a285f68 100644 --- a/jdk/src/share/classes/sun/dyn/CallSiteImpl.java +++ b/jdk/src/share/classes/sun/dyn/CallSiteImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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 sun.dyn; import java.dyn.*; +import static sun.dyn.MemberName.uncaughtException; /** * Parts of CallSite known to the JVM. @@ -40,28 +41,45 @@ public class CallSiteImpl { Object info, // Caller information: MemberName callerMethod, int callerBCI) { - Class caller = callerMethod.getDeclaringClass(); + Class callerClass = callerMethod.getDeclaringClass(); + Object caller; + if (bootstrapMethod.type().parameterType(0) == Class.class) + caller = callerClass; // remove for PFD + else + caller = MethodHandleImpl.IMPL_LOOKUP.in(callerClass); if (bootstrapMethod == null) { // If there is no bootstrap method, throw IncompatibleClassChangeError. // This is a valid generic error type for resolution (JLS 12.3.3). throw new IncompatibleClassChangeError - ("Class "+caller.getName()+" has not declared a bootstrap method for invokedynamic"); + ("Class "+callerClass.getName()+" has not declared a bootstrap method for invokedynamic"); } CallSite site; try { - if (bootstrapMethod.type().parameterCount() == 3) - site = bootstrapMethod.invokeExact(caller, name, type); - else if (bootstrapMethod.type().parameterCount() == 4) - site = bootstrapMethod.invokeExact(caller, name, type, - !(info instanceof java.lang.annotation.Annotation[]) ? null - : (java.lang.annotation.Annotation[]) info); - else - throw new InternalError("bad BSM: "+bootstrapMethod); - if (!(site instanceof CallSite)) - throw new InvokeDynamicBootstrapError("class bootstrap method failed to create a call site: "+caller); - PRIVATE_INITIALIZE_CALL_SITE.invokeExact(site, - name, type, - callerMethod, callerBCI); + Object binding; + if (info == null) { + if (false) // switch when invokeGeneric works + binding = bootstrapMethod.invokeGeneric(caller, name, type); + else + binding = bootstrapMethod.invokeVarargs(new Object[]{ caller, name, type }); + } else { + info = maybeReBox(info); + if (false) // switch when invokeGeneric works + binding = bootstrapMethod.invokeGeneric(caller, name, type, info); + else + binding = bootstrapMethod.invokeVarargs(new Object[]{ caller, name, type, info }); + } + //System.out.println("BSM for "+name+type+" => "+binding); + if (binding instanceof CallSite) { + site = (CallSite) binding; + } else if (binding instanceof MethodHandle) { + // Transitional! + MethodHandle target = (MethodHandle) binding; + site = new ConstantCallSite(target); + } else { + throw new ClassCastException("bootstrap method failed to produce a MethodHandle or CallSite"); + } + PRIVATE_INITIALIZE_CALL_SITE.invokeExact(site, name, type, + callerMethod, callerBCI); assert(site.getTarget() != null); assert(site.getTarget().type().equals(type)); } catch (Throwable ex) { @@ -75,13 +93,38 @@ public class CallSiteImpl { return site; } + private static Object maybeReBox(Object x) { + if (x instanceof Integer) { + int xi = (int) x; + if (xi == (byte) xi) + x = xi; // must rebox; see JLS 5.1.7 + return x; + } else if (x instanceof Object[]) { + Object[] xa = (Object[]) x; + for (int i = 0; i < xa.length; i++) { + if (xa[i] instanceof Integer) + xa[i] = maybeReBox(xa[i]); + } + return xa; + } else { + return x; + } + } + // This method is private in CallSite because it touches private fields in CallSite. // These private fields (vmmethod, vmindex) are specific to the JVM. - private static final MethodHandle PRIVATE_INITIALIZE_CALL_SITE = + private static final MethodHandle PRIVATE_INITIALIZE_CALL_SITE; + static { + try { + PRIVATE_INITIALIZE_CALL_SITE = MethodHandleImpl.IMPL_LOOKUP.findVirtual(CallSite.class, "initializeFromJVM", MethodType.methodType(void.class, String.class, MethodType.class, MemberName.class, int.class)); + } catch (NoAccessException ex) { + throw uncaughtException(ex); + } + } public static void setCallSiteTarget(Access token, CallSite site, MethodHandle target) { Access.check(token); diff --git a/jdk/src/share/classes/sun/dyn/FilterGeneric.java b/jdk/src/share/classes/sun/dyn/FilterGeneric.java index 21540e6647e..c15a8398777 100644 --- a/jdk/src/share/classes/sun/dyn/FilterGeneric.java +++ b/jdk/src/share/classes/sun/dyn/FilterGeneric.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 +25,8 @@ package sun.dyn; -import java.dyn.JavaMethodHandle; -import java.dyn.MethodHandle; -import java.dyn.MethodType; -import java.dyn.NoAccessException; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; +import java.dyn.*; +import java.lang.reflect.*; import static sun.dyn.MemberName.newIllegalArgumentException; /** @@ -229,13 +225,13 @@ class FilterGeneric { * The invoker is kept separate from the target because it can be * generated once per type erasure family, and reused across adapters. */ - static abstract class Adapter extends JavaMethodHandle { + static abstract class Adapter extends BoundMethodHandle { protected final MethodHandle filter; // transforms one or more arguments protected final MethodHandle target; // ultimate target @Override public String toString() { - return target.toString(); + return MethodHandleImpl.addTypeString(target, this); } protected boolean isPrototype() { return target == null; } @@ -250,7 +246,7 @@ class FilterGeneric { protected Adapter(MethodHandle entryPoint, MethodHandle filter, MethodHandle target) { - super(entryPoint); + super(Access.TOKEN, entryPoint); this.filter = filter; this.target = target; } @@ -307,7 +303,7 @@ class FilterGeneric { protected Object invoke_C0(Object a0) { return target.invokeExact(filter.invokeExact(a0)); } protected Object invoke_C1(Object a0) { return target.invokeExact(a0, filter.invokeExact()); } protected Object invoke_Y0(Object a0) { Object[] av = { a0 }; - filter.invokeExact(av); return target.invokeExact(av[0]); } + filter.invokeExact(av); return target.invokeExact(av[0]); } } static class F2X extends Adapter { protected F2X(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -324,7 +320,7 @@ class FilterGeneric { protected Object invoke_C1(Object a0, Object a1) { return target.invokeExact(a0, filter.invokeExact(a1)); } protected Object invoke_C2(Object a0, Object a1) { return target.invokeExact(a0, a1, filter.invokeExact()); } protected Object invoke_Y0(Object a0, Object a1) { Object[] av = { a0, a1 }; - filter.invokeExact(av); return target.invokeExact(av[0], av[1]); } + filter.invokeExact(av); return target.invokeExact(av[0], av[1]); } } // */ @@ -341,7 +337,7 @@ class FilterGeneric { return target.invokeExact(filter.invokeExact()); } static final Object[] NO_ARGS = { }; protected Object invoke_Y0() throws Throwable { - filter.invokeExact(NO_ARGS); // make the flyby + filter.invokeExact(NO_ARGS); // make the flyby return target.invokeExact(); } } @@ -379,7 +375,7 @@ class genclasses { " return target.invokeExact(@av@, filter.invokeExact()); }", " protected Object invoke_Y0(@Tvav@) throws Throwable {", " Object[] av = { @av@ };", - " filter.invokeExact(av); // make the flyby", + " filter.invokeExact(av); // make the flyby", " return target.invokeExact(@av[i]@); }", " }", } }; @@ -522,7 +518,7 @@ class genclasses { return target.invokeExact(a0, filter.invokeExact()); } protected Object invoke_Y0(Object a0) throws Throwable { Object[] av = { a0 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0]); } } static class F2 extends Adapter { @@ -552,7 +548,7 @@ class genclasses { return target.invokeExact(a0, a1, filter.invokeExact()); } protected Object invoke_Y0(Object a0, Object a1) throws Throwable { Object[] av = { a0, a1 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1]); } } static class F3 extends Adapter { @@ -589,7 +585,7 @@ class genclasses { return target.invokeExact(a0, a1, a2, filter.invokeExact()); } protected Object invoke_Y0(Object a0, Object a1, Object a2) throws Throwable { Object[] av = { a0, a1, a2 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2]); } } static class F4 extends Adapter { @@ -633,7 +629,7 @@ class genclasses { return target.invokeExact(a0, a1, a2, a3, filter.invokeExact()); } protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3) throws Throwable { Object[] av = { a0, a1, a2, a3 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3]); } } static class F5 extends Adapter { @@ -702,7 +698,7 @@ class genclasses { protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { Object[] av = { a0, a1, a2, a3, a4 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4]); } } static class F6 extends Adapter { @@ -781,7 +777,7 @@ class genclasses { protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5]); } } static class F7 extends Adapter { @@ -870,7 +866,7 @@ class genclasses { protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6]); } } static class F8 extends Adapter { @@ -969,7 +965,7 @@ class genclasses { protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7]); } } static class F9 extends Adapter { @@ -1108,7 +1104,7 @@ class genclasses { Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8]); } } static class F10 extends Adapter { @@ -1260,7 +1256,7 @@ class genclasses { Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9]); } } static class F11 extends Adapter { @@ -1446,7 +1442,7 @@ class genclasses { Object a4, Object a5, Object a6, Object a7, Object a8, Object a9, Object a10) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10]); } } static class F12 extends Adapter { @@ -1648,7 +1644,7 @@ class genclasses { Object a4, Object a5, Object a6, Object a7, Object a8, Object a9, Object a10, Object a11) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11]); } } static class F13 extends Adapter { @@ -1908,7 +1904,7 @@ class genclasses { Object a8, Object a9, Object a10, Object a11, Object a12) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12]); } } static class F14 extends Adapter { @@ -2187,7 +2183,7 @@ class genclasses { Object a8, Object a9, Object a10, Object a11, Object a12, Object a13) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13]); } } static class F15 extends Adapter { @@ -2485,7 +2481,7 @@ class genclasses { Object a8, Object a9, Object a10, Object a11, Object a12, Object a13, Object a14) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14]); } } static class F16 extends Adapter { @@ -2802,7 +2798,7 @@ class genclasses { Object a8, Object a9, Object a10, Object a11, Object a12, Object a13, Object a14, Object a15) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15]); } } static class F17 extends Adapter { @@ -3192,7 +3188,7 @@ class genclasses { Object a12, Object a13, Object a14, Object a15, Object a16) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16]); } } static class F18 extends Adapter { @@ -3604,7 +3600,7 @@ class genclasses { Object a12, Object a13, Object a14, Object a15, Object a16, Object a17) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16], av[17]); } } static class F19 extends Adapter { @@ -4038,7 +4034,7 @@ class genclasses { Object a12, Object a13, Object a14, Object a15, Object a16, Object a17, Object a18) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16], av[17], av[18]); } } static class F20 extends Adapter { @@ -4494,7 +4490,7 @@ class genclasses { Object a12, Object a13, Object a14, Object a15, Object a16, Object a17, Object a18, Object a19) throws Throwable { Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19 }; - filter.invokeExact(av); // make the flyby + filter.invokeExact(av); // make the flyby return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16], av[17], av[18], av[19]); } } } diff --git a/jdk/src/share/classes/sun/dyn/FilterOneArgument.java b/jdk/src/share/classes/sun/dyn/FilterOneArgument.java index 354694f49a4..f013bc35222 100644 --- a/jdk/src/share/classes/sun/dyn/FilterOneArgument.java +++ b/jdk/src/share/classes/sun/dyn/FilterOneArgument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +25,8 @@ package sun.dyn; -import java.dyn.JavaMethodHandle; -import java.dyn.MethodHandle; -import java.dyn.MethodType; +import java.dyn.*; +import static sun.dyn.MemberName.uncaughtException; /** * Unary function composition, useful for many small plumbing jobs. @@ -37,7 +36,7 @@ import java.dyn.MethodType; * final method type is the responsibility of a JVM-level adapter. * @author jrose */ -public class FilterOneArgument extends JavaMethodHandle { +public class FilterOneArgument extends BoundMethodHandle { protected final MethodHandle filter; // Object -> Object protected final MethodHandle target; // Object -> Object @@ -51,11 +50,19 @@ public class FilterOneArgument extends JavaMethodHandle { return target.invokeExact(filteredArgument); } - private static final MethodHandle INVOKE = - MethodHandleImpl.IMPL_LOOKUP.findVirtual(FilterOneArgument.class, "invoke", MethodType.genericMethodType(1)); + private static final MethodHandle INVOKE; + static { + try { + INVOKE = + MethodHandleImpl.IMPL_LOOKUP.findVirtual(FilterOneArgument.class, "invoke", + MethodType.genericMethodType(1)); + } catch (NoAccessException ex) { + throw uncaughtException(ex); + } + } protected FilterOneArgument(MethodHandle filter, MethodHandle target) { - super(INVOKE); + super(Access.TOKEN, INVOKE); this.filter = filter; this.target = target; } diff --git a/jdk/src/share/classes/sun/dyn/FromGeneric.java b/jdk/src/share/classes/sun/dyn/FromGeneric.java index f4a1969f8ff..f5ad1061ce2 100644 --- a/jdk/src/share/classes/sun/dyn/FromGeneric.java +++ b/jdk/src/share/classes/sun/dyn/FromGeneric.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 @@ package sun.dyn; -import java.dyn.JavaMethodHandle; -import java.dyn.MethodHandle; -import java.dyn.MethodHandles; -import java.dyn.MethodType; -import java.dyn.NoAccessException; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import sun.dyn.util.ValueConversions; -import sun.dyn.util.Wrapper; +import java.dyn.*; +import java.lang.reflect.*; +import sun.dyn.util.*; /** * Adapters which mediate between incoming calls which are generic @@ -247,7 +241,7 @@ class FromGeneric { * The invoker is kept separate from the target because it can be * generated once per type erasure family, and reused across adapters. */ - static abstract class Adapter extends JavaMethodHandle { + static abstract class Adapter extends BoundMethodHandle { /* * class X<> extends Adapter { * (MH, Object**N)=>raw(R) invoker; @@ -262,7 +256,7 @@ class FromGeneric { @Override public String toString() { - return target.toString(); + return MethodHandleImpl.addTypeString(target, this); } protected boolean isPrototype() { return target == null; } @@ -277,7 +271,7 @@ class FromGeneric { protected Adapter(MethodHandle entryPoint, MethodHandle invoker, MethodHandle convert, MethodHandle target) { - super(entryPoint); + super(Access.TOKEN, entryPoint); this.invoker = invoker; this.convert = convert; this.target = target; @@ -289,11 +283,11 @@ class FromGeneric { // { return new ThisType(entryPoint, convert, target); } /// Conversions on the value returned from the target. - protected Object convert_L(Object result) throws Throwable { return convert.invokeExact(result); } - protected Object convert_I(int result) throws Throwable { return convert.invokeExact(result); } - protected Object convert_J(long result) throws Throwable { return convert.invokeExact(result); } - protected Object convert_F(float result) throws Throwable { return convert.invokeExact(result); } - protected Object convert_D(double result) throws Throwable { return convert.invokeExact(result); } + protected Object convert_L(Object result) throws Throwable { return convert.invokeExact(result); } + protected Object convert_I(int result) throws Throwable { return convert.invokeExact(result); } + protected Object convert_J(long result) throws Throwable { return convert.invokeExact(result); } + protected Object convert_F(float result) throws Throwable { return convert.invokeExact(result); } + protected Object convert_D(double result) throws Throwable { return convert.invokeExact(result); } static private final String CLASS_PREFIX; // "sun.dyn.FromGeneric$" static { @@ -322,11 +316,11 @@ class FromGeneric { { super(e, i, c, t); } protected xA2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new xA2(e, i, c, t); } - protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L(invoker.invokeExact(target, a0, a1)); } - protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I(invoker.invokeExact(target, a0, a1)); } - protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J(invoker.invokeExact(target, a0, a1)); } - protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F(invoker.invokeExact(target, a0, a1)); } - protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D(invoker.invokeExact(target, a0, a1)); } + protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1)); } + protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1)); } + protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1)); } + protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1)); } + protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1)); } } // */ @@ -335,7 +329,8 @@ class FromGeneric { //{{{ import java.util.*; class genclasses { - static String[] TYPES = { "Object", "int ", "long ", "float ", "double" }; + static String[] TYPES = { "Object", "int ", "long ", "float ", "double" }; + static String[] WRAPS = { " ", "(Integer)", "(Long) ", "(Float) ", "(Double) " }; static String[] TCHARS = { "L", "I", "J", "F", "D", "A" }; static String[][] TEMPLATES = { { "@for@ arity=0..10 rcat<=4 nrefs<=99 nints=0 nlongs=0", @@ -347,13 +342,13 @@ class genclasses { " protected @cat@ makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)", " { return new @cat@(e, i, c, t); }", " //@each-R@", - " protected Object invoke_@catN@(@Tvav@) throws Throwable { return convert_@Rc@(invoker.<@R@>invokeExact(target@av@)); }", + " protected Object invoke_@catN@(@Tvav@) throws Throwable { return convert_@Rc@((@R@)@W@invoker.invokeExact(target@av@)); }", " //@end-R@", " }", } }; static final String NEWLINE_INDENT = "\n "; enum VAR { - cat, catN, R, Rc, av, Tvav, Ovav; + cat, catN, R, Rc, W, av, Tvav, Ovav; public final String pattern = "@"+toString().replace('_','.')+"@"; public String binding; static void makeBindings(boolean topLevel, int rcat, int nrefs, int nints, int nlongs) { @@ -363,6 +358,7 @@ class genclasses { VAR.catN.binding = catstr(rcat, nrefs, nints, nlongs); VAR.R.binding = TYPES[rcat]; VAR.Rc.binding = TCHARS[rcat]; + VAR.W.binding = WRAPS[rcat]; String[] Tv = new String[nargs]; String[] av = new String[nargs]; String[] Tvav = new String[nargs]; @@ -503,11 +499,11 @@ class genclasses { { super(e, i, c, t); } protected A0 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A0(e, i, c, t); } - protected Object invoke_L0() throws Throwable { return convert_L(invoker.invokeExact(target)); } - protected Object invoke_I0() throws Throwable { return convert_I(invoker.invokeExact(target)); } - protected Object invoke_J0() throws Throwable { return convert_J(invoker.invokeExact(target)); } - protected Object invoke_F0() throws Throwable { return convert_F(invoker.invokeExact(target)); } - protected Object invoke_D0() throws Throwable { return convert_D(invoker.invokeExact(target)); } + protected Object invoke_L0() throws Throwable { return convert_L((Object)invoker.invokeExact(target)); } + protected Object invoke_I0() throws Throwable { return convert_I((int) invoker.invokeExact(target)); } + protected Object invoke_J0() throws Throwable { return convert_J((long) invoker.invokeExact(target)); } + protected Object invoke_F0() throws Throwable { return convert_F((float) invoker.invokeExact(target)); } + protected Object invoke_D0() throws Throwable { return convert_D((double)invoker.invokeExact(target)); } } static class A1 extends Adapter { protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -515,11 +511,11 @@ class genclasses { { super(e, i, c, t); } protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A1(e, i, c, t); } - protected Object invoke_L1(Object a0) throws Throwable { return convert_L(invoker.invokeExact(target, a0)); } - protected Object invoke_I1(Object a0) throws Throwable { return convert_I(invoker.invokeExact(target, a0)); } - protected Object invoke_J1(Object a0) throws Throwable { return convert_J(invoker.invokeExact(target, a0)); } - protected Object invoke_F1(Object a0) throws Throwable { return convert_F(invoker.invokeExact(target, a0)); } - protected Object invoke_D1(Object a0) throws Throwable { return convert_D(invoker.invokeExact(target, a0)); } + protected Object invoke_L1(Object a0) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0)); } + protected Object invoke_I1(Object a0) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0)); } + protected Object invoke_J1(Object a0) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0)); } + protected Object invoke_F1(Object a0) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0)); } + protected Object invoke_D1(Object a0) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0)); } } static class A2 extends Adapter { protected A2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -527,11 +523,11 @@ class genclasses { { super(e, i, c, t); } protected A2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A2(e, i, c, t); } - protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L(invoker.invokeExact(target, a0, a1)); } - protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I(invoker.invokeExact(target, a0, a1)); } - protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J(invoker.invokeExact(target, a0, a1)); } - protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F(invoker.invokeExact(target, a0, a1)); } - protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D(invoker.invokeExact(target, a0, a1)); } + protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1)); } + protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1)); } + protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1)); } + protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1)); } + protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1)); } } static class A3 extends Adapter { protected A3(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -539,11 +535,11 @@ class genclasses { { super(e, i, c, t); } protected A3 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A3(e, i, c, t); } - protected Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { return convert_L(invoker.invokeExact(target, a0, a1, a2)); } - protected Object invoke_I3(Object a0, Object a1, Object a2) throws Throwable { return convert_I(invoker.invokeExact(target, a0, a1, a2)); } - protected Object invoke_J3(Object a0, Object a1, Object a2) throws Throwable { return convert_J(invoker.invokeExact(target, a0, a1, a2)); } - protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable { return convert_F(invoker.invokeExact(target, a0, a1, a2)); } - protected Object invoke_D3(Object a0, Object a1, Object a2) throws Throwable { return convert_D(invoker.invokeExact(target, a0, a1, a2)); } + protected Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2)); } + protected Object invoke_I3(Object a0, Object a1, Object a2) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2)); } + protected Object invoke_J3(Object a0, Object a1, Object a2) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2)); } + protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2)); } + protected Object invoke_D3(Object a0, Object a1, Object a2) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2)); } } static class A4 extends Adapter { protected A4(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -551,11 +547,11 @@ class genclasses { { super(e, i, c, t); } protected A4 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A4(e, i, c, t); } - protected Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_L(invoker.invokeExact(target, a0, a1, a2, a3)); } - protected Object invoke_I4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_I(invoker.invokeExact(target, a0, a1, a2, a3)); } - protected Object invoke_J4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_J(invoker.invokeExact(target, a0, a1, a2, a3)); } - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_F(invoker.invokeExact(target, a0, a1, a2, a3)); } - protected Object invoke_D4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_D(invoker.invokeExact(target, a0, a1, a2, a3)); } + protected Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3)); } + protected Object invoke_I4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3)); } + protected Object invoke_J4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3)); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3)); } + protected Object invoke_D4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3)); } } static class A5 extends Adapter { protected A5(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -563,11 +559,11 @@ class genclasses { { super(e, i, c, t); } protected A5 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A5(e, i, c, t); } - protected Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_L(invoker.invokeExact(target, a0, a1, a2, a3, a4)); } - protected Object invoke_I5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_I(invoker.invokeExact(target, a0, a1, a2, a3, a4)); } - protected Object invoke_J5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_J(invoker.invokeExact(target, a0, a1, a2, a3, a4)); } - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_F(invoker.invokeExact(target, a0, a1, a2, a3, a4)); } - protected Object invoke_D5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_D(invoker.invokeExact(target, a0, a1, a2, a3, a4)); } + protected Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4)); } + protected Object invoke_I5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4)); } + protected Object invoke_J5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4)); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4)); } + protected Object invoke_D5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4)); } } static class A6 extends Adapter { protected A6(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -575,11 +571,11 @@ class genclasses { { super(e, i, c, t); } protected A6 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A6(e, i, c, t); } - protected Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_L(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } - protected Object invoke_I6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_I(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } - protected Object invoke_J6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_J(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_F(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } - protected Object invoke_D6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_D(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } + protected Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } + protected Object invoke_I6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } + protected Object invoke_J6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } + protected Object invoke_D6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); } } static class A7 extends Adapter { protected A7(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -587,11 +583,11 @@ class genclasses { { super(e, i, c, t); } protected A7 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A7(e, i, c, t); } - protected Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_L(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_I7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_I(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_J7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_J(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_F(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_D7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_D(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } + protected Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } + protected Object invoke_I7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } + protected Object invoke_J7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } + protected Object invoke_D7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); } } static class A8 extends Adapter { protected A8(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -599,11 +595,11 @@ class genclasses { { super(e, i, c, t); } protected A8 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A8(e, i, c, t); } - protected Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_L(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_I8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_I(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_J8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_J(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_F(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_D8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_D(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } + protected Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } + protected Object invoke_I8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } + protected Object invoke_J8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } + protected Object invoke_D8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); } } static class A9 extends Adapter { protected A9(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -611,11 +607,11 @@ class genclasses { { super(e, i, c, t); } protected A9 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A9(e, i, c, t); } - protected Object invoke_L9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_L(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_I9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_I(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_J9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_J(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_F(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_D9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_D(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } + protected Object invoke_L9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } + protected Object invoke_I9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } + protected Object invoke_J9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } + protected Object invoke_D9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } } static class A10 extends Adapter { protected A10(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -623,10 +619,10 @@ class genclasses { { super(e, i, c, t); } protected A10 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A10(e, i, c, t); } - protected Object invoke_L10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_L(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_I10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_I(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_J10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_J(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_F(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_D10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_D(invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + protected Object invoke_L10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + protected Object invoke_I10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + protected Object invoke_J10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + protected Object invoke_D10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } } } diff --git a/jdk/src/share/classes/sun/dyn/InvokeGeneric.java b/jdk/src/share/classes/sun/dyn/InvokeGeneric.java new file mode 100644 index 00000000000..8137bb4a67a --- /dev/null +++ b/jdk/src/share/classes/sun/dyn/InvokeGeneric.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.dyn; + +import java.dyn.*; +import java.lang.reflect.*; +import sun.dyn.util.*; + +/** + * Adapters which manage MethodHanndle.invokeGeneric calls. + * The JVM calls one of these when the exact type match fails. + * @author jrose + */ +class InvokeGeneric { + // erased type for the call, which originates from an invokeGeneric site + private final MethodType erasedCallerType; + // an invoker of type (MT, MH; A...) -> R + private final MethodHandle initialInvoker; + + /** Compute and cache information for this adapter, so that it can + * call out to targets of the erasure-family of the given erased type. + */ + private InvokeGeneric(MethodType erasedCallerType) throws NoAccessException { + this.erasedCallerType = erasedCallerType; + this.initialInvoker = makeInitialInvoker(); + assert initialInvoker.type().equals(erasedCallerType + .insertParameterTypes(0, MethodType.class, MethodHandle.class)) + : initialInvoker.type(); + } + + private static MethodHandles.Lookup lookup() { + return MethodHandleImpl.IMPL_LOOKUP; + } + + /** Return the adapter information for this type's erasure. */ + static MethodHandle genericInvokerOf(MethodType type) { + MethodTypeImpl form = MethodTypeImpl.of(type); + MethodHandle genericInvoker = form.genericInvoker; + if (genericInvoker == null) { + try { + InvokeGeneric gen = new InvokeGeneric(form.erasedType()); + form.genericInvoker = genericInvoker = gen.initialInvoker; + } catch (NoAccessException ex) { + throw new RuntimeException(ex); + } + } + return genericInvoker; + } + + private MethodHandle makeInitialInvoker() throws NoAccessException { + // postDispatch = #(MH'; MT, MH; A...){MH'(MT, MH; A)} + MethodHandle postDispatch = makePostDispatchInvoker(); + MethodHandle invoker; + if (returnConversionPossible()) { + invoker = MethodHandles.foldArguments(postDispatch, + dispatcher("dispatchWithConversion")); + } else { + invoker = MethodHandles.foldArguments(postDispatch, dispatcher("dispatch")); + } + return invoker; + } + + private static final Class[] EXTRA_ARGS = { MethodType.class, MethodHandle.class }; + private MethodHandle makePostDispatchInvoker() { + // Take (MH'; MT, MH; A...) and run MH'(MT, MH; A...). + MethodType invokerType = erasedCallerType.insertParameterTypes(0, EXTRA_ARGS); + return MethodHandles.exactInvoker(invokerType); + } + private MethodHandle dropDispatchArguments(MethodHandle targetInvoker) { + assert(targetInvoker.type().parameterType(0) == MethodHandle.class); + return MethodHandles.dropArguments(targetInvoker, 1, EXTRA_ARGS); + } + + private MethodHandle dispatcher(String dispatchName) throws NoAccessException { + return lookup().bind(this, dispatchName, + MethodType.methodType(MethodHandle.class, + MethodType.class, MethodHandle.class)); + } + + static final boolean USE_AS_TYPE_PATH = true; + + /** Return a method handle to invoke on the callerType, target, and remaining arguments. + * The method handle must finish the call. + * This is the first look at the caller type and target. + */ + private MethodHandle dispatch(MethodType callerType, MethodHandle target) { + MethodType targetType = target.type(); + if (USE_AS_TYPE_PATH || target instanceof AdapterMethodHandle.WithTypeHandler) { + MethodHandle newTarget = target.asType(callerType); + targetType = callerType; + Invokers invokers = MethodTypeImpl.invokers(Access.TOKEN, targetType); + MethodHandle invoker = invokers.erasedInvokerWithDrops; + if (invoker == null) { + invokers.erasedInvokerWithDrops = invoker = + dropDispatchArguments(invokers.erasedInvoker()); + } + return invoker.bindTo(newTarget); + } + throw new RuntimeException("NYI"); + } + + private MethodHandle dispatchWithConversion(MethodType callerType, MethodHandle target) { + MethodHandle finisher = dispatch(callerType, target); + if (returnConversionNeeded(callerType, target)) + finisher = addReturnConversion(finisher, callerType.returnType()); //FIXME: slow + return finisher; + } + + private boolean returnConversionPossible() { + Class needType = erasedCallerType.returnType(); + return !needType.isPrimitive(); + } + private boolean returnConversionNeeded(MethodType callerType, MethodHandle target) { + Class needType = callerType.returnType(); + if (needType == erasedCallerType.returnType()) + return false; // no conversions possible, since must be primitive or Object + Class haveType = target.type().returnType(); + if (VerifyType.isNullConversion(haveType, needType)) + return false; + return true; + } + private MethodHandle addReturnConversion(MethodHandle target, Class type) { + if (true) throw new RuntimeException("NYI"); + // FIXME: This is slow because it creates a closure node on every call that requires a return cast. + MethodType targetType = target.type(); + MethodHandle caster = ValueConversions.identity(type); + caster = caster.asType(MethodType.methodType(type, targetType.returnType())); + // Drop irrelevant arguments, because we only care about the return value: + caster = MethodHandles.dropArguments(caster, 1, targetType.parameterList()); + MethodHandle result = MethodHandles.foldArguments(caster, target); + return result.asType(target.type()); + } + + public String toString() { + return "InvokeGeneric"+erasedCallerType; + } +} diff --git a/jdk/src/share/classes/sun/dyn/Invokers.java b/jdk/src/share/classes/sun/dyn/Invokers.java index 6af2ac6b171..35a8d2e4b55 100644 --- a/jdk/src/share/classes/sun/dyn/Invokers.java +++ b/jdk/src/share/classes/sun/dyn/Invokers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,8 @@ package sun.dyn; -import java.dyn.MethodHandle; -import java.dyn.MethodHandles; -import java.dyn.MethodType; - +import java.dyn.*; +import sun.dyn.empty.Empty; /** * Construction and caching of often-used invokers. @@ -41,12 +39,19 @@ public class Invokers { // exact invoker for the outgoing call private /*lazy*/ MethodHandle exactInvoker; + // erased (partially untyped but with primitives) invoker for the outgoing call + private /*lazy*/ MethodHandle erasedInvoker; + /*lazy*/ MethodHandle erasedInvokerWithDrops; // for InvokeGeneric + // generic (untyped) invoker for the outgoing call private /*lazy*/ MethodHandle genericInvoker; // generic (untyped) invoker for the outgoing call; accepts a single Object[] private final /*lazy*/ MethodHandle[] varargsInvokers; + // invoker for an unbound callsite + private /*lazy*/ MethodHandle uninitializedCallSite; + /** Compute and cache information common to all collecting adapters * that implement members of the erasure-family of the given erased type. */ @@ -63,8 +68,11 @@ public class Invokers { public MethodHandle exactInvoker() { MethodHandle invoker = exactInvoker; if (invoker != null) return invoker; - invoker = MethodHandleImpl.IMPL_LOOKUP.findVirtual(MethodHandle.class, "invoke", targetType); - if (invoker == null) throw new InternalError("JVM cannot find invoker for "+targetType); + try { + invoker = MethodHandleImpl.IMPL_LOOKUP.findVirtual(MethodHandle.class, "invoke", targetType); + } catch (NoAccessException ex) { + throw new InternalError("JVM cannot find invoker for "+targetType); + } assert(invokerType(targetType) == invoker.type()); exactInvoker = invoker; return invoker; @@ -80,6 +88,19 @@ public class Invokers { return invoker; } + public MethodHandle erasedInvoker() { + MethodHandle invoker1 = exactInvoker(); + MethodHandle invoker = erasedInvoker; + if (invoker != null) return invoker; + MethodType erasedType = targetType.erase(); + if (erasedType == targetType.generic()) + invoker = genericInvoker(); + else + invoker = MethodHandles.convertArguments(invoker1, invokerType(erasedType)); + erasedInvoker = invoker; + return invoker; + } + public MethodHandle varargsInvoker(int objectArgCount) { MethodHandle vaInvoker = varargsInvokers[objectArgCount]; if (vaInvoker != null) return vaInvoker; @@ -90,6 +111,35 @@ public class Invokers { return vaInvoker; } + private static MethodHandle THROW_UCS = null; + + public MethodHandle uninitializedCallSite() { + MethodHandle invoker = uninitializedCallSite; + if (invoker != null) return invoker; + if (targetType.parameterCount() > 0) { + MethodType type0 = targetType.dropParameterTypes(0, targetType.parameterCount()); + Invokers invokers0 = MethodTypeImpl.invokers(Access.TOKEN, type0); + invoker = MethodHandles.dropArguments(invokers0.uninitializedCallSite(), + 0, targetType.parameterList()); + assert(invoker.type().equals(targetType)); + uninitializedCallSite = invoker; + return invoker; + } + if (THROW_UCS == null) { + try { + THROW_UCS = MethodHandleImpl.IMPL_LOOKUP + .findStatic(CallSite.class, "uninitializedCallSite", + MethodType.methodType(Empty.class)); + } catch (NoAccessException ex) { + throw new RuntimeException(ex); + } + } + invoker = AdapterMethodHandle.makeRetypeRaw(Access.TOKEN, targetType, THROW_UCS); + assert(invoker.type().equals(targetType)); + uninitializedCallSite = invoker; + return invoker; + } + public String toString() { return "Invokers"+targetType; } diff --git a/jdk/src/share/classes/sun/dyn/MemberName.java b/jdk/src/share/classes/sun/dyn/MemberName.java index db21f2b4121..f45d1603ebf 100644 --- a/jdk/src/share/classes/sun/dyn/MemberName.java +++ b/jdk/src/share/classes/sun/dyn/MemberName.java @@ -521,6 +521,11 @@ public final class MemberName implements Member, Cloneable { if (lookupClass != null) message += ", from " + lookupClass.getName(); return new NoAccessException(message); } + public static Error uncaughtException(Exception ex) { + Error err = new InternalError("uncaught exception"); + err.initCause(ex); + return err; + } /** Actually making a query requires an access check. */ public static Factory getFactory(Access token) { @@ -641,7 +646,7 @@ public final class MemberName implements Member, Cloneable { * If lookup fails or access is not permitted, a {@linkplain NoAccessException} is thrown. * Otherwise a fresh copy of the given member is returned, with modifier bits filled in. */ - public MemberName resolveOrFail(MemberName m, boolean searchSupers, Class lookupClass) { + public MemberName resolveOrFail(MemberName m, boolean searchSupers, Class lookupClass) throws NoAccessException { MemberName result = resolveOrNull(m, searchSupers, lookupClass); if (result != null) return result; diff --git a/jdk/src/share/classes/sun/dyn/MethodHandleImpl.java b/jdk/src/share/classes/sun/dyn/MethodHandleImpl.java index 25dc470d061..24f7aae73a9 100644 --- a/jdk/src/share/classes/sun/dyn/MethodHandleImpl.java +++ b/jdk/src/share/classes/sun/dyn/MethodHandleImpl.java @@ -25,11 +25,8 @@ package sun.dyn; -import java.dyn.JavaMethodHandle; -import java.dyn.MethodHandle; -import java.dyn.MethodHandles; +import java.dyn.*; import java.dyn.MethodHandles.Lookup; -import java.dyn.MethodType; import java.util.logging.Level; import java.util.logging.Logger; import sun.dyn.util.VerifyType; @@ -46,6 +43,7 @@ import sun.dyn.util.Wrapper; import sun.misc.Unsafe; import static sun.dyn.MemberName.newIllegalArgumentException; import static sun.dyn.MemberName.newNoAccessException; +import static sun.dyn.MemberName.uncaughtException; /** * Base class for method handles, containing JVM-specific fields and logic. @@ -173,7 +171,7 @@ public abstract class MethodHandleImpl { */ public static MethodHandle findMethod(Access token, MemberName method, - boolean doDispatch, Class lookupClass) { + boolean doDispatch, Class lookupClass) throws NoAccessException { Access.check(token); // only trusted calls MethodType mtype = method.getMethodType(); if (!method.isStatic()) { @@ -201,7 +199,7 @@ public abstract class MethodHandleImpl { return allocator; } - static final class AllocateObject extends JavaMethodHandle { + static final class AllocateObject extends BoundMethodHandle { private static final Unsafe unsafe = Unsafe.getUnsafe(); private final Class allocateClass; @@ -209,7 +207,7 @@ public abstract class MethodHandleImpl { private AllocateObject(MethodHandle invoker, Class allocateClass, MethodHandle rawConstructor) { - super(invoker); + super(Access.TOKEN, invoker); this.allocateClass = allocateClass; this.rawConstructor = rawConstructor; } @@ -239,7 +237,7 @@ public abstract class MethodHandleImpl { } @Override public String toString() { - return allocateClass.getSimpleName(); + return addTypeString(allocateClass.getSimpleName(), this); } @SuppressWarnings("unchecked") private C allocate() throws InstantiationException { @@ -247,52 +245,52 @@ public abstract class MethodHandleImpl { } private C invoke_V(Object... av) throws Throwable { C obj = allocate(); - rawConstructor.invokeExact((Object)obj, av); + rawConstructor.invokeExact((Object)obj, av); return obj; } private C invoke_L0() throws Throwable { C obj = allocate(); - rawConstructor.invokeExact((Object)obj); + rawConstructor.invokeExact((Object)obj); return obj; } private C invoke_L1(Object a0) throws Throwable { C obj = allocate(); - rawConstructor.invokeExact((Object)obj, a0); + rawConstructor.invokeExact((Object)obj, a0); return obj; } private C invoke_L2(Object a0, Object a1) throws Throwable { C obj = allocate(); - rawConstructor.invokeExact((Object)obj, a0, a1); + rawConstructor.invokeExact((Object)obj, a0, a1); return obj; } private C invoke_L3(Object a0, Object a1, Object a2) throws Throwable { C obj = allocate(); - rawConstructor.invokeExact((Object)obj, a0, a1, a2); + rawConstructor.invokeExact((Object)obj, a0, a1, a2); return obj; } private C invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { C obj = allocate(); - rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3); + rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3); return obj; } private C invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { C obj = allocate(); - rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4); + rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4); return obj; } private C invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { C obj = allocate(); - rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5); + rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5); return obj; } private C invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { C obj = allocate(); - rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5, a6); + rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5, a6); return obj; } private C invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { C obj = allocate(); - rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5, a6, a7); + rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5, a6, a7); return obj; } static MethodHandle[] makeInvokes() { @@ -320,7 +318,7 @@ public abstract class MethodHandleImpl { try { VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(AllocateObject.class, "invoke_V", MethodType.genericMethodType(0, true)); } catch (NoAccessException ex) { - throw new InternalError(""); + throw uncaughtException(ex); } } // Corresponding generic constructor types: @@ -371,19 +369,19 @@ public abstract class MethodHandleImpl { return mhs[isSetter ? 1 : 0]; } - static final class FieldAccessor extends JavaMethodHandle { + static final class FieldAccessor extends BoundMethodHandle { private static final Unsafe unsafe = Unsafe.getUnsafe(); final Object base; // for static refs only final long offset; final String name; public FieldAccessor(Access token, MemberName field, boolean isSetter) { - super(fhandle(field.getDeclaringClass(), field.getFieldType(), isSetter, field.isStatic())); + super(Access.TOKEN, fhandle(field.getDeclaringClass(), field.getFieldType(), isSetter, field.isStatic())); this.offset = (long) field.getVMIndex(token); this.name = field.getName(); this.base = staticBase(field); } - public String toString() { return name; } + public String toString() { return addTypeString(name, this); } int getFieldI(C obj) { return unsafe.getInt(obj, offset); } void setFieldI(C obj, int x) { unsafe.putInt(obj, offset, x); } @@ -416,9 +414,7 @@ public abstract class MethodHandleImpl { f = c.getDeclaredField(field.getName()); return unsafe.staticFieldBase(f); } catch (Exception ee) { - Error e = new InternalError(); - e.initCause(ee); - throw e; + throw uncaughtException(ee); } } @@ -473,10 +469,8 @@ public abstract class MethodHandleImpl { MethodHandle mh; try { mh = IMPL_LOOKUP.findVirtual(FieldAccessor.class, name, type); - } catch (NoAccessException ee) { - Error e = new InternalError("name,type="+name+type); - e.initCause(ee); - throw e; + } catch (NoAccessException ex) { + throw uncaughtException(ex); } if (evclass != vclass || (!isStatic && ecclass != cclass)) { MethodType strongType = FieldAccessor.ftype(cclass, vclass, isSetter, isStatic); @@ -543,10 +537,8 @@ public abstract class MethodHandleImpl { MethodHandle mh; try { mh = IMPL_LOOKUP.findStatic(FieldAccessor.class, name, type); - } catch (NoAccessException ee) { - Error e = new InternalError("name,type="+name+type); - e.initCause(ee); - throw e; + } catch (NoAccessException ex) { + throw uncaughtException(ex); } if (caclass != null) { MethodType strongType = FieldAccessor.atype(caclass, isSetter); @@ -568,7 +560,9 @@ public abstract class MethodHandleImpl { MethodHandle bindReceiver(Access token, MethodHandle target, Object receiver) { Access.check(token); - if (target instanceof AdapterMethodHandle) { + if (target instanceof AdapterMethodHandle && + ((AdapterMethodHandle)target).conversionOp() == MethodHandleNatives.Constants.OP_RETYPE_ONLY + ) { Object info = MethodHandleNatives.getTargetInfo(target); if (info instanceof DirectMethodHandle) { DirectMethodHandle dmh = (DirectMethodHandle) info; @@ -916,11 +910,11 @@ public abstract class MethodHandleImpl { throw new UnsupportedOperationException("NYI"); } - private static class GuardWithTest extends JavaMethodHandle { + private static class GuardWithTest extends BoundMethodHandle { private final MethodHandle test, target, fallback; private GuardWithTest(MethodHandle invoker, MethodHandle test, MethodHandle target, MethodHandle fallback) { - super(invoker); + super(Access.TOKEN, invoker); this.test = test; this.target = target; this.fallback = fallback; @@ -954,57 +948,57 @@ public abstract class MethodHandleImpl { } @Override public String toString() { - return target.toString(); + return addTypeString(target, this); } private Object invoke_V(Object... av) throws Throwable { - if (test.invokeExact(av)) - return target.invokeExact(av); - return fallback.invokeExact(av); + if ((boolean) test.invokeExact(av)) + return target.invokeExact(av); + return fallback.invokeExact(av); } private Object invoke_L0() throws Throwable { - if (test.invokeExact()) - return target.invokeExact(); - return fallback.invokeExact(); + if ((boolean) test.invokeExact()) + return target.invokeExact(); + return fallback.invokeExact(); } private Object invoke_L1(Object a0) throws Throwable { - if (test.invokeExact(a0)) - return target.invokeExact(a0); - return fallback.invokeExact(a0); + if ((boolean) test.invokeExact(a0)) + return target.invokeExact(a0); + return fallback.invokeExact(a0); } private Object invoke_L2(Object a0, Object a1) throws Throwable { - if (test.invokeExact(a0, a1)) - return target.invokeExact(a0, a1); - return fallback.invokeExact(a0, a1); + if ((boolean) test.invokeExact(a0, a1)) + return target.invokeExact(a0, a1); + return fallback.invokeExact(a0, a1); } private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { - if (test.invokeExact(a0, a1, a2)) - return target.invokeExact(a0, a1, a2); - return fallback.invokeExact(a0, a1, a2); + if ((boolean) test.invokeExact(a0, a1, a2)) + return target.invokeExact(a0, a1, a2); + return fallback.invokeExact(a0, a1, a2); } private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { - if (test.invokeExact(a0, a1, a2, a3)) - return target.invokeExact(a0, a1, a2, a3); - return fallback.invokeExact(a0, a1, a2, a3); + if ((boolean) test.invokeExact(a0, a1, a2, a3)) + return target.invokeExact(a0, a1, a2, a3); + return fallback.invokeExact(a0, a1, a2, a3); } private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { - if (test.invokeExact(a0, a1, a2, a3, a4)) - return target.invokeExact(a0, a1, a2, a3, a4); - return fallback.invokeExact(a0, a1, a2, a3, a4); + if ((boolean) test.invokeExact(a0, a1, a2, a3, a4)) + return target.invokeExact(a0, a1, a2, a3, a4); + return fallback.invokeExact(a0, a1, a2, a3, a4); } private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { - if (test.invokeExact(a0, a1, a2, a3, a4, a5)) - return target.invokeExact(a0, a1, a2, a3, a4, a5); - return fallback.invokeExact(a0, a1, a2, a3, a4, a5); + if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5)) + return target.invokeExact(a0, a1, a2, a3, a4, a5); + return fallback.invokeExact(a0, a1, a2, a3, a4, a5); } private Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { - if (test.invokeExact(a0, a1, a2, a3, a4, a5, a6)) - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6); - return fallback.invokeExact(a0, a1, a2, a3, a4, a5, a6); + if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5, a6)) + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6); + return fallback.invokeExact(a0, a1, a2, a3, a4, a5, a6); } private Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { - if (test.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7)) - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); - return fallback.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); + if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7)) + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); + return fallback.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); } static MethodHandle[] makeInvokes() { ArrayList invokes = new ArrayList(); @@ -1031,7 +1025,7 @@ public abstract class MethodHandleImpl { try { VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(GuardWithTest.class, "invoke_V", MethodType.genericMethodType(0, true)); } catch (NoAccessException ex) { - throw new InternalError(""); + throw uncaughtException(ex); } } } @@ -1044,7 +1038,7 @@ public abstract class MethodHandleImpl { return GuardWithTest.make(token, test, target, fallback); } - private static class GuardWithCatch extends JavaMethodHandle { + private static class GuardWithCatch extends BoundMethodHandle { private final MethodHandle target; private final Class exType; private final MethodHandle catcher; @@ -1053,93 +1047,93 @@ public abstract class MethodHandleImpl { } public GuardWithCatch(MethodHandle invoker, MethodHandle target, Class exType, MethodHandle catcher) { - super(invoker); + super(Access.TOKEN, invoker); this.target = target; this.exType = exType; this.catcher = catcher; } @Override public String toString() { - return target.toString(); + return addTypeString(target, this); } private Object invoke_V(Object... av) throws Throwable { try { - return target.invokeExact(av); + return target.invokeExact(av); } catch (Throwable t) { if (!exType.isInstance(t)) throw t; - return catcher.invokeExact(t, av); + return catcher.invokeExact(t, av); } } private Object invoke_L0() throws Throwable { try { - return target.invokeExact(); + return target.invokeExact(); } catch (Throwable t) { if (!exType.isInstance(t)) throw t; - return catcher.invokeExact(t); + return catcher.invokeExact(t); } } private Object invoke_L1(Object a0) throws Throwable { try { - return target.invokeExact(a0); + return target.invokeExact(a0); } catch (Throwable t) { if (!exType.isInstance(t)) throw t; - return catcher.invokeExact(t, a0); + return catcher.invokeExact(t, a0); } } private Object invoke_L2(Object a0, Object a1) throws Throwable { try { - return target.invokeExact(a0, a1); + return target.invokeExact(a0, a1); } catch (Throwable t) { if (!exType.isInstance(t)) throw t; - return catcher.invokeExact(t, a0, a1); + return catcher.invokeExact(t, a0, a1); } } private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { try { - return target.invokeExact(a0, a1, a2); + return target.invokeExact(a0, a1, a2); } catch (Throwable t) { if (!exType.isInstance(t)) throw t; - return catcher.invokeExact(t, a0, a1, a2); + return catcher.invokeExact(t, a0, a1, a2); } } private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { try { - return target.invokeExact(a0, a1, a2, a3); + return target.invokeExact(a0, a1, a2, a3); } catch (Throwable t) { if (!exType.isInstance(t)) throw t; - return catcher.invokeExact(t, a0, a1, a2, a3); + return catcher.invokeExact(t, a0, a1, a2, a3); } } private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { try { - return target.invokeExact(a0, a1, a2, a3, a4); + return target.invokeExact(a0, a1, a2, a3, a4); } catch (Throwable t) { if (!exType.isInstance(t)) throw t; - return catcher.invokeExact(t, a0, a1, a2, a3, a4); + return catcher.invokeExact(t, a0, a1, a2, a3, a4); } } private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { try { - return target.invokeExact(a0, a1, a2, a3, a4, a5); + return target.invokeExact(a0, a1, a2, a3, a4, a5); } catch (Throwable t) { if (!exType.isInstance(t)) throw t; - return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5); + return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5); } } private Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { try { - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6); + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6); } catch (Throwable t) { if (!exType.isInstance(t)) throw t; - return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5, a6); + return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5, a6); } } private Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { try { - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); } catch (Throwable t) { if (!exType.isInstance(t)) throw t; - return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5, a6, a7); + return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5, a6, a7); } } static MethodHandle[] makeInvokes() { @@ -1167,7 +1161,7 @@ public abstract class MethodHandleImpl { try { VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(GuardWithCatch.class, "invoke_V", MethodType.genericMethodType(0, true)); } catch (NoAccessException ex) { - throw new InternalError(""); + throw uncaughtException(ex); } } } @@ -1207,9 +1201,16 @@ public abstract class MethodHandleImpl { return AdapterMethodHandle.makeRetypeRaw(token, type, THROW_EXCEPTION); } - static final MethodHandle THROW_EXCEPTION + static final MethodHandle THROW_EXCEPTION; + static { + try { + THROW_EXCEPTION = IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "throwException", MethodType.methodType(Empty.class, Throwable.class)); + } catch (NoAccessException ex) { + throw new RuntimeException(ex); + } + } static Empty throwException(T t) throws T { throw t; } public static String getNameString(Access token, MethodHandle target) { @@ -1218,21 +1219,24 @@ public abstract class MethodHandleImpl { if (target != null) name = MethodHandleNatives.getMethodName(target); if (name == null) - return ""; - return name.getName(); + return "invoke" + target.type(); + return name.getName() + target.type(); } - public static String addTypeString(MethodHandle target) { - if (target == null) return "null"; - return target.toString() + target.type(); + static String addTypeString(Object obj, MethodHandle target) { + String str = String.valueOf(obj); + if (target == null) return str; + int paren = str.indexOf('('); + if (paren >= 0) str = str.substring(0, paren); + return str + target.type(); } - public static void checkSpreadArgument(Object av, int n) { + static void checkSpreadArgument(Object av, int n) { if (av == null ? n != 0 : ((Object[])av).length != n) throw newIllegalArgumentException("Array is not of length "+n); } - public static void raiseException(int code, Object actual, Object required) { + static void raiseException(int code, Object actual, Object required) { String message; // disregard the identity of the actual object, if it is not a class: if (!(actual instanceof Class) && !(actual instanceof MethodType)) @@ -1258,4 +1262,9 @@ public abstract class MethodHandleImpl { Access.check(token); return MethodHandleNatives.getBootstrap(callerClass); } + + public static MethodHandle withTypeHandler(Access token, MethodHandle target, MethodHandle typeHandler) { + Access.check(token); + return AdapterMethodHandle.makeTypeHandler(token, target, typeHandler); + } } diff --git a/jdk/src/share/classes/sun/dyn/MethodHandleNatives.java b/jdk/src/share/classes/sun/dyn/MethodHandleNatives.java index 84470c8a870..3d0629dd034 100644 --- a/jdk/src/share/classes/sun/dyn/MethodHandleNatives.java +++ b/jdk/src/share/classes/sun/dyn/MethodHandleNatives.java @@ -25,9 +25,7 @@ package sun.dyn; -import java.dyn.CallSite; -import java.dyn.MethodHandle; -import java.dyn.MethodType; +import java.dyn.*; import java.dyn.MethodHandles.Lookup; import java.lang.reflect.AccessibleObject; import java.lang.reflect.Field; @@ -318,24 +316,44 @@ class MethodHandleNatives { return MethodTypeImpl.makeImpl(Access.TOKEN, rtype, ptypes, true); } + /** + * The JVM wants to use a MethodType with invokeGeneric. Give the runtime fair warning. + */ + static void notifyGenericMethodType(MethodType type) { + try { + // Trigger adapter creation. + InvokeGeneric.genericInvokerOf(type); + } catch (Exception ex) { + Error err = new InternalError("Exception while resolving invokeGeneric"); + err.initCause(ex); + throw err; + } + } + /** * The JVM is resolving a CONSTANT_MethodHandle CP entry. And it wants our help. * It will make an up-call to this method. (Do not change the name or signature.) */ static MethodHandle linkMethodHandleConstant(Class callerClass, int refKind, Class defc, String name, Object type) { - Lookup lookup = IMPL_LOOKUP.in(callerClass); - switch (refKind) { - case REF_getField: return lookup.findGetter( defc, name, (Class) type ); - case REF_getStatic: return lookup.findStaticGetter( defc, name, (Class) type ); - case REF_putField: return lookup.findSetter( defc, name, (Class) type ); - case REF_putStatic: return lookup.findStaticSetter( defc, name, (Class) type ); - case REF_invokeVirtual: return lookup.findVirtual( defc, name, (MethodType) type ); - case REF_invokeStatic: return lookup.findStatic( defc, name, (MethodType) type ); - case REF_invokeSpecial: return lookup.findSpecial( defc, name, (MethodType) type, callerClass ); - case REF_newInvokeSpecial: return lookup.findConstructor( defc, (MethodType) type ); - case REF_invokeInterface: return lookup.findVirtual( defc, name, (MethodType) type ); + try { + Lookup lookup = IMPL_LOOKUP.in(callerClass); + switch (refKind) { + case REF_getField: return lookup.findGetter( defc, name, (Class) type ); + case REF_getStatic: return lookup.findStaticGetter( defc, name, (Class) type ); + case REF_putField: return lookup.findSetter( defc, name, (Class) type ); + case REF_putStatic: return lookup.findStaticSetter( defc, name, (Class) type ); + case REF_invokeVirtual: return lookup.findVirtual( defc, name, (MethodType) type ); + case REF_invokeStatic: return lookup.findStatic( defc, name, (MethodType) type ); + case REF_invokeSpecial: return lookup.findSpecial( defc, name, (MethodType) type, callerClass ); + case REF_newInvokeSpecial: return lookup.findConstructor( defc, (MethodType) type ); + case REF_invokeInterface: return lookup.findVirtual( defc, name, (MethodType) type ); + } + throw new IllegalArgumentException("bad MethodHandle constant "+name+" : "+type); + } catch (NoAccessException ex) { + Error err = new IncompatibleClassChangeError(); + err.initCause(ex); + throw err; } - throw new IllegalArgumentException("bad MethodHandle constant "+name+" : "+type); } } diff --git a/jdk/src/share/classes/sun/dyn/MethodTypeImpl.java b/jdk/src/share/classes/sun/dyn/MethodTypeImpl.java index 0a318148a73..62276dff3b0 100644 --- a/jdk/src/share/classes/sun/dyn/MethodTypeImpl.java +++ b/jdk/src/share/classes/sun/dyn/MethodTypeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class MethodTypeImpl { final long primCounts; // packed prim & double counts final int vmslots; // total number of parameter slots final MethodType erasedType; // the canonical erasure + /*lazy*/ MethodType primsAsBoxes; // replace prims by wrappers /*lazy*/ MethodType primArgsAsBoxes; // wrap args only; make raw return /*lazy*/ MethodType primsAsInts; // replace prims by int/long @@ -59,6 +60,7 @@ public class MethodTypeImpl { /*lazy*/ FromGeneric fromGeneric; // convert cs. w/o prims to with /*lazy*/ SpreadGeneric[] spreadGeneric; // expand one argument to many /*lazy*/ FilterGeneric filterGeneric; // convert argument(s) on the fly + /*lazy*/ MethodHandle genericInvoker; // hook for invokeGeneric public MethodType erasedType() { return erasedType; diff --git a/jdk/src/share/classes/sun/dyn/SpreadGeneric.java b/jdk/src/share/classes/sun/dyn/SpreadGeneric.java index e88611c3f2f..5a50e0195a1 100644 --- a/jdk/src/share/classes/sun/dyn/SpreadGeneric.java +++ b/jdk/src/share/classes/sun/dyn/SpreadGeneric.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +25,7 @@ package sun.dyn; -import java.dyn.JavaMethodHandle; -import java.dyn.MethodHandle; -import java.dyn.MethodHandles; -import java.dyn.MethodType; -import java.dyn.NoAccessException; +import java.dyn.*; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; @@ -212,7 +208,7 @@ class SpreadGeneric { * The invoker is kept separate from the target because it can be * generated once per type erasure family, and reused across adapters. */ - static abstract class Adapter extends JavaMethodHandle { + static abstract class Adapter extends BoundMethodHandle { /* * class X<> extends Adapter { * (Object**N)=>R target; @@ -225,21 +221,21 @@ class SpreadGeneric { @Override public String toString() { - return target.toString(); + return MethodHandleImpl.addTypeString(target, this); } static final MethodHandle NO_ENTRY = ValueConversions.identity(); protected boolean isPrototype() { return target == null; } protected Adapter(SpreadGeneric outer) { - super(NO_ENTRY); + super(Access.TOKEN, NO_ENTRY); this.outer = outer; this.target = null; assert(isPrototype()); } protected Adapter(SpreadGeneric outer, MethodHandle target) { - super(outer.entryPoint); + super(Access.TOKEN, outer.entryPoint); this.outer = outer; this.target = target; } @@ -281,12 +277,12 @@ class SpreadGeneric { protected xS2(SpreadGeneric outer, MethodHandle t) { super(outer, t); } protected xS2 makeInstance(SpreadGeneric outer, MethodHandle t) { return new xS2(outer, t); } protected Object invoke_S0(Object a0, Object a1, Object av) throws Throwable { av = super.check(av,0); - return target.invokeExact(a0, a1)); } + return target.invokeExact(a0, a1)); } protected Object invoke_S1(Object a0, Object av) throws Throwable { av = super.check(av,1); - return target.invokeExact(a0, + return target.invokeExact(a0, super.select(av,0)); } protected Object invoke_S2(Object a0, Object av) throws Throwable { av = super.check(av,1); - return target.invokeExact( + return target.invokeExact( super.select(av,0), super.select(av,1)); } } // */ @@ -304,10 +300,10 @@ class genclasses { " protected @cat@(SpreadGeneric outer, MethodHandle t) { super(outer, t); }", " protected @cat@ makeInstance(SpreadGeneric outer, MethodHandle t) { return new @cat@(outer, t); }", " protected Object invoke_S0(@Tvav,@Object av) throws Throwable { av = super.check(av, 0);", - " return target.invokeExact(@av@); }", + " return target.invokeExact(@av@); }", " //@each-S@", " protected Object invoke_S@S@(@Tvav,@Object av) throws Throwable { av = super.check(av, @S@);", - " return target.invokeExact(@av,@@sv@); }", + " return target.invokeExact(@av,@@sv@); }", " //@end-S@", " }", } }; @@ -418,16 +414,16 @@ class genclasses { protected S0(SpreadGeneric outer, MethodHandle t) { super(outer, t); } protected S0 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S0(outer, t); } protected Object invoke_S0(Object av) throws Throwable { av = super.check(av, 0); - return target.invokeExact(); } + return target.invokeExact(); } } static class S1 extends Adapter { protected S1(SpreadGeneric outer) { super(outer); } // to build prototype protected S1(SpreadGeneric outer, MethodHandle t) { super(outer, t); } protected S1 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S1(outer, t); } protected Object invoke_S0(Object a0, Object av) throws Throwable { av = super.check(av, 0); - return target.invokeExact(a0); } + return target.invokeExact(a0); } protected Object invoke_S1(Object av) throws Throwable { av = super.check(av, 1); - return target.invokeExact( + return target.invokeExact( super.select(av,0)); } } static class S2 extends Adapter { @@ -435,12 +431,12 @@ class genclasses { protected S2(SpreadGeneric outer, MethodHandle t) { super(outer, t); } protected S2 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S2(outer, t); } protected Object invoke_S0(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 0); - return target.invokeExact(a0, a1); } + return target.invokeExact(a0, a1); } protected Object invoke_S1(Object a0, Object av) throws Throwable { av = super.check(av, 1); - return target.invokeExact(a0, + return target.invokeExact(a0, super.select(av,0)); } protected Object invoke_S2(Object av) throws Throwable { av = super.check(av, 2); - return target.invokeExact( + return target.invokeExact( super.select(av,0), super.select(av,1)); } } static class S3 extends Adapter { @@ -448,15 +444,15 @@ class genclasses { protected S3(SpreadGeneric outer, MethodHandle t) { super(outer, t); } protected S3 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S3(outer, t); } protected Object invoke_S0(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 0); - return target.invokeExact(a0, a1, a2); } + return target.invokeExact(a0, a1, a2); } protected Object invoke_S1(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 1); - return target.invokeExact(a0, a1, + return target.invokeExact(a0, a1, super.select(av,0)); } protected Object invoke_S2(Object a0, Object av) throws Throwable { av = super.check(av, 2); - return target.invokeExact(a0, + return target.invokeExact(a0, super.select(av,0), super.select(av,1)); } protected Object invoke_S3(Object av) throws Throwable { av = super.check(av, 3); - return target.invokeExact( + return target.invokeExact( super.select(av,0), super.select(av,1), super.select(av,2)); } } static class S4 extends Adapter { @@ -464,18 +460,18 @@ class genclasses { protected S4(SpreadGeneric outer, MethodHandle t) { super(outer, t); } protected S4 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S4(outer, t); } protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 0); - return target.invokeExact(a0, a1, a2, a3); } + return target.invokeExact(a0, a1, a2, a3); } protected Object invoke_S1(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 1); - return target.invokeExact(a0, a1, a2, + return target.invokeExact(a0, a1, a2, super.select(av,0)); } protected Object invoke_S2(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 2); - return target.invokeExact(a0, a1, + return target.invokeExact(a0, a1, super.select(av,0), super.select(av,1)); } protected Object invoke_S3(Object a0, Object av) throws Throwable { av = super.check(av, 3); - return target.invokeExact(a0, + return target.invokeExact(a0, super.select(av,0), super.select(av,1), super.select(av,2)); } protected Object invoke_S4(Object av) throws Throwable { av = super.check(av, 4); - return target.invokeExact( + return target.invokeExact( super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } } static class S5 extends Adapter { @@ -483,21 +479,21 @@ class genclasses { protected S5(SpreadGeneric outer, MethodHandle t) { super(outer, t); } protected S5 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S5(outer, t); } protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 0); - return target.invokeExact(a0, a1, a2, a3, a4); } + return target.invokeExact(a0, a1, a2, a3, a4); } protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 1); - return target.invokeExact(a0, a1, a2, a3, + return target.invokeExact(a0, a1, a2, a3, super.select(av,0)); } protected Object invoke_S2(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 2); - return target.invokeExact(a0, a1, a2, + return target.invokeExact(a0, a1, a2, super.select(av,0), super.select(av,1)); } protected Object invoke_S3(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 3); - return target.invokeExact(a0, a1, + return target.invokeExact(a0, a1, super.select(av,0), super.select(av,1), super.select(av,2)); } protected Object invoke_S4(Object a0, Object av) throws Throwable { av = super.check(av, 4); - return target.invokeExact(a0, + return target.invokeExact(a0, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } protected Object invoke_S5(Object av) throws Throwable { av = super.check(av, 5); - return target.invokeExact( + return target.invokeExact( super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4)); } } @@ -506,25 +502,25 @@ class genclasses { protected S6(SpreadGeneric outer, MethodHandle t) { super(outer, t); } protected S6 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S6(outer, t); } protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 0); - return target.invokeExact(a0, a1, a2, a3, a4, a5); } + return target.invokeExact(a0, a1, a2, a3, a4, a5); } protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 1); - return target.invokeExact(a0, a1, a2, a3, a4, + return target.invokeExact(a0, a1, a2, a3, a4, super.select(av,0)); } protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 2); - return target.invokeExact(a0, a1, a2, a3, + return target.invokeExact(a0, a1, a2, a3, super.select(av,0), super.select(av,1)); } protected Object invoke_S3(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 3); - return target.invokeExact(a0, a1, a2, + return target.invokeExact(a0, a1, a2, super.select(av,0), super.select(av,1), super.select(av,2)); } protected Object invoke_S4(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 4); - return target.invokeExact(a0, a1, + return target.invokeExact(a0, a1, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } protected Object invoke_S5(Object a0, Object av) throws Throwable { av = super.check(av, 5); - return target.invokeExact(a0, + return target.invokeExact(a0, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4)); } protected Object invoke_S6(Object av) throws Throwable { av = super.check(av, 6); - return target.invokeExact( + return target.invokeExact( super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5)); } } @@ -533,29 +529,29 @@ class genclasses { protected S7(SpreadGeneric outer, MethodHandle t) { super(outer, t); } protected S7 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S7(outer, t); } protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 0); - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6); } + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6); } protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 1); - return target.invokeExact(a0, a1, a2, a3, a4, a5, + return target.invokeExact(a0, a1, a2, a3, a4, a5, super.select(av,0)); } protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 2); - return target.invokeExact(a0, a1, a2, a3, a4, + return target.invokeExact(a0, a1, a2, a3, a4, super.select(av,0), super.select(av,1)); } protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 3); - return target.invokeExact(a0, a1, a2, a3, + return target.invokeExact(a0, a1, a2, a3, super.select(av,0), super.select(av,1), super.select(av,2)); } protected Object invoke_S4(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 4); - return target.invokeExact(a0, a1, a2, + return target.invokeExact(a0, a1, a2, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } protected Object invoke_S5(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 5); - return target.invokeExact(a0, a1, + return target.invokeExact(a0, a1, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4)); } protected Object invoke_S6(Object a0, Object av) throws Throwable { av = super.check(av, 6); - return target.invokeExact(a0, + return target.invokeExact(a0, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5)); } protected Object invoke_S7(Object av) throws Throwable { av = super.check(av, 7); - return target.invokeExact( + return target.invokeExact( super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5), super.select(av,6)); } } @@ -564,33 +560,33 @@ class genclasses { protected S8(SpreadGeneric outer, MethodHandle t) { super(outer, t); } protected S8 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S8(outer, t); } protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object av) throws Throwable { av = super.check(av, 0); - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); } + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); } protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 1); - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, super.select(av,0)); } protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 2); - return target.invokeExact(a0, a1, a2, a3, a4, a5, + return target.invokeExact(a0, a1, a2, a3, a4, a5, super.select(av,0), super.select(av,1)); } protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 3); - return target.invokeExact(a0, a1, a2, a3, a4, + return target.invokeExact(a0, a1, a2, a3, a4, super.select(av,0), super.select(av,1), super.select(av,2)); } protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 4); - return target.invokeExact(a0, a1, a2, a3, + return target.invokeExact(a0, a1, a2, a3, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } protected Object invoke_S5(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 5); - return target.invokeExact(a0, a1, a2, + return target.invokeExact(a0, a1, a2, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4)); } protected Object invoke_S6(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 6); - return target.invokeExact(a0, a1, + return target.invokeExact(a0, a1, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5)); } protected Object invoke_S7(Object a0, Object av) throws Throwable { av = super.check(av, 7); - return target.invokeExact(a0, + return target.invokeExact(a0, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5), super.select(av,6)); } protected Object invoke_S8(Object av) throws Throwable { av = super.check(av, 8); - return target.invokeExact( + return target.invokeExact( super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); } } @@ -599,37 +595,37 @@ class genclasses { protected S9(SpreadGeneric outer, MethodHandle t) { super(outer, t); } protected S9 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S9(outer, t); } protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object av) throws Throwable { av = super.check(av, 0); - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8); } + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8); } protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object av) throws Throwable { av = super.check(av, 1); - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, super.select(av,0)); } protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 2); - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, super.select(av,0), super.select(av,1)); } protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 3); - return target.invokeExact(a0, a1, a2, a3, a4, a5, + return target.invokeExact(a0, a1, a2, a3, a4, a5, super.select(av,0), super.select(av,1), super.select(av,2)); } protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 4); - return target.invokeExact(a0, a1, a2, a3, a4, + return target.invokeExact(a0, a1, a2, a3, a4, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } protected Object invoke_S5(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 5); - return target.invokeExact(a0, a1, a2, a3, + return target.invokeExact(a0, a1, a2, a3, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4)); } protected Object invoke_S6(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 6); - return target.invokeExact(a0, a1, a2, + return target.invokeExact(a0, a1, a2, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5)); } protected Object invoke_S7(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 7); - return target.invokeExact(a0, a1, + return target.invokeExact(a0, a1, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5), super.select(av,6)); } protected Object invoke_S8(Object a0, Object av) throws Throwable { av = super.check(av, 8); - return target.invokeExact(a0, + return target.invokeExact(a0, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); } protected Object invoke_S9(Object av) throws Throwable { av = super.check(av, 9); - return target.invokeExact( + return target.invokeExact( super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7), super.select(av,8)); } @@ -639,42 +635,42 @@ class genclasses { protected S10(SpreadGeneric outer, MethodHandle t) { super(outer, t); } protected S10 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S10(outer, t); } protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9, Object av) throws Throwable { av = super.check(av, 0); - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object av) throws Throwable { av = super.check(av, 1); - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, super.select(av,0)); } protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object av) throws Throwable { av = super.check(av, 2); - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, super.select(av,0), super.select(av,1)); } protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 3); - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, super.select(av,0), super.select(av,1), super.select(av,2)); } protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 4); - return target.invokeExact(a0, a1, a2, a3, a4, a5, + return target.invokeExact(a0, a1, a2, a3, a4, a5, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } protected Object invoke_S5(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 5); - return target.invokeExact(a0, a1, a2, a3, a4, + return target.invokeExact(a0, a1, a2, a3, a4, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4)); } protected Object invoke_S6(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 6); - return target.invokeExact(a0, a1, a2, a3, + return target.invokeExact(a0, a1, a2, a3, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5)); } protected Object invoke_S7(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 7); - return target.invokeExact(a0, a1, a2, + return target.invokeExact(a0, a1, a2, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5), super.select(av,6)); } protected Object invoke_S8(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 8); - return target.invokeExact(a0, a1, + return target.invokeExact(a0, a1, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); } protected Object invoke_S9(Object a0, Object av) throws Throwable { av = super.check(av, 9); - return target.invokeExact(a0, + return target.invokeExact(a0, super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7), super.select(av,8)); } protected Object invoke_S10(Object av) throws Throwable { av = super.check(av, 10); - return target.invokeExact( + return target.invokeExact( super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7), super.select(av,8), super.select(av,9)); } diff --git a/jdk/src/share/classes/sun/dyn/ToGeneric.java b/jdk/src/share/classes/sun/dyn/ToGeneric.java index eaaa89bfa9b..40ac10faf07 100644 --- a/jdk/src/share/classes/sun/dyn/ToGeneric.java +++ b/jdk/src/share/classes/sun/dyn/ToGeneric.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +25,7 @@ package sun.dyn; -import java.dyn.JavaMethodHandle; -import java.dyn.MethodHandle; -import java.dyn.MethodHandles; -import java.dyn.MethodType; -import java.dyn.NoAccessException; +import java.dyn.*; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import sun.dyn.util.ValueConversions; @@ -327,7 +323,7 @@ class ToGeneric { * via another method handle {@code convert}, which is responsible for * converting the object result into the raw return value. */ - static abstract class Adapter extends JavaMethodHandle { + static abstract class Adapter extends BoundMethodHandle { /* * class X<> extends Adapter { * Object...=>Object target; @@ -341,13 +337,13 @@ class ToGeneric { @Override public String toString() { - return target == null ? "prototype:"+convert : target.toString(); + return target == null ? "prototype:"+convert : MethodHandleImpl.addTypeString(target, this); } protected boolean isPrototype() { return target == null; } /* Prototype constructor. */ protected Adapter(MethodHandle entryPoint) { - super(entryPoint); + super(Access.TOKEN, entryPoint); this.invoker = null; this.convert = entryPoint; this.target = null; @@ -359,7 +355,7 @@ class ToGeneric { } protected Adapter(MethodHandle entryPoint, MethodHandle invoker, MethodHandle convert, MethodHandle target) { - super(entryPoint); + super(Access.TOKEN, entryPoint); this.invoker = invoker; this.convert = convert; this.target = target; @@ -371,33 +367,33 @@ class ToGeneric { // { return new ThisType(entryPoint, convert, target); } // Code to run when the arguments (<= 4) have all been boxed. - protected Object target() throws Throwable { return invoker.invokeExact(target); } - protected Object target(Object a0) throws Throwable { return invoker.invokeExact(target, a0); } + protected Object target() throws Throwable { return invoker.invokeExact(target); } + protected Object target(Object a0) throws Throwable { return invoker.invokeExact(target, a0); } protected Object target(Object a0, Object a1) - throws Throwable { return invoker.invokeExact(target, a0, a1); } + throws Throwable { return invoker.invokeExact(target, a0, a1); } protected Object target(Object a0, Object a1, Object a2) - throws Throwable { return invoker.invokeExact(target, a0, a1, a2); } + throws Throwable { return invoker.invokeExact(target, a0, a1, a2); } protected Object target(Object a0, Object a1, Object a2, Object a3) - throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3); } + throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3); } /* - protected Object target_0(Object... av) throws Throwable { return invoker.invokeExact(target, av); } + protected Object target_0(Object... av) throws Throwable { return invoker.invokeExact(target, av); } protected Object target_1(Object a0, Object... av) - throws Throwable { return invoker.invokeExact(target, a0, (Object)av); } + throws Throwable { return invoker.invokeExact(target, a0, (Object)av); } protected Object target_2(Object a0, Object a1, Object... av) - throws Throwable { return invoker.invokeExact(target, a0, a1, (Object)av); } + throws Throwable { return invoker.invokeExact(target, a0, a1, (Object)av); } protected Object target_3(Object a0, Object a1, Object a2, Object... av) - throws Throwable { return invoker.invokeExact(target, a0, a1, a2, (Object)av); } + throws Throwable { return invoker.invokeExact(target, a0, a1, a2, (Object)av); } protected Object target_4(Object a0, Object a1, Object a2, Object a3, Object... av) - throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, (Object)av); } + throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, (Object)av); } // */ // (For more than 4 arguments, generate the code in the adapter itself.) // Code to run when the generic target has finished and produced a value. - protected Object return_L(Object res) throws Throwable { return convert.invokeExact(res); } - protected int return_I(Object res) throws Throwable { return convert.invokeExact(res); } - protected long return_J(Object res) throws Throwable { return convert.invokeExact(res); } - protected float return_F(Object res) throws Throwable { return convert.invokeExact(res); } - protected double return_D(Object res) throws Throwable { return convert.invokeExact(res); } + protected Object return_L(Object res) throws Throwable { return (Object)convert.invokeExact(res); } + protected int return_I(Object res) throws Throwable { return (int) convert.invokeExact(res); } + protected long return_J(Object res) throws Throwable { return (long) convert.invokeExact(res); } + protected float return_F(Object res) throws Throwable { return (float) convert.invokeExact(res); } + protected double return_D(Object res) throws Throwable { return (double)convert.invokeExact(res); } static private final String CLASS_PREFIX; // "sun.dyn.ToGeneric$" static { @@ -424,7 +420,7 @@ class ToGeneric { protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A1(e, i, c, t); } - protected Object target(Object a0) throws Throwable { return invoker.invokeExact(target, a0); } + protected Object target(Object a0) throws Throwable { return invoker.invokeExact(target, a0); } protected Object targetA1(Object a0) throws Throwable { return target(a0); } protected Object targetA1(int a0) throws Throwable { return target(a0); } protected Object targetA1(long a0) throws Throwable { return target(a0); } @@ -462,7 +458,7 @@ class genclasses { " protected @cat@(MethodHandle entryPoint) { super(entryPoint); } // to build prototype", " protected @cat@(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }", " protected @cat@ makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new @cat@(e, i, c, t); }", - " protected Object target(@Ovav@) throws Throwable { return invoker.invokeExact(target, @av@); }", + " protected Object target(@Ovav@) throws Throwable { return invoker.invokeExact(target, @av@); }", " //@each-Tv@", " protected Object target@cat@(@Tvav@) throws Throwable { return target(@av@); }", " //@end-Tv@", @@ -622,7 +618,7 @@ class genclasses { protected A0(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A0(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A0 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A0(e, i, c, t); } - protected Object target() throws Throwable { return invoker.invokeExact(target); } + protected Object target() throws Throwable { return invoker.invokeExact(target); } protected Object targetA0() throws Throwable { return target(); } protected Object invoke_L() throws Throwable { return return_L(targetA0()); } protected int invoke_I() throws Throwable { return return_I(targetA0()); } @@ -634,7 +630,7 @@ class genclasses { protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A1(e, i, c, t); } - protected Object target(Object a0) throws Throwable { return invoker.invokeExact(target, a0); } + protected Object target(Object a0) throws Throwable { return invoker.invokeExact(target, a0); } protected Object targetA1(Object a0) throws Throwable { return target(a0); } protected Object targetA1(int a0) throws Throwable { return target(a0); } protected Object targetA1(long a0) throws Throwable { return target(a0); } @@ -658,7 +654,7 @@ class genclasses { protected A2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A2(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A2(e, i, c, t); } - protected Object target(Object a0, Object a1) throws Throwable { return invoker.invokeExact(target, a0, a1); } + protected Object target(Object a0, Object a1) throws Throwable { return invoker.invokeExact(target, a0, a1); } protected Object targetA2(Object a0, Object a1) throws Throwable { return target(a0, a1); } protected Object targetA2(Object a0, int a1) throws Throwable { return target(a0, a1); } protected Object targetA2(int a0, int a1) throws Throwable { return target(a0, a1); } @@ -694,7 +690,7 @@ class genclasses { protected A3(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A3(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A3 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A3(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2) throws Throwable { return invoker.invokeExact(target, a0, a1, a2); } + protected Object target(Object a0, Object a1, Object a2) throws Throwable { return invoker.invokeExact(target, a0, a1, a2); } protected Object targetA3(Object a0, Object a1, Object a2) throws Throwable { return target(a0, a1, a2); } protected Object targetA3(Object a0, Object a1, int a2) throws Throwable { return target(a0, a1, a2); } protected Object targetA3(Object a0, int a1, int a2) throws Throwable { return target(a0, a1, a2); } @@ -743,7 +739,7 @@ class genclasses { protected A4(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A4(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A4 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A4(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3); } + protected Object target(Object a0, Object a1, Object a2, Object a3) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3); } protected Object targetA4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return target(a0, a1, a2, a3); } protected Object targetA4(Object a0, Object a1, Object a2, int a3) throws Throwable { return target(a0, a1, a2, a3); } protected Object targetA4(Object a0, Object a1, int a2, int a3) throws Throwable { return target(a0, a1, a2, a3); } @@ -785,7 +781,7 @@ class genclasses { protected A5(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A5(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A5 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A5(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4); } + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4); } protected Object targetA5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return target(a0, a1, a2, a3, a4); } protected Object targetA5(Object a0, Object a1, Object a2, Object a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); } protected Object targetA5(Object a0, Object a1, Object a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); } @@ -836,7 +832,7 @@ class genclasses { protected A6(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A6(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A6 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A6(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5); } + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5); } protected Object targetA6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); } protected Object targetA6(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); } protected Object targetA6(Object a0, Object a1, Object a2, Object a3, long a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); } @@ -870,7 +866,7 @@ class genclasses { protected A7(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A7(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A7 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A7(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6); } + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6); } protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); } protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); } protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); } @@ -908,7 +904,7 @@ class genclasses { protected A8(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A8(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A8 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A8(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7); } + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7); } protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); } protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); } protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); } @@ -950,7 +946,7 @@ class genclasses { protected A9(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A9(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A9 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A9(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8); } + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8); } protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } @@ -996,7 +992,7 @@ class genclasses { protected A10(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A10(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A10 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A10(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } diff --git a/jdk/src/share/classes/sun/dyn/empty/Empty.java b/jdk/src/share/classes/sun/dyn/empty/Empty.java index ce6b4bcddd1..416a6f128e8 100644 --- a/jdk/src/share/classes/sun/dyn/empty/Empty.java +++ b/jdk/src/share/classes/sun/dyn/empty/Empty.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/dyn/package-info.java b/jdk/src/share/classes/sun/dyn/package-info.java index f7fe3cfa435..d129b0f5a27 100644 --- a/jdk/src/share/classes/sun/dyn/package-info.java +++ b/jdk/src/share/classes/sun/dyn/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/dyn/util/BytecodeDescriptor.java b/jdk/src/share/classes/sun/dyn/util/BytecodeDescriptor.java index 1fe87bed74e..2c59b918338 100644 --- a/jdk/src/share/classes/sun/dyn/util/BytecodeDescriptor.java +++ b/jdk/src/share/classes/sun/dyn/util/BytecodeDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/dyn/util/BytecodeName.java b/jdk/src/share/classes/sun/dyn/util/BytecodeName.java index fad568e64e8..73be3fb1361 100644 --- a/jdk/src/share/classes/sun/dyn/util/BytecodeName.java +++ b/jdk/src/share/classes/sun/dyn/util/BytecodeName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/dyn/util/ValueConversions.java b/jdk/src/share/classes/sun/dyn/util/ValueConversions.java index 90180c6e794..29e75eccede 100644 --- a/jdk/src/share/classes/sun/dyn/util/ValueConversions.java +++ b/jdk/src/share/classes/sun/dyn/util/ValueConversions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ import java.util.List; import sun.dyn.Access; import sun.dyn.AdapterMethodHandle; import sun.dyn.MethodHandleImpl; +import static sun.dyn.MemberName.uncaughtException; public class ValueConversions { private static final Access IMPL_TOKEN = Access.getToken(); @@ -148,11 +149,16 @@ public class ValueConversions { // look up the method String name = "unbox" + wrap.simpleName() + (raw ? "Raw" : ""); MethodType type = unboxType(wrap, raw); - if (!exact) - // actually, type is wrong; the Java method takes Object - mh = IMPL_LOOKUP.findStatic(ValueConversions.class, name, type.erase()); - else + if (!exact) { + try { + // actually, type is wrong; the Java method takes Object + mh = IMPL_LOOKUP.findStatic(ValueConversions.class, name, type.erase()); + } catch (NoAccessException ex) { + mh = null; + } + } else { mh = retype(type, unbox(wrap, !exact, raw)); + } if (mh != null) { cache.put(wrap, mh); return mh; @@ -280,10 +286,15 @@ public class ValueConversions { // look up the method String name = "box" + wrap.simpleName() + (raw ? "Raw" : ""); MethodType type = boxType(wrap, raw); - if (exact) - mh = IMPL_LOOKUP.findStatic(ValueConversions.class, name, type); - else + if (exact) { + try { + mh = IMPL_LOOKUP.findStatic(ValueConversions.class, name, type); + } catch (NoAccessException ex) { + mh = null; + } + } else { mh = retype(type.erase(), box(wrap, !exact, raw)); + } if (mh != null) { cache.put(wrap, mh); return mh; @@ -366,7 +377,7 @@ public class ValueConversions { REBOX_CONVERSIONS = newWrapperCaches(2); /** - * Becase we normalize primitive types to reduce the number of signatures, + * Because we normalize primitive types to reduce the number of signatures, * primitives are sometimes manipulated under an "erased" type, * either int (for types other than long/double) or long (for all types). * When the erased primitive value is then boxed into an Integer or Long, @@ -394,10 +405,15 @@ public class ValueConversions { // look up the method String name = "reboxRaw" + wrap.simpleName(); MethodType type = reboxType(wrap); - if (exact) - mh = IMPL_LOOKUP.findStatic(ValueConversions.class, name, type); - else + if (exact) { + try { + mh = IMPL_LOOKUP.findStatic(ValueConversions.class, name, type); + } catch (NoAccessException ex) { + mh = null; + } + } else { mh = retype(IDENTITY.type(), rebox(wrap, !exact)); + } if (mh != null) { cache.put(wrap, mh); return mh; @@ -459,10 +475,10 @@ public class ValueConversions { } private static final EnumMap[] - ZERO_CONSTANT_FUNCTIONS = newWrapperCaches(1); + CONSTANT_FUNCTIONS = newWrapperCaches(2); public static MethodHandle zeroConstantFunction(Wrapper wrap) { - EnumMap cache = ZERO_CONSTANT_FUNCTIONS[0]; + EnumMap cache = CONSTANT_FUNCTIONS[0]; MethodHandle mh = cache.get(wrap); if (mh != null) { return mh; @@ -474,7 +490,11 @@ public class ValueConversions { mh = EMPTY; break; case INT: case LONG: case FLOAT: case DOUBLE: - mh = IMPL_LOOKUP.findStatic(ValueConversions.class, "zero"+wrap.simpleName(), type); + try { + mh = IMPL_LOOKUP.findStatic(ValueConversions.class, "zero"+wrap.simpleName(), type); + } catch (NoAccessException ex) { + mh = null; + } break; } if (mh != null) { @@ -523,6 +543,24 @@ public class ValueConversions { return x; } + /** + * Identity function on ints. + * @param x an arbitrary int value + * @return the same value x + */ + static int identity(int x) { + return x; + } + + /** + * Identity function on longs. + * @param x an arbitrary long value + * @return the same value x + */ + static long identity(long x) { + return x; + } + /** * Identity function, with reference cast. * @param t an arbitrary reference type @@ -533,7 +571,7 @@ public class ValueConversions { return t.cast(x); } - private static final MethodHandle IDENTITY, CAST_REFERENCE, ALWAYS_NULL, ALWAYS_ZERO, ZERO_OBJECT, IGNORE, EMPTY; + private static final MethodHandle IDENTITY, IDENTITY_I, IDENTITY_J, CAST_REFERENCE, ALWAYS_NULL, ALWAYS_ZERO, ZERO_OBJECT, IGNORE, EMPTY; static { try { MethodType idType = MethodType.genericMethodType(1); @@ -542,6 +580,8 @@ public class ValueConversions { MethodType ignoreType = idType.changeReturnType(void.class); MethodType zeroObjectType = MethodType.genericMethodType(0); IDENTITY = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", idType); + IDENTITY_I = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", MethodType.methodType(int.class, int.class)); + IDENTITY_J = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", MethodType.methodType(long.class, long.class)); //CAST_REFERENCE = IMPL_LOOKUP.findVirtual(Class.class, "cast", idType); CAST_REFERENCE = IMPL_LOOKUP.findStatic(ValueConversions.class, "castReference", castType); ALWAYS_NULL = IMPL_LOOKUP.findStatic(ValueConversions.class, "alwaysNull", idType); @@ -549,8 +589,8 @@ public class ValueConversions { ZERO_OBJECT = IMPL_LOOKUP.findStatic(ValueConversions.class, "zeroObject", zeroObjectType); IGNORE = IMPL_LOOKUP.findStatic(ValueConversions.class, "ignore", ignoreType); EMPTY = IMPL_LOOKUP.findStatic(ValueConversions.class, "empty", ignoreType.dropParameterTypes(0, 1)); - } catch (RuntimeException ex) { - throw ex; + } catch (Exception ex) { + throw uncaughtException(ex); } } @@ -593,8 +633,53 @@ public class ValueConversions { return IDENTITY; } + public static MethodHandle identity(Class type) { + if (type == Object.class) + return IDENTITY; + else if (!type.isPrimitive()) + return retype(MethodType.methodType(type, type), IDENTITY); + else + return identity(Wrapper.forPrimitiveType(type)); + } + + static MethodHandle identity(Wrapper wrap) { + EnumMap cache = CONSTANT_FUNCTIONS[1]; + MethodHandle mh = cache.get(wrap); + if (mh != null) { + return mh; + } + // slow path + MethodType type = MethodType.methodType(wrap.primitiveType()); + if (wrap != Wrapper.VOID) + type = type.appendParameterTypes(wrap.primitiveType()); + try { + mh = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", type); + } catch (NoAccessException ex) { + mh = null; + } + if (mh == null && wrap == Wrapper.VOID) { + mh = EMPTY; // #(){} : #()void + } + if (mh != null) { + cache.put(wrap, mh); + return mh; + } + + // use a raw conversion + if (wrap.isSingleWord() && wrap != Wrapper.INT) { + mh = retype(type, identity(Wrapper.INT)); + } else if (wrap.isDoubleWord() && wrap != Wrapper.LONG) { + mh = retype(type, identity(Wrapper.LONG)); + } + if (mh != null) { + cache.put(wrap, mh); + return mh; + } + throw new IllegalArgumentException("cannot find identity for " + wrap); + } + private static MethodHandle retype(MethodType type, MethodHandle mh) { - return AdapterMethodHandle.makeRetypeOnly(IMPL_TOKEN, type, mh); + return AdapterMethodHandle.makeRetypeRaw(IMPL_TOKEN, type, mh); } private static final Object[] NO_ARGS_ARRAY = {}; diff --git a/jdk/src/share/classes/sun/dyn/util/VerifyAccess.java b/jdk/src/share/classes/sun/dyn/util/VerifyAccess.java index 13987dad9a9..88fdafbc310 100644 --- a/jdk/src/share/classes/sun/dyn/util/VerifyAccess.java +++ b/jdk/src/share/classes/sun/dyn/util/VerifyAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ package sun.dyn.util; -import java.dyn.LinkagePermission; import java.dyn.NoAccessException; import java.lang.reflect.Modifier; import sun.dyn.MemberName; @@ -43,6 +42,7 @@ public class VerifyAccess { private static final int PACKAGE_ONLY = 0; private static final int ALL_ACCESS_MODES = (PUBLIC|PRIVATE|PROTECTED|PACKAGE_ONLY); + private static final boolean ALLOW_NESTMATE_ACCESS = false; /** * Evaluate the JVM linkage rules for access to the given method @@ -102,6 +102,8 @@ public class VerifyAccess { // a superclass of the lookup class. } } + if (defc == lookupClass) + return true; // easy check; all self-access is OK switch (mods & ALL_ACCESS_MODES) { case PUBLIC: if (refc != defc) return true; // already checked above @@ -112,7 +114,8 @@ public class VerifyAccess { return isSamePackage(defc, lookupClass); case PRIVATE: // Loosened rules for privates follows access rules for inner classes. - return isSamePackageMember(defc, lookupClass); + return (ALLOW_NESTMATE_ACCESS && + isSamePackageMember(defc, lookupClass)); default: throw new IllegalArgumentException("bad modifiers: "+Modifier.toString(mods)); } @@ -206,24 +209,4 @@ public class VerifyAccess { } return false; } - - /** - * Ensure the requesting class have privileges to perform invokedynamic - * linkage operations on subjectClass. True if requestingClass is - * Access.class (meaning the request originates from the JVM) or if the - * classes are in the same package and have consistent class loaders. - * (The subject class loader must be identical with or be a child of - * the requesting class loader.) - * @param requestingClass - * @param subjectClass - */ - public static void checkBootstrapPrivilege(Class requestingClass, Class subjectClass, - String permissionName) { - if (requestingClass == null) return; - if (requestingClass == subjectClass) return; - SecurityManager security = System.getSecurityManager(); - if (security == null) return; // open season - if (isSamePackage(requestingClass, subjectClass)) return; - security.checkPermission(new LinkagePermission(permissionName, requestingClass)); - } } diff --git a/jdk/src/share/classes/sun/dyn/util/VerifyType.java b/jdk/src/share/classes/sun/dyn/util/VerifyType.java index 5217330894f..b6277e4a8a9 100644 --- a/jdk/src/share/classes/sun/dyn/util/VerifyType.java +++ b/jdk/src/share/classes/sun/dyn/util/VerifyType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/dyn/util/Wrapper.java b/jdk/src/share/classes/sun/dyn/util/Wrapper.java index 5229c807310..91b599e8c64 100644 --- a/jdk/src/share/classes/sun/dyn/util/Wrapper.java +++ b/jdk/src/share/classes/sun/dyn/util/Wrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,17 +26,19 @@ package sun.dyn.util; public enum Wrapper { - INT(Integer.class, int.class, 'I', (Integer)(int)0, Format.signed(32)), - LONG(Long.class, long.class, 'J', (Long)(long)0, Format.signed(64)), + BOOLEAN(Boolean.class, boolean.class, 'Z', (Boolean)false, Format.unsigned(1)), + // These must be in the order defined for widening primitive conversions in JLS 5.1.2 BYTE(Byte.class, byte.class, 'B', (Byte)(byte)0, Format.signed(8)), SHORT(Short.class, short.class, 'S', (Short)(short)0, Format.signed(16)), CHAR(Character.class, char.class, 'C', (Character)(char)0, Format.unsigned(16)), - BOOLEAN(Boolean.class, boolean.class, 'Z', (Boolean)false, Format.unsigned(1)), + INT(Integer.class, int.class, 'I', (Integer)(int)0, Format.signed(32)), + LONG(Long.class, long.class, 'J', (Long)(long)0, Format.signed(64)), FLOAT(Float.class, float.class, 'F', (Float)(float)0, Format.floating(32)), DOUBLE(Double.class, double.class, 'D', (Double)(double)0, Format.floating(64)), - VOID(Void.class, void.class, 'V', null, Format.other(0)), //NULL(Null.class, null.class, 'N', null, Format.other(1)), OBJECT(Object.class, Object.class, 'L', null, Format.other(1)), + // VOID must be the last type, since it is "assignable" from any other type: + VOID(Void.class, void.class, 'V', null, Format.other(0)), ; private final Class wrapperType; @@ -76,9 +78,11 @@ public enum Wrapper { false); return kind | (size << SIZE_SHIFT) | (slots << SLOT_SHIFT); } - static int + static final int INT = SIGNED | (32 << SIZE_SHIFT) | (1 << SLOT_SHIFT), + SHORT = SIGNED | (16 << SIZE_SHIFT) | (1 << SLOT_SHIFT), BOOLEAN = UNSIGNED | (1 << SIZE_SHIFT) | (1 << SLOT_SHIFT), + CHAR = UNSIGNED | (16 << SIZE_SHIFT) | (1 << SLOT_SHIFT), FLOAT = FLOATING | (32 << SIZE_SHIFT) | (1 << SLOT_SHIFT), VOID = UNSIGNED | (0 << SIZE_SHIFT) | (0 << SLOT_SHIFT), NUM_MASK = (-1) << SIZE_SHIFT; @@ -111,6 +115,29 @@ public enum Wrapper { /** Is the wrapped type either float or double? */ public boolean isFloating() { return format >= Format.FLOAT; } + /** Does the JVM verifier allow a variable of this wrapper's + * primitive type to be assigned from a value of the given wrapper's primitive type? + * Cases: + *
        + *
      • unboxing followed by widening primitive conversion + *
      • any type converted to {@code void} + *
      • boxing conversion followed by widening reference conversion to {@code Object} + *
      • conversion of {@code boolean} to any type + *
      + */ + public boolean isConvertibleFrom(Wrapper source) { + if (this == source) return true; + if (this.compareTo(source) < 0) { + // At best, this is a narrowing conversion. + return false; + } + if ((this.format ^ source.format) == (Format.SHORT ^ Format.CHAR)) { + assert (this == SHORT && source == CHAR) || (this == CHAR && source == SHORT); + return false; + } + return true; + } + /** Produce a zero value for the given wrapper type. * This will be a numeric zero for a number or character, * false for a boolean, and null for a reference or void. @@ -122,10 +149,10 @@ public enum Wrapper { public Object zero() { return zero; } /** Produce a zero value for the given wrapper type T. - * The optinoal argument must a type compatible with this wrapper. + * The optional argument must a type compatible with this wrapper. * Equivalent to {@code this.cast(this.zero(), type)}. */ - public T zero(Class type) { return cast(zero, type); } + public T zero(Class type) { return convert(zero, type); } // /** Produce a wrapper for the given wrapper or primitive type. */ // public static Wrapper valueOf(Class type) { @@ -264,7 +291,11 @@ public enum Wrapper { exampleType.isInterface()) { return forceType(wrapperType, exampleType); } - throw new ClassCastException(exampleType + " not <:" + wrapperType); + throw newClassCastException(exampleType, primitiveType); + } + + private static ClassCastException newClassCastException(Class actual, Class expected) { + return new ClassCastException(actual + " is not compatible with " + expected); } /** If {@code type} is a primitive type, return the corresponding @@ -325,17 +356,55 @@ public enum Wrapper { // } /** Cast a wrapped value to the given type, which may be either a primitive or wrapper type. + * The given target type must be this wrapper's primitive or wrapper type. + * If this wrapper is OBJECT, the target type may also be an interface, perform no runtime check. * Performs standard primitive conversions, including truncation and float conversions. * The given type must be compatible with this wrapper. That is, it must either * be the wrapper type (or a subtype, in the case of {@code OBJECT}) or else * it must be the wrapper's primitive type. + * Primitive conversions are only performed if the given type is itself a primitive. * @throws ClassCastException if the given type is not compatible with this wrapper */ public T cast(Object x, Class type) { + return convert(x, type, true); + } + + /** Convert a wrapped value to the given type. + * The given target type must be this wrapper's primitive or wrapper type. + * This is equivalent to {@link #cast}, except that it refuses to perform + * narrowing primitive conversions. + */ + public T convert(Object x, Class type) { + return convert(x, type, false); + } + + private T convert(Object x, Class type, boolean isCast) { + if (this == OBJECT) { + // If the target wrapper is OBJECT, just do a reference cast. + // If the target type is an interface, perform no runtime check. + // (This loophole is safe, and is allowed by the JVM verifier.) + // If the target type is a primitive, change it to a wrapper. + @SuppressWarnings("unchecked") + T result = (T) x; // unchecked warning is expected here + return result; + } Class wtype = wrapperType(type); - if (wtype.isInstance(x)) - return wtype.cast(x); - return wtype.cast(wrap(x)); + if (wtype.isInstance(x)) { + @SuppressWarnings("unchecked") + T result = (T) x; // unchecked warning is expected here + return result; + } + Class sourceType = x.getClass(); // throw NPE if x is null + if (!isCast) { + Wrapper source = findWrapperType(sourceType); + if (source == null || !this.isConvertibleFrom(source)) { + throw newClassCastException(wtype, sourceType); + } + } + @SuppressWarnings("unchecked") + T result = (T) wrap(x); // unchecked warning is expected here + assert result.getClass() == wtype; + return result; } /** Cast a reference type to another reference type. diff --git a/jdk/src/share/classes/sun/font/FileFontStrike.java b/jdk/src/share/classes/sun/font/FileFontStrike.java index ce4d87c2a99..ae6045f696c 100644 --- a/jdk/src/share/classes/sun/font/FileFontStrike.java +++ b/jdk/src/share/classes/sun/font/FileFontStrike.java @@ -58,10 +58,10 @@ public class FileFontStrike extends PhysicalStrike { private static final int SEGINTARRAY = 3; private static final int SEGLONGARRAY = 4; - private int glyphCacheFormat = UNINITIALISED; + private volatile int glyphCacheFormat = UNINITIALISED; - /* segmented arrays are blocks of 256 */ - private static final int SEGSHIFT = 8; + /* segmented arrays are blocks of 32 */ + private static final int SEGSHIFT = 5; private static final int SEGSIZE = 1 << SEGSHIFT; private boolean segmentedCache; @@ -171,7 +171,7 @@ public class FileFontStrike extends PhysicalStrike { mapper = fileFont.getMapper(); int numGlyphs = mapper.getNumGlyphs(); - /* Always segment for fonts with > 2K glyphs, but also for smaller + /* Always segment for fonts with > 256 glyphs, but also for smaller * fonts with non-typical sizes and transforms. * Segmenting for all non-typical pt sizes helps to minimise memory * usage when very many distinct strikes are created. @@ -522,32 +522,33 @@ public class FileFontStrike extends PhysicalStrike { } /* Called only from synchronized code or constructor */ - private void initGlyphCache() { + private synchronized void initGlyphCache() { int numGlyphs = mapper.getNumGlyphs(); - + int tmpFormat = UNINITIALISED; if (segmentedCache) { int numSegments = (numGlyphs + SEGSIZE-1)/SEGSIZE; if (longAddresses) { - glyphCacheFormat = SEGLONGARRAY; + tmpFormat = SEGLONGARRAY; segLongGlyphImages = new long[numSegments][]; this.disposer.segLongGlyphImages = segLongGlyphImages; } else { - glyphCacheFormat = SEGINTARRAY; + tmpFormat = SEGINTARRAY; segIntGlyphImages = new int[numSegments][]; this.disposer.segIntGlyphImages = segIntGlyphImages; } } else { if (longAddresses) { - glyphCacheFormat = LONGARRAY; + tmpFormat = LONGARRAY; longGlyphImages = new long[numGlyphs]; this.disposer.longGlyphImages = longGlyphImages; } else { - glyphCacheFormat = INTARRAY; + tmpFormat = INTARRAY; intGlyphImages = new int[numGlyphs]; this.disposer.intGlyphImages = intGlyphImages; } } + glyphCacheFormat = tmpFormat; } float getGlyphAdvance(int glyphCode) { diff --git a/jdk/src/share/classes/sun/font/Font2D.java b/jdk/src/share/classes/sun/font/Font2D.java index 3fab32c8434..b78292722b5 100644 --- a/jdk/src/share/classes/sun/font/Font2D.java +++ b/jdk/src/share/classes/sun/font/Font2D.java @@ -343,7 +343,21 @@ public abstract class Font2D { } strike = createStrike(desc); //StrikeCache.addStrike(); - strikeRef = StrikeCache.getStrikeRef(strike); + /* If we are creating many strikes on this font which + * involve non-quadrant rotations, or more general + * transforms which include shears, then force the use + * of weak references rather than soft references. + * This means that it won't live much beyond the next GC, + * which is what we want for what is likely a transient strike. + */ + int txType = desc.glyphTx.getType(); + if (txType == AffineTransform.TYPE_GENERAL_TRANSFORM || + (txType & AffineTransform.TYPE_GENERAL_ROTATION) != 0 && + strikeCache.size() > 10) { + strikeRef = StrikeCache.getStrikeRef(strike, true); + } else { + strikeRef = StrikeCache.getStrikeRef(strike); + } strikeCache.put(desc, strikeRef); //strike.lastlookupTime = System.currentTimeMillis(); lastFontStrike = new SoftReference(strike); diff --git a/jdk/src/share/classes/sun/font/FontManagerFactory.java b/jdk/src/share/classes/sun/font/FontManagerFactory.java index e692739c67a..b9f4a6f1298 100644 --- a/jdk/src/share/classes/sun/font/FontManagerFactory.java +++ b/jdk/src/share/classes/sun/font/FontManagerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/font/FontUtilities.java b/jdk/src/share/classes/sun/font/FontUtilities.java index 4438cc6aeee..ef53c60de08 100644 --- a/jdk/src/share/classes/sun/font/FontUtilities.java +++ b/jdk/src/share/classes/sun/font/FontUtilities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -276,6 +276,18 @@ public final class FontUtilities { // 0E00 - 0E7F if Thai, assume shaping for vowel, tone marks return true; } + else if (code < 0x0f00) { + return false; + } + else if (code <= 0x0fff) { // U+0F00 - U+0FFF Tibetan + return true; + } + else if (code < 0x1100) { + return false; + } + else if (code < 0x11ff) { // U+1100 - U+11FF Old Hangul + return true; + } else if (code < 0x1780) { return false; } diff --git a/jdk/src/share/classes/sun/font/StrikeCache.java b/jdk/src/share/classes/sun/font/StrikeCache.java index 6a83347d4d3..a7aa1f5846c 100644 --- a/jdk/src/share/classes/sun/font/StrikeCache.java +++ b/jdk/src/share/classes/sun/font/StrikeCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/font/SunFontManager.java b/jdk/src/share/classes/sun/font/SunFontManager.java index 2932a296cac..991064e38ae 100644 --- a/jdk/src/share/classes/sun/font/SunFontManager.java +++ b/jdk/src/share/classes/sun/font/SunFontManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/ByteToCharBig5.java b/jdk/src/share/classes/sun/io/ByteToCharBig5.java index 5038e8ca8b5..31b2ce43853 100644 --- a/jdk/src/share/classes/sun/io/ByteToCharBig5.java +++ b/jdk/src/share/classes/sun/io/ByteToCharBig5.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/ByteToCharBig5_HKSCS.java b/jdk/src/share/classes/sun/io/ByteToCharBig5_HKSCS.java index 732f10b48c9..dc36675c101 100644 --- a/jdk/src/share/classes/sun/io/ByteToCharBig5_HKSCS.java +++ b/jdk/src/share/classes/sun/io/ByteToCharBig5_HKSCS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/ByteToCharBig5_Solaris.java b/jdk/src/share/classes/sun/io/ByteToCharBig5_Solaris.java index bd9847fc40b..a6cd9458d43 100644 --- a/jdk/src/share/classes/sun/io/ByteToCharBig5_Solaris.java +++ b/jdk/src/share/classes/sun/io/ByteToCharBig5_Solaris.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/hpi/export/path_md.h b/jdk/src/share/classes/sun/io/ByteToCharCp833.java similarity index 72% rename from jdk/src/windows/hpi/export/path_md.h rename to jdk/src/share/classes/sun/io/ByteToCharCp833.java index fc801d80a9c..a83a893d137 100644 --- a/jdk/src/windows/hpi/export/path_md.h +++ b/jdk/src/share/classes/sun/io/ByteToCharCp833.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. * 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,20 @@ * questions. */ -/*- - * Win32 dependent search path definitions and API - */ +package sun.io; -#ifndef _JAVASOFT_WIN32_PATH_MD_H_ -#define _JAVASOFT_WIN32_PATH_MD_H_ +import sun.nio.cs.ext.IBM833; -#define PATH_SEPARATOR ";" -#define PATH_CURDIR "." +public class ByteToCharCp833 extends ByteToCharSingleByte { -#define DIR_SEPARATOR '/' -#define LOCAL_DIR_SEPARATOR '\\' + private final static IBM833 nioCoder = new IBM833(); + + public String getCharacterEncoding() { + return "Cp833"; + } + + public ByteToCharCp833() { + super.byteToCharTable = nioCoder.getDecoderSingleByteMappings(); + } +} -#endif /* !_JAVASOFT_WIN32_PATH_MD_H_ */ diff --git a/jdk/src/share/classes/sun/io/ByteToCharISO2022.java b/jdk/src/share/classes/sun/io/ByteToCharISO2022.java index 5fef812fd21..f827972fd8f 100644 --- a/jdk/src/share/classes/sun/io/ByteToCharISO2022.java +++ b/jdk/src/share/classes/sun/io/ByteToCharISO2022.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/ByteToCharISO2022JP.java b/jdk/src/share/classes/sun/io/ByteToCharISO2022JP.java index 03027c24732..0519cf97c33 100644 --- a/jdk/src/share/classes/sun/io/ByteToCharISO2022JP.java +++ b/jdk/src/share/classes/sun/io/ByteToCharISO2022JP.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/ByteToCharJISAutoDetect.java b/jdk/src/share/classes/sun/io/ByteToCharJISAutoDetect.java index 8f00ef6c233..47cc33cd04b 100644 --- a/jdk/src/share/classes/sun/io/ByteToCharJISAutoDetect.java +++ b/jdk/src/share/classes/sun/io/ByteToCharJISAutoDetect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/ByteToCharMS950_HKSCS.java b/jdk/src/share/classes/sun/io/ByteToCharMS950_HKSCS.java index e7401b5a2f4..f03b641104b 100644 --- a/jdk/src/share/classes/sun/io/ByteToCharMS950_HKSCS.java +++ b/jdk/src/share/classes/sun/io/ByteToCharMS950_HKSCS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/ByteToCharUTF8.java b/jdk/src/share/classes/sun/io/ByteToCharUTF8.java index dbc6fbbf307..3abe5937865 100644 --- a/jdk/src/share/classes/sun/io/ByteToCharUTF8.java +++ b/jdk/src/share/classes/sun/io/ByteToCharUTF8.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/CharToByteBig5.java b/jdk/src/share/classes/sun/io/CharToByteBig5.java index e6d1bf2c994..c6ef3e4c8f1 100644 --- a/jdk/src/share/classes/sun/io/CharToByteBig5.java +++ b/jdk/src/share/classes/sun/io/CharToByteBig5.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/CharToByteBig5_HKSCS.java b/jdk/src/share/classes/sun/io/CharToByteBig5_HKSCS.java index 5a1ba9bec3f..706e9059ddd 100644 --- a/jdk/src/share/classes/sun/io/CharToByteBig5_HKSCS.java +++ b/jdk/src/share/classes/sun/io/CharToByteBig5_HKSCS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/CharToByteBig5_Solaris.java b/jdk/src/share/classes/sun/io/CharToByteBig5_Solaris.java index 274e38d0a07..503d7b21ea5 100644 --- a/jdk/src/share/classes/sun/io/CharToByteBig5_Solaris.java +++ b/jdk/src/share/classes/sun/io/CharToByteBig5_Solaris.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/hpi/export/io_md.h b/jdk/src/share/classes/sun/io/CharToByteCp833.java similarity index 67% rename from jdk/src/solaris/hpi/export/io_md.h rename to jdk/src/share/classes/sun/io/CharToByteCp833.java index d1cc95d4938..2d531406c17 100644 --- a/jdk/src/solaris/hpi/export/io_md.h +++ b/jdk/src/share/classes/sun/io/CharToByteCp833.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. * 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,23 +23,24 @@ * questions. */ -/* - * Solaris-dependent I/O - */ +package sun.io; -#ifndef _JAVASOFT_SOLARIS_IO_MD_H_ -#define _JAVASOFT_SOLARIS_IO_MD_H_ +import sun.nio.cs.ext.IBM833; -#include -#include -#include -#include -#include -#include -#include +public class CharToByteCp833 extends CharToByteSingleByte { -#define LINE_SEPARATOR "\n" + private final static IBM833 nioCoder = new IBM833(); -/* file system macros moved to sysmacros_md.h */ + public String getCharacterEncoding() { + return "Cp833"; + } + + public CharToByteCp833() { + super.mask1 = 0xFF00; + super.mask2 = 0x00FF; + super.shift = 8; + super.index1 = nioCoder.getEncoderIndex1(); + super.index2 = nioCoder.getEncoderIndex2(); + } +} -#endif /* !_JAVASOFT_SOLARIS_IO_MD_H_ */ diff --git a/jdk/src/share/classes/sun/io/CharToByteDBCS_ASCII.java b/jdk/src/share/classes/sun/io/CharToByteDBCS_ASCII.java index 8d2ba119dae..ca261fce15b 100644 --- a/jdk/src/share/classes/sun/io/CharToByteDBCS_ASCII.java +++ b/jdk/src/share/classes/sun/io/CharToByteDBCS_ASCII.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/CharToByteDBCS_EBCDIC.java b/jdk/src/share/classes/sun/io/CharToByteDBCS_EBCDIC.java index b410076a7e6..8a7a1fdd435 100644 --- a/jdk/src/share/classes/sun/io/CharToByteDBCS_EBCDIC.java +++ b/jdk/src/share/classes/sun/io/CharToByteDBCS_EBCDIC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/CharToByteMS950_HKSCS.java b/jdk/src/share/classes/sun/io/CharToByteMS950_HKSCS.java index bbff6ddc421..540d3aac119 100644 --- a/jdk/src/share/classes/sun/io/CharToByteMS950_HKSCS.java +++ b/jdk/src/share/classes/sun/io/CharToByteMS950_HKSCS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/CharToBytePCK.java b/jdk/src/share/classes/sun/io/CharToBytePCK.java index 9a8d1a76cea..89c13cd2c18 100644 --- a/jdk/src/share/classes/sun/io/CharToBytePCK.java +++ b/jdk/src/share/classes/sun/io/CharToBytePCK.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/CharToByteUnicode.java b/jdk/src/share/classes/sun/io/CharToByteUnicode.java index 12dfa8f8bda..d7b19e1f31a 100644 --- a/jdk/src/share/classes/sun/io/CharToByteUnicode.java +++ b/jdk/src/share/classes/sun/io/CharToByteUnicode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/io/CharacterEncoding.java b/jdk/src/share/classes/sun/io/CharacterEncoding.java index 94ce7040f5d..f577a9bc79b 100644 --- a/jdk/src/share/classes/sun/io/CharacterEncoding.java +++ b/jdk/src/share/classes/sun/io/CharacterEncoding.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -406,6 +406,11 @@ public class CharacterEncoding { aliasTable.put("cp775", "Cp775"); aliasTable.put("775", "Cp775"); + aliasTable.put("ibm833", "Cp833"); + aliasTable.put("ibm-833", "Cp833"); + aliasTable.put("cp833", "Cp833"); + aliasTable.put("833", "Cp833"); + aliasTable.put("ibm834", "Cp834"); aliasTable.put("ibm-834", "Cp834"); aliasTable.put("cp834", "Cp834"); diff --git a/jdk/src/share/classes/sun/io/Converters.java b/jdk/src/share/classes/sun/io/Converters.java index 45807015d0a..d09bc1e81f3 100644 --- a/jdk/src/share/classes/sun/io/Converters.java +++ b/jdk/src/share/classes/sun/io/Converters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -120,7 +120,7 @@ public class Converters { private static Class cache(int type, Object encoding, Class c) { SoftReference[] srs = classCache[type]; - srs[CACHE_SIZE - 1] = new SoftReference(new Object[] { c, encoding }); + srs[CACHE_SIZE - 1] = new SoftReference<>(new Object[] { c, encoding }); moveToFront(srs, CACHE_SIZE - 1); return c; } diff --git a/jdk/src/share/classes/sun/java2d/Disposer.java b/jdk/src/share/classes/sun/java2d/Disposer.java index d26ca1f9a3e..83951023fbb 100644 --- a/jdk/src/share/classes/sun/java2d/Disposer.java +++ b/jdk/src/share/classes/sun/java2d/Disposer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/java2d/HeadlessGraphicsEnvironment.java b/jdk/src/share/classes/sun/java2d/HeadlessGraphicsEnvironment.java index 67d5d33c36f..e46e0c4fe8b 100644 --- a/jdk/src/share/classes/sun/java2d/HeadlessGraphicsEnvironment.java +++ b/jdk/src/share/classes/sun/java2d/HeadlessGraphicsEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/java2d/SurfaceData.java b/jdk/src/share/classes/sun/java2d/SurfaceData.java index 5a5a32b1563..9916c5b38a8 100644 --- a/jdk/src/share/classes/sun/java2d/SurfaceData.java +++ b/jdk/src/share/classes/sun/java2d/SurfaceData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,11 +46,15 @@ import sun.java2d.loops.DrawPolygons; import sun.java2d.loops.DrawPath; import sun.java2d.loops.FillPath; import sun.java2d.loops.FillSpans; +import sun.java2d.loops.FillParallelogram; +import sun.java2d.loops.DrawParallelogram; import sun.java2d.loops.FontInfo; import sun.java2d.loops.DrawGlyphList; import sun.java2d.loops.DrawGlyphListAA; import sun.java2d.loops.DrawGlyphListLCD; import sun.java2d.pipe.LoopPipe; +import sun.java2d.pipe.ShapeDrawPipe; +import sun.java2d.pipe.ParallelogramPipe; import sun.java2d.pipe.CompositePipe; import sun.java2d.pipe.GeneralCompositePipe; import sun.java2d.pipe.SpanClipRenderer; @@ -59,6 +63,7 @@ import sun.java2d.pipe.AAShapePipe; import sun.java2d.pipe.AlphaPaintPipe; import sun.java2d.pipe.AlphaColorPipe; import sun.java2d.pipe.PixelToShapeConverter; +import sun.java2d.pipe.PixelToParallelogramConverter; import sun.java2d.pipe.TextPipe; import sun.java2d.pipe.TextRenderer; import sun.java2d.pipe.AATextRenderer; @@ -362,15 +367,17 @@ public abstract class SurfaceData public static final TextPipe aaTextRenderer; public static final TextPipe lcdTextRenderer; - protected static final CompositePipe colorPipe; + protected static final AlphaColorPipe colorPipe; protected static final PixelToShapeConverter colorViaShape; + protected static final PixelToParallelogramConverter colorViaPgram; protected static final TextPipe colorText; protected static final CompositePipe clipColorPipe; protected static final TextPipe clipColorText; protected static final AAShapePipe AAColorShape; - protected static final PixelToShapeConverter AAColorViaShape; + protected static final PixelToParallelogramConverter AAColorViaShape; + protected static final PixelToParallelogramConverter AAColorViaPgram; protected static final AAShapePipe AAClipColorShape; - protected static final PixelToShapeConverter AAClipColorViaShape; + protected static final PixelToParallelogramConverter AAClipColorViaShape; protected static final CompositePipe paintPipe; protected static final SpanShapeRenderer paintShape; @@ -379,9 +386,9 @@ public abstract class SurfaceData protected static final CompositePipe clipPaintPipe; protected static final TextPipe clipPaintText; protected static final AAShapePipe AAPaintShape; - protected static final PixelToShapeConverter AAPaintViaShape; + protected static final PixelToParallelogramConverter AAPaintViaShape; protected static final AAShapePipe AAClipPaintShape; - protected static final PixelToShapeConverter AAClipPaintViaShape; + protected static final PixelToParallelogramConverter AAClipPaintViaShape; protected static final CompositePipe compPipe; protected static final SpanShapeRenderer compShape; @@ -390,12 +397,53 @@ public abstract class SurfaceData protected static final CompositePipe clipCompPipe; protected static final TextPipe clipCompText; protected static final AAShapePipe AACompShape; - protected static final PixelToShapeConverter AACompViaShape; + protected static final PixelToParallelogramConverter AACompViaShape; protected static final AAShapePipe AAClipCompShape; - protected static final PixelToShapeConverter AAClipCompViaShape; + protected static final PixelToParallelogramConverter AAClipCompViaShape; protected static final DrawImagePipe imagepipe; + // Utility subclass to add the LoopBasedPipe tagging interface + static class PixelToShapeLoopConverter + extends PixelToShapeConverter + implements LoopBasedPipe + { + public PixelToShapeLoopConverter(ShapeDrawPipe pipe) { + super(pipe); + } + } + + // Utility subclass to add the LoopBasedPipe tagging interface + static class PixelToPgramLoopConverter + extends PixelToParallelogramConverter + implements LoopBasedPipe + { + public PixelToPgramLoopConverter(ShapeDrawPipe shapepipe, + ParallelogramPipe pgrampipe, + double minPenSize, + double normPosition, + boolean adjustfill) + { + super(shapepipe, pgrampipe, minPenSize, normPosition, adjustfill); + } + } + + private static PixelToParallelogramConverter + makeConverter(AAShapePipe renderer, + ParallelogramPipe pgrampipe) + { + return new PixelToParallelogramConverter(renderer, + pgrampipe, + 1.0/8.0, 0.499, + false); + } + + private static PixelToParallelogramConverter + makeConverter(AAShapePipe renderer) + { + return makeConverter(renderer, renderer); + } + static { colorPrimitives = new LoopPipe(); @@ -406,14 +454,18 @@ public abstract class SurfaceData colorPipe = new AlphaColorPipe(); // colorShape = colorPrimitives; - colorViaShape = new PixelToShapeConverter(colorPrimitives); + colorViaShape = new PixelToShapeLoopConverter(colorPrimitives); + colorViaPgram = new PixelToPgramLoopConverter(colorPrimitives, + colorPrimitives, + 1.0, 0.25, true); colorText = new TextRenderer(colorPipe); clipColorPipe = new SpanClipRenderer(colorPipe); clipColorText = new TextRenderer(clipColorPipe); AAColorShape = new AAShapePipe(colorPipe); - AAColorViaShape = new PixelToShapeConverter(AAColorShape); + AAColorViaShape = makeConverter(AAColorShape); + AAColorViaPgram = makeConverter(AAColorShape, colorPipe); AAClipColorShape = new AAShapePipe(clipColorPipe); - AAClipColorViaShape = new PixelToShapeConverter(AAClipColorShape); + AAClipColorViaShape = makeConverter(AAClipColorShape); paintPipe = new AlphaPaintPipe(); paintShape = new SpanShapeRenderer.Composite(paintPipe); @@ -422,9 +474,9 @@ public abstract class SurfaceData clipPaintPipe = new SpanClipRenderer(paintPipe); clipPaintText = new TextRenderer(clipPaintPipe); AAPaintShape = new AAShapePipe(paintPipe); - AAPaintViaShape = new PixelToShapeConverter(AAPaintShape); + AAPaintViaShape = makeConverter(AAPaintShape); AAClipPaintShape = new AAShapePipe(clipPaintPipe); - AAClipPaintViaShape = new PixelToShapeConverter(AAClipPaintShape); + AAClipPaintViaShape = makeConverter(AAClipPaintShape); compPipe = new GeneralCompositePipe(); compShape = new SpanShapeRenderer.Composite(compPipe); @@ -433,18 +485,20 @@ public abstract class SurfaceData clipCompPipe = new SpanClipRenderer(compPipe); clipCompText = new TextRenderer(clipCompPipe); AACompShape = new AAShapePipe(compPipe); - AACompViaShape = new PixelToShapeConverter(AACompShape); + AACompViaShape = makeConverter(AACompShape); AAClipCompShape = new AAShapePipe(clipCompPipe); - AAClipCompViaShape = new PixelToShapeConverter(AAClipCompShape); + AAClipCompViaShape = makeConverter(AAClipCompShape); imagepipe = new DrawImage(); } /* Not all surfaces and rendering mode combinations support LCD text. */ - static final int LCDLOOP_UNKNOWN = 0; - static final int LCDLOOP_FOUND = 1; - static final int LCDLOOP_NOTFOUND = 2; + static final int LOOP_UNKNOWN = 0; + static final int LOOP_FOUND = 1; + static final int LOOP_NOTFOUND = 2; int haveLCDLoop; + int havePgramXORLoop; + int havePgramSolidLoop; public boolean canRenderLCDText(SunGraphics2D sg2d) { // For now the answer can only be true in the following cases: @@ -453,18 +507,48 @@ public abstract class SurfaceData sg2d.clipState <= SunGraphics2D.CLIP_RECTANGULAR && sg2d.surfaceData.getTransparency() == Transparency.OPAQUE) { - if (haveLCDLoop == LCDLOOP_UNKNOWN) { + if (haveLCDLoop == LOOP_UNKNOWN) { DrawGlyphListLCD loop = DrawGlyphListLCD.locate(SurfaceType.AnyColor, CompositeType.SrcNoEa, getSurfaceType()); - haveLCDLoop = (loop!= null) ? LCDLOOP_FOUND : LCDLOOP_NOTFOUND; + haveLCDLoop = (loop != null) ? LOOP_FOUND : LOOP_NOTFOUND; } - return haveLCDLoop == LCDLOOP_FOUND; + return haveLCDLoop == LOOP_FOUND; } return false; /* for now - in the future we may want to search */ } + public boolean canRenderParallelograms(SunGraphics2D sg2d) { + if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR) { + if (sg2d.compositeState == sg2d.COMP_XOR) { + if (havePgramXORLoop == LOOP_UNKNOWN) { + FillParallelogram loop = + FillParallelogram.locate(SurfaceType.AnyColor, + CompositeType.Xor, + getSurfaceType()); + havePgramXORLoop = + (loop != null) ? LOOP_FOUND : LOOP_NOTFOUND; + } + return havePgramXORLoop == LOOP_FOUND; + } else if (sg2d.compositeState <= sg2d.COMP_ISCOPY && + sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON && + sg2d.clipState != sg2d.CLIP_SHAPE) + { + if (havePgramSolidLoop == LOOP_UNKNOWN) { + FillParallelogram loop = + FillParallelogram.locate(SurfaceType.AnyColor, + CompositeType.SrcNoEa, + getSurfaceType()); + havePgramSolidLoop = + (loop != null) ? LOOP_FOUND : LOOP_NOTFOUND; + } + return havePgramSolidLoop == LOOP_FOUND; + } + } + return false; + } + public void validatePipe(SunGraphics2D sg2d) { sg2d.imagepipe = imagepipe; if (sg2d.compositeState == sg2d.COMP_XOR) { @@ -480,9 +564,21 @@ public abstract class SurfaceData // text drawn in XOR mode with a Paint object. sg2d.textpipe = outlineTextRenderer; } else { + PixelToShapeConverter converter; + if (canRenderParallelograms(sg2d)) { + converter = colorViaPgram; + // Note that we use the transforming pipe here because it + // will examine the shape and possibly perform an optimized + // operation if it can be simplified. The simplifications + // will be valid for all STROKE and TRANSFORM types. + sg2d.shapepipe = colorViaPgram; + } else { + converter = colorViaShape; + sg2d.shapepipe = colorPrimitives; + } if (sg2d.clipState == sg2d.CLIP_SHAPE) { - sg2d.drawpipe = colorViaShape; - sg2d.fillpipe = colorViaShape; + sg2d.drawpipe = converter; + sg2d.fillpipe = converter; // REMIND: We should not be changing text strategies // between outline and glyph rendering based upon the // presence of a complex clip as that could cause a @@ -494,11 +590,11 @@ public abstract class SurfaceData sg2d.textpipe = outlineTextRenderer; } else { if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) { - sg2d.drawpipe = colorViaShape; - sg2d.fillpipe = colorViaShape; + sg2d.drawpipe = converter; + sg2d.fillpipe = converter; } else { if (sg2d.strokeState != sg2d.STROKE_THIN) { - sg2d.drawpipe = colorViaShape; + sg2d.drawpipe = converter; } else { sg2d.drawpipe = colorPrimitives; } @@ -506,7 +602,6 @@ public abstract class SurfaceData } sg2d.textpipe = solidTextRenderer; } - sg2d.shapepipe = colorPrimitives; // assert(sg2d.surfaceData == this); } } else if (sg2d.compositeState == sg2d.COMP_CUSTOM) { @@ -514,12 +609,12 @@ public abstract class SurfaceData if (sg2d.clipState == sg2d.CLIP_SHAPE) { sg2d.drawpipe = AAClipCompViaShape; sg2d.fillpipe = AAClipCompViaShape; - sg2d.shapepipe = AAClipCompShape; + sg2d.shapepipe = AAClipCompViaShape; sg2d.textpipe = clipCompText; } else { sg2d.drawpipe = AACompViaShape; sg2d.fillpipe = AACompViaShape; - sg2d.shapepipe = AACompShape; + sg2d.shapepipe = AACompViaShape; sg2d.textpipe = compText; } } else { @@ -539,13 +634,17 @@ public abstract class SurfaceData if (sg2d.clipState == sg2d.CLIP_SHAPE) { sg2d.drawpipe = AAClipColorViaShape; sg2d.fillpipe = AAClipColorViaShape; - sg2d.shapepipe = AAClipColorShape; + sg2d.shapepipe = AAClipColorViaShape; sg2d.textpipe = clipColorText; } else { - sg2d.drawpipe = AAColorViaShape; - sg2d.fillpipe = AAColorViaShape; - sg2d.shapepipe = AAColorShape; - if (sg2d.paintState > sg2d.PAINT_OPAQUECOLOR || + PixelToParallelogramConverter converter = + (sg2d.alphafill.canDoParallelograms() + ? AAColorViaPgram + : AAColorViaShape); + sg2d.drawpipe = converter; + sg2d.fillpipe = converter; + sg2d.shapepipe = converter; + if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR || sg2d.compositeState > sg2d.COMP_ISCOPY) { sg2d.textpipe = colorText; @@ -557,12 +656,12 @@ public abstract class SurfaceData if (sg2d.clipState == sg2d.CLIP_SHAPE) { sg2d.drawpipe = AAClipPaintViaShape; sg2d.fillpipe = AAClipPaintViaShape; - sg2d.shapepipe = AAClipPaintShape; + sg2d.shapepipe = AAClipPaintViaShape; sg2d.textpipe = clipPaintText; } else { sg2d.drawpipe = AAPaintViaShape; sg2d.fillpipe = AAPaintViaShape; - sg2d.shapepipe = AAPaintShape; + sg2d.shapepipe = AAPaintViaShape; sg2d.textpipe = paintText; } } @@ -589,12 +688,24 @@ public abstract class SurfaceData } } } else { + PixelToShapeConverter converter; + if (canRenderParallelograms(sg2d)) { + converter = colorViaPgram; + // Note that we use the transforming pipe here because it + // will examine the shape and possibly perform an optimized + // operation if it can be simplified. The simplifications + // will be valid for all STROKE and TRANSFORM types. + sg2d.shapepipe = colorViaPgram; + } else { + converter = colorViaShape; + sg2d.shapepipe = colorPrimitives; + } if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) { - sg2d.drawpipe = colorViaShape; - sg2d.fillpipe = colorViaShape; + sg2d.drawpipe = converter; + sg2d.fillpipe = converter; } else { if (sg2d.strokeState != sg2d.STROKE_THIN) { - sg2d.drawpipe = colorViaShape; + sg2d.drawpipe = converter; } else { sg2d.drawpipe = colorPrimitives; } @@ -602,7 +713,6 @@ public abstract class SurfaceData } sg2d.textpipe = getTextPipe(sg2d, false /* AA==OFF */); - sg2d.shapepipe = colorPrimitives; // assert(sg2d.surfaceData == this); } @@ -705,6 +815,18 @@ public abstract class SurfaceData } } + private static CompositeType getFillCompositeType(SunGraphics2D sg2d) { + CompositeType compType = sg2d.imageComp; + if (sg2d.compositeState == sg2d.COMP_ISCOPY) { + if (compType == CompositeType.SrcOverNoEa) { + compType = CompositeType.OpaqueSrcOverNoEa; + } else { + compType = CompositeType.SrcNoEa; + } + } + return compType; + } + /** * Returns a MaskFill object that can be used on this destination * with the source (paint) and composite types determined by the given @@ -714,9 +836,10 @@ public abstract class SurfaceData * surface) before returning a specific MaskFill object. */ protected MaskFill getMaskFill(SunGraphics2D sg2d) { - return MaskFill.getFromCache(getPaintSurfaceType(sg2d), - sg2d.imageComp, - getSurfaceType()); + SurfaceType src = getPaintSurfaceType(sg2d); + CompositeType comp = getFillCompositeType(sg2d); + SurfaceType dst = getSurfaceType(); + return MaskFill.getFromCache(src, comp, dst); } private static RenderCache loopcache = new RenderCache(30); @@ -728,9 +851,7 @@ public abstract class SurfaceData */ public RenderLoops getRenderLoops(SunGraphics2D sg2d) { SurfaceType src = getPaintSurfaceType(sg2d); - CompositeType comp = (sg2d.compositeState == sg2d.COMP_ISCOPY - ? CompositeType.SrcNoEa - : sg2d.imageComp); + CompositeType comp = getFillCompositeType(sg2d); SurfaceType dst = sg2d.getSurfaceData().getSurfaceType(); Object o = loopcache.get(src, comp, dst); @@ -761,6 +882,8 @@ public abstract class SurfaceData loops.drawPathLoop = DrawPath.locate(src, comp, dst); loops.fillPathLoop = FillPath.locate(src, comp, dst); loops.fillSpansLoop = FillSpans.locate(src, comp, dst); + loops.fillParallelogramLoop = FillParallelogram.locate(src, comp, dst); + loops.drawParallelogramLoop = DrawParallelogram.locate(src, comp, dst); loops.drawGlyphListLoop = DrawGlyphList.locate(src, comp, dst); loops.drawGlyphListAALoop = DrawGlyphListAA.locate(src, comp, dst); loops.drawGlyphListLCDLoop = DrawGlyphListLCD.locate(src, comp, dst); diff --git a/jdk/src/share/classes/sun/java2d/cmm/CMSManager.java b/jdk/src/share/classes/sun/java2d/cmm/CMSManager.java index a12db1882a2..a6df658796f 100644 --- a/jdk/src/share/classes/sun/java2d/cmm/CMSManager.java +++ b/jdk/src/share/classes/sun/java2d/cmm/CMSManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/java2d/cmm/lcms/LCMS.java b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java index 5f9a55ea7fd..4ce85425f8b 100644 --- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java +++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/java2d/cmm/lcms/LCMSTransform.java b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSTransform.java index 1c462a146e2..07b5e4a3cce 100644 --- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSTransform.java +++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSTransform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/java2d/loops/CompositeType.java b/jdk/src/share/classes/sun/java2d/loops/CompositeType.java index 7c47cb3cae8..ec6d6d8064c 100644 --- a/jdk/src/share/classes/sun/java2d/loops/CompositeType.java +++ b/jdk/src/share/classes/sun/java2d/loops/CompositeType.java @@ -27,6 +27,7 @@ package sun.java2d.loops; import java.awt.image.BufferedImage; import java.awt.AlphaComposite; +import java.util.HashMap; /** * A CompositeType object provides a chained description of a type of @@ -51,6 +52,11 @@ import java.awt.AlphaComposite; * the indicated algorithm if all of the more specific searches fail. */ public final class CompositeType { + + private static int unusedUID = 1; + private static final HashMap compositeUIDMap = + new HashMap(100); + /* * CONSTANTS USED BY ALL PRIMITIVES TO DESCRIBE THE COMPOSITING * ALGORITHMS THEY CAN PERFORM @@ -152,6 +158,22 @@ public final class CompositeType { public static final CompositeType SrcOverNoEa = SrcOver.deriveSubType(DESC_SRC_OVER_NO_EA); + /* + * A special CompositeType for the case where we are filling in + * SrcOverNoEa mode with an opaque color. In that case then the + * best loop for us to use would be a SrcNoEa loop, but what if + * there is no such loop? In that case then we would end up + * backing off to a Src loop (which should still be fine) or an + * AnyAlpha loop which would be slower than a SrcOver loop in + * most cases. + * The fix is to use the following chain which looks for loops + * in the following order: + * SrcNoEa, Src, SrcOverNoEa, SrcOver, AnyAlpha + */ + public static final CompositeType + OpaqueSrcOverNoEa = SrcOverNoEa.deriveSubType(DESC_SRC) + .deriveSubType(DESC_SRC_NO_EA); + /* * END OF CompositeType OBJECTS FOR THE VARIOUS CONSTANTS */ @@ -210,7 +232,6 @@ public final class CompositeType { } } - private static int unusedUID = 1; private int uniqueID; private String desc; private CompositeType next; @@ -218,14 +239,20 @@ public final class CompositeType { private CompositeType(CompositeType parent, String desc) { next = parent; this.desc = desc; - this.uniqueID = makeUniqueID(); + this.uniqueID = makeUniqueID(desc); } - private synchronized static final int makeUniqueID() { - if (unusedUID > 255) { - throw new InternalError("composite type id overflow"); + public synchronized static final int makeUniqueID(String desc) { + Integer i = compositeUIDMap.get(desc); + + if (i == null) { + if (unusedUID > 255) { + throw new InternalError("composite type id overflow"); + } + i = unusedUID++; + compositeUIDMap.put(desc, i); } - return unusedUID++; + return i; } public int getUniqueID() { diff --git a/jdk/src/share/classes/sun/java2d/loops/DrawParallelogram.java b/jdk/src/share/classes/sun/java2d/loops/DrawParallelogram.java new file mode 100644 index 00000000000..a936d49f3d7 --- /dev/null +++ b/jdk/src/share/classes/sun/java2d/loops/DrawParallelogram.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @author Jim Graham + */ + +package sun.java2d.loops; + +import sun.java2d.loops.GraphicsPrimitive; +import sun.java2d.SunGraphics2D; +import sun.java2d.SurfaceData; + +/** + * DrawParallelogram + * 1) fill the area between the 4 edges of an outer parallelogram + * (as specified by an origin and 2 delta vectors) + * but also outside the 4 edges of an inner parallelogram + * (as specified by proportional amounts of the outer delta vectors) + */ +public class DrawParallelogram extends GraphicsPrimitive +{ + public final static String methodSignature = + "DrawParallelogram(...)".toString(); + + public final static int primTypeID = makePrimTypeID(); + + public static DrawParallelogram locate(SurfaceType srctype, + CompositeType comptype, + SurfaceType dsttype) + { + return (DrawParallelogram) + GraphicsPrimitiveMgr.locate(primTypeID, + srctype, comptype, dsttype); + } + + protected DrawParallelogram(SurfaceType srctype, + CompositeType comptype, + SurfaceType dsttype) + { + super(methodSignature, primTypeID, + srctype, comptype, dsttype); + } + + public DrawParallelogram(long pNativePrim, + SurfaceType srctype, + CompositeType comptype, + SurfaceType dsttype) + { + super(pNativePrim, methodSignature, primTypeID, + srctype, comptype, dsttype); + } + + /** + * All DrawParallelogram implementors must have this invoker method + */ + public native void DrawParallelogram(SunGraphics2D sg, SurfaceData dest, + double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2); + + public GraphicsPrimitive makePrimitive(SurfaceType srctype, + CompositeType comptype, + SurfaceType dsttype) + { + // REMIND: iterate with a FillRect primitive? + throw new InternalError("DrawParallelogram not implemented for "+ + srctype+" with "+comptype); + } + + public GraphicsPrimitive traceWrap() { + return new TraceDrawParallelogram(this); + } + + private static class TraceDrawParallelogram extends DrawParallelogram { + DrawParallelogram target; + + public TraceDrawParallelogram(DrawParallelogram target) { + super(target.getSourceType(), + target.getCompositeType(), + target.getDestType()); + this.target = target; + } + + public GraphicsPrimitive traceWrap() { + return this; + } + + public void DrawParallelogram(SunGraphics2D sg2d, SurfaceData dest, + double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2) + { + tracePrimitive(target); + target.DrawParallelogram(sg2d, dest, + x, y, dx1, dy1, dx2, dy2, lw1, lw2); + } + } +} diff --git a/jdk/src/share/classes/sun/java2d/loops/FillParallelogram.java b/jdk/src/share/classes/sun/java2d/loops/FillParallelogram.java new file mode 100644 index 00000000000..54138340162 --- /dev/null +++ b/jdk/src/share/classes/sun/java2d/loops/FillParallelogram.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @author Jim Graham + */ + +package sun.java2d.loops; + +import sun.java2d.loops.GraphicsPrimitive; +import sun.java2d.SunGraphics2D; +import sun.java2d.SurfaceData; + +/** + * FillParallelogram + * 1) fill the area between the 4 edges of a parallelogram + * (as specified by an origin and 2 delta vectors) + */ +public class FillParallelogram extends GraphicsPrimitive +{ + public final static String methodSignature = + "FillParallelogram(...)".toString(); + + public final static int primTypeID = makePrimTypeID(); + + public static FillParallelogram locate(SurfaceType srctype, + CompositeType comptype, + SurfaceType dsttype) + { + return (FillParallelogram) + GraphicsPrimitiveMgr.locate(primTypeID, + srctype, comptype, dsttype); + } + + protected FillParallelogram(SurfaceType srctype, + CompositeType comptype, + SurfaceType dsttype) + { + super(methodSignature, primTypeID, + srctype, comptype, dsttype); + } + + public FillParallelogram(long pNativePrim, + SurfaceType srctype, + CompositeType comptype, + SurfaceType dsttype) + { + super(pNativePrim, methodSignature, primTypeID, + srctype, comptype, dsttype); + } + + /** + * All FillParallelogram implementors must have this invoker method + */ + public native void FillParallelogram(SunGraphics2D sg2d, SurfaceData dest, + double x0, double y0, + double dx1, double dy1, + double dx2, double dy2); + + public GraphicsPrimitive makePrimitive(SurfaceType srctype, + CompositeType comptype, + SurfaceType dsttype) + { + // REMIND: iterate with a FillRect primitive? + throw new InternalError("FillParallelogram not implemented for "+ + srctype+" with "+comptype); + } + + public GraphicsPrimitive traceWrap() { + return new TraceFillParallelogram(this); + } + + private static class TraceFillParallelogram extends FillParallelogram { + FillParallelogram target; + + public TraceFillParallelogram(FillParallelogram target) { + super(target.getSourceType(), + target.getCompositeType(), + target.getDestType()); + this.target = target; + } + + public GraphicsPrimitive traceWrap() { + return this; + } + + public void FillParallelogram(SunGraphics2D sg2d, SurfaceData dest, + double x0, double y0, + double dx1, double dy1, + double dx2, double dy2) + { + tracePrimitive(target); + target.FillParallelogram(sg2d, dest, x0, y0, dx1, dy1, dx2, dy2); + } + } +} diff --git a/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java b/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java index bbe598f2c3a..664d5ff7e47 100644 --- a/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java +++ b/jdk/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/java2d/loops/MaskFill.java b/jdk/src/share/classes/sun/java2d/loops/MaskFill.java index f3807ffd8bd..557da13c848 100644 --- a/jdk/src/share/classes/sun/java2d/loops/MaskFill.java +++ b/jdk/src/share/classes/sun/java2d/loops/MaskFill.java @@ -50,6 +50,10 @@ import sun.java2d.SurfaceData; public class MaskFill extends GraphicsPrimitive { public static final String methodSignature = "MaskFill(...)".toString(); + public static final String fillPgramSignature = + "FillAAPgram(...)".toString(); + public static final String drawPgramSignature = + "DrawAAPgram(...)".toString(); public static final int primTypeID = makePrimTypeID(); @@ -92,6 +96,14 @@ public class MaskFill extends GraphicsPrimitive return fill; } + protected MaskFill(String alternateSignature, + SurfaceType srctype, + CompositeType comptype, + SurfaceType dsttype) + { + super(alternateSignature, primTypeID, srctype, comptype, dsttype); + } + protected MaskFill(SurfaceType srctype, CompositeType comptype, SurfaceType dsttype) @@ -115,6 +127,23 @@ public class MaskFill extends GraphicsPrimitive int x, int y, int w, int h, byte[] mask, int maskoff, int maskscan); + public native void FillAAPgram(SunGraphics2D sg2d, SurfaceData sData, + Composite comp, + double x, double y, + double dx1, double dy1, + double dx2, double dy2); + + public native void DrawAAPgram(SunGraphics2D sg2d, SurfaceData sData, + Composite comp, + double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2); + + public boolean canDoParallelograms() { + return (getNativePrim() != 0); + } + static { GraphicsPrimitiveMgr.registerGeneral(new MaskFill(null, null, null)); } @@ -182,12 +211,22 @@ public class MaskFill extends GraphicsPrimitive private static class TraceMaskFill extends MaskFill { MaskFill target; + MaskFill fillPgramTarget; + MaskFill drawPgramTarget; public TraceMaskFill(MaskFill target) { super(target.getSourceType(), target.getCompositeType(), target.getDestType()); this.target = target; + this.fillPgramTarget = new MaskFill(fillPgramSignature, + target.getSourceType(), + target.getCompositeType(), + target.getDestType()); + this.drawPgramTarget = new MaskFill(drawPgramSignature, + target.getSourceType(), + target.getCompositeType(), + target.getDestType()); } public GraphicsPrimitive traceWrap() { @@ -203,5 +242,32 @@ public class MaskFill extends GraphicsPrimitive target.MaskFill(sg2d, sData, comp, x, y, w, h, mask, maskoff, maskscan); } + + public void FillAAPgram(SunGraphics2D sg2d, SurfaceData sData, + Composite comp, + double x, double y, + double dx1, double dy1, + double dx2, double dy2) + { + tracePrimitive(fillPgramTarget); + target.FillAAPgram(sg2d, sData, comp, + x, y, dx1, dy1, dx2, dy2); + } + + public void DrawAAPgram(SunGraphics2D sg2d, SurfaceData sData, + Composite comp, + double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2) + { + tracePrimitive(drawPgramTarget); + target.DrawAAPgram(sg2d, sData, comp, + x, y, dx1, dy1, dx2, dy2, lw1, lw2); + } + + public boolean canDoParallelograms() { + return target.canDoParallelograms(); + } } } diff --git a/jdk/src/share/classes/sun/java2d/loops/RenderLoops.java b/jdk/src/share/classes/sun/java2d/loops/RenderLoops.java index 350914b42db..3b5a2a69ec1 100644 --- a/jdk/src/share/classes/sun/java2d/loops/RenderLoops.java +++ b/jdk/src/share/classes/sun/java2d/loops/RenderLoops.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ public class RenderLoops { public DrawPath drawPathLoop; public FillPath fillPathLoop; public FillSpans fillSpansLoop; + public FillParallelogram fillParallelogramLoop; + public DrawParallelogram drawParallelogramLoop; public DrawGlyphList drawGlyphListLoop; public DrawGlyphListAA drawGlyphListAALoop; public DrawGlyphListLCD drawGlyphListLCDLoop; diff --git a/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java b/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java index 9edff382b0f..8654bede25c 100644 --- a/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java +++ b/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java @@ -28,6 +28,7 @@ package sun.java2d.pipe; import java.awt.BasicStroke; import java.awt.Rectangle; import java.awt.Shape; +import java.awt.geom.Rectangle2D; import java.awt.geom.PathIterator; import sun.awt.SunHints; import sun.java2d.SunGraphics2D; @@ -39,7 +40,9 @@ import sun.java2d.SunGraphics2D; * This class sets up the Generator and computes the alpha tiles * and then passes them on to a CompositePipe object for painting. */ -public class AAShapePipe implements ShapeDrawPipe { +public class AAShapePipe + implements ShapeDrawPipe, ParallelogramPipe +{ static RenderingEngine renderengine = RenderingEngine.getInstance(); CompositePipe outpipe; @@ -65,6 +68,59 @@ public class AAShapePipe implements ShapeDrawPipe { renderPath(sg, s, null); } + private static Rectangle2D computeBBox(double x, double y, + double dx1, double dy1, + double dx2, double dy2) + { + double lox, loy, hix, hiy; + lox = hix = x; + loy = hiy = y; + if (dx1 < 0) { lox += dx1; } else { hix += dx1; } + if (dy1 < 0) { loy += dy1; } else { hiy += dy1; } + if (dx2 < 0) { lox += dx2; } else { hix += dx2; } + if (dy2 < 0) { loy += dy2; } else { hiy += dy2; } + return new Rectangle2D.Double(lox, loy, hix-lox, hiy-loy); + } + + public void fillParallelogram(SunGraphics2D sg, + double x, double y, + double dx1, double dy1, + double dx2, double dy2) + { + Region clip = sg.getCompClip(); + int abox[] = new int[4]; + AATileGenerator aatg = + renderengine.getAATileGenerator(x, y, dx1, dy1, dx2, dy2, 0, 0, + clip, abox); + if (aatg == null) { + // Nothing to render + return; + } + + renderTiles(sg, computeBBox(x, y, dx1, dy1, dx2, dy2), aatg, abox); + } + + public void drawParallelogram(SunGraphics2D sg, + double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2) + { + Region clip = sg.getCompClip(); + int abox[] = new int[4]; + AATileGenerator aatg = + renderengine.getAATileGenerator(x, y, dx1, dy1, dx2, dy2, 0, 0, + clip, abox); + if (aatg == null) { + // Nothing to render + return; + } + + // Note that bbox is of the original shape, not the wide path. + // This is appropriate for handing to Paint methods... + renderTiles(sg, computeBBox(x, y, dx1, dy1, dx2, dy2), aatg, abox); + } + private static byte[] theTile; public synchronized static byte[] getAlphaTile(int len) { @@ -85,8 +141,6 @@ public class AAShapePipe implements ShapeDrawPipe { boolean adjust = (bs != null && sg.strokeHint != SunHints.INTVAL_STROKE_PURE); boolean thin = (sg.strokeState <= sg.STROKE_THINDASHED); - Object context = null; - byte alpha[] = null; Region clip = sg.getCompClip(); int abox[] = new int[4]; @@ -98,6 +152,14 @@ public class AAShapePipe implements ShapeDrawPipe { return; } + renderTiles(sg, s, aatg, abox); + } + + public void renderTiles(SunGraphics2D sg, Shape s, + AATileGenerator aatg, int abox[]) + { + Object context = null; + byte alpha[] = null; try { context = outpipe.startSequence(sg, s, new Rectangle(abox[0], abox[1], diff --git a/jdk/src/share/classes/sun/java2d/pipe/AlphaColorPipe.java b/jdk/src/share/classes/sun/java2d/pipe/AlphaColorPipe.java index 28c335307ba..745bdf9bc5a 100644 --- a/jdk/src/share/classes/sun/java2d/pipe/AlphaColorPipe.java +++ b/jdk/src/share/classes/sun/java2d/pipe/AlphaColorPipe.java @@ -34,7 +34,7 @@ import sun.java2d.SunGraphics2D; * into a destination that supports direct alpha compositing of a solid * color, according to one of the rules in the AlphaComposite class. */ -public class AlphaColorPipe implements CompositePipe { +public class AlphaColorPipe implements CompositePipe, ParallelogramPipe { public AlphaColorPipe() { } @@ -64,4 +64,23 @@ public class AlphaColorPipe implements CompositePipe { public void endSequence(Object context) { return; } + + public void fillParallelogram(SunGraphics2D sg, + double x, double y, + double dx1, double dy1, + double dx2, double dy2) + { + sg.alphafill.FillAAPgram(sg, sg.getSurfaceData(), sg.composite, + x, y, dx1, dy1, dx2, dy2); + } + + public void drawParallelogram(SunGraphics2D sg, + double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2) + { + sg.alphafill.DrawAAPgram(sg, sg.getSurfaceData(), sg.composite, + x, y, dx1, dy1, dx2, dy2, lw1, lw2); + } } diff --git a/jdk/src/share/classes/sun/java2d/pipe/BufferedPaints.java b/jdk/src/share/classes/sun/java2d/pipe/BufferedPaints.java index 7f5fc1d047e..87ff6490bfd 100644 --- a/jdk/src/share/classes/sun/java2d/pipe/BufferedPaints.java +++ b/jdk/src/share/classes/sun/java2d/pipe/BufferedPaints.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/java2d/pipe/LoopPipe.java b/jdk/src/share/classes/sun/java2d/pipe/LoopPipe.java index b50b5529b1e..652239d784a 100644 --- a/jdk/src/share/classes/sun/java2d/pipe/LoopPipe.java +++ b/jdk/src/share/classes/sun/java2d/pipe/LoopPipe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 @@ import sun.java2d.SunGraphics2D; import sun.java2d.SurfaceData; import sun.java2d.loops.FontInfo; import sun.java2d.loops.DrawPolygons; +import sun.java2d.loops.FillParallelogram; +import sun.java2d.loops.DrawParallelogram; import sun.awt.SunHints; public class LoopPipe implements PixelDrawPipe, PixelFillPipe, + ParallelogramPipe, ShapeDrawPipe, LoopBasedPipe { @@ -347,4 +350,25 @@ public class LoopPipe sg2d.loops.fillRectLoop.FillRect(sg2d, sd, x, y, w, h); } } + + public void fillParallelogram(SunGraphics2D sg2d, + double x, double y, + double dx1, double dy1, + double dx2, double dy2) + { + FillParallelogram fp = sg2d.loops.fillParallelogramLoop; + fp.FillParallelogram(sg2d, sg2d.getSurfaceData(), + x, y, dx1, dy1, dx2, dy2); + } + + public void drawParallelogram(SunGraphics2D sg2d, + double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2) + { + DrawParallelogram dp = sg2d.loops.drawParallelogramLoop; + dp.DrawParallelogram(sg2d, sg2d.getSurfaceData(), + x, y, dx1, dy1, dx2, dy2, lw1, lw2); + } } diff --git a/jdk/src/share/classes/sun/java2d/pipe/RenderBuffer.java b/jdk/src/share/classes/sun/java2d/pipe/RenderBuffer.java index 6d207ee30ae..e7ba6c720da 100644 --- a/jdk/src/share/classes/sun/java2d/pipe/RenderBuffer.java +++ b/jdk/src/share/classes/sun/java2d/pipe/RenderBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/java2d/pipe/RenderingEngine.java b/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java index bda742fc6ec..171da288ba3 100644 --- a/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java +++ b/jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java @@ -280,6 +280,72 @@ public abstract class RenderingEngine { boolean normalize, int bbox[]); + /** + * Construct an antialiased tile generator for the given parallelogram + * store the bounds of the tile iteration in the bbox parameter. + * The parallelogram is specified as a starting point and 2 delta + * vectors that indicate the slopes of the 2 pairs of sides of the + * parallelogram. + * The 4 corners of the parallelogram are defined by the 4 points: + *
        + *
      • {@code x}, {@code y} + *
      • {@code x+dx1}, {@code y+dy1} + *
      • {@code x+dx1+dx2}, {@code y+dy1+dy2} + *
      • {@code x+dx2}, {@code y+dy2} + *
      + * The {@code lw1} and {@code lw2} parameters provide a specification + * for an optionally stroked parallelogram if they are positive numbers. + * The {@code lw1} parameter is the ratio of the length of the {@code dx1}, + * {@code dx2} delta vector to half of the line width in that same + * direction. + * The {@code lw2} parameter provides the same ratio for the other delta + * vector. + * If {@code lw1} and {@code lw2} are both greater than zero, then + * the parallelogram figure is doubled by both expanding and contracting + * each delta vector by its corresponding {@code lw} value. + * If either (@code lw1) or {@code lw2} are also greater than 1, then + * the inner (contracted) parallelogram disappears and the figure is + * simply a single expanded parallelogram. + * The {@code clip} parameter specifies the current clip in effect + * in device coordinates and can be used to prune the data for the + * operation, but the renderer is not required to perform any + * clipping. + *

      + * Upon returning, this method will fill the {@code bbox} parameter + * with 4 values indicating the bounds of the iteration of the + * tile generator. + * The iteration order of the tiles will be as specified by the + * pseudo-code: + *

      +     *     for (y = bbox[1]; y < bbox[3]; y += tileheight) {
      +     *         for (x = bbox[0]; x < bbox[2]; x += tilewidth) {
      +     *         }
      +     *     }
      +     * 
      + * If there is no output to be rendered, this method may return + * null. + * + * @param x the X coordinate of the first corner of the parallelogram + * @param y the Y coordinate of the first corner of the parallelogram + * @param dx1 the X coordinate delta of the first leg of the parallelogram + * @param dy1 the Y coordinate delta of the first leg of the parallelogram + * @param dx2 the X coordinate delta of the second leg of the parallelogram + * @param dy2 the Y coordinate delta of the second leg of the parallelogram + * @param lw1 the line width ratio for the first leg of the parallelogram + * @param lw2 the line width ratio for the second leg of the parallelogram + * @param clip the current clip in effect in device coordinates + * @param bbox returns the bounds of the iteration + * @return the {@code AATileGenerator} instance to be consulted + * for tile coverages, or null if there is no output to render + * @since 1.7 + */ + public abstract AATileGenerator getAATileGenerator(double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2, + Region clip, + int bbox[]); + /** * Returns the minimum pen width that the antialiasing rasterizer * can represent without dropouts occuring. @@ -393,5 +459,24 @@ public abstract class RenderingEngine { bs, thin, normalize, bbox); } + public AATileGenerator getAATileGenerator(double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2, + Region clip, + int bbox[]) + { + System.out.println(name+".getAATileGenerator("+ + x+", "+y+", "+ + dx1+", "+dy1+", "+ + dx2+", "+dy2+", "+ + lw1+", "+lw2+", "+ + clip+")"); + return target.getAATileGenerator(x, y, + dx1, dy1, + dx2, dy2, + lw1, lw2, + clip, bbox); + } } } diff --git a/jdk/src/share/classes/sun/java2d/pisces/Curve.java b/jdk/src/share/classes/sun/java2d/pisces/Curve.java new file mode 100644 index 00000000000..e613a264cbf --- /dev/null +++ b/jdk/src/share/classes/sun/java2d/pisces/Curve.java @@ -0,0 +1,294 @@ +/* + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.pisces; + +import java.util.Iterator; + +class Curve { + + float ax, ay, bx, by, cx, cy, dx, dy; + float dax, day, dbx, dby; + + Curve() { + } + + void set(float[] points, int type) { + switch(type) { + case 8: + set(points[0], points[1], + points[2], points[3], + points[4], points[5], + points[6], points[7]); + break; + case 6: + set(points[0], points[1], + points[2], points[3], + points[4], points[5]); + break; + default: + throw new InternalError("Curves can only be cubic or quadratic"); + } + } + + void set(float x1, float y1, + float x2, float y2, + float x3, float y3, + float x4, float y4) + { + ax = 3 * (x2 - x3) + x4 - x1; + ay = 3 * (y2 - y3) + y4 - y1; + bx = 3 * (x1 - 2 * x2 + x3); + by = 3 * (y1 - 2 * y2 + y3); + cx = 3 * (x2 - x1); + cy = 3 * (y2 - y1); + dx = x1; + dy = y1; + dax = 3 * ax; day = 3 * ay; + dbx = 2 * bx; dby = 2 * by; + } + + void set(float x1, float y1, + float x2, float y2, + float x3, float y3) + { + ax = ay = 0f; + + bx = x1 - 2 * x2 + x3; + by = y1 - 2 * y2 + y3; + cx = 2 * (x2 - x1); + cy = 2 * (y2 - y1); + dx = x1; + dy = y1; + dax = 0; day = 0; + dbx = 2 * bx; dby = 2 * by; + } + + float xat(float t) { + return t * (t * (t * ax + bx) + cx) + dx; + } + float yat(float t) { + return t * (t * (t * ay + by) + cy) + dy; + } + + float dxat(float t) { + return t * (t * dax + dbx) + cx; + } + + float dyat(float t) { + return t * (t * day + dby) + cy; + } + + private float ddxat(float t) { + return 2 * dax * t + dbx; + } + + private float ddyat(float t) { + return 2 * day * t + dby; + } + + int dxRoots(float[] roots, int off) { + return Helpers.quadraticRoots(dax, dbx, cx, roots, off); + } + + int dyRoots(float[] roots, int off) { + return Helpers.quadraticRoots(day, dby, cy, roots, off); + } + + int infPoints(float[] pts, int off) { + // inflection point at t if -f'(t)x*f''(t)y + f'(t)y*f''(t)x == 0 + // Fortunately, this turns out to be quadratic, so there are at + // most 2 inflection points. + final float a = dax * dby - dbx * day; + final float b = 2 * (cy * dax - day * cx); + final float c = cy * dbx - cx * dby; + + return Helpers.quadraticRoots(a, b, c, pts, off); + } + + // finds points where the first and second derivative are + // perpendicular. This happens when g(t) = f'(t)*f''(t) == 0 (where + // * is a dot product). Unfortunately, we have to solve a cubic. + private int perpendiculardfddf(float[] pts, int off, final float err) { + assert pts.length >= off + 4; + + // these are the coefficients of g(t): + final float a = 2*(dax*dax + day*day); + final float b = 3*(dax*dbx + day*dby); + final float c = 2*(dax*cx + day*cy) + dbx*dbx + dby*dby; + final float d = dbx*cx + dby*cy; + // TODO: We might want to divide the polynomial by a to make the + // coefficients smaller. This won't change the roots. + return Helpers.cubicRootsInAB(a, b, c, d, pts, off, err, 0f, 1f); + } + + // Tries to find the roots of the function ROC(t)-w in [0, 1). It uses + // a variant of the false position algorithm to find the roots. False + // position requires that 2 initial values x0,x1 be given, and that the + // function must have opposite signs at those values. To find such + // values, we need the local extrema of the ROC function, for which we + // need the roots of its derivative; however, it's harder to find the + // roots of the derivative in this case than it is to find the roots + // of the original function. So, we find all points where this curve's + // first and second derivative are perpendicular, and we pretend these + // are our local extrema. There are at most 3 of these, so we will check + // at most 4 sub-intervals of (0,1). ROC has asymptotes at inflection + // points, so roc-w can have at least 6 roots. This shouldn't be a + // problem for what we're trying to do (draw a nice looking curve). + int rootsOfROCMinusW(float[] roots, int off, final float w, final float err) { + // no OOB exception, because by now off<=6, and roots.length >= 10 + assert off <= 6 && roots.length >= 10; + int ret = off; + int numPerpdfddf = perpendiculardfddf(roots, off, err); + float t0 = 0, ft0 = ROCsq(t0) - w*w; + roots[off + numPerpdfddf] = 1f; // always check interval end points + numPerpdfddf++; + for (int i = off; i < off + numPerpdfddf; i++) { + float t1 = roots[i], ft1 = ROCsq(t1) - w*w; + if (ft0 == 0f) { + roots[ret++] = t0; + } else if (ft1 * ft0 < 0f) { // have opposite signs + // (ROC(t)^2 == w^2) == (ROC(t) == w) is true because + // ROC(t) >= 0 for all t. + roots[ret++] = falsePositionROCsqMinusX(t0, t1, w*w, err); + } + t0 = t1; + ft0 = ft1; + } + + return ret - off; + } + + private static float eliminateInf(float x) { + return (x == Float.POSITIVE_INFINITY ? Float.MAX_VALUE : + (x == Float.NEGATIVE_INFINITY ? Float.MIN_VALUE : x)); + } + + // A slight modification of the false position algorithm on wikipedia. + // This only works for the ROCsq-x functions. It might be nice to have + // the function as an argument, but that would be awkward in java6. + // It is something to consider for java7, depending on how closures + // and function objects turn out. Same goes for the newton's method + // algorithm in Helpers.java + private float falsePositionROCsqMinusX(float x0, float x1, + final float x, final float err) + { + final int iterLimit = 100; + int side = 0; + float t = x1, ft = eliminateInf(ROCsq(t) - x); + float s = x0, fs = eliminateInf(ROCsq(s) - x); + float r = s, fr; + for (int i = 0; i < iterLimit && Math.abs(t - s) > err * Math.abs(t + s); i++) { + r = (fs * t - ft * s) / (fs - ft); + fr = ROCsq(r) - x; + if (fr * ft > 0) {// have the same sign + ft = fr; t = r; + if (side < 0) { + fs /= (1 << (-side)); + side--; + } else { + side = -1; + } + } else if (fr * fs > 0) { + fs = fr; s = r; + if (side > 0) { + ft /= (1 << side); + side++; + } else { + side = 1; + } + } else { + break; + } + } + return r; + } + + // returns the radius of curvature squared at t of this curve + // see http://en.wikipedia.org/wiki/Radius_of_curvature_(applications) + private float ROCsq(final float t) { + final float dx = dxat(t); + final float dy = dyat(t); + final float ddx = ddxat(t); + final float ddy = ddyat(t); + final float dx2dy2 = dx*dx + dy*dy; + final float ddx2ddy2 = ddx*ddx + ddy*ddy; + final float ddxdxddydy = ddx*dx + ddy*dy; + float ret = ((dx2dy2*dx2dy2) / (dx2dy2 * ddx2ddy2 - ddxdxddydy*ddxdxddydy))*dx2dy2; + return ret; + } + + // curve to be broken should be in pts[0] + // this will change the contents of both pts and Ts + // TODO: There's no reason for Ts to be an array. All we need is a sequence + // of t values at which to subdivide. An array statisfies this condition, + // but is unnecessarily restrictive. Ts should be an Iterator instead. + // Doing this will also make dashing easier, since we could easily make + // LengthIterator an Iterator and feed it to this function to simplify + // the loop in Dasher.somethingTo. + static Iterator breakPtsAtTs(final float[][] pts, final int type, + final float[] Ts, final int numTs) + { + assert pts.length >= 2 && pts[0].length >= 8 && numTs <= Ts.length; + return new Iterator() { + int nextIdx = 0; + int nextCurveIdx = 0; + float prevT = 0; + + @Override public boolean hasNext() { + return nextCurveIdx < numTs + 1; + } + + @Override public float[] next() { + float[] ret; + if (nextCurveIdx < numTs) { + float curT = Ts[nextCurveIdx]; + float splitT = (curT - prevT) / (1 - prevT); + Helpers.subdivideAt(splitT, + pts[nextIdx], 0, + pts[nextIdx], 0, + pts[1-nextIdx], 0, type); + updateTs(Ts, Ts[nextCurveIdx], nextCurveIdx + 1, numTs - nextCurveIdx - 1); + ret = pts[nextIdx]; + nextIdx = 1 - nextIdx; + } else { + ret = pts[nextIdx]; + } + nextCurveIdx++; + return ret; + } + + @Override public void remove() {} + }; + } + + // precondition: ts[off]...ts[off+len-1] must all be greater than t. + private static void updateTs(float[] ts, final float t, final int off, final int len) { + for (int i = off; i < off + len; i++) { + ts[i] = (ts[i] - t) / (1 - t); + } + } +} + diff --git a/jdk/src/share/classes/sun/java2d/pisces/Dasher.java b/jdk/src/share/classes/sun/java2d/pisces/Dasher.java index f5b5e049143..0dd75a3c0a9 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/Dasher.java +++ b/jdk/src/share/classes/sun/java2d/pisces/Dasher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ package sun.java2d.pisces; +import sun.awt.geom.PathConsumer2D; + /** * The Dasher class takes a series of linear commands * (moveTo, lineTo, close and @@ -36,18 +38,16 @@ package sun.java2d.pisces; * semantics are unclear. * */ -public class Dasher implements LineSink { - private final LineSink output; +public class Dasher implements sun.awt.geom.PathConsumer2D { + + private final PathConsumer2D out; private final float[] dash; private final float startPhase; private final boolean startDashOn; private final int startIdx; - private final float m00, m10, m01, m11; - private final float det; - - private boolean firstDashOn; private boolean starting; + private boolean needsMoveTo; private int idx; private boolean dashOn; @@ -55,28 +55,23 @@ public class Dasher implements LineSink { private float sx, sy; private float x0, y0; - private float sx1, sy1; + // temporary storage for the current curve + private float[] curCurvepts; /** * Constructs a Dasher. * - * @param output an output LineSink. - * @param dash an array of ints containing the dash pattern - * @param phase an int containing the dash phase - * @param transform a Transform4 object indicating - * the transform that has been previously applied to all incoming - * coordinates. This is required in order to compute dash lengths - * properly. + * @param out an output PathConsumer2D. + * @param dash an array of floats containing the dash pattern + * @param phase a float containing the dash phase */ - public Dasher(LineSink output, - float[] dash, float phase, - float a00, float a01, float a10, float a11) { + public Dasher(PathConsumer2D out, float[] dash, float phase) { if (phase < 0) { throw new IllegalArgumentException("phase < 0 !"); } - this.output = output; + this.out = out; // Normalize so 0 <= phase < dash[0] int idx = 0; @@ -92,16 +87,19 @@ public class Dasher implements LineSink { this.startPhase = this.phase = phase; this.startDashOn = dashOn; this.startIdx = idx; + this.starting = true; - m00 = a00; - m01 = a01; - m10 = a10; - m11 = a11; - det = m00 * m11 - m01 * m10; + // we need curCurvepts to be able to contain 2 curves because when + // dashing curves, we need to subdivide it + curCurvepts = new float[8 * 2]; } public void moveTo(float x0, float y0) { - output.moveTo(x0, y0); + if (firstSegidx > 0) { + out.moveTo(sx, sy); + emitFirstSegments(); + } + needsMoveTo = true; this.idx = startIdx; this.dashOn = this.startDashOn; this.phase = this.startPhase; @@ -110,88 +108,108 @@ public class Dasher implements LineSink { this.starting = true; } - public void lineJoin() { - output.lineJoin(); + private void emitSeg(float[] buf, int off, int type) { + switch (type) { + case 8: + out.curveTo(buf[off+0], buf[off+1], + buf[off+2], buf[off+3], + buf[off+4], buf[off+5]); + break; + case 6: + out.quadTo(buf[off+0], buf[off+1], + buf[off+2], buf[off+3]); + break; + case 4: + out.lineTo(buf[off], buf[off+1]); + } } - private void goTo(float x1, float y1) { + private void emitFirstSegments() { + for (int i = 0; i < firstSegidx; ) { + emitSeg(firstSegmentsBuffer, i+1, (int)firstSegmentsBuffer[i]); + i += (((int)firstSegmentsBuffer[i]) - 1); + } + firstSegidx = 0; + } + + // We don't emit the first dash right away. If we did, caps would be + // drawn on it, but we need joins to be drawn if there's a closePath() + // So, we store the path elements that make up the first dash in the + // buffer below. + private float[] firstSegmentsBuffer = new float[7]; + private int firstSegidx = 0; + // precondition: pts must be in relative coordinates (relative to x0,y0) + // fullCurve is true iff the curve in pts has not been split. + private void goTo(float[] pts, int off, final int type) { + float x = pts[off + type - 4]; + float y = pts[off + type - 3]; if (dashOn) { if (starting) { - this.sx1 = x1; - this.sy1 = y1; - firstDashOn = true; - starting = false; + firstSegmentsBuffer = Helpers.widenArray(firstSegmentsBuffer, + firstSegidx, type - 2); + firstSegmentsBuffer[firstSegidx++] = type; + System.arraycopy(pts, off, firstSegmentsBuffer, firstSegidx, type - 2); + firstSegidx += type - 2; + } else { + if (needsMoveTo) { + out.moveTo(x0, y0); + needsMoveTo = false; + } + emitSeg(pts, off, type); } - output.lineTo(x1, y1); } else { - if (starting) { - firstDashOn = false; - starting = false; - } - output.moveTo(x1, y1); + starting = false; + needsMoveTo = true; } - this.x0 = x1; - this.y0 = y1; + this.x0 = x; + this.y0 = y; } public void lineTo(float x1, float y1) { - // The widened line is squished to a 0 width one, so no drawing is done - if (det == 0) { - goTo(x1, y1); - return; - } float dx = x1 - x0; float dy = y1 - y0; + float len = (float) Math.hypot(dx, dy); - // Compute segment length in the untransformed - // coordinate system - - float la = (dy*m00 - dx*m10)/det; - float lb = (dy*m01 - dx*m11)/det; - float origLen = (float) Math.hypot(la, lb); - - if (origLen == 0) { - // Let the output LineSink deal with cases where dx, dy are 0. - goTo(x1, y1); + if (len == 0) { return; } // The scaling factors needed to get the dx and dy of the // transformed dash segments. - float cx = dx / origLen; - float cy = dy / origLen; + float cx = dx / len; + float cy = dy / len; while (true) { float leftInThisDashSegment = dash[idx] - phase; - if (origLen < leftInThisDashSegment) { - goTo(x1, y1); + if (len <= leftInThisDashSegment) { + curCurvepts[0] = x1; + curCurvepts[1] = y1; + goTo(curCurvepts, 0, 4); // Advance phase within current dash segment - phase += origLen; - return; - } else if (origLen == leftInThisDashSegment) { - goTo(x1, y1); - phase = 0f; - idx = (idx + 1) % dash.length; - dashOn = !dashOn; + phase += len; + if (len == leftInThisDashSegment) { + phase = 0f; + idx = (idx + 1) % dash.length; + dashOn = !dashOn; + } return; } - float dashx, dashy; float dashdx = dash[idx] * cx; float dashdy = dash[idx] * cy; if (phase == 0) { - dashx = x0 + dashdx; - dashy = y0 + dashdy; + curCurvepts[0] = x0 + dashdx; + curCurvepts[1] = y0 + dashdy; } else { - float p = (leftInThisDashSegment) / dash[idx]; - dashx = x0 + p * dashdx; - dashy = y0 + p * dashdy; + float p = leftInThisDashSegment / dash[idx]; + curCurvepts[0] = x0 + p * dashdx; + curCurvepts[1] = y0 + p * dashdy; } - goTo(dashx, dashy); + goTo(curCurvepts, 0, 4); - origLen -= (dash[idx] - phase); + len -= leftInThisDashSegment; // Advance to next dash segment idx = (idx + 1) % dash.length; dashOn = !dashOn; @@ -199,15 +217,289 @@ public class Dasher implements LineSink { } } + private LengthIterator li = null; - public void close() { - lineTo(sx, sy); - if (firstDashOn) { - output.lineTo(sx1, sy1); + // preconditions: curCurvepts must be an array of length at least 2 * type, + // that contains the curve we want to dash in the first type elements + private void somethingTo(int type) { + if (pointCurve(curCurvepts, type)) { + return; + } + if (li == null) { + li = new LengthIterator(4, 0.0001f); + } + li.initializeIterationOnCurve(curCurvepts, type); + + int curCurveoff = 0; // initially the current curve is at curCurvepts[0...type] + float lastSplitT = 0; + float t = 0; + float leftInThisDashSegment = dash[idx] - phase; + while ((t = li.next(leftInThisDashSegment)) < 1) { + if (t != 0) { + Helpers.subdivideAt((t - lastSplitT) / (1 - lastSplitT), + curCurvepts, curCurveoff, + curCurvepts, 0, + curCurvepts, type, type); + lastSplitT = t; + goTo(curCurvepts, 2, type); + curCurveoff = type; + } + // Advance to next dash segment + idx = (idx + 1) % dash.length; + dashOn = !dashOn; + phase = 0; + leftInThisDashSegment = dash[idx]; + } + goTo(curCurvepts, curCurveoff+2, type); + phase += li.lastSegLen(); + if (phase >= dash[idx]) { + phase = 0f; + idx = (idx + 1) % dash.length; + dashOn = !dashOn; } } - public void end() { - output.end(); + private static boolean pointCurve(float[] curve, int type) { + for (int i = 2; i < type; i++) { + if (curve[i] != curve[i-2]) { + return false; + } + } + return true; + } + + // Objects of this class are used to iterate through curves. They return + // t values where the left side of the curve has a specified length. + // It does this by subdividing the input curve until a certain error + // condition has been met. A recursive subdivision procedure would + // return as many as 1< 0) { + this.sides[0] = Side.LEFT; + this.done = false; + } else { + // the root of the tree is a leaf so we're done. + this.sides[0] = Side.RIGHT; + this.done = true; + } + this.lastSegLen = 0; + } + + // returns the t value where the remaining curve should be split in + // order for the left subdivided curve to have length len. If len + // is >= than the length of the uniterated curve, it returns 1. + public float next(float len) { + float targetLength = lenAtLastSplit + len; + while(lenAtNextT < targetLength) { + if (done) { + lastSegLen = lenAtNextT - lenAtLastSplit; + return 1; + } + goToNextLeaf(); + } + lenAtLastSplit = targetLength; + float t = binSearchForLen(lenAtLastSplit - lenAtLastT, + recCurveStack[recLevel], curveType, lenAtNextT - lenAtLastT, ERR); + // t is relative to the current leaf, so we must make it a valid parameter + // of the original curve. + t = t * (nextT - lastT) + lastT; + if (t >= 1) { + t = 1; + done = true; + } + // even if done = true, if we're here, that means targetLength + // is equal to, or very, very close to the total length of the + // curve, so lastSegLen won't be too high. In cases where len + // overshoots the curve, this method will exit in the while + // loop, and lastSegLen will still be set to the right value. + lastSegLen = len; + return t; + } + + public float lastSegLen() { + return lastSegLen; + } + + // Returns t such that if leaf is subdivided at t the left + // curve will have length len. leafLen must be the length of leaf. + private static Curve bsc = new Curve(); + private static float binSearchForLen(float len, float[] leaf, int type, + float leafLen, float err) + { + assert len <= leafLen; + bsc.set(leaf, type); + float errBound = err*len; + float left = 0, right = 1; + while (left < right) { + float m = (left + right) / 2; + if (m == left || m == right) { + return m; + } + float x = bsc.xat(m); + float y = bsc.yat(m); + float leftLen = Helpers.linelen(leaf[0], leaf[1], x, y); + if (Math.abs(leftLen - len) < errBound) { + return m; + } + if (leftLen < len) { + left = m; + } else { + right = m; + } + } + return left; + } + + // go to the next leaf (in an inorder traversal) in the recursion tree + // preconditions: must be on a leaf, and that leaf must not be the root. + private void goToNextLeaf() { + // We must go to the first ancestor node that has an unvisited + // right child. + recLevel--; + while(sides[recLevel] == Side.RIGHT) { + if (recLevel == 0) { + done = true; + return; + } + recLevel--; + } + + sides[recLevel] = Side.RIGHT; + System.arraycopy(recCurveStack[recLevel], 0, recCurveStack[recLevel+1], 0, curveType); + recLevel++; + goLeft(); + } + + // go to the leftmost node from the current node. Return its length. + private void goLeft() { + float len = onLeaf(); + if (len >= 0) { + lastT = nextT; + lenAtLastT = lenAtNextT; + nextT += (1 << (limit - recLevel)) * minTincrement; + lenAtNextT += len; + } else { + Helpers.subdivide(recCurveStack[recLevel], 0, + recCurveStack[recLevel+1], 0, + recCurveStack[recLevel], 0, curveType); + sides[recLevel] = Side.LEFT; + recLevel++; + goLeft(); + } + } + + // this is a bit of a hack. It returns -1 if we're not on a leaf, and + // the length of the leaf if we are on a leaf. + private float onLeaf() { + float polylen = Helpers.polyLineLength(recCurveStack[recLevel], 0, curveType); + float linelen = Helpers.linelen(recCurveStack[recLevel][0], recCurveStack[recLevel][1], + recCurveStack[recLevel][curveType - 2], recCurveStack[recLevel][curveType - 1]); + return (polylen - linelen < ERR || recLevel == limit) ? + (polylen + linelen)/2 : -1; + } + } + + @Override + public void curveTo(float x1, float y1, + float x2, float y2, + float x3, float y3) + { + curCurvepts[0] = x0; curCurvepts[1] = y0; + curCurvepts[2] = x1; curCurvepts[3] = y1; + curCurvepts[4] = x2; curCurvepts[5] = y2; + curCurvepts[6] = x3; curCurvepts[7] = y3; + somethingTo(8); + } + + @Override + public void quadTo(float x1, float y1, float x2, float y2) { + curCurvepts[0] = x0; curCurvepts[1] = y0; + curCurvepts[2] = x1; curCurvepts[3] = y1; + curCurvepts[4] = x2; curCurvepts[5] = y2; + somethingTo(6); + } + + public void closePath() { + lineTo(sx, sy); + if (firstSegidx > 0) { + if (!dashOn || needsMoveTo) { + out.moveTo(sx, sy); + } + emitFirstSegments(); + } + moveTo(sx, sy); + } + + public void pathDone() { + if (firstSegidx > 0) { + out.moveTo(sx, sy); + emitFirstSegments(); + } + out.pathDone(); + } + + @Override + public long getNativeConsumer() { + throw new InternalError("Dasher does not use a native consumer"); } } + diff --git a/jdk/src/share/classes/sun/java2d/pisces/Helpers.java b/jdk/src/share/classes/sun/java2d/pisces/Helpers.java new file mode 100644 index 00000000000..c803f172688 --- /dev/null +++ b/jdk/src/share/classes/sun/java2d/pisces/Helpers.java @@ -0,0 +1,478 @@ +/* + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.pisces; + +import java.util.Arrays; + +final class Helpers { + private Helpers() { + throw new Error("This is a non instantiable class"); + } + + static boolean within(final float x, final float y, final float err) { + final float d = y - x; + return (d <= err && d >= -err); + } + + static boolean within(final double x, final double y, final double err) { + final double d = y - x; + return (d <= err && d >= -err); + } + + static int quadraticRoots(final float a, final float b, + final float c, float[] zeroes, final int off) + { + int ret = off; + float t; + if (a != 0f) { + final float dis = b*b - 4*a*c; + if (dis > 0) { + final float sqrtDis = (float)Math.sqrt(dis); + // depending on the sign of b we use a slightly different + // algorithm than the traditional one to find one of the roots + // so we can avoid adding numbers of different signs (which + // might result in loss of precision). + if (b >= 0) { + zeroes[ret++] = (2 * c) / (-b - sqrtDis); + zeroes[ret++] = (-b - sqrtDis) / (2 * a); + } else { + zeroes[ret++] = (-b + sqrtDis) / (2 * a); + zeroes[ret++] = (2 * c) / (-b + sqrtDis); + } + } else if (dis == 0f) { + t = (-b) / (2 * a); + zeroes[ret++] = t; + } + } else { + if (b != 0f) { + t = (-c) / b; + zeroes[ret++] = t; + } + } + return ret - off; + } + + // find the roots of g(t) = a*t^3 + b*t^2 + c*t + d in [A,B) + // We will not use Cardano's method, since it is complicated and + // involves too many square and cubic roots. We will use Newton's method. + // TODO: this should probably return ALL roots. Then the user can do + // his own filtering of roots outside [A,B). + static int cubicRootsInAB(final float a, final float b, + final float c, final float d, + float[] pts, final int off, final float E, + final float A, final float B) + { + if (a == 0) { + return quadraticRoots(b, c, d, pts, off); + } + // the coefficients of g'(t). no dc variable because dc=c + // we use these to get the critical points of g(t), which + // we then use to chose starting points for Newton's method. These + // should be very close to the actual roots. + final float da = 3 * a; + final float db = 2 * b; + int numCritPts = quadraticRoots(da, db, c, pts, off+1); + numCritPts = filterOutNotInAB(pts, off+1, numCritPts, A, B) - off - 1; + // need them sorted. + if (numCritPts == 2 && pts[off+1] > pts[off+2]) { + float tmp = pts[off+1]; + pts[off+1] = pts[off+2]; + pts[off+2] = tmp; + } + + int ret = off; + + // we don't actually care much about the extrema themselves. We + // only use them to ensure that g(t) is monotonic in each + // interval [pts[i],pts[i+1] (for i in off...off+numCritPts+1). + // This will allow us to determine intervals containing exactly + // one root. + // The end points of the interval are always local extrema. + pts[off] = A; + pts[off + numCritPts + 1] = B; + numCritPts += 2; + + float x0 = pts[off], fx0 = evalCubic(a, b, c, d, x0); + for (int i = off; i < off + numCritPts - 1; i++) { + float x1 = pts[i+1], fx1 = evalCubic(a, b, c, d, x1); + if (fx0 == 0f) { + pts[ret++] = x0; + } else if (fx1 * fx0 < 0f) { // have opposite signs + pts[ret++] = CubicNewton(a, b, c, d, + x0 + fx0 * (x1 - x0) / (fx0 - fx1), E); + } + x0 = x1; + fx0 = fx1; + } + return ret - off; + } + + // precondition: the polynomial to be evaluated must not be 0 at x0. + static float CubicNewton(final float a, final float b, + final float c, final float d, + float x0, final float err) + { + // considering how this function is used, 10 should be more than enough + final int itlimit = 10; + float fx0 = evalCubic(a, b, c, d, x0); + float x1; + int count = 0; + while(true) { + x1 = x0 - (fx0 / evalCubic(0, 3 * a, 2 * b, c, x0)); + if (Math.abs(x1 - x0) < err * Math.abs(x1 + x0) || count == itlimit) { + break; + } + x0 = x1; + fx0 = evalCubic(a, b, c, d, x0); + count++; + } + return x1; + } + + // fills the input array with numbers 0, INC, 2*INC, ... + static void fillWithIdxes(final float[] data, final int[] idxes) { + if (idxes.length > 0) { + idxes[0] = 0; + for (int i = 1; i < idxes.length; i++) { + idxes[i] = idxes[i-1] + (int)data[idxes[i-1]]; + } + } + } + + static void fillWithIdxes(final int[] idxes, final int inc) { + if (idxes.length > 0) { + idxes[0] = 0; + for (int i = 1; i < idxes.length; i++) { + idxes[i] = idxes[i-1] + inc; + } + } + } + + // These use a hardcoded factor of 2 for increasing sizes. Perhaps this + // should be provided as an argument. + static float[] widenArray(float[] in, final int cursize, final int numToAdd) { + if (in == null) { + return new float[5 * numToAdd]; + } + if (in.length >= cursize + numToAdd) { + return in; + } + return Arrays.copyOf(in, 2 * (cursize + numToAdd)); + } + static int[] widenArray(int[] in, final int cursize, final int numToAdd) { + if (in.length >= cursize + numToAdd) { + return in; + } + return Arrays.copyOf(in, 2 * (cursize + numToAdd)); + } + + static float evalCubic(final float a, final float b, + final float c, final float d, + final float t) + { + return t * (t * (t * a + b) + c) + d; + } + + static float evalQuad(final float a, final float b, + final float c, final float t) + { + return t * (t * a + b) + c; + } + + // returns the index 1 past the last valid element remaining after filtering + static int filterOutNotInAB(float[] nums, final int off, final int len, + final float a, final float b) + { + int ret = off; + for (int i = off; i < off + len; i++) { + if (nums[i] > a && nums[i] < b) { + nums[ret++] = nums[i]; + } + } + return ret; + } + + static float polyLineLength(float[] poly, final int off, final int nCoords) { + assert nCoords % 2 == 0 && poly.length >= off + nCoords : ""; + float acc = 0; + for (int i = off + 2; i < off + nCoords; i += 2) { + acc += linelen(poly[i], poly[i+1], poly[i-2], poly[i-1]); + } + return acc; + } + + static float linelen(float x1, float y1, float x2, float y2) { + return (float)Math.hypot(x2 - x1, y2 - y1); + } + + static void subdivide(float[] src, int srcoff, float[] left, int leftoff, + float[] right, int rightoff, int type) + { + switch(type) { + case 6: + Helpers.subdivideQuad(src, srcoff, left, leftoff, right, rightoff); + break; + case 8: + Helpers.subdivideCubic(src, srcoff, left, leftoff, right, rightoff); + break; + default: + throw new InternalError("Unsupported curve type"); + } + } + + static void isort(float[] a, int off, int len) { + for (int i = off + 1; i < off + len; i++) { + float ai = a[i]; + int j = i - 1; + for (; j >= off && a[j] > ai; j--) { + a[j+1] = a[j]; + } + a[j+1] = ai; + } + } + + // Most of these are copied from classes in java.awt.geom because we need + // float versions of these functions, and Line2D, CubicCurve2D, + // QuadCurve2D don't provide them. + /** + * Subdivides the cubic curve specified by the coordinates + * stored in the src array at indices srcoff + * through (srcoff + 7) and stores the + * resulting two subdivided curves into the two result arrays at the + * corresponding indices. + * Either or both of the left and right + * arrays may be null or a reference to the same array + * as the src array. + * Note that the last point in the first subdivided curve is the + * same as the first point in the second subdivided curve. Thus, + * it is possible to pass the same array for left + * and right and to use offsets, such as rightoff + * equals (leftoff + 6), in order + * to avoid allocating extra storage for this common point. + * @param src the array holding the coordinates for the source curve + * @param srcoff the offset into the array of the beginning of the + * the 6 source coordinates + * @param left the array for storing the coordinates for the first + * half of the subdivided curve + * @param leftoff the offset into the array of the beginning of the + * the 6 left coordinates + * @param right the array for storing the coordinates for the second + * half of the subdivided curve + * @param rightoff the offset into the array of the beginning of the + * the 6 right coordinates + * @since 1.7 + */ + static void subdivideCubic(float src[], int srcoff, + float left[], int leftoff, + float right[], int rightoff) + { + float x1 = src[srcoff + 0]; + float y1 = src[srcoff + 1]; + float ctrlx1 = src[srcoff + 2]; + float ctrly1 = src[srcoff + 3]; + float ctrlx2 = src[srcoff + 4]; + float ctrly2 = src[srcoff + 5]; + float x2 = src[srcoff + 6]; + float y2 = src[srcoff + 7]; + if (left != null) { + left[leftoff + 0] = x1; + left[leftoff + 1] = y1; + } + if (right != null) { + right[rightoff + 6] = x2; + right[rightoff + 7] = y2; + } + x1 = (x1 + ctrlx1) / 2.0f; + y1 = (y1 + ctrly1) / 2.0f; + x2 = (x2 + ctrlx2) / 2.0f; + y2 = (y2 + ctrly2) / 2.0f; + float centerx = (ctrlx1 + ctrlx2) / 2.0f; + float centery = (ctrly1 + ctrly2) / 2.0f; + ctrlx1 = (x1 + centerx) / 2.0f; + ctrly1 = (y1 + centery) / 2.0f; + ctrlx2 = (x2 + centerx) / 2.0f; + ctrly2 = (y2 + centery) / 2.0f; + centerx = (ctrlx1 + ctrlx2) / 2.0f; + centery = (ctrly1 + ctrly2) / 2.0f; + if (left != null) { + left[leftoff + 2] = x1; + left[leftoff + 3] = y1; + left[leftoff + 4] = ctrlx1; + left[leftoff + 5] = ctrly1; + left[leftoff + 6] = centerx; + left[leftoff + 7] = centery; + } + if (right != null) { + right[rightoff + 0] = centerx; + right[rightoff + 1] = centery; + right[rightoff + 2] = ctrlx2; + right[rightoff + 3] = ctrly2; + right[rightoff + 4] = x2; + right[rightoff + 5] = y2; + } + } + + + static void subdivideCubicAt(float t, float src[], int srcoff, + float left[], int leftoff, + float right[], int rightoff) + { + float x1 = src[srcoff + 0]; + float y1 = src[srcoff + 1]; + float ctrlx1 = src[srcoff + 2]; + float ctrly1 = src[srcoff + 3]; + float ctrlx2 = src[srcoff + 4]; + float ctrly2 = src[srcoff + 5]; + float x2 = src[srcoff + 6]; + float y2 = src[srcoff + 7]; + if (left != null) { + left[leftoff + 0] = x1; + left[leftoff + 1] = y1; + } + if (right != null) { + right[rightoff + 6] = x2; + right[rightoff + 7] = y2; + } + x1 = x1 + t * (ctrlx1 - x1); + y1 = y1 + t * (ctrly1 - y1); + x2 = ctrlx2 + t * (x2 - ctrlx2); + y2 = ctrly2 + t * (y2 - ctrly2); + float centerx = ctrlx1 + t * (ctrlx2 - ctrlx1); + float centery = ctrly1 + t * (ctrly2 - ctrly1); + ctrlx1 = x1 + t * (centerx - x1); + ctrly1 = y1 + t * (centery - y1); + ctrlx2 = centerx + t * (x2 - centerx); + ctrly2 = centery + t * (y2 - centery); + centerx = ctrlx1 + t * (ctrlx2 - ctrlx1); + centery = ctrly1 + t * (ctrly2 - ctrly1); + if (left != null) { + left[leftoff + 2] = x1; + left[leftoff + 3] = y1; + left[leftoff + 4] = ctrlx1; + left[leftoff + 5] = ctrly1; + left[leftoff + 6] = centerx; + left[leftoff + 7] = centery; + } + if (right != null) { + right[rightoff + 0] = centerx; + right[rightoff + 1] = centery; + right[rightoff + 2] = ctrlx2; + right[rightoff + 3] = ctrly2; + right[rightoff + 4] = x2; + right[rightoff + 5] = y2; + } + } + + static void subdivideQuad(float src[], int srcoff, + float left[], int leftoff, + float right[], int rightoff) + { + float x1 = src[srcoff + 0]; + float y1 = src[srcoff + 1]; + float ctrlx = src[srcoff + 2]; + float ctrly = src[srcoff + 3]; + float x2 = src[srcoff + 4]; + float y2 = src[srcoff + 5]; + if (left != null) { + left[leftoff + 0] = x1; + left[leftoff + 1] = y1; + } + if (right != null) { + right[rightoff + 4] = x2; + right[rightoff + 5] = y2; + } + x1 = (x1 + ctrlx) / 2.0f; + y1 = (y1 + ctrly) / 2.0f; + x2 = (x2 + ctrlx) / 2.0f; + y2 = (y2 + ctrly) / 2.0f; + ctrlx = (x1 + x2) / 2.0f; + ctrly = (y1 + y2) / 2.0f; + if (left != null) { + left[leftoff + 2] = x1; + left[leftoff + 3] = y1; + left[leftoff + 4] = ctrlx; + left[leftoff + 5] = ctrly; + } + if (right != null) { + right[rightoff + 0] = ctrlx; + right[rightoff + 1] = ctrly; + right[rightoff + 2] = x2; + right[rightoff + 3] = y2; + } + } + + static void subdivideQuadAt(float t, float src[], int srcoff, + float left[], int leftoff, + float right[], int rightoff) + { + float x1 = src[srcoff + 0]; + float y1 = src[srcoff + 1]; + float ctrlx = src[srcoff + 2]; + float ctrly = src[srcoff + 3]; + float x2 = src[srcoff + 4]; + float y2 = src[srcoff + 5]; + if (left != null) { + left[leftoff + 0] = x1; + left[leftoff + 1] = y1; + } + if (right != null) { + right[rightoff + 4] = x2; + right[rightoff + 5] = y2; + } + x1 = x1 + t * (ctrlx - x1); + y1 = y1 + t * (ctrly - y1); + x2 = ctrlx + t * (x2 - ctrlx); + y2 = ctrly + t * (y2 - ctrly); + ctrlx = x1 + t * (x2 - x1); + ctrly = y1 + t * (y2 - y1); + if (left != null) { + left[leftoff + 2] = x1; + left[leftoff + 3] = y1; + left[leftoff + 4] = ctrlx; + left[leftoff + 5] = ctrly; + } + if (right != null) { + right[rightoff + 0] = ctrlx; + right[rightoff + 1] = ctrly; + right[rightoff + 2] = x2; + right[rightoff + 3] = y2; + } + } + + static void subdivideAt(float t, float src[], int srcoff, + float left[], int leftoff, + float right[], int rightoff, int size) + { + switch(size) { + case 8: + subdivideCubicAt(t, src, srcoff, left, leftoff, right, rightoff); + break; + case 6: + subdivideQuadAt(t, src, srcoff, left, leftoff, right, rightoff); + break; + } + } +} diff --git a/jdk/src/share/classes/sun/java2d/pisces/LineSink.java b/jdk/src/share/classes/sun/java2d/pisces/LineSink.java deleted file mode 100644 index 81300a25fa0..00000000000 --- a/jdk/src/share/classes/sun/java2d/pisces/LineSink.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.java2d.pisces; - -/** - * The LineSink interface accepts a series of line - * drawing commands: moveTo, lineTo, - * close (equivalent to a lineTo command - * with an argument equal to the argument of the last - * moveTo command), and end. - * - *

      A Flattener may be used to connect a general path - * source to a LineSink. - * - *

      The Renderer class implements the - * LineSink interface. - * - */ -public interface LineSink { - - /** - * Moves the current drawing position to the point (x0, - * y0). - * - * @param x0 the X coordinate - * @param y0 the Y coordinate - */ - public void moveTo(float x0, float y0); - - /** - * Provides a hint that the current segment should be joined to - * the following segment using an explicit miter or round join if - * required. - * - *

      An application-generated path will generally have no need - * to contain calls to this method; they are typically introduced - * by a Flattener to mark segment divisions that - * appear in its input, and consumed by a Stroker - * that is responsible for emitting the miter or round join - * segments. - * - *

      Other LineSink classes should simply pass this - * hint to their output sink as needed. - */ - public void lineJoin(); - - /** - * Draws a line from the current drawing position to the point - * (x1, y1) and sets the current drawing position to - * (x1, y1). - * - * @param x1 the X coordinate - * @param y1 the Y coordinate - */ - public void lineTo(float x1, float y1); - - /** - * Closes the current path by drawing a line from the current - * drawing position to the point specified by the moset recent - * moveTo command. - */ - public void close(); - - /** - * Ends the current path. It may be necessary to end a path in - * order to allow end caps to be drawn. - */ - public void end(); - -} diff --git a/jdk/src/share/classes/sun/java2d/pisces/PiscesCache.java b/jdk/src/share/classes/sun/java2d/pisces/PiscesCache.java index 0ecc4209698..05243190ec9 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/PiscesCache.java +++ b/jdk/src/share/classes/sun/java2d/pisces/PiscesCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ package sun.java2d.pisces; +import java.util.Arrays; + /** * An object used to cache pre-rendered complex paths. * @@ -32,115 +34,153 @@ package sun.java2d.pisces; */ public final class PiscesCache { - int bboxX0, bboxY0, bboxX1, bboxY1; + final int bboxX0, bboxY0, bboxX1, bboxY1; - byte[] rowAARLE; - int alphaRLELength; + // rowAARLE[i] holds the encoding of the pixel row with y = bboxY0+i. + // The format of each of the inner arrays is: rowAARLE[i][0,1] = (x0, n) + // where x0 is the first x in row i with nonzero alpha, and n is the + // number of RLE entries in this row. rowAARLE[i][j,j+1] for j>1 is + // (val,runlen) + final int[][] rowAARLE; - int[] rowOffsetsRLE; - int[] minTouched; - int alphaRows; + // RLE encodings are added in increasing y rows and then in increasing + // x inside those rows. Therefore, at any one time there is a well + // defined position (x,y) where a run length is about to be added (or + // the row terminated). x0,y0 is this (x,y)-(bboxX0,bboxY0). They + // are used to get indices into the current tile. + private int x0 = Integer.MIN_VALUE, y0 = Integer.MIN_VALUE; - private PiscesCache() {} + // touchedTile[i][j] is the sum of all the alphas in the tile with + // y=i*TILE_SIZE+bboxY0 and x=j*TILE_SIZE+bboxX0. + private final int[][] touchedTile; - public static PiscesCache createInstance() { - return new PiscesCache(); + static final int TILE_SIZE_LG = 5; + static final int TILE_SIZE = 1 << TILE_SIZE_LG; // 32 + private static final int INIT_ROW_SIZE = 8; // enough for 3 run lengths + + PiscesCache(int minx, int miny, int maxx, int maxy) { + assert maxy >= miny && maxx >= minx; + bboxX0 = minx; + bboxY0 = miny; + bboxX1 = maxx + 1; + bboxY1 = maxy + 1; + // we could just leave the inner arrays as null and allocate them + // lazily (which would be beneficial for shapes with gaps), but we + // assume there won't be too many of those so we allocate everything + // up front (which is better for other cases) + rowAARLE = new int[bboxY1 - bboxY0 + 1][INIT_ROW_SIZE]; + x0 = 0; + y0 = -1; // -1 makes the first assert in startRow succeed + // the ceiling of (maxy - miny + 1) / TILE_SIZE; + int nyTiles = (maxy - miny + TILE_SIZE) >> TILE_SIZE_LG; + int nxTiles = (maxx - minx + TILE_SIZE) >> TILE_SIZE_LG; + + touchedTile = new int[nyTiles][nxTiles]; } - private static final float ROWAA_RLE_FACTOR = 1.5f; - private static final float TOUCHED_FACTOR = 1.5f; - private static final int MIN_TOUCHED_LEN = 64; - - private void reallocRowAARLE(int newLength) { - if (rowAARLE == null) { - rowAARLE = new byte[newLength]; - } else if (rowAARLE.length < newLength) { - int len = Math.max(newLength, - (int)(rowAARLE.length*ROWAA_RLE_FACTOR)); - byte[] newRowAARLE = new byte[len]; - System.arraycopy(rowAARLE, 0, newRowAARLE, 0, rowAARLE.length); - rowAARLE = newRowAARLE; + void addRLERun(int val, int runLen) { + if (runLen > 0) { + addTupleToRow(y0, val, runLen); + if (val != 0) { + // the x and y of the current row, minus bboxX0, bboxY0 + int tx = x0 >> TILE_SIZE_LG; + int ty = y0 >> TILE_SIZE_LG; + int tx1 = (x0 + runLen - 1) >> TILE_SIZE_LG; + // while we forbid rows from starting before bboxx0, our users + // can still store rows that go beyond bboxx1 (although this + // shouldn't happen), so it's a good idea to check that i + // is not going out of bounds in touchedTile[ty] + if (tx1 >= touchedTile[ty].length) { + tx1 = touchedTile[ty].length - 1; + } + if (tx <= tx1) { + int nextTileXCoord = (tx + 1) << TILE_SIZE_LG; + if (nextTileXCoord > x0+runLen) { + touchedTile[ty][tx] += val * runLen; + } else { + touchedTile[ty][tx] += val * (nextTileXCoord - x0); + } + tx++; + } + // don't go all the way to tx1 - we need to handle the last + // tile as a special case (just like we did with the first + for (; tx < tx1; tx++) { +// try { + touchedTile[ty][tx] += (val << TILE_SIZE_LG); +// } catch (RuntimeException e) { +// System.out.println("x0, y0: " + x0 + ", " + y0); +// System.out.printf("tx, ty, tx1: %d, %d, %d %n", tx, ty, tx1); +// System.out.printf("bboxX/Y0/1: %d, %d, %d, %d %n", +// bboxX0, bboxY0, bboxX1, bboxY1); +// throw e; +// } + } + // they will be equal unless x0>>TILE_SIZE_LG == tx1 + if (tx == tx1) { + int lastXCoord = Math.min(x0 + runLen, (tx + 1) << TILE_SIZE_LG); + int txXCoord = tx << TILE_SIZE_LG; + touchedTile[ty][tx] += val * (lastXCoord - txXCoord); + } + } + x0 += runLen; } } - private void reallocRowInfo(int newHeight) { - if (minTouched == null) { - int len = Math.max(newHeight, MIN_TOUCHED_LEN); - minTouched = new int[len]; - rowOffsetsRLE = new int[len]; - } else if (minTouched.length < newHeight) { - int len = Math.max(newHeight, - (int)(minTouched.length*TOUCHED_FACTOR)); - int[] newMinTouched = new int[len]; - int[] newRowOffsetsRLE = new int[len]; - System.arraycopy(minTouched, 0, newMinTouched, 0, - alphaRows); - System.arraycopy(rowOffsetsRLE, 0, newRowOffsetsRLE, 0, - alphaRows); - minTouched = newMinTouched; - rowOffsetsRLE = newRowOffsetsRLE; - } + void startRow(int y, int x) { + // rows are supposed to be added by increasing y. + assert y - bboxY0 > y0; + assert y <= bboxY1; // perhaps this should be < instead of <= + + y0 = y - bboxY0; + // this should be a new, uninitialized row. + assert rowAARLE[y0][1] == 0; + + x0 = x - bboxX0; + assert x0 >= 0 : "Input must not be to the left of bbox bounds"; + + // the way addTupleToRow is implemented it would work for this but it's + // not a good idea to use it because it is meant for adding + // RLE tuples, not the first tuple (which is special). + rowAARLE[y0][0] = x; + rowAARLE[y0][1] = 2; } - void addRLERun(byte val, int runLen) { - reallocRowAARLE(alphaRLELength + 2); - rowAARLE[alphaRLELength++] = val; - rowAARLE[alphaRLELength++] = (byte)runLen; + int alphaSumInTile(int x, int y) { + x -= bboxX0; + y -= bboxY0; + return touchedTile[y>>TILE_SIZE_LG][x>>TILE_SIZE_LG]; } - void startRow(int y, int x0, int x1) { - if (alphaRows == 0) { - bboxY0 = y; - bboxY1 = y+1; - bboxX0 = x0; - bboxX1 = x1+1; - } else { - if (bboxX0 > x0) bboxX0 = x0; - if (bboxX1 < x1 + 1) bboxX1 = x1 + 1; - while (bboxY1++ < y) { - reallocRowInfo(alphaRows+1); - minTouched[alphaRows] = 0; - // Assuming last 2 entries in rowAARLE are 0,0 - rowOffsetsRLE[alphaRows] = alphaRLELength-2; - alphaRows++; + int minTouched(int rowidx) { + return rowAARLE[rowidx][0]; + } + + int rowLength(int rowidx) { + return rowAARLE[rowidx][1]; + } + + private void addTupleToRow(int row, int a, int b) { + int end = rowAARLE[row][1]; + rowAARLE[row] = Helpers.widenArray(rowAARLE[row], end, 2); + rowAARLE[row][end++] = a; + rowAARLE[row][end++] = b; + rowAARLE[row][1] = end; + } + + @Override + public String toString() { + String ret = "bbox = ["+ + bboxX0+", "+bboxY0+" => "+ + bboxX1+", "+bboxY1+"]\n"; + for (int[] row : rowAARLE) { + if (row != null) { + ret += ("minTouchedX=" + row[0] + + "\tRLE Entries: " + Arrays.toString( + Arrays.copyOfRange(row, 2, row[1])) + "\n"); + } else { + ret += "[]\n"; } } - reallocRowInfo(alphaRows+1); - minTouched[alphaRows] = x0; - rowOffsetsRLE[alphaRows] = alphaRLELength; - alphaRows++; - } - - public synchronized void dispose() { - rowAARLE = null; - alphaRLELength = 0; - - minTouched = null; - rowOffsetsRLE = null; - alphaRows = 0; - - bboxX0 = bboxY0 = bboxX1 = bboxY1 = 0; - } - - public void print(java.io.PrintStream out) { - synchronized (out) { - out.println("bbox = ["+ - bboxX0+", "+bboxY0+" => "+ - bboxX1+", "+bboxY1+"]"); - - out.println("alphRLELength = "+alphaRLELength); - - for (int y = bboxY0; y < bboxY1; y++) { - int i = y-bboxY0; - out.println("row["+i+"] == {"+ - "minX = "+minTouched[i]+ - ", off = "+rowOffsetsRLE[i]+"}"); - } - - for (int i = 0; i < alphaRLELength; i += 2) { - out.println("rle["+i+"] = "+ - (rowAARLE[i+1]&0xff)+" of "+(rowAARLE[i]&0xff)); - } - } + return ret; } } diff --git a/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java b/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java index ee2b35e6809..9684edc5023 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java +++ b/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ package sun.java2d.pisces; import java.awt.Shape; import java.awt.BasicStroke; -import java.awt.geom.FlatteningPathIterator; +import java.awt.geom.NoninvertibleTransformException; import java.awt.geom.Path2D; import java.awt.geom.AffineTransform; import java.awt.geom.PathIterator; @@ -38,8 +38,6 @@ import sun.java2d.pipe.RenderingEngine; import sun.java2d.pipe.AATileGenerator; public class PiscesRenderingEngine extends RenderingEngine { - public static double defaultFlat = 0.1; - private static enum NormMode {OFF, ON_NO_AA, ON_WITH_AA} /** @@ -78,20 +76,29 @@ public class PiscesRenderingEngine extends RenderingEngine { miterlimit, dashes, dashphase, - new LineSink() { + new PathConsumer2D() { public void moveTo(float x0, float y0) { p2d.moveTo(x0, y0); } - public void lineJoin() {} public void lineTo(float x1, float y1) { p2d.lineTo(x1, y1); } - public void close() { + public void closePath() { p2d.closePath(); } - public void end() {} + public void pathDone() {} + public void curveTo(float x1, float y1, + float x2, float y2, + float x3, float y3) { + p2d.curveTo(x1, y1, x2, y2, x3, y3); + } + public void quadTo(float x1, float y1, float x2, float y2) { + p2d.quadTo(x1, y1, x2, y2); + } + public long getNativeConsumer() { + throw new InternalError("Not using a native peer"); + } }); - return p2d; } @@ -133,22 +140,7 @@ public class PiscesRenderingEngine extends RenderingEngine { NormMode norm = (normalize) ? ((antialias) ? NormMode.ON_WITH_AA : NormMode.ON_NO_AA) : NormMode.OFF; - strokeTo(src, at, bs, thin, norm, antialias, - new LineSink() { - public void moveTo(float x0, float y0) { - consumer.moveTo(x0, y0); - } - public void lineJoin() {} - public void lineTo(float x1, float y1) { - consumer.lineTo(x1, y1); - } - public void close() { - consumer.closePath(); - } - public void end() { - consumer.pathDone(); - } - }); + strokeTo(src, at, bs, thin, norm, antialias, consumer); } void strokeTo(Shape src, @@ -157,7 +149,7 @@ public class PiscesRenderingEngine extends RenderingEngine { boolean thin, NormMode normalize, boolean antialias, - LineSink lsink) + PathConsumer2D pc2d) { float lw; if (thin) { @@ -178,7 +170,7 @@ public class PiscesRenderingEngine extends RenderingEngine { bs.getMiterLimit(), bs.getDashArray(), bs.getDashPhase(), - lsink); + pc2d); } private float userSpaceLineWidth(AffineTransform at, float lw) { @@ -256,28 +248,113 @@ public class PiscesRenderingEngine extends RenderingEngine { float miterlimit, float dashes[], float dashphase, - LineSink lsink) + PathConsumer2D pc2d) { - float a00 = 1f, a01 = 0f, a10 = 0f, a11 = 1f; + // We use inat and outat so that in Stroker and Dasher we can work only + // with the pre-transformation coordinates. This will repeat a lot of + // computations done in the path iterator, but the alternative is to + // work with transformed paths and compute untransformed coordinates + // as needed. This would be faster but I do not think the complexity + // of working with both untransformed and transformed coordinates in + // the same code is worth it. + // However, if a path's width is constant after a transformation, + // we can skip all this untransforming. + + // If normalization is off we save some transformations by not + // transforming the input to pisces. Instead, we apply the + // transformation after the path processing has been done. + // We can't do this if normalization is on, because it isn't a good + // idea to normalize before the transformation is applied. + AffineTransform inat = null; + AffineTransform outat = null; + + PathIterator pi = null; + if (at != null && !at.isIdentity()) { - a00 = (float)at.getScaleX(); - a01 = (float)at.getShearX(); - a10 = (float)at.getShearY(); - a11 = (float)at.getScaleY(); - } - lsink = new Stroker(lsink, width, caps, join, miterlimit, a00, a01, a10, a11); - if (dashes != null) { - lsink = new Dasher(lsink, dashes, dashphase, a00, a01, a10, a11); - } - PathIterator pi; - if (normalize != NormMode.OFF) { - pi = new FlatteningPathIterator( - new NormalizingPathIterator(src.getPathIterator(at), normalize), - defaultFlat); + final double a = at.getScaleX(); + final double b = at.getShearX(); + final double c = at.getShearY(); + final double d = at.getScaleY(); + final double det = a * d - c * b; + if (Math.abs(det) <= 2 * Float.MIN_VALUE) { + // this rendering engine takes one dimensional curves and turns + // them into 2D shapes by giving them width. + // However, if everything is to be passed through a singular + // transformation, these 2D shapes will be squashed down to 1D + // again so, nothing can be drawn. + + // Every path needs an initial moveTo and a pathDone. If these + // aren't there this causes a SIGSEV in libawt.so (at the time + // of writing of this comment (September 16, 2010)). Actually, + // I'm not sure if the moveTo is necessary to avoid the SIGSEV + // but the pathDone is definitely needed. + pc2d.moveTo(0, 0); + pc2d.pathDone(); + return; + } + + // If the transform is a constant multiple of an orthogonal transformation + // then every length is just multiplied by a constant, so we just + // need to transform input paths to stroker and tell stroker + // the scaled width. This condition is satisfied if + // a*b == -c*d && a*a+c*c == b*b+d*d. In the actual check below, we + // leave a bit of room for error. + if (nearZero(a*b + c*d, 2) && nearZero(a*a+c*c - (b*b+d*d), 2)) { + double scale = Math.sqrt(a*a + c*c); + if (dashes != null) { + dashes = java.util.Arrays.copyOf(dashes, dashes.length); + for (int i = 0; i < dashes.length; i++) { + dashes[i] = (float)(scale * dashes[i]); + } + dashphase = (float)(scale * dashphase); + } + width = (float)(scale * width); + pi = src.getPathIterator(at); + if (normalize != NormMode.OFF) { + pi = new NormalizingPathIterator(pi, normalize); + } + // leave inat and outat null. + } else { + // We only need the inverse if normalization is on. Otherwise + // we just don't transform the input paths, do all the stroking + // and then transform out output (instead of making PathIterator + // apply the transformation, us applying the inverse, and then + // us applying the transform again to our output). + outat = at; + if (normalize != NormMode.OFF) { + try { + inat = outat.createInverse(); + } catch (NoninvertibleTransformException e) { + // we made sure this can't happen + e.printStackTrace(); + } + pi = src.getPathIterator(at); + pi = new NormalizingPathIterator(pi, normalize); + } else { + pi = src.getPathIterator(null); + } + } } else { - pi = src.getPathIterator(at, defaultFlat); + // either at is null or it's the identity. In either case + // we don't transform the path. + pi = src.getPathIterator(null); + if (normalize != NormMode.OFF) { + pi = new NormalizingPathIterator(pi, normalize); + } } - pathTo(pi, lsink); + + pc2d = TransformingPathConsumer2D.transformConsumer(pc2d, outat); + pc2d = new Stroker(pc2d, width, caps, join, miterlimit); + if (dashes != null) { + pc2d = new Dasher(pc2d, dashes, dashphase); + } + pc2d = TransformingPathConsumer2D.transformConsumer(pc2d, inat); + + pathTo(pi, pc2d); + } + + private static boolean nearZero(double num, int nulps) { + return Math.abs(num) < nulps * Math.ulp(num); } private static class NormalizingPathIterator implements PathIterator { @@ -337,10 +414,10 @@ public class PiscesRenderingEngine extends RenderingEngine { } // normalize endpoint - float x_adjust = (float)Math.floor(coords[lastCoord] + lval) + rval - - coords[lastCoord]; - float y_adjust = (float)Math.floor(coords[lastCoord+1] + lval) + rval - - coords[lastCoord + 1]; + float x_adjust = (float)Math.floor(coords[lastCoord] + lval) + + rval - coords[lastCoord]; + float y_adjust = (float)Math.floor(coords[lastCoord+1] + lval) + + rval - coords[lastCoord + 1]; coords[lastCoord ] += x_adjust; coords[lastCoord + 1] += y_adjust; @@ -393,27 +470,9 @@ public class PiscesRenderingEngine extends RenderingEngine { } } - void pathTo(PathIterator pi, LineSink lsink) { - float coords[] = new float[2]; - while (!pi.isDone()) { - switch (pi.currentSegment(coords)) { - case PathIterator.SEG_MOVETO: - lsink.moveTo(coords[0], coords[1]); - break; - case PathIterator.SEG_LINETO: - lsink.lineJoin(); - lsink.lineTo(coords[0], coords[1]); - break; - case PathIterator.SEG_CLOSE: - lsink.lineJoin(); - lsink.close(); - break; - default: - throw new InternalError("unknown flattened segment type"); - } - pi.next(); - } - lsink.end(); + static void pathTo(PathIterator pi, PathConsumer2D pc2d) { + RenderingEngine.feedConsumer(pi, pc2d); + pc2d.pathDone(); } /** @@ -471,32 +530,92 @@ public class PiscesRenderingEngine extends RenderingEngine { boolean normalize, int bbox[]) { - PiscesCache pc = PiscesCache.createInstance(); Renderer r; NormMode norm = (normalize) ? NormMode.ON_WITH_AA : NormMode.OFF; if (bs == null) { PathIterator pi; if (normalize) { - pi = new FlatteningPathIterator( - new NormalizingPathIterator(s.getPathIterator(at), norm), - defaultFlat); + pi = new NormalizingPathIterator(s.getPathIterator(at), norm); } else { - pi = s.getPathIterator(at, defaultFlat); + pi = s.getPathIterator(at); } r = new Renderer(3, 3, clip.getLoX(), clip.getLoY(), clip.getWidth(), clip.getHeight(), - pi.getWindingRule(), pc); + pi.getWindingRule()); pathTo(pi, r); } else { r = new Renderer(3, 3, clip.getLoX(), clip.getLoY(), clip.getWidth(), clip.getHeight(), - PathIterator.WIND_NON_ZERO, pc); + PathIterator.WIND_NON_ZERO); strokeTo(s, at, bs, thin, norm, true, r); } r.endRendering(); - PiscesTileGenerator ptg = new PiscesTileGenerator(pc, r.MAX_AA_ALPHA); + PiscesTileGenerator ptg = new PiscesTileGenerator(r, r.MAX_AA_ALPHA); + ptg.getBbox(bbox); + return ptg; + } + + public AATileGenerator getAATileGenerator(double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2, + Region clip, + int bbox[]) + { + // REMIND: Deal with large coordinates! + double ldx1, ldy1, ldx2, ldy2; + boolean innerpgram = (lw1 > 0 && lw2 > 0); + + if (innerpgram) { + ldx1 = dx1 * lw1; + ldy1 = dy1 * lw1; + ldx2 = dx2 * lw2; + ldy2 = dy2 * lw2; + x -= (ldx1 + ldx2) / 2.0; + y -= (ldy1 + ldy2) / 2.0; + dx1 += ldx1; + dy1 += ldy1; + dx2 += ldx2; + dy2 += ldy2; + if (lw1 > 1 && lw2 > 1) { + // Inner parallelogram was entirely consumed by stroke... + innerpgram = false; + } + } else { + ldx1 = ldy1 = ldx2 = ldy2 = 0; + } + + Renderer r = new Renderer(3, 3, + clip.getLoX(), clip.getLoY(), + clip.getWidth(), clip.getHeight(), + PathIterator.WIND_EVEN_ODD); + + r.moveTo((float) x, (float) y); + r.lineTo((float) (x+dx1), (float) (y+dy1)); + r.lineTo((float) (x+dx1+dx2), (float) (y+dy1+dy2)); + r.lineTo((float) (x+dx2), (float) (y+dy2)); + r.closePath(); + + if (innerpgram) { + x += ldx1 + ldx2; + y += ldy1 + ldy2; + dx1 -= 2.0 * ldx1; + dy1 -= 2.0 * ldy1; + dx2 -= 2.0 * ldx2; + dy2 -= 2.0 * ldy2; + r.moveTo((float) x, (float) y); + r.lineTo((float) (x+dx1), (float) (y+dy1)); + r.lineTo((float) (x+dx1+dx2), (float) (y+dy1+dy2)); + r.lineTo((float) (x+dx2), (float) (y+dy2)); + r.closePath(); + } + + r.pathDone(); + + r.endRendering(); + PiscesTileGenerator ptg = new PiscesTileGenerator(r, r.MAX_AA_ALPHA); ptg.getBbox(bbox); return ptg; } diff --git a/jdk/src/share/classes/sun/java2d/pisces/PiscesTileGenerator.java b/jdk/src/share/classes/sun/java2d/pisces/PiscesTileGenerator.java index 93ff5315d9f..e2779b8fe03 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/PiscesTileGenerator.java +++ b/jdk/src/share/classes/sun/java2d/pisces/PiscesTileGenerator.java @@ -25,40 +25,54 @@ package sun.java2d.pisces; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + import sun.java2d.pipe.AATileGenerator; -public class PiscesTileGenerator implements AATileGenerator { - public static final int TILE_SIZE = 32; +public final class PiscesTileGenerator implements AATileGenerator { + public static final int TILE_SIZE = PiscesCache.TILE_SIZE; + + // perhaps we should be using weak references here, but right now + // that's not necessary. The way the renderer is, this map will + // never contain more than one element - the one with key 64, since + // we only do 8x8 supersampling. + private static final Map alphaMapsCache = new + ConcurrentHashMap(); PiscesCache cache; int x, y; - int maxalpha; + final int maxalpha; + private final int maxTileAlphaSum; + + // The alpha map used by this object (taken out of our map cache) to convert + // pixel coverage counts gotten from PiscesCache (which are in the range + // [0, maxalpha]) into alpha values, which are in [0,256). byte alphaMap[]; - public PiscesTileGenerator(PiscesCache cache, int maxalpha) { - this.cache = cache; + public PiscesTileGenerator(Renderer r, int maxalpha) { + this.cache = r.getCache(); this.x = cache.bboxX0; this.y = cache.bboxY0; this.alphaMap = getAlphaMap(maxalpha); this.maxalpha = maxalpha; + this.maxTileAlphaSum = TILE_SIZE*TILE_SIZE*maxalpha; } - static int prevMaxAlpha; - static byte prevAlphaMap[]; - - public synchronized static byte[] getAlphaMap(int maxalpha) { - if (maxalpha != prevMaxAlpha) { - prevAlphaMap = new byte[maxalpha+300]; - int halfmaxalpha = maxalpha>>2; - for (int i = 0; i <= maxalpha; i++) { - prevAlphaMap[i] = (byte) ((i * 255 + halfmaxalpha) / maxalpha); - } - for (int i = maxalpha; i < prevAlphaMap.length; i++) { - prevAlphaMap[i] = (byte) 255; - } - prevMaxAlpha = maxalpha; + private static byte[] buildAlphaMap(int maxalpha) { + byte[] alMap = new byte[maxalpha+1]; + int halfmaxalpha = maxalpha>>2; + for (int i = 0; i <= maxalpha; i++) { + alMap[i] = (byte) ((i * 255 + halfmaxalpha) / maxalpha); } - return prevAlphaMap; + return alMap; + } + + public static byte[] getAlphaMap(int maxalpha) { + if (!alphaMapsCache.containsKey(maxalpha)) { + alphaMapsCache.put(maxalpha, buildAlphaMap(maxalpha)); + } + return alphaMapsCache.get(maxalpha); } public void getBbox(int bbox[]) { @@ -96,53 +110,24 @@ public class PiscesTileGenerator implements AATileGenerator { * value for partial coverage of the tile */ public int getTypicalAlpha() { - if (true) return 0x80; - // Decode run-length encoded alpha mask data - // The data for row j begins at cache.rowOffsetsRLE[j] - // and is encoded as a set of 2-byte pairs (val, runLen) - // terminated by a (0, 0) pair. - - int x0 = this.x; - int x1 = x0 + TILE_SIZE; - int y0 = this.y; - int y1 = y0 + TILE_SIZE; - if (x1 > cache.bboxX1) x1 = cache.bboxX1; - if (y1 > cache.bboxY1) y1 = cache.bboxY1; - y0 -= cache.bboxY0; - y1 -= cache.bboxY0; - - int ret = -1; - for (int cy = y0; cy < y1; cy++) { - int pos = cache.rowOffsetsRLE[cy]; - int cx = cache.minTouched[cy]; - - if (cx > x0) { - if (ret > 0) return 0x80; - ret = 0x00; - } - while (cx < x1) { - int runLen = cache.rowAARLE[pos + 1] & 0xff; - if (runLen == 0) { - if (ret > 0) return 0x80; - ret = 0x00; - break; - } - cx += runLen; - if (cx > x0) { - int val = cache.rowAARLE[pos] & 0xff; - if (ret != val) { - if (ret < 0) { - if (val != 0x00 && val != maxalpha) return 0x80; - ret = val; - } else { - return 0x80; - } - } - } - pos += 2; - } - } - return ret; + int al = cache.alphaSumInTile(x, y); + // Note: if we have a filled rectangle that doesn't end on a tile + // border, we could still return 0xff, even though al!=maxTileAlphaSum + // This is because if we return 0xff, our users will fill a rectangle + // starting at x,y that has width = Math.min(TILE_SIZE, bboxX1-x), + // and height min(TILE_SIZE,bboxY1-y), which is what should happen. + // However, to support this, we would have to use 2 Math.min's + // and 2 multiplications per tile, instead of just 2 multiplications + // to compute maxTileAlphaSum. The savings offered would probably + // not be worth it, considering how rare this case is. + // Note: I have not tested this, so in the future if it is determined + // that it is worth it, it should be implemented. Perhaps this method's + // interface should be changed to take arguments the width and height + // of the current tile. This would eliminate the 2 Math.min calls that + // would be needed here, since our caller needs to compute these 2 + // values anyway. + return (al == 0x00 ? 0x00 : + (al == maxTileAlphaSum ? 0xff : 0x80)); } /** @@ -179,22 +164,24 @@ public class PiscesTileGenerator implements AATileGenerator { int idx = offset; for (int cy = y0; cy < y1; cy++) { - int pos = cache.rowOffsetsRLE[cy]; - int cx = cache.minTouched[cy]; + int[] row = cache.rowAARLE[cy]; + assert row != null; + int cx = cache.minTouched(cy); if (cx > x1) cx = x1; - if (cx > x0) { - //System.out.println("L["+(cx-x0)+"]"); - for (int i = x0; i < cx; i++) { - tile[idx++] = 0x00; - } + for (int i = x0; i < cx; i++) { + tile[idx++] = 0x00; } - while (cx < x1) { + + int pos = 2; + while (cx < x1 && pos < row[1]) { byte val; int runLen = 0; + assert row[1] > 2; try { - val = alphaMap[cache.rowAARLE[pos] & 0xff]; - runLen = cache.rowAARLE[pos + 1] & 0xff; + val = alphaMap[row[pos]]; + runLen = row[pos + 1]; + assert runLen > 0; } catch (RuntimeException e0) { System.out.println("maxalpha = "+maxalpha); System.out.println("tile["+x0+", "+y0+ @@ -202,14 +189,12 @@ public class PiscesTileGenerator implements AATileGenerator { System.out.println("cx = "+cx+", cy = "+cy); System.out.println("idx = "+idx+", pos = "+pos); System.out.println("len = "+runLen); - cache.print(System.out); + System.out.print(cache.toString()); e0.printStackTrace(); System.exit(1); return; } - if (runLen == 0) { - break; - } + int rx0 = cx; cx += runLen; int rx1 = cx; @@ -228,7 +213,7 @@ public class PiscesTileGenerator implements AATileGenerator { System.out.println("idx = "+idx+", pos = "+pos); System.out.println("rx0 = "+rx0+", rx1 = "+rx1); System.out.println("len = "+runLen); - cache.print(System.out); + System.out.print(cache.toString()); e.printStackTrace(); System.exit(1); return; @@ -265,4 +250,4 @@ public class PiscesTileGenerator implements AATileGenerator { * No further calls will be made on this instance. */ public void dispose() {} -} +} \ No newline at end of file diff --git a/jdk/src/share/classes/sun/java2d/pisces/Renderer.java b/jdk/src/share/classes/sun/java2d/pisces/Renderer.java index 9768e90a77b..782d9e4f30b 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/Renderer.java +++ b/jdk/src/share/classes/sun/java2d/pisces/Renderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,250 +26,552 @@ package sun.java2d.pisces; import java.util.Arrays; +import java.util.Iterator; -public class Renderer implements LineSink { +import sun.awt.geom.PathConsumer2D; -/////////////////////////////////////////////////////////////////////////////// -// Scan line iterator and edge crossing data. -////////////////////////////////////////////////////////////////////////////// +public class Renderer implements PathConsumer2D { - private int[] crossings; + private class ScanlineIterator { - // This is an array of indices into the edge array. It is initialized to - // [i * SIZEOF_STRUCT_EDGE for i in range(0, edgesSize/SIZEOF_STRUCT_EDGE)] - // (where range(i, j) is i,i+1,...,j-1 -- just like in python). - // The reason for keeping this is because we need the edges array sorted - // by y0, but we don't want to move all that data around, so instead we - // sort the indices into the edge array, and use edgeIndices to access - // the edges array. This is meant to simulate a pointer array (hence the name) - private int[] edgePtrs; + private int[] crossings; - // crossing bounds. The bounds are not necessarily tight (the scan line - // at minY, for example, might have no crossings). The x bounds will - // be accumulated as crossings are computed. - private int minY, maxY; - private int minX, maxX; - private int nextY; + // crossing bounds. The bounds are not necessarily tight (the scan line + // at minY, for example, might have no crossings). The x bounds will + // be accumulated as crossings are computed. + private int minY, maxY; + private int nextY; - // indices into the edge pointer list. They indicate the "active" sublist in - // the edge list (the portion of the list that contains all the edges that - // cross the next scan line). - private int lo, hi; + // indices into the segment pointer lists. They indicate the "active" + // sublist in the segment lists (the portion of the list that contains + // all the segments that cross the next scan line). + private int elo, ehi; + private final int[] edgePtrs; + private int qlo, qhi; + private final int[] quadPtrs; + private int clo, chi; + private final int[] curvePtrs; - private static final int INIT_CROSSINGS_SIZE = 50; - private void ScanLineItInitialize() { - crossings = new int[INIT_CROSSINGS_SIZE]; - edgePtrs = new int[edgesSize / SIZEOF_STRUCT_EDGE]; - for (int i = 0; i < edgePtrs.length; i++) { - edgePtrs[i] = i * SIZEOF_STRUCT_EDGE; + private static final int INIT_CROSSINGS_SIZE = 10; + + private ScanlineIterator() { + crossings = new int[INIT_CROSSINGS_SIZE]; + + edgePtrs = new int[numEdges]; + Helpers.fillWithIdxes(edgePtrs, SIZEOF_EDGE); + qsort(edges, edgePtrs, YMIN, 0, numEdges - 1); + + quadPtrs = new int[numQuads]; + Helpers.fillWithIdxes(quadPtrs, SIZEOF_QUAD); + qsort(quads, quadPtrs, YMIN, 0, numQuads - 1); + + curvePtrs = new int[numCurves]; + Helpers.fillWithIdxes(curvePtrs, SIZEOF_CURVE); + qsort(curves, curvePtrs, YMIN, 0, numCurves - 1); + + // We don't care if we clip some of the line off with ceil, since + // no scan line crossings will be eliminated (in fact, the ceil is + // the y of the first scan line crossing). + nextY = minY = Math.max(boundsMinY, (int)Math.ceil(edgeMinY)); + maxY = Math.min(boundsMaxY, (int)Math.ceil(edgeMaxY)); + + for (elo = 0; elo < numEdges && edges[edgePtrs[elo]+YMAX] <= minY; elo++) + ; + // the active list is *edgePtrs[lo] (inclusive) *edgePtrs[hi] (exclusive) + for (ehi = elo; ehi < numEdges && edges[edgePtrs[ehi]+YMIN] <= minY; ehi++) + edgeSetCurY(edgePtrs[ehi], minY);// TODO: make minY a float to avoid casts + + for (qlo = 0; qlo < numQuads && quads[quadPtrs[qlo]+YMAX] <= minY; qlo++) + ; + for (qhi = qlo; qhi < numQuads && quads[quadPtrs[qhi]+YMIN] <= minY; qhi++) + quadSetCurY(quadPtrs[qhi], minY); + + for (clo = 0; clo < numCurves && curves[curvePtrs[clo]+YMAX] <= minY; clo++) + ; + for (chi = clo; chi < numCurves && curves[curvePtrs[chi]+YMIN] <= minY; chi++) + curveSetCurY(curvePtrs[chi], minY); } - qsort(0, edgePtrs.length - 1); - - // We don't care if we clip some of the line off with ceil, since - // no scan line crossings will be eliminated (in fact, the ceil is - // the y of the first scan line crossing). - nextY = minY = Math.max(boundsMinY, (int)Math.ceil(edgeMinY)); - maxY = Math.min(boundsMaxY, (int)Math.ceil(edgeMaxY)); - - for (lo = 0; lo < edgePtrs.length && edges[edgePtrs[lo]+Y1] <= nextY; lo++) - ; - for (hi = lo; hi < edgePtrs.length && edges[edgePtrs[hi]+CURY] <= nextY; hi++) - ; // the active list is *edgePtrs[lo] (inclusive) *edgePtrs[hi] (exclusive) - for (int i = lo; i < hi; i++) { - setCurY(edgePtrs[i], nextY); - } - - // We accumulate X in the iterator because accumulating it in addEdge - // like we do with Y does not do much good: if there's an edge - // (0,0)->(1000,10000), and if y gets clipped to 1000, then the x - // bound should be 100, but the accumulator from addEdge would say 1000, - // so we'd still have to accumulate the X bounds as we add crossings. - minX = boundsMinX; - maxX = boundsMaxX; - } - - private int ScanLineItCurrentY() { - return nextY - 1; - } - - private int ScanLineItGoToNextYAndComputeCrossings() { - // we go through the active list and remove the ones that don't cross - // the nextY scanline. - int crossingIdx = 0; - for (int i = lo; i < hi; i++) { - if (edges[edgePtrs[i]+Y1] <= nextY) { - edgePtrs[i] = edgePtrs[lo++]; + private int next() { + // we go through the active lists and remove segments that don't cross + // the nextY scanline. + int crossingIdx = 0; + for (int i = elo; i < ehi; i++) { + if (edges[edgePtrs[i]+YMAX] <= nextY) { + edgePtrs[i] = edgePtrs[elo++]; + } } - } - if (hi - lo > crossings.length) { - int newSize = Math.max(hi - lo, crossings.length * 2); - crossings = Arrays.copyOf(crossings, newSize); - } - // Now every edge between lo and hi crosses nextY. Compute it's - // crossing and put it in the crossings array. - for (int i = lo; i < hi; i++) { - addCrossing(nextY, getCurCrossing(edgePtrs[i]), (int)edges[edgePtrs[i]+OR], crossingIdx); - gotoNextY(edgePtrs[i]); - crossingIdx++; + for (int i = qlo; i < qhi; i++) { + if (quads[quadPtrs[i]+YMAX] <= nextY) { + quadPtrs[i] = quadPtrs[qlo++]; + } + } + for (int i = clo; i < chi; i++) { + if (curves[curvePtrs[i]+YMAX] <= nextY) { + curvePtrs[i] = curvePtrs[clo++]; + } + } + + crossings = Helpers.widenArray(crossings, 0, ehi-elo+qhi-qlo+chi-clo); + + // Now every edge between lo and hi crosses nextY. Compute it's + // crossing and put it in the crossings array. + for (int i = elo; i < ehi; i++) { + int ptr = edgePtrs[i]; + addCrossing(nextY, (int)edges[ptr+CURX], edges[ptr+OR], crossingIdx); + edgeGoToNextY(ptr); + crossingIdx++; + } + for (int i = qlo; i < qhi; i++) { + int ptr = quadPtrs[i]; + addCrossing(nextY, (int)quads[ptr+CURX], quads[ptr+OR], crossingIdx); + quadGoToNextY(ptr); + crossingIdx++; + } + for (int i = clo; i < chi; i++) { + int ptr = curvePtrs[i]; + addCrossing(nextY, (int)curves[ptr+CURX], curves[ptr+OR], crossingIdx); + curveGoToNextY(ptr); + crossingIdx++; + } + + nextY++; + // Expand active lists to include new edges. + for (; ehi < numEdges && edges[edgePtrs[ehi]+YMIN] <= nextY; ehi++) { + edgeSetCurY(edgePtrs[ehi], nextY); + } + for (; qhi < numQuads && quads[quadPtrs[qhi]+YMIN] <= nextY; qhi++) { + quadSetCurY(quadPtrs[qhi], nextY); + } + for (; chi < numCurves && curves[curvePtrs[chi]+YMIN] <= nextY; chi++) { + curveSetCurY(curvePtrs[chi], nextY); + } + Arrays.sort(crossings, 0, crossingIdx); + return crossingIdx; } - nextY++; - // Expand active list to include new edges. - for (; hi < edgePtrs.length && edges[edgePtrs[hi]+CURY] <= nextY; hi++) { - setCurY(edgePtrs[hi], nextY); + private boolean hasNext() { + return nextY < maxY; } - Arrays.sort(crossings, 0, crossingIdx); - return crossingIdx; + private int curY() { + return nextY - 1; + } + + private void addCrossing(int y, int x, float or, int idx) { + x <<= 1; + crossings[idx] = ((or > 0) ? (x | 0x1) : x); + } } - - private boolean ScanLineItHasNext() { - return nextY < maxY; - } - - private void addCrossing(int y, int x, int or, int idx) { - if (x < minX) { - minX = x; - } - if (x > maxX) { - maxX = x; - } - x <<= 1; - crossings[idx] = ((or == 1) ? (x | 0x1) : x); - } - - // quicksort implementation for sorting the edge indices ("pointers") // by increasing y0. first, last are indices into the "pointer" array // It sorts the pointer array from first (inclusive) to last (inclusive) - private void qsort(int first, int last) { + private static void qsort(final float[] data, final int[] ptrs, + final int fieldForCmp, int first, int last) + { if (last > first) { - int p = partition(first, last); + int p = partition(data, ptrs, fieldForCmp, first, last); if (first < p - 1) { - qsort(first, p - 1); + qsort(data, ptrs, fieldForCmp, first, p - 1); } if (p < last) { - qsort(p, last); + qsort(data, ptrs, fieldForCmp, p, last); } } } // i, j are indices into edgePtrs. - private int partition(int i, int j) { - int pivotVal = edgePtrs[i]; + private static int partition(final float[] data, final int[] ptrs, + final int fieldForCmp, int i, int j) + { + int pivotValFieldForCmp = ptrs[i]+fieldForCmp; while (i <= j) { // edges[edgePtrs[i]+1] is equivalent to (*(edgePtrs[i])).y0 in C - while (edges[edgePtrs[i]+CURY] < edges[pivotVal+CURY]) { i++; } - while (edges[edgePtrs[j]+CURY] > edges[pivotVal+CURY]) { j--; } + while (data[ptrs[i]+fieldForCmp] < data[pivotValFieldForCmp]) + i++; + while (data[ptrs[j]+fieldForCmp] > data[pivotValFieldForCmp]) + j--; if (i <= j) { - int tmp = edgePtrs[i]; - edgePtrs[i] = edgePtrs[j]; - edgePtrs[j] = tmp; + int tmp = ptrs[i]; + ptrs[i] = ptrs[j]; + ptrs[j] = tmp; i++; j--; } } return i; } - //============================================================================ ////////////////////////////////////////////////////////////////////////////// // EDGE LIST ////////////////////////////////////////////////////////////////////////////// +// TODO(maybe): very tempting to use fixed point here. A lot of opportunities +// for shifts and just removing certain operations altogether. +// TODO: it might be worth it to make an EdgeList class. It would probably +// clean things up a bit and not impact performance much. - private static final int INIT_NUM_EDGES = 1000; - private static final int SIZEOF_STRUCT_EDGE = 5; + // common to all types of input path segments. + private static final int YMIN = 0; + private static final int YMAX = 1; + private static final int CURX = 2; + // this and OR are meant to be indeces into "int" fields, but arrays must + // be homogenous, so every field is a float. However floats can represent + // exactly up to 26 bit ints, so we're ok. + private static final int CURY = 3; + private static final int OR = 4; - // The following array is a poor man's struct array: - // it simulates a struct array by having - // edges[SIZEOF_STRUCT_EDGE * i + j] be the jth field in the ith element - // of an array of edge structs. - private float[] edges; - private int edgesSize; // size of the edge list. - private static final int Y1 = 0; - private static final int SLOPE = 1; - private static final int OR = 2; // the orientation. This can be -1 or 1. - // -1 means up, 1 means down. - private static final int CURY = 3; // j = 5 corresponds to the "current Y". - // Each edge keeps track of the last scanline - // crossing it computed, and this is the y coord of - // that scanline. - private static final int CURX = 4; //the x coord of the current crossing. + // for straight lines only: + private static final int SLOPE = 5; - // Note that while the array is declared as a float[] not all of it's - // elements should be floats. currentY and Orientation should be ints (or int and - // byte respectively), but they all need to be the same type. This isn't - // really a problem because floats can represent exactly all 23 bit integers, - // which should be more than enough. - // Note, also, that we only need x1 for slope computation, so we don't need - // to store it. x0, y0 don't need to be stored either. They can be put into - // curx, cury, and it's ok if they're lost when curx and cury are changed. - // We take this undeniably ugly and error prone approach (instead of simply - // making an Edge class) for performance reasons. Also, it would probably be nicer - // to have one array for each field, but that would defeat the purpose because - // it would make poor use of the processor cache, since we tend to access - // all the fields for one edge at a time. + // for quads and cubics: + private static final int X0 = 5; + private static final int Y0 = 6; + private static final int XL = 7; + private static final int COUNT = 8; + private static final int CURSLOPE = 9; + private static final int DX = 10; + private static final int DY = 11; + private static final int DDX = 12; + private static final int DDY = 13; - private float edgeMinY; - private float edgeMaxY; + // for cubics only + private static final int DDDX = 14; + private static final int DDDY = 15; + + private float edgeMinY = Float.POSITIVE_INFINITY; + private float edgeMaxY = Float.NEGATIVE_INFINITY; + private float edgeMinX = Float.POSITIVE_INFINITY; + private float edgeMaxX = Float.NEGATIVE_INFINITY; + + private static final int SIZEOF_EDGE = 6; + private float[] edges = null; + private int numEdges; + // these are static because we need them to be usable from ScanlineIterator + private void edgeSetCurY(final int idx, int y) { + edges[idx+CURX] += (y - edges[idx+CURY]) * edges[idx+SLOPE]; + edges[idx+CURY] = y; + } + private void edgeGoToNextY(final int idx) { + edges[idx+CURY] += 1; + edges[idx+CURX] += edges[idx+SLOPE]; + } - private void addEdge(float x0, float y0, float x1, float y1) { - float or = (y0 < y1) ? 1f : -1f; // orientation: 1 = UP; -1 = DOWN - if (or == -1) { - float tmp = y0; - y0 = y1; - y1 = tmp; - tmp = x0; - x0 = x1; - x1 = tmp; + private static final int SIZEOF_QUAD = 14; + private float[] quads = null; + private int numQuads; + // This function should be called exactly once, to set the first scanline + // of the curve. Before it is called, the curve should think its first + // scanline is CEIL(YMIN). + private void quadSetCurY(final int idx, final int y) { + assert y < quads[idx+YMAX]; + assert (quads[idx+CURY] > y); + assert (quads[idx+CURY] == Math.ceil(quads[idx+CURY])); + + while (quads[idx+CURY] < ((float)y)) { + quadGoToNextY(idx); } - // skip edges that don't cross a scanline - if (Math.ceil(y0) >= Math.ceil(y1)) { + } + private void quadGoToNextY(final int idx) { + quads[idx+CURY] += 1; + // this will get overriden if the while executes. + quads[idx+CURX] += quads[idx+CURSLOPE]; + int count = (int)quads[idx+COUNT]; + // this loop should never execute more than once because our + // curve is monotonic in Y. Still we put it in because you can + // never be too sure when dealing with floating point. + while(quads[idx+CURY] >= quads[idx+Y0] && count > 0) { + float x0 = quads[idx+X0], y0 = quads[idx+Y0]; + count = executeQuadAFDIteration(idx); + float x1 = quads[idx+X0], y1 = quads[idx+Y0]; + // our quads are monotonic, so this shouldn't happen, but + // it is conceivable that for very flat quads with different + // y values at their endpoints AFD might give us a horizontal + // segment. + if (y1 == y0) { + continue; + } + quads[idx+CURSLOPE] = (x1 - x0) / (y1 - y0); + quads[idx+CURX] = x0 + (quads[idx+CURY] - y0) * quads[idx+CURSLOPE]; + } + } + + + private static final int SIZEOF_CURVE = 16; + private float[] curves = null; + private int numCurves; + private void curveSetCurY(final int idx, final int y) { + assert y < curves[idx+YMAX]; + assert (curves[idx+CURY] > y); + assert (curves[idx+CURY] == Math.ceil(curves[idx+CURY])); + + while (curves[idx+CURY] < ((float)y)) { + curveGoToNextY(idx); + } + } + private void curveGoToNextY(final int idx) { + curves[idx+CURY] += 1; + // this will get overriden if the while executes. + curves[idx+CURX] += curves[idx+CURSLOPE]; + int count = (int)curves[idx+COUNT]; + // this loop should never execute more than once because our + // curve is monotonic in Y. Still we put it in because you can + // never be too sure when dealing with floating point. + while(curves[idx+CURY] >= curves[idx+Y0] && count > 0) { + float x0 = curves[idx+X0], y0 = curves[idx+Y0]; + count = executeCurveAFDIteration(idx); + float x1 = curves[idx+X0], y1 = curves[idx+Y0]; + // our curves are monotonic, so this shouldn't happen, but + // it is conceivable that for very flat curves with different + // y values at their endpoints AFD might give us a horizontal + // segment. + if (y1 == y0) { + continue; + } + curves[idx+CURSLOPE] = (x1 - x0) / (y1 - y0); + curves[idx+CURX] = x0 + (curves[idx+CURY] - y0) * curves[idx+CURSLOPE]; + } + } + + + private static final float DEC_BND = 20f; + private static final float INC_BND = 8f; + // Flattens using adaptive forward differencing. This only carries out + // one iteration of the AFD loop. All it does is update AFD variables (i.e. + // X0, Y0, D*[X|Y], COUNT; not variables used for computing scanline crossings). + private int executeQuadAFDIteration(int idx) { + int count = (int)quads[idx+COUNT]; + float ddx = quads[idx+DDX]; + float ddy = quads[idx+DDY]; + float dx = quads[idx+DX]; + float dy = quads[idx+DY]; + + while (Math.abs(ddx) > DEC_BND || Math.abs(ddy) > DEC_BND) { + ddx = ddx / 4; + ddy = ddy / 4; + dx = (dx - ddx) / 2; + dy = (dy - ddy) / 2; + count <<= 1; + } + // can only do this on even "count" values, because we must divide count by 2 + while (count % 2 == 0 && Math.abs(dx) <= INC_BND && Math.abs(dy) <= INC_BND) { + dx = 2 * dx + ddx; + dy = 2 * dy + ddy; + ddx = 4 * ddx; + ddy = 4 * ddy; + count >>= 1; + } + count--; + if (count > 0) { + quads[idx+X0] += dx; + dx += ddx; + quads[idx+Y0] += dy; + dy += ddy; + } else { + quads[idx+X0] = quads[idx+XL]; + quads[idx+Y0] = quads[idx+YMAX]; + } + quads[idx+COUNT] = count; + quads[idx+DDX] = ddx; + quads[idx+DDY] = ddy; + quads[idx+DX] = dx; + quads[idx+DY] = dy; + return count; + } + private int executeCurveAFDIteration(int idx) { + int count = (int)curves[idx+COUNT]; + float ddx = curves[idx+DDX]; + float ddy = curves[idx+DDY]; + float dx = curves[idx+DX]; + float dy = curves[idx+DY]; + float dddx = curves[idx+DDDX]; + float dddy = curves[idx+DDDY]; + + while (Math.abs(ddx) > DEC_BND || Math.abs(ddy) > DEC_BND) { + dddx /= 8; + dddy /= 8; + ddx = ddx/4 - dddx; + ddy = ddy/4 - dddy; + dx = (dx - ddx) / 2; + dy = (dy - ddy) / 2; + count <<= 1; + } + // can only do this on even "count" values, because we must divide count by 2 + while (count % 2 == 0 && Math.abs(dx) <= INC_BND && Math.abs(dy) <= INC_BND) { + dx = 2 * dx + ddx; + dy = 2 * dy + ddy; + ddx = 4 * (ddx + dddx); + ddy = 4 * (ddy + dddy); + dddx = 8 * dddx; + dddy = 8 * dddy; + count >>= 1; + } + count--; + if (count > 0) { + curves[idx+X0] += dx; + dx += ddx; + ddx += dddx; + curves[idx+Y0] += dy; + dy += ddy; + ddy += dddy; + } else { + curves[idx+X0] = curves[idx+XL]; + curves[idx+Y0] = curves[idx+YMAX]; + } + curves[idx+COUNT] = count; + curves[idx+DDDX] = dddx; + curves[idx+DDDY] = dddy; + curves[idx+DDX] = ddx; + curves[idx+DDY] = ddy; + curves[idx+DX] = dx; + curves[idx+DY] = dy; + return count; + } + + + private void initLine(final int idx, float[] pts, int or) { + edges[idx+SLOPE] = (pts[2] - pts[0]) / (pts[3] - pts[1]); + edges[idx+CURX] = pts[0] + (edges[idx+CURY] - pts[1]) * edges[idx+SLOPE]; + } + + private void initQuad(final int idx, float[] points, int or) { + final int countlg = 3; + final int count = 1 << countlg; + + // the dx and dy refer to forward differencing variables, not the last + // coefficients of the "points" polynomial + final float ddx, ddy, dx, dy; + c.set(points, 6); + + ddx = c.dbx / (1 << (2 * countlg)); + ddy = c.dby / (1 << (2 * countlg)); + dx = c.bx / (1 << (2 * countlg)) + c.cx / (1 << countlg); + dy = c.by / (1 << (2 * countlg)) + c.cy / (1 << countlg); + + quads[idx+DDX] = ddx; + quads[idx+DDY] = ddy; + quads[idx+DX] = dx; + quads[idx+DY] = dy; + quads[idx+COUNT] = count; + quads[idx+XL] = points[4]; + quads[idx+X0] = points[0]; + quads[idx+Y0] = points[1]; + executeQuadAFDIteration(idx); + float x1 = quads[idx+X0], y1 = quads[idx+Y0]; + quads[idx+CURSLOPE] = (x1 - points[0]) / (y1 - points[1]); + quads[idx+CURX] = points[0] + (quads[idx+CURY] - points[1])*quads[idx+CURSLOPE]; + } + + private void initCurve(final int idx, float[] points, int or) { + final int countlg = 3; + final int count = 1 << countlg; + + // the dx and dy refer to forward differencing variables, not the last + // coefficients of the "points" polynomial + final float dddx, dddy, ddx, ddy, dx, dy; + c.set(points, 8); + dddx = 2f * c.dax / (1 << (3 * countlg)); + dddy = 2f * c.day / (1 << (3 * countlg)); + + ddx = dddx + c.dbx / (1 << (2 * countlg)); + ddy = dddy + c.dby / (1 << (2 * countlg)); + dx = c.ax / (1 << (3 * countlg)) + c.bx / (1 << (2 * countlg)) + c.cx / (1 << countlg); + dy = c.ay / (1 << (3 * countlg)) + c.by / (1 << (2 * countlg)) + c.cy / (1 << countlg); + + curves[idx+DDDX] = dddx; + curves[idx+DDDY] = dddy; + curves[idx+DDX] = ddx; + curves[idx+DDY] = ddy; + curves[idx+DX] = dx; + curves[idx+DY] = dy; + curves[idx+COUNT] = count; + curves[idx+XL] = points[6]; + curves[idx+X0] = points[0]; + curves[idx+Y0] = points[1]; + executeCurveAFDIteration(idx); + float x1 = curves[idx+X0], y1 = curves[idx+Y0]; + curves[idx+CURSLOPE] = (x1 - points[0]) / (y1 - points[1]); + curves[idx+CURX] = points[0] + (curves[idx+CURY] - points[1])*curves[idx+CURSLOPE]; + } + + private void addPathSegment(float[] pts, final int type, final int or) { + int idx; + float[] addTo; + switch (type) { + case 4: + idx = numEdges * SIZEOF_EDGE; + addTo = edges = Helpers.widenArray(edges, numEdges*SIZEOF_EDGE, SIZEOF_EDGE); + numEdges++; + break; + case 6: + idx = numQuads * SIZEOF_QUAD; + addTo = quads = Helpers.widenArray(quads, numQuads*SIZEOF_QUAD, SIZEOF_QUAD); + numQuads++; + break; + case 8: + idx = numCurves * SIZEOF_CURVE; + addTo = curves = Helpers.widenArray(curves, numCurves*SIZEOF_CURVE, SIZEOF_CURVE); + numCurves++; + break; + default: + throw new InternalError(); + } + // set the common fields, except CURX, for which we must know the kind + // of curve. NOTE: this must be done before the type specific fields + // are initialized, because those depend on the common ones. + addTo[idx+YMIN] = pts[1]; + addTo[idx+YMAX] = pts[type-1]; + addTo[idx+OR] = or; + addTo[idx+CURY] = (float)Math.ceil(pts[1]); + switch (type) { + case 4: + initLine(idx, pts, or); + break; + case 6: + initQuad(idx, pts, or); + break; + case 8: + initCurve(idx, pts, or); + break; + default: + throw new InternalError(); + } + } + + // precondition: the curve in pts must be monotonic and increasing in y. + private void somethingTo(float[] pts, final int type, final int or) { + // NOTE: it's very important that we check for or >= 0 below (as + // opposed to or == 1, or or > 0, or anything else). That's + // because if we check for or==1, when the curve being added + // is a horizontal line, or will be 0 so or==1 will be false and + // x0 and y0 will be updated to pts[0] and pts[1] instead of pts[type-2] + // and pts[type-1], which is the correct thing to do. + this.x0 = or >= 0 ? pts[type - 2] : pts[0]; + this.y0 = or >= 0 ? pts[type - 1] : pts[1]; + + float minY = pts[1], maxY = pts[type - 1]; + if (Math.ceil(minY) >= Math.ceil(maxY) || + Math.ceil(minY) >= boundsMaxY || maxY < boundsMinY) + { return; } - int newSize = edgesSize + SIZEOF_STRUCT_EDGE; - if (edges.length < newSize) { - edges = Arrays.copyOf(edges, newSize * 2); - } - edges[edgesSize+CURX] = x0; - edges[edgesSize+CURY] = y0; - edges[edgesSize+Y1] = y1; - edges[edgesSize+SLOPE] = (x1 - x0) / (y1 - y0); - edges[edgesSize+OR] = or; - // the crossing values can't be initialized meaningfully yet. This - // will have to wait until setCurY is called - edgesSize += SIZEOF_STRUCT_EDGE; + if (minY < edgeMinY) { edgeMinY = minY; } + if (maxY > edgeMaxY) { edgeMaxY = maxY; } - // Accumulate edgeMinY and edgeMaxY - if (y0 < edgeMinY) { edgeMinY = y0; } - if (y1 > edgeMaxY) { edgeMaxY = y1; } + int minXidx = (pts[0] < pts[type-2] ? 0 : type - 2); + float minX = pts[minXidx]; + float maxX = pts[type - 2 - minXidx]; + if (minX < edgeMinX) { edgeMinX = minX; } + if (maxX > edgeMaxX) { edgeMaxX = maxX; } + addPathSegment(pts, type, or); } - // As far as the following methods care, this edges extends to infinity. - // They can compute the x intersect of any horizontal line. - // precondition: idx is the index to the start of the desired edge. - // So, if the ith edge is wanted, idx should be SIZEOF_STRUCT_EDGE * i - private void setCurY(int idx, int y) { - // compute the x crossing of edge at idx and horizontal line y - // currentXCrossing = (y - y0)*slope + x0 - edges[idx + CURX] = (y - edges[idx + CURY]) * edges[idx + SLOPE] + edges[idx+CURX]; - edges[idx + CURY] = (float)y; - } +// END EDGE LIST +////////////////////////////////////////////////////////////////////////////// - private void gotoNextY(int idx) { - edges[idx + CURY] += 1f; // i.e. curY += 1 - edges[idx + CURX] += edges[idx + SLOPE]; // i.e. curXCrossing += slope - } - - private int getCurCrossing(int idx) { - return (int)edges[idx + CURX]; - } -//==================================================================================== public static final int WIND_EVEN_ODD = 0; public static final int WIND_NON_ZERO = 1; @@ -284,16 +586,13 @@ public class Renderer implements LineSink { final int MAX_AA_ALPHA; // Cache to store RLE-encoded coverage mask of the current primitive - final PiscesCache cache; + PiscesCache cache; // Bounds of the drawing region, at subpixel precision. - final private int boundsMinX, boundsMinY, boundsMaxX, boundsMaxY; - - // Pixel bounding box for current primitive - private int pix_bboxX0, pix_bboxY0, pix_bboxX1, pix_bboxY1; + private final int boundsMinX, boundsMinY, boundsMaxX, boundsMaxY; // Current winding rule - final private int windingRule; + private final int windingRule; // Current drawing position, i.e., final point of last segment private float x0, y0; @@ -304,8 +603,8 @@ public class Renderer implements LineSink { public Renderer(int subpixelLgPositionsX, int subpixelLgPositionsY, int pix_boundsX, int pix_boundsY, int pix_boundsWidth, int pix_boundsHeight, - int windingRule, - PiscesCache cache) { + int windingRule) + { this.SUBPIXEL_LG_POSITIONS_X = subpixelLgPositionsX; this.SUBPIXEL_LG_POSITIONS_Y = subpixelLgPositionsY; this.SUBPIXEL_MASK_X = (1 << (SUBPIXEL_LG_POSITIONS_X)) - 1; @@ -314,23 +613,12 @@ public class Renderer implements LineSink { this.SUBPIXEL_POSITIONS_Y = 1 << (SUBPIXEL_LG_POSITIONS_Y); this.MAX_AA_ALPHA = (SUBPIXEL_POSITIONS_X * SUBPIXEL_POSITIONS_Y); - this.edges = new float[SIZEOF_STRUCT_EDGE * INIT_NUM_EDGES]; - edgeMinY = Float.POSITIVE_INFINITY; - edgeMaxY = Float.NEGATIVE_INFINITY; - edgesSize = 0; - this.windingRule = windingRule; - this.cache = cache; this.boundsMinX = pix_boundsX * SUBPIXEL_POSITIONS_X; this.boundsMinY = pix_boundsY * SUBPIXEL_POSITIONS_Y; this.boundsMaxX = (pix_boundsX + pix_boundsWidth) * SUBPIXEL_POSITIONS_X; this.boundsMaxY = (pix_boundsY + pix_boundsHeight) * SUBPIXEL_POSITIONS_Y; - - this.pix_bboxX0 = pix_boundsX; - this.pix_bboxY0 = pix_boundsY; - this.pix_bboxX1 = pix_boundsX + pix_boundsWidth; - this.pix_bboxY1 = pix_boundsY + pix_boundsHeight; } private float tosubpixx(float pix_x) { @@ -341,7 +629,7 @@ public class Renderer implements LineSink { } public void moveTo(float pix_x0, float pix_y0) { - close(); + closePath(); this.pix_sx0 = pix_x0; this.pix_sy0 = pix_y0; this.y0 = tosubpixy(pix_y0); @@ -350,39 +638,102 @@ public class Renderer implements LineSink { public void lineJoin() { /* do nothing */ } - public void lineTo(float pix_x1, float pix_y1) { - float x1 = tosubpixx(pix_x1); - float y1 = tosubpixy(pix_y1); + private final float[][] pts = new float[2][8]; + private final float[] ts = new float[4]; - // Ignore horizontal lines - if (y0 == y1) { - this.x0 = x1; - return; + private static void invertPolyPoints(float[] pts, int off, int type) { + for (int i = off, j = off + type - 2; i < j; i += 2, j -= 2) { + float tmp = pts[i]; + pts[i] = pts[j]; + pts[j] = tmp; + tmp = pts[i+1]; + pts[i+1] = pts[j+1]; + pts[j+1] = tmp; } - - addEdge(x0, y0, x1, y1); - - this.x0 = x1; - this.y0 = y1; } - public void close() { + // return orientation before making the curve upright. + private static int makeMonotonicCurveUpright(float[] pts, int off, int type) { + float y0 = pts[off + 1]; + float y1 = pts[off + type - 1]; + if (y0 > y1) { + invertPolyPoints(pts, off, type); + return -1; + } else if (y0 < y1) { + return 1; + } + return 0; + } + + public void lineTo(float pix_x1, float pix_y1) { + pts[0][0] = x0; pts[0][1] = y0; + pts[0][2] = tosubpixx(pix_x1); pts[0][3] = tosubpixy(pix_y1); + int or = makeMonotonicCurveUpright(pts[0], 0, 4); + somethingTo(pts[0], 4, or); + } + + Curve c = new Curve(); + private void curveOrQuadTo(int type) { + c.set(pts[0], type); + int numTs = c.dxRoots(ts, 0); + numTs += c.dyRoots(ts, numTs); + numTs = Helpers.filterOutNotInAB(ts, 0, numTs, 0, 1); + Helpers.isort(ts, 0, numTs); + + Iterator it = Curve.breakPtsAtTs(pts, type, ts, numTs); + while(it.hasNext()) { + float[] curCurve = it.next(); + int or = makeMonotonicCurveUpright(curCurve, 0, type); + somethingTo(curCurve, type, or); + } + } + + @Override public void curveTo(float x1, float y1, + float x2, float y2, + float x3, float y3) + { + pts[0][0] = x0; pts[0][1] = y0; + pts[0][2] = tosubpixx(x1); pts[0][3] = tosubpixy(y1); + pts[0][4] = tosubpixx(x2); pts[0][5] = tosubpixy(y2); + pts[0][6] = tosubpixx(x3); pts[0][7] = tosubpixy(y3); + curveOrQuadTo(8); + } + + @Override public void quadTo(float x1, float y1, float x2, float y2) { + pts[0][0] = x0; pts[0][1] = y0; + pts[0][2] = tosubpixx(x1); pts[0][3] = tosubpixy(y1); + pts[0][4] = tosubpixx(x2); pts[0][5] = tosubpixy(y2); + curveOrQuadTo(6); + } + + public void closePath() { // lineTo expects its input in pixel coordinates. lineTo(pix_sx0, pix_sy0); } - public void end() { - close(); + public void pathDone() { + closePath(); } - private void _endRendering() { + + @Override + public long getNativeConsumer() { + throw new InternalError("Renderer does not use a native consumer."); + } + + private void _endRendering(final int pix_bboxx0, final int pix_bboxy0, + final int pix_bboxx1, final int pix_bboxy1) + { // Mask to determine the relevant bit of the crossing sum // 0x1 if EVEN_ODD, all bits if NON_ZERO int mask = (windingRule == WIND_EVEN_ODD) ? 0x1 : ~0x0; // add 1 to better deal with the last pixel in a pixel row. - int width = ((boundsMaxX - boundsMinX) >> SUBPIXEL_LG_POSITIONS_X) + 1; - byte[] alpha = new byte[width+1]; + int width = pix_bboxx1 - pix_bboxx0 + 1; + int[] alpha = new int[width+1]; + + int bboxx0 = pix_bboxx0 << SUBPIXEL_LG_POSITIONS_X; + int bboxx1 = pix_bboxx1 << SUBPIXEL_LG_POSITIONS_X; // Now we iterate through the scanlines. We must tell emitRow the coord // of the first non-transparent pixel, so we must keep accumulators for @@ -394,33 +745,34 @@ public class Renderer implements LineSink { int pix_minX = Integer.MAX_VALUE; int y = boundsMinY; // needs to be declared here so we emit the last row properly. - ScanLineItInitialize(); - for ( ; ScanLineItHasNext(); ) { - int numCrossings = ScanLineItGoToNextYAndComputeCrossings(); - y = ScanLineItCurrentY(); + ScanlineIterator it = this.new ScanlineIterator(); + for ( ; it.hasNext(); ) { + int numCrossings = it.next(); + int[] crossings = it.crossings; + y = it.curY(); if (numCrossings > 0) { int lowx = crossings[0] >> 1; int highx = crossings[numCrossings - 1] >> 1; - int x0 = Math.max(lowx, boundsMinX); - int x1 = Math.min(highx, boundsMaxX); + int x0 = Math.max(lowx, bboxx0); + int x1 = Math.min(highx, bboxx1); pix_minX = Math.min(pix_minX, x0 >> SUBPIXEL_LG_POSITIONS_X); pix_maxX = Math.max(pix_maxX, x1 >> SUBPIXEL_LG_POSITIONS_X); } int sum = 0; - int prev = boundsMinX; + int prev = bboxx0; for (int i = 0; i < numCrossings; i++) { int curxo = crossings[i]; int curx = curxo >> 1; int crorientation = ((curxo & 0x1) == 0x1) ? 1 : -1; if ((sum & mask) != 0) { - int x0 = Math.max(prev, boundsMinX); - int x1 = Math.min(curx, boundsMaxX); + int x0 = Math.max(prev, bboxx0); + int x1 = Math.min(curx, bboxx1); if (x0 < x1) { - x0 -= boundsMinX; // turn x0, x1 from coords to indeces - x1 -= boundsMinX; // in the alpha array. + x0 -= bboxx0; // turn x0, x1 from coords to indeces + x1 -= bboxx0; // in the alpha array. int pix_x = x0 >> SUBPIXEL_LG_POSITIONS_X; int pix_xmaxm1 = (x1 - 1) >> SUBPIXEL_LG_POSITIONS_X; @@ -442,6 +794,9 @@ public class Renderer implements LineSink { prev = curx; } + // even if this last row had no crossings, alpha will be zeroed + // from the last emitRow call. But this doesn't matter because + // maxX < minX, so no row will be emitted to the cache. if ((y & SUBPIXEL_MASK_Y) == SUBPIXEL_MASK_Y) { emitRow(alpha, y >> SUBPIXEL_LG_POSITIONS_Y, pix_minX, pix_maxX); pix_minX = Integer.MAX_VALUE; @@ -453,47 +808,53 @@ public class Renderer implements LineSink { if (pix_maxX >= pix_minX) { emitRow(alpha, y >> SUBPIXEL_LG_POSITIONS_Y, pix_minX, pix_maxX); } - pix_bboxX0 = minX >> SUBPIXEL_LG_POSITIONS_X; - pix_bboxX1 = maxX >> SUBPIXEL_LG_POSITIONS_X; - pix_bboxY0 = minY >> SUBPIXEL_LG_POSITIONS_Y; - pix_bboxY1 = maxY >> SUBPIXEL_LG_POSITIONS_Y; } - public void endRendering() { - // Set up the cache to accumulate the bounding box - if (cache != null) { - cache.bboxX0 = Integer.MAX_VALUE; - cache.bboxY0 = Integer.MAX_VALUE; - cache.bboxX1 = Integer.MIN_VALUE; - cache.bboxY1 = Integer.MIN_VALUE; + final int bminx = boundsMinX >> SUBPIXEL_LG_POSITIONS_X; + final int bmaxx = boundsMaxX >> SUBPIXEL_LG_POSITIONS_X; + final int bminy = boundsMinY >> SUBPIXEL_LG_POSITIONS_Y; + final int bmaxy = boundsMaxY >> SUBPIXEL_LG_POSITIONS_Y; + final int eminx = ((int)Math.floor(edgeMinX)) >> SUBPIXEL_LG_POSITIONS_X; + final int emaxx = ((int)Math.ceil(edgeMaxX)) >> SUBPIXEL_LG_POSITIONS_X; + final int eminy = ((int)Math.floor(edgeMinY)) >> SUBPIXEL_LG_POSITIONS_Y; + final int emaxy = ((int)Math.ceil(edgeMaxY)) >> SUBPIXEL_LG_POSITIONS_Y; + + final int minX = Math.max(bminx, eminx); + final int maxX = Math.min(bmaxx, emaxx); + final int minY = Math.max(bminy, eminy); + final int maxY = Math.min(bmaxy, emaxy); + if (minX > maxX || minY > maxY) { + this.cache = new PiscesCache(bminx, bminy, bmaxx, bmaxy); + return; } - _endRendering(); + this.cache = new PiscesCache(minX, minY, maxX, maxY); + _endRendering(minX, minY, maxX, maxY); } - public void getBoundingBox(int[] pix_bbox) { - pix_bbox[0] = pix_bboxX0; - pix_bbox[1] = pix_bboxY0; - pix_bbox[2] = pix_bboxX1 - pix_bboxX0; - pix_bbox[3] = pix_bboxY1 - pix_bboxY0; + public PiscesCache getCache() { + if (cache == null) { + throw new InternalError("cache not yet initialized"); + } + return cache; } - private void emitRow(byte[] alphaRow, int pix_y, int pix_from, int pix_to) { + private void emitRow(int[] alphaRow, int pix_y, int pix_from, int pix_to) { // Copy rowAA data into the cache if one is present if (cache != null) { if (pix_to >= pix_from) { - cache.startRow(pix_y, pix_from, pix_to); + cache.startRow(pix_y, pix_from); // Perform run-length encoding and store results in the cache - int from = pix_from - (boundsMinX >> SUBPIXEL_LG_POSITIONS_X); - int to = pix_to - (boundsMinX >> SUBPIXEL_LG_POSITIONS_X); + int from = pix_from - cache.bboxX0; + int to = pix_to - cache.bboxX0; int runLen = 1; - byte startVal = alphaRow[from]; + int startVal = alphaRow[from]; for (int i = from + 1; i <= to; i++) { - byte nextVal = (byte)(startVal + alphaRow[i]); - if (nextVal == startVal && runLen < 255) { + int nextVal = startVal + alphaRow[i]; + if (nextVal == startVal) { runLen++; } else { cache.addRLERun(startVal, runLen); @@ -502,9 +863,8 @@ public class Renderer implements LineSink { } } cache.addRLERun(startVal, runLen); - cache.addRLERun((byte)0, 0); } } - java.util.Arrays.fill(alphaRow, (byte)0); + java.util.Arrays.fill(alphaRow, 0); } } diff --git a/jdk/src/share/classes/sun/java2d/pisces/Stroker.java b/jdk/src/share/classes/sun/java2d/pisces/Stroker.java index 574c460fea9..7136fd6ef92 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/Stroker.java +++ b/jdk/src/share/classes/sun/java2d/pisces/Stroker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,18 @@ package sun.java2d.pisces; -public class Stroker implements LineSink { +import java.util.Arrays; +import java.util.Iterator; + +import sun.awt.geom.PathConsumer2D; + +// TODO: some of the arithmetic here is too verbose and prone to hard to +// debug typos. We should consider making a small Point/Vector class that +// has methods like plus(Point), minus(Point), dot(Point), cross(Point)and such +public class Stroker implements PathConsumer2D { private static final int MOVE_TO = 0; - private static final int LINE_TO = 1; + private static final int DRAWING_OP_TO = 1; // ie. curve, line, or quad private static final int CLOSE = 2; /** @@ -61,57 +69,37 @@ public class Stroker implements LineSink { */ public static final int CAP_SQUARE = 2; - private final LineSink output; + private final PathConsumer2D out; private final int capStyle; private final int joinStyle; - private final float m00, m01, m10, m11, det; - private final float lineWidth2; - private final float scaledLineWidth2; - // For any pen offset (pen_dx, pen_dy) that does not depend on - // the line orientation, the pen should be transformed so that: - // - // pen_dx' = m00*pen_dx + m01*pen_dy - // pen_dy' = m10*pen_dx + m11*pen_dy - // - // For a round pen, this means: - // - // pen_dx(r, theta) = r*cos(theta) - // pen_dy(r, theta) = r*sin(theta) - // - // pen_dx'(r, theta) = r*(m00*cos(theta) + m01*sin(theta)) - // pen_dy'(r, theta) = r*(m10*cos(theta) + m11*sin(theta)) - private int numPenSegments; - private final float[] pen_dx; - private final float[] pen_dy; - private boolean[] penIncluded; - private final float[] join; - - private final float[] offset = new float[2]; - private float[] reverse = new float[100]; + private final float[][] offset = new float[3][2]; private final float[] miter = new float[2]; private final float miterLimitSq; private int prev; - private int rindex; - private boolean started; - private boolean lineToOrigin; - private boolean joinToOrigin; - private float sx0, sy0, sx1, sy1, x0, y0, px0, py0; - private float mx0, my0, omx, omy; + // The starting point of the path, and the slope there. + private float sx0, sy0, sdx, sdy; + // the current point and the slope there. + private float cx0, cy0, cdx, cdy; // c stands for current + // vectors that when added to (sx0,sy0) and (cx0,cy0) respectively yield the + // first and last points on the left parallel path. Since this path is + // parallel, it's slope at any point is parallel to the slope of the + // original path (thought they may have different directions), so these + // could be computed from sdx,sdy and cdx,cdy (and vice versa), but that + // would be error prone and hard to read, so we keep these anyway. + private float smx, smy, cmx, cmy; - private float m00_2_m01_2; - private float m10_2_m11_2; - private float m00_m10_m01_m11; + private final PolyStack reverse = new PolyStack(); /** * Constructs a Stroker. * - * @param output an output LineSink. + * @param pc2d an output PathConsumer2D. * @param lineWidth the desired line width in pixels * @param capStyle the desired end cap style, one of * CAP_BUTT, CAP_ROUND or @@ -120,183 +108,61 @@ public class Stroker implements LineSink { * JOIN_MITER, JOIN_ROUND or * JOIN_BEVEL. * @param miterLimit the desired miter limit - * @param transform a Transform4 object indicating - * the transform that has been previously applied to all incoming - * coordinates. This is required in order to produce consistently - * shaped end caps and joins. */ - public Stroker(LineSink output, + public Stroker(PathConsumer2D pc2d, float lineWidth, int capStyle, int joinStyle, - float miterLimit, - float m00, float m01, float m10, float m11) { - this.output = output; + float miterLimit) + { + this.out = pc2d; this.lineWidth2 = lineWidth / 2; - this.scaledLineWidth2 = m00 * lineWidth2; this.capStyle = capStyle; this.joinStyle = joinStyle; - m00_2_m01_2 = m00*m00 + m01*m01; - m10_2_m11_2 = m10*m10 + m11*m11; - m00_m10_m01_m11 = m00*m10 + m01*m11; - - this.m00 = m00; - this.m01 = m01; - this.m10 = m10; - this.m11 = m11; - det = m00*m11 - m01*m10; - - float limit = miterLimit * lineWidth2 * det; + float limit = miterLimit * lineWidth2; this.miterLimitSq = limit*limit; - this.numPenSegments = (int)(3.14159f * lineWidth); - this.pen_dx = new float[numPenSegments]; - this.pen_dy = new float[numPenSegments]; - this.penIncluded = new boolean[numPenSegments]; - this.join = new float[2*numPenSegments]; - - for (int i = 0; i < numPenSegments; i++) { - double theta = (i * 2.0 * Math.PI)/numPenSegments; - - double cos = Math.cos(theta); - double sin = Math.sin(theta); - pen_dx[i] = (float)(lineWidth2 * (m00*cos + m01*sin)); - pen_dy[i] = (float)(lineWidth2 * (m10*cos + m11*sin)); - } - - prev = CLOSE; - rindex = 0; - started = false; - lineToOrigin = false; + this.prev = CLOSE; } - private void computeOffset(float x0, float y0, - float x1, float y1, float[] m) { - float lx = x1 - x0; - float ly = y1 - y0; - - float dx, dy; - if (m00 > 0 && m00 == m11 && m01 == 0 & m10 == 0) { - float ilen = (float)Math.hypot(lx, ly); - if (ilen == 0) { - dx = dy = 0; - } else { - dx = (ly * scaledLineWidth2)/ilen; - dy = -(lx * scaledLineWidth2)/ilen; - } + private static void computeOffset(final float lx, final float ly, + final float w, final float[] m) + { + final float len = (float)Math.hypot(lx, ly); + if (len == 0) { + m[0] = m[1] = 0; } else { - int sdet = (det > 0) ? 1 : -1; - float a = ly * m00 - lx * m10; - float b = ly * m01 - lx * m11; - float dh = (float)Math.hypot(a, b); - float div = sdet * lineWidth2/dh; - - float ddx = ly * m00_2_m01_2 - lx * m00_m10_m01_m11; - float ddy = ly * m00_m10_m01_m11 - lx * m10_2_m11_2; - dx = ddx*div; - dy = ddy*div; - } - - m[0] = dx; - m[1] = dy; - } - - private void ensureCapacity(int newrindex) { - if (reverse.length < newrindex) { - reverse = java.util.Arrays.copyOf(reverse, 6*reverse.length/5); + m[0] = (ly * w)/len; + m[1] = -(lx * w)/len; } } - private boolean isCCW(float x0, float y0, - float x1, float y1, - float x2, float y2) { - return (x1 - x0) * (y2 - y1) < (y1 - y0) * (x2 - x1); - } - - private boolean side(float x, float y, - float x0, float y0, - float x1, float y1) { - return (y0 - y1)*x + (x1 - x0)*y + (x0*y1 - x1*y0) > 0; - } - - private int computeRoundJoin(float cx, float cy, - float xa, float ya, - float xb, float yb, - int side, - boolean flip, - float[] join) { - float px, py; - int ncoords = 0; - - boolean centerSide; - if (side == 0) { - centerSide = side(cx, cy, xa, ya, xb, yb); - } else { - centerSide = (side == 1); - } - for (int i = 0; i < numPenSegments; i++) { - px = cx + pen_dx[i]; - py = cy + pen_dy[i]; - - boolean penSide = side(px, py, xa, ya, xb, yb); - penIncluded[i] = (penSide != centerSide); - } - - int start = -1, end = -1; - for (int i = 0; i < numPenSegments; i++) { - if (penIncluded[i] && - !penIncluded[(i + numPenSegments - 1) % numPenSegments]) { - start = i; - } - if (penIncluded[i] && - !penIncluded[(i + 1) % numPenSegments]) { - end = i; - } - } - - if (end < start) { - end += numPenSegments; - } - - if (start != -1 && end != -1) { - float dxa = cx + pen_dx[start] - xa; - float dya = cy + pen_dy[start] - ya; - float dxb = cx + pen_dx[start] - xb; - float dyb = cy + pen_dy[start] - yb; - - boolean rev = (dxa*dxa + dya*dya > dxb*dxb + dyb*dyb); - int i = rev ? end : start; - int incr = rev ? -1 : 1; - while (true) { - int idx = i % numPenSegments; - px = cx + pen_dx[idx]; - py = cy + pen_dy[idx]; - join[ncoords++] = px; - join[ncoords++] = py; - if (i == (rev ? start : end)) { - break; - } - i += incr; - } - } - - return ncoords/2; + // Returns true if the vectors (dx1, dy1) and (dx2, dy2) are + // clockwise (if dx1,dy1 needs to be rotated clockwise to close + // the smallest angle between it and dx2,dy2). + // This is equivalent to detecting whether a point q is on the right side + // of a line passing through points p1, p2 where p2 = p1+(dx1,dy1) and + // q = p2+(dx2,dy2), which is the same as saying p1, p2, q are in a + // clockwise order. + // NOTE: "clockwise" here assumes coordinates with 0,0 at the bottom left. + private static boolean isCW(final float dx1, final float dy1, + final float dx2, final float dy2) + { + return dx1 * dy2 <= dy1 * dx2; } // pisces used to use fixed point arithmetic with 16 decimal digits. I - // didn't want to change the values of the constants below when I converted + // didn't want to change the values of the constant below when I converted // it to floating point, so that's why the divisions by 2^16 are there. private static final float ROUND_JOIN_THRESHOLD = 1000/65536f; - private static final float ROUND_JOIN_INTERNAL_THRESHOLD = 1000000000/65536f; private void drawRoundJoin(float x, float y, float omx, float omy, float mx, float my, - int side, - boolean flip, boolean rev, - float threshold) { + float threshold) + { if ((omx == 0 && omy == 0) || (mx == 0 && my == 0)) { return; } @@ -314,54 +180,148 @@ public class Stroker implements LineSink { mx = -mx; my = -my; } + drawRoundJoin(x, y, omx, omy, mx, my, rev); + } - float bx0 = x + omx; - float by0 = y + omy; - float bx1 = x + mx; - float by1 = y + my; + private void drawRoundJoin(float cx, float cy, + float omx, float omy, + float mx, float my, + boolean rev) + { + // The sign of the dot product of mx,my and omx,omy is equal to the + // the sign of the cosine of ext + // (ext is the angle between omx,omy and mx,my). + double cosext = omx * mx + omy * my; + // If it is >=0, we know that abs(ext) is <= 90 degrees, so we only + // need 1 curve to approximate the circle section that joins omx,omy + // and mx,my. + final int numCurves = cosext >= 0 ? 1 : 2; - int npoints = computeRoundJoin(x, y, - bx0, by0, bx1, by1, side, flip, - join); - for (int i = 0; i < npoints; i++) { - emitLineTo(join[2*i], join[2*i + 1], rev); + switch (numCurves) { + case 1: + drawBezApproxForArc(cx, cy, omx, omy, mx, my, rev); + break; + case 2: + // we need to split the arc into 2 arcs spanning the same angle. + // The point we want will be one of the 2 intersections of the + // perpendicular bisector of the chord (omx,omy)->(mx,my) and the + // circle. We could find this by scaling the vector + // (omx+mx, omy+my)/2 so that it has length=lineWidth2 (and thus lies + // on the circle), but that can have numerical problems when the angle + // between omx,omy and mx,my is close to 180 degrees. So we compute a + // normal of (omx,omy)-(mx,my). This will be the direction of the + // perpendicular bisector. To get one of the intersections, we just scale + // this vector that its length is lineWidth2 (this works because the + // perpendicular bisector goes through the origin). This scaling doesn't + // have numerical problems because we know that lineWidth2 divided by + // this normal's length is at least 0.5 and at most sqrt(2)/2 (because + // we know the angle of the arc is > 90 degrees). + float nx = my - omy, ny = omx - mx; + float nlen = (float)Math.sqrt(nx*nx + ny*ny); + float scale = lineWidth2/nlen; + float mmx = nx * scale, mmy = ny * scale; + + // if (isCW(omx, omy, mx, my) != isCW(mmx, mmy, mx, my)) then we've + // computed the wrong intersection so we get the other one. + // The test above is equivalent to if (rev). + if (rev) { + mmx = -mmx; + mmy = -mmy; + } + drawBezApproxForArc(cx, cy, omx, omy, mmx, mmy, rev); + drawBezApproxForArc(cx, cy, mmx, mmy, mx, my, rev); + break; } } - // Return the intersection point of the lines (ix0, iy0) -> (ix1, iy1) - // and (ix0p, iy0p) -> (ix1p, iy1p) in m[0] and m[1] - private void computeMiter(float x0, float y0, float x1, float y1, - float x0p, float y0p, float x1p, float y1p, - float[] m) { + // the input arc defined by omx,omy and mx,my must span <= 90 degrees. + private void drawBezApproxForArc(final float cx, final float cy, + final float omx, final float omy, + final float mx, final float my, + boolean rev) + { + float cosext2 = (omx * mx + omy * my) / (2 * lineWidth2 * lineWidth2); + // cv is the length of P1-P0 and P2-P3 divided by the radius of the arc + // (so, cv assumes the arc has radius 1). P0, P1, P2, P3 are the points that + // define the bezier curve we're computing. + // It is computed using the constraints that P1-P0 and P3-P2 are parallel + // to the arc tangents at the endpoints, and that |P1-P0|=|P3-P2|. + float cv = (float)((4.0 / 3.0) * Math.sqrt(0.5-cosext2) / + (1.0 + Math.sqrt(cosext2+0.5))); + // if clockwise, we need to negate cv. + if (rev) { // rev is equivalent to isCW(omx, omy, mx, my) + cv = -cv; + } + final float x1 = cx + omx; + final float y1 = cy + omy; + final float x2 = x1 - cv * omy; + final float y2 = y1 + cv * omx; + + final float x4 = cx + mx; + final float y4 = cy + my; + final float x3 = x4 + cv * my; + final float y3 = y4 - cv * mx; + + emitCurveTo(x1, y1, x2, y2, x3, y3, x4, y4, rev); + } + + private void drawRoundCap(float cx, float cy, float mx, float my) { + final float C = 0.5522847498307933f; + // the first and second arguments of the following two calls + // are really will be ignored by emitCurveTo (because of the false), + // but we put them in anyway, as opposed to just giving it 4 zeroes, + // because it's just 4 additions and it's not good to rely on this + // sort of assumption (right now it's true, but that may change). + emitCurveTo(cx+mx, cy+my, + cx+mx-C*my, cy+my+C*mx, + cx-my+C*mx, cy+mx+C*my, + cx-my, cy+mx, + false); + emitCurveTo(cx-my, cy+mx, + cx-my-C*mx, cy+mx-C*my, + cx-mx-C*my, cy-my+C*mx, + cx-mx, cy-my, + false); + } + + // Return the intersection point of the lines (x0, y0) -> (x1, y1) + // and (x0p, y0p) -> (x1p, y1p) in m[0] and m[1] + private void computeMiter(final float x0, final float y0, + final float x1, final float y1, + final float x0p, final float y0p, + final float x1p, final float y1p, + final float[] m, int off) + { float x10 = x1 - x0; float y10 = y1 - y0; float x10p = x1p - x0p; float y10p = y1p - y0p; + // if this is 0, the lines are parallel. If they go in the + // same direction, there is no intersection so m[off] and + // m[off+1] will contain infinity, so no miter will be drawn. + // If they go in the same direction that means that the start of the + // current segment and the end of the previous segment have the same + // tangent, in which case this method won't even be involved in + // miter drawing because it won't be called by drawMiter (because + // (mx == omx && my == omy) will be true, and drawMiter will return + // immediately). float den = x10*y10p - x10p*y10; - if (den == 0) { - m[0] = x0; - m[1] = y0; - return; - } - - float t = x1p*(y0 - y0p) - x0*y10p + x0p*(y1p - y0); - m[0] = x0 + (t*x10)/den; - m[1] = y0 + (t*y10)/den; + float t = x10p*(y0-y0p) - y10p*(x0-x0p); + t /= den; + m[off++] = x0 + t*x10; + m[off] = y0 + t*y10; } - private void drawMiter(float px0, float py0, - float x0, float y0, - float x1, float y1, + private void drawMiter(final float pdx, final float pdy, + final float x0, final float y0, + final float dx, final float dy, float omx, float omy, float mx, float my, - boolean rev) { - if (mx == omx && my == omy) { - return; - } - if (px0 == x0 && py0 == y0) { - return; - } - if (x0 == x1 && y0 == y1) { + boolean rev) + { + if ((mx == omx && my == omy) || + (pdx == 0 && pdy == 0) || + (dx == 0 && dy == 0)) { return; } @@ -372,297 +332,734 @@ public class Stroker implements LineSink { my = -my; } - computeMiter(px0 + omx, py0 + omy, x0 + omx, y0 + omy, - x0 + mx, y0 + my, x1 + mx, y1 + my, - miter); + computeMiter((x0 - pdx) + omx, (y0 - pdy) + omy, x0 + omx, y0 + omy, + (dx + x0) + mx, (dy + y0) + my, x0 + mx, y0 + my, + miter, 0); - // Compute miter length in untransformed coordinates - float dx = miter[0] - x0; - float dy = miter[1] - y0; - float a = dy*m00 - dx*m10; - float b = dy*m01 - dx*m11; - float lenSq = a*a + b*b; + float lenSq = (miter[0]-x0)*(miter[0]-x0) + (miter[1]-y0)*(miter[1]-y0); if (lenSq < miterLimitSq) { emitLineTo(miter[0], miter[1], rev); } } - public void moveTo(float x0, float y0) { - // System.out.println("Stroker.moveTo(" + x0/65536.0 + ", " + y0/65536.0 + ")"); - - if (lineToOrigin) { - // not closing the path, do the previous lineTo - lineToImpl(sx0, sy0, joinToOrigin); - lineToOrigin = false; - } - - if (prev == LINE_TO) { + if (prev == DRAWING_OP_TO) { finish(); } - - this.sx0 = this.x0 = x0; - this.sy0 = this.y0 = y0; - this.rindex = 0; - this.started = false; - this.joinSegment = false; + this.sx0 = this.cx0 = x0; + this.sy0 = this.cy0 = y0; + this.cdx = this.sdx = 1; + this.cdy = this.sdy = 0; this.prev = MOVE_TO; } - boolean joinSegment = false; - - public void lineJoin() { - // System.out.println("Stroker.lineJoin()"); - this.joinSegment = true; - } - public void lineTo(float x1, float y1) { - // System.out.println("Stroker.lineTo(" + x1/65536.0 + ", " + y1/65536.0 + ")"); - - if (lineToOrigin) { - if (x1 == sx0 && y1 == sy0) { - // staying in the starting point - return; - } - - // not closing the path, do the previous lineTo - lineToImpl(sx0, sy0, joinToOrigin); - lineToOrigin = false; - } else if (x1 == x0 && y1 == y0) { - return; - } else if (x1 == sx0 && y1 == sy0) { - lineToOrigin = true; - joinToOrigin = joinSegment; - joinSegment = false; - return; + float dx = x1 - cx0; + float dy = y1 - cy0; + if (dx == 0f && dy == 0f) { + dx = 1; } + computeOffset(dx, dy, lineWidth2, offset[0]); + float mx = offset[0][0]; + float my = offset[0][1]; - lineToImpl(x1, y1, joinSegment); - joinSegment = false; - } + drawJoin(cdx, cdy, cx0, cy0, dx, dy, cmx, cmy, mx, my); - private void lineToImpl(float x1, float y1, boolean joinSegment) { - computeOffset(x0, y0, x1, y1, offset); - float mx = offset[0]; - float my = offset[1]; + emitLineTo(cx0 + mx, cy0 + my); + emitLineTo(x1 + mx, y1 + my); - if (!started) { - emitMoveTo(x0 + mx, y0 + my); - this.sx1 = x1; - this.sy1 = y1; - this.mx0 = mx; - this.my0 = my; - started = true; - } else { - boolean ccw = isCCW(px0, py0, x0, y0, x1, y1); - if (joinSegment) { - if (joinStyle == JOIN_MITER) { - drawMiter(px0, py0, x0, y0, x1, y1, omx, omy, mx, my, - ccw); - } else if (joinStyle == JOIN_ROUND) { - drawRoundJoin(x0, y0, - omx, omy, - mx, my, 0, false, ccw, - ROUND_JOIN_THRESHOLD); - } - } else { - // Draw internal joins as round - drawRoundJoin(x0, y0, - omx, omy, - mx, my, 0, false, ccw, - ROUND_JOIN_INTERNAL_THRESHOLD); - } - - emitLineTo(x0, y0, !ccw); - } - - emitLineTo(x0 + mx, y0 + my, false); - emitLineTo(x1 + mx, y1 + my, false); - - emitLineTo(x0 - mx, y0 - my, true); + emitLineTo(cx0 - mx, cy0 - my, true); emitLineTo(x1 - mx, y1 - my, true); - this.omx = mx; - this.omy = my; - this.px0 = x0; - this.py0 = y0; - this.x0 = x1; - this.y0 = y1; - this.prev = LINE_TO; + this.cmx = mx; + this.cmy = my; + this.cdx = dx; + this.cdy = dy; + this.cx0 = x1; + this.cy0 = y1; + this.prev = DRAWING_OP_TO; } - public void close() { - // System.out.println("Stroker.close()"); - - if (lineToOrigin) { - // ignore the previous lineTo - lineToOrigin = false; - } - - if (!started) { + public void closePath() { + if (prev != DRAWING_OP_TO) { + if (prev == CLOSE) { + return; + } + emitMoveTo(cx0, cy0 - lineWidth2); + this.cmx = this.smx = 0; + this.cmy = this.smy = -lineWidth2; + this.cdx = this.sdx = 1; + this.cdy = this.sdy = 0; finish(); return; } - computeOffset(x0, y0, sx0, sy0, offset); - float mx = offset[0]; - float my = offset[1]; - - // Draw penultimate join - boolean ccw = isCCW(px0, py0, x0, y0, sx0, sy0); - if (joinSegment) { - if (joinStyle == JOIN_MITER) { - drawMiter(px0, py0, x0, y0, sx0, sy0, omx, omy, mx, my, ccw); - } else if (joinStyle == JOIN_ROUND) { - drawRoundJoin(x0, y0, omx, omy, mx, my, 0, false, ccw, - ROUND_JOIN_THRESHOLD); - } - } else { - // Draw internal joins as round - drawRoundJoin(x0, y0, - omx, omy, - mx, my, 0, false, ccw, - ROUND_JOIN_INTERNAL_THRESHOLD); + if (cx0 != sx0 || cy0 != sy0) { + lineTo(sx0, sy0); } - emitLineTo(x0 + mx, y0 + my); - emitLineTo(sx0 + mx, sy0 + my); + drawJoin(cdx, cdy, cx0, cy0, sdx, sdy, cmx, cmy, smx, smy); - ccw = isCCW(x0, y0, sx0, sy0, sx1, sy1); + emitLineTo(sx0 + smx, sy0 + smy); - // Draw final join on the outside - if (!ccw) { - if (joinStyle == JOIN_MITER) { - drawMiter(x0, y0, sx0, sy0, sx1, sy1, - mx, my, mx0, my0, false); - } else if (joinStyle == JOIN_ROUND) { - drawRoundJoin(sx0, sy0, mx, my, mx0, my0, 0, false, false, - ROUND_JOIN_THRESHOLD); - } - } + emitMoveTo(sx0 - smx, sy0 - smy); + emitReverse(); - emitLineTo(sx0 + mx0, sy0 + my0); - emitLineTo(sx0 - mx0, sy0 - my0); // same as reverse[0], reverse[1] - - // Draw final join on the inside - if (ccw) { - if (joinStyle == JOIN_MITER) { - drawMiter(x0, y0, sx0, sy0, sx1, sy1, - -mx, -my, -mx0, -my0, false); - } else if (joinStyle == JOIN_ROUND) { - drawRoundJoin(sx0, sy0, -mx, -my, -mx0, -my0, 0, - true, false, - ROUND_JOIN_THRESHOLD); - } - } - - emitLineTo(sx0 - mx, sy0 - my); - emitLineTo(x0 - mx, y0 - my); - for (int i = rindex - 2; i >= 0; i -= 2) { - emitLineTo(reverse[i], reverse[i + 1]); - } - - this.x0 = this.sx0; - this.y0 = this.sy0; - this.rindex = 0; - this.started = false; - this.joinSegment = false; this.prev = CLOSE; emitClose(); } - public void end() { - // System.out.println("Stroker.end()"); - - if (lineToOrigin) { - // not closing the path, do the previous lineTo - lineToImpl(sx0, sy0, joinToOrigin); - lineToOrigin = false; + private void emitReverse() { + while(!reverse.isEmpty()) { + reverse.pop(out); } + } - if (prev == LINE_TO) { + public void pathDone() { + if (prev == DRAWING_OP_TO) { finish(); } - output.end(); - this.joinSegment = false; - this.prev = MOVE_TO; - } - - double userSpaceLineLength(double dx, double dy) { - double a = (dy*m00 - dx*m10)/det; - double b = (dy*m01 - dx*m11)/det; - return Math.hypot(a, b); + out.pathDone(); + // this shouldn't matter since this object won't be used + // after the call to this method. + this.prev = CLOSE; } private void finish() { if (capStyle == CAP_ROUND) { - drawRoundJoin(x0, y0, - omx, omy, -omx, -omy, 1, false, false, - ROUND_JOIN_THRESHOLD); + drawRoundCap(cx0, cy0, cmx, cmy); } else if (capStyle == CAP_SQUARE) { - float dx = px0 - x0; - float dy = py0 - y0; - float len = (float)userSpaceLineLength(dx, dy); - float s = lineWidth2/len; - - float capx = x0 - dx*s; - float capy = y0 - dy*s; - - emitLineTo(capx + omx, capy + omy); - emitLineTo(capx - omx, capy - omy); + emitLineTo(cx0 - cmy + cmx, cy0 + cmx + cmy); + emitLineTo(cx0 - cmy - cmx, cy0 + cmx - cmy); } - for (int i = rindex - 2; i >= 0; i -= 2) { - emitLineTo(reverse[i], reverse[i + 1]); - } - this.rindex = 0; + emitReverse(); if (capStyle == CAP_ROUND) { - drawRoundJoin(sx0, sy0, - -mx0, -my0, mx0, my0, 1, false, false, - ROUND_JOIN_THRESHOLD); + drawRoundCap(sx0, sy0, -smx, -smy); } else if (capStyle == CAP_SQUARE) { - float dx = sx1 - sx0; - float dy = sy1 - sy0; - float len = (float)userSpaceLineLength(dx, dy); - float s = lineWidth2/len; - - float capx = sx0 - dx*s; - float capy = sy0 - dy*s; - - emitLineTo(capx - mx0, capy - my0); - emitLineTo(capx + mx0, capy + my0); + emitLineTo(sx0 + smy - smx, sy0 - smx - smy); + emitLineTo(sx0 + smy + smx, sy0 - smx + smy); } emitClose(); - this.joinSegment = false; } - private void emitMoveTo(float x0, float y0) { - // System.out.println("Stroker.emitMoveTo(" + x0/65536.0 + ", " + y0/65536.0 + ")"); - output.moveTo(x0, y0); + private void emitMoveTo(final float x0, final float y0) { + out.moveTo(x0, y0); } - private void emitLineTo(float x1, float y1) { - // System.out.println("Stroker.emitLineTo(" + x0/65536.0 + ", " + y0/65536.0 + ")"); - output.lineTo(x1, y1); + private void emitLineTo(final float x1, final float y1) { + out.lineTo(x1, y1); } - private void emitLineTo(float x1, float y1, boolean rev) { + private void emitLineTo(final float x1, final float y1, + final boolean rev) + { if (rev) { - ensureCapacity(rindex + 2); - reverse[rindex++] = x1; - reverse[rindex++] = y1; + reverse.pushLine(x1, y1); } else { emitLineTo(x1, y1); } } + private void emitQuadTo(final float x0, final float y0, + final float x1, final float y1, + final float x2, final float y2, final boolean rev) + { + if (rev) { + reverse.pushQuad(x0, y0, x1, y1); + } else { + out.quadTo(x1, y1, x2, y2); + } + } + + private void emitCurveTo(final float x0, final float y0, + final float x1, final float y1, + final float x2, final float y2, + final float x3, final float y3, final boolean rev) + { + if (rev) { + reverse.pushCubic(x0, y0, x1, y1, x2, y2); + } else { + out.curveTo(x1, y1, x2, y2, x3, y3); + } + } + private void emitClose() { - // System.out.println("Stroker.emitClose()"); - output.close(); + out.closePath(); + } + + private void drawJoin(float pdx, float pdy, + float x0, float y0, + float dx, float dy, + float omx, float omy, + float mx, float my) + { + if (prev != DRAWING_OP_TO) { + emitMoveTo(x0 + mx, y0 + my); + this.sdx = dx; + this.sdy = dy; + this.smx = mx; + this.smy = my; + } else { + boolean cw = isCW(pdx, pdy, dx, dy); + if (joinStyle == JOIN_MITER) { + drawMiter(pdx, pdy, x0, y0, dx, dy, omx, omy, mx, my, cw); + } else if (joinStyle == JOIN_ROUND) { + drawRoundJoin(x0, y0, + omx, omy, + mx, my, cw, + ROUND_JOIN_THRESHOLD); + } + emitLineTo(x0, y0, !cw); + } + prev = DRAWING_OP_TO; + } + + private static boolean within(final float x1, final float y1, + final float x2, final float y2, + final float ERR) + { + assert ERR > 0 : ""; + // compare taxicab distance. ERR will always be small, so using + // true distance won't give much benefit + return (Helpers.within(x1, x2, ERR) && // we want to avoid calling Math.abs + Helpers.within(y1, y2, ERR)); // this is just as good. + } + + private void getLineOffsets(float x1, float y1, + float x2, float y2, + float[] left, float[] right) { + computeOffset(x2 - x1, y2 - y1, lineWidth2, offset[0]); + left[0] = x1 + offset[0][0]; + left[1] = y1 + offset[0][1]; + left[2] = x2 + offset[0][0]; + left[3] = y2 + offset[0][1]; + right[0] = x1 - offset[0][0]; + right[1] = y1 - offset[0][1]; + right[2] = x2 - offset[0][0]; + right[3] = y2 - offset[0][1]; + } + + private int computeOffsetCubic(float[] pts, final int off, + float[] leftOff, float[] rightOff) + { + // if p1=p2 or p3=p4 it means that the derivative at the endpoint + // vanishes, which creates problems with computeOffset. Usually + // this happens when this stroker object is trying to winden + // a curve with a cusp. What happens is that curveTo splits + // the input curve at the cusp, and passes it to this function. + // because of inaccuracies in the splitting, we consider points + // equal if they're very close to each other. + final float x1 = pts[off + 0], y1 = pts[off + 1]; + final float x2 = pts[off + 2], y2 = pts[off + 3]; + final float x3 = pts[off + 4], y3 = pts[off + 5]; + final float x4 = pts[off + 6], y4 = pts[off + 7]; + + float dx4 = x4 - x3; + float dy4 = y4 - y3; + float dx1 = x2 - x1; + float dy1 = y2 - y1; + + // if p1 == p2 && p3 == p4: draw line from p1->p4, unless p1 == p4, + // in which case ignore if p1 == p2 + final boolean p1eqp2 = within(x1,y1,x2,y2, 6 * Math.ulp(y2)); + final boolean p3eqp4 = within(x3,y3,x4,y4, 6 * Math.ulp(y4)); + if (p1eqp2 && p3eqp4) { + getLineOffsets(x1, y1, x4, y4, leftOff, rightOff); + return 4; + } else if (p1eqp2) { + dx1 = x3 - x1; + dy1 = y3 - y1; + } else if (p3eqp4) { + dx4 = x4 - x2; + dy4 = y4 - y2; + } + + // if p2-p1 and p4-p3 are parallel, that must mean this curve is a line + float dotsq = (dx1 * dx4 + dy1 * dy4); + dotsq = dotsq * dotsq; + float l1sq = dx1 * dx1 + dy1 * dy1, l4sq = dx4 * dx4 + dy4 * dy4; + if (Helpers.within(dotsq, l1sq * l4sq, 4 * Math.ulp(dotsq))) { + getLineOffsets(x1, y1, x4, y4, leftOff, rightOff); + return 4; + } + +// What we're trying to do in this function is to approximate an ideal +// offset curve (call it I) of the input curve B using a bezier curve Bp. +// The constraints I use to get the equations are: +// +// 1. The computed curve Bp should go through I(0) and I(1). These are +// x1p, y1p, x4p, y4p, which are p1p and p4p. We still need to find +// 4 variables: the x and y components of p2p and p3p (i.e. x2p, y2p, x3p, y3p). +// +// 2. Bp should have slope equal in absolute value to I at the endpoints. So, +// (by the way, the operator || in the comments below means "aligned with". +// It is defined on vectors, so when we say I'(0) || Bp'(0) we mean that +// vectors I'(0) and Bp'(0) are aligned, which is the same as saying +// that the tangent lines of I and Bp at 0 are parallel. Mathematically +// this means (I'(t) || Bp'(t)) <==> (I'(t) = c * Bp'(t)) where c is some +// nonzero constant.) +// I'(0) || Bp'(0) and I'(1) || Bp'(1). Obviously, I'(0) || B'(0) and +// I'(1) || B'(1); therefore, Bp'(0) || B'(0) and Bp'(1) || B'(1). +// We know that Bp'(0) || (p2p-p1p) and Bp'(1) || (p4p-p3p) and the same +// is true for any bezier curve; therefore, we get the equations +// (1) p2p = c1 * (p2-p1) + p1p +// (2) p3p = c2 * (p4-p3) + p4p +// We know p1p, p4p, p2, p1, p3, and p4; therefore, this reduces the number +// of unknowns from 4 to 2 (i.e. just c1 and c2). +// To eliminate these 2 unknowns we use the following constraint: +// +// 3. Bp(0.5) == I(0.5). Bp(0.5)=(x,y) and I(0.5)=(xi,yi), and I should note +// that I(0.5) is *the only* reason for computing dxm,dym. This gives us +// (3) Bp(0.5) = (p1p + 3 * (p2p + p3p) + p4p)/8, which is equivalent to +// (4) p2p + p3p = (Bp(0.5)*8 - p1p - p4p) / 3 +// We can substitute (1) and (2) from above into (4) and we get: +// (5) c1*(p2-p1) + c2*(p4-p3) = (Bp(0.5)*8 - p1p - p4p)/3 - p1p - p4p +// which is equivalent to +// (6) c1*(p2-p1) + c2*(p4-p3) = (4/3) * (Bp(0.5) * 2 - p1p - p4p) +// +// The right side of this is a 2D vector, and we know I(0.5), which gives us +// Bp(0.5), which gives us the value of the right side. +// The left side is just a matrix vector multiplication in disguise. It is +// +// [x2-x1, x4-x3][c1] +// [y2-y1, y4-y3][c2] +// which, is equal to +// [dx1, dx4][c1] +// [dy1, dy4][c2] +// At this point we are left with a simple linear system and we solve it by +// getting the inverse of the matrix above. Then we use [c1,c2] to compute +// p2p and p3p. + + float x = 0.125f * (x1 + 3 * (x2 + x3) + x4); + float y = 0.125f * (y1 + 3 * (y2 + y3) + y4); + // (dxm,dym) is some tangent of B at t=0.5. This means it's equal to + // c*B'(0.5) for some constant c. + float dxm = x3 + x4 - x1 - x2, dym = y3 + y4 - y1 - y2; + + // this computes the offsets at t=0, 0.5, 1, using the property that + // for any bezier curve the vectors p2-p1 and p4-p3 are parallel to + // the (dx/dt, dy/dt) vectors at the endpoints. + computeOffset(dx1, dy1, lineWidth2, offset[0]); + computeOffset(dxm, dym, lineWidth2, offset[1]); + computeOffset(dx4, dy4, lineWidth2, offset[2]); + float x1p = x1 + offset[0][0]; // start + float y1p = y1 + offset[0][1]; // point + float xi = x + offset[1][0]; // interpolation + float yi = y + offset[1][1]; // point + float x4p = x4 + offset[2][0]; // end + float y4p = y4 + offset[2][1]; // point + + float invdet43 = 4f / (3f * (dx1 * dy4 - dy1 * dx4)); + + float two_pi_m_p1_m_p4x = 2*xi - x1p - x4p; + float two_pi_m_p1_m_p4y = 2*yi - y1p - y4p; + float c1 = invdet43 * (dy4 * two_pi_m_p1_m_p4x - dx4 * two_pi_m_p1_m_p4y); + float c2 = invdet43 * (dx1 * two_pi_m_p1_m_p4y - dy1 * two_pi_m_p1_m_p4x); + + float x2p, y2p, x3p, y3p; + x2p = x1p + c1*dx1; + y2p = y1p + c1*dy1; + x3p = x4p + c2*dx4; + y3p = y4p + c2*dy4; + + leftOff[0] = x1p; leftOff[1] = y1p; + leftOff[2] = x2p; leftOff[3] = y2p; + leftOff[4] = x3p; leftOff[5] = y3p; + leftOff[6] = x4p; leftOff[7] = y4p; + + x1p = x1 - offset[0][0]; y1p = y1 - offset[0][1]; + xi = xi - 2 * offset[1][0]; yi = yi - 2 * offset[1][1]; + x4p = x4 - offset[2][0]; y4p = y4 - offset[2][1]; + + two_pi_m_p1_m_p4x = 2*xi - x1p - x4p; + two_pi_m_p1_m_p4y = 2*yi - y1p - y4p; + c1 = invdet43 * (dy4 * two_pi_m_p1_m_p4x - dx4 * two_pi_m_p1_m_p4y); + c2 = invdet43 * (dx1 * two_pi_m_p1_m_p4y - dy1 * two_pi_m_p1_m_p4x); + + x2p = x1p + c1*dx1; + y2p = y1p + c1*dy1; + x3p = x4p + c2*dx4; + y3p = y4p + c2*dy4; + + rightOff[0] = x1p; rightOff[1] = y1p; + rightOff[2] = x2p; rightOff[3] = y2p; + rightOff[4] = x3p; rightOff[5] = y3p; + rightOff[6] = x4p; rightOff[7] = y4p; + return 8; + } + + // compute offset curves using bezier spline through t=0.5 (i.e. + // ComputedCurve(0.5) == IdealParallelCurve(0.5)) + // return the kind of curve in the right and left arrays. + private int computeOffsetQuad(float[] pts, final int off, + float[] leftOff, float[] rightOff) + { + final float x1 = pts[off + 0], y1 = pts[off + 1]; + final float x2 = pts[off + 2], y2 = pts[off + 3]; + final float x3 = pts[off + 4], y3 = pts[off + 5]; + + float dx3 = x3 - x2; + float dy3 = y3 - y2; + float dx1 = x2 - x1; + float dy1 = y2 - y1; + + // if p1=p2 or p3=p4 it means that the derivative at the endpoint + // vanishes, which creates problems with computeOffset. Usually + // this happens when this stroker object is trying to winden + // a curve with a cusp. What happens is that curveTo splits + // the input curve at the cusp, and passes it to this function. + // because of inaccuracies in the splitting, we consider points + // equal if they're very close to each other. + + // if p1 == p2 && p3 == p4: draw line from p1->p4, unless p1 == p4, + // in which case ignore. + final boolean p1eqp2 = within(x1,y1,x2,y2, 6 * Math.ulp(y2)); + final boolean p2eqp3 = within(x2,y2,x3,y3, 6 * Math.ulp(y3)); + if (p1eqp2 || p2eqp3) { + getLineOffsets(x1, y1, x3, y3, leftOff, rightOff); + return 4; + } + + // if p2-p1 and p4-p3 are parallel, that must mean this curve is a line + float dotsq = (dx1 * dx3 + dy1 * dy3); + dotsq = dotsq * dotsq; + float l1sq = dx1 * dx1 + dy1 * dy1, l3sq = dx3 * dx3 + dy3 * dy3; + if (Helpers.within(dotsq, l1sq * l3sq, 4 * Math.ulp(dotsq))) { + getLineOffsets(x1, y1, x3, y3, leftOff, rightOff); + return 4; + } + + // this computes the offsets at t=0, 0.5, 1, using the property that + // for any bezier curve the vectors p2-p1 and p4-p3 are parallel to + // the (dx/dt, dy/dt) vectors at the endpoints. + computeOffset(dx1, dy1, lineWidth2, offset[0]); + computeOffset(dx3, dy3, lineWidth2, offset[1]); + float x1p = x1 + offset[0][0]; // start + float y1p = y1 + offset[0][1]; // point + float x3p = x3 + offset[1][0]; // end + float y3p = y3 + offset[1][1]; // point + + computeMiter(x1p, y1p, x1p+dx1, y1p+dy1, x3p, y3p, x3p-dx3, y3p-dy3, leftOff, 2); + leftOff[0] = x1p; leftOff[1] = y1p; + leftOff[4] = x3p; leftOff[5] = y3p; + x1p = x1 - offset[0][0]; y1p = y1 - offset[0][1]; + x3p = x3 - offset[1][0]; y3p = y3 - offset[1][1]; + computeMiter(x1p, y1p, x1p+dx1, y1p+dy1, x3p, y3p, x3p-dx3, y3p-dy3, rightOff, 2); + rightOff[0] = x1p; rightOff[1] = y1p; + rightOff[4] = x3p; rightOff[5] = y3p; + return 6; + } + + // This is where the curve to be processed is put. We give it + // enough room to store 2 curves: one for the current subdivision, the + // other for the rest of the curve. + private float[][] middle = new float[2][8]; + private float[] lp = new float[8]; + private float[] rp = new float[8]; + private static final int MAX_N_CURVES = 11; + private float[] subdivTs = new float[MAX_N_CURVES - 1]; + + private void somethingTo(final int type) { + // need these so we can update the state at the end of this method + final float xf = middle[0][type-2], yf = middle[0][type-1]; + float dxs = middle[0][2] - middle[0][0]; + float dys = middle[0][3] - middle[0][1]; + float dxf = middle[0][type - 2] - middle[0][type - 4]; + float dyf = middle[0][type - 1] - middle[0][type - 3]; + switch(type) { + case 6: + if ((dxs == 0f && dys == 0f) || + (dxf == 0f && dyf == 0f)) { + dxs = dxf = middle[0][4] - middle[0][0]; + dys = dyf = middle[0][5] - middle[0][1]; + } + break; + case 8: + boolean p1eqp2 = (dxs == 0f && dys == 0f); + boolean p3eqp4 = (dxf == 0f && dyf == 0f); + if (p1eqp2) { + dxs = middle[0][4] - middle[0][0]; + dys = middle[0][5] - middle[0][1]; + if (dxs == 0f && dys == 0f) { + dxs = middle[0][6] - middle[0][0]; + dys = middle[0][7] - middle[0][1]; + } + } + if (p3eqp4) { + dxf = middle[0][6] - middle[0][2]; + dyf = middle[0][7] - middle[0][3]; + if (dxf == 0f && dyf == 0f) { + dxf = middle[0][6] - middle[0][0]; + dyf = middle[0][7] - middle[0][1]; + } + } + } + if (dxs == 0f && dys == 0f) { + // this happens iff the "curve" is just a point + lineTo(middle[0][0], middle[0][1]); + return; + } + // if these vectors are too small, normalize them, to avoid future + // precision problems. + if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) { + double len = Math.hypot(dxs, dys); + dxs = (float)(dxs / len); + dys = (float)(dys / len); + } + if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) { + double len = Math.hypot(dxf, dyf); + dxf = (float)(dxf / len); + dyf = (float)(dyf / len); + } + + computeOffset(dxs, dys, lineWidth2, offset[0]); + final float mx = offset[0][0]; + final float my = offset[0][1]; + drawJoin(cdx, cdy, cx0, cy0, dxs, dys, cmx, cmy, mx, my); + + int nSplits = findSubdivPoints(middle[0], subdivTs, type,lineWidth2); + + int kind = 0; + Iterator it = Curve.breakPtsAtTs(middle, type, subdivTs, nSplits); + while(it.hasNext()) { + float[] curCurve = it.next(); + + kind = 0; + switch (type) { + case 8: + kind = computeOffsetCubic(curCurve, 0, lp, rp); + break; + case 6: + kind = computeOffsetQuad(curCurve, 0, lp, rp); + break; + } + if (kind != 0) { + emitLineTo(lp[0], lp[1]); + switch(kind) { + case 8: + emitCurveTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], lp[6], lp[7], false); + emitCurveTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], rp[6], rp[7], true); + break; + case 6: + emitQuadTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], false); + emitQuadTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], true); + break; + case 4: + emitLineTo(lp[2], lp[3]); + emitLineTo(rp[0], rp[1], true); + break; + } + emitLineTo(rp[kind - 2], rp[kind - 1], true); + } + } + + this.cmx = (lp[kind - 2] - rp[kind - 2]) / 2; + this.cmy = (lp[kind - 1] - rp[kind - 1]) / 2; + this.cdx = dxf; + this.cdy = dyf; + this.cx0 = xf; + this.cy0 = yf; + this.prev = DRAWING_OP_TO; + } + + // finds values of t where the curve in pts should be subdivided in order + // to get good offset curves a distance of w away from the middle curve. + // Stores the points in ts, and returns how many of them there were. + private static Curve c = new Curve(); + private static int findSubdivPoints(float[] pts, float[] ts, + final int type, final float w) + { + final float x12 = pts[2] - pts[0]; + final float y12 = pts[3] - pts[1]; + // if the curve is already parallel to either axis we gain nothing + // from rotating it. + if (y12 != 0f && x12 != 0f) { + // we rotate it so that the first vector in the control polygon is + // parallel to the x-axis. This will ensure that rotated quarter + // circles won't be subdivided. + final float hypot = (float)Math.sqrt(x12 * x12 + y12 * y12); + final float cos = x12 / hypot; + final float sin = y12 / hypot; + final float x1 = cos * pts[0] + sin * pts[1]; + final float y1 = cos * pts[1] - sin * pts[0]; + final float x2 = cos * pts[2] + sin * pts[3]; + final float y2 = cos * pts[3] - sin * pts[2]; + final float x3 = cos * pts[4] + sin * pts[5]; + final float y3 = cos * pts[5] - sin * pts[4]; + switch(type) { + case 8: + final float x4 = cos * pts[6] + sin * pts[7]; + final float y4 = cos * pts[7] - sin * pts[6]; + c.set(x1, y1, x2, y2, x3, y3, x4, y4); + break; + case 6: + c.set(x1, y1, x2, y2, x3, y3); + break; + } + } else { + c.set(pts, type); + } + + int ret = 0; + // we subdivide at values of t such that the remaining rotated + // curves are monotonic in x and y. + ret += c.dxRoots(ts, ret); + ret += c.dyRoots(ts, ret); + // subdivide at inflection points. + if (type == 8) { + // quadratic curves can't have inflection points + ret += c.infPoints(ts, ret); + } + + // now we must subdivide at points where one of the offset curves will have + // a cusp. This happens at ts where the radius of curvature is equal to w. + ret += c.rootsOfROCMinusW(ts, ret, w, 0.0001f); + ret = Helpers.filterOutNotInAB(ts, 0, ret, 0.0001f, 0.9999f); + Helpers.isort(ts, 0, ret); + return ret; + } + + @Override public void curveTo(float x1, float y1, + float x2, float y2, + float x3, float y3) + { + middle[0][0] = cx0; middle[0][1] = cy0; + middle[0][2] = x1; middle[0][3] = y1; + middle[0][4] = x2; middle[0][5] = y2; + middle[0][6] = x3; middle[0][7] = y3; + somethingTo(8); + } + + @Override public long getNativeConsumer() { + throw new InternalError("Stroker doesn't use a native consumer"); + } + + @Override public void quadTo(float x1, float y1, float x2, float y2) { + middle[0][0] = cx0; middle[0][1] = cy0; + middle[0][2] = x1; middle[0][3] = y1; + middle[0][4] = x2; middle[0][5] = y2; + somethingTo(6); + } + + // a stack of polynomial curves where each curve shares endpoints with + // adjacent ones. + private static final class PolyStack { + float[] curves; + int end; + int[] curveTypes; + int numCurves; + + private static final int INIT_SIZE = 50; + + PolyStack() { + curves = new float[8 * INIT_SIZE]; + curveTypes = new int[INIT_SIZE]; + end = 0; + numCurves = 0; + } + + public boolean isEmpty() { + return numCurves == 0; + } + + private void ensureSpace(int n) { + if (end + n >= curves.length) { + int newSize = (end + n) * 2; + curves = Arrays.copyOf(curves, newSize); + } + if (numCurves >= curveTypes.length) { + int newSize = numCurves * 2; + curveTypes = Arrays.copyOf(curveTypes, newSize); + } + } + + public void pushCubic(float x0, float y0, + float x1, float y1, + float x2, float y2) + { + ensureSpace(6); + curveTypes[numCurves++] = 8; + // assert(x0 == lastX && y0 == lastY) + + // we reverse the coordinate order to make popping easier + curves[end++] = x2; curves[end++] = y2; + curves[end++] = x1; curves[end++] = y1; + curves[end++] = x0; curves[end++] = y0; + } + + public void pushQuad(float x0, float y0, + float x1, float y1) + { + ensureSpace(4); + curveTypes[numCurves++] = 6; + // assert(x0 == lastX && y0 == lastY) + curves[end++] = x1; curves[end++] = y1; + curves[end++] = x0; curves[end++] = y0; + } + + public void pushLine(float x, float y) { + ensureSpace(2); + curveTypes[numCurves++] = 4; + // assert(x0 == lastX && y0 == lastY) + curves[end++] = x; curves[end++] = y; + } + + @SuppressWarnings("unused") + public int pop(float[] pts) { + int ret = curveTypes[numCurves - 1]; + numCurves--; + end -= (ret - 2); + System.arraycopy(curves, end, pts, 0, ret - 2); + return ret; + } + + public void pop(PathConsumer2D io) { + numCurves--; + int type = curveTypes[numCurves]; + end -= (type - 2); + switch(type) { + case 8: + io.curveTo(curves[end+0], curves[end+1], + curves[end+2], curves[end+3], + curves[end+4], curves[end+5]); + break; + case 6: + io.quadTo(curves[end+0], curves[end+1], + curves[end+2], curves[end+3]); + break; + case 4: + io.lineTo(curves[end], curves[end+1]); + } + } + + @Override + public String toString() { + String ret = ""; + int nc = numCurves; + int end = this.end; + while (nc > 0) { + nc--; + int type = curveTypes[numCurves]; + end -= (type - 2); + switch(type) { + case 8: + ret += "cubic: "; + break; + case 6: + ret += "quad: "; + break; + case 4: + ret += "line: "; + break; + } + ret += Arrays.toString(Arrays.copyOfRange(curves, end, end+type-2)) + "\n"; + } + return ret; + } } } - diff --git a/jdk/src/share/classes/sun/java2d/pisces/TransformingPathConsumer2D.java b/jdk/src/share/classes/sun/java2d/pisces/TransformingPathConsumer2D.java new file mode 100644 index 00000000000..f88fa5cc948 --- /dev/null +++ b/jdk/src/share/classes/sun/java2d/pisces/TransformingPathConsumer2D.java @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.pisces; + +import sun.awt.geom.PathConsumer2D; +import java.awt.geom.AffineTransform; + +public class TransformingPathConsumer2D { + public static PathConsumer2D + transformConsumer(PathConsumer2D out, + AffineTransform at) + { + if (at == null) { + return out; + } + float Mxx = (float) at.getScaleX(); + float Mxy = (float) at.getShearX(); + float Mxt = (float) at.getTranslateX(); + float Myx = (float) at.getShearY(); + float Myy = (float) at.getScaleY(); + float Myt = (float) at.getTranslateY(); + if (Mxy == 0f && Myx == 0f) { + if (Mxx == 1f && Myy == 1f) { + if (Mxt == 0f && Myt == 0f) { + return out; + } else { + return new TranslateFilter(out, Mxt, Myt); + } + } else { + return new ScaleFilter(out, Mxx, Myy, Mxt, Myt); + } + } else { + return new TransformFilter(out, Mxx, Mxy, Mxt, Myx, Myy, Myt); + } + } + + static class TranslateFilter implements PathConsumer2D { + PathConsumer2D out; + float tx; + float ty; + + TranslateFilter(PathConsumer2D out, + float tx, float ty) + { + this.out = out; + this.tx = tx; + this.ty = ty; + } + + public void moveTo(float x0, float y0) { + out.moveTo(x0 + tx, y0 + ty); + } + + public void lineTo(float x1, float y1) { + out.lineTo(x1 + tx, y1 + ty); + } + + public void quadTo(float x1, float y1, + float x2, float y2) + { + out.quadTo(x1 + tx, y1 + ty, + x2 + tx, y2 + ty); + } + + public void curveTo(float x1, float y1, + float x2, float y2, + float x3, float y3) + { + out.curveTo(x1 + tx, y1 + ty, + x2 + tx, y2 + ty, + x3 + tx, y3 + ty); + } + + public void closePath() { + out.closePath(); + } + + public void pathDone() { + out.pathDone(); + } + + public long getNativeConsumer() { + return 0; + } + } + + static class ScaleFilter implements PathConsumer2D { + PathConsumer2D out; + float sx; + float sy; + float tx; + float ty; + + ScaleFilter(PathConsumer2D out, + float sx, float sy, float tx, float ty) + { + this.out = out; + this.sx = sx; + this.sy = sy; + this.tx = tx; + this.ty = ty; + } + + public void moveTo(float x0, float y0) { + out.moveTo(x0 * sx + tx, y0 * sy + ty); + } + + public void lineTo(float x1, float y1) { + out.lineTo(x1 * sx + tx, y1 * sy + ty); + } + + public void quadTo(float x1, float y1, + float x2, float y2) + { + out.quadTo(x1 * sx + tx, y1 * sy + ty, + x2 * sx + tx, y2 * sy + ty); + } + + public void curveTo(float x1, float y1, + float x2, float y2, + float x3, float y3) + { + out.curveTo(x1 * sx + tx, y1 * sy + ty, + x2 * sx + tx, y2 * sy + ty, + x3 * sx + tx, y3 * sy + ty); + } + + public void closePath() { + out.closePath(); + } + + public void pathDone() { + out.pathDone(); + } + + public long getNativeConsumer() { + return 0; + } + } + + static class TransformFilter implements PathConsumer2D { + PathConsumer2D out; + float Mxx; + float Mxy; + float Mxt; + float Myx; + float Myy; + float Myt; + + TransformFilter(PathConsumer2D out, + float Mxx, float Mxy, float Mxt, + float Myx, float Myy, float Myt) + { + this.out = out; + this.Mxx = Mxx; + this.Mxy = Mxy; + this.Mxt = Mxt; + this.Myx = Myx; + this.Myy = Myy; + this.Myt = Myt; + } + + public void moveTo(float x0, float y0) { + out.moveTo(x0 * Mxx + y0 * Mxy + Mxt, + x0 * Myx + y0 * Myy + Myt); + } + + public void lineTo(float x1, float y1) { + out.lineTo(x1 * Mxx + y1 * Mxy + Mxt, + x1 * Myx + y1 * Myy + Myt); + } + + public void quadTo(float x1, float y1, + float x2, float y2) + { + out.quadTo(x1 * Mxx + y1 * Mxy + Mxt, + x1 * Myx + y1 * Myy + Myt, + x2 * Mxx + y2 * Mxy + Mxt, + x2 * Myx + y2 * Myy + Myt); + } + + public void curveTo(float x1, float y1, + float x2, float y2, + float x3, float y3) + { + out.curveTo(x1 * Mxx + y1 * Mxy + Mxt, + x1 * Myx + y1 * Myy + Myt, + x2 * Mxx + y2 * Mxy + Mxt, + x2 * Myx + y2 * Myy + Myt, + x3 * Mxx + y3 * Mxy + Mxt, + x3 * Myx + y3 * Myy + Myt); + } + + public void closePath() { + out.closePath(); + } + + public void pathDone() { + out.pathDone(); + } + + public long getNativeConsumer() { + return 0; + } + } +} diff --git a/jdk/src/share/classes/sun/jkernel/DownloadManager.java b/jdk/src/share/classes/sun/jkernel/DownloadManager.java index 416cec7feea..b21b6e7bfd0 100644 --- a/jdk/src/share/classes/sun/jkernel/DownloadManager.java +++ b/jdk/src/share/classes/sun/jkernel/DownloadManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/jvmstat/monitor/AbstractMonitor.java b/jdk/src/share/classes/sun/jvmstat/monitor/AbstractMonitor.java index b8d50ddc561..80789de60c5 100644 --- a/jdk/src/share/classes/sun/jvmstat/monitor/AbstractMonitor.java +++ b/jdk/src/share/classes/sun/jvmstat/monitor/AbstractMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/jvmstat/monitor/Monitor.java b/jdk/src/share/classes/sun/jvmstat/monitor/Monitor.java index 8560990fd80..b2f16936fbc 100644 --- a/jdk/src/share/classes/sun/jvmstat/monitor/Monitor.java +++ b/jdk/src/share/classes/sun/jvmstat/monitor/Monitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/jvmstat/monitor/Units.java b/jdk/src/share/classes/sun/jvmstat/monitor/Units.java index 906888f9ea8..140f069d106 100644 --- a/jdk/src/share/classes/sun/jvmstat/monitor/Units.java +++ b/jdk/src/share/classes/sun/jvmstat/monitor/Units.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/jvmstat/monitor/Variability.java b/jdk/src/share/classes/sun/jvmstat/monitor/Variability.java index 2d5ff01fc99..79e932eba60 100644 --- a/jdk/src/share/classes/sun/jvmstat/monitor/Variability.java +++ b/jdk/src/share/classes/sun/jvmstat/monitor/Variability.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/jvmstat/perfdata/monitor/PerfByteArrayMonitor.java b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfByteArrayMonitor.java index b5000511a62..b2414a37b21 100644 --- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfByteArrayMonitor.java +++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfByteArrayMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/jvmstat/perfdata/monitor/PerfIntegerMonitor.java b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfIntegerMonitor.java index d1f486c7346..591d7349e7c 100644 --- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfIntegerMonitor.java +++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfIntegerMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/jvmstat/perfdata/monitor/PerfLongMonitor.java b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfLongMonitor.java index 3dcf4e59c5b..faa79c22c8a 100644 --- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfLongMonitor.java +++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfLongMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/jvmstat/perfdata/monitor/PerfStringConstantMonitor.java b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringConstantMonitor.java index 6721101386c..163585a9386 100644 --- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringConstantMonitor.java +++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringConstantMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/jvmstat/perfdata/monitor/PerfStringMonitor.java b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringMonitor.java index f689db82e38..163c7e2f4cf 100644 --- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringMonitor.java +++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/jvmstat/perfdata/monitor/PerfStringVariableMonitor.java b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringVariableMonitor.java index 156eeb8c80a..cfc943a596d 100644 --- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringVariableMonitor.java +++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringVariableMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java index d13a8476c8a..a065258a73f 100644 --- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java +++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/jvmstat/perfdata/monitor/v2_0/PerfDataBuffer.java b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/v2_0/PerfDataBuffer.java index 7675509ddbe..746145095ec 100644 --- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/v2_0/PerfDataBuffer.java +++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/v2_0/PerfDataBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/launcher/LauncherHelper.java b/jdk/src/share/classes/sun/launcher/LauncherHelper.java index cba795968c6..870ed30e9f0 100644 --- a/jdk/src/share/classes/sun/launcher/LauncherHelper.java +++ b/jdk/src/share/classes/sun/launcher/LauncherHelper.java @@ -44,8 +44,19 @@ import java.io.IOException; import java.io.PrintStream; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.ResourceBundle; import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Locale.Category; +import java.util.Properties; +import java.util.Set; +import java.util.TreeSet; import java.util.jar.Attributes; import java.util.jar.JarFile; import java.util.jar.Manifest; @@ -59,6 +70,12 @@ public enum LauncherHelper { private static StringBuilder outBuf = new StringBuilder(); private static ResourceBundle javarb = null; + + private static final String INDENT = " "; + private static final String VM_SETTINGS = "VM settings:"; + private static final String PROP_SETTINGS = "Property settings:"; + private static final String LOCALE_SETTINGS = "Locale settings:"; + private static synchronized ResourceBundle getLauncherResourceBundle() { if (javarb == null) { javarb = ResourceBundle.getBundle(defaultBundleName); @@ -66,6 +83,226 @@ public enum LauncherHelper { return javarb; } + /* + * A method called by the launcher to print out the standard settings, + * by default -XshowSettings is equivalent to -XshowSettings:all, + * Specific information may be gotten by using suboptions with possible + * values vm, properties and locale. + * + * printToStderr: choose between stdout and stderr + * + * optionFlag: specifies which options to print default is all other + * possible values are vm, properties, locale. + * + * initialHeapSize: in bytes, as set by the launcher, a zero-value indicates + * this code should determine this value, using a suitable method or + * the line could be omitted. + * + * maxHeapSize: in bytes, as set by the launcher, a zero-value indicates + * this code should determine this value, using a suitable method. + * + * stackSize: in bytes, as set by the launcher, a zero-value indicates + * this code determine this value, using a suitable method or omit the + * line entirely. + */ + static void showSettings(boolean printToStderr, String optionFlag, + long initialHeapSize, long maxHeapSize, long stackSize, + boolean isServer) { + + PrintStream ostream = (printToStderr) ? System.err : System.out; + String opts[] = optionFlag.split(":"); + String optStr = (opts.length > 1 && opts[1] != null) + ? opts[1].trim() + : "all"; + switch (optStr) { + case "vm": + printVmSettings(ostream, initialHeapSize, maxHeapSize, + stackSize, isServer); + break; + case "properties": + printProperties(ostream); + break; + case "locale": + printLocale(ostream); + break; + default: + printVmSettings(ostream, initialHeapSize, maxHeapSize, + stackSize, isServer); + printProperties(ostream); + printLocale(ostream); + break; + } + } + + /* + * prints the main vm settings subopt/section + */ + private static void printVmSettings(PrintStream ostream, + long initialHeapSize, long maxHeapSize, + long stackSize, boolean isServer) { + + ostream.println(VM_SETTINGS); + if (stackSize != 0L) { + ostream.println(INDENT + "Stack Size: " + + SizePrefix.scaleValue(stackSize)); + } + if (initialHeapSize != 0L) { + ostream.println(INDENT + "Min. Heap Size: " + + SizePrefix.scaleValue(initialHeapSize)); + } + if (maxHeapSize != 0L) { + ostream.println(INDENT + "Max. Heap Size: " + + SizePrefix.scaleValue(maxHeapSize)); + } else { + ostream.println(INDENT + "Max. Heap Size (Estimated): " + + SizePrefix.scaleValue(Runtime.getRuntime().maxMemory())); + } + ostream.println(INDENT + "Ergonomics Machine Class: " + + ((isServer) ? "server" : "client")); + ostream.println(INDENT + "Using VM: " + + System.getProperty("java.vm.name")); + ostream.println(); + } + + /* + * prints the properties subopt/section + */ + private static void printProperties(PrintStream ostream) { + Properties p = System.getProperties(); + ostream.println(PROP_SETTINGS); + List sortedPropertyKeys = new ArrayList<>(); + sortedPropertyKeys.addAll(p.stringPropertyNames()); + Collections.sort(sortedPropertyKeys); + for (String x : sortedPropertyKeys) { + printPropertyValue(ostream, x, p.getProperty(x)); + } + ostream.println(); + } + + private static boolean isPath(String key) { + return key.endsWith(".dirs") || key.endsWith(".path"); + } + + private static void printPropertyValue(PrintStream ostream, + String key, String value) { + ostream.print(INDENT + key + " = "); + if (key.equals("line.separator")) { + for (byte b : value.getBytes()) { + switch (b) { + case 0xd: + ostream.print("\\r "); + break; + case 0xa: + ostream.print("\\n "); + break; + default: + // print any bizzare line separators in hex, but really + // shouldn't happen. + ostream.printf("0x%02X", b & 0xff); + break; + } + } + ostream.println(); + return; + } + if (!isPath(key)) { + ostream.println(value); + return; + } + String[] values = value.split(System.getProperty("path.separator")); + boolean first = true; + for (String s : values) { + if (first) { // first line treated specially + ostream.println(s); + first = false; + } else { // following lines prefix with indents + ostream.println(INDENT + INDENT + s); + } + } + } + + /* + * prints the locale subopt/section + */ + private static void printLocale(PrintStream ostream) { + Locale locale = Locale.getDefault(); + ostream.println(LOCALE_SETTINGS); + ostream.println(INDENT + "default locale = " + + locale.getDisplayLanguage()); + ostream.println(INDENT + "default display locale = " + + Locale.getDefault(Category.DISPLAY).getDisplayName()); + ostream.println(INDENT + "default format locale = " + + Locale.getDefault(Category.FORMAT).getDisplayName()); + printLocales(ostream); + ostream.println(); + } + + private static void printLocales(PrintStream ostream) { + Locale[] tlocales = Locale.getAvailableLocales(); + final int len = tlocales == null ? 0 : tlocales.length; + if (len < 1 ) { + return; + } + // Locale does not implement Comparable so we convert it to String + // and sort it for pretty printing. + Set sortedSet = new TreeSet<>(); + for (Locale l : tlocales) { + sortedSet.add(l.toString()); + } + + ostream.print(INDENT + "available locales = "); + Iterator iter = sortedSet.iterator(); + final int last = len - 1; + for (int i = 0 ; iter.hasNext() ; i++) { + String s = iter.next(); + ostream.print(s); + if (i != last) { + ostream.print(", "); + } + // print columns of 8 + if ((i + 1) % 8 == 0) { + ostream.println(); + ostream.print(INDENT + INDENT); + } + } + } + + private enum SizePrefix { + + KILO(1024, "K"), + MEGA(1024 * 1024, "M"), + GIGA(1024 * 1024 * 1024, "G"), + TERA(1024L * 1024L * 1024L * 1024L, "T"); + long size; + String abbrev; + + SizePrefix(long size, String abbrev) { + this.size = size; + this.abbrev = abbrev; + } + + private static String scale(long v, SizePrefix prefix) { + return BigDecimal.valueOf(v).divide(BigDecimal.valueOf(prefix.size), + 2, RoundingMode.HALF_EVEN).toPlainString() + prefix.abbrev; + } + /* + * scale the incoming values to a human readable form, represented as + * K, M, G and T, see java.c parse_size for the scaled values and + * suffixes. The lowest possible scaled value is Kilo. + */ + static String scaleValue(long v) { + if (v < MEGA.size) { + return scale(v, KILO); + } else if (v < GIGA.size) { + return scale(v, MEGA); + } else if (v < TERA.size) { + return scale(v, GIGA); + } else { + return scale(v, TERA); + } + } + } + /** * A private helper method to get a localized message and also * apply any arguments that we might pass. @@ -164,6 +401,14 @@ public enum LauncherHelper { } } + + // From src/share/bin/java.c: + // enum LaunchMode { LM_UNKNOWN = 0, LM_CLASS, LM_JAR }; + + private static final int LM_UNKNOWN = 0; + private static final int LM_CLASS = 1; + private static final int LM_JAR = 2; + /** * This method does the following: * 1. gets the classname from a Jar's manifest, if necessary @@ -183,24 +428,40 @@ public enum LauncherHelper { * @return * @throws java.io.IOException */ - public static Object checkAndLoadMain(boolean printToStderr, - boolean isJar, String name) throws IOException { + public static Class checkAndLoadMain(boolean printToStderr, + int mode, + String what) throws IOException + { + + ClassLoader ld = ClassLoader.getSystemClassLoader(); + // get the class name - String classname = (isJar) ? getMainClassFromJar(name) : name; - classname = classname.replace('/', '.'); - ClassLoader loader = ClassLoader.getSystemClassLoader(); - Class clazz = null; + String cn = null; + switch (mode) { + case LM_CLASS: + cn = what; + break; + case LM_JAR: + cn = getMainClassFromJar(what); + break; + default: + throw new InternalError("" + mode + ": Unknown launch mode"); + } + cn = cn.replace('/', '.'); + PrintStream ostream = (printToStderr) ? System.err : System.out; + Class c = null; try { - clazz = loader.loadClass(classname); + c = ld.loadClass(cn); } catch (ClassNotFoundException cnfe) { - ostream.println(getLocalizedMessage("java.launcher.cls.error1", classname)); - NoClassDefFoundError ncdfe = new NoClassDefFoundError(classname); + ostream.println(getLocalizedMessage("java.launcher.cls.error1", + cn)); + NoClassDefFoundError ncdfe = new NoClassDefFoundError(cn); ncdfe.initCause(cnfe); throw ncdfe; } - signatureDiagnostic(ostream, clazz); - return clazz; + signatureDiagnostic(ostream, c); + return c; } static void signatureDiagnostic(PrintStream ostream, Class clazz) { diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher.properties b/jdk/src/share/classes/sun/launcher/resources/launcher.properties index e89d147a5bb..17ba48a1384 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -97,7 +97,15 @@ java.launcher.X.usage=\ \ -Xcheck:jni perform additional checks for JNI functions\n\ \ -Xshare:off do not attempt to use shared class data\n\ \ -Xshare:auto use shared class data if possible (default)\n\ -\ -Xshare:on require using shared class data, otherwise fail.\n\n\ +\ -Xshare:on require using shared class data, otherwise fail.\n\ +\ -XshowSettings show all settings and continue\n\ +\ -XshowSettings:all\n\ +\ show all settings and continue\n\ +\ -XshowSettings:vm show all vm related settings and continue\n\ +\ -XshowSettings:properties\n\ +\ show all property settings and continue\n\ +\ -XshowSettings:locale\n\ +\ show all locale related settings and continue\n\n\ The -X options are non-standard and subject to change without notice.\n java.launcher.cls.error1=\ diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher_de.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_de.properties index 99d347d5966..5dbf33426fa 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_de.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_de.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/launcher/resources/launcher_es.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_es.properties index 2daa7a2ffc8..77d516bd8af 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_es.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_es.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/launcher/resources/launcher_fr.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_fr.properties index ace15ee3529..b58bb125903 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_fr.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_fr.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/launcher/resources/launcher_it.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_it.properties index 267283288a8..7c5c1583518 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_it.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_it.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/launcher/resources/launcher_ja.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_ja.properties index 2da74b850ca..2089852ec09 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_ja.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/launcher/resources/launcher_ko.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_ko.properties index ef3ae358639..4f45ef7e770 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_ko.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_ko.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/launcher/resources/launcher_pt_BR.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties new file mode 100644 index 00000000000..fa29bd18c75 --- /dev/null +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties @@ -0,0 +1,116 @@ +# +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Translators please note do not translate the options themselves +java.launcher.opt.header = Usage: {0} [-options] class [args...]\n\ +\ (to execute a class)\n or {0} [-options] -jar jarfile [args...]\n\ +\ (to execute a jar file)\n\ +where options include:\n + +java.launcher.opt.datamodel =\ -d{0}\t use a {0}-bit data model if available\n +java.launcher.opt.vmselect =\ {0}\t to select the "{1}" VM\n +java.launcher.opt.hotspot =\ {0}\t is a synonym for the "{1}" VM [deprecated]\n + +java.launcher.ergo.message1 =\ The default VM is {0} +java.launcher.ergo.message2 =\ because you are running on a server-class machine.\n + +# Translators please note do not translate the options themselves +java.launcher.opt.footer =\ -cp \n\ +\ -classpath \n\ +\ A {0} separated list of directories, JAR archives,\n\ +\ and ZIP archives to search for class files.\n\ +\ -D=\n\ +\ set a system property\n\ +\ -verbose[:class|gc|jni]\n\ +\ enable verbose output\n\ +\ -version print product version and exit\n\ +\ -version:\n\ +\ require the specified version to run\n\ +\ -showversion print product version and continue\n\ +\ -jre-restrict-search | -no-jre-restrict-search\n\ +\ include/exclude user private JREs in the version search\n\ +\ -? -help print this help message\n\ +\ -X print help on non-standard options\n\ +\ -ea[:...|:]\n\ +\ -enableassertions[:...|:]\n\ +\ enable assertions with specified granularity\n\ +\ -da[:...|:]\n\ +\ -disableassertions[:...|:]\n\ +\ disable assertions with specified granularity\n\ +\ -esa | -enablesystemassertions\n\ +\ enable system assertions\n\ +\ -dsa | -disablesystemassertions\n\ +\ disable system assertions\n\ +\ -agentlib:[=]\n\ +\ load native agent library , e.g. -agentlib:hprof\n\ +\ see also, -agentlib:jdwp=help and -agentlib:hprof=help\n\ +\ -agentpath:[=]\n\ +\ load native agent library by full pathname\n\ +\ -javaagent:[=]\n\ +\ load Java programming language agent, see java.lang.instrument\n\ +\ -splash:\n\ +\ show splash screen with specified image\n\ +See http://java.sun.com/javase/reference for more details. + +# Translators please note do not translate the options themselves +java.launcher.X.usage=\ +\ -Xmixed mixed mode execution (default)\n\ +\ -Xint interpreted mode execution only\n\ +\ -Xbootclasspath:\n\ +\ set search path for bootstrap classes and resources\n\ +\ -Xbootclasspath/a:\n\ +\ append to end of bootstrap class path\n\ +\ -Xbootclasspath/p:\n\ +\ prepend in front of bootstrap class path\n\ +\ -Xnoclassgc disable class garbage collection\n\ +\ -Xincgc enable incremental garbage collection\n\ +\ -Xloggc: log GC status to a file with time stamps\n\ +\ -Xbatch disable background compilation\n\ +\ -Xms set initial Java heap size\n\ +\ -Xmx set maximum Java heap size\n\ +\ -Xss set java thread stack size\n\ +\ -Xprof output cpu profiling data\n\ +\ -Xfuture enable strictest checks, anticipating future default\n\ +\ -Xrs reduce use of OS signals by Java/VM (see documentation)\n\ +\ -Xcheck:jni perform additional checks for JNI functions\n\ +\ -Xshare:off do not attempt to use shared class data\n\ +\ -Xshare:auto use shared class data if possible (default)\n\ +\ -Xshare:on require using shared class data, otherwise fail.\n\n\ +The -X options are non-standard and subject to change without notice.\n + +java.launcher.cls.error1=\ + Error: Could not find main class {0} +java.launcher.cls.error2=\ + Error: Main method is not {0} in class {1}, please define the main method as:\n\ +\ public static void main(String[] args) +java.launcher.cls.error3=\ + Error: Main method must return a value of type void in class {0}, please \n\ + define the main method as:\n\ +\ public static void main(String[] args) +java.launcher.cls.error4=\ + Error: Main method not found in class {0}, please define the main method as:\n\ +\ public static void main(String[] args) + + diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher_sv.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_sv.properties index 95b3ba28db4..869c34e71a1 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_sv.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_sv.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/launcher/resources/launcher_zh_CN.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties index 55b5a06feb5..2af849fbf65 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/launcher/resources/launcher_zh_TW.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties index e5b87470ede..b2cfaf02969 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/management/Flag.java b/jdk/src/share/classes/sun/management/Flag.java index ae96ed3f94a..f9109b8ce8f 100644 --- a/jdk/src/share/classes/sun/management/Flag.java +++ b/jdk/src/share/classes/sun/management/Flag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/management/ThreadImpl.java b/jdk/src/share/classes/sun/management/ThreadImpl.java index 19f4bf7a2af..019646ad4fe 100644 --- a/jdk/src/share/classes/sun/management/ThreadImpl.java +++ b/jdk/src/share/classes/sun/management/ThreadImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ package sun.management; -import java.lang.management.ThreadMXBean; import java.lang.management.ManagementFactory; import java.lang.management.ThreadInfo; @@ -39,13 +38,14 @@ import javax.management.ObjectName; * ManagementFactory.getThreadMXBean() returns an instance * of this class. */ -class ThreadImpl implements ThreadMXBean { +class ThreadImpl implements com.sun.management.ThreadMXBean { private final VMManagement jvm; // default for thread contention monitoring is disabled. private boolean contentionMonitoringEnabled = false; private boolean cpuTimeEnabled; + private boolean allocatedMemoryEnabled; /** * Constructor of ThreadImpl class. @@ -53,6 +53,7 @@ class ThreadImpl implements ThreadMXBean { ThreadImpl(VMManagement vm) { this.jvm = vm; this.cpuTimeEnabled = jvm.isThreadCpuTimeEnabled(); + this.allocatedMemoryEnabled = jvm.isThreadAllocatedMemoryEnabled(); } public int getThreadCount() { @@ -91,6 +92,10 @@ class ThreadImpl implements ThreadMXBean { return jvm.isCurrentThreadCpuTimeSupported(); } + public boolean isThreadAllocatedMemorySupported() { + return jvm.isThreadAllocatedMemorySupported(); + } + public boolean isThreadCpuTimeEnabled() { if (!isThreadCpuTimeSupported() && !isCurrentThreadCpuTimeSupported()) { @@ -100,6 +105,14 @@ class ThreadImpl implements ThreadMXBean { return cpuTimeEnabled; } + public boolean isThreadAllocatedMemoryEnabled() { + if (!isThreadAllocatedMemorySupported()) { + throw new UnsupportedOperationException( + "Thread allocated memory measurement is not supported"); + } + return allocatedMemoryEnabled; + } + public long[] getAllThreadIds() { Util.checkMonitorAccess(); @@ -114,11 +127,6 @@ class ThreadImpl implements ThreadMXBean { } public ThreadInfo getThreadInfo(long id) { - if (id <= 0) { - throw new IllegalArgumentException( - "Invalid thread ID parameter: " + id); - } - long[] ids = new long[1]; ids[0] = id; final ThreadInfo[] infos = getThreadInfo(ids, 0); @@ -126,15 +134,6 @@ class ThreadImpl implements ThreadMXBean { } public ThreadInfo getThreadInfo(long id, int maxDepth) { - if (id <= 0) { - throw new IllegalArgumentException( - "Invalid thread ID parameter: " + id); - } - if (maxDepth < 0) { - throw new IllegalArgumentException( - "Invalid maxDepth parameter: " + maxDepth); - } - long[] ids = new long[1]; ids[0] = id; final ThreadInfo[] infos = getThreadInfo(ids, maxDepth); @@ -145,11 +144,22 @@ class ThreadImpl implements ThreadMXBean { return getThreadInfo(ids, 0); } - public ThreadInfo[] getThreadInfo(long[] ids, int maxDepth) { + private void verifyThreadIds(long[] ids) { if (ids == null) { throw new NullPointerException("Null ids parameter."); } + for (int i = 0; i < ids.length; i++) { + if (ids[i] <= 0) { + throw new IllegalArgumentException( + "Invalid thread ID parameter: " + ids[i]); + } + } + } + + public ThreadInfo[] getThreadInfo(long[] ids, int maxDepth) { + verifyThreadIds(ids); + if (maxDepth < 0) { throw new IllegalArgumentException( "Invalid maxDepth parameter: " + maxDepth); @@ -157,17 +167,15 @@ class ThreadImpl implements ThreadMXBean { Util.checkMonitorAccess(); - ThreadInfo[] infos = new ThreadInfo[ids.length]; + ThreadInfo[] infos = new ThreadInfo[ids.length]; // nulls if (maxDepth == Integer.MAX_VALUE) { - getThreadInfo0(ids, -1, infos); + getThreadInfo1(ids, -1, infos); } else { - getThreadInfo0(ids, maxDepth, infos); + getThreadInfo1(ids, maxDepth, infos); } return infos; } - - public void setThreadContentionMonitoringEnabled(boolean enable) { if (!isThreadContentionMonitoringSupported()) { throw new UnsupportedOperationException( @@ -192,69 +200,32 @@ class ThreadImpl implements ThreadMXBean { } } - public long getCurrentThreadCpuTime() { + private boolean verifyCurrentThreadCpuTime() { // check if Thread CPU time measurement is supported. if (!isCurrentThreadCpuTimeSupported()) { throw new UnsupportedOperationException( "Current thread CPU time measurement is not supported."); } + return isThreadCpuTimeEnabled(); + } - if (!isThreadCpuTimeEnabled()) { - return -1; + public long getCurrentThreadCpuTime() { + if (verifyCurrentThreadCpuTime()) { + return getThreadTotalCpuTime0(0); } - - return getThreadTotalCpuTime0(0); + return -1; } public long getThreadCpuTime(long id) { - // check if Thread CPU time measurement is supported. - if (!isThreadCpuTimeSupported() && - !isCurrentThreadCpuTimeSupported()) { - throw new UnsupportedOperationException( - "Thread CPU Time Measurement is not supported."); - } - - if (!isThreadCpuTimeSupported()) { - // support current thread only - if (id != Thread.currentThread().getId()) { - throw new UnsupportedOperationException( - "Thread CPU Time Measurement is only supported" + - " for the current thread."); - } - } - - if (id <= 0) { - throw new IllegalArgumentException( - "Invalid thread ID parameter: " + id); - } - - if (!isThreadCpuTimeEnabled()) { - return -1; - } - - if (id == Thread.currentThread().getId()) { - // current thread - return getThreadTotalCpuTime0(0); - } else { - return getThreadTotalCpuTime0(id); - } + long[] ids = new long[1]; + ids[0] = id; + final long[] times = getThreadCpuTime(ids); + return times[0]; } - public long getCurrentThreadUserTime() { - // check if Thread CPU time measurement is supported. - if (!isCurrentThreadCpuTimeSupported()) { - throw new UnsupportedOperationException( - "Current thread CPU time measurement is not supported."); - } + private boolean verifyThreadCpuTime(long[] ids) { + verifyThreadIds(ids); - if (!isThreadCpuTimeEnabled()) { - return -1; - } - - return getThreadUserCpuTime0(0); - } - - public long getThreadUserTime(long id) { // check if Thread CPU time measurement is supported. if (!isThreadCpuTimeSupported() && !isCurrentThreadCpuTimeSupported()) { @@ -264,30 +235,73 @@ class ThreadImpl implements ThreadMXBean { if (!isThreadCpuTimeSupported()) { // support current thread only - if (id != Thread.currentThread().getId()) { - throw new UnsupportedOperationException( - "Thread CPU time measurement is only supported" + - " for the current thread."); + for (int i = 0; i < ids.length; i++) { + if (ids[i] != Thread.currentThread().getId()) { + throw new UnsupportedOperationException( + "Thread CPU time measurement is only supported" + + " for the current thread."); + } } } - if (id <= 0) { - throw new IllegalArgumentException( - "Invalid thread ID parameter: " + id); - } - - if (!isThreadCpuTimeEnabled()) { - return -1; - } - - if (id == Thread.currentThread().getId()) { - // current thread - return getThreadUserCpuTime0(0); - } else { - return getThreadUserCpuTime0(id); - } + return isThreadCpuTimeEnabled(); } + public long[] getThreadCpuTime(long[] ids) { + boolean verified = verifyThreadCpuTime(ids); + + int length = ids.length; + long[] times = new long[length]; + java.util.Arrays.fill(times, -1); + + if (verified) { + if (length == 1) { + long id = ids[0]; + if (id == Thread.currentThread().getId()) { + id = 0; + } + times[0] = getThreadTotalCpuTime0(id); + } else { + getThreadTotalCpuTime1(ids, times); + } + } + return times; + } + + public long getCurrentThreadUserTime() { + if (verifyCurrentThreadCpuTime()) { + return getThreadUserCpuTime0(0); + } + return -1; + } + + public long getThreadUserTime(long id) { + long[] ids = new long[1]; + ids[0] = id; + final long[] times = getThreadUserTime(ids); + return times[0]; + } + + public long[] getThreadUserTime(long[] ids) { + boolean verified = verifyThreadCpuTime(ids); + + int length = ids.length; + long[] times = new long[length]; + java.util.Arrays.fill(times, -1); + + if (verified) { + if (length == 1) { + long id = ids[0]; + if (id == Thread.currentThread().getId()) { + id = 0; + } + times[0] = getThreadUserCpuTime0(id); + } else { + getThreadUserCpuTime1(ids, times); + } + } + return times; + } public void setThreadCpuTimeEnabled(boolean enable) { if (!isThreadCpuTimeSupported() && @@ -299,13 +313,60 @@ class ThreadImpl implements ThreadMXBean { Util.checkControlAccess(); synchronized (this) { if (cpuTimeEnabled != enable) { - // update VM of the state change + // notify VM of the state change setThreadCpuTimeEnabled0(enable); cpuTimeEnabled = enable; } } } + public long getThreadAllocatedBytes(long id) { + long[] ids = new long[1]; + ids[0] = id; + final long[] sizes = getThreadAllocatedBytes(ids); + return sizes[0]; + } + + private boolean verifyThreadAllocatedMemory(long[] ids) { + verifyThreadIds(ids); + + // check if Thread allocated memory measurement is supported. + if (!isThreadAllocatedMemorySupported()) { + throw new UnsupportedOperationException( + "Thread allocated memory measurement is not supported."); + } + + return isThreadAllocatedMemoryEnabled(); + } + + public long[] getThreadAllocatedBytes(long[] ids) { + boolean verified = verifyThreadAllocatedMemory(ids); + + long[] sizes = new long[ids.length]; + java.util.Arrays.fill(sizes, -1); + + if (verified) { + getThreadAllocatedMemory1(ids, sizes); + } + return sizes; + } + + public void setThreadAllocatedMemoryEnabled(boolean enable) { + if (!isThreadAllocatedMemorySupported()) { + throw new UnsupportedOperationException( + "Thread allocated memory measurement is not supported."); + } + + Util.checkControlAccess(); + synchronized (this) { + if (allocatedMemoryEnabled != enable) { + // notify VM of the state change + setThreadAllocatedMemoryEnabled0(enable); + allocatedMemoryEnabled = enable; + } + } + } + public long[] findMonitorDeadlockedThreads() { Util.checkMonitorAccess(); @@ -356,49 +417,47 @@ class ThreadImpl implements ThreadMXBean { return jvm.isSynchronizerUsageSupported(); } + private void verifyDumpThreads(boolean lockedMonitors, + boolean lockedSynchronizers) { + if (lockedMonitors && !isObjectMonitorUsageSupported()) { + throw new UnsupportedOperationException( + "Monitoring of Object Monitor Usage is not supported."); + } + + if (lockedSynchronizers && !isSynchronizerUsageSupported()) { + throw new UnsupportedOperationException( + "Monitoring of Synchronizer Usage is not supported."); + } + + Util.checkMonitorAccess(); + } + public ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers) { - if (ids == null) { - throw new NullPointerException("Null ids parameter."); - } - - if (lockedMonitors && !isObjectMonitorUsageSupported()) { - throw new UnsupportedOperationException( - "Monitoring of Object Monitor Usage is not supported."); - } - if (lockedSynchronizers && !isSynchronizerUsageSupported()) { - throw new UnsupportedOperationException( - "Monitoring of Synchronizer Usage is not supported."); - } - - Util.checkMonitorAccess(); + verifyThreadIds(ids); + verifyDumpThreads(lockedMonitors, lockedSynchronizers); return dumpThreads0(ids, lockedMonitors, lockedSynchronizers); } - - public ThreadInfo[] dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers) { - if (lockedMonitors && !isObjectMonitorUsageSupported()) { - throw new UnsupportedOperationException( - "Monitoring of Object Monitor Usage is not supported."); - } - if (lockedSynchronizers && !isSynchronizerUsageSupported()) { - throw new UnsupportedOperationException( - "Monitoring of Synchronizer Usage is not supported."); - } - - Util.checkMonitorAccess(); + public ThreadInfo[] dumpAllThreads(boolean lockedMonitors, + boolean lockedSynchronizers) { + verifyDumpThreads(lockedMonitors, lockedSynchronizers); return dumpThreads0(null, lockedMonitors, lockedSynchronizers); } // VM support where maxDepth == -1 to request entire stack dump private static native Thread[] getThreads(); - private static native void getThreadInfo0(long[] ids, + private static native void getThreadInfo1(long[] ids, int maxDepth, ThreadInfo[] result); private static native long getThreadTotalCpuTime0(long id); + private static native void getThreadTotalCpuTime1(long[] ids, long[] result); private static native long getThreadUserCpuTime0(long id); + private static native void getThreadUserCpuTime1(long[] ids, long[] result); + private static native void getThreadAllocatedMemory1(long[] ids, long[] result); private static native void setThreadCpuTimeEnabled0(boolean enable); + private static native void setThreadAllocatedMemoryEnabled0(boolean enable); private static native void setThreadContentionMonitoringEnabled0(boolean enable); private static native Thread[] findMonitorDeadlockedThreads0(); private static native Thread[] findDeadlockedThreads0(); diff --git a/jdk/src/share/classes/sun/management/VMManagement.java b/jdk/src/share/classes/sun/management/VMManagement.java index 81d6e801555..607f6cf88aa 100644 --- a/jdk/src/share/classes/sun/management/VMManagement.java +++ b/jdk/src/share/classes/sun/management/VMManagement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * 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,6 +43,8 @@ public interface VMManagement { public boolean isBootClassPathSupported(); public boolean isObjectMonitorUsageSupported(); public boolean isSynchronizerUsageSupported(); + public boolean isThreadAllocatedMemorySupported(); + public boolean isThreadAllocatedMemoryEnabled(); // Class Loading Subsystem public long getTotalClassCount(); diff --git a/jdk/src/share/classes/sun/management/VMManagementImpl.java b/jdk/src/share/classes/sun/management/VMManagementImpl.java index fe0ec0e557c..d5b00ea117f 100644 --- a/jdk/src/share/classes/sun/management/VMManagementImpl.java +++ b/jdk/src/share/classes/sun/management/VMManagementImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,6 +55,7 @@ class VMManagementImpl implements VMManagement { private static boolean bootClassPathSupport; private static boolean objectMonitorUsageSupport; private static boolean synchronizerUsageSupport; + private static boolean threadAllocatedMemorySupport; static { version = getVersion0(); @@ -95,9 +96,13 @@ class VMManagementImpl implements VMManagement { return synchronizerUsageSupport; } + public boolean isThreadAllocatedMemorySupported() { + return threadAllocatedMemorySupport; + } + public native boolean isThreadContentionMonitoringEnabled(); public native boolean isThreadCpuTimeEnabled(); - + public native boolean isThreadAllocatedMemoryEnabled(); // Class Loading Subsystem public int getLoadedClassCount() { diff --git a/jdk/src/share/classes/sun/management/resources/agent_de.properties b/jdk/src/share/classes/sun/management/resources/agent_de.properties index 6e2bde92fc1..a58d0ecb027 100644 --- a/jdk/src/share/classes/sun/management/resources/agent_de.properties +++ b/jdk/src/share/classes/sun/management/resources/agent_de.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/management/resources/agent_es.properties b/jdk/src/share/classes/sun/management/resources/agent_es.properties index a94166553d9..973b39385f1 100644 --- a/jdk/src/share/classes/sun/management/resources/agent_es.properties +++ b/jdk/src/share/classes/sun/management/resources/agent_es.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/management/resources/agent_fr.properties b/jdk/src/share/classes/sun/management/resources/agent_fr.properties index 43a71c24679..0e1e94a8b3e 100644 --- a/jdk/src/share/classes/sun/management/resources/agent_fr.properties +++ b/jdk/src/share/classes/sun/management/resources/agent_fr.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/management/resources/agent_it.properties b/jdk/src/share/classes/sun/management/resources/agent_it.properties index a804e50b329..e16314817cf 100644 --- a/jdk/src/share/classes/sun/management/resources/agent_it.properties +++ b/jdk/src/share/classes/sun/management/resources/agent_it.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/management/resources/agent_ja.properties b/jdk/src/share/classes/sun/management/resources/agent_ja.properties index a948de8a45f..8d747f55a89 100644 --- a/jdk/src/share/classes/sun/management/resources/agent_ja.properties +++ b/jdk/src/share/classes/sun/management/resources/agent_ja.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/management/resources/agent_ko.properties b/jdk/src/share/classes/sun/management/resources/agent_ko.properties index f67bf59e3b6..62c612cd2af 100644 --- a/jdk/src/share/classes/sun/management/resources/agent_ko.properties +++ b/jdk/src/share/classes/sun/management/resources/agent_ko.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/management/resources/agent_pt_BR.properties b/jdk/src/share/classes/sun/management/resources/agent_pt_BR.properties new file mode 100644 index 00000000000..5ac26eb3a90 --- /dev/null +++ b/jdk/src/share/classes/sun/management/resources/agent_pt_BR.properties @@ -0,0 +1,92 @@ +# +# +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Localizations for Level names. For the US locale +# these are the same as the non-localized level name. + +agent.err.error = Erro +agent.err.exception = Exce\u00e7\u00e3o lan\u00e7ada pelo agente +agent.err.warning = Aviso + +agent.err.configfile.notfound = Arquivo de configura\u00e7\u00e3o n\u00e3o encontrado +agent.err.configfile.failed = Falha ao ler o arquivo de configura\u00e7\u00e3o +agent.err.configfile.closed.failed = Falha ao fechar o arquivo de configura\u00e7\u00e3o +agent.err.configfile.access.denied = Acesso negado ao arquivo de configura\u00e7\u00e3o + +agent.err.exportaddress.failed = Falha na exporta\u00e7\u00e3o do endere\u00e7o do conector JMX para o buffer de instrumenta\u00e7\u00e3o + +agent.err.agentclass.notfound = Classe do agente de gerenciamento n\u00e3o encontrada +agent.err.agentclass.failed = Classe do agente de gerenciamento falha +agent.err.premain.notfound = premain(String) n\u00e3o existe na classe do agente +agent.err.agentclass.access.denied = Acesso negado a premain(String) +agent.err.invalid.agentclass = Valor inv\u00e1lido da propriedade com.sun.management.agent.class + +agent.err.invalid.jmxremote.port = N\u00famero inv\u00e1lido de com.sun.management.jmxremote.port + +agent.err.file.not.set = Arquivo n\u00e3o especificado +agent.err.file.not.readable = Arquivo ileg\u00edvel +agent.err.file.read.failed = Falha ao ler o arquivo +agent.err.file.not.found = Arquivo n\u00e3o encontrado +agent.err.file.access.not.restricted = O acesso de leitura do arquivo deve ser limitado + +agent.err.password.file.notset = O arquivo de senha n\u00e3o est\u00e1 especificado, mas com.sun.management.jmxremote.authenticate=true +agent.err.password.file.not.readable = Arquivo de senha ileg\u00edvel +agent.err.password.file.read.failed = Falha ao ler o arquivo de senha +agent.err.password.file.notfound = Arquivo de senha n\u00e3o encontrado +agent.err.password.file.access.notrestricted = O acesso de leitura do arquivo de senha deve ser limitado + +agent.err.access.file.notset = O arquivo de acesso n\u00e3o est\u00e1 especificado, mas com.sun.management.jmxremote.authenticate=true +agent.err.access.file.not.readable = Arquivo de acesso ileg\u00edvel +agent.err.access.file.read.failed = Falha ao ler o arquivo de acesso +agent.err.access.file.notfound = Arquivo de acesso n\u00e3o encontrado + +agent.err.connector.server.io.error = Erro de comunica\u00e7\u00e3o do servidor do conector JMX + +agent.err.invalid.option = Op\u00e7\u00e3o especificada inv\u00e1lida +agent.err.invalid.snmp.port = N\u00famero inv\u00e1lido de com.sun.management.snmp.port +agent.err.invalid.snmp.trap.port = N\u00famero inv\u00e1lido de com.sun.management.snmp.trap +agent.err.unknown.snmp.interface = Interface SNMP desconhecida +agent.err.acl.file.notset = N\u00e3o h\u00e1 nenhum arquivo ACL SNMP especificado, mas com.sun.management.snmp.acl=true +agent.err.acl.file.notfound = Arquivo ACL SNMP n\u00e3o encontrado +agent.err.acl.file.not.readable = Arquivo ACL SNMP ileg\u00edvel +agent.err.acl.file.read.failed = Falha ao ler o arquivo ACL SNMP +agent.err.acl.file.access.notrestricted = O acesso de leitura do arquivo de senha deve ser limitado + +agent.err.snmp.adaptor.start.failed = Falha ao iniciar o adaptador SNMP com endere\u00e7o +agent.err.snmp.mib.init.failed = Falha ao inicializar o MIB SNMP com erro + +jmxremote.ConnectorBootstrap.initialize = Iniciando o servidor do conector JMX: +jmxremote.ConnectorBootstrap.initialize.noAuthentication = Sem autentica\u00e7\u00e3o +jmxremote.ConnectorBootstrap.initialize.ready = Conector JMX pronto em: {0} +jmxremote.ConnectorBootstrap.initialize.password.readonly = O acesso de leitura do arquivo de senha deve ser limitado: {0} +jmxremote.ConnectorBootstrap.initialize.file.readonly = O acesso de leitura do arquivo deve ser limitado: {0} + +jmxremote.AdaptorBootstrap.getTargetList.processing = Processando ACL +jmxremote.AdaptorBootstrap.getTargetList.adding = Adicionando destino: {0} +jmxremote.AdaptorBootstrap.getTargetList.starting = Iniciando o servidor do adaptador: +jmxremote.AdaptorBootstrap.getTargetList.initialize1 = Adaptador pronto. +jmxremote.AdaptorBootstrap.getTargetList.initialize2 = Adaptador SNMP pronto em: {0}:{1} +jmxremote.AdaptorBootstrap.getTargetList.terminate = conclu\u00eddo {0} diff --git a/jdk/src/share/classes/sun/management/resources/agent_sv.properties b/jdk/src/share/classes/sun/management/resources/agent_sv.properties index 7f6d3bd930d..3838dca8104 100644 --- a/jdk/src/share/classes/sun/management/resources/agent_sv.properties +++ b/jdk/src/share/classes/sun/management/resources/agent_sv.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/management/resources/agent_zh_CN.properties b/jdk/src/share/classes/sun/management/resources/agent_zh_CN.properties index 68b59cac7a4..6f52206c603 100644 --- a/jdk/src/share/classes/sun/management/resources/agent_zh_CN.properties +++ b/jdk/src/share/classes/sun/management/resources/agent_zh_CN.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/management/resources/agent_zh_TW.properties b/jdk/src/share/classes/sun/management/resources/agent_zh_TW.properties index 512efc63c8f..b3db73c92b2 100644 --- a/jdk/src/share/classes/sun/management/resources/agent_zh_TW.properties +++ b/jdk/src/share/classes/sun/management/resources/agent_zh_TW.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/misc/BootClassLoaderHook.java b/jdk/src/share/classes/sun/misc/BootClassLoaderHook.java index 970ad5ceacc..d0e2e4eb842 100644 --- a/jdk/src/share/classes/sun/misc/BootClassLoaderHook.java +++ b/jdk/src/share/classes/sun/misc/BootClassLoaderHook.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/misc/FpUtils.java b/jdk/src/share/classes/sun/misc/FpUtils.java index 72ac47eee36..21ea7c29a44 100644 --- a/jdk/src/share/classes/sun/misc/FpUtils.java +++ b/jdk/src/share/classes/sun/misc/FpUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010 Oracle and/or its affiliates. All rights reserved. * 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,9 +29,9 @@ import sun.misc.FloatConsts; import sun.misc.DoubleConsts; /** - * The class FpUtils contains static utility methods for - * manipulating and inspecting float and - * double floating-point numbers. These methods include + * The class {@code FpUtils} contains static utility methods for + * manipulating and inspecting {@code float} and + * {@code double} floating-point numbers. These methods include * functionality recommended or required by the IEEE 754 * floating-point standard. * @@ -136,7 +136,7 @@ public class FpUtils { // tests for exception cases. /** - * Returns unbiased exponent of a double. + * Returns unbiased exponent of a {@code double}. */ public static int getExponent(double d){ /* @@ -149,7 +149,7 @@ public class FpUtils { } /** - * Returns unbiased exponent of a float. + * Returns unbiased exponent of a {@code float}. */ public static int getExponent(float f){ /* @@ -185,15 +185,15 @@ public class FpUtils { * Returns the first floating-point argument with the sign of the * second floating-point argument. Note that unlike the {@link * FpUtils#copySign(double, double) copySign} method, this method - * does not require NaN sign arguments to be treated + * does not require NaN {@code sign} arguments to be treated * as positive values; implementations are permitted to treat some * NaN arguments as positive and other NaN arguments as negative * to allow greater performance. * * @param magnitude the parameter providing the magnitude of the result * @param sign the parameter providing the sign of the result - * @return a value with the magnitude of magnitude - * and the sign of sign. + * @return a value with the magnitude of {@code magnitude} + * and the sign of {@code sign}. * @author Joseph D. Darcy */ public static double rawCopySign(double magnitude, double sign) { @@ -208,15 +208,15 @@ public class FpUtils { * Returns the first floating-point argument with the sign of the * second floating-point argument. Note that unlike the {@link * FpUtils#copySign(float, float) copySign} method, this method - * does not require NaN sign arguments to be treated + * does not require NaN {@code sign} arguments to be treated * as positive values; implementations are permitted to treat some * NaN arguments as positive and other NaN arguments as negative * to allow greater performance. * * @param magnitude the parameter providing the magnitude of the result * @param sign the parameter providing the sign of the result - * @return a value with the magnitude of magnitude - * and the sign of sign. + * @return a value with the magnitude of {@code magnitude} + * and the sign of {@code sign}. * @author Joseph D. Darcy */ public static float rawCopySign(float magnitude, float sign) { @@ -230,129 +230,129 @@ public class FpUtils { /* ***************************************************************** */ /** - * Returns true if the argument is a finite - * floating-point value; returns false otherwise (for + * Returns {@code true} if the argument is a finite + * floating-point value; returns {@code false} otherwise (for * NaN and infinity arguments). * - * @param d the double value to be tested - * @return true if the argument is a finite - * floating-point value, false otherwise. + * @param d the {@code double} value to be tested + * @return {@code true} if the argument is a finite + * floating-point value, {@code false} otherwise. */ public static boolean isFinite(double d) { return Math.abs(d) <= DoubleConsts.MAX_VALUE; } /** - * Returns true if the argument is a finite - * floating-point value; returns false otherwise (for + * Returns {@code true} if the argument is a finite + * floating-point value; returns {@code false} otherwise (for * NaN and infinity arguments). * - * @param f the float value to be tested - * @return true if the argument is a finite - * floating-point value, false otherwise. + * @param f the {@code float} value to be tested + * @return {@code true} if the argument is a finite + * floating-point value, {@code false} otherwise. */ public static boolean isFinite(float f) { return Math.abs(f) <= FloatConsts.MAX_VALUE; } /** - * Returns true if the specified number is infinitely - * large in magnitude, false otherwise. + * Returns {@code true} if the specified number is infinitely + * large in magnitude, {@code false} otherwise. * *

      Note that this method is equivalent to the {@link * Double#isInfinite(double) Double.isInfinite} method; the * functionality is included in this class for convenience. * * @param d the value to be tested. - * @return true if the value of the argument is positive - * infinity or negative infinity; false otherwise. + * @return {@code true} if the value of the argument is positive + * infinity or negative infinity; {@code false} otherwise. */ public static boolean isInfinite(double d) { return Double.isInfinite(d); } /** - * Returns true if the specified number is infinitely - * large in magnitude, false otherwise. + * Returns {@code true} if the specified number is infinitely + * large in magnitude, {@code false} otherwise. * *

      Note that this method is equivalent to the {@link * Float#isInfinite(float) Float.isInfinite} method; the * functionality is included in this class for convenience. * * @param f the value to be tested. - * @return true if the argument is positive infinity or - * negative infinity; false otherwise. + * @return {@code true} if the argument is positive infinity or + * negative infinity; {@code false} otherwise. */ public static boolean isInfinite(float f) { return Float.isInfinite(f); } /** - * Returns true if the specified number is a - * Not-a-Number (NaN) value, false otherwise. + * Returns {@code true} if the specified number is a + * Not-a-Number (NaN) value, {@code false} otherwise. * *

      Note that this method is equivalent to the {@link * Double#isNaN(double) Double.isNaN} method; the functionality is * included in this class for convenience. * * @param d the value to be tested. - * @return true if the value of the argument is NaN; - * false otherwise. + * @return {@code true} if the value of the argument is NaN; + * {@code false} otherwise. */ public static boolean isNaN(double d) { return Double.isNaN(d); } /** - * Returns true if the specified number is a - * Not-a-Number (NaN) value, false otherwise. + * Returns {@code true} if the specified number is a + * Not-a-Number (NaN) value, {@code false} otherwise. * *

      Note that this method is equivalent to the {@link * Float#isNaN(float) Float.isNaN} method; the functionality is * included in this class for convenience. * * @param f the value to be tested. - * @return true if the argument is NaN; - * false otherwise. + * @return {@code true} if the argument is NaN; + * {@code false} otherwise. */ public static boolean isNaN(float f) { return Float.isNaN(f); } /** - * Returns true if the unordered relation holds + * Returns {@code true} if the unordered relation holds * between the two arguments. When two floating-point values are * unordered, one value is neither less than, equal to, nor * greater than the other. For the unordered relation to be true, - * at least one argument must be a NaN. + * at least one argument must be a {@code NaN}. * * @param arg1 the first argument * @param arg2 the second argument - * @return true if at least one argument is a NaN, - * false otherwise. + * @return {@code true} if at least one argument is a NaN, + * {@code false} otherwise. */ public static boolean isUnordered(double arg1, double arg2) { return isNaN(arg1) || isNaN(arg2); } /** - * Returns true if the unordered relation holds + * Returns {@code true} if the unordered relation holds * between the two arguments. When two floating-point values are * unordered, one value is neither less than, equal to, nor * greater than the other. For the unordered relation to be true, - * at least one argument must be a NaN. + * at least one argument must be a {@code NaN}. * * @param arg1 the first argument * @param arg2 the second argument - * @return true if at least one argument is a NaN, - * false otherwise. + * @return {@code true} if at least one argument is a NaN, + * {@code false} otherwise. */ public static boolean isUnordered(float arg1, float arg2) { return isNaN(arg1) || isNaN(arg2); } /** - * Returns unbiased exponent of a double; for + * Returns unbiased exponent of a {@code double}; for * subnormal values, the number is treated as if it were * normalized. That is for all finite, non-zero, positive numbers * x, scalb(x, -ilogb(x)) is @@ -378,7 +378,6 @@ public class FpUtils { return (1<<30); // 2^30 else // infinite value return (1<<28); // 2^28 - // break; case DoubleConsts.MIN_EXPONENT-1: // zero or subnormal if(d == 0.0) { @@ -414,18 +413,16 @@ public class FpUtils { exponent < DoubleConsts.MIN_EXPONENT); return exponent; } - // break; default: assert( exponent >= DoubleConsts.MIN_EXPONENT && exponent <= DoubleConsts.MAX_EXPONENT); return exponent; - // break; } } /** - * Returns unbiased exponent of a float; for + * Returns unbiased exponent of a {@code float}; for * subnormal values, the number is treated as if it were * normalized. That is for all finite, non-zero, positive numbers * x, scalb(x, -ilogb(x)) is @@ -451,7 +448,6 @@ public class FpUtils { return (1<<30); // 2^30 else // infinite value return (1<<28); // 2^28 - // break; case FloatConsts.MIN_EXPONENT-1: // zero or subnormal if(f == 0.0f) { @@ -487,13 +483,11 @@ public class FpUtils { exponent < FloatConsts.MIN_EXPONENT); return exponent; } - // break; default: assert( exponent >= FloatConsts.MIN_EXPONENT && exponent <= FloatConsts.MAX_EXPONENT); return exponent; - // break; } } @@ -534,22 +528,22 @@ public class FpUtils { */ /** - * Return d × - * 2scale_factor rounded as if performed + * Return {@code d} × + * 2{@code scale_factor} rounded as if performed * by a single correctly rounded floating-point multiply to a * member of the double value set. See §4.2.3 * of the Java * Language Specification for a discussion of floating-point * value sets. If the exponent of the result is between the - * double's minimum exponent and maximum exponent, + * {@code double}'s minimum exponent and maximum exponent, * the answer is calculated exactly. If the exponent of the - * result would be larger than doubles's maximum + * result would be larger than {@code doubles}'s maximum * exponent, an infinity is returned. Note that if the result is - * subnormal, precision may be lost; that is, when scalb(x, - * n) is subnormal, scalb(scalb(x, n), -n) may + * subnormal, precision may be lost; that is, when {@code scalb(x, + * n)} is subnormal, {@code scalb(scalb(x, n), -n)} may * not equal x. When the result is non-NaN, the result has - * the same sign as d. + * the same sign as {@code d}. * *

      * Special cases: @@ -562,8 +556,8 @@ public class FpUtils { * * * @param d number to be scaled by a power of two. - * @param scale_factor power of 2 used to scale d - * @return d * 2scale_factor + * @param scale_factor power of 2 used to scale {@code d} + * @return {@code d * }2{@code scale_factor} * @author Joseph D. Darcy */ public static double scalb(double d, int scale_factor) { @@ -644,22 +638,22 @@ public class FpUtils { } /** - * Return f × - * 2scale_factor rounded as if performed + * Return {@code f} × + * 2{@code scale_factor} rounded as if performed * by a single correctly rounded floating-point multiply to a * member of the float value set. See §4.2.3 * of the Java * Language Specification for a discussion of floating-point * value set. If the exponent of the result is between the - * float's minimum exponent and maximum exponent, the + * {@code float}'s minimum exponent and maximum exponent, the * answer is calculated exactly. If the exponent of the result - * would be larger than float's maximum exponent, an + * would be larger than {@code float}'s maximum exponent, an * infinity is returned. Note that if the result is subnormal, - * precision may be lost; that is, when scalb(x, n) - * is subnormal, scalb(scalb(x, n), -n) may not equal + * precision may be lost; that is, when {@code scalb(x, n)} + * is subnormal, {@code scalb(scalb(x, n), -n)} may not equal * x. When the result is non-NaN, the result has the same - * sign as f. + * sign as {@code f}. * *

      * Special cases: @@ -672,8 +666,8 @@ public class FpUtils { * * * @param f number to be scaled by a power of two. - * @param scale_factor power of 2 used to scale f - * @return f * 2scale_factor + * @param scale_factor power of 2 used to scale {@code f} + * @return {@code f * }2{@code scale_factor} * @author Joseph D. Darcy */ public static float scalb(float f, int scale_factor) { @@ -709,34 +703,34 @@ public class FpUtils { *

        *
      • If either argument is a NaN, then NaN is returned. * - *
      • If both arguments are signed zeros, direction + *
      • If both arguments are signed zeros, {@code direction} * is returned unchanged (as implied by the requirement of * returning the second argument if the arguments compare as * equal). * - *
      • If start is - * ±Double.MIN_VALUE and direction + *
      • If {@code start} is + * ±{@code Double.MIN_VALUE} and {@code direction} * has a value such that the result should have a smaller - * magnitude, then a zero with the same sign as start + * magnitude, then a zero with the same sign as {@code start} * is returned. * - *
      • If start is infinite and - * direction has a value such that the result should - * have a smaller magnitude, Double.MAX_VALUE with the - * same sign as start is returned. + *
      • If {@code start} is infinite and + * {@code direction} has a value such that the result should + * have a smaller magnitude, {@code Double.MAX_VALUE} with the + * same sign as {@code start} is returned. * - *
      • If start is equal to ± - * Double.MAX_VALUE and direction has a + *
      • If {@code start} is equal to ± + * {@code Double.MAX_VALUE} and {@code direction} has a * value such that the result should have a larger magnitude, an - * infinity with same sign as start is returned. + * infinity with same sign as {@code start} is returned. *
      * * @param start starting floating-point value * @param direction value indicating which of - * start's neighbors or start should + * {@code start}'s neighbors or {@code start} should * be returned - * @return The floating-point number adjacent to start in the - * direction of direction. + * @return The floating-point number adjacent to {@code start} in the + * direction of {@code direction}. * @author Joseph D. Darcy */ public static double nextAfter(double start, double direction) { @@ -809,34 +803,34 @@ public class FpUtils { *
        *
      • If either argument is a NaN, then NaN is returned. * - *
      • If both arguments are signed zeros, a float - * zero with the same sign as direction is returned + *
      • If both arguments are signed zeros, a {@code float} + * zero with the same sign as {@code direction} is returned * (as implied by the requirement of returning the second argument * if the arguments compare as equal). * - *
      • If start is - * ±Float.MIN_VALUE and direction + *
      • If {@code start} is + * ±{@code Float.MIN_VALUE} and {@code direction} * has a value such that the result should have a smaller - * magnitude, then a zero with the same sign as start + * magnitude, then a zero with the same sign as {@code start} * is returned. * - *
      • If start is infinite and - * direction has a value such that the result should - * have a smaller magnitude, Float.MAX_VALUE with the - * same sign as start is returned. + *
      • If {@code start} is infinite and + * {@code direction} has a value such that the result should + * have a smaller magnitude, {@code Float.MAX_VALUE} with the + * same sign as {@code start} is returned. * - *
      • If start is equal to ± - * Float.MAX_VALUE and direction has a + *
      • If {@code start} is equal to ± + * {@code Float.MAX_VALUE} and {@code direction} has a * value such that the result should have a larger magnitude, an - * infinity with same sign as start is returned. + * infinity with same sign as {@code start} is returned. *
      * * @param start starting floating-point value * @param direction value indicating which of - * start's neighbors or start should + * {@code start}'s neighbors or {@code start} should * be returned - * @return The floating-point number adjacent to start in the - * direction of direction. + * @return The floating-point number adjacent to {@code start} in the + * direction of {@code direction}. * @author Joseph D. Darcy */ public static float nextAfter(float start, double direction) { @@ -900,12 +894,12 @@ public class FpUtils { } /** - * Returns the floating-point value adjacent to d in + * Returns the floating-point value adjacent to {@code d} in * the direction of positive infinity. This method is - * semantically equivalent to nextAfter(d, - * Double.POSITIVE_INFINITY); however, a nextUp + * semantically equivalent to {@code nextAfter(d, + * Double.POSITIVE_INFINITY)}; however, a {@code nextUp} * implementation may run faster than its equivalent - * nextAfter call. + * {@code nextAfter} call. * *

      Special Cases: *

        @@ -915,7 +909,7 @@ public class FpUtils { * positive infinity. * *
      • If the argument is zero, the result is - * Double.MIN_VALUE + * {@code Double.MIN_VALUE} * *
      * @@ -935,12 +929,12 @@ public class FpUtils { } /** - * Returns the floating-point value adjacent to f in + * Returns the floating-point value adjacent to {@code f} in * the direction of positive infinity. This method is - * semantically equivalent to nextAfter(f, - * Double.POSITIVE_INFINITY); however, a nextUp + * semantically equivalent to {@code nextAfter(f, + * Double.POSITIVE_INFINITY)}; however, a {@code nextUp} * implementation may run faster than its equivalent - * nextAfter call. + * {@code nextAfter} call. * *

      Special Cases: *

        @@ -950,7 +944,7 @@ public class FpUtils { * positive infinity. * *
      • If the argument is zero, the result is - * Float.MIN_VALUE + * {@code Float.MIN_VALUE} * *
      * @@ -970,12 +964,12 @@ public class FpUtils { } /** - * Returns the floating-point value adjacent to d in + * Returns the floating-point value adjacent to {@code d} in * the direction of negative infinity. This method is - * semantically equivalent to nextAfter(d, - * Double.NEGATIVE_INFINITY); however, a - * nextDown implementation may run faster than its - * equivalent nextAfter call. + * semantically equivalent to {@code nextAfter(d, + * Double.NEGATIVE_INFINITY)}; however, a + * {@code nextDown} implementation may run faster than its + * equivalent {@code nextAfter} call. * *

      Special Cases: *

        @@ -985,7 +979,7 @@ public class FpUtils { * negative infinity. * *
      • If the argument is zero, the result is - * -Double.MIN_VALUE + * {@code -Double.MIN_VALUE} * *
      * @@ -1007,12 +1001,12 @@ public class FpUtils { } /** - * Returns the floating-point value adjacent to f in + * Returns the floating-point value adjacent to {@code f} in * the direction of negative infinity. This method is - * semantically equivalent to nextAfter(f, - * Float.NEGATIVE_INFINITY); however, a - * nextDown implementation may run faster than its - * equivalent nextAfter call. + * semantically equivalent to {@code nextAfter(f, + * Float.NEGATIVE_INFINITY)}; however, a + * {@code nextDown} implementation may run faster than its + * equivalent {@code nextAfter} call. * *

      Special Cases: *

        @@ -1022,7 +1016,7 @@ public class FpUtils { * negative infinity. * *
      • If the argument is zero, the result is - * -Float.MIN_VALUE + * {@code -Float.MIN_VALUE} * *
      * @@ -1046,13 +1040,13 @@ public class FpUtils { /** * Returns the first floating-point argument with the sign of the * second floating-point argument. For this method, a NaN - * sign argument is always treated as if it were + * {@code sign} argument is always treated as if it were * positive. * * @param magnitude the parameter providing the magnitude of the result * @param sign the parameter providing the sign of the result - * @return a value with the magnitude of magnitude - * and the sign of sign. + * @return a value with the magnitude of {@code magnitude} + * and the sign of {@code sign}. * @author Joseph D. Darcy * @since 1.5 */ @@ -1063,13 +1057,13 @@ public class FpUtils { /** * Returns the first floating-point argument with the sign of the * second floating-point argument. For this method, a NaN - * sign argument is always treated as if it were + * {@code sign} argument is always treated as if it were * positive. * * @param magnitude the parameter providing the magnitude of the result * @param sign the parameter providing the sign of the result - * @return a value with the magnitude of magnitude - * and the sign of sign. + * @return a value with the magnitude of {@code magnitude} + * and the sign of {@code sign}. * @author Joseph D. Darcy */ public static float copySign(float magnitude, float sign) { @@ -1078,8 +1072,8 @@ public class FpUtils { /** * Returns the size of an ulp of the argument. An ulp of a - * double value is the positive distance between this - * floating-point value and the double value next + * {@code double} value is the positive distance between this + * floating-point value and the {@code double} value next * larger in magnitude. Note that for non-NaN x, * ulp(-x) == ulp(x). * @@ -1089,8 +1083,8 @@ public class FpUtils { *
    7. If the argument is positive or negative infinity, then the * result is positive infinity. *
    8. If the argument is positive or negative zero, then the result is - * Double.MIN_VALUE. - *
    9. If the argument is ±Double.MAX_VALUE, then + * {@code Double.MIN_VALUE}. + *
    10. If the argument is ±{@code Double.MAX_VALUE}, then * the result is equal to 2971. * * @@ -1105,11 +1099,9 @@ public class FpUtils { switch(exp) { case DoubleConsts.MAX_EXPONENT+1: // NaN or infinity return Math.abs(d); - // break; case DoubleConsts.MIN_EXPONENT-1: // zero or subnormal return Double.MIN_VALUE; - // break default: assert exp <= DoubleConsts.MAX_EXPONENT && exp >= DoubleConsts.MIN_EXPONENT; @@ -1126,14 +1118,13 @@ public class FpUtils { return Double.longBitsToDouble(1L << (exp - (DoubleConsts.MIN_EXPONENT - (DoubleConsts.SIGNIFICAND_WIDTH-1)) )); } - // break } } /** * Returns the size of an ulp of the argument. An ulp of a - * float value is the positive distance between this - * floating-point value and the float value next + * {@code float} value is the positive distance between this + * floating-point value and the {@code float} value next * larger in magnitude. Note that for non-NaN x, * ulp(-x) == ulp(x). * @@ -1143,8 +1134,8 @@ public class FpUtils { *
    11. If the argument is positive or negative infinity, then the * result is positive infinity. *
    12. If the argument is positive or negative zero, then the result is - * Float.MIN_VALUE. - *
    13. If the argument is ±Float.MAX_VALUE, then + * {@code Float.MIN_VALUE}. + *
    14. If the argument is ±{@code Float.MAX_VALUE}, then * the result is equal to 2104. * * @@ -1159,11 +1150,9 @@ public class FpUtils { switch(exp) { case FloatConsts.MAX_EXPONENT+1: // NaN or infinity return Math.abs(f); - // break; case FloatConsts.MIN_EXPONENT-1: // zero or subnormal return FloatConsts.MIN_VALUE; - // break default: assert exp <= FloatConsts.MAX_EXPONENT && exp >= FloatConsts.MIN_EXPONENT; @@ -1180,7 +1169,6 @@ public class FpUtils { return Float.intBitsToFloat(1 << (exp - (FloatConsts.MIN_EXPONENT - (FloatConsts.SIGNIFICAND_WIDTH-1)) )); } - // break } } diff --git a/jdk/src/share/classes/sun/misc/Launcher.java b/jdk/src/share/classes/sun/misc/Launcher.java index 3d7c5e3cc69..93a6b168f33 100644 --- a/jdk/src/share/classes/sun/misc/Launcher.java +++ b/jdk/src/share/classes/sun/misc/Launcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/misc/URLClassPath.java b/jdk/src/share/classes/sun/misc/URLClassPath.java index c828ab3e16e..d7664f1be7b 100644 --- a/jdk/src/share/classes/sun/misc/URLClassPath.java +++ b/jdk/src/share/classes/sun/misc/URLClassPath.java @@ -466,6 +466,7 @@ public class URLClassPath { */ private static class Loader implements Closeable { private final URL base; + private JarFile jarfile; // if this points to a jar file /* * Creates a new Loader for the specified URL. @@ -530,6 +531,17 @@ public class URLClassPath { } uc = url.openConnection(); InputStream in = uc.getInputStream(); + if (uc instanceof JarURLConnection) { + /* JarURLConnection.getInputStream() returns a separate + * instance on each call. So we have to close this here. + * The jar file cache will keep the file open. + * Also, need to remember the jar file so it can be closed + * in a hurry. + */ + JarURLConnection juc = (JarURLConnection)uc; + jarfile = juc.getJarFile(); + in.close(); + } } catch (Exception e) { return null; } @@ -559,7 +571,11 @@ public class URLClassPath { * close this loader and release all resources * method overridden in sub-classes */ - public void close () throws IOException {} + public void close () throws IOException { + if (jarfile != null) { + jarfile.close(); + } + } /* * Returns the local class path for this loader, or null if none. diff --git a/jdk/src/share/classes/sun/misc/VM.java b/jdk/src/share/classes/sun/misc/VM.java index 9ea6990ae24..0d8369a9d01 100644 --- a/jdk/src/share/classes/sun/misc/VM.java +++ b/jdk/src/share/classes/sun/misc/VM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * 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 sun.misc; +import static java.lang.Thread.State.*; import java.util.Properties; import java.util.HashMap; import java.util.Map; @@ -332,69 +333,37 @@ public class VM { } } - + /** + * Returns Thread.State for the given threadStatus + */ public static Thread.State toThreadState(int threadStatus) { - // Initialize the threadStateMap - initThreadStateMap(); - - Thread.State s = threadStateMap.get(threadStatus); - if (s == null) { - // default to RUNNABLE if the threadStatus value is unknown - s = Thread.State.RUNNABLE; - } - return s; - } - - // a map of threadStatus values to the corresponding Thread.State - private static Map threadStateMap = null; - private static Map threadStateNames = null; - - private synchronized static void initThreadStateMap() { - if (threadStateMap != null) { - return; - } - - final Thread.State[] ts = Thread.State.values(); - - final int[][] vmThreadStateValues = new int[ts.length][]; - final String[][] vmThreadStateNames = new String[ts.length][]; - getThreadStateValues(vmThreadStateValues, vmThreadStateNames); - - threadStateMap = new HashMap(); - threadStateNames = new HashMap(); - for (int i = 0; i < ts.length; i++) { - String state = ts[i].name(); - int[] values = null; - String[] names = null; - for (int j = 0; j < ts.length; j++) { - if (vmThreadStateNames[j][0].startsWith(state)) { - values = vmThreadStateValues[j]; - names = vmThreadStateNames[j]; - } - } - if (values == null) { - throw new InternalError("No VM thread state mapped to " + - state); - } - if (values.length != names.length) { - throw new InternalError("VM thread state values and names " + - " mapped to " + state + ": length not matched" ); - } - for (int k = 0; k < values.length; k++) { - threadStateMap.put(values[k], ts[i]); - threadStateNames.put(values[k], names[k]); - } + if ((threadStatus & JVMTI_THREAD_STATE_RUNNABLE) != 0) { + return RUNNABLE; + } else if ((threadStatus & JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER) != 0) { + return BLOCKED; + } else if ((threadStatus & JVMTI_THREAD_STATE_WAITING_INDEFINITELY) != 0) { + return WAITING; + } else if ((threadStatus & JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT) != 0) { + return TIMED_WAITING; + } else if ((threadStatus & JVMTI_THREAD_STATE_TERMINATED) != 0) { + return TERMINATED; + } else if ((threadStatus & JVMTI_THREAD_STATE_ALIVE) == 0) { + return NEW; + } else { + return RUNNABLE; } } - // Fill in vmThreadStateValues with int arrays, each of which contains - // the threadStatus values mapping to the Thread.State enum constant. - // Fill in vmThreadStateNames with String arrays, each of which contains - // the name of each threadStatus value of the format: - // [.] - // e.g. WAITING.OBJECT_WAIT - // - private native static void getThreadStateValues(int[][] vmThreadStateValues, - String[][] vmThreadStateNames); + + /* The threadStatus field is set by the VM at state transition + * in the hotspot implementation. Its value is set according to + * the JVM TI specification GetThreadState function. + */ + private final static int JVMTI_THREAD_STATE_ALIVE = 0x0001; + private final static int JVMTI_THREAD_STATE_TERMINATED = 0x0002; + private final static int JVMTI_THREAD_STATE_RUNNABLE = 0x0004; + private final static int JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 0x0400; + private final static int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010; + private final static int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020; static { initialize(); diff --git a/jdk/src/solaris/hpi/native_threads/src/mutex_md.c b/jdk/src/share/classes/sun/misc/resources/Messages_pt_BR.java similarity index 52% rename from jdk/src/solaris/hpi/native_threads/src/mutex_md.c rename to jdk/src/share/classes/sun/misc/resources/Messages_pt_BR.java index 852dc67b0d2..b90fc942acb 100644 --- a/jdk/src/solaris/hpi/native_threads/src/mutex_md.c +++ b/jdk/src/share/classes/sun/misc/resources/Messages_pt_BR.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. * 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,31 +23,31 @@ * questions. */ -/* - * Mutex HPI implementation for Solaris +package sun.misc.resources; + +/** + *

      This class represents the ResourceBundle + * for sun.misc. * - * Mutexes are used both by the system-independent monitor implementation and - * to implement critical regions elsewhere within the runtime. + * @author Michael Colburn + * @version 1.5, 11/17/05 */ -#include +public class Messages_pt_BR extends java.util.ListResourceBundle { -#include "hpi_impl.h" - -#include "mutex_md.h" -#include "threads_md.h" - -/* - * Return true of the mutex in question is already locked. note: - * this does not tell if the mutex is already locked by *this* - * thread, only that is is locked by *some* thread. - */ -bool_t -mutexLocked(mutex_t *mutex) -{ - if (mutex_trylock(mutex) == 0) { - mutex_unlock(mutex); - return FALSE; + /** + * Returns the contents of this ResourceBundle. + *

      + * @return the contents of this ResourceBundle. + */ + public Object[][] getContents() { + return contents; } - return TRUE; -} + + private static final Object[][] contents = { + { "optpkg.versionerror", "ERRO: formato de vers\u00e3o inv\u00e1lido usado no arquivo jar {0}. Verifique a documenta\u00e7\u00e3o para obter o formato de vers\u00e3o suportado." }, + { "optpkg.attributeerror", "ERRO: o atributo de manifesto JAR {0} necess\u00e1rio n\u00e3o est\u00e1 definido no arquivo JAR {1}." }, + { "optpkg.attributeserror", "ERRO: alguns atributos de manifesto JAR necess\u00e1rios n\u00e3o est\u00e3o definidos no arquivo JAR {0}." } + }; + +} \ No newline at end of file diff --git a/jdk/src/share/classes/sun/net/InetAddressCachePolicy.java b/jdk/src/share/classes/sun/net/InetAddressCachePolicy.java index 7b48f5765ad..8437a1d5234 100644 --- a/jdk/src/share/classes/sun/net/InetAddressCachePolicy.java +++ b/jdk/src/share/classes/sun/net/InetAddressCachePolicy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ package sun.net; -import java.net.InetAddress; import java.security.PrivilegedAction; import java.security.Security; @@ -57,7 +56,7 @@ public final class InetAddressCachePolicy { * caching. For security reasons, this caching is made forever when * a security manager is set. */ - private static int cachePolicy; + private static int cachePolicy = FOREVER; /* The Java-level namelookup cache policy for negative lookups: * @@ -67,31 +66,24 @@ public final class InetAddressCachePolicy { * default value is 0. It can be set to some other value for * performance reasons. */ - private static int negativeCachePolicy; + private static int negativeCachePolicy = NEVER; /* * Whether or not the cache policy for successful lookups was set * using a property (cmd line). */ - private static boolean set = false; + private static boolean propertySet; /* * Whether or not the cache policy for negative lookups was set * using a property (cmd line). */ - private static boolean negativeSet = false; + private static boolean propertyNegativeSet; /* * Initialize */ static { - - set = false; - negativeSet = false; - - cachePolicy = FOREVER; - negativeCachePolicy = 0; - Integer tmp = null; try { @@ -110,7 +102,7 @@ public final class InetAddressCachePolicy { if (cachePolicy < 0) { cachePolicy = FOREVER; } - set = true; + propertySet = true; } else { tmp = java.security.AccessController.doPrivileged (new sun.security.action.GetIntegerAction(cachePolicyPropFallback)); @@ -119,7 +111,14 @@ public final class InetAddressCachePolicy { if (cachePolicy < 0) { cachePolicy = FOREVER; } - set = true; + propertySet = true; + } else { + /* No properties defined for positive caching. If there is no + * security manager then use the default positive cache value. + */ + if (System.getSecurityManager() == null) { + cachePolicy = DEFAULT_POSITIVE; + } } } @@ -140,7 +139,7 @@ public final class InetAddressCachePolicy { if (negativeCachePolicy < 0) { negativeCachePolicy = FOREVER; } - negativeSet = true; + propertyNegativeSet = true; } else { tmp = java.security.AccessController.doPrivileged (new sun.security.action.GetIntegerAction(negativeCachePolicyPropFallback)); @@ -149,17 +148,13 @@ public final class InetAddressCachePolicy { if (negativeCachePolicy < 0) { negativeCachePolicy = FOREVER; } - negativeSet = true; + propertyNegativeSet = true; } } } public static synchronized int get() { - if (!set && System.getSecurityManager() == null) { - return DEFAULT_POSITIVE; - } else { - return cachePolicy; - } + return cachePolicy; } public static synchronized int getNegative() { @@ -174,21 +169,17 @@ public final class InetAddressCachePolicy { * should be cached */ public static synchronized void setIfNotSet(int newPolicy) { - /* * When setting the new value we may want to signal that the * cache should be flushed, though this doesn't seem strictly * necessary. */ - - if (!set) { + if (!propertySet) { checkValue(newPolicy, cachePolicy); cachePolicy = newPolicy; } - } - /** * Sets the cache policy for negative lookups if the user has not * already specified a cache policy for it using a @@ -197,14 +188,12 @@ public final class InetAddressCachePolicy { * should be cached */ public static synchronized void setNegativeIfNotSet(int newPolicy) { - /* * When setting the new value we may want to signal that the * cache should be flushed, though this doesn't seem strictly * necessary. */ - - if (!negativeSet) { + if (!propertyNegativeSet) { // Negative caching does not seem to have any security // implications. // checkValue(newPolicy, negativeCachePolicy); @@ -213,13 +202,11 @@ public final class InetAddressCachePolicy { } private static void checkValue(int newPolicy, int oldPolicy) { - /* * If malicious code gets a hold of this method, prevent * setting the cache policy to something laxer or some * invalid negative value. */ - if (newPolicy == FOREVER) return; @@ -229,7 +216,6 @@ public final class InetAddressCachePolicy { throw new SecurityException("can't make InetAddress cache more lax"); - } } } diff --git a/jdk/src/share/classes/sun/net/NetworkClient.java b/jdk/src/share/classes/sun/net/NetworkClient.java index 01322c91acc..89d49942c6a 100644 --- a/jdk/src/share/classes/sun/net/NetworkClient.java +++ b/jdk/src/share/classes/sun/net/NetworkClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 @@ import java.security.PrivilegedAction; * @author Jonathan Payne */ public class NetworkClient { + /* Default value of read timeout, if not specified (infinity) */ + public static final int DEFAULT_READ_TIMEOUT = -1; + + /* Default value of connect timeout, if not specified (infinity) */ + public static final int DEFAULT_CONNECT_TIMEOUT = -1; + protected Proxy proxy = Proxy.NO_PROXY; /** Socket for communicating with server. */ protected Socket serverSocket = null; @@ -53,8 +59,8 @@ public class NetworkClient { protected static int defaultSoTimeout; protected static int defaultConnectTimeout; - protected int readTimeout = -1; - protected int connectTimeout = -1; + protected int readTimeout = DEFAULT_READ_TIMEOUT; + protected int connectTimeout = DEFAULT_CONNECT_TIMEOUT; /* Name of encoding to use for output */ protected static String encoding; @@ -71,16 +77,12 @@ public class NetworkClient { return null; } }); - if (vals[0] == 0) - defaultSoTimeout = -1; - else + if (vals[0] != 0) { defaultSoTimeout = vals[0]; - - if (vals[1] == 0) - defaultConnectTimeout = -1; - else + } + if (vals[1] != 0) { defaultConnectTimeout = vals[1]; - + } encoding = encs[0]; try { @@ -232,7 +234,23 @@ public class NetworkClient { return connectTimeout; } + /** + * Sets the read timeout. + * + * Note: Public URLConnection (and protocol specific implementations) + * protect against negative timeout values being set. This implemenation, + * and protocol specific implementations, use -1 to represent the default + * read timeout. + * + * This method may be invoked with the default timeout value when the + * protocol handler is trying to reset the timeout after doing a + * potentially blocking internal operation, e.g. cleaning up unread + * response data, buffering error stream response data, etc + */ public void setReadTimeout(int timeout) { + if (timeout == DEFAULT_READ_TIMEOUT) + timeout = defaultSoTimeout; + if (serverSocket != null && timeout >= 0) { try { serverSocket.setSoTimeout(timeout); diff --git a/jdk/src/solaris/hpi/include/largefile_linux.h b/jdk/src/share/classes/sun/net/SocksProxy.java similarity index 65% rename from jdk/src/solaris/hpi/include/largefile_linux.h rename to jdk/src/share/classes/sun/net/SocksProxy.java index 580047bf49e..90826c0f196 100644 --- a/jdk/src/solaris/hpi/include/largefile_linux.h +++ b/jdk/src/share/classes/sun/net/SocksProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * 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,14 +23,27 @@ * questions. */ -#ifndef _JAVASOFT_LINUX_LARGEFILE_SUPPORT_H_ -#define _JAVASOFT_LINUX_LARGEFILE_SUPPORT_H_ +package sun.net; -/* - * For building on glibc-2.0 we need to define stat64 here. +import java.net.Proxy; +import java.net.SocketAddress; + +/** + * Proxy wrapper class so we can determine the socks protocol version. */ +public final class SocksProxy extends Proxy { + private final int version; -#include -#include + private SocksProxy(SocketAddress addr, int version) { + super(Proxy.Type.SOCKS, addr); + this.version = version; + } -#endif /* _JAVASOFT_LINUX_LARGEFILE_SUPPORT_H_ */ + public static SocksProxy create(SocketAddress addr, int version) { + return new SocksProxy(addr, version); + } + + public int protocolVersion() { + return version; + } +} diff --git a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java index 75a1d7043f5..1406674c5a9 100644 --- a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java +++ b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/httpserver/ChunkedInputStream.java b/jdk/src/share/classes/sun/net/httpserver/ChunkedInputStream.java index 8a7c88ac603..97b8242a9fa 100644 --- a/jdk/src/share/classes/sun/net/httpserver/ChunkedInputStream.java +++ b/jdk/src/share/classes/sun/net/httpserver/ChunkedInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -110,6 +110,7 @@ class ChunkedInputStream extends LeftOverInputStream { if (remaining == 0) { eof = true; consumeCRLF(); + t.getServerImpl().requestCompleted (t.getConnection()); return -1; } needToReadHeader = false; diff --git a/jdk/src/share/classes/sun/net/httpserver/Event.java b/jdk/src/share/classes/sun/net/httpserver/Event.java index fa7512b99e8..f019ede6e52 100644 --- a/jdk/src/share/classes/sun/net/httpserver/Event.java +++ b/jdk/src/share/classes/sun/net/httpserver/Event.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +40,7 @@ class Event { class WriteFinishedEvent extends Event { WriteFinishedEvent (ExchangeImpl t) { super (t); + assert !t.writefinished; + t.writefinished = true; } } diff --git a/jdk/src/share/classes/sun/net/httpserver/ExchangeImpl.java b/jdk/src/share/classes/sun/net/httpserver/ExchangeImpl.java index 26453e6973e..eac2bc3ddf7 100644 --- a/jdk/src/share/classes/sun/net/httpserver/ExchangeImpl.java +++ b/jdk/src/share/classes/sun/net/httpserver/ExchangeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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 ExchangeImpl { Headers reqHdrs, rspHdrs; Request req; String method; + boolean writefinished; URI uri; HttpConnection connection; long reqContentLen; diff --git a/jdk/src/share/classes/sun/net/httpserver/FixedLengthInputStream.java b/jdk/src/share/classes/sun/net/httpserver/FixedLengthInputStream.java index a98779295cb..4d8099279f9 100644 --- a/jdk/src/share/classes/sun/net/httpserver/FixedLengthInputStream.java +++ b/jdk/src/share/classes/sun/net/httpserver/FixedLengthInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,6 +56,9 @@ class FixedLengthInputStream extends LeftOverInputStream { int n = in.read(b, off, len); if (n > -1) { remaining -= n; + if (remaining == 0) { + t.getServerImpl().requestCompleted (t.getConnection()); + } } return n; } diff --git a/jdk/src/share/classes/sun/net/httpserver/HttpConnection.java b/jdk/src/share/classes/sun/net/httpserver/HttpConnection.java index 6d2cf7f954c..c9f31efb7d4 100644 --- a/jdk/src/share/classes/sun/net/httpserver/HttpConnection.java +++ b/jdk/src/share/classes/sun/net/httpserver/HttpConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,10 +55,15 @@ class HttpConnection { SelectionKey selectionKey; String protocol; long time; + volatile long creationTime; // time this connection was created + volatile long rspStartedTime; // time we started writing the response int remaining; boolean closed = false; Logger logger; + public enum State {IDLE, REQUEST, RESPONSE}; + volatile State state; + public String toString() { String s = null; if (chan != null) { @@ -78,6 +83,14 @@ class HttpConnection { context = ctx; } + State getState() { + return state; + } + + void setState (State s) { + state = s; + } + void setParameters ( InputStream in, OutputStream rawout, SocketChannel chan, SSLEngine engine, SSLStreams sslStreams, SSLContext sslContext, String protocol, diff --git a/jdk/src/share/classes/sun/net/httpserver/Request.java b/jdk/src/share/classes/sun/net/httpserver/Request.java index 56c2e137f57..ee2db48240f 100644 --- a/jdk/src/share/classes/sun/net/httpserver/Request.java +++ b/jdk/src/share/classes/sun/net/httpserver/Request.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +129,22 @@ class Request { hdrs = new Headers(); char s[] = new char[10]; + int len = 0; + int firstc = is.read(); + + // check for empty headers + if (firstc == CR || firstc == LF) { + int c = is.read(); + if (c == CR || c == LF) { + return hdrs; + } + s[0] = (char)firstc; + len = 1; + firstc = c; + } + while (firstc != LF && firstc != CR && firstc >= 0) { - int len = 0; int keyend = -1; int c; boolean inKey = firstc > ' '; @@ -191,6 +204,7 @@ class Request { else v = String.copyValueOf(s, keyend, len - keyend); hdrs.add (k,v); + len = 0; } return hdrs; } @@ -201,32 +215,22 @@ class Request { static class ReadStream extends InputStream { SocketChannel channel; - SelectorCache sc; - Selector selector; ByteBuffer chanbuf; - SelectionKey key; - int available; byte[] one; - boolean closed = false, eof = false; + private boolean closed = false, eof = false; ByteBuffer markBuf; /* reads may be satisifed from this buffer */ boolean marked; boolean reset; int readlimit; static long readTimeout; ServerImpl server; - - static { - readTimeout = ServerConfig.getReadTimeout(); - } + final static int BUFSIZE = 8 * 1024; public ReadStream (ServerImpl server, SocketChannel chan) throws IOException { this.channel = chan; this.server = server; - sc = SelectorCache.getSelectorCache(); - selector = sc.getSelector(); - chanbuf = ByteBuffer.allocate (8* 1024); - key = chan.register (selector, SelectionKey.OP_READ); - available = 0; + chanbuf = ByteBuffer.allocate (BUFSIZE); + chanbuf.clear(); one = new byte[1]; closed = marked = reset = false; } @@ -255,6 +259,12 @@ class Request { return -1; } + assert channel.isBlocking(); + + if (off < 0 || srclen < 0|| srclen > (b.length-off)) { + throw new IndexOutOfBoundsException (); + } + if (reset) { /* satisfy from markBuf */ canreturn = markBuf.remaining (); willreturn = canreturn>srclen ? srclen : canreturn; @@ -263,17 +273,19 @@ class Request { reset = false; } } else { /* satisfy from channel */ - canreturn = available(); - while (canreturn == 0 && !eof) { - block (); - canreturn = available(); + chanbuf.clear (); + if (srclen < BUFSIZE) { + chanbuf.limit (srclen); } - if (eof) { + do { + willreturn = channel.read (chanbuf); + } while (willreturn == 0); + if (willreturn == -1) { + eof = true; return -1; } - willreturn = canreturn>srclen ? srclen : canreturn; + chanbuf.flip (); chanbuf.get(b, off, willreturn); - available -= willreturn; if (marked) { /* copy into markBuf */ try { @@ -286,6 +298,11 @@ class Request { return willreturn; } + public boolean markSupported () { + return true; + } + + /* Does not query the OS socket */ public synchronized int available () throws IOException { if (closed) throw new IOException ("Stream is closed"); @@ -296,36 +313,7 @@ class Request { if (reset) return markBuf.remaining(); - if (available > 0) - return available; - - chanbuf.clear (); - available = channel.read (chanbuf); - if (available > 0) { - chanbuf.flip(); - } else if (available == -1) { - eof = true; - available = 0; - } - return available; - } - - /** - * block() only called when available==0 and buf is empty - */ - private synchronized void block () throws IOException { - long currtime = server.getTime(); - long maxtime = currtime + readTimeout; - - while (currtime < maxtime) { - if (selector.select (readTimeout) == 1) { - selector.selectedKeys().clear(); - available (); - return; - } - currtime = server.getTime(); - } - throw new SocketTimeoutException ("no data received"); + return chanbuf.remaining(); } public void close () throws IOException { @@ -333,8 +321,6 @@ class Request { return; } channel.close (); - selector.selectNow(); - sc.freeSelector(selector); closed = true; } @@ -362,23 +348,14 @@ class Request { SocketChannel channel; ByteBuffer buf; SelectionKey key; - SelectorCache sc; - Selector selector; boolean closed; byte[] one; ServerImpl server; - static long writeTimeout; - - static { - writeTimeout = ServerConfig.getWriteTimeout(); - } public WriteStream (ServerImpl server, SocketChannel channel) throws IOException { this.channel = channel; this.server = server; - sc = SelectorCache.getSelectorCache(); - selector = sc.getSelector(); - key = channel.register (selector, SelectionKey.OP_WRITE); + assert channel.isBlocking(); closed = false; one = new byte [1]; buf = ByteBuffer.allocate (4096); @@ -411,31 +388,14 @@ class Request { l -= n; if (l == 0) return; - block(); } } - void block () throws IOException { - long currtime = server.getTime(); - long maxtime = currtime + writeTimeout; - - while (currtime < maxtime) { - if (selector.select (writeTimeout) == 1) { - selector.selectedKeys().clear (); - return; - } - currtime = server.getTime(); - } - throw new SocketTimeoutException ("write blocked too long"); - } - - public void close () throws IOException { if (closed) return; + //server.logStackTrace ("Request.OS.close: isOpen="+channel.isOpen()); channel.close (); - selector.selectNow(); - sc.freeSelector(selector); closed = true; } } diff --git a/jdk/src/share/classes/sun/net/httpserver/SSLStreams.java b/jdk/src/share/classes/sun/net/httpserver/SSLStreams.java index fed7f4b4943..c6b87cd6729 100644 --- a/jdk/src/share/classes/sun/net/httpserver/SSLStreams.java +++ b/jdk/src/share/classes/sun/net/httpserver/SSLStreams.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +53,6 @@ class SSLStreams { EngineWrapper wrapper; OutputStream os; InputStream is; - static long readTimeout = ServerConfig.getReadTimeout(); - static long writeTimeout = ServerConfig.getWriteTimeout(); /* held by thread doing the hand-shake on this connection */ Lock handshaking = new ReentrantLock(); @@ -76,11 +74,14 @@ class SSLStreams { private void configureEngine(HttpsConfigurator cfg, InetSocketAddress addr){ if (cfg != null) { Parameters params = new Parameters (cfg, addr); +//BEGIN_TIGER_EXCLUDE cfg.configure (params); SSLParameters sslParams = params.getSSLParameters(); if (sslParams != null) { engine.setSSLParameters (sslParams); - } else { + } else +//END_TIGER_EXCLUDE + { /* tiger compatibility */ if (params.getCipherSuites() != null) { try { @@ -104,7 +105,6 @@ class SSLStreams { class Parameters extends HttpsParameters { InetSocketAddress addr; - SSLParameters params; HttpsConfigurator cfg; Parameters (HttpsConfigurator cfg, InetSocketAddress addr) { @@ -117,12 +117,15 @@ class SSLStreams { public HttpsConfigurator getHttpsConfigurator() { return cfg; } +//BEGIN_TIGER_EXCLUDE + SSLParameters params; public void setSSLParameters (SSLParameters p) { params = p; } SSLParameters getSSLParameters () { return params; } +//END_TIGER_EXCLUDE } /** @@ -245,9 +248,6 @@ class SSLStreams { SocketChannel chan; SSLEngine engine; - SelectorCache sc; - Selector write_selector, read_selector; - SelectionKey wkey, rkey; Object wrapLock, unwrapLock; ByteBuffer unwrap_src, wrap_dst; boolean closed = false; @@ -260,16 +260,9 @@ class SSLStreams { unwrapLock = new Object(); unwrap_src = allocate(BufType.PACKET); wrap_dst = allocate(BufType.PACKET); - sc = SelectorCache.getSelectorCache(); - write_selector = sc.getSelector(); - wkey = chan.register (write_selector, SelectionKey.OP_WRITE); - read_selector = sc.getSelector(); - wkey = chan.register (read_selector, SelectionKey.OP_READ); } void close () throws IOException { - sc.freeSelector (write_selector); - sc.freeSelector (read_selector); } /* try to wrap and send the data in src. Handles OVERFLOW. @@ -304,15 +297,7 @@ class SSLStreams { wrap_dst.flip(); int l = wrap_dst.remaining(); assert l == r.result.bytesProduced(); - long currtime = time.getTime(); - long maxtime = currtime + writeTimeout; while (l>0) { - write_selector.select(writeTimeout); // timeout - currtime = time.getTime(); - if (currtime > maxtime) { - throw new SocketTimeoutException ("write timed out"); - } - write_selector.selectedKeys().clear(); l -= chan.write (wrap_dst); } } @@ -342,20 +327,12 @@ class SSLStreams { needData = true; } synchronized (unwrapLock) { - int x,y; + int x; do { if (needData) { - long currTime = time.getTime(); - long maxtime = currTime + readTimeout; do { - if (currTime > maxtime) { - throw new SocketTimeoutException ("read timedout"); - } - y = read_selector.select (readTimeout); - currTime = time.getTime(); - } while (y != 1); - read_selector.selectedKeys().clear(); x = chan.read (unwrap_src); + } while (x == 0); if (x == -1) { throw new IOException ("connection closed for reading"); } diff --git a/jdk/src/share/classes/sun/net/httpserver/SelectorCache.java b/jdk/src/share/classes/sun/net/httpserver/SelectorCache.java deleted file mode 100644 index afd87c02235..00000000000 --- a/jdk/src/share/classes/sun/net/httpserver/SelectorCache.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.net.httpserver; - -import java.util.*; -import java.nio.*; -import java.net.*; -import java.io.*; -import java.security.*; -import java.nio.channels.*; - -/* - * Implements a cache of java.nio.channels.Selector - * where Selectors are allocated on demand and placed - * in a temporary cache for a period of time, so they - * can be reused. If a period of between 2 and 4 minutes - * elapses without being used, then they are closed. - */ -public class SelectorCache { - - static SelectorCache cache = null; - - private SelectorCache () { - freeSelectors = new LinkedList(); - CacheCleaner c = AccessController.doPrivileged( - new PrivilegedAction() { - public CacheCleaner run() { - CacheCleaner cleaner = new CacheCleaner(); - cleaner.setDaemon (true); - return cleaner; - } - }); - c.start(); - } - - /** - * factory method for creating single instance - */ - public static SelectorCache getSelectorCache () { - synchronized (SelectorCache.class) { - if (cache == null) { - cache = new SelectorCache (); - } - } - return cache; - } - - private static class SelectorWrapper { - private Selector sel; - private boolean deleteFlag; - private SelectorWrapper (Selector sel) { - this.sel = sel; - this.deleteFlag = false; - } - public Selector getSelector() { return sel;} - public boolean getDeleteFlag () {return deleteFlag;} - public void setDeleteFlag (boolean b) {deleteFlag = b;} - } - - /* list of free selectors. Can be re-allocated for a period - * of time, after which if not allocated will be closed - * and removed from the list (by CacheCleaner thread) - */ - LinkedList freeSelectors; - - synchronized Selector getSelector () throws IOException { - SelectorWrapper wrapper = null; - Selector selector; - - if (freeSelectors.size() > 0) { - wrapper = freeSelectors.remove(); - selector = wrapper.getSelector(); - } else { - selector = Selector.open(); - } - return selector; - } - - synchronized void freeSelector (Selector selector) { - freeSelectors.add (new SelectorWrapper (selector)); - } - - /* Thread ensures that entries on freeSelector list - * remain there for at least 2 minutes and no longer - * than 4 minutes. - */ - class CacheCleaner extends Thread { - public void run () { - long timeout = ServerConfig.getSelCacheTimeout() * 1000; - while (true) { - try {Thread.sleep (timeout); } catch (Exception e) {} - synchronized (freeSelectors) { - ListIterator l = freeSelectors.listIterator(); - while (l.hasNext()) { - SelectorWrapper w = l.next(); - if (w.getDeleteFlag()) { - /* 2nd pass. Close the selector */ - try { - w.getSelector().close(); - } catch (IOException e) {} - l.remove(); - } else { - /* 1st pass. Set the flag */ - w.setDeleteFlag (true); - } - } - } - } - } - } -} diff --git a/jdk/src/share/classes/sun/net/httpserver/ServerConfig.java b/jdk/src/share/classes/sun/net/httpserver/ServerConfig.java index d4c87847547..0ada03ddfcc 100644 --- a/jdk/src/share/classes/sun/net/httpserver/ServerConfig.java +++ b/jdk/src/share/classes/sun/net/httpserver/ServerConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ package sun.net.httpserver; import com.sun.net.httpserver.*; import com.sun.net.httpserver.spi.*; +import java.util.logging.Logger; +import java.security.PrivilegedAction; /** * Parameters that users will not likely need to set @@ -37,23 +39,26 @@ class ServerConfig { static int clockTick; - static int defaultClockTick = 10000 ; // 10 sec. + static final int DEFAULT_CLOCK_TICK = 10000 ; // 10 sec. /* These values must be a reasonable multiple of clockTick */ - static long defaultReadTimeout = 20 ; // 20 sec. - static long defaultWriteTimeout = 60 ; // 60 sec. - static long defaultIdleInterval = 300 ; // 5 min - static long defaultSelCacheTimeout = 120 ; // seconds - static int defaultMaxIdleConnections = 200 ; + static final long DEFAULT_IDLE_INTERVAL = 30 ; // 5 min + static final int DEFAULT_MAX_IDLE_CONNECTIONS = 200 ; - static long defaultDrainAmount = 64 * 1024; + static final long DEFAULT_MAX_REQ_TIME = -1; // default: forever + static final long DEFAULT_MAX_RSP_TIME = -1; // default: forever + static final long DEFAULT_TIMER_MILLIS = 1000; + + static final long DEFAULT_DRAIN_AMOUNT = 64 * 1024; - static long readTimeout; - static long writeTimeout; static long idleInterval; - static long selCacheTimeout; static long drainAmount; // max # of bytes to drain from an inputstream static int maxIdleConnections; + + // max time a request or response is allowed to take + static long maxReqTime; + static long maxRspTime; + static long timerMillis; static boolean debug = false; static { @@ -61,49 +66,79 @@ class ServerConfig { idleInterval = ((Long)java.security.AccessController.doPrivileged( new sun.security.action.GetLongAction( "sun.net.httpserver.idleInterval", - defaultIdleInterval))).longValue() * 1000; + DEFAULT_IDLE_INTERVAL))).longValue() * 1000; clockTick = ((Integer)java.security.AccessController.doPrivileged( new sun.security.action.GetIntegerAction( "sun.net.httpserver.clockTick", - defaultClockTick))).intValue(); + DEFAULT_CLOCK_TICK))).intValue(); maxIdleConnections = ((Integer)java.security.AccessController.doPrivileged( new sun.security.action.GetIntegerAction( "sun.net.httpserver.maxIdleConnections", - defaultMaxIdleConnections))).intValue(); - - readTimeout = ((Long)java.security.AccessController.doPrivileged( - new sun.security.action.GetLongAction( - "sun.net.httpserver.readTimeout", - defaultReadTimeout))).longValue()* 1000; - - selCacheTimeout = ((Long)java.security.AccessController.doPrivileged( - new sun.security.action.GetLongAction( - "sun.net.httpserver.selCacheTimeout", - defaultSelCacheTimeout))).longValue()* 1000; - - writeTimeout = ((Long)java.security.AccessController.doPrivileged( - new sun.security.action.GetLongAction( - "sun.net.httpserver.writeTimeout", - defaultWriteTimeout))).longValue()* 1000; + DEFAULT_MAX_IDLE_CONNECTIONS))).intValue(); drainAmount = ((Long)java.security.AccessController.doPrivileged( new sun.security.action.GetLongAction( "sun.net.httpserver.drainAmount", - defaultDrainAmount))).longValue(); + DEFAULT_DRAIN_AMOUNT))).longValue(); + + maxReqTime = ((Long)java.security.AccessController.doPrivileged( + new sun.security.action.GetLongAction( + "sun.net.httpserver.maxReqTime", + DEFAULT_MAX_REQ_TIME))).longValue(); + + maxRspTime = ((Long)java.security.AccessController.doPrivileged( + new sun.security.action.GetLongAction( + "sun.net.httpserver.maxRspTime", + DEFAULT_MAX_RSP_TIME))).longValue(); + + timerMillis = ((Long)java.security.AccessController.doPrivileged( + new sun.security.action.GetLongAction( + "sun.net.httpserver.timerMillis", + DEFAULT_TIMER_MILLIS))).longValue(); debug = ((Boolean)java.security.AccessController.doPrivileged( new sun.security.action.GetBooleanAction( "sun.net.httpserver.debug"))).booleanValue(); } - static long getReadTimeout () { - return readTimeout; - } - static long getSelCacheTimeout () { - return selCacheTimeout; + static void checkLegacyProperties (final Logger logger) { + + // legacy properties that are no longer used + // print a warning to logger if they are set. + + java.security.AccessController.doPrivileged( + new PrivilegedAction() { + public Void run () { + if (System.getProperty("sun.net.httpserver.readTimeout") + !=null) + { + logger.warning ("sun.net.httpserver.readTimeout "+ + "property is no longer used. "+ + "Use sun.net.httpserver.maxReqTime instead." + ); + } + if (System.getProperty("sun.net.httpserver.writeTimeout") + !=null) + { + logger.warning ("sun.net.httpserver.writeTimeout "+ + "property is no longer used. Use "+ + "sun.net.httpserver.maxRspTime instead." + ); + } + if (System.getProperty("sun.net.httpserver.selCacheTimeout") + !=null) + { + logger.warning ("sun.net.httpserver.selCacheTimeout "+ + "property is no longer used." + ); + } + return null; + } + } + ); } static boolean debugEnabled () { @@ -122,11 +157,19 @@ class ServerConfig { return maxIdleConnections; } - static long getWriteTimeout () { - return writeTimeout; - } - static long getDrainAmount () { return drainAmount; } + + static long getMaxReqTime () { + return maxReqTime; + } + + static long getMaxRspTime () { + return maxRspTime; + } + + static long getTimerMillis () { + return timerMillis; + } } diff --git a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java index a8b02878082..0fa61a8b4d8 100644 --- a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java +++ b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ import java.util.logging.Level; import javax.net.ssl.*; import com.sun.net.httpserver.*; import com.sun.net.httpserver.spi.*; +import sun.net.httpserver.HttpConnection.State; /** * Provides implementation for both HTTP and HTTPS @@ -55,6 +56,12 @@ class ServerImpl implements TimeSource { private SelectionKey listenerKey; private Set idleConnections; private Set allConnections; + /* following two are used to keep track of the times + * when a connection/request is first received + * and when we start to send the response + */ + private Set reqConnections; + private Set rspConnections; private List events; private Object lolock = new Object(); private volatile boolean finished = false; @@ -62,14 +69,19 @@ class ServerImpl implements TimeSource { private boolean bound = false; private boolean started = false; private volatile long time; /* current time */ + private volatile long subticks = 0; private volatile long ticks; /* number of clock ticks since server started */ private HttpServer wrapper; final static int CLOCK_TICK = ServerConfig.getClockTick(); final static long IDLE_INTERVAL = ServerConfig.getIdleInterval(); final static int MAX_IDLE_CONNECTIONS = ServerConfig.getMaxIdleConnections(); + final static long TIMER_MILLIS = ServerConfig.getTimerMillis (); + final static long MAX_REQ_TIME=getTimeMillis(ServerConfig.getMaxReqTime()); + final static long MAX_RSP_TIME=getTimeMillis(ServerConfig.getMaxRspTime()); + final static boolean timer1Enabled = MAX_REQ_TIME != -1 || MAX_RSP_TIME != -1; - private Timer timer; + private Timer timer, timer1; private Logger logger; ServerImpl ( @@ -79,6 +91,7 @@ class ServerImpl implements TimeSource { this.protocol = protocol; this.wrapper = wrapper; this.logger = Logger.getLogger ("com.sun.net.httpserver"); + ServerConfig.checkLegacyProperties (logger); https = protocol.equalsIgnoreCase ("https"); this.address = addr; contexts = new ContextList(); @@ -94,9 +107,18 @@ class ServerImpl implements TimeSource { dispatcher = new Dispatcher(); idleConnections = Collections.synchronizedSet (new HashSet()); allConnections = Collections.synchronizedSet (new HashSet()); + reqConnections = Collections.synchronizedSet (new HashSet()); + rspConnections = Collections.synchronizedSet (new HashSet()); time = System.currentTimeMillis(); timer = new Timer ("server-timer", true); timer.schedule (new ServerTimerTask(), CLOCK_TICK, CLOCK_TICK); + if (timer1Enabled) { + timer1 = new Timer ("server-timer1", true); + timer1.schedule (new ServerTimerTask1(),TIMER_MILLIS,TIMER_MILLIS); + logger.config ("HttpServer timer1 enabled period in ms: "+TIMER_MILLIS); + logger.config ("MAX_REQ_TIME: "+MAX_REQ_TIME); + logger.config ("MAX_RSP_TIME: "+MAX_RSP_TIME); + } events = new LinkedList(); logger.config ("HttpServer created "+protocol+" "+ addr); } @@ -181,6 +203,9 @@ class ServerImpl implements TimeSource { allConnections.clear(); idleConnections.clear(); timer.cancel(); + if (timer1Enabled) { + timer1.cancel(); + } } Dispatcher dispatcher; @@ -236,13 +261,6 @@ class ServerImpl implements TimeSource { } } - int resultSize () { - synchronized (lolock) { - return events.size (); - } - } - - /* main server listener task */ class Dispatcher implements Runnable { @@ -257,7 +275,7 @@ class ServerImpl implements TimeSource { if (terminating && exchanges == 0) { finished = true; } - SocketChannel chan = c.getChannel(); + responseCompleted (c); LeftOverInputStream is = t.getOriginalInputStream(); if (!is.isEOF()) { t.close = true; @@ -268,17 +286,10 @@ class ServerImpl implements TimeSource { } else { if (is.isDataBuffered()) { /* don't re-enable the interestops, just handle it */ + requestStarted (c); handle (c.getChannel(), c); } else { - /* re-enable interestops */ - SelectionKey key = c.getSelectionKey(); - if (key.isValid()) { - key.interestOps ( - key.interestOps()|SelectionKey.OP_READ - ); - } - c.time = getTime() + IDLE_INTERVAL; - idleConnections.add (c); + connsToRegister.add (c); } } } @@ -290,21 +301,50 @@ class ServerImpl implements TimeSource { } } + final LinkedList connsToRegister = + new LinkedList(); + + void reRegister (HttpConnection c) { + /* re-register with selector */ + try { + SocketChannel chan = c.getChannel(); + chan.configureBlocking (false); + SelectionKey key = chan.register (selector, SelectionKey.OP_READ); + key.attach (c); + c.selectionKey = key; + c.time = getTime() + IDLE_INTERVAL; + idleConnections.add (c); + } catch (IOException e) { + dprint(e); + logger.log(Level.FINER, "Dispatcher(8)", e); + c.close(); + } + } + public void run() { while (!finished) { try { + ListIterator li = + connsToRegister.listIterator(); + for (HttpConnection c : connsToRegister) { + reRegister(c); + } + connsToRegister.clear(); - /* process the events list first */ - - while (resultSize() > 0) { - Event r; - synchronized (lolock) { - r = events.remove(0); - handleEvent (r); + List list = null; + selector.select(1000); + synchronized (lolock) { + if (events.size() > 0) { + list = events; + events = new LinkedList(); } } - selector.select(1000); + if (list != null) { + for (Event r: list) { + handleEvent (r); + } + } /* process the selected list now */ @@ -327,6 +367,7 @@ class ServerImpl implements TimeSource { c.selectionKey = newkey; c.setChannel (chan); newkey.attach (c); + requestStarted (c); allConnections.add (c); } else { try { @@ -334,27 +375,44 @@ class ServerImpl implements TimeSource { boolean closed; SocketChannel chan = (SocketChannel)key.channel(); HttpConnection conn = (HttpConnection)key.attachment(); - // interestOps will be restored at end of read - key.interestOps (0); + + key.cancel(); + chan.configureBlocking (true); + if (idleConnections.remove(conn)) { + // was an idle connection so add it + // to reqConnections set. + requestStarted (conn); + } handle (chan, conn); } else { assert false; } + } catch (CancelledKeyException e) { + handleException(key, null); } catch (IOException e) { - HttpConnection conn = (HttpConnection)key.attachment(); - logger.log ( - Level.FINER, "Dispatcher (2)", e - ); - conn.close(); + handleException(key, e); } } } + // call the selector just to process the cancelled keys + selector.selectNow(); + } catch (IOException e) { + logger.log (Level.FINER, "Dispatcher (4)", e); } catch (Exception e) { - logger.log (Level.FINER, "Dispatcher (3)", e); + e.printStackTrace(); + logger.log (Level.FINER, "Dispatcher (7)", e); } } } + private void handleException (SelectionKey key, Exception e) { + HttpConnection conn = (HttpConnection)key.attachment(); + if (e != null) { + logger.log (Level.FINER, "Dispatcher (2)", e); + } + closeConnection(conn); + } + public void handle (SocketChannel chan, HttpConnection conn) throws IOException { @@ -363,10 +421,10 @@ class ServerImpl implements TimeSource { executor.execute (t); } catch (HttpError e1) { logger.log (Level.FINER, "Dispatcher (4)", e1); - conn.close(); + closeConnection(conn); } catch (IOException e) { logger.log (Level.FINER, "Dispatcher (5)", e); - conn.close(); + closeConnection(conn); } } } @@ -390,7 +448,26 @@ class ServerImpl implements TimeSource { return logger; } - /* per exchange task */ + private void closeConnection(HttpConnection conn) { + conn.close(); + allConnections.remove(conn); + switch (conn.getState()) { + case REQUEST: + reqConnections.remove(conn); + break; + case RESPONSE: + rspConnections.remove(conn); + break; + case IDLE: + idleConnections.remove(conn); + break; + } + assert !reqConnections.remove(conn); + assert !rspConnections.remove(conn); + assert !idleConnections.remove(conn); + } + + /* per exchange task */ class Exchange implements Runnable { SocketChannel chan; @@ -450,8 +527,7 @@ class ServerImpl implements TimeSource { requestLine = req.requestLine(); if (requestLine == null) { /* connection closed */ - connection.close(); - allConnections.remove(connection); + closeConnection(connection); return; } int space = requestLine.indexOf (' '); @@ -482,6 +558,9 @@ class ServerImpl implements TimeSource { if (s != null) { clen = Long.parseLong(s); } + if (clen == 0) { + requestCompleted (connection); + } } ctx = contexts.findContext (protocol, uri.getPath()); if (ctx == null) { @@ -560,7 +639,7 @@ class ServerImpl implements TimeSource { } catch (IOException e1) { logger.log (Level.FINER, "ServerImpl.Exchange (1)", e1); - connection.close(); + closeConnection(connection); } catch (NumberFormatException e3) { reject (Code.HTTP_BAD_REQUEST, requestLine, "NumberFormatException thrown"); @@ -569,7 +648,7 @@ class ServerImpl implements TimeSource { requestLine, "URISyntaxException thrown"); } catch (Exception e4) { logger.log (Level.FINER, "ServerImpl.Exchange (2)", e4); - connection.close(); + closeConnection(connection); } } @@ -591,47 +670,60 @@ class ServerImpl implements TimeSource { rejected = true; logReply (code, requestStr, message); sendReply ( - code, true, "

      "+code+Code.msg(code)+"

      "+message + code, false, "

      "+code+Code.msg(code)+"

      "+message ); - /* connection is already closed by sendReply, now remove it */ - allConnections.remove(connection); + closeConnection(connection); } void sendReply ( int code, boolean closeNow, String text) { try { - String s = "HTTP/1.1 " + code + Code.msg(code) + "\r\n"; + StringBuilder builder = new StringBuilder (512); + builder.append ("HTTP/1.1 ") + .append (code).append (Code.msg(code)).append ("\r\n"); + if (text != null && text.length() != 0) { - s = s + "Content-Length: "+text.length()+"\r\n"; - s = s + "Content-Type: text/html\r\n"; + builder.append ("Content-Length: ") + .append (text.length()).append ("\r\n") + .append ("Content-Type: text/html\r\n"); } else { - s = s + "Content-Length: 0\r\n"; + builder.append ("Content-Length: 0\r\n"); text = ""; } if (closeNow) { - s = s + "Connection: close\r\n"; + builder.append ("Connection: close\r\n"); } - s = s + "\r\n" + text; + builder.append ("\r\n").append (text); + String s = builder.toString(); byte[] b = s.getBytes("ISO8859_1"); rawout.write (b); rawout.flush(); if (closeNow) { - connection.close(); + closeConnection(connection); } } catch (IOException e) { logger.log (Level.FINER, "ServerImpl.sendReply", e); - connection.close(); + closeConnection(connection); } } } void logReply (int code, String requestStr, String text) { + if (!logger.isLoggable(Level.FINE)) { + return; + } if (text == null) { text = ""; } - String message = requestStr + " [" + code + " " + + String r; + if (requestStr.length() > 80) { + r = requestStr.substring (0, 80) + ""; + } else { + r = requestStr; + } + String message = r + " [" + code + " " + Code.msg(code) + "] ("+text+")"; logger.fine (message); } @@ -667,6 +759,34 @@ class ServerImpl implements TimeSource { return wrapper; } + void requestStarted (HttpConnection c) { + c.creationTime = getTime(); + c.setState (State.REQUEST); + reqConnections.add (c); + } + + // called after a request has been completely read + // by the server. This stops the timer which would + // close the connection if the request doesn't arrive + // quickly enough. It then starts the timer + // that ensures the client reads the response in a timely + // fashion. + + void requestCompleted (HttpConnection c) { + assert c.getState() == State.REQUEST; + reqConnections.remove (c); + c.rspStartedTime = getTime(); + rspConnections.add (c); + c.setState (State.RESPONSE); + } + + // called after response has been sent + void responseCompleted (HttpConnection c) { + assert c.getState() == State.RESPONSE; + rspConnections.remove (c); + c.setState (State.IDLE); + } + /** * TimerTask run every CLOCK_TICK ms */ @@ -689,4 +809,62 @@ class ServerImpl implements TimeSource { } } } + + class ServerTimerTask1 extends TimerTask { + + // runs every TIMER_MILLIS + public void run () { + LinkedList toClose = new LinkedList(); + time = System.currentTimeMillis(); + synchronized (reqConnections) { + if (MAX_REQ_TIME != -1) { + for (HttpConnection c : reqConnections) { + if (c.creationTime + TIMER_MILLIS + MAX_REQ_TIME <= time) { + toClose.add (c); + } + } + for (HttpConnection c : toClose) { + logger.log (Level.FINE, "closing: no request: " + c); + reqConnections.remove (c); + allConnections.remove (c); + c.close(); + } + } + } + toClose = new LinkedList(); + synchronized (rspConnections) { + if (MAX_RSP_TIME != -1) { + for (HttpConnection c : rspConnections) { + if (c.rspStartedTime + TIMER_MILLIS +MAX_RSP_TIME <= time) { + toClose.add (c); + } + } + for (HttpConnection c : toClose) { + logger.log (Level.FINE, "closing: no response: " + c); + rspConnections.remove (c); + allConnections.remove (c); + c.close(); + } + } + } + } + } + + void logStackTrace (String s) { + logger.finest (s); + StringBuilder b = new StringBuilder (); + StackTraceElement[] e = Thread.currentThread().getStackTrace(); + for (int i=0; i { /* return a still valid, unused HttpClient */ synchronized void put(HttpClient h) { - if (size() > KeepAliveCache.getMaxConnections()) { + if (size() >= KeepAliveCache.getMaxConnections()) { h.closeServer(); // otherwise the connection remains in limbo } else { push(new KeepAliveEntry(h, System.currentTimeMillis())); diff --git a/jdk/src/share/classes/sun/net/www/protocol/file/FileURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/file/FileURLConnection.java index 787282b823d..1997cb08c8a 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/file/FileURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/file/FileURLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/www/protocol/ftp/FtpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java index 49af37825a2..ee7684deb9d 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,6 +46,7 @@ import java.net.ProxySelector; import java.util.StringTokenizer; import java.util.Iterator; import java.security.Permission; +import sun.net.NetworkClient; import sun.net.www.MessageHeader; import sun.net.www.MeteredStream; import sun.net.www.URLConnection; @@ -102,11 +103,11 @@ public class FtpURLConnection extends URLConnection { static final int BIN = 2; static final int DIR = 3; int type = NONE; - /* Redefine timeouts from java.net.URLConnection as we nee -1 to mean + /* Redefine timeouts from java.net.URLConnection as we need -1 to mean * not set. This is to ensure backward compatibility. */ - private int connectTimeout = -1; - private int readTimeout = -1; + private int connectTimeout = NetworkClient.DEFAULT_CONNECT_TIMEOUT;; + private int readTimeout = NetworkClient.DEFAULT_READ_TIMEOUT;; /** * For FTP URLs we need to have a special InputStream because we diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java b/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java index 337b601d2f0..23e84ba4462 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/www/protocol/http/BasicAuthentication.java b/jdk/src/share/classes/sun/net/www/protocol/http/BasicAuthentication.java index 33c1eb3dd0a..706037223fd 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/BasicAuthentication.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/BasicAuthentication.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index 56ed6a40fa3..69f12a5c601 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -359,11 +359,11 @@ public class HttpURLConnection extends java.net.HttpURLConnection { private TunnelState tunnelState = TunnelState.NONE; - /* Redefine timeouts from java.net.URLConnection as we nee -1 to mean + /* Redefine timeouts from java.net.URLConnection as we need -1 to mean * not set. This is to ensure backward compatibility. */ - private int connectTimeout = -1; - private int readTimeout = -1; + private int connectTimeout = NetworkClient.DEFAULT_CONNECT_TIMEOUT; + private int readTimeout = NetworkClient.DEFAULT_READ_TIMEOUT; /* Logging support */ private static final PlatformLogger logger = @@ -1041,9 +1041,9 @@ public class HttpURLConnection extends java.net.HttpURLConnection { throw new ProtocolException("Server rejected operation"); } } - if (oldTimeout > 0) { - http.setReadTimeout(oldTimeout); - } + + http.setReadTimeout(oldTimeout); + responseCode = -1; responses.reset(); // Proceed diff --git a/jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java b/jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java index 14b6c63b79d..24618e89b61 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java +++ b/jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -109,6 +109,10 @@ final class HttpsClient extends HttpClient // HTTPS uses a different default port number than HTTP. private static final int httpsPortNumber = 443; + // default HostnameVerifier class canonical name + private static final String defaultHVCanonicalName = + "javax.net.ssl.HttpsURLConnection.DefaultHostnameVerifier"; + /** Returns the default HTTPS port (443) */ @Override protected int getDefaultPort() { return httpsPortNumber; } @@ -427,13 +431,93 @@ final class HttpsClient extends HttpClient } s.addHandshakeCompletedListener(this); - // if the HostnameVerifier is not set, try to enable endpoint - // identification during handshaking - boolean enabledIdentification = false; - if (hv instanceof DefaultHostnameVerifier && - (s instanceof SSLSocketImpl) && - ((SSLSocketImpl)s).trySetHostnameVerification("HTTPS")) { - enabledIdentification = true; + // We have two hostname verification approaches. One is in + // SSL/TLS socket layer, where the algorithm is configured with + // SSLParameters.setEndpointIdentificationAlgorithm(), and the + // hostname verification is done by X509ExtendedTrustManager when + // the algorithm is "HTTPS". The other one is in HTTPS layer, + // where the algorithm is customized by + // HttpsURLConnection.setHostnameVerifier(), and the hostname + // verification is done by HostnameVerifier when the default + // rules for hostname verification fail. + // + // The relationship between two hostname verification approaches + // likes the following: + // + // | EIA algorithm + // +---------------------------------------------- + // | null | HTTPS | LDAP/other | + // ------------------------------------------------------------- + // | |1 |2 |3 | + // HNV | default | Set HTTPS EIA | use EIA | HTTPS | + // |-------------------------------------------------------- + // | non - |4 |5 |6 | + // | default | HTTPS/HNV | use EIA | HTTPS/HNV | + // ------------------------------------------------------------- + // + // Abbreviation: + // EIA: the endpoint identification algorithm in SSL/TLS + // socket layer + // HNV: the hostname verification object in HTTPS layer + // Notes: + // case 1. default HNV and EIA is null + // Set EIA as HTTPS, hostname check done in SSL/TLS + // layer. + // case 2. default HNV and EIA is HTTPS + // Use existing EIA, hostname check done in SSL/TLS + // layer. + // case 3. default HNV and EIA is other than HTTPS + // Use existing EIA, EIA check done in SSL/TLS + // layer, then do HTTPS check in HTTPS layer. + // case 4. non-default HNV and EIA is null + // No EIA, no EIA check done in SSL/TLS layer, then do + // HTTPS check in HTTPS layer using HNV as override. + // case 5. non-default HNV and EIA is HTTPS + // Use existing EIA, hostname check done in SSL/TLS + // layer. No HNV override possible. We will review this + // decision and may update the architecture for JDK 7. + // case 6. non-default HNV and EIA is other than HTTPS + // Use existing EIA, EIA check done in SSL/TLS layer, + // then do HTTPS check in HTTPS layer as override. + boolean needToCheckSpoofing = true; + String identification = + s.getSSLParameters().getEndpointIdentificationAlgorithm(); + if (identification != null && identification.length() != 0) { + if (identification.equalsIgnoreCase("HTTPS")) { + // Do not check server identity again out of SSLSocket, + // the endpoint will be identified during TLS handshaking + // in SSLSocket. + needToCheckSpoofing = false; + } // else, we don't understand the identification algorithm, + // need to check URL spoofing here. + } else { + boolean isDefaultHostnameVerifier = false; + + // We prefer to let the SSLSocket do the spoof checks, but if + // the application has specified a HostnameVerifier (HNV), + // we will always use that. + if (hv != null) { + String canonicalName = hv.getClass().getCanonicalName(); + if (canonicalName != null && + canonicalName.equalsIgnoreCase(defaultHVCanonicalName)) { + isDefaultHostnameVerifier = true; + } + } else { + // Unlikely to happen! As the behavior is the same as the + // default hostname verifier, so we prefer to let the + // SSLSocket do the spoof checks. + isDefaultHostnameVerifier = true; + } + + if (isDefaultHostnameVerifier) { + // If the HNV is the default from HttpsURLConnection, we + // will do the spoof checks in SSLSocket. + SSLParameters paramaters = s.getSSLParameters(); + paramaters.setEndpointIdentificationAlgorithm("HTTPS"); + s.setSSLParameters(paramaters); + + needToCheckSpoofing = false; + } } s.startHandshake(); @@ -449,7 +533,7 @@ final class HttpsClient extends HttpClient } // check URL spoofing if it has not been checked under handshaking - if (!enabledIdentification) { + if (needToCheckSpoofing) { checkURLSpoofing(hv); } } else { @@ -463,8 +547,7 @@ final class HttpsClient extends HttpClient // Server identity checking is done according to RFC 2818: HTTP over TLS // Section 3.1 Server Identity private void checkURLSpoofing(HostnameVerifier hostnameVerifier) - throws IOException - { + throws IOException { // // Get authenticated server name, if any // diff --git a/jdk/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java index 2e06969253c..4f5f65903f1 100644 --- a/jdk/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -235,8 +235,6 @@ abstract class AsynchronousSocketChannelImpl if (remoteAddress == null) throw new NotYetConnectedException(); - if (timeout < 0L) - throw new IllegalArgumentException("Negative timeout"); boolean hasSpaceToRead = isScatteringRead || dst.hasRemaining(); boolean shutdown = false; @@ -342,8 +340,6 @@ abstract class AsynchronousSocketChannelImpl if (isOpen()) { if (remoteAddress == null) throw new NotYetConnectedException(); - if (timeout < 0L) - throw new IllegalArgumentException("Negative timeout"); // check and update state synchronized (writeLock) { if (writeKilled) diff --git a/jdk/src/share/classes/sun/nio/ch/CompletedFuture.java b/jdk/src/share/classes/sun/nio/ch/CompletedFuture.java index 85ffdd25cf8..60f5f1056bc 100644 --- a/jdk/src/share/classes/sun/nio/ch/CompletedFuture.java +++ b/jdk/src/share/classes/sun/nio/ch/CompletedFuture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/ch/DatagramChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java index 1d7d6758d8e..8d2e31bf74c 100644 --- a/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -711,10 +711,8 @@ class DatagramChannelImpl cachedSenderInetAddress = isa.getAddress(); cachedSenderPort = isa.getPort(); - // Socket was not bound before connecting, - if (localAddress == null) { - localAddress = Net.localAddress(fd); - } + // set or refresh local address + localAddress = Net.localAddress(fd); } } } @@ -735,6 +733,9 @@ class DatagramChannelImpl disconnect0(fd); remoteAddress = null; state = ST_UNCONNECTED; + + // refresh local address + localAddress = Net.localAddress(fd); } } } diff --git a/jdk/src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java b/jdk/src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java index a5948881456..37ff489a0cb 100644 --- a/jdk/src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java +++ b/jdk/src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/ch/FileChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java index 208c36789b1..e9344cdab64 100644 --- a/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,13 +39,12 @@ import sun.security.action.GetPropertyAction; public class FileChannelImpl extends FileChannel { - - // Used to make native read and write calls - private static final FileDispatcher nd; - // Memory allocation size for mapping buffers private static final long allocationGranularity; + // Used to make native read and write calls + private final FileDispatcher nd; + // File descriptor private final FileDescriptor fd; @@ -63,22 +62,29 @@ public class FileChannelImpl private final Object positionLock = new Object(); private FileChannelImpl(FileDescriptor fd, boolean readable, - boolean writable, Object parent) + boolean writable, boolean append, Object parent) { this.fd = fd; this.readable = readable; this.writable = writable; this.parent = parent; + this.nd = new FileDispatcherImpl(append); } - // Invoked by getChannel() methods - // of java.io.File{Input,Output}Stream and RandomAccessFile - // + // Used by FileInputStream.getChannel() and RandomAccessFile.getChannel() public static FileChannel open(FileDescriptor fd, boolean readable, boolean writable, Object parent) { - return new FileChannelImpl(fd, readable, writable, parent); + return new FileChannelImpl(fd, readable, writable, false, parent); + } + + // Used by FileOutputStream.getChannel + public static FileChannel open(FileDescriptor fd, + boolean readable, boolean writable, + boolean append, Object parent) + { + return new FileChannelImpl(fd, readable, writable, append, parent); } private void ensureOpen() throws IOException { @@ -460,6 +466,16 @@ public class FileChannelImpl } finally { unmap(dbb); } + } catch (ClosedByInterruptException e) { + // target closed by interrupt as ClosedByInterruptException needs + // to be thrown after closing this channel. + assert !target.isOpen(); + try { + close(); + } catch (IOException ignore) { + // nothing we can do + } + throw e; } catch (IOException ioe) { // Only throw exception if no bytes have been written if (remaining == count) @@ -694,20 +710,27 @@ public class FileChannelImpl private static class Unmapper implements Runnable { + // may be required to close file + private static final NativeDispatcher nd = new FileDispatcherImpl(); + // keep track of mapped buffer usage static volatile int count; static volatile long totalSize; static volatile long totalCapacity; - private long address; - private long size; - private int cap; + private volatile long address; + private final long size; + private final int cap; + private final FileDescriptor fd; - private Unmapper(long address, long size, int cap) { + private Unmapper(long address, long size, int cap, + FileDescriptor fd) + { assert (address != 0); this.address = address; this.size = size; this.cap = cap; + this.fd = fd; synchronized (Unmapper.class) { count++; @@ -722,6 +745,15 @@ public class FileChannelImpl unmap0(address, size); address = 0; + // if this mapping has a valid file descriptor then we close it + if (fd.valid()) { + try { + nd.close(fd); + } catch (IOException ignore) { + // nothing we can do + } + } + synchronized (Unmapper.class) { count--; totalSize -= size; @@ -784,10 +816,12 @@ public class FileChannelImpl } if (size == 0) { addr = 0; + // a valid file descriptor is not required + FileDescriptor dummy = new FileDescriptor(); if ((!writable) || (imode == MAP_RO)) - return Util.newMappedByteBufferR(0, 0, null); + return Util.newMappedByteBufferR(0, 0, dummy, null); else - return Util.newMappedByteBuffer(0, 0, null); + return Util.newMappedByteBuffer(0, 0, dummy, null); } int pagePosition = (int)(position % allocationGranularity); @@ -813,14 +847,31 @@ public class FileChannelImpl } } + // On Windows, and potentially other platforms, we need an open + // file descriptor for some mapping operations. + FileDescriptor mfd; + try { + mfd = nd.duplicateForMapping(fd); + } catch (IOException ioe) { + unmap0(addr, mapSize); + throw ioe; + } + assert (IOStatus.checkAll(addr)); assert (addr % allocationGranularity == 0); int isize = (int)size; - Unmapper um = new Unmapper(addr, size + pagePosition, isize); - if ((!writable) || (imode == MAP_RO)) - return Util.newMappedByteBufferR(isize, addr + pagePosition, um); - else - return Util.newMappedByteBuffer(isize, addr + pagePosition, um); + Unmapper um = new Unmapper(addr, mapSize, isize, mfd); + if ((!writable) || (imode == MAP_RO)) { + return Util.newMappedByteBufferR(isize, + addr + pagePosition, + mfd, + um); + } else { + return Util.newMappedByteBuffer(isize, + addr + pagePosition, + mfd, + um); + } } finally { threads.remove(ti); end(IOStatus.checkAll(addr)); @@ -1077,7 +1128,6 @@ public class FileChannelImpl static { Util.load(); allocationGranularity = initIDs(); - nd = new FileDispatcherImpl(); } } diff --git a/jdk/src/share/classes/sun/nio/ch/FileDispatcher.java b/jdk/src/share/classes/sun/nio/ch/FileDispatcher.java index 4e90c9944f5..6e5df225080 100644 --- a/jdk/src/share/classes/sun/nio/ch/FileDispatcher.java +++ b/jdk/src/share/classes/sun/nio/ch/FileDispatcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,4 +45,12 @@ abstract class FileDispatcher extends NativeDispatcher { abstract void release(FileDescriptor fd, long pos, long size) throws IOException; + + /** + * Returns a dup of fd if a file descriptor is required for + * memory-mapping operations, otherwise returns an invalid + * FileDescriptor (meaning a newly allocated FileDescriptor) + */ + abstract FileDescriptor duplicateForMapping(FileDescriptor fd) + throws IOException; } diff --git a/jdk/src/share/classes/sun/nio/ch/IOUtil.java b/jdk/src/share/classes/sun/nio/ch/IOUtil.java index 97c8dca92b0..7ea8eca6c73 100644 --- a/jdk/src/share/classes/sun/nio/ch/IOUtil.java +++ b/jdk/src/share/classes/sun/nio/ch/IOUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/ch/IOVecWrapper.java b/jdk/src/share/classes/sun/nio/ch/IOVecWrapper.java index 0cfc6296b13..0b09fe752bf 100644 --- a/jdk/src/share/classes/sun/nio/ch/IOVecWrapper.java +++ b/jdk/src/share/classes/sun/nio/ch/IOVecWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/ch/Interruptible.java b/jdk/src/share/classes/sun/nio/ch/Interruptible.java index e8d3824473e..8445e35f050 100644 --- a/jdk/src/share/classes/sun/nio/ch/Interruptible.java +++ b/jdk/src/share/classes/sun/nio/ch/Interruptible.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 +23,14 @@ * questions. */ -/* +/** + * An object that interrupts a thread blocked in an I/O operation. */ package sun.nio.ch; - public interface Interruptible { - public void interrupt(); + public void interrupt(Thread t); } diff --git a/jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java b/jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java index eff83e2bff7..4fb8330e7b9 100644 --- a/jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java +++ b/jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/ch/ServerSocketChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java index 3685d3a7c68..a9000bcd34f 100644 --- a/jdk/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/ch/SimpleAsynchronousDatagramChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/SimpleAsynchronousDatagramChannelImpl.java deleted file mode 100644 index e1eccdecc9e..00000000000 --- a/jdk/src/share/classes/sun/nio/ch/SimpleAsynchronousDatagramChannelImpl.java +++ /dev/null @@ -1,667 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.nio.ch; - -import java.nio.ByteBuffer; -import java.nio.channels.*; -import java.net.*; -import java.io.IOException; -import java.util.*; -import java.util.concurrent.*; -import java.security.AccessController; -import java.security.AccessControlContext; -import java.security.PrivilegedExceptionAction; -import java.security.PrivilegedActionException; - -/** - * A prototype implementation of AsynchronousDatagramChannel, used to aid - * test and spec development. - */ - -class SimpleAsynchronousDatagramChannelImpl - extends AsynchronousDatagramChannel implements Groupable, Cancellable -{ - private final DatagramChannel dc; - private final AsynchronousChannelGroupImpl group; - private final Object attachKey; - private boolean closed; - - // used to coordinate timed and blocking reads - private final Object readLock = new Object(); - - // channel blocking mode (requires readLock) - private boolean isBlocking = true; - - // number of blocking readers (requires readLock) - private int blockingReaderCount; - - // true if timed read attempted while blocking read in progress (requires readLock) - private boolean transitionToNonBlocking; - - // true if a blocking read is cancelled (requires readLock) - private boolean blockingReadKilledByCancel; - - // temporary Selectors used by timed reads (requires readLock) - private Selector firstReader; - private Set otherReaders; - - SimpleAsynchronousDatagramChannelImpl(ProtocolFamily family, - AsynchronousChannelGroupImpl group) - throws IOException - { - super(group.provider()); - this.dc = (family == null) ? - DatagramChannel.open() : DatagramChannel.open(family); - this.group = group; - - // attach this channel to the group as foreign channel - boolean registered = false; - try { - if (!(dc instanceof DatagramChannelImpl)) - throw new UnsupportedOperationException(); - attachKey = group - .attachForeignChannel(this, ((DatagramChannelImpl)dc).getFD()); - registered = true; - } finally { - if (!registered) - dc.close(); - } - } - - // throws RuntimeException if blocking read has been cancelled - private void ensureBlockingReadNotKilled() { - assert Thread.holdsLock(readLock); - if (blockingReadKilledByCancel) - throw new RuntimeException("Reading not allowed due to cancellation"); - } - - // invoke prior to non-timed read/receive - private void beginNoTimeoutRead() { - synchronized (readLock) { - ensureBlockingReadNotKilled(); - if (isBlocking) - blockingReaderCount++; - } - } - - // invoke after non-timed read/receive has completed - private void endNoTimeoutRead() { - synchronized (readLock) { - if (isBlocking) { - if (--blockingReaderCount == 0 && transitionToNonBlocking) { - // notify any threads waiting to make channel non-blocking - readLock.notifyAll(); - } - } - } - } - - // invoke prior to timed read - // returns the timeout remaining - private long prepareForTimedRead(PendingFuture result, long timeout) - throws IOException - { - synchronized (readLock) { - ensureBlockingReadNotKilled(); - if (isBlocking) { - transitionToNonBlocking = true; - while (blockingReaderCount > 0 && - timeout > 0L && - !result.isCancelled()) - { - long st = System.currentTimeMillis(); - try { - readLock.wait(timeout); - } catch (InterruptedException e) { } - timeout -= System.currentTimeMillis() - st; - } - if (blockingReaderCount == 0) { - // re-check that blocked read wasn't cancelled - ensureBlockingReadNotKilled(); - // no blocking reads so change channel to non-blocking - dc.configureBlocking(false); - isBlocking = false; - } - } - return timeout; - } - } - - // returns a temporary Selector - private Selector getSelector() throws IOException { - Selector sel = Util.getTemporarySelector(dc); - synchronized (readLock) { - if (firstReader == null) { - firstReader = sel; - } else { - if (otherReaders == null) - otherReaders = new HashSet(); - otherReaders.add(sel); - } - } - return sel; - } - - // releases a temporary Selector - private void releaseSelector(Selector sel) throws IOException { - synchronized (readLock) { - if (firstReader == sel) { - firstReader = null; - } else { - otherReaders.remove(sel); - } - } - Util.releaseTemporarySelector(sel); - } - - // wakeup all Selectors currently in use - private void wakeupSelectors() { - synchronized (readLock) { - if (firstReader != null) - firstReader.wakeup(); - if (otherReaders != null) { - for (Selector sel: otherReaders) { - sel.wakeup(); - } - } - } - } - - @Override - public AsynchronousChannelGroupImpl group() { - return group; - } - - @Override - public boolean isOpen() { - return dc.isOpen(); - } - - @Override - public void onCancel(PendingFuture task) { - synchronized (readLock) { - if (blockingReaderCount > 0) { - blockingReadKilledByCancel = true; - readLock.notifyAll(); - return; - } - } - wakeupSelectors(); - } - - @Override - public void close() throws IOException { - synchronized (dc) { - if (closed) - return; - closed = true; - } - // detach from group and close underlying channel - group.detachForeignChannel(attachKey); - dc.close(); - - // wakeup any threads blocked in timed read/receives - wakeupSelectors(); - } - - @Override - public AsynchronousDatagramChannel connect(SocketAddress remote) - throws IOException - { - dc.connect(remote); - return this; - } - - @Override - public AsynchronousDatagramChannel disconnect() throws IOException { - dc.disconnect(); - return this; - } - - private static class WrappedMembershipKey extends MembershipKey { - private final MulticastChannel channel; - private final MembershipKey key; - - WrappedMembershipKey(MulticastChannel channel, MembershipKey key) { - this.channel = channel; - this.key = key; - } - - @Override - public boolean isValid() { - return key.isValid(); - } - - @Override - public void drop() { - key.drop(); - } - - @Override - public MulticastChannel channel() { - return channel; - } - - @Override - public InetAddress group() { - return key.group(); - } - - @Override - public NetworkInterface networkInterface() { - return key.networkInterface(); - } - - @Override - public InetAddress sourceAddress() { - return key.sourceAddress(); - } - - @Override - public MembershipKey block(InetAddress toBlock) throws IOException { - key.block(toBlock); - return this; - } - - @Override - public MembershipKey unblock(InetAddress toUnblock) { - key.unblock(toUnblock); - return this; - } - - @Override - public String toString() { - return key.toString(); - } - } - - @Override - public MembershipKey join(InetAddress group, - NetworkInterface interf) - throws IOException - { - MembershipKey key = ((MulticastChannel)dc).join(group, interf); - return new WrappedMembershipKey(this, key); - } - - @Override - public MembershipKey join(InetAddress group, - NetworkInterface interf, - InetAddress source) - throws IOException - { - MembershipKey key = ((MulticastChannel)dc).join(group, interf, source); - return new WrappedMembershipKey(this, key); - } - - private Future implSend(ByteBuffer src, - SocketAddress target, - A attachment, - CompletionHandler handler) - { - int n = 0; - Throwable exc = null; - try { - n = dc.send(src, target); - } catch (IOException ioe) { - exc = ioe; - } - if (handler == null) - return CompletedFuture.withResult(n, exc); - Invoker.invoke(this, handler, attachment, n, exc); - return null; - } - - @Override - public Future send(ByteBuffer src, SocketAddress target) { - return implSend(src, target, null, null); - } - - @Override - public void send(ByteBuffer src, - SocketAddress target, - A attachment, - CompletionHandler handler) - { - if (handler == null) - throw new NullPointerException("'handler' is null"); - implSend(src, target, attachment, handler); - } - - private Future implWrite(ByteBuffer src, - A attachment, - CompletionHandler handler) - { - int n = 0; - Throwable exc = null; - try { - n = dc.write(src); - } catch (IOException ioe) { - exc = ioe; - } - if (handler == null) - return CompletedFuture.withResult(n, exc); - Invoker.invoke(this, handler, attachment, n, exc); - return null; - - } - - @Override - public Future write(ByteBuffer src) { - return implWrite(src, null, null); - } - - @Override - public void write(ByteBuffer src, - A attachment, - CompletionHandler handler) - { - if (handler == null) - throw new NullPointerException("'handler' is null"); - implWrite(src, attachment, handler); - } - - /** - * Receive into the given buffer with privileges enabled and restricted by - * the given AccessControlContext (can be null). - */ - private SocketAddress doRestrictedReceive(final ByteBuffer dst, - AccessControlContext acc) - throws IOException - { - if (acc == null) { - return dc.receive(dst); - } else { - try { - return AccessController.doPrivileged( - new PrivilegedExceptionAction() { - public SocketAddress run() throws IOException { - return dc.receive(dst); - }}, acc); - } catch (PrivilegedActionException pae) { - Exception cause = pae.getException(); - if (cause instanceof SecurityException) - throw (SecurityException)cause; - throw (IOException)cause; - } - } - } - - private Future implReceive(final ByteBuffer dst, - final long timeout, - final TimeUnit unit, - A attachment, - final CompletionHandler handler) - { - if (dst.isReadOnly()) - throw new IllegalArgumentException("Read-only buffer"); - if (timeout < 0L) - throw new IllegalArgumentException("Negative timeout"); - if (unit == null) - throw new NullPointerException(); - - // complete immediately if channel closed - if (!isOpen()) { - Throwable exc = new ClosedChannelException(); - if (handler == null) - return CompletedFuture.withFailure(exc); - Invoker.invoke(this, handler, attachment, null, exc); - return null; - } - - final AccessControlContext acc = (System.getSecurityManager() == null) ? - null : AccessController.getContext(); - final PendingFuture result = - new PendingFuture(this, handler, attachment); - Runnable task = new Runnable() { - public void run() { - try { - SocketAddress remote = null; - long to; - if (timeout == 0L) { - beginNoTimeoutRead(); - try { - remote = doRestrictedReceive(dst, acc); - } finally { - endNoTimeoutRead(); - } - to = 0L; - } else { - to = prepareForTimedRead(result, unit.toMillis(timeout)); - if (to <= 0L) - throw new InterruptedByTimeoutException(); - remote = doRestrictedReceive(dst, acc); - } - if (remote == null) { - Selector sel = getSelector(); - SelectionKey sk = null; - try { - sk = dc.register(sel, SelectionKey.OP_READ); - for (;;) { - if (!dc.isOpen()) - throw new AsynchronousCloseException(); - if (result.isCancelled()) - break; - long st = System.currentTimeMillis(); - int ns = sel.select(to); - if (ns > 0) { - remote = doRestrictedReceive(dst, acc); - if (remote != null) - break; - } - sel.selectedKeys().remove(sk); - if (timeout != 0L) { - to -= System.currentTimeMillis() - st; - if (to <= 0) - throw new InterruptedByTimeoutException(); - } - } - } finally { - if (sk != null) - sk.cancel(); - releaseSelector(sel); - } - } - result.setResult(remote); - } catch (Throwable x) { - if (x instanceof ClosedChannelException) - x = new AsynchronousCloseException(); - result.setFailure(x); - } - Invoker.invokeUnchecked(result); - } - }; - try { - group.executeOnPooledThread(task); - } catch (RejectedExecutionException ree) { - throw new ShutdownChannelGroupException(); - } - return result; - } - - @Override - public Future receive(ByteBuffer dst) { - return implReceive(dst, 0L, TimeUnit.MILLISECONDS, null, null); - } - - @Override - public void receive(ByteBuffer dst, - long timeout, - TimeUnit unit, - A attachment, - CompletionHandler handler) - { - if (handler == null) - throw new NullPointerException("'handler' is null"); - implReceive(dst, timeout, unit, attachment, handler); - } - - private Future implRead(final ByteBuffer dst, - final long timeout, - final TimeUnit unit, - A attachment, - final CompletionHandler handler) - { - if (dst.isReadOnly()) - throw new IllegalArgumentException("Read-only buffer"); - if (timeout < 0L) - throw new IllegalArgumentException("Negative timeout"); - if (unit == null) - throw new NullPointerException(); - - // complete immediately if channel closed - if (!isOpen()) { - Throwable exc = new ClosedChannelException(); - if (handler == null) - return CompletedFuture.withFailure(exc); - Invoker.invoke(this, handler, attachment, null, exc); - return null; - } - - // another thread may disconnect before read is initiated - if (!dc.isConnected()) - throw new NotYetConnectedException(); - - final PendingFuture result = - new PendingFuture(this, handler, attachment); - Runnable task = new Runnable() { - public void run() { - try { - int n = 0; - long to; - if (timeout == 0L) { - beginNoTimeoutRead(); - try { - n = dc.read(dst); - } finally { - endNoTimeoutRead(); - } - to = 0L; - } else { - to = prepareForTimedRead(result, unit.toMillis(timeout)); - if (to <= 0L) - throw new InterruptedByTimeoutException(); - n = dc.read(dst); - } - if (n == 0) { - Selector sel = getSelector(); - SelectionKey sk = null; - try { - sk = dc.register(sel, SelectionKey.OP_READ); - for (;;) { - if (!dc.isOpen()) - throw new AsynchronousCloseException(); - if (result.isCancelled()) - break; - long st = System.currentTimeMillis(); - int ns = sel.select(to); - if (ns > 0) { - if ((n = dc.read(dst)) != 0) - break; - } - sel.selectedKeys().remove(sk); - if (timeout != 0L) { - to -= System.currentTimeMillis() - st; - if (to <= 0) - throw new InterruptedByTimeoutException(); - } - } - } finally { - if (sk != null) - sk.cancel(); - releaseSelector(sel); - } - } - result.setResult(n); - } catch (Throwable x) { - if (x instanceof ClosedChannelException) - x = new AsynchronousCloseException(); - result.setFailure(x); - } - Invoker.invokeUnchecked(result); - } - }; - try { - group.executeOnPooledThread(task); - } catch (RejectedExecutionException ree) { - throw new ShutdownChannelGroupException(); - } - return result; - } - - @Override - public Future read(ByteBuffer dst) { - return implRead(dst, 0L, TimeUnit.MILLISECONDS, null, null); - } - - @Override - public void read(ByteBuffer dst, - long timeout, - TimeUnit unit, - A attachment, - CompletionHandler handler) - { - if (handler == null) - throw new NullPointerException("'handler' is null"); - implRead(dst, timeout, unit, attachment, handler); - } - - @Override - public AsynchronousDatagramChannel bind(SocketAddress local) - throws IOException - { - dc.bind(local); - return this; - } - - @Override - public SocketAddress getLocalAddress() throws IOException { - return dc.getLocalAddress(); - } - - @Override - public AsynchronousDatagramChannel setOption(SocketOption name, T value) - throws IOException - { - dc.setOption(name, value); - return this; - } - - @Override - public T getOption(SocketOption name) throws IOException { - return dc.getOption(name); - } - - @Override - public Set> supportedOptions() { - return dc.supportedOptions(); - } - - @Override - public SocketAddress getRemoteAddress() throws IOException { - return dc.getRemoteAddress(); - } -} diff --git a/jdk/src/share/classes/sun/nio/ch/SocketAdaptor.java b/jdk/src/share/classes/sun/nio/ch/SocketAdaptor.java index 7ff9a3075f9..c2f7217b7df 100644 --- a/jdk/src/share/classes/sun/nio/ch/SocketAdaptor.java +++ b/jdk/src/share/classes/sun/nio/ch/SocketAdaptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/ch/SocketChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java index c8b93b7c6f7..8540229c36b 100644 --- a/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java +++ b/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/ch/Util.java b/jdk/src/share/classes/sun/nio/ch/Util.java index 50d280865cd..0746989f6f7 100644 --- a/jdk/src/share/classes/sun/nio/ch/Util.java +++ b/jdk/src/share/classes/sun/nio/ch/Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ package sun.nio.ch; import java.lang.ref.SoftReference; import java.lang.reflect.*; import java.io.IOException; +import java.io.FileDescriptor; import java.nio.ByteBuffer; import java.nio.MappedByteBuffer; import java.nio.channels.*; @@ -364,6 +365,7 @@ class Util { Constructor ctor = cl.getDeclaredConstructor( new Class[] { int.class, long.class, + FileDescriptor.class, Runnable.class }); ctor.setAccessible(true); directByteBufferConstructor = ctor; @@ -381,6 +383,7 @@ class Util { } static MappedByteBuffer newMappedByteBuffer(int size, long addr, + FileDescriptor fd, Runnable unmapper) { MappedByteBuffer dbb; @@ -390,6 +393,7 @@ class Util { dbb = (MappedByteBuffer)directByteBufferConstructor.newInstance( new Object[] { new Integer(size), new Long(addr), + fd, unmapper }); } catch (InstantiationException e) { throw new InternalError(); @@ -411,6 +415,7 @@ class Util { Constructor ctor = cl.getDeclaredConstructor( new Class[] { int.class, long.class, + FileDescriptor.class, Runnable.class }); ctor.setAccessible(true); directByteBufferRConstructor = ctor; @@ -428,6 +433,7 @@ class Util { } static MappedByteBuffer newMappedByteBufferR(int size, long addr, + FileDescriptor fd, Runnable unmapper) { MappedByteBuffer dbb; @@ -437,6 +443,7 @@ class Util { dbb = (MappedByteBuffer)directByteBufferRConstructor.newInstance( new Object[] { new Integer(size), new Long(addr), + fd, unmapper }); } catch (InstantiationException e) { throw new InternalError(); diff --git a/jdk/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java b/jdk/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java index 020a44ac1d1..f1714ea39c9 100644 --- a/jdk/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java +++ b/jdk/src/share/classes/sun/nio/cs/AbstractCharsetProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/UTF_32Coder.java b/jdk/src/share/classes/sun/nio/cs/UTF_32Coder.java index 53645a75b60..c6f38ec9bfc 100644 --- a/jdk/src/share/classes/sun/nio/cs/UTF_32Coder.java +++ b/jdk/src/share/classes/sun/nio/cs/UTF_32Coder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -144,7 +144,7 @@ class UTF_32Coder { protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) { int mark = src.position(); - if (!doneBOM) { + if (!doneBOM && src.hasRemaining()) { if (dst.remaining() < 4) return CoderResult.OVERFLOW; put(BOM_BIG, dst); diff --git a/jdk/src/share/classes/sun/nio/cs/UTF_8.java b/jdk/src/share/classes/sun/nio/cs/UTF_8.java index 2b62e92f6c1..67b7dc84125 100644 --- a/jdk/src/share/classes/sun/nio/cs/UTF_8.java +++ b/jdk/src/share/classes/sun/nio/cs/UTF_8.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -358,7 +358,7 @@ class UTF_8 extends Unicode private static class Encoder extends CharsetEncoder { private Encoder(Charset cs) { - super(cs, 1.1f, 4.0f); + super(cs, 1.1f, 3.0f); } public boolean canEncode(char c) { diff --git a/jdk/src/share/classes/sun/nio/cs/UnicodeEncoder.java b/jdk/src/share/classes/sun/nio/cs/UnicodeEncoder.java index cea0270c104..7b34fb2d512 100644 --- a/jdk/src/share/classes/sun/nio/cs/UnicodeEncoder.java +++ b/jdk/src/share/classes/sun/nio/cs/UnicodeEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,13 +70,12 @@ public abstract class UnicodeEncoder extends CharsetEncoder { protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) { int mark = src.position(); - if (needsMark) { + if (needsMark && src.hasRemaining()) { if (dst.remaining() < 2) return CoderResult.OVERFLOW; put(BYTE_ORDER_MARK, dst); needsMark = false; } - try { while (src.hasRemaining()) { char c = src.get(); diff --git a/jdk/src/share/classes/sun/nio/cs/ext/Big5_HKSCS_2001.java b/jdk/src/share/classes/sun/nio/cs/ext/Big5_HKSCS_2001.java index 8083f27a7cf..1514e2e5cb0 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/Big5_HKSCS_2001.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/Big5_HKSCS_2001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/Big5_Solaris.java b/jdk/src/share/classes/sun/nio/cs/ext/Big5_Solaris.java index 096dca9e3bb..bf98320287b 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/Big5_Solaris.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/Big5_Solaris.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/DoubleByte.java b/jdk/src/share/classes/sun/nio/cs/ext/DoubleByte.java index 265e03c71f4..ce66105a4e2 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/DoubleByte.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/DoubleByte.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/EUC_JP.java b/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP.java index 6443de39931..53c868c64cc 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/EUC_JP_LINUX.java b/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java index 480a4a74067..dccb0f8bf9c 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/EUC_JP_Open.java b/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP_Open.java index b36b76d3c75..d6ad2fa0e83 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP_Open.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP_Open.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/EUC_TW.java b/jdk/src/share/classes/sun/nio/cs/ext/EUC_TW.java index 28a2a97d929..d922eff81c9 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/EUC_TW.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/EUC_TW.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/ExtendedCharsets.java b/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java index ca6a49637c0..4011291d009 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -778,6 +778,13 @@ public class ExtendedCharsets "csIBM500" }); + charset("x-IBM833", "IBM833", + new String[] { + "cp833", + "ibm833", + "ibm-833" + }); + //EBCDIC DBCS-only Korean charset("x-IBM834", "IBM834", new String[] { diff --git a/jdk/src/share/classes/sun/nio/cs/ext/GB18030.java b/jdk/src/share/classes/sun/nio/cs/ext/GB18030.java index 59e3c4db851..daffbe4ffaa 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/GB18030.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/GB18030.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/IBM33722.java b/jdk/src/share/classes/sun/nio/cs/ext/IBM33722.java index dc1508278d2..b9063e5f744 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/IBM33722.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/IBM33722.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/IBM964.java b/jdk/src/share/classes/sun/nio/cs/ext/IBM964.java index b87e838714b..4635f867450 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/IBM964.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/IBM964.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/ISO2022.java b/jdk/src/share/classes/sun/nio/cs/ext/ISO2022.java index ad4e5978b12..983d57d2786 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/ISO2022.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/ISO2022.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/JISAutoDetect.java b/jdk/src/share/classes/sun/nio/cs/ext/JISAutoDetect.java index e190bd587e3..27a9cf8a07c 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/JISAutoDetect.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/JISAutoDetect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/MS950_HKSCS_XP.java b/jdk/src/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java index e4ec21d00c7..2fddb927914 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/PCK.java b/jdk/src/share/classes/sun/nio/cs/ext/PCK.java index 2c2387e0001..f048d254146 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/PCK.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/PCK.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ext/SJIS.java b/jdk/src/share/classes/sun/nio/cs/ext/SJIS.java index 1f8a8ea0ce2..308c25adc97 100644 --- a/jdk/src/share/classes/sun/nio/cs/ext/SJIS.java +++ b/jdk/src/share/classes/sun/nio/cs/ext/SJIS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/fs/AbstractPath.java b/jdk/src/share/classes/sun/nio/fs/AbstractPath.java index 0329d47db1e..17262b68c04 100644 --- a/jdk/src/share/classes/sun/nio/fs/AbstractPath.java +++ b/jdk/src/share/classes/sun/nio/fs/AbstractPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/fs/AbstractWatchKey.java b/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java index 4eafab20553..c3970d86c05 100644 --- a/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java +++ b/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/print/resources/serviceui_pt_BR.properties b/jdk/src/share/classes/sun/print/resources/serviceui_pt_BR.properties new file mode 100644 index 00000000000..216c4b168e4 --- /dev/null +++ b/jdk/src/share/classes/sun/print/resources/serviceui_pt_BR.properties @@ -0,0 +1,214 @@ +# +# +border.chromaticity=Apar\u00eancia da cor +border.copies=C\u00f3pias +border.jobattributes=Atributos do trabalho +border.media=M\u00eddia +border.orientation=Orienta\u00e7\u00e3o +border.printrange=Intervalo de impress\u00e3o +border.printservice=Servi\u00e7o de impress\u00e3o +border.quality=Qualidade +border.sides=Lados +border.margins=Margens +# +button.cancel=Cancelar +button.ok=OK +button.print=Imprimir +button.properties=Propriedades... +button.properties.mnemonic=R +# +checkbox.collate=Agrupar +checkbox.collate.mnemonic=C +checkbox.jobsheets=P\u00e1gina com cabe\u00e7alho +checkbox.jobsheets.mnemonic=B +checkbox.printtofile=Imprimir em arquivo +checkbox.printtofile.mnemonic=F +# +dialog.printtitle=Imprimir +dialog.pstitle=Configurar p\u00e1gina +dialog.overwrite=Este arquivo j\u00e1 existe. Deseja substituir o arquivo existente? +dialog.owtitle=Imprimir em arquivo +dialog.printtofile=Imprimir em arquivo +dialog.noprintermsg=Nenhum servi\u00e7o de impress\u00e3o encontrado. +dialog.writeerror=N\u00e3o \u00e9 poss\u00edvel gravar no arquivo: +# +label.info=Info: +label.jobname=Nome do trabalho: +label.jobname.mnemonic=J +label.numcopies=N\u00famero de c\u00f3pias: +label.numcopies.mnemonic=O +label.priority=Prioridade: +label.priority.mnemonic=R +label.psname=Nome: +label.psname.mnemonic=N +label.pstype=Tipo: +label.rangeto=Para +label.size=Tamanho: +label.size.mnemonic=Z +label.source=Fonte: +label.source.mnemonic=C +label.status=Status: +label.username=Nome de usu\u00e1rio: +label.username.mnemonic=U +label.millimetres=(mm) +label.inches=(pol) +label.topmargin=superior +label.topmargin.mnemonic=T +label.bottommargin=inferior +label.bottommargin.mnemonic=B +label.leftmargin=esquerda +label.leftmargin.mnemonic=F +label.rightmargin=direita +label.rightmargin.mnemonic=R +# +radiobutton.color=Cor +radiobutton.color.mnemonic=C +radiobutton.draftq=Rascunho +radiobutton.draftq.mnemonic=F +radiobutton.duplex=Duplex +radiobutton.duplex.mnemonic=D +radiobutton.highq=Alto +radiobutton.highq.mnemonic=H +radiobutton.landscape=Paisagem +radiobutton.landscape.mnemonic=L +radiobutton.monochrome=Monocrom\u00e1tico +radiobutton.monochrome.mnemonic=M +radiobutton.normalq=Normal +radiobutton.normalq.mnemonic=N +radiobutton.oneside=Um lado +radiobutton.oneside.mnemonic=O +radiobutton.portrait=Retrato +radiobutton.portrait.mnemonic=P +radiobutton.rangeall=Todas +radiobutton.rangeall.mnemonic=L +radiobutton.rangepages=P\u00e1ginas +radiobutton.rangepages.mnemonic=E +radiobutton.revlandscape=Paisagem invertida +radiobutton.revlandscape.mnemonic=N +radiobutton.revportrait=Retrato invertido +radiobutton.revportrait.mnemonic=I +radiobutton.tumble=Duplex horizontal +radiobutton.tumble.mnemonic=T +# The vkMnemonics correspond with the constants defined in KeyEvent, eg +# 65 = KeyEvent.VK_A +tab.appearance=Apar\u00eancia +tab.appearance.vkMnemonic=65 +tab.general=Geral +tab.general.vkMnemonic=71 +tab.pagesetup=Configurar p\u00e1gina +tab.pagesetup.vkMnemonic=83 +# +error.pagerange=Intervalo de p\u00e1ginas inv\u00e1lido; insira novamente os valores (por exemplo, 1-3,5,7-10) +error.destination=Nome de arquivo inv\u00e1lido; tente novamente +# +# The following keys match the Strings returned by MediaSizeName.toString() +# (in some cases the space character is replaced by '-' and the pound +# character is replaced with 'n') +# +iso-4a0=4A0 (ISO/DIN & JIS) +iso-2a0=2A0 (ISO/DIN & JIS) +iso-a0=A0 (ISO/DIN & JIS) +iso-a1=A1 (ISO/DIN & JIS) +iso-a2=A2 (ISO/DIN & JIS) +iso-a3=A3 (ISO/DIN & JIS) +iso-a4=A4 (ISO/DIN & JIS) +iso-a5=A5 (ISO/DIN & JIS) +iso-a6=A6 (ISO/DIN & JIS) +iso-a7=A7 (ISO/DIN & JIS) +iso-a8=A8 (ISO/DIN & JIS) +iso-a9=A9 (ISO/DIN & JIS) +iso-a10=A10 (ISO/DIN & JIS) +iso-b0=B0 (ISO/DIN) +iso-b1=B1 (ISO/DIN) +iso-b2=B2 (ISO/DIN) +iso-b3=B3 (ISO/DIN) +iso-b4=B4 (ISO/DIN) +iso-b5=B5 (ISO/DIN) +iso-b6=B6 (ISO/DIN) +iso-b7=B7 (ISO/DIN) +iso-b8=B8 (ISO/DIN) +iso-b9=B9 (ISO/DIN) +iso-b10=B10 (ISO/DIN) +jis-b0=B0 (JIS) +jis-b1=B1 (JIS) +jis-b2=B2 (JIS) +jis-b3=B3 (JIS) +jis-b4=B4 (JIS) +jis-b5=B5 (JIS) +jis-b6=B6 (JIS) +jis-b7=B7 (JIS) +jis-b8=B8 (JIS) +jis-b9=B9 (JIS) +jis-b10=B10 (JIS) +iso-c0=C0 (ISO/DIN) +iso-c1=C1 (ISO/DIN) +iso-c2=C2 (ISO/DIN) +iso-c3=C3 (ISO/DIN) +iso-c4=C4 (ISO/DIN) +iso-c5=C5 (ISO/DIN) +iso-c6=C6 (ISO/DIN) +iso-c7=C7 (ISO/DIN) +iso-c8=C8 (ISO/DIN) +iso-c9=C9 (ISO/DIN) +iso-c10=C10 (ISO/DIN) +na-letter=Carta +na-legal=Of\u00edcio +executive=Executivo +ledger=Livro-raz\u00e3o +tabloid=Tabl\u00f3ide +invoice=Fatura +folio=F\u00f3lio +quarto=Quarto +japanese-postcard=Cart\u00e3o-postal (JIS) +oufuko-postcard=Cart\u00e3o-postal (JIS) +a=Engenharia A +b=Engenharia B +c=Engenharia C +d=Engenharia D +e=Engenharia E +iso-designated-long=Longo designado ISO +italian-envelope=Envelope italiano +italy-envelope=Envelope italiano +invite-envelope=Envelope de convite +monarch-envelope=Envelope monarca +personal-envelope=Envelope personalizado +na-number-9-envelope=Envelope n\u00ba 9 +na-number-10-envelope=Envelope n\u00ba 10 +na-number-11-envelope=Envelope n\u00ba 11 +na-number-12-envelope=Envelope n\u00ba 12 +na-number-14-envelope=Envelope n\u00ba 14 +na-6x9-envelope=Envelope 6x9 +na-7x9-envelope=Envelope 6x7 +na-9x11-envelope=Envelope 9x11 +na-9x12-envelope=Envelope 9x12 +na-10x13-envelope=Envelope 10x15 +na-10x14-envelope=Envelope 10x15 +na-10x15-envelope=Envelope 10x15 +na-5x7=Papel 5" x 7" +na-8x10=Papel 8" x 10" +# +# The following keys match the Strings returned by MediaTray.toString() +# +auto-select=Selecionar automaticamente +top=Superior +middle=Meio +bottom=Inferior +envelope=Envelope +manual=Manual +large-capacity=Grande capacidade +main=Principal +side=Lado +# Add the additional standard bins defined by win32 +Manual-Envelope=Envelope manual +Automatic-Feeder=Alimentador autom\u00e1tico +Tractor-Feeder=Alimentador por tracionador +Small-Format=Formato pequeno +Large-Format=Formato grande +Cassette=Cassete +Form-Source=Fonte do formul\u00e1rio +# +# The following keys match the Strings returned by +# PrinterIsAcceptingJobs.toString() +# +accepting-jobs=Aceitando trabalhos +not-accepting-jobs=N\u00e3o aceitando trabalhos diff --git a/jdk/make/java/hpi/Makefile b/jdk/src/share/classes/sun/rmi/registry/resources/rmiregistry_pt_BR.properties similarity index 78% rename from jdk/make/java/hpi/Makefile rename to jdk/src/share/classes/sun/rmi/registry/resources/rmiregistry_pt_BR.properties index c5d79de8a6d..d35f01a45ee 100644 --- a/jdk/make/java/hpi/Makefile +++ b/jdk/src/share/classes/sun/rmi/registry/resources/rmiregistry_pt_BR.properties @@ -1,5 +1,6 @@ # -# Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. +# +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # 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,19 +24,5 @@ # questions. # -# -# Build HPI (Host Porting Interface) libraries -# - -BUILDDIR = ../.. -include $(BUILDDIR)/common/Defs.gmk - -# -# Build specified the HPI implementations -# -SUBDIRS = $(HPIS) -include $(BUILDDIR)/common/Subdirs.gmk - -all build clean clobber:: - $(SUBDIRS-loop) - +rmiregistry.usage=Uso: {0} \n\nem que inclui:\n -J passa o argumento para o int\u00e9rprete de java +rmiregistry.port.badnumber=o argumento da porta, {0}, n\u00e3o \u00e9 um n\u00famero. diff --git a/jdk/src/share/classes/sun/rmi/rmic/BatchEnvironment.java b/jdk/src/share/classes/sun/rmi/rmic/BatchEnvironment.java index 7f37662bb0d..3eff0bbbb93 100644 --- a/jdk/src/share/classes/sun/rmi/rmic/BatchEnvironment.java +++ b/jdk/src/share/classes/sun/rmi/rmic/BatchEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/rmi/rmic/resources/rmic.properties b/jdk/src/share/classes/sun/rmi/rmic/resources/rmic.properties index d92ba227ab7..541c7c141cf 100644 --- a/jdk/src/share/classes/sun/rmi/rmic/resources/rmic.properties +++ b/jdk/src/share/classes/sun/rmi/rmic/resources/rmic.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -100,8 +100,8 @@ rmic.usage=Usage: {0} \ \n -bootclasspath Override location of bootstrap class files\ \n -extdirs Override location of installed extensions\ \n -d Specify where to place generated class files\ -\n -J Pass argument to the java interpreter -\n\ +\n -J Pass argument to the java interpreter\ +\n # # Generic Messages diff --git a/jdk/src/share/classes/sun/rmi/rmic/resources/rmic_ja.properties b/jdk/src/share/classes/sun/rmi/rmic/resources/rmic_ja.properties index a47d866f1b1..2c53008d813 100644 --- a/jdk/src/share/classes/sun/rmi/rmic/resources/rmic_ja.properties +++ b/jdk/src/share/classes/sun/rmi/rmic/resources/rmic_ja.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -100,8 +100,8 @@ rmic.usage=\u4f7f\u3044\u65b9: {0} \ \n -bootclasspath \u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb\u306e\u4f4d\u7f6e\u3092\u7f6e\u304d\u63db\u3048\u308b\ \n -extdirs \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u62e1\u5f35\u6a5f\u80fd\u306e\u4f4d\u7f6e\u3092\u7f6e\u304d\u63db\u3048\u308b\ \n -d \u751f\u6210\u3055\u308c\u305f\u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u683c\u7d0d\u3059\u308b\u4f4d\u7f6e\u3092\u6307\u5b9a\u3059\u308b\ -\n -J java \u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306b\u5f15\u6570\u3092\u6e21\u3059 -\n\ +\n -J java \u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306b\u5f15\u6570\u3092\u6e21\u3059\ +\n # # Generic Messages diff --git a/jdk/src/share/classes/sun/rmi/rmic/resources/rmic_zh_CN.properties b/jdk/src/share/classes/sun/rmi/rmic/resources/rmic_zh_CN.properties index 0792dbc4724..a97142bac34 100644 --- a/jdk/src/share/classes/sun/rmi/rmic/resources/rmic_zh_CN.properties +++ b/jdk/src/share/classes/sun/rmi/rmic/resources/rmic_zh_CN.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -100,8 +100,8 @@ rmic.usage=\u7528\u6cd5\uff1a{0} <\u9009\u9879> <\u7c7b\u540d\u79f0>\ \n -bootclasspath <\u8def\u5f84> \u8986\u76d6\u5f15\u5bfc\u7c7b\u6587\u4ef6\u7684\u4f4d\u7f6e\ \n -extdirs <\u8def\u5f84> \u8986\u76d6\u5b89\u88c5\u7684\u6269\u5c55\u76ee\u5f55\u7684\u4f4d\u7f6e\ \n -d <\u76ee\u5f55> \u6307\u5b9a\u5b58\u653e\u751f\u6210\u7684\u7c7b\u6587\u4ef6\u7684\u4f4d\u7f6e\ -\n -J <\u8fd0\u884c\u65f6\u6807\u5fd7> \u5411 java \u89e3\u91ca\u7a0b\u5e8f\u4f20\u9012\u53c2\u6570 -\n\ +\n -J <\u8fd0\u884c\u65f6\u6807\u5fd7> \u5411 java \u89e3\u91ca\u7a0b\u5e8f\u4f20\u9012\u53c2\u6570\ +\n # # Generic Messages diff --git a/jdk/src/share/classes/sun/rmi/server/resources/rmid_pt_BR.properties b/jdk/src/share/classes/sun/rmi/server/resources/rmid_pt_BR.properties new file mode 100644 index 00000000000..ba9bf58e983 --- /dev/null +++ b/jdk/src/share/classes/sun/rmi/server/resources/rmid_pt_BR.properties @@ -0,0 +1,96 @@ +# +# +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# "rmid", inetd", and "wait" should not be translated. +rmid.syntax.exec.invalid=rmid foi iniciado de inetd com um status inv\u00e1lido (deve estar em espera) + +# "rmid" and "inetd" should not be translated. +rmid.syntax.port.badarg=a porta n\u00e3o pode ser especificada se rmid for iniciado de inetd + +# "port" here refers to a TCP port for the server to listen on. +rmid.syntax.port.badnumber=a porta n\u00e3o \u00e9 um n\u00famero + +# "-port" should not be translated, because it's part of command syntax. +rmid.syntax.port.missing=a op\u00e7\u00e3o -port requer argumento + +# "-log" should not be translated, because it's part of command syntax. +rmid.syntax.log.missing=a op\u00e7\u00e3o -log requer argumento + +# "-log" should not be translated, because it's part of command syntax. +rmid.syntax.log.required=op\u00e7\u00e3o -log necess\u00e1ria + +# {0} = the (string) illegal argument in question +rmid.syntax.illegal.option=op\u00e7\u00e3o ilegal: {0} + +# {0} = the (string) reason text that came with a thrown exception +# "Activation.main" should not be translated, because it's a codepoint +rmid.unexpected.exception=Activation.main: ocorreu uma exce\u00e7\u00e3o: {0} + +# "java.home" should not be translated, because it's a property name +# "ActivatorImpl" should not be translated, because it's a codepoint +rmid.unfound.java.home.property=ActivatorImpl: n\u00e3o \u00e9 poss\u00edvel localizar java.home + +# "rmid" should not be translated +rmid.inherited.channel.info=inicializa\u00e7\u00e3o de rmid com canal legado + +# "Activation.main" should not be translated, because it's a codepoint +rmid.exec.policy.invalid=Activation.main: classe de pol\u00edtica de execu\u00e7\u00e3o inv\u00e1lida + +# "rmid" should not be translated +rmid.exec.policy.exception=rmid: a tentativa de obter a pol\u00edtica de execu\u00e7\u00e3o gera: + +# "rmid" should not be translated +rmid.exec.command=rmid: debugExec: executando "{0}" + +# "rmid" should not be translated +rmid.group.inactive=rmid: grupo de ativa\u00e7\u00e3o inativo: {0} + +# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and +# "ExecOptionPermission" should not be translated, since they refer to +# class/permission names. +rmid.exec.perms.inadequate=Activation.main: aviso: propriedade do sistema sun.rmi.activation.execPolicy\nn\u00e3o registrada e nenhuma ExecPermission/ExecOptionPermission\nconcedida; as tentativas de ativa\u00e7\u00e3o seguintes podem falhar devido a verifica\u00e7\u00f5es mal sucedidas da permiss\u00e3o\nExecPermission/ExecOptionPermission. Para obter\ndocumenta\u00e7\u00e3o sobre como configurar a seguran\u00e7a rmid, conculte:\n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n + +# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated, +# because they are syntax +rmid.usage=Uso: {0} \n\nem que inclui:\n -port especifica a porta que rmid usar\u00e1\n -log especifica o diret\u00f3rio no qual o rmid grava o registro\n -stop para a chamada atual de rmid (para a porta especificada)\n -C passa o argumento para cada processo filho (grupo de ativa\u00e7\u00e3o)\n -J passa o argumento para o int\u00e9rprete de java\n +# This means "The currently running activation daemon has been shut down, +# and is about to exit". +rmid.daemon.shutdown=encerramento do daemon de ativa\u00e7\u00e3o + +# "rmid" should not be translated +rmid.restart.group.warning=\nrmid: (AVISO) reiniciar grupo gera: + +# "rmid" should not be translated +rmid.restart.service.warning=\nrmid: (AVISO) reiniciar servi\u00e7o gera: + +# "rmid" should not be translated +rmid.log.update.warning=\nrmid: (AVISO) registrar atualiza\u00e7\u00e3o gera: + +# "rmid" should not be translated +rmid.log.snapshot.warning=\nrmid: (GRAVE) registrar instant\u00e2neo gera: + +# "rmid" should not be translated +rmid.log.recover.warning=\nrmid: (AVISO) {0}: ignorando registro durante a recupera\u00e7\u00e3o: diff --git a/jdk/src/share/classes/sun/security/acl/AclEntryImpl.java b/jdk/src/share/classes/sun/security/acl/AclEntryImpl.java index 521e73b8f9c..2bc035469b8 100644 --- a/jdk/src/share/classes/sun/security/acl/AclEntryImpl.java +++ b/jdk/src/share/classes/sun/security/acl/AclEntryImpl.java @@ -37,7 +37,7 @@ import java.security.acl.*; */ public class AclEntryImpl implements AclEntry { private Principal user = null; - private Vector permissionSet = new Vector(10, 10); + private Vector permissionSet = new Vector<>(10, 10); private boolean negative = false; /** diff --git a/jdk/src/share/classes/sun/security/acl/AclImpl.java b/jdk/src/share/classes/sun/security/acl/AclImpl.java index 6a6da4bea85..d8ea50d3fb9 100644 --- a/jdk/src/share/classes/sun/security/acl/AclImpl.java +++ b/jdk/src/share/classes/sun/security/acl/AclImpl.java @@ -41,15 +41,15 @@ public class AclImpl extends OwnerImpl implements Acl { // or principal. // private Hashtable allowedUsersTable = - new Hashtable(23); + new Hashtable<>(23); private Hashtable allowedGroupsTable = - new Hashtable(23); + new Hashtable<>(23); private Hashtable deniedUsersTable = - new Hashtable(23); + new Hashtable<>(23); private Hashtable deniedGroupsTable = - new Hashtable(23); + new Hashtable<>(23); private String aclName = null; - private Vector zeroSet = new Vector(1,1); + private Vector zeroSet = new Vector<>(1,1); /** @@ -294,7 +294,7 @@ public class AclImpl extends OwnerImpl implements Acl { // private static Enumeration union(Enumeration e1, Enumeration e2) { - Vector v = new Vector(20, 20); + Vector v = new Vector<>(20, 20); while (e1.hasMoreElements()) v.addElement(e1.nextElement()); @@ -313,7 +313,7 @@ public class AclImpl extends OwnerImpl implements Acl { // private Enumeration subtract(Enumeration e1, Enumeration e2) { - Vector v = new Vector(20, 20); + Vector v = new Vector<>(20, 20); while (e1.hasMoreElements()) v.addElement(e1.nextElement()); diff --git a/jdk/src/share/classes/sun/security/acl/GroupImpl.java b/jdk/src/share/classes/sun/security/acl/GroupImpl.java index e475b795c7d..586c705bc0c 100644 --- a/jdk/src/share/classes/sun/security/acl/GroupImpl.java +++ b/jdk/src/share/classes/sun/security/acl/GroupImpl.java @@ -34,7 +34,7 @@ import java.security.acl.*; * @author Satish Dharmaraj */ public class GroupImpl implements Group { - private Vector groupMembers = new Vector(50, 100); + private Vector groupMembers = new Vector<>(50, 100); private String group; /** @@ -131,7 +131,7 @@ public class GroupImpl implements Group { if (groupMembers.contains(member)) { return true; } else { - Vector alreadySeen = new Vector(10); + Vector alreadySeen = new Vector<>(10); return isMemberRecurse(member, alreadySeen); } } diff --git a/jdk/src/share/classes/sun/security/internal/interfaces/TlsMasterSecret.java b/jdk/src/share/classes/sun/security/internal/interfaces/TlsMasterSecret.java index 4c5ba86261a..f3eb222ca68 100644 --- a/jdk/src/share/classes/sun/security/internal/interfaces/TlsMasterSecret.java +++ b/jdk/src/share/classes/sun/security/internal/interfaces/TlsMasterSecret.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import javax.crypto.SecretKey; * * @since 1.6 * @author Andreas Sterbenz - * @deprecated Sun JDK internal use only --- WILL BE REMOVED in Dolphin (JDK 7) + * @deprecated Sun JDK internal use only --- WILL BE REMOVED in a future + * release. */ @Deprecated public interface TlsMasterSecret extends SecretKey { diff --git a/jdk/src/share/classes/sun/security/internal/spec/TlsKeyMaterialParameterSpec.java b/jdk/src/share/classes/sun/security/internal/spec/TlsKeyMaterialParameterSpec.java index 62ffe990cec..80aa79a2596 100644 --- a/jdk/src/share/classes/sun/security/internal/spec/TlsKeyMaterialParameterSpec.java +++ b/jdk/src/share/classes/sun/security/internal/spec/TlsKeyMaterialParameterSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,8 @@ import javax.crypto.SecretKey; * * @since 1.6 * @author Andreas Sterbenz - * @deprecated Sun JDK internal use only --- WILL BE REMOVED in Dolphin (JDK 7) + * @deprecated Sun JDK internal use only --- WILL BE REMOVED in a future + * release. */ @Deprecated public class TlsKeyMaterialParameterSpec implements AlgorithmParameterSpec { @@ -50,6 +51,9 @@ public class TlsKeyMaterialParameterSpec implements AlgorithmParameterSpec { private final String cipherAlgorithm; private final int cipherKeyLength, ivLength, macKeyLength; private final int expandedCipherKeyLength; // == 0 for domestic ciphersuites + private final String prfHashAlg; + private final int prfHashLength; + private final int prfBlockSize; /** * Constructs a new TlsKeyMaterialParameterSpec. @@ -71,6 +75,12 @@ public class TlsKeyMaterialParameterSpec implements AlgorithmParameterSpec { * @param ivLength the length in bytes of the initialization vector * to be generated, or 0 if no initialization vector is required * @param macKeyLength the length in bytes of the MAC key to be generated + * @param prfHashAlg the name of the TLS PRF hash algorithm to use. + * Used only for TLS 1.2+. TLS1.1 and earlier use a fixed PRF. + * @param prfHashLength the output length of the TLS PRF hash algorithm. + * Used only for TLS 1.2+. + * @param prfBlockSize the input block size of the TLS PRF hash algorithm. + * Used only for TLS 1.2+. * * @throws NullPointerException if masterSecret, clientRandom, * serverRandom, or cipherAlgorithm are null @@ -82,7 +92,8 @@ public class TlsKeyMaterialParameterSpec implements AlgorithmParameterSpec { public TlsKeyMaterialParameterSpec(SecretKey masterSecret, int majorVersion, int minorVersion, byte[] clientRandom, byte[] serverRandom, String cipherAlgorithm, int cipherKeyLength, - int expandedCipherKeyLength, int ivLength, int macKeyLength) { + int expandedCipherKeyLength, int ivLength, int macKeyLength, + String prfHashAlg, int prfHashLength, int prfBlockSize) { if (masterSecret.getAlgorithm().equals("TlsMasterSecret") == false) { throw new IllegalArgumentException("Not a TLS master secret"); } @@ -90,8 +101,10 @@ public class TlsKeyMaterialParameterSpec implements AlgorithmParameterSpec { throw new NullPointerException(); } this.masterSecret = masterSecret; - this.majorVersion = TlsMasterSecretParameterSpec.checkVersion(majorVersion); - this.minorVersion = TlsMasterSecretParameterSpec.checkVersion(minorVersion); + this.majorVersion = + TlsMasterSecretParameterSpec.checkVersion(majorVersion); + this.minorVersion = + TlsMasterSecretParameterSpec.checkVersion(minorVersion); this.clientRandom = clientRandom.clone(); this.serverRandom = serverRandom.clone(); this.cipherAlgorithm = cipherAlgorithm; @@ -99,6 +112,9 @@ public class TlsKeyMaterialParameterSpec implements AlgorithmParameterSpec { this.expandedCipherKeyLength = checkSign(expandedCipherKeyLength); this.ivLength = checkSign(ivLength); this.macKeyLength = checkSign(macKeyLength); + this.prfHashAlg = prfHashAlg; + this.prfHashLength = prfHashLength; + this.prfBlockSize = prfBlockSize; } private static int checkSign(int k) { @@ -172,20 +188,36 @@ public class TlsKeyMaterialParameterSpec implements AlgorithmParameterSpec { } /** - * Returns the length in bytes of the expanded encryption key to be generated. + * Returns the length in bytes of the expanded encryption key to be + * generated. Returns zero if the expanded encryption key is not + * supposed to be generated. * - * @return the length in bytes of the expanded encryption key to be generated. + * @return the length in bytes of the expanded encryption key to be + * generated. */ public int getExpandedCipherKeyLength() { + // TLS v1.1 disables the exportable weak cipher suites. + if (majorVersion >= 0x03 && minorVersion >= 0x02) { + return 0; + } return expandedCipherKeyLength; } /** - * Returns the length in bytes of the initialization vector to be generated. + * Returns the length in bytes of the initialization vector to be + * generated. Returns zero if the initialization vector is not + * supposed to be generated. * - * @return the length in bytes of the initialization vector to be generated. + * @return the length in bytes of the initialization vector to be + * generated. */ public int getIvLength() { + // TLS v1.1 or later uses an explicit IV to protect against + // the CBC attacks. + if (majorVersion >= 0x03 && minorVersion >= 0x02) { + return 0; + } + return ivLength; } @@ -198,4 +230,30 @@ public class TlsKeyMaterialParameterSpec implements AlgorithmParameterSpec { return macKeyLength; } + /** + * Obtains the PRF hash algorithm to use in the PRF calculation. + * + * @return the hash algorithm. + */ + public String getPRFHashAlg() { + return prfHashAlg; + } + + /** + * Obtains the length of the PRF hash algorithm. + * + * @return the hash algorithm length. + */ + public int getPRFHashLength() { + return prfHashLength; + } + + /** + * Obtains the block size of the PRF hash algorithm. + * + * @return the hash algorithm block size + */ + public int getPRFBlockSize() { + return prfBlockSize; + } } diff --git a/jdk/src/share/classes/sun/security/internal/spec/TlsKeyMaterialSpec.java b/jdk/src/share/classes/sun/security/internal/spec/TlsKeyMaterialSpec.java index d92b9ad9071..d1204962881 100644 --- a/jdk/src/share/classes/sun/security/internal/spec/TlsKeyMaterialSpec.java +++ b/jdk/src/share/classes/sun/security/internal/spec/TlsKeyMaterialSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,8 @@ import javax.crypto.spec.IvParameterSpec; * * @since 1.6 * @author Andreas Sterbenz - * @deprecated Sun JDK internal use only --- WILL BE REMOVED in Dolphin (JDK 7) + * @deprecated Sun JDK internal use only --- WILL BE REMOVED in a future + * release. */ @Deprecated public class TlsKeyMaterialSpec implements KeySpec, SecretKey { @@ -80,7 +81,8 @@ public class TlsKeyMaterialSpec implements KeySpec, SecretKey { */ public TlsKeyMaterialSpec(SecretKey clientMacKey, SecretKey serverMacKey, SecretKey clientCipherKey, SecretKey serverCipherKey) { - this(clientMacKey, serverMacKey, clientCipherKey, null, serverCipherKey, null); + this(clientMacKey, serverMacKey, clientCipherKey, null, + serverCipherKey, null); } /** diff --git a/jdk/src/share/classes/sun/security/internal/spec/TlsMasterSecretParameterSpec.java b/jdk/src/share/classes/sun/security/internal/spec/TlsMasterSecretParameterSpec.java index 76ab0ed02b4..832b38edd76 100644 --- a/jdk/src/share/classes/sun/security/internal/spec/TlsMasterSecretParameterSpec.java +++ b/jdk/src/share/classes/sun/security/internal/spec/TlsMasterSecretParameterSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,8 @@ import javax.crypto.SecretKey; * * @since 1.6 * @author Andreas Sterbenz - * @deprecated Sun JDK internal use only --- WILL BE REMOVED in Dolphin (JDK 7) + * @deprecated Sun JDK internal use only --- WILL BE REMOVED in a future + * release. */ @Deprecated public class TlsMasterSecretParameterSpec implements AlgorithmParameterSpec { @@ -47,6 +48,9 @@ public class TlsMasterSecretParameterSpec implements AlgorithmParameterSpec { private final SecretKey premasterSecret; private final int majorVersion, minorVersion; private final byte[] clientRandom, serverRandom; + private final String prfHashAlg; + private final int prfHashLength; + private final int prfBlockSize; /** * Constructs a new TlsMasterSecretParameterSpec. @@ -60,6 +64,12 @@ public class TlsMasterSecretParameterSpec implements AlgorithmParameterSpec { * @param minorVersion the minor number of the protocol version * @param clientRandom the client's random value * @param serverRandom the server's random value + * @param prfHashAlg the name of the TLS PRF hash algorithm to use. + * Used only for TLS 1.2+. TLS1.1 and earlier use a fixed PRF. + * @param prfHashLength the output length of the TLS PRF hash algorithm. + * Used only for TLS 1.2+. + * @param prfBlockSize the input block size of the TLS PRF hash algorithm. + * Used only for TLS 1.2+. * * @throws NullPointerException if premasterSecret, clientRandom, * or serverRandom are null @@ -67,7 +77,9 @@ public class TlsMasterSecretParameterSpec implements AlgorithmParameterSpec { * negative or larger than 255 */ public TlsMasterSecretParameterSpec(SecretKey premasterSecret, - int majorVersion, int minorVersion, byte[] clientRandom, byte[] serverRandom) { + int majorVersion, int minorVersion, + byte[] clientRandom, byte[] serverRandom, + String prfHashAlg, int prfHashLength, int prfBlockSize) { if (premasterSecret == null) { throw new NullPointerException("premasterSecret must not be null"); } @@ -76,11 +88,15 @@ public class TlsMasterSecretParameterSpec implements AlgorithmParameterSpec { this.minorVersion = checkVersion(minorVersion); this.clientRandom = clientRandom.clone(); this.serverRandom = serverRandom.clone(); + this.prfHashAlg = prfHashAlg; + this.prfHashLength = prfHashLength; + this.prfBlockSize = prfBlockSize; } static int checkVersion(int version) { if ((version < 0) || (version > 255)) { - throw new IllegalArgumentException("Version must be between 0 and 255"); + throw new IllegalArgumentException( + "Version must be between 0 and 255"); } return version; } @@ -130,4 +146,30 @@ public class TlsMasterSecretParameterSpec implements AlgorithmParameterSpec { return serverRandom.clone(); } + /** + * Obtains the PRF hash algorithm to use in the PRF calculation. + * + * @return the hash algorithm. + */ + public String getPRFHashAlg() { + return prfHashAlg; + } + + /** + * Obtains the length of the PRF hash algorithm. + * + * @return the hash algorithm length. + */ + public int getPRFHashLength() { + return prfHashLength; + } + + /** + * Obtains the block size of the PRF hash algorithm. + * + * @return the hash algorithm block size. + */ + public int getPRFBlockSize() { + return prfBlockSize; + } } diff --git a/jdk/src/share/classes/sun/security/internal/spec/TlsPrfParameterSpec.java b/jdk/src/share/classes/sun/security/internal/spec/TlsPrfParameterSpec.java index 0d4e381280c..5958663bcf7 100644 --- a/jdk/src/share/classes/sun/security/internal/spec/TlsPrfParameterSpec.java +++ b/jdk/src/share/classes/sun/security/internal/spec/TlsPrfParameterSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import javax.crypto.SecretKey; * * @since 1.6 * @author Andreas Sterbenz - * @deprecated Sun JDK internal use only --- WILL BE REMOVED in Dolphin (JDK 7) + * @deprecated Sun JDK internal use only --- WILL BE REMOVED in a future + * release. */ @Deprecated public class TlsPrfParameterSpec implements AlgorithmParameterSpec { @@ -47,6 +48,9 @@ public class TlsPrfParameterSpec implements AlgorithmParameterSpec { private final String label; private final byte[] seed; private final int outputLength; + private final String prfHashAlg; + private final int prfHashLength; + private final int prfBlockSize; /** * Constructs a new TlsPrfParameterSpec. @@ -55,11 +59,19 @@ public class TlsPrfParameterSpec implements AlgorithmParameterSpec { * @param label the label to use in the calculation * @param seed the random seed to use in the calculation * @param outputLength the length in bytes of the output key to be produced + * @param prfHashAlg the name of the TLS PRF hash algorithm to use. + * Used only for TLS 1.2+. TLS1.1 and earlier use a fixed PRF. + * @param prfHashLength the output length of the TLS PRF hash algorithm. + * Used only for TLS 1.2+. + * @param prfBlockSize the input block size of the TLS PRF hash algorithm. + * Used only for TLS 1.2+. * * @throws NullPointerException if label or seed is null * @throws IllegalArgumentException if outputLength is negative */ - public TlsPrfParameterSpec(SecretKey secret, String label, byte[] seed, int outputLength) { + public TlsPrfParameterSpec(SecretKey secret, String label, + byte[] seed, int outputLength, + String prfHashAlg, int prfHashLength, int prfBlockSize) { if ((label == null) || (seed == null)) { throw new NullPointerException("label and seed must not be null"); } @@ -70,6 +82,9 @@ public class TlsPrfParameterSpec implements AlgorithmParameterSpec { this.label = label; this.seed = seed.clone(); this.outputLength = outputLength; + this.prfHashAlg = prfHashAlg; + this.prfHashLength = prfHashLength; + this.prfBlockSize = prfBlockSize; } /** @@ -110,4 +125,33 @@ public class TlsPrfParameterSpec implements AlgorithmParameterSpec { return outputLength; } + /** + * Obtains the PRF hash algorithm to use in the PRF calculation. + * + * @return the hash algorithm, or null if no algorithm was specified. + */ + public String getPRFHashAlg() { + return prfHashAlg; + } + + /** + * Obtains the length of PRF hash algorithm. + * + * It would have been preferred to use MessageDigest.getDigestLength(), + * but the API does not require implementations to support the method. + * + * @return the hash algorithm length. + */ + public int getPRFHashLength() { + return prfHashLength; + } + + /** + * Obtains the length of PRF hash algorithm. + * + * @return the hash algorithm length. + */ + public int getPRFBlockSize() { + return prfBlockSize; + } } diff --git a/jdk/src/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java b/jdk/src/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java index 42ba7d7a826..7ff1d7ff80f 100644 --- a/jdk/src/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java +++ b/jdk/src/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +36,12 @@ import java.security.spec.AlgorithmParameterSpec; * * @since 1.6 * @author Andreas Sterbenz - * @deprecated Sun JDK internal use only --- WILL BE REMOVED in Dolphin (JDK 7) + * @deprecated Sun JDK internal use only --- WILL BE REMOVED in a future + * release. */ @Deprecated -public class TlsRsaPremasterSecretParameterSpec implements AlgorithmParameterSpec { +public class TlsRsaPremasterSecretParameterSpec + implements AlgorithmParameterSpec { private final int majorVersion; private final int minorVersion; @@ -58,10 +60,12 @@ public class TlsRsaPremasterSecretParameterSpec implements AlgorithmParameterSpe * @throws IllegalArgumentException if minorVersion or majorVersion are * negative or larger than 255 */ - public TlsRsaPremasterSecretParameterSpec(int majorVersion, int minorVersion) { - this.majorVersion = TlsMasterSecretParameterSpec.checkVersion(majorVersion); - this.minorVersion = TlsMasterSecretParameterSpec.checkVersion(minorVersion); - } + public TlsRsaPremasterSecretParameterSpec(int majorVersion, + int minorVersion) { + this.majorVersion = + TlsMasterSecretParameterSpec.checkVersion(majorVersion); + this.minorVersion = + TlsMasterSecretParameterSpec.checkVersion(minorVersion); } /** * Returns the major version. diff --git a/jdk/src/share/classes/sun/security/jca/ProviderList.java b/jdk/src/share/classes/sun/security/jca/ProviderList.java index aae0fd2dcde..26bc9162761 100644 --- a/jdk/src/share/classes/sun/security/jca/ProviderList.java +++ b/jdk/src/share/classes/sun/security/jca/ProviderList.java @@ -96,7 +96,7 @@ public final class ProviderList { if (providerList.getProvider(p.getName()) != null) { return providerList; } - List list = new ArrayList + List list = new ArrayList<> (Arrays.asList(providerList.configs)); int n = list.size(); if ((position < 0) || (position > n)) { @@ -160,7 +160,7 @@ public final class ProviderList { * Return a new ProviderList parsed from the java.security Properties. */ private ProviderList() { - List configList = new ArrayList(); + List configList = new ArrayList<>(); for (int i = 1; true; i++) { String entry = Security.getProperty("security.provider." + i); if (entry == null) { @@ -200,7 +200,7 @@ public final class ProviderList { * possible recursion and deadlock during verification. */ ProviderList getJarList(String[] jarClassNames) { - List newConfigs = new ArrayList(); + List newConfigs = new ArrayList<>(); for (String className : jarClassNames) { ProviderConfig newConfig = new ProviderConfig(className); for (ProviderConfig config : configs) { @@ -356,7 +356,7 @@ public final class ProviderList { */ @Deprecated public List getServices(String type, List algorithms) { - List ids = new ArrayList(); + List ids = new ArrayList<>(); for (String alg : algorithms) { ids.add(new ServiceId(type, alg)); } diff --git a/jdk/src/share/classes/sun/security/jca/Providers.java b/jdk/src/share/classes/sun/security/jca/Providers.java index 9e2ad0e9fa9..c3903b7145e 100644 --- a/jdk/src/share/classes/sun/security/jca/Providers.java +++ b/jdk/src/share/classes/sun/security/jca/Providers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ import java.security.Security; public class Providers { private static final ThreadLocal threadLists = - new InheritableThreadLocal(); + new InheritableThreadLocal<>(); // number of threads currently using thread-local provider lists // tracked to allow an optimization if == 0 diff --git a/jdk/src/share/classes/sun/security/jgss/krb5/CipherHelper.java b/jdk/src/share/classes/sun/security/jgss/krb5/CipherHelper.java index ade8bbfe41b..51172cad3b8 100644 --- a/jdk/src/share/classes/sun/security/jgss/krb5/CipherHelper.java +++ b/jdk/src/share/classes/sun/security/jgss/krb5/CipherHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -710,29 +710,21 @@ class CipherHelper { * where HMAC is on {16-byte confounder | plaintext | 16-byte token_header} * HMAC is not encrypted; it is appended at the end. */ - void encryptData(WrapToken_v2 token, byte[] confounder, byte[] tokenHeader, - byte[] plaintext, int start, int len, int key_usage, OutputStream os) - throws GSSException, IOException { + byte[] encryptData(WrapToken_v2 token, byte[] confounder, byte[] tokenHeader, + byte[] plaintext, int start, int len, int key_usage) + throws GSSException { - byte[] ctext = null; switch (etype) { - case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96: - ctext = aes128Encrypt(confounder, tokenHeader, - plaintext, start, len, key_usage); - break; - case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96: - ctext = aes256Encrypt(confounder, tokenHeader, - plaintext, start, len, key_usage); - break; - default: - throw new GSSException(GSSException.FAILURE, -1, - "Unsupported etype: " + etype); + case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96: + return aes128Encrypt(confounder, tokenHeader, + plaintext, start, len, key_usage); + case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96: + return aes256Encrypt(confounder, tokenHeader, + plaintext, start, len, key_usage); + default: + throw new GSSException(GSSException.FAILURE, -1, + "Unsupported etype: " + etype); } - - // Krb5Token.debug("EncryptedData = " + - // Krb5Token.getHexBytes(ctext) + "\n"); - // Write to stream - os.write(ctext); } void encryptData(WrapToken token, byte[] confounder, byte[] plaintext, diff --git a/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java b/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java index e889fcc42a8..309e611a89e 100644 --- a/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java +++ b/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/jgss/krb5/MessageToken_v2.java b/jdk/src/share/classes/sun/security/jgss/krb5/MessageToken_v2.java index 7f5c2cfc91e..d76a58bc06e 100644 --- a/jdk/src/share/classes/sun/security/jgss/krb5/MessageToken_v2.java +++ b/jdk/src/share/classes/sun/security/jgss/krb5/MessageToken_v2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,42 +26,40 @@ package sun.security.jgss.krb5; import org.ietf.jgss.*; -import sun.security.jgss.*; -import sun.security.krb5.*; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; import java.io.ByteArrayInputStream; -import java.security.GeneralSecurityException; +import java.io.ByteArrayOutputStream; import java.security.MessageDigest; +import java.util.Arrays; /** * This class is a base class for new GSS token definitions, as defined - * in draft-ietf-krb-wg-gssapi-cfx-07.txt, that pertain to per-message - * GSS-API calls. Conceptually GSS-API has two types of per-message tokens: - * WrapToken and MicToken. They differ in the respect that a WrapToken - * carries additional plaintext or ciphertext application data besides - * just the sequence number and checksum. This class encapsulates the - * commonality in the structure of the WrapToken and the MicToken. - * This structure can be represented as: + * in RFC 4121, that pertain to per-message GSS-API calls. Conceptually + * GSS-API has two types of per-message tokens: WrapToken and MicToken. + * They differ in the respect that a WrapToken carries additional plaintext + * or ciphertext application data besides just the sequence number and + * checksum. This class encapsulates the commonality in the structure of + * the WrapToken and the MicToken. This structure can be represented as: *

      *

      - *  Wrap Tokens
      + * Wrap Tokens
        *
        *     Octet no   Name        Description
        *    ---------------------------------------------------------------
        *      0..1     TOK_ID     Identification field.  Tokens emitted by
      - *                          GSS_Wrap() contain the the hex value 05 04
      - *                          expressed in big endian order in this field.
      + *                          GSS_Wrap() contain the hex value 05 04
      + *                          expressed in big-endian order in this field.
        *      2        Flags      Attributes field, as described in section
        *                          4.2.2.
        *      3        Filler     Contains the hex value FF.
      - *      4..5     EC         Contains the "extra count" field, in big
      + *      4..5     EC         Contains the "extra count" field, in big-
        *                          endian order as described in section 4.2.3.
        *      6..7     RRC        Contains the "right rotation count" in big
        *                          endian order, as described in section 4.2.5.
        *      8..15    SND_SEQ    Sequence number field in clear text,
      - *                          expressed in big endian order.
      + *                          expressed in big-endian order.
        *      16..last Data       Encrypted data for Wrap tokens with
        *                          confidentiality, or plaintext data followed
        *                          by the checksum for Wrap tokens without
      @@ -73,67 +71,82 @@ import java.security.MessageDigest;
        *     -----------------------------------------------------------------
        *      0..1     TOK_ID     Identification field.  Tokens emitted by
        *                          GSS_GetMIC() contain the hex value 04 04
      - *                          expressed in big endian order in this field.
      + *                          expressed in big-endian order in this field.
        *      2        Flags      Attributes field, as described in section
        *                          4.2.2.
        *      3..7     Filler     Contains five octets of hex value FF.
        *      8..15    SND_SEQ    Sequence number field in clear text,
      - *                          expressed in big endian order.
      + *                          expressed in big-endian order.
        *      16..last SGN_CKSUM  Checksum of the "to-be-signed" data and
        *                          octet 0..15, as described in section 4.2.4.
        *
        * 
      *

      + * This class is the super class of WrapToken_v2 and MicToken_v2. The token's + * header (bytes[0..15]) and data (byte[16..]) are saved in tokenHeader and + * tokenData fields. Since there is no easy way to find out the exact length + * of a WrapToken_v2 token from any header info, in the case of reading from + * stream, we read all available() bytes into the token. + *

      + * All read actions are performed in this super class. On the write part, the + * super class only write the tokenHeader, and the content writing is inside + * child classes. * * @author Seema Malkani */ abstract class MessageToken_v2 extends Krb5Token { + protected static final int TOKEN_HEADER_SIZE = 16; private static final int TOKEN_ID_POS = 0; private static final int TOKEN_FLAG_POS = 2; private static final int TOKEN_EC_POS = 4; private static final int TOKEN_RRC_POS = 6; - // token header size - static final int TOKEN_HEADER_SIZE = 16; + /** + * The size of the random confounder used in a WrapToken. + */ + protected static final int CONFOUNDER_SIZE = 16; - private int tokenId = 0; - private int seqNumber; - - // EC and RRC fields - private int ec = 0; - private int rrc = 0; - - private boolean confState = true; - private boolean initiator = true; - - byte[] confounder = null; - byte[] checksum = null; - - private int key_usage = 0; - private byte[] seqNumberData = null; - - private MessageTokenHeader tokenHeader = null; - - /* cipher instance used by the corresponding GSSContext */ - CipherHelper cipherHelper = null; - - // draft-ietf-krb-wg-gssapi-cfx-07 + // RFC 4121, key usage values static final int KG_USAGE_ACCEPTOR_SEAL = 22; static final int KG_USAGE_ACCEPTOR_SIGN = 23; static final int KG_USAGE_INITIATOR_SEAL = 24; static final int KG_USAGE_INITIATOR_SIGN = 25; - // draft-ietf-krb-wg-gssapi-cfx-07 + // RFC 4121, Flags Field private static final int FLAG_SENDER_IS_ACCEPTOR = 1; private static final int FLAG_WRAP_CONFIDENTIAL = 2; private static final int FLAG_ACCEPTOR_SUBKEY = 4; private static final int FILLER = 0xff; + private MessageTokenHeader tokenHeader = null; + + // Common field + private int tokenId = 0; + private int seqNumber; + protected byte[] tokenData; // content of token, without the header + protected int tokenDataLen; + + // Key usage number for crypto action + private int key_usage = 0; + + // EC and RRC fields, WrapToken only + private int ec = 0; + private int rrc = 0; + + // Checksum. Always in MicToken, might be in WrapToken + byte[] checksum = null; + + // Context properties + private boolean confState = true; + private boolean initiator = true; + + /* cipher instance used by the corresponding GSSContext */ + CipherHelper cipherHelper = null; + /** - * Constructs a MessageToken from a byte array. If there are more bytes - * in the array than needed, the extra bytes are simply ignroed. + * Constructs a MessageToken from a byte array. * * @param tokenId the token id that should be contained in this token as * it is read. @@ -156,7 +169,9 @@ abstract class MessageToken_v2 extends Krb5Token { /** * Constructs a MessageToken from an InputStream. Bytes will be read on * demand and the thread might block if there are not enough bytes to - * complete the token. + * complete the token. Please note there is no accurate way to find out + * the size of a token, but we try our best to make sure there is + * enough bytes to construct one. * * @param tokenId the token id that should be contained in this token as * it is read. @@ -186,25 +201,58 @@ abstract class MessageToken_v2 extends Krb5Token { : KG_USAGE_ACCEPTOR_SIGN); } - // Read checksum - int tokenLen = is.available(); - byte[] data = new byte[tokenLen]; - readFully(is, data); - checksum = new byte[cipherHelper.getChecksumLength()]; - System.arraycopy(data, tokenLen-cipherHelper.getChecksumLength(), - checksum, 0, cipherHelper.getChecksumLength()); - // debug("\nLeaving MessageToken.Cons\n"); + int minSize = 0; // minimal size for token data + if (tokenId == Krb5Token.WRAP_ID_v2 && prop.getPrivacy()) { + minSize = CONFOUNDER_SIZE + + TOKEN_HEADER_SIZE + cipherHelper.getChecksumLength(); + } else { + minSize = cipherHelper.getChecksumLength(); + } - // validate EC for Wrap tokens without confidentiality - if (!prop.getPrivacy() && - (tokenId == Krb5Token.WRAP_ID_v2)) { - if (checksum.length != ec) { - throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, - getTokenName(tokenId) + ":" + "EC incorrect!"); + // Read token data + if (tokenId == Krb5Token.MIC_ID_v2) { + // The only case we can precisely predict the token data length + tokenDataLen = minSize; + tokenData = new byte[minSize]; + readFully(is, tokenData); + } else { + tokenDataLen = is.available(); + if (tokenDataLen >= minSize) { // read in one shot + tokenData = new byte[tokenDataLen]; + readFully(is, tokenData); + } else { + byte[] tmp = new byte[minSize]; + readFully(is, tmp); + // Hope while blocked in the read above, more data would + // come and is.available() below contains the whole token. + int more = is.available(); + tokenDataLen = minSize + more; + tokenData = Arrays.copyOf(tmp, tokenDataLen); + readFully(is, tokenData, minSize, more); } } + if (tokenId == Krb5Token.WRAP_ID_v2) { + // Does non-confidential data needs a rotate? + rotate(); + } + if (tokenId == Krb5Token.MIC_ID_v2 || + (tokenId == Krb5Token.WRAP_ID_v2 && !prop.getPrivacy())) { + // Read checksum + int chkLen = cipherHelper.getChecksumLength(); + checksum = new byte[chkLen]; + System.arraycopy(tokenData, tokenDataLen-chkLen, + checksum, 0, chkLen); + + // validate EC for Wrap tokens without confidentiality + if (tokenId == Krb5Token.WRAP_ID_v2 && !prop.getPrivacy()) { + if (chkLen != ec) { + throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, + getTokenName(tokenId) + ":" + "EC incorrect!"); + } + } + } } catch (IOException e) { throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, getTokenName(tokenId) + ":" + e.getMessage()); @@ -263,8 +311,7 @@ abstract class MessageToken_v2 extends Krb5Token { prop.setPrivacy(false); } - // Create a new gss token header as defined in - // draft-ietf-krb-wg-gssapi-cfx-07 + // Create a new gss token header as defined in RFC 4121 tokenHeader = new MessageTokenHeader(tokenId, prop.getPrivacy(), true); // debug("\n\t Message Header = " + @@ -326,50 +373,21 @@ abstract class MessageToken_v2 extends Krb5Token { * Rotate bytes as per the "RRC" (Right Rotation Count) received. * Our implementation does not do any rotates when sending, only * when receiving, we rotate left as per the RRC count, to revert it. - * - * @return true if bytes are rotated */ - public boolean rotate_left(byte[] in_bytes, int tokenOffset, - byte[] out_bytes, int bufsize) { + private void rotate() { + if (rrc % tokenDataLen != 0) { + rrc = rrc % tokenDataLen; + byte[] newBytes = new byte[tokenDataLen]; - int offset = 0; - // debug("\nRotate left: (before rotation) in_bytes = [ " + - // getHexBytes(in_bytes, tokenOffset, bufsize) + "]"); - if (rrc > 0) { - if (bufsize == 0) { - return false; - } - rrc = rrc % (bufsize - TOKEN_HEADER_SIZE); - if (rrc == 0) { - return false; - } + System.arraycopy(tokenData, rrc, newBytes, 0, tokenDataLen-rrc); + System.arraycopy(tokenData, 0, newBytes, tokenDataLen-rrc, rrc); - // if offset is not zero - if (tokenOffset > 0) { - offset += tokenOffset; - } - - // copy the header - System.arraycopy(in_bytes, offset, out_bytes, 0, TOKEN_HEADER_SIZE); - offset += TOKEN_HEADER_SIZE; - - // copy rest of the bytes - System.arraycopy(in_bytes, offset+rrc, out_bytes, - TOKEN_HEADER_SIZE, bufsize-TOKEN_HEADER_SIZE-rrc); - - // copy the bytes specified by rrc count - System.arraycopy(in_bytes, offset, out_bytes, - bufsize-TOKEN_HEADER_SIZE-rrc, rrc); - - // debug("\nRotate left: (after rotation) out_bytes = [ " + - // getHexBytes(out_bytes, 0, bufsize) + "]"); - return true; + tokenData = newBytes; } - return false; } public final int getSequenceNumber() { - return (readBigEndian(seqNumberData, 0, 4)); + return seqNumber; } /** @@ -444,44 +462,25 @@ abstract class MessageToken_v2 extends Krb5Token { this.cipherHelper = context.getCipherHelper(null); // debug("In MessageToken.Cons"); - - // draft-ietf-krb-wg-gssapi-cfx-07 - this.tokenId = tokenId; } /** - * Encodes a GSSHeader and this token onto an OutputStream. + * Encodes a MessageTokenHeader onto an OutputStream. * * @param os the OutputStream to which this should be written - * @throws GSSException if an error occurs while writing to the OutputStream + * @throws IOException is an error occurs while writing to the OutputStream */ - public void encode(OutputStream os) throws IOException, GSSException { - // debug("Writing tokenHeader " + getHexBytes(tokenHeader.getBytes()); - // (16 bytes of token header that includes sequence Number) + protected void encodeHeader(OutputStream os) throws IOException { tokenHeader.encode(os); - // debug("Writing checksum: " + getHexBytes(checksum)); - if (tokenId == MIC_ID_v2) { - os.write(checksum); - } } /** - * Obtains the size of this token. Note that this excludes the size of - * the GSSHeader. - * @return token size + * Encodes a MessageToken_v2 onto an OutputStream. + * + * @param os the OutputStream to which this should be written + * @throws IOException is an error occurs while encoding the token */ - protected int getKrb5TokenSize() throws GSSException { - return getTokenSize(); - } - - protected final int getTokenSize() throws GSSException { - return (TOKEN_HEADER_SIZE + cipherHelper.getChecksumLength()); - } - - protected static final int getTokenSize(CipherHelper ch) - throws GSSException { - return (TOKEN_HEADER_SIZE + ch.getChecksumLength()); - } + public abstract void encode(OutputStream os) throws IOException; protected final byte[] getTokenHeader() { return (tokenHeader.getBytes()); @@ -493,45 +492,14 @@ abstract class MessageToken_v2 extends Krb5Token { /** * This inner class represents the initial portion of the message token. - * It constitutes the first 16 bytes of the message token: - *

      -     *  Wrap Tokens
      -     *
      -     *     Octet no   Name        Description
      -     *    ---------------------------------------------------------------
      -     *      0..1     TOK_ID     Identification field.  Tokens emitted by
      -     *                          GSS_Wrap() contain the the hex value 05 04
      -     *                          expressed in big endian order in this field.
      -     *      2        Flags      Attributes field, as described in section
      -     *                          4.2.2.
      -     *      3        Filler     Contains the hex value FF.
      -     *      4..5     EC         Contains the "extra count" field, in big
      -     *                          endian order as described in section 4.2.3.
      -     *      6..7     RRC        Contains the "right rotation count" in big
      -     *                          endian order, as described in section 4.2.5.
      -     *      8..15    SND_SEQ    Sequence number field in clear text,
      -     *                          expressed in big endian order.
      -     *
      -     * MIC Tokens
      -     *
      -     *     Octet no   Name        Description
      -     *     -----------------------------------------------------------------
      -     *      0..1     TOK_ID     Identification field.  Tokens emitted by
      -     *                          GSS_GetMIC() contain the hex value 04 04
      -     *                          expressed in big endian order in this field.
      -     *      2        Flags      Attributes field, as described in section
      -     *                          4.2.2.
      -     *      3..7     Filler     Contains five octets of hex value FF.
      -     *      8..15    SND_SEQ    Sequence number field in clear text,
      -     *                          expressed in big endian order.
      -     * 
      + * It constitutes the first 16 bytes of the message token. */ class MessageTokenHeader { private int tokenId; private byte[] bytes = new byte[TOKEN_HEADER_SIZE]; - // new token header draft-ietf-krb-wg-gssapi-cfx-07 + // Writes a new token header public MessageTokenHeader(int tokenId, boolean conf, boolean have_acceptor_subkey) throws GSSException { @@ -542,16 +510,15 @@ abstract class MessageToken_v2 extends Krb5Token { // Flags (Note: MIT impl requires subkey) int flags = 0; - flags = ((initiator ? 0 : FLAG_SENDER_IS_ACCEPTOR) | + flags = (initiator ? 0 : FLAG_SENDER_IS_ACCEPTOR) | ((conf && tokenId != MIC_ID_v2) ? FLAG_WRAP_CONFIDENTIAL : 0) | - (have_acceptor_subkey ? FLAG_ACCEPTOR_SUBKEY : 0)); + (have_acceptor_subkey ? FLAG_ACCEPTOR_SUBKEY : 0); bytes[2] = (byte) flags; // filler bytes[3] = (byte) FILLER; - // EC and RRC fields if (tokenId == WRAP_ID_v2) { // EC field bytes[4] = (byte) 0; @@ -560,21 +527,19 @@ abstract class MessageToken_v2 extends Krb5Token { bytes[6] = (byte) 0; bytes[7] = (byte) 0; } else if (tokenId == MIC_ID_v2) { - // octets of filler FF + // more filler for MicToken for (int i = 4; i < 8; i++) { bytes[i] = (byte) FILLER; } } - // Calculate SND_SEQ - seqNumberData = new byte[8]; - writeBigEndian(seqNumber, seqNumberData, 4); - System.arraycopy(seqNumberData, 0, bytes, 8, 8); + // Calculate SND_SEQ, only write 4 bytes from the 12th position + writeBigEndian(seqNumber, bytes, 12); } /** - * Constructs a MessageTokenHeader by reading it from an InputStream - * and sets the appropriate confidentiality and quality of protection + * Reads a MessageTokenHeader from an InputStream and sets the + * appropriate confidentiality and quality of protection * values in a MessageProp structure. * * @param is the InputStream to read from @@ -588,15 +553,23 @@ abstract class MessageToken_v2 extends Krb5Token { readFully(is, bytes, 0, TOKEN_HEADER_SIZE); tokenId = readInt(bytes, TOKEN_ID_POS); + // validate Token ID + if (tokenId != tokId) { + throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, + getTokenName(tokenId) + ":" + "Defective Token ID!"); + } + /* * Validate new GSS TokenHeader */ - // valid acceptor_flag is set + + // valid acceptor_flag + // If I am initiator, the received token should have ACCEPTOR on int acceptor_flag = (initiator ? FLAG_SENDER_IS_ACCEPTOR : 0); int flag = bytes[TOKEN_FLAG_POS] & FLAG_SENDER_IS_ACCEPTOR; - if (!(flag == acceptor_flag)) { + if (flag != acceptor_flag) { throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, - getTokenName(tokenId) + ":" + "Acceptor Flag Missing!"); + getTokenName(tokenId) + ":" + "Acceptor Flag Error!"); } // check for confidentiality @@ -608,21 +581,20 @@ abstract class MessageToken_v2 extends Krb5Token { prop.setPrivacy(false); } - // validate Token ID - if (tokenId != tokId) { - throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, - getTokenName(tokenId) + ":" + "Defective Token ID!"); - } + if (tokenId == WRAP_ID_v2) { + // validate filler + if ((bytes[3] & 0xff) != FILLER) { + throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, + getTokenName(tokenId) + ":" + "Defective Token Filler!"); + } - // validate filler - if ((bytes[3] & 0xff) != FILLER) { - throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, - getTokenName(tokenId) + ":" + "Defective Token Filler!"); - } + // read EC field + ec = readBigEndian(bytes, TOKEN_EC_POS, 2); - // validate next 4 bytes of filler for MIC tokens - if (tokenId == MIC_ID_v2) { - for (int i = 4; i < 8; i++) { + // read RRC field + rrc = readBigEndian(bytes, TOKEN_RRC_POS, 2); + } else if (tokenId == MIC_ID_v2) { + for (int i = 3; i < 8; i++) { if ((bytes[i] & 0xff) != FILLER) { throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, getTokenName(tokenId) + ":" + @@ -631,18 +603,11 @@ abstract class MessageToken_v2 extends Krb5Token { } } - // read EC field - ec = readBigEndian(bytes, TOKEN_EC_POS, 2); - - // read RRC field - rrc = readBigEndian(bytes, TOKEN_RRC_POS, 2); - // set default QOP prop.setQOP(0); // sequence number - seqNumberData = new byte[8]; - System.arraycopy(bytes, 8, seqNumberData, 0, 8); + seqNumber = readBigEndian(bytes, 0, 8); } /** diff --git a/jdk/src/share/classes/sun/security/jgss/krb5/MicToken_v2.java b/jdk/src/share/classes/sun/security/jgss/krb5/MicToken_v2.java index 32390018e66..bd4a263ad3c 100644 --- a/jdk/src/share/classes/sun/security/jgss/krb5/MicToken_v2.java +++ b/jdk/src/share/classes/sun/security/jgss/krb5/MicToken_v2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 +29,11 @@ import org.ietf.jgss.*; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; /** * This class represents the new format of GSS MIC tokens, as specified - * in draft-ietf-krb-wg-gssapi-cfx-07.txt + * in RFC 4121 * * MIC tokens = { 16-byte token-header | HMAC } * where HMAC is on { plaintext | 16-byte token-header } @@ -48,12 +47,11 @@ class MicToken_v2 extends MessageToken_v2 { byte[] tokenBytes, int tokenOffset, int tokenLen, MessageProp prop) throws GSSException { super(Krb5Token.MIC_ID_v2, context, - tokenBytes, tokenOffset, tokenLen, prop); + tokenBytes, tokenOffset, tokenLen, prop); } - public MicToken_v2(Krb5Context context, - InputStream is, MessageProp prop) - throws GSSException { + public MicToken_v2(Krb5Context context, InputStream is, MessageProp prop) + throws GSSException { super(Krb5Token.MIC_ID_v2, context, is, prop); } @@ -64,7 +62,6 @@ class MicToken_v2 extends MessageToken_v2 { } public void verify(InputStream data) throws GSSException { - byte[] dataBytes = null; try { dataBytes = new byte[data.available()]; @@ -79,7 +76,7 @@ class MicToken_v2 extends MessageToken_v2 { public MicToken_v2(Krb5Context context, MessageProp prop, byte[] data, int pos, int len) - throws GSSException { + throws GSSException { super(Krb5Token.MIC_ID_v2, context); // debug("Application data to MicToken verify is [" + @@ -89,7 +86,7 @@ class MicToken_v2 extends MessageToken_v2 { } public MicToken_v2(Krb5Context context, MessageProp prop, InputStream data) - throws GSSException, IOException { + throws GSSException, IOException { super(Krb5Token.MIC_ID_v2, context); byte[] dataBytes = new byte[data.available()]; @@ -101,22 +98,21 @@ class MicToken_v2 extends MessageToken_v2 { genSignAndSeqNumber(prop, dataBytes, 0, dataBytes.length); } - public int encode(byte[] outToken, int offset) - throws IOException, GSSException { - - // Token is small - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - super.encode(bos); - byte[] token = bos.toByteArray(); - System.arraycopy(token, 0, outToken, offset, token.length); - return token.length; - } - - public byte[] encode() throws IOException, GSSException { - + public byte[] encode() throws IOException { // XXX Fine tune this initial size ByteArrayOutputStream bos = new ByteArrayOutputStream(50); encode(bos); return bos.toByteArray(); } + + public int encode(byte[] outToken, int offset) throws IOException { + byte[] token = encode(); + System.arraycopy(token, 0, outToken, offset, token.length); + return token.length; + } + + public void encode(OutputStream os) throws IOException { + encodeHeader(os); + os.write(checksum); + } } diff --git a/jdk/src/share/classes/sun/security/jgss/krb5/WrapToken.java b/jdk/src/share/classes/sun/security/jgss/krb5/WrapToken.java index 0fc988077ce..154be82d3b5 100644 --- a/jdk/src/share/classes/sun/security/jgss/krb5/WrapToken.java +++ b/jdk/src/share/classes/sun/security/jgss/krb5/WrapToken.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 @@ package sun.security.jgss.krb5; import org.ietf.jgss.*; import sun.security.jgss.*; -import java.security.GeneralSecurityException; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import sun.security.krb5.Confounder; -import sun.security.krb5.KrbException; /** * This class represents a token emitted by the GSSContext.wrap() @@ -336,24 +333,29 @@ class WrapToken extends MessageToken { // debug("\t\tNo encryption was performed by peer.\n"); readFully(is, confounder); - // Data is always a multiple of 8 with this GSS Mech - // Copy all but last block as they are - int numBlocks = (dataSize - CONFOUNDER_SIZE)/8 - 1; - int offset = dataBufOffset; - for (int i = 0; i < numBlocks; i++) { - readFully(is, dataBuf, offset, 8); - offset += 8; + if (cipherHelper.isArcFour()) { + padding = pads[1]; + readFully(is, dataBuf, dataBufOffset, dataSize-CONFOUNDER_SIZE-1); + } else { + // Data is always a multiple of 8 with this GSS Mech + // Copy all but last block as they are + int numBlocks = (dataSize - CONFOUNDER_SIZE)/8 - 1; + int offset = dataBufOffset; + for (int i = 0; i < numBlocks; i++) { + readFully(is, dataBuf, offset, 8); + offset += 8; + } + + byte[] finalBlock = new byte[8]; + readFully(is, finalBlock); + + int padSize = finalBlock[7]; + padding = pads[padSize]; + + // debug("\t\tPadding applied was: " + padSize + "\n"); + System.arraycopy(finalBlock, 0, dataBuf, offset, + finalBlock.length - padSize); } - - byte[] finalBlock = new byte[8]; - readFully(is, finalBlock); - - int padSize = finalBlock[7]; - padding = pads[padSize]; - - // debug("\t\tPadding applied was: " + padSize + "\n"); - System.arraycopy(finalBlock, 0, dataBuf, offset, - finalBlock.length - padSize); } } catch (IOException e) { throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, diff --git a/jdk/src/share/classes/sun/security/jgss/krb5/WrapToken_v2.java b/jdk/src/share/classes/sun/security/jgss/krb5/WrapToken_v2.java index 8112971682a..fa4de1dd3b4 100644 --- a/jdk/src/share/classes/sun/security/jgss/krb5/WrapToken_v2.java +++ b/jdk/src/share/classes/sun/security/jgss/krb5/WrapToken_v2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,66 +27,30 @@ package sun.security.jgss.krb5; import org.ietf.jgss.*; import sun.security.jgss.*; -import java.security.GeneralSecurityException; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.util.Arrays; import sun.security.krb5.Confounder; -import sun.security.krb5.KrbException; /** - * This class represents the new format of GSS tokens, as specified in - * draft-ietf-krb-wg-gssapi-cfx-07.txt, emitted by the GSSContext.wrap() - * call. It is a MessageToken except that it also contains plaintext or - * encrypted data at the end. A WrapToken has certain other rules that are - * peculiar to it and different from a MICToken, which is another type of - * MessageToken. All data in a WrapToken is prepended by a random counfounder - * of 16 bytes. Thus, all application data is replaced by - * (confounder || data || tokenHeader || checksum). + * This class represents the new format of GSS tokens, as specified in RFC + * 4121, emitted by the GSSContext.wrap() call. It is a MessageToken except + * that it also contains plaintext or encrypted data at the end. A WrapToken + * has certain other rules that are peculiar to it and different from a + * MICToken, which is another type of MessageToken. All data in a WrapToken is + * prepended by a random confounder of 16 bytes. Thus, all application data + * is replaced by (confounder || data || tokenHeader || checksum). * * @author Seema Malkani */ class WrapToken_v2 extends MessageToken_v2 { - /** - * The size of the random confounder used in a WrapToken. - */ - static final int CONFOUNDER_SIZE = 16; - - /* - * A token may come in either in an InputStream or as a - * byte[]. Store a reference to it in either case and process - * it's data only later when getData() is called and - * decryption/copying is needed to be done. Note that JCE can - * decrypt both from a byte[] and from an InputStream. - */ - private boolean readTokenFromInputStream = true; - private InputStream is = null; - private byte[] tokenBytes = null; - private int tokenOffset = 0; - private int tokenLen = 0; - - /* - * Application data may come from an InputStream or from a - * byte[]. However, it will always be stored and processed as a - * byte[] since - * (a) the MessageDigest class only accepts a byte[] as input and - * (b) It allows writing to an OuputStream via a CipherOutputStream. - */ - private byte[] dataBytes = null; - private int dataOffset = 0; - private int dataLen = 0; - - // the len of the token data: - // (confounder || data || tokenHeader || checksum) - private int dataSize = 0; // Accessed by CipherHelper byte[] confounder = null; - private boolean privacy = false; - private boolean initiator = true; + private final boolean privacy; /** * Constructs a WrapToken from token bytes obtained from the @@ -104,30 +68,9 @@ class WrapToken_v2 extends MessageToken_v2 { byte[] tokenBytes, int tokenOffset, int tokenLen, MessageProp prop) throws GSSException { - // Just parse the MessageToken part first super(Krb5Token.WRAP_ID_v2, context, tokenBytes, tokenOffset, tokenLen, prop); - this.readTokenFromInputStream = false; - - // rotate token bytes as per RRC - byte[] new_tokenBytes = new byte[tokenLen]; - if (rotate_left(tokenBytes, tokenOffset, new_tokenBytes, tokenLen)) { - this.tokenBytes = new_tokenBytes; - this.tokenOffset = 0; - } else { - this.tokenBytes = tokenBytes; - this.tokenOffset = tokenOffset; - } - - // Will need the token bytes again when extracting data - this.tokenLen = tokenLen; this.privacy = prop.getPrivacy(); - - dataSize = tokenLen - TOKEN_HEADER_SIZE; - - // save initiator - this.initiator = context.isInitiator(); - } /** @@ -145,27 +88,8 @@ class WrapToken_v2 extends MessageToken_v2 { InputStream is, MessageProp prop) throws GSSException { - // Just parse the MessageToken part first super(Krb5Token.WRAP_ID_v2, context, is, prop); - - // Will need the token bytes again when extracting data - this.is = is; this.privacy = prop.getPrivacy(); - - // get the token length - try { - this.tokenLen = is.available(); - } catch (IOException e) { - throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, - getTokenName(getTokenId()) - + ": " + e.getMessage()); - } - - // data size - dataSize = tokenLen - TOKEN_HEADER_SIZE; - - // save initiator - this.initiator = context.isInitiator(); } /** @@ -177,13 +101,9 @@ class WrapToken_v2 extends MessageToken_v2 { */ public byte[] getData() throws GSSException { - byte[] temp = new byte[dataSize]; + byte[] temp = new byte[tokenDataLen]; int len = getData(temp, 0); - // len obtained is after removing confounder, tokenHeader and HMAC - - byte[] retVal = new byte[len]; - System.arraycopy(temp, 0, retVal, 0, retVal.length); - return retVal; + return Arrays.copyOf(temp, len); } /** @@ -200,69 +120,26 @@ class WrapToken_v2 extends MessageToken_v2 { public int getData(byte[] dataBuf, int dataBufOffset) throws GSSException { - if (readTokenFromInputStream) - getDataFromStream(dataBuf, dataBufOffset); - else - getDataFromBuffer(dataBuf, dataBufOffset); - - int retVal = 0; - if (privacy) { - retVal = dataSize - confounder.length - - TOKEN_HEADER_SIZE - cipherHelper.getChecksumLength(); - } else { - retVal = dataSize - cipherHelper.getChecksumLength(); - } - return retVal; - } - - /** - * Helper routine to obtain the application data transmitted in - * this WrapToken. It is called if the WrapToken was constructed - * with a byte array as input. - * @param dataBuf the output buffer into which the data must be - * written - * @param dataBufOffset the offset at which to write the data - * @throws GSSException if an error occurs while decrypting any - * cipher text and checking for validity - */ - private void getDataFromBuffer(byte[] dataBuf, int dataBufOffset) - throws GSSException { - - int dataPos = tokenOffset + TOKEN_HEADER_SIZE; - int data_length = 0; - - if (dataPos + dataSize > tokenOffset + tokenLen) - throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, - "Insufficient data in " - + getTokenName(getTokenId())); // debug("WrapToken cons: data is token is [" + // getHexBytes(tokenBytes, tokenOffset, tokenLen) + "]\n"); - confounder = new byte[CONFOUNDER_SIZE]; // Do decryption if this token was privacy protected. if (privacy) { // decrypt data - cipherHelper.decryptData(this, tokenBytes, dataPos, dataSize, + cipherHelper.decryptData(this, tokenData, 0, tokenDataLen, dataBuf, dataBufOffset, getKeyUsage()); - /* - debug("\t\tDecrypted data is [" + - getHexBytes(confounder) + " " + - getHexBytes(dataBuf, dataBufOffset, - dataSize - CONFOUNDER_SIZE) + - "]\n"); - */ - data_length = dataSize - CONFOUNDER_SIZE - - TOKEN_HEADER_SIZE - cipherHelper.getChecksumLength(); + return tokenDataLen - CONFOUNDER_SIZE - + TOKEN_HEADER_SIZE - cipherHelper.getChecksumLength(); } else { // Token data is in cleartext - debug("\t\tNo encryption was performed by peer.\n"); + // debug("\t\tNo encryption was performed by peer.\n"); // data - data_length = dataSize - cipherHelper.getChecksumLength(); - System.arraycopy(tokenBytes, dataPos, + int data_length = tokenDataLen - cipherHelper.getChecksumLength(); + System.arraycopy(tokenData, 0, dataBuf, dataBufOffset, data_length); // debug("\t\tData is: " + getHexBytes(dataBuf, data_length)); @@ -274,95 +151,26 @@ class WrapToken_v2 extends MessageToken_v2 { throw new GSSException(GSSException.BAD_MIC, -1, "Corrupt checksum in Wrap token"); } + return data_length; } } /** - * Helper routine to obtain the application data transmitted in - * this WrapToken. It is called if the WrapToken was constructed - * with an Inputstream. - * @param dataBuf the output buffer into which the data must be - * written - * @param dataBufOffset the offset at which to write the data - * @throws GSSException if an error occurs while decrypting any - * cipher text and checking for validity + * Writes a WrapToken_v2 object */ - private void getDataFromStream(byte[] dataBuf, int dataBufOffset) - throws GSSException { - - int data_length = 0; - // Don't check the token length. Data will be read on demand from - // the InputStream. - // debug("WrapToken cons: data will be read from InputStream.\n"); - - confounder = new byte[CONFOUNDER_SIZE]; - - try { - // Do decryption if this token was privacy protected. - if (privacy) { - - cipherHelper.decryptData(this, is, dataSize, - dataBuf, dataBufOffset, getKeyUsage()); - - /* - debug("\t\tDecrypted data is [" + - getHexBytes(confounder) + " " + - getHexBytes(dataBuf, dataBufOffset, - dataSize - CONFOUNDER_SIZE) + - "]\n"); - */ - data_length = dataSize - CONFOUNDER_SIZE - - TOKEN_HEADER_SIZE - cipherHelper.getChecksumLength(); - } else { - - // Token data is in cleartext - debug("\t\tNo encryption was performed by peer.\n"); - readFully(is, confounder); - - // read the data - data_length = dataSize - cipherHelper.getChecksumLength(); - readFully(is, dataBuf, dataBufOffset, data_length); - - /* - * Make sure checksum is not corrupt - */ - if (!verifySign(dataBuf, dataBufOffset, data_length)) { - throw new GSSException(GSSException.BAD_MIC, -1, - "Corrupt checksum in Wrap token"); - } - } - } catch (IOException e) { - throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1, - getTokenName(getTokenId()) - + ": " + e.getMessage()); - } - - } - - public WrapToken_v2(Krb5Context context, MessageProp prop, byte[] dataBytes, int dataOffset, int dataLen) - throws GSSException { + throws GSSException { super(Krb5Token.WRAP_ID_v2, context); confounder = Confounder.bytes(CONFOUNDER_SIZE); - dataSize = confounder.length + dataLen + TOKEN_HEADER_SIZE + - cipherHelper.getChecksumLength(); - this.dataBytes = dataBytes; - this.dataOffset = dataOffset; - this.dataLen = dataLen; - - // save initiator - this.initiator = context.isInitiator(); - // debug("\nWrapToken cons: data to wrap is [" + // getHexBytes(confounder) + " " + // getHexBytes(dataBytes, dataOffset, dataLen) + "]\n"); - genSignAndSeqNumber(prop, - dataBytes, dataOffset, dataLen); + genSignAndSeqNumber(prop, dataBytes, dataOffset, dataLen); /* * If the application decides to ask for privacy when the context @@ -374,110 +182,42 @@ class WrapToken_v2 extends MessageToken_v2 { prop.setPrivacy(false); privacy = prop.getPrivacy(); - } - public void encode(OutputStream os) throws IOException, GSSException { - - super.encode(os); - - // debug("\n\nWriting data: ["); if (!privacy) { - // Wrap Tokens (without confidentiality) = // { 16 byte token_header | plaintext | 12-byte HMAC } // where HMAC is on { plaintext | token_header } - // calculate checksum - byte[] checksum = getChecksum(dataBytes, dataOffset, dataLen); - - // data - // debug(" " + getHexBytes(dataBytes, dataOffset, dataLen)); - os.write(dataBytes, dataOffset, dataLen); - - // write HMAC - // debug(" " + getHexBytes(checksum, - // cipherHelper.getChecksumLength())); - os.write(checksum); - + tokenData = new byte[dataLen + checksum.length]; + System.arraycopy(dataBytes, dataOffset, tokenData, 0, dataLen); + System.arraycopy(checksum, 0, tokenData, dataLen, checksum.length); } else { - // Wrap Tokens (with confidentiality) = // { 16 byte token_header | // Encrypt(16-byte confounder | plaintext | token_header) | // 12-byte HMAC } - cipherHelper.encryptData(this, confounder, getTokenHeader(), - dataBytes, dataOffset, dataLen, getKeyUsage(), os); - + tokenData = cipherHelper.encryptData(this, confounder, getTokenHeader(), + dataBytes, dataOffset, dataLen, getKeyUsage()); } - // debug("]\n"); } - public byte[] encode() throws IOException, GSSException { - // XXX Fine tune this initial size - ByteArrayOutputStream bos = new ByteArrayOutputStream(dataSize + 50); + public void encode(OutputStream os) throws IOException { + encodeHeader(os); + os.write(tokenData); + } + + public byte[] encode() throws IOException { + ByteArrayOutputStream bos = new ByteArrayOutputStream( + MessageToken_v2.TOKEN_HEADER_SIZE + tokenData.length); encode(bos); return bos.toByteArray(); } - public int encode(byte[] outToken, int offset) - throws IOException, GSSException { - - int retVal = 0; - - // Token header is small - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - super.encode(bos); - byte[] header = bos.toByteArray(); - System.arraycopy(header, 0, outToken, offset, header.length); - offset += header.length; - - // debug("WrapToken.encode: Writing data: ["); - if (!privacy) { - - // Wrap Tokens (without confidentiality) = - // { 16 byte token_header | plaintext | 12-byte HMAC } - // where HMAC is on { plaintext | token_header } - - // calculate checksum - byte[] checksum = getChecksum(dataBytes, dataOffset, dataLen); - - // data - // debug(" " + getHexBytes(dataBytes, dataOffset, dataLen)); - System.arraycopy(dataBytes, dataOffset, outToken, offset, - dataLen); - offset += dataLen; - - // write HMAC - // debug(" " + getHexBytes(checksum, - // cipherHelper.getChecksumLength())); - System.arraycopy(checksum, 0, outToken, offset, - cipherHelper.getChecksumLength()); - - retVal = header.length + dataLen + cipherHelper.getChecksumLength(); - } else { - - // Wrap Tokens (with confidentiality) = - // { 16 byte token_header | - // Encrypt(16-byte confounder | plaintext | token_header) | - // 12-byte HMAC } - int cLen = cipherHelper.encryptData(this, confounder, - getTokenHeader(), dataBytes, dataOffset, dataLen, - outToken, offset, getKeyUsage()); - - retVal = header.length + cLen; - // debug(getHexBytes(outToken, offset, dataSize)); - } - - // debug("]\n"); - - // %%% assume that plaintext length == ciphertext len - return retVal; - - } - - protected int getKrb5TokenSize() throws GSSException { - return (getTokenSize() + dataSize); + public int encode(byte[] outToken, int offset) throws IOException { + byte[] token = encode(); + System.arraycopy(token, 0, outToken, offset, token.length); + return token.length; } // This implementation is way to conservative. And it certainly @@ -485,6 +225,7 @@ class WrapToken_v2 extends MessageToken_v2 { static int getSizeLimit(int qop, boolean confReq, int maxTokenSize, CipherHelper ch) throws GSSException { return (GSSHeader.getMaxMechTokenSize(OID, maxTokenSize) - - (getTokenSize(ch) + CONFOUNDER_SIZE) - 8 /* safety */); + (TOKEN_HEADER_SIZE + ch.getChecksumLength() + CONFOUNDER_SIZE) + - 8 /* safety */); } } diff --git a/jdk/src/share/classes/sun/security/krb5/Config.java b/jdk/src/share/classes/sun/security/krb5/Config.java index 21fb4cea7f5..09017bf7a3e 100644 --- a/jdk/src/share/classes/sun/security/krb5/Config.java +++ b/jdk/src/share/classes/sun/security/krb5/Config.java @@ -111,7 +111,7 @@ public class Config { public static synchronized void refresh() throws KrbException { singleton = new Config(); KeyTab.refresh(); - KrbKdcReq.initStatic(); + KdcComm.initStatic(); } @@ -528,7 +528,7 @@ public class Config { } }))); String Line; - Vector v = new Vector (); + Vector v = new Vector<>(); String previous = null; while ((Line = br.readLine()) != null) { // ignore comments and blank line in the configuration file. @@ -589,7 +589,7 @@ public class Config { throw new KrbException("I/O error while reading" + " configuration file."); } - Hashtable table = new Hashtable (); + Hashtable table = new Hashtable<>(); for (int i = 0; i < v.size(); i++) { String line = v.elementAt(i).trim(); if (line.equalsIgnoreCase("[realms]")) { @@ -598,7 +598,7 @@ public class Config { if ((count == v.size()) || (v.elementAt(count).startsWith("["))) { Hashtable>> temp = - new Hashtable>>(); + new Hashtable<>(); temp = parseRealmField(v, i + 1, count); table.put("realms", temp); i = count - 1; @@ -611,7 +611,7 @@ public class Config { if ((count == v.size()) || (v.elementAt(count).startsWith("["))) { Hashtable>> temp = - new Hashtable>>(); + new Hashtable<>(); temp = parseRealmField(v, i + 1, count); table.put("capaths", temp); i = count - 1; @@ -729,7 +729,7 @@ public class Config { * Parses key-value pairs under a stanza name. */ private Hashtable parseField(Vector v, int start, int end) { - Hashtable table = new Hashtable (); + Hashtable table = new Hashtable<>(); String line; for (int i = start; i < end; i++) { line = v.elementAt(i); @@ -751,7 +751,7 @@ public class Config { * information for the realm given within a pair of braces. */ private Hashtable>> parseRealmField(Vector v, int start, int end) { - Hashtable>> table = new Hashtable>> (); + Hashtable>> table = new Hashtable<>(); String line; for (int i = start; i < end; i++) { line = v.elementAt(i).trim(); @@ -791,10 +791,9 @@ public class Config { * Parses key-value pairs within each braces under [realms]. */ private Hashtable> parseRealmFieldEx(Vector v, int start, int end) { - Hashtable> table = - new Hashtable> (); - Vector keyVector = new Vector (); - Vector nameVector = new Vector (); + Hashtable> table = new Hashtable<>(); + Vector keyVector = new Vector<>(); + Vector nameVector = new Vector<>(); String line = ""; String key; for (int i = start; i < end; i++) { @@ -899,7 +898,7 @@ public class Config { } st = new StringTokenizer(default_enctypes, delim); int len = st.countTokens(); - ArrayList ls = new ArrayList (len); + ArrayList ls = new ArrayList<>(len); int type; for (int i = 0; i < len; i++) { type = getType(st.nextToken()); diff --git a/jdk/src/share/classes/sun/security/krb5/Credentials.java b/jdk/src/share/classes/sun/security/krb5/Credentials.java index 6896aa18e95..86dc3a01668 100644 --- a/jdk/src/share/classes/sun/security/krb5/Credentials.java +++ b/jdk/src/share/classes/sun/security/krb5/Credentials.java @@ -347,94 +347,6 @@ public class Credentials { } } - /** - * Returns a TGT for the given client principal via an AS-Exchange. - * This method causes pre-authentication data to be sent in the - * AS-REQ. - * - * @param princ the client principal. This value cannot be null. - * @param secretKey the secret key of the client principal.This value - * cannot be null. - * @returns the TGT credentials - */ - public static Credentials acquireTGT(PrincipalName princ, - EncryptionKey[] secretKeys, - char[] password) - throws KrbException, IOException { - - if (princ == null) - throw new IllegalArgumentException( - "Cannot have null principal to do AS-Exchange"); - - if (secretKeys == null) - throw new IllegalArgumentException( - "Cannot have null secretKey to do AS-Exchange"); - - KrbAsRep asRep = null; - try { - asRep = sendASRequest(princ, secretKeys, null); - } catch (KrbException ke) { - if ((ke.returnCode() == Krb5.KDC_ERR_PREAUTH_FAILED) || - (ke.returnCode() == Krb5.KDC_ERR_PREAUTH_REQUIRED)) { - // process pre-auth info - if (DEBUG) { - System.out.println("AcquireTGT: PREAUTH FAILED/REQUIRED," + - " re-send AS-REQ"); - } - - KRBError error = ke.getError(); - // update salt in PrincipalName - String newSalt = error.getSalt(); - if (newSalt != null && newSalt.length() > 0) { - princ.setSalt(newSalt); - } - - // refresh keys - if (password != null) { - secretKeys = EncryptionKey.acquireSecretKeys(password, - princ.getSalt(), true, - error.getEType(), error.getParams()); - } - asRep = sendASRequest(princ, secretKeys, ke.getError()); - } else { - throw ke; - } - } - return asRep.getCreds(); - } - - /** - * Sends the AS-REQ - */ - private static KrbAsRep sendASRequest(PrincipalName princ, - EncryptionKey[] secretKeys, KRBError error) - throws KrbException, IOException { - - // %%% - KrbAsReq asReq = null; - if (error == null) { - asReq = new KrbAsReq(princ, secretKeys); - } else { - asReq = new KrbAsReq(princ, secretKeys, true, - error.getEType(), error.getSalt(), error.getParams()); - } - - String kdc = null; - KrbAsRep asRep = null; - try { - kdc = asReq.send(); - asRep = asReq.getReply(secretKeys); - } catch (KrbException ke) { - if (ke.returnCode() == Krb5.KRB_ERR_RESPONSE_TOO_BIG) { - asReq.send(princ.getRealmString(), kdc, true); - asRep = asReq.getReply(secretKeys); - } else { - throw ke; - } - } - return asRep; - } - /** * Acquires default credentials. *
      The possible locations for default credentials cache is searched in @@ -529,29 +441,6 @@ public class Credentials { return CredentialsUtil.acquireServiceCreds(service, ccreds); } - - /* - * This method does the real job to request the service credential. - */ - - private static Credentials serviceCreds(ServiceName service, - Credentials ccreds) - throws KrbException, IOException { - return new KrbTgsReq( - new KDCOptions(), - ccreds, - service, - null, // KerberosTime from - null, // KerberosTime till - null, // KerberosTime rtime - null, // int[] eTypes - null, // HostAddresses addresses - null, // AuthorizationData - null, // Ticket[] additionalTickets - null // EncryptionKey subSessionKey - ).sendAndGetCreds(); - } - public CredentialsCache getCache() { return cache; } diff --git a/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java b/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java index ff920af8e99..8ce51c0c659 100644 --- a/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java +++ b/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java @@ -156,6 +156,22 @@ public class EncryptionKey return ktab.readServiceKeys(princ); } + /** + * Obtains a key for a given etype with salt and optional s2kparams + * @param password NOT null + * @param salt NOT null + * @param etype + * @param s2kparams can be NULL + */ + public static EncryptionKey acquireSecretKey(char[] password, + String salt, int etype, byte[] s2kparams) + throws KrbException { + + return new EncryptionKey( + stringToKey(password, salt, s2kparams, etype), + etype, null); + } + /** * Generate a list of keys using the given principal and password. * Construct a key for each configured etype. @@ -169,19 +185,8 @@ public class EncryptionKey * as the default in that case. If default_tkt_enctypes was set in * the libdefaults of krb5.conf, then use that sequence. */ - // Used in Krb5LoginModule public static EncryptionKey[] acquireSecretKeys(char[] password, - String salt) throws KrbException { - return (acquireSecretKeys(password, salt, false, 0, null)); - } - - /** - * Generates a list of keys using the given principal, password, - * and the pre-authentication values. - */ - public static EncryptionKey[] acquireSecretKeys(char[] password, - String salt, boolean pa_exists, int pa_etype, byte[] pa_s2kparams) - throws KrbException { + String salt) throws KrbException { int[] etypes = EType.getDefaults("default_tkt_enctypes"); if (etypes == null) { @@ -191,10 +196,8 @@ public class EncryptionKey EncryptionKey[] encKeys = new EncryptionKey[etypes.length]; for (int i = 0; i < etypes.length; i++) { if (EType.isSupported(etypes[i])) { - byte[] s2kparams = (pa_exists && etypes[i] == pa_etype) - ? pa_s2kparams : null; encKeys[i] = new EncryptionKey( - stringToKey(password, salt, s2kparams, etypes[i]), + stringToKey(password, salt, null, etypes[i]), etypes[i], null); } else { if (DEBUG) { diff --git a/jdk/src/share/classes/sun/security/krb5/KrbKdcReq.java b/jdk/src/share/classes/sun/security/krb5/KdcComm.java similarity index 83% rename from jdk/src/share/classes/sun/security/krb5/KrbKdcReq.java rename to jdk/src/share/classes/sun/security/krb5/KdcComm.java index 9f968014ea1..bb113392db1 100644 --- a/jdk/src/share/classes/sun/security/krb5/KrbKdcReq.java +++ b/jdk/src/share/classes/sun/security/krb5/KdcComm.java @@ -31,13 +31,11 @@ package sun.security.krb5; -import java.security.AccessController; import java.security.PrivilegedAction; import java.security.Security; import java.util.Locale; import sun.security.krb5.internal.Krb5; -import sun.security.krb5.internal.UDPClient; -import sun.security.krb5.internal.TCPClient; +import sun.security.krb5.internal.NetClient; import java.io.IOException; import java.net.SocketTimeoutException; import java.util.StringTokenizer; @@ -48,8 +46,13 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.HashSet; +import sun.security.krb5.internal.KRBError; -public abstract class KrbKdcReq { +/** + * KDC-REQ/KDC-REP communication. No more base class for KrbAsReq and + * KrbTgsReq. This class is now communication only. + */ +public final class KdcComm { // The following settings can be configured in [libdefaults] // section of krb5.conf, which are global for all realms. Each of @@ -161,20 +164,23 @@ public abstract class KrbKdcReq { KdcAccessibility.reset(); } - protected byte[] obuf; - protected byte[] ibuf; - /** - * Sends the provided data to the KDC of the specified realm. - * Returns the response from the KDC. - * Default realm/KDC is used if realm is null. - * @param realm the realm of the KDC where data is to be sent. - * @returns the kdc to which the AS request was sent to - * @exception InterruptedIOException if timeout expires - * @exception KrbException + * The instance fields */ + private String realm; - public String send(String realm) + public KdcComm(String realm) throws KrbException { + if (realm == null) { + realm = Config.getInstance().getDefaultRealm(); + if (realm == null) { + throw new KrbException(Krb5.KRB_ERR_GENERIC, + "Cannot find default realm"); + } + } + this.realm = realm; + } + + public byte[] send(byte[] obuf) throws IOException, KrbException { int udpPrefLimit = getRealmSpecificValue( realm, "udp_preference_limit", defaultUdpPrefLimit); @@ -182,10 +188,10 @@ public abstract class KrbKdcReq { boolean useTCP = (udpPrefLimit > 0 && (obuf != null && obuf.length > udpPrefLimit)); - return (send(realm, useTCP)); + return send(obuf, useTCP); } - public String send(String realm, boolean useTCP) + private byte[] send(byte[] obuf, boolean useTCP) throws IOException, KrbException { if (obuf == null) @@ -206,10 +212,21 @@ public abstract class KrbKdcReq { throw new KrbException("Cannot get kdc for realm " + realm); } String tempKdc = null; // may include the port number also + byte[] ibuf = null; for (String tmp: KdcAccessibility.list(kdcList)) { tempKdc = tmp; try { - send(realm,tempKdc,useTCP); + ibuf = send(obuf,tempKdc,useTCP); + KRBError ke = null; + try { + ke = new KRBError(ibuf); + } catch (Exception e) { + // OK + } + if (ke != null && ke.getErrorCode() == + Krb5.KRB_ERR_RESPONSE_TOO_BIG) { + ibuf = send(obuf, tempKdc, true); + } KdcAccessibility.removeBad(tempKdc); break; } catch (Exception e) { @@ -229,16 +246,16 @@ public abstract class KrbKdcReq { throw (KrbException) savedException; } } - return tempKdc; + return ibuf; } // send the AS Request to the specified KDC - public void send(String realm, String tempKdc, boolean useTCP) + private byte[] send(byte[] obuf, String tempKdc, boolean useTCP) throws IOException, KrbException { if (obuf == null) - return; + return null; int port = Krb5.KDC_INET_DEFAULT_PORT; int retries = getRealmSpecificValue( @@ -303,11 +320,12 @@ public abstract class KrbKdcReq { KdcCommunication kdcCommunication = new KdcCommunication(kdc, port, useTCP, timeout, retries, obuf); try { - ibuf = AccessController.doPrivileged(kdcCommunication); + byte[] ibuf = AccessController.doPrivileged(kdcCommunication); if (DEBUG) { System.out.println(">>> KrbKdcReq send: #bytes read=" + (ibuf != null ? ibuf.length : 0)); } + return ibuf; } catch (PrivilegedActionException e) { Exception wrappedException = e.getException(); if (wrappedException instanceof IOException) { @@ -316,10 +334,6 @@ public abstract class KrbKdcReq { throw (KrbException) wrappedException; } } - if (DEBUG) { - System.out.println(">>> KrbKdcReq send: #bytes read=" - + (ibuf != null ? ibuf.length : 0)); - } } private static class KdcCommunication @@ -349,12 +363,16 @@ public abstract class KrbKdcReq { byte[] ibuf = null; - if (useTCP) { - TCPClient kdcClient = new TCPClient(kdc, port); + for (int i=1; i <= retries; i++) { + String proto = useTCP?"TCP":"UDP"; + NetClient kdcClient = NetClient.getInstance( + proto, kdc, port, timeout); if (DEBUG) { System.out.println(">>> KDCCommunication: kdc=" + kdc - + " TCP:" - + port + + " " + proto + ":" + + port + ", timeout=" + + timeout + + ",Attempt =" + i + ", #bytes=" + obuf.length); } try { @@ -366,51 +384,19 @@ public abstract class KrbKdcReq { * And get a response. */ ibuf = kdcClient.receive(); + break; + } catch (SocketTimeoutException se) { + if (DEBUG) { + System.out.println ("SocketTimeOutException with " + + "attempt: " + i); + } + if (i == retries) { + ibuf = null; + throw se; + } } finally { kdcClient.close(); } - - } else { - // For each KDC we try defaultKdcRetryLimit times to - // get the response - for (int i=1; i <= retries; i++) { - UDPClient kdcClient = new UDPClient(kdc, port, timeout); - - if (DEBUG) { - System.out.println(">>> KDCCommunication: kdc=" + kdc - + (useTCP ? " TCP:":" UDP:") - + port + ", timeout=" - + timeout - + ",Attempt =" + i - + ", #bytes=" + obuf.length); - } - try { - /* - * Send the data to the kdc. - */ - - kdcClient.send(obuf); - - /* - * And get a response. - */ - try { - ibuf = kdcClient.receive(); - break; - } catch (SocketTimeoutException se) { - if (DEBUG) { - System.out.println ("SocketTimeOutException with " + - "attempt: " + i); - } - if (i == retries) { - ibuf = null; - throw se; - } - } - } finally { - kdcClient.close(); - } - } } return ibuf; } @@ -476,7 +462,7 @@ public abstract class KrbKdcReq { */ static class KdcAccessibility { // Known bad KDCs - private static Set bads = new HashSet(); + private static Set bads = new HashSet<>(); private static synchronized void addBad(String kdc) { if (DEBUG) { @@ -506,9 +492,9 @@ public abstract class KrbKdcReq { // Returns a preferred KDC list by putting the bad ones at the end private static synchronized String[] list(String kdcList) { StringTokenizer st = new StringTokenizer(kdcList); - List list = new ArrayList(); + List list = new ArrayList<>(); if (badPolicy == BpType.TRY_LAST) { - List badkdcs = new ArrayList(); + List badkdcs = new ArrayList<>(); while (st.hasMoreTokens()) { String t = st.nextToken(); if (bads.contains(t)) badkdcs.add(t); diff --git a/jdk/src/share/classes/sun/security/krb5/KrbAsRep.java b/jdk/src/share/classes/sun/security/krb5/KrbAsRep.java index 709e4410a0a..c05d8bd08bf 100644 --- a/jdk/src/share/classes/sun/security/krb5/KrbAsRep.java +++ b/jdk/src/share/classes/sun/security/krb5/KrbAsRep.java @@ -36,25 +36,24 @@ import sun.security.krb5.internal.crypto.KeyUsage; import sun.security.krb5.internal.crypto.EType; import sun.security.util.*; import java.io.IOException; +import java.util.Objects; /** * This class encapsulates a AS-REP message that the KDC sends to the * client. */ -public class KrbAsRep extends KrbKdcRep { +class KrbAsRep extends KrbKdcRep { - private ASRep rep; - private Credentials creds; + private ASRep rep; // The AS-REP message + private Credentials creds; // The Credentials provide by the AS-REP + // message, created by initiator after calling + // the decrypt() method private boolean DEBUG = Krb5.DEBUG; - KrbAsRep(byte[] ibuf, EncryptionKey[] keys, KrbAsReq asReq) throws - KrbException, Asn1Exception, IOException { - if (keys == null) - throw new KrbException(Krb5.API_INVALID_ARG); + KrbAsRep(byte[] ibuf) throws + KrbException, Asn1Exception, IOException { DerValue encoding = new DerValue(ibuf); - ASReq req = asReq.getMessage(); - ASRep rep = null; try { rep = new ASRep(encoding); } catch (Asn1Exception e) { @@ -83,25 +82,77 @@ public class KrbAsRep extends KrbKdcRep { ke.initCause(e); throw ke; } + } + // KrbAsReqBuilder need to read back the PA for key generation + PAData[] getPA() { + return rep.pAData; + } + + /** + * Called by KrbAsReqBuilder to resolve a AS-REP message using keys. + * @param keys user provided keys, not null + * @param asReq the original AS-REQ sent, used to validate AS-REP + */ + void decryptUsingKeys(EncryptionKey[] keys, KrbAsReq asReq) + throws KrbException, Asn1Exception, IOException { + EncryptionKey dkey = null; int encPartKeyType = rep.encPart.getEType(); - EncryptionKey dkey = EncryptionKey.findKey(encPartKeyType, keys); - + Integer encPartKvno = rep.encPart.kvno; + try { + dkey = EncryptionKey.findKey(encPartKeyType, encPartKvno, keys); + } catch (KrbException ke) { + if (ke.returnCode() == Krb5.KRB_AP_ERR_BADKEYVER) { + // Fallback to no kvno. In some cases, keytab is generated + // not by sysadmin but Java's ktab command + dkey = EncryptionKey.findKey(encPartKeyType, keys); + } + } if (dkey == null) { throw new KrbException(Krb5.API_INVALID_ARG, - "Cannot find key of appropriate type to decrypt AS REP - " + - EType.toString(encPartKeyType)); + "Cannot find key for type/kvno to decrypt AS REP - " + + EType.toString(encPartKeyType) + "/" + encPartKvno); } + decrypt(dkey, asReq); + } + /** + * Called by KrbAsReqBuilder to resolve a AS-REP message using a password. + * @param password user provided password. not null + * @param asReq the original AS-REQ sent, used to validate AS-REP + * @param cname the user principal name, used to provide salt + */ + void decryptUsingPassword(char[] password, + KrbAsReq asReq, PrincipalName cname) + throws KrbException, Asn1Exception, IOException { + int encPartKeyType = rep.encPart.getEType(); + PAData.SaltAndParams snp = + PAData.getSaltAndParams(encPartKeyType, rep.pAData); + EncryptionKey dkey = null; + dkey = EncryptionKey.acquireSecretKey(password, + snp.salt == null ? cname.getSalt() : snp.salt, + encPartKeyType, + snp.params); + decrypt(dkey, asReq); + } + + /** + * Decrypts encrypted content inside AS-REP. Called by initiator. + * @param dkey the decryption key to use + * @param asReq the original AS-REQ sent, used to validate AS-REP + */ + private void decrypt(EncryptionKey dkey, KrbAsReq asReq) + throws KrbException, Asn1Exception, IOException { byte[] enc_as_rep_bytes = rep.encPart.decrypt(dkey, KeyUsage.KU_ENC_AS_REP_PART); byte[] enc_as_rep_part = rep.encPart.reset(enc_as_rep_bytes); - encoding = new DerValue(enc_as_rep_part); + DerValue encoding = new DerValue(enc_as_rep_part); EncASRepPart enc_part = new EncASRepPart(encoding); rep.ticket.sname.setRealm(rep.ticket.realm); rep.encKDCRepPart = enc_part; + ASReq req = asReq.getMessage(); check(req, rep); creds = new Credentials( @@ -119,17 +170,13 @@ public class KrbAsRep extends KrbKdcRep { System.out.println(">>> KrbAsRep cons in KrbAsReq.getReply " + req.reqBody.cname.getNameString()); } - - this.rep = rep; - this.creds = creds; } - public Credentials getCreds() { - return creds; + Credentials getCreds() { + return Objects.nonNull(creds, "Creds not available yet."); } - // made public for Kinit - public sun.security.krb5.internal.ccache.Credentials setCredentials() { + sun.security.krb5.internal.ccache.Credentials getCCreds() { return new sun.security.krb5.internal.ccache.Credentials(rep); } } diff --git a/jdk/src/share/classes/sun/security/krb5/KrbAsReq.java b/jdk/src/share/classes/sun/security/krb5/KrbAsReq.java index 77f3798332f..1c2dfdf94db 100644 --- a/jdk/src/share/classes/sun/security/krb5/KrbAsReq.java +++ b/jdk/src/share/classes/sun/security/krb5/KrbAsReq.java @@ -32,290 +32,38 @@ package sun.security.krb5; import sun.security.krb5.internal.*; -import sun.security.krb5.internal.crypto.EType; import sun.security.krb5.internal.crypto.Nonce; import sun.security.krb5.internal.crypto.KeyUsage; -import sun.security.util.*; import java.io.IOException; -import java.io.ByteArrayInputStream; -import java.net.UnknownHostException; -import java.util.StringTokenizer; /** * This class encapsulates the KRB-AS-REQ message that the client * sends to the KDC. */ -public class KrbAsReq extends KrbKdcReq { - private PrincipalName princName; +public class KrbAsReq { private ASReq asReqMessg; private boolean DEBUG = Krb5.DEBUG; - private static KDCOptions defaultKDCOptions = new KDCOptions(); - - // pre-auth info - private boolean PA_ENC_TIMESTAMP_REQUIRED = false; - private boolean pa_exists = false; - private int pa_etype = 0; - private String pa_salt = null; - private byte[] pa_s2kparams = null; - - // default is address-less tickets - private boolean KDC_EMPTY_ADDRESSES_ALLOWED = true; /** - * Creates a KRB-AS-REQ to send to the default KDC - * @throws KrbException - * @throws IOException + * Constructs an AS-REQ message. */ - // Called by Credentials - KrbAsReq(PrincipalName principal, EncryptionKey[] keys) - throws KrbException, IOException { - this(keys, // for pre-authentication - false, 0, null, null, // pre-auth values - defaultKDCOptions, - principal, - null, // PrincipalName sname - null, // KerberosTime from - null, // KerberosTime till - null, // KerberosTime rtime - null, // int[] eTypes - null, // HostAddresses addresses - null); // Ticket[] additionalTickets - } + // Can be null? has default? + public KrbAsReq(EncryptionKey pakey, // ok + KDCOptions options, // ok, new KDCOptions() + PrincipalName cname, // NO and must have realm + PrincipalName sname, // ok, krgtgt@CREALM + KerberosTime from, // ok + KerberosTime till, // ok, will use + KerberosTime rtime, // ok + int[] eTypes, // NO + HostAddresses addresses // ok + ) + throws KrbException, IOException { - /** - * Creates a KRB-AS-REQ to send to the default KDC - * with pre-authentication values - */ - KrbAsReq(PrincipalName principal, EncryptionKey[] keys, - boolean pa_exists, int etype, String salt, byte[] s2kparams) - throws KrbException, IOException { - this(keys, // for pre-authentication - pa_exists, etype, salt, s2kparams, // pre-auth values - defaultKDCOptions, - principal, - null, // PrincipalName sname - null, // KerberosTime from - null, // KerberosTime till - null, // KerberosTime rtime - null, // int[] eTypes - null, // HostAddresses addresses - null); // Ticket[] additionalTickets - } - - private static int[] getETypesFromKeys(EncryptionKey[] keys) { - int[] types = new int[keys.length]; - for (int i = 0; i < keys.length; i++) { - types[i] = keys[i].getEType(); - } - return types; - } - - // update with pre-auth info - public void updatePA(int etype, String salt, byte[] params, PrincipalName name) { - // set the pre-auth values - pa_exists = true; - pa_etype = etype; - pa_salt = salt; - pa_s2kparams = params; - - // update salt in PrincipalName - if (salt != null && salt.length() > 0) { - name.setSalt(salt); - if (DEBUG) { - System.out.println("Updated salt from pre-auth = " + name.getSalt()); - } + if (options == null) { + options = new KDCOptions(); } - PA_ENC_TIMESTAMP_REQUIRED = true; - } - - // Used by Kinit - public KrbAsReq( - char[] password, - KDCOptions options, - PrincipalName cname, - PrincipalName sname, - KerberosTime from, - KerberosTime till, - KerberosTime rtime, - int[] eTypes, - HostAddresses addresses, - Ticket[] additionalTickets) - throws KrbException, IOException { - this(password, - false, 0, null, null, // pre-auth values - options, - cname, - sname, // PrincipalName sname - from, // KerberosTime from - till, // KerberosTime till - rtime, // KerberosTime rtime - eTypes, // int[] eTypes - addresses, // HostAddresses addresses - additionalTickets); // Ticket[] additionalTickets - } - - // Used by Kinit - public KrbAsReq( - char[] password, - boolean pa_exists, - int etype, - String salt, - byte[] s2kparams, - KDCOptions options, - PrincipalName cname, - PrincipalName sname, - KerberosTime from, - KerberosTime till, - KerberosTime rtime, - int[] eTypes, - HostAddresses addresses, - Ticket[] additionalTickets) - throws KrbException, IOException { - - EncryptionKey[] keys = null; - - // update with preauth info - if (pa_exists) { - updatePA(etype, salt, s2kparams, cname); - } - - if (password != null) { - keys = EncryptionKey.acquireSecretKeys(password, cname.getSalt(), pa_exists, - pa_etype, pa_s2kparams); - } - if (DEBUG) { - System.out.println(">>>KrbAsReq salt is " + cname.getSalt()); - } - - try { - init( - keys, - options, - cname, - sname, - from, - till, - rtime, - eTypes, - addresses, - additionalTickets); - } - finally { - /* - * Its ok to destroy the key here because we created it and are - * now done with it. - */ - if (keys != null) { - for (int i = 0; i < keys.length; i++) { - keys[i].destroy(); - } - } - } - } - - // Used in Kinit - public KrbAsReq( - EncryptionKey[] keys, - KDCOptions options, - PrincipalName cname, - PrincipalName sname, - KerberosTime from, - KerberosTime till, - KerberosTime rtime, - int[] eTypes, - HostAddresses addresses, - Ticket[] additionalTickets) - throws KrbException, IOException { - this(keys, - false, 0, null, null, // pre-auth values - options, - cname, - sname, // PrincipalName sname - from, // KerberosTime from - till, // KerberosTime till - rtime, // KerberosTime rtime - eTypes, // int[] eTypes - addresses, // HostAddresses addresses - additionalTickets); // Ticket[] additionalTickets - } - - // Used by Kinit - public KrbAsReq( - EncryptionKey[] keys, - boolean pa_exists, - int etype, - String salt, - byte[] s2kparams, - KDCOptions options, - PrincipalName cname, - PrincipalName sname, - KerberosTime from, - KerberosTime till, - KerberosTime rtime, - int[] eTypes, - HostAddresses addresses, - Ticket[] additionalTickets) - throws KrbException, IOException { - - // update with preauth info - if (pa_exists) { - // update pre-auth info - updatePA(etype, salt, s2kparams, cname); - - if (DEBUG) { - System.out.println(">>>KrbAsReq salt is " + cname.getSalt()); - } - } - - init( - keys, - options, - cname, - sname, - from, - till, - rtime, - eTypes, - addresses, - additionalTickets); - } - - /* - private KrbAsReq(KDCOptions options, - PrincipalName cname, - PrincipalName sname, - KerberosTime from, - KerberosTime till, - KerberosTime rtime, - int[] eTypes, - HostAddresses addresses, - Ticket[] additionalTickets) - throws KrbException, IOException { - init(null, - options, - cname, - sname, - from, - till, - rtime, - eTypes, - addresses, - additionalTickets); - } -*/ - - private void init(EncryptionKey[] keys, - KDCOptions options, - PrincipalName cname, - PrincipalName sname, - KerberosTime from, - KerberosTime till, - KerberosTime rtime, - int[] eTypes, - HostAddresses addresses, - Ticket[] additionalTickets ) - throws KrbException, IOException { // check if they are valid arguments. The optional fields should be // consistent with settings in KDCOptions. Mar 17 2000 @@ -341,189 +89,66 @@ public class KrbAsReq extends KrbKdcReq { if (rtime != null) rtime = null; } - princName = cname; - int[] tktETypes = EType.getDefaults("default_tkt_enctypes", keys); PAData[] paData = null; - if (PA_ENC_TIMESTAMP_REQUIRED) { - EncryptionKey key = null; - if (pa_etype != EncryptedData.ETYPE_NULL) { - if (DEBUG) { - System.out.println("Pre-Authenticaton: find key for etype = " + pa_etype); - } - key = EncryptionKey.findKey(pa_etype, keys); - } else { - if (tktETypes.length > 0) { - key = EncryptionKey.findKey(tktETypes[0], keys); - } - } - if (DEBUG) { - System.out.println("AS-REQ: Add PA_ENC_TIMESTAMP now"); - } + if (pakey != null) { PAEncTSEnc ts = new PAEncTSEnc(); byte[] temp = ts.asn1Encode(); - if (key != null) { - // Use first key in list - EncryptedData encTs = new EncryptedData(key, temp, - KeyUsage.KU_PA_ENC_TS); - paData = new PAData[1]; - paData[0] = new PAData( Krb5.PA_ENC_TIMESTAMP, - encTs.asn1Encode()); - } + EncryptedData encTs = new EncryptedData(pakey, temp, + KeyUsage.KU_PA_ENC_TS); + paData = new PAData[1]; + paData[0] = new PAData( Krb5.PA_ENC_TIMESTAMP, + encTs.asn1Encode()); + } + + if (cname.getRealm() == null) { + throw new RealmException(Krb5.REALM_NULL, + "default realm not specified "); } if (DEBUG) { - System.out.println(">>> KrbAsReq calling createMessage"); - } - - if (eTypes == null) { - eTypes = tktETypes; + System.out.println(">>> KrbAsReq creating message"); } // check to use addresses in tickets - if (Config.getInstance().useAddresses()) { - KDC_EMPTY_ADDRESSES_ALLOWED = false; - } - // get the local InetAddress if required - if (addresses == null && !KDC_EMPTY_ADDRESSES_ALLOWED) { + if (addresses == null && Config.getInstance().useAddresses()) { addresses = HostAddresses.getLocalAddresses(); } - asReqMessg = createMessage( - paData, - options, - cname, - cname.getRealm(), - sname, - from, - till, - rtime, - eTypes, - addresses, - additionalTickets); - obuf = asReqMessg.asn1Encode(); - } - - /** - * Returns an AS-REP message corresponding to the AS-REQ that - * was sent. - * @param password The password that will be used to derive the - * secret key that will decrypt the AS-REP from the KDC. - * @exception KrbException if an error occurs while reading the data. - * @exception IOException if an I/O error occurs while reading encoded data. - */ - public KrbAsRep getReply(char[] password) - throws KrbException, IOException { - - if (password == null) - throw new KrbException(Krb5.API_INVALID_ARG); - KrbAsRep temp = null; - EncryptionKey[] keys = null; - try { - keys = EncryptionKey.acquireSecretKeys(password, - princName.getSalt(), pa_exists, pa_etype, pa_s2kparams); - temp = getReply(keys); - } finally { - /* - * Its ok to destroy the key here because we created it and are - * now done with it. - */ - if (keys != null) { - for (int i = 0; i < keys.length; i++) { - keys[i].destroy(); - } - } - } - return temp; - } - - /** - * Sends an AS request to the realm of the client. - * returns the KDC hostname that the request was sent to - */ - - public String send() - throws IOException, KrbException - { - String realmStr = null; - if (princName != null) - realmStr = princName.getRealmString(); - - return (send(realmStr)); - } - - /** - * Returns an AS-REP message corresponding to the AS-REQ that - * was sent. - * @param keys The secret keys that will decrypt the AS-REP from - * the KDC; key selected depends on etype used to encrypt data. - * @exception KrbException if an error occurs while reading the data. - * @exception IOException if an I/O error occurs while reading encoded - * data. - * - */ - public KrbAsRep getReply(EncryptionKey[] keys) - throws KrbException,IOException { - return new KrbAsRep(ibuf, keys, this); - } - - private ASReq createMessage( - PAData[] paData, - KDCOptions kdc_options, - PrincipalName cname, - Realm crealm, - PrincipalName sname, - KerberosTime from, - KerberosTime till, - KerberosTime rtime, - int[] eTypes, - HostAddresses addresses, - Ticket[] additionalTickets - ) throws Asn1Exception, KrbApErrException, - RealmException, UnknownHostException, IOException { - - if (DEBUG) { - System.out.println(">>> KrbAsReq in createMessage"); - } - - PrincipalName req_sname = null; if (sname == null) { - if (crealm == null) { - throw new RealmException(Krb5.REALM_NULL, - "default realm not specified "); - } - req_sname = new PrincipalName( - "krbtgt" + - PrincipalName.NAME_COMPONENT_SEPARATOR + - crealm.toString(), - PrincipalName.KRB_NT_SRV_INST); - } else - req_sname = sname; - - KerberosTime req_till = null; - if (till == null) { - req_till = new KerberosTime(); - } else { - req_till = till; + sname = new PrincipalName("krbtgt" + + PrincipalName.NAME_COMPONENT_SEPARATOR + + cname.getRealmAsString(), + PrincipalName.KRB_NT_SRV_INST); } - KDCReqBody kdc_req_body = new KDCReqBody(kdc_options, + if (till == null) { + till = new KerberosTime(0); // Choose KDC maximum allowed + } + + // enc-authorization-data and additional-tickets never in AS-REQ + KDCReqBody kdc_req_body = new KDCReqBody(options, cname, - crealm, - req_sname, + cname.getRealm(), + sname, from, - req_till, + till, rtime, Nonce.value(), eTypes, addresses, null, - additionalTickets); + null); - return new ASReq( + asReqMessg = new ASReq( paData, kdc_req_body); } + byte[] encoding() throws IOException, Asn1Exception { + return asReqMessg.asn1Encode(); + } + + // Used by KrbAsRep to validate AS-REP ASReq getMessage() { return asReqMessg; } diff --git a/jdk/src/share/classes/sun/security/krb5/KrbAsReqBuilder.java b/jdk/src/share/classes/sun/security/krb5/KrbAsReqBuilder.java new file mode 100644 index 00000000000..940d31107e5 --- /dev/null +++ b/jdk/src/share/classes/sun/security/krb5/KrbAsReqBuilder.java @@ -0,0 +1,395 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.krb5; + +import java.io.IOException; +import java.util.Arrays; +import sun.security.krb5.internal.HostAddresses; +import sun.security.krb5.internal.KDCOptions; +import sun.security.krb5.internal.KRBError; +import sun.security.krb5.internal.KerberosTime; +import sun.security.krb5.internal.Krb5; +import sun.security.krb5.internal.PAData; +import sun.security.krb5.internal.crypto.EType; + +/** + * A manager class for AS-REQ communications. + * + * This class does: + * 1. Gather information to create AS-REQ + * 2. Create and send AS-REQ + * 3. Receive AS-REP and KRB-ERROR (-KRB_ERR_RESPONSE_TOO_BIG) and parse them + * 4. Emit credentials and secret keys (for JAAS storeKey=true) + * + * This class does not: + * 1. Deal with real communications (KdcComm does it, and TGS-REQ) + * a. Name of KDCs for a realm + * b. Server availability, timeout, UDP or TCP + * d. KRB_ERR_RESPONSE_TOO_BIG + * + * With this class: + * 1. KrbAsReq has only one constructor + * 2. Krb5LoginModule and Kinit call a single builder + * 3. Better handling of sensitive info + * + * @since 1.7 + */ + +public final class KrbAsReqBuilder { + + // Common data for AS-REQ fields + private KDCOptions options; + private PrincipalName cname; + private PrincipalName sname; + private KerberosTime from; + private KerberosTime till; + private KerberosTime rtime; + private HostAddresses addresses; + + // Secret source: can't be changed once assigned, only one (of the two + // sources) can be set and should be non-null + private EncryptionKey[] keys; + private char[] password; + + // Used to create a ENC-TIMESTAMP in the 2nd AS-REQ + private EncryptionKey pakey; + private PAData[] paList; // PA-DATA from both KRB-ERROR and AS-REP. + // Used by getKeys() only. + // Only AS-REP should be enough per RFC, + // combined in case etypes are different. + + // The generated and received: + int[] eTypes; + private KrbAsReq req; + private KrbAsRep rep; + + private static enum State { + INIT, // Initialized, can still add more initialization info + REQ_OK, // AS-REQ performed + DESTROYED, // Destroyed, not usable anymore + } + private State state; + + // Called by other constructors + private KrbAsReqBuilder(PrincipalName cname) + throws KrbException { + if (cname.getRealm() == null) { + cname.setRealm(Config.getInstance().getDefaultRealm()); + } + this.cname = cname; + state = State.INIT; + } + + /** + * Creates a builder to be used by {@code cname} with existing keys. + * + * @param cname the client of the AS-REQ. Must not be null. Might have no + * realm, where default realm will be used. This realm will be the target + * realm for AS-REQ. I believe a client should only get initial TGT from + * its own realm. + * @param keys must not be null. if empty, might be quite useless. + * This argument will neither be modified nor stored by the method. + * @throws KrbException + */ + public KrbAsReqBuilder(PrincipalName cname, EncryptionKey[] keys) + throws KrbException { + this(cname); + this.keys = new EncryptionKey[keys.length]; + for (int i=0; i 0) { + int oldLen = paList.length; + paList = Arrays.copyOf(paList, paList.length + extraLen); + System.arraycopy(rep.getPA(), 0, paList, oldLen, extraLen); + } + } + } + return this; + } + + /** + * Communication until AS-REP or non preauth-related KRB-ERROR received + * @throws KrbException + * @throws IOException + */ + private KrbAsReqBuilder send() throws KrbException, IOException { + boolean preAuthFailedOnce = false; + KdcComm comm = new KdcComm(cname.getRealmAsString()); + while (true) { + try { + req = build(); + rep = new KrbAsRep(comm.send(req.encoding())); + return this; + } catch (KrbException ke) { + if (!preAuthFailedOnce && ( + ke.returnCode() == Krb5.KDC_ERR_PREAUTH_FAILED || + ke.returnCode() == Krb5.KDC_ERR_PREAUTH_REQUIRED)) { + if (Krb5.DEBUG) { + System.out.println("KrbAsReqBuilder: " + + "PREAUTH FAILED/REQ, re-send AS-REQ"); + } + preAuthFailedOnce = true; + KRBError kerr = ke.getError(); + if (password == null) { + pakey = EncryptionKey.findKey(kerr.getEType(), keys); + } else { + PAData.SaltAndParams snp = PAData.getSaltAndParams( + kerr.getEType(), kerr.getPA()); + if (kerr.getEType() == 0) { + // Possible if PA-PW-SALT is in KRB-ERROR. RFC + // does not recommend this + pakey = EncryptionKey.acquireSecretKey(password, + snp.salt == null ? cname.getSalt() : snp.salt, + eTypes[0], + null); + } else { + pakey = EncryptionKey.acquireSecretKey(password, + snp.salt == null ? cname.getSalt() : snp.salt, + kerr.getEType(), + snp.params); + } + } + paList = kerr.getPA(); // Update current paList + } else { + throw ke; + } + } + } + } + + /** + * Performs AS-REQ send and AS-REP receive. + * Maybe a state is needed here, to divide prepare process and getCreds. + * @throws KrbException + * @throws Asn1Exception + * @throws IOException + */ + public KrbAsReqBuilder action() + throws KrbException, Asn1Exception, IOException { + checkState(State.INIT, "Cannot call action"); + state = State.REQ_OK; + return send().resolve(); + } + + /** + * Gets Credentials object after action + */ + public Credentials getCreds() { + checkState(State.REQ_OK, "Cannot retrieve creds"); + return rep.getCreds(); + } + + /** + * Gets another type of Credentials after action + */ + public sun.security.krb5.internal.ccache.Credentials getCCreds() { + checkState(State.REQ_OK, "Cannot retrieve CCreds"); + return rep.getCCreds(); + } + + /** + * Destroys the object and clears keys and password info. + */ + public void destroy() { + state = State.DESTROYED; + if (keys != null) { + for (EncryptionKey k: keys) { + k.destroy(); + } + keys = null; + } + if (password != null) { + Arrays.fill(password, (char)0); + password = null; + } + } + + /** + * Checks if the current state is the specified one. + * @param st the expected state + * @param msg error message if state is not correct + * @throws IllegalStateException if state is not correct + */ + private void checkState(State st, String msg) { + if (state != st) { + throw new IllegalStateException(msg + " at " + st + " state"); + } + } +} diff --git a/jdk/src/share/classes/sun/security/krb5/KrbTgsReq.java b/jdk/src/share/classes/sun/security/krb5/KrbTgsReq.java index 286018ce328..1021a7b10bd 100644 --- a/jdk/src/share/classes/sun/security/krb5/KrbTgsReq.java +++ b/jdk/src/share/classes/sun/security/krb5/KrbTgsReq.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,20 +31,16 @@ package sun.security.krb5; -import sun.security.util.*; -import sun.security.krb5.EncryptionKey; import sun.security.krb5.internal.*; import sun.security.krb5.internal.crypto.*; import java.io.IOException; import java.net.UnknownHostException; -import java.util.StringTokenizer; -import java.io.InterruptedIOException; /** * This class encapsulates a Kerberos TGS-REQ that is sent from the * client to the KDC. */ -public class KrbTgsReq extends KrbKdcReq { +public class KrbTgsReq { private PrincipalName princName; private PrincipalName servName; @@ -56,7 +52,8 @@ public class KrbTgsReq extends KrbKdcReq { private static final boolean DEBUG = Krb5.DEBUG; - private int defaultTimeout = 30*1000; // 30 seconds + private byte[] obuf; + private byte[] ibuf; // Used in CredentialsUtil public KrbTgsReq(Credentials asCreds, @@ -182,11 +179,12 @@ public class KrbTgsReq extends KrbKdcReq { * @throws KrbException * @throws IOException */ - public String send() throws IOException, KrbException { + public void send() throws IOException, KrbException { String realmStr = null; if (servName != null) realmStr = servName.getRealmString(); - return (send(realmStr)); + KdcComm comm = new KdcComm(realmStr); + ibuf = comm.send(obuf); } public KrbTgsRep getReply() @@ -201,18 +199,8 @@ public class KrbTgsReq extends KrbKdcReq { public Credentials sendAndGetCreds() throws IOException, KrbException { KrbTgsRep tgs_rep = null; String kdc = null; - try { - kdc = send(); - tgs_rep = getReply(); - } catch (KrbException ke) { - if (ke.returnCode() == Krb5.KRB_ERR_RESPONSE_TOO_BIG) { - // set useTCP and retry - send(servName.getRealmString(), kdc, true); - tgs_rep = getReply(); - } else { - throw ke; - } - } + send(); + tgs_rep = getReply(); return tgs_rep.getCreds(); } @@ -240,7 +228,7 @@ public class KrbTgsReq extends KrbKdcReq { UnknownHostException, KrbCryptoException { KerberosTime req_till = null; if (till == null) { - req_till = new KerberosTime(); + req_till = new KerberosTime(0); } else { req_till = till; } diff --git a/jdk/src/share/classes/sun/security/krb5/PrincipalName.java b/jdk/src/share/classes/sun/security/krb5/PrincipalName.java index 6e41b93d604..11d11dbfa0e 100644 --- a/jdk/src/share/classes/sun/security/krb5/PrincipalName.java +++ b/jdk/src/share/classes/sun/security/krb5/PrincipalName.java @@ -244,7 +244,7 @@ public class PrincipalName if (subDer.getTag() != DerValue.tag_SequenceOf) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } - Vector v = new Vector (); + Vector v = new Vector<>(); DerValue subSubDer; while(subDer.getData().available() > 0) { subSubDer = subDer.getData().getDerValue(); @@ -299,7 +299,7 @@ public class PrincipalName // Code repetition, realm parsed again by class Realm protected static String[] parseName(String name) { - Vector tempStrings = new Vector (); + Vector tempStrings = new Vector<>(); String temp = name; int i = 0; int componentStart = 0; @@ -511,10 +511,6 @@ public class PrincipalName return salt; } - public void setSalt(String salt) { - this.salt = salt; - } - public String toString() { StringBuffer str = new StringBuffer(); for (int i = 0; i < nameStrings.length; i++) { diff --git a/jdk/src/share/classes/sun/security/krb5/Realm.java b/jdk/src/share/classes/sun/security/krb5/Realm.java index 88f679de7a5..f7b450ec6be 100644 --- a/jdk/src/share/classes/sun/security/krb5/Realm.java +++ b/jdk/src/share/classes/sun/security/krb5/Realm.java @@ -359,12 +359,12 @@ public class Realm implements Cloneable { } String tempTarget = null, tempRealm = null; - Stack iStack = new Stack (); + Stack iStack = new Stack<>(); /* * I don't expect any more than a handful of intermediaries. */ - Vector tempList = new Vector (8, 8); + Vector tempList = new Vector<>(8, 8); /* * The initiator at first location. diff --git a/jdk/src/share/classes/sun/security/krb5/internal/Authenticator.java b/jdk/src/share/classes/sun/security/krb5/internal/Authenticator.java index 28a44cc514c..67f70387a99 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/Authenticator.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/Authenticator.java @@ -176,7 +176,7 @@ public class Authenticator { * @exception IOException if an I/O error occurs while reading encoded data. */ public byte[] asn1Encode() throws Asn1Exception, IOException { - Vector v = new Vector(); + Vector v = new Vector<>(); DerOutputStream temp = new DerOutputStream(); temp.putInteger(BigInteger.valueOf(authenticator_vno)); v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x00), temp.toByteArray())); diff --git a/jdk/src/share/classes/sun/security/krb5/internal/AuthorizationData.java b/jdk/src/share/classes/sun/security/krb5/internal/AuthorizationData.java index bbec348c146..9a9de81932f 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/AuthorizationData.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/AuthorizationData.java @@ -99,8 +99,7 @@ public class AuthorizationData implements Cloneable { * @exception IOException if an I/O error occurs while reading encoded data. */ public AuthorizationData(DerValue der) throws Asn1Exception, IOException { - Vector v = - new Vector(); + Vector v = new Vector<>(); if (der.getTag() != DerValue.tag_Sequence) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } diff --git a/jdk/src/share/classes/sun/security/krb5/internal/EncAPRepPart.java b/jdk/src/share/classes/sun/security/krb5/internal/EncAPRepPart.java index f8fb0aead5b..fdebf1de980 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/EncAPRepPart.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/EncAPRepPart.java @@ -133,7 +133,7 @@ public class EncAPRepPart { * @exception IOException if an I/O error occurs while reading encoded data. */ public byte[] asn1Encode() throws Asn1Exception, IOException { - Vector v = new Vector(); + Vector v = new Vector<>(); DerOutputStream temp = new DerOutputStream(); v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x00), ctime.asn1Encode())); diff --git a/jdk/src/share/classes/sun/security/krb5/internal/HostAddresses.java b/jdk/src/share/classes/sun/security/krb5/internal/HostAddresses.java index df51f3a3536..1cd1e4ac44f 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/HostAddresses.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/HostAddresses.java @@ -179,7 +179,7 @@ public class HostAddresses implements Cloneable { */ public HostAddresses(DerValue encoding) throws Asn1Exception, IOException { - Vector tempAddresses = new Vector (); + Vector tempAddresses = new Vector<>(); DerValue der = null; while (encoding.getData().available() > 0) { der = encoding.getData().getDerValue(); @@ -265,8 +265,7 @@ public class HostAddresses implements Cloneable { if (addresses == null || addresses.length == 0) return null; - ArrayList ipAddrs = - new ArrayList (addresses.length); + ArrayList ipAddrs = new ArrayList<>(addresses.length); for (int i = 0; i < addresses.length; i++) { try { diff --git a/jdk/src/share/classes/sun/security/krb5/internal/KDCRep.java b/jdk/src/share/classes/sun/security/krb5/internal/KDCRep.java index fad96c8c414..5ff8da2e3aa 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/KDCRep.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/KDCRep.java @@ -32,7 +32,6 @@ package sun.security.krb5.internal; import sun.security.krb5.*; import sun.security.util.*; -import java.util.Vector; import java.io.IOException; import java.math.BigInteger; @@ -69,7 +68,7 @@ public class KDCRep { public EncKDCRepPart encKDCRepPart; //not part of ASN.1 encoding private int pvno; private int msgType; - private PAData[] pAData = null; //optional + public PAData[] pAData = null; //optional private boolean DEBUG = Krb5.DEBUG; public KDCRep( diff --git a/jdk/src/share/classes/sun/security/krb5/internal/KDCReq.java b/jdk/src/share/classes/sun/security/krb5/internal/KDCReq.java index 0dfd3ccf904..16591e80404 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/KDCReq.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/KDCReq.java @@ -150,7 +150,7 @@ public class KDCReq { if (subsubDer.getTag() != DerValue.tag_SequenceOf) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } - Vector v = new Vector(); + Vector v = new Vector<>(); while (subsubDer.getData().available() > 0) { v.addElement(new PAData(subsubDer.getData().getDerValue())); } diff --git a/jdk/src/share/classes/sun/security/krb5/internal/KDCReqBody.java b/jdk/src/share/classes/sun/security/krb5/internal/KDCReqBody.java index 4af4dad0c13..a23d452885d 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/KDCReqBody.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/KDCReqBody.java @@ -158,7 +158,7 @@ public class KDCReqBody { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } der = encoding.getData().getDerValue(); - Vector v = new Vector (); + Vector v = new Vector<>(); if ((der.getTag() & (byte)0x1F) == (byte)0x08) { subDer = der.getData().getDerValue(); @@ -183,7 +183,7 @@ public class KDCReqBody { encAuthorizationData = EncryptedData.parse(encoding.getData(), (byte)0x0A, true); } if (encoding.getData().available() > 0) { - Vector tempTickets = new Vector (); + Vector tempTickets = new Vector<>(); der = encoding.getData().getDerValue(); if ((der.getTag() & (byte)0x1F) == (byte)0x0B) { subDer = der.getData().getDerValue(); @@ -216,7 +216,7 @@ public class KDCReqBody { * */ public byte[] asn1Encode(int msgType) throws Asn1Exception, IOException { - Vector v = new Vector (); + Vector v = new Vector<>(); v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), kdcOptions.asn1Encode())); if (msgType == Krb5.KRB_AS_REQ) { if (cname != null) { diff --git a/jdk/src/share/classes/sun/security/krb5/internal/KRBCred.java b/jdk/src/share/classes/sun/security/krb5/internal/KRBCred.java index 5fbe7ad8e03..ff719f432c2 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/KRBCred.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/KRBCred.java @@ -134,7 +134,7 @@ public class KRBCred { if (subsubDer.getTag() != DerValue.tag_SequenceOf) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } - Vector v = new Vector(); + Vector v = new Vector<>(); while (subsubDer.getData().available() > 0) { v.addElement(new Ticket(subsubDer.getData().getDerValue())); } diff --git a/jdk/src/share/classes/sun/security/krb5/internal/KRBError.java b/jdk/src/share/classes/sun/security/krb5/internal/KRBError.java index 4bf1de79e94..ed17cd8212a 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/KRBError.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/KRBError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 @@ import sun.security.util.*; import java.io.IOException; import java.io.ObjectInputStream; import java.math.BigInteger; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import sun.security.krb5.internal.util.KerberosString; /** * Implements the ASN.1 KRBError type. @@ -96,10 +98,8 @@ public class KRBError implements java.io.Serializable { private byte[] eData; //optional private Checksum eCksum; //optional - // pre-auth info - private int etype = 0; - private String salt = null; - private byte[] s2kparams = null; + private PAData[] pa; // PA-DATA in eData + private int pa_eType; // The 1st etype appeared in salt-related PAData private static boolean DEBUG = Krb5.DEBUG; @@ -260,10 +260,12 @@ public class KRBError implements java.io.Serializable { private void parsePAData(byte[] data) throws IOException, Asn1Exception { DerValue derPA = new DerValue(data); + List paList = new ArrayList<>(); while (derPA.data.available() > 0) { // read the PA-DATA DerValue tmp = derPA.data.getDerValue(); PAData pa_data = new PAData(tmp); + paList.add(pa_data); int pa_type = pa_data.getType(); byte[] pa_value = pa_data.getValue(); if (DEBUG) { @@ -280,24 +282,13 @@ public class KRBError implements java.io.Serializable { case Krb5.PA_ETYPE_INFO: if (pa_value != null) { DerValue der = new DerValue(pa_value); - DerValue value = der.data.getDerValue(); - ETypeInfo info = new ETypeInfo(value); - etype = info.getEType(); - salt = info.getSalt(); - if (DEBUG) { - System.out.println("\t PA-ETYPE-INFO etype = " + etype); - System.out.println("\t PA-ETYPE-INFO salt = " + salt); - } while (der.data.available() > 0) { - value = der.data.getDerValue(); - info = new ETypeInfo(value); + DerValue value = der.data.getDerValue(); + ETypeInfo info = new ETypeInfo(value); + if (pa_eType == 0) pa_eType = info.getEType(); if (DEBUG) { - etype = info.getEType(); - System.out.println("\t salt for " + etype - + " is " + info.getSalt()); - } - if (salt == null || salt.isEmpty()) { - salt = info.getSalt(); + System.out.println("\t PA-ETYPE-INFO etype = " + info.getEType()); + System.out.println("\t PA-ETYPE-INFO salt = " + info.getSalt()); } } } @@ -305,25 +296,13 @@ public class KRBError implements java.io.Serializable { case Krb5.PA_ETYPE_INFO2: if (pa_value != null) { DerValue der = new DerValue(pa_value); - DerValue value = der.data.getDerValue(); - ETypeInfo2 info2 = new ETypeInfo2(value); - etype = info2.getEType(); - salt = info2.getSalt(); - s2kparams = info2.getParams(); - if (DEBUG) { - System.out.println("\t PA-ETYPE-INFO2 etype = " + etype); - System.out.println("\t PA-ETYPE-INFO salt = " + salt); - } while (der.data.available() > 0) { - value = der.data.getDerValue(); - info2 = new ETypeInfo2(value); + DerValue value = der.data.getDerValue(); + ETypeInfo2 info2 = new ETypeInfo2(value); + if (pa_eType == 0) pa_eType = info2.getEType(); if (DEBUG) { - etype = info2.getEType(); - System.out.println("\t salt for " + etype - + " is " + info2.getSalt()); - } - if (salt == null || salt.isEmpty()) { - salt = info2.getSalt(); + System.out.println("\t PA-ETYPE-INFO2 etype = " + info2.getEType()); + System.out.println("\t PA-ETYPE-INFO2 salt = " + info2.getSalt()); } } } @@ -333,6 +312,7 @@ public class KRBError implements java.io.Serializable { break; } } + pa = paList.toArray(new PAData[paList.size()]); } public final KerberosTime getServerTime() { @@ -356,18 +336,12 @@ public class KRBError implements java.io.Serializable { } // access pre-auth info + public final PAData[] getPA() { + return pa; + } + public final int getEType() { - return etype; - } - - // access pre-auth info - public final String getSalt() { - return salt; - } - - // access pre-auth info - public final byte[] getParams() { - return ((s2kparams == null) ? null : s2kparams.clone()); + return pa_eType; } public final String getErrorString() { diff --git a/jdk/src/share/classes/sun/security/krb5/internal/KerberosTime.java b/jdk/src/share/classes/sun/security/krb5/internal/KerberosTime.java index 1e0cbeccb2d..eae48e173ed 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/KerberosTime.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/KerberosTime.java @@ -77,11 +77,6 @@ public class KerberosTime implements Cloneable { public static final boolean NOW = true; public static final boolean UNADJUSTED_NOW = false; - //defaults to zero instead of now; use setNow() for current time - public KerberosTime() { - kerberosTime = 0; - } - public KerberosTime(long time) { kerberosTime = time; } diff --git a/jdk/src/share/classes/sun/security/krb5/internal/KrbCredInfo.java b/jdk/src/share/classes/sun/security/krb5/internal/KrbCredInfo.java index 7c2fbff849d..63ebe03d3c6 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/KrbCredInfo.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/KrbCredInfo.java @@ -157,7 +157,7 @@ public class KrbCredInfo { * @exception IOException if an I/O error occurs while reading encoded data. */ public byte[] asn1Encode() throws Asn1Exception, IOException { - Vector v = new Vector (); + Vector v = new Vector<>(); v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), key.asn1Encode())); if (prealm != null) v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x01), prealm.asn1Encode())); diff --git a/jdk/src/share/classes/sun/security/krb5/internal/LastReq.java b/jdk/src/share/classes/sun/security/krb5/internal/LastReq.java index 578d955f45b..45ff8a81274 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/LastReq.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/LastReq.java @@ -77,7 +77,7 @@ public class LastReq { */ public LastReq(DerValue encoding) throws Asn1Exception, IOException { - Vector v= new Vector (); + Vector v= new Vector<>(); if (encoding.getTag() != DerValue.tag_Sequence) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } diff --git a/jdk/src/share/classes/sun/security/krb5/internal/TCPClient.java b/jdk/src/share/classes/sun/security/krb5/internal/NetClient.java similarity index 66% rename from jdk/src/share/classes/sun/security/krb5/internal/TCPClient.java rename to jdk/src/share/classes/sun/security/krb5/internal/NetClient.java index 770871e7b6b..36e9a5c59c1 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/TCPClient.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/NetClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,18 +34,38 @@ package sun.security.krb5.internal; import java.io.*; import java.net.*; -public class TCPClient { +public abstract class NetClient { + public static NetClient getInstance(String protocol, String hostname, int port, + int timeout) throws IOException { + if (protocol.equals("TCP")) { + return new TCPClient(hostname, port, timeout); + } else { + return new UDPClient(hostname, port, timeout); + } + } + + abstract public void send(byte[] data) throws IOException; + + abstract public byte[] receive() throws IOException; + + abstract public void close() throws IOException; +} + +class TCPClient extends NetClient { private Socket tcpSocket; private BufferedOutputStream out; private BufferedInputStream in; - public TCPClient(String hostname, int port) throws IOException { + TCPClient(String hostname, int port, int timeout) + throws IOException { tcpSocket = new Socket(hostname, port); out = new BufferedOutputStream(tcpSocket.getOutputStream()); in = new BufferedInputStream(tcpSocket.getInputStream()); + tcpSocket.setSoTimeout(timeout); } + @Override public void send(byte[] data) throws IOException { byte[] lenField = new byte[4]; intToNetworkByteOrder(data.length, lenField, 0, 4); @@ -55,6 +75,7 @@ public class TCPClient { out.flush(); } + @Override public byte[] receive() throws IOException { byte[] lenField = new byte[4]; int count = readFully(lenField, 4); @@ -94,6 +115,7 @@ public class TCPClient { } } + @Override public void close() throws IOException { tcpSocket.close(); } @@ -120,7 +142,7 @@ public class TCPClient { /** * Returns the integer represented by 4 bytes in network byte order. */ - private static final int networkByteOrderToInt(byte[] buf, int start, + private static int networkByteOrderToInt(byte[] buf, int start, int count) { if (count > 4) { throw new IllegalArgumentException( @@ -140,7 +162,7 @@ public class TCPClient { * Encodes an integer into 4 bytes in network byte order in the buffer * supplied. */ - private static final void intToNetworkByteOrder(int num, byte[] buf, + private static void intToNetworkByteOrder(int num, byte[] buf, int start, int count) { if (count > 4) { throw new IllegalArgumentException( @@ -153,3 +175,47 @@ public class TCPClient { } } } + +class UDPClient extends NetClient { + InetAddress iaddr; + int iport; + int bufSize = 65507; + DatagramSocket dgSocket; + DatagramPacket dgPacketIn; + + UDPClient(String hostname, int port, int timeout) + throws UnknownHostException, SocketException { + iaddr = InetAddress.getByName(hostname); + iport = port; + dgSocket = new DatagramSocket(); + dgSocket.setSoTimeout(timeout); + } + + @Override + public void send(byte[] data) throws IOException { + DatagramPacket dgPacketOut = new DatagramPacket(data, data.length, + iaddr, iport); + dgSocket.send(dgPacketOut); + } + + @Override + public byte[] receive() throws IOException { + byte ibuf[] = new byte[bufSize]; + dgPacketIn = new DatagramPacket(ibuf, ibuf.length); + try { + dgSocket.receive(dgPacketIn); + } + catch (SocketException e) { + dgSocket.receive(dgPacketIn); + } + byte[] data = new byte[dgPacketIn.getLength()]; + System.arraycopy(dgPacketIn.getData(), 0, data, 0, + dgPacketIn.getLength()); + return data; + } + + @Override + public void close() { + dgSocket.close(); + } +} diff --git a/jdk/src/share/classes/sun/security/krb5/internal/PAData.java b/jdk/src/share/classes/sun/security/krb5/internal/PAData.java index b5f95f1ceea..d32bbc47ee5 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/PAData.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/PAData.java @@ -30,9 +30,11 @@ package sun.security.krb5.internal; +import sun.security.krb5.KrbException; import sun.security.util.*; import sun.security.krb5.Asn1Exception; import java.io.IOException; +import sun.security.krb5.internal.util.KerberosString; /** * Implements the ASN.1 PA-DATA type. @@ -135,4 +137,75 @@ public class PAData { public byte[] getValue() { return ((pADataValue == null) ? null : pADataValue.clone()); } + + /** + * A place to store a pair of salt and s2kparams. + * An empty salt is changed to null, to be interopable + * with Windows 2000 server. + */ + public static class SaltAndParams { + public final String salt; + public final byte[] params; + public SaltAndParams(String s, byte[] p) { + if (s != null && s.isEmpty()) s = null; + this.salt = s; + this.params = p; + } + } + + /** + * Fetches salt and s2kparams value for eType in a series of PA-DATAs. + * The preference order is PA-ETYPE-INFO2 > PA-ETYPE-INFO > PA-PW-SALT. + * If multiple PA-DATA for the same etype appears, use the last one. + * (This is useful when PA-DATAs from KRB-ERROR and AS-REP are combined). + * @return salt and s2kparams. never null, its field might be null. + */ + public static SaltAndParams getSaltAndParams(int eType, PAData[] pas) + throws Asn1Exception, KrbException { + + if (pas == null || pas.length == 0) { + return new SaltAndParams(null, null); + } + + String paPwSalt = null; + ETypeInfo2 info2 = null; + ETypeInfo info = null; + + for (PAData p: pas) { + if (p.getValue() != null) { + try { + switch (p.getType()) { + case Krb5.PA_PW_SALT: + paPwSalt = new String(p.getValue(), + KerberosString.MSNAME?"UTF8":"8859_1"); + break; + case Krb5.PA_ETYPE_INFO: + DerValue der = new DerValue(p.getValue()); + while (der.data.available() > 0) { + DerValue value = der.data.getDerValue(); + ETypeInfo tmp = new ETypeInfo(value); + if (tmp.getEType() == eType) info = tmp; + } + break; + case Krb5.PA_ETYPE_INFO2: + der = new DerValue(p.getValue()); + while (der.data.available() > 0) { + DerValue value = der.data.getDerValue(); + ETypeInfo2 tmp = new ETypeInfo2(value); + if (tmp.getEType() == eType) info2 = tmp; + } + break; + } + } catch (IOException ioe) { + // Ignored + } + } + } + if (info2 != null) { + return new SaltAndParams(info2.getSalt(), info2.getParams()); + } else if (info != null) { + return new SaltAndParams(info.getSalt(), null); + } + return new SaltAndParams(paPwSalt, null); + } } diff --git a/jdk/src/share/classes/sun/security/krb5/internal/UDPClient.java b/jdk/src/share/classes/sun/security/krb5/internal/UDPClient.java deleted file mode 100644 index 59b53edfcd9..00000000000 --- a/jdk/src/share/classes/sun/security/krb5/internal/UDPClient.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * - * (C) Copyright IBM Corp. 1999 All Rights Reserved. - * Copyright 1997 The Open Group Research Institute. All rights reserved. - */ - -package sun.security.krb5.internal; - -import java.io.*; -import java.net.*; - -public class UDPClient { - InetAddress iaddr; - int iport; - int bufSize = 65507; - DatagramSocket dgSocket; - DatagramPacket dgPacketIn; - - public UDPClient(InetAddress newIAddr, int port) - throws SocketException { - iaddr = newIAddr; - iport = port; - dgSocket = new DatagramSocket(); - } - - public UDPClient(String hostname, int port) - throws UnknownHostException, SocketException { - iaddr = InetAddress.getByName(hostname); - iport = port; - dgSocket = new DatagramSocket(); - } - - public UDPClient(String hostname, int port, int timeout) - throws UnknownHostException, SocketException { - iaddr = InetAddress.getByName(hostname); - iport = port; - dgSocket = new DatagramSocket(); - dgSocket.setSoTimeout(timeout); - } - - public void setBufSize(int newBufSize) { - bufSize = newBufSize; - } - - public InetAddress getInetAddress() { - if (dgPacketIn != null) - return dgPacketIn.getAddress(); - return null; - } - - public void send(byte[] data) throws IOException { - DatagramPacket dgPacketOut = new DatagramPacket(data, data.length, - iaddr, iport); - dgSocket.send(dgPacketOut); - } - - public byte[] receive() throws IOException { - byte ibuf[] = new byte[bufSize]; - dgPacketIn = new DatagramPacket(ibuf, ibuf.length); - try { - dgSocket.receive(dgPacketIn); - } - catch (SocketException e) { - dgSocket.receive(dgPacketIn); - } - byte[] data = new byte[dgPacketIn.getLength()]; - System.arraycopy(dgPacketIn.getData(), 0, data, 0, - dgPacketIn.getLength()); - return data; - } - - public void close() { - dgSocket.close(); - } -} diff --git a/jdk/src/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java b/jdk/src/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java index 0649ae10da8..4f387b99f96 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java @@ -250,16 +250,16 @@ public class CCacheInputStream extends KrbDataInputStream implements FileCCacheC else return null; } - Ticket readData() throws IOException, RealmException, KrbApErrException, Asn1Exception { + byte[] readData() throws IOException { int length; length = read(4); - if (length > 0) { + if (length == 0) { + return null; + } else { byte[] bytes = new byte[length]; read(bytes, 0, length); - Ticket ticket = new Ticket(bytes); - return ticket; + return bytes; } - else return null; } boolean[] readFlags() throws IOException { @@ -328,6 +328,17 @@ public class CCacheInputStream extends KrbDataInputStream implements FileCCacheC } return flags; } + + /** + * Reads the next cred in stream. + * @return the next cred, null if ticket or second_ticket unparseable. + * + * Note: MIT krb5 1.8.1 might generate a config entry with server principal + * X-CACHECONF:/krb5_ccache_conf_data/fast_avail/krbtgt/REALM@REALM. The + * entry is used by KDC to inform the client that it support certain + * features. Its ticket is not a valid krb5 ticket and thus this method + * returns null. + */ Credentials readCred(int version) throws IOException,RealmException, KrbApErrException, Asn1Exception { PrincipalName cpname = readPrincipal(version); if (DEBUG) @@ -367,17 +378,17 @@ public class CCacheInputStream extends KrbDataInputStream implements FileCCacheC if (auData != null) { auData = new AuthorizationData(auDataEntry); } - Ticket ticket = readData(); - if (DEBUG) { - System.out.println(">>>DEBUG "); - if (ticket == null) { - System.out.println("///ticket is null"); - } + byte[] ticketData = readData(); + byte[] ticketData2 = readData(); + + try { + return new Credentials(cpname, spname, key, authtime, starttime, + endtime, renewTill, skey, tFlags, + addrs, auData, + ticketData != null ? new Ticket(ticketData) : null, + ticketData2 != null ? new Ticket(ticketData2) : null); + } catch (Exception e) { // If any of new Ticket(*) fails. + return null; } - Ticket secTicket = readData(); - Credentials cred = new Credentials(cpname, spname, key, authtime, starttime, - endtime, renewTill, skey, tFlags, - addrs, auData, ticket, secTicket); - return cred; } } diff --git a/jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java b/jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java index 6095077f503..46e5985f76f 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -186,7 +186,10 @@ public class FileCredentialsCache extends CredentialsCache primaryRealm = primaryPrincipal.getRealm(); credentialsList = new Vector (); while (cis.available() > 0) { - credentialsList.addElement(cis.readCred(version)); + Credentials cred = cis.readCred(version); + if (cred != null) { + credentialsList.addElement(cred); + } } cis.close(); } @@ -487,7 +490,7 @@ public class FileCredentialsCache extends CredentialsCache private static String exec(String c) { StringTokenizer st = new StringTokenizer(c); - Vector v = new Vector (); + Vector v = new Vector<>(); while (st.hasMoreTokens()) { v.addElement(st.nextToken()); } diff --git a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java index 90c0be67dae..85ba264944d 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java @@ -257,7 +257,7 @@ public abstract class EType { + configName); } - List list = new ArrayList (answer.length); + List list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); diff --git a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java index 623d6252bcf..3c680fde166 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java @@ -34,7 +34,6 @@ package sun.security.krb5.internal.ktab; import sun.security.krb5.*; import sun.security.krb5.internal.*; import sun.security.krb5.internal.crypto.*; -import java.util.Vector; import java.util.ArrayList; import java.util.Arrays; import java.io.IOException; @@ -42,7 +41,10 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.File; import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; import java.util.StringTokenizer; +import java.util.Vector; /** * This class represents key table. The key table functions deal with storing @@ -55,7 +57,7 @@ public class KeyTab implements KeyTabConstants { private static KeyTab singleton = null; private static final boolean DEBUG = Krb5.DEBUG; private static String name; - private Vector entries = new Vector (); + private Vector entries = new Vector<>(); private KeyTab(String filename) throws IOException, RealmException { init(filename); @@ -238,24 +240,23 @@ public class KeyTab implements KeyTabConstants { KeyTabEntry entry; EncryptionKey key; int size = entries.size(); - ArrayList keys = new ArrayList (size); - if (entries != null) { - for (int i = size-1; i >= 0; i--) { - entry = entries.elementAt(i); - if (entry.service.match(service)) { - if (EType.isSupported(entry.keyType)) { - key = new EncryptionKey(entry.keyblock, - entry.keyType, - new Integer(entry.keyVersion)); - keys.add(key); - if (DEBUG) { - System.out.println("Added key: " + entry.keyType + - "version: " + entry.keyVersion); - } - } else if (DEBUG) { - System.out.println("Found unsupported keytype (" + - entry.keyType + ") for " + service); + ArrayList keys = new ArrayList<>(size); + + for (int i = size-1; i >= 0; i--) { + entry = entries.elementAt(i); + if (entry.service.match(service)) { + if (EType.isSupported(entry.keyType)) { + key = new EncryptionKey(entry.keyblock, + entry.keyType, + new Integer(entry.keyVersion)); + keys.add(key); + if (DEBUG) { + System.out.println("Added key: " + entry.keyType + + "version: " + entry.keyVersion); } + } else if (DEBUG) { + System.out.println("Found unsupported keytype (" + + entry.keyType + ") for " + service); } } } @@ -313,16 +314,14 @@ public class KeyTab implements KeyTabConstants { */ public boolean findServiceEntry(PrincipalName service) { KeyTabEntry entry; - if (entries != null) { - for (int i = 0; i < entries.size(); i++) { - entry = entries.elementAt(i); - if (entry.service.match(service)) { - if (EType.isSupported(entry.keyType)) { - return true; - } else if (DEBUG) { - System.out.println("Found unsupported keytype (" + - entry.keyType + ") for " + service); - } + for (int i = 0; i < entries.size(); i++) { + entry = entries.elementAt(i); + if (entry.service.match(service)) { + if (EType.isSupported(entry.keyType)) { + return true; + } else if (DEBUG) { + System.out.println("Found unsupported keytype (" + + entry.keyType + ") for " + service); } } } @@ -337,78 +336,45 @@ public class KeyTab implements KeyTabConstants { * Adds a new entry in the key table. * @param service the service which will have a new entry in the key table. * @param psswd the password which generates the key. + * @param kvno the kvno to use, -1 means automatic increasing + * @param append false if entries with old kvno would be removed. + * Note: if kvno is not -1, entries with the same kvno are always removed */ - public void addEntry(PrincipalName service, char[] psswd) - throws KrbException { + public void addEntry(PrincipalName service, char[] psswd, + int kvno, boolean append) throws KrbException { EncryptionKey[] encKeys = EncryptionKey.acquireSecretKeys( psswd, service.getSalt()); - for (int i = 0; encKeys != null && i < encKeys.length; i++) { - int keyType = encKeys[i].getEType(); - byte[] keyValue = encKeys[i].getBytes(); - int result = retrieveEntry(service, keyType); - int kvno = 1; - if (result != -1) { - KeyTabEntry oldEntry = entries.elementAt(result); - kvno = oldEntry.keyVersion; - entries.removeElementAt(result); - kvno += 1; - } else - kvno = 1; + // There should be only one maximum KVNO value for all etypes, so that + // all added keys can have the same KVNO. - KeyTabEntry newEntry = new KeyTabEntry(service, - service.getRealm(), - new KerberosTime(System.currentTimeMillis()), - kvno, keyType, keyValue); - if (entries == null) - entries = new Vector (); - entries.addElement(newEntry); - } - } - - /** - * Only used by KDC test. This method can specify kvno and does not - * remove any old keys. - */ - public void addEntry(PrincipalName service, char[] psswd, int kvno) - throws KrbException { - - EncryptionKey[] encKeys = EncryptionKey.acquireSecretKeys( - psswd, service.getSalt()); - - for (int i = 0; encKeys != null && i < encKeys.length; i++) { - int keyType = encKeys[i].getEType(); - byte[] keyValue = encKeys[i].getBytes(); - KeyTabEntry newEntry = new KeyTabEntry(service, - service.getRealm(), - new KerberosTime(System.currentTimeMillis()), - kvno, keyType, keyValue); - if (entries == null) - entries = new Vector (); - entries.addElement(newEntry); - } - } - - /** - * Retrieves the key table entry with the specified service name. - * @param service the service which may have an entry in the key table. - * @param keyType the etype to match, returns the 1st one if -1 provided - * @return -1 if the entry is not found, else return the entry index - * in the list. - */ - private int retrieveEntry(PrincipalName service, int keyType) { - KeyTabEntry e; - if (entries != null) { - for (int i = 0; i < entries.size(); i++) { - e = entries.elementAt(i); - if (service.match(e.getService()) && - (keyType == -1 || e.keyType == keyType)) { - return i; + int maxKvno = 0; // only useful when kvno == -1 + for (int i = entries.size()-1; i >= 0; i--) { + KeyTabEntry e = entries.get(i); + if (e.service.match(service)) { + if (e.keyVersion > maxKvno) { + maxKvno = e.keyVersion; + } + if (!append || e.keyVersion == kvno) { + entries.removeElementAt(i); } } } - return -1; + if (kvno == -1) { + kvno = maxKvno + 1; + } + + for (int i = 0; encKeys != null && i < encKeys.length; i++) { + int keyType = encKeys[i].getEType(); + byte[] keyValue = encKeys[i].getBytes(); + + KeyTabEntry newEntry = new KeyTabEntry(service, + service.getRealm(), + new KerberosTime(System.currentTimeMillis()), + kvno, keyType, keyValue); + entries.addElement(newEntry); + } } /** @@ -416,15 +382,11 @@ public class KeyTab implements KeyTabConstants { * @return array of KeyTabEntry. */ public KeyTabEntry[] getEntries() { - if (entries != null) { - KeyTabEntry[] kentries = new KeyTabEntry[entries.size()]; - for (int i = 0; i < kentries.length; i++) { - kentries[i] = entries.elementAt(i); - } - return kentries; - } else { - return null; + KeyTabEntry[] kentries = new KeyTabEntry[entries.size()]; + for (int i = 0; i < kentries.length; i++) { + kentries[i] = entries.elementAt(i); } + return kentries; } /** @@ -464,29 +426,55 @@ public class KeyTab implements KeyTabConstants { } /** - * Removes an entry from the key table. + * Removes entries from the key table. * @param service the service PrincipalName. - * @param etype the etype to match, first one if -1 provided - * @return 1 if removed successfully, 0 otherwise + * @param etype the etype to match, remove all if -1 + * @param kvno what kvno to remove, -1 for all, -2 for old + * @return the number of entries deleted */ - public int deleteEntry(PrincipalName service, int etype) { - int result = retrieveEntry(service, etype); - if (result != -1) { - entries.removeElementAt(result); - return 1; - } - return 0; - } - - /** - * Removes an entry from the key table. - * @param service the service PrincipalName. - * @return number of entries removed - */ - public int deleteEntry(PrincipalName service) { + public int deleteEntries(PrincipalName service, int etype, int kvno) { int count = 0; - while (deleteEntry(service, -1) > 0) { - count++; + + // Remember the highest KVNO for each etype. Used for kvno == -2 + Map highest = new HashMap<>(); + + for (int i = entries.size()-1; i >= 0; i--) { + KeyTabEntry e = entries.get(i); + if (service.match(e.getService())) { + if (etype == -1 || e.keyType == etype) { + if (kvno == -2) { + // Two rounds for kvno == -2. In the first round (here), + // only find out highest KVNO for each etype + if (highest.containsKey(e.keyType)) { + int n = highest.get(e.keyType); + if (e.keyVersion > n) { + highest.put(e.keyType, e.keyVersion); + } + } else { + highest.put(e.keyType, e.keyVersion); + } + } else if (kvno == -1 || e.keyVersion == kvno) { + entries.removeElementAt(i); + count++; + } + } + } + } + + // Second round for kvno == -2, remove old entries + if (kvno == -2) { + for (int i = entries.size()-1; i >= 0; i--) { + KeyTabEntry e = entries.get(i); + if (service.match(e.getService())) { + if (etype == -1 || e.keyType == etype) { + int n = highest.get(e.keyType); + if (e.keyVersion != n) { + entries.removeElementAt(i); + count++; + } + } + } + } } return count; } diff --git a/jdk/src/share/classes/sun/security/pkcs11/Config.java b/jdk/src/share/classes/sun/security/pkcs11/Config.java index 940a4c5e261..243f49d0182 100644 --- a/jdk/src/share/classes/sun/security/pkcs11/Config.java +++ b/jdk/src/share/classes/sun/security/pkcs11/Config.java @@ -343,6 +343,7 @@ final class Config { st.wordChars('{', '{'); // need {} for property subst st.wordChars('}', '}'); st.wordChars('*', '*'); + st.wordChars('~', '~'); // XXX check ASCII table and add all other characters except special // special: #="(), diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java b/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java index 1ea39e799d1..3d2525f3f07 100644 --- a/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java +++ b/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java @@ -74,7 +74,7 @@ final class P11Cipher extends CipherSpi { // DEC: return the length of trailing padding bytes given the specified // padded data int unpad(byte[] paddedData, int len) - throws BadPaddingException; + throws BadPaddingException, IllegalBlockSizeException; } private static class PKCS5Padding implements Padding { @@ -96,9 +96,10 @@ final class P11Cipher extends CipherSpi { } public int unpad(byte[] paddedData, int len) - throws BadPaddingException { - if (len < 1 || len > paddedData.length) { - throw new BadPaddingException("Invalid pad array length!"); + throws BadPaddingException, IllegalBlockSizeException { + if ((len < 1) || (len % blockSize != 0)) { + throw new IllegalBlockSizeException + ("Input length must be multiples of " + blockSize); } byte padValue = paddedData[len - 1]; if (padValue < 1 || padValue > blockSize) { @@ -394,6 +395,8 @@ final class P11Cipher extends CipherSpi { } } catch (PKCS11Exception e) { throw new ProviderException("Cancel failed", e); + } finally { + reset(); } } @@ -407,12 +410,18 @@ final class P11Cipher extends CipherSpi { if (session == null) { session = token.getOpSession(); } - if (encrypt) { - token.p11.C_EncryptInit(session.id(), - new CK_MECHANISM(mechanism, iv), p11Key.keyID); - } else { - token.p11.C_DecryptInit(session.id(), - new CK_MECHANISM(mechanism, iv), p11Key.keyID); + try { + if (encrypt) { + token.p11.C_EncryptInit(session.id(), + new CK_MECHANISM(mechanism, iv), p11Key.keyID); + } else { + token.p11.C_DecryptInit(session.id(), + new CK_MECHANISM(mechanism, iv), p11Key.keyID); + } + } catch (PKCS11Exception ex) { + // release session when initialization failed + session = token.releaseSession(session); + throw ex; } bytesBuffered = 0; padBufferLen = 0; @@ -447,6 +456,16 @@ final class P11Cipher extends CipherSpi { return result; } + // reset the states to the pre-initialized values + private void reset() { + initialized = false; + bytesBuffered = 0; + padBufferLen = 0; + if (session != null) { + session = token.releaseSession(session); + } + } + // see JCE spec protected byte[] engineUpdate(byte[] in, int inOfs, int inLen) { try { @@ -565,6 +584,7 @@ final class P11Cipher extends CipherSpi { throw (ShortBufferException) (new ShortBufferException().initCause(e)); } + reset(); throw new ProviderException("update() failed", e); } } @@ -682,6 +702,7 @@ final class P11Cipher extends CipherSpi { throw (ShortBufferException) (new ShortBufferException().initCause(e)); } + reset(); throw new ProviderException("update() failed", e); } } @@ -728,10 +749,7 @@ final class P11Cipher extends CipherSpi { handleException(e); throw new ProviderException("doFinal() failed", e); } finally { - initialized = false; - bytesBuffered = 0; - padBufferLen = 0; - session = token.releaseSession(session); + reset(); } } @@ -805,9 +823,7 @@ final class P11Cipher extends CipherSpi { handleException(e); throw new ProviderException("doFinal() failed", e); } finally { - initialized = false; - bytesBuffered = 0; - session = token.releaseSession(session); + reset(); } } diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java b/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java index 3d931fcc685..08c0768108e 100644 --- a/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java +++ b/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/pkcs11/SunPKCS11.java b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java index 95be485b58a..55843b95c58 100644 --- a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java +++ b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -655,6 +655,25 @@ public final class SunPKCS11 extends AuthProvider { d(SIG, "SHA512withRSA", P11Signature, m(CKM_SHA512_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509)); + /* + * TLS 1.2 uses a different hash algorithm than 1.0/1.1 for the + * PRF calculations. As of 2010, there is no PKCS11-level + * support for TLS 1.2 PRF calculations, and no known OS's have + * an internal variant we could use. Therefore for TLS 1.2, we + * are updating JSSE to request different provider algorithms + * (e.g. "SunTls12Prf"), and currently only SunJCE has these + * TLS 1.2 algorithms. + * + * If we reused the names such as "SunTlsPrf", the PKCS11 + * providers would need be updated to fail correctly when + * presented with the wrong version number (via + * Provider.Service.supportsParameters()), and we would also + * need to add the appropriate supportsParamters() checks into + * KeyGenerators (not currently there). + * + * In the future, if PKCS11 support is added, we will restructure + * this. + */ d(KG, "SunTlsRsaPremasterSecret", "sun.security.pkcs11.P11TlsRsaPremasterSecretGenerator", m(CKM_SSL3_PRE_MASTER_KEY_GEN, CKM_TLS_PRE_MASTER_KEY_GEN)); @@ -887,7 +906,8 @@ public final class SunPKCS11 extends AuthProvider { return (aliases == null) ? null : Arrays.asList(aliases); } - public Object newInstance(Object param) throws NoSuchAlgorithmException { + public Object newInstance(Object param) + throws NoSuchAlgorithmException { if (token.isValid() == false) { throw new NoSuchAlgorithmException("Token has been removed"); } @@ -1103,7 +1123,7 @@ public final class SunPKCS11 extends AuthProvider { java.text.MessageFormat form = new java.text.MessageFormat (ResourcesMgr.getString - ("PKCS11 Token [providerName] Password: ")); + ("PKCS11.Token.providerName.Password.")); Object[] source = { getName() }; PasswordCallback pcall = new PasswordCallback(form.format(source), diff --git a/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java b/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java index 5785bd2bb12..ffde3d1a46b 100644 --- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java +++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. diff --git a/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java b/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java index a5ce64d7c7a..1a899868de1 100644 --- a/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java +++ b/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/provider/PolicyFile.java b/jdk/src/share/classes/sun/security/provider/PolicyFile.java index 5e5598bde33..7112a7f60c5 100644 --- a/jdk/src/share/classes/sun/security/provider/PolicyFile.java +++ b/jdk/src/share/classes/sun/security/provider/PolicyFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -299,8 +299,7 @@ public class PolicyFile extends java.security.Policy { private static final int DEFAULT_CACHE_SIZE = 1; // contains the policy grant entries, PD cache, and alias mapping - private AtomicReference policyInfo = - new AtomicReference(); + private AtomicReference policyInfo = new AtomicReference<>(); private boolean constructed = false; private boolean expandProperties = true; @@ -653,7 +652,7 @@ public class PolicyFile extends java.security.Policy { } } catch (PolicyParser.ParsingException pe) { MessageFormat form = new MessageFormat(ResourcesMgr.getString - (POLICY + ": error parsing policy:\n\tmessage")); + (POLICY + ".error.parsing.policy.message")); Object[] source = {policy, pe.getLocalizedMessage()}; System.err.println(form.format(source)); if (debug != null) @@ -895,7 +894,7 @@ public class PolicyFile extends java.security.Policy { MessageFormat form = new MessageFormat (ResourcesMgr.getString (POLICY + - ": error adding Permission, perm:\n\tmessage")); + ".error.adding.Permission.perm.message")); Object[] source = {pe.permission, ite.getTargetException().toString()}; System.err.println(form.format(source)); @@ -903,7 +902,7 @@ public class PolicyFile extends java.security.Policy { MessageFormat form = new MessageFormat (ResourcesMgr.getString (POLICY + - ": error adding Permission, perm:\n\tmessage")); + ".error.adding.Permission.perm.message")); Object[] source = {pe.permission, e.toString()}; System.err.println(form.format(source)); @@ -915,7 +914,7 @@ public class PolicyFile extends java.security.Policy { } catch (Exception e) { MessageFormat form = new MessageFormat(ResourcesMgr.getString (POLICY - + ": error adding Entry:\n\tmessage")); + + ".error.adding.Entry.message")); Object[] source = {e.toString()}; System.err.println(form.format(source)); } @@ -1334,8 +1333,7 @@ public class PolicyFile extends java.security.Policy { List entryPs = entry.getPrincipals(); if (debug != null) { - ArrayList accPs = - new ArrayList(); + ArrayList accPs = new ArrayList<>(); if (principals != null) { for (int i = 0; i < principals.length; i++) { accPs.add(new PolicyParser.PrincipalEntry @@ -1416,8 +1414,7 @@ public class PolicyFile extends java.security.Policy { // check if the PrincipalComparator // implies the current thread's principals - Set pSet = - new HashSet(principals.length); + Set pSet = new HashSet<>(principals.length); for (int j = 0; j < principals.length; j++) { pSet.add(principals[j]); } @@ -1700,7 +1697,7 @@ public class PolicyFile extends java.security.Policy { // build an info array for every principal // in the current domain which has a principal class // that is equal to policy entry principal class name - List plist = new ArrayList(); + List plist = new ArrayList<>(); for (int i = 0; i < pdp.length; i++) { if(pe.principalClass.equals(pdp[i].getClass().getName())) plist.add(pdp[i]); @@ -1770,7 +1767,7 @@ public class PolicyFile extends java.security.Policy { // Done return certs; - ArrayList userCertList = new ArrayList(); + ArrayList userCertList = new ArrayList<>(); i = 0; while (i < certs.length) { userCertList.add(certs[i]); @@ -1950,7 +1947,7 @@ public class PolicyFile extends java.security.Policy { if (colonIndex == -1) { MessageFormat form = new MessageFormat (ResourcesMgr.getString - ("alias name not provided (pe.name)")); + ("alias.name.not.provided.pe.name.")); Object[] source = {pe.name}; throw new Exception(form.format(source)); } @@ -1958,7 +1955,7 @@ public class PolicyFile extends java.security.Policy { if ((suffix = getDN(suffix, keystore)) == null) { MessageFormat form = new MessageFormat (ResourcesMgr.getString - ("unable to perform substitution on alias, suffix")); + ("unable.to.perform.substitution.on.alias.suffix")); Object[] source = {value.substring(colonIndex+1)}; throw new Exception(form.format(source)); } @@ -1968,7 +1965,7 @@ public class PolicyFile extends java.security.Policy { } else { MessageFormat form = new MessageFormat (ResourcesMgr.getString - ("substitution value, prefix, unsupported")); + ("substitution.value.prefix.unsupported")); Object[] source = {prefix}; throw new Exception(form.format(source)); } @@ -2127,18 +2124,18 @@ public class PolicyFile extends java.security.Policy { @Override public String toString(){ StringBuilder sb = new StringBuilder(); - sb.append(ResourcesMgr.getString("(")); + sb.append(ResourcesMgr.getString("LPARAM")); sb.append(getCodeSource()); sb.append("\n"); for (int j = 0; j < permissions.size(); j++) { Permission p = permissions.get(j); - sb.append(ResourcesMgr.getString(" ")); - sb.append(ResourcesMgr.getString(" ")); + sb.append(ResourcesMgr.getString("SPACE")); + sb.append(ResourcesMgr.getString("SPACE")); sb.append(p); - sb.append(ResourcesMgr.getString("\n")); + sb.append(ResourcesMgr.getString("NEWLINE")); } - sb.append(ResourcesMgr.getString(")")); - sb.append(ResourcesMgr.getString("\n")); + sb.append(ResourcesMgr.getString("RPARAM")); + sb.append(ResourcesMgr.getString("NEWLINE")); return sb.toString(); } } @@ -2195,7 +2192,7 @@ public class PolicyFile extends java.security.Policy { super(type); if (type == null) { throw new NullPointerException - (ResourcesMgr.getString("type can't be null")); + (ResourcesMgr.getString("type.can.t.be.null")); } this.type = type; this.name = name; @@ -2234,7 +2231,7 @@ public class PolicyFile extends java.security.Policy { if (this.certs == null) { // extract the signer certs ArrayList signerCerts = - new ArrayList(); + new ArrayList<>(); i = 0; while (i < certs.length) { signerCerts.add(certs[i]); diff --git a/jdk/src/share/classes/sun/security/provider/PolicyParser.java b/jdk/src/share/classes/sun/security/provider/PolicyParser.java index aae3f103d7a..07956f4e33e 100644 --- a/jdk/src/share/classes/sun/security/provider/PolicyParser.java +++ b/jdk/src/share/classes/sun/security/provider/PolicyParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +219,7 @@ public class PolicyParser { if (keyStoreUrlString == null && storePassURL != null) { throw new ParsingException(ResourcesMgr.getString - ("keystorePasswordURL can not be specified without also " + - "specifying keystore")); + ("keystorePasswordURL.can.not.be.specified.without.also.specifying.keystore")); } } @@ -357,7 +356,7 @@ public class PolicyParser { keyStoreType = match("quoted string"); } else { throw new ParsingException(st.lineno(), - ResourcesMgr.getString("expected keystore type")); + ResourcesMgr.getString("expected.keystore.type")); } // parse keystore provider @@ -370,7 +369,7 @@ public class PolicyParser { keyStoreProvider = match("quoted string"); } else { throw new ParsingException(st.lineno(), - ResourcesMgr.getString("expected keystore provider")); + ResourcesMgr.getString("expected.keystore.provider")); } } @@ -421,7 +420,7 @@ public class PolicyParser { throw new ParsingException( st.lineno(), ResourcesMgr.getString - ("multiple Codebase expressions")); + ("multiple.Codebase.expressions")); e.codeBase = match("quoted string"); peekAndMatch(","); } else if (peekAndMatch("SignedBy")) { @@ -429,7 +428,7 @@ public class PolicyParser { throw new ParsingException( st.lineno(), ResourcesMgr.getString( - "multiple SignedBy expressions")); + "multiple.SignedBy.expressions")); e.signedBy = match("quoted string"); // verify syntax of the aliases @@ -448,7 +447,7 @@ public class PolicyParser { throw new ParsingException( st.lineno(), ResourcesMgr.getString( - "SignedBy has empty alias")); + "SignedBy.has.empty.alias")); peekAndMatch(","); } else if (peekAndMatch("Principal")) { @@ -491,8 +490,7 @@ public class PolicyParser { throw new ParsingException (st.lineno(), ResourcesMgr.getString - ("can not specify Principal with a " + - "wildcard class without a wildcard name")); + ("can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name")); } } @@ -529,8 +527,7 @@ public class PolicyParser { } else { throw new ParsingException(st.lineno(), ResourcesMgr.getString( - "expected codeBase or SignedBy or " + - "Principal")); + "expected.codeBase.or.SignedBy.or.Principal")); } } @@ -554,7 +551,7 @@ public class PolicyParser { throw new ParsingException(st.lineno(), ResourcesMgr.getString( - "expected permission entry")); + "expected.permission.entry")); } } match("}"); @@ -727,12 +724,12 @@ public class PolicyParser { switch (lookahead) { case StreamTokenizer.TT_NUMBER: throw new ParsingException(st.lineno(), expect, - ResourcesMgr.getString("number ") + + ResourcesMgr.getString("number.") + String.valueOf(st.nval)); case StreamTokenizer.TT_EOF: MessageFormat form = new MessageFormat( ResourcesMgr.getString - ("expected [expect], read [end of file]")); + ("expected.expect.read.end.of.file.")); Object[] source = {expect}; throw new ParsingException(form.format(source)); case StreamTokenizer.TT_WORD: @@ -809,11 +806,11 @@ public class PolicyParser { switch (lookahead) { case StreamTokenizer.TT_NUMBER: throw new ParsingException(st.lineno(), ";", - ResourcesMgr.getString("number ") + + ResourcesMgr.getString("number.") + String.valueOf(st.nval)); case StreamTokenizer.TT_EOF: throw new ParsingException(ResourcesMgr.getString - ("expected [;], read [end of file]")); + ("expected.read.end.of.file.")); default: lookahead = st.nextToken(); } @@ -973,7 +970,7 @@ public class PolicyParser { public PrincipalEntry(String principalClass, String principalName) { if (principalClass == null || principalName == null) throw new NullPointerException(ResourcesMgr.getString( - "null principalClass or principalName")); + "null.principalClass.or.principalName")); this.principalClass = principalClass; this.principalName = principalName; } @@ -1199,7 +1196,7 @@ public class PolicyParser { public ParsingException(int line, String msg) { super("line " + line + ": " + msg); MessageFormat form = new MessageFormat - (ResourcesMgr.getString("line number: msg")); + (ResourcesMgr.getString("line.number.msg")); Object[] source = {new Integer(line), msg}; i18nMessage = form.format(source); } @@ -1208,7 +1205,7 @@ public class PolicyParser { super("line " + line + ": expected [" + expect + "], found [" + actual + "]"); MessageFormat form = new MessageFormat(ResourcesMgr.getString - ("line number: expected [expect], found [actual]")); + ("line.number.expected.expect.found.actual.")); Object[] source = {new Integer(line), expect, actual}; i18nMessage = form.format(source); } diff --git a/jdk/src/share/classes/sun/security/provider/SeedGenerator.java b/jdk/src/share/classes/sun/security/provider/SeedGenerator.java index ecf132044aa..d66181a6149 100644 --- a/jdk/src/share/classes/sun/security/provider/SeedGenerator.java +++ b/jdk/src/share/classes/sun/security/provider/SeedGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -138,13 +138,7 @@ abstract class SeedGenerator { instance.getSeedBytes(result); } - void getSeedBytes(byte[] result) { - for (int i = 0; i < result.length; i++) { - result[i] = getSeedByte(); - } - } - - abstract byte getSeedByte(); + abstract void getSeedBytes(byte[] result); /** * Retrieve some system information, hashed. @@ -369,6 +363,13 @@ abstract class SeedGenerator { } } + @Override + void getSeedBytes(byte[] result) { + for (int i = 0; i < result.length; i++) { + result[i] = getSeedByte(); + } + } + byte getSeedByte() { byte b = 0; @@ -455,8 +456,7 @@ abstract class SeedGenerator { static class URLSeedGenerator extends SeedGenerator { private String deviceName; - private BufferedInputStream devRandom; - + private InputStream devRandom; /** * The constructor is only called once to construct the one @@ -465,7 +465,7 @@ abstract class SeedGenerator { */ URLSeedGenerator(String egdurl) throws IOException { - if (egdurl == null) { + if (egdurl == null) { throw new IOException("No random source specified"); } deviceName = egdurl; @@ -478,41 +478,78 @@ abstract class SeedGenerator { private void init() throws IOException { final URL device = new URL(deviceName); - devRandom = java.security.AccessController.doPrivileged - (new java.security.PrivilegedAction() { - public BufferedInputStream run() { - try { - return new BufferedInputStream(device.openStream()); - } catch (IOException ioe) { - return null; + try { + devRandom = java.security.AccessController.doPrivileged + (new java.security.PrivilegedExceptionAction() { + public InputStream run() throws IOException { + /* + * return a FileInputStream for file URLs and + * avoid buffering. The openStream() call wraps + * InputStream in a BufferedInputStream which + * can buffer up to 8K bytes. This read is a + * performance issue for entropy sources which + * can be slow to replenish. + */ + if (device.getProtocol().equalsIgnoreCase("file")) { + File deviceFile = getDeviceFile(device); + return new FileInputStream(deviceFile); + } else { + return device.openStream(); } } }); - - if (devRandom == null) { - throw new IOException("failed to open " + device); + } catch (Exception e) { + throw new IOException("Failed to open " + deviceName, e.getCause()); } } - byte getSeedByte() { - byte b[] = new byte[1]; - int stat; + /* + * Use a URI to access this File. Previous code used a URL + * which is less strict on syntax. If we encounter a + * URISyntaxException we make best efforts for backwards + * compatibility. e.g. space character in deviceName string. + * + * Method called within PrivilegedExceptionAction block. + */ + private File getDeviceFile(URL device) throws IOException { try { - stat = devRandom.read(b, 0, b.length); + URI deviceURI = device.toURI(); + if(deviceURI.isOpaque()) { + // File constructor does not accept opaque URI + URI localDir = new File(System.getProperty("user.dir")).toURI(); + String uriPath = localDir.toString() + + deviceURI.toString().substring(5); + return new File(URI.create(uriPath)); + } else { + return new File(deviceURI); + } + } catch (URISyntaxException use) { + /* + * Make best effort to access this File. + * We can try using the URL path. + */ + return new File(device.getPath()); + } + } + + @Override + void getSeedBytes(byte[] result) { + int len = result.length; + int read = 0; + try { + while (read < len) { + int count = devRandom.read(result, read, len - read); + // /dev/random blocks - should never have EOF + if (count < 0) + throw new InternalError("URLSeedGenerator " + deviceName + + " reached end of file"); + read += count; + } } catch (IOException ioe) { throw new InternalError("URLSeedGenerator " + deviceName + " generated exception: " + ioe.getMessage()); } - if (stat == b.length) { - return b[0]; - } else if (stat == -1) { - throw new InternalError("URLSeedGenerator " + deviceName + - " reached end of file"); - } else { - throw new InternalError("URLSeedGenerator " + deviceName + - " failed read"); - } } } diff --git a/jdk/src/share/classes/sun/security/provider/Sun.java b/jdk/src/share/classes/sun/security/provider/Sun.java index e2fed0363a2..078bef6cdf1 100644 --- a/jdk/src/share/classes/sun/security/provider/Sun.java +++ b/jdk/src/share/classes/sun/security/provider/Sun.java @@ -55,7 +55,7 @@ public final class Sun extends Provider { SunEntries.putEntries(this); } else { // use LinkedHashMap to preserve the order of the PRNGs - Map map = new LinkedHashMap(); + Map map = new LinkedHashMap<>(); SunEntries.putEntries(map); AccessController.doPrivileged(new PutAllAction(this, map)); } diff --git a/jdk/src/share/classes/sun/security/provider/VerificationProvider.java b/jdk/src/share/classes/sun/security/provider/VerificationProvider.java index 18af2e88f6f..86801228abe 100644 --- a/jdk/src/share/classes/sun/security/provider/VerificationProvider.java +++ b/jdk/src/share/classes/sun/security/provider/VerificationProvider.java @@ -76,7 +76,7 @@ public final class VerificationProvider extends Provider { SunRsaSignEntries.putEntries(this); } else { // use LinkedHashMap to preserve the order of the PRNGs - Map map = new LinkedHashMap(); + Map map = new LinkedHashMap<>(); SunEntries.putEntries(map); SunRsaSignEntries.putEntries(map); AccessController.doPrivileged(new PutAllAction(this, map)); diff --git a/jdk/src/share/classes/sun/security/provider/X509Factory.java b/jdk/src/share/classes/sun/security/provider/X509Factory.java index e785b655a2e..8ec0cbe5941 100644 --- a/jdk/src/share/classes/sun/security/provider/X509Factory.java +++ b/jdk/src/share/classes/sun/security/provider/X509Factory.java @@ -409,10 +409,10 @@ public class X509Factory extends CertificateFactorySpi { parseX509orPKCS7Cert(InputStream is) throws CertificateException, IOException { - Collection coll = new ArrayList(); + Collection coll = new ArrayList<>(); byte[] data = readOneBlock(is); if (data == null) { - return new ArrayList(0); + return new ArrayList<>(0); } try { PKCS7 pkcs7 = new PKCS7(data); @@ -422,7 +422,7 @@ public class X509Factory extends CertificateFactorySpi { return Arrays.asList(certs); } else { // no crls provided - return new ArrayList(0); + return new ArrayList<>(0); } } catch (ParsingException e) { while (data != null) { @@ -442,10 +442,10 @@ public class X509Factory extends CertificateFactorySpi { parseX509orPKCS7CRL(InputStream is) throws CRLException, IOException { - Collection coll = new ArrayList(); + Collection coll = new ArrayList<>(); byte[] data = readOneBlock(is); if (data == null) { - return new ArrayList(0); + return new ArrayList<>(0); } try { PKCS7 pkcs7 = new PKCS7(data); @@ -455,7 +455,7 @@ public class X509Factory extends CertificateFactorySpi { return Arrays.asList(crls); } else { // no crls provided - return new ArrayList(0); + return new ArrayList<>(0); } } catch (ParsingException e) { while (data != null) { diff --git a/jdk/src/share/classes/sun/security/provider/certpath/AlgorithmChecker.java b/jdk/src/share/classes/sun/security/provider/certpath/AlgorithmChecker.java index eb18820b2b8..69e560ed4bf 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/AlgorithmChecker.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/AlgorithmChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,95 +25,336 @@ package sun.security.provider.certpath; -import java.util.Set; +import java.security.AlgorithmConstraints; +import java.security.CryptoPrimitive; import java.util.Collection; -import java.util.Locale; +import java.util.Collections; +import java.util.Set; +import java.util.EnumSet; +import java.util.HashSet; +import java.math.BigInteger; +import java.security.PublicKey; +import java.security.KeyFactory; +import java.security.AlgorithmParameters; +import java.security.NoSuchAlgorithmException; +import java.security.GeneralSecurityException; import java.security.cert.Certificate; -import java.security.cert.X509Certificate; import java.security.cert.X509CRL; -import java.security.cert.CertPathValidatorException; +import java.security.cert.X509Certificate; import java.security.cert.PKIXCertPathChecker; +import java.security.cert.TrustAnchor; +import java.security.cert.CRLException; +import java.security.cert.CertificateException; +import java.security.cert.CertPathValidatorException; +import java.io.IOException; +import java.security.interfaces.*; +import java.security.spec.*; +import sun.security.util.DisabledAlgorithmConstraints; +import sun.security.x509.X509CertImpl; +import sun.security.x509.X509CRLImpl; import sun.security.x509.AlgorithmId; /** - * AlgorithmChecker is a PKIXCertPathChecker that checks that - * the signature algorithm of the specified certificate is not disabled. + * A PKIXCertPathChecker implementation to check whether a + * specified certificate contains the required algorithm constraints. + *

      + * Certificate fields such as the subject public key, the signature + * algorithm, key usage, extended key usage, etc. need to conform to + * the specified algorithm constraints. * - * @author Xuelei Fan + * @see PKIXCertPathChecker + * @see PKIXParameters */ final public class AlgorithmChecker extends PKIXCertPathChecker { - // the disabled algorithms - private static final String[] disabledAlgorithms = new String[] {"md2"}; + private final AlgorithmConstraints constraints; + private final PublicKey trustedPubKey; + private PublicKey prevPubKey; - // singleton instance - static final AlgorithmChecker INSTANCE = new AlgorithmChecker(); + private final static Set SIGNATURE_PRIMITIVE_SET = + EnumSet.of(CryptoPrimitive.SIGNATURE); + + private final static DisabledAlgorithmConstraints + certPathDefaultConstraints = new DisabledAlgorithmConstraints( + DisabledAlgorithmConstraints.PROPERTY_CERTPATH_DISABLED_ALGS); /** - * Default Constructor + * Create a new AlgorithmChecker with the algorithm + * constraints specified in security property + * "jdk.certpath.disabledAlgorithms". + * + * @param anchor the trust anchor selected to validate the target + * certificate */ - private AlgorithmChecker() { - // do nothing + public AlgorithmChecker(TrustAnchor anchor) { + this(anchor, certPathDefaultConstraints); } /** - * Return a AlgorithmChecker instance. + * Create a new AlgorithmChecker with the + * given {@code AlgorithmConstraints}. + *

      + * Note that this constructor will be used to check a certification + * path where the trust anchor is unknown, or a certificate list which may + * contain the trust anchor. This constructor is used by SunJSSE. + * + * @param constraints the algorithm constraints (or null) */ - static AlgorithmChecker getInstance() { - return INSTANCE; + public AlgorithmChecker(AlgorithmConstraints constraints) { + this.prevPubKey = null; + this.trustedPubKey = null; + this.constraints = constraints; } /** - * Initializes the internal state of the checker from parameters - * specified in the constructor. + * Create a new AlgorithmChecker with the + * given TrustAnchor and AlgorithmConstraints. + * + * @param anchor the trust anchor selected to validate the target + * certificate + * @param constraints the algorithm constraints (or null) + * + * @throws IllegalArgumentException if the anchor is null */ + public AlgorithmChecker(TrustAnchor anchor, + AlgorithmConstraints constraints) { + + if (anchor == null) { + throw new IllegalArgumentException( + "The trust anchor cannot be null"); + } + + if (anchor.getTrustedCert() != null) { + this.trustedPubKey = anchor.getTrustedCert().getPublicKey(); + } else { + this.trustedPubKey = anchor.getCAPublicKey(); + } + + this.prevPubKey = trustedPubKey; + this.constraints = constraints; + } + + @Override public void init(boolean forward) throws CertPathValidatorException { - // do nothing + // Note that this class does not support forward mode. + if (!forward) { + if (trustedPubKey != null) { + prevPubKey = trustedPubKey; + } else { + prevPubKey = null; + } + } else { + throw new + CertPathValidatorException("forward checking not supported"); + } } + @Override public boolean isForwardCheckingSupported() { + // Note that as this class does not support forward mode, the method + // will always returns false. return false; } + @Override public Set getSupportedExtensions() { return null; } + @Override + public void check(Certificate cert, + Collection unresolvedCritExts) + throws CertPathValidatorException { + + if (!(cert instanceof X509Certificate) || constraints == null) { + // ignore the check for non-x.509 certificate or null constraints + return; + } + + X509CertImpl x509Cert = null; + try { + x509Cert = X509CertImpl.toImpl((X509Certificate)cert); + } catch (CertificateException ce) { + throw new CertPathValidatorException(ce); + } + + PublicKey currPubKey = x509Cert.getPublicKey(); + String currSigAlg = x509Cert.getSigAlgName(); + + AlgorithmId algorithmId = null; + try { + algorithmId = (AlgorithmId)x509Cert.get(X509CertImpl.SIG_ALG); + } catch (CertificateException ce) { + throw new CertPathValidatorException(ce); + } + + AlgorithmParameters currSigAlgParams = algorithmId.getParameters(); + + // Check the current signature algorithm + if (!constraints.permits( + SIGNATURE_PRIMITIVE_SET, + currSigAlg, currSigAlgParams)) { + throw new CertPathValidatorException( + "Algorithm constraints check failed: " + currSigAlg); + } + + // check the key usage and key size + boolean[] keyUsage = x509Cert.getKeyUsage(); + if (keyUsage != null && keyUsage.length < 9) { + throw new CertPathValidatorException( + "incorrect KeyUsage extension"); + } + + if (keyUsage != null) { + Set primitives = + EnumSet.noneOf(CryptoPrimitive.class); + + if (keyUsage[0] || keyUsage[1] || keyUsage[5] || keyUsage[6]) { + // keyUsage[0]: KeyUsage.digitalSignature + // keyUsage[1]: KeyUsage.nonRepudiation + // keyUsage[5]: KeyUsage.keyCertSign + // keyUsage[6]: KeyUsage.cRLSign + primitives.add(CryptoPrimitive.SIGNATURE); + } + + if (keyUsage[2]) { // KeyUsage.keyEncipherment + primitives.add(CryptoPrimitive.KEY_ENCAPSULATION); + } + + if (keyUsage[3]) { // KeyUsage.dataEncipherment + primitives.add(CryptoPrimitive.PUBLIC_KEY_ENCRYPTION); + } + + if (keyUsage[4]) { // KeyUsage.keyAgreement + primitives.add(CryptoPrimitive.KEY_AGREEMENT); + } + + // KeyUsage.encipherOnly and KeyUsage.decipherOnly are + // undefined in the absence of the keyAgreement bit. + + if (!primitives.isEmpty()) { + if (!constraints.permits(primitives, currPubKey)) { + throw new CertPathValidatorException( + "algorithm constraints check failed"); + } + } + } + + // Check with previous cert for signature algorithm and public key + if (prevPubKey != null) { + if (currSigAlg != null) { + if (!constraints.permits( + SIGNATURE_PRIMITIVE_SET, + currSigAlg, prevPubKey, currSigAlgParams)) { + throw new CertPathValidatorException( + "Algorithm constraints check failed: " + currSigAlg); + } + } + + // Inherit key parameters from previous key + if (currPubKey instanceof DSAPublicKey && + ((DSAPublicKey)currPubKey).getParams() == null) { + // Inherit DSA parameters from previous key + if (!(prevPubKey instanceof DSAPublicKey)) { + throw new CertPathValidatorException("Input key is not " + + "of a appropriate type for inheriting parameters"); + } + + DSAParams params = ((DSAPublicKey)prevPubKey).getParams(); + if (params == null) { + throw new CertPathValidatorException( + "Key parameters missing"); + } + + try { + BigInteger y = ((DSAPublicKey)currPubKey).getY(); + KeyFactory kf = KeyFactory.getInstance("DSA"); + DSAPublicKeySpec ks = new DSAPublicKeySpec(y, + params.getP(), + params.getQ(), + params.getG()); + currPubKey = kf.generatePublic(ks); + } catch (GeneralSecurityException e) { + throw new CertPathValidatorException("Unable to generate " + + "key with inherited parameters: " + e.getMessage(), e); + } + } + } + + // reset the previous public key + prevPubKey = currPubKey; + + // check the extended key usage, ignore the check now + // List extendedKeyUsages = x509Cert.getExtendedKeyUsage(); + + // DO NOT remove any unresolved critical extensions + } + /** - * Checks the signature algorithm of the specified certificate. + * Try to set the trust anchor of the checker. + *

      + * If there is no trust anchor specified and the checker has not started, + * set the trust anchor. + * + * @param anchor the trust anchor selected to validate the target + * certificate */ - public void check(Certificate cert, Collection unresolvedCritExts) - throws CertPathValidatorException { - check(cert); - } + void trySetTrustAnchor(TrustAnchor anchor) { + // Don't bother if the check has started or trust anchor has already + // specified. + if (prevPubKey == null) { + if (anchor == null) { + throw new IllegalArgumentException( + "The trust anchor cannot be null"); + } - public static void check(Certificate cert) - throws CertPathValidatorException { - X509Certificate xcert = (X509Certificate)cert; - check(xcert.getSigAlgName()); - } - - static void check(AlgorithmId aid) throws CertPathValidatorException { - check(aid.getName()); - } - - static void check(X509CRL crl) throws CertPathValidatorException { - check(crl.getSigAlgName()); - } - - private static void check(String algName) - throws CertPathValidatorException { - - String lowerCaseAlgName = algName.toLowerCase(Locale.ENGLISH); - - for (String disabled : disabledAlgorithms) { - // checking the signature algorithm name - if (lowerCaseAlgName.indexOf(disabled) != -1) { - throw new CertPathValidatorException( - "algorithm check failed: " + algName + " is disabled"); + // Don't bother to change the trustedPubKey. + if (anchor.getTrustedCert() != null) { + prevPubKey = anchor.getTrustedCert().getPublicKey(); + } else { + prevPubKey = anchor.getCAPublicKey(); } } } + /** + * Check the signature algorithm with the specified public key. + * + * @param key the public key to verify the CRL signature + * @param crl the target CRL + */ + static void check(PublicKey key, X509CRL crl) + throws CertPathValidatorException { + + X509CRLImpl x509CRLImpl = null; + try { + x509CRLImpl = X509CRLImpl.toImpl(crl); + } catch (CRLException ce) { + throw new CertPathValidatorException(ce); + } + + AlgorithmId algorithmId = x509CRLImpl.getSigAlgId(); + check(key, algorithmId); + } + + /** + * Check the signature algorithm with the specified public key. + * + * @param key the public key to verify the CRL signature + * @param crl the target CRL + */ + static void check(PublicKey key, AlgorithmId algorithmId) + throws CertPathValidatorException { + String sigAlgName = algorithmId.getName(); + AlgorithmParameters sigAlgParams = algorithmId.getParameters(); + + if (!certPathDefaultConstraints.permits( + SIGNATURE_PRIMITIVE_SET, sigAlgName, key, sigAlgParams)) { + throw new CertPathValidatorException( + "algorithm check failed: " + sigAlgName + " is disabled"); + } + } + } + diff --git a/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java b/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java index 4dd29710ef1..a980e7d1657 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -289,16 +289,6 @@ class DistributionPointFetcher { X500Name certIssuer = (X500Name) certImpl.getIssuerDN(); X500Name crlIssuer = (X500Name) crlImpl.getIssuerDN(); - // check the crl signature algorithm - try { - AlgorithmChecker.check(crl); - } catch (CertPathValidatorException cpve) { - if (debug != null) { - debug.println("CRL signature algorithm check failed: " + cpve); - } - return false; - } - // if crlIssuer is set, verify that it matches the issuer of the // CRL and the CRL contains an IDP extension with the indirectCRL // boolean asserted. Otherwise, verify that the CRL issuer matches the @@ -637,6 +627,16 @@ class DistributionPointFetcher { } } + // check the crl signature algorithm + try { + AlgorithmChecker.check(prevKey, crl); + } catch (CertPathValidatorException cpve) { + if (debug != null) { + debug.println("CRL signature algorithm check failed: " + cpve); + } + return false; + } + // validate the signature on the CRL try { crl.verify(prevKey, provider); diff --git a/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java b/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java index ae7ccd38846..7e828884940 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -718,11 +718,6 @@ class ForwardBuilder extends Builder { /* we don't perform any validation of the trusted cert */ if (!isTrustedCert) { - /* - * check that the signature algorithm is not disabled. - */ - AlgorithmChecker.check(cert); - /* * Check CRITICAL private extensions for user checkers that * support forward checking (forwardCheckers) and remove diff --git a/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java b/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java index b72cd79a31c..d734ff90408 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -327,6 +327,10 @@ class OCSPChecker extends PKIXCertPathChecker { "(set using the OCSP security properties)."); } + // The algorithm constraints of the OCSP trusted responder certificate + // does not need to be checked in this code. The constraints will be + // checked when the responder's certificate is validated. + CertId certId = null; OCSPResponse response = null; try { diff --git a/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java b/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java index 0b64e412cf6..63566dd5558 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +32,7 @@ import java.security.cert.CertificateException; import java.security.cert.CertificateParsingException; import java.security.cert.CertPathValidatorException; import java.security.cert.CRLReason; +import java.security.cert.TrustAnchor; import java.security.cert.X509Certificate; import java.util.Collections; import java.util.Date; @@ -371,6 +372,13 @@ public final class OCSPResponse { "OCSP responses", cpe); } + // Check algorithm constraints specified in security property + // "jdk.certpath.disabledAlgorithms". + AlgorithmChecker algChecker = new AlgorithmChecker( + new TrustAnchor(responderCert, null)); + algChecker.init(false); + algChecker.check(cert, Collections.emptySet()); + // check the validity try { if (dateCheckedAgainst == null) { @@ -422,6 +430,10 @@ public final class OCSPResponse { // Confirm that the signed response was generated using the public // key from the trusted responder cert if (responderCert != null) { + // Check algorithm constraints specified in security property + // "jdk.certpath.disabledAlgorithms". + AlgorithmChecker.check(responderCert.getPublicKey(), sigAlgId); + if (!verifyResponse(responseDataDer, responderCert, sigAlgId, signature)) { throw new CertPathValidatorException( diff --git a/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java b/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java index fa954ce2fde..d8fbadf199a 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -275,7 +275,7 @@ public class PKIXCertPathValidator extends CertPathValidatorSpi { int certPathLen = certList.size(); basicChecker = new BasicChecker(anchor, testDate, sigProvider, false); - AlgorithmChecker algorithmChecker= AlgorithmChecker.getInstance(); + AlgorithmChecker algorithmChecker = new AlgorithmChecker(anchor); KeyChecker keyChecker = new KeyChecker(certPathLen, pkixParam.getTargetCertConstraints()); ConstraintsChecker constraintsChecker = diff --git a/jdk/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java b/jdk/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java index 7705dcf363d..7bb5ee632d9 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -347,9 +347,6 @@ class ReverseBuilder extends Builder { return; } - /* check that the signature algorithm is not disabled. */ - AlgorithmChecker.check(cert); - /* * check for looping - abort a loop if * ((we encounter the same certificate twice) AND @@ -470,9 +467,16 @@ class ReverseBuilder extends Builder { if (unresolvedCritExts == null) { unresolvedCritExts = Collections.emptySet(); } + + /* + * Check that the signature algorithm is not disabled. + */ + currentState.algorithmChecker.check(cert, unresolvedCritExts); + for (PKIXCertPathChecker checker : currentState.userCheckers) { checker.check(cert, unresolvedCritExts); } + /* * Look at the remaining extensions and remove any ones we have * already checked. If there are any left, throw an exception! diff --git a/jdk/src/share/classes/sun/security/provider/certpath/ReverseState.java b/jdk/src/share/classes/sun/security/provider/certpath/ReverseState.java index 0b795c3b0f3..b7285a140a5 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/ReverseState.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/ReverseState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,6 +96,9 @@ class ReverseState implements State { /* the checker used for revocation status */ public CrlRevocationChecker crlChecker; + /* the algorithm checker */ + AlgorithmChecker algorithmChecker; + /* the trust anchor used to validate the path */ TrustAnchor trustAnchor; @@ -241,6 +244,14 @@ class ReverseState implements State { updateState(anchor.getCAPublicKey(), caName); } + // The user specified AlgorithmChecker may not be + // able to set the trust anchor until now. + for (PKIXCertPathChecker checker : userCheckers) { + if (checker instanceof AlgorithmChecker) { + ((AlgorithmChecker)checker).trySetTrustAnchor(anchor); + } + } + init = false; } diff --git a/jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java b/jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java index 85a9c01015a..b4dac76ae31 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -302,6 +302,7 @@ public final class SunCertPathBuilder extends CertPathBuilderSpi { // init the crl checker currentState.crlChecker = new CrlRevocationChecker(null, buildParams, null, onlyEECert); + currentState.algorithmChecker = new AlgorithmChecker(anchor); try { depthFirstSearchReverse(null, currentState, new ReverseBuilder(buildParams, targetSubjectDN), adjacencyList, @@ -475,29 +476,41 @@ public final class SunCertPathBuilder extends CertPathBuilderSpi { userCheckers.add(mustCheck, policyChecker); mustCheck++; + // add the algorithm checker + userCheckers.add(mustCheck, + new AlgorithmChecker(builder.trustAnchor)); + mustCheck++; + if (nextState.keyParamsNeeded()) { PublicKey rootKey = cert.getPublicKey(); if (builder.trustAnchor.getTrustedCert() == null) { rootKey = builder.trustAnchor.getCAPublicKey(); if (debug != null) - debug.println("SunCertPathBuilder.depthFirstSearchForward" + - " using buildParams public key: " + - rootKey.toString()); + debug.println( + "SunCertPathBuilder.depthFirstSearchForward " + + "using buildParams public key: " + + rootKey.toString()); } TrustAnchor anchor = new TrustAnchor (cert.getSubjectX500Principal(), rootKey, null); + + // add the basic checker basicChecker = new BasicChecker(anchor, builder.date, buildParams.getSigProvider(), true); userCheckers.add(mustCheck, basicChecker); mustCheck++; + + // add the crl revocation checker if (buildParams.isRevocationEnabled()) { userCheckers.add(mustCheck, new CrlRevocationChecker (anchor, buildParams, null, onlyEECert)); mustCheck++; } } + // Why we don't need BasicChecker and CrlRevocationChecker + // if nextState.keyParamsNeeded() is false? for (int i=0; i= mustCheck && + currChecker instanceof AlgorithmChecker) { + ((AlgorithmChecker)currChecker). + trySetTrustAnchor(builder.trustAnchor); + } } try { diff --git a/jdk/src/share/classes/sun/security/rsa/RSACore.java b/jdk/src/share/classes/sun/security/rsa/RSACore.java index 4b3ec9afa28..42ebc3c1a48 100644 --- a/jdk/src/share/classes/sun/security/rsa/RSACore.java +++ b/jdk/src/share/classes/sun/security/rsa/RSACore.java @@ -215,11 +215,11 @@ public final class RSACore { // value suggested by Paul Kocher (quoted by NSS) private final static int BLINDING_MAX_REUSE = 50; - // cache for blinding parameters. Map + // cache for blinding parameters. Map // use a weak hashmap so that cached values are automatically cleared // when the modulus is GC'ed - private final static Map blindingCache = - new WeakHashMap(); + private final static Map blindingCache = + new WeakHashMap<>(); /** * Set of blinding parameters for a given RSA key. diff --git a/jdk/src/share/classes/sun/security/rsa/RSASignature.java b/jdk/src/share/classes/sun/security/rsa/RSASignature.java index 5f02bf4ffcd..c510413a215 100644 --- a/jdk/src/share/classes/sun/security/rsa/RSASignature.java +++ b/jdk/src/share/classes/sun/security/rsa/RSASignature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ import sun.security.x509.AlgorithmId; public abstract class RSASignature extends SignatureSpi { // we sign an ASN.1 SEQUENCE of AlgorithmId and digest - // it has the form 30:xx:30:0c:[digestOID]:05:00:04:xx:[digest] + // it has the form 30:xx:30:xx:[digestOID]:05:00:04:xx:[digest] // this means the encoded length is (8 + digestOID.length + digest.length) private static final int baseLength = 8; @@ -104,7 +104,8 @@ public abstract class RSASignature extends SignatureSpi { // initialize for signing. See JCA doc protected void engineInitSign(PrivateKey privateKey, SecureRandom random) throws InvalidKeyException { - RSAPrivateKey rsaKey = (RSAPrivateKey)RSAKeyFactory.toRSAKey(privateKey); + RSAPrivateKey rsaKey = + (RSAPrivateKey)RSAKeyFactory.toRSAKey(privateKey); this.privateKey = rsaKey; this.publicKey = null; initCommon(rsaKey, random); @@ -184,6 +185,11 @@ public abstract class RSASignature extends SignatureSpi { // verify the data and return the result. See JCA doc protected boolean engineVerify(byte[] sigBytes) throws SignatureException { + if (sigBytes.length != RSACore.getByteLength(publicKey)) { + throw new SignatureException("Signature length not correct: got " + + sigBytes.length + " but was expecting " + + RSACore.getByteLength(publicKey)); + } byte[] digest = getDigestValue(); try { byte[] decrypted = RSACore.rsa(sigBytes, publicKey); @@ -212,7 +218,8 @@ public abstract class RSASignature extends SignatureSpi { DerOutputStream out = new DerOutputStream(); new AlgorithmId(oid).encode(out); out.putOctetString(digest); - DerValue result = new DerValue(DerValue.tag_Sequence, out.toByteArray()); + DerValue result = + new DerValue(DerValue.tag_Sequence, out.toByteArray()); return result.toByteArray(); } @@ -229,7 +236,8 @@ public abstract class RSASignature extends SignatureSpi { } AlgorithmId algId = AlgorithmId.parse(values[0]); if (algId.getOID().equals(oid) == false) { - throw new IOException("ObjectIdentifier mismatch: " + algId.getOID()); + throw new IOException("ObjectIdentifier mismatch: " + + algId.getOID()); } if (algId.getEncodedParams() != null) { throw new IOException("Unexpected AlgorithmId parameters"); diff --git a/jdk/src/share/classes/sun/security/rsa/SunRsaSign.java b/jdk/src/share/classes/sun/security/rsa/SunRsaSign.java index 20e56311eb8..b48882c2824 100644 --- a/jdk/src/share/classes/sun/security/rsa/SunRsaSign.java +++ b/jdk/src/share/classes/sun/security/rsa/SunRsaSign.java @@ -52,7 +52,7 @@ public final class SunRsaSign extends Provider { SunRsaSignEntries.putEntries(this); } else { // use LinkedHashMap to preserve the order of the PRNGs - Map map = new HashMap(); + Map map = new HashMap<>(); SunRsaSignEntries.putEntries(map); AccessController.doPrivileged(new PutAllAction(this, map)); } diff --git a/jdk/src/share/classes/sun/security/ssl/CipherBox.java b/jdk/src/share/classes/sun/security/ssl/CipherBox.java index fe68fc7a782..91f9f36198d 100644 --- a/jdk/src/share/classes/sun/security/ssl/CipherBox.java +++ b/jdk/src/share/classes/sun/security/ssl/CipherBox.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ package sun.security.ssl; import java.io.ByteArrayInputStream; import java.io.IOException; +import java.util.Hashtable; import java.security.*; import javax.crypto.*; @@ -50,6 +51,37 @@ import sun.misc.HexDumpEncoder; * Individual instances are obtained by calling the static method * newCipherBox(), which should only be invoked by BulkCipher.newCipher(). * + * In RFC 2246, with bock ciphers in CBC mode, the Initialization + * Vector (IV) for the first record is generated with the other keys + * and secrets when the security parameters are set. The IV for + * subsequent records is the last ciphertext block from the previous + * record. + * + * In RFC 4346, the implicit Initialization Vector (IV) is replaced + * with an explicit IV to protect against CBC attacks. RFC 4346 + * recommends two algorithms used to generated the per-record IV. + * The implementation uses the algorithm (2)(b), as described at + * section 6.2.3.2 of RFC 4346. + * + * The usage of IV in CBC block cipher can be illustrated in + * the following diagrams. + * + * (random) + * R P1 IV C1 + * | | | | + * SIV---+ |-----+ |-... |----- |------ + * | | | | | | | | + * +----+ | +----+ | +----+ | +----+ | + * | Ek | | + Ek + | | Dk | | | Dk | | + * +----+ | +----+ | +----+ | +----+ | + * | | | | | | | | + * |----| |----| SIV--+ |----| |-... + * | | | | + * IV C1 R P1 + * (discard) + * + * CBC Encryption CBC Decryption + * * NOTE that any ciphering involved in key exchange (e.g. with RSA) is * handled separately. * @@ -75,6 +107,21 @@ final class CipherBox { */ private int blockSize; + /** + * secure random + */ + private SecureRandom random; + + /** + * Fixed masks of various block size, as the initial decryption IVs + * for TLS 1.1 or later. + * + * For performance, we do not use random IVs. As the initial decryption + * IVs will be discarded by TLS decryption processes, so the fixed masks + * do not hurt cryptographic strength. + */ + private static Hashtable masks; + /** * NULL cipherbox. Identity operation, no encryption. */ @@ -90,14 +137,37 @@ final class CipherBox { * implementation could be found. */ private CipherBox(ProtocolVersion protocolVersion, BulkCipher bulkCipher, - SecretKey key, IvParameterSpec iv, boolean encrypt) - throws NoSuchAlgorithmException { + SecretKey key, IvParameterSpec iv, SecureRandom random, + boolean encrypt) throws NoSuchAlgorithmException { try { this.protocolVersion = protocolVersion; this.cipher = JsseJce.getCipher(bulkCipher.transformation); int mode = encrypt ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE; - cipher.init(mode, key, iv); - // do not call getBlockSize until after init() + + if (random == null) { + random = JsseJce.getSecureRandom(); + } + this.random = random; + + /* + * RFC 4346 recommends two algorithms used to generated the + * per-record IV. The implementation uses the algorithm (2)(b), + * as described at section 6.2.3.2 of RFC 4346. + * + * As we don't care about the initial IV value for TLS 1.1 or + * later, so if the "iv" parameter is null, we use the default + * value generated by Cipher.init() for encryption, and a fixed + * mask for decryption. + */ + if (iv == null && bulkCipher.ivSize != 0 && + mode == Cipher.DECRYPT_MODE && + protocolVersion.v >= ProtocolVersion.TLS11.v) { + iv = getFixedMask(bulkCipher.ivSize); + } + + cipher.init(mode, key, iv, random); + + // Do not call getBlockSize until after init() // otherwise we would disrupt JCE delayed provider selection blockSize = cipher.getBlockSize(); // some providers implement getBlockSize() incorrectly @@ -119,18 +189,36 @@ final class CipherBox { * Factory method to obtain a new CipherBox object. */ static CipherBox newCipherBox(ProtocolVersion version, BulkCipher cipher, - SecretKey key, IvParameterSpec iv, boolean encrypt) - throws NoSuchAlgorithmException { + SecretKey key, IvParameterSpec iv, SecureRandom random, + boolean encrypt) throws NoSuchAlgorithmException { if (cipher.allowed == false) { throw new NoSuchAlgorithmException("Unsupported cipher " + cipher); } + if (cipher == B_NULL) { return NULL; } else { - return new CipherBox(version, cipher, key, iv, encrypt); + return new CipherBox(version, cipher, key, iv, random, encrypt); } } + /* + * Get a fixed mask, as the initial decryption IVs for TLS 1.1 or later. + */ + private static IvParameterSpec getFixedMask(int ivSize) { + if (masks == null) { + masks = new Hashtable(5); + } + + IvParameterSpec iv = masks.get(ivSize); + if (iv == null) { + iv = new IvParameterSpec(new byte[ivSize]); + masks.put(ivSize, iv); + } + + return iv; + } + /* * Encrypts a block of data, returning the size of the * resulting block. @@ -139,8 +227,26 @@ final class CipherBox { if (cipher == null) { return len; } + try { if (blockSize != 0) { + // TLSv1.1 needs a IV block + if (protocolVersion.v >= ProtocolVersion.TLS11.v) { + // generate a random number + byte[] prefix = new byte[blockSize]; + random.nextBytes(prefix); + + // move forward the plaintext + System.arraycopy(buf, offset, + buf, offset + prefix.length, len); + + // prefix the plaintext + System.arraycopy(prefix, 0, + buf, offset, prefix.length); + + len += prefix.length; + } + len = addPadding(buf, offset, len, blockSize); } if (debug != null && Debug.isOn("plaintext")) { @@ -189,6 +295,34 @@ final class CipherBox { int pos = bb.position(); if (blockSize != 0) { + // TLSv1.1 needs a IV block + if (protocolVersion.v >= ProtocolVersion.TLS11.v) { + // generate a random number + byte[] prefix = new byte[blockSize]; + random.nextBytes(prefix); + + // move forward the plaintext + byte[] buf = null; + int limit = bb.limit(); + if (bb.hasArray()) { + buf = bb.array(); + System.arraycopy(buf, pos, + buf, pos + prefix.length, limit - pos); + bb.limit(limit + prefix.length); + } else { + buf = new byte[limit - pos]; + bb.get(buf, 0, limit - pos); + bb.position(pos + prefix.length); + bb.limit(limit + prefix.length); + bb.put(buf); + } + bb.position(pos); + + // prefix the plaintext + bb.put(prefix); + bb.position(pos); + } + // addPadding adjusts pos/limit len = addPadding(bb, blockSize); bb.position(pos); @@ -236,11 +370,25 @@ final class CipherBox { /* * Decrypts a block of data, returning the size of the * resulting block if padding was required. + * + * For SSLv3 and TLSv1.0, with block ciphers in CBC mode the + * Initialization Vector (IV) for the first record is generated by + * the handshake protocol, the IV for subsequent records is the + * last ciphertext block from the previous record. + * + * From TLSv1.1, the implicit IV is replaced with an explicit IV to + * protect against CBC attacks. + * + * Differentiating between bad_record_mac and decryption_failed alerts + * may permit certain attacks against CBC mode. It is preferable to + * uniformly use the bad_record_mac alert to hide the specific type of + * the error. */ int decrypt(byte[] buf, int offset, int len) throws BadPaddingException { if (cipher == null) { return len; } + try { int newLen = cipher.update(buf, offset, len, buf, offset); if (newLen != len) { @@ -263,6 +411,18 @@ final class CipherBox { if (blockSize != 0) { newLen = removePadding(buf, offset, newLen, blockSize, protocolVersion); + + if (protocolVersion.v >= ProtocolVersion.TLS11.v) { + if (newLen < blockSize) { + throw new BadPaddingException("invalid explicit IV"); + } + + // discards the first cipher block, the IV component. + System.arraycopy(buf, offset + blockSize, + buf, offset, newLen - blockSize); + + newLen -= blockSize; + } } return newLen; } catch (ShortBufferException e) { @@ -277,6 +437,8 @@ final class CipherBox { * point to the end of the decrypted/depadded data. The initial * limit and new limit may be different, given we may * have stripped off some padding bytes. + * + * @see decrypt(byte[], int, int) */ int decrypt(ByteBuffer bb) throws BadPaddingException { @@ -292,7 +454,6 @@ final class CipherBox { * Decrypt "in-place". */ int pos = bb.position(); - ByteBuffer dup = bb.duplicate(); int newLen = cipher.update(dup, bb); if (newLen != len) { @@ -320,6 +481,33 @@ final class CipherBox { if (blockSize != 0) { bb.position(pos); newLen = removePadding(bb, blockSize, protocolVersion); + + if (protocolVersion.v >= ProtocolVersion.TLS11.v) { + if (newLen < blockSize) { + throw new BadPaddingException("invalid explicit IV"); + } + + // discards the first cipher block, the IV component. + byte[] buf = null; + int limit = bb.limit(); + if (bb.hasArray()) { + buf = bb.array(); + System.arraycopy(buf, pos + blockSize, + buf, pos, limit - pos - blockSize); + bb.limit(limit - blockSize); + } else { + buf = new byte[limit - pos - blockSize]; + bb.position(pos + blockSize); + bb.get(buf); + bb.position(pos); + bb.put(buf); + bb.limit(limit - blockSize); + } + + // reset the position to the end of the decrypted data + limit = bb.limit(); + bb.position(limit); + } } return newLen; } catch (ShortBufferException e) { diff --git a/jdk/src/share/classes/sun/security/ssl/CipherSuite.java b/jdk/src/share/classes/sun/security/ssl/CipherSuite.java index b6619a952a8..08146df7621 100644 --- a/jdk/src/share/classes/sun/security/ssl/CipherSuite.java +++ b/jdk/src/share/classes/sun/security/ssl/CipherSuite.java @@ -30,6 +30,7 @@ import java.util.*; import java.security.NoSuchAlgorithmException; import java.security.InvalidKeyException; +import java.security.SecureRandom; import javax.crypto.SecretKey; import javax.crypto.spec.IvParameterSpec; @@ -37,6 +38,7 @@ import javax.crypto.spec.SecretKeySpec; import sun.security.ssl.CipherSuite.*; import static sun.security.ssl.CipherSuite.KeyExchange.*; +import static sun.security.ssl.CipherSuite.PRF.*; import static sun.security.ssl.JsseJce.*; /** @@ -101,19 +103,32 @@ final class CipherSuite implements Comparable { // by default final int priority; - // key exchange, bulk cipher, and mac algorithms. See those classes below. + // key exchange, bulk cipher, mac and prf algorithms. See those + // classes below. final KeyExchange keyExchange; final BulkCipher cipher; final MacAlg macAlg; + final PRF prfAlg; // whether a CipherSuite qualifies as exportable under 512/40 bit rules. + // TLS 1.1+ (RFC 4346) must not negotiate to these suites. final boolean exportable; // true iff implemented and enabled at compile time final boolean allowed; + // obsoleted since protocol version + final int obsoleted; + + // supported since protocol version + final int supported; + + /** + * Constructor for implemented CipherSuites. + */ private CipherSuite(String name, int id, int priority, - KeyExchange keyExchange, BulkCipher cipher, boolean allowed) { + KeyExchange keyExchange, BulkCipher cipher, + boolean allowed, int obsoleted, int supported, PRF prfAlg) { this.name = name; this.id = id; this.priority = priority; @@ -124,6 +139,10 @@ final class CipherSuite implements Comparable { macAlg = M_MD5; } else if (name.endsWith("_SHA")) { macAlg = M_SHA; + } else if (name.endsWith("_SHA256")) { + macAlg = M_SHA256; + } else if (name.endsWith("_SHA384")) { + macAlg = M_SHA384; } else if (name.endsWith("_NULL")) { macAlg = M_NULL; } else if (name.endsWith("_SCSV")) { @@ -136,8 +155,14 @@ final class CipherSuite implements Comparable { allowed &= keyExchange.allowed; allowed &= cipher.allowed; this.allowed = allowed; + this.obsoleted = obsoleted; + this.supported = supported; + this.prfAlg = prfAlg; } + /** + * Constructor for unimplemented CipherSuites. + */ private CipherSuite(String name, int id) { this.name = name; this.id = id; @@ -148,6 +173,9 @@ final class CipherSuite implements Comparable { this.cipher = null; this.macAlg = null; this.exportable = false; + this.obsoleted = ProtocolVersion.LIMIT_MAX_VALUE; + this.supported = ProtocolVersion.LIMIT_MIN_VALUE; + this.prfAlg = P_NONE; } /** @@ -197,10 +225,12 @@ final class CipherSuite implements Comparable { if (s == null) { throw new IllegalArgumentException("Name must not be null"); } + CipherSuite c = nameMap.get(s); if ((c == null) || (c.allowed == false)) { throw new IllegalArgumentException("Unsupported ciphersuite " + s); } + return c; } @@ -227,10 +257,17 @@ final class CipherSuite implements Comparable { return nameMap.values(); } + /* + * Use this method when all of the values need to be specified. + * This is primarily used when defining a new ciphersuite for + * TLS 1.2+ that doesn't use the "default" PRF. + */ private static void add(String name, int id, int priority, - KeyExchange keyExchange, BulkCipher cipher, boolean allowed) { + KeyExchange keyExchange, BulkCipher cipher, + boolean allowed, int obsoleted, int supported, PRF prf) { + CipherSuite c = new CipherSuite(name, id, priority, keyExchange, - cipher, allowed); + cipher, allowed, obsoleted, supported, prf); if (idMap.put(id, c) != null) { throw new RuntimeException("Duplicate ciphersuite definition: " + id + ", " + name); @@ -243,6 +280,41 @@ final class CipherSuite implements Comparable { } } + /* + * Use this method when there is no lower protocol limit where this + * suite can be used, and the PRF is P_SHA256. That is, the + * existing ciphersuites. From RFC 5246: + * + * All cipher suites in this document use P_SHA256. + */ + private static void add(String name, int id, int priority, + KeyExchange keyExchange, BulkCipher cipher, + boolean allowed, int obsoleted) { + // If this is an obsoleted suite, then don't let the TLS 1.2 + // protocol have a valid PRF value. + PRF prf = P_SHA256; + if (obsoleted < ProtocolVersion.TLS12.v) { + prf = P_NONE; + } + + add(name, id, priority, keyExchange, cipher, allowed, obsoleted, + ProtocolVersion.LIMIT_MIN_VALUE, prf); + } + + /* + * Use this method when there is no upper protocol limit. That is, + * suites which have not been obsoleted. + */ + private static void add(String name, int id, int priority, + KeyExchange keyExchange, BulkCipher cipher, boolean allowed) { + add(name, id, priority, keyExchange, + cipher, allowed, ProtocolVersion.LIMIT_MAX_VALUE); + } + + /* + * Use this method to define an unimplemented suite. This provides + * a number<->name mapping that can be used for debugging. + */ private static void add(String name, int id) { CipherSuite c = new CipherSuite(name, id); if (idMap.put(id, c) != null) { @@ -321,7 +393,7 @@ final class CipherSuite implements Comparable { // Map BulkCipher -> Boolean(available) private final static Map availableCache = - new HashMap(8); + new HashMap<>(8); // descriptive name including key size, e.g. AES/128 final String description; @@ -380,10 +452,11 @@ final class CipherSuite implements Comparable { * * @exception NoSuchAlgorithmException if anything goes wrong */ - CipherBox newCipher(ProtocolVersion version, - SecretKey key, IvParameterSpec iv, + CipherBox newCipher(ProtocolVersion version, SecretKey key, + IvParameterSpec iv, SecureRandom random, boolean encrypt) throws NoSuchAlgorithmException { - return CipherBox.newCipherBox(version, this, key, iv, encrypt); + return CipherBox.newCipherBox(version, this, + key, iv, random, encrypt); } /** @@ -402,6 +475,7 @@ final class CipherSuite implements Comparable { if (this == B_AES_256) { return isAvailable(this); } + // always available return true; } @@ -421,7 +495,8 @@ final class CipherSuite implements Comparable { (new byte[cipher.expandedKeySize], cipher.algorithm); IvParameterSpec iv = new IvParameterSpec(new byte[cipher.ivSize]); - cipher.newCipher(ProtocolVersion.DEFAULT, key, iv, true); + cipher.newCipher(ProtocolVersion.DEFAULT, + key, iv, null, true); b = Boolean.TRUE; } catch (NoSuchAlgorithmException e) { b = Boolean.FALSE; @@ -439,7 +514,7 @@ final class CipherSuite implements Comparable { /** * An SSL/TLS key MAC algorithm. * - * Also contains a factory method to obtain in initialized MAC + * Also contains a factory method to obtain an initialized MAC * for this algorithm. */ final static class MacAlg { @@ -499,6 +574,50 @@ final class CipherSuite implements Comparable { final static MacAlg M_NULL = new MacAlg("NULL", 0); final static MacAlg M_MD5 = new MacAlg("MD5", 16); final static MacAlg M_SHA = new MacAlg("SHA", 20); + final static MacAlg M_SHA256 = new MacAlg("SHA256", 32); + final static MacAlg M_SHA384 = new MacAlg("SHA384", 48); + + /** + * PRFs (PseudoRandom Function) from TLS specifications. + * + * TLS 1.1- uses a single MD5/SHA1-based PRF algorithm for generating + * the necessary material. + * + * In TLS 1.2+, all existing/known CipherSuites use SHA256, however + * new Ciphersuites (e.g. RFC 5288) can define specific PRF hash + * algorithms. + */ + static enum PRF { + + // PRF algorithms + P_NONE( "NONE", 0, 0), + P_SHA256("SHA-256", 32, 64), + P_SHA384("SHA-384", 48, 128), + P_SHA512("SHA-512", 64, 128); // not currently used. + + // PRF characteristics + private final String prfHashAlg; + private final int prfHashLength; + private final int prfBlockSize; + + PRF(String prfHashAlg, int prfHashLength, int prfBlockSize) { + this.prfHashAlg = prfHashAlg; + this.prfHashLength = prfHashLength; + this.prfBlockSize = prfBlockSize; + } + + String getPRFHashAlg() { + return prfHashAlg; + } + + int getPRFHashLength() { + return prfHashLength; + } + + int getPRFBlockSize() { + return prfBlockSize; + } + } static { idMap = new HashMap(); @@ -509,198 +628,642 @@ final class CipherSuite implements Comparable { // N: ciphersuites only allowed if we are not in FIPS mode final boolean N = (SunJSSE.isFIPS() == false); + /* + * TLS Cipher Suite Registry, as of August 2010. + * + * http://www.iana.org/assignments/tls-parameters/tls-parameters.xml + * + * Range Registration Procedures Notes + * 000-191 Standards Action Refers to value of first byte + * 192-254 Specification Required Refers to value of first byte + * 255 Reserved for Private Use Refers to value of first byte + * + * Value Description Reference + * 0x00,0x00 TLS_NULL_WITH_NULL_NULL [RFC5246] + * 0x00,0x01 TLS_RSA_WITH_NULL_MD5 [RFC5246] + * 0x00,0x02 TLS_RSA_WITH_NULL_SHA [RFC5246] + * 0x00,0x03 TLS_RSA_EXPORT_WITH_RC4_40_MD5 [RFC4346] + * 0x00,0x04 TLS_RSA_WITH_RC4_128_MD5 [RFC5246] + * 0x00,0x05 TLS_RSA_WITH_RC4_128_SHA [RFC5246] + * 0x00,0x06 TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 [RFC4346] + * 0x00,0x07 TLS_RSA_WITH_IDEA_CBC_SHA [RFC5469] + * 0x00,0x08 TLS_RSA_EXPORT_WITH_DES40_CBC_SHA [RFC4346] + * 0x00,0x09 TLS_RSA_WITH_DES_CBC_SHA [RFC5469] + * 0x00,0x0A TLS_RSA_WITH_3DES_EDE_CBC_SHA [RFC5246] + * 0x00,0x0B TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA [RFC4346] + * 0x00,0x0C TLS_DH_DSS_WITH_DES_CBC_SHA [RFC5469] + * 0x00,0x0D TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA [RFC5246] + * 0x00,0x0E TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA [RFC4346] + * 0x00,0x0F TLS_DH_RSA_WITH_DES_CBC_SHA [RFC5469] + * 0x00,0x10 TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA [RFC5246] + * 0x00,0x11 TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA [RFC4346] + * 0x00,0x12 TLS_DHE_DSS_WITH_DES_CBC_SHA [RFC5469] + * 0x00,0x13 TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA [RFC5246] + * 0x00,0x14 TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA [RFC4346] + * 0x00,0x15 TLS_DHE_RSA_WITH_DES_CBC_SHA [RFC5469] + * 0x00,0x16 TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA [RFC5246] + * 0x00,0x17 TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 [RFC4346] + * 0x00,0x18 TLS_DH_anon_WITH_RC4_128_MD5 [RFC5246] + * 0x00,0x19 TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA [RFC4346] + * 0x00,0x1A TLS_DH_anon_WITH_DES_CBC_SHA [RFC5469] + * 0x00,0x1B TLS_DH_anon_WITH_3DES_EDE_CBC_SHA [RFC5246] + * 0x00,0x1C-1D Reserved to avoid conflicts with SSLv3 [RFC5246] + * 0x00,0x1E TLS_KRB5_WITH_DES_CBC_SHA [RFC2712] + * 0x00,0x1F TLS_KRB5_WITH_3DES_EDE_CBC_SHA [RFC2712] + * 0x00,0x20 TLS_KRB5_WITH_RC4_128_SHA [RFC2712] + * 0x00,0x21 TLS_KRB5_WITH_IDEA_CBC_SHA [RFC2712] + * 0x00,0x22 TLS_KRB5_WITH_DES_CBC_MD5 [RFC2712] + * 0x00,0x23 TLS_KRB5_WITH_3DES_EDE_CBC_MD5 [RFC2712] + * 0x00,0x24 TLS_KRB5_WITH_RC4_128_MD5 [RFC2712] + * 0x00,0x25 TLS_KRB5_WITH_IDEA_CBC_MD5 [RFC2712] + * 0x00,0x26 TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA [RFC2712] + * 0x00,0x27 TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA [RFC2712] + * 0x00,0x28 TLS_KRB5_EXPORT_WITH_RC4_40_SHA [RFC2712] + * 0x00,0x29 TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 [RFC2712] + * 0x00,0x2A TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5 [RFC2712] + * 0x00,0x2B TLS_KRB5_EXPORT_WITH_RC4_40_MD5 [RFC2712] + * 0x00,0x2C TLS_PSK_WITH_NULL_SHA [RFC4785] + * 0x00,0x2D TLS_DHE_PSK_WITH_NULL_SHA [RFC4785] + * 0x00,0x2E TLS_RSA_PSK_WITH_NULL_SHA [RFC4785] + * 0x00,0x2F TLS_RSA_WITH_AES_128_CBC_SHA [RFC5246] + * 0x00,0x30 TLS_DH_DSS_WITH_AES_128_CBC_SHA [RFC5246] + * 0x00,0x31 TLS_DH_RSA_WITH_AES_128_CBC_SHA [RFC5246] + * 0x00,0x32 TLS_DHE_DSS_WITH_AES_128_CBC_SHA [RFC5246] + * 0x00,0x33 TLS_DHE_RSA_WITH_AES_128_CBC_SHA [RFC5246] + * 0x00,0x34 TLS_DH_anon_WITH_AES_128_CBC_SHA [RFC5246] + * 0x00,0x35 TLS_RSA_WITH_AES_256_CBC_SHA [RFC5246] + * 0x00,0x36 TLS_DH_DSS_WITH_AES_256_CBC_SHA [RFC5246] + * 0x00,0x37 TLS_DH_RSA_WITH_AES_256_CBC_SHA [RFC5246] + * 0x00,0x38 TLS_DHE_DSS_WITH_AES_256_CBC_SHA [RFC5246] + * 0x00,0x39 TLS_DHE_RSA_WITH_AES_256_CBC_SHA [RFC5246] + * 0x00,0x3A TLS_DH_anon_WITH_AES_256_CBC_SHA [RFC5246] + * 0x00,0x3B TLS_RSA_WITH_NULL_SHA256 [RFC5246] + * 0x00,0x3C TLS_RSA_WITH_AES_128_CBC_SHA256 [RFC5246] + * 0x00,0x3D TLS_RSA_WITH_AES_256_CBC_SHA256 [RFC5246] + * 0x00,0x3E TLS_DH_DSS_WITH_AES_128_CBC_SHA256 [RFC5246] + * 0x00,0x3F TLS_DH_RSA_WITH_AES_128_CBC_SHA256 [RFC5246] + * 0x00,0x40 TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 [RFC5246] + * 0x00,0x41 TLS_RSA_WITH_CAMELLIA_128_CBC_SHA [RFC5932] + * 0x00,0x42 TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA [RFC5932] + * 0x00,0x43 TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA [RFC5932] + * 0x00,0x44 TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA [RFC5932] + * 0x00,0x45 TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA [RFC5932] + * 0x00,0x46 TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA [RFC5932] + * 0x00,0x47-4F Reserved to avoid conflicts with + * deployed implementations [Pasi_Eronen] + * 0x00,0x50-58 Reserved to avoid conflicts [Pasi Eronen] + * 0x00,0x59-5C Reserved to avoid conflicts with + * deployed implementations [Pasi_Eronen] + * 0x00,0x5D-5F Unassigned + * 0x00,0x60-66 Reserved to avoid conflicts with widely + * deployed implementations [Pasi_Eronen] + * 0x00,0x67 TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 [RFC5246] + * 0x00,0x68 TLS_DH_DSS_WITH_AES_256_CBC_SHA256 [RFC5246] + * 0x00,0x69 TLS_DH_RSA_WITH_AES_256_CBC_SHA256 [RFC5246] + * 0x00,0x6A TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 [RFC5246] + * 0x00,0x6B TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 [RFC5246] + * 0x00,0x6C TLS_DH_anon_WITH_AES_128_CBC_SHA256 [RFC5246] + * 0x00,0x6D TLS_DH_anon_WITH_AES_256_CBC_SHA256 [RFC5246] + * 0x00,0x6E-83 Unassigned + * 0x00,0x84 TLS_RSA_WITH_CAMELLIA_256_CBC_SHA [RFC5932] + * 0x00,0x85 TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA [RFC5932] + * 0x00,0x86 TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA [RFC5932] + * 0x00,0x87 TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA [RFC5932] + * 0x00,0x88 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA [RFC5932] + * 0x00,0x89 TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA [RFC5932] + * 0x00,0x8A TLS_PSK_WITH_RC4_128_SHA [RFC4279] + * 0x00,0x8B TLS_PSK_WITH_3DES_EDE_CBC_SHA [RFC4279] + * 0x00,0x8C TLS_PSK_WITH_AES_128_CBC_SHA [RFC4279] + * 0x00,0x8D TLS_PSK_WITH_AES_256_CBC_SHA [RFC4279] + * 0x00,0x8E TLS_DHE_PSK_WITH_RC4_128_SHA [RFC4279] + * 0x00,0x8F TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA [RFC4279] + * 0x00,0x90 TLS_DHE_PSK_WITH_AES_128_CBC_SHA [RFC4279] + * 0x00,0x91 TLS_DHE_PSK_WITH_AES_256_CBC_SHA [RFC4279] + * 0x00,0x92 TLS_RSA_PSK_WITH_RC4_128_SHA [RFC4279] + * 0x00,0x93 TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA [RFC4279] + * 0x00,0x94 TLS_RSA_PSK_WITH_AES_128_CBC_SHA [RFC4279] + * 0x00,0x95 TLS_RSA_PSK_WITH_AES_256_CBC_SHA [RFC4279] + * 0x00,0x96 TLS_RSA_WITH_SEED_CBC_SHA [RFC4162] + * 0x00,0x97 TLS_DH_DSS_WITH_SEED_CBC_SHA [RFC4162] + * 0x00,0x98 TLS_DH_RSA_WITH_SEED_CBC_SHA [RFC4162] + * 0x00,0x99 TLS_DHE_DSS_WITH_SEED_CBC_SHA [RFC4162] + * 0x00,0x9A TLS_DHE_RSA_WITH_SEED_CBC_SHA [RFC4162] + * 0x00,0x9B TLS_DH_anon_WITH_SEED_CBC_SHA [RFC4162] + * 0x00,0x9C TLS_RSA_WITH_AES_128_GCM_SHA256 [RFC5288] + * 0x00,0x9D TLS_RSA_WITH_AES_256_GCM_SHA384 [RFC5288] + * 0x00,0x9E TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 [RFC5288] + * 0x00,0x9F TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 [RFC5288] + * 0x00,0xA0 TLS_DH_RSA_WITH_AES_128_GCM_SHA256 [RFC5288] + * 0x00,0xA1 TLS_DH_RSA_WITH_AES_256_GCM_SHA384 [RFC5288] + * 0x00,0xA2 TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 [RFC5288] + * 0x00,0xA3 TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 [RFC5288] + * 0x00,0xA4 TLS_DH_DSS_WITH_AES_128_GCM_SHA256 [RFC5288] + * 0x00,0xA5 TLS_DH_DSS_WITH_AES_256_GCM_SHA384 [RFC5288] + * 0x00,0xA6 TLS_DH_anon_WITH_AES_128_GCM_SHA256 [RFC5288] + * 0x00,0xA7 TLS_DH_anon_WITH_AES_256_GCM_SHA384 [RFC5288] + * 0x00,0xA8 TLS_PSK_WITH_AES_128_GCM_SHA256 [RFC5487] + * 0x00,0xA9 TLS_PSK_WITH_AES_256_GCM_SHA384 [RFC5487] + * 0x00,0xAA TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 [RFC5487] + * 0x00,0xAB TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 [RFC5487] + * 0x00,0xAC TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 [RFC5487] + * 0x00,0xAD TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 [RFC5487] + * 0x00,0xAE TLS_PSK_WITH_AES_128_CBC_SHA256 [RFC5487] + * 0x00,0xAF TLS_PSK_WITH_AES_256_CBC_SHA384 [RFC5487] + * 0x00,0xB0 TLS_PSK_WITH_NULL_SHA256 [RFC5487] + * 0x00,0xB1 TLS_PSK_WITH_NULL_SHA384 [RFC5487] + * 0x00,0xB2 TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 [RFC5487] + * 0x00,0xB3 TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 [RFC5487] + * 0x00,0xB4 TLS_DHE_PSK_WITH_NULL_SHA256 [RFC5487] + * 0x00,0xB5 TLS_DHE_PSK_WITH_NULL_SHA384 [RFC5487] + * 0x00,0xB6 TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 [RFC5487] + * 0x00,0xB7 TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 [RFC5487] + * 0x00,0xB8 TLS_RSA_PSK_WITH_NULL_SHA256 [RFC5487] + * 0x00,0xB9 TLS_RSA_PSK_WITH_NULL_SHA384 [RFC5487] + * 0x00,0xBA TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] + * 0x00,0xBB TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] + * 0x00,0xBC TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] + * 0x00,0xBD TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] + * 0x00,0xBE TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] + * 0x00,0xBF TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] + * 0x00,0xC0 TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] + * 0x00,0xC1 TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] + * 0x00,0xC2 TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] + * 0x00,0xC3 TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] + * 0x00,0xC4 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] + * 0x00,0xC5 TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] + * 0x00,0xC6-FE Unassigned + * 0x00,0xFF TLS_EMPTY_RENEGOTIATION_INFO_SCSV [RFC5746] + * 0x01-BF,* Unassigned + * 0xC0,0x01 TLS_ECDH_ECDSA_WITH_NULL_SHA [RFC4492] + * 0xC0,0x02 TLS_ECDH_ECDSA_WITH_RC4_128_SHA [RFC4492] + * 0xC0,0x03 TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA [RFC4492] + * 0xC0,0x04 TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA [RFC4492] + * 0xC0,0x05 TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA [RFC4492] + * 0xC0,0x06 TLS_ECDHE_ECDSA_WITH_NULL_SHA [RFC4492] + * 0xC0,0x07 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA [RFC4492] + * 0xC0,0x08 TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA [RFC4492] + * 0xC0,0x09 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA [RFC4492] + * 0xC0,0x0A TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA [RFC4492] + * 0xC0,0x0B TLS_ECDH_RSA_WITH_NULL_SHA [RFC4492] + * 0xC0,0x0C TLS_ECDH_RSA_WITH_RC4_128_SHA [RFC4492] + * 0xC0,0x0D TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA [RFC4492] + * 0xC0,0x0E TLS_ECDH_RSA_WITH_AES_128_CBC_SHA [RFC4492] + * 0xC0,0x0F TLS_ECDH_RSA_WITH_AES_256_CBC_SHA [RFC4492] + * 0xC0,0x10 TLS_ECDHE_RSA_WITH_NULL_SHA [RFC4492] + * 0xC0,0x11 TLS_ECDHE_RSA_WITH_RC4_128_SHA [RFC4492] + * 0xC0,0x12 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA [RFC4492] + * 0xC0,0x13 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA [RFC4492] + * 0xC0,0x14 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA [RFC4492] + * 0xC0,0x15 TLS_ECDH_anon_WITH_NULL_SHA [RFC4492] + * 0xC0,0x16 TLS_ECDH_anon_WITH_RC4_128_SHA [RFC4492] + * 0xC0,0x17 TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA [RFC4492] + * 0xC0,0x18 TLS_ECDH_anon_WITH_AES_128_CBC_SHA [RFC4492] + * 0xC0,0x19 TLS_ECDH_anon_WITH_AES_256_CBC_SHA [RFC4492] + * 0xC0,0x1A TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA [RFC5054] + * 0xC0,0x1B TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA [RFC5054] + * 0xC0,0x1C TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA [RFC5054] + * 0xC0,0x1D TLS_SRP_SHA_WITH_AES_128_CBC_SHA [RFC5054] + * 0xC0,0x1E TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA [RFC5054] + * 0xC0,0x1F TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA [RFC5054] + * 0xC0,0x20 TLS_SRP_SHA_WITH_AES_256_CBC_SHA [RFC5054] + * 0xC0,0x21 TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA [RFC5054] + * 0xC0,0x22 TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA [RFC5054] + * 0xC0,0x23 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 [RFC5289] + * 0xC0,0x24 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 [RFC5289] + * 0xC0,0x25 TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 [RFC5289] + * 0xC0,0x26 TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 [RFC5289] + * 0xC0,0x27 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 [RFC5289] + * 0xC0,0x28 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 [RFC5289] + * 0xC0,0x29 TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 [RFC5289] + * 0xC0,0x2A TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 [RFC5289] + * 0xC0,0x2B TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 [RFC5289] + * 0xC0,0x2C TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 [RFC5289] + * 0xC0,0x2D TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 [RFC5289] + * 0xC0,0x2E TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 [RFC5289] + * 0xC0,0x2F TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 [RFC5289] + * 0xC0,0x30 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 [RFC5289] + * 0xC0,0x31 TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 [RFC5289] + * 0xC0,0x32 TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 [RFC5289] + * 0xC0,0x33 TLS_ECDHE_PSK_WITH_RC4_128_SHA [RFC5489] + * 0xC0,0x34 TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA [RFC5489] + * 0xC0,0x35 TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA [RFC5489] + * 0xC0,0x36 TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA [RFC5489] + * 0xC0,0x37 TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 [RFC5489] + * 0xC0,0x38 TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 [RFC5489] + * 0xC0,0x39 TLS_ECDHE_PSK_WITH_NULL_SHA [RFC5489] + * 0xC0,0x3A TLS_ECDHE_PSK_WITH_NULL_SHA256 [RFC5489] + * 0xC0,0x3B TLS_ECDHE_PSK_WITH_NULL_SHA384 [RFC5489] + * 0xC0,0x3C-FF Unassigned + * 0xC1-FD,* Unassigned + * 0xFE,0x00-FD Unassigned + * 0xFE,0xFE-FF Reserved to avoid conflicts with widely + * deployed implementations [Pasi_Eronen] + * 0xFF,0x00-FF Reserved for Private Use [RFC5246] + */ + add("SSL_NULL_WITH_NULL_NULL", 0x0000, 1, K_NULL, B_NULL, F); - // Definition of the CipherSuites that are enabled by default. - // They are listed in preference order, most preferred first. + /* + * Definition of the CipherSuites that are enabled by default. + * They are listed in preference order, most preferred first, using + * the following criteria: + * 1. Prefer the stronger buld cipher, in the order of AES_256, + * AES_128, RC-4, 3DES-EDE. + * 2. Prefer the stronger MAC algorithm, in the order of SHA384, + * SHA256, SHA, MD5. + * 3. Prefer the better performance of key exchange and digital + * signature algorithm, in the order of ECDHE-ECDSA, ECDHE-RSA, + * RSA, ECDH-ECDSA, ECDH-RSA, DHE-RSA, DHE-DSS. + */ int p = DEFAULT_SUITES_PRIORITY * 2; - add("SSL_RSA_WITH_RC4_128_MD5", - 0x0004, --p, K_RSA, B_RC4_128, N); - add("SSL_RSA_WITH_RC4_128_SHA", - 0x0005, --p, K_RSA, B_RC4_128, N); - add("TLS_RSA_WITH_AES_128_CBC_SHA", - 0x002f, --p, K_RSA, B_AES_128, T); - add("TLS_RSA_WITH_AES_256_CBC_SHA", - 0x0035, --p, K_RSA, B_AES_256, T); + // shorten names to fit the following table cleanly. + int max = ProtocolVersion.LIMIT_MAX_VALUE; + int tls11 = ProtocolVersion.TLS11.v; + int tls12 = ProtocolVersion.TLS12.v; - add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA", - 0xC002, --p, K_ECDH_ECDSA, B_RC4_128, N); - add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", - 0xC004, --p, K_ECDH_ECDSA, B_AES_128, T); + // ID Key Exchange Cipher A obs suprt PRF + // ====== ============ ========= = === ===== ======== + add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", + 0xc024, --p, K_ECDHE_ECDSA, B_AES_256, T, max, tls12, P_SHA384); + add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", + 0xc028, --p, K_ECDHE_RSA, B_AES_256, T, max, tls12, P_SHA384); + add("TLS_RSA_WITH_AES_256_CBC_SHA256", + 0x003d, --p, K_RSA, B_AES_256, T, max, tls12, P_SHA256); + add("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", + 0xc026, --p, K_ECDH_ECDSA, B_AES_256, T, max, tls12, P_SHA384); + add("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", + 0xc02a, --p, K_ECDH_RSA, B_AES_256, T, max, tls12, P_SHA384); + add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", + 0x006b, --p, K_DHE_RSA, B_AES_256, T, max, tls12, P_SHA256); + add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", + 0x006a, --p, K_DHE_DSS, B_AES_256, T, max, tls12, P_SHA256); + + add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + 0xC00A, --p, K_ECDHE_ECDSA, B_AES_256, T); + add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + 0xC014, --p, K_ECDHE_RSA, B_AES_256, T); + add("TLS_RSA_WITH_AES_256_CBC_SHA", + 0x0035, --p, K_RSA, B_AES_256, T); add("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", - 0xC005, --p, K_ECDH_ECDSA, B_AES_256, T); - add("TLS_ECDH_RSA_WITH_RC4_128_SHA", - 0xC00C, --p, K_ECDH_RSA, B_RC4_128, N); - add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", - 0xC00E, --p, K_ECDH_RSA, B_AES_128, T); + 0xC005, --p, K_ECDH_ECDSA, B_AES_256, T); add("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", - 0xC00F, --p, K_ECDH_RSA, B_AES_256, T); + 0xC00F, --p, K_ECDH_RSA, B_AES_256, T); + add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA", + 0x0039, --p, K_DHE_RSA, B_AES_256, T); + add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA", + 0x0038, --p, K_DHE_DSS, B_AES_256, T); + + add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + 0xc023, --p, K_ECDHE_ECDSA, B_AES_128, T, max, tls12, P_SHA256); + add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + 0xc027, --p, K_ECDHE_RSA, B_AES_128, T, max, tls12, P_SHA256); + add("TLS_RSA_WITH_AES_128_CBC_SHA256", + 0x003c, --p, K_RSA, B_AES_128, T, max, tls12, P_SHA256); + add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", + 0xc025, --p, K_ECDH_ECDSA, B_AES_128, T, max, tls12, P_SHA256); + add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", + 0xc029, --p, K_ECDH_RSA, B_AES_128, T, max, tls12, P_SHA256); + add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", + 0x0067, --p, K_DHE_RSA, B_AES_128, T, max, tls12, P_SHA256); + add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", + 0x0040, --p, K_DHE_DSS, B_AES_128, T, max, tls12, P_SHA256); + + add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + 0xC009, --p, K_ECDHE_ECDSA, B_AES_128, T); + add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + 0xC013, --p, K_ECDHE_RSA, B_AES_128, T); + add("TLS_RSA_WITH_AES_128_CBC_SHA", + 0x002f, --p, K_RSA, B_AES_128, T); + add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", + 0xC004, --p, K_ECDH_ECDSA, B_AES_128, T); + add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", + 0xC00E, --p, K_ECDH_RSA, B_AES_128, T); + add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA", + 0x0033, --p, K_DHE_RSA, B_AES_128, T); + add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA", + 0x0032, --p, K_DHE_DSS, B_AES_128, T); add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - 0xC007, --p, K_ECDHE_ECDSA,B_RC4_128, N); - add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - 0xC009, --p, K_ECDHE_ECDSA,B_AES_128, T); - add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", - 0xC00A, --p, K_ECDHE_ECDSA,B_AES_256, T); + 0xC007, --p, K_ECDHE_ECDSA, B_RC4_128, N); add("TLS_ECDHE_RSA_WITH_RC4_128_SHA", - 0xC011, --p, K_ECDHE_RSA, B_RC4_128, N); - add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", - 0xC013, --p, K_ECDHE_RSA, B_AES_128, T); - add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", - 0xC014, --p, K_ECDHE_RSA, B_AES_256, T); + 0xC011, --p, K_ECDHE_RSA, B_RC4_128, N); + add("SSL_RSA_WITH_RC4_128_SHA", + 0x0005, --p, K_RSA, B_RC4_128, N); + add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA", + 0xC002, --p, K_ECDH_ECDSA, B_RC4_128, N); + add("TLS_ECDH_RSA_WITH_RC4_128_SHA", + 0xC00C, --p, K_ECDH_RSA, B_RC4_128, N); - add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA", - 0x0033, --p, K_DHE_RSA, B_AES_128, T); - add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA", - 0x0039, --p, K_DHE_RSA, B_AES_256, T); - add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA", - 0x0032, --p, K_DHE_DSS, B_AES_128, T); - add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA", - 0x0038, --p, K_DHE_DSS, B_AES_256, T); - - add("SSL_RSA_WITH_3DES_EDE_CBC_SHA", - 0x000a, --p, K_RSA, B_3DES, T); - add("TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", - 0xC003, --p, K_ECDH_ECDSA, B_3DES, T); - add("TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", - 0xC00D, --p, K_ECDH_RSA, B_3DES, T); add("TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", - 0xC008, --p, K_ECDHE_ECDSA,B_3DES, T); + 0xC008, --p, K_ECDHE_ECDSA, B_3DES, T); add("TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - 0xC012, --p, K_ECDHE_RSA, B_3DES, T); + 0xC012, --p, K_ECDHE_RSA, B_3DES, T); + add("SSL_RSA_WITH_3DES_EDE_CBC_SHA", + 0x000a, --p, K_RSA, B_3DES, T); + add("TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", + 0xC003, --p, K_ECDH_ECDSA, B_3DES, T); + add("TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", + 0xC00D, --p, K_ECDH_RSA, B_3DES, T); add("SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", - 0x0016, --p, K_DHE_RSA, B_3DES, T); + 0x0016, --p, K_DHE_RSA, B_3DES, T); add("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", - 0x0013, --p, K_DHE_DSS, B_3DES, N); + 0x0013, --p, K_DHE_DSS, B_3DES, N); - add("SSL_RSA_WITH_DES_CBC_SHA", - 0x0009, --p, K_RSA, B_DES, N); - add("SSL_DHE_RSA_WITH_DES_CBC_SHA", - 0x0015, --p, K_DHE_RSA, B_DES, N); - add("SSL_DHE_DSS_WITH_DES_CBC_SHA", - 0x0012, --p, K_DHE_DSS, B_DES, N); - add("SSL_RSA_EXPORT_WITH_RC4_40_MD5", - 0x0003, --p, K_RSA_EXPORT, B_RC4_40, N); - add("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", - 0x0008, --p, K_RSA_EXPORT, B_DES_40, N); - add("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", - 0x0014, --p, K_DHE_RSA, B_DES_40, N); - add("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", - 0x0011, --p, K_DHE_DSS, B_DES_40, N); + add("SSL_RSA_WITH_RC4_128_MD5", + 0x0004, --p, K_RSA, B_RC4_128, N); // Renegotiation protection request Signalling Cipher Suite Value (SCSV) add("TLS_EMPTY_RENEGOTIATION_INFO_SCSV", - 0x00ff, --p, K_SCSV, B_NULL, T); + 0x00ff, --p, K_SCSV, B_NULL, T); - // Definition of the CipherSuites that are supported but not enabled - // by default. - // They are listed in preference order, preferred first. + /* + * Definition of the CipherSuites that are supported but not enabled + * by default. + * They are listed in preference order, preferred first, using the + * following criteria: + * 1. CipherSuites for KRB5 need additional KRB5 service + * configuration, and these suites are not common in practice, + * so we put KRB5 based cipher suites at the end of the supported + * list. + * 2. If a cipher suite has been obsoleted, we put it at the end of + * the list. + * 3. Prefer the stronger bulk cipher, in the order of AES_256, + * AES_128, RC-4, 3DES-EDE, DES, RC4_40, DES40, NULL. + * 4. Prefer the stronger MAC algorithm, in the order of SHA384, + * SHA256, SHA, MD5. + * 5. Prefer the better performance of key exchange and digital + * signature algorithm, in the order of ECDHE-ECDSA, ECDHE-RSA, + * RSA, ECDH-ECDSA, ECDH-RSA, DHE-RSA, DHE-DSS, anonymous. + */ p = DEFAULT_SUITES_PRIORITY; - // Anonymous key exchange and the NULL ciphers - add("SSL_RSA_WITH_NULL_MD5", - 0x0001, --p, K_RSA, B_NULL, N); - add("SSL_RSA_WITH_NULL_SHA", - 0x0002, --p, K_RSA, B_NULL, N); - add("TLS_ECDH_ECDSA_WITH_NULL_SHA", - 0xC001, --p, K_ECDH_ECDSA, B_NULL, N); - add("TLS_ECDH_RSA_WITH_NULL_SHA", - 0xC00B, --p, K_ECDH_RSA, B_NULL, N); - add("TLS_ECDHE_ECDSA_WITH_NULL_SHA", - 0xC006, --p, K_ECDHE_ECDSA,B_NULL, N); - add("TLS_ECDHE_RSA_WITH_NULL_SHA", - 0xC010, --p, K_ECDHE_RSA, B_NULL, N); - - add("SSL_DH_anon_WITH_RC4_128_MD5", - 0x0018, --p, K_DH_ANON, B_RC4_128, N); - add("TLS_DH_anon_WITH_AES_128_CBC_SHA", - 0x0034, --p, K_DH_ANON, B_AES_128, N); + add("TLS_DH_anon_WITH_AES_256_CBC_SHA256", + 0x006d, --p, K_DH_ANON, B_AES_256, N, max, tls12, P_SHA256); + add("TLS_ECDH_anon_WITH_AES_256_CBC_SHA", + 0xC019, --p, K_ECDH_ANON, B_AES_256, T); add("TLS_DH_anon_WITH_AES_256_CBC_SHA", - 0x003a, --p, K_DH_ANON, B_AES_256, N); - add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", - 0x001b, --p, K_DH_ANON, B_3DES, N); - add("SSL_DH_anon_WITH_DES_CBC_SHA", - 0x001a, --p, K_DH_ANON, B_DES, N); + 0x003a, --p, K_DH_ANON, B_AES_256, N); + + add("TLS_DH_anon_WITH_AES_128_CBC_SHA256", + 0x006c, --p, K_DH_ANON, B_AES_128, N, max, tls12, P_SHA256); + add("TLS_ECDH_anon_WITH_AES_128_CBC_SHA", + 0xC018, --p, K_ECDH_ANON, B_AES_128, T); + add("TLS_DH_anon_WITH_AES_128_CBC_SHA", + 0x0034, --p, K_DH_ANON, B_AES_128, N); add("TLS_ECDH_anon_WITH_RC4_128_SHA", - 0xC016, --p, K_ECDH_ANON, B_RC4_128, N); - add("TLS_ECDH_anon_WITH_AES_128_CBC_SHA", - 0xC018, --p, K_ECDH_ANON, B_AES_128, T); - add("TLS_ECDH_anon_WITH_AES_256_CBC_SHA", - 0xC019, --p, K_ECDH_ANON, B_AES_256, T); + 0xC016, --p, K_ECDH_ANON, B_RC4_128, N); + add("SSL_DH_anon_WITH_RC4_128_MD5", + 0x0018, --p, K_DH_ANON, B_RC4_128, N); + add("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", - 0xC017, --p, K_ECDH_ANON, B_3DES, T); - - add("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", - 0x0017, --p, K_DH_ANON, B_RC4_40, N); - add("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", - 0x0019, --p, K_DH_ANON, B_DES_40, N); + 0xC017, --p, K_ECDH_ANON, B_3DES, T); + add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", + 0x001b, --p, K_DH_ANON, B_3DES, N); + add("TLS_RSA_WITH_NULL_SHA256", + 0x003b, --p, K_RSA, B_NULL, N, max, tls12, P_SHA256); + add("TLS_ECDHE_ECDSA_WITH_NULL_SHA", + 0xC006, --p, K_ECDHE_ECDSA, B_NULL, N); + add("TLS_ECDHE_RSA_WITH_NULL_SHA", + 0xC010, --p, K_ECDHE_RSA, B_NULL, N); + add("SSL_RSA_WITH_NULL_SHA", + 0x0002, --p, K_RSA, B_NULL, N); + add("TLS_ECDH_ECDSA_WITH_NULL_SHA", + 0xC001, --p, K_ECDH_ECDSA, B_NULL, N); + add("TLS_ECDH_RSA_WITH_NULL_SHA", + 0xC00B, --p, K_ECDH_RSA, B_NULL, N); add("TLS_ECDH_anon_WITH_NULL_SHA", - 0xC015, --p, K_ECDH_ANON, B_NULL, N); + 0xC015, --p, K_ECDH_ANON, B_NULL, N); + add("SSL_RSA_WITH_NULL_MD5", + 0x0001, --p, K_RSA, B_NULL, N); + + // weak cipher suites obsoleted in TLS 1.2 + add("SSL_RSA_WITH_DES_CBC_SHA", + 0x0009, --p, K_RSA, B_DES, N, tls12); + add("SSL_DHE_RSA_WITH_DES_CBC_SHA", + 0x0015, --p, K_DHE_RSA, B_DES, N, tls12); + add("SSL_DHE_DSS_WITH_DES_CBC_SHA", + 0x0012, --p, K_DHE_DSS, B_DES, N, tls12); + add("SSL_DH_anon_WITH_DES_CBC_SHA", + 0x001a, --p, K_DH_ANON, B_DES, N, tls12); + + // weak cipher suites obsoleted in TLS 1.1 + add("SSL_RSA_EXPORT_WITH_RC4_40_MD5", + 0x0003, --p, K_RSA_EXPORT, B_RC4_40, N, tls11); + add("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", + 0x0017, --p, K_DH_ANON, B_RC4_40, N, tls11); + + add("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", + 0x0008, --p, K_RSA_EXPORT, B_DES_40, N, tls11); + add("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", + 0x0014, --p, K_DHE_RSA, B_DES_40, N, tls11); + add("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", + 0x0011, --p, K_DHE_DSS, B_DES_40, N, tls11); + add("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", + 0x0019, --p, K_DH_ANON, B_DES_40, N, tls11); // Supported Kerberos ciphersuites from RFC2712 add("TLS_KRB5_WITH_RC4_128_SHA", - 0x0020, --p, K_KRB5, B_RC4_128, N); + 0x0020, --p, K_KRB5, B_RC4_128, N); add("TLS_KRB5_WITH_RC4_128_MD5", - 0x0024, --p, K_KRB5, B_RC4_128, N); + 0x0024, --p, K_KRB5, B_RC4_128, N); add("TLS_KRB5_WITH_3DES_EDE_CBC_SHA", - 0x001f, --p, K_KRB5, B_3DES, N); + 0x001f, --p, K_KRB5, B_3DES, N); add("TLS_KRB5_WITH_3DES_EDE_CBC_MD5", - 0x0023, --p, K_KRB5, B_3DES, N); + 0x0023, --p, K_KRB5, B_3DES, N); add("TLS_KRB5_WITH_DES_CBC_SHA", - 0x001e, --p, K_KRB5, B_DES, N); + 0x001e, --p, K_KRB5, B_DES, N, tls12); add("TLS_KRB5_WITH_DES_CBC_MD5", - 0x0022, --p, K_KRB5, B_DES, N); + 0x0022, --p, K_KRB5, B_DES, N, tls12); add("TLS_KRB5_EXPORT_WITH_RC4_40_SHA", - 0x0028, --p, K_KRB5_EXPORT, B_RC4_40, N); + 0x0028, --p, K_KRB5_EXPORT, B_RC4_40, N, tls11); add("TLS_KRB5_EXPORT_WITH_RC4_40_MD5", - 0x002b, --p, K_KRB5_EXPORT, B_RC4_40, N); + 0x002b, --p, K_KRB5_EXPORT, B_RC4_40, N, tls11); add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", - 0x0026, --p, K_KRB5_EXPORT, B_DES_40, N); + 0x0026, --p, K_KRB5_EXPORT, B_DES_40, N, tls11); add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", - 0x0029, --p, K_KRB5_EXPORT, B_DES_40, N); + 0x0029, --p, K_KRB5_EXPORT, B_DES_40, N, tls11); + + /* + * Other values from the TLS Cipher Suite Registry, as of August 2010. + * + * http://www.iana.org/assignments/tls-parameters/tls-parameters.xml + * + * Range Registration Procedures Notes + * 000-191 Standards Action Refers to value of first byte + * 192-254 Specification Required Refers to value of first byte + * 255 Reserved for Private Use Refers to value of first byte + */ // Register the names of a few additional CipherSuites. // Makes them show up as names instead of numbers in // the debug output. // remaining unsupported ciphersuites defined in RFC2246. - add("SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", 0x0006); - add("SSL_RSA_WITH_IDEA_CBC_SHA", 0x0007); - add("SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", 0x000b); - add("SSL_DH_DSS_WITH_DES_CBC_SHA", 0x000c); - add("SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA", 0x000d); - add("SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x000e); - add("SSL_DH_RSA_WITH_DES_CBC_SHA", 0x000f); - add("SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA", 0x0010); + add("SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", 0x0006); + add("SSL_RSA_WITH_IDEA_CBC_SHA", 0x0007); + add("SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", 0x000b); + add("SSL_DH_DSS_WITH_DES_CBC_SHA", 0x000c); + add("SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA", 0x000d); + add("SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x000e); + add("SSL_DH_RSA_WITH_DES_CBC_SHA", 0x000f); + add("SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA", 0x0010); // SSL 3.0 Fortezza ciphersuites - add("SSL_FORTEZZA_DMS_WITH_NULL_SHA", 0x001c); - add("SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA", 0x001d); + add("SSL_FORTEZZA_DMS_WITH_NULL_SHA", 0x001c); + add("SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA", 0x001d); // 1024/56 bit exportable ciphersuites from expired internet draft - add("SSL_RSA_EXPORT1024_WITH_DES_CBC_SHA", 0x0062); - add("SSL_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA", 0x0063); - add("SSL_RSA_EXPORT1024_WITH_RC4_56_SHA", 0x0064); - add("SSL_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA", 0x0065); - add("SSL_DHE_DSS_WITH_RC4_128_SHA", 0x0066); + add("SSL_RSA_EXPORT1024_WITH_DES_CBC_SHA", 0x0062); + add("SSL_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA", 0x0063); + add("SSL_RSA_EXPORT1024_WITH_RC4_56_SHA", 0x0064); + add("SSL_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA", 0x0065); + add("SSL_DHE_DSS_WITH_RC4_128_SHA", 0x0066); // Netscape old and new SSL 3.0 FIPS ciphersuites // see http://www.mozilla.org/projects/security/pki/nss/ssl/fips-ssl-ciphersuites.html - add("NETSCAPE_RSA_FIPS_WITH_3DES_EDE_CBC_SHA", 0xffe0); - add("NETSCAPE_RSA_FIPS_WITH_DES_CBC_SHA", 0xffe1); - add("SSL_RSA_FIPS_WITH_DES_CBC_SHA", 0xfefe); - add("SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA", 0xfeff); + add("NETSCAPE_RSA_FIPS_WITH_3DES_EDE_CBC_SHA", 0xffe0); + add("NETSCAPE_RSA_FIPS_WITH_DES_CBC_SHA", 0xffe1); + add("SSL_RSA_FIPS_WITH_DES_CBC_SHA", 0xfefe); + add("SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA", 0xfeff); // Unsupported Kerberos cipher suites from RFC 2712 - add("TLS_KRB5_WITH_IDEA_CBC_SHA", 0x0021); - add("TLS_KRB5_WITH_IDEA_CBC_MD5", 0x0025); - add("TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA", 0x0027); - add("TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5", 0x002a); + add("TLS_KRB5_WITH_IDEA_CBC_SHA", 0x0021); + add("TLS_KRB5_WITH_IDEA_CBC_MD5", 0x0025); + add("TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA", 0x0027); + add("TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5", 0x002a); + // Unsupported cipher suites from RFC 4162 + add("TLS_RSA_WITH_SEED_CBC_SHA", 0x0096); + add("TLS_DH_DSS_WITH_SEED_CBC_SHA", 0x0097); + add("TLS_DH_RSA_WITH_SEED_CBC_SHA", 0x0098); + add("TLS_DHE_DSS_WITH_SEED_CBC_SHA", 0x0099); + add("TLS_DHE_RSA_WITH_SEED_CBC_SHA", 0x009a); + add("TLS_DH_anon_WITH_SEED_CBC_SHA", 0x009b); + + // Unsupported cipher suites from RFC 4279 + add("TLS_PSK_WITH_RC4_128_SHA", 0x008a); + add("TLS_PSK_WITH_3DES_EDE_CBC_SHA", 0x008b); + add("TLS_PSK_WITH_AES_128_CBC_SHA", 0x008c); + add("TLS_PSK_WITH_AES_256_CBC_SHA", 0x008d); + add("TLS_DHE_PSK_WITH_RC4_128_SHA", 0x008e); + add("TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA", 0x008f); + add("TLS_DHE_PSK_WITH_AES_128_CBC_SHA", 0x0090); + add("TLS_DHE_PSK_WITH_AES_256_CBC_SHA", 0x0091); + add("TLS_RSA_PSK_WITH_RC4_128_SHA", 0x0092); + add("TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA", 0x0093); + add("TLS_RSA_PSK_WITH_AES_128_CBC_SHA", 0x0094); + add("TLS_RSA_PSK_WITH_AES_256_CBC_SHA", 0x0095); + + // Unsupported cipher suites from RFC 4785 + add("TLS_PSK_WITH_NULL_SHA", 0x002c); + add("TLS_DHE_PSK_WITH_NULL_SHA", 0x002d); + add("TLS_RSA_PSK_WITH_NULL_SHA", 0x002e); + + // Unsupported cipher suites from RFC 5246 + add("TLS_DH_DSS_WITH_AES_128_CBC_SHA", 0x0030); + add("TLS_DH_RSA_WITH_AES_128_CBC_SHA", 0x0031); + add("TLS_DH_DSS_WITH_AES_256_CBC_SHA", 0x0036); + add("TLS_DH_RSA_WITH_AES_256_CBC_SHA", 0x0037); + add("TLS_DH_DSS_WITH_AES_128_CBC_SHA256", 0x003e); + add("TLS_DH_RSA_WITH_AES_128_CBC_SHA256", 0x003f); + add("TLS_DH_DSS_WITH_AES_256_CBC_SHA256", 0x0068); + add("TLS_DH_RSA_WITH_AES_256_CBC_SHA256", 0x0069); + + // Unsupported cipher suites from RFC 5288 + add("TLS_RSA_WITH_AES_128_GCM_SHA256", 0x009c); + add("TLS_RSA_WITH_AES_256_GCM_SHA384", 0x009d); + add("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", 0x009e); + add("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", 0x009f); + add("TLS_DH_RSA_WITH_AES_128_GCM_SHA256", 0x00a0); + add("TLS_DH_RSA_WITH_AES_256_GCM_SHA384", 0x00a1); + add("TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", 0x00a2); + add("TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", 0x00a3); + add("TLS_DH_DSS_WITH_AES_128_GCM_SHA256", 0x00a4); + add("TLS_DH_DSS_WITH_AES_256_GCM_SHA384", 0x00a5); + add("TLS_DH_anon_WITH_AES_128_GCM_SHA256", 0x00a6); + add("TLS_DH_anon_WITH_AES_256_GCM_SHA384", 0x00a7); + + // Unsupported cipher suites from RFC 5487 + add("TLS_PSK_WITH_AES_128_GCM_SHA256", 0x00a8); + add("TLS_PSK_WITH_AES_256_GCM_SHA384", 0x00a9); + add("TLS_DHE_PSK_WITH_AES_128_GCM_SHA256", 0x00aa); + add("TLS_DHE_PSK_WITH_AES_256_GCM_SHA384", 0x00ab); + add("TLS_RSA_PSK_WITH_AES_128_GCM_SHA256", 0x00ac); + add("TLS_RSA_PSK_WITH_AES_256_GCM_SHA384", 0x00ad); + add("TLS_PSK_WITH_AES_128_CBC_SHA256", 0x00ae); + add("TLS_PSK_WITH_AES_256_CBC_SHA384", 0x00af); + add("TLS_PSK_WITH_NULL_SHA256", 0x00b0); + add("TLS_PSK_WITH_NULL_SHA384", 0x00b1); + add("TLS_DHE_PSK_WITH_AES_128_CBC_SHA256", 0x00b2); + add("TLS_DHE_PSK_WITH_AES_256_CBC_SHA384", 0x00b3); + add("TLS_DHE_PSK_WITH_NULL_SHA256", 0x00b4); + add("TLS_DHE_PSK_WITH_NULL_SHA384", 0x00b5); + add("TLS_RSA_PSK_WITH_AES_128_CBC_SHA256", 0x00b6); + add("TLS_RSA_PSK_WITH_AES_256_CBC_SHA384", 0x00b7); + add("TLS_RSA_PSK_WITH_NULL_SHA256", 0x00b8); + add("TLS_RSA_PSK_WITH_NULL_SHA384", 0x00b9); + + // Unsupported cipher suites from RFC 5932 + add("TLS_RSA_WITH_CAMELLIA_128_CBC_SHA", 0x0041); + add("TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA", 0x0042); + add("TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA", 0x0043); + add("TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA", 0x0044); + add("TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA", 0x0045); + add("TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA", 0x0046); + add("TLS_RSA_WITH_CAMELLIA_256_CBC_SHA", 0x0084); + add("TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA", 0x0085); + add("TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA", 0x0086); + add("TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA", 0x0087); + add("TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA", 0x0088); + add("TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA", 0x0089); + add("TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0x00ba); + add("TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256", 0x00bb); + add("TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0x00bc); + add("TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256", 0x00bd); + add("TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0x00be); + add("TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256", 0x00bf); + add("TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256", 0x00c0); + add("TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256", 0x00c1); + add("TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256", 0x00c2); + add("TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256", 0x00c3); + add("TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256", 0x00c4); + add("TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256", 0x00c5); + + // Unsupported cipher suites from RFC 5054 + add("TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA", 0xc01a); + add("TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA", 0xc01b); + add("TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA", 0xc01c); + add("TLS_SRP_SHA_WITH_AES_128_CBC_SHA", 0xc01d); + add("TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA", 0xc01e); + add("TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA", 0xc01f); + add("TLS_SRP_SHA_WITH_AES_256_CBC_SHA", 0xc020); + add("TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA", 0xc021); + add("TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA", 0xc022); + + // Unsupported cipher suites from RFC 5289 + add("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", 0xc02b); + add("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", 0xc02c); + add("TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", 0xc02d); + add("TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", 0xc02e); + add("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", 0xc02f); + add("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", 0xc030); + add("TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", 0xc031); + add("TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", 0xc032); + + // Unsupported cipher suites from RFC 5489 + add("TLS_ECDHE_PSK_WITH_RC4_128_SHA", 0xc033); + add("TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA", 0xc034); + add("TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA", 0xc035); + add("TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA", 0xc036); + add("TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256", 0xc037); + add("TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384", 0xc038); + add("TLS_ECDHE_PSK_WITH_NULL_SHA", 0xc039); + add("TLS_ECDHE_PSK_WITH_NULL_SHA256", 0xc03a); + add("TLS_ECDHE_PSK_WITH_NULL_SHA384", 0xc03b); } // ciphersuite SSL_NULL_WITH_NULL_NULL diff --git a/jdk/src/share/classes/sun/security/ssl/CipherSuiteList.java b/jdk/src/share/classes/sun/security/ssl/CipherSuiteList.java index 93bfb15a02f..43750203b36 100644 --- a/jdk/src/share/classes/sun/security/ssl/CipherSuiteList.java +++ b/jdk/src/share/classes/sun/security/ssl/CipherSuiteList.java @@ -221,7 +221,7 @@ final class CipherSuiteList { private static CipherSuiteList buildAvailableCache(int minPriority) { // SortedSet automatically arranges ciphersuites in default // preference order - Set cipherSuites = new TreeSet(); + Set cipherSuites = new TreeSet<>(); Collection allowedCipherSuites = CipherSuite.allowedCipherSuites(); for (CipherSuite c : allowedCipherSuites) { diff --git a/jdk/src/share/classes/sun/security/ssl/ClientHandshaker.java b/jdk/src/share/classes/sun/security/ssl/ClientHandshaker.java index 0e9960e11fc..3920b35c37a 100644 --- a/jdk/src/share/classes/sun/security/ssl/ClientHandshaker.java +++ b/jdk/src/share/classes/sun/security/ssl/ClientHandshaker.java @@ -23,7 +23,6 @@ * questions. */ - package sun.security.ssl; import java.io.*; @@ -45,12 +44,12 @@ import javax.net.ssl.*; import javax.security.auth.Subject; -import com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager; - import sun.security.ssl.HandshakeMessage.*; import sun.security.ssl.CipherSuite.*; import static sun.security.ssl.CipherSuite.KeyExchange.*; +import sun.net.util.IPAddressUtil; + /** * ClientHandshaker does the protocol handshaking from the point * of view of a client. It is driven asychronously by handshake messages @@ -89,6 +88,10 @@ final class ClientHandshaker extends Handshaker { */ private ProtocolVersion maxProtocolVersion; + // To switch off the SNI extension. + private final static boolean enableSNIExtension = + Debug.getBooleanProperty("jsse.enableSNIExtension", true); + /* * Constructors */ @@ -190,7 +193,8 @@ final class ClientHandshaker extends Handshaker { } break; case K_DH_ANON: - this.serverKeyExchange(new DH_ServerKeyExchange(input)); + this.serverKeyExchange(new DH_ServerKeyExchange( + input, protocolVersion)); break; case K_DHE_DSS: case K_DHE_RSA: @@ -198,7 +202,8 @@ final class ClientHandshaker extends Handshaker { this.serverKeyExchange(new DH_ServerKeyExchange( input, serverKey, clnt_random.random_bytes, svr_random.random_bytes, - messageLen)); + messageLen, + localSupportedSignAlgs, protocolVersion)); } catch (GeneralSecurityException e) { throwSSLException("Server key", e); } @@ -209,7 +214,8 @@ final class ClientHandshaker extends Handshaker { try { this.serverKeyExchange(new ECDH_ServerKeyExchange (input, serverKey, clnt_random.random_bytes, - svr_random.random_bytes)); + svr_random.random_bytes, + localSupportedSignAlgs, protocolVersion)); } catch (GeneralSecurityException e) { throwSSLException("Server key", e); } @@ -219,8 +225,9 @@ final class ClientHandshaker extends Handshaker { case K_DH_DSS: case K_ECDH_ECDSA: case K_ECDH_RSA: - throw new SSLProtocolException("Protocol violation: server sent" - + " a server key exchange message for key exchange " + keyExchange); + throw new SSLProtocolException( + "Protocol violation: server sent a server key exchange" + + "message for key exchange " + keyExchange); case K_KRB5: case K_KRB5_EXPORT: throw new SSLProtocolException( @@ -243,10 +250,32 @@ final class ClientHandshaker extends Handshaker { "Client certificate requested for "+ "kerberos cipher suite."); } - certRequest = new CertificateRequest(input); + certRequest = new CertificateRequest(input, protocolVersion); if (debug != null && Debug.isOn("handshake")) { certRequest.print(System.out); } + + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + Collection peerSignAlgs = + certRequest.getSignAlgorithms(); + if (peerSignAlgs == null || peerSignAlgs.isEmpty()) { + throw new SSLHandshakeException( + "No peer supported signature algorithms"); + } + + Collection supportedPeerSignAlgs = + SignatureAndHashAlgorithm.getSupportedAlgorithms( + peerSignAlgs); + if (supportedPeerSignAlgs.isEmpty()) { + throw new SSLHandshakeException( + "No supported signature and hash algorithm in common"); + } + + setPeerSupportedSignAlgs(supportedPeerSignAlgs); + session.setPeerSupportedSignatureAlgorithms( + supportedPeerSignAlgs); + } + break; case HandshakeMessage.ht_server_hello_done: @@ -254,7 +283,8 @@ final class ClientHandshaker extends Handshaker { break; case HandshakeMessage.ht_finished: - this.serverFinished(new Finished(protocolVersion, input)); + this.serverFinished( + new Finished(protocolVersion, input, cipherSuite)); break; default: @@ -345,11 +375,14 @@ final class ClientHandshaker extends Handshaker { // check if the server selected protocol version is OK for us ProtocolVersion mesgVersion = mesg.protocolVersion; - if (enabledProtocols.contains(mesgVersion) == false) { - throw new SSLHandshakeException - ("Server chose unsupported or disabled protocol: " + mesgVersion); + if (!isNegotiable(mesgVersion)) { + throw new SSLHandshakeException( + "Server chose unsupported or disabled protocol: " + + mesgVersion); } + handshakeHash.protocolDetermined(mesgVersion); + // Set protocolVersion and propagate to SSLSocket and the // Handshake streams setVersion(mesgVersion); @@ -425,10 +458,13 @@ final class ClientHandshaker extends Handshaker { if (isNegotiable(mesg.cipherSuite) == false) { fatalSE(Alerts.alert_illegal_parameter, - "Server selected improper ciphersuite " + cipherSuite); + "Server selected improper ciphersuite " + mesg.cipherSuite); } setCipherSuite(mesg.cipherSuite); + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + handshakeHash.setFinishedAlg(cipherSuite.prfAlg.getPRFHashAlg()); + } if (mesg.compression_method != 0) { fatalSE(Alerts.alert_illegal_parameter, @@ -507,7 +543,6 @@ final class ClientHandshaker extends Handshaker { if (debug != null && Debug.isOn("session")) { System.out.println("%% Server resumed " + session); } - return; } else { // we wanted to resume, but the server refused session = null; @@ -518,11 +553,21 @@ final class ClientHandshaker extends Handshaker { } } + if (resumingSession && session != null) { + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + handshakeHash.setCertificateVerifyAlg(null); + } + + setHandshakeSessionSE(session); + return; + } + // check extensions for (HelloExtension ext : mesg.extensions.list()) { ExtensionType type = ext.type; if ((type != ExtensionType.EXT_ELLIPTIC_CURVES) && (type != ExtensionType.EXT_EC_POINT_FORMATS) + && (type != ExtensionType.EXT_SERVER_NAME) && (type != ExtensionType.EXT_RENEGOTIATION_INFO)) { fatalSE(Alerts.alert_unsupported_extension, "Server sent an unsupported extension: " + type); @@ -531,7 +576,9 @@ final class ClientHandshaker extends Handshaker { // Create a new session, we need to do the full handshake session = new SSLSessionImpl(protocolVersion, cipherSuite, + getLocalSupportedSignAlgs(), mesg.sessionId, getHostSE(), getPortSE()); + setHandshakeSessionSE(session); if (debug != null && Debug.isOn("handshake")) { System.out.println("** " + cipherSuite); } @@ -567,11 +614,13 @@ final class ClientHandshaker extends Handshaker { if (debug != null && Debug.isOn("handshake")) { mesg.print(System.out); } - dh = new DHCrypt(mesg.getModulus(), mesg.getBase(), sslContext.getSecureRandom()); + dh = new DHCrypt(mesg.getModulus(), mesg.getBase(), + sslContext.getSecureRandom()); serverDH = mesg.getServerPublicKey(); } - private void serverKeyExchange(ECDH_ServerKeyExchange mesg) throws IOException { + private void serverKeyExchange(ECDH_ServerKeyExchange mesg) + throws IOException { if (debug != null && Debug.isOn("handshake")) { mesg.print(System.out); } @@ -606,7 +655,7 @@ final class ClientHandshaker extends Handshaker { if (certRequest != null) { X509ExtendedKeyManager km = sslContext.getX509KeyManager(); - ArrayList keytypesTmp = new ArrayList(4); + ArrayList keytypesTmp = new ArrayList<>(4); for (int i = 0; i < certRequest.types.length; i++) { String typeName; @@ -665,9 +714,13 @@ final class ClientHandshaker extends Handshaker { PublicKey publicKey = certs[0].getPublicKey(); // for EC, make sure we use a supported named curve if (publicKey instanceof ECPublicKey) { - ECParameterSpec params = ((ECPublicKey)publicKey).getParams(); - int index = SupportedEllipticCurvesExtension.getCurveIndex(params); - if (!SupportedEllipticCurvesExtension.isSupported(index)) { + ECParameterSpec params = + ((ECPublicKey)publicKey).getParams(); + int index = + SupportedEllipticCurvesExtension.getCurveIndex( + params); + if (!SupportedEllipticCurvesExtension.isSupported( + index)) { publicKey = null; } } @@ -813,8 +866,9 @@ final class ClientHandshaker extends Handshaker { throw new IOException("Hostname is required" + " to use Kerberos cipher suites"); } - KerberosClientKeyExchange kerberosMsg = new KerberosClientKeyExchange - (hostname, isLoopbackSE(), getAccSE(), protocolVersion, + KerberosClientKeyExchange kerberosMsg = + new KerberosClientKeyExchange( + hostname, isLoopbackSE(), getAccSE(), protocolVersion, sslContext.getSecureRandom()); // Record the principals involved in exchange session.setPeerPrincipal(kerberosMsg.getPeerPrincipal()); @@ -861,7 +915,8 @@ final class ClientHandshaker extends Handshaker { case K_KRB5_EXPORT: byte[] secretBytes = ((KerberosClientKeyExchange)m2).getUnencryptedPreMasterSecret(); - preMasterSecret = new SecretKeySpec(secretBytes, "TlsPremasterSecret"); + preMasterSecret = new SecretKeySpec(secretBytes, + "TlsPremasterSecret"); break; case K_DHE_RSA: case K_DHE_DSS: @@ -878,7 +933,8 @@ final class ClientHandshaker extends Handshaker { preMasterSecret = ecdh.getAgreedSecret(serverKey); break; default: - throw new IOException("Internal error: unknown key exchange " + keyExchange); + throw new IOException("Internal error: unknown key exchange " + + keyExchange); } calculateKeys(preMasterSecret, null); @@ -896,9 +952,32 @@ final class ClientHandshaker extends Handshaker { if (signingKey != null) { CertificateVerify m3; try { + SignatureAndHashAlgorithm preferableSignatureAlgorithm = null; + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + preferableSignatureAlgorithm = + SignatureAndHashAlgorithm.getPreferableAlgorithm( + peerSupportedSignAlgs, signingKey.getAlgorithm()); + + if (preferableSignatureAlgorithm == null) { + throw new SSLHandshakeException( + "No supported signature algorithm"); + } + + String hashAlg = + SignatureAndHashAlgorithm.getHashAlgorithmName( + preferableSignatureAlgorithm); + if (hashAlg == null || hashAlg.length() == 0) { + throw new SSLHandshakeException( + "No supported hash algorithm"); + } + + handshakeHash.setCertificateVerifyAlg(hashAlg); + } + m3 = new CertificateVerify(protocolVersion, handshakeHash, signingKey, session.getMasterSecret(), - sslContext.getSecureRandom()); + sslContext.getSecureRandom(), + preferableSignatureAlgorithm); } catch (GeneralSecurityException e) { fatalSE(Alerts.alert_handshake_failure, "Error signing certificate verify", e); @@ -910,6 +989,10 @@ final class ClientHandshaker extends Handshaker { } m3.write(output); output.doHashes(); + } else { + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + handshakeHash.setCertificateVerifyAlg(null); + } } /* @@ -930,8 +1013,8 @@ final class ClientHandshaker extends Handshaker { mesg.print(System.out); } - boolean verified = mesg.verify(protocolVersion, handshakeHash, - Finished.SERVER, session.getMasterSecret()); + boolean verified = mesg.verify(handshakeHash, Finished.SERVER, + session.getMasterSecret()); if (!verified) { fatalSE(Alerts.alert_illegal_parameter, @@ -988,7 +1071,7 @@ final class ClientHandshaker extends Handshaker { private void sendChangeCipherAndFinish(boolean finishedTag) throws IOException { Finished mesg = new Finished(protocolVersion, handshakeHash, - Finished.CLIENT, session.getMasterSecret()); + Finished.CLIENT, session.getMasterSecret(), cipherSuite); /* * Send the change_cipher_spec message, then the Finished message @@ -1022,7 +1105,7 @@ final class ClientHandshaker extends Handshaker { SessionId sessionId = SSLSessionImpl.nullSession.getSessionId(); // a list of cipher suites sent by the client - CipherSuiteList cipherSuites = enabledCipherSuites; + CipherSuiteList cipherSuites = getActiveCipherSuites(); // set the max protocol version this client is supporting. maxProtocolVersion = protocolVersion; @@ -1057,8 +1140,7 @@ final class ClientHandshaker extends Handshaker { session = null; } - if ((session != null) && - (enabledProtocols.contains(sessionVersion) == false)) { + if ((session != null) && !isNegotiable(sessionVersion)) { if (debug != null && Debug.isOn("session")) { System.out.println("%% can't resume, protocol disabled"); } @@ -1088,12 +1170,11 @@ final class ClientHandshaker extends Handshaker { */ if (!enableNewSession) { if (session == null) { - throw new SSLException( + throw new SSLHandshakeException( "Can't reuse existing SSL client session"); } - Collection cipherList = - new ArrayList(2); + Collection cipherList = new ArrayList<>(2); cipherList.add(sessionSuite); if (!secureRenegotiation && cipherSuites.contains(CipherSuite.C_SCSV)) { @@ -1105,13 +1186,13 @@ final class ClientHandshaker extends Handshaker { } if (session == null && !enableNewSession) { - throw new SSLException("No existing session to resume"); + throw new SSLHandshakeException("No existing session to resume"); } // exclude SCSV for secure renegotiation if (secureRenegotiation && cipherSuites.contains(CipherSuite.C_SCSV)) { Collection cipherList = - new ArrayList(cipherSuites.size() - 1); + new ArrayList<>(cipherSuites.size() - 1); for (CipherSuite suite : cipherSuites.collection()) { if (suite != CipherSuite.C_SCSV) { cipherList.add(suite); @@ -1131,14 +1212,52 @@ final class ClientHandshaker extends Handshaker { } if (!negotiable) { - throw new SSLException("No negotiable cipher suite"); + throw new SSLHandshakeException("No negotiable cipher suite"); } + // Not a TLS1.2+ handshake + // For SSLv2Hello, HandshakeHash.reset() will be called, so we + // cannot call HandshakeHash.protocolDetermined() here. As it does + // not follow the spec that HandshakeHash.reset() can be only be + // called before protocolDetermined. + // if (maxProtocolVersion.v < ProtocolVersion.TLS12.v) { + // handshakeHash.protocolDetermined(maxProtocolVersion); + // } + // create the ClientHello message ClientHello clientHelloMessage = new ClientHello( sslContext.getSecureRandom(), maxProtocolVersion, sessionId, cipherSuites); + // add signature_algorithm extension + if (maxProtocolVersion.v >= ProtocolVersion.TLS12.v) { + // we will always send the signature_algorithm extension + Collection localSignAlgs = + getLocalSupportedSignAlgs(); + if (localSignAlgs.isEmpty()) { + throw new SSLHandshakeException( + "No supported signature algorithm"); + } + + clientHelloMessage.addSignatureAlgorithmsExtension(localSignAlgs); + } + + // add server_name extension + if (enableSNIExtension) { + // We cannot use the hostname resolved from name services. For + // virtual hosting, multiple hostnames may be bound to the same IP + // address, so the hostname resolved from name services is not + // reliable. + String hostname = getRawHostnameSE(); + + // we only allow FQDN + if (hostname != null && hostname.indexOf('.') > 0 && + !IPAddressUtil.isIPv4LiteralAddress(hostname) && + !IPAddressUtil.isIPv6LiteralAddress(hostname)) { + clientHelloMessage.addServerNameIndicationExtension(hostname); + } + } + // reset the client random cookie clnt_random = clientHelloMessage.clnt_random; @@ -1194,26 +1313,23 @@ final class ClientHandshaker extends Handshaker { keyExchangeString = keyExchange.name; } - String identificator = getHostnameVerificationSE(); if (tm instanceof X509ExtendedTrustManager) { - ((X509ExtendedTrustManager)tm).checkServerTrusted( - (peerCerts != null ? - peerCerts.clone() : - null), + if (conn != null) { + ((X509ExtendedTrustManager)tm).checkServerTrusted( + peerCerts.clone(), keyExchangeString, - getHostSE(), - identificator); - } else { - if (identificator != null) { - throw new RuntimeException( - "trust manager does not support peer identification"); + conn); + } else { + ((X509ExtendedTrustManager)tm).checkServerTrusted( + peerCerts.clone(), + keyExchangeString, + engine); } - - tm.checkServerTrusted( - (peerCerts != null ? - peerCerts.clone() : - peerCerts), - keyExchangeString); + } else { + // Unlikely to happen, because we have wrapped the old + // X509TrustManager with the new X509ExtendedTrustManager. + throw new CertificateException( + "Improper X509TrustManager implementation"); } } catch (CertificateException e) { // This will throw an exception, so include the original error. diff --git a/jdk/src/share/classes/sun/security/ssl/Debug.java b/jdk/src/share/classes/sun/security/ssl/Debug.java index 0373bb66c3d..a270816d929 100644 --- a/jdk/src/share/classes/sun/security/ssl/Debug.java +++ b/jdk/src/share/classes/sun/security/ssl/Debug.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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 sun.security.ssl; import java.io.PrintStream; import java.security.AccessController; +import java.util.Locale; import sun.security.action.GetPropertyAction; @@ -44,7 +45,7 @@ public class Debug { static { args = java.security.AccessController.doPrivileged( new GetPropertyAction("javax.net.debug", "")); - args = args.toLowerCase(); + args = args.toLowerCase(Locale.ENGLISH); if (args.equals("help")) { Help(); } @@ -114,7 +115,7 @@ public class Debug { return false; } else { int n = 0; - option = option.toLowerCase(); + option = option.toLowerCase(Locale.ENGLISH); if (args.indexOf("all") != -1) { return true; diff --git a/jdk/src/share/classes/sun/security/ssl/DefaultSSLContextImpl.java b/jdk/src/share/classes/sun/security/ssl/DefaultSSLContextImpl.java index 5ec2cb834c3..f4c6e160200 100644 --- a/jdk/src/share/classes/sun/security/ssl/DefaultSSLContextImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/DefaultSSLContextImpl.java @@ -98,7 +98,7 @@ public final class DefaultSSLContextImpl extends SSLContextImpl { return defaultKeyManagers; } - final Map props = new HashMap(); + final Map props = new HashMap<>(); AccessController.doPrivileged( new PrivilegedExceptionAction() { public Object run() throws Exception { diff --git a/jdk/src/share/classes/sun/security/ssl/HandshakeHash.java b/jdk/src/share/classes/sun/security/ssl/HandshakeHash.java index 530680cb9c1..ffb8f322606 100644 --- a/jdk/src/share/classes/sun/security/ssl/HandshakeHash.java +++ b/jdk/src/share/classes/sun/security/ssl/HandshakeHash.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,13 @@ package sun.security.ssl; +import java.io.ByteArrayOutputStream; import java.security.*; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Set; /** * Abstraction for the SSL/TLS hash of all handshake messages that is @@ -36,51 +42,162 @@ import java.security.*; * * This class transparently deals with cloneable and non-cloneable digests. * + * This class now supports TLS 1.2 also. The key difference for TLS 1.2 + * is that you cannot determine the hash algorithms for CertificateVerify + * at a early stage. On the other hand, it's simpler than TLS 1.1 (and earlier) + * that there is no messy MD5+SHA1 digests. + * + * You need to obey these conventions when using this class: + * + * 1. protocolDetermined(version) should be called when the negotiated + * protocol version is determined. + * + * 2. Before protocolDetermined() is called, only update(), reset(), + * restrictCertificateVerifyAlgs(), setFinishedAlg(), and + * setCertificateVerifyAlg() can be called. + * + * 3. After protocolDetermined() is called, reset() cannot be called. + * + * 4. After protocolDetermined() is called, if the version is pre-TLS 1.2, + * getFinishedHash() and getCertificateVerifyHash() cannot be called. Otherwise, + * getMD5Clone() and getSHAClone() cannot be called. + * + * 5. getMD5Clone() and getSHAClone() can only be called after + * protocolDetermined() is called and version is pre-TLS 1.2. + * + * 6. getFinishedHash() and getCertificateVerifyHash() can only be called after + * all protocolDetermined(), setCertificateVerifyAlg() and setFinishedAlg() + * have been called and the version is TLS 1.2. If a CertificateVerify message + * is to be used, call setCertificateVerifyAlg() with the hash algorithm as the + * argument. Otherwise, you still must call setCertificateVerifyAlg(null) before + * calculating any hash value. + * + * Suggestions: Call protocolDetermined(), restrictCertificateVerifyAlgs(), + * setFinishedAlg(), and setCertificateVerifyAlg() as early as possible. + * + * Example: + *
      + * HandshakeHash hh = new HandshakeHash(...)
      + * hh.protocolDetermined(ProtocolVersion.TLS12);
      + * hh.update(clientHelloBytes);
      + * hh.setFinishedAlg("SHA-256");
      + * hh.update(serverHelloBytes);
      + * ...
      + * hh.setCertificateVerifyAlg("SHA-384");
      + * hh.update(CertificateVerifyBytes);
      + * byte[] cvDigest = hh.getCertificateVerifyHash();
      + * ...
      + * hh.update(finished1);
      + * byte[] finDigest1 = hh.getFinishedHash();
      + * hh.update(finished2);
      + * byte[] finDigest2 = hh.getFinishedHash();
      + * 
      + * If no CertificateVerify message is to be used, call + *
      + * hh.setCertificateVerifyAlg(null);
      + * 
      + * This call can be made once you are certain that this message + * will never be used. */ final class HandshakeHash { - private final MessageDigest md5, sha; + // Common + + // -1: unknown + // 1: <=TLS 1.1 + // 2: TLS 1.2 + private int version = -1; + private ByteArrayOutputStream data = new ByteArrayOutputStream(); + private final boolean isServer; + + // For TLS 1.1 + private MessageDigest md5, sha; + private final int clonesNeeded; // needs to be saved for later use + + // For TLS 1.2 + // cvAlgDetermined == true means setCertificateVerifyAlg() is called + private boolean cvAlgDetermined = false; + private String cvAlg; + private MessageDigest finMD; /** * Create a new HandshakeHash. needCertificateVerify indicates whether - * a hash for the certificate verify message is required. + * a hash for the certificate verify message is required. The argument + * algs is a set of all possible hash algorithms that might be used in + * TLS 1.2. If the caller is sure that TLS 1.2 won't be used or no + * CertificateVerify message will be used, leave it null or empty. */ - HandshakeHash(boolean needCertificateVerify) { - int n = needCertificateVerify ? 3 : 2; - try { - md5 = CloneableDigest.getDigest("MD5", n); - sha = CloneableDigest.getDigest("SHA", n); - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException - ("Algorithm MD5 or SHA not available", e); - - } - } - - void update(byte b) { - md5.update(b); - sha.update(b); + HandshakeHash(boolean isServer, boolean needCertificateVerify, + Set algs) { + this.isServer = isServer; + clonesNeeded = needCertificateVerify ? 3 : 2; } void update(byte[] b, int offset, int len) { - md5.update(b, offset, len); - sha.update(b, offset, len); + switch (version) { + case 1: + md5.update(b, offset, len); + sha.update(b, offset, len); + break; + default: + if (finMD != null) { + finMD.update(b, offset, len); + } + data.write(b, offset, len); + break; + } } /** - * Reset the remaining digests. Note this does *not* reset the numbe of + * Reset the remaining digests. Note this does *not* reset the number of * digest clones that can be obtained. Digests that have already been * cloned and are gone remain gone. */ void reset() { - md5.reset(); - sha.reset(); + if (version != -1) { + throw new RuntimeException( + "reset() can be only be called before protocolDetermined"); + } + data.reset(); } + + void protocolDetermined(ProtocolVersion pv) { + + // Do not set again, will ignore + if (version != -1) return; + + version = pv.compareTo(ProtocolVersion.TLS12) >= 0 ? 2 : 1; + switch (version) { + case 1: + // initiate md5, sha and call update on saved array + try { + md5 = CloneableDigest.getDigest("MD5", clonesNeeded); + sha = CloneableDigest.getDigest("SHA", clonesNeeded); + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException + ("Algorithm MD5 or SHA not available", e); + } + byte[] bytes = data.toByteArray(); + update(bytes, 0, bytes.length); + break; + case 2: + break; + } + } + + ///////////////////////////////////////////////////////////// + // Below are old methods for pre-TLS 1.1 + ///////////////////////////////////////////////////////////// + /** * Return a new MD5 digest updated with all data hashed so far. */ MessageDigest getMD5Clone() { + if (version != 1) { + throw new RuntimeException( + "getMD5Clone() can be only be called for TLS 1.1"); + } return cloneDigest(md5); } @@ -88,6 +205,10 @@ final class HandshakeHash { * Return a new SHA digest updated with all data hashed so far. */ MessageDigest getSHAClone() { + if (version != 1) { + throw new RuntimeException( + "getSHAClone() can be only be called for TLS 1.1"); + } return cloneDigest(sha); } @@ -100,6 +221,96 @@ final class HandshakeHash { } } + ///////////////////////////////////////////////////////////// + // Below are new methods for TLS 1.2 + ///////////////////////////////////////////////////////////// + + private static String normalizeAlgName(String alg) { + alg = alg.toUpperCase(Locale.US); + if (alg.startsWith("SHA")) { + if (alg.length() == 3) { + return "SHA-1"; + } + if (alg.charAt(3) != '-') { + return "SHA-" + alg.substring(3); + } + } + return alg; + } + /** + * Specifies the hash algorithm used in Finished. This should be called + * based in info in ServerHello. + * Can be called multiple times. + */ + void setFinishedAlg(String s) { + if (s == null) { + throw new RuntimeException( + "setFinishedAlg's argument cannot be null"); + } + + // Can be called multiple times, but only set once + if (finMD != null) return; + + try { + finMD = CloneableDigest.getDigest(normalizeAlgName(s), 2); + } catch (NoSuchAlgorithmException e) { + throw new Error(e); + } + finMD.update(data.toByteArray()); + } + + /** + * Restricts the possible algorithms for the CertificateVerify. Called by + * the server based on info in CertRequest. The argument must be a subset + * of the argument with the same name in the constructor. The method can be + * called multiple times. If the caller is sure that no CertificateVerify + * message will be used, leave this argument null or empty. + */ + void restrictCertificateVerifyAlgs(Set algs) { + if (version == 1) { + throw new RuntimeException( + "setCertificateVerifyAlg() cannot be called for TLS 1.1"); + } + // Not used yet + } + + /** + * Specifies the hash algorithm used in CertificateVerify. + * Can be called multiple times. + */ + void setCertificateVerifyAlg(String s) { + + // Can be called multiple times, but only set once + if (cvAlgDetermined) return; + + cvAlg = s == null ? null : normalizeAlgName(s); + cvAlgDetermined = true; + } + + byte[] getAllHandshakeMessages() { + return data.toByteArray(); + } + + /** + * Calculates the hash in the CertificateVerify. Must be called right + * after setCertificateVerifyAlg() + */ + /*byte[] getCertificateVerifyHash() { + throw new Error("Do not call getCertificateVerifyHash()"); + }*/ + + /** + * Calculates the hash in Finished. Must be called after setFinishedAlg(). + * This method can be called twice, for Finished messages of the server + * side and client side respectively. + */ + byte[] getFinishedHash() { + try { + return cloneDigest(finMD).digest(); + } catch (Exception e) { + throw new Error("BAD"); + } + } } /** diff --git a/jdk/src/share/classes/sun/security/ssl/HandshakeMessage.java b/jdk/src/share/classes/sun/security/ssl/HandshakeMessage.java index 126ad310345..f5f84c1ef9d 100644 --- a/jdk/src/share/classes/sun/security/ssl/HandshakeMessage.java +++ b/jdk/src/share/classes/sun/security/ssl/HandshakeMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. + * copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * 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,15 +41,12 @@ import javax.security.auth.x500.X500Principal; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; -import javax.crypto.spec.SecretKeySpec; import javax.net.ssl.*; -import sun.security.action.GetPropertyAction; - import sun.security.internal.spec.TlsPrfParameterSpec; - import sun.security.ssl.CipherSuite.*; +import static sun.security.ssl.CipherSuite.PRF.*; /** * Many data structures are involved in the handshake messages. These @@ -258,6 +255,27 @@ static final class ClientHello extends HandshakeMessage { extensions.add(renegotiationInfo); } + // add server_name extension + void addServerNameIndicationExtension(String hostname) { + // We would have checked that the hostname ia a FQDN. + ArrayList hostnames = new ArrayList<>(1); + hostnames.add(hostname); + + try { + extensions.add(new ServerNameExtension(hostnames)); + } catch (IOException ioe) { + // ignore the exception and return + } + } + + // add signature_algorithm extension + void addSignatureAlgorithmsExtension( + Collection algorithms) { + HelloExtension signatureAlgorithm = + new SignatureAlgorithmsExtension(algorithms); + extensions.add(signatureAlgorithm); + } + @Override int messageType() { return ht_client_hello; } @@ -290,7 +308,8 @@ static final class ClientHello extends HandshakeMessage { s.println("*** ClientHello, " + protocolVersion); if (debug != null && Debug.isOn("verbose")) { - s.print ("RandomCookie: "); clnt_random.print(s); + s.print("RandomCookie: "); + clnt_random.print(s); s.print("Session ID: "); s.println(sessionId); @@ -327,7 +346,8 @@ class ServerHello extends HandshakeMessage // empty } - ServerHello(HandshakeInStream input, int messageLength) throws IOException { + ServerHello(HandshakeInStream input, int messageLength) + throws IOException { protocolVersion = ProtocolVersion.valueOf(input.getInt8(), input.getInt8()); svr_random = new RandomCookie(input); @@ -367,7 +387,8 @@ class ServerHello extends HandshakeMessage s.println("*** ServerHello, " + protocolVersion); if (debug != null && Debug.isOn("verbose")) { - s.print ("RandomCookie: "); svr_random.print(s); + s.print("RandomCookie: "); + svr_random.print(s); int i; @@ -413,7 +434,7 @@ class CertificateMsg extends HandshakeMessage CertificateMsg(HandshakeInStream input) throws IOException { int chainLen = input.getInt24(); - List v = new ArrayList(4); + List v = new ArrayList<>(4); CertificateFactory cf = null; while (chainLen > 0) { @@ -425,8 +446,8 @@ class CertificateMsg extends HandshakeMessage } v.add(cf.generateCertificate(new ByteArrayInputStream(cert))); } catch (CertificateException e) { - throw (SSLProtocolException)new SSLProtocolException - (e.getMessage()).initCause(e); + throw (SSLProtocolException)new SSLProtocolException( + e.getMessage()).initCause(e); } } @@ -469,7 +490,7 @@ class CertificateMsg extends HandshakeMessage } X509Certificate[] getCertificateChain() { - return chain; + return chain.clone(); } } @@ -597,9 +618,9 @@ class RSA_ServerKeyExchange extends ServerKeyExchange try { KeyFactory kfac = JsseJce.getKeyFactory("RSA"); // modulus and exponent are always positive - RSAPublicKeySpec kspec = new RSAPublicKeySpec - (new BigInteger(1, rsa_modulus), - new BigInteger(1, rsa_exponent)); + RSAPublicKeySpec kspec = new RSAPublicKeySpec( + new BigInteger(1, rsa_modulus), + new BigInteger(1, rsa_exponent)); return kfac.generatePublic(kspec); } catch (Exception e) { throw new RuntimeException(e); @@ -667,6 +688,12 @@ class DH_ServerKeyExchange extends ServerKeyExchange private byte signature []; + // protocol version being established using this ServerKeyExchange message + ProtocolVersion protocolVersion; + + // the preferable signature algorithm used by this ServerKeyExchange message + private SignatureAndHashAlgorithm preferableSignatureAlgorithm; + /* Return the Diffie-Hellman modulus */ BigInteger getModulus() { return new BigInteger(1, dh_p); @@ -712,8 +739,11 @@ class DH_ServerKeyExchange extends ServerKeyExchange * Construct from initialized DH key object, for DH_anon * key exchange. */ - DH_ServerKeyExchange(DHCrypt obj) { - getValues(obj); + DH_ServerKeyExchange(DHCrypt obj, ProtocolVersion protocolVersion) { + this.protocolVersion = protocolVersion; + this.preferableSignatureAlgorithm = null; + + setValues(obj); signature = null; } @@ -723,22 +753,33 @@ class DH_ServerKeyExchange extends ServerKeyExchange * key exchange. (Constructor called by server.) */ DH_ServerKeyExchange(DHCrypt obj, PrivateKey key, byte clntNonce[], - byte svrNonce[], SecureRandom sr) throws GeneralSecurityException { + byte svrNonce[], SecureRandom sr, + SignatureAndHashAlgorithm signAlgorithm, + ProtocolVersion protocolVersion) throws GeneralSecurityException { - getValues(obj); + this.protocolVersion = protocolVersion; + + setValues(obj); Signature sig; - if (key.getAlgorithm().equals("DSA")) { - sig = JsseJce.getSignature(JsseJce.SIGNATURE_DSA); + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + this.preferableSignatureAlgorithm = signAlgorithm; + sig = JsseJce.getSignature(signAlgorithm.getAlgorithmName()); } else { - sig = RSASignature.getInstance(); + this.preferableSignatureAlgorithm = null; + if (key.getAlgorithm().equals("DSA")) { + sig = JsseJce.getSignature(JsseJce.SIGNATURE_DSA); + } else { + sig = RSASignature.getInstance(); + } } + sig.initSign(key, sr); updateSignature(sig, clntNonce, svrNonce); signature = sig.sign(); } - private void getValues(DHCrypt obj) { + private void setValues(DHCrypt obj) { dh_p = toByteArray(obj.getModulus()); dh_g = toByteArray(obj.getBase()); dh_Ys = toByteArray(obj.getPublicKey()); @@ -749,7 +790,12 @@ class DH_ServerKeyExchange extends ServerKeyExchange * stream, as if sent from server to client for use with * DH_anon key exchange */ - DH_ServerKeyExchange(HandshakeInStream input) throws IOException { + DH_ServerKeyExchange(HandshakeInStream input, + ProtocolVersion protocolVersion) throws IOException { + + this.protocolVersion = protocolVersion; + this.preferableSignatureAlgorithm = null; + dh_p = input.getBytes16(); dh_g = input.getBytes16(); dh_Ys = input.getBytes16(); @@ -762,13 +808,38 @@ class DH_ServerKeyExchange extends ServerKeyExchange * DHE_DSS or DHE_RSA key exchange. (Called by client.) */ DH_ServerKeyExchange(HandshakeInStream input, PublicKey publicKey, - byte clntNonce[], byte svrNonce[], int messageSize) + byte clntNonce[], byte svrNonce[], int messageSize, + Collection localSupportedSignAlgs, + ProtocolVersion protocolVersion) throws IOException, GeneralSecurityException { + this.protocolVersion = protocolVersion; + + // read params: ServerDHParams dh_p = input.getBytes16(); dh_g = input.getBytes16(); dh_Ys = input.getBytes16(); + // read the signature and hash algorithm + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + int hash = input.getInt8(); // hash algorithm + int signature = input.getInt8(); // signature algorithm + + preferableSignatureAlgorithm = + SignatureAndHashAlgorithm.valueOf(hash, signature, 0); + + // Is it a local supported signature algorithm? + if (!localSupportedSignAlgs.contains( + preferableSignatureAlgorithm)) { + throw new SSLHandshakeException( + "Unsupported SignatureAndHashAlgorithm in " + + "ServerKeyExchange message"); + } + } else { + this.preferableSignatureAlgorithm = null; + } + + // read the signature byte signature[]; if (dhKeyExchangeFix) { signature = input.getBytes16(); @@ -783,12 +854,17 @@ class DH_ServerKeyExchange extends ServerKeyExchange Signature sig; String algorithm = publicKey.getAlgorithm(); - if (algorithm.equals("DSA")) { - sig = JsseJce.getSignature(JsseJce.SIGNATURE_DSA); - } else if (algorithm.equals("RSA")) { - sig = RSASignature.getInstance(); + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + sig = JsseJce.getSignature( + preferableSignatureAlgorithm.getAlgorithmName()); } else { - throw new SSLKeyException("neither an RSA or a DSA key"); + if (algorithm.equals("DSA")) { + sig = JsseJce.getSignature(JsseJce.SIGNATURE_DSA); + } else if (algorithm.equals("RSA")) { + sig = RSASignature.getInstance(); + } else { + throw new SSLKeyException("neither an RSA or a DSA key"); + } } sig.initVerify(publicKey); @@ -805,12 +881,18 @@ class DH_ServerKeyExchange extends ServerKeyExchange temp += dh_p.length; temp += dh_g.length; temp += dh_Ys.length; + if (signature != null) { + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + temp += SignatureAndHashAlgorithm.sizeInRecord(); + } + temp += signature.length; if (dhKeyExchangeFix) { temp += 2; } } + return temp; } @@ -818,7 +900,13 @@ class DH_ServerKeyExchange extends ServerKeyExchange s.putBytes16(dh_p); s.putBytes16(dh_g); s.putBytes16(dh_Ys); + if (signature != null) { + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + s.putInt8(preferableSignatureAlgorithm.getHashValue()); + s.putInt8(preferableSignatureAlgorithm.getSignatureValue()); + } + if (dhKeyExchangeFix) { s.putBytes16(signature); } else { @@ -838,6 +926,11 @@ class DH_ServerKeyExchange extends ServerKeyExchange if (signature == null) { s.println("Anonymous"); } else { + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + s.println("Signature Algorithm " + + preferableSignatureAlgorithm.getAlgorithmName()); + } + s.println("Signed with a DSA or RSA public key"); } } @@ -871,9 +964,19 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange // public key object encapsulated in this message private ECPublicKey publicKey; + // protocol version being established using this ServerKeyExchange message + ProtocolVersion protocolVersion; + + // the preferable signature algorithm used by this ServerKeyExchange message + private SignatureAndHashAlgorithm preferableSignatureAlgorithm; + ECDH_ServerKeyExchange(ECDHCrypt obj, PrivateKey privateKey, - byte[] clntNonce, byte[] svrNonce, SecureRandom sr) - throws GeneralSecurityException { + byte[] clntNonce, byte[] svrNonce, SecureRandom sr, + SignatureAndHashAlgorithm signAlgorithm, + ProtocolVersion protocolVersion) throws GeneralSecurityException { + + this.protocolVersion = protocolVersion; + publicKey = (ECPublicKey)obj.getPublicKey(); ECParameterSpec params = publicKey.getParams(); ECPoint point = publicKey.getW(); @@ -885,8 +988,14 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange return; } - Signature sig = getSignature(privateKey.getAlgorithm()); - sig.initSign(privateKey); + Signature sig; + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + this.preferableSignatureAlgorithm = signAlgorithm; + sig = JsseJce.getSignature(signAlgorithm.getAlgorithmName()); + } else { + sig = getSignature(privateKey.getAlgorithm()); + } + sig.initSign(privateKey); // where is the SecureRandom? updateSignature(sig, clntNonce, svrNonce); signatureBytes = sig.sign(); @@ -896,49 +1005,87 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange * Parse an ECDH server key exchange message. */ ECDH_ServerKeyExchange(HandshakeInStream input, PublicKey signingKey, - byte[] clntNonce, byte[] svrNonce) + byte[] clntNonce, byte[] svrNonce, + Collection localSupportedSignAlgs, + ProtocolVersion protocolVersion) throws IOException, GeneralSecurityException { + + this.protocolVersion = protocolVersion; + + // read params: ServerECDHParams int curveType = input.getInt8(); ECParameterSpec parameters; // These parsing errors should never occur as we negotiated // the supported curves during the exchange of the Hello messages. if (curveType == CURVE_NAMED_CURVE) { curveId = input.getInt16(); - if (SupportedEllipticCurvesExtension.isSupported(curveId) == false) { - throw new SSLHandshakeException("Unsupported curveId: " + curveId); + if (SupportedEllipticCurvesExtension.isSupported(curveId) + == false) { + throw new SSLHandshakeException( + "Unsupported curveId: " + curveId); } - String curveOid = SupportedEllipticCurvesExtension.getCurveOid(curveId); + String curveOid = + SupportedEllipticCurvesExtension.getCurveOid(curveId); if (curveOid == null) { - throw new SSLHandshakeException("Unknown named curve: " + curveId); + throw new SSLHandshakeException( + "Unknown named curve: " + curveId); } parameters = JsseJce.getECParameterSpec(curveOid); if (parameters == null) { - throw new SSLHandshakeException("Unsupported curve: " + curveOid); + throw new SSLHandshakeException( + "Unsupported curve: " + curveOid); } } else { - throw new SSLHandshakeException("Unsupported ECCurveType: " + curveType); + throw new SSLHandshakeException( + "Unsupported ECCurveType: " + curveType); } pointBytes = input.getBytes8(); ECPoint point = JsseJce.decodePoint(pointBytes, parameters.getCurve()); KeyFactory factory = JsseJce.getKeyFactory("EC"); - publicKey = (ECPublicKey)factory.generatePublic(new ECPublicKeySpec(point, parameters)); + publicKey = (ECPublicKey)factory.generatePublic( + new ECPublicKeySpec(point, parameters)); if (signingKey == null) { // ECDH_anon return; } - // verify the signature + // read the signature and hash algorithm + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + int hash = input.getInt8(); // hash algorithm + int signature = input.getInt8(); // signature algorithm + + preferableSignatureAlgorithm = + SignatureAndHashAlgorithm.valueOf(hash, signature, 0); + + // Is it a local supported signature algorithm? + if (!localSupportedSignAlgs.contains( + preferableSignatureAlgorithm)) { + throw new SSLHandshakeException( + "Unsupported SignatureAndHashAlgorithm in " + + "ServerKeyExchange message"); + } + } + + // read the signature signatureBytes = input.getBytes16(); - Signature sig = getSignature(signingKey.getAlgorithm()); + + // verify the signature + Signature sig; + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + sig = JsseJce.getSignature( + preferableSignatureAlgorithm.getAlgorithmName()); + } else { + sig = getSignature(signingKey.getAlgorithm()); + } sig.initVerify(signingKey); updateSignature(sig, clntNonce, svrNonce); if (sig.verify(signatureBytes) == false ) { - throw new SSLKeyException - ("Invalid signature on ECDH server key exchange message"); + throw new SSLKeyException( + "Invalid signature on ECDH server key exchange message"); } } @@ -949,7 +1096,8 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange return publicKey; } - private static Signature getSignature(String keyAlgorithm) throws NoSuchAlgorithmException { + private static Signature getSignature(String keyAlgorithm) + throws NoSuchAlgorithmException { if (keyAlgorithm.equals("EC")) { return JsseJce.getSignature(JsseJce.SIGNATURE_ECDSA); } else if (keyAlgorithm.equals("RSA")) { @@ -973,6 +1121,11 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange int messageLength() { int sigLen = (signatureBytes == null) ? 0 : 2 + signatureBytes.length; + + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + sigLen += SignatureAndHashAlgorithm.sizeInRecord(); + } + return 4 + pointBytes.length + sigLen; } @@ -980,6 +1133,11 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange s.putInt8(CURVE_NAMED_CURVE); s.putInt16(curveId); s.putBytes8(pointBytes); + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + s.putInt8(preferableSignatureAlgorithm.getHashValue()); + s.putInt8(preferableSignatureAlgorithm.getSignatureValue()); + } + if (signatureBytes != null) { s.putBytes16(signatureBytes); } @@ -989,6 +1147,11 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange s.println("*** ECDH ServerKeyExchange"); if (debug != null && Debug.isOn("verbose")) { + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + s.println("Signature Algorithm " + + preferableSignatureAlgorithm.getAlgorithmName()); + } + s.println("Server key: " + publicKey); } } @@ -1014,8 +1177,8 @@ static final class DistinguishedName { try { return new X500Principal(name); } catch (IllegalArgumentException e) { - throw (SSLProtocolException)new SSLProtocolException - (e.getMessage()).initCause(e); + throw (SSLProtocolException)new SSLProtocolException( + e.getMessage()).initCause(e); } } @@ -1038,12 +1201,25 @@ static final class DistinguishedName { * * Authenticated servers may ask clients to authenticate themselves * in turn, using this message. + * + * Prior to TLS 1.2, the structure of the message is defined as: + * struct { + * ClientCertificateType certificate_types<1..2^8-1>; + * DistinguishedName certificate_authorities<0..2^16-1>; + * } CertificateRequest; + * + * In TLS 1.2, the structure is changed to: + * struct { + * ClientCertificateType certificate_types<1..2^8-1>; + * SignatureAndHashAlgorithm + * supported_signature_algorithms<2^16-1>; + * DistinguishedName certificate_authorities<0..2^16-1>; + * } CertificateRequest; + * */ static final class CertificateRequest extends HandshakeMessage { - int messageType() { return ht_certificate_request; } - // enum ClientCertificateType static final int cct_rsa_sign = 1; static final int cct_dss_sign = 2; @@ -1068,8 +1244,21 @@ class CertificateRequest extends HandshakeMessage DistinguishedName authorities []; // 3 to 2^16 - 1 // ... "3" because that's the smallest DER-encoded X500 DN - CertificateRequest(X509Certificate ca[], KeyExchange keyExchange) - throws IOException { + // protocol version being established using this CertificateRequest message + ProtocolVersion protocolVersion; + + // supported_signature_algorithms for TLS 1.2 or later + private Collection algorithms; + + // length of supported_signature_algorithms + private int algorithmsLen; + + CertificateRequest(X509Certificate ca[], KeyExchange keyExchange, + Collection signAlgs, + ProtocolVersion protocolVersion) throws IOException { + + this.protocolVersion = protocolVersion; + // always use X500Principal authorities = new DistinguishedName[ca.length]; for (int i = 0; i < ca.length; i++) { @@ -1081,12 +1270,65 @@ class CertificateRequest extends HandshakeMessage // needs to be adapted to take keyExchange into account. // We only request ECDSA client auth if we have ECC crypto available. this.types = JsseJce.isEcAvailable() ? TYPES_ECC : TYPES_NO_ECC; + + // Use supported_signature_algorithms for TLS 1.2 or later. + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + if (signAlgs == null || signAlgs.isEmpty()) { + throw new SSLProtocolException( + "No supported signature algorithms"); + } + + algorithms = new ArrayList(signAlgs); + algorithmsLen = + SignatureAndHashAlgorithm.sizeInRecord() * algorithms.size(); + } else { + algorithms = new ArrayList(); + algorithmsLen = 0; + } } - CertificateRequest(HandshakeInStream input) throws IOException { + CertificateRequest(HandshakeInStream input, + ProtocolVersion protocolVersion) throws IOException { + + this.protocolVersion = protocolVersion; + + // Read the certificate_types. types = input.getBytes8(); + + // Read the supported_signature_algorithms for TLS 1.2 or later. + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + algorithmsLen = input.getInt16(); + if (algorithmsLen < 2) { + throw new SSLProtocolException( + "Invalid supported_signature_algorithms field"); + } + + algorithms = new ArrayList(); + int remains = algorithmsLen; + int sequence = 0; + while (remains > 1) { // needs at least two bytes + int hash = input.getInt8(); // hash algorithm + int signature = input.getInt8(); // signature algorithm + + SignatureAndHashAlgorithm algorithm = + SignatureAndHashAlgorithm.valueOf(hash, signature, + ++sequence); + algorithms.add(algorithm); + remains -= 2; // one byte for hash, one byte for signature + } + + if (remains != 0) { + throw new SSLProtocolException( + "Invalid supported_signature_algorithms field"); + } + } else { + algorithms = new ArrayList(); + algorithmsLen = 0; + } + + // read the certificate_authorities int len = input.getInt16(); - ArrayList v = new ArrayList(); + ArrayList v = new ArrayList<>(); while (len >= 3) { DistinguishedName dn = new DistinguishedName(input); v.add(dn); @@ -1108,31 +1350,58 @@ class CertificateRequest extends HandshakeMessage return ret; } - int messageLength() - { - int len; + Collection getSignAlgorithms() { + return algorithms; + } - len = 1 + types.length + 2; - for (int i = 0; i < authorities.length; i++) + @Override + int messageType() { + return ht_certificate_request; + } + + @Override + int messageLength() { + int len = 1 + types.length + 2; + + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + len += algorithmsLen + 2; + } + + for (int i = 0; i < authorities.length; i++) { len += authorities[i].length(); + } + return len; } - void send(HandshakeOutStream output) throws IOException - { - int len = 0; - - for (int i = 0; i < authorities.length; i++) - len += authorities[i].length(); - + @Override + void send(HandshakeOutStream output) throws IOException { + // put certificate_types output.putBytes8(types); + + // put supported_signature_algorithms + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + output.putInt16(algorithmsLen); + for (SignatureAndHashAlgorithm algorithm : algorithms) { + output.putInt8(algorithm.getHashValue()); // hash + output.putInt8(algorithm.getSignatureValue()); // signature + } + } + + // put certificate_authorities + int len = 0; + for (int i = 0; i < authorities.length; i++) { + len += authorities[i].length(); + } + output.putInt16(len); - for (int i = 0; i < authorities.length; i++) + for (int i = 0; i < authorities.length; i++) { authorities[i].send(output); + } } - void print(PrintStream s) throws IOException - { + @Override + void print(PrintStream s) throws IOException { s.println("*** CertificateRequest"); if (debug != null && Debug.isOn("verbose")) { @@ -1166,9 +1435,28 @@ class CertificateRequest extends HandshakeMessage } s.println(); + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + StringBuffer buffer = new StringBuffer(); + boolean opened = false; + for (SignatureAndHashAlgorithm signAlg : algorithms) { + if (opened) { + buffer.append(", " + signAlg.getAlgorithmName()); + } else { + buffer.append(signAlg.getAlgorithmName()); + opened = true; + } + } + s.println("Supported Signature Algorithms: " + buffer); + } + s.println("Cert Authorities:"); - for (int i = 0; i < authorities.length; i++) - authorities[i].print(s); + if (authorities.length == 0) { + s.println(""); + } else { + for (int i = 0; i < authorities.length; i++) { + authorities[i].print(s); + } + } } } } @@ -1219,18 +1507,34 @@ class ServerHelloDone extends HandshakeMessage */ static final class CertificateVerify extends HandshakeMessage { - int messageType() { return ht_certificate_verify; } - + // the signature bytes private byte[] signature; + // protocol version being established using this ServerKeyExchange message + ProtocolVersion protocolVersion; + + // the preferable signature algorithm used by this CertificateVerify message + private SignatureAndHashAlgorithm preferableSignatureAlgorithm = null; + /* * Create an RSA or DSA signed certificate verify message. */ - CertificateVerify(ProtocolVersion protocolVersion, HandshakeHash - handshakeHash, PrivateKey privateKey, SecretKey masterSecret, - SecureRandom sr) throws GeneralSecurityException { + CertificateVerify(ProtocolVersion protocolVersion, + HandshakeHash handshakeHash, PrivateKey privateKey, + SecretKey masterSecret, SecureRandom sr, + SignatureAndHashAlgorithm signAlgorithm) + throws GeneralSecurityException { + + this.protocolVersion = protocolVersion; + String algorithm = privateKey.getAlgorithm(); - Signature sig = getSignature(protocolVersion, algorithm); + Signature sig = null; + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + this.preferableSignatureAlgorithm = signAlgorithm; + sig = JsseJce.getSignature(signAlgorithm.getAlgorithmName()); + } else { + sig = getSignature(protocolVersion, algorithm); + } sig.initSign(privateKey, sr); updateSignature(sig, protocolVersion, handshakeHash, algorithm, masterSecret); @@ -1240,10 +1544,40 @@ static final class CertificateVerify extends HandshakeMessage { // // Unmarshal the signed data from the input stream. // - CertificateVerify(HandshakeInStream input) throws IOException { + CertificateVerify(HandshakeInStream input, + Collection localSupportedSignAlgs, + ProtocolVersion protocolVersion) throws IOException { + + this.protocolVersion = protocolVersion; + + // read the signature and hash algorithm + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + int hashAlg = input.getInt8(); // hash algorithm + int signAlg = input.getInt8(); // signature algorithm + + preferableSignatureAlgorithm = + SignatureAndHashAlgorithm.valueOf(hashAlg, signAlg, 0); + + // Is it a local supported signature algorithm? + if (!localSupportedSignAlgs.contains( + preferableSignatureAlgorithm)) { + throw new SSLHandshakeException( + "Unsupported SignatureAndHashAlgorithm in " + + "ServerKeyExchange message"); + } + } + + // read the signature signature = input.getBytes16(); } + /* + * Get the preferable signature algorithm used by this message + */ + SignatureAndHashAlgorithm getPreferableSignatureAlgorithm() { + return preferableSignatureAlgorithm; + } + /* * Verify a certificate verify message. Return the result of verification, * if there is a problem throw a GeneralSecurityException. @@ -1252,7 +1586,13 @@ static final class CertificateVerify extends HandshakeMessage { HandshakeHash handshakeHash, PublicKey publicKey, SecretKey masterSecret) throws GeneralSecurityException { String algorithm = publicKey.getAlgorithm(); - Signature sig = getSignature(protocolVersion, algorithm); + Signature sig = null; + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + sig = JsseJce.getSignature( + preferableSignatureAlgorithm.getAlgorithmName()); + } else { + sig = getSignature(protocolVersion, algorithm); + } sig.initVerify(publicKey); updateSignature(sig, protocolVersion, handshakeHash, algorithm, masterSecret); @@ -1286,25 +1626,35 @@ static final class CertificateVerify extends HandshakeMessage { ProtocolVersion protocolVersion, HandshakeHash handshakeHash, String algorithm, SecretKey masterKey) throws SignatureException { - MessageDigest md5Clone = handshakeHash.getMD5Clone(); - MessageDigest shaClone = handshakeHash.getSHAClone(); - boolean tls = protocolVersion.v >= ProtocolVersion.TLS10.v; + if (algorithm.equals("RSA")) { - if (tls) { - // nothing to do - } else { // SSLv3 - updateDigest(md5Clone, MD5_pad1, MD5_pad2, masterKey); - updateDigest(shaClone, SHA_pad1, SHA_pad2, masterKey); + if (protocolVersion.v < ProtocolVersion.TLS12.v) { // TLS1.1- + MessageDigest md5Clone = handshakeHash.getMD5Clone(); + MessageDigest shaClone = handshakeHash.getSHAClone(); + + if (protocolVersion.v < ProtocolVersion.TLS10.v) { // SSLv3 + updateDigest(md5Clone, MD5_pad1, MD5_pad2, masterKey); + updateDigest(shaClone, SHA_pad1, SHA_pad2, masterKey); + } + + // The signature must be an instance of RSASignature, need + // to use these hashes directly. + RSASignature.setHashes(sig, md5Clone, shaClone); + } else { // TLS1.2+ + sig.update(handshakeHash.getAllHandshakeMessages()); } - // need to use these hashes directly - RSASignature.setHashes(sig, md5Clone, shaClone); } else { // DSA, ECDSA - if (tls) { - // nothing to do - } else { // SSLv3 - updateDigest(shaClone, SHA_pad1, SHA_pad2, masterKey); + if (protocolVersion.v < ProtocolVersion.TLS12.v) { // TLS1.1- + MessageDigest shaClone = handshakeHash.getSHAClone(); + + if (protocolVersion.v < ProtocolVersion.TLS10.v) { // SSLv3 + updateDigest(shaClone, SHA_pad1, SHA_pad2, masterKey); + } + + sig.update(shaClone.digest()); + } else { // TLS1.2+ + sig.update(handshakeHash.getAllHandshakeMessages()); } - sig.update(shaClone.digest()); } } @@ -1314,7 +1664,8 @@ static final class CertificateVerify extends HandshakeMessage { * all preceding handshake messages. * Used by the Finished class as well. */ - static void updateDigest(MessageDigest md, byte[] pad1, byte[] pad2, + private static void updateDigest(MessageDigest md, + byte[] pad1, byte[] pad2, SecretKey masterSecret) { // Digest the key bytes if available. // Otherwise (sensitive key), try digesting the key directly. @@ -1368,7 +1719,7 @@ static final class CertificateVerify extends HandshakeMessage { // Note that this will prevent the Spi classes from being GC'd. We assume // that is not a problem. private final static Map methodCache = - new ConcurrentHashMap(); + new ConcurrentHashMap<>(); private static void digestKey(MessageDigest md, SecretKey key) { try { @@ -1390,26 +1741,54 @@ static final class CertificateVerify extends HandshakeMessage { methodCache.put(clazz, r); } if (r == NULL_OBJECT) { - throw new Exception("Digest does not support implUpdate(SecretKey)"); + throw new Exception( + "Digest does not support implUpdate(SecretKey)"); } Method update = (Method)r; update.invoke(spi, key); } catch (Exception e) { - throw new RuntimeException - ("Could not obtain encoded key and MessageDigest cannot digest key", e); + throw new RuntimeException( + "Could not obtain encoded key and " + + "MessageDigest cannot digest key", e); } } - int messageLength() { - return 2 + signature.length; + @Override + int messageType() { + return ht_certificate_verify; } + @Override + int messageLength() { + int temp = 2; + + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + temp += SignatureAndHashAlgorithm.sizeInRecord(); + } + + return temp + signature.length; + } + + @Override void send(HandshakeOutStream s) throws IOException { + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + s.putInt8(preferableSignatureAlgorithm.getHashValue()); + s.putInt8(preferableSignatureAlgorithm.getSignatureValue()); + } + s.putBytes16(signature); } + @Override void print(PrintStream s) throws IOException { s.println("*** CertificateVerify"); + + if (debug != null && Debug.isOn("verbose")) { + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + s.println("Signature Algorithm " + + preferableSignatureAlgorithm.getAlgorithmName()); + } + } } } @@ -1447,20 +1826,30 @@ static final class Finished extends HandshakeMessage { */ private byte[] verifyData; + /* + * Current cipher suite we are negotiating. TLS 1.2 has + * ciphersuite-defined PRF algorithms. + */ + private ProtocolVersion protocolVersion; + private CipherSuite cipherSuite; + /* * Create a finished message to send to the remote peer. */ Finished(ProtocolVersion protocolVersion, HandshakeHash handshakeHash, - int sender, SecretKey master) { - verifyData = getFinished(protocolVersion, handshakeHash, sender, - master); + int sender, SecretKey master, CipherSuite cipherSuite) { + this.protocolVersion = protocolVersion; + this.cipherSuite = cipherSuite; + verifyData = getFinished(handshakeHash, sender, master); } /* * Constructor that reads FINISHED message from stream. */ - Finished(ProtocolVersion protocolVersion, HandshakeInStream input) - throws IOException { + Finished(ProtocolVersion protocolVersion, HandshakeInStream input, + CipherSuite cipherSuite) throws IOException { + this.protocolVersion = protocolVersion; + this.cipherSuite = cipherSuite; int msgLen = (protocolVersion.v >= ProtocolVersion.TLS10.v) ? 12 : 36; verifyData = new byte[msgLen]; input.read(verifyData); @@ -1472,18 +1861,16 @@ static final class Finished extends HandshakeMessage { * both client and server are fully in sync, and that the handshake * computations have been successful. */ - boolean verify(ProtocolVersion protocolVersion, - HandshakeHash handshakeHash, int sender, SecretKey master) { - byte[] myFinished = getFinished(protocolVersion, handshakeHash, - sender, master); + boolean verify(HandshakeHash handshakeHash, int sender, SecretKey master) { + byte[] myFinished = getFinished(handshakeHash, sender, master); return Arrays.equals(myFinished, verifyData); } /* * Perform the actual finished message calculation. */ - private static byte[] getFinished(ProtocolVersion protocolVersion, - HandshakeHash handshakeHash, int sender, SecretKey masterKey) { + private byte[] getFinished(HandshakeHash handshakeHash, + int sender, SecretKey masterKey) { byte[] sslLabel; String tlsLabel; if (sender == CLIENT) { @@ -1495,23 +1882,53 @@ static final class Finished extends HandshakeMessage { } else { throw new RuntimeException("Invalid sender: " + sender); } - MessageDigest md5Clone = handshakeHash.getMD5Clone(); - MessageDigest shaClone = handshakeHash.getSHAClone(); - if (protocolVersion.v >= ProtocolVersion.TLS10.v) { - // TLS - try { - byte[] seed = new byte[36]; - md5Clone.digest(seed, 0, 16); - shaClone.digest(seed, 16, 20); - TlsPrfParameterSpec spec = new TlsPrfParameterSpec - (masterKey, tlsLabel, seed, 12); - KeyGenerator prf = JsseJce.getKeyGenerator("SunTlsPrf"); - prf.init(spec); - SecretKey prfKey = prf.generateKey(); + if (protocolVersion.v >= ProtocolVersion.TLS10.v) { + // TLS 1.0+ + try { + byte [] seed; + String prfAlg; + PRF prf; + + // Get the KeyGenerator alg and calculate the seed. + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + // TLS 1.2 + seed = handshakeHash.getFinishedHash(); + + prfAlg = "SunTls12Prf"; + prf = cipherSuite.prfAlg; + } else { + // TLS 1.0/1.1 + MessageDigest md5Clone = handshakeHash.getMD5Clone(); + MessageDigest shaClone = handshakeHash.getSHAClone(); + seed = new byte[36]; + md5Clone.digest(seed, 0, 16); + shaClone.digest(seed, 16, 20); + + prfAlg = "SunTlsPrf"; + prf = P_NONE; + } + + String prfHashAlg = prf.getPRFHashAlg(); + int prfHashLength = prf.getPRFHashLength(); + int prfBlockSize = prf.getPRFBlockSize(); + + /* + * RFC 5246/7.4.9 says that finished messages can + * be ciphersuite-specific in both length/PRF hash + * algorithm. If we ever run across a different + * length, this call will need to be updated. + */ + TlsPrfParameterSpec spec = new TlsPrfParameterSpec( + masterKey, tlsLabel, seed, 12, + prfHashAlg, prfHashLength, prfBlockSize); + + KeyGenerator kg = JsseJce.getKeyGenerator(prfAlg); + kg.init(spec); + SecretKey prfKey = kg.generateKey(); if ("RAW".equals(prfKey.getFormat()) == false) { - throw new ProviderException - ("Invalid PRF output, format must be RAW"); + throw new ProviderException( + "Invalid PRF output, format must be RAW"); } byte[] finished = prfKey.getEncoded(); return finished; @@ -1520,6 +1937,8 @@ static final class Finished extends HandshakeMessage { } } else { // SSLv3 + MessageDigest md5Clone = handshakeHash.getMD5Clone(); + MessageDigest shaClone = handshakeHash.getSHAClone(); updateDigest(md5Clone, sslLabel, MD5_pad1, MD5_pad2, masterKey); updateDigest(shaClone, sslLabel, SHA_pad1, SHA_pad2, masterKey); byte[] finished = new byte[36]; diff --git a/jdk/src/share/classes/sun/security/ssl/Handshaker.java b/jdk/src/share/classes/sun/security/ssl/Handshaker.java index ddef8fc221a..050355cf7b8 100644 --- a/jdk/src/share/classes/sun/security/ssl/Handshaker.java +++ b/jdk/src/share/classes/sun/security/ssl/Handshaker.java @@ -29,13 +29,12 @@ package sun.security.ssl; import java.io.*; import java.util.*; import java.security.*; -import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.AccessController; +import java.security.AlgorithmConstraints; import java.security.AccessControlContext; import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; -import java.security.cert.X509Certificate; import javax.crypto.*; import javax.crypto.spec.*; @@ -49,6 +48,8 @@ import sun.security.internal.interfaces.TlsMasterSecret; import sun.security.ssl.HandshakeMessage.*; import sun.security.ssl.CipherSuite.*; +import static sun.security.ssl.CipherSuite.PRF.*; + /** * Handshaker ... processes handshake records from an SSL V3.0 * data stream, handling all the details of the handshake protocol. @@ -71,13 +72,48 @@ abstract class Handshaker { byte[] clientVerifyData; byte[] serverVerifyData; - // is it an initial negotiation or a renegotiation? + // Is it an initial negotiation or a renegotiation? boolean isInitialHandshake; - // list of enabled protocols - ProtocolList enabledProtocols; + // List of enabled protocols + private ProtocolList enabledProtocols; + + // List of enabled CipherSuites + private CipherSuiteList enabledCipherSuites; + + // The endpoint identification protocol + String identificationProtocol; + + // The cryptographic algorithm constraints + private AlgorithmConstraints algorithmConstraints = null; + + // Local supported signature and algorithms + Collection localSupportedSignAlgs; + + // Peer supported signature and algorithms + Collection peerSupportedSignAlgs; + + /* + + /* + * List of active protocols + * + * Active protocols is a subset of enabled protocols, and will + * contain only those protocols that have vaild cipher suites + * enabled. + */ + private ProtocolList activeProtocols; + + /* + * List of active cipher suites + * + * Active cipher suites is a subset of enabled cipher suites, and will + * contain only those cipher suites available for the active protocols. + */ + private CipherSuiteList activeCipherSuites; private boolean isClient; + private boolean needCertVerify; SSLSocketImpl conn = null; SSLEngineImpl engine = null; @@ -90,13 +126,6 @@ abstract class Handshaker { RandomCookie clnt_random, svr_random; SSLSessionImpl session; - // Temporary MD5 and SHA message digests. Must always be left - // in reset state after use. - private MessageDigest md5Tmp, shaTmp; - - // list of enabled CipherSuites - CipherSuiteList enabledCipherSuites; - // current CipherSuite. Never null, initially SSL_NULL_WITH_NULL_NULL CipherSuite cipherSuite; @@ -191,6 +220,7 @@ abstract class Handshaker { this.sslContext = context; this.isClient = isClient; + this.needCertVerify = needCertVerify; this.activeProtocolVersion = activeProtocolVersion; this.isInitialHandshake = isInitialHandshake; this.secureRenegotiation = secureRenegotiation; @@ -200,23 +230,12 @@ abstract class Handshaker { invalidated = false; setCipherSuite(CipherSuite.C_NULL); - - md5Tmp = JsseJce.getMD5(); - shaTmp = JsseJce.getSHA(); - - // - // We accumulate digests of the handshake messages so that - // we can read/write CertificateVerify and Finished messages, - // getting assurance against some particular active attacks. - // - handshakeHash = new HandshakeHash(needCertVerify); - setEnabledProtocols(enabledProtocols); if (conn != null) { - conn.getAppInputStream().r.setHandshakeHash(handshakeHash); + algorithmConstraints = new SSLAlgorithmConstraints(conn, true); } else { // engine != null - engine.inputRecord.setHandshakeHash(handshakeHash); + algorithmConstraints = new SSLAlgorithmConstraints(engine, true); } @@ -233,7 +252,7 @@ abstract class Handshaker { // client's cert verify, those constants are in a convenient // order to drastically simplify state machine checking. // - state = -1; + state = -2; // initialized but not activated } /* @@ -268,6 +287,14 @@ abstract class Handshaker { } } + String getRawHostnameSE() { + if (conn != null) { + return conn.getRawHostname(); + } else { + return engine.getPeerHost(); + } + } + String getHostSE() { if (conn != null) { return conn.getHost(); @@ -313,14 +340,6 @@ abstract class Handshaker { } } - String getHostnameVerificationSE() { - if (conn != null) { - return conn.getHostnameVerification(); - } else { - return engine.getHostnameVerification(); - } - } - AccessControlContext getAccSE() { if (conn != null) { return conn.getAcc(); @@ -345,39 +364,139 @@ abstract class Handshaker { void setVersion(ProtocolVersion protocolVersion) { this.protocolVersion = protocolVersion; setVersionSE(protocolVersion); + output.r.setVersion(protocolVersion); } + /** + * Set the enabled protocols. Called from the constructor or + * SSLSocketImpl/SSLEngineImpl.setEnabledProtocols() (if the + * handshake is not yet in progress). + */ + void setEnabledProtocols(ProtocolList enabledProtocols) { + activeCipherSuites = null; + activeProtocols = null; + + this.enabledProtocols = enabledProtocols; + } + + /** + * Set the enabled cipher suites. Called from + * SSLSocketImpl/SSLEngineImpl.setEnabledCipherSuites() (if the + * handshake is not yet in progress). + */ + void setEnabledCipherSuites(CipherSuiteList enabledCipherSuites) { + activeCipherSuites = null; + activeProtocols = null; + this.enabledCipherSuites = enabledCipherSuites; + } + + /** + * Set the algorithm constraints. Called from the constructor or + * SSLSocketImpl/SSLEngineImpl.setAlgorithmConstraints() (if the + * handshake is not yet in progress). + */ + void setAlgorithmConstraints(AlgorithmConstraints algorithmConstraints) { + activeCipherSuites = null; + activeProtocols = null; + + this.algorithmConstraints = + new SSLAlgorithmConstraints(algorithmConstraints); + this.localSupportedSignAlgs = null; + } + + Collection getLocalSupportedSignAlgs() { + if (localSupportedSignAlgs == null) { + localSupportedSignAlgs = + SignatureAndHashAlgorithm.getSupportedAlgorithms( + algorithmConstraints); + } + + return localSupportedSignAlgs; + } + + void setPeerSupportedSignAlgs( + Collection algorithms) { + peerSupportedSignAlgs = + new ArrayList(algorithms); + } + + Collection getPeerSupportedSignAlgs() { + return peerSupportedSignAlgs; + } + /** - * Set the enabled protocols. Called from the constructor or - * SSLSocketImpl.setEnabledProtocols() (if the handshake is not yet - * in progress). + * Set the identification protocol. Called from the constructor or + * SSLSocketImpl/SSLEngineImpl.setIdentificationProtocol() (if the + * handshake is not yet in progress). */ - void setEnabledProtocols(ProtocolList enabledProtocols) { - this.enabledProtocols = enabledProtocols; + void setIdentificationProtocol(String protocol) { + this.identificationProtocol = protocol; + } + + /** + * Prior to handshaking, activate the handshake and initialize the version, + * input stream and output stream. + */ + void activate(ProtocolVersion helloVersion) throws IOException { + if (activeProtocols == null) { + activeProtocols = getActiveProtocols(); + } + + if (activeProtocols.collection().isEmpty() || + activeProtocols.max.v == ProtocolVersion.NONE.v) { + throw new SSLHandshakeException("No appropriate protocol"); + } + + if (activeCipherSuites == null) { + activeCipherSuites = getActiveCipherSuites(); + } + + if (activeCipherSuites.collection().isEmpty()) { + throw new SSLHandshakeException("No appropriate cipher suite"); + } // temporary protocol version until the actual protocol version // is negotiated in the Hello exchange. This affects the record - // version we sent with the ClientHello. Using max() as the record - // version is not really correct but some implementations fail to - // correctly negotiate TLS otherwise. - protocolVersion = enabledProtocols.max; + // version we sent with the ClientHello. + if (!isInitialHandshake) { + protocolVersion = activeProtocolVersion; + } else { + protocolVersion = activeProtocols.max; + } - ProtocolVersion helloVersion = enabledProtocols.helloVersion; + if (helloVersion == null || helloVersion.v == ProtocolVersion.NONE.v) { + helloVersion = activeProtocols.helloVersion; + } + // We accumulate digests of the handshake messages so that + // we can read/write CertificateVerify and Finished messages, + // getting assurance against some particular active attacks. + Set localSupportedHashAlgorithms = + SignatureAndHashAlgorithm.getHashAlgorithmNames( + getLocalSupportedSignAlgs()); + handshakeHash = new HandshakeHash(!isClient, needCertVerify, + localSupportedHashAlgorithms); + + // Generate handshake input/output stream. input = new HandshakeInStream(handshakeHash); - if (conn != null) { output = new HandshakeOutStream(protocolVersion, helloVersion, handshakeHash, conn); + conn.getAppInputStream().r.setHandshakeHash(handshakeHash); conn.getAppInputStream().r.setHelloVersion(helloVersion); + conn.getAppOutputStream().r.setHelloVersion(helloVersion); } else { output = new HandshakeOutStream(protocolVersion, helloVersion, handshakeHash, engine); + engine.inputRecord.setHandshakeHash(handshakeHash); + engine.inputRecord.setHelloVersion(helloVersion); engine.outputRecord.setHelloVersion(helloVersion); } + // move state to activated + state = -1; } /** @@ -392,20 +511,149 @@ abstract class Handshaker { /** * Check if the given ciphersuite is enabled and available. - * (Enabled ciphersuites are always available unless the status has - * changed due to change in JCE providers since it was enabled). * Does not check if the required server certificates are available. */ boolean isNegotiable(CipherSuite s) { - return enabledCipherSuites.contains(s) && s.isNegotiable(); + if (activeCipherSuites == null) { + activeCipherSuites = getActiveCipherSuites(); + } + + return activeCipherSuites.contains(s) && s.isNegotiable(); } /** - * As long as handshaking has not started, we can + * Check if the given protocol version is enabled and available. + */ + boolean isNegotiable(ProtocolVersion protocolVersion) { + if (activeProtocols == null) { + activeProtocols = getActiveProtocols(); + } + + return activeProtocols.contains(protocolVersion); + } + + /** + * Select a protocol version from the list. Called from + * ServerHandshaker to negotiate protocol version. + * + * Return the lower of the protocol version suggested in the + * clien hello and the highest supported by the server. + */ + ProtocolVersion selectProtocolVersion(ProtocolVersion protocolVersion) { + if (activeProtocols == null) { + activeProtocols = getActiveProtocols(); + } + + return activeProtocols.selectProtocolVersion(protocolVersion); + } + + /** + * Get the active cipher suites. + * + * In TLS 1.1, many weak or vulnerable cipher suites were obsoleted, + * such as TLS_RSA_EXPORT_WITH_RC4_40_MD5. The implementation MUST NOT + * negotiate these cipher suites in TLS 1.1 or later mode. + * + * Therefore, when the active protocols only include TLS 1.1 or later, + * the client cannot request to negotiate those obsoleted cipher + * suites. That is, the obsoleted suites should not be included in the + * client hello. So we need to create a subset of the enabled cipher + * suites, the active cipher suites, which does not contain obsoleted + * cipher suites of the minimum active protocol. + * + * Return empty list instead of null if no active cipher suites. + */ + CipherSuiteList getActiveCipherSuites() { + if (activeCipherSuites == null) { + if (activeProtocols == null) { + activeProtocols = getActiveProtocols(); + } + + ArrayList suites = new ArrayList<>(); + if (!(activeProtocols.collection().isEmpty()) && + activeProtocols.min.v != ProtocolVersion.NONE.v) { + for (CipherSuite suite : enabledCipherSuites.collection()) { + if (suite.obsoleted > activeProtocols.min.v && + suite.supported <= activeProtocols.max.v) { + if (algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + suite.name, null)) { + suites.add(suite); + } + } else if (debug != null && Debug.isOn("verbose")) { + if (suite.obsoleted <= activeProtocols.min.v) { + System.out.println( + "Ignoring obsoleted cipher suite: " + suite); + } else { + System.out.println( + "Ignoring unsupported cipher suite: " + suite); + } + } + } + } + activeCipherSuites = new CipherSuiteList(suites); + } + + return activeCipherSuites; + } + + /* + * Get the active protocol versions. + * + * In TLS 1.1, many weak or vulnerable cipher suites were obsoleted, + * such as TLS_RSA_EXPORT_WITH_RC4_40_MD5. The implementation MUST NOT + * negotiate these cipher suites in TLS 1.1 or later mode. + * + * For example, if "TLS_RSA_EXPORT_WITH_RC4_40_MD5" is the + * only enabled cipher suite, the client cannot request TLS 1.1 or + * later, even though TLS 1.1 or later is enabled. We need to create a + * subset of the enabled protocols, called the active protocols, which + * contains protocols appropriate to the list of enabled Ciphersuites. + * + * Return empty list instead of null if no active protocol versions. + */ + ProtocolList getActiveProtocols() { + if (activeProtocols == null) { + ArrayList protocols = new ArrayList<>(4); + for (ProtocolVersion protocol : enabledProtocols.collection()) { + boolean found = false; + for (CipherSuite suite : enabledCipherSuites.collection()) { + if (suite.isAvailable() && suite.obsoleted > protocol.v && + suite.supported <= protocol.v) { + if (algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + suite.name, null)) { + protocols.add(protocol); + found = true; + break; + } else if (debug != null && Debug.isOn("verbose")) { + System.out.println( + "Ignoring disabled cipher suite: " + suite + + " for " + protocol); + } + } else if (debug != null && Debug.isOn("verbose")) { + System.out.println( + "Ignoring unsupported cipher suite: " + suite + + " for " + protocol); + } + } + if (!found && (debug != null) && Debug.isOn("handshake")) { + System.out.println( + "No available cipher suite for " + protocol); + } + } + activeProtocols = new ProtocolList(protocols); + } + + return activeProtocols; + } + + /** + * As long as handshaking has not activated, we can * change whether session creations are allowed. * * Callers should do their own checking if handshaking - * has started. + * has activated. */ void setEnableSessionCreation(boolean newSessions) { enableNewSession = newSessions; @@ -419,12 +667,12 @@ abstract class Handshaker { CipherBox box; if (isClient) { box = cipher.newCipher(protocolVersion, svrWriteKey, svrWriteIV, - false); + sslContext.getSecureRandom(), false); svrWriteKey = null; svrWriteIV = null; } else { box = cipher.newCipher(protocolVersion, clntWriteKey, clntWriteIV, - false); + sslContext.getSecureRandom(), false); clntWriteKey = null; clntWriteIV = null; } @@ -439,12 +687,12 @@ abstract class Handshaker { CipherBox box; if (isClient) { box = cipher.newCipher(protocolVersion, clntWriteKey, clntWriteIV, - true); + sslContext.getSecureRandom(), true); clntWriteKey = null; clntWriteIV = null; } else { box = cipher.newCipher(protocolVersion, svrWriteKey, svrWriteIV, - true); + sslContext.getSecureRandom(), true); svrWriteKey = null; svrWriteIV = null; } @@ -501,6 +749,17 @@ abstract class Handshaker { return session; } + /* + * Set the handshake session + */ + void setHandshakeSessionSE(SSLSessionImpl handshakeSession) { + if (conn != null) { + conn.setHandshakeSession(handshakeSession); + } else { + engine.setHandshakeSession(handshakeSession); + } + } + /* * Returns true if renegotiation is in use for this connection. */ @@ -613,14 +872,21 @@ abstract class Handshaker { } + /** + * Returns true iff the handshaker has been activated. + * + * In activated state, the handshaker may not send any messages out. + */ + boolean activated() { + return state >= -1; + } + /** * Returns true iff the handshaker has sent any messages. - * Server kickstarting is not as neat as it should be; we - * need to create a new handshaker, this method lets us - * know if we should. */ boolean started() { - return state >= 0; + return state >= 0; // 0: HandshakeMessage.ht_hello_request + // 1: HandshakeMessage.ht_client_hello } @@ -633,6 +899,7 @@ abstract class Handshaker { if (state >= 0) { return; } + HandshakeMessage m = getKickstartMessage(); if (debug != null && Debug.isOn("handshake")) { @@ -746,9 +1013,6 @@ abstract class Handshaker { */ private SecretKey calculateMasterSecret(SecretKey preMasterSecret, ProtocolVersion requestedVersion) { - TlsMasterSecretParameterSpec spec = new TlsMasterSecretParameterSpec - (preMasterSecret, protocolVersion.major, protocolVersion.minor, - clnt_random.random_bytes, svr_random.random_bytes); if (debug != null && Debug.isOn("keygen")) { HexDumpEncoder dump = new HexDumpEncoder(); @@ -762,33 +1026,70 @@ abstract class Handshaker { // benefit to doing it twice } + // What algs/params do we need to use? + String masterAlg; + PRF prf; + + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + masterAlg = "SunTls12MasterSecret"; + prf = cipherSuite.prfAlg; + } else { + masterAlg = "SunTlsMasterSecret"; + prf = P_NONE; + } + + String prfHashAlg = prf.getPRFHashAlg(); + int prfHashLength = prf.getPRFHashLength(); + int prfBlockSize = prf.getPRFBlockSize(); + + TlsMasterSecretParameterSpec spec = new TlsMasterSecretParameterSpec( + preMasterSecret, protocolVersion.major, protocolVersion.minor, + clnt_random.random_bytes, svr_random.random_bytes, + prfHashAlg, prfHashLength, prfBlockSize); + SecretKey masterSecret; try { - KeyGenerator kg = JsseJce.getKeyGenerator("SunTlsMasterSecret"); + KeyGenerator kg = JsseJce.getKeyGenerator(masterAlg); kg.init(spec); masterSecret = kg.generateKey(); } catch (GeneralSecurityException e) { // For RSA premaster secrets, do not signal a protocol error // due to the Bleichenbacher attack. See comments further down. - if (!preMasterSecret.getAlgorithm().equals("TlsRsaPremasterSecret")) { + if (!preMasterSecret.getAlgorithm().equals( + "TlsRsaPremasterSecret")) { throw new ProviderException(e); } + if (debug != null && Debug.isOn("handshake")) { System.out.println("RSA master secret generation error:"); e.printStackTrace(System.out); System.out.println("Generating new random premaster secret"); } - preMasterSecret = RSAClientKeyExchange.generateDummySecret(protocolVersion); + + if (requestedVersion != null) { + preMasterSecret = + RSAClientKeyExchange.generateDummySecret(requestedVersion); + } else { + preMasterSecret = + RSAClientKeyExchange.generateDummySecret(protocolVersion); + } + // recursive call with new premaster secret return calculateMasterSecret(preMasterSecret, null); } - // if no version check requested (client side handshake), - // or version information is not available (not an RSA premaster secret), + // if no version check requested (client side handshake), or version + // information is not available (not an RSA premaster secret), // return master secret immediately. - if ((requestedVersion == null) || !(masterSecret instanceof TlsMasterSecret)) { + if ((requestedVersion == null) || + !(masterSecret instanceof TlsMasterSecret)) { return masterSecret; } + + // we have checked the ClientKeyExchange message when reading TLS + // record, the following check is necessary to ensure that + // JCE provider does not ignore the checking, or the previous + // checking process bypassed the premaster secret version checking. TlsMasterSecret tlsKey = (TlsMasterSecret)masterSecret; int major = tlsKey.getMajorVersion(); int minor = tlsKey.getMinorVersion(); @@ -800,13 +1101,21 @@ abstract class Handshaker { // the specification says that it must be the maximum version supported // by the client from its ClientHello message. However, many // implementations send the negotiated version, so accept both - // NOTE that we may be comparing two unsupported version numbers in - // the second case, which is why we cannot use object reference - // equality in this special case - ProtocolVersion premasterVersion = ProtocolVersion.valueOf(major, minor); - boolean versionMismatch = (premasterVersion != protocolVersion) && - (premasterVersion.v != requestedVersion.v); + // for SSL v3.0 and TLS v1.0. + // NOTE that we may be comparing two unsupported version numbers, which + // is why we cannot use object reference equality in this special case. + ProtocolVersion premasterVersion = + ProtocolVersion.valueOf(major, minor); + boolean versionMismatch = (premasterVersion.v != requestedVersion.v); + /* + * we never checked the client_version in server side + * for TLS v1.0 and SSL v3.0. For compatibility, we + * maintain this behavior. + */ + if (versionMismatch && requestedVersion.v <= ProtocolVersion.TLS10.v) { + versionMismatch = (premasterVersion.v != protocolVersion.v); + } if (versionMismatch == false) { // check passed, return key @@ -823,7 +1132,9 @@ abstract class Handshaker { + premasterVersion); System.out.println("Generating new random premaster secret"); } - preMasterSecret = RSAClientKeyExchange.generateDummySecret(protocolVersion); + preMasterSecret = + RSAClientKeyExchange.generateDummySecret(requestedVersion); + // recursive call with new premaster secret return calculateMasterSecret(preMasterSecret, null); } @@ -849,24 +1160,41 @@ abstract class Handshaker { int hashSize = cipherSuite.macAlg.size; boolean is_exportable = cipherSuite.exportable; BulkCipher cipher = cipherSuite.cipher; - int keySize = cipher.keySize; - int ivSize = cipher.ivSize; int expandedKeySize = is_exportable ? cipher.expandedKeySize : 0; - TlsKeyMaterialParameterSpec spec = new TlsKeyMaterialParameterSpec - (masterKey, protocolVersion.major, protocolVersion.minor, + // Which algs/params do we need to use? + String keyMaterialAlg; + PRF prf; + + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + keyMaterialAlg = "SunTls12KeyMaterial"; + prf = cipherSuite.prfAlg; + } else { + keyMaterialAlg = "SunTlsKeyMaterial"; + prf = P_NONE; + } + + String prfHashAlg = prf.getPRFHashAlg(); + int prfHashLength = prf.getPRFHashLength(); + int prfBlockSize = prf.getPRFBlockSize(); + + TlsKeyMaterialParameterSpec spec = new TlsKeyMaterialParameterSpec( + masterKey, protocolVersion.major, protocolVersion.minor, clnt_random.random_bytes, svr_random.random_bytes, cipher.algorithm, cipher.keySize, expandedKeySize, - cipher.ivSize, hashSize); + cipher.ivSize, hashSize, + prfHashAlg, prfHashLength, prfBlockSize); try { - KeyGenerator kg = JsseJce.getKeyGenerator("SunTlsKeyMaterial"); + KeyGenerator kg = JsseJce.getKeyGenerator(keyMaterialAlg); kg.init(spec); TlsKeyMaterialSpec keySpec = (TlsKeyMaterialSpec)kg.generateKey(); clntWriteKey = keySpec.getClientCipherKey(); svrWriteKey = keySpec.getServerCipherKey(); + // Return null if IVs are not supposed to be generated. + // e.g. TLS 1.1+. clntWriteIV = keySpec.getClientIv(); svrWriteIV = keySpec.getServerIv(); @@ -914,7 +1242,12 @@ abstract class Handshaker { System.out.println("Server write IV:"); printHex(dump, svrWriteIV.getIV()); } else { - System.out.println("... no IV used for this cipher"); + if (protocolVersion.v >= ProtocolVersion.TLS11.v) { + System.out.println( + "... no IV derived for this protocol"); + } else { + System.out.println("... no IV used for this cipher"); + } } System.out.flush(); } diff --git a/jdk/src/share/classes/sun/security/ssl/HelloExtensions.java b/jdk/src/share/classes/sun/security/ssl/HelloExtensions.java index 8b2764494ea..cbd320188c2 100644 --- a/jdk/src/share/classes/sun/security/ssl/HelloExtensions.java +++ b/jdk/src/share/classes/sun/security/ssl/HelloExtensions.java @@ -50,7 +50,8 @@ import javax.net.ssl.SSLProtocolException; * * . UnknownExtension: used to represent all parsed extensions that we do not * explicitly support. - * . ServerNameExtension: partially implemented server_name extension. + * . ServerNameExtension: the server_name extension. + * . SignatureAlgorithmsExtension: the signature_algorithms extension. * . SupportedEllipticCurvesExtension: the ECC supported curves extension. * . SupportedEllipticPointFormatsExtension: the ECC supported point formats * (compressed/uncompressed) extension. @@ -78,6 +79,8 @@ final class HelloExtensions { HelloExtension extension; if (extType == ExtensionType.EXT_SERVER_NAME) { extension = new ServerNameExtension(s, extlen); + } else if (extType == ExtensionType.EXT_SIGNATURE_ALGORITHMS) { + extension = new SignatureAlgorithmsExtension(s, extlen); } else if (extType == ExtensionType.EXT_ELLIPTIC_CURVES) { extension = new SupportedEllipticCurvesExtension(s, extlen); } else if (extType == ExtensionType.EXT_EC_POINT_FORMATS) { @@ -166,8 +169,7 @@ final class ExtensionType { return name; } - static List knownExtensions = - new ArrayList(9); + static List knownExtensions = new ArrayList<>(9); static ExtensionType get(int id) { for (ExtensionType ext : knownExtensions) { @@ -266,31 +268,102 @@ final class UnknownExtension extends HelloExtension { } public String toString() { - return "Unsupported extension " + type + ", data: " + Debug.toString(data); + return "Unsupported extension " + type + ", data: " + + Debug.toString(data); } } /* - * Support for the server_name extension is incomplete. Parsing is implemented - * so that we get nicer debug output, but we neither send it nor do we do - * act on it if we receive it. + * [RFC4366] To facilitate secure connections to servers that host multiple + * 'virtual' servers at a single underlying network address, clients MAY + * include an extension of type "server_name" in the (extended) client hello. + * The "extension_data" field of this extension SHALL contain "ServerNameList" + * where: + * + * struct { + * NameType name_type; + * select (name_type) { + * case host_name: HostName; + * } name; + * } ServerName; + * + * enum { + * host_name(0), (255) + * } NameType; + * + * opaque HostName<1..2^16-1>; + * + * struct { + * ServerName server_name_list<1..2^16-1> + * } ServerNameList; */ final class ServerNameExtension extends HelloExtension { final static int NAME_HOST_NAME = 0; private List names; + private int listLength; // ServerNameList length + + ServerNameExtension(List hostnames) throws IOException { + super(ExtensionType.EXT_SERVER_NAME); + + listLength = 0; + names = new ArrayList(hostnames.size()); + for (String hostname : hostnames) { + if (hostname != null && hostname.length() != 0) { + // we only support DNS hostname now. + ServerName serverName = + new ServerName(NAME_HOST_NAME, hostname); + names.add(serverName); + listLength += serverName.length; + } + } + + // As we only support DNS hostname now, the hostname list must + // not contain more than one hostname + if (names.size() > 1) { + throw new SSLProtocolException( + "The ServerNameList MUST NOT contain more than " + + "one name of the same name_type"); + } + + // We only need to add "server_name" extension in ClientHello unless + // we support SNI in server side in the future. It is possible that + // the SNI is empty in ServerHello. As we don't support SNI in + // ServerHello now, we will throw exception for empty list for now. + if (listLength == 0) { + throw new SSLProtocolException( + "The ServerNameList cannot be empty"); + } + } ServerNameExtension(HandshakeInStream s, int len) throws IOException { super(ExtensionType.EXT_SERVER_NAME); - names = new ArrayList(); - while (len > 0) { - ServerName name = new ServerName(s); - names.add(name); - len -= name.length + 2; + + int remains = len; + if (len >= 2) { // "server_name" extension in ClientHello + listLength = s.getInt16(); // ServerNameList length + if (listLength == 0 || listLength + 2 != len) { + throw new SSLProtocolException( + "Invalid " + type + " extension"); + } + + remains -= 2; + names = new ArrayList(); + while (remains > 0) { + ServerName name = new ServerName(s); + names.add(name); + remains -= name.length; + + // we may need to check the duplicated ServerName type + } + } else if (len == 0) { // "server_name" extension in ServerHello + listLength = 0; + names = Collections.emptyList(); } - if (len != 0) { + + if (remains != 0) { throw new SSLProtocolException("Invalid server_name extension"); } } @@ -301,10 +374,19 @@ final class ServerNameExtension extends HelloExtension { final byte[] data; final String hostname; + ServerName(int type, String hostname) throws IOException { + this.type = type; // NameType + this.hostname = hostname; + this.data = hostname.getBytes("UTF8"); // HostName + this.length = data.length + 3; // NameType: 1 byte + // HostName length: 2 bytes + } + ServerName(HandshakeInStream s) throws IOException { - length = s.getInt16(); // ServerNameList length type = s.getInt8(); // NameType data = s.getBytes16(); // HostName (length read in getBytes16) + length = data.length + 3; // NameType: 1 byte + // HostName length: 2 bytes if (type == NAME_HOST_NAME) { hostname = new String(data, "UTF8"); } else { @@ -322,15 +404,29 @@ final class ServerNameExtension extends HelloExtension { } int length() { - throw new RuntimeException("not yet supported"); + return listLength == 0 ? 4 : 6 + listLength; } void send(HandshakeOutStream s) throws IOException { - throw new RuntimeException("not yet supported"); + s.putInt16(type.id); + s.putInt16(listLength + 2); + if (listLength != 0) { + s.putInt16(listLength); + + for (ServerName name : names) { + s.putInt8(name.type); // NameType + s.putBytes16(name.data); // HostName + } + } } public String toString() { - return "Unsupported extension " + type + ", " + names.toString(); + StringBuffer buffer = new StringBuffer(); + for (ServerName name : names) { + buffer.append("[" + name + "]"); + } + + return "Extension " + type + ", server_name: " + buffer; } } @@ -523,7 +619,8 @@ final class SupportedEllipticPointFormatsExtension extends HelloExtension { final static int FMT_ANSIX962_COMPRESSED_CHAR2 = 2; static final HelloExtension DEFAULT = - new SupportedEllipticPointFormatsExtension(new byte[] {FMT_UNCOMPRESSED}); + new SupportedEllipticPointFormatsExtension( + new byte[] {FMT_UNCOMPRESSED}); private final byte[] formats; @@ -576,7 +673,7 @@ final class SupportedEllipticPointFormatsExtension extends HelloExtension { } public String toString() { - List list = new ArrayList(); + List list = new ArrayList<>(); for (byte format : formats) { list.add(toString(format)); } @@ -665,3 +762,105 @@ final class RenegotiationInfoExtension extends HelloExtension { } } + +/* + * [RFC5246] The client uses the "signature_algorithms" extension to + * indicate to the server which signature/hash algorithm pairs may be + * used in digital signatures. The "extension_data" field of this + * extension contains a "supported_signature_algorithms" value. + * + * enum { + * none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5), + * sha512(6), (255) + * } HashAlgorithm; + * + * enum { anonymous(0), rsa(1), dsa(2), ecdsa(3), (255) } + * SignatureAlgorithm; + * + * struct { + * HashAlgorithm hash; + * SignatureAlgorithm signature; + * } SignatureAndHashAlgorithm; + * + * SignatureAndHashAlgorithm + * supported_signature_algorithms<2..2^16-2>; + */ +final class SignatureAlgorithmsExtension extends HelloExtension { + + private Collection algorithms; + private int algorithmsLen; // length of supported_signature_algorithms + + SignatureAlgorithmsExtension( + Collection signAlgs) { + + super(ExtensionType.EXT_SIGNATURE_ALGORITHMS); + + algorithms = new ArrayList(signAlgs); + algorithmsLen = + SignatureAndHashAlgorithm.sizeInRecord() * algorithms.size(); + } + + SignatureAlgorithmsExtension(HandshakeInStream s, int len) + throws IOException { + super(ExtensionType.EXT_SIGNATURE_ALGORITHMS); + + algorithmsLen = s.getInt16(); + if (algorithmsLen == 0 || algorithmsLen + 2 != len) { + throw new SSLProtocolException("Invalid " + type + " extension"); + } + + algorithms = new ArrayList(); + int remains = algorithmsLen; + int sequence = 0; + while (remains > 1) { // needs at least two bytes + int hash = s.getInt8(); // hash algorithm + int signature = s.getInt8(); // signature algorithm + + SignatureAndHashAlgorithm algorithm = + SignatureAndHashAlgorithm.valueOf(hash, signature, ++sequence); + algorithms.add(algorithm); + remains -= 2; // one byte for hash, one byte for signature + } + + if (remains != 0) { + throw new SSLProtocolException("Invalid server_name extension"); + } + } + + Collection getSignAlgorithms() { + return algorithms; + } + + @Override + int length() { + return 6 + algorithmsLen; + } + + @Override + void send(HandshakeOutStream s) throws IOException { + s.putInt16(type.id); + s.putInt16(algorithmsLen + 2); + s.putInt16(algorithmsLen); + + for (SignatureAndHashAlgorithm algorithm : algorithms) { + s.putInt8(algorithm.getHashValue()); // HashAlgorithm + s.putInt8(algorithm.getSignatureValue()); // SignatureAlgorithm + } + } + + @Override + public String toString() { + StringBuffer buffer = new StringBuffer(); + boolean opened = false; + for (SignatureAndHashAlgorithm signAlg : algorithms) { + if (opened) { + buffer.append(", " + signAlg.getAlgorithmName()); + } else { + buffer.append(signAlg.getAlgorithmName()); + opened = true; + } + } + + return "Extension " + type + ", signature_algorithms: " + buffer; + } +} diff --git a/jdk/src/share/classes/sun/security/ssl/KerberosClientKeyExchange.java b/jdk/src/share/classes/sun/security/ssl/KerberosClientKeyExchange.java index 13500e8b3a6..339f94b8701 100644 --- a/jdk/src/share/classes/sun/security/ssl/KerberosClientKeyExchange.java +++ b/jdk/src/share/classes/sun/security/ssl/KerberosClientKeyExchange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,6 +69,7 @@ public class KerberosClientKeyExchange extends HandshakeMessage { } public KerberosClientKeyExchange() { + // empty } public KerberosClientKeyExchange(String serverName, boolean isLoopback, @@ -93,14 +94,17 @@ public class KerberosClientKeyExchange extends HandshakeMessage { } } + @Override int messageType() { return ht_client_key_exchange; } + @Override public int messageLength() { return impl.messageLength(); } + @Override public void send(HandshakeOutStream s) throws IOException { impl.send(s); } diff --git a/jdk/src/share/classes/sun/security/ssl/Krb5Helper.java b/jdk/src/share/classes/sun/security/ssl/Krb5Helper.java index 440b119861e..d1bbe83d26e 100644 --- a/jdk/src/share/classes/sun/security/ssl/Krb5Helper.java +++ b/jdk/src/share/classes/sun/security/ssl/Krb5Helper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -10,7 +10,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * diff --git a/jdk/src/share/classes/sun/security/ssl/Krb5Proxy.java b/jdk/src/share/classes/sun/security/ssl/Krb5Proxy.java index 2e591585942..14a1501904f 100644 --- a/jdk/src/share/classes/sun/security/ssl/Krb5Proxy.java +++ b/jdk/src/share/classes/sun/security/ssl/Krb5Proxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -10,7 +10,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * diff --git a/jdk/src/share/classes/sun/security/ssl/MAC.java b/jdk/src/share/classes/sun/security/ssl/MAC.java index 64b2b1d22e0..8002148a994 100644 --- a/jdk/src/share/classes/sun/security/ssl/MAC.java +++ b/jdk/src/share/classes/sun/security/ssl/MAC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -105,6 +105,10 @@ final class MAC { algorithm = tls ? "HmacMD5" : "SslMacMD5"; } else if (macAlg == M_SHA) { algorithm = tls ? "HmacSHA1" : "SslMacSHA1"; + } else if (macAlg == M_SHA256) { + algorithm = "HmacSHA256"; // TLS 1.2+ + } else if (macAlg == M_SHA384) { + algorithm = "HmacSHA384"; // TLS 1.2+ } else { throw new RuntimeException("Unknown Mac " + macAlg); } @@ -155,6 +159,42 @@ final class MAC { return compute(type, bb, null, 0, bb.remaining()); } + /** + * Check whether the sequence number is close to wrap + * + * Sequence numbers are of type uint64 and may not exceed 2^64-1. + * Sequence numbers do not wrap. When the sequence number is near + * to wrap, we need to close the connection immediately. + */ + final boolean seqNumOverflow() { + /* + * Conservatively, we don't allow more records to be generated + * when there are only 2^8 sequence numbers left. + */ + return (block != null && mac != null && + block[0] == 0xFF && block[1] == 0xFF && + block[2] == 0xFF && block[3] == 0xFF && + block[4] == 0xFF && block[5] == 0xFF && + block[6] == 0xFF); + } + + /* + * Check whether to renew the sequence number + * + * Sequence numbers are of type uint64 and may not exceed 2^64-1. + * Sequence numbers do not wrap. If a TLS + * implementation would need to wrap a sequence number, it must + * renegotiate instead. + */ + final boolean seqNumIsHuge() { + /* + * Conservatively, we should ask for renegotiation when there are + * only 2^48 sequence numbers left. + */ + return (block != null && mac != null && + block[0] == 0xFF && block[1] == 0xFF); + } + // increment the sequence number in the block array // it is a 64-bit number stored in big-endian format private void incrementSequenceNumber() { @@ -168,7 +208,8 @@ final class MAC { * Compute based on either buffer type, either bb.position/limit * or buf/offset/len. */ - private byte[] compute(byte type, ByteBuffer bb, byte[] buf, int offset, int len) { + private byte[] compute(byte type, ByteBuffer bb, byte[] buf, + int offset, int len) { if (macSize == 0) { return nullMAC; diff --git a/jdk/src/share/classes/sun/security/ssl/ProtocolList.java b/jdk/src/share/classes/sun/security/ssl/ProtocolList.java index 221a6deea47..6f41e4efa3d 100644 --- a/jdk/src/share/classes/sun/security/ssl/ProtocolList.java +++ b/jdk/src/share/classes/sun/security/ssl/ProtocolList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +38,12 @@ import java.util.*; final class ProtocolList { private static final ProtocolList SUPPORTED; + private static final ProtocolList CLIENT_DEFAULT; + private static final ProtocolList SERVER_DEFAULT; + + // the sorted protocol version list + private final ArrayList protocols; - private final Collection protocols; private String[] protocolNames; // the minimum and maximum ProtocolVersions in this list @@ -49,30 +53,45 @@ final class ProtocolList { final ProtocolVersion helloVersion; ProtocolList(String[] names) { + this(convert(names)); + } + + ProtocolList(ArrayList versions) { + this.protocols = versions; + + if ((protocols.size() == 1) && + protocols.contains(ProtocolVersion.SSL20Hello)) { + throw new IllegalArgumentException("SSLv2Hello cannot be " + + "enabled unless at least one other supported version " + + "is also enabled."); + } + + if (protocols.size() != 0) { + Collections.sort(protocols); + min = protocols.get(0); + max = protocols.get(protocols.size() - 1); + helloVersion = protocols.get(0); + } else { + min = ProtocolVersion.NONE; + max = ProtocolVersion.NONE; + helloVersion = ProtocolVersion.NONE; + } + } + + private static ArrayList convert(String[] names) { if (names == null) { throw new IllegalArgumentException("Protocols may not be null"); } - protocols = new ArrayList(3); + + ArrayList versions = new ArrayList<>(3); for (int i = 0; i < names.length; i++ ) { ProtocolVersion version = ProtocolVersion.valueOf(names[i]); - if (protocols.contains(version) == false) { - protocols.add(version); + if (versions.contains(version) == false) { + versions.add(version); } } - if ((protocols.size() == 1) - && protocols.contains(ProtocolVersion.SSL20Hello)) { - throw new IllegalArgumentException("SSLv2Hello" + - "cannot be enabled unless TLSv1 or SSLv3 is also enabled"); - } - min = contains(ProtocolVersion.SSL30) ? ProtocolVersion.SSL30 - : ProtocolVersion.TLS10; - max = contains(ProtocolVersion.TLS10) ? ProtocolVersion.TLS10 - : ProtocolVersion.SSL30; - if (protocols.contains(ProtocolVersion.SSL20Hello)) { - helloVersion = ProtocolVersion.SSL20Hello; - } else { - helloVersion = min; - } + + return versions; } /** @@ -87,6 +106,37 @@ final class ProtocolList { return protocols.contains(protocolVersion); } + /** + * Return a reference to the internal Collection of CipherSuites. + * The Collection MUST NOT be modified. + */ + Collection collection() { + return protocols; + } + + /** + * Select a protocol version from the list. + * + * Return the lower of the protocol version of that suggested by + * the protocolVersion and the highest version of this + * protocol list, or null if no protocol version is available. + * + * The method is used by TLS server to negotiated the protocol + * version between client suggested protocol version in the + * client hello and protocol versions supported by the server. + */ + ProtocolVersion selectProtocolVersion(ProtocolVersion protocolVersion) { + ProtocolVersion selectedVersion = null; + for (ProtocolVersion pv : protocols) { + if (pv.v > protocolVersion.v) { + break; // Safe to break here as this.protocols is sorted + } + selectedVersion = pv; + } + + return selectedVersion; + } + /** * Return an array with the names of the ProtocolVersions in this list. */ @@ -106,11 +156,18 @@ final class ProtocolList { } /** - * Return the list of default enabled protocols. Currently, this - * is identical to the supported protocols. + * Return the list of default enabled protocols. */ - static ProtocolList getDefault() { - return SUPPORTED; + static ProtocolList getDefault(boolean isServer) { + return isServer ? SERVER_DEFAULT : CLIENT_DEFAULT; + } + + /** + * Return whether a protocol list is the original default enabled + * protocols. See: SSLSocket/SSLEngine.setEnabledProtocols() + */ + static boolean isDefaultProtocolList(ProtocolList protocols) { + return protocols == CLIENT_DEFAULT || protocols == SERVER_DEFAULT; } /** @@ -123,6 +180,13 @@ final class ProtocolList { static { if (SunJSSE.isFIPS()) { SUPPORTED = new ProtocolList(new String[] { + ProtocolVersion.TLS10.name, + ProtocolVersion.TLS11.name, + ProtocolVersion.TLS12.name + }); + + SERVER_DEFAULT = SUPPORTED; + CLIENT_DEFAULT = new ProtocolList(new String[] { ProtocolVersion.TLS10.name }); } else { @@ -130,6 +194,24 @@ final class ProtocolList { ProtocolVersion.SSL20Hello.name, ProtocolVersion.SSL30.name, ProtocolVersion.TLS10.name, + ProtocolVersion.TLS11.name, + ProtocolVersion.TLS12.name + }); + + SERVER_DEFAULT = SUPPORTED; + + /* + * RFC 5246 says that sending SSLv2 backward-compatible + * hello SHOULD NOT be done any longer. + * + * We are not enabling TLS 1.1/1.2 by default yet on clients + * out of concern for interop with existing + * SSLv3/TLS1.0-only servers. When these versions of TLS + * gain more traction, we'll enable them. + */ + CLIENT_DEFAULT = new ProtocolList(new String[] { + ProtocolVersion.SSL30.name, + ProtocolVersion.TLS10.name }); } } diff --git a/jdk/src/share/classes/sun/security/ssl/ProtocolVersion.java b/jdk/src/share/classes/sun/security/ssl/ProtocolVersion.java index 8cda729a97a..77c102a6290 100644 --- a/jdk/src/share/classes/sun/security/ssl/ProtocolVersion.java +++ b/jdk/src/share/classes/sun/security/ssl/ProtocolVersion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +45,15 @@ package sun.security.ssl; * @author Andreas Sterbenz * @since 1.4.1 */ -public final class ProtocolVersion { +public final class ProtocolVersion implements Comparable { - // dummy protocol version value for invalid SSLSession + // The limit of maximum protocol version + final static int LIMIT_MAX_VALUE = 0xFFFF; + + // The limit of minimum protocol version + final static int LIMIT_MIN_VALUE = 0x0000; + + // Dummy protocol version value for invalid SSLSession final static ProtocolVersion NONE = new ProtocolVersion(-1, "NONE"); // If enabled, send/ accept SSLv2 hello messages @@ -61,22 +67,24 @@ public final class ProtocolVersion { final static ProtocolVersion TLS10 = new ProtocolVersion(0x0301, "TLSv1"); // TLS 1.1 - // not supported yet, but added for better readability of the debug trace final static ProtocolVersion TLS11 = new ProtocolVersion(0x0302, "TLSv1.1"); + // TLS 1.2 + final static ProtocolVersion TLS12 = new ProtocolVersion(0x0303, "TLSv1.2"); + private static final boolean FIPS = SunJSSE.isFIPS(); // minimum version we implement (SSL 3.0) final static ProtocolVersion MIN = FIPS ? TLS10 : SSL30; - // maximum version we implement (TLS 1.0) - final static ProtocolVersion MAX = TLS10; + // maximum version we implement (TLS 1.2) + final static ProtocolVersion MAX = TLS12; // ProtocolVersion to use by default (TLS 1.0) final static ProtocolVersion DEFAULT = TLS10; // Default version for hello messages (SSLv2Hello) - final static ProtocolVersion DEFAULT_HELLO = FIPS ? TLS10 : SSL20Hello; + final static ProtocolVersion DEFAULT_HELLO = FIPS ? TLS10 : SSL30; // version in 16 bit MSB format as it appears in records and // messages, i.e. 0x0301 for TLS 1.0 @@ -104,6 +112,8 @@ public final class ProtocolVersion { return TLS10; } else if (v == TLS11.v) { return TLS11; + } else if (v == TLS12.v) { + return TLS12; } else if (v == SSL20Hello.v) { return SSL20Hello; } else { @@ -134,18 +144,20 @@ public final class ProtocolVersion { if (name == null) { throw new IllegalArgumentException("Protocol cannot be null"); } - if (FIPS) { - if (name.equals(TLS10.name)) { - return TLS10; - } else { - throw new IllegalArgumentException - ("Only TLS 1.0 allowed in FIPS mode"); - } + + if (FIPS && (name.equals(SSL30.name) || name.equals(SSL20Hello.name))) { + throw new IllegalArgumentException + ("Only TLS 1.0 or later allowed in FIPS mode"); } + if (name.equals(SSL30.name)) { return SSL30; } else if (name.equals(TLS10.name)) { return TLS10; + } else if (name.equals(TLS11.name)) { + return TLS11; + } else if (name.equals(TLS12.name)) { + return TLS12; } else if (name.equals(SSL20Hello.name)) { return SSL20Hello; } else { @@ -157,4 +169,10 @@ public final class ProtocolVersion { return name; } + /** + * Compares this object with the specified object for order. + */ + public int compareTo(ProtocolVersion protocolVersion) { + return this.v - protocolVersion.v; + } } diff --git a/jdk/src/share/classes/sun/security/ssl/RSAClientKeyExchange.java b/jdk/src/share/classes/sun/security/ssl/RSAClientKeyExchange.java index 9fd820b28f3..1c0d6921091 100644 --- a/jdk/src/share/classes/sun/security/ssl/RSAClientKeyExchange.java +++ b/jdk/src/share/classes/sun/security/ssl/RSAClientKeyExchange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,20 +55,17 @@ final class RSAClientKeyExchange extends HandshakeMessage { * requested in its client hello version). However, we (and other * implementations) used to send the active negotiated version. The * system property below allows to toggle the behavior. - * - * Default is "false" (old behavior) for compatibility reasons. This - * will be changed in the future. */ private final static String PROP_NAME = "com.sun.net.ssl.rsaPreMasterSecretFix"; + /* + * Default is "false" (old behavior) for compatibility reasons in + * SSLv3/TLSv1. Later protocols (TLSv1.1+) do not use this property. + */ private final static boolean rsaPreMasterSecretFix = Debug.getBooleanProperty(PROP_NAME, false); - int messageType() { - return ht_client_key_exchange; - } - /* * The following field values were encrypted with the server's public * key (or temp key from server key exchange msg) and are presented @@ -78,14 +75,14 @@ final class RSAClientKeyExchange extends HandshakeMessage { SecretKey preMaster; private byte[] encrypted; // same size as public modulus - /* * Client randomly creates a pre-master secret and encrypts it * using the server's RSA public key; only the server can decrypt * it, using its RSA private key. Result is the same size as the * server's public key, and uses PKCS #1 block format 02. */ - RSAClientKeyExchange(ProtocolVersion protocolVersion, ProtocolVersion maxVersion, + RSAClientKeyExchange(ProtocolVersion protocolVersion, + ProtocolVersion maxVersion, SecureRandom generator, PublicKey publicKey) throws IOException { if (publicKey.getAlgorithm().equals("RSA") == false) { throw new SSLKeyException("Public key not of type RSA"); @@ -94,7 +91,7 @@ final class RSAClientKeyExchange extends HandshakeMessage { int major, minor; - if (rsaPreMasterSecretFix) { + if (rsaPreMasterSecretFix || maxVersion.v >= ProtocolVersion.TLS11.v) { major = maxVersion.major; minor = maxVersion.minor; } else { @@ -103,8 +100,11 @@ final class RSAClientKeyExchange extends HandshakeMessage { } try { - KeyGenerator kg = JsseJce.getKeyGenerator("SunTlsRsaPremasterSecret"); - kg.init(new TlsRsaPremasterSecretParameterSpec(major, minor)); + String s = ((protocolVersion.v >= ProtocolVersion.TLS12.v) ? + "SunTls12RsaPremasterSecret" : "SunTlsRsaPremasterSecret"); + KeyGenerator kg = JsseJce.getKeyGenerator(s); + kg.init(new TlsRsaPremasterSecretParameterSpec(major, minor), + generator); preMaster = kg.generateKey(); Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); @@ -120,14 +120,15 @@ final class RSAClientKeyExchange extends HandshakeMessage { * Server gets the PKCS #1 (block format 02) data, decrypts * it with its private key. */ - RSAClientKeyExchange(ProtocolVersion currentVersion, HandshakeInStream input, + RSAClientKeyExchange(ProtocolVersion currentVersion, + ProtocolVersion maxVersion, + SecureRandom generator, HandshakeInStream input, int messageSize, PrivateKey privateKey) throws IOException { if (privateKey.getAlgorithm().equals("RSA") == false) { throw new SSLKeyException("Private key not of type RSA"); } - this.protocolVersion = currentVersion; if (currentVersion.v >= ProtocolVersion.TLS10.v) { encrypted = input.getBytes16(); } else { @@ -143,31 +144,109 @@ final class RSAClientKeyExchange extends HandshakeMessage { cipher.init(Cipher.UNWRAP_MODE, privateKey); preMaster = (SecretKey)cipher.unwrap(encrypted, "TlsRsaPremasterSecret", Cipher.SECRET_KEY); + + // polish the premaster secret + preMaster = polishPreMasterSecretKey(currentVersion, maxVersion, + generator, preMaster, null); } catch (Exception e) { - /* - * Bogus decrypted ClientKeyExchange? If so, conjure a - * a random preMaster secret that will fail later during - * Finished message processing. This is a countermeasure against - * the "interactive RSA PKCS#1 encryption envelop attack" reported - * in June 1998. Preserving the executation path will - * mitigate timing attacks and force consistent error handling - * that will prevent an attacking client from differentiating - * different kinds of decrypted ClientKeyExchange bogosities. - */ - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Error decrypting premaster secret:"); - e.printStackTrace(System.out); - System.out.println("Generating random secret"); - } - preMaster = generateDummySecret(currentVersion); + // polish the premaster secret + preMaster = + polishPreMasterSecretKey(currentVersion, maxVersion, + generator, null, e); } } + /** + * To avoid vulnerabilities described by section 7.4.7.1, RFC 5246, + * treating incorrectly formatted message blocks and/or mismatched + * version numbers in a manner indistinguishable from correctly + * formatted RSA blocks. + * + * RFC 5246 describes the approach as : + * + * 1. Generate a string R of 46 random bytes + * + * 2. Decrypt the message to recover the plaintext M + * + * 3. If the PKCS#1 padding is not correct, or the length of message + * M is not exactly 48 bytes: + * pre_master_secret = ClientHello.client_version || R + * else If ClientHello.client_version <= TLS 1.0, and version + * number check is explicitly disabled: + * pre_master_secret = M + * else: + * pre_master_secret = ClientHello.client_version || M[2..47] + */ + private SecretKey polishPreMasterSecretKey(ProtocolVersion currentVersion, + ProtocolVersion clientHelloVersion, SecureRandom generator, + SecretKey secretKey, Exception failoverException) { + + this.protocolVersion = clientHelloVersion; + + if (failoverException == null && secretKey != null) { + // check the length + byte[] encoded = secretKey.getEncoded(); + if (encoded == null) { // unable to get the encoded key + if (debug != null && Debug.isOn("handshake")) { + System.out.println( + "unable to get the plaintext of the premaster secret"); + } + + // We are not always able to get the encoded key of the + // premaster secret. Pass the cheking to master secret + // calculation. + return secretKey; + } else if (encoded.length == 48) { + // check the version + if (clientHelloVersion.major == encoded[0] && + clientHelloVersion.minor == encoded[1]) { + return secretKey; + } else if (clientHelloVersion.v <= ProtocolVersion.TLS10.v) { + /* + * we never checked the client_version in server side + * for TLS v1.0 and SSL v3.0. For compatibility, we + * maintain this behavior. + */ + if (currentVersion.major == encoded[0] && + currentVersion.minor == encoded[1]) { + this.protocolVersion = currentVersion; + return secretKey; + } + } + + if (debug != null && Debug.isOn("handshake")) { + System.out.println("Mismatching Protocol Versions, " + + "ClientHello.client_version is " + clientHelloVersion + + ", while PreMasterSecret.client_version is " + + ProtocolVersion.valueOf(encoded[0], encoded[1])); + } + } else { + if (debug != null && Debug.isOn("handshake")) { + System.out.println( + "incorrect length of premaster secret: " + + encoded.length); + } + } + } + + if (debug != null && Debug.isOn("handshake")) { + if (failoverException != null) { + System.out.println("Error decrypting premaster secret:"); + failoverException.printStackTrace(System.out); + } + + System.out.println("Generating random secret"); + } + + return generateDummySecret(clientHelloVersion); + } + // generate a premaster secret with the specified version number static SecretKey generateDummySecret(ProtocolVersion version) { try { - KeyGenerator kg = - JsseJce.getKeyGenerator("SunTlsRsaPremasterSecret"); + String s = ((version.v >= ProtocolVersion.TLS12.v) ? + "SunTls12RsaPremasterSecret" : "SunTlsRsaPremasterSecret"); + KeyGenerator kg = JsseJce.getKeyGenerator(s); kg.init(new TlsRsaPremasterSecretParameterSpec (version.major, version.minor)); return kg.generateKey(); @@ -176,6 +255,12 @@ final class RSAClientKeyExchange extends HandshakeMessage { } } + @Override + int messageType() { + return ht_client_key_exchange; + } + + @Override int messageLength() { if (protocolVersion.v >= ProtocolVersion.TLS10.v) { return encrypted.length + 2; @@ -184,6 +269,7 @@ final class RSAClientKeyExchange extends HandshakeMessage { } } + @Override void send(HandshakeOutStream s) throws IOException { if (protocolVersion.v >= ProtocolVersion.TLS10.v) { s.putBytes16(encrypted); @@ -192,7 +278,9 @@ final class RSAClientKeyExchange extends HandshakeMessage { } } + @Override void print(PrintStream s) throws IOException { - s.println("*** ClientKeyExchange, RSA PreMasterSecret, " + protocolVersion); + s.println("*** ClientKeyExchange, RSA PreMasterSecret, " + + protocolVersion); } } diff --git a/jdk/src/share/classes/sun/security/ssl/Record.java b/jdk/src/share/classes/sun/security/ssl/Record.java index df6c8a2f0a7..1378e107afc 100644 --- a/jdk/src/share/classes/sun/security/ssl/Record.java +++ b/jdk/src/share/classes/sun/security/ssl/Record.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +47,12 @@ interface Record { static final byte ct_handshake = 22; static final byte ct_application_data = 23; - static final int headerSize = 5; // SSLv3 record header - static final int maxExpansion = 1024; // for bad compression - static final int trailerSize = 20; // SHA1 hash size - static final int maxDataSize = 16384; // 2^14 bytes of data - static final int maxPadding = 256; // block cipher padding + static final int headerSize = 5; // SSLv3 record header + static final int maxExpansion = 1024; // for bad compression + static final int trailerSize = 20; // SHA1 hash size + static final int maxDataSize = 16384; // 2^14 bytes of data + static final int maxPadding = 256; // block cipher padding + static final int maxIVLength = 256; // block length /* * SSL has a maximum record size. It's header, (compressed) data, @@ -59,8 +60,9 @@ interface Record { * Some compression algorithms have rare cases where they expand the data. * As we don't support compression at this time, leave that out. */ - static final int maxRecordSize = + static final int maxRecordSize = headerSize // header + + maxIVLength // iv + maxDataSize // data + maxPadding // padding + trailerSize; // MAC @@ -74,7 +76,7 @@ interface Record { * The maximum large record size is defined as maxRecordSize plus 2^14, * this is the amount OpenSSL is using. */ - static final int maxLargeRecordSize = + static final int maxLargeRecordSize = maxRecordSize // Max size with a conforming implemenation + maxDataSize; // extra 2^14 bytes for large data packets. @@ -84,7 +86,11 @@ interface Record { * They only contain 2 and 1 bytes of data, respectively. * Allocate a smaller array. */ - static final int maxAlertRecordSize = - headerSize + 2 + maxPadding + trailerSize; + static final int maxAlertRecordSize = + headerSize // header + + maxIVLength // iv + + 2 // alert + + maxPadding // padding + + trailerSize; // MAC } diff --git a/jdk/src/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java b/jdk/src/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java new file mode 100644 index 00000000000..8914cf6aa17 --- /dev/null +++ b/jdk/src/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.security.AlgorithmConstraints; +import java.security.CryptoPrimitive; +import java.security.AlgorithmParameters; + +import javax.net.ssl.*; + +import java.security.Key; + +import java.util.Set; +import java.util.HashSet; + +import sun.security.util.DisabledAlgorithmConstraints; +import sun.security.ssl.CipherSuite.*; + +/** + * Algorithm constraints for disabled algorithms property + * + * See the "jdk.certpath.disabledAlgorithms" specification in java.security + * for the syntax of the disabled algorithm string. + */ +final class SSLAlgorithmConstraints implements AlgorithmConstraints { + private final static AlgorithmConstraints tlsDisabledAlgConstraints = + new TLSDisabledAlgConstraints(); + private final static AlgorithmConstraints x509DisabledAlgConstraints = + new X509DisabledAlgConstraints(); + private AlgorithmConstraints userAlgConstraints = null; + private AlgorithmConstraints peerAlgConstraints = null; + + private boolean enabledX509DisabledAlgConstraints = true; + + SSLAlgorithmConstraints(AlgorithmConstraints algorithmConstraints) { + userAlgConstraints = algorithmConstraints; + } + + SSLAlgorithmConstraints(SSLSocket socket, + boolean withDefaultCertPathConstraints) { + if (socket != null) { + userAlgConstraints = + socket.getSSLParameters().getAlgorithmConstraints(); + } + + if (!withDefaultCertPathConstraints) { + enabledX509DisabledAlgConstraints = false; + } + } + + SSLAlgorithmConstraints(SSLEngine engine, + boolean withDefaultCertPathConstraints) { + if (engine != null) { + userAlgConstraints = + engine.getSSLParameters().getAlgorithmConstraints(); + } + + if (!withDefaultCertPathConstraints) { + enabledX509DisabledAlgConstraints = false; + } + } + + SSLAlgorithmConstraints(SSLSocket socket, String[] supportedAlgorithms, + boolean withDefaultCertPathConstraints) { + if (socket != null) { + userAlgConstraints = + socket.getSSLParameters().getAlgorithmConstraints(); + peerAlgConstraints = + new SupportedSignatureAlgorithmConstraints(supportedAlgorithms); + } + + if (!withDefaultCertPathConstraints) { + enabledX509DisabledAlgConstraints = false; + } + } + + SSLAlgorithmConstraints(SSLEngine engine, String[] supportedAlgorithms, + boolean withDefaultCertPathConstraints) { + if (engine != null) { + userAlgConstraints = + engine.getSSLParameters().getAlgorithmConstraints(); + peerAlgConstraints = + new SupportedSignatureAlgorithmConstraints(supportedAlgorithms); + } + + if (!withDefaultCertPathConstraints) { + enabledX509DisabledAlgConstraints = false; + } + } + + public boolean permits(Set primitives, + String algorithm, AlgorithmParameters parameters) { + + boolean permitted = true; + + if (peerAlgConstraints != null) { + permitted = peerAlgConstraints.permits( + primitives, algorithm, parameters); + } + + if (permitted && userAlgConstraints != null) { + permitted = userAlgConstraints.permits( + primitives, algorithm, parameters); + } + + if (permitted) { + permitted = tlsDisabledAlgConstraints.permits( + primitives, algorithm, parameters); + } + + if (permitted && enabledX509DisabledAlgConstraints) { + permitted = x509DisabledAlgConstraints.permits( + primitives, algorithm, parameters); + } + + return permitted; + } + + public boolean permits(Set primitives, Key key) { + + boolean permitted = true; + + if (peerAlgConstraints != null) { + permitted = peerAlgConstraints.permits(primitives, key); + } + + if (permitted && userAlgConstraints != null) { + permitted = userAlgConstraints.permits(primitives, key); + } + + if (permitted) { + permitted = tlsDisabledAlgConstraints.permits(primitives, key); + } + + if (permitted && enabledX509DisabledAlgConstraints) { + permitted = x509DisabledAlgConstraints.permits(primitives, key); + } + + return permitted; + } + + public boolean permits(Set primitives, + String algorithm, Key key, AlgorithmParameters parameters) { + + boolean permitted = true; + + if (peerAlgConstraints != null) { + permitted = peerAlgConstraints.permits( + primitives, algorithm, key, parameters); + } + + if (permitted && userAlgConstraints != null) { + permitted = userAlgConstraints.permits( + primitives, algorithm, key, parameters); + } + + if (permitted) { + permitted = tlsDisabledAlgConstraints.permits( + primitives, algorithm, key, parameters); + } + + if (permitted && enabledX509DisabledAlgConstraints) { + permitted = x509DisabledAlgConstraints.permits( + primitives, algorithm, key, parameters); + } + + return permitted; + } + + + static private class SupportedSignatureAlgorithmConstraints + implements AlgorithmConstraints { + // supported signature algorithms + private String[] supportedAlgorithms; + + SupportedSignatureAlgorithmConstraints(String[] supportedAlgorithms) { + if (supportedAlgorithms != null) { + this.supportedAlgorithms = supportedAlgorithms.clone(); + } else { + this.supportedAlgorithms = null; + } + } + + public boolean permits(Set primitives, + String algorithm, AlgorithmParameters parameters) { + + if (algorithm == null || algorithm.length() == 0) { + throw new IllegalArgumentException( + "No algorithm name specified"); + } + + if (primitives == null || primitives.isEmpty()) { + throw new IllegalArgumentException( + "No cryptographic primitive specified"); + } + + if (supportedAlgorithms == null || + supportedAlgorithms.length == 0) { + return false; + } + + // trim the MGF part: withand + int position = algorithm.indexOf("and"); + if (position > 0) { + algorithm = algorithm.substring(0, position); + } + + for (String supportedAlgorithm : supportedAlgorithms) { + if (algorithm.equalsIgnoreCase(supportedAlgorithm)) { + return true; + } + } + + return false; + } + + final public boolean permits(Set primitives, Key key) { + return true; + } + + final public boolean permits(Set primitives, + String algorithm, Key key, AlgorithmParameters parameters) { + + if (algorithm == null || algorithm.length() == 0) { + throw new IllegalArgumentException( + "No algorithm name specified"); + } + + return permits(primitives, algorithm, parameters); + } + } + + static private class BasicDisabledAlgConstraints + extends DisabledAlgorithmConstraints { + BasicDisabledAlgConstraints(String propertyName) { + super(propertyName); + } + + protected Set decomposes(KeyExchange keyExchange, + boolean forCertPathOnly) { + Set components = new HashSet<>(); + switch (keyExchange) { + case K_NULL: + if (!forCertPathOnly) { + components.add("NULL"); + } + break; + case K_RSA: + components.add("RSA"); + break; + case K_RSA_EXPORT: + components.add("RSA"); + components.add("RSA_EXPORT"); + break; + case K_DH_RSA: + components.add("RSA"); + components.add("DH"); + components.add("DiffieHellman"); + components.add("DH_RSA"); + break; + case K_DH_DSS: + components.add("DSA"); + components.add("DSS"); + components.add("DH"); + components.add("DiffieHellman"); + components.add("DH_DSS"); + break; + case K_DHE_DSS: + components.add("DSA"); + components.add("DSS"); + components.add("DH"); + components.add("DHE"); + components.add("DiffieHellman"); + components.add("DHE_DSS"); + break; + case K_DHE_RSA: + components.add("RSA"); + components.add("DH"); + components.add("DHE"); + components.add("DiffieHellman"); + components.add("DHE_RSA"); + break; + case K_DH_ANON: + if (!forCertPathOnly) { + components.add("ANON"); + components.add("DH"); + components.add("DiffieHellman"); + components.add("DH_ANON"); + } + break; + case K_ECDH_ECDSA: + components.add("ECDH"); + components.add("ECDSA"); + components.add("ECDH_ECDSA"); + break; + case K_ECDH_RSA: + components.add("ECDH"); + components.add("RSA"); + components.add("ECDH_RSA"); + break; + case K_ECDHE_ECDSA: + components.add("ECDHE"); + components.add("ECDSA"); + components.add("ECDHE_ECDSA"); + break; + case K_ECDHE_RSA: + components.add("ECDHE"); + components.add("RSA"); + components.add("ECDHE_RSA"); + break; + case K_ECDH_ANON: + if (!forCertPathOnly) { + components.add("ECDH"); + components.add("ANON"); + components.add("ECDH_ANON"); + } + break; + case K_KRB5: + if (!forCertPathOnly) { + components.add("KRB5"); + } + break; + case K_KRB5_EXPORT: + if (!forCertPathOnly) { + components.add("KRB5_EXPORT"); + } + break; + default: + // ignore + } + + return components; + } + + protected Set decomposes(BulkCipher bulkCipher) { + Set components = new HashSet<>(); + + if (bulkCipher.transformation != null) { + components.addAll(super.decomposes(bulkCipher.transformation)); + } + + return components; + } + + protected Set decomposes(MacAlg macAlg) { + Set components = new HashSet<>(); + + if (macAlg == CipherSuite.M_MD5) { + components.add("MD5"); + components.add("HmacMD5"); + } else if (macAlg == CipherSuite.M_SHA) { + components.add("SHA1"); + components.add("SHA-1"); + components.add("HmacSHA1"); + } else if (macAlg == CipherSuite.M_SHA256) { + components.add("SHA256"); + components.add("SHA-256"); + components.add("HmacSHA256"); + } else if (macAlg == CipherSuite.M_SHA384) { + components.add("SHA384"); + components.add("SHA-384"); + components.add("HmacSHA384"); + } + + return components; + } + } + + static private class TLSDisabledAlgConstraints + extends BasicDisabledAlgConstraints { + + TLSDisabledAlgConstraints() { + super(DisabledAlgorithmConstraints.PROPERTY_TLS_DISABLED_ALGS); + } + + @Override + protected Set decomposes(String algorithm) { + if (algorithm.startsWith("SSL_") || algorithm.startsWith("TLS_")) { + CipherSuite cipherSuite = null; + try { + cipherSuite = CipherSuite.valueOf(algorithm); + } catch (IllegalArgumentException iae) { + // ignore: unknown or unsupported ciphersuite + } + + if (cipherSuite != null) { + Set components = new HashSet<>(); + + if(cipherSuite.keyExchange != null) { + components.addAll( + decomposes(cipherSuite.keyExchange, false)); + } + + if (cipherSuite.cipher != null) { + components.addAll(decomposes(cipherSuite.cipher)); + } + + if (cipherSuite.macAlg != null) { + components.addAll(decomposes(cipherSuite.macAlg)); + } + + return components; + } + } + + return super.decomposes(algorithm); + } + } + + static private class X509DisabledAlgConstraints + extends BasicDisabledAlgConstraints { + + X509DisabledAlgConstraints() { + super(DisabledAlgorithmConstraints.PROPERTY_CERTPATH_DISABLED_ALGS); + } + + @Override + protected Set decomposes(String algorithm) { + if (algorithm.startsWith("SSL_") || algorithm.startsWith("TLS_")) { + CipherSuite cipherSuite = null; + try { + cipherSuite = CipherSuite.valueOf(algorithm); + } catch (IllegalArgumentException iae) { + // ignore: unknown or unsupported ciphersuite + } + + if (cipherSuite != null) { + Set components = new HashSet<>(); + + if(cipherSuite.keyExchange != null) { + components.addAll( + decomposes(cipherSuite.keyExchange, true)); + } + + // Certification path algorithm constraints do not apply + // to cipherSuite.cipher and cipherSuite.macAlg. + + return components; + } + } + + return super.decomposes(algorithm); + } + } +} + diff --git a/jdk/src/share/classes/sun/security/ssl/SSLContextImpl.java b/jdk/src/share/classes/sun/security/ssl/SSLContextImpl.java index 9225312de9d..cfbab4cb4e4 100644 --- a/jdk/src/share/classes/sun/security/ssl/SSLContextImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/SSLContextImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +27,15 @@ package sun.security.ssl; import java.net.Socket; +import java.util.*; import java.security.*; import java.security.cert.*; +import java.security.cert.Certificate; import javax.net.ssl.*; +import sun.security.provider.certpath.AlgorithmChecker; + public class SSLContextImpl extends SSLContextSpi { private static final Debug debug = Debug.getInstance("ssl"); @@ -82,7 +86,8 @@ public class SSLContextImpl extends SSLContextSpi { if (sr == null) { secureRandom = JsseJce.getSecureRandom(); } else { - if (SunJSSE.isFIPS() && (sr.getProvider() != SunJSSE.cryptoProvider)) { + if (SunJSSE.isFIPS() && + (sr.getProvider() != SunJSSE.cryptoProvider)) { throw new KeyManagementException ("FIPS mode: SecureRandom must be from provider " + SunJSSE.cryptoProvider.getName()); @@ -111,11 +116,18 @@ public class SSLContextImpl extends SSLContextSpi { // We only use the first instance of X509TrustManager passed to us. for (int i = 0; tm != null && i < tm.length; i++) { if (tm[i] instanceof X509TrustManager) { - if (SunJSSE.isFIPS() && !(tm[i] instanceof X509TrustManagerImpl)) { + if (SunJSSE.isFIPS() && + !(tm[i] instanceof X509TrustManagerImpl)) { throw new KeyManagementException ("FIPS mode: only SunJSSE TrustManagers may be used"); } - return (X509TrustManager)tm[i]; + + if (tm[i] instanceof X509ExtendedTrustManager) { + return (X509TrustManager)tm[i]; + } else { + return new AbstractTrustManagerWrapper( + (X509TrustManager)tm[i]); + } } } @@ -153,7 +165,7 @@ public class SSLContextImpl extends SSLContextSpi { "SSLContext.init(): need an " + "X509ExtendedKeyManager for SSLEngine use"); } - return new AbstractWrapper((X509KeyManager)km); + return new AbstractKeyManagerWrapper((X509KeyManager)km); } // nothing found, return a dummy X509ExtendedKeyManager @@ -217,9 +229,179 @@ public class SSLContextImpl extends SSLContextSpi { } + +final class AbstractTrustManagerWrapper extends X509ExtendedTrustManager + implements X509TrustManager { + + private final X509TrustManager tm; + + AbstractTrustManagerWrapper(X509TrustManager tm) { + this.tm = tm; + } + + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + tm.checkClientTrusted(chain, authType); + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + tm.checkServerTrusted(chain, authType); + } + + @Override + public X509Certificate[] getAcceptedIssuers() { + return tm.getAcceptedIssuers(); + } + + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType, + Socket socket) throws CertificateException { + tm.checkClientTrusted(chain, authType); + checkAdditionalTrust(chain, authType, socket, true); + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType, + Socket socket) throws CertificateException { + tm.checkServerTrusted(chain, authType); + checkAdditionalTrust(chain, authType, socket, false); + } + + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType, + SSLEngine engine) throws CertificateException { + tm.checkClientTrusted(chain, authType); + checkAdditionalTrust(chain, authType, engine, true); + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType, + SSLEngine engine) throws CertificateException { + tm.checkServerTrusted(chain, authType); + checkAdditionalTrust(chain, authType, engine, false); + } + + private void checkAdditionalTrust(X509Certificate[] chain, String authType, + Socket socket, boolean isClient) throws CertificateException { + if (socket != null && socket.isConnected() && + socket instanceof SSLSocket) { + + SSLSocket sslSocket = (SSLSocket)socket; + SSLSession session = sslSocket.getHandshakeSession(); + if (session == null) { + throw new CertificateException("No handshake session"); + } + + // check endpoint identity + String identityAlg = sslSocket.getSSLParameters(). + getEndpointIdentificationAlgorithm(); + if (identityAlg != null && identityAlg.length() != 0) { + String hostname = session.getPeerHost(); + X509TrustManagerImpl.checkIdentity( + hostname, chain[0], identityAlg); + } + + // try the best to check the algorithm constraints + ProtocolVersion protocolVersion = + ProtocolVersion.valueOf(session.getProtocol()); + AlgorithmConstraints constraints = null; + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + if (session instanceof ExtendedSSLSession) { + ExtendedSSLSession extSession = + (ExtendedSSLSession)session; + String[] peerSupportedSignAlgs = + extSession.getLocalSupportedSignatureAlgorithms(); + + constraints = new SSLAlgorithmConstraints( + sslSocket, peerSupportedSignAlgs, true); + } else { + constraints = + new SSLAlgorithmConstraints(sslSocket, true); + } + } else { + constraints = new SSLAlgorithmConstraints(sslSocket, true); + } + + AlgorithmChecker checker = new AlgorithmChecker(constraints); + try { + checker.init(false); + + // a forward checker, need to check from trust to target + for (int i = chain.length - 1; i >= 0; i--) { + Certificate cert = chain[i]; + // We don't care about the unresolved critical extensions. + checker.check(cert, Collections.emptySet()); + } + } catch (CertPathValidatorException cpve) { + throw new CertificateException( + "Certificates does not conform to algorithm constraints"); + } + } + } + + private void checkAdditionalTrust(X509Certificate[] chain, String authType, + SSLEngine engine, boolean isClient) throws CertificateException { + if (engine != null) { + SSLSession session = engine.getHandshakeSession(); + if (session == null) { + throw new CertificateException("No handshake session"); + } + + // check endpoint identity + String identityAlg = engine.getSSLParameters(). + getEndpointIdentificationAlgorithm(); + if (identityAlg != null && identityAlg.length() != 0) { + String hostname = session.getPeerHost(); + X509TrustManagerImpl.checkIdentity( + hostname, chain[0], identityAlg); + } + + // try the best to check the algorithm constraints + ProtocolVersion protocolVersion = + ProtocolVersion.valueOf(session.getProtocol()); + AlgorithmConstraints constraints = null; + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + if (session instanceof ExtendedSSLSession) { + ExtendedSSLSession extSession = + (ExtendedSSLSession)session; + String[] peerSupportedSignAlgs = + extSession.getLocalSupportedSignatureAlgorithms(); + + constraints = new SSLAlgorithmConstraints( + engine, peerSupportedSignAlgs, true); + } else { + constraints = + new SSLAlgorithmConstraints(engine, true); + } + } else { + constraints = new SSLAlgorithmConstraints(engine, true); + } + + AlgorithmChecker checker = new AlgorithmChecker(constraints); + try { + checker.init(false); + + // A forward checker, need to check from trust to target + for (int i = chain.length - 1; i >= 0; i--) { + Certificate cert = chain[i]; + // We don't care about the unresolved critical extensions. + checker.check(cert, Collections.emptySet()); + } + } catch (CertPathValidatorException cpve) { + throw new CertificateException( + "Certificates does not conform to algorithm constraints"); + } + } + } +} + // Dummy X509TrustManager implementation, rejects all peer certificates. // Used if the application did not specify a proper X509TrustManager. -final class DummyX509TrustManager implements X509TrustManager { +final class DummyX509TrustManager extends X509ExtendedTrustManager + implements X509TrustManager { static final X509TrustManager INSTANCE = new DummyX509TrustManager(); @@ -234,6 +416,7 @@ final class DummyX509TrustManager implements X509TrustManager { * validated and is trusted for client SSL authentication. * If not, it throws an exception. */ + @Override public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { throw new CertificateException( @@ -247,6 +430,7 @@ final class DummyX509TrustManager implements X509TrustManager { * validated and is trusted for server SSL authentication. * If not, it throws an exception. */ + @Override public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { throw new CertificateException( @@ -257,19 +441,48 @@ final class DummyX509TrustManager implements X509TrustManager { * Return an array of issuer certificates which are trusted * for authenticating peers. */ + @Override public X509Certificate[] getAcceptedIssuers() { return new X509Certificate[0]; } + + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType, + Socket socket) throws CertificateException { + throw new CertificateException( + "No X509TrustManager implementation available"); + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType, + Socket socket) throws CertificateException { + throw new CertificateException( + "No X509TrustManager implementation available"); + } + + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType, + SSLEngine engine) throws CertificateException { + throw new CertificateException( + "No X509TrustManager implementation available"); + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType, + SSLEngine engine) throws CertificateException { + throw new CertificateException( + "No X509TrustManager implementation available"); + } } /* * A wrapper class to turn a X509KeyManager into an X509ExtendedKeyManager */ -final class AbstractWrapper extends X509ExtendedKeyManager { +final class AbstractKeyManagerWrapper extends X509ExtendedKeyManager { private final X509KeyManager km; - AbstractWrapper(X509KeyManager km) { + AbstractKeyManagerWrapper(X509KeyManager km) { this.km = km; } diff --git a/jdk/src/share/classes/sun/security/ssl/SSLEngineImpl.java b/jdk/src/share/classes/sun/security/ssl/SSLEngineImpl.java index cd7122aec19..76b781806fd 100644 --- a/jdk/src/share/classes/sun/security/ssl/SSLEngineImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/SSLEngineImpl.java @@ -200,8 +200,10 @@ final public class SSLEngineImpl extends SSLEngine { * is associated with a session at the same time. (TLS/IETF may * change that to add client authentication w/o new key exchg.) */ - private SSLSessionImpl sess; - private Handshaker handshaker; + private Handshaker handshaker; + private SSLSessionImpl sess; + private volatile SSLSessionImpl handshakeSession; + /* * Client authentication be off, requested, or required. @@ -240,26 +242,30 @@ final public class SSLEngineImpl extends SSLEngine { * session is changed. */ private byte doClientAuth; - private CipherSuiteList enabledCipherSuites; private boolean enableSessionCreation = true; EngineInputRecord inputRecord; EngineOutputRecord outputRecord; private AccessControlContext acc; - // hostname identification algorithm, the hostname identification is - // disabled by default. - private String identificationAlg = null; + // The cipher suites enabled for use on this connection. + private CipherSuiteList enabledCipherSuites; + + // the endpoint identification protocol + private String identificationProtocol = null; + + // The cryptographic algorithm constraints + private AlgorithmConstraints algorithmConstraints = null; // Have we been told whether we're client or server? private boolean serverModeSet = false; private boolean roleIsServer; /* - * The protocols we support are SSL Version 3.0) and - * TLS (version 3.1). - * In addition we support a pseudo protocol called - * SSLv2Hello which when set will result in an SSL v2 Hello - * being sent with SSLv3 or TLSv1 version info. + * The protocol versions enabled for use on this connection. + * + * Note: we support a pseudo protocol called SSLv2Hello which when + * set will result in an SSL v2 Hello being sent with SSL (version 3.0) + * or TLS (version 3.1, 3.2, etc.) version info. */ private ProtocolList enabledProtocols; @@ -342,6 +348,7 @@ final public class SSLEngineImpl extends SSLEngine { sslContext = ctx; sess = SSLSessionImpl.nullSession; + handshakeSession = null; /* * State is cs_START until we initialize the handshaker. @@ -368,7 +375,7 @@ final public class SSLEngineImpl extends SSLEngine { serverVerifyData = new byte[0]; enabledCipherSuites = CipherSuiteList.getDefault(); - enabledProtocols = ProtocolList.getDefault(); + enabledProtocols = ProtocolList.getDefault(roleIsServer); wrapLock = new Object(); unwrapLock = new Object(); @@ -405,8 +412,8 @@ final public class SSLEngineImpl extends SSLEngine { * . if the engine is already closed, throw an Exception (internal error) * * . otherwise (cs_START or cs_DATA), create the appropriate handshaker - * object, initialize it, and advance the connection state (to - * cs_HANDSHAKE or cs_RENEGOTIATE, respectively). + * object and advance the connection state (to cs_HANDSHAKE or + * cs_RENEGOTIATE, respectively). * * This method is called right after a new engine is created, when * starting renegotiation, or when changing client/server mode of the @@ -454,12 +461,8 @@ final public class SSLEngineImpl extends SSLEngine { protocolVersion, connectionState == cs_HANDSHAKE, secureRenegotiation, clientVerifyData, serverVerifyData); } - handshaker.enabledCipherSuites = enabledCipherSuites; + handshaker.setEnabledCipherSuites(enabledCipherSuites); handshaker.setEnableSessionCreation(enableSessionCreation); - if (connectionState == cs_RENEGOTIATE) { - // don't use SSLv2Hello when renegotiating - handshaker.output.r.setHelloVersion(protocolVersion); - } } /* @@ -686,7 +689,15 @@ final public class SSLEngineImpl extends SSLEngine { // to its HandshakeOutStream, which calls back into // SSLSocketImpl.writeRecord() to send it. // - if (!handshaker.started()) { + if (!handshaker.activated()) { + // prior to handshaking, activate the handshake + if (connectionState == cs_RENEGOTIATE) { + // don't use SSLv2Hello when renegotiating + handshaker.activate(protocolVersion); + } else { + handshaker.activate(null); + } + if (handshaker instanceof ClientHandshaker) { // send client hello handshaker.kickstart(); @@ -696,6 +707,7 @@ final public class SSLEngineImpl extends SSLEngine { } else { // we want to renegotiate, send hello request handshaker.kickstart(); + // hello request is not included in the handshake // hashes, reset them handshaker.handshakeHash.reset(); @@ -982,6 +994,15 @@ final public class SSLEngineImpl extends SSLEngine { * in it. */ initHandshaker(); + if (!handshaker.activated()) { + // prior to handshaking, activate the handshake + if (connectionState == cs_RENEGOTIATE) { + // don't use SSLv2Hello when renegotiating + handshaker.activate(protocolVersion); + } else { + handshaker.activate(null); + } + } /* * process the handshake record ... may contain just @@ -1007,6 +1028,7 @@ final public class SSLEngineImpl extends SSLEngine { serverVerifyData = handshaker.getServerVerifyData(); sess = handshaker.getSession(); + handshakeSession = null; if (!writer.hasOutboundData()) { hsStatus = HandshakeStatus.FINISHED; } @@ -1081,6 +1103,26 @@ final public class SSLEngineImpl extends SSLEngine { } break; } // switch + + /* + * We only need to check the sequence number state for + * non-handshaking record. + * + * Note that in order to maintain the handshake status + * properly, we check the sequence number after the last + * record reading process. As we request renegotiation + * or close the connection for wrapped sequence number + * when there is enough sequence number space left to + * handle a few more records, so the sequence number + * of the last record cannot be wrapped. + */ + if (connectionState < cs_ERROR && !isInboundDone() && + (hsStatus == HandshakeStatus.NOT_HANDSHAKING)) { + if (checkSequenceNumber(readMAC, + inputRecord.contentType())) { + hsStatus = getHSStatus(null); + } + } } // synchronized (this) } @@ -1229,7 +1271,29 @@ final public class SSLEngineImpl extends SSLEngine { EngineArgs ea) throws IOException { // eventually compress as well. - return writer.writeRecord(eor, ea, writeMAC, writeCipher); + HandshakeStatus hsStatus = + writer.writeRecord(eor, ea, writeMAC, writeCipher); + + /* + * We only need to check the sequence number state for + * non-handshaking record. + * + * Note that in order to maintain the handshake status + * properly, we check the sequence number after the last + * record writing process. As we request renegotiation + * or close the connection for wrapped sequence number + * when there is enough sequence number space left to + * handle a few more records, so the sequence number + * of the last record cannot be wrapped. + */ + if (connectionState < cs_ERROR && !isOutboundDone() && + (hsStatus == HandshakeStatus.NOT_HANDSHAKING)) { + if (checkSequenceNumber(writeMAC, eor.contentType())) { + hsStatus = getHSStatus(null); + } + } + + return hsStatus; } /* @@ -1238,12 +1302,88 @@ final public class SSLEngineImpl extends SSLEngine { void writeRecord(EngineOutputRecord eor) throws IOException { // eventually compress as well. writer.writeRecord(eor, writeMAC, writeCipher); + + /* + * Check the sequence number state + * + * Note that in order to maintain the connection I/O + * properly, we check the sequence number after the last + * record writing process. As we request renegotiation + * or close the connection for wrapped sequence number + * when there is enough sequence number space left to + * handle a few more records, so the sequence number + * of the last record cannot be wrapped. + */ + if ((connectionState < cs_ERROR) && !isOutboundDone()) { + checkSequenceNumber(writeMAC, eor.contentType()); + } } // // Close code // + /** + * Check the sequence number state + * + * RFC 4346 states that, "Sequence numbers are of type uint64 and + * may not exceed 2^64-1. Sequence numbers do not wrap. If a TLS + * implementation would need to wrap a sequence number, it must + * renegotiate instead." + * + * Return true if the handshake status may be changed. + */ + private boolean checkSequenceNumber(MAC mac, byte type) + throws IOException { + + /* + * Don't bother to check the sequence number for error or + * closed connections, or NULL MAC + */ + if (connectionState >= cs_ERROR || mac == MAC.NULL) { + return false; + } + + /* + * Conservatively, close the connection immediately when the + * sequence number is close to overflow + */ + if (mac.seqNumOverflow()) { + /* + * TLS protocols do not define a error alert for sequence + * number overflow. We use handshake_failure error alert + * for handshaking and bad_record_mac for other records. + */ + if (debug != null && Debug.isOn("ssl")) { + System.out.println(threadName() + + ", sequence number extremely close to overflow " + + "(2^64-1 packets). Closing connection."); + } + + fatal(Alerts.alert_handshake_failure, "sequence number overflow"); + + return true; // make the compiler happy + } + + /* + * Ask for renegotiation when need to renew sequence number. + * + * Don't bother to kickstart the renegotiation when the local is + * asking for it. + */ + if ((type != Record.ct_handshake) && mac.seqNumIsHuge()) { + if (debug != null && Debug.isOn("ssl")) { + System.out.println(threadName() + ", request renegotiation " + + "to avoid sequence number overflow"); + } + + beginHandshake(); + return true; + } + + return false; + } + /** * Signals that no more outbound application data will be sent * on this SSLEngine. @@ -1394,6 +1534,15 @@ final public class SSLEngineImpl extends SSLEngine { return sess; } + @Override + synchronized public SSLSession getHandshakeSession() { + return handshakeSession; + } + + synchronized void setHandshakeSession(SSLSessionImpl session) { + handshakeSession = session; + } + /** * Returns a delegated Runnable task for * this SSLEngine. @@ -1495,6 +1644,9 @@ final public class SSLEngineImpl extends SSLEngine { inboundDone = true; sess.invalidate(); + if (handshakeSession != null) { + handshakeSession.invalidate(); + } /* * If we haven't even started handshaking yet, no need @@ -1594,10 +1746,18 @@ final public class SSLEngineImpl extends SSLEngine { * Emit alerts. Caller must have synchronized with "this". */ private void sendAlert(byte level, byte description) { + // the connectionState cannot be cs_START if (connectionState >= cs_CLOSED) { return; } + // For initial handshaking, don't send alert message to peer if + // handshaker has not started. + if (connectionState == cs_HANDSHAKE && + (handshaker == null || !handshaker.started())) { + return; + } + EngineOutputRecord r = new EngineOutputRecord(Record.ct_alert, this); r.setVersion(protocolVersion); @@ -1647,7 +1807,7 @@ final public class SSLEngineImpl extends SSLEngine { synchronized public void setEnableSessionCreation(boolean flag) { enableSessionCreation = flag; - if ((handshaker != null) && !handshaker.started()) { + if ((handshaker != null) && !handshaker.activated()) { handshaker.setEnableSessionCreation(enableSessionCreation); } } @@ -1675,7 +1835,7 @@ final public class SSLEngineImpl extends SSLEngine { if ((handshaker != null) && (handshaker instanceof ServerHandshaker) && - !handshaker.started()) { + !handshaker.activated()) { ((ServerHandshaker) handshaker).setClientAuth(doClientAuth); } } @@ -1698,7 +1858,7 @@ final public class SSLEngineImpl extends SSLEngine { if ((handshaker != null) && (handshaker instanceof ServerHandshaker) && - !handshaker.started()) { + !handshaker.activated()) { ((ServerHandshaker) handshaker).setClientAuth(doClientAuth); } } @@ -1717,6 +1877,16 @@ final public class SSLEngineImpl extends SSLEngine { switch (connectionState) { case cs_START: + /* + * If we need to change the engine mode and the enabled + * protocols haven't specifically been set by the user, + * change them to the corresponding default ones. + */ + if (roleIsServer != (!flag) && + ProtocolList.isDefaultProtocolList(enabledProtocols)) { + enabledProtocols = ProtocolList.getDefault(!flag); + } + roleIsServer = !flag; serverModeSet = true; break; @@ -1730,7 +1900,17 @@ final public class SSLEngineImpl extends SSLEngine { * have the streams. */ assert(handshaker != null); - if (!handshaker.started()) { + if (!handshaker.activated()) { + /* + * If we need to change the engine mode and the enabled + * protocols haven't specifically been set by the user, + * change them to the corresponding default ones. + */ + if (roleIsServer != (!flag) && + ProtocolList.isDefaultProtocolList(enabledProtocols)) { + enabledProtocols = ProtocolList.getDefault(!flag); + } + roleIsServer = !flag; connectionState = cs_START; initHandshaker(); @@ -1786,8 +1966,8 @@ final public class SSLEngineImpl extends SSLEngine { */ synchronized public void setEnabledCipherSuites(String[] suites) { enabledCipherSuites = new CipherSuiteList(suites); - if ((handshaker != null) && !handshaker.started()) { - handshaker.enabledCipherSuites = enabledCipherSuites; + if ((handshaker != null) && !handshaker.activated()) { + handshaker.setEnabledCipherSuites(enabledCipherSuites); } } @@ -1809,7 +1989,7 @@ final public class SSLEngineImpl extends SSLEngine { /** * Returns the protocols that are supported by this implementation. * A subset of the supported protocols may be enabled for this connection - * @ returns an array of protocol names. + * @return an array of protocol names. */ public String[] getSupportedProtocols() { return ProtocolList.getSupported().toStringArray(); @@ -1826,7 +2006,7 @@ final public class SSLEngineImpl extends SSLEngine { */ synchronized public void setEnabledProtocols(String[] protocols) { enabledProtocols = new ProtocolList(protocols); - if ((handshaker != null) && !handshaker.started()) { + if ((handshaker != null) && !handshaker.activated()) { handshaker.setEnabledProtocols(enabledProtocols); } } @@ -1836,28 +2016,31 @@ final public class SSLEngineImpl extends SSLEngine { } /** - * Try to configure the endpoint identification algorithm of the engine. - * - * @param identificationAlgorithm the algorithm used to check the - * endpoint identity. - * @return true if the identification algorithm configuration success. + * Returns the SSLParameters in effect for this SSLEngine. */ - synchronized public boolean trySetHostnameVerification( - String identificationAlgorithm) { - if (sslContext.getX509TrustManager() instanceof - X509ExtendedTrustManager) { - this.identificationAlg = identificationAlgorithm; - return true; - } else { - return false; - } + synchronized public SSLParameters getSSLParameters() { + SSLParameters params = super.getSSLParameters(); + + // the super implementation does not handle the following parameters + params.setEndpointIdentificationAlgorithm(identificationProtocol); + params.setAlgorithmConstraints(algorithmConstraints); + + return params; } /** - * Returns the endpoint identification algorithm of the engine. + * Applies SSLParameters to this engine. */ - synchronized public String getHostnameVerification() { - return identificationAlg; + synchronized public void setSSLParameters(SSLParameters params) { + super.setSSLParameters(params); + + // the super implementation does not handle the following parameters + identificationProtocol = params.getEndpointIdentificationAlgorithm(); + algorithmConstraints = params.getAlgorithmConstraints(); + if ((handshaker != null) && !handshaker.started()) { + handshaker.setIdentificationProtocol(identificationProtocol); + handshaker.setAlgorithmConstraints(algorithmConstraints); + } } /** diff --git a/jdk/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java b/jdk/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java index 914406b2e42..0ea3cfa9fba 100644 --- a/jdk/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java @@ -31,11 +31,14 @@ import java.net.InetAddress; import java.net.Socket; import java.net.ServerSocket; +import java.security.AlgorithmConstraints; + import java.util.*; import javax.net.ServerSocketFactory; import javax.net.ssl.SSLException; import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLParameters; /** @@ -83,6 +86,12 @@ class SSLServerSocketImpl extends SSLServerSocket /* could enabledCipherSuites ever complete handshaking? */ private boolean checkedEnabled = false; + // the endpoint identification protocol to use by default + private String identificationProtocol = null; + + // The cryptographic algorithm constraints + private AlgorithmConstraints algorithmConstraints = null; + /** * Create an SSL server socket on a port, using a non-default * authentication context and a specified connection backlog. @@ -145,7 +154,7 @@ class SSLServerSocketImpl extends SSLServerSocket } sslContext = context; enabledCipherSuites = CipherSuiteList.getDefault(); - enabledProtocols = ProtocolList.getDefault(); + enabledProtocols = ProtocolList.getDefault(true); } /** @@ -238,6 +247,16 @@ class SSLServerSocketImpl extends SSLServerSocket * rejoining the already-negotiated SSL connection. */ public void setUseClientMode(boolean flag) { + /* + * If we need to change the socket mode and the enabled + * protocols haven't specifically been set by the user, + * change them to the corresponding default ones. + */ + if (useServerMode != (!flag) && + ProtocolList.isDefaultProtocolList(enabledProtocols)) { + enabledProtocols = ProtocolList.getDefault(!flag); + } + useServerMode = !flag; } @@ -262,6 +281,29 @@ class SSLServerSocketImpl extends SSLServerSocket return enableSessionCreation; } + /** + * Returns the SSLParameters in effect for newly accepted connections. + */ + synchronized public SSLParameters getSSLParameters() { + SSLParameters params = super.getSSLParameters(); + + // the super implementation does not handle the following parameters + params.setEndpointIdentificationAlgorithm(identificationProtocol); + params.setAlgorithmConstraints(algorithmConstraints); + + return params; + } + + /** + * Applies SSLParameters to newly accepted connections. + */ + synchronized public void setSSLParameters(SSLParameters params) { + super.setSSLParameters(params); + + // the super implementation does not handle the following parameters + identificationProtocol = params.getEndpointIdentificationAlgorithm(); + algorithmConstraints = params.getAlgorithmConstraints(); + } /** * Accept a new SSL connection. This server identifies itself with @@ -269,67 +311,15 @@ class SSLServerSocketImpl extends SSLServerSocket * presented during construction. */ public Socket accept() throws IOException { - checkEnabledSuites(); - SSLSocketImpl s = new SSLSocketImpl(sslContext, useServerMode, enabledCipherSuites, doClientAuth, enableSessionCreation, - enabledProtocols); + enabledProtocols, identificationProtocol, algorithmConstraints); implAccept(s); s.doneConnect(); return s; } - - /* - * This is a sometimes helpful diagnostic check that is performed - * once for each ServerSocket to verify that the initial set of - * enabled suites are capable of supporting a successful handshake. - */ - private void checkEnabledSuites() throws IOException { - // - // We want to report an error if no cipher suites were actually - // enabled, since this is an error users are known to make. Then - // they get vastly confused by having clients report an error! - // - synchronized (this) { - if (checkedEnabled) { - return; - } - if (useServerMode == false) { - return; - } - - SSLSocketImpl tmp = new SSLSocketImpl(sslContext, useServerMode, - enabledCipherSuites, doClientAuth, - enableSessionCreation, enabledProtocols); - - try { - ServerHandshaker handshaker = tmp.getServerHandshaker(); - - for (Iterator t = enabledCipherSuites.iterator(); - t.hasNext();) { - CipherSuite suite = t.next(); - if (handshaker.trySetCipherSuite(suite)) { - checkedEnabled = true; - return; - } - } - } finally { - tmp.closeSocket(); - } - - // - // diagnostic text here is currently appropriate - // since it's only certificate unavailability that can - // cause such problems ... but that might change someday. - // - throw new SSLException("No available certificate or key corresponds" - + " to the SSL cipher suites which are enabled."); - } - } - - /** * Provides a brief description of this SSL socket. */ diff --git a/jdk/src/share/classes/sun/security/ssl/SSLSessionImpl.java b/jdk/src/share/classes/sun/security/ssl/SSLSessionImpl.java index f885c83cb66..f68b14be9c2 100644 --- a/jdk/src/share/classes/sun/security/ssl/SSLSessionImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/SSLSessionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import java.net.*; import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; +import java.util.Arrays; +import java.util.Collection; import java.security.Principal; import java.security.PrivateKey; @@ -47,6 +49,8 @@ import javax.net.ssl.SSLSessionBindingEvent; import javax.net.ssl.SSLPeerUnverifiedException; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLPermission; +import javax.net.ssl.SSLException; +import javax.net.ssl.ExtendedSSLSession; import javax.security.auth.x500.X500Principal; @@ -71,7 +75,7 @@ import static sun.security.ssl.CipherSuite.KeyExchange.*; * * @author David Brownell */ -final class SSLSessionImpl implements SSLSession { +final class SSLSessionImpl extends ExtendedSSLSession { /* * we only really need a single null session @@ -89,7 +93,7 @@ final class SSLSessionImpl implements SSLSession { private final SessionId sessionId; private X509Certificate[] peerCerts; private byte compressionMethod; - private final CipherSuite cipherSuite; + private CipherSuite cipherSuite; private SecretKey masterSecret; /* @@ -105,6 +109,8 @@ final class SSLSessionImpl implements SSLSession { private boolean invalidated; private X509Certificate[] localCerts; private PrivateKey localPrivateKey; + private String[] localSupportedSignAlgs; + private String[] peerSupportedSignAlgs; // Principals for non-certificate based cipher suites private Principal peerPrincipal; @@ -132,8 +138,8 @@ final class SSLSessionImpl implements SSLSession { * first opened and before handshaking begins. */ private SSLSessionImpl() { - this(ProtocolVersion.NONE, CipherSuite.C_NULL, - new SessionId(false, null), null, -1); + this(ProtocolVersion.NONE, CipherSuite.C_NULL, null, + new SessionId(false, null), null, -1); } /* @@ -142,8 +148,9 @@ final class SSLSessionImpl implements SSLSession { * is intended mostly for use by serves. */ SSLSessionImpl(ProtocolVersion protocolVersion, CipherSuite cipherSuite, + Collection algorithms, SecureRandom generator, String host, int port) { - this(protocolVersion, cipherSuite, + this(protocolVersion, cipherSuite, algorithms, new SessionId(defaultRejoinable, generator), host, port); } @@ -151,6 +158,7 @@ final class SSLSessionImpl implements SSLSession { * Record a new session, using a given cipher spec and session ID. */ SSLSessionImpl(ProtocolVersion protocolVersion, CipherSuite cipherSuite, + Collection algorithms, SessionId id, String host, int port) { this.protocolVersion = protocolVersion; sessionId = id; @@ -161,9 +169,11 @@ final class SSLSessionImpl implements SSLSession { this.host = host; this.port = port; sessionCount = ++counter; + localSupportedSignAlgs = + SignatureAndHashAlgorithm.getAlgorithmNames(algorithms); if (debug != null && Debug.isOn("session")) { - System.out.println("%% Created: " + this); + System.out.println("%% Initialized: " + this); } } @@ -196,6 +206,12 @@ final class SSLSessionImpl implements SSLSession { localPrivateKey = privateKey; } + void setPeerSupportedSignatureAlgorithms( + Collection algorithms) { + peerSupportedSignAlgs = + SignatureAndHashAlgorithm.getAlgorithmNames(algorithms); + } + /** * Set the peer principal. */ @@ -292,6 +308,17 @@ final class SSLSessionImpl implements SSLSession { return cipherSuite; } + /** + * Resets the cipher spec in use on this session + */ + void setSuite(CipherSuite suite) { + cipherSuite = suite; + + if (debug != null && Debug.isOn("session")) { + System.out.println("%% Negotiating: " + this); + } + } + /** * Returns the name of the cipher suite in use on this session */ @@ -591,8 +618,7 @@ final class SSLSessionImpl implements SSLSession { * key and the calling security context. This is important since * sessions can be shared across different protection domains. */ - private Hashtable table = - new Hashtable(); + private Hashtable table = new Hashtable<>(); /** * Assigns a session value. Session change events are given if @@ -660,7 +686,7 @@ final class SSLSessionImpl implements SSLSession { */ public String[] getValueNames() { Enumeration e; - Vector v = new Vector(); + Vector v = new Vector<>(); SecureKey key; Object securityCtx = SecureKey.getCurrentSecurityContext(); @@ -718,6 +744,30 @@ final class SSLSessionImpl implements SSLSession { return getPacketBufferSize() - Record.headerSize; } + /** + * Gets an array of supported signature algorithms that the local side is + * willing to verify. + */ + public String[] getLocalSupportedSignatureAlgorithms() { + if (localSupportedSignAlgs != null) { + return localSupportedSignAlgs.clone(); + } + + return new String[0]; + } + + /** + * Gets an array of supported signature algorithms that the peer is + * able to verify. + */ + public String[] getPeerSupportedSignatureAlgorithms() { + if (peerSupportedSignAlgs != null) { + return peerSupportedSignAlgs.clone(); + } + + return new String[0]; + } + /** Returns a string representation of this SSL session */ public String toString() { return "[Session-" + sessionCount diff --git a/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java b/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java index a360fe7a2aa..010f4cbce9a 100644 --- a/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java @@ -32,6 +32,7 @@ import java.security.GeneralSecurityException; import java.security.AccessController; import java.security.AccessControlContext; import java.security.PrivilegedAction; +import java.security.AlgorithmConstraints; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.ReentrantLock; @@ -194,15 +195,27 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { */ private byte doClientAuth; private boolean roleIsServer; - private CipherSuiteList enabledCipherSuites; private boolean enableSessionCreation = true; private String host; private boolean autoClose = true; private AccessControlContext acc; - // hostname identification algorithm, the hostname identification is - // disabled by default. - private String identificationAlg = null; + /* + * We cannot use the hostname resolved from name services. For + * virtual hosting, multiple hostnames may be bound to the same IP + * address, so the hostname resolved from name services is not + * reliable. + */ + private String rawHostname; + + // The cipher suites enabled for use on this connection. + private CipherSuiteList enabledCipherSuites; + + // The endpoint identification protocol + private String identificationProtocol = null; + + // The cryptographic algorithm constraints + private AlgorithmConstraints algorithmConstraints = null; /* * READ ME * READ ME * READ ME * READ ME * READ ME * READ ME * @@ -312,8 +325,9 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { * is associated with a session at the same time. (TLS/IETF may * change that to add client authentication w/o new key exchg.) */ - private SSLSessionImpl sess; - private Handshaker handshaker; + private Handshaker handshaker; + private SSLSessionImpl sess; + private volatile SSLSessionImpl handshakeSession; /* @@ -341,11 +355,11 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { private AppOutputStream output; /* - * The protocols we support are SSL Version 3.0) and - * TLS (version 3.1). - * In addition we support a pseudo protocol called - * SSLv2Hello which when set will result in an SSL v2 Hello - * being sent with SSLv3 or TLSv1 version info. + * The protocol versions enabled for use on this connection. + * + * Note: we support a pseudo protocol called SSLv2Hello which when + * set will result in an SSL v2 Hello being sent with SSL (version 3.0) + * or TLS (version 3.1, 3.2, etc.) version info. */ private ProtocolList enabledProtocols; @@ -374,6 +388,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { throws IOException, UnknownHostException { super(); this.host = host; + this.rawHostname = host; init(context, false); SocketAddress socketAddress = host != null ? new InetSocketAddress(host, port) : @@ -416,6 +431,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { throws IOException, UnknownHostException { super(); this.host = host; + this.rawHostname = host; init(context, false); bind(new InetSocketAddress(localAddr, localPort)); SocketAddress socketAddress = @@ -455,11 +471,15 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { */ SSLSocketImpl(SSLContextImpl context, boolean serverMode, CipherSuiteList suites, byte clientAuth, - boolean sessionCreation, ProtocolList protocols) - throws IOException { + boolean sessionCreation, ProtocolList protocols, + String identificationProtocol, + AlgorithmConstraints algorithmConstraints) throws IOException { + super(); doClientAuth = clientAuth; enableSessionCreation = sessionCreation; + this.identificationProtocol = identificationProtocol; + this.algorithmConstraints = algorithmConstraints; init(context, serverMode); /* @@ -506,6 +526,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { throw new SocketException("Underlying socket is not connected"); } this.host = host; + this.rawHostname = host; init(context, false); this.autoClose = autoClose; doneConnect(); @@ -517,6 +538,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { private void init(SSLContextImpl context, boolean isServer) { sslContext = context; sess = SSLSessionImpl.nullSession; + handshakeSession = null; /* * role is as specified, state is START until after @@ -541,7 +563,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { serverVerifyData = new byte[0]; enabledCipherSuites = CipherSuiteList.getDefault(); - enabledProtocols = ProtocolList.getDefault(); + enabledProtocols = ProtocolList.getDefault(roleIsServer); inrec = null; // save the acc @@ -764,6 +786,21 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { r.addMAC(writeMAC); r.encrypt(writeCipher); r.write(sockOutput); + + /* + * Check the sequence number state + * + * Note that in order to maintain the connection I/O + * properly, we check the sequence number after the last + * record writing process. As we request renegotiation + * or close the connection for wrapped sequence number + * when there is enough sequence number space left to + * handle a few more records, so the sequence number + * of the last record cannot be wrapped. + */ + if (connectionState < cs_ERROR) { + checkSequenceNumber(writeMAC, r.contentType()); + } } @@ -883,6 +920,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { } } + // if (!r.decompress(c)) // fatal(Alerts.alert_decompression_failure, // "decompression failure"); @@ -905,6 +943,15 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { * in it. */ initHandshaker(); + if (!handshaker.activated()) { + // prior to handshaking, activate the handshake + if (connectionState == cs_RENEGOTIATE) { + // don't use SSLv2Hello when renegotiating + handshaker.activate(protocolVersion); + } else { + handshaker.activate(null); + } + } /* * process the handshake record ... may contain just @@ -930,6 +977,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { serverVerifyData = handshaker.getServerVerifyData(); sess = handshaker.getSession(); + handshakeSession = null; handshaker = null; connectionState = cs_DATA; @@ -949,9 +997,8 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { if (needAppData || connectionState != cs_DATA) { continue; - } else { - return; } + break; case Record.ct_application_data: // Pass this right back up to the application. @@ -971,7 +1018,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { } r.setAppDataValid(true); - return; + break; case Record.ct_alert: recvAlert(r); @@ -1010,6 +1057,23 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { } continue; } // switch + + /* + * Check the sequence number state + * + * Note that in order to maintain the connection I/O + * properly, we check the sequence number after the last + * record reading process. As we request renegotiation + * or close the connection for wrapped sequence number + * when there is enough sequence number space left to + * handle a few more records, so the sequence number + * of the last record cannot be wrapped. + */ + if (connectionState < cs_ERROR) { + checkSequenceNumber(readMAC, r.contentType()); + } + + return; } // synchronized (this) } @@ -1021,6 +1085,61 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { } // synchronized (readLock) } + /** + * Check the sequence number state + * + * RFC 4346 states that, "Sequence numbers are of type uint64 and + * may not exceed 2^64-1. Sequence numbers do not wrap. If a TLS + * implementation would need to wrap a sequence number, it must + * renegotiate instead." + */ + private void checkSequenceNumber(MAC mac, byte type) + throws IOException { + + /* + * Don't bother to check the sequence number for error or + * closed connections, or NULL MAC. + */ + if (connectionState >= cs_ERROR || mac == MAC.NULL) { + return; + } + + /* + * Conservatively, close the connection immediately when the + * sequence number is close to overflow + */ + if (mac.seqNumOverflow()) { + /* + * TLS protocols do not define a error alert for sequence + * number overflow. We use handshake_failure error alert + * for handshaking and bad_record_mac for other records. + */ + if (debug != null && Debug.isOn("ssl")) { + System.out.println(threadName() + + ", sequence number extremely close to overflow " + + "(2^64-1 packets). Closing connection."); + + } + + fatal(Alerts.alert_handshake_failure, "sequence number overflow"); + } + + /* + * Ask for renegotiation when need to renew sequence number. + * + * Don't bother to kickstart the renegotiation when the local is + * asking for it. + */ + if ((type != Record.ct_handshake) && mac.seqNumIsHuge()) { + if (debug != null && Debug.isOn("ssl")) { + System.out.println(threadName() + ", request renegotiation " + + "to avoid sequence number overflow"); + } + + startHandshake(); + } + } + // // HANDSHAKE RELATED CODE // @@ -1033,28 +1152,10 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { } /** - * Initialize and get the server handshaker. Used by SSLServerSocketImpl - * for the ciphersuite availability test *only*. + * Return the AppOutputStream. For use by Handshaker only. */ - ServerHandshaker getServerHandshaker() throws SSLException { - initHandshaker(); - - // The connection state would have been set to cs_HANDSHAKE during the - // handshaking initializing, however the caller may not have the - // the low level connection's established, which is not consistent with - // the HANDSHAKE state. As if it is unconnected, we need to reset the - // connection state to cs_START. - if (!isConnected()) { - connectionState = cs_START; - } - - // Make sure that we get a ServerHandshaker. - // This should never happen. - if (!(handshaker instanceof ServerHandshaker)) { - throw new SSLProtocolException("unexpected handshaker instance"); - } - - return (ServerHandshaker)handshaker; + AppOutputStream getAppOutputStream() { + return output; } /** @@ -1066,8 +1167,8 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { * . if the socket is already closed, throw an Exception (internal error) * * . otherwise (cs_START or cs_DATA), create the appropriate handshaker - * object, initialize it, and advance the connection state (to - * cs_HANDSHAKE or cs_RENEGOTIATE, respectively). + * object, and advance the connection state (to cs_HANDSHAKE or + * cs_RENEGOTIATE, respectively). * * This method is called right after a new socket is created, when * starting renegotiation, or when changing client/ server mode of the @@ -1115,12 +1216,8 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { protocolVersion, connectionState == cs_HANDSHAKE, secureRenegotiation, clientVerifyData, serverVerifyData); } - handshaker.enabledCipherSuites = enabledCipherSuites; + handshaker.setEnabledCipherSuites(enabledCipherSuites); handshaker.setEnableSessionCreation(enableSessionCreation); - if (connectionState == cs_RENEGOTIATE) { - // don't use SSLv2Hello when renegotiating - handshaker.output.r.setHelloVersion(protocolVersion); - } } /** @@ -1135,6 +1232,8 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { // one thread performs the handshake synchronized (handshakeLock) { if (getConnectionState() == cs_HANDSHAKE) { + kickstartHandshake(); + /* * All initial handshaking goes through this * InputRecord until we have a valid SSL connection. @@ -1157,7 +1256,6 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { inrec.enableFormatChecks(); } - kickstartHandshake(); readRecord(inrec, false); inrec = null; } @@ -1211,6 +1309,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { * on servers when renegotiating). */ private synchronized void kickstartHandshake() throws IOException { + switch (connectionState) { case cs_HANDSHAKE: @@ -1257,7 +1356,15 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { // to its HandshakeOutStream, which calls back into // SSLSocketImpl.writeRecord() to send it. // - if (!handshaker.started()) { + if (!handshaker.activated()) { + // prior to handshaking, activate the handshake + if (connectionState == cs_RENEGOTIATE) { + // don't use SSLv2Hello when renegotiating + handshaker.activate(protocolVersion); + } else { + handshaker.activate(null); + } + if (handshaker instanceof ClientHandshaker) { // send client hello handshaker.kickstart(); @@ -1646,6 +1753,9 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { input.r.close(); } sess.invalidate(); + if (handshakeSession != null) { + handshakeSession.invalidate(); + } int oldState = connectionState; connectionState = cs_ERROR; @@ -1752,10 +1862,18 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { * Emit alerts. Caller must have synchronized with "this". */ private void sendAlert(byte level, byte description) { + // the connectionState cannot be cs_START if (connectionState >= cs_SENT_CLOSE) { return; } + // For initial handshaking, don't send alert message to peer if + // handshaker has not started. + if (connectionState == cs_HANDSHAKE && + (handshaker == null || !handshaker.started())) { + return; + } + OutputRecord r = new OutputRecord(Record.ct_alert); r.setVersion(protocolVersion); @@ -1878,9 +1996,14 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { return host; } + synchronized String getRawHostname() { + return rawHostname; + } + // ONLY used by HttpsClient to setup the URI specified hostname synchronized public void setHost(String host) { this.host = host; + this.rawHostname = host; } /** @@ -1951,6 +2074,15 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { } } + @Override + synchronized public SSLSession getHandshakeSession() { + return handshakeSession; + } + + synchronized void setHandshakeSession(SSLSessionImpl session) { + handshakeSession = session; + } + /** * Controls whether new connections may cause creation of new SSL * sessions. @@ -1962,7 +2094,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { synchronized public void setEnableSessionCreation(boolean flag) { enableSessionCreation = flag; - if ((handshaker != null) && !handshaker.started()) { + if ((handshaker != null) && !handshaker.activated()) { handshaker.setEnableSessionCreation(enableSessionCreation); } } @@ -1990,7 +2122,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { if ((handshaker != null) && (handshaker instanceof ServerHandshaker) && - !handshaker.started()) { + !handshaker.activated()) { ((ServerHandshaker) handshaker).setClientAuth(doClientAuth); } } @@ -2013,7 +2145,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { if ((handshaker != null) && (handshaker instanceof ServerHandshaker) && - !handshaker.started()) { + !handshaker.activated()) { ((ServerHandshaker) handshaker).setClientAuth(doClientAuth); } } @@ -2032,6 +2164,15 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { switch (connectionState) { case cs_START: + /* + * If we need to change the socket mode and the enabled + * protocols haven't specifically been set by the user, + * change them to the corresponding default ones. + */ + if (roleIsServer != (!flag) && + ProtocolList.isDefaultProtocolList(enabledProtocols)) { + enabledProtocols = ProtocolList.getDefault(!flag); + } roleIsServer = !flag; break; @@ -2044,7 +2185,16 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { * have the streams. */ assert(handshaker != null); - if (!handshaker.started()) { + if (!handshaker.activated()) { + /* + * If we need to change the socket mode and the enabled + * protocols haven't specifically been set by the user, + * change them to the corresponding default ones. + */ + if (roleIsServer != (!flag) && + ProtocolList.isDefaultProtocolList(enabledProtocols)) { + enabledProtocols = ProtocolList.getDefault(!flag); + } roleIsServer = !flag; connectionState = cs_START; initHandshaker(); @@ -2095,8 +2245,8 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { */ synchronized public void setEnabledCipherSuites(String[] suites) { enabledCipherSuites = new CipherSuiteList(suites); - if ((handshaker != null) && !handshaker.started()) { - handshaker.enabledCipherSuites = enabledCipherSuites; + if ((handshaker != null) && !handshaker.activated()) { + handshaker.setEnabledCipherSuites(enabledCipherSuites); } } @@ -2118,7 +2268,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { /** * Returns the protocols that are supported by this implementation. * A subset of the supported protocols may be enabled for this connection - * @ returns an array of protocol names. + * @return an array of protocol names. */ public String[] getSupportedProtocols() { return ProtocolList.getSupported().toStringArray(); @@ -2135,7 +2285,7 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { */ synchronized public void setEnabledProtocols(String[] protocols) { enabledProtocols = new ProtocolList(protocols); - if ((handshaker != null) && !handshaker.started()) { + if ((handshaker != null) && !handshaker.activated()) { handshaker.setEnabledProtocols(enabledProtocols); } } @@ -2194,28 +2344,31 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { } /** - * Try to configure the endpoint identification algorithm of the socket. - * - * @param identificationAlgorithm the algorithm used to check the - * endpoint identity. - * @return true if the identification algorithm configuration success. + * Returns the SSLParameters in effect for this SSLSocket. */ - synchronized public boolean trySetHostnameVerification( - String identificationAlgorithm) { - if (sslContext.getX509TrustManager() instanceof - X509ExtendedTrustManager) { - this.identificationAlg = identificationAlgorithm; - return true; - } else { - return false; - } + synchronized public SSLParameters getSSLParameters() { + SSLParameters params = super.getSSLParameters(); + + // the super implementation does not handle the following parameters + params.setEndpointIdentificationAlgorithm(identificationProtocol); + params.setAlgorithmConstraints(algorithmConstraints); + + return params; } /** - * Returns the endpoint identification algorithm of the socket. + * Applies SSLParameters to this socket. */ - synchronized public String getHostnameVerification() { - return identificationAlg; + synchronized public void setSSLParameters(SSLParameters params) { + super.setSSLParameters(params); + + // the super implementation does not handle the following parameters + identificationProtocol = params.getEndpointIdentificationAlgorithm(); + algorithmConstraints = params.getAlgorithmConstraints(); + if ((handshaker != null) && !handshaker.started()) { + handshaker.setIdentificationProtocol(identificationProtocol); + handshaker.setAlgorithmConstraints(algorithmConstraints); + } } // diff --git a/jdk/src/share/classes/sun/security/ssl/ServerHandshaker.java b/jdk/src/share/classes/sun/security/ssl/ServerHandshaker.java index 5d70c749227..ff1c8d7d5c9 100644 --- a/jdk/src/share/classes/sun/security/ssl/ServerHandshaker.java +++ b/jdk/src/share/classes/sun/security/ssl/ServerHandshaker.java @@ -40,10 +40,9 @@ import javax.net.ssl.*; import javax.security.auth.Subject; -import com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager; - import sun.security.ssl.HandshakeMessage.*; import sun.security.ssl.CipherSuite.*; +import sun.security.ssl.SignatureAndHashAlgorithm.*; import static sun.security.ssl.CipherSuite.*; import static sun.security.ssl.CipherSuite.KeyExchange.*; @@ -92,6 +91,9 @@ final class ServerHandshaker extends Handshaker { private SupportedEllipticCurvesExtension supportedCurves; + // the preferable signature algorithm used by ServerKeyExchange message + SignatureAndHashAlgorithm preferableSignatureAlgorithm; + /* * Constructor ... use the keys found in the auth context. */ @@ -185,8 +187,10 @@ final class ServerHandshaker extends Handshaker { * temporary one used for non-export or signing-only * certificates/keys. */ - RSAClientKeyExchange pms = new RSAClientKeyExchange - (protocolVersion, input, message_len, privateKey); + RSAClientKeyExchange pms = new RSAClientKeyExchange( + protocolVersion, clientRequestedVersion, + sslContext.getSecureRandom(), input, + message_len, privateKey); preMasterSecret = this.clientKeyExchange(pms); break; case K_KRB5: @@ -231,11 +235,13 @@ final class ServerHandshaker extends Handshaker { break; case HandshakeMessage.ht_certificate_verify: - this.clientCertificateVerify(new CertificateVerify(input)); + this.clientCertificateVerify(new CertificateVerify(input, + localSupportedSignAlgs, protocolVersion)); break; case HandshakeMessage.ht_finished: - this.clientFinished(new Finished(protocolVersion, input)); + this.clientFinished( + new Finished(protocolVersion, input, cipherSuite)); break; default: @@ -408,21 +414,17 @@ final class ServerHandshaker extends Handshaker { clientRequestedVersion = mesg.protocolVersion; - // check if clientVersion is recent enough for us - if (clientRequestedVersion.v < enabledProtocols.min.v) { + // select a proper protocol version. + ProtocolVersion selectedVersion = + selectProtocolVersion(clientRequestedVersion); + if (selectedVersion == null || + selectedVersion.v == ProtocolVersion.SSL20Hello.v) { fatalSE(Alerts.alert_handshake_failure, "Client requested protocol " + clientRequestedVersion + - " not enabled or not supported"); + " not enabled or not supported"); } - // now we know we have an acceptable version - // use the lower of our max and the client requested version - ProtocolVersion selectedVersion; - if (clientRequestedVersion.v <= enabledProtocols.max.v) { - selectedVersion = clientRequestedVersion; - } else { - selectedVersion = enabledProtocols.max; - } + handshakeHash.protocolDetermined(selectedVersion); setVersion(selectedVersion); m1.protocolVersion = protocolVersion; @@ -566,14 +568,71 @@ final class ServerHandshaker extends Handshaker { if (!enableNewSession) { throw new SSLException("Client did not resume a session"); } + supportedCurves = (SupportedEllipticCurvesExtension) mesg.extensions.get(ExtensionType.EXT_ELLIPTIC_CURVES); + + // We only need to handle the "signature_algorithm" extension + // for full handshakes and TLS 1.2 or later. + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + SignatureAlgorithmsExtension signAlgs = + (SignatureAlgorithmsExtension)mesg.extensions.get( + ExtensionType.EXT_SIGNATURE_ALGORITHMS); + if (signAlgs != null) { + Collection peerSignAlgs = + signAlgs.getSignAlgorithms(); + if (peerSignAlgs == null || peerSignAlgs.isEmpty()) { + throw new SSLHandshakeException( + "No peer supported signature algorithms"); + } + + Collection + supportedPeerSignAlgs = + SignatureAndHashAlgorithm.getSupportedAlgorithms( + peerSignAlgs); + if (supportedPeerSignAlgs.isEmpty()) { + throw new SSLHandshakeException( + "No supported signature and hash algorithm " + + "in common"); + } + + setPeerSupportedSignAlgs(supportedPeerSignAlgs); + } // else, need to use peer implicit supported signature algs + } + + session = new SSLSessionImpl(protocolVersion, CipherSuite.C_NULL, + getLocalSupportedSignAlgs(), + sslContext.getSecureRandom(), + getHostAddressSE(), getPortSE()); + + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + if (peerSupportedSignAlgs != null) { + session.setPeerSupportedSignatureAlgorithms( + peerSupportedSignAlgs); + } // else, we will set the implicit peer supported signature + // algorithms in chooseCipherSuite() + } + + // set the handshake session + setHandshakeSessionSE(session); + + // choose cipher suite and corresponding private key chooseCipherSuite(mesg); - session = new SSLSessionImpl(protocolVersion, cipherSuite, - sslContext.getSecureRandom(), - getHostAddressSE(), getPortSE()); + + session.setSuite(cipherSuite); session.setLocalPrivateKey(privateKey); + // chooseCompression(mesg); + } else { + // set the handshake session + setHandshakeSessionSE(session); + } + + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + if (resumingSession) { + handshakeHash.setCertificateVerifyAlg(null); + } + handshakeHash.setFinishedAlg(cipherSuite.prfAlg.getPRFHashAlg()); } m1.cipherSuite = cipherSuite; @@ -693,14 +752,16 @@ final class ServerHandshaker extends Handshaker { privateKey, clnt_random.random_bytes, svr_random.random_bytes, - sslContext.getSecureRandom()); + sslContext.getSecureRandom(), + preferableSignatureAlgorithm, + protocolVersion); } catch (GeneralSecurityException e) { throwSSLException("Error generating DH server key exchange", e); m3 = null; // make compiler happy } break; case K_DH_ANON: - m3 = new DH_ServerKeyExchange(dh); + m3 = new DH_ServerKeyExchange(dh, protocolVersion); break; case K_ECDHE_RSA: case K_ECDHE_ECDSA: @@ -710,9 +771,12 @@ final class ServerHandshaker extends Handshaker { privateKey, clnt_random.random_bytes, svr_random.random_bytes, - sslContext.getSecureRandom()); + sslContext.getSecureRandom(), + preferableSignatureAlgorithm, + protocolVersion); } catch (GeneralSecurityException e) { - throwSSLException("Error generating ECDH server key exchange", e); + throwSSLException( + "Error generating ECDH server key exchange", e); m3 = null; // make compiler happy } break; @@ -741,21 +805,48 @@ final class ServerHandshaker extends Handshaker { // Needed only if server requires client to authenticate self. // Illegal for anonymous flavors, so we need to check that. // - if (keyExchange == K_KRB5 || keyExchange == K_KRB5_EXPORT) { - // CertificateRequest is omitted for Kerberos ciphers + // CertificateRequest is omitted for Kerberos ciphers + if (doClientAuth != SSLEngineImpl.clauth_none && + keyExchange != K_DH_ANON && keyExchange != K_ECDH_ANON && + keyExchange != K_KRB5 && keyExchange != K_KRB5_EXPORT) { - } else if (doClientAuth != SSLEngineImpl.clauth_none && - keyExchange != K_DH_ANON && keyExchange != K_ECDH_ANON) { CertificateRequest m4; X509Certificate caCerts[]; + Collection localSignAlgs = null; + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + // We currently use all local upported signature and hash + // algorithms. However, to minimize the computation cost + // of requested hash algorithms, we may use a restricted + // set of signature algorithms in the future. + localSignAlgs = getLocalSupportedSignAlgs(); + if (localSignAlgs.isEmpty()) { + throw new SSLHandshakeException( + "No supported signature algorithm"); + } + + Set localHashAlgs = + SignatureAndHashAlgorithm.getHashAlgorithmNames( + localSignAlgs); + if (localHashAlgs.isEmpty()) { + throw new SSLHandshakeException( + "No supported signature algorithm"); + } + handshakeHash.restrictCertificateVerifyAlgs(localHashAlgs); + } + caCerts = sslContext.getX509TrustManager().getAcceptedIssuers(); - m4 = new CertificateRequest(caCerts, keyExchange); + m4 = new CertificateRequest(caCerts, keyExchange, + localSignAlgs, protocolVersion); if (debug != null && Debug.isOn("handshake")) { m4.print(System.out); } m4.write(output); + } else { + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + handshakeHash.setCertificateVerifyAlg(null); + } } /* @@ -813,8 +904,7 @@ final class ServerHandshaker extends Handshaker { * method should only be called if you really want to use the * CipherSuite. * - * This method is called from chooseCipherSuite() in this class - * and SSLServerSocketImpl.checkEnabledSuites() (as a sanity check). + * This method is called from chooseCipherSuite() in this class. */ boolean trySetCipherSuite(CipherSuite suite) { /* @@ -831,6 +921,16 @@ final class ServerHandshaker extends Handshaker { return false; } + // must not negotiate the obsoleted weak cipher suites. + if (protocolVersion.v >= suite.obsoleted) { + return false; + } + + // must not negotiate unsupported cipher suites. + if (protocolVersion.v < suite.supported) { + return false; + } + KeyExchange keyExchange = suite.keyExchange; // null out any existing references @@ -840,36 +940,136 @@ final class ServerHandshaker extends Handshaker { tempPrivateKey = null; tempPublicKey = null; + Collection supportedSignAlgs = null; + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + if (peerSupportedSignAlgs != null) { + supportedSignAlgs = peerSupportedSignAlgs; + } else { + SignatureAndHashAlgorithm algorithm = null; + + // we may optimize the performance + switch (keyExchange) { + // If the negotiated key exchange algorithm is one of + // (RSA, DHE_RSA, DH_RSA, RSA_PSK, ECDH_RSA, ECDHE_RSA), + // behave as if client had sent the value {sha1,rsa}. + case K_RSA: + case K_DHE_RSA: + case K_DH_RSA: + // case K_RSA_PSK: + case K_ECDH_RSA: + case K_ECDHE_RSA: + algorithm = SignatureAndHashAlgorithm.valueOf( + HashAlgorithm.SHA1.value, + SignatureAlgorithm.RSA.value, 0); + break; + // If the negotiated key exchange algorithm is one of + // (DHE_DSS, DH_DSS), behave as if the client had + // sent the value {sha1,dsa}. + case K_DHE_DSS: + case K_DH_DSS: + algorithm = SignatureAndHashAlgorithm.valueOf( + HashAlgorithm.SHA1.value, + SignatureAlgorithm.DSA.value, 0); + break; + // If the negotiated key exchange algorithm is one of + // (ECDH_ECDSA, ECDHE_ECDSA), behave as if the client + // had sent value {sha1,ecdsa}. + case K_ECDH_ECDSA: + case K_ECDHE_ECDSA: + algorithm = SignatureAndHashAlgorithm.valueOf( + HashAlgorithm.SHA1.value, + SignatureAlgorithm.ECDSA.value, 0); + break; + default: + // no peer supported signature algorithms + } + + if (algorithm == null) { + supportedSignAlgs = + Collections.emptySet(); + } else { + supportedSignAlgs = + new ArrayList(1); + supportedSignAlgs.add(algorithm); + } + + // Sets the peer supported signature algorithm to use in KM + // temporarily. + session.setPeerSupportedSignatureAlgorithms(supportedSignAlgs); + } + } + switch (keyExchange) { case K_RSA: + // need RSA certs for authentication + if (setupPrivateKeyAndChain("RSA") == false) { + return false; + } + break; case K_RSA_EXPORT: - case K_DHE_RSA: - case K_ECDHE_RSA: // need RSA certs for authentication if (setupPrivateKeyAndChain("RSA") == false) { return false; } - if (keyExchange == K_RSA_EXPORT) { - try { - if (JsseJce.getRSAKeyLength(certs[0].getPublicKey()) > 512) { - if (!setupEphemeralRSAKeys(suite.exportable)) { - return false; - } - } - } catch (RuntimeException e) { - // could not determine keylength, ignore key + try { + if (JsseJce.getRSAKeyLength(certs[0].getPublicKey()) > 512) { + if (!setupEphemeralRSAKeys(suite.exportable)) { + return false; + } + } + } catch (RuntimeException e) { + // could not determine keylength, ignore key + return false; + } + break; + case K_DHE_RSA: + // get preferable peer signature algorithm for server key exchange + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + preferableSignatureAlgorithm = + SignatureAndHashAlgorithm.getPreferableAlgorithm( + supportedSignAlgs, "RSA"); + if (preferableSignatureAlgorithm == null) { return false; } - } else if (keyExchange == K_DHE_RSA) { - setupEphemeralDHKeys(suite.exportable); - } else if (keyExchange == K_ECDHE_RSA) { - if (setupEphemeralECDHKeys() == false) { + } + + // need RSA certs for authentication + if (setupPrivateKeyAndChain("RSA") == false) { + return false; + } + setupEphemeralDHKeys(suite.exportable); + break; + case K_ECDHE_RSA: + // get preferable peer signature algorithm for server key exchange + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + preferableSignatureAlgorithm = + SignatureAndHashAlgorithm.getPreferableAlgorithm( + supportedSignAlgs, "RSA"); + if (preferableSignatureAlgorithm == null) { return false; } - } // else nothing more to do for K_RSA + } + + // need RSA certs for authentication + if (setupPrivateKeyAndChain("RSA") == false) { + return false; + } + if (setupEphemeralECDHKeys() == false) { + return false; + } break; case K_DHE_DSS: + // get preferable peer signature algorithm for server key exchange + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + preferableSignatureAlgorithm = + SignatureAndHashAlgorithm.getPreferableAlgorithm( + supportedSignAlgs, "DSA"); + if (preferableSignatureAlgorithm == null) { + return false; + } + } + // need DSS certs for authentication if (setupPrivateKeyAndChain("DSA") == false) { return false; @@ -877,6 +1077,16 @@ final class ServerHandshaker extends Handshaker { setupEphemeralDHKeys(suite.exportable); break; case K_ECDHE_ECDSA: + // get preferable peer signature algorithm for server key exchange + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + preferableSignatureAlgorithm = + SignatureAndHashAlgorithm.getPreferableAlgorithm( + supportedSignAlgs, "ECDSA"); + if (preferableSignatureAlgorithm == null) { + return false; + } + } + // need EC cert signed using EC if (setupPrivateKeyAndChain("EC_EC") == false) { return false; @@ -921,6 +1131,14 @@ final class ServerHandshaker extends Handshaker { throw new RuntimeException("Unrecognized cipherSuite: " + suite); } setCipherSuite(suite); + + // set the peer implicit supported signature algorithms + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + if (peerSupportedSignAlgs == null) { + setPeerSupportedSignAlgs(supportedSignAlgs); + // we had alreay update the session + } + } return true; } @@ -1170,6 +1388,24 @@ final class ServerHandshaker extends Handshaker { mesg.print(System.out); } + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + SignatureAndHashAlgorithm signAlg = + mesg.getPreferableSignatureAlgorithm(); + if (signAlg == null) { + throw new SSLHandshakeException( + "Illegal CertificateVerify message"); + } + + String hashAlg = + SignatureAndHashAlgorithm.getHashAlgorithmName(signAlg); + if (hashAlg == null || hashAlg.length() == 0) { + throw new SSLHandshakeException( + "No supported hash algorithm"); + } + + handshakeHash.setCertificateVerifyAlg(hashAlg); + } + try { PublicKey publicKey = session.getPeerCertificates()[0].getPublicKey(); @@ -1225,8 +1461,8 @@ final class ServerHandshaker extends Handshaker { * Verify the client's message with the "before" digest of messages, * and forget about continuing to use that digest. */ - boolean verified = mesg.verify(protocolVersion, handshakeHash, - Finished.CLIENT, session.getMasterSecret()); + boolean verified = mesg.verify(handshakeHash, Finished.CLIENT, + session.getMasterSecret()); if (!verified) { fatalSE(Alerts.alert_handshake_failure, @@ -1281,7 +1517,7 @@ final class ServerHandshaker extends Handshaker { output.flush(); Finished mesg = new Finished(protocolVersion, handshakeHash, - Finished.SERVER, session.getMasterSecret()); + Finished.SERVER, session.getMasterSecret(), cipherSuite); /* * Send the change_cipher_spec record; then our Finished handshake @@ -1351,7 +1587,8 @@ final class ServerHandshaker extends Handshaker { * ServerKeyExchange) message that was sent to it by the server. That's * decrypted using the private key before we get here. */ - private SecretKey clientKeyExchange(RSAClientKeyExchange mesg) throws IOException { + private SecretKey clientKeyExchange(RSAClientKeyExchange mesg) + throws IOException { if (debug != null && Debug.isOn("handshake")) { mesg.print(System.out); @@ -1379,6 +1616,11 @@ final class ServerHandshaker extends Handshaker { * not *REQUIRED*, this is an acceptable condition.) */ if (doClientAuth == SSLEngineImpl.clauth_requested) { + // Smart (aka stupid) to forecast that no CertificateVerify + // message will be received. + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + handshakeHash.setCertificateVerifyAlg(null); + } return; } else { fatalSE(Alerts.alert_bad_certificate, @@ -1405,26 +1647,23 @@ final class ServerHandshaker extends Handshaker { authType = "UNKNOWN"; } - String identificator = getHostnameVerificationSE(); if (tm instanceof X509ExtendedTrustManager) { - ((X509ExtendedTrustManager)tm).checkClientTrusted( - (peerCerts != null ? - peerCerts.clone() : - null), + if (conn != null) { + ((X509ExtendedTrustManager)tm).checkClientTrusted( + peerCerts.clone(), authType, - getHostSE(), - identificator); - } else { - if (identificator != null) { - throw new RuntimeException( - "trust manager does not support peer identification"); + conn); + } else { + ((X509ExtendedTrustManager)tm).checkClientTrusted( + peerCerts.clone(), + authType, + engine); } - - tm.checkClientTrusted( - (peerCerts != null ? - peerCerts.clone() : - peerCerts), - authType); + } else { + // Unlikely to happen, because we have wrapped the old + // X509TrustManager with the new X509ExtendedTrustManager. + throw new CertificateException( + "Improper X509TrustManager implementation"); } } catch (CertificateException e) { // This will throw an exception, so include the original error. diff --git a/jdk/src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java b/jdk/src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java new file mode 100644 index 00000000000..4b1dee8f682 --- /dev/null +++ b/jdk/src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java @@ -0,0 +1,387 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.security.AlgorithmConstraints; +import java.security.CryptoPrimitive; + +import java.util.Set; +import java.util.HashSet; +import java.util.Map; +import java.util.EnumSet; +import java.util.TreeMap; +import java.util.Collection; +import java.util.Collections; +import java.util.ArrayList; + +/** + * Signature and hash algorithm. + * + * [RFC5246] The client uses the "signature_algorithms" extension to + * indicate to the server which signature/hash algorithm pairs may be + * used in digital signatures. The "extension_data" field of this + * extension contains a "supported_signature_algorithms" value. + * + * enum { + * none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5), + * sha512(6), (255) + * } HashAlgorithm; + * + * enum { anonymous(0), rsa(1), dsa(2), ecdsa(3), (255) } + * SignatureAlgorithm; + * + * struct { + * HashAlgorithm hash; + * SignatureAlgorithm signature; + * } SignatureAndHashAlgorithm; + */ +final class SignatureAndHashAlgorithm { + + // minimum priority for default enabled algorithms + final static int SUPPORTED_ALG_PRIORITY_MAX_NUM = 0x00F0; + + // performance optimization + private final static Set SIGNATURE_PRIMITIVE_SET = + EnumSet.of(CryptoPrimitive.SIGNATURE); + + // supported pairs of signature and hash algorithm + private final static Map supportedMap; + private final static Map priorityMap; + + // the hash algorithm + private HashAlgorithm hash; + + // the signature algorithm + private SignatureAlgorithm signature; + + // id in 16 bit MSB format, i.e. 0x0603 for SHA512withECDSA + private int id; + + // the standard algorithm name, for example "SHA512withECDSA" + private String algorithm; + + // Priority for the preference order. The lower the better. + // + // If the algorithm is unsupported, its priority should be bigger + // than SUPPORTED_ALG_PRIORITY_MAX_NUM. + private int priority; + + // constructor for supported algorithm + private SignatureAndHashAlgorithm(HashAlgorithm hash, + SignatureAlgorithm signature, String algorithm, int priority) { + this.hash = hash; + this.signature = signature; + this.algorithm = algorithm; + this.id = ((hash.value & 0xFF) << 8) | (signature.value & 0xFF); + this.priority = priority; + } + + // constructor for unsupported algorithm + private SignatureAndHashAlgorithm(String algorithm, int id, int sequence) { + this.hash = HashAlgorithm.valueOf((id >> 8) & 0xFF); + this.signature = SignatureAlgorithm.valueOf(id & 0xFF); + this.algorithm = algorithm; + this.id = id; + + // add one more to the sequece number, in case that the number is zero + this.priority = SUPPORTED_ALG_PRIORITY_MAX_NUM + sequence + 1; + } + + // Note that we do not use the sequence argument for supported algorithms, + // so please don't sort by comparing the objects read from handshake + // messages. + static SignatureAndHashAlgorithm valueOf(int hash, + int signature, int sequence) { + hash &= 0xFF; + signature &= 0xFF; + + int id = (hash << 8) | signature; + SignatureAndHashAlgorithm signAlg = supportedMap.get(id); + if (signAlg == null) { + // unsupported algorithm + signAlg = new SignatureAndHashAlgorithm( + "Unknown (hash:0x" + Integer.toString(hash, 16) + + ", signature:0x" + Integer.toString(signature, 16) + ")", + id, sequence); + } + + return signAlg; + } + + int getHashValue() { + return (id >> 8) & 0xFF; + } + + int getSignatureValue() { + return id & 0xFF; + } + + String getAlgorithmName() { + return algorithm; + } + + // return the size of a SignatureAndHashAlgorithm structure in TLS record + static int sizeInRecord() { + return 2; + } + + // Get local supported algorithm collection complying to + // algorithm constraints + static Collection + getSupportedAlgorithms(AlgorithmConstraints constraints) { + + Collection supported = new ArrayList<>(); + synchronized (priorityMap) { + for (SignatureAndHashAlgorithm sigAlg : priorityMap.values()) { + if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM && + constraints.permits(SIGNATURE_PRIMITIVE_SET, + sigAlg.algorithm, null)) { + supported.add(sigAlg); + } + } + } + + return supported; + } + + // Get supported algorithm collection from an untrusted collection + static Collection getSupportedAlgorithms( + Collection algorithms ) { + Collection supported = new ArrayList<>(); + for (SignatureAndHashAlgorithm sigAlg : algorithms) { + if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM) { + supported.add(sigAlg); + } + } + + return supported; + } + + static String[] getAlgorithmNames( + Collection algorithms) { + ArrayList algorithmNames = new ArrayList<>(); + if (algorithms != null) { + for (SignatureAndHashAlgorithm sigAlg : algorithms) { + algorithmNames.add(sigAlg.algorithm); + } + } + + String[] array = new String[algorithmNames.size()]; + return algorithmNames.toArray(array); + } + + static Set getHashAlgorithmNames( + Collection algorithms) { + Set algorithmNames = new HashSet<>(); + if (algorithms != null) { + for (SignatureAndHashAlgorithm sigAlg : algorithms) { + if (sigAlg.hash.value > 0) { + algorithmNames.add(sigAlg.hash.standardName); + } + } + } + + return algorithmNames; + } + + static String getHashAlgorithmName(SignatureAndHashAlgorithm algorithm) { + return algorithm.hash.standardName; + } + + private static void supports(HashAlgorithm hash, + SignatureAlgorithm signature, String algorithm, int priority) { + + SignatureAndHashAlgorithm pair = + new SignatureAndHashAlgorithm(hash, signature, algorithm, priority); + if (supportedMap.put(pair.id, pair) != null) { + throw new RuntimeException( + "Duplicate SignatureAndHashAlgorithm definition, id: " + + pair.id); + } + if (priorityMap.put(pair.priority, pair) != null) { + throw new RuntimeException( + "Duplicate SignatureAndHashAlgorithm definition, priority: " + + pair.priority); + } + } + + static SignatureAndHashAlgorithm getPreferableAlgorithm( + Collection algorithms, String expected) { + + if (expected == null && !algorithms.isEmpty()) { + for (SignatureAndHashAlgorithm sigAlg : algorithms) { + if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM) { + return sigAlg; + } + } + + return null; // no supported algorithm + } + + + for (SignatureAndHashAlgorithm algorithm : algorithms) { + int signValue = algorithm.id & 0xFF; + if ((expected.equalsIgnoreCase("dsa") && + signValue == SignatureAlgorithm.DSA.value) || + (expected.equalsIgnoreCase("rsa") && + signValue == SignatureAlgorithm.RSA.value) || + (expected.equalsIgnoreCase("ecdsa") && + signValue == SignatureAlgorithm.ECDSA.value) || + (expected.equalsIgnoreCase("ec") && + signValue == SignatureAlgorithm.ECDSA.value)) { + return algorithm; + } + } + + return null; + } + + static enum HashAlgorithm { + UNDEFINED("undefined", "", -1), + NONE( "none", "NONE", 0), + MD5( "md5", "MD5", 1), + SHA1( "sha1", "SHA-1", 2), + SHA224( "sha224", "SHA-224", 3), + SHA256( "sha256", "SHA-256", 4), + SHA384( "sha384", "SHA-384", 5), + SHA512( "sha512", "SHA-512", 6); + + final String name; // not the standard signature algorithm name + // except the UNDEFINED, other names are defined + // by TLS 1.2 protocol + final String standardName; // the standard MessageDigest algorithm name + final int value; + + private HashAlgorithm(String name, String standardName, int value) { + this.name = name; + this.standardName = standardName; + this.value = value; + } + + static HashAlgorithm valueOf(int value) { + HashAlgorithm algorithm = UNDEFINED; + switch (value) { + case 0: + algorithm = NONE; + break; + case 1: + algorithm = MD5; + break; + case 2: + algorithm = SHA1; + break; + case 3: + algorithm = SHA224; + break; + case 4: + algorithm = SHA256; + break; + case 5: + algorithm = SHA384; + break; + case 6: + algorithm = SHA512; + break; + } + + return algorithm; + } + } + + static enum SignatureAlgorithm { + UNDEFINED("undefined", -1), + ANONYMOUS("anonymous", 0), + RSA( "rsa", 1), + DSA( "dsa", 2), + ECDSA( "ecdsa", 3); + + final String name; // not the standard signature algorithm name + // except the UNDEFINED, other names are defined + // by TLS 1.2 protocol + final int value; + + private SignatureAlgorithm(String name, int value) { + this.name = name; + this.value = value; + } + + static SignatureAlgorithm valueOf(int value) { + SignatureAlgorithm algorithm = UNDEFINED; + switch (value) { + case 0: + algorithm = ANONYMOUS; + break; + case 1: + algorithm = RSA; + break; + case 2: + algorithm = DSA; + break; + case 3: + algorithm = ECDSA; + break; + } + + return algorithm; + } + } + + static { + supportedMap = Collections.synchronizedSortedMap( + new TreeMap()); + priorityMap = Collections.synchronizedSortedMap( + new TreeMap()); + + synchronized (supportedMap) { + int p = SUPPORTED_ALG_PRIORITY_MAX_NUM; + supports(HashAlgorithm.MD5, SignatureAlgorithm.RSA, + "MD5withRSA", --p); + supports(HashAlgorithm.SHA1, SignatureAlgorithm.DSA, + "SHA1withDSA", --p); + supports(HashAlgorithm.SHA1, SignatureAlgorithm.RSA, + "SHA1withRSA", --p); + supports(HashAlgorithm.SHA1, SignatureAlgorithm.ECDSA, + "SHA1withECDSA", --p); + supports(HashAlgorithm.SHA224, SignatureAlgorithm.RSA, + "SHA224withRSA", --p); + supports(HashAlgorithm.SHA224, SignatureAlgorithm.ECDSA, + "SHA224withECDSA", --p); + supports(HashAlgorithm.SHA256, SignatureAlgorithm.RSA, + "SHA256withRSA", --p); + supports(HashAlgorithm.SHA256, SignatureAlgorithm.ECDSA, + "SHA256withECDSA", --p); + supports(HashAlgorithm.SHA384, SignatureAlgorithm.RSA, + "SHA384withRSA", --p); + supports(HashAlgorithm.SHA384, SignatureAlgorithm.ECDSA, + "SHA384withECDSA", --p); + supports(HashAlgorithm.SHA512, SignatureAlgorithm.RSA, + "SHA512withRSA", --p); + supports(HashAlgorithm.SHA512, SignatureAlgorithm.ECDSA, + "SHA512withECDSA", --p); + } + } +} + diff --git a/jdk/src/share/classes/sun/security/ssl/SunJSSE.java b/jdk/src/share/classes/sun/security/ssl/SunJSSE.java index e92c47713e1..1668e6ff79d 100644 --- a/jdk/src/share/classes/sun/security/ssl/SunJSSE.java +++ b/jdk/src/share/classes/sun/security/ssl/SunJSSE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ import java.security.*; * * SunJSSE now supports an experimental FIPS compliant mode when used with an * appropriate FIPS certified crypto provider. In FIPS mode, we: - * . allow only TLS 1.0 + * . allow only TLS 1.0 or later * . allow only FIPS approved ciphersuites * . perform all crypto in the FIPS crypto provider * @@ -129,7 +129,8 @@ public abstract class SunJSSE extends java.security.Provider { return t; } - private SunJSSE(java.security.Provider cryptoProvider, String providerName) { + private SunJSSE(java.security.Provider cryptoProvider, + String providerName) { super("SunJSSE", 1.6d, fipsInfo + providerName + ")"); subclassCheck(); if (cryptoProvider == null) { @@ -211,6 +212,10 @@ public abstract class SunJSSE extends java.security.Provider { "sun.security.ssl.SSLContextImpl"); put("SSLContext.TLSv1", "sun.security.ssl.SSLContextImpl"); + put("SSLContext.TLSv1.1", + "sun.security.ssl.SSLContextImpl"); + put("SSLContext.TLSv1.2", + "sun.security.ssl.SSLContextImpl"); put("SSLContext.Default", "sun.security.ssl.DefaultSSLContextImpl"); diff --git a/jdk/src/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java b/jdk/src/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java index 0b0e6b5f0b0..5c2d09c4db5 100644 --- a/jdk/src/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java @@ -337,7 +337,7 @@ final class SunX509KeyManagerImpl extends X509ExtendedKeyManager { X500Principal[] x500Issuers = (X500Principal[])issuers; // the algorithm below does not produce duplicates, so avoid Set - List aliases = new ArrayList(); + List aliases = new ArrayList<>(); for (Map.Entry entry : credentialsMap.entrySet()) { @@ -397,7 +397,7 @@ final class SunX509KeyManagerImpl extends X509ExtendedKeyManager { * possible. Principals that cannot be converted are ignored. */ private static X500Principal[] convertPrincipals(Principal[] principals) { - List list = new ArrayList(principals.length); + List list = new ArrayList<>(principals.length); for (int i = 0; i < principals.length; i++) { Principal p = principals[i]; if (p instanceof X500Principal) { diff --git a/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java b/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java index b19149dee96..3e758f64c25 100644 --- a/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ abstract class TrustManagerFactoryImpl extends TrustManagerFactorySpi { FileInputStream fis = null; String defaultTrustStoreType; String defaultTrustStoreProvider; - final HashMap props = new HashMap(); + final HashMap props = new HashMap<>(); final String sep = File.separator; KeyStore ks = null; diff --git a/jdk/src/share/classes/sun/security/ssl/X509KeyManagerImpl.java b/jdk/src/share/classes/sun/security/ssl/X509KeyManagerImpl.java index 612f00a00a3..0d3731f2ba4 100644 --- a/jdk/src/share/classes/sun/security/ssl/X509KeyManagerImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/X509KeyManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,8 @@ import java.security.cert.Certificate; import javax.net.ssl.*; +import sun.security.provider.certpath.AlgorithmChecker; + /** * The new X509 key manager implementation. The main differences to the * old SunX509 key manager are: @@ -111,36 +113,98 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager public String chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket) { - return chooseAlias(getKeyTypes(keyTypes), issuers, CheckType.CLIENT); + return chooseAlias(getKeyTypes(keyTypes), issuers, CheckType.CLIENT, + getAlgorithmConstraints(socket)); } public String chooseEngineClientAlias(String[] keyTypes, Principal[] issuers, SSLEngine engine) { - return chooseAlias(getKeyTypes(keyTypes), issuers, CheckType.CLIENT); + return chooseAlias(getKeyTypes(keyTypes), issuers, CheckType.CLIENT, + getAlgorithmConstraints(engine)); } public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) { - return chooseAlias(getKeyTypes(keyType), issuers, CheckType.SERVER); + return chooseAlias(getKeyTypes(keyType), issuers, CheckType.SERVER, + getAlgorithmConstraints(socket)); } public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine) { - return chooseAlias(getKeyTypes(keyType), issuers, CheckType.SERVER); + return chooseAlias(getKeyTypes(keyType), issuers, CheckType.SERVER, + getAlgorithmConstraints(engine)); } public String[] getClientAliases(String keyType, Principal[] issuers) { - return getAliases(keyType, issuers, CheckType.CLIENT); + return getAliases(keyType, issuers, CheckType.CLIENT, null); } public String[] getServerAliases(String keyType, Principal[] issuers) { - return getAliases(keyType, issuers, CheckType.SERVER); + return getAliases(keyType, issuers, CheckType.SERVER, null); } // // implementation private methods // + // Gets algorithm constraints of the socket. + private AlgorithmConstraints getAlgorithmConstraints(Socket socket) { + if (socket != null && socket.isConnected() && + socket instanceof SSLSocket) { + + SSLSocket sslSocket = (SSLSocket)socket; + SSLSession session = sslSocket.getHandshakeSession(); + + if (session != null) { + ProtocolVersion protocolVersion = + ProtocolVersion.valueOf(session.getProtocol()); + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + String[] peerSupportedSignAlgs = null; + + if (session instanceof ExtendedSSLSession) { + ExtendedSSLSession extSession = + (ExtendedSSLSession)session; + peerSupportedSignAlgs = + extSession.getPeerSupportedSignatureAlgorithms(); + } + + return new SSLAlgorithmConstraints( + sslSocket, peerSupportedSignAlgs, true); + } + } + + return new SSLAlgorithmConstraints(sslSocket, true); + } + + return new SSLAlgorithmConstraints((SSLSocket)null, true); + } + + // Gets algorithm constraints of the engine. + private AlgorithmConstraints getAlgorithmConstraints(SSLEngine engine) { + if (engine != null) { + SSLSession session = engine.getHandshakeSession(); + if (session != null) { + ProtocolVersion protocolVersion = + ProtocolVersion.valueOf(session.getProtocol()); + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + String[] peerSupportedSignAlgs = null; + + if (session instanceof ExtendedSSLSession) { + ExtendedSSLSession extSession = + (ExtendedSSLSession)session; + peerSupportedSignAlgs = + extSession.getPeerSupportedSignatureAlgorithms(); + } + + return new SSLAlgorithmConstraints( + engine, peerSupportedSignAlgs, true); + } + } + } + + return new SSLAlgorithmConstraints(engine, true); + } + // we construct the alias we return to JSSE as seen in the code below // a unique id is included to allow us to reliably cache entries // between the calls to getCertificateChain() and getPrivateKey() @@ -196,6 +260,13 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager private static class KeyType { final String keyAlgorithm; + + // In TLS 1.2, the signature algorithm has been obsoleted by the + // supported_signature_algorithms, and the certificate type no longer + // restricts the algorithm used to sign the certificate. + // However, because we don't support certificate type checking other + // than rsa_sign, dss_sign and ecdsa_sign, we don't have to check the + // protocol version here. final String sigKeyAlgorithm; KeyType(String algorithm) { @@ -218,7 +289,8 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager } if (chain.length > 1) { // if possible, check the public key in the issuer cert - return sigKeyAlgorithm.equals(chain[1].getPublicKey().getAlgorithm()); + return sigKeyAlgorithm.equals( + chain[1].getPublicKey().getAlgorithm()); } else { // Check the signature algorithm of the certificate itself. // Look for the "withRSA" in "SHA1withRSA", etc. @@ -231,10 +303,11 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager } private static List getKeyTypes(String ... keyTypes) { - if ((keyTypes == null) || (keyTypes.length == 0) || (keyTypes[0] == null)) { + if ((keyTypes == null) || + (keyTypes.length == 0) || (keyTypes[0] == null)) { return null; } - List list = new ArrayList(keyTypes.length); + List list = new ArrayList<>(keyTypes.length); for (String keyType : keyTypes) { list.add(new KeyType(keyType)); } @@ -254,8 +327,8 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager * with appropriate key usage to certs with the wrong key usage. * return the first one of them. */ - private String chooseAlias(List keyTypeList, - Principal[] issuers, CheckType checkType) { + private String chooseAlias(List keyTypeList, Principal[] issuers, + CheckType checkType, AlgorithmConstraints constraints) { if (keyTypeList == null || keyTypeList.size() == 0) { return null; } @@ -264,8 +337,8 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager List allResults = null; for (int i = 0, n = builders.size(); i < n; i++) { try { - List results = - getAliases(i, keyTypeList, issuerSet, false, checkType); + List results = getAliases(i, keyTypeList, + issuerSet, false, checkType, constraints); if (results != null) { // the results will either be a single perfect match // or 1 or more imperfect matches @@ -308,7 +381,7 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager * The perfect matches will be first in the array. */ public String[] getAliases(String keyType, Principal[] issuers, - CheckType checkType) { + CheckType checkType, AlgorithmConstraints constraints) { if (keyType == null) { return null; } @@ -318,8 +391,8 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager List allResults = null; for (int i = 0, n = builders.size(); i < n; i++) { try { - List results = - getAliases(i, keyTypeList, issuerSet, true, checkType); + List results = getAliases(i, keyTypeList, + issuerSet, true, checkType, constraints); if (results != null) { if (allResults == null) { allResults = new ArrayList(); @@ -356,7 +429,7 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager // make a Set out of the array private Set getIssuerSet(Principal[] issuers) { if ((issuers != null) && (issuers.length != 0)) { - return new HashSet(Arrays.asList(issuers)); + return new HashSet<>(Arrays.asList(issuers)); } else { return null; } @@ -438,7 +511,8 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager try { // check extended key usage List certEku = cert.getExtendedKeyUsage(); - if ((certEku != null) && Collections.disjoint(validEku, certEku)) { + if ((certEku != null) && + Collections.disjoint(validEku, certEku)) { // if extension present and it does not contain any of // the valid EKU OIDs, return extension_mismatch return CheckResult.EXTENSION_MISMATCH; @@ -534,7 +608,8 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager */ private List getAliases(int builderIndex, List keyTypes, Set issuerSet, - boolean findAll, CheckType checkType) throws Exception { + boolean findAll, CheckType checkType, + AlgorithmConstraints constraints) throws Exception { Builder builder = builders.get(builderIndex); KeyStore ks = builder.getKeyStore(); List results = null; @@ -552,6 +627,19 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager // must be secret key entry, ignore continue; } + + boolean incompatible = false; + for (Certificate cert : chain) { + if (cert instanceof X509Certificate == false) { + // not an X509Certificate, ignore this alias + incompatible = true; + break; + } + } + if (incompatible) { + continue; + } + // check keytype int keyIndex = -1; int j = 0; @@ -573,10 +661,6 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager if (issuerSet != null) { boolean found = false; for (Certificate cert : chain) { - if (cert instanceof X509Certificate == false) { - // not an X509Certificate, ignore this entry - break; - } X509Certificate xcert = (X509Certificate)cert; if (issuerSet.contains(xcert.getIssuerX500Principal())) { found = true; @@ -591,6 +675,19 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager continue; } } + + // check the algorithm constraints + if (constraints != null && + !conformsToAlgorithmConstraints(constraints, chain)) { + + if (useDebug) { + debug.println("Ignoring alias " + alias + + ": certificate list does not conform to " + + "algorithm constraints"); + } + continue; + } + if (date == null) { date = new Date(); } @@ -616,4 +713,29 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager return results; } + private static boolean conformsToAlgorithmConstraints( + AlgorithmConstraints constraints, Certificate[] chain) { + + AlgorithmChecker checker = new AlgorithmChecker(constraints); + try { + checker.init(false); + } catch (CertPathValidatorException cpve) { + // unlikely to happen + return false; + } + + // It is a forward checker, so we need to check from trust to target. + for (int i = chain.length - 1; i >= 0; i--) { + Certificate cert = chain[i]; + try { + // We don't care about the unresolved critical extensions. + checker.check(cert, Collections.emptySet()); + } catch (CertPathValidatorException cpve) { + return false; + } + } + + return true; + } + } diff --git a/jdk/src/share/classes/sun/security/ssl/X509TrustManagerImpl.java b/jdk/src/share/classes/sun/security/ssl/X509TrustManagerImpl.java index 28897a05ae4..d38e727010c 100644 --- a/jdk/src/share/classes/sun/security/ssl/X509TrustManagerImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/X509TrustManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 +26,15 @@ package sun.security.ssl; +import java.net.Socket; +import javax.net.ssl.SSLSession; + import java.util.*; import java.security.*; import java.security.cert.*; import javax.net.ssl.*; -import com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager; - import sun.security.validator.*; import sun.security.util.HostnameChecker; @@ -41,7 +42,7 @@ import sun.security.util.HostnameChecker; /** * This class implements the SunJSSE X.509 trust manager using the internal * validator API in J2SE core. The logic in this class is minimal.

      - * + *

      * This class supports both the Simple validation algorithm from previous * JSSE versions and PKIX validation. Currently, it is not possible for the * application to specify PKIX parameters other than trust anchors. This will @@ -50,19 +51,10 @@ import sun.security.util.HostnameChecker; * classes. * * @author Andreas Sterbenz - * @author Xuelei Fan */ final class X509TrustManagerImpl extends X509ExtendedTrustManager implements X509TrustManager { - /** - * Flag indicating whether to enable revocation check for the PKIX trust - * manager. Typically, this will only work if the PKIX implementation - * supports CRL distribution points as we do not manually setup CertStores. - */ - private final static boolean checkRevocation = - Debug.getBooleanProperty("com.sun.net.ssl.checkRevocation", false); - private final String validatorType; /** @@ -103,6 +95,199 @@ final class X509TrustManagerImpl extends X509ExtendedTrustManager showTrustedCerts(); } + @Override + public void checkClientTrusted(X509Certificate chain[], String authType) + throws CertificateException { + checkTrusted(chain, authType, (Socket)null, true); + } + + @Override + public void checkServerTrusted(X509Certificate chain[], String authType) + throws CertificateException { + checkTrusted(chain, authType, (Socket)null, false); + } + + @Override + public X509Certificate[] getAcceptedIssuers() { + X509Certificate[] certsArray = new X509Certificate[trustedCerts.size()]; + trustedCerts.toArray(certsArray); + return certsArray; + } + + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType, + Socket socket) throws CertificateException { + checkTrusted(chain, authType, socket, true); + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType, + Socket socket) throws CertificateException { + checkTrusted(chain, authType, socket, false); + } + + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType, + SSLEngine engine) throws CertificateException { + checkTrusted(chain, authType, engine, true); + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType, + SSLEngine engine) throws CertificateException { + checkTrusted(chain, authType, engine, false); + } + + private Validator checkTrustedInit(X509Certificate[] chain, + String authType, boolean isClient) { + if (chain == null || chain.length == 0) { + throw new IllegalArgumentException( + "null or zero-length certificate chain"); + } + + if (authType == null || authType.length() == 0) { + throw new IllegalArgumentException( + "null or zero-length authentication type"); + } + + Validator v = null; + if (isClient) { + v = clientValidator; + if (v == null) { + synchronized (this) { + v = clientValidator; + if (v == null) { + v = getValidator(Validator.VAR_TLS_CLIENT); + clientValidator = v; + } + } + } + } else { + // assume double checked locking with a volatile flag works + // (guaranteed under the new Tiger memory model) + v = serverValidator; + if (v == null) { + synchronized (this) { + v = serverValidator; + if (v == null) { + v = getValidator(Validator.VAR_TLS_SERVER); + serverValidator = v; + } + } + } + } + + return v; + } + + + private void checkTrusted(X509Certificate[] chain, String authType, + Socket socket, boolean isClient) throws CertificateException { + Validator v = checkTrustedInit(chain, authType, isClient); + + AlgorithmConstraints constraints = null; + if ((socket != null) && socket.isConnected() && + (socket instanceof SSLSocket)) { + + SSLSocket sslSocket = (SSLSocket)socket; + SSLSession session = sslSocket.getHandshakeSession(); + if (session == null) { + throw new CertificateException("No handshake session"); + } + + // check endpoint identity + String identityAlg = sslSocket.getSSLParameters(). + getEndpointIdentificationAlgorithm(); + if (identityAlg != null && identityAlg.length() != 0) { + String hostname = session.getPeerHost(); + checkIdentity(hostname, chain[0], identityAlg); + } + + // create the algorithm constraints + ProtocolVersion protocolVersion = + ProtocolVersion.valueOf(session.getProtocol()); + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + if (session instanceof ExtendedSSLSession) { + ExtendedSSLSession extSession = + (ExtendedSSLSession)session; + String[] localSupportedSignAlgs = + extSession.getLocalSupportedSignatureAlgorithms(); + + constraints = new SSLAlgorithmConstraints( + sslSocket, localSupportedSignAlgs, false); + } else { + constraints = + new SSLAlgorithmConstraints(sslSocket, false); + } + } else { + constraints = new SSLAlgorithmConstraints(sslSocket, false); + } + } + + X509Certificate[] trustedChain = null; + if (isClient) { + trustedChain = validate(v, chain, constraints, null); + } else { + trustedChain = validate(v, chain, constraints, authType); + } + if (debug != null && Debug.isOn("trustmanager")) { + System.out.println("Found trusted certificate:"); + System.out.println(trustedChain[trustedChain.length - 1]); + } + } + + private void checkTrusted(X509Certificate[] chain, String authType, + SSLEngine engine, boolean isClient) throws CertificateException { + Validator v = checkTrustedInit(chain, authType, isClient); + + AlgorithmConstraints constraints = null; + if (engine != null) { + SSLSession session = engine.getHandshakeSession(); + if (session == null) { + throw new CertificateException("No handshake session"); + } + + // check endpoint identity + String identityAlg = engine.getSSLParameters(). + getEndpointIdentificationAlgorithm(); + if (identityAlg != null && identityAlg.length() != 0) { + String hostname = session.getPeerHost(); + checkIdentity(hostname, chain[0], identityAlg); + } + + // create the algorithm constraints + ProtocolVersion protocolVersion = + ProtocolVersion.valueOf(session.getProtocol()); + if (protocolVersion.v >= ProtocolVersion.TLS12.v) { + if (session instanceof ExtendedSSLSession) { + ExtendedSSLSession extSession = + (ExtendedSSLSession)session; + String[] localSupportedSignAlgs = + extSession.getLocalSupportedSignatureAlgorithms(); + + constraints = new SSLAlgorithmConstraints( + engine, localSupportedSignAlgs, false); + } else { + constraints = + new SSLAlgorithmConstraints(engine, false); + } + } else { + constraints = new SSLAlgorithmConstraints(engine, false); + } + } + + X509Certificate[] trustedChain = null; + if (isClient) { + trustedChain = validate(v, chain, constraints, null); + } else { + trustedChain = validate(v, chain, constraints, authType); + } + if (debug != null && Debug.isOn("trustmanager")) { + System.out.println("Found trusted certificate:"); + System.out.println(trustedChain[trustedChain.length - 1]); + } + } + private void showTrustedCerts() { if (debug != null && Debug.isOn("trustmanager")) { for (X509Certificate cert : trustedCerts) { @@ -127,13 +312,6 @@ final class X509TrustManagerImpl extends X509ExtendedTrustManager Validator v; if (pkixParams == null) { v = Validator.getInstance(validatorType, variant, trustedCerts); - // if the PKIX validator is created from a KeyStore, - // disable revocation checking - if (v instanceof PKIXValidator) { - PKIXValidator pkixValidator = (PKIXValidator)v; - pkixValidator.getParameters().setRevocationEnabled - (checkRevocation); - } } else { v = Validator.getInstance(validatorType, variant, pkixParams); } @@ -141,150 +319,35 @@ final class X509TrustManagerImpl extends X509ExtendedTrustManager } private static X509Certificate[] validate(Validator v, - X509Certificate[] chain, String authType) throws CertificateException { + X509Certificate[] chain, AlgorithmConstraints constraints, + String authType) throws CertificateException { Object o = JsseJce.beginFipsProvider(); try { - return v.validate(chain, null, authType); + return v.validate(chain, null, constraints, authType); } finally { JsseJce.endFipsProvider(o); } } - /** - * Returns true if the client certificate can be trusted. + /* + * Identify the peer by its certificate and hostname. * - * @param chain certificates which establish an identity for the client. - * Chains of arbitrary length are supported, and certificates - * marked internally as trusted will short-circuit signature checks. - * @throws IllegalArgumentException if null or zero-length chain - * is passed in for the chain parameter or if null or zero-length - * string is passed in for the authType parameter. - * @throws CertificateException if the certificate chain is not trusted - * by this TrustManager. + * Lifted from sun.net.www.protocol.https.HttpsClient. */ - public void checkClientTrusted(X509Certificate chain[], String authType) - throws CertificateException { - if (chain == null || chain.length == 0) { - throw new IllegalArgumentException( - "null or zero-length certificate chain"); - } - if (authType == null || authType.length() == 0) { - throw new IllegalArgumentException( - "null or zero-length authentication type"); - } - - // assume double checked locking with a volatile flag works - // (guaranteed under the new Tiger memory model) - Validator v = clientValidator; - if (v == null) { - synchronized (this) { - v = clientValidator; - if (v == null) { - v = getValidator(Validator.VAR_TLS_CLIENT); - clientValidator = v; - } - } - } - X509Certificate[] trustedChain = validate(v, chain, null); - if (debug != null && Debug.isOn("trustmanager")) { - System.out.println("Found trusted certificate:"); - System.out.println(trustedChain[trustedChain.length - 1]); - } - } - - /** - * Returns true if the server certifcate can be trusted. - * - * @param chain certificates which establish an identity for the server. - * Chains of arbitrary length are supported, and certificates - * marked internally as trusted will short-circuit signature checks. - * @throws IllegalArgumentException if null or zero-length chain - * is passed in for the chain parameter or if null or zero-length - * string is passed in for the authType parameter. - * @throws CertificateException if the certificate chain is not trusted - * by this TrustManager. - */ - public void checkServerTrusted(X509Certificate chain[], String authType) - throws CertificateException { - if (chain == null || chain.length == 0) { - throw new IllegalArgumentException( - "null or zero-length certificate chain"); - } - if (authType == null || authType.length() == 0) { - throw new IllegalArgumentException( - "null or zero-length authentication type"); - } - - // assume double checked locking with a volatile flag works - // (guaranteed under the new Tiger memory model) - Validator v = serverValidator; - if (v == null) { - synchronized (this) { - v = serverValidator; - if (v == null) { - v = getValidator(Validator.VAR_TLS_SERVER); - serverValidator = v; - } - } - } - X509Certificate[] trustedChain = validate(v, chain, authType); - if (debug != null && Debug.isOn("trustmanager")) { - System.out.println("Found trusted certificate:"); - System.out.println(trustedChain[trustedChain.length - 1]); - } - } - - /** - * Returns a list of CAs accepted to authenticate entities for the - * specified purpose. - * - * @param purpose activity for which CAs should be trusted - * @return list of CAs accepted for authenticating such tasks - */ - public X509Certificate[] getAcceptedIssuers() { - X509Certificate[] certsArray = new X509Certificate[trustedCerts.size()]; - trustedCerts.toArray(certsArray); - return certsArray; - } - - /** - * Given the partial or complete certificate chain provided by the - * peer, check its identity and build a certificate path to a trusted - * root, return if it can be validated and is trusted for client SSL - * authentication based on the authentication type. - */ - public void checkClientTrusted(X509Certificate[] chain, String authType, - String hostname, String algorithm) throws CertificateException { - checkClientTrusted(chain, authType); - checkIdentity(hostname, chain[0], algorithm); - } - - /** - * Given the partial or complete certificate chain provided by the - * peer, check its identity and build a certificate path to a trusted - * root, return if it can be validated and is trusted for server SSL - * authentication based on the authentication type. - */ - public void checkServerTrusted(X509Certificate[] chain, String authType, - String hostname, String algorithm) throws CertificateException { - checkServerTrusted(chain, authType); - checkIdentity(hostname, chain[0], algorithm); - } - - // Identify the peer by its certificate and hostname. - private void checkIdentity(String hostname, X509Certificate cert, - String algorithm) throws CertificateException { + static void checkIdentity(String hostname, X509Certificate cert, + String algorithm) throws CertificateException { if (algorithm != null && algorithm.length() != 0) { // if IPv6 strip off the "[]" - if (hostname != null && hostname.startsWith("[") && - hostname.endsWith("]")) { - hostname = hostname.substring(1, hostname.length()-1); + if ((hostname != null) && hostname.startsWith("[") && + hostname.endsWith("]")) { + hostname = hostname.substring(1, hostname.length() - 1); } if (algorithm.equalsIgnoreCase("HTTPS")) { HostnameChecker.getInstance(HostnameChecker.TYPE_TLS).match( hostname, cert); - } else if (algorithm.equalsIgnoreCase("LDAP")) { + } else if (algorithm.equalsIgnoreCase("LDAP") || + algorithm.equalsIgnoreCase("LDAPS")) { HostnameChecker.getInstance(HostnameChecker.TYPE_LDAP).match( hostname, cert); } else { diff --git a/jdk/src/share/classes/sun/security/ssl/krb5/KerberosClientKeyExchangeImpl.java b/jdk/src/share/classes/sun/security/ssl/krb5/KerberosClientKeyExchangeImpl.java index 8cc2d0e497d..7e220bc06eb 100644 --- a/jdk/src/share/classes/sun/security/ssl/krb5/KerberosClientKeyExchangeImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/krb5/KerberosClientKeyExchangeImpl.java @@ -244,7 +244,7 @@ public final class KerberosClientKeyExchangeImpl clientVersion, rand, input, sessionKey); } else { // Generate bogus premaster secret - preMaster = new KerberosPreMasterSecret(protocolVersion, rand); + preMaster = new KerberosPreMasterSecret(clientVersion, rand); } } diff --git a/jdk/src/share/classes/sun/security/ssl/krb5/KerberosPreMasterSecret.java b/jdk/src/share/classes/sun/security/ssl/krb5/KerberosPreMasterSecret.java index 0d7571aab75..84c96a35b3f 100644 --- a/jdk/src/share/classes/sun/security/ssl/krb5/KerberosPreMasterSecret.java +++ b/jdk/src/share/classes/sun/security/ssl/krb5/KerberosPreMasterSecret.java @@ -176,13 +176,21 @@ final class KerberosPreMasterSecret { // check if the premaster secret version is ok // the specification says that it must be the maximum version supported // by the client from its ClientHello message. However, many - // implementations send the negotiated version, so accept both + // old implementations send the negotiated version, so accept both + // for SSL v3.0 and TLS v1.0. // NOTE that we may be comparing two unsupported version numbers in // the second case, which is why we cannot use object references // equality in this special case - boolean versionMismatch = (protocolVersion != currentVersion) && - (protocolVersion.v != clientVersion.v); + boolean versionMismatch = (protocolVersion.v != clientVersion.v); + /* + * we never checked the client_version in server side + * for TLS v1.0 and SSL v3.0. For compatibility, we + * maintain this behavior. + */ + if (versionMismatch && (clientVersion.v <= 0x0301)) { + versionMismatch = (protocolVersion.v != currentVersion.v); + } /* * Bogus decrypted ClientKeyExchange? If so, conjure a @@ -203,8 +211,14 @@ final class KerberosPreMasterSecret { Debug.println(System.out, "Invalid secret", preMaster); } } - preMaster = generatePreMaster(generator, currentVersion); - protocolVersion = currentVersion; + + /* + * Randomize the preMaster secret with the + * ClientHello.client_version, as will produce invalid master + * secret to prevent the attacks. + */ + preMaster = generatePreMaster(generator, clientVersion); + protocolVersion = clientVersion; } } diff --git a/jdk/src/share/classes/sun/security/ssl/krb5/Krb5ProxyImpl.java b/jdk/src/share/classes/sun/security/ssl/krb5/Krb5ProxyImpl.java index 70dc7532e5b..94d1e8e75be 100644 --- a/jdk/src/share/classes/sun/security/ssl/krb5/Krb5ProxyImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/krb5/Krb5ProxyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -10,7 +10,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * diff --git a/jdk/src/share/classes/sun/security/tools/JarSigner.java b/jdk/src/share/classes/sun/security/tools/JarSigner.java index 981b7fd531a..42d3bf57fd8 100644 --- a/jdk/src/share/classes/sun/security/tools/JarSigner.java +++ b/jdk/src/share/classes/sun/security/tools/JarSigner.java @@ -123,19 +123,19 @@ public class JarSigner { // or the default keystore, never null String keystore; // key store file - List crlfiles = new ArrayList(); // CRL files to add + List crlfiles = new ArrayList<>(); // CRL files to add boolean nullStream = false; // null keystore input stream (NONE) boolean token = false; // token-based keystore String jarfile; // jar files to sign or verify String alias; // alias to sign jar with - List ckaliases = new ArrayList(); // aliases in -verify + List ckaliases = new ArrayList<>(); // aliases in -verify char[] storepass; // keystore password boolean protectedPath; // protected authentication path String storetype; // keystore type String providerName; // provider name Vector providers = null; // list of providers // arguments for provider constructors - HashMap providerArgs = new HashMap(); + HashMap providerArgs = new HashMap<>(); char[] keypass; // private key password String sigfile; // name of .SF file String sigalg; // name of signature algorithm @@ -205,7 +205,7 @@ public class JarSigner { if (!(obj instanceof Provider)) { MessageFormat form = new MessageFormat(rb.getString - ("provName not a provider")); + ("provName.not.a.provider")); Object[] source = {provName}; throw new Exception(form.format(source)); } @@ -218,7 +218,7 @@ public class JarSigner { loadKeyStore(keystore, false); } catch (Exception e) { if ((keystore != null) || (storepass != null)) { - System.out.println(rb.getString("jarsigner error: ") + + System.out.println(rb.getString("jarsigner.error.") + e.getMessage()); System.exit(1); } @@ -236,7 +236,7 @@ public class JarSigner { if (crlfiles.size() > 0 || autoCRL) { CertificateFactory fac = CertificateFactory.getInstance("X509"); - List list = new ArrayList(); + List list = new ArrayList<>(); for (String file: crlfiles) { Collection tmp = KeyTool.loadCRLs(file); for (CRL crl: tmp) { @@ -264,7 +264,7 @@ public class JarSigner { signJar(jarfile, alias, args); } } catch (Exception e) { - System.out.println(rb.getString("jarsigner error: ") + e); + System.out.println(rb.getString("jarsigner.error.") + e); if (debug) { e.printStackTrace(); } @@ -420,7 +420,7 @@ public class JarSigner { } } else { System.err.println( - rb.getString("Illegal option: ") + flags); + rb.getString("Illegal.option.") + flags); usage(); } } @@ -430,15 +430,15 @@ public class JarSigner { if (verbose == null) showcerts = false; if (jarfile == null) { - System.err.println(rb.getString("Please specify jarfile name")); + System.err.println(rb.getString("Please.specify.jarfile.name")); usage(); } if (!verify && alias == null) { - System.err.println(rb.getString("Please specify alias name")); + System.err.println(rb.getString("Please.specify.alias.name")); usage(); } if (!verify && ckaliases.size() > 1) { - System.err.println(rb.getString("Only one alias can be specified")); + System.err.println(rb.getString("Only.one.alias.can.be.specified")); usage(); } @@ -471,30 +471,27 @@ public class JarSigner { if (token && !nullStream) { System.err.println(MessageFormat.format(rb.getString - ("-keystore must be NONE if -storetype is {0}"), storetype)); + (".keystore.must.be.NONE.if.storetype.is.{0}"), storetype)); usage(); } if (token && keypass != null) { System.err.println(MessageFormat.format(rb.getString - ("-keypass can not be specified " + - "if -storetype is {0}"), storetype)); + (".keypass.can.not.be.specified.if.storetype.is.{0}"), storetype)); usage(); } if (protectedPath) { if (storepass != null || keypass != null) { System.err.println(rb.getString - ("If -protected is specified, " + - "then -storepass and -keypass must not be specified")); + ("If.protected.is.specified.then.storepass.and.keypass.must.not.be.specified")); usage(); } } if (KeyStoreUtil.isWindowsKeyStore(storetype)) { if (storepass != null || keypass != null) { System.err.println(rb.getString - ("If keystore is not password protected, " + - "then -storepass and -keypass must not be specified")); + ("If.keystore.is.not.password.protected.then.storepass.and.keypass.must.not.be.specified")); usage(); } } @@ -508,94 +505,94 @@ public class JarSigner { } static void usageNoArg() { - System.out.println(rb.getString("Option lacks argument")); + System.out.println(rb.getString("Option.lacks.argument")); usage(); } static void usage() { System.out.println(); - System.out.println(rb.getString("Please type jarsigner -help for usage")); + System.out.println(rb.getString("Please.type.jarsigner.help.for.usage")); System.exit(1); } static void fullusage() { System.out.println(rb.getString - ("Usage: jarsigner [options] jar-file alias")); + ("Usage.jarsigner.options.jar.file.alias")); System.out.println(rb.getString - (" jarsigner -verify [options] jar-file [alias...]")); + (".jarsigner.verify.options.jar.file.alias.")); System.out.println(); System.out.println(rb.getString - ("[-keystore ] keystore location")); + (".keystore.url.keystore.location")); System.out.println(); System.out.println(rb.getString - ("[-storepass ] password for keystore integrity")); + (".storepass.password.password.for.keystore.integrity")); System.out.println(); System.out.println(rb.getString - ("[-storetype ] keystore type")); + (".storetype.type.keystore.type")); System.out.println(); System.out.println(rb.getString - ("[-keypass ] password for private key (if different)")); + (".keypass.password.password.for.private.key.if.different.")); System.out.println(); System.out.println(rb.getString - ("[-certchain ] name of alternative certchain file")); + (".certchain.file.name.of.alternative.certchain.file")); System.out.println(); System.out.println(rb.getString - ("[-sigfile ] name of .SF/.DSA file")); + (".sigfile.file.name.of.SF.DSA.file")); System.out.println(); System.out.println(rb.getString - ("[-signedjar ] name of signed JAR file")); + (".signedjar.file.name.of.signed.JAR.file")); System.out.println(); System.out.println(rb.getString - ("[-digestalg ] name of digest algorithm")); + (".digestalg.algorithm.name.of.digest.algorithm")); System.out.println(); System.out.println(rb.getString - ("[-sigalg ] name of signature algorithm")); + (".sigalg.algorithm.name.of.signature.algorithm")); System.out.println(); System.out.println(rb.getString - ("[-crl[:auto| ] include CRL in signed jar")); + (".crl.auto.file.include.CRL.in.signed.jar")); System.out.println(); System.out.println(rb.getString - ("[-verify] verify a signed JAR file")); + (".verify.verify.a.signed.JAR.file")); System.out.println(); System.out.println(rb.getString - ("[-verbose[:suboptions]] verbose output when signing/verifying.")); + (".verbose.suboptions.verbose.output.when.signing.verifying.")); System.out.println(rb.getString - (" suboptions can be all, grouped or summary")); + (".suboptions.can.be.all.grouped.or.summary")); System.out.println(); System.out.println(rb.getString - ("[-certs] display certificates when verbose and verifying")); + (".certs.display.certificates.when.verbose.and.verifying")); System.out.println(); System.out.println(rb.getString - ("[-tsa ] location of the Timestamping Authority")); + (".tsa.url.location.of.the.Timestamping.Authority")); System.out.println(); System.out.println(rb.getString - ("[-tsacert ] public key certificate for Timestamping Authority")); + (".tsacert.alias.public.key.certificate.for.Timestamping.Authority")); System.out.println(); System.out.println(rb.getString - ("[-altsigner ] class name of an alternative signing mechanism")); + (".altsigner.class.class.name.of.an.alternative.signing.mechanism")); System.out.println(); System.out.println(rb.getString - ("[-altsignerpath ] location of an alternative signing mechanism")); + (".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism")); System.out.println(); System.out.println(rb.getString - ("[-internalsf] include the .SF file inside the signature block")); + (".internalsf.include.the.SF.file.inside.the.signature.block")); System.out.println(); System.out.println(rb.getString - ("[-sectionsonly] don't compute hash of entire manifest")); + (".sectionsonly.don.t.compute.hash.of.entire.manifest")); System.out.println(); System.out.println(rb.getString - ("[-protected] keystore has protected authentication path")); + (".protected.keystore.has.protected.authentication.path")); System.out.println(); System.out.println(rb.getString - ("[-providerName ] provider name")); + (".providerName.name.provider.name")); System.out.println(); System.out.println(rb.getString - ("[-providerClass name of cryptographic service provider's")); + (".providerClass.class.name.of.cryptographic.service.provider.s")); System.out.println(rb.getString - (" [-providerArg ]] ... master class file and constructor argument")); + (".providerArg.arg.master.class.file.and.constructor.argument")); System.out.println(); System.out.println(rb.getString - ("[-strict] treat warnings as errors")); + (".strict.treat.warnings.as.errors")); System.out.println(); System.exit(0); @@ -609,7 +606,7 @@ public class JarSigner { try { jf = new JarFile(jarName, true); - Vector entriesVec = new Vector(); + Vector entriesVec = new Vector<>(); byte[] buffer = new byte[8192]; Enumeration entries = jf.entries(); @@ -636,15 +633,14 @@ public class JarSigner { // The map to record display info, only used when -verbose provided // key: signer info string // value: the list of files with common key - Map> output = - new LinkedHashMap>(); + Map> output = new LinkedHashMap<>(); if (man != null) { if (verbose != null) System.out.println(); Enumeration e = entriesVec.elements(); long now = System.currentTimeMillis(); - String tab = rb.getString(" "); + String tab = rb.getString("6SPACE"); while (e.hasMoreElements()) { JarEntry je = e.nextElement(); @@ -661,7 +657,9 @@ public class JarSigner { boolean inScope = (inStoreOrScope & IN_SCOPE) != 0; notSignedByAlias |= (inStoreOrScope & NOT_ALIAS) != 0; - aliasNotInStore |= isSigned && (!inStore && !inScope); + if (keystore != null) { + aliasNotInStore |= isSigned && (!inStore && !inScope); + } // Only used when -verbose provided StringBuffer sb = null; @@ -672,12 +670,12 @@ public class JarSigner { (man.getAttributes("./"+name) != null) || (man.getAttributes("/"+name) != null)); sb.append( - (isSigned ? rb.getString("s") : rb.getString(" ")) + - (inManifest ? rb.getString("m") : rb.getString(" ")) + - (inStore ? rb.getString("k") : rb.getString(" ")) + - (inScope ? rb.getString("i") : rb.getString(" ")) + + (isSigned ? rb.getString("s") : rb.getString("SPACE")) + + (inManifest ? rb.getString("m") : rb.getString("SPACE")) + + (inStore ? rb.getString("k") : rb.getString("SPACE")) + + (inScope ? rb.getString("i") : rb.getString("SPACE")) + ((inStoreOrScope & NOT_ALIAS) != 0 ?"X":" ") + - rb.getString(" ")); + rb.getString("SPACE")); sb.append("|"); } @@ -701,7 +699,7 @@ public class JarSigner { if (crl instanceof X509CRLImpl) { sb.append(tab).append("["); sb.append(String.format( - rb.getString("with a CRL including %d entries"), + rb.getString("with.a.CRL.including.d.entries"), ((X509CRLImpl)crl).getRevokedCertificates().size())) .append("]\n"); } @@ -714,10 +712,10 @@ public class JarSigner { // to be consistent with old behavior. if (signatureRelated(name)) { sb.append("\n" + tab + rb.getString( - "(Signature related entries)") + "\n\n"); + ".Signature.related.entries.") + "\n\n"); } else { sb.append("\n" + tab + rb.getString( - "(Unsigned entries)") + "\n\n"); + ".Unsigned.entries.") + "\n\n"); } } @@ -726,7 +724,7 @@ public class JarSigner { if (signatureRelated(name)) { // Entries inside META-INF and other unsigned // entries are grouped separately. - label = "-" + label.substring(1); + label = "-" + label; } // The label finally contains 2 parts separated by '|': @@ -755,7 +753,7 @@ public class JarSigner { List files = s.getValue(); String key = s.getKey(); if (key.charAt(0) == '-') { // the signature-related group - key = ' ' + key.substring(1); + key = key.substring(1); } int pipe = key.indexOf('|'); if (verbose.equals("all")) { @@ -773,7 +771,7 @@ public class JarSigner { if (files.size() > 1) { System.out.println(files.get(0) + " " + String.format(rb.getString( - "(and %d more)"), files.size()-1)); + ".and.d.more."), files.size()-1)); } else { System.out.println(files.get(0)); } @@ -783,89 +781,89 @@ public class JarSigner { } System.out.println(); System.out.println(rb.getString( - " s = signature was verified ")); + ".s.signature.was.verified.")); System.out.println(rb.getString( - " m = entry is listed in manifest")); + ".m.entry.is.listed.in.manifest")); System.out.println(rb.getString( - " k = at least one certificate was found in keystore")); + ".k.at.least.one.certificate.was.found.in.keystore")); System.out.println(rb.getString( - " i = at least one certificate was found in identity scope")); + ".i.at.least.one.certificate.was.found.in.identity.scope")); if (ckaliases.size() > 0) { - System.out.println(( - " X = not signed by specified alias(es)")); + System.out.println(rb.getString( + ".X.not.signed.by.specified.alias.es.")); } System.out.println(); } if (man == null) - System.out.println(rb.getString("no manifest.")); + System.out.println(rb.getString("no.manifest.")); if (!anySigned) { System.out.println(rb.getString( - "jar is unsigned. (signatures missing or not parsable)")); + "jar.is.unsigned.signatures.missing.or.not.parsable.")); } else { - System.out.println(rb.getString("jar verified.")); + System.out.println(rb.getString("jar.verified.")); if (hasUnsignedEntry || hasExpiredCert || hasExpiringCert || badKeyUsage || badExtendedKeyUsage || badNetscapeCertType || notYetValidCert || chainNotValidated || aliasNotInStore || notSignedByAlias) { System.out.println(); - System.out.println(rb.getString("Warning: ")); + System.out.println(rb.getString("Warning.")); if (badKeyUsage) { System.out.println( - rb.getString("This jar contains entries whose signer certificate's KeyUsage extension doesn't allow code signing.")); + rb.getString("This.jar.contains.entries.whose.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.")); } if (badExtendedKeyUsage) { System.out.println( - rb.getString("This jar contains entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing.")); + rb.getString("This.jar.contains.entries.whose.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.")); } if (badNetscapeCertType) { System.out.println( - rb.getString("This jar contains entries whose signer certificate's NetscapeCertType extension doesn't allow code signing.")); + rb.getString("This.jar.contains.entries.whose.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.")); } if (hasUnsignedEntry) { System.out.println(rb.getString( - "This jar contains unsigned entries which have not been integrity-checked. ")); + "This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked.")); } if (hasExpiredCert) { System.out.println(rb.getString( - "This jar contains entries whose signer certificate has expired. ")); + "This.jar.contains.entries.whose.signer.certificate.has.expired.")); } if (hasExpiringCert) { System.out.println(rb.getString( - "This jar contains entries whose signer certificate will expire within six months. ")); + "This.jar.contains.entries.whose.signer.certificate.will.expire.within.six.months.")); } if (notYetValidCert) { System.out.println(rb.getString( - "This jar contains entries whose signer certificate is not yet valid. ")); + "This.jar.contains.entries.whose.signer.certificate.is.not.yet.valid.")); } if (chainNotValidated) { System.out.println( - rb.getString("This jar contains entries whose certificate chain is not validated.")); + rb.getString("This.jar.contains.entries.whose.certificate.chain.is.not.validated.")); } if (notSignedByAlias) { System.out.println( - rb.getString("This jar contains signed entries which is not signed by the specified alias(es).")); + rb.getString("This.jar.contains.signed.entries.which.is.not.signed.by.the.specified.alias.es.")); } if (aliasNotInStore) { - System.out.println(rb.getString("This jar contains signed entries that's not signed by alias in this keystore.")); + System.out.println(rb.getString("This.jar.contains.signed.entries.that.s.not.signed.by.alias.in.this.keystore.")); } if (! (verbose != null && showcerts)) { System.out.println(); System.out.println(rb.getString( - "Re-run with the -verbose and -certs options for more details.")); + "Re.run.with.the.verbose.and.certs.options.for.more.details.")); } } } return; } catch (Exception e) { - System.out.println(rb.getString("jarsigner: ") + e); + System.out.println(rb.getString("jarsigner.") + e); if (debug) { e.printStackTrace(); } @@ -892,16 +890,16 @@ public class JarSigner { * Note: no newline character at the end */ String printCert(String tab, Certificate c, boolean checkValidityPeriod, - long now) { + long now, boolean checkUsage) { StringBuilder certStr = new StringBuilder(); - String space = rb.getString(" "); + String space = rb.getString("SPACE"); X509Certificate x509Cert = null; if (c instanceof X509Certificate) { x509Cert = (X509Certificate) c; certStr.append(tab).append(x509Cert.getType()) - .append(rb.getString(", ")) + .append(rb.getString("COMMA")) .append(x509Cert.getSubjectDN().getName()); } else { certStr.append(tab).append(c.getType()); @@ -927,7 +925,7 @@ public class JarSigner { if (expiringTimeForm == null) { expiringTimeForm = new MessageFormat( - rb.getString("certificate will expire on")); + rb.getString("certificate.will.expire.on")); } Object[] source = { notAfter }; certStr.append(expiringTimeForm.format(source)); @@ -935,7 +933,7 @@ public class JarSigner { } else { if (validityTimeForm == null) { validityTimeForm = new MessageFormat( - rb.getString("certificate is valid from")); + rb.getString("certificate.is.valid.from")); } Object[] source = { x509Cert.getNotBefore(), notAfter }; certStr.append(validityTimeForm.format(source)); @@ -945,7 +943,7 @@ public class JarSigner { if (expiredTimeForm == null) { expiredTimeForm = new MessageFormat( - rb.getString("certificate expired on")); + rb.getString("certificate.expired.on")); } Object[] source = { notAfter }; certStr.append(expiredTimeForm.format(source)); @@ -955,31 +953,33 @@ public class JarSigner { if (notYetTimeForm == null) { notYetTimeForm = new MessageFormat( - rb.getString("certificate is not valid until")); + rb.getString("certificate.is.not.valid.until")); } Object[] source = { x509Cert.getNotBefore() }; certStr.append(notYetTimeForm.format(source)); } certStr.append("]"); - boolean[] bad = new boolean[3]; - checkCertUsage(x509Cert, bad); - if (bad[0] || bad[1] || bad[2]) { - String x = ""; - if (bad[0]) { - x ="KeyUsage"; - } - if (bad[1]) { - if (x.length() > 0) x = x + ", "; - x = x + "ExtendedKeyUsage"; - } - if (bad[2]) { - if (x.length() > 0) x = x + ", "; - x = x + "NetscapeCertType"; - } - certStr.append("\n").append(tab) + if (checkUsage) { + boolean[] bad = new boolean[3]; + checkCertUsage(x509Cert, bad); + if (bad[0] || bad[1] || bad[2]) { + String x = ""; + if (bad[0]) { + x ="KeyUsage"; + } + if (bad[1]) { + if (x.length() > 0) x = x + ", "; + x = x + "ExtendedKeyUsage"; + } + if (bad[2]) { + if (x.length() > 0) x = x + ", "; + x = x + "NetscapeCertType"; + } + certStr.append("\n").append(tab) .append(MessageFormat.format(rb.getString( - "[{0} extension does not support code signing]"), x)); + ".{0}.extension.does.not.support.code.signing."), x)); + } } } return certStr.toString(); @@ -991,7 +991,7 @@ public class JarSigner { if (signTimeForm == null) { signTimeForm = - new MessageFormat(rb.getString("entry was signed on")); + new MessageFormat(rb.getString("entry.was.signed.on")); } Object[] source = { timestamp.getTimestamp() }; @@ -999,8 +999,7 @@ public class JarSigner { .append(signTimeForm.format(source)).append("]").toString(); } - private Map cacheForInKS = - new IdentityHashMap(); + private Map cacheForInKS = new IdentityHashMap<>(); private int inKeyStoreForOneSigner(CodeSigner signer) { if (cacheForInKS.containsKey(signer)) { @@ -1043,8 +1042,7 @@ public class JarSigner { return result; } - Hashtable storeHash = - new Hashtable(); + Hashtable storeHash = new Hashtable<>(); int inKeyStore(CodeSigner[] signers) { @@ -1093,7 +1091,7 @@ public class JarSigner { } else { throw new RuntimeException(rb.getString - ("signature filename must consist of the following characters: A-Z, 0-9, _ or -")); + ("signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.")); } } tmpSigFile.append(c); @@ -1112,14 +1110,14 @@ public class JarSigner { try { zipFile = new ZipFile(jarName); } catch (IOException ioe) { - error(rb.getString("unable to open jar file: ")+jarName, ioe); + error(rb.getString("unable.to.open.jar.file.")+jarName, ioe); } FileOutputStream fos = null; try { fos = new FileOutputStream(signedJarFile); } catch (IOException ioe) { - error(rb.getString("unable to create: ")+tmpJarName, ioe); + error(rb.getString("unable.to.create.")+tmpJarName, ioe); } PrintStream ps = new PrintStream(fos); @@ -1174,7 +1172,7 @@ public class JarSigner { * generated one. (This may invalidate existing signatures!) */ BASE64Encoder encoder = new JarBASE64Encoder(); - Vector mfFiles = new Vector(); + Vector mfFiles = new Vector<>(); boolean wasSigned = false; @@ -1263,10 +1261,10 @@ public class JarSigner { } if (verbose != null) { if (mfCreated) { - System.out.println(rb.getString(" adding: ") + + System.out.println(rb.getString(".adding.") + mfFile.getName()); } else if (mfModified) { - System.out.println(rb.getString(" updating: ") + + System.out.println(rb.getString(".updating.") + mfFile.getName()); } } @@ -1291,10 +1289,10 @@ public class JarSigner { zipFile); } catch (SocketTimeoutException e) { // Provide a helpful message when TSA is beyond a firewall - error(rb.getString("unable to sign jar: ") + - rb.getString("no response from the Timestamping Authority. ") + - rb.getString("When connecting from behind a firewall then an HTTP proxy may need to be specified. ") + - rb.getString("Supply the following options to jarsigner: ") + + error(rb.getString("unable.to.sign.jar.") + + rb.getString("no.response.from.the.Timestamping.Authority.") + + rb.getString("When.connecting.from.behind.a.firewall.then.an.HTTP.proxy.may.need.to.be.specified.") + + rb.getString("Supply.the.following.options.to.jarsigner.") + "\n -J-Dhttp.proxyHost= " + "\n -J-Dhttp.proxyPort= ", e); } @@ -1314,10 +1312,10 @@ public class JarSigner { sf.write(zos); if (verbose != null) { if (zipFile.getEntry(sfFilename) != null) { - System.out.println(rb.getString(" updating: ") + + System.out.println(rb.getString(".updating.") + sfFilename); } else { - System.out.println(rb.getString(" adding: ") + + System.out.println(rb.getString(".adding.") + sfFilename); } } @@ -1325,24 +1323,24 @@ public class JarSigner { if (verbose != null) { if (tsaUrl != null || tsaCert != null) { System.out.println( - rb.getString("requesting a signature timestamp")); + rb.getString("requesting.a.signature.timestamp")); } if (tsaUrl != null) { - System.out.println(rb.getString("TSA location: ") + tsaUrl); + System.out.println(rb.getString("TSA.location.") + tsaUrl); } if (tsaCert != null) { String certUrl = TimestampedSigner.getTimestampingUrl(tsaCert); if (certUrl != null) { - System.out.println(rb.getString("TSA location: ") + + System.out.println(rb.getString("TSA.location.") + certUrl); } - System.out.println(rb.getString("TSA certificate: ") + - printCert("", tsaCert, false, 0)); + System.out.println(rb.getString("TSA.certificate.") + + printCert("", tsaCert, false, 0, false)); } if (signingMechanism != null) { System.out.println( - rb.getString("using an alternative signing mechanism")); + rb.getString("using.an.alternative.signing.mechanism")); } } @@ -1351,10 +1349,10 @@ public class JarSigner { block.write(zos); if (verbose != null) { if (zipFile.getEntry(bkFilename) != null) { - System.out.println(rb.getString(" updating: ") + + System.out.println(rb.getString(".updating.") + bkFilename); } else { - System.out.println(rb.getString(" adding: ") + + System.out.println(rb.getString(".adding.") + bkFilename); } } @@ -1378,17 +1376,17 @@ public class JarSigner { if (!ze.getName().startsWith(META_INF)) { if (verbose != null) { if (manifest.getAttributes(ze.getName()) != null) - System.out.println(rb.getString(" signing: ") + + System.out.println(rb.getString(".signing.") + ze.getName()); else - System.out.println(rb.getString(" adding: ") + + System.out.println(rb.getString(".adding.") + ze.getName()); } writeEntry(zipFile, zos, ze); } } } catch(IOException ioe) { - error(rb.getString("unable to sign jar: ")+ioe, ioe); + error(rb.getString("unable.to.sign.jar.")+ioe, ioe); } finally { // close the resouces if (zipFile != null) { @@ -1416,13 +1414,13 @@ public class JarSigner { origJar.delete(); } else { MessageFormat form = new MessageFormat(rb.getString - ("attempt to rename signedJarFile to jarFile failed")); + ("attempt.to.rename.signedJarFile.to.jarFile.failed")); Object[] source = {signedJarFile, jarFile}; error(form.format(source)); } } else { MessageFormat form = new MessageFormat(rb.getString - ("attempt to rename jarFile to origJar failed")); + ("attempt.to.rename.jarFile.to.origJar.failed")); Object[] source = {jarFile, origJar}; error(form.format(source)); } @@ -1434,43 +1432,43 @@ public class JarSigner { || badNetscapeCertType || chainNotValidated) { System.out.println(); - System.out.println(rb.getString("Warning: ")); + System.out.println(rb.getString("Warning.")); if (badKeyUsage) { System.out.println( - rb.getString("The signer certificate's KeyUsage extension doesn't allow code signing.")); + rb.getString("The.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.")); } if (badExtendedKeyUsage) { System.out.println( - rb.getString("The signer certificate's ExtendedKeyUsage extension doesn't allow code signing.")); + rb.getString("The.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.")); } if (badNetscapeCertType) { System.out.println( - rb.getString("The signer certificate's NetscapeCertType extension doesn't allow code signing.")); + rb.getString("The.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.")); } if (hasExpiredCert) { System.out.println( - rb.getString("The signer certificate has expired.")); + rb.getString("The.signer.certificate.has.expired.")); } else if (hasExpiringCert) { System.out.println( - rb.getString("The signer certificate will expire within six months.")); + rb.getString("The.signer.certificate.will.expire.within.six.months.")); } else if (notYetValidCert) { System.out.println( - rb.getString("The signer certificate is not yet valid.")); + rb.getString("The.signer.certificate.is.not.yet.valid.")); } if (chainNotValidated) { System.out.println( - rb.getString("The signer's certificate chain is not validated.")); + rb.getString("The.signer.s.certificate.chain.is.not.validated.")); } } // no IOException thrown in the above try clause, so disable // the catch clause. // } catch(IOException ioe) { - // error(rb.getString("unable to sign jar: ")+ioe, ioe); + // error(rb.getString("unable.to.sign.jar.")+ioe, ioe); // } } @@ -1530,7 +1528,7 @@ public class JarSigner { return false; } - Map cacheForSignerInfo = new IdentityHashMap(); + Map cacheForSignerInfo = new IdentityHashMap<>(); /** * Returns a string of singer info, with a newline at the end @@ -1547,17 +1545,20 @@ public class JarSigner { s.append(printTimestamp(tab, timestamp)); s.append('\n'); } - // display the certificate(s) + // display the certificate(s). The first one is end-enity cert and + // its KeyUsage should be checked. + boolean first = true; for (Certificate c : certs) { - s.append(printCert(tab, c, true, now)); + s.append(printCert(tab, c, true, now, first)); s.append('\n'); + first = false; } try { CertPath cp = certificateFactory.generateCertPath(certs); validator.validate(cp, pkixParameters); } catch (Exception e) { chainNotValidated = true; - s.append(tab + rb.getString("[CertPath not validated: ") + + s.append(tab + rb.getString(".CertPath.not.validated.") + e.getLocalizedMessage() + "]\n"); // TODO } String result = s.toString(); @@ -1624,10 +1625,10 @@ public class JarSigner { if (token && storepass == null && !protectedPath && !KeyStoreUtil.isWindowsKeyStore(storetype)) { storepass = getPass - (rb.getString("Enter Passphrase for keystore: ")); + (rb.getString("Enter.Passphrase.for.keystore.")); } else if (!token && storepass == null && prompt) { storepass = getPass - (rb.getString("Enter Passphrase for keystore: ")); + (rb.getString("Enter.Passphrase.for.keystore.")); } if (nullStream) { @@ -1651,7 +1652,7 @@ public class JarSigner { } } } - Set tas = new HashSet(); + Set tas = new HashSet<>(); try { KeyStore caks = KeyTool.getCacertsKeyStore(); if (caks != null) { @@ -1694,20 +1695,20 @@ public class JarSigner { // Only if tas is empty } } catch (IOException ioe) { - throw new RuntimeException(rb.getString("keystore load: ") + + throw new RuntimeException(rb.getString("keystore.load.") + ioe.getMessage()); } catch (java.security.cert.CertificateException ce) { - throw new RuntimeException(rb.getString("certificate exception: ") + + throw new RuntimeException(rb.getString("certificate.exception.") + ce.getMessage()); } catch (NoSuchProviderException pe) { - throw new RuntimeException(rb.getString("keystore load: ") + + throw new RuntimeException(rb.getString("keystore.load.") + pe.getMessage()); } catch (NoSuchAlgorithmException nsae) { - throw new RuntimeException(rb.getString("keystore load: ") + + throw new RuntimeException(rb.getString("keystore.load.") + nsae.getMessage()); } catch (KeyStoreException kse) { throw new RuntimeException - (rb.getString("unable to instantiate keystore class: ") + + (rb.getString("unable.to.instantiate.keystore.class.") + kse.getMessage()); } } @@ -1723,7 +1724,7 @@ public class JarSigner { } if (cs == null || (!(cs instanceof X509Certificate))) { MessageFormat form = new MessageFormat(rb.getString - ("Certificate not found for: alias. alias must reference a valid KeyStore entry containing an X.509 public key certificate for the Timestamping Authority.")); + ("Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the")); Object[] source = {alias, alias}; error(form.format(source)); } @@ -1816,9 +1817,9 @@ public class JarSigner { generateCertificates(new FileInputStream(altCertChain)). toArray(new Certificate[0]); } catch (CertificateException ex) { - error(rb.getString("Cannot restore certchain from file specified")); + error(rb.getString("Cannot.restore.certchain.from.file.specified")); } catch (FileNotFoundException ex) { - error(rb.getString("File specified by -certchain does not exist")); + error(rb.getString("File.specified.by.certchain.does.not.exist")); } } else { try { @@ -1830,12 +1831,10 @@ public class JarSigner { if (cs == null || cs.length == 0) { if (altCertChain != null) { error(rb.getString - ("Certificate chain not found in the file specified.")); + ("Certificate.chain.not.found.in.the.file.specified.")); } else { MessageFormat form = new MessageFormat(rb.getString - ("Certificate chain not found for: alias. alias must" + - " reference a valid KeyStore key entry containing a" + - " private key and corresponding public key certificate chain.")); + ("Certificate.chain.not.found.for.alias.alias.must.reference.a.valid.KeyStore.key.entry.containing.a.private.key.and")); Object[] source = {alias, alias}; error(form.format(source)); } @@ -1845,14 +1844,14 @@ public class JarSigner { for (int i=0; i] keystore location", + {".keystore.url.keystore.location", "[-keystore ] keystore location"}, - {"[-storepass ] password for keystore integrity", + {".storepass.password.password.for.keystore.integrity", "[-storepass ] password for keystore integrity"}, - {"[-storetype ] keystore type", + {".storetype.type.keystore.type", "[-storetype ] keystore type"}, - {"[-keypass ] password for private key (if different)", + {".keypass.password.password.for.private.key.if.different.", "[-keypass ] password for private key (if different)"}, - {"[-certchain ] name of alternative certchain file", + {".certchain.file.name.of.alternative.certchain.file", "[-certchain ] name of alternative certchain file"}, - {"[-sigfile ] name of .SF/.DSA file", + {".sigfile.file.name.of.SF.DSA.file", "[-sigfile ] name of .SF/.DSA file"}, - {"[-signedjar ] name of signed JAR file", + {".signedjar.file.name.of.signed.JAR.file", "[-signedjar ] name of signed JAR file"}, - {"[-digestalg ] name of digest algorithm", + {".digestalg.algorithm.name.of.digest.algorithm", "[-digestalg ] name of digest algorithm"}, - {"[-sigalg ] name of signature algorithm", + {".sigalg.algorithm.name.of.signature.algorithm", "[-sigalg ] name of signature algorithm"}, - {"[-crl[:auto| ] include CRL in signed jar", + {".crl.auto.file.include.CRL.in.signed.jar", "[-crl[:auto| ] include CRL in signed jar"}, - {"[-verify] verify a signed JAR file", + {".verify.verify.a.signed.JAR.file", "[-verify] verify a signed JAR file"}, - {"[-verbose[:suboptions]] verbose output when signing/verifying.", + {".verbose.suboptions.verbose.output.when.signing.verifying.", "[-verbose[:suboptions]] verbose output when signing/verifying."}, - {" suboptions can be all, grouped or summary", + {".suboptions.can.be.all.grouped.or.summary", " suboptions can be all, grouped or summary"}, - {"[-certs] display certificates when verbose and verifying", + {".certs.display.certificates.when.verbose.and.verifying", "[-certs] display certificates when verbose and verifying"}, - {"[-tsa ] location of the Timestamping Authority", + {".tsa.url.location.of.the.Timestamping.Authority", "[-tsa ] location of the Timestamping Authority"}, - {"[-tsacert ] public key certificate for Timestamping Authority", + {".tsacert.alias.public.key.certificate.for.Timestamping.Authority", "[-tsacert ] public key certificate for Timestamping Authority"}, - {"[-altsigner ] class name of an alternative signing mechanism", + {".altsigner.class.class.name.of.an.alternative.signing.mechanism", "[-altsigner ] class name of an alternative signing mechanism"}, - {"[-altsignerpath ] location of an alternative signing mechanism", + {".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism", "[-altsignerpath ] location of an alternative signing mechanism"}, - {"[-internalsf] include the .SF file inside the signature block", + {".internalsf.include.the.SF.file.inside.the.signature.block", "[-internalsf] include the .SF file inside the signature block"}, - {"[-sectionsonly] don't compute hash of entire manifest", + {".sectionsonly.don.t.compute.hash.of.entire.manifest", "[-sectionsonly] don't compute hash of entire manifest"}, - {"[-protected] keystore has protected authentication path", + {".protected.keystore.has.protected.authentication.path", "[-protected] keystore has protected authentication path"}, - {"[-providerName ] provider name", + {".providerName.name.provider.name", "[-providerName ] provider name"}, - {"[-providerClass name of cryptographic service provider's", + {".providerClass.class.name.of.cryptographic.service.provider.s", "[-providerClass name of cryptographic service provider's"}, - {" [-providerArg ]] ... master class file and constructor argument", + {".providerArg.arg.master.class.file.and.constructor.argument", " [-providerArg ]] ... master class file and constructor argument"}, - {"[-strict] treat warnings as errors", + {".strict.treat.warnings.as.errors", "[-strict] treat warnings as errors"}, - {"Option lacks argument", "Option lacks argument"}, - {"Please type jarsigner -help for usage", "Please type jarsigner -help for usage"}, - {"Please specify jarfile name", "Please specify jarfile name"}, - {"Please specify alias name", "Please specify alias name"}, - {"Only one alias can be specified", "Only one alias can be specified"}, - {"This jar contains signed entries which is not signed by the specified alias(es).", + {"Option.lacks.argument", "Option lacks argument"}, + {"Please.type.jarsigner.help.for.usage", "Please type jarsigner -help for usage"}, + {"Please.specify.jarfile.name", "Please specify jarfile name"}, + {"Please.specify.alias.name", "Please specify alias name"}, + {"Only.one.alias.can.be.specified", "Only one alias can be specified"}, + {"This.jar.contains.signed.entries.which.is.not.signed.by.the.specified.alias.es.", "This jar contains signed entries which is not signed by the specified alias(es)."}, - {"This jar contains signed entries that's not signed by alias in this keystore.", + {"This.jar.contains.signed.entries.that.s.not.signed.by.alias.in.this.keystore.", "This jar contains signed entries that's not signed by alias in this keystore."}, {"s", "s"}, {"m", "m"}, {"k", "k"}, {"i", "i"}, - {"(and %d more)", "(and %d more)"}, - {" s = signature was verified ", + {".and.d.more.", "(and %d more)"}, + {".s.signature.was.verified.", " s = signature was verified "}, - {" m = entry is listed in manifest", + {".m.entry.is.listed.in.manifest", " m = entry is listed in manifest"}, - {" k = at least one certificate was found in keystore", + {".k.at.least.one.certificate.was.found.in.keystore", " k = at least one certificate was found in keystore"}, - {" i = at least one certificate was found in identity scope", + {".i.at.least.one.certificate.was.found.in.identity.scope", " i = at least one certificate was found in identity scope"}, - {" X = not signed by specified alias(es)", + {".X.not.signed.by.specified.alias.es.", " X = not signed by specified alias(es)"}, - {"no manifest.", "no manifest."}, - {"(Signature related entries)","(Signature related entries)"}, - {"(Unsigned entries)", "(Unsigned entries)"}, - {"jar is unsigned. (signatures missing or not parsable)", + {"no.manifest.", "no manifest."}, + {".Signature.related.entries.","(Signature related entries)"}, + {".Unsigned.entries.", "(Unsigned entries)"}, + {"jar.is.unsigned.signatures.missing.or.not.parsable.", "jar is unsigned. (signatures missing or not parsable)"}, - {"jar verified.", "jar verified."}, - {"jarsigner: ", "jarsigner: "}, - {"signature filename must consist of the following characters: A-Z, 0-9, _ or -", + {"jar.verified.", "jar verified."}, + {"jarsigner.", "jarsigner: "}, + {"signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.", "signature filename must consist of the following characters: A-Z, 0-9, _ or -"}, - {"unable to open jar file: ", "unable to open jar file: "}, - {"unable to create: ", "unable to create: "}, - {" adding: ", " adding: "}, - {" updating: ", " updating: "}, - {" signing: ", " signing: "}, - {"attempt to rename signedJarFile to jarFile failed", + {"unable.to.open.jar.file.", "unable to open jar file: "}, + {"unable.to.create.", "unable to create: "}, + {".adding.", " adding: "}, + {".updating.", " updating: "}, + {".signing.", " signing: "}, + {"attempt.to.rename.signedJarFile.to.jarFile.failed", "attempt to rename {0} to {1} failed"}, - {"attempt to rename jarFile to origJar failed", + {"attempt.to.rename.jarFile.to.origJar.failed", "attempt to rename {0} to {1} failed"}, - {"unable to sign jar: ", "unable to sign jar: "}, - {"Enter Passphrase for keystore: ", "Enter Passphrase for keystore: "}, - {"keystore load: ", "keystore load: "}, - {"certificate exception: ", "certificate exception: "}, - {"unable to instantiate keystore class: ", + {"unable.to.sign.jar.", "unable to sign jar: "}, + {"Enter.Passphrase.for.keystore.", "Enter Passphrase for keystore: "}, + {"keystore.load.", "keystore load: "}, + {"certificate.exception.", "certificate exception: "}, + {"unable.to.instantiate.keystore.class.", "unable to instantiate keystore class: "}, - {"Certificate chain not found for: alias. alias must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.", + {"Certificate.chain.not.found.for.alias.alias.must.reference.a.valid.KeyStore.key.entry.containing.a.private.key.and", "Certificate chain not found for: {0}. {1} must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain."}, - {"File specified by -certchain does not exist", + {"File.specified.by.certchain.does.not.exist", "File specified by -certchain does not exist"}, - {"Cannot restore certchain from file specified", + {"Cannot.restore.certchain.from.file.specified", "Cannot restore certchain from file specified"}, - {"Certificate chain not found in the file specified.", + {"Certificate.chain.not.found.in.the.file.specified.", "Certificate chain not found in the file specified."}, - {"found non-X.509 certificate in signer's chain", + {"found.non.X.509.certificate.in.signer.s.chain", "found non-X.509 certificate in signer's chain"}, - {"incomplete certificate chain", "incomplete certificate chain"}, - {"Enter key password for alias: ", "Enter key password for {0}: "}, - {"unable to recover key from keystore", + {"incomplete.certificate.chain", "incomplete certificate chain"}, + {"Enter.key.password.for.alias.", "Enter key password for {0}: "}, + {"unable.to.recover.key.from.keystore", "unable to recover key from keystore"}, - {"key associated with alias not a private key", + {"key.associated.with.alias.not.a.private.key", "key associated with {0} not a private key"}, - {"you must enter key password", "you must enter key password"}, - {"unable to read password: ", "unable to read password: "}, - {"certificate is valid from", "certificate is valid from {0} to {1}"}, - {"certificate expired on", "certificate expired on {0}"}, - {"certificate is not valid until", + {"you.must.enter.key.password", "you must enter key password"}, + {"unable.to.read.password.", "unable to read password: "}, + {"certificate.is.valid.from", "certificate is valid from {0} to {1}"}, + {"certificate.expired.on", "certificate expired on {0}"}, + {"certificate.is.not.valid.until", "certificate is not valid until {0}"}, - {"certificate will expire on", "certificate will expire on {0}"}, - {"[CertPath not validated: ", "[CertPath not validated: "}, - {"requesting a signature timestamp", + {"certificate.will.expire.on", "certificate will expire on {0}"}, + {".CertPath.not.validated.", "[CertPath not validated: "}, + {"requesting.a.signature.timestamp", "requesting a signature timestamp"}, - {"TSA location: ", "TSA location: "}, - {"TSA certificate: ", "TSA certificate: "}, - {"no response from the Timestamping Authority. ", + {"TSA.location.", "TSA location: "}, + {"TSA.certificate.", "TSA certificate: "}, + {"no.response.from.the.Timestamping.Authority.", "no response from the Timestamping Authority. "}, - {"When connecting from behind a firewall then an HTTP proxy may need to be specified. ", + {"When.connecting.from.behind.a.firewall.then.an.HTTP.proxy.may.need.to.be.specified.", "When connecting from behind a firewall then an HTTP proxy may need to be specified. "}, - {"Supply the following options to jarsigner: ", + {"Supply.the.following.options.to.jarsigner.", "Supply the following options to jarsigner: "}, - {"Certificate not found for: alias. alias must reference a valid KeyStore entry containing an X.509 public key certificate for the Timestamping Authority.", + {"Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the", "Certificate not found for: {0}. {1} must reference a valid KeyStore entry containing an X.509 public key certificate for the Timestamping Authority."}, - {"using an alternative signing mechanism", + {"using.an.alternative.signing.mechanism", "using an alternative signing mechanism"}, - {"entry was signed on", "entry was signed on {0}"}, - {"with a CRL including %d entries", "with a CRL including %d entries"}, - {"Warning: ", "Warning: "}, - {"This jar contains unsigned entries which have not been integrity-checked. ", + {"entry.was.signed.on", "entry was signed on {0}"}, + {"with.a.CRL.including.d.entries", "with a CRL including %d entries"}, + {"Warning.", "Warning: "}, + {"This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked.", "This jar contains unsigned entries which have not been integrity-checked. "}, - {"This jar contains entries whose signer certificate has expired. ", + {"This.jar.contains.entries.whose.signer.certificate.has.expired.", "This jar contains entries whose signer certificate has expired. "}, - {"This jar contains entries whose signer certificate will expire within six months. ", + {"This.jar.contains.entries.whose.signer.certificate.will.expire.within.six.months.", "This jar contains entries whose signer certificate will expire within six months. "}, - {"This jar contains entries whose signer certificate is not yet valid. ", + {"This.jar.contains.entries.whose.signer.certificate.is.not.yet.valid.", "This jar contains entries whose signer certificate is not yet valid. "}, - {"Re-run with the -verbose option for more details.", + {"Re.run.with.the.verbose.option.for.more.details.", "Re-run with the -verbose option for more details."}, - {"Re-run with the -verbose and -certs options for more details.", + {"Re.run.with.the.verbose.and.certs.options.for.more.details.", "Re-run with the -verbose and -certs options for more details."}, - {"The signer certificate has expired.", + {"The.signer.certificate.has.expired.", "The signer certificate has expired."}, - {"The signer certificate will expire within six months.", + {"The.signer.certificate.will.expire.within.six.months.", "The signer certificate will expire within six months."}, - {"The signer certificate is not yet valid.", + {"The.signer.certificate.is.not.yet.valid.", "The signer certificate is not yet valid."}, - {"The signer certificate's KeyUsage extension doesn't allow code signing.", + {"The.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.", "The signer certificate's KeyUsage extension doesn't allow code signing."}, - {"The signer certificate's ExtendedKeyUsage extension doesn't allow code signing.", + {"The.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.", "The signer certificate's ExtendedKeyUsage extension doesn't allow code signing."}, - {"The signer certificate's NetscapeCertType extension doesn't allow code signing.", + {"The.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.", "The signer certificate's NetscapeCertType extension doesn't allow code signing."}, - {"This jar contains entries whose signer certificate's KeyUsage extension doesn't allow code signing.", + {"This.jar.contains.entries.whose.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.", "This jar contains entries whose signer certificate's KeyUsage extension doesn't allow code signing."}, - {"This jar contains entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing.", + {"This.jar.contains.entries.whose.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.", "This jar contains entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing."}, - {"This jar contains entries whose signer certificate's NetscapeCertType extension doesn't allow code signing.", + {"This.jar.contains.entries.whose.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.", "This jar contains entries whose signer certificate's NetscapeCertType extension doesn't allow code signing."}, - {"[{0} extension does not support code signing]", + {".{0}.extension.does.not.support.code.signing.", "[{0} extension does not support code signing]"}, - {"The signer's certificate chain is not validated.", + {"The.signer.s.certificate.chain.is.not.validated.", "The signer's certificate chain is not validated."}, - {"This jar contains entries whose certificate chain is not validated.", + {"This.jar.contains.entries.whose.certificate.chain.is.not.validated.", "This jar contains entries whose certificate chain is not validated."}, }; diff --git a/jdk/src/share/classes/sun/security/tools/JarSignerResources_ja.java b/jdk/src/share/classes/sun/security/tools/JarSignerResources_ja.java index 7c25e6bb7d1..263dfe22c77 100644 --- a/jdk/src/share/classes/sun/security/tools/JarSignerResources_ja.java +++ b/jdk/src/share/classes/sun/security/tools/JarSignerResources_ja.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/tools/JarSignerResources_zh_CN.java b/jdk/src/share/classes/sun/security/tools/JarSignerResources_zh_CN.java index c76a722b9de..c36427aa57f 100644 --- a/jdk/src/share/classes/sun/security/tools/JarSignerResources_zh_CN.java +++ b/jdk/src/share/classes/sun/security/tools/JarSignerResources_zh_CN.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/tools/KeyTool.java b/jdk/src/share/classes/sun/security/tools/KeyTool.java index a3a102bfd47..897d407a1c2 100644 --- a/jdk/src/share/classes/sun/security/tools/KeyTool.java +++ b/jdk/src/share/classes/sun/security/tools/KeyTool.java @@ -153,89 +153,89 @@ public final class KeyTool { private KeyStore caks = null; // "cacerts" keystore private char[] srcstorePass = null; private String srcstoretype = null; - private Set passwords = new HashSet (); + private Set passwords = new HashSet<>(); private String startDate = null; - private List ids = new ArrayList (); // used in GENCRL - private List v3ext = new ArrayList (); + private List ids = new ArrayList<>(); // used in GENCRL + private List v3ext = new ArrayList<>(); enum Command { - CERTREQ("Generates a certificate request", + CERTREQ("Generates.a.certificate.request", ALIAS, SIGALG, FILEOUT, KEYPASS, KEYSTORE, DNAME, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V, PROTECTED), - CHANGEALIAS("Changes an entry's alias", + CHANGEALIAS("Changes.an.entry.s.alias", ALIAS, DESTALIAS, KEYPASS, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V, PROTECTED), - DELETE("Deletes an entry", + DELETE("Deletes.an.entry", ALIAS, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V, PROTECTED), - EXPORTCERT("Exports certificate", + EXPORTCERT("Exports.certificate", RFC, ALIAS, FILEOUT, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V, PROTECTED), - GENKEYPAIR("Generates a key pair", + GENKEYPAIR("Generates.a.key.pair", ALIAS, KEYALG, KEYSIZE, SIGALG, DESTALIAS, DNAME, STARTDATE, EXT, VALIDITY, KEYPASS, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V, PROTECTED), - GENSECKEY("Generates a secret key", + GENSECKEY("Generates.a.secret.key", ALIAS, KEYPASS, KEYALG, KEYSIZE, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V, PROTECTED), - GENCERT("Generates certificate from a certificate request", + GENCERT("Generates.certificate.from.a.certificate.request", RFC, INFILE, OUTFILE, ALIAS, SIGALG, DNAME, STARTDATE, EXT, VALIDITY, KEYPASS, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V, PROTECTED), - IMPORTCERT("Imports a certificate or a certificate chain", + IMPORTCERT("Imports.a.certificate.or.a.certificate.chain", NOPROMPT, TRUSTCACERTS, PROTECTED, ALIAS, FILEIN, KEYPASS, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V), - IMPORTKEYSTORE("Imports one or all entries from another keystore", + IMPORTKEYSTORE("Imports.one.or.all.entries.from.another.keystore", SRCKEYSTORE, DESTKEYSTORE, SRCSTORETYPE, DESTSTORETYPE, SRCSTOREPASS, DESTSTOREPASS, SRCPROTECTED, SRCPROVIDERNAME, DESTPROVIDERNAME, SRCALIAS, DESTALIAS, SRCKEYPASS, DESTKEYPASS, NOPROMPT, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V), - KEYPASSWD("Changes the key password of an entry", + KEYPASSWD("Changes.the.key.password.of.an.entry", ALIAS, KEYPASS, NEW, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V), - LIST("Lists entries in a keystore", + LIST("Lists.entries.in.a.keystore", RFC, ALIAS, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V, PROTECTED), - PRINTCERT("Prints the content of a certificate", + PRINTCERT("Prints.the.content.of.a.certificate", RFC, FILEIN, SSLSERVER, JARFILE, V), - PRINTCERTREQ("Prints the content of a certificate request", + PRINTCERTREQ("Prints.the.content.of.a.certificate.request", FILEIN, V), - PRINTCRL("Prints the content of a CRL file", + PRINTCRL("Prints.the.content.of.a.CRL.file", FILEIN, V), - STOREPASSWD("Changes the store password of a keystore", + STOREPASSWD("Changes.the.store.password.of.a.keystore", NEW, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V), // Undocumented start here, KEYCLONE is used a marker in -help; - KEYCLONE("Clones a key entry", + KEYCLONE("Clones.a.key.entry", ALIAS, DESTALIAS, KEYPASS, NEW, STORETYPE, KEYSTORE, STOREPASS, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V), - SELFCERT("Generates a self-signed certificate", + SELFCERT("Generates.a.self.signed.certificate", ALIAS, SIGALG, DNAME, STARTDATE, VALIDITY, KEYPASS, STORETYPE, KEYSTORE, STOREPASS, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V), - GENCRL("Generates CRL", + GENCRL("Generates.CRL", RFC, FILEOUT, ID, ALIAS, SIGALG, EXT, KEYPASS, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V, PROTECTED), - IDENTITYDB("Imports entries from a JDK 1.1.x-style identity database", + IDENTITYDB("Imports.entries.from.a.JDK.1.1.x.style.identity.database", FILEIN, STORETYPE, KEYSTORE, STOREPASS, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V); @@ -252,49 +252,49 @@ public final class KeyTool { }; enum Option { - ALIAS("alias", "", "alias name of the entry to process"), - DESTALIAS("destalias", "", "destination alias"), - DESTKEYPASS("destkeypass", "", "destination key password"), - DESTKEYSTORE("destkeystore", "", "destination keystore name"), - DESTPROTECTED("destprotected", null, "destination keystore password protected"), - DESTPROVIDERNAME("destprovidername", "", "destination keystore provider name"), - DESTSTOREPASS("deststorepass", "", "destination keystore password"), - DESTSTORETYPE("deststoretype", "", "destination keystore type"), - DNAME("dname", "", "distinguished name"), - EXT("ext", "", "X.509 extension"), - FILEOUT("file", "", "output file name"), - FILEIN("file", "", "input file name"), - ID("id", "", "Serial ID of cert to revoke"), - INFILE("infile", "", "input file name"), - KEYALG("keyalg", "", "key algorithm name"), - KEYPASS("keypass", "", "key password"), - KEYSIZE("keysize", "", "key bit size"), - KEYSTORE("keystore", "", "keystore name"), - NEW("new", "", "new password"), - NOPROMPT("noprompt", null, "do not prompt"), - OUTFILE("outfile", "", "output file name"), - PROTECTED("protected", null, "password through protected mechanism"), - PROVIDERARG("providerarg", "", "provider argument"), - PROVIDERCLASS("providerclass", "", "provider class name"), - PROVIDERNAME("providername", "", "provider name"), - PROVIDERPATH("providerpath", "", "provider classpath"), - RFC("rfc", null, "output in RFC style"), - SIGALG("sigalg", "", "signature algorithm name"), - SRCALIAS("srcalias", "", "source alias"), - SRCKEYPASS("srckeypass", "", "source key password"), - SRCKEYSTORE("srckeystore", "", "source keystore name"), - SRCPROTECTED("srcprotected", null, "source keystore password protected"), - SRCPROVIDERNAME("srcprovidername", "", "source keystore provider name"), - SRCSTOREPASS("srcstorepass", "", "source keystore password"), - SRCSTORETYPE("srcstoretype", "", "source keystore type"), - SSLSERVER("sslserver", "", "SSL server host and port"), - JARFILE("jarfile", "", "signed jar file"), - STARTDATE("startdate", "", "certificate validity start date/time"), - STOREPASS("storepass", "", "keystore password"), - STORETYPE("storetype", "", "keystore type"), - TRUSTCACERTS("trustcacerts", null, "trust certificates from cacerts"), - V("v", null, "verbose output"), - VALIDITY("validity", "", "validity number of days"); + ALIAS("alias", "", "alias.name.of.the.entry.to.process"), + DESTALIAS("destalias", "", "destination.alias"), + DESTKEYPASS("destkeypass", "", "destination.key.password"), + DESTKEYSTORE("destkeystore", "", "destination.keystore.name"), + DESTPROTECTED("destprotected", null, "destination.keystore.password.protected"), + DESTPROVIDERNAME("destprovidername", "", "destination.keystore.provider.name"), + DESTSTOREPASS("deststorepass", "", "destination.keystore.password"), + DESTSTORETYPE("deststoretype", "", "destination.keystore.type"), + DNAME("dname", "", "distinguished.name"), + EXT("ext", "", "X.509.extension"), + FILEOUT("file", "", "output.file.name"), + FILEIN("file", "", "input.file.name"), + ID("id", "", "Serial.ID.of.cert.to.revoke"), + INFILE("infile", "", "input.file.name"), + KEYALG("keyalg", "", "key.algorithm.name"), + KEYPASS("keypass", "", "key.password"), + KEYSIZE("keysize", "", "key.bit.size"), + KEYSTORE("keystore", "", "keystore.name"), + NEW("new", "", "new.password"), + NOPROMPT("noprompt", null, "do.not.prompt"), + OUTFILE("outfile", "", "output.file.name"), + PROTECTED("protected", null, "password.through.protected.mechanism"), + PROVIDERARG("providerarg", "", "provider.argument"), + PROVIDERCLASS("providerclass", "", "provider.class.name"), + PROVIDERNAME("providername", "", "provider.name"), + PROVIDERPATH("providerpath", "", "provider.classpath"), + RFC("rfc", null, "output.in.RFC.style"), + SIGALG("sigalg", "", "signature.algorithm.name"), + SRCALIAS("srcalias", "", "source.alias"), + SRCKEYPASS("srckeypass", "", "source.key.password"), + SRCKEYSTORE("srckeystore", "", "source.keystore.name"), + SRCPROTECTED("srcprotected", null, "source.keystore.password.protected"), + SRCPROVIDERNAME("srcprovidername", "", "source.keystore.provider.name"), + SRCSTOREPASS("srcstorepass", "", "source.keystore.password"), + SRCSTORETYPE("srcstoretype", "", "source.keystore.type"), + SSLSERVER("sslserver", "", "SSL.server.host.and.port"), + JARFILE("jarfile", "", "signed.jar.file"), + STARTDATE("startdate", "", "certificate.validity.start.date.time"), + STOREPASS("storepass", "", "keystore.password"), + STORETYPE("storetype", "", "keystore.type"), + TRUSTCACERTS("trustcacerts", null, "trust.certificates.from.cacerts"), + V("v", null, "verbose.output"), + VALIDITY("validity", "", "validity.number.of.days"); final String name, arg, description; Option(String name, String arg, String description) { @@ -339,7 +339,7 @@ public final class KeyTool { doCommands(out); } } catch (Exception e) { - System.out.println(rb.getString("keytool error: ") + e); + System.out.println(rb.getString("keytool.error.") + e); if (verbose) { e.printStackTrace(System.out); } @@ -532,13 +532,13 @@ public final class KeyTool { } else if (collator.compare(flags, "-srcprotected") == 0) { srcprotectedPath = true; } else { - System.err.println(rb.getString("Illegal option: ") + flags); + System.err.println(rb.getString("Illegal.option.") + flags); tinyHelp(); } } if (i value.")); + "Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.")); if (keyPass != null && !Arrays.equals(storePass, keyPass)) { Object[] source = {"-keypass"}; System.err.println(form.format(source)); @@ -946,10 +933,10 @@ public final class KeyTool { } if (verbose && filename != null) { MessageFormat form = new MessageFormat(rb.getString - ("Certification request stored in file ")); + ("Certification.request.stored.in.file.filename.")); Object[] source = {filename}; System.err.println(form.format(source)); - System.err.println(rb.getString("Submit this to your CA")); + System.err.println(rb.getString("Submit.this.to.your.CA")); } } else if (command == DELETE) { doDeleteEntry(alias); @@ -970,7 +957,7 @@ public final class KeyTool { } if (filename != null) { MessageFormat form = new MessageFormat(rb.getString - ("Certificate stored in file ")); + ("Certificate.stored.in.file.filename.")); Object[] source = {filename}; System.err.println(form.format(source)); } @@ -1010,10 +997,10 @@ public final class KeyTool { kssave = installReply(importAlias, inStream); if (kssave) { System.err.println(rb.getString - ("Certificate reply was installed in keystore")); + ("Certificate.reply.was.installed.in.keystore")); } else { System.err.println(rb.getString - ("Certificate reply was not installed in keystore")); + ("Certificate.reply.was.not.installed.in.keystore")); } } else if (!keyStore.containsAlias(importAlias) || keyStore.entryInstanceOf(importAlias, @@ -1021,10 +1008,10 @@ public final class KeyTool { kssave = addTrustedCert(importAlias, inStream); if (kssave) { System.err.println(rb.getString - ("Certificate was added to keystore")); + ("Certificate.was.added.to.keystore")); } else { System.err.println(rb.getString - ("Certificate was not added to keystore")); + ("Certificate.was.not.added.to.keystore")); } } } finally { @@ -1044,14 +1031,13 @@ public final class KeyTool { } if (keyStore.containsAlias(alias) == false) { MessageFormat form = new MessageFormat - (rb.getString("Alias does not exist")); + (rb.getString("Alias.alias.does.not.exist")); Object[] source = {alias}; throw new Exception(form.format(source)); } if (!keyStore.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class)) { MessageFormat form = new MessageFormat(rb.getString( - "Alias references an entry type that is not a private key entry. " + - "The -keyclone command only supports cloning of private key entries")); + "Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -1148,7 +1134,7 @@ public final class KeyTool { if (kssave) { if (verbose) { MessageFormat form = new MessageFormat - (rb.getString("[Storing ksfname]")); + (rb.getString(".Storing.ksfname.")); Object[] source = {nullStream ? "keystore" : ksfname}; System.err.println(form.format(source)); } @@ -1336,7 +1322,7 @@ public final class KeyTool { Certificate cert = keyStore.getCertificate(alias); if (cert == null) { MessageFormat form = new MessageFormat - (rb.getString("alias has no public key (certificate)")); + (rb.getString("alias.has.no.public.key.certificate.")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -1368,7 +1354,7 @@ public final class KeyTool { private void doDeleteEntry(String alias) throws Exception { if (keyStore.containsAlias(alias) == false) { MessageFormat form = new MessageFormat - (rb.getString("Alias does not exist")); + (rb.getString("Alias.alias.does.not.exist")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -1390,7 +1376,7 @@ public final class KeyTool { } if (keyStore.containsAlias(alias) == false) { MessageFormat form = new MessageFormat - (rb.getString("Alias does not exist")); + (rb.getString("Alias.alias.does.not.exist")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -1398,7 +1384,7 @@ public final class KeyTool { X509Certificate cert = (X509Certificate)keyStore.getCertificate(alias); if (cert == null) { MessageFormat form = new MessageFormat - (rb.getString("Alias has no certificate")); + (rb.getString("Alias.alias.has.no.certificate")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -1419,15 +1405,15 @@ public final class KeyTool { int count; for (count = 0; count < 3; count++) { MessageFormat form = new MessageFormat(rb.getString - ("Enter key password for ")); + ("Enter.key.password.for.alias.")); Object[] source = {alias}; System.err.println(form.format(source)); if (orig == null) { System.err.print(rb.getString - ("\t(RETURN if same as keystore password): ")); + (".RETURN.if.same.as.keystore.password.")); } else { form = new MessageFormat(rb.getString - ("\t(RETURN if same as for )")); + (".RETURN.if.same.as.for.otherAlias.")); Object[] src = {orig}; System.err.print(form.format(src)); } @@ -1437,27 +1423,27 @@ public final class KeyTool { if (entered == null) { return origPass; } else if (entered.length >= 6) { - System.err.print(rb.getString("Re-enter new password: ")); + System.err.print(rb.getString("Re.enter.new.password.")); char[] passAgain = Password.readPassword(System.in); passwords.add(passAgain); if (!Arrays.equals(entered, passAgain)) { System.err.println - (rb.getString("They don't match. Try again")); + (rb.getString("They.don.t.match.Try.again")); continue; } return entered; } else { System.err.println(rb.getString - ("Key password is too short - must be at least 6 characters")); + ("Key.password.is.too.short.must.be.at.least.6.characters")); } } if (count == 3) { if (command == KEYCLONE) { throw new Exception(rb.getString - ("Too many failures. Key entry not cloned")); + ("Too.many.failures.Key.entry.not.cloned")); } else { throw new Exception(rb.getString - ("Too many failures - key not added to keystore")); + ("Too.many.failures.key.not.added.to.keystore")); } } } @@ -1475,7 +1461,7 @@ public final class KeyTool { } if (keyStore.containsAlias(alias)) { MessageFormat form = new MessageFormat(rb.getString - ("Secret key not generated, alias already exists")); + ("Secret.key.not.generated.alias.alias.already.exists")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -1490,7 +1476,7 @@ public final class KeyTool { keygen.init(168); } else { throw new Exception(rb.getString - ("Please provide -keysize for secret key generation")); + ("Please.provide.keysize.for.secret.key.generation")); } secKey = keygen.generateKey(); @@ -1514,7 +1500,7 @@ public final class KeyTool { return "SHA256withECDSA"; } else { throw new Exception(rb.getString - ("Cannot derive signature algorithm")); + ("Cannot.derive.signature.algorithm")); } } /** @@ -1540,7 +1526,7 @@ public final class KeyTool { if (keyStore.containsAlias(alias)) { MessageFormat form = new MessageFormat(rb.getString - ("Key pair not generated, alias already exists")); + ("Key.pair.not.generated.alias.alias.already.exists")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -1569,8 +1555,7 @@ public final class KeyTool { if (verbose) { MessageFormat form = new MessageFormat(rb.getString - ("Generating keysize bit keyAlgName key pair and self-signed certificate " + - "(sigAlgName) with a validity of validality days\n\tfor: x500Name")); + ("Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for")); Object[] source = {new Integer(keysize), privKey.getAlgorithm(), chain[0].getSigAlgName(), @@ -1603,7 +1588,7 @@ public final class KeyTool { if (keyStore.containsAlias(dest)) { MessageFormat form = new MessageFormat - (rb.getString("Destination alias already exists")); + (rb.getString("Destination.alias.dest.already.exists")); Object[] source = {dest}; throw new Exception(form.format(source)); } @@ -1644,7 +1629,7 @@ public final class KeyTool { if (keyPassNew == null) { MessageFormat form = new MessageFormat - (rb.getString("key password for ")); + (rb.getString("key.password.for.alias.")); Object[] source = {alias}; keyPassNew = getNewPasswd(form.format(source), keyPass); } @@ -1661,7 +1646,7 @@ public final class KeyTool { throws Exception { System.err.println(rb.getString - ("No entries from identity database added")); + ("No.entries.from.identity.database.added")); } /** @@ -1678,32 +1663,32 @@ public final class KeyTool { if (keyStore.containsAlias(alias) == false) { MessageFormat form = new MessageFormat - (rb.getString("Alias does not exist")); + (rb.getString("Alias.alias.does.not.exist")); Object[] source = {alias}; throw new Exception(form.format(source)); } if (verbose || rfc || debug) { MessageFormat form = new MessageFormat - (rb.getString("Alias name: alias")); + (rb.getString("Alias.name.alias")); Object[] source = {alias}; out.println(form.format(source)); if (!token) { form = new MessageFormat(rb.getString - ("Creation date: keyStore.getCreationDate(alias)")); + ("Creation.date.keyStore.getCreationDate.alias.")); Object[] src = {keyStore.getCreationDate(alias)}; out.println(form.format(src)); } } else { if (!token) { MessageFormat form = new MessageFormat - (rb.getString("alias, keyStore.getCreationDate(alias), ")); + (rb.getString("alias.keyStore.getCreationDate.alias.")); Object[] source = {alias, keyStore.getCreationDate(alias)}; out.print(form.format(source)); } else { MessageFormat form = new MessageFormat - (rb.getString("alias, ")); + (rb.getString("alias.")); Object[] source = {alias}; out.print(form.format(source)); } @@ -1713,7 +1698,7 @@ public final class KeyTool { if (verbose || rfc || debug) { Object[] source = {"SecretKeyEntry"}; out.println(new MessageFormat( - rb.getString("Entry type: ")).format(source)); + rb.getString("Entry.type.type.")).format(source)); } else { out.println("SecretKeyEntry, "); } @@ -1721,7 +1706,7 @@ public final class KeyTool { if (verbose || rfc || debug) { Object[] source = {"PrivateKeyEntry"}; out.println(new MessageFormat( - rb.getString("Entry type: ")).format(source)); + rb.getString("Entry.type.type.")).format(source)); } else { out.println("PrivateKeyEntry, "); } @@ -1731,10 +1716,10 @@ public final class KeyTool { if (chain != null) { if (verbose || rfc || debug) { out.println(rb.getString - ("Certificate chain length: ") + chain.length); + ("Certificate.chain.length.") + chain.length); for (int i = 0; i < chain.length; i ++) { MessageFormat form = new MessageFormat - (rb.getString("Certificate[(i + 1)]:")); + (rb.getString("Certificate.i.1.")); Object[] source = {new Integer((i + 1))}; out.println(form.format(source)); if (verbose && (chain[i] instanceof X509Certificate)) { @@ -1748,7 +1733,7 @@ public final class KeyTool { } else { // Print the digest of the user cert only out.println - (rb.getString("Certificate fingerprint (SHA1): ") + + (rb.getString("Certificate.fingerprint.SHA1.") + getCertFingerPrint("SHA1", chain[0])); } } @@ -1757,20 +1742,20 @@ public final class KeyTool { // We have a trusted certificate entry Certificate cert = keyStore.getCertificate(alias); if (verbose && (cert instanceof X509Certificate)) { - out.println(rb.getString("Entry type: trustedCertEntry\n")); + out.println(rb.getString("Entry.type.trustedCertEntry.")); printX509Cert((X509Certificate)cert, out); } else if (rfc) { - out.println(rb.getString("Entry type: trustedCertEntry\n")); + out.println(rb.getString("Entry.type.trustedCertEntry.")); dumpCert(cert, out); } else if (debug) { out.println(cert.toString()); } else { - out.println(rb.getString("trustedCertEntry,")); - out.println(rb.getString("Certificate fingerprint (SHA1): ") + out.println(rb.getString("trustedCertEntry.")); + out.println(rb.getString("Certificate.fingerprint.SHA1.") + getCertFingerPrint("SHA1", cert)); } } else { - out.println(rb.getString("Unknown Entry Type")); + out.println(rb.getString("Unknown.Entry.Type")); } } @@ -1787,7 +1772,7 @@ public final class KeyTool { KeyStoreUtil.isWindowsKeyStore(srcstoretype)) { if (!NONE.equals(srcksfname)) { System.err.println(MessageFormat.format(rb.getString - ("-keystore must be NONE if -storetype is {0}"), srcstoretype)); + (".keystore.must.be.NONE.if.storetype.is.{0}"), srcstoretype)); System.err.println(); tinyHelp(); } @@ -1797,13 +1782,13 @@ public final class KeyTool { File srcksfile = new File(srcksfname); if (srcksfile.exists() && srcksfile.length() == 0) { throw new Exception(rb.getString - ("Source keystore file exists, but is empty: ") + + ("Source.keystore.file.exists.but.is.empty.") + srcksfname); } is = new FileInputStream(srcksfile); } else { throw new Exception(rb.getString - ("Please specify -srckeystore")); + ("Please.specify.srckeystore")); } } @@ -1818,7 +1803,7 @@ public final class KeyTool { if (srcstorePass == null && !srcprotectedPath && !KeyStoreUtil.isWindowsKeyStore(srcstoretype)) { - System.err.print(rb.getString("Enter source keystore password: ")); + System.err.print(rb.getString("Enter.source.keystore.password.")); System.err.flush(); srcstorePass = Password.readPassword(System.in); passwords.add(srcstorePass); @@ -1829,8 +1814,7 @@ public final class KeyTool { if (srckeyPass != null && srcstorePass != null && !Arrays.equals(srcstorePass, srckeyPass)) { MessageFormat form = new MessageFormat(rb.getString( - "Warning: Different store and key passwords not supported " + - "for PKCS12 KeyStores. Ignoring user-specified value.")); + "Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.")); Object[] source = {"-srckeypass"}; System.err.println(form.format(source)); srckeyPass = srcstorePass; @@ -1850,15 +1834,15 @@ public final class KeyTool { // but change 2 lines System.err.println(); System.err.println(rb.getString - ("***************** WARNING WARNING WARNING *****************")); + (".WARNING.WARNING.WARNING.")); System.err.println(rb.getString - ("* The integrity of the information stored in the srckeystore*")); + (".The.integrity.of.the.information.stored.in.the.srckeystore.")); System.err.println(rb.getString - ("* has NOT been verified! In order to verify its integrity, *")); + (".has.NOT.been.verified.In.order.to.verify.its.integrity.")); System.err.println(rb.getString - ("* you must provide the srckeystore password. *")); + (".you.must.provide.the.srckeystore.password.")); System.err.println(rb.getString - ("***************** WARNING WARNING WARNING *****************")); + (".WARNING.WARNING.WARNING.")); System.err.println(); } @@ -1877,8 +1861,7 @@ public final class KeyTool { } else { if (dest != null || srckeyPass != null || destKeyPass != null) { throw new Exception(rb.getString( - "if alias not specified, destalias, srckeypass, " + - "and destkeypass must not be specified")); + "if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified")); } doImportKeyStoreAll(loadSourceKeyStore()); } @@ -1906,16 +1889,16 @@ public final class KeyTool { Object[] source = {alias}; if (noprompt) { System.err.println(new MessageFormat(rb.getString( - "Warning: Overwriting existing alias in destination keystore")).format(source)); + "Warning.Overwriting.existing.alias.alias.in.destination.keystore")).format(source)); } else { String reply = getYesNoReply(new MessageFormat(rb.getString( - "Existing entry alias exists, overwrite? [no]: ")).format(source)); + "Existing.entry.alias.alias.exists.overwrite.no.")).format(source)); if ("NO".equals(reply)) { newAlias = inputStringFromStdin(rb.getString - ("Enter new alias name\t(RETURN to cancel import for this entry): ")); + ("Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.")); if ("".equals(newAlias)) { System.err.println(new MessageFormat(rb.getString( - "Entry for alias not imported.")).format( + "Entry.for.alias.alias.not.imported.")).format( source)); return 0; } @@ -1944,7 +1927,7 @@ public final class KeyTool { } catch (KeyStoreException kse) { Object[] source2 = {alias, kse.toString()}; MessageFormat form = new MessageFormat(rb.getString( - "Problem importing entry for alias : .\nEntry for alias not imported.")); + "Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.")); System.err.println(form.format(source2)); return 2; } @@ -1961,7 +1944,7 @@ public final class KeyTool { if (result == 1) { ok++; Object[] source = {alias}; - MessageFormat form = new MessageFormat(rb.getString("Entry for alias successfully imported.")); + MessageFormat form = new MessageFormat(rb.getString("Entry.for.alias.alias.successfully.imported.")); System.err.println(form.format(source)); } else if (result == 2) { if (!noprompt) { @@ -1974,7 +1957,7 @@ public final class KeyTool { } Object[] source = {ok, count-ok}; MessageFormat form = new MessageFormat(rb.getString( - "Import command completed: entries successfully imported, entries failed or cancelled")); + "Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled")); System.err.println(form.format(source)); } @@ -1991,17 +1974,17 @@ public final class KeyTool { out.println(); } - out.println(rb.getString("Keystore type: ") + keyStore.getType()); - out.println(rb.getString("Keystore provider: ") + + out.println(rb.getString("Keystore.type.") + keyStore.getType()); + out.println(rb.getString("Keystore.provider.") + keyStore.getProvider().getName()); out.println(); MessageFormat form; form = (keyStore.size() == 1) ? new MessageFormat(rb.getString - ("Your keystore contains keyStore.size() entry")) : + ("Your.keystore.contains.keyStore.size.entry")) : new MessageFormat(rb.getString - ("Your keystore contains keyStore.size() entries")); + ("Your.keystore.contains.keyStore.size.entries")); Object[] source = {new Integer(keyStore.size())}; out.println(form.format(source)); out.println(); @@ -2011,11 +1994,11 @@ public final class KeyTool { String alias = e.nextElement(); doPrintEntry(alias, out, false); if (verbose || rfc) { - out.println(rb.getString("\n")); + out.println(rb.getString("NEWLINE")); out.println(rb.getString - ("*******************************************")); + ("STAR")); out.println(rb.getString - ("*******************************************\n\n")); + ("STARNN")); } } } @@ -2108,7 +2091,7 @@ public final class KeyTool { */ public static List readCRLsFromCert(X509Certificate cert) throws Exception { - List crls = new ArrayList(); + List crls = new ArrayList<>(); CRLDistributionPointsExtension ext = X509CertImpl.toImpl(cert).getCRLDistributionPointsExtension(); if (ext == null) return crls; @@ -2171,10 +2154,10 @@ public final class KeyTool { } if (issuer == null) { out.println(rb.getString - ("*******************************************")); + ("STAR")); out.println("WARNING: not verified. Make sure -keystore and -alias are correct."); out.println(rb.getString - ("*******************************************\n\n")); + ("STARNN")); } } } @@ -2214,15 +2197,14 @@ public final class KeyTool { PKCS10 req = new PKCS10(new BASE64Decoder().decodeBuffer(new String(sb))); PublicKey pkey = req.getSubjectPublicKeyInfo(); - out.printf(rb.getString("PKCS #10 Certificate Request (Version 1.0)\n" + - "Subject: %s\nPublic Key: %s format %s key\n"), + out.printf(rb.getString("PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key."), req.getSubjectName(), pkey.getFormat(), pkey.getAlgorithm()); for (PKCS10Attribute attr: req.getAttributes().getAttributes()) { ObjectIdentifier oid = attr.getAttributeId(); if (oid.equals(PKCS9Attribute.EXTENSION_REQUEST_OID)) { CertificateExtensions exts = (CertificateExtensions)attr.getAttributeValue(); if (exts != null) { - printExtensions(rb.getString("Extension Request:"), exts, out); + printExtensions(rb.getString("Extension.Request."), exts, out); } } else { out.println(attr.getAttributeId()); @@ -2245,10 +2227,10 @@ public final class KeyTool { try { c = cf.generateCertificates(in); } catch (CertificateException ce) { - throw new Exception(rb.getString("Failed to parse input"), ce); + throw new Exception(rb.getString("Failed.to.parse.input"), ce); } if (c.isEmpty()) { - throw new Exception(rb.getString("Empty input")); + throw new Exception(rb.getString("Empty.input")); } Certificate[] certs = c.toArray(new Certificate[c.size()]); for (int i=0; i 1) { MessageFormat form = new MessageFormat - (rb.getString("Certificate[(i + 1)]:")); + (rb.getString("Certificate.i.1.")); Object[] source = {new Integer(i + 1)}; out.println(form.format(source)); } @@ -2276,7 +2258,7 @@ public final class KeyTool { if (jarfile != null) { JarFile jf = new JarFile(jarfile, true); Enumeration entries = jf.entries(); - Set ss = new HashSet(); + Set ss = new HashSet<>(); byte[] buffer = new byte[8192]; int pos = 0; while (entries.hasMoreElements()) { @@ -2299,15 +2281,15 @@ public final class KeyTool { for (CodeSigner signer: signers) { if (!ss.contains(signer)) { ss.add(signer); - out.printf(rb.getString("Signer #%d:"), ++pos); + out.printf(rb.getString("Signer.d."), ++pos); out.println(); out.println(); - out.println(rb.getString("Signature:")); + out.println(rb.getString("Signature.")); out.println(); for (Certificate cert: signer.getSignerCertPath().getCertificates()) { X509Certificate x = (X509Certificate)cert; if (rfc) { - out.println(rb.getString("Certificate owner: ") + x.getSubjectDN() + "\n"); + out.println(rb.getString("Certificate.owner.") + x.getSubjectDN() + "\n"); dumpCert(x, out); } else { printX509Cert(x, out); @@ -2316,12 +2298,12 @@ public final class KeyTool { } Timestamp ts = signer.getTimestamp(); if (ts != null) { - out.println(rb.getString("Timestamp:")); + out.println(rb.getString("Timestamp.")); out.println(); for (Certificate cert: ts.getSignerCertPath().getCertificates()) { X509Certificate x = (X509Certificate)cert; if (rfc) { - out.println(rb.getString("Certificate owner: ") + x.getSubjectDN() + "\n"); + out.println(rb.getString("Certificate.owner.") + x.getSubjectDN() + "\n"); dumpCert(x, out); } else { printX509Cert(x, out); @@ -2333,7 +2315,7 @@ public final class KeyTool { .getJavaSecurityCodeSignerAccess() .getCRLs(signer); if (crls != null) { - out.println(rb.getString("CRLs:")); + out.println(rb.getString("CRLs.")); out.println(); for (CRL crl: crls) { printCRL(crl, out); @@ -2345,7 +2327,7 @@ public final class KeyTool { } jf.close(); if (ss.size() == 0) { - out.println(rb.getString("Not a signed jar file")); + out.println(rb.getString("Not.a.signed.jar.file")); } } else if (sslserver != null) { SSLContext sc = SSLContext.getInstance("SSL"); @@ -2410,7 +2392,7 @@ public final class KeyTool { // if the URL connection is successful. if (!certPrinted[0]) { Exception e = new Exception( - rb.getString("No certificate from the SSL server")); + rb.getString("No.certificate.from.the.SSL.server")); if (ex != null) { e.initCause(ex); } @@ -2455,13 +2437,13 @@ public final class KeyTool { Certificate oldCert = keyStore.getCertificate(alias); if (oldCert == null) { MessageFormat form = new MessageFormat - (rb.getString("alias has no public key")); + (rb.getString("alias.has.no.public.key")); Object[] source = {alias}; throw new Exception(form.format(source)); } if (!(oldCert instanceof X509Certificate)) { MessageFormat form = new MessageFormat - (rb.getString("alias has no X.509 certificate")); + (rb.getString("alias.has.no.X.509.certificate")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -2532,7 +2514,7 @@ public final class KeyTool { new Certificate[] { newCert } ); if (verbose) { - System.err.println(rb.getString("New certificate (self-signed):")); + System.err.println(rb.getString("New.certificate.self.signed.")); System.err.print(newCert.toString()); System.err.println(); } @@ -2568,7 +2550,7 @@ public final class KeyTool { Certificate userCert = keyStore.getCertificate(alias); if (userCert == null) { MessageFormat form = new MessageFormat - (rb.getString("alias has no public key (certificate)")); + (rb.getString("alias.has.no.public.key.certificate.")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -2576,7 +2558,7 @@ public final class KeyTool { // Read the certificates in the reply Collection c = cf.generateCertificates(in); if (c.isEmpty()) { - throw new Exception(rb.getString("Reply has no certificates")); + throw new Exception(rb.getString("Reply.has.no.certificates")); } Certificate[] replyCerts = c.toArray(new Certificate[c.size()]); Certificate[] newChain; @@ -2609,11 +2591,11 @@ public final class KeyTool { throws Exception { if (alias == null) { - throw new Exception(rb.getString("Must specify alias")); + throw new Exception(rb.getString("Must.specify.alias")); } if (keyStore.containsAlias(alias)) { MessageFormat form = new MessageFormat(rb.getString - ("Certificate not imported, alias already exists")); + ("Certificate.not.imported.alias.alias.already.exists")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -2623,9 +2605,9 @@ public final class KeyTool { try { cert = (X509Certificate)cf.generateCertificate(in); } catch (ClassCastException cce) { - throw new Exception(rb.getString("Input not an X.509 certificate")); + throw new Exception(rb.getString("Input.not.an.X.509.certificate")); } catch (CertificateException ce) { - throw new Exception(rb.getString("Input not an X.509 certificate")); + throw new Exception(rb.getString("Input.not.an.X.509.certificate")); } // if certificate is self-signed, make sure it verifies @@ -2645,27 +2627,27 @@ public final class KeyTool { String trustalias = keyStore.getCertificateAlias(cert); if (trustalias != null) { MessageFormat form = new MessageFormat(rb.getString - ("Certificate already exists in keystore under alias ")); + ("Certificate.already.exists.in.keystore.under.alias.trustalias.")); Object[] source = {trustalias}; System.err.println(form.format(source)); reply = getYesNoReply - (rb.getString("Do you still want to add it? [no]: ")); + (rb.getString("Do.you.still.want.to.add.it.no.")); } else if (selfSigned) { if (trustcacerts && (caks != null) && ((trustalias=caks.getCertificateAlias(cert)) != null)) { MessageFormat form = new MessageFormat(rb.getString - ("Certificate already exists in system-wide CA keystore under alias ")); + ("Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.")); Object[] source = {trustalias}; System.err.println(form.format(source)); reply = getYesNoReply - (rb.getString("Do you still want to add it to your own keystore? [no]: ")); + (rb.getString("Do.you.still.want.to.add.it.to.your.own.keystore.no.")); } if (trustalias == null) { // Print the cert and ask user if they really want to add // it to their keystore printX509Cert(cert, System.out); reply = getYesNoReply - (rb.getString("Trust this certificate? [no]: ")); + (rb.getString("Trust.this.certificate.no.")); } } if (reply != null) { @@ -2689,7 +2671,7 @@ public final class KeyTool { // their keystore printX509Cert(cert, System.out); reply = getYesNoReply - (rb.getString("Trust this certificate? [no]: ")); + (rb.getString("Trust.this.certificate.no.")); if ("YES".equals(reply)) { keyStore.setCertificateEntry(alias, cert); return true; @@ -2716,26 +2698,26 @@ public final class KeyTool { for (int count = 0; count < 3; count++) { MessageFormat form = new MessageFormat - (rb.getString("New prompt: ")); + (rb.getString("New.prompt.")); Object[] source = {prompt}; System.err.print(form.format(source)); entered = Password.readPassword(System.in); passwords.add(entered); if (entered == null || entered.length < 6) { System.err.println(rb.getString - ("Password is too short - must be at least 6 characters")); + ("Password.is.too.short.must.be.at.least.6.characters")); } else if (Arrays.equals(entered, oldPasswd)) { - System.err.println(rb.getString("Passwords must differ")); + System.err.println(rb.getString("Passwords.must.differ")); } else { form = new MessageFormat - (rb.getString("Re-enter new prompt: ")); + (rb.getString("Re.enter.new.prompt.")); Object[] src = {prompt}; System.err.print(form.format(src)); reentered = Password.readPassword(System.in); passwords.add(reentered); if (!Arrays.equals(entered, reentered)) { System.err.println - (rb.getString("They don't match. Try again")); + (rb.getString("They.don.t.match.Try.again")); } else { Arrays.fill(reentered, ' '); return entered; @@ -2750,7 +2732,7 @@ public final class KeyTool { reentered = null; } } - throw new Exception(rb.getString("Too many failures - try later")); + throw new Exception(rb.getString("Too.many.failures.try.later")); } /** @@ -2761,11 +2743,11 @@ public final class KeyTool { private String getAlias(String prompt) throws Exception { if (prompt != null) { MessageFormat form = new MessageFormat - (rb.getString("Enter prompt alias name: ")); + (rb.getString("Enter.prompt.alias.name.")); Object[] source = {prompt}; System.err.print(form.format(source)); } else { - System.err.print(rb.getString("Enter alias name: ")); + System.err.print(rb.getString("Enter.alias.name.")); } return (new BufferedReader(new InputStreamReader( System.in))).readLine(); @@ -2796,17 +2778,17 @@ public final class KeyTool { do { if (otherKeyPass != null) { MessageFormat form = new MessageFormat(rb.getString - ("Enter key password for ")); + ("Enter.key.password.for.alias.")); Object[] source = {alias}; System.err.println(form.format(source)); form = new MessageFormat(rb.getString - ("\t(RETURN if same as for )")); + (".RETURN.if.same.as.for.otherAlias.")); Object[] src = {otherAlias}; System.err.print(form.format(src)); } else { MessageFormat form = new MessageFormat(rb.getString - ("Enter key password for ")); + ("Enter.key.password.for.alias.")); Object[] source = {alias}; System.err.print(form.format(source)); } @@ -2820,7 +2802,7 @@ public final class KeyTool { } while ((keyPass == null) && count < 3); if (keyPass == null) { - throw new Exception(rb.getString("Too many failures - try later")); + throw new Exception(rb.getString("Too.many.failures.try.later")); } return keyPass; @@ -2851,7 +2833,7 @@ public final class KeyTool { */ MessageFormat form = new MessageFormat - (rb.getString("*PATTERN* printX509Cert")); + (rb.getString(".PATTERN.printX509Cert")); Object[] source = {cert.getSubjectDN().toString(), cert.getIssuerDN().toString(), cert.getSerialNumber().toString(16), @@ -2873,7 +2855,7 @@ public final class KeyTool { CertificateExtensions exts = (CertificateExtensions) certInfo.get(X509CertInfo.EXTENSIONS); if (exts != null) { - printExtensions(rb.getString("Extensions: "), exts, out); + printExtensions(rb.getString("Extensions."), exts, out); } } } @@ -2894,7 +2876,7 @@ public final class KeyTool { if (ext.getClass() == Extension.class) { byte[] v = ext.getExtensionValue(); if (v.length == 0) { - out.println(rb.getString("(Empty value)")); + out.println(rb.getString(".Empty.value.")); } else { new sun.misc.HexDumpEncoder().encodeBuffer(ext.getExtensionValue(), out); out.println(); @@ -2972,32 +2954,32 @@ public final class KeyTool { do { if (maxRetry-- < 0) { throw new RuntimeException(rb.getString( - "Too many retries, program terminated")); + "Too.many.retries.program.terminated")); } commonName = inputString(in, - rb.getString("What is your first and last name?"), + rb.getString("What.is.your.first.and.last.name."), commonName); organizationalUnit = inputString(in, rb.getString - ("What is the name of your organizational unit?"), + ("What.is.the.name.of.your.organizational.unit."), organizationalUnit); organization = inputString(in, - rb.getString("What is the name of your organization?"), + rb.getString("What.is.the.name.of.your.organization."), organization); city = inputString(in, - rb.getString("What is the name of your City or Locality?"), + rb.getString("What.is.the.name.of.your.City.or.Locality."), city); state = inputString(in, - rb.getString("What is the name of your State or Province?"), + rb.getString("What.is.the.name.of.your.State.or.Province."), state); country = inputString(in, rb.getString - ("What is the two-letter country code for this unit?"), + ("What.is.the.two.letter.country.code.for.this.unit."), country); name = new X500Name(commonName, organizationalUnit, organization, city, state, country); MessageFormat form = new MessageFormat - (rb.getString("Is correct?")); + (rb.getString("Is.name.correct.")); Object[] source = {name}; userInput = inputString (in, form.format(source), rb.getString("no")); @@ -3014,7 +2996,7 @@ public final class KeyTool { { System.err.println(prompt); MessageFormat form = new MessageFormat - (rb.getString(" [defaultValue]: ")); + (rb.getString(".defaultValue.")); Object[] source = {defaultValue}; System.err.print(form.format(source)); System.err.flush(); @@ -3085,14 +3067,14 @@ public final class KeyTool { if (keyStore.containsAlias(alias) == false) { MessageFormat form = new MessageFormat - (rb.getString("Alias does not exist")); + (rb.getString("Alias.alias.does.not.exist")); Object[] source = {alias}; throw new Exception(form.format(source)); } if (!keyStore.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class) && !keyStore.entryInstanceOf(alias, KeyStore.SecretKeyEntry.class)) { MessageFormat form = new MessageFormat - (rb.getString("Alias has no key")); + (rb.getString("Alias.alias.has.no.key")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -3134,7 +3116,7 @@ public final class KeyTool { if (ks.containsAlias(alias) == false) { MessageFormat form = new MessageFormat - (rb.getString("Alias does not exist")); + (rb.getString("Alias.alias.does.not.exist")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -3212,15 +3194,15 @@ public final class KeyTool { private void printWarning() { System.err.println(); System.err.println(rb.getString - ("***************** WARNING WARNING WARNING *****************")); + (".WARNING.WARNING.WARNING.")); System.err.println(rb.getString - ("* The integrity of the information stored in your keystore *")); + (".The.integrity.of.the.information.stored.in.your.keystore.")); System.err.println(rb.getString - ("* has NOT been verified! In order to verify its integrity, *")); + (".has.NOT.been.verified.In.order.to.verify.its.integrity.")); System.err.println(rb.getString - ("* you must provide your keystore password. *")); + (".you.must.provide.your.keystore.password.")); System.err.println(rb.getString - ("***************** WARNING WARNING WARNING *****************")); + (".WARNING.WARNING.WARNING.")); System.err.println(); } @@ -3250,7 +3232,7 @@ public final class KeyTool { } if (i == replyCerts.length) { MessageFormat form = new MessageFormat(rb.getString - ("Certificate reply does not contain public key for ")); + ("Certificate.reply.does.not.contain.public.key.for.alias.")); Object[] source = {alias}; throw new Exception(form.format(source)); } @@ -3275,7 +3257,7 @@ public final class KeyTool { } if (j == replyCerts.length) { throw new Exception - (rb.getString("Incomplete certificate chain in reply")); + (rb.getString("Incomplete.certificate.chain.in.reply")); } } @@ -3292,12 +3274,12 @@ public final class KeyTool { if (root == null) { System.err.println(); System.err.println - (rb.getString("Top-level certificate in reply:\n")); + (rb.getString("Top.level.certificate.in.reply.")); printX509Cert((X509Certificate)topCert, System.out); System.err.println(); - System.err.print(rb.getString("... is not trusted. ")); + System.err.print(rb.getString(".is.not.trusted.")); String reply = getYesNoReply - (rb.getString("Install reply anyway? [no]: ")); + (rb.getString("Install.reply.anyway.no.")); if ("NO".equals(reply)) { return null; } @@ -3335,14 +3317,14 @@ public final class KeyTool { PublicKey replyPubKey = certToVerify.getPublicKey(); if (!origPubKey.equals(replyPubKey)) { throw new Exception(rb.getString - ("Public keys in reply and keystore don't match")); + ("Public.keys.in.reply.and.keystore.don.t.match")); } // If the two certs are identical, we're done: no need to import // anything if (certToVerify.equals(userCert)) { throw new Exception(rb.getString - ("Certificate reply and certificate in keystore are identical")); + ("Certificate.reply.and.certificate.in.keystore.are.identical")); } } @@ -3365,7 +3347,7 @@ public final class KeyTool { } // start building chain - Vector chain = new Vector(2); + Vector chain = new Vector<>(2); if (buildChain((X509Certificate)certToVerify, chain, certs)) { Certificate[] newChain = new Certificate[chain.size()]; // buildChain() returns chain with self-signed root-cert first and @@ -3379,7 +3361,7 @@ public final class KeyTool { return newChain; } else { throw new Exception - (rb.getString("Failed to establish chain from reply")); + (rb.getString("Failed.to.establish.chain.from.reply")); } } @@ -3443,7 +3425,7 @@ public final class KeyTool { do { if (maxRetry-- < 0) { throw new RuntimeException(rb.getString( - "Too many retries, program terminated")); + "Too.many.retries.program.terminated")); } System.err.print(prompt); System.err.flush(); @@ -3457,7 +3439,7 @@ public final class KeyTool { collator.compare(reply, rb.getString("yes")) == 0) { reply = "YES"; } else { - System.err.println(rb.getString("Wrong answer, try again")); + System.err.println(rb.getString("Wrong.answer.try.again")); reply = null; } } while (reply == null); @@ -3528,7 +3510,7 @@ public final class KeyTool { Calendar c = new GregorianCalendar(); if (s != null) { IOException ioe = new IOException( - rb.getString("Illegal startdate value")); + rb.getString("Illegal.startdate.value")); int len = s.length(); if (len == 0) { throw ioe; @@ -3654,7 +3636,7 @@ public final class KeyTool { } StringBuffer sb = new StringBuffer(); MessageFormat form = new MessageFormat(rb.getString - ("command {0} is ambiguous:")); + ("command.{0}.is.ambiguous.")); Object[] source = {s}; sb.append(form.format(source)); sb.append("\n "); @@ -3678,7 +3660,7 @@ public final class KeyTool { int p = oneOf(t, "EMAIL", "URI", "DNS", "IP", "OID"); if (p < 0) { throw new Exception(rb.getString( - "Unrecognized GeneralName type: ") + t); + "Unrecognized.GeneralName.type.") + t); } switch (p) { case 0: gn = new RFC822Name(v); break; @@ -3773,7 +3755,7 @@ public final class KeyTool { "critical", "non-critical"); if (action == -1) { throw new Exception(rb.getString - ("Illegal value: ") + item); + ("Illegal.value.") + item); } } } @@ -3837,7 +3819,7 @@ public final class KeyTool { String[] nv = part.split(":"); if (nv.length != 2) { throw new Exception(rb.getString - ("Illegal value: ") + extstr); + ("Illegal.value.") + extstr); } else { if (nv[0].equalsIgnoreCase("ca")) { isCA = Boolean.parseBoolean(nv[1]); @@ -3845,7 +3827,7 @@ public final class KeyTool { pathLen = Integer.parseInt(nv[1]); } else { throw new Exception(rb.getString - ("Illegal value: ") + extstr); + ("Illegal.value.") + extstr); } } } @@ -3872,7 +3854,7 @@ public final class KeyTool { "contentCommitment" // also (1) ); if (p < 0) { - throw new Exception(rb.getString("Unknown keyUsage type: ") + s); + throw new Exception(rb.getString("Unknown.keyUsage.type.") + s); } if (p == 9) p = 1; ok[p] = true; @@ -3886,13 +3868,12 @@ public final class KeyTool { kue.getExtensionValue())); } else { throw new Exception(rb.getString - ("Illegal value: ") + extstr); + ("Illegal.value.") + extstr); } break; case 2: // EKU if(value != null) { - Vector v = - new Vector (); + Vector v = new Vector<>(); for (String s: value.split(",")) { int p = oneOf(s, "anyExtendedKeyUsage", @@ -3911,7 +3892,7 @@ public final class KeyTool { v.add(new ObjectIdentifier(s)); } catch (Exception e) { throw new Exception(rb.getString( - "Unknown extendedkeyUsage type: ") + s); + "Unknown.extendedkeyUsage.type.") + s); } } else if (p == 0) { v.add(new ObjectIdentifier("2.5.29.37.0")); @@ -3923,7 +3904,7 @@ public final class KeyTool { new ExtendedKeyUsageExtension(isCritical, v)); } else { throw new Exception(rb.getString - ("Illegal value: ") + extstr); + ("Illegal.value.") + extstr); } break; case 3: // SAN @@ -3951,25 +3932,25 @@ public final class KeyTool { } } else { throw new Exception(rb.getString - ("Illegal value: ") + extstr); + ("Illegal.value.") + extstr); } break; case 5: // SIA, always non-critical case 6: // AIA, always non-critical if (isCritical) { throw new Exception(rb.getString( - "This extension cannot be marked as critical. ") + extstr); + "This.extension.cannot.be.marked.as.critical.") + extstr); } if(value != null) { List accessDescriptions = - new ArrayList(); + new ArrayList<>(); String[] ps = value.split(","); for(String item: ps) { colonpos = item.indexOf(':'); int colonpos2 = item.indexOf(':', colonpos+1); if (colonpos < 0 || colonpos2 < 0) { throw new Exception(rb.getString - ("Illegal value: ") + extstr); + ("Illegal.value.") + extstr); } String m = item.substring(0, colonpos); String t = item.substring(colonpos+1, colonpos2); @@ -3988,7 +3969,7 @@ public final class KeyTool { oid = new ObjectIdentifier(m); } catch (Exception e) { throw new Exception(rb.getString( - "Unknown AccessDescription type: ") + m); + "Unknown.AccessDescription.type.") + m); } } else { oid = new ObjectIdentifier("1.3.6.1.5.5.7.48." + p); @@ -4005,7 +3986,7 @@ public final class KeyTool { } } else { throw new Exception(rb.getString - ("Illegal value: ") + extstr); + ("Illegal.value.") + extstr); } break; case 8: // CRL, experimental, only support 1 distributionpoint @@ -4027,7 +4008,7 @@ public final class KeyTool { new DistributionPoint(gnames, null, null)))); } else { throw new Exception(rb.getString - ("Illegal value: ") + extstr); + ("Illegal.value.") + extstr); } break; case -1: @@ -4056,7 +4037,7 @@ public final class KeyTool { } if (pos % 2 != 0) { throw new Exception(rb.getString( - "Odd number of hex digits found: ") + extstr); + "Odd.number.of.hex.digits.found.") + extstr); } data = Arrays.copyOf(data, pos/2); } else { @@ -4068,7 +4049,7 @@ public final class KeyTool { break; default: throw new Exception(rb.getString( - "Unknown extension type: ") + extstr); + "Unknown.extension.type.") + extstr); } } // always non-critical @@ -4092,11 +4073,11 @@ public final class KeyTool { private void usage() { if (command != null) { System.err.println("keytool " + command + - rb.getString(" [OPTION]...")); + rb.getString(".OPTION.")); System.err.println(); System.err.println(rb.getString(command.description)); System.err.println(); - System.err.println(rb.getString("Options:")); + System.err.println(rb.getString("Options.")); System.err.println(); // Left and right sides of the options list @@ -4123,12 +4104,12 @@ public final class KeyTool { } System.err.println(); System.err.println(rb.getString( - "Use \"keytool -help\" for all available commands")); + "Use.keytool.help.for.all.available.commands")); } else { System.err.println(rb.getString( - "Key and Certificate Management Tool")); + "Key.and.Certificate.Management.Tool")); System.err.println(); - System.err.println(rb.getString("Commands:")); + System.err.println(rb.getString("Commands.")); System.err.println(); for (Command c: Command.values()) { if (c == KEYCLONE) break; @@ -4136,7 +4117,7 @@ public final class KeyTool { } System.err.println(); System.err.println(rb.getString( - "Use \"keytool -command_name -help\" for usage of command_name")); + "Use.keytool.command.name.help.for.usage.of.command.name")); } } @@ -4152,7 +4133,7 @@ public final class KeyTool { private void errorNeedArgument(String flag) { Object[] source = {flag}; System.err.println(new MessageFormat( - rb.getString("Command option needs an argument.")).format(source)); + rb.getString("Command.option.flag.needs.an.argument.")).format(source)); tinyHelp(); } @@ -4171,7 +4152,7 @@ public final class KeyTool { String value = System.getenv(arg); if (value == null) { System.err.println(rb.getString( - "Cannot find environment variable: ") + arg); + "Cannot.find.environment.variable.") + arg); return null; } else { return value.toCharArray(); @@ -4187,7 +4168,7 @@ public final class KeyTool { url = f.toURI().toURL(); } else { System.err.println(rb.getString( - "Cannot find file: ") + arg); + "Cannot.find.file.") + arg); return null; } } @@ -4205,7 +4186,7 @@ public final class KeyTool { return null; } } else { - System.err.println(rb.getString("Unknown password type: ") + + System.err.println(rb.getString("Unknown.password.type.") + modifier); return null; } @@ -4246,7 +4227,7 @@ class Pair { } public static Pair of(A a, B b) { - return new Pair(a,b); + return new Pair<>(a,b); } } diff --git a/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java b/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java index 8791e731aeb..cc40a08e594 100644 --- a/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java +++ b/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java @@ -49,7 +49,7 @@ import javax.security.auth.x500.X500Principal; /** * PolicyTool may be used by users and administrators to configure the * overall java security policy (currently stored in the policy file). - * Using PolicyTool administators may add and remove policies from + * Using PolicyTool administrators may add and remove policies from * the policy file.

      * * @see java.security.Policy @@ -228,9 +228,7 @@ public class PolicyTool { if (pubKey == null) { newWarning = true; MessageFormat form = new MessageFormat(rb.getString - ("Warning: A public key for alias " + - "'signers[i]' does not exist. " + - "Make sure a KeyStore is properly configured.")); + ("Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.")); Object[] source = {signers[i]}; warnings.addElement(form.format(source)); } @@ -248,7 +246,7 @@ public class PolicyTool { } catch (ClassNotFoundException fnfe) { newWarning = true; MessageFormat form = new MessageFormat(rb.getString - ("Warning: Class not found: class")); + ("Warning.Class.not.found.class")); Object[] source = {pe.getPrincipalClass()}; warnings.addElement(form.format(source)); } @@ -264,13 +262,13 @@ public class PolicyTool { } catch (ClassNotFoundException fnfe) { newWarning = true; MessageFormat form = new MessageFormat(rb.getString - ("Warning: Class not found: class")); + ("Warning.Class.not.found.class")); Object[] source = {pe.permission}; warnings.addElement(form.format(source)); } catch (InvocationTargetException ite) { newWarning = true; MessageFormat form = new MessageFormat(rb.getString - ("Warning: Invalid argument(s) for constructor: arg")); + ("Warning.Invalid.argument.s.for.constructor.arg")); Object[] source = {pe.permission}; warnings.addElement(form.format(source)); } @@ -285,9 +283,7 @@ public class PolicyTool { if (pubKey == null) { newWarning = true; MessageFormat form = new MessageFormat(rb.getString - ("Warning: A public key for alias " + - "'signers[i]' does not exist. " + - "Make sure a KeyStore is properly configured.")); + ("Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.")); Object[] source = {signers[i]}; warnings.addElement(form.format(source)); } @@ -615,7 +611,7 @@ public class PolicyTool { Thread.currentThread().getContextClassLoader()); if (!PRIN.isAssignableFrom(pc)) { MessageFormat form = new MessageFormat(rb.getString - ("Illegal Principal Type: type")); + ("Illegal.Principal.Type.type")); Object[] source = {type}; throw new InstantiationException(form.format(source)); } @@ -647,7 +643,7 @@ public class PolicyTool { Class pc = Class.forName(type, true, Thread.currentThread().getContextClassLoader()); Constructor c = null; - Vector objects = new Vector(2); + Vector objects = new Vector<>(2); if (name != null) objects.add(name); if (actions != null) objects.add(actions); switch (objects.size()) { @@ -691,7 +687,7 @@ public class PolicyTool { policyFileName = args[n]; } else { MessageFormat form = new MessageFormat(rb.getString - ("Illegal option: option")); + ("Illegal.option.option")); Object[] source = { flags }; System.err.println(form.format(source)); usage(); @@ -700,10 +696,10 @@ public class PolicyTool { } static void usage() { - System.out.println(rb.getString("Usage: policytool [options]")); + System.out.println(rb.getString("Usage.policytool.options.")); System.out.println(); System.out.println(rb.getString - (" [-file ] policy file location")); + (".file.file.policy.file.location")); System.out.println(); System.exit(1); @@ -903,23 +899,23 @@ class ToolWindow extends Frame { public static final String SAVE_POLICY_FILE = PolicyTool.rb.getString("Save"); public static final String SAVE_AS_POLICY_FILE = - PolicyTool.rb.getString("Save As"); + PolicyTool.rb.getString("Save.As"); public static final String VIEW_WARNINGS = - PolicyTool.rb.getString("View Warning Log"); + PolicyTool.rb.getString("View.Warning.Log"); public static final String QUIT = PolicyTool.rb.getString("Exit"); public static final String ADD_POLICY_ENTRY = - PolicyTool.rb.getString("Add Policy Entry"); + PolicyTool.rb.getString("Add.Policy.Entry"); public static final String EDIT_POLICY_ENTRY = - PolicyTool.rb.getString("Edit Policy Entry"); + PolicyTool.rb.getString("Edit.Policy.Entry"); public static final String REMOVE_POLICY_ENTRY = - PolicyTool.rb.getString("Remove Policy Entry"); + PolicyTool.rb.getString("Remove.Policy.Entry"); public static final String EDIT_KEYSTORE = PolicyTool.rb.getString("Edit"); public static final String ADD_PUBKEY_ALIAS = - PolicyTool.rb.getString("Add Public Key Alias"); + PolicyTool.rb.getString("Add.Public.Key.Alias"); public static final String REMOVE_PUBKEY_ALIAS = - PolicyTool.rb.getString("Remove Public Key Alias"); + PolicyTool.rb.getString("Remove.Public.Key.Alias"); /* gridbag index for components in the main window (MW) */ public static final int MW_FILENAME_LABEL = 0; @@ -968,13 +964,13 @@ class ToolWindow extends Frame { // policy entry listing - Label label = new Label(PolicyTool.rb.getString("Policy File:")); + Label label = new Label(PolicyTool.rb.getString("Policy.File.")); addNewComponent(this, label, MW_FILENAME_LABEL, 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, TOP_BOTTOM_PADDING); TextField tf = new TextField(50); tf.getAccessibleContext().setAccessibleName( - PolicyTool.rb.getString("Policy File:")); + PolicyTool.rb.getString("Policy.File.")); tf.setEditable(false); addNewComponent(this, tf, MW_FILENAME_TEXTFIELD, 1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, @@ -1056,7 +1052,7 @@ class ToolWindow extends Frame { // display the error MessageFormat form = new MessageFormat(PolicyTool.rb.getString - ("Could not open policy file: policyFile: e.toString()")); + ("Could.not.open.policy.file.policyFile.e.toString.")); Object[] source = {policyFile, e.toString()}; displayErrorDialog(null, form.format(source)); } @@ -1133,7 +1129,7 @@ class ToolWindow extends Frame { */ void displayToolWindow(String args[]) { - setTitle(PolicyTool.rb.getString("Policy Tool")); + setTitle(PolicyTool.rb.getString("Policy.Tool")); setResizable(true); addWindowListener(new ToolWindowListener(this)); setBounds(135, 80, 500, 500); @@ -1146,9 +1142,7 @@ class ToolWindow extends Frame { if (tool.newWarning == true) { displayStatusDialog(this, PolicyTool.rb.getString - ("Errors have occurred while opening the " + - "policy configuration. View the Warning Log " + - "for more information.")); + ("Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.")); } } @@ -1231,7 +1225,7 @@ class ToolWindow extends Frame { ta.setEditable(false); for (int i = 0; i < tool.warnings.size(); i++) { ta.append(tool.warnings.elementAt(i)); - ta.append(PolicyTool.rb.getString("\n")); + ta.append(PolicyTool.rb.getString("NEWLINE")); } addNewComponent(wd, ta, 0, 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, @@ -1332,27 +1326,22 @@ class ToolDialog extends Dialog { /* popup menus */ public static final String PERM = PolicyTool.rb.getString - ("Permission: "); + ("Permission."); public static final String PRIN_TYPE = - PolicyTool.rb.getString("Principal Type:"); + PolicyTool.rb.getString("Principal.Type."); public static final String PRIN_NAME = - PolicyTool.rb.getString("Principal Name:"); + PolicyTool.rb.getString("Principal.Name."); /* more popu menus */ public static final String PERM_NAME = PolicyTool.rb.getString - ("Target Name: "); + ("Target.Name."); /* and more popup menus */ public static final String PERM_ACTIONS = PolicyTool.rb.getString - ("Actions: "); - - /* gridbag index for display OverWriteFile (OW) components */ - public static final int OW_LABEL = 0; - public static final int OW_OK_BUTTON = 1; - public static final int OW_CANCEL_BUTTON = 2; + ("Actions."); /* gridbag index for display PolicyEntry (PE) components */ public static final int PE_CODEBASE_LABEL = 0; @@ -1528,44 +1517,6 @@ class ToolDialog extends Dialog { return null; } - /** - * ask user if they want to overwrite an existing file - */ - void displayOverWriteFileDialog(String filename, int nextEvent) { - - // find where the PolicyTool gui is - Point location = tw.getLocationOnScreen(); - setBounds(location.x + 75, location.y + 100, 400, 150); - setLayout(new GridBagLayout()); - - // ask the user if they want to over write the existing file - MessageFormat form = new MessageFormat(PolicyTool.rb.getString - ("OK to overwrite existing file filename?")); - Object[] source = {filename}; - Label label = new Label(form.format(source)); - tw.addNewComponent(this, label, OW_LABEL, - 0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH, - tw.TOP_PADDING); - - // OK button - Button button = new Button(PolicyTool.rb.getString("OK")); - button.addActionListener(new OverWriteFileOKButtonListener - (tool, tw, this, filename, nextEvent)); - tw.addNewComponent(this, button, OW_OK_BUTTON, - 0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL, - tw.TOP_PADDING); - - // Cancel button - // -- if the user hits cancel, do NOT go on to the next event - button = new Button(PolicyTool.rb.getString("Cancel")); - button.addActionListener(new CancelButtonListener(this)); - tw.addNewComponent(this, button, OW_CANCEL_BUTTON, - 1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL, - tw.TOP_PADDING); - - setVisible(true); - } - /** * pop up a dialog so the user can enter info to add a new PolicyEntry * - if edit is TRUE, then the user is editing an existing entry @@ -1584,12 +1535,12 @@ class ToolDialog extends Dialog { PolicyEntry entries[] = null; TaggedList prinList = new TaggedList(3, false); prinList.getAccessibleContext().setAccessibleName( - PolicyTool.rb.getString("Principal List")); + PolicyTool.rb.getString("Principal.List")); prinList.addActionListener (new EditPrinButtonListener(tool, tw, this, edit)); TaggedList permList = new TaggedList(10, false); permList.getAccessibleContext().setAccessibleName( - PolicyTool.rb.getString("Permission List")); + PolicyTool.rb.getString("Permission.List")); permList.addActionListener (new EditPermButtonListener(tool, tw, this, edit)); @@ -1627,7 +1578,7 @@ class ToolDialog extends Dialog { } // codebase label and textfield - Label label = new Label(PolicyTool.rb.getString("CodeBase:")); + Label label = new Label(PolicyTool.rb.getString("CodeBase.")); tw.addNewComponent(this, label, PE_CODEBASE_LABEL, 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH); TextField tf; @@ -1635,19 +1586,19 @@ class ToolDialog extends Dialog { new TextField(entries[listIndex].getGrantEntry().codeBase, 60) : new TextField(60)); tf.getAccessibleContext().setAccessibleName( - PolicyTool.rb.getString("Code Base")); + PolicyTool.rb.getString("Code.Base")); tw.addNewComponent(this, tf, PE_CODEBASE_TEXTFIELD, 1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH); // signedby label and textfield - label = new Label(PolicyTool.rb.getString("SignedBy:")); + label = new Label(PolicyTool.rb.getString("SignedBy.")); tw.addNewComponent(this, label, PE_SIGNEDBY_LABEL, 0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH); tf = (edit ? new TextField(entries[listIndex].getGrantEntry().signedBy, 60) : new TextField(60)); tf.getAccessibleContext().setAccessibleName( - PolicyTool.rb.getString("Signed By:")); + PolicyTool.rb.getString("Signed.By.")); tw.addNewComponent(this, tf, PE_SIGNEDBY_TEXTFIELD, 1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH); @@ -1655,19 +1606,19 @@ class ToolDialog extends Dialog { Panel panel = new Panel(); panel.setLayout(new GridBagLayout()); - Button button = new Button(PolicyTool.rb.getString("Add Principal")); + Button button = new Button(PolicyTool.rb.getString("Add.Principal")); button.addActionListener (new AddPrinButtonListener(tool, tw, this, edit)); tw.addNewComponent(panel, button, PE_ADD_PRIN_BUTTON, 0, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL); - button = new Button(PolicyTool.rb.getString("Edit Principal")); + button = new Button(PolicyTool.rb.getString("Edit.Principal")); button.addActionListener(new EditPrinButtonListener (tool, tw, this, edit)); tw.addNewComponent(panel, button, PE_EDIT_PRIN_BUTTON, 1, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL); - button = new Button(PolicyTool.rb.getString("Remove Principal")); + button = new Button(PolicyTool.rb.getString("Remove.Principal")); button.addActionListener(new RemovePrinButtonListener (tool, tw, this, edit)); tw.addNewComponent(panel, button, PE_REMOVE_PRIN_BUTTON, @@ -1677,7 +1628,7 @@ class ToolDialog extends Dialog { 1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.HORIZONTAL); // principal label and list - label = new Label(PolicyTool.rb.getString("Principals:")); + label = new Label(PolicyTool.rb.getString("Principals.")); tw.addNewComponent(this, label, PE_PRIN_LABEL, 0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.BOTTOM_PADDING); @@ -1689,20 +1640,20 @@ class ToolDialog extends Dialog { panel = new Panel(); panel.setLayout(new GridBagLayout()); - button = new Button(PolicyTool.rb.getString(" Add Permission")); + button = new Button(PolicyTool.rb.getString(".Add.Permission")); button.addActionListener(new AddPermButtonListener (tool, tw, this, edit)); tw.addNewComponent(panel, button, PE_ADD_PERM_BUTTON, 0, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL); - button = new Button(PolicyTool.rb.getString(" Edit Permission")); + button = new Button(PolicyTool.rb.getString(".Edit.Permission")); button.addActionListener(new EditPermButtonListener (tool, tw, this, edit)); tw.addNewComponent(panel, button, PE_EDIT_PERM_BUTTON, 1, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL); - button = new Button(PolicyTool.rb.getString("Remove Permission")); + button = new Button(PolicyTool.rb.getString("Remove.Permission")); button.addActionListener(new RemovePermButtonListener (tool, tw, this, edit)); tw.addNewComponent(panel, button, PE_REMOVE_PERM_BUTTON, @@ -1771,8 +1722,7 @@ class ToolDialog extends Dialog { new PolicyParser.GrantEntry(signedby, codebase); // get the new Principals - LinkedList prins = - new LinkedList(); + LinkedList prins = new LinkedList<>(); TaggedList prinList = (TaggedList)getComponent(PE_PRIN_LIST); for (int i = 0; i < prinList.getItemCount(); i++) { prins.add((PolicyParser.PrincipalEntry)prinList.getObject(i)); @@ -1780,8 +1730,7 @@ class ToolDialog extends Dialog { ge.principals = prins; // get the new Permissions - Vector perms = - new Vector(); + Vector perms = new Vector<>(); TaggedList permList = (TaggedList)getComponent(PE_PERM_LIST); for (int i = 0; i < permList.getItemCount(); i++) { perms.addElement((PolicyParser.PermissionEntry)permList.getObject(i)); @@ -1808,7 +1757,7 @@ class ToolDialog extends Dialog { // KeyStore label and textfield Label label = new Label - (PolicyTool.rb.getString("KeyStore URL:")); + (PolicyTool.rb.getString("KeyStore.URL.")); tw.addNewComponent(this, label, KSD_NAME_LABEL, 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.BOTTOM_PADDING); @@ -1816,45 +1765,45 @@ class ToolDialog extends Dialog { // URL to U R L, so that accessibility reader will pronounce well tf.getAccessibleContext().setAccessibleName( - PolicyTool.rb.getString("KeyStore U R L:")); + PolicyTool.rb.getString("KeyStore.U.R.L.")); tw.addNewComponent(this, tf, KSD_NAME_TEXTFIELD, 1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.BOTTOM_PADDING); // KeyStore type and textfield - label = new Label(PolicyTool.rb.getString("KeyStore Type:")); + label = new Label(PolicyTool.rb.getString("KeyStore.Type.")); tw.addNewComponent(this, label, KSD_TYPE_LABEL, 0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.BOTTOM_PADDING); tf = new TextField(tool.getKeyStoreType(), 30); tf.getAccessibleContext().setAccessibleName( - PolicyTool.rb.getString("KeyStore Type:")); + PolicyTool.rb.getString("KeyStore.Type.")); tw.addNewComponent(this, tf, KSD_TYPE_TEXTFIELD, 1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.BOTTOM_PADDING); // KeyStore provider and textfield label = new Label(PolicyTool.rb.getString - ("KeyStore Provider:")); + ("KeyStore.Provider.")); tw.addNewComponent(this, label, KSD_PROVIDER_LABEL, 0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.BOTTOM_PADDING); tf = new TextField(tool.getKeyStoreProvider(), 30); tf.getAccessibleContext().setAccessibleName( - PolicyTool.rb.getString("KeyStore Provider:")); + PolicyTool.rb.getString("KeyStore.Provider.")); tw.addNewComponent(this, tf, KSD_PROVIDER_TEXTFIELD, 1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.BOTTOM_PADDING); // KeyStore password URL and textfield label = new Label(PolicyTool.rb.getString - ("KeyStore Password URL:")); + ("KeyStore.Password.URL.")); tw.addNewComponent(this, label, KSD_PWD_URL_LABEL, 0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.BOTTOM_PADDING); tf = new TextField(tool.getKeyStorePwdURL(), 30); tf.getAccessibleContext().setAccessibleName( - PolicyTool.rb.getString("KeyStore Password U R L:")); + PolicyTool.rb.getString("KeyStore.Password.U.R.L.")); tw.addNewComponent(this, tf, KSD_PWD_URL_TEXTFIELD, 1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.BOTTOM_PADDING); @@ -1909,8 +1858,8 @@ class ToolDialog extends Dialog { // description label Label label = (edit ? - new Label(PolicyTool.rb.getString(" Edit Principal:")) : - new Label(PolicyTool.rb.getString(" Add New Principal:"))); + new Label(PolicyTool.rb.getString(".Edit.Principal.")) : + new Label(PolicyTool.rb.getString(".Add.New.Principal."))); tw.addNewComponent(newTD, label, PRD_DESC_LABEL, 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.TOP_BOTTOM_PADDING); @@ -2016,8 +1965,8 @@ class ToolDialog extends Dialog { // description label Label label = (edit ? - new Label(PolicyTool.rb.getString(" Edit Permission:")) : - new Label(PolicyTool.rb.getString(" Add New Permission:"))); + new Label(PolicyTool.rb.getString(".Edit.Permission.")) : + new Label(PolicyTool.rb.getString(".Add.New.Permission."))); tw.addNewComponent(newTD, label, PD_DESC_LABEL, 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.TOP_BOTTOM_PADDING); @@ -2084,13 +2033,13 @@ class ToolDialog extends Dialog { tw.LR_PADDING); // signedby label and textfield - label = new Label(PolicyTool.rb.getString("Signed By:")); + label = new Label(PolicyTool.rb.getString("Signed.By.")); tw.addNewComponent(newTD, label, PD_SIGNEDBY_LABEL, 0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.LR_PADDING); tf = (edit ? new TextField(editMe.signedBy, 40) : new TextField(40)); tf.getAccessibleContext().setAccessibleName( - PolicyTool.rb.getString("Signed By:")); + PolicyTool.rb.getString("Signed.By.")); tw.addNewComponent(newTD, tf, PD_SIGNEDBY_TEXTFIELD, 1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.LR_PADDING); @@ -2135,12 +2084,10 @@ class ToolDialog extends Dialog { if ((pclass.equals(PolicyParser.PrincipalEntry.WILDCARD_CLASS)) && (!pname.equals(PolicyParser.PrincipalEntry.WILDCARD_NAME))) { throw new Exception - (PolicyTool.rb.getString("Cannot Specify Principal " + - "with a Wildcard Class without a Wildcard Name")); + (PolicyTool.rb.getString("Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name")); } else if (pname.equals("")) { throw new Exception - (PolicyTool.rb.getString("Cannot Specify Principal " + - "without a Name")); + (PolicyTool.rb.getString("Cannot.Specify.Principal.without.a.Name")); } else if (pclass.equals("")) { // make this consistent with what PolicyParser does // when it sees an empty principal class @@ -2188,7 +2135,7 @@ class ToolDialog extends Dialog { if (permission.equals("") || (!permission.equals(ALL_PERM_CLASS) && name == null)) { throw new InvalidParameterException(PolicyTool.rb.getString - ("Permission and Target Name must have a value")); + ("Permission.and.Target.Name.must.have.a.value")); } // When the permission is FilePermission, we need to check the name @@ -2205,12 +2152,7 @@ class ToolDialog extends Dialog { char result = tw.displayYesNoDialog(this, PolicyTool.rb.getString("Warning"), PolicyTool.rb.getString( - "Warning: File name may include escaped backslash characters. " + - "It is not necessary to escape backslash characters " + - "(the tool escapes characters as necessary when writing " + - "the policy contents to the persistent store).\n\n" + - "Click on Retain to retain the entered name, or click on " + - "Edit to edit the name."), + "Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes"), PolicyTool.rb.getString("Retain"), PolicyTool.rb.getString("Edit") ); @@ -2244,9 +2186,7 @@ class ToolDialog extends Dialog { if (pubKey == null) { MessageFormat form = new MessageFormat (PolicyTool.rb.getString - ("Warning: A public key for alias " + - "'signers[i]' does not exist. " + - "Make sure a KeyStore is properly configured.")); + ("Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.")); Object[] source = {signers[i]}; tool.warnings.addElement(form.format(source)); tw.displayStatusDialog(this, form.format(source)); @@ -2276,7 +2216,7 @@ class ToolDialog extends Dialog { // ask the user do they really want to do this? Label label = new Label - (PolicyTool.rb.getString("Remove this Policy Entry?")); + (PolicyTool.rb.getString("Remove.this.Policy.Entry.")); tw.addNewComponent(this, label, CRPE_LABEL1, 0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.BOTTOM_PADDING); @@ -2340,7 +2280,7 @@ class ToolDialog extends Dialog { // pop up a dialog box for the user to enter a filename. FileDialog fd = new FileDialog - (tw, PolicyTool.rb.getString("Save As"), FileDialog.SAVE); + (tw, PolicyTool.rb.getString("Save.As"), FileDialog.SAVE); fd.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { e.getWindow().setVisible(false); @@ -2354,47 +2294,39 @@ class ToolDialog extends Dialog { return; // get the entered filename - String filename = new String(fd.getDirectory() + fd.getFile()); + File saveAsFile = new File(fd.getDirectory(), fd.getFile()); + String filename = saveAsFile.getPath(); fd.dispose(); - // see if the file already exists - File saveAsFile = new File(filename); - if (saveAsFile.exists()) { - // display a dialog box for the user to enter policy info - ToolDialog td = new ToolDialog - (PolicyTool.rb.getString("Overwrite File"), tool, tw, true); - td.displayOverWriteFileDialog(filename, nextEvent); - } else { - try { - // save the policy entries to a file - tool.savePolicy(filename); + try { + // save the policy entries to a file + tool.savePolicy(filename); - // display status - MessageFormat form = new MessageFormat(PolicyTool.rb.getString - ("Policy successfully written to filename")); - Object[] source = {filename}; - tw.displayStatusDialog(null, form.format(source)); + // display status + MessageFormat form = new MessageFormat(PolicyTool.rb.getString + ("Policy.successfully.written.to.filename")); + Object[] source = {filename}; + tw.displayStatusDialog(null, form.format(source)); - // display the new policy filename - TextField newFilename = (TextField)tw.getComponent - (tw.MW_FILENAME_TEXTFIELD); - newFilename.setText(filename); - tw.setVisible(true); + // display the new policy filename + TextField newFilename = (TextField)tw.getComponent + (tw.MW_FILENAME_TEXTFIELD); + newFilename.setText(filename); + tw.setVisible(true); - // now continue with the originally requested command - // (QUIT, NEW, or OPEN) - userSaveContinue(tool, tw, this, nextEvent); + // now continue with the originally requested command + // (QUIT, NEW, or OPEN) + userSaveContinue(tool, tw, this, nextEvent); - } catch (FileNotFoundException fnfe) { - if (filename == null || filename.equals("")) { - tw.displayErrorDialog(null, new FileNotFoundException - (PolicyTool.rb.getString("null filename"))); - } else { - tw.displayErrorDialog(null, fnfe); - } - } catch (Exception ee) { - tw.displayErrorDialog(null, ee); + } catch (FileNotFoundException fnfe) { + if (filename == null || filename.equals("")) { + tw.displayErrorDialog(null, new FileNotFoundException + (PolicyTool.rb.getString("null.filename"))); + } else { + tw.displayErrorDialog(null, fnfe); } + } catch (Exception ee) { + tw.displayErrorDialog(null, ee); } } @@ -2411,7 +2343,7 @@ class ToolDialog extends Dialog { setLayout(new GridBagLayout()); Label label = new Label - (PolicyTool.rb.getString("Save changes?")); + (PolicyTool.rb.getString("Save.changes.")); tw.addNewComponent(this, label, USC_LABEL, 0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.BOTH, tw.L_TOP_BOTTOM_PADDING); @@ -2509,7 +2441,7 @@ class ToolDialog extends Dialog { return; // get the entered filename - String policyFile = new String(fd.getDirectory() + fd.getFile()); + String policyFile = new File(fd.getDirectory(), fd.getFile()).getPath(); try { // open the policy file @@ -2535,9 +2467,7 @@ class ToolDialog extends Dialog { // inform user of warnings if (tool.newWarning == true) { tw.displayStatusDialog(null, PolicyTool.rb.getString - ("Errors have occurred while opening the " + - "policy configuration. View the Warning Log " + - "for more information.")); + ("Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.")); } } catch (Exception e) { @@ -2556,7 +2486,7 @@ class ToolDialog extends Dialog { // display the error MessageFormat form = new MessageFormat(PolicyTool.rb.getString - ("Could not open policy file: policyFile: e.toString()")); + ("Could.not.open.policy.file.policyFile.e.toString.")); Object[] source = {policyFile, e.toString()}; tw.displayErrorDialog(null, form.format(source)); } @@ -2708,7 +2638,7 @@ class PolicyListListener implements ActionListener { // display the permission list for a policy entry ToolDialog td = new ToolDialog - (PolicyTool.rb.getString("Policy Entry"), tool, tw, true); + (PolicyTool.rb.getString("Policy.Entry"), tool, tw, true); td.displayPolicyEntryDialog(true); } } @@ -2732,7 +2662,7 @@ class FileMenuListener implements ActionListener { // ask user if they want to save changes ToolDialog td = new ToolDialog - (PolicyTool.rb.getString("Save Changes"), tool, tw, true); + (PolicyTool.rb.getString("Save.Changes"), tool, tw, true); td.displayUserSave(td.QUIT); // the above method will perform the QUIT as long as the @@ -2743,7 +2673,7 @@ class FileMenuListener implements ActionListener { // ask user if they want to save changes ToolDialog td = new ToolDialog - (PolicyTool.rb.getString("Save Changes"), tool, tw, true); + (PolicyTool.rb.getString("Save.Changes"), tool, tw, true); td.displayUserSave(td.NEW); // the above method will perform the NEW as long as the @@ -2754,7 +2684,7 @@ class FileMenuListener implements ActionListener { // ask user if they want to save changes ToolDialog td = new ToolDialog - (PolicyTool.rb.getString("Save Changes"), tool, tw, true); + (PolicyTool.rb.getString("Save.Changes"), tool, tw, true); td.displayUserSave(td.OPEN); // the above method will perform the OPEN as long as the @@ -2771,7 +2701,7 @@ class FileMenuListener implements ActionListener { if (filename == null || filename.length() == 0) { // user wants to SAVE AS ToolDialog td = new ToolDialog - (PolicyTool.rb.getString("Save As"), tool, tw, true); + (PolicyTool.rb.getString("Save.As"), tool, tw, true); td.displaySaveAsDialog(td.NOACTION); } else { try { @@ -2781,13 +2711,13 @@ class FileMenuListener implements ActionListener { // display status MessageFormat form = new MessageFormat (PolicyTool.rb.getString - ("Policy successfully written to filename")); + ("Policy.successfully.written.to.filename")); Object[] source = {filename}; tw.displayStatusDialog(null, form.format(source)); } catch (FileNotFoundException fnfe) { if (filename == null || filename.equals("")) { tw.displayErrorDialog(null, new FileNotFoundException - (PolicyTool.rb.getString("null filename"))); + (PolicyTool.rb.getString("null.filename"))); } else { tw.displayErrorDialog(null, fnfe); } @@ -2800,7 +2730,7 @@ class FileMenuListener implements ActionListener { // user wants to SAVE AS ToolDialog td = new ToolDialog - (PolicyTool.rb.getString("Save As"), tool, tw, true); + (PolicyTool.rb.getString("Save.As"), tool, tw, true); td.displaySaveAsDialog(td.NOACTION); } else if (PolicyTool.collator.compare(e.getActionCommand(), @@ -2830,7 +2760,7 @@ class MainWindowListener implements ActionListener { // display a dialog box for the user to enter policy info ToolDialog td = new ToolDialog - (PolicyTool.rb.getString("Policy Entry"), tool, tw, true); + (PolicyTool.rb.getString("Policy.Entry"), tool, tw, true); td.displayPolicyEntryDialog(false); } else if (PolicyTool.collator.compare(e.getActionCommand(), @@ -2841,13 +2771,13 @@ class MainWindowListener implements ActionListener { int index = list.getSelectedIndex(); if (index < 0) { tw.displayErrorDialog(null, new Exception - (PolicyTool.rb.getString("No Policy Entry selected"))); + (PolicyTool.rb.getString("No.Policy.Entry.selected"))); return; } // ask the user if they really want to remove the policy entry ToolDialog td = new ToolDialog(PolicyTool.rb.getString - ("Remove Policy Entry"), tool, tw, true); + ("Remove.Policy.Entry"), tool, tw, true); td.displayConfirmRemovePolicyEntry(); } else if (PolicyTool.collator.compare(e.getActionCommand(), @@ -2858,13 +2788,13 @@ class MainWindowListener implements ActionListener { int index = list.getSelectedIndex(); if (index < 0) { tw.displayErrorDialog(null, new Exception - (PolicyTool.rb.getString("No Policy Entry selected"))); + (PolicyTool.rb.getString("No.Policy.Entry.selected"))); return; } // display the permission list for a policy entry ToolDialog td = new ToolDialog - (PolicyTool.rb.getString("Policy Entry"), tool, tw, true); + (PolicyTool.rb.getString("Policy.Entry"), tool, tw, true); td.displayPolicyEntryDialog(true); } else if (PolicyTool.collator.compare(e.getActionCommand(), @@ -2878,67 +2808,6 @@ class MainWindowListener implements ActionListener { } } -/** - * Event handler for OverWriteFileOKButton button - */ -class OverWriteFileOKButtonListener implements ActionListener { - - private PolicyTool tool; - private ToolWindow tw; - private ToolDialog td; - private String filename; - private int nextEvent; - - OverWriteFileOKButtonListener(PolicyTool tool, ToolWindow tw, - ToolDialog td, String filename, int nextEvent) { - this.tool = tool; - this.tw = tw; - this.td = td; - this.filename = filename; - this.nextEvent = nextEvent; - } - - public void actionPerformed(ActionEvent e) { - try { - // save the policy entries to a file - tool.savePolicy(filename); - - // display status - MessageFormat form = new MessageFormat - (PolicyTool.rb.getString - ("Policy successfully written to filename")); - Object[] source = {filename}; - tw.displayStatusDialog(null, form.format(source)); - - // display the new policy filename - TextField newFilename = (TextField)tw.getComponent - (tw.MW_FILENAME_TEXTFIELD); - newFilename.setText(filename); - tw.setVisible(true); - - // now continue with the originally requested command - // (QUIT, NEW, or OPEN) - td.setVisible(false); - td.dispose(); - td.userSaveContinue(tool, tw, td, nextEvent); - - } catch (FileNotFoundException fnfe) { - if (filename == null || filename.equals("")) { - tw.displayErrorDialog(null, new FileNotFoundException - (PolicyTool.rb.getString("null filename"))); - } else { - tw.displayErrorDialog(null, fnfe); - } - td.setVisible(false); - td.dispose(); - } catch (Exception ee) { - tw.displayErrorDialog(null, ee); - td.setVisible(false); - td.dispose(); - } - } -} - /** * Event handler for AddEntryDoneButton button * @@ -2977,9 +2846,7 @@ class AddEntryDoneButtonListener implements ActionListener { if (pubKey == null) { MessageFormat form = new MessageFormat (PolicyTool.rb.getString - ("Warning: A public key for alias " + - "'signers[i]' does not exist. " + - "Make sure a KeyStore is properly configured.")); + ("Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.")); Object[] source = {signers[i]}; tool.warnings.addElement(form.format(source)); tw.displayStatusDialog(td, form.format(source)); @@ -3047,7 +2914,7 @@ class ChangeKeyStoreOKButtonListener implements ActionListener { tool.modified = true; } catch (Exception ex) { MessageFormat form = new MessageFormat(PolicyTool.rb.getString - ("Unable to open KeyStore: ex.toString()")); + ("Unable.to.open.KeyStore.ex.toString.")); Object[] source = {ex.toString()}; tw.displayErrorDialog(td, form.format(source)); return; @@ -3143,7 +3010,7 @@ class NewPolicyPrinOKButtonListener implements ActionListener { } catch (ClassNotFoundException cnfe) { MessageFormat form = new MessageFormat (PolicyTool.rb.getString - ("Warning: Class not found: class")); + ("Warning.Class.not.found.class")); Object[] source = {pppe.getPrincipalClass()}; tool.warnings.addElement(form.format(source)); tw.displayStatusDialog(infoDialog, form.format(source)); @@ -3204,7 +3071,7 @@ class NewPolicyPermOKButtonListener implements ActionListener { tool.verifyPermission(pppe.permission, pppe.name, pppe.action); } catch (ClassNotFoundException cnfe) { MessageFormat form = new MessageFormat(PolicyTool.rb.getString - ("Warning: Class not found: class")); + ("Warning.Class.not.found.class")); Object[] source = {pppe.permission}; tool.warnings.addElement(form.format(source)); tw.displayStatusDialog(infoDialog, form.format(source)); @@ -3259,7 +3126,7 @@ class RemovePrinButtonListener implements ActionListener { if (prinIndex < 0) { tw.displayErrorDialog(td, new Exception - (PolicyTool.rb.getString("No principal selected"))); + (PolicyTool.rb.getString("No.principal.selected"))); return; } // remove the principal from the display @@ -3293,7 +3160,7 @@ class RemovePermButtonListener implements ActionListener { if (permIndex < 0) { tw.displayErrorDialog(td, new Exception - (PolicyTool.rb.getString("No permission selected"))); + (PolicyTool.rb.getString("No.permission.selected"))); return; } // remove the permission from the display @@ -3334,7 +3201,7 @@ class EditPrinButtonListener implements ActionListener { if (prinIndex < 0) { tw.displayErrorDialog(td, new Exception - (PolicyTool.rb.getString("No principal selected"))); + (PolicyTool.rb.getString("No.principal.selected"))); return; } td.displayPrincipalDialog(editPolicyEntry, true); @@ -3373,7 +3240,7 @@ class EditPermButtonListener implements ActionListener { if (permIndex < 0) { tw.displayErrorDialog(td, new Exception - (PolicyTool.rb.getString("No permission selected"))); + (PolicyTool.rb.getString("No.permission.selected"))); return; } td.displayPermissionDialog(editPolicyEntry, true); @@ -3668,7 +3535,7 @@ class UserSaveYesButtonListener implements ActionListener { // display status MessageFormat form = new MessageFormat (PolicyTool.rb.getString - ("Policy successfully written to filename")); + ("Policy.successfully.written.to.filename")); Object[] source = {filename}; tw.displayStatusDialog(null, form.format(source)); @@ -3780,7 +3647,7 @@ class NoDisplayException extends RuntimeException { * This is a java.awt.List that bind an Object to each String it holds. */ class TaggedList extends List { - private java.util.List data = new LinkedList(); + private java.util.List data = new LinkedList<>(); public TaggedList(int i, boolean b) { super(i, b); } @@ -3900,7 +3767,7 @@ class AuthPerm extends Perm { "getLoginConfiguration", "setLoginConfiguration", "createLoginConfiguration.<" + - PolicyTool.rb.getString("configuration type") + ">", + PolicyTool.rb.getString("configuration.type") + ">", "refreshLoginConfiguration" }, null); @@ -4117,7 +3984,7 @@ class RuntimePerm extends Perm { "setSecurityManager", "createSecurityManager", "getenv.<" + - PolicyTool.rb.getString("environment variable name") + ">", + PolicyTool.rb.getString("environment.variable.name") + ">", "exitVM", "shutdownHooks", "setFactory", @@ -4129,11 +3996,11 @@ class RuntimePerm extends Perm { "readFileDescriptor", "writeFileDescriptor", "loadLibrary.<" + - PolicyTool.rb.getString("library name") + ">", + PolicyTool.rb.getString("library.name") + ">", "accessClassInPackage.<" + - PolicyTool.rb.getString("package name")+">", + PolicyTool.rb.getString("package.name")+">", "defineClassInPackage.<" + - PolicyTool.rb.getString("package name")+">", + PolicyTool.rb.getString("package.name")+">", "accessDeclaredMembers", "queuePrintJob", "getStackTrace", @@ -4156,15 +4023,15 @@ class SecurityPerm extends Perm { "getPolicy", "setPolicy", "createPolicy.<" + - PolicyTool.rb.getString("policy type") + ">", + PolicyTool.rb.getString("policy.type") + ">", "getProperty.<" + - PolicyTool.rb.getString("property name") + ">", + PolicyTool.rb.getString("property.name") + ">", "setProperty.<" + - PolicyTool.rb.getString("property name") + ">", + PolicyTool.rb.getString("property.name") + ">", "insertProvider.<" + - PolicyTool.rb.getString("provider name") + ">", + PolicyTool.rb.getString("provider.name") + ">", "removeProvider.<" + - PolicyTool.rb.getString("provider name") + ">", + PolicyTool.rb.getString("provider.name") + ">", //"setSystemScope", //"setIdentityPublicKey", //"setIdentityInfo", @@ -4172,11 +4039,11 @@ class SecurityPerm extends Perm { //"removeIdentityCertificate", //"printIdentity", "clearProviderProperties.<" + - PolicyTool.rb.getString("provider name") + ">", + PolicyTool.rb.getString("provider.name") + ">", "putProviderProperty.<" + - PolicyTool.rb.getString("provider name") + ">", + PolicyTool.rb.getString("provider.name") + ">", "removeProviderProperty.<" + - PolicyTool.rb.getString("provider name") + ">", + PolicyTool.rb.getString("provider.name") + ">", //"getSignerPrivateKey", //"setSignerKeyPair" }, diff --git a/jdk/src/share/classes/sun/security/util/AuthResources.java b/jdk/src/share/classes/sun/security/util/AuthResources.java index 7633ed072e9..68d8d9edbe2 100644 --- a/jdk/src/share/classes/sun/security/util/AuthResources.java +++ b/jdk/src/share/classes/sun/security/util/AuthResources.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,103 +40,103 @@ public class AuthResources extends java.util.ListResourceBundle { private static final Object[][] contents = { // NT principals - {"invalid null input: value", "invalid null input: {0}"}, - {"NTDomainPrincipal: name", "NTDomainPrincipal: {0}"}, - {"NTNumericCredential: name", "NTNumericCredential: {0}"}, - {"Invalid NTSid value", "Invalid NTSid value"}, - {"NTSid: name", "NTSid: {0}"}, - {"NTSidDomainPrincipal: name", "NTSidDomainPrincipal: {0}"}, - {"NTSidGroupPrincipal: name", "NTSidGroupPrincipal: {0}"}, - {"NTSidPrimaryGroupPrincipal: name", "NTSidPrimaryGroupPrincipal: {0}"}, - {"NTSidUserPrincipal: name", "NTSidUserPrincipal: {0}"}, - {"NTUserPrincipal: name", "NTUserPrincipal: {0}"}, + {"invalid.null.input.value", "invalid null input: {0}"}, + {"NTDomainPrincipal.name", "NTDomainPrincipal: {0}"}, + {"NTNumericCredential.name", "NTNumericCredential: {0}"}, + {"Invalid.NTSid.value", "Invalid NTSid value"}, + {"NTSid.name", "NTSid: {0}"}, + {"NTSidDomainPrincipal.name", "NTSidDomainPrincipal: {0}"}, + {"NTSidGroupPrincipal.name", "NTSidGroupPrincipal: {0}"}, + {"NTSidPrimaryGroupPrincipal.name", "NTSidPrimaryGroupPrincipal: {0}"}, + {"NTSidUserPrincipal.name", "NTSidUserPrincipal: {0}"}, + {"NTUserPrincipal.name", "NTUserPrincipal: {0}"}, // UnixPrincipals - {"UnixNumericGroupPrincipal [Primary Group]: name", + {"UnixNumericGroupPrincipal.Primary.Group.name", "UnixNumericGroupPrincipal [Primary Group]: {0}"}, - {"UnixNumericGroupPrincipal [Supplementary Group]: name", + {"UnixNumericGroupPrincipal.Supplementary.Group.name", "UnixNumericGroupPrincipal [Supplementary Group]: {0}"}, - {"UnixNumericUserPrincipal: name", "UnixNumericUserPrincipal: {0}"}, - {"UnixPrincipal: name", "UnixPrincipal: {0}"}, + {"UnixNumericUserPrincipal.name", "UnixNumericUserPrincipal: {0}"}, + {"UnixPrincipal.name", "UnixPrincipal: {0}"}, // com.sun.security.auth.login.ConfigFile - {"Unable to properly expand config", "Unable to properly expand {0}"}, - {"extra_config (No such file or directory)", + {"Unable.to.properly.expand.config", "Unable to properly expand {0}"}, + {"extra.config.No.such.file.or.directory.", "{0} (No such file or directory)"}, - {"Configuration Error:\n\tNo such file or directory", + {"Configuration.Error.No.such.file.or.directory", "Configuration Error:\n\tNo such file or directory"}, - {"Configuration Error:\n\tInvalid control flag, flag", + {"Configuration.Error.Invalid.control.flag.flag", "Configuration Error:\n\tInvalid control flag, {0}"}, - {"Configuration Error:\n\tCan not specify multiple entries for appName", + {"Configuration.Error.Can.not.specify.multiple.entries.for.appName", "Configuration Error:\n\tCan not specify multiple entries for {0}"}, - {"Configuration Error:\n\texpected [expect], read [end of file]", + {"Configuration.Error.expected.expect.read.end.of.file.", "Configuration Error:\n\texpected [{0}], read [end of file]"}, - {"Configuration Error:\n\tLine line: expected [expect], found [value]", + {"Configuration.Error.Line.line.expected.expect.found.value.", "Configuration Error:\n\tLine {0}: expected [{1}], found [{2}]"}, - {"Configuration Error:\n\tLine line: expected [expect]", + {"Configuration.Error.Line.line.expected.expect.", "Configuration Error:\n\tLine {0}: expected [{1}]"}, - {"Configuration Error:\n\tLine line: system property [value] expanded to empty value", + {"Configuration.Error.Line.line.system.property.value.expanded.to.empty.value", "Configuration Error:\n\tLine {0}: system property [{1}] expanded to empty value"}, // com.sun.security.auth.module.JndiLoginModule - {"username: ","username: "}, - {"password: ","password: "}, + {"username.","username: "}, + {"password.","password: "}, // com.sun.security.auth.module.KeyStoreLoginModule - {"Please enter keystore information", + {"Please.enter.keystore.information", "Please enter keystore information"}, - {"Keystore alias: ","Keystore alias: "}, - {"Keystore password: ","Keystore password: "}, - {"Private key password (optional): ", + {"Keystore.alias.","Keystore alias: "}, + {"Keystore.password.","Keystore password: "}, + {"Private.key.password.optional.", "Private key password (optional): "}, // com.sun.security.auth.module.Krb5LoginModule - {"Kerberos username [[defUsername]]: ", + {"Kerberos.username.defUsername.", "Kerberos username [{0}]: "}, - {"Kerberos password for [username]: ", + {"Kerberos.password.for.username.", "Kerberos password for {0}: "}, /*** EVERYTHING BELOW IS DEPRECATED ***/ // com.sun.security.auth.PolicyFile - {": error parsing ", ": error parsing "}, - {": ", ": "}, - {": error adding Permission ", ": error adding Permission "}, - {" ", " "}, - {": error adding Entry ", ": error adding Entry "}, - {"(", "("}, - {")", ")"}, - {"attempt to add a Permission to a readonly PermissionCollection", + {".error.parsing.", ": error parsing "}, + {"COLON", ": "}, + {".error.adding.Permission.", ": error adding Permission "}, + {"SPACE", " "}, + {".error.adding.Entry.", ": error adding Entry "}, + {"LPARAM", "("}, + {"RPARAM", ")"}, + {"attempt.to.add.a.Permission.to.a.readonly.PermissionCollection", "attempt to add a Permission to a readonly PermissionCollection"}, // com.sun.security.auth.PolicyParser - {"expected keystore type", "expected keystore type"}, - {"can not specify Principal with a ", + {"expected.keystore.type", "expected keystore type"}, + {"can.not.specify.Principal.with.a.", "can not specify Principal with a "}, - {"wildcard class without a wildcard name", + {"wildcard.class.without.a.wildcard.name", "wildcard class without a wildcard name"}, - {"expected codeBase or SignedBy", "expected codeBase or SignedBy"}, - {"only Principal-based grant entries permitted", + {"expected.codeBase.or.SignedBy", "expected codeBase or SignedBy"}, + {"only.Principal.based.grant.entries.permitted", "only Principal-based grant entries permitted"}, - {"expected permission entry", "expected permission entry"}, - {"number ", "number "}, - {"expected ", "expected "}, - {", read end of file", ", read end of file"}, - {"expected ';', read end of file", "expected ';', read end of file"}, - {"line ", "line "}, - {": expected '", ": expected '"}, - {"', found '", "', found '"}, - {"'", "'"}, + {"expected.permission.entry", "expected permission entry"}, + {"number.", "number "}, + {"expected.", "expected "}, + {".read.end.of.file", ", read end of file"}, + {"expected.read.end.of.file", "expected ';', read end of file"}, + {"line.", "line "}, + {".expected.", ": expected '"}, + {".found.", "', found '"}, + {"QUOTE", "'"}, // SolarisPrincipals - {"SolarisNumericGroupPrincipal [Primary Group]: ", + {"SolarisNumericGroupPrincipal.Primary.Group.", "SolarisNumericGroupPrincipal [Primary Group]: "}, - {"SolarisNumericGroupPrincipal [Supplementary Group]: ", + {"SolarisNumericGroupPrincipal.Supplementary.Group.", "SolarisNumericGroupPrincipal [Supplementary Group]: "}, - {"SolarisNumericUserPrincipal: ", + {"SolarisNumericUserPrincipal.", "SolarisNumericUserPrincipal: "}, - {"SolarisPrincipal: ", "SolarisPrincipal: "}, - {"provided null name", "provided null name"} + {"SolarisPrincipal.", "SolarisPrincipal: "}, + {"provided.null.name", "provided null name"} }; diff --git a/jdk/src/share/classes/sun/security/util/AuthResources_de.java b/jdk/src/share/classes/sun/security/util/AuthResources_de.java index ad0ddc08086..bd3a3f93810 100644 --- a/jdk/src/share/classes/sun/security/util/AuthResources_de.java +++ b/jdk/src/share/classes/sun/security/util/AuthResources_de.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/util/AuthResources_es.java b/jdk/src/share/classes/sun/security/util/AuthResources_es.java index 9249d859c14..543f47f1fad 100644 --- a/jdk/src/share/classes/sun/security/util/AuthResources_es.java +++ b/jdk/src/share/classes/sun/security/util/AuthResources_es.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/util/AuthResources_fr.java b/jdk/src/share/classes/sun/security/util/AuthResources_fr.java index c8b0df0f606..c1a009b13d5 100644 --- a/jdk/src/share/classes/sun/security/util/AuthResources_fr.java +++ b/jdk/src/share/classes/sun/security/util/AuthResources_fr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/util/AuthResources_it.java b/jdk/src/share/classes/sun/security/util/AuthResources_it.java index f6eaef8540a..f0eb8dbe071 100644 --- a/jdk/src/share/classes/sun/security/util/AuthResources_it.java +++ b/jdk/src/share/classes/sun/security/util/AuthResources_it.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/util/AuthResources_ja.java b/jdk/src/share/classes/sun/security/util/AuthResources_ja.java index 417e312a5ca..33ba47fe7b5 100644 --- a/jdk/src/share/classes/sun/security/util/AuthResources_ja.java +++ b/jdk/src/share/classes/sun/security/util/AuthResources_ja.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/util/AuthResources_ko.java b/jdk/src/share/classes/sun/security/util/AuthResources_ko.java index 5edecfebc0a..148957d4cd1 100644 --- a/jdk/src/share/classes/sun/security/util/AuthResources_ko.java +++ b/jdk/src/share/classes/sun/security/util/AuthResources_ko.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/util/AuthResources_pt_BR.java b/jdk/src/share/classes/sun/security/util/AuthResources_pt_BR.java new file mode 100644 index 00000000000..23a6094e484 --- /dev/null +++ b/jdk/src/share/classes/sun/security/util/AuthResources_pt_BR.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.util; + +/** + *

      This class represents the ResourceBundle + * for the following packages: + * + *

        + *
      1. com.sun.security.auth + *
      2. com.sun.security.auth.login + *
      + * + * @version 1.6, 01/23/01 + */ +public class AuthResources_pt_BR extends java.util.ListResourceBundle { + + private static final Object[][] contents = { + + // NT principals + {"invalid null input: value", "entrada nula inv\u00e1lida: {0}"}, + {"NTDomainPrincipal: name", "NTDomainPrincipal: {0}"}, + {"NTNumericCredential: name", "NTNumericCredential: {0}"}, + {"Invalid NTSid value", "Valor de NTSid inv\u00e1lido"}, + {"NTSid: name", "NTSid: {0}"}, + {"NTSidDomainPrincipal: name", "NTSidDomainPrincipal: {0}"}, + {"NTSidGroupPrincipal: name", "NTSidGroupPrincipal: {0}"}, + {"NTSidPrimaryGroupPrincipal: name", "NTSidPrimaryGroupPrincipal: {0}"}, + {"NTSidUserPrincipal: name", "NTSidUserPrincipal: {0}"}, + {"NTUserPrincipal: name", "NTUserPrincipal: {0}"}, + + // UnixPrincipals + {"UnixNumericGroupPrincipal [Primary Group]: name", + "UnixNumericGroupPrincipal [grupo principal]: {0}"}, + {"UnixNumericGroupPrincipal [Supplementary Group]: name", + "UnixNumericGroupPrincipal [grupo complement\u00e1rio]: {0}"}, + {"UnixNumericUserPrincipal: name", "UnixNumericUserPrincipal: {0}"}, + {"UnixPrincipal: name", "UnixPrincipal: {0}"}, + + // com.sun.security.auth.login.ConfigFile + {"Unable to properly expand config", "N\u00e3o \u00e9 poss\u00edvel expandir corretamente {0}"}, + {"extra_config (No such file or directory)", + "{0} (tal arquivo ou diret\u00f3rio n\u00e3o existe)"}, + {"Unable to locate a login configuration", + "N\u00e3o \u00e9 poss\u00edvel localizar uma configura\u00e7\u00e3o de logon"}, + {"Configuration Error:\n\tInvalid control flag, flag", + "Erro de configura\u00e7\u00e3o:\n\tSinalizador de controle inv\u00e1lido, {0}"}, + {"Configuration Error:\n\tCan not specify multiple entries for appName", + "Erro de configura\u00e7\u00e3o:\n\tN\u00e3o \u00e9 poss\u00edvel especificar v\u00e1rias entradas para {0}"}, + {"Configuration Error:\n\texpected [expect], read [end of file]", + "Erro de configura\u00e7\u00e3o:\n\tesperado [{0}], lido [fim do arquivo]"}, + {"Configuration Error:\n\tLine line: expected [expect], found [value]", + "Erro de configura\u00e7\u00e3o:\n\tlinha {0}: esperado [{1}], encontrado [{2}]"}, + {"Configuration Error:\n\tLine line: expected [expect]", + "Erro de configura\u00e7\u00e3o:\n\tlinha {0}: esperado [{1}]"}, + {"Configuration Error:\n\tLine line: system property [value] expanded to empty value", + "Erro de configura\u00e7\u00e3o:\n\tlinha {0}: propriedade do sistema [{1}] expandida para valor vazio"}, + + // com.sun.security.auth.module.JndiLoginModule + {"username: ","nome de usu\u00e1rio: "}, + {"password: ","senha: "}, + + // com.sun.security.auth.module.KeyStoreLoginModule + {"Please enter keystore information", + "Insira as informa\u00e7\u00f5es do armazenamento de chaves"}, + {"Keystore alias: ","Alias do armazenamento de chaves: "}, + {"Keystore password: ","Senha do armazenamento de chaves: "}, + {"Private key password (optional): ", + "Senha da chave privada (opcional): "}, + + // com.sun.security.auth.module.Krb5LoginModule + {"Kerberos username [[defUsername]]: ", + "Nome de usu\u00e1rio de Kerberos [{0}]: "}, + {"Kerberos password for [username]: ", + "Senha de Kerberos de {0}: "}, + + /*** EVERYTHING BELOW IS DEPRECATED ***/ + + // com.sun.security.auth.PolicyFile + {": error parsing ", ": erro ao analisar "}, + {": ", ": "}, + {": error adding Permission ", ": erro ao adicionar permiss\u00e3o "}, + {" ", " "}, + {": error adding Entry ", ": erro ao adicionar entrada "}, + {"(", "("}, + {")", ")"}, + {"attempt to add a Permission to a readonly PermissionCollection", + "tentativa de adicionar uma permiss\u00e3o ao um PermissionCollection de somente leitura"}, + + // com.sun.security.auth.PolicyParser + {"expected keystore type", "tipo de armazenamento de chaves esperado"}, + {"can not specify Principal with a ", + "n\u00e3o \u00e9 poss\u00edvel especificar um principal com uma "}, + {"wildcard class without a wildcard name", + "de coringa sem um nome de coringa"}, + {"expected codeBase or SignedBy", "CodeBase ou SignedBy esperado"}, + {"only Principal-based grant entries permitted", + "somente \u00e9 permitido conceder entradas com base no principal"}, + {"expected permission entry", "entrada de permiss\u00e3o esperada"}, + {"number ", "n\u00famero "}, + {"expected ", "esperado "}, + {", read end of file", ", fim de arquivo lido"}, + {"expected ';', read end of file", "esperado ';', fim de arquivo lido"}, + {"line ", "linha "}, + {": expected '", ": esperado '"}, + {"', found '", "', encontrado '"}, + {"'", "'"}, + + // SolarisPrincipals + {"SolarisNumericGroupPrincipal [Primary Group]: ", + "SolarisNumericGroupPrincipal [grupo principal]: "}, + {"SolarisNumericGroupPrincipal [Supplementary Group]: ", + "SolarisNumericGroupPrincipal [grupo complement\u00e1rio]: "}, + {"SolarisNumericUserPrincipal: ", + "SolarisNumericUserPrincipal: "}, + {"SolarisPrincipal: ", "SolarisPrincipal: "}, + {"provided null name", "nome nulo fornecido"} + + }; + + /** + * Returns the contents of this ResourceBundle. + * + *

      + * + * @return the contents of this ResourceBundle. + */ + public Object[][] getContents() { + return contents; + } +} diff --git a/jdk/src/share/classes/sun/security/util/AuthResources_sv.java b/jdk/src/share/classes/sun/security/util/AuthResources_sv.java index ccacb01f835..8dcf0920f34 100644 --- a/jdk/src/share/classes/sun/security/util/AuthResources_sv.java +++ b/jdk/src/share/classes/sun/security/util/AuthResources_sv.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/util/AuthResources_zh_CN.java b/jdk/src/share/classes/sun/security/util/AuthResources_zh_CN.java index 2ab890a3248..3e92c787748 100644 --- a/jdk/src/share/classes/sun/security/util/AuthResources_zh_CN.java +++ b/jdk/src/share/classes/sun/security/util/AuthResources_zh_CN.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/util/AuthResources_zh_TW.java b/jdk/src/share/classes/sun/security/util/AuthResources_zh_TW.java index 42fca7c4f6f..1cb58dd5873 100644 --- a/jdk/src/share/classes/sun/security/util/AuthResources_zh_TW.java +++ b/jdk/src/share/classes/sun/security/util/AuthResources_zh_TW.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/util/DisabledAlgorithmConstraints.java b/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java new file mode 100644 index 00000000000..a537c554854 --- /dev/null +++ b/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java @@ -0,0 +1,486 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.util; + +import java.security.AlgorithmConstraints; +import java.security.CryptoPrimitive; +import java.security.AlgorithmParameters; + +import java.security.Key; +import java.security.Security; +import java.security.PrivilegedAction; +import java.security.AccessController; +import java.security.interfaces.ECKey; +import java.security.interfaces.RSAKey; +import java.security.interfaces.DSAKey; +import javax.crypto.SecretKey; +import javax.crypto.interfaces.DHKey; + +import java.util.Locale; +import java.util.Set; +import java.util.Collections; +import java.util.HashSet; +import java.util.Map; +import java.util.HashMap; +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +/** + * Algorithm constraints for disabled algorithms property + * + * See the "jdk.certpath.disabledAlgorithms" specification in java.security + * for the syntax of the disabled algorithm string. + */ +public class DisabledAlgorithmConstraints implements AlgorithmConstraints { + + // the known security property, jdk.certpath.disabledAlgorithms + public final static String PROPERTY_CERTPATH_DISABLED_ALGS = + "jdk.certpath.disabledAlgorithms"; + + // the known security property, jdk.tls.disabledAlgorithms + public final static String PROPERTY_TLS_DISABLED_ALGS = + "jdk.tls.disabledAlgorithms"; + + private static Map disabledAlgorithmsMap = + Collections.synchronizedMap(new HashMap()); + private static Map keySizeConstraintsMap = + Collections.synchronizedMap(new HashMap()); + + private String[] disabledAlgorithms; + private KeySizeConstraints keySizeConstraints; + + /** + * Initialize algorithm constraints with the specified security property. + * + * @param propertyName the security property name that define the disabled + * algorithm constraints + */ + public DisabledAlgorithmConstraints(String propertyName) { + synchronized (disabledAlgorithmsMap) { + if(!disabledAlgorithmsMap.containsKey(propertyName)) { + loadDisabledAlgorithmsMap(propertyName); + } + + disabledAlgorithms = disabledAlgorithmsMap.get(propertyName); + keySizeConstraints = keySizeConstraintsMap.get(propertyName); + } + } + + @Override + final public boolean permits(Set primitives, + String algorithm, AlgorithmParameters parameters) { + + if (algorithm == null || algorithm.length() == 0) { + throw new IllegalArgumentException("No algorithm name specified"); + } + + if (primitives == null || primitives.isEmpty()) { + throw new IllegalArgumentException( + "No cryptographic primitive specified"); + } + + Set elements = null; + for (String disabled : disabledAlgorithms) { + if (disabled == null || disabled.isEmpty()) { + continue; + } + + // check the full name + if (disabled.equalsIgnoreCase(algorithm)) { + return false; + } + + // decompose the algorithm into sub-elements + if (elements == null) { + elements = decomposes(algorithm); + } + + // check the items of the algorithm + for (String element : elements) { + if (disabled.equalsIgnoreCase(element)) { + return false; + } + } + } + + return true; + } + + @Override + final public boolean permits(Set primitives, Key key) { + return checkConstraints(primitives, "", key, null); + } + + @Override + final public boolean permits(Set primitives, + String algorithm, Key key, AlgorithmParameters parameters) { + + if (algorithm == null || algorithm.length() == 0) { + throw new IllegalArgumentException("No algorithm name specified"); + } + + return checkConstraints(primitives, algorithm, key, parameters); + } + + /** + * Decompose the standard algorithm name into sub-elements. + *

      + * For example, we need to decompose "SHA1WithRSA" into "SHA1" and "RSA" + * so that we can check the "SHA1" and "RSA" algorithm constraints + * separately. + *

      + * Please override the method if need to support more name pattern. + */ + protected Set decomposes(String algorithm) { + if (algorithm == null || algorithm.length() == 0) { + return new HashSet(); + } + + // algorithm/mode/padding + Pattern transPattern = Pattern.compile("/"); + String[] transTockens = transPattern.split(algorithm); + + Set elements = new HashSet(); + for (String transTocken : transTockens) { + if (transTocken == null || transTocken.length() == 0) { + continue; + } + + // PBEWithAnd + // PBEWithAnd + // OAEPWithAndPadding + // with + // withand + Pattern pattern = + Pattern.compile("with|and", Pattern.CASE_INSENSITIVE); + String[] tokens = pattern.split(transTocken); + + for (String token : tokens) { + if (token == null || token.length() == 0) { + continue; + } + + elements.add(token); + } + } + + // In Java standard algorithm name specification, for different + // purpose, the SHA-1 and SHA-2 algorithm names are different. For + // example, for MessageDigest, the standard name is "SHA-256", while + // for Signature, the digest algorithm component is "SHA256" for + // signature algorithm "SHA256withRSA". So we need to check both + // "SHA-256" and "SHA256" to make the right constraint checking. + + // handle special name: SHA-1 and SHA1 + if (elements.contains("SHA1") && !elements.contains("SHA-1")) { + elements.add("SHA-1"); + } + if (elements.contains("SHA-1") && !elements.contains("SHA1")) { + elements.add("SHA1"); + } + + // handle special name: SHA-224 and SHA224 + if (elements.contains("SHA224") && !elements.contains("SHA-224")) { + elements.add("SHA-224"); + } + if (elements.contains("SHA-224") && !elements.contains("SHA224")) { + elements.add("SHA224"); + } + + // handle special name: SHA-256 and SHA256 + if (elements.contains("SHA256") && !elements.contains("SHA-256")) { + elements.add("SHA-256"); + } + if (elements.contains("SHA-256") && !elements.contains("SHA256")) { + elements.add("SHA256"); + } + + // handle special name: SHA-384 and SHA384 + if (elements.contains("SHA384") && !elements.contains("SHA-384")) { + elements.add("SHA-384"); + } + if (elements.contains("SHA-384") && !elements.contains("SHA384")) { + elements.add("SHA384"); + } + + // handle special name: SHA-512 and SHA512 + if (elements.contains("SHA512") && !elements.contains("SHA-512")) { + elements.add("SHA-512"); + } + if (elements.contains("SHA-512") && !elements.contains("SHA512")) { + elements.add("SHA512"); + } + + return elements; + } + + // Check algorithm constraints + private boolean checkConstraints(Set primitives, + String algorithm, Key key, AlgorithmParameters parameters) { + + // check the key parameter, it cannot be null. + if (key == null) { + throw new IllegalArgumentException("The key cannot be null"); + } + + // check the target algorithm + if (algorithm != null && algorithm.length() != 0) { + if (!permits(primitives, algorithm, parameters)) { + return false; + } + } + + // check the key algorithm + if (!permits(primitives, key.getAlgorithm(), null)) { + return false; + } + + // check the key constraints + if (keySizeConstraints.disables(key)) { + return false; + } + + return true; + } + + // Get disabled algorithm constraints from the specified security property. + private static void loadDisabledAlgorithmsMap( + final String propertyName) { + + String property = AccessController.doPrivileged( + new PrivilegedAction() { + public String run() { + return Security.getProperty(propertyName); + } + }); + + String[] algorithmsInProperty = null; + + if (property != null && !property.isEmpty()) { + + // remove double quote marks from beginning/end of the property + if (property.charAt(0) == '"' && + property.charAt(property.length() - 1) == '"') { + property = property.substring(1, property.length() - 1); + } + + algorithmsInProperty = property.split(","); + for (int i = 0; i < algorithmsInProperty.length; i++) { + algorithmsInProperty[i] = algorithmsInProperty[i].trim(); + } + } + + // map the disabled algorithms + if (algorithmsInProperty == null) { + algorithmsInProperty = new String[0]; + } + disabledAlgorithmsMap.put(propertyName, algorithmsInProperty); + + // map the key constraints + KeySizeConstraints keySizeConstraints = + new KeySizeConstraints(algorithmsInProperty); + keySizeConstraintsMap.put(propertyName, keySizeConstraints); + } + + /** + * key constraints + */ + private static class KeySizeConstraints { + private static final Pattern pattern = Pattern.compile( + "(\\S+)\\s+keySize\\s*(<=|<|==|!=|>|>=)\\s*(\\d+)"); + + private Map> constraintsMap = + Collections.synchronizedMap( + new HashMap>()); + + public KeySizeConstraints(String[] restrictions) { + for (String restriction : restrictions) { + if (restriction == null || restriction.isEmpty()) { + continue; + } + + Matcher matcher = pattern.matcher(restriction); + if (matcher.matches()) { + String algorithm = matcher.group(1); + + KeySizeConstraint.Operator operator = + KeySizeConstraint.Operator.of(matcher.group(2)); + int length = Integer.parseInt(matcher.group(3)); + + algorithm = algorithm.toLowerCase(Locale.ENGLISH); + + synchronized (constraintsMap) { + if (!constraintsMap.containsKey(algorithm)) { + constraintsMap.put(algorithm, + new HashSet()); + } + + Set constraintSet = + constraintsMap.get(algorithm); + KeySizeConstraint constraint = + new KeySizeConstraint(operator, length); + constraintSet.add(constraint); + } + } + } + } + + // Does this KeySizeConstraints disable the specified key? + public boolean disables(Key key) { + String algorithm = key.getAlgorithm().toLowerCase(Locale.ENGLISH); + synchronized (constraintsMap) { + if (constraintsMap.containsKey(algorithm)) { + Set constraintSet = + constraintsMap.get(algorithm); + for (KeySizeConstraint constraint : constraintSet) { + if (constraint.disables(key)) { + return true; + } + } + } + } + + return false; + } + } + + /** + * Key size constraint. + * + * e.g. "keysize <= 1024" + */ + private static class KeySizeConstraint { + // operator + static enum Operator { + EQ, // "==" + NE, // "!=" + LT, // "<" + LE, // "<=" + GT, // ">" + GE; // ">=" + + static Operator of(String s) { + switch (s) { + case "==": + return EQ; + case "!=": + return NE; + case "<": + return LT; + case "<=": + return LE; + case ">": + return GT; + case ">=": + return GE; + } + + throw new IllegalArgumentException( + s + " is not a legal Operator"); + } + } + + private int minSize; // the minimal available key size + private int maxSize; // the maximal available key size + private int prohibitedSize = -1; // unavailable key sizes + + public KeySizeConstraint(Operator operator, int length) { + switch (operator) { + case EQ: // an unavailable key size + this.minSize = 0; + this.maxSize = Integer.MAX_VALUE; + prohibitedSize = length; + break; + case NE: + this.minSize = length; + this.maxSize = length; + break; + case LT: + this.minSize = length; + this.maxSize = Integer.MAX_VALUE; + break; + case LE: + this.minSize = length + 1; + this.maxSize = Integer.MAX_VALUE; + break; + case GT: + this.minSize = 0; + this.maxSize = length; + break; + case GE: + this.minSize = 0; + this.maxSize = length > 1 ? (length - 1) : 0; + break; + default: + // unlikely to happen + this.minSize = Integer.MAX_VALUE; + this.maxSize = -1; + } + } + + // Does this key constraint disable the specified key? + public boolean disables(Key key) { + int size = -1; + + // it is a SecretKey + if (key instanceof SecretKey) { + SecretKey sk = (SecretKey)key; + if (sk.getFormat().equals("RAW") && sk.getEncoded() != null) { + size = sk.getEncoded().length * 8; + + } + } + + // it is an asymmetric key + if (key instanceof RSAKey) { + RSAKey pubk = (RSAKey)key; + size = pubk.getModulus().bitLength(); + } else if (key instanceof ECKey) { + ECKey pubk = (ECKey)key; + size = pubk.getParams().getOrder().bitLength(); + } else if (key instanceof DSAKey) { + DSAKey pubk = (DSAKey)key; + size = pubk.getParams().getP().bitLength(); + } else if (key instanceof DHKey) { + DHKey pubk = (DHKey)key; + size = pubk.getParams().getP().bitLength(); + } // else, it is not a key we know. + + if (size == 0) { + return true; // we don't allow any key of size 0. + } + + if (size >= 0) { + return ((size < minSize) || (size > maxSize) || + (prohibitedSize == size)); + } + + return false; + } + } + +} + diff --git a/jdk/src/share/classes/sun/security/util/ManifestEntryVerifier.java b/jdk/src/share/classes/sun/security/util/ManifestEntryVerifier.java index 3952ccee86d..3bcc18a7456 100644 --- a/jdk/src/share/classes/sun/security/util/ManifestEntryVerifier.java +++ b/jdk/src/share/classes/sun/security/util/ManifestEntryVerifier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,16 @@ public class ManifestEntryVerifier { private static final Debug debug = Debug.getInstance("jar"); + /** + * Holder class to lazily load Sun provider. NOTE: if + * Providers.getSunProvider returned a cached provider, we could avoid the + * need for caching the provider with this holder class; we should try to + * revisit this in JDK 8. + */ + private static class SunProviderHolder { + private static final Provider instance = Providers.getSunProvider(); + } + /** the created digest objects */ HashMap createdDigests; @@ -125,7 +135,7 @@ public class ManifestEntryVerifier { try { digest = MessageDigest.getInstance - (algorithm, Providers.getSunProvider()); + (algorithm, SunProviderHolder.instance); createdDigests.put(algorithm, digest); } catch (NoSuchAlgorithmException nsae) { // ignore @@ -185,7 +195,10 @@ public class ManifestEntryVerifier { Hashtable sigFileSigners) throws JarException { - if (skip) return null; + // MANIFEST.MF should not be skipped. It has signers. + if (skip && !entry.getName().equals(JarFile.MANIFEST_NAME)) { + return null; + } if (signers != null) return signers; diff --git a/jdk/src/share/classes/sun/security/util/Resources.java b/jdk/src/share/classes/sun/security/util/Resources.java index 1186c298054..5489c3d9eaa 100644 --- a/jdk/src/share/classes/sun/security/util/Resources.java +++ b/jdk/src/share/classes/sun/security/util/Resources.java @@ -35,434 +35,428 @@ public class Resources extends java.util.ListResourceBundle { private static final Object[][] contents = { // shared (from jarsigner) - {" ", " "}, - {" ", " "}, - {" ", " "}, - {", ", ", "}, + {"SPACE", " "}, + {"2SPACE", " "}, + {"6SPACE", " "}, + {"COMMA", ", "}, // shared (from keytool) - {"\n", "\n"}, - {"*******************************************", + {"NEWLINE", "\n"}, + {"STAR", "*******************************************"}, - {"*******************************************\n\n", + {"STARNN", "*******************************************\n\n"}, // keytool: Help part - {" [OPTION]...", " [OPTION]..."}, - {"Options:", "Options:"}, - {"Use \"keytool -help\" for all available commands", + {".OPTION.", " [OPTION]..."}, + {"Options.", "Options:"}, + {"Use.keytool.help.for.all.available.commands", "Use \"keytool -help\" for all available commands"}, - {"Key and Certificate Management Tool", + {"Key.and.Certificate.Management.Tool", "Key and Certificate Management Tool"}, - {"Commands:", "Commands:"}, - {"Use \"keytool -command_name -help\" for usage of command_name", + {"Commands.", "Commands:"}, + {"Use.keytool.command.name.help.for.usage.of.command.name", "Use \"keytool -command_name -help\" for usage of command_name"}, // keytool: help: commands - {"Generates a certificate request", + {"Generates.a.certificate.request", "Generates a certificate request"}, //-certreq - {"Changes an entry's alias", + {"Changes.an.entry.s.alias", "Changes an entry's alias"}, //-changealias - {"Deletes an entry", + {"Deletes.an.entry", "Deletes an entry"}, //-delete - {"Exports certificate", + {"Exports.certificate", "Exports certificate"}, //-exportcert - {"Generates a key pair", + {"Generates.a.key.pair", "Generates a key pair"}, //-genkeypair - {"Generates a secret key", + {"Generates.a.secret.key", "Generates a secret key"}, //-genseckey - {"Generates certificate from a certificate request", + {"Generates.certificate.from.a.certificate.request", "Generates certificate from a certificate request"}, //-gencert - {"Generates CRL", "Generates CRL"}, //-gencrl - {"Imports entries from a JDK 1.1.x-style identity database", + {"Generates.CRL", "Generates CRL"}, //-gencrl + {"Imports.entries.from.a.JDK.1.1.x.style.identity.database", "Imports entries from a JDK 1.1.x-style identity database"}, //-identitydb - {"Imports a certificate or a certificate chain", + {"Imports.a.certificate.or.a.certificate.chain", "Imports a certificate or a certificate chain"}, //-importcert - {"Imports one or all entries from another keystore", + {"Imports.one.or.all.entries.from.another.keystore", "Imports one or all entries from another keystore"}, //-importkeystore - {"Clones a key entry", + {"Clones.a.key.entry", "Clones a key entry"}, //-keyclone - {"Changes the key password of an entry", + {"Changes.the.key.password.of.an.entry", "Changes the key password of an entry"}, //-keypasswd - {"Lists entries in a keystore", + {"Lists.entries.in.a.keystore", "Lists entries in a keystore"}, //-list - {"Prints the content of a certificate", + {"Prints.the.content.of.a.certificate", "Prints the content of a certificate"}, //-printcert - {"Prints the content of a certificate request", + {"Prints.the.content.of.a.certificate.request", "Prints the content of a certificate request"}, //-printcertreq - {"Prints the content of a CRL file", + {"Prints.the.content.of.a.CRL.file", "Prints the content of a CRL file"}, //-printcrl - {"Generates a self-signed certificate", + {"Generates.a.self.signed.certificate", "Generates a self-signed certificate"}, //-selfcert - {"Changes the store password of a keystore", + {"Changes.the.store.password.of.a.keystore", "Changes the store password of a keystore"}, //-storepasswd // keytool: help: options - {"alias name of the entry to process", + {"alias.name.of.the.entry.to.process", "alias name of the entry to process"}, //-alias - {"destination alias", + {"destination.alias", "destination alias"}, //-destalias - {"destination key password", + {"destination.key.password", "destination key password"}, //-destkeypass - {"destination keystore name", + {"destination.keystore.name", "destination keystore name"}, //-destkeystore - {"destination keystore password protected", + {"destination.keystore.password.protected", "destination keystore password protected"}, //-destprotected - {"destination keystore provider name", + {"destination.keystore.provider.name", "destination keystore provider name"}, //-destprovidername - {"destination keystore password", + {"destination.keystore.password", "destination keystore password"}, //-deststorepass - {"destination keystore type", + {"destination.keystore.type", "destination keystore type"}, //-deststoretype - {"distinguished name", + {"distinguished.name", "distinguished name"}, //-dname - {"X.509 extension", + {"X.509.extension", "X.509 extension"}, //-ext - {"output file name", + {"output.file.name", "output file name"}, //-file and -outfile - {"input file name", + {"input.file.name", "input file name"}, //-file and -infile - {"key algorithm name", + {"key.algorithm.name", "key algorithm name"}, //-keyalg - {"key password", + {"key.password", "key password"}, //-keypass - {"key bit size", + {"key.bit.size", "key bit size"}, //-keysize - {"keystore name", + {"keystore.name", "keystore name"}, //-keystore - {"new password", + {"new.password", "new password"}, //-new - {"do not prompt", + {"do.not.prompt", "do not prompt"}, //-noprompt - {"password through protected mechanism", + {"password.through.protected.mechanism", "password through protected mechanism"}, //-protected - {"provider argument", + {"provider.argument", "provider argument"}, //-providerarg - {"provider class name", + {"provider.class.name", "provider class name"}, //-providerclass - {"provider name", + {"provider.name", "provider name"}, //-providername - {"provider classpath", + {"provider.classpath", "provider classpath"}, //-providerpath - {"output in RFC style", + {"output.in.RFC.style", "output in RFC style"}, //-rfc - {"signature algorithm name", + {"signature.algorithm.name", "signature algorithm name"}, //-sigalg - {"source alias", + {"source.alias", "source alias"}, //-srcalias - {"source key password", + {"source.key.password", "source key password"}, //-srckeypass - {"source keystore name", + {"source.keystore.name", "source keystore name"}, //-srckeystore - {"source keystore password protected", + {"source.keystore.password.protected", "source keystore password protected"}, //-srcprotected - {"source keystore provider name", + {"source.keystore.provider.name", "source keystore provider name"}, //-srcprovidername - {"source keystore password", + {"source.keystore.password", "source keystore password"}, //-srcstorepass - {"source keystore type", + {"source.keystore.type", "source keystore type"}, //-srcstoretype - {"SSL server host and port", + {"SSL.server.host.and.port", "SSL server host and port"}, //-sslserver - {"signed jar file", + {"signed.jar.file", "signed jar file"}, //=jarfile - {"certificate validity start date/time", + {"certificate.validity.start.date.time", "certificate validity start date/time"}, //-startdate - {"keystore password", + {"keystore.password", "keystore password"}, //-storepass - {"keystore type", + {"keystore.type", "keystore type"}, //-storetype - {"trust certificates from cacerts", + {"trust.certificates.from.cacerts", "trust certificates from cacerts"}, //-trustcacerts - {"verbose output", + {"verbose.output", "verbose output"}, //-v - {"validity number of days", + {"validity.number.of.days", "validity number of days"}, //-validity - {"Serial ID of cert to revoke", + {"Serial.ID.of.cert.to.revoke", "Serial ID of cert to revoke"}, //-id // keytool: Running part - {"keytool error: ", "keytool error: "}, - {"Illegal option: ", "Illegal option: "}, - {"Illegal value: ", "Illegal value: "}, - {"Unknown password type: ", "Unknown password type: "}, - {"Cannot find environment variable: ", + {"keytool.error.", "keytool error: "}, + {"Illegal.option.", "Illegal option: "}, + {"Illegal.value.", "Illegal value: "}, + {"Unknown.password.type.", "Unknown password type: "}, + {"Cannot.find.environment.variable.", "Cannot find environment variable: "}, - {"Cannot find file: ", "Cannot find file: "}, - {"Command option needs an argument.", "Command option {0} needs an argument."}, - {"Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified value.", + {"Cannot.find.file.", "Cannot find file: "}, + {"Command.option.flag.needs.an.argument.", "Command option {0} needs an argument."}, + {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.", "Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified {0} value."}, - {"-keystore must be NONE if -storetype is {0}", + {".keystore.must.be.NONE.if.storetype.is.{0}", "-keystore must be NONE if -storetype is {0}"}, - {"Too many retries, program terminated", + {"Too.many.retries.program.terminated", "Too many retries, program terminated"}, - {"-storepasswd and -keypasswd commands not supported if -storetype is {0}", + {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}", "-storepasswd and -keypasswd commands not supported if -storetype is {0}"}, - {"-keypasswd commands not supported if -storetype is PKCS12", + {".keypasswd.commands.not.supported.if.storetype.is.PKCS12", "-keypasswd commands not supported if -storetype is PKCS12"}, - {"-keypass and -new can not be specified if -storetype is {0}", + {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}", "-keypass and -new can not be specified if -storetype is {0}"}, - {"if -protected is specified, then -storepass, -keypass, and -new must not be specified", + {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified", "if -protected is specified, then -storepass, -keypass, and -new must not be specified"}, - {"if -srcprotected is specified, then -srcstorepass and -srckeypass must not be specified", + {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified", "if -srcprotected is specified, then -srcstorepass and -srckeypass must not be specified"}, - {"if keystore is not password protected, then -storepass, -keypass, and -new must not be specified", + {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified", "if keystore is not password protected, then -storepass, -keypass, and -new must not be specified"}, - {"if source keystore is not password protected, then -srcstorepass and -srckeypass must not be specified", + {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified", "if source keystore is not password protected, then -srcstorepass and -srckeypass must not be specified"}, - {"Illegal startdate value", "Illegal startdate value"}, - {"Validity must be greater than zero", + {"Illegal.startdate.value", "Illegal startdate value"}, + {"Validity.must.be.greater.than.zero", "Validity must be greater than zero"}, - {"provName not a provider", "{0} not a provider"}, - {"Usage error: no command provided", "Usage error: no command provided"}, - {"Source keystore file exists, but is empty: ", "Source keystore file exists, but is empty: "}, - {"Please specify -srckeystore", "Please specify -srckeystore"}, - {"Must not specify both -v and -rfc with 'list' command", + {"provName.not.a.provider", "{0} not a provider"}, + {"Usage.error.no.command.provided", "Usage error: no command provided"}, + {"Source.keystore.file.exists.but.is.empty.", "Source keystore file exists, but is empty: "}, + {"Please.specify.srckeystore", "Please specify -srckeystore"}, + {"Must.not.specify.both.v.and.rfc.with.list.command", "Must not specify both -v and -rfc with 'list' command"}, - {"Key password must be at least 6 characters", + {"Key.password.must.be.at.least.6.characters", "Key password must be at least 6 characters"}, - {"New password must be at least 6 characters", + {"New.password.must.be.at.least.6.characters", "New password must be at least 6 characters"}, - {"Keystore file exists, but is empty: ", + {"Keystore.file.exists.but.is.empty.", "Keystore file exists, but is empty: "}, - {"Keystore file does not exist: ", + {"Keystore.file.does.not.exist.", "Keystore file does not exist: "}, - {"Must specify destination alias", "Must specify destination alias"}, - {"Must specify alias", "Must specify alias"}, - {"Keystore password must be at least 6 characters", + {"Must.specify.destination.alias", "Must specify destination alias"}, + {"Must.specify.alias", "Must specify alias"}, + {"Keystore.password.must.be.at.least.6.characters", "Keystore password must be at least 6 characters"}, - {"Enter keystore password: ", "Enter keystore password: "}, - {"Enter source keystore password: ", "Enter source keystore password: "}, - {"Enter destination keystore password: ", "Enter destination keystore password: "}, - {"Keystore password is too short - must be at least 6 characters", + {"Enter.keystore.password.", "Enter keystore password: "}, + {"Enter.source.keystore.password.", "Enter source keystore password: "}, + {"Enter.destination.keystore.password.", "Enter destination keystore password: "}, + {"Keystore.password.is.too.short.must.be.at.least.6.characters", "Keystore password is too short - must be at least 6 characters"}, - {"Unknown Entry Type", "Unknown Entry Type"}, - {"Too many failures. Alias not changed", "Too many failures. Alias not changed"}, - {"Entry for alias successfully imported.", + {"Unknown.Entry.Type", "Unknown Entry Type"}, + {"Too.many.failures.Alias.not.changed", "Too many failures. Alias not changed"}, + {"Entry.for.alias.alias.successfully.imported.", "Entry for alias {0} successfully imported."}, - {"Entry for alias not imported.", "Entry for alias {0} not imported."}, - {"Problem importing entry for alias : .\nEntry for alias not imported.", + {"Entry.for.alias.alias.not.imported.", "Entry for alias {0} not imported."}, + {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.", "Problem importing entry for alias {0}: {1}.\nEntry for alias {0} not imported."}, - {"Import command completed: entries successfully imported, entries failed or cancelled", + {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled", "Import command completed: {0} entries successfully imported, {1} entries failed or cancelled"}, - {"Warning: Overwriting existing alias in destination keystore", + {"Warning.Overwriting.existing.alias.alias.in.destination.keystore", "Warning: Overwriting existing alias {0} in destination keystore"}, - {"Existing entry alias exists, overwrite? [no]: ", + {"Existing.entry.alias.alias.exists.overwrite.no.", "Existing entry alias {0} exists, overwrite? [no]: "}, - {"Too many failures - try later", "Too many failures - try later"}, - {"Certification request stored in file ", + {"Too.many.failures.try.later", "Too many failures - try later"}, + {"Certification.request.stored.in.file.filename.", "Certification request stored in file <{0}>"}, - {"Submit this to your CA", "Submit this to your CA"}, - {"if alias not specified, destalias, srckeypass, and destkeypass must not be specified", + {"Submit.this.to.your.CA", "Submit this to your CA"}, + {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified", "if alias not specified, destalias, srckeypass, and destkeypass must not be specified"}, - {"Certificate stored in file ", + {"Certificate.stored.in.file.filename.", "Certificate stored in file <{0}>"}, - {"Certificate reply was installed in keystore", + {"Certificate.reply.was.installed.in.keystore", "Certificate reply was installed in keystore"}, - {"Certificate reply was not installed in keystore", + {"Certificate.reply.was.not.installed.in.keystore", "Certificate reply was not installed in keystore"}, - {"Certificate was added to keystore", + {"Certificate.was.added.to.keystore", "Certificate was added to keystore"}, - {"Certificate was not added to keystore", + {"Certificate.was.not.added.to.keystore", "Certificate was not added to keystore"}, - {"[Storing ksfname]", "[Storing {0}]"}, - {"alias has no public key (certificate)", + {".Storing.ksfname.", "[Storing {0}]"}, + {"alias.has.no.public.key.certificate.", "{0} has no public key (certificate)"}, - {"Cannot derive signature algorithm", + {"Cannot.derive.signature.algorithm", "Cannot derive signature algorithm"}, - {"Alias does not exist", + {"Alias.alias.does.not.exist", "Alias <{0}> does not exist"}, - {"Alias has no certificate", + {"Alias.alias.has.no.certificate", "Alias <{0}> has no certificate"}, - {"Key pair not generated, alias already exists", + {"Key.pair.not.generated.alias.alias.already.exists", "Key pair not generated, alias <{0}> already exists"}, - {"Generating keysize bit keyAlgName key pair and self-signed certificate (sigAlgName) with a validity of validality days\n\tfor: x500Name", + {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for", "Generating {0} bit {1} key pair and self-signed certificate ({2}) with a validity of {3} days\n\tfor: {4}"}, - {"Enter key password for ", "Enter key password for <{0}>"}, - {"\t(RETURN if same as keystore password): ", + {"Enter.key.password.for.alias.", "Enter key password for <{0}>"}, + {".RETURN.if.same.as.keystore.password.", "\t(RETURN if same as keystore password): "}, - {"Key password is too short - must be at least 6 characters", + {"Key.password.is.too.short.must.be.at.least.6.characters", "Key password is too short - must be at least 6 characters"}, - {"Too many failures - key not added to keystore", + {"Too.many.failures.key.not.added.to.keystore", "Too many failures - key not added to keystore"}, - {"Destination alias already exists", + {"Destination.alias.dest.already.exists", "Destination alias <{0}> already exists"}, - {"Password is too short - must be at least 6 characters", + {"Password.is.too.short.must.be.at.least.6.characters", "Password is too short - must be at least 6 characters"}, - {"Too many failures. Key entry not cloned", + {"Too.many.failures.Key.entry.not.cloned", "Too many failures. Key entry not cloned"}, - {"key password for ", "key password for <{0}>"}, - {"Keystore entry for already exists", + {"key.password.for.alias.", "key password for <{0}>"}, + {"Keystore.entry.for.id.getName.already.exists", "Keystore entry for <{0}> already exists"}, - {"Creating keystore entry for ...", + {"Creating.keystore.entry.for.id.getName.", "Creating keystore entry for <{0}> ..."}, - {"No entries from identity database added", + {"No.entries.from.identity.database.added", "No entries from identity database added"}, - {"Alias name: alias", "Alias name: {0}"}, - {"Creation date: keyStore.getCreationDate(alias)", + {"Alias.name.alias", "Alias name: {0}"}, + {"Creation.date.keyStore.getCreationDate.alias.", "Creation date: {0,date}"}, - {"alias, keyStore.getCreationDate(alias), ", + {"alias.keyStore.getCreationDate.alias.", "{0}, {1,date}, "}, - {"alias, ", "{0}, "}, - {"Entry type: ", "Entry type: {0}"}, - {"Certificate chain length: ", "Certificate chain length: "}, - {"Certificate[(i + 1)]:", "Certificate[{0,number,integer}]:"}, - {"Certificate fingerprint (SHA1): ", "Certificate fingerprint (SHA1): "}, - {"Entry type: trustedCertEntry\n", "Entry type: trustedCertEntry\n"}, - {"trustedCertEntry,", "trustedCertEntry,"}, - {"Keystore type: ", "Keystore type: "}, - {"Keystore provider: ", "Keystore provider: "}, - {"Your keystore contains keyStore.size() entry", + {"alias.", "{0}, "}, + {"Entry.type.type.", "Entry type: {0}"}, + {"Certificate.chain.length.", "Certificate chain length: "}, + {"Certificate.i.1.", "Certificate[{0,number,integer}]:"}, + {"Certificate.fingerprint.SHA1.", "Certificate fingerprint (SHA1): "}, + {"Entry.type.trustedCertEntry.", "Entry type: trustedCertEntry\n"}, + {"trustedCertEntry.", "trustedCertEntry,"}, + {"Keystore.type.", "Keystore type: "}, + {"Keystore.provider.", "Keystore provider: "}, + {"Your.keystore.contains.keyStore.size.entry", "Your keystore contains {0,number,integer} entry"}, - {"Your keystore contains keyStore.size() entries", + {"Your.keystore.contains.keyStore.size.entries", "Your keystore contains {0,number,integer} entries"}, - {"Failed to parse input", "Failed to parse input"}, - {"Empty input", "Empty input"}, - {"Not X.509 certificate", "Not X.509 certificate"}, - {"alias has no public key", "{0} has no public key"}, - {"alias has no X.509 certificate", "{0} has no X.509 certificate"}, - {"New certificate (self-signed):", "New certificate (self-signed):"}, - {"Reply has no certificates", "Reply has no certificates"}, - {"Certificate not imported, alias already exists", + {"Failed.to.parse.input", "Failed to parse input"}, + {"Empty.input", "Empty input"}, + {"Not.X.509.certificate", "Not X.509 certificate"}, + {"alias.has.no.public.key", "{0} has no public key"}, + {"alias.has.no.X.509.certificate", "{0} has no X.509 certificate"}, + {"New.certificate.self.signed.", "New certificate (self-signed):"}, + {"Reply.has.no.certificates", "Reply has no certificates"}, + {"Certificate.not.imported.alias.alias.already.exists", "Certificate not imported, alias <{0}> already exists"}, - {"Input not an X.509 certificate", "Input not an X.509 certificate"}, - {"Certificate already exists in keystore under alias ", + {"Input.not.an.X.509.certificate", "Input not an X.509 certificate"}, + {"Certificate.already.exists.in.keystore.under.alias.trustalias.", "Certificate already exists in keystore under alias <{0}>"}, - {"Do you still want to add it? [no]: ", + {"Do.you.still.want.to.add.it.no.", "Do you still want to add it? [no]: "}, - {"Certificate already exists in system-wide CA keystore under alias ", + {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.", "Certificate already exists in system-wide CA keystore under alias <{0}>"}, - {"Do you still want to add it to your own keystore? [no]: ", + {"Do.you.still.want.to.add.it.to.your.own.keystore.no.", "Do you still want to add it to your own keystore? [no]: "}, - {"Trust this certificate? [no]: ", "Trust this certificate? [no]: "}, + {"Trust.this.certificate.no.", "Trust this certificate? [no]: "}, {"YES", "YES"}, - {"New prompt: ", "New {0}: "}, - {"Passwords must differ", "Passwords must differ"}, - {"Re-enter new prompt: ", "Re-enter new {0}: "}, - {"Re-enter new password: ", "Re-enter new password: "}, - {"They don't match. Try again", "They don't match. Try again"}, - {"Enter prompt alias name: ", "Enter {0} alias name: "}, - {"Enter new alias name\t(RETURN to cancel import for this entry): ", + {"New.prompt.", "New {0}: "}, + {"Passwords.must.differ", "Passwords must differ"}, + {"Re.enter.new.prompt.", "Re-enter new {0}: "}, + {"Re.enter.new.password.", "Re-enter new password: "}, + {"They.don.t.match.Try.again", "They don't match. Try again"}, + {"Enter.prompt.alias.name.", "Enter {0} alias name: "}, + {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.", "Enter new alias name\t(RETURN to cancel import for this entry): "}, - {"Enter alias name: ", "Enter alias name: "}, - {"\t(RETURN if same as for )", + {"Enter.alias.name.", "Enter alias name: "}, + {".RETURN.if.same.as.for.otherAlias.", "\t(RETURN if same as for <{0}>)"}, - {"*PATTERN* printX509Cert", + {".PATTERN.printX509Cert", "Owner: {0}\nIssuer: {1}\nSerial number: {2}\nValid from: {3} until: {4}\nCertificate fingerprints:\n\t MD5: {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Signature algorithm name: {8}\n\t Version: {9}"}, - {"What is your first and last name?", + {"What.is.your.first.and.last.name.", "What is your first and last name?"}, - {"What is the name of your organizational unit?", + {"What.is.the.name.of.your.organizational.unit.", "What is the name of your organizational unit?"}, - {"What is the name of your organization?", + {"What.is.the.name.of.your.organization.", "What is the name of your organization?"}, - {"What is the name of your City or Locality?", + {"What.is.the.name.of.your.City.or.Locality.", "What is the name of your City or Locality?"}, - {"What is the name of your State or Province?", + {"What.is.the.name.of.your.State.or.Province.", "What is the name of your State or Province?"}, - {"What is the two-letter country code for this unit?", + {"What.is.the.two.letter.country.code.for.this.unit.", "What is the two-letter country code for this unit?"}, - {"Is correct?", "Is {0} correct?"}, + {"Is.name.correct.", "Is {0} correct?"}, {"no", "no"}, {"yes", "yes"}, {"y", "y"}, - {" [defaultValue]: ", " [{0}]: "}, - {"Alias has no key", + {".defaultValue.", " [{0}]: "}, + {"Alias.alias.has.no.key", "Alias <{0}> has no key"}, - {"Alias references an entry type that is not a private key entry. The -keyclone command only supports cloning of private key entries", + {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key", "Alias <{0}> references an entry type that is not a private key entry. The -keyclone command only supports cloning of private key entries"}, - {"***************** WARNING WARNING WARNING *****************", + {".WARNING.WARNING.WARNING.", "***************** WARNING WARNING WARNING *****************"}, - {"Signer #%d:", "Signer #%d:"}, - {"Timestamp:", "Timestamp:"}, - {"Signature:", "Signature:"}, - {"CRLs:", "CRLs:"}, - {"Certificate owner: ", "Certificate owner: "}, - {"Not a signed jar file", "Not a signed jar file"}, - {"No certificate from the SSL server", + {"Signer.d.", "Signer #%d:"}, + {"Timestamp.", "Timestamp:"}, + {"Signature.", "Signature:"}, + {"CRLs.", "CRLs:"}, + {"Certificate.owner.", "Certificate owner: "}, + {"Not.a.signed.jar.file", "Not a signed jar file"}, + {"No.certificate.from.the.SSL.server", "No certificate from the SSL server"}, // Translators of the following 5 pairs, ATTENTION: // the next 5 string pairs are meant to be combined into 2 paragraphs, // 1+3+4 and 2+3+5. make sure your translation also does. - {"* The integrity of the information stored in your keystore *", + {".The.integrity.of.the.information.stored.in.your.keystore.", "* The integrity of the information stored in your keystore *"}, - {"* The integrity of the information stored in the srckeystore*", + {".The.integrity.of.the.information.stored.in.the.srckeystore.", "* The integrity of the information stored in the srckeystore*"}, - {"* has NOT been verified! In order to verify its integrity, *", + {".has.NOT.been.verified.In.order.to.verify.its.integrity.", "* has NOT been verified! In order to verify its integrity, *"}, - {"* you must provide your keystore password. *", + {".you.must.provide.your.keystore.password.", "* you must provide your keystore password. *"}, - {"* you must provide the srckeystore password. *", + {".you.must.provide.the.srckeystore.password.", "* you must provide the srckeystore password. *"}, - {"Certificate reply does not contain public key for ", + {"Certificate.reply.does.not.contain.public.key.for.alias.", "Certificate reply does not contain public key for <{0}>"}, - {"Incomplete certificate chain in reply", + {"Incomplete.certificate.chain.in.reply", "Incomplete certificate chain in reply"}, - {"Certificate chain in reply does not verify: ", + {"Certificate.chain.in.reply.does.not.verify.", "Certificate chain in reply does not verify: "}, - {"Top-level certificate in reply:\n", + {"Top.level.certificate.in.reply.", "Top-level certificate in reply:\n"}, - {"... is not trusted. ", "... is not trusted. "}, - {"Install reply anyway? [no]: ", "Install reply anyway? [no]: "}, + {".is.not.trusted.", "... is not trusted. "}, + {"Install.reply.anyway.no.", "Install reply anyway? [no]: "}, {"NO", "NO"}, - {"Public keys in reply and keystore don't match", + {"Public.keys.in.reply.and.keystore.don.t.match", "Public keys in reply and keystore don't match"}, - {"Certificate reply and certificate in keystore are identical", + {"Certificate.reply.and.certificate.in.keystore.are.identical", "Certificate reply and certificate in keystore are identical"}, - {"Failed to establish chain from reply", + {"Failed.to.establish.chain.from.reply", "Failed to establish chain from reply"}, {"n", "n"}, - {"Wrong answer, try again", "Wrong answer, try again"}, - {"Secret key not generated, alias already exists", + {"Wrong.answer.try.again", "Wrong answer, try again"}, + {"Secret.key.not.generated.alias.alias.already.exists", "Secret Key not generated, alias <{0}> already exists"}, - {"Please provide -keysize for secret key generation", + {"Please.provide.keysize.for.secret.key.generation", "Please provide -keysize for secret key generation"}, - {"Extensions: ", "Extensions: "}, - {"(Empty value)", "(Empty value)"}, - {"Extension Request:", "Extension Request:"}, - {"PKCS #10 Certificate Request (Version 1.0)\n" + - "Subject: %s\nPublic Key: %s format %s key\n", + {"Extensions.", "Extensions: "}, + {".Empty.value.", "(Empty value)"}, + {"Extension.Request.", "Extension Request:"}, + {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.", "PKCS #10 Certificate Request (Version 1.0)\n" + "Subject: %s\nPublic Key: %s format %s key\n"}, - {"Unknown keyUsage type: ", "Unknown keyUsage type: "}, - {"Unknown extendedkeyUsage type: ", "Unknown extendedkeyUsage type: "}, - {"Unknown AccessDescription type: ", "Unknown AccessDescription type: "}, - {"Unrecognized GeneralName type: ", "Unrecognized GeneralName type: "}, - {"This extension cannot be marked as critical. ", + {"Unknown.keyUsage.type.", "Unknown keyUsage type: "}, + {"Unknown.extendedkeyUsage.type.", "Unknown extendedkeyUsage type: "}, + {"Unknown.AccessDescription.type.", "Unknown AccessDescription type: "}, + {"Unrecognized.GeneralName.type.", "Unrecognized GeneralName type: "}, + {"This.extension.cannot.be.marked.as.critical.", "This extension cannot be marked as critical. "}, - {"Odd number of hex digits found: ", "Odd number of hex digits found: "}, - {"Unknown extension type: ", "Unknown extension type: "}, - {"command {0} is ambiguous:", "command {0} is ambiguous:"}, + {"Odd.number.of.hex.digits.found.", "Odd number of hex digits found: "}, + {"Unknown.extension.type.", "Unknown extension type: "}, + {"command.{0}.is.ambiguous.", "command {0} is ambiguous:"}, // policytool - {"Warning: A public key for alias 'signers[i]' does not exist. Make sure a KeyStore is properly configured.", + {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.", "Warning: A public key for alias {0} does not exist. Make sure a KeyStore is properly configured."}, - {"Warning: Class not found: class", "Warning: Class not found: {0}"}, - {"Warning: Invalid argument(s) for constructor: arg", + {"Warning.Class.not.found.class", "Warning: Class not found: {0}"}, + {"Warning.Invalid.argument.s.for.constructor.arg", "Warning: Invalid argument(s) for constructor: {0}"}, - {"Illegal Principal Type: type", "Illegal Principal Type: {0}"}, - {"Illegal option: option", "Illegal option: {0}"}, - {"Usage: policytool [options]", "Usage: policytool [options]"}, - {" [-file ] policy file location", + {"Illegal.Principal.Type.type", "Illegal Principal Type: {0}"}, + {"Illegal.option.option", "Illegal option: {0}"}, + {"Usage.policytool.options.", "Usage: policytool [options]"}, + {".file.file.policy.file.location", " [-file ] policy file location"}, {"New", "New"}, {"Open", "Open"}, {"Save", "Save"}, - {"Save As", "Save As"}, - {"View Warning Log", "View Warning Log"}, + {"Save.As", "Save As"}, + {"View.Warning.Log", "View Warning Log"}, {"Exit", "Exit"}, - {"Add Policy Entry", "Add Policy Entry"}, - {"Edit Policy Entry", "Edit Policy Entry"}, - {"Remove Policy Entry", "Remove Policy Entry"}, + {"Add.Policy.Entry", "Add Policy Entry"}, + {"Edit.Policy.Entry", "Edit Policy Entry"}, + {"Remove.Policy.Entry", "Remove Policy Entry"}, {"Edit", "Edit"}, {"Retain", "Retain"}, - {"Warning: File name may include escaped backslash characters. " + - "It is not necessary to escape backslash characters " + - "(the tool escapes characters as necessary when writing " + - "the policy contents to the persistent store).\n\n" + - "Click on Retain to retain the entered name, or click on " + - "Edit to edit the name.", + {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes", "Warning: File name may include escaped backslash characters. " + "It is not necessary to escape backslash characters " + "(the tool escapes characters as necessary when writing " + @@ -470,203 +464,203 @@ public class Resources extends java.util.ListResourceBundle { "Click on Retain to retain the entered name, or click on " + "Edit to edit the name."}, - {"Add Public Key Alias", "Add Public Key Alias"}, - {"Remove Public Key Alias", "Remove Public Key Alias"}, + {"Add.Public.Key.Alias", "Add Public Key Alias"}, + {"Remove.Public.Key.Alias", "Remove Public Key Alias"}, {"File", "File"}, {"KeyStore", "KeyStore"}, - {"Policy File:", "Policy File:"}, - {"Could not open policy file: policyFile: e.toString()", + {"Policy.File.", "Policy File:"}, + {"Could.not.open.policy.file.policyFile.e.toString.", "Could not open policy file: {0}: {1}"}, - {"Policy Tool", "Policy Tool"}, - {"Errors have occurred while opening the policy configuration. View the Warning Log for more information.", + {"Policy.Tool", "Policy Tool"}, + {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.", "Errors have occurred while opening the policy configuration. View the Warning Log for more information."}, {"Error", "Error"}, {"OK", "OK"}, {"Status", "Status"}, {"Warning", "Warning"}, - {"Permission: ", + {"Permission.", "Permission: "}, - {"Principal Type:", "Principal Type:"}, - {"Principal Name:", "Principal Name:"}, - {"Target Name: ", + {"Principal.Type.", "Principal Type:"}, + {"Principal.Name.", "Principal Name:"}, + {"Target.Name.", "Target Name: "}, - {"Actions: ", + {"Actions.", "Actions: "}, - {"OK to overwrite existing file filename?", + {"OK.to.overwrite.existing.file.filename.", "OK to overwrite existing file {0}?"}, {"Cancel", "Cancel"}, - {"CodeBase:", "CodeBase:"}, - {"SignedBy:", "SignedBy:"}, - {"Add Principal", "Add Principal"}, - {"Edit Principal", "Edit Principal"}, - {"Remove Principal", "Remove Principal"}, - {"Principals:", "Principals:"}, - {" Add Permission", " Add Permission"}, - {" Edit Permission", " Edit Permission"}, - {"Remove Permission", "Remove Permission"}, + {"CodeBase.", "CodeBase:"}, + {"SignedBy.", "SignedBy:"}, + {"Add.Principal", "Add Principal"}, + {"Edit.Principal", "Edit Principal"}, + {"Remove.Principal", "Remove Principal"}, + {"Principals.", "Principals:"}, + {".Add.Permission", " Add Permission"}, + {".Edit.Permission", " Edit Permission"}, + {"Remove.Permission", "Remove Permission"}, {"Done", "Done"}, - {"KeyStore URL:", "KeyStore URL:"}, - {"KeyStore Type:", "KeyStore Type:"}, - {"KeyStore Provider:", "KeyStore Provider:"}, - {"KeyStore Password URL:", "KeyStore Password URL:"}, + {"KeyStore.URL.", "KeyStore URL:"}, + {"KeyStore.Type.", "KeyStore Type:"}, + {"KeyStore.Provider.", "KeyStore Provider:"}, + {"KeyStore.Password.URL.", "KeyStore Password URL:"}, {"Principals", "Principals"}, - {" Edit Principal:", " Edit Principal:"}, - {" Add New Principal:", " Add New Principal:"}, + {".Edit.Principal.", " Edit Principal:"}, + {".Add.New.Principal.", " Add New Principal:"}, {"Permissions", "Permissions"}, - {" Edit Permission:", " Edit Permission:"}, - {" Add New Permission:", " Add New Permission:"}, - {"Signed By:", "Signed By:"}, - {"Cannot Specify Principal with a Wildcard Class without a Wildcard Name", + {".Edit.Permission.", " Edit Permission:"}, + {".Add.New.Permission.", " Add New Permission:"}, + {"Signed.By.", "Signed By:"}, + {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name", "Cannot Specify Principal with a Wildcard Class without a Wildcard Name"}, - {"Cannot Specify Principal without a Name", + {"Cannot.Specify.Principal.without.a.Name", "Cannot Specify Principal without a Name"}, - {"Permission and Target Name must have a value", + {"Permission.and.Target.Name.must.have.a.value", "Permission and Target Name must have a value"}, - {"Remove this Policy Entry?", "Remove this Policy Entry?"}, - {"Overwrite File", "Overwrite File"}, - {"Policy successfully written to filename", + {"Remove.this.Policy.Entry.", "Remove this Policy Entry?"}, + {"Overwrite.File", "Overwrite File"}, + {"Policy.successfully.written.to.filename", "Policy successfully written to {0}"}, - {"null filename", "null filename"}, - {"Save changes?", "Save changes?"}, + {"null.filename", "null filename"}, + {"Save.changes.", "Save changes?"}, {"Yes", "Yes"}, {"No", "No"}, - {"Policy Entry", "Policy Entry"}, - {"Save Changes", "Save Changes"}, - {"No Policy Entry selected", "No Policy Entry selected"}, - {"Unable to open KeyStore: ex.toString()", + {"Policy.Entry", "Policy Entry"}, + {"Save.Changes", "Save Changes"}, + {"No.Policy.Entry.selected", "No Policy Entry selected"}, + {"Unable.to.open.KeyStore.ex.toString.", "Unable to open KeyStore: {0}"}, - {"No principal selected", "No principal selected"}, - {"No permission selected", "No permission selected"}, + {"No.principal.selected", "No principal selected"}, + {"No.permission.selected", "No permission selected"}, {"name", "name"}, - {"configuration type", "configuration type"}, - {"environment variable name", "environment variable name"}, - {"library name", "library name"}, - {"package name", "package name"}, - {"policy type", "policy type"}, - {"property name", "property name"}, - {"Principal List", "Principal List"}, - {"Permission List", "Permission List"}, - {"Code Base", "Code Base"}, - {"KeyStore U R L:", "KeyStore U R L:"}, - {"KeyStore Password U R L:", "KeyStore Password U R L:"}, + {"configuration.type", "configuration type"}, + {"environment.variable.name", "environment variable name"}, + {"library.name", "library name"}, + {"package.name", "package name"}, + {"policy.type", "policy type"}, + {"property.name", "property name"}, + {"Principal.List", "Principal List"}, + {"Permission.List", "Permission List"}, + {"Code.Base", "Code Base"}, + {"KeyStore.U.R.L.", "KeyStore U R L:"}, + {"KeyStore.Password.U.R.L.", "KeyStore Password U R L:"}, // javax.security.auth.PrivateCredentialPermission - {"invalid null input(s)", "invalid null input(s)"}, - {"actions can only be 'read'", "actions can only be 'read'"}, - {"permission name [name] syntax invalid: ", + {"invalid.null.input.s.", "invalid null input(s)"}, + {"actions.can.only.be.read.", "actions can only be 'read'"}, + {"permission.name.name.syntax.invalid.", "permission name [{0}] syntax invalid: "}, - {"Credential Class not followed by a Principal Class and Name", + {"Credential.Class.not.followed.by.a.Principal.Class.and.Name", "Credential Class not followed by a Principal Class and Name"}, - {"Principal Class not followed by a Principal Name", + {"Principal.Class.not.followed.by.a.Principal.Name", "Principal Class not followed by a Principal Name"}, - {"Principal Name must be surrounded by quotes", + {"Principal.Name.must.be.surrounded.by.quotes", "Principal Name must be surrounded by quotes"}, - {"Principal Name missing end quote", + {"Principal.Name.missing.end.quote", "Principal Name missing end quote"}, - {"PrivateCredentialPermission Principal Class can not be a wildcard (*) value if Principal Name is not a wildcard (*) value", + {"PrivateCredentialPermission.Principal.Class.can.not.be.a.wildcard.value.if.Principal.Name.is.not.a.wildcard.value", "PrivateCredentialPermission Principal Class can not be a wildcard (*) value if Principal Name is not a wildcard (*) value"}, - {"CredOwner:\n\tPrincipal Class = class\n\tPrincipal Name = name", + {"CredOwner.Principal.Class.class.Principal.Name.name", "CredOwner:\n\tPrincipal Class = {0}\n\tPrincipal Name = {1}"}, // javax.security.auth.x500 - {"provided null name", "provided null name"}, - {"provided null keyword map", "provided null keyword map"}, - {"provided null OID map", "provided null OID map"}, + {"provided.null.name", "provided null name"}, + {"provided.null.keyword.map", "provided null keyword map"}, + {"provided.null.OID.map", "provided null OID map"}, // javax.security.auth.Subject - {"invalid null AccessControlContext provided", + {"invalid.null.AccessControlContext.provided", "invalid null AccessControlContext provided"}, - {"invalid null action provided", "invalid null action provided"}, - {"invalid null Class provided", "invalid null Class provided"}, - {"Subject:\n", "Subject:\n"}, - {"\tPrincipal: ", "\tPrincipal: "}, - {"\tPublic Credential: ", "\tPublic Credential: "}, - {"\tPrivate Credentials inaccessible\n", + {"invalid.null.action.provided", "invalid null action provided"}, + {"invalid.null.Class.provided", "invalid null Class provided"}, + {"Subject.", "Subject:\n"}, + {".Principal.", "\tPrincipal: "}, + {".Public.Credential.", "\tPublic Credential: "}, + {".Private.Credentials.inaccessible.", "\tPrivate Credentials inaccessible\n"}, - {"\tPrivate Credential: ", "\tPrivate Credential: "}, - {"\tPrivate Credential inaccessible\n", + {".Private.Credential.", "\tPrivate Credential: "}, + {".Private.Credential.inaccessible.", "\tPrivate Credential inaccessible\n"}, - {"Subject is read-only", "Subject is read-only"}, - {"attempting to add an object which is not an instance of java.security.Principal to a Subject's Principal Set", + {"Subject.is.read.only", "Subject is read-only"}, + {"attempting.to.add.an.object.which.is.not.an.instance.of.java.security.Principal.to.a.Subject.s.Principal.Set", "attempting to add an object which is not an instance of java.security.Principal to a Subject's Principal Set"}, - {"attempting to add an object which is not an instance of class", + {"attempting.to.add.an.object.which.is.not.an.instance.of.class", "attempting to add an object which is not an instance of {0}"}, // javax.security.auth.login.AppConfigurationEntry - {"LoginModuleControlFlag: ", "LoginModuleControlFlag: "}, + {"LoginModuleControlFlag.", "LoginModuleControlFlag: "}, // javax.security.auth.login.LoginContext - {"Invalid null input: name", "Invalid null input: name"}, - {"No LoginModules configured for name", + {"Invalid.null.input.name", "Invalid null input: name"}, + {"No.LoginModules.configured.for.name", "No LoginModules configured for {0}"}, - {"invalid null Subject provided", "invalid null Subject provided"}, - {"invalid null CallbackHandler provided", + {"invalid.null.Subject.provided", "invalid null Subject provided"}, + {"invalid.null.CallbackHandler.provided", "invalid null CallbackHandler provided"}, - {"null subject - logout called before login", + {"null.subject.logout.called.before.login", "null subject - logout called before login"}, - {"unable to instantiate LoginModule, module, because it does not provide a no-argument constructor", + {"unable.to.instantiate.LoginModule.module.because.it.does.not.provide.a.no.argument.constructor", "unable to instantiate LoginModule, {0}, because it does not provide a no-argument constructor"}, - {"unable to instantiate LoginModule", + {"unable.to.instantiate.LoginModule", "unable to instantiate LoginModule"}, - {"unable to instantiate LoginModule: ", + {"unable.to.instantiate.LoginModule.", "unable to instantiate LoginModule: "}, - {"unable to find LoginModule class: ", + {"unable.to.find.LoginModule.class.", "unable to find LoginModule class: "}, - {"unable to access LoginModule: ", + {"unable.to.access.LoginModule.", "unable to access LoginModule: "}, - {"Login Failure: all modules ignored", + {"Login.Failure.all.modules.ignored", "Login Failure: all modules ignored"}, // sun.security.provider.PolicyFile - {"java.security.policy: error parsing policy:\n\tmessage", + {"java.security.policy.error.parsing.policy.message", "java.security.policy: error parsing {0}:\n\t{1}"}, - {"java.security.policy: error adding Permission, perm:\n\tmessage", + {"java.security.policy.error.adding.Permission.perm.message", "java.security.policy: error adding Permission, {0}:\n\t{1}"}, - {"java.security.policy: error adding Entry:\n\tmessage", + {"java.security.policy.error.adding.Entry.message", "java.security.policy: error adding Entry:\n\t{0}"}, - {"alias name not provided (pe.name)", "alias name not provided ({0})"}, - {"unable to perform substitution on alias, suffix", + {"alias.name.not.provided.pe.name.", "alias name not provided ({0})"}, + {"unable.to.perform.substitution.on.alias.suffix", "unable to perform substitution on alias, {0}"}, - {"substitution value, prefix, unsupported", + {"substitution.value.prefix.unsupported", "substitution value, {0}, unsupported"}, - {"(", "("}, - {")", ")"}, - {"type can't be null","type can't be null"}, + {"LPARAM", "("}, + {"RPARAM", ")"}, + {"type.can.t.be.null","type can't be null"}, // sun.security.provider.PolicyParser - {"keystorePasswordURL can not be specified without also specifying keystore", + {"keystorePasswordURL.can.not.be.specified.without.also.specifying.keystore", "keystorePasswordURL can not be specified without also specifying keystore"}, - {"expected keystore type", "expected keystore type"}, - {"expected keystore provider", "expected keystore provider"}, - {"multiple Codebase expressions", + {"expected.keystore.type", "expected keystore type"}, + {"expected.keystore.provider", "expected keystore provider"}, + {"multiple.Codebase.expressions", "multiple Codebase expressions"}, - {"multiple SignedBy expressions","multiple SignedBy expressions"}, - {"SignedBy has empty alias","SignedBy has empty alias"}, - {"can not specify Principal with a wildcard class without a wildcard name", + {"multiple.SignedBy.expressions","multiple SignedBy expressions"}, + {"SignedBy.has.empty.alias","SignedBy has empty alias"}, + {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name", "can not specify Principal with a wildcard class without a wildcard name"}, - {"expected codeBase or SignedBy or Principal", + {"expected.codeBase.or.SignedBy.or.Principal", "expected codeBase or SignedBy or Principal"}, - {"expected permission entry", "expected permission entry"}, - {"number ", "number "}, - {"expected [expect], read [end of file]", + {"expected.permission.entry", "expected permission entry"}, + {"number.", "number "}, + {"expected.expect.read.end.of.file.", "expected [{0}], read [end of file]"}, - {"expected [;], read [end of file]", + {"expected.read.end.of.file.", "expected [;], read [end of file]"}, - {"line number: msg", "line {0}: {1}"}, - {"line number: expected [expect], found [actual]", + {"line.number.msg", "line {0}: {1}"}, + {"line.number.expected.expect.found.actual.", "line {0}: expected [{1}], found [{2}]"}, - {"null principalClass or principalName", + {"null.principalClass.or.principalName", "null principalClass or principalName"}, // sun.security.pkcs11.SunPKCS11 - {"PKCS11 Token [providerName] Password: ", + {"PKCS11.Token.providerName.Password.", "PKCS11 Token [{0}] Password: "}, /* --- DEPRECATED --- */ // javax.security.auth.Policy - {"unable to instantiate Subject-based policy", + {"unable.to.instantiate.Subject.based.policy", "unable to instantiate Subject-based policy"} }; diff --git a/jdk/src/share/classes/sun/security/util/Resources_fr.java b/jdk/src/share/classes/sun/security/util/Resources_fr.java index c9000d33256..199642dfc46 100644 --- a/jdk/src/share/classes/sun/security/util/Resources_fr.java +++ b/jdk/src/share/classes/sun/security/util/Resources_fr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +50,9 @@ public class Resources_fr extends java.util.ListResourceBundle { {"keytool error: ", "erreur keytool : "}, {"Illegal option: ", "Option non valide : "}, {"Try keytool -help","Essayez keytool -help"}, - {"Command option needs an argument.", "L'option de commande {0} requiert un argument."}, + {"Command option needs an argument.", "L''option de commande {0} requiert un argument."}, {"Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified value.", - "Avertissement\u00a0: Les mots de passe store et key distincts ne sont pas pris en charge pour les keystores PKCS12. La valeur {0} sp\u00e9cifi\u00e9e par l'utilisateur est ignor\u00e9e."}, + "Avertissement\u00a0: Les mots de passe store et key distincts ne sont pas pris en charge pour les keystores PKCS12. La valeur {0} sp\u00e9cifi\u00e9e par l''utilisateur est ignor\u00e9e."}, {"-keystore must be NONE if -storetype is {0}", "-keystore doit \u00eatre d\u00e9fini sur NONE si -storetype est {0}"}, {"Too may retries, program terminated", @@ -75,7 +75,7 @@ public class Resources_fr extends java.util.ListResourceBundle { "La validit\u00e9 doit \u00eatre sup\u00e9rieure \u00e0 z\u00e9ro"}, {"provName not a provider", "{0} n''est pas un fournisseur"}, {"Usage error: no command provided", "Erreur d'utilisation\u00a0: aucune commande fournie"}, - {"Usage error, is not a legal command", "Erreur d'utilisation, {0} n'est pas une commande valide"}, + {"Usage error, is not a legal command", "Erreur d''utilisation, {0} n''est pas une commande valide"}, {"Source keystore file exists, but is empty: ", "Le fichier du keystore source existe, mais il est vide\u00a0: "}, {"Please specify -srckeystore", "veuillez sp\u00e9cifier -srckeystore"}, {"Must not specify both -v and -rfc with 'list' command", @@ -100,16 +100,16 @@ public class Resources_fr extends java.util.ListResourceBundle { {"Unknown Entry Type", "Type d'entr\u00e9e inconnu"}, {"Too many failures. Alias not changed", "Trop d'erreurs. Alias non modifi\u00e9"}, {"Entry for alias successfully imported.", - "L'entr\u00e9e de l'alias {0} a \u00e9t\u00e9 import\u00e9e."}, - {"Entry for alias not imported.", "L'entr\u00e9e de l'alias {0} n'a pas \u00e9t\u00e9 import\u00e9e."}, + "L''entr\u00e9e de l''alias {0} a \u00e9t\u00e9 import\u00e9e."}, + {"Entry for alias not imported.", "L''entr\u00e9e de l''alias {0} n''a pas \u00e9t\u00e9 import\u00e9e."}, {"Problem importing entry for alias : .\nEntry for alias not imported.", - "Probl\u00e8me lors de l'importation de l'entr\u00e9e de l'alias {0}\u00a0: {1}.\nL'entr\u00e9e de l'alias {0} n'a pas \u00e9t\u00e9 import\u00e9e."}, + "Probl\u00e8me lors de l''importation de l''entr\u00e9e de l''alias {0}\u00a0: {1}.\nL''entr\u00e9e de l''alias {0} n''a pas \u00e9t\u00e9 import\u00e9e."}, {"Import command completed: entries successfully imported, entries failed or cancelled", - "Commande d'importation ex\u00e9cut\u00e9e\u00a0: {0} entr\u00e9es import\u00e9es, \u00e9chec ou annulation de {1} entr\u00e9es"}, + "Commande d''importation ex\u00e9cut\u00e9e\u00a0: {0} entr\u00e9es import\u00e9es, \u00e9chec ou annulation de {1} entr\u00e9es"}, {"Warning: Overwriting existing alias in destination keystore", - "Avertissement\u00a0: L'alias existant {0} est \u00e9cras\u00e9 dans le keystore de destination"}, + "Avertissement\u00a0: L''alias existant {0} est \u00e9cras\u00e9 dans le keystore de destination"}, {"Existing entry alias exists, overwrite? [no]: ", - "L'alias d'entr\u00e9e {0} existe d\u00e9j\u00e0, voulez-vous l'\u00e9craser\u00a0? [non]\u00a0: "}, + "L''alias d''entr\u00e9e {0} existe d\u00e9j\u00e0, voulez-vous l''\u00e9craser\u00a0? [non]\u00a0: "}, {"Too many failures - try later", "Trop d'erreurs - r\u00e9essayez plus tard"}, {"Certification request stored in file ", "Demande de certification enregistr\u00e9e dans le fichier <{0}>"}, @@ -167,7 +167,7 @@ public class Resources_fr extends java.util.ListResourceBundle { {"alias, keyStore.getCreationDate(alias), ", "{0}, {1,date}, "}, {"alias, ", "{0}, "}, - {"Entry type: ", "Type d'entr\u00e9e\u00a0: {0}"}, + {"Entry type: ", "Type d''entr\u00e9e\u00a0: {0}"}, {"Certificate chain length: ", "Longueur de cha\u00eene du certificat : "}, {"Certificate[(i + 1)]:", "Certificat[{0,number,integer}]:"}, {"Certificate fingerprint (MD5): ", "Empreinte du certificat (MD5) : "}, @@ -213,7 +213,7 @@ public class Resources_fr extends java.util.ListResourceBundle { {"\t(RETURN if same as for )", "\t(appuyez sur Entr\u00e9e si le r\u00e9sultat est identique \u00e0 <{0}>)"}, {"*PATTERN* printX509Cert", - "Propri\u00e9taire\u00a0: {0}\n\u00c9metteur\u00a0: {1}\nNum\u00e9ro de s\u00e9rie\u00a0: {2}\nValide du\u00a0: {3} au\u00a0: {4}\nEmpreintes du certificat\u00a0:\n\t MD5\u00a0: {5}\n\t SHA1\u00a0: {6}\n\t Nom de l'algorithme de signature\u00a0: {7}\n\t Version\u00a0: {8}"}, + "Propri\u00e9taire\u00a0: {0}\n\u00c9metteur\u00a0: {1}\nNum\u00e9ro de s\u00e9rie\u00a0: {2}\nValide du\u00a0: {3} au\u00a0: {4}\nEmpreintes du certificat\u00a0:\n\t MD5\u00a0: {5}\n\t SHA1\u00a0: {6}\n\t Nom de l''algorithme de signature\u00a0: {7}\n\t Version\u00a0: {8}"}, {"What is your first and last name?", "Quels sont vos pr\u00e9nom et nom ?"}, {"What is the name of your organizational unit?", @@ -232,9 +232,9 @@ public class Resources_fr extends java.util.ListResourceBundle { {"y", "o"}, {" [defaultValue]: ", " [{0}] : "}, {"Alias has no key", - "L'alias <{0}> n'est associ\u00e9 \u00e0 aucune cl\u00e9"}, + "L''alias <{0}> n''est associ\u00e9 \u00e0 aucune cl\u00e9"}, {"Alias references an entry type that is not a private key entry. The -keyclone command only supports cloning of private key entries", - "L'entr\u00e9e \u00e0 laquelle l'alias <{0}> fait r\u00e9f\u00e9rence n'est pas une entr\u00e9e de type cl\u00e9 priv\u00e9e. La commande -keyclone prend uniquement en charge le clonage des cl\u00e9s priv\u00e9es"}, + "L''entr\u00e9e \u00e0 laquelle l''alias <{0}> fait r\u00e9f\u00e9rence n''est pas une entr\u00e9e de type cl\u00e9 priv\u00e9e. La commande -keyclone prend uniquement en charge le clonage des cl\u00e9s priv\u00e9es"}, {"***************** WARNING WARNING WARNING *****************", "***************** A V E R T I S S E M E N T *****************"}, @@ -441,7 +441,7 @@ public class Resources_fr extends java.util.ListResourceBundle { {"KeyStore", "KeyStore"}, {"Policy File:", "Fichier de r\u00e8gles :"}, {"Could not open policy file: policyFile: e.toString()", - "Impossible d'ouvrir le fichier de strat\u00e9gie\u00a0: {0}: {1}"}, + "Impossible d''ouvrir le fichier de strat\u00e9gie\u00a0: {0}: {1}"}, {"Policy Tool", "Policy Tool"}, {"Errors have occurred while opening the policy configuration. View the Warning Log for more information.", "Des erreurs se sont produites \u00e0 l'ouverture de la configuration de r\u00e8gles. Consultez le journal des avertissements pour obtenir des informations."}, @@ -499,7 +499,7 @@ public class Resources_fr extends java.util.ListResourceBundle { {"Save Changes", "Enregistrer les changements"}, {"No Policy Entry selected", "Aucune r\u00e8gle s\u00e9lectionn\u00e9e"}, {"Unable to open KeyStore: ex.toString()", - "Impossible d'ouvrir le keystore\u00a0: {0}"}, + "Impossible d''ouvrir le keystore\u00a0: {0}"}, {"No principal selected", "Aucun principal s\u00e9lectionn\u00e9"}, {"No permission selected", "Aucune permission s\u00e9lectionn\u00e9e"}, {"name", "nom"}, diff --git a/jdk/src/share/classes/sun/security/util/Resources_it.java b/jdk/src/share/classes/sun/security/util/Resources_it.java index 4d296010e21..3beec0ddf9b 100644 --- a/jdk/src/share/classes/sun/security/util/Resources_it.java +++ b/jdk/src/share/classes/sun/security/util/Resources_it.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +50,9 @@ public class Resources_it extends java.util.ListResourceBundle { {"keytool error: ", "Errore keytool: "}, {"Illegal option: ", "Opzione non valida: "}, {"Try keytool -help","Provare keytool -help"}, - {"Command option needs an argument.", "\u00c8 necessario specificare un argomento per l'opzione di comando {0}."}, + {"Command option needs an argument.", "\u00c8 necessario specificare un argomento per l''opzione di comando {0}."}, {"Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified value.", - "Avviso: non sono supportate password diverse di chiave e di archivio per i KeyStore PKCS12. Il valore {0} specificato dall'utente verr\u00e0 ignorato."}, + "Avviso: non sono supportate password diverse di chiave e di archivio per i KeyStore PKCS12. Il valore {0} specificato dall''utente verr\u00e0 ignorato."}, {"-keystore must be NONE if -storetype is {0}", "Se -storetype \u00e8 impostato su {0}, -keystore deve essere impostato su NONE"}, {"Too may retries, program terminated", @@ -100,16 +100,16 @@ public class Resources_it extends java.util.ListResourceBundle { {"Unknown Entry Type", "Tipo di voce sconosciuto"}, {"Too many failures. Alias not changed", "Si sono verificati troppi errori. L'alias non \u00e8 stato modificato."}, {"Entry for alias successfully imported.", - "La voce dell'alias {0} \u00e8 stata importata."}, - {"Entry for alias not imported.", "La voce dell'alias {0} non \u00e8 stata importata."}, + "La voce dell''alias {0} \u00e8 stata importata."}, + {"Entry for alias not imported.", "La voce dell''alias {0} non \u00e8 stata importata."}, {"Problem importing entry for alias : .\nEntry for alias not imported.", - "Si \u00e8 verificato un problema durante l'importazione della voce dell'alias {0}: {1}.\nLa voce dell'alias {0} non \u00e8 stata importata."}, + "Si \u00e8 verificato un problema durante l''importazione della voce dell''alias {0}: {1}.\nLa voce dell''alias {0} non \u00e8 stata importata."}, {"Import command completed: entries successfully imported, entries failed or cancelled", "Importazione completata: {0} voci importate, {1} voci non importate o annullate"}, {"Warning: Overwriting existing alias in destination keystore", - "Avviso: sovrascrittura in corso dell'alias {0} nel file keystore di destinazione"}, + "Avviso: sovrascrittura in corso dell''alias {0} nel file keystore di destinazione"}, {"Existing entry alias exists, overwrite? [no]: ", - "La voce dell'alias {0} esiste gi\u00e0. Sovrascrivere? [no]: "}, + "La voce dell''alias {0} esiste gi\u00e0. Sovrascrivere? [no]: "}, {"Too many failures - try later", "Troppi errori - riprovare"}, {"Certification request stored in file ", "La richiesta di certificazione \u00e8 memorizzata nel file <{0}>"}, @@ -232,9 +232,9 @@ public class Resources_it extends java.util.ListResourceBundle { {"y", "s"}, {" [defaultValue]: ", " [{0}]: "}, {"Alias has no key", - "All'alias <{0}> non \u00e8 associata alcuna chiave"}, + "All''alias <{0}> non \u00e8 associata alcuna chiave"}, {"Alias references an entry type that is not a private key entry. The -keyclone command only supports cloning of private key entries", - "L'alias <{0}> fa riferimento a un tipo di voce che non \u00e8 una voce di chiave privata. Il comando -keyclone supporta solo la duplicazione delle voci di chiave private."}, + "L''alias <{0}> fa riferimento a un tipo di voce che non \u00e8 una voce di chiave privata. Il comando -keyclone supporta solo la duplicazione delle voci di chiave private."}, {"***************** WARNING WARNING WARNING *****************", "***************** AVVISO AVVISO AVVISO *****************"}, @@ -274,7 +274,7 @@ public class Resources_it extends java.util.ListResourceBundle { {"n", "n"}, {"Wrong answer, try again", "Risposta errata, riprovare"}, {"Secret key not generated, alias already exists", - "La chiave segreta non \u00e8 stata generata; l'alias <{0}> esiste gi\u00e0"}, + "La chiave segreta non \u00e8 stata generata; l''alias <{0}> esiste gi\u00e0"}, {"Please provide -keysize for secret key generation", "Specificare il valore -keysize per la generazione della chiave segreta"}, {"keytool usage:\n", "utilizzo keytool:\n"}, @@ -401,7 +401,7 @@ public class Resources_it extends java.util.ListResourceBundle { // policytool {"Warning: A public key for alias 'signers[i]' does not exist. Make sure a KeyStore is properly configured.", - "Avviso: non esiste una chiave pubblica per l'alias {0}. Verificare che il KeyStore sia configurato correttamente."}, + "Avviso: non esiste una chiave pubblica per l''alias {0}. Verificare che il KeyStore sia configurato correttamente."}, {"Warning: Class not found: class", "Avviso: Classe non trovata: {0}"}, {"Warning: Invalid argument(s) for constructor: arg", "Avviso: argomento o argomenti non validi per il costruttore {0}"}, diff --git a/jdk/src/share/classes/sun/security/util/Resources_pt_BR.java b/jdk/src/share/classes/sun/security/util/Resources_pt_BR.java new file mode 100644 index 00000000000..4eaf5295f35 --- /dev/null +++ b/jdk/src/share/classes/sun/security/util/Resources_pt_BR.java @@ -0,0 +1,646 @@ +/* + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.util; + +/** + *

      This class represents the ResourceBundle + * for javax.security.auth and sun.security. + * + * @version 1.33, 12/06/05 + */ +public class Resources_pt_BR extends java.util.ListResourceBundle { + + private static final Object[][] contents = { + + // shared (from jarsigner) + {" ", " "}, + {" ", " "}, + {" ", " "}, + {", ", ", "}, + // shared (from keytool) + {"\n", "\n"}, + {"*******************************************", + "*******************************************"}, + {"*******************************************\n\n", + "*******************************************\n\n"}, + + // keytool + {"keytool error: ", "erro de keytool: "}, + {"Illegal option: ", "Op\u00e7\u00e3o ilegal: "}, + {"Try keytool -help","Tentar keytool -help"}, + {"Command option needs an argument.", "A op\u00e7\u00e3o de comando {0} precisa de um argumento."}, + {"Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified value.", + "Aviso: senhas de chave e de armazenamento diferentes n\u00e3o suportadas para KeyStores PKCS12. Ignorando valor {0} especificado pelo usu\u00e1rio."}, + {"-keystore must be NONE if -storetype is {0}", + "-keystore deve ser NONE se -storetype for {0}"}, + {"Too may retries, program terminated", + "N\u00famero de tentativas excedido, programa finalizado"}, + {"-storepasswd and -keypasswd commands not supported if -storetype is {0}", + "comandos -storepasswd e -keypasswd n\u00e3o suportados se -storetype for {0}"}, + {"-keypasswd commands not supported if -storetype is PKCS12", + "comandos -keypasswd n\u00e3o suportados se -storetype for PKCS12"}, + {"-keypass and -new can not be specified if -storetype is {0}", + "-keypass e -new n\u00e3o podem ser especificados se -storetype for {0}"}, + {"if -protected is specified, then -storepass, -keypass, and -new must not be specified", + "se -protected estiver especificado, ent\u00e3o -storepass, -keypass e -new n\u00e3o devem ser especificados"}, + {"if -srcprotected is specified, then -srcstorepass and -srckeypass must not be specified", + "se -srcprotected estiver especificado, ent\u00e3o -srcstorepass e -srckeypass n\u00e3o devem ser especificados"}, + {"if keystore is not password protected, then -storepass, -keypass, and -new must not be specified", + "se o armazenamento de chaves n\u00e3o estiver protegido por senha, ent\u00e3o -storepass, -keypass e -new n\u00e3o devem ser especificados"}, + {"if source keystore is not password protected, then -srcstorepass and -srckeypass must not be specified", + "se o armazenamento de chaves de origem n\u00e3o estiver protegido por senha, ent\u00e3o -srcstorepass e -srckeypass n\u00e3o devem ser especificados"}, + {"Validity must be greater than zero", + "A validade deve ser maior do que zero"}, + {"provName not a provider", "{0} n\u00e3o \u00e9 um fornecedor"}, + {"Usage error: no command provided", "Erro de uso: nenhum comando fornecido"}, + {"Usage error, is not a legal command", "Erro de uso, {0} n\u00e3o \u00e9 um comando legal"}, + {"Source keystore file exists, but is empty: ", "O arquivo de armazenamento de chaves de origem existe, mas est\u00e1 vazio: "}, + {"Please specify -srckeystore", "Especifique -srckeystore"}, + {"Must not specify both -v and -rfc with 'list' command", + "N\u00e3o devem ser especificados -v e -rfc com o comando 'list'"}, + {"Key password must be at least 6 characters", + "A senha da chave deve ter como m\u00ednimo 6 caracteres"}, + {"New password must be at least 6 characters", + "A nova senha deve ter como m\u00ednimo 6 caracteres"}, + {"Keystore file exists, but is empty: ", + "O arquivo de armazenamento de chaves existe, mas est\u00e1 vazio: "}, + {"Keystore file does not exist: ", + "O arquivo de armazenamento de chaves n\u00e3o existe. "}, + {"Must specify destination alias", "Deve ser especificado um alias de destino"}, + {"Must specify alias", "Deve ser especificado um alias"}, + {"Keystore password must be at least 6 characters", + "A senha do armazenamento de chaves deve ter como m\u00ednimo 6 caracteres"}, + {"Enter keystore password: ", "Insira a senha do armazenamento de chaves: "}, + {"Enter source keystore password: ", "Insira a senha do armazenamento de chaves de origem: "}, + {"Enter destination keystore password: ", "Insira a senha do armazenamento de chaves de destino: "}, + {"Keystore password is too short - must be at least 6 characters", + "A senha do armazenamento de chaves \u00e9 muito curta - deve ter como m\u00ednimo 6 caracteres"}, + {"Unknown Entry Type", "Tipo de entrada desconhecido"}, + {"Too many failures. Alias not changed", "Excesso de falhas. Alias n\u00e3o alterado"}, + {"Entry for alias successfully imported.", + "Entrada do alias {0} importada com \u00eaxito."}, + {"Entry for alias not imported.", "Entrada do alias {0} n\u00e3o importada."}, + {"Problem importing entry for alias : .\nEntry for alias not imported.", + "Problema ao importar a entrada do {0}: {1}.\nEntrada do alias {0} n\u00e3o importada."}, + {"Import command completed: entries successfully imported, entries failed or cancelled", + "Comando de importa\u00e7\u00e3o conclu\u00eddo: {0} entradas importadas com \u00eaxito, {1} entradas falhas ou canceladas"}, + {"Warning: Overwriting existing alias in destination keystore", + "Aviso: substitui\u00e7\u00e3o de alias {0} existente no armazenamento de chaves de destino"}, + {"Existing entry alias exists, overwrite? [no]: ", + "Entrada j\u00e1 existente no alias {0}, substituir? [n\u00e3o]: "}, + {"Too many failures - try later", "Excesso de falhas - tentar mais tarde"}, + {"Certification request stored in file ", + "Solicita\u00e7\u00e3o de certificado armazenada no arquivo <{0}>"}, + {"Submit this to your CA", "Enviar \u00e0 CA"}, + {"if alias not specified, destalias, srckeypass, and destkeypass must not be specified", + "se o alias n\u00e3o estiver especificado, destalias, srckeypass e destkeypass n\u00e3o devem ser especificados"}, + {"Certificate stored in file ", + "Certificado armazenado no arquivo <{0}>"}, + {"Certificate reply was installed in keystore", + "Resposta do certificado foi instalada no armazenamento de chaves"}, + {"Certificate reply was not installed in keystore", + "Resposta do certificado n\u00e3o foi instalada no armazenamento de chaves"}, + {"Certificate was added to keystore", + "O certificado foi adicionado ao armazenamento de chaves"}, + {"Certificate was not added to keystore", + "O certificado n\u00e3o foi adicionado ao armazenamento de chaves"}, + {"[Storing ksfname]", "[Armazenando {0}]"}, + {"alias has no public key (certificate)", + "{0} n\u00e3o possui chave p\u00fablica (certificado)"}, + {"Cannot derive signature algorithm", + "N\u00e3o \u00e9 poss\u00edvel obter algoritmo de assinatura"}, + {"Alias does not exist", + "O alias <{0}> n\u00e3o existe"}, + {"Alias has no certificate", + "O alias <{0}> n\u00e3o possui certificado"}, + {"Key pair not generated, alias already exists", + "Par de chaves n\u00e3o gerado, o alias <{0}> j\u00e1 existe"}, + {"Cannot derive signature algorithm", + "N\u00e3o \u00e9 poss\u00edvel obter algoritmo de assinatura"}, + {"Generating keysize bit keyAlgName key pair and self-signed certificate (sigAlgName) with a validity of validality days\n\tfor: x500Name", + "Gerando o par de chaves {1} de {0} bit e o certificado autoassinado ({2}) com uma validade de {3} dias\n\tpara: {4}"}, + {"Enter key password for ", "Inserir a senha da chave de <{0}>"}, + {"\t(RETURN if same as keystore password): ", + "\t(RETURN se for igual \u00e0 senha do armazenamento de chaves): "}, + {"Key password is too short - must be at least 6 characters", + "A senha da chave \u00e9 muito curta - deve ter como m\u00ednimo 6 caracteres"}, + {"Too many failures - key not added to keystore", + "Excesso de falhas - chave n\u00e3o adicionada ao armazenamento de chaves"}, + {"Destination alias already exists", + "O alias de destino <{0}> j\u00e1 existe"}, + {"Password is too short - must be at least 6 characters", + "A senha \u00e9 muito curta - deve ter como m\u00ednimo 6 caracteres"}, + {"Too many failures. Key entry not cloned", + "Excesso de falhas. Entrada da chave n\u00e3o clonada"}, + {"key password for ", "senha da chave de <{0}>"}, + {"Keystore entry for already exists", + "A entrada do armazenamento de chaves de <{0}> j\u00e1 existe"}, + {"Creating keystore entry for ...", + "Criando entrada do armazenamento de chaves para <{0}> ..."}, + {"No entries from identity database added", + "Nenhuma entrada adicionada do banco de dados de identidades"}, + {"Alias name: alias", "Nome do alias: {0}"}, + {"Creation date: keyStore.getCreationDate(alias)", + "Data de cria\u00e7\u00e3o: {0,data}"}, + {"alias, keyStore.getCreationDate(alias), ", + "{0}, {1,data}, "}, + {"alias, ", "{0}, "}, + {"Entry type: ", "Tipo de entrada: {0}"}, + {"Certificate chain length: ", "Comprimento da cadeia de certificados: "}, + {"Certificate[(i + 1)]:", "Certificado[{0,n\u00famero,inteiro}]:"}, + {"Certificate fingerprint (MD5): ", "Fingerprint (MD5) do certificado: "}, + {"Entry type: trustedCertEntry\n", "Tipo de entrada: trustedCertEntry\n"}, + {"trustedCertEntry,", "trustedCertEntry,"}, + {"Keystore type: ", "Tipo de armazenamento de chaves: "}, + {"Keystore provider: ", "Fornecedor de armazenamento de chaves: "}, + {"Your keystore contains keyStore.size() entry", + "Seu armazenamento de chaves cont\u00e9m {0,n\u00famero,inteiro} entrada"}, + {"Your keystore contains keyStore.size() entries", + "Seu armazenamento de chaves cont\u00e9m {0,n\u00famero,inteiro} entradas"}, + {"Failed to parse input", "Falha ao analisar a entrada"}, + {"Empty input", "Entrada vazia"}, + {"Not X.509 certificate", "N\u00e3o \u00e9 um certificado X.509"}, + {"Cannot derive signature algorithm", + "N\u00e3o \u00e9 poss\u00edvel obter algoritmo de assinatura"}, + {"alias has no public key", "{0} n\u00e3o possui chave p\u00fablica"}, + {"alias has no X.509 certificate", "{0} n\u00e3o possui certificado X.509"}, + {"New certificate (self-signed):", "Novo certificado (autoassinado):"}, + {"Reply has no certificates", "A resposta n\u00e3o possui certificado"}, + {"Certificate not imported, alias already exists", + "Certificado n\u00e3o importado, o alias <{0}> j\u00e1 existe"}, + {"Input not an X.509 certificate", "A entrada n\u00e3o \u00e9 um certificado X.509"}, + {"Certificate already exists in keystore under alias ", + "O certificado j\u00e1 existe no armazenamento de chaves no alias <{0}>"}, + {"Do you still want to add it? [no]: ", + "Ainda deseja adicion\u00e1-lo? [n\u00e3o]: "}, + {"Certificate already exists in system-wide CA keystore under alias ", + "O certificado j\u00e1 existe no armazenamento de chaves de CA em todo o sistema no alias <{0}>"}, + {"Do you still want to add it to your own keystore? [no]: ", + "Ainda deseja adicion\u00e1-lo ao seu pr\u00f3prio armazenamento de chaves? [n\u00e3o]: "}, + {"Trust this certificate? [no]: ", "Confiar neste certificado? [n\u00e3o]: "}, + {"YES", "SIM"}, + {"New prompt: ", "Nova {0}: "}, + {"Passwords must differ", "As senhas devem ser diferentes"}, + {"Re-enter new prompt: ", "Insira novamente a nova {0}: "}, + {"Re-enter new password: ", "Insira novamente a nova senha: "}, + {"They don't match. Try again", "Elas n\u00e3o correspondem. Tente novamente"}, + {"Enter prompt alias name: ", "Insira o nome do alias {0}: "}, + {"Enter new alias name\t(RETURN to cancel import for this entry): ", + "Insira o novo nome do alias\t(RETURN para cancelar a importa\u00e7\u00e3o desta entrada): "}, + {"Enter alias name: ", "Insira o nome do alias: "}, + {"\t(RETURN if same as for )", + "\t(RETURN se for igual ao de <{0}>)"}, + {"*PATTERN* printX509Cert", + "Propriet\u00e1rio: {0}\nEmissor: {1}\nN\u00famero de s\u00e9rie: {2}\nV\u00e1lido de: {3} a: {4}\nFingerprints do certificado:\n\t MD5: {5}\n\t SHA1: {6}\n\t Nome do algoritmo de assinatura: {7}\n\t Vers\u00e3o: {8}"}, + {"What is your first and last name?", + "Qual \u00e9 o seu nome e o seu sobrenome?"}, + {"What is the name of your organizational unit?", + "Qual \u00e9 o nome da sua unidade organizacional?"}, + {"What is the name of your organization?", + "Qual \u00e9 o nome da sua empresa?"}, + {"What is the name of your City or Locality?", + "Qual \u00e9 o nome da sua cidade ou localidade?"}, + {"What is the name of your State or Province?", + "Qual \u00e9 o nome do seu estado ou munic\u00edpio?"}, + {"What is the two-letter country code for this unit?", + "Quais s\u00e3o as duas letras do c\u00f3digo do pa\u00eds desta unidade?"}, + {"Is correct?", "{0} \u00e9 correto?"}, + {"no", "n\u00e3o"}, + {"yes", "sim"}, + {"y", "s"}, + {" [defaultValue]: ", " [{0}]: "}, + {"Alias has no key", + "O alias <{0}> n\u00e3o possui chave"}, + {"Alias references an entry type that is not a private key entry. The -keyclone command only supports cloning of private key entries", + "O alias <{0}> faz refer\u00eancia a um tipo de entrada que n\u00e3o \u00e9 uma entrada de chave privada. O comando -keyclone oferece suporte somente \u00e0 clonagem de entradas de chave privada"}, + + {"***************** WARNING WARNING WARNING *****************", + "***************** AVISO AVISO AVISO *****************"}, + + // Translators of the following 5 pairs, ATTENTION: + // the next 5 string pairs are meant to be combined into 2 paragraphs, + // 1+3+4 and 2+3+5. make sure your translation also does. + {"* The integrity of the information stored in your keystore *", + "* A integridade das informa\u00e7\u00f5es armazenadas no seu armazenamento de chaves *"}, + {"* The integrity of the information stored in the srckeystore*", + "* A integridade das informa\u00e7\u00f5es armazenadas no srckeystore*"}, + {"* has NOT been verified! In order to verify its integrity, *", + "* N\u00c3O foi verificada! Para verificar a integridade destas informa\u00e7\u00f5es, *"}, + {"* you must provide your keystore password. *", + "* voc\u00ea deve fornecer a senha do seu armazenamento de chaves. *"}, + {"* you must provide the srckeystore password. *", + "* voc\u00ea deve fornecer a senha do srckeystore. *"}, + + + {"Certificate reply does not contain public key for ", + "A resposta do certificado n\u00e3o cont\u00e9m a chave p\u00fablica de <{0}>"}, + {"Incomplete certificate chain in reply", + "Cadeia de certificados incompleta na resposta"}, + {"Certificate chain in reply does not verify: ", + "A cadeia de certificados da resposta n\u00e3o verifica: "}, + {"Top-level certificate in reply:\n", + "Certificado de n\u00edvel superior na resposta:\n"}, + {"... is not trusted. ", "... n\u00e3o \u00e9 confi\u00e1vel. "}, + {"Install reply anyway? [no]: ", "Instalar resposta assim mesmo? [n\u00e3o]: "}, + {"NO", "N\u00c3O"}, + {"Public keys in reply and keystore don't match", + "As chaves p\u00fablicas da resposta e do armazenamento de chaves n\u00e3o correspondem"}, + {"Certificate reply and certificate in keystore are identical", + "O certificado da resposta e o certificado do armazenamento de chaves s\u00e3o id\u00eanticos"}, + {"Failed to establish chain from reply", + "Falha ao estabelecer a cadeia a partir da resposta"}, + {"n", "n"}, + {"Wrong answer, try again", "Resposta errada, tente novamente"}, + {"Secret key not generated, alias already exists", + "Chave secreta n\u00e3o gerada, o alias <{0}> j\u00e1 existe"}, + {"Please provide -keysize for secret key generation", + "Forne\u00e7a o -keysize para a gera\u00e7\u00e3o da chave secreta"}, + {"keytool usage:\n", "uso de keytool:\n"}, + + {"Extensions: ", "Extens\u00f5es: "}, + + {"-certreq [-v] [-protected]", + "-certreq [-v] [-protected]"}, + {"\t [-alias ] [-sigalg ]", + "\t [-alias ] [-sigalg ]"}, + {"\t [-file ] [-keypass ]", + "\t [-file ] [-keypass ]"}, + {"\t [-keystore ] [-storepass ]", + "\t [-keystore ] [-storepass ]"}, + {"\t [-storetype ] [-providername ]", + "\t [-storetype ] [-providername ]"}, + {"\t [-providerclass [-providerarg ]] ...", + "\t [-providerclass [-providerarg ]] ..."}, + {"\t [-providerpath ]", + "\t [-providerpath ]"}, + {"-delete [-v] [-protected] -alias ", + "-delete [-v] [-protected] -alias "}, + /** rest is same as -certreq starting from -keystore **/ + + //{"-export [-v] [-rfc] [-protected]", + // "-export [-v] [-rfc] [-protected]"}, + {"-exportcert [-v] [-rfc] [-protected]", + "-exportcert [-v] [-rfc] [-protected]"}, + {"\t [-alias ] [-file ]", + "\t [-alias ] [-file ]"}, + /** rest is same as -certreq starting from -keystore **/ + + //{"-genkey [-v] [-protected]", + // "-genkey [-v] [-protected]"}, + {"-genkeypair [-v] [-protected]", + "-genkeypair [-v] [-protected]"}, + {"\t [-alias ]", "\t [-alias ]"}, + {"\t [-keyalg ] [-keysize ]", + "\t [-keyalg ] [-keysize ]"}, + {"\t [-sigalg ] [-dname ]", + "\t [-sigalg ] [-dname ]"}, + {"\t [-validity ] [-keypass ]", + "\t [-validity ] [-keypass ]"}, + /** rest is same as -certreq starting from -keystore **/ + + {"-genseckey [-v] [-protected]", + "-genseckey [-v] [-protected]"}, + /** rest is same as -certreq starting from -keystore **/ + + {"-help", "-help"}, + //{"-identitydb [-v] [-protected]", + // "-identitydb [-v] [-protected]"}, + //{"\t [-file ]", "\t [-file ]"}, + /** rest is same as -certreq starting from -keystore **/ + + //{"-import [-v] [-noprompt] [-trustcacerts] [-protected]", + // "-import [-v] [-noprompt] [-trustcacerts] [-protected]"}, + {"-importcert [-v] [-noprompt] [-trustcacerts] [-protected]", + "-importcert [-v] [-noprompt] [-trustcacerts] [-protected]"}, + {"\t [-alias ]", "\t [-alias ]"}, + {"\t [-alias ] [-keypass ]", + "\t [-alias ] [-keypass ]"}, + {"\t [-file ] [-keypass ]", + "\t [-file ] [-keypass ]"}, + /** rest is same as -certreq starting from -keystore **/ + + {"-importkeystore [-v] ", + "-importkeystore [-v] "}, + {"\t [-srckeystore ] [-destkeystore ]", + "\t [-srckeystore ] [-destkeystore ]"}, + {"\t [-srcstoretype ] [-deststoretype ]", + "\t [-srcstoretype ] [-deststoretype ]"}, + {"\t [-srcprotected] [-destprotected]", + "\t [-srcprotected] [-destprotected]"}, + {"\t [-srcstorepass ] [-deststorepass ]", + "\t [-srcstorepass ] [-deststorepass ]"}, + {"\t [-srcprovidername ]\n\t [-destprovidername ]", // line too long, split to 2 + "\t [-srcprovidername ]\n\t [-destprovidername ]"}, + {"\t [-srcalias [-destalias ]", + "\t [-srcalias [-destalias ]"}, + {"\t [-srckeypass ] [-destkeypass ]]", + "\t [-srckeypass ] [-destkeypass ]]"}, + {"\t [-noprompt]", "\t [-noprompt]"}, + /** rest is same as -certreq starting from -keystore **/ + + {"-changealias [-v] [-protected] -alias -destalias ", + "-changealias [-v] [-protected] -alias -destalias "}, + {"\t [-keypass ]", "\t [-keypass ]"}, + + //{"-keyclone [-v] [-protected]", + // "-keyclone [-v] [-protected]"}, + //{"\t [-alias ] -dest ", + // "\t [-alias ] -dest "}, + //{"\t [-keypass ] [-new ]", + // "\t [-keypass ] [-new ]"}, + /** rest is same as -certreq starting from -keystore **/ + + {"-keypasswd [-v] [-alias ]", + "-keypasswd [-v] [-alias ]"}, + {"\t [-keypass ] [-new ]", + "\t [-keypass ] [-new ]"}, + /** rest is same as -certreq starting from -keystore **/ + + {"-list [-v | -rfc] [-protected]", + "-list [-v | -rfc] [-protected]"}, + {"\t [-alias ]", "\t [-alias ]"}, + /** rest is same as -certreq starting from -keystore **/ + + {"-printcert [-v] [-file ]", + "-printcert [-v] [-file ]"}, + + //{"-selfcert [-v] [-protected]", + // "-selfcert [-v] [-protected]"}, + {"\t [-alias ]", "\t [-alias ]"}, + //{"\t [-dname ] [-validity ]", + // "\t [-dname ] [-validity ]"}, + //{"\t [-keypass ] [-sigalg ]", + // "\t [-keypass ] [-sigalg ]"}, + /** rest is same as -certreq starting from -keystore **/ + + {"-storepasswd [-v] [-new ]", + "-storepasswd [-v] [-new ]"}, + /** rest is same as -certreq starting from -keystore **/ + + // policytool + {"Warning: A public key for alias 'signers[i]' does not exist. Make sure a KeyStore is properly configured.", + "Aviso: n\u00e3o existe uma chave p\u00fablica para o alias {0}. Certifique-se de que um KeyStore esteja configurado adequadamente."}, + {"Warning: Class not found: class", "Aviso: classe n\u00e3o encontrada: {0}"}, + {"Warning: Invalid argument(s) for constructor: arg", + "Aviso: argumento(s) inv\u00e1lido(s) para o construtor: {0}"}, + {"Illegal Principal Type: type", "Tipo principal ilegal: {0}"}, + {"Illegal option: option", "Op\u00e7\u00e3o ilegal: {0}"}, + {"Usage: policytool [options]", "Uso: policytool [op\u00e7\u00f5es]"}, + {" [-file ] policy file location", + " [-file ] local do arquivo de pol\u00edtica"}, + {"New", "Novo"}, + {"Open", "Abrir"}, + {"Save", "Salvar"}, + {"Save As", "Salvar como"}, + {"View Warning Log", "Visualizar registro de avisos"}, + {"Exit", "Sair"}, + {"Add Policy Entry", "Adicionar entrada de pol\u00edtica"}, + {"Edit Policy Entry", "Editar entrada de pol\u00edtica"}, + {"Remove Policy Entry", "Remover entrada de pol\u00edtica"}, + {"Edit", "Editar"}, + {"Retain", "Conservar"}, + + {"Warning: File name may include escaped backslash characters. " + + "It is not necessary to escape backslash characters " + + "(the tool escapes characters as necessary when writing " + + "the policy contents to the persistent store).\n\n" + + "Click on Retain to retain the entered name, or click on " + + "Edit to edit the name.", + "Aviso: o nome do arquivo pode incluir caracteres de escape barra invertida. N\u00e3o \u00e9 necess\u00e1rio fazer o escape dos caracteres de barra invertida (a ferramenta faz o escape dos caracteres conforme necess\u00e1rio ao gravar o conte\u00fado da pol\u00edtica no armazenamento persistente).\n\nClique em Conservar para conservar o nome da entrada ou clique em Editar para edit\u00e1-lo."}, + + {"Add Public Key Alias", "Adicionar alias de chave p\u00fablica"}, + {"Remove Public Key Alias", "Remover alias de chave p\u00fablica"}, + {"File", "Arquivo"}, + {"KeyStore", "KeyStore"}, + {"Policy File:", "Arquivo de pol\u00edtica:"}, + {"Could not open policy file: policyFile: e.toString()", + "N\u00e3o foi poss\u00edvel abrir o arquivo de pol\u00edtica: {0}: {1}"}, + {"Policy Tool", "Ferramenta de pol\u00edtica"}, + {"Errors have occurred while opening the policy configuration. View the Warning Log for more information.", + "Ocorreram erros ao abrir a configura\u00e7\u00e3o da pol\u00edtica. Consulte o registro de avisos para obter mais informa\u00e7\u00f5es."}, + {"Error", "Erro"}, + {"OK", "OK"}, + {"Status", "Status"}, + {"Warning", "Aviso"}, + {"Permission: ", + "Permiss\u00e3o: "}, + {"Principal Type:", "Tipo do principal:"}, + {"Principal Name:", "Nome do principal:"}, + {"Target Name: ", + "Nome de destino: "}, + {"Actions: ", + "A\u00e7\u00f5es: "}, + {"OK to overwrite existing file filename?", + "OK para substituir o arquivo existente {0}?"}, + {"Cancel", "Cancelar"}, + {"CodeBase:", "CodeBase:"}, + {"SignedBy:", "SignedBy:"}, + {"Add Principal", "Adicionar principal"}, + {"Edit Principal", "Editar principal"}, + {"Remove Principal", "Remover principal"}, + {"Principals:", "Principais:"}, + {" Add Permission", " Adicionar permiss\u00e3o"}, + {" Edit Permission", " Editar permiss\u00e3o"}, + {"Remove Permission", "Remover permiss\u00e3o"}, + {"Done", "Conclu\u00eddo"}, + {"KeyStore URL:", "URL do KeyStore:"}, + {"KeyStore Type:", "Tipo de KeyStore:"}, + {"KeyStore Provider:", "Fornecedor de KeyStore:"}, + {"KeyStore Password URL:", "URL da senha do KeyStore:"}, + {"Principals", "Principais"}, + {" Edit Principal:", " Editar principal:"}, + {" Add New Principal:", " Adicionar novo principal:"}, + {"Permissions", "Permiss\u00f5es"}, + {" Edit Permission:", " Editar permiss\u00e3o:"}, + {" Add New Permission:", " Adicionar nova permiss\u00e3o:"}, + {"Signed By:", "Assinado por:"}, + {"Cannot Specify Principal with a Wildcard Class without a Wildcard Name", + "N\u00e3o \u00e9 poss\u00edvel especificar principal com uma classe de coringa sem um nome de coringa"}, + {"Cannot Specify Principal without a Name", + "N\u00e3o \u00e9 poss\u00edvel especificar principal sem um nome"}, + {"Permission and Target Name must have a value", + "O nome de destino e a permiss\u00e3o devem ter um valor"}, + {"Remove this Policy Entry?", "Remover esta entrada de pol\u00edtica?"}, + {"Overwrite File", "Substituir arquivo"}, + {"Policy successfully written to filename", + "Pol\u00edtica gravada com \u00eaxito em {0}"}, + {"null filename", "nome de arquivo nulo"}, + {"Save changes?", "Salvar altera\u00e7\u00f5es?"}, + {"Yes", "Sim"}, + {"No", "N\u00e3o"}, + {"Policy Entry", "Entrada de pol\u00edtica"}, + {"Save Changes", "Salvar altera\u00e7\u00f5es"}, + {"No Policy Entry selected", "Nenhuma entrada de pol\u00edtica selecionada"}, + {"Unable to open KeyStore: ex.toString()", + "N\u00e3o \u00e9 poss\u00edvel abrir o KeyStore: {0}"}, + {"No principal selected", "Nenhum principal selecionado"}, + {"No permission selected", "Nenhuma permiss\u00e3o selecionada"}, + {"name", "nome"}, + {"configuration type", "tipo de configura\u00e7\u00e3o"}, + {"environment variable name", "nome da vari\u00e1vel de ambiente"}, + {"library name", "nome da biblioteca"}, + {"package name", "nome do pacote"}, + {"policy type", "tipo de pol\u00edtica"}, + {"property name", "nome da propriedade"}, + {"provider name", "nome do fornecedor"}, + {"Principal List", "Lista de principais"}, + {"Permission List", "Lista de permiss\u00f5es"}, + {"Code Base", "Base de c\u00f3digo"}, + {"KeyStore U R L:", "U R L do KeyStore:"}, + {"KeyStore Password U R L:", "U R L da senha do KeyStore:"}, + + + // javax.security.auth.PrivateCredentialPermission + {"invalid null input(s)", "entrada(s) nula(s) inv\u00e1lida(s)"}, + {"actions can only be 'read'", "as a\u00e7\u00f5es podem ser somente 'lidas'"}, + {"permission name [name] syntax invalid: ", + "sintaxe inv\u00e1lida do nome da permiss\u00e3o [{0}]: "}, + {"Credential Class not followed by a Principal Class and Name", + "Classe da credencial n\u00e3o seguida por um nome e classe do principal"}, + {"Principal Class not followed by a Principal Name", + "Classe do principal n\u00e3o seguida por um nome do principal"}, + {"Principal Name must be surrounded by quotes", + "O nome do principal deve estar entre aspas"}, + {"Principal Name missing end quote", + "Faltam as aspas finais no nome do principal "}, + {"PrivateCredentialPermission Principal Class can not be a wildcard (*) value if Principal Name is not a wildcard (*) value", + "A classe do principal PrivateCredentialPermission n\u00e3o pode ser um valor coringa (*) se o nome do principal n\u00e3o for um valor coringa (*)"}, + {"CredOwner:\n\tPrincipal Class = class\n\tPrincipal Name = name", + "CredOwner:\n\tClasse do principal = {0}\n\tNome do principal = {1}"}, + + // javax.security.auth.x500 + {"provided null name", "nome nulo fornecido"}, + {"provided null keyword map", "mapa de palavra-chave nulo fornecido"}, + {"provided null OID map", "mapa OID nulo fornecido"}, + + // javax.security.auth.Subject + {"invalid null AccessControlContext provided", + "AccessControlContext nulo inv\u00e1lido fornecido"}, + {"invalid null action provided", "a\u00e7\u00e3o nula inv\u00e1lida fornecida"}, + {"invalid null Class provided", "classe nula inv\u00e1lida fornecida"}, + {"Subject:\n", "Subject:\n"}, + {"\tPrincipal: ", "\tPrincipal: "}, + {"\tPublic Credential: ", "\tCredencial p\u00fablica: "}, + {"\tPrivate Credentials inaccessible\n", + "\tCredenciais privadas inacess\u00edveis\n"}, + {"\tPrivate Credential: ", "\tCredencial privada: "}, + {"\tPrivate Credential inaccessible\n", + "\tCredencial privada inacess\u00edvel\n"}, + {"Subject is read-only", "O Subject \u00e9 de somente leitura"}, + {"attempting to add an object which is not an instance of java.security.Principal to a Subject's Principal Set", + "tentativa de adicionar um objeto que n\u00e3o \u00e9 uma inst\u00e2ncia de java.security.Principal a um conjunto de principais do Subject"}, + {"attempting to add an object which is not an instance of class", + "tentativa de adicionar um objeto que n\u00e3o \u00e9 uma inst\u00e2ncia de {0}"}, + + // javax.security.auth.login.AppConfigurationEntry + {"LoginModuleControlFlag: ", "LoginModuleControlFlag: "}, + + // javax.security.auth.login.LoginContext + {"Invalid null input: name", "Entrada nula inv\u00e1lida: nome"}, + {"No LoginModules configured for name", + "Nenhum LoginModule configurado para {0}"}, + {"invalid null Subject provided", "Subject nulo inv\u00e1lido fornecido"}, + {"invalid null CallbackHandler provided", + "CallbackHandler nulo inv\u00e1lido fornecido"}, + {"null subject - logout called before login", + "Subject nulo - logoff chamado antes do logon"}, + {"unable to instantiate LoginModule, module, because it does not provide a no-argument constructor", + "n\u00e3o \u00e9 poss\u00edvel instanciar LoginModule, {0}, porque n\u00e3o fornece um construtor sem argumento"}, + {"unable to instantiate LoginModule", + "n\u00e3o \u00e9 poss\u00edvel instanciar LoginModule"}, + {"unable to instantiate LoginModule: ", + "n\u00e3o \u00e9 poss\u00edvel instanciar LoginModule: "}, + {"unable to find LoginModule class: ", + "n\u00e3o \u00e9 poss\u00edvel localizar a classe LoginModule: "}, + {"unable to access LoginModule: ", + "n\u00e3o \u00e9 poss\u00edvel acessar LoginModule: "}, + {"Login Failure: all modules ignored", + "Falha de logon: todos os m\u00f3dulos ignorados"}, + + // sun.security.provider.PolicyFile + + {"java.security.policy: error parsing policy:\n\tmessage", + "java.security.policy: erro ao analisar {0}:\n\t{1}"}, + {"java.security.policy: error adding Permission, perm:\n\tmessage", + "java.security.policy: erro ao adicionar permiss\u00e3o, {0}:\n\t{1}"}, + {"java.security.policy: error adding Entry:\n\tmessage", + "java.security.policy: erro ao adicionar entrada:\n\t{0}"}, + {"alias name not provided (pe.name)", "nome de alias n\u00e3o fornecido ({0})"}, + {"unable to perform substitution on alias, suffix", + "n\u00e3o \u00e9 poss\u00edvel realizar a substitui\u00e7\u00e3o no alias, {0}"}, + {"substitution value, prefix, unsupported", + "valor da substitui\u00e7\u00e3o, {0}, n\u00e3o suportado"}, + {"(", "("}, + {")", ")"}, + {"type can't be null","o tipo n\u00e3o pode ser nulo"}, + + // sun.security.provider.PolicyParser + {"keystorePasswordURL can not be specified without also specifying keystore", + "keystorePasswordURL n\u00e3o pode ser especificado sem que o armazenamento de chaves tamb\u00e9m seja especificado"}, + {"expected keystore type", "tipo de armazenamento de chaves esperado"}, + {"expected keystore provider", "fornecedor de armazenamento de chaves esperado"}, + {"multiple Codebase expressions", + "v\u00e1rias express\u00f5es CodeBase"}, + {"multiple SignedBy expressions","v\u00e1rias express\u00f5es SignedBy"}, + {"SignedBy has empty alias","SignedBy possui alias vazio"}, + {"can not specify Principal with a wildcard class without a wildcard name", + "n\u00e3o \u00e9 poss\u00edvel especificar principal com uma classe de coringa sem um nome de coringa"}, + {"expected codeBase or SignedBy or Principal", + "CodeBase ou SignedBy ou Principal esperado"}, + {"expected permission entry", "entrada de permiss\u00e3o esperada"}, + {"number ", "n\u00famero "}, + {"expected [expect], read [end of file]", + "esperado [{0}], lido [fim do arquivo]"}, + {"expected [;], read [end of file]", + "esperado [;], lido [fim do arquivo]"}, + {"line number: msg", "linha {0}: {1}"}, + {"line number: expected [expect], found [actual]", + "linha {0}: esperado [{1}], encontrado [{2}]"}, + {"null principalClass or principalName", + "principalClass ou principalName nulo "}, + + // sun.security.pkcs11.SunPKCS11 + {"PKCS11 Token [providerName] Password: ", + "Senha PKCS11 Token [{0}]: "}, + + /* --- DEPRECATED --- */ + // javax.security.auth.Policy + {"unable to instantiate Subject-based policy", + "n\u00e3o \u00e9 poss\u00edvel instanciar a pol\u00edtica com base em Subject"} + }; + + + /** + * Returns the contents of this ResourceBundle. + * + *

      + * + * @return the contents of this ResourceBundle. + */ + public Object[][] getContents() { + return contents; + } +} diff --git a/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java b/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java index b0a334ee498..d3ce9013e15 100644 --- a/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java +++ b/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java @@ -265,6 +265,9 @@ public class SignatureFileVerifier { debug.println("processSignature unsigned name = "+name); } } + + // MANIFEST.MF is always regarded as signed + updateSigners(newSigners, signers, JarFile.MANIFEST_NAME); } /** diff --git a/jdk/src/share/classes/sun/security/validator/PKIXValidator.java b/jdk/src/share/classes/sun/security/validator/PKIXValidator.java index 59daa9eefb8..a1860a732a8 100644 --- a/jdk/src/share/classes/sun/security/validator/PKIXValidator.java +++ b/jdk/src/share/classes/sun/security/validator/PKIXValidator.java @@ -31,20 +31,35 @@ import java.security.*; import java.security.cert.*; import javax.security.auth.x500.X500Principal; +import sun.security.action.GetBooleanAction; +import sun.security.provider.certpath.AlgorithmChecker; /** * Validator implementation built on the PKIX CertPath API. This * implementation will be emphasized going forward.

      - * + *

      * Note that the validate() implementation tries to use a PKIX validator * if that appears possible and a PKIX builder otherwise. This increases * performance and currently also leads to better exception messages * in case of failures. + *

      + * {@code PKIXValidator} objects are immutable once they have been created. + * Please DO NOT add methods that can change the state of an instance once + * it has been created. * * @author Andreas Sterbenz */ public final class PKIXValidator extends Validator { + /** + * Flag indicating whether to enable revocation check for the PKIX trust + * manager. Typically, this will only work if the PKIX implementation + * supports CRL distribution points as we do not manually setup CertStores. + */ + private final static boolean checkTLSRevocation = + AccessController.doPrivileged + (new GetBooleanAction("com.sun.net.ssl.checkRevocation")); + // enable use of the validator if possible private final static boolean TRY_VALIDATOR = true; @@ -53,10 +68,10 @@ public final class PKIXValidator extends Validator { private int certPathLength = -1; // needed only for the validator - private Map> trustedSubjects; - private CertificateFactory factory; + private final Map> trustedSubjects; + private final CertificateFactory factory; - private boolean plugin = false; + private final boolean plugin; PKIXValidator(String variant, Collection trustedCerts) { super(TYPE_PKIX, variant); @@ -75,7 +90,33 @@ public final class PKIXValidator extends Validator { throw new RuntimeException("Unexpected error: " + e.toString(), e); } setDefaultParameters(variant); - initCommon(); + + // initCommon(); + if (TRY_VALIDATOR) { + if (TRY_VALIDATOR == false) { + return; + } + trustedSubjects = new HashMap>(); + for (X509Certificate cert : trustedCerts) { + X500Principal dn = cert.getSubjectX500Principal(); + List keys; + if (trustedSubjects.containsKey(dn)) { + keys = trustedSubjects.get(dn); + } else { + keys = new ArrayList(); + trustedSubjects.put(dn, keys); + } + keys.add(cert.getPublicKey()); + } + try { + factory = CertificateFactory.getInstance("X.509"); + } catch (CertificateException e) { + throw new RuntimeException("Internal error", e); + } + plugin = variant.equals(VAR_PLUGIN_CODE_SIGNING); + } else { + plugin = false; + } } PKIXValidator(String variant, PKIXBuilderParameters params) { @@ -88,31 +129,33 @@ public final class PKIXValidator extends Validator { } } parameterTemplate = params; - initCommon(); - } - private void initCommon() { - if (TRY_VALIDATOR == false) { - return; - } - trustedSubjects = new HashMap>(); - for (X509Certificate cert : trustedCerts) { - X500Principal dn = cert.getSubjectX500Principal(); - List keys; - if (trustedSubjects.containsKey(dn)) { - keys = trustedSubjects.get(dn); - } else { - keys = new ArrayList(); - trustedSubjects.put(dn, keys); + // initCommon(); + if (TRY_VALIDATOR) { + if (TRY_VALIDATOR == false) { + return; } - keys.add(cert.getPublicKey()); + trustedSubjects = new HashMap>(); + for (X509Certificate cert : trustedCerts) { + X500Principal dn = cert.getSubjectX500Principal(); + List keys; + if (trustedSubjects.containsKey(dn)) { + keys = trustedSubjects.get(dn); + } else { + keys = new ArrayList(); + trustedSubjects.put(dn, keys); + } + keys.add(cert.getPublicKey()); + } + try { + factory = CertificateFactory.getInstance("X.509"); + } catch (CertificateException e) { + throw new RuntimeException("Internal error", e); + } + plugin = variant.equals(VAR_PLUGIN_CODE_SIGNING); + } else { + plugin = false; } - try { - factory = CertificateFactory.getInstance("X.509"); - } catch (CertificateException e) { - throw new RuntimeException("Internal error", e); - } - plugin = variant.equals(VAR_PLUGIN_CODE_SIGNING); } public Collection getTrustedCertificates() { @@ -129,7 +172,7 @@ public final class PKIXValidator extends Validator { * @return the length of the last certification path passed to * CertPathValidator.validate, or -1 if it has not been invoked yet */ - public int getCertPathLength() { + public int getCertPathLength() { // mutable, should be private return certPathLength; } @@ -138,7 +181,12 @@ public final class PKIXValidator extends Validator { * revocation checking. In the future, this should be configurable. */ private void setDefaultParameters(String variant) { - parameterTemplate.setRevocationEnabled(false); + if ((variant == Validator.VAR_TLS_SERVER) || + (variant == Validator.VAR_TLS_CLIENT)) { + parameterTemplate.setRevocationEnabled(checkTLSRevocation); + } else { + parameterTemplate.setRevocationEnabled(false); + } } /** @@ -146,17 +194,29 @@ public final class PKIXValidator extends Validator { * modify the parameters but must make sure not to perform any concurrent * validations. */ - public PKIXBuilderParameters getParameters() { + public PKIXBuilderParameters getParameters() { // mutable, should be private return parameterTemplate; } + @Override X509Certificate[] engineValidate(X509Certificate[] chain, - Collection otherCerts, Object parameter) - throws CertificateException { + Collection otherCerts, + AlgorithmConstraints constraints, + Object parameter) throws CertificateException { if ((chain == null) || (chain.length == 0)) { throw new CertificateException ("null or zero-length certificate chain"); } + + // add new algorithm constraints checker + PKIXBuilderParameters pkixParameters = + (PKIXBuilderParameters) parameterTemplate.clone(); + AlgorithmChecker algorithmChecker = null; + if (constraints != null) { + algorithmChecker = new AlgorithmChecker(constraints); + pkixParameters.addCertPathChecker(algorithmChecker); + } + if (TRY_VALIDATOR) { // check that chain is in correct order and check if chain contains // trust anchor @@ -167,7 +227,7 @@ public final class PKIXValidator extends Validator { if (i != 0 && !dn.equals(prevIssuer)) { // chain is not ordered correctly, call builder instead - return doBuild(chain, otherCerts); + return doBuild(chain, otherCerts, pkixParameters); } // Check if chain[i] is already trusted. It may be inside @@ -186,7 +246,7 @@ public final class PKIXValidator extends Validator { // Remove and call validator on partial chain [0 .. i-1] X509Certificate[] newChain = new X509Certificate[i]; System.arraycopy(chain, 0, newChain, 0, i); - return doValidate(newChain); + return doValidate(newChain, pkixParameters); } prevIssuer = cert.getIssuerX500Principal(); } @@ -197,7 +257,7 @@ public final class PKIXValidator extends Validator { X500Principal subject = last.getSubjectX500Principal(); if (trustedSubjects.containsKey(issuer) && isSignatureValid(trustedSubjects.get(issuer), last)) { - return doValidate(chain); + return doValidate(chain, pkixParameters); } // don't fallback to builder if called from plugin/webstart @@ -209,18 +269,17 @@ public final class PKIXValidator extends Validator { X509Certificate[] newChain = new X509Certificate[chain.length-1]; System.arraycopy(chain, 0, newChain, 0, newChain.length); + // temporarily set last cert as sole trust anchor - PKIXBuilderParameters params = - (PKIXBuilderParameters) parameterTemplate.clone(); try { - params.setTrustAnchors + pkixParameters.setTrustAnchors (Collections.singleton(new TrustAnchor (chain[chain.length-1], null))); } catch (InvalidAlgorithmParameterException iape) { // should never occur, but ... throw new CertificateException(iape); } - doValidate(newChain, params); + doValidate(newChain, pkixParameters); } // if the rest of the chain is valid, throw exception // indicating no trust anchor was found @@ -230,10 +289,11 @@ public final class PKIXValidator extends Validator { // otherwise, fall back to builder } - return doBuild(chain, otherCerts); + return doBuild(chain, otherCerts, pkixParameters); } - private boolean isSignatureValid(List keys, X509Certificate sub) { + private boolean isSignatureValid(List keys, + X509Certificate sub) { if (plugin) { for (PublicKey key: keys) { try { @@ -273,13 +333,6 @@ public final class PKIXValidator extends Validator { } } - private X509Certificate[] doValidate(X509Certificate[] chain) - throws CertificateException { - PKIXBuilderParameters params = - (PKIXBuilderParameters)parameterTemplate.clone(); - return doValidate(chain, params); - } - private X509Certificate[] doValidate(X509Certificate[] chain, PKIXBuilderParameters params) throws CertificateException { try { @@ -300,11 +353,10 @@ public final class PKIXValidator extends Validator { } private X509Certificate[] doBuild(X509Certificate[] chain, - Collection otherCerts) throws CertificateException { + Collection otherCerts, + PKIXBuilderParameters params) throws CertificateException { try { - PKIXBuilderParameters params = - (PKIXBuilderParameters)parameterTemplate.clone(); setDate(params); // setup target constraints diff --git a/jdk/src/share/classes/sun/security/validator/SimpleValidator.java b/jdk/src/share/classes/sun/security/validator/SimpleValidator.java index 8c94376f35a..f825a4d6867 100644 --- a/jdk/src/share/classes/sun/security/validator/SimpleValidator.java +++ b/jdk/src/share/classes/sun/security/validator/SimpleValidator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 @@ import sun.security.provider.certpath.AlgorithmChecker; * deployed certificates and previous J2SE versions. It will never support * more advanced features and will be deemphasized in favor of the PKIX * validator going forward. + *

      + * {@code SimpleValidator} objects are immutable once they have been created. + * Please DO NOT add methods that can change the state of an instance once + * it has been created. * * @author Andreas Sterbenz */ @@ -80,13 +84,14 @@ public final class SimpleValidator extends Validator { * The list is used because there may be multiple certificates * with an identical subject DN. */ - private Map> trustedX500Principals; + private final Map> + trustedX500Principals; /** * Set of the trusted certificates. Present only for * getTrustedCertificates(). */ - private Collection trustedCerts; + private final Collection trustedCerts; SimpleValidator(String variant, Collection trustedCerts) { super(TYPE_SIMPLE, variant); @@ -114,9 +119,11 @@ public final class SimpleValidator extends Validator { * Perform simple validation of chain. The arguments otherCerts and * parameter are ignored. */ + @Override X509Certificate[] engineValidate(X509Certificate[] chain, - Collection otherCerts, Object parameter) - throws CertificateException { + Collection otherCerts, + AlgorithmConstraints constraints, + Object parameter) throws CertificateException { if ((chain == null) || (chain.length == 0)) { throw new CertificateException ("null or zero-length certificate chain"); @@ -129,6 +136,17 @@ public final class SimpleValidator extends Validator { if (date == null) { date = new Date(); } + + // create default algorithm constraints checker + TrustAnchor anchor = new TrustAnchor(chain[chain.length - 1], null); + AlgorithmChecker defaultAlgChecker = new AlgorithmChecker(anchor); + + // create application level algorithm constraints checker + AlgorithmChecker appAlgChecker = null; + if (constraints != null) { + appAlgChecker = new AlgorithmChecker(anchor, constraints); + } + // verify top down, starting at the certificate issued by // the trust anchor int maxPathLength = chain.length - 1; @@ -138,7 +156,12 @@ public final class SimpleValidator extends Validator { // check certificate algorithm try { - AlgorithmChecker.check(cert); + // Algorithm checker don't care about the unresolved critical + // extensions. + defaultAlgChecker.check(cert, Collections.emptySet()); + if (appAlgChecker != null) { + appAlgChecker.check(cert, Collections.emptySet()); + } } catch (CertPathValidatorException cpve) { throw new ValidatorException (ValidatorException.T_ALGORITHM_DISABLED, cert, cpve); diff --git a/jdk/src/share/classes/sun/security/validator/Validator.java b/jdk/src/share/classes/sun/security/validator/Validator.java index 0e21397aeaa..863566c7357 100644 --- a/jdk/src/share/classes/sun/security/validator/Validator.java +++ b/jdk/src/share/classes/sun/security/validator/Validator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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 sun.security.validator; import java.util.*; +import java.security.AlgorithmConstraints; import java.security.KeyStore; import java.security.cert.*; @@ -232,16 +233,44 @@ public abstract class Validator { public final X509Certificate[] validate(X509Certificate[] chain, Collection otherCerts, Object parameter) throws CertificateException { - chain = engineValidate(chain, otherCerts, parameter); + return validate(chain, otherCerts, null, parameter); + } + + /** + * Validate the given certificate chain. + * + * @param chain the target certificate chain + * @param otherCerts a Collection of additional X509Certificates that + * could be helpful for path building (or null) + * @param constraints algorithm constraints for certification path + * processing + * @param parameter an additional parameter with variant specific meaning. + * Currently, it is only defined for TLS_SERVER variant validators, + * where it must be non null and the name of the TLS key exchange + * algorithm being used (see JSSE X509TrustManager specification). + * In the future, it could be used to pass in a PKCS#7 object for + * code signing to check time stamps. + * @return a non-empty chain that was used to validate the path. The + * end entity cert is at index 0, the trust anchor at index n-1. + */ + public final X509Certificate[] validate(X509Certificate[] chain, + Collection otherCerts, + AlgorithmConstraints constraints, + Object parameter) throws CertificateException { + chain = engineValidate(chain, otherCerts, constraints, parameter); + // omit EE extension check if EE cert is also trust anchor if (chain.length > 1) { endEntityChecker.check(chain[0], parameter); } + return chain; } abstract X509Certificate[] engineValidate(X509Certificate[] chain, - Collection otherCerts, Object parameter) throws CertificateException; + Collection otherCerts, + AlgorithmConstraints constraints, + Object parameter) throws CertificateException; /** * Returns an immutable Collection of the X509Certificates this instance diff --git a/jdk/src/share/classes/sun/security/x509/X509CRLImpl.java b/jdk/src/share/classes/sun/security/x509/X509CRLImpl.java index 404826b6d61..b99bc448bbd 100644 --- a/jdk/src/share/classes/sun/security/x509/X509CRLImpl.java +++ b/jdk/src/share/classes/sun/security/x509/X509CRLImpl.java @@ -763,6 +763,15 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { } } + /** + * Gets the signature AlgorithmId from the CRL. + * + * @return the signature AlgorithmId + */ + public AlgorithmId getSigAlgId() { + return sigAlgId; + } + /** * return the AuthorityKeyIdentifier, if any. * diff --git a/jdk/src/share/classes/sun/security/x509/X509Key.java b/jdk/src/share/classes/sun/security/x509/X509Key.java index db591cc86c3..109cedf2ed1 100644 --- a/jdk/src/share/classes/sun/security/x509/X509Key.java +++ b/jdk/src/share/classes/sun/security/x509/X509Key.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/swing/SwingUtilities2.java b/jdk/src/share/classes/sun/swing/SwingUtilities2.java index ef372a6a878..e786da7fbf6 100644 --- a/jdk/src/share/classes/sun/swing/SwingUtilities2.java +++ b/jdk/src/share/classes/sun/swing/SwingUtilities2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/swing/plaf/synth/SynthFileChooserUIImpl.java b/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java index 08745ad1902..e971d9d1c4d 100644 --- a/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java +++ b/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/swing/table/DefaultTableCellHeaderRenderer.java b/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java index 78207ce1c0c..68aada7d758 100644 --- a/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java +++ b/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/text/normalizer/NormalizerImpl.java b/jdk/src/share/classes/sun/text/normalizer/NormalizerImpl.java index 498a680947a..b0b8e371200 100644 --- a/jdk/src/share/classes/sun/text/normalizer/NormalizerImpl.java +++ b/jdk/src/share/classes/sun/text/normalizer/NormalizerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1472,19 +1472,9 @@ public final class NormalizerImpl { } --remove; } - } else if(value2!=0) { - /* the composition is longer than the starter, - * move the intermediate characters back one */ + } else if(value2!=0) { // for U+1109A, U+1109C, and U+110AB starterIsSupplementary=true; - /* temporarily increment for the loop boundary */ - ++starter; - q=remove; - r=++remove; - while(starter ] [ -version ] [ connection ... ]\n\n" + " -interval Set the update interval to n seconds (default is 4 seconds)\n" + " -notile Do not tile windows initially (for two or more connections)\n" + - " -pluginpath Specify the path that jconsole uses to look up the plugins\n\n" + - " -version Print program version\n" + + " -pluginpath Specify the path that jconsole uses to look up the plugins\n" + + " -version Print program version\n\n" + " connection = pid || host:port || JMX URL (service:jmx:://...)\n" + " pid The process id of a target process\n" + " host A remote host name or IP address\n" + diff --git a/jdk/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_ja.java b/jdk/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_ja.java index 9fc4e95f7d8..a1d34a41c3b 100644 --- a/jdk/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_ja.java +++ b/jdk/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_ja.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,8 +46,6 @@ import static java.awt.event.KeyEvent.*; */ public class JConsoleResources_ja extends JConsoleResources { - private static final String cr = System.getProperty("line.separator"); - /** * Returns the contents of this ResourceBundle. * @@ -56,7 +54,7 @@ public class JConsoleResources_ja extends JConsoleResources { * @return the contents of this ResourceBundle. */ protected Object[][] getContents0() { - return new Object[][] { + Object[][] temp = new Object[][] { // NOTE 1: The value strings in this file containing "{0}" are // processed by the java.text.MessageFormat class. Any // single quotes appearing in these strings need to be @@ -98,7 +96,7 @@ public class JConsoleResources_ja extends JConsoleResources { {"Attributes","\u5c5e\u6027"}, {"Blank", "\u30d6\u30e9\u30f3\u30af"}, {"BlockedCount WaitedCount", - "\u7dcf\u30d6\u30ed\u30c3\u30af\u6570 : {0} \u7dcf\u5f85\u6a5f\u6570 : {1}" + cr}, + "\u7dcf\u30d6\u30ed\u30c3\u30af\u6570 : {0} \u7dcf\u5f85\u6a5f\u6570 : {1}\n"}, {"Boot class path","\u30d6\u30fc\u30c8\u30af\u30e9\u30b9\u30d1\u30b9"}, {"BorderedComponent.moreOrLessButton.toolTip", "\u8a73\u7d30\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u304b\u3069\u3046\u304b\u5207\u308a\u66ff\u3048\u308b"}, {"CPU Usage","CPU \u4f7f\u7528\u72b6\u6cc1"}, @@ -268,21 +266,21 @@ public class JConsoleResources_ja extends JConsoleResources { {"Minimize All.mnemonic", 'M'}, {"Minus Version", "\u3053\u308c\u306f {0} \u30d0\u30fc\u30b8\u30e7\u30f3 {1} \u3067\u3059"}, {"Monitor locked", - " - \u30ed\u30c3\u30af\u3055\u308c\u305f {0}" + cr}, + " - \u30ed\u30c3\u30af\u3055\u308c\u305f {0}\n"}, {"Motif","Motif"}, {"Name Build and Mode","{0} (\u30d3\u30eb\u30c9 {1}, {2})"}, {"Name and Build","{0} (\u30d3\u30eb\u30c9 {1})"}, {"Name","\u540d\u524d"}, {"Name: ","\u540d\u524d: "}, {"Name State", - "\u540d\u524d: {0}" + cr + - "\u72b6\u614b: {1}" + cr}, + "\u540d\u524d: {0}\n" + + "\u72b6\u614b: {1}\n"}, {"Name State LockName", - "\u540d\u524d: {0}" + cr + - "\u72b6\u614b: {1} ({2} \u4e0a)" + cr}, + "\u540d\u524d: {0}\n" + + "\u72b6\u614b: {1} ({2} \u4e0a)\n"}, {"Name State LockName LockOwner", - "\u540d\u524d: {0}" + cr + - "\u72b6\u614b: {1} ({2} \u4e0a) \u6240\u6709\u8005: {3}" + cr}, + "\u540d\u524d: {0}\n" + + "\u72b6\u614b: {1} ({2} \u4e0a) \u6240\u6709\u8005: {3}\n"}, {"New Connection...", "\u65b0\u898f\u63a5\u7d9a(N)..."}, {"New Connection....mnemonic", 'N'}, {"New value applied","\u65b0\u3057\u3044\u5024\u304c\u9069\u7528\u3055\u308c\u307e\u3057\u305f"}, @@ -348,7 +346,7 @@ public class JConsoleResources_ja extends JConsoleResources { {"Size Mb","{0} M \u30d0\u30a4\u30c8"}, {"Source","\u30bd\u30fc\u30b9"}, {"Stack trace", - cr + "\u30b9\u30bf\u30c3\u30af\u30c8\u30ec\u30fc\u30b9: " + cr}, + "\n\u30b9\u30bf\u30c3\u30af\u30c8\u30ec\u30fc\u30b9: \n"}, {"Success:","\u6210\u529f:"}, // Note: SummaryTab.headerDateTimeFormat can be one the following: // 1. A combination of two styles for date and time, using the @@ -426,22 +424,29 @@ public class JConsoleResources_ja extends JConsoleResources { {"plot", "\u30d7\u30ed\u30c3\u30c8"}, {"visualize","\u8868\u793a"}, {"zz usage text", - "\u4f7f\u3044\u65b9: {0} [ -interval=n ] [ -notile ] [ -pluginpath ] [ -version ] [ connection ... ]" + cr + - cr + - " -interval \u66f4\u65b0\u9593\u9694\u3092 n \u79d2\u306b\u8a2d\u5b9a\u3059\u308b (\u30c7\u30d5\u30a9\u30eb\u30c8\u306f 4 \u79d2)" + cr + - " -notile \u521d\u671f\u72b6\u614b\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u30bf\u30a4\u30eb\u72b6\u306b\u4e26\u3079\u306a\u3044 (\u63a5\u7d9a\u304c\u8907\u6570\u3042\u308b\u5834\u5408)" + cr + - " -pluginpath JConsole \u3067\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u63a2\u3059\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b" + cr + - " -version \u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u51fa\u529b\u3059\u308b" + cr + - cr + - " connection = pid || host:port || JMX URL (service:jmx:://...)" + cr + - " pid \u30bf\u30fc\u30b2\u30c3\u30c8\u30d7\u30ed\u30bb\u30b9\u306e\u30d7\u30ed\u30bb\u30b9 ID" + cr + - " host \u30ea\u30e2\u30fc\u30c8\u30db\u30b9\u30c8\u306e\u540d\u524d\u307e\u305f\u306f IP \u30a2\u30c9\u30ec\u30b9" + cr + - " port \u30ea\u30e2\u30fc\u30c8\u63a5\u7d9a\u7528\u306e\u30dd\u30fc\u30c8\u756a\u53f7" + cr + - cr + - " -J JConsole \u3092\u5b9f\u884c\u3059\u308b Java \u4eee\u60f3\u30de\u30b7\u30f3\u3078\u306e" + cr + + "\u4f7f\u3044\u65b9: {0} [ -interval=n ] [ -notile ] [ -pluginpath ] [ -version ] [ connection ... ]\n\n" + + " -interval \u66f4\u65b0\u9593\u9694\u3092 n \u79d2\u306b\u8a2d\u5b9a\u3059\u308b (\u30c7\u30d5\u30a9\u30eb\u30c8\u306f 4 \u79d2)\n" + + " -notile \u521d\u671f\u72b6\u614b\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u30bf\u30a4\u30eb\u72b6\u306b\u4e26\u3079\u306a\u3044 (\u63a5\u7d9a\u304c\u8907\u6570\u3042\u308b\u5834\u5408)\n" + + " -pluginpath JConsole \u3067\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u63a2\u3059\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b\n" + + " -version \u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u51fa\u529b\u3059\u308b\n\n" + + " connection = pid || host:port || JMX URL (service:jmx:://...)\n" + + " pid \u30bf\u30fc\u30b2\u30c3\u30c8\u30d7\u30ed\u30bb\u30b9\u306e\u30d7\u30ed\u30bb\u30b9 ID\n" + + " host \u30ea\u30e2\u30fc\u30c8\u30db\u30b9\u30c8\u306e\u540d\u524d\u307e\u305f\u306f IP \u30a2\u30c9\u30ec\u30b9\n" + + " port \u30ea\u30e2\u30fc\u30c8\u63a5\u7d9a\u7528\u306e\u30dd\u30fc\u30c8\u756a\u53f7\n\n" + + " -J JConsole \u3092\u5b9f\u884c\u3059\u308b Java \u4eee\u60f3\u30de\u30b7\u30f3\u3078\u306e\n" + " \u5165\u529b\u5f15\u6570\u3092\u6307\u5b9a\u3059\u308b"}, // END OF MATERIAL TO LOCALIZE }; + + String ls = System.getProperty("line.separator"); + for(int i=0;iResourceBundle. * @@ -56,7 +54,7 @@ public class JConsoleResources_zh_CN extends JConsoleResources { * @return the contents of this ResourceBundle. */ protected Object[][] getContents0() { - return new Object[][] { + Object[][] temp = new Object[][] { // NOTE 1: The value strings in this file containing "{0}" are // processed by the java.text.MessageFormat class. Any // single quotes appearing in these strings need to be @@ -98,7 +96,7 @@ public class JConsoleResources_zh_CN extends JConsoleResources { {"Attributes","\u5c5e\u6027"}, {"Blank", "\u7a7a\u767d"}, {"BlockedCount WaitedCount", - "\u963b\u585e\u603b\u6570\uff1a{0} \u7b49\u5f85\u603b\u6570\uff1a {1}" + cr}, + "\u963b\u585e\u603b\u6570\uff1a{0} \u7b49\u5f85\u603b\u6570\uff1a {1}\n"}, {"Boot class path","\u5f15\u5bfc\u7c7b\u8def\u5f84"}, {"BorderedComponent.moreOrLessButton.toolTip", "\u5207\u6362\u4ee5\u663e\u793a\u8f83\u591a\u4fe1\u606f\u6216\u8f83\u5c11\u4fe1\u606f"}, {"CPU Usage","CPU \u4f7f\u7528\u60c5\u51b5"}, @@ -268,21 +266,21 @@ public class JConsoleResources_zh_CN extends JConsoleResources { {"Minimize All.mnemonic", 'M'}, {"Minus Version", "\u8fd9\u662f {0} \u7248\u672c {1}"}, {"Monitor locked", - " - \u5df2\u9501\u5b9a {0}" + cr}, + " - \u5df2\u9501\u5b9a {0}\n"}, {"Motif","\u4fee\u6539"}, {"Name Build and Mode","{0}\uff08\u5185\u90e8\u7248\u672c {1}\u3001{2}\uff09"}, {"Name and Build","{0}\uff08\u5185\u90e8\u7248\u672c {1}\uff09"}, {"Name","\u540d\u79f0"}, {"Name: ","\u540d\u79f0\uff1a "}, {"Name State", - "\u540d\u79f0\uff1a {0}" + cr + - "\u72b6\u6001\uff1a {1}" + cr}, + "\u540d\u79f0\uff1a {0}\n" + + "\u72b6\u6001\uff1a {1}\n"}, {"Name State LockName", - "\u540d\u79f0\uff1a {0}" + cr + - "\u72b6\u6001\uff1a{1} \u5728 {2} \u4e0a" + cr}, + "\u540d\u79f0\uff1a {0}\n" + + "\u72b6\u6001\uff1a{1} \u5728 {2} \u4e0a\n"}, {"Name State LockName LockOwner", - "\u540d\u79f0\uff1a {0}" + cr + - "\u72b6\u6001\uff1a{1} \u5728 {2} \u4e0a\uff0c\u62e5\u6709\u8005\uff1a {3}" + cr}, + "\u540d\u79f0\uff1a {0}\n" + + "\u72b6\u6001\uff1a{1} \u5728 {2} \u4e0a\uff0c\u62e5\u6709\u8005\uff1a {3}\n"}, {"New Connection...", "\u65b0\u5efa\u8fde\u63a5..."}, {"New Connection....mnemonic", 'N'}, {"New value applied","\u5df2\u5e94\u7528\u65b0\u503c"}, @@ -348,7 +346,7 @@ public class JConsoleResources_zh_CN extends JConsoleResources { {"Size Mb","{0} Mb"}, {"Source","\u6e90"}, {"Stack trace", - cr + "\u5806\u6808\u8ffd\u8e2a\uff1a " + cr}, + "\n\u5806\u6808\u8ffd\u8e2a\uff1a \n"}, {"Success:","\u6210\u529f\uff1a"}, // Note: SummaryTab.headerDateTimeFormat can be one the following: // 1. A combination of two styles for date and time, using the @@ -426,22 +424,29 @@ public class JConsoleResources_zh_CN extends JConsoleResources { {"plot", "\u7ed8\u56fe"}, {"visualize","\u663e\u793a"}, {"zz usage text", - "\u7528\u6cd5: {0} [ -interval=n ] [ -notile ] [ -pluginpath ] [ -version ] [ connection ...]" + cr + - cr + - " -interval \u5c06\u66f4\u65b0\u95f4\u9694\u65f6\u95f4\u8bbe\u7f6e\u4e3a n \u79d2\uff08\u9ed8\u8ba4\u503c\u4e3a 4 \u79d2\uff09" + cr + - " -notile \u6700\u521d\u4e0d\u5e73\u94fa\u663e\u793a\u7a97\u53e3\uff08\u5bf9\u4e8e\u4e24\u4e2a\u6216\u66f4\u591a\u8fde\u63a5\uff09" + cr + - " -pluginpath \u6307\u5b9a jconsole \u7528\u4e8e\u67e5\u627e\u63d2\u4ef6\u7684\u8def\u5f84" + cr + - " -version \u8f93\u51fa\u7a0b\u5e8f\u7248\u672c" + cr + - cr + - " connection = pid || host:port || JMX URL (service:jmx:://...)" + cr + - " pid \u76ee\u6807\u8fdb\u7a0b\u7684\u8fdb\u7a0b ID" + cr + - " host \u8fdc\u7a0b\u4e3b\u673a\u540d\u6216 IP \u5730\u5740" + cr + - " port \u7528\u4e8e\u8fdc\u7a0b\u8fde\u63a5\u7684\u7aef\u53e3\u53f7" + cr + - cr + - " -J \u5bf9\u6b63\u5728\u8fd0\u884c jconsole \u7684 Java \u865a\u62df\u673a\u6307\u5b9a" + cr + + "\u7528\u6cd5: {0} [ -interval=n ] [ -notile ] [ -pluginpath ] [ -version ] [ connection ...]\n\n" + + " -interval \u5c06\u66f4\u65b0\u95f4\u9694\u65f6\u95f4\u8bbe\u7f6e\u4e3a n \u79d2\uff08\u9ed8\u8ba4\u503c\u4e3a 4 \u79d2\uff09\n" + + " -notile \u6700\u521d\u4e0d\u5e73\u94fa\u663e\u793a\u7a97\u53e3\uff08\u5bf9\u4e8e\u4e24\u4e2a\u6216\u66f4\u591a\u8fde\u63a5\uff09\n" + + " -pluginpath \u6307\u5b9a jconsole \u7528\u4e8e\u67e5\u627e\u63d2\u4ef6\u7684\u8def\u5f84\n" + + " -version \u8f93\u51fa\u7a0b\u5e8f\u7248\u672c\n\n" + + " connection = pid || host:port || JMX URL (service:jmx:://...)\n" + + " pid \u76ee\u6807\u8fdb\u7a0b\u7684\u8fdb\u7a0b ID\n" + + " host \u8fdc\u7a0b\u4e3b\u673a\u540d\u6216 IP \u5730\u5740\n" + + " port \u7528\u4e8e\u8fdc\u7a0b\u8fde\u63a5\u7684\u7aef\u53e3\u53f7\n\n" + + " -J \u5bf9\u6b63\u5728\u8fd0\u884c jconsole \u7684 Java \u865a\u62df\u673a\u6307\u5b9a\n" + " \u8f93\u5165\u53c2\u6570"}, // END OF MATERIAL TO LOCALIZE }; + + String ls = System.getProperty("line.separator"); + for(int i=0;i availableJRELocales = null; + private static volatile List availableJRELocales = null; /** * Provider locales for this locale sensitive service. @@ -252,12 +252,16 @@ public final class LocaleServiceProviderPool { * * @return list of the available JRE locales */ - private synchronized List getJRELocales() { + private List getJRELocales() { if (availableJRELocales == null) { - Locale[] allLocales = LocaleData.getAvailableLocales(); - availableJRELocales = new ArrayList(allLocales.length); - for (Locale locale : allLocales) { - availableJRELocales.add(getLookupLocale(locale)); + synchronized (LocaleServiceProviderPool.class) { + if (availableJRELocales == null) { + Locale[] allLocales = LocaleData.getAvailableLocales(); + availableJRELocales = new ArrayList(allLocales.length); + for (Locale locale : allLocales) { + availableJRELocales.add(getLookupLocale(locale)); + } + } } } return availableJRELocales; diff --git a/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java b/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java index 856297fc40a..c6251ade512 100644 --- a/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java +++ b/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/util/logging/PlatformLogger.java b/jdk/src/share/classes/sun/util/logging/PlatformLogger.java index 499a5483a8c..ae12554d1f4 100644 --- a/jdk/src/share/classes/sun/util/logging/PlatformLogger.java +++ b/jdk/src/share/classes/sun/util/logging/PlatformLogger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +113,7 @@ public class PlatformLogger { // Table of known loggers. Maps names to PlatformLoggers. private static Map> loggers = - new HashMap>(); + new HashMap<>(); /** * Returns a PlatformLogger of a given name. @@ -126,7 +126,7 @@ public class PlatformLogger { } if (log == null) { log = new PlatformLogger(name); - loggers.put(name, new WeakReference(log)); + loggers.put(name, new WeakReference<>(log)); } return log; } @@ -488,7 +488,7 @@ public class PlatformLogger { */ static class JavaLogger extends LoggerProxy { private static final Map levelObjects = - new HashMap(); + new HashMap<>(); static { if (LoggingSupport.isAvailable()) { @@ -535,10 +535,6 @@ public class PlatformLogger { } void doLog(int level, String msg, Object... params) { - int paramsNumber = (params != null) ? params.length : 0; - for (int i = 0; i < paramsNumber; i++) { - params[i] = String.valueOf(params[i]); - } LoggingSupport.log(javaLogger, levelObjects.get(level), msg, params); } diff --git a/jdk/make/java/hpi/windows/Makefile b/jdk/src/share/classes/sun/util/logging/resources/logging_pt_BR.properties similarity index 58% rename from jdk/make/java/hpi/windows/Makefile rename to jdk/src/share/classes/sun/util/logging/resources/logging_pt_BR.properties index e36f0bd4c1b..03fab157a1c 100644 --- a/jdk/make/java/hpi/windows/Makefile +++ b/jdk/src/share/classes/sun/util/logging/resources/logging_pt_BR.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. # 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,47 +23,15 @@ # questions. # -# -# Makefile for Windows HPI DLL -# -BUILDDIR = ../../.. -MODULE = base -LIBRARY = hpi -PRODUCT = java -THREADDIR = windows_threads -LIB_LOCATION = $(BINDIR) - -include $(BUILDDIR)/common/Defs.gmk - -# windows compiler flags -ifeq ($(PLATFORM),windows) - CPPFLAGS_DBG += -DLOGGING -endif - -FILES_c = \ - linker_md.c \ - memory_md.c \ - monitor_md.c \ - path_md.c \ - socket_md.c \ - sys_api_md.c \ - system_md.c \ - threads_md.c \ - hpi.c # trailing blank required! - -JVMLIB = -JAVALIB = -OTHER_LCF = -export:DLL_Initialize -EXTRA_LIBS = - - -# -# Other files/flags shared between the HPIs. -# -include $(BUILDDIR)/java/hpi/hpi_common.gmk - -# -# Rules for the .so file. -# -include $(BUILDDIR)/common/Library.gmk +# Localizations for Level names. For the US locale +# these are the same as the non-localized level name. +ALL=TODOS +SEVERE=GRAVE +WARNING=AVISO +INFO=INFO +CONFIG= CONFIG +FINE=BOM +FINER=MUITO BOM +FINEST=EXCELENTE +OFF=OFF diff --git a/jdk/src/share/classes/sun/util/resources/CalendarData_hu.properties b/jdk/src/share/classes/sun/util/resources/CalendarData_hu.properties index 9fcc1ced96b..48312915f68 100644 --- a/jdk/src/share/classes/sun/util/resources/CalendarData_hu.properties +++ b/jdk/src/share/classes/sun/util/resources/CalendarData_hu.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/util/resources/CurrencyNames_uk_UA.properties b/jdk/src/share/classes/sun/util/resources/CurrencyNames_uk_UA.properties index a85d80a36ca..ebe2325a966 100644 --- a/jdk/src/share/classes/sun/util/resources/CurrencyNames_uk_UA.properties +++ b/jdk/src/share/classes/sun/util/resources/CurrencyNames_uk_UA.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/util/resources/LocaleNames.properties b/jdk/src/share/classes/sun/util/resources/LocaleNames.properties index 5aae361c386..6756add95af 100644 --- a/jdk/src/share/classes/sun/util/resources/LocaleNames.properties +++ b/jdk/src/share/classes/sun/util/resources/LocaleNames.properties @@ -1,5 +1,5 @@ -# -# Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. +# +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -21,7 +21,7 @@ # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA # or visit www.oracle.com if you need additional information or have any # questions. -# +# # (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved # (C) Copyright IBM Corp. 1996 - 1999 - All Rights Reserved @@ -228,6 +228,492 @@ za=Zhuang zh=Chinese zu=Zulu +# key is ISO 639.2 language code +aar=Afar +abk=Abkhazian +ace=Achinese +ach=Acoli +ada=Adangme +ady=Adyghe +afa=Afro-Asiatic +afh=Afrihili +afr=Afrikaans +ain=Ainu +aka=Akan +akk=Akkadian +alb=Albanian +ale=Aleut +alg=Algonquian +alt=Southern Altai +amh=Amharic +ang=English, Old (ca.450-1100) +anp=Angika +apa=Apache +ara=Arabic +arc=Official Aramaic (700-300 BCE) +arg=Aragonese +arm=Armenian +arn=Mapudungun +arp=Arapaho +art=Artificial +arw=Arawak +asm=Assamese +ast=Asturian +ath=Athapascan +aus=Australian +ava=Avaric +ave=Avestan +awa=Awadhi +aym=Aymara +aze=Azerbaijani +bad=Banda +bai=Bamileke +bak=Bashkir +bal=Baluchi +bam=Bambara +ban=Balinese +baq=Basque +bas=Basa +bat=Baltic +bej=Beja +bel=Belarusian +bem=Bemba +ben=Bengali +ber=Berber +bho=Bhojpuri +bih=Bihari +bik=Bikol +bin=Bini +bis=Bislama +bla=Siksika +bnt=Bantu +bos=Bosnian +bra=Braj +bre=Breton +btk=Batak +bua=Buriat +bug=Buginese +bul=Bulgarian +bur=Burmese +byn=Blin +cad=Caddo +cai=Central American Indian +car=Galibi Carib +cat=Catalan +cau=Caucasian +ceb=Cebuano +cel=Celtic +cha=Chamorro +chb=Chibcha +che=Chechen +chg=Chagatai +chi=Chinese +chk=Chuukese +chm=Mari +chn=Chinook jargon +cho=Choctaw +chp=Chipewyan +chr=Cherokee +chu=Church Slavic +chv=Chuvash +chy=Cheyenne +cmc=Chamic +cop=Coptic +cor=Cornish +cos=Corsican +cpe=Creoles and pidgins, English based +cpf=Creoles and pidgins, French-based +cpp=Creoles and pidgins, Portuguese-based +cre=Cree +crh=Crimean Tatar +crp=Creoles and pidgins +csb=Kashubian +cus=Cushitic +cze=Czech +dak=Dakota +dan=Danish +dar=Dargwa +day=Land Dayak +del=Delaware +den=Slave (Athapascan) +dgr=Dogrib +din=Dinka +div=Divehi +doi=Dogri +dra=Dravidian +dsb=Lower Sorbian +dua=Duala +dum=Dutch, Middle (ca.1050-1350) +dut=Dutch +dyu=Dyula +dzo=Dzongkha +efi=Efik +egy=Egyptian (Ancient) +eka=Ekajuk +elx=Elamite +eng=English +enm=English, Middle (1100-1500) +epo=Esperanto +est=Estonian +ewe=Ewe +ewo=Ewondo +fan=Fang +fao=Faroese +fat=Fanti +fij=Fijian +fil=Filipino +fin=Finnish +fiu=Finno-Ugrian +fon=Fon +fre=French +frm=French, Middle (ca.1400-1600) +fro=French, Old (842-ca.1400) +frr=Northern Frisian +frs=Eastern Frisian +fry=Western Frisian +ful=Fulah +fur=Friulian +gaa=Ga +gay=Gayo +gba=Gbaya +gem=Germanic +geo=Georgian +ger=German +gez=Geez +gil=Gilbertese +gla=Gaelic +gle=Irish +glg=Galician +glv=Manx +gmh=German, Middle High (ca.1050-1500) +goh=German, Old High (ca.750-1050) +gon=Gondi +gor=Gorontalo +got=Gothic +grb=Grebo +grc=Greek, Ancient (to 1453) +gre=Greek, Modern (1453-) +grn=Guarani +gsw=Swiss German +guj=Gujarati +gwi=Gwich'in +hai=Haida +hat=Haitian +hau=Hausa +haw=Hawaiian +heb=Hebrew +her=Herero +hil=Hiligaynon +him=Himachali +hin=Hindi +hit=Hittite +hmn=Hmong +hmo=Hiri Motu +hrv=Croatian +hsb=Upper Sorbian +hun=Hungarian +hup=Hupa +iba=Iban +ibo=Igbo +ice=Icelandic +ido=Ido +iii=Sichuan Yi +ijo=Ijo +iku=Inuktitut +ile=Interlingue +ilo=Iloko +ina=Interlingua (International Auxiliary Language Association) +inc=Indic +ind=Indonesian +ine=Indo-European +inh=Ingush +ipk=Inupiaq +ira=Iranian +iro=Iroquoian +ita=Italian +jav=Javanese +jbo=Lojban +jpn=Japanese +jpr=Judeo-Persian +jrb=Judeo-Arabic +kaa=Kara-Kalpak +kab=Kabyle +kac=Kachin +kal=Kalaallisut +kam=Kamba +kan=Kannada +kar=Karen +kas=Kashmiri +kau=Kanuri +kaw=Kawi +kaz=Kazakh +kbd=Kabardian +kha=Khasi +khi=Khoisan +khm=Central Khmer +kho=Khotanese +kik=Kikuyu +kin=Kinyarwanda +kir=Kirghiz +kmb=Kimbundu +kok=Konkani +kom=Komi +kon=Kongo +kor=Korean +kos=Kosraean +kpe=Kpelle +krc=Karachay-Balkar +krl=Karelian +kro=Kru +kru=Kurukh +kua=Kuanyama +kum=Kumyk +kur=Kurdish +kut=Kutenai +lad=Ladino +lah=Lahnda +lam=Lamba +lao=Lao +lat=Latin +lav=Latvian +lez=Lezghian +lim=Limburgan +lin=Lingala +lit=Lithuanian +lol=Mongo +loz=Lozi +ltz=Luxembourgish +lua=Luba-Lulua +lub=Luba-Katanga +lug=Ganda +lui=Luiseno +lun=Lunda +luo=Luo (Kenya and Tanzania) +lus=Lushai +mac=Macedonian +mad=Madurese +mag=Magahi +mah=Marshallese +mai=Maithili +mak=Makasar +mal=Malayalam +man=Mandingo +mao=Maori +map=Austronesian +mar=Marathi +mas=Masai +may=Malay +mdf=Moksha +mdr=Mandar +men=Mende +mga=Irish, Middle (900-1200) +mic=Mi'kmaq +min=Minangkabau +mis=Uncoded +mkh=Mon-Khmer +mlg=Malagasy +mlt=Maltese +mnc=Manchu +mni=Manipuri +mno=Manobo +moh=Mohawk +mon=Mongolian +mos=Mossi +mul=Multiple +mun=Munda +mus=Creek +mwl=Mirandese +mwr=Marwari +myn=Mayan +myv=Erzya +nah=Nahuatl +nai=North American Indian +nap=Neapolitan +nau=Nauru +nav=Navajo +nbl=Ndebele, South +nde=Ndebele, North +ndo=Ndonga +nds=Low German +nep=Nepali +new=Nepal Bhasa +nia=Nias +nic=Niger-Kordofanian +niu=Niuean +nno=Norwegian Nynorsk +nob=Bokm\u00e5l, Norwegian +nog=Nogai +non=Norse, Old +nor=Norwegian +nqo=N'Ko +nso=Pedi +nub=Nubian +nwc=Classical Newari +nya=Chichewa +nym=Nyamwezi +nyn=Nyankole +nyo=Nyoro +nzi=Nzima +oci=Occitan (post 1500) +oji=Ojibwa +ori=Oriya +orm=Oromo +osa=Osage +oss=Ossetian +ota=Turkish, Ottoman (1500-1928) +oto=Otomian +paa=Papuan +pag=Pangasinan +pal=Pahlavi +pam=Pampanga +pan=Panjabi +pap=Papiamento +pau=Palauan +peo=Persian, Old (ca.600-400 B.C.) +per=Persian +phi=Philippine +phn=Phoenician +pli=Pali +pol=Polish +pon=Pohnpeian +por=Portuguese +pra=Prakrit +pro=Proven\u00e7al, Old (to 1500) +pus=Pushto; Pashto +que=Quechua +raj=Rajasthani +rap=Rapanui +rar=Rarotongan +roa=Romance +roh=Romansh +rom=Romany +rum=Romanian +run=Rundi +rup=Aromanian +rus=Russian +sad=Sandawe +sag=Sango +sah=Yakut +sai=South American Indian +sal=Salishan +sam=Samaritan Aramaic +san=Sanskrit +sas=Sasak +sat=Santali +scn=Sicilian +sco=Scots +sel=Selkup +sem=Semitic +sga=Irish, Old (to 900) +sgn=Sign +shn=Shan +sid=Sidamo +sin=Sinhala +sio=Siouan +sit=Sino-Tibetan +sla=Slavic +slo=Slovak +slv=Slovenian +sma=Southern Sami +sme=Northern Sami +smi=Sami +smj=Lule Sami +smn=Inari Sami +smo=Samoan +sms=Skolt Sami +sna=Shona +snd=Sindhi +snk=Soninke +sog=Sogdian +som=Somali +son=Songhai +sot=Sotho, Southern +spa=Spanish +srd=Sardinian +srn=Sranan Tongo +srp=Serbian +srr=Serer +ssa=Nilo-Saharan +ssw=Swati +suk=Sukuma +sun=Sundanese +sus=Susu +sux=Sumerian +swa=Swahili +swe=Swedish +syc=Classical Syriac +syr=Syriac +tah=Tahitian +tai=Tai +tam=Tamil +tat=Tatar +tel=Telugu +tem=Timne +ter=Tereno +tet=Tetum +tgk=Tajik +tgl=Tagalog +tha=Thai +tib=Tibetan +tig=Tigre +tir=Tigrinya +tiv=Tiv +tkl=Tokelau +tlh=Klingon +tli=Tlingit +tmh=Tamashek +tog=Tonga (Nyasa) +ton=Tonga (Tonga Islands) +tpi=Tok Pisin +tsi=Tsimshian +tsn=Tswana +tso=Tsonga +tuk=Turkmen +tum=Tumbuka +tup=Tupi +tur=Turkish +tut=Altaic +tvl=Tuvalu +twi=Twi +tyv=Tuvinian +udm=Udmurt +uga=Ugaritic +uig=Uighur +ukr=Ukrainian +umb=Umbundu +und=Undetermined +urd=Urdu +uzb=Uzbek +vai=Vai +ven=Venda +vie=Vietnamese +vol=Volap\u00fck +vot=Votic +wak=Wakashan +wal=Wolaitta +war=Waray +was=Washo +wel=Welsh +wen=Sorbian +wln=Walloon +wol=Wolof +xal=Kalmyk +xho=Xhosa +yao=Yao +yap=Yapese +yid=Yiddish +yor=Yoruba +ypk=Yupik +zap=Zapotec +zbl=Blissymbols +zen=Zenaga +zha=Zhuang +znd=Zande +zul=Zulu +zun=Zuni +zxx=No linguistic content +zza=Zaza + # script names # key is ISO 15924 script code diff --git a/jdk/src/share/classes/sun/util/resources/LocaleNames_nl.properties b/jdk/src/share/classes/sun/util/resources/LocaleNames_nl.properties index 218b81a3896..b88e5a0e937 100644 --- a/jdk/src/share/classes/sun/util/resources/LocaleNames_nl.properties +++ b/jdk/src/share/classes/sun/util/resources/LocaleNames_nl.properties @@ -1,4 +1,4 @@ -# Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/util/resources/LocaleNames_zh.properties b/jdk/src/share/classes/sun/util/resources/LocaleNames_zh.properties index eb58d8dd15a..30c450c6cfd 100644 --- a/jdk/src/share/classes/sun/util/resources/LocaleNames_zh.properties +++ b/jdk/src/share/classes/sun/util/resources/LocaleNames_zh.properties @@ -1,4 +1,4 @@ -# Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/util/resources/LocaleNames_zh_TW.properties b/jdk/src/share/classes/sun/util/resources/LocaleNames_zh_TW.properties index dae7ba5f3dc..95d598e967b 100644 --- a/jdk/src/share/classes/sun/util/resources/LocaleNames_zh_TW.properties +++ b/jdk/src/share/classes/sun/util/resources/LocaleNames_zh_TW.properties @@ -1,4 +1,4 @@ -# Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/util/resources/TimeZoneNames_pt_BR.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java new file mode 100644 index 00000000000..981281217f7 --- /dev/null +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java @@ -0,0 +1,860 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved + * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved + * + * The original version of this source code and documentation + * is copyrighted and owned by Taligent, Inc., a wholly-owned + * subsidiary of IBM. These materials are provided under terms + * of a License Agreement between Taligent and Sun. This technology + * is protected by multiple US and International patents. + * + * This notice and attribution to Taligent may not be removed. + * Taligent is a registered trademark of Taligent, Inc. + * + */ + +package sun.util.resources; + +public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { + + protected final Object[][] getContents() { + String ACT[] = new String[] {"Fuso hor\u00e1rio do Acre", "ACT", + "Fuso hor\u00e1rio de ver\u00e3o do Acre", "ACST"}; + String ADELAIDE[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central (Austr\u00e1lia do Sul)", "CST", + "Fuso hor\u00e1rio de ver\u00e3o central (Austr\u00e1lia do Sul)", "CST"}; + String AGT[] = new String[] {"Fuso hor\u00e1rio da Argentina", "ART", + "Fuso hor\u00e1rio de ver\u00e3o da Argentina", "ARST"}; + String AKST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Alaska", "AKST", + "Hor\u00e1rio de luz natural do Alaska", "AKDT"}; + String AMT[] = new String[] {"Fuso hor\u00e1rio do Amazonas", "AMT", + "Fuso hor\u00e1rio de ver\u00e3o do Amazonas", "AMST"}; + String ARAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da Ar\u00e1bia", "AST", + "Hor\u00e1rio de luz natural da Ar\u00e1bia", "ADT"}; + String ARMT[] = new String[] {"Fuso hor\u00e1rio da Arm\u00eania", "AMT", + "Fuso hor\u00e1rio de ver\u00e3o da Arm\u00eania", "AMST"}; + String AST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Atl\u00e2ntico", "AST", + "Hor\u00e1rio de luz natural do Atl\u00e2ntico", "ADT"}; + String BDT[] = new String[] {"Fuso hor\u00e1rio de Bangladesh", "BDT", + "Fuso hor\u00e1rio de ver\u00e3o de Bangladesh", "BDST"}; + String BRISBANE[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Queensland)", "EST", + "Fuso hor\u00e1rio de ver\u00e3o oriental (Queensland)", "EST"}; + String BROKEN_HILL[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central (Austr\u00e1lia do Sul/Nova Gales do Sul)", "CST", + "Fuso hor\u00e1rio de ver\u00e3o central (Austr\u00e1lia do Sul/Nova Gales do Sul)", "CST"}; + String BRT[] = new String[] {"Fuso hor\u00e1rio de Bras\u00edlia", "BRT", + "Fuso hor\u00e1rio de ver\u00e3o de Bras\u00edlia", "BRST"}; + String BTT[] = new String[] {"Fuso hor\u00e1rio de But\u00e3o", "BTT", + "Fuso hor\u00e1rio de ver\u00e3o de But\u00e3o", "BTST"}; + String CAT[] = new String[] {"Fuso hor\u00e1rio da \u00c1frica Central", "CAT", + "Fuso hor\u00e1rio de ver\u00e3o da \u00c1frica Central", "CAST"}; + String CET[] = new String[] {"Fuso hor\u00e1rio da Europa Central", "CET", + "Fuso hor\u00e1rio de ver\u00e3o da Europa Central", "CEST"}; + String CHAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Chatham", "CHAST", + "Hor\u00e1rio de luz natural de Chatham", "CHADT"}; + String CIT[] = new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Central", "CIT", + "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Central", "CIST"}; + String CLT[] = new String[] {"Fuso hor\u00e1rio do Chile", "CLT", + "Fuso hor\u00e1rio de ver\u00e3o do Chile", "CLST"}; + String CST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central", "CST", + "Hor\u00e1rio de luz natural central", "CDT"}; + String CTT[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da China", "CST", + "Hor\u00e1rio de luz natural da China", "CDT"}; + String CUBA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Cuba", "CST", + "Hor\u00e1rio de luz natural de Cuba", "CDT"}; + String DARWIN[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central (Territ\u00f3rio do Norte)", "CST", + "Fuso hor\u00e1rio de ver\u00e3o central (Territ\u00f3rio do Norte)", "CST"}; + String DUBLIN[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT", + "Fuso hor\u00e1rio de ver\u00e3o da Irlanda", "IST"}; + String EAT[] = new String[] {"Fuso hor\u00e1rio da \u00c1frica Oriental", "EAT", + "Fuso hor\u00e1rio padr\u00e3o da \u00c1frica Oriental", "EAST"}; + String EASTER[] = new String[] {"Fuso hor\u00e1rio da Ilha de P\u00e1scoa", "EAST", + "Fuso hor\u00e1rio de ver\u00e3o da Ilha de P\u00e1scoa", "EASST"}; + String EET[] = new String[] {"Fuso hor\u00e1rio da Europa Oriental", "EET", + "Fuso hor\u00e1rio de ver\u00e3o da Europa Oriental", "EEST"}; + String EGT[] = new String[] {"Fuso hor\u00e1rio da Groenl\u00e2ndia Oriental", "EGT", + "Fuso hor\u00e1rio de ver\u00e3o da Groenl\u00e2ndia Oriental", "EGST"}; + String EST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental", "EST", + "Hor\u00e1rio de luz natural oriental", "EDT"}; + String EST_NSW[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Nova Gales do Sul)", "EST", + "Fuso hor\u00e1rio de ver\u00e3o oriental (Nova Gales do Sul)", "EST"}; + String GHMT[] = new String[] {"Fuso hor\u00e1rio do meridiano de Gana", "GMT", + "Fuso hor\u00e1rio de ver\u00e3o de Gana", "GHST"}; + String GAMBIER[] = new String[] {"Fuso hor\u00e1rio de Gambier", "GAMT", + "Fuso hor\u00e1rio de ver\u00e3o de Gambier", "GAMST"}; + String GMT[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT", + "Fuso hor\u00e1rio do meridiano de Greenwich", "GMT"}; + String GMTBST[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT", + "Fuso hor\u00e1rio de ver\u00e3o da Gr\u00e3-Bretanha", "BST"}; + String GST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do golfo", "GST", + "Hor\u00e1rio de luz natural do golfo", "GDT"}; + String HAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Hava\u00ed-Aleutian", "HAST", + "Hor\u00e1rio de luz natural do Hava\u00ed-Aleutian", "HADT"}; + String HKT[] = new String[] {"Fuso hor\u00e1rio de Hong Kong", "HKT", + "Fuso hor\u00e1rio de ver\u00e3o de Hong Kong", "HKST"}; + String HST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Hava\u00ed", "HST", + "Hor\u00e1rio de luz natural do Hava\u00ed", "HDT"}; + String ICT[] = new String[] {"Fuso hor\u00e1rio da Indochina", "ICT", + "Fuso hor\u00e1rio de ver\u00e3o da Indochina", "ICST"}; + String IRT[] = new String[] {"Fuso hor\u00e1rio do Ir\u00e3", "IRST", + "Hor\u00e1rio de luz natural do Ir\u00e3", "IRDT"}; + String ISRAEL[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Israel", "IST", + "Hor\u00e1rio de luz natural de Israel", "IDT"}; + String IST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da \u00cdndia", "IST", + "Hor\u00e1rio de luz natural da \u00cdndia", "IDT"}; + String JST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Jap\u00e3o", "JST", + "Hor\u00e1rio de luz natural do Jap\u00e3o", "JDT"}; + String KST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da Coreia", "KST", + "Hor\u00e1rio de luz natural da Coreia", "KDT"}; + String LORD_HOWE[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Lord Howe", "LHST", + "Fuso hor\u00e1rio de ver\u00e3o de Lord Howe", "LHST"}; + String MHT[] = new String[] {"Fuso hor\u00e1rio das Ilhas Marshall", "MHT", + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Marshall", "MHST"}; + String MSK[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Moscou", "MSK", + "Hor\u00e1rio de luz natural de Moscou", "MSD"}; + String MST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o das montanhas", "MST", + "Hor\u00e1rio de luz natural das montanhas", "MDT"}; + String MYT[] = new String[] {"Fuso hor\u00e1rio da Mal\u00e1sia", "MYT", + "Fuso hor\u00e1rio de ver\u00e3o da Mal\u00e1sia", "MYST"}; + String NORONHA[] = new String[] {"Fuso hor\u00e1rio de Fernando de Noronha", "FNT", + "Fuso hor\u00e1rio de ver\u00e3o de Fernando de Noronha", "FNST"}; + String NOVT[] = new String[] {"Fuso hor\u00e1rio de Novosibirsk", "NOVT", + "Fuso hor\u00e1rio de ver\u00e3o de Novosibirsk", "NOVST"}; + String NPT[] = new String[] {"Fuso hor\u00e1rio do Nepal", "NPT", + "Fuso hor\u00e1rio de ver\u00e3o do Nepal", "NPST"}; + String NST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Terra Nova", "NST", + "Hor\u00e1rio de luz natural de Terra Nova", "NDT"}; + String NZST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da Nova Zel\u00e2ndia", "NZST", + "Hor\u00e1rio de luz natural da Nova Zel\u00e2ndia", "NZDT"}; + String PITCAIRN[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Pitcairn", "PST", + "Hor\u00e1rio de luz natural de Pitcairn", "PDT"}; + String PKT[] = new String[] {"Fuso hor\u00e1rio do Paquist\u00e3o", "PKT", + "Fuso hor\u00e1rio de ver\u00e3o do Paquist\u00e3o", "PKST"}; + String PONT[] = new String[] {"Fuso hor\u00e1rio de Pohnpei", "PONT", + "Fuso hor\u00e1rio de ver\u00e3o de Pohnpei", "PONST"}; + String PST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Pac\u00edfico", "PST", + "Hor\u00e1rio de luz natural do Pac\u00edfico", "PDT"}; + String RST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental", "EST", + "Hor\u00e1rio de luz natural central", "CDT"}; + String SAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da \u00c1frica do Sul", "SAST", + "Fuso hor\u00e1rio de ver\u00e3o da \u00c1frica do Sul", "SAST"}; + String SBT[] = new String[] {"Fuso hor\u00e1rio das Ilhas Salom\u00e3o", "SBT", + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Salom\u00e3o", "SBST"}; + String SGT[] = new String[] {"Fuso hor\u00e1rio de Cingapura", "SGT", + "Fuso hor\u00e1rio de ver\u00e1 de Cingapura", "SGST"}; + String SLST[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT", + "Fuso hor\u00e1rio de ver\u00e3o de Serra Leoa", "SLST"}; + String TASMANIA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Tasm\u00e2nia)", "EST", + "Fuso hor\u00e1rio de ver\u00e3o oriental (Tasm\u00e2nia)", "EST"}; + String TMT[] = new String[] {"Fuso hor\u00e1rio do Turcomenist\u00e3o", "TMT", + "Fuso hor\u00e1rio de ver\u00e3o do Turcomenist\u00e3o", "TMST"}; + String TRUT[] = new String[] {"Fuso hor\u00e1rio de Chuuk", "CHUT", + "Fuso hor\u00e1rio de ver\u00e3o de Chuuk", "CHUST"}; + String ULAT[]= new String[] {"Fuso hor\u00e1rio de Ulan Bator", "ULAT", + "Fuso hor\u00e1rio de ver\u00e3o de Ulan Bator", "ULAST"}; + String WAT[] = new String[] {"Fuso hor\u00e1rio da \u00c1frica Ocidental", "WAT", + "Fuso hor\u00e1rio de ver\u00e3o da \u00c1frica Ocidental", "WAST"}; + String WET[] = new String[] {"Fuso hor\u00e1rio da Europa Ocidental", "WET", + "Fuso hor\u00e1rio de ver\u00e3o da Europa Ocidental", "WEST"}; + String WIT[] = new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Ocidental", "WIT", + "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Ocidental", "WIST"}; + String WST_AUS[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o ocidental (Austr\u00e1lia)", "WST", + "Fuso hor\u00e1rio de ver\u00e3o ocidental (Austr\u00e1lia)", "WST"}; + String SAMOA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Samoa", "SST", + "Hor\u00e1rio de luz natural de Samoa", "SDT"}; + String WST_SAMOA[] = new String[] {"Fuso hor\u00e1rio de Samoa Ocidental", "WST", + "Fuso hor\u00e1rio de ver\u00e3o de Samoa Ocidental", "WSST"}; + String ChST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Chamorro", "ChST", + "Hor\u00e1rio de luz natural de Chamorro", "ChDT"}; + String VICTORIA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Victoria)", "EST", + "Fuso hor\u00e1rio de ver\u00e3o oriental (Victoria)", "EST"}; + String UTC[] = new String[] {"Tempo universal coordenado", "UTC", + "Tempo universal coordenado", "UTC"}; + String UZT[] = new String[] {"Fuso hor\u00e1rio do Uzbequist\u00e3o", "UZT", + "Fuso hor\u00e1rio de ver\u00e3o do Uzbequist\u00e3o", "UZST"}; + String WART[] = new String[] {"Fuso hor\u00e1rio da Argentina Ocidental", "WART", + "Fuso hor\u00e1rio de ver\u00e3o da Argentina Ocidental", "WARST"}; + + + return new Object[][] { + {"America/Los_Angeles", PST}, + {"PST", PST}, + {"America/Denver", MST}, + {"MST", MST}, + {"America/Phoenix", MST}, + {"PNT", MST}, + {"America/Chicago", CST}, + {"CST", CST}, + {"America/New_York", EST}, + {"EST", EST}, + {"America/Indianapolis", EST}, + {"IET", EST}, + {"Pacific/Honolulu", HST}, + {"HST", HST}, + {"America/Anchorage", AKST}, + {"AST", AKST}, + {"America/Halifax", AST}, + {"America/St_Johns", NST}, + {"CNT", NST}, + {"Europe/Paris", CET}, + {"ECT", CET}, + {"GMT", GMT}, + {"Africa/Casablanca", WET}, + {"Asia/Jerusalem", ISRAEL}, + {"Asia/Tokyo", JST}, + {"JST", JST}, + {"Europe/Bucharest", EET}, + {"Asia/Shanghai", CTT}, + {"CTT", CTT}, + /* Don't change the order of the above zones + * to keep compatibility with the previous version. + */ + + {"ACT", DARWIN}, + {"AET", EST_NSW}, + {"AGT", AGT}, + {"ART", EET}, + {"Africa/Abidjan", GMT}, + {"Africa/Accra", GHMT}, + {"Africa/Addis_Ababa", EAT}, + {"Africa/Algiers", CET}, + {"Africa/Asmara", EAT}, + {"Africa/Asmera", EAT}, + {"Africa/Bamako", GMT}, + {"Africa/Bangui", WAT}, + {"Africa/Banjul", GMT}, + {"Africa/Bissau", GMT}, + {"Africa/Blantyre", CAT}, + {"Africa/Brazzaville", WAT}, + {"Africa/Bujumbura", CAT}, + {"Africa/Cairo", EET}, + {"Africa/Ceuta", CET}, + {"Africa/Conakry", GMT}, + {"Africa/Dakar", GMT}, + {"Africa/Dar_es_Salaam", EAT}, + {"Africa/Djibouti", EAT}, + {"Africa/Douala", WAT}, + {"Africa/El_Aaiun", WET}, + {"Africa/Freetown", SLST}, + {"Africa/Gaborone", CAT}, + {"Africa/Harare", CAT}, + {"Africa/Johannesburg", SAST}, + {"Africa/Kampala", EAT}, + {"Africa/Khartoum", EAT}, + {"Africa/Kigali", CAT}, + {"Africa/Kinshasa", WAT}, + {"Africa/Lagos", WAT}, + {"Africa/Libreville", WAT}, + {"Africa/Lome", GMT}, + {"Africa/Luanda", WAT}, + {"Africa/Lubumbashi", CAT}, + {"Africa/Lusaka", CAT}, + {"Africa/Malabo", WAT}, + {"Africa/Maputo", CAT}, + {"Africa/Maseru", SAST}, + {"Africa/Mbabane", SAST}, + {"Africa/Mogadishu", EAT}, + {"Africa/Monrovia", GMT}, + {"Africa/Nairobi", EAT}, + {"Africa/Ndjamena", WAT}, + {"Africa/Niamey", WAT}, + {"Africa/Nouakchott", GMT}, + {"Africa/Ouagadougou", GMT}, + {"Africa/Porto-Novo", WAT}, + {"Africa/Sao_Tome", GMT}, + {"Africa/Timbuktu", GMT}, + {"Africa/Tripoli", EET}, + {"Africa/Tunis", CET}, + {"Africa/Windhoek", WAT}, + {"America/Adak", HAST}, + {"America/Anguilla", AST}, + {"America/Antigua", AST}, + {"America/Araguaina", BRT}, + {"America/Argentina/Buenos_Aires", AGT}, + {"America/Argentina/Catamarca", AGT}, + {"America/Argentina/ComodRivadavia", AGT}, + {"America/Argentina/Cordoba", AGT}, + {"America/Argentina/Jujuy", AGT}, + {"America/Argentina/La_Rioja", AGT}, + {"America/Argentina/Mendoza", AGT}, + {"America/Argentina/Rio_Gallegos", AGT}, + {"America/Argentina/Salta", AGT}, + {"America/Argentina/San_Juan", AGT}, + {"America/Argentina/San_Luis", WART}, + {"America/Argentina/Tucuman", AGT}, + {"America/Argentina/Ushuaia", AGT}, + {"America/Aruba", AST}, + {"America/Asuncion", new String[] {"Fuso hor\u00e1rio do Paraguai", "PYT", + "Fuso hor\u00e1rio de ver\u00e3o do Paraguai", "PYST"}}, + {"America/Atikokan", EST}, + {"America/Atka", HAST}, + {"America/Bahia", BRT}, + {"America/Bahia_Banderas", CST}, + {"America/Barbados", AST}, + {"America/Belem", BRT}, + {"America/Belize", CST}, + {"America/Blanc-Sablon", AST}, + {"America/Boa_Vista", AMT}, + {"America/Bogota", new String[] {"Fuso hor\u00e1rio da Col\u00f4mbia", "COT", + "Fuso hor\u00e1rio de ver\u00e3o da Col\u00f4mbia", "COST"}}, + {"America/Boise", MST}, + {"America/Buenos_Aires", AGT}, + {"America/Cambridge_Bay", MST}, + {"America/Campo_Grande", AMT}, + {"America/Cancun", CST}, + {"America/Caracas", new String[] {"Fuso hor\u00e1rio da Venezuela", "VET", + "Fuso hor\u00e1rio de ver\u00e3o da Venezuela", "VEST"}}, + {"America/Catamarca", AGT}, + {"America/Cayenne", new String[] {"Fuso hor\u00e1rio da Guiana Francesa", "GFT", + "Fuso hor\u00e1rio de ver\u00e3o da Guiana Francesa", "GFST"}}, + {"America/Cayman", EST}, + {"America/Chihuahua", MST}, + {"America/Coral_Harbour", EST}, + {"America/Cordoba", AGT}, + {"America/Costa_Rica", CST}, + {"America/Cuiaba", AMT}, + {"America/Curacao", AST}, + {"America/Danmarkshavn", GMT}, + {"America/Dawson", PST}, + {"America/Dawson_Creek", MST}, + {"America/Detroit", EST}, + {"America/Dominica", AST}, + {"America/Edmonton", MST}, + {"America/Eirunepe", AMT}, + {"America/El_Salvador", CST}, + {"America/Ensenada", PST}, + {"America/Fort_Wayne", EST}, + {"America/Fortaleza", BRT}, + {"America/Glace_Bay", AST}, + {"America/Godthab", new String[] {"Fuso hor\u00e1rio da Groenl\u00e2ndia Ocidental", "WGT", + "Fuso hor\u00e1rio de ver\u00e3o da Groenl\u00e2ndia Ocidental", "WGST"}}, + {"America/Goose_Bay", AST}, + {"America/Grand_Turk", EST}, + {"America/Grenada", AST}, + {"America/Guadeloupe", AST}, + {"America/Guatemala", CST}, + {"America/Guayaquil", new String[] {"Fuso hor\u00e1rio do Equador", "ECT", + "Fuso hor\u00e1rio de ver\u00e3o do Equador", "ECST"}}, + {"America/Guyana", new String[] {"Fuso hor\u00e1rio da Guiana", "GYT", + "Fuso hor\u00e1rio de ver\u00e3o da Guiana", "GYST"}}, + {"America/Havana", CUBA}, + {"America/Hermosillo", MST}, + {"America/Indiana/Indianapolis", EST}, + {"America/Indiana/Knox", CST}, + {"America/Indiana/Marengo", EST}, + {"America/Indiana/Petersburg", EST}, + {"America/Indiana/Tell_City", CST}, + {"America/Indiana/Vevay", EST}, + {"America/Indiana/Vincennes", EST}, + {"America/Indiana/Winamac", EST}, + {"America/Inuvik", MST}, + {"America/Iqaluit", EST}, + {"America/Jamaica", EST}, + {"America/Jujuy", AGT}, + {"America/Juneau", AKST}, + {"America/Kentucky/Louisville", EST}, + {"America/Kentucky/Monticello", EST}, + {"America/Knox_IN", CST}, + {"America/La_Paz", new String[] {"Fuso hor\u00e1rio da Bol\u00edvia", "BOT", + "Fuso hor\u00e1rio de ver\u00e3o da Bol\u00edvia", "BOST"}}, + {"America/Lima", new String[] {"Fuso hor\u00e1rio do Peru", "PET", + "Fuso hor\u00e1rio de ver\u00e3o do Peru", "PEST"}}, + {"America/Louisville", EST}, + {"America/Maceio", BRT}, + {"America/Managua", CST}, + {"America/Manaus", AMT}, + {"America/Marigot", AST}, + {"America/Martinique", AST}, + {"America/Mazatlan", MST}, + {"America/Mendoza", AGT}, + {"America/Menominee", CST}, + {"America/Merida", CST}, + {"America/Mexico_City", CST}, + {"America/Miquelon", new String[] {"Fuso hor\u00e1rio padr\u00e3o de S\u00e3o Pedro e Miquelon", "PMST", + "Hor\u00e1rio de luz natural de S\u00e3o Pedro e Miquelon", "PMDT"}}, + {"America/Moncton", AST}, + {"America/Montevideo", new String[] {"Fuso hor\u00e1rio do Uruguai", "UYT", + "Fuso hor\u00e1rio de ver\u00e3o do Uruguai", "UYST"}}, + {"America/Monterrey", CST}, + {"America/Montreal", EST}, + {"America/Montserrat", AST}, + {"America/Nassau", EST}, + {"America/Nipigon", EST}, + {"America/Nome", AKST}, + {"America/Noronha", NORONHA}, + {"America/North_Dakota/Center", CST}, + {"America/North_Dakota/New_Salem", CST}, + {"America/Panama", EST}, + {"America/Pangnirtung", EST}, + {"America/Paramaribo", new String[] {"Fuso hor\u00e1rio do Suriname", "SRT", + "Fuso hor\u00e1rio de ver\u00e3o do Suriname", "SRST"}}, + {"America/Port-au-Prince", EST}, + {"America/Port_of_Spain", AST}, + {"America/Porto_Acre", AMT}, + {"America/Porto_Velho", AMT}, + {"America/Puerto_Rico", AST}, + {"America/Rainy_River", CST}, + {"America/Rankin_Inlet", CST}, + {"America/Recife", BRT}, + {"America/Regina", CST}, + {"America/Resolute", RST}, + {"America/Rio_Branco", AMT}, + {"America/Rosario", AGT}, + {"America/Santarem", BRT}, + {"America/Santiago", CLT}, + {"America/Santo_Domingo", AST}, + {"America/Sao_Paulo", BRT}, + {"America/Scoresbysund", EGT}, + {"America/Shiprock", MST}, + {"America/St_Barthelemy", AST}, + {"America/St_Kitts", AST}, + {"America/St_Lucia", AST}, + {"America/St_Thomas", AST}, + {"America/St_Vincent", AST}, + {"America/Swift_Current", CST}, + {"America/Tegucigalpa", CST}, + {"America/Thule", AST}, + {"America/Thunder_Bay", EST}, + {"America/Tijuana", PST}, + {"America/Toronto", EST}, + {"America/Tortola", AST}, + {"America/Vancouver", PST}, + {"America/Virgin", AST}, + {"America/Whitehorse", PST}, + {"America/Winnipeg", CST}, + {"America/Yakutat", AKST}, + {"America/Yellowknife", MST}, + {"Antarctica/Casey", WST_AUS}, + {"Antarctica/Davis", new String[] {"Fuso hor\u00e1rio de Davis", "DAVT", + "Fuso hor\u00e1rio de ver\u00e3o de Davis", "DAVST"}}, + {"Antarctica/DumontDUrville", new String[] {"Fuso hor\u00e1rio de Dumont-d'Urville", "DDUT", + "Fuso hor\u00e1rio de ver\u00e3o de Dumont-d'Urville", "DDUST"}}, + {"Antarctica/Mawson", new String[] {"Fuso hor\u00e1rio de Mawson", "MAWT", + "Fuso hor\u00e1rio de ver\u00e3o de Mawson", "MAWST"}}, + {"Antarctica/McMurdo", NZST}, + {"Antarctica/Palmer", CLT}, + {"Antarctica/Rothera", new String[] {"Fuso hor\u00e1rio de Rothera", "ROTT", + "Fuso hor\u00e1rio de ver\u00e3o de Rothera", "ROTST"}}, + {"Antarctica/South_Pole", NZST}, + {"Antarctica/Syowa", new String[] {"Fuso hor\u00e1rio de Syowa", "SYOT", + "Fuso hor\u00e1rio de ver\u00e3o de Syowa", "SYOST"}}, + {"Antarctica/Vostok", new String[] {"Fuso hor\u00e1rio de Vostok", "VOST", + "Fuso hor\u00e1rio de ver\u00e3o de Vostok", "VOSST"}}, + {"Arctic/Longyearbyen", CET}, + {"Asia/Aden", ARAST}, + {"Asia/Almaty", new String[] {"Fuso hor\u00e1rio de Alma-Ata", "ALMT", + "Fuso hor\u00e1rio de ver\u00e3o de Alma-Ata", "ALMST"}}, + {"Asia/Amman", EET}, + {"Asia/Anadyr", new String[] {"Fuso hor\u00e1rio de Anadyr", "ANAT", + "Fuso hor\u00e1rio de ver\u00e3o de Anadyr", "ANAST"}}, + {"Asia/Aqtau", new String[] {"Fuso hor\u00e1rio de Aqtau", "AQTT", + "Fuso hor\u00e1rio de ver\u00e3o de Aqtau", "AQTST"}}, + {"Asia/Aqtobe", new String[] {"Fuso hor\u00e1rio de Aqtobe", "AQTT", + "Fuso hor\u00e1rio de ver\u00e3o de Aqtobe", "AQTST"}}, + {"Asia/Ashgabat", TMT}, + {"Asia/Ashkhabad", TMT}, + {"Asia/Baghdad", ARAST}, + {"Asia/Bahrain", ARAST}, + {"Asia/Baku", new String[] {"Fuso hor\u00e1rio do Azerbaij\u00e3o", "AZT", + "Fuso hor\u00e1rio de ver\u00e3o do Azerbaij\u00e3o", "AZST"}}, + {"Asia/Bangkok", ICT}, + {"Asia/Beirut", EET}, + {"Asia/Bishkek", new String[] {"Fuso hor\u00e1rio do Quirguist\u00e3o", "KGT", + "Fuso hor\u00e1rio de ver\u00e3o do Quirguist\u00e3o", "KGST"}}, + {"Asia/Brunei", new String[] {"Fuso hor\u00e1rio de Brunei", "BNT", + "Fuso hor\u00e1rio de ver\u00e3o de Brunei", "BNST"}}, + {"Asia/Calcutta", IST}, + {"Asia/Choibalsan", new String[] {"Fuso hor\u00e1rio de Choibalsan", "CHOT", + "Fuso hor\u00e1rio de ver\u00e3o de Choibalsan", "CHOST"}}, + {"Asia/Chongqing", CTT}, + {"Asia/Chungking", CTT}, + {"Asia/Colombo", IST}, + {"Asia/Dacca", BDT}, + {"Asia/Dhaka", BDT}, + {"Asia/Dili", new String[] {"Fuso hor\u00e1rio do Timor-Leste", "TLT", + "Fuso hor\u00e1rio de ver\u00e3o do Timor-Leste", "TLST"}}, + {"Asia/Damascus", EET}, + {"Asia/Dubai", GST}, + {"Asia/Dushanbe", new String[] {"Fuso hor\u00e1rio do Tadjiquist\u00e3o", "TJT", + "Fuso hor\u00e1rio de ver\u00e3o do Tadjiquist\u00e3o", "TJST"}}, + {"Asia/Gaza", EET}, + {"Asia/Harbin", CTT}, + {"Asia/Ho_Chi_Minh", ICT}, + {"Asia/Hong_Kong", HKT}, + {"Asia/Hovd", new String[] {"Fuso hor\u00e1rio de Hovd", "HOVT", + "Fuso hor\u00e1rio de ver\u00e3o de Hovd", "HOVST"}}, + {"Asia/Irkutsk", new String[] {"Fuso hor\u00e1rio de Irkutsk", "IRKT", + "Fuso hor\u00e1rio de ver\u00e3o de Irkutsk", "IRKST"}}, + {"Asia/Istanbul", EET}, + {"Asia/Jakarta", WIT}, + {"Asia/Jayapura", new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Oriental", "EIT", + "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Oriental", "EIST"}}, + {"Asia/Kabul", new String[] {"Fuso hor\u00e1rio do Afeganist\u00e3o", "AFT", + "Fuso hor\u00e1rio de ver\u00e3o do Afeganist\u00e3o", "AFST"}}, + {"Asia/Kamchatka", new String[] {"Fuso hor\u00e1rio de Petropavlovsk-Kamchatski", "PETT", + "Fuso hor\u00e1rio de ver\u00e3o de Petropavlovsk-Kamchatski", "PETST"}}, + {"Asia/Karachi", PKT}, + {"Asia/Kashgar", CTT}, + {"Asia/Kathmandu", NPT}, + {"Asia/Katmandu", NPT}, + {"Asia/Kolkata", IST}, + {"Asia/Krasnoyarsk", new String[] {"Fuso hor\u00e1rio de Krasnoyarsk", "KRAT", + "Fuso hor\u00e1rio de ver\u00e3o de Krasnoyarsk", "KRAST"}}, + {"Asia/Kuala_Lumpur", MYT}, + {"Asia/Kuching", MYT}, + {"Asia/Kuwait", ARAST}, + {"Asia/Macao", CTT}, + {"Asia/Macau", CTT}, + {"Asia/Magadan", new String[] {"Fuso hor\u00e1rio de Magadan", "MAGT", + "Fuso hor\u00e1rio de ver\u00e3o de Magadan", "MAGST"}}, + {"Asia/Makassar", CIT}, + {"Asia/Manila", new String[] {"Fuso hor\u00e1rio das Filipinas", "PHT", + "Fuso hor\u00e1rio de ver\u00e3o das Filipinas", "PHST"}}, + {"Asia/Muscat", GST}, + {"Asia/Nicosia", EET}, + {"Asia/Novokuznetsk", NOVT}, + {"Asia/Novosibirsk", NOVT}, + {"Asia/Oral", new String[] {"Fuso hor\u00e1rio de Uralsk", "ORAT", + "Fuso hor\u00e1rio de ver\u00e3o de Uralsk", "ORAST"}}, + {"Asia/Omsk", new String[] {"Fuso hor\u00e1rio de Omsk", "OMST", + "Fuso hor\u00e1rio de ver\u00e3o de Omsk", "OMSST"}}, + {"Asia/Phnom_Penh", ICT}, + {"Asia/Pontianak", WIT}, + {"Asia/Pyongyang", KST}, + {"Asia/Qatar", ARAST}, + {"Asia/Qyzylorda", new String[] {"Fuso hor\u00e1rio de Kizil-Orda", "QYZT", + "Fuso hor\u00e1rio de ver\u00e3o de Kizil-Orda", "QYZST"}}, + {"Asia/Rangoon", new String[] {"Fuso hor\u00e1rio de Mianmar", "MMT", + "Fuso hor\u00e1rio de ver\u00e3o de Mianmar", "MMST"}}, + {"Asia/Riyadh", ARAST}, + {"Asia/Saigon", ICT}, + {"Asia/Sakhalin", new String[] {"Fuso hor\u00e1rio de Sakhalina", "SAKT", + "Fuso hor\u00e1rio de ver\u00e3o de Sakhalina", "SAKST"}}, + {"Asia/Samarkand", UZT}, + {"Asia/Seoul", KST}, + {"Asia/Singapore", SGT}, + {"Asia/Taipei", CTT}, + {"Asia/Tel_Aviv", ISRAEL}, + {"Asia/Tashkent", UZT}, + {"Asia/Tbilisi", new String[] {"Fuso hor\u00e1rio da Ge\u00f3rgia", "GET", + "Fuso hor\u00e1rio de ver\u00e3o da Ge\u00f3rgia", "GEST"}}, + {"Asia/Tehran", IRT}, + {"Asia/Thimbu", BTT}, + {"Asia/Thimphu", BTT}, + {"Asia/Ujung_Pandang", CIT}, + {"Asia/Ulaanbaatar", ULAT}, + {"Asia/Ulan_Bator", ULAT}, + {"Asia/Urumqi", CTT}, + {"Asia/Vientiane", ICT}, + {"Asia/Vladivostok", new String[] {"Fuso hor\u00e1rio de Vladivostok", "VLAT", + "Fuso hor\u00e1rio de ver\u00e3o de Vladivostok", "VLAST"}}, + {"Asia/Yakutsk", new String[] {"Fuso hor\u00e1rio de Yakutsk", "YAKT", + "Fuso hor\u00e1rio de ver\u00e3o de Yakutsk", "YAKST"}}, + {"Asia/Yekaterinburg", new String[] {"Fuso hor\u00e1rio de Yekaterinburgo", "YEKT", + "Fuso hor\u00e1rio de ver\u00e3o de Yekaterinburgo", "YEKST"}}, + {"Asia/Yerevan", ARMT}, + {"Atlantic/Azores", new String[] {"Fuso hor\u00e1rio das A\u00e7ores", "AZOT", + "Fuso hor\u00e1rio de ver\u00e3o das A\u00e7ores", "AZOST"}}, + {"Atlantic/Bermuda", AST}, + {"Atlantic/Canary", WET}, + {"Atlantic/Cape_Verde", new String[] {"Fuso hor\u00e1rio de Cabo Verde", "CVT", + "Fuso hor\u00e1rio de ver\u00e3o de Cabo Verde", "CVST"}}, + {"Atlantic/Faeroe", WET}, + {"Atlantic/Faroe", WET}, + {"Atlantic/Jan_Mayen", CET}, + {"Atlantic/Madeira", WET}, + {"Atlantic/Reykjavik", GMT}, + {"Atlantic/South_Georgia", new String[] {"Fuso hor\u00e1rio padr\u00e3o da Ge\u00f3rgia do Sul", "GST", + "Hor\u00e1rio de luz natural da Ge\u00f3rgia do Sul", "GDT"}}, + {"Atlantic/St_Helena", GMT}, + {"Atlantic/Stanley", new String[] {"Fuso hor\u00e1rio das Ilhas Falkland", "FKT", + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Falkland", "FKST"}}, + {"Australia/ACT", EST_NSW}, + {"Australia/Adelaide", ADELAIDE}, + {"Australia/Brisbane", BRISBANE}, + {"Australia/Broken_Hill", BROKEN_HILL}, + {"Australia/Canberra", EST_NSW}, + {"Australia/Currie", EST_NSW}, + {"Australia/Darwin", DARWIN}, + {"Australia/Eucla", new String[] {"Fuso hor\u00e1rio ocidental central (Austr\u00e1lia)", "CWST", + "Fuso hor\u00e1rio de ver\u00e3o ocidental central (Austr\u00e1lia)", "CWST"}}, + {"Australia/Hobart", TASMANIA}, + {"Australia/LHI", LORD_HOWE}, + {"Australia/Lindeman", BRISBANE}, + {"Australia/Lord_Howe", LORD_HOWE}, + {"Australia/Melbourne", VICTORIA}, + {"Australia/North", DARWIN}, + {"Australia/NSW", EST_NSW}, + {"Australia/Perth", WST_AUS}, + {"Australia/Queensland", BRISBANE}, + {"Australia/South", ADELAIDE}, + {"Australia/Sydney", EST_NSW}, + {"Australia/Tasmania", TASMANIA}, + {"Australia/Victoria", VICTORIA}, + {"Australia/West", WST_AUS}, + {"Australia/Yancowinna", BROKEN_HILL}, + {"BET", BRT}, + {"BST", BDT}, + {"Brazil/Acre", AMT}, + {"Brazil/DeNoronha", NORONHA}, + {"Brazil/East", BRT}, + {"Brazil/West", AMT}, + {"Canada/Atlantic", AST}, + {"Canada/Central", CST}, + {"Canada/East-Saskatchewan", CST}, + {"Canada/Eastern", EST}, + {"Canada/Mountain", MST}, + {"Canada/Newfoundland", NST}, + {"Canada/Pacific", PST}, + {"Canada/Yukon", PST}, + {"Canada/Saskatchewan", CST}, + {"CAT", CAT}, + {"CET", CET}, + {"Chile/Continental", CLT}, + {"Chile/EasterIsland", EASTER}, + {"CST6CDT", CST}, + {"Cuba", CUBA}, + {"EAT", EAT}, + {"EET", EET}, + {"Egypt", EET}, + {"Eire", DUBLIN}, + {"EST5EDT", EST}, + {"Etc/Greenwich", GMT}, + {"Etc/UCT", UTC}, + {"Etc/Universal", UTC}, + {"Etc/UTC", UTC}, + {"Etc/Zulu", UTC}, + {"Europe/Amsterdam", CET}, + {"Europe/Andorra", CET}, + {"Europe/Athens", EET}, + {"Europe/Belfast", GMTBST}, + {"Europe/Belgrade", CET}, + {"Europe/Berlin", CET}, + {"Europe/Bratislava", CET}, + {"Europe/Brussels", CET}, + {"Europe/Budapest", CET}, + {"Europe/Chisinau", EET}, + {"Europe/Copenhagen", CET}, + {"Europe/Dublin", DUBLIN}, + {"Europe/Gibraltar", CET}, + {"Europe/Guernsey", GMTBST}, + {"Europe/Helsinki", EET}, + {"Europe/Isle_of_Man", GMTBST}, + {"Europe/Istanbul", EET}, + {"Europe/Jersey", GMTBST}, + {"Europe/Kaliningrad", EET}, + {"Europe/Kiev", EET}, + {"Europe/Lisbon", WET}, + {"Europe/Ljubljana", CET}, + {"Europe/London", GMTBST}, + {"Europe/Luxembourg", CET}, + {"Europe/Madrid", CET}, + {"Europe/Malta", CET}, + {"Europe/Mariehamn", EET}, + {"Europe/Minsk", EET}, + {"Europe/Monaco", CET}, + {"Europe/Moscow", MSK}, + {"Europe/Nicosia", EET}, + {"Europe/Oslo", CET}, + {"Europe/Podgorica", CET}, + {"Europe/Prague", CET}, + {"Europe/Riga", EET}, + {"Europe/Rome", CET}, + {"Europe/Samara", new String[] {"Fuso hor\u00e1rio de Samara", "SAMT", + "Fuso hor\u00e1rio de ver\u00e3o de Samara", "SAMST"}}, + {"Europe/San_Marino", CET}, + {"Europe/Sarajevo", CET}, + {"Europe/Simferopol", EET}, + {"Europe/Skopje", CET}, + {"Europe/Sofia", EET}, + {"Europe/Stockholm", CET}, + {"Europe/Tallinn", EET}, + {"Europe/Tirane", CET}, + {"Europe/Tiraspol", EET}, + {"Europe/Uzhgorod", EET}, + {"Europe/Vaduz", CET}, + {"Europe/Vatican", CET}, + {"Europe/Vienna", CET}, + {"Europe/Vilnius", EET}, + {"Europe/Volgograd", new String[] {"Fuso hor\u00e1rio de Volgogrado", "VOLT", + "Fuso hor\u00e1rio de ver\u00e3o de Volgogrado", "VOLST"}}, + {"Europe/Warsaw", CET}, + {"Europe/Zagreb", CET}, + {"Europe/Zaporozhye", EET}, + {"Europe/Zurich", CET}, + {"GB", GMTBST}, + {"GB-Eire", GMTBST}, + {"Greenwich", GMT}, + {"Hongkong", HKT}, + {"Iceland", GMT}, + {"Iran", IRT}, + {"IST", IST}, + {"Indian/Antananarivo", EAT}, + {"Indian/Chagos", new String[] {"Fuso hor\u00e1rio dos territ\u00f3rios do Oceano \u00cdndico", "IOT", + "Fuso hor\u00e1rio de ver\u00e3o dos territ\u00f3rios do Oceano \u00cdndico", "IOST"}}, + {"Indian/Christmas", new String[] {"Fuso hor\u00e1rio das Ilhas Christmas", "CXT", + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Christmas", "CXST"}}, + {"Indian/Cocos", new String[] {"Fuso hor\u00e1rio das Ilhas Cocos", "CCT", + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Cocos", "CCST"}}, + {"Indian/Comoro", EAT}, + {"Indian/Kerguelen", new String[] {"Fuso hor\u00e1rio das Terras Austrais e Ant\u00e1rticas Francesas", "TFT", + "Fuso hor\u00e1rio de ver\u00e3o das Terras Austrais e Ant\u00e1rticas Francesas", "TFST"}}, + {"Indian/Mahe", new String[] {"Fuso hor\u00e1rio das Seychelles", "SCT", + "Fuso hor\u00e1rio de ver\u00e3o das Seychelles", "SCST"}}, + {"Indian/Maldives", new String[] {"Fuso hor\u00e1rio das Maldivas", "MVT", + "Fuso hor\u00e1rio de ver\u00e3o das Maldivas", "MVST"}}, + {"Indian/Mauritius", new String[] {"Fuso hor\u00e1rio das Ilhas Maur\u00edcio", "MUT", + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Maur\u00edcio", "MUST"}}, + {"Indian/Mayotte", EAT}, + {"Indian/Reunion", new String[] {"Fuso hor\u00e1rio de Reuni\u00e3o", "RET", + "Fuso hor\u00e1rio de ver\u00e3o de Reuni\u00e3o", "REST"}}, + {"Israel", ISRAEL}, + {"Jamaica", EST}, + {"Japan", JST}, + {"Kwajalein", MHT}, + {"Libya", EET}, + {"MET", new String[] {"Fuso hor\u00e1rio da Europa M\u00e9dia", "MET", + "Fuso hor\u00e1rio de ver\u00e3o da Europa M\u00e9dia", "MEST"}}, + {"Mexico/BajaNorte", PST}, + {"Mexico/BajaSur", MST}, + {"Mexico/General", CST}, + {"MIT", WST_SAMOA}, + {"MST7MDT", MST}, + {"Navajo", MST}, + {"NET", ARMT}, + {"NST", NZST}, + {"NZ", NZST}, + {"NZ-CHAT", CHAST}, + {"PLT", PKT}, + {"Portugal", WET}, + {"PRT", AST}, + {"Pacific/Apia", WST_SAMOA}, + {"Pacific/Auckland", NZST}, + {"Pacific/Chatham", CHAST}, + {"Pacific/Chuuk", TRUT}, + {"Pacific/Easter", EASTER}, + {"Pacific/Efate", new String[] {"Fuso hor\u00e1rio de Vanuatu", "VUT", + "Fuso hor\u00e1rio de ver\u00e3o de Vanuatu", "VUST"}}, + {"Pacific/Enderbury", new String[] {"Fuso hor\u00e1rio das Ilhas F\u00e9nix", "PHOT", + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas F\u00e9nix", "PHOST"}}, + {"Pacific/Fakaofo", new String[] {"Fuso hor\u00e1rio de Tokelau", "TKT", + "Fuso hor\u00e1rio de ver\u00e3o de Tokelau", "TKST"}}, + {"Pacific/Fiji", new String[] {"Fuso hor\u00e1rio de Fiji", "FJT", + "Fuso hor\u00e1rio de ver\u00e3o de Fiji", "FJST"}}, + {"Pacific/Funafuti", new String[] {"Fuso hor\u00e1rio de Tuvalu", "TVT", + "Fuso hor\u00e1rio de ver\u00e3o de Tuvalu", "TVST"}}, + {"Pacific/Galapagos", new String[] {"Fuso hor\u00e1rio das Ilhas Gal\u00e1pagos", "GALT", + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Gal\u00e1pagos", "GALST"}}, + {"Pacific/Gambier", GAMBIER}, + {"Pacific/Guadalcanal", SBT}, + {"Pacific/Guam", ChST}, + {"Pacific/Johnston", HST}, + {"Pacific/Kiritimati", new String[] {"Fuso hor\u00e1rio das Esp\u00f3rades Equatoriais", "LINT", + "Fuso hor\u00e1rio de ver\u00e3o das Esp\u00f3rades Equatoriais", "LINST"}}, + {"Pacific/Kosrae", new String[] {"Fuso hor\u00e1rio de Kosrae", "KOST", + "Fuso hor\u00e1rio de ver\u00e3o de Kosrae", "KOSST"}}, + {"Pacific/Kwajalein", MHT}, + {"Pacific/Majuro", MHT}, + {"Pacific/Marquesas", new String[] {"Fuso hor\u00e1rio das Ilhas Marquesas", "MART", + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Marquesas", "MARST"}}, + {"Pacific/Midway", SAMOA}, + {"Pacific/Nauru", new String[] {"Fuso hor\u00e1rio de Nauru", "NRT", + "Fuso hor\u00e1rio de ver\u00e3o de Nauru", "NRST"}}, + {"Pacific/Niue", new String[] {"Fuso hor\u00e1rio de Niue", "NUT", + "Fuso hor\u00e1rio de ver\u00e3o de Niue", "NUST"}}, + {"Pacific/Norfolk", new String[] {"Fuso hor\u00e1rio da Ilha de Norfolk", "NFT", + "Fuso hor\u00e1rio de ver\u00e3o da Ilha de Norfolk", "NFST"}}, + {"Pacific/Noumea", new String[] {"Fuso hor\u00e1rio da Nova Caled\u00f4nia", "NCT", + "Fuso hor\u00e1rio de ver\u00e3o da Nova Caled\u00f4nia", "NCST"}}, + {"Pacific/Pago_Pago", SAMOA}, + {"Pacific/Palau", new String[] {"Fuso hor\u00e1rio de Palau", "PWT", + "Fuso hor\u00e1rio de ver\u00e3o de Palau", "PWST"}}, + {"Pacific/Pitcairn", PITCAIRN}, + {"Pacific/Pohnpei", PONT}, + {"Pacific/Ponape", PONT}, + {"Pacific/Port_Moresby", new String[] {"Fuso hor\u00e1rio de Papua-Nova Guin\u00e9", "PGT", + "Fuso hor\u00e1rio de ver\u00e3o de Papua-Nova Guin\u00e9", "PGST"}}, + {"Pacific/Rarotonga", new String[] {"Fuso hor\u00e1rio das Ilhas Cook", "CKT", + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Cook", "CKHST"}}, + {"Pacific/Saipan", ChST}, + {"Pacific/Samoa", SAMOA}, + {"Pacific/Tahiti", new String[] {"Fuso hor\u00e1rio do Taiti", "TAHT", + "Fuso hor\u00e1rio de ver\u00e3o do Taiti", "TAHST"}}, + {"Pacific/Tarawa", new String[] {"Fuso hor\u00e1rio das Ilhas Gilbert", "GILT", + "Fuso hor\u00e1rio de ver\u00e3o das Ilhas Gilbert", "GILST"}}, + {"Pacific/Tongatapu", new String[] {"Fuso hor\u00e1rio de Tonga", "TOT", + "Fuso hor\u00e1rio de ver\u00e3o de Tonga", "TOST"}}, + {"Pacific/Truk", TRUT}, + {"Pacific/Wake", new String[] {"Fuso hor\u00e1rio de Wake", "WAKT", + "Fuso hor\u00e1rio de ver\u00e3o de Wake", "WAKST"}}, + {"Pacific/Wallis", new String[] {"Fuso hor\u00e1rio de Wallis e Futuna", "WFT", + "Fuso hor\u00e1rio de ver\u00e3o de Wallis e Futuna", "WFST"}}, + {"Pacific/Yap", TRUT}, + {"Poland", CET}, + {"PRC", CTT}, + {"PST8PDT", PST}, + {"ROK", KST}, + {"Singapore", SGT}, + {"SST", SBT}, + {"SystemV/AST4", AST}, + {"SystemV/AST4ADT", AST}, + {"SystemV/CST6", CST}, + {"SystemV/CST6CDT", CST}, + {"SystemV/EST5", EST}, + {"SystemV/EST5EDT", EST}, + {"SystemV/HST10", HST}, + {"SystemV/MST7", MST}, + {"SystemV/MST7MDT", MST}, + {"SystemV/PST8", PST}, + {"SystemV/PST8PDT", PST}, + {"SystemV/YST9", AKST}, + {"SystemV/YST9YDT", AKST}, + {"Turkey", EET}, + {"UCT", UTC}, + {"Universal", UTC}, + {"US/Alaska", AKST}, + {"US/Aleutian", HAST}, + {"US/Arizona", MST}, + {"US/Central", CST}, + {"US/Eastern", EST}, + {"US/Hawaii", HST}, + {"US/Indiana-Starke", CST}, + {"US/East-Indiana", EST}, + {"US/Michigan", EST}, + {"US/Mountain", MST}, + {"US/Pacific", PST}, + {"US/Pacific-New", PST}, + {"US/Samoa", SAMOA}, + {"UTC", UTC}, + {"VST", ICT}, + {"W-SU", MSK}, + {"WET", WET}, + {"Zulu", UTC}, + }; + } +} + + diff --git a/jdk/src/share/demo/applets/NervousText/example1.html b/jdk/src/share/demo/applets/NervousText/example1.html index 38e4f840da5..96013da6f45 100644 --- a/jdk/src/share/demo/applets/NervousText/example1.html +++ b/jdk/src/share/demo/applets/NervousText/example1.html @@ -1,7 +1,7 @@ Nervous Text 1.1


      - +
      The source. diff --git a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/J2DBench.java b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/J2DBench.java index 193264670d5..c4d50554cd5 100644 --- a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/J2DBench.java +++ b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/J2DBench.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -75,7 +75,8 @@ public class J2DBench { static JFrame guiFrame; - static final SimpleDateFormat sdf = new SimpleDateFormat("MM.dd.yyyy 'at' HH:mm aaa z"); + static final SimpleDateFormat sdf = + new SimpleDateFormat("MM.dd.yyyy 'at' HH:mm aaa z"); public static void init() { progoptroot = new Group("prog", "Program Options"); @@ -176,6 +177,8 @@ public class J2DBench { public static void main(String argv[]) { init(); TestEnvironment.init(); + Result.init(); + Destinations.init(); GraphicsTests.init(); RenderTests.init(); @@ -323,7 +326,7 @@ public class J2DBench { } else if (type.equalsIgnoreCase("m")) { multiplyWith = 60; } else { - System.out.println("Invalid \"-loop\" option specified."); + System.err.println("Invalid \"-loop\" option specified."); usage(1); } @@ -331,32 +334,20 @@ public class J2DBench { try { val = Integer.parseInt(argv[i].substring(0, argv[i].length() - 1)); } catch(Exception e) { - System.out.println("Invalid \"-loop\" option specified."); + System.err.println("Invalid \"-loop\" option specified."); usage(1); } requiredLoopTime = val * multiplyWith * 1000; } - } else if (arg.length() > 7 && - arg.substring(0, 7).equalsIgnoreCase("-report")) - { - for (int j = 7; j < arg.length(); j++) { - char c = arg.charAt(j); - switch (c) { - case 'N': Result.unitScale = Result.UNITS_WHOLE; break; - case 'M': Result.unitScale = Result.UNITS_MILLIONS; break; - case 'K': Result.unitScale = Result.UNITS_THOUSANDS; break; - case 'A': Result.unitScale = Result.UNITS_AUTO; break; - case 'U': Result.useUnits = true; break; - case 'O': Result.useUnits = false; break; - case 's': Result.timeScale = Result.SECONDS_WHOLE; break; - case 'm': Result.timeScale = Result.SECONDS_MILLIS; break; - case 'u': Result.timeScale = Result.SECONDS_MICROS; break; - case 'n': Result.timeScale = Result.SECONDS_NANOS; break; - case 'a': Result.timeScale = Result.SECONDS_AUTO; break; - case '/': Result.invertRate = !Result.invertRate; break; - } + } else if (arg.length() > 8 && + arg.substring(0, 8).equalsIgnoreCase("-report:")) + { + String error = Result.parseRateOpt(arg.substring(8)); + if (error != null) { + System.err.println("Invalid rate: "+error); + usage(1); } } else { String reason = Group.root.setOption(arg); @@ -411,7 +402,7 @@ public class J2DBench { writer.flush(); } catch(IOException ioe) { ioe.printStackTrace(); - System.out.println("\nERROR : Could not create Loop-Report. Exit"); + System.err.println("\nERROR : Could not create Loop-Report. Exit"); System.exit(1); } } @@ -466,7 +457,7 @@ public class J2DBench { } while(J2DBench.looping); - if(J2DBench.looping) { + if (J2DBench.looping) { writer.println(""); writer.flush(); writer.close(); diff --git a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/Option.java b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/Option.java index 8ca540337f3..1266eda9a61 100644 --- a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/Option.java +++ b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/Option.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -170,7 +170,7 @@ public abstract class Option extends Node implements Modifier { updateGUI(); jcb.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { - if (e.getStateChange() == e.SELECTED) { + if (e.getStateChange() == ItemEvent.SELECTED) { JComboBox jcb = (JComboBox) e.getItemSelectable(); value = jcb.getSelectedIndex(); if (J2DBench.verbose.isEnabled()) { @@ -261,7 +261,7 @@ public abstract class Option extends Node implements Modifier { updateGUI(); jcb.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { - value = (e.getStateChange() == e.SELECTED); + value = (e.getStateChange() == ItemEvent.SELECTED); if (J2DBench.verbose.isEnabled()) { System.out.println(getOptionString()); } @@ -569,8 +569,6 @@ public abstract class Option extends Node implements Modifier { } public String setValueFromString(String value) { - int prev = 0; - int next = 0; int enabled = 0; StringTokenizer st = new StringTokenizer(value, ","); while (st.hasMoreTokens()) { @@ -588,7 +586,6 @@ public abstract class Option extends Node implements Modifier { if (s != null) { return "Bad value in list ("+s+")"; } - prev = next+1; } this.enabled = enabled; updateGUI(); @@ -623,6 +620,175 @@ public abstract class Option extends Node implements Modifier { } } + public static class ObjectChoice extends Option { + int size; + String optionnames[]; + Object optionvalues[]; + String abbrevnames[]; + String descnames[]; + int defaultselected; + int selected; + JPanel jp; + JComboBox jcombo; + + public ObjectChoice(Group parent, String nodeName, String description, + String optionnames[], + Object optionvalues[], + String abbrevnames[], + String descnames[], + int defaultselected) + { + this(parent, nodeName, description, + Math.min(Math.min(optionnames.length, + optionvalues.length), + Math.min(abbrevnames.length, + descnames.length)), + optionnames, optionvalues, + abbrevnames, descnames, defaultselected); + } + + public ObjectChoice(Group parent, String nodeName, String description, + int size, + String optionnames[], + Object optionvalues[], + String abbrevnames[], + String descnames[], + int defaultselected) + { + super(parent, nodeName, description); + this.size = size; + this.optionnames = trim(optionnames, size); + this.optionvalues = trim(optionvalues, size); + this.abbrevnames = trim(abbrevnames, size); + this.descnames = trim(descnames, size); + this.selected = this.defaultselected = defaultselected; + } + + private static String[] trim(String list[], int size) { + if (list.length == size) { + return list; + } + String newlist[] = new String[size]; + System.arraycopy(list, 0, newlist, 0, size); + return newlist; + } + + private static Object[] trim(Object list[], int size) { + if (list.length == size) { + return list; + } + Object newlist[] = new Object[size]; + System.arraycopy(list, 0, newlist, 0, size); + return newlist; + } + + public void restoreDefault() { + if (selected != defaultselected) { + selected = defaultselected; + updateGUI(); + } + } + + public void updateGUI() { + if (jcombo != null) { + jcombo.setSelectedIndex(this.selected); + } + } + + public boolean isDefault() { + return (selected == defaultselected); + } + + public Modifier.Iterator getIterator(TestEnvironment env) { + return new SwitchIterator(optionvalues, 1 << selected); + } + + public JComponent getJComponent() { + if (jp == null) { + jp = new JPanel(); + jp.setLayout(new BorderLayout()); + jp.add(new JLabel(getDescription()), BorderLayout.WEST); + jcombo = new JComboBox(descnames); + updateGUI(); + jcombo.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + if (e.getStateChange() == ItemEvent.SELECTED) { + selected = jcombo.getSelectedIndex(); + if (J2DBench.verbose.isEnabled()) { + System.out.println(getOptionString()); + } + } + } + }); + jp.add(jcombo, BorderLayout.EAST); + } + return jp; + } + + public Object getValue() { + return optionvalues[selected]; + } + + public int getIntValue() { + return ((Integer) optionvalues[selected]).intValue(); + } + + public boolean getBooleanValue() { + return ((Boolean) optionvalues[selected]).booleanValue(); + } + + public String getValString() { + return optionnames[selected]; + } + + int findValueIndex(Object value) { + for (int i = 0; i < size; i++) { + if (optionvalues[i] == value) { + return i; + } + } + return -1; + } + + public String getValString(Object value) { + return optionnames[findValueIndex(value)]; + } + + public String getAbbreviatedModifierDescription(Object value) { + return abbrevnames[findValueIndex(value)]; + } + + public String setValue(int v) { + return setValue(new Integer(v)); + } + + public String setValue(boolean v) { + return setValue(new Boolean(v)); + } + + public String setValue(Object value) { + for (int i = 0; i < size; i++) { + if (optionvalues[i].equals(value)) { + this.selected = i; + updateGUI(); + return null; + } + } + return "Bad value"; + } + + public String setValueFromString(String value) { + for (int i = 0; i < size; i++) { + if (optionnames[i].equals(value)) { + this.selected = i; + updateGUI(); + return null; + } + } + return "Bad value"; + } + } + public static class BooleanIterator implements Modifier.Iterator { private Boolean list[]; private int index; diff --git a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/Result.java b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/Result.java index 70dce030026..a89342fc695 100644 --- a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/Result.java +++ b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/Result.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,23 +35,199 @@ import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; import java.io.PrintWriter; +import java.util.HashMap; public class Result { - public static final int UNITS_WHOLE = 0; - public static final int UNITS_THOUSANDS = 1; - public static final int UNITS_MILLIONS = 2; - public static final int UNITS_AUTO = 3; + public static final int RATE_UNKNOWN = 0; - public static final int SECONDS_WHOLE = 0; - public static final int SECONDS_MILLIS = 1; - public static final int SECONDS_MICROS = 2; - public static final int SECONDS_NANOS = 3; - public static final int SECONDS_AUTO = 4; + public static final int WORK_OPS = 1; + public static final int WORK_UNITS = 2; + public static final int WORK_THOUSANDS = 4; + public static final int WORK_MILLIONS = 6; + public static final int WORK_AUTO = 8; - public static int unitScale = UNITS_WHOLE; - public static int timeScale = SECONDS_WHOLE; - public static boolean useUnits = true; - public static boolean invertRate = false; + public static final int TIME_SECONDS = 10; + public static final int TIME_MILLIS = 11; + public static final int TIME_MICROS = 12; + public static final int TIME_NANOS = 13; + public static final int TIME_AUTO = 14; + + static Group resultoptroot; + static Option.ObjectChoice timeOpt; + static Option.ObjectChoice workOpt; + static Option.ObjectChoice rateOpt; + + public static void init() { + resultoptroot = new Group(TestEnvironment.globaloptroot, + "results", "Result Options"); + + String workStrings[] = { + "units", + "kilounits", + "megaunits", + "autounits", + "ops", + "kiloops", + "megaops", + "autoops", + }; + String workDescriptions[] = { + "Test Units", + "Thousands of Test Units", + "Millions of Test Units", + "Auto-scaled Test Units", + "Operations", + "Thousands of Operations", + "Millions of Operations", + "Auto-scaled Operations", + }; + Integer workObjects[] = { + new Integer(WORK_UNITS), + new Integer(WORK_THOUSANDS), + new Integer(WORK_MILLIONS), + new Integer(WORK_AUTO), + new Integer(WORK_OPS | WORK_UNITS), + new Integer(WORK_OPS | WORK_THOUSANDS), + new Integer(WORK_OPS | WORK_MILLIONS), + new Integer(WORK_OPS | WORK_AUTO), + }; + workOpt = new Option.ObjectChoice(resultoptroot, + "workunits", "Work Units", + workStrings, workObjects, + workStrings, workDescriptions, + 0); + String timeStrings[] = { + "sec", + "msec", + "usec", + "nsec", + "autosec", + }; + String timeDescriptions[] = { + "Seconds", + "Milliseconds", + "Microseconds", + "Nanoseconds", + "Auto-scaled seconds", + }; + Integer timeObjects[] = { + new Integer(TIME_SECONDS), + new Integer(TIME_MILLIS), + new Integer(TIME_MICROS), + new Integer(TIME_NANOS), + new Integer(TIME_AUTO), + }; + timeOpt = new Option.ObjectChoice(resultoptroot, + "timeunits", "Time Units", + timeStrings, timeObjects, + timeStrings, timeDescriptions, + 0); + String rateStrings[] = { + "unitspersec", + "secsperunit", + }; + String rateDescriptions[] = { + "Work units per Time", + "Time units per Work", + }; + Boolean rateObjects[] = { + Boolean.FALSE, + Boolean.TRUE, + }; + rateOpt = new Option.ObjectChoice(resultoptroot, + "ratio", "Rate Ratio", + rateStrings, rateObjects, + rateStrings, rateDescriptions, + 0); + } + + public static boolean isTimeUnit(int unit) { + return (unit >= TIME_SECONDS && unit <= TIME_AUTO); + } + + public static boolean isWorkUnit(int unit) { + return (unit >= WORK_OPS && unit <= (WORK_AUTO | WORK_OPS)); + } + + public static String parseRateOpt(String opt) { + int timeScale = timeOpt.getIntValue(); + int workScale = workOpt.getIntValue(); + boolean invertRate = rateOpt.getBooleanValue(); + int divindex = opt.indexOf('/'); + if (divindex < 0) { + int unit = parseUnit(opt); + if (isTimeUnit(unit)) { + timeScale = unit; + } else if (isWorkUnit(unit)) { + workScale = unit; + } else { + return "Bad unit: "+opt; + } + } else { + int unit1 = parseUnit(opt.substring(0,divindex)); + int unit2 = parseUnit(opt.substring(divindex+1)); + if (isTimeUnit(unit1)) { + if (isWorkUnit(unit2)) { + timeScale = unit1; + workScale = unit2; + invertRate = true; + } else if (isTimeUnit(unit2)) { + return "Both time units: "+opt; + } else { + return "Bad denominator: "+opt; + } + } else if (isWorkUnit(unit1)) { + if (isWorkUnit(unit2)) { + return "Both work units: "+opt; + } else if (isTimeUnit(unit2)) { + timeScale = unit2; + workScale = unit1; + invertRate = false; + } else { + return "Bad denominator: "+opt; + } + } else { + return "Bad numerator: "+opt; + } + } + timeOpt.setValue(timeScale); + workOpt.setValue(workScale); + rateOpt.setValue(invertRate); + return null; + } + + private static HashMap unitMap; + + static { + unitMap = new HashMap(); + unitMap.put("U", new Integer(WORK_UNITS)); + unitMap.put("M", new Integer(WORK_MILLIONS)); + unitMap.put("K", new Integer(WORK_THOUSANDS)); + unitMap.put("A", new Integer(WORK_AUTO)); + unitMap.put("MU", new Integer(WORK_MILLIONS)); + unitMap.put("KU", new Integer(WORK_THOUSANDS)); + unitMap.put("AU", new Integer(WORK_AUTO)); + + unitMap.put("O", new Integer(WORK_UNITS | WORK_OPS)); + unitMap.put("NO", new Integer(WORK_UNITS | WORK_OPS)); + unitMap.put("MO", new Integer(WORK_MILLIONS | WORK_OPS)); + unitMap.put("KO", new Integer(WORK_THOUSANDS | WORK_OPS)); + unitMap.put("AO", new Integer(WORK_AUTO | WORK_OPS)); + + unitMap.put("s", new Integer(TIME_SECONDS)); + unitMap.put("m", new Integer(TIME_MILLIS)); + unitMap.put("u", new Integer(TIME_MICROS)); + unitMap.put("n", new Integer(TIME_NANOS)); + unitMap.put("a", new Integer(TIME_AUTO)); + } + + public static int parseUnit(String c) { + Integer u = (Integer) unitMap.get(c); + if (u != null) { + return u.intValue(); + } + return RATE_UNKNOWN; + } String unitname = "unit"; Test test; @@ -157,69 +333,76 @@ public class Result { } public String getAverageString() { - double units = (useUnits ? getTotalUnits() : getTotalReps()); + int timeScale = timeOpt.getIntValue(); + int workScale = workOpt.getIntValue(); + boolean invertRate = rateOpt.getBooleanValue(); double time = getTotalTime(); + String timeprefix = ""; + switch (timeScale) { + case TIME_AUTO: + case TIME_SECONDS: + time /= 1000; + break; + case TIME_MILLIS: + timeprefix = "m"; + break; + case TIME_MICROS: + time *= 1000.0; + timeprefix = "u"; + break; + case TIME_NANOS: + time *= 1000000.0; + timeprefix = "n"; + break; + } + + String workprefix = ""; + boolean isOps = (workScale & WORK_OPS) != 0; + String workname = isOps ? "op" : unitname; + double work = isOps ? getTotalReps() : getTotalUnits(); + switch (workScale & (~WORK_OPS)) { + case WORK_AUTO: + case WORK_UNITS: + break; + case WORK_THOUSANDS: + work /= 1000.0; + workprefix = "K"; + break; + case WORK_MILLIONS: + work /= 1000000.0; + workprefix = "M"; + break; + } if (invertRate) { - double rate = time / units; - String prefix = ""; - switch (timeScale) { - case SECONDS_WHOLE: - rate /= 1000; - break; - case SECONDS_MILLIS: - prefix = "m"; - break; - case SECONDS_MICROS: - rate *= 1000.0; - prefix = "u"; - break; - case SECONDS_NANOS: - rate *= 1000000.0; - prefix = "n"; - break; - case SECONDS_AUTO: - rate /= 1000.0; + double rate = time / work; + if (timeScale == TIME_AUTO) { if (rate < 1.0) { rate *= 1000.0; - prefix = "m"; + timeprefix = "m"; if (rate < 1.0) { rate *= 1000.0; - prefix = "u"; + timeprefix = "u"; if (rate < 1.0) { rate *= 1000.0; - prefix = "n"; + timeprefix = "n"; } } } - break; } - return rate+" "+prefix+"secs/"+(useUnits ? unitname : "op"); + return rate+" "+timeprefix+"secs/"+workprefix+workname; } else { - double rate = units / (time / 1000.0); - String prefix = ""; - switch (unitScale) { - case UNITS_WHOLE: - break; - case UNITS_THOUSANDS: - rate /= 1000.0; - prefix = "K"; - break; - case UNITS_MILLIONS: - rate /= 1000000.0; - prefix = "M"; - break; - case UNITS_AUTO: + double rate = work / time; + if (workScale == WORK_AUTO) { if (rate > 1000.0) { rate /= 1000.0; - prefix = "K"; + workprefix = "K"; if (rate > 1000.0) { rate /= 1000.0; - prefix = "M"; + workprefix = "M"; } } - break; } - return rate+" "+prefix+(useUnits ? unitname : "op")+"s/sec"; + return rate+" "+workprefix+workname+"s/"+timeprefix+"sec"; } } diff --git a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/report/J2DAnalyzer.java b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/report/J2DAnalyzer.java index 37cab7587d4..5f5b9457c95 100644 --- a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/report/J2DAnalyzer.java +++ b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/report/J2DAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -61,6 +61,8 @@ public class J2DAnalyzer { "the following result sets are combined into a group"); out.println(" -NoGroup "+ "the following result sets stand on their own"); + out.println(" -ShowUncontested "+ + "show results even when only result set has a result"); out.println(" -Graph "+ "graph the results visually (using lines of *'s)"); out.println(" -Best "+ @@ -83,6 +85,7 @@ public class J2DAnalyzer { public static void main(String argv[]) { boolean gavehelp = false; boolean graph = false; + boolean ignoreuncontested = true; if (argv.length > 0 && argv[0].equalsIgnoreCase("-html")) { String newargs[] = new String[argv.length-1]; System.arraycopy(argv, 1, newargs, 0, newargs.length); @@ -97,6 +100,8 @@ public class J2DAnalyzer { results.add(groupHolder); } else if (arg.equalsIgnoreCase("-NoGroup")) { groupHolder = null; + } else if (arg.equalsIgnoreCase("-ShowUncontested")) { + ignoreuncontested = false; } else if (arg.equalsIgnoreCase("-Graph")) { graph = true; } else if (arg.equalsIgnoreCase("-Best")) { @@ -171,18 +176,23 @@ public class J2DAnalyzer { String key = keys[k]; ResultHolder rh = base.getResultByKey(key); double score = rh.getScore(); - System.out.println(rh.getShortKey()+":"); double maxscore = score; - if (graph) { - for (int i = 0; i < numsets; i++) { - ResultSetHolder rsh = - (ResultSetHolder) results.elementAt(i); - ResultHolder rh2 = rsh.getResultByKey(key); - if (rh2 != null) { + int numcontesting = 0; + for (int i = 0; i < numsets; i++) { + ResultSetHolder rsh = + (ResultSetHolder) results.elementAt(i); + ResultHolder rh2 = rsh.getResultByKey(key); + if (rh2 != null) { + if (graph) { maxscore = Math.max(maxscore, rh2.getBestScore()); } + numcontesting++; } } + if (ignoreuncontested && numcontesting < 2) { + continue; + } + System.out.println(rh.getShortKey()+":"); for (int i = 0; i < numsets; i++) { ResultSetHolder rsh = (ResultSetHolder) results.elementAt(i); System.out.print(rsh.getTitle()+": "); diff --git a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/GraphicsTests.java b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/GraphicsTests.java index 2f638c634e7..3b04ad1ab3c 100644 --- a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/GraphicsTests.java +++ b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/GraphicsTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,6 +38,8 @@ import java.awt.RenderingHints; import java.awt.Polygon; import java.awt.Color; import java.awt.Dimension; +import java.awt.geom.Point2D; +import java.awt.geom.AffineTransform; import java.lang.reflect.Field; import j2dbench.Destinations; @@ -74,6 +76,7 @@ public abstract class GraphicsTests extends Test { static Option animList; static Option sizeList; static Option compRules; + static Option transforms; static Option doExtraAlpha; static Option doXor; static Option doClipping; @@ -167,6 +170,29 @@ public abstract class GraphicsTests extends Test { j, rulenames, rules, rulenames, ruledescs, (1 << defrule)); ((Option.ObjectList) compRules).setNumRows(4); + + Transform xforms[] = { + Identity.instance, + FTranslate.instance, + Scale2x2.instance, + Rotate15.instance, + ShearX.instance, + ShearY.instance, + }; + String xformnames[] = new String[xforms.length]; + String xformdescs[] = new String[xforms.length]; + for (int i = 0; i < xforms.length; i++) { + xformnames[i] = xforms[i].getShortName(); + xformdescs[i] = xforms[i].getDescription(); + } + transforms = + new Option.ObjectList(groptroot, "transform", + "Affine Transform", + xforms.length, + xformnames, xforms, xformnames, + xformdescs, 0x1); + ((Option.ObjectList) transforms).setNumRows(3); + doExtraAlpha = new Option.Toggle(groptroot, "extraalpha", "Render with an \"extra alpha\" of 0.125", @@ -200,6 +226,7 @@ public abstract class GraphicsTests extends Test { int orgX, orgY; int initX, initY; int maxX, maxY; + double pixscale; } public GraphicsTests(Group parent, String nodeName, String description) { @@ -211,7 +238,7 @@ public abstract class GraphicsTests extends Test { public Object initTest(TestEnvironment env, Result result) { Context ctx = createContext(); initContext(env, ctx); - result.setUnits(pixelsTouched(ctx)); + result.setUnits((int) (ctx.pixscale * pixelsTouched(ctx))); result.setUnitName("pixel"); return ctx; } @@ -232,6 +259,9 @@ public abstract class GraphicsTests extends Test { ctx.graphics = env.getGraphics(); int w = env.getWidth(); int h = env.getHeight(); + ctx.size = env.getIntValue(sizeList); + ctx.outdim = getOutputSize(ctx.size, ctx.size); + ctx.pixscale = 1.0; if (hasGraphics2D) { Graphics2D g2d = (Graphics2D) ctx.graphics; AlphaComposite ac = (AlphaComposite) env.getModifier(compRules); @@ -251,11 +281,14 @@ public abstract class GraphicsTests extends Test { p.addPoint(0, 0); g2d.clip(p); } + Transform tx = (Transform) env.getModifier(transforms); + Dimension envdim = new Dimension(w, h); + tx.init(g2d, ctx, envdim); + w = envdim.width; + h = envdim.height; g2d.setRenderingHint(RenderingHints.KEY_RENDERING, env.getModifier(renderHint)); } - ctx.size = env.getIntValue(sizeList); - ctx.outdim = getOutputSize(ctx.size, ctx.size); switch (env.getIntValue(animList)) { case 0: ctx.animate = false; @@ -290,4 +323,201 @@ public abstract class GraphicsTests extends Test { graphics.dispose(); ((Context) ctx).graphics = null; } + + public abstract static class Transform { + public abstract String getShortName(); + public abstract String getDescription(); + public abstract void init(Graphics2D g2d, Context ctx, Dimension dim); + + public static double scaleForPoint(AffineTransform at, + double xorig, double yorig, + double x, double y, + int w, int h) + { + Point2D.Double ptd = new Point2D.Double(x, y); + at.transform(ptd, ptd); + x = ptd.getX(); + y = ptd.getY(); + double scale = 1.0; + if (x < 0) { + scale = Math.min(scale, xorig / (xorig - x)); + } else if (x > w) { + scale = Math.min(scale, (w - xorig) / (x - xorig)); + } + if (y < 0) { + scale = Math.min(scale, yorig / (yorig - y)); + } else if (y > h) { + scale = Math.min(scale, (h - yorig) / (y - yorig)); + } + return scale; + } + + public static Dimension scaleForTransform(AffineTransform at, + Dimension dim) + { + int w = dim.width; + int h = dim.height; + Point2D.Double ptd = new Point2D.Double(0, 0); + at.transform(ptd, ptd); + double ox = ptd.getX(); + double oy = ptd.getY(); + if (ox < 0 || ox > w || oy < 0 || oy > h) { + throw new InternalError("origin outside destination"); + } + double scalex = scaleForPoint(at, ox, oy, w, h, w, h); + double scaley = scalex; + scalex = Math.min(scaleForPoint(at, ox, oy, w, 0, w, h), scalex); + scaley = Math.min(scaleForPoint(at, ox, oy, 0, h, w, h), scaley); + if (scalex < 0 || scaley < 0) { + throw new InternalError("could not fit dims to transform"); + } + return new Dimension((int) Math.floor(w * scalex), + (int) Math.floor(h * scaley)); + } + } + + public static class Identity extends Transform { + public static final Identity instance = new Identity(); + + private Identity() {} + + public String getShortName() { + return "ident"; + } + + public String getDescription() { + return "Identity"; + } + + public void init(Graphics2D g2d, Context ctx, Dimension dim) { + } + } + + public static class FTranslate extends Transform { + public static final FTranslate instance = new FTranslate(); + + private FTranslate() {} + + public String getShortName() { + return "ftrans"; + } + + public String getDescription() { + return "FTranslate 1.5"; + } + + public void init(Graphics2D g2d, Context ctx, Dimension dim) { + int w = dim.width; + int h = dim.height; + AffineTransform at = new AffineTransform(); + at.translate(1.5, 1.5); + g2d.transform(at); + dim.setSize(w-3, h-3); + } + } + + public static class Scale2x2 extends Transform { + public static final Scale2x2 instance = new Scale2x2(); + + private Scale2x2() {} + + public String getShortName() { + return "scale2x2"; + } + + public String getDescription() { + return "Scale 2x by 2x"; + } + + public void init(Graphics2D g2d, Context ctx, Dimension dim) { + int w = dim.width; + int h = dim.height; + AffineTransform at = new AffineTransform(); + at.scale(2.0, 2.0); + g2d.transform(at); + dim.setSize(w/2, h/2); + ctx.pixscale = 4; + } + } + + public static class Rotate15 extends Transform { + public static final Rotate15 instance = new Rotate15(); + + private Rotate15() {} + + public String getShortName() { + return "rot15"; + } + + public String getDescription() { + return "Rotate 15 degrees"; + } + + public void init(Graphics2D g2d, Context ctx, Dimension dim) { + int w = dim.width; + int h = dim.height; + double theta = Math.toRadians(15); + double cos = Math.cos(theta); + double sin = Math.sin(theta); + double xsize = sin * h + cos * w; + double ysize = sin * w + cos * h; + double scale = Math.min(w / xsize, h / ysize); + xsize *= scale; + ysize *= scale; + AffineTransform at = new AffineTransform(); + at.translate((w - xsize) / 2.0, (h - ysize) / 2.0); + at.translate(sin * h * scale, 0.0); + at.rotate(theta); + g2d.transform(at); + dim.setSize(scaleForTransform(at, dim)); + } + } + + public static class ShearX extends Transform { + public static final ShearX instance = new ShearX(); + + private ShearX() {} + + public String getShortName() { + return "shearx"; + } + + public String getDescription() { + return "Shear X to the right"; + } + + public void init(Graphics2D g2d, Context ctx, Dimension dim) { + int w = dim.width; + int h = dim.height; + AffineTransform at = new AffineTransform(); + at.translate(0.0, (h - (w*h)/(w + h*0.1)) / 2); + at.shear(0.1, 0.0); + g2d.transform(at); + dim.setSize(scaleForTransform(at, dim)); + } + } + + public static class ShearY extends Transform { + public static final ShearY instance = new ShearY(); + + private ShearY() {} + + public String getShortName() { + return "sheary"; + } + + public String getDescription() { + return "Shear Y down"; + } + + public void init(Graphics2D g2d, Context ctx, Dimension dim) { + int w = dim.width; + int h = dim.height; + AffineTransform at = new AffineTransform(); + at.translate((w - (w*h)/(h + w*0.1)) / 2, 0.0); + at.shear(0.0, 0.1); + g2d.transform(at); + dim.setSize(scaleForTransform(at, dim)); + } + } } diff --git a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/text/TextTests.java b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/text/TextTests.java index 9960a7b7046..1569f9dfc6f 100644 --- a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/text/TextTests.java +++ b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/text/TextTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -454,7 +454,7 @@ public abstract class TextTests extends Test { taaNames, taaHints, taaNames, taaNames, 0x1); - ((Option.ObjectList) taaList).setNumRows(2); + ((Option.ObjectList) taaList).setNumRows(6); // add special TextAAOpt for backwards compatibility with // older options files new TextAAOpt(); @@ -707,3 +707,4 @@ public abstract class TextTests extends Test { } } } + diff --git a/jdk/src/share/demo/jvmti/heapTracker/heapTracker.c b/jdk/src/share/demo/jvmti/heapTracker/heapTracker.c index 8cc294c6600..4704c5bf1e2 100644 --- a/jdk/src/share/demo/jvmti/heapTracker/heapTracker.c +++ b/jdk/src/share/demo/jvmti/heapTracker/heapTracker.c @@ -340,7 +340,7 @@ tagObjectWithTraceInfo(jvmtiEnv *jvmti, jobject object, TraceInfo *tinfo) } /* Java Native Method for Object. */ -static void +static void JNICALL HEAP_TRACKER_native_newobj(JNIEnv *env, jclass klass, jthread thread, jobject o) { TraceInfo *tinfo; @@ -353,7 +353,7 @@ HEAP_TRACKER_native_newobj(JNIEnv *env, jclass klass, jthread thread, jobject o) } /* Java Native Method for newarray */ -static void +static void JNICALL HEAP_TRACKER_native_newarr(JNIEnv *env, jclass klass, jthread thread, jobject a) { TraceInfo *tinfo; diff --git a/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt b/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt index 3766a287783..8028cd86f01 100644 --- a/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt +++ b/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/jdk/src/share/demo/nio/zipfs/Demo.java b/jdk/src/share/demo/nio/zipfs/Demo.java index 3666dfd70de..fd2ba7311b1 100644 --- a/jdk/src/share/demo/nio/zipfs/Demo.java +++ b/jdk/src/share/demo/nio/zipfs/Demo.java @@ -45,12 +45,7 @@ import static java.nio.file.StandardCopyOption.*; /* * ZipFileSystem usage demo * - * java [-cp .../zipfs.jar:./] Demo action ZipfileName [...] - * - * To deploy the provider, either copy the zipfs.jar into JDK/JRE - * extensions directory or add - * /demo/nio/ZipFileSystem/zipfs.jar - * into your class path as showed above. + * java Demo action ZipfileName [...] * * @author Xueming Shen */ @@ -75,9 +70,15 @@ public class Demo { // copy an external src file into zipfile // as entry dst + copyin_attrs, // + // copy an external src file into zipfile + // as entry dst, with attributes (timestamp) + copyout, // // copy zipfile entry src" out to file dst + copyout_attrs, // + zzmove, // // move entry path/dir from zfsrc to zfdst @@ -94,6 +95,9 @@ public class Demo { setmtime, // // set the lastModifiedTime of entry path + setatime, // + setctime, // + lsdir, // // list dir's direct child files/dirs @@ -135,21 +139,20 @@ public class Demo { attrs2, // // test different ways to print attrs + + prof, } public static void main(String[] args) throws Throwable { - Action action = Action.valueOf(args[0]);; - Map env = env = new HashMap(); + Action action = Action.valueOf(args[0]); + Map env = env = new HashMap<>(); if (action == Action.create) - env.put("createNew", true); + env.put("create", "true"); if (action == Action.tlist || action == Action.twalk) env.put("buildDirTree", true); + FileSystem fs = FileSystems.newFileSystem(Paths.get(args[1]), env, null); - FileSystem fs = FileSystems.newFileSystem( - URI.create("zip" + Paths.get(args[1]).toUri().toString().substring(4)), - env, - null); try { FileSystem fs2; Path path, src, dst; @@ -185,20 +188,24 @@ public class Demo { dst = fs.getPath(args[3]); src.copyTo(dst); break; + case copyin_attrs: + src = Paths.get(args[2]); + dst = fs.getPath(args[3]); + src.copyTo(dst, COPY_ATTRIBUTES); + break; + case copyout_attrs: + src = fs.getPath(args[2]); + dst = Paths.get(args[3]); + src.copyTo(dst, COPY_ATTRIBUTES); + break; case zzmove: - fs2 = FileSystems.newFileSystem( - URI.create("zip" + Paths.get(args[2]).toUri().toString().substring(4)), - env, - null); + fs2 = FileSystems.newFileSystem(Paths.get(args[2]), env, null); //sf1.getPath(args[3]).moveTo(fs2.getPath(args[3])); z2zmove(fs, fs2, args[3]); fs2.close(); break; case zzcopy: - fs2 = FileSystems.newFileSystem( - URI.create("zip" + Paths.get(args[2]).toUri().toString().substring(4)), - env, - null); + fs2 = FileSystems.newFileSystem(Paths.get(args[2]), env, null); //sf1.getPath(args[3]).copyTo(fs2.getPath(args[3])); z2zcopy(fs, fs2, args[3]); fs2.close(); @@ -206,6 +213,7 @@ public class Demo { case attrs: for (int i = 2; i < args.length; i++) { path = fs.getPath(args[i]); + System.out.println(path); System.out.println( Attributes.readBasicFileAttributes(path).toString()); } @@ -221,6 +229,28 @@ public class Demo { Attributes.readBasicFileAttributes(path).toString()); } break; + case setctime: + df = new SimpleDateFormat("MM/dd/yyyy-HH:mm:ss"); + newDatetime = df.parse(args[2]); + for (int i = 3; i < args.length; i++) { + path = fs.getPath(args[i]); + path.setAttribute("creationTime", + FileTime.fromMillis(newDatetime.getTime())); + System.out.println( + Attributes.readBasicFileAttributes(path).toString()); + } + break; + case setatime: + df = new SimpleDateFormat("MM/dd/yyyy-HH:mm:ss"); + newDatetime = df.parse(args[2]); + for (int i = 3; i < args.length; i++) { + path = fs.getPath(args[i]); + path.setAttribute("lastAccessTime", + FileTime.fromMillis(newDatetime.getTime())); + System.out.println( + Attributes.readBasicFileAttributes(path).toString()); + } + break; case attrsspace: path = fs.getPath("/"); FileStore fstore = path.getFileStore(); @@ -293,6 +323,7 @@ public class Demo { case attrs2: for (int i = 2; i < args.length; i++) { path = fs.getPath(args[i]); + System.out.printf("%n%s%n", path); System.out.println("-------(1)---------"); System.out.println( Attributes.readBasicFileAttributes(path).toString()); @@ -308,6 +339,13 @@ public class Demo { } } break; + case prof: + list(fs.getPath("/"), false); + while (true) { + Thread.sleep(10000); + //list(fs.getPath("/"), true); + System.out.println("sleeping..."); + } } } catch (Exception x) { x.printStackTrace(); @@ -501,10 +539,11 @@ public class Demo { } private static void list(Path path, boolean verbose ) throws IOException { - if (verbose) - System.out.println(Attributes.readBasicFileAttributes(path).toString()); - else - System.out.printf(" %s%n", path.toString()); + if (!"/".equals(path.toString())) { + System.out.printf(" %s%n", path.toString()); + if (verbose) + System.out.println(Attributes.readBasicFileAttributes(path).toString()); + } if (path.notExists()) return; if (Attributes.readBasicFileAttributes(path).isDirectory()) { diff --git a/jdk/src/share/demo/nio/zipfs/README.txt b/jdk/src/share/demo/nio/zipfs/README.txt index 227a67e270e..9a216e48d70 100644 --- a/jdk/src/share/demo/nio/zipfs/README.txt +++ b/jdk/src/share/demo/nio/zipfs/README.txt @@ -1,23 +1,19 @@ ZipFileSystem is a file system provider that treats the contents of a zip or JAR file as a java.nio.file.FileSystem. -To deploy the provider you must copy zipfs.jar into your extensions -directory or else add /demo/nio/ZipFileSystem/zipfs.jar -to your class path. - The factory methods defined by the java.nio.file.FileSystems class can be used to create a FileSystem, eg: // use file type detection Map env = Collections.emptyMap(); - Path jarfile = Path.get("foo.jar"); - FileSystem fs = FileSystems.newFileSystem(jarfile, env); + Path jarfile = Paths.get("foo.jar"); + FileSystem fs = FileSystems.newFileSystem(jarfile, env, null); -or - // locate file system by URI + // locate file system by the legacy JAR URL syntax Map env = Collections.emptyMap(); - URI uri = URI.create("zip:///mydir/foo.jar"); + URI uri = URI.create("jar:file:/mydir/foo.jar"); FileSystem fs = FileSystems.newFileSystem(uri, env); Once a FileSystem is created then classes in the java.nio.file package @@ -26,4 +22,6 @@ can be used to access files in the zip/JAR file, eg: Path mf = fs.getPath("/META-INF/MANIFEST.MF"); InputStream in = mf.newInputStream(); +See Demo.java for more interesting usages. + diff --git a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipInfo.java b/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipInfo.java deleted file mode 100644 index 741376daf0d..00000000000 --- a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipInfo.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of Oracle nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.sun.nio.zipfs; - -import java.io.PrintStream; -import java.nio.file.Paths; -import java.util.Collections; -import java.util.Iterator; -import java.util.Map; -import com.sun.nio.zipfs.ZipFileSystem.Entry; -import static com.sun.nio.zipfs.ZipConstants.*; -import static com.sun.nio.zipfs.ZipUtils.*; - -/** - * Print the loc and cen tables of the ZIP file - * - * @author Xueming Shen - */ - -public class ZipInfo { - - public static void main(String[] args) throws Throwable { - if (args.length < 2) { - print("Usage: java ZipInfo [cen|loc] zfname"); - } else { - Map env = Collections.emptyMap(); - ZipFileSystem zfs = (ZipFileSystem)(new ZipFileSystemProvider() - .newFileSystem(Paths.get(args[1]), env)); - - long pos = 0; - - if ("loc".equals(args[0])) { - print("[Local File Header]%n"); - byte[] buf = new byte[1024]; - for (int i = 0; i < zfs.getEntryNames().length; i++) { - Entry loc = Entry.readLOC(zfs, pos, buf); - print("--------loc[%x]--------%n", pos); - printLOC(loc); - pos = loc.endPos; - } - } if ("cen".equals(args[0])) { - int i = 0; - Iterator itr = zfs.inodes.values().iterator(); - print("[Central Directory Header]%n"); - while (itr.hasNext()) { - Entry cen = Entry.readCEN(zfs.cen, itr.next().pos); - print("--------cen[%d]--------%n", i); - printCEN(cen); - i++; - } - } - zfs.close(); - } - } - - static void print(String fmt, Object... objs) { - System.out.printf(fmt, objs); - } - - static void printLOC(Entry loc) { - print(" [%x, %x]%n", loc.startPos, loc.endPos); - print(" Signature : %8x%n", LOCSIG); - print(" Version : %4x [%d.%d]%n", - loc.version, loc. version/10, loc. version%10); - print(" Flag : %4x%n", loc.flag); - print(" Method : %4x%n", loc. method); - print(" LastMTime : %8x [%tc]%n", - loc.mtime, dosToJavaTime(loc.mtime)); - print(" CRC : %8x%n", loc.crc); - print(" CSize : %8x%n", loc.csize); - print(" Size : %8x%n", loc.size); - print(" NameLength : %4x [%s]%n", - loc.nlen, new String(loc.name)); - print(" ExtraLength : %4x%n", loc.elen); - if (loc.hasZip64) - print(" *ZIP64*%n"); - } - - static void printCEN(Entry cen) { - print(" Signature : %08x%n", CENSIG); - print(" VerMadeby : %4x [%d.%d]%n", - cen.versionMade, cen.versionMade/10, cen.versionMade%10); - print(" VerExtract : %4x [%d.%d]%n", - cen.version, cen.version/10, cen.version%10); - print(" Flag : %4x%n", cen.flag); - print(" Method : %4x%n", cen.method); - print(" LastMTime : %8x [%tc]%n", - cen.mtime, dosToJavaTime(cen.mtime)); - print(" CRC : %8x%n", cen.crc); - print(" CSize : %8x%n", cen.csize); - print(" Size : %8x%n", cen.size); - print(" NameLen : %4x [%s]%n", - cen.nlen, new String(cen.name)); - print(" ExtraLen : %4x%n", cen.elen); - print(" CommentLen : %4x%n", cen.clen); - print(" DiskStart : %4x%n", cen.disk); - print(" Attrs : %4x%n", cen.attrs); - print(" AttrsEx : %8x%n", cen.attrsEx); - print(" LocOff : %8x%n", cen.locoff); - if (cen.hasZip64) - print(" *ZIP64*%n"); - } -} diff --git a/jdk/src/share/demo/nio/zipfs/META-INF/services/java.nio.file.spi.FileSystemProvider b/jdk/src/share/demo/nio/zipfs/src/META-INF/services/java.nio.file.spi.FileSystemProvider similarity index 50% rename from jdk/src/share/demo/nio/zipfs/META-INF/services/java.nio.file.spi.FileSystemProvider rename to jdk/src/share/demo/nio/zipfs/src/META-INF/services/java.nio.file.spi.FileSystemProvider index ace131aa0fd..58ee3a6b972 100644 --- a/jdk/src/share/demo/nio/zipfs/META-INF/services/java.nio.file.spi.FileSystemProvider +++ b/jdk/src/share/demo/nio/zipfs/src/META-INF/services/java.nio.file.spi.FileSystemProvider @@ -1,3 +1,2 @@ com.sun.nio.zipfs.ZipFileSystemProvider -com.sun.nio.zipfs.JarFileSystemProvider diff --git a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/JarFileSystemProvider.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/JarFileSystemProvider.java similarity index 83% rename from jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/JarFileSystemProvider.java rename to jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/JarFileSystemProvider.java index 2fc9c83ef14..dddf69e4dee 100644 --- a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/JarFileSystemProvider.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/JarFileSystemProvider.java @@ -68,4 +68,21 @@ public class JarFileSystemProvider extends ZipFileSystemProvider throw new AssertionError(e); //never thrown } } + + @Override + public Path getPath(URI uri) { + FileSystem fs = getFileSystem(uri); + String path = uri.getFragment(); + if (path == null) { + String uristr = uri.toString(); + int off = uristr.indexOf("!/"); + if (off != -1) + path = uristr.substring(off + 2); + } + if (path != null) + return fs.getPath(path); + throw new IllegalArgumentException("URI: " + + uri + + " does not contain path fragment ex. jar:///c:/foo.zip!/BAR"); + } } diff --git a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipCoder.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipCoder.java similarity index 100% rename from jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipCoder.java rename to jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipCoder.java diff --git a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipConstants.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java similarity index 86% rename from jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipConstants.java rename to jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java index aa7073ac15e..24c28cfe80c 100644 --- a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipConstants.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java @@ -31,7 +31,6 @@ package com.sun.nio.zipfs; -import java.nio.ByteBuffer; /** * @@ -48,6 +47,7 @@ class ZipConstants { static final int METHOD_BZIP2 = 12; static final int METHOD_LZMA = 14; static final int METHOD_LZ77 = 19; + static final int METHOD_AES = 99; /* * General purpose big flag @@ -168,7 +168,8 @@ class ZipConstants { static final int EXTID_ZIP64 = 0x0001; // ZIP64 static final int EXTID_NTFS = 0x000a; // NTFS static final int EXTID_UNIX = 0x000d; // UNIX - + static final int EXTID_EFS = 0x0017; // Strong Encryption + static final int EXTID_EXTT = 0x5455; // Info-ZIP Extended Timestamp /* * fields access methods @@ -226,34 +227,23 @@ class ZipConstants { static final long ZIP64_ENDOFF(byte[] b) { return LL(b, 48);} // central directory offset static final long ZIP64_LOCOFF(byte[] b) { return LL(b, 8);} // zip64 end offset - ////////////////////////////////////////// - static final int CH(ByteBuffer b, int pos) { - return b.get(pos) & 0xff; - } - static final int SH(ByteBuffer b, int pos) { - return b.getShort(pos) & 0xffff; - } - static final long LG(ByteBuffer b, int pos) { - return b.getInt(pos) & 0xffffffffL; - } - - // central directory header (END) fields - static final long CENSIG(ByteBuffer b, int pos) { return LG(b, pos + 0); } - static final int CENVEM(ByteBuffer b, int pos) { return SH(b, pos + 4); } - static final int CENVER(ByteBuffer b, int pos) { return SH(b, pos + 6); } - static final int CENFLG(ByteBuffer b, int pos) { return SH(b, pos + 8); } - static final int CENHOW(ByteBuffer b, int pos) { return SH(b, pos + 10);} - static final long CENTIM(ByteBuffer b, int pos) { return LG(b, pos + 12);} - static final long CENCRC(ByteBuffer b, int pos) { return LG(b, pos + 16);} - static final long CENSIZ(ByteBuffer b, int pos) { return LG(b, pos + 20);} - static final long CENLEN(ByteBuffer b, int pos) { return LG(b, pos + 24);} - static final int CENNAM(ByteBuffer b, int pos) { return SH(b, pos + 28);} - static final int CENEXT(ByteBuffer b, int pos) { return SH(b, pos + 30);} - static final int CENCOM(ByteBuffer b, int pos) { return SH(b, pos + 32);} - static final int CENDSK(ByteBuffer b, int pos) { return SH(b, pos + 34);} - static final int CENATT(ByteBuffer b, int pos) { return SH(b, pos + 36);} - static final long CENATX(ByteBuffer b, int pos) { return LG(b, pos + 38);} - static final long CENOFF(ByteBuffer b, int pos) { return LG(b, pos + 42);} + // central directory header (CEN) fields + static final long CENSIG(byte[] b, int pos) { return LG(b, pos + 0); } + static final int CENVEM(byte[] b, int pos) { return SH(b, pos + 4); } + static final int CENVER(byte[] b, int pos) { return SH(b, pos + 6); } + static final int CENFLG(byte[] b, int pos) { return SH(b, pos + 8); } + static final int CENHOW(byte[] b, int pos) { return SH(b, pos + 10);} + static final long CENTIM(byte[] b, int pos) { return LG(b, pos + 12);} + static final long CENCRC(byte[] b, int pos) { return LG(b, pos + 16);} + static final long CENSIZ(byte[] b, int pos) { return LG(b, pos + 20);} + static final long CENLEN(byte[] b, int pos) { return LG(b, pos + 24);} + static final int CENNAM(byte[] b, int pos) { return SH(b, pos + 28);} + static final int CENEXT(byte[] b, int pos) { return SH(b, pos + 30);} + static final int CENCOM(byte[] b, int pos) { return SH(b, pos + 32);} + static final int CENDSK(byte[] b, int pos) { return SH(b, pos + 34);} + static final int CENATT(byte[] b, int pos) { return SH(b, pos + 36);} + static final long CENATX(byte[] b, int pos) { return LG(b, pos + 38);} + static final long CENOFF(byte[] b, int pos) { return LG(b, pos + 42);} /* The END header is followed by a variable length comment of size < 64k. */ static final long END_MAXLEN = 0xFFFF + ENDHDR; diff --git a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipDirectoryStream.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipDirectoryStream.java similarity index 97% rename from jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipDirectoryStream.java rename to jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipDirectoryStream.java index 3052b34e59a..10f6bd477a9 100644 --- a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipDirectoryStream.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipDirectoryStream.java @@ -38,7 +38,6 @@ import java.nio.file.Path; import java.util.Iterator; import java.util.NoSuchElementException; import java.io.IOException; -import static com.sun.nio.zipfs.ZipUtils.*; /** * @@ -77,7 +76,7 @@ public class ZipDirectoryStream implements DirectoryStream { } catch (IOException e) { throw new IllegalStateException(e); } - return new Iterator() { + return new Iterator<>() { private Path next; @Override public boolean hasNext() { diff --git a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileAttributeView.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributeView.java similarity index 96% rename from jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileAttributeView.java rename to jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributeView.java index d4a9a67c9fc..5c31ebe7ba6 100644 --- a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileAttributeView.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributeView.java @@ -32,7 +32,6 @@ package com.sun.nio.zipfs; -import java.nio.file.ReadOnlyFileSystemException; import java.nio.file.attribute.BasicFileAttributeView; import java.nio.file.attribute.FileAttributeView; import java.nio.file.attribute.FileTime; @@ -113,6 +112,10 @@ public class ZipFileAttributeView implements BasicFileAttributeView try { if (AttrID.valueOf(attribute) == AttrID.lastModifiedTime) setTimes ((FileTime)value, null, null); + if (AttrID.valueOf(attribute) == AttrID.lastAccessTime) + setTimes (null, (FileTime)value, null); + if (AttrID.valueOf(attribute) == AttrID.creationTime) + setTimes (null, null, (FileTime)value); return; } catch (IllegalArgumentException x) {} throw new UnsupportedOperationException("'" + attribute + diff --git a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileAttributes.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributes.java similarity index 90% rename from jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileAttributes.java rename to jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributes.java index 157f9eb163a..687f92644c4 100644 --- a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileAttributes.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributes.java @@ -56,7 +56,7 @@ public class ZipFileAttributes implements BasicFileAttributes @Override public FileTime creationTime() { if (e.ctime != -1) - return FileTime.fromMillis(dosToJavaTime(e.ctime)); + return FileTime.fromMillis(e.ctime); return null; } @@ -78,13 +78,13 @@ public class ZipFileAttributes implements BasicFileAttributes @Override public FileTime lastAccessTime() { if (e.atime != -1) - return FileTime.fromMillis(dosToJavaTime(e.atime)); + return FileTime.fromMillis(e.atime); return null; } @Override public FileTime lastModifiedTime() { - return FileTime.fromMillis(dosToJavaTime(e.mtime)); + return FileTime.fromMillis(e.mtime); } @Override @@ -103,10 +103,6 @@ public class ZipFileAttributes implements BasicFileAttributes } ///////// zip entry attributes /////////// - public byte[] name() { - return Arrays.copyOf(e.name, e.name.length); - } - public long compressedSize() { return e.csize; } @@ -132,10 +128,13 @@ public class ZipFileAttributes implements BasicFileAttributes } public String toString() { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(1024); Formatter fm = new Formatter(sb); - fm.format("[/%s]%n", new String(e.name)); // TBD encoding - fm.format(" creationTime : %s%n", creationTime()); + if (creationTime() != null) + fm.format(" creationTime : %tc%n", creationTime().toMillis()); + else + fm.format(" creationTime : null%n"); + if (lastAccessTime() != null) fm.format(" lastAccessTime : %tc%n", lastAccessTime().toMillis()); else diff --git a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileStore.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java similarity index 100% rename from jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileStore.java rename to jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java diff --git a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileSystem.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java similarity index 68% rename from jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileSystem.java rename to jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java index 152ca957c1d..21094011c01 100644 --- a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileSystem.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java @@ -35,19 +35,18 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.EOFException; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; -import java.nio.ByteOrder; import java.nio.MappedByteBuffer; import java.nio.channels.*; import java.nio.file.*; import java.nio.file.attribute.*; import java.nio.file.spi.*; -import java.net.URI; import java.util.*; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.regex.Pattern; import java.util.zip.CRC32; import java.util.zip.Inflater; @@ -76,8 +75,6 @@ public class ZipFileSystem extends FileSystem { private final Path zfpath; private final ZipCoder zc; - private final Object lock = new Object(); - // configurable by env map private final String defaultDir; // default dir for the file system private final String nameEncoding; // default encoding for name/comment @@ -85,6 +82,8 @@ public class ZipFileSystem extends FileSystem { private final boolean useTempFile; // use a temp file for newOS, default // is to use BAOS for better performance private final boolean createNew; // create a new zip if not exists + private static final boolean isWindows = + System.getProperty("os.name").startsWith("Windows"); ZipFileSystem(ZipFileSystemProvider provider, Path zfpath, @@ -92,13 +91,13 @@ public class ZipFileSystem extends FileSystem { throws IOException { // configurable env setup - this.buildDirTree = TRUE.equals(env.get("buildDirTree")); - this.useTempFile = TRUE.equals(env.get("useTempFile")); - this.createNew = TRUE.equals(env.get("createNew")); - this.nameEncoding = env.containsKey("nameEncoding") ? - (String)env.get("nameEncoding") : "UTF-8"; - this.defaultDir = env.containsKey("default.dir") ? - (String)env.get("default.dir") : "/"; + this.createNew = "true".equals(env.get("create")); + this.nameEncoding = env.containsKey("encoding") ? + (String)env.get("encoding") : "UTF-8"; + this.buildDirTree = TRUE.equals(env.get("buildDirTreea")); + this.useTempFile = TRUE.equals(env.get("useTempFile")); + this.defaultDir = env.containsKey("default.dir") ? + (String)env.get("default.dir") : "/"; if (this.defaultDir.charAt(0) != '/') throw new IllegalArgumentException("default dir should be absolute"); @@ -121,7 +120,8 @@ public class ZipFileSystem extends FileSystem { } this.zc = ZipCoder.get(nameEncoding); this.defaultdir = new ZipPath(this, getBytes(defaultDir)); - initZipFile(); + this.ch = zfpath.newByteChannel(READ); + this.cen = initCEN(); } @Override @@ -183,7 +183,7 @@ public class ZipFileSystem extends FileSystem { @Override public Iterable getFileStores() { - ArrayList list = new ArrayList(1); + ArrayList list = new ArrayList<>(1); list.add(new ZipFileStore(new ZipPath(this, new byte[]{'/'}))); return list; } @@ -240,19 +240,27 @@ public class ZipFileSystem extends FileSystem { @Override public void close() throws IOException { - synchronized (lock) { + beginWrite(); + try { if (!isOpen) return; - isOpen = false; - if (!streams.isEmpty()) { - synchronized(streams) { - for (InputStream is: streams) - is.close(); - } - } - sync(); - ch.close(); + isOpen = false; // set closed + } finally { + endWrite(); } + if (!streams.isEmpty()) { // unlock and close all remaining streams + Set copy = new HashSet<>(streams); + for (InputStream is: copy) + is.close(); + } + beginWrite(); // lock and sync + try { + sync(); + ch.close(); // close the ch just in case no update + } finally { // and sync dose not close the ch + endWrite(); + } + synchronized (inflaters) { for (Inflater inf : inflaters) inf.end(); @@ -261,97 +269,101 @@ public class ZipFileSystem extends FileSystem { for (Deflater def : deflaters) def.end(); } - for (Path p: tmppaths) { - try { - p.deleteIfExists(); - } catch (IOException x) { - x.printStackTrace(); + + synchronized (tmppaths) { + for (Path p: tmppaths) { + try { + p.deleteIfExists(); + } catch (IOException x) { + x.printStackTrace(); + } } } provider.removeFileSystem(zfpath); } - ZipFileAttributes[] getAllAttributes() throws IOException { - ensureOpen(); - int n = inodes.size(); - ZipFileAttributes[] zes = new ZipFileAttributes[n]; - Iterator itr = inodes.values().iterator(); - int i = 0; - while(itr.hasNext()) { - zes[i++] = new ZipFileAttributes(Entry.readCEN(cen, itr.next().pos)); - } - return zes; - } - - EntryName[] getEntryNames() throws IOException { - ensureOpen(); - return inodes.keySet().toArray(new EntryName[0]); - } - ZipFileAttributes getFileAttributes(byte[] path) throws IOException { - synchronized (lock) { - Entry e = getEntry0(path); - if (e == null) { - if (path.length == 0) { - e = new Entry(new byte[0]); // root - } else if (buildDirTree) { - IndexNode inode = getDirs().get(new EntryName(path)); - if (inode == null) - return null; - e = new Entry(inode.name); - } else { - return null; - } - e.method = METHOD_STORED; // STORED for dir - BasicFileAttributes bfas = Attributes.readBasicFileAttributes(zfpath); - if (bfas.lastModifiedTime() != null) - e.mtime = javaToDosTime(bfas.lastModifiedTime().toMillis()); - if (bfas.lastAccessTime() != null) - e.atime = javaToDosTime(bfas.lastAccessTime().toMillis()); - if (bfas.creationTime() != null) - e.ctime = javaToDosTime(bfas.creationTime().toMillis()); - } - return new ZipFileAttributes(e); + Entry e; + beginRead(); + try { + ensureOpen(); + e = getEntry0(path); + } finally { + endRead(); } + if (e == null) { + if (path.length == 0) { + e = new Entry(new byte[0]); // root + } else if (buildDirTree) { + IndexNode inode = getDirs().get(IndexNode.keyOf(path)); + if (inode == null) + return null; + e = new Entry(inode.name); + } else { + return null; + } + e.method = METHOD_STORED; // STORED for dir + BasicFileAttributes bfas = Attributes.readBasicFileAttributes(zfpath); + if (bfas.lastModifiedTime() != null) + e.mtime = bfas.lastModifiedTime().toMillis(); + if (bfas.lastAccessTime() != null) + e.atime = bfas.lastAccessTime().toMillis(); + if (bfas.creationTime() != null) + e.ctime = bfas.creationTime().toMillis(); + } + return new ZipFileAttributes(e); } void setTimes(byte[] path, FileTime mtime, FileTime atime, FileTime ctime) throws IOException { checkWritable(); - synchronized (lock) { + beginWrite(); + try { + ensureOpen(); Entry e = getEntry0(path); // ensureOpen checked if (e == null) throw new NoSuchFileException(getString(path)); if (e.type == Entry.CEN) e.type = Entry.COPY; // copy e if (mtime != null) - e.mtime = javaToDosTime(mtime.toMillis()); + e.mtime = mtime.toMillis(); if (atime != null) - e.atime = javaToDosTime(atime.toMillis()); + e.atime = atime.toMillis(); if (ctime != null) - e.ctime = javaToDosTime(ctime.toMillis()); + e.ctime = ctime.toMillis(); update(e); + } finally { + endWrite(); } } boolean exists(byte[] path) throws IOException { - return getEntry0(path) != null; + beginRead(); + try { + ensureOpen(); + return getEntry0(path) != null; + } finally { + endRead(); + } } boolean isDirectory(byte[] path) throws IOException { - synchronized (lock) { - if (buildDirTree) { - return getDirs().containsKey(new EntryName(path)); - } + if (buildDirTree) + return getDirs().containsKey(IndexNode.keyOf(path)); + + beginRead(); + try { Entry e = getEntry0(path); return (e != null && e.isDir()) || path.length == 0; + } finally { + endRead(); } } @@ -368,12 +380,14 @@ public class ZipFileSystem extends FileSystem { DirectoryStream.Filter filter) throws IOException { - synchronized (lock) { + beginWrite(); // iteration of inodes needs exclusive lock + try { + ensureOpen(); if (buildDirTree) { - IndexNode inode = getDirs().get(new EntryName(path)); + IndexNode inode = getDirs().get(IndexNode.keyOf(path)); if (inode == null) throw new NotDirectoryException(getString(path)); - List list = new ArrayList(); + List list = new ArrayList<>(); IndexNode child = inode.child; while (child != null) { ZipPath zp = toZipPath(child.name); @@ -386,25 +400,26 @@ public class ZipFileSystem extends FileSystem { if (!isDirectory(path)) throw new NotDirectoryException(getString(path)); - List list = new ArrayList(); - EntryName[] entries = getEntryNames(); + List list = new ArrayList<>(); path = toDirectoryPath(path); - for (EntryName en :entries) { - if (!isParentOf(path, en.name)) // is "path" the parent of "name" + for (IndexNode key : inodes.keySet()) { + if (!isParentOf(path, key.name)) // is "path" the parent of "name" continue; int off = path.length; - while (off < en.name.length) { - if (en.name[off] == '/') + while (off < key.name.length) { + if (key.name[off] == '/') break; off++; } - if (off < (en.name.length - 1)) + if (off < (key.name.length - 1)) continue; - ZipPath zp = toZipPath(en.name); + ZipPath zp = toZipPath(key.name); if (filter == null || filter.accept(zp)) list.add(zp); } return list.iterator(); + } finally { + endWrite(); } } @@ -413,16 +428,18 @@ public class ZipFileSystem extends FileSystem { { checkWritable(); dir = toDirectoryPath(dir); - synchronized (lock) { + beginWrite(); + try { ensureOpen(); - // pseudo root dir, or exiting dir - if (dir.length == 0 || exists(dir)) + if (dir.length == 0 || exists(dir)) // root dir, or exiting dir throw new FileAlreadyExistsException(getString(dir)); - checkParents(dir); + checkParents(dir); Entry e = new Entry(dir, Entry.NEW); - e.method = METHOD_STORED; // STORED for dir + e.method = METHOD_STORED; // STORED for dir update(e); + } finally { + endWrite(); } } @@ -432,7 +449,10 @@ public class ZipFileSystem extends FileSystem { checkWritable(); if (Arrays.equals(src, dst)) return; // do nothing, src and dst are the same - synchronized (lock) { + + beginWrite(); + try { + ensureOpen(); Entry eSrc = getEntry0(src); // ensureOpen checked if (eSrc == null) throw new NoSuchFileException(getString(src)); @@ -457,11 +477,6 @@ public class ZipFileSystem extends FileSystem { } Entry u = new Entry(eSrc, Entry.COPY); // copy eSrc entry u.name = dst; // change name - // don't touch the "nlen and elen" here. writeLOC() always - // re-calculate from "name" and "extra" for the correct length, - // copyLOCEntry however needs the original lengths to skip the - // loc header. - // u.nlen = dst.length; if (eSrc.type == Entry.NEW || eSrc.type == Entry.FILECH) { u.type = eSrc.type; // make it the same type @@ -475,10 +490,12 @@ public class ZipFileSystem extends FileSystem { } } if (!hasCopyAttrs) - u.mtime = u.atime= u.ctime = javaToDosTime(System.currentTimeMillis()); + u.mtime = u.atime= u.ctime = System.currentTimeMillis(); update(u); if (deletesrc) updateDelete(eSrc); + } finally { + endWrite(); } } @@ -501,7 +518,9 @@ public class ZipFileSystem extends FileSystem { if (opt == APPEND) hasAppend = true; } - synchronized (lock) { + beginRead(); // only need a readlock, the "update()" will + try { // try to obtain a writelock when the os is + ensureOpen(); // being closed. Entry e = getEntry0(path); if (e != null) { if (e.isDir() || hasCreateNew) @@ -512,27 +531,33 @@ public class ZipFileSystem extends FileSystem { copyStream(is, os); is.close(); return os; - } - return getOutputStream(new Entry(e, Entry.NEW)); + } + return getOutputStream(new Entry(e, Entry.NEW)); } else { if (!hasCreate && !hasCreateNew) throw new NoSuchFileException(getString(path)); checkParents(path); return getOutputStream(new Entry(path, Entry.NEW)); } + } finally { + endRead(); } } // Returns an input stream for reading the contents of the specified // file entry. InputStream newInputStream(byte[] path) throws IOException { - synchronized (lock) { + beginRead(); + try { + ensureOpen(); Entry e = getEntry0(path); if (e == null) throw new NoSuchFileException(getString(path)); if (e.isDir()) throw new FileSystemException(getString(path), "is a directory", null); return getInputStream(e); + } finally { + endRead(); } } @@ -559,78 +584,111 @@ public class ZipFileSystem extends FileSystem { if (options.contains(StandardOpenOption.WRITE) || options.contains(StandardOpenOption.APPEND)) { checkWritable(); - final WritableByteChannel wbc = Channels.newChannel(newOutputStream(path, - options.toArray(new OpenOption[0]))); - long leftover = 0;; - if (options.contains(StandardOpenOption.APPEND)) { - Entry e = getEntry0(path); - if (e != null && e.size >= 0) - leftover = e.size; + beginRead(); + try { + final WritableByteChannel wbc = Channels.newChannel( + newOutputStream(path, options.toArray(new OpenOption[0]))); + long leftover = 0; + if (options.contains(StandardOpenOption.APPEND)) { + Entry e = getEntry0(path); + if (e != null && e.size >= 0) + leftover = e.size; + } + final long offset = leftover; + return new SeekableByteChannel() { + long written = offset; + public boolean isOpen() { + return wbc.isOpen(); + } + + public long position() throws IOException { + return written; + } + + public SeekableByteChannel position(long pos) + throws IOException + { + throw new UnsupportedOperationException(); + } + + public int read(ByteBuffer dst) throws IOException { + throw new UnsupportedOperationException(); + } + + public SeekableByteChannel truncate(long size) + throws IOException + { + throw new UnsupportedOperationException(); + } + + public int write(ByteBuffer src) throws IOException { + int n = wbc.write(src); + written += n; + return n; + } + + public long size() throws IOException { + return written; + } + + public void close() throws IOException { + wbc.close(); + } + }; + } finally { + endRead(); } - final long offset = leftover; - return new SeekableByteChannel() { - long written = offset; - public boolean isOpen() { - return wbc.isOpen(); - } - public long position() throws IOException { - return written; - } - public SeekableByteChannel position(long pos) throws IOException { - throw new UnsupportedOperationException(); - } - public int read(ByteBuffer dst) throws IOException { - throw new UnsupportedOperationException(); - } - public SeekableByteChannel truncate(long size) throws IOException { - throw new UnsupportedOperationException(); - } - public int write(ByteBuffer src) throws IOException { - int n = wbc.write(src); - written += n; - return n; - } - public long size() throws IOException { - return written; - } - public void close() throws IOException { - wbc.close(); - } - }; } else { - Entry e = getEntry0(path); - if (e == null || e.isDir()) - throw new NoSuchFileException(getString(path)); - final ReadableByteChannel rbc = - Channels.newChannel(getInputStream(e)); - final long size = e.size; - return new SeekableByteChannel() { - long read = 0; - public boolean isOpen() { - return rbc.isOpen(); - } - public long position() throws IOException { - return read; - } - public SeekableByteChannel position(long pos) throws IOException { - throw new UnsupportedOperationException(); - } - public int read(ByteBuffer dst) throws IOException { - return rbc.read(dst); - } - public SeekableByteChannel truncate(long size) throws IOException { - throw new NonWritableChannelException(); - } - public int write (ByteBuffer src) throws IOException { - throw new NonWritableChannelException(); - } - public long size() throws IOException { - return size; - } - public void close() throws IOException { - rbc.close(); - } - }; + beginRead(); + try { + ensureOpen(); + Entry e = getEntry0(path); + if (e == null || e.isDir()) + throw new NoSuchFileException(getString(path)); + final ReadableByteChannel rbc = + Channels.newChannel(getInputStream(e)); + final long size = e.size; + return new SeekableByteChannel() { + long read = 0; + public boolean isOpen() { + return rbc.isOpen(); + } + + public long position() throws IOException { + return read; + } + + public SeekableByteChannel position(long pos) + throws IOException + { + throw new UnsupportedOperationException(); + } + + public int read(ByteBuffer dst) throws IOException { + return rbc.read(dst); + } + + public SeekableByteChannel truncate(long size) + throws IOException + { + throw new NonWritableChannelException(); + } + + public int write (ByteBuffer src) throws IOException { + throw new NonWritableChannelException(); + } + + public long size() throws IOException { + return size; + } + + public void close() throws IOException { + rbc.close(); + } + }; + } finally { + endRead(); + } } } @@ -647,125 +705,131 @@ public class ZipFileSystem extends FileSystem { checkOptions(options); final boolean forWrite = (options.contains(StandardOpenOption.WRITE) || options.contains(StandardOpenOption.APPEND)); - Entry e = getEntry0(path); - if (forWrite) { - checkWritable(); - if (e == null) { + beginRead(); + try { + ensureOpen(); + Entry e = getEntry0(path); + if (forWrite) { + checkWritable(); + if (e == null) { if (!options.contains(StandardOpenOption.CREATE_NEW)) throw new NoSuchFileException(getString(path)); - } else { - if (options.contains(StandardOpenOption.CREATE_NEW)) - throw new FileAlreadyExistsException(getString(path)); - if (e.isDir()) - throw new FileAlreadyExistsException("directory <" - + getString(path) + "> exists"); - } - options.remove(StandardOpenOption.CREATE_NEW); // for tmpfile - } else if (e == null || e.isDir()) { - throw new NoSuchFileException(getString(path)); - } - - final boolean isFCH = (e != null && e.type == Entry.FILECH); - final Path tmpfile = isFCH ? e.file : getTempPathForEntry(path); - final FileChannel fch = tmpfile.getFileSystem() - .provider() - .newFileChannel(tmpfile, options, attrs); - final Entry u = isFCH ? e : new Entry(path, tmpfile, Entry.FILECH); - if (forWrite) { - u.flag = FLAG_DATADESCR; - u.method = METHOD_DEFLATED; - } - // is there a better way to hook into the FileChannel's close method? - return new FileChannel() { - public int write(ByteBuffer src) throws IOException { - return fch.write(src); - } - public long write(ByteBuffer[] srcs, int offset, int length) - throws IOException - { - return fch.write(srcs, offset, length); - } - public long position() throws IOException { - return fch.position(); - } - public FileChannel position(long newPosition) - throws IOException - { - fch.position(newPosition); - return this; - } - public long size() throws IOException { - return fch.size(); - } - public FileChannel truncate(long size) - throws IOException - { - fch.truncate(size); - return this; - } - public void force(boolean metaData) - throws IOException - { - fch.force(metaData); - } - public long transferTo(long position, long count, - WritableByteChannel target) - throws IOException - { - return fch.transferTo(position, count, target); - } - public long transferFrom(ReadableByteChannel src, - long position, long count) - throws IOException - { - return fch.transferFrom(src, position, count); - } - public int read(ByteBuffer dst) throws IOException { - return fch.read(dst); - } - public int read(ByteBuffer dst, long position) - throws IOException - { - return fch.read(dst, position); - } - public long read(ByteBuffer[] dsts, int offset, int length) - throws IOException - { - return fch.read(dsts, offset, length); - } - public int write(ByteBuffer src, long position) - throws IOException - { - return fch.write(src, position); - } - public MappedByteBuffer map(MapMode mode, - long position, long size) - throws IOException - { - throw new UnsupportedOperationException(); - } - public FileLock lock(long position, long size, boolean shared) - throws IOException - { - return fch.lock(position, size, shared); - } - public FileLock tryLock(long position, long size, boolean shared) - throws IOException - { - return fch.tryLock(position, size, shared); - } - protected void implCloseChannel() throws IOException { - fch.close(); - if (forWrite) { - u.mtime = javaToDosTime(System.currentTimeMillis()); - u.size = Attributes.readBasicFileAttributes(u.file).size(); - update(u); } else { - if (!isFCH) // if this is a new fch for reading - removeTempPathForEntry(tmpfile); + if (options.contains(StandardOpenOption.CREATE_NEW)) + throw new FileAlreadyExistsException(getString(path)); + if (e.isDir()) + throw new FileAlreadyExistsException("directory <" + + getString(path) + "> exists"); } + options.remove(StandardOpenOption.CREATE_NEW); // for tmpfile + } else if (e == null || e.isDir()) { + throw new NoSuchFileException(getString(path)); } - }; + + final boolean isFCH = (e != null && e.type == Entry.FILECH); + final Path tmpfile = isFCH ? e.file : getTempPathForEntry(path); + final FileChannel fch = tmpfile.getFileSystem() + .provider() + .newFileChannel(tmpfile, options, attrs); + final Entry u = isFCH ? e : new Entry(path, tmpfile, Entry.FILECH); + if (forWrite) { + u.flag = FLAG_DATADESCR; + u.method = METHOD_DEFLATED; + } + // is there a better way to hook into the FileChannel's close method? + return new FileChannel() { + public int write(ByteBuffer src) throws IOException { + return fch.write(src); + } + public long write(ByteBuffer[] srcs, int offset, int length) + throws IOException + { + return fch.write(srcs, offset, length); + } + public long position() throws IOException { + return fch.position(); + } + public FileChannel position(long newPosition) + throws IOException + { + fch.position(newPosition); + return this; + } + public long size() throws IOException { + return fch.size(); + } + public FileChannel truncate(long size) + throws IOException + { + fch.truncate(size); + return this; + } + public void force(boolean metaData) + throws IOException + { + fch.force(metaData); + } + public long transferTo(long position, long count, + WritableByteChannel target) + throws IOException + { + return fch.transferTo(position, count, target); + } + public long transferFrom(ReadableByteChannel src, + long position, long count) + throws IOException + { + return fch.transferFrom(src, position, count); + } + public int read(ByteBuffer dst) throws IOException { + return fch.read(dst); + } + public int read(ByteBuffer dst, long position) + throws IOException + { + return fch.read(dst, position); + } + public long read(ByteBuffer[] dsts, int offset, int length) + throws IOException + { + return fch.read(dsts, offset, length); + } + public int write(ByteBuffer src, long position) + throws IOException + { + return fch.write(src, position); + } + public MappedByteBuffer map(MapMode mode, + long position, long size) + throws IOException + { + throw new UnsupportedOperationException(); + } + public FileLock lock(long position, long size, boolean shared) + throws IOException + { + return fch.lock(position, size, shared); + } + public FileLock tryLock(long position, long size, boolean shared) + throws IOException + { + return fch.tryLock(position, size, shared); + } + protected void implCloseChannel() throws IOException { + fch.close(); + if (forWrite) { + u.mtime = System.currentTimeMillis(); + u.size = Attributes.readBasicFileAttributes(u.file).size(); + update(u); + } else { + if (!isFCH) // if this is a new fch for reading + removeTempPathForEntry(tmpfile); + } + } + }; + } finally { + endRead(); + } } // the outstanding input streams that need to be closed @@ -776,11 +840,9 @@ public class ZipFileSystem extends FileSystem { // input streams are all closed by the obtainers. private Set exChClosers = new HashSet<>(); - private Set tmppaths = new HashSet<>(); + private Set tmppaths = Collections.synchronizedSet(new HashSet()); private Path getTempPathForEntry(byte[] path) throws IOException { Path tmpPath = createTempFileInSameDirectoryAs(zfpath); - tmppaths.add(tmpPath); - if (path != null) { Entry e = getEntry0(path); if (e != null) { @@ -805,9 +867,14 @@ public class ZipFileSystem extends FileSystem { // check if all parents really exit. ZIP spec does not require // the existence of any "parent directory". private void checkParents(byte[] path) throws IOException { - while ((path = getParent(path)) != null) { - if (!inodes.containsKey(new EntryName(path))) - throw new NoSuchFileException(getString(path)); + beginRead(); + try { + while ((path = getParent(path)) != null) { + if (!inodes.containsKey(IndexNode.keyOf(path))) + throw new NoSuchFileException(getString(path)); + } + } finally { + endRead(); } } @@ -839,25 +906,40 @@ public class ZipFileSystem extends FileSystem { return true; } - /////////////////////////////////////////////////////////////////// - private void initZipFile() throws IOException { - ch = zfpath.newByteChannel(READ); - initCEN(); + private final void beginWrite() { + rwlock.writeLock().lock(); } + private final void endWrite() { + rwlock.writeLock().unlock(); + } + + private final void beginRead() { + rwlock.readLock().lock(); + } + + private final void endRead() { + rwlock.readLock().unlock(); + } + + /////////////////////////////////////////////////////////////////// + private volatile boolean isOpen = true; - private SeekableByteChannel ch; // channel to the zipfile - ByteBuffer cen; // CEN & ENDHDR + private final SeekableByteChannel ch; // channel to the zipfile + final byte[] cen; // CEN & ENDHDR private END end; private long locpos; // position of first LOC header (usually 0) - // name -> pos (in cen), package private for ZipInfo - LinkedHashMap inodes; + private final ReadWriteLock rwlock = new ReentrantReadWriteLock(); - byte[] getBytes(String name) { + // name -> pos (in cen), IndexNode itself can be used as a "key" + private LinkedHashMap inodes; + + final byte[] getBytes(String name) { return zc.getBytes(name); } - String getString(byte[] name) { + + final String getString(byte[] name) { return zc.toString(name); } @@ -881,7 +963,7 @@ public class ZipFileSystem extends FileSystem { // Reads len bytes of data from the specified offset into buf. // Returns the total number of bytes read. // Each/every byte read from here (except the cen, which is mapped). - private long readFullyAt(byte[] buf, int off, long len, long pos) + final long readFullyAt(byte[] buf, int off, long len, long pos) throws IOException { ByteBuffer bb = ByteBuffer.wrap(buf); @@ -890,7 +972,7 @@ public class ZipFileSystem extends FileSystem { return readFullyAt(bb, pos); } - private long readFullyAt(ByteBuffer bb, long pos) + private final long readFullyAt(ByteBuffer bb, long pos) throws IOException { synchronized(ch) { @@ -971,12 +1053,12 @@ public class ZipFileSystem extends FileSystem { // CEN header, otherwise returns -1 if an error occured. If zip->msg != NULL // then the error was a zip format error and zip->msg has the error text. // Always pass in -1 for knownTotal; it's used for a recursive call. - private long initCEN() throws IOException { + private byte[] initCEN() throws IOException { end = findEND(); if (end.endpos == 0) { - inodes = new LinkedHashMap(10); + inodes = new LinkedHashMap<>(10); locpos = 0; - return 0; // only END header present + return null; // only END header present } if (end.cenlen > end.endpos) zerror("invalid END header (bad central directory size)"); @@ -989,18 +1071,14 @@ public class ZipFileSystem extends FileSystem { zerror("invalid END header (bad central directory offset)"); // read in the CEN and END - cen = ByteBuffer.allocate((int)(end.cenlen + ENDHDR)); - if (readFullyAt(cen, cenpos) != end.cenlen + ENDHDR) { + byte[] cen = new byte[(int)(end.cenlen + ENDHDR)]; + if (readFullyAt(cen, 0, cen.length, cenpos) != end.cenlen + ENDHDR) { zerror("read CEN tables failed"); } - cen.order(ByteOrder.LITTLE_ENDIAN).flip(); - // Iterate through the entries in the central directory - inodes = new LinkedHashMap(end.centot + 1); + inodes = new LinkedHashMap<>(end.centot + 1); int pos = 0; - int limit = cen.remaining() - ENDHDR; - int i = 0; - byte[] bBuf = new byte[1024]; + int limit = cen.length - ENDHDR; while (pos < limit) { if (CENSIG(cen, pos) != CENSIG) zerror("invalid CEN header (bad signature)"); @@ -1011,24 +1089,19 @@ public class ZipFileSystem extends FileSystem { if ((CENFLG(cen, pos) & 1) != 0) zerror("invalid CEN header (encrypted entry)"); if (method != METHOD_STORED && method != METHOD_DEFLATED) - zerror("invalid CEN header (bad compression method: " + method + ")"); + zerror("invalid CEN header (unsupported compression method: " + method + ")"); if (pos + CENHDR + nlen > limit) zerror("invalid CEN header (bad header size)"); - if (bBuf.length < nlen) - bBuf = new byte[nlen]; - cen.position(pos + CENHDR); - byte[] name = new byte[nlen]; - cen.get(name); - inodes.put(new EntryName(name), new IndexNode(name, pos)); + byte[] name = Arrays.copyOfRange(cen, pos + CENHDR, pos + CENHDR + nlen); + IndexNode inode = new IndexNode(name, pos); + inodes.put(inode, inode); // skip ext and comment - cen.position(pos += (CENHDR + nlen + elen + clen)); - i++; + pos += (CENHDR + nlen + elen + clen); } - if (cen.remaining() != ENDHDR) { + if (pos + ENDHDR != cen.length) { zerror("invalid CEN header (bad header size)"); } - dirs = null; // clear the dir map - return cenpos; + return cen; } private void ensureOpen() throws IOException { @@ -1038,27 +1111,40 @@ public class ZipFileSystem extends FileSystem { // Creates a new empty temporary file in the same directory as the // specified file. A variant of File.createTempFile. - private static Path createTempFileInSameDirectoryAs(Path path) + private Path createTempFileInSameDirectoryAs(Path path) throws IOException { Path parent = path.toAbsolutePath().getParent(); String dir = (parent == null)? "." : parent.toString(); - return File.createTempFile("zipfstmp", null, new File(dir)).toPath(); + Path tmpPath = File.createTempFile("zipfstmp", null, new File(dir)).toPath(); + tmppaths.add(tmpPath); + return tmpPath; } ////////////////////update & sync ////////////////////////////////////// private boolean hasUpdate = false; + private void updateDelete(Entry e) { - EntryName en = new EntryName(e.name); - inodes.remove(en); - hasUpdate = true; + beginWrite(); + try { + inodes.remove(IndexNode.keyOf(e.name)); //inodes.remove(e.name); + hasUpdate = true; + dirs = null; + } finally { + endWrite(); + } } private void update(Entry e) { - EntryName en = new EntryName(e.name); - inodes.put(en, e); - hasUpdate = true; + beginWrite(); + try { + inodes.put(IndexNode.keyOf(e.name), e); //inodes.put(e, e); + hasUpdate = true; + dirs = null; + } finally { + endWrite(); + } } // copy over the whole LOC entry (header if necessary, data and ext) from @@ -1080,13 +1166,20 @@ public class ZipFileSystem extends FileSystem { else size = 16; } - if (updateHeader) { // if we need update the loc header - locoff += LOCHDR + e.nlen + e.elen; // skip header + // read loc, use the original loc.elen/nlen + if (readFullyAt(buf, 0, LOCHDR , locoff) != LOCHDR) + throw new ZipException("loc: reading failed"); + if (updateHeader) { + locoff += LOCHDR + LOCNAM(buf) + LOCEXT(buf); // skip header size += e.csize; written = e.writeLOC(os) + size; } else { - size += LOCHDR + e.nlen + e.elen + e.csize; - written = size; + os.write(buf, 0, LOCHDR); // write out the loc header + locoff += LOCHDR; + // use e.csize, LOCSIZ(buf) is zero if FLAG_DATADESCR is on + // size += LOCNAM(buf) + LOCEXT(buf) + LOCSIZ(buf); + size += LOCNAM(buf) + LOCEXT(buf) + e.csize; + written = LOCHDR + size; } int n; while (size > 0 && @@ -1103,7 +1196,7 @@ public class ZipFileSystem extends FileSystem { // sync the zip file system, if there is any udpate private void sync() throws IOException { - assert Thread.holdsLock(this); + //System.out.printf("->sync(%s) starting....!%n", toString()); // check ex-closer if (!exChClosers.isEmpty()) { @@ -1117,7 +1210,6 @@ public class ZipFileSystem extends FileSystem { } if (!hasUpdate) return; - Path tmpFile = createTempFileInSameDirectoryAs(zfpath); OutputStream os = tmpFile.newOutputStream(WRITE); ArrayList elist = new ArrayList<>(inodes.size()); @@ -1174,7 +1266,7 @@ public class ZipFileSystem extends FileSystem { x.printStackTrace(); // skip any in-accurate entry } } else { // unchanged inode - e = Entry.readCEN(cen, inode.pos); + e = Entry.readCEN(this, inode.pos); try { written += copyLOCEntry(e, false, os, written, buf); elist.add(e); @@ -1195,6 +1287,11 @@ public class ZipFileSystem extends FileSystem { os.close(); if (!streams.isEmpty()) { + // + // TBD: ExChannelCloser should not be necessary if we only + // sync when being closed, all streams should have been + // closed already. Keep the logic here for now. + // // There are outstanding input streams open on existing "ch", // so, don't close the "cha" and delete the "file for now, let // the "ex-channel-closer" to handle them @@ -1209,45 +1306,41 @@ public class ZipFileSystem extends FileSystem { ch.close(); zfpath.delete(); } + tmpFile.moveTo(zfpath, REPLACE_EXISTING); hasUpdate = false; // clear - + /* if (isOpen) { ch = zfpath.newByteChannel(READ); // re-fresh "ch" and "cen" - initCEN(); + cen = initCEN(); } - //System.out.println("->sync() done!"); + */ + //System.out.printf("->sync(%s) done!%n", toString()); } private Entry getEntry0(byte[] path) throws IOException { - assert Thread.holdsLock(this); - if (path == null) throw new NullPointerException("path"); if (path.length == 0) return null; - EntryName en = new EntryName(path); IndexNode inode = null; - synchronized (lock) { - ensureOpen(); - if ((inode = inodes.get(en)) == null) { - if (path[path.length -1] == '/') // already has a slash - return null; - path = Arrays.copyOf(path, path.length + 1); - path[path.length - 1] = '/'; - en.name(path); - if ((inode = inodes.get(en)) == null) - return null; - } - if (inode instanceof Entry) - return (Entry)inode; - return Entry.readCEN(cen, inode.pos); + IndexNode key = IndexNode.keyOf(path); + if ((inode = inodes.get(key)) == null) { + if (path[path.length -1] == '/') // already has a slash + return null; + path = Arrays.copyOf(path, path.length + 1); + path[path.length - 1] = '/'; + if ((inode = inodes.get(key.as(path))) == null) + return null; } + if (inode instanceof Entry) + return (Entry)inode; + return Entry.readCEN(this, inode.pos); } // Test if the "name" a parent directory of any entry (dir empty) boolean isAncestor(byte[] name) { - for (Map.Entry entry : inodes.entrySet()) { + for (Map.Entry entry : inodes.entrySet()) { byte[] ename = entry.getKey().name; if (isParentOf(name, ename)) return true; @@ -1259,18 +1352,16 @@ public class ZipFileSystem extends FileSystem { throws IOException { checkWritable(); - synchronized(lock) { - Entry e = getEntry0(path); - if (e == null) { - if (path != null && path.length == 0) - throw new ZipException("root directory can't not be delete"); - if (failIfNotExists) - throw new NoSuchFileException(getString(path)); - } else { - if (e.isDir() && isAncestor(path)) - throw new DirectoryNotEmptyException(getString(path)); - updateDelete(e); - } + Entry e = getEntry0(path); + if (e == null) { + if (path != null && path.length == 0) + throw new ZipException("root directory can't not be delete"); + if (failIfNotExists) + throw new NoSuchFileException(getString(path)); + } else { + if (e.isDir() && isAncestor(path)) + throw new DirectoryNotEmptyException(getString(path)); + updateDelete(e); } } @@ -1289,9 +1380,8 @@ public class ZipFileSystem extends FileSystem { // (2) updating/replacing the contents of the specified existing entry. private OutputStream getOutputStream(Entry e) throws IOException { - ensureOpen(); if (e.mtime == -1) - e.mtime = javaToDosTime(System.currentTimeMillis()); + e.mtime = System.currentTimeMillis(); if (e.method == -1) e.method = METHOD_DEFLATED; // TBD: use default method // store size, compressed size, and crc-32 in LOC header @@ -1334,7 +1424,7 @@ public class ZipFileSystem extends FileSystem { long bufSize = e.size + 2; // Inflater likes a bit of slack if (bufSize > 65536) bufSize = 8192; - final long size = e.size;; + final long size = e.size; eis = new InflaterInputStream(eis, getInflater(), (int)bufSize) { private boolean isClosed = false; @@ -1343,6 +1433,7 @@ public class ZipFileSystem extends FileSystem { releaseInflater(inf); this.in.close(); isClosed = true; + streams.remove(this); } } // Override fill() method to provide an extra "dummy" byte @@ -1372,7 +1463,9 @@ public class ZipFileSystem extends FileSystem { Integer.MAX_VALUE : (int) avail; } }; - } else if (e.method != METHOD_STORED) { + } else if (e.method == METHOD_STORED) { + // TBD: wrap/ it does not seem necessary + } else { throw new ZipException("invalid compression method"); } streams.add(eis); @@ -1382,11 +1475,11 @@ public class ZipFileSystem extends FileSystem { // Inner class implementing the input stream used to read // a (possibly compressed) zip file entry. private class EntryInputStream extends InputStream { - private SeekableByteChannel zfch; // local ref to zipfs's "ch". zipfs.ch might + private final SeekableByteChannel zfch; // local ref to zipfs's "ch". zipfs.ch might // point to a new channel after sync() private long pos; // current position within entry data protected long rem; // number of remaining bytes within entry - protected long size; // uncompressed size of this entry + protected final long size; // uncompressed size of this entry EntryInputStream(Entry e, SeekableByteChannel zfch) throws IOException @@ -1527,14 +1620,14 @@ public class ZipFileSystem extends FileSystem { } } - private static void zerror(String msg) { + static void zerror(String msg) { throw new ZipError(msg); } // Maxmum number of de/inflater we cache private final int MAX_FLATER = 20; // List of available Inflater objects for decompression - private List inflaters = new ArrayList<>(); + private final List inflaters = new ArrayList<>(); // Gets an inflater from the list of available inflaters or allocates // a new one. @@ -1563,7 +1656,7 @@ public class ZipFileSystem extends FileSystem { } // List of available Deflater objects for compression - private List deflaters = new ArrayList<>(); + private final List deflaters = new ArrayList<>(); // Gets an deflater from the list of available deflaters or allocates // a new one. @@ -1660,44 +1753,40 @@ public class ZipFileSystem extends FileSystem { } } - // wrapper for the byte[] name - static class EntryName { + // Internal node that links a "name" to its pos in cen table. + // The node itself can be used as a "key" to lookup itself in + // the HashMap inodes. + static class IndexNode { byte[] name; - int hashcode; // node is hashable/hashed by its name - - public EntryName (byte[] name) { - name(name); + int hashcode; // node is hashable/hashed by its name + int pos = -1; // postion in cen table, -1 menas the + // entry does not exists in zip file + IndexNode(byte[] name, int pos) { + as(name); + this.pos = pos; } - void name(byte[] name) { - this.name = name; + final static IndexNode keyOf(byte[] name) { // get a lookup key; + return new IndexNode(name, -1); + } + + final IndexNode as(byte[] name) { // reuse the node, mostly + this.name = name; // as a lookup "key" this.hashcode = Arrays.hashCode(name); + return this; } public boolean equals(Object other) { - if (!(other instanceof EntryName)) + if (!(other instanceof IndexNode)) return false; - return Arrays.equals(name, ((EntryName)other).name); + return Arrays.equals(name, ((IndexNode)other).name); } public int hashCode() { return hashcode; } - } - - // can simply use Integer instead, if we don't use it to - // build a internal node tree. - static class IndexNode { - byte[] name; - int pos = -1; // postion in cen table, -1 menas the - // entry does not exists in zip file - IndexNode(byte[] name, int pos) { - this.name = name; - this.pos = pos; - } IndexNode() {} - IndexNode sibling; IndexNode child; // 1st child } @@ -1723,37 +1812,25 @@ public class ZipFileSystem extends FileSystem { long crc = -1; // crc-32 of entry data long csize = -1; // compressed size of entry data long size = -1; // uncompressed size of entry data - int nlen; - int elen; byte[] extra; - // loc - long startPos; - long endPos; // exclusive - // cen int versionMade; int disk; int attrs; long attrsEx; long locoff; - - int clen; byte[] comment; - // ZIP64 flag - boolean hasZip64; - Entry() {} Entry(byte[] name) { - this.name = name; - //this.nlen = name.length; - this.mtime = javaToDosTime(System.currentTimeMillis()); - this.crc = 0; - this.size = 0; - this.csize = 0; - this.method = METHOD_DEFLATED; + this.name = name; + this.mtime = System.currentTimeMillis(); + this.crc = 0; + this.size = 0; + this.csize = 0; + this.method = METHOD_DEFLATED; } Entry(byte[] name, int type) { @@ -1761,16 +1838,9 @@ public class ZipFileSystem extends FileSystem { this.type = type; } - Entry (byte[] name, Path file, int type) { - this(name, type); - this.file = file; - this.method = METHOD_STORED; - } - - Entry(Entry e) { + Entry (Entry e, int type) { this.version = e.version; - this.name = e.name; // copyOf? - this.nlen = e.nlen; + this.name = e.name; this.ctime = e.ctime; this.atime = e.atime; this.mtime = e.mtime; @@ -1778,25 +1848,21 @@ public class ZipFileSystem extends FileSystem { this.size = e.size; this.csize = e.csize; this.method = e.method; - this.extra = (e.extra == null)? - null:Arrays.copyOf(e.extra, e.extra.length); - this.elen = e.elen; + this.extra = e.extra; this.versionMade = e.versionMade; this.disk = e.disk; this.attrs = e.attrs; this.attrsEx = e.attrsEx; this.locoff = e.locoff; - this.clen = e.clen; - this.comment = (e.comment == null)? - null:Arrays.copyOf(e.comment, e.comment.length); - this.startPos = e.startPos; - this.endPos = e.endPos; - this.hasZip64 = e.hasZip64;; + this.comment = e.comment; + + this.type = type; } - Entry (Entry e, int type) { - this(e); - this.type = type; + Entry (byte[] name, Path file, int type) { + this(name, type); + this.file = file; + this.method = METHOD_STORED; } boolean isDir() { @@ -1814,77 +1880,45 @@ public class ZipFileSystem extends FileSystem { } ///////////////////// CEN ////////////////////// - static Entry readCEN(ByteBuffer cen, int pos) throws IOException + static Entry readCEN(ZipFileSystem zipfs, int pos) + throws IOException { - return new Entry().cen(cen, pos); + return new Entry().cen(zipfs, pos); } - private Entry cen(ByteBuffer cen, int pos) throws IOException + private Entry cen(ZipFileSystem zipfs, int pos) + throws IOException { + byte[] cen = zipfs.cen; if (CENSIG(cen, pos) != CENSIG) zerror("invalid CEN header (bad signature)"); versionMade = CENVEM(cen, pos); version = CENVER(cen, pos); flag = CENFLG(cen, pos); method = CENHOW(cen, pos); - mtime = CENTIM(cen, pos); + mtime = dosToJavaTime(CENTIM(cen, pos)); crc = CENCRC(cen, pos); csize = CENSIZ(cen, pos); size = CENLEN(cen, pos); - nlen = CENNAM(cen, pos); - elen = CENEXT(cen, pos); - clen = CENCOM(cen, pos); + int nlen = CENNAM(cen, pos); + int elen = CENEXT(cen, pos); + int clen = CENCOM(cen, pos); disk = CENDSK(cen, pos); attrs = CENATT(cen, pos); attrsEx = CENATX(cen, pos); locoff = CENOFF(cen, pos); - cen.position(pos + CENHDR); - name = new byte[nlen]; - cen.get(name); + pos += CENHDR; + name = Arrays.copyOfRange(cen, pos, pos + nlen); + pos += nlen; if (elen > 0) { - extra = new byte[elen]; - cen.get(extra); - if (csize == ZIP64_MINVAL || size == ZIP64_MINVAL || - locoff == ZIP64_MINVAL) { - int off = 0; - while (off + 4 < elen) { - // extra spec: HeaderID+DataSize+Data - int sz = SH(extra, off + 2); - if (SH(extra, off) == EXTID_ZIP64) { - off += 4; - if (size == ZIP64_MINVAL) { - // if invalid zip64 extra fields, just skip - if (sz < 8 || (off + 8) > elen) - break; - size = LL(extra, off); - sz -= 8; - off += 8; - } - if (csize == ZIP64_MINVAL) { - if (sz < 8 || (off + 8) > elen) - break; - csize = LL(extra, off); - sz -= 8; - off += 8; - } - if (locoff == ZIP64_MINVAL) { - if (sz < 8 || (off + 8) > elen) - break; - locoff = LL(extra, off); - sz -= 8; - off += 8; - } - break; - } - off += (sz + 4); - } - } + extra = Arrays.copyOfRange(cen, pos, pos + elen); + pos += elen; + readExtra(zipfs); } if (clen > 0) { - comment = new byte[clen]; - cen.get(comment); + comment = Arrays.copyOfRange(cen, pos, pos + clen); } return this; } @@ -1897,31 +1931,37 @@ public class ZipFileSystem extends FileSystem { long csize0 = csize; long size0 = size; long locoff0 = locoff; - int e64len = 0; + int elen64 = 0; // extra for ZIP64 + int elenNTFS = 0; // extra for NTFS (a/c/mtime) + int elenEXTT = 0; // extra for Extended Timestamp // confirm size/length - nlen = (name != null) ? name.length : 0; - elen = (extra != null) ? extra.length : 0; - clen = (comment != null) ? comment.length : 0; - - boolean hasZip64 = false; + int nlen = (name != null) ? name.length : 0; + int elen = (extra != null) ? extra.length : 0; + int clen = (comment != null) ? comment.length : 0; if (csize >= ZIP64_MINVAL) { csize0 = ZIP64_MINVAL; - e64len += 8; // csize(8) - hasZip64 = true; + elen64 += 8; // csize(8) } if (size >= ZIP64_MINVAL) { size0 = ZIP64_MINVAL; // size(8) - e64len += 8; - hasZip64 = true; + elen64 += 8; } if (locoff >= ZIP64_MINVAL) { locoff0 = ZIP64_MINVAL; - e64len += 8; // offset(8) - hasZip64 = true; + elen64 += 8; // offset(8) + } + if (elen64 != 0) + elen64 += 4; // header and data sz 4 bytes + + if (atime != -1) { + if (isWindows) // use NTFS + elenNTFS = 36; // total 36 bytes + else // Extended Timestamp otherwise + elenEXTT = 9; // only mtime in cen } writeInt(os, CENSIG); // CEN header signature - if (hasZip64) { + if (elen64 != 0) { writeShort(os, 45); // ver 4.5 for zip64 writeShort(os, 45); } else { @@ -1930,18 +1970,14 @@ public class ZipFileSystem extends FileSystem { } writeShort(os, flag); // general purpose bit flag writeShort(os, method); // compression method - writeInt(os, mtime); // last modification time + // last modification time + writeInt(os, (int)javaToDosTime(mtime)); writeInt(os, crc); // crc-32 writeInt(os, csize0); // compressed size writeInt(os, size0); // uncompressed size writeShort(os, name.length); + writeShort(os, elen + elen64 + elenNTFS + elenEXTT); - if (hasZip64) { - // + headid(2) + datasize(2) - writeShort(os, e64len + 4 + elen); - } else { - writeShort(os, elen); - } if (comment != null) { writeShort(os, Math.min(clen, 0xffff)); } else { @@ -1952,9 +1988,9 @@ public class ZipFileSystem extends FileSystem { writeInt(os, 0); // external file attributes (unused) writeInt(os, locoff0); // relative offset of local header writeBytes(os, name); - if (hasZip64) { + if (elen64 != 0) { writeShort(os, EXTID_ZIP64);// Zip64 extra - writeShort(os, e64len); + writeShort(os, elen64); // size of "this" extra block if (size0 == ZIP64_MINVAL) writeLong(os, size); if (csize0 == ZIP64_MINVAL) @@ -1962,58 +1998,73 @@ public class ZipFileSystem extends FileSystem { if (locoff0 == ZIP64_MINVAL) writeLong(os, locoff); } - if (extra != null) { + if (elenNTFS != 0) { + // System.out.println("writing NTFS:" + elenNTFS); + writeShort(os, EXTID_NTFS); + writeShort(os, elenNTFS - 4); + writeInt(os, 0); // reserved + writeShort(os, 0x0001); // NTFS attr tag + writeShort(os, 24); + writeLong(os, javaToWinTime(mtime)); + writeLong(os, javaToWinTime(atime)); + writeLong(os, javaToWinTime(ctime)); + } + if (elenEXTT != 0) { + writeShort(os, EXTID_EXTT); + writeShort(os, elenEXTT - 4); + if (ctime == -1) + os.write(0x3); // mtime and atime + else + os.write(0x7); // mtime, atime and ctime + writeInt(os, javaToUnixTime(mtime)); + } + if (extra != null) // whatever not recognized writeBytes(os, extra); - } - if (comment != null) { - //TBD: 0, Math.min(commentBytes.length, 0xffff)); + if (comment != null) //TBD: 0, Math.min(commentBytes.length, 0xffff)); writeBytes(os, comment); - } - return CENHDR + nlen + elen + clen + (hasZip64?(e64len + 4):0); + return CENHDR + nlen + elen + clen + elen64 + elenNTFS + elenEXTT; } ///////////////////// LOC ////////////////////// - static Entry readLOC(ZipFileSystem zf, long pos) + static Entry readLOC(ZipFileSystem zipfs, long pos) throws IOException { - return readLOC(zf, pos, new byte[1024]); + return readLOC(zipfs, pos, new byte[1024]); } - static Entry readLOC(ZipFileSystem zf, long pos, byte[] buf) + static Entry readLOC(ZipFileSystem zipfs, long pos, byte[] buf) throws IOException { - return new Entry().loc(zf, pos, buf); + return new Entry().loc(zipfs, pos, buf); } - Entry loc(ZipFileSystem zf, long pos, byte[] buf) + Entry loc(ZipFileSystem zipfs, long pos, byte[] buf) throws IOException { assert (buf.length >= LOCHDR); - if (zf.readFullyAt(buf, 0, LOCHDR , pos) != LOCHDR) { + if (zipfs.readFullyAt(buf, 0, LOCHDR , pos) != LOCHDR) throw new ZipException("loc: reading failed"); - } - if (LOCSIG(buf) != LOCSIG) { + if (LOCSIG(buf) != LOCSIG) throw new ZipException("loc: wrong sig ->" + Long.toString(LOCSIG(buf), 16)); - } - startPos = pos; + //startPos = pos; version = LOCVER(buf); flag = LOCFLG(buf); method = LOCHOW(buf); - mtime = LOCTIM(buf); + mtime = dosToJavaTime(LOCTIM(buf)); crc = LOCCRC(buf); csize = LOCSIZ(buf); size = LOCLEN(buf); - nlen = LOCNAM(buf); - elen = LOCEXT(buf); + int nlen = LOCNAM(buf); + int elen = LOCEXT(buf); name = new byte[nlen]; - if (zf.readFullyAt(name, 0, nlen, pos + LOCHDR) != nlen) { + if (zipfs.readFullyAt(name, 0, nlen, pos + LOCHDR) != nlen) { throw new ZipException("loc: name reading failed"); } if (elen > 0) { extra = new byte[elen]; - if (zf.readFullyAt(extra, 0, elen, pos + LOCHDR + nlen) + if (zipfs.readFullyAt(extra, 0, elen, pos + LOCHDR + nlen) != elen) { throw new ZipException("loc: ext reading failed"); } @@ -2021,7 +2072,7 @@ public class ZipFileSystem extends FileSystem { pos += (LOCHDR + nlen + elen); if ((flag & FLAG_DATADESCR) != 0) { // Data Descriptor - Entry e = zf.getEntry0(name); // get the size/csize from cen + Entry e = zipfs.getEntry0(name); // get the size/csize from cen if (e == null) throw new ZipException("loc: name not found in cen"); size = e.size; @@ -2032,7 +2083,6 @@ public class ZipFileSystem extends FileSystem { else pos += 16; } else { - boolean hasZip64 = false; if (extra != null && (size == ZIP64_MINVAL || csize == ZIP64_MINVAL)) { // zip64 ext: must include both size and csize @@ -2042,7 +2092,6 @@ public class ZipFileSystem extends FileSystem { if (SH(extra, off) == EXTID_ZIP64 && sz == 16) { size = LL(extra, off + 4); csize = LL(extra, off + 12); - hasZip64 = true; break; } off += (sz + 4); @@ -2050,7 +2099,6 @@ public class ZipFileSystem extends FileSystem { } pos += (method == METHOD_STORED ? size : csize); } - endPos = pos; return this; } @@ -2058,14 +2106,18 @@ public class ZipFileSystem extends FileSystem { throws IOException { writeInt(os, LOCSIG); // LOC header signature - int version = version(); + + int nlen = (name != null) ? name.length : 0; + int elen = (extra != null) ? extra.length : 0; + int elen64 = 0; + int elenEXTT = 0; if ((flag & FLAG_DATADESCR) != 0) { writeShort(os, version()); // version needed to extract writeShort(os, flag); // general purpose bit flag writeShort(os, method); // compression method - writeInt(os, mtime); // last modification time - + // last modification time + writeInt(os, (int)javaToDosTime(mtime)); // store size, uncompressed size, and crc-32 in data descriptor // immediately following compressed entry data writeInt(os, 0); @@ -2073,7 +2125,7 @@ public class ZipFileSystem extends FileSystem { writeInt(os, 0); } else { if (csize >= ZIP64_MINVAL || size >= ZIP64_MINVAL) { - hasZip64 = true; + elen64 = 20; //headid(2) + size(2) + size(8) + csize(8) writeShort(os, 45); // ver 4.5 for zip64 } else { writeShort(os, version()); // version needed to extract @@ -2082,29 +2134,45 @@ public class ZipFileSystem extends FileSystem { writeShort(os, method); // compression method writeInt(os, mtime); // last modification time writeInt(os, crc); // crc-32 - if (hasZip64) { + if (elen64 != 0) { writeInt(os, ZIP64_MINVAL); writeInt(os, ZIP64_MINVAL); - //TBD: e.elen += 20; //headid(2) + size(2) + size(8) + csize(8) } else { writeInt(os, csize); // compressed size writeInt(os, size); // uncompressed size } } + if (atime != -1 && !isWindows) { // on unix use "ext time" + if (ctime == -1) + elenEXTT = 13; + else + elenEXTT = 17; + } writeShort(os, name.length); - writeShort(os, elen + (hasZip64 ? 20 : 0)); + writeShort(os, elen + elen64 + elenEXTT); writeBytes(os, name); - if (hasZip64) { - // TBD: should we update extra directory? + if (elen64 != 0) { writeShort(os, EXTID_ZIP64); writeShort(os, 16); writeLong(os, size); writeLong(os, csize); } + if (elenEXTT != 0) { + writeShort(os, EXTID_EXTT); + writeShort(os, elenEXTT - 4);// size for the folowing data block + if (ctime == -1) + os.write(0x3); // mtime and atime + else + os.write(0x7); // mtime, atime and ctime + writeInt(os, javaToUnixTime(mtime)); + writeInt(os, javaToUnixTime(atime)); + if (ctime != -1) + writeInt(os, javaToUnixTime(ctime)); + } if (extra != null) { writeBytes(os, extra); } - return LOCHDR + name.length + elen + (hasZip64 ? 20 : 0); + return LOCHDR + name.length + elen + elen64 + elenEXTT; } // Data Descriptior @@ -2125,17 +2193,18 @@ public class ZipFileSystem extends FileSystem { } // read NTFS, UNIX and ZIP64 data from cen.extra - void readExtra() { + void readExtra(ZipFileSystem zipfs) throws IOException { if (extra == null) return; int elen = extra.length; int off = 0; + int newOff = 0; while (off + 4 < elen) { // extra spec: HeaderID+DataSize+Data - int sz = SH(extra, off + 2); - int tag = SH(extra, off); - off += 4; int pos = off; + int tag = SH(extra, pos); + int sz = SH(extra, pos + 2); + pos += 4; if (pos + sz > elen) // invalid data break; switch (tag) { @@ -2165,18 +2234,66 @@ public class ZipFileSystem extends FileSystem { break; if (SH(extra, pos + 2) != 24) break; - mtime = LL(extra, pos + 4); - atime = LL(extra, pos + 12); - ctime = LL(extra, pos + 20); + // override the loc field, datatime here is + // more "accurate" + mtime = winToJavaTime(LL(extra, pos + 4)); + atime = winToJavaTime(LL(extra, pos + 12)); + ctime = winToJavaTime(LL(extra, pos + 20)); break; - case EXTID_UNIX: - atime = LG(extra, pos); - mtime = LG(extra, pos + 4); + case EXTID_EXTT: + // spec says the Extened timestamp in cen only has mtime + // need to read the loc to get the extra a/ctime + byte[] buf = new byte[LOCHDR]; + if (zipfs.readFullyAt(buf, 0, buf.length , locoff) + != buf.length) + throw new ZipException("loc: reading failed"); + if (LOCSIG(buf) != LOCSIG) + throw new ZipException("loc: wrong sig ->" + + Long.toString(LOCSIG(buf), 16)); + + int locElen = LOCEXT(buf); + if (locElen < 9) // EXTT is at lease 9 bytes + break; + int locNlen = LOCNAM(buf); + buf = new byte[locElen]; + if (zipfs.readFullyAt(buf, 0, buf.length , locoff + LOCHDR + locNlen) + != buf.length) + throw new ZipException("loc extra: reading failed"); + int locPos = 0; + while (locPos + 4 < buf.length) { + int locTag = SH(buf, locPos); + int locSZ = SH(buf, locPos + 2); + locPos += 4; + if (locTag != EXTID_EXTT) { + locPos += locSZ; + continue; + } + int flag = CH(buf, locPos++); + if ((flag & 0x1) != 0) { + mtime = unixToJavaTime(LG(buf, locPos)); + locPos += 4; + } + if ((flag & 0x2) != 0) { + atime = unixToJavaTime(LG(buf, locPos)); + locPos += 4; + } + if ((flag & 0x4) != 0) { + ctime = unixToJavaTime(LG(buf, locPos)); + locPos += 4; + } + break; + } break; - default: // unknow + default: // unknown tag + System.arraycopy(extra, off, extra, newOff, sz + 4); + newOff += (sz + 4); } - off += sz; + off += (sz + 4); } + if (newOff != 0 && newOff != extra.length) + extra = Arrays.copyOf(extra, newOff); + else + extra = null; } } @@ -2201,9 +2318,9 @@ public class ZipFileSystem extends FileSystem { // structure. // A possible solution is to build the node tree ourself as // implemented below. - private HashMap dirs; + private HashMap dirs; private IndexNode root; - private IndexNode addToDir(EntryName child) { + private IndexNode addToDir(IndexNode child) { IndexNode cinode = dirs.get(child); if (cinode != null) return cinode; @@ -2213,7 +2330,7 @@ public class ZipFileSystem extends FileSystem { IndexNode pinode; if (pname != null) - pinode = addToDir(new EntryName(pname)); + pinode = addToDir(IndexNode.keyOf(pname)); else pinode = root; cinode = inodes.get(child); @@ -2222,8 +2339,8 @@ public class ZipFileSystem extends FileSystem { pinode.child = cinode; return null; } - cinode = dirs.get(child); - if (cinode == null) // pseudo directry entry + //cinode = dirs.get(child); + if (cinode == null) // pseudo directry entry cinode = new IndexNode(cname, -1); cinode.sibling = pinode.child; pinode.child = cinode; @@ -2232,26 +2349,21 @@ public class ZipFileSystem extends FileSystem { return cinode; } - private HashMap getDirs() + private HashMap getDirs() throws IOException { - if (hasUpdate) - sync(); - if (dirs != null) + beginWrite(); + try { + if (dirs != null) + return dirs; + dirs = new HashMap<>(); + root = new IndexNode(new byte[0], -1); + dirs.put(root, root); + for (IndexNode node : inodes.keySet()) + addToDir(node); return dirs; - dirs = new HashMap(); - byte[] empty = new byte[0]; - root = new IndexNode(empty, -1); - dirs.put(new EntryName(empty), root); - - EntryName[] names = inodes.keySet().toArray(new EntryName[0]); - int i = names.length; - while (--i >= 0) { - addToDir(names[i]); + } finally { + endWrite(); } - // for (int i EntryName en : inodes.keySet()) { - // addToDir(en); - // } - return dirs; } } diff --git a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileSystemProvider.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java similarity index 76% rename from jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileSystemProvider.java rename to jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java index a43b2cf7de3..cf39b07cae7 100644 --- a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileSystemProvider.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java @@ -55,13 +55,15 @@ import java.util.Set; */ public class ZipFileSystemProvider extends FileSystemProvider { + + private final Map filesystems = new HashMap<>(); public ZipFileSystemProvider() {} @Override public String getScheme() { - return "zip"; + return "jar"; } protected Path uriToPath(URI uri) { @@ -70,10 +72,14 @@ public class ZipFileSystemProvider extends FileSystemProvider { throw new IllegalArgumentException("URI scheme is not '" + getScheme() + "'"); } try { - return Paths.get(new URI("file", uri.getHost(), uri.getPath(), null)) - .toAbsolutePath(); + // only support legacy JAR URL syntax jar:{uri}!/{entry} for now + String spec = uri.getSchemeSpecificPart(); + int sep = spec.indexOf("!/"); + if (sep != -1) + spec = spec.substring(0, sep); + return Paths.get(new URI(spec)).toAbsolutePath(); } catch (URISyntaxException e) { - throw new AssertionError(e); //never thrown + throw new IllegalArgumentException(e.getMessage(), e); } } @@ -101,24 +107,30 @@ public class ZipFileSystemProvider extends FileSystemProvider { throws IOException { synchronized(filesystems) { - if (filesystems.containsKey(path)) - throw new FileSystemAlreadyExistsException(); + Path realPath = null; + if (path.exists()) { + realPath = path.toRealPath(true); + if (filesystems.containsKey(realPath)) + throw new FileSystemAlreadyExistsException(); + } ZipFileSystem zipfs = new ZipFileSystem(this, path, env); - filesystems.put(path, zipfs); + if (realPath == null) + realPath = path.toRealPath(true); + filesystems.put(realPath, zipfs); return zipfs; } } @Override public Path getPath(URI uri) { - FileSystem fs = getFileSystem(uri); - String fragment = uri.getFragment(); - if (fragment == null) { + + String spec = uri.getSchemeSpecificPart(); + int sep = spec.indexOf("!/"); + if (sep == -1) throw new IllegalArgumentException("URI: " + uri - + " does not contain path fragment ex. zip:///c:/foo.zip#/BAR"); - } - return fs.getPath(fragment); + + " does not contain path info ex. jar:file:/c:/foo.zip!/BAR"); + return getFileSystem(uri).getPath(spec.substring(sep + 1)); } @Override @@ -137,16 +149,21 @@ public class ZipFileSystemProvider extends FileSystemProvider { @Override public FileSystem getFileSystem(URI uri) { synchronized (filesystems) { - ZipFileSystem zipfs = filesystems.get(uriToPath(uri)); + ZipFileSystem zipfs = null; + try { + zipfs = filesystems.get(uriToPath(uri).toRealPath(true)); + } catch (IOException x) { + // ignore the ioe from toRealPath(), return FSNFE + } if (zipfs == null) throw new FileSystemNotFoundException(); return zipfs; } } - void removeFileSystem(Path zfpath) { + void removeFileSystem(Path zfpath) throws IOException { synchronized (filesystems) { - filesystems.remove(zfpath); + filesystems.remove(zfpath.toRealPath(true)); } } } diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java new file mode 100644 index 00000000000..56954e1d9ea --- /dev/null +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipInfo.java @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.sun.nio.zipfs; + +import java.nio.file.Paths; +import java.util.Collections; +import java.util.Map; +import static com.sun.nio.zipfs.ZipConstants.*; +import static com.sun.nio.zipfs.ZipUtils.*; + +/** + * Print all loc and cen headers of the ZIP file + * + * @author Xueming Shen + */ + +public class ZipInfo { + + public static void main(String[] args) throws Throwable { + if (args.length < 1) { + print("Usage: java ZipInfo zfname"); + } else { + Map env = Collections.emptyMap(); + ZipFileSystem zfs = (ZipFileSystem)(new ZipFileSystemProvider() + .newFileSystem(Paths.get(args[0]), env)); + byte[] cen = zfs.cen; + if (cen == null) { + print("zip file is empty%n"); + return; + } + int pos = 0; + byte[] buf = new byte[1024]; + int no = 1; + while (pos + CENHDR < cen.length) { + print("----------------#%d--------------------%n", no++); + printCEN(cen, pos); + + // use size CENHDR as the extra bytes to read, just in case the + // loc.extra is bigger than the cen.extra, try to avoid to read + // twice + long len = LOCHDR + CENNAM(cen, pos) + CENEXT(cen, pos) + CENHDR; + if (zfs.readFullyAt(buf, 0, len, locoff(cen, pos)) != len) + zfs.zerror("read loc header failed"); + if (LOCEXT(buf) > CENEXT(cen, pos) + CENHDR) { + // have to read the second time; + len = LOCHDR + LOCNAM(buf) + LOCEXT(buf); + if (zfs.readFullyAt(buf, 0, len, locoff(cen, pos)) != len) + zfs.zerror("read loc header failed"); + } + printLOC(buf); + pos += CENHDR + CENNAM(cen, pos) + CENEXT(cen, pos) + CENCOM(cen, pos); + } + zfs.close(); + } + } + + static void print(String fmt, Object... objs) { + System.out.printf(fmt, objs); + } + + static void printLOC(byte[] loc) { + print("%n"); + print("[Local File Header]%n"); + print(" Signature : %#010x%n", LOCSIG(loc)); + if (LOCSIG(loc) != LOCSIG) { + print(" Wrong signature!"); + return; + } + print(" Version : %#6x [%d.%d]%n", + LOCVER(loc), LOCVER(loc) / 10, LOCVER(loc) % 10); + print(" Flag : %#6x%n", LOCFLG(loc)); + print(" Method : %#6x%n", LOCHOW(loc)); + print(" LastMTime : %#10x [%tc]%n", + LOCTIM(loc), dosToJavaTime(LOCTIM(loc))); + print(" CRC : %#10x%n", LOCCRC(loc)); + print(" CSize : %#10x%n", LOCSIZ(loc)); + print(" Size : %#10x%n", LOCLEN(loc)); + print(" NameLength : %#6x [%s]%n", + LOCNAM(loc), new String(loc, LOCHDR, LOCNAM(loc))); + print(" ExtraLength : %#6x%n", LOCEXT(loc)); + if (LOCEXT(loc) != 0) + printExtra(loc, LOCHDR + LOCNAM(loc), LOCEXT(loc)); + } + + static void printCEN(byte[] cen, int off) { + print("[Central Directory Header]%n"); + print(" Signature : %#010x%n", CENSIG(cen, off)); + if (CENSIG(cen, off) != CENSIG) { + print(" Wrong signature!"); + return; + } + print(" VerMadeby : %#6x [%d, %d.%d]%n", + CENVEM(cen, off), (CENVEM(cen, off) >> 8), + (CENVEM(cen, off) & 0xff) / 10, + (CENVEM(cen, off) & 0xff) % 10); + print(" VerExtract : %#6x [%d.%d]%n", + CENVER(cen, off), CENVER(cen, off) / 10, CENVER(cen, off) % 10); + print(" Flag : %#6x%n", CENFLG(cen, off)); + print(" Method : %#6x%n", CENHOW(cen, off)); + print(" LastMTime : %#10x [%tc]%n", + CENTIM(cen, off), dosToJavaTime(CENTIM(cen, off))); + print(" CRC : %#10x%n", CENCRC(cen, off)); + print(" CSize : %#10x%n", CENSIZ(cen, off)); + print(" Size : %#10x%n", CENLEN(cen, off)); + print(" NameLen : %#6x [%s]%n", + CENNAM(cen, off), new String(cen, off + CENHDR, CENNAM(cen, off))); + print(" ExtraLen : %#6x%n", CENEXT(cen, off)); + if (CENEXT(cen, off) != 0) + printExtra(cen, off + CENHDR + CENNAM(cen, off), CENEXT(cen, off)); + print(" CommentLen : %#6x%n", CENCOM(cen, off)); + print(" DiskStart : %#6x%n", CENDSK(cen, off)); + print(" Attrs : %#6x%n", CENATT(cen, off)); + print(" AttrsEx : %#10x%n", CENATX(cen, off)); + print(" LocOff : %#10x%n", CENOFF(cen, off)); + + } + + static long locoff(byte[] cen, int pos) { + long locoff = CENOFF(cen, pos); + if (locoff == ZIP64_MINVAL) { //ZIP64 + int off = pos + CENHDR + CENNAM(cen, pos); + int end = off + CENEXT(cen, pos); + while (off + 4 < end) { + int tag = SH(cen, off); + int sz = SH(cen, off + 2); + if (tag != EXTID_ZIP64) { + off += 4 + sz; + continue; + } + off += 4; + if (CENLEN(cen, pos) == ZIP64_MINVAL) + off += 8; + if (CENSIZ(cen, pos) == ZIP64_MINVAL) + off += 8; + return LL(cen, off); + } + // should never be here + } + return locoff; + } + + static void printExtra(byte[] extra, int off, int len) { + int end = off + len; + while (off + 4 <= end) { + int tag = SH(extra, off); + int sz = SH(extra, off + 2); + print(" [tag=0x%04x, sz=%d, data= ", tag, sz); + if (off + sz > end) { + print(" Error: Invalid extra data, beyond extra length"); + break; + } + off += 4; + for (int i = 0; i < sz; i++) + print("%02x ", extra[off + i]); + print("]%n"); + switch (tag) { + case EXTID_ZIP64 : + print(" ->ZIP64: "); + int pos = off; + while (pos + 8 <= off + sz) { + print(" *0x%x ", LL(extra, pos)); + pos += 8; + } + print("%n"); + break; + case EXTID_NTFS: + print(" ->PKWare NTFS%n"); + // 4 bytes reserved + if (SH(extra, off + 4) != 0x0001 || SH(extra, off + 6) != 24) + print(" Error: Invalid NTFS sub-tag or subsz"); + print(" mtime:%tc%n", + winToJavaTime(LL(extra, off + 8))); + print(" atime:%tc%n", + winToJavaTime(LL(extra, off + 16))); + print(" ctime:%tc%n", + winToJavaTime(LL(extra, off + 24))); + break; + case EXTID_EXTT: + print(" ->Inof-ZIP Extended Timestamp: flag=%x%n",extra[off]); + pos = off + 1 ; + while (pos + 4 <= off + sz) { + print(" *%tc%n", + unixToJavaTime(LG(extra, pos))); + pos += 4; + } + break; + default: + } + off += sz; + } + } +} diff --git a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipPath.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java similarity index 97% rename from jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipPath.java rename to jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java index 1ceab8fc81a..a2c766f0da2 100644 --- a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipPath.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java @@ -32,24 +32,19 @@ package com.sun.nio.zipfs; import java.io.File; -import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URI; -import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.nio.channels.SeekableByteChannel; import java.nio.file.*; import java.nio.file.DirectoryStream.Filter; -import java.nio.file.spi.FileSystemProvider; import java.nio.file.attribute.BasicFileAttributeView; import java.nio.file.attribute.FileAttribute; import java.nio.file.attribute.FileAttributeView; import java.nio.file.attribute.FileTime; import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import static java.nio.file.StandardOpenOption.*; import static java.nio.file.StandardCopyOption.*; @@ -196,13 +191,12 @@ public class ZipPath extends Path { @Override public URI toUri() { - String zfPath = zfs.toString(); - if (File.separatorChar == '\\') // replace all separators by '/' - zfPath = "/" + zfPath.replace("\\", "/"); try { - return new URI("zip", "", - zfPath, - zfs.getString(toAbsolutePath().path)); + return new URI("jar", + zfs.getZipFile().toUri() + + "!" + + zfs.getString(toAbsolutePath().path), + null); } catch (Exception ex) { throw new AssertionError(ex); } @@ -599,7 +593,7 @@ public class ZipPath extends Path { } private static final DirectoryStream.Filter acceptAllFilter = - new DirectoryStream.Filter() { + new DirectoryStream.Filter<>() { @Override public boolean accept(Path entry) { return true; } }; @@ -625,7 +619,7 @@ public class ZipPath extends Path { // create a matcher and return a filter that uses it. final PathMatcher matcher = getFileSystem().getPathMatcher("glob:" + glob); - DirectoryStream.Filter filter = new DirectoryStream.Filter() { + DirectoryStream.Filter filter = new DirectoryStream.Filter<>() { @Override public boolean accept(Path entry) { return matcher.matches(entry.getName()); @@ -758,7 +752,7 @@ public class ZipPath extends Path { @Override public Iterator iterator() { - return new Iterator() { + return new Iterator<>() { private int i = 0; @Override @@ -803,7 +797,7 @@ public class ZipPath extends Path { @Override public SeekableByteChannel newByteChannel(OpenOption... options) throws IOException { - Set set = new HashSet(options.length); + Set set = new HashSet<>(options.length); Collections.addAll(set, options); return newByteChannel(set); } @@ -908,7 +902,7 @@ public class ZipPath extends Path { if (opt == REPLACE_EXISTING) replaceExisting = true; else if (opt == COPY_ATTRIBUTES) - copyAttrs = false; + copyAttrs = true; } // attributes of source file ZipFileAttributes zfas = getAttributes(); @@ -951,7 +945,9 @@ public class ZipPath extends Path { BasicFileAttributeView view = target.getFileAttributeView(BasicFileAttributeView.class); try { - view.setTimes(zfas.lastModifiedTime(), null, null); + view.setTimes(zfas.lastModifiedTime(), + zfas.lastAccessTime(), + zfas.creationTime()); } catch (IOException x) { // rollback? try { diff --git a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipUtils.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipUtils.java similarity index 91% rename from jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipUtils.java rename to jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipUtils.java index b3106e09fa3..cddec6f9bef 100644 --- a/jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipUtils.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipUtils.java @@ -36,6 +36,7 @@ import java.io.OutputStream; import java.util.Arrays; import java.util.Date; import java.util.regex.PatternSyntaxException; +import java.util.concurrent.TimeUnit; /** * @@ -48,7 +49,7 @@ class ZipUtils { * Writes a 16-bit short to the output stream in little-endian byte order. */ public static void writeShort(OutputStream os, int v) throws IOException { - os.write((v >>> 0) & 0xff); + os.write(v & 0xff); os.write((v >>> 8) & 0xff); } @@ -56,7 +57,7 @@ class ZipUtils { * Writes a 32-bit int to the output stream in little-endian byte order. */ public static void writeInt(OutputStream os, long v) throws IOException { - os.write((int)((v >>> 0) & 0xff)); + os.write((int)(v & 0xff)); os.write((int)((v >>> 8) & 0xff)); os.write((int)((v >>> 16) & 0xff)); os.write((int)((v >>> 24) & 0xff)); @@ -66,7 +67,7 @@ class ZipUtils { * Writes a 64-bit int to the output stream in little-endian byte order. */ public static void writeLong(OutputStream os, long v) throws IOException { - os.write((int)((v >>> 0) & 0xff)); + os.write((int)(v & 0xff)); os.write((int)((v >>> 8) & 0xff)); os.write((int)((v >>> 16) & 0xff)); os.write((int)((v >>> 24) & 0xff)); @@ -132,6 +133,27 @@ class ZipUtils { d.getSeconds() >> 1; } + + // used to adjust values between Windows and java epoch + private static final long WINDOWS_EPOCH_IN_MICROSECONDS = -11644473600000000L; + public static final long winToJavaTime(long wtime) { + return TimeUnit.MILLISECONDS.convert( + wtime / 10 + WINDOWS_EPOCH_IN_MICROSECONDS, TimeUnit.MICROSECONDS); + } + + public static final long javaToWinTime(long time) { + return (TimeUnit.MICROSECONDS.convert(time, TimeUnit.MILLISECONDS) + - WINDOWS_EPOCH_IN_MICROSECONDS) * 10; + } + + public static final long unixToJavaTime(long utime) { + return TimeUnit.MILLISECONDS.convert(utime, TimeUnit.SECONDS); + } + + public static final long javaToUnixTime(long time) { + return TimeUnit.SECONDS.convert(time, TimeUnit.MILLISECONDS); + } + private static final String regexMetaChars = ".^$+{[]|()"; private static final String globMetaChars = "\\*?[{"; private static boolean isRegexMeta(char c) { diff --git a/jdk/src/share/demo/zipfs b/jdk/src/share/demo/zipfs new file mode 100644 index 00000000000..fd2ba7311b1 --- /dev/null +++ b/jdk/src/share/demo/zipfs @@ -0,0 +1,703 @@ +/* + * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import java.io.*; +import java.nio.*; +import java.nio.channels.*; +import java.nio.file.*; +import java.nio.file.attribute.*; +import java.net.*; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; + +import static java.nio.file.StandardOpenOption.*; +import static java.nio.file.StandardCopyOption.*; + +/* + * ZipFileSystem usage demo + * + * java Demo action ZipfileName [...] + * + * @author Xueming Shen + */ + +public class Demo { + + static enum Action { + rename, // + // rename entry src to dst inside zipfile + + movein, // + // move an external src file into zipfile + // as entry dst + + moveout, // + // move a zipfile entry src out to dst + + copy, // + // copy entry src to dst inside zipfile + + copyin, // + // copy an external src file into zipfile + // as entry dst + + copyin_attrs, // + // copy an external src file into zipfile + // as entry dst, with attributes (timestamp) + + copyout, // + // copy zipfile entry src" out to file dst + + copyout_attrs, // + + zzmove, // + // move entry path/dir from zfsrc to zfdst + + zzcopy, // + // copy path from zipfile zfsrc to zipfile + // zfdst + + attrs, // + // printout the attributes of entry path + + attrsspace, // + // printout the storespace attrs of entry path + + setmtime, // + // set the lastModifiedTime of entry path + + setatime, // + setctime, // + + lsdir, // + // list dir's direct child files/dirs + + mkdir, // + + mkdirs, // + + rmdirs, // + + list, // + // recursively list all entries of dir + // via DirectoryStream + + tlist, // + // list with buildDirTree=true + + vlist, // + // recursively verbose list all entries of + // dir via DirectoryStream + + walk, // + // recursively walk all entries of dir + // via Files.walkFileTree + + twalk, // + // walk with buildDirTree=true + + extract, // + + update, // + + delete, // + + add, // + + create, // + // create a new zipfile if it doesn't exit + // and then add the file(s) into it. + + attrs2, // + // test different ways to print attrs + + prof, + } + + public static void main(String[] args) throws Throwable { + + Action action = Action.valueOf(args[0]); + Map env = env = new HashMap<>(); + if (action == Action.create) + env.put("create", "true"); + if (action == Action.tlist || action == Action.twalk) + env.put("buildDirTree", true); + FileSystem fs = FileSystems.newFileSystem(Paths.get(args[1]), env, null); + + try { + FileSystem fs2; + Path path, src, dst; + boolean isRename = false; + switch (action) { + case rename: + src = fs.getPath(args[2]); + dst = fs.getPath(args[3]); + src.moveTo(dst); + break; + case moveout: + src = fs.getPath(args[2]); + dst = Paths.get(args[3]); + src.moveTo(dst); + break; + case movein: + src = Paths.get(args[2]); + dst = fs.getPath(args[3]); + src.moveTo(dst); + break; + case copy: + src = fs.getPath(args[2]); + dst = fs.getPath(args[3]); + src.copyTo(dst); + break; + case copyout: + src = fs.getPath(args[2]); + dst = Paths.get(args[3]); + src.copyTo(dst); + break; + case copyin: + src = Paths.get(args[2]); + dst = fs.getPath(args[3]); + src.copyTo(dst); + break; + case copyin_attrs: + src = Paths.get(args[2]); + dst = fs.getPath(args[3]); + src.copyTo(dst, COPY_ATTRIBUTES); + break; + case copyout_attrs: + src = fs.getPath(args[2]); + dst = Paths.get(args[3]); + src.copyTo(dst, COPY_ATTRIBUTES); + break; + case zzmove: + fs2 = FileSystems.newFileSystem(Paths.get(args[2]), env, null); + //sf1.getPath(args[3]).moveTo(fs2.getPath(args[3])); + z2zmove(fs, fs2, args[3]); + fs2.close(); + break; + case zzcopy: + fs2 = FileSystems.newFileSystem(Paths.get(args[2]), env, null); + //sf1.getPath(args[3]).copyTo(fs2.getPath(args[3])); + z2zcopy(fs, fs2, args[3]); + fs2.close(); + break; + case attrs: + for (int i = 2; i < args.length; i++) { + path = fs.getPath(args[i]); + System.out.println(path); + System.out.println( + Attributes.readBasicFileAttributes(path).toString()); + } + break; + case setmtime: + DateFormat df = new SimpleDateFormat("MM/dd/yyyy-HH:mm:ss"); + Date newDatetime = df.parse(args[2]); + for (int i = 3; i < args.length; i++) { + path = fs.getPath(args[i]); + path.setAttribute("lastModifiedTime", + FileTime.fromMillis(newDatetime.getTime())); + System.out.println( + Attributes.readBasicFileAttributes(path).toString()); + } + break; + case setctime: + df = new SimpleDateFormat("MM/dd/yyyy-HH:mm:ss"); + newDatetime = df.parse(args[2]); + for (int i = 3; i < args.length; i++) { + path = fs.getPath(args[i]); + path.setAttribute("creationTime", + FileTime.fromMillis(newDatetime.getTime())); + System.out.println( + Attributes.readBasicFileAttributes(path).toString()); + } + break; + case setatime: + df = new SimpleDateFormat("MM/dd/yyyy-HH:mm:ss"); + newDatetime = df.parse(args[2]); + for (int i = 3; i < args.length; i++) { + path = fs.getPath(args[i]); + path.setAttribute("lastAccessTime", + FileTime.fromMillis(newDatetime.getTime())); + System.out.println( + Attributes.readBasicFileAttributes(path).toString()); + } + break; + case attrsspace: + path = fs.getPath("/"); + FileStore fstore = path.getFileStore(); + //System.out.println(fstore.getFileStoreAttributeView(FileStoreSpaceAttributeView.class) + // .readAttributes()); + // or + System.out.printf("filestore[%s]%n", fstore.name()); + System.out.printf(" totalSpace: %d%n", + (Long)fstore.getAttribute("space:totalSpace")); + System.out.printf(" usableSpace: %d%n", + (Long)fstore.getAttribute("space:usableSpace")); + System.out.printf(" unallocSpace: %d%n", + (Long)fstore.getAttribute("space:unallocatedSpace")); + break; + case list: + case tlist: + if (args.length < 3) + list(fs.getPath("/"), false); + else + list(fs.getPath(args[2]), false); + break; + case vlist: + if (args.length < 3) + list(fs.getPath("/"), true); + else + list(fs.getPath(args[2]), true); + break; + case twalk: + case walk: + walk(fs.getPath((args.length > 2)? args[2] : "/")); + break; + case extract: + if (args.length == 2) { + extract(fs, "/"); + } else { + for (int i = 2; i < args.length; i++) { + extract(fs, args[i]); + } + } + break; + case delete: + for (int i = 2; i < args.length; i++) + fs.getPath(args[i]).delete(); + break; + case create: + case add: + case update: + for (int i = 2; i < args.length; i++) { + update(fs, args[i]); + } + break; + case lsdir: + path = fs.getPath(args[2]); + final String fStr = (args.length > 3)?args[3]:""; + DirectoryStream ds = path.newDirectoryStream( + new DirectoryStream.Filter() { + public boolean accept(Path path) { + return path.toString().contains(fStr); + } + }); + for (Path p : ds) + System.out.println(p); + break; + case mkdir: + fs.getPath(args[2]).createDirectory(); + break; + case mkdirs: + mkdirs(fs.getPath(args[2])); + break; + case attrs2: + for (int i = 2; i < args.length; i++) { + path = fs.getPath(args[i]); + System.out.printf("%n%s%n", path); + System.out.println("-------(1)---------"); + System.out.println( + Attributes.readBasicFileAttributes(path).toString()); + System.out.println("-------(2)---------"); + Map map = path.readAttributes("zip:*"); + for (Map.Entry e : map.entrySet()) { + System.out.printf(" %s : %s%n", e.getKey(), e.getValue()); + } + System.out.println("-------(3)---------"); + map = path.readAttributes("size,lastModifiedTime,isDirectory"); + for (Map.Entry e : map.entrySet()) { + System.out.printf(" %s : %s%n", e.getKey(), e.getValue()); + } + } + break; + case prof: + list(fs.getPath("/"), false); + while (true) { + Thread.sleep(10000); + //list(fs.getPath("/"), true); + System.out.println("sleeping..."); + } + } + } catch (Exception x) { + x.printStackTrace(); + } finally { + if (fs != null) + fs.close(); + } + } + + private static byte[] getBytes(String name) { + return name.getBytes(); + } + + private static String getString(byte[] name) { + return new String(name); + } + + private static void walk(Path path) throws IOException + { + Files.walkFileTree( + path, + new SimpleFileVisitor() { + private int indent = 0; + private void indent() { + int n = 0; + while (n++ < indent) + System.out.printf(" "); + } + + @Override + public FileVisitResult visitFile(Path file, + BasicFileAttributes attrs) + { + indent(); + System.out.printf("%s%n", file.getName().toString()); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult preVisitDirectory(Path dir, + BasicFileAttributes attrs) + { + indent(); + System.out.printf("[%s]%n", dir.toString()); + indent += 2; + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, + IOException ioe) + { + indent -= 2; + return FileVisitResult.CONTINUE; + } + }); + } + + private static void update(FileSystem fs, String path) throws Throwable{ + Path src = FileSystems.getDefault().getPath(path); + if (Boolean.TRUE.equals(src.getAttribute("isDirectory"))) { + DirectoryStream ds = src.newDirectoryStream(); + for (Path child : ds) + update(fs, child.toString()); + ds.close(); + } else { + Path dst = fs.getPath(path); + Path parent = dst.getParent(); + if (parent != null && parent.notExists()) + mkdirs(parent); + src.copyTo(dst, REPLACE_EXISTING); + } + } + + private static void extract(FileSystem fs, String path) throws Throwable{ + Path src = fs.getPath(path); + if (Boolean.TRUE.equals(src.getAttribute("isDirectory"))) { + DirectoryStream ds = src.newDirectoryStream(); + for (Path child : ds) + extract(fs, child.toString()); + ds.close(); + } else { + if (path.startsWith("/")) + path = path.substring(1); + Path dst = FileSystems.getDefault().getPath(path); + Path parent = dst.getParent(); + if (parent.notExists()) + mkdirs(parent); + src.copyTo(dst, REPLACE_EXISTING); + } + } + + // use DirectoryStream + private static void z2zcopy(FileSystem src, FileSystem dst, String path) + throws IOException + { + Path srcPath = src.getPath(path); + Path dstPath = dst.getPath(path); + + if (Boolean.TRUE.equals(srcPath.getAttribute("isDirectory"))) { + if (!dstPath.exists()) { + try { + mkdirs(dstPath); + } catch (FileAlreadyExistsException x) {} + } + DirectoryStream ds = srcPath.newDirectoryStream(); + for (Path child : ds) { + z2zcopy(src, dst, + path + (path.endsWith("/")?"":"/") + child.getName()); + } + ds.close(); + } else { + //System.out.println("copying..." + path); + srcPath.copyTo(dstPath); + } + } + + // use TreeWalk to move + private static void z2zmove(FileSystem src, FileSystem dst, String path) + throws IOException + { + final Path srcPath = src.getPath(path).toAbsolutePath(); + final Path dstPath = dst.getPath(path).toAbsolutePath(); + + Files.walkFileTree(srcPath, new SimpleFileVisitor() { + + @Override + public FileVisitResult visitFile(Path file, + BasicFileAttributes attrs) + { + Path dst = srcPath.relativize(file); + dst = dstPath.resolve(dst); + try { + Path parent = dstPath.getParent(); + if (parent != null && parent.notExists()) + mkdirs(parent); + file.moveTo(dst); + } catch (IOException x) { + x.printStackTrace(); + } + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult preVisitDirectory(Path dir, + BasicFileAttributes attrs) + { + Path dst = srcPath.relativize(dir); + dst = dstPath.resolve(dst); + try { + + if (dst.notExists()) + mkdirs(dst); + } catch (IOException x) { + x.printStackTrace(); + } + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, + IOException ioe) + throws IOException + { + try { + dir.delete(); + } catch (IOException x) { + //x.printStackTrace(); + } + return FileVisitResult.CONTINUE; + } + }); + + } + + private static void mkdirs(Path path) throws IOException { + path = path.toAbsolutePath(); + Path parent = path.getParent(); + if (parent != null) { + if (parent.notExists()) + mkdirs(parent); + } + path.createDirectory(); + } + + private static void rmdirs(Path path) throws IOException { + while (path != null && path.getNameCount() != 0) { + path.delete(); + path = path.getParent(); + } + } + + private static void list(Path path, boolean verbose ) throws IOException { + if (!"/".equals(path.toString())) { + System.out.printf(" %s%n", path.toString()); + if (verbose) + System.out.println(Attributes.readBasicFileAttributes(path).toString()); + } + if (path.notExists()) + return; + if (Attributes.readBasicFileAttributes(path).isDirectory()) { + DirectoryStream ds = path.newDirectoryStream(); + for (Path child : ds) + list(child, verbose); + ds.close(); + } + } + + // check the content of two paths are equal + private static void checkEqual(Path src, Path dst) throws IOException + { + //System.out.printf("checking <%s> vs <%s>...%n", + // src.toString(), dst.toString()); + + //streams + InputStream isSrc = src.newInputStream(); + InputStream isDst = dst.newInputStream(); + byte[] bufSrc = new byte[8192]; + byte[] bufDst = new byte[8192]; + + try { + int nSrc = 0; + while ((nSrc = isSrc.read(bufSrc)) != -1) { + int nDst = 0; + while (nDst < nSrc) { + int n = isDst.read(bufDst, nDst, nSrc - nDst); + if (n == -1) { + System.out.printf("checking <%s> vs <%s>...%n", + src.toString(), dst.toString()); + throw new RuntimeException("CHECK FAILED!"); + } + nDst += n; + } + while (--nSrc >= 0) { + if (bufSrc[nSrc] != bufDst[nSrc]) { + System.out.printf("checking <%s> vs <%s>...%n", + src.toString(), dst.toString()); + throw new RuntimeException("CHECK FAILED!"); + } + nSrc--; + } + } + } finally { + isSrc.close(); + isDst.close(); + } + + // channels + SeekableByteChannel chSrc = src.newByteChannel(); + SeekableByteChannel chDst = dst.newByteChannel(); + if (chSrc.size() != chDst.size()) { + System.out.printf("src[%s].size=%d, dst[%s].size=%d%n", + chSrc.toString(), chSrc.size(), + chDst.toString(), chDst.size()); + throw new RuntimeException("CHECK FAILED!"); + } + ByteBuffer bbSrc = ByteBuffer.allocate(8192); + ByteBuffer bbDst = ByteBuffer.allocate(8192); + + try { + int nSrc = 0; + while ((nSrc = chSrc.read(bbSrc)) != -1) { + int nDst = chDst.read(bbDst); + if (nSrc != nDst) { + System.out.printf("checking <%s> vs <%s>...%n", + src.toString(), dst.toString()); + throw new RuntimeException("CHECK FAILED!"); + } + while (--nSrc >= 0) { + if (bbSrc.get(nSrc) != bbDst.get(nSrc)) { + System.out.printf("checking <%s> vs <%s>...%n", + src.toString(), dst.toString()); + throw new RuntimeException("CHECK FAILED!"); + } + nSrc--; + } + bbSrc.flip(); + bbDst.flip(); + } + } catch (IOException x) { + x.printStackTrace(); + } finally { + chSrc.close(); + chDst.close(); + } + } + + private static void fchCopy(Path src, Path dst) throws IOException + { + Set read = new HashSet<>(); + read.add(READ); + Set openwrite = new HashSet<>(); + openwrite.add(CREATE_NEW); + openwrite.add(WRITE); + + FileChannel srcFc = src.getFileSystem() + .provider() + .newFileChannel(src, read); + FileChannel dstFc = dst.getFileSystem() + .provider() + .newFileChannel(dst, openwrite); + + try { + ByteBuffer bb = ByteBuffer.allocate(8192); + while (srcFc.read(bb) >= 0) { + bb.flip(); + dstFc.write(bb); + bb.clear(); + } + } finally { + srcFc.close(); + dstFc.close(); + } + } + + private static void chCopy(Path src, Path dst) throws IOException + { + Set read = new HashSet<>(); + read.add(READ); + Set openwrite = new HashSet<>(); + openwrite.add(CREATE_NEW); + openwrite.add(WRITE); + + SeekableByteChannel srcCh = src.newByteChannel(read); + SeekableByteChannel dstCh = dst.newByteChannel(openwrite); + + try { + ByteBuffer bb = ByteBuffer.allocate(8192); + while (srcCh.read(bb) >= 0) { + bb.flip(); + dstCh.write(bb); + bb.clear(); + } + } finally { + srcCh.close(); + dstCh.close(); + } + } + + private static void streamCopy(Path src, Path dst) throws IOException + { + InputStream isSrc = src.newInputStream(); + OutputStream osDst = dst.newOutputStream(); + byte[] buf = new byte[8192]; + try { + int n = 0; + while ((n = isSrc.read(buf)) != -1) { + osDst.write(buf, 0, n); + } + } finally { + isSrc.close(); + osDst.close(); + } + } +} diff --git a/jdk/src/share/hpi/export/bool.h b/jdk/src/share/hpi/export/bool.h deleted file mode 100644 index e87c5a9e4ce..00000000000 --- a/jdk/src/share/hpi/export/bool.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef _JAVASOFT_BOOL_H_ -#define _JAVASOFT_BOOL_H_ - -#undef TRUE -#undef FALSE - -typedef enum { - FALSE = 0, - TRUE = 1 -} bool_t; - -#endif /* !_JAVASOFT_BOOL_H_ */ diff --git a/jdk/src/share/hpi/export/hpi.h b/jdk/src/share/hpi/export/hpi.h deleted file mode 100644 index 6fb6be84578..00000000000 --- a/jdk/src/share/hpi/export/hpi.h +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Host Porting Interface. This defines the "porting layer" for - * POSIX.1 compliant operating systems. - */ - -#ifndef _JAVASOFT_HPI_H_ -#define _JAVASOFT_HPI_H_ - -#include -#include - -#include "jni.h" -#include "bool.h" -#include "hpi_md.h" -#include "dll.h" - -#ifdef __solaris__ -#define SSIZE_T ssize_t -#else -#ifdef _LP64 -#define SSIZE_T ssize_t -#else -#define SSIZE_T int -#endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * memory allocations - */ -typedef struct { - /* - * Malloc must return a unique pointer if size == 0. - */ - void * (*Malloc)(size_t size); - void * (*Realloc)(void *ptr, size_t new_size); - /* - * Free must allow ptr == NULL to be a no-op. - */ - void (*Free)(void *ptr); - /* - * Calloc must return a unique pointer for if - * n_item == 0 || item_size == 0. - */ - void * (*Calloc)(size_t n_item, size_t item_size); - char * (*Strdup)(const char *str); - - void * (*MapMem)(size_t req_size, size_t *maped_size); - void * (*UnmapMem)(void *req_addr, size_t req_size, size_t *unmap_size); - /* - * CommitMem should round the ptr down to the nearest page and - * round the size up to the nearest page so that the committed - * region is at least as large as the requested region. - */ - void * (*CommitMem)(void *ptr, size_t size, size_t *actual); - /* - * sysDecommitMem should round the ptr up to the nearest page and - * round the size down to the nearest page so that the decommitted - * region is no greater than the requested region. - */ - void * (*DecommitMem)(void *ptr, size_t size, size_t *actual); - -#define HPI_PAGE_ALIGNMENT (64 * 1024) - - void * (*AllocBlock)(size_t size, void **headP); - void (*FreeBlock)(void *head); -} HPI_MemoryInterface; - -/* - * dynamic linking libraries - */ -typedef struct { - void (*BuildLibName)(char *buf, int buf_len, char *path, char *name); - int (*BuildFunName)(char *name, int name_len, int arg_size, int en_idx); - - void * (*LoadLibrary)(const char *name, char *err_buf, int err_buflen); - void (*UnloadLibrary)(void *lib); - void * (*FindLibraryEntry)(void *lib, const char *name); -} HPI_LibraryInterface; - -typedef void (*signal_handler_t)(int sig, void *siginfo, void *context); - -#define HPI_SIG_DFL (signal_handler_t)0 -#define HPI_SIG_ERR (signal_handler_t)-1 -#define HPI_SIG_IGN (signal_handler_t)1 - -typedef struct { - char *name; /* name such as green/native threads. */ - int isMP; -} HPI_SysInfo; - -typedef struct { - HPI_SysInfo * (*GetSysInfo)(void); - long (*GetMilliTicks)(void); - jlong (*TimeMillis)(void); - - signal_handler_t (*Signal)(int sig, signal_handler_t handler); - void (*Raise)(int sig); - void (*SignalNotify)(int sig); - int (*SignalWait)(void); - - int (*Shutdown)(void); - - int (*SetLoggingLevel)(int level); - bool_t (*SetMonitoringOn)(bool_t on); - int (*GetLastErrorString)(char *buf, int len); -} HPI_SystemInterface; - -/* - * threads and monitors - */ -typedef struct sys_thread sys_thread_t; -typedef struct sys_mon sys_mon_t; - -#define HPI_OK 0 -#define HPI_ERR -1 -#define HPI_INTRPT -2 /* Operation was interrupted */ -#define HPI_TIMEOUT -3 /* A timer ran out */ -#define HPI_NOMEM -5 /* Ran out of memory */ -#define HPI_NORESOURCE -6 /* Ran out of some system resource */ - -/* There are three basic states: RUNNABLE, MONITOR_WAIT, and CONDVAR_WAIT. - * When the thread is suspended in any of these states, the - * HPI_THREAD_SUSPENDED bit will be set - */ -enum { - HPI_THREAD_RUNNABLE = 1, - HPI_THREAD_MONITOR_WAIT, - HPI_THREAD_CONDVAR_WAIT -}; - -#define HPI_MINIMUM_PRIORITY 1 -#define HPI_MAXIMUM_PRIORITY 10 -#define HPI_NORMAL_PRIORITY 5 - -#define HPI_THREAD_SUSPENDED 0x8000 -#define HPI_THREAD_INTERRUPTED 0x4000 - -typedef struct { - sys_thread_t *owner; - long entry_count; - sys_thread_t **monitor_waiters; - sys_thread_t **condvar_waiters; - int sz_monitor_waiters; - int sz_condvar_waiters; - int n_monitor_waiters; - int n_condvar_waiters; -} sys_mon_info; - -typedef struct { - int (*ThreadBootstrap)(sys_thread_t **tidP, - sys_mon_t **qlockP, - int nReservedBytes); - int (*ThreadCreate)(sys_thread_t **tidP, - long stk_size, - void (*func)(void *), - void *arg); - sys_thread_t * (*ThreadSelf)(void); - void (*ThreadYield)(void); - int (*ThreadSuspend)(sys_thread_t *tid); - int (*ThreadResume)(sys_thread_t *tid); - int (*ThreadSetPriority)(sys_thread_t *tid, int prio); - int (*ThreadGetPriority)(sys_thread_t *tid, int *prio); - void * (*ThreadStackPointer)(sys_thread_t *tid); - void * (*ThreadStackTop)(sys_thread_t *tid); - long * (*ThreadRegs)(sys_thread_t *tid, int *regs); - int (*ThreadSingle)(void); - void (*ThreadMulti)(void); - int (*ThreadEnumerateOver)(int (*func)(sys_thread_t *, void *), - void *arg); - int (*ThreadCheckStack)(void); - void (*ThreadPostException)(sys_thread_t *tid, void *arg); - void (*ThreadInterrupt)(sys_thread_t *tid); - int (*ThreadIsInterrupted)(sys_thread_t *tid, int clear); - int (*ThreadAlloc)(sys_thread_t **tidP); - int (*ThreadFree)(void); - jlong (*ThreadCPUTime)(void); - int (*ThreadGetStatus)(sys_thread_t *tid, sys_mon_t **monitor); - void * (*ThreadInterruptEvent)(void); - void * (*ThreadNativeID)(sys_thread_t *tid); - - /* These three functions are used by the CPU time profiler. - * sysThreadIsRunning determines whether the thread is running (not just - * runnable). It is only safe to call this function after calling - * sysThreadProfSuspend. - */ - bool_t (*ThreadIsRunning)(sys_thread_t *tid); - void (*ThreadProfSuspend)(sys_thread_t *tid); - void (*ThreadProfResume)(sys_thread_t *tid); - - int (*AdjustTimeSlice)(int ms); - - size_t (*MonitorSizeof)(void); - int (*MonitorInit)(sys_mon_t *mid); - int (*MonitorDestroy)(sys_mon_t *mid); - int (*MonitorEnter)(sys_thread_t *self, sys_mon_t *mid); - bool_t (*MonitorEntered)(sys_thread_t *self, sys_mon_t *mid); - int (*MonitorExit)(sys_thread_t *self, sys_mon_t *mid); - int (*MonitorNotify)(sys_thread_t *self, sys_mon_t *mid); - int (*MonitorNotifyAll)(sys_thread_t *self, sys_mon_t *mid); - int (*MonitorWait)(sys_thread_t *self, sys_mon_t *mid, jlong ms); - bool_t (*MonitorInUse)(sys_mon_t *mid); - sys_thread_t * (*MonitorOwner)(sys_mon_t *mid); - int (*MonitorGetInfo)(sys_mon_t *mid, sys_mon_info *info); - -} HPI_ThreadInterface; - -/* - * files - */ - -#define HPI_FILETYPE_REGULAR (0) -#define HPI_FILETYPE_DIRECTORY (1) -#define HPI_FILETYPE_OTHER (2) - -typedef struct { - char * (*NativePath)(char *path); - int (*FileType)(const char *path); - int (*Open)(const char *name, int openMode, int filePerm); - int (*Close)(int fd); - jlong (*Seek)(int fd, jlong offset, int whence); - int (*SetLength)(int fd, jlong length); - int (*Sync)(int fd); - int (*Available)(int fd, jlong *bytes); - size_t (*Read)(int fd, void *buf, unsigned int nBytes); - size_t (*Write)(int fd, const void *buf, unsigned int nBytes); - int (*FileSizeFD)(int fd, jlong *size); -} HPI_FileInterface; - -/* - * sockets - */ -struct sockaddr; -struct hostent; - -typedef struct { - int (*Close)(int fd); - long (*Available)(int fd, jint *pbytes); - int (*Connect)(int fd, struct sockaddr *him, int len); - int (*Accept)(int fd, struct sockaddr *him, int *len); - SSIZE_T (*SendTo)(int fd, char *buf, int len, int flags, - struct sockaddr *to, int tolen); - SSIZE_T (*RecvFrom)(int fd, char *buf, int nbytes, int flags, - struct sockaddr *from, int *fromlen); - int (*Listen)(int fd, int count); - SSIZE_T (*Recv)(int fd, char *buf, int nBytes, int flags); - SSIZE_T (*Send)(int fd, char *buf, int nBytes, int flags); - int (*Timeout)(int fd, long timeout); - struct hostent * (*GetHostByName)(char *hostname); - int (*Socket)(int domain, int type, int protocol); - int (*SocketShutdown)(int fd, int howto); - int (*Bind)(int fd, struct sockaddr *him, int len); - int (*GetSocketName)(int fd, struct sockaddr *him, int *len); - int (*GetHostName)(char *hostname, int namelen); - struct hostent * (*GetHostByAddr)(const char *hostname, int len, int type); - int (*SocketGetOption)(int fd, int level, int optname, char *optval, int *optlen); - int (*SocketSetOption)(int fd, int level, int optname, const char *optval, int optlen); - struct protoent * (*GetProtoByName)(char* name); -} HPI_SocketInterface; - -/* - * callbacks. - */ -typedef struct vm_calls { - int (*jio_fprintf)(FILE *fp, const char *fmt, ...); - void (*panic)(const char *fmt, ...); - void (*monitorRegister)(sys_mon_t *mid, char *info_str); - - void (*monitorContendedEnter)(sys_thread_t *self, sys_mon_t *mid); - void (*monitorContendedEntered)(sys_thread_t *self, sys_mon_t *mid); - void (*monitorContendedExit)(sys_thread_t *self, sys_mon_t *mid); -} vm_calls_t; - -#ifdef __cplusplus -} -#endif - -#endif /* !_JAVASOFT_HPI_H_ */ diff --git a/jdk/src/share/hpi/include/hpi_impl.h b/jdk/src/share/hpi/include/hpi_impl.h deleted file mode 100644 index 72f8d36e2d6..00000000000 --- a/jdk/src/share/hpi/include/hpi_impl.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef _JAVASOFT_HPI_IMPL_H_ -#define _JAVASOFT_HPI_IMPL_H_ - -#include "hpi.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#include "vm_calls.h" - -extern int nReservedBytes; -sys_thread_t *allocThreadBlock(void); -void freeThreadBlock(sys_thread_t *tid); -int threadBootstrapMD(sys_thread_t **tid, sys_mon_t **lockP, int nb); - -HPI_SysInfo *sysGetSysInfo(void); -long sysGetMilliTicks(void); -jlong sysTimeMillis(void); - -signal_handler_t sysSignal(int sig, signal_handler_t handler); -void sysRaise(int sig); -void sysSignalNotify(int sig); -int sysSignalWait(void); -int sysShutdown(void); -int sysSetLoggingLevel(int level); -bool_t sysSetMonitoringOn(bool_t on); -int sysGetLastErrorString(char *buf, int len); - -void * sysMalloc(size_t); -void * sysRealloc(void*, size_t); -void sysFree(void*); -void * sysCalloc(size_t, size_t); -char * sysStrdup(const char * string); -void * sysMapMem(size_t, size_t *); -void * sysUnmapMem(void *, size_t, size_t *); -void * sysCommitMem(void * ptr, size_t size, size_t * actual); -void * sysDecommitMem(void * ptr, size_t size, size_t * actual); -void * sysAllocBlock(size_t, void**); -void sysFreeBlock(void *); - -void sysBuildLibName(char *, int, char *, char *); -int sysBuildFunName(char *, int, int, int); -void * sysLoadLibrary(const char *, char *err_buf, int err_buflen); -void sysUnloadLibrary(void *); -void * sysFindLibraryEntry(void *, const char *); - -int sysThreadBootstrap(sys_thread_t **, sys_mon_t **, int); -int sysThreadCreate(sys_thread_t **, - long, - void (*)(void *), - void *arg); -void sysThreadExit(void); -sys_thread_t * sysThreadSelf(void); -void sysThreadYield(void); -int sysThreadSuspend(sys_thread_t *); -int sysThreadResume(sys_thread_t *); -int sysThreadSetPriority(sys_thread_t *, int); -int sysThreadGetPriority(sys_thread_t *, int *); -void * sysThreadStackPointer(sys_thread_t *); -void * sysThreadStackTop(sys_thread_t *); -long * sysThreadRegs(sys_thread_t *, int *); -int sysThreadSingle(void); -void sysThreadMulti(void); -int sysThreadEnumerateOver(int (*)(sys_thread_t *, void *), void *); -int sysThreadCheckStack(void); -void sysThreadPostException(sys_thread_t *, void *); -void sysThreadInterrupt(sys_thread_t *); -int sysThreadIsInterrupted(sys_thread_t *, int); -int sysThreadAlloc(sys_thread_t **); -int sysThreadFree(void); -size_t sysThreadSizeof(void); -jlong sysThreadCPUTime(void); -int sysThreadGetStatus(sys_thread_t *, sys_mon_t **); -int sysAdjustUserThreadCount(int delta); -bool_t sysThreadIsRunning(sys_thread_t *); -void sysThreadProfSuspend(sys_thread_t *); -void sysThreadProfResume(sys_thread_t *); -int sysAdjustTimeSlice(int); -int sysThreadEnumerateOver(int (*f)(sys_thread_t *, void *), void *arg); -void * sysThreadInterruptEvent(void); -void * sysThreadNativeID(sys_thread_t *); - -size_t sysMonitorSizeof(void); -int sysMonitorInit(sys_mon_t *); -int sysMonitorDestroy(sys_mon_t *); -int sysMonitorEnter(sys_thread_t *, sys_mon_t *); -bool_t sysMonitorEntered(sys_thread_t *, sys_mon_t *); -int sysMonitorExit(sys_thread_t *, sys_mon_t *); -int sysMonitorNotify(sys_thread_t *, sys_mon_t *); -int sysMonitorNotifyAll(sys_thread_t *, sys_mon_t *); -int sysMonitorWait(sys_thread_t *, sys_mon_t *, jlong); -bool_t sysMonitorInUse(sys_mon_t *); -sys_thread_t * sysMonitorOwner(sys_mon_t *); -int sysMonitorGetInfo(sys_mon_t *, sys_mon_info *); - -char *sysNativePath(char *path); -int sysFileType(const char *path); -int sysOpen(const char *name, int openMode, int filePerm); -int sysClose(int fd); -jlong sysSeek(int fd, jlong offset, int whence); -int sysSetLength(int fd, jlong length); -int sysSync(int fd); -int sysAvailable(int fd, jlong *bytes); -size_t sysRead(int fd, void *buf, unsigned int nBytes); -size_t sysWrite(int fd, const void *buf, unsigned int nBytes); -int sysFileSizeFD(int fd, jlong *size); - -int sysSocketClose(int fd); -int sysSocketShutdown(int fd, int howto); -long sysSocketAvailable(int fd, jint *pbytes); -int sysConnect(int fd, struct sockaddr *him, int len); -int sysBind(int fd, struct sockaddr *him, int len); -int sysAccept(int fd, struct sockaddr *him, int *len); -int sysGetSockName(int fd, struct sockaddr *him, int *len); -#ifdef _LP64 -ssize_t sysSendTo(int fd, char *buf, int len, int flags, struct sockaddr *to, - int tolen); -ssize_t sysRecvFrom(int fd, char *buf, int nbytes, int flags, - struct sockaddr *from, int *fromlen); -ssize_t sysRecv(int fd, char *buf, int nBytes, int flags); -ssize_t sysSend(int fd, char *buf, int nBytes, int flags); -#else -int sysSendTo(int fd, char *buf, int len, int flags, struct sockaddr *to, - int tolen); -int sysRecvFrom(int fd, char *buf, int nbytes, int flags, - struct sockaddr *from, int *fromlen); -int sysRecv(int fd, char *buf, int nBytes, int flags); -int sysSend(int fd, char *buf, int nBytes, int flags); -#endif -int sysListen(int fd, int count); -int sysTimeout(int fd, long timeout); -int sysGetHostName(char* name, int namelen); -struct hostent *sysGetHostByAddr(const char* name, int len, int type); -struct hostent *sysGetHostByName(char *hostname); -int sysSocket(int domain, int type, int protocol); -int sysGetSockOpt(int fd, int level, int optname, char *optval, int *optlen); -int sysSetSockOpt(int fd, int level, int optname, const char *optval, int optlen); -struct protoent * sysGetProtoByName(char* name); - -#define SYS_SIG_DFL HPI_SIG_DFL -#define SYS_SIG_ERR HPI_SIG_ERR -#define SYS_SIG_IGN HPI_SIG_IGN - -#define SYS_OK HPI_OK -#define SYS_ERR HPI_ERR -#define SYS_INTRPT HPI_INTRPT -#define SYS_TIMEOUT HPI_TIMEOUT -#define SYS_NOMEM HPI_NOMEM -#define SYS_NORESOURCE HPI_NORESOURCE - -#define SYS_THREAD_RUNNABLE HPI_THREAD_RUNNABLE -#define SYS_THREAD_MONITOR_WAIT HPI_THREAD_MONITOR_WAIT -#define SYS_THREAD_CONDVAR_WAIT HPI_THREAD_CONDVAR_WAIT - -#define MinimumPriority HPI_MINIMUM_PRIORITY -#define MaximumPriority HPI_MAXIMUM_PRIORITY -#define NormalPriority HPI_NORMAL_PRIORITY - -#define SYS_THREAD_SUSPENDED HPI_THREAD_SUSPENDED - -#define PAGE_ALIGNMENT HPI_PAGE_ALIGNMENT - -#define SYS_TIMEOUT_INFINITY HPI_TIMEOUT_INFINITY - -#define SYS_FILETYPE_REGULAR HPI_FILETYPE_REGULAR -#define SYS_FILETYPE_DIRECTORY HPI_FILETYPE_DIRECTORY -#define SYS_FILETYPE_OTHER HPI_FILETYPE_OTHER - -typedef void *stackp_t; - -/* global vars */ - -extern int logging_level; -extern bool_t profiler_on; - -#ifdef __cplusplus -} -#endif - -#endif /* !_JAVASOFT_HPI_IMPL_H_ */ diff --git a/jdk/src/share/hpi/include/vm_calls.h b/jdk/src/share/hpi/include/vm_calls.h deleted file mode 100644 index 10037c4a97b..00000000000 --- a/jdk/src/share/hpi/include/vm_calls.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef _JAVASOFT_VM_CALLS_H_ -#define _JAVASOFT_VM_CALLS_H_ - -/* This file defines the function table and macros exported from the VM - * for the implementation of HPI. - */ - -extern vm_calls_t *vm_calls; - -#define VM_CALLS_READY() vm_calls -#define VM_CALL(f) (vm_calls->f) - -#undef sysAssert - -#ifdef DEBUG -#define sysAssert(expression) { \ - if (!(expression)) { \ - vm_calls->panic \ - ("\"%s\", line %d: assertion failure\n", __FILE__, __LINE__); \ - } \ -} -#else -#define sysAssert(expression) ((void) 0) -#endif - -#ifdef LOGGING - -#define Log(level, message) { \ - if (vm_calls && level <= logging_level) \ - vm_calls->jio_fprintf(stderr, message); \ -} - -#define Log1(level, message, x1) { \ - if (vm_calls && level <= logging_level) \ - vm_calls->jio_fprintf(stderr, message, (x1)); \ -} - -#define Log2(level, message, x1, x2) { \ - if (vm_calls && level <= logging_level) \ - vm_calls->jio_fprintf(stderr, message, (x1), (x2)); \ -} - -#define Log3(level, message, x1, x2, x3) { \ - if (vm_calls && level <= logging_level) \ - vm_calls->jio_fprintf(stderr, message, (x1), (x2), (x3)); \ -} - -#define Log4(level, message, x1, x2, x3, x4) { \ - if (vm_calls && level <= logging_level) \ - vm_calls->jio_fprintf(stderr, message, (x1), (x2), (x3), (x4)); \ -} - -#else - -#define Log(level, message) ((void) 0) -#define Log1(level, message, x1) ((void) 0) -#define Log2(level, message, x1, x2) ((void) 0) -#define Log3(level, message, x1, x2, x3) ((void) 0) -#define Log4(level, message, x1, x2, x3, x4) ((void) 0) - -#endif /* LOGGING */ - -#endif /* !_JAVASOFT_VM_CALLS_H_ */ diff --git a/jdk/src/share/hpi/src/hpi.c b/jdk/src/share/hpi/src/hpi.c deleted file mode 100644 index 09389d3cf69..00000000000 --- a/jdk/src/share/hpi/src/hpi.c +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include - -#include "hpi_impl.h" -#include "threads_md.h" - -int logging_level = 0; -bool_t profiler_on = FALSE; - -int sysSetLoggingLevel(int level) -{ - int old = logging_level; - logging_level = level; - return old; -} - -bool_t sysSetMonitoringOn(bool_t s) -{ - bool_t old = profiler_on; - profiler_on = s; - return old; -} - -int nReservedBytes; - -sys_thread_t *allocThreadBlock() -{ - char *p = sysCalloc(nReservedBytes + sizeof(sys_thread_t), 1); - if (p == NULL) { - return NULL; - } - return (sys_thread_t *)(p + nReservedBytes); -} - -void freeThreadBlock(sys_thread_t *tid) -{ - sysFree((char *)tid - nReservedBytes); -} - -vm_calls_t *vm_calls = NULL; - -static HPI_MemoryInterface hpi_memory_interface = { - sysMalloc, - sysRealloc, - sysFree, - sysCalloc, - sysStrdup, - sysMapMem, - sysUnmapMem, - sysCommitMem, - sysDecommitMem, - sysAllocBlock, - sysFreeBlock, -}; - -static HPI_LibraryInterface hpi_library_interface = { - sysBuildLibName, - sysBuildFunName, - sysLoadLibrary, - sysUnloadLibrary, - sysFindLibraryEntry, -}; - -static HPI_SystemInterface hpi_system_interface = { - sysGetSysInfo, - sysGetMilliTicks, - sysTimeMillis, - sysSignal, - sysRaise, - sysSignalNotify, - sysSignalWait, - sysShutdown, - sysSetLoggingLevel, - sysSetMonitoringOn, - sysGetLastErrorString -}; - -static HPI_ThreadInterface hpi_thread_interface = { - sysThreadBootstrap, - sysThreadCreate, - sysThreadSelf, - sysThreadYield, - sysThreadSuspend, - sysThreadResume, - sysThreadSetPriority, - sysThreadGetPriority, - sysThreadStackPointer, - sysThreadStackTop, - sysThreadRegs, - sysThreadSingle, - sysThreadMulti, - sysThreadEnumerateOver, - sysThreadCheckStack, - sysThreadPostException, - sysThreadInterrupt, - sysThreadIsInterrupted, - sysThreadAlloc, - sysThreadFree, - sysThreadCPUTime, - sysThreadGetStatus, - sysThreadInterruptEvent, - sysThreadNativeID, - sysThreadIsRunning, - sysThreadProfSuspend, - sysThreadProfResume, - sysAdjustTimeSlice, - sysMonitorSizeof, - sysMonitorInit, - sysMonitorDestroy, - sysMonitorEnter, - sysMonitorEntered, - sysMonitorExit, - sysMonitorNotify, - sysMonitorNotifyAll, - sysMonitorWait, - sysMonitorInUse, - sysMonitorOwner, - sysMonitorGetInfo, -}; - -static HPI_FileInterface hpi_file_interface = { - sysNativePath, - sysFileType, - sysOpen, - sysClose, - sysSeek, - sysSetLength, - sysSync, - sysAvailable, - sysRead, - sysWrite, - sysFileSizeFD -}; - -static HPI_SocketInterface hpi_socket_interface = { - sysSocketClose, - sysSocketAvailable, - sysConnect, - sysAccept, - sysSendTo, - sysRecvFrom, - sysListen, - sysRecv, - sysSend, - sysTimeout, - sysGetHostByName, - sysSocket, - sysSocketShutdown, - sysBind, - sysGetSockName, - sysGetHostName, - sysGetHostByAddr, - sysGetSockOpt, - sysSetSockOpt, - sysGetProtoByName, -}; - -static jint JNICALL -GetInterface(void **intfP, const char *name, jint version) -{ - *intfP = NULL; - if (version != 1) { - return -1; - } - if (strcmp(name, "Memory") == 0) { - *intfP = &hpi_memory_interface; - return 0; - } - if (strcmp(name, "Library") == 0) { - *intfP = &hpi_library_interface; - return 0; - } - if (strcmp(name, "System") == 0) { - *intfP = &hpi_system_interface; - return 0; - } - if (strcmp(name, "Thread") == 0) { - *intfP = &hpi_thread_interface; - return 0; - } - if (strcmp(name, "File") == 0) { - *intfP = &hpi_file_interface; - return 0; - } - if (strcmp(name, "Socket") == 0) { - *intfP = &hpi_socket_interface; - return 0; - } - return -2; -} - -jint JNICALL -DLL_Initialize(GetInterfaceFunc *gi, void *args) -{ - vm_calls = args; - *gi = GetInterface; - return SYS_OK; -} diff --git a/jdk/src/share/instrument/JPLISAgent.c b/jdk/src/share/instrument/JPLISAgent.c index adc9cf13355..7f6b2a0b67c 100644 --- a/jdk/src/share/instrument/JPLISAgent.c +++ b/jdk/src/share/instrument/JPLISAgent.c @@ -209,7 +209,7 @@ createNewJPLISAgent(JavaVM * vm, JPLISAgent **agent_ptr) { *agent_ptr = NULL; jnierror = (*vm)->GetEnv( vm, (void **) &jvmtienv, - JVMTI_VERSION); + JVMTI_VERSION_1_1); if ( jnierror != JNI_OK ) { initerror = JPLIS_INIT_ERROR_CANNOT_CREATE_NATIVE_AGENT; } else { @@ -990,7 +990,7 @@ retransformableEnvironment(JPLISAgent * agent) { } jnierror = (*agent->mJVM)->GetEnv( agent->mJVM, (void **) &retransformerEnv, - JVMTI_VERSION); + JVMTI_VERSION_1_1); if ( jnierror != JNI_OK ) { return NULL; } diff --git a/jdk/src/share/javavm/export/classfile_constants.h b/jdk/src/share/javavm/export/classfile_constants.h index 9030935c5c6..ccdf594fdca 100644 --- a/jdk/src/share/javavm/export/classfile_constants.h +++ b/jdk/src/share/javavm/export/classfile_constants.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/javavm/export/jmm.h b/jdk/src/share/javavm/export/jmm.h index e25de8bbb77..df08124e56c 100644 --- a/jdk/src/share/javavm/export/jmm.h +++ b/jdk/src/share/javavm/export/jmm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * 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,7 +60,8 @@ typedef struct { unsigned int isBootClassPathSupported : 1; unsigned int isObjectMonitorUsageSupported : 1; unsigned int isSynchronizerUsageSupported : 1; - unsigned int : 24; + unsigned int isThreadAllocatedMemorySupported : 1; + unsigned int : 23; } jmmOptionalSupport; typedef enum { @@ -105,7 +106,8 @@ typedef enum { JMM_VERBOSE_GC = 21, JMM_VERBOSE_CLASS = 22, JMM_THREAD_CONTENTION_MONITORING = 23, - JMM_THREAD_CPU_TIME = 24 + JMM_THREAD_CPU_TIME = 24, + JMM_THREAD_ALLOCATED_MEMORY = 25 } jmmBoolAttribute; @@ -213,7 +215,10 @@ typedef struct jmmInterface_1_ { jobject (JNICALL *GetMemoryPoolUsage) (JNIEnv* env, jobject pool); jobject (JNICALL *GetPeakMemoryPoolUsage) (JNIEnv* env, jobject pool); - void* reserved4; + void (JNICALL *GetThreadAllocatedMemory) + (JNIEnv *env, + jlongArray ids, + jlongArray sizeArray); jobject (JNICALL *GetMemoryUsage) (JNIEnv* env, jboolean heap); @@ -228,6 +233,8 @@ typedef struct jmmInterface_1_ { jlong* result); jobjectArray (JNICALL *FindCircularBlockedThreads) (JNIEnv *env); + + // Not used in JDK 6 or JDK 7 jlong (JNICALL *GetThreadCpuTime) (JNIEnv *env, jlong thread_id); jobjectArray (JNICALL *GetVMGlobalNames) (JNIEnv *env); @@ -262,14 +269,22 @@ typedef struct jmmInterface_1_ { void (JNICALL *GetLastGCStat) (JNIEnv *env, jobject mgr, jmmGCStat *gc_stat); - jlong (JNICALL *GetThreadCpuTimeWithKind) (JNIEnv *env, - jlong thread_id, - jboolean user_sys_cpu_time); - void* reserved5; + + jlong (JNICALL *GetThreadCpuTimeWithKind) + (JNIEnv *env, + jlong thread_id, + jboolean user_sys_cpu_time); + void (JNICALL *GetThreadCpuTimesWithKind) + (JNIEnv *env, + jlongArray ids, + jlongArray timeArray, + jboolean user_sys_cpu_time); + jint (JNICALL *DumpHeap0) (JNIEnv *env, jstring outputfile, jboolean live); - jobjectArray (JNICALL *FindDeadlocks) (JNIEnv *env, jboolean object_monitors_only); + jobjectArray (JNICALL *FindDeadlocks) (JNIEnv *env, + jboolean object_monitors_only); void (JNICALL *SetVMGlobal) (JNIEnv *env, jstring flag_name, jvalue new_value); diff --git a/jdk/src/share/javavm/export/jvmti.h b/jdk/src/share/javavm/export/jvmti.h index c235f16376b..7e9f2216b55 100644 --- a/jdk/src/share/javavm/export/jvmti.h +++ b/jdk/src/share/javavm/export/jvmti.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +41,9 @@ enum { JVMTI_VERSION_1 = 0x30010000, JVMTI_VERSION_1_0 = 0x30010000, JVMTI_VERSION_1_1 = 0x30010100, + JVMTI_VERSION_1_2 = 0x30010200, - JVMTI_VERSION = 0x30000000 + (1 * 0x10000) + (1 * 0x100) + 102 /* version: 1.1.102 */ + JVMTI_VERSION = 0x30000000 + (1 * 0x10000) + (2 * 0x100) + 1 /* version: 1.2.1 */ }; JNIEXPORT jint JNICALL @@ -1774,6 +1775,12 @@ typedef struct jvmtiInterface_1_ { jobject object, jlong* size_ptr); + /* 155 : Get Local Instance */ + jvmtiError (JNICALL *GetLocalInstance) (jvmtiEnv* env, + jthread thread, + jint depth, + jobject* value_ptr); + } jvmtiInterface_1; struct _jvmtiEnv { @@ -2031,6 +2038,12 @@ struct _jvmtiEnv { return functions->GetLocalObject(this, thread, depth, slot, value_ptr); } + jvmtiError GetLocalInstance(jthread thread, + jint depth, + jobject* value_ptr) { + return functions->GetLocalInstance(this, thread, depth, value_ptr); + } + jvmtiError GetLocalInt(jthread thread, jint depth, jint slot, @@ -2518,3 +2531,4 @@ struct _jvmtiEnv { #endif /* __cplusplus */ #endif /* !_JAVA_JVMTI_H_ */ + diff --git a/jdk/src/share/lib/security/java.security b/jdk/src/share/lib/security/java.security index 1c9404f60af..5a0726de0a7 100644 --- a/jdk/src/share/lib/security/java.security +++ b/jdk/src/share/lib/security/java.security @@ -282,3 +282,95 @@ networkaddress.cache.negative.ttl=10 # krb5.kdc.bad.policy = tryLess:2,2000 krb5.kdc.bad.policy = tryLast +# Algorithm restrictions for certification path (CertPath) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# for certification path building and validation. For example, "MD2" is +# generally no longer considered to be a secure hash algorithm. This section +# describes the mechanism for disabling algorithms based on algorithm name +# and/or key length. This includes algorithms used in certificates, as well +# as revocation information such as CRLs and signed OCSP Responses. +# +# The syntax of the disabled algorithm string is described as this Java +# BNF-style: +# DisabledAlgorithms: +# " DisabledAlgorithm { , DisabledAlgorithm } " +# +# DisabledAlgorithm: +# AlgorithmName [Constraint] +# +# AlgorithmName: +# (see below) +# +# Constraint: +# KeySizeConstraint +# +# KeySizeConstraint: +# keySize Operator DecimalInteger +# +# Operator: +# <= | < | == | != | >= | > +# +# DecimalInteger: +# DecimalDigits +# +# DecimalDigits: +# DecimalDigit {DecimalDigit} +# +# DecimalDigit: one of +# 1 2 3 4 5 6 7 8 9 0 +# +# The "AlgorithmName" is the standard algorithm name of the disabled +# algorithm. See "Java Cryptography Architecture Standard Algorithm Name +# Documentation" for information about Standard Algorithm Names. Matching +# is performed using a case-insensitive sub-element matching rule. (For +# example, in "SHA1withECDSA" the sub-elements are "SHA1" for hashing and +# "ECDSA" for signatures.) If the assertion "AlgorithmName" is a +# sub-element of the certificate algorithm name, the algorithm will be +# rejected during certification path building and validation. For example, +# the assertion algorithm name "DSA" will disable all certificate algorithms +# that rely on DSA, such as NONEwithDSA, SHA1withDSA. However, the assertion +# will not disable algorithms related to "ECDSA". +# +# A "Constraint" provides further guidance for the algorithm being specified. +# The "KeySizeConstraint" requires a key of a valid size range if the +# "AlgorithmName" is of a key algorithm. The "DecimalInteger" indicates the +# key size specified in number of bits. For example, "RSA keySize <= 1024" +# indicates that any RSA key with key size less than or equal to 1024 bits +# should be disabled, and "RSA keySize < 1024, RSA keySize > 2048" indicates +# that any RSA key with key size less than 1024 or greater than 2048 should +# be disabled. Note that the "KeySizeConstraint" only makes sense to key +# algorithms. +# +# Note: This property is currently used by Oracle's PKIX implementation. It +# is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048 +# +# +jdk.certpath.disabledAlgorithms=MD2 + +# Algorithm restrictions for Secure Socket Layer/Transport Layer Security +# (SSL/TLS) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# when using SSL/TLS. This section describes the mechanism for disabling +# algorithms during SSL/TLS security parameters negotiation, including cipher +# suites selection, peer authentication and key exchange mechanisms. +# +# For PKI-based peer authentication and key exchange mechanisms, this list +# of disabled algorithms will also be checked during certification path +# building and validation, including algorithms used in certificates, as +# well as revocation information such as CRLs and signed OCSP Responses. +# This is in addition to the jdk.certpath.disabledAlgorithms property above. +# +# See the specification of "jdk.certpath.disabledAlgorithms" for the +# syntax of the disabled algorithm string. +# +# Note: This property is currently used by Oracle's JSSE implementation. +# It is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048 + diff --git a/jdk/src/share/lib/security/java.security-solaris b/jdk/src/share/lib/security/java.security-solaris index 43621a48511..8e9b1ffd791 100644 --- a/jdk/src/share/lib/security/java.security-solaris +++ b/jdk/src/share/lib/security/java.security-solaris @@ -56,10 +56,10 @@ security.provider.10=sun.security.smartcardio.SunPCSC # # Select the source of seed data for SecureRandom. By default an -# attempt is made to use the entropy gathering device specified by +# attempt is made to use the entropy gathering device specified by # the securerandom.source property. If an exception occurs when -# accessing the URL then the traditional system/thread activity -# algorithm is used. +# accessing the URL then the traditional system/thread activity +# algorithm is used. # # On Solaris and Linux systems, if file:/dev/urandom is specified and it # exists, a special SecureRandom implementation is activated by default. @@ -73,7 +73,7 @@ securerandom.source=file:/dev/urandom # The entropy gathering device is described as a URL and can also # be specified with the system property "java.security.egd". For example, # -Djava.security.egd=file:/dev/urandom -# Specifying this system property will override the securerandom.source +# Specifying this system property will override the securerandom.source # setting. # @@ -118,11 +118,6 @@ policy.ignoreIdentityScope=false # keystore.type=jks -# -# Class to instantiate as the system scope: -# -system.scope=sun.security.provider.IdentityDatabase - # # List of comma-separated packages that start with or equal this string # will cause a security exception to be thrown when @@ -150,7 +145,7 @@ package.access=sun.,com.sun.imageio. security.overridePropertiesFile=true # -# Determines the default key and trust manager factory algorithms for +# Determines the default key and trust manager factory algorithms for # the javax.net.ssl package. # ssl.KeyManagerFactory.algorithm=SunX509 @@ -165,13 +160,14 @@ ssl.TrustManagerFactory.algorithm=PKIX # # default value is forever (FOREVER). For security reasons, this # caching is made forever when a security manager is set. When a security -# manager is not set, the default behavior is to cache for 30 seconds. +# manager is not set, the default behavior in this implementation +# is to cache for 30 seconds. # # NOTE: setting this to anything other than the default value can have -# serious security implications. Do not set it unless +# serious security implications. Do not set it unless # you are sure you are not exposed to DNS spoofing attack. # -#networkaddress.cache.ttl=-1 +#networkaddress.cache.ttl=-1 # The Java-level namelookup cache policy for failed lookups: # @@ -183,7 +179,7 @@ ssl.TrustManagerFactory.algorithm=PKIX # the WINS name service in addition to DNS, name service lookups # that fail may take a noticeably long time to return (approx. 5 seconds). # For this reason the default caching policy is to maintain these -# results for 10 seconds. +# results for 10 seconds. # # networkaddress.cache.negative.ttl=10 @@ -192,7 +188,7 @@ networkaddress.cache.negative.ttl=10 # Properties to configure OCSP for certificate revocation checking # -# Enable OCSP +# Enable OCSP # # By default, OCSP is not used for certificate revocation checking. # This property enables the use of OCSP when set to the value "true". @@ -201,7 +197,7 @@ networkaddress.cache.negative.ttl=10 # # Example, # ocsp.enable=true - + # # Location of the OCSP responder # @@ -213,15 +209,15 @@ networkaddress.cache.negative.ttl=10 # # Example, # ocsp.responderURL=http://ocsp.example.net:80 - + # # Subject name of the OCSP responder's certificate # # By default, the certificate of the OCSP responder is that of the issuer # of the certificate being validated. This property identifies the certificate -# of the OCSP responder when the default does not apply. Its value is a string -# distinguished name (defined in RFC 2253) which identifies a certificate in -# the set of certificates supplied during cert path validation. In cases where +# of the OCSP responder when the default does not apply. Its value is a string +# distinguished name (defined in RFC 2253) which identifies a certificate in +# the set of certificates supplied during cert path validation. In cases where # the subject name alone is not sufficient to uniquely identify the certificate # then both the "ocsp.responderCertIssuerName" and # "ocsp.responderCertSerialNumber" properties must be used instead. When this @@ -237,14 +233,14 @@ networkaddress.cache.negative.ttl=10 # of the certificate being validated. This property identifies the certificate # of the OCSP responder when the default does not apply. Its value is a string # distinguished name (defined in RFC 2253) which identifies a certificate in -# the set of certificates supplied during cert path validation. When this -# property is set then the "ocsp.responderCertSerialNumber" property must also -# be set. When the "ocsp.responderCertSubjectName" property is set then this +# the set of certificates supplied during cert path validation. When this +# property is set then the "ocsp.responderCertSerialNumber" property must also +# be set. When the "ocsp.responderCertSubjectName" property is set then this # property is ignored. # # Example, # ocsp.responderCertIssuerName="CN=Enterprise CA, O=XYZ Corp" - + # # Serial number of the OCSP responder's certificate # @@ -259,7 +255,7 @@ networkaddress.cache.negative.ttl=10 # # Example, # ocsp.responderCertSerialNumber=2A:FF:00 - + # # Policy for failed Kerberos KDC lookups: # @@ -287,3 +283,95 @@ networkaddress.cache.negative.ttl=10 # krb5.kdc.bad.policy = tryLess:2,2000 krb5.kdc.bad.policy = tryLast +# Algorithm restrictions for certification path (CertPath) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# for certification path building and validation. For example, "MD2" is +# generally no longer considered to be a secure hash algorithm. This section +# describes the mechanism for disabling algorithms based on algorithm name +# and/or key length. This includes algorithms used in certificates, as well +# as revocation information such as CRLs and signed OCSP Responses. +# +# The syntax of the disabled algorithm string is described as this Java +# BNF-style: +# DisabledAlgorithms: +# " DisabledAlgorithm { , DisabledAlgorithm } " +# +# DisabledAlgorithm: +# AlgorithmName [Constraint] +# +# AlgorithmName: +# (see below) +# +# Constraint: +# KeySizeConstraint +# +# KeySizeConstraint: +# keySize Operator DecimalInteger +# +# Operator: +# <= | < | == | != | >= | > +# +# DecimalInteger: +# DecimalDigits +# +# DecimalDigits: +# DecimalDigit {DecimalDigit} +# +# DecimalDigit: one of +# 1 2 3 4 5 6 7 8 9 0 +# +# The "AlgorithmName" is the standard algorithm name of the disabled +# algorithm. See "Java Cryptography Architecture Standard Algorithm Name +# Documentation" for information about Standard Algorithm Names. Matching +# is performed using a case-insensitive sub-element matching rule. (For +# example, in "SHA1withECDSA" the sub-elements are "SHA1" for hashing and +# "ECDSA" for signatures.) If the assertion "AlgorithmName" is a +# sub-element of the certificate algorithm name, the algorithm will be +# rejected during certification path building and validation. For example, +# the assertion algorithm name "DSA" will disable all certificate algorithms +# that rely on DSA, such as NONEwithDSA, SHA1withDSA. However, the assertion +# will not disable algorithms related to "ECDSA". +# +# A "Constraint" provides further guidance for the algorithm being specified. +# The "KeySizeConstraint" requires a key of a valid size range if the +# "AlgorithmName" is of a key algorithm. The "DecimalInteger" indicates the +# key size specified in number of bits. For example, "RSA keySize <= 1024" +# indicates that any RSA key with key size less than or equal to 1024 bits +# should be disabled, and "RSA keySize < 1024, RSA keySize > 2048" indicates +# that any RSA key with key size less than 1024 or greater than 2048 should +# be disabled. Note that the "KeySizeConstraint" only makes sense to key +# algorithms. +# +# Note: This property is currently used by Oracle's PKIX implementation. It +# is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048 +# +# +jdk.certpath.disabledAlgorithms=MD2 + +# Algorithm restrictions for Secure Socket Layer/Transport Layer Security +# (SSL/TLS) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# when using SSL/TLS. This section describes the mechanism for disabling +# algorithms during SSL/TLS security parameters negotiation, including cipher +# suites selection, peer authentication and key exchange mechanisms. +# +# For PKI-based peer authentication and key exchange mechanisms, this list +# of disabled algorithms will also be checked during certification path +# building and validation, including algorithms used in certificates, as +# well as revocation information such as CRLs and signed OCSP Responses. +# This is in addition to the jdk.certpath.disabledAlgorithms property above. +# +# See the specification of "jdk.certpath.disabledAlgorithms" for the +# syntax of the disabled algorithm string. +# +# Note: This property is currently used by Oracle's JSSE implementation. +# It is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048 +i diff --git a/jdk/src/share/lib/security/java.security-windows b/jdk/src/share/lib/security/java.security-windows index 21573b7d23b..99eda51b910 100644 --- a/jdk/src/share/lib/security/java.security-windows +++ b/jdk/src/share/lib/security/java.security-windows @@ -56,10 +56,10 @@ security.provider.10=sun.security.mscapi.SunMSCAPI # # Select the source of seed data for SecureRandom. By default an -# attempt is made to use the entropy gathering device specified by +# attempt is made to use the entropy gathering device specified by # the securerandom.source property. If an exception occurs when -# accessing the URL then the traditional system/thread activity -# algorithm is used. +# accessing the URL then the traditional system/thread activity +# algorithm is used. # # On Solaris and Linux systems, if file:/dev/urandom is specified and it # exists, a special SecureRandom implementation is activated by default. @@ -73,7 +73,7 @@ securerandom.source=file:/dev/urandom # The entropy gathering device is described as a URL and can also # be specified with the system property "java.security.egd". For example, # -Djava.security.egd=file:/dev/urandom -# Specifying this system property will override the securerandom.source +# Specifying this system property will override the securerandom.source # setting. # @@ -118,11 +118,6 @@ policy.ignoreIdentityScope=false # keystore.type=jks -# -# Class to instantiate as the system scope: -# -system.scope=sun.security.provider.IdentityDatabase - # # List of comma-separated packages that start with or equal this string # will cause a security exception to be thrown when @@ -150,7 +145,7 @@ package.access=sun.,com.sun.imageio. security.overridePropertiesFile=true # -# Determines the default key and trust manager factory algorithms for +# Determines the default key and trust manager factory algorithms for # the javax.net.ssl package. # ssl.KeyManagerFactory.algorithm=SunX509 @@ -165,13 +160,14 @@ ssl.TrustManagerFactory.algorithm=PKIX # # default value is forever (FOREVER). For security reasons, this # caching is made forever when a security manager is set. When a security -# manager is not set, the default behavior is to cache for 30 seconds. +# manager is not set, the default behavior in this implementation +# is to cache for 30 seconds. # # NOTE: setting this to anything other than the default value can have -# serious security implications. Do not set it unless +# serious security implications. Do not set it unless # you are sure you are not exposed to DNS spoofing attack. # -#networkaddress.cache.ttl=-1 +#networkaddress.cache.ttl=-1 # The Java-level namelookup cache policy for failed lookups: # @@ -183,7 +179,7 @@ ssl.TrustManagerFactory.algorithm=PKIX # the WINS name service in addition to DNS, name service lookups # that fail may take a noticeably long time to return (approx. 5 seconds). # For this reason the default caching policy is to maintain these -# results for 10 seconds. +# results for 10 seconds. # # networkaddress.cache.negative.ttl=10 @@ -192,7 +188,7 @@ networkaddress.cache.negative.ttl=10 # Properties to configure OCSP for certificate revocation checking # -# Enable OCSP +# Enable OCSP # # By default, OCSP is not used for certificate revocation checking. # This property enables the use of OCSP when set to the value "true". @@ -201,7 +197,7 @@ networkaddress.cache.negative.ttl=10 # # Example, # ocsp.enable=true - + # # Location of the OCSP responder # @@ -213,15 +209,15 @@ networkaddress.cache.negative.ttl=10 # # Example, # ocsp.responderURL=http://ocsp.example.net:80 - + # # Subject name of the OCSP responder's certificate # # By default, the certificate of the OCSP responder is that of the issuer # of the certificate being validated. This property identifies the certificate -# of the OCSP responder when the default does not apply. Its value is a string -# distinguished name (defined in RFC 2253) which identifies a certificate in -# the set of certificates supplied during cert path validation. In cases where +# of the OCSP responder when the default does not apply. Its value is a string +# distinguished name (defined in RFC 2253) which identifies a certificate in +# the set of certificates supplied during cert path validation. In cases where # the subject name alone is not sufficient to uniquely identify the certificate # then both the "ocsp.responderCertIssuerName" and # "ocsp.responderCertSerialNumber" properties must be used instead. When this @@ -237,14 +233,14 @@ networkaddress.cache.negative.ttl=10 # of the certificate being validated. This property identifies the certificate # of the OCSP responder when the default does not apply. Its value is a string # distinguished name (defined in RFC 2253) which identifies a certificate in -# the set of certificates supplied during cert path validation. When this -# property is set then the "ocsp.responderCertSerialNumber" property must also -# be set. When the "ocsp.responderCertSubjectName" property is set then this +# the set of certificates supplied during cert path validation. When this +# property is set then the "ocsp.responderCertSerialNumber" property must also +# be set. When the "ocsp.responderCertSubjectName" property is set then this # property is ignored. # # Example, # ocsp.responderCertIssuerName="CN=Enterprise CA, O=XYZ Corp" - + # # Serial number of the OCSP responder's certificate # @@ -259,7 +255,7 @@ networkaddress.cache.negative.ttl=10 # # Example, # ocsp.responderCertSerialNumber=2A:FF:00 - + # # Policy for failed Kerberos KDC lookups: # @@ -287,3 +283,95 @@ networkaddress.cache.negative.ttl=10 # krb5.kdc.bad.policy = tryLess:2,2000 krb5.kdc.bad.policy = tryLast +# Algorithm restrictions for certification path (CertPath) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# for certification path building and validation. For example, "MD2" is +# generally no longer considered to be a secure hash algorithm. This section +# describes the mechanism for disabling algorithms based on algorithm name +# and/or key length. This includes algorithms used in certificates, as well +# as revocation information such as CRLs and signed OCSP Responses. +# +# The syntax of the disabled algorithm string is described as this Java +# BNF-style: +# DisabledAlgorithms: +# " DisabledAlgorithm { , DisabledAlgorithm } " +# +# DisabledAlgorithm: +# AlgorithmName [Constraint] +# +# AlgorithmName: +# (see below) +# +# Constraint: +# KeySizeConstraint +# +# KeySizeConstraint: +# keySize Operator DecimalInteger +# +# Operator: +# <= | < | == | != | >= | > +# +# DecimalInteger: +# DecimalDigits +# +# DecimalDigits: +# DecimalDigit {DecimalDigit} +# +# DecimalDigit: one of +# 1 2 3 4 5 6 7 8 9 0 +# +# The "AlgorithmName" is the standard algorithm name of the disabled +# algorithm. See "Java Cryptography Architecture Standard Algorithm Name +# Documentation" for information about Standard Algorithm Names. Matching +# is performed using a case-insensitive sub-element matching rule. (For +# example, in "SHA1withECDSA" the sub-elements are "SHA1" for hashing and +# "ECDSA" for signatures.) If the assertion "AlgorithmName" is a +# sub-element of the certificate algorithm name, the algorithm will be +# rejected during certification path building and validation. For example, +# the assertion algorithm name "DSA" will disable all certificate algorithms +# that rely on DSA, such as NONEwithDSA, SHA1withDSA. However, the assertion +# will not disable algorithms related to "ECDSA". +# +# A "Constraint" provides further guidance for the algorithm being specified. +# The "KeySizeConstraint" requires a key of a valid size range if the +# "AlgorithmName" is of a key algorithm. The "DecimalInteger" indicates the +# key size specified in number of bits. For example, "RSA keySize <= 1024" +# indicates that any RSA key with key size less than or equal to 1024 bits +# should be disabled, and "RSA keySize < 1024, RSA keySize > 2048" indicates +# that any RSA key with key size less than 1024 or greater than 2048 should +# be disabled. Note that the "KeySizeConstraint" only makes sense to key +# algorithms. +# +# Note: This property is currently used by Oracle's PKIX implementation. It +# is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048 +# +# +jdk.certpath.disabledAlgorithms=MD2 + +# Algorithm restrictions for Secure Socket Layer/Transport Layer Security +# (SSL/TLS) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# when using SSL/TLS. This section describes the mechanism for disabling +# algorithms during SSL/TLS security parameters negotiation, including cipher +# suites selection, peer authentication and key exchange mechanisms. +# +# For PKI-based peer authentication and key exchange mechanisms, this list +# of disabled algorithms will also be checked during certification path +# building and validation, including algorithms used in certificates, as +# well as revocation information such as CRLs and signed OCSP Responses. +# This is in addition to the jdk.certpath.disabledAlgorithms property above. +# +# See the specification of "jdk.certpath.disabledAlgorithms" for the +# syntax of the disabled algorithm string. +# +# Note: This property is currently used by Oracle's JSSE implementation. +# It is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048 + diff --git a/jdk/src/share/lib/security/sunpkcs11-solaris.cfg b/jdk/src/share/lib/security/sunpkcs11-solaris.cfg index 4ceccc3d08d..d0b34ca134d 100644 --- a/jdk/src/share/lib/security/sunpkcs11-solaris.cfg +++ b/jdk/src/share/lib/security/sunpkcs11-solaris.cfg @@ -31,5 +31,9 @@ disabledMechanisms = { CKM_SHA256_RSA_PKCS CKM_SHA384_RSA_PKCS CKM_SHA512_RSA_PKCS +# the following mechanisms are disabled to ensure backward compatibility (Solaris bug 6545046) + CKM_DES_CBC_PAD + CKM_DES3_CBC_PAD + CKM_AES_CBC_PAD } diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.cpp index 8f0e0419bc2..44b4bc581d9 100644 --- a/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.cpp +++ b/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/com/sun/java/util/jar/pack/unpack.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp index 302078e151e..b53b14ed87b 100644 --- a/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp +++ b/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/common/check_code.c b/jdk/src/share/native/common/check_code.c index 980480edfec..00dcdf163b3 100644 --- a/jdk/src/share/native/common/check_code.c +++ b/jdk/src/share/native/common/check_code.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/common/jdk_util.c b/jdk/src/share/native/common/jdk_util.c index 8c7c8a1da1c..2fb3366d740 100644 --- a/jdk/src/share/native/common/jdk_util.c +++ b/jdk/src/share/native/common/jdk_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ #include #include +#include +#include #include "jvm.h" #include "jdk_util.h" @@ -45,6 +47,7 @@ JDK_GetVersionInfo0(jdk_version_info* info, size_t info_size) { (unsigned int) atoi(JDK_MICRO_VERSION); const char* jdk_build_string = JDK_BUILD_NUMBER; + char build_number[4]; unsigned int jdk_build_number = 0; const char* jdk_update_string = JDK_UPDATE_VERSION; @@ -55,16 +58,28 @@ JDK_GetVersionInfo0(jdk_version_info* info, size_t info_size) { /* If the JDK_BUILD_NUMBER is of format bXX and XX is an integer * XX is the jdk_build_number. */ - if (strlen(jdk_build_string) == 3) { - if (jdk_build_string[0] == 'b' && - jdk_build_string[1] >= '0' && jdk_build_string[1] <= '9' && - jdk_build_string[2] >= '0' && jdk_build_string[2] <= '9') { - jdk_build_number = (unsigned int) atoi(&jdk_build_string[1]); + int len = strlen(jdk_build_string); + if (jdk_build_string[0] == 'b' && len >= 2) { + int i = 0; + for (i = 1; i < len; i++) { + if (isdigit(jdk_build_string[i])) { + build_number[i-1] = jdk_build_string[i]; + } else { + // invalid build number + i = -1; + break; + } + } + if (i == len) { + build_number[len-1] = '\0'; + jdk_build_number = (unsigned int) atoi(build_number) ; } } + + assert(jdk_build_number >= 0 && jdk_build_number <= 255); + if (strlen(jdk_update_string) == 2 || strlen(jdk_update_string) == 3) { - if (jdk_update_string[0] >= '0' && jdk_update_string[0] <= '9' && - jdk_update_string[1] >= '0' && jdk_update_string[1] <= '9') { + if (isdigit(jdk_update_string[0]) && isdigit(jdk_update_string[1])) { update_ver[0] = jdk_update_string[0]; update_ver[1] = jdk_update_string[1]; update_ver[2] = '\0'; @@ -75,7 +90,6 @@ JDK_GetVersionInfo0(jdk_version_info* info, size_t info_size) { } } - memset(info, 0, info_size); info->jdk_version = ((jdk_major_version & 0xFF) << 24) | ((jdk_minor_version & 0xFF) << 16) | diff --git a/jdk/src/share/native/common/jni_util.c b/jdk/src/share/native/common/jni_util.c index fb903bbdcce..3ef707f6079 100644 --- a/jdk/src/share/native/common/jni_util.c +++ b/jdk/src/share/native/common/jni_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/java/io/RandomAccessFile.c b/jdk/src/share/native/java/io/RandomAccessFile.c index a8c3390b677..42733fb0b3c 100644 --- a/jdk/src/share/native/java/io/RandomAccessFile.c +++ b/jdk/src/share/native/java/io/RandomAccessFile.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -76,13 +76,13 @@ Java_java_io_RandomAccessFile_readBytes(JNIEnv *env, JNIEXPORT void JNICALL Java_java_io_RandomAccessFile_write(JNIEnv *env, jobject this, jint byte) { - writeSingle(env, this, byte, raf_fd); + writeSingle(env, this, byte, JNI_FALSE, raf_fd); } JNIEXPORT void JNICALL Java_java_io_RandomAccessFile_writeBytes(JNIEnv *env, jobject this, jbyteArray bytes, jint off, jint len) { - writeBytes(env, this, bytes, off, len, raf_fd); + writeBytes(env, this, bytes, off, len, JNI_FALSE, raf_fd); } JNIEXPORT jlong JNICALL diff --git a/jdk/src/share/native/java/io/io_util.c b/jdk/src/share/native/java/io/io_util.c index 986416e20d8..4689ef72afa 100644 --- a/jdk/src/share/native/java/io/io_util.c +++ b/jdk/src/share/native/java/io/io_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -127,7 +127,7 @@ readBytes(JNIEnv *env, jobject this, jbyteArray bytes, } void -writeSingle(JNIEnv *env, jobject this, jint byte, jfieldID fid) { +writeSingle(JNIEnv *env, jobject this, jint byte, jboolean append, jfieldID fid) { // Discard the 24 high-order bits of byte. See OutputStream#write(int) char c = (char) byte; jint n; @@ -136,7 +136,11 @@ writeSingle(JNIEnv *env, jobject this, jint byte, jfieldID fid) { JNU_ThrowIOException(env, "Stream Closed"); return; } - n = IO_Write(fd, &c, 1); + if (append == JNI_TRUE) { + n = IO_Append(fd, &c, 1); + } else { + n = IO_Write(fd, &c, 1); + } if (n == JVM_IO_ERR) { JNU_ThrowIOExceptionWithLastError(env, "Write error"); } else if (n == JVM_IO_INTR) { @@ -146,7 +150,7 @@ writeSingle(JNIEnv *env, jobject this, jint byte, jfieldID fid) { void writeBytes(JNIEnv *env, jobject this, jbyteArray bytes, - jint off, jint len, jfieldID fid) + jint off, jint len, jboolean append, jfieldID fid) { jint n; char stackBuf[BUF_SIZE]; @@ -185,7 +189,11 @@ writeBytes(JNIEnv *env, jobject this, jbyteArray bytes, JNU_ThrowIOException(env, "Stream Closed"); break; } - n = IO_Write(fd, buf+off, len); + if (append == JNI_TRUE) { + n = IO_Append(fd, buf+off, len); + } else { + n = IO_Write(fd, buf+off, len); + } if (n == JVM_IO_ERR) { JNU_ThrowIOExceptionWithLastError(env, "Write error"); break; diff --git a/jdk/src/share/native/java/io/io_util.h b/jdk/src/share/native/java/io/io_util.h index 436acdff16d..83eed0d88e8 100644 --- a/jdk/src/share/native/java/io/io_util.h +++ b/jdk/src/share/native/java/io/io_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +41,9 @@ extern jfieldID IO_handle_fdID; jint readSingle(JNIEnv *env, jobject this, jfieldID fid); jint readBytes(JNIEnv *env, jobject this, jbyteArray bytes, jint off, jint len, jfieldID fid); -void writeSingle(JNIEnv *env, jobject this, jint byte, jfieldID fid); +void writeSingle(JNIEnv *env, jobject this, jint byte, jboolean append, jfieldID fid); void writeBytes(JNIEnv *env, jobject this, jbyteArray bytes, jint off, - jint len, jfieldID fid); + jint len, jboolean append, jfieldID fid); void fileOpen(JNIEnv *env, jobject this, jstring path, jfieldID fid, int flags); void throwFileNotFoundException(JNIEnv *env, jstring path); diff --git a/jdk/src/share/native/java/lang/Class.c b/jdk/src/share/native/java/lang/Class.c index ff57ed31191..3e595e726af 100644 --- a/jdk/src/share/native/java/lang/Class.c +++ b/jdk/src/share/native/java/lang/Class.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/java/lang/ClassLoader.c b/jdk/src/share/native/java/lang/ClassLoader.c index 7e87af176ce..8965d0a86d7 100644 --- a/jdk/src/share/native/java/lang/ClassLoader.c +++ b/jdk/src/share/native/java/lang/ClassLoader.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/java/lang/System.c b/jdk/src/share/native/java/lang/System.c index 245b1bc5356..f2b81a069b5 100644 --- a/jdk/src/share/native/java/lang/System.c +++ b/jdk/src/share/native/java/lang/System.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +219,14 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props) /* * user.language - * user.country, user.variant (if user's environment specifies them) + * user.script, user.country, user.variant (if user's environment specifies them) * file.encoding * file.encoding.pkg */ PUTPROP(props, "user.language", sprops->language); + if (sprops->script) { + PUTPROP(props, "user.script", sprops->script); + } if (sprops->country) { PUTPROP(props, "user.country", sprops->country); } @@ -305,11 +308,12 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props) } /* - * unset "user.language", "user.country", and "user.variant" + * unset "user.language", "user.script", "user.country", and "user.variant" * in order to tell whether the command line option "-DXXXX=YYYY" is * specified or not. They will be reset in fillI18nProps() below. */ REMOVEPROP(props, "user.language"); + REMOVEPROP(props, "user.script"); REMOVEPROP(props, "user.country"); REMOVEPROP(props, "user.variant"); REMOVEPROP(props, "file.encoding"); @@ -328,6 +332,8 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props) /* reconstruct i18n related properties */ fillI18nProps(env, props, "user.language", sprops->display_language, sprops->format_language, putID, getPropID); + fillI18nProps(env, props, "user.script", + sprops->display_script, sprops->format_script, putID, getPropID); fillI18nProps(env, props, "user.country", sprops->display_country, sprops->format_country, putID, getPropID); fillI18nProps(env, props, "user.variant", diff --git a/jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h b/jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h index 7a11f52a3ed..2b3592dc143 100644 --- a/jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h +++ b/jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/java/lang/java_props.h b/jdk/src/share/native/java/lang/java_props.h index eda885911a2..89f7671c7e6 100644 --- a/jdk/src/share/native/java/lang/java_props.h +++ b/jdk/src/share/native/java/lang/java_props.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,6 +55,9 @@ typedef struct { char *language; char *format_language; char *display_language; + char *script; + char *format_script; + char *display_script; char *country; char *format_country; char *display_country; diff --git a/jdk/src/share/native/java/lang/reflect/Proxy.c b/jdk/src/share/native/java/lang/reflect/Proxy.c index 3f023a423a6..bdfbd905831 100644 --- a/jdk/src/share/native/java/lang/reflect/Proxy.c +++ b/jdk/src/share/native/java/lang/reflect/Proxy.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/java/net/net_util.c b/jdk/src/share/native/java/net/net_util.c index da6207e1525..68776c1ce0c 100644 --- a/jdk/src/share/native/java/net/net_util.c +++ b/jdk/src/share/native/java/net/net_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/java/nio/Bits.c b/jdk/src/share/native/java/nio/Bits.c index 838a764da56..20aa0d194a8 100644 --- a/jdk/src/share/native/java/nio/Bits.c +++ b/jdk/src/share/native/java/nio/Bits.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/java/util/zip/Deflater.c b/jdk/src/share/native/java/util/zip/Deflater.c index f0923c447ba..3b32750a298 100644 --- a/jdk/src/share/native/java/util/zip/Deflater.c +++ b/jdk/src/share/native/java/util/zip/Deflater.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -132,14 +132,17 @@ Java_java_util_zip_Deflater_deflateBytes(JNIEnv *env, jobject this, jlong addr, in_buf = (jbyte *) malloc(this_len); if (in_buf == 0) { - JNU_ThrowOutOfMemoryError(env, 0); + // Throw OOME only when length is not zero + if (this_len != 0) + JNU_ThrowOutOfMemoryError(env, 0); return 0; } (*env)->GetByteArrayRegion(env, this_buf, this_off, this_len, in_buf); out_buf = (jbyte *) malloc(len); if (out_buf == 0) { free(in_buf); - JNU_ThrowOutOfMemoryError(env, 0); + if (len != 0) + JNU_ThrowOutOfMemoryError(env, 0); return 0; } @@ -173,7 +176,8 @@ Java_java_util_zip_Deflater_deflateBytes(JNIEnv *env, jobject this, jlong addr, jboolean finish = (*env)->GetBooleanField(env, this, finishID); in_buf = (jbyte *) malloc(this_len); if (in_buf == 0) { - JNU_ThrowOutOfMemoryError(env, 0); + if (this_len != 0) + JNU_ThrowOutOfMemoryError(env, 0); return 0; } (*env)->GetByteArrayRegion(env, this_buf, this_off, this_len, in_buf); @@ -181,7 +185,8 @@ Java_java_util_zip_Deflater_deflateBytes(JNIEnv *env, jobject this, jlong addr, out_buf = (jbyte *) malloc(len); if (out_buf == 0) { free(in_buf); - JNU_ThrowOutOfMemoryError(env, 0); + if (len != 0) + JNU_ThrowOutOfMemoryError(env, 0); return 0; } diff --git a/jdk/src/share/native/java/util/zip/Inflater.c b/jdk/src/share/native/java/util/zip/Inflater.c index 78619f4ac0f..dbf9a1357ae 100644 --- a/jdk/src/share/native/java/util/zip/Inflater.c +++ b/jdk/src/share/native/java/util/zip/Inflater.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -135,7 +135,8 @@ Java_java_util_zip_Inflater_inflateBytes(JNIEnv *env, jobject this, jlong addr, in_buf = (jbyte *) malloc(in_len); if (in_buf == 0) { - JNU_ThrowOutOfMemoryError(env, 0); + if (in_len != 0) + JNU_ThrowOutOfMemoryError(env, 0); return 0; } (*env)->GetByteArrayRegion(env, this_buf, this_off, in_len, in_buf); @@ -143,7 +144,8 @@ Java_java_util_zip_Inflater_inflateBytes(JNIEnv *env, jobject this, jlong addr, out_buf = (jbyte *) malloc(len); if (out_buf == 0) { free(in_buf); - JNU_ThrowOutOfMemoryError(env, 0); + if (len != 0) + JNU_ThrowOutOfMemoryError(env, 0); return 0; } diff --git a/jdk/src/share/native/java/util/zip/ZipFile.c b/jdk/src/share/native/java/util/zip/ZipFile.c index 0345989ec62..99d6d229f89 100644 --- a/jdk/src/share/native/java/util/zip/ZipFile.c +++ b/jdk/src/share/native/java/util/zip/ZipFile.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/java/util/zip/zip_util.c b/jdk/src/share/native/java/util/zip/zip_util.c index 222fe738758..f048dc6b758 100644 --- a/jdk/src/share/native/java/util/zip/zip_util.c +++ b/jdk/src/share/native/java/util/zip/zip_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -314,7 +314,7 @@ findEND(jzfile *zip, void *endbuf) if (pos < 0) { /* Pretend there are some NUL bytes before start of file */ off = -pos; - memset(buf, '\0', off); + memset(buf, '\0', (size_t)off); } if (readFullyAt(zfd, buf + off, sizeof(buf) - off, @@ -426,7 +426,7 @@ static int isMetaName(const char *name, int length) { const char *s; - if (length < sizeof("META-INF/") - 1) + if (length < (int)sizeof("META-INF/") - 1) return 0; for (s = "META-INF/"; *s != '\0'; s++) { char c = *name++; @@ -912,7 +912,7 @@ readCENHeader(jzfile *zip, jlong cenpos, jint bufsize) ZFILE zfd = zip->zfd; char *cen; if (bufsize > zip->len - cenpos) - bufsize = zip->len - cenpos; + bufsize = (jint)(zip->len - cenpos); if ((cen = malloc(bufsize)) == NULL) goto Catch; if (readFullyAt(zfd, cen, bufsize, cenpos) == -1) goto Catch; censize = CENSIZE(cen); @@ -1256,6 +1256,9 @@ ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry) * file had been previously locked with ZIP_Lock(). Returns the * number of bytes read, or -1 if an error occurred. If zip->msg != 0 * then a zip error occurred and zip->msg contains the error text. + * + * The current implementation does not support reading an entry that + * has the size bigger than 2**32 bytes in ONE invocation. */ jint ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len) @@ -1276,7 +1279,7 @@ ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len) if (len <= 0) return 0; if (len > entry_size - pos) - len = entry_size - pos; + len = (jint)(entry_size - pos); /* Get file offset to start reading data */ start = ZIP_GetEntryDataOffset(zip, entry); @@ -1306,6 +1309,9 @@ ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len) * from ZIP/JAR files specified in the class path. It is defined here * so that it can be dynamically loaded by the runtime if the zip library * is found. + * + * The current implementation does not support reading an entry that + * has the size bigger than 2**32 bytes in ONE invocation. */ jboolean InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg) @@ -1314,7 +1320,6 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg) char tmp[BUF_SIZE]; jlong pos = 0; jlong count = entry->csize; - jboolean status; *msg = 0; /* Reset error message */ @@ -1330,10 +1335,10 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg) } strm.next_out = buf; - strm.avail_out = entry->size; + strm.avail_out = (uInt)entry->size; while (count > 0) { - jint n = count > (jlong)sizeof(tmp) ? (jint)sizeof(tmp) : count; + jint n = count > (jlong)sizeof(tmp) ? (jint)sizeof(tmp) : (jint)count; ZIP_Lock(zip); n = ZIP_Read(zip, entry, pos, tmp, n); ZIP_Unlock(zip); @@ -1368,12 +1373,16 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg) return JNI_TRUE; } +/* + * The current implementation does not support reading an entry that + * has the size bigger than 2**32 bytes in ONE invocation. + */ jzentry * JNICALL ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP) { jzentry *entry = ZIP_GetEntry(zip, name, 0); if (entry) { - *sizeP = entry->size; + *sizeP = (jint)entry->size; *nameLenP = strlen(entry->name); } return entry; diff --git a/jdk/src/share/native/java/util/zip/zip_util.h b/jdk/src/share/native/java/util/zip/zip_util.h index 6556a4aabd3..5771e86320f 100644 --- a/jdk/src/share/native/java/util/zip/zip_util.h +++ b/jdk/src/share/native/java/util/zip/zip_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/java/util/zip/zlib-1.2.3/compress.c b/jdk/src/share/native/java/util/zip/zlib-1.2.3/compress.c index c82999dcf9d..58669987caf 100644 --- a/jdk/src/share/native/java/util/zip/zlib-1.2.3/compress.c +++ b/jdk/src/share/native/java/util/zip/zlib-1.2.3/compress.c @@ -75,7 +75,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) deflateEnd(&stream); return err == Z_OK ? Z_BUF_ERROR : err; } - *destLen = stream.total_out; + *destLen = (uLong)stream.total_out; err = deflateEnd(&stream); return err; diff --git a/jdk/src/share/native/java/util/zip/zlib-1.2.3/uncompr.c b/jdk/src/share/native/java/util/zip/zlib-1.2.3/uncompr.c index c38dc304c45..d2e4ef4c97e 100644 --- a/jdk/src/share/native/java/util/zip/zlib-1.2.3/uncompr.c +++ b/jdk/src/share/native/java/util/zip/zlib-1.2.3/uncompr.c @@ -78,7 +78,7 @@ int ZEXPORT uncompress (dest, destLen, source, sourceLen) return Z_DATA_ERROR; return err; } - *destLen = stream.total_out; + *destLen = (uLong)stream.total_out; err = inflateEnd(&stream); return err; diff --git a/jdk/src/share/native/java/util/zip/zlib-1.2.3/zcrc32.c b/jdk/src/share/native/java/util/zip/zlib-1.2.3/zcrc32.c index 580e26c83c4..0fd9a92c05e 100644 --- a/jdk/src/share/native/java/util/zip/zlib-1.2.3/zcrc32.c +++ b/jdk/src/share/native/java/util/zip/zlib-1.2.3/zcrc32.c @@ -406,7 +406,7 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2) return crc1; /* put operator for one zero bit in odd */ - odd[0] = 0xedb88320L; /* CRC-32 polynomial */ + odd[0] = 0xedb88320UL; /* CRC-32 polynomial */ row = 1; for (n = 1; n < GF2_DIM; n++) { odd[n] = row; diff --git a/jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c b/jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c index f8ebd3ad4b7..a986467e93f 100644 --- a/jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c +++ b/jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/awt/image/awt_parseImage.c b/jdk/src/share/native/sun/awt/image/awt_parseImage.c index 0a50d19755b..b569828f5f6 100644 --- a/jdk/src/share/native/sun/awt/image/awt_parseImage.c +++ b/jdk/src/share/native/sun/awt/image/awt_parseImage.c @@ -178,7 +178,7 @@ int awt_parseRaster(JNIEnv *env, jobject jraster, RasterS_t *rasterP) { jnbits = (*env)->GetObjectField(env, rasterP->jsampleModel, g_SPPSMnBitsID); if (jmask == NULL || joffs == NULL || jnbits == NULL || - rasterP->sppsm.maxBitSize < 0 || rasterP->sppsm.maxBitSize > 8) + rasterP->sppsm.maxBitSize < 0) { JNU_ThrowInternalError(env, "Can't grab SPPSM fields"); return -1; @@ -280,6 +280,17 @@ int awt_parseRaster(JNIEnv *env, jobject jraster, RasterS_t *rasterP) { rasterP->chanOffsets); } + /* additioanl check for sppsm fields validity: make sure that + * size of raster samples doesn't exceed the data type cpacity. + */ + if (rasterP->dataType > UNKNOWN_DATA_TYPE && /* data type has been recognized */ + rasterP->sppsm.maxBitSize > 0 && /* raster has SPP sample model */ + rasterP->sppsm.maxBitSize > (rasterP->dataSize * 8)) + { + JNU_ThrowInternalError(env, "Raster samples are too big"); + return -1; + } + #if 0 fprintf(stderr,"---------------------\n"); fprintf(stderr,"Width : %d\n",rasterP->width); diff --git a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c index 6495db28fc5..bfbef221dbd 100644 --- a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c +++ b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/awt/libpng/pngrtran.c b/jdk/src/share/native/sun/awt/libpng/pngrtran.c index e3e675eeee0..e50ee482737 100644 --- a/jdk/src/share/native/sun/awt/libpng/pngrtran.c +++ b/jdk/src/share/native/sun/awt/libpng/pngrtran.c @@ -3993,7 +3993,7 @@ png_do_dither(png_row_infop row_info, png_bytep row, #ifdef PNG_FLOATING_POINT_SUPPORTED #if defined(PNG_READ_GAMMA_SUPPORTED) -const static int png_gamma_shift[] = +static PNG_CONST int png_gamma_shift[] = {0x10, 0x21, 0x42, 0x84, 0x110, 0x248, 0x550, 0xff0, 0x00}; /* We build the 8- or 16-bit gamma tables here. Note that for 16-bit diff --git a/jdk/src/share/native/sun/awt/libpng/pngrutil.c b/jdk/src/share/native/sun/awt/libpng/pngrutil.c index bce2e210715..428f947e00a 100644 --- a/jdk/src/share/native/sun/awt/libpng/pngrutil.c +++ b/jdk/src/share/native/sun/awt/libpng/pngrutil.c @@ -209,7 +209,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type, png_charp chunkdata, png_size_t chunklength, png_size_t prefix_size, png_size_t *newlength) { - const static char msg[] = "Error decoding compressed text"; + static PNG_CONST char msg[] = "Error decoding compressed text"; png_charp text; png_size_t text_size; diff --git a/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c b/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c index c9fec900e8f..4f1a2e1609a 100644 --- a/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c +++ b/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/awt/medialib/mlib_ImageLookUp_64.c b/jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c index 320ecfd8fa3..585739300aa 100644 --- a/jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c +++ b/jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -558,10 +558,11 @@ void mlib_ImageLookUp_S32_D64(const mlib_s32 *src, const mlib_d64 **table) { const mlib_d64 *table_base[4]; + mlib_u32 shift = TABLE_SHIFT_S32; mlib_s32 c; for (c = 0; c < csize; c++) { - table_base[c] = &table[c][TABLE_SHIFT_S32]; + table_base[c] = &table[c][shift]; } MLIB_C_IMAGELOOKUP(mlib_d64, mlib_s32, table_base); @@ -1039,10 +1040,11 @@ void mlib_ImageLookUpSI_S32_D64(const mlib_s32 *src, const mlib_d64 **table) { const mlib_d64 *table_base[4]; + mlib_u32 shift = TABLE_SHIFT_S32; mlib_s32 c; for (c = 0; c < csize; c++) { - table_base[c] = &table[c][TABLE_SHIFT_S32]; + table_base[c] = &table[c][shift]; } MLIB_C_IMAGELOOKUPSI(mlib_d64, mlib_s32, table_base); diff --git a/jdk/src/share/native/sun/awt/medialib/safe_alloc.h b/jdk/src/share/native/sun/awt/medialib/safe_alloc.h index 4dc00324cc7..ce744af2c3b 100644 --- a/jdk/src/share/native/sun/awt/medialib/safe_alloc.h +++ b/jdk/src/share/native/sun/awt/medialib/safe_alloc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/awt/splashscreen/splashscreen_gfx_impl.h b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h index f2f367c6dfa..a0fd446e94a 100644 --- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h +++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h @@ -88,27 +88,18 @@ ditherColor(rgbquad_t value, ImageFormat * format, int row, int col) /* blend (lerp between) two rgb quads src and dst alpha is ignored the algorithm: src*alpha+dst*(1-alpha)=(src-dst)*alpha+dst, rb and g are done separately - it's possible to verify that it's almost accurate indeed */ - +*/ INLINE rgbquad_t blendRGB(rgbquad_t dst, rgbquad_t src, rgbquad_t alpha) { - const rgbquad_t dstrb = dst & 0xFF00FF; - const rgbquad_t dstg = dst & 0xFF00; - const rgbquad_t srcrb = src & 0xFF00FF; - const rgbquad_t srcg = src & 0xFF00; + const rgbquad_t a = alpha; + const rgbquad_t a1 = 0xFF - alpha; - rgbquad_t drb = srcrb - dstrb; - rgbquad_t dg = srcg - dstg; - - alpha += 1; - - drb *= alpha; - dg *= alpha; - drb >>= 8; - dg >>= 8; - - return ((drb + dstrb) & 0xFF00FF) | ((dg + dstg) & 0xFF00); + return MAKE_QUAD( + (rgbquad_t)((QUAD_RED(src) * a + QUAD_RED(dst) * a1) / 0xFF), + (rgbquad_t)((QUAD_GREEN(src) * a + QUAD_GREEN(dst) * a1) / 0xFF), + (rgbquad_t)((QUAD_BLUE(src) * a + QUAD_BLUE(dst) * a1) / 0xFF), + 0); } /* scales rgb quad by alpha. basically similar to what's above. src alpha is retained. diff --git a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c index bac88dc1166..3c2d0fac23e 100644 --- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c +++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ static const char szNetscape20ext[11] = "NETSCAPE2.0"; #define NSEXT_LOOP 0x01 // Loop Count field code // convert libungif samples to our ones -#define MAKE_QUAD_GIF(c,a) MAKE_QUAD((c).Red, (c).Green, (c).Blue, (a)) +#define MAKE_QUAD_GIF(c,a) MAKE_QUAD((c).Red, (c).Green, (c).Blue, (unsigned)(a)) /* stdio FILE* and memory input functions for libungif */ int @@ -165,7 +165,7 @@ SplashDecodeGif(Splash * splash, GifFileType * gif) { int flag = pExtension[0]; - frameDelay = (pExtension[2] << 8) | pExtension[1]; + frameDelay = (((int)pExtension[2]) << 8) | pExtension[1]; if (frameDelay < 10) frameDelay = 10; if (flag & GIF_TRANSPARENT) { @@ -191,7 +191,7 @@ SplashDecodeGif(Splash * splash, GifFileType * gif) iSubCode = pExtension[0] & 0x07; if (iSubCode == NSEXT_LOOP) { splash->loopCount = - (pExtension[1] | (pExtension[2] << 8)) - 1; + (pExtension[1] | (((int)pExtension[2]) << 8)) - 1; } } break; @@ -277,7 +277,7 @@ SplashDecodeGif(Splash * splash, GifFileType * gif) ImageRect dstRect; rgbquad_t fillColor = 0; // 0 is transparent - if (transparentColor > 0) { + if (transparentColor < 0) { fillColor= MAKE_QUAD_GIF( colorMap->Colors[gif->SBackGroundColor], 0xff); } diff --git a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c index 7a814d215f5..156fcdfa5fc 100644 --- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c +++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/font/AccelGlyphCache.c b/jdk/src/share/native/sun/font/AccelGlyphCache.c index f6e34c755ea..bc4416f1ec1 100644 --- a/jdk/src/share/native/sun/font/AccelGlyphCache.c +++ b/jdk/src/share/native/sun/font/AccelGlyphCache.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/font/fontscalerdefs.h b/jdk/src/share/native/sun/font/fontscalerdefs.h index 9b5ad7fe468..4e1bb99e9c3 100644 --- a/jdk/src/share/native/sun/font/fontscalerdefs.h +++ b/jdk/src/share/native/sun/font/fontscalerdefs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/font/freetypeScaler.c b/jdk/src/share/native/sun/font/freetypeScaler.c index c132a4a5a2c..97744125c5f 100644 --- a/jdk/src/share/native/sun/font/freetypeScaler.c +++ b/jdk/src/share/native/sun/font/freetypeScaler.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/font/layout/ArabicLayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.cpp index 325ca9dab05..807a072410c 100644 --- a/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.cpp +++ b/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.cpp @@ -59,16 +59,16 @@ le_bool CharSubstitutionFilter::accept(LEGlyphID glyph) const UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ArabicOpenTypeLayoutEngine) ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) - : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable) + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success) + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success) { fFeatureMap = ArabicShaping::getFeatureMap(fFeatureMapCount); fFeatureOrder = TRUE; } ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags) - : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags) + le_int32 typoFlags, LEErrorCode &success) + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success) { fFeatureMap = ArabicShaping::getFeatureMap(fFeatureMapCount); @@ -151,8 +151,8 @@ void ArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], l } } -UnicodeArabicOpenTypeLayoutEngine::UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) - : ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags) +UnicodeArabicOpenTypeLayoutEngine::UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, LEErrorCode &success) + : ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success) { fGSUBTable = (const GlyphSubstitutionTableHeader *) CanonShaping::glyphSubstitutionTable; fGDEFTable = (const GlyphDefinitionTableHeader *) CanonShaping::glyphDefinitionTable; diff --git a/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.h b/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.h index cb2baf19c1b..956b3d50f8c 100644 --- a/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.h +++ b/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.h @@ -66,6 +66,7 @@ public: * @param scriptCode - the script * @param langaugeCode - the language * @param gsubTable - the GSUB table + * @param success - set to an error code if the operation fails * * @see LayoutEngine::layoutEngineFactory * @see OpenTypeLayoutEngine @@ -74,7 +75,7 @@ public: * @internal */ ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success); /** * This constructor is used when the font requires a "canned" GSUB table which can't be known @@ -83,6 +84,7 @@ public: * @param fontInstance - the font * @param scriptCode - the script * @param langaugeCode - the language + * @param success - set to an error code if the operation fails * * @see OpenTypeLayoutEngine * @see ScriptAndLanguageTags.h for script and language codes @@ -90,7 +92,7 @@ public: * @internal */ ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags); + le_int32 typoFlags, LEErrorCode &success); /** * The destructor, virtual for correct polymorphic invocation. @@ -184,6 +186,7 @@ public: * @param fontInstance - the font * @param scriptCode - the script * @param languageCode - the language + * @param success - set to an error code if the operation fails * * @see LEFontInstance * @see ScriptAndLanguageTags.h for script and language codes @@ -191,7 +194,7 @@ public: * @internal */ UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags); + le_int32 typoFlags, LEErrorCode &success); /** * The destructor, virtual for correct polymorphic invocation. diff --git a/jdk/src/share/native/sun/font/layout/ArabicShaping.cpp b/jdk/src/share/native/sun/font/layout/ArabicShaping.cpp index c177cc8eac2..7c91f4f9721 100644 --- a/jdk/src/share/native/sun/font/layout/ArabicShaping.cpp +++ b/jdk/src/share/native/sun/font/layout/ArabicShaping.cpp @@ -104,6 +104,7 @@ ArabicShaping::ShapeType ArabicShaping::getShapeType(LEUnicode c) #define markFeatureMask 0x00040000UL #define mkmkFeatureMask 0x00020000UL +#define NO_FEATURES 0 #define ISOL_FEATURES (isolFeatureMask | ligaFeatureMask | msetFeatureMask | markFeatureMask | ccmpFeatureMask | rligFeatureMask | caltFeatureMask | dligFeatureMask | cswhFeatureMask | cursFeatureMask | kernFeatureMask | mkmkFeatureMask) #define SHAPE_MASK 0xF0000000UL @@ -198,7 +199,11 @@ void ArabicShaping::shape(const LEUnicode *chars, le_int32 offset, le_int32 char LEUnicode c = chars[in]; ShapeType t = getShapeType(c); + if (t == ST_NOSHAPE_NONE) { + glyphStorage.setAuxData(out, NO_FEATURES, success); + } else { glyphStorage.setAuxData(out, ISOL_FEATURES, success); + } if ((t & MASK_TRANSPARENT) != 0) { continue; diff --git a/jdk/src/share/native/sun/font/layout/CanonData.cpp b/jdk/src/share/native/sun/font/layout/CanonData.cpp index 7d1d1db2d6f..41d4bc213ae 100644 --- a/jdk/src/share/native/sun/font/layout/CanonData.cpp +++ b/jdk/src/share/native/sun/font/layout/CanonData.cpp @@ -30,7 +30,7 @@ * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS * YOU REALLY KNOW WHAT YOU'RE DOING. * - * Generated on: 03/31/2005 08:15:27 AM HST + * Generated on: 03/12/2008 03:14:34 PM HST */ #include "LETypes.h" @@ -39,36 +39,33 @@ U_NAMESPACE_BEGIN const le_uint8 CanonShaping::glyphSubstitutionTable[] = { - 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x01, 0x58, 0x02, 0x86, 0x00, 0x12, 0x61, 0x72, 0x61, 0x62, - 0x00, 0x6E, 0x62, 0x65, 0x6E, 0x67, 0x00, 0x82, 0x63, 0x79, 0x72, 0x6C, 0x00, 0x8E, 0x64, 0x65, - 0x76, 0x61, 0x00, 0x9A, 0x67, 0x72, 0x65, 0x6B, 0x00, 0xA6, 0x67, 0x75, 0x72, 0x75, 0x00, 0xB2, - 0x68, 0x65, 0x62, 0x72, 0x00, 0xBE, 0x68, 0x69, 0x72, 0x61, 0x00, 0xCA, 0x6B, 0x61, 0x6E, 0x61, - 0x00, 0xD6, 0x6B, 0x6E, 0x64, 0x61, 0x00, 0xE2, 0x6C, 0x61, 0x74, 0x6E, 0x00, 0xEE, 0x6D, 0x6C, - 0x79, 0x6D, 0x00, 0xFA, 0x6D, 0x79, 0x6D, 0x72, 0x01, 0x06, 0x6F, 0x72, 0x79, 0x61, 0x01, 0x12, - 0x73, 0x69, 0x6E, 0x68, 0x01, 0x1E, 0x74, 0x61, 0x6D, 0x6C, 0x01, 0x2A, 0x74, 0x65, 0x6C, 0x75, - 0x01, 0x36, 0x74, 0x69, 0x62, 0x74, 0x01, 0x42, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, - 0x00, 0x05, 0x00, 0x00, 0x00, 0x13, 0x00, 0x15, 0x00, 0x12, 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x01, 0x34, 0x02, 0x46, 0x00, 0x10, 0x61, 0x72, 0x61, 0x62, + 0x00, 0x62, 0x62, 0x61, 0x6C, 0x69, 0x00, 0x76, 0x62, 0x65, 0x6E, 0x67, 0x00, 0x82, 0x63, 0x79, + 0x72, 0x6C, 0x00, 0x8E, 0x64, 0x65, 0x76, 0x61, 0x00, 0x9A, 0x67, 0x72, 0x65, 0x6B, 0x00, 0xA6, + 0x68, 0x69, 0x72, 0x61, 0x00, 0xB2, 0x6B, 0x61, 0x6E, 0x61, 0x00, 0xBE, 0x6B, 0x6E, 0x64, 0x61, + 0x00, 0xCA, 0x6C, 0x61, 0x74, 0x6E, 0x00, 0xD6, 0x6D, 0x6C, 0x79, 0x6D, 0x00, 0xE2, 0x6D, 0x79, + 0x6D, 0x72, 0x00, 0xEE, 0x6F, 0x72, 0x79, 0x61, 0x00, 0xFA, 0x73, 0x69, 0x6E, 0x68, 0x01, 0x06, + 0x74, 0x61, 0x6D, 0x6C, 0x01, 0x12, 0x74, 0x65, 0x6C, 0x75, 0x01, 0x1E, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0x00, 0x13, 0x00, 0x10, 0x00, 0x12, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x0F, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x05, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, - 0x00, 0x01, 0x00, 0x06, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x07, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, - 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0x00, 0x01, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x06, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x0A, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x0D, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, - 0x00, 0x01, 0x00, 0x0E, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x0F, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, - 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x11, 0x00, 0x16, 0x63, 0x63, 0x6D, 0x70, 0x00, 0x86, - 0x63, 0x63, 0x6D, 0x70, 0x00, 0x8E, 0x63, 0x63, 0x6D, 0x70, 0x00, 0x96, 0x63, 0x63, 0x6D, 0x70, - 0x00, 0x9E, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xA6, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xAE, 0x63, 0x63, - 0x6D, 0x70, 0x00, 0xB6, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xBE, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xC6, - 0x63, 0x63, 0x6D, 0x70, 0x00, 0xCE, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xD6, 0x63, 0x63, 0x6D, 0x70, - 0x00, 0xDE, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xE6, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xEE, 0x63, 0x63, - 0x6D, 0x70, 0x00, 0xF6, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xFE, 0x63, 0x63, 0x6D, 0x70, 0x01, 0x06, - 0x63, 0x63, 0x6D, 0x70, 0x01, 0x0E, 0x66, 0x69, 0x6E, 0x61, 0x01, 0x16, 0x69, 0x6E, 0x69, 0x74, - 0x01, 0x1C, 0x6C, 0x69, 0x67, 0x61, 0x01, 0x22, 0x6D, 0x65, 0x64, 0x69, 0x01, 0x28, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x0E, 0x00, 0x14, 0x63, 0x63, 0x6D, 0x70, 0x00, 0x7A, 0x63, 0x63, 0x6D, 0x70, + 0x00, 0x82, 0x63, 0x63, 0x6D, 0x70, 0x00, 0x8A, 0x63, 0x63, 0x6D, 0x70, 0x00, 0x92, 0x63, 0x63, + 0x6D, 0x70, 0x00, 0x9A, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xA2, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xAA, + 0x63, 0x63, 0x6D, 0x70, 0x00, 0xB2, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xBA, 0x63, 0x63, 0x6D, 0x70, + 0x00, 0xC2, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xCA, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xD2, 0x63, 0x63, + 0x6D, 0x70, 0x00, 0xDA, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xE2, 0x63, 0x63, 0x6D, 0x70, 0x00, 0xEA, + 0x63, 0x63, 0x6D, 0x70, 0x00, 0xF2, 0x66, 0x69, 0x6E, 0x61, 0x00, 0xFA, 0x69, 0x6E, 0x69, 0x74, + 0x01, 0x00, 0x6C, 0x69, 0x67, 0x61, 0x01, 0x06, 0x6D, 0x65, 0x64, 0x69, 0x01, 0x0C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x09, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0C, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0E, 0x00, 0x0F, 0x00, 0x00, @@ -77,355 +74,349 @@ const le_uint8 CanonShaping::glyphSubstitutionTable[] = { 0x00, 0x02, 0x00, 0x18, 0x00, 0x19, 0x00, 0x00, 0x00, 0x02, 0x00, 0x1A, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x02, 0x00, 0x1C, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x02, 0x00, 0x1E, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x22, 0x00, 0x23, 0x00, 0x00, - 0x00, 0x02, 0x00, 0x24, 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00, 0x26, 0x00, 0x27, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x28, 0x00, 0x52, 0x00, 0xC8, 0x01, 0x2A, 0x01, 0xF4, - 0x02, 0xBE, 0x03, 0xF8, 0x15, 0x06, 0x15, 0x58, 0x15, 0x9C, 0x18, 0x4E, 0x1A, 0xC4, 0x1B, 0x70, - 0x1B, 0xF0, 0x4F, 0xEA, 0x8E, 0xAE, 0x8F, 0x14, 0x8F, 0x62, 0x91, 0x58, 0x93, 0x26, 0x94, 0x94, - 0x95, 0xB4, 0x96, 0x0A, 0x96, 0x66, 0x98, 0x0C, 0x99, 0x54, 0xB9, 0x0C, 0xDC, 0x92, 0xDC, 0xC8, - 0xDC, 0xF8, 0xDD, 0x18, 0xDD, 0x34, 0xDD, 0x80, 0xDD, 0xC4, 0xDE, 0x0C, 0xDE, 0x5E, 0xDE, 0xA2, - 0xDE, 0xDC, 0xDE, 0xFC, 0xDF, 0x18, 0xE0, 0x36, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, - 0x00, 0x01, 0x00, 0x5E, 0x00, 0x06, 0x00, 0x12, 0x00, 0x2C, 0x00, 0x36, 0x00, 0x40, 0x00, 0x4A, - 0x00, 0x54, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, 0x06, 0x22, 0x00, 0x02, 0x06, 0x53, - 0x06, 0x23, 0x00, 0x02, 0x06, 0x54, 0x06, 0x25, 0x00, 0x02, 0x06, 0x55, 0x00, 0x01, 0x00, 0x04, - 0x06, 0x24, 0x00, 0x02, 0x06, 0x54, 0x00, 0x01, 0x00, 0x04, 0x06, 0x26, 0x00, 0x02, 0x06, 0x54, - 0x00, 0x01, 0x00, 0x04, 0x06, 0xC2, 0x00, 0x02, 0x06, 0x54, 0x00, 0x01, 0x00, 0x04, 0x06, 0xD3, - 0x00, 0x02, 0x06, 0x54, 0x00, 0x01, 0x00, 0x04, 0x06, 0xC0, 0x00, 0x02, 0x06, 0x54, 0x00, 0x01, - 0x00, 0x06, 0x06, 0x27, 0x06, 0x48, 0x06, 0x4A, 0x06, 0xC1, 0x06, 0xD2, 0x06, 0xD5, 0x00, 0x02, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x46, 0x00, 0x08, 0x00, 0x16, 0x00, 0x1C, - 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x00, 0x3A, 0x00, 0x40, 0x00, 0x02, 0x06, 0x27, - 0x06, 0x53, 0x00, 0x02, 0x06, 0x27, 0x06, 0x54, 0x00, 0x02, 0x06, 0x48, 0x06, 0x54, 0x00, 0x02, - 0x06, 0x27, 0x06, 0x55, 0x00, 0x02, 0x06, 0x4A, 0x06, 0x54, 0x00, 0x02, 0x06, 0xD5, 0x06, 0x54, - 0x00, 0x02, 0x06, 0xC1, 0x06, 0x54, 0x00, 0x02, 0x06, 0xD2, 0x06, 0x54, 0x00, 0x01, 0x00, 0x08, - 0x06, 0x22, 0x06, 0x23, 0x06, 0x24, 0x06, 0x25, 0x06, 0x26, 0x06, 0xC0, 0x06, 0xC2, 0x06, 0xD3, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x02, 0x00, 0x62, 0x00, 0x2E, 0xFE, 0x8B, - 0xFE, 0x91, 0xFE, 0x97, 0xFE, 0x9B, 0xFE, 0x9F, 0xFE, 0xA3, 0xFE, 0xA7, 0xFE, 0xB3, 0xFE, 0xB7, - 0xFE, 0xBB, 0xFE, 0xBF, 0xFE, 0xC3, 0xFE, 0xC7, 0xFE, 0xCB, 0xFE, 0xCF, 0xFE, 0xD3, 0xFE, 0xD7, - 0xFE, 0xDB, 0xFE, 0xDF, 0xFE, 0xE3, 0xFE, 0xE7, 0xFE, 0xEB, 0xFB, 0xE8, 0xFE, 0xF3, 0xFB, 0x68, - 0xFB, 0x60, 0xFB, 0x54, 0xFB, 0x58, 0xFB, 0x64, 0xFB, 0x5C, 0xFB, 0x78, 0xFB, 0x74, 0xFB, 0x7C, - 0xFB, 0x80, 0xFB, 0x6C, 0xFB, 0x70, 0xFB, 0x90, 0xFB, 0xD5, 0xFB, 0x94, 0xFB, 0x9C, 0xFB, 0x98, - 0xFB, 0xA2, 0xFB, 0xAC, 0xFB, 0xA8, 0xFB, 0xFE, 0xFB, 0xE6, 0x00, 0x01, 0x00, 0x2E, 0x06, 0x26, - 0x06, 0x28, 0x06, 0x2A, 0x06, 0x2B, 0x06, 0x2C, 0x06, 0x2D, 0x06, 0x2E, 0x06, 0x33, 0x06, 0x34, - 0x06, 0x35, 0x06, 0x36, 0x06, 0x37, 0x06, 0x38, 0x06, 0x39, 0x06, 0x3A, 0x06, 0x41, 0x06, 0x42, - 0x06, 0x43, 0x06, 0x44, 0x06, 0x45, 0x06, 0x46, 0x06, 0x47, 0x06, 0x49, 0x06, 0x4A, 0x06, 0x79, - 0x06, 0x7A, 0x06, 0x7B, 0x06, 0x7E, 0x06, 0x7F, 0x06, 0x80, 0x06, 0x83, 0x06, 0x84, 0x06, 0x86, - 0x06, 0x87, 0x06, 0xA4, 0x06, 0xA6, 0x06, 0xA9, 0x06, 0xAD, 0x06, 0xAF, 0x06, 0xB1, 0x06, 0xB3, - 0x06, 0xBB, 0x06, 0xBE, 0x06, 0xC1, 0x06, 0xCC, 0x06, 0xD0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x08, 0x00, 0x02, 0x00, 0x62, 0x00, 0x2E, 0xFE, 0x8C, 0xFE, 0x92, 0xFE, 0x98, 0xFE, 0x9C, - 0xFE, 0xA0, 0xFE, 0xA4, 0xFE, 0xA8, 0xFE, 0xB4, 0xFE, 0xB8, 0xFE, 0xBC, 0xFE, 0xC0, 0xFE, 0xC4, - 0xFE, 0xC8, 0xFE, 0xCC, 0xFE, 0xD0, 0xFE, 0xD4, 0xFE, 0xD8, 0xFE, 0xDC, 0xFE, 0xE0, 0xFE, 0xE4, - 0xFE, 0xE8, 0xFE, 0xEC, 0xFB, 0xE9, 0xFE, 0xF4, 0xFB, 0x69, 0xFB, 0x61, 0xFB, 0x55, 0xFB, 0x59, - 0xFB, 0x65, 0xFB, 0x5D, 0xFB, 0x79, 0xFB, 0x75, 0xFB, 0x7D, 0xFB, 0x81, 0xFB, 0x6D, 0xFB, 0x71, - 0xFB, 0x91, 0xFB, 0xD6, 0xFB, 0x95, 0xFB, 0x9D, 0xFB, 0x99, 0xFB, 0xA3, 0xFB, 0xAD, 0xFB, 0xA9, - 0xFB, 0xFF, 0xFB, 0xE7, 0x00, 0x01, 0x00, 0x2E, 0x06, 0x26, 0x06, 0x28, 0x06, 0x2A, 0x06, 0x2B, - 0x06, 0x2C, 0x06, 0x2D, 0x06, 0x2E, 0x06, 0x33, 0x06, 0x34, 0x06, 0x35, 0x06, 0x36, 0x06, 0x37, - 0x06, 0x38, 0x06, 0x39, 0x06, 0x3A, 0x06, 0x41, 0x06, 0x42, 0x06, 0x43, 0x06, 0x44, 0x06, 0x45, - 0x06, 0x46, 0x06, 0x47, 0x06, 0x49, 0x06, 0x4A, 0x06, 0x79, 0x06, 0x7A, 0x06, 0x7B, 0x06, 0x7E, - 0x06, 0x7F, 0x06, 0x80, 0x06, 0x83, 0x06, 0x84, 0x06, 0x86, 0x06, 0x87, 0x06, 0xA4, 0x06, 0xA6, - 0x06, 0xA9, 0x06, 0xAD, 0x06, 0xAF, 0x06, 0xB1, 0x06, 0xB3, 0x06, 0xBB, 0x06, 0xBE, 0x06, 0xC1, - 0x06, 0xCC, 0x06, 0xD0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x02, 0x00, 0x9A, - 0x00, 0x4A, 0xFE, 0x82, 0xFE, 0x84, 0xFE, 0x86, 0xFE, 0x88, 0xFE, 0x8A, 0xFE, 0x8E, 0xFE, 0x90, - 0xFE, 0x94, 0xFE, 0x96, 0xFE, 0x9A, 0xFE, 0x9E, 0xFE, 0xA2, 0xFE, 0xA6, 0xFE, 0xAA, 0xFE, 0xAC, - 0xFE, 0xAE, 0xFE, 0xB0, 0xFE, 0xB2, 0xFE, 0xB6, 0xFE, 0xBA, 0xFE, 0xBE, 0xFE, 0xC2, 0xFE, 0xC6, - 0xFE, 0xCA, 0xFE, 0xCE, 0xFE, 0xD2, 0xFE, 0xD6, 0xFE, 0xDA, 0xFE, 0xDE, 0xFE, 0xE2, 0xFE, 0xE6, - 0xFE, 0xEA, 0xFE, 0xEE, 0xFE, 0xF0, 0xFE, 0xF2, 0xFB, 0x51, 0xFB, 0x67, 0xFB, 0x5F, 0xFB, 0x53, - 0xFB, 0x57, 0xFB, 0x63, 0xFB, 0x5B, 0xFB, 0x77, 0xFB, 0x73, 0xFB, 0x7B, 0xFB, 0x7F, 0xFB, 0x89, - 0xFB, 0x85, 0xFB, 0x83, 0xFB, 0x87, 0xFB, 0x8D, 0xFB, 0x8B, 0xFB, 0x6B, 0xFB, 0x6F, 0xFB, 0x8F, - 0xFB, 0xD4, 0xFB, 0x93, 0xFB, 0x9B, 0xFB, 0x97, 0xFB, 0x9F, 0xFB, 0xA1, 0xFB, 0xAB, 0xFB, 0xA5, - 0xFB, 0xA7, 0xFB, 0xE1, 0xFB, 0xDA, 0xFB, 0xD8, 0xFB, 0xDC, 0xFB, 0xE3, 0xFB, 0xDF, 0xFB, 0xFD, - 0xFB, 0xE5, 0xFB, 0xAF, 0xFB, 0xB1, 0x00, 0x01, 0x00, 0x4A, 0x06, 0x22, 0x06, 0x23, 0x06, 0x24, - 0x06, 0x25, 0x06, 0x26, 0x06, 0x27, 0x06, 0x28, 0x06, 0x29, 0x06, 0x2A, 0x06, 0x2B, 0x06, 0x2C, - 0x06, 0x2D, 0x06, 0x2E, 0x06, 0x2F, 0x06, 0x30, 0x06, 0x31, 0x06, 0x32, 0x06, 0x33, 0x06, 0x34, - 0x06, 0x35, 0x06, 0x36, 0x06, 0x37, 0x06, 0x38, 0x06, 0x39, 0x06, 0x3A, 0x06, 0x41, 0x06, 0x42, - 0x06, 0x43, 0x06, 0x44, 0x06, 0x45, 0x06, 0x46, 0x06, 0x47, 0x06, 0x48, 0x06, 0x49, 0x06, 0x4A, - 0x06, 0x71, 0x06, 0x79, 0x06, 0x7A, 0x06, 0x7B, 0x06, 0x7E, 0x06, 0x7F, 0x06, 0x80, 0x06, 0x83, - 0x06, 0x84, 0x06, 0x86, 0x06, 0x87, 0x06, 0x88, 0x06, 0x8C, 0x06, 0x8D, 0x06, 0x8E, 0x06, 0x91, - 0x06, 0x98, 0x06, 0xA4, 0x06, 0xA6, 0x06, 0xA9, 0x06, 0xAD, 0x06, 0xAF, 0x06, 0xB1, 0x06, 0xB3, - 0x06, 0xBA, 0x06, 0xBB, 0x06, 0xBE, 0x06, 0xC0, 0x06, 0xC1, 0x06, 0xC5, 0x06, 0xC6, 0x06, 0xC7, - 0x06, 0xC8, 0x06, 0xC9, 0x06, 0xCB, 0x06, 0xCC, 0x06, 0xD0, 0x06, 0xD2, 0x06, 0xD3, 0x00, 0x04, - 0x00, 0x08, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x10, 0x98, 0x00, 0x35, 0x00, 0x70, 0x00, 0x7A, - 0x01, 0x0C, 0x01, 0x86, 0x01, 0xA8, 0x01, 0xB2, 0x02, 0x0C, 0x02, 0x62, 0x03, 0x02, 0x03, 0x8A, - 0x03, 0xB4, 0x03, 0xF6, 0x04, 0x46, 0x04, 0x8A, 0x04, 0xBC, 0x04, 0xEC, 0x05, 0x26, 0x05, 0x38, - 0x05, 0x42, 0x05, 0x64, 0x05, 0xF8, 0x06, 0x6C, 0x06, 0xEC, 0x07, 0x80, 0x08, 0x1E, 0x08, 0x56, - 0x08, 0xBA, 0x08, 0xF2, 0x09, 0x38, 0x09, 0x66, 0x09, 0x78, 0x09, 0x82, 0x09, 0xD4, 0x0A, 0x0E, - 0x0A, 0x40, 0x0A, 0x70, 0x0A, 0xCC, 0x0A, 0xF2, 0x0B, 0x38, 0x0B, 0x68, 0x0B, 0xDC, 0x0C, 0x2A, - 0x0C, 0xD6, 0x0D, 0x72, 0x0E, 0x16, 0x0E, 0x50, 0x0E, 0xC8, 0x0F, 0x5A, 0x0F, 0xA8, 0x0F, 0xB6, - 0x0F, 0xC0, 0x0F, 0xCA, 0x10, 0x2E, 0x00, 0x01, 0x00, 0x04, 0xFB, 0xDD, 0x00, 0x02, 0x06, 0x74, - 0x00, 0x12, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x44, 0x00, 0x4A, - 0x00, 0x50, 0x00, 0x56, 0x00, 0x5C, 0x00, 0x62, 0x00, 0x68, 0x00, 0x6E, 0x00, 0x74, 0x00, 0x7A, - 0x00, 0x80, 0x00, 0x86, 0x00, 0x8C, 0xFB, 0xEC, 0x00, 0x02, 0x00, 0x01, 0xFB, 0xF0, 0x00, 0x02, - 0xFB, 0xD8, 0xFB, 0xF2, 0x00, 0x02, 0xFB, 0xDA, 0xFB, 0xF4, 0x00, 0x02, 0xFB, 0xDC, 0xFB, 0xF6, - 0x00, 0x02, 0xFB, 0xE5, 0xFB, 0xF8, 0x00, 0x02, 0xFB, 0xE7, 0xFB, 0xEA, 0x00, 0x02, 0xFE, 0x8E, - 0xFC, 0x00, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0x97, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x01, 0x00, 0x02, - 0xFE, 0xA2, 0xFC, 0x98, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x99, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x02, - 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0x9A, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x9B, 0x00, 0x02, 0xFE, 0xEC, - 0xFB, 0xEE, 0x00, 0x02, 0xFE, 0xEE, 0xFB, 0xF9, 0x00, 0x02, 0xFE, 0xF0, 0xFB, 0xFB, 0x00, 0x02, - 0xFE, 0xF2, 0x00, 0x0F, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, - 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, 0x00, 0x56, 0x00, 0x5C, 0x00, 0x62, 0x00, 0x68, 0x00, 0x6E, - 0x00, 0x74, 0xFB, 0xED, 0x00, 0x02, 0x00, 0x01, 0xFB, 0xF1, 0x00, 0x02, 0xFB, 0xD8, 0xFB, 0xF3, - 0x00, 0x02, 0xFB, 0xDA, 0xFB, 0xF5, 0x00, 0x02, 0xFB, 0xDC, 0xFB, 0xF7, 0x00, 0x02, 0xFB, 0xE5, - 0xFB, 0xEB, 0x00, 0x02, 0xFE, 0x8E, 0xFC, 0x64, 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x65, 0x00, 0x02, - 0xFE, 0xB0, 0xFC, 0x66, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xDF, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x67, - 0x00, 0x02, 0xFE, 0xE6, 0xFC, 0xE0, 0x00, 0x02, 0xFE, 0xEC, 0xFB, 0xEF, 0x00, 0x02, 0xFE, 0xEE, - 0xFB, 0xFA, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x69, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x03, 0x00, 0x08, - 0x00, 0x0E, 0x00, 0x18, 0xFD, 0x3D, 0x00, 0x02, 0x06, 0x4B, 0xFD, 0xF3, 0x00, 0x04, 0xFE, 0xDB, - 0xFE, 0x92, 0xFE, 0xAE, 0xFD, 0xF2, 0x00, 0x04, 0xFE, 0xDF, 0xFE, 0xE0, 0xFE, 0xEA, 0x00, 0x01, - 0x00, 0x04, 0xFD, 0x3C, 0x00, 0x02, 0x06, 0x4B, 0x00, 0x0B, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, - 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0x00, 0x4E, 0x00, 0x54, - 0xFC, 0x05, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0x9C, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x06, 0x00, 0x02, - 0xFE, 0xA2, 0xFC, 0x9D, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x07, 0x00, 0x02, 0xFE, 0xA6, 0xFC, 0x9E, - 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x08, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0x9F, 0x00, 0x02, 0xFE, 0xE4, - 0xFC, 0xA0, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x09, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x0A, 0x00, 0x02, - 0xFE, 0xF2, 0x00, 0x0A, 0x00, 0x16, 0x00, 0x1E, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, - 0x00, 0x3E, 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, 0xFD, 0xC2, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, - 0xFD, 0x9E, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xF2, 0xFC, 0x6A, 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x6B, - 0x00, 0x02, 0xFE, 0xB0, 0xFC, 0x6C, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xE1, 0x00, 0x02, 0xFE, 0xE4, - 0xFC, 0x6D, 0x00, 0x02, 0xFE, 0xE6, 0xFC, 0xE2, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x6E, 0x00, 0x02, - 0xFE, 0xF0, 0xFC, 0x6F, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x12, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x34, - 0x00, 0x3A, 0x00, 0x40, 0x00, 0x48, 0x00, 0x50, 0x00, 0x56, 0x00, 0x5C, 0x00, 0x64, 0x00, 0x6A, - 0x00, 0x70, 0x00, 0x78, 0x00, 0x80, 0x00, 0x88, 0x00, 0x8E, 0x00, 0x94, 0x00, 0x9A, 0xFC, 0x0B, - 0x00, 0x02, 0xFE, 0x9E, 0xFD, 0x50, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xE4, 0xFC, 0xA1, 0x00, 0x02, - 0xFE, 0xA0, 0xFC, 0x0C, 0x00, 0x02, 0xFE, 0xA2, 0xFD, 0x52, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xA0, - 0xFD, 0x53, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xE4, 0xFC, 0xA2, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x0D, - 0x00, 0x02, 0xFE, 0xA6, 0xFD, 0x54, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xE4, 0xFC, 0xA3, 0x00, 0x02, - 0xFE, 0xA8, 0xFC, 0x0E, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x55, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA0, - 0xFD, 0x56, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA4, 0xFD, 0x57, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA8, - 0xFC, 0xA4, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xA5, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x0F, 0x00, 0x02, - 0xFE, 0xF0, 0xFC, 0x10, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0F, 0x00, 0x20, 0x00, 0x28, 0x00, 0x30, - 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0x00, 0x4E, 0x00, 0x54, 0x00, 0x5A, 0x00, 0x62, 0x00, 0x6A, - 0x00, 0x70, 0x00, 0x76, 0x00, 0x7C, 0x00, 0x82, 0xFD, 0xA0, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF0, - 0xFD, 0x9F, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, 0xFD, 0x51, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0x9E, - 0xFD, 0xA2, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xF0, 0xFD, 0xA1, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xF2, - 0xFC, 0x70, 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x71, 0x00, 0x02, 0xFE, 0xB0, 0xFC, 0x72, 0x00, 0x02, - 0xFE, 0xE2, 0xFD, 0xA4, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF0, 0xFD, 0xA3, 0x00, 0x03, 0xFE, 0xE4, - 0xFE, 0xF2, 0xFC, 0xE3, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x73, 0x00, 0x02, 0xFE, 0xE6, 0xFC, 0xE4, - 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x74, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x75, 0x00, 0x02, 0xFE, 0xF2, - 0x00, 0x05, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0xFC, 0x11, 0x00, 0x02, - 0xFE, 0x9E, 0xFC, 0x12, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xA6, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x13, - 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x14, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, - 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0xFC, 0x76, 0x00, 0x02, - 0xFE, 0xAE, 0xFC, 0x77, 0x00, 0x02, 0xFE, 0xB0, 0xFC, 0x78, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xE5, - 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x79, 0x00, 0x02, 0xFE, 0xE6, 0xFC, 0xE6, 0x00, 0x02, 0xFE, 0xEC, - 0xFC, 0x7A, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x7B, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x08, 0x00, 0x12, - 0x00, 0x18, 0x00, 0x1E, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3E, 0x00, 0x44, 0x00, 0x4A, 0xFC, 0x15, - 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0xA7, 0x00, 0x02, 0xFE, 0xA4, 0xFD, 0xFB, 0x00, 0x08, 0xFE, 0xDE, - 0x00, 0x20, 0xFE, 0x9F, 0xFE, 0xE0, 0xFE, 0x8E, 0xFE, 0xDF, 0xFE, 0xEA, 0xFC, 0x16, 0x00, 0x02, - 0xFE, 0xE2, 0xFD, 0x59, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA4, 0xFC, 0xA8, 0x00, 0x02, 0xFE, 0xE4, - 0xFD, 0x01, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x02, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x07, 0x00, 0x10, - 0x00, 0x18, 0x00, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, 0x00, 0x3E, 0xFD, 0xA6, 0x00, 0x03, - 0xFE, 0xA4, 0xFE, 0xF0, 0xFD, 0xBE, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, 0xFD, 0x58, 0x00, 0x03, - 0xFE, 0xE4, 0xFE, 0xA2, 0xFD, 0xA7, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF0, 0xFD, 0xA5, 0x00, 0x03, - 0xFE, 0xE4, 0xFE, 0xF2, 0xFD, 0x1D, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x1E, 0x00, 0x02, 0xFE, 0xF2, - 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0xFC, 0x17, - 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0xA9, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x18, 0x00, 0x02, 0xFE, 0xE2, - 0xFC, 0xAA, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xFF, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x00, 0x00, 0x02, - 0xFE, 0xF2, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x14, 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2A, 0xFD, 0xBF, - 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, 0xFD, 0x5B, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF0, 0xFD, 0x5A, - 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFD, 0x1B, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x1C, 0x00, 0x02, - 0xFE, 0xF2, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, - 0x00, 0x34, 0xFC, 0x19, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0xAB, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x1A, - 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0x1B, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xAC, 0x00, 0x02, 0xFE, 0xE4, - 0xFD, 0x03, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x04, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x02, 0x00, 0x06, - 0x00, 0x0C, 0xFD, 0x1F, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x20, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x01, - 0x00, 0x04, 0xFC, 0x5B, 0x00, 0x02, 0x06, 0x70, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x18, - 0xFC, 0x5C, 0x00, 0x02, 0x06, 0x70, 0xFD, 0xFC, 0x00, 0x04, 0xFB, 0xFE, 0xFE, 0x8E, 0xFE, 0xDD, - 0xFD, 0xF6, 0x00, 0x04, 0xFE, 0xB3, 0xFE, 0xEE, 0xFE, 0xDD, 0x00, 0x11, 0x00, 0x24, 0x00, 0x2A, - 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, 0x00, 0x5E, - 0x00, 0x64, 0x00, 0x6C, 0x00, 0x74, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x88, 0x00, 0x8E, 0xFC, 0x1C, - 0x00, 0x02, 0xFE, 0x9E, 0xFD, 0x5D, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xA4, 0xFC, 0xAD, 0x00, 0x02, - 0xFE, 0xA0, 0xFC, 0x1D, 0x00, 0x02, 0xFE, 0xA2, 0xFD, 0x5C, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xA0, - 0xFC, 0xAE, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x1E, 0x00, 0x02, 0xFE, 0xA6, 0xFC, 0xAF, 0x00, 0x02, - 0xFE, 0xA8, 0xFD, 0x0E, 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x1F, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x61, - 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA0, 0xFD, 0x60, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA4, 0xFD, 0x63, - 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE4, 0xFC, 0xB0, 0x00, 0x02, 0xFE, 0xE4, 0xFD, 0x31, 0x00, 0x02, - 0xFE, 0xEC, 0xFC, 0xFB, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0xFC, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0D, - 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x38, 0x00, 0x40, 0x00, 0x46, 0x00, 0x4C, - 0x00, 0x54, 0x00, 0x5C, 0x00, 0x62, 0x00, 0x68, 0x00, 0x6E, 0xFD, 0x5E, 0x00, 0x03, 0xFE, 0xA0, - 0xFE, 0xF0, 0xFD, 0x34, 0x00, 0x02, 0xFE, 0xA0, 0xFD, 0x35, 0x00, 0x02, 0xFE, 0xA4, 0xFD, 0xA8, - 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xF0, 0xFD, 0xC6, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xF2, 0xFD, 0x36, - 0x00, 0x02, 0xFE, 0xA8, 0xFD, 0x2A, 0x00, 0x02, 0xFE, 0xAE, 0xFD, 0x5F, 0x00, 0x03, 0xFE, 0xE4, - 0xFE, 0xA2, 0xFD, 0x62, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, 0xFC, 0xE7, 0x00, 0x02, 0xFE, 0xE4, - 0xFC, 0xE8, 0x00, 0x02, 0xFE, 0xEC, 0xFD, 0x17, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x18, 0x00, 0x02, - 0xFE, 0xF2, 0x00, 0x0F, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x3A, 0x00, 0x40, - 0x00, 0x46, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, 0x00, 0x60, 0x00, 0x68, 0x00, 0x6E, 0x00, 0x74, - 0x00, 0x7A, 0xFD, 0x09, 0x00, 0x02, 0xFE, 0x9E, 0xFD, 0x2D, 0x00, 0x02, 0xFE, 0xA0, 0xFD, 0x0A, - 0x00, 0x02, 0xFE, 0xA2, 0xFD, 0x68, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xE4, 0xFD, 0x2E, 0x00, 0x02, - 0xFE, 0xA4, 0xFD, 0x0B, 0x00, 0x02, 0xFE, 0xA6, 0xFD, 0x2F, 0x00, 0x02, 0xFE, 0xA8, 0xFD, 0x0D, - 0x00, 0x02, 0xFE, 0xAE, 0xFD, 0x0C, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x6B, 0x00, 0x03, 0xFE, 0xE4, - 0xFE, 0xA8, 0xFD, 0x6D, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE4, 0xFD, 0x30, 0x00, 0x02, 0xFE, 0xE4, - 0xFD, 0x32, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0xFD, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0xFE, 0x00, 0x02, - 0xFE, 0xF2, 0x00, 0x11, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x46, - 0x00, 0x4E, 0x00, 0x54, 0x00, 0x5A, 0x00, 0x60, 0x00, 0x66, 0x00, 0x6C, 0x00, 0x74, 0x00, 0x7C, - 0x00, 0x82, 0x00, 0x88, 0x00, 0x8E, 0xFD, 0x25, 0x00, 0x02, 0xFE, 0x9E, 0xFD, 0x69, 0x00, 0x03, - 0xFE, 0xA0, 0xFE, 0xF2, 0xFD, 0x37, 0x00, 0x02, 0xFE, 0xA0, 0xFD, 0x26, 0x00, 0x02, 0xFE, 0xA2, - 0xFD, 0x67, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xE2, 0xFD, 0xAA, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, - 0xFD, 0x38, 0x00, 0x02, 0xFE, 0xA4, 0xFD, 0x27, 0x00, 0x02, 0xFE, 0xA6, 0xFD, 0x39, 0x00, 0x02, - 0xFE, 0xA8, 0xFD, 0x29, 0x00, 0x02, 0xFE, 0xAE, 0xFD, 0x28, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x6A, - 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA6, 0xFD, 0x6C, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, 0xFC, 0xE9, - 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xEA, 0x00, 0x02, 0xFE, 0xEC, 0xFD, 0x19, 0x00, 0x02, 0xFE, 0xF0, - 0xFD, 0x1A, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0E, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2C, 0x00, 0x32, - 0x00, 0x38, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x50, 0x00, 0x76, 0x00, 0x7E, 0x00, 0x84, 0x00, 0x8C, - 0x00, 0x92, 0x00, 0x98, 0xFC, 0x20, 0x00, 0x02, 0xFE, 0xA2, 0xFD, 0x65, 0x00, 0x03, 0xFE, 0xA4, - 0xFE, 0xA4, 0xFC, 0xB1, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0xB2, 0x00, 0x02, 0xFE, 0xA8, 0xFD, 0x0F, - 0x00, 0x02, 0xFE, 0xAE, 0xFD, 0xF0, 0x00, 0x03, 0xFE, 0xE0, 0xFB, 0xAF, 0xFD, 0xF5, 0x00, 0x04, - 0xFE, 0xE0, 0xFE, 0xCC, 0xFE, 0xE2, 0xFD, 0xFA, 0x00, 0x12, 0xFE, 0xE0, 0xFE, 0xF0, 0x00, 0x20, - 0xFE, 0x8D, 0xFE, 0xDF, 0xFE, 0xE0, 0xFE, 0xEA, 0x00, 0x20, 0xFE, 0xCB, 0xFE, 0xE0, 0xFE, 0xF4, - 0xFE, 0xEA, 0x00, 0x20, 0xFE, 0xED, 0xFE, 0xB3, 0xFE, 0xE0, 0xFE, 0xE2, 0xFD, 0xF9, 0x00, 0x03, - 0xFE, 0xE0, 0xFE, 0xF0, 0xFC, 0x21, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0xC5, 0x00, 0x03, 0xFE, 0xE4, - 0xFE, 0xE4, 0xFC, 0xB3, 0x00, 0x02, 0xFE, 0xE4, 0xFD, 0x05, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x06, - 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x16, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2C, - 0x00, 0x32, 0xFD, 0x64, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xA2, 0xFD, 0xA9, 0x00, 0x03, 0xFE, 0xA4, - 0xFE, 0xF2, 0xFD, 0x2B, 0x00, 0x02, 0xFE, 0xAE, 0xFD, 0x66, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, - 0xFD, 0x21, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x22, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0C, 0x00, 0x1A, - 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x40, 0x00, 0x46, 0x00, 0x4C, - 0x00, 0x52, 0x00, 0x58, 0x00, 0x5E, 0xFC, 0x22, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0xB4, 0x00, 0x02, - 0xFE, 0xA0, 0xFC, 0x23, 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0xB5, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x24, - 0x00, 0x02, 0xFE, 0xA6, 0xFD, 0x70, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xE4, 0xFC, 0xB6, 0x00, 0x02, - 0xFE, 0xA8, 0xFD, 0x10, 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x25, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xB7, - 0x00, 0x02, 0xFE, 0xE4, 0xFD, 0x07, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x08, 0x00, 0x02, 0xFE, 0xF2, - 0x00, 0x06, 0x00, 0x0E, 0x00, 0x16, 0x00, 0x1E, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0xFD, 0x6E, - 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF0, 0xFD, 0xAB, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, 0xFD, 0x6F, - 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xE2, 0xFD, 0x2C, 0x00, 0x02, 0xFE, 0xAE, 0xFD, 0x23, 0x00, 0x02, - 0xFE, 0xF0, 0xFD, 0x24, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, - 0x00, 0x24, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x3A, 0x00, 0x40, 0xFC, 0x26, 0x00, 0x02, 0xFE, 0xA2, - 0xFC, 0xB8, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x27, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x72, 0x00, 0x03, - 0xFE, 0xE4, 0xFE, 0xA4, 0xFD, 0x73, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE4, 0xFD, 0x33, 0x00, 0x02, - 0xFE, 0xE4, 0xFC, 0xF5, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0xF6, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x05, - 0x00, 0x0C, 0x00, 0x14, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0xFD, 0x71, 0x00, 0x03, 0xFE, 0xE4, - 0xFE, 0xA2, 0xFD, 0x74, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFD, 0x3A, 0x00, 0x02, 0xFE, 0xE4, - 0xFD, 0x11, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x12, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x02, 0x00, 0x06, - 0x00, 0x0C, 0xFC, 0x28, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xB9, 0x00, 0x02, 0xFE, 0xE4, 0x00, 0x01, - 0x00, 0x04, 0xFD, 0x3B, 0x00, 0x02, 0xFE, 0xE4, 0x00, 0x09, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x22, - 0x00, 0x28, 0x00, 0x32, 0x00, 0x38, 0x00, 0x40, 0x00, 0x46, 0x00, 0x4C, 0xFC, 0x29, 0x00, 0x02, - 0xFE, 0x9E, 0xFD, 0xC4, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xE4, 0xFC, 0xBA, 0x00, 0x02, 0xFE, 0xA0, - 0xFD, 0xF7, 0x00, 0x04, 0xFE, 0xE0, 0xFE, 0xF4, 0xFE, 0xEA, 0xFC, 0x2A, 0x00, 0x02, 0xFE, 0xE2, - 0xFD, 0x77, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE4, 0xFC, 0xBB, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xF7, - 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0xF8, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x16, - 0x00, 0x1E, 0x00, 0x26, 0x00, 0x2E, 0x00, 0x34, 0xFD, 0x75, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xE2, - 0xFD, 0x76, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, 0xFD, 0x78, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF0, - 0xFD, 0xB6, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFD, 0x13, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x14, - 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, - 0x00, 0x2C, 0xFC, 0x2B, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0xBC, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x2C, - 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xBD, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xF9, 0x00, 0x02, 0xFE, 0xF0, - 0xFC, 0xFA, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x14, 0x00, 0x1C, 0x00, 0x24, - 0x00, 0x2A, 0xFD, 0x79, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, 0xFD, 0x7B, 0x00, 0x03, 0xFE, 0xE4, - 0xFE, 0xF0, 0xFD, 0x7A, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFD, 0x15, 0x00, 0x02, 0xFE, 0xF0, - 0xFD, 0x16, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0B, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, - 0x00, 0x30, 0x00, 0x36, 0x00, 0x3E, 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, 0x00, 0x56, 0xFC, 0x2D, - 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0xBE, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x2E, 0x00, 0x02, 0xFE, 0xA2, - 0xFC, 0xBF, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x2F, 0x00, 0x02, 0xFE, 0xA6, 0xFD, 0x7D, 0x00, 0x03, - 0xFE, 0xA8, 0xFE, 0xE4, 0xFC, 0xC0, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x30, 0x00, 0x02, 0xFE, 0xE2, - 0xFC, 0xC1, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x31, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x32, 0x00, 0x02, - 0xFE, 0xF2, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x12, 0x00, 0x1A, 0x00, 0x20, 0xFD, 0x7C, 0x00, 0x03, - 0xFE, 0xA8, 0xFE, 0xE2, 0xFD, 0xC1, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFC, 0x7C, 0x00, 0x02, - 0xFE, 0xF0, 0xFC, 0x7D, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, - 0x00, 0x26, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x3A, 0x00, 0x40, 0xFC, 0x33, 0x00, 0x02, 0xFE, 0xA2, - 0xFC, 0xC2, 0x00, 0x02, 0xFE, 0xA4, 0xFD, 0xF1, 0x00, 0x03, 0xFE, 0xE0, 0xFB, 0xAF, 0xFC, 0x34, - 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0xB4, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA4, 0xFC, 0xC3, 0x00, 0x02, - 0xFE, 0xE4, 0xFC, 0x35, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x36, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x05, - 0x00, 0x0C, 0x00, 0x14, 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2A, 0xFD, 0x7E, 0x00, 0x03, 0xFE, 0xE4, - 0xFE, 0xA2, 0xFD, 0x7F, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, 0xFD, 0xB2, 0x00, 0x03, 0xFE, 0xE4, - 0xFE, 0xF2, 0xFC, 0x7E, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x7F, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0E, - 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, - 0x00, 0x4E, 0x00, 0x54, 0x00, 0x5A, 0x00, 0x62, 0x00, 0x68, 0x00, 0x6E, 0xFC, 0x37, 0x00, 0x02, - 0xFE, 0x8E, 0xFC, 0x38, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0xC4, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x39, - 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0xC5, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x3A, 0x00, 0x02, 0xFE, 0xA6, - 0xFC, 0xC6, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x3B, 0x00, 0x02, 0xFE, 0xDE, 0xFC, 0xC7, 0x00, 0x02, - 0xFE, 0xE0, 0xFC, 0x3C, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0xC3, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE4, - 0xFC, 0xC8, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x3D, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x3E, 0x00, 0x02, - 0xFE, 0xF2, 0x00, 0x09, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x34, - 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0xFC, 0x80, 0x00, 0x02, 0xFE, 0x8E, 0xFC, 0x81, 0x00, 0x02, - 0xFE, 0xDE, 0xFC, 0xEB, 0x00, 0x02, 0xFE, 0xE0, 0xFC, 0x82, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0xBB, - 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, 0xFD, 0xB7, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFC, 0xEC, - 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x83, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x84, 0x00, 0x02, 0xFE, 0xF2, - 0x00, 0x14, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, - 0x00, 0x58, 0x00, 0x5E, 0x00, 0x64, 0x00, 0x6C, 0x00, 0x72, 0x00, 0x78, 0x00, 0x80, 0x00, 0x86, - 0x00, 0x8C, 0x00, 0x94, 0x00, 0x9A, 0x00, 0xA0, 0x00, 0xA6, 0xFE, 0xF5, 0x00, 0x02, 0xFE, 0x82, - 0xFE, 0xF7, 0x00, 0x02, 0xFE, 0x84, 0xFE, 0xF9, 0x00, 0x02, 0xFE, 0x88, 0xFE, 0xFB, 0x00, 0x02, - 0xFE, 0x8E, 0xFC, 0x3F, 0x00, 0x02, 0xFE, 0x9E, 0xFD, 0x83, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xA0, - 0xFD, 0xBA, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xE4, 0xFC, 0xC9, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x40, - 0x00, 0x02, 0xFE, 0xA2, 0xFD, 0xB5, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xE4, 0xFC, 0xCA, 0x00, 0x02, - 0xFE, 0xA4, 0xFC, 0x41, 0x00, 0x02, 0xFE, 0xA6, 0xFD, 0x86, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xE4, - 0xFC, 0xCB, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x42, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x88, 0x00, 0x03, - 0xFE, 0xE4, 0xFE, 0xA4, 0xFC, 0xCC, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xCD, 0x00, 0x02, 0xFE, 0xEC, - 0xFC, 0x43, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x44, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x11, 0x00, 0x24, - 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x44, 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5C, - 0x00, 0x64, 0x00, 0x6C, 0x00, 0x74, 0x00, 0x7A, 0x00, 0x82, 0x00, 0x8A, 0x00, 0x90, 0x00, 0x96, - 0xFE, 0xF6, 0x00, 0x02, 0xFE, 0x82, 0xFE, 0xF8, 0x00, 0x02, 0xFE, 0x84, 0xFE, 0xFA, 0x00, 0x02, - 0xFE, 0x88, 0xFE, 0xFC, 0x00, 0x02, 0xFE, 0x8E, 0xFD, 0x84, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0x9E, - 0xFD, 0xBC, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xE2, 0xFD, 0xAC, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, - 0xFD, 0x80, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xE2, 0xFD, 0x82, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF0, - 0xFD, 0x81, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, 0xFD, 0x85, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xE2, - 0xFC, 0x85, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x87, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA2, 0xFD, 0xAD, - 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFC, 0xED, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x86, 0x00, 0x02, - 0xFE, 0xF0, 0xFC, 0x87, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x12, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x34, - 0x00, 0x3C, 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, 0x00, 0x58, 0x00, 0x62, 0x00, 0x6A, 0x00, 0x70, - 0x00, 0x76, 0x00, 0x7E, 0x00, 0x86, 0x00, 0x8C, 0x00, 0x92, 0x00, 0x98, 0x00, 0x9E, 0xFC, 0x45, - 0x00, 0x02, 0xFE, 0x9E, 0xFD, 0x8C, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xA4, 0xFD, 0x92, 0x00, 0x03, - 0xFE, 0xA0, 0xFE, 0xA8, 0xFD, 0x8D, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xE4, 0xFC, 0xCE, 0x00, 0x02, - 0xFE, 0xA0, 0xFC, 0x46, 0x00, 0x02, 0xFE, 0xA2, 0xFD, 0x89, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xA0, - 0xFD, 0xF4, 0x00, 0x04, 0xFE, 0xA4, 0xFE, 0xE4, 0xFE, 0xAA, 0xFD, 0x8A, 0x00, 0x03, 0xFE, 0xA4, - 0xFE, 0xE4, 0xFC, 0xCF, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x47, 0x00, 0x02, 0xFE, 0xA6, 0xFD, 0x8E, - 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xA0, 0xFD, 0x8F, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xE4, 0xFC, 0xD0, - 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x48, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xD1, 0x00, 0x02, 0xFE, 0xE4, - 0xFC, 0x49, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x4A, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x06, 0x00, 0x0E, - 0x00, 0x14, 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2C, 0x00, 0x32, 0xFC, 0x88, 0x00, 0x02, 0xFE, 0x8E, - 0xFD, 0xC0, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, 0xFD, 0x8B, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, - 0xFD, 0xB9, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xF2, 0xFC, 0x89, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0xB1, - 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0x00, 0x0E, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2C, 0x00, 0x34, - 0x00, 0x3A, 0x00, 0x40, 0x00, 0x48, 0x00, 0x4E, 0x00, 0x54, 0x00, 0x5A, 0x00, 0x60, 0x00, 0x66, - 0x00, 0x6C, 0x00, 0x72, 0xFC, 0x4B, 0x00, 0x02, 0xFE, 0x9E, 0xFD, 0xB8, 0x00, 0x03, 0xFE, 0xA0, - 0xFE, 0xA4, 0xFD, 0x98, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xE4, 0xFC, 0xD2, 0x00, 0x02, 0xFE, 0xA0, - 0xFC, 0x4C, 0x00, 0x02, 0xFE, 0xA2, 0xFD, 0x95, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xE4, 0xFC, 0xD3, - 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x4D, 0x00, 0x02, 0xFE, 0xA6, 0xFC, 0xD4, 0x00, 0x02, 0xFE, 0xA8, - 0xFC, 0x4E, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xD5, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xD6, 0x00, 0x02, - 0xFE, 0xEC, 0xFC, 0x4F, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x50, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x10, - 0x00, 0x22, 0x00, 0x2A, 0x00, 0x32, 0x00, 0x3A, 0x00, 0x42, 0x00, 0x4A, 0x00, 0x52, 0x00, 0x58, - 0x00, 0x5E, 0x00, 0x64, 0x00, 0x6C, 0x00, 0x74, 0x00, 0x7A, 0x00, 0x80, 0x00, 0x86, 0x00, 0x8C, - 0xFD, 0xBD, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xA2, 0xFD, 0x97, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xE2, - 0xFD, 0x99, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF0, 0xFD, 0xC7, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, - 0xFD, 0x96, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF0, 0xFD, 0xB3, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, - 0xFC, 0x8A, 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x8B, 0x00, 0x02, 0xFE, 0xB0, 0xFC, 0x8C, 0x00, 0x02, - 0xFE, 0xE2, 0xFD, 0x9B, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF0, 0xFD, 0x9A, 0x00, 0x03, 0xFE, 0xE4, - 0xFE, 0xF2, 0xFC, 0xEE, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x8D, 0x00, 0x02, 0xFE, 0xE6, 0xFC, 0xEF, - 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x8E, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x8F, 0x00, 0x02, 0xFE, 0xF2, - 0x00, 0x09, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x3C, - 0x00, 0x42, 0x00, 0x48, 0xFC, 0xD9, 0x00, 0x02, 0x06, 0x70, 0xFC, 0x51, 0x00, 0x02, 0xFE, 0x9E, - 0xFC, 0xD7, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x52, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x93, 0x00, 0x03, - 0xFE, 0xE4, 0xFE, 0xA0, 0xFD, 0x94, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE4, 0xFC, 0xD8, 0x00, 0x02, - 0xFE, 0xE4, 0xFC, 0x53, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x54, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x01, - 0x00, 0x04, 0xFD, 0xF8, 0x00, 0x04, 0xFE, 0xB3, 0xFE, 0xE0, 0xFE, 0xE2, 0x00, 0x01, 0x00, 0x04, - 0xFC, 0x5D, 0x00, 0x02, 0x06, 0x70, 0x00, 0x01, 0x00, 0x04, 0xFC, 0x90, 0x00, 0x02, 0x06, 0x70, - 0x00, 0x0C, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, - 0x00, 0x44, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, 0x00, 0x5E, 0xFC, 0x55, 0x00, 0x02, 0xFE, 0x9E, - 0xFC, 0xDA, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x56, 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0xDB, 0x00, 0x02, - 0xFE, 0xA4, 0xFC, 0x57, 0x00, 0x02, 0xFE, 0xA6, 0xFC, 0xDC, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x58, - 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x9D, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE4, 0xFC, 0xDD, 0x00, 0x02, - 0xFE, 0xE4, 0xFC, 0xDE, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x59, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x5A, - 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0C, 0x00, 0x1A, 0x00, 0x22, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, - 0x00, 0x3C, 0x00, 0x44, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, 0x00, 0x5E, 0x00, 0x64, 0xFD, 0xAF, - 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, 0xFD, 0xAE, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, 0xFC, 0x91, - 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x92, 0x00, 0x02, 0xFE, 0xB0, 0xFC, 0x93, 0x00, 0x02, 0xFE, 0xE2, - 0xFD, 0x9C, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, 0xFD, 0xB0, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, - 0xFC, 0xF0, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x94, 0x00, 0x02, 0xFE, 0xE6, 0xFC, 0xF1, 0x00, 0x02, - 0xFE, 0xEC, 0xFC, 0x95, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x96, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x01, - 0x00, 0x35, 0xFB, 0xD7, 0xFE, 0x8B, 0xFE, 0x8C, 0xFE, 0x8D, 0xFE, 0x8E, 0xFE, 0x91, 0xFE, 0x92, - 0xFE, 0x97, 0xFE, 0x98, 0xFE, 0x9B, 0xFE, 0x9C, 0xFE, 0x9F, 0xFE, 0xA0, 0xFE, 0xA3, 0xFE, 0xA4, - 0xFE, 0xA7, 0xFE, 0xA8, 0xFE, 0xAB, 0xFE, 0xAD, 0xFE, 0xB3, 0xFE, 0xB4, 0xFE, 0xB7, 0xFE, 0xB8, - 0xFE, 0xBB, 0xFE, 0xBC, 0xFE, 0xBF, 0xFE, 0xC0, 0xFE, 0xC3, 0xFE, 0xC4, 0xFE, 0xC7, 0xFE, 0xC8, - 0xFE, 0xCB, 0xFE, 0xCC, 0xFE, 0xCF, 0xFE, 0xD0, 0xFE, 0xD3, 0xFE, 0xD4, 0xFE, 0xD7, 0xFE, 0xD8, - 0xFE, 0xDB, 0xFE, 0xDC, 0xFE, 0xDF, 0xFE, 0xE0, 0xFE, 0xE3, 0xFE, 0xE4, 0xFE, 0xE7, 0xFE, 0xE8, - 0xFE, 0xEB, 0xFE, 0xED, 0xFE, 0xEF, 0xFE, 0xF0, 0xFE, 0xF3, 0xFE, 0xF4, 0x00, 0x04, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x3E, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x18, 0x00, 0x22, - 0x00, 0x2C, 0x00, 0x01, 0x00, 0x04, 0x09, 0xDC, 0x00, 0x02, 0x09, 0xBC, 0x00, 0x01, 0x00, 0x04, - 0x09, 0xDD, 0x00, 0x02, 0x09, 0xBC, 0x00, 0x01, 0x00, 0x04, 0x09, 0xDF, 0x00, 0x02, 0x09, 0xBC, - 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x09, 0xCB, 0x00, 0x02, 0x09, 0xBE, 0x09, 0xCC, 0x00, 0x02, - 0x09, 0xD7, 0x00, 0x01, 0x00, 0x04, 0x09, 0xA1, 0x09, 0xA2, 0x09, 0xAF, 0x09, 0xC7, 0x00, 0x02, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x2E, 0x00, 0x05, 0x00, 0x10, 0x00, 0x16, - 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x02, 0x09, 0xC7, 0x09, 0xBE, 0x00, 0x02, 0x09, 0xC7, - 0x09, 0xD7, 0x00, 0x02, 0x09, 0xA1, 0x09, 0xBC, 0x00, 0x02, 0x09, 0xA2, 0x09, 0xBC, 0x00, 0x02, - 0x09, 0xAF, 0x09, 0xBC, 0x00, 0x01, 0x00, 0x05, 0x09, 0xCB, 0x09, 0xCC, 0x09, 0xDC, 0x09, 0xDD, - 0x09, 0xDF, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x02, 0x66, 0x00, 0x20, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x24, 0x00, 0x4A, 0x00, 0xC0, 0x01, 0x22, 0x01, 0xEC, + 0x02, 0xB6, 0x03, 0xF0, 0x14, 0xFE, 0x15, 0x26, 0x15, 0x4C, 0x17, 0xFE, 0x1A, 0x74, 0x1A, 0xB0, + 0x1A, 0xE0, 0x4E, 0xDA, 0x8B, 0xBC, 0x8D, 0x2A, 0x8E, 0x4A, 0x8E, 0xA0, 0x8E, 0xFC, 0x90, 0xA2, + 0x91, 0xEA, 0xB1, 0xA2, 0xD5, 0x1E, 0xD5, 0x54, 0xD5, 0x84, 0xD5, 0xA4, 0xD5, 0xC0, 0xD5, 0xF0, + 0xD6, 0x20, 0xD6, 0x68, 0xD6, 0xBA, 0xD6, 0xFE, 0xD7, 0x38, 0xD7, 0x58, 0xD7, 0x74, 0xD8, 0x20, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x5E, 0x00, 0x06, 0x00, 0x12, + 0x00, 0x2C, 0x00, 0x36, 0x00, 0x40, 0x00, 0x4A, 0x00, 0x54, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, + 0x00, 0x14, 0x06, 0x22, 0x00, 0x02, 0x06, 0x53, 0x06, 0x23, 0x00, 0x02, 0x06, 0x54, 0x06, 0x25, + 0x00, 0x02, 0x06, 0x55, 0x00, 0x01, 0x00, 0x04, 0x06, 0x24, 0x00, 0x02, 0x06, 0x54, 0x00, 0x01, + 0x00, 0x04, 0x06, 0x26, 0x00, 0x02, 0x06, 0x54, 0x00, 0x01, 0x00, 0x04, 0x06, 0xC2, 0x00, 0x02, + 0x06, 0x54, 0x00, 0x01, 0x00, 0x04, 0x06, 0xD3, 0x00, 0x02, 0x06, 0x54, 0x00, 0x01, 0x00, 0x04, + 0x06, 0xC0, 0x00, 0x02, 0x06, 0x54, 0x00, 0x01, 0x00, 0x06, 0x06, 0x27, 0x06, 0x48, 0x06, 0x4A, + 0x06, 0xC1, 0x06, 0xD2, 0x06, 0xD5, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, + 0x00, 0x46, 0x00, 0x08, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, + 0x00, 0x3A, 0x00, 0x40, 0x00, 0x02, 0x06, 0x27, 0x06, 0x53, 0x00, 0x02, 0x06, 0x27, 0x06, 0x54, + 0x00, 0x02, 0x06, 0x48, 0x06, 0x54, 0x00, 0x02, 0x06, 0x27, 0x06, 0x55, 0x00, 0x02, 0x06, 0x4A, + 0x06, 0x54, 0x00, 0x02, 0x06, 0xD5, 0x06, 0x54, 0x00, 0x02, 0x06, 0xC1, 0x06, 0x54, 0x00, 0x02, + 0x06, 0xD2, 0x06, 0x54, 0x00, 0x01, 0x00, 0x08, 0x06, 0x22, 0x06, 0x23, 0x06, 0x24, 0x06, 0x25, + 0x06, 0x26, 0x06, 0xC0, 0x06, 0xC2, 0x06, 0xD3, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, + 0x00, 0x02, 0x00, 0x62, 0x00, 0x2E, 0xFE, 0x8B, 0xFE, 0x91, 0xFE, 0x97, 0xFE, 0x9B, 0xFE, 0x9F, + 0xFE, 0xA3, 0xFE, 0xA7, 0xFE, 0xB3, 0xFE, 0xB7, 0xFE, 0xBB, 0xFE, 0xBF, 0xFE, 0xC3, 0xFE, 0xC7, + 0xFE, 0xCB, 0xFE, 0xCF, 0xFE, 0xD3, 0xFE, 0xD7, 0xFE, 0xDB, 0xFE, 0xDF, 0xFE, 0xE3, 0xFE, 0xE7, + 0xFE, 0xEB, 0xFB, 0xE8, 0xFE, 0xF3, 0xFB, 0x68, 0xFB, 0x60, 0xFB, 0x54, 0xFB, 0x58, 0xFB, 0x64, + 0xFB, 0x5C, 0xFB, 0x78, 0xFB, 0x74, 0xFB, 0x7C, 0xFB, 0x80, 0xFB, 0x6C, 0xFB, 0x70, 0xFB, 0x90, + 0xFB, 0xD5, 0xFB, 0x94, 0xFB, 0x9C, 0xFB, 0x98, 0xFB, 0xA2, 0xFB, 0xAC, 0xFB, 0xA8, 0xFB, 0xFE, + 0xFB, 0xE6, 0x00, 0x01, 0x00, 0x2E, 0x06, 0x26, 0x06, 0x28, 0x06, 0x2A, 0x06, 0x2B, 0x06, 0x2C, + 0x06, 0x2D, 0x06, 0x2E, 0x06, 0x33, 0x06, 0x34, 0x06, 0x35, 0x06, 0x36, 0x06, 0x37, 0x06, 0x38, + 0x06, 0x39, 0x06, 0x3A, 0x06, 0x41, 0x06, 0x42, 0x06, 0x43, 0x06, 0x44, 0x06, 0x45, 0x06, 0x46, + 0x06, 0x47, 0x06, 0x49, 0x06, 0x4A, 0x06, 0x79, 0x06, 0x7A, 0x06, 0x7B, 0x06, 0x7E, 0x06, 0x7F, + 0x06, 0x80, 0x06, 0x83, 0x06, 0x84, 0x06, 0x86, 0x06, 0x87, 0x06, 0xA4, 0x06, 0xA6, 0x06, 0xA9, + 0x06, 0xAD, 0x06, 0xAF, 0x06, 0xB1, 0x06, 0xB3, 0x06, 0xBB, 0x06, 0xBE, 0x06, 0xC1, 0x06, 0xCC, + 0x06, 0xD0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x02, 0x00, 0x62, 0x00, 0x2E, + 0xFE, 0x8C, 0xFE, 0x92, 0xFE, 0x98, 0xFE, 0x9C, 0xFE, 0xA0, 0xFE, 0xA4, 0xFE, 0xA8, 0xFE, 0xB4, + 0xFE, 0xB8, 0xFE, 0xBC, 0xFE, 0xC0, 0xFE, 0xC4, 0xFE, 0xC8, 0xFE, 0xCC, 0xFE, 0xD0, 0xFE, 0xD4, + 0xFE, 0xD8, 0xFE, 0xDC, 0xFE, 0xE0, 0xFE, 0xE4, 0xFE, 0xE8, 0xFE, 0xEC, 0xFB, 0xE9, 0xFE, 0xF4, + 0xFB, 0x69, 0xFB, 0x61, 0xFB, 0x55, 0xFB, 0x59, 0xFB, 0x65, 0xFB, 0x5D, 0xFB, 0x79, 0xFB, 0x75, + 0xFB, 0x7D, 0xFB, 0x81, 0xFB, 0x6D, 0xFB, 0x71, 0xFB, 0x91, 0xFB, 0xD6, 0xFB, 0x95, 0xFB, 0x9D, + 0xFB, 0x99, 0xFB, 0xA3, 0xFB, 0xAD, 0xFB, 0xA9, 0xFB, 0xFF, 0xFB, 0xE7, 0x00, 0x01, 0x00, 0x2E, + 0x06, 0x26, 0x06, 0x28, 0x06, 0x2A, 0x06, 0x2B, 0x06, 0x2C, 0x06, 0x2D, 0x06, 0x2E, 0x06, 0x33, + 0x06, 0x34, 0x06, 0x35, 0x06, 0x36, 0x06, 0x37, 0x06, 0x38, 0x06, 0x39, 0x06, 0x3A, 0x06, 0x41, + 0x06, 0x42, 0x06, 0x43, 0x06, 0x44, 0x06, 0x45, 0x06, 0x46, 0x06, 0x47, 0x06, 0x49, 0x06, 0x4A, + 0x06, 0x79, 0x06, 0x7A, 0x06, 0x7B, 0x06, 0x7E, 0x06, 0x7F, 0x06, 0x80, 0x06, 0x83, 0x06, 0x84, + 0x06, 0x86, 0x06, 0x87, 0x06, 0xA4, 0x06, 0xA6, 0x06, 0xA9, 0x06, 0xAD, 0x06, 0xAF, 0x06, 0xB1, + 0x06, 0xB3, 0x06, 0xBB, 0x06, 0xBE, 0x06, 0xC1, 0x06, 0xCC, 0x06, 0xD0, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x08, 0x00, 0x02, 0x00, 0x9A, 0x00, 0x4A, 0xFE, 0x82, 0xFE, 0x84, 0xFE, 0x86, + 0xFE, 0x88, 0xFE, 0x8A, 0xFE, 0x8E, 0xFE, 0x90, 0xFE, 0x94, 0xFE, 0x96, 0xFE, 0x9A, 0xFE, 0x9E, + 0xFE, 0xA2, 0xFE, 0xA6, 0xFE, 0xAA, 0xFE, 0xAC, 0xFE, 0xAE, 0xFE, 0xB0, 0xFE, 0xB2, 0xFE, 0xB6, + 0xFE, 0xBA, 0xFE, 0xBE, 0xFE, 0xC2, 0xFE, 0xC6, 0xFE, 0xCA, 0xFE, 0xCE, 0xFE, 0xD2, 0xFE, 0xD6, + 0xFE, 0xDA, 0xFE, 0xDE, 0xFE, 0xE2, 0xFE, 0xE6, 0xFE, 0xEA, 0xFE, 0xEE, 0xFE, 0xF0, 0xFE, 0xF2, + 0xFB, 0x51, 0xFB, 0x67, 0xFB, 0x5F, 0xFB, 0x53, 0xFB, 0x57, 0xFB, 0x63, 0xFB, 0x5B, 0xFB, 0x77, + 0xFB, 0x73, 0xFB, 0x7B, 0xFB, 0x7F, 0xFB, 0x89, 0xFB, 0x85, 0xFB, 0x83, 0xFB, 0x87, 0xFB, 0x8D, + 0xFB, 0x8B, 0xFB, 0x6B, 0xFB, 0x6F, 0xFB, 0x8F, 0xFB, 0xD4, 0xFB, 0x93, 0xFB, 0x9B, 0xFB, 0x97, + 0xFB, 0x9F, 0xFB, 0xA1, 0xFB, 0xAB, 0xFB, 0xA5, 0xFB, 0xA7, 0xFB, 0xE1, 0xFB, 0xDA, 0xFB, 0xD8, + 0xFB, 0xDC, 0xFB, 0xE3, 0xFB, 0xDF, 0xFB, 0xFD, 0xFB, 0xE5, 0xFB, 0xAF, 0xFB, 0xB1, 0x00, 0x01, + 0x00, 0x4A, 0x06, 0x22, 0x06, 0x23, 0x06, 0x24, 0x06, 0x25, 0x06, 0x26, 0x06, 0x27, 0x06, 0x28, + 0x06, 0x29, 0x06, 0x2A, 0x06, 0x2B, 0x06, 0x2C, 0x06, 0x2D, 0x06, 0x2E, 0x06, 0x2F, 0x06, 0x30, + 0x06, 0x31, 0x06, 0x32, 0x06, 0x33, 0x06, 0x34, 0x06, 0x35, 0x06, 0x36, 0x06, 0x37, 0x06, 0x38, + 0x06, 0x39, 0x06, 0x3A, 0x06, 0x41, 0x06, 0x42, 0x06, 0x43, 0x06, 0x44, 0x06, 0x45, 0x06, 0x46, + 0x06, 0x47, 0x06, 0x48, 0x06, 0x49, 0x06, 0x4A, 0x06, 0x71, 0x06, 0x79, 0x06, 0x7A, 0x06, 0x7B, + 0x06, 0x7E, 0x06, 0x7F, 0x06, 0x80, 0x06, 0x83, 0x06, 0x84, 0x06, 0x86, 0x06, 0x87, 0x06, 0x88, + 0x06, 0x8C, 0x06, 0x8D, 0x06, 0x8E, 0x06, 0x91, 0x06, 0x98, 0x06, 0xA4, 0x06, 0xA6, 0x06, 0xA9, + 0x06, 0xAD, 0x06, 0xAF, 0x06, 0xB1, 0x06, 0xB3, 0x06, 0xBA, 0x06, 0xBB, 0x06, 0xBE, 0x06, 0xC0, + 0x06, 0xC1, 0x06, 0xC5, 0x06, 0xC6, 0x06, 0xC7, 0x06, 0xC8, 0x06, 0xC9, 0x06, 0xCB, 0x06, 0xCC, + 0x06, 0xD0, 0x06, 0xD2, 0x06, 0xD3, 0x00, 0x04, 0x00, 0x08, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, + 0x10, 0x98, 0x00, 0x35, 0x00, 0x70, 0x00, 0x7A, 0x01, 0x0C, 0x01, 0x86, 0x01, 0xA8, 0x01, 0xB2, + 0x02, 0x0C, 0x02, 0x62, 0x03, 0x02, 0x03, 0x8A, 0x03, 0xB4, 0x03, 0xF6, 0x04, 0x46, 0x04, 0x8A, + 0x04, 0xBC, 0x04, 0xEC, 0x05, 0x26, 0x05, 0x38, 0x05, 0x42, 0x05, 0x64, 0x05, 0xF8, 0x06, 0x6C, + 0x06, 0xEC, 0x07, 0x80, 0x08, 0x1E, 0x08, 0x56, 0x08, 0xBA, 0x08, 0xF2, 0x09, 0x38, 0x09, 0x66, + 0x09, 0x78, 0x09, 0x82, 0x09, 0xD4, 0x0A, 0x0E, 0x0A, 0x40, 0x0A, 0x70, 0x0A, 0xCC, 0x0A, 0xF2, + 0x0B, 0x38, 0x0B, 0x68, 0x0B, 0xDC, 0x0C, 0x2A, 0x0C, 0xD6, 0x0D, 0x72, 0x0E, 0x16, 0x0E, 0x50, + 0x0E, 0xC8, 0x0F, 0x5A, 0x0F, 0xA8, 0x0F, 0xB6, 0x0F, 0xC0, 0x0F, 0xCA, 0x10, 0x2E, 0x00, 0x01, + 0x00, 0x04, 0xFB, 0xDD, 0x00, 0x02, 0x06, 0x74, 0x00, 0x12, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, + 0x00, 0x38, 0x00, 0x3E, 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, 0x00, 0x56, 0x00, 0x5C, 0x00, 0x62, + 0x00, 0x68, 0x00, 0x6E, 0x00, 0x74, 0x00, 0x7A, 0x00, 0x80, 0x00, 0x86, 0x00, 0x8C, 0xFB, 0xEC, + 0x00, 0x02, 0x00, 0x01, 0xFB, 0xF0, 0x00, 0x02, 0xFB, 0xD8, 0xFB, 0xF2, 0x00, 0x02, 0xFB, 0xDA, + 0xFB, 0xF4, 0x00, 0x02, 0xFB, 0xDC, 0xFB, 0xF6, 0x00, 0x02, 0xFB, 0xE5, 0xFB, 0xF8, 0x00, 0x02, + 0xFB, 0xE7, 0xFB, 0xEA, 0x00, 0x02, 0xFE, 0x8E, 0xFC, 0x00, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0x97, + 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x01, 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0x98, 0x00, 0x02, 0xFE, 0xA4, + 0xFC, 0x99, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x02, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0x9A, 0x00, 0x02, + 0xFE, 0xE4, 0xFC, 0x9B, 0x00, 0x02, 0xFE, 0xEC, 0xFB, 0xEE, 0x00, 0x02, 0xFE, 0xEE, 0xFB, 0xF9, + 0x00, 0x02, 0xFE, 0xF0, 0xFB, 0xFB, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0F, 0x00, 0x20, 0x00, 0x26, + 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, 0x00, 0x56, + 0x00, 0x5C, 0x00, 0x62, 0x00, 0x68, 0x00, 0x6E, 0x00, 0x74, 0xFB, 0xED, 0x00, 0x02, 0x00, 0x01, + 0xFB, 0xF1, 0x00, 0x02, 0xFB, 0xD8, 0xFB, 0xF3, 0x00, 0x02, 0xFB, 0xDA, 0xFB, 0xF5, 0x00, 0x02, + 0xFB, 0xDC, 0xFB, 0xF7, 0x00, 0x02, 0xFB, 0xE5, 0xFB, 0xEB, 0x00, 0x02, 0xFE, 0x8E, 0xFC, 0x64, + 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x65, 0x00, 0x02, 0xFE, 0xB0, 0xFC, 0x66, 0x00, 0x02, 0xFE, 0xE2, + 0xFC, 0xDF, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x67, 0x00, 0x02, 0xFE, 0xE6, 0xFC, 0xE0, 0x00, 0x02, + 0xFE, 0xEC, 0xFB, 0xEF, 0x00, 0x02, 0xFE, 0xEE, 0xFB, 0xFA, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x69, + 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x18, 0xFD, 0x3D, 0x00, 0x02, + 0x06, 0x4B, 0xFD, 0xF3, 0x00, 0x04, 0xFE, 0xDB, 0xFE, 0x92, 0xFE, 0xAE, 0xFD, 0xF2, 0x00, 0x04, + 0xFE, 0xDF, 0xFE, 0xE0, 0xFE, 0xEA, 0x00, 0x01, 0x00, 0x04, 0xFD, 0x3C, 0x00, 0x02, 0x06, 0x4B, + 0x00, 0x0B, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, + 0x00, 0x42, 0x00, 0x48, 0x00, 0x4E, 0x00, 0x54, 0xFC, 0x05, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0x9C, + 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x06, 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0x9D, 0x00, 0x02, 0xFE, 0xA4, + 0xFC, 0x07, 0x00, 0x02, 0xFE, 0xA6, 0xFC, 0x9E, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x08, 0x00, 0x02, + 0xFE, 0xE2, 0xFC, 0x9F, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xA0, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x09, + 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x0A, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0A, 0x00, 0x16, 0x00, 0x1E, + 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, + 0xFD, 0xC2, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, 0xFD, 0x9E, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xF2, + 0xFC, 0x6A, 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x6B, 0x00, 0x02, 0xFE, 0xB0, 0xFC, 0x6C, 0x00, 0x02, + 0xFE, 0xE2, 0xFC, 0xE1, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x6D, 0x00, 0x02, 0xFE, 0xE6, 0xFC, 0xE2, + 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x6E, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x6F, 0x00, 0x02, 0xFE, 0xF2, + 0x00, 0x12, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x3A, 0x00, 0x40, 0x00, 0x48, 0x00, 0x50, + 0x00, 0x56, 0x00, 0x5C, 0x00, 0x64, 0x00, 0x6A, 0x00, 0x70, 0x00, 0x78, 0x00, 0x80, 0x00, 0x88, + 0x00, 0x8E, 0x00, 0x94, 0x00, 0x9A, 0xFC, 0x0B, 0x00, 0x02, 0xFE, 0x9E, 0xFD, 0x50, 0x00, 0x03, + 0xFE, 0xA0, 0xFE, 0xE4, 0xFC, 0xA1, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x0C, 0x00, 0x02, 0xFE, 0xA2, + 0xFD, 0x52, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xA0, 0xFD, 0x53, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xE4, + 0xFC, 0xA2, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x0D, 0x00, 0x02, 0xFE, 0xA6, 0xFD, 0x54, 0x00, 0x03, + 0xFE, 0xA8, 0xFE, 0xE4, 0xFC, 0xA3, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x0E, 0x00, 0x02, 0xFE, 0xE2, + 0xFD, 0x55, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA0, 0xFD, 0x56, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA4, + 0xFD, 0x57, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA8, 0xFC, 0xA4, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xA5, + 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x0F, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x10, 0x00, 0x02, 0xFE, 0xF2, + 0x00, 0x0F, 0x00, 0x20, 0x00, 0x28, 0x00, 0x30, 0x00, 0x38, 0x00, 0x40, 0x00, 0x48, 0x00, 0x4E, + 0x00, 0x54, 0x00, 0x5A, 0x00, 0x62, 0x00, 0x6A, 0x00, 0x70, 0x00, 0x76, 0x00, 0x7C, 0x00, 0x82, + 0xFD, 0xA0, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF0, 0xFD, 0x9F, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, + 0xFD, 0x51, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0x9E, 0xFD, 0xA2, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xF0, + 0xFD, 0xA1, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xF2, 0xFC, 0x70, 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x71, + 0x00, 0x02, 0xFE, 0xB0, 0xFC, 0x72, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0xA4, 0x00, 0x03, 0xFE, 0xE4, + 0xFE, 0xF0, 0xFD, 0xA3, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFC, 0xE3, 0x00, 0x02, 0xFE, 0xE4, + 0xFC, 0x73, 0x00, 0x02, 0xFE, 0xE6, 0xFC, 0xE4, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x74, 0x00, 0x02, + 0xFE, 0xF0, 0xFC, 0x75, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, + 0x00, 0x1E, 0x00, 0x24, 0xFC, 0x11, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0x12, 0x00, 0x02, 0xFE, 0xE2, + 0xFC, 0xA6, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x13, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x14, 0x00, 0x02, + 0xFE, 0xF2, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, + 0x00, 0x36, 0x00, 0x3C, 0xFC, 0x76, 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x77, 0x00, 0x02, 0xFE, 0xB0, + 0xFC, 0x78, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xE5, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x79, 0x00, 0x02, + 0xFE, 0xE6, 0xFC, 0xE6, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x7A, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x7B, + 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x30, 0x00, 0x36, + 0x00, 0x3E, 0x00, 0x44, 0x00, 0x4A, 0xFC, 0x15, 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0xA7, 0x00, 0x02, + 0xFE, 0xA4, 0xFD, 0xFB, 0x00, 0x08, 0xFE, 0xDE, 0x00, 0x20, 0xFE, 0x9F, 0xFE, 0xE0, 0xFE, 0x8E, + 0xFE, 0xDF, 0xFE, 0xEA, 0xFC, 0x16, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x59, 0x00, 0x03, 0xFE, 0xE4, + 0xFE, 0xA4, 0xFC, 0xA8, 0x00, 0x02, 0xFE, 0xE4, 0xFD, 0x01, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x02, + 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x07, 0x00, 0x10, 0x00, 0x18, 0x00, 0x20, 0x00, 0x28, 0x00, 0x30, + 0x00, 0x38, 0x00, 0x3E, 0xFD, 0xA6, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF0, 0xFD, 0xBE, 0x00, 0x03, + 0xFE, 0xA4, 0xFE, 0xF2, 0xFD, 0x58, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA2, 0xFD, 0xA7, 0x00, 0x03, + 0xFE, 0xE4, 0xFE, 0xF0, 0xFD, 0xA5, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFD, 0x1D, 0x00, 0x02, + 0xFE, 0xF0, 0xFD, 0x1E, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, + 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0xFC, 0x17, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0xA9, 0x00, 0x02, + 0xFE, 0xA0, 0xFC, 0x18, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xAA, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xFF, + 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x00, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x14, + 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2A, 0xFD, 0xBF, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, 0xFD, 0x5B, + 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF0, 0xFD, 0x5A, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFD, 0x1B, + 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x1C, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, + 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0xFC, 0x19, 0x00, 0x02, 0xFE, 0x9E, + 0xFC, 0xAB, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x1A, 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0x1B, 0x00, 0x02, + 0xFE, 0xE2, 0xFC, 0xAC, 0x00, 0x02, 0xFE, 0xE4, 0xFD, 0x03, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x04, + 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0xFD, 0x1F, 0x00, 0x02, 0xFE, 0xF0, + 0xFD, 0x20, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x01, 0x00, 0x04, 0xFC, 0x5B, 0x00, 0x02, 0x06, 0x70, + 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x18, 0xFC, 0x5C, 0x00, 0x02, 0x06, 0x70, 0xFD, 0xFC, + 0x00, 0x04, 0xFB, 0xFE, 0xFE, 0x8E, 0xFE, 0xDD, 0xFD, 0xF6, 0x00, 0x04, 0xFE, 0xB3, 0xFE, 0xEE, + 0xFE, 0xDD, 0x00, 0x11, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x46, + 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, 0x00, 0x5E, 0x00, 0x64, 0x00, 0x6C, 0x00, 0x74, 0x00, 0x7C, + 0x00, 0x82, 0x00, 0x88, 0x00, 0x8E, 0xFC, 0x1C, 0x00, 0x02, 0xFE, 0x9E, 0xFD, 0x5D, 0x00, 0x03, + 0xFE, 0xA0, 0xFE, 0xA4, 0xFC, 0xAD, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x1D, 0x00, 0x02, 0xFE, 0xA2, + 0xFD, 0x5C, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xA0, 0xFC, 0xAE, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x1E, + 0x00, 0x02, 0xFE, 0xA6, 0xFC, 0xAF, 0x00, 0x02, 0xFE, 0xA8, 0xFD, 0x0E, 0x00, 0x02, 0xFE, 0xAE, + 0xFC, 0x1F, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x61, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA0, 0xFD, 0x60, + 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA4, 0xFD, 0x63, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE4, 0xFC, 0xB0, + 0x00, 0x02, 0xFE, 0xE4, 0xFD, 0x31, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0xFB, 0x00, 0x02, 0xFE, 0xF0, + 0xFC, 0xFC, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0D, 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, + 0x00, 0x38, 0x00, 0x40, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5C, 0x00, 0x62, 0x00, 0x68, + 0x00, 0x6E, 0xFD, 0x5E, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF0, 0xFD, 0x34, 0x00, 0x02, 0xFE, 0xA0, + 0xFD, 0x35, 0x00, 0x02, 0xFE, 0xA4, 0xFD, 0xA8, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xF0, 0xFD, 0xC6, + 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xF2, 0xFD, 0x36, 0x00, 0x02, 0xFE, 0xA8, 0xFD, 0x2A, 0x00, 0x02, + 0xFE, 0xAE, 0xFD, 0x5F, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA2, 0xFD, 0x62, 0x00, 0x03, 0xFE, 0xE4, + 0xFE, 0xE2, 0xFC, 0xE7, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xE8, 0x00, 0x02, 0xFE, 0xEC, 0xFD, 0x17, + 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x18, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0F, 0x00, 0x20, 0x00, 0x26, + 0x00, 0x2C, 0x00, 0x32, 0x00, 0x3A, 0x00, 0x40, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, + 0x00, 0x60, 0x00, 0x68, 0x00, 0x6E, 0x00, 0x74, 0x00, 0x7A, 0xFD, 0x09, 0x00, 0x02, 0xFE, 0x9E, + 0xFD, 0x2D, 0x00, 0x02, 0xFE, 0xA0, 0xFD, 0x0A, 0x00, 0x02, 0xFE, 0xA2, 0xFD, 0x68, 0x00, 0x03, + 0xFE, 0xA4, 0xFE, 0xE4, 0xFD, 0x2E, 0x00, 0x02, 0xFE, 0xA4, 0xFD, 0x0B, 0x00, 0x02, 0xFE, 0xA6, + 0xFD, 0x2F, 0x00, 0x02, 0xFE, 0xA8, 0xFD, 0x0D, 0x00, 0x02, 0xFE, 0xAE, 0xFD, 0x0C, 0x00, 0x02, + 0xFE, 0xE2, 0xFD, 0x6B, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA8, 0xFD, 0x6D, 0x00, 0x03, 0xFE, 0xE4, + 0xFE, 0xE4, 0xFD, 0x30, 0x00, 0x02, 0xFE, 0xE4, 0xFD, 0x32, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0xFD, + 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0xFE, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x11, 0x00, 0x24, 0x00, 0x2A, + 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4E, 0x00, 0x54, 0x00, 0x5A, 0x00, 0x60, + 0x00, 0x66, 0x00, 0x6C, 0x00, 0x74, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x88, 0x00, 0x8E, 0xFD, 0x25, + 0x00, 0x02, 0xFE, 0x9E, 0xFD, 0x69, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, 0xFD, 0x37, 0x00, 0x02, + 0xFE, 0xA0, 0xFD, 0x26, 0x00, 0x02, 0xFE, 0xA2, 0xFD, 0x67, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xE2, + 0xFD, 0xAA, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, 0xFD, 0x38, 0x00, 0x02, 0xFE, 0xA4, 0xFD, 0x27, + 0x00, 0x02, 0xFE, 0xA6, 0xFD, 0x39, 0x00, 0x02, 0xFE, 0xA8, 0xFD, 0x29, 0x00, 0x02, 0xFE, 0xAE, + 0xFD, 0x28, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x6A, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA6, 0xFD, 0x6C, + 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, 0xFC, 0xE9, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xEA, 0x00, 0x02, + 0xFE, 0xEC, 0xFD, 0x19, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x1A, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0E, + 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x50, + 0x00, 0x76, 0x00, 0x7E, 0x00, 0x84, 0x00, 0x8C, 0x00, 0x92, 0x00, 0x98, 0xFC, 0x20, 0x00, 0x02, + 0xFE, 0xA2, 0xFD, 0x65, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xA4, 0xFC, 0xB1, 0x00, 0x02, 0xFE, 0xA4, + 0xFC, 0xB2, 0x00, 0x02, 0xFE, 0xA8, 0xFD, 0x0F, 0x00, 0x02, 0xFE, 0xAE, 0xFD, 0xF0, 0x00, 0x03, + 0xFE, 0xE0, 0xFB, 0xAF, 0xFD, 0xF5, 0x00, 0x04, 0xFE, 0xE0, 0xFE, 0xCC, 0xFE, 0xE2, 0xFD, 0xFA, + 0x00, 0x12, 0xFE, 0xE0, 0xFE, 0xF0, 0x00, 0x20, 0xFE, 0x8D, 0xFE, 0xDF, 0xFE, 0xE0, 0xFE, 0xEA, + 0x00, 0x20, 0xFE, 0xCB, 0xFE, 0xE0, 0xFE, 0xF4, 0xFE, 0xEA, 0x00, 0x20, 0xFE, 0xED, 0xFE, 0xB3, + 0xFE, 0xE0, 0xFE, 0xE2, 0xFD, 0xF9, 0x00, 0x03, 0xFE, 0xE0, 0xFE, 0xF0, 0xFC, 0x21, 0x00, 0x02, + 0xFE, 0xE2, 0xFD, 0xC5, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE4, 0xFC, 0xB3, 0x00, 0x02, 0xFE, 0xE4, + 0xFD, 0x05, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x06, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x06, 0x00, 0x0E, + 0x00, 0x16, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2C, 0x00, 0x32, 0xFD, 0x64, 0x00, 0x03, 0xFE, 0xA4, + 0xFE, 0xA2, 0xFD, 0xA9, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, 0xFD, 0x2B, 0x00, 0x02, 0xFE, 0xAE, + 0xFD, 0x66, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, 0xFD, 0x21, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x22, + 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0C, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, + 0x00, 0x38, 0x00, 0x40, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, 0x00, 0x5E, 0xFC, 0x22, + 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0xB4, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x23, 0x00, 0x02, 0xFE, 0xA2, + 0xFC, 0xB5, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x24, 0x00, 0x02, 0xFE, 0xA6, 0xFD, 0x70, 0x00, 0x03, + 0xFE, 0xA8, 0xFE, 0xE4, 0xFC, 0xB6, 0x00, 0x02, 0xFE, 0xA8, 0xFD, 0x10, 0x00, 0x02, 0xFE, 0xAE, + 0xFC, 0x25, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xB7, 0x00, 0x02, 0xFE, 0xE4, 0xFD, 0x07, 0x00, 0x02, + 0xFE, 0xF0, 0xFD, 0x08, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x16, 0x00, 0x1E, + 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0xFD, 0x6E, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF0, 0xFD, 0xAB, + 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, 0xFD, 0x6F, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xE2, 0xFD, 0x2C, + 0x00, 0x02, 0xFE, 0xAE, 0xFD, 0x23, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x24, 0x00, 0x02, 0xFE, 0xF2, + 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x3A, + 0x00, 0x40, 0xFC, 0x26, 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0xB8, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x27, + 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x72, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA4, 0xFD, 0x73, 0x00, 0x03, + 0xFE, 0xE4, 0xFE, 0xE4, 0xFD, 0x33, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xF5, 0x00, 0x02, 0xFE, 0xF0, + 0xFC, 0xF6, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x14, 0x00, 0x1C, 0x00, 0x22, + 0x00, 0x28, 0xFD, 0x71, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA2, 0xFD, 0x74, 0x00, 0x03, 0xFE, 0xE4, + 0xFE, 0xF2, 0xFD, 0x3A, 0x00, 0x02, 0xFE, 0xE4, 0xFD, 0x11, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x12, + 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0xFC, 0x28, 0x00, 0x02, 0xFE, 0xE2, + 0xFC, 0xB9, 0x00, 0x02, 0xFE, 0xE4, 0x00, 0x01, 0x00, 0x04, 0xFD, 0x3B, 0x00, 0x02, 0xFE, 0xE4, + 0x00, 0x09, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x22, 0x00, 0x28, 0x00, 0x32, 0x00, 0x38, 0x00, 0x40, + 0x00, 0x46, 0x00, 0x4C, 0xFC, 0x29, 0x00, 0x02, 0xFE, 0x9E, 0xFD, 0xC4, 0x00, 0x03, 0xFE, 0xA0, + 0xFE, 0xE4, 0xFC, 0xBA, 0x00, 0x02, 0xFE, 0xA0, 0xFD, 0xF7, 0x00, 0x04, 0xFE, 0xE0, 0xFE, 0xF4, + 0xFE, 0xEA, 0xFC, 0x2A, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x77, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE4, + 0xFC, 0xBB, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xF7, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0xF8, 0x00, 0x02, + 0xFE, 0xF2, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x16, 0x00, 0x1E, 0x00, 0x26, 0x00, 0x2E, 0x00, 0x34, + 0xFD, 0x75, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xE2, 0xFD, 0x76, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, + 0xFD, 0x78, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF0, 0xFD, 0xB6, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, + 0xFD, 0x13, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x14, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x06, 0x00, 0x0E, + 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0xFC, 0x2B, 0x00, 0x02, 0xFE, 0x9E, + 0xFC, 0xBC, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x2C, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xBD, 0x00, 0x02, + 0xFE, 0xE4, 0xFC, 0xF9, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0xFA, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x05, + 0x00, 0x0C, 0x00, 0x14, 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2A, 0xFD, 0x79, 0x00, 0x03, 0xFE, 0xE4, + 0xFE, 0xE2, 0xFD, 0x7B, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF0, 0xFD, 0x7A, 0x00, 0x03, 0xFE, 0xE4, + 0xFE, 0xF2, 0xFD, 0x15, 0x00, 0x02, 0xFE, 0xF0, 0xFD, 0x16, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0B, + 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3E, 0x00, 0x44, + 0x00, 0x4A, 0x00, 0x50, 0x00, 0x56, 0xFC, 0x2D, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0xBE, 0x00, 0x02, + 0xFE, 0xA0, 0xFC, 0x2E, 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0xBF, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x2F, + 0x00, 0x02, 0xFE, 0xA6, 0xFD, 0x7D, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xE4, 0xFC, 0xC0, 0x00, 0x02, + 0xFE, 0xA8, 0xFC, 0x30, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xC1, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x31, + 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x32, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x12, + 0x00, 0x1A, 0x00, 0x20, 0xFD, 0x7C, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xE2, 0xFD, 0xC1, 0x00, 0x03, + 0xFE, 0xE4, 0xFE, 0xF2, 0xFC, 0x7C, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x7D, 0x00, 0x02, 0xFE, 0xF2, + 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x3A, + 0x00, 0x40, 0xFC, 0x33, 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0xC2, 0x00, 0x02, 0xFE, 0xA4, 0xFD, 0xF1, + 0x00, 0x03, 0xFE, 0xE0, 0xFB, 0xAF, 0xFC, 0x34, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0xB4, 0x00, 0x03, + 0xFE, 0xE4, 0xFE, 0xA4, 0xFC, 0xC3, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x35, 0x00, 0x02, 0xFE, 0xF0, + 0xFC, 0x36, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x14, 0x00, 0x1C, 0x00, 0x24, + 0x00, 0x2A, 0xFD, 0x7E, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA2, 0xFD, 0x7F, 0x00, 0x03, 0xFE, 0xE4, + 0xFE, 0xE2, 0xFD, 0xB2, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFC, 0x7E, 0x00, 0x02, 0xFE, 0xF0, + 0xFC, 0x7F, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0E, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, + 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0x00, 0x4E, 0x00, 0x54, 0x00, 0x5A, 0x00, 0x62, + 0x00, 0x68, 0x00, 0x6E, 0xFC, 0x37, 0x00, 0x02, 0xFE, 0x8E, 0xFC, 0x38, 0x00, 0x02, 0xFE, 0x9E, + 0xFC, 0xC4, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x39, 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0xC5, 0x00, 0x02, + 0xFE, 0xA4, 0xFC, 0x3A, 0x00, 0x02, 0xFE, 0xA6, 0xFC, 0xC6, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x3B, + 0x00, 0x02, 0xFE, 0xDE, 0xFC, 0xC7, 0x00, 0x02, 0xFE, 0xE0, 0xFC, 0x3C, 0x00, 0x02, 0xFE, 0xE2, + 0xFD, 0xC3, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE4, 0xFC, 0xC8, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x3D, + 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x3E, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x09, 0x00, 0x14, 0x00, 0x1A, + 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0xFC, 0x80, + 0x00, 0x02, 0xFE, 0x8E, 0xFC, 0x81, 0x00, 0x02, 0xFE, 0xDE, 0xFC, 0xEB, 0x00, 0x02, 0xFE, 0xE0, + 0xFC, 0x82, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0xBB, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, 0xFD, 0xB7, + 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFC, 0xEC, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x83, 0x00, 0x02, + 0xFE, 0xF0, 0xFC, 0x84, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x14, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, + 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0x00, 0x50, 0x00, 0x58, 0x00, 0x5E, 0x00, 0x64, 0x00, 0x6C, + 0x00, 0x72, 0x00, 0x78, 0x00, 0x80, 0x00, 0x86, 0x00, 0x8C, 0x00, 0x94, 0x00, 0x9A, 0x00, 0xA0, + 0x00, 0xA6, 0xFE, 0xF5, 0x00, 0x02, 0xFE, 0x82, 0xFE, 0xF7, 0x00, 0x02, 0xFE, 0x84, 0xFE, 0xF9, + 0x00, 0x02, 0xFE, 0x88, 0xFE, 0xFB, 0x00, 0x02, 0xFE, 0x8E, 0xFC, 0x3F, 0x00, 0x02, 0xFE, 0x9E, + 0xFD, 0x83, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xA0, 0xFD, 0xBA, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xE4, + 0xFC, 0xC9, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x40, 0x00, 0x02, 0xFE, 0xA2, 0xFD, 0xB5, 0x00, 0x03, + 0xFE, 0xA4, 0xFE, 0xE4, 0xFC, 0xCA, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x41, 0x00, 0x02, 0xFE, 0xA6, + 0xFD, 0x86, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xE4, 0xFC, 0xCB, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x42, + 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x88, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA4, 0xFC, 0xCC, 0x00, 0x02, + 0xFE, 0xE4, 0xFC, 0xCD, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x43, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x44, + 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x11, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, + 0x00, 0x44, 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5C, 0x00, 0x64, 0x00, 0x6C, 0x00, 0x74, 0x00, 0x7A, + 0x00, 0x82, 0x00, 0x8A, 0x00, 0x90, 0x00, 0x96, 0xFE, 0xF6, 0x00, 0x02, 0xFE, 0x82, 0xFE, 0xF8, + 0x00, 0x02, 0xFE, 0x84, 0xFE, 0xFA, 0x00, 0x02, 0xFE, 0x88, 0xFE, 0xFC, 0x00, 0x02, 0xFE, 0x8E, + 0xFD, 0x84, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0x9E, 0xFD, 0xBC, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xE2, + 0xFD, 0xAC, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, 0xFD, 0x80, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xE2, + 0xFD, 0x82, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF0, 0xFD, 0x81, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, + 0xFD, 0x85, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xE2, 0xFC, 0x85, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x87, + 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA2, 0xFD, 0xAD, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFC, 0xED, + 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x86, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x87, 0x00, 0x02, 0xFE, 0xF2, + 0x00, 0x12, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x3C, 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, + 0x00, 0x58, 0x00, 0x62, 0x00, 0x6A, 0x00, 0x70, 0x00, 0x76, 0x00, 0x7E, 0x00, 0x86, 0x00, 0x8C, + 0x00, 0x92, 0x00, 0x98, 0x00, 0x9E, 0xFC, 0x45, 0x00, 0x02, 0xFE, 0x9E, 0xFD, 0x8C, 0x00, 0x03, + 0xFE, 0xA0, 0xFE, 0xA4, 0xFD, 0x92, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xA8, 0xFD, 0x8D, 0x00, 0x03, + 0xFE, 0xA0, 0xFE, 0xE4, 0xFC, 0xCE, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x46, 0x00, 0x02, 0xFE, 0xA2, + 0xFD, 0x89, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xA0, 0xFD, 0xF4, 0x00, 0x04, 0xFE, 0xA4, 0xFE, 0xE4, + 0xFE, 0xAA, 0xFD, 0x8A, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xE4, 0xFC, 0xCF, 0x00, 0x02, 0xFE, 0xA4, + 0xFC, 0x47, 0x00, 0x02, 0xFE, 0xA6, 0xFD, 0x8E, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xA0, 0xFD, 0x8F, + 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xE4, 0xFC, 0xD0, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x48, 0x00, 0x02, + 0xFE, 0xE2, 0xFC, 0xD1, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x49, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x4A, + 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2C, + 0x00, 0x32, 0xFC, 0x88, 0x00, 0x02, 0xFE, 0x8E, 0xFD, 0xC0, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, + 0xFD, 0x8B, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, 0xFD, 0xB9, 0x00, 0x03, 0xFE, 0xA8, 0xFE, 0xF2, + 0xFC, 0x89, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0xB1, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0x00, 0x0E, + 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x3A, 0x00, 0x40, 0x00, 0x48, 0x00, 0x4E, + 0x00, 0x54, 0x00, 0x5A, 0x00, 0x60, 0x00, 0x66, 0x00, 0x6C, 0x00, 0x72, 0xFC, 0x4B, 0x00, 0x02, + 0xFE, 0x9E, 0xFD, 0xB8, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xA4, 0xFD, 0x98, 0x00, 0x03, 0xFE, 0xA0, + 0xFE, 0xE4, 0xFC, 0xD2, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x4C, 0x00, 0x02, 0xFE, 0xA2, 0xFD, 0x95, + 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xE4, 0xFC, 0xD3, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x4D, 0x00, 0x02, + 0xFE, 0xA6, 0xFC, 0xD4, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x4E, 0x00, 0x02, 0xFE, 0xE2, 0xFC, 0xD5, + 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xD6, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x4F, 0x00, 0x02, 0xFE, 0xF0, + 0xFC, 0x50, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x10, 0x00, 0x22, 0x00, 0x2A, 0x00, 0x32, 0x00, 0x3A, + 0x00, 0x42, 0x00, 0x4A, 0x00, 0x52, 0x00, 0x58, 0x00, 0x5E, 0x00, 0x64, 0x00, 0x6C, 0x00, 0x74, + 0x00, 0x7A, 0x00, 0x80, 0x00, 0x86, 0x00, 0x8C, 0xFD, 0xBD, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xA2, + 0xFD, 0x97, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xE2, 0xFD, 0x99, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF0, + 0xFD, 0xC7, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, 0xFD, 0x96, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF0, + 0xFD, 0xB3, 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, 0xFC, 0x8A, 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x8B, + 0x00, 0x02, 0xFE, 0xB0, 0xFC, 0x8C, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x9B, 0x00, 0x03, 0xFE, 0xE4, + 0xFE, 0xF0, 0xFD, 0x9A, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFC, 0xEE, 0x00, 0x02, 0xFE, 0xE4, + 0xFC, 0x8D, 0x00, 0x02, 0xFE, 0xE6, 0xFC, 0xEF, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x8E, 0x00, 0x02, + 0xFE, 0xF0, 0xFC, 0x8F, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x09, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, + 0x00, 0x26, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0xFC, 0xD9, 0x00, 0x02, + 0x06, 0x70, 0xFC, 0x51, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0xD7, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x52, + 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x93, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xA0, 0xFD, 0x94, 0x00, 0x03, + 0xFE, 0xE4, 0xFE, 0xE4, 0xFC, 0xD8, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x53, 0x00, 0x02, 0xFE, 0xF0, + 0xFC, 0x54, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x01, 0x00, 0x04, 0xFD, 0xF8, 0x00, 0x04, 0xFE, 0xB3, + 0xFE, 0xE0, 0xFE, 0xE2, 0x00, 0x01, 0x00, 0x04, 0xFC, 0x5D, 0x00, 0x02, 0x06, 0x70, 0x00, 0x01, + 0x00, 0x04, 0xFC, 0x90, 0x00, 0x02, 0x06, 0x70, 0x00, 0x0C, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, + 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x44, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, + 0x00, 0x5E, 0xFC, 0x55, 0x00, 0x02, 0xFE, 0x9E, 0xFC, 0xDA, 0x00, 0x02, 0xFE, 0xA0, 0xFC, 0x56, + 0x00, 0x02, 0xFE, 0xA2, 0xFC, 0xDB, 0x00, 0x02, 0xFE, 0xA4, 0xFC, 0x57, 0x00, 0x02, 0xFE, 0xA6, + 0xFC, 0xDC, 0x00, 0x02, 0xFE, 0xA8, 0xFC, 0x58, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x9D, 0x00, 0x03, + 0xFE, 0xE4, 0xFE, 0xE4, 0xFC, 0xDD, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0xDE, 0x00, 0x02, 0xFE, 0xEC, + 0xFC, 0x59, 0x00, 0x02, 0xFE, 0xF0, 0xFC, 0x5A, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x0C, 0x00, 0x1A, + 0x00, 0x22, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x44, 0x00, 0x4C, 0x00, 0x52, + 0x00, 0x58, 0x00, 0x5E, 0x00, 0x64, 0xFD, 0xAF, 0x00, 0x03, 0xFE, 0xA0, 0xFE, 0xF2, 0xFD, 0xAE, + 0x00, 0x03, 0xFE, 0xA4, 0xFE, 0xF2, 0xFC, 0x91, 0x00, 0x02, 0xFE, 0xAE, 0xFC, 0x92, 0x00, 0x02, + 0xFE, 0xB0, 0xFC, 0x93, 0x00, 0x02, 0xFE, 0xE2, 0xFD, 0x9C, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xE2, + 0xFD, 0xB0, 0x00, 0x03, 0xFE, 0xE4, 0xFE, 0xF2, 0xFC, 0xF0, 0x00, 0x02, 0xFE, 0xE4, 0xFC, 0x94, + 0x00, 0x02, 0xFE, 0xE6, 0xFC, 0xF1, 0x00, 0x02, 0xFE, 0xEC, 0xFC, 0x95, 0x00, 0x02, 0xFE, 0xF0, + 0xFC, 0x96, 0x00, 0x02, 0xFE, 0xF2, 0x00, 0x01, 0x00, 0x35, 0xFB, 0xD7, 0xFE, 0x8B, 0xFE, 0x8C, + 0xFE, 0x8D, 0xFE, 0x8E, 0xFE, 0x91, 0xFE, 0x92, 0xFE, 0x97, 0xFE, 0x98, 0xFE, 0x9B, 0xFE, 0x9C, + 0xFE, 0x9F, 0xFE, 0xA0, 0xFE, 0xA3, 0xFE, 0xA4, 0xFE, 0xA7, 0xFE, 0xA8, 0xFE, 0xAB, 0xFE, 0xAD, + 0xFE, 0xB3, 0xFE, 0xB4, 0xFE, 0xB7, 0xFE, 0xB8, 0xFE, 0xBB, 0xFE, 0xBC, 0xFE, 0xBF, 0xFE, 0xC0, + 0xFE, 0xC3, 0xFE, 0xC4, 0xFE, 0xC7, 0xFE, 0xC8, 0xFE, 0xCB, 0xFE, 0xCC, 0xFE, 0xCF, 0xFE, 0xD0, + 0xFE, 0xD3, 0xFE, 0xD4, 0xFE, 0xD7, 0xFE, 0xD8, 0xFE, 0xDB, 0xFE, 0xDC, 0xFE, 0xDF, 0xFE, 0xE0, + 0xFE, 0xE3, 0xFE, 0xE4, 0xFE, 0xE7, 0xFE, 0xE8, 0xFE, 0xEB, 0xFE, 0xED, 0xFE, 0xEF, 0xFE, 0xF0, + 0xFE, 0xF3, 0xFE, 0xF4, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x1A, + 0x00, 0x01, 0x00, 0x08, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x09, 0xCB, 0x00, 0x02, 0x09, 0xBE, + 0x09, 0xCC, 0x00, 0x02, 0x09, 0xD7, 0x00, 0x01, 0x00, 0x01, 0x09, 0xC7, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x16, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x02, + 0x09, 0xC7, 0x09, 0xBE, 0x00, 0x02, 0x09, 0xC7, 0x09, 0xD7, 0x00, 0x01, 0x00, 0x02, 0x09, 0xCB, + 0x09, 0xCC, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x02, 0x66, 0x00, 0x20, 0x00, 0x46, 0x00, 0x50, 0x00, 0x62, 0x00, 0x74, 0x00, 0x96, 0x00, 0xA8, 0x00, 0xB2, 0x00, 0xDC, 0x00, 0xEE, 0x00, 0xF8, 0x01, 0x1A, 0x01, 0x24, 0x01, 0x2E, 0x01, 0x38, 0x01, 0x4A, 0x01, 0x5C, 0x01, 0x7E, 0x01, 0x90, 0x01, 0x9A, 0x01, 0xC4, 0x01, 0xD6, 0x01, 0xE0, 0x02, 0x02, 0x02, 0x0C, @@ -508,25 +499,13 @@ const le_uint8 CanonShaping::glyphSubstitutionTable[] = { 0x04, 0x35, 0x03, 0x40, 0x00, 0x02, 0x04, 0x33, 0x03, 0x41, 0x00, 0x02, 0x04, 0x3A, 0x03, 0x41, 0x00, 0x02, 0x04, 0x38, 0x03, 0x40, 0x00, 0x01, 0x00, 0x08, 0x04, 0x00, 0x04, 0x03, 0x04, 0x0C, 0x04, 0x0D, 0x04, 0x50, 0x04, 0x53, 0x04, 0x5C, 0x04, 0x5D, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x08, 0x00, 0x01, 0x00, 0x8A, 0x00, 0x0B, 0x00, 0x1C, 0x00, 0x26, 0x00, 0x30, 0x00, 0x3A, - 0x00, 0x44, 0x00, 0x4E, 0x00, 0x58, 0x00, 0x62, 0x00, 0x6C, 0x00, 0x76, 0x00, 0x80, 0x00, 0x01, - 0x00, 0x04, 0x09, 0x58, 0x00, 0x02, 0x09, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x09, 0x59, 0x00, 0x02, - 0x09, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x09, 0x5A, 0x00, 0x02, 0x09, 0x3C, 0x00, 0x01, 0x00, 0x04, - 0x09, 0x5B, 0x00, 0x02, 0x09, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x09, 0x5C, 0x00, 0x02, 0x09, 0x3C, - 0x00, 0x01, 0x00, 0x04, 0x09, 0x5D, 0x00, 0x02, 0x09, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x09, 0x29, - 0x00, 0x02, 0x09, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x09, 0x5E, 0x00, 0x02, 0x09, 0x3C, 0x00, 0x01, - 0x00, 0x04, 0x09, 0x5F, 0x00, 0x02, 0x09, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x09, 0x31, 0x00, 0x02, - 0x09, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x09, 0x34, 0x00, 0x02, 0x09, 0x3C, 0x00, 0x01, 0x00, 0x0B, - 0x09, 0x15, 0x09, 0x16, 0x09, 0x17, 0x09, 0x1C, 0x09, 0x21, 0x09, 0x22, 0x09, 0x28, 0x09, 0x2B, - 0x09, 0x2F, 0x09, 0x30, 0x09, 0x33, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, - 0x00, 0x5E, 0x00, 0x0B, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x00, 0x3A, - 0x00, 0x40, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, 0x00, 0x02, 0x09, 0x28, 0x09, 0x3C, - 0x00, 0x02, 0x09, 0x30, 0x09, 0x3C, 0x00, 0x02, 0x09, 0x33, 0x09, 0x3C, 0x00, 0x02, 0x09, 0x15, - 0x09, 0x3C, 0x00, 0x02, 0x09, 0x16, 0x09, 0x3C, 0x00, 0x02, 0x09, 0x17, 0x09, 0x3C, 0x00, 0x02, - 0x09, 0x1C, 0x09, 0x3C, 0x00, 0x02, 0x09, 0x21, 0x09, 0x3C, 0x00, 0x02, 0x09, 0x22, 0x09, 0x3C, - 0x00, 0x02, 0x09, 0x2B, 0x09, 0x3C, 0x00, 0x02, 0x09, 0x2F, 0x09, 0x3C, 0x00, 0x01, 0x00, 0x0B, - 0x09, 0x29, 0x09, 0x31, 0x09, 0x34, 0x09, 0x58, 0x09, 0x59, 0x09, 0x5A, 0x09, 0x5B, 0x09, 0x5C, - 0x09, 0x5D, 0x09, 0x5E, 0x09, 0x5F, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, + 0x00, 0x08, 0x00, 0x01, 0x00, 0x2A, 0x00, 0x03, 0x00, 0x0C, 0x00, 0x16, 0x00, 0x20, 0x00, 0x01, + 0x00, 0x04, 0x09, 0x29, 0x00, 0x02, 0x09, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x09, 0x31, 0x00, 0x02, + 0x09, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x09, 0x34, 0x00, 0x02, 0x09, 0x3C, 0x00, 0x01, 0x00, 0x03, + 0x09, 0x28, 0x09, 0x30, 0x09, 0x33, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, + 0x00, 0x1E, 0x00, 0x03, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x02, 0x09, 0x28, 0x09, 0x3C, + 0x00, 0x02, 0x09, 0x30, 0x09, 0x3C, 0x00, 0x02, 0x09, 0x33, 0x09, 0x3C, 0x00, 0x01, 0x00, 0x03, + 0x09, 0x29, 0x09, 0x31, 0x09, 0x34, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x33, 0x04, 0x00, 0x75, 0x00, 0xF0, 0x01, 0x1A, 0x04, 0x5A, 0x05, 0x0C, 0x08, 0x3C, 0x09, 0x24, 0x09, 0xD6, 0x09, 0xE0, 0x0A, 0x54, 0x0D, 0x84, 0x0D, 0x8E, 0x0D, 0x98, 0x11, 0x44, 0x11, 0xF6, 0x15, 0x92, 0x16, 0xBC, 0x17, 0x6E, 0x17, 0x88, 0x18, 0xB2, 0x1C, 0x4E, 0x1C, 0x78, 0x1C, 0xA2, @@ -1358,569 +1337,541 @@ const le_uint8 CanonShaping::glyphSubstitutionTable[] = { 0x1F, 0x81, 0x1F, 0x88, 0x1F, 0x89, 0x1F, 0x90, 0x1F, 0x91, 0x1F, 0x98, 0x1F, 0x99, 0x1F, 0xA0, 0x1F, 0xA1, 0x1F, 0xA8, 0x1F, 0xA9, 0x1F, 0xB3, 0x1F, 0xB6, 0x1F, 0xBC, 0x1F, 0xBE, 0x1F, 0xBF, 0x1F, 0xC3, 0x1F, 0xC6, 0x1F, 0xCC, 0x1F, 0xF3, 0x1F, 0xF6, 0x1F, 0xFC, 0x1F, 0xFE, 0x21, 0x26, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x4C, 0x0A, 0x10, 0x12, 0x6E, 0x18, 0x84, 0x1E, 0x68, - 0x22, 0x7A, 0x26, 0x68, 0x29, 0x12, 0x2B, 0x5C, 0x2D, 0x24, 0x2F, 0x04, 0x30, 0xB4, 0x32, 0x62, - 0x33, 0xCA, 0x35, 0x32, 0x36, 0x9A, 0x37, 0x76, 0x38, 0x52, 0x39, 0x2E, 0x39, 0xFC, 0x3A, 0xCA, - 0x3B, 0x98, 0x3C, 0x4A, 0x3C, 0xFC, 0x3D, 0x22, 0x3D, 0x48, 0x3D, 0x6E, 0x3D, 0x94, 0x3D, 0xBA, - 0x3D, 0xE0, 0x3E, 0x06, 0x3E, 0x2C, 0x3E, 0x52, 0x3E, 0x78, 0x3E, 0x9E, 0x00, 0x01, 0x07, 0xCE, - 0x00, 0xF9, 0x01, 0xF8, 0x01, 0xFE, 0x02, 0x04, 0x02, 0x0A, 0x02, 0x10, 0x02, 0x16, 0x02, 0x1C, - 0x02, 0x22, 0x02, 0x28, 0x02, 0x2E, 0x02, 0x34, 0x02, 0x3A, 0x02, 0x40, 0x02, 0x46, 0x02, 0x4C, - 0x02, 0x52, 0x02, 0x58, 0x02, 0x5E, 0x02, 0x64, 0x02, 0x6A, 0x02, 0x70, 0x02, 0x76, 0x02, 0x7C, - 0x02, 0x82, 0x02, 0x88, 0x02, 0x8E, 0x02, 0x94, 0x02, 0x9A, 0x02, 0xA0, 0x02, 0xA6, 0x02, 0xAC, - 0x02, 0xB2, 0x02, 0xB8, 0x02, 0xBE, 0x02, 0xC4, 0x02, 0xCA, 0x02, 0xD0, 0x02, 0xD6, 0x02, 0xDC, - 0x02, 0xE2, 0x02, 0xE8, 0x02, 0xEE, 0x02, 0xF4, 0x02, 0xFA, 0x03, 0x00, 0x03, 0x06, 0x03, 0x0C, - 0x03, 0x12, 0x03, 0x18, 0x03, 0x1E, 0x03, 0x24, 0x03, 0x2A, 0x03, 0x30, 0x03, 0x36, 0x03, 0x3C, - 0x03, 0x42, 0x03, 0x48, 0x03, 0x4E, 0x03, 0x54, 0x03, 0x5A, 0x03, 0x60, 0x03, 0x66, 0x03, 0x6C, - 0x03, 0x72, 0x03, 0x78, 0x03, 0x7E, 0x03, 0x84, 0x03, 0x8A, 0x03, 0x90, 0x03, 0x96, 0x03, 0x9C, - 0x03, 0xA2, 0x03, 0xA8, 0x03, 0xAE, 0x03, 0xB4, 0x03, 0xBA, 0x03, 0xC0, 0x03, 0xC6, 0x03, 0xCC, - 0x03, 0xD2, 0x03, 0xD8, 0x03, 0xDE, 0x03, 0xE4, 0x03, 0xEA, 0x03, 0xF0, 0x03, 0xF6, 0x03, 0xFC, - 0x04, 0x02, 0x04, 0x08, 0x04, 0x0E, 0x04, 0x14, 0x04, 0x1A, 0x04, 0x20, 0x04, 0x26, 0x04, 0x2C, - 0x04, 0x32, 0x04, 0x38, 0x04, 0x3E, 0x04, 0x44, 0x04, 0x4A, 0x04, 0x50, 0x04, 0x56, 0x04, 0x5C, - 0x04, 0x62, 0x04, 0x68, 0x04, 0x6E, 0x04, 0x74, 0x04, 0x7A, 0x04, 0x80, 0x04, 0x86, 0x04, 0x8C, - 0x04, 0x92, 0x04, 0x98, 0x04, 0x9E, 0x04, 0xA4, 0x04, 0xAA, 0x04, 0xB0, 0x04, 0xB6, 0x04, 0xBC, - 0x04, 0xC2, 0x04, 0xC8, 0x04, 0xCE, 0x04, 0xD4, 0x04, 0xDA, 0x04, 0xE0, 0x04, 0xE6, 0x04, 0xEC, - 0x04, 0xF2, 0x04, 0xF8, 0x04, 0xFE, 0x05, 0x04, 0x05, 0x0A, 0x05, 0x10, 0x05, 0x16, 0x05, 0x1C, - 0x05, 0x22, 0x05, 0x28, 0x05, 0x2E, 0x05, 0x34, 0x05, 0x3A, 0x05, 0x40, 0x05, 0x46, 0x05, 0x4C, - 0x05, 0x52, 0x05, 0x58, 0x05, 0x5E, 0x05, 0x64, 0x05, 0x6A, 0x05, 0x70, 0x05, 0x76, 0x05, 0x7C, - 0x05, 0x82, 0x05, 0x88, 0x05, 0x8E, 0x05, 0x94, 0x05, 0x9A, 0x05, 0xA0, 0x05, 0xA6, 0x05, 0xAC, - 0x05, 0xB2, 0x05, 0xB8, 0x05, 0xBE, 0x05, 0xC4, 0x05, 0xCA, 0x05, 0xD0, 0x05, 0xD6, 0x05, 0xDC, - 0x05, 0xE2, 0x05, 0xE8, 0x05, 0xEE, 0x05, 0xF4, 0x05, 0xFA, 0x06, 0x00, 0x06, 0x06, 0x06, 0x0C, - 0x06, 0x12, 0x06, 0x18, 0x06, 0x1E, 0x06, 0x24, 0x06, 0x2A, 0x06, 0x30, 0x06, 0x36, 0x06, 0x3C, - 0x06, 0x42, 0x06, 0x48, 0x06, 0x4E, 0x06, 0x54, 0x06, 0x5A, 0x06, 0x60, 0x06, 0x66, 0x06, 0x6C, - 0x06, 0x72, 0x06, 0x78, 0x06, 0x7E, 0x06, 0x84, 0x06, 0x8A, 0x06, 0x90, 0x06, 0x96, 0x06, 0x9C, - 0x06, 0xA2, 0x06, 0xA8, 0x06, 0xAE, 0x06, 0xB4, 0x06, 0xBA, 0x06, 0xC0, 0x06, 0xC6, 0x06, 0xCC, - 0x06, 0xD2, 0x06, 0xD8, 0x06, 0xDE, 0x06, 0xE4, 0x06, 0xEA, 0x06, 0xF0, 0x06, 0xF6, 0x06, 0xFC, - 0x07, 0x02, 0x07, 0x08, 0x07, 0x0E, 0x07, 0x14, 0x07, 0x1A, 0x07, 0x20, 0x07, 0x26, 0x07, 0x2C, - 0x07, 0x32, 0x07, 0x38, 0x07, 0x3E, 0x07, 0x44, 0x07, 0x4A, 0x07, 0x50, 0x07, 0x56, 0x07, 0x5C, - 0x07, 0x62, 0x07, 0x68, 0x07, 0x6E, 0x07, 0x74, 0x07, 0x7A, 0x07, 0x80, 0x07, 0x86, 0x07, 0x8C, - 0x07, 0x92, 0x07, 0x98, 0x07, 0x9E, 0x07, 0xA4, 0x07, 0xAA, 0x07, 0xB0, 0x07, 0xB6, 0x07, 0xBC, - 0x07, 0xC2, 0x07, 0xC8, 0x00, 0x02, 0x00, 0xA8, 0x03, 0x01, 0x00, 0x02, 0x03, 0x91, 0x03, 0x01, - 0x00, 0x02, 0x03, 0x95, 0x03, 0x01, 0x00, 0x02, 0x03, 0x97, 0x03, 0x01, 0x00, 0x02, 0x03, 0x99, - 0x03, 0x01, 0x00, 0x02, 0x03, 0x9F, 0x03, 0x01, 0x00, 0x02, 0x03, 0xA5, 0x03, 0x01, 0x00, 0x02, - 0x03, 0xA9, 0x03, 0x01, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x44, 0x00, 0x02, 0x03, 0x99, 0x03, 0x08, - 0x00, 0x02, 0x03, 0xA5, 0x03, 0x08, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x01, 0x00, 0x02, 0x03, 0xB5, - 0x03, 0x01, 0x00, 0x02, 0x03, 0xB7, 0x03, 0x01, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x01, 0x00, 0x02, - 0x03, 0xC5, 0x03, 0x44, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x08, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x08, - 0x00, 0x02, 0x03, 0xBF, 0x03, 0x01, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x01, 0x00, 0x02, 0x03, 0xC9, - 0x03, 0x01, 0x00, 0x02, 0x03, 0xD2, 0x03, 0x01, 0x00, 0x02, 0x03, 0xD2, 0x03, 0x08, 0x00, 0x02, - 0x03, 0xB1, 0x03, 0x13, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x00, 0x03, 0x00, - 0x00, 0x02, 0x1F, 0x01, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x00, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x01, - 0x03, 0x01, 0x00, 0x02, 0x1F, 0x00, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x01, 0x03, 0x42, 0x00, 0x02, - 0x03, 0x91, 0x03, 0x13, 0x00, 0x02, 0x03, 0x91, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x08, 0x03, 0x00, - 0x00, 0x02, 0x1F, 0x09, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x08, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x09, - 0x03, 0x01, 0x00, 0x02, 0x1F, 0x08, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x09, 0x03, 0x42, 0x00, 0x02, - 0x03, 0xB5, 0x03, 0x13, 0x00, 0x02, 0x03, 0xB5, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x10, 0x03, 0x00, - 0x00, 0x02, 0x1F, 0x11, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x10, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x11, - 0x03, 0x01, 0x00, 0x02, 0x03, 0x95, 0x03, 0x13, 0x00, 0x02, 0x03, 0x95, 0x03, 0x14, 0x00, 0x02, - 0x1F, 0x18, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x19, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x18, 0x03, 0x01, - 0x00, 0x02, 0x1F, 0x19, 0x03, 0x01, 0x00, 0x02, 0x03, 0xB7, 0x03, 0x13, 0x00, 0x02, 0x03, 0xB7, - 0x03, 0x14, 0x00, 0x02, 0x1F, 0x20, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x21, 0x03, 0x00, 0x00, 0x02, - 0x1F, 0x20, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x21, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x20, 0x03, 0x42, - 0x00, 0x02, 0x1F, 0x21, 0x03, 0x42, 0x00, 0x02, 0x03, 0x97, 0x03, 0x13, 0x00, 0x02, 0x03, 0x97, - 0x03, 0x14, 0x00, 0x02, 0x1F, 0x28, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x29, 0x03, 0x00, 0x00, 0x02, - 0x1F, 0x28, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x29, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x28, 0x03, 0x42, - 0x00, 0x02, 0x1F, 0x29, 0x03, 0x42, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x13, 0x00, 0x02, 0x03, 0xB9, - 0x03, 0x14, 0x00, 0x02, 0x1F, 0x30, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x31, 0x03, 0x00, 0x00, 0x02, - 0x1F, 0x30, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x31, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x30, 0x03, 0x42, - 0x00, 0x02, 0x1F, 0x31, 0x03, 0x42, 0x00, 0x02, 0x03, 0x99, 0x03, 0x13, 0x00, 0x02, 0x03, 0x99, - 0x03, 0x14, 0x00, 0x02, 0x1F, 0x38, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x39, 0x03, 0x00, 0x00, 0x02, - 0x1F, 0x38, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x39, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x38, 0x03, 0x42, - 0x00, 0x02, 0x1F, 0x39, 0x03, 0x42, 0x00, 0x02, 0x03, 0xBF, 0x03, 0x13, 0x00, 0x02, 0x03, 0xBF, - 0x03, 0x14, 0x00, 0x02, 0x1F, 0x40, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x41, 0x03, 0x00, 0x00, 0x02, - 0x1F, 0x40, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x41, 0x03, 0x01, 0x00, 0x02, 0x03, 0x9F, 0x03, 0x13, - 0x00, 0x02, 0x03, 0x9F, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x48, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x49, - 0x03, 0x00, 0x00, 0x02, 0x1F, 0x48, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x49, 0x03, 0x01, 0x00, 0x02, - 0x03, 0xC5, 0x03, 0x13, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x50, 0x03, 0x00, - 0x00, 0x02, 0x1F, 0x51, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x50, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x51, - 0x03, 0x01, 0x00, 0x02, 0x1F, 0x50, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x51, 0x03, 0x42, 0x00, 0x02, - 0x03, 0xA5, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x59, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x59, 0x03, 0x01, - 0x00, 0x02, 0x1F, 0x59, 0x03, 0x42, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x13, 0x00, 0x02, 0x03, 0xC9, - 0x03, 0x14, 0x00, 0x02, 0x1F, 0x60, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x61, 0x03, 0x00, 0x00, 0x02, - 0x1F, 0x60, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x61, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x60, 0x03, 0x42, - 0x00, 0x02, 0x1F, 0x61, 0x03, 0x42, 0x00, 0x02, 0x03, 0xA9, 0x03, 0x13, 0x00, 0x02, 0x03, 0xA9, - 0x03, 0x14, 0x00, 0x02, 0x1F, 0x68, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x69, 0x03, 0x00, 0x00, 0x02, - 0x1F, 0x68, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x69, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x68, 0x03, 0x42, - 0x00, 0x02, 0x1F, 0x69, 0x03, 0x42, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x00, 0x00, 0x02, 0x03, 0xB1, - 0x03, 0x01, 0x00, 0x02, 0x03, 0xB5, 0x03, 0x00, 0x00, 0x02, 0x03, 0xB5, 0x03, 0x01, 0x00, 0x02, - 0x03, 0xB7, 0x03, 0x00, 0x00, 0x02, 0x03, 0xB7, 0x03, 0x01, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x00, - 0x00, 0x02, 0x03, 0xB9, 0x03, 0x01, 0x00, 0x02, 0x03, 0xBF, 0x03, 0x00, 0x00, 0x02, 0x03, 0xBF, - 0x03, 0x01, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x00, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x01, 0x00, 0x02, - 0x03, 0xC9, 0x03, 0x00, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x00, 0x03, 0x45, - 0x00, 0x02, 0x1F, 0x01, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x02, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x03, - 0x03, 0x45, 0x00, 0x02, 0x1F, 0x04, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x05, 0x03, 0x45, 0x00, 0x02, - 0x1F, 0x06, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x07, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x08, 0x03, 0x45, - 0x00, 0x02, 0x1F, 0x09, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x0A, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x0B, - 0x03, 0x45, 0x00, 0x02, 0x1F, 0x0C, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x0D, 0x03, 0x45, 0x00, 0x02, - 0x1F, 0x0E, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x0F, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x20, 0x03, 0x45, - 0x00, 0x02, 0x1F, 0x21, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x22, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x23, - 0x03, 0x45, 0x00, 0x02, 0x1F, 0x24, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x25, 0x03, 0x45, 0x00, 0x02, - 0x1F, 0x26, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x27, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x28, 0x03, 0x45, - 0x00, 0x02, 0x1F, 0x29, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x2A, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x2B, - 0x03, 0x45, 0x00, 0x02, 0x1F, 0x2C, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x2D, 0x03, 0x45, 0x00, 0x02, - 0x1F, 0x2E, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x2F, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x60, 0x03, 0x45, - 0x00, 0x02, 0x1F, 0x61, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x62, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x63, - 0x03, 0x45, 0x00, 0x02, 0x1F, 0x64, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x65, 0x03, 0x45, 0x00, 0x02, - 0x1F, 0x66, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x67, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x68, 0x03, 0x45, - 0x00, 0x02, 0x1F, 0x69, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x6A, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x6B, - 0x03, 0x45, 0x00, 0x02, 0x1F, 0x6C, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x6D, 0x03, 0x45, 0x00, 0x02, - 0x1F, 0x6E, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x6F, 0x03, 0x45, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x06, - 0x00, 0x02, 0x03, 0xB1, 0x03, 0x04, 0x00, 0x02, 0x1F, 0x70, 0x03, 0x45, 0x00, 0x02, 0x03, 0xB1, - 0x03, 0x45, 0x00, 0x02, 0x03, 0xAC, 0x03, 0x45, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x42, 0x00, 0x02, - 0x1F, 0xB3, 0x03, 0x42, 0x00, 0x02, 0x03, 0x91, 0x03, 0x06, 0x00, 0x02, 0x03, 0x91, 0x03, 0x04, - 0x00, 0x02, 0x03, 0x91, 0x03, 0x00, 0x00, 0x02, 0x03, 0x91, 0x03, 0x01, 0x00, 0x02, 0x03, 0x91, - 0x03, 0x45, 0x00, 0x02, 0x00, 0xA8, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x74, 0x03, 0x45, 0x00, 0x02, - 0x03, 0xB7, 0x03, 0x45, 0x00, 0x02, 0x03, 0xAE, 0x03, 0x45, 0x00, 0x02, 0x03, 0xB7, 0x03, 0x42, - 0x00, 0x02, 0x1F, 0xC3, 0x03, 0x42, 0x00, 0x02, 0x03, 0x95, 0x03, 0x00, 0x00, 0x02, 0x03, 0x95, - 0x03, 0x01, 0x00, 0x02, 0x03, 0x97, 0x03, 0x00, 0x00, 0x02, 0x03, 0x97, 0x03, 0x01, 0x00, 0x02, - 0x03, 0x97, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xBF, 0x03, 0x00, 0x00, 0x02, 0x1F, 0xBF, 0x03, 0x01, - 0x00, 0x02, 0x1F, 0xBF, 0x03, 0x42, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x06, 0x00, 0x02, 0x03, 0xB9, - 0x03, 0x04, 0x00, 0x02, 0x03, 0xCA, 0x03, 0x00, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x44, 0x00, 0x02, - 0x03, 0xB9, 0x03, 0x42, 0x00, 0x02, 0x03, 0xCA, 0x03, 0x42, 0x00, 0x02, 0x03, 0x99, 0x03, 0x06, - 0x00, 0x02, 0x03, 0x99, 0x03, 0x04, 0x00, 0x02, 0x03, 0x99, 0x03, 0x00, 0x00, 0x02, 0x03, 0x99, - 0x03, 0x01, 0x00, 0x02, 0x1F, 0xFE, 0x03, 0x00, 0x00, 0x02, 0x1F, 0xFE, 0x03, 0x01, 0x00, 0x02, - 0x1F, 0xFE, 0x03, 0x42, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x06, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x04, - 0x00, 0x02, 0x03, 0xCB, 0x03, 0x00, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x44, 0x00, 0x02, 0x03, 0xC1, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x4C, 0x09, 0x66, 0x11, 0x1A, 0x17, 0x08, 0x1C, 0xC2, + 0x20, 0xBC, 0x24, 0x9E, 0x27, 0x3C, 0x29, 0x7A, 0x2B, 0x42, 0x2D, 0x22, 0x2E, 0xD2, 0x30, 0x80, + 0x31, 0xE8, 0x33, 0x50, 0x34, 0xB8, 0x35, 0x94, 0x36, 0x70, 0x37, 0x4C, 0x38, 0x1A, 0x38, 0xE8, + 0x39, 0xB6, 0x3A, 0x68, 0x3B, 0x1A, 0x3B, 0x40, 0x3B, 0x66, 0x3B, 0x8C, 0x3B, 0xB2, 0x3B, 0xD8, + 0x3B, 0xFE, 0x3C, 0x24, 0x3C, 0x4A, 0x3C, 0x70, 0x3C, 0x96, 0x3C, 0xBC, 0x00, 0x01, 0x07, 0x46, + 0x00, 0xE8, 0x01, 0xD6, 0x01, 0xDC, 0x01, 0xE2, 0x01, 0xE8, 0x01, 0xEE, 0x01, 0xF4, 0x01, 0xFA, + 0x02, 0x00, 0x02, 0x06, 0x02, 0x0C, 0x02, 0x12, 0x02, 0x18, 0x02, 0x1E, 0x02, 0x24, 0x02, 0x2A, + 0x02, 0x30, 0x02, 0x36, 0x02, 0x3C, 0x02, 0x42, 0x02, 0x48, 0x02, 0x4E, 0x02, 0x54, 0x02, 0x5A, + 0x02, 0x60, 0x02, 0x66, 0x02, 0x6C, 0x02, 0x72, 0x02, 0x78, 0x02, 0x7E, 0x02, 0x84, 0x02, 0x8A, + 0x02, 0x90, 0x02, 0x96, 0x02, 0x9C, 0x02, 0xA2, 0x02, 0xA8, 0x02, 0xAE, 0x02, 0xB4, 0x02, 0xBA, + 0x02, 0xC0, 0x02, 0xC6, 0x02, 0xCC, 0x02, 0xD2, 0x02, 0xD8, 0x02, 0xDE, 0x02, 0xE4, 0x02, 0xEA, + 0x02, 0xF0, 0x02, 0xF6, 0x02, 0xFC, 0x03, 0x02, 0x03, 0x08, 0x03, 0x0E, 0x03, 0x14, 0x03, 0x1A, + 0x03, 0x20, 0x03, 0x26, 0x03, 0x2C, 0x03, 0x32, 0x03, 0x38, 0x03, 0x3E, 0x03, 0x44, 0x03, 0x4A, + 0x03, 0x50, 0x03, 0x56, 0x03, 0x5C, 0x03, 0x62, 0x03, 0x68, 0x03, 0x6E, 0x03, 0x74, 0x03, 0x7A, + 0x03, 0x80, 0x03, 0x86, 0x03, 0x8C, 0x03, 0x92, 0x03, 0x98, 0x03, 0x9E, 0x03, 0xA4, 0x03, 0xAA, + 0x03, 0xB0, 0x03, 0xB6, 0x03, 0xBC, 0x03, 0xC2, 0x03, 0xC8, 0x03, 0xCE, 0x03, 0xD4, 0x03, 0xDA, + 0x03, 0xE0, 0x03, 0xE6, 0x03, 0xEC, 0x03, 0xF2, 0x03, 0xF8, 0x03, 0xFE, 0x04, 0x04, 0x04, 0x0A, + 0x04, 0x10, 0x04, 0x16, 0x04, 0x1C, 0x04, 0x22, 0x04, 0x28, 0x04, 0x2E, 0x04, 0x34, 0x04, 0x3A, + 0x04, 0x40, 0x04, 0x46, 0x04, 0x4C, 0x04, 0x52, 0x04, 0x58, 0x04, 0x5E, 0x04, 0x64, 0x04, 0x6A, + 0x04, 0x70, 0x04, 0x76, 0x04, 0x7C, 0x04, 0x82, 0x04, 0x88, 0x04, 0x8E, 0x04, 0x94, 0x04, 0x9A, + 0x04, 0xA0, 0x04, 0xA6, 0x04, 0xAC, 0x04, 0xB2, 0x04, 0xB8, 0x04, 0xBE, 0x04, 0xC4, 0x04, 0xCA, + 0x04, 0xD0, 0x04, 0xD6, 0x04, 0xDC, 0x04, 0xE2, 0x04, 0xE8, 0x04, 0xEE, 0x04, 0xF4, 0x04, 0xFA, + 0x05, 0x00, 0x05, 0x06, 0x05, 0x0C, 0x05, 0x12, 0x05, 0x18, 0x05, 0x1E, 0x05, 0x24, 0x05, 0x2A, + 0x05, 0x30, 0x05, 0x36, 0x05, 0x3C, 0x05, 0x42, 0x05, 0x48, 0x05, 0x4E, 0x05, 0x54, 0x05, 0x5A, + 0x05, 0x60, 0x05, 0x66, 0x05, 0x6C, 0x05, 0x72, 0x05, 0x78, 0x05, 0x7E, 0x05, 0x84, 0x05, 0x8A, + 0x05, 0x90, 0x05, 0x96, 0x05, 0x9C, 0x05, 0xA2, 0x05, 0xA8, 0x05, 0xAE, 0x05, 0xB4, 0x05, 0xBA, + 0x05, 0xC0, 0x05, 0xC6, 0x05, 0xCC, 0x05, 0xD2, 0x05, 0xD8, 0x05, 0xDE, 0x05, 0xE4, 0x05, 0xEA, + 0x05, 0xF0, 0x05, 0xF6, 0x05, 0xFC, 0x06, 0x02, 0x06, 0x08, 0x06, 0x0E, 0x06, 0x14, 0x06, 0x1A, + 0x06, 0x20, 0x06, 0x26, 0x06, 0x2C, 0x06, 0x32, 0x06, 0x38, 0x06, 0x3E, 0x06, 0x44, 0x06, 0x4A, + 0x06, 0x50, 0x06, 0x56, 0x06, 0x5C, 0x06, 0x62, 0x06, 0x68, 0x06, 0x6E, 0x06, 0x74, 0x06, 0x7A, + 0x06, 0x80, 0x06, 0x86, 0x06, 0x8C, 0x06, 0x92, 0x06, 0x98, 0x06, 0x9E, 0x06, 0xA4, 0x06, 0xAA, + 0x06, 0xB0, 0x06, 0xB6, 0x06, 0xBC, 0x06, 0xC2, 0x06, 0xC8, 0x06, 0xCE, 0x06, 0xD4, 0x06, 0xDA, + 0x06, 0xE0, 0x06, 0xE6, 0x06, 0xEC, 0x06, 0xF2, 0x06, 0xF8, 0x06, 0xFE, 0x07, 0x04, 0x07, 0x0A, + 0x07, 0x10, 0x07, 0x16, 0x07, 0x1C, 0x07, 0x22, 0x07, 0x28, 0x07, 0x2E, 0x07, 0x34, 0x07, 0x3A, + 0x07, 0x40, 0x00, 0x02, 0x00, 0xA8, 0x03, 0x01, 0x00, 0x02, 0x03, 0x91, 0x03, 0x01, 0x00, 0x02, + 0x03, 0x95, 0x03, 0x01, 0x00, 0x02, 0x03, 0x97, 0x03, 0x01, 0x00, 0x02, 0x03, 0x99, 0x03, 0x01, + 0x00, 0x02, 0x03, 0x9F, 0x03, 0x01, 0x00, 0x02, 0x03, 0xA5, 0x03, 0x01, 0x00, 0x02, 0x03, 0xA9, + 0x03, 0x01, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x44, 0x00, 0x02, 0x03, 0x99, 0x03, 0x08, 0x00, 0x02, + 0x03, 0xA5, 0x03, 0x08, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x01, 0x00, 0x02, 0x03, 0xB5, 0x03, 0x01, + 0x00, 0x02, 0x03, 0xB7, 0x03, 0x01, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x01, 0x00, 0x02, 0x03, 0xC5, + 0x03, 0x44, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x08, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x08, 0x00, 0x02, + 0x03, 0xBF, 0x03, 0x01, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x01, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x01, + 0x00, 0x02, 0x03, 0xD2, 0x03, 0x01, 0x00, 0x02, 0x03, 0xD2, 0x03, 0x08, 0x00, 0x02, 0x03, 0xB1, + 0x03, 0x13, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x00, 0x03, 0x00, 0x00, 0x02, + 0x1F, 0x01, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x00, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x01, 0x03, 0x01, + 0x00, 0x02, 0x1F, 0x00, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x01, 0x03, 0x42, 0x00, 0x02, 0x03, 0x91, + 0x03, 0x13, 0x00, 0x02, 0x03, 0x91, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x08, 0x03, 0x00, 0x00, 0x02, + 0x1F, 0x09, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x08, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x09, 0x03, 0x01, + 0x00, 0x02, 0x1F, 0x08, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x09, 0x03, 0x42, 0x00, 0x02, 0x03, 0xB5, + 0x03, 0x13, 0x00, 0x02, 0x03, 0xB5, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x10, 0x03, 0x00, 0x00, 0x02, + 0x1F, 0x11, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x10, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x11, 0x03, 0x01, + 0x00, 0x02, 0x03, 0x95, 0x03, 0x13, 0x00, 0x02, 0x03, 0x95, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x18, + 0x03, 0x00, 0x00, 0x02, 0x1F, 0x19, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x18, 0x03, 0x01, 0x00, 0x02, + 0x1F, 0x19, 0x03, 0x01, 0x00, 0x02, 0x03, 0xB7, 0x03, 0x13, 0x00, 0x02, 0x03, 0xB7, 0x03, 0x14, + 0x00, 0x02, 0x1F, 0x20, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x21, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x20, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0x21, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x20, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0x21, 0x03, 0x42, 0x00, 0x02, 0x03, 0x97, 0x03, 0x13, 0x00, 0x02, 0x03, 0x97, 0x03, 0x14, + 0x00, 0x02, 0x1F, 0x28, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x29, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x28, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0x29, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x28, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0x29, 0x03, 0x42, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x13, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x14, + 0x00, 0x02, 0x1F, 0x30, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x31, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x30, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0x31, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x30, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0x31, 0x03, 0x42, 0x00, 0x02, 0x03, 0x99, 0x03, 0x13, 0x00, 0x02, 0x03, 0x99, 0x03, 0x14, + 0x00, 0x02, 0x1F, 0x38, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x39, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x38, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0x39, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x38, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0x39, 0x03, 0x42, 0x00, 0x02, 0x03, 0xBF, 0x03, 0x13, 0x00, 0x02, 0x03, 0xBF, 0x03, 0x14, + 0x00, 0x02, 0x1F, 0x40, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x41, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x40, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0x41, 0x03, 0x01, 0x00, 0x02, 0x03, 0x9F, 0x03, 0x13, 0x00, 0x02, + 0x03, 0x9F, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x48, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x49, 0x03, 0x00, + 0x00, 0x02, 0x1F, 0x48, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x49, 0x03, 0x01, 0x00, 0x02, 0x03, 0xC5, + 0x03, 0x13, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x50, 0x03, 0x00, 0x00, 0x02, + 0x1F, 0x51, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x50, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x51, 0x03, 0x01, + 0x00, 0x02, 0x1F, 0x50, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x51, 0x03, 0x42, 0x00, 0x02, 0x03, 0xA5, + 0x03, 0x14, 0x00, 0x02, 0x1F, 0x59, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x59, 0x03, 0x01, 0x00, 0x02, + 0x1F, 0x59, 0x03, 0x42, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x13, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x14, + 0x00, 0x02, 0x1F, 0x60, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x61, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x60, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0x61, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x60, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0x61, 0x03, 0x42, 0x00, 0x02, 0x03, 0xA9, 0x03, 0x13, 0x00, 0x02, 0x03, 0xA9, 0x03, 0x14, + 0x00, 0x02, 0x1F, 0x68, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x69, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x68, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0x69, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x68, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0x69, 0x03, 0x42, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x00, 0x00, 0x02, 0x03, 0xB5, 0x03, 0x00, + 0x00, 0x02, 0x03, 0xB7, 0x03, 0x00, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x00, 0x00, 0x02, 0x03, 0xBF, + 0x03, 0x00, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x00, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x00, 0x00, 0x02, + 0x1F, 0x00, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x01, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x02, 0x03, 0x45, + 0x00, 0x02, 0x1F, 0x03, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x04, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x05, + 0x03, 0x45, 0x00, 0x02, 0x1F, 0x06, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x07, 0x03, 0x45, 0x00, 0x02, + 0x1F, 0x08, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x09, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x0A, 0x03, 0x45, + 0x00, 0x02, 0x1F, 0x0B, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x0C, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x0D, + 0x03, 0x45, 0x00, 0x02, 0x1F, 0x0E, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x0F, 0x03, 0x45, 0x00, 0x02, + 0x1F, 0x20, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x21, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x22, 0x03, 0x45, + 0x00, 0x02, 0x1F, 0x23, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x24, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x25, + 0x03, 0x45, 0x00, 0x02, 0x1F, 0x26, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x27, 0x03, 0x45, 0x00, 0x02, + 0x1F, 0x28, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x29, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x2A, 0x03, 0x45, + 0x00, 0x02, 0x1F, 0x2B, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x2C, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x2D, + 0x03, 0x45, 0x00, 0x02, 0x1F, 0x2E, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x2F, 0x03, 0x45, 0x00, 0x02, + 0x1F, 0x60, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x61, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x62, 0x03, 0x45, + 0x00, 0x02, 0x1F, 0x63, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x64, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x65, + 0x03, 0x45, 0x00, 0x02, 0x1F, 0x66, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x67, 0x03, 0x45, 0x00, 0x02, + 0x1F, 0x68, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x69, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x6A, 0x03, 0x45, + 0x00, 0x02, 0x1F, 0x6B, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x6C, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x6D, + 0x03, 0x45, 0x00, 0x02, 0x1F, 0x6E, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x6F, 0x03, 0x45, 0x00, 0x02, + 0x03, 0xB1, 0x03, 0x06, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x04, 0x00, 0x02, 0x1F, 0x70, 0x03, 0x45, + 0x00, 0x02, 0x03, 0xB1, 0x03, 0x45, 0x00, 0x02, 0x03, 0xAC, 0x03, 0x45, 0x00, 0x02, 0x03, 0xB1, + 0x03, 0x42, 0x00, 0x02, 0x1F, 0xB3, 0x03, 0x42, 0x00, 0x02, 0x03, 0x91, 0x03, 0x06, 0x00, 0x02, + 0x03, 0x91, 0x03, 0x04, 0x00, 0x02, 0x03, 0x91, 0x03, 0x00, 0x00, 0x02, 0x03, 0x91, 0x03, 0x45, + 0x00, 0x02, 0x00, 0xA8, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x74, 0x03, 0x45, 0x00, 0x02, 0x03, 0xB7, + 0x03, 0x45, 0x00, 0x02, 0x03, 0xAE, 0x03, 0x45, 0x00, 0x02, 0x03, 0xB7, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0xC3, 0x03, 0x42, 0x00, 0x02, 0x03, 0x95, 0x03, 0x00, 0x00, 0x02, 0x03, 0x97, 0x03, 0x00, + 0x00, 0x02, 0x03, 0x97, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xBF, 0x03, 0x00, 0x00, 0x02, 0x1F, 0xBF, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0xBF, 0x03, 0x42, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x06, 0x00, 0x02, + 0x03, 0xB9, 0x03, 0x04, 0x00, 0x02, 0x03, 0xCA, 0x03, 0x00, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x42, + 0x00, 0x02, 0x03, 0xCA, 0x03, 0x42, 0x00, 0x02, 0x03, 0x99, 0x03, 0x06, 0x00, 0x02, 0x03, 0x99, + 0x03, 0x04, 0x00, 0x02, 0x03, 0x99, 0x03, 0x00, 0x00, 0x02, 0x1F, 0xFE, 0x03, 0x00, 0x00, 0x02, + 0x1F, 0xFE, 0x03, 0x01, 0x00, 0x02, 0x1F, 0xFE, 0x03, 0x42, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x06, + 0x00, 0x02, 0x03, 0xC5, 0x03, 0x04, 0x00, 0x02, 0x03, 0xCB, 0x03, 0x00, 0x00, 0x02, 0x03, 0xC1, 0x03, 0x13, 0x00, 0x02, 0x03, 0xC1, 0x03, 0x14, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x42, 0x00, 0x02, 0x03, 0xCB, 0x03, 0x42, 0x00, 0x02, 0x03, 0xA5, 0x03, 0x06, 0x00, 0x02, 0x03, 0xA5, 0x03, 0x04, - 0x00, 0x02, 0x03, 0xA5, 0x03, 0x00, 0x00, 0x02, 0x03, 0xA5, 0x03, 0x01, 0x00, 0x02, 0x03, 0xA1, - 0x03, 0x14, 0x00, 0x02, 0x00, 0xA8, 0x03, 0x00, 0x00, 0x02, 0x00, 0xA8, 0x03, 0x01, 0x00, 0x02, - 0x1F, 0x7C, 0x03, 0x45, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x45, 0x00, 0x02, 0x03, 0xCE, 0x03, 0x45, - 0x00, 0x02, 0x03, 0xC9, 0x03, 0x42, 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x42, 0x00, 0x02, 0x03, 0x9F, - 0x03, 0x00, 0x00, 0x02, 0x03, 0x9F, 0x03, 0x01, 0x00, 0x02, 0x03, 0xA9, 0x03, 0x00, 0x00, 0x02, - 0x03, 0xA9, 0x03, 0x01, 0x00, 0x02, 0x03, 0xA9, 0x03, 0x45, 0x00, 0x01, 0x00, 0xF9, 0x03, 0x85, - 0x03, 0x86, 0x03, 0x88, 0x03, 0x89, 0x03, 0x8A, 0x03, 0x8C, 0x03, 0x8E, 0x03, 0x8F, 0x03, 0x90, - 0x03, 0xAA, 0x03, 0xAB, 0x03, 0xAC, 0x03, 0xAD, 0x03, 0xAE, 0x03, 0xAF, 0x03, 0xB0, 0x03, 0xCA, - 0x03, 0xCB, 0x03, 0xCC, 0x03, 0xCD, 0x03, 0xCE, 0x03, 0xD3, 0x03, 0xD4, 0x1F, 0x00, 0x1F, 0x01, - 0x1F, 0x02, 0x1F, 0x03, 0x1F, 0x04, 0x1F, 0x05, 0x1F, 0x06, 0x1F, 0x07, 0x1F, 0x08, 0x1F, 0x09, - 0x1F, 0x0A, 0x1F, 0x0B, 0x1F, 0x0C, 0x1F, 0x0D, 0x1F, 0x0E, 0x1F, 0x0F, 0x1F, 0x10, 0x1F, 0x11, - 0x1F, 0x12, 0x1F, 0x13, 0x1F, 0x14, 0x1F, 0x15, 0x1F, 0x18, 0x1F, 0x19, 0x1F, 0x1A, 0x1F, 0x1B, - 0x1F, 0x1C, 0x1F, 0x1D, 0x1F, 0x20, 0x1F, 0x21, 0x1F, 0x22, 0x1F, 0x23, 0x1F, 0x24, 0x1F, 0x25, - 0x1F, 0x26, 0x1F, 0x27, 0x1F, 0x28, 0x1F, 0x29, 0x1F, 0x2A, 0x1F, 0x2B, 0x1F, 0x2C, 0x1F, 0x2D, - 0x1F, 0x2E, 0x1F, 0x2F, 0x1F, 0x30, 0x1F, 0x31, 0x1F, 0x32, 0x1F, 0x33, 0x1F, 0x34, 0x1F, 0x35, - 0x1F, 0x36, 0x1F, 0x37, 0x1F, 0x38, 0x1F, 0x39, 0x1F, 0x3A, 0x1F, 0x3B, 0x1F, 0x3C, 0x1F, 0x3D, - 0x1F, 0x3E, 0x1F, 0x3F, 0x1F, 0x40, 0x1F, 0x41, 0x1F, 0x42, 0x1F, 0x43, 0x1F, 0x44, 0x1F, 0x45, - 0x1F, 0x48, 0x1F, 0x49, 0x1F, 0x4A, 0x1F, 0x4B, 0x1F, 0x4C, 0x1F, 0x4D, 0x1F, 0x50, 0x1F, 0x51, - 0x1F, 0x52, 0x1F, 0x53, 0x1F, 0x54, 0x1F, 0x55, 0x1F, 0x56, 0x1F, 0x57, 0x1F, 0x59, 0x1F, 0x5B, - 0x1F, 0x5D, 0x1F, 0x5F, 0x1F, 0x60, 0x1F, 0x61, 0x1F, 0x62, 0x1F, 0x63, 0x1F, 0x64, 0x1F, 0x65, - 0x1F, 0x66, 0x1F, 0x67, 0x1F, 0x68, 0x1F, 0x69, 0x1F, 0x6A, 0x1F, 0x6B, 0x1F, 0x6C, 0x1F, 0x6D, - 0x1F, 0x6E, 0x1F, 0x6F, 0x1F, 0x70, 0x1F, 0x71, 0x1F, 0x72, 0x1F, 0x73, 0x1F, 0x74, 0x1F, 0x75, - 0x1F, 0x76, 0x1F, 0x77, 0x1F, 0x78, 0x1F, 0x79, 0x1F, 0x7A, 0x1F, 0x7B, 0x1F, 0x7C, 0x1F, 0x7D, - 0x1F, 0x80, 0x1F, 0x81, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x87, - 0x1F, 0x88, 0x1F, 0x89, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x8F, - 0x1F, 0x90, 0x1F, 0x91, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, 0x1F, 0x97, - 0x1F, 0x98, 0x1F, 0x99, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0x9F, - 0x1F, 0xA0, 0x1F, 0xA1, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA7, - 0x1F, 0xA8, 0x1F, 0xA9, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x1F, 0xAF, - 0x1F, 0xB0, 0x1F, 0xB1, 0x1F, 0xB2, 0x1F, 0xB3, 0x1F, 0xB4, 0x1F, 0xB6, 0x1F, 0xB7, 0x1F, 0xB8, - 0x1F, 0xB9, 0x1F, 0xBA, 0x1F, 0xBB, 0x1F, 0xBC, 0x1F, 0xC1, 0x1F, 0xC2, 0x1F, 0xC3, 0x1F, 0xC4, - 0x1F, 0xC6, 0x1F, 0xC7, 0x1F, 0xC8, 0x1F, 0xC9, 0x1F, 0xCA, 0x1F, 0xCB, 0x1F, 0xCC, 0x1F, 0xCD, - 0x1F, 0xCE, 0x1F, 0xCF, 0x1F, 0xD0, 0x1F, 0xD1, 0x1F, 0xD2, 0x1F, 0xD3, 0x1F, 0xD6, 0x1F, 0xD7, - 0x1F, 0xD8, 0x1F, 0xD9, 0x1F, 0xDA, 0x1F, 0xDB, 0x1F, 0xDD, 0x1F, 0xDE, 0x1F, 0xDF, 0x1F, 0xE0, - 0x1F, 0xE1, 0x1F, 0xE2, 0x1F, 0xE3, 0x1F, 0xE4, 0x1F, 0xE5, 0x1F, 0xE6, 0x1F, 0xE7, 0x1F, 0xE8, - 0x1F, 0xE9, 0x1F, 0xEA, 0x1F, 0xEB, 0x1F, 0xEC, 0x1F, 0xED, 0x1F, 0xEE, 0x1F, 0xF2, 0x1F, 0xF3, - 0x1F, 0xF4, 0x1F, 0xF6, 0x1F, 0xF7, 0x1F, 0xF8, 0x1F, 0xF9, 0x1F, 0xFA, 0x1F, 0xFB, 0x1F, 0xFC, - 0x00, 0x01, 0x06, 0xB8, 0x00, 0xD1, 0x01, 0xA8, 0x01, 0xAE, 0x01, 0xB4, 0x01, 0xBA, 0x01, 0xC0, - 0x01, 0xC6, 0x01, 0xCC, 0x01, 0xD2, 0x01, 0xD8, 0x01, 0xDE, 0x01, 0xE4, 0x01, 0xEA, 0x01, 0xF0, - 0x01, 0xF6, 0x01, 0xFC, 0x02, 0x02, 0x02, 0x08, 0x02, 0x0E, 0x02, 0x14, 0x02, 0x1A, 0x02, 0x20, - 0x02, 0x26, 0x02, 0x2C, 0x02, 0x32, 0x02, 0x38, 0x02, 0x40, 0x02, 0x48, 0x02, 0x4E, 0x02, 0x54, - 0x02, 0x5A, 0x02, 0x60, 0x02, 0x66, 0x02, 0x6E, 0x02, 0x76, 0x02, 0x7C, 0x02, 0x82, 0x02, 0x88, - 0x02, 0x8E, 0x02, 0x94, 0x02, 0x9A, 0x02, 0xA0, 0x02, 0xA6, 0x02, 0xAC, 0x02, 0xB2, 0x02, 0xB8, - 0x02, 0xBE, 0x02, 0xC4, 0x02, 0xCA, 0x02, 0xD0, 0x02, 0xD8, 0x02, 0xE0, 0x02, 0xE6, 0x02, 0xEC, - 0x02, 0xF2, 0x02, 0xF8, 0x02, 0xFE, 0x03, 0x06, 0x03, 0x0E, 0x03, 0x14, 0x03, 0x1A, 0x03, 0x20, - 0x03, 0x26, 0x03, 0x2C, 0x03, 0x32, 0x03, 0x3A, 0x03, 0x42, 0x03, 0x48, 0x03, 0x4E, 0x03, 0x54, - 0x03, 0x5A, 0x03, 0x60, 0x03, 0x68, 0x03, 0x70, 0x03, 0x76, 0x03, 0x7C, 0x03, 0x82, 0x03, 0x88, - 0x03, 0x8E, 0x03, 0x94, 0x03, 0x9A, 0x03, 0xA0, 0x03, 0xA6, 0x03, 0xAC, 0x03, 0xB2, 0x03, 0xB8, - 0x03, 0xBE, 0x03, 0xC4, 0x03, 0xCA, 0x03, 0xD2, 0x03, 0xDA, 0x03, 0xE0, 0x03, 0xE6, 0x03, 0xEE, - 0x03, 0xF4, 0x03, 0xFA, 0x04, 0x00, 0x04, 0x06, 0x04, 0x0C, 0x04, 0x14, 0x04, 0x1C, 0x04, 0x22, - 0x04, 0x28, 0x04, 0x2E, 0x04, 0x34, 0x04, 0x3A, 0x04, 0x40, 0x04, 0x48, 0x04, 0x50, 0x04, 0x56, - 0x04, 0x5C, 0x04, 0x62, 0x04, 0x68, 0x04, 0x6E, 0x04, 0x74, 0x04, 0x7A, 0x04, 0x80, 0x04, 0x86, - 0x04, 0x8C, 0x04, 0x92, 0x04, 0x98, 0x04, 0x9E, 0x04, 0xA4, 0x04, 0xAA, 0x04, 0xB0, 0x04, 0xB6, - 0x04, 0xBC, 0x04, 0xC2, 0x04, 0xC8, 0x04, 0xCE, 0x04, 0xD4, 0x04, 0xDA, 0x04, 0xE0, 0x04, 0xE6, - 0x04, 0xEC, 0x04, 0xF2, 0x04, 0xF8, 0x04, 0xFE, 0x05, 0x04, 0x05, 0x0A, 0x05, 0x10, 0x05, 0x16, - 0x05, 0x1C, 0x05, 0x22, 0x05, 0x28, 0x05, 0x2E, 0x05, 0x34, 0x05, 0x3A, 0x05, 0x40, 0x05, 0x46, - 0x05, 0x4C, 0x05, 0x52, 0x05, 0x58, 0x05, 0x5E, 0x05, 0x64, 0x05, 0x6A, 0x05, 0x70, 0x05, 0x76, - 0x05, 0x7C, 0x05, 0x82, 0x05, 0x88, 0x05, 0x8E, 0x05, 0x94, 0x05, 0x9A, 0x05, 0xA0, 0x05, 0xA6, - 0x05, 0xAC, 0x05, 0xB2, 0x05, 0xB8, 0x05, 0xBE, 0x05, 0xC4, 0x05, 0xCA, 0x05, 0xD0, 0x05, 0xD6, - 0x05, 0xDC, 0x05, 0xE2, 0x05, 0xE8, 0x05, 0xEE, 0x05, 0xF4, 0x05, 0xFA, 0x06, 0x00, 0x06, 0x06, - 0x06, 0x0C, 0x06, 0x12, 0x06, 0x18, 0x06, 0x1E, 0x06, 0x24, 0x06, 0x2A, 0x06, 0x30, 0x06, 0x36, - 0x06, 0x3E, 0x06, 0x44, 0x06, 0x4A, 0x06, 0x50, 0x06, 0x56, 0x06, 0x5C, 0x06, 0x62, 0x06, 0x68, - 0x06, 0x70, 0x06, 0x76, 0x06, 0x7C, 0x06, 0x82, 0x06, 0x88, 0x06, 0x8E, 0x06, 0x94, 0x06, 0x9A, - 0x06, 0xA0, 0x06, 0xA6, 0x06, 0xAC, 0x06, 0xB2, 0x00, 0x02, 0x00, 0xA8, 0x03, 0x41, 0x00, 0x02, - 0x03, 0x91, 0x03, 0x41, 0x00, 0x02, 0x03, 0x95, 0x03, 0x41, 0x00, 0x02, 0x03, 0x97, 0x03, 0x41, - 0x00, 0x02, 0x03, 0x99, 0x03, 0x41, 0x00, 0x02, 0x03, 0x9F, 0x03, 0x41, 0x00, 0x02, 0x03, 0xA5, - 0x03, 0x41, 0x00, 0x02, 0x03, 0xA9, 0x03, 0x41, 0x00, 0x02, 0x03, 0xCA, 0x03, 0x01, 0x00, 0x02, - 0x03, 0xB1, 0x03, 0x41, 0x00, 0x02, 0x03, 0xB5, 0x03, 0x41, 0x00, 0x02, 0x03, 0xB7, 0x03, 0x41, - 0x00, 0x02, 0x03, 0xB9, 0x03, 0x41, 0x00, 0x02, 0x03, 0xCB, 0x03, 0x01, 0x00, 0x02, 0x1F, 0xBE, - 0x03, 0x08, 0x00, 0x02, 0x03, 0xBF, 0x03, 0x41, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x41, 0x00, 0x02, - 0x03, 0xC9, 0x03, 0x41, 0x00, 0x02, 0x03, 0xD2, 0x03, 0x41, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x43, - 0x00, 0x02, 0x1F, 0x00, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x01, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x00, - 0x03, 0x41, 0x00, 0x02, 0x1F, 0x01, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x42, - 0x00, 0x03, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, 0x03, 0x91, 0x03, 0x43, 0x00, 0x02, - 0x1F, 0x08, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x09, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x08, 0x03, 0x41, - 0x00, 0x02, 0x1F, 0x09, 0x03, 0x41, 0x00, 0x03, 0x03, 0x91, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, - 0x03, 0x91, 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, 0x03, 0xB5, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x10, - 0x03, 0x40, 0x00, 0x02, 0x1F, 0x11, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x10, 0x03, 0x41, 0x00, 0x02, - 0x1F, 0x11, 0x03, 0x41, 0x00, 0x02, 0x03, 0x95, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x18, 0x03, 0x40, - 0x00, 0x02, 0x1F, 0x19, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x18, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x19, - 0x03, 0x41, 0x00, 0x02, 0x03, 0xB7, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x20, 0x03, 0x40, 0x00, 0x02, - 0x1F, 0x21, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x20, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x21, 0x03, 0x41, - 0x00, 0x03, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x42, - 0x00, 0x02, 0x03, 0x97, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x28, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x29, - 0x03, 0x40, 0x00, 0x02, 0x1F, 0x28, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x29, 0x03, 0x41, 0x00, 0x03, - 0x03, 0x97, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0x97, 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, - 0x03, 0xB9, 0x03, 0x43, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x30, 0x03, 0x40, - 0x00, 0x02, 0x1F, 0x31, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x30, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x31, - 0x03, 0x41, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x14, - 0x03, 0x42, 0x00, 0x02, 0x03, 0x99, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x38, 0x03, 0x40, 0x00, 0x02, - 0x1F, 0x39, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x38, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x39, 0x03, 0x41, - 0x00, 0x03, 0x03, 0x99, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0x99, 0x03, 0x14, 0x03, 0x42, - 0x00, 0x02, 0x03, 0xBF, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x40, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x41, - 0x03, 0x40, 0x00, 0x02, 0x1F, 0x40, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x41, 0x03, 0x41, 0x00, 0x02, - 0x03, 0x9F, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x48, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x49, 0x03, 0x40, - 0x00, 0x02, 0x1F, 0x48, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x49, 0x03, 0x41, 0x00, 0x02, 0x03, 0xC5, - 0x03, 0x43, 0x00, 0x02, 0x1F, 0x50, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x51, 0x03, 0x40, 0x00, 0x02, - 0x1F, 0x50, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x51, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x13, - 0x03, 0x42, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x59, 0x03, 0x40, - 0x00, 0x02, 0x1F, 0x59, 0x03, 0x41, 0x00, 0x03, 0x03, 0xA5, 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, - 0x03, 0xC9, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x60, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x61, 0x03, 0x40, - 0x00, 0x02, 0x1F, 0x60, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x61, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC9, - 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, 0x03, 0xA9, - 0x03, 0x43, 0x00, 0x02, 0x21, 0x26, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x68, 0x03, 0x40, 0x00, 0x02, - 0x1F, 0x69, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x68, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x69, 0x03, 0x41, - 0x00, 0x03, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x42, - 0x00, 0x02, 0x03, 0xB1, 0x03, 0x40, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x41, 0x00, 0x02, 0x03, 0xB5, - 0x03, 0x40, 0x00, 0x02, 0x03, 0xB5, 0x03, 0x41, 0x00, 0x02, 0x03, 0xB7, 0x03, 0x40, 0x00, 0x02, - 0x03, 0xB7, 0x03, 0x41, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x40, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x41, - 0x00, 0x02, 0x03, 0xBF, 0x03, 0x40, 0x00, 0x02, 0x03, 0xBF, 0x03, 0x41, 0x00, 0x02, 0x03, 0xC5, - 0x03, 0x40, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x41, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x40, 0x00, 0x02, - 0x03, 0xC9, 0x03, 0x41, 0x00, 0x02, 0x1F, 0xB3, 0x03, 0x13, 0x00, 0x02, 0x1F, 0xB3, 0x03, 0x14, - 0x00, 0x02, 0x1F, 0x80, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x81, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x80, - 0x03, 0x01, 0x00, 0x02, 0x1F, 0x81, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x80, 0x03, 0x42, 0x00, 0x02, - 0x1F, 0x81, 0x03, 0x42, 0x00, 0x02, 0x1F, 0xBC, 0x03, 0x13, 0x00, 0x02, 0x1F, 0xBC, 0x03, 0x14, - 0x00, 0x02, 0x1F, 0x88, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x89, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x88, - 0x03, 0x01, 0x00, 0x02, 0x1F, 0x89, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x88, 0x03, 0x42, 0x00, 0x02, - 0x1F, 0x89, 0x03, 0x42, 0x00, 0x02, 0x1F, 0xC3, 0x03, 0x13, 0x00, 0x02, 0x1F, 0xC3, 0x03, 0x14, - 0x00, 0x02, 0x1F, 0x90, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x91, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x90, - 0x03, 0x01, 0x00, 0x02, 0x1F, 0x91, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x90, 0x03, 0x42, 0x00, 0x02, - 0x1F, 0x91, 0x03, 0x42, 0x00, 0x02, 0x1F, 0xCC, 0x03, 0x13, 0x00, 0x02, 0x1F, 0xCC, 0x03, 0x14, - 0x00, 0x02, 0x1F, 0x98, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x99, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x98, - 0x03, 0x01, 0x00, 0x02, 0x1F, 0x99, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x98, 0x03, 0x42, 0x00, 0x02, - 0x1F, 0x99, 0x03, 0x42, 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x13, 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x14, - 0x00, 0x02, 0x1F, 0xA0, 0x03, 0x00, 0x00, 0x02, 0x1F, 0xA1, 0x03, 0x00, 0x00, 0x02, 0x1F, 0xA0, - 0x03, 0x01, 0x00, 0x02, 0x1F, 0xA1, 0x03, 0x01, 0x00, 0x02, 0x1F, 0xA0, 0x03, 0x42, 0x00, 0x02, - 0x1F, 0xA1, 0x03, 0x42, 0x00, 0x02, 0x1F, 0xFC, 0x03, 0x13, 0x00, 0x02, 0x1F, 0xFC, 0x03, 0x14, - 0x00, 0x02, 0x1F, 0xA8, 0x03, 0x00, 0x00, 0x02, 0x1F, 0xA9, 0x03, 0x00, 0x00, 0x02, 0x1F, 0xA8, - 0x03, 0x01, 0x00, 0x02, 0x1F, 0xA9, 0x03, 0x01, 0x00, 0x02, 0x1F, 0xA8, 0x03, 0x42, 0x00, 0x02, - 0x1F, 0xA9, 0x03, 0x42, 0x00, 0x02, 0x1F, 0xB3, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x71, 0x03, 0x45, - 0x00, 0x02, 0x1F, 0xB6, 0x03, 0x45, 0x00, 0x02, 0x03, 0x91, 0x03, 0x40, 0x00, 0x02, 0x03, 0x91, - 0x03, 0x41, 0x00, 0x02, 0x1F, 0xC3, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x75, 0x03, 0x45, 0x00, 0x02, - 0x1F, 0xC6, 0x03, 0x45, 0x00, 0x02, 0x03, 0x95, 0x03, 0x40, 0x00, 0x02, 0x03, 0x95, 0x03, 0x41, - 0x00, 0x02, 0x03, 0x97, 0x03, 0x40, 0x00, 0x02, 0x03, 0x97, 0x03, 0x41, 0x00, 0x02, 0x1F, 0xBF, - 0x03, 0x40, 0x00, 0x02, 0x1F, 0xBF, 0x03, 0x41, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x06, 0x00, 0x02, - 0x1F, 0xBE, 0x03, 0x04, 0x00, 0x02, 0x03, 0xCA, 0x03, 0x40, 0x00, 0x02, 0x03, 0xCA, 0x03, 0x01, - 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x08, 0x03, 0x42, 0x00, 0x02, - 0x03, 0x99, 0x03, 0x40, 0x00, 0x02, 0x03, 0x99, 0x03, 0x41, 0x00, 0x02, 0x1F, 0xFE, 0x03, 0x40, - 0x00, 0x02, 0x1F, 0xFE, 0x03, 0x41, 0x00, 0x02, 0x03, 0xCB, 0x03, 0x40, 0x00, 0x02, 0x03, 0xCB, - 0x03, 0x01, 0x00, 0x02, 0x03, 0xC1, 0x03, 0x43, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x08, 0x03, 0x42, - 0x00, 0x02, 0x03, 0xA5, 0x03, 0x40, 0x00, 0x02, 0x03, 0xA5, 0x03, 0x41, 0x00, 0x02, 0x00, 0xA8, - 0x03, 0x40, 0x00, 0x02, 0x00, 0xA8, 0x03, 0x41, 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x00, 0x00, 0x02, - 0x1F, 0x7D, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xF6, 0x03, 0x45, 0x00, 0x02, 0x03, 0x9F, 0x03, 0x40, - 0x00, 0x02, 0x03, 0x9F, 0x03, 0x41, 0x00, 0x02, 0x03, 0xA9, 0x03, 0x40, 0x00, 0x02, 0x03, 0xA9, - 0x03, 0x41, 0x00, 0x02, 0x21, 0x26, 0x03, 0x45, 0x00, 0x01, 0x00, 0xD1, 0x03, 0x85, 0x03, 0x86, - 0x03, 0x88, 0x03, 0x89, 0x03, 0x8A, 0x03, 0x8C, 0x03, 0x8E, 0x03, 0x8F, 0x03, 0x90, 0x03, 0xAC, - 0x03, 0xAD, 0x03, 0xAE, 0x03, 0xAF, 0x03, 0xB0, 0x03, 0xCA, 0x03, 0xCC, 0x03, 0xCD, 0x03, 0xCE, - 0x03, 0xD3, 0x1F, 0x00, 0x1F, 0x02, 0x1F, 0x03, 0x1F, 0x04, 0x1F, 0x05, 0x1F, 0x06, 0x1F, 0x07, - 0x1F, 0x08, 0x1F, 0x0A, 0x1F, 0x0B, 0x1F, 0x0C, 0x1F, 0x0D, 0x1F, 0x0E, 0x1F, 0x0F, 0x1F, 0x10, - 0x1F, 0x12, 0x1F, 0x13, 0x1F, 0x14, 0x1F, 0x15, 0x1F, 0x18, 0x1F, 0x1A, 0x1F, 0x1B, 0x1F, 0x1C, - 0x1F, 0x1D, 0x1F, 0x20, 0x1F, 0x22, 0x1F, 0x23, 0x1F, 0x24, 0x1F, 0x25, 0x1F, 0x26, 0x1F, 0x27, - 0x1F, 0x28, 0x1F, 0x2A, 0x1F, 0x2B, 0x1F, 0x2C, 0x1F, 0x2D, 0x1F, 0x2E, 0x1F, 0x2F, 0x1F, 0x30, - 0x1F, 0x31, 0x1F, 0x32, 0x1F, 0x33, 0x1F, 0x34, 0x1F, 0x35, 0x1F, 0x36, 0x1F, 0x37, 0x1F, 0x38, - 0x1F, 0x3A, 0x1F, 0x3B, 0x1F, 0x3C, 0x1F, 0x3D, 0x1F, 0x3E, 0x1F, 0x3F, 0x1F, 0x40, 0x1F, 0x42, - 0x1F, 0x43, 0x1F, 0x44, 0x1F, 0x45, 0x1F, 0x48, 0x1F, 0x4A, 0x1F, 0x4B, 0x1F, 0x4C, 0x1F, 0x4D, - 0x1F, 0x50, 0x1F, 0x52, 0x1F, 0x53, 0x1F, 0x54, 0x1F, 0x55, 0x1F, 0x56, 0x1F, 0x57, 0x1F, 0x5B, - 0x1F, 0x5D, 0x1F, 0x5F, 0x1F, 0x60, 0x1F, 0x62, 0x1F, 0x63, 0x1F, 0x64, 0x1F, 0x65, 0x1F, 0x66, - 0x1F, 0x67, 0x1F, 0x68, 0x1F, 0x69, 0x1F, 0x6A, 0x1F, 0x6B, 0x1F, 0x6C, 0x1F, 0x6D, 0x1F, 0x6E, - 0x1F, 0x6F, 0x1F, 0x70, 0x1F, 0x71, 0x1F, 0x72, 0x1F, 0x73, 0x1F, 0x74, 0x1F, 0x75, 0x1F, 0x76, - 0x1F, 0x77, 0x1F, 0x78, 0x1F, 0x79, 0x1F, 0x7A, 0x1F, 0x7B, 0x1F, 0x7C, 0x1F, 0x7D, 0x1F, 0x80, + 0x00, 0x02, 0x03, 0xA5, 0x03, 0x00, 0x00, 0x02, 0x03, 0xA1, 0x03, 0x14, 0x00, 0x02, 0x00, 0xA8, + 0x03, 0x00, 0x00, 0x02, 0x1F, 0x7C, 0x03, 0x45, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x45, 0x00, 0x02, + 0x03, 0xCE, 0x03, 0x45, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x42, 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x42, + 0x00, 0x02, 0x03, 0x9F, 0x03, 0x00, 0x00, 0x02, 0x03, 0xA9, 0x03, 0x00, 0x00, 0x02, 0x03, 0xA9, + 0x03, 0x45, 0x00, 0x01, 0x00, 0xE8, 0x03, 0x85, 0x03, 0x86, 0x03, 0x88, 0x03, 0x89, 0x03, 0x8A, + 0x03, 0x8C, 0x03, 0x8E, 0x03, 0x8F, 0x03, 0x90, 0x03, 0xAA, 0x03, 0xAB, 0x03, 0xAC, 0x03, 0xAD, + 0x03, 0xAE, 0x03, 0xAF, 0x03, 0xB0, 0x03, 0xCA, 0x03, 0xCB, 0x03, 0xCC, 0x03, 0xCD, 0x03, 0xCE, + 0x03, 0xD3, 0x03, 0xD4, 0x1F, 0x00, 0x1F, 0x01, 0x1F, 0x02, 0x1F, 0x03, 0x1F, 0x04, 0x1F, 0x05, + 0x1F, 0x06, 0x1F, 0x07, 0x1F, 0x08, 0x1F, 0x09, 0x1F, 0x0A, 0x1F, 0x0B, 0x1F, 0x0C, 0x1F, 0x0D, + 0x1F, 0x0E, 0x1F, 0x0F, 0x1F, 0x10, 0x1F, 0x11, 0x1F, 0x12, 0x1F, 0x13, 0x1F, 0x14, 0x1F, 0x15, + 0x1F, 0x18, 0x1F, 0x19, 0x1F, 0x1A, 0x1F, 0x1B, 0x1F, 0x1C, 0x1F, 0x1D, 0x1F, 0x20, 0x1F, 0x21, + 0x1F, 0x22, 0x1F, 0x23, 0x1F, 0x24, 0x1F, 0x25, 0x1F, 0x26, 0x1F, 0x27, 0x1F, 0x28, 0x1F, 0x29, + 0x1F, 0x2A, 0x1F, 0x2B, 0x1F, 0x2C, 0x1F, 0x2D, 0x1F, 0x2E, 0x1F, 0x2F, 0x1F, 0x30, 0x1F, 0x31, + 0x1F, 0x32, 0x1F, 0x33, 0x1F, 0x34, 0x1F, 0x35, 0x1F, 0x36, 0x1F, 0x37, 0x1F, 0x38, 0x1F, 0x39, + 0x1F, 0x3A, 0x1F, 0x3B, 0x1F, 0x3C, 0x1F, 0x3D, 0x1F, 0x3E, 0x1F, 0x3F, 0x1F, 0x40, 0x1F, 0x41, + 0x1F, 0x42, 0x1F, 0x43, 0x1F, 0x44, 0x1F, 0x45, 0x1F, 0x48, 0x1F, 0x49, 0x1F, 0x4A, 0x1F, 0x4B, + 0x1F, 0x4C, 0x1F, 0x4D, 0x1F, 0x50, 0x1F, 0x51, 0x1F, 0x52, 0x1F, 0x53, 0x1F, 0x54, 0x1F, 0x55, + 0x1F, 0x56, 0x1F, 0x57, 0x1F, 0x59, 0x1F, 0x5B, 0x1F, 0x5D, 0x1F, 0x5F, 0x1F, 0x60, 0x1F, 0x61, + 0x1F, 0x62, 0x1F, 0x63, 0x1F, 0x64, 0x1F, 0x65, 0x1F, 0x66, 0x1F, 0x67, 0x1F, 0x68, 0x1F, 0x69, + 0x1F, 0x6A, 0x1F, 0x6B, 0x1F, 0x6C, 0x1F, 0x6D, 0x1F, 0x6E, 0x1F, 0x6F, 0x1F, 0x70, 0x1F, 0x72, + 0x1F, 0x74, 0x1F, 0x76, 0x1F, 0x78, 0x1F, 0x7A, 0x1F, 0x7C, 0x1F, 0x80, 0x1F, 0x81, 0x1F, 0x82, + 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x87, 0x1F, 0x88, 0x1F, 0x89, 0x1F, 0x8A, + 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x8F, 0x1F, 0x90, 0x1F, 0x91, 0x1F, 0x92, + 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, 0x1F, 0x97, 0x1F, 0x98, 0x1F, 0x99, 0x1F, 0x9A, + 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0x9F, 0x1F, 0xA0, 0x1F, 0xA1, 0x1F, 0xA2, + 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA7, 0x1F, 0xA8, 0x1F, 0xA9, 0x1F, 0xAA, + 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x1F, 0xAF, 0x1F, 0xB0, 0x1F, 0xB1, 0x1F, 0xB2, + 0x1F, 0xB3, 0x1F, 0xB4, 0x1F, 0xB6, 0x1F, 0xB7, 0x1F, 0xB8, 0x1F, 0xB9, 0x1F, 0xBA, 0x1F, 0xBC, + 0x1F, 0xC1, 0x1F, 0xC2, 0x1F, 0xC3, 0x1F, 0xC4, 0x1F, 0xC6, 0x1F, 0xC7, 0x1F, 0xC8, 0x1F, 0xCA, + 0x1F, 0xCC, 0x1F, 0xCD, 0x1F, 0xCE, 0x1F, 0xCF, 0x1F, 0xD0, 0x1F, 0xD1, 0x1F, 0xD2, 0x1F, 0xD6, + 0x1F, 0xD7, 0x1F, 0xD8, 0x1F, 0xD9, 0x1F, 0xDA, 0x1F, 0xDD, 0x1F, 0xDE, 0x1F, 0xDF, 0x1F, 0xE0, + 0x1F, 0xE1, 0x1F, 0xE2, 0x1F, 0xE4, 0x1F, 0xE5, 0x1F, 0xE6, 0x1F, 0xE7, 0x1F, 0xE8, 0x1F, 0xE9, + 0x1F, 0xEA, 0x1F, 0xEC, 0x1F, 0xED, 0x1F, 0xF2, 0x1F, 0xF3, 0x1F, 0xF4, 0x1F, 0xF6, 0x1F, 0xF7, + 0x1F, 0xF8, 0x1F, 0xFA, 0x1F, 0xFC, 0x00, 0x01, 0x06, 0x30, 0x00, 0xC0, 0x01, 0x86, 0x01, 0x8C, + 0x01, 0x92, 0x01, 0x98, 0x01, 0x9E, 0x01, 0xA4, 0x01, 0xAA, 0x01, 0xB0, 0x01, 0xB6, 0x01, 0xBC, + 0x01, 0xC2, 0x01, 0xC8, 0x01, 0xCE, 0x01, 0xD4, 0x01, 0xDA, 0x01, 0xE0, 0x01, 0xE6, 0x01, 0xEC, + 0x01, 0xF2, 0x01, 0xF8, 0x01, 0xFE, 0x02, 0x04, 0x02, 0x0A, 0x02, 0x10, 0x02, 0x16, 0x02, 0x1E, + 0x02, 0x26, 0x02, 0x2C, 0x02, 0x32, 0x02, 0x38, 0x02, 0x3E, 0x02, 0x44, 0x02, 0x4C, 0x02, 0x54, + 0x02, 0x5A, 0x02, 0x60, 0x02, 0x66, 0x02, 0x6C, 0x02, 0x72, 0x02, 0x78, 0x02, 0x7E, 0x02, 0x84, + 0x02, 0x8A, 0x02, 0x90, 0x02, 0x96, 0x02, 0x9C, 0x02, 0xA2, 0x02, 0xA8, 0x02, 0xAE, 0x02, 0xB6, + 0x02, 0xBE, 0x02, 0xC4, 0x02, 0xCA, 0x02, 0xD0, 0x02, 0xD6, 0x02, 0xDC, 0x02, 0xE4, 0x02, 0xEC, + 0x02, 0xF2, 0x02, 0xF8, 0x02, 0xFE, 0x03, 0x04, 0x03, 0x0A, 0x03, 0x10, 0x03, 0x18, 0x03, 0x20, + 0x03, 0x26, 0x03, 0x2C, 0x03, 0x32, 0x03, 0x38, 0x03, 0x3E, 0x03, 0x46, 0x03, 0x4E, 0x03, 0x54, + 0x03, 0x5A, 0x03, 0x60, 0x03, 0x66, 0x03, 0x6C, 0x03, 0x72, 0x03, 0x78, 0x03, 0x7E, 0x03, 0x84, + 0x03, 0x8A, 0x03, 0x90, 0x03, 0x96, 0x03, 0x9C, 0x03, 0xA2, 0x03, 0xA8, 0x03, 0xB0, 0x03, 0xB8, + 0x03, 0xBE, 0x03, 0xC4, 0x03, 0xCC, 0x03, 0xD2, 0x03, 0xD8, 0x03, 0xDE, 0x03, 0xE4, 0x03, 0xEA, + 0x03, 0xF2, 0x03, 0xFA, 0x04, 0x00, 0x04, 0x06, 0x04, 0x0C, 0x04, 0x12, 0x04, 0x18, 0x04, 0x1E, + 0x04, 0x26, 0x04, 0x2E, 0x04, 0x34, 0x04, 0x3A, 0x04, 0x40, 0x04, 0x46, 0x04, 0x4C, 0x04, 0x52, + 0x04, 0x58, 0x04, 0x5E, 0x04, 0x64, 0x04, 0x6A, 0x04, 0x70, 0x04, 0x76, 0x04, 0x7C, 0x04, 0x82, + 0x04, 0x88, 0x04, 0x8E, 0x04, 0x94, 0x04, 0x9A, 0x04, 0xA0, 0x04, 0xA6, 0x04, 0xAC, 0x04, 0xB2, + 0x04, 0xB8, 0x04, 0xBE, 0x04, 0xC4, 0x04, 0xCA, 0x04, 0xD0, 0x04, 0xD6, 0x04, 0xDC, 0x04, 0xE2, + 0x04, 0xE8, 0x04, 0xEE, 0x04, 0xF4, 0x04, 0xFA, 0x05, 0x00, 0x05, 0x06, 0x05, 0x0C, 0x05, 0x12, + 0x05, 0x18, 0x05, 0x1E, 0x05, 0x24, 0x05, 0x2A, 0x05, 0x30, 0x05, 0x36, 0x05, 0x3C, 0x05, 0x42, + 0x05, 0x48, 0x05, 0x4E, 0x05, 0x54, 0x05, 0x5A, 0x05, 0x60, 0x05, 0x66, 0x05, 0x6C, 0x05, 0x72, + 0x05, 0x78, 0x05, 0x7E, 0x05, 0x84, 0x05, 0x8A, 0x05, 0x90, 0x05, 0x96, 0x05, 0x9C, 0x05, 0xA2, + 0x05, 0xA8, 0x05, 0xAE, 0x05, 0xB4, 0x05, 0xBA, 0x05, 0xC0, 0x05, 0xC6, 0x05, 0xCC, 0x05, 0xD2, + 0x05, 0xDA, 0x05, 0xE0, 0x05, 0xE6, 0x05, 0xEC, 0x05, 0xF2, 0x05, 0xF8, 0x06, 0x00, 0x06, 0x06, + 0x06, 0x0C, 0x06, 0x12, 0x06, 0x18, 0x06, 0x1E, 0x06, 0x24, 0x06, 0x2A, 0x00, 0x02, 0x00, 0xA8, + 0x03, 0x41, 0x00, 0x02, 0x03, 0x91, 0x03, 0x41, 0x00, 0x02, 0x03, 0x95, 0x03, 0x41, 0x00, 0x02, + 0x03, 0x97, 0x03, 0x41, 0x00, 0x02, 0x03, 0x99, 0x03, 0x41, 0x00, 0x02, 0x03, 0x9F, 0x03, 0x41, + 0x00, 0x02, 0x03, 0xA5, 0x03, 0x41, 0x00, 0x02, 0x03, 0xA9, 0x03, 0x41, 0x00, 0x02, 0x03, 0xCA, + 0x03, 0x01, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x41, 0x00, 0x02, 0x03, 0xB5, 0x03, 0x41, 0x00, 0x02, + 0x03, 0xB7, 0x03, 0x41, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x41, 0x00, 0x02, 0x03, 0xCB, 0x03, 0x01, + 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x08, 0x00, 0x02, 0x03, 0xBF, 0x03, 0x41, 0x00, 0x02, 0x03, 0xC5, + 0x03, 0x41, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x41, 0x00, 0x02, 0x03, 0xD2, 0x03, 0x41, 0x00, 0x02, + 0x03, 0xB1, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x00, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x01, 0x03, 0x40, + 0x00, 0x02, 0x1F, 0x00, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x01, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB1, + 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, 0x03, 0x91, + 0x03, 0x43, 0x00, 0x02, 0x1F, 0x08, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x09, 0x03, 0x40, 0x00, 0x02, + 0x1F, 0x08, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x09, 0x03, 0x41, 0x00, 0x03, 0x03, 0x91, 0x03, 0x13, + 0x03, 0x42, 0x00, 0x03, 0x03, 0x91, 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, 0x03, 0xB5, 0x03, 0x43, + 0x00, 0x02, 0x1F, 0x10, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x11, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x10, + 0x03, 0x41, 0x00, 0x02, 0x1F, 0x11, 0x03, 0x41, 0x00, 0x02, 0x03, 0x95, 0x03, 0x43, 0x00, 0x02, + 0x1F, 0x18, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x19, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x18, 0x03, 0x41, + 0x00, 0x02, 0x1F, 0x19, 0x03, 0x41, 0x00, 0x02, 0x03, 0xB7, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x20, + 0x03, 0x40, 0x00, 0x02, 0x1F, 0x21, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x20, 0x03, 0x41, 0x00, 0x02, + 0x1F, 0x21, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB7, + 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, 0x03, 0x97, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x28, 0x03, 0x40, + 0x00, 0x02, 0x1F, 0x29, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x28, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x29, + 0x03, 0x41, 0x00, 0x03, 0x03, 0x97, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0x97, 0x03, 0x14, + 0x03, 0x42, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x43, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x14, 0x00, 0x02, + 0x1F, 0x30, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x31, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x30, 0x03, 0x41, + 0x00, 0x02, 0x1F, 0x31, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, + 0x03, 0xB9, 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, 0x03, 0x99, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x38, + 0x03, 0x40, 0x00, 0x02, 0x1F, 0x39, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x38, 0x03, 0x41, 0x00, 0x02, + 0x1F, 0x39, 0x03, 0x41, 0x00, 0x03, 0x03, 0x99, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0x99, + 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, 0x03, 0xBF, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x40, 0x03, 0x40, + 0x00, 0x02, 0x1F, 0x41, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x40, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x41, + 0x03, 0x41, 0x00, 0x02, 0x03, 0x9F, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x48, 0x03, 0x40, 0x00, 0x02, + 0x1F, 0x49, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x48, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x49, 0x03, 0x41, + 0x00, 0x02, 0x03, 0xC5, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x50, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x51, + 0x03, 0x40, 0x00, 0x02, 0x1F, 0x50, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x51, 0x03, 0x41, 0x00, 0x03, + 0x03, 0xC5, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0x59, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x59, 0x03, 0x41, 0x00, 0x03, 0x03, 0xA5, 0x03, 0x14, + 0x03, 0x42, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x43, 0x00, 0x02, 0x1F, 0x60, 0x03, 0x40, 0x00, 0x02, + 0x1F, 0x61, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x60, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x61, 0x03, 0x41, + 0x00, 0x03, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x42, + 0x00, 0x02, 0x03, 0xA9, 0x03, 0x43, 0x00, 0x02, 0x21, 0x26, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x68, + 0x03, 0x40, 0x00, 0x02, 0x1F, 0x69, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x68, 0x03, 0x41, 0x00, 0x02, + 0x1F, 0x69, 0x03, 0x41, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0xA9, + 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, 0x03, 0xB1, 0x03, 0x40, 0x00, 0x02, 0x03, 0xB5, 0x03, 0x40, + 0x00, 0x02, 0x03, 0xB7, 0x03, 0x40, 0x00, 0x02, 0x03, 0xB9, 0x03, 0x40, 0x00, 0x02, 0x03, 0xBF, + 0x03, 0x40, 0x00, 0x02, 0x03, 0xC5, 0x03, 0x40, 0x00, 0x02, 0x03, 0xC9, 0x03, 0x40, 0x00, 0x02, + 0x1F, 0xB3, 0x03, 0x13, 0x00, 0x02, 0x1F, 0xB3, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x80, 0x03, 0x00, + 0x00, 0x02, 0x1F, 0x81, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x80, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x81, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0x80, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x81, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0xBC, 0x03, 0x13, 0x00, 0x02, 0x1F, 0xBC, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x88, 0x03, 0x00, + 0x00, 0x02, 0x1F, 0x89, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x88, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x89, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0x88, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x89, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0xC3, 0x03, 0x13, 0x00, 0x02, 0x1F, 0xC3, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x90, 0x03, 0x00, + 0x00, 0x02, 0x1F, 0x91, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x90, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x91, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0x90, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x91, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0xCC, 0x03, 0x13, 0x00, 0x02, 0x1F, 0xCC, 0x03, 0x14, 0x00, 0x02, 0x1F, 0x98, 0x03, 0x00, + 0x00, 0x02, 0x1F, 0x99, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x98, 0x03, 0x01, 0x00, 0x02, 0x1F, 0x99, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0x98, 0x03, 0x42, 0x00, 0x02, 0x1F, 0x99, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0xF3, 0x03, 0x13, 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x14, 0x00, 0x02, 0x1F, 0xA0, 0x03, 0x00, + 0x00, 0x02, 0x1F, 0xA1, 0x03, 0x00, 0x00, 0x02, 0x1F, 0xA0, 0x03, 0x01, 0x00, 0x02, 0x1F, 0xA1, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0xA0, 0x03, 0x42, 0x00, 0x02, 0x1F, 0xA1, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0xFC, 0x03, 0x13, 0x00, 0x02, 0x1F, 0xFC, 0x03, 0x14, 0x00, 0x02, 0x1F, 0xA8, 0x03, 0x00, + 0x00, 0x02, 0x1F, 0xA9, 0x03, 0x00, 0x00, 0x02, 0x1F, 0xA8, 0x03, 0x01, 0x00, 0x02, 0x1F, 0xA9, + 0x03, 0x01, 0x00, 0x02, 0x1F, 0xA8, 0x03, 0x42, 0x00, 0x02, 0x1F, 0xA9, 0x03, 0x42, 0x00, 0x02, + 0x1F, 0xB3, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x71, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xB6, 0x03, 0x45, + 0x00, 0x02, 0x03, 0x91, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xC3, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x75, + 0x03, 0x45, 0x00, 0x02, 0x1F, 0xC6, 0x03, 0x45, 0x00, 0x02, 0x03, 0x95, 0x03, 0x40, 0x00, 0x02, + 0x03, 0x97, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xBF, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xBF, 0x03, 0x41, + 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x06, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x04, 0x00, 0x02, 0x03, 0xCA, + 0x03, 0x40, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x08, 0x03, 0x42, + 0x00, 0x02, 0x03, 0x99, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xFE, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xFE, + 0x03, 0x41, 0x00, 0x02, 0x03, 0xCB, 0x03, 0x40, 0x00, 0x02, 0x03, 0xC1, 0x03, 0x43, 0x00, 0x03, + 0x03, 0xC5, 0x03, 0x08, 0x03, 0x42, 0x00, 0x02, 0x03, 0xA5, 0x03, 0x40, 0x00, 0x02, 0x00, 0xA8, + 0x03, 0x40, 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x00, 0x00, 0x02, 0x1F, 0x7D, 0x03, 0x45, 0x00, 0x02, + 0x1F, 0xF6, 0x03, 0x45, 0x00, 0x02, 0x03, 0x9F, 0x03, 0x40, 0x00, 0x02, 0x03, 0xA9, 0x03, 0x40, + 0x00, 0x02, 0x21, 0x26, 0x03, 0x45, 0x00, 0x01, 0x00, 0xC0, 0x03, 0x85, 0x03, 0x86, 0x03, 0x88, + 0x03, 0x89, 0x03, 0x8A, 0x03, 0x8C, 0x03, 0x8E, 0x03, 0x8F, 0x03, 0x90, 0x03, 0xAC, 0x03, 0xAD, + 0x03, 0xAE, 0x03, 0xAF, 0x03, 0xB0, 0x03, 0xCA, 0x03, 0xCC, 0x03, 0xCD, 0x03, 0xCE, 0x03, 0xD3, + 0x1F, 0x00, 0x1F, 0x02, 0x1F, 0x03, 0x1F, 0x04, 0x1F, 0x05, 0x1F, 0x06, 0x1F, 0x07, 0x1F, 0x08, + 0x1F, 0x0A, 0x1F, 0x0B, 0x1F, 0x0C, 0x1F, 0x0D, 0x1F, 0x0E, 0x1F, 0x0F, 0x1F, 0x10, 0x1F, 0x12, + 0x1F, 0x13, 0x1F, 0x14, 0x1F, 0x15, 0x1F, 0x18, 0x1F, 0x1A, 0x1F, 0x1B, 0x1F, 0x1C, 0x1F, 0x1D, + 0x1F, 0x20, 0x1F, 0x22, 0x1F, 0x23, 0x1F, 0x24, 0x1F, 0x25, 0x1F, 0x26, 0x1F, 0x27, 0x1F, 0x28, + 0x1F, 0x2A, 0x1F, 0x2B, 0x1F, 0x2C, 0x1F, 0x2D, 0x1F, 0x2E, 0x1F, 0x2F, 0x1F, 0x30, 0x1F, 0x31, + 0x1F, 0x32, 0x1F, 0x33, 0x1F, 0x34, 0x1F, 0x35, 0x1F, 0x36, 0x1F, 0x37, 0x1F, 0x38, 0x1F, 0x3A, + 0x1F, 0x3B, 0x1F, 0x3C, 0x1F, 0x3D, 0x1F, 0x3E, 0x1F, 0x3F, 0x1F, 0x40, 0x1F, 0x42, 0x1F, 0x43, + 0x1F, 0x44, 0x1F, 0x45, 0x1F, 0x48, 0x1F, 0x4A, 0x1F, 0x4B, 0x1F, 0x4C, 0x1F, 0x4D, 0x1F, 0x50, + 0x1F, 0x52, 0x1F, 0x53, 0x1F, 0x54, 0x1F, 0x55, 0x1F, 0x56, 0x1F, 0x57, 0x1F, 0x5B, 0x1F, 0x5D, + 0x1F, 0x5F, 0x1F, 0x60, 0x1F, 0x62, 0x1F, 0x63, 0x1F, 0x64, 0x1F, 0x65, 0x1F, 0x66, 0x1F, 0x67, + 0x1F, 0x68, 0x1F, 0x69, 0x1F, 0x6A, 0x1F, 0x6B, 0x1F, 0x6C, 0x1F, 0x6D, 0x1F, 0x6E, 0x1F, 0x6F, + 0x1F, 0x70, 0x1F, 0x72, 0x1F, 0x74, 0x1F, 0x76, 0x1F, 0x78, 0x1F, 0x7A, 0x1F, 0x7C, 0x1F, 0x80, 0x1F, 0x81, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x87, 0x1F, 0x88, 0x1F, 0x89, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x8F, 0x1F, 0x90, 0x1F, 0x91, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, 0x1F, 0x97, 0x1F, 0x98, 0x1F, 0x99, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0x9F, 0x1F, 0xA0, 0x1F, 0xA1, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA7, 0x1F, 0xA8, 0x1F, 0xA9, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x1F, 0xAF, 0x1F, 0xB2, - 0x1F, 0xB4, 0x1F, 0xB7, 0x1F, 0xBA, 0x1F, 0xBB, 0x1F, 0xC2, 0x1F, 0xC4, 0x1F, 0xC7, 0x1F, 0xC8, - 0x1F, 0xC9, 0x1F, 0xCA, 0x1F, 0xCB, 0x1F, 0xCD, 0x1F, 0xCE, 0x1F, 0xD0, 0x1F, 0xD1, 0x1F, 0xD2, - 0x1F, 0xD3, 0x1F, 0xD6, 0x1F, 0xD7, 0x1F, 0xDA, 0x1F, 0xDB, 0x1F, 0xDD, 0x1F, 0xDE, 0x1F, 0xE2, - 0x1F, 0xE3, 0x1F, 0xE4, 0x1F, 0xE7, 0x1F, 0xEA, 0x1F, 0xEB, 0x1F, 0xED, 0x1F, 0xEE, 0x1F, 0xF2, - 0x1F, 0xF4, 0x1F, 0xF7, 0x1F, 0xF8, 0x1F, 0xF9, 0x1F, 0xFA, 0x1F, 0xFB, 0x1F, 0xFC, 0x00, 0x01, - 0x05, 0x00, 0x00, 0x89, 0x01, 0x18, 0x01, 0x1E, 0x01, 0x24, 0x01, 0x2A, 0x01, 0x30, 0x01, 0x38, - 0x01, 0x40, 0x01, 0x48, 0x01, 0x50, 0x01, 0x58, 0x01, 0x60, 0x01, 0x68, 0x01, 0x70, 0x01, 0x78, - 0x01, 0x80, 0x01, 0x88, 0x01, 0x90, 0x01, 0x98, 0x01, 0xA0, 0x01, 0xA8, 0x01, 0xB0, 0x01, 0xB8, - 0x01, 0xC0, 0x01, 0xC8, 0x01, 0xD0, 0x01, 0xD8, 0x01, 0xE0, 0x01, 0xE8, 0x01, 0xF0, 0x01, 0xF8, - 0x02, 0x00, 0x02, 0x08, 0x02, 0x10, 0x02, 0x16, 0x02, 0x1E, 0x02, 0x26, 0x02, 0x2E, 0x02, 0x36, - 0x02, 0x3E, 0x02, 0x46, 0x02, 0x4E, 0x02, 0x56, 0x02, 0x5E, 0x02, 0x66, 0x02, 0x6E, 0x02, 0x76, - 0x02, 0x7E, 0x02, 0x86, 0x02, 0x8E, 0x02, 0x96, 0x02, 0x9E, 0x02, 0xA6, 0x02, 0xAE, 0x02, 0xB6, - 0x02, 0xBE, 0x02, 0xC6, 0x02, 0xCE, 0x02, 0xD6, 0x02, 0xDE, 0x02, 0xE6, 0x02, 0xEE, 0x02, 0xF6, - 0x02, 0xFE, 0x03, 0x06, 0x03, 0x0E, 0x03, 0x14, 0x03, 0x1C, 0x03, 0x24, 0x03, 0x2C, 0x03, 0x34, - 0x03, 0x3C, 0x03, 0x44, 0x03, 0x4A, 0x03, 0x50, 0x03, 0x56, 0x03, 0x5E, 0x03, 0x64, 0x03, 0x6A, - 0x03, 0x70, 0x03, 0x76, 0x03, 0x7E, 0x03, 0x86, 0x03, 0x8C, 0x03, 0x94, 0x03, 0x9A, 0x03, 0xA0, - 0x03, 0xA6, 0x03, 0xAC, 0x03, 0xB4, 0x03, 0xBC, 0x03, 0xC2, 0x03, 0xCA, 0x03, 0xD0, 0x03, 0xD6, - 0x03, 0xDC, 0x03, 0xE2, 0x03, 0xEA, 0x03, 0xF2, 0x03, 0xF8, 0x04, 0x00, 0x04, 0x06, 0x04, 0x0C, - 0x04, 0x12, 0x04, 0x18, 0x04, 0x20, 0x04, 0x28, 0x04, 0x2E, 0x04, 0x36, 0x04, 0x3C, 0x04, 0x42, - 0x04, 0x48, 0x04, 0x4E, 0x04, 0x56, 0x04, 0x5E, 0x04, 0x64, 0x04, 0x6C, 0x04, 0x72, 0x04, 0x78, - 0x04, 0x7E, 0x04, 0x84, 0x04, 0x8C, 0x04, 0x94, 0x04, 0x9A, 0x04, 0xA0, 0x04, 0xA8, 0x04, 0xAE, - 0x04, 0xB4, 0x04, 0xBC, 0x04, 0xC4, 0x04, 0xCA, 0x04, 0xD2, 0x04, 0xDA, 0x04, 0xE0, 0x04, 0xE6, - 0x04, 0xEC, 0x04, 0xF4, 0x04, 0xFA, 0x00, 0x02, 0x21, 0x26, 0x03, 0x01, 0x00, 0x02, 0x03, 0xCA, - 0x03, 0x41, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x01, 0x00, 0x02, 0x03, 0xCB, 0x03, 0x41, 0x00, 0x03, - 0x03, 0xB1, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, - 0x03, 0xB1, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, - 0x03, 0xB1, 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, 0x03, 0x91, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, - 0x03, 0x91, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0x91, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, - 0x03, 0x91, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0x91, 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, - 0x03, 0xB5, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, - 0x03, 0xB5, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, - 0x03, 0x95, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0x95, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, - 0x03, 0x95, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0x95, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, - 0x03, 0xB7, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, - 0x03, 0xB7, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, - 0x03, 0xB7, 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, 0x03, 0x97, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, - 0x03, 0x97, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0x97, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, - 0x03, 0x97, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0x97, 0x03, 0x43, 0x03, 0x42, 0x00, 0x02, - 0x1F, 0xBE, 0x03, 0x13, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB9, - 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB9, - 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xBE, - 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x03, 0x99, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0x99, - 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0x99, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0x99, - 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0x99, 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, 0x03, 0xBF, - 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xBF, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0xBF, - 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xBF, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0x9F, - 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0x9F, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0x9F, - 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0x9F, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC5, - 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0xC5, - 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC5, - 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, 0x03, 0xA5, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0xA5, - 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xC9, - 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC9, - 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x42, 0x00, 0x02, 0x21, 0x26, - 0x03, 0x13, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x14, - 0x03, 0x00, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x14, - 0x03, 0x01, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, 0x21, 0x26, 0x03, 0x14, - 0x03, 0x42, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x00, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x01, 0x00, 0x02, - 0x1F, 0xB3, 0x03, 0x43, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x80, - 0x03, 0x40, 0x00, 0x02, 0x1F, 0x81, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x80, 0x03, 0x41, 0x00, 0x02, - 0x1F, 0x81, 0x03, 0x41, 0x00, 0x03, 0x1F, 0x00, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x01, - 0x03, 0x42, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xBC, 0x03, 0x43, 0x00, 0x03, 0x03, 0x91, 0x03, 0x14, - 0x03, 0x45, 0x00, 0x02, 0x1F, 0x88, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x89, 0x03, 0x40, 0x00, 0x02, - 0x1F, 0x88, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x89, 0x03, 0x41, 0x00, 0x03, 0x1F, 0x08, 0x03, 0x42, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x42, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xC3, 0x03, 0x43, - 0x00, 0x03, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x90, 0x03, 0x40, 0x00, 0x02, - 0x1F, 0x91, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x90, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x91, 0x03, 0x41, - 0x00, 0x03, 0x1F, 0x20, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x21, 0x03, 0x42, 0x03, 0x45, - 0x00, 0x02, 0x1F, 0xCC, 0x03, 0x43, 0x00, 0x03, 0x03, 0x97, 0x03, 0x14, 0x03, 0x45, 0x00, 0x02, - 0x1F, 0x98, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x99, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x98, 0x03, 0x41, - 0x00, 0x02, 0x1F, 0x99, 0x03, 0x41, 0x00, 0x03, 0x1F, 0x28, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, - 0x1F, 0x29, 0x03, 0x42, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x43, 0x00, 0x03, 0x03, 0xC9, - 0x03, 0x14, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xA0, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xA1, 0x03, 0x40, - 0x00, 0x02, 0x1F, 0xA0, 0x03, 0x41, 0x00, 0x02, 0x1F, 0xA1, 0x03, 0x41, 0x00, 0x03, 0x1F, 0x60, - 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x42, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xFC, - 0x03, 0x43, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xA8, 0x03, 0x40, - 0x00, 0x02, 0x1F, 0xA9, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xA8, 0x03, 0x41, 0x00, 0x02, 0x1F, 0xA9, - 0x03, 0x41, 0x00, 0x03, 0x1F, 0x68, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x69, 0x03, 0x42, - 0x03, 0x45, 0x00, 0x02, 0x1F, 0xB3, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xB3, 0x03, 0x01, 0x00, 0x03, - 0x03, 0xB1, 0x03, 0x42, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xC3, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xC3, - 0x03, 0x01, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x08, - 0x03, 0x00, 0x00, 0x02, 0x03, 0xCA, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x08, 0x03, 0x42, - 0x00, 0x03, 0x03, 0xC5, 0x03, 0x08, 0x03, 0x00, 0x00, 0x02, 0x03, 0xCB, 0x03, 0x41, 0x00, 0x02, - 0x1F, 0xF3, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x42, - 0x03, 0x45, 0x00, 0x02, 0x21, 0x26, 0x03, 0x00, 0x00, 0x02, 0x21, 0x26, 0x03, 0x01, 0x00, 0x01, - 0x00, 0x89, 0x03, 0x8F, 0x03, 0x90, 0x03, 0xAF, 0x03, 0xB0, 0x1F, 0x02, 0x1F, 0x03, 0x1F, 0x04, - 0x1F, 0x05, 0x1F, 0x06, 0x1F, 0x0A, 0x1F, 0x0B, 0x1F, 0x0C, 0x1F, 0x0D, 0x1F, 0x0E, 0x1F, 0x12, - 0x1F, 0x13, 0x1F, 0x14, 0x1F, 0x15, 0x1F, 0x1A, 0x1F, 0x1B, 0x1F, 0x1C, 0x1F, 0x1D, 0x1F, 0x22, - 0x1F, 0x23, 0x1F, 0x24, 0x1F, 0x25, 0x1F, 0x26, 0x1F, 0x2A, 0x1F, 0x2B, 0x1F, 0x2C, 0x1F, 0x2D, - 0x1F, 0x2E, 0x1F, 0x30, 0x1F, 0x32, 0x1F, 0x33, 0x1F, 0x34, 0x1F, 0x35, 0x1F, 0x36, 0x1F, 0x37, - 0x1F, 0x3A, 0x1F, 0x3B, 0x1F, 0x3C, 0x1F, 0x3D, 0x1F, 0x3E, 0x1F, 0x42, 0x1F, 0x43, 0x1F, 0x44, - 0x1F, 0x45, 0x1F, 0x4A, 0x1F, 0x4B, 0x1F, 0x4C, 0x1F, 0x4D, 0x1F, 0x52, 0x1F, 0x53, 0x1F, 0x54, - 0x1F, 0x55, 0x1F, 0x56, 0x1F, 0x5B, 0x1F, 0x5D, 0x1F, 0x62, 0x1F, 0x63, 0x1F, 0x64, 0x1F, 0x65, - 0x1F, 0x66, 0x1F, 0x68, 0x1F, 0x6A, 0x1F, 0x6B, 0x1F, 0x6C, 0x1F, 0x6D, 0x1F, 0x6E, 0x1F, 0x6F, - 0x1F, 0x76, 0x1F, 0x77, 0x1F, 0x80, 0x1F, 0x81, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, - 0x1F, 0x86, 0x1F, 0x87, 0x1F, 0x88, 0x1F, 0x89, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, - 0x1F, 0x8E, 0x1F, 0x8F, 0x1F, 0x90, 0x1F, 0x91, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, - 0x1F, 0x96, 0x1F, 0x97, 0x1F, 0x98, 0x1F, 0x99, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, - 0x1F, 0x9E, 0x1F, 0x9F, 0x1F, 0xA0, 0x1F, 0xA1, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, - 0x1F, 0xA6, 0x1F, 0xA7, 0x1F, 0xA8, 0x1F, 0xA9, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, - 0x1F, 0xAE, 0x1F, 0xAF, 0x1F, 0xB2, 0x1F, 0xB4, 0x1F, 0xB7, 0x1F, 0xC2, 0x1F, 0xC4, 0x1F, 0xC7, - 0x1F, 0xD2, 0x1F, 0xD3, 0x1F, 0xD7, 0x1F, 0xE2, 0x1F, 0xE3, 0x1F, 0xF2, 0x1F, 0xF4, 0x1F, 0xF7, - 0x1F, 0xFA, 0x1F, 0xFB, 0x00, 0x01, 0x04, 0xE2, 0x00, 0x7F, 0x01, 0x04, 0x01, 0x0A, 0x01, 0x10, - 0x01, 0x16, 0x01, 0x1E, 0x01, 0x26, 0x01, 0x2E, 0x01, 0x36, 0x01, 0x3E, 0x01, 0x46, 0x01, 0x4E, - 0x01, 0x56, 0x01, 0x5E, 0x01, 0x66, 0x01, 0x6E, 0x01, 0x76, 0x01, 0x7E, 0x01, 0x86, 0x01, 0x8E, - 0x01, 0x96, 0x01, 0x9E, 0x01, 0xA6, 0x01, 0xAE, 0x01, 0xB6, 0x01, 0xBE, 0x01, 0xC6, 0x01, 0xCE, - 0x01, 0xD6, 0x01, 0xDE, 0x01, 0xE4, 0x01, 0xEC, 0x01, 0xF4, 0x01, 0xFC, 0x02, 0x04, 0x02, 0x0C, - 0x02, 0x14, 0x02, 0x1C, 0x02, 0x24, 0x02, 0x2C, 0x02, 0x34, 0x02, 0x3C, 0x02, 0x44, 0x02, 0x4C, - 0x02, 0x54, 0x02, 0x5C, 0x02, 0x64, 0x02, 0x6C, 0x02, 0x74, 0x02, 0x7C, 0x02, 0x84, 0x02, 0x8C, - 0x02, 0x94, 0x02, 0x9C, 0x02, 0xA4, 0x02, 0xAC, 0x02, 0xB4, 0x02, 0xBC, 0x02, 0xC2, 0x02, 0xCA, - 0x02, 0xD2, 0x02, 0xDA, 0x02, 0xE2, 0x02, 0xEA, 0x02, 0xF0, 0x02, 0xF6, 0x02, 0xFE, 0x03, 0x06, - 0x03, 0x0E, 0x03, 0x16, 0x03, 0x1E, 0x03, 0x26, 0x03, 0x2E, 0x03, 0x36, 0x03, 0x3E, 0x03, 0x46, - 0x03, 0x4E, 0x03, 0x56, 0x03, 0x5E, 0x03, 0x66, 0x03, 0x6E, 0x03, 0x76, 0x03, 0x7E, 0x03, 0x86, - 0x03, 0x8E, 0x03, 0x96, 0x03, 0x9E, 0x03, 0xA6, 0x03, 0xAE, 0x03, 0xB6, 0x03, 0xBE, 0x03, 0xC6, - 0x03, 0xCE, 0x03, 0xD6, 0x03, 0xDE, 0x03, 0xE6, 0x03, 0xEE, 0x03, 0xF6, 0x03, 0xFE, 0x04, 0x06, - 0x04, 0x0E, 0x04, 0x16, 0x04, 0x1E, 0x04, 0x26, 0x04, 0x2E, 0x04, 0x36, 0x04, 0x3E, 0x04, 0x46, - 0x04, 0x4E, 0x04, 0x56, 0x04, 0x5E, 0x04, 0x66, 0x04, 0x6E, 0x04, 0x76, 0x04, 0x7E, 0x04, 0x84, - 0x04, 0x8C, 0x04, 0x94, 0x04, 0x9A, 0x04, 0xA2, 0x04, 0xAA, 0x04, 0xB0, 0x04, 0xB8, 0x04, 0xC0, - 0x04, 0xC8, 0x04, 0xCE, 0x04, 0xD6, 0x04, 0xDC, 0x00, 0x02, 0x21, 0x26, 0x03, 0x41, 0x00, 0x02, - 0x1F, 0xBE, 0x03, 0x44, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x08, - 0x03, 0x01, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x14, - 0x03, 0x40, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x14, - 0x03, 0x41, 0x00, 0x03, 0x03, 0x91, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0x91, 0x03, 0x14, - 0x03, 0x40, 0x00, 0x03, 0x03, 0x91, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0x91, 0x03, 0x14, - 0x03, 0x41, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x14, - 0x03, 0x40, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x14, - 0x03, 0x41, 0x00, 0x03, 0x03, 0x95, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0x95, 0x03, 0x14, - 0x03, 0x40, 0x00, 0x03, 0x03, 0x95, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0x95, 0x03, 0x14, - 0x03, 0x41, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x14, - 0x03, 0x40, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x14, - 0x03, 0x41, 0x00, 0x03, 0x03, 0x97, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0x97, 0x03, 0x14, - 0x03, 0x40, 0x00, 0x03, 0x03, 0x97, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0x97, 0x03, 0x14, - 0x03, 0x41, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x43, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x13, 0x03, 0x40, - 0x00, 0x03, 0x03, 0xB9, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x13, 0x03, 0x41, - 0x00, 0x03, 0x03, 0xB9, 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x13, 0x03, 0x42, - 0x00, 0x03, 0x03, 0x99, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0x99, 0x03, 0x14, 0x03, 0x40, - 0x00, 0x03, 0x03, 0x99, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0x99, 0x03, 0x14, 0x03, 0x41, - 0x00, 0x03, 0x03, 0xBF, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xBF, 0x03, 0x14, 0x03, 0x40, - 0x00, 0x03, 0x03, 0xBF, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xBF, 0x03, 0x14, 0x03, 0x41, - 0x00, 0x03, 0x03, 0x9F, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0x9F, 0x03, 0x14, 0x03, 0x40, - 0x00, 0x03, 0x03, 0x9F, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0x9F, 0x03, 0x14, 0x03, 0x41, - 0x00, 0x03, 0x03, 0xC5, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x14, 0x03, 0x40, - 0x00, 0x03, 0x03, 0xC5, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x14, 0x03, 0x41, - 0x00, 0x03, 0x03, 0xA5, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x03, 0xA5, 0x03, 0x14, 0x03, 0x41, - 0x00, 0x03, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x40, - 0x00, 0x03, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x41, - 0x00, 0x02, 0x21, 0x26, 0x03, 0x43, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, - 0x03, 0xA9, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, - 0x03, 0xA9, 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, 0x21, 0x26, 0x03, 0x13, 0x03, 0x42, 0x00, 0x02, - 0x1F, 0xBE, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x13, - 0x03, 0x45, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x14, 0x00, 0x03, 0x1F, 0x00, 0x03, 0x00, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x00, 0x03, 0x01, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x00, 0x03, 0x45, - 0x03, 0x42, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0x91, 0x03, 0x13, - 0x03, 0x45, 0x00, 0x03, 0x03, 0x91, 0x03, 0x45, 0x03, 0x14, 0x00, 0x03, 0x1F, 0x08, 0x03, 0x00, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x08, 0x03, 0x01, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x08, 0x03, 0x45, - 0x03, 0x42, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x13, - 0x03, 0x45, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x14, 0x00, 0x03, 0x1F, 0x20, 0x03, 0x00, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x21, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x20, 0x03, 0x01, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x21, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x20, 0x03, 0x45, - 0x03, 0x42, 0x00, 0x03, 0x1F, 0x21, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0x97, 0x03, 0x13, - 0x03, 0x45, 0x00, 0x03, 0x03, 0x97, 0x03, 0x45, 0x03, 0x14, 0x00, 0x03, 0x1F, 0x28, 0x03, 0x00, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x28, 0x03, 0x01, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x28, 0x03, 0x45, - 0x03, 0x42, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x13, - 0x03, 0x45, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x14, 0x00, 0x03, 0x1F, 0x60, 0x03, 0x00, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x60, 0x03, 0x01, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x60, 0x03, 0x45, - 0x03, 0x42, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x13, - 0x03, 0x45, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x14, 0x00, 0x03, 0x1F, 0x68, 0x03, 0x00, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x69, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x68, 0x03, 0x01, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x69, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x68, 0x03, 0x45, - 0x03, 0x42, 0x00, 0x03, 0x1F, 0x69, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x00, - 0x03, 0x45, 0x00, 0x02, 0x1F, 0xB3, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x42, - 0x00, 0x03, 0x03, 0xB7, 0x03, 0x00, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xC3, 0x03, 0x41, 0x00, 0x03, - 0x03, 0xB7, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x08, 0x03, 0x40, 0x00, 0x02, - 0x1F, 0xBE, 0x03, 0x44, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x08, 0x03, 0x40, 0x00, 0x03, 0x03, 0xC5, - 0x03, 0x08, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x00, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xF3, - 0x03, 0x41, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x42, 0x00, 0x02, 0x21, 0x26, 0x03, 0x40, - 0x00, 0x02, 0x21, 0x26, 0x03, 0x41, 0x00, 0x01, 0x00, 0x7F, 0x03, 0x8F, 0x03, 0x90, 0x03, 0xAF, - 0x03, 0xB0, 0x1F, 0x02, 0x1F, 0x03, 0x1F, 0x04, 0x1F, 0x05, 0x1F, 0x0A, 0x1F, 0x0B, 0x1F, 0x0C, - 0x1F, 0x0D, 0x1F, 0x12, 0x1F, 0x13, 0x1F, 0x14, 0x1F, 0x15, 0x1F, 0x1A, 0x1F, 0x1B, 0x1F, 0x1C, - 0x1F, 0x1D, 0x1F, 0x22, 0x1F, 0x23, 0x1F, 0x24, 0x1F, 0x25, 0x1F, 0x2A, 0x1F, 0x2B, 0x1F, 0x2C, - 0x1F, 0x2D, 0x1F, 0x30, 0x1F, 0x32, 0x1F, 0x33, 0x1F, 0x34, 0x1F, 0x35, 0x1F, 0x36, 0x1F, 0x3A, - 0x1F, 0x3B, 0x1F, 0x3C, 0x1F, 0x3D, 0x1F, 0x42, 0x1F, 0x43, 0x1F, 0x44, 0x1F, 0x45, 0x1F, 0x4A, - 0x1F, 0x4B, 0x1F, 0x4C, 0x1F, 0x4D, 0x1F, 0x52, 0x1F, 0x53, 0x1F, 0x54, 0x1F, 0x55, 0x1F, 0x5B, - 0x1F, 0x5D, 0x1F, 0x62, 0x1F, 0x63, 0x1F, 0x64, 0x1F, 0x65, 0x1F, 0x68, 0x1F, 0x6A, 0x1F, 0x6B, - 0x1F, 0x6C, 0x1F, 0x6D, 0x1F, 0x6E, 0x1F, 0x76, 0x1F, 0x77, 0x1F, 0x80, 0x1F, 0x81, 0x1F, 0x82, + 0x1F, 0xB4, 0x1F, 0xB7, 0x1F, 0xBA, 0x1F, 0xC2, 0x1F, 0xC4, 0x1F, 0xC7, 0x1F, 0xC8, 0x1F, 0xCA, + 0x1F, 0xCD, 0x1F, 0xCE, 0x1F, 0xD0, 0x1F, 0xD1, 0x1F, 0xD2, 0x1F, 0xD6, 0x1F, 0xD7, 0x1F, 0xDA, + 0x1F, 0xDD, 0x1F, 0xDE, 0x1F, 0xE2, 0x1F, 0xE4, 0x1F, 0xE7, 0x1F, 0xEA, 0x1F, 0xED, 0x1F, 0xF2, + 0x1F, 0xF4, 0x1F, 0xF7, 0x1F, 0xF8, 0x1F, 0xFA, 0x1F, 0xFC, 0x00, 0x01, 0x04, 0xE0, 0x00, 0x85, + 0x01, 0x10, 0x01, 0x16, 0x01, 0x1C, 0x01, 0x22, 0x01, 0x28, 0x01, 0x30, 0x01, 0x38, 0x01, 0x40, + 0x01, 0x48, 0x01, 0x50, 0x01, 0x58, 0x01, 0x60, 0x01, 0x68, 0x01, 0x70, 0x01, 0x78, 0x01, 0x80, + 0x01, 0x88, 0x01, 0x90, 0x01, 0x98, 0x01, 0xA0, 0x01, 0xA8, 0x01, 0xB0, 0x01, 0xB8, 0x01, 0xC0, + 0x01, 0xC8, 0x01, 0xD0, 0x01, 0xD8, 0x01, 0xE0, 0x01, 0xE8, 0x01, 0xF0, 0x01, 0xF8, 0x02, 0x00, + 0x02, 0x08, 0x02, 0x0E, 0x02, 0x16, 0x02, 0x1E, 0x02, 0x26, 0x02, 0x2E, 0x02, 0x36, 0x02, 0x3E, + 0x02, 0x46, 0x02, 0x4E, 0x02, 0x56, 0x02, 0x5E, 0x02, 0x66, 0x02, 0x6E, 0x02, 0x76, 0x02, 0x7E, + 0x02, 0x86, 0x02, 0x8E, 0x02, 0x96, 0x02, 0x9E, 0x02, 0xA6, 0x02, 0xAE, 0x02, 0xB6, 0x02, 0xBE, + 0x02, 0xC6, 0x02, 0xCE, 0x02, 0xD6, 0x02, 0xDE, 0x02, 0xE6, 0x02, 0xEE, 0x02, 0xF6, 0x02, 0xFE, + 0x03, 0x06, 0x03, 0x0C, 0x03, 0x14, 0x03, 0x1C, 0x03, 0x24, 0x03, 0x2C, 0x03, 0x34, 0x03, 0x3C, + 0x03, 0x42, 0x03, 0x48, 0x03, 0x50, 0x03, 0x56, 0x03, 0x5C, 0x03, 0x62, 0x03, 0x68, 0x03, 0x70, + 0x03, 0x78, 0x03, 0x7E, 0x03, 0x86, 0x03, 0x8C, 0x03, 0x92, 0x03, 0x98, 0x03, 0x9E, 0x03, 0xA6, + 0x03, 0xAE, 0x03, 0xB4, 0x03, 0xBC, 0x03, 0xC2, 0x03, 0xC8, 0x03, 0xCE, 0x03, 0xD4, 0x03, 0xDC, + 0x03, 0xE4, 0x03, 0xEA, 0x03, 0xF2, 0x03, 0xF8, 0x03, 0xFE, 0x04, 0x04, 0x04, 0x0A, 0x04, 0x12, + 0x04, 0x1A, 0x04, 0x20, 0x04, 0x28, 0x04, 0x2E, 0x04, 0x34, 0x04, 0x3A, 0x04, 0x40, 0x04, 0x48, + 0x04, 0x50, 0x04, 0x56, 0x04, 0x5E, 0x04, 0x64, 0x04, 0x6A, 0x04, 0x70, 0x04, 0x76, 0x04, 0x7E, + 0x04, 0x86, 0x04, 0x8C, 0x04, 0x92, 0x04, 0x9A, 0x04, 0xA0, 0x04, 0xA6, 0x04, 0xAE, 0x04, 0xB6, + 0x04, 0xBE, 0x04, 0xC6, 0x04, 0xCC, 0x04, 0xD2, 0x04, 0xDA, 0x00, 0x02, 0x21, 0x26, 0x03, 0x01, + 0x00, 0x02, 0x03, 0xCA, 0x03, 0x41, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x01, 0x00, 0x02, 0x03, 0xCB, + 0x03, 0x41, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x14, + 0x03, 0x00, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x14, + 0x03, 0x01, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, 0x03, 0x91, 0x03, 0x13, + 0x03, 0x00, 0x00, 0x03, 0x03, 0x91, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0x91, 0x03, 0x13, + 0x03, 0x01, 0x00, 0x03, 0x03, 0x91, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0x91, 0x03, 0x43, + 0x03, 0x42, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x14, + 0x03, 0x00, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x14, + 0x03, 0x01, 0x00, 0x03, 0x03, 0x95, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0x95, 0x03, 0x14, + 0x03, 0x00, 0x00, 0x03, 0x03, 0x95, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0x95, 0x03, 0x14, + 0x03, 0x01, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x14, + 0x03, 0x00, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x14, + 0x03, 0x01, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, 0x03, 0x97, 0x03, 0x13, + 0x03, 0x00, 0x00, 0x03, 0x03, 0x97, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0x97, 0x03, 0x13, + 0x03, 0x01, 0x00, 0x03, 0x03, 0x97, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0x97, 0x03, 0x43, + 0x03, 0x42, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x13, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x13, 0x03, 0x00, + 0x00, 0x03, 0x03, 0xB9, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x13, 0x03, 0x01, + 0x00, 0x03, 0x03, 0xB9, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x43, 0x03, 0x42, + 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x03, 0x99, 0x03, 0x13, 0x03, 0x00, + 0x00, 0x03, 0x03, 0x99, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0x99, 0x03, 0x13, 0x03, 0x01, + 0x00, 0x03, 0x03, 0x99, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0x99, 0x03, 0x43, 0x03, 0x42, + 0x00, 0x03, 0x03, 0xBF, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xBF, 0x03, 0x14, 0x03, 0x00, + 0x00, 0x03, 0x03, 0xBF, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xBF, 0x03, 0x14, 0x03, 0x01, + 0x00, 0x03, 0x03, 0x9F, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0x9F, 0x03, 0x14, 0x03, 0x00, + 0x00, 0x03, 0x03, 0x9F, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0x9F, 0x03, 0x14, 0x03, 0x01, + 0x00, 0x03, 0x03, 0xC5, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x14, 0x03, 0x00, + 0x00, 0x03, 0x03, 0xC5, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x14, 0x03, 0x01, + 0x00, 0x03, 0x03, 0xC5, 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, 0x03, 0xA5, 0x03, 0x14, 0x03, 0x00, + 0x00, 0x03, 0x03, 0xA5, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x00, + 0x00, 0x03, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x01, + 0x00, 0x03, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x42, + 0x00, 0x02, 0x21, 0x26, 0x03, 0x13, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, + 0x03, 0xA9, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, + 0x03, 0xA9, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, + 0x21, 0x26, 0x03, 0x14, 0x03, 0x42, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x00, 0x00, 0x02, 0x1F, 0xB3, + 0x03, 0x43, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x80, 0x03, 0x40, + 0x00, 0x02, 0x1F, 0x81, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x80, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x81, + 0x03, 0x41, 0x00, 0x03, 0x1F, 0x00, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x42, + 0x03, 0x45, 0x00, 0x02, 0x1F, 0xBC, 0x03, 0x43, 0x00, 0x03, 0x03, 0x91, 0x03, 0x14, 0x03, 0x45, + 0x00, 0x02, 0x1F, 0x88, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x89, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x88, + 0x03, 0x41, 0x00, 0x02, 0x1F, 0x89, 0x03, 0x41, 0x00, 0x03, 0x1F, 0x08, 0x03, 0x42, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x09, 0x03, 0x42, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xC3, 0x03, 0x43, 0x00, 0x03, + 0x03, 0xB7, 0x03, 0x14, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x90, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x91, + 0x03, 0x40, 0x00, 0x02, 0x1F, 0x90, 0x03, 0x41, 0x00, 0x02, 0x1F, 0x91, 0x03, 0x41, 0x00, 0x03, + 0x1F, 0x20, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x21, 0x03, 0x42, 0x03, 0x45, 0x00, 0x02, + 0x1F, 0xCC, 0x03, 0x43, 0x00, 0x03, 0x03, 0x97, 0x03, 0x14, 0x03, 0x45, 0x00, 0x02, 0x1F, 0x98, + 0x03, 0x40, 0x00, 0x02, 0x1F, 0x99, 0x03, 0x40, 0x00, 0x02, 0x1F, 0x98, 0x03, 0x41, 0x00, 0x02, + 0x1F, 0x99, 0x03, 0x41, 0x00, 0x03, 0x1F, 0x28, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x29, + 0x03, 0x42, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x43, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x14, + 0x03, 0x45, 0x00, 0x02, 0x1F, 0xA0, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xA1, 0x03, 0x40, 0x00, 0x02, + 0x1F, 0xA0, 0x03, 0x41, 0x00, 0x02, 0x1F, 0xA1, 0x03, 0x41, 0x00, 0x03, 0x1F, 0x60, 0x03, 0x42, + 0x03, 0x45, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x42, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xFC, 0x03, 0x43, + 0x00, 0x03, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xA8, 0x03, 0x40, 0x00, 0x02, + 0x1F, 0xA9, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xA8, 0x03, 0x41, 0x00, 0x02, 0x1F, 0xA9, 0x03, 0x41, + 0x00, 0x03, 0x1F, 0x68, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x69, 0x03, 0x42, 0x03, 0x45, + 0x00, 0x02, 0x1F, 0xB3, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xB3, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB1, + 0x03, 0x42, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xC3, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xC3, 0x03, 0x01, + 0x00, 0x03, 0x03, 0xB7, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x08, 0x03, 0x00, + 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x08, 0x03, 0x42, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x08, 0x03, 0x00, + 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x40, 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC9, + 0x03, 0x42, 0x03, 0x45, 0x00, 0x02, 0x21, 0x26, 0x03, 0x00, 0x00, 0x01, 0x00, 0x85, 0x03, 0x8F, + 0x03, 0x90, 0x03, 0xAF, 0x03, 0xB0, 0x1F, 0x02, 0x1F, 0x03, 0x1F, 0x04, 0x1F, 0x05, 0x1F, 0x06, + 0x1F, 0x0A, 0x1F, 0x0B, 0x1F, 0x0C, 0x1F, 0x0D, 0x1F, 0x0E, 0x1F, 0x12, 0x1F, 0x13, 0x1F, 0x14, + 0x1F, 0x15, 0x1F, 0x1A, 0x1F, 0x1B, 0x1F, 0x1C, 0x1F, 0x1D, 0x1F, 0x22, 0x1F, 0x23, 0x1F, 0x24, + 0x1F, 0x25, 0x1F, 0x26, 0x1F, 0x2A, 0x1F, 0x2B, 0x1F, 0x2C, 0x1F, 0x2D, 0x1F, 0x2E, 0x1F, 0x30, + 0x1F, 0x32, 0x1F, 0x33, 0x1F, 0x34, 0x1F, 0x35, 0x1F, 0x36, 0x1F, 0x37, 0x1F, 0x3A, 0x1F, 0x3B, + 0x1F, 0x3C, 0x1F, 0x3D, 0x1F, 0x3E, 0x1F, 0x42, 0x1F, 0x43, 0x1F, 0x44, 0x1F, 0x45, 0x1F, 0x4A, + 0x1F, 0x4B, 0x1F, 0x4C, 0x1F, 0x4D, 0x1F, 0x52, 0x1F, 0x53, 0x1F, 0x54, 0x1F, 0x55, 0x1F, 0x56, + 0x1F, 0x5B, 0x1F, 0x5D, 0x1F, 0x62, 0x1F, 0x63, 0x1F, 0x64, 0x1F, 0x65, 0x1F, 0x66, 0x1F, 0x68, + 0x1F, 0x6A, 0x1F, 0x6B, 0x1F, 0x6C, 0x1F, 0x6D, 0x1F, 0x6E, 0x1F, 0x6F, 0x1F, 0x76, 0x1F, 0x80, + 0x1F, 0x81, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x87, 0x1F, 0x88, + 0x1F, 0x89, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x8F, 0x1F, 0x90, + 0x1F, 0x91, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, 0x1F, 0x97, 0x1F, 0x98, + 0x1F, 0x99, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0x9F, 0x1F, 0xA0, + 0x1F, 0xA1, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA7, 0x1F, 0xA8, + 0x1F, 0xA9, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x1F, 0xAF, 0x1F, 0xB2, + 0x1F, 0xB4, 0x1F, 0xB7, 0x1F, 0xC2, 0x1F, 0xC4, 0x1F, 0xC7, 0x1F, 0xD2, 0x1F, 0xD7, 0x1F, 0xE2, + 0x1F, 0xF2, 0x1F, 0xF4, 0x1F, 0xF7, 0x1F, 0xFA, 0x00, 0x01, 0x04, 0xC0, 0x00, 0x7B, 0x00, 0xFC, + 0x01, 0x02, 0x01, 0x08, 0x01, 0x0E, 0x01, 0x16, 0x01, 0x1E, 0x01, 0x26, 0x01, 0x2E, 0x01, 0x36, + 0x01, 0x3E, 0x01, 0x46, 0x01, 0x4E, 0x01, 0x56, 0x01, 0x5E, 0x01, 0x66, 0x01, 0x6E, 0x01, 0x76, + 0x01, 0x7E, 0x01, 0x86, 0x01, 0x8E, 0x01, 0x96, 0x01, 0x9E, 0x01, 0xA6, 0x01, 0xAE, 0x01, 0xB6, + 0x01, 0xBE, 0x01, 0xC6, 0x01, 0xCE, 0x01, 0xD6, 0x01, 0xDC, 0x01, 0xE4, 0x01, 0xEC, 0x01, 0xF4, + 0x01, 0xFC, 0x02, 0x04, 0x02, 0x0C, 0x02, 0x14, 0x02, 0x1C, 0x02, 0x24, 0x02, 0x2C, 0x02, 0x34, + 0x02, 0x3C, 0x02, 0x44, 0x02, 0x4C, 0x02, 0x54, 0x02, 0x5C, 0x02, 0x64, 0x02, 0x6C, 0x02, 0x74, + 0x02, 0x7C, 0x02, 0x84, 0x02, 0x8C, 0x02, 0x94, 0x02, 0x9C, 0x02, 0xA4, 0x02, 0xAC, 0x02, 0xB4, + 0x02, 0xBA, 0x02, 0xC2, 0x02, 0xCA, 0x02, 0xD2, 0x02, 0xDA, 0x02, 0xE2, 0x02, 0xE8, 0x02, 0xF0, + 0x02, 0xF8, 0x03, 0x00, 0x03, 0x08, 0x03, 0x10, 0x03, 0x18, 0x03, 0x20, 0x03, 0x28, 0x03, 0x30, + 0x03, 0x38, 0x03, 0x40, 0x03, 0x48, 0x03, 0x50, 0x03, 0x58, 0x03, 0x60, 0x03, 0x68, 0x03, 0x70, + 0x03, 0x78, 0x03, 0x80, 0x03, 0x88, 0x03, 0x90, 0x03, 0x98, 0x03, 0xA0, 0x03, 0xA8, 0x03, 0xB0, + 0x03, 0xB8, 0x03, 0xC0, 0x03, 0xC8, 0x03, 0xD0, 0x03, 0xD8, 0x03, 0xE0, 0x03, 0xE8, 0x03, 0xF0, + 0x03, 0xF8, 0x04, 0x00, 0x04, 0x08, 0x04, 0x10, 0x04, 0x18, 0x04, 0x20, 0x04, 0x28, 0x04, 0x30, + 0x04, 0x38, 0x04, 0x40, 0x04, 0x48, 0x04, 0x50, 0x04, 0x58, 0x04, 0x60, 0x04, 0x68, 0x04, 0x70, + 0x04, 0x76, 0x04, 0x7E, 0x04, 0x86, 0x04, 0x8C, 0x04, 0x94, 0x04, 0x9C, 0x04, 0xA4, 0x04, 0xAC, + 0x04, 0xB2, 0x04, 0xBA, 0x00, 0x02, 0x21, 0x26, 0x03, 0x41, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x44, + 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x08, 0x03, 0x01, 0x00, 0x03, + 0x03, 0xB1, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, + 0x03, 0xB1, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, + 0x03, 0x91, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0x91, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, + 0x03, 0x91, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0x91, 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, + 0x03, 0xB5, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, + 0x03, 0xB5, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, + 0x03, 0x95, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0x95, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, + 0x03, 0x95, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0x95, 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, + 0x03, 0xB7, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, + 0x03, 0xB7, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, + 0x03, 0x97, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0x97, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, + 0x03, 0x97, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0x97, 0x03, 0x14, 0x03, 0x41, 0x00, 0x02, + 0x1F, 0xBE, 0x03, 0x43, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB9, + 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB9, + 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x03, 0x99, + 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0x99, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x03, 0x99, + 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0x99, 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, 0x03, 0xBF, + 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xBF, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x03, 0xBF, + 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xBF, 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, 0x03, 0x9F, + 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0x9F, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x03, 0x9F, + 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0x9F, 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC5, + 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x03, 0xC5, + 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, 0x03, 0xA5, + 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x03, 0xA5, 0x03, 0x14, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC9, + 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x03, 0xC9, + 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x41, 0x00, 0x02, 0x21, 0x26, + 0x03, 0x43, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x14, + 0x03, 0x40, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x14, + 0x03, 0x41, 0x00, 0x03, 0x21, 0x26, 0x03, 0x13, 0x03, 0x42, 0x00, 0x02, 0x1F, 0xBE, 0x03, 0x40, + 0x00, 0x03, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x45, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x14, + 0x00, 0x03, 0x1F, 0x00, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x00, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x00, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x01, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x00, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x45, 0x03, 0x42, + 0x00, 0x03, 0x03, 0x91, 0x03, 0x13, 0x03, 0x45, 0x00, 0x03, 0x03, 0x91, 0x03, 0x45, 0x03, 0x14, + 0x00, 0x03, 0x1F, 0x08, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x00, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x08, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x01, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x08, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x45, 0x03, 0x42, + 0x00, 0x03, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x45, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x14, + 0x00, 0x03, 0x1F, 0x20, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x21, 0x03, 0x00, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x20, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x21, 0x03, 0x01, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x20, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x1F, 0x21, 0x03, 0x45, 0x03, 0x42, + 0x00, 0x03, 0x03, 0x97, 0x03, 0x13, 0x03, 0x45, 0x00, 0x03, 0x03, 0x97, 0x03, 0x45, 0x03, 0x14, + 0x00, 0x03, 0x1F, 0x28, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x00, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x28, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x01, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x28, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x45, 0x03, 0x42, + 0x00, 0x03, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x45, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x14, + 0x00, 0x03, 0x1F, 0x60, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x00, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x60, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x01, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x60, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x45, 0x03, 0x42, + 0x00, 0x03, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x45, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x14, + 0x00, 0x03, 0x1F, 0x68, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x69, 0x03, 0x00, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x68, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x69, 0x03, 0x01, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x68, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x1F, 0x69, 0x03, 0x45, 0x03, 0x42, + 0x00, 0x03, 0x03, 0xB1, 0x03, 0x00, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xB3, 0x03, 0x41, 0x00, 0x03, + 0x03, 0xB1, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x00, 0x03, 0x45, 0x00, 0x02, + 0x1F, 0xC3, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB9, + 0x03, 0x08, 0x03, 0x40, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x08, 0x03, 0x40, 0x00, 0x03, 0x03, 0xC9, + 0x03, 0x00, 0x03, 0x45, 0x00, 0x02, 0x1F, 0xF3, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, + 0x03, 0x42, 0x00, 0x02, 0x21, 0x26, 0x03, 0x40, 0x00, 0x01, 0x00, 0x7B, 0x03, 0x8F, 0x03, 0x90, + 0x03, 0xAF, 0x03, 0xB0, 0x1F, 0x02, 0x1F, 0x03, 0x1F, 0x04, 0x1F, 0x05, 0x1F, 0x0A, 0x1F, 0x0B, + 0x1F, 0x0C, 0x1F, 0x0D, 0x1F, 0x12, 0x1F, 0x13, 0x1F, 0x14, 0x1F, 0x15, 0x1F, 0x1A, 0x1F, 0x1B, + 0x1F, 0x1C, 0x1F, 0x1D, 0x1F, 0x22, 0x1F, 0x23, 0x1F, 0x24, 0x1F, 0x25, 0x1F, 0x2A, 0x1F, 0x2B, + 0x1F, 0x2C, 0x1F, 0x2D, 0x1F, 0x30, 0x1F, 0x32, 0x1F, 0x33, 0x1F, 0x34, 0x1F, 0x35, 0x1F, 0x36, + 0x1F, 0x3A, 0x1F, 0x3B, 0x1F, 0x3C, 0x1F, 0x3D, 0x1F, 0x42, 0x1F, 0x43, 0x1F, 0x44, 0x1F, 0x45, + 0x1F, 0x4A, 0x1F, 0x4B, 0x1F, 0x4C, 0x1F, 0x4D, 0x1F, 0x52, 0x1F, 0x53, 0x1F, 0x54, 0x1F, 0x55, + 0x1F, 0x5B, 0x1F, 0x5D, 0x1F, 0x62, 0x1F, 0x63, 0x1F, 0x64, 0x1F, 0x65, 0x1F, 0x68, 0x1F, 0x6A, + 0x1F, 0x6B, 0x1F, 0x6C, 0x1F, 0x6D, 0x1F, 0x6E, 0x1F, 0x76, 0x1F, 0x80, 0x1F, 0x81, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x87, 0x1F, 0x88, 0x1F, 0x89, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x8F, 0x1F, 0x90, 0x1F, 0x91, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, 0x1F, 0x97, 0x1F, 0x98, 0x1F, 0x99, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0x9F, 0x1F, 0xA0, 0x1F, 0xA1, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA7, 0x1F, 0xA8, 0x1F, 0xA9, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x1F, 0xAF, 0x1F, 0xB2, 0x1F, 0xB4, 0x1F, 0xB7, - 0x1F, 0xC2, 0x1F, 0xC4, 0x1F, 0xC7, 0x1F, 0xD2, 0x1F, 0xD3, 0x1F, 0xE2, 0x1F, 0xE3, 0x1F, 0xF2, - 0x1F, 0xF4, 0x1F, 0xF7, 0x1F, 0xFA, 0x1F, 0xFB, 0x00, 0x01, 0x03, 0x62, 0x00, 0x56, 0x00, 0xB2, - 0x00, 0xBA, 0x00, 0xC2, 0x00, 0xCA, 0x00, 0xD2, 0x00, 0xDA, 0x00, 0xE2, 0x00, 0xEA, 0x00, 0xF2, - 0x00, 0xFA, 0x01, 0x02, 0x01, 0x0A, 0x01, 0x12, 0x01, 0x1A, 0x01, 0x22, 0x01, 0x2A, 0x01, 0x32, - 0x01, 0x3A, 0x01, 0x42, 0x01, 0x4A, 0x01, 0x52, 0x01, 0x5A, 0x01, 0x62, 0x01, 0x6A, 0x01, 0x72, - 0x01, 0x7A, 0x01, 0x82, 0x01, 0x8A, 0x01, 0x92, 0x01, 0x9A, 0x01, 0xA2, 0x01, 0xAA, 0x01, 0xB2, - 0x01, 0xBA, 0x01, 0xC2, 0x01, 0xCA, 0x01, 0xD2, 0x01, 0xDA, 0x01, 0xE2, 0x01, 0xEA, 0x01, 0xF2, - 0x01, 0xFA, 0x02, 0x02, 0x02, 0x0A, 0x02, 0x12, 0x02, 0x1A, 0x02, 0x22, 0x02, 0x2A, 0x02, 0x32, - 0x02, 0x3A, 0x02, 0x42, 0x02, 0x4A, 0x02, 0x52, 0x02, 0x5A, 0x02, 0x62, 0x02, 0x6A, 0x02, 0x72, - 0x02, 0x7A, 0x02, 0x82, 0x02, 0x8A, 0x02, 0x92, 0x02, 0x9A, 0x02, 0xA2, 0x02, 0xAA, 0x02, 0xB2, - 0x02, 0xBA, 0x02, 0xC2, 0x02, 0xCA, 0x02, 0xD2, 0x02, 0xDA, 0x02, 0xE2, 0x02, 0xEA, 0x02, 0xF2, - 0x02, 0xFA, 0x03, 0x02, 0x03, 0x0A, 0x03, 0x12, 0x03, 0x1A, 0x03, 0x22, 0x03, 0x2A, 0x03, 0x32, - 0x03, 0x3A, 0x03, 0x42, 0x03, 0x4A, 0x03, 0x52, 0x03, 0x5A, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x08, - 0x03, 0x01, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x43, - 0x03, 0x00, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x03, 0x91, 0x03, 0x43, - 0x03, 0x00, 0x00, 0x03, 0x03, 0x91, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x43, - 0x03, 0x00, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x03, 0x95, 0x03, 0x43, - 0x03, 0x00, 0x00, 0x03, 0x03, 0x95, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x43, - 0x03, 0x00, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x03, 0x97, 0x03, 0x43, - 0x03, 0x00, 0x00, 0x03, 0x03, 0x97, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x43, - 0x03, 0x00, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x43, - 0x03, 0x01, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x43, - 0x03, 0x42, 0x00, 0x03, 0x03, 0x99, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x03, 0x99, 0x03, 0x43, - 0x03, 0x01, 0x00, 0x03, 0x03, 0xBF, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x03, 0xBF, 0x03, 0x43, - 0x03, 0x01, 0x00, 0x03, 0x03, 0x9F, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x03, 0x9F, 0x03, 0x43, - 0x03, 0x01, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x43, - 0x03, 0x01, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x43, - 0x03, 0x01, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x21, 0x26, 0x03, 0x14, - 0x03, 0x00, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x21, 0x26, 0x03, 0x14, - 0x03, 0x01, 0x00, 0x03, 0x21, 0x26, 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x43, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x00, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x40, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x00, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x41, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x14, - 0x03, 0x42, 0x00, 0x03, 0x03, 0x91, 0x03, 0x43, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x08, 0x03, 0x40, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x08, 0x03, 0x41, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x13, - 0x03, 0x42, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x43, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x20, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x21, 0x03, 0x40, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x20, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x21, 0x03, 0x41, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x14, - 0x03, 0x42, 0x00, 0x03, 0x03, 0x97, 0x03, 0x43, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x28, 0x03, 0x40, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x28, 0x03, 0x41, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x13, - 0x03, 0x42, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x43, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x60, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x40, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x60, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x41, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x14, - 0x03, 0x42, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x45, 0x00, 0x03, 0x21, 0x26, 0x03, 0x14, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x68, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x69, 0x03, 0x40, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0x68, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x69, 0x03, 0x41, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x14, - 0x03, 0x42, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x01, - 0x03, 0x45, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x01, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x08, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x08, - 0x03, 0x01, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x40, - 0x03, 0x45, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x01, 0x03, 0x45, 0x00, 0x01, 0x00, 0x56, 0x03, 0x90, - 0x03, 0xB0, 0x1F, 0x02, 0x1F, 0x04, 0x1F, 0x0A, 0x1F, 0x0C, 0x1F, 0x12, 0x1F, 0x14, 0x1F, 0x1A, - 0x1F, 0x1C, 0x1F, 0x22, 0x1F, 0x24, 0x1F, 0x2A, 0x1F, 0x2C, 0x1F, 0x32, 0x1F, 0x33, 0x1F, 0x34, - 0x1F, 0x35, 0x1F, 0x36, 0x1F, 0x3A, 0x1F, 0x3C, 0x1F, 0x42, 0x1F, 0x44, 0x1F, 0x4A, 0x1F, 0x4C, - 0x1F, 0x52, 0x1F, 0x54, 0x1F, 0x62, 0x1F, 0x64, 0x1F, 0x6A, 0x1F, 0x6B, 0x1F, 0x6C, 0x1F, 0x6D, - 0x1F, 0x6E, 0x1F, 0x80, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x87, - 0x1F, 0x88, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x8F, 0x1F, 0x90, - 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, 0x1F, 0x97, 0x1F, 0x98, 0x1F, 0x9A, - 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0x9F, 0x1F, 0xA0, 0x1F, 0xA2, 0x1F, 0xA3, - 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA7, 0x1F, 0xA8, 0x1F, 0xA9, 0x1F, 0xAA, 0x1F, 0xAB, - 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x1F, 0xAF, 0x1F, 0xB2, 0x1F, 0xB4, 0x1F, 0xC2, 0x1F, 0xC4, - 0x1F, 0xD2, 0x1F, 0xD3, 0x1F, 0xE3, 0x1F, 0xF2, 0x1F, 0xF4, 0x00, 0x01, 0x03, 0x46, 0x00, 0x52, - 0x00, 0xAA, 0x00, 0xB2, 0x00, 0xBA, 0x00, 0xC2, 0x00, 0xCA, 0x00, 0xD2, 0x00, 0xDA, 0x00, 0xE2, - 0x00, 0xEA, 0x00, 0xF2, 0x00, 0xFA, 0x01, 0x02, 0x01, 0x0A, 0x01, 0x12, 0x01, 0x1A, 0x01, 0x22, - 0x01, 0x2A, 0x01, 0x32, 0x01, 0x3A, 0x01, 0x42, 0x01, 0x4A, 0x01, 0x52, 0x01, 0x5A, 0x01, 0x62, - 0x01, 0x6A, 0x01, 0x72, 0x01, 0x7A, 0x01, 0x82, 0x01, 0x8A, 0x01, 0x92, 0x01, 0x9A, 0x01, 0xA2, - 0x01, 0xAA, 0x01, 0xB2, 0x01, 0xBA, 0x01, 0xC2, 0x01, 0xCA, 0x01, 0xD2, 0x01, 0xDC, 0x01, 0xE4, - 0x01, 0xEC, 0x01, 0xF4, 0x01, 0xFC, 0x02, 0x04, 0x02, 0x0C, 0x02, 0x16, 0x02, 0x1E, 0x02, 0x26, - 0x02, 0x2E, 0x02, 0x36, 0x02, 0x3E, 0x02, 0x46, 0x02, 0x50, 0x02, 0x58, 0x02, 0x60, 0x02, 0x68, - 0x02, 0x70, 0x02, 0x78, 0x02, 0x80, 0x02, 0x8A, 0x02, 0x92, 0x02, 0x9A, 0x02, 0xA2, 0x02, 0xAA, - 0x02, 0xB2, 0x02, 0xBA, 0x02, 0xC4, 0x02, 0xCC, 0x02, 0xD4, 0x02, 0xDC, 0x02, 0xE4, 0x02, 0xEC, - 0x02, 0xF4, 0x02, 0xFC, 0x03, 0x06, 0x03, 0x0E, 0x03, 0x16, 0x03, 0x1E, 0x03, 0x26, 0x03, 0x2E, - 0x03, 0x36, 0x03, 0x3E, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB1, + 0x1F, 0xC2, 0x1F, 0xC4, 0x1F, 0xC7, 0x1F, 0xD2, 0x1F, 0xE2, 0x1F, 0xF2, 0x1F, 0xF4, 0x1F, 0xF7, + 0x1F, 0xFA, 0x00, 0x01, 0x03, 0x4E, 0x00, 0x54, 0x00, 0xAE, 0x00, 0xB6, 0x00, 0xBE, 0x00, 0xC6, + 0x00, 0xCE, 0x00, 0xD6, 0x00, 0xDE, 0x00, 0xE6, 0x00, 0xEE, 0x00, 0xF6, 0x00, 0xFE, 0x01, 0x06, + 0x01, 0x0E, 0x01, 0x16, 0x01, 0x1E, 0x01, 0x26, 0x01, 0x2E, 0x01, 0x36, 0x01, 0x3E, 0x01, 0x46, + 0x01, 0x4E, 0x01, 0x56, 0x01, 0x5E, 0x01, 0x66, 0x01, 0x6E, 0x01, 0x76, 0x01, 0x7E, 0x01, 0x86, + 0x01, 0x8E, 0x01, 0x96, 0x01, 0x9E, 0x01, 0xA6, 0x01, 0xAE, 0x01, 0xB6, 0x01, 0xBE, 0x01, 0xC6, + 0x01, 0xCE, 0x01, 0xD6, 0x01, 0xDE, 0x01, 0xE6, 0x01, 0xEE, 0x01, 0xF6, 0x01, 0xFE, 0x02, 0x06, + 0x02, 0x0E, 0x02, 0x16, 0x02, 0x1E, 0x02, 0x26, 0x02, 0x2E, 0x02, 0x36, 0x02, 0x3E, 0x02, 0x46, + 0x02, 0x4E, 0x02, 0x56, 0x02, 0x5E, 0x02, 0x66, 0x02, 0x6E, 0x02, 0x76, 0x02, 0x7E, 0x02, 0x86, + 0x02, 0x8E, 0x02, 0x96, 0x02, 0x9E, 0x02, 0xA6, 0x02, 0xAE, 0x02, 0xB6, 0x02, 0xBE, 0x02, 0xC6, + 0x02, 0xCE, 0x02, 0xD6, 0x02, 0xDE, 0x02, 0xE6, 0x02, 0xEE, 0x02, 0xF6, 0x02, 0xFE, 0x03, 0x06, + 0x03, 0x0E, 0x03, 0x16, 0x03, 0x1E, 0x03, 0x26, 0x03, 0x2E, 0x03, 0x36, 0x03, 0x3E, 0x03, 0x46, + 0x00, 0x03, 0x03, 0xB9, 0x03, 0x08, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x08, 0x03, 0x41, + 0x00, 0x03, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x01, + 0x00, 0x03, 0x03, 0x91, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x03, 0x91, 0x03, 0x43, 0x03, 0x01, + 0x00, 0x03, 0x03, 0xB5, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x43, 0x03, 0x01, + 0x00, 0x03, 0x03, 0x95, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x03, 0x95, 0x03, 0x43, 0x03, 0x01, + 0x00, 0x03, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x01, + 0x00, 0x03, 0x03, 0x97, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x03, 0x97, 0x03, 0x43, 0x03, 0x01, + 0x00, 0x03, 0x03, 0xB9, 0x03, 0x43, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x14, 0x03, 0x00, + 0x00, 0x03, 0x03, 0xB9, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x14, 0x03, 0x01, + 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x43, 0x03, 0x42, 0x00, 0x03, 0x03, 0x99, 0x03, 0x43, 0x03, 0x00, + 0x00, 0x03, 0x03, 0x99, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x03, 0xBF, 0x03, 0x43, 0x03, 0x00, + 0x00, 0x03, 0x03, 0xBF, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x03, 0x9F, 0x03, 0x43, 0x03, 0x00, + 0x00, 0x03, 0x03, 0x9F, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC5, 0x03, 0x43, 0x03, 0x00, + 0x00, 0x03, 0x03, 0xC5, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x00, + 0x00, 0x03, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x00, + 0x00, 0x03, 0x21, 0x26, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x01, + 0x00, 0x03, 0x21, 0x26, 0x03, 0x14, 0x03, 0x01, 0x00, 0x03, 0x21, 0x26, 0x03, 0x43, 0x03, 0x42, + 0x00, 0x03, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x00, 0x03, 0x40, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x01, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x00, 0x03, 0x41, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x01, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x13, 0x03, 0x42, + 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x03, 0x91, 0x03, 0x43, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x08, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x40, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x08, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x41, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x14, 0x03, 0x42, + 0x00, 0x03, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x20, 0x03, 0x40, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x21, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x20, 0x03, 0x41, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x21, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x13, 0x03, 0x42, + 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x03, 0x97, 0x03, 0x43, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x28, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x40, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x28, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x41, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x14, 0x03, 0x42, + 0x00, 0x03, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x60, 0x03, 0x40, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x61, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x60, 0x03, 0x41, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x61, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x13, 0x03, 0x42, + 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x45, + 0x00, 0x03, 0x21, 0x26, 0x03, 0x14, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x68, 0x03, 0x40, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x69, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0x68, 0x03, 0x41, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0x69, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x13, 0x03, 0x42, + 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x40, 0x03, 0x45, + 0x00, 0x03, 0x03, 0xB1, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x40, 0x03, 0x45, + 0x00, 0x03, 0x03, 0xB7, 0x03, 0x01, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x08, 0x03, 0x00, + 0x00, 0x03, 0x03, 0xC9, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x01, 0x03, 0x45, + 0x00, 0x01, 0x00, 0x54, 0x03, 0x90, 0x03, 0xB0, 0x1F, 0x02, 0x1F, 0x04, 0x1F, 0x0A, 0x1F, 0x0C, + 0x1F, 0x12, 0x1F, 0x14, 0x1F, 0x1A, 0x1F, 0x1C, 0x1F, 0x22, 0x1F, 0x24, 0x1F, 0x2A, 0x1F, 0x2C, + 0x1F, 0x32, 0x1F, 0x33, 0x1F, 0x34, 0x1F, 0x35, 0x1F, 0x36, 0x1F, 0x3A, 0x1F, 0x3C, 0x1F, 0x42, + 0x1F, 0x44, 0x1F, 0x4A, 0x1F, 0x4C, 0x1F, 0x52, 0x1F, 0x54, 0x1F, 0x62, 0x1F, 0x64, 0x1F, 0x6A, + 0x1F, 0x6B, 0x1F, 0x6C, 0x1F, 0x6D, 0x1F, 0x6E, 0x1F, 0x80, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, + 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x87, 0x1F, 0x88, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, + 0x1F, 0x8E, 0x1F, 0x8F, 0x1F, 0x90, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, + 0x1F, 0x97, 0x1F, 0x98, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0x9F, + 0x1F, 0xA0, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA7, 0x1F, 0xA8, + 0x1F, 0xA9, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x1F, 0xAF, 0x1F, 0xB2, + 0x1F, 0xB4, 0x1F, 0xC2, 0x1F, 0xC4, 0x1F, 0xD2, 0x1F, 0xF2, 0x1F, 0xF4, 0x00, 0x01, 0x03, 0x3C, + 0x00, 0x51, 0x00, 0xA8, 0x00, 0xB0, 0x00, 0xB8, 0x00, 0xC0, 0x00, 0xC8, 0x00, 0xD0, 0x00, 0xD8, + 0x00, 0xE0, 0x00, 0xE8, 0x00, 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x01, 0x08, 0x01, 0x10, 0x01, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x01, 0x30, 0x01, 0x38, 0x01, 0x40, 0x01, 0x48, 0x01, 0x50, 0x01, 0x58, + 0x01, 0x60, 0x01, 0x68, 0x01, 0x70, 0x01, 0x78, 0x01, 0x80, 0x01, 0x88, 0x01, 0x90, 0x01, 0x98, + 0x01, 0xA0, 0x01, 0xA8, 0x01, 0xB0, 0x01, 0xB8, 0x01, 0xC0, 0x01, 0xC8, 0x01, 0xD0, 0x01, 0xDA, + 0x01, 0xE2, 0x01, 0xEA, 0x01, 0xF2, 0x01, 0xFA, 0x02, 0x02, 0x02, 0x0A, 0x02, 0x14, 0x02, 0x1C, + 0x02, 0x24, 0x02, 0x2C, 0x02, 0x34, 0x02, 0x3C, 0x02, 0x44, 0x02, 0x4E, 0x02, 0x56, 0x02, 0x5E, + 0x02, 0x66, 0x02, 0x6E, 0x02, 0x76, 0x02, 0x7E, 0x02, 0x88, 0x02, 0x90, 0x02, 0x98, 0x02, 0xA0, + 0x02, 0xA8, 0x02, 0xB0, 0x02, 0xB8, 0x02, 0xC2, 0x02, 0xCA, 0x02, 0xD2, 0x02, 0xDA, 0x02, 0xE2, + 0x02, 0xEA, 0x02, 0xF2, 0x02, 0xFA, 0x03, 0x04, 0x03, 0x0C, 0x03, 0x14, 0x03, 0x1C, 0x03, 0x24, + 0x03, 0x2C, 0x03, 0x34, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x41, 0x00, 0x03, 0x03, 0x91, 0x03, 0x43, 0x03, 0x40, 0x00, 0x03, 0x03, 0x91, 0x03, 0x43, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x43, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB5, 0x03, 0x43, 0x03, 0x41, 0x00, 0x03, 0x03, 0x95, @@ -1960,1728 +1911,1637 @@ const le_uint8 CanonShaping::glyphSubstitutionTable[] = { 0x1F, 0xFC, 0x03, 0x43, 0x03, 0x42, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x41, 0x03, 0x45, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x00, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x41, 0x03, 0x45, - 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x08, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB9, 0x03, 0x08, 0x03, 0x41, - 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x00, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x41, 0x03, 0x45, - 0x00, 0x01, 0x00, 0x52, 0x03, 0x90, 0x1F, 0x02, 0x1F, 0x04, 0x1F, 0x0A, 0x1F, 0x0C, 0x1F, 0x12, - 0x1F, 0x14, 0x1F, 0x1A, 0x1F, 0x1C, 0x1F, 0x22, 0x1F, 0x24, 0x1F, 0x2A, 0x1F, 0x2C, 0x1F, 0x32, - 0x1F, 0x33, 0x1F, 0x34, 0x1F, 0x35, 0x1F, 0x3A, 0x1F, 0x3C, 0x1F, 0x42, 0x1F, 0x44, 0x1F, 0x4A, - 0x1F, 0x4C, 0x1F, 0x52, 0x1F, 0x54, 0x1F, 0x62, 0x1F, 0x64, 0x1F, 0x6A, 0x1F, 0x6B, 0x1F, 0x6C, - 0x1F, 0x6D, 0x1F, 0x80, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x87, - 0x1F, 0x88, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x8F, 0x1F, 0x90, - 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, 0x1F, 0x97, 0x1F, 0x98, 0x1F, 0x9A, - 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0x9F, 0x1F, 0xA0, 0x1F, 0xA2, 0x1F, 0xA3, - 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA7, 0x1F, 0xA8, 0x1F, 0xA9, 0x1F, 0xAA, 0x1F, 0xAB, - 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x1F, 0xAF, 0x1F, 0xB2, 0x1F, 0xB4, 0x1F, 0xC2, 0x1F, 0xC4, - 0x1F, 0xD2, 0x1F, 0xD3, 0x1F, 0xF2, 0x1F, 0xF4, 0x00, 0x01, 0x02, 0x3A, 0x00, 0x36, 0x00, 0x72, - 0x00, 0x7A, 0x00, 0x82, 0x00, 0x8A, 0x00, 0x92, 0x00, 0x9A, 0x00, 0xA2, 0x00, 0xAA, 0x00, 0xB2, - 0x00, 0xBA, 0x00, 0xC2, 0x00, 0xCC, 0x00, 0xD6, 0x00, 0xDE, 0x00, 0xE6, 0x00, 0xEE, 0x00, 0xF6, - 0x00, 0xFE, 0x01, 0x08, 0x01, 0x12, 0x01, 0x1A, 0x01, 0x22, 0x01, 0x2A, 0x01, 0x32, 0x01, 0x3A, - 0x01, 0x44, 0x01, 0x4E, 0x01, 0x56, 0x01, 0x5E, 0x01, 0x66, 0x01, 0x6E, 0x01, 0x76, 0x01, 0x80, - 0x01, 0x8A, 0x01, 0x92, 0x01, 0x9A, 0x01, 0xA2, 0x01, 0xAA, 0x01, 0xB2, 0x01, 0xBC, 0x01, 0xC6, - 0x01, 0xCE, 0x01, 0xD6, 0x01, 0xDE, 0x01, 0xE6, 0x01, 0xEE, 0x01, 0xF8, 0x02, 0x02, 0x02, 0x0A, - 0x02, 0x12, 0x02, 0x1A, 0x02, 0x22, 0x02, 0x2A, 0x02, 0x32, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x08, - 0x03, 0x01, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x13, - 0x03, 0x01, 0x00, 0x03, 0x21, 0x26, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x21, 0x26, 0x03, 0x13, - 0x03, 0x01, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x43, 0x00, 0x03, 0x1F, 0x00, 0x03, 0x45, - 0x03, 0x40, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x1F, 0x00, 0x03, 0x45, - 0x03, 0x41, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, - 0x03, 0x42, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, - 0x03, 0x91, 0x03, 0x45, 0x03, 0x43, 0x00, 0x03, 0x1F, 0x08, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, - 0x1F, 0x09, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x1F, 0x08, 0x03, 0x45, 0x03, 0x41, 0x00, 0x03, - 0x1F, 0x09, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x42, 0x03, 0x45, - 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x45, - 0x03, 0x43, 0x00, 0x03, 0x1F, 0x20, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x1F, 0x21, 0x03, 0x45, - 0x03, 0x40, 0x00, 0x03, 0x1F, 0x20, 0x03, 0x45, 0x03, 0x41, 0x00, 0x03, 0x1F, 0x21, 0x03, 0x45, - 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x42, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, - 0x03, 0x14, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0x97, 0x03, 0x45, 0x03, 0x43, 0x00, 0x03, - 0x1F, 0x28, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, - 0x1F, 0x28, 0x03, 0x45, 0x03, 0x41, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, - 0x03, 0x97, 0x03, 0x13, 0x03, 0x42, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x14, 0x03, 0x45, - 0x03, 0x42, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x43, 0x00, 0x03, 0x1F, 0x60, 0x03, 0x45, - 0x03, 0x40, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x1F, 0x60, 0x03, 0x45, - 0x03, 0x41, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x13, - 0x03, 0x42, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, - 0x03, 0xA9, 0x03, 0x45, 0x03, 0x43, 0x00, 0x03, 0x1F, 0x68, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, - 0x1F, 0x69, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x1F, 0x68, 0x03, 0x45, 0x03, 0x41, 0x00, 0x03, - 0x1F, 0x69, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x42, 0x03, 0x45, - 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x45, - 0x03, 0x40, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x45, - 0x03, 0x40, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x08, - 0x03, 0x01, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, - 0x03, 0x01, 0x00, 0x01, 0x00, 0x36, 0x03, 0x90, 0x1F, 0x32, 0x1F, 0x34, 0x1F, 0x6A, 0x1F, 0x6C, - 0x1F, 0x80, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x87, 0x1F, 0x88, - 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x8F, 0x1F, 0x90, 0x1F, 0x92, - 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, 0x1F, 0x97, 0x1F, 0x98, 0x1F, 0x9A, 0x1F, 0x9B, - 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0x9F, 0x1F, 0xA0, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, - 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA7, 0x1F, 0xA8, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, - 0x1F, 0xAE, 0x1F, 0xAF, 0x1F, 0xB2, 0x1F, 0xB4, 0x1F, 0xC2, 0x1F, 0xC4, 0x1F, 0xD3, 0x1F, 0xF2, - 0x1F, 0xF4, 0x00, 0x01, 0x01, 0xEA, 0x00, 0x2E, 0x00, 0x62, 0x00, 0x6A, 0x00, 0x72, 0x00, 0x7A, - 0x00, 0x82, 0x00, 0x8A, 0x00, 0x92, 0x00, 0x9A, 0x00, 0xA2, 0x00, 0xAA, 0x00, 0xB4, 0x00, 0xBE, - 0x00, 0xC6, 0x00, 0xCE, 0x00, 0xD6, 0x00, 0xDE, 0x00, 0xE8, 0x00, 0xF2, 0x00, 0xFA, 0x01, 0x02, - 0x01, 0x0A, 0x01, 0x12, 0x01, 0x1C, 0x01, 0x26, 0x01, 0x2E, 0x01, 0x36, 0x01, 0x3E, 0x01, 0x46, - 0x01, 0x50, 0x01, 0x5A, 0x01, 0x62, 0x01, 0x6A, 0x01, 0x72, 0x01, 0x7A, 0x01, 0x84, 0x01, 0x8E, - 0x01, 0x96, 0x01, 0x9E, 0x01, 0xA6, 0x01, 0xAE, 0x01, 0xB6, 0x01, 0xC0, 0x01, 0xCA, 0x01, 0xD2, - 0x01, 0xDA, 0x01, 0xE2, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xBE, - 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x21, 0x26, - 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x21, 0x26, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xB3, - 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xB3, - 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB1, - 0x03, 0x13, 0x03, 0x45, 0x03, 0x42, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x14, 0x03, 0x42, - 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x14, 0x03, 0x00, - 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x14, 0x03, 0x01, - 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x45, 0x03, 0x42, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, - 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xC3, - 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xC3, - 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x45, 0x03, 0x42, 0x00, 0x04, - 0x03, 0xB7, 0x03, 0x45, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x13, 0x03, 0x00, - 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x13, 0x03, 0x01, - 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x45, - 0x03, 0x42, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xF3, - 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xF3, - 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0xC9, - 0x03, 0x13, 0x03, 0x45, 0x03, 0x42, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x42, - 0x00, 0x03, 0x21, 0x26, 0x03, 0x13, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x13, 0x03, 0x00, - 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x13, 0x03, 0x01, - 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x45, - 0x03, 0x42, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB1, - 0x03, 0x45, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xBE, - 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x41, 0x00, 0x01, 0x00, 0x2E, + 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x08, 0x03, 0x40, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x00, + 0x00, 0x03, 0x03, 0xC9, 0x03, 0x41, 0x03, 0x45, 0x00, 0x01, 0x00, 0x51, 0x03, 0x90, 0x1F, 0x02, + 0x1F, 0x04, 0x1F, 0x0A, 0x1F, 0x0C, 0x1F, 0x12, 0x1F, 0x14, 0x1F, 0x1A, 0x1F, 0x1C, 0x1F, 0x22, + 0x1F, 0x24, 0x1F, 0x2A, 0x1F, 0x2C, 0x1F, 0x32, 0x1F, 0x33, 0x1F, 0x34, 0x1F, 0x35, 0x1F, 0x3A, + 0x1F, 0x3C, 0x1F, 0x42, 0x1F, 0x44, 0x1F, 0x4A, 0x1F, 0x4C, 0x1F, 0x52, 0x1F, 0x54, 0x1F, 0x62, + 0x1F, 0x64, 0x1F, 0x6A, 0x1F, 0x6B, 0x1F, 0x6C, 0x1F, 0x6D, 0x1F, 0x80, 0x1F, 0x82, 0x1F, 0x83, + 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x87, 0x1F, 0x88, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, + 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x8F, 0x1F, 0x90, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, + 0x1F, 0x96, 0x1F, 0x97, 0x1F, 0x98, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, + 0x1F, 0x9F, 0x1F, 0xA0, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA7, + 0x1F, 0xA8, 0x1F, 0xA9, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x1F, 0xAF, + 0x1F, 0xB2, 0x1F, 0xB4, 0x1F, 0xC2, 0x1F, 0xC4, 0x1F, 0xD2, 0x1F, 0xF2, 0x1F, 0xF4, 0x00, 0x01, + 0x02, 0x30, 0x00, 0x35, 0x00, 0x70, 0x00, 0x78, 0x00, 0x80, 0x00, 0x88, 0x00, 0x90, 0x00, 0x98, + 0x00, 0xA0, 0x00, 0xA8, 0x00, 0xB0, 0x00, 0xB8, 0x00, 0xC0, 0x00, 0xCA, 0x00, 0xD4, 0x00, 0xDC, + 0x00, 0xE4, 0x00, 0xEC, 0x00, 0xF4, 0x00, 0xFC, 0x01, 0x06, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x01, 0x30, 0x01, 0x38, 0x01, 0x42, 0x01, 0x4C, 0x01, 0x54, 0x01, 0x5C, 0x01, 0x64, + 0x01, 0x6C, 0x01, 0x74, 0x01, 0x7E, 0x01, 0x88, 0x01, 0x90, 0x01, 0x98, 0x01, 0xA0, 0x01, 0xA8, + 0x01, 0xB0, 0x01, 0xBA, 0x01, 0xC4, 0x01, 0xCC, 0x01, 0xD4, 0x01, 0xDC, 0x01, 0xE4, 0x01, 0xEC, + 0x01, 0xF6, 0x02, 0x00, 0x02, 0x08, 0x02, 0x10, 0x02, 0x18, 0x02, 0x20, 0x02, 0x28, 0x00, 0x03, + 0x1F, 0xBE, 0x03, 0x08, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, + 0x1F, 0xBE, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x21, 0x26, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, + 0x21, 0x26, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x43, 0x00, 0x03, + 0x1F, 0x00, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, + 0x1F, 0x00, 0x03, 0x45, 0x03, 0x41, 0x00, 0x03, 0x1F, 0x01, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, + 0x03, 0xB1, 0x03, 0x13, 0x03, 0x42, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x45, + 0x03, 0x42, 0x00, 0x03, 0x03, 0x91, 0x03, 0x45, 0x03, 0x43, 0x00, 0x03, 0x1F, 0x08, 0x03, 0x45, + 0x03, 0x40, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x1F, 0x08, 0x03, 0x45, + 0x03, 0x41, 0x00, 0x03, 0x1F, 0x09, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, + 0x03, 0x42, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, + 0x03, 0xB7, 0x03, 0x45, 0x03, 0x43, 0x00, 0x03, 0x1F, 0x20, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, + 0x1F, 0x21, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x1F, 0x20, 0x03, 0x45, 0x03, 0x41, 0x00, 0x03, + 0x1F, 0x21, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x42, 0x03, 0x45, + 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0x97, 0x03, 0x45, + 0x03, 0x43, 0x00, 0x03, 0x1F, 0x28, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x45, + 0x03, 0x40, 0x00, 0x03, 0x1F, 0x28, 0x03, 0x45, 0x03, 0x41, 0x00, 0x03, 0x1F, 0x29, 0x03, 0x45, + 0x03, 0x41, 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x42, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, + 0x03, 0x14, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x43, 0x00, 0x03, + 0x1F, 0x60, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, + 0x1F, 0x60, 0x03, 0x45, 0x03, 0x41, 0x00, 0x03, 0x1F, 0x61, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, + 0x03, 0xC9, 0x03, 0x13, 0x03, 0x42, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x45, + 0x03, 0x42, 0x00, 0x03, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x43, 0x00, 0x03, 0x1F, 0x68, 0x03, 0x45, + 0x03, 0x40, 0x00, 0x03, 0x1F, 0x69, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x1F, 0x68, 0x03, 0x45, + 0x03, 0x41, 0x00, 0x03, 0x1F, 0x69, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, + 0x03, 0x42, 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, + 0x03, 0xB1, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x01, 0x00, 0x03, + 0x03, 0xB7, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x01, 0x00, 0x03, + 0x03, 0xC9, 0x03, 0x45, 0x03, 0x40, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x01, 0x00, 0x01, + 0x00, 0x35, 0x03, 0x90, 0x1F, 0x32, 0x1F, 0x34, 0x1F, 0x6A, 0x1F, 0x6C, 0x1F, 0x80, 0x1F, 0x82, + 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x87, 0x1F, 0x88, 0x1F, 0x8A, 0x1F, 0x8B, + 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x8F, 0x1F, 0x90, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, + 0x1F, 0x95, 0x1F, 0x96, 0x1F, 0x97, 0x1F, 0x98, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, + 0x1F, 0x9E, 0x1F, 0x9F, 0x1F, 0xA0, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, + 0x1F, 0xA7, 0x1F, 0xA8, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x1F, 0xAF, + 0x1F, 0xB2, 0x1F, 0xB4, 0x1F, 0xC2, 0x1F, 0xC4, 0x1F, 0xF2, 0x1F, 0xF4, 0x00, 0x01, 0x01, 0xE0, + 0x00, 0x2D, 0x00, 0x60, 0x00, 0x68, 0x00, 0x70, 0x00, 0x78, 0x00, 0x80, 0x00, 0x88, 0x00, 0x90, + 0x00, 0x98, 0x00, 0xA0, 0x00, 0xA8, 0x00, 0xB2, 0x00, 0xBC, 0x00, 0xC4, 0x00, 0xCC, 0x00, 0xD4, + 0x00, 0xDC, 0x00, 0xE6, 0x00, 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x01, 0x08, 0x01, 0x10, 0x01, 0x1A, + 0x01, 0x24, 0x01, 0x2C, 0x01, 0x34, 0x01, 0x3C, 0x01, 0x44, 0x01, 0x4E, 0x01, 0x58, 0x01, 0x60, + 0x01, 0x68, 0x01, 0x70, 0x01, 0x78, 0x01, 0x82, 0x01, 0x8C, 0x01, 0x94, 0x01, 0x9C, 0x01, 0xA4, + 0x01, 0xAC, 0x01, 0xB4, 0x01, 0xBE, 0x01, 0xC8, 0x01, 0xD0, 0x01, 0xD8, 0x00, 0x03, 0x1F, 0xBE, + 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xBE, + 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x21, 0x26, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x21, 0x26, + 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xB3, + 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xB3, + 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x45, 0x03, 0x42, 0x00, 0x04, + 0x03, 0xB1, 0x03, 0x45, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x13, 0x03, 0x00, + 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x13, 0x03, 0x01, + 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x45, + 0x03, 0x42, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xC3, + 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xC3, + 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB7, + 0x03, 0x13, 0x03, 0x45, 0x03, 0x42, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x14, 0x03, 0x42, + 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x14, 0x03, 0x00, + 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x14, 0x03, 0x01, + 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x45, 0x03, 0x42, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, + 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xF3, + 0x03, 0x14, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xF3, + 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x45, 0x03, 0x42, 0x00, 0x04, + 0x03, 0xC9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x21, 0x26, 0x03, 0x13, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x13, 0x03, 0x00, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x14, 0x03, 0x00, + 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x13, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x14, 0x03, 0x01, + 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x45, 0x03, 0x42, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, + 0x03, 0x14, 0x03, 0x42, 0x00, 0x03, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x41, 0x00, 0x03, 0x03, 0xB7, + 0x03, 0x45, 0x03, 0x41, 0x00, 0x03, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x41, 0x00, 0x01, 0x00, 0x2D, 0x03, 0x90, 0x1F, 0x32, 0x1F, 0x34, 0x1F, 0x6A, 0x1F, 0x6C, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x87, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x8F, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, 0x1F, 0x97, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0x9F, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA7, 0x1F, 0xA8, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, - 0x1F, 0xAE, 0x1F, 0xAF, 0x1F, 0xB4, 0x1F, 0xC4, 0x1F, 0xD3, 0x1F, 0xF4, 0x00, 0x01, 0x01, 0x7C, - 0x00, 0x24, 0x00, 0x4E, 0x00, 0x56, 0x00, 0x5E, 0x00, 0x66, 0x00, 0x6E, 0x00, 0x76, 0x00, 0x7E, - 0x00, 0x86, 0x00, 0x8E, 0x00, 0x98, 0x00, 0xA0, 0x00, 0xA8, 0x00, 0xB0, 0x00, 0xB8, 0x00, 0xC2, - 0x00, 0xCA, 0x00, 0xD2, 0x00, 0xDA, 0x00, 0xE2, 0x00, 0xEC, 0x00, 0xF4, 0x00, 0xFC, 0x01, 0x04, - 0x01, 0x0C, 0x01, 0x16, 0x01, 0x1E, 0x01, 0x26, 0x01, 0x2E, 0x01, 0x36, 0x01, 0x40, 0x01, 0x48, - 0x01, 0x50, 0x01, 0x58, 0x01, 0x60, 0x01, 0x68, 0x01, 0x72, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x43, - 0x03, 0x00, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x21, 0x26, 0x03, 0x43, - 0x03, 0x00, 0x00, 0x03, 0x21, 0x26, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x13, - 0x03, 0x40, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x13, - 0x03, 0x41, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, - 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xBC, - 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xBC, - 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, - 0x1F, 0xC3, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, - 0x1F, 0xC3, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, - 0x03, 0xB7, 0x03, 0x43, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x13, 0x03, 0x40, - 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x13, 0x03, 0x41, - 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x42, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x14, - 0x03, 0x40, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x14, - 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x21, 0x26, - 0x03, 0x43, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xFC, - 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xFC, - 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x42, 0x03, 0x45, 0x00, 0x04, - 0x21, 0x26, 0x03, 0x14, 0x03, 0x42, 0x03, 0x45, 0x00, 0x01, 0x00, 0x24, 0x1F, 0x32, 0x1F, 0x34, - 0x1F, 0x6A, 0x1F, 0x6C, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x8A, + 0x1F, 0xAE, 0x1F, 0xAF, 0x1F, 0xB4, 0x1F, 0xC4, 0x1F, 0xF4, 0x00, 0x01, 0x01, 0x7C, 0x00, 0x24, + 0x00, 0x4E, 0x00, 0x56, 0x00, 0x5E, 0x00, 0x66, 0x00, 0x6E, 0x00, 0x76, 0x00, 0x7E, 0x00, 0x86, + 0x00, 0x8E, 0x00, 0x98, 0x00, 0xA0, 0x00, 0xA8, 0x00, 0xB0, 0x00, 0xB8, 0x00, 0xC2, 0x00, 0xCA, + 0x00, 0xD2, 0x00, 0xDA, 0x00, 0xE2, 0x00, 0xEC, 0x00, 0xF4, 0x00, 0xFC, 0x01, 0x04, 0x01, 0x0C, + 0x01, 0x16, 0x01, 0x1E, 0x01, 0x26, 0x01, 0x2E, 0x01, 0x36, 0x01, 0x40, 0x01, 0x48, 0x01, 0x50, + 0x01, 0x58, 0x01, 0x60, 0x01, 0x68, 0x01, 0x72, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x43, 0x03, 0x00, + 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x21, 0x26, 0x03, 0x43, 0x03, 0x00, + 0x00, 0x03, 0x21, 0x26, 0x03, 0x43, 0x03, 0x01, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x13, 0x03, 0x40, + 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x13, 0x03, 0x41, + 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x42, + 0x03, 0x45, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x14, + 0x03, 0x40, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x14, + 0x03, 0x41, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xC3, + 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xC3, + 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, + 0x03, 0x43, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, + 0x1F, 0xCC, 0x03, 0x14, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, + 0x1F, 0xCC, 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x42, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x14, 0x03, 0x40, + 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x14, 0x03, 0x41, + 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x42, 0x03, 0x45, 0x00, 0x03, 0x21, 0x26, 0x03, 0x43, + 0x03, 0x45, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x13, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x14, + 0x03, 0x40, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x13, 0x03, 0x41, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x14, + 0x03, 0x41, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x42, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, + 0x03, 0x14, 0x03, 0x42, 0x03, 0x45, 0x00, 0x01, 0x00, 0x24, 0x1F, 0x32, 0x1F, 0x34, 0x1F, 0x6A, + 0x1F, 0x6C, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x8A, 0x1F, 0x8B, + 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, + 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, + 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA8, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, + 0x1F, 0xAF, 0x00, 0x01, 0x01, 0x94, 0x00, 0x24, 0x00, 0x4E, 0x00, 0x56, 0x00, 0x5E, 0x00, 0x66, + 0x00, 0x6E, 0x00, 0x76, 0x00, 0x80, 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA4, 0x00, 0xAE, + 0x00, 0xB6, 0x00, 0xC0, 0x00, 0xCA, 0x00, 0xD2, 0x00, 0xDC, 0x00, 0xE4, 0x00, 0xEE, 0x00, 0xF8, + 0x01, 0x00, 0x01, 0x0A, 0x01, 0x12, 0x01, 0x1C, 0x01, 0x26, 0x01, 0x2E, 0x01, 0x38, 0x01, 0x40, + 0x01, 0x4A, 0x01, 0x54, 0x01, 0x5C, 0x01, 0x64, 0x01, 0x6E, 0x01, 0x76, 0x01, 0x80, 0x01, 0x8A, + 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x43, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x43, 0x03, 0x41, + 0x00, 0x03, 0x21, 0x26, 0x03, 0x43, 0x03, 0x40, 0x00, 0x03, 0x21, 0x26, 0x03, 0x43, 0x03, 0x41, + 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x00, + 0x03, 0x45, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, + 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, + 0x1F, 0xBC, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x00, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x01, + 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xC3, + 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, + 0x1F, 0xC3, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x01, 0x03, 0x45, + 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x43, + 0x03, 0x00, 0x00, 0x04, 0x03, 0x97, 0x03, 0x14, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xCC, + 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x14, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, + 0x03, 0x97, 0x03, 0x43, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x43, 0x03, 0x00, + 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x43, + 0x03, 0x01, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, + 0x03, 0x43, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x21, 0x26, 0x03, 0x45, 0x03, 0x13, 0x00, 0x03, + 0x1F, 0xFC, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x00, 0x03, 0x45, + 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x01, + 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x42, 0x00, 0x04, 0x21, 0x26, + 0x03, 0x14, 0x03, 0x45, 0x03, 0x42, 0x00, 0x01, 0x00, 0x24, 0x1F, 0x32, 0x1F, 0x34, 0x1F, 0x6A, + 0x1F, 0x6C, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x8A, 0x1F, 0x8B, + 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, + 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, + 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA8, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, + 0x1F, 0xAF, 0x00, 0x01, 0x01, 0x6C, 0x00, 0x20, 0x00, 0x46, 0x00, 0x4E, 0x00, 0x58, 0x00, 0x60, + 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7C, 0x00, 0x86, 0x00, 0x8E, 0x00, 0x98, 0x00, 0xA2, 0x00, 0xAA, + 0x00, 0xB4, 0x00, 0xBC, 0x00, 0xC6, 0x00, 0xD0, 0x00, 0xD8, 0x00, 0xE2, 0x00, 0xEA, 0x00, 0xF4, + 0x00, 0xFE, 0x01, 0x06, 0x01, 0x10, 0x01, 0x18, 0x01, 0x22, 0x01, 0x2C, 0x01, 0x34, 0x01, 0x3C, + 0x01, 0x46, 0x01, 0x4E, 0x01, 0x58, 0x01, 0x62, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x43, 0x03, 0x40, + 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x43, + 0x03, 0x41, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, + 0x03, 0x45, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, + 0x03, 0x91, 0x03, 0x14, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x43, 0x03, 0x41, + 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, + 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB7, + 0x03, 0x14, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, + 0x03, 0xB7, 0x03, 0x14, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x13, + 0x03, 0x42, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, 0x03, 0x97, 0x03, 0x14, + 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, 0x03, 0x97, + 0x03, 0x14, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x13, 0x03, 0x42, + 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x40, + 0x03, 0x45, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, + 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, + 0x21, 0x26, 0x03, 0x45, 0x03, 0x43, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, + 0x03, 0xA9, 0x03, 0x14, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x43, 0x03, 0x41, + 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, + 0x03, 0x13, 0x03, 0x42, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x14, 0x03, 0x42, 0x00, 0x01, + 0x00, 0x20, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x8A, 0x1F, 0x8B, + 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, + 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, + 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA8, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, + 0x1F, 0xAF, 0x00, 0x01, 0x01, 0x6E, 0x00, 0x1E, 0x00, 0x42, 0x00, 0x4C, 0x00, 0x56, 0x00, 0x60, + 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7E, 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA6, 0x00, 0xB0, + 0x00, 0xBA, 0x00, 0xC4, 0x00, 0xCE, 0x00, 0xD8, 0x00, 0xE2, 0x00, 0xEC, 0x00, 0xF6, 0x01, 0x00, + 0x01, 0x0A, 0x01, 0x14, 0x01, 0x1E, 0x01, 0x28, 0x01, 0x32, 0x01, 0x3C, 0x01, 0x46, 0x01, 0x50, + 0x01, 0x5A, 0x01, 0x64, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, + 0x03, 0xB1, 0x03, 0x14, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x01, + 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB1, + 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x00, 0x03, 0x45, + 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, + 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, + 0x03, 0x91, 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x00, + 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB7, + 0x03, 0x13, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x45, 0x03, 0x01, + 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, + 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x14, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, + 0x03, 0x97, 0x03, 0x13, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x14, 0x03, 0x45, + 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, 0x00, 0x04, 0x03, 0xC9, + 0x03, 0x13, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x45, 0x03, 0x00, + 0x00, 0x04, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, + 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, 0x00, 0x04, + 0x03, 0xA9, 0x03, 0x13, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x45, + 0x03, 0x00, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, + 0x03, 0x14, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, + 0x00, 0x01, 0x00, 0x1E, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x96, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0xA2, 0x1F, 0xA3, - 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA8, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, - 0x1F, 0xAE, 0x1F, 0xAF, 0x00, 0x01, 0x01, 0x94, 0x00, 0x24, 0x00, 0x4E, 0x00, 0x56, 0x00, 0x5E, - 0x00, 0x66, 0x00, 0x6E, 0x00, 0x76, 0x00, 0x80, 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA4, - 0x00, 0xAE, 0x00, 0xB6, 0x00, 0xC0, 0x00, 0xCA, 0x00, 0xD2, 0x00, 0xDC, 0x00, 0xE4, 0x00, 0xEE, - 0x00, 0xF8, 0x01, 0x00, 0x01, 0x0A, 0x01, 0x12, 0x01, 0x1C, 0x01, 0x26, 0x01, 0x2E, 0x01, 0x38, - 0x01, 0x40, 0x01, 0x4A, 0x01, 0x54, 0x01, 0x5C, 0x01, 0x64, 0x01, 0x6E, 0x01, 0x76, 0x01, 0x80, - 0x01, 0x8A, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x43, 0x03, 0x40, 0x00, 0x03, 0x1F, 0xBE, 0x03, 0x43, - 0x03, 0x41, 0x00, 0x03, 0x21, 0x26, 0x03, 0x43, 0x03, 0x40, 0x00, 0x03, 0x21, 0x26, 0x03, 0x43, - 0x03, 0x41, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, - 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB1, - 0x03, 0x14, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x45, 0x03, 0x42, - 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x00, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, - 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, - 0x1F, 0xC3, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x00, 0x03, 0x45, - 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x01, - 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xCC, - 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0x97, 0x03, 0x14, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, - 0x1F, 0xCC, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x14, 0x03, 0x01, 0x03, 0x45, - 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x43, - 0x03, 0x00, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x00, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xF3, - 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, - 0x03, 0xC9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x42, 0x00, 0x03, 0x21, 0x26, 0x03, 0x45, 0x03, 0x13, - 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x00, - 0x03, 0x45, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, - 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x42, 0x00, 0x04, - 0x21, 0x26, 0x03, 0x14, 0x03, 0x45, 0x03, 0x42, 0x00, 0x01, 0x00, 0x24, 0x1F, 0x32, 0x1F, 0x34, - 0x1F, 0x6A, 0x1F, 0x6C, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x8A, - 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, - 0x1F, 0x96, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0xA2, 0x1F, 0xA3, - 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA8, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, - 0x1F, 0xAE, 0x1F, 0xAF, 0x00, 0x01, 0x01, 0x6C, 0x00, 0x20, 0x00, 0x46, 0x00, 0x4E, 0x00, 0x58, - 0x00, 0x60, 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7C, 0x00, 0x86, 0x00, 0x8E, 0x00, 0x98, 0x00, 0xA2, - 0x00, 0xAA, 0x00, 0xB4, 0x00, 0xBC, 0x00, 0xC6, 0x00, 0xD0, 0x00, 0xD8, 0x00, 0xE2, 0x00, 0xEA, - 0x00, 0xF4, 0x00, 0xFE, 0x01, 0x06, 0x01, 0x10, 0x01, 0x18, 0x01, 0x22, 0x01, 0x2C, 0x01, 0x34, - 0x01, 0x3C, 0x01, 0x46, 0x01, 0x4E, 0x01, 0x58, 0x01, 0x62, 0x00, 0x03, 0x1F, 0xB3, 0x03, 0x43, - 0x03, 0x40, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xB3, - 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, - 0x03, 0xB1, 0x03, 0x45, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x43, 0x03, 0x40, - 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xBC, 0x03, 0x43, - 0x03, 0x41, 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, - 0x03, 0x45, 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, - 0x03, 0xB7, 0x03, 0x14, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xC3, 0x03, 0x43, 0x03, 0x41, - 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, - 0x03, 0x13, 0x03, 0x42, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, 0x03, 0x97, - 0x03, 0x14, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xCC, 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, - 0x03, 0x97, 0x03, 0x14, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x13, - 0x03, 0x42, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, - 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xF3, 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, - 0x03, 0x14, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x42, - 0x00, 0x03, 0x21, 0x26, 0x03, 0x45, 0x03, 0x43, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x43, 0x03, 0x40, - 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x40, 0x03, 0x45, 0x00, 0x03, 0x1F, 0xFC, 0x03, 0x43, - 0x03, 0x41, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, - 0x03, 0x45, 0x03, 0x13, 0x03, 0x42, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x14, 0x03, 0x42, - 0x00, 0x01, 0x00, 0x20, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, 0x1F, 0x8A, - 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, - 0x1F, 0x96, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0xA2, 0x1F, 0xA3, - 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xA8, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, - 0x1F, 0xAE, 0x1F, 0xAF, 0x00, 0x01, 0x01, 0x6E, 0x00, 0x1E, 0x00, 0x42, 0x00, 0x4C, 0x00, 0x56, - 0x00, 0x60, 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7E, 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA6, - 0x00, 0xB0, 0x00, 0xBA, 0x00, 0xC4, 0x00, 0xCE, 0x00, 0xD8, 0x00, 0xE2, 0x00, 0xEC, 0x00, 0xF6, - 0x01, 0x00, 0x01, 0x0A, 0x01, 0x14, 0x01, 0x1E, 0x01, 0x28, 0x01, 0x32, 0x01, 0x3C, 0x01, 0x46, - 0x01, 0x50, 0x01, 0x5A, 0x01, 0x64, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x00, 0x03, 0x45, - 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, - 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, - 0x03, 0xB1, 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x00, - 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, - 0x03, 0x13, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x45, 0x03, 0x01, - 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, - 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, - 0x03, 0xB7, 0x03, 0x13, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x45, - 0x03, 0x01, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, 0x00, 0x04, 0x03, 0x97, - 0x03, 0x13, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x14, 0x03, 0x45, 0x03, 0x00, - 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x14, - 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, 0x00, 0x04, - 0x03, 0xC9, 0x03, 0x13, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x45, - 0x03, 0x00, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, - 0x03, 0x14, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, - 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, - 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, - 0x03, 0xA9, 0x03, 0x14, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x43, - 0x03, 0x42, 0x00, 0x01, 0x00, 0x1E, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x86, - 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x8E, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, - 0x1F, 0x95, 0x1F, 0x96, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0x9E, 0x1F, 0xA2, - 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, - 0x1F, 0xAE, 0x00, 0x01, 0x01, 0x32, 0x00, 0x19, 0x00, 0x38, 0x00, 0x42, 0x00, 0x4C, 0x00, 0x56, - 0x00, 0x60, 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7E, 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA6, - 0x00, 0xB0, 0x00, 0xBA, 0x00, 0xC4, 0x00, 0xCE, 0x00, 0xD8, 0x00, 0xE2, 0x00, 0xEC, 0x00, 0xF6, - 0x01, 0x00, 0x01, 0x0A, 0x01, 0x14, 0x01, 0x1E, 0x01, 0x28, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, - 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, - 0x03, 0xB1, 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x45, - 0x03, 0x41, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, - 0x03, 0x14, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, - 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, - 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, - 0x03, 0xB7, 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x45, - 0x03, 0x41, 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, - 0x03, 0x14, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, - 0x00, 0x04, 0x03, 0x97, 0x03, 0x14, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x13, - 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, - 0x03, 0xC9, 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x45, - 0x03, 0x41, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, - 0x03, 0x14, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, - 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, - 0x03, 0x42, 0x03, 0x45, 0x00, 0x01, 0x00, 0x19, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, - 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, - 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, - 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x00, 0x01, 0x01, 0x32, 0x00, 0x19, - 0x00, 0x38, 0x00, 0x42, 0x00, 0x4C, 0x00, 0x56, 0x00, 0x60, 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7E, - 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA6, 0x00, 0xB0, 0x00, 0xBA, 0x00, 0xC4, 0x00, 0xCE, - 0x00, 0xD8, 0x00, 0xE2, 0x00, 0xEC, 0x00, 0xF6, 0x01, 0x00, 0x01, 0x0A, 0x01, 0x14, 0x01, 0x1E, - 0x01, 0x28, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB1, - 0x03, 0x45, 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, - 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, - 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, - 0x03, 0x91, 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x14, - 0x03, 0x01, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB7, - 0x03, 0x45, 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, - 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, - 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, - 0x03, 0x97, 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x14, - 0x03, 0x01, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xC9, - 0x03, 0x45, 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, - 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, - 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, - 0x03, 0xA9, 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x14, - 0x03, 0x01, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x45, 0x03, 0x42, 0x00, 0x01, 0x00, 0x19, - 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, - 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, - 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, - 0x1F, 0xAE, 0x00, 0x01, 0x01, 0x32, 0x00, 0x19, 0x00, 0x38, 0x00, 0x42, 0x00, 0x4C, 0x00, 0x56, - 0x00, 0x60, 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7E, 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA6, - 0x00, 0xB0, 0x00, 0xBA, 0x00, 0xC4, 0x00, 0xCE, 0x00, 0xD8, 0x00, 0xE2, 0x00, 0xEC, 0x00, 0xF6, - 0x01, 0x00, 0x01, 0x0A, 0x01, 0x14, 0x01, 0x1E, 0x01, 0x28, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, - 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, - 0x03, 0xB1, 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x14, - 0x03, 0x41, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0x91, - 0x03, 0x45, 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, - 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, - 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, - 0x03, 0xB7, 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x14, - 0x03, 0x41, 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0x97, - 0x03, 0x45, 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, - 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x13, - 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, - 0x03, 0xC9, 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x14, - 0x03, 0x41, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xA9, - 0x03, 0x45, 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, - 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, - 0x03, 0x42, 0x03, 0x45, 0x00, 0x01, 0x00, 0x19, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, - 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, - 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, - 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x00, 0x01, 0x00, 0xBA, 0x00, 0x0F, - 0x00, 0x24, 0x00, 0x2E, 0x00, 0x38, 0x00, 0x42, 0x00, 0x4C, 0x00, 0x56, 0x00, 0x60, 0x00, 0x6A, - 0x00, 0x74, 0x00, 0x7E, 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA6, 0x00, 0xB0, 0x00, 0x04, - 0x03, 0xB1, 0x03, 0x43, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x01, - 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, - 0x03, 0x43, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x00, 0x03, 0x45, - 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, - 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, - 0x03, 0xC9, 0x03, 0x43, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x01, - 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, - 0x03, 0x14, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x01, 0x03, 0x45, - 0x00, 0x04, 0x21, 0x26, 0x03, 0x14, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, - 0x03, 0x45, 0x03, 0x42, 0x00, 0x01, 0x00, 0x0F, 0x1F, 0x82, 0x1F, 0x84, 0x1F, 0x8A, 0x1F, 0x8C, - 0x1F, 0x92, 0x1F, 0x94, 0x1F, 0x9A, 0x1F, 0x9C, 0x1F, 0xA2, 0x1F, 0xA4, 0x1F, 0xAA, 0x1F, 0xAB, - 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x00, 0x01, 0x00, 0xBA, 0x00, 0x0F, 0x00, 0x24, 0x00, 0x2E, - 0x00, 0x38, 0x00, 0x42, 0x00, 0x4C, 0x00, 0x56, 0x00, 0x60, 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7E, - 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA6, 0x00, 0xB0, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, - 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, - 0x03, 0x91, 0x03, 0x43, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x41, - 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, - 0x03, 0x43, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x40, 0x03, 0x45, - 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, - 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, - 0x03, 0xA9, 0x03, 0x43, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, 0x03, 0x14, 0x03, 0x40, - 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, - 0x03, 0x14, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x13, 0x03, 0x42, - 0x00, 0x01, 0x00, 0x0F, 0x1F, 0x82, 0x1F, 0x84, 0x1F, 0x8A, 0x1F, 0x8C, 0x1F, 0x92, 0x1F, 0x94, - 0x1F, 0x9A, 0x1F, 0x9C, 0x1F, 0xA2, 0x1F, 0xA4, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, - 0x1F, 0xAE, 0x00, 0x01, 0x00, 0xBA, 0x00, 0x0F, 0x00, 0x24, 0x00, 0x2E, 0x00, 0x38, 0x00, 0x42, - 0x00, 0x4C, 0x00, 0x56, 0x00, 0x60, 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7E, 0x00, 0x88, 0x00, 0x92, - 0x00, 0x9C, 0x00, 0xA6, 0x00, 0xB0, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x45, 0x03, 0x00, - 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, - 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, - 0x03, 0xB7, 0x03, 0x43, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x45, - 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0x97, - 0x03, 0x43, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x00, - 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, - 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x21, 0x26, 0x03, 0x14, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, - 0x03, 0xA9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x21, 0x26, 0x03, 0x14, 0x03, 0x45, - 0x03, 0x01, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, 0x00, 0x01, 0x00, 0x0F, - 0x1F, 0x82, 0x1F, 0x84, 0x1F, 0x8A, 0x1F, 0x8C, 0x1F, 0x92, 0x1F, 0x94, 0x1F, 0x9A, 0x1F, 0x9C, - 0x1F, 0xA2, 0x1F, 0xA4, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x00, 0x01, - 0x00, 0xAE, 0x00, 0x0E, 0x00, 0x22, 0x00, 0x2C, 0x00, 0x36, 0x00, 0x40, 0x00, 0x4A, 0x00, 0x54, - 0x00, 0x5E, 0x00, 0x68, 0x00, 0x72, 0x00, 0x7C, 0x00, 0x86, 0x00, 0x90, 0x00, 0x9A, 0x00, 0xA4, - 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, - 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, - 0x03, 0x91, 0x03, 0x43, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x45, - 0x03, 0x40, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0x97, - 0x03, 0x43, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x45, 0x03, 0x41, - 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, - 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, - 0x21, 0x26, 0x03, 0x14, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x45, - 0x03, 0x41, 0x00, 0x04, 0x21, 0x26, 0x03, 0x14, 0x03, 0x45, 0x03, 0x41, 0x00, 0x01, 0x00, 0x0E, - 0x1F, 0x82, 0x1F, 0x84, 0x1F, 0x8A, 0x1F, 0x8C, 0x1F, 0x92, 0x1F, 0x94, 0x1F, 0x9A, 0x1F, 0x9C, - 0x1F, 0xA2, 0x1F, 0xA4, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x00, 0x01, 0x00, 0xAE, + 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xA6, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, + 0x00, 0x01, 0x01, 0x32, 0x00, 0x19, 0x00, 0x38, 0x00, 0x42, 0x00, 0x4C, 0x00, 0x56, 0x00, 0x60, + 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7E, 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA6, 0x00, 0xB0, + 0x00, 0xBA, 0x00, 0xC4, 0x00, 0xCE, 0x00, 0xD8, 0x00, 0xE2, 0x00, 0xEC, 0x00, 0xF6, 0x01, 0x00, + 0x01, 0x0A, 0x01, 0x14, 0x01, 0x1E, 0x01, 0x28, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x40, + 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB1, + 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x14, 0x03, 0x45, 0x03, 0x41, + 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, 0x03, 0x14, + 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, + 0x03, 0x91, 0x03, 0x14, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x40, + 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB7, + 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x14, 0x03, 0x45, 0x03, 0x41, + 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x14, + 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, + 0x03, 0x97, 0x03, 0x14, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x40, + 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xC9, + 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x14, 0x03, 0x45, 0x03, 0x41, + 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x14, + 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, + 0x03, 0xA9, 0x03, 0x14, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x42, + 0x03, 0x45, 0x00, 0x01, 0x00, 0x19, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x8A, + 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x9A, + 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xAA, + 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x00, 0x01, 0x01, 0x32, 0x00, 0x19, 0x00, 0x38, + 0x00, 0x42, 0x00, 0x4C, 0x00, 0x56, 0x00, 0x60, 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7E, 0x00, 0x88, + 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA6, 0x00, 0xB0, 0x00, 0xBA, 0x00, 0xC4, 0x00, 0xCE, 0x00, 0xD8, + 0x00, 0xE2, 0x00, 0xEC, 0x00, 0xF6, 0x01, 0x00, 0x01, 0x0A, 0x01, 0x14, 0x01, 0x1E, 0x01, 0x28, + 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, + 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, + 0x03, 0xB1, 0x03, 0x45, 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x45, + 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, + 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x14, 0x03, 0x01, + 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, + 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, + 0x03, 0xB7, 0x03, 0x45, 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x45, + 0x03, 0x00, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, 0x03, 0x97, + 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x14, 0x03, 0x01, + 0x00, 0x04, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, + 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, + 0x03, 0xC9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x45, + 0x03, 0x00, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, 0x03, 0xA9, + 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x01, + 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x45, 0x03, 0x42, 0x00, 0x01, 0x00, 0x19, 0x1F, 0x82, + 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x8A, 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x92, + 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x9A, 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0xA2, + 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, + 0x00, 0x01, 0x01, 0x32, 0x00, 0x19, 0x00, 0x38, 0x00, 0x42, 0x00, 0x4C, 0x00, 0x56, 0x00, 0x60, + 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7E, 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA6, 0x00, 0xB0, + 0x00, 0xBA, 0x00, 0xC4, 0x00, 0xCE, 0x00, 0xD8, 0x00, 0xE2, 0x00, 0xEC, 0x00, 0xF6, 0x01, 0x00, + 0x01, 0x0A, 0x01, 0x14, 0x01, 0x1E, 0x01, 0x28, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x13, 0x03, 0x45, + 0x03, 0x40, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB1, + 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x14, 0x03, 0x41, + 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, + 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, 0x03, 0x91, 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, + 0x03, 0x91, 0x03, 0x45, 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x13, 0x03, 0x45, + 0x03, 0x40, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB7, + 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x14, 0x03, 0x41, + 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, + 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, 0x03, 0x97, 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, + 0x03, 0x97, 0x03, 0x45, 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x13, 0x03, 0x45, + 0x03, 0x40, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, 0x03, 0xC9, + 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x41, + 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, + 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, + 0x03, 0xA9, 0x03, 0x45, 0x03, 0x14, 0x03, 0x41, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, 0x03, 0x42, + 0x03, 0x45, 0x00, 0x01, 0x00, 0x19, 0x1F, 0x82, 0x1F, 0x83, 0x1F, 0x84, 0x1F, 0x85, 0x1F, 0x8A, + 0x1F, 0x8B, 0x1F, 0x8C, 0x1F, 0x8D, 0x1F, 0x92, 0x1F, 0x93, 0x1F, 0x94, 0x1F, 0x95, 0x1F, 0x9A, + 0x1F, 0x9B, 0x1F, 0x9C, 0x1F, 0x9D, 0x1F, 0xA2, 0x1F, 0xA3, 0x1F, 0xA4, 0x1F, 0xA5, 0x1F, 0xAA, + 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x00, 0x01, 0x00, 0xBA, 0x00, 0x0F, 0x00, 0x24, + 0x00, 0x2E, 0x00, 0x38, 0x00, 0x42, 0x00, 0x4C, 0x00, 0x56, 0x00, 0x60, 0x00, 0x6A, 0x00, 0x74, + 0x00, 0x7E, 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA6, 0x00, 0xB0, 0x00, 0x04, 0x03, 0xB1, + 0x03, 0x43, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x01, 0x03, 0x45, + 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, + 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, + 0x03, 0xB7, 0x03, 0x43, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x00, + 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, + 0x03, 0x43, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x01, 0x03, 0x45, + 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, 0x03, 0x14, + 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, + 0x21, 0x26, 0x03, 0x14, 0x03, 0x01, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, 0x03, 0x45, + 0x03, 0x42, 0x00, 0x01, 0x00, 0x0F, 0x1F, 0x82, 0x1F, 0x84, 0x1F, 0x8A, 0x1F, 0x8C, 0x1F, 0x92, + 0x1F, 0x94, 0x1F, 0x9A, 0x1F, 0x9C, 0x1F, 0xA2, 0x1F, 0xA4, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, + 0x1F, 0xAD, 0x1F, 0xAE, 0x00, 0x01, 0x00, 0xBA, 0x00, 0x0F, 0x00, 0x24, 0x00, 0x2E, 0x00, 0x38, + 0x00, 0x42, 0x00, 0x4C, 0x00, 0x56, 0x00, 0x60, 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7E, 0x00, 0x88, + 0x00, 0x92, 0x00, 0x9C, 0x00, 0xA6, 0x00, 0xB0, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x40, + 0x03, 0x45, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, + 0x03, 0x43, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x41, 0x03, 0x45, + 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, + 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, + 0x03, 0x97, 0x03, 0x43, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x40, + 0x03, 0x45, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x03, 0xA9, + 0x03, 0x43, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, 0x03, 0x14, 0x03, 0x40, 0x03, 0x45, + 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, 0x03, 0x14, + 0x03, 0x41, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x13, 0x03, 0x42, 0x00, 0x01, + 0x00, 0x0F, 0x1F, 0x82, 0x1F, 0x84, 0x1F, 0x8A, 0x1F, 0x8C, 0x1F, 0x92, 0x1F, 0x94, 0x1F, 0x9A, + 0x1F, 0x9C, 0x1F, 0xA2, 0x1F, 0xA4, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, + 0x00, 0x01, 0x00, 0xBA, 0x00, 0x0F, 0x00, 0x24, 0x00, 0x2E, 0x00, 0x38, 0x00, 0x42, 0x00, 0x4C, + 0x00, 0x56, 0x00, 0x60, 0x00, 0x6A, 0x00, 0x74, 0x00, 0x7E, 0x00, 0x88, 0x00, 0x92, 0x00, 0x9C, + 0x00, 0xA6, 0x00, 0xB0, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, + 0x03, 0xB1, 0x03, 0x43, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x45, + 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB7, + 0x03, 0x43, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x45, 0x03, 0x01, + 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, + 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, + 0x03, 0xC9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x45, + 0x03, 0x00, 0x00, 0x04, 0x21, 0x26, 0x03, 0x14, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x03, 0xA9, + 0x03, 0x43, 0x03, 0x45, 0x03, 0x01, 0x00, 0x04, 0x21, 0x26, 0x03, 0x14, 0x03, 0x45, 0x03, 0x01, + 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x43, 0x03, 0x42, 0x00, 0x01, 0x00, 0x0F, 0x1F, 0x82, + 0x1F, 0x84, 0x1F, 0x8A, 0x1F, 0x8C, 0x1F, 0x92, 0x1F, 0x94, 0x1F, 0x9A, 0x1F, 0x9C, 0x1F, 0xA2, + 0x1F, 0xA4, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x1F, 0xAE, 0x00, 0x01, 0x00, 0xAE, 0x00, 0x0E, 0x00, 0x22, 0x00, 0x2C, 0x00, 0x36, 0x00, 0x40, 0x00, 0x4A, 0x00, 0x54, 0x00, 0x5E, 0x00, 0x68, 0x00, 0x72, 0x00, 0x7C, 0x00, 0x86, 0x00, 0x90, 0x00, 0x9A, 0x00, 0xA4, 0x00, 0x04, - 0x03, 0xB1, 0x03, 0x45, 0x03, 0x13, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x13, - 0x03, 0x01, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x13, 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, - 0x03, 0x45, 0x03, 0x13, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x13, 0x03, 0x00, - 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x13, 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, - 0x03, 0x13, 0x03, 0x00, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x13, 0x03, 0x01, 0x00, 0x04, - 0x03, 0xC9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x00, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x13, - 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x00, 0x00, 0x04, 0x21, 0x26, - 0x03, 0x45, 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x01, - 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x14, 0x03, 0x01, 0x00, 0x01, 0x00, 0x0E, 0x1F, 0x82, + 0x03, 0xB1, 0x03, 0x43, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x43, 0x03, 0x45, + 0x03, 0x41, 0x00, 0x04, 0x03, 0x91, 0x03, 0x43, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0x91, + 0x03, 0x43, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x45, 0x03, 0x40, + 0x00, 0x04, 0x03, 0xB7, 0x03, 0x43, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, + 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0x97, 0x03, 0x43, 0x03, 0x45, 0x03, 0x41, 0x00, 0x04, + 0x03, 0xC9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x43, 0x03, 0x45, + 0x03, 0x41, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x21, 0x26, + 0x03, 0x14, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x43, 0x03, 0x45, 0x03, 0x41, + 0x00, 0x04, 0x21, 0x26, 0x03, 0x14, 0x03, 0x45, 0x03, 0x41, 0x00, 0x01, 0x00, 0x0E, 0x1F, 0x82, 0x1F, 0x84, 0x1F, 0x8A, 0x1F, 0x8C, 0x1F, 0x92, 0x1F, 0x94, 0x1F, 0x9A, 0x1F, 0x9C, 0x1F, 0xA2, 0x1F, 0xA4, 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x00, 0x01, 0x00, 0xAE, 0x00, 0x0E, 0x00, 0x22, 0x00, 0x2C, 0x00, 0x36, 0x00, 0x40, 0x00, 0x4A, 0x00, 0x54, 0x00, 0x5E, 0x00, 0x68, 0x00, 0x72, 0x00, 0x7C, 0x00, 0x86, 0x00, 0x90, 0x00, 0x9A, 0x00, 0xA4, 0x00, 0x04, 0x03, 0xB1, - 0x03, 0x45, 0x03, 0x13, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x13, 0x03, 0x41, - 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x13, 0x03, 0x40, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, - 0x03, 0x13, 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x13, 0x03, 0x40, 0x00, 0x04, - 0x03, 0xB7, 0x03, 0x45, 0x03, 0x13, 0x03, 0x41, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x13, - 0x03, 0x40, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x13, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, - 0x03, 0x45, 0x03, 0x13, 0x03, 0x40, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x41, - 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x40, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, - 0x03, 0x14, 0x03, 0x40, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x41, 0x00, 0x04, - 0x21, 0x26, 0x03, 0x45, 0x03, 0x14, 0x03, 0x41, 0x00, 0x01, 0x00, 0x0E, 0x1F, 0x82, 0x1F, 0x84, + 0x03, 0x45, 0x03, 0x13, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x13, 0x03, 0x01, + 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x13, 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, + 0x03, 0x13, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x13, 0x03, 0x00, 0x00, 0x04, + 0x03, 0xB7, 0x03, 0x45, 0x03, 0x13, 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x13, + 0x03, 0x00, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x13, 0x03, 0x01, 0x00, 0x04, 0x03, 0xC9, + 0x03, 0x45, 0x03, 0x13, 0x03, 0x00, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x01, + 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x00, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, + 0x03, 0x14, 0x03, 0x00, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x01, 0x00, 0x04, + 0x21, 0x26, 0x03, 0x45, 0x03, 0x14, 0x03, 0x01, 0x00, 0x01, 0x00, 0x0E, 0x1F, 0x82, 0x1F, 0x84, 0x1F, 0x8A, 0x1F, 0x8C, 0x1F, 0x92, 0x1F, 0x94, 0x1F, 0x9A, 0x1F, 0x9C, 0x1F, 0xA2, 0x1F, 0xA4, - 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x00, 0x01, 0x00, 0x96, 0x00, 0x0C, 0x00, 0x1E, + 0x1F, 0xAA, 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x00, 0x01, 0x00, 0xAE, 0x00, 0x0E, 0x00, 0x22, + 0x00, 0x2C, 0x00, 0x36, 0x00, 0x40, 0x00, 0x4A, 0x00, 0x54, 0x00, 0x5E, 0x00, 0x68, 0x00, 0x72, + 0x00, 0x7C, 0x00, 0x86, 0x00, 0x90, 0x00, 0x9A, 0x00, 0xA4, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, + 0x03, 0x13, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x13, 0x03, 0x41, 0x00, 0x04, + 0x03, 0x91, 0x03, 0x45, 0x03, 0x13, 0x03, 0x40, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x13, + 0x03, 0x41, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x13, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB7, + 0x03, 0x45, 0x03, 0x13, 0x03, 0x41, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x13, 0x03, 0x40, + 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x13, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, + 0x03, 0x13, 0x03, 0x40, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x41, 0x00, 0x04, + 0x03, 0xA9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x40, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x14, + 0x03, 0x40, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x13, 0x03, 0x41, 0x00, 0x04, 0x21, 0x26, + 0x03, 0x45, 0x03, 0x14, 0x03, 0x41, 0x00, 0x01, 0x00, 0x0E, 0x1F, 0x82, 0x1F, 0x84, 0x1F, 0x8A, + 0x1F, 0x8C, 0x1F, 0x92, 0x1F, 0x94, 0x1F, 0x9A, 0x1F, 0x9C, 0x1F, 0xA2, 0x1F, 0xA4, 0x1F, 0xAA, + 0x1F, 0xAB, 0x1F, 0xAC, 0x1F, 0xAD, 0x00, 0x01, 0x00, 0x96, 0x00, 0x0C, 0x00, 0x1E, 0x00, 0x28, + 0x00, 0x32, 0x00, 0x3C, 0x00, 0x46, 0x00, 0x50, 0x00, 0x5A, 0x00, 0x64, 0x00, 0x6E, 0x00, 0x78, + 0x00, 0x82, 0x00, 0x8C, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, + 0x03, 0xB1, 0x03, 0x45, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x43, + 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0xB7, + 0x03, 0x45, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x43, 0x03, 0x01, + 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, + 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, + 0x03, 0xC9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x43, + 0x03, 0x00, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x01, 0x00, 0x01, 0x00, 0x0C, + 0x1F, 0x82, 0x1F, 0x84, 0x1F, 0x8A, 0x1F, 0x8C, 0x1F, 0x92, 0x1F, 0x94, 0x1F, 0x9A, 0x1F, 0x9C, + 0x1F, 0xA2, 0x1F, 0xA4, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x96, 0x00, 0x0C, 0x00, 0x1E, 0x00, 0x28, 0x00, 0x32, 0x00, 0x3C, 0x00, 0x46, 0x00, 0x50, 0x00, 0x5A, 0x00, 0x64, 0x00, 0x6E, - 0x00, 0x78, 0x00, 0x82, 0x00, 0x8C, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x43, 0x03, 0x00, - 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, - 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, - 0x03, 0xB7, 0x03, 0x45, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x43, - 0x03, 0x01, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0x97, - 0x03, 0x45, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x00, - 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x01, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, - 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x01, 0x00, 0x01, + 0x00, 0x78, 0x00, 0x82, 0x00, 0x8C, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x43, 0x03, 0x40, + 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, + 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, + 0x03, 0xB7, 0x03, 0x45, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x43, + 0x03, 0x41, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, 0x03, 0x97, + 0x03, 0x45, 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x40, + 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, + 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x41, 0x00, 0x01, 0x00, 0x0C, 0x1F, 0x82, 0x1F, 0x84, 0x1F, 0x8A, 0x1F, 0x8C, 0x1F, 0x92, 0x1F, 0x94, 0x1F, 0x9A, - 0x1F, 0x9C, 0x1F, 0xA2, 0x1F, 0xA4, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x96, 0x00, 0x0C, - 0x00, 0x1E, 0x00, 0x28, 0x00, 0x32, 0x00, 0x3C, 0x00, 0x46, 0x00, 0x50, 0x00, 0x5A, 0x00, 0x64, - 0x00, 0x6E, 0x00, 0x78, 0x00, 0x82, 0x00, 0x8C, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x43, - 0x03, 0x40, 0x00, 0x04, 0x03, 0xB1, 0x03, 0x45, 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, 0x03, 0x91, - 0x03, 0x45, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, 0x03, 0x91, 0x03, 0x45, 0x03, 0x43, 0x03, 0x41, - 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, 0x03, 0xB7, 0x03, 0x45, - 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, 0x03, 0x97, 0x03, 0x45, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, - 0x03, 0x97, 0x03, 0x45, 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x43, - 0x03, 0x40, 0x00, 0x04, 0x03, 0xC9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x41, 0x00, 0x04, 0x03, 0xA9, - 0x03, 0x45, 0x03, 0x43, 0x03, 0x40, 0x00, 0x04, 0x03, 0xA9, 0x03, 0x45, 0x03, 0x43, 0x03, 0x41, - 0x00, 0x01, 0x00, 0x0C, 0x1F, 0x82, 0x1F, 0x84, 0x1F, 0x8A, 0x1F, 0x8C, 0x1F, 0x92, 0x1F, 0x94, - 0x1F, 0x9A, 0x1F, 0x9C, 0x1F, 0xA2, 0x1F, 0xA4, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, - 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x00, 0x03, 0x45, - 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x01, 0x03, 0x45, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, - 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, - 0x03, 0x13, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, - 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, - 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x21, 0x26, - 0x03, 0x13, 0x03, 0x45, 0x03, 0x01, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, - 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x45, - 0x03, 0x40, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, 0x00, 0x01, 0x00, 0x02, - 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, - 0x21, 0x26, 0x03, 0x43, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, 0x03, 0x01, - 0x03, 0x45, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, - 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, - 0x21, 0x26, 0x03, 0x43, 0x03, 0x41, 0x03, 0x45, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, - 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, - 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, 0x03, 0x45, 0x03, 0x01, 0x00, 0x01, + 0x1F, 0x9C, 0x1F, 0xA2, 0x1F, 0xA4, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, + 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, + 0x21, 0x26, 0x03, 0x13, 0x03, 0x01, 0x03, 0x45, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, + 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, + 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x41, 0x03, 0x45, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, - 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, - 0x03, 0x45, 0x03, 0x41, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, - 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x13, 0x03, 0x00, - 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x13, 0x03, 0x01, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, + 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x45, 0x03, 0x00, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, + 0x03, 0x45, 0x03, 0x01, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, + 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x45, 0x03, 0x40, + 0x00, 0x04, 0x21, 0x26, 0x03, 0x13, 0x03, 0x45, 0x03, 0x41, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, - 0x03, 0x45, 0x03, 0x13, 0x03, 0x40, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x13, 0x03, 0x41, + 0x03, 0x43, 0x03, 0x00, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, 0x03, 0x01, 0x03, 0x45, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, - 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x21, 0x26, - 0x03, 0x45, 0x03, 0x43, 0x03, 0x01, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, - 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x43, - 0x03, 0x40, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x43, 0x03, 0x41, 0x00, 0x01, 0x00, 0x02, - 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x4E, - 0x00, 0x06, 0x00, 0x12, 0x00, 0x1C, 0x00, 0x26, 0x00, 0x30, 0x00, 0x3A, 0x00, 0x44, 0x00, 0x01, - 0x00, 0x04, 0x0A, 0x59, 0x00, 0x02, 0x0A, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x0A, 0x5A, 0x00, 0x02, - 0x0A, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x0A, 0x5B, 0x00, 0x02, 0x0A, 0x3C, 0x00, 0x01, 0x00, 0x04, - 0x0A, 0x5E, 0x00, 0x02, 0x0A, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x0A, 0x33, 0x00, 0x02, 0x0A, 0x3C, - 0x00, 0x01, 0x00, 0x04, 0x0A, 0x36, 0x00, 0x02, 0x0A, 0x3C, 0x00, 0x01, 0x00, 0x06, 0x0A, 0x16, - 0x0A, 0x17, 0x0A, 0x1C, 0x0A, 0x2B, 0x0A, 0x32, 0x0A, 0x38, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x08, 0x00, 0x01, 0x00, 0x36, 0x00, 0x06, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, - 0x00, 0x2A, 0x00, 0x30, 0x00, 0x02, 0x0A, 0x32, 0x0A, 0x3C, 0x00, 0x02, 0x0A, 0x38, 0x0A, 0x3C, - 0x00, 0x02, 0x0A, 0x16, 0x0A, 0x3C, 0x00, 0x02, 0x0A, 0x17, 0x0A, 0x3C, 0x00, 0x02, 0x0A, 0x1C, - 0x0A, 0x3C, 0x00, 0x02, 0x0A, 0x2B, 0x0A, 0x3C, 0x00, 0x01, 0x00, 0x06, 0x0A, 0x33, 0x0A, 0x36, - 0x0A, 0x59, 0x0A, 0x5A, 0x0A, 0x5B, 0x0A, 0x5E, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, - 0x00, 0x01, 0x01, 0xB6, 0x00, 0x1A, 0x00, 0x3A, 0x00, 0x54, 0x00, 0x66, 0x00, 0x70, 0x00, 0x7A, - 0x00, 0x84, 0x00, 0x96, 0x00, 0xA0, 0x00, 0xAA, 0x00, 0xBC, 0x00, 0xC6, 0x00, 0xD8, 0x00, 0xE2, - 0x00, 0xEC, 0x00, 0xF6, 0x01, 0x00, 0x01, 0x0A, 0x01, 0x1C, 0x01, 0x26, 0x01, 0x30, 0x01, 0x3A, - 0x01, 0x7C, 0x01, 0x86, 0x01, 0x90, 0x01, 0x9A, 0x01, 0xA4, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, - 0x00, 0x14, 0xFB, 0x2E, 0x00, 0x02, 0x05, 0xB7, 0xFB, 0x2F, 0x00, 0x02, 0x05, 0xB8, 0xFB, 0x30, - 0x00, 0x02, 0x05, 0xBC, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0xFB, 0x31, 0x00, 0x02, 0x05, 0xBC, - 0xFB, 0x4C, 0x00, 0x02, 0x05, 0xBF, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x32, 0x00, 0x02, 0x05, 0xBC, - 0x00, 0x01, 0x00, 0x04, 0xFB, 0x33, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x34, - 0x00, 0x02, 0x05, 0xBC, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0xFB, 0x4B, 0x00, 0x02, 0x05, 0xB9, - 0xFB, 0x35, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x36, 0x00, 0x02, 0x05, 0xBC, - 0x00, 0x01, 0x00, 0x04, 0xFB, 0x38, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, - 0xFB, 0x1D, 0x00, 0x02, 0x05, 0xB4, 0xFB, 0x39, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, - 0xFB, 0x3A, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0xFB, 0x3B, 0x00, 0x02, - 0x05, 0xBC, 0xFB, 0x4D, 0x00, 0x02, 0x05, 0xBF, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x3C, 0x00, 0x02, - 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x3E, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, - 0xFB, 0x40, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x41, 0x00, 0x02, 0x05, 0xBC, - 0x00, 0x01, 0x00, 0x04, 0xFB, 0x43, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, - 0xFB, 0x44, 0x00, 0x02, 0x05, 0xBC, 0xFB, 0x4E, 0x00, 0x02, 0x05, 0xBF, 0x00, 0x01, 0x00, 0x04, - 0xFB, 0x46, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x47, 0x00, 0x02, 0x05, 0xBC, - 0x00, 0x01, 0x00, 0x04, 0xFB, 0x48, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x07, 0x00, 0x10, 0x00, 0x18, - 0x00, 0x20, 0x00, 0x26, 0x00, 0x2E, 0x00, 0x34, 0x00, 0x3C, 0xFB, 0x2C, 0x00, 0x03, 0x05, 0xBC, - 0x05, 0xC1, 0xFB, 0x2D, 0x00, 0x03, 0x05, 0xBC, 0x05, 0xC2, 0xFB, 0x49, 0x00, 0x02, 0x05, 0xBC, - 0xFB, 0x2C, 0x00, 0x03, 0x05, 0xC1, 0x05, 0xBC, 0xFB, 0x2A, 0x00, 0x02, 0x05, 0xC1, 0xFB, 0x2D, - 0x00, 0x03, 0x05, 0xC2, 0x05, 0xBC, 0xFB, 0x2B, 0x00, 0x02, 0x05, 0xC2, 0x00, 0x01, 0x00, 0x04, - 0xFB, 0x4A, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x1F, 0x00, 0x02, 0x05, 0xB7, - 0x00, 0x01, 0x00, 0x04, 0xFB, 0x2C, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x2D, - 0x00, 0x02, 0x05, 0xBC, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0xFB, 0x2C, 0x00, 0x02, 0x05, 0xC1, - 0xFB, 0x2D, 0x00, 0x02, 0x05, 0xC2, 0x00, 0x01, 0x00, 0x1A, 0x05, 0xD0, 0x05, 0xD1, 0x05, 0xD2, - 0x05, 0xD3, 0x05, 0xD4, 0x05, 0xD5, 0x05, 0xD6, 0x05, 0xD8, 0x05, 0xD9, 0x05, 0xDA, 0x05, 0xDB, - 0x05, 0xDC, 0x05, 0xDE, 0x05, 0xE0, 0x05, 0xE1, 0x05, 0xE3, 0x05, 0xE4, 0x05, 0xE6, 0x05, 0xE7, - 0x05, 0xE8, 0x05, 0xE9, 0x05, 0xEA, 0x05, 0xF2, 0xFB, 0x2A, 0xFB, 0x2B, 0xFB, 0x49, 0x00, 0x02, - 0x00, 0x00, 0x00, 0x04, 0x00, 0x0E, 0x01, 0x6C, 0x01, 0x8A, 0x01, 0xAC, 0x00, 0x01, 0x01, 0x16, - 0x00, 0x22, 0x00, 0x4A, 0x00, 0x50, 0x00, 0x56, 0x00, 0x5C, 0x00, 0x62, 0x00, 0x68, 0x00, 0x6E, - 0x00, 0x74, 0x00, 0x7A, 0x00, 0x80, 0x00, 0x86, 0x00, 0x8C, 0x00, 0x92, 0x00, 0x98, 0x00, 0x9E, - 0x00, 0xA4, 0x00, 0xAA, 0x00, 0xB0, 0x00, 0xB6, 0x00, 0xBC, 0x00, 0xC2, 0x00, 0xC8, 0x00, 0xCE, - 0x00, 0xD4, 0x00, 0xDA, 0x00, 0xE0, 0x00, 0xE6, 0x00, 0xEC, 0x00, 0xF2, 0x00, 0xF8, 0x00, 0xFE, - 0x01, 0x04, 0x01, 0x0A, 0x01, 0x10, 0x00, 0x02, 0x05, 0xD9, 0x05, 0xB4, 0x00, 0x02, 0x05, 0xF2, - 0x05, 0xB7, 0x00, 0x02, 0x05, 0xE9, 0x05, 0xC1, 0x00, 0x02, 0x05, 0xE9, 0x05, 0xC2, 0x00, 0x02, - 0xFB, 0x2A, 0x05, 0xBC, 0x00, 0x02, 0xFB, 0x2B, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xD0, 0x05, 0xB7, - 0x00, 0x02, 0x05, 0xD0, 0x05, 0xB8, 0x00, 0x02, 0x05, 0xD0, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xD1, - 0x05, 0xBC, 0x00, 0x02, 0x05, 0xD2, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xD3, 0x05, 0xBC, 0x00, 0x02, - 0x05, 0xD4, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xD5, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xD6, 0x05, 0xBC, - 0x00, 0x02, 0x05, 0xD8, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xD9, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xDA, - 0x05, 0xBC, 0x00, 0x02, 0x05, 0xDB, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xDC, 0x05, 0xBC, 0x00, 0x02, - 0x05, 0xDE, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xE0, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xE1, 0x05, 0xBC, - 0x00, 0x02, 0x05, 0xE3, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xE4, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xE6, - 0x05, 0xBC, 0x00, 0x02, 0x05, 0xE7, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xE8, 0x05, 0xBC, 0x00, 0x02, - 0x05, 0xE9, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xEA, 0x05, 0xBC, 0x00, 0x02, 0x05, 0xD5, 0x05, 0xB9, - 0x00, 0x02, 0x05, 0xD1, 0x05, 0xBF, 0x00, 0x02, 0x05, 0xDB, 0x05, 0xBF, 0x00, 0x02, 0x05, 0xE4, - 0x05, 0xBF, 0x00, 0x01, 0x00, 0x22, 0xFB, 0x1D, 0xFB, 0x1F, 0xFB, 0x2A, 0xFB, 0x2B, 0xFB, 0x2C, - 0xFB, 0x2D, 0xFB, 0x2E, 0xFB, 0x2F, 0xFB, 0x30, 0xFB, 0x31, 0xFB, 0x32, 0xFB, 0x33, 0xFB, 0x34, - 0xFB, 0x35, 0xFB, 0x36, 0xFB, 0x38, 0xFB, 0x39, 0xFB, 0x3A, 0xFB, 0x3B, 0xFB, 0x3C, 0xFB, 0x3E, - 0xFB, 0x40, 0xFB, 0x41, 0xFB, 0x43, 0xFB, 0x44, 0xFB, 0x46, 0xFB, 0x47, 0xFB, 0x48, 0xFB, 0x49, - 0xFB, 0x4A, 0xFB, 0x4B, 0xFB, 0x4C, 0xFB, 0x4D, 0xFB, 0x4E, 0x00, 0x01, 0x00, 0x16, 0x00, 0x02, - 0x00, 0x0A, 0x00, 0x10, 0x00, 0x02, 0xFB, 0x49, 0x05, 0xC1, 0x00, 0x02, 0xFB, 0x49, 0x05, 0xC2, - 0x00, 0x01, 0x00, 0x02, 0xFB, 0x2C, 0xFB, 0x2D, 0x00, 0x01, 0x00, 0x1A, 0x00, 0x02, 0x00, 0x0A, - 0x00, 0x12, 0x00, 0x03, 0x05, 0xE9, 0x05, 0xBC, 0x05, 0xC1, 0x00, 0x03, 0x05, 0xE9, 0x05, 0xBC, - 0x05, 0xC2, 0x00, 0x01, 0x00, 0x02, 0xFB, 0x2C, 0xFB, 0x2D, 0x00, 0x01, 0x00, 0x1A, 0x00, 0x02, - 0x00, 0x0A, 0x00, 0x12, 0x00, 0x03, 0x05, 0xE9, 0x05, 0xC1, 0x05, 0xBC, 0x00, 0x03, 0x05, 0xE9, - 0x05, 0xC2, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x02, 0xFB, 0x2C, 0xFB, 0x2D, 0x00, 0x04, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x01, 0x36, 0x00, 0x16, 0x00, 0x32, 0x00, 0x3C, 0x00, 0x46, - 0x00, 0x50, 0x00, 0x5A, 0x00, 0x64, 0x00, 0x6E, 0x00, 0x78, 0x00, 0x82, 0x00, 0x8C, 0x00, 0x96, - 0x00, 0xA0, 0x00, 0xAA, 0x00, 0xB4, 0x00, 0xBE, 0x00, 0xC8, 0x00, 0xD2, 0x00, 0xE4, 0x00, 0xF6, - 0x01, 0x08, 0x01, 0x1A, 0x01, 0x2C, 0x00, 0x01, 0x00, 0x04, 0x30, 0x94, 0x00, 0x02, 0x30, 0x99, - 0x00, 0x01, 0x00, 0x04, 0x30, 0x4C, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x4E, - 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x50, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, - 0x00, 0x04, 0x30, 0x52, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x54, 0x00, 0x02, - 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x56, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, - 0x30, 0x58, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x5A, 0x00, 0x02, 0x30, 0x99, - 0x00, 0x01, 0x00, 0x04, 0x30, 0x5C, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x5E, - 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x60, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, - 0x00, 0x04, 0x30, 0x62, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x65, 0x00, 0x02, - 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x67, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, - 0x30, 0x69, 0x00, 0x02, 0x30, 0x99, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x30, 0x70, 0x00, 0x02, - 0x30, 0x99, 0x30, 0x71, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x30, 0x73, - 0x00, 0x02, 0x30, 0x99, 0x30, 0x74, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, - 0x30, 0x76, 0x00, 0x02, 0x30, 0x99, 0x30, 0x77, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x02, 0x00, 0x06, - 0x00, 0x0C, 0x30, 0x79, 0x00, 0x02, 0x30, 0x99, 0x30, 0x7A, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x02, - 0x00, 0x06, 0x00, 0x0C, 0x30, 0x7C, 0x00, 0x02, 0x30, 0x99, 0x30, 0x7D, 0x00, 0x02, 0x30, 0x9A, - 0x00, 0x01, 0x00, 0x04, 0x30, 0x9E, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x16, 0x30, 0x46, - 0x30, 0x4B, 0x30, 0x4D, 0x30, 0x4F, 0x30, 0x51, 0x30, 0x53, 0x30, 0x55, 0x30, 0x57, 0x30, 0x59, - 0x30, 0x5B, 0x30, 0x5D, 0x30, 0x5F, 0x30, 0x61, 0x30, 0x64, 0x30, 0x66, 0x30, 0x68, 0x30, 0x6F, - 0x30, 0x72, 0x30, 0x75, 0x30, 0x78, 0x30, 0x7B, 0x30, 0x9D, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x08, 0x00, 0x01, 0x00, 0xDE, 0x00, 0x1B, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0x00, 0x4E, - 0x00, 0x54, 0x00, 0x5A, 0x00, 0x60, 0x00, 0x66, 0x00, 0x6C, 0x00, 0x72, 0x00, 0x78, 0x00, 0x7E, - 0x00, 0x84, 0x00, 0x8A, 0x00, 0x90, 0x00, 0x96, 0x00, 0x9C, 0x00, 0xA2, 0x00, 0xA8, 0x00, 0xAE, - 0x00, 0xB4, 0x00, 0xBA, 0x00, 0xC0, 0x00, 0xC6, 0x00, 0xCC, 0x00, 0xD2, 0x00, 0xD8, 0x00, 0x02, - 0x30, 0x4B, 0x30, 0x99, 0x00, 0x02, 0x30, 0x4D, 0x30, 0x99, 0x00, 0x02, 0x30, 0x4F, 0x30, 0x99, - 0x00, 0x02, 0x30, 0x51, 0x30, 0x99, 0x00, 0x02, 0x30, 0x53, 0x30, 0x99, 0x00, 0x02, 0x30, 0x55, - 0x30, 0x99, 0x00, 0x02, 0x30, 0x57, 0x30, 0x99, 0x00, 0x02, 0x30, 0x59, 0x30, 0x99, 0x00, 0x02, - 0x30, 0x5B, 0x30, 0x99, 0x00, 0x02, 0x30, 0x5D, 0x30, 0x99, 0x00, 0x02, 0x30, 0x5F, 0x30, 0x99, - 0x00, 0x02, 0x30, 0x61, 0x30, 0x99, 0x00, 0x02, 0x30, 0x64, 0x30, 0x99, 0x00, 0x02, 0x30, 0x66, - 0x30, 0x99, 0x00, 0x02, 0x30, 0x68, 0x30, 0x99, 0x00, 0x02, 0x30, 0x6F, 0x30, 0x99, 0x00, 0x02, - 0x30, 0x6F, 0x30, 0x9A, 0x00, 0x02, 0x30, 0x72, 0x30, 0x99, 0x00, 0x02, 0x30, 0x72, 0x30, 0x9A, - 0x00, 0x02, 0x30, 0x75, 0x30, 0x99, 0x00, 0x02, 0x30, 0x75, 0x30, 0x9A, 0x00, 0x02, 0x30, 0x78, - 0x30, 0x99, 0x00, 0x02, 0x30, 0x78, 0x30, 0x9A, 0x00, 0x02, 0x30, 0x7B, 0x30, 0x99, 0x00, 0x02, - 0x30, 0x7B, 0x30, 0x9A, 0x00, 0x02, 0x30, 0x46, 0x30, 0x99, 0x00, 0x02, 0x30, 0x9D, 0x30, 0x99, - 0x00, 0x01, 0x00, 0x1B, 0x30, 0x4C, 0x30, 0x4E, 0x30, 0x50, 0x30, 0x52, 0x30, 0x54, 0x30, 0x56, - 0x30, 0x58, 0x30, 0x5A, 0x30, 0x5C, 0x30, 0x5E, 0x30, 0x60, 0x30, 0x62, 0x30, 0x65, 0x30, 0x67, - 0x30, 0x69, 0x30, 0x70, 0x30, 0x71, 0x30, 0x73, 0x30, 0x74, 0x30, 0x76, 0x30, 0x77, 0x30, 0x79, - 0x30, 0x7A, 0x30, 0x7C, 0x30, 0x7D, 0x30, 0x94, 0x30, 0x9E, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x08, 0x00, 0x01, 0x00, 0x44, 0x00, 0x03, 0x00, 0x0C, 0x00, 0x16, 0x00, 0x3A, 0x00, 0x01, - 0x00, 0x04, 0x0C, 0xC0, 0x00, 0x02, 0x0C, 0xD5, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x12, 0x00, 0x18, - 0x00, 0x1E, 0x0C, 0xCB, 0x00, 0x03, 0x0C, 0xC2, 0x0C, 0xD5, 0x0C, 0xCA, 0x00, 0x02, 0x0C, 0xC2, - 0x0C, 0xC7, 0x00, 0x02, 0x0C, 0xD5, 0x0C, 0xC8, 0x00, 0x02, 0x0C, 0xD6, 0x00, 0x01, 0x00, 0x04, - 0x0C, 0xCB, 0x00, 0x02, 0x0C, 0xD5, 0x00, 0x01, 0x00, 0x03, 0x0C, 0xBF, 0x0C, 0xC6, 0x0C, 0xCA, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x46, 0x00, 0x01, 0x00, 0x2E, 0x00, 0x05, - 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x02, 0x0C, 0xBF, 0x0C, 0xD5, - 0x00, 0x02, 0x0C, 0xC6, 0x0C, 0xD5, 0x00, 0x02, 0x0C, 0xC6, 0x0C, 0xD6, 0x00, 0x02, 0x0C, 0xC6, - 0x0C, 0xC2, 0x00, 0x02, 0x0C, 0xCA, 0x0C, 0xD5, 0x00, 0x01, 0x00, 0x05, 0x0C, 0xC0, 0x0C, 0xC7, - 0x0C, 0xC8, 0x0C, 0xCA, 0x0C, 0xCB, 0x00, 0x01, 0x00, 0x10, 0x00, 0x01, 0x00, 0x08, 0x00, 0x03, - 0x0C, 0xC6, 0x0C, 0xC2, 0x0C, 0xD5, 0x00, 0x01, 0x00, 0x01, 0x0C, 0xCB, 0x00, 0x04, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x01, 0x66, 0x00, 0x1A, 0x00, 0x3A, 0x00, 0x44, 0x00, 0x4E, - 0x00, 0x58, 0x00, 0x62, 0x00, 0x6C, 0x00, 0x76, 0x00, 0x80, 0x00, 0x8A, 0x00, 0x94, 0x00, 0x9E, - 0x00, 0xA8, 0x00, 0xB2, 0x00, 0xBC, 0x00, 0xC6, 0x00, 0xD0, 0x00, 0xDA, 0x00, 0xEC, 0x00, 0xFE, - 0x01, 0x10, 0x01, 0x22, 0x01, 0x34, 0x01, 0x3E, 0x01, 0x48, 0x01, 0x52, 0x01, 0x5C, 0x00, 0x01, - 0x00, 0x04, 0x30, 0xF4, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xAC, 0x00, 0x02, - 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xAE, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, - 0x30, 0xB0, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xB2, 0x00, 0x02, 0x30, 0x99, - 0x00, 0x01, 0x00, 0x04, 0x30, 0xB4, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xB6, - 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xB8, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, - 0x00, 0x04, 0x30, 0xBA, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xBC, 0x00, 0x02, - 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xBE, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, - 0x30, 0xC0, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xC2, 0x00, 0x02, 0x30, 0x99, - 0x00, 0x01, 0x00, 0x04, 0x30, 0xC5, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xC7, - 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xC9, 0x00, 0x02, 0x30, 0x99, 0x00, 0x02, - 0x00, 0x06, 0x00, 0x0C, 0x30, 0xD0, 0x00, 0x02, 0x30, 0x99, 0x30, 0xD1, 0x00, 0x02, 0x30, 0x9A, - 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x30, 0xD3, 0x00, 0x02, 0x30, 0x99, 0x30, 0xD4, 0x00, 0x02, - 0x30, 0x9A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x30, 0xD6, 0x00, 0x02, 0x30, 0x99, 0x30, 0xD7, - 0x00, 0x02, 0x30, 0x9A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x30, 0xD9, 0x00, 0x02, 0x30, 0x99, - 0x30, 0xDA, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x30, 0xDC, 0x00, 0x02, - 0x30, 0x99, 0x30, 0xDD, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x01, 0x00, 0x04, 0x30, 0xF7, 0x00, 0x02, - 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xF8, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, - 0x30, 0xF9, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xFA, 0x00, 0x02, 0x30, 0x99, - 0x00, 0x01, 0x00, 0x04, 0x30, 0xFE, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x1A, 0x30, 0xA6, - 0x30, 0xAB, 0x30, 0xAD, 0x30, 0xAF, 0x30, 0xB1, 0x30, 0xB3, 0x30, 0xB5, 0x30, 0xB7, 0x30, 0xB9, - 0x30, 0xBB, 0x30, 0xBD, 0x30, 0xBF, 0x30, 0xC1, 0x30, 0xC4, 0x30, 0xC6, 0x30, 0xC8, 0x30, 0xCF, - 0x30, 0xD2, 0x30, 0xD5, 0x30, 0xD8, 0x30, 0xDB, 0x30, 0xEF, 0x30, 0xF0, 0x30, 0xF1, 0x30, 0xF2, - 0x30, 0xFD, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0xFE, 0x00, 0x1F, - 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, 0x00, 0x56, 0x00, 0x5C, 0x00, 0x62, 0x00, 0x68, 0x00, 0x6E, - 0x00, 0x74, 0x00, 0x7A, 0x00, 0x80, 0x00, 0x86, 0x00, 0x8C, 0x00, 0x92, 0x00, 0x98, 0x00, 0x9E, - 0x00, 0xA4, 0x00, 0xAA, 0x00, 0xB0, 0x00, 0xB6, 0x00, 0xBC, 0x00, 0xC2, 0x00, 0xC8, 0x00, 0xCE, - 0x00, 0xD4, 0x00, 0xDA, 0x00, 0xE0, 0x00, 0xE6, 0x00, 0xEC, 0x00, 0xF2, 0x00, 0xF8, 0x00, 0x02, - 0x30, 0xAB, 0x30, 0x99, 0x00, 0x02, 0x30, 0xAD, 0x30, 0x99, 0x00, 0x02, 0x30, 0xAF, 0x30, 0x99, - 0x00, 0x02, 0x30, 0xB1, 0x30, 0x99, 0x00, 0x02, 0x30, 0xB3, 0x30, 0x99, 0x00, 0x02, 0x30, 0xB5, - 0x30, 0x99, 0x00, 0x02, 0x30, 0xB7, 0x30, 0x99, 0x00, 0x02, 0x30, 0xB9, 0x30, 0x99, 0x00, 0x02, - 0x30, 0xBB, 0x30, 0x99, 0x00, 0x02, 0x30, 0xBD, 0x30, 0x99, 0x00, 0x02, 0x30, 0xBF, 0x30, 0x99, - 0x00, 0x02, 0x30, 0xC1, 0x30, 0x99, 0x00, 0x02, 0x30, 0xC4, 0x30, 0x99, 0x00, 0x02, 0x30, 0xC6, - 0x30, 0x99, 0x00, 0x02, 0x30, 0xC8, 0x30, 0x99, 0x00, 0x02, 0x30, 0xCF, 0x30, 0x99, 0x00, 0x02, - 0x30, 0xCF, 0x30, 0x9A, 0x00, 0x02, 0x30, 0xD2, 0x30, 0x99, 0x00, 0x02, 0x30, 0xD2, 0x30, 0x9A, - 0x00, 0x02, 0x30, 0xD5, 0x30, 0x99, 0x00, 0x02, 0x30, 0xD5, 0x30, 0x9A, 0x00, 0x02, 0x30, 0xD8, - 0x30, 0x99, 0x00, 0x02, 0x30, 0xD8, 0x30, 0x9A, 0x00, 0x02, 0x30, 0xDB, 0x30, 0x99, 0x00, 0x02, - 0x30, 0xDB, 0x30, 0x9A, 0x00, 0x02, 0x30, 0xA6, 0x30, 0x99, 0x00, 0x02, 0x30, 0xEF, 0x30, 0x99, - 0x00, 0x02, 0x30, 0xF0, 0x30, 0x99, 0x00, 0x02, 0x30, 0xF1, 0x30, 0x99, 0x00, 0x02, 0x30, 0xF2, - 0x30, 0x99, 0x00, 0x02, 0x30, 0xFD, 0x30, 0x99, 0x00, 0x01, 0x00, 0x1F, 0x30, 0xAC, 0x30, 0xAE, - 0x30, 0xB0, 0x30, 0xB2, 0x30, 0xB4, 0x30, 0xB6, 0x30, 0xB8, 0x30, 0xBA, 0x30, 0xBC, 0x30, 0xBE, - 0x30, 0xC0, 0x30, 0xC2, 0x30, 0xC5, 0x30, 0xC7, 0x30, 0xC9, 0x30, 0xD0, 0x30, 0xD1, 0x30, 0xD3, - 0x30, 0xD4, 0x30, 0xD6, 0x30, 0xD7, 0x30, 0xD9, 0x30, 0xDA, 0x30, 0xDC, 0x30, 0xDD, 0x30, 0xF4, - 0x30, 0xF7, 0x30, 0xF8, 0x30, 0xF9, 0x30, 0xFA, 0x30, 0xFE, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x08, 0x00, 0x01, 0x1E, 0x9A, 0x00, 0x89, 0x01, 0x18, 0x02, 0x72, 0x02, 0x8C, 0x02, 0xE6, - 0x03, 0x18, 0x04, 0x3E, 0x04, 0x48, 0x04, 0x8A, 0x04, 0xC4, 0x05, 0x6A, 0x05, 0x74, 0x05, 0xA6, - 0x05, 0xF4, 0x06, 0x16, 0x06, 0x70, 0x08, 0x56, 0x08, 0x70, 0x08, 0xCE, 0x09, 0x42, 0x09, 0x7C, - 0x0B, 0x14, 0x0B, 0x26, 0x0B, 0x68, 0x0B, 0x7A, 0x0B, 0xD4, 0x0C, 0x0E, 0x0D, 0x68, 0x0D, 0x82, - 0x0D, 0xDC, 0x0E, 0x0E, 0x0F, 0x34, 0x0F, 0x3E, 0x0F, 0x80, 0x0F, 0xC2, 0x10, 0x60, 0x10, 0x72, - 0x10, 0xA4, 0x10, 0xF2, 0x11, 0x14, 0x11, 0x6E, 0x13, 0x54, 0x13, 0x6E, 0x13, 0xCC, 0x14, 0x40, - 0x14, 0x82, 0x16, 0x1A, 0x16, 0x2C, 0x16, 0x76, 0x16, 0x88, 0x16, 0xEA, 0x17, 0x24, 0x17, 0x5E, - 0x17, 0x68, 0x17, 0x7A, 0x17, 0x94, 0x17, 0xA6, 0x17, 0xE0, 0x17, 0xF2, 0x17, 0xFC, 0x18, 0x06, - 0x18, 0x40, 0x18, 0x6A, 0x18, 0x74, 0x18, 0x86, 0x18, 0x90, 0x18, 0x9A, 0x18, 0xCC, 0x19, 0x06, - 0x19, 0x10, 0x19, 0x22, 0x19, 0x3C, 0x19, 0x4E, 0x19, 0x88, 0x19, 0x9A, 0x19, 0xA4, 0x19, 0xAE, - 0x19, 0xE8, 0x1A, 0x12, 0x1A, 0x1C, 0x1A, 0x2E, 0x1A, 0x38, 0x1A, 0x42, 0x1A, 0x74, 0x1A, 0xAE, - 0x1A, 0xE8, 0x1A, 0xF2, 0x1A, 0xFC, 0x1B, 0x1E, 0x1B, 0x40, 0x1B, 0x4A, 0x1B, 0x54, 0x1B, 0x7E, - 0x1B, 0xA8, 0x1B, 0xB2, 0x1B, 0xBC, 0x1B, 0xC6, 0x1B, 0xD0, 0x1B, 0xEA, 0x1C, 0x04, 0x1C, 0x0E, - 0x1C, 0x18, 0x1C, 0x22, 0x1C, 0x5C, 0x1C, 0x96, 0x1C, 0xD0, 0x1D, 0x0A, 0x1D, 0x14, 0x1D, 0x1E, - 0x1D, 0x28, 0x1D, 0x32, 0x1D, 0x3C, 0x1D, 0x46, 0x1D, 0x50, 0x1D, 0x5A, 0x1D, 0x64, 0x1D, 0x6E, - 0x1D, 0x78, 0x1D, 0x82, 0x1D, 0x8C, 0x1D, 0x96, 0x1D, 0xA0, 0x1D, 0xAA, 0x1D, 0xB4, 0x1D, 0xBE, - 0x1D, 0xD0, 0x1D, 0xE2, 0x1D, 0xEC, 0x1D, 0xF6, 0x1E, 0x08, 0x1E, 0x1A, 0x1E, 0x24, 0x1E, 0x2E, - 0x1E, 0x38, 0x1E, 0x42, 0x1E, 0x4C, 0x1E, 0x56, 0x1E, 0x88, 0x00, 0x26, 0x00, 0x4E, 0x00, 0x54, - 0x00, 0x5A, 0x00, 0x62, 0x00, 0x6A, 0x00, 0x72, 0x00, 0x7A, 0x00, 0x82, 0x00, 0x8A, 0x00, 0x92, - 0x00, 0x98, 0x00, 0x9E, 0x00, 0xA4, 0x00, 0xAC, 0x00, 0xB4, 0x00, 0xBC, 0x00, 0xC4, 0x00, 0xCC, - 0x00, 0xD4, 0x00, 0xDC, 0x00, 0xE2, 0x00, 0xEA, 0x00, 0xF0, 0x00, 0xF8, 0x00, 0xFE, 0x01, 0x04, - 0x01, 0x0C, 0x01, 0x14, 0x01, 0x1A, 0x01, 0x20, 0x01, 0x26, 0x01, 0x2C, 0x01, 0x34, 0x01, 0x3C, - 0x01, 0x42, 0x01, 0x48, 0x01, 0x4E, 0x01, 0x54, 0x00, 0xC0, 0x00, 0x02, 0x03, 0x00, 0x00, 0xC1, - 0x00, 0x02, 0x03, 0x01, 0x1E, 0xA6, 0x00, 0x03, 0x03, 0x02, 0x03, 0x00, 0x1E, 0xA4, 0x00, 0x03, - 0x03, 0x02, 0x03, 0x01, 0x1E, 0xAA, 0x00, 0x03, 0x03, 0x02, 0x03, 0x03, 0x1E, 0xA8, 0x00, 0x03, - 0x03, 0x02, 0x03, 0x09, 0x1E, 0xAC, 0x00, 0x03, 0x03, 0x02, 0x03, 0x23, 0x1E, 0xA6, 0x00, 0x03, - 0x03, 0x02, 0x03, 0x40, 0x1E, 0xA4, 0x00, 0x03, 0x03, 0x02, 0x03, 0x41, 0x00, 0xC2, 0x00, 0x02, - 0x03, 0x02, 0x00, 0xC3, 0x00, 0x02, 0x03, 0x03, 0x01, 0x00, 0x00, 0x02, 0x03, 0x04, 0x1E, 0xB0, - 0x00, 0x03, 0x03, 0x06, 0x03, 0x00, 0x1E, 0xAE, 0x00, 0x03, 0x03, 0x06, 0x03, 0x01, 0x1E, 0xB4, - 0x00, 0x03, 0x03, 0x06, 0x03, 0x03, 0x1E, 0xB2, 0x00, 0x03, 0x03, 0x06, 0x03, 0x09, 0x1E, 0xB6, - 0x00, 0x03, 0x03, 0x06, 0x03, 0x23, 0x1E, 0xB0, 0x00, 0x03, 0x03, 0x06, 0x03, 0x40, 0x1E, 0xAE, - 0x00, 0x03, 0x03, 0x06, 0x03, 0x41, 0x01, 0x02, 0x00, 0x02, 0x03, 0x06, 0x01, 0xE0, 0x00, 0x03, - 0x03, 0x07, 0x03, 0x04, 0x02, 0x26, 0x00, 0x02, 0x03, 0x07, 0x01, 0xDE, 0x00, 0x03, 0x03, 0x08, - 0x03, 0x04, 0x00, 0xC4, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xA2, 0x00, 0x02, 0x03, 0x09, 0x01, 0xFA, - 0x00, 0x03, 0x03, 0x0A, 0x03, 0x01, 0x01, 0xFA, 0x00, 0x03, 0x03, 0x0A, 0x03, 0x41, 0x00, 0xC5, - 0x00, 0x02, 0x03, 0x0A, 0x01, 0xCD, 0x00, 0x02, 0x03, 0x0C, 0x02, 0x00, 0x00, 0x02, 0x03, 0x0F, - 0x02, 0x02, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xAC, 0x00, 0x03, 0x03, 0x23, 0x03, 0x02, 0x1E, 0xB6, - 0x00, 0x03, 0x03, 0x23, 0x03, 0x06, 0x1E, 0xA0, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x00, 0x00, 0x02, - 0x03, 0x25, 0x01, 0x04, 0x00, 0x02, 0x03, 0x28, 0x00, 0xC0, 0x00, 0x02, 0x03, 0x40, 0x00, 0xC1, - 0x00, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, 0x1E, 0x02, 0x00, 0x02, - 0x03, 0x07, 0x1E, 0x04, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x06, 0x00, 0x02, 0x03, 0x31, 0x00, 0x0A, - 0x00, 0x16, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3E, 0x00, 0x46, - 0x00, 0x4C, 0x00, 0x54, 0x1E, 0x08, 0x00, 0x03, 0x03, 0x01, 0x03, 0x27, 0x01, 0x06, 0x00, 0x02, - 0x03, 0x01, 0x01, 0x08, 0x00, 0x02, 0x03, 0x02, 0x01, 0x0A, 0x00, 0x02, 0x03, 0x07, 0x01, 0x0C, - 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x08, 0x00, 0x03, 0x03, 0x27, 0x03, 0x01, 0x1E, 0x08, 0x00, 0x03, - 0x03, 0x27, 0x03, 0x41, 0x00, 0xC7, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x08, 0x00, 0x03, 0x03, 0x41, - 0x03, 0x27, 0x01, 0x06, 0x00, 0x02, 0x03, 0x41, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, - 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x1E, 0x0A, 0x00, 0x02, 0x03, 0x07, 0x01, 0x0E, 0x00, 0x02, - 0x03, 0x0C, 0x1E, 0x0C, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x10, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x12, - 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x0E, 0x00, 0x02, 0x03, 0x31, 0x00, 0x21, 0x00, 0x44, 0x00, 0x4A, - 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x68, 0x00, 0x70, 0x00, 0x78, 0x00, 0x80, 0x00, 0x88, - 0x00, 0x8E, 0x00, 0x94, 0x00, 0x9C, 0x00, 0xA4, 0x00, 0xAC, 0x00, 0xB4, 0x00, 0xBA, 0x00, 0xC2, - 0x00, 0xC8, 0x00, 0xCE, 0x00, 0xD4, 0x00, 0xDA, 0x00, 0xE0, 0x00, 0xE6, 0x00, 0xEC, 0x00, 0xF4, - 0x00, 0xFA, 0x01, 0x02, 0x01, 0x08, 0x01, 0x0E, 0x01, 0x14, 0x01, 0x1A, 0x01, 0x20, 0x00, 0xC8, - 0x00, 0x02, 0x03, 0x00, 0x00, 0xC9, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xC0, 0x00, 0x03, 0x03, 0x02, - 0x03, 0x00, 0x1E, 0xBE, 0x00, 0x03, 0x03, 0x02, 0x03, 0x01, 0x1E, 0xC4, 0x00, 0x03, 0x03, 0x02, - 0x03, 0x03, 0x1E, 0xC2, 0x00, 0x03, 0x03, 0x02, 0x03, 0x09, 0x1E, 0xC6, 0x00, 0x03, 0x03, 0x02, - 0x03, 0x23, 0x1E, 0xC0, 0x00, 0x03, 0x03, 0x02, 0x03, 0x40, 0x1E, 0xBE, 0x00, 0x03, 0x03, 0x02, - 0x03, 0x41, 0x00, 0xCA, 0x00, 0x02, 0x03, 0x02, 0x1E, 0xBC, 0x00, 0x02, 0x03, 0x03, 0x1E, 0x14, - 0x00, 0x03, 0x03, 0x04, 0x03, 0x00, 0x1E, 0x16, 0x00, 0x03, 0x03, 0x04, 0x03, 0x01, 0x1E, 0x14, - 0x00, 0x03, 0x03, 0x04, 0x03, 0x40, 0x1E, 0x16, 0x00, 0x03, 0x03, 0x04, 0x03, 0x41, 0x01, 0x12, - 0x00, 0x02, 0x03, 0x04, 0x1E, 0x1C, 0x00, 0x03, 0x03, 0x06, 0x03, 0x27, 0x01, 0x14, 0x00, 0x02, - 0x03, 0x06, 0x01, 0x16, 0x00, 0x02, 0x03, 0x07, 0x00, 0xCB, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xBA, - 0x00, 0x02, 0x03, 0x09, 0x01, 0x1A, 0x00, 0x02, 0x03, 0x0C, 0x02, 0x04, 0x00, 0x02, 0x03, 0x0F, - 0x02, 0x06, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xC6, 0x00, 0x03, 0x03, 0x23, 0x03, 0x02, 0x1E, 0xB8, - 0x00, 0x02, 0x03, 0x23, 0x1E, 0x1C, 0x00, 0x03, 0x03, 0x27, 0x03, 0x06, 0x02, 0x28, 0x00, 0x02, - 0x03, 0x27, 0x01, 0x18, 0x00, 0x02, 0x03, 0x28, 0x1E, 0x18, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x1A, - 0x00, 0x02, 0x03, 0x30, 0x00, 0xC8, 0x00, 0x02, 0x03, 0x40, 0x00, 0xC9, 0x00, 0x02, 0x03, 0x41, - 0x00, 0x01, 0x00, 0x04, 0x1E, 0x1E, 0x00, 0x02, 0x03, 0x07, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, - 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x01, 0xF4, 0x00, 0x02, - 0x03, 0x01, 0x01, 0x1C, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x20, 0x00, 0x02, 0x03, 0x04, 0x01, 0x1E, - 0x00, 0x02, 0x03, 0x06, 0x01, 0x20, 0x00, 0x02, 0x03, 0x07, 0x01, 0xE6, 0x00, 0x02, 0x03, 0x0C, - 0x01, 0x22, 0x00, 0x02, 0x03, 0x27, 0x01, 0xF4, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, - 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x01, 0x24, 0x00, 0x02, - 0x03, 0x02, 0x1E, 0x22, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x26, 0x00, 0x02, 0x03, 0x08, 0x02, 0x1E, - 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x24, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x28, 0x00, 0x02, 0x03, 0x27, - 0x1E, 0x2A, 0x00, 0x02, 0x03, 0x2E, 0x00, 0x14, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, - 0x00, 0x42, 0x00, 0x48, 0x00, 0x4E, 0x00, 0x54, 0x00, 0x5C, 0x00, 0x64, 0x00, 0x6A, 0x00, 0x70, - 0x00, 0x76, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x88, 0x00, 0x8E, 0x00, 0x94, 0x00, 0x9A, 0x00, 0xA0, - 0x00, 0xCC, 0x00, 0x02, 0x03, 0x00, 0x00, 0xCD, 0x00, 0x02, 0x03, 0x01, 0x00, 0xCE, 0x00, 0x02, - 0x03, 0x02, 0x01, 0x28, 0x00, 0x02, 0x03, 0x03, 0x01, 0x2A, 0x00, 0x02, 0x03, 0x04, 0x01, 0x2C, - 0x00, 0x02, 0x03, 0x06, 0x01, 0x30, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x2E, 0x00, 0x03, 0x03, 0x08, - 0x03, 0x01, 0x1E, 0x2E, 0x00, 0x03, 0x03, 0x08, 0x03, 0x41, 0x00, 0xCF, 0x00, 0x02, 0x03, 0x08, - 0x1E, 0xC8, 0x00, 0x02, 0x03, 0x09, 0x01, 0xCF, 0x00, 0x02, 0x03, 0x0C, 0x02, 0x08, 0x00, 0x02, - 0x03, 0x0F, 0x02, 0x0A, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xCA, 0x00, 0x02, 0x03, 0x23, 0x01, 0x2E, - 0x00, 0x02, 0x03, 0x28, 0x1E, 0x2C, 0x00, 0x02, 0x03, 0x30, 0x00, 0xCC, 0x00, 0x02, 0x03, 0x40, - 0x00, 0xCD, 0x00, 0x02, 0x03, 0x41, 0x1E, 0x2E, 0x00, 0x02, 0x03, 0x44, 0x00, 0x01, 0x00, 0x04, - 0x01, 0x34, 0x00, 0x02, 0x03, 0x02, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, - 0x00, 0x26, 0x00, 0x2C, 0x1E, 0x30, 0x00, 0x02, 0x03, 0x01, 0x01, 0xE8, 0x00, 0x02, 0x03, 0x0C, - 0x1E, 0x32, 0x00, 0x02, 0x03, 0x23, 0x01, 0x36, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x34, 0x00, 0x02, - 0x03, 0x31, 0x1E, 0x30, 0x00, 0x02, 0x03, 0x41, 0x00, 0x09, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x22, - 0x00, 0x28, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0x01, 0x39, 0x00, 0x02, - 0x03, 0x01, 0x1E, 0x38, 0x00, 0x03, 0x03, 0x04, 0x03, 0x23, 0x01, 0x3D, 0x00, 0x02, 0x03, 0x0C, - 0x1E, 0x38, 0x00, 0x03, 0x03, 0x23, 0x03, 0x04, 0x1E, 0x36, 0x00, 0x02, 0x03, 0x23, 0x01, 0x3B, - 0x00, 0x02, 0x03, 0x27, 0x1E, 0x3C, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x3A, 0x00, 0x02, 0x03, 0x31, - 0x01, 0x39, 0x00, 0x02, 0x03, 0x41, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, - 0x1E, 0x3E, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x40, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x42, 0x00, 0x02, - 0x03, 0x23, 0x1E, 0x3E, 0x00, 0x02, 0x03, 0x41, 0x00, 0x0B, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, - 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0x00, 0x4E, 0x00, 0x54, - 0x01, 0xF8, 0x00, 0x02, 0x03, 0x00, 0x01, 0x43, 0x00, 0x02, 0x03, 0x01, 0x00, 0xD1, 0x00, 0x02, - 0x03, 0x03, 0x1E, 0x44, 0x00, 0x02, 0x03, 0x07, 0x01, 0x47, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x46, - 0x00, 0x02, 0x03, 0x23, 0x01, 0x45, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x4A, 0x00, 0x02, 0x03, 0x2D, - 0x1E, 0x48, 0x00, 0x02, 0x03, 0x31, 0x01, 0xF8, 0x00, 0x02, 0x03, 0x40, 0x01, 0x43, 0x00, 0x02, - 0x03, 0x41, 0x00, 0x34, 0x00, 0x6A, 0x00, 0x72, 0x00, 0x78, 0x00, 0x80, 0x00, 0x86, 0x00, 0x8E, - 0x00, 0x96, 0x00, 0x9E, 0x00, 0xA6, 0x00, 0xAE, 0x00, 0xB6, 0x00, 0xBE, 0x00, 0xC4, 0x00, 0xCC, - 0x00, 0xD4, 0x00, 0xDC, 0x00, 0xE4, 0x00, 0xEC, 0x00, 0xF2, 0x00, 0xFA, 0x01, 0x02, 0x01, 0x0A, - 0x01, 0x12, 0x01, 0x1A, 0x01, 0x20, 0x01, 0x26, 0x01, 0x2E, 0x01, 0x34, 0x01, 0x3C, 0x01, 0x42, - 0x01, 0x4A, 0x01, 0x50, 0x01, 0x56, 0x01, 0x5C, 0x01, 0x62, 0x01, 0x68, 0x01, 0x70, 0x01, 0x78, - 0x01, 0x80, 0x01, 0x88, 0x01, 0x90, 0x01, 0x98, 0x01, 0xA0, 0x01, 0xA6, 0x01, 0xAE, 0x01, 0xB6, - 0x01, 0xBC, 0x01, 0xC4, 0x01, 0xCA, 0x01, 0xD2, 0x01, 0xD8, 0x01, 0xE0, 0x1E, 0xDC, 0x00, 0x03, - 0x03, 0x00, 0x03, 0x1B, 0x00, 0xD2, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xDA, 0x00, 0x03, 0x03, 0x01, - 0x03, 0x1B, 0x00, 0xD3, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xD2, 0x00, 0x03, 0x03, 0x02, 0x03, 0x00, - 0x1E, 0xD0, 0x00, 0x03, 0x03, 0x02, 0x03, 0x01, 0x1E, 0xD6, 0x00, 0x03, 0x03, 0x02, 0x03, 0x03, - 0x1E, 0xD4, 0x00, 0x03, 0x03, 0x02, 0x03, 0x09, 0x1E, 0xD8, 0x00, 0x03, 0x03, 0x02, 0x03, 0x23, - 0x1E, 0xD2, 0x00, 0x03, 0x03, 0x02, 0x03, 0x40, 0x1E, 0xD0, 0x00, 0x03, 0x03, 0x02, 0x03, 0x41, - 0x00, 0xD4, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x4C, 0x00, 0x03, 0x03, 0x03, 0x03, 0x01, 0x02, 0x2C, - 0x00, 0x03, 0x03, 0x03, 0x03, 0x04, 0x1E, 0x4E, 0x00, 0x03, 0x03, 0x03, 0x03, 0x08, 0x1E, 0xE0, - 0x00, 0x03, 0x03, 0x03, 0x03, 0x1B, 0x1E, 0x4C, 0x00, 0x03, 0x03, 0x03, 0x03, 0x41, 0x00, 0xD5, - 0x00, 0x02, 0x03, 0x03, 0x1E, 0x50, 0x00, 0x03, 0x03, 0x04, 0x03, 0x00, 0x1E, 0x52, 0x00, 0x03, - 0x03, 0x04, 0x03, 0x01, 0x01, 0xEC, 0x00, 0x03, 0x03, 0x04, 0x03, 0x28, 0x1E, 0x50, 0x00, 0x03, - 0x03, 0x04, 0x03, 0x40, 0x1E, 0x52, 0x00, 0x03, 0x03, 0x04, 0x03, 0x41, 0x01, 0x4C, 0x00, 0x02, - 0x03, 0x04, 0x01, 0x4E, 0x00, 0x02, 0x03, 0x06, 0x02, 0x30, 0x00, 0x03, 0x03, 0x07, 0x03, 0x04, - 0x02, 0x2E, 0x00, 0x02, 0x03, 0x07, 0x02, 0x2A, 0x00, 0x03, 0x03, 0x08, 0x03, 0x04, 0x00, 0xD6, - 0x00, 0x02, 0x03, 0x08, 0x1E, 0xDE, 0x00, 0x03, 0x03, 0x09, 0x03, 0x1B, 0x1E, 0xCE, 0x00, 0x02, - 0x03, 0x09, 0x01, 0x50, 0x00, 0x02, 0x03, 0x0B, 0x01, 0xD1, 0x00, 0x02, 0x03, 0x0C, 0x02, 0x0C, - 0x00, 0x02, 0x03, 0x0F, 0x02, 0x0E, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xDC, 0x00, 0x03, 0x03, 0x1B, - 0x03, 0x00, 0x1E, 0xDA, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x01, 0x1E, 0xE0, 0x00, 0x03, 0x03, 0x1B, - 0x03, 0x03, 0x1E, 0xDE, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x09, 0x1E, 0xE2, 0x00, 0x03, 0x03, 0x1B, - 0x03, 0x23, 0x1E, 0xDC, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x40, 0x1E, 0xDA, 0x00, 0x03, 0x03, 0x1B, - 0x03, 0x41, 0x01, 0xA0, 0x00, 0x02, 0x03, 0x1B, 0x1E, 0xD8, 0x00, 0x03, 0x03, 0x23, 0x03, 0x02, - 0x1E, 0xE2, 0x00, 0x03, 0x03, 0x23, 0x03, 0x1B, 0x1E, 0xCC, 0x00, 0x02, 0x03, 0x23, 0x01, 0xEC, - 0x00, 0x03, 0x03, 0x28, 0x03, 0x04, 0x01, 0xEA, 0x00, 0x02, 0x03, 0x28, 0x1E, 0xDC, 0x00, 0x03, - 0x03, 0x40, 0x03, 0x1B, 0x00, 0xD2, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xDA, 0x00, 0x03, 0x03, 0x41, - 0x03, 0x1B, 0x00, 0xD3, 0x00, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, - 0x1E, 0x54, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x56, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x54, 0x00, 0x02, - 0x03, 0x41, 0x00, 0x0B, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, - 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, 0x01, 0x54, 0x00, 0x02, 0x03, 0x01, - 0x1E, 0x5C, 0x00, 0x03, 0x03, 0x04, 0x03, 0x23, 0x1E, 0x58, 0x00, 0x02, 0x03, 0x07, 0x01, 0x58, - 0x00, 0x02, 0x03, 0x0C, 0x02, 0x10, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x12, 0x00, 0x02, 0x03, 0x11, - 0x1E, 0x5C, 0x00, 0x03, 0x03, 0x23, 0x03, 0x04, 0x1E, 0x5A, 0x00, 0x02, 0x03, 0x23, 0x01, 0x56, - 0x00, 0x02, 0x03, 0x27, 0x1E, 0x5E, 0x00, 0x02, 0x03, 0x31, 0x01, 0x54, 0x00, 0x02, 0x03, 0x41, - 0x00, 0x0D, 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x46, - 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5A, 0x00, 0x60, 0x00, 0x66, 0x00, 0x6E, 0x1E, 0x64, 0x00, 0x03, - 0x03, 0x01, 0x03, 0x07, 0x01, 0x5A, 0x00, 0x02, 0x03, 0x01, 0x01, 0x5C, 0x00, 0x02, 0x03, 0x02, - 0x1E, 0x68, 0x00, 0x03, 0x03, 0x07, 0x03, 0x23, 0x1E, 0x60, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x66, - 0x00, 0x03, 0x03, 0x0C, 0x03, 0x07, 0x01, 0x60, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x68, 0x00, 0x03, - 0x03, 0x23, 0x03, 0x07, 0x1E, 0x62, 0x00, 0x02, 0x03, 0x23, 0x02, 0x18, 0x00, 0x02, 0x03, 0x26, - 0x01, 0x5E, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x64, 0x00, 0x03, 0x03, 0x41, 0x03, 0x07, 0x01, 0x5A, - 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, - 0x00, 0x2E, 0x00, 0x34, 0x1E, 0x6A, 0x00, 0x02, 0x03, 0x07, 0x01, 0x64, 0x00, 0x02, 0x03, 0x0C, - 0x1E, 0x6C, 0x00, 0x02, 0x03, 0x23, 0x02, 0x1A, 0x00, 0x02, 0x03, 0x26, 0x01, 0x62, 0x00, 0x02, - 0x03, 0x27, 0x1E, 0x70, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x6E, 0x00, 0x02, 0x03, 0x31, 0x00, 0x2D, - 0x00, 0x5C, 0x00, 0x64, 0x00, 0x6A, 0x00, 0x72, 0x00, 0x78, 0x00, 0x7E, 0x00, 0x86, 0x00, 0x8E, - 0x00, 0x96, 0x00, 0x9C, 0x00, 0xA4, 0x00, 0xAA, 0x00, 0xB0, 0x00, 0xB8, 0x00, 0xC0, 0x00, 0xC8, - 0x00, 0xD0, 0x00, 0xD8, 0x00, 0xE0, 0x00, 0xE6, 0x00, 0xEE, 0x00, 0xF4, 0x00, 0xFA, 0x01, 0x00, - 0x01, 0x06, 0x01, 0x0C, 0x01, 0x12, 0x01, 0x1A, 0x01, 0x22, 0x01, 0x2A, 0x01, 0x32, 0x01, 0x3A, - 0x01, 0x42, 0x01, 0x4A, 0x01, 0x50, 0x01, 0x58, 0x01, 0x5E, 0x01, 0x64, 0x01, 0x6A, 0x01, 0x70, - 0x01, 0x76, 0x01, 0x7E, 0x01, 0x84, 0x01, 0x8C, 0x01, 0x92, 0x1E, 0xEA, 0x00, 0x03, 0x03, 0x00, - 0x03, 0x1B, 0x00, 0xD9, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xE8, 0x00, 0x03, 0x03, 0x01, 0x03, 0x1B, - 0x00, 0xDA, 0x00, 0x02, 0x03, 0x01, 0x00, 0xDB, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x78, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x01, 0x1E, 0xEE, 0x00, 0x03, 0x03, 0x03, 0x03, 0x1B, 0x1E, 0x78, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x41, 0x01, 0x68, 0x00, 0x02, 0x03, 0x03, 0x1E, 0x7A, 0x00, 0x03, 0x03, 0x04, - 0x03, 0x08, 0x01, 0x6A, 0x00, 0x02, 0x03, 0x04, 0x01, 0x6C, 0x00, 0x02, 0x03, 0x06, 0x01, 0xDB, - 0x00, 0x03, 0x03, 0x08, 0x03, 0x00, 0x01, 0xD7, 0x00, 0x03, 0x03, 0x08, 0x03, 0x01, 0x01, 0xD5, - 0x00, 0x03, 0x03, 0x08, 0x03, 0x04, 0x01, 0xD9, 0x00, 0x03, 0x03, 0x08, 0x03, 0x0C, 0x01, 0xDB, - 0x00, 0x03, 0x03, 0x08, 0x03, 0x40, 0x01, 0xD7, 0x00, 0x03, 0x03, 0x08, 0x03, 0x41, 0x00, 0xDC, - 0x00, 0x02, 0x03, 0x08, 0x1E, 0xEC, 0x00, 0x03, 0x03, 0x09, 0x03, 0x1B, 0x1E, 0xE6, 0x00, 0x02, - 0x03, 0x09, 0x01, 0x6E, 0x00, 0x02, 0x03, 0x0A, 0x01, 0x70, 0x00, 0x02, 0x03, 0x0B, 0x01, 0xD3, - 0x00, 0x02, 0x03, 0x0C, 0x02, 0x14, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x16, 0x00, 0x02, 0x03, 0x11, - 0x1E, 0xEA, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x00, 0x1E, 0xE8, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x01, - 0x1E, 0xEE, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x03, 0x1E, 0xEC, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x09, - 0x1E, 0xF0, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x23, 0x1E, 0xEA, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x40, - 0x1E, 0xE8, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x41, 0x01, 0xAF, 0x00, 0x02, 0x03, 0x1B, 0x1E, 0xF0, - 0x00, 0x03, 0x03, 0x23, 0x03, 0x1B, 0x1E, 0xE4, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x72, 0x00, 0x02, - 0x03, 0x24, 0x01, 0x72, 0x00, 0x02, 0x03, 0x28, 0x1E, 0x76, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x74, - 0x00, 0x02, 0x03, 0x30, 0x1E, 0xEA, 0x00, 0x03, 0x03, 0x40, 0x03, 0x1B, 0x00, 0xD9, 0x00, 0x02, - 0x03, 0x40, 0x1E, 0xE8, 0x00, 0x03, 0x03, 0x41, 0x03, 0x1B, 0x00, 0xDA, 0x00, 0x02, 0x03, 0x41, - 0x01, 0xD7, 0x00, 0x02, 0x03, 0x44, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0x7C, 0x00, 0x02, - 0x03, 0x03, 0x1E, 0x7E, 0x00, 0x02, 0x03, 0x23, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, - 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x1E, 0x80, 0x00, 0x02, 0x03, 0x00, - 0x1E, 0x82, 0x00, 0x02, 0x03, 0x01, 0x01, 0x74, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x86, 0x00, 0x02, - 0x03, 0x07, 0x1E, 0x84, 0x00, 0x02, 0x03, 0x08, 0x1E, 0x88, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x80, - 0x00, 0x02, 0x03, 0x40, 0x1E, 0x82, 0x00, 0x02, 0x03, 0x41, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, - 0x1E, 0x8A, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x8C, 0x00, 0x02, 0x03, 0x08, 0x00, 0x0B, 0x00, 0x18, - 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, - 0x00, 0x4E, 0x00, 0x54, 0x1E, 0xF2, 0x00, 0x02, 0x03, 0x00, 0x00, 0xDD, 0x00, 0x02, 0x03, 0x01, - 0x01, 0x76, 0x00, 0x02, 0x03, 0x02, 0x1E, 0xF8, 0x00, 0x02, 0x03, 0x03, 0x02, 0x32, 0x00, 0x02, - 0x03, 0x04, 0x1E, 0x8E, 0x00, 0x02, 0x03, 0x07, 0x01, 0x78, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xF6, - 0x00, 0x02, 0x03, 0x09, 0x1E, 0xF4, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xF2, 0x00, 0x02, 0x03, 0x40, - 0x00, 0xDD, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, - 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x01, 0x79, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x90, 0x00, 0x02, - 0x03, 0x02, 0x01, 0x7B, 0x00, 0x02, 0x03, 0x07, 0x01, 0x7D, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x92, - 0x00, 0x02, 0x03, 0x23, 0x1E, 0x94, 0x00, 0x02, 0x03, 0x31, 0x01, 0x79, 0x00, 0x02, 0x03, 0x41, + 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, 0x03, 0x40, 0x03, 0x45, 0x00, 0x04, 0x21, 0x26, + 0x03, 0x43, 0x03, 0x41, 0x03, 0x45, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, + 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, 0x03, 0x45, + 0x03, 0x00, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, 0x03, 0x45, 0x03, 0x01, 0x00, 0x01, 0x00, 0x02, + 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, + 0x21, 0x26, 0x03, 0x43, 0x03, 0x45, 0x03, 0x40, 0x00, 0x04, 0x21, 0x26, 0x03, 0x43, 0x03, 0x45, + 0x03, 0x41, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, + 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x13, 0x03, 0x00, 0x00, 0x04, + 0x21, 0x26, 0x03, 0x45, 0x03, 0x13, 0x03, 0x01, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, + 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, + 0x03, 0x13, 0x03, 0x40, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x13, 0x03, 0x41, 0x00, 0x01, + 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, + 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x43, 0x03, 0x00, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, + 0x03, 0x43, 0x03, 0x01, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, 0x1F, 0xAC, 0x00, 0x01, 0x00, 0x1E, + 0x00, 0x02, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x43, 0x03, 0x40, + 0x00, 0x04, 0x21, 0x26, 0x03, 0x45, 0x03, 0x43, 0x03, 0x41, 0x00, 0x01, 0x00, 0x02, 0x1F, 0xAA, + 0x1F, 0xAC, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x01, 0x36, 0x00, 0x16, + 0x00, 0x32, 0x00, 0x3C, 0x00, 0x46, 0x00, 0x50, 0x00, 0x5A, 0x00, 0x64, 0x00, 0x6E, 0x00, 0x78, + 0x00, 0x82, 0x00, 0x8C, 0x00, 0x96, 0x00, 0xA0, 0x00, 0xAA, 0x00, 0xB4, 0x00, 0xBE, 0x00, 0xC8, + 0x00, 0xD2, 0x00, 0xE4, 0x00, 0xF6, 0x01, 0x08, 0x01, 0x1A, 0x01, 0x2C, 0x00, 0x01, 0x00, 0x04, + 0x30, 0x94, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x4C, 0x00, 0x02, 0x30, 0x99, + 0x00, 0x01, 0x00, 0x04, 0x30, 0x4E, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x50, + 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x52, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, + 0x00, 0x04, 0x30, 0x54, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x56, 0x00, 0x02, + 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x58, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, + 0x30, 0x5A, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x5C, 0x00, 0x02, 0x30, 0x99, + 0x00, 0x01, 0x00, 0x04, 0x30, 0x5E, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x60, + 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x62, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, + 0x00, 0x04, 0x30, 0x65, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x67, 0x00, 0x02, + 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0x69, 0x00, 0x02, 0x30, 0x99, 0x00, 0x02, 0x00, 0x06, + 0x00, 0x0C, 0x30, 0x70, 0x00, 0x02, 0x30, 0x99, 0x30, 0x71, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x02, + 0x00, 0x06, 0x00, 0x0C, 0x30, 0x73, 0x00, 0x02, 0x30, 0x99, 0x30, 0x74, 0x00, 0x02, 0x30, 0x9A, + 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x30, 0x76, 0x00, 0x02, 0x30, 0x99, 0x30, 0x77, 0x00, 0x02, + 0x30, 0x9A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x30, 0x79, 0x00, 0x02, 0x30, 0x99, 0x30, 0x7A, + 0x00, 0x02, 0x30, 0x9A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x30, 0x7C, 0x00, 0x02, 0x30, 0x99, + 0x30, 0x7D, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x01, 0x00, 0x04, 0x30, 0x9E, 0x00, 0x02, 0x30, 0x99, + 0x00, 0x01, 0x00, 0x16, 0x30, 0x46, 0x30, 0x4B, 0x30, 0x4D, 0x30, 0x4F, 0x30, 0x51, 0x30, 0x53, + 0x30, 0x55, 0x30, 0x57, 0x30, 0x59, 0x30, 0x5B, 0x30, 0x5D, 0x30, 0x5F, 0x30, 0x61, 0x30, 0x64, + 0x30, 0x66, 0x30, 0x68, 0x30, 0x6F, 0x30, 0x72, 0x30, 0x75, 0x30, 0x78, 0x30, 0x7B, 0x30, 0x9D, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0xDE, 0x00, 0x1B, 0x00, 0x3C, + 0x00, 0x42, 0x00, 0x48, 0x00, 0x4E, 0x00, 0x54, 0x00, 0x5A, 0x00, 0x60, 0x00, 0x66, 0x00, 0x6C, + 0x00, 0x72, 0x00, 0x78, 0x00, 0x7E, 0x00, 0x84, 0x00, 0x8A, 0x00, 0x90, 0x00, 0x96, 0x00, 0x9C, + 0x00, 0xA2, 0x00, 0xA8, 0x00, 0xAE, 0x00, 0xB4, 0x00, 0xBA, 0x00, 0xC0, 0x00, 0xC6, 0x00, 0xCC, + 0x00, 0xD2, 0x00, 0xD8, 0x00, 0x02, 0x30, 0x4B, 0x30, 0x99, 0x00, 0x02, 0x30, 0x4D, 0x30, 0x99, + 0x00, 0x02, 0x30, 0x4F, 0x30, 0x99, 0x00, 0x02, 0x30, 0x51, 0x30, 0x99, 0x00, 0x02, 0x30, 0x53, + 0x30, 0x99, 0x00, 0x02, 0x30, 0x55, 0x30, 0x99, 0x00, 0x02, 0x30, 0x57, 0x30, 0x99, 0x00, 0x02, + 0x30, 0x59, 0x30, 0x99, 0x00, 0x02, 0x30, 0x5B, 0x30, 0x99, 0x00, 0x02, 0x30, 0x5D, 0x30, 0x99, + 0x00, 0x02, 0x30, 0x5F, 0x30, 0x99, 0x00, 0x02, 0x30, 0x61, 0x30, 0x99, 0x00, 0x02, 0x30, 0x64, + 0x30, 0x99, 0x00, 0x02, 0x30, 0x66, 0x30, 0x99, 0x00, 0x02, 0x30, 0x68, 0x30, 0x99, 0x00, 0x02, + 0x30, 0x6F, 0x30, 0x99, 0x00, 0x02, 0x30, 0x6F, 0x30, 0x9A, 0x00, 0x02, 0x30, 0x72, 0x30, 0x99, + 0x00, 0x02, 0x30, 0x72, 0x30, 0x9A, 0x00, 0x02, 0x30, 0x75, 0x30, 0x99, 0x00, 0x02, 0x30, 0x75, + 0x30, 0x9A, 0x00, 0x02, 0x30, 0x78, 0x30, 0x99, 0x00, 0x02, 0x30, 0x78, 0x30, 0x9A, 0x00, 0x02, + 0x30, 0x7B, 0x30, 0x99, 0x00, 0x02, 0x30, 0x7B, 0x30, 0x9A, 0x00, 0x02, 0x30, 0x46, 0x30, 0x99, + 0x00, 0x02, 0x30, 0x9D, 0x30, 0x99, 0x00, 0x01, 0x00, 0x1B, 0x30, 0x4C, 0x30, 0x4E, 0x30, 0x50, + 0x30, 0x52, 0x30, 0x54, 0x30, 0x56, 0x30, 0x58, 0x30, 0x5A, 0x30, 0x5C, 0x30, 0x5E, 0x30, 0x60, + 0x30, 0x62, 0x30, 0x65, 0x30, 0x67, 0x30, 0x69, 0x30, 0x70, 0x30, 0x71, 0x30, 0x73, 0x30, 0x74, + 0x30, 0x76, 0x30, 0x77, 0x30, 0x79, 0x30, 0x7A, 0x30, 0x7C, 0x30, 0x7D, 0x30, 0x94, 0x30, 0x9E, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x44, 0x00, 0x03, 0x00, 0x0C, + 0x00, 0x16, 0x00, 0x3A, 0x00, 0x01, 0x00, 0x04, 0x0C, 0xC0, 0x00, 0x02, 0x0C, 0xD5, 0x00, 0x04, + 0x00, 0x0A, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x0C, 0xCB, 0x00, 0x03, 0x0C, 0xC2, 0x0C, 0xD5, + 0x0C, 0xCA, 0x00, 0x02, 0x0C, 0xC2, 0x0C, 0xC7, 0x00, 0x02, 0x0C, 0xD5, 0x0C, 0xC8, 0x00, 0x02, + 0x0C, 0xD6, 0x00, 0x01, 0x00, 0x04, 0x0C, 0xCB, 0x00, 0x02, 0x0C, 0xD5, 0x00, 0x01, 0x00, 0x03, + 0x0C, 0xBF, 0x0C, 0xC6, 0x0C, 0xCA, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x46, + 0x00, 0x01, 0x00, 0x2E, 0x00, 0x05, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, + 0x00, 0x02, 0x0C, 0xBF, 0x0C, 0xD5, 0x00, 0x02, 0x0C, 0xC6, 0x0C, 0xD5, 0x00, 0x02, 0x0C, 0xC6, + 0x0C, 0xD6, 0x00, 0x02, 0x0C, 0xC6, 0x0C, 0xC2, 0x00, 0x02, 0x0C, 0xCA, 0x0C, 0xD5, 0x00, 0x01, + 0x00, 0x05, 0x0C, 0xC0, 0x0C, 0xC7, 0x0C, 0xC8, 0x0C, 0xCA, 0x0C, 0xCB, 0x00, 0x01, 0x00, 0x10, + 0x00, 0x01, 0x00, 0x08, 0x00, 0x03, 0x0C, 0xC6, 0x0C, 0xC2, 0x0C, 0xD5, 0x00, 0x01, 0x00, 0x01, + 0x0C, 0xCB, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x01, 0x66, 0x00, 0x1A, + 0x00, 0x3A, 0x00, 0x44, 0x00, 0x4E, 0x00, 0x58, 0x00, 0x62, 0x00, 0x6C, 0x00, 0x76, 0x00, 0x80, + 0x00, 0x8A, 0x00, 0x94, 0x00, 0x9E, 0x00, 0xA8, 0x00, 0xB2, 0x00, 0xBC, 0x00, 0xC6, 0x00, 0xD0, + 0x00, 0xDA, 0x00, 0xEC, 0x00, 0xFE, 0x01, 0x10, 0x01, 0x22, 0x01, 0x34, 0x01, 0x3E, 0x01, 0x48, + 0x01, 0x52, 0x01, 0x5C, 0x00, 0x01, 0x00, 0x04, 0x30, 0xF4, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, + 0x00, 0x04, 0x30, 0xAC, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xAE, 0x00, 0x02, + 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xB0, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, + 0x30, 0xB2, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xB4, 0x00, 0x02, 0x30, 0x99, + 0x00, 0x01, 0x00, 0x04, 0x30, 0xB6, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xB8, + 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xBA, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, + 0x00, 0x04, 0x30, 0xBC, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xBE, 0x00, 0x02, + 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xC0, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, + 0x30, 0xC2, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xC5, 0x00, 0x02, 0x30, 0x99, + 0x00, 0x01, 0x00, 0x04, 0x30, 0xC7, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xC9, + 0x00, 0x02, 0x30, 0x99, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x30, 0xD0, 0x00, 0x02, 0x30, 0x99, + 0x30, 0xD1, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x30, 0xD3, 0x00, 0x02, + 0x30, 0x99, 0x30, 0xD4, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x30, 0xD6, + 0x00, 0x02, 0x30, 0x99, 0x30, 0xD7, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, + 0x30, 0xD9, 0x00, 0x02, 0x30, 0x99, 0x30, 0xDA, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x02, 0x00, 0x06, + 0x00, 0x0C, 0x30, 0xDC, 0x00, 0x02, 0x30, 0x99, 0x30, 0xDD, 0x00, 0x02, 0x30, 0x9A, 0x00, 0x01, + 0x00, 0x04, 0x30, 0xF7, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xF8, 0x00, 0x02, + 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xF9, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, + 0x30, 0xFA, 0x00, 0x02, 0x30, 0x99, 0x00, 0x01, 0x00, 0x04, 0x30, 0xFE, 0x00, 0x02, 0x30, 0x99, + 0x00, 0x01, 0x00, 0x1A, 0x30, 0xA6, 0x30, 0xAB, 0x30, 0xAD, 0x30, 0xAF, 0x30, 0xB1, 0x30, 0xB3, + 0x30, 0xB5, 0x30, 0xB7, 0x30, 0xB9, 0x30, 0xBB, 0x30, 0xBD, 0x30, 0xBF, 0x30, 0xC1, 0x30, 0xC4, + 0x30, 0xC6, 0x30, 0xC8, 0x30, 0xCF, 0x30, 0xD2, 0x30, 0xD5, 0x30, 0xD8, 0x30, 0xDB, 0x30, 0xEF, + 0x30, 0xF0, 0x30, 0xF1, 0x30, 0xF2, 0x30, 0xFD, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, + 0x00, 0x01, 0x00, 0xFE, 0x00, 0x1F, 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, 0x00, 0x56, 0x00, 0x5C, + 0x00, 0x62, 0x00, 0x68, 0x00, 0x6E, 0x00, 0x74, 0x00, 0x7A, 0x00, 0x80, 0x00, 0x86, 0x00, 0x8C, + 0x00, 0x92, 0x00, 0x98, 0x00, 0x9E, 0x00, 0xA4, 0x00, 0xAA, 0x00, 0xB0, 0x00, 0xB6, 0x00, 0xBC, + 0x00, 0xC2, 0x00, 0xC8, 0x00, 0xCE, 0x00, 0xD4, 0x00, 0xDA, 0x00, 0xE0, 0x00, 0xE6, 0x00, 0xEC, + 0x00, 0xF2, 0x00, 0xF8, 0x00, 0x02, 0x30, 0xAB, 0x30, 0x99, 0x00, 0x02, 0x30, 0xAD, 0x30, 0x99, + 0x00, 0x02, 0x30, 0xAF, 0x30, 0x99, 0x00, 0x02, 0x30, 0xB1, 0x30, 0x99, 0x00, 0x02, 0x30, 0xB3, + 0x30, 0x99, 0x00, 0x02, 0x30, 0xB5, 0x30, 0x99, 0x00, 0x02, 0x30, 0xB7, 0x30, 0x99, 0x00, 0x02, + 0x30, 0xB9, 0x30, 0x99, 0x00, 0x02, 0x30, 0xBB, 0x30, 0x99, 0x00, 0x02, 0x30, 0xBD, 0x30, 0x99, + 0x00, 0x02, 0x30, 0xBF, 0x30, 0x99, 0x00, 0x02, 0x30, 0xC1, 0x30, 0x99, 0x00, 0x02, 0x30, 0xC4, + 0x30, 0x99, 0x00, 0x02, 0x30, 0xC6, 0x30, 0x99, 0x00, 0x02, 0x30, 0xC8, 0x30, 0x99, 0x00, 0x02, + 0x30, 0xCF, 0x30, 0x99, 0x00, 0x02, 0x30, 0xCF, 0x30, 0x9A, 0x00, 0x02, 0x30, 0xD2, 0x30, 0x99, + 0x00, 0x02, 0x30, 0xD2, 0x30, 0x9A, 0x00, 0x02, 0x30, 0xD5, 0x30, 0x99, 0x00, 0x02, 0x30, 0xD5, + 0x30, 0x9A, 0x00, 0x02, 0x30, 0xD8, 0x30, 0x99, 0x00, 0x02, 0x30, 0xD8, 0x30, 0x9A, 0x00, 0x02, + 0x30, 0xDB, 0x30, 0x99, 0x00, 0x02, 0x30, 0xDB, 0x30, 0x9A, 0x00, 0x02, 0x30, 0xA6, 0x30, 0x99, + 0x00, 0x02, 0x30, 0xEF, 0x30, 0x99, 0x00, 0x02, 0x30, 0xF0, 0x30, 0x99, 0x00, 0x02, 0x30, 0xF1, + 0x30, 0x99, 0x00, 0x02, 0x30, 0xF2, 0x30, 0x99, 0x00, 0x02, 0x30, 0xFD, 0x30, 0x99, 0x00, 0x01, + 0x00, 0x1F, 0x30, 0xAC, 0x30, 0xAE, 0x30, 0xB0, 0x30, 0xB2, 0x30, 0xB4, 0x30, 0xB6, 0x30, 0xB8, + 0x30, 0xBA, 0x30, 0xBC, 0x30, 0xBE, 0x30, 0xC0, 0x30, 0xC2, 0x30, 0xC5, 0x30, 0xC7, 0x30, 0xC9, + 0x30, 0xD0, 0x30, 0xD1, 0x30, 0xD3, 0x30, 0xD4, 0x30, 0xD6, 0x30, 0xD7, 0x30, 0xD9, 0x30, 0xDA, + 0x30, 0xDC, 0x30, 0xDD, 0x30, 0xF4, 0x30, 0xF7, 0x30, 0xF8, 0x30, 0xF9, 0x30, 0xFA, 0x30, 0xFE, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x1E, 0x9A, 0x00, 0x89, 0x01, 0x18, + 0x02, 0x72, 0x02, 0x8C, 0x02, 0xE6, 0x03, 0x18, 0x04, 0x3E, 0x04, 0x48, 0x04, 0x8A, 0x04, 0xC4, + 0x05, 0x6A, 0x05, 0x74, 0x05, 0xA6, 0x05, 0xF4, 0x06, 0x16, 0x06, 0x70, 0x08, 0x56, 0x08, 0x70, + 0x08, 0xCE, 0x09, 0x42, 0x09, 0x7C, 0x0B, 0x14, 0x0B, 0x26, 0x0B, 0x68, 0x0B, 0x7A, 0x0B, 0xD4, + 0x0C, 0x0E, 0x0D, 0x68, 0x0D, 0x82, 0x0D, 0xDC, 0x0E, 0x0E, 0x0F, 0x34, 0x0F, 0x3E, 0x0F, 0x80, + 0x0F, 0xC2, 0x10, 0x60, 0x10, 0x72, 0x10, 0xA4, 0x10, 0xF2, 0x11, 0x14, 0x11, 0x6E, 0x13, 0x54, + 0x13, 0x6E, 0x13, 0xCC, 0x14, 0x40, 0x14, 0x82, 0x16, 0x1A, 0x16, 0x2C, 0x16, 0x76, 0x16, 0x88, + 0x16, 0xEA, 0x17, 0x24, 0x17, 0x5E, 0x17, 0x68, 0x17, 0x7A, 0x17, 0x94, 0x17, 0xA6, 0x17, 0xE0, + 0x17, 0xF2, 0x17, 0xFC, 0x18, 0x06, 0x18, 0x40, 0x18, 0x6A, 0x18, 0x74, 0x18, 0x86, 0x18, 0x90, + 0x18, 0x9A, 0x18, 0xCC, 0x19, 0x06, 0x19, 0x10, 0x19, 0x22, 0x19, 0x3C, 0x19, 0x4E, 0x19, 0x88, + 0x19, 0x9A, 0x19, 0xA4, 0x19, 0xAE, 0x19, 0xE8, 0x1A, 0x12, 0x1A, 0x1C, 0x1A, 0x2E, 0x1A, 0x38, + 0x1A, 0x42, 0x1A, 0x74, 0x1A, 0xAE, 0x1A, 0xE8, 0x1A, 0xF2, 0x1A, 0xFC, 0x1B, 0x1E, 0x1B, 0x40, + 0x1B, 0x4A, 0x1B, 0x54, 0x1B, 0x7E, 0x1B, 0xA8, 0x1B, 0xB2, 0x1B, 0xBC, 0x1B, 0xC6, 0x1B, 0xD0, + 0x1B, 0xEA, 0x1C, 0x04, 0x1C, 0x0E, 0x1C, 0x18, 0x1C, 0x22, 0x1C, 0x5C, 0x1C, 0x96, 0x1C, 0xD0, + 0x1D, 0x0A, 0x1D, 0x14, 0x1D, 0x1E, 0x1D, 0x28, 0x1D, 0x32, 0x1D, 0x3C, 0x1D, 0x46, 0x1D, 0x50, + 0x1D, 0x5A, 0x1D, 0x64, 0x1D, 0x6E, 0x1D, 0x78, 0x1D, 0x82, 0x1D, 0x8C, 0x1D, 0x96, 0x1D, 0xA0, + 0x1D, 0xAA, 0x1D, 0xB4, 0x1D, 0xBE, 0x1D, 0xD0, 0x1D, 0xE2, 0x1D, 0xEC, 0x1D, 0xF6, 0x1E, 0x08, + 0x1E, 0x1A, 0x1E, 0x24, 0x1E, 0x2E, 0x1E, 0x38, 0x1E, 0x42, 0x1E, 0x4C, 0x1E, 0x56, 0x1E, 0x88, 0x00, 0x26, 0x00, 0x4E, 0x00, 0x54, 0x00, 0x5A, 0x00, 0x62, 0x00, 0x6A, 0x00, 0x72, 0x00, 0x7A, 0x00, 0x82, 0x00, 0x8A, 0x00, 0x92, 0x00, 0x98, 0x00, 0x9E, 0x00, 0xA4, 0x00, 0xAC, 0x00, 0xB4, 0x00, 0xBC, 0x00, 0xC4, 0x00, 0xCC, 0x00, 0xD4, 0x00, 0xDC, 0x00, 0xE2, 0x00, 0xEA, 0x00, 0xF0, 0x00, 0xF8, 0x00, 0xFE, 0x01, 0x04, 0x01, 0x0C, 0x01, 0x14, 0x01, 0x1A, 0x01, 0x20, 0x01, 0x26, - 0x01, 0x2C, 0x01, 0x34, 0x01, 0x3C, 0x01, 0x42, 0x01, 0x48, 0x01, 0x4E, 0x01, 0x54, 0x00, 0xE0, - 0x00, 0x02, 0x03, 0x00, 0x00, 0xE1, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xA7, 0x00, 0x03, 0x03, 0x02, - 0x03, 0x00, 0x1E, 0xA5, 0x00, 0x03, 0x03, 0x02, 0x03, 0x01, 0x1E, 0xAB, 0x00, 0x03, 0x03, 0x02, - 0x03, 0x03, 0x1E, 0xA9, 0x00, 0x03, 0x03, 0x02, 0x03, 0x09, 0x1E, 0xAD, 0x00, 0x03, 0x03, 0x02, - 0x03, 0x23, 0x1E, 0xA7, 0x00, 0x03, 0x03, 0x02, 0x03, 0x40, 0x1E, 0xA5, 0x00, 0x03, 0x03, 0x02, - 0x03, 0x41, 0x00, 0xE2, 0x00, 0x02, 0x03, 0x02, 0x00, 0xE3, 0x00, 0x02, 0x03, 0x03, 0x01, 0x01, - 0x00, 0x02, 0x03, 0x04, 0x1E, 0xB1, 0x00, 0x03, 0x03, 0x06, 0x03, 0x00, 0x1E, 0xAF, 0x00, 0x03, - 0x03, 0x06, 0x03, 0x01, 0x1E, 0xB5, 0x00, 0x03, 0x03, 0x06, 0x03, 0x03, 0x1E, 0xB3, 0x00, 0x03, - 0x03, 0x06, 0x03, 0x09, 0x1E, 0xB7, 0x00, 0x03, 0x03, 0x06, 0x03, 0x23, 0x1E, 0xB1, 0x00, 0x03, - 0x03, 0x06, 0x03, 0x40, 0x1E, 0xAF, 0x00, 0x03, 0x03, 0x06, 0x03, 0x41, 0x01, 0x03, 0x00, 0x02, - 0x03, 0x06, 0x01, 0xE1, 0x00, 0x03, 0x03, 0x07, 0x03, 0x04, 0x02, 0x27, 0x00, 0x02, 0x03, 0x07, - 0x01, 0xDF, 0x00, 0x03, 0x03, 0x08, 0x03, 0x04, 0x00, 0xE4, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xA3, - 0x00, 0x02, 0x03, 0x09, 0x01, 0xFB, 0x00, 0x03, 0x03, 0x0A, 0x03, 0x01, 0x01, 0xFB, 0x00, 0x03, - 0x03, 0x0A, 0x03, 0x41, 0x00, 0xE5, 0x00, 0x02, 0x03, 0x0A, 0x01, 0xCE, 0x00, 0x02, 0x03, 0x0C, - 0x02, 0x01, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x03, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xAD, 0x00, 0x03, - 0x03, 0x23, 0x03, 0x02, 0x1E, 0xB7, 0x00, 0x03, 0x03, 0x23, 0x03, 0x06, 0x1E, 0xA1, 0x00, 0x02, - 0x03, 0x23, 0x1E, 0x01, 0x00, 0x02, 0x03, 0x25, 0x01, 0x05, 0x00, 0x02, 0x03, 0x28, 0x00, 0xE0, - 0x00, 0x02, 0x03, 0x40, 0x00, 0xE1, 0x00, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, - 0x00, 0x14, 0x1E, 0x03, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x05, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x07, + 0x01, 0x2C, 0x01, 0x34, 0x01, 0x3C, 0x01, 0x42, 0x01, 0x48, 0x01, 0x4E, 0x01, 0x54, 0x00, 0xC0, + 0x00, 0x02, 0x03, 0x00, 0x00, 0xC1, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xA6, 0x00, 0x03, 0x03, 0x02, + 0x03, 0x00, 0x1E, 0xA4, 0x00, 0x03, 0x03, 0x02, 0x03, 0x01, 0x1E, 0xAA, 0x00, 0x03, 0x03, 0x02, + 0x03, 0x03, 0x1E, 0xA8, 0x00, 0x03, 0x03, 0x02, 0x03, 0x09, 0x1E, 0xAC, 0x00, 0x03, 0x03, 0x02, + 0x03, 0x23, 0x1E, 0xA6, 0x00, 0x03, 0x03, 0x02, 0x03, 0x40, 0x1E, 0xA4, 0x00, 0x03, 0x03, 0x02, + 0x03, 0x41, 0x00, 0xC2, 0x00, 0x02, 0x03, 0x02, 0x00, 0xC3, 0x00, 0x02, 0x03, 0x03, 0x01, 0x00, + 0x00, 0x02, 0x03, 0x04, 0x1E, 0xB0, 0x00, 0x03, 0x03, 0x06, 0x03, 0x00, 0x1E, 0xAE, 0x00, 0x03, + 0x03, 0x06, 0x03, 0x01, 0x1E, 0xB4, 0x00, 0x03, 0x03, 0x06, 0x03, 0x03, 0x1E, 0xB2, 0x00, 0x03, + 0x03, 0x06, 0x03, 0x09, 0x1E, 0xB6, 0x00, 0x03, 0x03, 0x06, 0x03, 0x23, 0x1E, 0xB0, 0x00, 0x03, + 0x03, 0x06, 0x03, 0x40, 0x1E, 0xAE, 0x00, 0x03, 0x03, 0x06, 0x03, 0x41, 0x01, 0x02, 0x00, 0x02, + 0x03, 0x06, 0x01, 0xE0, 0x00, 0x03, 0x03, 0x07, 0x03, 0x04, 0x02, 0x26, 0x00, 0x02, 0x03, 0x07, + 0x01, 0xDE, 0x00, 0x03, 0x03, 0x08, 0x03, 0x04, 0x00, 0xC4, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xA2, + 0x00, 0x02, 0x03, 0x09, 0x01, 0xFA, 0x00, 0x03, 0x03, 0x0A, 0x03, 0x01, 0x01, 0xFA, 0x00, 0x03, + 0x03, 0x0A, 0x03, 0x41, 0x00, 0xC5, 0x00, 0x02, 0x03, 0x0A, 0x01, 0xCD, 0x00, 0x02, 0x03, 0x0C, + 0x02, 0x00, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x02, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xAC, 0x00, 0x03, + 0x03, 0x23, 0x03, 0x02, 0x1E, 0xB6, 0x00, 0x03, 0x03, 0x23, 0x03, 0x06, 0x1E, 0xA0, 0x00, 0x02, + 0x03, 0x23, 0x1E, 0x00, 0x00, 0x02, 0x03, 0x25, 0x01, 0x04, 0x00, 0x02, 0x03, 0x28, 0x00, 0xC0, + 0x00, 0x02, 0x03, 0x40, 0x00, 0xC1, 0x00, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, + 0x00, 0x14, 0x1E, 0x02, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x04, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x06, 0x00, 0x02, 0x03, 0x31, 0x00, 0x0A, 0x00, 0x16, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, - 0x00, 0x36, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x54, 0x1E, 0x09, 0x00, 0x03, 0x03, 0x01, - 0x03, 0x27, 0x01, 0x07, 0x00, 0x02, 0x03, 0x01, 0x01, 0x09, 0x00, 0x02, 0x03, 0x02, 0x01, 0x0B, - 0x00, 0x02, 0x03, 0x07, 0x01, 0x0D, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x09, 0x00, 0x03, 0x03, 0x27, - 0x03, 0x01, 0x1E, 0x09, 0x00, 0x03, 0x03, 0x27, 0x03, 0x41, 0x00, 0xE7, 0x00, 0x02, 0x03, 0x27, - 0x1E, 0x09, 0x00, 0x03, 0x03, 0x41, 0x03, 0x27, 0x01, 0x07, 0x00, 0x02, 0x03, 0x41, 0x00, 0x06, - 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x1E, 0x0B, 0x00, 0x02, - 0x03, 0x07, 0x01, 0x0F, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x0D, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x11, - 0x00, 0x02, 0x03, 0x27, 0x1E, 0x13, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x0F, 0x00, 0x02, 0x03, 0x31, + 0x00, 0x36, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x54, 0x1E, 0x08, 0x00, 0x03, 0x03, 0x01, + 0x03, 0x27, 0x01, 0x06, 0x00, 0x02, 0x03, 0x01, 0x01, 0x08, 0x00, 0x02, 0x03, 0x02, 0x01, 0x0A, + 0x00, 0x02, 0x03, 0x07, 0x01, 0x0C, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x08, 0x00, 0x03, 0x03, 0x27, + 0x03, 0x01, 0x1E, 0x08, 0x00, 0x03, 0x03, 0x27, 0x03, 0x41, 0x00, 0xC7, 0x00, 0x02, 0x03, 0x27, + 0x1E, 0x08, 0x00, 0x03, 0x03, 0x41, 0x03, 0x27, 0x01, 0x06, 0x00, 0x02, 0x03, 0x41, 0x00, 0x06, + 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x1E, 0x0A, 0x00, 0x02, + 0x03, 0x07, 0x01, 0x0E, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x0C, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x10, + 0x00, 0x02, 0x03, 0x27, 0x1E, 0x12, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x0E, 0x00, 0x02, 0x03, 0x31, 0x00, 0x21, 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, 0x00, 0x58, 0x00, 0x60, 0x00, 0x68, 0x00, 0x70, 0x00, 0x78, 0x00, 0x80, 0x00, 0x88, 0x00, 0x8E, 0x00, 0x94, 0x00, 0x9C, 0x00, 0xA4, 0x00, 0xAC, 0x00, 0xB4, 0x00, 0xBA, 0x00, 0xC2, 0x00, 0xC8, 0x00, 0xCE, 0x00, 0xD4, 0x00, 0xDA, 0x00, 0xE0, 0x00, 0xE6, 0x00, 0xEC, 0x00, 0xF4, 0x00, 0xFA, 0x01, 0x02, 0x01, 0x08, 0x01, 0x0E, 0x01, 0x14, - 0x01, 0x1A, 0x01, 0x20, 0x00, 0xE8, 0x00, 0x02, 0x03, 0x00, 0x00, 0xE9, 0x00, 0x02, 0x03, 0x01, - 0x1E, 0xC1, 0x00, 0x03, 0x03, 0x02, 0x03, 0x00, 0x1E, 0xBF, 0x00, 0x03, 0x03, 0x02, 0x03, 0x01, - 0x1E, 0xC5, 0x00, 0x03, 0x03, 0x02, 0x03, 0x03, 0x1E, 0xC3, 0x00, 0x03, 0x03, 0x02, 0x03, 0x09, - 0x1E, 0xC7, 0x00, 0x03, 0x03, 0x02, 0x03, 0x23, 0x1E, 0xC1, 0x00, 0x03, 0x03, 0x02, 0x03, 0x40, - 0x1E, 0xBF, 0x00, 0x03, 0x03, 0x02, 0x03, 0x41, 0x00, 0xEA, 0x00, 0x02, 0x03, 0x02, 0x1E, 0xBD, - 0x00, 0x02, 0x03, 0x03, 0x1E, 0x15, 0x00, 0x03, 0x03, 0x04, 0x03, 0x00, 0x1E, 0x17, 0x00, 0x03, - 0x03, 0x04, 0x03, 0x01, 0x1E, 0x15, 0x00, 0x03, 0x03, 0x04, 0x03, 0x40, 0x1E, 0x17, 0x00, 0x03, - 0x03, 0x04, 0x03, 0x41, 0x01, 0x13, 0x00, 0x02, 0x03, 0x04, 0x1E, 0x1D, 0x00, 0x03, 0x03, 0x06, - 0x03, 0x27, 0x01, 0x15, 0x00, 0x02, 0x03, 0x06, 0x01, 0x17, 0x00, 0x02, 0x03, 0x07, 0x00, 0xEB, - 0x00, 0x02, 0x03, 0x08, 0x1E, 0xBB, 0x00, 0x02, 0x03, 0x09, 0x01, 0x1B, 0x00, 0x02, 0x03, 0x0C, - 0x02, 0x05, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x07, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xC7, 0x00, 0x03, - 0x03, 0x23, 0x03, 0x02, 0x1E, 0xB9, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x1D, 0x00, 0x03, 0x03, 0x27, - 0x03, 0x06, 0x02, 0x29, 0x00, 0x02, 0x03, 0x27, 0x01, 0x19, 0x00, 0x02, 0x03, 0x28, 0x1E, 0x19, - 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x1B, 0x00, 0x02, 0x03, 0x30, 0x00, 0xE8, 0x00, 0x02, 0x03, 0x40, - 0x00, 0xE9, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x1F, 0x00, 0x02, 0x03, 0x07, + 0x01, 0x1A, 0x01, 0x20, 0x00, 0xC8, 0x00, 0x02, 0x03, 0x00, 0x00, 0xC9, 0x00, 0x02, 0x03, 0x01, + 0x1E, 0xC0, 0x00, 0x03, 0x03, 0x02, 0x03, 0x00, 0x1E, 0xBE, 0x00, 0x03, 0x03, 0x02, 0x03, 0x01, + 0x1E, 0xC4, 0x00, 0x03, 0x03, 0x02, 0x03, 0x03, 0x1E, 0xC2, 0x00, 0x03, 0x03, 0x02, 0x03, 0x09, + 0x1E, 0xC6, 0x00, 0x03, 0x03, 0x02, 0x03, 0x23, 0x1E, 0xC0, 0x00, 0x03, 0x03, 0x02, 0x03, 0x40, + 0x1E, 0xBE, 0x00, 0x03, 0x03, 0x02, 0x03, 0x41, 0x00, 0xCA, 0x00, 0x02, 0x03, 0x02, 0x1E, 0xBC, + 0x00, 0x02, 0x03, 0x03, 0x1E, 0x14, 0x00, 0x03, 0x03, 0x04, 0x03, 0x00, 0x1E, 0x16, 0x00, 0x03, + 0x03, 0x04, 0x03, 0x01, 0x1E, 0x14, 0x00, 0x03, 0x03, 0x04, 0x03, 0x40, 0x1E, 0x16, 0x00, 0x03, + 0x03, 0x04, 0x03, 0x41, 0x01, 0x12, 0x00, 0x02, 0x03, 0x04, 0x1E, 0x1C, 0x00, 0x03, 0x03, 0x06, + 0x03, 0x27, 0x01, 0x14, 0x00, 0x02, 0x03, 0x06, 0x01, 0x16, 0x00, 0x02, 0x03, 0x07, 0x00, 0xCB, + 0x00, 0x02, 0x03, 0x08, 0x1E, 0xBA, 0x00, 0x02, 0x03, 0x09, 0x01, 0x1A, 0x00, 0x02, 0x03, 0x0C, + 0x02, 0x04, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x06, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xC6, 0x00, 0x03, + 0x03, 0x23, 0x03, 0x02, 0x1E, 0xB8, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x1C, 0x00, 0x03, 0x03, 0x27, + 0x03, 0x06, 0x02, 0x28, 0x00, 0x02, 0x03, 0x27, 0x01, 0x18, 0x00, 0x02, 0x03, 0x28, 0x1E, 0x18, + 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x1A, 0x00, 0x02, 0x03, 0x30, 0x00, 0xC8, 0x00, 0x02, 0x03, 0x40, + 0x00, 0xC9, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x1E, 0x00, 0x02, 0x03, 0x07, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, - 0x00, 0x3C, 0x01, 0xF5, 0x00, 0x02, 0x03, 0x01, 0x01, 0x1D, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x21, - 0x00, 0x02, 0x03, 0x04, 0x01, 0x1F, 0x00, 0x02, 0x03, 0x06, 0x01, 0x21, 0x00, 0x02, 0x03, 0x07, - 0x01, 0xE7, 0x00, 0x02, 0x03, 0x0C, 0x01, 0x23, 0x00, 0x02, 0x03, 0x27, 0x01, 0xF5, 0x00, 0x02, - 0x03, 0x41, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, - 0x00, 0x36, 0x00, 0x3C, 0x01, 0x25, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x23, 0x00, 0x02, 0x03, 0x07, - 0x1E, 0x27, 0x00, 0x02, 0x03, 0x08, 0x02, 0x1F, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x25, 0x00, 0x02, - 0x03, 0x23, 0x1E, 0x29, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x2B, 0x00, 0x02, 0x03, 0x2E, 0x1E, 0x96, - 0x00, 0x02, 0x03, 0x31, 0x00, 0x13, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x00, 0x3A, 0x00, 0x40, - 0x00, 0x46, 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5C, 0x00, 0x62, 0x00, 0x68, 0x00, 0x6E, 0x00, 0x74, - 0x00, 0x7A, 0x00, 0x80, 0x00, 0x86, 0x00, 0x8C, 0x00, 0x92, 0x00, 0x98, 0x00, 0xEC, 0x00, 0x02, - 0x03, 0x00, 0x00, 0xED, 0x00, 0x02, 0x03, 0x01, 0x00, 0xEE, 0x00, 0x02, 0x03, 0x02, 0x01, 0x29, - 0x00, 0x02, 0x03, 0x03, 0x01, 0x2B, 0x00, 0x02, 0x03, 0x04, 0x01, 0x2D, 0x00, 0x02, 0x03, 0x06, - 0x1E, 0x2F, 0x00, 0x03, 0x03, 0x08, 0x03, 0x01, 0x1E, 0x2F, 0x00, 0x03, 0x03, 0x08, 0x03, 0x41, - 0x00, 0xEF, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xC9, 0x00, 0x02, 0x03, 0x09, 0x01, 0xD0, 0x00, 0x02, - 0x03, 0x0C, 0x02, 0x09, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x0B, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xCB, - 0x00, 0x02, 0x03, 0x23, 0x01, 0x2F, 0x00, 0x02, 0x03, 0x28, 0x1E, 0x2D, 0x00, 0x02, 0x03, 0x30, - 0x00, 0xEC, 0x00, 0x02, 0x03, 0x40, 0x00, 0xED, 0x00, 0x02, 0x03, 0x41, 0x1E, 0x2F, 0x00, 0x02, - 0x03, 0x44, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x01, 0x35, 0x00, 0x02, 0x03, 0x02, 0x01, 0xF0, - 0x00, 0x02, 0x03, 0x0C, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, - 0x00, 0x2C, 0x1E, 0x31, 0x00, 0x02, 0x03, 0x01, 0x01, 0xE9, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x33, - 0x00, 0x02, 0x03, 0x23, 0x01, 0x37, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x35, 0x00, 0x02, 0x03, 0x31, - 0x1E, 0x31, 0x00, 0x02, 0x03, 0x41, 0x00, 0x09, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x22, 0x00, 0x28, - 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0x01, 0x3A, 0x00, 0x02, 0x03, 0x01, - 0x1E, 0x39, 0x00, 0x03, 0x03, 0x04, 0x03, 0x23, 0x01, 0x3E, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x39, - 0x00, 0x03, 0x03, 0x23, 0x03, 0x04, 0x1E, 0x37, 0x00, 0x02, 0x03, 0x23, 0x01, 0x3C, 0x00, 0x02, - 0x03, 0x27, 0x1E, 0x3D, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x3B, 0x00, 0x02, 0x03, 0x31, 0x01, 0x3A, - 0x00, 0x02, 0x03, 0x41, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x1E, 0x3F, - 0x00, 0x02, 0x03, 0x01, 0x1E, 0x41, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x43, 0x00, 0x02, 0x03, 0x23, - 0x1E, 0x3F, 0x00, 0x02, 0x03, 0x41, 0x00, 0x0B, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, - 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0x00, 0x4E, 0x00, 0x54, 0x01, 0xF9, - 0x00, 0x02, 0x03, 0x00, 0x01, 0x44, 0x00, 0x02, 0x03, 0x01, 0x00, 0xF1, 0x00, 0x02, 0x03, 0x03, - 0x1E, 0x45, 0x00, 0x02, 0x03, 0x07, 0x01, 0x48, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x47, 0x00, 0x02, - 0x03, 0x23, 0x01, 0x46, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x4B, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x49, - 0x00, 0x02, 0x03, 0x31, 0x01, 0xF9, 0x00, 0x02, 0x03, 0x40, 0x01, 0x44, 0x00, 0x02, 0x03, 0x41, - 0x00, 0x34, 0x00, 0x6A, 0x00, 0x72, 0x00, 0x78, 0x00, 0x80, 0x00, 0x86, 0x00, 0x8E, 0x00, 0x96, - 0x00, 0x9E, 0x00, 0xA6, 0x00, 0xAE, 0x00, 0xB6, 0x00, 0xBE, 0x00, 0xC4, 0x00, 0xCC, 0x00, 0xD4, - 0x00, 0xDC, 0x00, 0xE4, 0x00, 0xEC, 0x00, 0xF2, 0x00, 0xFA, 0x01, 0x02, 0x01, 0x0A, 0x01, 0x12, - 0x01, 0x1A, 0x01, 0x20, 0x01, 0x26, 0x01, 0x2E, 0x01, 0x34, 0x01, 0x3C, 0x01, 0x42, 0x01, 0x4A, - 0x01, 0x50, 0x01, 0x56, 0x01, 0x5C, 0x01, 0x62, 0x01, 0x68, 0x01, 0x70, 0x01, 0x78, 0x01, 0x80, - 0x01, 0x88, 0x01, 0x90, 0x01, 0x98, 0x01, 0xA0, 0x01, 0xA6, 0x01, 0xAE, 0x01, 0xB6, 0x01, 0xBC, - 0x01, 0xC4, 0x01, 0xCA, 0x01, 0xD2, 0x01, 0xD8, 0x01, 0xE0, 0x1E, 0xDD, 0x00, 0x03, 0x03, 0x00, - 0x03, 0x1B, 0x00, 0xF2, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xDB, 0x00, 0x03, 0x03, 0x01, 0x03, 0x1B, - 0x00, 0xF3, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xD3, 0x00, 0x03, 0x03, 0x02, 0x03, 0x00, 0x1E, 0xD1, - 0x00, 0x03, 0x03, 0x02, 0x03, 0x01, 0x1E, 0xD7, 0x00, 0x03, 0x03, 0x02, 0x03, 0x03, 0x1E, 0xD5, - 0x00, 0x03, 0x03, 0x02, 0x03, 0x09, 0x1E, 0xD9, 0x00, 0x03, 0x03, 0x02, 0x03, 0x23, 0x1E, 0xD3, - 0x00, 0x03, 0x03, 0x02, 0x03, 0x40, 0x1E, 0xD1, 0x00, 0x03, 0x03, 0x02, 0x03, 0x41, 0x00, 0xF4, - 0x00, 0x02, 0x03, 0x02, 0x1E, 0x4D, 0x00, 0x03, 0x03, 0x03, 0x03, 0x01, 0x02, 0x2D, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x04, 0x1E, 0x4F, 0x00, 0x03, 0x03, 0x03, 0x03, 0x08, 0x1E, 0xE1, 0x00, 0x03, - 0x03, 0x03, 0x03, 0x1B, 0x1E, 0x4D, 0x00, 0x03, 0x03, 0x03, 0x03, 0x41, 0x00, 0xF5, 0x00, 0x02, - 0x03, 0x03, 0x1E, 0x51, 0x00, 0x03, 0x03, 0x04, 0x03, 0x00, 0x1E, 0x53, 0x00, 0x03, 0x03, 0x04, - 0x03, 0x01, 0x01, 0xED, 0x00, 0x03, 0x03, 0x04, 0x03, 0x28, 0x1E, 0x51, 0x00, 0x03, 0x03, 0x04, - 0x03, 0x40, 0x1E, 0x53, 0x00, 0x03, 0x03, 0x04, 0x03, 0x41, 0x01, 0x4D, 0x00, 0x02, 0x03, 0x04, - 0x01, 0x4F, 0x00, 0x02, 0x03, 0x06, 0x02, 0x31, 0x00, 0x03, 0x03, 0x07, 0x03, 0x04, 0x02, 0x2F, - 0x00, 0x02, 0x03, 0x07, 0x02, 0x2B, 0x00, 0x03, 0x03, 0x08, 0x03, 0x04, 0x00, 0xF6, 0x00, 0x02, - 0x03, 0x08, 0x1E, 0xDF, 0x00, 0x03, 0x03, 0x09, 0x03, 0x1B, 0x1E, 0xCF, 0x00, 0x02, 0x03, 0x09, - 0x01, 0x51, 0x00, 0x02, 0x03, 0x0B, 0x01, 0xD2, 0x00, 0x02, 0x03, 0x0C, 0x02, 0x0D, 0x00, 0x02, - 0x03, 0x0F, 0x02, 0x0F, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xDD, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x00, - 0x1E, 0xDB, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x01, 0x1E, 0xE1, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x03, - 0x1E, 0xDF, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x09, 0x1E, 0xE3, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x23, - 0x1E, 0xDD, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x40, 0x1E, 0xDB, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x41, - 0x01, 0xA1, 0x00, 0x02, 0x03, 0x1B, 0x1E, 0xD9, 0x00, 0x03, 0x03, 0x23, 0x03, 0x02, 0x1E, 0xE3, - 0x00, 0x03, 0x03, 0x23, 0x03, 0x1B, 0x1E, 0xCD, 0x00, 0x02, 0x03, 0x23, 0x01, 0xED, 0x00, 0x03, - 0x03, 0x28, 0x03, 0x04, 0x01, 0xEB, 0x00, 0x02, 0x03, 0x28, 0x1E, 0xDD, 0x00, 0x03, 0x03, 0x40, - 0x03, 0x1B, 0x00, 0xF2, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xDB, 0x00, 0x03, 0x03, 0x41, 0x03, 0x1B, - 0x00, 0xF3, 0x00, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, 0x1E, 0x55, - 0x00, 0x02, 0x03, 0x01, 0x1E, 0x57, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x55, 0x00, 0x02, 0x03, 0x41, - 0x00, 0x0B, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, - 0x00, 0x46, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, 0x01, 0x55, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x5D, - 0x00, 0x03, 0x03, 0x04, 0x03, 0x23, 0x1E, 0x59, 0x00, 0x02, 0x03, 0x07, 0x01, 0x59, 0x00, 0x02, - 0x03, 0x0C, 0x02, 0x11, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x13, 0x00, 0x02, 0x03, 0x11, 0x1E, 0x5D, - 0x00, 0x03, 0x03, 0x23, 0x03, 0x04, 0x1E, 0x5B, 0x00, 0x02, 0x03, 0x23, 0x01, 0x57, 0x00, 0x02, - 0x03, 0x27, 0x1E, 0x5F, 0x00, 0x02, 0x03, 0x31, 0x01, 0x55, 0x00, 0x02, 0x03, 0x41, 0x00, 0x0D, - 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4C, - 0x00, 0x54, 0x00, 0x5A, 0x00, 0x60, 0x00, 0x66, 0x00, 0x6E, 0x1E, 0x65, 0x00, 0x03, 0x03, 0x01, - 0x03, 0x07, 0x01, 0x5B, 0x00, 0x02, 0x03, 0x01, 0x01, 0x5D, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x69, - 0x00, 0x03, 0x03, 0x07, 0x03, 0x23, 0x1E, 0x61, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x67, 0x00, 0x03, - 0x03, 0x0C, 0x03, 0x07, 0x01, 0x61, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x69, 0x00, 0x03, 0x03, 0x23, - 0x03, 0x07, 0x1E, 0x63, 0x00, 0x02, 0x03, 0x23, 0x02, 0x19, 0x00, 0x02, 0x03, 0x26, 0x01, 0x5F, - 0x00, 0x02, 0x03, 0x27, 0x1E, 0x65, 0x00, 0x03, 0x03, 0x41, 0x03, 0x07, 0x01, 0x5B, 0x00, 0x02, - 0x03, 0x41, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, - 0x00, 0x36, 0x00, 0x3C, 0x1E, 0x6B, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x97, 0x00, 0x02, 0x03, 0x08, - 0x01, 0x65, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x6D, 0x00, 0x02, 0x03, 0x23, 0x02, 0x1B, 0x00, 0x02, - 0x03, 0x26, 0x01, 0x63, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x71, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x6F, + 0x00, 0x3C, 0x01, 0xF4, 0x00, 0x02, 0x03, 0x01, 0x01, 0x1C, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x20, + 0x00, 0x02, 0x03, 0x04, 0x01, 0x1E, 0x00, 0x02, 0x03, 0x06, 0x01, 0x20, 0x00, 0x02, 0x03, 0x07, + 0x01, 0xE6, 0x00, 0x02, 0x03, 0x0C, 0x01, 0x22, 0x00, 0x02, 0x03, 0x27, 0x01, 0xF4, 0x00, 0x02, + 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, + 0x00, 0x34, 0x01, 0x24, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x22, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x26, + 0x00, 0x02, 0x03, 0x08, 0x02, 0x1E, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x24, 0x00, 0x02, 0x03, 0x23, + 0x1E, 0x28, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x2A, 0x00, 0x02, 0x03, 0x2E, 0x00, 0x14, 0x00, 0x2A, + 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0x00, 0x4E, 0x00, 0x54, 0x00, 0x5C, + 0x00, 0x64, 0x00, 0x6A, 0x00, 0x70, 0x00, 0x76, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x88, 0x00, 0x8E, + 0x00, 0x94, 0x00, 0x9A, 0x00, 0xA0, 0x00, 0xCC, 0x00, 0x02, 0x03, 0x00, 0x00, 0xCD, 0x00, 0x02, + 0x03, 0x01, 0x00, 0xCE, 0x00, 0x02, 0x03, 0x02, 0x01, 0x28, 0x00, 0x02, 0x03, 0x03, 0x01, 0x2A, + 0x00, 0x02, 0x03, 0x04, 0x01, 0x2C, 0x00, 0x02, 0x03, 0x06, 0x01, 0x30, 0x00, 0x02, 0x03, 0x07, + 0x1E, 0x2E, 0x00, 0x03, 0x03, 0x08, 0x03, 0x01, 0x1E, 0x2E, 0x00, 0x03, 0x03, 0x08, 0x03, 0x41, + 0x00, 0xCF, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xC8, 0x00, 0x02, 0x03, 0x09, 0x01, 0xCF, 0x00, 0x02, + 0x03, 0x0C, 0x02, 0x08, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x0A, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xCA, + 0x00, 0x02, 0x03, 0x23, 0x01, 0x2E, 0x00, 0x02, 0x03, 0x28, 0x1E, 0x2C, 0x00, 0x02, 0x03, 0x30, + 0x00, 0xCC, 0x00, 0x02, 0x03, 0x40, 0x00, 0xCD, 0x00, 0x02, 0x03, 0x41, 0x1E, 0x2E, 0x00, 0x02, + 0x03, 0x44, 0x00, 0x01, 0x00, 0x04, 0x01, 0x34, 0x00, 0x02, 0x03, 0x02, 0x00, 0x06, 0x00, 0x0E, + 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x1E, 0x30, 0x00, 0x02, 0x03, 0x01, + 0x01, 0xE8, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x32, 0x00, 0x02, 0x03, 0x23, 0x01, 0x36, 0x00, 0x02, + 0x03, 0x27, 0x1E, 0x34, 0x00, 0x02, 0x03, 0x31, 0x1E, 0x30, 0x00, 0x02, 0x03, 0x41, 0x00, 0x09, + 0x00, 0x14, 0x00, 0x1A, 0x00, 0x22, 0x00, 0x28, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, + 0x00, 0x48, 0x01, 0x39, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x38, 0x00, 0x03, 0x03, 0x04, 0x03, 0x23, + 0x01, 0x3D, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x38, 0x00, 0x03, 0x03, 0x23, 0x03, 0x04, 0x1E, 0x36, + 0x00, 0x02, 0x03, 0x23, 0x01, 0x3B, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x3C, 0x00, 0x02, 0x03, 0x2D, + 0x1E, 0x3A, 0x00, 0x02, 0x03, 0x31, 0x01, 0x39, 0x00, 0x02, 0x03, 0x41, 0x00, 0x04, 0x00, 0x0A, + 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x1E, 0x3E, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x40, 0x00, 0x02, + 0x03, 0x07, 0x1E, 0x42, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x3E, 0x00, 0x02, 0x03, 0x41, 0x00, 0x0B, + 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, + 0x00, 0x48, 0x00, 0x4E, 0x00, 0x54, 0x01, 0xF8, 0x00, 0x02, 0x03, 0x00, 0x01, 0x43, 0x00, 0x02, + 0x03, 0x01, 0x00, 0xD1, 0x00, 0x02, 0x03, 0x03, 0x1E, 0x44, 0x00, 0x02, 0x03, 0x07, 0x01, 0x47, + 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x46, 0x00, 0x02, 0x03, 0x23, 0x01, 0x45, 0x00, 0x02, 0x03, 0x27, + 0x1E, 0x4A, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x48, 0x00, 0x02, 0x03, 0x31, 0x01, 0xF8, 0x00, 0x02, + 0x03, 0x40, 0x01, 0x43, 0x00, 0x02, 0x03, 0x41, 0x00, 0x34, 0x00, 0x6A, 0x00, 0x72, 0x00, 0x78, + 0x00, 0x80, 0x00, 0x86, 0x00, 0x8E, 0x00, 0x96, 0x00, 0x9E, 0x00, 0xA6, 0x00, 0xAE, 0x00, 0xB6, + 0x00, 0xBE, 0x00, 0xC4, 0x00, 0xCC, 0x00, 0xD4, 0x00, 0xDC, 0x00, 0xE4, 0x00, 0xEC, 0x00, 0xF2, + 0x00, 0xFA, 0x01, 0x02, 0x01, 0x0A, 0x01, 0x12, 0x01, 0x1A, 0x01, 0x20, 0x01, 0x26, 0x01, 0x2E, + 0x01, 0x34, 0x01, 0x3C, 0x01, 0x42, 0x01, 0x4A, 0x01, 0x50, 0x01, 0x56, 0x01, 0x5C, 0x01, 0x62, + 0x01, 0x68, 0x01, 0x70, 0x01, 0x78, 0x01, 0x80, 0x01, 0x88, 0x01, 0x90, 0x01, 0x98, 0x01, 0xA0, + 0x01, 0xA6, 0x01, 0xAE, 0x01, 0xB6, 0x01, 0xBC, 0x01, 0xC4, 0x01, 0xCA, 0x01, 0xD2, 0x01, 0xD8, + 0x01, 0xE0, 0x1E, 0xDC, 0x00, 0x03, 0x03, 0x00, 0x03, 0x1B, 0x00, 0xD2, 0x00, 0x02, 0x03, 0x00, + 0x1E, 0xDA, 0x00, 0x03, 0x03, 0x01, 0x03, 0x1B, 0x00, 0xD3, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xD2, + 0x00, 0x03, 0x03, 0x02, 0x03, 0x00, 0x1E, 0xD0, 0x00, 0x03, 0x03, 0x02, 0x03, 0x01, 0x1E, 0xD6, + 0x00, 0x03, 0x03, 0x02, 0x03, 0x03, 0x1E, 0xD4, 0x00, 0x03, 0x03, 0x02, 0x03, 0x09, 0x1E, 0xD8, + 0x00, 0x03, 0x03, 0x02, 0x03, 0x23, 0x1E, 0xD2, 0x00, 0x03, 0x03, 0x02, 0x03, 0x40, 0x1E, 0xD0, + 0x00, 0x03, 0x03, 0x02, 0x03, 0x41, 0x00, 0xD4, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x4C, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x01, 0x02, 0x2C, 0x00, 0x03, 0x03, 0x03, 0x03, 0x04, 0x1E, 0x4E, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x08, 0x1E, 0xE0, 0x00, 0x03, 0x03, 0x03, 0x03, 0x1B, 0x1E, 0x4C, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x41, 0x00, 0xD5, 0x00, 0x02, 0x03, 0x03, 0x1E, 0x50, 0x00, 0x03, 0x03, 0x04, + 0x03, 0x00, 0x1E, 0x52, 0x00, 0x03, 0x03, 0x04, 0x03, 0x01, 0x01, 0xEC, 0x00, 0x03, 0x03, 0x04, + 0x03, 0x28, 0x1E, 0x50, 0x00, 0x03, 0x03, 0x04, 0x03, 0x40, 0x1E, 0x52, 0x00, 0x03, 0x03, 0x04, + 0x03, 0x41, 0x01, 0x4C, 0x00, 0x02, 0x03, 0x04, 0x01, 0x4E, 0x00, 0x02, 0x03, 0x06, 0x02, 0x30, + 0x00, 0x03, 0x03, 0x07, 0x03, 0x04, 0x02, 0x2E, 0x00, 0x02, 0x03, 0x07, 0x02, 0x2A, 0x00, 0x03, + 0x03, 0x08, 0x03, 0x04, 0x00, 0xD6, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xDE, 0x00, 0x03, 0x03, 0x09, + 0x03, 0x1B, 0x1E, 0xCE, 0x00, 0x02, 0x03, 0x09, 0x01, 0x50, 0x00, 0x02, 0x03, 0x0B, 0x01, 0xD1, + 0x00, 0x02, 0x03, 0x0C, 0x02, 0x0C, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x0E, 0x00, 0x02, 0x03, 0x11, + 0x1E, 0xDC, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x00, 0x1E, 0xDA, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x01, + 0x1E, 0xE0, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x03, 0x1E, 0xDE, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x09, + 0x1E, 0xE2, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x23, 0x1E, 0xDC, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x40, + 0x1E, 0xDA, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x41, 0x01, 0xA0, 0x00, 0x02, 0x03, 0x1B, 0x1E, 0xD8, + 0x00, 0x03, 0x03, 0x23, 0x03, 0x02, 0x1E, 0xE2, 0x00, 0x03, 0x03, 0x23, 0x03, 0x1B, 0x1E, 0xCC, + 0x00, 0x02, 0x03, 0x23, 0x01, 0xEC, 0x00, 0x03, 0x03, 0x28, 0x03, 0x04, 0x01, 0xEA, 0x00, 0x02, + 0x03, 0x28, 0x1E, 0xDC, 0x00, 0x03, 0x03, 0x40, 0x03, 0x1B, 0x00, 0xD2, 0x00, 0x02, 0x03, 0x40, + 0x1E, 0xDA, 0x00, 0x03, 0x03, 0x41, 0x03, 0x1B, 0x00, 0xD3, 0x00, 0x02, 0x03, 0x41, 0x00, 0x03, + 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, 0x1E, 0x54, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x56, 0x00, 0x02, + 0x03, 0x07, 0x1E, 0x54, 0x00, 0x02, 0x03, 0x41, 0x00, 0x0B, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x26, + 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, + 0x01, 0x54, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x5C, 0x00, 0x03, 0x03, 0x04, 0x03, 0x23, 0x1E, 0x58, + 0x00, 0x02, 0x03, 0x07, 0x01, 0x58, 0x00, 0x02, 0x03, 0x0C, 0x02, 0x10, 0x00, 0x02, 0x03, 0x0F, + 0x02, 0x12, 0x00, 0x02, 0x03, 0x11, 0x1E, 0x5C, 0x00, 0x03, 0x03, 0x23, 0x03, 0x04, 0x1E, 0x5A, + 0x00, 0x02, 0x03, 0x23, 0x01, 0x56, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x5E, 0x00, 0x02, 0x03, 0x31, + 0x01, 0x54, 0x00, 0x02, 0x03, 0x41, 0x00, 0x0D, 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, + 0x00, 0x38, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5A, 0x00, 0x60, 0x00, 0x66, + 0x00, 0x6E, 0x1E, 0x64, 0x00, 0x03, 0x03, 0x01, 0x03, 0x07, 0x01, 0x5A, 0x00, 0x02, 0x03, 0x01, + 0x01, 0x5C, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x68, 0x00, 0x03, 0x03, 0x07, 0x03, 0x23, 0x1E, 0x60, + 0x00, 0x02, 0x03, 0x07, 0x1E, 0x66, 0x00, 0x03, 0x03, 0x0C, 0x03, 0x07, 0x01, 0x60, 0x00, 0x02, + 0x03, 0x0C, 0x1E, 0x68, 0x00, 0x03, 0x03, 0x23, 0x03, 0x07, 0x1E, 0x62, 0x00, 0x02, 0x03, 0x23, + 0x02, 0x18, 0x00, 0x02, 0x03, 0x26, 0x01, 0x5E, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x64, 0x00, 0x03, + 0x03, 0x41, 0x03, 0x07, 0x01, 0x5A, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, + 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0x6A, 0x00, 0x02, 0x03, 0x07, + 0x01, 0x64, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x6C, 0x00, 0x02, 0x03, 0x23, 0x02, 0x1A, 0x00, 0x02, + 0x03, 0x26, 0x01, 0x62, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x70, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x6E, 0x00, 0x02, 0x03, 0x31, 0x00, 0x2D, 0x00, 0x5C, 0x00, 0x64, 0x00, 0x6A, 0x00, 0x72, 0x00, 0x78, 0x00, 0x7E, 0x00, 0x86, 0x00, 0x8E, 0x00, 0x96, 0x00, 0x9C, 0x00, 0xA4, 0x00, 0xAA, 0x00, 0xB0, 0x00, 0xB8, 0x00, 0xC0, 0x00, 0xC8, 0x00, 0xD0, 0x00, 0xD8, 0x00, 0xE0, 0x00, 0xE6, 0x00, 0xEE, 0x00, 0xF4, 0x00, 0xFA, 0x01, 0x00, 0x01, 0x06, 0x01, 0x0C, 0x01, 0x12, 0x01, 0x1A, 0x01, 0x22, 0x01, 0x2A, 0x01, 0x32, 0x01, 0x3A, 0x01, 0x42, 0x01, 0x4A, 0x01, 0x50, 0x01, 0x58, 0x01, 0x5E, 0x01, 0x64, 0x01, 0x6A, 0x01, 0x70, 0x01, 0x76, 0x01, 0x7E, 0x01, 0x84, 0x01, 0x8C, 0x01, 0x92, - 0x1E, 0xEB, 0x00, 0x03, 0x03, 0x00, 0x03, 0x1B, 0x00, 0xF9, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xE9, - 0x00, 0x03, 0x03, 0x01, 0x03, 0x1B, 0x00, 0xFA, 0x00, 0x02, 0x03, 0x01, 0x00, 0xFB, 0x00, 0x02, - 0x03, 0x02, 0x1E, 0x79, 0x00, 0x03, 0x03, 0x03, 0x03, 0x01, 0x1E, 0xEF, 0x00, 0x03, 0x03, 0x03, - 0x03, 0x1B, 0x1E, 0x79, 0x00, 0x03, 0x03, 0x03, 0x03, 0x41, 0x01, 0x69, 0x00, 0x02, 0x03, 0x03, - 0x1E, 0x7B, 0x00, 0x03, 0x03, 0x04, 0x03, 0x08, 0x01, 0x6B, 0x00, 0x02, 0x03, 0x04, 0x01, 0x6D, - 0x00, 0x02, 0x03, 0x06, 0x01, 0xDC, 0x00, 0x03, 0x03, 0x08, 0x03, 0x00, 0x01, 0xD8, 0x00, 0x03, - 0x03, 0x08, 0x03, 0x01, 0x01, 0xD6, 0x00, 0x03, 0x03, 0x08, 0x03, 0x04, 0x01, 0xDA, 0x00, 0x03, - 0x03, 0x08, 0x03, 0x0C, 0x01, 0xDC, 0x00, 0x03, 0x03, 0x08, 0x03, 0x40, 0x01, 0xD8, 0x00, 0x03, - 0x03, 0x08, 0x03, 0x41, 0x00, 0xFC, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xED, 0x00, 0x03, 0x03, 0x09, - 0x03, 0x1B, 0x1E, 0xE7, 0x00, 0x02, 0x03, 0x09, 0x01, 0x6F, 0x00, 0x02, 0x03, 0x0A, 0x01, 0x71, - 0x00, 0x02, 0x03, 0x0B, 0x01, 0xD4, 0x00, 0x02, 0x03, 0x0C, 0x02, 0x15, 0x00, 0x02, 0x03, 0x0F, - 0x02, 0x17, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xEB, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x00, 0x1E, 0xE9, - 0x00, 0x03, 0x03, 0x1B, 0x03, 0x01, 0x1E, 0xEF, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x03, 0x1E, 0xED, - 0x00, 0x03, 0x03, 0x1B, 0x03, 0x09, 0x1E, 0xF1, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x23, 0x1E, 0xEB, - 0x00, 0x03, 0x03, 0x1B, 0x03, 0x40, 0x1E, 0xE9, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x41, 0x01, 0xB0, - 0x00, 0x02, 0x03, 0x1B, 0x1E, 0xF1, 0x00, 0x03, 0x03, 0x23, 0x03, 0x1B, 0x1E, 0xE5, 0x00, 0x02, - 0x03, 0x23, 0x1E, 0x73, 0x00, 0x02, 0x03, 0x24, 0x01, 0x73, 0x00, 0x02, 0x03, 0x28, 0x1E, 0x77, - 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x75, 0x00, 0x02, 0x03, 0x30, 0x1E, 0xEB, 0x00, 0x03, 0x03, 0x40, - 0x03, 0x1B, 0x00, 0xF9, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xE9, 0x00, 0x03, 0x03, 0x41, 0x03, 0x1B, - 0x00, 0xFA, 0x00, 0x02, 0x03, 0x41, 0x01, 0xD8, 0x00, 0x02, 0x03, 0x44, 0x00, 0x02, 0x00, 0x06, - 0x00, 0x0C, 0x1E, 0x7D, 0x00, 0x02, 0x03, 0x03, 0x1E, 0x7F, 0x00, 0x02, 0x03, 0x23, 0x00, 0x09, - 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, - 0x00, 0x44, 0x1E, 0x81, 0x00, 0x02, 0x03, 0x00, 0x1E, 0x83, 0x00, 0x02, 0x03, 0x01, 0x01, 0x75, - 0x00, 0x02, 0x03, 0x02, 0x1E, 0x87, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x85, 0x00, 0x02, 0x03, 0x08, - 0x1E, 0x98, 0x00, 0x02, 0x03, 0x0A, 0x1E, 0x89, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x81, 0x00, 0x02, - 0x03, 0x40, 0x1E, 0x83, 0x00, 0x02, 0x03, 0x41, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0x8B, - 0x00, 0x02, 0x03, 0x07, 0x1E, 0x8D, 0x00, 0x02, 0x03, 0x08, 0x00, 0x0C, 0x00, 0x1A, 0x00, 0x20, - 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, - 0x00, 0x56, 0x00, 0x5C, 0x1E, 0xF3, 0x00, 0x02, 0x03, 0x00, 0x00, 0xFD, 0x00, 0x02, 0x03, 0x01, - 0x01, 0x77, 0x00, 0x02, 0x03, 0x02, 0x1E, 0xF9, 0x00, 0x02, 0x03, 0x03, 0x02, 0x33, 0x00, 0x02, - 0x03, 0x04, 0x1E, 0x8F, 0x00, 0x02, 0x03, 0x07, 0x00, 0xFF, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xF7, - 0x00, 0x02, 0x03, 0x09, 0x1E, 0x99, 0x00, 0x02, 0x03, 0x0A, 0x1E, 0xF5, 0x00, 0x02, 0x03, 0x23, - 0x1E, 0xF3, 0x00, 0x02, 0x03, 0x40, 0x00, 0xFD, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, - 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x01, 0x7A, 0x00, 0x02, - 0x03, 0x01, 0x1E, 0x91, 0x00, 0x02, 0x03, 0x02, 0x01, 0x7C, 0x00, 0x02, 0x03, 0x07, 0x01, 0x7E, - 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x93, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x95, 0x00, 0x02, 0x03, 0x31, - 0x01, 0x7A, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, - 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xA6, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xA4, 0x00, 0x02, - 0x03, 0x01, 0x1E, 0xAA, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xA8, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xAC, - 0x00, 0x02, 0x03, 0x23, 0x1E, 0xA6, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xA4, 0x00, 0x02, 0x03, 0x41, - 0x00, 0x01, 0x00, 0x04, 0x01, 0xDE, 0x00, 0x02, 0x03, 0x04, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, - 0x01, 0xFA, 0x00, 0x02, 0x03, 0x01, 0x01, 0xFA, 0x00, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x08, - 0x00, 0x0E, 0x00, 0x14, 0x01, 0xFC, 0x00, 0x02, 0x03, 0x01, 0x01, 0xE2, 0x00, 0x02, 0x03, 0x04, - 0x01, 0xFC, 0x00, 0x02, 0x03, 0x41, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0x08, 0x00, 0x02, - 0x03, 0x01, 0x1E, 0x08, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, - 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xC0, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xBE, - 0x00, 0x02, 0x03, 0x01, 0x1E, 0xC4, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xC2, 0x00, 0x02, 0x03, 0x09, - 0x1E, 0xC6, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xC0, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xBE, 0x00, 0x02, - 0x03, 0x41, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0x2E, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x2E, - 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xDC, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, - 0x00, 0x04, 0x1E, 0xDA, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, - 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xD2, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xD0, - 0x00, 0x02, 0x03, 0x01, 0x1E, 0xD6, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xD4, 0x00, 0x02, 0x03, 0x09, - 0x1E, 0xD8, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xD2, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xD0, 0x00, 0x02, - 0x03, 0x41, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x1E, 0x4C, - 0x00, 0x02, 0x03, 0x01, 0x02, 0x2C, 0x00, 0x02, 0x03, 0x04, 0x1E, 0x4E, 0x00, 0x02, 0x03, 0x08, - 0x1E, 0xE0, 0x00, 0x02, 0x03, 0x1B, 0x1E, 0x4C, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, - 0x02, 0x2A, 0x00, 0x02, 0x03, 0x04, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x01, 0xFE, 0x00, 0x02, - 0x03, 0x01, 0x01, 0xFE, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xEA, 0x00, 0x02, - 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xE8, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x06, 0x00, 0x0E, - 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x01, 0xDB, 0x00, 0x02, 0x03, 0x00, - 0x01, 0xD7, 0x00, 0x02, 0x03, 0x01, 0x01, 0xD5, 0x00, 0x02, 0x03, 0x04, 0x01, 0xD9, 0x00, 0x02, - 0x03, 0x0C, 0x01, 0xDB, 0x00, 0x02, 0x03, 0x40, 0x01, 0xD7, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, - 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xA7, - 0x00, 0x02, 0x03, 0x00, 0x1E, 0xA5, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xAB, 0x00, 0x02, 0x03, 0x03, - 0x1E, 0xA9, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xAD, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xA7, 0x00, 0x02, - 0x03, 0x40, 0x1E, 0xA5, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x01, 0xDF, 0x00, 0x02, - 0x03, 0x04, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x01, 0xFB, 0x00, 0x02, 0x03, 0x01, 0x01, 0xFB, - 0x00, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, 0x01, 0xFD, 0x00, 0x02, - 0x03, 0x01, 0x01, 0xE3, 0x00, 0x02, 0x03, 0x04, 0x01, 0xFD, 0x00, 0x02, 0x03, 0x41, 0x00, 0x02, - 0x00, 0x06, 0x00, 0x0C, 0x1E, 0x09, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x09, 0x00, 0x02, 0x03, 0x41, - 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, - 0x1E, 0xC1, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xBF, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xC5, 0x00, 0x02, - 0x03, 0x03, 0x1E, 0xC3, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xC7, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xC1, - 0x00, 0x02, 0x03, 0x40, 0x1E, 0xBF, 0x00, 0x02, 0x03, 0x41, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, - 0x1E, 0x2F, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x2F, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, - 0x1E, 0xDD, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xDB, 0x00, 0x02, 0x03, 0x1B, - 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, - 0x1E, 0xD3, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xD1, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xD7, 0x00, 0x02, - 0x03, 0x03, 0x1E, 0xD5, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xD9, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xD3, - 0x00, 0x02, 0x03, 0x40, 0x1E, 0xD1, 0x00, 0x02, 0x03, 0x41, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x12, - 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x1E, 0x4D, 0x00, 0x02, 0x03, 0x01, 0x02, 0x2D, 0x00, 0x02, - 0x03, 0x04, 0x1E, 0x4F, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xE1, 0x00, 0x02, 0x03, 0x1B, 0x1E, 0x4D, - 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x02, 0x2B, 0x00, 0x02, 0x03, 0x04, 0x00, 0x02, - 0x00, 0x06, 0x00, 0x0C, 0x01, 0xFF, 0x00, 0x02, 0x03, 0x01, 0x01, 0xFF, 0x00, 0x02, 0x03, 0x41, - 0x00, 0x01, 0x00, 0x04, 0x1E, 0xEB, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xE9, - 0x00, 0x02, 0x03, 0x1B, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, - 0x00, 0x2C, 0x01, 0xDC, 0x00, 0x02, 0x03, 0x00, 0x01, 0xD8, 0x00, 0x02, 0x03, 0x01, 0x01, 0xD6, - 0x00, 0x02, 0x03, 0x04, 0x01, 0xDA, 0x00, 0x02, 0x03, 0x0C, 0x01, 0xDC, 0x00, 0x02, 0x03, 0x40, - 0x01, 0xD8, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, - 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xB0, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xAE, 0x00, 0x02, - 0x03, 0x01, 0x1E, 0xB4, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xB2, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xB6, - 0x00, 0x02, 0x03, 0x23, 0x1E, 0xB0, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xAE, 0x00, 0x02, 0x03, 0x41, - 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, - 0x1E, 0xB1, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xAF, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xB5, 0x00, 0x02, - 0x03, 0x03, 0x1E, 0xB3, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xB7, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xB1, - 0x00, 0x02, 0x03, 0x40, 0x1E, 0xAF, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x08, - 0x00, 0x02, 0x03, 0x27, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x09, 0x00, 0x02, 0x03, 0x27, 0x00, 0x04, - 0x00, 0x0A, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x1E, 0x14, 0x00, 0x02, 0x03, 0x00, 0x1E, 0x16, - 0x00, 0x02, 0x03, 0x01, 0x1E, 0x14, 0x00, 0x02, 0x03, 0x40, 0x1E, 0x16, 0x00, 0x02, 0x03, 0x41, - 0x00, 0x04, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x1E, 0x15, 0x00, 0x02, 0x03, 0x00, - 0x1E, 0x17, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x15, 0x00, 0x02, 0x03, 0x40, 0x1E, 0x17, 0x00, 0x02, - 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x1C, 0x00, 0x02, 0x03, 0x27, 0x00, 0x01, 0x00, 0x04, - 0x1E, 0x1D, 0x00, 0x02, 0x03, 0x27, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, - 0x00, 0x24, 0x1E, 0x50, 0x00, 0x02, 0x03, 0x00, 0x1E, 0x52, 0x00, 0x02, 0x03, 0x01, 0x01, 0xEC, - 0x00, 0x02, 0x03, 0x28, 0x1E, 0x50, 0x00, 0x02, 0x03, 0x40, 0x1E, 0x52, 0x00, 0x02, 0x03, 0x41, - 0x00, 0x05, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x1E, 0x51, 0x00, 0x02, - 0x03, 0x00, 0x1E, 0x53, 0x00, 0x02, 0x03, 0x01, 0x01, 0xED, 0x00, 0x02, 0x03, 0x28, 0x1E, 0x51, - 0x00, 0x02, 0x03, 0x40, 0x1E, 0x53, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x64, - 0x00, 0x02, 0x03, 0x07, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x65, 0x00, 0x02, 0x03, 0x07, 0x00, 0x01, - 0x00, 0x04, 0x1E, 0x66, 0x00, 0x02, 0x03, 0x07, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x67, 0x00, 0x02, - 0x03, 0x07, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, 0x1E, 0x78, 0x00, 0x02, 0x03, 0x01, - 0x1E, 0xEE, 0x00, 0x02, 0x03, 0x1B, 0x1E, 0x78, 0x00, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x08, - 0x00, 0x0E, 0x00, 0x14, 0x1E, 0x79, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xEF, 0x00, 0x02, 0x03, 0x1B, - 0x1E, 0x79, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x7A, 0x00, 0x02, 0x03, 0x08, - 0x00, 0x01, 0x00, 0x04, 0x1E, 0x7B, 0x00, 0x02, 0x03, 0x08, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x9B, - 0x00, 0x02, 0x03, 0x07, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, - 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xDC, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xDA, 0x00, 0x02, 0x03, 0x01, - 0x1E, 0xE0, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xDE, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xE2, 0x00, 0x02, - 0x03, 0x23, 0x1E, 0xDC, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xDA, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, - 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xDD, - 0x00, 0x02, 0x03, 0x00, 0x1E, 0xDB, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xE1, 0x00, 0x02, 0x03, 0x03, - 0x1E, 0xDF, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xE3, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xDD, 0x00, 0x02, - 0x03, 0x40, 0x1E, 0xDB, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, - 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xEA, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xE8, - 0x00, 0x02, 0x03, 0x01, 0x1E, 0xEE, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xEC, 0x00, 0x02, 0x03, 0x09, - 0x1E, 0xF0, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xEA, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xE8, 0x00, 0x02, + 0x1E, 0xEA, 0x00, 0x03, 0x03, 0x00, 0x03, 0x1B, 0x00, 0xD9, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xE8, + 0x00, 0x03, 0x03, 0x01, 0x03, 0x1B, 0x00, 0xDA, 0x00, 0x02, 0x03, 0x01, 0x00, 0xDB, 0x00, 0x02, + 0x03, 0x02, 0x1E, 0x78, 0x00, 0x03, 0x03, 0x03, 0x03, 0x01, 0x1E, 0xEE, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x1B, 0x1E, 0x78, 0x00, 0x03, 0x03, 0x03, 0x03, 0x41, 0x01, 0x68, 0x00, 0x02, 0x03, 0x03, + 0x1E, 0x7A, 0x00, 0x03, 0x03, 0x04, 0x03, 0x08, 0x01, 0x6A, 0x00, 0x02, 0x03, 0x04, 0x01, 0x6C, + 0x00, 0x02, 0x03, 0x06, 0x01, 0xDB, 0x00, 0x03, 0x03, 0x08, 0x03, 0x00, 0x01, 0xD7, 0x00, 0x03, + 0x03, 0x08, 0x03, 0x01, 0x01, 0xD5, 0x00, 0x03, 0x03, 0x08, 0x03, 0x04, 0x01, 0xD9, 0x00, 0x03, + 0x03, 0x08, 0x03, 0x0C, 0x01, 0xDB, 0x00, 0x03, 0x03, 0x08, 0x03, 0x40, 0x01, 0xD7, 0x00, 0x03, + 0x03, 0x08, 0x03, 0x41, 0x00, 0xDC, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xEC, 0x00, 0x03, 0x03, 0x09, + 0x03, 0x1B, 0x1E, 0xE6, 0x00, 0x02, 0x03, 0x09, 0x01, 0x6E, 0x00, 0x02, 0x03, 0x0A, 0x01, 0x70, + 0x00, 0x02, 0x03, 0x0B, 0x01, 0xD3, 0x00, 0x02, 0x03, 0x0C, 0x02, 0x14, 0x00, 0x02, 0x03, 0x0F, + 0x02, 0x16, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xEA, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x00, 0x1E, 0xE8, + 0x00, 0x03, 0x03, 0x1B, 0x03, 0x01, 0x1E, 0xEE, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x03, 0x1E, 0xEC, + 0x00, 0x03, 0x03, 0x1B, 0x03, 0x09, 0x1E, 0xF0, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x23, 0x1E, 0xEA, + 0x00, 0x03, 0x03, 0x1B, 0x03, 0x40, 0x1E, 0xE8, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x41, 0x01, 0xAF, + 0x00, 0x02, 0x03, 0x1B, 0x1E, 0xF0, 0x00, 0x03, 0x03, 0x23, 0x03, 0x1B, 0x1E, 0xE4, 0x00, 0x02, + 0x03, 0x23, 0x1E, 0x72, 0x00, 0x02, 0x03, 0x24, 0x01, 0x72, 0x00, 0x02, 0x03, 0x28, 0x1E, 0x76, + 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x74, 0x00, 0x02, 0x03, 0x30, 0x1E, 0xEA, 0x00, 0x03, 0x03, 0x40, + 0x03, 0x1B, 0x00, 0xD9, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xE8, 0x00, 0x03, 0x03, 0x41, 0x03, 0x1B, + 0x00, 0xDA, 0x00, 0x02, 0x03, 0x41, 0x01, 0xD7, 0x00, 0x02, 0x03, 0x44, 0x00, 0x02, 0x00, 0x06, + 0x00, 0x0C, 0x1E, 0x7C, 0x00, 0x02, 0x03, 0x03, 0x1E, 0x7E, 0x00, 0x02, 0x03, 0x23, 0x00, 0x08, + 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, + 0x1E, 0x80, 0x00, 0x02, 0x03, 0x00, 0x1E, 0x82, 0x00, 0x02, 0x03, 0x01, 0x01, 0x74, 0x00, 0x02, + 0x03, 0x02, 0x1E, 0x86, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x84, 0x00, 0x02, 0x03, 0x08, 0x1E, 0x88, + 0x00, 0x02, 0x03, 0x23, 0x1E, 0x80, 0x00, 0x02, 0x03, 0x40, 0x1E, 0x82, 0x00, 0x02, 0x03, 0x41, + 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0x8A, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x8C, 0x00, 0x02, + 0x03, 0x08, 0x00, 0x0B, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, + 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, 0x00, 0x4E, 0x00, 0x54, 0x1E, 0xF2, 0x00, 0x02, 0x03, 0x00, + 0x00, 0xDD, 0x00, 0x02, 0x03, 0x01, 0x01, 0x76, 0x00, 0x02, 0x03, 0x02, 0x1E, 0xF8, 0x00, 0x02, + 0x03, 0x03, 0x02, 0x32, 0x00, 0x02, 0x03, 0x04, 0x1E, 0x8E, 0x00, 0x02, 0x03, 0x07, 0x01, 0x78, + 0x00, 0x02, 0x03, 0x08, 0x1E, 0xF6, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xF4, 0x00, 0x02, 0x03, 0x23, + 0x1E, 0xF2, 0x00, 0x02, 0x03, 0x40, 0x00, 0xDD, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, + 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x01, 0x79, 0x00, 0x02, + 0x03, 0x01, 0x1E, 0x90, 0x00, 0x02, 0x03, 0x02, 0x01, 0x7B, 0x00, 0x02, 0x03, 0x07, 0x01, 0x7D, + 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x92, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x94, 0x00, 0x02, 0x03, 0x31, + 0x01, 0x79, 0x00, 0x02, 0x03, 0x41, 0x00, 0x26, 0x00, 0x4E, 0x00, 0x54, 0x00, 0x5A, 0x00, 0x62, + 0x00, 0x6A, 0x00, 0x72, 0x00, 0x7A, 0x00, 0x82, 0x00, 0x8A, 0x00, 0x92, 0x00, 0x98, 0x00, 0x9E, + 0x00, 0xA4, 0x00, 0xAC, 0x00, 0xB4, 0x00, 0xBC, 0x00, 0xC4, 0x00, 0xCC, 0x00, 0xD4, 0x00, 0xDC, + 0x00, 0xE2, 0x00, 0xEA, 0x00, 0xF0, 0x00, 0xF8, 0x00, 0xFE, 0x01, 0x04, 0x01, 0x0C, 0x01, 0x14, + 0x01, 0x1A, 0x01, 0x20, 0x01, 0x26, 0x01, 0x2C, 0x01, 0x34, 0x01, 0x3C, 0x01, 0x42, 0x01, 0x48, + 0x01, 0x4E, 0x01, 0x54, 0x00, 0xE0, 0x00, 0x02, 0x03, 0x00, 0x00, 0xE1, 0x00, 0x02, 0x03, 0x01, + 0x1E, 0xA7, 0x00, 0x03, 0x03, 0x02, 0x03, 0x00, 0x1E, 0xA5, 0x00, 0x03, 0x03, 0x02, 0x03, 0x01, + 0x1E, 0xAB, 0x00, 0x03, 0x03, 0x02, 0x03, 0x03, 0x1E, 0xA9, 0x00, 0x03, 0x03, 0x02, 0x03, 0x09, + 0x1E, 0xAD, 0x00, 0x03, 0x03, 0x02, 0x03, 0x23, 0x1E, 0xA7, 0x00, 0x03, 0x03, 0x02, 0x03, 0x40, + 0x1E, 0xA5, 0x00, 0x03, 0x03, 0x02, 0x03, 0x41, 0x00, 0xE2, 0x00, 0x02, 0x03, 0x02, 0x00, 0xE3, + 0x00, 0x02, 0x03, 0x03, 0x01, 0x01, 0x00, 0x02, 0x03, 0x04, 0x1E, 0xB1, 0x00, 0x03, 0x03, 0x06, + 0x03, 0x00, 0x1E, 0xAF, 0x00, 0x03, 0x03, 0x06, 0x03, 0x01, 0x1E, 0xB5, 0x00, 0x03, 0x03, 0x06, + 0x03, 0x03, 0x1E, 0xB3, 0x00, 0x03, 0x03, 0x06, 0x03, 0x09, 0x1E, 0xB7, 0x00, 0x03, 0x03, 0x06, + 0x03, 0x23, 0x1E, 0xB1, 0x00, 0x03, 0x03, 0x06, 0x03, 0x40, 0x1E, 0xAF, 0x00, 0x03, 0x03, 0x06, + 0x03, 0x41, 0x01, 0x03, 0x00, 0x02, 0x03, 0x06, 0x01, 0xE1, 0x00, 0x03, 0x03, 0x07, 0x03, 0x04, + 0x02, 0x27, 0x00, 0x02, 0x03, 0x07, 0x01, 0xDF, 0x00, 0x03, 0x03, 0x08, 0x03, 0x04, 0x00, 0xE4, + 0x00, 0x02, 0x03, 0x08, 0x1E, 0xA3, 0x00, 0x02, 0x03, 0x09, 0x01, 0xFB, 0x00, 0x03, 0x03, 0x0A, + 0x03, 0x01, 0x01, 0xFB, 0x00, 0x03, 0x03, 0x0A, 0x03, 0x41, 0x00, 0xE5, 0x00, 0x02, 0x03, 0x0A, + 0x01, 0xCE, 0x00, 0x02, 0x03, 0x0C, 0x02, 0x01, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x03, 0x00, 0x02, + 0x03, 0x11, 0x1E, 0xAD, 0x00, 0x03, 0x03, 0x23, 0x03, 0x02, 0x1E, 0xB7, 0x00, 0x03, 0x03, 0x23, + 0x03, 0x06, 0x1E, 0xA1, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x01, 0x00, 0x02, 0x03, 0x25, 0x01, 0x05, + 0x00, 0x02, 0x03, 0x28, 0x00, 0xE0, 0x00, 0x02, 0x03, 0x40, 0x00, 0xE1, 0x00, 0x02, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, 0x1E, 0x03, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x05, + 0x00, 0x02, 0x03, 0x23, 0x1E, 0x07, 0x00, 0x02, 0x03, 0x31, 0x00, 0x0A, 0x00, 0x16, 0x00, 0x1E, + 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x54, + 0x1E, 0x09, 0x00, 0x03, 0x03, 0x01, 0x03, 0x27, 0x01, 0x07, 0x00, 0x02, 0x03, 0x01, 0x01, 0x09, + 0x00, 0x02, 0x03, 0x02, 0x01, 0x0B, 0x00, 0x02, 0x03, 0x07, 0x01, 0x0D, 0x00, 0x02, 0x03, 0x0C, + 0x1E, 0x09, 0x00, 0x03, 0x03, 0x27, 0x03, 0x01, 0x1E, 0x09, 0x00, 0x03, 0x03, 0x27, 0x03, 0x41, + 0x00, 0xE7, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x09, 0x00, 0x03, 0x03, 0x41, 0x03, 0x27, 0x01, 0x07, + 0x00, 0x02, 0x03, 0x41, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, + 0x00, 0x2C, 0x1E, 0x0B, 0x00, 0x02, 0x03, 0x07, 0x01, 0x0F, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x0D, + 0x00, 0x02, 0x03, 0x23, 0x1E, 0x11, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x13, 0x00, 0x02, 0x03, 0x2D, + 0x1E, 0x0F, 0x00, 0x02, 0x03, 0x31, 0x00, 0x21, 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, 0x00, 0x58, + 0x00, 0x60, 0x00, 0x68, 0x00, 0x70, 0x00, 0x78, 0x00, 0x80, 0x00, 0x88, 0x00, 0x8E, 0x00, 0x94, + 0x00, 0x9C, 0x00, 0xA4, 0x00, 0xAC, 0x00, 0xB4, 0x00, 0xBA, 0x00, 0xC2, 0x00, 0xC8, 0x00, 0xCE, + 0x00, 0xD4, 0x00, 0xDA, 0x00, 0xE0, 0x00, 0xE6, 0x00, 0xEC, 0x00, 0xF4, 0x00, 0xFA, 0x01, 0x02, + 0x01, 0x08, 0x01, 0x0E, 0x01, 0x14, 0x01, 0x1A, 0x01, 0x20, 0x00, 0xE8, 0x00, 0x02, 0x03, 0x00, + 0x00, 0xE9, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xC1, 0x00, 0x03, 0x03, 0x02, 0x03, 0x00, 0x1E, 0xBF, + 0x00, 0x03, 0x03, 0x02, 0x03, 0x01, 0x1E, 0xC5, 0x00, 0x03, 0x03, 0x02, 0x03, 0x03, 0x1E, 0xC3, + 0x00, 0x03, 0x03, 0x02, 0x03, 0x09, 0x1E, 0xC7, 0x00, 0x03, 0x03, 0x02, 0x03, 0x23, 0x1E, 0xC1, + 0x00, 0x03, 0x03, 0x02, 0x03, 0x40, 0x1E, 0xBF, 0x00, 0x03, 0x03, 0x02, 0x03, 0x41, 0x00, 0xEA, + 0x00, 0x02, 0x03, 0x02, 0x1E, 0xBD, 0x00, 0x02, 0x03, 0x03, 0x1E, 0x15, 0x00, 0x03, 0x03, 0x04, + 0x03, 0x00, 0x1E, 0x17, 0x00, 0x03, 0x03, 0x04, 0x03, 0x01, 0x1E, 0x15, 0x00, 0x03, 0x03, 0x04, + 0x03, 0x40, 0x1E, 0x17, 0x00, 0x03, 0x03, 0x04, 0x03, 0x41, 0x01, 0x13, 0x00, 0x02, 0x03, 0x04, + 0x1E, 0x1D, 0x00, 0x03, 0x03, 0x06, 0x03, 0x27, 0x01, 0x15, 0x00, 0x02, 0x03, 0x06, 0x01, 0x17, + 0x00, 0x02, 0x03, 0x07, 0x00, 0xEB, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xBB, 0x00, 0x02, 0x03, 0x09, + 0x01, 0x1B, 0x00, 0x02, 0x03, 0x0C, 0x02, 0x05, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x07, 0x00, 0x02, + 0x03, 0x11, 0x1E, 0xC7, 0x00, 0x03, 0x03, 0x23, 0x03, 0x02, 0x1E, 0xB9, 0x00, 0x02, 0x03, 0x23, + 0x1E, 0x1D, 0x00, 0x03, 0x03, 0x27, 0x03, 0x06, 0x02, 0x29, 0x00, 0x02, 0x03, 0x27, 0x01, 0x19, + 0x00, 0x02, 0x03, 0x28, 0x1E, 0x19, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x1B, 0x00, 0x02, 0x03, 0x30, + 0x00, 0xE8, 0x00, 0x02, 0x03, 0x40, 0x00, 0xE9, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, + 0x1E, 0x1F, 0x00, 0x02, 0x03, 0x07, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, + 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x01, 0xF5, 0x00, 0x02, 0x03, 0x01, 0x01, 0x1D, + 0x00, 0x02, 0x03, 0x02, 0x1E, 0x21, 0x00, 0x02, 0x03, 0x04, 0x01, 0x1F, 0x00, 0x02, 0x03, 0x06, + 0x01, 0x21, 0x00, 0x02, 0x03, 0x07, 0x01, 0xE7, 0x00, 0x02, 0x03, 0x0C, 0x01, 0x23, 0x00, 0x02, + 0x03, 0x27, 0x01, 0xF5, 0x00, 0x02, 0x03, 0x41, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, + 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x01, 0x25, 0x00, 0x02, 0x03, 0x02, + 0x1E, 0x23, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x27, 0x00, 0x02, 0x03, 0x08, 0x02, 0x1F, 0x00, 0x02, + 0x03, 0x0C, 0x1E, 0x25, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x29, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x2B, + 0x00, 0x02, 0x03, 0x2E, 0x1E, 0x96, 0x00, 0x02, 0x03, 0x31, 0x00, 0x13, 0x00, 0x28, 0x00, 0x2E, + 0x00, 0x34, 0x00, 0x3A, 0x00, 0x40, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5C, 0x00, 0x62, + 0x00, 0x68, 0x00, 0x6E, 0x00, 0x74, 0x00, 0x7A, 0x00, 0x80, 0x00, 0x86, 0x00, 0x8C, 0x00, 0x92, + 0x00, 0x98, 0x00, 0xEC, 0x00, 0x02, 0x03, 0x00, 0x00, 0xED, 0x00, 0x02, 0x03, 0x01, 0x00, 0xEE, + 0x00, 0x02, 0x03, 0x02, 0x01, 0x29, 0x00, 0x02, 0x03, 0x03, 0x01, 0x2B, 0x00, 0x02, 0x03, 0x04, + 0x01, 0x2D, 0x00, 0x02, 0x03, 0x06, 0x1E, 0x2F, 0x00, 0x03, 0x03, 0x08, 0x03, 0x01, 0x1E, 0x2F, + 0x00, 0x03, 0x03, 0x08, 0x03, 0x41, 0x00, 0xEF, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xC9, 0x00, 0x02, + 0x03, 0x09, 0x01, 0xD0, 0x00, 0x02, 0x03, 0x0C, 0x02, 0x09, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x0B, + 0x00, 0x02, 0x03, 0x11, 0x1E, 0xCB, 0x00, 0x02, 0x03, 0x23, 0x01, 0x2F, 0x00, 0x02, 0x03, 0x28, + 0x1E, 0x2D, 0x00, 0x02, 0x03, 0x30, 0x00, 0xEC, 0x00, 0x02, 0x03, 0x40, 0x00, 0xED, 0x00, 0x02, + 0x03, 0x41, 0x1E, 0x2F, 0x00, 0x02, 0x03, 0x44, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x01, 0x35, + 0x00, 0x02, 0x03, 0x02, 0x01, 0xF0, 0x00, 0x02, 0x03, 0x0C, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, + 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x1E, 0x31, 0x00, 0x02, 0x03, 0x01, 0x01, 0xE9, + 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x33, 0x00, 0x02, 0x03, 0x23, 0x01, 0x37, 0x00, 0x02, 0x03, 0x27, + 0x1E, 0x35, 0x00, 0x02, 0x03, 0x31, 0x1E, 0x31, 0x00, 0x02, 0x03, 0x41, 0x00, 0x09, 0x00, 0x14, + 0x00, 0x1A, 0x00, 0x22, 0x00, 0x28, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, + 0x01, 0x3A, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x39, 0x00, 0x03, 0x03, 0x04, 0x03, 0x23, 0x01, 0x3E, + 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x39, 0x00, 0x03, 0x03, 0x23, 0x03, 0x04, 0x1E, 0x37, 0x00, 0x02, + 0x03, 0x23, 0x01, 0x3C, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x3D, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x3B, + 0x00, 0x02, 0x03, 0x31, 0x01, 0x3A, 0x00, 0x02, 0x03, 0x41, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x10, + 0x00, 0x16, 0x00, 0x1C, 0x1E, 0x3F, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x41, 0x00, 0x02, 0x03, 0x07, + 0x1E, 0x43, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x3F, 0x00, 0x02, 0x03, 0x41, 0x00, 0x0B, 0x00, 0x18, + 0x00, 0x1E, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x00, 0x42, 0x00, 0x48, + 0x00, 0x4E, 0x00, 0x54, 0x01, 0xF9, 0x00, 0x02, 0x03, 0x00, 0x01, 0x44, 0x00, 0x02, 0x03, 0x01, + 0x00, 0xF1, 0x00, 0x02, 0x03, 0x03, 0x1E, 0x45, 0x00, 0x02, 0x03, 0x07, 0x01, 0x48, 0x00, 0x02, + 0x03, 0x0C, 0x1E, 0x47, 0x00, 0x02, 0x03, 0x23, 0x01, 0x46, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x4B, + 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x49, 0x00, 0x02, 0x03, 0x31, 0x01, 0xF9, 0x00, 0x02, 0x03, 0x40, + 0x01, 0x44, 0x00, 0x02, 0x03, 0x41, 0x00, 0x34, 0x00, 0x6A, 0x00, 0x72, 0x00, 0x78, 0x00, 0x80, + 0x00, 0x86, 0x00, 0x8E, 0x00, 0x96, 0x00, 0x9E, 0x00, 0xA6, 0x00, 0xAE, 0x00, 0xB6, 0x00, 0xBE, + 0x00, 0xC4, 0x00, 0xCC, 0x00, 0xD4, 0x00, 0xDC, 0x00, 0xE4, 0x00, 0xEC, 0x00, 0xF2, 0x00, 0xFA, + 0x01, 0x02, 0x01, 0x0A, 0x01, 0x12, 0x01, 0x1A, 0x01, 0x20, 0x01, 0x26, 0x01, 0x2E, 0x01, 0x34, + 0x01, 0x3C, 0x01, 0x42, 0x01, 0x4A, 0x01, 0x50, 0x01, 0x56, 0x01, 0x5C, 0x01, 0x62, 0x01, 0x68, + 0x01, 0x70, 0x01, 0x78, 0x01, 0x80, 0x01, 0x88, 0x01, 0x90, 0x01, 0x98, 0x01, 0xA0, 0x01, 0xA6, + 0x01, 0xAE, 0x01, 0xB6, 0x01, 0xBC, 0x01, 0xC4, 0x01, 0xCA, 0x01, 0xD2, 0x01, 0xD8, 0x01, 0xE0, + 0x1E, 0xDD, 0x00, 0x03, 0x03, 0x00, 0x03, 0x1B, 0x00, 0xF2, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xDB, + 0x00, 0x03, 0x03, 0x01, 0x03, 0x1B, 0x00, 0xF3, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xD3, 0x00, 0x03, + 0x03, 0x02, 0x03, 0x00, 0x1E, 0xD1, 0x00, 0x03, 0x03, 0x02, 0x03, 0x01, 0x1E, 0xD7, 0x00, 0x03, + 0x03, 0x02, 0x03, 0x03, 0x1E, 0xD5, 0x00, 0x03, 0x03, 0x02, 0x03, 0x09, 0x1E, 0xD9, 0x00, 0x03, + 0x03, 0x02, 0x03, 0x23, 0x1E, 0xD3, 0x00, 0x03, 0x03, 0x02, 0x03, 0x40, 0x1E, 0xD1, 0x00, 0x03, + 0x03, 0x02, 0x03, 0x41, 0x00, 0xF4, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x4D, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x01, 0x02, 0x2D, 0x00, 0x03, 0x03, 0x03, 0x03, 0x04, 0x1E, 0x4F, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x08, 0x1E, 0xE1, 0x00, 0x03, 0x03, 0x03, 0x03, 0x1B, 0x1E, 0x4D, 0x00, 0x03, 0x03, 0x03, + 0x03, 0x41, 0x00, 0xF5, 0x00, 0x02, 0x03, 0x03, 0x1E, 0x51, 0x00, 0x03, 0x03, 0x04, 0x03, 0x00, + 0x1E, 0x53, 0x00, 0x03, 0x03, 0x04, 0x03, 0x01, 0x01, 0xED, 0x00, 0x03, 0x03, 0x04, 0x03, 0x28, + 0x1E, 0x51, 0x00, 0x03, 0x03, 0x04, 0x03, 0x40, 0x1E, 0x53, 0x00, 0x03, 0x03, 0x04, 0x03, 0x41, + 0x01, 0x4D, 0x00, 0x02, 0x03, 0x04, 0x01, 0x4F, 0x00, 0x02, 0x03, 0x06, 0x02, 0x31, 0x00, 0x03, + 0x03, 0x07, 0x03, 0x04, 0x02, 0x2F, 0x00, 0x02, 0x03, 0x07, 0x02, 0x2B, 0x00, 0x03, 0x03, 0x08, + 0x03, 0x04, 0x00, 0xF6, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xDF, 0x00, 0x03, 0x03, 0x09, 0x03, 0x1B, + 0x1E, 0xCF, 0x00, 0x02, 0x03, 0x09, 0x01, 0x51, 0x00, 0x02, 0x03, 0x0B, 0x01, 0xD2, 0x00, 0x02, + 0x03, 0x0C, 0x02, 0x0D, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x0F, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xDD, + 0x00, 0x03, 0x03, 0x1B, 0x03, 0x00, 0x1E, 0xDB, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x01, 0x1E, 0xE1, + 0x00, 0x03, 0x03, 0x1B, 0x03, 0x03, 0x1E, 0xDF, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x09, 0x1E, 0xE3, + 0x00, 0x03, 0x03, 0x1B, 0x03, 0x23, 0x1E, 0xDD, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x40, 0x1E, 0xDB, + 0x00, 0x03, 0x03, 0x1B, 0x03, 0x41, 0x01, 0xA1, 0x00, 0x02, 0x03, 0x1B, 0x1E, 0xD9, 0x00, 0x03, + 0x03, 0x23, 0x03, 0x02, 0x1E, 0xE3, 0x00, 0x03, 0x03, 0x23, 0x03, 0x1B, 0x1E, 0xCD, 0x00, 0x02, + 0x03, 0x23, 0x01, 0xED, 0x00, 0x03, 0x03, 0x28, 0x03, 0x04, 0x01, 0xEB, 0x00, 0x02, 0x03, 0x28, + 0x1E, 0xDD, 0x00, 0x03, 0x03, 0x40, 0x03, 0x1B, 0x00, 0xF2, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xDB, + 0x00, 0x03, 0x03, 0x41, 0x03, 0x1B, 0x00, 0xF3, 0x00, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x08, + 0x00, 0x0E, 0x00, 0x14, 0x1E, 0x55, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x57, 0x00, 0x02, 0x03, 0x07, + 0x1E, 0x55, 0x00, 0x02, 0x03, 0x41, 0x00, 0x0B, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x26, 0x00, 0x2C, + 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, 0x01, 0x55, + 0x00, 0x02, 0x03, 0x01, 0x1E, 0x5D, 0x00, 0x03, 0x03, 0x04, 0x03, 0x23, 0x1E, 0x59, 0x00, 0x02, + 0x03, 0x07, 0x01, 0x59, 0x00, 0x02, 0x03, 0x0C, 0x02, 0x11, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x13, + 0x00, 0x02, 0x03, 0x11, 0x1E, 0x5D, 0x00, 0x03, 0x03, 0x23, 0x03, 0x04, 0x1E, 0x5B, 0x00, 0x02, + 0x03, 0x23, 0x01, 0x57, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x5F, 0x00, 0x02, 0x03, 0x31, 0x01, 0x55, + 0x00, 0x02, 0x03, 0x41, 0x00, 0x0D, 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x38, + 0x00, 0x3E, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5A, 0x00, 0x60, 0x00, 0x66, 0x00, 0x6E, + 0x1E, 0x65, 0x00, 0x03, 0x03, 0x01, 0x03, 0x07, 0x01, 0x5B, 0x00, 0x02, 0x03, 0x01, 0x01, 0x5D, + 0x00, 0x02, 0x03, 0x02, 0x1E, 0x69, 0x00, 0x03, 0x03, 0x07, 0x03, 0x23, 0x1E, 0x61, 0x00, 0x02, + 0x03, 0x07, 0x1E, 0x67, 0x00, 0x03, 0x03, 0x0C, 0x03, 0x07, 0x01, 0x61, 0x00, 0x02, 0x03, 0x0C, + 0x1E, 0x69, 0x00, 0x03, 0x03, 0x23, 0x03, 0x07, 0x1E, 0x63, 0x00, 0x02, 0x03, 0x23, 0x02, 0x19, + 0x00, 0x02, 0x03, 0x26, 0x01, 0x5F, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x65, 0x00, 0x03, 0x03, 0x41, + 0x03, 0x07, 0x01, 0x5B, 0x00, 0x02, 0x03, 0x41, 0x00, 0x08, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, + 0x00, 0x24, 0x00, 0x2A, 0x00, 0x30, 0x00, 0x36, 0x00, 0x3C, 0x1E, 0x6B, 0x00, 0x02, 0x03, 0x07, + 0x1E, 0x97, 0x00, 0x02, 0x03, 0x08, 0x01, 0x65, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x6D, 0x00, 0x02, + 0x03, 0x23, 0x02, 0x1B, 0x00, 0x02, 0x03, 0x26, 0x01, 0x63, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x71, + 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x6F, 0x00, 0x02, 0x03, 0x31, 0x00, 0x2D, 0x00, 0x5C, 0x00, 0x64, + 0x00, 0x6A, 0x00, 0x72, 0x00, 0x78, 0x00, 0x7E, 0x00, 0x86, 0x00, 0x8E, 0x00, 0x96, 0x00, 0x9C, + 0x00, 0xA4, 0x00, 0xAA, 0x00, 0xB0, 0x00, 0xB8, 0x00, 0xC0, 0x00, 0xC8, 0x00, 0xD0, 0x00, 0xD8, + 0x00, 0xE0, 0x00, 0xE6, 0x00, 0xEE, 0x00, 0xF4, 0x00, 0xFA, 0x01, 0x00, 0x01, 0x06, 0x01, 0x0C, + 0x01, 0x12, 0x01, 0x1A, 0x01, 0x22, 0x01, 0x2A, 0x01, 0x32, 0x01, 0x3A, 0x01, 0x42, 0x01, 0x4A, + 0x01, 0x50, 0x01, 0x58, 0x01, 0x5E, 0x01, 0x64, 0x01, 0x6A, 0x01, 0x70, 0x01, 0x76, 0x01, 0x7E, + 0x01, 0x84, 0x01, 0x8C, 0x01, 0x92, 0x1E, 0xEB, 0x00, 0x03, 0x03, 0x00, 0x03, 0x1B, 0x00, 0xF9, + 0x00, 0x02, 0x03, 0x00, 0x1E, 0xE9, 0x00, 0x03, 0x03, 0x01, 0x03, 0x1B, 0x00, 0xFA, 0x00, 0x02, + 0x03, 0x01, 0x00, 0xFB, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x79, 0x00, 0x03, 0x03, 0x03, 0x03, 0x01, + 0x1E, 0xEF, 0x00, 0x03, 0x03, 0x03, 0x03, 0x1B, 0x1E, 0x79, 0x00, 0x03, 0x03, 0x03, 0x03, 0x41, + 0x01, 0x69, 0x00, 0x02, 0x03, 0x03, 0x1E, 0x7B, 0x00, 0x03, 0x03, 0x04, 0x03, 0x08, 0x01, 0x6B, + 0x00, 0x02, 0x03, 0x04, 0x01, 0x6D, 0x00, 0x02, 0x03, 0x06, 0x01, 0xDC, 0x00, 0x03, 0x03, 0x08, + 0x03, 0x00, 0x01, 0xD8, 0x00, 0x03, 0x03, 0x08, 0x03, 0x01, 0x01, 0xD6, 0x00, 0x03, 0x03, 0x08, + 0x03, 0x04, 0x01, 0xDA, 0x00, 0x03, 0x03, 0x08, 0x03, 0x0C, 0x01, 0xDC, 0x00, 0x03, 0x03, 0x08, + 0x03, 0x40, 0x01, 0xD8, 0x00, 0x03, 0x03, 0x08, 0x03, 0x41, 0x00, 0xFC, 0x00, 0x02, 0x03, 0x08, + 0x1E, 0xED, 0x00, 0x03, 0x03, 0x09, 0x03, 0x1B, 0x1E, 0xE7, 0x00, 0x02, 0x03, 0x09, 0x01, 0x6F, + 0x00, 0x02, 0x03, 0x0A, 0x01, 0x71, 0x00, 0x02, 0x03, 0x0B, 0x01, 0xD4, 0x00, 0x02, 0x03, 0x0C, + 0x02, 0x15, 0x00, 0x02, 0x03, 0x0F, 0x02, 0x17, 0x00, 0x02, 0x03, 0x11, 0x1E, 0xEB, 0x00, 0x03, + 0x03, 0x1B, 0x03, 0x00, 0x1E, 0xE9, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x01, 0x1E, 0xEF, 0x00, 0x03, + 0x03, 0x1B, 0x03, 0x03, 0x1E, 0xED, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x09, 0x1E, 0xF1, 0x00, 0x03, + 0x03, 0x1B, 0x03, 0x23, 0x1E, 0xEB, 0x00, 0x03, 0x03, 0x1B, 0x03, 0x40, 0x1E, 0xE9, 0x00, 0x03, + 0x03, 0x1B, 0x03, 0x41, 0x01, 0xB0, 0x00, 0x02, 0x03, 0x1B, 0x1E, 0xF1, 0x00, 0x03, 0x03, 0x23, + 0x03, 0x1B, 0x1E, 0xE5, 0x00, 0x02, 0x03, 0x23, 0x1E, 0x73, 0x00, 0x02, 0x03, 0x24, 0x01, 0x73, + 0x00, 0x02, 0x03, 0x28, 0x1E, 0x77, 0x00, 0x02, 0x03, 0x2D, 0x1E, 0x75, 0x00, 0x02, 0x03, 0x30, + 0x1E, 0xEB, 0x00, 0x03, 0x03, 0x40, 0x03, 0x1B, 0x00, 0xF9, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xE9, + 0x00, 0x03, 0x03, 0x41, 0x03, 0x1B, 0x00, 0xFA, 0x00, 0x02, 0x03, 0x41, 0x01, 0xD8, 0x00, 0x02, + 0x03, 0x44, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0x7D, 0x00, 0x02, 0x03, 0x03, 0x1E, 0x7F, + 0x00, 0x02, 0x03, 0x23, 0x00, 0x09, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, + 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, 0x00, 0x44, 0x1E, 0x81, 0x00, 0x02, 0x03, 0x00, 0x1E, 0x83, + 0x00, 0x02, 0x03, 0x01, 0x01, 0x75, 0x00, 0x02, 0x03, 0x02, 0x1E, 0x87, 0x00, 0x02, 0x03, 0x07, + 0x1E, 0x85, 0x00, 0x02, 0x03, 0x08, 0x1E, 0x98, 0x00, 0x02, 0x03, 0x0A, 0x1E, 0x89, 0x00, 0x02, + 0x03, 0x23, 0x1E, 0x81, 0x00, 0x02, 0x03, 0x40, 0x1E, 0x83, 0x00, 0x02, 0x03, 0x41, 0x00, 0x02, + 0x00, 0x06, 0x00, 0x0C, 0x1E, 0x8B, 0x00, 0x02, 0x03, 0x07, 0x1E, 0x8D, 0x00, 0x02, 0x03, 0x08, + 0x00, 0x0C, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3E, + 0x00, 0x44, 0x00, 0x4A, 0x00, 0x50, 0x00, 0x56, 0x00, 0x5C, 0x1E, 0xF3, 0x00, 0x02, 0x03, 0x00, + 0x00, 0xFD, 0x00, 0x02, 0x03, 0x01, 0x01, 0x77, 0x00, 0x02, 0x03, 0x02, 0x1E, 0xF9, 0x00, 0x02, + 0x03, 0x03, 0x02, 0x33, 0x00, 0x02, 0x03, 0x04, 0x1E, 0x8F, 0x00, 0x02, 0x03, 0x07, 0x00, 0xFF, + 0x00, 0x02, 0x03, 0x08, 0x1E, 0xF7, 0x00, 0x02, 0x03, 0x09, 0x1E, 0x99, 0x00, 0x02, 0x03, 0x0A, + 0x1E, 0xF5, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xF3, 0x00, 0x02, 0x03, 0x40, 0x00, 0xFD, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, - 0x00, 0x34, 0x1E, 0xEB, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xE9, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xEF, - 0x00, 0x02, 0x03, 0x03, 0x1E, 0xED, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xF1, 0x00, 0x02, 0x03, 0x23, - 0x1E, 0xEB, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xE9, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, - 0x01, 0xEE, 0x00, 0x02, 0x03, 0x0C, 0x00, 0x01, 0x00, 0x04, 0x01, 0xEC, 0x00, 0x02, 0x03, 0x04, - 0x00, 0x01, 0x00, 0x04, 0x01, 0xED, 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, 0x01, 0xE0, - 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, 0x01, 0xE1, 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, - 0x00, 0x04, 0x1E, 0x1C, 0x00, 0x02, 0x03, 0x06, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x1D, 0x00, 0x02, - 0x03, 0x06, 0x00, 0x01, 0x00, 0x04, 0x02, 0x30, 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, - 0x02, 0x31, 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, 0x01, 0xEF, 0x00, 0x02, 0x03, 0x0C, - 0x00, 0x01, 0x00, 0x04, 0x1E, 0x38, 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x39, - 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x5C, 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, - 0x00, 0x04, 0x1E, 0x5D, 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x68, 0x00, 0x02, - 0x03, 0x23, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x69, 0x00, 0x02, 0x03, 0x23, 0x00, 0x01, 0x00, 0x04, - 0x1E, 0x68, 0x00, 0x02, 0x03, 0x07, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x69, 0x00, 0x02, 0x03, 0x07, - 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0xAC, 0x00, 0x02, 0x03, 0x02, 0x1E, 0xB6, 0x00, 0x02, - 0x03, 0x06, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0xAD, 0x00, 0x02, 0x03, 0x02, 0x1E, 0xB7, - 0x00, 0x02, 0x03, 0x06, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xC6, 0x00, 0x02, 0x03, 0x02, 0x00, 0x01, - 0x00, 0x04, 0x1E, 0xC7, 0x00, 0x02, 0x03, 0x02, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0xD8, - 0x00, 0x02, 0x03, 0x02, 0x1E, 0xE2, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, - 0x1E, 0xD9, 0x00, 0x02, 0x03, 0x02, 0x1E, 0xE3, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, - 0x1E, 0xDE, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xDF, 0x00, 0x02, 0x03, 0x1B, - 0x00, 0x01, 0x00, 0x04, 0x1E, 0xF0, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xF1, - 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xEC, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, - 0x00, 0x04, 0x1E, 0xED, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, - 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x1E, 0x30, 0x00, 0x02, 0x03, 0x01, 0x01, 0xE8, 0x00, 0x02, - 0x03, 0x0C, 0x1E, 0x32, 0x00, 0x02, 0x03, 0x23, 0x01, 0x36, 0x00, 0x02, 0x03, 0x27, 0x1E, 0x34, - 0x00, 0x02, 0x03, 0x31, 0x1E, 0x30, 0x00, 0x02, 0x03, 0x41, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, - 0x01, 0xFA, 0x00, 0x02, 0x03, 0x01, 0x01, 0xFA, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x89, - 0x00, 0x41, 0x00, 0x42, 0x00, 0x43, 0x00, 0x44, 0x00, 0x45, 0x00, 0x46, 0x00, 0x47, 0x00, 0x48, - 0x00, 0x49, 0x00, 0x4A, 0x00, 0x4B, 0x00, 0x4C, 0x00, 0x4D, 0x00, 0x4E, 0x00, 0x4F, 0x00, 0x50, - 0x00, 0x52, 0x00, 0x53, 0x00, 0x54, 0x00, 0x55, 0x00, 0x56, 0x00, 0x57, 0x00, 0x58, 0x00, 0x59, - 0x00, 0x5A, 0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00, 0x64, 0x00, 0x65, 0x00, 0x66, 0x00, 0x67, - 0x00, 0x68, 0x00, 0x69, 0x00, 0x6A, 0x00, 0x6B, 0x00, 0x6C, 0x00, 0x6D, 0x00, 0x6E, 0x00, 0x6F, - 0x00, 0x70, 0x00, 0x72, 0x00, 0x73, 0x00, 0x74, 0x00, 0x75, 0x00, 0x76, 0x00, 0x77, 0x00, 0x78, - 0x00, 0x79, 0x00, 0x7A, 0x00, 0xC2, 0x00, 0xC4, 0x00, 0xC5, 0x00, 0xC6, 0x00, 0xC7, 0x00, 0xCA, - 0x00, 0xCF, 0x00, 0xD2, 0x00, 0xD3, 0x00, 0xD4, 0x00, 0xD5, 0x00, 0xD6, 0x00, 0xD8, 0x00, 0xD9, - 0x00, 0xDA, 0x00, 0xDC, 0x00, 0xE2, 0x00, 0xE4, 0x00, 0xE5, 0x00, 0xE6, 0x00, 0xE7, 0x00, 0xEA, - 0x00, 0xEF, 0x00, 0xF2, 0x00, 0xF3, 0x00, 0xF4, 0x00, 0xF5, 0x00, 0xF6, 0x00, 0xF8, 0x00, 0xF9, - 0x00, 0xFA, 0x00, 0xFC, 0x01, 0x02, 0x01, 0x03, 0x01, 0x06, 0x01, 0x07, 0x01, 0x12, 0x01, 0x13, - 0x01, 0x14, 0x01, 0x15, 0x01, 0x4C, 0x01, 0x4D, 0x01, 0x5A, 0x01, 0x5B, 0x01, 0x60, 0x01, 0x61, - 0x01, 0x68, 0x01, 0x69, 0x01, 0x6A, 0x01, 0x6B, 0x01, 0x7F, 0x01, 0xA0, 0x01, 0xA1, 0x01, 0xAF, - 0x01, 0xB0, 0x01, 0xB7, 0x01, 0xEA, 0x01, 0xEB, 0x02, 0x26, 0x02, 0x27, 0x02, 0x28, 0x02, 0x29, - 0x02, 0x2E, 0x02, 0x2F, 0x02, 0x92, 0x1E, 0x36, 0x1E, 0x37, 0x1E, 0x5A, 0x1E, 0x5B, 0x1E, 0x60, - 0x1E, 0x61, 0x1E, 0x62, 0x1E, 0x63, 0x1E, 0xA0, 0x1E, 0xA1, 0x1E, 0xB8, 0x1E, 0xB9, 0x1E, 0xCC, - 0x1E, 0xCD, 0x1E, 0xCE, 0x1E, 0xCF, 0x1E, 0xE4, 0x1E, 0xE5, 0x1E, 0xE6, 0x1E, 0xE7, 0x21, 0x2A, - 0x21, 0x2B, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x14, 0x13, 0x92, 0x1A, 0xA8, 0x1E, 0x46, - 0x21, 0xB8, 0x22, 0x76, 0x23, 0x04, 0x00, 0x01, 0x0F, 0x96, 0x01, 0xF2, 0x03, 0xEA, 0x03, 0xF0, - 0x03, 0xF6, 0x03, 0xFC, 0x04, 0x02, 0x04, 0x08, 0x04, 0x0E, 0x04, 0x14, 0x04, 0x1A, 0x04, 0x20, - 0x04, 0x26, 0x04, 0x2C, 0x04, 0x32, 0x04, 0x38, 0x04, 0x3E, 0x04, 0x44, 0x04, 0x4A, 0x04, 0x50, - 0x04, 0x56, 0x04, 0x5C, 0x04, 0x62, 0x04, 0x68, 0x04, 0x6E, 0x04, 0x74, 0x04, 0x7A, 0x04, 0x80, - 0x04, 0x86, 0x04, 0x8C, 0x04, 0x92, 0x04, 0x98, 0x04, 0x9E, 0x04, 0xA4, 0x04, 0xAA, 0x04, 0xB0, - 0x04, 0xB6, 0x04, 0xBC, 0x04, 0xC2, 0x04, 0xC8, 0x04, 0xCE, 0x04, 0xD4, 0x04, 0xDA, 0x04, 0xE0, - 0x04, 0xE6, 0x04, 0xEC, 0x04, 0xF2, 0x04, 0xF8, 0x04, 0xFE, 0x05, 0x04, 0x05, 0x0A, 0x05, 0x10, - 0x05, 0x16, 0x05, 0x1C, 0x05, 0x22, 0x05, 0x28, 0x05, 0x2E, 0x05, 0x34, 0x05, 0x3A, 0x05, 0x40, - 0x05, 0x46, 0x05, 0x4C, 0x05, 0x52, 0x05, 0x58, 0x05, 0x5E, 0x05, 0x64, 0x05, 0x6A, 0x05, 0x70, - 0x05, 0x76, 0x05, 0x7C, 0x05, 0x82, 0x05, 0x88, 0x05, 0x8E, 0x05, 0x94, 0x05, 0x9A, 0x05, 0xA0, - 0x05, 0xA6, 0x05, 0xAC, 0x05, 0xB2, 0x05, 0xB8, 0x05, 0xBE, 0x05, 0xC4, 0x05, 0xCA, 0x05, 0xD0, - 0x05, 0xD6, 0x05, 0xDC, 0x05, 0xE2, 0x05, 0xE8, 0x05, 0xEE, 0x05, 0xF4, 0x05, 0xFA, 0x06, 0x00, - 0x06, 0x06, 0x06, 0x0C, 0x06, 0x12, 0x06, 0x18, 0x06, 0x1E, 0x06, 0x24, 0x06, 0x2A, 0x06, 0x30, - 0x06, 0x36, 0x06, 0x3C, 0x06, 0x42, 0x06, 0x48, 0x06, 0x4E, 0x06, 0x54, 0x06, 0x5A, 0x06, 0x60, - 0x06, 0x66, 0x06, 0x6C, 0x06, 0x72, 0x06, 0x78, 0x06, 0x7E, 0x06, 0x84, 0x06, 0x8A, 0x06, 0x90, - 0x06, 0x96, 0x06, 0x9C, 0x06, 0xA2, 0x06, 0xA8, 0x06, 0xAE, 0x06, 0xB4, 0x06, 0xBA, 0x06, 0xC0, - 0x06, 0xC6, 0x06, 0xCC, 0x06, 0xD2, 0x06, 0xD8, 0x06, 0xDE, 0x06, 0xE4, 0x06, 0xEA, 0x06, 0xF0, - 0x06, 0xF6, 0x06, 0xFC, 0x07, 0x02, 0x07, 0x08, 0x07, 0x0E, 0x07, 0x14, 0x07, 0x1A, 0x07, 0x20, - 0x07, 0x26, 0x07, 0x2C, 0x07, 0x32, 0x07, 0x38, 0x07, 0x3E, 0x07, 0x44, 0x07, 0x4A, 0x07, 0x50, - 0x07, 0x56, 0x07, 0x5C, 0x07, 0x62, 0x07, 0x68, 0x07, 0x6E, 0x07, 0x74, 0x07, 0x7A, 0x07, 0x80, - 0x07, 0x86, 0x07, 0x8C, 0x07, 0x92, 0x07, 0x98, 0x07, 0x9E, 0x07, 0xA4, 0x07, 0xAA, 0x07, 0xB0, - 0x07, 0xB6, 0x07, 0xBC, 0x07, 0xC2, 0x07, 0xC8, 0x07, 0xCE, 0x07, 0xD4, 0x07, 0xDA, 0x07, 0xE0, - 0x07, 0xE6, 0x07, 0xEC, 0x07, 0xF2, 0x07, 0xF8, 0x07, 0xFE, 0x08, 0x04, 0x08, 0x0A, 0x08, 0x10, - 0x08, 0x16, 0x08, 0x1C, 0x08, 0x22, 0x08, 0x28, 0x08, 0x2E, 0x08, 0x34, 0x08, 0x3A, 0x08, 0x40, - 0x08, 0x46, 0x08, 0x4C, 0x08, 0x52, 0x08, 0x58, 0x08, 0x5E, 0x08, 0x64, 0x08, 0x6A, 0x08, 0x70, - 0x08, 0x76, 0x08, 0x7C, 0x08, 0x82, 0x08, 0x88, 0x08, 0x8E, 0x08, 0x94, 0x08, 0x9A, 0x08, 0xA0, - 0x08, 0xA6, 0x08, 0xAC, 0x08, 0xB2, 0x08, 0xB8, 0x08, 0xBE, 0x08, 0xC4, 0x08, 0xCA, 0x08, 0xD0, - 0x08, 0xD6, 0x08, 0xDC, 0x08, 0xE2, 0x08, 0xE8, 0x08, 0xEE, 0x08, 0xF4, 0x08, 0xFA, 0x09, 0x00, - 0x09, 0x06, 0x09, 0x0C, 0x09, 0x12, 0x09, 0x18, 0x09, 0x1E, 0x09, 0x24, 0x09, 0x2A, 0x09, 0x30, - 0x09, 0x36, 0x09, 0x3C, 0x09, 0x42, 0x09, 0x48, 0x09, 0x4E, 0x09, 0x54, 0x09, 0x5A, 0x09, 0x60, - 0x09, 0x66, 0x09, 0x6C, 0x09, 0x72, 0x09, 0x78, 0x09, 0x7E, 0x09, 0x84, 0x09, 0x8A, 0x09, 0x90, - 0x09, 0x96, 0x09, 0x9C, 0x09, 0xA2, 0x09, 0xA8, 0x09, 0xAE, 0x09, 0xB4, 0x09, 0xBA, 0x09, 0xC0, - 0x09, 0xC6, 0x09, 0xCC, 0x09, 0xD2, 0x09, 0xD8, 0x09, 0xDE, 0x09, 0xE4, 0x09, 0xEA, 0x09, 0xF0, - 0x09, 0xF6, 0x09, 0xFC, 0x0A, 0x02, 0x0A, 0x08, 0x0A, 0x0E, 0x0A, 0x14, 0x0A, 0x1A, 0x0A, 0x20, - 0x0A, 0x26, 0x0A, 0x2C, 0x0A, 0x32, 0x0A, 0x38, 0x0A, 0x3E, 0x0A, 0x44, 0x0A, 0x4A, 0x0A, 0x50, - 0x0A, 0x56, 0x0A, 0x5C, 0x0A, 0x62, 0x0A, 0x68, 0x0A, 0x6E, 0x0A, 0x74, 0x0A, 0x7A, 0x0A, 0x80, - 0x0A, 0x86, 0x0A, 0x8C, 0x0A, 0x92, 0x0A, 0x98, 0x0A, 0x9E, 0x0A, 0xA4, 0x0A, 0xAA, 0x0A, 0xB0, - 0x0A, 0xB6, 0x0A, 0xBC, 0x0A, 0xC2, 0x0A, 0xC8, 0x0A, 0xCE, 0x0A, 0xD4, 0x0A, 0xDA, 0x0A, 0xE0, - 0x0A, 0xE6, 0x0A, 0xEC, 0x0A, 0xF2, 0x0A, 0xF8, 0x0A, 0xFE, 0x0B, 0x04, 0x0B, 0x0A, 0x0B, 0x10, - 0x0B, 0x16, 0x0B, 0x1C, 0x0B, 0x22, 0x0B, 0x28, 0x0B, 0x2E, 0x0B, 0x34, 0x0B, 0x3A, 0x0B, 0x40, - 0x0B, 0x46, 0x0B, 0x4C, 0x0B, 0x52, 0x0B, 0x58, 0x0B, 0x5E, 0x0B, 0x64, 0x0B, 0x6A, 0x0B, 0x70, - 0x0B, 0x76, 0x0B, 0x7C, 0x0B, 0x82, 0x0B, 0x88, 0x0B, 0x8E, 0x0B, 0x94, 0x0B, 0x9A, 0x0B, 0xA0, - 0x0B, 0xA6, 0x0B, 0xAC, 0x0B, 0xB2, 0x0B, 0xB8, 0x0B, 0xBE, 0x0B, 0xC4, 0x0B, 0xCA, 0x0B, 0xD0, - 0x0B, 0xD6, 0x0B, 0xDC, 0x0B, 0xE2, 0x0B, 0xE8, 0x0B, 0xEE, 0x0B, 0xF4, 0x0B, 0xFA, 0x0C, 0x00, - 0x0C, 0x06, 0x0C, 0x0C, 0x0C, 0x12, 0x0C, 0x18, 0x0C, 0x1E, 0x0C, 0x24, 0x0C, 0x2A, 0x0C, 0x30, - 0x0C, 0x36, 0x0C, 0x3C, 0x0C, 0x42, 0x0C, 0x48, 0x0C, 0x4E, 0x0C, 0x54, 0x0C, 0x5A, 0x0C, 0x60, - 0x0C, 0x66, 0x0C, 0x6C, 0x0C, 0x72, 0x0C, 0x78, 0x0C, 0x7E, 0x0C, 0x84, 0x0C, 0x8A, 0x0C, 0x90, - 0x0C, 0x96, 0x0C, 0x9C, 0x0C, 0xA2, 0x0C, 0xA8, 0x0C, 0xAE, 0x0C, 0xB4, 0x0C, 0xBA, 0x0C, 0xC0, - 0x0C, 0xC6, 0x0C, 0xCC, 0x0C, 0xD2, 0x0C, 0xD8, 0x0C, 0xDE, 0x0C, 0xE4, 0x0C, 0xEA, 0x0C, 0xF0, - 0x0C, 0xF6, 0x0C, 0xFC, 0x0D, 0x02, 0x0D, 0x08, 0x0D, 0x0E, 0x0D, 0x14, 0x0D, 0x1A, 0x0D, 0x20, - 0x0D, 0x26, 0x0D, 0x2C, 0x0D, 0x32, 0x0D, 0x38, 0x0D, 0x3E, 0x0D, 0x44, 0x0D, 0x4A, 0x0D, 0x50, - 0x0D, 0x56, 0x0D, 0x5C, 0x0D, 0x62, 0x0D, 0x68, 0x0D, 0x6E, 0x0D, 0x74, 0x0D, 0x7A, 0x0D, 0x80, - 0x0D, 0x86, 0x0D, 0x8C, 0x0D, 0x92, 0x0D, 0x98, 0x0D, 0x9E, 0x0D, 0xA4, 0x0D, 0xAA, 0x0D, 0xB0, - 0x0D, 0xB6, 0x0D, 0xBC, 0x0D, 0xC2, 0x0D, 0xC8, 0x0D, 0xCE, 0x0D, 0xD4, 0x0D, 0xDA, 0x0D, 0xE0, - 0x0D, 0xE6, 0x0D, 0xEC, 0x0D, 0xF2, 0x0D, 0xF8, 0x0D, 0xFE, 0x0E, 0x04, 0x0E, 0x0A, 0x0E, 0x10, - 0x0E, 0x16, 0x0E, 0x1C, 0x0E, 0x22, 0x0E, 0x28, 0x0E, 0x2E, 0x0E, 0x34, 0x0E, 0x3A, 0x0E, 0x40, - 0x0E, 0x46, 0x0E, 0x4C, 0x0E, 0x52, 0x0E, 0x58, 0x0E, 0x5E, 0x0E, 0x64, 0x0E, 0x6A, 0x0E, 0x70, - 0x0E, 0x76, 0x0E, 0x7C, 0x0E, 0x82, 0x0E, 0x88, 0x0E, 0x8E, 0x0E, 0x94, 0x0E, 0x9A, 0x0E, 0xA0, - 0x0E, 0xA6, 0x0E, 0xAC, 0x0E, 0xB2, 0x0E, 0xB8, 0x0E, 0xBE, 0x0E, 0xC4, 0x0E, 0xCA, 0x0E, 0xD0, - 0x0E, 0xD6, 0x0E, 0xDC, 0x0E, 0xE2, 0x0E, 0xE8, 0x0E, 0xEE, 0x0E, 0xF4, 0x0E, 0xFA, 0x0F, 0x00, - 0x0F, 0x06, 0x0F, 0x0C, 0x0F, 0x12, 0x0F, 0x18, 0x0F, 0x1E, 0x0F, 0x24, 0x0F, 0x2A, 0x0F, 0x30, - 0x0F, 0x36, 0x0F, 0x3C, 0x0F, 0x42, 0x0F, 0x48, 0x0F, 0x4E, 0x0F, 0x54, 0x0F, 0x5A, 0x0F, 0x60, - 0x0F, 0x66, 0x0F, 0x6C, 0x0F, 0x72, 0x0F, 0x78, 0x0F, 0x7E, 0x0F, 0x84, 0x0F, 0x8A, 0x0F, 0x90, - 0x00, 0x02, 0x00, 0x41, 0x03, 0x00, 0x00, 0x02, 0x00, 0x41, 0x03, 0x01, 0x00, 0x02, 0x00, 0x41, - 0x03, 0x02, 0x00, 0x02, 0x00, 0x41, 0x03, 0x03, 0x00, 0x02, 0x00, 0x41, 0x03, 0x08, 0x00, 0x02, - 0x00, 0x41, 0x03, 0x0A, 0x00, 0x02, 0x00, 0x43, 0x03, 0x27, 0x00, 0x02, 0x00, 0x45, 0x03, 0x00, - 0x00, 0x02, 0x00, 0x45, 0x03, 0x01, 0x00, 0x02, 0x00, 0x45, 0x03, 0x02, 0x00, 0x02, 0x00, 0x45, - 0x03, 0x08, 0x00, 0x02, 0x00, 0x49, 0x03, 0x00, 0x00, 0x02, 0x00, 0x49, 0x03, 0x01, 0x00, 0x02, - 0x00, 0x49, 0x03, 0x02, 0x00, 0x02, 0x00, 0x49, 0x03, 0x08, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x03, - 0x00, 0x02, 0x00, 0x4F, 0x03, 0x00, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x01, 0x00, 0x02, 0x00, 0x4F, - 0x03, 0x02, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x03, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x08, 0x00, 0x02, - 0x00, 0x55, 0x03, 0x00, 0x00, 0x02, 0x00, 0x55, 0x03, 0x01, 0x00, 0x02, 0x00, 0x55, 0x03, 0x02, - 0x00, 0x02, 0x00, 0x55, 0x03, 0x08, 0x00, 0x02, 0x00, 0x59, 0x03, 0x01, 0x00, 0x02, 0x00, 0x61, - 0x03, 0x00, 0x00, 0x02, 0x00, 0x61, 0x03, 0x01, 0x00, 0x02, 0x00, 0x61, 0x03, 0x02, 0x00, 0x02, - 0x00, 0x61, 0x03, 0x03, 0x00, 0x02, 0x00, 0x61, 0x03, 0x08, 0x00, 0x02, 0x00, 0x61, 0x03, 0x0A, - 0x00, 0x02, 0x00, 0x63, 0x03, 0x27, 0x00, 0x02, 0x00, 0x65, 0x03, 0x00, 0x00, 0x02, 0x00, 0x65, - 0x03, 0x01, 0x00, 0x02, 0x00, 0x65, 0x03, 0x02, 0x00, 0x02, 0x00, 0x65, 0x03, 0x08, 0x00, 0x02, - 0x00, 0x69, 0x03, 0x00, 0x00, 0x02, 0x00, 0x69, 0x03, 0x01, 0x00, 0x02, 0x00, 0x69, 0x03, 0x02, - 0x00, 0x02, 0x00, 0x69, 0x03, 0x08, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x03, 0x00, 0x02, 0x00, 0x6F, - 0x03, 0x00, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x01, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x02, 0x00, 0x02, - 0x00, 0x6F, 0x03, 0x03, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x08, 0x00, 0x02, 0x00, 0x75, 0x03, 0x00, - 0x00, 0x02, 0x00, 0x75, 0x03, 0x01, 0x00, 0x02, 0x00, 0x75, 0x03, 0x02, 0x00, 0x02, 0x00, 0x75, - 0x03, 0x08, 0x00, 0x02, 0x00, 0x79, 0x03, 0x01, 0x00, 0x02, 0x00, 0x79, 0x03, 0x08, 0x00, 0x02, - 0x00, 0x41, 0x03, 0x04, 0x00, 0x02, 0x00, 0x61, 0x03, 0x04, 0x00, 0x02, 0x00, 0x41, 0x03, 0x06, - 0x00, 0x02, 0x00, 0x61, 0x03, 0x06, 0x00, 0x02, 0x00, 0x41, 0x03, 0x28, 0x00, 0x02, 0x00, 0x61, - 0x03, 0x28, 0x00, 0x02, 0x00, 0x43, 0x03, 0x01, 0x00, 0x02, 0x00, 0x63, 0x03, 0x01, 0x00, 0x02, - 0x00, 0x43, 0x03, 0x02, 0x00, 0x02, 0x00, 0x63, 0x03, 0x02, 0x00, 0x02, 0x00, 0x43, 0x03, 0x07, - 0x00, 0x02, 0x00, 0x63, 0x03, 0x07, 0x00, 0x02, 0x00, 0x43, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x63, - 0x03, 0x0C, 0x00, 0x02, 0x00, 0x44, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x64, 0x03, 0x0C, 0x00, 0x02, - 0x00, 0x45, 0x03, 0x04, 0x00, 0x02, 0x00, 0x65, 0x03, 0x04, 0x00, 0x02, 0x00, 0x45, 0x03, 0x06, - 0x00, 0x02, 0x00, 0x65, 0x03, 0x06, 0x00, 0x02, 0x00, 0x45, 0x03, 0x07, 0x00, 0x02, 0x00, 0x65, - 0x03, 0x07, 0x00, 0x02, 0x00, 0x45, 0x03, 0x28, 0x00, 0x02, 0x00, 0x65, 0x03, 0x28, 0x00, 0x02, - 0x00, 0x45, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x65, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x47, 0x03, 0x02, - 0x00, 0x02, 0x00, 0x67, 0x03, 0x02, 0x00, 0x02, 0x00, 0x47, 0x03, 0x06, 0x00, 0x02, 0x00, 0x67, - 0x03, 0x06, 0x00, 0x02, 0x00, 0x47, 0x03, 0x07, 0x00, 0x02, 0x00, 0x67, 0x03, 0x07, 0x00, 0x02, - 0x00, 0x47, 0x03, 0x27, 0x00, 0x02, 0x00, 0x67, 0x03, 0x27, 0x00, 0x02, 0x00, 0x48, 0x03, 0x02, - 0x00, 0x02, 0x00, 0x68, 0x03, 0x02, 0x00, 0x02, 0x00, 0x49, 0x03, 0x03, 0x00, 0x02, 0x00, 0x69, - 0x03, 0x03, 0x00, 0x02, 0x00, 0x49, 0x03, 0x04, 0x00, 0x02, 0x00, 0x69, 0x03, 0x04, 0x00, 0x02, - 0x00, 0x49, 0x03, 0x06, 0x00, 0x02, 0x00, 0x69, 0x03, 0x06, 0x00, 0x02, 0x00, 0x49, 0x03, 0x28, - 0x00, 0x02, 0x00, 0x69, 0x03, 0x28, 0x00, 0x02, 0x00, 0x49, 0x03, 0x07, 0x00, 0x02, 0x00, 0x4A, - 0x03, 0x02, 0x00, 0x02, 0x00, 0x6A, 0x03, 0x02, 0x00, 0x02, 0x00, 0x4B, 0x03, 0x27, 0x00, 0x02, - 0x00, 0x6B, 0x03, 0x27, 0x00, 0x02, 0x00, 0x4C, 0x03, 0x01, 0x00, 0x02, 0x00, 0x6C, 0x03, 0x01, - 0x00, 0x02, 0x00, 0x4C, 0x03, 0x27, 0x00, 0x02, 0x00, 0x6C, 0x03, 0x27, 0x00, 0x02, 0x00, 0x4C, - 0x03, 0x0C, 0x00, 0x02, 0x00, 0x6C, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x01, 0x00, 0x02, - 0x00, 0x6E, 0x03, 0x01, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x27, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x27, - 0x00, 0x02, 0x00, 0x4E, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x4F, - 0x03, 0x04, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x04, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x06, 0x00, 0x02, - 0x00, 0x6F, 0x03, 0x06, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x0B, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x0B, - 0x00, 0x02, 0x00, 0x52, 0x03, 0x01, 0x00, 0x02, 0x00, 0x72, 0x03, 0x01, 0x00, 0x02, 0x00, 0x52, - 0x03, 0x27, 0x00, 0x02, 0x00, 0x72, 0x03, 0x27, 0x00, 0x02, 0x00, 0x52, 0x03, 0x0C, 0x00, 0x02, - 0x00, 0x72, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x53, 0x03, 0x01, 0x00, 0x02, 0x00, 0x73, 0x03, 0x01, - 0x00, 0x02, 0x00, 0x53, 0x03, 0x02, 0x00, 0x02, 0x00, 0x73, 0x03, 0x02, 0x00, 0x02, 0x00, 0x53, - 0x03, 0x27, 0x00, 0x02, 0x00, 0x73, 0x03, 0x27, 0x00, 0x02, 0x00, 0x53, 0x03, 0x0C, 0x00, 0x02, - 0x00, 0x73, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x54, 0x03, 0x27, 0x00, 0x02, 0x00, 0x74, 0x03, 0x27, - 0x00, 0x02, 0x00, 0x54, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x74, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x55, - 0x03, 0x03, 0x00, 0x02, 0x00, 0x75, 0x03, 0x03, 0x00, 0x02, 0x00, 0x55, 0x03, 0x04, 0x00, 0x02, - 0x00, 0x75, 0x03, 0x04, 0x00, 0x02, 0x00, 0x55, 0x03, 0x06, 0x00, 0x02, 0x00, 0x75, 0x03, 0x06, - 0x00, 0x02, 0x00, 0x55, 0x03, 0x0A, 0x00, 0x02, 0x00, 0x75, 0x03, 0x0A, 0x00, 0x02, 0x00, 0x55, - 0x03, 0x0B, 0x00, 0x02, 0x00, 0x75, 0x03, 0x0B, 0x00, 0x02, 0x00, 0x55, 0x03, 0x28, 0x00, 0x02, - 0x00, 0x75, 0x03, 0x28, 0x00, 0x02, 0x00, 0x57, 0x03, 0x02, 0x00, 0x02, 0x00, 0x77, 0x03, 0x02, - 0x00, 0x02, 0x00, 0x59, 0x03, 0x02, 0x00, 0x02, 0x00, 0x79, 0x03, 0x02, 0x00, 0x02, 0x00, 0x59, - 0x03, 0x08, 0x00, 0x02, 0x00, 0x5A, 0x03, 0x01, 0x00, 0x02, 0x00, 0x7A, 0x03, 0x01, 0x00, 0x02, - 0x00, 0x5A, 0x03, 0x07, 0x00, 0x02, 0x00, 0x7A, 0x03, 0x07, 0x00, 0x02, 0x00, 0x5A, 0x03, 0x0C, - 0x00, 0x02, 0x00, 0x7A, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x1B, 0x00, 0x02, 0x00, 0x6F, - 0x03, 0x1B, 0x00, 0x02, 0x00, 0x55, 0x03, 0x1B, 0x00, 0x02, 0x00, 0x75, 0x03, 0x1B, 0x00, 0x02, - 0x00, 0x41, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x61, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x49, 0x03, 0x0C, - 0x00, 0x02, 0x00, 0x69, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x6F, - 0x03, 0x0C, 0x00, 0x02, 0x00, 0x55, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x75, 0x03, 0x0C, 0x00, 0x02, - 0x00, 0xDC, 0x03, 0x04, 0x00, 0x02, 0x00, 0xFC, 0x03, 0x04, 0x00, 0x02, 0x00, 0x55, 0x03, 0x44, - 0x00, 0x02, 0x00, 0x75, 0x03, 0x44, 0x00, 0x02, 0x00, 0xDC, 0x03, 0x0C, 0x00, 0x02, 0x00, 0xFC, - 0x03, 0x0C, 0x00, 0x02, 0x00, 0xDC, 0x03, 0x00, 0x00, 0x02, 0x00, 0xFC, 0x03, 0x00, 0x00, 0x02, - 0x00, 0xC4, 0x03, 0x04, 0x00, 0x02, 0x00, 0xE4, 0x03, 0x04, 0x00, 0x02, 0x02, 0x26, 0x03, 0x04, - 0x00, 0x02, 0x02, 0x27, 0x03, 0x04, 0x00, 0x02, 0x00, 0xC6, 0x03, 0x04, 0x00, 0x02, 0x00, 0xE6, - 0x03, 0x04, 0x00, 0x02, 0x00, 0x47, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x67, 0x03, 0x0C, 0x00, 0x02, - 0x00, 0x4B, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x6B, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x28, - 0x00, 0x02, 0x00, 0x6F, 0x03, 0x28, 0x00, 0x02, 0x01, 0x4C, 0x03, 0x28, 0x00, 0x02, 0x01, 0x4D, - 0x03, 0x28, 0x00, 0x02, 0x01, 0xB7, 0x03, 0x0C, 0x00, 0x02, 0x02, 0x92, 0x03, 0x0C, 0x00, 0x02, - 0x00, 0x6A, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x47, 0x03, 0x01, 0x00, 0x02, 0x00, 0x67, 0x03, 0x01, - 0x00, 0x02, 0x00, 0x4E, 0x03, 0x00, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x00, 0x00, 0x02, 0x00, 0xC5, - 0x03, 0x01, 0x00, 0x02, 0x00, 0xE5, 0x03, 0x01, 0x00, 0x02, 0x00, 0xC6, 0x03, 0x01, 0x00, 0x02, - 0x00, 0xE6, 0x03, 0x01, 0x00, 0x02, 0x00, 0xD8, 0x03, 0x01, 0x00, 0x02, 0x00, 0xF8, 0x03, 0x01, - 0x00, 0x02, 0x00, 0x41, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x61, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x41, - 0x03, 0x11, 0x00, 0x02, 0x00, 0x61, 0x03, 0x11, 0x00, 0x02, 0x00, 0x45, 0x03, 0x0F, 0x00, 0x02, - 0x00, 0x65, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x45, 0x03, 0x11, 0x00, 0x02, 0x00, 0x65, 0x03, 0x11, - 0x00, 0x02, 0x00, 0x49, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x69, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x49, - 0x03, 0x11, 0x00, 0x02, 0x00, 0x69, 0x03, 0x11, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x0F, 0x00, 0x02, - 0x00, 0x6F, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x11, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x11, - 0x00, 0x02, 0x00, 0x52, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x72, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x52, - 0x03, 0x11, 0x00, 0x02, 0x00, 0x72, 0x03, 0x11, 0x00, 0x02, 0x00, 0x55, 0x03, 0x0F, 0x00, 0x02, - 0x00, 0x75, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x55, 0x03, 0x11, 0x00, 0x02, 0x00, 0x75, 0x03, 0x11, - 0x00, 0x02, 0x00, 0x53, 0x03, 0x26, 0x00, 0x02, 0x00, 0x73, 0x03, 0x26, 0x00, 0x02, 0x00, 0x54, - 0x03, 0x26, 0x00, 0x02, 0x00, 0x74, 0x03, 0x26, 0x00, 0x02, 0x00, 0x48, 0x03, 0x0C, 0x00, 0x02, - 0x00, 0x68, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x41, 0x03, 0x07, 0x00, 0x02, 0x00, 0x61, 0x03, 0x07, - 0x00, 0x02, 0x00, 0x45, 0x03, 0x27, 0x00, 0x02, 0x00, 0x65, 0x03, 0x27, 0x00, 0x02, 0x00, 0xD6, - 0x03, 0x04, 0x00, 0x02, 0x00, 0xF6, 0x03, 0x04, 0x00, 0x02, 0x00, 0xD5, 0x03, 0x04, 0x00, 0x02, - 0x00, 0xF5, 0x03, 0x04, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x07, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x07, - 0x00, 0x02, 0x02, 0x2E, 0x03, 0x04, 0x00, 0x02, 0x02, 0x2F, 0x03, 0x04, 0x00, 0x02, 0x00, 0x59, - 0x03, 0x04, 0x00, 0x02, 0x00, 0x79, 0x03, 0x04, 0x00, 0x02, 0x00, 0x41, 0x03, 0x25, 0x00, 0x02, - 0x00, 0x61, 0x03, 0x25, 0x00, 0x02, 0x00, 0x42, 0x03, 0x07, 0x00, 0x02, 0x00, 0x62, 0x03, 0x07, - 0x00, 0x02, 0x00, 0x42, 0x03, 0x23, 0x00, 0x02, 0x00, 0x62, 0x03, 0x23, 0x00, 0x02, 0x00, 0x42, - 0x03, 0x31, 0x00, 0x02, 0x00, 0x62, 0x03, 0x31, 0x00, 0x02, 0x00, 0xC7, 0x03, 0x01, 0x00, 0x02, - 0x00, 0xE7, 0x03, 0x01, 0x00, 0x02, 0x00, 0x44, 0x03, 0x07, 0x00, 0x02, 0x00, 0x64, 0x03, 0x07, - 0x00, 0x02, 0x00, 0x44, 0x03, 0x23, 0x00, 0x02, 0x00, 0x64, 0x03, 0x23, 0x00, 0x02, 0x00, 0x44, - 0x03, 0x31, 0x00, 0x02, 0x00, 0x64, 0x03, 0x31, 0x00, 0x02, 0x00, 0x44, 0x03, 0x27, 0x00, 0x02, - 0x00, 0x64, 0x03, 0x27, 0x00, 0x02, 0x00, 0x44, 0x03, 0x2D, 0x00, 0x02, 0x00, 0x64, 0x03, 0x2D, - 0x00, 0x02, 0x01, 0x12, 0x03, 0x00, 0x00, 0x02, 0x01, 0x13, 0x03, 0x00, 0x00, 0x02, 0x01, 0x12, - 0x03, 0x01, 0x00, 0x02, 0x01, 0x13, 0x03, 0x01, 0x00, 0x02, 0x00, 0x45, 0x03, 0x2D, 0x00, 0x02, - 0x00, 0x65, 0x03, 0x2D, 0x00, 0x02, 0x00, 0x45, 0x03, 0x30, 0x00, 0x02, 0x00, 0x65, 0x03, 0x30, - 0x00, 0x02, 0x01, 0x14, 0x03, 0x27, 0x00, 0x02, 0x01, 0x15, 0x03, 0x27, 0x00, 0x02, 0x00, 0x46, - 0x03, 0x07, 0x00, 0x02, 0x00, 0x66, 0x03, 0x07, 0x00, 0x02, 0x00, 0x47, 0x03, 0x04, 0x00, 0x02, - 0x00, 0x67, 0x03, 0x04, 0x00, 0x02, 0x00, 0x48, 0x03, 0x07, 0x00, 0x02, 0x00, 0x68, 0x03, 0x07, - 0x00, 0x02, 0x00, 0x48, 0x03, 0x23, 0x00, 0x02, 0x00, 0x68, 0x03, 0x23, 0x00, 0x02, 0x00, 0x48, - 0x03, 0x08, 0x00, 0x02, 0x00, 0x68, 0x03, 0x08, 0x00, 0x02, 0x00, 0x48, 0x03, 0x27, 0x00, 0x02, - 0x00, 0x68, 0x03, 0x27, 0x00, 0x02, 0x00, 0x48, 0x03, 0x2E, 0x00, 0x02, 0x00, 0x68, 0x03, 0x2E, - 0x00, 0x02, 0x00, 0x49, 0x03, 0x30, 0x00, 0x02, 0x00, 0x69, 0x03, 0x30, 0x00, 0x02, 0x00, 0x49, - 0x03, 0x44, 0x00, 0x02, 0x00, 0x69, 0x03, 0x44, 0x00, 0x02, 0x00, 0x4B, 0x03, 0x01, 0x00, 0x02, - 0x00, 0x6B, 0x03, 0x01, 0x00, 0x02, 0x00, 0x4B, 0x03, 0x23, 0x00, 0x02, 0x00, 0x6B, 0x03, 0x23, - 0x00, 0x02, 0x00, 0x4B, 0x03, 0x31, 0x00, 0x02, 0x00, 0x6B, 0x03, 0x31, 0x00, 0x02, 0x00, 0x4C, - 0x03, 0x23, 0x00, 0x02, 0x00, 0x6C, 0x03, 0x23, 0x00, 0x02, 0x1E, 0x36, 0x03, 0x04, 0x00, 0x02, - 0x1E, 0x37, 0x03, 0x04, 0x00, 0x02, 0x00, 0x4C, 0x03, 0x31, 0x00, 0x02, 0x00, 0x6C, 0x03, 0x31, - 0x00, 0x02, 0x00, 0x4C, 0x03, 0x2D, 0x00, 0x02, 0x00, 0x6C, 0x03, 0x2D, 0x00, 0x02, 0x00, 0x4D, - 0x03, 0x01, 0x00, 0x02, 0x00, 0x6D, 0x03, 0x01, 0x00, 0x02, 0x00, 0x4D, 0x03, 0x07, 0x00, 0x02, - 0x00, 0x6D, 0x03, 0x07, 0x00, 0x02, 0x00, 0x4D, 0x03, 0x23, 0x00, 0x02, 0x00, 0x6D, 0x03, 0x23, - 0x00, 0x02, 0x00, 0x4E, 0x03, 0x07, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x07, 0x00, 0x02, 0x00, 0x4E, - 0x03, 0x23, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x23, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x31, 0x00, 0x02, - 0x00, 0x6E, 0x03, 0x31, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x2D, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x2D, - 0x00, 0x02, 0x00, 0xD5, 0x03, 0x01, 0x00, 0x02, 0x00, 0xF5, 0x03, 0x01, 0x00, 0x02, 0x00, 0xD5, - 0x03, 0x08, 0x00, 0x02, 0x00, 0xF5, 0x03, 0x08, 0x00, 0x02, 0x01, 0x4C, 0x03, 0x00, 0x00, 0x02, - 0x01, 0x4D, 0x03, 0x00, 0x00, 0x02, 0x01, 0x4C, 0x03, 0x01, 0x00, 0x02, 0x01, 0x4D, 0x03, 0x01, - 0x00, 0x02, 0x00, 0x50, 0x03, 0x01, 0x00, 0x02, 0x00, 0x70, 0x03, 0x01, 0x00, 0x02, 0x00, 0x50, - 0x03, 0x07, 0x00, 0x02, 0x00, 0x70, 0x03, 0x07, 0x00, 0x02, 0x00, 0x52, 0x03, 0x07, 0x00, 0x02, - 0x00, 0x72, 0x03, 0x07, 0x00, 0x02, 0x00, 0x52, 0x03, 0x23, 0x00, 0x02, 0x00, 0x72, 0x03, 0x23, - 0x00, 0x02, 0x1E, 0x5A, 0x03, 0x04, 0x00, 0x02, 0x1E, 0x5B, 0x03, 0x04, 0x00, 0x02, 0x00, 0x52, - 0x03, 0x31, 0x00, 0x02, 0x00, 0x72, 0x03, 0x31, 0x00, 0x02, 0x00, 0x53, 0x03, 0x07, 0x00, 0x02, - 0x00, 0x73, 0x03, 0x07, 0x00, 0x02, 0x00, 0x53, 0x03, 0x23, 0x00, 0x02, 0x00, 0x73, 0x03, 0x23, - 0x00, 0x02, 0x01, 0x5A, 0x03, 0x07, 0x00, 0x02, 0x01, 0x5B, 0x03, 0x07, 0x00, 0x02, 0x01, 0x60, - 0x03, 0x07, 0x00, 0x02, 0x01, 0x61, 0x03, 0x07, 0x00, 0x02, 0x1E, 0x60, 0x03, 0x23, 0x00, 0x02, - 0x1E, 0x61, 0x03, 0x23, 0x00, 0x02, 0x00, 0x54, 0x03, 0x07, 0x00, 0x02, 0x00, 0x74, 0x03, 0x07, - 0x00, 0x02, 0x00, 0x54, 0x03, 0x23, 0x00, 0x02, 0x00, 0x74, 0x03, 0x23, 0x00, 0x02, 0x00, 0x54, - 0x03, 0x31, 0x00, 0x02, 0x00, 0x74, 0x03, 0x31, 0x00, 0x02, 0x00, 0x54, 0x03, 0x2D, 0x00, 0x02, - 0x00, 0x74, 0x03, 0x2D, 0x00, 0x02, 0x00, 0x55, 0x03, 0x24, 0x00, 0x02, 0x00, 0x75, 0x03, 0x24, - 0x00, 0x02, 0x00, 0x55, 0x03, 0x30, 0x00, 0x02, 0x00, 0x75, 0x03, 0x30, 0x00, 0x02, 0x00, 0x55, - 0x03, 0x2D, 0x00, 0x02, 0x00, 0x75, 0x03, 0x2D, 0x00, 0x02, 0x01, 0x68, 0x03, 0x01, 0x00, 0x02, - 0x01, 0x69, 0x03, 0x01, 0x00, 0x02, 0x01, 0x6A, 0x03, 0x08, 0x00, 0x02, 0x01, 0x6B, 0x03, 0x08, - 0x00, 0x02, 0x00, 0x56, 0x03, 0x03, 0x00, 0x02, 0x00, 0x76, 0x03, 0x03, 0x00, 0x02, 0x00, 0x56, - 0x03, 0x23, 0x00, 0x02, 0x00, 0x76, 0x03, 0x23, 0x00, 0x02, 0x00, 0x57, 0x03, 0x00, 0x00, 0x02, - 0x00, 0x77, 0x03, 0x00, 0x00, 0x02, 0x00, 0x57, 0x03, 0x01, 0x00, 0x02, 0x00, 0x77, 0x03, 0x01, - 0x00, 0x02, 0x00, 0x57, 0x03, 0x08, 0x00, 0x02, 0x00, 0x77, 0x03, 0x08, 0x00, 0x02, 0x00, 0x57, - 0x03, 0x07, 0x00, 0x02, 0x00, 0x77, 0x03, 0x07, 0x00, 0x02, 0x00, 0x57, 0x03, 0x23, 0x00, 0x02, - 0x00, 0x77, 0x03, 0x23, 0x00, 0x02, 0x00, 0x58, 0x03, 0x07, 0x00, 0x02, 0x00, 0x78, 0x03, 0x07, - 0x00, 0x02, 0x00, 0x58, 0x03, 0x08, 0x00, 0x02, 0x00, 0x78, 0x03, 0x08, 0x00, 0x02, 0x00, 0x59, - 0x03, 0x07, 0x00, 0x02, 0x00, 0x79, 0x03, 0x07, 0x00, 0x02, 0x00, 0x5A, 0x03, 0x02, 0x00, 0x02, - 0x00, 0x7A, 0x03, 0x02, 0x00, 0x02, 0x00, 0x5A, 0x03, 0x23, 0x00, 0x02, 0x00, 0x7A, 0x03, 0x23, - 0x00, 0x02, 0x00, 0x5A, 0x03, 0x31, 0x00, 0x02, 0x00, 0x7A, 0x03, 0x31, 0x00, 0x02, 0x00, 0x68, - 0x03, 0x31, 0x00, 0x02, 0x00, 0x74, 0x03, 0x08, 0x00, 0x02, 0x00, 0x77, 0x03, 0x0A, 0x00, 0x02, - 0x00, 0x79, 0x03, 0x0A, 0x00, 0x02, 0x01, 0x7F, 0x03, 0x07, 0x00, 0x02, 0x00, 0x41, 0x03, 0x23, - 0x00, 0x02, 0x00, 0x61, 0x03, 0x23, 0x00, 0x02, 0x00, 0x41, 0x03, 0x09, 0x00, 0x02, 0x00, 0x61, - 0x03, 0x09, 0x00, 0x02, 0x00, 0xC2, 0x03, 0x01, 0x00, 0x02, 0x00, 0xE2, 0x03, 0x01, 0x00, 0x02, - 0x00, 0xC2, 0x03, 0x00, 0x00, 0x02, 0x00, 0xE2, 0x03, 0x00, 0x00, 0x02, 0x00, 0xC2, 0x03, 0x09, - 0x00, 0x02, 0x00, 0xE2, 0x03, 0x09, 0x00, 0x02, 0x00, 0xC2, 0x03, 0x03, 0x00, 0x02, 0x00, 0xE2, - 0x03, 0x03, 0x00, 0x02, 0x00, 0xC2, 0x03, 0x23, 0x00, 0x02, 0x00, 0xE2, 0x03, 0x23, 0x00, 0x02, - 0x01, 0x02, 0x03, 0x01, 0x00, 0x02, 0x01, 0x03, 0x03, 0x01, 0x00, 0x02, 0x01, 0x02, 0x03, 0x00, - 0x00, 0x02, 0x01, 0x03, 0x03, 0x00, 0x00, 0x02, 0x01, 0x02, 0x03, 0x09, 0x00, 0x02, 0x01, 0x03, - 0x03, 0x09, 0x00, 0x02, 0x01, 0x02, 0x03, 0x03, 0x00, 0x02, 0x01, 0x03, 0x03, 0x03, 0x00, 0x02, - 0x01, 0x02, 0x03, 0x23, 0x00, 0x02, 0x01, 0x03, 0x03, 0x23, 0x00, 0x02, 0x00, 0x45, 0x03, 0x23, - 0x00, 0x02, 0x00, 0x65, 0x03, 0x23, 0x00, 0x02, 0x00, 0x45, 0x03, 0x09, 0x00, 0x02, 0x00, 0x65, - 0x03, 0x09, 0x00, 0x02, 0x00, 0x45, 0x03, 0x03, 0x00, 0x02, 0x00, 0x65, 0x03, 0x03, 0x00, 0x02, - 0x00, 0xCA, 0x03, 0x01, 0x00, 0x02, 0x00, 0xEA, 0x03, 0x01, 0x00, 0x02, 0x00, 0xCA, 0x03, 0x00, - 0x00, 0x02, 0x00, 0xEA, 0x03, 0x00, 0x00, 0x02, 0x00, 0xCA, 0x03, 0x09, 0x00, 0x02, 0x00, 0xEA, - 0x03, 0x09, 0x00, 0x02, 0x00, 0xCA, 0x03, 0x03, 0x00, 0x02, 0x00, 0xEA, 0x03, 0x03, 0x00, 0x02, - 0x00, 0xCA, 0x03, 0x23, 0x00, 0x02, 0x00, 0xEA, 0x03, 0x23, 0x00, 0x02, 0x00, 0x49, 0x03, 0x09, - 0x00, 0x02, 0x00, 0x69, 0x03, 0x09, 0x00, 0x02, 0x00, 0x49, 0x03, 0x23, 0x00, 0x02, 0x00, 0x69, - 0x03, 0x23, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x23, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x23, 0x00, 0x02, - 0x00, 0x4F, 0x03, 0x09, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x09, 0x00, 0x02, 0x00, 0xD4, 0x03, 0x01, - 0x00, 0x02, 0x00, 0xF4, 0x03, 0x01, 0x00, 0x02, 0x00, 0xD4, 0x03, 0x00, 0x00, 0x02, 0x00, 0xF4, - 0x03, 0x00, 0x00, 0x02, 0x00, 0xD4, 0x03, 0x09, 0x00, 0x02, 0x00, 0xF4, 0x03, 0x09, 0x00, 0x02, - 0x00, 0xD4, 0x03, 0x03, 0x00, 0x02, 0x00, 0xF4, 0x03, 0x03, 0x00, 0x02, 0x00, 0xD4, 0x03, 0x23, - 0x00, 0x02, 0x00, 0xF4, 0x03, 0x23, 0x00, 0x02, 0x00, 0xD3, 0x03, 0x1B, 0x00, 0x02, 0x00, 0xF3, - 0x03, 0x1B, 0x00, 0x02, 0x00, 0xD2, 0x03, 0x1B, 0x00, 0x02, 0x00, 0xF2, 0x03, 0x1B, 0x00, 0x02, - 0x01, 0xA0, 0x03, 0x09, 0x00, 0x02, 0x01, 0xA1, 0x03, 0x09, 0x00, 0x02, 0x00, 0xD5, 0x03, 0x1B, - 0x00, 0x02, 0x00, 0xF5, 0x03, 0x1B, 0x00, 0x02, 0x01, 0xA0, 0x03, 0x23, 0x00, 0x02, 0x01, 0xA1, - 0x03, 0x23, 0x00, 0x02, 0x00, 0x55, 0x03, 0x23, 0x00, 0x02, 0x00, 0x75, 0x03, 0x23, 0x00, 0x02, - 0x00, 0x55, 0x03, 0x09, 0x00, 0x02, 0x00, 0x75, 0x03, 0x09, 0x00, 0x02, 0x00, 0xDA, 0x03, 0x1B, - 0x00, 0x02, 0x00, 0xFA, 0x03, 0x1B, 0x00, 0x02, 0x00, 0xD9, 0x03, 0x1B, 0x00, 0x02, 0x00, 0xF9, - 0x03, 0x1B, 0x00, 0x02, 0x01, 0xAF, 0x03, 0x09, 0x00, 0x02, 0x01, 0xB0, 0x03, 0x09, 0x00, 0x02, - 0x01, 0x68, 0x03, 0x1B, 0x00, 0x02, 0x01, 0x69, 0x03, 0x1B, 0x00, 0x02, 0x01, 0xAF, 0x03, 0x23, - 0x00, 0x02, 0x01, 0xB0, 0x03, 0x23, 0x00, 0x02, 0x00, 0x59, 0x03, 0x00, 0x00, 0x02, 0x00, 0x79, - 0x03, 0x00, 0x00, 0x02, 0x00, 0x59, 0x03, 0x23, 0x00, 0x02, 0x00, 0x79, 0x03, 0x23, 0x00, 0x02, - 0x00, 0x59, 0x03, 0x09, 0x00, 0x02, 0x00, 0x79, 0x03, 0x09, 0x00, 0x02, 0x00, 0x59, 0x03, 0x03, - 0x00, 0x02, 0x00, 0x79, 0x03, 0x03, 0x00, 0x02, 0x00, 0x41, 0x03, 0x0A, 0x00, 0x01, 0x01, 0xF2, - 0x00, 0xC0, 0x00, 0xC1, 0x00, 0xC2, 0x00, 0xC3, 0x00, 0xC4, 0x00, 0xC5, 0x00, 0xC7, 0x00, 0xC8, - 0x00, 0xC9, 0x00, 0xCA, 0x00, 0xCB, 0x00, 0xCC, 0x00, 0xCD, 0x00, 0xCE, 0x00, 0xCF, 0x00, 0xD1, - 0x00, 0xD2, 0x00, 0xD3, 0x00, 0xD4, 0x00, 0xD5, 0x00, 0xD6, 0x00, 0xD9, 0x00, 0xDA, 0x00, 0xDB, - 0x00, 0xDC, 0x00, 0xDD, 0x00, 0xE0, 0x00, 0xE1, 0x00, 0xE2, 0x00, 0xE3, 0x00, 0xE4, 0x00, 0xE5, - 0x00, 0xE7, 0x00, 0xE8, 0x00, 0xE9, 0x00, 0xEA, 0x00, 0xEB, 0x00, 0xEC, 0x00, 0xED, 0x00, 0xEE, - 0x00, 0xEF, 0x00, 0xF1, 0x00, 0xF2, 0x00, 0xF3, 0x00, 0xF4, 0x00, 0xF5, 0x00, 0xF6, 0x00, 0xF9, - 0x00, 0xFA, 0x00, 0xFB, 0x00, 0xFC, 0x00, 0xFD, 0x00, 0xFF, 0x01, 0x00, 0x01, 0x01, 0x01, 0x02, - 0x01, 0x03, 0x01, 0x04, 0x01, 0x05, 0x01, 0x06, 0x01, 0x07, 0x01, 0x08, 0x01, 0x09, 0x01, 0x0A, - 0x01, 0x0B, 0x01, 0x0C, 0x01, 0x0D, 0x01, 0x0E, 0x01, 0x0F, 0x01, 0x12, 0x01, 0x13, 0x01, 0x14, - 0x01, 0x15, 0x01, 0x16, 0x01, 0x17, 0x01, 0x18, 0x01, 0x19, 0x01, 0x1A, 0x01, 0x1B, 0x01, 0x1C, - 0x01, 0x1D, 0x01, 0x1E, 0x01, 0x1F, 0x01, 0x20, 0x01, 0x21, 0x01, 0x22, 0x01, 0x23, 0x01, 0x24, - 0x01, 0x25, 0x01, 0x28, 0x01, 0x29, 0x01, 0x2A, 0x01, 0x2B, 0x01, 0x2C, 0x01, 0x2D, 0x01, 0x2E, - 0x01, 0x2F, 0x01, 0x30, 0x01, 0x34, 0x01, 0x35, 0x01, 0x36, 0x01, 0x37, 0x01, 0x39, 0x01, 0x3A, - 0x01, 0x3B, 0x01, 0x3C, 0x01, 0x3D, 0x01, 0x3E, 0x01, 0x43, 0x01, 0x44, 0x01, 0x45, 0x01, 0x46, - 0x01, 0x47, 0x01, 0x48, 0x01, 0x4C, 0x01, 0x4D, 0x01, 0x4E, 0x01, 0x4F, 0x01, 0x50, 0x01, 0x51, - 0x01, 0x54, 0x01, 0x55, 0x01, 0x56, 0x01, 0x57, 0x01, 0x58, 0x01, 0x59, 0x01, 0x5A, 0x01, 0x5B, - 0x01, 0x5C, 0x01, 0x5D, 0x01, 0x5E, 0x01, 0x5F, 0x01, 0x60, 0x01, 0x61, 0x01, 0x62, 0x01, 0x63, - 0x01, 0x64, 0x01, 0x65, 0x01, 0x68, 0x01, 0x69, 0x01, 0x6A, 0x01, 0x6B, 0x01, 0x6C, 0x01, 0x6D, - 0x01, 0x6E, 0x01, 0x6F, 0x01, 0x70, 0x01, 0x71, 0x01, 0x72, 0x01, 0x73, 0x01, 0x74, 0x01, 0x75, - 0x01, 0x76, 0x01, 0x77, 0x01, 0x78, 0x01, 0x79, 0x01, 0x7A, 0x01, 0x7B, 0x01, 0x7C, 0x01, 0x7D, - 0x01, 0x7E, 0x01, 0xA0, 0x01, 0xA1, 0x01, 0xAF, 0x01, 0xB0, 0x01, 0xCD, 0x01, 0xCE, 0x01, 0xCF, - 0x01, 0xD0, 0x01, 0xD1, 0x01, 0xD2, 0x01, 0xD3, 0x01, 0xD4, 0x01, 0xD5, 0x01, 0xD6, 0x01, 0xD7, - 0x01, 0xD8, 0x01, 0xD9, 0x01, 0xDA, 0x01, 0xDB, 0x01, 0xDC, 0x01, 0xDE, 0x01, 0xDF, 0x01, 0xE0, - 0x01, 0xE1, 0x01, 0xE2, 0x01, 0xE3, 0x01, 0xE6, 0x01, 0xE7, 0x01, 0xE8, 0x01, 0xE9, 0x01, 0xEA, - 0x01, 0xEB, 0x01, 0xEC, 0x01, 0xED, 0x01, 0xEE, 0x01, 0xEF, 0x01, 0xF0, 0x01, 0xF4, 0x01, 0xF5, - 0x01, 0xF8, 0x01, 0xF9, 0x01, 0xFA, 0x01, 0xFB, 0x01, 0xFC, 0x01, 0xFD, 0x01, 0xFE, 0x01, 0xFF, - 0x02, 0x00, 0x02, 0x01, 0x02, 0x02, 0x02, 0x03, 0x02, 0x04, 0x02, 0x05, 0x02, 0x06, 0x02, 0x07, - 0x02, 0x08, 0x02, 0x09, 0x02, 0x0A, 0x02, 0x0B, 0x02, 0x0C, 0x02, 0x0D, 0x02, 0x0E, 0x02, 0x0F, - 0x02, 0x10, 0x02, 0x11, 0x02, 0x12, 0x02, 0x13, 0x02, 0x14, 0x02, 0x15, 0x02, 0x16, 0x02, 0x17, - 0x02, 0x18, 0x02, 0x19, 0x02, 0x1A, 0x02, 0x1B, 0x02, 0x1E, 0x02, 0x1F, 0x02, 0x26, 0x02, 0x27, - 0x02, 0x28, 0x02, 0x29, 0x02, 0x2A, 0x02, 0x2B, 0x02, 0x2C, 0x02, 0x2D, 0x02, 0x2E, 0x02, 0x2F, - 0x02, 0x30, 0x02, 0x31, 0x02, 0x32, 0x02, 0x33, 0x1E, 0x00, 0x1E, 0x01, 0x1E, 0x02, 0x1E, 0x03, - 0x1E, 0x04, 0x1E, 0x05, 0x1E, 0x06, 0x1E, 0x07, 0x1E, 0x08, 0x1E, 0x09, 0x1E, 0x0A, 0x1E, 0x0B, - 0x1E, 0x0C, 0x1E, 0x0D, 0x1E, 0x0E, 0x1E, 0x0F, 0x1E, 0x10, 0x1E, 0x11, 0x1E, 0x12, 0x1E, 0x13, - 0x1E, 0x14, 0x1E, 0x15, 0x1E, 0x16, 0x1E, 0x17, 0x1E, 0x18, 0x1E, 0x19, 0x1E, 0x1A, 0x1E, 0x1B, - 0x1E, 0x1C, 0x1E, 0x1D, 0x1E, 0x1E, 0x1E, 0x1F, 0x1E, 0x20, 0x1E, 0x21, 0x1E, 0x22, 0x1E, 0x23, - 0x1E, 0x24, 0x1E, 0x25, 0x1E, 0x26, 0x1E, 0x27, 0x1E, 0x28, 0x1E, 0x29, 0x1E, 0x2A, 0x1E, 0x2B, - 0x1E, 0x2C, 0x1E, 0x2D, 0x1E, 0x2E, 0x1E, 0x2F, 0x1E, 0x30, 0x1E, 0x31, 0x1E, 0x32, 0x1E, 0x33, - 0x1E, 0x34, 0x1E, 0x35, 0x1E, 0x36, 0x1E, 0x37, 0x1E, 0x38, 0x1E, 0x39, 0x1E, 0x3A, 0x1E, 0x3B, - 0x1E, 0x3C, 0x1E, 0x3D, 0x1E, 0x3E, 0x1E, 0x3F, 0x1E, 0x40, 0x1E, 0x41, 0x1E, 0x42, 0x1E, 0x43, - 0x1E, 0x44, 0x1E, 0x45, 0x1E, 0x46, 0x1E, 0x47, 0x1E, 0x48, 0x1E, 0x49, 0x1E, 0x4A, 0x1E, 0x4B, - 0x1E, 0x4C, 0x1E, 0x4D, 0x1E, 0x4E, 0x1E, 0x4F, 0x1E, 0x50, 0x1E, 0x51, 0x1E, 0x52, 0x1E, 0x53, - 0x1E, 0x54, 0x1E, 0x55, 0x1E, 0x56, 0x1E, 0x57, 0x1E, 0x58, 0x1E, 0x59, 0x1E, 0x5A, 0x1E, 0x5B, - 0x1E, 0x5C, 0x1E, 0x5D, 0x1E, 0x5E, 0x1E, 0x5F, 0x1E, 0x60, 0x1E, 0x61, 0x1E, 0x62, 0x1E, 0x63, - 0x1E, 0x64, 0x1E, 0x65, 0x1E, 0x66, 0x1E, 0x67, 0x1E, 0x68, 0x1E, 0x69, 0x1E, 0x6A, 0x1E, 0x6B, - 0x1E, 0x6C, 0x1E, 0x6D, 0x1E, 0x6E, 0x1E, 0x6F, 0x1E, 0x70, 0x1E, 0x71, 0x1E, 0x72, 0x1E, 0x73, - 0x1E, 0x74, 0x1E, 0x75, 0x1E, 0x76, 0x1E, 0x77, 0x1E, 0x78, 0x1E, 0x79, 0x1E, 0x7A, 0x1E, 0x7B, - 0x1E, 0x7C, 0x1E, 0x7D, 0x1E, 0x7E, 0x1E, 0x7F, 0x1E, 0x80, 0x1E, 0x81, 0x1E, 0x82, 0x1E, 0x83, - 0x1E, 0x84, 0x1E, 0x85, 0x1E, 0x86, 0x1E, 0x87, 0x1E, 0x88, 0x1E, 0x89, 0x1E, 0x8A, 0x1E, 0x8B, - 0x1E, 0x8C, 0x1E, 0x8D, 0x1E, 0x8E, 0x1E, 0x8F, 0x1E, 0x90, 0x1E, 0x91, 0x1E, 0x92, 0x1E, 0x93, - 0x1E, 0x94, 0x1E, 0x95, 0x1E, 0x96, 0x1E, 0x97, 0x1E, 0x98, 0x1E, 0x99, 0x1E, 0x9B, 0x1E, 0xA0, - 0x1E, 0xA1, 0x1E, 0xA2, 0x1E, 0xA3, 0x1E, 0xA4, 0x1E, 0xA5, 0x1E, 0xA6, 0x1E, 0xA7, 0x1E, 0xA8, - 0x1E, 0xA9, 0x1E, 0xAA, 0x1E, 0xAB, 0x1E, 0xAC, 0x1E, 0xAD, 0x1E, 0xAE, 0x1E, 0xAF, 0x1E, 0xB0, - 0x1E, 0xB1, 0x1E, 0xB2, 0x1E, 0xB3, 0x1E, 0xB4, 0x1E, 0xB5, 0x1E, 0xB6, 0x1E, 0xB7, 0x1E, 0xB8, - 0x1E, 0xB9, 0x1E, 0xBA, 0x1E, 0xBB, 0x1E, 0xBC, 0x1E, 0xBD, 0x1E, 0xBE, 0x1E, 0xBF, 0x1E, 0xC0, - 0x1E, 0xC1, 0x1E, 0xC2, 0x1E, 0xC3, 0x1E, 0xC4, 0x1E, 0xC5, 0x1E, 0xC6, 0x1E, 0xC7, 0x1E, 0xC8, - 0x1E, 0xC9, 0x1E, 0xCA, 0x1E, 0xCB, 0x1E, 0xCC, 0x1E, 0xCD, 0x1E, 0xCE, 0x1E, 0xCF, 0x1E, 0xD0, - 0x1E, 0xD1, 0x1E, 0xD2, 0x1E, 0xD3, 0x1E, 0xD4, 0x1E, 0xD5, 0x1E, 0xD6, 0x1E, 0xD7, 0x1E, 0xD8, - 0x1E, 0xD9, 0x1E, 0xDA, 0x1E, 0xDB, 0x1E, 0xDC, 0x1E, 0xDD, 0x1E, 0xDE, 0x1E, 0xDF, 0x1E, 0xE0, - 0x1E, 0xE1, 0x1E, 0xE2, 0x1E, 0xE3, 0x1E, 0xE4, 0x1E, 0xE5, 0x1E, 0xE6, 0x1E, 0xE7, 0x1E, 0xE8, - 0x1E, 0xE9, 0x1E, 0xEA, 0x1E, 0xEB, 0x1E, 0xEC, 0x1E, 0xED, 0x1E, 0xEE, 0x1E, 0xEF, 0x1E, 0xF0, - 0x1E, 0xF1, 0x1E, 0xF2, 0x1E, 0xF3, 0x1E, 0xF4, 0x1E, 0xF5, 0x1E, 0xF6, 0x1E, 0xF7, 0x1E, 0xF8, - 0x1E, 0xF9, 0x21, 0x2B, 0x00, 0x01, 0x05, 0xBA, 0x00, 0xAC, 0x01, 0x5E, 0x01, 0x64, 0x01, 0x6A, - 0x01, 0x70, 0x01, 0x76, 0x01, 0x7C, 0x01, 0x82, 0x01, 0x88, 0x01, 0x8E, 0x01, 0x94, 0x01, 0x9A, - 0x01, 0xA0, 0x01, 0xA6, 0x01, 0xAC, 0x01, 0xB2, 0x01, 0xB8, 0x01, 0xBE, 0x01, 0xC4, 0x01, 0xCA, - 0x01, 0xD0, 0x01, 0xD6, 0x01, 0xDC, 0x01, 0xE2, 0x01, 0xE8, 0x01, 0xEE, 0x01, 0xF4, 0x01, 0xFA, - 0x02, 0x00, 0x02, 0x06, 0x02, 0x0C, 0x02, 0x12, 0x02, 0x18, 0x02, 0x1E, 0x02, 0x24, 0x02, 0x2A, - 0x02, 0x30, 0x02, 0x38, 0x02, 0x40, 0x02, 0x46, 0x02, 0x4C, 0x02, 0x54, 0x02, 0x5C, 0x02, 0x62, - 0x02, 0x68, 0x02, 0x70, 0x02, 0x78, 0x02, 0x80, 0x02, 0x88, 0x02, 0x8E, 0x02, 0x94, 0x02, 0x9A, - 0x02, 0xA0, 0x02, 0xA6, 0x02, 0xAC, 0x02, 0xB2, 0x02, 0xB8, 0x02, 0xBE, 0x02, 0xC4, 0x02, 0xCA, - 0x02, 0xD0, 0x02, 0xD6, 0x02, 0xDE, 0x02, 0xE6, 0x02, 0xEE, 0x02, 0xF6, 0x02, 0xFE, 0x03, 0x06, - 0x03, 0x0C, 0x03, 0x12, 0x03, 0x18, 0x03, 0x1E, 0x03, 0x24, 0x03, 0x2A, 0x03, 0x30, 0x03, 0x36, - 0x03, 0x3C, 0x03, 0x42, 0x03, 0x48, 0x03, 0x4E, 0x03, 0x54, 0x03, 0x5A, 0x03, 0x62, 0x03, 0x6A, - 0x03, 0x70, 0x03, 0x76, 0x03, 0x7C, 0x03, 0x82, 0x03, 0x8A, 0x03, 0x92, 0x03, 0x98, 0x03, 0x9E, - 0x03, 0xA4, 0x03, 0xAA, 0x03, 0xB0, 0x03, 0xB6, 0x03, 0xBE, 0x03, 0xC6, 0x03, 0xCE, 0x03, 0xD6, - 0x03, 0xDE, 0x03, 0xE6, 0x03, 0xEC, 0x03, 0xF2, 0x03, 0xF8, 0x03, 0xFE, 0x04, 0x06, 0x04, 0x0E, - 0x04, 0x14, 0x04, 0x1A, 0x04, 0x20, 0x04, 0x26, 0x04, 0x2C, 0x04, 0x32, 0x04, 0x38, 0x04, 0x3E, - 0x04, 0x46, 0x04, 0x4E, 0x04, 0x56, 0x04, 0x5E, 0x04, 0x64, 0x04, 0x6A, 0x04, 0x70, 0x04, 0x76, - 0x04, 0x7C, 0x04, 0x82, 0x04, 0x8A, 0x04, 0x92, 0x04, 0x9A, 0x04, 0xA2, 0x04, 0xA8, 0x04, 0xAE, - 0x04, 0xB4, 0x04, 0xBA, 0x04, 0xC0, 0x04, 0xC6, 0x04, 0xCE, 0x04, 0xD6, 0x04, 0xDE, 0x04, 0xE6, - 0x04, 0xEC, 0x04, 0xF2, 0x04, 0xF8, 0x04, 0xFE, 0x05, 0x04, 0x05, 0x0A, 0x05, 0x12, 0x05, 0x1A, - 0x05, 0x22, 0x05, 0x2A, 0x05, 0x30, 0x05, 0x36, 0x05, 0x3C, 0x05, 0x42, 0x05, 0x48, 0x05, 0x4E, - 0x05, 0x54, 0x05, 0x5A, 0x05, 0x60, 0x05, 0x66, 0x05, 0x6C, 0x05, 0x72, 0x05, 0x78, 0x05, 0x7E, - 0x05, 0x84, 0x05, 0x8A, 0x05, 0x90, 0x05, 0x96, 0x05, 0x9C, 0x05, 0xA2, 0x05, 0xA8, 0x05, 0xAE, - 0x05, 0xB4, 0x00, 0x02, 0x00, 0x41, 0x03, 0x40, 0x00, 0x02, 0x00, 0x41, 0x03, 0x41, 0x00, 0x02, - 0x00, 0x45, 0x03, 0x40, 0x00, 0x02, 0x00, 0x45, 0x03, 0x41, 0x00, 0x02, 0x00, 0x49, 0x03, 0x40, - 0x00, 0x02, 0x00, 0x49, 0x03, 0x41, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x40, 0x00, 0x02, 0x00, 0x4F, - 0x03, 0x41, 0x00, 0x02, 0x00, 0x55, 0x03, 0x40, 0x00, 0x02, 0x00, 0x55, 0x03, 0x41, 0x00, 0x02, - 0x00, 0x59, 0x03, 0x41, 0x00, 0x02, 0x00, 0x61, 0x03, 0x40, 0x00, 0x02, 0x00, 0x61, 0x03, 0x41, - 0x00, 0x02, 0x00, 0x65, 0x03, 0x40, 0x00, 0x02, 0x00, 0x65, 0x03, 0x41, 0x00, 0x02, 0x00, 0x69, - 0x03, 0x40, 0x00, 0x02, 0x00, 0x69, 0x03, 0x41, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x40, 0x00, 0x02, - 0x00, 0x6F, 0x03, 0x41, 0x00, 0x02, 0x00, 0x75, 0x03, 0x40, 0x00, 0x02, 0x00, 0x75, 0x03, 0x41, - 0x00, 0x02, 0x00, 0x79, 0x03, 0x41, 0x00, 0x02, 0x00, 0x43, 0x03, 0x41, 0x00, 0x02, 0x00, 0x63, - 0x03, 0x41, 0x00, 0x02, 0x21, 0x2A, 0x03, 0x27, 0x00, 0x02, 0x00, 0x4C, 0x03, 0x41, 0x00, 0x02, - 0x00, 0x6C, 0x03, 0x41, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x41, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x41, - 0x00, 0x02, 0x00, 0x52, 0x03, 0x41, 0x00, 0x02, 0x00, 0x72, 0x03, 0x41, 0x00, 0x02, 0x00, 0x53, - 0x03, 0x41, 0x00, 0x02, 0x00, 0x73, 0x03, 0x41, 0x00, 0x02, 0x00, 0x5A, 0x03, 0x41, 0x00, 0x02, - 0x00, 0x7A, 0x03, 0x41, 0x00, 0x03, 0x00, 0x55, 0x03, 0x08, 0x03, 0x04, 0x00, 0x03, 0x00, 0x75, - 0x03, 0x08, 0x03, 0x04, 0x00, 0x02, 0x00, 0xDC, 0x03, 0x01, 0x00, 0x02, 0x00, 0xFC, 0x03, 0x01, - 0x00, 0x03, 0x00, 0x55, 0x03, 0x08, 0x03, 0x0C, 0x00, 0x03, 0x00, 0x75, 0x03, 0x08, 0x03, 0x0C, - 0x00, 0x02, 0x00, 0xDC, 0x03, 0x40, 0x00, 0x02, 0x00, 0xFC, 0x03, 0x40, 0x00, 0x03, 0x00, 0x41, - 0x03, 0x08, 0x03, 0x04, 0x00, 0x03, 0x00, 0x61, 0x03, 0x08, 0x03, 0x04, 0x00, 0x03, 0x00, 0x41, - 0x03, 0x07, 0x03, 0x04, 0x00, 0x03, 0x00, 0x61, 0x03, 0x07, 0x03, 0x04, 0x00, 0x02, 0x21, 0x2A, - 0x03, 0x0C, 0x00, 0x02, 0x01, 0xEA, 0x03, 0x04, 0x00, 0x02, 0x01, 0xEB, 0x03, 0x04, 0x00, 0x02, - 0x00, 0x47, 0x03, 0x41, 0x00, 0x02, 0x00, 0x67, 0x03, 0x41, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x40, - 0x00, 0x02, 0x00, 0x6E, 0x03, 0x40, 0x00, 0x02, 0x00, 0xC5, 0x03, 0x41, 0x00, 0x02, 0x00, 0xE5, - 0x03, 0x41, 0x00, 0x02, 0x00, 0xC6, 0x03, 0x41, 0x00, 0x02, 0x00, 0xE6, 0x03, 0x41, 0x00, 0x02, - 0x00, 0xD8, 0x03, 0x41, 0x00, 0x02, 0x00, 0xF8, 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x08, - 0x03, 0x04, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x08, 0x03, 0x04, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x03, - 0x03, 0x04, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x03, 0x03, 0x04, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x07, - 0x03, 0x04, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x07, 0x03, 0x04, 0x00, 0x02, 0x00, 0xC7, 0x03, 0x41, - 0x00, 0x02, 0x00, 0xE7, 0x03, 0x41, 0x00, 0x02, 0x01, 0x12, 0x03, 0x40, 0x00, 0x02, 0x01, 0x13, - 0x03, 0x40, 0x00, 0x02, 0x01, 0x12, 0x03, 0x41, 0x00, 0x02, 0x01, 0x13, 0x03, 0x41, 0x00, 0x02, - 0x02, 0x28, 0x03, 0x06, 0x00, 0x02, 0x02, 0x29, 0x03, 0x06, 0x00, 0x02, 0x00, 0xCF, 0x03, 0x01, - 0x00, 0x02, 0x00, 0xEF, 0x03, 0x01, 0x00, 0x02, 0x00, 0x4B, 0x03, 0x41, 0x00, 0x02, 0x00, 0x6B, - 0x03, 0x41, 0x00, 0x02, 0x21, 0x2A, 0x03, 0x23, 0x00, 0x02, 0x21, 0x2A, 0x03, 0x31, 0x00, 0x03, - 0x00, 0x4C, 0x03, 0x04, 0x03, 0x23, 0x00, 0x03, 0x00, 0x6C, 0x03, 0x04, 0x03, 0x23, 0x00, 0x02, - 0x00, 0x4D, 0x03, 0x41, 0x00, 0x02, 0x00, 0x6D, 0x03, 0x41, 0x00, 0x02, 0x00, 0xD5, 0x03, 0x41, - 0x00, 0x02, 0x00, 0xF5, 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x03, 0x03, 0x08, 0x00, 0x03, - 0x00, 0x6F, 0x03, 0x03, 0x03, 0x08, 0x00, 0x02, 0x01, 0x4C, 0x03, 0x40, 0x00, 0x02, 0x01, 0x4D, - 0x03, 0x40, 0x00, 0x02, 0x01, 0x4C, 0x03, 0x41, 0x00, 0x02, 0x01, 0x4D, 0x03, 0x41, 0x00, 0x02, - 0x00, 0x50, 0x03, 0x41, 0x00, 0x02, 0x00, 0x70, 0x03, 0x41, 0x00, 0x03, 0x00, 0x52, 0x03, 0x04, - 0x03, 0x23, 0x00, 0x03, 0x00, 0x72, 0x03, 0x04, 0x03, 0x23, 0x00, 0x03, 0x00, 0x53, 0x03, 0x01, - 0x03, 0x07, 0x00, 0x03, 0x00, 0x73, 0x03, 0x01, 0x03, 0x07, 0x00, 0x03, 0x00, 0x53, 0x03, 0x0C, - 0x03, 0x07, 0x00, 0x03, 0x00, 0x73, 0x03, 0x0C, 0x03, 0x07, 0x00, 0x02, 0x1E, 0x62, 0x03, 0x07, - 0x00, 0x02, 0x1E, 0x63, 0x03, 0x07, 0x00, 0x02, 0x01, 0x68, 0x03, 0x41, 0x00, 0x02, 0x01, 0x69, - 0x03, 0x41, 0x00, 0x03, 0x00, 0x55, 0x03, 0x04, 0x03, 0x08, 0x00, 0x03, 0x00, 0x75, 0x03, 0x04, - 0x03, 0x08, 0x00, 0x02, 0x00, 0x57, 0x03, 0x40, 0x00, 0x02, 0x00, 0x77, 0x03, 0x40, 0x00, 0x02, - 0x00, 0x57, 0x03, 0x41, 0x00, 0x02, 0x00, 0x77, 0x03, 0x41, 0x00, 0x02, 0x00, 0xC2, 0x03, 0x41, - 0x00, 0x02, 0x00, 0xE2, 0x03, 0x41, 0x00, 0x02, 0x00, 0xC2, 0x03, 0x40, 0x00, 0x02, 0x00, 0xE2, - 0x03, 0x40, 0x00, 0x03, 0x00, 0x41, 0x03, 0x02, 0x03, 0x09, 0x00, 0x03, 0x00, 0x61, 0x03, 0x02, - 0x03, 0x09, 0x00, 0x03, 0x00, 0x41, 0x03, 0x02, 0x03, 0x03, 0x00, 0x03, 0x00, 0x61, 0x03, 0x02, - 0x03, 0x03, 0x00, 0x02, 0x1E, 0xA0, 0x03, 0x02, 0x00, 0x02, 0x1E, 0xA1, 0x03, 0x02, 0x00, 0x02, - 0x01, 0x02, 0x03, 0x41, 0x00, 0x02, 0x01, 0x03, 0x03, 0x41, 0x00, 0x02, 0x01, 0x02, 0x03, 0x40, - 0x00, 0x02, 0x01, 0x03, 0x03, 0x40, 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x09, 0x00, 0x03, - 0x00, 0x61, 0x03, 0x06, 0x03, 0x09, 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x03, 0x00, 0x03, - 0x00, 0x61, 0x03, 0x06, 0x03, 0x03, 0x00, 0x02, 0x1E, 0xA0, 0x03, 0x06, 0x00, 0x02, 0x1E, 0xA1, - 0x03, 0x06, 0x00, 0x02, 0x00, 0xCA, 0x03, 0x41, 0x00, 0x02, 0x00, 0xEA, 0x03, 0x41, 0x00, 0x02, - 0x00, 0xCA, 0x03, 0x40, 0x00, 0x02, 0x00, 0xEA, 0x03, 0x40, 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, - 0x03, 0x09, 0x00, 0x03, 0x00, 0x65, 0x03, 0x02, 0x03, 0x09, 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, - 0x03, 0x03, 0x00, 0x03, 0x00, 0x65, 0x03, 0x02, 0x03, 0x03, 0x00, 0x02, 0x1E, 0xB8, 0x03, 0x02, - 0x00, 0x02, 0x1E, 0xB9, 0x03, 0x02, 0x00, 0x02, 0x00, 0xD4, 0x03, 0x41, 0x00, 0x02, 0x00, 0xF4, - 0x03, 0x41, 0x00, 0x02, 0x00, 0xD4, 0x03, 0x40, 0x00, 0x02, 0x00, 0xF4, 0x03, 0x40, 0x00, 0x03, - 0x00, 0x4F, 0x03, 0x02, 0x03, 0x09, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x02, 0x03, 0x09, 0x00, 0x03, - 0x00, 0x4F, 0x03, 0x02, 0x03, 0x03, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x02, 0x03, 0x03, 0x00, 0x02, - 0x1E, 0xCC, 0x03, 0x02, 0x00, 0x02, 0x1E, 0xCD, 0x03, 0x02, 0x00, 0x02, 0x01, 0xA0, 0x03, 0x01, - 0x00, 0x02, 0x01, 0xA1, 0x03, 0x01, 0x00, 0x02, 0x01, 0xA0, 0x03, 0x00, 0x00, 0x02, 0x01, 0xA1, - 0x03, 0x00, 0x00, 0x02, 0x1E, 0xCE, 0x03, 0x1B, 0x00, 0x02, 0x1E, 0xCF, 0x03, 0x1B, 0x00, 0x02, - 0x01, 0xA0, 0x03, 0x03, 0x00, 0x02, 0x01, 0xA1, 0x03, 0x03, 0x00, 0x02, 0x1E, 0xCC, 0x03, 0x1B, - 0x00, 0x02, 0x1E, 0xCD, 0x03, 0x1B, 0x00, 0x02, 0x01, 0xAF, 0x03, 0x01, 0x00, 0x02, 0x01, 0xB0, - 0x03, 0x01, 0x00, 0x02, 0x01, 0xAF, 0x03, 0x00, 0x00, 0x02, 0x01, 0xB0, 0x03, 0x00, 0x00, 0x02, - 0x1E, 0xE6, 0x03, 0x1B, 0x00, 0x02, 0x1E, 0xE7, 0x03, 0x1B, 0x00, 0x02, 0x01, 0xAF, 0x03, 0x03, - 0x00, 0x02, 0x01, 0xB0, 0x03, 0x03, 0x00, 0x02, 0x1E, 0xE4, 0x03, 0x1B, 0x00, 0x02, 0x1E, 0xE5, - 0x03, 0x1B, 0x00, 0x02, 0x00, 0x59, 0x03, 0x40, 0x00, 0x02, 0x00, 0x79, 0x03, 0x40, 0x00, 0x01, - 0x00, 0xAC, 0x00, 0xC0, 0x00, 0xC1, 0x00, 0xC8, 0x00, 0xC9, 0x00, 0xCC, 0x00, 0xCD, 0x00, 0xD2, - 0x00, 0xD3, 0x00, 0xD9, 0x00, 0xDA, 0x00, 0xDD, 0x00, 0xE0, 0x00, 0xE1, 0x00, 0xE8, 0x00, 0xE9, - 0x00, 0xEC, 0x00, 0xED, 0x00, 0xF2, 0x00, 0xF3, 0x00, 0xF9, 0x00, 0xFA, 0x00, 0xFD, 0x01, 0x06, - 0x01, 0x07, 0x01, 0x36, 0x01, 0x39, 0x01, 0x3A, 0x01, 0x43, 0x01, 0x44, 0x01, 0x54, 0x01, 0x55, - 0x01, 0x5A, 0x01, 0x5B, 0x01, 0x79, 0x01, 0x7A, 0x01, 0xD5, 0x01, 0xD6, 0x01, 0xD7, 0x01, 0xD8, + 0x00, 0x34, 0x01, 0x7A, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x91, 0x00, 0x02, 0x03, 0x02, 0x01, 0x7C, + 0x00, 0x02, 0x03, 0x07, 0x01, 0x7E, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x93, 0x00, 0x02, 0x03, 0x23, + 0x1E, 0x95, 0x00, 0x02, 0x03, 0x31, 0x01, 0x7A, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, + 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xA6, 0x00, 0x02, + 0x03, 0x00, 0x1E, 0xA4, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xAA, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xA8, + 0x00, 0x02, 0x03, 0x09, 0x1E, 0xAC, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xA6, 0x00, 0x02, 0x03, 0x40, + 0x1E, 0xA4, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x01, 0xDE, 0x00, 0x02, 0x03, 0x04, + 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x01, 0xFA, 0x00, 0x02, 0x03, 0x01, 0x01, 0xFA, 0x00, 0x02, + 0x03, 0x41, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, 0x01, 0xFC, 0x00, 0x02, 0x03, 0x01, + 0x01, 0xE2, 0x00, 0x02, 0x03, 0x04, 0x01, 0xFC, 0x00, 0x02, 0x03, 0x41, 0x00, 0x02, 0x00, 0x06, + 0x00, 0x0C, 0x1E, 0x08, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x08, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, + 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xC0, + 0x00, 0x02, 0x03, 0x00, 0x1E, 0xBE, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xC4, 0x00, 0x02, 0x03, 0x03, + 0x1E, 0xC2, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xC6, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xC0, 0x00, 0x02, + 0x03, 0x40, 0x1E, 0xBE, 0x00, 0x02, 0x03, 0x41, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0x2E, + 0x00, 0x02, 0x03, 0x01, 0x1E, 0x2E, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xDC, + 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xDA, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x07, + 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xD2, + 0x00, 0x02, 0x03, 0x00, 0x1E, 0xD0, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xD6, 0x00, 0x02, 0x03, 0x03, + 0x1E, 0xD4, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xD8, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xD2, 0x00, 0x02, + 0x03, 0x40, 0x1E, 0xD0, 0x00, 0x02, 0x03, 0x41, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, + 0x00, 0x1E, 0x00, 0x24, 0x1E, 0x4C, 0x00, 0x02, 0x03, 0x01, 0x02, 0x2C, 0x00, 0x02, 0x03, 0x04, + 0x1E, 0x4E, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xE0, 0x00, 0x02, 0x03, 0x1B, 0x1E, 0x4C, 0x00, 0x02, + 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x02, 0x2A, 0x00, 0x02, 0x03, 0x04, 0x00, 0x02, 0x00, 0x06, + 0x00, 0x0C, 0x01, 0xFE, 0x00, 0x02, 0x03, 0x01, 0x01, 0xFE, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, + 0x00, 0x04, 0x1E, 0xEA, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xE8, 0x00, 0x02, + 0x03, 0x1B, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, + 0x01, 0xDB, 0x00, 0x02, 0x03, 0x00, 0x01, 0xD7, 0x00, 0x02, 0x03, 0x01, 0x01, 0xD5, 0x00, 0x02, + 0x03, 0x04, 0x01, 0xD9, 0x00, 0x02, 0x03, 0x0C, 0x01, 0xDB, 0x00, 0x02, 0x03, 0x40, 0x01, 0xD7, + 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, + 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xA7, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xA5, 0x00, 0x02, 0x03, 0x01, + 0x1E, 0xAB, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xA9, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xAD, 0x00, 0x02, + 0x03, 0x23, 0x1E, 0xA7, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xA5, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, + 0x00, 0x04, 0x01, 0xDF, 0x00, 0x02, 0x03, 0x04, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x01, 0xFB, + 0x00, 0x02, 0x03, 0x01, 0x01, 0xFB, 0x00, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, + 0x00, 0x14, 0x01, 0xFD, 0x00, 0x02, 0x03, 0x01, 0x01, 0xE3, 0x00, 0x02, 0x03, 0x04, 0x01, 0xFD, + 0x00, 0x02, 0x03, 0x41, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0x09, 0x00, 0x02, 0x03, 0x01, + 0x1E, 0x09, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, + 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xC1, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xBF, 0x00, 0x02, + 0x03, 0x01, 0x1E, 0xC5, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xC3, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xC7, + 0x00, 0x02, 0x03, 0x23, 0x1E, 0xC1, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xBF, 0x00, 0x02, 0x03, 0x41, + 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0x2F, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x2F, 0x00, 0x02, + 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xDD, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, + 0x1E, 0xDB, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, + 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xD3, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xD1, 0x00, 0x02, + 0x03, 0x01, 0x1E, 0xD7, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xD5, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xD9, + 0x00, 0x02, 0x03, 0x23, 0x1E, 0xD3, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xD1, 0x00, 0x02, 0x03, 0x41, + 0x00, 0x05, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x1E, 0x4D, 0x00, 0x02, + 0x03, 0x01, 0x02, 0x2D, 0x00, 0x02, 0x03, 0x04, 0x1E, 0x4F, 0x00, 0x02, 0x03, 0x08, 0x1E, 0xE1, + 0x00, 0x02, 0x03, 0x1B, 0x1E, 0x4D, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x02, 0x2B, + 0x00, 0x02, 0x03, 0x04, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x01, 0xFF, 0x00, 0x02, 0x03, 0x01, + 0x01, 0xFF, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xEB, 0x00, 0x02, 0x03, 0x1B, + 0x00, 0x01, 0x00, 0x04, 0x1E, 0xE9, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x06, 0x00, 0x0E, 0x00, 0x14, + 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x01, 0xDC, 0x00, 0x02, 0x03, 0x00, 0x01, 0xD8, + 0x00, 0x02, 0x03, 0x01, 0x01, 0xD6, 0x00, 0x02, 0x03, 0x04, 0x01, 0xDA, 0x00, 0x02, 0x03, 0x0C, + 0x01, 0xDC, 0x00, 0x02, 0x03, 0x40, 0x01, 0xD8, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, + 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xB0, 0x00, 0x02, + 0x03, 0x00, 0x1E, 0xAE, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xB4, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xB2, + 0x00, 0x02, 0x03, 0x09, 0x1E, 0xB6, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xB0, 0x00, 0x02, 0x03, 0x40, + 0x1E, 0xAE, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, + 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xB1, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xAF, 0x00, 0x02, + 0x03, 0x01, 0x1E, 0xB5, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xB3, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xB7, + 0x00, 0x02, 0x03, 0x23, 0x1E, 0xB1, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xAF, 0x00, 0x02, 0x03, 0x41, + 0x00, 0x01, 0x00, 0x04, 0x1E, 0x08, 0x00, 0x02, 0x03, 0x27, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x09, + 0x00, 0x02, 0x03, 0x27, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x1E, 0x14, + 0x00, 0x02, 0x03, 0x00, 0x1E, 0x16, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x14, 0x00, 0x02, 0x03, 0x40, + 0x1E, 0x16, 0x00, 0x02, 0x03, 0x41, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, + 0x1E, 0x15, 0x00, 0x02, 0x03, 0x00, 0x1E, 0x17, 0x00, 0x02, 0x03, 0x01, 0x1E, 0x15, 0x00, 0x02, + 0x03, 0x40, 0x1E, 0x17, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x1C, 0x00, 0x02, + 0x03, 0x27, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x1D, 0x00, 0x02, 0x03, 0x27, 0x00, 0x05, 0x00, 0x0C, + 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, 0x00, 0x24, 0x1E, 0x50, 0x00, 0x02, 0x03, 0x00, 0x1E, 0x52, + 0x00, 0x02, 0x03, 0x01, 0x01, 0xEC, 0x00, 0x02, 0x03, 0x28, 0x1E, 0x50, 0x00, 0x02, 0x03, 0x40, + 0x1E, 0x52, 0x00, 0x02, 0x03, 0x41, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x1E, + 0x00, 0x24, 0x1E, 0x51, 0x00, 0x02, 0x03, 0x00, 0x1E, 0x53, 0x00, 0x02, 0x03, 0x01, 0x01, 0xED, + 0x00, 0x02, 0x03, 0x28, 0x1E, 0x51, 0x00, 0x02, 0x03, 0x40, 0x1E, 0x53, 0x00, 0x02, 0x03, 0x41, + 0x00, 0x01, 0x00, 0x04, 0x1E, 0x64, 0x00, 0x02, 0x03, 0x07, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x65, + 0x00, 0x02, 0x03, 0x07, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x66, 0x00, 0x02, 0x03, 0x07, 0x00, 0x01, + 0x00, 0x04, 0x1E, 0x67, 0x00, 0x02, 0x03, 0x07, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, + 0x1E, 0x78, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xEE, 0x00, 0x02, 0x03, 0x1B, 0x1E, 0x78, 0x00, 0x02, + 0x03, 0x41, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, 0x1E, 0x79, 0x00, 0x02, 0x03, 0x01, + 0x1E, 0xEF, 0x00, 0x02, 0x03, 0x1B, 0x1E, 0x79, 0x00, 0x02, 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, + 0x1E, 0x7A, 0x00, 0x02, 0x03, 0x08, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x7B, 0x00, 0x02, 0x03, 0x08, + 0x00, 0x01, 0x00, 0x04, 0x1E, 0x9B, 0x00, 0x02, 0x03, 0x07, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, + 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xDC, 0x00, 0x02, 0x03, 0x00, + 0x1E, 0xDA, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xE0, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xDE, 0x00, 0x02, + 0x03, 0x09, 0x1E, 0xE2, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xDC, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xDA, + 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, + 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xDD, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xDB, 0x00, 0x02, 0x03, 0x01, + 0x1E, 0xE1, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xDF, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xE3, 0x00, 0x02, + 0x03, 0x23, 0x1E, 0xDD, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xDB, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, + 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xEA, + 0x00, 0x02, 0x03, 0x00, 0x1E, 0xE8, 0x00, 0x02, 0x03, 0x01, 0x1E, 0xEE, 0x00, 0x02, 0x03, 0x03, + 0x1E, 0xEC, 0x00, 0x02, 0x03, 0x09, 0x1E, 0xF0, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xEA, 0x00, 0x02, + 0x03, 0x40, 0x1E, 0xE8, 0x00, 0x02, 0x03, 0x41, 0x00, 0x07, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, + 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x1E, 0xEB, 0x00, 0x02, 0x03, 0x00, 0x1E, 0xE9, + 0x00, 0x02, 0x03, 0x01, 0x1E, 0xEF, 0x00, 0x02, 0x03, 0x03, 0x1E, 0xED, 0x00, 0x02, 0x03, 0x09, + 0x1E, 0xF1, 0x00, 0x02, 0x03, 0x23, 0x1E, 0xEB, 0x00, 0x02, 0x03, 0x40, 0x1E, 0xE9, 0x00, 0x02, + 0x03, 0x41, 0x00, 0x01, 0x00, 0x04, 0x01, 0xEE, 0x00, 0x02, 0x03, 0x0C, 0x00, 0x01, 0x00, 0x04, + 0x01, 0xEC, 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, 0x01, 0xED, 0x00, 0x02, 0x03, 0x04, + 0x00, 0x01, 0x00, 0x04, 0x01, 0xE0, 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, 0x01, 0xE1, + 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x1C, 0x00, 0x02, 0x03, 0x06, 0x00, 0x01, + 0x00, 0x04, 0x1E, 0x1D, 0x00, 0x02, 0x03, 0x06, 0x00, 0x01, 0x00, 0x04, 0x02, 0x30, 0x00, 0x02, + 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, 0x02, 0x31, 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, + 0x01, 0xEF, 0x00, 0x02, 0x03, 0x0C, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x38, 0x00, 0x02, 0x03, 0x04, + 0x00, 0x01, 0x00, 0x04, 0x1E, 0x39, 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x5C, + 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x5D, 0x00, 0x02, 0x03, 0x04, 0x00, 0x01, + 0x00, 0x04, 0x1E, 0x68, 0x00, 0x02, 0x03, 0x23, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x69, 0x00, 0x02, + 0x03, 0x23, 0x00, 0x01, 0x00, 0x04, 0x1E, 0x68, 0x00, 0x02, 0x03, 0x07, 0x00, 0x01, 0x00, 0x04, + 0x1E, 0x69, 0x00, 0x02, 0x03, 0x07, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0xAC, 0x00, 0x02, + 0x03, 0x02, 0x1E, 0xB6, 0x00, 0x02, 0x03, 0x06, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0xAD, + 0x00, 0x02, 0x03, 0x02, 0x1E, 0xB7, 0x00, 0x02, 0x03, 0x06, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xC6, + 0x00, 0x02, 0x03, 0x02, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xC7, 0x00, 0x02, 0x03, 0x02, 0x00, 0x02, + 0x00, 0x06, 0x00, 0x0C, 0x1E, 0xD8, 0x00, 0x02, 0x03, 0x02, 0x1E, 0xE2, 0x00, 0x02, 0x03, 0x1B, + 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x1E, 0xD9, 0x00, 0x02, 0x03, 0x02, 0x1E, 0xE3, 0x00, 0x02, + 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xDE, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, + 0x1E, 0xDF, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xF0, 0x00, 0x02, 0x03, 0x1B, + 0x00, 0x01, 0x00, 0x04, 0x1E, 0xF1, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xEC, + 0x00, 0x02, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x04, 0x1E, 0xED, 0x00, 0x02, 0x03, 0x1B, 0x00, 0x06, + 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x26, 0x00, 0x2C, 0x1E, 0x30, 0x00, 0x02, + 0x03, 0x01, 0x01, 0xE8, 0x00, 0x02, 0x03, 0x0C, 0x1E, 0x32, 0x00, 0x02, 0x03, 0x23, 0x01, 0x36, + 0x00, 0x02, 0x03, 0x27, 0x1E, 0x34, 0x00, 0x02, 0x03, 0x31, 0x1E, 0x30, 0x00, 0x02, 0x03, 0x41, + 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x01, 0xFA, 0x00, 0x02, 0x03, 0x01, 0x01, 0xFA, 0x00, 0x02, + 0x03, 0x41, 0x00, 0x01, 0x00, 0x89, 0x00, 0x41, 0x00, 0x42, 0x00, 0x43, 0x00, 0x44, 0x00, 0x45, + 0x00, 0x46, 0x00, 0x47, 0x00, 0x48, 0x00, 0x49, 0x00, 0x4A, 0x00, 0x4B, 0x00, 0x4C, 0x00, 0x4D, + 0x00, 0x4E, 0x00, 0x4F, 0x00, 0x50, 0x00, 0x52, 0x00, 0x53, 0x00, 0x54, 0x00, 0x55, 0x00, 0x56, + 0x00, 0x57, 0x00, 0x58, 0x00, 0x59, 0x00, 0x5A, 0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00, 0x64, + 0x00, 0x65, 0x00, 0x66, 0x00, 0x67, 0x00, 0x68, 0x00, 0x69, 0x00, 0x6A, 0x00, 0x6B, 0x00, 0x6C, + 0x00, 0x6D, 0x00, 0x6E, 0x00, 0x6F, 0x00, 0x70, 0x00, 0x72, 0x00, 0x73, 0x00, 0x74, 0x00, 0x75, + 0x00, 0x76, 0x00, 0x77, 0x00, 0x78, 0x00, 0x79, 0x00, 0x7A, 0x00, 0xC2, 0x00, 0xC4, 0x00, 0xC5, + 0x00, 0xC6, 0x00, 0xC7, 0x00, 0xCA, 0x00, 0xCF, 0x00, 0xD2, 0x00, 0xD3, 0x00, 0xD4, 0x00, 0xD5, + 0x00, 0xD6, 0x00, 0xD8, 0x00, 0xD9, 0x00, 0xDA, 0x00, 0xDC, 0x00, 0xE2, 0x00, 0xE4, 0x00, 0xE5, + 0x00, 0xE6, 0x00, 0xE7, 0x00, 0xEA, 0x00, 0xEF, 0x00, 0xF2, 0x00, 0xF3, 0x00, 0xF4, 0x00, 0xF5, + 0x00, 0xF6, 0x00, 0xF8, 0x00, 0xF9, 0x00, 0xFA, 0x00, 0xFC, 0x01, 0x02, 0x01, 0x03, 0x01, 0x06, + 0x01, 0x07, 0x01, 0x12, 0x01, 0x13, 0x01, 0x14, 0x01, 0x15, 0x01, 0x4C, 0x01, 0x4D, 0x01, 0x5A, + 0x01, 0x5B, 0x01, 0x60, 0x01, 0x61, 0x01, 0x68, 0x01, 0x69, 0x01, 0x6A, 0x01, 0x6B, 0x01, 0x7F, + 0x01, 0xA0, 0x01, 0xA1, 0x01, 0xAF, 0x01, 0xB0, 0x01, 0xB7, 0x01, 0xEA, 0x01, 0xEB, 0x02, 0x26, + 0x02, 0x27, 0x02, 0x28, 0x02, 0x29, 0x02, 0x2E, 0x02, 0x2F, 0x02, 0x92, 0x1E, 0x36, 0x1E, 0x37, + 0x1E, 0x5A, 0x1E, 0x5B, 0x1E, 0x60, 0x1E, 0x61, 0x1E, 0x62, 0x1E, 0x63, 0x1E, 0xA0, 0x1E, 0xA1, + 0x1E, 0xB8, 0x1E, 0xB9, 0x1E, 0xCC, 0x1E, 0xCD, 0x1E, 0xCE, 0x1E, 0xCF, 0x1E, 0xE4, 0x1E, 0xE5, + 0x1E, 0xE6, 0x1E, 0xE7, 0x21, 0x2A, 0x21, 0x2B, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x14, + 0x13, 0x88, 0x1A, 0x9E, 0x1E, 0x3C, 0x21, 0xAE, 0x22, 0x6C, 0x22, 0xFA, 0x00, 0x01, 0x0F, 0x8E, + 0x01, 0xF1, 0x03, 0xE8, 0x03, 0xEE, 0x03, 0xF4, 0x03, 0xFA, 0x04, 0x00, 0x04, 0x06, 0x04, 0x0C, + 0x04, 0x12, 0x04, 0x18, 0x04, 0x1E, 0x04, 0x24, 0x04, 0x2A, 0x04, 0x30, 0x04, 0x36, 0x04, 0x3C, + 0x04, 0x42, 0x04, 0x48, 0x04, 0x4E, 0x04, 0x54, 0x04, 0x5A, 0x04, 0x60, 0x04, 0x66, 0x04, 0x6C, + 0x04, 0x72, 0x04, 0x78, 0x04, 0x7E, 0x04, 0x84, 0x04, 0x8A, 0x04, 0x90, 0x04, 0x96, 0x04, 0x9C, + 0x04, 0xA2, 0x04, 0xA8, 0x04, 0xAE, 0x04, 0xB4, 0x04, 0xBA, 0x04, 0xC0, 0x04, 0xC6, 0x04, 0xCC, + 0x04, 0xD2, 0x04, 0xD8, 0x04, 0xDE, 0x04, 0xE4, 0x04, 0xEA, 0x04, 0xF0, 0x04, 0xF6, 0x04, 0xFC, + 0x05, 0x02, 0x05, 0x08, 0x05, 0x0E, 0x05, 0x14, 0x05, 0x1A, 0x05, 0x20, 0x05, 0x26, 0x05, 0x2C, + 0x05, 0x32, 0x05, 0x38, 0x05, 0x3E, 0x05, 0x44, 0x05, 0x4A, 0x05, 0x50, 0x05, 0x56, 0x05, 0x5C, + 0x05, 0x62, 0x05, 0x68, 0x05, 0x6E, 0x05, 0x74, 0x05, 0x7A, 0x05, 0x80, 0x05, 0x86, 0x05, 0x8C, + 0x05, 0x92, 0x05, 0x98, 0x05, 0x9E, 0x05, 0xA4, 0x05, 0xAA, 0x05, 0xB0, 0x05, 0xB6, 0x05, 0xBC, + 0x05, 0xC2, 0x05, 0xC8, 0x05, 0xCE, 0x05, 0xD4, 0x05, 0xDA, 0x05, 0xE0, 0x05, 0xE6, 0x05, 0xEC, + 0x05, 0xF2, 0x05, 0xF8, 0x05, 0xFE, 0x06, 0x04, 0x06, 0x0A, 0x06, 0x10, 0x06, 0x16, 0x06, 0x1C, + 0x06, 0x22, 0x06, 0x28, 0x06, 0x2E, 0x06, 0x34, 0x06, 0x3A, 0x06, 0x40, 0x06, 0x46, 0x06, 0x4C, + 0x06, 0x52, 0x06, 0x58, 0x06, 0x5E, 0x06, 0x64, 0x06, 0x6A, 0x06, 0x70, 0x06, 0x76, 0x06, 0x7C, + 0x06, 0x82, 0x06, 0x88, 0x06, 0x8E, 0x06, 0x94, 0x06, 0x9A, 0x06, 0xA0, 0x06, 0xA6, 0x06, 0xAC, + 0x06, 0xB2, 0x06, 0xB8, 0x06, 0xBE, 0x06, 0xC4, 0x06, 0xCA, 0x06, 0xD0, 0x06, 0xD6, 0x06, 0xDC, + 0x06, 0xE2, 0x06, 0xE8, 0x06, 0xEE, 0x06, 0xF4, 0x06, 0xFA, 0x07, 0x00, 0x07, 0x06, 0x07, 0x0C, + 0x07, 0x12, 0x07, 0x18, 0x07, 0x1E, 0x07, 0x24, 0x07, 0x2A, 0x07, 0x30, 0x07, 0x36, 0x07, 0x3C, + 0x07, 0x42, 0x07, 0x48, 0x07, 0x4E, 0x07, 0x54, 0x07, 0x5A, 0x07, 0x60, 0x07, 0x66, 0x07, 0x6C, + 0x07, 0x72, 0x07, 0x78, 0x07, 0x7E, 0x07, 0x84, 0x07, 0x8A, 0x07, 0x90, 0x07, 0x96, 0x07, 0x9C, + 0x07, 0xA2, 0x07, 0xA8, 0x07, 0xAE, 0x07, 0xB4, 0x07, 0xBA, 0x07, 0xC0, 0x07, 0xC6, 0x07, 0xCC, + 0x07, 0xD2, 0x07, 0xD8, 0x07, 0xDE, 0x07, 0xE4, 0x07, 0xEA, 0x07, 0xF0, 0x07, 0xF6, 0x07, 0xFC, + 0x08, 0x02, 0x08, 0x08, 0x08, 0x0E, 0x08, 0x14, 0x08, 0x1A, 0x08, 0x20, 0x08, 0x26, 0x08, 0x2C, + 0x08, 0x32, 0x08, 0x38, 0x08, 0x3E, 0x08, 0x44, 0x08, 0x4A, 0x08, 0x50, 0x08, 0x56, 0x08, 0x5C, + 0x08, 0x62, 0x08, 0x68, 0x08, 0x6E, 0x08, 0x74, 0x08, 0x7A, 0x08, 0x80, 0x08, 0x86, 0x08, 0x8C, + 0x08, 0x92, 0x08, 0x98, 0x08, 0x9E, 0x08, 0xA4, 0x08, 0xAA, 0x08, 0xB0, 0x08, 0xB6, 0x08, 0xBC, + 0x08, 0xC2, 0x08, 0xC8, 0x08, 0xCE, 0x08, 0xD4, 0x08, 0xDA, 0x08, 0xE0, 0x08, 0xE6, 0x08, 0xEC, + 0x08, 0xF2, 0x08, 0xF8, 0x08, 0xFE, 0x09, 0x04, 0x09, 0x0A, 0x09, 0x10, 0x09, 0x16, 0x09, 0x1C, + 0x09, 0x22, 0x09, 0x28, 0x09, 0x2E, 0x09, 0x34, 0x09, 0x3A, 0x09, 0x40, 0x09, 0x46, 0x09, 0x4C, + 0x09, 0x52, 0x09, 0x58, 0x09, 0x5E, 0x09, 0x64, 0x09, 0x6A, 0x09, 0x70, 0x09, 0x76, 0x09, 0x7C, + 0x09, 0x82, 0x09, 0x88, 0x09, 0x8E, 0x09, 0x94, 0x09, 0x9A, 0x09, 0xA0, 0x09, 0xA6, 0x09, 0xAC, + 0x09, 0xB2, 0x09, 0xB8, 0x09, 0xBE, 0x09, 0xC4, 0x09, 0xCA, 0x09, 0xD0, 0x09, 0xD6, 0x09, 0xDC, + 0x09, 0xE2, 0x09, 0xE8, 0x09, 0xEE, 0x09, 0xF4, 0x09, 0xFA, 0x0A, 0x00, 0x0A, 0x06, 0x0A, 0x0C, + 0x0A, 0x12, 0x0A, 0x18, 0x0A, 0x1E, 0x0A, 0x24, 0x0A, 0x2A, 0x0A, 0x30, 0x0A, 0x36, 0x0A, 0x3C, + 0x0A, 0x42, 0x0A, 0x48, 0x0A, 0x4E, 0x0A, 0x54, 0x0A, 0x5A, 0x0A, 0x60, 0x0A, 0x66, 0x0A, 0x6C, + 0x0A, 0x72, 0x0A, 0x78, 0x0A, 0x7E, 0x0A, 0x84, 0x0A, 0x8A, 0x0A, 0x90, 0x0A, 0x96, 0x0A, 0x9C, + 0x0A, 0xA2, 0x0A, 0xA8, 0x0A, 0xAE, 0x0A, 0xB4, 0x0A, 0xBA, 0x0A, 0xC0, 0x0A, 0xC6, 0x0A, 0xCC, + 0x0A, 0xD2, 0x0A, 0xD8, 0x0A, 0xDE, 0x0A, 0xE4, 0x0A, 0xEA, 0x0A, 0xF0, 0x0A, 0xF6, 0x0A, 0xFC, + 0x0B, 0x02, 0x0B, 0x08, 0x0B, 0x0E, 0x0B, 0x14, 0x0B, 0x1A, 0x0B, 0x20, 0x0B, 0x26, 0x0B, 0x2C, + 0x0B, 0x32, 0x0B, 0x38, 0x0B, 0x3E, 0x0B, 0x44, 0x0B, 0x4A, 0x0B, 0x50, 0x0B, 0x56, 0x0B, 0x5C, + 0x0B, 0x62, 0x0B, 0x68, 0x0B, 0x6E, 0x0B, 0x74, 0x0B, 0x7A, 0x0B, 0x80, 0x0B, 0x86, 0x0B, 0x8C, + 0x0B, 0x92, 0x0B, 0x98, 0x0B, 0x9E, 0x0B, 0xA4, 0x0B, 0xAA, 0x0B, 0xB0, 0x0B, 0xB6, 0x0B, 0xBC, + 0x0B, 0xC2, 0x0B, 0xC8, 0x0B, 0xCE, 0x0B, 0xD4, 0x0B, 0xDA, 0x0B, 0xE0, 0x0B, 0xE6, 0x0B, 0xEC, + 0x0B, 0xF2, 0x0B, 0xF8, 0x0B, 0xFE, 0x0C, 0x04, 0x0C, 0x0A, 0x0C, 0x10, 0x0C, 0x16, 0x0C, 0x1C, + 0x0C, 0x22, 0x0C, 0x28, 0x0C, 0x2E, 0x0C, 0x34, 0x0C, 0x3A, 0x0C, 0x40, 0x0C, 0x46, 0x0C, 0x4C, + 0x0C, 0x52, 0x0C, 0x58, 0x0C, 0x5E, 0x0C, 0x64, 0x0C, 0x6A, 0x0C, 0x70, 0x0C, 0x76, 0x0C, 0x7C, + 0x0C, 0x82, 0x0C, 0x88, 0x0C, 0x8E, 0x0C, 0x94, 0x0C, 0x9A, 0x0C, 0xA0, 0x0C, 0xA6, 0x0C, 0xAC, + 0x0C, 0xB2, 0x0C, 0xB8, 0x0C, 0xBE, 0x0C, 0xC4, 0x0C, 0xCA, 0x0C, 0xD0, 0x0C, 0xD6, 0x0C, 0xDC, + 0x0C, 0xE2, 0x0C, 0xE8, 0x0C, 0xEE, 0x0C, 0xF4, 0x0C, 0xFA, 0x0D, 0x00, 0x0D, 0x06, 0x0D, 0x0C, + 0x0D, 0x12, 0x0D, 0x18, 0x0D, 0x1E, 0x0D, 0x24, 0x0D, 0x2A, 0x0D, 0x30, 0x0D, 0x36, 0x0D, 0x3C, + 0x0D, 0x42, 0x0D, 0x48, 0x0D, 0x4E, 0x0D, 0x54, 0x0D, 0x5A, 0x0D, 0x60, 0x0D, 0x66, 0x0D, 0x6C, + 0x0D, 0x72, 0x0D, 0x78, 0x0D, 0x7E, 0x0D, 0x84, 0x0D, 0x8A, 0x0D, 0x90, 0x0D, 0x96, 0x0D, 0x9C, + 0x0D, 0xA2, 0x0D, 0xA8, 0x0D, 0xAE, 0x0D, 0xB4, 0x0D, 0xBA, 0x0D, 0xC0, 0x0D, 0xC6, 0x0D, 0xCC, + 0x0D, 0xD2, 0x0D, 0xD8, 0x0D, 0xDE, 0x0D, 0xE4, 0x0D, 0xEA, 0x0D, 0xF0, 0x0D, 0xF6, 0x0D, 0xFC, + 0x0E, 0x02, 0x0E, 0x08, 0x0E, 0x0E, 0x0E, 0x14, 0x0E, 0x1A, 0x0E, 0x20, 0x0E, 0x26, 0x0E, 0x2C, + 0x0E, 0x32, 0x0E, 0x38, 0x0E, 0x3E, 0x0E, 0x44, 0x0E, 0x4A, 0x0E, 0x50, 0x0E, 0x56, 0x0E, 0x5C, + 0x0E, 0x62, 0x0E, 0x68, 0x0E, 0x6E, 0x0E, 0x74, 0x0E, 0x7A, 0x0E, 0x80, 0x0E, 0x86, 0x0E, 0x8C, + 0x0E, 0x92, 0x0E, 0x98, 0x0E, 0x9E, 0x0E, 0xA4, 0x0E, 0xAA, 0x0E, 0xB0, 0x0E, 0xB6, 0x0E, 0xBC, + 0x0E, 0xC2, 0x0E, 0xC8, 0x0E, 0xCE, 0x0E, 0xD4, 0x0E, 0xDA, 0x0E, 0xE0, 0x0E, 0xE6, 0x0E, 0xEC, + 0x0E, 0xF2, 0x0E, 0xF8, 0x0E, 0xFE, 0x0F, 0x04, 0x0F, 0x0A, 0x0F, 0x10, 0x0F, 0x16, 0x0F, 0x1C, + 0x0F, 0x22, 0x0F, 0x28, 0x0F, 0x2E, 0x0F, 0x34, 0x0F, 0x3A, 0x0F, 0x40, 0x0F, 0x46, 0x0F, 0x4C, + 0x0F, 0x52, 0x0F, 0x58, 0x0F, 0x5E, 0x0F, 0x64, 0x0F, 0x6A, 0x0F, 0x70, 0x0F, 0x76, 0x0F, 0x7C, + 0x0F, 0x82, 0x0F, 0x88, 0x00, 0x02, 0x00, 0x41, 0x03, 0x00, 0x00, 0x02, 0x00, 0x41, 0x03, 0x01, + 0x00, 0x02, 0x00, 0x41, 0x03, 0x02, 0x00, 0x02, 0x00, 0x41, 0x03, 0x03, 0x00, 0x02, 0x00, 0x41, + 0x03, 0x08, 0x00, 0x02, 0x00, 0x41, 0x03, 0x0A, 0x00, 0x02, 0x00, 0x43, 0x03, 0x27, 0x00, 0x02, + 0x00, 0x45, 0x03, 0x00, 0x00, 0x02, 0x00, 0x45, 0x03, 0x01, 0x00, 0x02, 0x00, 0x45, 0x03, 0x02, + 0x00, 0x02, 0x00, 0x45, 0x03, 0x08, 0x00, 0x02, 0x00, 0x49, 0x03, 0x00, 0x00, 0x02, 0x00, 0x49, + 0x03, 0x01, 0x00, 0x02, 0x00, 0x49, 0x03, 0x02, 0x00, 0x02, 0x00, 0x49, 0x03, 0x08, 0x00, 0x02, + 0x00, 0x4E, 0x03, 0x03, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x00, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x01, + 0x00, 0x02, 0x00, 0x4F, 0x03, 0x02, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x03, 0x00, 0x02, 0x00, 0x4F, + 0x03, 0x08, 0x00, 0x02, 0x00, 0x55, 0x03, 0x00, 0x00, 0x02, 0x00, 0x55, 0x03, 0x01, 0x00, 0x02, + 0x00, 0x55, 0x03, 0x02, 0x00, 0x02, 0x00, 0x55, 0x03, 0x08, 0x00, 0x02, 0x00, 0x59, 0x03, 0x01, + 0x00, 0x02, 0x00, 0x61, 0x03, 0x00, 0x00, 0x02, 0x00, 0x61, 0x03, 0x01, 0x00, 0x02, 0x00, 0x61, + 0x03, 0x02, 0x00, 0x02, 0x00, 0x61, 0x03, 0x03, 0x00, 0x02, 0x00, 0x61, 0x03, 0x08, 0x00, 0x02, + 0x00, 0x61, 0x03, 0x0A, 0x00, 0x02, 0x00, 0x63, 0x03, 0x27, 0x00, 0x02, 0x00, 0x65, 0x03, 0x00, + 0x00, 0x02, 0x00, 0x65, 0x03, 0x01, 0x00, 0x02, 0x00, 0x65, 0x03, 0x02, 0x00, 0x02, 0x00, 0x65, + 0x03, 0x08, 0x00, 0x02, 0x00, 0x69, 0x03, 0x00, 0x00, 0x02, 0x00, 0x69, 0x03, 0x01, 0x00, 0x02, + 0x00, 0x69, 0x03, 0x02, 0x00, 0x02, 0x00, 0x69, 0x03, 0x08, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x03, + 0x00, 0x02, 0x00, 0x6F, 0x03, 0x00, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x01, 0x00, 0x02, 0x00, 0x6F, + 0x03, 0x02, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x03, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x08, 0x00, 0x02, + 0x00, 0x75, 0x03, 0x00, 0x00, 0x02, 0x00, 0x75, 0x03, 0x01, 0x00, 0x02, 0x00, 0x75, 0x03, 0x02, + 0x00, 0x02, 0x00, 0x75, 0x03, 0x08, 0x00, 0x02, 0x00, 0x79, 0x03, 0x01, 0x00, 0x02, 0x00, 0x79, + 0x03, 0x08, 0x00, 0x02, 0x00, 0x41, 0x03, 0x04, 0x00, 0x02, 0x00, 0x61, 0x03, 0x04, 0x00, 0x02, + 0x00, 0x41, 0x03, 0x06, 0x00, 0x02, 0x00, 0x61, 0x03, 0x06, 0x00, 0x02, 0x00, 0x41, 0x03, 0x28, + 0x00, 0x02, 0x00, 0x61, 0x03, 0x28, 0x00, 0x02, 0x00, 0x43, 0x03, 0x01, 0x00, 0x02, 0x00, 0x63, + 0x03, 0x01, 0x00, 0x02, 0x00, 0x43, 0x03, 0x02, 0x00, 0x02, 0x00, 0x63, 0x03, 0x02, 0x00, 0x02, + 0x00, 0x43, 0x03, 0x07, 0x00, 0x02, 0x00, 0x63, 0x03, 0x07, 0x00, 0x02, 0x00, 0x43, 0x03, 0x0C, + 0x00, 0x02, 0x00, 0x63, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x44, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x64, + 0x03, 0x0C, 0x00, 0x02, 0x00, 0x45, 0x03, 0x04, 0x00, 0x02, 0x00, 0x65, 0x03, 0x04, 0x00, 0x02, + 0x00, 0x45, 0x03, 0x06, 0x00, 0x02, 0x00, 0x65, 0x03, 0x06, 0x00, 0x02, 0x00, 0x45, 0x03, 0x07, + 0x00, 0x02, 0x00, 0x65, 0x03, 0x07, 0x00, 0x02, 0x00, 0x45, 0x03, 0x28, 0x00, 0x02, 0x00, 0x65, + 0x03, 0x28, 0x00, 0x02, 0x00, 0x45, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x65, 0x03, 0x0C, 0x00, 0x02, + 0x00, 0x47, 0x03, 0x02, 0x00, 0x02, 0x00, 0x67, 0x03, 0x02, 0x00, 0x02, 0x00, 0x47, 0x03, 0x06, + 0x00, 0x02, 0x00, 0x67, 0x03, 0x06, 0x00, 0x02, 0x00, 0x47, 0x03, 0x07, 0x00, 0x02, 0x00, 0x67, + 0x03, 0x07, 0x00, 0x02, 0x00, 0x47, 0x03, 0x27, 0x00, 0x02, 0x00, 0x67, 0x03, 0x27, 0x00, 0x02, + 0x00, 0x48, 0x03, 0x02, 0x00, 0x02, 0x00, 0x68, 0x03, 0x02, 0x00, 0x02, 0x00, 0x49, 0x03, 0x03, + 0x00, 0x02, 0x00, 0x69, 0x03, 0x03, 0x00, 0x02, 0x00, 0x49, 0x03, 0x04, 0x00, 0x02, 0x00, 0x69, + 0x03, 0x04, 0x00, 0x02, 0x00, 0x49, 0x03, 0x06, 0x00, 0x02, 0x00, 0x69, 0x03, 0x06, 0x00, 0x02, + 0x00, 0x49, 0x03, 0x28, 0x00, 0x02, 0x00, 0x69, 0x03, 0x28, 0x00, 0x02, 0x00, 0x49, 0x03, 0x07, + 0x00, 0x02, 0x00, 0x4A, 0x03, 0x02, 0x00, 0x02, 0x00, 0x6A, 0x03, 0x02, 0x00, 0x02, 0x00, 0x4B, + 0x03, 0x27, 0x00, 0x02, 0x00, 0x6B, 0x03, 0x27, 0x00, 0x02, 0x00, 0x4C, 0x03, 0x01, 0x00, 0x02, + 0x00, 0x6C, 0x03, 0x01, 0x00, 0x02, 0x00, 0x4C, 0x03, 0x27, 0x00, 0x02, 0x00, 0x6C, 0x03, 0x27, + 0x00, 0x02, 0x00, 0x4C, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x6C, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x4E, + 0x03, 0x01, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x01, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x27, 0x00, 0x02, + 0x00, 0x6E, 0x03, 0x27, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x0C, + 0x00, 0x02, 0x00, 0x4F, 0x03, 0x04, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x04, 0x00, 0x02, 0x00, 0x4F, + 0x03, 0x06, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x06, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x0B, 0x00, 0x02, + 0x00, 0x6F, 0x03, 0x0B, 0x00, 0x02, 0x00, 0x52, 0x03, 0x01, 0x00, 0x02, 0x00, 0x72, 0x03, 0x01, + 0x00, 0x02, 0x00, 0x52, 0x03, 0x27, 0x00, 0x02, 0x00, 0x72, 0x03, 0x27, 0x00, 0x02, 0x00, 0x52, + 0x03, 0x0C, 0x00, 0x02, 0x00, 0x72, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x53, 0x03, 0x01, 0x00, 0x02, + 0x00, 0x73, 0x03, 0x01, 0x00, 0x02, 0x00, 0x53, 0x03, 0x02, 0x00, 0x02, 0x00, 0x73, 0x03, 0x02, + 0x00, 0x02, 0x00, 0x53, 0x03, 0x27, 0x00, 0x02, 0x00, 0x73, 0x03, 0x27, 0x00, 0x02, 0x00, 0x53, + 0x03, 0x0C, 0x00, 0x02, 0x00, 0x73, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x54, 0x03, 0x27, 0x00, 0x02, + 0x00, 0x74, 0x03, 0x27, 0x00, 0x02, 0x00, 0x54, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x74, 0x03, 0x0C, + 0x00, 0x02, 0x00, 0x55, 0x03, 0x03, 0x00, 0x02, 0x00, 0x75, 0x03, 0x03, 0x00, 0x02, 0x00, 0x55, + 0x03, 0x04, 0x00, 0x02, 0x00, 0x75, 0x03, 0x04, 0x00, 0x02, 0x00, 0x55, 0x03, 0x06, 0x00, 0x02, + 0x00, 0x75, 0x03, 0x06, 0x00, 0x02, 0x00, 0x55, 0x03, 0x0A, 0x00, 0x02, 0x00, 0x75, 0x03, 0x0A, + 0x00, 0x02, 0x00, 0x55, 0x03, 0x0B, 0x00, 0x02, 0x00, 0x75, 0x03, 0x0B, 0x00, 0x02, 0x00, 0x55, + 0x03, 0x28, 0x00, 0x02, 0x00, 0x75, 0x03, 0x28, 0x00, 0x02, 0x00, 0x57, 0x03, 0x02, 0x00, 0x02, + 0x00, 0x77, 0x03, 0x02, 0x00, 0x02, 0x00, 0x59, 0x03, 0x02, 0x00, 0x02, 0x00, 0x79, 0x03, 0x02, + 0x00, 0x02, 0x00, 0x59, 0x03, 0x08, 0x00, 0x02, 0x00, 0x5A, 0x03, 0x01, 0x00, 0x02, 0x00, 0x7A, + 0x03, 0x01, 0x00, 0x02, 0x00, 0x5A, 0x03, 0x07, 0x00, 0x02, 0x00, 0x7A, 0x03, 0x07, 0x00, 0x02, + 0x00, 0x5A, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x7A, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x1B, + 0x00, 0x02, 0x00, 0x6F, 0x03, 0x1B, 0x00, 0x02, 0x00, 0x55, 0x03, 0x1B, 0x00, 0x02, 0x00, 0x75, + 0x03, 0x1B, 0x00, 0x02, 0x00, 0x41, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x61, 0x03, 0x0C, 0x00, 0x02, + 0x00, 0x49, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x69, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x0C, + 0x00, 0x02, 0x00, 0x6F, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x55, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x75, + 0x03, 0x0C, 0x00, 0x02, 0x00, 0xDC, 0x03, 0x04, 0x00, 0x02, 0x00, 0xFC, 0x03, 0x04, 0x00, 0x02, + 0x00, 0x55, 0x03, 0x44, 0x00, 0x02, 0x00, 0x75, 0x03, 0x44, 0x00, 0x02, 0x00, 0xDC, 0x03, 0x0C, + 0x00, 0x02, 0x00, 0xFC, 0x03, 0x0C, 0x00, 0x02, 0x00, 0xDC, 0x03, 0x00, 0x00, 0x02, 0x00, 0xFC, + 0x03, 0x00, 0x00, 0x02, 0x00, 0xC4, 0x03, 0x04, 0x00, 0x02, 0x00, 0xE4, 0x03, 0x04, 0x00, 0x02, + 0x02, 0x26, 0x03, 0x04, 0x00, 0x02, 0x02, 0x27, 0x03, 0x04, 0x00, 0x02, 0x00, 0xC6, 0x03, 0x04, + 0x00, 0x02, 0x00, 0xE6, 0x03, 0x04, 0x00, 0x02, 0x00, 0x47, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x67, + 0x03, 0x0C, 0x00, 0x02, 0x00, 0x4B, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x6B, 0x03, 0x0C, 0x00, 0x02, + 0x00, 0x4F, 0x03, 0x28, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x28, 0x00, 0x02, 0x01, 0x4C, 0x03, 0x28, + 0x00, 0x02, 0x01, 0x4D, 0x03, 0x28, 0x00, 0x02, 0x01, 0xB7, 0x03, 0x0C, 0x00, 0x02, 0x02, 0x92, + 0x03, 0x0C, 0x00, 0x02, 0x00, 0x6A, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x47, 0x03, 0x01, 0x00, 0x02, + 0x00, 0x67, 0x03, 0x01, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x00, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x00, + 0x00, 0x02, 0x00, 0xC5, 0x03, 0x01, 0x00, 0x02, 0x00, 0xE5, 0x03, 0x01, 0x00, 0x02, 0x00, 0xC6, + 0x03, 0x01, 0x00, 0x02, 0x00, 0xE6, 0x03, 0x01, 0x00, 0x02, 0x00, 0xD8, 0x03, 0x01, 0x00, 0x02, + 0x00, 0xF8, 0x03, 0x01, 0x00, 0x02, 0x00, 0x41, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x61, 0x03, 0x0F, + 0x00, 0x02, 0x00, 0x41, 0x03, 0x11, 0x00, 0x02, 0x00, 0x61, 0x03, 0x11, 0x00, 0x02, 0x00, 0x45, + 0x03, 0x0F, 0x00, 0x02, 0x00, 0x65, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x45, 0x03, 0x11, 0x00, 0x02, + 0x00, 0x65, 0x03, 0x11, 0x00, 0x02, 0x00, 0x49, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x69, 0x03, 0x0F, + 0x00, 0x02, 0x00, 0x49, 0x03, 0x11, 0x00, 0x02, 0x00, 0x69, 0x03, 0x11, 0x00, 0x02, 0x00, 0x4F, + 0x03, 0x0F, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x11, 0x00, 0x02, + 0x00, 0x6F, 0x03, 0x11, 0x00, 0x02, 0x00, 0x52, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x72, 0x03, 0x0F, + 0x00, 0x02, 0x00, 0x52, 0x03, 0x11, 0x00, 0x02, 0x00, 0x72, 0x03, 0x11, 0x00, 0x02, 0x00, 0x55, + 0x03, 0x0F, 0x00, 0x02, 0x00, 0x75, 0x03, 0x0F, 0x00, 0x02, 0x00, 0x55, 0x03, 0x11, 0x00, 0x02, + 0x00, 0x75, 0x03, 0x11, 0x00, 0x02, 0x00, 0x53, 0x03, 0x26, 0x00, 0x02, 0x00, 0x73, 0x03, 0x26, + 0x00, 0x02, 0x00, 0x54, 0x03, 0x26, 0x00, 0x02, 0x00, 0x74, 0x03, 0x26, 0x00, 0x02, 0x00, 0x48, + 0x03, 0x0C, 0x00, 0x02, 0x00, 0x68, 0x03, 0x0C, 0x00, 0x02, 0x00, 0x41, 0x03, 0x07, 0x00, 0x02, + 0x00, 0x61, 0x03, 0x07, 0x00, 0x02, 0x00, 0x45, 0x03, 0x27, 0x00, 0x02, 0x00, 0x65, 0x03, 0x27, + 0x00, 0x02, 0x00, 0xD6, 0x03, 0x04, 0x00, 0x02, 0x00, 0xF6, 0x03, 0x04, 0x00, 0x02, 0x00, 0xD5, + 0x03, 0x04, 0x00, 0x02, 0x00, 0xF5, 0x03, 0x04, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x07, 0x00, 0x02, + 0x00, 0x6F, 0x03, 0x07, 0x00, 0x02, 0x02, 0x2E, 0x03, 0x04, 0x00, 0x02, 0x02, 0x2F, 0x03, 0x04, + 0x00, 0x02, 0x00, 0x59, 0x03, 0x04, 0x00, 0x02, 0x00, 0x79, 0x03, 0x04, 0x00, 0x02, 0x00, 0x41, + 0x03, 0x25, 0x00, 0x02, 0x00, 0x61, 0x03, 0x25, 0x00, 0x02, 0x00, 0x42, 0x03, 0x07, 0x00, 0x02, + 0x00, 0x62, 0x03, 0x07, 0x00, 0x02, 0x00, 0x42, 0x03, 0x23, 0x00, 0x02, 0x00, 0x62, 0x03, 0x23, + 0x00, 0x02, 0x00, 0x42, 0x03, 0x31, 0x00, 0x02, 0x00, 0x62, 0x03, 0x31, 0x00, 0x02, 0x00, 0xC7, + 0x03, 0x01, 0x00, 0x02, 0x00, 0xE7, 0x03, 0x01, 0x00, 0x02, 0x00, 0x44, 0x03, 0x07, 0x00, 0x02, + 0x00, 0x64, 0x03, 0x07, 0x00, 0x02, 0x00, 0x44, 0x03, 0x23, 0x00, 0x02, 0x00, 0x64, 0x03, 0x23, + 0x00, 0x02, 0x00, 0x44, 0x03, 0x31, 0x00, 0x02, 0x00, 0x64, 0x03, 0x31, 0x00, 0x02, 0x00, 0x44, + 0x03, 0x27, 0x00, 0x02, 0x00, 0x64, 0x03, 0x27, 0x00, 0x02, 0x00, 0x44, 0x03, 0x2D, 0x00, 0x02, + 0x00, 0x64, 0x03, 0x2D, 0x00, 0x02, 0x01, 0x12, 0x03, 0x00, 0x00, 0x02, 0x01, 0x13, 0x03, 0x00, + 0x00, 0x02, 0x01, 0x12, 0x03, 0x01, 0x00, 0x02, 0x01, 0x13, 0x03, 0x01, 0x00, 0x02, 0x00, 0x45, + 0x03, 0x2D, 0x00, 0x02, 0x00, 0x65, 0x03, 0x2D, 0x00, 0x02, 0x00, 0x45, 0x03, 0x30, 0x00, 0x02, + 0x00, 0x65, 0x03, 0x30, 0x00, 0x02, 0x01, 0x14, 0x03, 0x27, 0x00, 0x02, 0x01, 0x15, 0x03, 0x27, + 0x00, 0x02, 0x00, 0x46, 0x03, 0x07, 0x00, 0x02, 0x00, 0x66, 0x03, 0x07, 0x00, 0x02, 0x00, 0x47, + 0x03, 0x04, 0x00, 0x02, 0x00, 0x67, 0x03, 0x04, 0x00, 0x02, 0x00, 0x48, 0x03, 0x07, 0x00, 0x02, + 0x00, 0x68, 0x03, 0x07, 0x00, 0x02, 0x00, 0x48, 0x03, 0x23, 0x00, 0x02, 0x00, 0x68, 0x03, 0x23, + 0x00, 0x02, 0x00, 0x48, 0x03, 0x08, 0x00, 0x02, 0x00, 0x68, 0x03, 0x08, 0x00, 0x02, 0x00, 0x48, + 0x03, 0x27, 0x00, 0x02, 0x00, 0x68, 0x03, 0x27, 0x00, 0x02, 0x00, 0x48, 0x03, 0x2E, 0x00, 0x02, + 0x00, 0x68, 0x03, 0x2E, 0x00, 0x02, 0x00, 0x49, 0x03, 0x30, 0x00, 0x02, 0x00, 0x69, 0x03, 0x30, + 0x00, 0x02, 0x00, 0x49, 0x03, 0x44, 0x00, 0x02, 0x00, 0x69, 0x03, 0x44, 0x00, 0x02, 0x00, 0x4B, + 0x03, 0x01, 0x00, 0x02, 0x00, 0x6B, 0x03, 0x01, 0x00, 0x02, 0x00, 0x4B, 0x03, 0x23, 0x00, 0x02, + 0x00, 0x6B, 0x03, 0x23, 0x00, 0x02, 0x00, 0x4B, 0x03, 0x31, 0x00, 0x02, 0x00, 0x6B, 0x03, 0x31, + 0x00, 0x02, 0x00, 0x4C, 0x03, 0x23, 0x00, 0x02, 0x00, 0x6C, 0x03, 0x23, 0x00, 0x02, 0x1E, 0x36, + 0x03, 0x04, 0x00, 0x02, 0x1E, 0x37, 0x03, 0x04, 0x00, 0x02, 0x00, 0x4C, 0x03, 0x31, 0x00, 0x02, + 0x00, 0x6C, 0x03, 0x31, 0x00, 0x02, 0x00, 0x4C, 0x03, 0x2D, 0x00, 0x02, 0x00, 0x6C, 0x03, 0x2D, + 0x00, 0x02, 0x00, 0x4D, 0x03, 0x01, 0x00, 0x02, 0x00, 0x6D, 0x03, 0x01, 0x00, 0x02, 0x00, 0x4D, + 0x03, 0x07, 0x00, 0x02, 0x00, 0x6D, 0x03, 0x07, 0x00, 0x02, 0x00, 0x4D, 0x03, 0x23, 0x00, 0x02, + 0x00, 0x6D, 0x03, 0x23, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x07, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x07, + 0x00, 0x02, 0x00, 0x4E, 0x03, 0x23, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x23, 0x00, 0x02, 0x00, 0x4E, + 0x03, 0x31, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x31, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x2D, 0x00, 0x02, + 0x00, 0x6E, 0x03, 0x2D, 0x00, 0x02, 0x00, 0xD5, 0x03, 0x01, 0x00, 0x02, 0x00, 0xF5, 0x03, 0x01, + 0x00, 0x02, 0x00, 0xD5, 0x03, 0x08, 0x00, 0x02, 0x00, 0xF5, 0x03, 0x08, 0x00, 0x02, 0x01, 0x4C, + 0x03, 0x00, 0x00, 0x02, 0x01, 0x4D, 0x03, 0x00, 0x00, 0x02, 0x01, 0x4C, 0x03, 0x01, 0x00, 0x02, + 0x01, 0x4D, 0x03, 0x01, 0x00, 0x02, 0x00, 0x50, 0x03, 0x01, 0x00, 0x02, 0x00, 0x70, 0x03, 0x01, + 0x00, 0x02, 0x00, 0x50, 0x03, 0x07, 0x00, 0x02, 0x00, 0x70, 0x03, 0x07, 0x00, 0x02, 0x00, 0x52, + 0x03, 0x07, 0x00, 0x02, 0x00, 0x72, 0x03, 0x07, 0x00, 0x02, 0x00, 0x52, 0x03, 0x23, 0x00, 0x02, + 0x00, 0x72, 0x03, 0x23, 0x00, 0x02, 0x1E, 0x5A, 0x03, 0x04, 0x00, 0x02, 0x1E, 0x5B, 0x03, 0x04, + 0x00, 0x02, 0x00, 0x52, 0x03, 0x31, 0x00, 0x02, 0x00, 0x72, 0x03, 0x31, 0x00, 0x02, 0x00, 0x53, + 0x03, 0x07, 0x00, 0x02, 0x00, 0x73, 0x03, 0x07, 0x00, 0x02, 0x00, 0x53, 0x03, 0x23, 0x00, 0x02, + 0x00, 0x73, 0x03, 0x23, 0x00, 0x02, 0x01, 0x5A, 0x03, 0x07, 0x00, 0x02, 0x01, 0x5B, 0x03, 0x07, + 0x00, 0x02, 0x01, 0x60, 0x03, 0x07, 0x00, 0x02, 0x01, 0x61, 0x03, 0x07, 0x00, 0x02, 0x1E, 0x60, + 0x03, 0x23, 0x00, 0x02, 0x1E, 0x61, 0x03, 0x23, 0x00, 0x02, 0x00, 0x54, 0x03, 0x07, 0x00, 0x02, + 0x00, 0x74, 0x03, 0x07, 0x00, 0x02, 0x00, 0x54, 0x03, 0x23, 0x00, 0x02, 0x00, 0x74, 0x03, 0x23, + 0x00, 0x02, 0x00, 0x54, 0x03, 0x31, 0x00, 0x02, 0x00, 0x74, 0x03, 0x31, 0x00, 0x02, 0x00, 0x54, + 0x03, 0x2D, 0x00, 0x02, 0x00, 0x74, 0x03, 0x2D, 0x00, 0x02, 0x00, 0x55, 0x03, 0x24, 0x00, 0x02, + 0x00, 0x75, 0x03, 0x24, 0x00, 0x02, 0x00, 0x55, 0x03, 0x30, 0x00, 0x02, 0x00, 0x75, 0x03, 0x30, + 0x00, 0x02, 0x00, 0x55, 0x03, 0x2D, 0x00, 0x02, 0x00, 0x75, 0x03, 0x2D, 0x00, 0x02, 0x01, 0x68, + 0x03, 0x01, 0x00, 0x02, 0x01, 0x69, 0x03, 0x01, 0x00, 0x02, 0x01, 0x6A, 0x03, 0x08, 0x00, 0x02, + 0x01, 0x6B, 0x03, 0x08, 0x00, 0x02, 0x00, 0x56, 0x03, 0x03, 0x00, 0x02, 0x00, 0x76, 0x03, 0x03, + 0x00, 0x02, 0x00, 0x56, 0x03, 0x23, 0x00, 0x02, 0x00, 0x76, 0x03, 0x23, 0x00, 0x02, 0x00, 0x57, + 0x03, 0x00, 0x00, 0x02, 0x00, 0x77, 0x03, 0x00, 0x00, 0x02, 0x00, 0x57, 0x03, 0x01, 0x00, 0x02, + 0x00, 0x77, 0x03, 0x01, 0x00, 0x02, 0x00, 0x57, 0x03, 0x08, 0x00, 0x02, 0x00, 0x77, 0x03, 0x08, + 0x00, 0x02, 0x00, 0x57, 0x03, 0x07, 0x00, 0x02, 0x00, 0x77, 0x03, 0x07, 0x00, 0x02, 0x00, 0x57, + 0x03, 0x23, 0x00, 0x02, 0x00, 0x77, 0x03, 0x23, 0x00, 0x02, 0x00, 0x58, 0x03, 0x07, 0x00, 0x02, + 0x00, 0x78, 0x03, 0x07, 0x00, 0x02, 0x00, 0x58, 0x03, 0x08, 0x00, 0x02, 0x00, 0x78, 0x03, 0x08, + 0x00, 0x02, 0x00, 0x59, 0x03, 0x07, 0x00, 0x02, 0x00, 0x79, 0x03, 0x07, 0x00, 0x02, 0x00, 0x5A, + 0x03, 0x02, 0x00, 0x02, 0x00, 0x7A, 0x03, 0x02, 0x00, 0x02, 0x00, 0x5A, 0x03, 0x23, 0x00, 0x02, + 0x00, 0x7A, 0x03, 0x23, 0x00, 0x02, 0x00, 0x5A, 0x03, 0x31, 0x00, 0x02, 0x00, 0x7A, 0x03, 0x31, + 0x00, 0x02, 0x00, 0x68, 0x03, 0x31, 0x00, 0x02, 0x00, 0x74, 0x03, 0x08, 0x00, 0x02, 0x00, 0x77, + 0x03, 0x0A, 0x00, 0x02, 0x00, 0x79, 0x03, 0x0A, 0x00, 0x02, 0x01, 0x7F, 0x03, 0x07, 0x00, 0x02, + 0x00, 0x41, 0x03, 0x23, 0x00, 0x02, 0x00, 0x61, 0x03, 0x23, 0x00, 0x02, 0x00, 0x41, 0x03, 0x09, + 0x00, 0x02, 0x00, 0x61, 0x03, 0x09, 0x00, 0x02, 0x00, 0xC2, 0x03, 0x01, 0x00, 0x02, 0x00, 0xE2, + 0x03, 0x01, 0x00, 0x02, 0x00, 0xC2, 0x03, 0x00, 0x00, 0x02, 0x00, 0xE2, 0x03, 0x00, 0x00, 0x02, + 0x00, 0xC2, 0x03, 0x09, 0x00, 0x02, 0x00, 0xE2, 0x03, 0x09, 0x00, 0x02, 0x00, 0xC2, 0x03, 0x03, + 0x00, 0x02, 0x00, 0xE2, 0x03, 0x03, 0x00, 0x02, 0x00, 0xC2, 0x03, 0x23, 0x00, 0x02, 0x00, 0xE2, + 0x03, 0x23, 0x00, 0x02, 0x01, 0x02, 0x03, 0x01, 0x00, 0x02, 0x01, 0x03, 0x03, 0x01, 0x00, 0x02, + 0x01, 0x02, 0x03, 0x00, 0x00, 0x02, 0x01, 0x03, 0x03, 0x00, 0x00, 0x02, 0x01, 0x02, 0x03, 0x09, + 0x00, 0x02, 0x01, 0x03, 0x03, 0x09, 0x00, 0x02, 0x01, 0x02, 0x03, 0x03, 0x00, 0x02, 0x01, 0x03, + 0x03, 0x03, 0x00, 0x02, 0x01, 0x02, 0x03, 0x23, 0x00, 0x02, 0x01, 0x03, 0x03, 0x23, 0x00, 0x02, + 0x00, 0x45, 0x03, 0x23, 0x00, 0x02, 0x00, 0x65, 0x03, 0x23, 0x00, 0x02, 0x00, 0x45, 0x03, 0x09, + 0x00, 0x02, 0x00, 0x65, 0x03, 0x09, 0x00, 0x02, 0x00, 0x45, 0x03, 0x03, 0x00, 0x02, 0x00, 0x65, + 0x03, 0x03, 0x00, 0x02, 0x00, 0xCA, 0x03, 0x01, 0x00, 0x02, 0x00, 0xEA, 0x03, 0x01, 0x00, 0x02, + 0x00, 0xCA, 0x03, 0x00, 0x00, 0x02, 0x00, 0xEA, 0x03, 0x00, 0x00, 0x02, 0x00, 0xCA, 0x03, 0x09, + 0x00, 0x02, 0x00, 0xEA, 0x03, 0x09, 0x00, 0x02, 0x00, 0xCA, 0x03, 0x03, 0x00, 0x02, 0x00, 0xEA, + 0x03, 0x03, 0x00, 0x02, 0x00, 0xCA, 0x03, 0x23, 0x00, 0x02, 0x00, 0xEA, 0x03, 0x23, 0x00, 0x02, + 0x00, 0x49, 0x03, 0x09, 0x00, 0x02, 0x00, 0x69, 0x03, 0x09, 0x00, 0x02, 0x00, 0x49, 0x03, 0x23, + 0x00, 0x02, 0x00, 0x69, 0x03, 0x23, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x23, 0x00, 0x02, 0x00, 0x6F, + 0x03, 0x23, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x09, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x09, 0x00, 0x02, + 0x00, 0xD4, 0x03, 0x01, 0x00, 0x02, 0x00, 0xF4, 0x03, 0x01, 0x00, 0x02, 0x00, 0xD4, 0x03, 0x00, + 0x00, 0x02, 0x00, 0xF4, 0x03, 0x00, 0x00, 0x02, 0x00, 0xD4, 0x03, 0x09, 0x00, 0x02, 0x00, 0xF4, + 0x03, 0x09, 0x00, 0x02, 0x00, 0xD4, 0x03, 0x03, 0x00, 0x02, 0x00, 0xF4, 0x03, 0x03, 0x00, 0x02, + 0x00, 0xD4, 0x03, 0x23, 0x00, 0x02, 0x00, 0xF4, 0x03, 0x23, 0x00, 0x02, 0x00, 0xD3, 0x03, 0x1B, + 0x00, 0x02, 0x00, 0xF3, 0x03, 0x1B, 0x00, 0x02, 0x00, 0xD2, 0x03, 0x1B, 0x00, 0x02, 0x00, 0xF2, + 0x03, 0x1B, 0x00, 0x02, 0x01, 0xA0, 0x03, 0x09, 0x00, 0x02, 0x01, 0xA1, 0x03, 0x09, 0x00, 0x02, + 0x00, 0xD5, 0x03, 0x1B, 0x00, 0x02, 0x00, 0xF5, 0x03, 0x1B, 0x00, 0x02, 0x01, 0xA0, 0x03, 0x23, + 0x00, 0x02, 0x01, 0xA1, 0x03, 0x23, 0x00, 0x02, 0x00, 0x55, 0x03, 0x23, 0x00, 0x02, 0x00, 0x75, + 0x03, 0x23, 0x00, 0x02, 0x00, 0x55, 0x03, 0x09, 0x00, 0x02, 0x00, 0x75, 0x03, 0x09, 0x00, 0x02, + 0x00, 0xDA, 0x03, 0x1B, 0x00, 0x02, 0x00, 0xFA, 0x03, 0x1B, 0x00, 0x02, 0x00, 0xD9, 0x03, 0x1B, + 0x00, 0x02, 0x00, 0xF9, 0x03, 0x1B, 0x00, 0x02, 0x01, 0xAF, 0x03, 0x09, 0x00, 0x02, 0x01, 0xB0, + 0x03, 0x09, 0x00, 0x02, 0x01, 0x68, 0x03, 0x1B, 0x00, 0x02, 0x01, 0x69, 0x03, 0x1B, 0x00, 0x02, + 0x01, 0xAF, 0x03, 0x23, 0x00, 0x02, 0x01, 0xB0, 0x03, 0x23, 0x00, 0x02, 0x00, 0x59, 0x03, 0x00, + 0x00, 0x02, 0x00, 0x79, 0x03, 0x00, 0x00, 0x02, 0x00, 0x59, 0x03, 0x23, 0x00, 0x02, 0x00, 0x79, + 0x03, 0x23, 0x00, 0x02, 0x00, 0x59, 0x03, 0x09, 0x00, 0x02, 0x00, 0x79, 0x03, 0x09, 0x00, 0x02, + 0x00, 0x59, 0x03, 0x03, 0x00, 0x02, 0x00, 0x79, 0x03, 0x03, 0x00, 0x01, 0x01, 0xF1, 0x00, 0xC0, + 0x00, 0xC1, 0x00, 0xC2, 0x00, 0xC3, 0x00, 0xC4, 0x00, 0xC5, 0x00, 0xC7, 0x00, 0xC8, 0x00, 0xC9, + 0x00, 0xCA, 0x00, 0xCB, 0x00, 0xCC, 0x00, 0xCD, 0x00, 0xCE, 0x00, 0xCF, 0x00, 0xD1, 0x00, 0xD2, + 0x00, 0xD3, 0x00, 0xD4, 0x00, 0xD5, 0x00, 0xD6, 0x00, 0xD9, 0x00, 0xDA, 0x00, 0xDB, 0x00, 0xDC, + 0x00, 0xDD, 0x00, 0xE0, 0x00, 0xE1, 0x00, 0xE2, 0x00, 0xE3, 0x00, 0xE4, 0x00, 0xE5, 0x00, 0xE7, + 0x00, 0xE8, 0x00, 0xE9, 0x00, 0xEA, 0x00, 0xEB, 0x00, 0xEC, 0x00, 0xED, 0x00, 0xEE, 0x00, 0xEF, + 0x00, 0xF1, 0x00, 0xF2, 0x00, 0xF3, 0x00, 0xF4, 0x00, 0xF5, 0x00, 0xF6, 0x00, 0xF9, 0x00, 0xFA, + 0x00, 0xFB, 0x00, 0xFC, 0x00, 0xFD, 0x00, 0xFF, 0x01, 0x00, 0x01, 0x01, 0x01, 0x02, 0x01, 0x03, + 0x01, 0x04, 0x01, 0x05, 0x01, 0x06, 0x01, 0x07, 0x01, 0x08, 0x01, 0x09, 0x01, 0x0A, 0x01, 0x0B, + 0x01, 0x0C, 0x01, 0x0D, 0x01, 0x0E, 0x01, 0x0F, 0x01, 0x12, 0x01, 0x13, 0x01, 0x14, 0x01, 0x15, + 0x01, 0x16, 0x01, 0x17, 0x01, 0x18, 0x01, 0x19, 0x01, 0x1A, 0x01, 0x1B, 0x01, 0x1C, 0x01, 0x1D, + 0x01, 0x1E, 0x01, 0x1F, 0x01, 0x20, 0x01, 0x21, 0x01, 0x22, 0x01, 0x23, 0x01, 0x24, 0x01, 0x25, + 0x01, 0x28, 0x01, 0x29, 0x01, 0x2A, 0x01, 0x2B, 0x01, 0x2C, 0x01, 0x2D, 0x01, 0x2E, 0x01, 0x2F, + 0x01, 0x30, 0x01, 0x34, 0x01, 0x35, 0x01, 0x36, 0x01, 0x37, 0x01, 0x39, 0x01, 0x3A, 0x01, 0x3B, + 0x01, 0x3C, 0x01, 0x3D, 0x01, 0x3E, 0x01, 0x43, 0x01, 0x44, 0x01, 0x45, 0x01, 0x46, 0x01, 0x47, + 0x01, 0x48, 0x01, 0x4C, 0x01, 0x4D, 0x01, 0x4E, 0x01, 0x4F, 0x01, 0x50, 0x01, 0x51, 0x01, 0x54, + 0x01, 0x55, 0x01, 0x56, 0x01, 0x57, 0x01, 0x58, 0x01, 0x59, 0x01, 0x5A, 0x01, 0x5B, 0x01, 0x5C, + 0x01, 0x5D, 0x01, 0x5E, 0x01, 0x5F, 0x01, 0x60, 0x01, 0x61, 0x01, 0x62, 0x01, 0x63, 0x01, 0x64, + 0x01, 0x65, 0x01, 0x68, 0x01, 0x69, 0x01, 0x6A, 0x01, 0x6B, 0x01, 0x6C, 0x01, 0x6D, 0x01, 0x6E, + 0x01, 0x6F, 0x01, 0x70, 0x01, 0x71, 0x01, 0x72, 0x01, 0x73, 0x01, 0x74, 0x01, 0x75, 0x01, 0x76, + 0x01, 0x77, 0x01, 0x78, 0x01, 0x79, 0x01, 0x7A, 0x01, 0x7B, 0x01, 0x7C, 0x01, 0x7D, 0x01, 0x7E, + 0x01, 0xA0, 0x01, 0xA1, 0x01, 0xAF, 0x01, 0xB0, 0x01, 0xCD, 0x01, 0xCE, 0x01, 0xCF, 0x01, 0xD0, + 0x01, 0xD1, 0x01, 0xD2, 0x01, 0xD3, 0x01, 0xD4, 0x01, 0xD5, 0x01, 0xD6, 0x01, 0xD7, 0x01, 0xD8, 0x01, 0xD9, 0x01, 0xDA, 0x01, 0xDB, 0x01, 0xDC, 0x01, 0xDE, 0x01, 0xDF, 0x01, 0xE0, 0x01, 0xE1, - 0x01, 0xE8, 0x01, 0xEC, 0x01, 0xED, 0x01, 0xF4, 0x01, 0xF5, 0x01, 0xF8, 0x01, 0xF9, 0x01, 0xFA, - 0x01, 0xFB, 0x01, 0xFC, 0x01, 0xFD, 0x01, 0xFE, 0x01, 0xFF, 0x02, 0x2A, 0x02, 0x2B, 0x02, 0x2C, - 0x02, 0x2D, 0x02, 0x30, 0x02, 0x31, 0x1E, 0x08, 0x1E, 0x09, 0x1E, 0x14, 0x1E, 0x15, 0x1E, 0x16, - 0x1E, 0x17, 0x1E, 0x1C, 0x1E, 0x1D, 0x1E, 0x2E, 0x1E, 0x2F, 0x1E, 0x30, 0x1E, 0x31, 0x1E, 0x32, - 0x1E, 0x34, 0x1E, 0x38, 0x1E, 0x39, 0x1E, 0x3E, 0x1E, 0x3F, 0x1E, 0x4C, 0x1E, 0x4D, 0x1E, 0x4E, - 0x1E, 0x4F, 0x1E, 0x50, 0x1E, 0x51, 0x1E, 0x52, 0x1E, 0x53, 0x1E, 0x54, 0x1E, 0x55, 0x1E, 0x5C, - 0x1E, 0x5D, 0x1E, 0x64, 0x1E, 0x65, 0x1E, 0x66, 0x1E, 0x67, 0x1E, 0x68, 0x1E, 0x69, 0x1E, 0x78, - 0x1E, 0x79, 0x1E, 0x7A, 0x1E, 0x7B, 0x1E, 0x80, 0x1E, 0x81, 0x1E, 0x82, 0x1E, 0x83, 0x1E, 0xA4, - 0x1E, 0xA5, 0x1E, 0xA6, 0x1E, 0xA7, 0x1E, 0xA8, 0x1E, 0xA9, 0x1E, 0xAA, 0x1E, 0xAB, 0x1E, 0xAC, - 0x1E, 0xAD, 0x1E, 0xAE, 0x1E, 0xAF, 0x1E, 0xB0, 0x1E, 0xB1, 0x1E, 0xB2, 0x1E, 0xB3, 0x1E, 0xB4, - 0x1E, 0xB5, 0x1E, 0xB6, 0x1E, 0xB7, 0x1E, 0xBE, 0x1E, 0xBF, 0x1E, 0xC0, 0x1E, 0xC1, 0x1E, 0xC2, - 0x1E, 0xC3, 0x1E, 0xC4, 0x1E, 0xC5, 0x1E, 0xC6, 0x1E, 0xC7, 0x1E, 0xD0, 0x1E, 0xD1, 0x1E, 0xD2, - 0x1E, 0xD3, 0x1E, 0xD4, 0x1E, 0xD5, 0x1E, 0xD6, 0x1E, 0xD7, 0x1E, 0xD8, 0x1E, 0xD9, 0x1E, 0xDA, + 0x01, 0xE2, 0x01, 0xE3, 0x01, 0xE6, 0x01, 0xE7, 0x01, 0xE8, 0x01, 0xE9, 0x01, 0xEA, 0x01, 0xEB, + 0x01, 0xEC, 0x01, 0xED, 0x01, 0xEE, 0x01, 0xEF, 0x01, 0xF0, 0x01, 0xF4, 0x01, 0xF5, 0x01, 0xF8, + 0x01, 0xF9, 0x01, 0xFA, 0x01, 0xFB, 0x01, 0xFC, 0x01, 0xFD, 0x01, 0xFE, 0x01, 0xFF, 0x02, 0x00, + 0x02, 0x01, 0x02, 0x02, 0x02, 0x03, 0x02, 0x04, 0x02, 0x05, 0x02, 0x06, 0x02, 0x07, 0x02, 0x08, + 0x02, 0x09, 0x02, 0x0A, 0x02, 0x0B, 0x02, 0x0C, 0x02, 0x0D, 0x02, 0x0E, 0x02, 0x0F, 0x02, 0x10, + 0x02, 0x11, 0x02, 0x12, 0x02, 0x13, 0x02, 0x14, 0x02, 0x15, 0x02, 0x16, 0x02, 0x17, 0x02, 0x18, + 0x02, 0x19, 0x02, 0x1A, 0x02, 0x1B, 0x02, 0x1E, 0x02, 0x1F, 0x02, 0x26, 0x02, 0x27, 0x02, 0x28, + 0x02, 0x29, 0x02, 0x2A, 0x02, 0x2B, 0x02, 0x2C, 0x02, 0x2D, 0x02, 0x2E, 0x02, 0x2F, 0x02, 0x30, + 0x02, 0x31, 0x02, 0x32, 0x02, 0x33, 0x1E, 0x00, 0x1E, 0x01, 0x1E, 0x02, 0x1E, 0x03, 0x1E, 0x04, + 0x1E, 0x05, 0x1E, 0x06, 0x1E, 0x07, 0x1E, 0x08, 0x1E, 0x09, 0x1E, 0x0A, 0x1E, 0x0B, 0x1E, 0x0C, + 0x1E, 0x0D, 0x1E, 0x0E, 0x1E, 0x0F, 0x1E, 0x10, 0x1E, 0x11, 0x1E, 0x12, 0x1E, 0x13, 0x1E, 0x14, + 0x1E, 0x15, 0x1E, 0x16, 0x1E, 0x17, 0x1E, 0x18, 0x1E, 0x19, 0x1E, 0x1A, 0x1E, 0x1B, 0x1E, 0x1C, + 0x1E, 0x1D, 0x1E, 0x1E, 0x1E, 0x1F, 0x1E, 0x20, 0x1E, 0x21, 0x1E, 0x22, 0x1E, 0x23, 0x1E, 0x24, + 0x1E, 0x25, 0x1E, 0x26, 0x1E, 0x27, 0x1E, 0x28, 0x1E, 0x29, 0x1E, 0x2A, 0x1E, 0x2B, 0x1E, 0x2C, + 0x1E, 0x2D, 0x1E, 0x2E, 0x1E, 0x2F, 0x1E, 0x30, 0x1E, 0x31, 0x1E, 0x32, 0x1E, 0x33, 0x1E, 0x34, + 0x1E, 0x35, 0x1E, 0x36, 0x1E, 0x37, 0x1E, 0x38, 0x1E, 0x39, 0x1E, 0x3A, 0x1E, 0x3B, 0x1E, 0x3C, + 0x1E, 0x3D, 0x1E, 0x3E, 0x1E, 0x3F, 0x1E, 0x40, 0x1E, 0x41, 0x1E, 0x42, 0x1E, 0x43, 0x1E, 0x44, + 0x1E, 0x45, 0x1E, 0x46, 0x1E, 0x47, 0x1E, 0x48, 0x1E, 0x49, 0x1E, 0x4A, 0x1E, 0x4B, 0x1E, 0x4C, + 0x1E, 0x4D, 0x1E, 0x4E, 0x1E, 0x4F, 0x1E, 0x50, 0x1E, 0x51, 0x1E, 0x52, 0x1E, 0x53, 0x1E, 0x54, + 0x1E, 0x55, 0x1E, 0x56, 0x1E, 0x57, 0x1E, 0x58, 0x1E, 0x59, 0x1E, 0x5A, 0x1E, 0x5B, 0x1E, 0x5C, + 0x1E, 0x5D, 0x1E, 0x5E, 0x1E, 0x5F, 0x1E, 0x60, 0x1E, 0x61, 0x1E, 0x62, 0x1E, 0x63, 0x1E, 0x64, + 0x1E, 0x65, 0x1E, 0x66, 0x1E, 0x67, 0x1E, 0x68, 0x1E, 0x69, 0x1E, 0x6A, 0x1E, 0x6B, 0x1E, 0x6C, + 0x1E, 0x6D, 0x1E, 0x6E, 0x1E, 0x6F, 0x1E, 0x70, 0x1E, 0x71, 0x1E, 0x72, 0x1E, 0x73, 0x1E, 0x74, + 0x1E, 0x75, 0x1E, 0x76, 0x1E, 0x77, 0x1E, 0x78, 0x1E, 0x79, 0x1E, 0x7A, 0x1E, 0x7B, 0x1E, 0x7C, + 0x1E, 0x7D, 0x1E, 0x7E, 0x1E, 0x7F, 0x1E, 0x80, 0x1E, 0x81, 0x1E, 0x82, 0x1E, 0x83, 0x1E, 0x84, + 0x1E, 0x85, 0x1E, 0x86, 0x1E, 0x87, 0x1E, 0x88, 0x1E, 0x89, 0x1E, 0x8A, 0x1E, 0x8B, 0x1E, 0x8C, + 0x1E, 0x8D, 0x1E, 0x8E, 0x1E, 0x8F, 0x1E, 0x90, 0x1E, 0x91, 0x1E, 0x92, 0x1E, 0x93, 0x1E, 0x94, + 0x1E, 0x95, 0x1E, 0x96, 0x1E, 0x97, 0x1E, 0x98, 0x1E, 0x99, 0x1E, 0x9B, 0x1E, 0xA0, 0x1E, 0xA1, + 0x1E, 0xA2, 0x1E, 0xA3, 0x1E, 0xA4, 0x1E, 0xA5, 0x1E, 0xA6, 0x1E, 0xA7, 0x1E, 0xA8, 0x1E, 0xA9, + 0x1E, 0xAA, 0x1E, 0xAB, 0x1E, 0xAC, 0x1E, 0xAD, 0x1E, 0xAE, 0x1E, 0xAF, 0x1E, 0xB0, 0x1E, 0xB1, + 0x1E, 0xB2, 0x1E, 0xB3, 0x1E, 0xB4, 0x1E, 0xB5, 0x1E, 0xB6, 0x1E, 0xB7, 0x1E, 0xB8, 0x1E, 0xB9, + 0x1E, 0xBA, 0x1E, 0xBB, 0x1E, 0xBC, 0x1E, 0xBD, 0x1E, 0xBE, 0x1E, 0xBF, 0x1E, 0xC0, 0x1E, 0xC1, + 0x1E, 0xC2, 0x1E, 0xC3, 0x1E, 0xC4, 0x1E, 0xC5, 0x1E, 0xC6, 0x1E, 0xC7, 0x1E, 0xC8, 0x1E, 0xC9, + 0x1E, 0xCA, 0x1E, 0xCB, 0x1E, 0xCC, 0x1E, 0xCD, 0x1E, 0xCE, 0x1E, 0xCF, 0x1E, 0xD0, 0x1E, 0xD1, + 0x1E, 0xD2, 0x1E, 0xD3, 0x1E, 0xD4, 0x1E, 0xD5, 0x1E, 0xD6, 0x1E, 0xD7, 0x1E, 0xD8, 0x1E, 0xD9, + 0x1E, 0xDA, 0x1E, 0xDB, 0x1E, 0xDC, 0x1E, 0xDD, 0x1E, 0xDE, 0x1E, 0xDF, 0x1E, 0xE0, 0x1E, 0xE1, + 0x1E, 0xE2, 0x1E, 0xE3, 0x1E, 0xE4, 0x1E, 0xE5, 0x1E, 0xE6, 0x1E, 0xE7, 0x1E, 0xE8, 0x1E, 0xE9, + 0x1E, 0xEA, 0x1E, 0xEB, 0x1E, 0xEC, 0x1E, 0xED, 0x1E, 0xEE, 0x1E, 0xEF, 0x1E, 0xF0, 0x1E, 0xF1, + 0x1E, 0xF2, 0x1E, 0xF3, 0x1E, 0xF4, 0x1E, 0xF5, 0x1E, 0xF6, 0x1E, 0xF7, 0x1E, 0xF8, 0x1E, 0xF9, + 0x00, 0x01, 0x05, 0xBA, 0x00, 0xAC, 0x01, 0x5E, 0x01, 0x64, 0x01, 0x6A, 0x01, 0x70, 0x01, 0x76, + 0x01, 0x7C, 0x01, 0x82, 0x01, 0x88, 0x01, 0x8E, 0x01, 0x94, 0x01, 0x9A, 0x01, 0xA0, 0x01, 0xA6, + 0x01, 0xAC, 0x01, 0xB2, 0x01, 0xB8, 0x01, 0xBE, 0x01, 0xC4, 0x01, 0xCA, 0x01, 0xD0, 0x01, 0xD6, + 0x01, 0xDC, 0x01, 0xE2, 0x01, 0xE8, 0x01, 0xEE, 0x01, 0xF4, 0x01, 0xFA, 0x02, 0x00, 0x02, 0x06, + 0x02, 0x0C, 0x02, 0x12, 0x02, 0x18, 0x02, 0x1E, 0x02, 0x24, 0x02, 0x2A, 0x02, 0x30, 0x02, 0x38, + 0x02, 0x40, 0x02, 0x46, 0x02, 0x4C, 0x02, 0x54, 0x02, 0x5C, 0x02, 0x62, 0x02, 0x68, 0x02, 0x70, + 0x02, 0x78, 0x02, 0x80, 0x02, 0x88, 0x02, 0x8E, 0x02, 0x94, 0x02, 0x9A, 0x02, 0xA0, 0x02, 0xA6, + 0x02, 0xAC, 0x02, 0xB2, 0x02, 0xB8, 0x02, 0xBE, 0x02, 0xC4, 0x02, 0xCA, 0x02, 0xD0, 0x02, 0xD6, + 0x02, 0xDE, 0x02, 0xE6, 0x02, 0xEE, 0x02, 0xF6, 0x02, 0xFE, 0x03, 0x06, 0x03, 0x0C, 0x03, 0x12, + 0x03, 0x18, 0x03, 0x1E, 0x03, 0x24, 0x03, 0x2A, 0x03, 0x30, 0x03, 0x36, 0x03, 0x3C, 0x03, 0x42, + 0x03, 0x48, 0x03, 0x4E, 0x03, 0x54, 0x03, 0x5A, 0x03, 0x62, 0x03, 0x6A, 0x03, 0x70, 0x03, 0x76, + 0x03, 0x7C, 0x03, 0x82, 0x03, 0x8A, 0x03, 0x92, 0x03, 0x98, 0x03, 0x9E, 0x03, 0xA4, 0x03, 0xAA, + 0x03, 0xB0, 0x03, 0xB6, 0x03, 0xBE, 0x03, 0xC6, 0x03, 0xCE, 0x03, 0xD6, 0x03, 0xDE, 0x03, 0xE6, + 0x03, 0xEC, 0x03, 0xF2, 0x03, 0xF8, 0x03, 0xFE, 0x04, 0x06, 0x04, 0x0E, 0x04, 0x14, 0x04, 0x1A, + 0x04, 0x20, 0x04, 0x26, 0x04, 0x2C, 0x04, 0x32, 0x04, 0x38, 0x04, 0x3E, 0x04, 0x46, 0x04, 0x4E, + 0x04, 0x56, 0x04, 0x5E, 0x04, 0x64, 0x04, 0x6A, 0x04, 0x70, 0x04, 0x76, 0x04, 0x7C, 0x04, 0x82, + 0x04, 0x8A, 0x04, 0x92, 0x04, 0x9A, 0x04, 0xA2, 0x04, 0xA8, 0x04, 0xAE, 0x04, 0xB4, 0x04, 0xBA, + 0x04, 0xC0, 0x04, 0xC6, 0x04, 0xCE, 0x04, 0xD6, 0x04, 0xDE, 0x04, 0xE6, 0x04, 0xEC, 0x04, 0xF2, + 0x04, 0xF8, 0x04, 0xFE, 0x05, 0x04, 0x05, 0x0A, 0x05, 0x12, 0x05, 0x1A, 0x05, 0x22, 0x05, 0x2A, + 0x05, 0x30, 0x05, 0x36, 0x05, 0x3C, 0x05, 0x42, 0x05, 0x48, 0x05, 0x4E, 0x05, 0x54, 0x05, 0x5A, + 0x05, 0x60, 0x05, 0x66, 0x05, 0x6C, 0x05, 0x72, 0x05, 0x78, 0x05, 0x7E, 0x05, 0x84, 0x05, 0x8A, + 0x05, 0x90, 0x05, 0x96, 0x05, 0x9C, 0x05, 0xA2, 0x05, 0xA8, 0x05, 0xAE, 0x05, 0xB4, 0x00, 0x02, + 0x00, 0x41, 0x03, 0x40, 0x00, 0x02, 0x00, 0x41, 0x03, 0x41, 0x00, 0x02, 0x00, 0x45, 0x03, 0x40, + 0x00, 0x02, 0x00, 0x45, 0x03, 0x41, 0x00, 0x02, 0x00, 0x49, 0x03, 0x40, 0x00, 0x02, 0x00, 0x49, + 0x03, 0x41, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x40, 0x00, 0x02, 0x00, 0x4F, 0x03, 0x41, 0x00, 0x02, + 0x00, 0x55, 0x03, 0x40, 0x00, 0x02, 0x00, 0x55, 0x03, 0x41, 0x00, 0x02, 0x00, 0x59, 0x03, 0x41, + 0x00, 0x02, 0x00, 0x61, 0x03, 0x40, 0x00, 0x02, 0x00, 0x61, 0x03, 0x41, 0x00, 0x02, 0x00, 0x65, + 0x03, 0x40, 0x00, 0x02, 0x00, 0x65, 0x03, 0x41, 0x00, 0x02, 0x00, 0x69, 0x03, 0x40, 0x00, 0x02, + 0x00, 0x69, 0x03, 0x41, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x40, 0x00, 0x02, 0x00, 0x6F, 0x03, 0x41, + 0x00, 0x02, 0x00, 0x75, 0x03, 0x40, 0x00, 0x02, 0x00, 0x75, 0x03, 0x41, 0x00, 0x02, 0x00, 0x79, + 0x03, 0x41, 0x00, 0x02, 0x00, 0x43, 0x03, 0x41, 0x00, 0x02, 0x00, 0x63, 0x03, 0x41, 0x00, 0x02, + 0x21, 0x2A, 0x03, 0x27, 0x00, 0x02, 0x00, 0x4C, 0x03, 0x41, 0x00, 0x02, 0x00, 0x6C, 0x03, 0x41, + 0x00, 0x02, 0x00, 0x4E, 0x03, 0x41, 0x00, 0x02, 0x00, 0x6E, 0x03, 0x41, 0x00, 0x02, 0x00, 0x52, + 0x03, 0x41, 0x00, 0x02, 0x00, 0x72, 0x03, 0x41, 0x00, 0x02, 0x00, 0x53, 0x03, 0x41, 0x00, 0x02, + 0x00, 0x73, 0x03, 0x41, 0x00, 0x02, 0x00, 0x5A, 0x03, 0x41, 0x00, 0x02, 0x00, 0x7A, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x55, 0x03, 0x08, 0x03, 0x04, 0x00, 0x03, 0x00, 0x75, 0x03, 0x08, 0x03, 0x04, + 0x00, 0x02, 0x00, 0xDC, 0x03, 0x01, 0x00, 0x02, 0x00, 0xFC, 0x03, 0x01, 0x00, 0x03, 0x00, 0x55, + 0x03, 0x08, 0x03, 0x0C, 0x00, 0x03, 0x00, 0x75, 0x03, 0x08, 0x03, 0x0C, 0x00, 0x02, 0x00, 0xDC, + 0x03, 0x40, 0x00, 0x02, 0x00, 0xFC, 0x03, 0x40, 0x00, 0x03, 0x00, 0x41, 0x03, 0x08, 0x03, 0x04, + 0x00, 0x03, 0x00, 0x61, 0x03, 0x08, 0x03, 0x04, 0x00, 0x03, 0x00, 0x41, 0x03, 0x07, 0x03, 0x04, + 0x00, 0x03, 0x00, 0x61, 0x03, 0x07, 0x03, 0x04, 0x00, 0x02, 0x21, 0x2A, 0x03, 0x0C, 0x00, 0x02, + 0x01, 0xEA, 0x03, 0x04, 0x00, 0x02, 0x01, 0xEB, 0x03, 0x04, 0x00, 0x02, 0x00, 0x47, 0x03, 0x41, + 0x00, 0x02, 0x00, 0x67, 0x03, 0x41, 0x00, 0x02, 0x00, 0x4E, 0x03, 0x40, 0x00, 0x02, 0x00, 0x6E, + 0x03, 0x40, 0x00, 0x02, 0x00, 0xC5, 0x03, 0x41, 0x00, 0x02, 0x00, 0xE5, 0x03, 0x41, 0x00, 0x02, + 0x00, 0xC6, 0x03, 0x41, 0x00, 0x02, 0x00, 0xE6, 0x03, 0x41, 0x00, 0x02, 0x00, 0xD8, 0x03, 0x41, + 0x00, 0x02, 0x00, 0xF8, 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x08, 0x03, 0x04, 0x00, 0x03, + 0x00, 0x6F, 0x03, 0x08, 0x03, 0x04, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x03, 0x03, 0x04, 0x00, 0x03, + 0x00, 0x6F, 0x03, 0x03, 0x03, 0x04, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x07, 0x03, 0x04, 0x00, 0x03, + 0x00, 0x6F, 0x03, 0x07, 0x03, 0x04, 0x00, 0x02, 0x00, 0xC7, 0x03, 0x41, 0x00, 0x02, 0x00, 0xE7, + 0x03, 0x41, 0x00, 0x02, 0x01, 0x12, 0x03, 0x40, 0x00, 0x02, 0x01, 0x13, 0x03, 0x40, 0x00, 0x02, + 0x01, 0x12, 0x03, 0x41, 0x00, 0x02, 0x01, 0x13, 0x03, 0x41, 0x00, 0x02, 0x02, 0x28, 0x03, 0x06, + 0x00, 0x02, 0x02, 0x29, 0x03, 0x06, 0x00, 0x02, 0x00, 0xCF, 0x03, 0x01, 0x00, 0x02, 0x00, 0xEF, + 0x03, 0x01, 0x00, 0x02, 0x00, 0x4B, 0x03, 0x41, 0x00, 0x02, 0x00, 0x6B, 0x03, 0x41, 0x00, 0x02, + 0x21, 0x2A, 0x03, 0x23, 0x00, 0x02, 0x21, 0x2A, 0x03, 0x31, 0x00, 0x03, 0x00, 0x4C, 0x03, 0x04, + 0x03, 0x23, 0x00, 0x03, 0x00, 0x6C, 0x03, 0x04, 0x03, 0x23, 0x00, 0x02, 0x00, 0x4D, 0x03, 0x41, + 0x00, 0x02, 0x00, 0x6D, 0x03, 0x41, 0x00, 0x02, 0x00, 0xD5, 0x03, 0x41, 0x00, 0x02, 0x00, 0xF5, + 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x03, 0x03, 0x08, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x03, + 0x03, 0x08, 0x00, 0x02, 0x01, 0x4C, 0x03, 0x40, 0x00, 0x02, 0x01, 0x4D, 0x03, 0x40, 0x00, 0x02, + 0x01, 0x4C, 0x03, 0x41, 0x00, 0x02, 0x01, 0x4D, 0x03, 0x41, 0x00, 0x02, 0x00, 0x50, 0x03, 0x41, + 0x00, 0x02, 0x00, 0x70, 0x03, 0x41, 0x00, 0x03, 0x00, 0x52, 0x03, 0x04, 0x03, 0x23, 0x00, 0x03, + 0x00, 0x72, 0x03, 0x04, 0x03, 0x23, 0x00, 0x03, 0x00, 0x53, 0x03, 0x01, 0x03, 0x07, 0x00, 0x03, + 0x00, 0x73, 0x03, 0x01, 0x03, 0x07, 0x00, 0x03, 0x00, 0x53, 0x03, 0x0C, 0x03, 0x07, 0x00, 0x03, + 0x00, 0x73, 0x03, 0x0C, 0x03, 0x07, 0x00, 0x02, 0x1E, 0x62, 0x03, 0x07, 0x00, 0x02, 0x1E, 0x63, + 0x03, 0x07, 0x00, 0x02, 0x01, 0x68, 0x03, 0x41, 0x00, 0x02, 0x01, 0x69, 0x03, 0x41, 0x00, 0x03, + 0x00, 0x55, 0x03, 0x04, 0x03, 0x08, 0x00, 0x03, 0x00, 0x75, 0x03, 0x04, 0x03, 0x08, 0x00, 0x02, + 0x00, 0x57, 0x03, 0x40, 0x00, 0x02, 0x00, 0x77, 0x03, 0x40, 0x00, 0x02, 0x00, 0x57, 0x03, 0x41, + 0x00, 0x02, 0x00, 0x77, 0x03, 0x41, 0x00, 0x02, 0x00, 0xC2, 0x03, 0x41, 0x00, 0x02, 0x00, 0xE2, + 0x03, 0x41, 0x00, 0x02, 0x00, 0xC2, 0x03, 0x40, 0x00, 0x02, 0x00, 0xE2, 0x03, 0x40, 0x00, 0x03, + 0x00, 0x41, 0x03, 0x02, 0x03, 0x09, 0x00, 0x03, 0x00, 0x61, 0x03, 0x02, 0x03, 0x09, 0x00, 0x03, + 0x00, 0x41, 0x03, 0x02, 0x03, 0x03, 0x00, 0x03, 0x00, 0x61, 0x03, 0x02, 0x03, 0x03, 0x00, 0x02, + 0x1E, 0xA0, 0x03, 0x02, 0x00, 0x02, 0x1E, 0xA1, 0x03, 0x02, 0x00, 0x02, 0x01, 0x02, 0x03, 0x41, + 0x00, 0x02, 0x01, 0x03, 0x03, 0x41, 0x00, 0x02, 0x01, 0x02, 0x03, 0x40, 0x00, 0x02, 0x01, 0x03, + 0x03, 0x40, 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x09, 0x00, 0x03, 0x00, 0x61, 0x03, 0x06, + 0x03, 0x09, 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x03, 0x00, 0x03, 0x00, 0x61, 0x03, 0x06, + 0x03, 0x03, 0x00, 0x02, 0x1E, 0xA0, 0x03, 0x06, 0x00, 0x02, 0x1E, 0xA1, 0x03, 0x06, 0x00, 0x02, + 0x00, 0xCA, 0x03, 0x41, 0x00, 0x02, 0x00, 0xEA, 0x03, 0x41, 0x00, 0x02, 0x00, 0xCA, 0x03, 0x40, + 0x00, 0x02, 0x00, 0xEA, 0x03, 0x40, 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, 0x03, 0x09, 0x00, 0x03, + 0x00, 0x65, 0x03, 0x02, 0x03, 0x09, 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, 0x03, 0x03, 0x00, 0x03, + 0x00, 0x65, 0x03, 0x02, 0x03, 0x03, 0x00, 0x02, 0x1E, 0xB8, 0x03, 0x02, 0x00, 0x02, 0x1E, 0xB9, + 0x03, 0x02, 0x00, 0x02, 0x00, 0xD4, 0x03, 0x41, 0x00, 0x02, 0x00, 0xF4, 0x03, 0x41, 0x00, 0x02, + 0x00, 0xD4, 0x03, 0x40, 0x00, 0x02, 0x00, 0xF4, 0x03, 0x40, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x02, + 0x03, 0x09, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x02, 0x03, 0x09, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x02, + 0x03, 0x03, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x02, 0x03, 0x03, 0x00, 0x02, 0x1E, 0xCC, 0x03, 0x02, + 0x00, 0x02, 0x1E, 0xCD, 0x03, 0x02, 0x00, 0x02, 0x01, 0xA0, 0x03, 0x01, 0x00, 0x02, 0x01, 0xA1, + 0x03, 0x01, 0x00, 0x02, 0x01, 0xA0, 0x03, 0x00, 0x00, 0x02, 0x01, 0xA1, 0x03, 0x00, 0x00, 0x02, + 0x1E, 0xCE, 0x03, 0x1B, 0x00, 0x02, 0x1E, 0xCF, 0x03, 0x1B, 0x00, 0x02, 0x01, 0xA0, 0x03, 0x03, + 0x00, 0x02, 0x01, 0xA1, 0x03, 0x03, 0x00, 0x02, 0x1E, 0xCC, 0x03, 0x1B, 0x00, 0x02, 0x1E, 0xCD, + 0x03, 0x1B, 0x00, 0x02, 0x01, 0xAF, 0x03, 0x01, 0x00, 0x02, 0x01, 0xB0, 0x03, 0x01, 0x00, 0x02, + 0x01, 0xAF, 0x03, 0x00, 0x00, 0x02, 0x01, 0xB0, 0x03, 0x00, 0x00, 0x02, 0x1E, 0xE6, 0x03, 0x1B, + 0x00, 0x02, 0x1E, 0xE7, 0x03, 0x1B, 0x00, 0x02, 0x01, 0xAF, 0x03, 0x03, 0x00, 0x02, 0x01, 0xB0, + 0x03, 0x03, 0x00, 0x02, 0x1E, 0xE4, 0x03, 0x1B, 0x00, 0x02, 0x1E, 0xE5, 0x03, 0x1B, 0x00, 0x02, + 0x00, 0x59, 0x03, 0x40, 0x00, 0x02, 0x00, 0x79, 0x03, 0x40, 0x00, 0x01, 0x00, 0xAC, 0x00, 0xC0, + 0x00, 0xC1, 0x00, 0xC8, 0x00, 0xC9, 0x00, 0xCC, 0x00, 0xCD, 0x00, 0xD2, 0x00, 0xD3, 0x00, 0xD9, + 0x00, 0xDA, 0x00, 0xDD, 0x00, 0xE0, 0x00, 0xE1, 0x00, 0xE8, 0x00, 0xE9, 0x00, 0xEC, 0x00, 0xED, + 0x00, 0xF2, 0x00, 0xF3, 0x00, 0xF9, 0x00, 0xFA, 0x00, 0xFD, 0x01, 0x06, 0x01, 0x07, 0x01, 0x36, + 0x01, 0x39, 0x01, 0x3A, 0x01, 0x43, 0x01, 0x44, 0x01, 0x54, 0x01, 0x55, 0x01, 0x5A, 0x01, 0x5B, + 0x01, 0x79, 0x01, 0x7A, 0x01, 0xD5, 0x01, 0xD6, 0x01, 0xD7, 0x01, 0xD8, 0x01, 0xD9, 0x01, 0xDA, + 0x01, 0xDB, 0x01, 0xDC, 0x01, 0xDE, 0x01, 0xDF, 0x01, 0xE0, 0x01, 0xE1, 0x01, 0xE8, 0x01, 0xEC, + 0x01, 0xED, 0x01, 0xF4, 0x01, 0xF5, 0x01, 0xF8, 0x01, 0xF9, 0x01, 0xFA, 0x01, 0xFB, 0x01, 0xFC, + 0x01, 0xFD, 0x01, 0xFE, 0x01, 0xFF, 0x02, 0x2A, 0x02, 0x2B, 0x02, 0x2C, 0x02, 0x2D, 0x02, 0x30, + 0x02, 0x31, 0x1E, 0x08, 0x1E, 0x09, 0x1E, 0x14, 0x1E, 0x15, 0x1E, 0x16, 0x1E, 0x17, 0x1E, 0x1C, + 0x1E, 0x1D, 0x1E, 0x2E, 0x1E, 0x2F, 0x1E, 0x30, 0x1E, 0x31, 0x1E, 0x32, 0x1E, 0x34, 0x1E, 0x38, + 0x1E, 0x39, 0x1E, 0x3E, 0x1E, 0x3F, 0x1E, 0x4C, 0x1E, 0x4D, 0x1E, 0x4E, 0x1E, 0x4F, 0x1E, 0x50, + 0x1E, 0x51, 0x1E, 0x52, 0x1E, 0x53, 0x1E, 0x54, 0x1E, 0x55, 0x1E, 0x5C, 0x1E, 0x5D, 0x1E, 0x64, + 0x1E, 0x65, 0x1E, 0x66, 0x1E, 0x67, 0x1E, 0x68, 0x1E, 0x69, 0x1E, 0x78, 0x1E, 0x79, 0x1E, 0x7A, + 0x1E, 0x7B, 0x1E, 0x80, 0x1E, 0x81, 0x1E, 0x82, 0x1E, 0x83, 0x1E, 0xA4, 0x1E, 0xA5, 0x1E, 0xA6, + 0x1E, 0xA7, 0x1E, 0xA8, 0x1E, 0xA9, 0x1E, 0xAA, 0x1E, 0xAB, 0x1E, 0xAC, 0x1E, 0xAD, 0x1E, 0xAE, + 0x1E, 0xAF, 0x1E, 0xB0, 0x1E, 0xB1, 0x1E, 0xB2, 0x1E, 0xB3, 0x1E, 0xB4, 0x1E, 0xB5, 0x1E, 0xB6, + 0x1E, 0xB7, 0x1E, 0xBE, 0x1E, 0xBF, 0x1E, 0xC0, 0x1E, 0xC1, 0x1E, 0xC2, 0x1E, 0xC3, 0x1E, 0xC4, + 0x1E, 0xC5, 0x1E, 0xC6, 0x1E, 0xC7, 0x1E, 0xD0, 0x1E, 0xD1, 0x1E, 0xD2, 0x1E, 0xD3, 0x1E, 0xD4, + 0x1E, 0xD5, 0x1E, 0xD6, 0x1E, 0xD7, 0x1E, 0xD8, 0x1E, 0xD9, 0x1E, 0xDA, 0x1E, 0xDB, 0x1E, 0xDC, + 0x1E, 0xDD, 0x1E, 0xDE, 0x1E, 0xDF, 0x1E, 0xE0, 0x1E, 0xE1, 0x1E, 0xE2, 0x1E, 0xE3, 0x1E, 0xE8, + 0x1E, 0xE9, 0x1E, 0xEA, 0x1E, 0xEB, 0x1E, 0xEC, 0x1E, 0xED, 0x1E, 0xEE, 0x1E, 0xEF, 0x1E, 0xF0, + 0x1E, 0xF1, 0x1E, 0xF2, 0x1E, 0xF3, 0x00, 0x01, 0x02, 0xFC, 0x00, 0x4F, 0x00, 0xA4, 0x00, 0xAA, + 0x00, 0xB0, 0x00, 0xB8, 0x00, 0xC0, 0x00, 0xC8, 0x00, 0xD0, 0x00, 0xD6, 0x00, 0xDE, 0x00, 0xE4, + 0x00, 0xEA, 0x00, 0xF2, 0x00, 0xFA, 0x01, 0x02, 0x01, 0x0A, 0x01, 0x12, 0x01, 0x1A, 0x01, 0x20, + 0x01, 0x26, 0x01, 0x2C, 0x01, 0x34, 0x01, 0x3C, 0x01, 0x44, 0x01, 0x4C, 0x01, 0x54, 0x01, 0x5C, + 0x01, 0x64, 0x01, 0x6C, 0x01, 0x74, 0x01, 0x7C, 0x01, 0x84, 0x01, 0x8C, 0x01, 0x94, 0x01, 0x9C, + 0x01, 0xA4, 0x01, 0xAC, 0x01, 0xB4, 0x01, 0xBC, 0x01, 0xC4, 0x01, 0xCC, 0x01, 0xD4, 0x01, 0xDC, + 0x01, 0xE4, 0x01, 0xEC, 0x01, 0xF4, 0x01, 0xFC, 0x02, 0x04, 0x02, 0x0C, 0x02, 0x14, 0x02, 0x1C, + 0x02, 0x24, 0x02, 0x2C, 0x02, 0x34, 0x02, 0x3C, 0x02, 0x44, 0x02, 0x4C, 0x02, 0x54, 0x02, 0x5C, + 0x02, 0x64, 0x02, 0x6C, 0x02, 0x72, 0x02, 0x78, 0x02, 0x7E, 0x02, 0x84, 0x02, 0x8C, 0x02, 0x94, + 0x02, 0x9C, 0x02, 0xA4, 0x02, 0xAC, 0x02, 0xB4, 0x02, 0xBA, 0x02, 0xC0, 0x02, 0xC6, 0x02, 0xCC, + 0x02, 0xD4, 0x02, 0xDC, 0x02, 0xE4, 0x02, 0xEC, 0x02, 0xF4, 0x00, 0x02, 0x00, 0xDC, 0x03, 0x41, + 0x00, 0x02, 0x00, 0xFC, 0x03, 0x41, 0x00, 0x03, 0x00, 0x55, 0x03, 0x08, 0x03, 0x00, 0x00, 0x03, + 0x00, 0x75, 0x03, 0x08, 0x03, 0x00, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x04, 0x03, 0x28, 0x00, 0x03, + 0x00, 0x6F, 0x03, 0x04, 0x03, 0x28, 0x00, 0x02, 0x21, 0x2B, 0x03, 0x01, 0x00, 0x03, 0x00, 0x61, + 0x03, 0x0A, 0x03, 0x01, 0x00, 0x02, 0x01, 0x06, 0x03, 0x27, 0x00, 0x02, 0x01, 0x07, 0x03, 0x27, + 0x00, 0x03, 0x00, 0x45, 0x03, 0x04, 0x03, 0x00, 0x00, 0x03, 0x00, 0x65, 0x03, 0x04, 0x03, 0x00, + 0x00, 0x03, 0x00, 0x45, 0x03, 0x04, 0x03, 0x01, 0x00, 0x03, 0x00, 0x65, 0x03, 0x04, 0x03, 0x01, + 0x00, 0x03, 0x00, 0x45, 0x03, 0x06, 0x03, 0x27, 0x00, 0x03, 0x00, 0x65, 0x03, 0x06, 0x03, 0x27, + 0x00, 0x02, 0x00, 0xCF, 0x03, 0x41, 0x00, 0x02, 0x00, 0xEF, 0x03, 0x41, 0x00, 0x02, 0x21, 0x2A, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x4C, 0x03, 0x23, 0x03, 0x04, 0x00, 0x03, 0x00, 0x6C, 0x03, 0x23, + 0x03, 0x04, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x03, 0x03, 0x01, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x04, 0x03, 0x00, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x04, + 0x03, 0x00, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x04, 0x03, 0x01, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x04, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x52, 0x03, 0x23, 0x03, 0x04, 0x00, 0x03, 0x00, 0x72, 0x03, 0x23, + 0x03, 0x04, 0x00, 0x03, 0x00, 0x53, 0x03, 0x41, 0x03, 0x07, 0x00, 0x03, 0x00, 0x73, 0x03, 0x41, + 0x03, 0x07, 0x00, 0x03, 0x00, 0x53, 0x03, 0x07, 0x03, 0x23, 0x00, 0x03, 0x00, 0x73, 0x03, 0x07, + 0x03, 0x23, 0x00, 0x03, 0x00, 0x55, 0x03, 0x03, 0x03, 0x01, 0x00, 0x03, 0x00, 0x75, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x41, 0x03, 0x02, 0x03, 0x01, 0x00, 0x03, 0x00, 0x61, 0x03, 0x02, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x41, 0x03, 0x02, 0x03, 0x00, 0x00, 0x03, 0x00, 0x61, 0x03, 0x02, + 0x03, 0x00, 0x00, 0x03, 0x00, 0x41, 0x03, 0x02, 0x03, 0x23, 0x00, 0x03, 0x00, 0x61, 0x03, 0x02, + 0x03, 0x23, 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x01, 0x00, 0x03, 0x00, 0x61, 0x03, 0x06, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x00, 0x00, 0x03, 0x00, 0x61, 0x03, 0x06, + 0x03, 0x00, 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x23, 0x00, 0x03, 0x00, 0x61, 0x03, 0x06, + 0x03, 0x23, 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, 0x03, 0x01, 0x00, 0x03, 0x00, 0x65, 0x03, 0x02, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, 0x03, 0x00, 0x00, 0x03, 0x00, 0x65, 0x03, 0x02, + 0x03, 0x00, 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, 0x03, 0x23, 0x00, 0x03, 0x00, 0x65, 0x03, 0x02, + 0x03, 0x23, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x02, 0x03, 0x01, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x02, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x02, 0x03, 0x00, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x02, + 0x03, 0x00, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x02, 0x03, 0x23, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x02, + 0x03, 0x23, 0x00, 0x02, 0x01, 0xA0, 0x03, 0x41, 0x00, 0x02, 0x01, 0xA1, 0x03, 0x41, 0x00, 0x02, + 0x01, 0xA0, 0x03, 0x40, 0x00, 0x02, 0x01, 0xA1, 0x03, 0x40, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x09, + 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x09, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x03, + 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x03, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x1B, + 0x03, 0x23, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x1B, 0x03, 0x23, 0x00, 0x02, 0x01, 0xAF, 0x03, 0x41, + 0x00, 0x02, 0x01, 0xB0, 0x03, 0x41, 0x00, 0x02, 0x01, 0xAF, 0x03, 0x40, 0x00, 0x02, 0x01, 0xB0, + 0x03, 0x40, 0x00, 0x03, 0x00, 0x55, 0x03, 0x09, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x75, 0x03, 0x09, + 0x03, 0x1B, 0x00, 0x03, 0x00, 0x55, 0x03, 0x03, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x75, 0x03, 0x03, + 0x03, 0x1B, 0x00, 0x03, 0x00, 0x55, 0x03, 0x1B, 0x03, 0x23, 0x00, 0x03, 0x00, 0x75, 0x03, 0x1B, + 0x03, 0x23, 0x00, 0x01, 0x00, 0x4F, 0x01, 0xD7, 0x01, 0xD8, 0x01, 0xDB, 0x01, 0xDC, 0x01, 0xEC, + 0x01, 0xED, 0x01, 0xFA, 0x01, 0xFB, 0x1E, 0x08, 0x1E, 0x09, 0x1E, 0x14, 0x1E, 0x15, 0x1E, 0x16, + 0x1E, 0x17, 0x1E, 0x1C, 0x1E, 0x1D, 0x1E, 0x2E, 0x1E, 0x2F, 0x1E, 0x30, 0x1E, 0x38, 0x1E, 0x39, + 0x1E, 0x4C, 0x1E, 0x4D, 0x1E, 0x50, 0x1E, 0x51, 0x1E, 0x52, 0x1E, 0x53, 0x1E, 0x5C, 0x1E, 0x5D, + 0x1E, 0x64, 0x1E, 0x65, 0x1E, 0x68, 0x1E, 0x69, 0x1E, 0x78, 0x1E, 0x79, 0x1E, 0xA4, 0x1E, 0xA5, + 0x1E, 0xA6, 0x1E, 0xA7, 0x1E, 0xAC, 0x1E, 0xAD, 0x1E, 0xAE, 0x1E, 0xAF, 0x1E, 0xB0, 0x1E, 0xB1, + 0x1E, 0xB6, 0x1E, 0xB7, 0x1E, 0xBE, 0x1E, 0xBF, 0x1E, 0xC0, 0x1E, 0xC1, 0x1E, 0xC6, 0x1E, 0xC7, + 0x1E, 0xD0, 0x1E, 0xD1, 0x1E, 0xD2, 0x1E, 0xD3, 0x1E, 0xD8, 0x1E, 0xD9, 0x1E, 0xDA, 0x1E, 0xDB, + 0x1E, 0xDC, 0x1E, 0xDD, 0x1E, 0xDE, 0x1E, 0xDF, 0x1E, 0xE0, 0x1E, 0xE1, 0x1E, 0xE2, 0x1E, 0xE3, + 0x1E, 0xE8, 0x1E, 0xE9, 0x1E, 0xEA, 0x1E, 0xEB, 0x1E, 0xEC, 0x1E, 0xED, 0x1E, 0xEE, 0x1E, 0xEF, + 0x1E, 0xF0, 0x1E, 0xF1, 0x00, 0x01, 0x02, 0xDC, 0x00, 0x49, 0x00, 0x98, 0x00, 0xA0, 0x00, 0xA8, + 0x00, 0xB0, 0x00, 0xB8, 0x00, 0xC0, 0x00, 0xC8, 0x00, 0xCE, 0x00, 0xD6, 0x00, 0xDE, 0x00, 0xE6, + 0x00, 0xEE, 0x00, 0xF6, 0x00, 0xFE, 0x01, 0x06, 0x01, 0x0E, 0x01, 0x16, 0x01, 0x1E, 0x01, 0x26, + 0x01, 0x2C, 0x01, 0x34, 0x01, 0x3C, 0x01, 0x44, 0x01, 0x4C, 0x01, 0x54, 0x01, 0x5C, 0x01, 0x64, + 0x01, 0x6C, 0x01, 0x74, 0x01, 0x7C, 0x01, 0x84, 0x01, 0x8C, 0x01, 0x94, 0x01, 0x9C, 0x01, 0xA4, + 0x01, 0xAC, 0x01, 0xB4, 0x01, 0xBC, 0x01, 0xC4, 0x01, 0xCC, 0x01, 0xD4, 0x01, 0xDC, 0x01, 0xE4, + 0x01, 0xEC, 0x01, 0xF4, 0x01, 0xFC, 0x02, 0x04, 0x02, 0x0C, 0x02, 0x14, 0x02, 0x1C, 0x02, 0x24, + 0x02, 0x2C, 0x02, 0x34, 0x02, 0x3C, 0x02, 0x44, 0x02, 0x4C, 0x02, 0x54, 0x02, 0x5C, 0x02, 0x64, + 0x02, 0x6C, 0x02, 0x74, 0x02, 0x7C, 0x02, 0x84, 0x02, 0x8C, 0x02, 0x94, 0x02, 0x9C, 0x02, 0xA4, + 0x02, 0xAC, 0x02, 0xB4, 0x02, 0xBC, 0x02, 0xC4, 0x02, 0xCC, 0x02, 0xD4, 0x00, 0x03, 0x00, 0x55, + 0x03, 0x08, 0x03, 0x01, 0x00, 0x03, 0x00, 0x75, 0x03, 0x08, 0x03, 0x01, 0x00, 0x03, 0x00, 0x55, + 0x03, 0x08, 0x03, 0x40, 0x00, 0x03, 0x00, 0x75, 0x03, 0x08, 0x03, 0x40, 0x00, 0x03, 0x00, 0x4F, + 0x03, 0x28, 0x03, 0x04, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x28, 0x03, 0x04, 0x00, 0x02, 0x21, 0x2B, + 0x03, 0x41, 0x00, 0x03, 0x00, 0x61, 0x03, 0x0A, 0x03, 0x41, 0x00, 0x03, 0x00, 0x43, 0x03, 0x01, + 0x03, 0x27, 0x00, 0x03, 0x00, 0x63, 0x03, 0x01, 0x03, 0x27, 0x00, 0x03, 0x00, 0x45, 0x03, 0x04, + 0x03, 0x40, 0x00, 0x03, 0x00, 0x65, 0x03, 0x04, 0x03, 0x40, 0x00, 0x03, 0x00, 0x45, 0x03, 0x04, + 0x03, 0x41, 0x00, 0x03, 0x00, 0x65, 0x03, 0x04, 0x03, 0x41, 0x00, 0x03, 0x00, 0x45, 0x03, 0x27, + 0x03, 0x06, 0x00, 0x03, 0x00, 0x65, 0x03, 0x27, 0x03, 0x06, 0x00, 0x03, 0x00, 0x49, 0x03, 0x08, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x69, 0x03, 0x08, 0x03, 0x01, 0x00, 0x02, 0x21, 0x2A, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x4F, 0x03, 0x03, 0x03, 0x41, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x03, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x4F, 0x03, 0x04, 0x03, 0x40, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x04, 0x03, 0x40, + 0x00, 0x03, 0x00, 0x4F, 0x03, 0x04, 0x03, 0x41, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x04, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x53, 0x03, 0x23, 0x03, 0x07, 0x00, 0x03, 0x00, 0x73, 0x03, 0x23, 0x03, 0x07, + 0x00, 0x03, 0x00, 0x55, 0x03, 0x03, 0x03, 0x41, 0x00, 0x03, 0x00, 0x75, 0x03, 0x03, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x41, 0x03, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x61, 0x03, 0x02, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x41, 0x03, 0x02, 0x03, 0x40, 0x00, 0x03, 0x00, 0x61, 0x03, 0x02, 0x03, 0x40, + 0x00, 0x03, 0x00, 0x41, 0x03, 0x23, 0x03, 0x02, 0x00, 0x03, 0x00, 0x61, 0x03, 0x23, 0x03, 0x02, + 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x41, 0x00, 0x03, 0x00, 0x61, 0x03, 0x06, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x40, 0x00, 0x03, 0x00, 0x61, 0x03, 0x06, 0x03, 0x40, + 0x00, 0x03, 0x00, 0x41, 0x03, 0x23, 0x03, 0x06, 0x00, 0x03, 0x00, 0x61, 0x03, 0x23, 0x03, 0x06, + 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x65, 0x03, 0x02, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, 0x03, 0x40, 0x00, 0x03, 0x00, 0x65, 0x03, 0x02, 0x03, 0x40, + 0x00, 0x03, 0x00, 0x45, 0x03, 0x23, 0x03, 0x02, 0x00, 0x03, 0x00, 0x65, 0x03, 0x23, 0x03, 0x02, + 0x00, 0x03, 0x00, 0x4F, 0x03, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x02, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x4F, 0x03, 0x02, 0x03, 0x40, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x02, 0x03, 0x40, + 0x00, 0x03, 0x00, 0x4F, 0x03, 0x23, 0x03, 0x02, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x23, 0x03, 0x02, + 0x00, 0x03, 0x00, 0x4F, 0x03, 0x01, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x01, 0x03, 0x1B, + 0x00, 0x03, 0x00, 0x4F, 0x03, 0x00, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x00, 0x03, 0x1B, + 0x00, 0x03, 0x00, 0x4F, 0x03, 0x1B, 0x03, 0x09, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x1B, 0x03, 0x09, + 0x00, 0x03, 0x00, 0x4F, 0x03, 0x1B, 0x03, 0x03, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x1B, 0x03, 0x03, + 0x00, 0x03, 0x00, 0x4F, 0x03, 0x23, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x23, 0x03, 0x1B, + 0x00, 0x03, 0x00, 0x55, 0x03, 0x01, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x75, 0x03, 0x01, 0x03, 0x1B, + 0x00, 0x03, 0x00, 0x55, 0x03, 0x00, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x75, 0x03, 0x00, 0x03, 0x1B, + 0x00, 0x03, 0x00, 0x55, 0x03, 0x1B, 0x03, 0x09, 0x00, 0x03, 0x00, 0x75, 0x03, 0x1B, 0x03, 0x09, + 0x00, 0x03, 0x00, 0x55, 0x03, 0x1B, 0x03, 0x03, 0x00, 0x03, 0x00, 0x75, 0x03, 0x1B, 0x03, 0x03, + 0x00, 0x03, 0x00, 0x55, 0x03, 0x23, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x75, 0x03, 0x23, 0x03, 0x1B, + 0x00, 0x01, 0x00, 0x49, 0x01, 0xD7, 0x01, 0xD8, 0x01, 0xDB, 0x01, 0xDC, 0x01, 0xEC, 0x01, 0xED, + 0x01, 0xFA, 0x01, 0xFB, 0x1E, 0x08, 0x1E, 0x09, 0x1E, 0x14, 0x1E, 0x15, 0x1E, 0x16, 0x1E, 0x17, + 0x1E, 0x1C, 0x1E, 0x1D, 0x1E, 0x2E, 0x1E, 0x2F, 0x1E, 0x30, 0x1E, 0x4C, 0x1E, 0x4D, 0x1E, 0x50, + 0x1E, 0x51, 0x1E, 0x52, 0x1E, 0x53, 0x1E, 0x68, 0x1E, 0x69, 0x1E, 0x78, 0x1E, 0x79, 0x1E, 0xA4, + 0x1E, 0xA5, 0x1E, 0xA6, 0x1E, 0xA7, 0x1E, 0xAC, 0x1E, 0xAD, 0x1E, 0xAE, 0x1E, 0xAF, 0x1E, 0xB0, + 0x1E, 0xB1, 0x1E, 0xB6, 0x1E, 0xB7, 0x1E, 0xBE, 0x1E, 0xBF, 0x1E, 0xC0, 0x1E, 0xC1, 0x1E, 0xC6, + 0x1E, 0xC7, 0x1E, 0xD0, 0x1E, 0xD1, 0x1E, 0xD2, 0x1E, 0xD3, 0x1E, 0xD8, 0x1E, 0xD9, 0x1E, 0xDA, 0x1E, 0xDB, 0x1E, 0xDC, 0x1E, 0xDD, 0x1E, 0xDE, 0x1E, 0xDF, 0x1E, 0xE0, 0x1E, 0xE1, 0x1E, 0xE2, 0x1E, 0xE3, 0x1E, 0xE8, 0x1E, 0xE9, 0x1E, 0xEA, 0x1E, 0xEB, 0x1E, 0xEC, 0x1E, 0xED, 0x1E, 0xEE, - 0x1E, 0xEF, 0x1E, 0xF0, 0x1E, 0xF1, 0x1E, 0xF2, 0x1E, 0xF3, 0x00, 0x01, 0x02, 0xFC, 0x00, 0x4F, - 0x00, 0xA4, 0x00, 0xAA, 0x00, 0xB0, 0x00, 0xB8, 0x00, 0xC0, 0x00, 0xC8, 0x00, 0xD0, 0x00, 0xD6, - 0x00, 0xDE, 0x00, 0xE4, 0x00, 0xEA, 0x00, 0xF2, 0x00, 0xFA, 0x01, 0x02, 0x01, 0x0A, 0x01, 0x12, - 0x01, 0x1A, 0x01, 0x20, 0x01, 0x26, 0x01, 0x2C, 0x01, 0x34, 0x01, 0x3C, 0x01, 0x44, 0x01, 0x4C, - 0x01, 0x54, 0x01, 0x5C, 0x01, 0x64, 0x01, 0x6C, 0x01, 0x74, 0x01, 0x7C, 0x01, 0x84, 0x01, 0x8C, - 0x01, 0x94, 0x01, 0x9C, 0x01, 0xA4, 0x01, 0xAC, 0x01, 0xB4, 0x01, 0xBC, 0x01, 0xC4, 0x01, 0xCC, - 0x01, 0xD4, 0x01, 0xDC, 0x01, 0xE4, 0x01, 0xEC, 0x01, 0xF4, 0x01, 0xFC, 0x02, 0x04, 0x02, 0x0C, - 0x02, 0x14, 0x02, 0x1C, 0x02, 0x24, 0x02, 0x2C, 0x02, 0x34, 0x02, 0x3C, 0x02, 0x44, 0x02, 0x4C, - 0x02, 0x54, 0x02, 0x5C, 0x02, 0x64, 0x02, 0x6C, 0x02, 0x72, 0x02, 0x78, 0x02, 0x7E, 0x02, 0x84, - 0x02, 0x8C, 0x02, 0x94, 0x02, 0x9C, 0x02, 0xA4, 0x02, 0xAC, 0x02, 0xB4, 0x02, 0xBA, 0x02, 0xC0, - 0x02, 0xC6, 0x02, 0xCC, 0x02, 0xD4, 0x02, 0xDC, 0x02, 0xE4, 0x02, 0xEC, 0x02, 0xF4, 0x00, 0x02, - 0x00, 0xDC, 0x03, 0x41, 0x00, 0x02, 0x00, 0xFC, 0x03, 0x41, 0x00, 0x03, 0x00, 0x55, 0x03, 0x08, - 0x03, 0x00, 0x00, 0x03, 0x00, 0x75, 0x03, 0x08, 0x03, 0x00, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x04, - 0x03, 0x28, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x04, 0x03, 0x28, 0x00, 0x02, 0x21, 0x2B, 0x03, 0x01, - 0x00, 0x03, 0x00, 0x61, 0x03, 0x0A, 0x03, 0x01, 0x00, 0x02, 0x01, 0x06, 0x03, 0x27, 0x00, 0x02, - 0x01, 0x07, 0x03, 0x27, 0x00, 0x03, 0x00, 0x45, 0x03, 0x04, 0x03, 0x00, 0x00, 0x03, 0x00, 0x65, - 0x03, 0x04, 0x03, 0x00, 0x00, 0x03, 0x00, 0x45, 0x03, 0x04, 0x03, 0x01, 0x00, 0x03, 0x00, 0x65, - 0x03, 0x04, 0x03, 0x01, 0x00, 0x03, 0x00, 0x45, 0x03, 0x06, 0x03, 0x27, 0x00, 0x03, 0x00, 0x65, - 0x03, 0x06, 0x03, 0x27, 0x00, 0x02, 0x00, 0xCF, 0x03, 0x41, 0x00, 0x02, 0x00, 0xEF, 0x03, 0x41, - 0x00, 0x02, 0x21, 0x2A, 0x03, 0x01, 0x00, 0x03, 0x00, 0x4C, 0x03, 0x23, 0x03, 0x04, 0x00, 0x03, - 0x00, 0x6C, 0x03, 0x23, 0x03, 0x04, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x03, 0x03, 0x01, 0x00, 0x03, - 0x00, 0x6F, 0x03, 0x03, 0x03, 0x01, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x04, 0x03, 0x00, 0x00, 0x03, - 0x00, 0x6F, 0x03, 0x04, 0x03, 0x00, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x04, 0x03, 0x01, 0x00, 0x03, - 0x00, 0x6F, 0x03, 0x04, 0x03, 0x01, 0x00, 0x03, 0x00, 0x52, 0x03, 0x23, 0x03, 0x04, 0x00, 0x03, - 0x00, 0x72, 0x03, 0x23, 0x03, 0x04, 0x00, 0x03, 0x00, 0x53, 0x03, 0x41, 0x03, 0x07, 0x00, 0x03, - 0x00, 0x73, 0x03, 0x41, 0x03, 0x07, 0x00, 0x03, 0x00, 0x53, 0x03, 0x07, 0x03, 0x23, 0x00, 0x03, - 0x00, 0x73, 0x03, 0x07, 0x03, 0x23, 0x00, 0x03, 0x00, 0x55, 0x03, 0x03, 0x03, 0x01, 0x00, 0x03, - 0x00, 0x75, 0x03, 0x03, 0x03, 0x01, 0x00, 0x03, 0x00, 0x41, 0x03, 0x02, 0x03, 0x01, 0x00, 0x03, - 0x00, 0x61, 0x03, 0x02, 0x03, 0x01, 0x00, 0x03, 0x00, 0x41, 0x03, 0x02, 0x03, 0x00, 0x00, 0x03, - 0x00, 0x61, 0x03, 0x02, 0x03, 0x00, 0x00, 0x03, 0x00, 0x41, 0x03, 0x02, 0x03, 0x23, 0x00, 0x03, - 0x00, 0x61, 0x03, 0x02, 0x03, 0x23, 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x01, 0x00, 0x03, - 0x00, 0x61, 0x03, 0x06, 0x03, 0x01, 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x00, 0x00, 0x03, - 0x00, 0x61, 0x03, 0x06, 0x03, 0x00, 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x23, 0x00, 0x03, - 0x00, 0x61, 0x03, 0x06, 0x03, 0x23, 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, 0x03, 0x01, 0x00, 0x03, - 0x00, 0x65, 0x03, 0x02, 0x03, 0x01, 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, 0x03, 0x00, 0x00, 0x03, - 0x00, 0x65, 0x03, 0x02, 0x03, 0x00, 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, 0x03, 0x23, 0x00, 0x03, - 0x00, 0x65, 0x03, 0x02, 0x03, 0x23, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x02, 0x03, 0x01, 0x00, 0x03, - 0x00, 0x6F, 0x03, 0x02, 0x03, 0x01, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x02, 0x03, 0x00, 0x00, 0x03, - 0x00, 0x6F, 0x03, 0x02, 0x03, 0x00, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x02, 0x03, 0x23, 0x00, 0x03, - 0x00, 0x6F, 0x03, 0x02, 0x03, 0x23, 0x00, 0x02, 0x01, 0xA0, 0x03, 0x41, 0x00, 0x02, 0x01, 0xA1, - 0x03, 0x41, 0x00, 0x02, 0x01, 0xA0, 0x03, 0x40, 0x00, 0x02, 0x01, 0xA1, 0x03, 0x40, 0x00, 0x03, - 0x00, 0x4F, 0x03, 0x09, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x09, 0x03, 0x1B, 0x00, 0x03, - 0x00, 0x4F, 0x03, 0x03, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x03, 0x03, 0x1B, 0x00, 0x03, - 0x00, 0x4F, 0x03, 0x1B, 0x03, 0x23, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x1B, 0x03, 0x23, 0x00, 0x02, - 0x01, 0xAF, 0x03, 0x41, 0x00, 0x02, 0x01, 0xB0, 0x03, 0x41, 0x00, 0x02, 0x01, 0xAF, 0x03, 0x40, - 0x00, 0x02, 0x01, 0xB0, 0x03, 0x40, 0x00, 0x03, 0x00, 0x55, 0x03, 0x09, 0x03, 0x1B, 0x00, 0x03, - 0x00, 0x75, 0x03, 0x09, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x55, 0x03, 0x03, 0x03, 0x1B, 0x00, 0x03, - 0x00, 0x75, 0x03, 0x03, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x55, 0x03, 0x1B, 0x03, 0x23, 0x00, 0x03, - 0x00, 0x75, 0x03, 0x1B, 0x03, 0x23, 0x00, 0x01, 0x00, 0x4F, 0x01, 0xD7, 0x01, 0xD8, 0x01, 0xDB, - 0x01, 0xDC, 0x01, 0xEC, 0x01, 0xED, 0x01, 0xFA, 0x01, 0xFB, 0x1E, 0x08, 0x1E, 0x09, 0x1E, 0x14, - 0x1E, 0x15, 0x1E, 0x16, 0x1E, 0x17, 0x1E, 0x1C, 0x1E, 0x1D, 0x1E, 0x2E, 0x1E, 0x2F, 0x1E, 0x30, - 0x1E, 0x38, 0x1E, 0x39, 0x1E, 0x4C, 0x1E, 0x4D, 0x1E, 0x50, 0x1E, 0x51, 0x1E, 0x52, 0x1E, 0x53, - 0x1E, 0x5C, 0x1E, 0x5D, 0x1E, 0x64, 0x1E, 0x65, 0x1E, 0x68, 0x1E, 0x69, 0x1E, 0x78, 0x1E, 0x79, - 0x1E, 0xA4, 0x1E, 0xA5, 0x1E, 0xA6, 0x1E, 0xA7, 0x1E, 0xAC, 0x1E, 0xAD, 0x1E, 0xAE, 0x1E, 0xAF, - 0x1E, 0xB0, 0x1E, 0xB1, 0x1E, 0xB6, 0x1E, 0xB7, 0x1E, 0xBE, 0x1E, 0xBF, 0x1E, 0xC0, 0x1E, 0xC1, - 0x1E, 0xC6, 0x1E, 0xC7, 0x1E, 0xD0, 0x1E, 0xD1, 0x1E, 0xD2, 0x1E, 0xD3, 0x1E, 0xD8, 0x1E, 0xD9, - 0x1E, 0xDA, 0x1E, 0xDB, 0x1E, 0xDC, 0x1E, 0xDD, 0x1E, 0xDE, 0x1E, 0xDF, 0x1E, 0xE0, 0x1E, 0xE1, - 0x1E, 0xE2, 0x1E, 0xE3, 0x1E, 0xE8, 0x1E, 0xE9, 0x1E, 0xEA, 0x1E, 0xEB, 0x1E, 0xEC, 0x1E, 0xED, - 0x1E, 0xEE, 0x1E, 0xEF, 0x1E, 0xF0, 0x1E, 0xF1, 0x00, 0x01, 0x02, 0xDC, 0x00, 0x49, 0x00, 0x98, - 0x00, 0xA0, 0x00, 0xA8, 0x00, 0xB0, 0x00, 0xB8, 0x00, 0xC0, 0x00, 0xC8, 0x00, 0xCE, 0x00, 0xD6, - 0x00, 0xDE, 0x00, 0xE6, 0x00, 0xEE, 0x00, 0xF6, 0x00, 0xFE, 0x01, 0x06, 0x01, 0x0E, 0x01, 0x16, - 0x01, 0x1E, 0x01, 0x26, 0x01, 0x2C, 0x01, 0x34, 0x01, 0x3C, 0x01, 0x44, 0x01, 0x4C, 0x01, 0x54, - 0x01, 0x5C, 0x01, 0x64, 0x01, 0x6C, 0x01, 0x74, 0x01, 0x7C, 0x01, 0x84, 0x01, 0x8C, 0x01, 0x94, - 0x01, 0x9C, 0x01, 0xA4, 0x01, 0xAC, 0x01, 0xB4, 0x01, 0xBC, 0x01, 0xC4, 0x01, 0xCC, 0x01, 0xD4, - 0x01, 0xDC, 0x01, 0xE4, 0x01, 0xEC, 0x01, 0xF4, 0x01, 0xFC, 0x02, 0x04, 0x02, 0x0C, 0x02, 0x14, - 0x02, 0x1C, 0x02, 0x24, 0x02, 0x2C, 0x02, 0x34, 0x02, 0x3C, 0x02, 0x44, 0x02, 0x4C, 0x02, 0x54, - 0x02, 0x5C, 0x02, 0x64, 0x02, 0x6C, 0x02, 0x74, 0x02, 0x7C, 0x02, 0x84, 0x02, 0x8C, 0x02, 0x94, - 0x02, 0x9C, 0x02, 0xA4, 0x02, 0xAC, 0x02, 0xB4, 0x02, 0xBC, 0x02, 0xC4, 0x02, 0xCC, 0x02, 0xD4, - 0x00, 0x03, 0x00, 0x55, 0x03, 0x08, 0x03, 0x01, 0x00, 0x03, 0x00, 0x75, 0x03, 0x08, 0x03, 0x01, - 0x00, 0x03, 0x00, 0x55, 0x03, 0x08, 0x03, 0x40, 0x00, 0x03, 0x00, 0x75, 0x03, 0x08, 0x03, 0x40, - 0x00, 0x03, 0x00, 0x4F, 0x03, 0x28, 0x03, 0x04, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x28, 0x03, 0x04, - 0x00, 0x02, 0x21, 0x2B, 0x03, 0x41, 0x00, 0x03, 0x00, 0x61, 0x03, 0x0A, 0x03, 0x41, 0x00, 0x03, - 0x00, 0x43, 0x03, 0x01, 0x03, 0x27, 0x00, 0x03, 0x00, 0x63, 0x03, 0x01, 0x03, 0x27, 0x00, 0x03, - 0x00, 0x45, 0x03, 0x04, 0x03, 0x40, 0x00, 0x03, 0x00, 0x65, 0x03, 0x04, 0x03, 0x40, 0x00, 0x03, - 0x00, 0x45, 0x03, 0x04, 0x03, 0x41, 0x00, 0x03, 0x00, 0x65, 0x03, 0x04, 0x03, 0x41, 0x00, 0x03, - 0x00, 0x45, 0x03, 0x27, 0x03, 0x06, 0x00, 0x03, 0x00, 0x65, 0x03, 0x27, 0x03, 0x06, 0x00, 0x03, - 0x00, 0x49, 0x03, 0x08, 0x03, 0x01, 0x00, 0x03, 0x00, 0x69, 0x03, 0x08, 0x03, 0x01, 0x00, 0x02, - 0x21, 0x2A, 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x03, 0x03, 0x41, 0x00, 0x03, 0x00, 0x6F, - 0x03, 0x03, 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x04, 0x03, 0x40, 0x00, 0x03, 0x00, 0x6F, - 0x03, 0x04, 0x03, 0x40, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x04, 0x03, 0x41, 0x00, 0x03, 0x00, 0x6F, - 0x03, 0x04, 0x03, 0x41, 0x00, 0x03, 0x00, 0x53, 0x03, 0x23, 0x03, 0x07, 0x00, 0x03, 0x00, 0x73, - 0x03, 0x23, 0x03, 0x07, 0x00, 0x03, 0x00, 0x55, 0x03, 0x03, 0x03, 0x41, 0x00, 0x03, 0x00, 0x75, - 0x03, 0x03, 0x03, 0x41, 0x00, 0x03, 0x00, 0x41, 0x03, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x61, - 0x03, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x41, 0x03, 0x02, 0x03, 0x40, 0x00, 0x03, 0x00, 0x61, - 0x03, 0x02, 0x03, 0x40, 0x00, 0x03, 0x00, 0x41, 0x03, 0x23, 0x03, 0x02, 0x00, 0x03, 0x00, 0x61, - 0x03, 0x23, 0x03, 0x02, 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x41, 0x00, 0x03, 0x00, 0x61, - 0x03, 0x06, 0x03, 0x41, 0x00, 0x03, 0x00, 0x41, 0x03, 0x06, 0x03, 0x40, 0x00, 0x03, 0x00, 0x61, - 0x03, 0x06, 0x03, 0x40, 0x00, 0x03, 0x00, 0x41, 0x03, 0x23, 0x03, 0x06, 0x00, 0x03, 0x00, 0x61, - 0x03, 0x23, 0x03, 0x06, 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x65, - 0x03, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x45, 0x03, 0x02, 0x03, 0x40, 0x00, 0x03, 0x00, 0x65, - 0x03, 0x02, 0x03, 0x40, 0x00, 0x03, 0x00, 0x45, 0x03, 0x23, 0x03, 0x02, 0x00, 0x03, 0x00, 0x65, - 0x03, 0x23, 0x03, 0x02, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x6F, - 0x03, 0x02, 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x02, 0x03, 0x40, 0x00, 0x03, 0x00, 0x6F, - 0x03, 0x02, 0x03, 0x40, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x23, 0x03, 0x02, 0x00, 0x03, 0x00, 0x6F, - 0x03, 0x23, 0x03, 0x02, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x01, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, - 0x03, 0x01, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x00, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, - 0x03, 0x00, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x1B, 0x03, 0x09, 0x00, 0x03, 0x00, 0x6F, - 0x03, 0x1B, 0x03, 0x09, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x1B, 0x03, 0x03, 0x00, 0x03, 0x00, 0x6F, - 0x03, 0x1B, 0x03, 0x03, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x23, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, - 0x03, 0x23, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x55, 0x03, 0x01, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x75, - 0x03, 0x01, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x55, 0x03, 0x00, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x75, - 0x03, 0x00, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x55, 0x03, 0x1B, 0x03, 0x09, 0x00, 0x03, 0x00, 0x75, - 0x03, 0x1B, 0x03, 0x09, 0x00, 0x03, 0x00, 0x55, 0x03, 0x1B, 0x03, 0x03, 0x00, 0x03, 0x00, 0x75, - 0x03, 0x1B, 0x03, 0x03, 0x00, 0x03, 0x00, 0x55, 0x03, 0x23, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x75, - 0x03, 0x23, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x49, 0x01, 0xD7, 0x01, 0xD8, 0x01, 0xDB, 0x01, 0xDC, - 0x01, 0xEC, 0x01, 0xED, 0x01, 0xFA, 0x01, 0xFB, 0x1E, 0x08, 0x1E, 0x09, 0x1E, 0x14, 0x1E, 0x15, - 0x1E, 0x16, 0x1E, 0x17, 0x1E, 0x1C, 0x1E, 0x1D, 0x1E, 0x2E, 0x1E, 0x2F, 0x1E, 0x30, 0x1E, 0x4C, - 0x1E, 0x4D, 0x1E, 0x50, 0x1E, 0x51, 0x1E, 0x52, 0x1E, 0x53, 0x1E, 0x68, 0x1E, 0x69, 0x1E, 0x78, - 0x1E, 0x79, 0x1E, 0xA4, 0x1E, 0xA5, 0x1E, 0xA6, 0x1E, 0xA7, 0x1E, 0xAC, 0x1E, 0xAD, 0x1E, 0xAE, - 0x1E, 0xAF, 0x1E, 0xB0, 0x1E, 0xB1, 0x1E, 0xB6, 0x1E, 0xB7, 0x1E, 0xBE, 0x1E, 0xBF, 0x1E, 0xC0, - 0x1E, 0xC1, 0x1E, 0xC6, 0x1E, 0xC7, 0x1E, 0xD0, 0x1E, 0xD1, 0x1E, 0xD2, 0x1E, 0xD3, 0x1E, 0xD8, - 0x1E, 0xD9, 0x1E, 0xDA, 0x1E, 0xDB, 0x1E, 0xDC, 0x1E, 0xDD, 0x1E, 0xDE, 0x1E, 0xDF, 0x1E, 0xE0, - 0x1E, 0xE1, 0x1E, 0xE2, 0x1E, 0xE3, 0x1E, 0xE8, 0x1E, 0xE9, 0x1E, 0xEA, 0x1E, 0xEB, 0x1E, 0xEC, - 0x1E, 0xED, 0x1E, 0xEE, 0x1E, 0xEF, 0x1E, 0xF0, 0x1E, 0xF1, 0x00, 0x01, 0x00, 0x9C, 0x00, 0x0F, - 0x00, 0x24, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x3C, 0x00, 0x44, 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5C, - 0x00, 0x64, 0x00, 0x6C, 0x00, 0x74, 0x00, 0x7C, 0x00, 0x84, 0x00, 0x8C, 0x00, 0x94, 0x00, 0x03, - 0x00, 0x55, 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, 0x00, 0x75, 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, - 0x00, 0x41, 0x03, 0x0A, 0x03, 0x01, 0x00, 0x03, 0x00, 0x43, 0x03, 0x27, 0x03, 0x01, 0x00, 0x03, - 0x00, 0x63, 0x03, 0x27, 0x03, 0x01, 0x00, 0x03, 0x00, 0x49, 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, - 0x00, 0x69, 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x1B, 0x03, 0x01, 0x00, 0x03, - 0x00, 0x6F, 0x03, 0x1B, 0x03, 0x01, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x1B, 0x03, 0x00, 0x00, 0x03, - 0x00, 0x6F, 0x03, 0x1B, 0x03, 0x00, 0x00, 0x03, 0x00, 0x55, 0x03, 0x1B, 0x03, 0x01, 0x00, 0x03, - 0x00, 0x75, 0x03, 0x1B, 0x03, 0x01, 0x00, 0x03, 0x00, 0x55, 0x03, 0x1B, 0x03, 0x00, 0x00, 0x03, - 0x00, 0x75, 0x03, 0x1B, 0x03, 0x00, 0x00, 0x01, 0x00, 0x0F, 0x01, 0xD7, 0x01, 0xD8, 0x01, 0xFA, - 0x1E, 0x08, 0x1E, 0x09, 0x1E, 0x2E, 0x1E, 0x2F, 0x1E, 0xDA, 0x1E, 0xDB, 0x1E, 0xDC, 0x1E, 0xDD, - 0x1E, 0xE8, 0x1E, 0xE9, 0x1E, 0xEA, 0x1E, 0xEB, 0x00, 0x01, 0x00, 0x74, 0x00, 0x0B, 0x00, 0x1C, - 0x00, 0x24, 0x00, 0x2C, 0x00, 0x34, 0x00, 0x3C, 0x00, 0x44, 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5C, - 0x00, 0x64, 0x00, 0x6C, 0x00, 0x03, 0x00, 0x41, 0x03, 0x0A, 0x03, 0x41, 0x00, 0x03, 0x00, 0x43, - 0x03, 0x27, 0x03, 0x41, 0x00, 0x03, 0x00, 0x63, 0x03, 0x27, 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, - 0x03, 0x1B, 0x03, 0x41, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x1B, 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, - 0x03, 0x1B, 0x03, 0x40, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x1B, 0x03, 0x40, 0x00, 0x03, 0x00, 0x55, - 0x03, 0x1B, 0x03, 0x41, 0x00, 0x03, 0x00, 0x75, 0x03, 0x1B, 0x03, 0x41, 0x00, 0x03, 0x00, 0x55, - 0x03, 0x1B, 0x03, 0x40, 0x00, 0x03, 0x00, 0x75, 0x03, 0x1B, 0x03, 0x40, 0x00, 0x01, 0x00, 0x0B, - 0x01, 0xFA, 0x1E, 0x08, 0x1E, 0x09, 0x1E, 0xDA, 0x1E, 0xDB, 0x1E, 0xDC, 0x1E, 0xDD, 0x1E, 0xE8, - 0x1E, 0xE9, 0x1E, 0xEA, 0x1E, 0xEB, 0x00, 0x01, 0x00, 0x6A, 0x00, 0x0A, 0x00, 0x1A, 0x00, 0x22, - 0x00, 0x2A, 0x00, 0x32, 0x00, 0x3A, 0x00, 0x42, 0x00, 0x4A, 0x00, 0x52, 0x00, 0x5A, 0x00, 0x62, - 0x00, 0x03, 0x00, 0x43, 0x03, 0x41, 0x03, 0x27, 0x00, 0x03, 0x00, 0x63, 0x03, 0x41, 0x03, 0x27, - 0x00, 0x03, 0x00, 0x4F, 0x03, 0x41, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x41, 0x03, 0x1B, - 0x00, 0x03, 0x00, 0x4F, 0x03, 0x40, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x40, 0x03, 0x1B, - 0x00, 0x03, 0x00, 0x55, 0x03, 0x41, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x75, 0x03, 0x41, 0x03, 0x1B, - 0x00, 0x03, 0x00, 0x55, 0x03, 0x40, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x75, 0x03, 0x40, 0x03, 0x1B, - 0x00, 0x01, 0x00, 0x0A, 0x1E, 0x08, 0x1E, 0x09, 0x1E, 0xDA, 0x1E, 0xDB, 0x1E, 0xDC, 0x1E, 0xDD, - 0x1E, 0xE8, 0x1E, 0xE9, 0x1E, 0xEA, 0x1E, 0xEB, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, - 0x00, 0x01, 0x00, 0x26, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x1C, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, - 0x0D, 0x4A, 0x00, 0x02, 0x0D, 0x3E, 0x0D, 0x4C, 0x00, 0x02, 0x0D, 0x57, 0x00, 0x01, 0x00, 0x04, - 0x0D, 0x4B, 0x00, 0x02, 0x0D, 0x3E, 0x00, 0x01, 0x00, 0x02, 0x0D, 0x46, 0x0D, 0x47, 0x00, 0x02, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x03, 0x00, 0x0C, 0x00, 0x12, - 0x00, 0x18, 0x00, 0x02, 0x0D, 0x46, 0x0D, 0x3E, 0x00, 0x02, 0x0D, 0x47, 0x0D, 0x3E, 0x00, 0x02, - 0x0D, 0x46, 0x0D, 0x57, 0x00, 0x01, 0x00, 0x03, 0x0D, 0x4A, 0x0D, 0x4B, 0x0D, 0x4C, 0x00, 0x04, + 0x1E, 0xEF, 0x1E, 0xF0, 0x1E, 0xF1, 0x00, 0x01, 0x00, 0x9C, 0x00, 0x0F, 0x00, 0x24, 0x00, 0x2C, + 0x00, 0x34, 0x00, 0x3C, 0x00, 0x44, 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5C, 0x00, 0x64, 0x00, 0x6C, + 0x00, 0x74, 0x00, 0x7C, 0x00, 0x84, 0x00, 0x8C, 0x00, 0x94, 0x00, 0x03, 0x00, 0x55, 0x03, 0x08, + 0x03, 0x41, 0x00, 0x03, 0x00, 0x75, 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, 0x00, 0x41, 0x03, 0x0A, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x43, 0x03, 0x27, 0x03, 0x01, 0x00, 0x03, 0x00, 0x63, 0x03, 0x27, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x49, 0x03, 0x08, 0x03, 0x41, 0x00, 0x03, 0x00, 0x69, 0x03, 0x08, + 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x1B, 0x03, 0x01, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x1B, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x1B, 0x03, 0x00, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x1B, + 0x03, 0x00, 0x00, 0x03, 0x00, 0x55, 0x03, 0x1B, 0x03, 0x01, 0x00, 0x03, 0x00, 0x75, 0x03, 0x1B, + 0x03, 0x01, 0x00, 0x03, 0x00, 0x55, 0x03, 0x1B, 0x03, 0x00, 0x00, 0x03, 0x00, 0x75, 0x03, 0x1B, + 0x03, 0x00, 0x00, 0x01, 0x00, 0x0F, 0x01, 0xD7, 0x01, 0xD8, 0x01, 0xFA, 0x1E, 0x08, 0x1E, 0x09, + 0x1E, 0x2E, 0x1E, 0x2F, 0x1E, 0xDA, 0x1E, 0xDB, 0x1E, 0xDC, 0x1E, 0xDD, 0x1E, 0xE8, 0x1E, 0xE9, + 0x1E, 0xEA, 0x1E, 0xEB, 0x00, 0x01, 0x00, 0x74, 0x00, 0x0B, 0x00, 0x1C, 0x00, 0x24, 0x00, 0x2C, + 0x00, 0x34, 0x00, 0x3C, 0x00, 0x44, 0x00, 0x4C, 0x00, 0x54, 0x00, 0x5C, 0x00, 0x64, 0x00, 0x6C, + 0x00, 0x03, 0x00, 0x41, 0x03, 0x0A, 0x03, 0x41, 0x00, 0x03, 0x00, 0x43, 0x03, 0x27, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x63, 0x03, 0x27, 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x1B, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x6F, 0x03, 0x1B, 0x03, 0x41, 0x00, 0x03, 0x00, 0x4F, 0x03, 0x1B, 0x03, 0x40, + 0x00, 0x03, 0x00, 0x6F, 0x03, 0x1B, 0x03, 0x40, 0x00, 0x03, 0x00, 0x55, 0x03, 0x1B, 0x03, 0x41, + 0x00, 0x03, 0x00, 0x75, 0x03, 0x1B, 0x03, 0x41, 0x00, 0x03, 0x00, 0x55, 0x03, 0x1B, 0x03, 0x40, + 0x00, 0x03, 0x00, 0x75, 0x03, 0x1B, 0x03, 0x40, 0x00, 0x01, 0x00, 0x0B, 0x01, 0xFA, 0x1E, 0x08, + 0x1E, 0x09, 0x1E, 0xDA, 0x1E, 0xDB, 0x1E, 0xDC, 0x1E, 0xDD, 0x1E, 0xE8, 0x1E, 0xE9, 0x1E, 0xEA, + 0x1E, 0xEB, 0x00, 0x01, 0x00, 0x6A, 0x00, 0x0A, 0x00, 0x1A, 0x00, 0x22, 0x00, 0x2A, 0x00, 0x32, + 0x00, 0x3A, 0x00, 0x42, 0x00, 0x4A, 0x00, 0x52, 0x00, 0x5A, 0x00, 0x62, 0x00, 0x03, 0x00, 0x43, + 0x03, 0x41, 0x03, 0x27, 0x00, 0x03, 0x00, 0x63, 0x03, 0x41, 0x03, 0x27, 0x00, 0x03, 0x00, 0x4F, + 0x03, 0x41, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x41, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x4F, + 0x03, 0x40, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x6F, 0x03, 0x40, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x55, + 0x03, 0x41, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x75, 0x03, 0x41, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x55, + 0x03, 0x40, 0x03, 0x1B, 0x00, 0x03, 0x00, 0x75, 0x03, 0x40, 0x03, 0x1B, 0x00, 0x01, 0x00, 0x0A, + 0x1E, 0x08, 0x1E, 0x09, 0x1E, 0xDA, 0x1E, 0xDB, 0x1E, 0xDC, 0x1E, 0xDD, 0x1E, 0xE8, 0x1E, 0xE9, + 0x1E, 0xEA, 0x1E, 0xEB, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x26, + 0x00, 0x02, 0x00, 0x0A, 0x00, 0x1C, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x0D, 0x4A, 0x00, 0x02, + 0x0D, 0x3E, 0x0D, 0x4C, 0x00, 0x02, 0x0D, 0x57, 0x00, 0x01, 0x00, 0x04, 0x0D, 0x4B, 0x00, 0x02, + 0x0D, 0x3E, 0x00, 0x01, 0x00, 0x02, 0x0D, 0x46, 0x0D, 0x47, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x08, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x03, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x02, + 0x0D, 0x46, 0x0D, 0x3E, 0x00, 0x02, 0x0D, 0x47, 0x0D, 0x3E, 0x00, 0x02, 0x0D, 0x46, 0x0D, 0x57, + 0x00, 0x01, 0x00, 0x03, 0x0D, 0x4A, 0x0D, 0x4B, 0x0D, 0x4C, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x08, 0x00, 0x01, 0x00, 0x12, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x04, 0x10, 0x26, + 0x00, 0x02, 0x10, 0x2E, 0x00, 0x01, 0x00, 0x01, 0x10, 0x25, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x08, 0x00, 0x01, 0x00, 0x0E, 0x00, 0x01, 0x00, 0x08, 0x00, 0x02, 0x10, 0x25, 0x10, 0x2E, + 0x00, 0x01, 0x00, 0x01, 0x10, 0x26, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, + 0x00, 0x22, 0x00, 0x01, 0x00, 0x08, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, 0x0B, 0x4B, + 0x00, 0x02, 0x0B, 0x3E, 0x0B, 0x48, 0x00, 0x02, 0x0B, 0x56, 0x0B, 0x4C, 0x00, 0x02, 0x0B, 0x57, + 0x00, 0x01, 0x00, 0x01, 0x0B, 0x47, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, + 0x00, 0x1E, 0x00, 0x03, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x02, 0x0B, 0x47, 0x0B, 0x56, + 0x00, 0x02, 0x0B, 0x47, 0x0B, 0x3E, 0x00, 0x02, 0x0B, 0x47, 0x0B, 0x57, 0x00, 0x01, 0x00, 0x03, + 0x0B, 0x48, 0x0B, 0x4B, 0x0B, 0x4C, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, + 0x00, 0x38, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x2E, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x18, + 0x00, 0x1E, 0x0D, 0xDA, 0x00, 0x02, 0x0D, 0xCA, 0x0D, 0xDD, 0x00, 0x03, 0x0D, 0xCF, 0x0D, 0xCA, + 0x0D, 0xDC, 0x00, 0x02, 0x0D, 0xCF, 0x0D, 0xDE, 0x00, 0x02, 0x0D, 0xDF, 0x00, 0x01, 0x00, 0x04, + 0x0D, 0xDD, 0x00, 0x02, 0x0D, 0xCA, 0x00, 0x01, 0x00, 0x02, 0x0D, 0xD9, 0x0D, 0xDC, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x3C, 0x00, 0x01, 0x00, 0x26, 0x00, 0x04, 0x00, 0x0E, + 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x02, 0x0D, 0xD9, 0x0D, 0xCA, 0x00, 0x02, 0x0D, 0xD9, + 0x0D, 0xCF, 0x00, 0x02, 0x0D, 0xDC, 0x0D, 0xCA, 0x00, 0x02, 0x0D, 0xD9, 0x0D, 0xDF, 0x00, 0x01, + 0x00, 0x04, 0x0D, 0xDA, 0x0D, 0xDC, 0x0D, 0xDD, 0x0D, 0xDE, 0x00, 0x01, 0x00, 0x10, 0x00, 0x01, + 0x00, 0x08, 0x00, 0x03, 0x0D, 0xD9, 0x0D, 0xCF, 0x0D, 0xCA, 0x00, 0x01, 0x00, 0x01, 0x0D, 0xDD, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x32, 0x00, 0x03, 0x00, 0x0C, + 0x00, 0x16, 0x00, 0x28, 0x00, 0x01, 0x00, 0x04, 0x0B, 0x94, 0x00, 0x02, 0x0B, 0xD7, 0x00, 0x02, + 0x00, 0x06, 0x00, 0x0C, 0x0B, 0xCA, 0x00, 0x02, 0x0B, 0xBE, 0x0B, 0xCC, 0x00, 0x02, 0x0B, 0xD7, + 0x00, 0x01, 0x00, 0x04, 0x0B, 0xCB, 0x00, 0x02, 0x0B, 0xBE, 0x00, 0x01, 0x00, 0x03, 0x0B, 0x92, + 0x0B, 0xC6, 0x0B, 0xC7, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x26, + 0x00, 0x04, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x02, 0x0B, 0x92, 0x0B, 0xD7, + 0x00, 0x02, 0x0B, 0xC6, 0x0B, 0xBE, 0x00, 0x02, 0x0B, 0xC7, 0x0B, 0xBE, 0x00, 0x02, 0x0B, 0xC6, + 0x0B, 0xD7, 0x00, 0x01, 0x00, 0x04, 0x0B, 0x94, 0x0B, 0xCA, 0x0B, 0xCB, 0x0B, 0xCC, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x12, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, - 0x00, 0x04, 0x10, 0x26, 0x00, 0x02, 0x10, 0x2E, 0x00, 0x01, 0x00, 0x01, 0x10, 0x25, 0x00, 0x02, + 0x00, 0x04, 0x0C, 0x48, 0x00, 0x02, 0x0C, 0x56, 0x00, 0x01, 0x00, 0x01, 0x0C, 0x46, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x0E, 0x00, 0x01, 0x00, 0x08, 0x00, 0x02, - 0x10, 0x25, 0x10, 0x2E, 0x00, 0x01, 0x00, 0x01, 0x10, 0x26, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x08, 0x00, 0x01, 0x00, 0x3A, 0x00, 0x03, 0x00, 0x0C, 0x00, 0x16, 0x00, 0x20, 0x00, 0x01, - 0x00, 0x04, 0x0B, 0x5C, 0x00, 0x02, 0x0B, 0x3C, 0x00, 0x01, 0x00, 0x04, 0x0B, 0x5D, 0x00, 0x02, - 0x0B, 0x3C, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x14, 0x0B, 0x4B, 0x00, 0x02, 0x0B, 0x3E, - 0x0B, 0x48, 0x00, 0x02, 0x0B, 0x56, 0x0B, 0x4C, 0x00, 0x02, 0x0B, 0x57, 0x00, 0x01, 0x00, 0x03, - 0x0B, 0x21, 0x0B, 0x22, 0x0B, 0x47, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, - 0x00, 0x2E, 0x00, 0x05, 0x00, 0x10, 0x00, 0x16, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x02, - 0x0B, 0x47, 0x0B, 0x56, 0x00, 0x02, 0x0B, 0x47, 0x0B, 0x3E, 0x00, 0x02, 0x0B, 0x47, 0x0B, 0x57, - 0x00, 0x02, 0x0B, 0x21, 0x0B, 0x3C, 0x00, 0x02, 0x0B, 0x22, 0x0B, 0x3C, 0x00, 0x01, 0x00, 0x05, - 0x0B, 0x48, 0x0B, 0x4B, 0x0B, 0x4C, 0x0B, 0x5C, 0x0B, 0x5D, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x08, 0x00, 0x01, 0x00, 0x38, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x2E, 0x00, 0x04, 0x00, 0x0A, - 0x00, 0x10, 0x00, 0x18, 0x00, 0x1E, 0x0D, 0xDA, 0x00, 0x02, 0x0D, 0xCA, 0x0D, 0xDD, 0x00, 0x03, - 0x0D, 0xCF, 0x0D, 0xCA, 0x0D, 0xDC, 0x00, 0x02, 0x0D, 0xCF, 0x0D, 0xDE, 0x00, 0x02, 0x0D, 0xDF, - 0x00, 0x01, 0x00, 0x04, 0x0D, 0xDD, 0x00, 0x02, 0x0D, 0xCA, 0x00, 0x01, 0x00, 0x02, 0x0D, 0xD9, - 0x0D, 0xDC, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0A, 0x00, 0x3C, 0x00, 0x01, 0x00, 0x26, - 0x00, 0x04, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x02, 0x0D, 0xD9, 0x0D, 0xCA, - 0x00, 0x02, 0x0D, 0xD9, 0x0D, 0xCF, 0x00, 0x02, 0x0D, 0xDC, 0x0D, 0xCA, 0x00, 0x02, 0x0D, 0xD9, - 0x0D, 0xDF, 0x00, 0x01, 0x00, 0x04, 0x0D, 0xDA, 0x0D, 0xDC, 0x0D, 0xDD, 0x0D, 0xDE, 0x00, 0x01, - 0x00, 0x10, 0x00, 0x01, 0x00, 0x08, 0x00, 0x03, 0x0D, 0xD9, 0x0D, 0xCF, 0x0D, 0xCA, 0x00, 0x01, - 0x00, 0x01, 0x0D, 0xDD, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x32, - 0x00, 0x03, 0x00, 0x0C, 0x00, 0x16, 0x00, 0x28, 0x00, 0x01, 0x00, 0x04, 0x0B, 0x94, 0x00, 0x02, - 0x0B, 0xD7, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0x0B, 0xCA, 0x00, 0x02, 0x0B, 0xBE, 0x0B, 0xCC, - 0x00, 0x02, 0x0B, 0xD7, 0x00, 0x01, 0x00, 0x04, 0x0B, 0xCB, 0x00, 0x02, 0x0B, 0xBE, 0x00, 0x01, - 0x00, 0x03, 0x0B, 0x92, 0x0B, 0xC6, 0x0B, 0xC7, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, - 0x00, 0x01, 0x00, 0x26, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x1A, 0x00, 0x20, 0x00, 0x02, - 0x0B, 0x92, 0x0B, 0xD7, 0x00, 0x02, 0x0B, 0xC6, 0x0B, 0xBE, 0x00, 0x02, 0x0B, 0xC7, 0x0B, 0xBE, - 0x00, 0x02, 0x0B, 0xC6, 0x0B, 0xD7, 0x00, 0x01, 0x00, 0x04, 0x0B, 0x94, 0x0B, 0xCA, 0x0B, 0xCB, - 0x0B, 0xCC, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x12, 0x00, 0x01, - 0x00, 0x08, 0x00, 0x01, 0x00, 0x04, 0x0C, 0x48, 0x00, 0x02, 0x0C, 0x56, 0x00, 0x01, 0x00, 0x01, - 0x0C, 0x46, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x0E, 0x00, 0x01, - 0x00, 0x08, 0x00, 0x02, 0x0C, 0x46, 0x0C, 0x56, 0x00, 0x01, 0x00, 0x01, 0x0C, 0x48, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0xEE, 0x00, 0x12, 0x00, 0x2A, 0x00, 0x34, - 0x00, 0x3E, 0x00, 0x48, 0x00, 0x52, 0x00, 0x5C, 0x00, 0x66, 0x00, 0x80, 0x00, 0x8A, 0x00, 0x94, - 0x00, 0x9E, 0x00, 0xA8, 0x00, 0xB2, 0x00, 0xBC, 0x00, 0xC6, 0x00, 0xD0, 0x00, 0xDA, 0x00, 0xE4, - 0x00, 0x01, 0x00, 0x04, 0x0F, 0x69, 0x00, 0x02, 0x0F, 0xB5, 0x00, 0x01, 0x00, 0x04, 0x0F, 0x43, - 0x00, 0x02, 0x0F, 0xB7, 0x00, 0x01, 0x00, 0x04, 0x0F, 0x4D, 0x00, 0x02, 0x0F, 0xB7, 0x00, 0x01, - 0x00, 0x04, 0x0F, 0x52, 0x00, 0x02, 0x0F, 0xB7, 0x00, 0x01, 0x00, 0x04, 0x0F, 0x57, 0x00, 0x02, - 0x0F, 0xB7, 0x00, 0x01, 0x00, 0x04, 0x0F, 0x5C, 0x00, 0x02, 0x0F, 0xB7, 0x00, 0x03, 0x00, 0x08, - 0x00, 0x0E, 0x00, 0x14, 0x0F, 0x73, 0x00, 0x02, 0x0F, 0x72, 0x0F, 0x75, 0x00, 0x02, 0x0F, 0x74, - 0x0F, 0x81, 0x00, 0x02, 0x0F, 0x80, 0x00, 0x01, 0x00, 0x04, 0x0F, 0x73, 0x00, 0x02, 0x0F, 0x71, - 0x00, 0x01, 0x00, 0x04, 0x0F, 0x75, 0x00, 0x02, 0x0F, 0x71, 0x00, 0x01, 0x00, 0x04, 0x0F, 0x81, - 0x00, 0x02, 0x0F, 0x71, 0x00, 0x01, 0x00, 0x04, 0x0F, 0xB9, 0x00, 0x02, 0x0F, 0xB5, 0x00, 0x01, - 0x00, 0x04, 0x0F, 0x93, 0x00, 0x02, 0x0F, 0xB7, 0x00, 0x01, 0x00, 0x04, 0x0F, 0x9D, 0x00, 0x02, - 0x0F, 0xB7, 0x00, 0x01, 0x00, 0x04, 0x0F, 0xA2, 0x00, 0x02, 0x0F, 0xB7, 0x00, 0x01, 0x00, 0x04, - 0x0F, 0xA7, 0x00, 0x02, 0x0F, 0xB7, 0x00, 0x01, 0x00, 0x04, 0x0F, 0xAC, 0x00, 0x02, 0x0F, 0xB7, - 0x00, 0x01, 0x00, 0x04, 0x0F, 0x76, 0x00, 0x02, 0x0F, 0x80, 0x00, 0x01, 0x00, 0x04, 0x0F, 0x78, - 0x00, 0x02, 0x0F, 0x80, 0x00, 0x01, 0x00, 0x12, 0x0F, 0x40, 0x0F, 0x42, 0x0F, 0x4C, 0x0F, 0x51, - 0x0F, 0x56, 0x0F, 0x5B, 0x0F, 0x71, 0x0F, 0x72, 0x0F, 0x74, 0x0F, 0x80, 0x0F, 0x90, 0x0F, 0x92, - 0x0F, 0x9C, 0x0F, 0xA1, 0x0F, 0xA6, 0x0F, 0xAB, 0x0F, 0xB2, 0x0F, 0xB3, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x02, 0x00, 0x0A, 0x00, 0xBE, 0x00, 0x01, 0x00, 0x8E, 0x00, 0x11, 0x00, 0x28, 0x00, 0x2E, - 0x00, 0x34, 0x00, 0x3A, 0x00, 0x40, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, 0x00, 0x5E, - 0x00, 0x64, 0x00, 0x6A, 0x00, 0x70, 0x00, 0x76, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x88, 0x00, 0x02, - 0x0F, 0x42, 0x0F, 0xB7, 0x00, 0x02, 0x0F, 0x4C, 0x0F, 0xB7, 0x00, 0x02, 0x0F, 0x51, 0x0F, 0xB7, - 0x00, 0x02, 0x0F, 0x56, 0x0F, 0xB7, 0x00, 0x02, 0x0F, 0x5B, 0x0F, 0xB7, 0x00, 0x02, 0x0F, 0x40, - 0x0F, 0xB5, 0x00, 0x02, 0x0F, 0x71, 0x0F, 0x72, 0x00, 0x02, 0x0F, 0x71, 0x0F, 0x74, 0x00, 0x02, - 0x0F, 0xB2, 0x0F, 0x80, 0x00, 0x02, 0x0F, 0xB3, 0x0F, 0x80, 0x00, 0x02, 0x0F, 0x71, 0x0F, 0x80, - 0x00, 0x02, 0x0F, 0x92, 0x0F, 0xB7, 0x00, 0x02, 0x0F, 0x9C, 0x0F, 0xB7, 0x00, 0x02, 0x0F, 0xA1, - 0x0F, 0xB7, 0x00, 0x02, 0x0F, 0xA6, 0x0F, 0xB7, 0x00, 0x02, 0x0F, 0xAB, 0x0F, 0xB7, 0x00, 0x02, - 0x0F, 0x90, 0x0F, 0xB5, 0x00, 0x01, 0x00, 0x11, 0x0F, 0x43, 0x0F, 0x4D, 0x0F, 0x52, 0x0F, 0x57, - 0x0F, 0x5C, 0x0F, 0x69, 0x0F, 0x73, 0x0F, 0x75, 0x0F, 0x76, 0x0F, 0x78, 0x0F, 0x81, 0x0F, 0x93, - 0x0F, 0x9D, 0x0F, 0xA2, 0x0F, 0xA7, 0x0F, 0xAC, 0x0F, 0xB9, 0x00, 0x01, 0x00, 0x1E, 0x00, 0x03, - 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x02, 0x0F, 0x72, 0x0F, 0x71, 0x00, 0x02, 0x0F, 0x74, - 0x0F, 0x71, 0x00, 0x02, 0x0F, 0x80, 0x0F, 0x71, 0x00, 0x01, 0x00, 0x03, 0x0F, 0x73, 0x0F, 0x75, - 0x0F, 0x81 + 0x0C, 0x46, 0x0C, 0x56, 0x00, 0x01, 0x00, 0x01, 0x0C, 0x48, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x08, 0x00, 0x01, 0x00, 0x8A, 0x00, 0x0B, 0x00, 0x1C, 0x00, 0x26, 0x00, 0x30, 0x00, 0x3A, + 0x00, 0x44, 0x00, 0x4E, 0x00, 0x58, 0x00, 0x62, 0x00, 0x6C, 0x00, 0x76, 0x00, 0x80, 0x00, 0x01, + 0x00, 0x04, 0x1B, 0x06, 0x00, 0x02, 0x1B, 0x35, 0x00, 0x01, 0x00, 0x04, 0x1B, 0x08, 0x00, 0x02, + 0x1B, 0x35, 0x00, 0x01, 0x00, 0x04, 0x1B, 0x0A, 0x00, 0x02, 0x1B, 0x35, 0x00, 0x01, 0x00, 0x04, + 0x1B, 0x0C, 0x00, 0x02, 0x1B, 0x35, 0x00, 0x01, 0x00, 0x04, 0x1B, 0x0E, 0x00, 0x02, 0x1B, 0x35, + 0x00, 0x01, 0x00, 0x04, 0x1B, 0x12, 0x00, 0x02, 0x1B, 0x35, 0x00, 0x01, 0x00, 0x04, 0x1B, 0x3B, + 0x00, 0x02, 0x1B, 0x35, 0x00, 0x01, 0x00, 0x04, 0x1B, 0x3D, 0x00, 0x02, 0x1B, 0x35, 0x00, 0x01, + 0x00, 0x04, 0x1B, 0x40, 0x00, 0x02, 0x1B, 0x35, 0x00, 0x01, 0x00, 0x04, 0x1B, 0x41, 0x00, 0x02, + 0x1B, 0x35, 0x00, 0x01, 0x00, 0x04, 0x1B, 0x43, 0x00, 0x02, 0x1B, 0x35, 0x00, 0x01, 0x00, 0x0B, + 0x1B, 0x05, 0x1B, 0x07, 0x1B, 0x09, 0x1B, 0x0B, 0x1B, 0x0D, 0x1B, 0x11, 0x1B, 0x3A, 0x1B, 0x3C, + 0x1B, 0x3E, 0x1B, 0x3F, 0x1B, 0x42, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, + 0x00, 0x5E, 0x00, 0x0B, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0x00, 0x2E, 0x00, 0x34, 0x00, 0x3A, + 0x00, 0x40, 0x00, 0x46, 0x00, 0x4C, 0x00, 0x52, 0x00, 0x58, 0x00, 0x02, 0x1B, 0x05, 0x1B, 0x35, + 0x00, 0x02, 0x1B, 0x07, 0x1B, 0x35, 0x00, 0x02, 0x1B, 0x09, 0x1B, 0x35, 0x00, 0x02, 0x1B, 0x0B, + 0x1B, 0x35, 0x00, 0x02, 0x1B, 0x0D, 0x1B, 0x35, 0x00, 0x02, 0x1B, 0x11, 0x1B, 0x35, 0x00, 0x02, + 0x1B, 0x3A, 0x1B, 0x35, 0x00, 0x02, 0x1B, 0x3C, 0x1B, 0x35, 0x00, 0x02, 0x1B, 0x3E, 0x1B, 0x35, + 0x00, 0x02, 0x1B, 0x3F, 0x1B, 0x35, 0x00, 0x02, 0x1B, 0x42, 0x1B, 0x35, 0x00, 0x01, 0x00, 0x0B, + 0x1B, 0x06, 0x1B, 0x08, 0x1B, 0x0A, 0x1B, 0x0C, 0x1B, 0x0E, 0x1B, 0x12, 0x1B, 0x3B, 0x1B, 0x3D, + 0x1B, 0x40, 0x1B, 0x41, 0x1B, 0x43 }; const le_uint8 CanonShaping::glyphDefinitionTable[] = { @@ -3701,7 +3561,7 @@ const le_uint8 CanonShaping::glyphDefinitionTable[] = { 0xFC, 0x00, 0xFC, 0x5D, 0x00, 0x02, 0xFC, 0x64, 0xFC, 0xF1, 0x00, 0x02, 0xFC, 0xF5, 0xFD, 0x3D, 0x00, 0x02, 0xFD, 0x50, 0xFD, 0x8F, 0x00, 0x02, 0xFD, 0x92, 0xFD, 0xC7, 0x00, 0x02, 0xFD, 0xF0, 0xFD, 0xFC, 0x00, 0x02, 0xFE, 0x80, 0xFE, 0xF4, 0x00, 0x01, 0xFE, 0xF5, 0xFE, 0xFC, 0x00, 0x02, - 0x00, 0x02, 0x00, 0xC1, 0x03, 0x00, 0x03, 0x14, 0x00, 0xE6, 0x03, 0x15, 0x03, 0x15, 0x00, 0xE8, + 0x00, 0x02, 0x00, 0xCE, 0x03, 0x00, 0x03, 0x14, 0x00, 0xE6, 0x03, 0x15, 0x03, 0x15, 0x00, 0xE8, 0x03, 0x16, 0x03, 0x19, 0x00, 0xDC, 0x03, 0x1A, 0x03, 0x1A, 0x00, 0xE8, 0x03, 0x1B, 0x03, 0x1B, 0x00, 0xD8, 0x03, 0x1C, 0x03, 0x20, 0x00, 0xDC, 0x03, 0x21, 0x03, 0x22, 0x00, 0xCA, 0x03, 0x23, 0x03, 0x26, 0x00, 0xDC, 0x03, 0x27, 0x03, 0x28, 0x00, 0xCA, 0x03, 0x29, 0x03, 0x33, 0x00, 0xDC, @@ -3719,61 +3579,66 @@ const le_uint8 CanonShaping::glyphDefinitionTable[] = { 0x05, 0xA7, 0x00, 0xDC, 0x05, 0xA8, 0x05, 0xA8, 0x00, 0xE6, 0x05, 0xA9, 0x05, 0xA9, 0x00, 0xE8, 0x05, 0xAA, 0x05, 0xAA, 0x00, 0xDC, 0x05, 0xAB, 0x05, 0xAC, 0x00, 0xE6, 0x05, 0xAD, 0x05, 0xAD, 0x00, 0xDE, 0x05, 0xAE, 0x05, 0xAE, 0x00, 0xE8, 0x05, 0xAF, 0x05, 0xAF, 0x00, 0xE6, 0x05, 0xB0, - 0x05, 0xB8, 0x00, 0xDC, 0x05, 0xB9, 0x05, 0xB9, 0x00, 0x1B, 0x05, 0xBB, 0x05, 0xBB, 0x00, 0xDC, - 0x05, 0xBC, 0x05, 0xBC, 0x00, 0x15, 0x05, 0xBD, 0x05, 0xBD, 0x00, 0xDC, 0x05, 0xBF, 0x05, 0xBF, - 0x00, 0x17, 0x05, 0xC1, 0x05, 0xC1, 0x00, 0x0A, 0x05, 0xC2, 0x05, 0xC2, 0x00, 0x0B, 0x05, 0xC4, - 0x05, 0xC4, 0x00, 0xE6, 0x05, 0xC5, 0x05, 0xC5, 0x00, 0xDC, 0x05, 0xC7, 0x05, 0xC7, 0x00, 0x12, - 0x06, 0x10, 0x06, 0x15, 0x00, 0xE6, 0x06, 0x4B, 0x06, 0x4C, 0x00, 0x1F, 0x06, 0x4D, 0x06, 0x4D, - 0x00, 0x1E, 0x06, 0x4E, 0x06, 0x4F, 0x00, 0x1F, 0x06, 0x50, 0x06, 0x50, 0x00, 0x1E, 0x06, 0x51, - 0x06, 0x51, 0x00, 0x1C, 0x06, 0x52, 0x06, 0x52, 0x00, 0x1F, 0x06, 0x53, 0x06, 0x53, 0x00, 0x20, - 0x06, 0x54, 0x06, 0x55, 0x00, 0x1B, 0x06, 0x56, 0x06, 0x56, 0x00, 0x1D, 0x06, 0x57, 0x06, 0x58, - 0x00, 0x1F, 0x06, 0x59, 0x06, 0x5B, 0x00, 0xE6, 0x06, 0x5C, 0x06, 0x5C, 0x00, 0xDC, 0x06, 0x5D, - 0x06, 0x5E, 0x00, 0xE6, 0x06, 0x70, 0x06, 0x70, 0x00, 0x1D, 0x06, 0xD6, 0x06, 0xDC, 0x00, 0xE6, - 0x06, 0xDF, 0x06, 0xE0, 0x00, 0xE6, 0x06, 0xE1, 0x06, 0xE1, 0x00, 0x1F, 0x06, 0xE2, 0x06, 0xE2, - 0x00, 0xE6, 0x06, 0xE3, 0x06, 0xE3, 0x00, 0xDC, 0x06, 0xE4, 0x06, 0xE4, 0x00, 0xE6, 0x06, 0xE7, - 0x06, 0xE8, 0x00, 0xE6, 0x06, 0xEA, 0x06, 0xEA, 0x00, 0xDC, 0x06, 0xEB, 0x06, 0xEC, 0x00, 0xE6, - 0x06, 0xED, 0x06, 0xED, 0x00, 0xDC, 0x07, 0x11, 0x07, 0x11, 0x00, 0x24, 0x07, 0x30, 0x07, 0x30, - 0x00, 0xE6, 0x07, 0x31, 0x07, 0x31, 0x00, 0xDC, 0x07, 0x32, 0x07, 0x33, 0x00, 0xE6, 0x07, 0x34, - 0x07, 0x34, 0x00, 0xDC, 0x07, 0x35, 0x07, 0x36, 0x00, 0xE6, 0x07, 0x37, 0x07, 0x39, 0x00, 0xDC, - 0x07, 0x3A, 0x07, 0x3A, 0x00, 0xE6, 0x07, 0x3B, 0x07, 0x3C, 0x00, 0xDC, 0x07, 0x3D, 0x07, 0x3D, - 0x00, 0xE6, 0x07, 0x3E, 0x07, 0x3E, 0x00, 0xDC, 0x07, 0x3F, 0x07, 0x41, 0x00, 0xE6, 0x07, 0x42, - 0x07, 0x42, 0x00, 0xDC, 0x07, 0x43, 0x07, 0x43, 0x00, 0xE6, 0x07, 0x44, 0x07, 0x44, 0x00, 0xDC, - 0x07, 0x45, 0x07, 0x45, 0x00, 0xE6, 0x07, 0x46, 0x07, 0x46, 0x00, 0xDC, 0x07, 0x47, 0x07, 0x47, - 0x00, 0xE6, 0x07, 0x48, 0x07, 0x48, 0x00, 0xDC, 0x07, 0x49, 0x07, 0x4A, 0x00, 0xE6, 0x09, 0x3C, - 0x09, 0x3C, 0x00, 0x07, 0x09, 0x4D, 0x09, 0x4D, 0x00, 0x09, 0x09, 0x51, 0x09, 0x51, 0x00, 0xE6, - 0x09, 0x52, 0x09, 0x52, 0x00, 0xDC, 0x09, 0x53, 0x09, 0x54, 0x00, 0xE6, 0x09, 0xBC, 0x09, 0xBC, - 0x00, 0x07, 0x09, 0xCD, 0x09, 0xCD, 0x00, 0x09, 0x0A, 0x3C, 0x0A, 0x3C, 0x00, 0x07, 0x0A, 0x4D, - 0x0A, 0x4D, 0x00, 0x09, 0x0A, 0xBC, 0x0A, 0xBC, 0x00, 0x07, 0x0A, 0xCD, 0x0A, 0xCD, 0x00, 0x09, - 0x0B, 0x3C, 0x0B, 0x3C, 0x00, 0x07, 0x0B, 0x4D, 0x0B, 0x4D, 0x00, 0x09, 0x0B, 0xCD, 0x0B, 0xCD, - 0x00, 0x09, 0x0C, 0x4D, 0x0C, 0x4D, 0x00, 0x09, 0x0C, 0x55, 0x0C, 0x55, 0x00, 0x54, 0x0C, 0x56, - 0x0C, 0x56, 0x00, 0x5B, 0x0C, 0xBC, 0x0C, 0xBC, 0x00, 0x07, 0x0C, 0xCD, 0x0C, 0xCD, 0x00, 0x09, - 0x0D, 0x4D, 0x0D, 0x4D, 0x00, 0x09, 0x0D, 0xCA, 0x0D, 0xCA, 0x00, 0x09, 0x0E, 0x38, 0x0E, 0x39, - 0x00, 0x67, 0x0E, 0x3A, 0x0E, 0x3A, 0x00, 0x09, 0x0E, 0x48, 0x0E, 0x4B, 0x00, 0x6B, 0x0E, 0xB8, - 0x0E, 0xB9, 0x00, 0x76, 0x0E, 0xC8, 0x0E, 0xCB, 0x00, 0x7A, 0x0F, 0x18, 0x0F, 0x19, 0x00, 0xDC, - 0x0F, 0x35, 0x0F, 0x35, 0x00, 0xDC, 0x0F, 0x37, 0x0F, 0x37, 0x00, 0xDC, 0x0F, 0x39, 0x0F, 0x39, - 0x00, 0xD8, 0x0F, 0x71, 0x0F, 0x71, 0x00, 0x81, 0x0F, 0x72, 0x0F, 0x72, 0x00, 0x82, 0x0F, 0x74, - 0x0F, 0x74, 0x00, 0x84, 0x0F, 0x7A, 0x0F, 0x7D, 0x00, 0x82, 0x0F, 0x80, 0x0F, 0x80, 0x00, 0x82, - 0x0F, 0x82, 0x0F, 0x83, 0x00, 0xE6, 0x0F, 0x84, 0x0F, 0x84, 0x00, 0x09, 0x0F, 0x86, 0x0F, 0x87, - 0x00, 0xE6, 0x0F, 0xC6, 0x0F, 0xC6, 0x00, 0xDC, 0x10, 0x37, 0x10, 0x37, 0x00, 0x07, 0x10, 0x39, - 0x10, 0x39, 0x00, 0x09, 0x13, 0x5F, 0x13, 0x5F, 0x00, 0xE6, 0x17, 0x14, 0x17, 0x14, 0x00, 0x09, - 0x17, 0x34, 0x17, 0x34, 0x00, 0x09, 0x17, 0xD2, 0x17, 0xD2, 0x00, 0x09, 0x17, 0xDD, 0x17, 0xDD, - 0x00, 0xE6, 0x18, 0xA9, 0x18, 0xA9, 0x00, 0xE4, 0x19, 0x39, 0x19, 0x39, 0x00, 0xDE, 0x19, 0x3A, - 0x19, 0x3A, 0x00, 0xE6, 0x19, 0x3B, 0x19, 0x3B, 0x00, 0xDC, 0x1A, 0x17, 0x1A, 0x17, 0x00, 0xE6, - 0x1A, 0x18, 0x1A, 0x18, 0x00, 0xDC, 0x1D, 0xC0, 0x1D, 0xC1, 0x00, 0xE6, 0x1D, 0xC2, 0x1D, 0xC2, - 0x00, 0xDC, 0x1D, 0xC3, 0x1D, 0xC3, 0x00, 0xE6, 0x20, 0xD0, 0x20, 0xD1, 0x00, 0xE6, 0x20, 0xD2, - 0x20, 0xD3, 0x00, 0x01, 0x20, 0xD4, 0x20, 0xD7, 0x00, 0xE6, 0x20, 0xD8, 0x20, 0xDA, 0x00, 0x01, - 0x20, 0xDB, 0x20, 0xDC, 0x00, 0xE6, 0x20, 0xE1, 0x20, 0xE1, 0x00, 0xE6, 0x20, 0xE5, 0x20, 0xE6, - 0x00, 0x01, 0x20, 0xE7, 0x20, 0xE7, 0x00, 0xE6, 0x20, 0xE8, 0x20, 0xE8, 0x00, 0xDC, 0x20, 0xE9, - 0x20, 0xE9, 0x00, 0xE6, 0x20, 0xEA, 0x20, 0xEB, 0x00, 0x01, 0x30, 0x2A, 0x30, 0x2A, 0x00, 0xDA, - 0x30, 0x2B, 0x30, 0x2B, 0x00, 0xE4, 0x30, 0x2C, 0x30, 0x2C, 0x00, 0xE8, 0x30, 0x2D, 0x30, 0x2D, - 0x00, 0xDE, 0x30, 0x2E, 0x30, 0x2F, 0x00, 0xE0, 0x30, 0x99, 0x30, 0x9A, 0x00, 0x08, 0xA8, 0x06, - 0xA8, 0x06, 0x00, 0x09, 0xFB, 0x1E, 0xFB, 0x1E, 0x00, 0x1A, 0xFE, 0x20, 0xFE, 0x23, 0x00, 0xE6, - 0x0A, 0x0D, 0x0A, 0x0D, 0x00, 0xDC, 0x0A, 0x0F, 0x0A, 0x0F, 0x00, 0xE6, 0x0A, 0x38, 0x0A, 0x38, - 0x00, 0xE6, 0x0A, 0x39, 0x0A, 0x39, 0x00, 0x01, 0x0A, 0x3A, 0x0A, 0x3A, 0x00, 0xDC, 0x0A, 0x3F, - 0x0A, 0x3F, 0x00, 0x09, 0xD1, 0x65, 0xD1, 0x66, 0x00, 0xD8, 0xD1, 0x67, 0xD1, 0x69, 0x00, 0x01, - 0xD1, 0x6D, 0xD1, 0x6D, 0x00, 0xE2, 0xD1, 0x6E, 0xD1, 0x72, 0x00, 0xD8, 0xD1, 0x7B, 0xD1, 0x82, - 0x00, 0xDC, 0xD1, 0x85, 0xD1, 0x89, 0x00, 0xE6, 0xD1, 0x8A, 0xD1, 0x8B, 0x00, 0xDC, 0xD1, 0xAA, - 0xD1, 0xAD, 0x00, 0xE6, 0xD2, 0x42, 0xD2, 0x44, 0x00, 0xE6 + 0x05, 0xB8, 0x00, 0xDC, 0x05, 0xB9, 0x05, 0xB9, 0x00, 0x1B, 0x05, 0xBA, 0x05, 0xBA, 0x00, 0x13, + 0x05, 0xBB, 0x05, 0xBB, 0x00, 0xDC, 0x05, 0xBC, 0x05, 0xBC, 0x00, 0x15, 0x05, 0xBD, 0x05, 0xBD, + 0x00, 0xDC, 0x05, 0xBF, 0x05, 0xBF, 0x00, 0x17, 0x05, 0xC1, 0x05, 0xC1, 0x00, 0x0A, 0x05, 0xC2, + 0x05, 0xC2, 0x00, 0x0B, 0x05, 0xC4, 0x05, 0xC4, 0x00, 0xE6, 0x05, 0xC5, 0x05, 0xC5, 0x00, 0xDC, + 0x05, 0xC7, 0x05, 0xC7, 0x00, 0x12, 0x06, 0x10, 0x06, 0x15, 0x00, 0xE6, 0x06, 0x4B, 0x06, 0x4C, + 0x00, 0x1F, 0x06, 0x4D, 0x06, 0x4D, 0x00, 0x1E, 0x06, 0x4E, 0x06, 0x4F, 0x00, 0x1F, 0x06, 0x50, + 0x06, 0x50, 0x00, 0x1E, 0x06, 0x51, 0x06, 0x51, 0x00, 0x1C, 0x06, 0x52, 0x06, 0x52, 0x00, 0x1F, + 0x06, 0x53, 0x06, 0x53, 0x00, 0x20, 0x06, 0x54, 0x06, 0x55, 0x00, 0x1B, 0x06, 0x56, 0x06, 0x56, + 0x00, 0x1D, 0x06, 0x57, 0x06, 0x58, 0x00, 0x1F, 0x06, 0x59, 0x06, 0x5B, 0x00, 0xE6, 0x06, 0x5C, + 0x06, 0x5C, 0x00, 0xDC, 0x06, 0x5D, 0x06, 0x5E, 0x00, 0xE6, 0x06, 0x70, 0x06, 0x70, 0x00, 0x1D, + 0x06, 0xD6, 0x06, 0xDC, 0x00, 0xE6, 0x06, 0xDF, 0x06, 0xE0, 0x00, 0xE6, 0x06, 0xE1, 0x06, 0xE1, + 0x00, 0x1F, 0x06, 0xE2, 0x06, 0xE2, 0x00, 0xE6, 0x06, 0xE3, 0x06, 0xE3, 0x00, 0xDC, 0x06, 0xE4, + 0x06, 0xE4, 0x00, 0xE6, 0x06, 0xE7, 0x06, 0xE8, 0x00, 0xE6, 0x06, 0xEA, 0x06, 0xEA, 0x00, 0xDC, + 0x06, 0xEB, 0x06, 0xEC, 0x00, 0xE6, 0x06, 0xED, 0x06, 0xED, 0x00, 0xDC, 0x07, 0x11, 0x07, 0x11, + 0x00, 0x24, 0x07, 0x30, 0x07, 0x30, 0x00, 0xE6, 0x07, 0x31, 0x07, 0x31, 0x00, 0xDC, 0x07, 0x32, + 0x07, 0x33, 0x00, 0xE6, 0x07, 0x34, 0x07, 0x34, 0x00, 0xDC, 0x07, 0x35, 0x07, 0x36, 0x00, 0xE6, + 0x07, 0x37, 0x07, 0x39, 0x00, 0xDC, 0x07, 0x3A, 0x07, 0x3A, 0x00, 0xE6, 0x07, 0x3B, 0x07, 0x3C, + 0x00, 0xDC, 0x07, 0x3D, 0x07, 0x3D, 0x00, 0xE6, 0x07, 0x3E, 0x07, 0x3E, 0x00, 0xDC, 0x07, 0x3F, + 0x07, 0x41, 0x00, 0xE6, 0x07, 0x42, 0x07, 0x42, 0x00, 0xDC, 0x07, 0x43, 0x07, 0x43, 0x00, 0xE6, + 0x07, 0x44, 0x07, 0x44, 0x00, 0xDC, 0x07, 0x45, 0x07, 0x45, 0x00, 0xE6, 0x07, 0x46, 0x07, 0x46, + 0x00, 0xDC, 0x07, 0x47, 0x07, 0x47, 0x00, 0xE6, 0x07, 0x48, 0x07, 0x48, 0x00, 0xDC, 0x07, 0x49, + 0x07, 0x4A, 0x00, 0xE6, 0x07, 0xEB, 0x07, 0xF1, 0x00, 0xE6, 0x07, 0xF2, 0x07, 0xF2, 0x00, 0xDC, + 0x07, 0xF3, 0x07, 0xF3, 0x00, 0xE6, 0x09, 0x3C, 0x09, 0x3C, 0x00, 0x07, 0x09, 0x4D, 0x09, 0x4D, + 0x00, 0x09, 0x09, 0x51, 0x09, 0x51, 0x00, 0xE6, 0x09, 0x52, 0x09, 0x52, 0x00, 0xDC, 0x09, 0x53, + 0x09, 0x54, 0x00, 0xE6, 0x09, 0xBC, 0x09, 0xBC, 0x00, 0x07, 0x09, 0xCD, 0x09, 0xCD, 0x00, 0x09, + 0x0A, 0x3C, 0x0A, 0x3C, 0x00, 0x07, 0x0A, 0x4D, 0x0A, 0x4D, 0x00, 0x09, 0x0A, 0xBC, 0x0A, 0xBC, + 0x00, 0x07, 0x0A, 0xCD, 0x0A, 0xCD, 0x00, 0x09, 0x0B, 0x3C, 0x0B, 0x3C, 0x00, 0x07, 0x0B, 0x4D, + 0x0B, 0x4D, 0x00, 0x09, 0x0B, 0xCD, 0x0B, 0xCD, 0x00, 0x09, 0x0C, 0x4D, 0x0C, 0x4D, 0x00, 0x09, + 0x0C, 0x55, 0x0C, 0x55, 0x00, 0x54, 0x0C, 0x56, 0x0C, 0x56, 0x00, 0x5B, 0x0C, 0xBC, 0x0C, 0xBC, + 0x00, 0x07, 0x0C, 0xCD, 0x0C, 0xCD, 0x00, 0x09, 0x0D, 0x4D, 0x0D, 0x4D, 0x00, 0x09, 0x0D, 0xCA, + 0x0D, 0xCA, 0x00, 0x09, 0x0E, 0x38, 0x0E, 0x39, 0x00, 0x67, 0x0E, 0x3A, 0x0E, 0x3A, 0x00, 0x09, + 0x0E, 0x48, 0x0E, 0x4B, 0x00, 0x6B, 0x0E, 0xB8, 0x0E, 0xB9, 0x00, 0x76, 0x0E, 0xC8, 0x0E, 0xCB, + 0x00, 0x7A, 0x0F, 0x18, 0x0F, 0x19, 0x00, 0xDC, 0x0F, 0x35, 0x0F, 0x35, 0x00, 0xDC, 0x0F, 0x37, + 0x0F, 0x37, 0x00, 0xDC, 0x0F, 0x39, 0x0F, 0x39, 0x00, 0xD8, 0x0F, 0x71, 0x0F, 0x71, 0x00, 0x81, + 0x0F, 0x72, 0x0F, 0x72, 0x00, 0x82, 0x0F, 0x74, 0x0F, 0x74, 0x00, 0x84, 0x0F, 0x7A, 0x0F, 0x7D, + 0x00, 0x82, 0x0F, 0x80, 0x0F, 0x80, 0x00, 0x82, 0x0F, 0x82, 0x0F, 0x83, 0x00, 0xE6, 0x0F, 0x84, + 0x0F, 0x84, 0x00, 0x09, 0x0F, 0x86, 0x0F, 0x87, 0x00, 0xE6, 0x0F, 0xC6, 0x0F, 0xC6, 0x00, 0xDC, + 0x10, 0x37, 0x10, 0x37, 0x00, 0x07, 0x10, 0x39, 0x10, 0x39, 0x00, 0x09, 0x13, 0x5F, 0x13, 0x5F, + 0x00, 0xE6, 0x17, 0x14, 0x17, 0x14, 0x00, 0x09, 0x17, 0x34, 0x17, 0x34, 0x00, 0x09, 0x17, 0xD2, + 0x17, 0xD2, 0x00, 0x09, 0x17, 0xDD, 0x17, 0xDD, 0x00, 0xE6, 0x18, 0xA9, 0x18, 0xA9, 0x00, 0xE4, + 0x19, 0x39, 0x19, 0x39, 0x00, 0xDE, 0x19, 0x3A, 0x19, 0x3A, 0x00, 0xE6, 0x19, 0x3B, 0x19, 0x3B, + 0x00, 0xDC, 0x1A, 0x17, 0x1A, 0x17, 0x00, 0xE6, 0x1A, 0x18, 0x1A, 0x18, 0x00, 0xDC, 0x1B, 0x34, + 0x1B, 0x34, 0x00, 0x07, 0x1B, 0x44, 0x1B, 0x44, 0x00, 0x09, 0x1B, 0x6B, 0x1B, 0x6B, 0x00, 0xE6, + 0x1B, 0x6C, 0x1B, 0x6C, 0x00, 0xDC, 0x1B, 0x6D, 0x1B, 0x73, 0x00, 0xE6, 0x1D, 0xC0, 0x1D, 0xC1, + 0x00, 0xE6, 0x1D, 0xC2, 0x1D, 0xC2, 0x00, 0xDC, 0x1D, 0xC3, 0x1D, 0xC9, 0x00, 0xE6, 0x1D, 0xCA, + 0x1D, 0xCA, 0x00, 0xDC, 0x1D, 0xFE, 0x1D, 0xFE, 0x00, 0xE6, 0x1D, 0xFF, 0x1D, 0xFF, 0x00, 0xDC, + 0x20, 0xD0, 0x20, 0xD1, 0x00, 0xE6, 0x20, 0xD2, 0x20, 0xD3, 0x00, 0x01, 0x20, 0xD4, 0x20, 0xD7, + 0x00, 0xE6, 0x20, 0xD8, 0x20, 0xDA, 0x00, 0x01, 0x20, 0xDB, 0x20, 0xDC, 0x00, 0xE6, 0x20, 0xE1, + 0x20, 0xE1, 0x00, 0xE6, 0x20, 0xE5, 0x20, 0xE6, 0x00, 0x01, 0x20, 0xE7, 0x20, 0xE7, 0x00, 0xE6, + 0x20, 0xE8, 0x20, 0xE8, 0x00, 0xDC, 0x20, 0xE9, 0x20, 0xE9, 0x00, 0xE6, 0x20, 0xEA, 0x20, 0xEB, + 0x00, 0x01, 0x20, 0xEC, 0x20, 0xEF, 0x00, 0xDC, 0x30, 0x2A, 0x30, 0x2A, 0x00, 0xDA, 0x30, 0x2B, + 0x30, 0x2B, 0x00, 0xE4, 0x30, 0x2C, 0x30, 0x2C, 0x00, 0xE8, 0x30, 0x2D, 0x30, 0x2D, 0x00, 0xDE, + 0x30, 0x2E, 0x30, 0x2F, 0x00, 0xE0, 0x30, 0x99, 0x30, 0x9A, 0x00, 0x08, 0xA8, 0x06, 0xA8, 0x06, + 0x00, 0x09, 0xFB, 0x1E, 0xFB, 0x1E, 0x00, 0x1A, 0xFE, 0x20, 0xFE, 0x23, 0x00, 0xE6, 0x0A, 0x0D, + 0x0A, 0x0D, 0x00, 0xDC, 0x0A, 0x0F, 0x0A, 0x0F, 0x00, 0xE6, 0x0A, 0x38, 0x0A, 0x38, 0x00, 0xE6, + 0x0A, 0x39, 0x0A, 0x39, 0x00, 0x01, 0x0A, 0x3A, 0x0A, 0x3A, 0x00, 0xDC, 0x0A, 0x3F, 0x0A, 0x3F, + 0x00, 0x09, 0xD1, 0x65, 0xD1, 0x66, 0x00, 0xD8, 0xD1, 0x67, 0xD1, 0x69, 0x00, 0x01, 0xD1, 0x6D, + 0xD1, 0x6D, 0x00, 0xE2, 0xD1, 0x6E, 0xD1, 0x72, 0x00, 0xD8, 0xD1, 0x7B, 0xD1, 0x82, 0x00, 0xDC, + 0xD1, 0x85, 0xD1, 0x89, 0x00, 0xE6, 0xD1, 0x8A, 0xD1, 0x8B, 0x00, 0xDC, 0xD1, 0xAA, 0xD1, 0xAD, + 0x00, 0xE6, 0xD2, 0x42, 0xD2, 0x44, 0x00, 0xE6 }; U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/CanonShaping.h b/jdk/src/share/native/sun/font/layout/CanonShaping.h index e4f7c2cd014..62ad919b965 100644 --- a/jdk/src/share/native/sun/font/layout/CanonShaping.h +++ b/jdk/src/share/native/sun/font/layout/CanonShaping.h @@ -38,7 +38,7 @@ U_NAMESPACE_BEGIN class LEGlyphStorage; -class CanonShaping /* not : public UObject because all members are static */ +class U_LAYOUT_API CanonShaping /* not : public UObject because all members are static */ { public: static const le_uint8 glyphSubstitutionTable[]; diff --git a/jdk/src/share/native/sun/font/layout/ClassDefinitionTables.cpp b/jdk/src/share/native/sun/font/layout/ClassDefinitionTables.cpp index fcaf48de806..af600444007 100644 --- a/jdk/src/share/native/sun/font/layout/ClassDefinitionTables.cpp +++ b/jdk/src/share/native/sun/font/layout/ClassDefinitionTables.cpp @@ -93,7 +93,7 @@ le_int32 ClassDefFormat1Table::getGlyphClass(LEGlyphID glyphID) const TTGlyphID firstGlyph = SWAPW(startGlyph); TTGlyphID lastGlyph = firstGlyph + SWAPW(glyphCount); - if (ttGlyphID > firstGlyph && ttGlyphID < lastGlyph) { + if (ttGlyphID >= firstGlyph && ttGlyphID < lastGlyph) { return SWAPW(classValueArray[ttGlyphID - firstGlyph]); } diff --git a/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp b/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp index d2825ed73e3..c799fc957e8 100644 --- a/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp @@ -52,18 +52,23 @@ void ContextualSubstitutionBase::applySubstitutionLookups( le_uint16 substCount, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, - le_int32 position) + le_int32 position, + LEErrorCode& success) { + if (LE_FAILURE(success)) { + return; + } + GlyphIterator tempIterator(*glyphIterator); - for (le_int16 subst = 0; subst < substCount; subst += 1) { + for (le_int16 subst = 0; subst < substCount && LE_SUCCESS(success); subst += 1) { le_uint16 sequenceIndex = SWAPW(substLookupRecordArray[subst].sequenceIndex); le_uint16 lookupListIndex = SWAPW(substLookupRecordArray[subst].lookupListIndex); tempIterator.setCurrStreamPosition(position); tempIterator.next(sequenceIndex); - lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance); + lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance, success); } } @@ -165,9 +170,15 @@ le_bool ContextualSubstitutionBase::matchGlyphCoverages(const Offset *coverageTa return TRUE; } -le_uint32 ContextualSubstitutionSubtable::process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance) const +le_uint32 ContextualSubstitutionSubtable::process(const LookupProcessor *lookupProcessor, + GlyphIterator *glyphIterator, + const LEFontInstance *fontInstance, + LEErrorCode& success) const { + if (LE_FAILURE(success)) { + return 0; + } + switch(SWAPW(subtableFormat)) { case 0: @@ -176,22 +187,19 @@ le_uint32 ContextualSubstitutionSubtable::process(const LookupProcessor *lookupP case 1: { const ContextualSubstitutionFormat1Subtable *subtable = (const ContextualSubstitutionFormat1Subtable *) this; - - return subtable->process(lookupProcessor, glyphIterator, fontInstance); + return subtable->process(lookupProcessor, glyphIterator, fontInstance, success); } case 2: { const ContextualSubstitutionFormat2Subtable *subtable = (const ContextualSubstitutionFormat2Subtable *) this; - - return subtable->process(lookupProcessor, glyphIterator, fontInstance); + return subtable->process(lookupProcessor, glyphIterator, fontInstance, success); } case 3: { const ContextualSubstitutionFormat3Subtable *subtable = (const ContextualSubstitutionFormat3Subtable *) this; - - return subtable->process(lookupProcessor, glyphIterator, fontInstance); + return subtable->process(lookupProcessor, glyphIterator, fontInstance, success); } default: @@ -199,9 +207,15 @@ le_uint32 ContextualSubstitutionSubtable::process(const LookupProcessor *lookupP } } -le_uint32 ContextualSubstitutionFormat1Subtable::process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance) const +le_uint32 ContextualSubstitutionFormat1Subtable::process(const LookupProcessor *lookupProcessor, + GlyphIterator *glyphIterator, + const LEFontInstance *fontInstance, + LEErrorCode& success) const { + if (LE_FAILURE(success)) { + return 0; + } + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(glyph); @@ -227,7 +241,7 @@ le_uint32 ContextualSubstitutionFormat1Subtable::process(const LookupProcessor * const SubstitutionLookupRecord *substLookupRecordArray = (const SubstitutionLookupRecord *) &subRuleTable->inputGlyphArray[matchCount]; - applySubstitutionLookups(lookupProcessor, substLookupRecordArray, substCount, glyphIterator, fontInstance, position); + applySubstitutionLookups(lookupProcessor, substLookupRecordArray, substCount, glyphIterator, fontInstance, position, success); return matchCount + 1; } @@ -242,9 +256,15 @@ le_uint32 ContextualSubstitutionFormat1Subtable::process(const LookupProcessor * return 0; } -le_uint32 ContextualSubstitutionFormat2Subtable::process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance) const +le_uint32 ContextualSubstitutionFormat2Subtable::process(const LookupProcessor *lookupProcessor, + GlyphIterator *glyphIterator, + const LEFontInstance *fontInstance, + LEErrorCode& success) const { + if (LE_FAILURE(success)) { + return 0; + } + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(glyph); @@ -273,7 +293,7 @@ le_uint32 ContextualSubstitutionFormat2Subtable::process(const LookupProcessor * const SubstitutionLookupRecord *substLookupRecordArray = (const SubstitutionLookupRecord *) &subClassRuleTable->classArray[matchCount]; - applySubstitutionLookups(lookupProcessor, substLookupRecordArray, substCount, glyphIterator, fontInstance, position); + applySubstitutionLookups(lookupProcessor, substLookupRecordArray, substCount, glyphIterator, fontInstance, position, success); return matchCount + 1; } @@ -288,9 +308,15 @@ le_uint32 ContextualSubstitutionFormat2Subtable::process(const LookupProcessor * return 0; } -le_uint32 ContextualSubstitutionFormat3Subtable::process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance)const +le_uint32 ContextualSubstitutionFormat3Subtable::process(const LookupProcessor *lookupProcessor, + GlyphIterator *glyphIterator, + const LEFontInstance *fontInstance, + LEErrorCode& success)const { + if (LE_FAILURE(success)) { + return 0; + } + le_uint16 gCount = SWAPW(glyphCount); le_uint16 subCount = SWAPW(substCount); le_int32 position = glyphIterator->getCurrStreamPosition(); @@ -305,7 +331,7 @@ le_uint32 ContextualSubstitutionFormat3Subtable::process(const LookupProcessor * const SubstitutionLookupRecord *substLookupRecordArray = (const SubstitutionLookupRecord *) &coverageTableOffsetArray[gCount]; - ContextualSubstitutionBase::applySubstitutionLookups(lookupProcessor, substLookupRecordArray, subCount, glyphIterator, fontInstance, position); + ContextualSubstitutionBase::applySubstitutionLookups(lookupProcessor, substLookupRecordArray, subCount, glyphIterator, fontInstance, position, success); return gCount + 1; } @@ -315,9 +341,15 @@ le_uint32 ContextualSubstitutionFormat3Subtable::process(const LookupProcessor * return 0; } -le_uint32 ChainingContextualSubstitutionSubtable::process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance) const +le_uint32 ChainingContextualSubstitutionSubtable::process(const LookupProcessor *lookupProcessor, + GlyphIterator *glyphIterator, + const LEFontInstance *fontInstance, + LEErrorCode& success) const { + if (LE_FAILURE(success)) { + return 0; + } + switch(SWAPW(subtableFormat)) { case 0: @@ -326,22 +358,19 @@ le_uint32 ChainingContextualSubstitutionSubtable::process(const LookupProcessor case 1: { const ChainingContextualSubstitutionFormat1Subtable *subtable = (const ChainingContextualSubstitutionFormat1Subtable *) this; - - return subtable->process(lookupProcessor, glyphIterator, fontInstance); + return subtable->process(lookupProcessor, glyphIterator, fontInstance, success); } case 2: { const ChainingContextualSubstitutionFormat2Subtable *subtable = (const ChainingContextualSubstitutionFormat2Subtable *) this; - - return subtable->process(lookupProcessor, glyphIterator, fontInstance); + return subtable->process(lookupProcessor, glyphIterator, fontInstance, success); } case 3: { const ChainingContextualSubstitutionFormat3Subtable *subtable = (const ChainingContextualSubstitutionFormat3Subtable *) this; - - return subtable->process(lookupProcessor, glyphIterator, fontInstance); + return subtable->process(lookupProcessor, glyphIterator, fontInstance, success); } default: @@ -355,9 +384,15 @@ le_uint32 ChainingContextualSubstitutionSubtable::process(const LookupProcessor // emptyFeatureList matches an le_uint32 or an le_uint16... static const FeatureMask emptyFeatureList = 0x00000000UL; -le_uint32 ChainingContextualSubstitutionFormat1Subtable::process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance) const +le_uint32 ChainingContextualSubstitutionFormat1Subtable::process(const LookupProcessor *lookupProcessor, + GlyphIterator *glyphIterator, + const LEFontInstance *fontInstance, + LEErrorCode& success) const { + if (LE_FAILURE(success)) { + return 0; + } + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(glyph); @@ -405,7 +440,7 @@ le_uint32 ChainingContextualSubstitutionFormat1Subtable::process(const LookupPro const SubstitutionLookupRecord *substLookupRecordArray = (const SubstitutionLookupRecord *) &lookaheadGlyphArray[lookaheadGlyphCount + 1]; - applySubstitutionLookups(lookupProcessor, substLookupRecordArray, substCount, glyphIterator, fontInstance, position); + applySubstitutionLookups(lookupProcessor, substLookupRecordArray, substCount, glyphIterator, fontInstance, position, success); return inputGlyphCount + 1; } @@ -420,9 +455,15 @@ le_uint32 ChainingContextualSubstitutionFormat1Subtable::process(const LookupPro return 0; } -le_uint32 ChainingContextualSubstitutionFormat2Subtable::process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance) const +le_uint32 ChainingContextualSubstitutionFormat2Subtable::process(const LookupProcessor *lookupProcessor, + GlyphIterator *glyphIterator, + const LEFontInstance *fontInstance, + LEErrorCode& success) const { + if (LE_FAILURE(success)) { + return 0; + } + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(glyph); @@ -479,7 +520,7 @@ le_uint32 ChainingContextualSubstitutionFormat2Subtable::process(const LookupPro const SubstitutionLookupRecord *substLookupRecordArray = (const SubstitutionLookupRecord *) &lookaheadClassArray[lookaheadGlyphCount + 1]; - applySubstitutionLookups(lookupProcessor, substLookupRecordArray, substCount, glyphIterator, fontInstance, position); + applySubstitutionLookups(lookupProcessor, substLookupRecordArray, substCount, glyphIterator, fontInstance, position, success); return inputGlyphCount + 1; } @@ -494,9 +535,15 @@ le_uint32 ChainingContextualSubstitutionFormat2Subtable::process(const LookupPro return 0; } -le_uint32 ChainingContextualSubstitutionFormat3Subtable::process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance) const +le_uint32 ChainingContextualSubstitutionFormat3Subtable::process(const LookupProcessor *lookupProcessor, + GlyphIterator *glyphIterator, + const LEFontInstance *fontInstance, + LEErrorCode & success) const { + if (LE_FAILURE(success)) { + return 0; + } + le_uint16 backtrkGlyphCount = SWAPW(backtrackGlyphCount); le_uint16 inputGlyphCount = (le_uint16) SWAPW(backtrackCoverageTableOffsetArray[backtrkGlyphCount]); const Offset *inputCoverageTableOffsetArray = &backtrackCoverageTableOffsetArray[backtrkGlyphCount + 1]; @@ -534,7 +581,7 @@ le_uint32 ChainingContextualSubstitutionFormat3Subtable::process(const LookupPro const SubstitutionLookupRecord *substLookupRecordArray = (const SubstitutionLookupRecord *) &lookaheadCoverageTableOffsetArray[lookaheadGlyphCount + 1]; - ContextualSubstitutionBase::applySubstitutionLookups(lookupProcessor, substLookupRecordArray, substCount, glyphIterator, fontInstance, position); + ContextualSubstitutionBase::applySubstitutionLookups(lookupProcessor, substLookupRecordArray, substCount, glyphIterator, fontInstance, position, success); return inputGlyphCount; } diff --git a/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.h b/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.h index 743371d3ed0..9df57fee2eb 100644 --- a/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.h +++ b/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.h @@ -72,12 +72,13 @@ struct ContextualSubstitutionBase : GlyphSubstitutionSubtable le_uint16 substCount, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, - le_int32 position); + le_int32 position, + LEErrorCode& success); }; struct ContextualSubstitutionSubtable : ContextualSubstitutionBase { - le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; + le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; }; struct ContextualSubstitutionFormat1Subtable : ContextualSubstitutionSubtable @@ -85,7 +86,7 @@ struct ContextualSubstitutionFormat1Subtable : ContextualSubstitutionSubtable le_uint16 subRuleSetCount; Offset subRuleSetTableOffsetArray[ANY_NUMBER]; - le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; + le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; }; struct SubRuleSetTable @@ -110,7 +111,7 @@ struct ContextualSubstitutionFormat2Subtable : ContextualSubstitutionSubtable le_uint16 subClassSetCount; Offset subClassSetTableOffsetArray[ANY_NUMBER]; - le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; + le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; }; struct SubClassSetTable @@ -140,12 +141,12 @@ struct ContextualSubstitutionFormat3Subtable Offset coverageTableOffsetArray[ANY_NUMBER]; //SubstitutionLookupRecord substLookupRecord[ANY_NUMBER]; - le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; + le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; }; struct ChainingContextualSubstitutionSubtable : ContextualSubstitutionBase { - le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; + le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; }; struct ChainingContextualSubstitutionFormat1Subtable : ChainingContextualSubstitutionSubtable @@ -153,7 +154,7 @@ struct ChainingContextualSubstitutionFormat1Subtable : ChainingContextualSubstit le_uint16 chainSubRuleSetCount; Offset chainSubRuleSetTableOffsetArray[ANY_NUMBER]; - le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; + le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; }; struct ChainSubRuleSetTable @@ -184,7 +185,7 @@ struct ChainingContextualSubstitutionFormat2Subtable : ChainingContextualSubstit le_uint16 chainSubClassSetCount; Offset chainSubClassSetTableOffsetArray[ANY_NUMBER]; - le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; + le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; }; struct ChainSubClassSetTable @@ -222,7 +223,7 @@ struct ChainingContextualSubstitutionFormat3Subtable //le_uint16 substCount; //SubstitutionLookupRecord substLookupRecord[ANY_NUMBER]; - le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; + le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; }; U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/CoverageTables.cpp b/jdk/src/share/native/sun/font/layout/CoverageTables.cpp index e91d69f8d0e..2d7c10baec5 100644 --- a/jdk/src/share/native/sun/font/layout/CoverageTables.cpp +++ b/jdk/src/share/native/sun/font/layout/CoverageTables.cpp @@ -73,6 +73,10 @@ le_int32 CoverageFormat1Table::getGlyphCoverage(LEGlyphID glyphID) const le_uint16 probe = power; le_uint16 index = 0; + if (count == 0) { + return -1; + } + if (SWAPW(glyphArray[extra]) <= ttGlyphID) { index = extra; } diff --git a/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp b/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp index fbd76b46254..e3a7d041efc 100644 --- a/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp @@ -59,6 +59,8 @@ le_uint32 CursiveAttachmentSubtable::process(GlyphIterator *glyphIterator, const entryAnchorTable->getAnchor(glyphID, fontInstance, entryAnchor); glyphIterator->setCursiveEntryPoint(entryAnchor); + } else { + //glyphIterator->clearCursiveEntryPoint(); } if (exitOffset != 0) { @@ -66,6 +68,8 @@ le_uint32 CursiveAttachmentSubtable::process(GlyphIterator *glyphIterator, const exitAnchorTable->getAnchor(glyphID, fontInstance, exitAnchor); glyphIterator->setCursiveExitPoint(exitAnchor); + } else { + //glyphIterator->clearCursiveExitPoint(); } return 1; diff --git a/jdk/src/share/native/sun/font/layout/DeviceTables.cpp b/jdk/src/share/native/sun/font/layout/DeviceTables.cpp index fdee8266f54..c0a16cdd463 100644 --- a/jdk/src/share/native/sun/font/layout/DeviceTables.cpp +++ b/jdk/src/share/native/sun/font/layout/DeviceTables.cpp @@ -41,13 +41,15 @@ const le_uint16 DeviceTable::fieldMasks[] = {0x0003, 0x000F, 0x00FF}; const le_uint16 DeviceTable::fieldSignBits[] = {0x0002, 0x0008, 0x0080}; const le_uint16 DeviceTable::fieldBits[] = { 2, 4, 8}; +#define FORMAT_COUNT LE_ARRAY_SIZE(fieldBits) + le_int16 DeviceTable::getAdjustment(le_uint16 ppem) const { le_uint16 start = SWAPW(startSize); le_uint16 format = SWAPW(deltaFormat) - 1; le_int16 result = 0; - if (ppem >= start && ppem <= SWAPW(endSize)) { + if (ppem >= start && ppem <= SWAPW(endSize) && format < FORMAT_COUNT) { le_uint16 sizeIndex = ppem - start; le_uint16 bits = fieldBits[format]; le_uint16 count = 16 / bits; diff --git a/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp b/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp index fa498a39fe5..7ecd2685635 100644 --- a/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp @@ -40,18 +40,24 @@ U_NAMESPACE_BEGIN +// read a 32-bit value that might only be 16-bit-aligned in memory +#define READ_LONG(code) (le_uint32)((SWAPW(*(le_uint16*)&code) << 16) + SWAPW(*(((le_uint16*)&code) + 1))) // FIXME: should look at the format too... maybe have a sub-class for it? le_uint32 ExtensionSubtable::process(const LookupProcessor *lookupProcessor, le_uint16 lookupType, - GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const + GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const { + if (LE_FAILURE(success)) { + return 0; + } + le_uint16 elt = SWAPW(extensionLookupType); if (elt != lookupType) { - le_uint32 extOffset = SWAPL(extensionOffset); + le_uint32 extOffset = READ_LONG(extensionOffset); LookupSubtable *subtable = (LookupSubtable *) ((char *) this + extOffset); - return lookupProcessor->applySubtable(subtable, elt, glyphIterator, fontInstance); + return lookupProcessor->applySubtable(subtable, elt, glyphIterator, fontInstance, success); } return 0; diff --git a/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h b/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h index bee48a3d5ed..47476fc984b 100644 --- a/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h +++ b/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h @@ -53,7 +53,7 @@ struct ExtensionSubtable //: GlyphSubstitutionSubtable le_uint32 extensionOffset; le_uint32 process(const LookupProcessor *lookupProcessor, le_uint16 lookupType, - GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; + GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; }; U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/Features.cpp b/jdk/src/share/native/sun/font/layout/Features.cpp index 2f0627287ce..c83ac05d97d 100644 --- a/jdk/src/share/native/sun/font/layout/Features.cpp +++ b/jdk/src/share/native/sun/font/layout/Features.cpp @@ -33,7 +33,7 @@ #include "LETypes.h" #include "OpenTypeUtilities.h" #include "OpenTypeTables.h" -#include "Features.h" +#include "ICUFeatures.h" #include "LESwaps.h" U_NAMESPACE_BEGIN diff --git a/jdk/src/share/native/sun/font/layout/GXLayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/GXLayoutEngine.cpp index 29fcf31b1a8..9321d5a01e2 100644 --- a/jdk/src/share/native/sun/font/layout/GXLayoutEngine.cpp +++ b/jdk/src/share/native/sun/font/layout/GXLayoutEngine.cpp @@ -41,8 +41,8 @@ U_NAMESPACE_BEGIN UOBJECT_DEFINE_RTTI_IMPLEMENTATION(GXLayoutEngine) -GXLayoutEngine::GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const MorphTableHeader *morphTable) - : LayoutEngine(fontInstance, scriptCode, languageCode, 0), fMorphTable(morphTable) +GXLayoutEngine::GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const MorphTableHeader *morphTable, LEErrorCode &success) + : LayoutEngine(fontInstance, scriptCode, languageCode, 0, success), fMorphTable(morphTable) { // nothing else to do? } diff --git a/jdk/src/share/native/sun/font/layout/GXLayoutEngine.h b/jdk/src/share/native/sun/font/layout/GXLayoutEngine.h index 93f99e0d6b5..b7aa296ca0d 100644 --- a/jdk/src/share/native/sun/font/layout/GXLayoutEngine.h +++ b/jdk/src/share/native/sun/font/layout/GXLayoutEngine.h @@ -67,13 +67,14 @@ public: * @param scriptCode - the script * @param langaugeCode - the language * @param morphTable - the 'mort' table + * @param success - set to an error code if the operation fails * * @see LayoutEngine::layoutEngineFactory * @see ScriptAndLangaugeTags.h for script and language codes * * @internal */ - GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const MorphTableHeader *morphTable); + GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const MorphTableHeader *morphTable, LEErrorCode &success); /** * The destructor, virtual for correct polymorphic invocation. diff --git a/jdk/src/share/native/sun/font/layout/GlyphIterator.cpp b/jdk/src/share/native/sun/font/layout/GlyphIterator.cpp index a3dfa0a73f9..2fea0e9df23 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphIterator.cpp +++ b/jdk/src/share/native/sun/font/layout/GlyphIterator.cpp @@ -44,7 +44,7 @@ GlyphIterator::GlyphIterator(LEGlyphStorage &theGlyphStorage, GlyphPositionAdjus FeatureMask theFeatureMask, const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader) : direction(1), position(-1), nextLimit(-1), prevLimit(-1), glyphStorage(theGlyphStorage), glyphPositionAdjustments(theGlyphPositionAdjustments), - srcIndex(-1), destIndex(-1), lookupFlags(theLookupFlags), featureMask(theFeatureMask), + srcIndex(-1), destIndex(-1), lookupFlags(theLookupFlags), featureMask(theFeatureMask), glyphGroup(0), glyphClassDefinitionTable(NULL), markAttachClassDefinitionTable(NULL) { @@ -78,6 +78,7 @@ GlyphIterator::GlyphIterator(GlyphIterator &that) destIndex = that.destIndex; lookupFlags = that.lookupFlags; featureMask = that.featureMask; + glyphGroup = that.glyphGroup; glyphClassDefinitionTable = that.glyphClassDefinitionTable; markAttachClassDefinitionTable = that.markAttachClassDefinitionTable; } @@ -95,6 +96,7 @@ GlyphIterator::GlyphIterator(GlyphIterator &that, FeatureMask newFeatureMask) destIndex = that.destIndex; lookupFlags = that.lookupFlags; featureMask = newFeatureMask; + glyphGroup = 0; glyphClassDefinitionTable = that.glyphClassDefinitionTable; markAttachClassDefinitionTable = that.markAttachClassDefinitionTable; } @@ -112,6 +114,7 @@ GlyphIterator::GlyphIterator(GlyphIterator &that, le_uint16 newLookupFlags) destIndex = that.destIndex; lookupFlags = newLookupFlags; featureMask = that.featureMask; + glyphGroup = that.glyphGroup; glyphClassDefinitionTable = that.glyphClassDefinitionTable; markAttachClassDefinitionTable = that.markAttachClassDefinitionTable; } @@ -125,12 +128,13 @@ void GlyphIterator::reset(le_uint16 newLookupFlags, FeatureMask newFeatureMask) { position = prevLimit; featureMask = newFeatureMask; + glyphGroup = 0; lookupFlags = newLookupFlags; } -LEGlyphID *GlyphIterator::insertGlyphs(le_int32 count) +LEGlyphID *GlyphIterator::insertGlyphs(le_int32 count, LEErrorCode& success) { - return glyphStorage.insertGlyphs(position, count); + return glyphStorage.insertGlyphs(position, count, success); } le_int32 GlyphIterator::applyInsertions() @@ -299,6 +303,36 @@ void GlyphIterator::setCurrGlyphPositionAdjustment(float xPlacementAdjust, float glyphPositionAdjustments->setYAdvance(position, yAdvanceAdjust); } +void GlyphIterator::clearCursiveEntryPoint() +{ + if (direction < 0) { + if (position <= nextLimit || position >= prevLimit) { + return; + } + } else { + if (position <= prevLimit || position >= nextLimit) { + return; + } + } + + glyphPositionAdjustments->clearEntryPoint(position); +} + +void GlyphIterator::clearCursiveExitPoint() +{ + if (direction < 0) { + if (position <= nextLimit || position >= prevLimit) { + return; + } + } else { + if (position <= prevLimit || position >= nextLimit) { + return; + } + } + + glyphPositionAdjustments->clearExitPoint(position); +} + void GlyphIterator::setCursiveEntryPoint(LEPoint &entryPoint) { if (direction < 0) { @@ -391,7 +425,7 @@ le_bool GlyphIterator::filterGlyph(le_uint32 index) const } } -le_bool GlyphIterator::hasFeatureTag() const +le_bool GlyphIterator::hasFeatureTag(le_bool matchGroup) const { if (featureMask == 0) { return TRUE; @@ -400,14 +434,18 @@ le_bool GlyphIterator::hasFeatureTag() const LEErrorCode success = LE_NO_ERROR; FeatureMask fm = glyphStorage.getAuxData(position, success); - return (fm & featureMask) != 0; + return ((fm & featureMask) == featureMask) && (!matchGroup || (le_int32)(fm & LE_GLYPH_GROUP_MASK) == glyphGroup); } le_bool GlyphIterator::findFeatureTag() { + //glyphGroup = 0; + while (nextInternal()) { - if (hasFeatureTag()) { - prevInternal(); + if (hasFeatureTag(FALSE)) { + LEErrorCode success = LE_NO_ERROR; + + glyphGroup = (glyphStorage.getAuxData(position, success) & LE_GLYPH_GROUP_MASK); return TRUE; } } @@ -435,7 +473,7 @@ le_bool GlyphIterator::nextInternal(le_uint32 delta) le_bool GlyphIterator::next(le_uint32 delta) { - return nextInternal(delta) && hasFeatureTag(); + return nextInternal(delta) && hasFeatureTag(TRUE); } le_bool GlyphIterator::prevInternal(le_uint32 delta) @@ -457,7 +495,7 @@ le_bool GlyphIterator::prevInternal(le_uint32 delta) le_bool GlyphIterator::prev(le_uint32 delta) { - return prevInternal(delta) && hasFeatureTag(); + return prevInternal(delta) && hasFeatureTag(TRUE); } le_int32 GlyphIterator::getMarkComponent(le_int32 markPosition) const diff --git a/jdk/src/share/native/sun/font/layout/GlyphIterator.h b/jdk/src/share/native/sun/font/layout/GlyphIterator.h index a9750936500..63d0aedda00 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphIterator.h +++ b/jdk/src/share/native/sun/font/layout/GlyphIterator.h @@ -88,16 +88,18 @@ public: void setCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust, float xAdvanceAdjust, float yAdvanceAdjust); + void clearCursiveEntryPoint(); + void clearCursiveExitPoint(); void setCursiveEntryPoint(LEPoint &entryPoint); void setCursiveExitPoint(LEPoint &exitPoint); void setCursiveGlyph(); - LEGlyphID *insertGlyphs(le_int32 count); + LEGlyphID *insertGlyphs(le_int32 count, LEErrorCode& success); le_int32 applyInsertions(); private: le_bool filterGlyph(le_uint32 index) const; - le_bool hasFeatureTag() const; + le_bool hasFeatureTag(le_bool matchGroup) const; le_bool nextInternal(le_uint32 delta = 1); le_bool prevInternal(le_uint32 delta = 1); @@ -113,6 +115,7 @@ private: le_int32 destIndex; le_uint16 lookupFlags; FeatureMask featureMask; + le_int32 glyphGroup; const GlyphClassDefinitionTable *glyphClassDefinitionTable; const MarkAttachClassDefinitionTable *markAttachClassDefinitionTable; diff --git a/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.cpp b/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.cpp index b2028a4f47c..f83407d7546 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.cpp +++ b/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.cpp @@ -71,6 +71,20 @@ const LEPoint *GlyphPositionAdjustments::getExitPoint(le_int32 index, LEPoint &e return fEntryExitPoints[index].getExitPoint(exitPoint); } +void GlyphPositionAdjustments::clearEntryPoint(le_int32 index) +{ + CHECK_ALLOCATE_ARRAY(fEntryExitPoints, EntryExitPoint, fGlyphCount); + + fEntryExitPoints[index].clearEntryPoint(); +} + +void GlyphPositionAdjustments::clearExitPoint(le_int32 index) +{ + CHECK_ALLOCATE_ARRAY(fEntryExitPoints, EntryExitPoint, fGlyphCount); + + fEntryExitPoints[index].clearExitPoint(); +} + void GlyphPositionAdjustments::setEntryPoint(le_int32 index, LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd) { CHECK_ALLOCATE_ARRAY(fEntryExitPoints, EntryExitPoint, fGlyphCount); @@ -152,7 +166,12 @@ void GlyphPositionAdjustments::applyCursiveAdjustments(LEGlyphStorage &glyphStor lastExitGlyphID = glyphID; } else { if (baselineIsLogicalEnd(i) && firstExitPoint >= 0 && lastExitPoint >= 0) { - le_int32 limit = lastExitPoint + dir; + le_int32 limit = lastExitPoint /*+ dir*/; + LEPoint dummyAnchor; + + if (getEntryPoint(i, dummyAnchor) != NULL) { + limit += dir; + } for (le_int32 j = firstExitPoint; j != limit; j += dir) { if (isCursiveGlyph(j)) { diff --git a/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.h b/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.h index 9fa2c4cccbc..9ae4f53c9ba 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.h +++ b/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.h @@ -97,6 +97,8 @@ private: LEPoint *getEntryPoint(LEPoint &entryPoint) const; LEPoint *getExitPoint(LEPoint &exitPoint) const; + inline void clearEntryPoint(); + inline void clearExitPoint(); inline void setEntryPoint(LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd); inline void setExitPoint(LEPoint &newExitPoint, le_bool baselineIsLogicalEnd); inline void setCursiveGlyph(le_bool baselineIsLogicalEnd); @@ -151,6 +153,8 @@ public: inline void adjustXAdvance(le_int32 index, float xAdjustment); inline void adjustYAdvance(le_int32 index, float yAdjustment); + void clearEntryPoint(le_int32 index); + void clearExitPoint(le_int32 index); void setEntryPoint(le_int32 index, LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd); void setExitPoint(le_int32 index, LEPoint &newExitPoint, le_bool baselineIsLogicalEnd); void setCursiveGlyph(le_int32 index, le_bool baselineIsLogicalEnd); @@ -266,6 +270,16 @@ inline le_bool GlyphPositionAdjustments::EntryExitPoint::baselineIsLogicalEnd() return (fFlags & EEF_BASELINE_IS_LOGICAL_END) != 0; } +inline void GlyphPositionAdjustments::EntryExitPoint::clearEntryPoint() +{ + fFlags &= ~EEF_HAS_ENTRY_POINT; +} + +inline void GlyphPositionAdjustments::EntryExitPoint::clearExitPoint() +{ + fFlags &= ~EEF_HAS_EXIT_POINT; +} + inline void GlyphPositionAdjustments::EntryExitPoint::setEntryPoint(LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd) { if (baselineIsLogicalEnd) { diff --git a/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.cpp b/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.cpp index 6382c593cdc..dd3894e33d4 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.cpp +++ b/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.cpp @@ -43,12 +43,19 @@ U_NAMESPACE_BEGIN void GlyphPositioningTableHeader::process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, le_bool rightToLeft, LETag scriptTag, LETag languageTag, - const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, + const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, LEErrorCode &success, const LEFontInstance *fontInstance, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const { - GlyphPositioningLookupProcessor processor(this, scriptTag, languageTag, featureMap, featureMapCount, featureOrder); + if (LE_FAILURE(success)) { + return; + } - processor.process(glyphStorage, glyphPositionAdjustments, rightToLeft, glyphDefinitionTableHeader, fontInstance); + GlyphPositioningLookupProcessor processor(this, scriptTag, languageTag, featureMap, featureMapCount, featureOrder, success); + if (LE_FAILURE(success)) { + return; + } + + processor.process(glyphStorage, glyphPositionAdjustments, rightToLeft, glyphDefinitionTableHeader, fontInstance, success); glyphPositionAdjustments->applyCursiveAdjustments(glyphStorage, rightToLeft, fontInstance); } diff --git a/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.h b/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.h index 2afde63b2d7..ef3c5e652f5 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.h +++ b/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.h @@ -53,7 +53,7 @@ struct GlyphPositioningTableHeader : public GlyphLookupTableHeader { void process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, le_bool rightToLeft, LETag scriptTag, LETag languageTag, - const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, + const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, LEErrorCode &success, const LEFontInstance *fontInstance, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const; }; diff --git a/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp b/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp index 735ce7cd723..22d251586a7 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp +++ b/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp @@ -31,7 +31,7 @@ #include "LETypes.h" #include "LEFontInstance.h" #include "OpenTypeTables.h" -#include "Features.h" +#include "ICUFeatures.h" #include "Lookups.h" #include "ScriptAndLanguage.h" #include "GlyphDefinitionTables.h" @@ -58,13 +58,24 @@ typedef ChainingContextualSubstitutionSubtable ChainingContextualPositioningSubt GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor( const GlyphPositioningTableHeader *glyphPositioningTableHeader, - LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) + LETag scriptTag, + LETag languageTag, + const FeatureMap *featureMap, + le_int32 featureMapCount, + le_bool featureOrder, + LEErrorCode& success) : LookupProcessor( (char *) glyphPositioningTableHeader, SWAPW(glyphPositioningTableHeader->scriptListOffset), SWAPW(glyphPositioningTableHeader->featureListOffset), SWAPW(glyphPositioningTableHeader->lookupListOffset), - scriptTag, languageTag, featureMap, featureMapCount, featureOrder) + scriptTag, + languageTag, + featureMap, + featureMapCount, + featureOrder, + success + ) { // anything? } @@ -75,8 +86,13 @@ GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor() le_uint32 GlyphPositioningLookupProcessor::applySubtable(const LookupSubtable *lookupSubtable, le_uint16 lookupType, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance) const + const LEFontInstance *fontInstance, + LEErrorCode& success) const { + if (LE_FAILURE(success)) { + return 0; + } + le_uint32 delta = 0; switch(lookupType) @@ -136,7 +152,7 @@ le_uint32 GlyphPositioningLookupProcessor::applySubtable(const LookupSubtable *l { const ContextualPositioningSubtable *subtable = (const ContextualPositioningSubtable *) lookupSubtable; - delta = subtable->process(this, glyphIterator, fontInstance); + delta = subtable->process(this, glyphIterator, fontInstance, success); break; } @@ -144,7 +160,7 @@ le_uint32 GlyphPositioningLookupProcessor::applySubtable(const LookupSubtable *l { const ChainingContextualPositioningSubtable *subtable = (const ChainingContextualPositioningSubtable *) lookupSubtable; - delta = subtable->process(this, glyphIterator, fontInstance); + delta = subtable->process(this, glyphIterator, fontInstance, success); break; } @@ -152,7 +168,7 @@ le_uint32 GlyphPositioningLookupProcessor::applySubtable(const LookupSubtable *l { const ExtensionSubtable *subtable = (const ExtensionSubtable *) lookupSubtable; - delta = subtable->process(this, lookupType, glyphIterator, fontInstance); + delta = subtable->process(this, lookupType, glyphIterator, fontInstance, success); break; } diff --git a/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.h b/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.h index 11390f51db1..6001f2c9863 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.h +++ b/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.h @@ -40,7 +40,7 @@ #include "LEFontInstance.h" #include "OpenTypeTables.h" #include "Lookups.h" -#include "Features.h" +#include "ICUFeatures.h" #include "GlyphDefinitionTables.h" #include "GlyphPositioningTables.h" #include "GlyphIterator.h" @@ -52,12 +52,17 @@ class GlyphPositioningLookupProcessor : public LookupProcessor { public: GlyphPositioningLookupProcessor(const GlyphPositioningTableHeader *glyphPositioningTableHeader, - LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder); + LETag scriptTag, + LETag languageTag, + const FeatureMap *featureMap, + le_int32 featureMapCount, + le_bool featureOrder, + LEErrorCode& success); virtual ~GlyphPositioningLookupProcessor(); virtual le_uint32 applySubtable(const LookupSubtable *lookupSubtable, le_uint16 lookupType, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance) const; + const LEFontInstance *fontInstance, LEErrorCode& success) const; protected: GlyphPositioningLookupProcessor(); diff --git a/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp b/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp index aa3b88f826a..850b7829318 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp +++ b/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp @@ -33,7 +33,7 @@ #include "LEGlyphFilter.h" #include "LEFontInstance.h" #include "OpenTypeTables.h" -#include "Features.h" +#include "ICUFeatures.h" #include "Lookups.h" #include "ScriptAndLanguage.h" #include "GlyphDefinitionTables.h" @@ -52,13 +52,19 @@ U_NAMESPACE_BEGIN GlyphSubstitutionLookupProcessor::GlyphSubstitutionLookupProcessor( const GlyphSubstitutionTableHeader *glyphSubstitutionTableHeader, - LETag scriptTag, LETag languageTag, const LEGlyphFilter *filter, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) + LETag scriptTag, + LETag languageTag, + const LEGlyphFilter *filter, + const FeatureMap *featureMap, + le_int32 featureMapCount, + le_bool featureOrder, + LEErrorCode& success) : LookupProcessor( (char *) glyphSubstitutionTableHeader, SWAPW(glyphSubstitutionTableHeader->scriptListOffset), SWAPW(glyphSubstitutionTableHeader->featureListOffset), SWAPW(glyphSubstitutionTableHeader->lookupListOffset), - scriptTag, languageTag, featureMap, featureMapCount, featureOrder), fFilter(filter) + scriptTag, languageTag, featureMap, featureMapCount, featureOrder, success), fFilter(filter) { // anything? } @@ -68,8 +74,12 @@ GlyphSubstitutionLookupProcessor::GlyphSubstitutionLookupProcessor() } le_uint32 GlyphSubstitutionLookupProcessor::applySubtable(const LookupSubtable *lookupSubtable, le_uint16 lookupType, - GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const + GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const { + if (LE_FAILURE(success)) { + return 0; + } + le_uint32 delta = 0; switch(lookupType) @@ -89,7 +99,7 @@ le_uint32 GlyphSubstitutionLookupProcessor::applySubtable(const LookupSubtable * { const MultipleSubstitutionSubtable *subtable = (const MultipleSubstitutionSubtable *) lookupSubtable; - delta = subtable->process(glyphIterator, fFilter); + delta = subtable->process(glyphIterator, success, fFilter); break; } @@ -113,7 +123,7 @@ le_uint32 GlyphSubstitutionLookupProcessor::applySubtable(const LookupSubtable * { const ContextualSubstitutionSubtable *subtable = (const ContextualSubstitutionSubtable *) lookupSubtable; - delta = subtable->process(this, glyphIterator, fontInstance); + delta = subtable->process(this, glyphIterator, fontInstance, success); break; } @@ -121,7 +131,7 @@ le_uint32 GlyphSubstitutionLookupProcessor::applySubtable(const LookupSubtable * { const ChainingContextualSubstitutionSubtable *subtable = (const ChainingContextualSubstitutionSubtable *) lookupSubtable; - delta = subtable->process(this, glyphIterator, fontInstance); + delta = subtable->process(this, glyphIterator, fontInstance, success); break; } @@ -129,7 +139,7 @@ le_uint32 GlyphSubstitutionLookupProcessor::applySubtable(const LookupSubtable * { const ExtensionSubtable *subtable = (const ExtensionSubtable *) lookupSubtable; - delta = subtable->process(this, lookupType, glyphIterator, fontInstance); + delta = subtable->process(this, lookupType, glyphIterator, fontInstance, success); break; } diff --git a/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.h b/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.h index 5ffa579aa96..154cc2b9236 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.h +++ b/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.h @@ -41,7 +41,7 @@ #include "LEFontInstance.h" #include "OpenTypeTables.h" #include "Lookups.h" -#include "Features.h" +#include "ICUFeatures.h" #include "GlyphDefinitionTables.h" #include "GlyphSubstitutionTables.h" #include "GlyphIterator.h" @@ -53,12 +53,18 @@ class GlyphSubstitutionLookupProcessor : public LookupProcessor { public: GlyphSubstitutionLookupProcessor(const GlyphSubstitutionTableHeader *glyphSubstitutionTableHeader, - LETag scriptTag, LETag languageTag, const LEGlyphFilter *filter, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder); + LETag scriptTag, + LETag languageTag, + const LEGlyphFilter *filter, + const FeatureMap *featureMap, + le_int32 featureMapCount, + le_bool featureOrder, + LEErrorCode& success); virtual ~GlyphSubstitutionLookupProcessor(); virtual le_uint32 applySubtable(const LookupSubtable *lookupSubtable, le_uint16 lookupType, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance) const; + const LEFontInstance *fontInstance, LEErrorCode& success) const; protected: GlyphSubstitutionLookupProcessor(); diff --git a/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.cpp b/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.cpp index e51e1518e54..bd056b60260 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.cpp +++ b/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.cpp @@ -42,13 +42,23 @@ U_NAMESPACE_BEGIN -le_int32 GlyphSubstitutionTableHeader::process(LEGlyphStorage &glyphStorage, le_bool rightToLeft, LETag scriptTag, LETag languageTag, +le_int32 GlyphSubstitutionTableHeader::process(LEGlyphStorage &glyphStorage, + le_bool rightToLeft, + LETag scriptTag, + LETag languageTag, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, - const LEGlyphFilter *filter, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const + const LEGlyphFilter *filter, + const FeatureMap *featureMap, + le_int32 featureMapCount, + le_bool featureOrder, + LEErrorCode &success) const { - GlyphSubstitutionLookupProcessor processor(this, scriptTag, languageTag, filter, featureMap, featureMapCount, featureOrder); + if (LE_FAILURE(success)) { + return 0; + } - return processor.process(glyphStorage, NULL, rightToLeft, glyphDefinitionTableHeader, NULL); + GlyphSubstitutionLookupProcessor processor(this, scriptTag, languageTag, filter, featureMap, featureMapCount, featureOrder, success); + return processor.process(glyphStorage, NULL, rightToLeft, glyphDefinitionTableHeader, NULL, success); } U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.h b/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.h index b533942906b..207747dd9a7 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.h +++ b/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.h @@ -50,9 +50,16 @@ struct GlyphDefinitionTableHeader; struct GlyphSubstitutionTableHeader : public GlyphLookupTableHeader { - le_int32 process(LEGlyphStorage &glyphStorage, le_bool rightToLeft, LETag scriptTag, LETag languageTag, - const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, const LEGlyphFilter *filter, - const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const; + le_int32 process(LEGlyphStorage &glyphStorage, + le_bool rightToLeft, + LETag scriptTag, + LETag languageTag, + const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, + const LEGlyphFilter *filter, + const FeatureMap *featureMap, + le_int32 featureMapCount, + le_bool featureOrder, + LEErrorCode &success) const; }; enum GlyphSubstitutionSubtableTypes diff --git a/jdk/src/share/native/sun/font/layout/HanLayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/HanLayoutEngine.cpp index 0a50ef24280..5e799ef8339 100644 --- a/jdk/src/share/native/sun/font/layout/HanLayoutEngine.cpp +++ b/jdk/src/share/native/sun/font/layout/HanLayoutEngine.cpp @@ -26,7 +26,7 @@ /* * HanLayoutEngine.cpp: OpenType processing for Han fonts. * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved. + * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved. */ #include "LETypes.h" @@ -64,8 +64,8 @@ static const le_int32 featureMapCount = LE_ARRAY_SIZE(featureMap); #define features (loclFeatureMask) HanOpenTypeLayoutEngine::HanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) - : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable) + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success) + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success) { fFeatureMap = featureMap; fFeatureMapCount = featureMapCount; diff --git a/jdk/src/share/native/sun/font/layout/HanLayoutEngine.h b/jdk/src/share/native/sun/font/layout/HanLayoutEngine.h index baf76199977..6dd726069a5 100644 --- a/jdk/src/share/native/sun/font/layout/HanLayoutEngine.h +++ b/jdk/src/share/native/sun/font/layout/HanLayoutEngine.h @@ -27,7 +27,7 @@ /* * HanLayoutEngine.h: OpenType processing for Han fonts. * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved. + * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved. */ #ifndef __HANLAYOUTENGINE_H @@ -64,6 +64,7 @@ public: * @param scriptCode - the script * @param langaugeCode - the language * @param gsubTable - the GSUB table + * @param success - set to an error code if the operation fails * * @see LayoutEngine::layoutEngineFactory * @see OpenTypeLayoutEngine @@ -72,7 +73,7 @@ public: * @internal */ HanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTablem, LEErrorCode &success); /** diff --git a/jdk/src/share/native/sun/font/layout/HangulLayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/HangulLayoutEngine.cpp new file mode 100644 index 00000000000..806f2dc5813 --- /dev/null +++ b/jdk/src/share/native/sun/font/layout/HangulLayoutEngine.cpp @@ -0,0 +1,363 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * HangulLayoutEngine.cpp: OpenType processing for Han fonts. + * + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved. + */ + +#include "LETypes.h" +#include "LEScripts.h" +#include "LELanguages.h" + +#include "LayoutEngine.h" +#include "OpenTypeLayoutEngine.h" +#include "HangulLayoutEngine.h" +#include "ScriptAndLanguageTags.h" +#include "LEGlyphStorage.h" +#include "OpenTypeTables.h" + +U_NAMESPACE_BEGIN + +UOBJECT_DEFINE_RTTI_IMPLEMENTATION(HangulOpenTypeLayoutEngine) + + +#define FEATURE_MAP(name) {name ## FeatureTag, name ## FeatureMask} + +#define LJMO_FIRST 0x1100 +#define LJMO_LAST 0x1159 +#define LJMO_FILL 0x115F +#define LJMO_COUNT 19 + +#define VJMO_FIRST 0x1161 +#define VJMO_LAST 0x11A2 +#define VJMO_FILL 0x1160 +#define VJMO_COUNT 21 + +#define TJMO_FIRST 0x11A7 +#define TJMO_LAST 0x11F9 +#define TJMO_COUNT 28 + +#define HSYL_FIRST 0xAC00 +#define HSYL_COUNT 11172 +#define HSYL_LVCNT (VJMO_COUNT * TJMO_COUNT) + +// Character classes +enum +{ + CC_L = 0, + CC_V, + CC_T, + CC_LV, + CC_LVT, + CC_X, + CC_COUNT +}; + +// Action flags +#define AF_L 1 +#define AF_V 2 +#define AF_T 4 + +// Actions +#define a_N 0 +#define a_L (AF_L) +#define a_V (AF_V) +#define a_T (AF_T) +#define a_VT (AF_V | AF_T) +#define a_LV (AF_L | AF_V) +#define a_LVT (AF_L | AF_V | AF_T) + +typedef struct +{ + le_int32 newState; + le_int32 actionFlags; +} StateTransition; + +static const StateTransition stateTable[][CC_COUNT] = +{ +// L V T LV LVT X + { {1, a_L}, {2, a_LV}, {3, a_LVT}, {2, a_LV}, {3, a_LVT}, {4, a_T}}, // 0 - start + { {1, a_L}, {2, a_V}, {3, a_VT}, {2, a_LV}, {3, a_LVT}, {-1, a_V}}, // 1 - L+ + {{-1, a_N}, {2, a_V}, {3, a_T}, {-1, a_N}, {-1, a_N}, {-1, a_N}}, // 2 - L+V+ + {{-1, a_N}, {-1, a_N}, {3, a_T}, {-1, a_N}, {-1, a_N}, {-1, a_N}}, // 3 - L+V+T* + {{-1, a_N}, {-1, a_N}, {-1, a_N}, {-1, a_N}, {-1, a_N}, {4, a_T}} // 4 - X+ +}; + + +#define ccmpFeatureTag LE_CCMP_FEATURE_TAG +#define ljmoFeatureTag LE_LJMO_FEATURE_TAG +#define vjmoFeatureTag LE_VJMO_FEATURE_TAG +#define tjmoFeatureTag LE_TJMO_FEATURE_TAG + +#define ccmpFeatureMask 0x80000000UL +#define ljmoFeatureMask 0x40000000UL +#define vjmoFeatureMask 0x20000000UL +#define tjmoFeatureMask 0x10000000UL + +static const FeatureMap featureMap[] = +{ + {ccmpFeatureTag, ccmpFeatureMask}, + {ljmoFeatureTag, ljmoFeatureMask}, + {vjmoFeatureTag, vjmoFeatureMask}, + {tjmoFeatureTag, tjmoFeatureMask} +}; + +static const le_int32 featureMapCount = LE_ARRAY_SIZE(featureMap); + +#define nullFeatures 0 +#define ljmoFeatures (ccmpFeatureMask | ljmoFeatureMask) +#define vjmoFeatures (ccmpFeatureMask | vjmoFeatureMask | ljmoFeatureMask | tjmoFeatureMask) +#define tjmoFeatures (ccmpFeatureMask | tjmoFeatureMask | ljmoFeatureMask | vjmoFeatureMask) + +static le_int32 compose(LEUnicode lead, LEUnicode vowel, LEUnicode trail, LEUnicode &syllable) +{ + le_int32 lIndex = lead - LJMO_FIRST; + le_int32 vIndex = vowel - VJMO_FIRST; + le_int32 tIndex = trail - TJMO_FIRST; + le_int32 result = 3; + + if ((lIndex < 0 || lIndex >= LJMO_COUNT ) || (vIndex < 0 || vIndex >= VJMO_COUNT)) { + return 0; + } + + if (tIndex <= 0 || tIndex >= TJMO_COUNT) { + tIndex = 0; + result = 2; + } + + syllable = (LEUnicode) ((lIndex * VJMO_COUNT + vIndex) * TJMO_COUNT + tIndex + HSYL_FIRST); + + return result; +} + +static le_int32 decompose(LEUnicode syllable, LEUnicode &lead, LEUnicode &vowel, LEUnicode &trail) +{ + le_int32 sIndex = syllable - HSYL_FIRST; + + if (sIndex < 0 || sIndex >= HSYL_COUNT) { + return 0; + } + + lead = LJMO_FIRST + (sIndex / HSYL_LVCNT); + vowel = VJMO_FIRST + (sIndex % HSYL_LVCNT) / TJMO_COUNT; + trail = TJMO_FIRST + (sIndex % TJMO_COUNT); + + if (trail == TJMO_FIRST) { + return 2; + } + + return 3; +} + +static le_int32 getCharClass(LEUnicode ch, LEUnicode &lead, LEUnicode &vowel, LEUnicode &trail) +{ + lead = LJMO_FILL; + vowel = VJMO_FILL; + trail = TJMO_FIRST; + + if (ch >= LJMO_FIRST && ch <= LJMO_LAST) { + lead = ch; + return CC_L; + } + + if (ch >= VJMO_FIRST && ch <= VJMO_LAST) { + vowel = ch; + return CC_V; + } + + if (ch > TJMO_FIRST && ch <= TJMO_LAST) { + trail = ch; + return CC_T; + } + + le_int32 c = decompose(ch, lead, vowel, trail); + + if (c == 2) { + return CC_LV; + } + + if (c == 3) { + return CC_LVT; + } + + trail = ch; + return CC_X; +} + +HangulOpenTypeLayoutEngine::HangulOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 /*languageCode*/, + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success) + : OpenTypeLayoutEngine(fontInstance, scriptCode, korLanguageCode, typoFlags, gsubTable, success) +{ + fFeatureMap = featureMap; + fFeatureMapCount = featureMapCount; + fFeatureOrder = TRUE; +} + +HangulOpenTypeLayoutEngine::HangulOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 /*languageCode*/, + le_int32 typoFlags, LEErrorCode &success) + : OpenTypeLayoutEngine(fontInstance, scriptCode, korLanguageCode, typoFlags, success) +{ + fFeatureMap = featureMap; + fFeatureMapCount = featureMapCount; + fFeatureOrder = TRUE; +} + +HangulOpenTypeLayoutEngine::~HangulOpenTypeLayoutEngine() +{ + // nothing to do +} + +le_int32 HangulOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, + LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) +{ + if (LE_FAILURE(success)) { + return 0; + } + + if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { + success = LE_ILLEGAL_ARGUMENT_ERROR; + return 0; + } + + le_int32 worstCase = count * 3; + + outChars = LE_NEW_ARRAY(LEUnicode, worstCase); + + if (outChars == NULL) { + success = LE_MEMORY_ALLOCATION_ERROR; + return 0; + } + + glyphStorage.allocateGlyphArray(worstCase, rightToLeft, success); + glyphStorage.allocateAuxData(success); + + if (LE_FAILURE(success)) { + LE_DELETE_ARRAY(outChars); + return 0; + } + + le_int32 outCharCount = 0; + le_int32 limit = offset + count; + le_int32 i = offset; + + while (i < limit) { + le_int32 state = 0; + le_int32 inStart = i; + le_int32 outStart = outCharCount; + + while( i < limit) { + LEUnicode lead = 0; + LEUnicode vowel = 0; + LEUnicode trail = 0; + le_int32 chClass = getCharClass(chars[i], lead, vowel, trail); + const StateTransition transition = stateTable[state][chClass]; + + if (chClass == CC_X) { + /* Any character of type X will be stored as a trail jamo */ + if ((transition.actionFlags & AF_T) != 0) { + outChars[outCharCount] = trail; + glyphStorage.setCharIndex(outCharCount, i-offset, success); + glyphStorage.setAuxData(outCharCount++, nullFeatures, success); + } + } else { + /* Any Hangul will be fully decomposed. Output the decomposed characters. */ + if ((transition.actionFlags & AF_L) != 0) { + outChars[outCharCount] = lead; + glyphStorage.setCharIndex(outCharCount, i-offset, success); + glyphStorage.setAuxData(outCharCount++, ljmoFeatures, success); + } + + if ((transition.actionFlags & AF_V) != 0) { + outChars[outCharCount] = vowel; + glyphStorage.setCharIndex(outCharCount, i-offset, success); + glyphStorage.setAuxData(outCharCount++, vjmoFeatures, success); + } + + if ((transition.actionFlags & AF_T) != 0) { + outChars[outCharCount] = trail; + glyphStorage.setCharIndex(outCharCount, i-offset, success); + glyphStorage.setAuxData(outCharCount++, tjmoFeatures, success); + } + } + + state = transition.newState; + + /* Negative next state means stop. */ + if (state < 0) { + break; + } + + i += 1; + } + + le_int32 inLength = i - inStart; + le_int32 outLength = outCharCount - outStart; + + /* + * See if the syllable can be composed into a single character. There are 5 + * possible cases: + * + * Input Decomposed to Compose to + * LV L, V LV + * LVT L, V, T LVT + * L, V L, V LV, DEL + * LV, T L, V, T LVT, DEL + * L, V, T L, V, T LVT, DEL, DEL + */ + if ((inLength >= 1 && inLength <= 3) && (outLength == 2 || outLength == 3)) { + LEUnicode syllable = 0x0000; + LEUnicode lead = outChars[outStart]; + LEUnicode vowel = outChars[outStart + 1]; + LEUnicode trail = outLength == 3? outChars[outStart + 2] : TJMO_FIRST; + + /* + * If the composition consumes the whole decomposed syllable, + * we can use it. + */ + if (compose(lead, vowel, trail, syllable) == outLength) { + outCharCount = outStart; + outChars[outCharCount] = syllable; + glyphStorage.setCharIndex(outCharCount, inStart-offset, success); + glyphStorage.setAuxData(outCharCount++, nullFeatures, success); + + /* + * Replace the rest of the input characters with DEL. + */ + for(le_int32 d = inStart + 1; d < i; d += 1) { + outChars[outCharCount] = 0xFFFF; + glyphStorage.setCharIndex(outCharCount, d - offset, success); + glyphStorage.setAuxData(outCharCount++, nullFeatures, success); + } + } + } + } + + glyphStorage.adoptGlyphCount(outCharCount); + return outCharCount; +} + +U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/HangulLayoutEngine.h b/jdk/src/share/native/sun/font/layout/HangulLayoutEngine.h new file mode 100644 index 00000000000..e2a485e5f81 --- /dev/null +++ b/jdk/src/share/native/sun/font/layout/HangulLayoutEngine.h @@ -0,0 +1,151 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved + * + */ + +#ifndef __HANGULAYOUTENGINE_H +#define __HANGULAYOUTENGINE_H + +#include "LETypes.h" +#include "LEFontInstance.h" +#include "LEGlyphFilter.h" +#include "LayoutEngine.h" +#include "OpenTypeLayoutEngine.h" + +#include "GlyphSubstitutionTables.h" +#include "GlyphDefinitionTables.h" +#include "GlyphPositioningTables.h" + +U_NAMESPACE_BEGIN + +class MPreFixups; +class LEGlyphStorage; + +/** + * This class implements OpenType layout for Old Hangul OpenType fonts, as + * specified by Microsoft in "Creating and Supporting OpenType Fonts for + * The Korean Hangul Script" (http://www.microsoft.com/typography/otfntdev/hangulot/default.htm) + * + * This class overrides the characterProcessing method to do Hangul character processing. + * (See the MS spec. for more details) + * + * @internal + */ +class HangulOpenTypeLayoutEngine : public OpenTypeLayoutEngine +{ +public: + /** + * This is the main constructor. It constructs an instance of HangulOpenTypeLayoutEngine for + * a particular font, script and language. It takes the GSUB table as a parameter since + * LayoutEngine::layoutEngineFactory has to read the GSUB table to know that it has an + * Hangul OpenType font. + * + * @param fontInstance - the font + * @param scriptCode - the script + * @param langaugeCode - the language + * @param gsubTable - the GSUB table + * @param success - set to an error code if the operation fails + * + * @see LayoutEngine::layoutEngineFactory + * @see OpenTypeLayoutEngine + * @see ScriptAndLangaugeTags.h for script and language codes + * + * @internal + */ + HangulOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success); + + /** + * This constructor is used when the font requires a "canned" GSUB table which can't be known + * until after this constructor has been invoked. + * + * @param fontInstance - the font + * @param scriptCode - the script + * @param langaugeCode - the language + * @param success - set to an error code if the operation fails + * + * @see OpenTypeLayoutEngine + * @see ScriptAndLangaugeTags.h for script and language codes + * + * @internal + */ + HangulOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, + le_int32 typoFlags, LEErrorCode &success); + + /** + * The destructor, virtual for correct polymorphic invocation. + * + * @internal + */ + virtual ~HangulOpenTypeLayoutEngine(); + + /** + * ICU "poor man's RTTI", returns a UClassID for the actual class. + * + * @stable ICU 2.8 + */ + virtual UClassID getDynamicClassID() const; + + /** + * ICU "poor man's RTTI", returns a UClassID for this class. + * + * @stable ICU 2.8 + */ + static UClassID getStaticClassID(); + +protected: + + /** + * This method does Hangul OpenType character processing. It assigns the OpenType feature + * tags to the characters, and may compose a character sequence into a modern Hangul syllable, + * or decompose a modern Hangul syllable if it forms part of an old Hangul syllable. + * + * Input parameters: + * @param chars - the input character context + * @param offset - the index of the first character to process + * @param count - the number of characters to process + * @param max - the number of characters in the input context + * @param rightToLeft - TRUE if the characters are in a right to left directional run + * @param glyphStorage - the glyph storage object. The glyph and character index arrays will be set. + * the auxillary data array will be set to the feature tags. + * + * Output parameters: + * @param success - set to an error code if the operation fails + * + * @return the output character count + * + * @internal + */ + virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, + LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); +}; + +U_NAMESPACE_END +#endif + diff --git a/jdk/src/share/native/sun/font/layout/HebrewLigatureData.cpp b/jdk/src/share/native/sun/font/layout/HebrewLigatureData.cpp deleted file mode 100644 index cc905ba8464..00000000000 --- a/jdk/src/share/native/sun/font/layout/HebrewLigatureData.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -/* - * - * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved - * - * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS - * YOU REALLY KNOW WHAT YOU'RE DOING. - * - */ - -#include "LETypes.h" -#include "HebrewShaping.h" - -const le_uint8 HebrewShaping::glyphSubstitutionTable[] = { - 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x1E, 0x00, 0x2C, 0x00, 0x01, 0x68, 0x65, 0x62, 0x72, - 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - 0x6C, 0x69, 0x67, 0x61, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x01, 0x62, 0x00, 0x16, 0x00, 0x32, - 0x00, 0x4C, 0x00, 0x5E, 0x00, 0x68, 0x00, 0x72, 0x00, 0x7C, 0x00, 0x8E, 0x00, 0x98, 0x00, 0xA2, - 0x00, 0xAC, 0x00, 0xB6, 0x00, 0xC8, 0x00, 0xD2, 0x00, 0xDC, 0x00, 0xE6, 0x00, 0xF0, 0x00, 0xFA, - 0x01, 0x0C, 0x01, 0x16, 0x01, 0x20, 0x01, 0x2A, 0x01, 0x58, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0E, - 0x00, 0x14, 0xFB, 0x2E, 0x00, 0x02, 0x05, 0xB7, 0xFB, 0x2F, 0x00, 0x02, 0x05, 0xB8, 0xFB, 0x30, - 0x00, 0x02, 0x05, 0xBC, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0xFB, 0x31, 0x00, 0x02, 0x05, 0xBC, - 0xFB, 0x4C, 0x00, 0x02, 0x05, 0xBF, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x32, 0x00, 0x02, 0x05, 0xBC, - 0x00, 0x01, 0x00, 0x04, 0xFB, 0x33, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x34, - 0x00, 0x02, 0x05, 0xBC, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0xFB, 0x4B, 0x00, 0x02, 0x05, 0xB9, - 0xFB, 0x35, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x36, 0x00, 0x02, 0x05, 0xBC, - 0x00, 0x01, 0x00, 0x04, 0xFB, 0x38, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x39, - 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x3A, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x02, - 0x00, 0x06, 0x00, 0x0C, 0xFB, 0x3B, 0x00, 0x02, 0x05, 0xBC, 0xFB, 0x4D, 0x00, 0x02, 0x05, 0xBF, - 0x00, 0x01, 0x00, 0x04, 0xFB, 0x3C, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x3E, - 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x40, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, - 0x00, 0x04, 0xFB, 0x41, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x43, 0x00, 0x02, - 0x05, 0xBC, 0x00, 0x02, 0x00, 0x06, 0x00, 0x0C, 0xFB, 0x44, 0x00, 0x02, 0x05, 0xBC, 0xFB, 0x4E, - 0x00, 0x02, 0x05, 0xBF, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x46, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, - 0x00, 0x04, 0xFB, 0x47, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x04, 0xFB, 0x48, 0x00, 0x02, - 0x05, 0xBC, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x14, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x28, 0xFB, 0x2C, - 0x00, 0x03, 0x05, 0xBC, 0x05, 0xC1, 0xFB, 0x2D, 0x00, 0x03, 0x05, 0xBC, 0x05, 0xC2, 0xFB, 0x49, - 0x00, 0x02, 0x05, 0xBC, 0xFB, 0x2A, 0x00, 0x02, 0x05, 0xC1, 0xFB, 0x2B, 0x00, 0x02, 0x05, 0xC2, - 0x00, 0x01, 0x00, 0x04, 0xFB, 0x4A, 0x00, 0x02, 0x05, 0xBC, 0x00, 0x01, 0x00, 0x16, 0x05, 0xD0, - 0x05, 0xD1, 0x05, 0xD2, 0x05, 0xD3, 0x05, 0xD4, 0x05, 0xD5, 0x05, 0xD6, 0x05, 0xD8, 0x05, 0xD9, - 0x05, 0xDA, 0x05, 0xDB, 0x05, 0xDC, 0x05, 0xDE, 0x05, 0xE0, 0x05, 0xE1, 0x05, 0xE3, 0x05, 0xE4, - 0x05, 0xE6, 0x05, 0xE7, 0x05, 0xE8, 0x05, 0xE9, 0x05, 0xEA -}; - -const le_uint8 HebrewShaping::glyphDefinitionTable[] = { - 0x00, 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x15, - 0x05, 0x91, 0x05, 0xA1, 0x00, 0x03, 0x05, 0xA3, 0x05, 0xB9, 0x00, 0x03, 0x05, 0xBB, 0x05, 0xBD, - 0x00, 0x03, 0x05, 0xBE, 0x05, 0xBE, 0x00, 0x01, 0x05, 0xBF, 0x05, 0xBF, 0x00, 0x03, 0x05, 0xC0, - 0x05, 0xC0, 0x00, 0x01, 0x05, 0xC1, 0x05, 0xC2, 0x00, 0x03, 0x05, 0xC3, 0x05, 0xC3, 0x00, 0x01, - 0x05, 0xC4, 0x05, 0xC4, 0x00, 0x03, 0x05, 0xD0, 0x05, 0xEA, 0x00, 0x01, 0x05, 0xF0, 0x05, 0xF2, - 0x00, 0x02, 0x05, 0xF3, 0x05, 0xF4, 0x00, 0x01, 0xFB, 0x1E, 0xFB, 0x1E, 0x00, 0x03, 0xFB, 0x1F, - 0xFB, 0x1F, 0x00, 0x02, 0xFB, 0x20, 0xFB, 0x36, 0x00, 0x01, 0xFB, 0x38, 0xFB, 0x3C, 0x00, 0x01, - 0xFB, 0x3E, 0xFB, 0x3E, 0x00, 0x01, 0xFB, 0x40, 0xFB, 0x41, 0x00, 0x01, 0xFB, 0x43, 0xFB, 0x44, - 0x00, 0x01, 0xFB, 0x46, 0xFB, 0x4E, 0x00, 0x01, 0xFB, 0x4F, 0xFB, 0x4F, 0x00, 0x02 -}; diff --git a/jdk/src/share/native/sun/font/layout/HebrewShaping.h b/jdk/src/share/native/sun/font/layout/ICUFeatures.h similarity index 64% rename from jdk/src/share/native/sun/font/layout/HebrewShaping.h rename to jdk/src/share/native/sun/font/layout/ICUFeatures.h index b117a143412..f32d8e2b869 100644 --- a/jdk/src/share/native/sun/font/layout/HebrewShaping.h +++ b/jdk/src/share/native/sun/font/layout/ICUFeatures.h @@ -25,28 +25,45 @@ /* * - * (C) Copyright IBM Corp. 1998, 1999, 2000 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ -#ifndef __HEBREWSHAPING_H -#define __HEBREWSHAPING_H +#ifndef __ICUFEATURES_H +#define __ICUFEATURES_H + +/** + * \file + * \internal + */ #include "LETypes.h" #include "OpenTypeTables.h" -class HebrewShaping +U_NAMESPACE_BEGIN + +struct FeatureRecord { -public: - static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount, le_int32 charMax, - le_bool rightToLeft, const LETag **tags); - - static const le_uint8 glyphSubstitutionTable[]; - static const le_uint8 glyphDefinitionTable[]; - -private: - // forbid instantiation - HebrewShaping(); + ATag featureTag; + Offset featureTableOffset; }; +struct FeatureTable +{ + Offset featureParamsOffset; + le_uint16 lookupCount; + le_uint16 lookupListIndexArray[ANY_NUMBER]; +}; + +struct FeatureListTable +{ + le_uint16 featureCount; + FeatureRecord featureRecordArray[ANY_NUMBER]; + + const FeatureTable *getFeatureTable(le_uint16 featureIndex, LETag *featureTag) const; + + const FeatureTable *getFeatureTable(LETag featureTag) const; +}; + +U_NAMESPACE_END #endif diff --git a/jdk/src/share/native/sun/font/layout/IndicClassTables.cpp b/jdk/src/share/native/sun/font/layout/IndicClassTables.cpp index 4a9999bd5c3..73cd2cfd718 100644 --- a/jdk/src/share/native/sun/font/layout/IndicClassTables.cpp +++ b/jdk/src/share/native/sun/font/layout/IndicClassTables.cpp @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -73,6 +73,7 @@ U_NAMESPACE_BEGIN #define _m2 (CC_SPLIT_VOWEL_PIECE_2 | CF_LENGTH_MARK) #define _m3 (CC_SPLIT_VOWEL_PIECE_3 | CF_LENGTH_MARK) #define _vr (CC_VIRAMA) +#define _al (CC_AL_LAKUNA) // split matras #define _s1 (_dv | _x1) @@ -90,6 +91,7 @@ U_NAMESPACE_BEGIN // special forms... (Bengali RA?) #define _bb (_ct | CF_BELOW_BASE) #define _pb (_ct | CF_POST_BASE) +#define _fb (_ct | CF_PRE_BASE) #define _vt (_bb | CF_VATTU) #define _rv (_vt | CF_REPH) #define _rp (_pb | CF_REPH) @@ -119,7 +121,7 @@ static const IndicClassTable::CharClass bengCharClasses[] = _dr, _db, _db, _db, _db, _xx, _xx, _l1, _dl, _xx, _xx, _s1, _s2, _vr, _xx, _xx, // 09C0 - 09CF _xx, _xx, _xx, _xx, _xx, _xx, _xx, _m2, _xx, _xx, _xx, _xx, _cn, _cn, _xx, _cn, // 09D0 - 09DF _iv, _iv, _dv, _dv, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 09E0 - 09EF - _ct, _ct, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx // 09F0 - 09FA + _rv, _ct, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx // 09F0 - 09FA }; static const IndicClassTable::CharClass punjCharClasses[] = @@ -142,9 +144,22 @@ static const IndicClassTable::CharClass gujrCharClasses[] = _rv, _xx, _ct, _ct, _xx, _ct, _ct, _ct, _ct, _ct, _xx, _xx, _nu, _xx, _dr, _dl, // 0AB0 - 0ABF _dr, _db, _db, _db, _db, _da, _xx, _da, _da, _dr, _xx, _dr, _dr, _vr, _xx, _xx, // 0AC0 - 0ACF _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0AD0 - 0ADF - _iv, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx // 0AE0 - 0AEF + _iv, _iv, _db, _db, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx // 0AE0 - 0AEF }; +#if 1 +static const IndicClassTable::CharClass oryaCharClasses[] = +{ + _xx, _ma, _mp, _mp, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _xx, _iv, /* 0B00 - 0B0F */ + _iv, _xx, _xx, _iv, _iv, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _ct, _bb, /* 0B10 - 0B1F */ + _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _pb, /* 0B20 - 0B2F */ + _rb, _xx, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _xx, _xx, _nu, _xx, _dr, _da, /* 0B30 - 0B3F */ + _dr, _db, _db, _db, _xx, _xx, _xx, _dl, _s1, _xx, _xx, _s2, _s3, _vr, _xx, _xx, /* 0B40 - 0B4F */ + _xx, _xx, _xx, _xx, _xx, _xx, _da, _dr, _xx, _xx, _xx, _xx, _cn, _cn, _xx, _pb, /* 0B50 - 0B5F */ + _iv, _iv, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, /* 0B60 - 0B6F */ + _xx, _bb /* 0B70 - 0B71 */ +}; +#else static const IndicClassTable::CharClass oryaCharClasses[] = { _xx, _ma, _mp, _mp, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _xx, _iv, // 0B00 - 0B0F @@ -156,13 +171,14 @@ static const IndicClassTable::CharClass oryaCharClasses[] = _iv, _iv, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0B60 - 0B6F _xx, _ct // 0B70 - 0B71 }; +#endif static const IndicClassTable::CharClass tamlCharClasses[] = { - _xx, _xx, _ma, _mp, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _xx, _xx, _iv, _iv, // 0B80 - 0B8F + _xx, _xx, _ma, _xx, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _xx, _xx, _iv, _iv, // 0B80 - 0B8F _iv, _xx, _iv, _iv, _iv, _ct, _xx, _xx, _xx, _ct, _ct, _xx, _ct, _xx, _ct, _ct, // 0B90 - 0B9F _xx, _xx, _xx, _ct, _ct, _xx, _xx, _xx, _ct, _ct, _ct, _xx, _xx, _xx, _ct, _ct, // 0BA0 - 0BAF - _ct, _ct, _ct, _ct, _ct, _ct, _xx, _ct, _ct, _ct, _xx, _xx, _xx, _xx, _r2, _dr, // 0BB0 - 0BBF + _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _xx, _xx, _xx, _xx, _r2, _dr, // 0BB0 - 0BBF _da, _dr, _dr, _xx, _xx, _xx, _l1, _l1, _dl, _xx, _s1, _s2, _s3, _vr, _xx, _xx, // 0BC0 - 0BCF _xx, _xx, _xx, _xx, _xx, _xx, _xx, _m2, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0BD0 - 0BDF _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0BE0 - 0BEF @@ -175,7 +191,7 @@ static const IndicClassTable::CharClass teluCharClasses[] = _xx, _mp, _mp, _mp, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _iv, _iv, // 0C00 - 0C0F _iv, _xx, _iv, _iv, _iv, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, // 0C10 - 0C1F _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _bb, // 0C20 - 0C2F - _bb, _ct, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _xx, _xx, _xx, _xx, _da, _da, // 0C30 - 0C3F + _bb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _xx, _xx, _xx, _xx, _da, _da, // 0C30 - 0C3F _da, _dr, _dr, _dr, _dr, _xx, _a1, _da, _s1, _xx, _da, _da, _da, _vr, _xx, _xx, // 0C40 - 0C4F _xx, _xx, _xx, _xx, _xx, _da, _m2, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0C50 - 0C5F _iv, _iv, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx // 0C60 - 0C6F @@ -189,7 +205,7 @@ static const IndicClassTable::CharClass teluCharClasses[] = // http://brahmi.sourceforge.net/docs/KannadaComputing.html static const IndicClassTable::CharClass kndaCharClasses[] = { - _xx, _xx, _mp, _mp, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _iv, // 0C80 - 0C8F + _xx, _xx, _mp, _mp, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _iv, _iv, // 0C80 - 0C8F _iv, _xx, _iv, _iv, _iv, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, // 0C90 - 0C9F _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _bb, // 0CA0 - 0CAF _rb, _ct, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _xx, _xx, _xx, _xx, _dr, _da, // 0CB0 - 0CBF @@ -203,9 +219,9 @@ static const IndicClassTable::CharClass kndaCharClasses[] = static const IndicClassTable::CharClass mlymCharClasses[] = { _xx, _xx, _mp, _mp, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _iv, _iv, // 0D00 - 0D0F - _iv, _xx, _iv, _iv, _iv, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _bb, // 0D10 - 0D1F - _ct, _ct, _ct, _bb, _ct, _bb, _bb, _ct, _ct, _xx, _ct, _ct, _ct, _ct, _ct, _pb, // 0D20 - 0D2F - _pb, _cn, _bb, _ct, _ct, _pb, _ct, _ct, _ct, _ct, _xx, _xx, _xx, _xx, _r2, _dr, // 0D30 - 0D3F + _iv, _xx, _iv, _iv, _iv, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, // 0D10 - 0D1F + _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _xx, _ct, _ct, _ct, _ct, _ct, _pb, // 0D20 - 0D2F + _fb, _fb, _bb, _ct, _ct, _pb, _ct, _ct, _ct, _ct, _xx, _xx, _xx, _xx, _r2, _dr, // 0D30 - 0D3F _dr, _dr, _dr, _dr, _xx, _xx, _l1, _l1, _dl, _xx, _s1, _s2, _s3, _vr, _xx, _xx, // 0D40 - 0D4F _xx, _xx, _xx, _xx, _xx, _xx, _xx, _m2, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0D50 - 0D5F _iv, _iv, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx // 0D60 - 0D6F @@ -217,7 +233,7 @@ static const IndicClassTable::CharClass sinhCharClasses[] = _iv, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _xx, _xx, _ct, _ct, _ct, _ct, _ct, _ct, // 0D90 - 0D9F _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, // 0DA0 - 0DAF _ct, _ct, _xx, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _xx, _ct, _xx, _xx, // 0DB0 - 0DBF - _ct, _ct, _ct, _ct, _ct, _ct, _ct, _xx, _xx, _xx, _vr, _xx, _xx, _xx, _xx, _dr, // 0DC0 - 0DCF + _ct, _ct, _ct, _ct, _ct, _ct, _ct, _xx, _xx, _xx, _al, _xx, _xx, _xx, _xx, _dr, // 0DC0 - 0DCF _dr, _dr, _da, _da, _db, _xx, _db, _xx, _dr, _dl, _s1, _dl, _s2, _s3, _s4, _dr, // 0DD0 - 0DDF _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0DE0 - 0DEF _xx, _xx, _dr, _dr, _xx // 0DF0 - 0DF4 @@ -248,17 +264,18 @@ static const SplitMatra sinhSplitTable[] = {{0x0DD9, 0x0DCA}, {0x0DD9, 0x0DCF}, // FIXME: post 'GSUB' reordering of MATRA_PRE's for Malayalam and Tamil // FIXME: reformed Malayalam needs to reorder VATTU to before base glyph... +// FIXME: not sure passing ZWJ/ZWNJ is best way to render Malayalam Cillu... // FIXME: eyelash RA only for Devanagari?? -#define DEVA_SCRIPT_FLAGS (SF_EYELASH_RA | SF_NO_POST_BASE_LIMIT) -#define BENG_SCRIPT_FLAGS (SF_REPH_AFTER_BELOW | SF_NO_POST_BASE_LIMIT) -#define PUNJ_SCRIPT_FLAGS (SF_NO_POST_BASE_LIMIT) -#define GUJR_SCRIPT_FLAGS (SF_NO_POST_BASE_LIMIT) -#define ORYA_SCRIPT_FLAGS (SF_REPH_AFTER_BELOW | SF_NO_POST_BASE_LIMIT) -#define TAML_SCRIPT_FLAGS (SF_MPRE_FIXUP | SF_NO_POST_BASE_LIMIT) -#define TELU_SCRIPT_FLAGS (SF_MATRAS_AFTER_BASE | 3) -#define KNDA_SCRIPT_FLAGS (SF_MATRAS_AFTER_BASE | 3) -#define MLYM_SCRIPT_FLAGS (SF_MPRE_FIXUP | SF_NO_POST_BASE_LIMIT) -#define SINH_SCRIPT_FLAGS (SF_MPRE_FIXUP | SF_NO_POST_BASE_LIMIT) +#define DEVA_SCRIPT_FLAGS (SF_EYELASH_RA | SF_NO_POST_BASE_LIMIT | SF_FILTER_ZERO_WIDTH) +#define BENG_SCRIPT_FLAGS (SF_REPH_AFTER_BELOW | SF_NO_POST_BASE_LIMIT | SF_FILTER_ZERO_WIDTH) +#define PUNJ_SCRIPT_FLAGS (SF_NO_POST_BASE_LIMIT | SF_FILTER_ZERO_WIDTH) +#define GUJR_SCRIPT_FLAGS (SF_NO_POST_BASE_LIMIT | SF_FILTER_ZERO_WIDTH) +#define ORYA_SCRIPT_FLAGS (SF_REPH_AFTER_BELOW | SF_NO_POST_BASE_LIMIT | SF_FILTER_ZERO_WIDTH) +#define TAML_SCRIPT_FLAGS (SF_MPRE_FIXUP | SF_NO_POST_BASE_LIMIT | SF_FILTER_ZERO_WIDTH) +#define TELU_SCRIPT_FLAGS (SF_MATRAS_AFTER_BASE | SF_FILTER_ZERO_WIDTH | 3) +#define KNDA_SCRIPT_FLAGS (SF_MATRAS_AFTER_BASE | SF_FILTER_ZERO_WIDTH | 3) +#define MLYM_SCRIPT_FLAGS (SF_MPRE_FIXUP | SF_NO_POST_BASE_LIMIT /*| SF_FILTER_ZERO_WIDTH*/) +#define SINH_SCRIPT_FLAGS (SF_NO_POST_BASE_LIMIT) // // Indic Class Tables @@ -286,7 +303,7 @@ static const IndicClassTable sinhClassTable = {0x0D80, 0x0DF4, 4, SINH_SCRIPT_FL // // IndicClassTable addresses // -static const IndicClassTable * const indicClassTables[] = { +static const IndicClassTable * const indicClassTables[scriptCodeCount] = { NULL, /* 'zyyy' (COMMON) */ NULL, /* 'qaai' (INHERITED) */ NULL, /* 'arab' (ARABIC) */ @@ -348,7 +365,79 @@ static const IndicClassTable * const indicClassTables[] = { NULL, /* 'sylo' (SYLOTI_NAGRI) */ NULL, /* 'talu' (NEW_TAI_LUE) */ NULL, /* 'tfng' (TIFINAGH) */ - NULL /* 'xpeo' (OLD_PERSIAN) */ + NULL, /* 'xpeo' (OLD_PERSIAN) */ + NULL, /* 'bali' (BALINESE) */ + NULL, /* 'batk' (BATK) */ + NULL, /* 'blis' (BLIS) */ + NULL, /* 'brah' (BRAH) */ + NULL, /* 'cham' (CHAM) */ + NULL, /* 'cirt' (CIRT) */ + NULL, /* 'cyrs' (CYRS) */ + NULL, /* 'egyd' (EGYD) */ + NULL, /* 'egyh' (EGYH) */ + NULL, /* 'egyp' (EGYP) */ + NULL, /* 'geok' (GEOK) */ + NULL, /* 'hans' (HANS) */ + NULL, /* 'hant' (HANT) */ + NULL, /* 'hmng' (HMNG) */ + NULL, /* 'hung' (HUNG) */ + NULL, /* 'inds' (INDS) */ + NULL, /* 'java' (JAVA) */ + NULL, /* 'kali' (KALI) */ + NULL, /* 'latf' (LATF) */ + NULL, /* 'latg' (LATG) */ + NULL, /* 'lepc' (LEPC) */ + NULL, /* 'lina' (LINA) */ + NULL, /* 'mand' (MAND) */ + NULL, /* 'maya' (MAYA) */ + NULL, /* 'mero' (MERO) */ + NULL, /* 'nko ' (NKO) */ + NULL, /* 'orkh' (ORKH) */ + NULL, /* 'perm' (PERM) */ + NULL, /* 'phag' (PHAGS_PA) */ + NULL, /* 'phnx' (PHOENICIAN) */ + NULL, /* 'plrd' (PLRD) */ + NULL, /* 'roro' (RORO) */ + NULL, /* 'sara' (SARA) */ + NULL, /* 'syre' (SYRE) */ + NULL, /* 'syrj' (SYRJ) */ + NULL, /* 'syrn' (SYRN) */ + NULL, /* 'teng' (TENG) */ + NULL, /* 'vai ' (VAII) */ + NULL, /* 'visp' (VISP) */ + NULL, /* 'xsux' (CUNEIFORM) */ + NULL, /* 'zxxx' (ZXXX) */ + NULL, /* 'zzzz' (UNKNOWN) */ + NULL, /* 'cari' (CARI) */ + NULL, /* 'jpan' (JPAN) */ + NULL, /* 'lana' (LANA) */ + NULL, /* 'lyci' (LYCI) */ + NULL, /* 'lydi' (LYDI) */ + NULL, /* 'olck' (OLCK) */ + NULL, /* 'rjng' (RJNG) */ + NULL, /* 'saur' (SAUR) */ + NULL, /* 'sgnw' (SGNW) */ + NULL, /* 'sund' (SUND) */ + NULL, /* 'moon' (MOON) */ + NULL, /* 'mtei' (MTEI) */ + NULL, /* 'armi' (ARMI) */ + NULL, /* 'avst' (AVST) */ + NULL, /* 'cakm' (CAKM) */ + NULL, /* 'kore' (KORE) */ + NULL, /* 'kthi' (KTHI) */ + NULL, /* 'mani' (MANI) */ + NULL, /* 'phli' (PHLI) */ + NULL, /* 'phlp' (PHLP) */ + NULL, /* 'phlv' (PHLV) */ + NULL, /* 'prti' (PRTI) */ + NULL, /* 'samr' (SAMR) */ + NULL, /* 'tavt' (TAVT) */ + NULL, /* 'zmth' (ZMTH) */ + NULL, /* 'zsym' (ZSYM) */ + NULL, /* 'bamu' (BAMUM) */ + NULL, /* 'lisu' (LISU) */ + NULL, /* 'nkgb' (NKGB) */ + NULL /* 'sarb' (OLD_SOUTH_ARABIAN) */ }; IndicClassTable::CharClass IndicClassTable::getCharClass(LEUnicode ch) const @@ -388,4 +477,15 @@ le_int32 IndicReordering::getWorstCaseExpansion(le_int32 scriptCode) return classTable->getWorstCaseExpansion(); } +le_bool IndicReordering::getFilterZeroWidth(le_int32 scriptCode) +{ + const IndicClassTable *classTable = IndicClassTable::getScriptClassTable(scriptCode); + + if (classTable == NULL) { + return TRUE; + } + + return classTable->getFilterZeroWidth(); +} + U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp index acc214641a2..4d2c4180226 100644 --- a/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp +++ b/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp @@ -26,7 +26,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2009 - All Rights Reserved * */ @@ -44,24 +44,31 @@ #include "LEGlyphStorage.h" #include "IndicReordering.h" - +#include U_NAMESPACE_BEGIN UOBJECT_DEFINE_RTTI_IMPLEMENTATION(IndicOpenTypeLayoutEngine) IndicOpenTypeLayoutEngine::IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) - : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable), fMPreFixups(NULL) + le_int32 typoFlags, le_bool version2, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success) + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success), fMPreFixups(NULL) { + if ( version2 ) { + fFeatureMap = IndicReordering::getv2FeatureMap(fFeatureMapCount); + } else { fFeatureMap = IndicReordering::getFeatureMap(fFeatureMapCount); + } fFeatureOrder = TRUE; + fVersion2 = version2; + fFilterZeroWidth = IndicReordering::getFilterZeroWidth(fScriptCode); } -IndicOpenTypeLayoutEngine::IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) - : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), fMPreFixups(NULL) +IndicOpenTypeLayoutEngine::IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, LEErrorCode &success) + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success), fMPreFixups(NULL) { fFeatureMap = IndicReordering::getFeatureMap(fFeatureMapCount); fFeatureOrder = TRUE; + fVersion2 = FALSE; } IndicOpenTypeLayoutEngine::~IndicOpenTypeLayoutEngine() @@ -89,8 +96,13 @@ le_int32 IndicOpenTypeLayoutEngine::glyphProcessing(const LEUnicode chars[], le_ return 0; } - IndicReordering::adjustMPres(fMPreFixups, glyphStorage); - + if (fVersion2) { + IndicReordering::finalReordering(glyphStorage,retCount); + IndicReordering::applyPresentationForms(glyphStorage,retCount); + OpenTypeLayoutEngine::glyphSubstitution(count,max, rightToLeft, glyphStorage, success); + } else { + IndicReordering::adjustMPres(fMPreFixups, glyphStorage, success); + } return retCount; } @@ -128,7 +140,18 @@ le_int32 IndicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], // NOTE: assumes this allocates featureTags... // (probably better than doing the worst case stuff here...) - le_int32 outCharCount = IndicReordering::reorder(&chars[offset], count, fScriptCode, outChars, glyphStorage, &fMPreFixups); + + le_int32 outCharCount; + if (fVersion2) { + outCharCount = IndicReordering::v2process(&chars[offset], count, fScriptCode, outChars, glyphStorage); + } else { + outCharCount = IndicReordering::reorder(&chars[offset], count, fScriptCode, outChars, glyphStorage, &fMPreFixups, success); + } + + if (LE_FAILURE(success)) { + LE_DELETE_ARRAY(outChars); + return 0; + } glyphStorage.adoptGlyphCount(outCharCount); return outCharCount; diff --git a/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.h b/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.h index ba1c5262cfe..b443941bf99 100644 --- a/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.h +++ b/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.h @@ -26,7 +26,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2009 - All Rights Reserved * */ @@ -72,6 +72,7 @@ public: * @param scriptCode - the script * @param langaugeCode - the language * @param gsubTable - the GSUB table + * @param success - set to an error code if the operation fails * * @see LayoutEngine::layoutEngineFactory * @see OpenTypeLayoutEngine @@ -80,7 +81,7 @@ public: * @internal */ IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); + le_int32 typoFlags, le_bool version2, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success); /** * This constructor is used when the font requires a "canned" GSUB table which can't be known @@ -89,6 +90,7 @@ public: * @param fontInstance - the font * @param scriptCode - the script * @param langaugeCode - the language + * @param success - set to an error code if the operation fails * * @see OpenTypeLayoutEngine * @see ScriptAndLangaugeTags.h for script and language codes @@ -96,7 +98,7 @@ public: * @internal */ IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags); + le_int32 typoFlags, LEErrorCode &success); /** * The destructor, virtual for correct polymorphic invocation. @@ -177,9 +179,12 @@ protected: virtual le_int32 glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); + le_bool fVersion2; + private: MPreFixups *fMPreFixups; + }; U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/IndicReordering.cpp b/jdk/src/share/native/sun/font/layout/IndicReordering.cpp index 2bbceabda11..9b28ada355d 100644 --- a/jdk/src/share/native/sun/font/layout/IndicReordering.cpp +++ b/jdk/src/share/native/sun/font/layout/IndicReordering.cpp @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2009 - All Rights Reserved * */ @@ -38,10 +38,12 @@ U_NAMESPACE_BEGIN +#define loclFeatureTag LE_LOCL_FEATURE_TAG #define initFeatureTag LE_INIT_FEATURE_TAG #define nuktFeatureTag LE_NUKT_FEATURE_TAG #define akhnFeatureTag LE_AKHN_FEATURE_TAG #define rphfFeatureTag LE_RPHF_FEATURE_TAG +#define rkrfFeatureTag LE_RKRF_FEATURE_TAG #define blwfFeatureTag LE_BLWF_FEATURE_TAG #define halfFeatureTag LE_HALF_FEATURE_TAG #define pstfFeatureTag LE_PSTF_FEATURE_TAG @@ -51,30 +53,69 @@ U_NAMESPACE_BEGIN #define abvsFeatureTag LE_ABVS_FEATURE_TAG #define pstsFeatureTag LE_PSTS_FEATURE_TAG #define halnFeatureTag LE_HALN_FEATURE_TAG - +#define cjctFeatureTag LE_CJCT_FEATURE_TAG #define blwmFeatureTag LE_BLWM_FEATURE_TAG #define abvmFeatureTag LE_ABVM_FEATURE_TAG #define distFeatureTag LE_DIST_FEATURE_TAG +#define caltFeatureTag LE_CALT_FEATURE_TAG +#define kernFeatureTag LE_KERN_FEATURE_TAG -#define rphfFeatureMask 0x80000000UL -#define blwfFeatureMask 0x40000000UL -#define halfFeatureMask 0x20000000UL -#define pstfFeatureMask 0x10000000UL -#define nuktFeatureMask 0x08000000UL -#define akhnFeatureMask 0x04000000UL -#define vatuFeatureMask 0x02000000UL -#define presFeatureMask 0x01000000UL -#define blwsFeatureMask 0x00800000UL -#define abvsFeatureMask 0x00400000UL -#define pstsFeatureMask 0x00200000UL -#define halnFeatureMask 0x00100000UL -#define blwmFeatureMask 0x00080000UL -#define abvmFeatureMask 0x00040000UL -#define distFeatureMask 0x00020000UL -#define initFeatureMask 0x00010000UL +#define loclFeatureMask 0x80000000UL +#define rphfFeatureMask 0x40000000UL +#define blwfFeatureMask 0x20000000UL +#define halfFeatureMask 0x10000000UL +#define pstfFeatureMask 0x08000000UL +#define nuktFeatureMask 0x04000000UL +#define akhnFeatureMask 0x02000000UL +#define vatuFeatureMask 0x01000000UL +#define presFeatureMask 0x00800000UL +#define blwsFeatureMask 0x00400000UL +#define abvsFeatureMask 0x00200000UL +#define pstsFeatureMask 0x00100000UL +#define halnFeatureMask 0x00080000UL +#define blwmFeatureMask 0x00040000UL +#define abvmFeatureMask 0x00020000UL +#define distFeatureMask 0x00010000UL +#define initFeatureMask 0x00008000UL +#define cjctFeatureMask 0x00004000UL +#define rkrfFeatureMask 0x00002000UL +#define caltFeatureMask 0x00001000UL +#define kernFeatureMask 0x00000800UL -class ReorderingOutput : public UMemory { +// Syllable structure bits +#define baseConsonantMask 0x00000400UL +#define consonantMask 0x00000200UL +#define halfConsonantMask 0x00000100UL +#define rephConsonantMask 0x00000080UL +#define matraMask 0x00000040UL +#define vowelModifierMask 0x00000020UL +#define markPositionMask 0x00000018UL + +#define postBasePosition 0x00000000UL +#define preBasePosition 0x00000008UL +#define aboveBasePosition 0x00000010UL +#define belowBasePosition 0x00000018UL + +#define repositionedGlyphMask 0x00000002UL + +#define basicShapingFormsMask ( loclFeatureMask | nuktFeatureMask | akhnFeatureMask | rkrfFeatureMask | blwfFeatureMask | halfFeatureMask | vatuFeatureMask | cjctFeatureMask ) +#define positioningFormsMask ( kernFeatureMask | distFeatureMask | abvmFeatureMask | blwmFeatureMask ) +#define presentationFormsMask ( presFeatureMask | abvsFeatureMask | blwsFeatureMask | pstsFeatureMask | halnFeatureMask | caltFeatureMask ) + + +#define C_MALAYALAM_VOWEL_SIGN_U 0x0D41 +#define C_DOTTED_CIRCLE 0x25CC +#define NO_GLYPH 0xFFFF + +// Some level of debate as to the proper value for MAX_CONSONANTS_PER_SYLLABLE. Ticket 5588 states that 4 +// is the magic number according to ISCII, but 5 seems to be the more consistent with XP. +#define MAX_CONSONANTS_PER_SYLLABLE 5 + +#define INDIC_BLOCK_SIZE 0x7F + +class IndicReorderingOutput : public UMemory { private: + le_int32 fSyllableCount; le_int32 fOutIndex; LEUnicode *fOutChars; @@ -95,8 +136,8 @@ private: LEUnicode fLengthMark; le_int32 fLengthMarkIndex; - LEUnicode fVirama; - le_int32 fViramaIndex; + LEUnicode fAlLakuna; + le_int32 fAlLakunaIndex; FeatureMask fMatraFeatures; @@ -113,15 +154,20 @@ private: le_int32 fSMIndex; FeatureMask fSMFeatures; + LEUnicode fPreBaseConsonant; + LEUnicode fPreBaseVirama; + le_int32 fPBCIndex; + FeatureMask fPBCFeatures; + void saveMatra(LEUnicode matra, le_int32 matraIndex, IndicClassTable::CharClass matraClass) { // FIXME: check if already set, or if not a matra... if (IndicClassTable::isLengthMark(matraClass)) { fLengthMark = matra; fLengthMarkIndex = matraIndex; - } else if (IndicClassTable::isVirama(matraClass)) { - fVirama = matra; - fViramaIndex = matraIndex; + } else if (IndicClassTable::isAlLakuna(matraClass)) { + fAlLakuna = matra; + fAlLakunaIndex = matraIndex; } else { switch (matraClass & CF_POS_MASK) { case CF_POS_BEFORE: @@ -152,29 +198,34 @@ private: } public: - ReorderingOutput(LEUnicode *outChars, LEGlyphStorage &glyphStorage, MPreFixups *mpreFixups) - : fOutIndex(0), fOutChars(outChars), fGlyphStorage(glyphStorage), + IndicReorderingOutput(LEUnicode *outChars, LEGlyphStorage &glyphStorage, MPreFixups *mpreFixups) + : fSyllableCount(0), fOutIndex(0), fOutChars(outChars), fGlyphStorage(glyphStorage), fMpre(0), fMpreIndex(0), fMbelow(0), fMbelowIndex(0), fMabove(0), fMaboveIndex(0), - fMpost(0), fMpostIndex(0), fLengthMark(0), fLengthMarkIndex(0), fVirama(0), fViramaIndex(0), + fMpost(0), fMpostIndex(0), fLengthMark(0), fLengthMarkIndex(0), fAlLakuna(0), fAlLakunaIndex(0), fMatraFeatures(0), fMPreOutIndex(-1), fMPreFixups(mpreFixups), fVMabove(0), fVMpost(0), fVMIndex(0), fVMFeatures(0), - fSMabove(0), fSMbelow(0), fSMIndex(0), fSMFeatures(0) + fSMabove(0), fSMbelow(0), fSMIndex(0), fSMFeatures(0), + fPreBaseConsonant(0), fPreBaseVirama(0), fPBCIndex(0), fPBCFeatures(0) { // nothing else to do... } - ~ReorderingOutput() + ~IndicReorderingOutput() { // nothing to do here... } void reset() { - fMpre = fMbelow = fMabove = fMpost = fLengthMark = fVirama = 0; + fSyllableCount += 1; + + fMpre = fMbelow = fMabove = fMpost = fLengthMark = fAlLakuna = 0; fMPreOutIndex = -1; fVMabove = fVMpost = 0; fSMabove = fSMbelow = 0; + + fPreBaseConsonant = fPreBaseVirama = 0; } void writeChar(LEUnicode ch, le_uint32 charIndex, FeatureMask charFeatures) @@ -184,11 +235,113 @@ public: fOutChars[fOutIndex] = ch; fGlyphStorage.setCharIndex(fOutIndex, charIndex, success); - fGlyphStorage.setAuxData(fOutIndex, charFeatures, success); + fGlyphStorage.setAuxData(fOutIndex, charFeatures | (fSyllableCount & LE_GLYPH_GROUP_MASK), success); fOutIndex += 1; } + void setFeatures ( le_uint32 charIndex, FeatureMask charFeatures) + { + LEErrorCode success = LE_NO_ERROR; + + fGlyphStorage.setAuxData( charIndex, charFeatures, success ); + + } + + FeatureMask getFeatures ( le_uint32 charIndex ) + { + LEErrorCode success = LE_NO_ERROR; + return fGlyphStorage.getAuxData(charIndex,success); + } + + void decomposeReorderMatras ( const IndicClassTable *classTable, le_int32 beginSyllable, le_int32 nextSyllable, le_int32 inv_count ) { + le_int32 i; + LEErrorCode success = LE_NO_ERROR; + + for ( i = beginSyllable ; i < nextSyllable ; i++ ) { + if ( classTable->isMatra(fOutChars[i+inv_count])) { + IndicClassTable::CharClass matraClass = classTable->getCharClass(fOutChars[i+inv_count]); + if ( classTable->isSplitMatra(matraClass)) { + le_int32 saveIndex = fGlyphStorage.getCharIndex(i+inv_count,success); + le_uint32 saveAuxData = fGlyphStorage.getAuxData(i+inv_count,success); + const SplitMatra *splitMatra = classTable->getSplitMatra(matraClass); + int j; + for (j = 0 ; *(splitMatra)[j] != 0 ; j++) { + LEUnicode piece = (*splitMatra)[j]; + if ( j == 0 ) { + fOutChars[i+inv_count] = piece; + matraClass = classTable->getCharClass(piece); + } else { + insertCharacter(piece,i+1+inv_count,saveIndex,saveAuxData); + nextSyllable++; + } + } + } + + if ((matraClass & CF_POS_MASK) == CF_POS_BEFORE) { + moveCharacter(i+inv_count,beginSyllable+inv_count); + } + } + } + } + + void moveCharacter( le_int32 fromPosition, le_int32 toPosition ) { + le_int32 i,saveIndex; + le_uint32 saveAuxData; + LEUnicode saveChar = fOutChars[fromPosition]; + LEErrorCode success = LE_NO_ERROR; + LEErrorCode success2 = LE_NO_ERROR; + saveIndex = fGlyphStorage.getCharIndex(fromPosition,success); + saveAuxData = fGlyphStorage.getAuxData(fromPosition,success); + + if ( fromPosition > toPosition ) { + for ( i = fromPosition ; i > toPosition ; i-- ) { + fOutChars[i] = fOutChars[i-1]; + fGlyphStorage.setCharIndex(i,fGlyphStorage.getCharIndex(i-1,success2),success); + fGlyphStorage.setAuxData(i,fGlyphStorage.getAuxData(i-1,success2), success); + + } + } else { + for ( i = fromPosition ; i < toPosition ; i++ ) { + fOutChars[i] = fOutChars[i+1]; + fGlyphStorage.setCharIndex(i,fGlyphStorage.getCharIndex(i+1,success2),success); + fGlyphStorage.setAuxData(i,fGlyphStorage.getAuxData(i+1,success2), success); + } + + } + fOutChars[toPosition] = saveChar; + fGlyphStorage.setCharIndex(toPosition,saveIndex,success); + fGlyphStorage.setAuxData(toPosition,saveAuxData,success); + + } + void insertCharacter( LEUnicode ch, le_int32 toPosition, le_int32 charIndex, le_uint32 auxData ) { + LEErrorCode success = LE_NO_ERROR; + le_int32 i; + fOutIndex += 1; + + for ( i = fOutIndex ; i > toPosition ; i--) { + fOutChars[i] = fOutChars[i-1]; + fGlyphStorage.setCharIndex(i,fGlyphStorage.getCharIndex(i-1,success),success); + fGlyphStorage.setAuxData(i,fGlyphStorage.getAuxData(i-1,success), success); + } + + fOutChars[toPosition] = ch; + fGlyphStorage.setCharIndex(toPosition,charIndex,success); + fGlyphStorage.setAuxData(toPosition,auxData,success); + + } + void removeCharacter( le_int32 fromPosition ) { + LEErrorCode success = LE_NO_ERROR; + le_int32 i; + fOutIndex -= 1; + + for ( i = fromPosition ; i < fOutIndex ; i--) { + fOutChars[i] = fOutChars[i+1]; + fGlyphStorage.setCharIndex(i,fGlyphStorage.getCharIndex(i+1,success),success); + fGlyphStorage.setAuxData(i,fGlyphStorage.getAuxData(i+1,success), success); + } + } + le_bool noteMatra(const IndicClassTable *classTable, LEUnicode matra, le_uint32 matraIndex, FeatureMask matraFeatures, le_bool wordStart) { IndicClassTable::CharClass matraClass = classTable->getCharClass(matra); @@ -268,6 +421,14 @@ public: } } + void notePreBaseConsonant(le_uint32 index,LEUnicode PBConsonant, LEUnicode PBVirama, FeatureMask features) + { + fPBCIndex = index; + fPreBaseConsonant = PBConsonant; + fPreBaseVirama = PBVirama; + fPBCFeatures = features; + } + void noteBaseConsonant() { if (fMPreFixups != NULL && fMPreOutIndex >= 0) { @@ -275,11 +436,11 @@ public: } } - // Handles virama in Sinhala split vowels. - void writeVirama() + // Handles Al-Lakuna in Sinhala split vowels. + void writeAlLakuna() { - if (fVirama != 0) { - writeChar(fVirama, fViramaIndex, fMatraFeatures); + if (fAlLakuna != 0) { + writeChar(fAlLakuna, fAlLakunaIndex, fMatraFeatures); } } @@ -347,26 +508,39 @@ public: } } + void writePreBaseConsonant() + { + // The TDIL spec says that consonant + virama + RRA should produce a rakar in Malayalam. However, + // it seems that almost none of the fonts for Malayalam are set up to handle this. + // So, we're going to force the issue here by using the rakar as defined with RA in most fonts. + + if (fPreBaseConsonant == 0x0d31) { // RRA + fPreBaseConsonant = 0x0d30; // RA + } + + if (fPreBaseConsonant != 0) { + writeChar(fPreBaseConsonant, fPBCIndex, fPBCFeatures); + writeChar(fPreBaseVirama,fPBCIndex-1,fPBCFeatures); + } + } + le_int32 getOutputIndex() { return fOutIndex; } }; -enum -{ - C_DOTTED_CIRCLE = 0x25CC -}; + // TODO: Find better names for these! -#define tagArray4 (nuktFeatureMask | akhnFeatureMask | vatuFeatureMask | presFeatureMask | blwsFeatureMask | abvsFeatureMask | pstsFeatureMask | halnFeatureMask | blwmFeatureMask | abvmFeatureMask | distFeatureMask) +#define tagArray4 (loclFeatureMask | nuktFeatureMask | akhnFeatureMask | vatuFeatureMask | presFeatureMask | blwsFeatureMask | abvsFeatureMask | pstsFeatureMask | halnFeatureMask | blwmFeatureMask | abvmFeatureMask | distFeatureMask) #define tagArray3 (pstfFeatureMask | tagArray4) #define tagArray2 (halfFeatureMask | tagArray3) #define tagArray1 (blwfFeatureMask | tagArray2) #define tagArray0 (rphfFeatureMask | tagArray1) -static const FeatureMap featureMap[] = -{ +static const FeatureMap featureMap[] = { + {loclFeatureTag, loclFeatureMask}, {initFeatureTag, initFeatureMask}, {nuktFeatureTag, nuktFeatureMask}, {akhnFeatureTag, akhnFeatureMask}, @@ -387,21 +561,47 @@ static const FeatureMap featureMap[] = static const le_int32 featureCount = LE_ARRAY_SIZE(featureMap); +static const FeatureMap v2FeatureMap[] = { + {loclFeatureTag, loclFeatureMask}, + {nuktFeatureTag, nuktFeatureMask}, + {akhnFeatureTag, akhnFeatureMask}, + {rphfFeatureTag, rphfFeatureMask}, + {rkrfFeatureTag, rkrfFeatureMask}, + {blwfFeatureTag, blwfFeatureMask}, + {halfFeatureTag, halfFeatureMask}, + {vatuFeatureTag, vatuFeatureMask}, + {cjctFeatureTag, cjctFeatureMask}, + {presFeatureTag, presFeatureMask}, + {abvsFeatureTag, abvsFeatureMask}, + {blwsFeatureTag, blwsFeatureMask}, + {pstsFeatureTag, pstsFeatureMask}, + {halnFeatureTag, halnFeatureMask}, + {caltFeatureTag, caltFeatureMask}, + {kernFeatureTag, kernFeatureMask}, + {distFeatureTag, distFeatureMask}, + {abvmFeatureTag, abvmFeatureMask}, + {blwmFeatureTag, blwmFeatureMask} +}; + +static const le_int32 v2FeatureMapCount = LE_ARRAY_SIZE(v2FeatureMap); + static const le_int8 stateTable[][CC_COUNT] = { -// xx vm sm iv i2 i3 ct cn nu dv s1 s2 s3 vr zw - { 1, 1, 1, 5, 8, 11, 3, 2, 1, 5, 9, 5, 1, 1, 1}, // 0 - ground state - {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 - exit state - {-1, 6, 1, -1, -1, -1, -1, -1, -1, 5, 9, 5, 5, 4, -1}, // 2 - consonant with nukta - {-1, 6, 1, -1, -1, -1, -1, -1, 2, 5, 9, 5, 5, 4, -1}, // 3 - consonant - {-1, -1, -1, -1, -1, -1, 3, 2, -1, -1, -1, -1, -1, -1, 7}, // 4 - consonant virama - {-1, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 5 - dependent vowels - {-1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 6 - vowel mark - {-1, -1, -1, -1, -1, -1, 3, 2, -1, -1, -1, -1, -1, -1, -1}, // 7 - ZWJ, ZWNJ - {-1, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1}, // 8 - independent vowels that can take a virama - {-1, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 5, -1, -1}, // 9 - first part of split vowel - {-1, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1}, // 10 - second part of split vowel - {-1, 6, 1, -1, -1, -1, -1, -1, -1, 5, 9, 5, 5, 4, -1} // 11 - independent vowels that can take an iv +// xx vm sm iv i2 i3 ct cn nu dv s1 s2 s3 vr zw al + { 1, 6, 1, 5, 8, 11, 3, 2, 1, 5, 9, 5, 5, 1, 1, 1}, // 0 - ground state + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 - exit state + {-1, 6, 1, -1, -1, -1, -1, -1, -1, 5, 9, 5, 5, 4, 12, -1}, // 2 - consonant with nukta + {-1, 6, 1, -1, -1, -1, -1, -1, 2, 5, 9, 5, 5, 4, 12, 13}, // 3 - consonant + {-1, -1, -1, -1, -1, -1, 3, 2, -1, -1, -1, -1, -1, -1, 7, -1}, // 4 - consonant virama + {-1, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 5 - dependent vowels + {-1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 6 - vowel mark + {-1, -1, -1, -1, -1, -1, 3, 2, -1, -1, -1, -1, -1, -1, -1, -1}, // 7 - consonant virama ZWJ, consonant ZWJ virama + {-1, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, -1}, // 8 - independent vowels that can take a virama + {-1, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 5, -1, -1, -1}, // 9 - first part of split vowel + {-1, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, -1}, // 10 - second part of split vowel + {-1, 6, 1, -1, -1, -1, -1, -1, -1, 5, 9, 5, 5, 4, -1, -1}, // 11 - independent vowels that can take an iv + {-1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7, -1, 7}, // 12 - consonant ZWJ (TODO: Take everything else that can be after a consonant?) + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7, -1} // 13 - consonant al-lakuna ZWJ consonant }; @@ -412,14 +612,29 @@ const FeatureMap *IndicReordering::getFeatureMap(le_int32 &count) return featureMap; } +const FeatureMap *IndicReordering::getv2FeatureMap(le_int32 &count) +{ + count = v2FeatureMapCount; + + return v2FeatureMap; +} + le_int32 IndicReordering::findSyllable(const IndicClassTable *classTable, const LEUnicode *chars, le_int32 prev, le_int32 charCount) { le_int32 cursor = prev; le_int8 state = 0; + le_int8 consonant_count = 0; while (cursor < charCount) { IndicClassTable::CharClass charClass = classTable->getCharClass(chars[cursor]); + if ( IndicClassTable::isConsonant(charClass) ) { + consonant_count++; + if ( consonant_count > MAX_CONSONANTS_PER_SYLLABLE ) { + break; + } + } + state = stateTable[state][charClass & CF_CLASS_MASK]; if (state < 0) { @@ -434,16 +649,24 @@ le_int32 IndicReordering::findSyllable(const IndicClassTable *classTable, const le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le_int32 scriptCode, LEUnicode *outChars, LEGlyphStorage &glyphStorage, - MPreFixups **outMPreFixups) + MPreFixups **outMPreFixups, LEErrorCode& success) { + if (LE_FAILURE(success)) { + return 0; + } + MPreFixups *mpreFixups = NULL; const IndicClassTable *classTable = IndicClassTable::getScriptClassTable(scriptCode); if (classTable->scriptFlags & SF_MPRE_FIXUP) { mpreFixups = new MPreFixups(charCount); + if (mpreFixups == NULL) { + success = LE_MEMORY_ALLOCATION_ERROR; + return 0; + } } - ReorderingOutput output(outChars, glyphStorage, mpreFixups); + IndicReorderingOutput output(outChars, glyphStorage, mpreFixups); le_int32 i, prev = 0; le_bool lastInWord = FALSE; @@ -458,7 +681,7 @@ le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le output.noteStressMark(classTable, chars[markStart], markStart, tagArray1); } - if (classTable->isVowelModifier(chars[markStart - 1])) { + if (markStart != prev && classTable->isVowelModifier(chars[markStart - 1])) { markStart -= 1; output.noteVowelModifier(classTable, chars[markStart], markStart, tagArray1); } @@ -484,12 +707,23 @@ le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le break; + case CC_AL_LAKUNA: case CC_NUKTA: - case CC_VIRAMA: output.writeChar(C_DOTTED_CIRCLE, prev, tagArray1); output.writeChar(chars[prev], prev, tagArray1); break; + case CC_VIRAMA: + // A lone virama is illegal unless it follows a + // MALAYALAM_VOWEL_SIGN_U. Such a usage is called + // "samvruthokaram". + if (chars[prev - 1] != C_MALAYALAM_VOWEL_SIGN_U) { + output.writeChar(C_DOTTED_CIRCLE, prev, tagArray1); + } + + output.writeChar(chars[prev], prev, tagArray1); + break; + case CC_DEPENDENT_VOWEL: case CC_SPLIT_VOWEL_PIECE_1: case CC_SPLIT_VOWEL_PIECE_2: @@ -518,7 +752,7 @@ le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le } output.writeLengthMark(); - output.writeVirama(); + output.writeAlLakuna(); if ((classTable->scriptFlags & SF_REPH_AFTER_BELOW) == 0) { output.writeVMabove(); @@ -538,7 +772,7 @@ le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le le_int32 baseLimit = prev; // Check for REPH at front of syllable - if (length > 2 && classTable->isReph(chars[prev]) && classTable->isVirama(chars[prev + 1])) { + if (length > 2 && classTable->isReph(chars[prev]) && classTable->isVirama(chars[prev + 1]) && chars[prev + 2] != C_SIGN_ZWNJ) { baseLimit += 2; // Check for eyelash RA, if the script supports it @@ -556,35 +790,59 @@ le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le lastConsonant -= 1; } + + IndicClassTable::CharClass charClass = CC_RESERVED; + IndicClassTable::CharClass nextClass = CC_RESERVED; le_int32 baseConsonant = lastConsonant; le_int32 postBase = lastConsonant + 1; le_int32 postBaseLimit = classTable->scriptFlags & SF_POST_BASE_LIMIT_MASK; le_bool seenVattu = FALSE; le_bool seenBelowBaseForm = FALSE; + le_bool seenPreBaseForm = FALSE; + le_bool hasNukta = FALSE; + le_bool hasBelowBaseForm = FALSE; + le_bool hasPostBaseForm = FALSE; + le_bool hasPreBaseForm = FALSE; if (postBase < markStart && classTable->isNukta(chars[postBase])) { + charClass = CC_NUKTA; postBase += 1; } while (baseConsonant > baseLimit) { - IndicClassTable::CharClass charClass = classTable->getCharClass(chars[baseConsonant]); + nextClass = charClass; + hasNukta = IndicClassTable::isNukta(nextClass); + charClass = classTable->getCharClass(chars[baseConsonant]); + + hasBelowBaseForm = IndicClassTable::hasBelowBaseForm(charClass) && !hasNukta; + hasPostBaseForm = IndicClassTable::hasPostBaseForm(charClass) && !hasNukta; + hasPreBaseForm = IndicClassTable::hasPreBaseForm(charClass) && !hasNukta; if (IndicClassTable::isConsonant(charClass)) { if (postBaseLimit == 0 || seenVattu || (baseConsonant > baseLimit && !classTable->isVirama(chars[baseConsonant - 1])) || - !IndicClassTable::hasPostOrBelowBaseForm(charClass)) { + !(hasBelowBaseForm || hasPostBaseForm || hasPreBaseForm)) { break; } - seenVattu = IndicClassTable::isVattu(charClass); + // Note any pre-base consonants + if ( baseConsonant == lastConsonant && lastConsonant > 0 && + hasPreBaseForm && classTable->isVirama(chars[baseConsonant - 1])) { + output.notePreBaseConsonant(lastConsonant,chars[lastConsonant],chars[lastConsonant-1],tagArray2); + seenPreBaseForm = TRUE; - if (IndicClassTable::hasPostBaseForm(charClass)) { + } + // consonants with nuktas are never vattus + seenVattu = IndicClassTable::isVattu(charClass) && !hasNukta; + + // consonants with nuktas never have below- or post-base forms + if (hasPostBaseForm) { if (seenBelowBaseForm) { break; } postBase = baseConsonant; - } else if (IndicClassTable::hasBelowBaseForm(charClass)) { + } else if (hasBelowBaseForm) { seenBelowBaseForm = TRUE; } @@ -606,20 +864,25 @@ le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le } // write any pre-base consonants + output.writePreBaseConsonant(); + le_bool supressVattu = TRUE; for (i = baseLimit; i < baseConsonant; i += 1) { LEUnicode ch = chars[i]; - // Don't put 'blwf' on first consonant. - FeatureMask features = (i == baseLimit? tagArray2 : tagArray1); - IndicClassTable::CharClass charClass = classTable->getCharClass(ch); + // Don't put 'pstf' or 'blwf' on anything before the base consonant. + FeatureMask features = tagArray1 & ~( pstfFeatureMask | blwfFeatureMask ); + + charClass = classTable->getCharClass(ch); + nextClass = classTable->getCharClass(chars[i + 1]); + hasNukta = IndicClassTable::isNukta(nextClass); if (IndicClassTable::isConsonant(charClass)) { - if (IndicClassTable::isVattu(charClass) && supressVattu) { + if (IndicClassTable::isVattu(charClass) && !hasNukta && supressVattu) { features = tagArray4; } - supressVattu = IndicClassTable::isVattu(charClass); + supressVattu = IndicClassTable::isVattu(charClass) && !hasNukta; } else if (IndicClassTable::isVirama(charClass) && chars[i + 1] == C_SIGN_ZWNJ) { features = tagArray4; @@ -634,7 +897,8 @@ le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le bcSpan += 1; } - if (baseConsonant == lastConsonant && bcSpan < markStart && classTable->isVirama(chars[bcSpan])) { + if (baseConsonant == lastConsonant && bcSpan < markStart && + (classTable->isVirama(chars[bcSpan]) || classTable->isAlLakuna(chars[bcSpan]))) { bcSpan += 1; if (bcSpan < markStart && chars[bcSpan] == C_SIGN_ZWNJ) { @@ -658,7 +922,7 @@ le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le } // write below-base consonants - if (baseConsonant != lastConsonant) { + if (baseConsonant != lastConsonant && !seenPreBaseForm) { for (i = bcSpan + 1; i < postBase; i += 1) { output.writeChar(chars[i], i, tagArray1); } @@ -688,7 +952,7 @@ le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le // write post-base consonants // FIXME: does this put the right tags on post-base consonants? - if (baseConsonant != lastConsonant) { + if (baseConsonant != lastConsonant && !seenPreBaseForm) { if (postBase <= lastConsonant) { for (i = postBase; i <= lastConsonant; i += 1) { output.writeChar(chars[i], i, tagArray3); @@ -710,7 +974,7 @@ le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le } output.writeLengthMark(); - output.writeVirama(); + output.writeAlLakuna(); // write reph if ((classTable->scriptFlags & SF_REPH_AFTER_BELOW) == 0) { @@ -740,13 +1004,250 @@ le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le return output.getOutputIndex(); } -void IndicReordering::adjustMPres(MPreFixups *mpreFixups, LEGlyphStorage &glyphStorage) +void IndicReordering::adjustMPres(MPreFixups *mpreFixups, LEGlyphStorage &glyphStorage, LEErrorCode& success) { if (mpreFixups != NULL) { - mpreFixups->apply(glyphStorage); + mpreFixups->apply(glyphStorage, success); delete mpreFixups; } } +void IndicReordering::applyPresentationForms(LEGlyphStorage &glyphStorage, le_int32 count) +{ + LEErrorCode success = LE_NO_ERROR; + +// This sets us up for 2nd pass of glyph substitution as well as setting the feature masks for the +// GPOS table lookups + + for ( le_int32 i = 0 ; i < count ; i++ ) { + glyphStorage.setAuxData(i, ( presentationFormsMask | positioningFormsMask ), success); + } + +} +void IndicReordering::finalReordering(LEGlyphStorage &glyphStorage, le_int32 count) +{ + LEErrorCode success = LE_NO_ERROR; + + // Reposition REPH as appropriate + + for ( le_int32 i = 0 ; i < count ; i++ ) { + + le_int32 tmpAuxData = glyphStorage.getAuxData(i,success); + LEGlyphID tmpGlyph = glyphStorage.getGlyphID(i,success); + + if ( ( tmpGlyph != NO_GLYPH ) && (tmpAuxData & rephConsonantMask) && !(tmpAuxData & repositionedGlyphMask)) { + + le_bool targetPositionFound = false; + le_int32 targetPosition = i+1; + le_int32 baseConsonantData; + + while (!targetPositionFound) { + tmpGlyph = glyphStorage.getGlyphID(targetPosition,success); + tmpAuxData = glyphStorage.getAuxData(targetPosition,success); + + if ( tmpAuxData & baseConsonantMask ) { + baseConsonantData = tmpAuxData; + targetPositionFound = true; + } else { + targetPosition++; + } + } + + // Make sure we are not putting the reph into an empty hole + + le_bool targetPositionHasGlyph = false; + while (!targetPositionHasGlyph) { + tmpGlyph = glyphStorage.getGlyphID(targetPosition,success); + if ( tmpGlyph != NO_GLYPH ) { + targetPositionHasGlyph = true; + } else { + targetPosition--; + } + } + + // Make sure that REPH is positioned after any above base or post base matras + // + le_bool checkMatraDone = false; + le_int32 checkMatraPosition = targetPosition+1; + while ( !checkMatraDone ) { + tmpAuxData = glyphStorage.getAuxData(checkMatraPosition,success); + if ( checkMatraPosition >= count || ( (tmpAuxData ^ baseConsonantData) & LE_GLYPH_GROUP_MASK)) { + checkMatraDone = true; + continue; + } + if ( (tmpAuxData & matraMask) && + (((tmpAuxData & markPositionMask) == aboveBasePosition) || + ((tmpAuxData & markPositionMask) == postBasePosition))) { + targetPosition = checkMatraPosition; + } + checkMatraPosition++; + } + + glyphStorage.moveGlyph(i,targetPosition,repositionedGlyphMask); + } + } +} + + +le_int32 IndicReordering::v2process(const LEUnicode *chars, le_int32 charCount, le_int32 scriptCode, + LEUnicode *outChars, LEGlyphStorage &glyphStorage) +{ + const IndicClassTable *classTable = IndicClassTable::getScriptClassTable(scriptCode); + + DynamicProperties dynProps[INDIC_BLOCK_SIZE]; + IndicReordering::getDynamicProperties(dynProps,classTable); + + IndicReorderingOutput output(outChars, glyphStorage, NULL); + le_int32 i, firstConsonant, baseConsonant, secondConsonant, inv_count = 0, beginSyllable = 0; + //le_bool lastInWord = FALSE; + + while (beginSyllable < charCount) { + le_int32 nextSyllable = findSyllable(classTable, chars, beginSyllable, charCount); + + output.reset(); + + // Find the First Consonant + for ( firstConsonant = beginSyllable ; firstConsonant < nextSyllable ; firstConsonant++ ) { + if ( classTable->isConsonant(chars[firstConsonant]) ) { + break; + } + } + + // Find the base consonant + + baseConsonant = nextSyllable - 1; + secondConsonant = firstConsonant; + + // TODO: Use Dynamic Properties for hasBelowBaseForm and hasPostBaseForm() + + while ( baseConsonant > firstConsonant ) { + if ( classTable->isConsonant(chars[baseConsonant]) && + !classTable->hasBelowBaseForm(chars[baseConsonant]) && + !classTable->hasPostBaseForm(chars[baseConsonant]) ) { + break; + } + else { + if ( classTable->isConsonant(chars[baseConsonant]) ) { + secondConsonant = baseConsonant; + } + baseConsonant--; + } + } + + // If the syllable starts with Ra + Halant ( in a script that has Reph ) and has more than one + // consonant, Ra is excluced from candidates for base consonants + + if ( classTable->isReph(chars[beginSyllable]) && + beginSyllable+1 < nextSyllable && classTable->isVirama(chars[beginSyllable+1]) && + secondConsonant != firstConsonant) { + baseConsonant = secondConsonant; + } + + // Populate the output + for ( i = beginSyllable ; i < nextSyllable ; i++ ) { + + // Handle invalid combinartions + + if ( classTable->isVirama(chars[beginSyllable]) || + classTable->isMatra(chars[beginSyllable]) || + classTable->isVowelModifier(chars[beginSyllable]) || + classTable->isNukta(chars[beginSyllable]) ) { + output.writeChar(C_DOTTED_CIRCLE,beginSyllable,basicShapingFormsMask); + inv_count++; + } + output.writeChar(chars[i],i, basicShapingFormsMask); + + } + + // Adjust features and set syllable structure bits + + for ( i = beginSyllable ; i < nextSyllable ; i++ ) { + + FeatureMask outMask = output.getFeatures(i+inv_count); + FeatureMask saveMask = outMask; + + // Since reph can only validly occur at the beginning of a syllable + // We only apply it to the first 2 characters in the syllable, to keep it from + // conflicting with other features ( i.e. rkrf ) + + // TODO : Use the dynamic property for determining isREPH + if ( i == beginSyllable && i < baseConsonant && classTable->isReph(chars[i]) && + i+1 < nextSyllable && classTable->isVirama(chars[i+1])) { + outMask |= rphfFeatureMask; + outMask |= rephConsonantMask; + output.setFeatures(i+1+inv_count,outMask); + + } + + if ( i == baseConsonant ) { + outMask |= baseConsonantMask; + } + + if ( classTable->isMatra(chars[i])) { + outMask |= matraMask; + if ( classTable->hasAboveBaseForm(chars[i])) { + outMask |= aboveBasePosition; + } else if ( classTable->hasBelowBaseForm(chars[i])) { + outMask |= belowBasePosition; + } + } + + // Don't apply half form to virama that stands alone at the end of a syllable + // to prevent half forms from forming when syllable ends with virama + + if ( classTable->isVirama(chars[i]) && (i+1 == nextSyllable) ) { + outMask ^= halfFeatureMask; + if ( classTable->isConsonant(chars[i-1]) ) { + FeatureMask tmp = output.getFeatures(i-1+inv_count); + tmp ^= halfFeatureMask; + output.setFeatures(i-1+inv_count,tmp); + } + } + + if ( outMask != saveMask ) { + output.setFeatures(i+inv_count,outMask); + } + } + + output.decomposeReorderMatras(classTable,beginSyllable,nextSyllable,inv_count); + + beginSyllable = nextSyllable; + } + + + return output.getOutputIndex(); +} + + +void IndicReordering::getDynamicProperties( DynamicProperties *, const IndicClassTable *classTable ) { + + + LEUnicode currentChar; + LEUnicode virama; + LEUnicode workChars[2]; + LEGlyphStorage workGlyphs; + + IndicReorderingOutput workOutput(workChars, workGlyphs, NULL); + + //le_int32 offset = 0; + + // First find the relevant virama for the script we are dealing with + + for ( currentChar = classTable->firstChar ; currentChar <= classTable->lastChar ; currentChar++ ) { + if ( classTable->isVirama(currentChar)) { + virama = currentChar; + break; + } + } + + for ( currentChar = classTable->firstChar ; currentChar <= classTable->lastChar ; currentChar++ ) { + if ( classTable->isConsonant(currentChar)) { + workOutput.reset(); + } + } + + +} + U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/IndicReordering.h b/jdk/src/share/native/sun/font/layout/IndicReordering.h index 1ab14f1bca1..2a5b10e9369 100644 --- a/jdk/src/share/native/sun/font/layout/IndicReordering.h +++ b/jdk/src/share/native/sun/font/layout/IndicReordering.h @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2009 - All Rights Reserved * */ @@ -62,7 +62,8 @@ U_NAMESPACE_BEGIN #define CC_SPLIT_VOWEL_PIECE_3 12U #define CC_VIRAMA 13U #define CC_ZERO_WIDTH_MARK 14U -#define CC_COUNT 15U +#define CC_AL_LAKUNA 15U +#define CC_COUNT 16U // Character class flags #define CF_CLASS_MASK 0x0000FFFFU @@ -74,6 +75,7 @@ U_NAMESPACE_BEGIN #define CF_BELOW_BASE 0x10000000U #define CF_POST_BASE 0x08000000U #define CF_LENGTH_MARK 0x04000000U +#define CF_PRE_BASE 0x02000000U #define CF_POS_BEFORE 0x00300000U #define CF_POS_BELOW 0x00200000U @@ -89,6 +91,7 @@ U_NAMESPACE_BEGIN #define SF_REPH_AFTER_BELOW 0x40000000U #define SF_EYELASH_RA 0x20000000U #define SF_MPRE_FIXUP 0x10000000U +#define SF_FILTER_ZERO_WIDTH 0x08000000U #define SF_POST_BASE_LIMIT_MASK 0x0000FFFFU #define SF_NO_POST_BASE_LIMIT 0x00007FFFU @@ -98,6 +101,15 @@ typedef LEUnicode SplitMatra[3]; class MPreFixups; class LEGlyphStorage; +// Dynamic Properties ( v2 fonts only ) +typedef le_uint32 DynamicProperties; + +#define DP_REPH 0x80000000U +#define DP_HALF 0x40000000U +#define DP_PREF 0x20000000U +#define DP_BLWF 0x10000000U +#define DP_PSTF 0x08000000U + struct IndicClassTable { typedef le_uint32 CharClass; @@ -111,6 +123,7 @@ struct IndicClassTable const SplitMatra *splitMatraTable; inline le_int32 getWorstCaseExpansion() const; + inline le_bool getFilterZeroWidth() const; CharClass getCharClass(LEUnicode ch) const; @@ -121,6 +134,7 @@ struct IndicClassTable inline le_bool isConsonant(LEUnicode ch) const; inline le_bool isReph(LEUnicode ch) const; inline le_bool isVirama(LEUnicode ch) const; + inline le_bool isAlLakuna(LEUnicode ch) const; inline le_bool isNukta(LEUnicode ch) const; inline le_bool isVattu(LEUnicode ch) const; inline le_bool isMatra(LEUnicode ch) const; @@ -129,12 +143,15 @@ struct IndicClassTable inline le_bool hasPostOrBelowBaseForm(LEUnicode ch) const; inline le_bool hasPostBaseForm(LEUnicode ch) const; inline le_bool hasBelowBaseForm(LEUnicode ch) const; + inline le_bool hasAboveBaseForm(LEUnicode ch) const; + inline le_bool hasPreBaseForm(LEUnicode ch) const; inline static le_bool isVowelModifier(CharClass charClass); inline static le_bool isStressMark(CharClass charClass); inline static le_bool isConsonant(CharClass charClass); inline static le_bool isReph(CharClass charClass); inline static le_bool isVirama(CharClass charClass); + inline static le_bool isAlLakuna(CharClass charClass); inline static le_bool isNukta(CharClass charClass); inline static le_bool isVattu(CharClass charClass); inline static le_bool isMatra(CharClass charClass); @@ -143,6 +160,8 @@ struct IndicClassTable inline static le_bool hasPostOrBelowBaseForm(CharClass charClass); inline static le_bool hasPostBaseForm(CharClass charClass); inline static le_bool hasBelowBaseForm(CharClass charClass); + inline static le_bool hasAboveBaseForm(CharClass charClass); + inline static le_bool hasPreBaseForm(CharClass charClass); static const IndicClassTable *getScriptClassTable(le_int32 scriptCode); }; @@ -151,14 +170,27 @@ class IndicReordering /* not : public UObject because all methods are static */ public: static le_int32 getWorstCaseExpansion(le_int32 scriptCode); + static le_bool getFilterZeroWidth(le_int32 scriptCode); + static le_int32 reorder(const LEUnicode *theChars, le_int32 charCount, le_int32 scriptCode, LEUnicode *outChars, LEGlyphStorage &glyphStorage, - MPreFixups **outMPreFixups); + MPreFixups **outMPreFixups, LEErrorCode& success); - static void adjustMPres(MPreFixups *mpreFixups, LEGlyphStorage &glyphStorage); + static void adjustMPres(MPreFixups *mpreFixups, LEGlyphStorage &glyphStorage, LEErrorCode& success); + + static le_int32 v2process(const LEUnicode *theChars, le_int32 charCount, le_int32 scriptCode, + LEUnicode *outChars, LEGlyphStorage &glyphStorage); static const FeatureMap *getFeatureMap(le_int32 &count); + static const FeatureMap *getv2FeatureMap(le_int32 &count); + + static void applyPresentationForms(LEGlyphStorage &glyphStorage, le_int32 count); + + static void finalReordering(LEGlyphStorage &glyphStorage, le_int32 count); + + static void getDynamicProperties(DynamicProperties *dProps, const IndicClassTable *classTable); + private: // do not instantiate IndicReordering(); @@ -172,6 +204,11 @@ inline le_int32 IndicClassTable::getWorstCaseExpansion() const return worstCaseExpansion; } +inline le_bool IndicClassTable::getFilterZeroWidth() const +{ + return (scriptFlags & SF_FILTER_ZERO_WIDTH) != 0; +} + inline const SplitMatra *IndicClassTable::getSplitMatra(CharClass charClass) const { le_int32 index = (charClass & CF_INDEX_MASK) >> CF_INDEX_SHIFT; @@ -209,6 +246,11 @@ inline le_bool IndicClassTable::isVirama(CharClass charClass) return (charClass & CF_CLASS_MASK) == CC_VIRAMA; } +inline le_bool IndicClassTable::isAlLakuna(CharClass charClass) +{ + return (charClass & CF_CLASS_MASK) == CC_AL_LAKUNA; +} + inline le_bool IndicClassTable::isVattu(CharClass charClass) { return (charClass & CF_VATTU) != 0; @@ -241,11 +283,21 @@ inline le_bool IndicClassTable::hasPostBaseForm(CharClass charClass) return (charClass & CF_POST_BASE) != 0; } +inline le_bool IndicClassTable::hasPreBaseForm(CharClass charClass) +{ + return (charClass & CF_PRE_BASE) != 0; +} + inline le_bool IndicClassTable::hasBelowBaseForm(CharClass charClass) { return (charClass & CF_BELOW_BASE) != 0; } +inline le_bool IndicClassTable::hasAboveBaseForm(CharClass charClass) +{ + return ((charClass & CF_POS_MASK) == CF_POS_ABOVE); +} + inline le_bool IndicClassTable::isVowelModifier(LEUnicode ch) const { return isVowelModifier(getCharClass(ch)); @@ -271,6 +323,11 @@ inline le_bool IndicClassTable::isVirama(LEUnicode ch) const return isVirama(getCharClass(ch)); } +inline le_bool IndicClassTable::isAlLakuna(LEUnicode ch) const +{ + return isAlLakuna(getCharClass(ch)); +} + inline le_bool IndicClassTable::isNukta(LEUnicode ch) const { return isNukta(getCharClass(ch)); @@ -311,5 +368,14 @@ inline le_bool IndicClassTable::hasBelowBaseForm(LEUnicode ch) const return hasBelowBaseForm(getCharClass(ch)); } +inline le_bool IndicClassTable::hasPreBaseForm(LEUnicode ch) const +{ + return hasPreBaseForm(getCharClass(ch)); +} + +inline le_bool IndicClassTable::hasAboveBaseForm(LEUnicode ch) const +{ + return hasAboveBaseForm(getCharClass(ch)); +} U_NAMESPACE_END #endif diff --git a/jdk/src/share/native/sun/font/layout/KernTable.cpp b/jdk/src/share/native/sun/font/layout/KernTable.cpp index 1120ac19c86..8d368211309 100644 --- a/jdk/src/share/native/sun/font/layout/KernTable.cpp +++ b/jdk/src/share/native/sun/font/layout/KernTable.cpp @@ -26,7 +26,7 @@ /* * * - * (C) Copyright IBM Corp. 2004-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 2004-2010 - All Rights Reserved * */ @@ -35,6 +35,7 @@ #include "LEGlyphStorage.h" #include "LESwaps.h" +#include "OpenTypeUtilities.h" #include @@ -91,8 +92,8 @@ struct KernTableHeader { * TODO: support multiple subtables * TODO: respect header flags */ -KernTable::KernTable(const LEFontInstance* font, const void* tableData) - : pairs(0), font(font) +KernTable::KernTable(const LEFontInstance* font_, const void* tableData) + : pairs(0), font(font_) { const KernTableHeader* header = (const KernTableHeader*)tableData; if (header == 0) { @@ -120,10 +121,18 @@ KernTable::KernTable(const LEFontInstance* font, const void* tableData) coverage = SWAPW(subhead->coverage); if (coverage & COVERAGE_HORIZONTAL) { // only handle horizontal kerning const Subtable_0* table = (const Subtable_0*)((char*)subhead + KERN_SUBTABLE_HEADER_SIZE); - nPairs = SWAPW(table->nPairs); - searchRange = SWAPW(table->searchRange) / KERN_PAIRINFO_SIZE ; + + nPairs = SWAPW(table->nPairs); + +#if 0 // some old fonts have bad values here... + searchRange = SWAPW(table->searchRange); entrySelector = SWAPW(table->entrySelector); - rangeShift = SWAPW(table->rangeShift) / KERN_PAIRINFO_SIZE; + rangeShift = SWAPW(table->rangeShift); +#else + entrySelector = OpenTypeUtilities::highBit(nPairs); + searchRange = (1 << entrySelector) * KERN_PAIRINFO_SIZE; + rangeShift = (nPairs * KERN_PAIRINFO_SIZE) - searchRange; +#endif pairs = (PairInfo*)font->getKernPairs(); if (pairs == NULL) { diff --git a/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.cpp index c007e9887ba..d1f0674ebf4 100644 --- a/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.cpp +++ b/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.cpp @@ -25,7 +25,7 @@ /* - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved * * This file is a modification of the ICU file IndicLayoutEngine.cpp * by Jens Herden and Javier Sola for Khmer language @@ -43,16 +43,16 @@ U_NAMESPACE_BEGIN UOBJECT_DEFINE_RTTI_IMPLEMENTATION(KhmerOpenTypeLayoutEngine) KhmerOpenTypeLayoutEngine::KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) - : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable) + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success) + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success) { fFeatureMap = KhmerReordering::getFeatureMap(fFeatureMapCount); fFeatureOrder = TRUE; } KhmerOpenTypeLayoutEngine::KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags) - : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags) + le_int32 typoFlags, LEErrorCode &success) + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success) { fFeatureMap = KhmerReordering::getFeatureMap(fFeatureMapCount); fFeatureOrder = TRUE; diff --git a/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.h b/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.h index 713884bcd9b..602d8563a33 100644 --- a/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.h +++ b/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.h @@ -26,7 +26,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved * * This file is a modification of the ICU file IndicLayoutEngine.h * by Jens Herden and Javier Sola for Khmer language @@ -72,8 +72,9 @@ public: * * @param fontInstance - the font * @param scriptCode - the script - * @param languageCode - the language + * @param langaugeCode - the language * @param gsubTable - the GSUB table + * @param success - set to an error code if the operation fails * * @see LayoutEngine::layoutEngineFactory * @see OpenTypeLayoutEngine @@ -82,7 +83,7 @@ public: * @internal */ KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success); /** * This constructor is used when the font requires a "canned" GSUB table which can't be known @@ -91,6 +92,7 @@ public: * @param fontInstance - the font * @param scriptCode - the script * @param langaugeCode - the language + * @param success - set to an error code if the operation fails * * @see OpenTypeLayoutEngine * @see ScriptAndLangaugeTags.h for script and language codes @@ -98,7 +100,7 @@ public: * @internal */ KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags); + le_int32 typoFlags, LEErrorCode &success); /** * The destructor, virtual for correct polymorphic invocation. diff --git a/jdk/src/share/native/sun/font/layout/KhmerReordering.cpp b/jdk/src/share/native/sun/font/layout/KhmerReordering.cpp index cd869ab2880..ea8fcf51ec2 100644 --- a/jdk/src/share/native/sun/font/layout/KhmerReordering.cpp +++ b/jdk/src/share/native/sun/font/layout/KhmerReordering.cpp @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved * * This file is a modification of the ICU file IndicReordering.cpp * by Jens Herden and Javier Sola for Khmer language @@ -149,8 +149,9 @@ const KhmerClassTable *KhmerClassTable::getKhmerClassTable() -class ReorderingOutput : public UMemory { +class KhmerReorderingOutput : public UMemory { private: + le_int32 fSyllableCount; le_int32 fOutIndex; LEUnicode *fOutChars; @@ -158,17 +159,22 @@ private: public: - ReorderingOutput(LEUnicode *outChars, LEGlyphStorage &glyphStorage) - : fOutIndex(0), fOutChars(outChars), fGlyphStorage(glyphStorage) + KhmerReorderingOutput(LEUnicode *outChars, LEGlyphStorage &glyphStorage) + : fSyllableCount(0), fOutIndex(0), fOutChars(outChars), fGlyphStorage(glyphStorage) { // nothing else to do... } - ~ReorderingOutput() + ~KhmerReorderingOutput() { // nothing to do here... } + void reset() + { + fSyllableCount += 1; + } + void writeChar(LEUnicode ch, le_uint32 charIndex, FeatureMask charFeatures) { LEErrorCode success = LE_NO_ERROR; @@ -176,7 +182,7 @@ public: fOutChars[fOutIndex] = ch; fGlyphStorage.setCharIndex(fOutIndex, charIndex, success); - fGlyphStorage.setAuxData(fOutIndex, charFeatures, success); + fGlyphStorage.setAuxData(fOutIndex, charFeatures | (fSyllableCount & LE_GLYPH_GROUP_MASK), success); fOutIndex += 1; } @@ -328,12 +334,12 @@ static const le_int8 khmerStateTable[][KhmerClassTable::CC_COUNT] = {-1, -1, -1, -1, 12, 13, -1, 10, 16, 17, 1, 14}, // 9 - First consonant or type 3 after ceong {-1, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 10 - Second Coeng (no register shifter before) {-1, -1, -1, -1, 15, -1, -1, -1, 16, 17, 1, 14}, // 11 - Second coeng consonant (or ind. vowel) no register shifter before - {-1, -1, 1, -1, -1, 13, -1, -1, 16, -1, -1, -1}, // 12 - Second ZWNJ before a register shifter + {-1, -1, -1, -1, -1, 13, -1, -1, 16, -1, -1, -1}, // 12 - Second ZWNJ before a register shifter {-1, -1, -1, -1, 15, -1, -1, -1, 16, 17, 1, 14}, // 13 - Second register shifter {-1, -1, -1, -1, -1, -1, -1, -1, 16, -1, -1, -1}, // 14 - ZWJ before vowel {-1, -1, -1, -1, -1, -1, -1, -1, 16, -1, -1, -1}, // 15 - ZWNJ before vowel {-1, -1, -1, -1, -1, -1, -1, -1, -1, 17, 1, 18}, // 16 - dependent vowel - {-1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 18}, // 17 - sign above + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 18}, // 17 - sign above {-1, -1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1}, // 18 - ZWJ after vowel {-1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1}, // 19 - Third coeng {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1}, // 20 - dependent vowel after a Robat @@ -380,7 +386,7 @@ le_int32 KhmerReordering::reorder(const LEUnicode *chars, le_int32 charCount, le { const KhmerClassTable *classTable = KhmerClassTable::getKhmerClassTable(); - ReorderingOutput output(outChars, glyphStorage); + KhmerReorderingOutput output(outChars, glyphStorage); KhmerClassTable::CharClass charClass; le_int32 i, prev = 0, coengRo; @@ -390,6 +396,8 @@ le_int32 KhmerReordering::reorder(const LEUnicode *chars, le_int32 charCount, le while (prev < charCount) { le_int32 syllable = findSyllable(classTable, chars, prev, charCount); + output.reset(); + // write a pre vowel or the pre part of a split vowel first // and look out for coeng + ro. RO is the only vowel of type 2, and // therefore the only one that requires saving space before the base. diff --git a/jdk/src/share/native/sun/font/layout/LEFontInstance.cpp b/jdk/src/share/native/sun/font/layout/LEFontInstance.cpp index b41b45fb6ac..4b7bcd10fa0 100644 --- a/jdk/src/share/native/sun/font/layout/LEFontInstance.cpp +++ b/jdk/src/share/native/sun/font/layout/LEFontInstance.cpp @@ -26,7 +26,7 @@ /* ******************************************************************************* * - * Copyright (C) 1999-2005, International Business Machines + * Copyright (C) 1999-2007, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -45,6 +45,16 @@ U_NAMESPACE_BEGIN UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LEFontInstance) +LECharMapper::~LECharMapper() +{ + // nothing to do. +} + +LEFontInstance::~LEFontInstance() +{ + // nothing to do +} + const LEFontInstance *LEFontInstance::getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit, le_int32 script, LEErrorCode &success) const { @@ -62,7 +72,7 @@ const LEFontInstance *LEFontInstance::getSubFont(const LEUnicode chars[], le_int } void LEFontInstance::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, - le_bool reverse, const LECharMapper *mapper, LEGlyphStorage &glyphStorage) const + le_bool reverse, const LECharMapper *mapper, le_bool filterZeroWidth, LEGlyphStorage &glyphStorage) const { le_int32 i, out = 0, dir = 1; @@ -83,7 +93,7 @@ void LEFontInstance::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, } } - glyphStorage[out] = mapCharToGlyph(code, mapper); + glyphStorage[out] = mapCharToGlyph(code, mapper, filterZeroWidth); if (code >= 0x10000) { i += 1; @@ -93,15 +103,72 @@ void LEFontInstance::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, } LEGlyphID LEFontInstance::mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const +{ + return mapCharToGlyph(ch, mapper, TRUE); +} + +LEGlyphID LEFontInstance::mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const { LEUnicode32 mappedChar = mapper->mapChar(ch); - if (mappedChar == 0xFFFE || mappedChar == 0xFFFF || - mappedChar == 0x200C || mappedChar == 0x200D) { + if (mappedChar == 0xFFFE || mappedChar == 0xFFFF) { return 0xFFFF; } + if (filterZeroWidth && (mappedChar == 0x200C || mappedChar == 0x200D)) { + return canDisplay(mappedChar)? 0x0001 : 0xFFFF; + } + return mapCharToGlyph(mappedChar); } + +le_bool LEFontInstance::canDisplay(LEUnicode32 ch) const +{ + return LE_GET_GLYPH(mapCharToGlyph(ch)) != 0; +} + +float LEFontInstance::xUnitsToPoints(float xUnits) const +{ + return (xUnits * getXPixelsPerEm()) / (float) getUnitsPerEM(); +} + +float LEFontInstance::yUnitsToPoints(float yUnits) const +{ + return (yUnits * getYPixelsPerEm()) / (float) getUnitsPerEM(); +} + +void LEFontInstance::unitsToPoints(LEPoint &units, LEPoint &points) const +{ + points.fX = xUnitsToPoints(units.fX); + points.fY = yUnitsToPoints(units.fY); +} + +float LEFontInstance::xPixelsToUnits(float xPixels) const +{ + return (xPixels * getUnitsPerEM()) / (float) getXPixelsPerEm(); +} + +float LEFontInstance::yPixelsToUnits(float yPixels) const +{ + return (yPixels * getUnitsPerEM()) / (float) getYPixelsPerEm(); +} + +void LEFontInstance::pixelsToUnits(LEPoint &pixels, LEPoint &units) const +{ + units.fX = xPixelsToUnits(pixels.fX); + units.fY = yPixelsToUnits(pixels.fY); +} + +void LEFontInstance::transformFunits(float xFunits, float yFunits, LEPoint &pixels) const +{ + pixels.fX = xUnitsToPoints(xFunits) * getScaleFactorX(); + pixels.fY = yUnitsToPoints(yFunits) * getScaleFactorY(); +} + +le_int32 LEFontInstance::getLineHeight() const +{ + return getAscent() + getDescent() + getLeading(); +} + U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/LEFontInstance.h b/jdk/src/share/native/sun/font/layout/LEFontInstance.h index 5206ce9eacd..1f1d415b820 100644 --- a/jdk/src/share/native/sun/font/layout/LEFontInstance.h +++ b/jdk/src/share/native/sun/font/layout/LEFontInstance.h @@ -26,7 +26,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved * */ @@ -57,7 +57,7 @@ public: * Destructor. * @stable ICU 3.2 */ - virtual inline ~LECharMapper() {}; + virtual ~LECharMapper(); /** * This method does the adjustments. @@ -75,7 +75,7 @@ public: * This is a forward reference to the class which holds the per-glyph * storage. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ class LEGlyphStorage; @@ -101,7 +101,7 @@ class LEGlyphStorage; * methods with some default behavior such as returning constant values, or using the * values from the first subfont. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ class U_LAYOUT_API LEFontInstance : public UObject { @@ -113,7 +113,7 @@ public: * * @stable ICU 2.8 */ - virtual inline ~LEFontInstance() {}; + virtual ~LEFontInstance(); /** * Get a physical font which can render the given text. For composite fonts, @@ -209,7 +209,7 @@ public: * * @stable ICU 3.2 */ - virtual inline le_bool canDisplay(LEUnicode32 ch) const; + virtual le_bool canDisplay(LEUnicode32 ch) const; /** * This method returns the number of design units in @@ -237,13 +237,31 @@ public: * @param count - the number of characters * @param reverse - if TRUE, store the glyph indices in reverse order. * @param mapper - the character mapper. + * @param filterZeroWidth - TRUE if ZWJ / ZWNJ characters should map to a glyph w/ no contours. * @param glyphStorage - the object which contains the output glyph array * * @see LECharMapper * - * @draft ICU 3.0 + * @stable ICU 3.6 */ - virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, const LECharMapper *mapper, LEGlyphStorage &glyphStorage) const; + virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, const LECharMapper *mapper, le_bool filterZeroWidth, LEGlyphStorage &glyphStorage) const; + + /** + * This method maps a single character to a glyph index, using the + * font's character to glyph map. The default implementation of this + * method calls the mapper, and then calls mapCharToGlyph(mappedCh). + * + * @param ch - the character + * @param mapper - the character mapper + * @param filterZeroWidth - TRUE if ZWJ / ZWNJ characters should map to a glyph w/ no contours. + * + * @return the glyph index + * + * @see LECharMapper + * + * @stable ICU 3.6 + */ + virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const; /** * This method maps a single character to a glyph index, using the @@ -335,7 +353,7 @@ public: * * @stable ICU 3.2 */ - virtual inline float xUnitsToPoints(float xUnits) const; + virtual float xUnitsToPoints(float xUnits) const; /** * This method converts font design units in the @@ -347,7 +365,7 @@ public: * * @stable ICU 3.2 */ - virtual inline float yUnitsToPoints(float yUnits) const; + virtual float yUnitsToPoints(float yUnits) const; /** * This method converts font design units to points. @@ -357,7 +375,7 @@ public: * * @stable ICU 3.2 */ - virtual inline void unitsToPoints(LEPoint &units, LEPoint &points) const; + virtual void unitsToPoints(LEPoint &units, LEPoint &points) const; /** * This method converts pixels in the @@ -369,7 +387,7 @@ public: * * @stable ICU 3.2 */ - virtual inline float xPixelsToUnits(float xPixels) const; + virtual float xPixelsToUnits(float xPixels) const; /** * This method converts pixels in the @@ -381,7 +399,7 @@ public: * * @stable ICU 3.2 */ - virtual inline float yPixelsToUnits(float yPixels) const; + virtual float yPixelsToUnits(float yPixels) const; /** * This method converts pixels to font design units. @@ -391,7 +409,7 @@ public: * * @stable ICU 3.2 */ - virtual inline void pixelsToUnits(LEPoint &pixels, LEPoint &units) const; + virtual void pixelsToUnits(LEPoint &pixels, LEPoint &units) const; /** * Get the X scale factor from the font's transform. The default @@ -433,7 +451,7 @@ public: * * @stable ICU 3.2 */ - virtual inline void transformFunits(float xFunits, float yFunits, LEPoint &pixels) const; + virtual void transformFunits(float xFunits, float yFunits, LEPoint &pixels) const; /** * This is a convenience method used to convert @@ -523,49 +541,6 @@ public: }; -inline le_bool LEFontInstance::canDisplay(LEUnicode32 ch) const -{ - return LE_GET_GLYPH(mapCharToGlyph(ch)) != 0; -} - -inline float LEFontInstance::xUnitsToPoints(float xUnits) const -{ - return (xUnits * getXPixelsPerEm()) / (float) getUnitsPerEM(); -} - -inline float LEFontInstance::yUnitsToPoints(float yUnits) const -{ - return (yUnits * getYPixelsPerEm()) / (float) getUnitsPerEM(); -} - -inline void LEFontInstance::unitsToPoints(LEPoint &units, LEPoint &points) const -{ - points.fX = xUnitsToPoints(units.fX); - points.fY = yUnitsToPoints(units.fY); -} - -inline float LEFontInstance::xPixelsToUnits(float xPixels) const -{ - return (xPixels * getUnitsPerEM()) / (float) getXPixelsPerEm(); -} - -inline float LEFontInstance::yPixelsToUnits(float yPixels) const -{ - return (yPixels * getUnitsPerEM()) / (float) getYPixelsPerEm(); -} - -inline void LEFontInstance::pixelsToUnits(LEPoint &pixels, LEPoint &units) const -{ - units.fX = xPixelsToUnits(pixels.fX); - units.fY = yPixelsToUnits(pixels.fY); -} - -inline void LEFontInstance::transformFunits(float xFunits, float yFunits, LEPoint &pixels) const -{ - pixels.fX = xUnitsToPoints(xFunits) * getScaleFactorX(); - pixels.fY = yUnitsToPoints(yFunits) * getScaleFactorY(); -} - inline float LEFontInstance::fixedToFloat(le_int32 fixed) { return (float) (fixed / 65536.0); @@ -576,11 +551,6 @@ inline le_int32 LEFontInstance::floatToFixed(float theFloat) return (le_int32) (theFloat * 65536.0); } -inline le_int32 LEFontInstance::getLineHeight() const -{ - return getAscent() + getDescent() + getLeading(); -} - U_NAMESPACE_END #endif diff --git a/jdk/src/share/native/sun/font/layout/LEGlyphStorage.cpp b/jdk/src/share/native/sun/font/layout/LEGlyphStorage.cpp index cb3e1c81a09..be5f0831b8e 100644 --- a/jdk/src/share/native/sun/font/layout/LEGlyphStorage.cpp +++ b/jdk/src/share/native/sun/font/layout/LEGlyphStorage.cpp @@ -25,7 +25,7 @@ /* ********************************************************************** - * Copyright (C) 1998-2005, International Business Machines + * Copyright (C) 1998-2009, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** */ @@ -38,6 +38,11 @@ U_NAMESPACE_BEGIN UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LEGlyphStorage) +LEInsertionCallback::~LEInsertionCallback() +{ + // nothing to do... +} + LEGlyphStorage::LEGlyphStorage() : fGlyphCount(0), fGlyphs(NULL), fCharIndices(NULL), fPositions(NULL), fAuxData(NULL), fInsertionList(NULL), fSrcIndex(0), fDestIndex(0) @@ -129,8 +134,18 @@ void LEGlyphStorage::allocateGlyphArray(le_int32 initialGlyphCount, le_bool righ if (fInsertionList == NULL) { // FIXME: check this for failure? fInsertionList = new LEInsertionList(rightToLeft); + if (fInsertionList == NULL) { + LE_DELETE_ARRAY(fCharIndices); + fCharIndices = NULL; + + LE_DELETE_ARRAY(fGlyphs); + fGlyphs = NULL; + + success = LE_MEMORY_ALLOCATION_ERROR; + return; } } +} // FIXME: do we want to initialize the positions to [0, 0]? le_int32 LEGlyphStorage::allocatePositions(LEErrorCode &success) @@ -139,6 +154,11 @@ le_int32 LEGlyphStorage::allocatePositions(LEErrorCode &success) return -1; } + if (fPositions != NULL) { + success = LE_INTERNAL_ERROR; + return -1; + } + fPositions = LE_NEW_ARRAY(float, 2 * (fGlyphCount + 1)); if (fPositions == NULL) { @@ -156,6 +176,11 @@ le_int32 LEGlyphStorage::allocateAuxData(LEErrorCode &success) return -1; } + if (fAuxData != NULL) { + success = LE_INTERNAL_ERROR; + return -1; + } + fAuxData = LE_NEW_ARRAY(le_uint32, fGlyphCount); if (fAuxData == NULL) { @@ -510,10 +535,49 @@ void LEGlyphStorage::adoptGlyphCount(le_int32 newGlyphCount) fGlyphCount = newGlyphCount; } -// FIXME: add error checking? +// Move a glyph to a different position in the LEGlyphStorage ( used for Indic v2 processing ) + +void LEGlyphStorage::moveGlyph(le_int32 fromPosition, le_int32 toPosition, le_uint32 marker ) +{ + + LEErrorCode success = LE_NO_ERROR; + + LEGlyphID holdGlyph = getGlyphID(fromPosition,success); + le_int32 holdCharIndex = getCharIndex(fromPosition,success); + le_uint32 holdAuxData = getAuxData(fromPosition,success); + + if ( fromPosition < toPosition ) { + for ( le_int32 i = fromPosition ; i < toPosition ; i++ ) { + setGlyphID(i,getGlyphID(i+1,success),success); + setCharIndex(i,getCharIndex(i+1,success),success); + setAuxData(i,getAuxData(i+1,success),success); + } + } else { + for ( le_int32 i = toPosition ; i > fromPosition ; i-- ) { + setGlyphID(i,getGlyphID(i-1,success),success); + setCharIndex(i,getCharIndex(i-1,success),success); + setAuxData(i,getAuxData(i-1,success),success); + + } + } + + setGlyphID(toPosition,holdGlyph,success); + setCharIndex(toPosition,holdCharIndex,success); + setAuxData(toPosition,holdAuxData | marker,success); + +} + +// Glue code for existing stable API LEGlyphID *LEGlyphStorage::insertGlyphs(le_int32 atIndex, le_int32 insertCount) { - return fInsertionList->insert(atIndex, insertCount); + LEErrorCode ignored = LE_NO_LAYOUT_ERROR; + return insertGlyphs(atIndex, insertCount, ignored); +} + +// FIXME: add error checking? +LEGlyphID *LEGlyphStorage::insertGlyphs(le_int32 atIndex, le_int32 insertCount, LEErrorCode& success) +{ + return fInsertionList->insert(atIndex, insertCount, success); } le_int32 LEGlyphStorage::applyInsertions() @@ -526,11 +590,27 @@ le_int32 LEGlyphStorage::applyInsertions() le_int32 newGlyphCount = fGlyphCount + growAmount; - fGlyphs = (LEGlyphID *) LE_GROW_ARRAY(fGlyphs, newGlyphCount); - fCharIndices = (le_int32 *) LE_GROW_ARRAY(fCharIndices, newGlyphCount); + LEGlyphID *newGlyphs = (LEGlyphID *) LE_GROW_ARRAY(fGlyphs, newGlyphCount); + if (newGlyphs == NULL) { + // Could not grow the glyph array + return fGlyphCount; + } + fGlyphs = newGlyphs; + + le_int32 *newCharIndices = (le_int32 *) LE_GROW_ARRAY(fCharIndices, newGlyphCount); + if (newCharIndices == NULL) { + // Could not grow the glyph array + return fGlyphCount; + } + fCharIndices = newCharIndices; if (fAuxData != NULL) { - fAuxData = (le_uint32 *) LE_GROW_ARRAY(fAuxData, newGlyphCount); + le_uint32 *newAuxData = (le_uint32 *) LE_GROW_ARRAY(fAuxData, newGlyphCount); + if (newAuxData == NULL) { + // could not grow the aux data array + return fGlyphCount; + } + fAuxData = (le_uint32 *)newAuxData; } fSrcIndex = fGlyphCount - 1; diff --git a/jdk/src/share/native/sun/font/layout/LEGlyphStorage.h b/jdk/src/share/native/sun/font/layout/LEGlyphStorage.h index 0851c4158b5..71869ebb075 100644 --- a/jdk/src/share/native/sun/font/layout/LEGlyphStorage.h +++ b/jdk/src/share/native/sun/font/layout/LEGlyphStorage.h @@ -25,7 +25,7 @@ /* ********************************************************************** - * Copyright (C) 1998-2005, International Business Machines + * Copyright (C) 1998-2010, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** */ @@ -54,7 +54,7 @@ U_NAMESPACE_BEGIN * * @see LEInsertionList.h * - * @draft ICU 3.6 + * @stable ICU 3.6 */ class U_LAYOUT_API LEGlyphStorage : public UObject, protected LEInsertionCallback { @@ -130,7 +130,7 @@ protected: * * @see LEInsertionList.h * - * @draft ICU 3.0 + * @stable ICU 3.0 */ virtual le_bool applyInsertion(le_int32 atPosition, le_int32 count, LEGlyphID newGlyphs[]); @@ -141,14 +141,14 @@ public: * allocateGlyphArray, allocatePositions and allocateAuxData * to allocate the data. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ LEGlyphStorage(); /** * The destructor. This will deallocate all of the arrays. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ ~LEGlyphStorage(); @@ -157,7 +157,7 @@ public: * * @return the number of glyphs in the glyph array * - * @draft ICU 3.0 + * @stable ICU 3.0 */ inline le_int32 getGlyphCount() const; @@ -169,7 +169,7 @@ public: * @param glyphs - the destiniation glyph array * @param success - set to an error code if the operation fails * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const; @@ -183,7 +183,7 @@ public: * @param extraBits - this value will be ORed with each glyph index * @param success - set to an error code if the operation fails * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const; @@ -195,7 +195,7 @@ public: * @param charIndices - the destiniation character index array * @param success - set to an error code if the operation fails * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const; @@ -208,7 +208,7 @@ public: * @param indexBase - an offset which will be added to each index * @param success - set to an error code if the operation fails * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const; @@ -221,7 +221,7 @@ public: * @param positions - the destiniation position array * @param success - set to an error code if the operation fails * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void getGlyphPositions(float positions[], LEErrorCode &success) const; @@ -237,7 +237,7 @@ public: * @param y - the glyph's Y position * @param success - set to an error code if the operation fails * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const; @@ -251,7 +251,7 @@ public: * @param success set to an error code if the storage cannot be allocated of if the initial * glyph count is not positive. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void allocateGlyphArray(le_int32 initialGlyphCount, le_bool rightToLeft, LEErrorCode &success); @@ -263,7 +263,7 @@ public: * * @return the number of X, Y position pairs allocated. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ le_int32 allocatePositions(LEErrorCode &success); @@ -274,7 +274,7 @@ public: * * @return the size of the auxillary data array. * - * @draft ICU 3.6 + * @stable ICU 3.6 */ le_int32 allocateAuxData(LEErrorCode &success); @@ -284,7 +284,7 @@ public: * @param auxData the auxillary data array will be copied to this address * @param success set to an error code if the data cannot be copied * - * @draft ICU 3.6 + * @stable ICU 3.6 */ void getAuxData(le_uint32 auxData[], LEErrorCode &success) const; @@ -296,7 +296,7 @@ public: * * @return the glyph ID * - * @draft ICU 3.0 + * @stable ICU 3.0 */ LEGlyphID getGlyphID(le_int32 glyphIndex, LEErrorCode &success) const; @@ -308,7 +308,7 @@ public: * * @return the character index * - * @draft ICU 3.0 + * @stable ICU 3.0 */ le_int32 getCharIndex(le_int32 glyphIndex, LEErrorCode &success) const; @@ -321,7 +321,7 @@ public: * * @return the auxillary data * - * @draft ICU 3.6 + * @stable ICU 3.6 */ le_uint32 getAuxData(le_int32 glyphIndex, LEErrorCode &success) const; @@ -333,7 +333,7 @@ public: * * @return a reference to the given location in the glyph array * - * @draft ICU 3.0 + * @stable ICU 3.0 */ inline LEGlyphID &operator[](le_int32 glyphIndex) const; @@ -346,15 +346,51 @@ public: * * @param atIndex the index of the glyph to be replaced * @param insertCount the number of glyphs to replace it with + * @param success set to an error code if the auxillary data cannot be retrieved. * * @return the address at which to store the replacement glyphs. * - * @see LEInsetionList.h + * @see LEInsertionList.h * - * @draft ICU 3.0 + * @stable ICU 4.2 + */ + LEGlyphID *insertGlyphs(le_int32 atIndex, le_int32 insertCount, LEErrorCode& success); + + /** + * Call this method to replace a single glyph in the glyph array + * with multiple glyphs. This method uses the LEInsertionList + * to do the insertion. It returns the address of storage where the new + * glyph IDs can be stored. They will not actually be inserted into the + * glyph array until applyInsertions is called. + * + * Note: Don't use this version, use the other version of this function which has an error code. + * + * @param atIndex the index of the glyph to be replaced + * @param insertCount the number of glyphs to replace it with + * + * @return the address at which to store the replacement glyphs. + * + * @see LEInsertionList.h + * + * @stable ICU 3.0 */ LEGlyphID *insertGlyphs(le_int32 atIndex, le_int32 insertCount); + /** + * This method is used to reposition glyphs during Indic v2 processing. It moves + * all of the relevant glyph information ( glyph, indices, positions, and auxData ), + * from the source position to the target position, and also allows for a marker bit + * to be set in the target glyph's auxData so that it won't be reprocessed later in the + * cycle. + * + * @param fromPosition - position of the glyph to be moved + * @param toPosition - target position of the glyph + * @param marker marker bit + * + * @stable ICU 4.2 + */ + void moveGlyph(le_int32 fromPosition, le_int32 toPosition, le_uint32 marker); + /** * This method causes all of the glyph insertions recorded by * insertGlyphs to be applied to the glyph array. The @@ -365,7 +401,7 @@ public: * * @see LEInsertionList.h * - * @draft ICU 3.0 + * @stable ICU 3.0 */ le_int32 applyInsertions(); @@ -376,7 +412,7 @@ public: * @param glyphID the new glyph ID * @param success will be set to an error code if the glyph ID cannot be set. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void setGlyphID(le_int32 glyphIndex, LEGlyphID glyphID, LEErrorCode &success); @@ -387,7 +423,7 @@ public: * @param charIndex the new char index * @param success will be set to an error code if the char index cannot be set. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void setCharIndex(le_int32 glyphIndex, le_int32 charIndex, LEErrorCode &success); @@ -399,7 +435,7 @@ public: * @param y the new Y position * @param success will be set to an error code if the position cannot be set. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void setPosition(le_int32 glyphIndex, float x, float y, LEErrorCode &success); @@ -411,7 +447,7 @@ public: * @param yAdjust the adjustment to the glyph's Y position * @param success will be set to an error code if the glyph's position cannot be adjusted. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void adjustPosition(le_int32 glyphIndex, float xAdjust, float yAdjust, LEErrorCode &success); @@ -422,7 +458,7 @@ public: * @param auxData the new auxillary data * @param success will be set to an error code if the auxillary data cannot be set. * - * @draft ICU 3.6 + * @stable ICU 3.6 */ void setAuxData(le_int32 glyphIndex, le_uint32 auxData, LEErrorCode &success); @@ -434,7 +470,7 @@ public: * @param from the LEGlyphStorage object from which * to get the new glyph array. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void adoptGlyphArray(LEGlyphStorage &from); @@ -446,7 +482,7 @@ public: * @param from the LEGlyphStorage object from which * to get the new char indices array. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void adoptCharIndicesArray(LEGlyphStorage &from); @@ -458,7 +494,7 @@ public: * @param from the LEGlyphStorage object from which * to get the new position array. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void adoptPositionArray(LEGlyphStorage &from); @@ -470,7 +506,7 @@ public: * @param from the LEGlyphStorage object from which * to get the new auxillary data array. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void adoptAuxDataArray(LEGlyphStorage &from); @@ -481,7 +517,7 @@ public: * @param from the LEGlyphStorage object from which * to get the new glyph count. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void adoptGlyphCount(LEGlyphStorage &from); @@ -490,7 +526,7 @@ public: * * @param newGlyphCount the new glyph count. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void adoptGlyphCount(le_int32 newGlyphCount); @@ -500,21 +536,21 @@ public: * to layout a different characer array. (This method is also called * by the destructor) * - * @draft ICU 3.0 + * @stable ICU 3.0 */ void reset(); /** * ICU "poor man's RTTI", returns a UClassID for the actual class. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ virtual UClassID getDynamicClassID() const; /** * ICU "poor man's RTTI", returns a UClassID for this class. * - * @draft ICU 3.0 + * @stable ICU 3.0 */ static UClassID getStaticClassID(); }; diff --git a/jdk/src/share/native/sun/font/layout/LEInsertionList.cpp b/jdk/src/share/native/sun/font/layout/LEInsertionList.cpp index c92690a774a..c88436c0489 100644 --- a/jdk/src/share/native/sun/font/layout/LEInsertionList.cpp +++ b/jdk/src/share/native/sun/font/layout/LEInsertionList.cpp @@ -25,7 +25,7 @@ /* ********************************************************************** - * Copyright (C) 1998-2004, International Business Machines + * Copyright (C) 1998-2008, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** */ @@ -76,9 +76,17 @@ le_int32 LEInsertionList::getGrowAmount() return growAmount; } -LEGlyphID *LEInsertionList::insert(le_int32 position, le_int32 count) +LEGlyphID *LEInsertionList::insert(le_int32 position, le_int32 count, LEErrorCode &success) { + if (LE_FAILURE(success)) { + return 0; + } + InsertionRecord *insertion = (InsertionRecord *) LE_NEW_ARRAY(char, sizeof(InsertionRecord) + (count - ANY_NUMBER) * sizeof (LEGlyphID)); + if (insertion == NULL) { + success = LE_MEMORY_ALLOCATION_ERROR; + return 0; + } insertion->position = position; insertion->count = count; diff --git a/jdk/src/share/native/sun/font/layout/LEInsertionList.h b/jdk/src/share/native/sun/font/layout/LEInsertionList.h index d74847a401a..6a48227973e 100644 --- a/jdk/src/share/native/sun/font/layout/LEInsertionList.h +++ b/jdk/src/share/native/sun/font/layout/LEInsertionList.h @@ -25,7 +25,7 @@ /* ********************************************************************** - * Copyright (C) 1998-2004, International Business Machines + * Copyright (C) 1998-2008, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** */ @@ -45,7 +45,7 @@ struct InsertionRecord; * * @internal */ -class LEInsertionCallback +class U_LAYOUT_API LEInsertionCallback { public: /** @@ -62,6 +62,11 @@ public: * @internal */ virtual le_bool applyInsertion(le_int32 atPosition, le_int32 count, LEGlyphID newGlyphs[]) = 0; + + /** + * The destructor + */ + virtual ~LEInsertionCallback(); }; /** @@ -103,13 +108,14 @@ public: * @param position the glyph at this position in the array will be * replaced by the new glyphs. * @param count the number of new glyphs + * @param success set to an error code if the auxillary data cannot be retrieved. * * @return the address of an array in which to store the new glyphs. This will * not be in the glyph array. * * @internal */ - LEGlyphID *insert(le_int32 position, le_int32 count); + LEGlyphID *insert(le_int32 position, le_int32 count, LEErrorCode &success); /** * Return the number of new glyphs that have been inserted. diff --git a/jdk/src/share/native/sun/font/layout/LELanguages.h b/jdk/src/share/native/sun/font/layout/LELanguages.h index a50f6c1cab5..94ce50fc74a 100644 --- a/jdk/src/share/native/sun/font/layout/LELanguages.h +++ b/jdk/src/share/native/sun/font/layout/LELanguages.h @@ -25,12 +25,12 @@ /* * - * (C) Copyright IBM Corp. 1998-2005. All Rights Reserved. + * (C) Copyright IBM Corp. 1998-2010. All Rights Reserved. * * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS * YOU REALLY KNOW WHAT YOU'RE DOING. * - * Generated on: 07/19/2005 01:01:08 PM PDT + * Generated on: 10/26/2010 02:53:33 PM PDT */ #ifndef __LELANGUAGES_H @@ -50,7 +50,7 @@ U_NAMESPACE_BEGIN * this is just a list of languages which the LayoutEngine * supports. * - * @draft ICU 3.4 + * @stable ICU 2.6 */ enum LanguageCodes { @@ -85,7 +85,51 @@ enum LanguageCodes { zhsLanguageCode = 28, zhtLanguageCode = 29, - languageCodeCount = 30 + /** New language codes added 03/13/2008 @stable ICU 4.0 */ + afkLanguageCode = 30, + belLanguageCode = 31, + bgrLanguageCode = 32, + catLanguageCode = 33, + cheLanguageCode = 34, + copLanguageCode = 35, + csyLanguageCode = 36, + danLanguageCode = 37, + deuLanguageCode = 38, + dznLanguageCode = 39, + ellLanguageCode = 40, + engLanguageCode = 41, + espLanguageCode = 42, + etiLanguageCode = 43, + euqLanguageCode = 44, + finLanguageCode = 45, + fraLanguageCode = 46, + gaeLanguageCode = 47, + hauLanguageCode = 48, + hrvLanguageCode = 49, + hunLanguageCode = 50, + hyeLanguageCode = 51, + indLanguageCode = 52, + itaLanguageCode = 53, + khmLanguageCode = 54, + mngLanguageCode = 55, + mtsLanguageCode = 56, + nepLanguageCode = 57, + nldLanguageCode = 58, + pasLanguageCode = 59, + plkLanguageCode = 60, + ptgLanguageCode = 61, + romLanguageCode = 62, + rusLanguageCode = 63, + skyLanguageCode = 64, + slvLanguageCode = 65, + sqiLanguageCode = 66, + srbLanguageCode = 67, + sveLanguageCode = 68, + tibLanguageCode = 69, + trkLanguageCode = 70, + welLanguageCode = 71, + + languageCodeCount = 72 }; U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/LEScripts.h b/jdk/src/share/native/sun/font/layout/LEScripts.h index 1615da95655..ed25b604413 100644 --- a/jdk/src/share/native/sun/font/layout/LEScripts.h +++ b/jdk/src/share/native/sun/font/layout/LEScripts.h @@ -25,40 +25,43 @@ /* * - * (C) Copyright IBM Corp. 1998-2005. All Rights Reserved. + * (C) Copyright IBM Corp. 1998-2010. All Rights Reserved. * * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS * YOU REALLY KNOW WHAT YOU'RE DOING. + * + * Generated on: 10/26/2010 02:53:33 PM PDT */ #ifndef __LESCRIPTS_H #define __LESCRIPTS_H #include "LETypes.h" + /** * \file * \brief C++ API: Constants for Unicode script values */ - U_NAMESPACE_BEGIN /** * Constants for Unicode script values, generated using * ICU4J's UScript class. * - * @draft ICU 3.0 + * @stable ICU 2.2 */ enum ScriptCodes { zyyyScriptCode = 0, - qaaiScriptCode = 1, + zinhScriptCode = 1, + qaaiScriptCode = zinhScriptCode, /* manually added alias, for API stability */ arabScriptCode = 2, armnScriptCode = 3, bengScriptCode = 4, bopoScriptCode = 5, cherScriptCode = 6, - qaacScriptCode = 7, + coptScriptCode = 7, cyrlScriptCode = 8, dsrtScriptCode = 9, devaScriptCode = 10, @@ -91,12 +94,24 @@ enum ScriptCodes { thaaScriptCode = 37, thaiScriptCode = 38, tibtScriptCode = 39, +/** + * @stable ICU 2.6 + */ + cansScriptCode = 40, +/** + * @stable ICU 2.2 + */ + yiiiScriptCode = 41, tglgScriptCode = 42, hanoScriptCode = 43, buhdScriptCode = 44, tagbScriptCode = 45, +/** + * @stable ICU 2.6 + */ + braiScriptCode = 46, cprtScriptCode = 47, limbScriptCode = 48, @@ -105,9 +120,129 @@ enum ScriptCodes { shawScriptCode = 51, taleScriptCode = 52, ugarScriptCode = 53, - hrktScriptCode = 54, +/** + * @stable ICU 3.0 + */ - scriptCodeCount = 55 + hrktScriptCode = 54, +/** + * @stable ICU 3.4 + */ + + bugiScriptCode = 55, + glagScriptCode = 56, + kharScriptCode = 57, + syloScriptCode = 58, + taluScriptCode = 59, + tfngScriptCode = 60, + xpeoScriptCode = 61, +/** + * @stable ICU 3.6 + */ + + baliScriptCode = 62, + batkScriptCode = 63, + blisScriptCode = 64, + brahScriptCode = 65, + chamScriptCode = 66, + cirtScriptCode = 67, + cyrsScriptCode = 68, + egydScriptCode = 69, + egyhScriptCode = 70, + egypScriptCode = 71, + geokScriptCode = 72, + hansScriptCode = 73, + hantScriptCode = 74, + hmngScriptCode = 75, + hungScriptCode = 76, + indsScriptCode = 77, + javaScriptCode = 78, + kaliScriptCode = 79, + latfScriptCode = 80, + latgScriptCode = 81, + lepcScriptCode = 82, + linaScriptCode = 83, + mandScriptCode = 84, + mayaScriptCode = 85, + meroScriptCode = 86, + nkooScriptCode = 87, + orkhScriptCode = 88, + permScriptCode = 89, + phagScriptCode = 90, + phnxScriptCode = 91, + plrdScriptCode = 92, + roroScriptCode = 93, + saraScriptCode = 94, + syreScriptCode = 95, + syrjScriptCode = 96, + syrnScriptCode = 97, + tengScriptCode = 98, + vaiiScriptCode = 99, + vispScriptCode = 100, + xsuxScriptCode = 101, + zxxxScriptCode = 102, + zzzzScriptCode = 103, +/** + * @stable ICU 3.8 + */ + + cariScriptCode = 104, + jpanScriptCode = 105, + lanaScriptCode = 106, + lyciScriptCode = 107, + lydiScriptCode = 108, + olckScriptCode = 109, + rjngScriptCode = 110, + saurScriptCode = 111, + sgnwScriptCode = 112, + sundScriptCode = 113, + moonScriptCode = 114, + mteiScriptCode = 115, +/** + * @stable ICU 4.0 + */ + + armiScriptCode = 116, + avstScriptCode = 117, + cakmScriptCode = 118, + koreScriptCode = 119, + kthiScriptCode = 120, + maniScriptCode = 121, + phliScriptCode = 122, + phlpScriptCode = 123, + phlvScriptCode = 124, + prtiScriptCode = 125, + samrScriptCode = 126, + tavtScriptCode = 127, + zmthScriptCode = 128, + zsymScriptCode = 129, +/** + * @stable ICU 4.4 + */ + + bamuScriptCode = 130, + lisuScriptCode = 131, + nkgbScriptCode = 132, + sarbScriptCode = 133, +/** + * @stable ICU 4.6 + */ + + bassScriptCode = 134, + duplScriptCode = 135, + elbaScriptCode = 136, + granScriptCode = 137, + kpelScriptCode = 138, + lomaScriptCode = 139, + mendScriptCode = 140, + mercScriptCode = 141, + narbScriptCode = 142, + nbatScriptCode = 143, + palmScriptCode = 144, + sindScriptCode = 145, + waraScriptCode = 146, + + scriptCodeCount = 147 }; U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/LEStandalone.h b/jdk/src/share/native/sun/font/layout/LEStandalone.h index ecf0410e918..b0ccec6481a 100644 --- a/jdk/src/share/native/sun/font/layout/LEStandalone.h +++ b/jdk/src/share/native/sun/font/layout/LEStandalone.h @@ -26,6 +26,15 @@ #ifndef __LESTANDALONE #define __LESTANDALONE +#ifndef U_COPYRIGHT_STRING +#define U_COPYRIGHT_STRING " (C) Copyright IBM Corp and Others. 1998-2010 - All Rights Reserved" +#endif + +/* ICU Version number */ +#ifndef U_ICU_VERSION +#define U_ICU_VERSION "4.6" +#endif + /* Definitions to make Layout Engine work away from ICU. */ #ifndef U_NAMESPACE_BEGIN #define U_NAMESPACE_BEGIN diff --git a/jdk/src/share/native/sun/font/layout/LESwaps.h b/jdk/src/share/native/sun/font/layout/LESwaps.h index 9bfeacd4e1b..ef59f4a7df3 100644 --- a/jdk/src/share/native/sun/font/layout/LESwaps.h +++ b/jdk/src/share/native/sun/font/layout/LESwaps.h @@ -26,7 +26,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ diff --git a/jdk/src/share/native/sun/font/layout/LETypes.h b/jdk/src/share/native/sun/font/layout/LETypes.h index f0fffad55f2..be0441b538f 100644 --- a/jdk/src/share/native/sun/font/layout/LETypes.h +++ b/jdk/src/share/native/sun/font/layout/LETypes.h @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -472,6 +472,7 @@ enum LEFeatureTags { LE_CALT_FEATURE_TAG = 0x63616C74UL, /**< 'calt' */ LE_CASE_FEATURE_TAG = 0x63617365UL, /**< 'case' */ LE_CCMP_FEATURE_TAG = 0x63636D70UL, /**< 'ccmp' */ + LE_CJCT_FEATURE_TAG = 0x636A6374UL, /**< 'cjct' */ LE_CLIG_FEATURE_TAG = 0x636C6967UL, /**< 'clig' */ LE_CPSP_FEATURE_TAG = 0x63707370UL, /**< 'cpsp' */ LE_CSWH_FEATURE_TAG = 0x63737768UL, /**< 'cswh' */ @@ -535,6 +536,7 @@ enum LEFeatureTags { LE_RAND_FEATURE_TAG = 0x72616E64UL, /**< 'rand' */ LE_RLIG_FEATURE_TAG = 0x726C6967UL, /**< 'rlig' */ LE_RPHF_FEATURE_TAG = 0x72706866UL, /**< 'rphf' */ + LE_RKRF_FEATURE_TAG = 0x726B7266UL, /**< 'rkrf' */ LE_RTBD_FEATURE_TAG = 0x72746264UL, /**< 'rtbd' */ LE_RTLA_FEATURE_TAG = 0x72746C61UL, /**< 'rtla' */ LE_RUBY_FEATURE_TAG = 0x72756279UL, /**< 'ruby' */ diff --git a/jdk/src/share/native/sun/font/layout/LayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/LayoutEngine.cpp index 046b2b28dbd..6b0aa1baa58 100644 --- a/jdk/src/share/native/sun/font/layout/LayoutEngine.cpp +++ b/jdk/src/share/native/sun/font/layout/LayoutEngine.cpp @@ -38,10 +38,11 @@ #include "ArabicLayoutEngine.h" #include "CanonShaping.h" #include "HanLayoutEngine.h" +#include "HangulLayoutEngine.h" #include "IndicLayoutEngine.h" #include "KhmerLayoutEngine.h" #include "ThaiLayoutEngine.h" -//#include "TibetanLayoutEngine.h" +#include "TibetanLayoutEngine.h" #include "GXLayoutEngine.h" #include "ScriptAndLanguageTags.h" #include "CharSubstitutionFilter.h" @@ -59,6 +60,9 @@ U_NAMESPACE_BEGIN +/* Leave this copyright notice here! It needs to go somewhere in this library. */ +static const char copyright[] = U_COPYRIGHT_STRING; + const LEUnicode32 DefaultCharMapper::controlChars[] = { 0x0009, 0x000A, 0x000D, /*0x200C, 0x200D,*/ 0x200E, 0x200F, @@ -96,9 +100,8 @@ LEUnicode32 DefaultCharMapper::mapChar(LEUnicode32 ch) const } if (fFilterControls) { - le_int32 index = OpenTypeUtilities::search((le_uint32)ch, - (le_uint32 *)controlChars, - controlCharsCount); + le_int32 index = OpenTypeUtilities::search((le_uint32)ch, (le_uint32 *)controlChars, controlCharsCount); + if (controlChars[index] == ch) { return 0xFFFF; } @@ -134,56 +137,7 @@ CharSubstitutionFilter::~CharSubstitutionFilter() // nothing to do } - -UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LayoutEngine) - -#define ccmpFeatureTag LE_CCMP_FEATURE_TAG - -#define ccmpFeatureMask 0x80000000UL - -#define canonFeatures (ccmpFeatureMask) - -static const FeatureMap canonFeatureMap[] = -{ - {ccmpFeatureTag, ccmpFeatureMask} -}; - -static const le_int32 canonFeatureMapCount = LE_ARRAY_SIZE(canonFeatureMap); - -LayoutEngine::LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) - : fGlyphStorage(NULL), fFontInstance(fontInstance), fScriptCode(scriptCode), fLanguageCode(languageCode), - fTypoFlags(typoFlags) -{ - fGlyphStorage = new LEGlyphStorage(); -} - -le_int32 LayoutEngine::getGlyphCount() const -{ - return fGlyphStorage->getGlyphCount(); -} - -void LayoutEngine::getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const -{ - fGlyphStorage->getCharIndices(charIndices, indexBase, success); -} - -void LayoutEngine::getCharIndices(le_int32 charIndices[], LEErrorCode &success) const -{ - fGlyphStorage->getCharIndices(charIndices, success); -} - -// Copy the glyphs into caller's (32-bit) glyph array, OR in extraBits -void LayoutEngine::getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const -{ - fGlyphStorage->getGlyphs(glyphs, extraBits, success); -} - -void LayoutEngine::getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const -{ - fGlyphStorage->getGlyphs(glyphs, success); -} - -class CanonMarkFilter : public LEGlyphFilter +class CanonMarkFilter : public UMemory, public LEGlyphFilter { private: const GlyphClassDefinitionTable *classDefTable; @@ -215,6 +169,66 @@ le_bool CanonMarkFilter::accept(LEGlyphID glyph) const return glyphClass != 0; } +UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LayoutEngine) + +#define ccmpFeatureTag LE_CCMP_FEATURE_TAG + +#define ccmpFeatureMask 0x80000000UL + +#define canonFeatures (ccmpFeatureMask) + +static const FeatureMap canonFeatureMap[] = +{ + {ccmpFeatureTag, ccmpFeatureMask} +}; + +static const le_int32 canonFeatureMapCount = LE_ARRAY_SIZE(canonFeatureMap); + +LayoutEngine::LayoutEngine(const LEFontInstance *fontInstance, + le_int32 scriptCode, + le_int32 languageCode, + le_int32 typoFlags, + LEErrorCode &success) + : fGlyphStorage(NULL), fFontInstance(fontInstance), fScriptCode(scriptCode), fLanguageCode(languageCode), + fTypoFlags(typoFlags), fFilterZeroWidth(TRUE) +{ + if (LE_FAILURE(success)) { + return; + } + + fGlyphStorage = new LEGlyphStorage(); + if (fGlyphStorage == NULL) { + success = LE_MEMORY_ALLOCATION_ERROR; +} +} + +le_int32 LayoutEngine::getGlyphCount() const +{ + return fGlyphStorage->getGlyphCount(); +} + +void LayoutEngine::getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const +{ + fGlyphStorage->getCharIndices(charIndices, indexBase, success); +} + +void LayoutEngine::getCharIndices(le_int32 charIndices[], LEErrorCode &success) const +{ + fGlyphStorage->getCharIndices(charIndices, success); +} + +// Copy the glyphs into caller's (32-bit) glyph array, OR in extraBits +void LayoutEngine::getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const +{ + fGlyphStorage->getGlyphs(glyphs, extraBits, success); +} + +void LayoutEngine::getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const +{ + fGlyphStorage->getGlyphs(glyphs, success); +} + + void LayoutEngine::getGlyphPositions(float positions[], LEErrorCode &success) const { fGlyphStorage->getGlyphPositions(positions, success); @@ -244,8 +258,21 @@ le_int32 LayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 off if (canonGSUBTable->coversScript(scriptTag)) { CharSubstitutionFilter *substitutionFilter = new CharSubstitutionFilter(fFontInstance); + if (substitutionFilter == NULL) { + success = LE_MEMORY_ALLOCATION_ERROR; + return 0; + } + const LEUnicode *inChars = &chars[offset]; LEUnicode *reordered = NULL; + LEGlyphStorage fakeGlyphStorage; + + fakeGlyphStorage.allocateGlyphArray(count, rightToLeft, success); + + if (LE_FAILURE(success)) { + delete substitutionFilter; + return 0; + } // This is the cheapest way to get mark reordering only for Hebrew. // We could just do the mark reordering for all scripts, but most @@ -254,18 +281,19 @@ le_int32 LayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 off reordered = LE_NEW_ARRAY(LEUnicode, count); if (reordered == NULL) { + delete substitutionFilter; success = LE_MEMORY_ALLOCATION_ERROR; return 0; } - CanonShaping::reorderMarks(&chars[offset], count, rightToLeft, reordered, glyphStorage); + CanonShaping::reorderMarks(&chars[offset], count, rightToLeft, reordered, fakeGlyphStorage); inChars = reordered; } - glyphStorage.allocateGlyphArray(count, rightToLeft, success); - glyphStorage.allocateAuxData(success); + fakeGlyphStorage.allocateAuxData(success); if (LE_FAILURE(success)) { + delete substitutionFilter; return 0; } @@ -275,21 +303,41 @@ le_int32 LayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 off } for (i = 0; i < count; i += 1, out += dir) { - glyphStorage[out] = (LEGlyphID) inChars[i]; - glyphStorage.setAuxData(out, canonFeatures, success); + fakeGlyphStorage[out] = (LEGlyphID) inChars[i]; + fakeGlyphStorage.setAuxData(out, canonFeatures, success); } if (reordered != NULL) { LE_DELETE_ARRAY(reordered); } - outCharCount = canonGSUBTable->process(glyphStorage, rightToLeft, scriptTag, langSysTag, NULL, substitutionFilter, canonFeatureMap, canonFeatureMapCount, FALSE); + outCharCount = canonGSUBTable->process(fakeGlyphStorage, rightToLeft, scriptTag, langSysTag, NULL, substitutionFilter, canonFeatureMap, canonFeatureMapCount, FALSE, success); - out = (rightToLeft? count - 1 : 0); + if (LE_FAILURE(success)) { + delete substitutionFilter; + return 0; + } + + out = (rightToLeft? outCharCount - 1 : 0); + + /* + * The char indices array in fakeGlyphStorage has the correct mapping + * back to the original input characters. Save it in glyphStorage. The + * subsequent call to glyphStoratge.allocateGlyphArray will keep this + * array rather than allocating and initializing a new one. + */ + glyphStorage.adoptCharIndicesArray(fakeGlyphStorage); outChars = LE_NEW_ARRAY(LEUnicode, outCharCount); + + if (outChars == NULL) { + delete substitutionFilter; + success = LE_MEMORY_ALLOCATION_ERROR; + return 0; + } + for (i = 0; i < outCharCount; i += 1, out += dir) { - outChars[out] = (LEUnicode) LE_GET_GLYPH(glyphStorage[i]); + outChars[out] = (LEUnicode) LE_GET_GLYPH(fakeGlyphStorage[i]); } delete substitutionFilter; @@ -474,7 +522,7 @@ void LayoutEngine::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le DefaultCharMapper charMapper(TRUE, mirror); - fFontInstance->mapCharsToGlyphs(chars, offset, count, reverse, &charMapper, glyphStorage); + fFontInstance->mapCharsToGlyphs(chars, offset, count, reverse, &charMapper, fFilterZeroWidth, glyphStorage); } // Input: characters, font? @@ -494,6 +542,10 @@ le_int32 LayoutEngine::layoutChars(const LEUnicode chars[], le_int32 offset, le_ le_int32 glyphCount; + if (fGlyphStorage->getGlyphCount() > 0) { + fGlyphStorage->reset(); + } + glyphCount = computeGlyphs(chars, offset, count, max, rightToLeft, *fGlyphStorage, success); positionGlyphs(*fGlyphStorage, x, y, success); adjustGlyphPositions(chars, offset, count, rightToLeft, *fGlyphStorage, success); @@ -525,8 +577,15 @@ LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstan LayoutEngine *result = NULL; LETag scriptTag = 0x00000000; LETag languageTag = 0x00000000; + LETag v2ScriptTag = OpenTypeLayoutEngine::getV2ScriptTag(scriptCode); - if (gsubTable != NULL && gsubTable->coversScript(scriptTag = OpenTypeLayoutEngine::getScriptTag(scriptCode))) { + // Right now, only invoke V2 processing for Devanagari. TODO: Allow more V2 scripts as they are + // properly tested. + + if ( v2ScriptTag == dev2ScriptTag && gsubTable != NULL && gsubTable->coversScript( v2ScriptTag )) { + result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, TRUE, gsubTable, success); + } + else if (gsubTable != NULL && gsubTable->coversScript(scriptTag = OpenTypeLayoutEngine::getScriptTag(scriptCode))) { switch (scriptCode) { case bengScriptCode: case devaScriptCode: @@ -538,11 +597,15 @@ LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstan case tamlScriptCode: case teluScriptCode: case sinhScriptCode: - result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); + result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, FALSE, gsubTable, success); break; case arabScriptCode: - result = new ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); + result = new ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success); + break; + + case hangScriptCode: + result = new HangulOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success); break; case haniScriptCode: @@ -554,36 +617,35 @@ LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstan case zhtLanguageCode: case zhsLanguageCode: if (gsubTable->coversScriptAndLanguage(scriptTag, languageTag, TRUE)) { - result = new HanOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); + result = new HanOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success); break; } // note: falling through to default case. default: - result = new OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); + result = new OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success); break; } break; -#if 0 + case tibtScriptCode: - result = new TibetanOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); + result = new TibetanOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success); break; -#endif case khmrScriptCode: - result = new KhmerOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); + result = new KhmerOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success); break; default: - result = new OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); + result = new OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success); break; } } else { const MorphTableHeader *morphTable = (MorphTableHeader *) fontInstance->getFontTable(mortTableTag); if (morphTable != NULL) { - result = new GXLayoutEngine(fontInstance, scriptCode, languageCode, morphTable); + result = new GXLayoutEngine(fontInstance, scriptCode, languageCode, morphTable, success); } else { switch (scriptCode) { case bengScriptCode: @@ -597,29 +659,38 @@ LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstan case teluScriptCode: case sinhScriptCode: { - result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); + result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success); break; } case arabScriptCode: //case hebrScriptCode: - result = new UnicodeArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); + result = new UnicodeArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success); break; //case hebrScriptCode: // return new HebrewOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); case thaiScriptCode: - result = new ThaiLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); + result = new ThaiLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success); + break; + + case hangScriptCode: + result = new HangulOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success); break; default: - result = new LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); + result = new LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success); break; } } } + if (result && LE_FAILURE(success)) { + delete result; + result = NULL; + } + if (result == NULL) { success = LE_MEMORY_ALLOCATION_ERROR; } diff --git a/jdk/src/share/native/sun/font/layout/LayoutEngine.h b/jdk/src/share/native/sun/font/layout/LayoutEngine.h index 7e87b1a22cb..4334ce355d4 100644 --- a/jdk/src/share/native/sun/font/layout/LayoutEngine.h +++ b/jdk/src/share/native/sun/font/layout/LayoutEngine.h @@ -26,7 +26,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved * */ @@ -132,6 +132,14 @@ protected: */ le_int32 fTypoFlags; + /** + * TRUE if mapCharsToGlyphs should replace ZWJ / ZWNJ with a glyph + * with no contours. + * + * @internal + */ + le_bool fFilterZeroWidth; + /** * This constructs an instance for a given font, script and language. Subclass constructors * must call this constructor. @@ -141,13 +149,18 @@ protected: * @param languageCode - the language for the text * @param typoFlags - the typographic control flags for the text. Set bit 1 if kerning * is desired, set bit 2 if ligature formation is desired. Others are reserved. + * @param success - set to an error code if the operation fails * * @see LEFontInstance * @see ScriptAndLanguageTags.h * * @internal */ - LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); + LayoutEngine(const LEFontInstance *fontInstance, + le_int32 scriptCode, + le_int32 languageCode, + le_int32 typoFlags, + LEErrorCode &success); /** * This overrides the default no argument constructor to make it @@ -338,7 +351,7 @@ public: /** * This method will invoke the layout steps in their correct order by calling - * the computeGlyphs, positionGlyphs and adjustGlyphPosition methods.. It will + * the computeGlyphs, positionGlyphs and adjustGlyphPosition methods. It will * compute the glyph, character index and position arrays. * * @param chars - the input character context @@ -352,8 +365,12 @@ public: * * @return the number of glyphs in the glyph array * - * Note; the glyph, character index and position array can be accessed - * using the getter method below. + * Note: The glyph, character index and position array can be accessed + * using the getter methods below. + * + * Note: If you call this method more than once, you must call the reset() + * method first to free the glyph, character index and position arrays + * allocated by the previous call. * * @stable ICU 2.8 */ @@ -479,7 +496,7 @@ public: /** * Override of existing call that provides flags to control typography. - * @draft ICU 3.4 + * @stable ICU 3.4 */ static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success); diff --git a/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp b/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp index 12df5eb7131..0c173f3c7d5 100644 --- a/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp @@ -26,7 +26,7 @@ /* * * - * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2006 - All Rights Reserved * */ @@ -58,10 +58,6 @@ le_uint32 LigatureSubstitutionSubtable::process(GlyphIterator *glyphIterator, co TTGlyphID ligGlyph = SWAPW(ligTable->ligGlyph); le_uint16 comp; - if (filter != NULL && ! filter->accept(LE_SET_GLYPH(glyph, ligGlyph))) { - continue; - } - for (comp = 0; comp < compCount; comp += 1) { if (! glyphIterator->next()) { break; @@ -72,7 +68,7 @@ le_uint32 LigatureSubstitutionSubtable::process(GlyphIterator *glyphIterator, co } } - if (comp == compCount) { + if (comp == compCount && (filter == NULL || filter->accept(LE_SET_GLYPH(glyph, ligGlyph)))) { GlyphIterator tempIterator(*glyphIterator); TTGlyphID deletedGlyph = tempIterator.ignoresMarks()? 0xFFFE : 0xFFFF; diff --git a/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp b/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp index 038316fc395..eb5002ef8a2 100644 --- a/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp +++ b/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -33,7 +33,7 @@ #include "OpenTypeUtilities.h" #include "LEFontInstance.h" #include "OpenTypeTables.h" -#include "Features.h" +#include "ICUFeatures.h" #include "Lookups.h" #include "ScriptAndLanguage.h" #include "GlyphDefinitionTables.h" @@ -45,8 +45,12 @@ U_NAMESPACE_BEGIN le_uint32 LookupProcessor::applyLookupTable(const LookupTable *lookupTable, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance) const + const LEFontInstance *fontInstance, LEErrorCode& success) const { + if (LE_FAILURE(success)) { + return 0; + } + le_uint16 lookupType = SWAPW(lookupTable->lookupType); le_uint16 subtableCount = SWAPW(lookupTable->subTableCount); le_int32 startPosition = glyphIterator->getCurrStreamPosition(); @@ -55,9 +59,9 @@ le_uint32 LookupProcessor::applyLookupTable(const LookupTable *lookupTable, Glyp for (le_uint16 subtable = 0; subtable < subtableCount; subtable += 1) { const LookupSubtable *lookupSubtable = lookupTable->getLookupSubtable(subtable); - delta = applySubtable(lookupSubtable, lookupType, glyphIterator, fontInstance); + delta = applySubtable(lookupSubtable, lookupType, glyphIterator, fontInstance, success); - if (delta > 0) { + if (delta > 0 && LE_FAILURE(success)) { return 1; } @@ -69,8 +73,12 @@ le_uint32 LookupProcessor::applyLookupTable(const LookupTable *lookupTable, Glyp le_int32 LookupProcessor::process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, le_bool rightToLeft, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, - const LEFontInstance *fontInstance) const + const LEFontInstance *fontInstance, LEErrorCode& success) const { + if (LE_FAILURE(success)) { + return 0; + } + le_int32 glyphCount = glyphStorage.getGlyphCount(); if (lookupSelectArray == NULL) { @@ -92,10 +100,9 @@ le_int32 LookupProcessor::process(LEGlyphStorage &glyphStorage, GlyphPositionAdj glyphIterator.reset(lookupFlags, selectMask); while (glyphIterator.findFeatureTag()) { - le_uint32 delta = 1; - - while (glyphIterator.next(delta)) { - delta = applyLookupTable(lookupTable, &glyphIterator, fontInstance); + applyLookupTable(lookupTable, &glyphIterator, fontInstance, success); + if (LE_FAILURE(success)) { + return 0; } } @@ -107,12 +114,16 @@ le_int32 LookupProcessor::process(LEGlyphStorage &glyphStorage, GlyphPositionAdj } le_uint32 LookupProcessor::applySingleLookup(le_uint16 lookupTableIndex, GlyphIterator *glyphIterator, - const LEFontInstance *fontInstance) const + const LEFontInstance *fontInstance, LEErrorCode& success) const { + if (LE_FAILURE(success)) { + return 0; + } + const LookupTable *lookupTable = lookupListTable->getLookupTable(lookupTableIndex); le_uint16 lookupFlags = SWAPW(lookupTable->lookupFlags); GlyphIterator tempIterator(*glyphIterator, lookupFlags); - le_uint32 delta = applyLookupTable(lookupTable, &tempIterator, fontInstance); + le_uint32 delta = applyLookupTable(lookupTable, &tempIterator, fontInstance, success); return delta; } @@ -134,7 +145,8 @@ le_int32 LookupProcessor::selectLookups(const FeatureTable *featureTable, Featur LookupProcessor::LookupProcessor(const char *baseAddress, Offset scriptListOffset, Offset featureListOffset, Offset lookupListOffset, - LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool orderFeatures) + LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool orderFeatures, + LEErrorCode& success) : lookupListTable(NULL), featureListTable(NULL), lookupSelectArray(NULL), lookupOrderArray(NULL), lookupOrderCount(0) { @@ -144,6 +156,10 @@ LookupProcessor::LookupProcessor(const char *baseAddress, le_uint16 lookupListCount = 0; le_uint16 requiredFeatureIndex; + if (LE_FAILURE(success)) { + return; + } + if (scriptListOffset != 0) { scriptListTable = (const ScriptListTable *) (baseAddress + scriptListOffset); langSysTable = scriptListTable->findLanguage(scriptTag, languageTag); @@ -170,6 +186,10 @@ LookupProcessor::LookupProcessor(const char *baseAddress, requiredFeatureIndex = SWAPW(langSysTable->reqFeatureIndex); lookupSelectArray = LE_NEW_ARRAY(FeatureMask, lookupListCount); + if (lookupSelectArray == NULL) { + success = LE_MEMORY_ALLOCATION_ERROR; + return; + } for (int i = 0; i < lookupListCount; i += 1) { lookupSelectArray[i] = 0; @@ -200,6 +220,10 @@ LookupProcessor::LookupProcessor(const char *baseAddress, } lookupOrderArray = LE_NEW_ARRAY(le_uint16, featureReferences); + if (lookupOrderArray == NULL) { + success = LE_MEMORY_ALLOCATION_ERROR; + return; + } for (le_int32 f = 0; f < featureMapCount; f += 1) { FeatureMap fm = featureMap[f]; @@ -289,6 +313,8 @@ LookupProcessor::LookupProcessor(const char *baseAddress, LookupProcessor::LookupProcessor() { + lookupOrderArray = NULL; + lookupSelectArray = NULL; } LookupProcessor::~LookupProcessor() diff --git a/jdk/src/share/native/sun/font/layout/LookupProcessor.h b/jdk/src/share/native/sun/font/layout/LookupProcessor.h index 2ed5d9aa331..73a44f05cdb 100644 --- a/jdk/src/share/native/sun/font/layout/LookupProcessor.h +++ b/jdk/src/share/native/sun/font/layout/LookupProcessor.h @@ -26,7 +26,7 @@ /* * * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved * */ @@ -59,21 +59,28 @@ struct LookupTable; class LookupProcessor : public UMemory { public: le_int32 process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, - le_bool rightToLeft, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, const LEFontInstance *fontInstance) const; + le_bool rightToLeft, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, const LEFontInstance *fontInstance, LEErrorCode& success) const; - le_uint32 applyLookupTable(const LookupTable *lookupTable, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; + le_uint32 applyLookupTable(const LookupTable *lookupTable, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; - le_uint32 applySingleLookup(le_uint16 lookupTableIndex, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; + le_uint32 applySingleLookup(le_uint16 lookupTableIndex, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; virtual le_uint32 applySubtable(const LookupSubtable *lookupSubtable, le_uint16 subtableType, - GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const = 0; + GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const = 0; virtual ~LookupProcessor(); protected: LookupProcessor(const char *baseAddress, - Offset scriptListOffset, Offset featureListOffset, Offset lookupListOffset, - LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool orderFeatures); + Offset scriptListOffset, + Offset featureListOffset, + Offset lookupListOffset, + LETag scriptTag, + LETag languageTag, + const FeatureMap *featureMap, + le_int32 featureMapCount, + le_bool orderFeatures, + LEErrorCode& success); LookupProcessor(); diff --git a/jdk/src/share/native/sun/font/layout/MPreFixups.cpp b/jdk/src/share/native/sun/font/layout/MPreFixups.cpp index 5412ca1c7d6..673ea32ca16 100644 --- a/jdk/src/share/native/sun/font/layout/MPreFixups.cpp +++ b/jdk/src/share/native/sun/font/layout/MPreFixups.cpp @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 2002-2004 - All Rights Reserved + * (C) Copyright IBM Corp. 2002-2008 - All Rights Reserved * */ @@ -65,8 +65,12 @@ void MPreFixups::add(le_int32 baseIndex, le_int32 mpreIndex) } } -void MPreFixups::apply(LEGlyphStorage &glyphStorage) +void MPreFixups::apply(LEGlyphStorage &glyphStorage, LEErrorCode& success) { + if (LE_FAILURE(success)) { + return; + } + for (le_int32 fixup = 0; fixup < fFixupCount; fixup += 1) { le_int32 baseIndex = fFixupData[fixup].fBaseIndex; le_int32 mpreIndex = fFixupData[fixup].fMPreIndex; @@ -90,6 +94,14 @@ void MPreFixups::apply(LEGlyphStorage &glyphStorage) le_int32 mpreDest = baseIndex - mpreCount; LEGlyphID *mpreSave = LE_NEW_ARRAY(LEGlyphID, mpreCount); le_int32 *indexSave = LE_NEW_ARRAY(le_int32, mpreCount); + + if (mpreSave == NULL || indexSave == NULL) { + LE_DELETE_ARRAY(mpreSave); + LE_DELETE_ARRAY(indexSave); + success = LE_MEMORY_ALLOCATION_ERROR; + return; + } + le_int32 i; for (i = 0; i < mpreCount; i += 1) { diff --git a/jdk/src/share/native/sun/font/layout/MPreFixups.h b/jdk/src/share/native/sun/font/layout/MPreFixups.h index 2cb7600b880..7ae70bd47e7 100644 --- a/jdk/src/share/native/sun/font/layout/MPreFixups.h +++ b/jdk/src/share/native/sun/font/layout/MPreFixups.h @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 2002-2004 - All Rights Reserved + * (C) Copyright IBM Corp. 2002-2008 - All Rights Reserved * */ @@ -54,7 +54,7 @@ public: void add(le_int32 baseIndex, le_int32 mpreIndex); - void apply(LEGlyphStorage &glyphStorage); + void apply(LEGlyphStorage &glyphStorage, LEErrorCode& success); private: FixupData *fFixupData; diff --git a/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp b/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp index 708f3df9f95..45b78cf81fe 100644 --- a/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -108,11 +108,27 @@ le_int32 MarkToBasePositioningSubtable::process(GlyphIterator *glyphIterator, co glyphIterator->setCurrGlyphBaseOffset(baseIterator.getCurrStreamPosition()); if (glyphIterator->isRightToLeft()) { + // FIXME: need similar patch to below; also in MarkToLigature and MarkToMark + // (is there a better way to approach this for all the cases?) glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX, anchorDiffY, -markAdvance.fX, -markAdvance.fY); } else { LEPoint baseAdvance; fontInstance->getGlyphAdvance(baseGlyph, pixels); + + //JK: adjustment needs to account for non-zero advance of any marks between base glyph and current mark + GlyphIterator gi(baseIterator, (le_uint16)0); // copy of baseIterator that won't ignore marks + gi.next(); // point beyond the base glyph + while (gi.getCurrStreamPosition() < glyphIterator->getCurrStreamPosition()) { // for all intervening glyphs (marks)... + LEGlyphID otherMark = gi.getCurrGlyphID(); + LEPoint px; + fontInstance->getGlyphAdvance(otherMark, px); // get advance, in case it's non-zero + pixels.fX += px.fX; // and add that to the base glyph's advance + pixels.fY += px.fY; + gi.next(); + } + // end of JK patch + fontInstance->pixelsToUnits(pixels, baseAdvance); glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - baseAdvance.fX, anchorDiffY - baseAdvance.fY, -markAdvance.fX, -markAdvance.fY); diff --git a/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp b/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp index 038911c722a..e105e1eb688 100644 --- a/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved * */ @@ -39,8 +39,12 @@ U_NAMESPACE_BEGIN -le_uint32 MultipleSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const +le_uint32 MultipleSubstitutionSubtable::process(GlyphIterator *glyphIterator, LEErrorCode& success, const LEGlyphFilter *filter) const { + if (LE_FAILURE(success)) { + return 0; + } + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); // If there's a filter, we only want to do the @@ -87,7 +91,11 @@ le_uint32 MultipleSubstitutionSubtable::process(GlyphIterator *glyphIterator, co } } - LEGlyphID *newGlyphs = glyphIterator->insertGlyphs(glyphCount); + LEGlyphID *newGlyphs = glyphIterator->insertGlyphs(glyphCount, success); + if (LE_FAILURE(success)) { + return 0; + } + le_int32 insert = 0, direction = 1; if (glyphIterator->isRightToLeft()) { diff --git a/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.h b/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.h index 64029ffe416..5fe715ab7d5 100644 --- a/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.h +++ b/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.h @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved * */ @@ -56,7 +56,7 @@ struct MultipleSubstitutionSubtable : GlyphSubstitutionSubtable le_uint16 sequenceCount; Offset sequenceTableOffsetArray[ANY_NUMBER]; - le_uint32 process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter = NULL) const; + le_uint32 process(GlyphIterator *glyphIterator, LEErrorCode& success, const LEGlyphFilter *filter = NULL) const; }; U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.cpp index 9e1ef358a64..45eaadf4b7a 100644 --- a/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.cpp +++ b/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.cpp @@ -26,7 +26,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -35,8 +35,10 @@ #include "LELanguages.h" #include "LayoutEngine.h" +#include "CanonShaping.h" #include "OpenTypeLayoutEngine.h" #include "ScriptAndLanguageTags.h" +#include "CharSubstitutionFilter.h" #include "GlyphSubstitutionTables.h" #include "GlyphDefinitionTables.h" @@ -47,6 +49,8 @@ #include "GDEFMarkFilter.h" +#include "KernTable.h" + U_NAMESPACE_BEGIN UOBJECT_DEFINE_RTTI_IMPLEMENTATION(OpenTypeLayoutEngine) @@ -57,6 +61,8 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(OpenTypeLayoutEngine) #define kernFeatureTag LE_KERN_FEATURE_TAG #define markFeatureTag LE_MARK_FEATURE_TAG #define mkmkFeatureTag LE_MKMK_FEATURE_TAG +#define loclFeatureTag LE_LOCL_FEATURE_TAG +#define caltFeatureTag LE_CALT_FEATURE_TAG // 'dlig' not used at the moment #define dligFeatureTag 0x646C6967 @@ -71,8 +77,10 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(OpenTypeLayoutEngine) #define paltFeatureMask 0x08000000UL #define markFeatureMask 0x04000000UL #define mkmkFeatureMask 0x02000000UL +#define loclFeatureMask 0x01000000UL +#define caltFeatureMask 0x00800000UL -#define minimalFeatures (ccmpFeatureMask | markFeatureMask | mkmkFeatureMask) +#define minimalFeatures (ccmpFeatureMask | markFeatureMask | mkmkFeatureMask | loclFeatureMask | caltFeatureMask) #define ligaFeatures (ligaFeatureMask | cligFeatureMask | minimalFeatures) #define kernFeatures (kernFeatureMask | paltFeatureMask | minimalFeatures) #define kernAndLigaFeatures (ligaFeatures | kernFeatures) @@ -85,14 +93,16 @@ static const FeatureMap featureMap[] = {kernFeatureTag, kernFeatureMask}, {paltFeatureTag, paltFeatureMask}, {markFeatureTag, markFeatureMask}, - {mkmkFeatureTag, mkmkFeatureMask} + {mkmkFeatureTag, mkmkFeatureMask}, + {loclFeatureTag, loclFeatureMask}, + {caltFeatureTag, caltFeatureMask} }; static const le_int32 featureMapCount = LE_ARRAY_SIZE(featureMap); OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) - : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), fFeatureMask(minimalFeatures), + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success) + : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success), fFeatureMask(minimalFeatures), fFeatureMap(featureMap), fFeatureMapCount(featureMapCount), fFeatureOrder(FALSE), fGSUBTable(gsubTable), fGDEFTable(NULL), fGPOSTable(NULL), fSubstitutionFilter(NULL) { @@ -101,7 +111,7 @@ OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, l const GlyphPositioningTableHeader *gposTable = (const GlyphPositioningTableHeader *) getFontTable(gposTableTag); // todo: switch to more flags and bitfield rather than list of feature tags? - switch (typoFlags) { + switch (typoFlags & ~0x80000000L) { case 0: break; // default case 1: fFeatureMask = kernFeatures; break; case 2: fFeatureMask = ligaFeatures; break; @@ -109,11 +119,17 @@ OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, l default: break; } + if (typoFlags & 0x80000000L) { + fSubstitutionFilter = new CharSubstitutionFilter(fontInstance); + } + setScriptAndLanguageTags(); fGDEFTable = (const GlyphDefinitionTableHeader *) getFontTable(gdefTableTag); - if (gposTable != NULL && gposTable->coversScriptAndLanguage(fScriptTag, fLangSysTag)) { +// JK patch, 2008-05-30 - see Sinhala bug report and LKLUG font +// if (gposTable != NULL && gposTable->coversScriptAndLanguage(fScriptTag, fLangSysTag)) { + if (gposTable != NULL && gposTable->coversScript(fScriptTag)) { fGPOSTable = gposTable; } } @@ -128,8 +144,8 @@ void OpenTypeLayoutEngine::reset() } OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags) - : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), fFeatureOrder(FALSE), + le_int32 typoFlags, LEErrorCode &success) + : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success), fFeatureOrder(FALSE), fGSUBTable(NULL), fGDEFTable(NULL), fGPOSTable(NULL), fSubstitutionFilter(NULL) { setScriptAndLanguageTags(); @@ -137,6 +153,10 @@ OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, l OpenTypeLayoutEngine::~OpenTypeLayoutEngine() { + if (fTypoFlags & 0x80000000L) { + delete fSubstitutionFilter; + } + reset(); } @@ -145,10 +165,25 @@ LETag OpenTypeLayoutEngine::getScriptTag(le_int32 scriptCode) if (scriptCode < 0 || scriptCode >= scriptCodeCount) { return 0xFFFFFFFF; } - return scriptTags[scriptCode]; } +LETag OpenTypeLayoutEngine::getV2ScriptTag(le_int32 scriptCode) +{ + switch (scriptCode) { + case bengScriptCode : return bng2ScriptTag; + case devaScriptCode : return dev2ScriptTag; + case gujrScriptCode : return gjr2ScriptTag; + case guruScriptCode : return gur2ScriptTag; + case kndaScriptCode : return knd2ScriptTag; + case mlymScriptCode : return mlm2ScriptTag; + case oryaScriptCode : return ory2ScriptTag; + case tamlScriptCode : return tml2ScriptTag; + case teluScriptCode : return tel2ScriptTag; + default: return nullScriptTag; + } +} + LETag OpenTypeLayoutEngine::getLangSysTag(le_int32 languageCode) { if (languageCode < 0 || languageCode >= languageCodeCount) { @@ -161,6 +196,7 @@ LETag OpenTypeLayoutEngine::getLangSysTag(le_int32 languageCode) void OpenTypeLayoutEngine::setScriptAndLanguageTags() { fScriptTag = getScriptTag(fScriptCode); + fScriptTagV2 = getV2ScriptTag(fScriptCode); fLangSysTag = getLangSysTag(fLanguageCode); } @@ -176,20 +212,39 @@ le_int32 OpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_i return 0; } - le_int32 outCharCount = LayoutEngine::characterProcessing(chars, offset, count, max, rightToLeft, outChars, glyphStorage, success); + // This is the cheapest way to get mark reordering only for Hebrew. + // We could just do the mark reordering for all scripts, but most + // of them probably don't need it... Another option would be to + // add a HebrewOpenTypeLayoutEngine subclass, but the only thing it + // would need to do is mark reordering, so that seems like overkill. + if (fScriptCode == hebrScriptCode) { + outChars = LE_NEW_ARRAY(LEUnicode, count); + + if (outChars == NULL) { + success = LE_MEMORY_ALLOCATION_ERROR; + return 0; + } + + if (LE_FAILURE(success)) { + LE_DELETE_ARRAY(outChars); + return 0; + } + + CanonShaping::reorderMarks(&chars[offset], count, rightToLeft, outChars, glyphStorage); + } if (LE_FAILURE(success)) { return 0; } - glyphStorage.allocateGlyphArray(outCharCount, rightToLeft, success); + glyphStorage.allocateGlyphArray(count, rightToLeft, success); glyphStorage.allocateAuxData(success); - for (le_int32 i = 0; i < outCharCount; i += 1) { + for (le_int32 i = 0; i < count; i += 1) { glyphStorage.setAuxData(i, fFeatureMask, success); } - return outCharCount; + return count; } // Input: characters, tags @@ -213,13 +268,45 @@ le_int32 OpenTypeLayoutEngine::glyphProcessing(const LEUnicode chars[], le_int32 } if (fGSUBTable != NULL) { + if (fScriptTagV2 != nullScriptTag && fGSUBTable->coversScriptAndLanguage(fScriptTagV2,fLangSysTag)) { + count = fGSUBTable->process(glyphStorage, rightToLeft, fScriptTagV2, fLangSysTag, fGDEFTable, fSubstitutionFilter, + fFeatureMap, fFeatureMapCount, fFeatureOrder, success); + + } else { count = fGSUBTable->process(glyphStorage, rightToLeft, fScriptTag, fLangSysTag, fGDEFTable, fSubstitutionFilter, - fFeatureMap, fFeatureMapCount, fFeatureOrder); + fFeatureMap, fFeatureMapCount, fFeatureOrder, success); + } } return count; } +// Input: characters, tags +// Output: glyphs, char indices +le_int32 OpenTypeLayoutEngine::glyphSubstitution(le_int32 count, le_int32 max, le_bool rightToLeft, + LEGlyphStorage &glyphStorage, LEErrorCode &success) +{ + if (LE_FAILURE(success)) { + return 0; + } + if ( count < 0 || max < 0 ) { + success = LE_ILLEGAL_ARGUMENT_ERROR; + return 0; + } + + if (fGSUBTable != NULL) { + if (fScriptTagV2 != nullScriptTag && fGSUBTable->coversScriptAndLanguage(fScriptTagV2,fLangSysTag)) { + count = fGSUBTable->process(glyphStorage, rightToLeft, fScriptTagV2, fLangSysTag, fGDEFTable, fSubstitutionFilter, + fFeatureMap, fFeatureMapCount, fFeatureOrder, success); + + } else { + count = fGSUBTable->process(glyphStorage, rightToLeft, fScriptTag, fLangSysTag, fGDEFTable, fSubstitutionFilter, + fFeatureMap, fFeatureMapCount, fFeatureOrder, success); + } + } + + return count; +} le_int32 OpenTypeLayoutEngine::glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success) { if (LE_FAILURE(success)) { @@ -251,6 +338,10 @@ le_int32 OpenTypeLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 o outCharCount = characterProcessing(chars, offset, count, max, rightToLeft, outChars, fakeGlyphStorage, success); + if (LE_FAILURE(success)) { + return 0; + } + if (outChars != NULL) { fakeGlyphCount = glyphProcessing(outChars, 0, outCharCount, outCharCount, rightToLeft, fakeGlyphStorage, success); LE_DELETE_ARRAY(outChars); // FIXME: a subclass may have allocated this, in which case this delete might not work... @@ -260,6 +351,10 @@ le_int32 OpenTypeLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 o //adjustGlyphs(chars, offset, count, rightToLeft, fakeGlyphs, fakeGlyphCount); } + if (LE_FAILURE(success)) { + return 0; + } + outGlyphCount = glyphPostProcessing(fakeGlyphStorage, glyphStorage, success); return outGlyphCount; @@ -279,8 +374,11 @@ void OpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int3 } le_int32 glyphCount = glyphStorage.getGlyphCount(); + if (glyphCount == 0) { + return; + } - if (glyphCount > 0 && fGPOSTable != NULL) { + if (fGPOSTable != NULL) { GlyphPositionAdjustments *adjustments = new GlyphPositionAdjustments(glyphCount); le_int32 i; @@ -303,9 +401,21 @@ void OpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int3 } #endif - fGPOSTable->process(glyphStorage, adjustments, reverse, fScriptTag, fLangSysTag, fGDEFTable, fFontInstance, + if (fGPOSTable != NULL) { + if (fScriptTagV2 != nullScriptTag && fGPOSTable->coversScriptAndLanguage(fScriptTagV2,fLangSysTag)) { + fGPOSTable->process(glyphStorage, adjustments, reverse, fScriptTagV2, fLangSysTag, fGDEFTable, success, fFontInstance, fFeatureMap, fFeatureMapCount, fFeatureOrder); + } else { + fGPOSTable->process(glyphStorage, adjustments, reverse, fScriptTag, fLangSysTag, fGDEFTable, success, fFontInstance, + fFeatureMap, fFeatureMapCount, fFeatureOrder); + } + } else if ( fTypoFlags & 0x1 ) { + static const le_uint32 kernTableTag = LE_KERN_TABLE_TAG; + KernTable kt(fFontInstance, getFontTable(kernTableTag)); + kt.process(glyphStorage); + } + float xAdjust = 0, yAdjust = 0; for (i = 0; i < glyphCount; i += 1) { @@ -338,6 +448,21 @@ void OpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int3 glyphStorage.adjustPosition(glyphCount, xAdjust, -yAdjust, success); delete adjustments; + } else { + // if there was no GPOS table, maybe there's non-OpenType kerning we can use + LayoutEngine::adjustGlyphPositions(chars, offset, count, reverse, glyphStorage, success); + } + + LEGlyphID zwnj = fFontInstance->mapCharToGlyph(0x200C); + + if (zwnj != 0x0000) { + for (le_int32 g = 0; g < glyphCount; g += 1) { + LEGlyphID glyph = glyphStorage[g]; + + if (glyph == zwnj) { + glyphStorage[g] = LE_SET_GLYPH(glyph, 0xFFFF); + } + } } #if 0 diff --git a/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.h b/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.h index d5c7d5fca10..cf257fb8131 100644 --- a/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.h +++ b/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.h @@ -24,7 +24,7 @@ */ /* - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -67,7 +67,7 @@ U_NAMESPACE_BEGIN * * @internal */ -class OpenTypeLayoutEngine : public LayoutEngine +class U_LAYOUT_API OpenTypeLayoutEngine : public LayoutEngine { public: /** @@ -80,6 +80,7 @@ public: * @param scriptCode - the script * @param langaugeCode - the language * @param gsubTable - the GSUB table + * @param success - set to an error code if the operation fails * * @see LayoutEngine::layoutEngineFactory * @see ScriptAndLangaugeTags.h for script and language codes @@ -87,7 +88,7 @@ public: * @internal */ OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success); /** * This constructor is used when the font requires a "canned" GSUB table which can't be known @@ -96,11 +97,12 @@ public: * @param fontInstance - the font * @param scriptCode - the script * @param langaugeCode - the language + * @param success - set to an error code if the operation fails * * @internal */ OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - le_int32 typoFlags); + le_int32 typoFlags, LEErrorCode &success); /** * The destructor, virtual for correct polymorphic invocation. @@ -112,6 +114,8 @@ public: /** * A convenience method used to convert the script code into * the four byte script tag required by OpenType. + * For Indic languages where multiple script tags exist, + * the version 1 (old style) tag is returned. * * @param scriptCode - the script code * @@ -120,6 +124,19 @@ public: * @internal */ static LETag getScriptTag(le_int32 scriptCode); + /** + * A convenience method used to convert the script code into + * the four byte script tag required by OpenType. + * For Indic languages where multiple script tags exist, + * the version 2 tag is returned. + * + * @param scriptCode - the script code + * + * @return the four byte script tag + * + * @internal + */ + static LETag getV2ScriptTag(le_int32 scriptCode); /** * A convenience method used to convert the langauge code into @@ -147,6 +164,13 @@ public: */ static UClassID getStaticClassID(); + /** + * The array of language tags, indexed by language code. + * + * @internal + */ + static const LETag languageTags[]; + private: /** @@ -160,11 +184,6 @@ private: */ static const LETag scriptTags[]; - /** - * The array of language tags, indexed by language code. - */ - static const LETag languageTags[]; - protected: /** * A set of "default" features. The default characterProcessing method @@ -237,6 +256,13 @@ protected: */ LETag fScriptTag; + /** + * The four byte script tag for V2 fonts. + * + * @internal + */ + LETag fScriptTagV2; + /** * The four byte language tag * @@ -304,6 +330,8 @@ protected: virtual le_int32 glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); + virtual le_int32 glyphSubstitution(le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); + /** * This method does any processing necessary to convert "fake" * glyph indices used by the glyphProcessing method into "real" glyph diff --git a/jdk/src/share/native/sun/font/layout/OpenTypeTables.h b/jdk/src/share/native/sun/font/layout/OpenTypeTables.h index 126e400119c..c4a4a68b75a 100644 --- a/jdk/src/share/native/sun/font/layout/OpenTypeTables.h +++ b/jdk/src/share/native/sun/font/layout/OpenTypeTables.h @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -46,6 +46,8 @@ U_NAMESPACE_BEGIN typedef le_uint16 Offset; typedef le_uint8 ATag[4]; typedef le_uint32 fixed32; + +#define LE_GLYPH_GROUP_MASK 0x00000001UL typedef le_uint32 FeatureMask; #define SWAPT(atag) ((LETag) ((atag[0] << 24) + (atag[1] << 16) + (atag[2] << 8) + atag[3])) diff --git a/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.cpp b/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.cpp index 6ede057a53e..3b25aa280c9 100644 --- a/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.cpp +++ b/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.cpp @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -111,6 +111,10 @@ le_int32 OpenTypeUtilities::getGlyphRangeIndex(TTGlyphID glyphID, const GlyphRan le_int32 probe = power; le_int32 range = 0; + if (recordCount == 0) { + return -1; + } + if (SWAPW(records[extra].firstGlyph) <= glyphID) { range = extra; } diff --git a/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp b/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp index 0bd6624912d..d5d4f1bf15b 100644 --- a/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp @@ -101,7 +101,10 @@ le_uint32 PairPositioningFormat1Subtable::process(GlyphIterator *glyphIterator, valueRecord2->adjustPosition(SWAPW(valueFormat2), (char *) this, *glyphIterator, fontInstance); } - return 2; + // back up glyphIterator so second glyph can be + // first glyph in the next pair + glyphIterator->prev(); + return 1; } return 0; @@ -137,7 +140,10 @@ le_uint32 PairPositioningFormat2Subtable::process(GlyphIterator *glyphIterator, valueRecord2->adjustPosition(SWAPW(valueFormat2), (const char *) this, *glyphIterator, fontInstance); } - return 2; + // back up glyphIterator so second glyph can be + // first glyph in the next pair + glyphIterator->prev(); + return 1; } return 0; @@ -145,6 +151,20 @@ le_uint32 PairPositioningFormat2Subtable::process(GlyphIterator *glyphIterator, const PairValueRecord *PairPositioningFormat1Subtable::findPairValueRecord(TTGlyphID glyphID, const PairValueRecord *records, le_uint16 recordCount, le_uint16 recordSize) const { +#if 1 + // The OpenType spec. says that the ValueRecord table is + // sorted by secondGlyph. Unfortunately, there are fonts + // around that have an unsorted ValueRecord table. + const PairValueRecord *record = records; + + for(le_int32 r = 0; r < recordCount; r += 1) { + if (SWAPW(record->secondGlyph) == glyphID) { + return record; + } + + record = (const PairValueRecord *) ((char *) record + recordSize); + } +#else le_uint8 bit = OpenTypeUtilities::highBit(recordCount); le_uint16 power = 1 << bit; le_uint16 extra = (recordCount - power) * recordSize; @@ -168,6 +188,7 @@ const PairValueRecord *PairPositioningFormat1Subtable::findPairValueRecord(TTGly if (SWAPW(record->secondGlyph) == glyphID) { return record; } +#endif return NULL; } diff --git a/jdk/src/share/native/sun/font/layout/ScriptAndLanguage.cpp b/jdk/src/share/native/sun/font/layout/ScriptAndLanguage.cpp index 77fd0f60141..bb8b65ba371 100644 --- a/jdk/src/share/native/sun/font/layout/ScriptAndLanguage.cpp +++ b/jdk/src/share/native/sun/font/layout/ScriptAndLanguage.cpp @@ -26,7 +26,7 @@ /* * * - * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -56,20 +56,45 @@ const LangSysTable *ScriptTable::findLanguage(LETag languageTag, le_bool exactMa return (const LangSysTable *) ((char *)this + langSysTableOffset); } - return 0; + return NULL; } const ScriptTable *ScriptListTable::findScript(LETag scriptTag) const { + /* + * There are some fonts that have a large, bogus value for scriptCount. To try + * and protect against this, we use the offset in the first scriptRecord, + * which we know has to be past the end of the scriptRecordArray, to compute + * a value which is greater than or equal to the actual script count. + * + * Note: normally, the first offset will point to just after the scriptRecordArray, + * but there's no guarantee of this, only that it's *after* the scriptRecordArray. + * Because of this, a binary serach isn't safe, because the new count may include + * data that's not actually in the scriptRecordArray and hence the array will appear + * to be unsorted. + */ le_uint16 count = SWAPW(scriptCount); - Offset scriptTableOffset = - OpenTypeUtilities::getTagOffset(scriptTag, scriptRecordArray, count); + le_uint16 limit = ((SWAPW(scriptRecordArray[0].offset) - sizeof(ScriptListTable)) / sizeof(scriptRecordArray)) + ANY_NUMBER; + Offset scriptTableOffset = 0; + + if (count > limit) { + // the scriptCount value is bogus; do a linear search + // because limit may still be too large. + for(le_int32 s = 0; s < limit; s += 1) { + if (SWAPT(scriptRecordArray[s].tag) == scriptTag) { + scriptTableOffset = SWAPW(scriptRecordArray[s].offset); + break; + } + } + } else { + scriptTableOffset = OpenTypeUtilities::getTagOffset(scriptTag, scriptRecordArray, count); + } if (scriptTableOffset != 0) { return (const ScriptTable *) ((char *)this + scriptTableOffset); } - return 0; + return NULL; } const LangSysTable *ScriptListTable::findLanguage(LETag scriptTag, LETag languageTag, le_bool exactMatch) const @@ -77,7 +102,7 @@ const LangSysTable *ScriptListTable::findLanguage(LETag scriptTag, LETag languag const ScriptTable *scriptTable = findScript(scriptTag); if (scriptTable == 0) { - return 0; + return NULL; } return scriptTable->findLanguage(languageTag, exactMatch); diff --git a/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.cpp b/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.cpp index 91de6df4bfc..c7d46c631bc 100644 --- a/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.cpp +++ b/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.cpp @@ -25,10 +25,12 @@ /* * - * (C) Copyright IBM Corp. 1998-2004. All Rights Reserved. + * (C) Copyright IBM Corp. 1998-2010. All Rights Reserved. * * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS * YOU REALLY KNOW WHAT YOU'RE DOING. + * + * Generated on: 10/26/2010 02:53:33 PM PDT */ #include "LETypes.h" @@ -39,13 +41,13 @@ U_NAMESPACE_BEGIN const LETag OpenTypeLayoutEngine::scriptTags[] = { zyyyScriptTag, /* 'zyyy' (COMMON) */ - qaaiScriptTag, /* 'qaai' (INHERITED) */ + zinhScriptTag, /* 'zinh' (INHERITED) */ arabScriptTag, /* 'arab' (ARABIC) */ armnScriptTag, /* 'armn' (ARMENIAN) */ bengScriptTag, /* 'beng' (BENGALI) */ bopoScriptTag, /* 'bopo' (BOPOMOFO) */ cherScriptTag, /* 'cher' (CHEROKEE) */ - qaacScriptTag, /* 'qaac' (COPTIC) */ + coptScriptTag, /* 'copt' (COPTIC) */ cyrlScriptTag, /* 'cyrl' (CYRILLIC) */ dsrtScriptTag, /* 'dsrt' (DESERET) */ devaScriptTag, /* 'deva' (DEVANAGARI) */ @@ -62,7 +64,7 @@ const LETag OpenTypeLayoutEngine::scriptTags[] = { kndaScriptTag, /* 'knda' (KANNADA) */ kanaScriptTag, /* 'kana' (KATAKANA) */ khmrScriptTag, /* 'khmr' (KHMER) */ - laooScriptTag, /* 'laoo' (LAO) */ + laooScriptTag, /* 'lao ' (LAO) */ latnScriptTag, /* 'latn' (LATIN) */ mlymScriptTag, /* 'mlym' (MALAYALAM) */ mongScriptTag, /* 'mong' (MONGOLIAN) */ @@ -79,7 +81,7 @@ const LETag OpenTypeLayoutEngine::scriptTags[] = { thaiScriptTag, /* 'thai' (THAI) */ tibtScriptTag, /* 'tibt' (TIBETAN) */ cansScriptTag, /* 'cans' (CANADIAN_ABORIGINAL) */ - yiiiScriptTag, /* 'yiii' (YI) */ + yiiiScriptTag, /* 'yi ' (YI) */ tglgScriptTag, /* 'tglg' (TAGALOG) */ hanoScriptTag, /* 'hano' (HANUNOO) */ buhdScriptTag, /* 'buhd' (BUHID) */ @@ -92,7 +94,99 @@ const LETag OpenTypeLayoutEngine::scriptTags[] = { shawScriptTag, /* 'shaw' (SHAVIAN) */ taleScriptTag, /* 'tale' (TAI_LE) */ ugarScriptTag, /* 'ugar' (UGARITIC) */ - hrktScriptTag /* 'hrkt' (KATAKANA_OR_HIRAGANA) */ + hrktScriptTag, /* 'hrkt' (KATAKANA_OR_HIRAGANA) */ + bugiScriptTag, /* 'bugi' (BUGINESE) */ + glagScriptTag, /* 'glag' (GLAGOLITIC) */ + kharScriptTag, /* 'khar' (KHAROSHTHI) */ + syloScriptTag, /* 'sylo' (SYLOTI_NAGRI) */ + taluScriptTag, /* 'talu' (NEW_TAI_LUE) */ + tfngScriptTag, /* 'tfng' (TIFINAGH) */ + xpeoScriptTag, /* 'xpeo' (OLD_PERSIAN) */ + baliScriptTag, /* 'bali' (BALINESE) */ + batkScriptTag, /* 'batk' (BATAK) */ + blisScriptTag, /* 'blis' (BLIS) */ + brahScriptTag, /* 'brah' (BRAHMI) */ + chamScriptTag, /* 'cham' (CHAM) */ + cirtScriptTag, /* 'cirt' (CIRT) */ + cyrsScriptTag, /* 'cyrs' (CYRS) */ + egydScriptTag, /* 'egyd' (EGYD) */ + egyhScriptTag, /* 'egyh' (EGYH) */ + egypScriptTag, /* 'egyp' (EGYPTIAN_HIEROGLYPHS) */ + geokScriptTag, /* 'geok' (GEOK) */ + hansScriptTag, /* 'hans' (HANS) */ + hantScriptTag, /* 'hant' (HANT) */ + hmngScriptTag, /* 'hmng' (HMNG) */ + hungScriptTag, /* 'hung' (HUNG) */ + indsScriptTag, /* 'inds' (INDS) */ + javaScriptTag, /* 'java' (JAVANESE) */ + kaliScriptTag, /* 'kali' (KAYAH_LI) */ + latfScriptTag, /* 'latf' (LATF) */ + latgScriptTag, /* 'latg' (LATG) */ + lepcScriptTag, /* 'lepc' (LEPCHA) */ + linaScriptTag, /* 'lina' (LINA) */ + mandScriptTag, /* 'mand' (MANDAIC) */ + mayaScriptTag, /* 'maya' (MAYA) */ + meroScriptTag, /* 'mero' (MERO) */ + nkooScriptTag, /* 'nko ' (NKO) */ + orkhScriptTag, /* 'orkh' (OLD_TURKIC) */ + permScriptTag, /* 'perm' (PERM) */ + phagScriptTag, /* 'phag' (PHAGS_PA) */ + phnxScriptTag, /* 'phnx' (PHOENICIAN) */ + plrdScriptTag, /* 'plrd' (PLRD) */ + roroScriptTag, /* 'roro' (RORO) */ + saraScriptTag, /* 'sara' (SARA) */ + syreScriptTag, /* 'syre' (SYRE) */ + syrjScriptTag, /* 'syrj' (SYRJ) */ + syrnScriptTag, /* 'syrn' (SYRN) */ + tengScriptTag, /* 'teng' (TENG) */ + vaiiScriptTag, /* 'vai ' (VAI) */ + vispScriptTag, /* 'visp' (VISP) */ + xsuxScriptTag, /* 'xsux' (CUNEIFORM) */ + zxxxScriptTag, /* 'zxxx' (ZXXX) */ + zzzzScriptTag, /* 'zzzz' (UNKNOWN) */ + cariScriptTag, /* 'cari' (CARIAN) */ + jpanScriptTag, /* 'jpan' (JPAN) */ + lanaScriptTag, /* 'lana' (TAI_THAM) */ + lyciScriptTag, /* 'lyci' (LYCIAN) */ + lydiScriptTag, /* 'lydi' (LYDIAN) */ + olckScriptTag, /* 'olck' (OL_CHIKI) */ + rjngScriptTag, /* 'rjng' (REJANG) */ + saurScriptTag, /* 'saur' (SAURASHTRA) */ + sgnwScriptTag, /* 'sgnw' (SGNW) */ + sundScriptTag, /* 'sund' (SUNDANESE) */ + moonScriptTag, /* 'moon' (MOON) */ + mteiScriptTag, /* 'mtei' (MEETEI_MAYEK) */ + armiScriptTag, /* 'armi' (IMPERIAL_ARAMAIC) */ + avstScriptTag, /* 'avst' (AVESTAN) */ + cakmScriptTag, /* 'cakm' (CAKM) */ + koreScriptTag, /* 'kore' (KORE) */ + kthiScriptTag, /* 'kthi' (KAITHI) */ + maniScriptTag, /* 'mani' (MANI) */ + phliScriptTag, /* 'phli' (INSCRIPTIONAL_PAHLAVI) */ + phlpScriptTag, /* 'phlp' (PHLP) */ + phlvScriptTag, /* 'phlv' (PHLV) */ + prtiScriptTag, /* 'prti' (INSCRIPTIONAL_PARTHIAN) */ + samrScriptTag, /* 'samr' (SAMARITAN) */ + tavtScriptTag, /* 'tavt' (TAI_VIET) */ + zmthScriptTag, /* 'zmth' (ZMTH) */ + zsymScriptTag, /* 'zsym' (ZSYM) */ + bamuScriptTag, /* 'bamu' (BAMUM) */ + lisuScriptTag, /* 'lisu' (LISU) */ + nkgbScriptTag, /* 'nkgb' (NKGB) */ + sarbScriptTag, /* 'sarb' (OLD_SOUTH_ARABIAN) */ + bassScriptTag, /* 'bass' (BASS) */ + duplScriptTag, /* 'dupl' (DUPL) */ + elbaScriptTag, /* 'elba' (ELBA) */ + granScriptTag, /* 'gran' (GRAN) */ + kpelScriptTag, /* 'kpel' (KPEL) */ + lomaScriptTag, /* 'loma' (LOMA) */ + mendScriptTag, /* 'mend' (MEND) */ + mercScriptTag, /* 'merc' (MERC) */ + narbScriptTag, /* 'narb' (NARB) */ + nbatScriptTag, /* 'nbat' (NBAT) */ + palmScriptTag, /* 'palm' (PALM) */ + sindScriptTag, /* 'sind' (SIND) */ + waraScriptTag /* 'wara' (WARA) */ }; const LETag OpenTypeLayoutEngine::languageTags[] = { @@ -125,7 +219,49 @@ const LETag OpenTypeLayoutEngine::languageTags[] = { urdLanguageTag, /* 'URD' (Urdu) */ zhpLanguageTag, /* 'ZHP' (Chinese (Phonetic)) */ zhsLanguageTag, /* 'ZHS' (Chinese (Simplified)) */ - zhtLanguageTag /* 'ZHT' (Chinese (Traditional)) */ + zhtLanguageTag, /* 'ZHT' (Chinese (Traditional)) */ + afkLanguageTag, /* 'AFK' (Afrikaans) */ + belLanguageTag, /* 'BEL' (Belarussian) */ + bgrLanguageTag, /* 'BGR' (Bulgarian) */ + catLanguageTag, /* 'CAT' (Catalan) */ + cheLanguageTag, /* 'CHE' (Chechen) */ + copLanguageTag, /* 'COP' (Coptic) */ + csyLanguageTag, /* 'CSY' (Czech) */ + danLanguageTag, /* 'DAN' (Danish) */ + deuLanguageTag, /* 'DEU' (German) */ + dznLanguageTag, /* 'DZN' (Dzongkha) */ + ellLanguageTag, /* 'ELL' (Greek) */ + engLanguageTag, /* 'ENG' (English) */ + espLanguageTag, /* 'ESP' (Spanish) */ + etiLanguageTag, /* 'ETI' (Estonian) */ + euqLanguageTag, /* 'EUQ' (Basque) */ + finLanguageTag, /* 'FIN' (Finnish) */ + fraLanguageTag, /* 'FRA' (French) */ + gaeLanguageTag, /* 'GAE' (Gaelic) */ + hauLanguageTag, /* 'HAU' (Hausa) */ + hrvLanguageTag, /* 'HRV' (Croation) */ + hunLanguageTag, /* 'HUN' (Hungarian) */ + hyeLanguageTag, /* 'HYE' (Armenian) */ + indLanguageTag, /* 'IND' (Indonesian) */ + itaLanguageTag, /* 'ITA' (Italian) */ + khmLanguageTag, /* 'KHM' (Khmer) */ + mngLanguageTag, /* 'MNG' (Mongolian) */ + mtsLanguageTag, /* 'MTS' (Maltese) */ + nepLanguageTag, /* 'NEP' (Nepali) */ + nldLanguageTag, /* 'NLD' (Dutch) */ + pasLanguageTag, /* 'PAS' (Pashto) */ + plkLanguageTag, /* 'PLK' (Polish) */ + ptgLanguageTag, /* 'PTG' (Portuguese) */ + romLanguageTag, /* 'ROM' (Romanian) */ + rusLanguageTag, /* 'RUS' (Russian) */ + skyLanguageTag, /* 'SKY' (Slovak) */ + slvLanguageTag, /* 'SLV' (Slovenian) */ + sqiLanguageTag, /* 'SQI' (Albanian) */ + srbLanguageTag, /* 'SRB' (Serbian) */ + sveLanguageTag, /* 'SVE' (Swedish) */ + tibLanguageTag, /* 'TIB' (Tibetan) */ + trkLanguageTag, /* 'TRK' (Turkish) */ + welLanguageTag /* 'WEL' (Welsh) */ }; U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.h b/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.h index 84994095468..885b50c0da2 100644 --- a/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.h +++ b/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.h @@ -25,10 +25,12 @@ /* * - * (C) Copyright IBM Corp. 1998-2004. All Rights Reserved. + * (C) Copyright IBM Corp. 1998-2010. All Rights Reserved. * * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS * YOU REALLY KNOW WHAT YOU'RE DOING. + * + * Generated on: 10/26/2010 02:53:33 PM PDT */ #ifndef __SCRIPTANDLANGUAGES_H @@ -36,55 +38,64 @@ #include "LETypes.h" -U_NAMESPACE_BEGIN - /** * \file * \internal */ +U_NAMESPACE_BEGIN + const LETag zyyyScriptTag = 0x7A797979; /* 'zyyy' (COMMON) */ -const LETag qaaiScriptTag = 0x71616169; /* 'qaai' (INHERITED) */ +const LETag zinhScriptTag = 0x7A696E68; /* 'zinh' (INHERITED) */ const LETag arabScriptTag = 0x61726162; /* 'arab' (ARABIC) */ const LETag armnScriptTag = 0x61726D6E; /* 'armn' (ARMENIAN) */ const LETag bengScriptTag = 0x62656E67; /* 'beng' (BENGALI) */ +const LETag bng2ScriptTag = 0x626E6732; /* 'bng2' (BENGALI v.2) (manually added) */ const LETag bopoScriptTag = 0x626F706F; /* 'bopo' (BOPOMOFO) */ const LETag cherScriptTag = 0x63686572; /* 'cher' (CHEROKEE) */ -const LETag qaacScriptTag = 0x71616163; /* 'qaac' (COPTIC) */ +const LETag coptScriptTag = 0x636F7074; /* 'copt' (COPTIC) */ const LETag cyrlScriptTag = 0x6379726C; /* 'cyrl' (CYRILLIC) */ const LETag dsrtScriptTag = 0x64737274; /* 'dsrt' (DESERET) */ const LETag devaScriptTag = 0x64657661; /* 'deva' (DEVANAGARI) */ +const LETag dev2ScriptTag = 0x64657632; /* 'dev2' (DEVANAGARI v.2) (manually added) */ const LETag ethiScriptTag = 0x65746869; /* 'ethi' (ETHIOPIC) */ const LETag georScriptTag = 0x67656F72; /* 'geor' (GEORGIAN) */ const LETag gothScriptTag = 0x676F7468; /* 'goth' (GOTHIC) */ const LETag grekScriptTag = 0x6772656B; /* 'grek' (GREEK) */ const LETag gujrScriptTag = 0x67756A72; /* 'gujr' (GUJARATI) */ +const LETag gjr2ScriptTag = 0x676A7232; /* 'gjr2' (GUJARATI v.2) (manually added) */ const LETag guruScriptTag = 0x67757275; /* 'guru' (GURMUKHI) */ +const LETag gur2ScriptTag = 0x67757232; /* 'gur2' (GURMUKHI v.2) (manually added) */ const LETag haniScriptTag = 0x68616E69; /* 'hani' (HAN) */ const LETag hangScriptTag = 0x68616E67; /* 'hang' (HANGUL) */ const LETag hebrScriptTag = 0x68656272; /* 'hebr' (HEBREW) */ const LETag hiraScriptTag = 0x68697261; /* 'hira' (HIRAGANA) */ const LETag kndaScriptTag = 0x6B6E6461; /* 'knda' (KANNADA) */ +const LETag knd2ScriptTag = 0x6B6E6432; /* 'knd2' (KANNADA v.2) (manually added) */ const LETag kanaScriptTag = 0x6B616E61; /* 'kana' (KATAKANA) */ const LETag khmrScriptTag = 0x6B686D72; /* 'khmr' (KHMER) */ -const LETag laooScriptTag = 0x6C616F6F; /* 'laoo' (LAO) */ +const LETag laooScriptTag = 0x6C616F20; /* 'lao ' (LAO) */ const LETag latnScriptTag = 0x6C61746E; /* 'latn' (LATIN) */ const LETag mlymScriptTag = 0x6D6C796D; /* 'mlym' (MALAYALAM) */ +const LETag mlm2ScriptTag = 0x6D6C6D32; /* 'mlm2' (MALAYALAM v.2) (manually added) */ const LETag mongScriptTag = 0x6D6F6E67; /* 'mong' (MONGOLIAN) */ const LETag mymrScriptTag = 0x6D796D72; /* 'mymr' (MYANMAR) */ const LETag ogamScriptTag = 0x6F67616D; /* 'ogam' (OGHAM) */ const LETag italScriptTag = 0x6974616C; /* 'ital' (OLD_ITALIC) */ const LETag oryaScriptTag = 0x6F727961; /* 'orya' (ORIYA) */ +const LETag ory2ScriptTag = 0x6F727932; /* 'ory2' (ORIYA v.2) (manually added) */ const LETag runrScriptTag = 0x72756E72; /* 'runr' (RUNIC) */ const LETag sinhScriptTag = 0x73696E68; /* 'sinh' (SINHALA) */ const LETag syrcScriptTag = 0x73797263; /* 'syrc' (SYRIAC) */ const LETag tamlScriptTag = 0x74616D6C; /* 'taml' (TAMIL) */ +const LETag tml2ScriptTag = 0x746D6C32; /* 'tml2' (TAMIL v.2) (manually added) */ const LETag teluScriptTag = 0x74656C75; /* 'telu' (TELUGU) */ +const LETag tel2ScriptTag = 0x74656C32; /* 'tel2' (TELUGU v.2) (manually added) */ const LETag thaaScriptTag = 0x74686161; /* 'thaa' (THAANA) */ const LETag thaiScriptTag = 0x74686169; /* 'thai' (THAI) */ const LETag tibtScriptTag = 0x74696274; /* 'tibt' (TIBETAN) */ const LETag cansScriptTag = 0x63616E73; /* 'cans' (CANADIAN_ABORIGINAL) */ -const LETag yiiiScriptTag = 0x79696969; /* 'yiii' (YI) */ +const LETag yiiiScriptTag = 0x79692020; /* 'yi ' (YI) */ const LETag tglgScriptTag = 0x74676C67; /* 'tglg' (TAGALOG) */ const LETag hanoScriptTag = 0x68616E6F; /* 'hano' (HANUNOO) */ const LETag buhdScriptTag = 0x62756864; /* 'buhd' (BUHID) */ @@ -98,6 +109,98 @@ const LETag shawScriptTag = 0x73686177; /* 'shaw' (SHAVIAN) */ const LETag taleScriptTag = 0x74616C65; /* 'tale' (TAI_LE) */ const LETag ugarScriptTag = 0x75676172; /* 'ugar' (UGARITIC) */ const LETag hrktScriptTag = 0x68726B74; /* 'hrkt' (KATAKANA_OR_HIRAGANA) */ +const LETag bugiScriptTag = 0x62756769; /* 'bugi' (BUGINESE) */ +const LETag glagScriptTag = 0x676C6167; /* 'glag' (GLAGOLITIC) */ +const LETag kharScriptTag = 0x6B686172; /* 'khar' (KHAROSHTHI) */ +const LETag syloScriptTag = 0x73796C6F; /* 'sylo' (SYLOTI_NAGRI) */ +const LETag taluScriptTag = 0x74616C75; /* 'talu' (NEW_TAI_LUE) */ +const LETag tfngScriptTag = 0x74666E67; /* 'tfng' (TIFINAGH) */ +const LETag xpeoScriptTag = 0x7870656F; /* 'xpeo' (OLD_PERSIAN) */ +const LETag baliScriptTag = 0x62616C69; /* 'bali' (BALINESE) */ +const LETag batkScriptTag = 0x6261746B; /* 'batk' (BATAK) */ +const LETag blisScriptTag = 0x626C6973; /* 'blis' (BLIS) */ +const LETag brahScriptTag = 0x62726168; /* 'brah' (BRAHMI) */ +const LETag chamScriptTag = 0x6368616D; /* 'cham' (CHAM) */ +const LETag cirtScriptTag = 0x63697274; /* 'cirt' (CIRT) */ +const LETag cyrsScriptTag = 0x63797273; /* 'cyrs' (CYRS) */ +const LETag egydScriptTag = 0x65677964; /* 'egyd' (EGYD) */ +const LETag egyhScriptTag = 0x65677968; /* 'egyh' (EGYH) */ +const LETag egypScriptTag = 0x65677970; /* 'egyp' (EGYPTIAN_HIEROGLYPHS) */ +const LETag geokScriptTag = 0x67656F6B; /* 'geok' (GEOK) */ +const LETag hansScriptTag = 0x68616E73; /* 'hans' (HANS) */ +const LETag hantScriptTag = 0x68616E74; /* 'hant' (HANT) */ +const LETag hmngScriptTag = 0x686D6E67; /* 'hmng' (HMNG) */ +const LETag hungScriptTag = 0x68756E67; /* 'hung' (HUNG) */ +const LETag indsScriptTag = 0x696E6473; /* 'inds' (INDS) */ +const LETag javaScriptTag = 0x6A617661; /* 'java' (JAVANESE) */ +const LETag kaliScriptTag = 0x6B616C69; /* 'kali' (KAYAH_LI) */ +const LETag latfScriptTag = 0x6C617466; /* 'latf' (LATF) */ +const LETag latgScriptTag = 0x6C617467; /* 'latg' (LATG) */ +const LETag lepcScriptTag = 0x6C657063; /* 'lepc' (LEPCHA) */ +const LETag linaScriptTag = 0x6C696E61; /* 'lina' (LINA) */ +const LETag mandScriptTag = 0x6D616E64; /* 'mand' (MANDAIC) */ +const LETag mayaScriptTag = 0x6D617961; /* 'maya' (MAYA) */ +const LETag meroScriptTag = 0x6D65726F; /* 'mero' (MERO) */ +const LETag nkooScriptTag = 0x6E6B6F20; /* 'nko ' (NKO) */ +const LETag orkhScriptTag = 0x6F726B68; /* 'orkh' (OLD_TURKIC) */ +const LETag permScriptTag = 0x7065726D; /* 'perm' (PERM) */ +const LETag phagScriptTag = 0x70686167; /* 'phag' (PHAGS_PA) */ +const LETag phnxScriptTag = 0x70686E78; /* 'phnx' (PHOENICIAN) */ +const LETag plrdScriptTag = 0x706C7264; /* 'plrd' (PLRD) */ +const LETag roroScriptTag = 0x726F726F; /* 'roro' (RORO) */ +const LETag saraScriptTag = 0x73617261; /* 'sara' (SARA) */ +const LETag syreScriptTag = 0x73797265; /* 'syre' (SYRE) */ +const LETag syrjScriptTag = 0x7379726A; /* 'syrj' (SYRJ) */ +const LETag syrnScriptTag = 0x7379726E; /* 'syrn' (SYRN) */ +const LETag tengScriptTag = 0x74656E67; /* 'teng' (TENG) */ +const LETag vaiiScriptTag = 0x76616920; /* 'vai ' (VAI) */ +const LETag vispScriptTag = 0x76697370; /* 'visp' (VISP) */ +const LETag xsuxScriptTag = 0x78737578; /* 'xsux' (CUNEIFORM) */ +const LETag zxxxScriptTag = 0x7A787878; /* 'zxxx' (ZXXX) */ +const LETag zzzzScriptTag = 0x7A7A7A7A; /* 'zzzz' (UNKNOWN) */ +const LETag cariScriptTag = 0x63617269; /* 'cari' (CARIAN) */ +const LETag jpanScriptTag = 0x6A70616E; /* 'jpan' (JPAN) */ +const LETag lanaScriptTag = 0x6C616E61; /* 'lana' (TAI_THAM) */ +const LETag lyciScriptTag = 0x6C796369; /* 'lyci' (LYCIAN) */ +const LETag lydiScriptTag = 0x6C796469; /* 'lydi' (LYDIAN) */ +const LETag olckScriptTag = 0x6F6C636B; /* 'olck' (OL_CHIKI) */ +const LETag rjngScriptTag = 0x726A6E67; /* 'rjng' (REJANG) */ +const LETag saurScriptTag = 0x73617572; /* 'saur' (SAURASHTRA) */ +const LETag sgnwScriptTag = 0x73676E77; /* 'sgnw' (SGNW) */ +const LETag sundScriptTag = 0x73756E64; /* 'sund' (SUNDANESE) */ +const LETag moonScriptTag = 0x6D6F6F6E; /* 'moon' (MOON) */ +const LETag mteiScriptTag = 0x6D746569; /* 'mtei' (MEETEI_MAYEK) */ +const LETag armiScriptTag = 0x61726D69; /* 'armi' (IMPERIAL_ARAMAIC) */ +const LETag avstScriptTag = 0x61767374; /* 'avst' (AVESTAN) */ +const LETag cakmScriptTag = 0x63616B6D; /* 'cakm' (CAKM) */ +const LETag koreScriptTag = 0x6B6F7265; /* 'kore' (KORE) */ +const LETag kthiScriptTag = 0x6B746869; /* 'kthi' (KAITHI) */ +const LETag maniScriptTag = 0x6D616E69; /* 'mani' (MANI) */ +const LETag phliScriptTag = 0x70686C69; /* 'phli' (INSCRIPTIONAL_PAHLAVI) */ +const LETag phlpScriptTag = 0x70686C70; /* 'phlp' (PHLP) */ +const LETag phlvScriptTag = 0x70686C76; /* 'phlv' (PHLV) */ +const LETag prtiScriptTag = 0x70727469; /* 'prti' (INSCRIPTIONAL_PARTHIAN) */ +const LETag samrScriptTag = 0x73616D72; /* 'samr' (SAMARITAN) */ +const LETag tavtScriptTag = 0x74617674; /* 'tavt' (TAI_VIET) */ +const LETag zmthScriptTag = 0x7A6D7468; /* 'zmth' (ZMTH) */ +const LETag zsymScriptTag = 0x7A73796D; /* 'zsym' (ZSYM) */ +const LETag bamuScriptTag = 0x62616D75; /* 'bamu' (BAMUM) */ +const LETag lisuScriptTag = 0x6C697375; /* 'lisu' (LISU) */ +const LETag nkgbScriptTag = 0x6E6B6762; /* 'nkgb' (NKGB) */ +const LETag sarbScriptTag = 0x73617262; /* 'sarb' (OLD_SOUTH_ARABIAN) */ +const LETag bassScriptTag = 0x62617373; /* 'bass' (BASS) */ +const LETag duplScriptTag = 0x6475706C; /* 'dupl' (DUPL) */ +const LETag elbaScriptTag = 0x656C6261; /* 'elba' (ELBA) */ +const LETag granScriptTag = 0x6772616E; /* 'gran' (GRAN) */ +const LETag kpelScriptTag = 0x6B70656C; /* 'kpel' (KPEL) */ +const LETag lomaScriptTag = 0x6C6F6D61; /* 'loma' (LOMA) */ +const LETag mendScriptTag = 0x6D656E64; /* 'mend' (MEND) */ +const LETag mercScriptTag = 0x6D657263; /* 'merc' (MERC) */ +const LETag narbScriptTag = 0x6E617262; /* 'narb' (NARB) */ +const LETag nbatScriptTag = 0x6E626174; /* 'nbat' (NBAT) */ +const LETag palmScriptTag = 0x70616C6D; /* 'palm' (PALM) */ +const LETag sindScriptTag = 0x73696E64; /* 'sind' (SIND) */ +const LETag waraScriptTag = 0x77617261; /* 'wara' (WARA) */ const LETag nullScriptTag = 0x00000000; /* '' (NULL) */ @@ -132,6 +235,48 @@ const LETag urdLanguageTag = 0x55524420; /* 'URD' (Urdu) */ const LETag zhpLanguageTag = 0x5A485020; /* 'ZHP' (Chinese (Phonetic)) */ const LETag zhsLanguageTag = 0x5A485320; /* 'ZHS' (Chinese (Simplified)) */ const LETag zhtLanguageTag = 0x5A485420; /* 'ZHT' (Chinese (Traditional)) */ +const LETag afkLanguageTag = 0x41464B20; /* 'AFK' (Afrikaans) */ +const LETag belLanguageTag = 0x42454C20; /* 'BEL' (Belarussian) */ +const LETag bgrLanguageTag = 0x42475220; /* 'BGR' (Bulgarian) */ +const LETag catLanguageTag = 0x43415420; /* 'CAT' (Catalan) */ +const LETag cheLanguageTag = 0x43484520; /* 'CHE' (Chechen) */ +const LETag copLanguageTag = 0x434F5020; /* 'COP' (Coptic) */ +const LETag csyLanguageTag = 0x43535920; /* 'CSY' (Czech) */ +const LETag danLanguageTag = 0x44414E20; /* 'DAN' (Danish) */ +const LETag deuLanguageTag = 0x44455520; /* 'DEU' (German) */ +const LETag dznLanguageTag = 0x445A4E20; /* 'DZN' (Dzongkha) */ +const LETag ellLanguageTag = 0x454C4C20; /* 'ELL' (Greek) */ +const LETag engLanguageTag = 0x454E4720; /* 'ENG' (English) */ +const LETag espLanguageTag = 0x45535020; /* 'ESP' (Spanish) */ +const LETag etiLanguageTag = 0x45544920; /* 'ETI' (Estonian) */ +const LETag euqLanguageTag = 0x45555120; /* 'EUQ' (Basque) */ +const LETag finLanguageTag = 0x46494E20; /* 'FIN' (Finnish) */ +const LETag fraLanguageTag = 0x46524120; /* 'FRA' (French) */ +const LETag gaeLanguageTag = 0x47414520; /* 'GAE' (Gaelic) */ +const LETag hauLanguageTag = 0x48415520; /* 'HAU' (Hausa) */ +const LETag hrvLanguageTag = 0x48525620; /* 'HRV' (Croation) */ +const LETag hunLanguageTag = 0x48554E20; /* 'HUN' (Hungarian) */ +const LETag hyeLanguageTag = 0x48594520; /* 'HYE' (Armenian) */ +const LETag indLanguageTag = 0x494E4420; /* 'IND' (Indonesian) */ +const LETag itaLanguageTag = 0x49544120; /* 'ITA' (Italian) */ +const LETag khmLanguageTag = 0x4B484D20; /* 'KHM' (Khmer) */ +const LETag mngLanguageTag = 0x4D4E4720; /* 'MNG' (Mongolian) */ +const LETag mtsLanguageTag = 0x4D545320; /* 'MTS' (Maltese) */ +const LETag nepLanguageTag = 0x4E455020; /* 'NEP' (Nepali) */ +const LETag nldLanguageTag = 0x4E4C4420; /* 'NLD' (Dutch) */ +const LETag pasLanguageTag = 0x50415320; /* 'PAS' (Pashto) */ +const LETag plkLanguageTag = 0x504C4B20; /* 'PLK' (Polish) */ +const LETag ptgLanguageTag = 0x50544720; /* 'PTG' (Portuguese) */ +const LETag romLanguageTag = 0x524F4D20; /* 'ROM' (Romanian) */ +const LETag rusLanguageTag = 0x52555320; /* 'RUS' (Russian) */ +const LETag skyLanguageTag = 0x534B5920; /* 'SKY' (Slovak) */ +const LETag slvLanguageTag = 0x534C5620; /* 'SLV' (Slovenian) */ +const LETag sqiLanguageTag = 0x53514920; /* 'SQI' (Albanian) */ +const LETag srbLanguageTag = 0x53524220; /* 'SRB' (Serbian) */ +const LETag sveLanguageTag = 0x53564520; /* 'SVE' (Swedish) */ +const LETag tibLanguageTag = 0x54494220; /* 'TIB' (Tibetan) */ +const LETag trkLanguageTag = 0x54524B20; /* 'TRK' (Turkish) */ +const LETag welLanguageTag = 0x57454C20; /* 'WEL' (Welsh) */ U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp b/jdk/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp index d2016ba13a7..d9064a11c12 100644 --- a/jdk/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp +++ b/jdk/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp @@ -74,7 +74,7 @@ void SegmentArrayProcessor::process(LEGlyphStorage &glyphStorage) if (offset != 0) { TTGlyphID *glyphArray = (TTGlyphID *) ((char *) subtableHeader + offset); - TTGlyphID newGlyph = (TTGlyphID)SWAPW(glyphArray[LE_GET_GLYPH(thisGlyph) - firstGlyph]); + TTGlyphID newGlyph = SWAPW(glyphArray[LE_GET_GLYPH(thisGlyph) - firstGlyph]); glyphStorage[glyph] = LE_SET_GLYPH(thisGlyph, newGlyph); } diff --git a/jdk/src/share/native/sun/font/layout/ShapingTypeData.cpp b/jdk/src/share/native/sun/font/layout/ShapingTypeData.cpp index c4c293977d4..06529907ba9 100644 --- a/jdk/src/share/native/sun/font/layout/ShapingTypeData.cpp +++ b/jdk/src/share/native/sun/font/layout/ShapingTypeData.cpp @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005. All Rights Reserved. + * (C) Copyright IBM Corp. 1998-2010. All Rights Reserved. * * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS * YOU REALLY KNOW WHAT YOU'RE DOING. @@ -39,72 +39,87 @@ U_NAMESPACE_BEGIN const le_uint8 ArabicShaping::shapingTypeTable[] = { - 0x00, 0x02, 0x00, 0xAD, 0x00, 0xAD, 0x00, 0xAD, 0x00, 0x05, 0x03, 0x00, 0x03, 0x6F, 0x00, 0x05, - 0x04, 0x83, 0x04, 0x86, 0x00, 0x05, 0x04, 0x88, 0x04, 0x89, 0x00, 0x05, 0x05, 0x91, 0x05, 0xB9, - 0x00, 0x05, 0x05, 0xBB, 0x05, 0xBD, 0x00, 0x05, 0x05, 0xBF, 0x05, 0xBF, 0x00, 0x05, 0x05, 0xC1, - 0x05, 0xC2, 0x00, 0x05, 0x05, 0xC4, 0x05, 0xC5, 0x00, 0x05, 0x05, 0xC7, 0x05, 0xC7, 0x00, 0x05, - 0x06, 0x10, 0x06, 0x15, 0x00, 0x05, 0x06, 0x22, 0x06, 0x25, 0x00, 0x04, 0x06, 0x26, 0x06, 0x26, - 0x00, 0x02, 0x06, 0x27, 0x06, 0x27, 0x00, 0x04, 0x06, 0x28, 0x06, 0x28, 0x00, 0x02, 0x06, 0x29, - 0x06, 0x29, 0x00, 0x04, 0x06, 0x2A, 0x06, 0x2E, 0x00, 0x02, 0x06, 0x2F, 0x06, 0x32, 0x00, 0x04, - 0x06, 0x33, 0x06, 0x3A, 0x00, 0x02, 0x06, 0x40, 0x06, 0x40, 0x00, 0x01, 0x06, 0x41, 0x06, 0x47, - 0x00, 0x02, 0x06, 0x48, 0x06, 0x48, 0x00, 0x04, 0x06, 0x49, 0x06, 0x4A, 0x00, 0x02, 0x06, 0x4B, - 0x06, 0x5E, 0x00, 0x05, 0x06, 0x6E, 0x06, 0x6F, 0x00, 0x02, 0x06, 0x70, 0x06, 0x70, 0x00, 0x05, - 0x06, 0x71, 0x06, 0x73, 0x00, 0x04, 0x06, 0x75, 0x06, 0x77, 0x00, 0x04, 0x06, 0x78, 0x06, 0x87, - 0x00, 0x02, 0x06, 0x88, 0x06, 0x99, 0x00, 0x04, 0x06, 0x9A, 0x06, 0xBF, 0x00, 0x02, 0x06, 0xC0, - 0x06, 0xC0, 0x00, 0x04, 0x06, 0xC1, 0x06, 0xC2, 0x00, 0x02, 0x06, 0xC3, 0x06, 0xCB, 0x00, 0x04, - 0x06, 0xCC, 0x06, 0xCC, 0x00, 0x02, 0x06, 0xCD, 0x06, 0xCD, 0x00, 0x04, 0x06, 0xCE, 0x06, 0xCE, - 0x00, 0x02, 0x06, 0xCF, 0x06, 0xCF, 0x00, 0x04, 0x06, 0xD0, 0x06, 0xD1, 0x00, 0x02, 0x06, 0xD2, - 0x06, 0xD3, 0x00, 0x04, 0x06, 0xD5, 0x06, 0xD5, 0x00, 0x04, 0x06, 0xD6, 0x06, 0xDC, 0x00, 0x05, - 0x06, 0xDE, 0x06, 0xE4, 0x00, 0x05, 0x06, 0xE7, 0x06, 0xE8, 0x00, 0x05, 0x06, 0xEA, 0x06, 0xED, - 0x00, 0x05, 0x06, 0xEE, 0x06, 0xEF, 0x00, 0x04, 0x06, 0xFA, 0x06, 0xFC, 0x00, 0x02, 0x06, 0xFF, - 0x06, 0xFF, 0x00, 0x02, 0x07, 0x0F, 0x07, 0x0F, 0x00, 0x05, 0x07, 0x10, 0x07, 0x10, 0x00, 0x04, - 0x07, 0x11, 0x07, 0x11, 0x00, 0x05, 0x07, 0x12, 0x07, 0x14, 0x00, 0x02, 0x07, 0x15, 0x07, 0x19, - 0x00, 0x04, 0x07, 0x1A, 0x07, 0x1D, 0x00, 0x02, 0x07, 0x1E, 0x07, 0x1E, 0x00, 0x04, 0x07, 0x1F, - 0x07, 0x27, 0x00, 0x02, 0x07, 0x28, 0x07, 0x28, 0x00, 0x04, 0x07, 0x29, 0x07, 0x29, 0x00, 0x02, - 0x07, 0x2A, 0x07, 0x2A, 0x00, 0x04, 0x07, 0x2B, 0x07, 0x2B, 0x00, 0x02, 0x07, 0x2C, 0x07, 0x2C, - 0x00, 0x04, 0x07, 0x2D, 0x07, 0x2E, 0x00, 0x02, 0x07, 0x2F, 0x07, 0x2F, 0x00, 0x04, 0x07, 0x30, - 0x07, 0x4A, 0x00, 0x05, 0x07, 0x4D, 0x07, 0x4D, 0x00, 0x04, 0x07, 0x4E, 0x07, 0x58, 0x00, 0x02, - 0x07, 0x59, 0x07, 0x5B, 0x00, 0x04, 0x07, 0x5C, 0x07, 0x6A, 0x00, 0x02, 0x07, 0x6B, 0x07, 0x6C, - 0x00, 0x04, 0x07, 0x6D, 0x07, 0x6D, 0x00, 0x02, 0x07, 0xA6, 0x07, 0xB0, 0x00, 0x05, 0x09, 0x01, - 0x09, 0x02, 0x00, 0x05, 0x09, 0x3C, 0x09, 0x3C, 0x00, 0x05, 0x09, 0x41, 0x09, 0x48, 0x00, 0x05, - 0x09, 0x4D, 0x09, 0x4D, 0x00, 0x05, 0x09, 0x51, 0x09, 0x54, 0x00, 0x05, 0x09, 0x62, 0x09, 0x63, - 0x00, 0x05, 0x09, 0x81, 0x09, 0x81, 0x00, 0x05, 0x09, 0xBC, 0x09, 0xBC, 0x00, 0x05, 0x09, 0xC1, - 0x09, 0xC4, 0x00, 0x05, 0x09, 0xCD, 0x09, 0xCD, 0x00, 0x05, 0x09, 0xE2, 0x09, 0xE3, 0x00, 0x05, - 0x0A, 0x01, 0x0A, 0x02, 0x00, 0x05, 0x0A, 0x3C, 0x0A, 0x3C, 0x00, 0x05, 0x0A, 0x41, 0x0A, 0x42, - 0x00, 0x05, 0x0A, 0x47, 0x0A, 0x48, 0x00, 0x05, 0x0A, 0x4B, 0x0A, 0x4D, 0x00, 0x05, 0x0A, 0x70, - 0x0A, 0x71, 0x00, 0x05, 0x0A, 0x81, 0x0A, 0x82, 0x00, 0x05, 0x0A, 0xBC, 0x0A, 0xBC, 0x00, 0x05, - 0x0A, 0xC1, 0x0A, 0xC5, 0x00, 0x05, 0x0A, 0xC7, 0x0A, 0xC8, 0x00, 0x05, 0x0A, 0xCD, 0x0A, 0xCD, - 0x00, 0x05, 0x0A, 0xE2, 0x0A, 0xE3, 0x00, 0x05, 0x0B, 0x01, 0x0B, 0x01, 0x00, 0x05, 0x0B, 0x3C, - 0x0B, 0x3C, 0x00, 0x05, 0x0B, 0x3F, 0x0B, 0x3F, 0x00, 0x05, 0x0B, 0x41, 0x0B, 0x43, 0x00, 0x05, - 0x0B, 0x4D, 0x0B, 0x4D, 0x00, 0x05, 0x0B, 0x56, 0x0B, 0x56, 0x00, 0x05, 0x0B, 0x82, 0x0B, 0x82, - 0x00, 0x05, 0x0B, 0xC0, 0x0B, 0xC0, 0x00, 0x05, 0x0B, 0xCD, 0x0B, 0xCD, 0x00, 0x05, 0x0C, 0x3E, - 0x0C, 0x40, 0x00, 0x05, 0x0C, 0x46, 0x0C, 0x48, 0x00, 0x05, 0x0C, 0x4A, 0x0C, 0x4D, 0x00, 0x05, - 0x0C, 0x55, 0x0C, 0x56, 0x00, 0x05, 0x0C, 0xBC, 0x0C, 0xBC, 0x00, 0x05, 0x0C, 0xBF, 0x0C, 0xBF, - 0x00, 0x05, 0x0C, 0xC6, 0x0C, 0xC6, 0x00, 0x05, 0x0C, 0xCC, 0x0C, 0xCD, 0x00, 0x05, 0x0D, 0x41, - 0x0D, 0x43, 0x00, 0x05, 0x0D, 0x4D, 0x0D, 0x4D, 0x00, 0x05, 0x0D, 0xCA, 0x0D, 0xCA, 0x00, 0x05, - 0x0D, 0xD2, 0x0D, 0xD4, 0x00, 0x05, 0x0D, 0xD6, 0x0D, 0xD6, 0x00, 0x05, 0x0E, 0x31, 0x0E, 0x31, - 0x00, 0x05, 0x0E, 0x34, 0x0E, 0x3A, 0x00, 0x05, 0x0E, 0x47, 0x0E, 0x4E, 0x00, 0x05, 0x0E, 0xB1, - 0x0E, 0xB1, 0x00, 0x05, 0x0E, 0xB4, 0x0E, 0xB9, 0x00, 0x05, 0x0E, 0xBB, 0x0E, 0xBC, 0x00, 0x05, - 0x0E, 0xC8, 0x0E, 0xCD, 0x00, 0x05, 0x0F, 0x18, 0x0F, 0x19, 0x00, 0x05, 0x0F, 0x35, 0x0F, 0x35, - 0x00, 0x05, 0x0F, 0x37, 0x0F, 0x37, 0x00, 0x05, 0x0F, 0x39, 0x0F, 0x39, 0x00, 0x05, 0x0F, 0x71, - 0x0F, 0x7E, 0x00, 0x05, 0x0F, 0x80, 0x0F, 0x84, 0x00, 0x05, 0x0F, 0x86, 0x0F, 0x87, 0x00, 0x05, - 0x0F, 0x90, 0x0F, 0x97, 0x00, 0x05, 0x0F, 0x99, 0x0F, 0xBC, 0x00, 0x05, 0x0F, 0xC6, 0x0F, 0xC6, - 0x00, 0x05, 0x10, 0x2D, 0x10, 0x30, 0x00, 0x05, 0x10, 0x32, 0x10, 0x32, 0x00, 0x05, 0x10, 0x36, - 0x10, 0x37, 0x00, 0x05, 0x10, 0x39, 0x10, 0x39, 0x00, 0x05, 0x10, 0x58, 0x10, 0x59, 0x00, 0x05, - 0x13, 0x5F, 0x13, 0x5F, 0x00, 0x05, 0x17, 0x12, 0x17, 0x14, 0x00, 0x05, 0x17, 0x32, 0x17, 0x34, - 0x00, 0x05, 0x17, 0x52, 0x17, 0x53, 0x00, 0x05, 0x17, 0x72, 0x17, 0x73, 0x00, 0x05, 0x17, 0xB4, - 0x17, 0xB5, 0x00, 0x05, 0x17, 0xB7, 0x17, 0xBD, 0x00, 0x05, 0x17, 0xC6, 0x17, 0xC6, 0x00, 0x05, - 0x17, 0xC9, 0x17, 0xD3, 0x00, 0x05, 0x17, 0xDD, 0x17, 0xDD, 0x00, 0x05, 0x18, 0x0B, 0x18, 0x0D, - 0x00, 0x05, 0x18, 0xA9, 0x18, 0xA9, 0x00, 0x05, 0x19, 0x20, 0x19, 0x22, 0x00, 0x05, 0x19, 0x27, - 0x19, 0x28, 0x00, 0x05, 0x19, 0x32, 0x19, 0x32, 0x00, 0x05, 0x19, 0x39, 0x19, 0x3B, 0x00, 0x05, - 0x1A, 0x17, 0x1A, 0x18, 0x00, 0x05, 0x1D, 0xC0, 0x1D, 0xC3, 0x00, 0x05, 0x20, 0x0B, 0x20, 0x0B, - 0x00, 0x05, 0x20, 0x0D, 0x20, 0x0D, 0x00, 0x01, 0x20, 0x0E, 0x20, 0x0F, 0x00, 0x05, 0x20, 0x2A, - 0x20, 0x2E, 0x00, 0x05, 0x20, 0x60, 0x20, 0x63, 0x00, 0x05, 0x20, 0x6A, 0x20, 0x6F, 0x00, 0x05, - 0x20, 0xD0, 0x20, 0xEB, 0x00, 0x05, 0x30, 0x2A, 0x30, 0x2F, 0x00, 0x05, 0x30, 0x99, 0x30, 0x9A, - 0x00, 0x05, 0xA8, 0x06, 0xA8, 0x06, 0x00, 0x05, 0xA8, 0x0B, 0xA8, 0x0B, 0x00, 0x05, 0xA8, 0x25, - 0xA8, 0x26, 0x00, 0x05, 0xFB, 0x1E, 0xFB, 0x1E, 0x00, 0x05, 0xFE, 0x00, 0xFE, 0x0F, 0x00, 0x05, - 0xFE, 0x20, 0xFE, 0x23, 0x00, 0x05, 0xFE, 0xFF, 0xFE, 0xFF, 0x00, 0x05, 0xFF, 0xF9, 0xFF, 0xFB, - 0x00, 0x05 + 0x00, 0x02, 0x00, 0xD7, 0x00, 0xAD, 0x00, 0xAD, 0x00, 0x05, 0x03, 0x00, 0x03, 0x6F, 0x00, 0x05, + 0x04, 0x83, 0x04, 0x89, 0x00, 0x05, 0x05, 0x91, 0x05, 0xBD, 0x00, 0x05, 0x05, 0xBF, 0x05, 0xBF, + 0x00, 0x05, 0x05, 0xC1, 0x05, 0xC2, 0x00, 0x05, 0x05, 0xC4, 0x05, 0xC5, 0x00, 0x05, 0x05, 0xC7, + 0x05, 0xC7, 0x00, 0x05, 0x06, 0x10, 0x06, 0x1A, 0x00, 0x05, 0x06, 0x22, 0x06, 0x25, 0x00, 0x04, + 0x06, 0x26, 0x06, 0x26, 0x00, 0x02, 0x06, 0x27, 0x06, 0x27, 0x00, 0x04, 0x06, 0x28, 0x06, 0x28, + 0x00, 0x02, 0x06, 0x29, 0x06, 0x29, 0x00, 0x04, 0x06, 0x2A, 0x06, 0x2E, 0x00, 0x02, 0x06, 0x2F, + 0x06, 0x32, 0x00, 0x04, 0x06, 0x33, 0x06, 0x3F, 0x00, 0x02, 0x06, 0x40, 0x06, 0x40, 0x00, 0x01, + 0x06, 0x41, 0x06, 0x47, 0x00, 0x02, 0x06, 0x48, 0x06, 0x48, 0x00, 0x04, 0x06, 0x49, 0x06, 0x4A, + 0x00, 0x02, 0x06, 0x4B, 0x06, 0x5E, 0x00, 0x05, 0x06, 0x6E, 0x06, 0x6F, 0x00, 0x02, 0x06, 0x70, + 0x06, 0x70, 0x00, 0x05, 0x06, 0x71, 0x06, 0x73, 0x00, 0x04, 0x06, 0x75, 0x06, 0x77, 0x00, 0x04, + 0x06, 0x78, 0x06, 0x87, 0x00, 0x02, 0x06, 0x88, 0x06, 0x99, 0x00, 0x04, 0x06, 0x9A, 0x06, 0xBF, + 0x00, 0x02, 0x06, 0xC0, 0x06, 0xC0, 0x00, 0x04, 0x06, 0xC1, 0x06, 0xC2, 0x00, 0x02, 0x06, 0xC3, + 0x06, 0xCB, 0x00, 0x04, 0x06, 0xCC, 0x06, 0xCC, 0x00, 0x02, 0x06, 0xCD, 0x06, 0xCD, 0x00, 0x04, + 0x06, 0xCE, 0x06, 0xCE, 0x00, 0x02, 0x06, 0xCF, 0x06, 0xCF, 0x00, 0x04, 0x06, 0xD0, 0x06, 0xD1, + 0x00, 0x02, 0x06, 0xD2, 0x06, 0xD3, 0x00, 0x04, 0x06, 0xD5, 0x06, 0xD5, 0x00, 0x04, 0x06, 0xD6, + 0x06, 0xDC, 0x00, 0x05, 0x06, 0xDE, 0x06, 0xE4, 0x00, 0x05, 0x06, 0xE7, 0x06, 0xE8, 0x00, 0x05, + 0x06, 0xEA, 0x06, 0xED, 0x00, 0x05, 0x06, 0xEE, 0x06, 0xEF, 0x00, 0x04, 0x06, 0xFA, 0x06, 0xFC, + 0x00, 0x02, 0x06, 0xFF, 0x06, 0xFF, 0x00, 0x02, 0x07, 0x0F, 0x07, 0x0F, 0x00, 0x05, 0x07, 0x10, + 0x07, 0x10, 0x00, 0x04, 0x07, 0x11, 0x07, 0x11, 0x00, 0x05, 0x07, 0x12, 0x07, 0x14, 0x00, 0x02, + 0x07, 0x15, 0x07, 0x19, 0x00, 0x04, 0x07, 0x1A, 0x07, 0x1D, 0x00, 0x02, 0x07, 0x1E, 0x07, 0x1E, + 0x00, 0x04, 0x07, 0x1F, 0x07, 0x27, 0x00, 0x02, 0x07, 0x28, 0x07, 0x28, 0x00, 0x04, 0x07, 0x29, + 0x07, 0x29, 0x00, 0x02, 0x07, 0x2A, 0x07, 0x2A, 0x00, 0x04, 0x07, 0x2B, 0x07, 0x2B, 0x00, 0x02, + 0x07, 0x2C, 0x07, 0x2C, 0x00, 0x04, 0x07, 0x2D, 0x07, 0x2E, 0x00, 0x02, 0x07, 0x2F, 0x07, 0x2F, + 0x00, 0x04, 0x07, 0x30, 0x07, 0x4A, 0x00, 0x05, 0x07, 0x4D, 0x07, 0x4D, 0x00, 0x04, 0x07, 0x4E, + 0x07, 0x58, 0x00, 0x02, 0x07, 0x59, 0x07, 0x5B, 0x00, 0x04, 0x07, 0x5C, 0x07, 0x6A, 0x00, 0x02, + 0x07, 0x6B, 0x07, 0x6C, 0x00, 0x04, 0x07, 0x6D, 0x07, 0x70, 0x00, 0x02, 0x07, 0x71, 0x07, 0x71, + 0x00, 0x04, 0x07, 0x72, 0x07, 0x72, 0x00, 0x02, 0x07, 0x73, 0x07, 0x74, 0x00, 0x04, 0x07, 0x75, + 0x07, 0x77, 0x00, 0x02, 0x07, 0x78, 0x07, 0x79, 0x00, 0x04, 0x07, 0x7A, 0x07, 0x7F, 0x00, 0x02, + 0x07, 0xA6, 0x07, 0xB0, 0x00, 0x05, 0x07, 0xCA, 0x07, 0xEA, 0x00, 0x02, 0x07, 0xEB, 0x07, 0xF3, + 0x00, 0x05, 0x07, 0xFA, 0x07, 0xFA, 0x00, 0x01, 0x09, 0x01, 0x09, 0x02, 0x00, 0x05, 0x09, 0x3C, + 0x09, 0x3C, 0x00, 0x05, 0x09, 0x41, 0x09, 0x48, 0x00, 0x05, 0x09, 0x4D, 0x09, 0x4D, 0x00, 0x05, + 0x09, 0x51, 0x09, 0x54, 0x00, 0x05, 0x09, 0x62, 0x09, 0x63, 0x00, 0x05, 0x09, 0x81, 0x09, 0x81, + 0x00, 0x05, 0x09, 0xBC, 0x09, 0xBC, 0x00, 0x05, 0x09, 0xC1, 0x09, 0xC4, 0x00, 0x05, 0x09, 0xCD, + 0x09, 0xCD, 0x00, 0x05, 0x09, 0xE2, 0x09, 0xE3, 0x00, 0x05, 0x0A, 0x01, 0x0A, 0x02, 0x00, 0x05, + 0x0A, 0x3C, 0x0A, 0x3C, 0x00, 0x05, 0x0A, 0x41, 0x0A, 0x42, 0x00, 0x05, 0x0A, 0x47, 0x0A, 0x48, + 0x00, 0x05, 0x0A, 0x4B, 0x0A, 0x4D, 0x00, 0x05, 0x0A, 0x51, 0x0A, 0x51, 0x00, 0x05, 0x0A, 0x70, + 0x0A, 0x71, 0x00, 0x05, 0x0A, 0x75, 0x0A, 0x75, 0x00, 0x05, 0x0A, 0x81, 0x0A, 0x82, 0x00, 0x05, + 0x0A, 0xBC, 0x0A, 0xBC, 0x00, 0x05, 0x0A, 0xC1, 0x0A, 0xC5, 0x00, 0x05, 0x0A, 0xC7, 0x0A, 0xC8, + 0x00, 0x05, 0x0A, 0xCD, 0x0A, 0xCD, 0x00, 0x05, 0x0A, 0xE2, 0x0A, 0xE3, 0x00, 0x05, 0x0B, 0x01, + 0x0B, 0x01, 0x00, 0x05, 0x0B, 0x3C, 0x0B, 0x3C, 0x00, 0x05, 0x0B, 0x3F, 0x0B, 0x3F, 0x00, 0x05, + 0x0B, 0x41, 0x0B, 0x44, 0x00, 0x05, 0x0B, 0x4D, 0x0B, 0x4D, 0x00, 0x05, 0x0B, 0x56, 0x0B, 0x56, + 0x00, 0x05, 0x0B, 0x62, 0x0B, 0x63, 0x00, 0x05, 0x0B, 0x82, 0x0B, 0x82, 0x00, 0x05, 0x0B, 0xC0, + 0x0B, 0xC0, 0x00, 0x05, 0x0B, 0xCD, 0x0B, 0xCD, 0x00, 0x05, 0x0C, 0x3E, 0x0C, 0x40, 0x00, 0x05, + 0x0C, 0x46, 0x0C, 0x48, 0x00, 0x05, 0x0C, 0x4A, 0x0C, 0x4D, 0x00, 0x05, 0x0C, 0x55, 0x0C, 0x56, + 0x00, 0x05, 0x0C, 0x62, 0x0C, 0x63, 0x00, 0x05, 0x0C, 0xBC, 0x0C, 0xBC, 0x00, 0x05, 0x0C, 0xBF, + 0x0C, 0xBF, 0x00, 0x05, 0x0C, 0xC6, 0x0C, 0xC6, 0x00, 0x05, 0x0C, 0xCC, 0x0C, 0xCD, 0x00, 0x05, + 0x0C, 0xE2, 0x0C, 0xE3, 0x00, 0x05, 0x0D, 0x41, 0x0D, 0x44, 0x00, 0x05, 0x0D, 0x4D, 0x0D, 0x4D, + 0x00, 0x05, 0x0D, 0x62, 0x0D, 0x63, 0x00, 0x05, 0x0D, 0xCA, 0x0D, 0xCA, 0x00, 0x05, 0x0D, 0xD2, + 0x0D, 0xD4, 0x00, 0x05, 0x0D, 0xD6, 0x0D, 0xD6, 0x00, 0x05, 0x0E, 0x31, 0x0E, 0x31, 0x00, 0x05, + 0x0E, 0x34, 0x0E, 0x3A, 0x00, 0x05, 0x0E, 0x47, 0x0E, 0x4E, 0x00, 0x05, 0x0E, 0xB1, 0x0E, 0xB1, + 0x00, 0x05, 0x0E, 0xB4, 0x0E, 0xB9, 0x00, 0x05, 0x0E, 0xBB, 0x0E, 0xBC, 0x00, 0x05, 0x0E, 0xC8, + 0x0E, 0xCD, 0x00, 0x05, 0x0F, 0x18, 0x0F, 0x19, 0x00, 0x05, 0x0F, 0x35, 0x0F, 0x35, 0x00, 0x05, + 0x0F, 0x37, 0x0F, 0x37, 0x00, 0x05, 0x0F, 0x39, 0x0F, 0x39, 0x00, 0x05, 0x0F, 0x71, 0x0F, 0x7E, + 0x00, 0x05, 0x0F, 0x80, 0x0F, 0x84, 0x00, 0x05, 0x0F, 0x86, 0x0F, 0x87, 0x00, 0x05, 0x0F, 0x90, + 0x0F, 0x97, 0x00, 0x05, 0x0F, 0x99, 0x0F, 0xBC, 0x00, 0x05, 0x0F, 0xC6, 0x0F, 0xC6, 0x00, 0x05, + 0x10, 0x2D, 0x10, 0x30, 0x00, 0x05, 0x10, 0x32, 0x10, 0x37, 0x00, 0x05, 0x10, 0x39, 0x10, 0x3A, + 0x00, 0x05, 0x10, 0x3D, 0x10, 0x3E, 0x00, 0x05, 0x10, 0x58, 0x10, 0x59, 0x00, 0x05, 0x10, 0x5E, + 0x10, 0x60, 0x00, 0x05, 0x10, 0x71, 0x10, 0x74, 0x00, 0x05, 0x10, 0x82, 0x10, 0x82, 0x00, 0x05, + 0x10, 0x85, 0x10, 0x86, 0x00, 0x05, 0x10, 0x8D, 0x10, 0x8D, 0x00, 0x05, 0x13, 0x5F, 0x13, 0x5F, + 0x00, 0x05, 0x17, 0x12, 0x17, 0x14, 0x00, 0x05, 0x17, 0x32, 0x17, 0x34, 0x00, 0x05, 0x17, 0x52, + 0x17, 0x53, 0x00, 0x05, 0x17, 0x72, 0x17, 0x73, 0x00, 0x05, 0x17, 0xB4, 0x17, 0xB5, 0x00, 0x05, + 0x17, 0xB7, 0x17, 0xBD, 0x00, 0x05, 0x17, 0xC6, 0x17, 0xC6, 0x00, 0x05, 0x17, 0xC9, 0x17, 0xD3, + 0x00, 0x05, 0x17, 0xDD, 0x17, 0xDD, 0x00, 0x05, 0x18, 0x0B, 0x18, 0x0D, 0x00, 0x05, 0x18, 0xA9, + 0x18, 0xA9, 0x00, 0x05, 0x19, 0x20, 0x19, 0x22, 0x00, 0x05, 0x19, 0x27, 0x19, 0x28, 0x00, 0x05, + 0x19, 0x32, 0x19, 0x32, 0x00, 0x05, 0x19, 0x39, 0x19, 0x3B, 0x00, 0x05, 0x1A, 0x17, 0x1A, 0x18, + 0x00, 0x05, 0x1B, 0x00, 0x1B, 0x03, 0x00, 0x05, 0x1B, 0x34, 0x1B, 0x34, 0x00, 0x05, 0x1B, 0x36, + 0x1B, 0x3A, 0x00, 0x05, 0x1B, 0x3C, 0x1B, 0x3C, 0x00, 0x05, 0x1B, 0x42, 0x1B, 0x42, 0x00, 0x05, + 0x1B, 0x6B, 0x1B, 0x73, 0x00, 0x05, 0x1B, 0x80, 0x1B, 0x81, 0x00, 0x05, 0x1B, 0xA2, 0x1B, 0xA5, + 0x00, 0x05, 0x1B, 0xA8, 0x1B, 0xA9, 0x00, 0x05, 0x1C, 0x2C, 0x1C, 0x33, 0x00, 0x05, 0x1C, 0x36, + 0x1C, 0x37, 0x00, 0x05, 0x1D, 0xC0, 0x1D, 0xE6, 0x00, 0x05, 0x1D, 0xFE, 0x1D, 0xFF, 0x00, 0x05, + 0x20, 0x0B, 0x20, 0x0B, 0x00, 0x05, 0x20, 0x0D, 0x20, 0x0D, 0x00, 0x01, 0x20, 0x0E, 0x20, 0x0F, + 0x00, 0x05, 0x20, 0x2A, 0x20, 0x2E, 0x00, 0x05, 0x20, 0x60, 0x20, 0x64, 0x00, 0x05, 0x20, 0x6A, + 0x20, 0x6F, 0x00, 0x05, 0x20, 0xD0, 0x20, 0xF0, 0x00, 0x05, 0x2D, 0xE0, 0x2D, 0xFF, 0x00, 0x05, + 0x30, 0x2A, 0x30, 0x2F, 0x00, 0x05, 0x30, 0x99, 0x30, 0x9A, 0x00, 0x05, 0xA6, 0x6F, 0xA6, 0x72, + 0x00, 0x05, 0xA6, 0x7C, 0xA6, 0x7D, 0x00, 0x05, 0xA8, 0x02, 0xA8, 0x02, 0x00, 0x05, 0xA8, 0x06, + 0xA8, 0x06, 0x00, 0x05, 0xA8, 0x0B, 0xA8, 0x0B, 0x00, 0x05, 0xA8, 0x25, 0xA8, 0x26, 0x00, 0x05, + 0xA8, 0xC4, 0xA8, 0xC4, 0x00, 0x05, 0xA9, 0x26, 0xA9, 0x2D, 0x00, 0x05, 0xA9, 0x47, 0xA9, 0x51, + 0x00, 0x05, 0xAA, 0x29, 0xAA, 0x2E, 0x00, 0x05, 0xAA, 0x31, 0xAA, 0x32, 0x00, 0x05, 0xAA, 0x35, + 0xAA, 0x36, 0x00, 0x05, 0xAA, 0x43, 0xAA, 0x43, 0x00, 0x05, 0xAA, 0x4C, 0xAA, 0x4C, 0x00, 0x05, + 0xFB, 0x1E, 0xFB, 0x1E, 0x00, 0x05, 0xFE, 0x00, 0xFE, 0x0F, 0x00, 0x05, 0xFE, 0x20, 0xFE, 0x26, + 0x00, 0x05, 0xFE, 0xFF, 0xFE, 0xFF, 0x00, 0x05, 0xFF, 0xF9, 0xFF, 0xFB, 0x00, 0x05 }; U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/SubstitutionLookups.cpp b/jdk/src/share/native/sun/font/layout/SubstitutionLookups.cpp index 286cf2f063c..7103a3fbb3b 100644 --- a/jdk/src/share/native/sun/font/layout/SubstitutionLookups.cpp +++ b/jdk/src/share/native/sun/font/layout/SubstitutionLookups.cpp @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -53,18 +53,23 @@ void SubstitutionLookup::applySubstitutionLookups( le_uint16 substCount, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, - le_int32 position) + le_int32 position, + LEErrorCode& success) { + if (LE_FAILURE(success)) { + return; + } + GlyphIterator tempIterator(*glyphIterator); - for (le_uint16 subst = 0; subst < substCount; subst += 1) { + for (le_uint16 subst = 0; subst < substCount && LE_SUCCESS(success); subst += 1) { le_uint16 sequenceIndex = SWAPW(substLookupRecordArray[subst].sequenceIndex); le_uint16 lookupListIndex = SWAPW(substLookupRecordArray[subst].lookupListIndex); tempIterator.setCurrStreamPosition(position); tempIterator.next(sequenceIndex); - lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance); + lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance, success); } } diff --git a/jdk/src/share/native/sun/font/layout/SubstitutionLookups.h b/jdk/src/share/native/sun/font/layout/SubstitutionLookups.h index ef06fd07ccc..03693b1ef11 100644 --- a/jdk/src/share/native/sun/font/layout/SubstitutionLookups.h +++ b/jdk/src/share/native/sun/font/layout/SubstitutionLookups.h @@ -25,7 +25,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -60,7 +60,8 @@ struct SubstitutionLookup le_uint16 substCount, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, - le_int32 position); + le_int32 position, + LEErrorCode& success); }; U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.cpp index d4fc121da27..65177a6e94c 100644 --- a/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.cpp +++ b/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.cpp @@ -26,7 +26,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -36,19 +36,24 @@ #include "ScriptAndLanguageTags.h" #include "LEGlyphStorage.h" +#include "KernTable.h" + #include "ThaiShaping.h" U_NAMESPACE_BEGIN UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ThaiLayoutEngine) -ThaiLayoutEngine::ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) - : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags) +ThaiLayoutEngine::ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, LEErrorCode &success) + : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success) { fErrorChar = 0x25CC; // Figure out which presentation forms the font uses - if (fontInstance->canDisplay(0x0E64)) { + if (! fontInstance->canDisplay(0x0E01)) { + // No Thai in font; don't use presentation forms. + fGlyphSet = 3; + } else if (fontInstance->canDisplay(0x0E64)) { // WorldType uses reserved space in Thai block fGlyphSet = 0; } else if (fontInstance->canDisplay(0xF701)) { @@ -116,4 +121,28 @@ le_int32 ThaiLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offse return glyphCount; } +// This is the same as LayoutEngline::adjustGlyphPositions() except that it doesn't call adjustMarkGlyphs +void ThaiLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool /*reverse*/, + LEGlyphStorage &glyphStorage, LEErrorCode &success) +{ + if (LE_FAILURE(success)) { + return; + } + + if (chars == NULL || offset < 0 || count < 0) { + success = LE_ILLEGAL_ARGUMENT_ERROR; + return; + } + + if (fTypoFlags & 0x1) { /* kerning enabled */ + static const le_uint32 kernTableTag = LE_KERN_TABLE_TAG; + + KernTable kt(fFontInstance, getFontTable(kernTableTag)); + kt.process(glyphStorage); + } + + // default is no adjustments + return; +} + U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.h b/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.h index 28e1a72f17a..6851a5c8376 100644 --- a/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.h +++ b/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.h @@ -26,7 +26,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -62,13 +62,14 @@ public: * @param fontInstance - the font * @param scriptCode - the script * @param languageCode - the language + * @param success - set to an error code if the operation fails * * @see LEFontInstance * @see ScriptAndLanguageTags.h for script and language codes * * @internal */ - ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); + ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, LEErrorCode &success); /** * The destructor, virtual for correct polymorphic invocation. @@ -139,6 +140,28 @@ protected: virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); + /** + * This method does positioning adjustments like accent positioning and + * kerning. The default implementation does nothing. Subclasses needing + * position adjustments must override this method. + * + * Note that this method has both characters and glyphs as input so that + * it can use the character codes to determine glyph types if that information + * isn't directly available. (e.g. Some Arabic OpenType fonts don't have a GDEF + * table) + * + * @param chars - the input character context + * @param offset - the offset of the first character to process + * @param count - the number of characters to process + * @param reverse - TRUE if the glyphs in the glyph array have been reordered + * @param glyphStorage - the object which holds the per-glyph storage. The glyph positions will be + * adjusted as needed. + * @param success - output parameter set to an error code if the operation fails + * + * @internal + */ + virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); + }; U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/TibetanLayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/TibetanLayoutEngine.cpp new file mode 100644 index 00000000000..9f706548aae --- /dev/null +++ b/jdk/src/share/native/sun/font/layout/TibetanLayoutEngine.cpp @@ -0,0 +1,112 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved + * + * Developed at DIT - Government of Bhutan + * + * Contact person: Pema Geyleg - + * + * This file is a modification of the ICU file KhmerReordering.cpp + * by Jens Herden and Javier Sola who have given all their possible rights to IBM and the Governement of Bhutan + * A first module for Dzongkha was developed by Karunakar under Panlocalisation funding. + * Assistance for this module has been received from Namgay Thinley, Christopher Fynn and Javier Sola + * + */ + + +#include "OpenTypeLayoutEngine.h" +#include "TibetanLayoutEngine.h" +#include "LEGlyphStorage.h" +#include "TibetanReordering.h" + +U_NAMESPACE_BEGIN + +UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TibetanOpenTypeLayoutEngine) + +TibetanOpenTypeLayoutEngine::TibetanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success) + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable, success) +{ + fFeatureMap = TibetanReordering::getFeatureMap(fFeatureMapCount); + fFeatureOrder = TRUE; +} + +TibetanOpenTypeLayoutEngine::TibetanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, + le_int32 typoFlags, LEErrorCode &success) + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success) +{ + fFeatureMap = TibetanReordering::getFeatureMap(fFeatureMapCount); + fFeatureOrder = TRUE; +} + +TibetanOpenTypeLayoutEngine::~TibetanOpenTypeLayoutEngine() +{ + // nothing to do +} + +// Input: characters +// Output: characters, char indices, tags +// Returns: output character count +le_int32 TibetanOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, + LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) +{ + if (LE_FAILURE(success)) { + return 0; + } + + if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { + success = LE_ILLEGAL_ARGUMENT_ERROR; + return 0; + } + + le_int32 worstCase = count * 3; // worst case is 3 for Khmer TODO check if 2 is enough + + outChars = LE_NEW_ARRAY(LEUnicode, worstCase); + + if (outChars == NULL) { + success = LE_MEMORY_ALLOCATION_ERROR; + return 0; + } + + glyphStorage.allocateGlyphArray(worstCase, rightToLeft, success); + glyphStorage.allocateAuxData(success); + + if (LE_FAILURE(success)) { + LE_DELETE_ARRAY(outChars); + return 0; + } + + // NOTE: assumes this allocates featureTags... + // (probably better than doing the worst case stuff here...) + le_int32 outCharCount = TibetanReordering::reorder(&chars[offset], count, fScriptCode, outChars, glyphStorage); + + glyphStorage.adoptGlyphCount(outCharCount); + return outCharCount; +} + +U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/TibetanLayoutEngine.h b/jdk/src/share/native/sun/font/layout/TibetanLayoutEngine.h new file mode 100644 index 00000000000..c40dcc3343f --- /dev/null +++ b/jdk/src/share/native/sun/font/layout/TibetanLayoutEngine.h @@ -0,0 +1,156 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved + * + * Developed at DIT - Government of Bhutan + * + * Contact person: Pema Geyleg - + * + * This file is a modification of the ICU file KhmerReordering.cpp + * by Jens Herden and Javier Sola who have given all their possible rights to IBM and the Governement of Bhutan + * A first module for Dzongkha was developed by Karunakar under Panlocalisation funding. + * Assistance for this module has been received from Namgay Thinley, Christopher Fynn and Javier Sola + * + */ + +#ifndef __TIBETANLAYOUTENGINE_H +#define __TIBETANLAYOUTENGINE_H + +// #include "LETypes.h" +// #include "LEFontInstance.h" +// #include "LEGlyphFilter.h" +// #include "LayoutEngine.h" +// #include "OpenTypeLayoutEngine.h" + +// #include "GlyphSubstitutionTables.h" +// #include "GlyphDefinitionTables.h" +// #include "GlyphPositioningTables.h" + +U_NAMESPACE_BEGIN + +// class MPreFixups; +// class LEGlyphStorage; + +/** + * This class implements OpenType layout for Dzongkha and Tibetan OpenType fonts + * + * @internal + */ +class TibetanOpenTypeLayoutEngine : public OpenTypeLayoutEngine +{ +public: + /** + * This is the main constructor. It constructs an instance of TibetanOpenTypeLayoutEngine for + * a particular font, script and language. It takes the GSUB table as a parameter since + * LayoutEngine::layoutEngineFactory has to read the GSUB table to know that it has an + * Tibetan OpenType font. + * + * @param fontInstance - the font + * @param scriptCode - the script + * @param langaugeCode - the language + * @param gsubTable - the GSUB table + * @param success - set to an error code if the operation fails + * + * @see LayoutEngine::layoutEngineFactory + * @see OpenTypeLayoutEngine + * @see ScriptAndLangaugeTags.h for script and language codes + * + * @internal + */ + TibetanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success); + + /** + * This constructor is used when the font requires a "canned" GSUB table which can't be known + * until after this constructor has been invoked. + * + * @param fontInstance - the font + * @param scriptCode - the script + * @param langaugeCode - the language + * @param success - set to an error code if the operation fails + * + * @see OpenTypeLayoutEngine + * @see ScriptAndLangaugeTags.h for script and language codes + * + * @internal + */ + TibetanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, + le_int32 typoFlags, LEErrorCode &success); + + /** + * The destructor, virtual for correct polymorphic invocation. + * + * @internal + */ + virtual ~TibetanOpenTypeLayoutEngine(); + + /** + * ICU "poor man's RTTI", returns a UClassID for the actual class. + * + * @internal ICU 3.6 + */ + virtual UClassID getDynamicClassID() const; + + /** + * ICU "poor man's RTTI", returns a UClassID for this class. + * + * @internal ICU 3.6 + */ + static UClassID getStaticClassID(); + +protected: + + /** + * This method does Tibetan OpenType character processing. It assigns the OpenType feature + * tags to the characters, and may generate output characters which have been reordered. + * It may also split some vowels, resulting in more output characters than input characters. + * + * Input parameters: + * @param chars - the input character context + * @param offset - the index of the first character to process + * @param count - the number of characters to process + * @param max - the number of characters in the input context + * @param rightToLeft - TRUE if the characters are in a right to left directional run + * @param glyphStorage - the glyph storage object. The glyph and character index arrays will be set. + * the auxillary data array will be set to the feature tags. + * + * Output parameters: + * @param success - set to an error code if the operation fails + * + * @return the output character count + * + * @internal + */ + virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, + LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); + +}; + +U_NAMESPACE_END +#endif + diff --git a/jdk/src/share/native/sun/font/layout/TibetanReordering.cpp b/jdk/src/share/native/sun/font/layout/TibetanReordering.cpp new file mode 100644 index 00000000000..853843f3895 --- /dev/null +++ b/jdk/src/share/native/sun/font/layout/TibetanReordering.cpp @@ -0,0 +1,414 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved + * + * Developed at DIT - Government of Bhutan + * + * Contact person: Pema Geyleg - + * + * This file is a modification of the ICU file KhmerReordering.cpp + * by Jens Herden and Javier Sola who have given all their possible rights to IBM and the Governement of Bhutan + * A first module for Dzongkha was developed by Karunakar under Panlocalisation funding. + * Assistance for this module has been received from Namgay Thinley, Christopher Fynn and Javier Sola + * + */ + +//#include +#include "LETypes.h" +#include "OpenTypeTables.h" +#include "TibetanReordering.h" +#include "LEGlyphStorage.h" + + +U_NAMESPACE_BEGIN + +// Characters that get refered to by name... +enum +{ + C_DOTTED_CIRCLE = 0x25CC, + C_PRE_NUMBER_MARK = 0x0F3F + }; + + +enum +{ + // simple classes, they are used in the statetable (in this file) to control the length of a syllable + // they are also used to know where a character should be placed (location in reference to the base character) + // and also to know if a character, when independtly displayed, should be displayed with a dotted-circle to + // indicate error in syllable construction + _xx = TibetanClassTable::CC_RESERVED, + _ba = TibetanClassTable::CC_BASE, + _sj = TibetanClassTable::CC_SUBJOINED | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_POS_BELOW, + _tp = TibetanClassTable::CC_TSA_PHRU | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_POS_ABOVE, + _ac = TibetanClassTable::CC_A_CHUNG | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_POS_BELOW, + _cs = TibetanClassTable::CC_COMP_SANSKRIT | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_POS_BELOW, + _ha = TibetanClassTable::CC_HALANTA | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_POS_BELOW, + _bv = TibetanClassTable::CC_BELOW_VOWEL | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_POS_BELOW, + _av = TibetanClassTable::CC_ABOVE_VOWEL | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_POS_ABOVE, + _an = TibetanClassTable::CC_ANUSVARA | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_POS_ABOVE, + _cb = TibetanClassTable::CC_CANDRABINDU | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_POS_ABOVE, + _vs = TibetanClassTable::CC_VISARGA | TibetanClassTable::CF_DOTTED_CIRCLE| TibetanClassTable::CF_POS_AFTER, + _as = TibetanClassTable::CC_ABOVE_S_MARK | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_POS_ABOVE, + _bs = TibetanClassTable::CC_BELOW_S_MARK | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_POS_BELOW, + _di = TibetanClassTable::CC_DIGIT | TibetanClassTable::CF_DIGIT, + _pd = TibetanClassTable::CC_PRE_DIGIT_MARK | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_PREDIGIT | TibetanClassTable::CF_POS_BEFORE , + _bd = TibetanClassTable::CC_POST_BELOW_DIGIT_M | TibetanClassTable::CF_DOTTED_CIRCLE | TibetanClassTable::CF_POS_AFTER +}; + + +// Character class tables +//_xx Non Combining characters +//_ba Base Consonants +//_sj Subjoined consonants +//_tp Tsa - phru +//_ac A-chung, Vowel Lengthening mark +//_cs Precomposed Sanskrit vowel + subjoined consonants +//_ha Halanta/Virama +//_bv Below vowel +//_av above vowel +//_an Anusvara +//_cb Candrabindu +//_vs Visaraga/Post mark +//_as Upper Stress marks +//_bs Lower Stress marks +//_di Digit +//_pd Number pre combining, Needs reordering +//_bd Other number combining marks + +static const TibetanClassTable::CharClass tibetanCharClasses[] = +{ + // 0 1 2 3 4 5 6 7 8 9 a b c d e f + _xx, _ba, _xx, _xx, _ba, _ba, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0F00 - 0F0F 0 + _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _bd, _bd, _xx, _xx, _xx, _xx, _xx, _xx, // 0F10 - 0F1F 1 + _di, _di, _di, _di, _di, _di, _di, _di, _di, _di, _xx, _xx, _xx, _xx, _xx, _xx, // 0F20 - 0F2F 2 + _xx, _xx, _xx, _xx, _xx, _bs, _xx, _bs, _xx, _tp, _xx, _xx, _xx, _xx, _bd, _pd, // 0F30 - 0F3F 3 + _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _xx, _ba, _ba, _ba, _ba, _ba, _ba, _ba, // 0F40 - 0F4F 4 + _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, // 0F50 - 0F5F 5 + _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _ba, _xx, _xx, _xx, _xx, _xx, // 0F60 - 0F6F 6 + _xx, _ac, _av, _cs, _bv, _bv, _cs, _cs, _cs, _cs, _av, _av, _av, _av, _an, _vs, // 0F70 - 0F7F 7 + _av, _cs, _cb, _cb, _ha, _xx, _as, _as, _ba, _ba, _ba, _ba, _xx, _xx, _xx, _xx, // 0F80 - 0F8F 8 + _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _xx, _sj, _sj, _sj, _sj, _sj, _sj, _sj, // 0F90 - 0F9F 9 + _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, // 0FA0 - 0FAF a + _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _sj, _xx, _sj, _sj, // 0FB0 - 0FBF b + _xx, _xx, _xx, _xx, _xx, _xx, _bs, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0FC0 - 0FCF c + _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx,// 0FD0 - 0FDF d + _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0FE0 - 0FEF e + _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, // 0FF0 - 0FFF f +}; + + +// +// Tibetan Class Tables +// + +// +// The range of characters defined in the above table is defined here. For Tibetan 0F00 to 0FFF +// Even if the Tibetan range is bigger, most of the characters are not combinable, and therefore treated +// as _xx +static const TibetanClassTable tibetanClassTable = {0x0F00, 0x0FFF, tibetanCharClasses}; + + +// Below we define how a character in the input string is either in the tibetanCharClasses table +// (in which case we get its type back), or an unknown object in which case we get _xx (CC_RESERVED) back +TibetanClassTable::CharClass TibetanClassTable::getCharClass(LEUnicode ch) const +{ + if (ch < firstChar || ch > lastChar) { + return CC_RESERVED; + } + + return classTable[ch - firstChar]; +} + +const TibetanClassTable *TibetanClassTable::getTibetanClassTable() +{ + return &tibetanClassTable; +} + + + +class TibetanReorderingOutput : public UMemory { +private: + le_int32 fSyllableCount; + le_int32 fOutIndex; + LEUnicode *fOutChars; + + LEGlyphStorage &fGlyphStorage; + + +public: + TibetanReorderingOutput(LEUnicode *outChars, LEGlyphStorage &glyphStorage) + : fSyllableCount(0), fOutIndex(0), fOutChars(outChars), fGlyphStorage(glyphStorage) + { + // nothing else to do... + } + + ~TibetanReorderingOutput() + { + // nothing to do here... + } + + void reset() + { + fSyllableCount += 1; + } + + void writeChar(LEUnicode ch, le_uint32 charIndex, FeatureMask featureMask) + { + LEErrorCode success = LE_NO_ERROR; + + fOutChars[fOutIndex] = ch; + + fGlyphStorage.setCharIndex(fOutIndex, charIndex, success); + fGlyphStorage.setAuxData(fOutIndex, featureMask, success); + + fOutIndex += 1; + } + + le_int32 getOutputIndex() + { + return fOutIndex; + } +}; + + +//TODO remove unused flags +#define ccmpFeatureTag LE_CCMP_FEATURE_TAG +#define blwfFeatureTag LE_BLWF_FEATURE_TAG +#define pstfFeatureTag LE_PSTF_FEATURE_TAG +#define presFeatureTag LE_PRES_FEATURE_TAG +#define blwsFeatureTag LE_BLWS_FEATURE_TAG +#define abvsFeatureTag LE_ABVS_FEATURE_TAG +#define pstsFeatureTag LE_PSTS_FEATURE_TAG + +#define blwmFeatureTag LE_BLWM_FEATURE_TAG +#define abvmFeatureTag LE_ABVM_FEATURE_TAG +#define distFeatureTag LE_DIST_FEATURE_TAG + +#define prefFeatureTag LE_PREF_FEATURE_TAG +#define abvfFeatureTag LE_ABVF_FEATURE_TAG +#define cligFeatureTag LE_CLIG_FEATURE_TAG +#define mkmkFeatureTag LE_MKMK_FEATURE_TAG + +// Shaping features +#define prefFeatureMask 0x80000000UL +#define blwfFeatureMask 0x40000000UL +#define abvfFeatureMask 0x20000000UL +#define pstfFeatureMask 0x10000000UL +#define presFeatureMask 0x08000000UL +#define blwsFeatureMask 0x04000000UL +#define abvsFeatureMask 0x02000000UL +#define pstsFeatureMask 0x01000000UL +#define cligFeatureMask 0x00800000UL +#define ccmpFeatureMask 0x00040000UL + +// Positioning features +#define distFeatureMask 0x00400000UL +#define blwmFeatureMask 0x00200000UL +#define abvmFeatureMask 0x00100000UL +#define mkmkFeatureMask 0x00080000UL + +#define tagPref (ccmpFeatureMask | prefFeatureMask | presFeatureMask | cligFeatureMask | distFeatureMask) +#define tagAbvf (ccmpFeatureMask | abvfFeatureMask | abvsFeatureMask | cligFeatureMask | distFeatureMask | abvmFeatureMask | mkmkFeatureMask) +#define tagPstf (ccmpFeatureMask | blwfFeatureMask | blwsFeatureMask | prefFeatureMask | presFeatureMask | pstfFeatureMask | pstsFeatureMask | cligFeatureMask | distFeatureMask | blwmFeatureMask) +#define tagBlwf (ccmpFeatureMask | blwfFeatureMask | blwsFeatureMask | cligFeatureMask | distFeatureMask | blwmFeatureMask | mkmkFeatureMask) +#define tagDefault (ccmpFeatureMask | prefFeatureMask | blwfFeatureMask | presFeatureMask | blwsFeatureMask | cligFeatureMask | distFeatureMask | abvmFeatureMask | blwmFeatureMask | mkmkFeatureMask) + + + +// These are in the order in which the features need to be applied +// for correct processing +static const FeatureMap featureMap[] = +{ + // Shaping features + {ccmpFeatureTag, ccmpFeatureMask}, + {prefFeatureTag, prefFeatureMask}, + {blwfFeatureTag, blwfFeatureMask}, + {abvfFeatureTag, abvfFeatureMask}, + {pstfFeatureTag, pstfFeatureMask}, + {presFeatureTag, presFeatureMask}, + {blwsFeatureTag, blwsFeatureMask}, + {abvsFeatureTag, abvsFeatureMask}, + {pstsFeatureTag, pstsFeatureMask}, + {cligFeatureTag, cligFeatureMask}, + + // Positioning features + {distFeatureTag, distFeatureMask}, + {blwmFeatureTag, blwmFeatureMask}, + {abvmFeatureTag, abvmFeatureMask}, + {mkmkFeatureTag, mkmkFeatureMask}, +}; + +static const le_int32 featureMapCount = LE_ARRAY_SIZE(featureMap); + +// The stateTable is used to calculate the end (the length) of a well +// formed Tibetan Syllable. +// +// Each horizontal line is ordered exactly the same way as the values in TibetanClassTable +// CharClassValues in TibetanReordering.h This coincidence of values allows the +// follow up of the table. +// +// Each line corresponds to a state, which does not necessarily need to be a type +// of component... for example, state 2 is a base, with is always a first character +// in the syllable, but the state could be produced a consonant of any type when +// it is the first character that is analysed (in ground state). +// +static const le_int8 tibetanStateTable[][TibetanClassTable::CC_COUNT] = +{ + + + //Dzongkha state table + //xx ba sj tp ac cs ha bv av an cb vs as bs di pd bd + { 1, 2, 4, 3, 8, 7, 9, 10, 14, 13, 17, 18, 19, 19, 20, 21, 21,}, // 0 - ground state + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,}, // 1 - exit state (or sign to the right of the syllable) + {-1, -1, 4, 3, 8, 7, 9, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 2 - Base consonant + {-1, -1, 5, -1, 8, 7, -1, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 3 - Tsa phru after base + {-1, -1, 4, 6, 8, 7, 9, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 4 - Subjoined consonant after base + {-1, -1, 5, -1, 8, 7, -1, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 5 - Subjoined consonant after tsa phru + {-1, -1, -1, -1, 8, 7, -1, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 6 - Tsa phru after subjoined consonant + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, 19, -1, -1, -1,}, // 7 - Pre Composed Sanskrit + {-1, -1, -1, -1, -1, -1, -1, 10, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 8 - A-chung + {-1, -1, -1, -1, -1, -1, -1, -1, 14, 13, 17, -1, 19, 19, -1, -1, -1,}, // 9 - Halanta + {-1, -1, -1, -1, -1, -1, -1, 11, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 10 - below vowel 1 + {-1, -1, -1, -1, -1, -1, -1, 12, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 11 - below vowel 2 + {-1, -1, -1, -1, -1, -1, -1, -1, 14, 13, 17, 18, 19, 19, -1, -1, -1,}, // 12 - below vowel 3 + {-1, -1, -1, -1, -1, -1, -1, -1, 14, 17, 17, 18, 19, 19, -1, -1, -1,}, // 13 - Anusvara before vowel + {-1, -1, -1, -1, -1, -1, -1, -1, 15, 17, 17, 18, 19, 19, -1, -1, -1,}, // 14 - above vowel 1 + {-1, -1, -1, -1, -1, -1, -1, -1, 16, 17, 17, 18, 19, 19, -1, -1, -1,}, // 15 - above vowel 2 + {-1, -1, -1, -1, -1, -1, -1, -1, -1, 17, 17, 18, 19, 19, -1, -1, -1,}, // 16 - above vowel 3 + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 19, -1, -1, -1,}, // 17 - Anusvara or Candrabindu after vowel + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, 19, -1, -1, -1,}, // 18 - Visarga + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,}, // 19 - strss mark + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 21, 21,}, // 20 - digit + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,}, // 21 - digit mark + + +}; + + +const FeatureMap *TibetanReordering::getFeatureMap(le_int32 &count) +{ + count = featureMapCount; + + return featureMap; +} + + +// Given an input string of characters and a location in which to start looking +// calculate, using the state table, which one is the last character of the syllable +// that starts in the starting position. +le_int32 TibetanReordering::findSyllable(const TibetanClassTable *classTable, const LEUnicode *chars, le_int32 prev, le_int32 charCount) +{ + le_int32 cursor = prev; + le_int8 state = 0; + + while (cursor < charCount) { + TibetanClassTable::CharClass charClass = (classTable->getCharClass(chars[cursor]) & TibetanClassTable::CF_CLASS_MASK); + + state = tibetanStateTable[state][charClass]; + + if (state < 0) { + break; + } + + cursor += 1; + } + + return cursor; +} + + +// This is the real reordering function as applied to the Tibetan language + +le_int32 TibetanReordering::reorder(const LEUnicode *chars, le_int32 charCount, le_int32, + LEUnicode *outChars, LEGlyphStorage &glyphStorage) +{ + const TibetanClassTable *classTable = TibetanClassTable::getTibetanClassTable(); + + TibetanReorderingOutput output(outChars, glyphStorage); + TibetanClassTable::CharClass charClass; + le_int32 i, prev = 0; + + // This loop only exits when we reach the end of a run, which may contain + // several syllables. + while (prev < charCount) { + le_int32 syllable = findSyllable(classTable, chars, prev, charCount); + + output.reset(); + + // shall we add a dotted circle? + // If in the position in which the base should be (first char in the string) there is + // a character that has the Dotted circle flag (a character that cannot be a base) + // then write a dotted circle + if (classTable->getCharClass(chars[prev]) & TibetanClassTable::CF_DOTTED_CIRCLE) { + output.writeChar(C_DOTTED_CIRCLE, prev, tagDefault); + } + + // copy the rest to output, inverting the pre-number mark if present after a digit. + for (i = prev; i < syllable; i += 1) { + charClass = classTable->getCharClass(chars[i]); + + if ((TibetanClassTable::CF_DIGIT & charClass) + && ( classTable->getCharClass(chars[i+1]) & TibetanClassTable::CF_PREDIGIT)) + { + output.writeChar(C_PRE_NUMBER_MARK, i, tagPref); + output.writeChar(chars[i], i+1 , tagPref); + i += 1; + } else { + switch (charClass & TibetanClassTable::CF_POS_MASK) { + + // If the present character is a number, and the next character is a pre-number combining mark + // then the two characters are reordered + + case TibetanClassTable::CF_POS_ABOVE : + output.writeChar(chars[i], i, tagAbvf); + break; + + case TibetanClassTable::CF_POS_AFTER : + output.writeChar(chars[i], i, tagPstf); + break; + + case TibetanClassTable::CF_POS_BELOW : + output.writeChar(chars[i], i, tagBlwf); + break; + + default: + // default - any other characters + output.writeChar(chars[i], i, tagDefault); + break; + } // switch + } // if + } // for + + prev = syllable; // move the pointer to the start of next syllable + } + + return output.getOutputIndex(); +} + + +U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/TibetanReordering.h b/jdk/src/share/native/sun/font/layout/TibetanReordering.h new file mode 100644 index 00000000000..26a7ce4bb9a --- /dev/null +++ b/jdk/src/share/native/sun/font/layout/TibetanReordering.h @@ -0,0 +1,176 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved + * + * Developed at DIT - Government of Bhutan + * + * Contact person: Pema Geyleg - + * + * This file is a modification of the ICU file KhmerReordering.h + * by Jens Herden and Javier Sola who have given all their possible rights to IBM and the Governement of Bhutan + * A first module for Dzongkha was developed by Karunakar under Panlocalisation funding. + * Assistance for this module has been received from Namgay Thinley, Christopher Fynn and Javier Sola + * + */ + +#ifndef __TIBETANREORDERING_H +#define __TIBETANORDERING_H + +/** + * \file + * \internal + */ + +// #include "LETypes.h" +// #include "OpenTypeTables.h" + +U_NAMESPACE_BEGIN + +class LEGlyphStorage; + +// Vocabulary +// Base -> A consonant in its full (not subscript) form. It is the +// center of the syllable, it can be souranded by subjoined consonants, vowels, +// signs... but there is only one base in a stack, it has to be coded as +// the first character of the syllable.Included here are also groups of base + subjoined +// which are represented by one single code point in unicode (e.g. 0F43) Also other characters that might take +// subjoined consonants or other combining characters. +// Subjoined -> Subjoined consonants and groups of subjoined consonants which have a single code-point +// to repersent the group (even if each subjoined consonant is represented independently +// by anothe code-point +// Tsa Phru --> Tsa Phru character, Bhutanese people will always place it right after the base, but sometimes, due to +// "normalization" +// is placed after all the subjoined consonants, and it is also permitted there. +// A Chung Vowel lengthening mark --> . 0F71 It is placed after the base and any subjoined consonants but before any vowels +// Precomposed Sanskrit vowels --> The are combinations of subjoined consonants + vowels that have been assigned +// a given code-point (in spite of each single part of them having also a code-point +// They are avoided, and users are encouraged to use the combination of code-points that +// represents the same sound instead of using this combined characters. This is included here +// for compatibility with possible texts that use them (they are not in the Dzongkha keyboard). +// Halanta -> The Halanta or Virama character 0F84 indicates that a consonant should not use its inheernt vowel, +// in spite of not having other vowels present. It is usually placed immediatly after a base consonant, +// but in some special cases it can also be placed after a subjoined consonant, so this is also +// permitted in this algorithm. (Halanta is always displayed in Tibetan not used as a connecting char) +// +// Subjoined vowels -> Dependent vowels (matras) placed below the base and below all subjoined consonants. There +// might be as much as three subjoined vowels in a given stack (only one in general text, but up +// to three for abreviations, they have to be permitted). +// Superscript vowels -> There are three superscript vowels, and they can be repeated or combined (up to three +// times. They can combine with subjoined vowels, and are always coded after these. +// Anusvara --> Nasalisation sign. Traditioinally placed in absence of vowels, but also after vowels. In some +// special cases it can be placed before a vowel, so this is also permitted +// Candrabindu -> Forms of the Anusvara with different glyphs (and different in identity) which can be placed +// without vowel or after the vowel, but never before. Cannot combine with Anusvara. +// Stress marks -> Marks placed above or below a syllable, affecting the whole syllable. They are combining +// marks, so they have to be attached to a specific stack. The are using to emphasise a syllable. +// +// Digits -> Digits are not considered as non-combining characters because there are a few characters which +// combine with them, so they have to be considered independently. +// Digit combining marks -> dependent marks that combine with digits. +// +// TODO +// There are a number of characters in the CJK block that are used in Tibetan script, two of these are symbols +// are used as bases for combining glyphs, and have not been encoded in Tibetan. As these characters are outside +// of the tibetan block, they have not been treated in this program. + + +struct TibetanClassTable // This list must include all types of components that can be used inside a syllable +{ + enum CharClassValues // order is important here! This order must be the same that is found in each horizontal + // line in the statetable for Tibetan (file TibetanReordering.cpp). It assigns one number + // to each type of character that has to be considered when analysing the order in which + // characters can be placed + { + CC_RESERVED = 0, //Non Combining Characters + CC_BASE = 1, // Base Consonants, Base Consonants with Subjoined attached in code point, Sanskrit base marks + CC_SUBJOINED = 2, // Subjoined Consonats, combination of more than Subjoined Consonants in the code point + CC_TSA_PHRU = 3, // Tsa-Phru character 0F39 + CC_A_CHUNG = 4, // Vowel Lenthening a-chung mark 0F71 + CC_COMP_SANSKRIT = 5, // Precomposed Sanskrit vowels including Subjoined characters and vowels + CC_HALANTA = 6, // Halanta Character 0F84 + CC_BELOW_VOWEL = 7, // Subjoined vowels + CC_ABOVE_VOWEL = 8, // Superscript vowels + CC_ANUSVARA = 9, // Tibetan sign Rjes Su Nga Ro 0F7E + CC_CANDRABINDU = 10, // Tibetan sign Sna Ldan and Nyi Zla Naa Da 0F82, 0F83 + CC_VISARGA = 11, // Tibetan sign Rnam Bcad (0F7F) + CC_ABOVE_S_MARK = 12, // Stress Marks placed above the text + CC_BELOW_S_MARK = 13, // Stress Marks placed below the text + CC_DIGIT = 14, // Dzongkha Digits + CC_PRE_DIGIT_MARK = 15, // Mark placed before the digit + CC_POST_BELOW_DIGIT_M = 16, // Mark placed below or after the digit + CC_COUNT = 17 // This is the number of character classes + }; + + enum CharClassFlags + { + CF_CLASS_MASK = 0x0000FFFF, + + CF_DOTTED_CIRCLE = 0x04000000, // add a dotted circle if a character with this flag is the first in a syllable + CF_DIGIT = 0x01000000, // flag to speed up comparaisson + CF_PREDIGIT = 0x02000000, // flag to detect pre-digit marks for reordering + + // position flags + CF_POS_BEFORE = 0x00080000, + CF_POS_BELOW = 0x00040000, + CF_POS_ABOVE = 0x00020000, + CF_POS_AFTER = 0x00010000, + CF_POS_MASK = 0x000f0000 + }; + + typedef le_uint32 CharClass; + + typedef le_int32 ScriptFlags; + + LEUnicode firstChar; // for Tibetan this will become xOF00 + LEUnicode lastChar; // and this x0FFF + const CharClass *classTable; + + CharClass getCharClass(LEUnicode ch) const; + + static const TibetanClassTable *getTibetanClassTable(); +}; + + +class TibetanReordering /* not : public UObject because all methods are static */ { +public: + static le_int32 reorder(const LEUnicode *theChars, le_int32 charCount, le_int32 scriptCode, + LEUnicode *outChars, LEGlyphStorage &glyphStorage); + + static const FeatureMap *getFeatureMap(le_int32 &count); + +private: + // do not instantiate + TibetanReordering(); + + static le_int32 findSyllable(const TibetanClassTable *classTable, const LEUnicode *chars, le_int32 prev, le_int32 charCount); + +}; + + +U_NAMESPACE_END +#endif diff --git a/jdk/src/share/native/sun/font/sunFont.c b/jdk/src/share/native/sun/font/sunFont.c index 4c6949e2043..3dd7c3ef4aa 100644 --- a/jdk/src/share/native/sun/font/sunFont.c +++ b/jdk/src/share/native/sun/font/sunFont.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/java2d/cmm/lcms/LCMS.c b/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c index 6bd3ccfa591..7493c837cb8 100644 --- a/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c +++ b/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/java2d/loops/Any3Byte.c b/jdk/src/share/native/sun/java2d/loops/Any3Byte.c index 0f51bdc602b..15364a80699 100644 --- a/jdk/src/share/native/sun/java2d/loops/Any3Byte.c +++ b/jdk/src/share/native/sun/java2d/loops/Any3Byte.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ RegisterFunc RegisterAny3Byte; DECLARE_SOLID_FILLRECT(Any3Byte); DECLARE_SOLID_FILLSPANS(Any3Byte); +DECLARE_SOLID_PARALLELOGRAM(Any3Byte); DECLARE_SOLID_DRAWLINE(Any3Byte); DECLARE_XOR_FILLRECT(Any3Byte); DECLARE_XOR_FILLSPANS(Any3Byte); @@ -48,6 +49,7 @@ DECLARE_XOR_DRAWGLYPHLIST(Any3Byte); NativePrimitive Any3BytePrimitives[] = { REGISTER_SOLID_FILLRECT(Any3Byte), REGISTER_SOLID_FILLSPANS(Any3Byte), + REGISTER_SOLID_PARALLELOGRAM(Any3Byte), REGISTER_SOLID_LINE_PRIMITIVES(Any3Byte), REGISTER_XOR_FILLRECT(Any3Byte), REGISTER_XOR_FILLSPANS(Any3Byte), @@ -72,6 +74,8 @@ DEFINE_SOLID_FILLRECT(Any3Byte) DEFINE_SOLID_FILLSPANS(Any3Byte) +DEFINE_SOLID_PARALLELOGRAM(Any3Byte) + DEFINE_SOLID_DRAWLINE(Any3Byte) DEFINE_XOR_FILLRECT(Any3Byte) diff --git a/jdk/src/share/native/sun/java2d/loops/Any4Byte.c b/jdk/src/share/native/sun/java2d/loops/Any4Byte.c index 126ff922b2e..9dc15327863 100644 --- a/jdk/src/share/native/sun/java2d/loops/Any4Byte.c +++ b/jdk/src/share/native/sun/java2d/loops/Any4Byte.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ RegisterFunc RegisterAny4Byte; DECLARE_SOLID_FILLRECT(Any4Byte); DECLARE_SOLID_FILLSPANS(Any4Byte); +DECLARE_SOLID_PARALLELOGRAM(Any4Byte); DECLARE_SOLID_DRAWLINE(Any4Byte); DECLARE_XOR_FILLRECT(Any4Byte); DECLARE_XOR_FILLSPANS(Any4Byte); @@ -51,6 +52,7 @@ DECLARE_XOR_DRAWGLYPHLIST(Any4Byte); NativePrimitive Any4BytePrimitives[] = { REGISTER_SOLID_FILLRECT(Any4Byte), REGISTER_SOLID_FILLSPANS(Any4Byte), + REGISTER_SOLID_PARALLELOGRAM(Any4Byte), REGISTER_SOLID_LINE_PRIMITIVES(Any4Byte), REGISTER_XOR_FILLRECT(Any4Byte), REGISTER_XOR_FILLSPANS(Any4Byte), @@ -75,6 +77,8 @@ DEFINE_SOLID_FILLRECT(Any4Byte) DEFINE_SOLID_FILLSPANS(Any4Byte) +DEFINE_SOLID_PARALLELOGRAM(Any4Byte) + DEFINE_SOLID_DRAWLINE(Any4Byte) DEFINE_XOR_FILLRECT(Any4Byte) diff --git a/jdk/src/share/native/sun/java2d/loops/AnyByte.c b/jdk/src/share/native/sun/java2d/loops/AnyByte.c index 2d19c0d18c0..ef1f83024f9 100644 --- a/jdk/src/share/native/sun/java2d/loops/AnyByte.c +++ b/jdk/src/share/native/sun/java2d/loops/AnyByte.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ RegisterFunc RegisterAnyByte; DECLARE_SOLID_FILLRECT(AnyByte); DECLARE_SOLID_FILLSPANS(AnyByte); +DECLARE_SOLID_PARALLELOGRAM(AnyByte); DECLARE_SOLID_DRAWLINE(AnyByte); DECLARE_XOR_FILLRECT(AnyByte); DECLARE_XOR_FILLSPANS(AnyByte); @@ -48,6 +49,7 @@ DECLARE_XOR_DRAWGLYPHLIST(AnyByte); NativePrimitive AnyBytePrimitives[] = { REGISTER_SOLID_FILLRECT(AnyByte), REGISTER_SOLID_FILLSPANS(AnyByte), + REGISTER_SOLID_PARALLELOGRAM(AnyByte), REGISTER_SOLID_LINE_PRIMITIVES(AnyByte), REGISTER_XOR_FILLRECT(AnyByte), REGISTER_XOR_FILLSPANS(AnyByte), @@ -72,6 +74,8 @@ DEFINE_SOLID_FILLRECT(AnyByte) DEFINE_SOLID_FILLSPANS(AnyByte) +DEFINE_SOLID_PARALLELOGRAM(AnyByte) + DEFINE_SOLID_DRAWLINE(AnyByte) DEFINE_XOR_FILLRECT(AnyByte) diff --git a/jdk/src/share/native/sun/java2d/loops/AnyInt.c b/jdk/src/share/native/sun/java2d/loops/AnyInt.c index 4e580c6048c..9fb93f2d314 100644 --- a/jdk/src/share/native/sun/java2d/loops/AnyInt.c +++ b/jdk/src/share/native/sun/java2d/loops/AnyInt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ RegisterFunc RegisterAnyInt; DECLARE_SOLID_FILLRECT(AnyInt); DECLARE_SOLID_FILLSPANS(AnyInt); +DECLARE_SOLID_PARALLELOGRAM(AnyInt); DECLARE_SOLID_DRAWLINE(AnyInt); DECLARE_XOR_FILLRECT(AnyInt); DECLARE_XOR_FILLSPANS(AnyInt); @@ -48,6 +49,7 @@ DECLARE_XOR_DRAWGLYPHLIST(AnyInt); NativePrimitive AnyIntPrimitives[] = { REGISTER_SOLID_FILLRECT(AnyInt), REGISTER_SOLID_FILLSPANS(AnyInt), + REGISTER_SOLID_PARALLELOGRAM(AnyInt), REGISTER_SOLID_LINE_PRIMITIVES(AnyInt), REGISTER_XOR_FILLRECT(AnyInt), REGISTER_XOR_FILLSPANS(AnyInt), @@ -72,6 +74,8 @@ DEFINE_SOLID_FILLRECT(AnyInt) DEFINE_SOLID_FILLSPANS(AnyInt) +DEFINE_SOLID_PARALLELOGRAM(AnyInt) + DEFINE_SOLID_DRAWLINE(AnyInt) DEFINE_XOR_FILLRECT(AnyInt) diff --git a/jdk/src/share/native/sun/java2d/loops/AnyShort.c b/jdk/src/share/native/sun/java2d/loops/AnyShort.c index dd04e3096b1..b65d6d62fb0 100644 --- a/jdk/src/share/native/sun/java2d/loops/AnyShort.c +++ b/jdk/src/share/native/sun/java2d/loops/AnyShort.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ RegisterFunc RegisterAnyShort; DECLARE_SOLID_FILLRECT(AnyShort); DECLARE_SOLID_FILLSPANS(AnyShort); +DECLARE_SOLID_PARALLELOGRAM(AnyShort); DECLARE_SOLID_DRAWLINE(AnyShort); DECLARE_XOR_FILLRECT(AnyShort); DECLARE_XOR_FILLSPANS(AnyShort); @@ -48,6 +49,7 @@ DECLARE_XOR_DRAWGLYPHLIST(AnyShort); NativePrimitive AnyShortPrimitives[] = { REGISTER_SOLID_FILLRECT(AnyShort), REGISTER_SOLID_FILLSPANS(AnyShort), + REGISTER_SOLID_PARALLELOGRAM(AnyShort), REGISTER_SOLID_LINE_PRIMITIVES(AnyShort), REGISTER_XOR_FILLRECT(AnyShort), REGISTER_XOR_FILLSPANS(AnyShort), @@ -72,6 +74,8 @@ DEFINE_SOLID_FILLRECT(AnyShort) DEFINE_SOLID_FILLSPANS(AnyShort) +DEFINE_SOLID_PARALLELOGRAM(AnyShort) + DEFINE_SOLID_DRAWLINE(AnyShort) DEFINE_XOR_FILLRECT(AnyShort) diff --git a/jdk/src/share/native/sun/java2d/loops/DrawParallelogram.c b/jdk/src/share/native/sun/java2d/loops/DrawParallelogram.c new file mode 100644 index 00000000000..6bff9ef8081 --- /dev/null +++ b/jdk/src/share/native/sun/java2d/loops/DrawParallelogram.c @@ -0,0 +1,304 @@ +/* + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "math.h" +#include "GraphicsPrimitiveMgr.h" +#include "LineUtils.h" +#include "Trace.h" +#include "ParallelogramUtils.h" + +#include "sun_java2d_loops_DrawParallelogram.h" + +#define HANDLE_PGRAM_EDGE(X1, Y1, X2, Y2, \ + pRasInfo, pixel, pPrim, pFunc, pCompInfo) \ + do { \ + jint ix1 = (jint) floor(X1); \ + jint ix2 = (jint) floor(X2); \ + jint iy1 = (jint) floor(Y1); \ + jint iy2 = (jint) floor(Y2); \ + LineUtils_ProcessLine(pRasInfo, pixel, \ + pFunc, pPrim, pCompInfo, \ + ix1, iy1, ix2, iy2, JNI_TRUE); \ + } while (0) + +typedef struct { + jdouble x0; + jdouble y0; + jdouble y1; + jdouble slope; + jlong dx; + jint ystart; + jint yend; +} EdgeInfo; + +#define STORE_EDGE(pEDGE, X0, Y0, Y1, SLOPE, DELTAX) \ + do { \ + (pEDGE)->x0 = (X0); \ + (pEDGE)->y0 = (Y0); \ + (pEDGE)->y1 = (Y1); \ + (pEDGE)->slope = (SLOPE); \ + (pEDGE)->dx = (DELTAX); \ + (pEDGE)->ystart = (jint) floor((Y0) + 0.5); \ + (pEDGE)->yend = (jint) floor((Y1) + 0.5); \ + } while (0) + +#define STORE_PGRAM(pLTEDGE, pRTEDGE, \ + X0, Y0, dX1, dY1, dX2, dY2, \ + SLOPE1, SLOPE2, DELTAX1, DELTAX2) \ + do { \ + STORE_EDGE((pLTEDGE)+0, \ + (X0), (Y0), (Y0) + (dY1), \ + (SLOPE1), (DELTAX1)); \ + STORE_EDGE((pRTEDGE)+0, \ + (X0), (Y0), (Y0) + (dY2), \ + (SLOPE2), (DELTAX2)); \ + STORE_EDGE((pLTEDGE)+1, \ + (X0) + (dX1), (Y0) + (dY1), (Y0) + (dY1) + (dY2), \ + (SLOPE2), (DELTAX2)); \ + STORE_EDGE((pRTEDGE)+1, \ + (X0) + (dX2), (Y0) + (dY2), (Y0) + (dY1) + (dY2), \ + (SLOPE1), (DELTAX1)); \ + } while (0) + +/* + * Class: sun_java2d_loops_DrawParallelogram + * Method: DrawParallelogram + * Signature: (Lsun/java2d/SunGraphics2D;Lsun/java2d/SurfaceData;DDDDDDDD)V + */ +JNIEXPORT void JNICALL +Java_sun_java2d_loops_DrawParallelogram_DrawParallelogram + (JNIEnv *env, jobject self, + jobject sg2d, jobject sData, + jdouble x0, jdouble y0, + jdouble dx1, jdouble dy1, + jdouble dx2, jdouble dy2, + jdouble lw1, jdouble lw2) +{ + SurfaceDataOps *sdOps; + SurfaceDataRasInfo rasInfo; + NativePrimitive *pPrim; + CompositeInfo compInfo; + jint pixel; + EdgeInfo edges[8]; + EdgeInfo *active[4]; + jint ix1, iy1, ix2, iy2; + jdouble ldx1, ldy1, ldx2, ldy2; + jdouble ox0, oy0; + + /* + * Sort parallelogram by y values, ensure that each delta vector + * has a non-negative y delta. + */ + SORT_PGRAM(x0, y0, dx1, dy1, dx2, dy2, + v = lw1; lw1 = lw2; lw2 = v;); + + // dx,dy for line width in the "1" and "2" directions. + ldx1 = dx1 * lw1; + ldy1 = dy1 * lw1; + ldx2 = dx2 * lw2; + ldy2 = dy2 * lw2; + + // calculate origin of the outer parallelogram + ox0 = x0 - (ldx1 + ldx2) / 2.0; + oy0 = y0 - (ldy1 + ldy2) / 2.0; + + PGRAM_MIN_MAX(ix1, ix2, ox0, dx1+ldx1, dx2+ldx2, JNI_FALSE); + iy1 = (jint) floor(oy0 + 0.5); + iy2 = (jint) floor(oy0 + dy1 + ldy1 + dy2 + ldy2 + 0.5); + + pPrim = GetNativePrim(env, self); + if (pPrim == NULL) { + return; + } + pixel = GrPrim_Sg2dGetPixel(env, sg2d); + if (pPrim->pCompType->getCompInfo != NULL) { + GrPrim_Sg2dGetCompInfo(env, sg2d, pPrim, &compInfo); + } + + sdOps = SurfaceData_GetOps(env, sData); + if (sdOps == NULL) { + return; + } + + GrPrim_Sg2dGetClip(env, sg2d, &rasInfo.bounds); + SurfaceData_IntersectBoundsXYXY(&rasInfo.bounds, ix1, iy1, ix2, iy2); + if (rasInfo.bounds.y2 <= rasInfo.bounds.y1 || + rasInfo.bounds.x2 <= rasInfo.bounds.x1) + { + return; + } + + if (sdOps->Lock(env, sdOps, &rasInfo, pPrim->dstflags) != SD_SUCCESS) { + return; + } + + ix1 = rasInfo.bounds.x1; + iy1 = rasInfo.bounds.y1; + ix2 = rasInfo.bounds.x2; + iy2 = rasInfo.bounds.y2; + if (ix2 > ix1 && iy2 > iy1) { + sdOps->GetRasInfo(env, sdOps, &rasInfo); + if (rasInfo.rasBase) { + jdouble lslope, rslope; + jlong ldx, rdx; + jint loy, hiy, numedges; + FillParallelogramFunc *pFill = + pPrim->funcs.drawparallelogram->fillpgram; + + lslope = (dy1 == 0) ? 0 : dx1 / dy1; + rslope = (dy2 == 0) ? 0 : dx2 / dy2; + ldx = DblToLong(lslope); + rdx = DblToLong(rslope); + + // Only need to generate 4 quads if the interior still + // has a hole in it (i.e. if the line width ratios were + // both less than 1.0) + if (lw1 < 1.0 && lw2 < 1.0) { + // If the line widths are both less than a pixel wide + // then we can use a drawline function instead for even + // more performance. + lw1 = sqrt(ldx1*ldx1 + ldy1*ldy1); + lw2 = sqrt(ldx2*ldx2 + ldy2*ldy2); + if (lw1 <= 1.0001 && lw2 <= 1.0001) { + jdouble x3, y3; + DrawLineFunc *pLine = + pPrim->funcs.drawparallelogram->drawline; + + x3 = (dx1 += x0); + y3 = (dy1 += y0); + x3 += dx2; + y3 += dy2; + dx2 += x0; + dy2 += y0; + + HANDLE_PGRAM_EDGE( x0, y0, dx1, dy1, + &rasInfo, pixel, pPrim, pLine, &compInfo); + HANDLE_PGRAM_EDGE(dx1, dy1, x3, y3, + &rasInfo, pixel, pPrim, pLine, &compInfo); + HANDLE_PGRAM_EDGE( x3, y3, dx2, dy2, + &rasInfo, pixel, pPrim, pLine, &compInfo); + HANDLE_PGRAM_EDGE(dx2, dy2, x0, y0, + &rasInfo, pixel, pPrim, pLine, &compInfo); + SurfaceData_InvokeRelease(env, sdOps, &rasInfo); + SurfaceData_InvokeUnlock(env, sdOps, &rasInfo); + return; + } + + // To simplify the edge management below we presort the + // inner and outer edges so that they are globally sorted + // from left to right. If you scan across the array of + // edges for a given Y range then the edges you encounter + // will be sorted in X as well. + // If AB are left top and bottom edges of outer parallelogram, + // and CD are the right pair of edges, and abcd are the + // corresponding inner parallelogram edges then we want them + // sorted as ABabcdCD to ensure this horizontal ordering. + // Conceptually it is like 2 pairs of nested parentheses. + STORE_PGRAM(edges + 2, edges + 4, + ox0 + ldx1 + ldx2, oy0 + ldy1 + ldy2, + dx1 - ldx1, dy1 - ldy1, + dx2 - ldx2, dy2 - ldy2, + lslope, rslope, ldx, rdx); + numedges = 8; + } else { + // The line width ratios were large enough to consume + // the entire hole in the middle of the parallelogram + // so we can just issue one large quad for the outer + // parallelogram. + numedges = 4; + } + + // The outer parallelogram always goes in the first two + // and last two entries in the array so we either have + // ABabcdCD ordering for 8 edges or ABCD ordering for 4 + // edges. See comment above where we store the inner + // parallelogram for a more complete description. + STORE_PGRAM(edges + 0, edges + numedges-2, + ox0, oy0, + dx1 + ldx1, dy1 + ldy1, + dx2 + ldx2, dy2 + ldy2, + lslope, rslope, ldx, rdx); + + loy = edges[0].ystart; + if (loy < iy1) loy = iy1; + while (loy < iy2) { + jint numactive = 0; + jint cur; + + hiy = iy2; + // Maintaining a sorted edge list is probably overkill for + // 4 or 8 edges. The indices chosen above for storing the + // inner and outer left and right edges already guarantee + // left to right ordering so we just need to scan for edges + // that overlap the current Y range (and also determine the + // maximum Y value for which the range is valid). + for (cur = 0; cur < numedges; cur++) { + EdgeInfo *pEdge = &edges[cur]; + jint yend = pEdge->yend; + if (loy < yend) { + // This edge is still in play, have we reached it yet? + jint ystart = pEdge->ystart; + if (loy < ystart) { + // This edge is not active (yet) + // Stop before we get to the top of it + if (hiy > ystart) hiy = ystart; + } else { + // This edge is active, store it + active[numactive++] = pEdge; + // And stop when we get to the bottom of it + if (hiy > yend) hiy = yend; + } + } + } +#ifdef DEBUG + if ((numactive & 1) != 0) { + J2dTraceLn1(J2D_TRACE_ERROR, + "DrawParallelogram: " + "ODD NUMBER OF PGRAM EDGES (%d)!!", + numactive); + } +#endif + for (cur = 0; cur < numactive; cur += 2) { + EdgeInfo *pLeft = active[cur+0]; + EdgeInfo *pRight = active[cur+1]; + jlong lx = PGRAM_INIT_X(loy, + pLeft->x0, pLeft->y0, + pLeft->slope); + jlong rx = PGRAM_INIT_X(loy, + pRight->x0, pRight->y0, + pRight->slope); + (*pFill)(&rasInfo, + ix1, loy, ix2, hiy, + lx, pLeft->dx, + rx, pRight->dx, + pixel, pPrim, &compInfo); + } + loy = hiy; + } + } + SurfaceData_InvokeRelease(env, sdOps, &rasInfo); + } + SurfaceData_InvokeUnlock(env, sdOps, &rasInfo); +} diff --git a/jdk/src/share/native/sun/java2d/loops/FillParallelogram.c b/jdk/src/share/native/sun/java2d/loops/FillParallelogram.c new file mode 100644 index 00000000000..495c442f4dc --- /dev/null +++ b/jdk/src/share/native/sun/java2d/loops/FillParallelogram.c @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "math.h" +#include "GraphicsPrimitiveMgr.h" +#include "ParallelogramUtils.h" + +#include "sun_java2d_loops_FillParallelogram.h" + +/* + * Class: sun_java2d_loops_FillParallelogram + * Method: FillParallelogram + * Signature: (Lsun/java2d/SunGraphics2D;Lsun/java2d/SurfaceData;DDDDDD)V + */ +JNIEXPORT void JNICALL +Java_sun_java2d_loops_FillParallelogram_FillParallelogram + (JNIEnv *env, jobject self, + jobject sg2d, jobject sData, + jdouble x0, jdouble y0, + jdouble dx1, jdouble dy1, + jdouble dx2, jdouble dy2) +{ + SurfaceDataOps *sdOps; + SurfaceDataRasInfo rasInfo; + NativePrimitive *pPrim; + CompositeInfo compInfo; + jint pixel; + jint ix1, iy1, ix2, iy2; + + if ((dy1 == 0 && dx1 == 0) || (dy2 == 0 && dx2 == 0)) { + return; + } + + /* + * Sort parallelogram by y values, ensure that each delta vector + * has a non-negative y delta. + */ + SORT_PGRAM(x0, y0, dx1, dy1, dx2, dy2, ); + + PGRAM_MIN_MAX(ix1, ix2, x0, dx1, dx2, JNI_FALSE); + iy1 = (jint) floor(y0 + 0.5); + iy2 = (jint) floor(y0 + dy1 + dy2 + 0.5); + + pPrim = GetNativePrim(env, self); + if (pPrim == NULL) { + return; + } + pixel = GrPrim_Sg2dGetPixel(env, sg2d); + if (pPrim->pCompType->getCompInfo != NULL) { + GrPrim_Sg2dGetCompInfo(env, sg2d, pPrim, &compInfo); + } + + sdOps = SurfaceData_GetOps(env, sData); + if (sdOps == NULL) { + return; + } + + GrPrim_Sg2dGetClip(env, sg2d, &rasInfo.bounds); + SurfaceData_IntersectBoundsXYXY(&rasInfo.bounds, ix1, iy1, ix2, iy2); + if (rasInfo.bounds.y2 <= rasInfo.bounds.y1 || + rasInfo.bounds.x2 <= rasInfo.bounds.x1) + { + return; + } + + if (sdOps->Lock(env, sdOps, &rasInfo, pPrim->dstflags) != SD_SUCCESS) { + return; + } + + ix1 = rasInfo.bounds.x1; + iy1 = rasInfo.bounds.y1; + ix2 = rasInfo.bounds.x2; + iy2 = rasInfo.bounds.y2; + if (ix2 > ix1 && iy2 > iy1) { + sdOps->GetRasInfo(env, sdOps, &rasInfo); + if (rasInfo.rasBase) { + jdouble lslope = (dy1 == 0) ? 0 : dx1 / dy1; + jdouble rslope = (dy2 == 0) ? 0 : dx2 / dy2; + jlong ldx = DblToLong(lslope); + jlong rdx = DblToLong(rslope); + jint cy1, cy2, loy, hiy; + dx1 += x0; + dy1 += y0; + dx2 += x0; + dy2 += y0; + cy1 = (jint) floor(dy1 + 0.5); + cy2 = (jint) floor(dy2 + 0.5); + + /* Top triangular portion. */ + loy = iy1; + hiy = (cy1 < cy2) ? cy1 : cy2; + if (hiy > iy2) hiy = iy2; + if (loy < hiy) { + jlong lx = PGRAM_INIT_X(loy, x0, y0, lslope); + jlong rx = PGRAM_INIT_X(loy, x0, y0, rslope); + (*pPrim->funcs.fillparallelogram)(&rasInfo, + ix1, loy, ix2, hiy, + lx, ldx, rx, rdx, + pixel, pPrim, &compInfo); + } + + /* Middle parallelogram portion, which way does it slant? */ + if (cy1 < cy2) { + /* Middle parallelogram portion, slanted to right. */ + /* left leg turned a corner at y0+dy1 */ + /* right leg continuing on its initial trajectory from y0 */ + loy = cy1; + hiy = cy2; + if (loy < iy1) loy = iy1; + if (hiy > iy2) hiy = iy2; + if (loy < hiy) { + jlong lx = PGRAM_INIT_X(loy, dx1, dy1, rslope); + jlong rx = PGRAM_INIT_X(loy, x0, y0, rslope); + (*pPrim->funcs.fillparallelogram)(&rasInfo, + ix1, loy, ix2, hiy, + lx, rdx, rx, rdx, + pixel, pPrim, &compInfo); + } + } else if (cy2 < cy1) { + /* Middle parallelogram portion, slanted to left. */ + /* left leg continuing on its initial trajectory from y0 */ + /* right leg turned a corner at y0+dy2 */ + loy = cy2; + hiy = cy1; + if (loy < iy1) loy = iy1; + if (hiy > iy2) hiy = iy2; + if (loy < hiy) { + jlong lx = PGRAM_INIT_X(loy, x0, y0, lslope); + jlong rx = PGRAM_INIT_X(loy, dx2, dy2, lslope); + (*pPrim->funcs.fillparallelogram)(&rasInfo, + ix1, loy, ix2, hiy, + lx, ldx, rx, ldx, + pixel, pPrim, &compInfo); + } + } + + /* Bottom triangular portion. */ + loy = (cy1 > cy2) ? cy1 : cy2; + if (loy < iy1) loy = iy1; + hiy = iy2; + if (loy < hiy) { + /* left leg turned its corner at y0+dy1, now moving right */ + /* right leg turned its corner at y0+dy2, now moving left */ + jlong lx = PGRAM_INIT_X(loy, dx1, dy1, rslope); + jlong rx = PGRAM_INIT_X(loy, dx2, dy2, lslope); + (*pPrim->funcs.fillparallelogram)(&rasInfo, + ix1, loy, ix2, hiy, + lx, rdx, rx, ldx, + pixel, pPrim, &compInfo); + } + } + SurfaceData_InvokeRelease(env, sdOps, &rasInfo); + } + SurfaceData_InvokeUnlock(env, sdOps, &rasInfo); +} diff --git a/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.c b/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.c index 5ccc7e4b0e8..7e323086c1a 100644 --- a/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.c +++ b/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -574,6 +574,8 @@ struct _PrimitiveTypes PrimitiveTypes = { { "sun/java2d/loops/ScaledBlit", SD_LOCK_READ, SD_LOCK_WRITE, NULL, NULL}, { "sun/java2d/loops/FillRect", 0, SD_LOCK_WRITE, NULL, NULL}, { "sun/java2d/loops/FillSpans", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL}, + { "sun/java2d/loops/FillParallelogram", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL}, + { "sun/java2d/loops/DrawParallelogram", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL}, { "sun/java2d/loops/DrawLine", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL}, { "sun/java2d/loops/DrawRect", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL}, { "sun/java2d/loops/DrawPolygons", 0, SD_LOCK_PARTIAL_WRITE, NULL, NULL}, diff --git a/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h b/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h index 4385785ca42..3efdc272e9c 100644 --- a/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h +++ b/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -333,6 +333,26 @@ typedef void (TransformInterpFunc)(jint *pRGBbase, jint numpix, jint xfract, jint dxfract, jint yfract, jint dyfract); +/* + * The signature of the inner loop function for a "FillParallelogram" + * Note that this same inner loop is used for native DrawParallelogram + * primitives. + * Note that these functions are paired with equivalent DrawLine + * inner loop functions to facilitate nicer looking and faster thin + * transformed drawrect calls. + */ +typedef void (FillParallelogramFunc)(SurfaceDataRasInfo *pRasInfo, + jint lox, jint loy, jint hix, jint hiy, + jlong leftx, jlong dleftx, + jlong rightx, jlong drightx, + jint pixel, struct _NativePrimitive *pPrim, + CompositeInfo *pCompInfo); + +typedef struct { + FillParallelogramFunc *fillpgram; + DrawLineFunc *drawline; +} DrawParallelogramFuncs; + /* * This structure contains all information for defining a single * native GraphicsPrimitive, including: @@ -363,6 +383,8 @@ typedef struct _NativePrimitive { ScaleBlitFunc *scaledblit; FillRectFunc *fillrect; FillSpansFunc *fillspans; + FillParallelogramFunc *fillparallelogram; + DrawParallelogramFuncs *drawparallelogram; DrawLineFunc *drawline; MaskFillFunc *maskfill; MaskBlitFunc *maskblit; @@ -393,6 +415,8 @@ extern struct _PrimitiveTypes { PrimitiveType ScaledBlit; PrimitiveType FillRect; PrimitiveType FillSpans; + PrimitiveType FillParallelogram; + PrimitiveType DrawParallelogram; PrimitiveType DrawLine; PrimitiveType DrawRect; PrimitiveType DrawPolygons; @@ -536,6 +560,7 @@ extern jint sunHints_INTVAL_STROKE_PURE; #define LongOneHalf (((jlong) 1) << 31) #define IntToLong(i) (((jlong) (i)) << 32) #define DblToLong(d) ((jlong) ((d) * IntToLong(1))) +#define LongToDbl(l) (((jdouble) l) / IntToLong(1)) #define WholeOfLong(l) ((jint) ((l) >> 32)) #define FractOfLong(l) ((jint) (l)) #define URShift(i, n) (((juint) (i)) >> (n)) @@ -595,6 +620,10 @@ extern jint sunHints_INTVAL_STROKE_PURE; #define REGISTER_FILLSPANS(SRC, COMP, DST, FUNC) \ REGISTER_PRIMITIVE(FillSpans, SRC, COMP, DST, FUNC) +#define REGISTER_FILLPGRAM(SRC, COMP, DST, FUNC) \ + REGISTER_PRIMITIVE(FillParallelogram, SRC, COMP, DST, FUNC), \ + REGISTER_PRIMITIVE(DrawParallelogram, SRC, COMP, DST, FUNC) + #define REGISTER_LINE_PRIMITIVES(SRC, COMP, DST, FUNC) \ REGISTER_PRIMITIVE(DrawLine, SRC, COMP, DST, FUNC), \ REGISTER_PRIMITIVE(DrawRect, SRC, COMP, DST, FUNC), \ diff --git a/jdk/src/share/native/sun/java2d/loops/LoopMacros.h b/jdk/src/share/native/sun/java2d/loops/LoopMacros.h index 8b54e563fa4..370d024966f 100644 --- a/jdk/src/share/native/sun/java2d/loops/LoopMacros.h +++ b/jdk/src/share/native/sun/java2d/loops/LoopMacros.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -607,6 +607,12 @@ #define NAME_TRANSFORMHELPER_FUNCS(TYPE) TYPE ## TransformHelperFuncs +#define NAME_SOLID_FILLPGRAM(TYPE) TYPE ## SetParallelogram +#define NAME_SOLID_PGRAM_FUNCS(TYPE) TYPE ## SetParallelogramFuncs + +#define NAME_XOR_FILLPGRAM(TYPE) TYPE ## XorParallelogram +#define NAME_XOR_PGRAM_FUNCS(TYPE) TYPE ## XorParallelogramFuncs + /* * These macros conveniently name and declare the indicated native * primitive loop function for forward referencing. @@ -689,6 +695,16 @@ TransformHelperFunc NAME_TRANSFORMHELPER_BC(TYPE); \ TransformHelperFuncs NAME_TRANSFORMHELPER_FUNCS(TYPE) +#define DECLARE_SOLID_PARALLELOGRAM(TYPE) \ + FillParallelogramFunc NAME_SOLID_FILLPGRAM(TYPE); \ + DECLARE_SOLID_DRAWLINE(TYPE); \ + DrawParallelogramFuncs NAME_SOLID_PGRAM_FUNCS(TYPE) + +#define DECLARE_XOR_PARALLELOGRAM(TYPE) \ + FillParallelogramFunc NAME_XOR_FILLPGRAM(TYPE); \ + DECLARE_XOR_DRAWLINE(TYPE); \ + DrawParallelogramFuncs NAME_XOR_PGRAM_FUNCS(TYPE) + /* * These macros construct the necessary NativePrimitive structure * for the indicated native primitive loop function which will be @@ -800,6 +816,18 @@ REGISTER_PRIMITIVE(TransformHelper, TYPE, SrcNoEa, IntArgbPre, \ (AnyFunc *) &NAME_TRANSFORMHELPER_FUNCS(TYPE)) +#define REGISTER_SOLID_PARALLELOGRAM(TYPE) \ + REGISTER_PRIMITIVE(FillParallelogram, AnyColor, SrcNoEa, TYPE, \ + NAME_SOLID_FILLPGRAM(TYPE)), \ + REGISTER_PRIMITIVE(DrawParallelogram, AnyColor, SrcNoEa, TYPE, \ + (AnyFunc *) &NAME_SOLID_PGRAM_FUNCS(TYPE)) + +#define REGISTER_XOR_PARALLELOGRAM(TYPE) \ + REGISTER_PRIMITIVE(FillParallelogram, AnyColor, Xor, TYPE, \ + NAME_XOR_FILLPGRAM(TYPE)), \ + REGISTER_PRIMITIVE(DrawParallelogram, AnyColor, Xor, TYPE, \ + (AnyFunc *) &NAME_XOR_PGRAM_FUNCS(TYPE)) + /* * This macro defines an entire function to implement a Blit inner loop * for copying pixels of a common type from one buffer to another. @@ -1264,6 +1292,51 @@ void NAME_SOLID_FILLSPANS(DST)(SurfaceDataRasInfo *pRasInfo, \ } \ } +/* + * This macro defines an entire function to implement a FillParallelogram + * inner loop for tracing 2 diagonal edges (left and right) and setting + * those regions of pixels between them to a specific pixel value. + * No blending of the fill color is done with the pixels. + */ +#define DEFINE_SOLID_FILLPGRAM(DST) \ +void NAME_SOLID_FILLPGRAM(DST)(SurfaceDataRasInfo *pRasInfo, \ + jint lox, jint loy, jint hix, jint hiy, \ + jlong leftx, jlong dleftx, \ + jlong rightx, jlong drightx, \ + jint pixel, struct _NativePrimitive *pPrim, \ + CompositeInfo *pCompInfo) \ +{ \ + Declare ## DST ## PixelData(pix) \ + jint scan = pRasInfo->scanStride; \ + DST ## DataType *pPix = PtrCoord(pRasInfo->rasBase, 0, 0, loy, scan); \ + \ + Extract ## DST ## PixelData(pixel, pix); \ + while (loy < hiy) { \ + jint lx = WholeOfLong(leftx); \ + jint rx = WholeOfLong(rightx); \ + if (lx < lox) lx = lox; \ + if (rx > hix) rx = hix; \ + while (lx < rx) { \ + Store ## DST ## PixelData(pPix, lx, pixel, pix); \ + lx++; \ + } \ + pPix = PtrAddBytes(pPix, scan); \ + leftx += dleftx; \ + rightx += drightx; \ + loy++; \ + } \ +} + +#define DEFINE_SOLID_DRAWPARALLELOGRAM_FUNCS(DST) \ + DrawParallelogramFuncs NAME_SOLID_PGRAM_FUNCS(DST) = { \ + NAME_SOLID_FILLPGRAM(DST), \ + NAME_SOLID_DRAWLINE(DST), \ + }; + +#define DEFINE_SOLID_PARALLELOGRAM(DST) \ + DEFINE_SOLID_FILLPGRAM(DST) \ + DEFINE_SOLID_DRAWPARALLELOGRAM_FUNCS(DST) + /* * This macro declares the bumpmajor and bumpminor variables used for the * DrawLine functions. diff --git a/jdk/src/share/native/sun/java2d/loops/MaskFill.c b/jdk/src/share/native/sun/java2d/loops/MaskFill.c index c64f3190646..6691ede7a35 100644 --- a/jdk/src/share/native/sun/java2d/loops/MaskFill.c +++ b/jdk/src/share/native/sun/java2d/loops/MaskFill.c @@ -23,7 +23,11 @@ * questions. */ +#include +#include +#include #include "GraphicsPrimitiveMgr.h" +#include "ParallelogramUtils.h" #include "sun_java2d_loops_MaskFill.h" @@ -93,6 +97,967 @@ Java_sun_java2d_loops_MaskFill_MaskFill } } SurfaceData_InvokeRelease(env, sdOps, &rasInfo); + } + SurfaceData_InvokeUnlock(env, sdOps, &rasInfo); +} + +#define MASK_BUF_LEN 1024 + +#define DblToMask(v) ((unsigned char) ((v)*255.9999)) + +/* Fills an aligned rectangle with potentially translucent edges. */ +static void +fillAARect(NativePrimitive *pPrim, SurfaceDataRasInfo *pRasInfo, + CompositeInfo *pCompInfo, jint color, unsigned char *pMask, + void *pDst, + jdouble x1, jdouble y1, jdouble x2, jdouble y2) +{ + jint cx1 = pRasInfo->bounds.x1; + jint cy1 = pRasInfo->bounds.y1; + jint cx2 = pRasInfo->bounds.x2; + jint cy2 = pRasInfo->bounds.y2; + jint rx1 = (jint) ceil(x1); + jint ry1 = (jint) ceil(y1); + jint rx2 = (jint) floor(x2); + jint ry2 = (jint) floor(y2); + jint width = cx2 - cx1; + jint scan = pRasInfo->scanStride; + /* Convert xy12 into the edge coverage fractions for those edges. */ + x1 = rx1-x1; + y1 = ry1-y1; + x2 = x2-rx2; + y2 = y2-ry2; + if (ry2 < ry1) { + /* Accumulate bottom coverage into top coverage. */ + y1 = y1 + y2 - 1.0; + /* prevent processing of "bottom fractional row" */ + ry2 = cy2; + } + if (rx2 < rx1) { + /* Accumulate right coverage into left coverage. */ + x1 = x1 + x2 - 1.0; + /* prevent processing of "right fractional column" */ + rx2 = cx2; + } + /* Check for a visible "top fractional row" and process it */ + if (cy1 < ry1) { + unsigned char midcov = DblToMask(y1); + jint x; + for (x = 0; x < width; x++) { + pMask[x] = midcov; + } + if (cx1 < rx1) { + pMask[0] = DblToMask(y1 * x1); + } + if (cx2 > rx2) { + pMask[width-1] = DblToMask(y1 * x2); + } + (*pPrim->funcs.maskfill)(pDst, + pMask, 0, 0, + width, 1, + color, pRasInfo, + pPrim, pCompInfo); + pDst = PtrAddBytes(pDst, scan); + cy1++; + } + /* Check for a visible "left fract, solid middle, right fract" section. */ + if (cy1 < ry2 && cy1 < cy2) { + jint midh = ((ry2 < cy2) ? ry2 : cy2) - cy1; + jint midx = cx1; + void *pMid = pDst; + /* First process the left "fractional column" if it is visible. */ + if (midx < rx1) { + pMask[0] = DblToMask(x1); + /* Note: maskscan == 0 means we reuse this value for every row. */ + (*pPrim->funcs.maskfill)(pMid, + pMask, 0, 0, + 1, midh, + color, pRasInfo, + pPrim, pCompInfo); + pMid = PtrAddBytes(pMid, pRasInfo->pixelStride); + midx++; + } + /* Process the central solid section if it is visible. */ + if (midx < rx2 && midx < cx2) { + jint midw = ((rx2 < cx2) ? rx2 : cx2) - midx; + /* A NULL mask buffer means "all coverages are 0xff" */ + (*pPrim->funcs.maskfill)(pMid, + NULL, 0, 0, + midw, midh, + color, pRasInfo, + pPrim, pCompInfo); + pMid = PtrCoord(pMid, midw, pRasInfo->pixelStride, 0, 0); + midx += midw; + } + /* Finally process the right "fractional column" if it is visible. */ + if (midx < cx2) { + pMask[0] = DblToMask(x2); + /* Note: maskscan == 0 means we reuse this value for every row. */ + (*pPrim->funcs.maskfill)(pMid, + pMask, 0, 0, + 1, midh, + color, pRasInfo, + pPrim, pCompInfo); + } + cy1 += midh; + pDst = PtrCoord(pDst, 0, 0, midh, scan); + } + /* Check for a visible "bottom fractional row" and process it */ + if (cy1 < cy2) { + unsigned char midcov = DblToMask(y2); + jint x; + for (x = 0; x < width; x++) { + pMask[x] = midcov; + } + if (cx1 < rx1) { + pMask[0] = DblToMask(y2 * x1); + } + if (cx2 > rx2) { + pMask[width-1] = DblToMask(y2 * x2); + } + (*pPrim->funcs.maskfill)(pDst, + pMask, 0, 0, + width, 1, + color, pRasInfo, + pPrim, pCompInfo); + } +} + +/* + * Support code for arbitrary tracing and MaskFill filling of + * non-rectilinear (diagonal) parallelograms. + * + * This code is based upon the following model of AA coverage. + * + * Each edge of a parallelogram (for fillPgram) or a double + * parallelogram (inner and outer parallelograms for drawPgram) + * can be rasterized independently because the geometry is well + * defined in such a way that none of the sides will ever cross + * each other and they have a fixed ordering that is fairly + * well predetermined. + * + * So, for each edge we will look at the diagonal line that + * the edge makes as it passes through a row of pixels. Some + * such diagonal lines may pass entirely through the row of + * pixels in a single pixel column. Some may cut across the + * row and pass through several pixel columns before they pass + * on to the next row. + * + * As the edge passes through the row of pixels it will affect + * the coverage of the pixels it passes through as well as all + * of the pixels to the right of the edge. The coverage will + * either be increased (by a left edge of a parallelogram) or + * decreased (by a right edge) for all pixels to the right, until + * another edge passing the opposite direction is encountered. + * + * The coverage added or subtracted by an edge as it crosses a + * given pixel is calculated using a trapezoid formula in the + * following manner: + * + * / + * +-----+---/-+-----+ + * | | / | | + * | | / | | + * +-----+/----+-----+ + * / + * + * The area to the right of that edge for the pixel where it + * crosses is given as: + * + * trapheight * (topedge + bottomedge)/2 + * + * Another thing to note is that the above formula gives the + * contribution of that edge to the given pixel where it crossed, + * but in so crossing the pixel row, it also created 100% coverage + * for all of the pixels to the right. + * + * This example was simplified in that the edge depicted crossed + * the complete pixel row and it did so entirely within the bounds + * of a single pixel column. In practice, many edges may start or + * end in a given row and thus provide only partial row coverage + * (i.e. the total "trapheight" in the formula never reaches 1.0). + * And in other cases, edges may travel sideways through several + * pixel columns on a given pixel row from where they enter it to + * where the leave it (which also mans that the trapheight for a + * given pixel will be less than 1.0, but by the time the edge + * completes its journey through the pixel row the "coverage shadow" + * that it casts on all pixels to the right eventually reaches 100%). + * + * In order to simplify the calculations so that we don't have to + * keep propagating coverages we calculate for one edge "until we + * reach another edge" we will process one edge at a time and + * simply record in a buffer the amount that an edge added to + * or subtracted from the coverage for a given pixel and its + * following right-side neighbors. Thus, the true total coverage + * of a given pixel is only determined by summing the deltas for + * that pixel and all of the pixels to its left. Since we already + * have to scan the buffer to change floating point coverages into + * mask values for a MaskFill loop, it is simple enough to sum the + * values as we perform that scan from left to right. + * + * In the above example, note that 2 deltas need to be recorded even + * though the edge only intersected a single pixel. The delta recorded + * for the pixel where the edge crossed will be approximately 55% + * (guesstimating by examining the poor ascii art) which is fine for + * determining how to render that pixel, but the rest of the pixels + * to its right should have their coverage modified by a full 100% + * and the 55% delta value we recorded for the pixel that the edge + * crossed will not get them there. We adjust for this by adding + * the "remainder" of the coverage implied by the shadow to the + * pixel immediately to the right of where we record a trapezoidal + * contribution. In this case a delta of 45% will be recorded in + * the pixel immediately to the right to raise the total to 100%. + * + * As we sum these delta values as we process the line from left + * to right, these delta values will typically drive the sum from + * 0% up to 100% and back down to 0% over the course of a single + * pixel row. In the case of a drawn (double) parallelogram the + * sum will go to 100% and back to 0% twice on most scanlines. + * + * The fillAAPgram and drawAAPgram functions drive the main flow + * of the algorithm with help from the following structures, + * macros, and functions. It is probably best to start with + * those 2 functions to gain an understanding of the algorithm. + */ +typedef struct { + jdouble x; + jdouble y; + jdouble xbot; + jdouble ybot; + jdouble xnexty; + jdouble ynextx; + jdouble xnextx; + jdouble linedx; + jdouble celldx; + jdouble celldy; + jboolean isTrailing; +} EdgeInfo; + +#define MIN_DELTA (1.0/256.0) + +/* + * Calculates slopes and deltas for an edge and stores results in an EdgeInfo. + * Returns true if the edge was valid (i.e. not ignored for some reason). + */ +static jboolean +storeEdge(EdgeInfo *pEdge, + jdouble x, jdouble y, jdouble dx, jdouble dy, + jint cx1, jint cy1, jint cx2, jint cy2, + jboolean isTrailing) +{ + jdouble xbot = x + dx; + jdouble ybot = y + dy; + jboolean ret; + + pEdge->x = x; + pEdge->y = y; + pEdge->xbot = xbot; + pEdge->ybot = ybot; + + /* Note that parallelograms are sorted so dy is always non-negative */ + if (dy > MIN_DELTA && /* NaN and horizontal protection */ + ybot > cy1 && /* NaN and "OUT_ABOVE" protection */ + y < cy2 && /* NaN and "OUT_BELOW" protection */ + xbot == xbot && /* NaN protection */ + (x < cx2 || xbot < cx2)) /* "OUT_RIGHT" protection */ + /* Note: "OUT_LEFT" segments may still contribute coverage... */ + { + /* no NaNs, dy is not horizontal, and segment contributes to clip */ + if (dx < -MIN_DELTA || dx > MIN_DELTA) { + /* dx is not vertical */ + jdouble linedx; + jdouble celldy; + jdouble nextx; + + linedx = dx / dy; + celldy = dy / dx; + if (y < cy1) { + pEdge->x = x = x + (cy1 - y) * linedx; + pEdge->y = y = cy1; + } + pEdge->linedx = linedx; + if (dx < 0) { + pEdge->celldx = -1.0; + pEdge->celldy = -celldy; + pEdge->xnextx = nextx = ceil(x) - 1.0; + } else { + pEdge->celldx = +1.0; + pEdge->celldy = celldy; + pEdge->xnextx = nextx = floor(x) + 1.0; + } + pEdge->ynextx = y + (nextx - x) * celldy; + pEdge->xnexty = x + ((floor(y) + 1) - y) * linedx; + } else { + /* dx is essentially vertical */ + if (y < cy1) { + pEdge->y = y = cy1; + } + pEdge->xbot = x; + pEdge->linedx = 0.0; + pEdge->celldx = 0.0; + pEdge->celldy = 1.0; + pEdge->xnextx = x; + pEdge->xnexty = x; + pEdge->ynextx = ybot; + } + ret = JNI_TRUE; + } else { + /* There is some reason to ignore this segment, "celldy=0" omits it */ + pEdge->ybot = y; + pEdge->linedx = dx; + pEdge->celldx = dx; + pEdge->celldy = 0.0; + pEdge->xnextx = xbot; + pEdge->xnexty = xbot; + pEdge->ynextx = y; + ret = JNI_FALSE; + } + pEdge->isTrailing = isTrailing; + return ret; +} + +/* + * Calculates and stores slopes and deltas for all edges of a parallelogram. + * Returns true if at least 1 edge was valid (i.e. not ignored for some reason). + * + * The inverted flag is true for an outer parallelogram (left and right + * edges are leading and trailing) and false for an inner parallelogram + * (where the left edge is trailing and the right edge is leading). + */ +static jboolean +storePgram(EdgeInfo *pLeftEdge, EdgeInfo *pRightEdge, + jdouble x, jdouble y, + jdouble dx1, jdouble dy1, + jdouble dx2, jdouble dy2, + jint cx1, jint cy1, jint cx2, jint cy2, + jboolean inverted) +{ + jboolean ret = JNI_FALSE; + ret = (storeEdge(pLeftEdge + 0, + x , y , dx1, dy1, + cx1, cy1, cx2, cy2, inverted) || ret); + ret = (storeEdge(pLeftEdge + 1, + x+dx1, y+dy1, dx2, dy2, + cx1, cy1, cx2, cy2, inverted) || ret); + ret = (storeEdge(pRightEdge + 0, + x , y , dx2, dy2, + cx1, cy1, cx2, cy2, !inverted) || ret); + ret = (storeEdge(pRightEdge + 1, + x+dx2, y+dy2, dx1, dy1, + cx1, cy1, cx2, cy2, !inverted) || ret); + return ret; +} + +/* + * The X0,Y0,X1,Y1 values represent a trapezoidal fragment whose + * coverage must be accounted for in the accum buffer. + * + * All four values are assumed to fall within (or on the edge of) + * a single pixel. + * + * The trapezoid area is accumulated into the proper element of + * the accum buffer and the remainder of the "slice height" is + * accumulated into the element to its right. + */ +#define INSERT_ACCUM(pACCUM, IMIN, IMAX, X0, Y0, X1, Y1, CX1, CX2, MULT) \ + do { \ + jdouble xmid = ((X0) + (X1)) * 0.5; \ + if (xmid <= (CX2)) { \ + jdouble sliceh = ((Y1) - (Y0)); \ + jdouble slicearea; \ + jint i; \ + if (xmid < (CX1)) { \ + /* Accumulate the entire slice height into accum[0]. */ \ + i = 0; \ + slicearea = sliceh; \ + } else { \ + jdouble xpos = floor(xmid); \ + i = ((jint) xpos) - (CX1); \ + slicearea = (xpos+1-xmid) * sliceh; \ + } \ + if (IMIN > i) { \ + IMIN = i; \ + } \ + (pACCUM)[i++] += (jfloat) ((MULT) * slicearea); \ + (pACCUM)[i++] += (jfloat) ((MULT) * (sliceh - slicearea)); \ + if (IMAX < i) { \ + IMAX = i; \ + } \ + } \ + } while (0) + +/* + * Accumulate the contributions for a given edge crossing a given + * scan line into the corresponding entries of the accum buffer. + * CY1 is the Y coordinate of the top edge of the scanline and CY2 + * is equal to (CY1 + 1) and is the Y coordinate of the bottom edge + * of the scanline. CX1 and CX2 are the left and right edges of the + * clip (or area of interest) being rendered. + * + * The edge is processed from the top edge to the bottom edge and + * a single pixel column at a time. + */ +#define ACCUM_EDGE(pEDGE, pACCUM, IMIN, IMAX, CX1, CY1, CX2, CY2) \ + do { \ + jdouble x, y, xnext, ynext, xlast, ylast, dx, dy, mult; \ + y = (pEDGE)->y; \ + dy = (pEDGE)->celldy; \ + ylast = (pEDGE)->ybot; \ + if (ylast <= (CY1) || y >= (CY2) || dy == 0.0) { \ + break; \ + } \ + x = (pEDGE)->x; \ + dx = (pEDGE)->celldx; \ + if (ylast > (CY2)) { \ + ylast = (CY2); \ + xlast = (pEDGE)->xnexty; \ + } else { \ + xlast = (pEDGE)->xbot; \ + } \ + xnext = (pEDGE)->xnextx; \ + ynext = (pEDGE)->ynextx; \ + mult = ((pEDGE)->isTrailing) ? -1.0 : 1.0; \ + while (ynext <= ylast) { \ + INSERT_ACCUM(pACCUM, IMIN, IMAX, \ + x, y, xnext, ynext, \ + CX1, CX2, mult); \ + x = xnext; \ + y = ynext; \ + xnext += dx; \ + ynext += dy; \ + } \ + (pEDGE)->ynextx = ynext; \ + (pEDGE)->xnextx = xnext; \ + INSERT_ACCUM(pACCUM, IMIN, IMAX, \ + x, y, xlast, ylast, \ + CX1, CX2, mult); \ + (pEDGE)->x = xlast; \ + (pEDGE)->y = ylast; \ + (pEDGE)->xnexty = xlast + (pEDGE)->linedx; \ + } while(0) + +/* Main function to fill a single Parallelogram */ +static void +fillAAPgram(NativePrimitive *pPrim, SurfaceDataRasInfo *pRasInfo, + CompositeInfo *pCompInfo, jint color, unsigned char *pMask, + void *pDst, + jdouble x1, jdouble y1, + jdouble dx1, jdouble dy1, + jdouble dx2, jdouble dy2) +{ + jint cx1 = pRasInfo->bounds.x1; + jint cy1 = pRasInfo->bounds.y1; + jint cx2 = pRasInfo->bounds.x2; + jint cy2 = pRasInfo->bounds.y2; + jint width = cx2 - cx1; + EdgeInfo edges[4]; + jfloat localaccum[MASK_BUF_LEN + 1]; + jfloat *pAccum; + + if (!storePgram(edges + 0, edges + 2, + x1, y1, dx1, dy1, dx2, dy2, + cx1, cy1, cx2, cy2, + JNI_FALSE)) + { + return; + } + + pAccum = ((width > MASK_BUF_LEN) + ? malloc((width + 1) * sizeof(jfloat)) + : localaccum); + if (pAccum == NULL) { + return; + } + memset(pAccum, 0, (width+1) * sizeof(jfloat)); + + while (cy1 < cy2) { + jint lmin, lmax, rmin, rmax; + jint moff, x; + jdouble accum; + unsigned char lastcov; + + lmin = rmin = width + 2; + lmax = rmax = 0; + ACCUM_EDGE(&edges[0], pAccum, lmin, lmax, + cx1, cy1, cx2, cy1+1); + ACCUM_EDGE(&edges[1], pAccum, lmin, lmax, + cx1, cy1, cx2, cy1+1); + ACCUM_EDGE(&edges[2], pAccum, rmin, rmax, + cx1, cy1, cx2, cy1+1); + ACCUM_EDGE(&edges[3], pAccum, rmin, rmax, + cx1, cy1, cx2, cy1+1); + if (lmax > width) { + lmax = width; /* Extra col has data we do not need. */ + } + if (rmax > width) { + rmax = width; /* Extra col has data we do not need. */ + } + /* If ranges overlap, handle both in the first pass. */ + if (rmin <= lmax) { + lmax = rmax; + } + + x = lmin; + accum = 0.0; + moff = 0; + lastcov = 0; + while (x < lmax) { + accum += pAccum[x]; + pAccum[x] = 0.0f; + pMask[moff++] = lastcov = DblToMask(accum); + x++; + } + /* Check for a solid center section. */ + if (lastcov == 0xFF) { + jint endx; + void *pRow; + + /* First process the existing partial coverage data. */ + if (moff > 0) { + pRow = PtrCoord(pDst, x-moff, pRasInfo->pixelStride, 0, 0); + (*pPrim->funcs.maskfill)(pRow, + pMask, 0, 0, + moff, 1, + color, pRasInfo, + pPrim, pCompInfo); + moff = 0; + } + + /* Where does the center section end? */ + /* If there is no right AA edge in the accum buffer, then */ + /* the right edge was beyond the clip, so fill out to width */ + endx = (rmin < rmax) ? rmin : width; + if (x < endx) { + pRow = PtrCoord(pDst, x, pRasInfo->pixelStride, 0, 0); + (*pPrim->funcs.maskfill)(pRow, + NULL, 0, 0, + endx - x, 1, + color, pRasInfo, + pPrim, pCompInfo); + x = endx; + } + } else if (lastcov > 0 && rmin >= rmax) { + /* We are not at 0 coverage, but there is no right edge, */ + /* force a right edge so we process pixels out to width. */ + rmax = width; + } + /* The following loop will process the right AA edge and/or any */ + /* partial coverage center section not processed above. */ + while (x < rmax) { + accum += pAccum[x]; + pAccum[x] = 0.0f; + pMask[moff++] = DblToMask(accum); + x++; + } + if (moff > 0) { + void *pRow = PtrCoord(pDst, x-moff, pRasInfo->pixelStride, 0, 0); + (*pPrim->funcs.maskfill)(pRow, + pMask, 0, 0, + moff, 1, + color, pRasInfo, + pPrim, pCompInfo); + } + pDst = PtrAddBytes(pDst, pRasInfo->scanStride); + cy1++; + } + if (pAccum != localaccum) { + free(pAccum); + } +} + +/* + * Class: sun_java2d_loops_MaskFill + * Method: FillAAPgram + * Signature: (Lsun/java2d/SunGraphics2D;Lsun/java2d/SurfaceData;Ljava/awt/Composite;DDDDDD)V + */ +JNIEXPORT void JNICALL +Java_sun_java2d_loops_MaskFill_FillAAPgram + (JNIEnv *env, jobject self, + jobject sg2d, jobject sData, jobject comp, + jdouble x0, jdouble y0, + jdouble dx1, jdouble dy1, + jdouble dx2, jdouble dy2) +{ + SurfaceDataOps *sdOps; + SurfaceDataRasInfo rasInfo; + NativePrimitive *pPrim; + CompositeInfo compInfo; + jint ix1, iy1, ix2, iy2; + + if ((dy1 == 0 && dx1 == 0) || (dy2 == 0 && dx2 == 0)) { + return; + } + + /* + * Sort parallelogram by y values, ensure that each delta vector + * has a non-negative y delta. + */ + SORT_PGRAM(x0, y0, dx1, dy1, dx2, dy2, ); + + PGRAM_MIN_MAX(ix1, ix2, x0, dx1, dx2, JNI_TRUE); + iy1 = (jint) floor(y0); + iy2 = (jint) ceil(y0 + dy1 + dy2); + + pPrim = GetNativePrim(env, self); + if (pPrim == NULL) { + return; + } + if (pPrim->pCompType->getCompInfo != NULL) { + (*pPrim->pCompType->getCompInfo)(env, &compInfo, comp); + } + + sdOps = SurfaceData_GetOps(env, sData); + if (sdOps == 0) { + return; + } + + GrPrim_Sg2dGetClip(env, sg2d, &rasInfo.bounds); + SurfaceData_IntersectBoundsXYXY(&rasInfo.bounds, ix1, iy1, ix2, iy2); + if (rasInfo.bounds.y2 <= rasInfo.bounds.y1 || + rasInfo.bounds.x2 <= rasInfo.bounds.x1) + { + return; + } + + if (sdOps->Lock(env, sdOps, &rasInfo, pPrim->dstflags) != SD_SUCCESS) { + return; + } + + ix1 = rasInfo.bounds.x1; + iy1 = rasInfo.bounds.y1; + ix2 = rasInfo.bounds.x2; + iy2 = rasInfo.bounds.y2; + if (ix2 > ix1 && iy2 > iy1) { + jint width = ix2 - ix1; + jint color = GrPrim_Sg2dGetEaRGB(env, sg2d); + unsigned char localmask[MASK_BUF_LEN]; + unsigned char *pMask = ((width > MASK_BUF_LEN) + ? malloc(width) + : localmask); + + sdOps->GetRasInfo(env, sdOps, &rasInfo); + if (rasInfo.rasBase != NULL && pMask != NULL) { + void *pDst = PtrCoord(rasInfo.rasBase, + ix1, rasInfo.pixelStride, + iy1, rasInfo.scanStride); + if (dy1 == 0 && dx2 == 0) { + if (dx1 < 0) { + // We sorted by Y above, but not by X + x0 += dx1; + dx1 = -dx1; + } + fillAARect(pPrim, &rasInfo, &compInfo, + color, pMask, pDst, + x0, y0, x0+dx1, y0+dy2); + } else if (dx1 == 0 && dy2 == 0) { + if (dx2 < 0) { + // We sorted by Y above, but not by X + x0 += dx2; + dx2 = -dx2; + } + fillAARect(pPrim, &rasInfo, &compInfo, + color, pMask, pDst, + x0, y0, x0+dx2, y0+dy1); + } else { + fillAAPgram(pPrim, &rasInfo, &compInfo, + color, pMask, pDst, + x0, y0, dx1, dy1, dx2, dy2); + } + } + SurfaceData_InvokeRelease(env, sdOps, &rasInfo); + if (pMask != NULL && pMask != localmask) { + free(pMask); + } + } + SurfaceData_InvokeUnlock(env, sdOps, &rasInfo); +} + +/* Main function to fill a double pair of (inner and outer) parallelograms */ +static void +drawAAPgram(NativePrimitive *pPrim, SurfaceDataRasInfo *pRasInfo, + CompositeInfo *pCompInfo, jint color, unsigned char *pMask, + void *pDst, + jdouble ox0, jdouble oy0, + jdouble dx1, jdouble dy1, + jdouble dx2, jdouble dy2, + jdouble ldx1, jdouble ldy1, + jdouble ldx2, jdouble ldy2) +{ + jint cx1 = pRasInfo->bounds.x1; + jint cy1 = pRasInfo->bounds.y1; + jint cx2 = pRasInfo->bounds.x2; + jint cy2 = pRasInfo->bounds.y2; + jint width = cx2 - cx1; + EdgeInfo edges[8]; + jfloat localaccum[MASK_BUF_LEN + 1]; + jfloat *pAccum; + + if (!storePgram(edges + 0, edges + 6, + ox0, oy0, + dx1 + ldx1, dy1 + ldy1, + dx2 + ldx2, dy2 + ldy2, + cx1, cy1, cx2, cy2, + JNI_FALSE)) + { + /* If outer pgram does not contribute, then inner cannot either. */ + return; + } + storePgram(edges + 2, edges + 4, + ox0 + ldx1 + ldx2, oy0 + ldy1 + ldy2, + dx1 - ldx1, dy1 - ldy1, + dx2 - ldx2, dy2 - ldy2, + cx1, cy1, cx2, cy2, + JNI_TRUE); + + pAccum = ((width > MASK_BUF_LEN) + ? malloc((width + 1) * sizeof(jfloat)) + : localaccum); + if (pAccum == NULL) { + return; + } + memset(pAccum, 0, (width+1) * sizeof(jfloat)); + + while (cy1 < cy2) { + jint lmin, lmax, rmin, rmax; + jint moff, x; + jdouble accum; + unsigned char lastcov; + + lmin = rmin = width + 2; + lmax = rmax = 0; + ACCUM_EDGE(&edges[0], pAccum, lmin, lmax, + cx1, cy1, cx2, cy1+1); + ACCUM_EDGE(&edges[1], pAccum, lmin, lmax, + cx1, cy1, cx2, cy1+1); + ACCUM_EDGE(&edges[2], pAccum, lmin, lmax, + cx1, cy1, cx2, cy1+1); + ACCUM_EDGE(&edges[3], pAccum, lmin, lmax, + cx1, cy1, cx2, cy1+1); + ACCUM_EDGE(&edges[4], pAccum, rmin, rmax, + cx1, cy1, cx2, cy1+1); + ACCUM_EDGE(&edges[5], pAccum, rmin, rmax, + cx1, cy1, cx2, cy1+1); + ACCUM_EDGE(&edges[6], pAccum, rmin, rmax, + cx1, cy1, cx2, cy1+1); + ACCUM_EDGE(&edges[7], pAccum, rmin, rmax, + cx1, cy1, cx2, cy1+1); + if (lmax > width) { + lmax = width; /* Extra col has data we do not need. */ + } + if (rmax > width) { + rmax = width; /* Extra col has data we do not need. */ + } + /* If ranges overlap, handle both in the first pass. */ + if (rmin <= lmax) { + lmax = rmax; + } + + x = lmin; + accum = 0.0; + moff = 0; + lastcov = 0; + while (x < lmax) { + accum += pAccum[x]; + pAccum[x] = 0.0f; + pMask[moff++] = lastcov = DblToMask(accum); + x++; + } + /* Check for an empty or solidcenter section. */ + if (lastcov == 0 || lastcov == 0xFF) { + jint endx; + void *pRow; + + /* First process the existing partial coverage data. */ + if (moff > 0) { + pRow = PtrCoord(pDst, x-moff, pRasInfo->pixelStride, 0, 0); + (*pPrim->funcs.maskfill)(pRow, + pMask, 0, 0, + moff, 1, + color, pRasInfo, + pPrim, pCompInfo); + moff = 0; + } + + /* Where does the center section end? */ + /* If there is no right AA edge in the accum buffer, then */ + /* the right edge was beyond the clip, so fill out to width */ + endx = (rmin < rmax) ? rmin : width; + if (x < endx) { + if (lastcov == 0xFF) { + pRow = PtrCoord(pDst, x, pRasInfo->pixelStride, 0, 0); + (*pPrim->funcs.maskfill)(pRow, + NULL, 0, 0, + endx - x, 1, + color, pRasInfo, + pPrim, pCompInfo); + } + x = endx; + } + } else if (rmin >= rmax) { + /* We are not at 0 coverage, but there is no right edge, */ + /* force a right edge so we process pixels out to width. */ + rmax = width; + } + /* The following loop will process the right AA edge and/or any */ + /* partial coverage center section not processed above. */ + while (x < rmax) { + accum += pAccum[x]; + pAccum[x] = 0.0f; + pMask[moff++] = lastcov = DblToMask(accum); + x++; + } + if (moff > 0) { + void *pRow = PtrCoord(pDst, x-moff, pRasInfo->pixelStride, 0, 0); + (*pPrim->funcs.maskfill)(pRow, + pMask, 0, 0, + moff, 1, + color, pRasInfo, + pPrim, pCompInfo); + } + if (lastcov == 0xFF && x < width) { + void *pRow = PtrCoord(pDst, x, pRasInfo->pixelStride, 0, 0); + (*pPrim->funcs.maskfill)(pRow, + NULL, 0, 0, + width - x, 1, + color, pRasInfo, + pPrim, pCompInfo); + } + pDst = PtrAddBytes(pDst, pRasInfo->scanStride); + cy1++; + } + if (pAccum != localaccum) { + free(pAccum); + } +} + +/* + * Class: sun_java2d_loops_MaskFill + * Method: DrawAAPgram + * Signature: (Lsun/java2d/SunGraphics2D;Lsun/java2d/SurfaceData;Ljava/awt/Composite;DDDDDDDD)V + */ +JNIEXPORT void JNICALL +Java_sun_java2d_loops_MaskFill_DrawAAPgram + (JNIEnv *env, jobject self, + jobject sg2d, jobject sData, jobject comp, + jdouble x0, jdouble y0, + jdouble dx1, jdouble dy1, + jdouble dx2, jdouble dy2, + jdouble lw1, jdouble lw2) +{ + SurfaceDataOps *sdOps; + SurfaceDataRasInfo rasInfo; + NativePrimitive *pPrim; + CompositeInfo compInfo; + jint ix1, iy1, ix2, iy2; + jdouble ldx1, ldy1, ldx2, ldy2; + jdouble ox0, oy0; + + if ((dy1 == 0 && dx1 == 0) || (dy2 == 0 && dx2 == 0)) { + return; + } + + /* + * Sort parallelogram by y values, ensure that each delta vector + * has a non-negative y delta. + */ + SORT_PGRAM(x0, y0, dx1, dy1, dx2, dy2, + v = lw1; lw1 = lw2; lw2 = v;); + + // dx,dy for line width in the "1" and "2" directions. + ldx1 = dx1 * lw1; + ldy1 = dy1 * lw1; + ldx2 = dx2 * lw2; + ldy2 = dy2 * lw2; + + // calculate origin of the outer parallelogram + ox0 = x0 - (ldx1 + ldx2) / 2.0; + oy0 = y0 - (ldy1 + ldy2) / 2.0; + + if (lw1 >= 1.0 || lw2 >= 1.0) { + /* Only need to fill an outer pgram if the interior no longer + * has a hole in it (i.e. if either of the line width ratios + * were greater than or equal to 1.0). + */ + Java_sun_java2d_loops_MaskFill_FillAAPgram(env, self, + sg2d, sData, comp, + ox0, oy0, + dx1 + ldx1, dy1 + ldy1, + dx2 + ldx2, dy2 + ldy2); + return; + } + + PGRAM_MIN_MAX(ix1, ix2, ox0, dx1+ldx1, dx2+ldx2, JNI_TRUE); + iy1 = (jint) floor(oy0); + iy2 = (jint) ceil(oy0 + dy1 + ldy1 + dy2 + ldy2); + + pPrim = GetNativePrim(env, self); + if (pPrim == NULL) { + return; + } + if (pPrim->pCompType->getCompInfo != NULL) { + (*pPrim->pCompType->getCompInfo)(env, &compInfo, comp); + } + + sdOps = SurfaceData_GetOps(env, sData); + if (sdOps == 0) { + return; + } + + GrPrim_Sg2dGetClip(env, sg2d, &rasInfo.bounds); + SurfaceData_IntersectBoundsXYXY(&rasInfo.bounds, ix1, iy1, ix2, iy2); + if (rasInfo.bounds.y2 <= rasInfo.bounds.y1 || + rasInfo.bounds.x2 <= rasInfo.bounds.x1) + { + return; + } + + if (sdOps->Lock(env, sdOps, &rasInfo, pPrim->dstflags) != SD_SUCCESS) { + return; + } + + ix1 = rasInfo.bounds.x1; + iy1 = rasInfo.bounds.y1; + ix2 = rasInfo.bounds.x2; + iy2 = rasInfo.bounds.y2; + if (ix2 > ix1 && iy2 > iy1) { + jint width = ix2 - ix1; + jint color = GrPrim_Sg2dGetEaRGB(env, sg2d); + unsigned char localmask[MASK_BUF_LEN]; + unsigned char *pMask = ((width > MASK_BUF_LEN) + ? malloc(width) + : localmask); + + sdOps->GetRasInfo(env, sdOps, &rasInfo); + if (rasInfo.rasBase != NULL && pMask != NULL) { + void *pDst = PtrCoord(rasInfo.rasBase, + ix1, rasInfo.pixelStride, + iy1, rasInfo.scanStride); + /* + * NOTE: aligned rects could probably be drawn + * even faster with a little work here. + * if (dy1 == 0 && dx2 == 0) { + * drawAARect(pPrim, &rasInfo, &compInfo, + * color, pMask, pDst, + * ox0, oy0, ox0+dx1+ldx1, oy0+dy2+ldy2, ldx1, ldy2); + * } else if (dx1 == 0 && dy2 == 0) { + * drawAARect(pPrim, &rasInfo, &compInfo, + * color, pMask, pDst, + * ox0, oy0, ox0+dx2+ldx2, oy0+dy1+ldy1, ldx2, ldy1); + * } else { + */ + drawAAPgram(pPrim, &rasInfo, &compInfo, + color, pMask, pDst, + ox0, oy0, + dx1, dy1, dx2, dy2, + ldx1, ldy1, ldx2, ldy2); + /* + * } + */ + } + SurfaceData_InvokeRelease(env, sdOps, &rasInfo); + if (pMask != NULL && pMask != localmask) { + free(pMask); + } } SurfaceData_InvokeUnlock(env, sdOps, &rasInfo); } diff --git a/jdk/src/share/native/sun/java2d/loops/ParallelogramUtils.h b/jdk/src/share/native/sun/java2d/loops/ParallelogramUtils.h new file mode 100644 index 00000000000..3691abad25c --- /dev/null +++ b/jdk/src/share/native/sun/java2d/loops/ParallelogramUtils.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef ParallelogramUtils_h_Included +#define ParallelogramUtils_h_Included + +#ifdef __cplusplus +extern "C" { +#endif + +#define PGRAM_MIN_MAX(bmin, bmax, v0, dv1, dv2, AA) \ + do { \ + double vmin, vmax; \ + if (dv1 < 0) { \ + vmin = v0+dv1; \ + vmax = v0; \ + } else { \ + vmin = v0; \ + vmax = v0+dv1; \ + } \ + if (dv2 < 0) { \ + vmin += dv2; \ + } else { \ + vmax += dv2; \ + } \ + if (AA) { \ + bmin = (jint) floor(vmin); \ + bmax = (jint) ceil(vmax); \ + } else { \ + bmin = (jint) floor(vmin + 0.5); \ + bmax = (jint) floor(vmax + 0.5); \ + } \ + } while(0) + +#define PGRAM_INIT_X(starty, x, y, slope) \ + (DblToLong((x) + (slope) * ((starty)+0.5 - (y))) + LongOneHalf - 1) + +/* + * Sort parallelogram by y values, ensure that each delta vector + * has a non-negative y delta. + */ +#define SORT_PGRAM(x0, y0, dx1, dy1, dx2, dy2, OTHER_SWAP_CODE) \ + do { \ + if (dy1 < 0) { \ + x0 += dx1; y0 += dy1; \ + dx1 = -dx1; dy1 = -dy1; \ + } \ + if (dy2 < 0) { \ + x0 += dx2; y0 += dy2; \ + dx2 = -dx2; dy2 = -dy2; \ + } \ + /* Sort delta vectors so dxy1 is left of dxy2. */ \ + if (dx1 * dy2 > dx2 * dy1) { \ + double v; \ + v = dx1; dx1 = dx2; dx2 = v; \ + v = dy1; dy1 = dy2; dy2 = v; \ + OTHER_SWAP_CODE \ + } \ + } while(0) + +#endif /* ParallelogramUtils_h_Included */ diff --git a/jdk/src/share/native/sun/java2d/loops/ProcessPath.c b/jdk/src/share/native/sun/java2d/loops/ProcessPath.c index d847872a82f..b4f724752dc 100644 --- a/jdk/src/share/native/sun/java2d/loops/ProcessPath.c +++ b/jdk/src/share/native/sun/java2d/loops/ProcessPath.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 +116,26 @@ jint Y0 = (fY0) >> MDP_PREC; \ jint X1 = (fX1) >> MDP_PREC; \ jint Y1 = (fY1) >> MDP_PREC; \ - /* Handling lines having just one pixel */\ - if (((X0^X1) | (Y0^Y1)) == 0) { \ - if (checkBounds && \ - (hnd->dhnd->yMin > Y0 || \ - hnd->dhnd->yMax <= Y0 || \ - hnd->dhnd->xMin > X0 || \ - hnd->dhnd->xMax <= X0)) break; \ + jint res; \ \ + /* Checking bounds and clipping if necessary */ \ + if (checkBounds) { \ + TESTANDCLIP(hnd->dhnd->yMin, hnd->dhnd->yMax, Y0, X0, Y1, X1, \ + jint, res); \ + if (res == CRES_INVISIBLE) break; \ + TESTANDCLIP(hnd->dhnd->yMin, hnd->dhnd->yMax, Y1, X1, Y0, X0, \ + jint, res); \ + if (res == CRES_INVISIBLE) break; \ + TESTANDCLIP(hnd->dhnd->xMin, hnd->dhnd->xMax, X0, Y0, X1, Y1, \ + jint, res); \ + if (res == CRES_INVISIBLE) break; \ + TESTANDCLIP(hnd->dhnd->xMin, hnd->dhnd->xMax, X1, Y1, X0, Y0, \ + jint, res); \ + if (res == CRES_INVISIBLE) break; \ + } \ + \ + /* Handling lines having just one pixel */ \ + if (((X0^X1) | (Y0^Y1)) == 0) { \ if (pixelInfo[0] == 0) { \ pixelInfo[0] = 1; \ pixelInfo[1] = X0; \ @@ -140,18 +152,11 @@ break; \ } \ \ - if (!checkBounds || \ - (hnd->dhnd->yMin <= Y0 && \ - hnd->dhnd->yMax > Y0 && \ - hnd->dhnd->xMin <= X0 && \ - hnd->dhnd->xMax > X0)) \ + if (pixelInfo[0] && \ + ((pixelInfo[1] == X0 && pixelInfo[2] == Y0) || \ + (pixelInfo[3] == X0 && pixelInfo[4] == Y0))) \ { \ - if (pixelInfo[0] && \ - ((pixelInfo[1] == X0 && pixelInfo[2] == Y0) || \ - (pixelInfo[3] == X0 && pixelInfo[4] == Y0))) \ - { \ - hnd->dhnd->pDrawPixel(hnd->dhnd, X0, Y0); \ - } \ + hnd->dhnd->pDrawPixel(hnd->dhnd, X0, Y0); \ } \ \ hnd->dhnd->pDrawLine(hnd->dhnd, X0, Y0, X1, Y1); \ @@ -170,14 +175,6 @@ if ((pixelInfo[1] == X1 && pixelInfo[2] == Y1) || \ (pixelInfo[3] == X1 && pixelInfo[4] == Y1)) \ { \ - if (checkBounds && \ - (hnd->dhnd->yMin > Y1 || \ - hnd->dhnd->yMax <= Y1 || \ - hnd->dhnd->xMin > X1 || \ - hnd->dhnd->xMax <= X1)) { \ - break; \ - } \ - \ hnd->dhnd->pDrawPixel(hnd->dhnd, X1, Y1); \ } \ pixelInfo[3] = X1; \ diff --git a/jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c b/jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c index 7b35884a26e..f0a34881cce 100644 --- a/jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c +++ b/jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/java2d/pipe/BufferedMaskBlit.c b/jdk/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c index 1c5b99b250d..ccfeab5cafd 100644 --- a/jdk/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c +++ b/jdk/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c @@ -119,7 +119,8 @@ Java_sun_java2d_pipe_BufferedMaskBlit_enqueueTile PtrCoord(srcInfo.rasBase, srcInfo.bounds.x1, srcInfo.pixelStride, srcInfo.bounds.y1, srcInfo.scanStride); - unsigned char *pMask = + unsigned char *pMask, *pMaskAlloc; + pMask = pMaskAlloc = (*env)->GetPrimitiveArrayCritical(env, maskArray, 0); if (pMask == NULL) { J2dRlsTraceLn(J2D_TRACE_ERROR, @@ -274,7 +275,7 @@ Java_sun_java2d_pipe_BufferedMaskBlit_enqueueTile bpos += width * height * sizeof(jint); (*env)->ReleasePrimitiveArrayCritical(env, maskArray, - pMask, JNI_ABORT); + pMaskAlloc, JNI_ABORT); } SurfaceData_InvokeRelease(env, srcOps, &srcInfo); } diff --git a/jdk/src/share/native/sun/management/Flag.c b/jdk/src/share/native/sun/management/Flag.c index 7a1fab59721..cda64d51f8f 100644 --- a/jdk/src/share/native/sun/management/Flag.c +++ b/jdk/src/share/native/sun/management/Flag.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/management/ThreadImpl.c b/jdk/src/share/native/sun/management/ThreadImpl.c index 7ffdb351b13..9e1baadf15c 100644 --- a/jdk/src/share/native/sun/management/ThreadImpl.c +++ b/jdk/src/share/native/sun/management/ThreadImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * 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,9 +42,15 @@ Java_sun_management_ThreadImpl_setThreadCpuTimeEnabled0 jmm_interface->SetBoolAttribute(env, JMM_THREAD_CPU_TIME, flag); } +JNIEXPORT void JNICALL +Java_sun_management_ThreadImpl_setThreadAllocatedMemoryEnabled0 + (JNIEnv *env, jclass cls, jboolean flag) +{ + jmm_interface->SetBoolAttribute(env, JMM_THREAD_ALLOCATED_MEMORY, flag); +} JNIEXPORT void JNICALL -Java_sun_management_ThreadImpl_getThreadInfo0 +Java_sun_management_ThreadImpl_getThreadInfo1 (JNIEnv *env, jclass cls, jlongArray ids, jint maxDepth, jobjectArray infoArray) { @@ -65,6 +71,14 @@ Java_sun_management_ThreadImpl_getThreadTotalCpuTime0 return jmm_interface->GetThreadCpuTimeWithKind(env, tid, JNI_TRUE /* user+sys */); } +JNIEXPORT void JNICALL +Java_sun_management_ThreadImpl_getThreadTotalCpuTime1 + (JNIEnv *env, jclass cls, jlongArray ids, jlongArray timeArray) +{ + jmm_interface->GetThreadCpuTimesWithKind(env, ids, timeArray, + JNI_TRUE /* user+sys */); +} + JNIEXPORT jlong JNICALL Java_sun_management_ThreadImpl_getThreadUserCpuTime0 (JNIEnv *env, jclass cls, jlong tid) @@ -72,6 +86,21 @@ Java_sun_management_ThreadImpl_getThreadUserCpuTime0 return jmm_interface->GetThreadCpuTimeWithKind(env, tid, JNI_FALSE /* user */); } +JNIEXPORT void JNICALL +Java_sun_management_ThreadImpl_getThreadUserCpuTime1 + (JNIEnv *env, jclass cls, jlongArray ids, jlongArray timeArray) +{ + jmm_interface->GetThreadCpuTimesWithKind(env, ids, timeArray, + JNI_FALSE /* user */); +} + +JNIEXPORT void JNICALL +Java_sun_management_ThreadImpl_getThreadAllocatedMemory1 + (JNIEnv *env, jclass cls, jlongArray ids, jlongArray sizeArray) +{ + jmm_interface->GetThreadAllocatedMemory(env, ids, sizeArray); +} + JNIEXPORT jobjectArray JNICALL Java_sun_management_ThreadImpl_findMonitorDeadlockedThreads0 (JNIEnv *env, jclass cls) diff --git a/jdk/src/share/native/sun/management/VMManagementImpl.c b/jdk/src/share/native/sun/management/VMManagementImpl.c index a7cb4b35e65..295d93c34f5 100644 --- a/jdk/src/share/native/sun/management/VMManagementImpl.c +++ b/jdk/src/share/native/sun/management/VMManagementImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * 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,6 +92,9 @@ Java_sun_management_VMManagementImpl_initOptionalSupportFields setStaticBooleanField(env, cls, "objectMonitorUsageSupport", JNI_FALSE); setStaticBooleanField(env, cls, "synchronizerUsageSupport", JNI_FALSE); } + + value = mos.isThreadAllocatedMemorySupported; + setStaticBooleanField(env, cls, "threadAllocatedMemorySupport", value); } JNIEXPORT jobjectArray JNICALL @@ -201,6 +204,13 @@ Java_sun_management_VMManagementImpl_isThreadCpuTimeEnabled return jmm_interface->GetBoolAttribute(env, JMM_THREAD_CPU_TIME); } +JNIEXPORT jboolean JNICALL +Java_sun_management_VMManagementImpl_isThreadAllocatedMemoryEnabled + (JNIEnv *env, jobject dummy) +{ + return jmm_interface->GetBoolAttribute(env, JMM_THREAD_ALLOCATED_MEMORY); +} + JNIEXPORT jint JNICALL Java_sun_management_VMManagementImpl_getProcessId (JNIEnv *env, jobject dummy) diff --git a/jdk/src/share/native/sun/misc/VM.c b/jdk/src/share/native/sun/misc/VM.c index 28b378cce83..8744da78403 100644 --- a/jdk/src/share/native/sun/misc/VM.c +++ b/jdk/src/share/native/sun/misc/VM.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/misc/VMSupport.c b/jdk/src/share/native/sun/misc/VMSupport.c index e37ff936032..27a97504ff1 100644 --- a/jdk/src/share/native/sun/misc/VMSupport.c +++ b/jdk/src/share/native/sun/misc/VMSupport.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/security/ec/ECC_JNI.cpp b/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp index 1ddc5853368..457fb058082 100644 --- a/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp +++ b/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +89,7 @@ JNICALL Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair // Fill a new ECParams using the supplied OID if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { /* bad curve OID */ - ThrowException(env, INVALID_ALGORITHM_PARAMETER_EXCEPTION); + ThrowException(env, (char *) INVALID_ALGORITHM_PARAMETER_EXCEPTION); goto cleanup; } @@ -101,7 +101,7 @@ JNICALL Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair // Generate the new keypair (using the supplied seed) if (EC_NewKey(ecparams, &privKey, (unsigned char *) pSeedBuffer, jSeedLength, 0) != SECSuccess) { - ThrowException(env, KEY_EXCEPTION); + ThrowException(env, (char *) KEY_EXCEPTION); goto cleanup; } diff --git a/jdk/src/share/sample/nio/file/Chmod.java b/jdk/src/share/sample/nio/file/Chmod.java index fd5cd918526..ae8feeeae04 100644 --- a/jdk/src/share/sample/nio/file/Chmod.java +++ b/jdk/src/share/sample/nio/file/Chmod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/jdk/src/share/sample/nio/file/Copy.java b/jdk/src/share/sample/nio/file/Copy.java index 5408e6a5cbc..eb3d5a06d03 100644 --- a/jdk/src/share/sample/nio/file/Copy.java +++ b/jdk/src/share/sample/nio/file/Copy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/jdk/src/share/sample/nio/file/WatchDir.java b/jdk/src/share/sample/nio/file/WatchDir.java index 73b4b7052fd..f2017256e9e 100644 --- a/jdk/src/share/sample/nio/file/WatchDir.java +++ b/jdk/src/share/sample/nio/file/WatchDir.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/jdk/src/solaris/bin/java_md.c b/jdk/src/solaris/bin/java_md.c index ca1ce5b9f0b..441d41efe25 100644 --- a/jdk/src/solaris/bin/java_md.c +++ b/jdk/src/solaris/bin/java_md.c @@ -868,7 +868,7 @@ LocateJRE(manifest_info* info) while (dp != NULL) { cp = JLI_StrChr(dp, (int)':'); if (cp != NULL) - *cp = (char)NULL; + *cp = '\0'; if ((target = ProcessDir(info, dp)) != NULL) break; dp = cp; diff --git a/jdk/src/solaris/bin/jexec.c b/jdk/src/solaris/bin/jexec.c index 24ba47ed94d..b2efc99c48d 100644 --- a/jdk/src/solaris/bin/jexec.c +++ b/jdk/src/solaris/bin/jexec.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -221,6 +221,7 @@ int main(int argc, const char * argv[]) { * implies an error in the exec. */ free(nargv); errorExit(errno, BAD_EXEC_MSG); + return 0; // keep the compiler happy } diff --git a/jdk/src/solaris/classes/java/io/UnixFileSystem.java b/jdk/src/solaris/classes/java/io/UnixFileSystem.java index 2c0feb2d5ef..fb0fef63646 100644 --- a/jdk/src/solaris/classes/java/io/UnixFileSystem.java +++ b/jdk/src/solaris/classes/java/io/UnixFileSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/java/lang/ProcessEnvironment.java b/jdk/src/solaris/classes/java/lang/ProcessEnvironment.java index a6e4c4a5d61..a08a291c937 100644 --- a/jdk/src/solaris/classes/java/lang/ProcessEnvironment.java +++ b/jdk/src/solaris/classes/java/lang/ProcessEnvironment.java @@ -68,7 +68,7 @@ final class ProcessEnvironment // We cache the C environment. This means that subsequent calls // to putenv/setenv from C will not be visible from Java code. byte[][] environ = environ(); - theEnvironment = new HashMap(environ.length/2 + 3); + theEnvironment = new HashMap<>(environ.length/2 + 3); // Read environment variables back to front, // so that earlier variables override later ones. for (int i = environ.length-1; i > 0; i-=2) diff --git a/jdk/src/solaris/classes/java/lang/ProcessImpl.java b/jdk/src/solaris/classes/java/lang/ProcessImpl.java index 5c291b138c3..777018bddb0 100644 --- a/jdk/src/solaris/classes/java/lang/ProcessImpl.java +++ b/jdk/src/solaris/classes/java/lang/ProcessImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,7 +111,8 @@ final class ProcessImpl { else if (redirects[1] == Redirect.INHERIT) std_fds[1] = 1; else { - f1 = redirects[1].toFileOutputStream(); + f1 = new FileOutputStream(redirects[1].file(), + redirects[1].append()); std_fds[1] = fdAccess.get(f1.getFD()); } @@ -120,7 +121,8 @@ final class ProcessImpl { else if (redirects[2] == Redirect.INHERIT) std_fds[2] = 2; else { - f2 = redirects[2].toFileOutputStream(); + f2 = new FileOutputStream(redirects[2].file(), + redirects[2].append()); std_fds[2] = fdAccess.get(f2.getFD()); } } diff --git a/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux b/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux index b277c2184b5..61676e084cf 100644 --- a/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux +++ b/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/java/lang/UNIXProcess.java.solaris b/jdk/src/solaris/classes/java/lang/UNIXProcess.java.solaris index 8d01b7e726a..550ce7c2b05 100644 --- a/jdk/src/solaris/classes/java/lang/UNIXProcess.java.solaris +++ b/jdk/src/solaris/classes/java/lang/UNIXProcess.java.solaris @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/java/util/prefs/FileSystemPreferences.java b/jdk/src/solaris/classes/java/util/prefs/FileSystemPreferences.java index 1982932380f..32e4b032929 100644 --- a/jdk/src/solaris/classes/java/util/prefs/FileSystemPreferences.java +++ b/jdk/src/solaris/classes/java/util/prefs/FileSystemPreferences.java @@ -354,7 +354,7 @@ class FileSystemPreferences extends AbstractPreferences { * log against that map. The resulting map is then written back * to the disk. */ - final List changeLog = new ArrayList(); + final List changeLog = new ArrayList<>(); /** * Represents a change to a preference. @@ -507,7 +507,7 @@ class FileSystemPreferences extends AbstractPreferences { }); if (newNode) { // These 2 things guarantee node will get wrtten at next flush/sync - prefsCache = new TreeMap(); + prefsCache = new TreeMap<>(); nodeCreate = new NodeCreate(); changeLog.add(nodeCreate); } @@ -550,7 +550,7 @@ class FileSystemPreferences extends AbstractPreferences { loadCache(); } catch(Exception e) { // assert lastSyncTime == 0; - prefsCache = new TreeMap(); + prefsCache = new TreeMap<>(); } } @@ -567,7 +567,7 @@ class FileSystemPreferences extends AbstractPreferences { AccessController.doPrivileged( new PrivilegedExceptionAction() { public Void run() throws BackingStoreException { - Map m = new TreeMap(); + Map m = new TreeMap<>(); long newLastSyncTime = 0; try { newLastSyncTime = prefsFile.lastModified(); @@ -581,7 +581,7 @@ class FileSystemPreferences extends AbstractPreferences { prefsFile.renameTo( new File( prefsFile.getParentFile(), "IncorrectFormatPrefs.xml")); - m = new TreeMap(); + m = new TreeMap<>(); } else if (e instanceof FileNotFoundException) { getLogger().warning("Prefs file removed in background " + prefsFile.getPath()); @@ -646,7 +646,7 @@ class FileSystemPreferences extends AbstractPreferences { return AccessController.doPrivileged( new PrivilegedAction() { public String[] run() { - List result = new ArrayList(); + List result = new ArrayList<>(); File[] dirContents = dir.listFiles(); if (dirContents != null) { for (int i = 0; i < dirContents.length; i++) @@ -794,7 +794,7 @@ class FileSystemPreferences extends AbstractPreferences { } else if (lastSyncTime != 0 && !dir.exists()) { // This node was removed in the background. Playback any changes // against a virgin (empty) Map. - prefsCache = new TreeMap(); + prefsCache = new TreeMap<>(); replayChanges(); } if (!changeLog.isEmpty()) { diff --git a/jdk/src/solaris/classes/sun/awt/UNIXToolkit.java b/jdk/src/solaris/classes/sun/awt/UNIXToolkit.java index caacf3a60d0..50a913c5438 100644 --- a/jdk/src/solaris/classes/sun/awt/UNIXToolkit.java +++ b/jdk/src/solaris/classes/sun/awt/UNIXToolkit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java b/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java index 57a0492ddee..572a9200064 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java @@ -42,16 +42,27 @@ class GtkFileDialogPeer extends XDialogPeer implements FileDialogPeer { private FileDialog fd; + // A pointer to the native GTK FileChooser widget + private volatile long widget = 0L; + public GtkFileDialogPeer(FileDialog fd) { super((Dialog) fd); this.fd = fd; } + private static native void initIDs(); + static { + initIDs(); + } + private native void run(String title, int mode, String dir, String file, FilenameFilter filter, boolean isMultipleMode); - private native void quit(); + @Override + public native void toFront(); + + /** * Called exclusively by the native C code. */ diff --git a/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java b/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java index 6728e356591..20c6174c2ee 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -432,7 +432,7 @@ public abstract class InfoWindow extends Window { ActionEvent aev = new ActionEvent(target, ActionEvent.ACTION_PERFORMED, liveArguments.getActionCommand(), e.getWhen(), e.getModifiers()); - Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(aev); + XToolkit.postEvent(XToolkit.targetToAppContext(aev.getSource()), aev); } } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java index 3cfffa71979..85cd5448fd5 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol if (swapNeeded) { t = MotifDnDConstants.Swapper.swap(t); } - long time = t; + long time = t & 0xffffffffL; + // with correction of (32-bit unsigned to 64-bit signed) implicit conversion. /* Discard events from the previous receiver. */ if (targetEnterServerTime == XConstants.CurrentTime || diff --git a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java index a6ec86c505f..030c02f557b 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -928,7 +928,9 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol { throw new IOException("Cannot get data: drag source property atom unavailable"); } - long time_stamp = MotifDnDConstants.Swapper.getInt(data + 4, eventByteOrder); + long time_stamp = MotifDnDConstants.Swapper.getInt(data + 4, eventByteOrder) & 0xffffffffL; + // with correction of (32-bit unsigned to 64-bit signed) implicit conversion. + XAtom selectionAtom = XAtom.get(selatom); XSelection selection = XSelection.getSelection(selectionAtom); @@ -962,7 +964,9 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol { return false; } - long time_stamp = MotifDnDConstants.Swapper.getInt(data + 4, eventByteOrder); + long time_stamp = MotifDnDConstants.Swapper.getInt(data + 4, eventByteOrder) & 0xffffffffL; + // with correction of (32-bit unsigned to 64-bit signed) implicit conversion. + long sel_atom = MotifDnDConstants.Swapper.getInt(data + 12, eventByteOrder); long status_atom = 0; diff --git a/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java index 45c29daa6fd..f053dc50ffe 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/awt/X11/XDecoratedPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java index 340747f689c..60c254f76b7 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +87,15 @@ abstract class XDecoratedPeer extends XWindowPeer { } void postInit(XCreateWindowParams params) { + // The size hints must be set BEFORE mapping the window (see 6895647) + updateSizeHints(dimensions); + + // The super method maps the window if it's visible on the shared level super.postInit(params); + // The lines that follow need to be in a postInit, so they // happen after the X window is created. initResizability(); - updateSizeHints(dimensions); XWM.requestWMExtents(getWindow()); content = XContentWindow.createContent(this); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFrame.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFrame.java index e9d0fcb6e7a..4e968977d44 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFrame.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java index 9fee20f90df..dfea40d78d3 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/awt/X11/XFileDialogPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java index 5a159e94e53..9fac04660ca 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/awt/X11/XFramePeer.java b/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java index 8ff374b0f37..fdefb1047ce 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -150,6 +150,8 @@ class XFramePeer extends XDecoratedPeer implements FramePeer { void updateChildrenSizes() { super.updateChildrenSizes(); + int height = getMenuBarHeight(); + // XWindow.reshape calls XBaseWindow.xSetBounds, which acquires // the AWT lock, so we have to acquire the AWT lock here // before getStateLock() to avoid a deadlock with the Toolkit thread @@ -159,7 +161,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer { synchronized(getStateLock()) { int width = dimensions.getClientSize().width; if (menubarPeer != null) { - menubarPeer.reshape(0, 0, width, getMenuBarHeight()); + menubarPeer.reshape(0, 0, width, height); } } } finally { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XRobotPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XRobotPeer.java index 270c0c12f02..a6acd8eb5f5 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XRobotPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XRobotPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +25,15 @@ package sun.awt.X11; import java.awt.*; +import java.awt.event.InputEvent; import java.awt.peer.*; -import sun.awt.X11GraphicsConfig; + +import sun.awt.AWTAccessor; import sun.awt.SunToolkit; +import sun.awt.X11GraphicsConfig; class XRobotPeer implements RobotPeer { + private X11GraphicsConfig xgc = null; /* * native implementation uses some static shared data (pipes, processes) @@ -40,7 +44,7 @@ class XRobotPeer implements RobotPeer { XRobotPeer(GraphicsConfiguration gc) { this.xgc = (X11GraphicsConfig)gc; SunToolkit tk = (SunToolkit)Toolkit.getDefaultToolkit(); - setup(tk.getNumberOfButtons()); + setup(tk.getNumberOfButtons(), AWTAccessor.getInputEventAccessor().getButtonDownMasks()); } public void dispose() { @@ -83,7 +87,7 @@ class XRobotPeer implements RobotPeer { return pixelArray; } - private static native synchronized void setup(int numberOfButtons); + private static native synchronized void setup(int numberOfButtons, int[] buttonDownMasks); private static native synchronized void mouseMoveImpl(X11GraphicsConfig xgc, int x, int y); private static native synchronized void mousePressImpl(int buttons); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java index fcc5659e5cb..4cbca44224d 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ import javax.swing.plaf.BorderUIResource; import java.awt.im.InputMethodRequests; import sun.awt.CausedFocusEvent; import sun.awt.AWTAccessor; +import sun.awt.SunToolkit; class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { @@ -1318,13 +1319,18 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { Component source, Point point, MouseEvent template ) { MouseEvent e = template; - return new MouseEvent( + MouseEvent nme = new MouseEvent( source, e.getID(), e.getWhen(), e.getModifiersEx() | e.getModifiers(), point.x, point.y, e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton() ); + // Because these MouseEvents are dispatched directly to + // their target, we need to mark them as being + // system-generated here + SunToolkit.setSystemGenerated(nme); + return nme; } private void setCursor() { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java index 192a8f568e9..ad92d2e9c00 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java @@ -377,22 +377,22 @@ public final class XToolkit extends UNIXToolkit implements Runnable { init(); XWM.init(); SunToolkit.setDataTransfererClassName(DATA_TRANSFERER_CLASS_NAME); - toolkitThread = new Thread(this, "AWT-XAWT"); - toolkitThread.setPriority(Thread.NORM_PRIORITY + 1); - toolkitThread.setDaemon(true); - ThreadGroup mainTG = (ThreadGroup)AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { - ThreadGroup currentTG = - Thread.currentThread().getThreadGroup(); - ThreadGroup parentTG = currentTG.getParent(); - while (parentTG != null) { - currentTG = parentTG; - parentTG = currentTG.getParent(); - } - return currentTG; - } - }); + + PrivilegedAction action = new PrivilegedAction() { + public Thread run() { + ThreadGroup currentTG = Thread.currentThread().getThreadGroup(); + ThreadGroup parentTG = currentTG.getParent(); + while (parentTG != null) { + currentTG = parentTG; + parentTG = currentTG.getParent(); + } + Thread thread = new Thread(currentTG, XToolkit.this, "AWT-XAWT"); + thread.setPriority(Thread.NORM_PRIORITY + 1); + thread.setDaemon(true); + return thread; + } + }; + toolkitThread = AccessController.doPrivileged(action); toolkitThread.start(); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java index dc9130927b6..ff7b78e2c13 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -454,7 +454,7 @@ public class XTrayIconPeer implements TrayIconPeer, ActionEvent aev = new ActionEvent(xtiPeer.target, ActionEvent.ACTION_PERFORMED, xtiPeer.target.getActionCommand(), e.getWhen(), e.getModifiers()); - Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(aev); + XToolkit.postEvent(XToolkit.targetToAppContext(aev.getSource()), aev); } if (xtiPeer.balloon.isVisible()) { xtiPeer.balloon.hide(); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java index 77ae9c522f6..8c69ce8276c 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -401,6 +401,8 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { if (isPostedField == null) { isPostedField = SunToolkit.getField(AWTEvent.class, "isPosted"); } + // The uses of this method imply that the incoming event is system-generated + SunToolkit.setSystemGenerated(e); PeerEvent pe = new PeerEvent(Toolkit.getDefaultToolkit(), new Runnable() { public void run() { try { @@ -779,7 +781,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { xbe.get_x_root(), xbe.get_y_root(), 1,false,MouseWheelEvent.WHEEL_UNIT_SCROLL, - 3,button==4 ? -1*clickCount : 1*clickCount); + 3,button==4 ? -1 : 1); postEventToEventQueue(mwe); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java index 058cf966a50..395dbcd824b 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -604,7 +604,9 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, public void handleWindowFocusIn_Dispatch() { if (EventQueue.isDispatchThread()) { XKeyboardFocusManagerPeer.setCurrentNativeFocusedWindow((Window) target); - target.dispatchEvent(new WindowEvent((Window)target, WindowEvent.WINDOW_GAINED_FOCUS)); + WindowEvent we = new WindowEvent((Window)target, WindowEvent.WINDOW_GAINED_FOCUS); + SunToolkit.setSystemGenerated(we); + target.dispatchEvent(we); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java index 1f15542fd01..ca415b1b212 100644 --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/awt/X11GraphicsEnvironment.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java index 533d22dc15a..40b32d4258e 100644 --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/awt/X11InputMethod.java b/jdk/src/solaris/classes/sun/awt/X11InputMethod.java index b87877c8386..ccfa5104809 100644 --- a/jdk/src/solaris/classes/sun/awt/X11InputMethod.java +++ b/jdk/src/solaris/classes/sun/awt/X11InputMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,6 +96,7 @@ public abstract class X11InputMethod extends InputMethodAdapter { private Component awtFocussedComponent = null; private Component lastXICFocussedComponent = null; private boolean isLastXICActive = false; + private boolean isLastTemporary = false; private boolean isActive = false; private boolean isActiveClient = false; private static Map[] highlightStyles; @@ -349,7 +350,7 @@ public abstract class X11InputMethod extends InputMethodAdapter { current focussed component, change the XIC focus to the newly focussed component. */ - if (lastXICFocussedComponentPeer != awtFocussedComponentPeer || + if (isLastTemporary || lastXICFocussedComponentPeer != awtFocussedComponentPeer || isLastXICActive != haveActiveClient()) { if (lastXICFocussedComponentPeer != null) { setXICFocus(lastXICFocussedComponentPeer, false, isLastXICActive); @@ -401,6 +402,7 @@ public abstract class X11InputMethod extends InputMethodAdapter { */ lastXICFocussedComponent = awtFocussedComponent; isLastXICActive = isAc; + isLastTemporary = isTemporary; isActive = false; } diff --git a/jdk/src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.Fedora.properties b/jdk/src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.Fedora.properties index 74585a8cfe0..e9f3a4912e3 100644 --- a/jdk/src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.Fedora.properties +++ b/jdk/src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.Fedora.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.Ubuntu.properties b/jdk/src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.Ubuntu.properties index 28dae0387a5..e1817934138 100644 --- a/jdk/src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.Ubuntu.properties +++ b/jdk/src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.Ubuntu.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/solaris/classes/sun/awt/fontconfigs/solaris.fontconfig.properties b/jdk/src/solaris/classes/sun/awt/fontconfigs/solaris.fontconfig.properties index 0147737c627..e1617fadd73 100644 --- a/jdk/src/solaris/classes/sun/awt/fontconfigs/solaris.fontconfig.properties +++ b/jdk/src/solaris/classes/sun/awt/fontconfigs/solaris.fontconfig.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/solaris/classes/sun/awt/motif/MToolkit.java b/jdk/src/solaris/classes/sun/awt/motif/MToolkit.java index b68ff70cf5e..cf960a73891 100644 --- a/jdk/src/solaris/classes/sun/awt/motif/MToolkit.java +++ b/jdk/src/solaris/classes/sun/awt/motif/MToolkit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/java2d/UnixSurfaceManagerFactory.java b/jdk/src/solaris/classes/sun/java2d/UnixSurfaceManagerFactory.java index 6270484499a..5ab78ee39ee 100644 --- a/jdk/src/solaris/classes/sun/java2d/UnixSurfaceManagerFactory.java +++ b/jdk/src/solaris/classes/sun/java2d/UnixSurfaceManagerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/java2d/x11/X11SurfaceData.java b/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java index 81adf8315ea..24513aa1af3 100644 --- a/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java +++ b/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/net/NetHooks.java b/jdk/src/solaris/classes/sun/net/NetHooks.java index bc4a60b72eb..cd0de5e72fd 100644 --- a/jdk/src/solaris/classes/sun/net/NetHooks.java +++ b/jdk/src/solaris/classes/sun/net/NetHooks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/net/sdp/SdpProvider.java b/jdk/src/solaris/classes/sun/net/sdp/SdpProvider.java index 0fcec598726..74bcfeae34e 100644 --- a/jdk/src/solaris/classes/sun/net/sdp/SdpProvider.java +++ b/jdk/src/solaris/classes/sun/net/sdp/SdpProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/net/www/protocol/http/NTLMAuthentication.java b/jdk/src/solaris/classes/sun/net/www/protocol/http/NTLMAuthentication.java deleted file mode 100644 index 4bc5a887484..00000000000 --- a/jdk/src/solaris/classes/sun/net/www/protocol/http/NTLMAuthentication.java +++ /dev/null @@ -1,427 +0,0 @@ -/* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.net.www.protocol.http; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.InetAddress; -import java.net.PasswordAuthentication; -import java.net.UnknownHostException; -import java.net.URL; -import java.security.GeneralSecurityException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import javax.crypto.Cipher; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.SecretKey; -import javax.crypto.SecretKeyFactory; -import javax.crypto.spec.DESKeySpec; - -import sun.net.www.HeaderParser; - -/** - * NTLMAuthentication: - * - * @author Michael McMahon - */ - -/* - * NTLM authentication is nominally based on the framework defined in RFC2617, - * but differs from the standard (Basic & Digest) schemes as follows: - * - * 1. A complete authentication requires three request/response transactions - * as shown below: - * REQ -------------------------------> - * <---- 401 (signalling NTLM) -------- - * - * REQ (with type1 NTLM msg) ---------> - * <---- 401 (with type 2 NTLM msg) --- - * - * REQ (with type3 NTLM msg) ---------> - * <---- OK --------------------------- - * - * 2. The scope of the authentication is the TCP connection (which must be kept-alive) - * after the type2 response is received. This means that NTLM does not work end-to-end - * through a proxy, rather between client and proxy, or between client and server (with no proxy) - */ - -class NTLMAuthentication extends AuthenticationInfo { - private static final long serialVersionUID = -2403849171106437142L; - - private byte[] type1; - private byte[] type3; - - private SecretKeyFactory fac; - private Cipher cipher; - private MessageDigest md4; - private String hostname; - private static String defaultDomain; /* Domain to use if not specified by user */ - - static { - defaultDomain = java.security.AccessController.doPrivileged( - new sun.security.action.GetPropertyAction("http.auth.ntlm.domain", - "domain")); - }; - - static boolean supportsTransparentAuth () { - return false; - } - - private void init0() { - type1 = new byte[256]; - type3 = new byte[256]; - System.arraycopy (new byte[] {'N','T','L','M','S','S','P',0,1}, 0, type1, 0, 9); - type1[12] = (byte) 3; - type1[13] = (byte) 0xb2; - type1[28] = (byte) 0x20; - System.arraycopy (new byte[] {'N','T','L','M','S','S','P',0,3}, 0, type3, 0, 9); - type3[12] = (byte) 0x18; - type3[14] = (byte) 0x18; - type3[20] = (byte) 0x18; - type3[22] = (byte) 0x18; - type3[32] = (byte) 0x40; - type3[60] = (byte) 1; - type3[61] = (byte) 0x82; - - try { - hostname = java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public String run() { - String localhost; - try { - localhost = InetAddress.getLocalHost().getHostName().toUpperCase(); - } catch (UnknownHostException e) { - localhost = "localhost"; - } - return localhost; - } - }); - int x = hostname.indexOf ('.'); - if (x != -1) { - hostname = hostname.substring (0, x); - } - fac = SecretKeyFactory.getInstance ("DES"); - cipher = Cipher.getInstance ("DES/ECB/NoPadding"); - md4 = sun.security.provider.MD4.getInstance(); - } catch (NoSuchPaddingException e) { - assert false; - } catch (NoSuchAlgorithmException e) { - assert false; - } - }; - - PasswordAuthentication pw; - String username; - String ntdomain; - String password; - - /** - * Create a NTLMAuthentication: - * Username may be specified as domainusername in the application Authenticator. - * If this notation is not used, then the domain will be taken - * from a system property: "http.auth.ntlm.domain". - */ - public NTLMAuthentication(boolean isProxy, URL url, PasswordAuthentication pw) { - super(isProxy ? PROXY_AUTHENTICATION : SERVER_AUTHENTICATION, - AuthScheme.NTLM, - url, - ""); - init (pw); - } - - private void init (PasswordAuthentication pw) { - this.pw = pw; - String s = pw.getUserName(); - int i = s.indexOf ('\\'); - if (i == -1) { - username = s; - ntdomain = defaultDomain; - } else { - ntdomain = s.substring (0, i).toUpperCase(); - username = s.substring (i+1); - } - password = new String (pw.getPassword()); - init0(); - } - - /** - * Constructor used for proxy entries - */ - public NTLMAuthentication(boolean isProxy, String host, int port, - PasswordAuthentication pw) { - super(isProxy ? PROXY_AUTHENTICATION : SERVER_AUTHENTICATION, - AuthScheme.NTLM, - host, - port, - ""); - init (pw); - } - - /** - * @return true if this authentication supports preemptive authorization - */ - boolean supportsPreemptiveAuthorization() { - return false; - } - - /** - * @return the name of the HTTP header this authentication wants set - */ - String getHeaderName() { - if (type == SERVER_AUTHENTICATION) { - return "Authorization"; - } else { - return "Proxy-authorization"; - } - } - - /** - * Not supported. Must use the setHeaders() method - */ - String getHeaderValue(URL url, String method) { - throw new RuntimeException ("getHeaderValue not supported"); - } - - /** - * Check if the header indicates that the current auth. parameters are stale. - * If so, then replace the relevant field with the new value - * and return true. Otherwise return false. - * returning true means the request can be retried with the same userid/password - * returning false means we have to go back to the user to ask for a new - * username password. - */ - boolean isAuthorizationStale (String header) { - return false; /* should not be called for ntlm */ - } - - /** - * Set header(s) on the given connection. - * @param conn The connection to apply the header(s) to - * @param p A source of header values for this connection, not used because - * HeaderParser converts the fields to lower case, use raw instead - * @param raw The raw header field. - * @return true if all goes well, false if no headers were set. - */ - synchronized boolean setHeaders(HttpURLConnection conn, HeaderParser p, String raw) { - - try { - String response; - if (raw.length() < 6) { /* NTLM */ - response = buildType1Msg (); - } else { - String msg = raw.substring (5); /* skip NTLM */ - response = buildType3Msg (msg); - } - conn.setAuthenticationProperty(getHeaderName(), response); - return true; - } catch (IOException e) { - return false; - } catch (GeneralSecurityException e) { - return false; - } - } - - private void copybytes (byte[] dest, int destpos, String src, String enc) { - try { - byte[] x = src.getBytes(enc); - System.arraycopy (x, 0, dest, destpos, x.length); - } catch (UnsupportedEncodingException e) { - assert false; - } - } - - private String buildType1Msg () { - int dlen = ntdomain.length(); - type1[16]= (byte) (dlen % 256); - type1[17]= (byte) (dlen / 256); - type1[18] = type1[16]; - type1[19] = type1[17]; - - int hlen = hostname.length(); - type1[24]= (byte) (hlen % 256); - type1[25]= (byte) (hlen / 256); - type1[26] = type1[24]; - type1[27] = type1[25]; - - copybytes (type1, 32, hostname, "ISO8859_1"); - copybytes (type1, hlen+32, ntdomain, "ISO8859_1"); - type1[20] = (byte) ((hlen+32) % 256); - type1[21] = (byte) ((hlen+32) / 256); - - byte[] msg = new byte [32 + hlen + dlen]; - System.arraycopy (type1, 0, msg, 0, 32 + hlen + dlen); - String result = "NTLM " + (new B64Encoder()).encode (msg); - return result; - } - - - /* Convert a 7 byte array to an 8 byte array (for a des key with parity) - * input starts at offset off - */ - private byte[] makeDesKey (byte[] input, int off) { - int[] in = new int [input.length]; - for (int i=0; i> 1)); - out[2] = (byte)(((in[off+1] << 6) & 0xFF) | (in[off+2] >> 2)); - out[3] = (byte)(((in[off+2] << 5) & 0xFF) | (in[off+3] >> 3)); - out[4] = (byte)(((in[off+3] << 4) & 0xFF) | (in[off+4] >> 4)); - out[5] = (byte)(((in[off+4] << 3) & 0xFF) | (in[off+5] >> 5)); - out[6] = (byte)(((in[off+5] << 2) & 0xFF) | (in[off+6] >> 6)); - out[7] = (byte)((in[off+6] << 1) & 0xFF); - return out; - } - - private byte[] calcLMHash () throws GeneralSecurityException { - byte[] magic = {0x4b, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; - byte[] pwb = password.toUpperCase ().getBytes(); - byte[] pwb1 = new byte [14]; - int len = password.length(); - if (len > 14) - len = 14; - System.arraycopy (pwb, 0, pwb1, 0, len); /* Zero padded */ - - DESKeySpec dks1 = new DESKeySpec (makeDesKey (pwb1, 0)); - DESKeySpec dks2 = new DESKeySpec (makeDesKey (pwb1, 7)); - - SecretKey key1 = fac.generateSecret (dks1); - SecretKey key2 = fac.generateSecret (dks2); - cipher.init (Cipher.ENCRYPT_MODE, key1); - byte[] out1 = cipher.doFinal (magic, 0, 8); - cipher.init (Cipher.ENCRYPT_MODE, key2); - byte[] out2 = cipher.doFinal (magic, 0, 8); - - byte[] result = new byte [21]; - System.arraycopy (out1, 0, result, 0, 8); - System.arraycopy (out2, 0, result, 8, 8); - return result; - } - - private byte[] calcNTHash () throws GeneralSecurityException { - byte[] pw = null; - try { - pw = password.getBytes ("UnicodeLittleUnmarked"); - } catch (UnsupportedEncodingException e) { - assert false; - } - byte[] out = md4.digest (pw); - byte[] result = new byte [21]; - System.arraycopy (out, 0, result, 0, 16); - return result; - } - - /* key is a 21 byte array. Split it into 3 7 byte chunks, - * Convert each to 8 byte DES keys, encrypt the text arg with - * each key and return the three results in a sequential [] - */ - private byte[] calcResponse (byte[] key, byte[] text) - throws GeneralSecurityException { - assert key.length == 21; - DESKeySpec dks1 = new DESKeySpec (makeDesKey (key, 0)); - DESKeySpec dks2 = new DESKeySpec (makeDesKey (key, 7)); - DESKeySpec dks3 = new DESKeySpec (makeDesKey (key, 14)); - SecretKey key1 = fac.generateSecret (dks1); - SecretKey key2 = fac.generateSecret (dks2); - SecretKey key3 = fac.generateSecret (dks3); - cipher.init (Cipher.ENCRYPT_MODE, key1); - byte[] out1 = cipher.doFinal (text, 0, 8); - cipher.init (Cipher.ENCRYPT_MODE, key2); - byte[] out2 = cipher.doFinal (text, 0, 8); - cipher.init (Cipher.ENCRYPT_MODE, key3); - byte[] out3 = cipher.doFinal (text, 0, 8); - byte[] result = new byte [24]; - System.arraycopy (out1, 0, result, 0, 8); - System.arraycopy (out2, 0, result, 8, 8); - System.arraycopy (out3, 0, result, 16, 8); - return result; - } - - private String buildType3Msg (String challenge) throws GeneralSecurityException, - IOException { - /* First decode the type2 message to get the server nonce */ - /* nonce is located at type2[24] for 8 bytes */ - - byte[] type2 = (new sun.misc.BASE64Decoder()).decodeBuffer (challenge); - byte[] nonce = new byte [8]; - System.arraycopy (type2, 24, nonce, 0, 8); - - int ulen = username.length()*2; - type3[36] = type3[38] = (byte) (ulen % 256); - type3[37] = type3[39] = (byte) (ulen / 256); - int dlen = ntdomain.length()*2; - type3[28] = type3[30] = (byte) (dlen % 256); - type3[29] = type3[31] = (byte) (dlen / 256); - int hlen = hostname.length()*2; - type3[44] = type3[46] = (byte) (hlen % 256); - type3[45] = type3[47] = (byte) (hlen / 256); - - int l = 64; - copybytes (type3, l, ntdomain, "UnicodeLittleUnmarked"); - type3[32] = (byte) (l % 256); - type3[33] = (byte) (l / 256); - l += dlen; - copybytes (type3, l, username, "UnicodeLittleUnmarked"); - type3[40] = (byte) (l % 256); - type3[41] = (byte) (l / 256); - l += ulen; - copybytes (type3, l, hostname, "UnicodeLittleUnmarked"); - type3[48] = (byte) (l % 256); - type3[49] = (byte) (l / 256); - l += hlen; - - byte[] lmhash = calcLMHash(); - byte[] lmresponse = calcResponse (lmhash, nonce); - byte[] nthash = calcNTHash(); - byte[] ntresponse = calcResponse (nthash, nonce); - System.arraycopy (lmresponse, 0, type3, l, 24); - type3[16] = (byte) (l % 256); - type3[17] = (byte) (l / 256); - l += 24; - System.arraycopy (ntresponse, 0, type3, l, 24); - type3[24] = (byte) (l % 256); - type3[25] = (byte) (l / 256); - l += 24; - type3[56] = (byte) (l % 256); - type3[57] = (byte) (l / 256); - - byte[] msg = new byte [l]; - System.arraycopy (type3, 0, msg, 0, l); - String result = "NTLM " + (new B64Encoder()).encode (msg); - return result; - } - -} - - -class B64Encoder extends sun.misc.BASE64Encoder { - /* to force it to to the entire encoding in one line */ - protected int bytesPerLine () { - return 1024; - } -} diff --git a/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java b/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java index fd2538f90da..1badd793fb5 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/ch/EPollSelectorImpl.java b/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java index 7881fe56a31..c6a09ba4ed5 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/ch/FileDispatcherImpl.java b/jdk/src/solaris/classes/sun/nio/ch/FileDispatcherImpl.java index 41656baaafe..79f238dc7de 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/FileDispatcherImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/FileDispatcherImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,13 @@ class FileDispatcherImpl extends FileDispatcher init(); } + FileDispatcherImpl(boolean append) { + /* append is ignored */ + } + + FileDispatcherImpl() { + } + int read(FileDescriptor fd, long address, int len) throws IOException { return read0(fd, address, len); } @@ -94,6 +101,12 @@ class FileDispatcherImpl extends FileDispatcher preClose0(fd); } + FileDescriptor duplicateForMapping(FileDescriptor fd) { + // file descriptor not required for mapping operations; okay + // to return invalid file descriptor. + return new FileDescriptor(); + } + // -- Native methods -- static native int read0(FileDescriptor fd, long address, int len) diff --git a/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java b/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java index ff51aa052ca..4c88a8d4219 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java +++ b/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/ch/LinuxAsynchronousChannelProvider.java b/jdk/src/solaris/classes/sun/nio/ch/LinuxAsynchronousChannelProvider.java index 017846239a4..2fbe89685ff 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/LinuxAsynchronousChannelProvider.java +++ b/jdk/src/solaris/classes/sun/nio/ch/LinuxAsynchronousChannelProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ import java.nio.channels.*; import java.nio.channels.spi.AsynchronousChannelProvider; import java.util.concurrent.ExecutorService; import java.util.concurrent.ThreadFactory; -import java.net.ProtocolFamily; import java.io.IOException; public class LinuxAsynchronousChannelProvider @@ -88,12 +87,4 @@ public class LinuxAsynchronousChannelProvider { return new UnixAsynchronousSocketChannelImpl(toPort(group)); } - - @Override - public AsynchronousDatagramChannel openAsynchronousDatagramChannel(ProtocolFamily family, - AsynchronousChannelGroup group) - throws IOException - { - return new SimpleAsynchronousDatagramChannelImpl(family, toPort(group)); - } } diff --git a/jdk/src/solaris/classes/sun/nio/ch/PipeImpl.java b/jdk/src/solaris/classes/sun/nio/ch/PipeImpl.java index 0e2852b95a1..0e8a5492451 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/PipeImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/PipeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/ch/PollSelectorImpl.java b/jdk/src/solaris/classes/sun/nio/ch/PollSelectorImpl.java index 2a776e16a4d..17c9f03ec5d 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/PollSelectorImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/PollSelectorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/ch/SctpChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java index c4ec0116b4a..342ecb06ec4 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java index 14e9c3f83e7..028d76eb571 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/ch/SctpNet.java b/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java index c19aa7d1ec5..f464ae6c95f 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java +++ b/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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 SctpNet { /* -- Miscellaneous SCTP utilities -- */ - static boolean bindxIPv4MappedAddresses() { + private static boolean IPv4MappedAddresses() { if ("SunOS".equals(osName)) { /* Solaris supports IPv4Mapped Addresses with bindx */ return true; @@ -87,7 +87,7 @@ public class SctpNet { static void bindx(int fd, InetAddress[] addrs, int port, boolean add) throws IOException { bindx(fd, addrs, port, addrs.length, add, - bindxIPv4MappedAddresses()); + IPv4MappedAddresses()); } static Set getLocalAddresses(int fd) @@ -145,11 +145,16 @@ public class SctpNet { InetSocketAddress netAddr = (InetSocketAddress)addr; if (name.equals(SCTP_PRIMARY_ADDR)) { - setPrimAddrOption0(fd, assocId, - netAddr.getAddress(), netAddr.getPort()); + setPrimAddrOption0(fd, + assocId, + netAddr.getAddress(), + netAddr.getPort()); } else { - setPeerPrimAddrOption0(fd, assocId, - netAddr.getAddress(), netAddr.getPort()); + setPeerPrimAddrOption0(fd, + assocId, + netAddr.getAddress(), + netAddr.getPort(), + IPv4MappedAddresses()); } } else if (name.equals(SCTP_DISABLE_FRAGMENTS) || name.equals(SCTP_EXPLICIT_COMPLETE) || @@ -290,7 +295,7 @@ public class SctpNet { int port) throws IOException; static native void setPeerPrimAddrOption0(int fd, int assocId, - InetAddress ia, int port) throws IOException; + InetAddress ia, int port, boolean preferIPv6) throws IOException; static native SocketAddress getPrimAddrOption0(int fd, int assocId) throws IOException; diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java index 07d721b399e..d1e3287ead2 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/ch/SolarisAsynchronousChannelProvider.java b/jdk/src/solaris/classes/sun/nio/ch/SolarisAsynchronousChannelProvider.java index f290a4a92b4..b77f29297cd 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SolarisAsynchronousChannelProvider.java +++ b/jdk/src/solaris/classes/sun/nio/ch/SolarisAsynchronousChannelProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ import java.nio.channels.*; import java.nio.channels.spi.AsynchronousChannelProvider; import java.util.concurrent.ExecutorService; import java.util.concurrent.ThreadFactory; -import java.net.ProtocolFamily; import java.io.IOException; public class SolarisAsynchronousChannelProvider @@ -91,12 +90,4 @@ public class SolarisAsynchronousChannelProvider { return new UnixAsynchronousSocketChannelImpl(toEventPort(group)); } - - @Override - public AsynchronousDatagramChannel openAsynchronousDatagramChannel(ProtocolFamily family, - AsynchronousChannelGroup group) - throws IOException - { - return new SimpleAsynchronousDatagramChannelImpl(family, toEventPort(group)); - } } diff --git a/jdk/src/solaris/classes/sun/nio/cs/ext/COMPOUND_TEXT_Encoder.java b/jdk/src/solaris/classes/sun/nio/cs/ext/COMPOUND_TEXT_Encoder.java index d73a21b9864..15e0f4670c6 100644 --- a/jdk/src/solaris/classes/sun/nio/cs/ext/COMPOUND_TEXT_Encoder.java +++ b/jdk/src/solaris/classes/sun/nio/cs/ext/COMPOUND_TEXT_Encoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/cs/ext/CompoundTextSupport.java b/jdk/src/solaris/classes/sun/nio/cs/ext/CompoundTextSupport.java index 4f2a047110c..bb61426d33f 100644 --- a/jdk/src/solaris/classes/sun/nio/cs/ext/CompoundTextSupport.java +++ b/jdk/src/solaris/classes/sun/nio/cs/ext/CompoundTextSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/fs/LinuxFileStore.java b/jdk/src/solaris/classes/sun/nio/fs/LinuxFileStore.java index b8b18f31f09..0571227d95c 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/LinuxFileStore.java +++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxFileStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/fs/SolarisFileStore.java b/jdk/src/solaris/classes/sun/nio/fs/SolarisFileStore.java index efee0d2914b..1fcda3e7b73 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/SolarisFileStore.java +++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisFileStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/fs/UnixDirectoryStream.java b/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java index 2328c6266d3..60f958203df 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/fs/UnixFileStore.java b/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java index 5ef4cbf6410..46e09c6d7b1 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/fs/UnixPath.java b/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java index 53a32c14a64..1667263c222 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/nio/fs/UnixSecureDirectoryStream.java b/jdk/src/solaris/classes/sun/nio/fs/UnixSecureDirectoryStream.java index 33eecd14bec..19ed91919e6 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixSecureDirectoryStream.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixSecureDirectoryStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java b/jdk/src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java index bdec8fc54ed..e2279befe34 100644 --- a/jdk/src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java +++ b/jdk/src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/classes/sun/tools/attach/SolarisVirtualMachine.java b/jdk/src/solaris/classes/sun/tools/attach/SolarisVirtualMachine.java index 0d6b234fa14..d40f8a709ab 100644 --- a/jdk/src/solaris/classes/sun/tools/attach/SolarisVirtualMachine.java +++ b/jdk/src/solaris/classes/sun/tools/attach/SolarisVirtualMachine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/demo/jni/Poller/Poller.c b/jdk/src/solaris/demo/jni/Poller/Poller.c index aa86f0fcee1..aa96db01cc5 100644 --- a/jdk/src/solaris/demo/jni/Poller/Poller.c +++ b/jdk/src/solaris/demo/jni/Poller/Poller.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/jdk/src/solaris/hpi/export/byteorder_md.h b/jdk/src/solaris/hpi/export/byteorder_md.h deleted file mode 100644 index 3ba7232bb97..00000000000 --- a/jdk/src/solaris/hpi/export/byteorder_md.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Solaris-dependent byte order include - */ - -#ifndef _JAVASOFT_SOLARIS_BYTE_MD_H_ -#define _JAVASOFT_SOLARIS_BYTE_MD_H_ - -#include - -#endif /* !_JAVASOFT_SOLARIS_BYTE_MD_H_ */ diff --git a/jdk/src/solaris/hpi/export/hpi_md.h b/jdk/src/solaris/hpi/export/hpi_md.h deleted file mode 100644 index 92b96f50fc3..00000000000 --- a/jdk/src/solaris/hpi/export/hpi_md.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef _JAVASOFT_HPI_MD_H_ -#define _JAVASOFT_HPI_MD_H_ - -#include "timeval_md.h" -#include "io_md.h" -#include "path_md.h" -#include "byteorder_md.h" - -#define HPI_TIMEOUT_INFINITY ((jlong)(-1)) - -#endif /* !_JAVASOFT_HPI_MD_H_ */ diff --git a/jdk/src/solaris/hpi/export/path_md.h b/jdk/src/solaris/hpi/export/path_md.h deleted file mode 100644 index 3539437e340..00000000000 --- a/jdk/src/solaris/hpi/export/path_md.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Solaris-dependent search path definitions and API - */ - -#ifndef _JAVASOFT_SOLARIS_PATH_MD_H_ -#define _JAVASOFT_SOLARIS_PATH_MD_H_ - -#define PATH_SEPARATOR ":" -#define PATH_CURDIR "." - -#define DIR_SEPARATOR '/' -#define LOCAL_DIR_SEPARATOR '/' - -#endif /* !_JAVASOFT_SOLARIS_PATH_MD_H_ */ diff --git a/jdk/src/solaris/hpi/export/timeval_md.h b/jdk/src/solaris/hpi/export/timeval_md.h deleted file mode 100644 index 77148a850c4..00000000000 --- a/jdk/src/solaris/hpi/export/timeval_md.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef _JAVASOFT_SOLARIS_TIMEVAL_H_ -#define _JAVASOFT_SOLARIS_TIMEVAL_H_ - -typedef struct { - long tv_sec; /* seconds */ - long tv_usec; /* microseconds (NOT milliseconds) */ -} timeval_t; - -#endif /* !_JAVASOFT_SOLARIS_TIMEVAL_H_ */ diff --git a/jdk/src/solaris/hpi/include/interrupt.h b/jdk/src/solaris/hpi/include/interrupt.h deleted file mode 100644 index 9c273c0b8cb..00000000000 --- a/jdk/src/solaris/hpi/include/interrupt.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 1994, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Interrupt dispatch interface - */ - -#ifndef _JAVASOFT_INTERRUPT_H_ -#define _JAVASOFT_INTERRUPT_H_ - -/* - * Type definitions. - */ - -/*- - * A function that handles interrupt dispatch requests is of type - * intr_handler_t. This type definition is mostly for convenience. - * A declaration of a handler function, should look like this: - * - * void myHandler(int interrupt, void *siginfo, void *context, void *arg); - * - * An intr_handler_t is constrained: - * - * - It runs on the exception stack. - * - It cannot yield. - * - It cannot allocate/free memory. - * - It can only call interrupt-safe routines. - * - * "arg" is set to the "handlerArg" specified in intrRegister(). - */ -typedef void (*intr_handler_t)(int interrupt, void *siginfo, - void *context, void *arg); - -/* - * Routines. - */ - -/* Initialize the interrupt system */ -void intrInit(void); - -/* Set a handler for a particular interrupt */ -signal_handler_t intrRegister(int interrupt, intr_handler_t handler, - void *handlerArg); - -/* Dispatch an interrupt (called from the low-level handlers) */ -void intrDispatch(int interrupt, void *siginfo, void *context); - -/*- - * The target specific header file should define the following - * - * Constants - * - * N_INTERRUPTS - The number of interrupt channels. These - * are numbered from 0 to (N_INTERRUPTS - 1). - */ -#ifdef __linux__ -#define N_INTERRUPTS NSIG /* 0 to NSIG - 1*/ -#else -#define N_INTERRUPTS 32 /* 0 to 31 */ -#endif - -/*- - * Routines/Macros that control whether interrupts are enabled or - * not. - * - * void intrLock(void) - Disable all interrupts. - * void intrUnlock(void) - Enable all interrupts. - * - * Note: intrLock()/intrUnlock() pairs can be nested. - * - */ - -void intrLock(void); -void intrUnlock(void); - -/*- - * intrInitMD() -- - * Initialize the machine-dependant interrupt software. - * - * This routine should leave the all interrupts disabled as if - * one (1) intrLock() had been called. At the end of the - * bootstrap, a single intrUnlock(), will be called to turn - * interrupts on. - */ - -void intrInitMD(void); - -#if defined(__solaris__) && !defined(SA_SIGINFO) -#error signal.h has not been included? -#endif - -#ifdef SA_SIGINFO -/* Thread implementation dependent interrupt dispatcher. */ -void intrDispatchMD(int sig, siginfo_t *info, void *uc); -#else -void intrDispatchMD(int sig); -#endif - -/* Whether the signal is used by the HPI implementation */ -bool_t intrInUse(int sig); - -#endif /* !_JAVASOFT_INTERRUPT_H_ */ diff --git a/jdk/src/solaris/hpi/include/largefile_solaris.h b/jdk/src/solaris/hpi/include/largefile_solaris.h deleted file mode 100644 index b40666ffe97..00000000000 --- a/jdk/src/solaris/hpi/include/largefile_solaris.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef _JAVASOFT_SOLARIS_LARGEFILE_SUPPORT_H_ -#define _JAVASOFT_SOLARIS_LARGEFILE_SUPPORT_H_ - -#include -#include - -/** - * This file contains the definitions for providing 64 bit File I/O support. - */ - -#if !defined(_LFS_LARGEFILE) || !_LFS_LARGEFILE - -#ifdef __GLIBC__ -typedef jlong longlong_t; -#endif - -/* - * This definition is from Solaris 2.6; it is required by systems that do not - * support large files (e.g., Solaris 2.5.1). - */ - -typedef longlong_t off64_t; /* offsets within files */ - - -#ifdef __GLIBC__ -/* Doesn't matter what these are, there is no 64 bit support. */ -typedef int u_longlong_t; -typedef int timestruc_t; -#define _ST_FSTYPSZ 1 -#endif /* __GLIBC__ */ - -/* - * The stat64 structure must be provided on systems without large file - * support (e.g., Solaris 2.5.1). These definitions are from Solaris 2.6 - * sys/stat.h and sys/types.h. - */ - -typedef u_longlong_t ino64_t; /* expanded inode type */ -typedef longlong_t blkcnt64_t; /* count of file blocks */ - -struct stat64 { - dev_t st_dev; - long st_pad1[3]; - ino64_t st_ino; - mode_t st_mode; - nlink_t st_nlink; - uid_t st_uid; - gid_t st_gid; - dev_t st_rdev; - long st_pad2[2]; - off64_t st_size; - timestruc_t st_atim; - timestruc_t st_mtim; - timestruc_t st_ctim; - long st_blksize; - blkcnt64_t st_blocks; - char st_fstype[_ST_FSTYPSZ]; - long st_pad4[8]; -}; - -#define O_LARGEFILE 0x2000 /* Solaris 2.6 sys/fcntl.h */ -#endif /* !_LFS_LARGEFILE */ - -#endif /* !_JAVASOFT_SOLARIS_LARGEFILE_SUPPORT_H_ */ diff --git a/jdk/src/solaris/hpi/native_threads/include/condvar_md.h b/jdk/src/solaris/hpi/native_threads/include/condvar_md.h deleted file mode 100644 index 0f86fbb5987..00000000000 --- a/jdk/src/solaris/hpi/native_threads/include/condvar_md.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Interface to condition variable HPI implementation for Solaris - */ - -#ifndef _JAVASOFT_CONDVAR_MD_H_ -#define _JAVASOFT_CONDVAR_MD_H_ - -#include "threads_md.h" - -typedef struct condvar { - cond_t cond; /* Manual-reset event for notifications */ - unsigned int counter; /* Current number of notifications */ -} condvar_t; - -int condvarInit(condvar_t *); -int condvarDestroy(condvar_t *); -int condvarWait(condvar_t *, mutex_t *, thread_state_t wtype); -int condvarTimedWait(condvar_t *, mutex_t *, jlong millis, thread_state_t wtype); -int condvarSignal(condvar_t *); -int condvarBroadcast(condvar_t *); - -#endif /* !_JAVASOFT_CONDVAR_MD_H_ */ diff --git a/jdk/src/solaris/hpi/native_threads/include/monitor_md.h b/jdk/src/solaris/hpi/native_threads/include/monitor_md.h deleted file mode 100644 index 7d20da695a3..00000000000 --- a/jdk/src/solaris/hpi/native_threads/include/monitor_md.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Monitor interface 10/25/94 - * - * Private data structures and interfaces used in the monitor code. - * This file is used to share declarations and such between the different - * files implementing monitors. It does not contain exported API. - */ - -#ifndef _JAVASOFT_SOLARIS_MONITOR_MD_H_ -#define _JAVASOFT_SOLARIS_MONITOR_MD_H_ - -#include -#include -#include - -/* - * Type definitions. - */ - -typedef struct monitor_waiter monitor_waiter_t; -typedef struct monitor_wait_queue monitor_wait_queue_t; - -/* Element of the MonitorWaitQ - representing thread doing a monitor wait */ -/* - * The only reason we do the queueing is for sysMonitorDumpInfo. - * The counting, though, is used to avoid extraneous calls to - * condvarBroadcast and condvarSignal, for instance. - */ -struct monitor_waiter { - monitor_waiter_t *next; - monitor_waiter_t **prev; - sys_thread_t *waiting_thread; -}; - -struct monitor_wait_queue { - monitor_waiter_t *head; /* linked list of waiting threads */ - short count; /* number of waiters on the list */ -}; - -#define ANY_WAITING(mwq) ((mwq).count > 0) -#define INIT_MONITOR_WAIT_QUEUE(mwq) { (mwq).head = NULL; (mwq).count = 0; } - -/* The system-level monitor data structure */ -struct sys_mon { - mutex_t mutex; /* The monitor's mutex */ - condvar_t cv_monitor; /* Notify those doing monitorWait on - the monitor */ - /* - * Threads waiting on either of the above condvars put themselves - * on one of these lists. - */ - monitor_wait_queue_t mwait_queue; /* Head of MonitorWaitQ */ - - /* Thread currently executing in this monitor */ - sys_thread_t *monitor_owner; - long entry_count; /* Recursion depth */ - int contention_count; -}; - -void initializeContentionCountMutex(); - -typedef enum { - ASYNC_REGISTER, - ASYNC_UNREGISTER -} async_action_t; - -/* - * Macros - */ - -#define SYS_MID_NULL ((sys_mon_t *) 0) - -typedef enum { - SYS_ASYNC_MON_ALARM = 1, - SYS_ASYNC_MON_IO, - SYS_ASYNC_MON_EVENT, - SYS_ASYNC_MON_CHILD, - SYS_ASYNC_MON_MAX -} async_mon_key_t; - -#define SYS_ASYNC_MON_INPUT SYS_ASYNC_MON_IO -#define SYS_ASYNC_MON_OUTPUT SYS_ASYNC_MON_IO - -sys_mon_t *asyncMon(async_mon_key_t); - -#endif /* !_JAVASOFT_SOLARIS_MONITOR_MD_H_ */ diff --git a/jdk/src/solaris/hpi/native_threads/include/mutex_md.h b/jdk/src/solaris/hpi/native_threads/include/mutex_md.h deleted file mode 100644 index c384d00b280..00000000000 --- a/jdk/src/solaris/hpi/native_threads/include/mutex_md.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Interface to mutex HPI implementation for Solaris - */ - -#ifndef _JAVASOFT_MUTEX_MD_H_ -#define _JAVASOFT_MUTEX_MD_H_ - -#include "porting.h" - -/* - * Generally, we would typedef mutex_t to be whatever the system - * supplies. But Solaris gives us mutex_t directly. - */ - -#ifdef USE_PTHREADS -#define mutexInit(m) pthread_mutex_init(m, 0) -#else -#define mutexInit(m) mutex_init(m, USYNC_THREAD, 0) -#endif -#define mutexDestroy(m) mutex_destroy(m) -#define mutexLock(m) mutex_lock(m) -#define mutexUnlock(m) mutex_unlock(m) -bool_t mutexLocked(mutex_t *); - -#endif /* !_JAVASOFT_MUTEX_MD_H_ */ diff --git a/jdk/src/solaris/hpi/native_threads/include/np.h b/jdk/src/solaris/hpi/native_threads/include/np.h deleted file mode 100644 index 8fab6e19376..00000000000 --- a/jdk/src/solaris/hpi/native_threads/include/np.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Non-posix parts of the threads HPI. - */ - -#ifndef _JAVASOFT_NP_H_ -#define _JAVASOFT_NP_H_ - -extern int np_suspend(sys_thread_t *tid); -extern int np_continue(sys_thread_t *tid); - -extern int np_single(void); -extern void np_multi(void); -extern int np_stackinfo(void **addr, long *size); -extern int np_initialize(void); -extern void np_initialize_thread(sys_thread_t *tid); -#ifdef __linux__ -extern int np_initial_suspend(sys_thread_t *tid); -extern void np_free_thread(sys_thread_t *tid); -#endif - -extern void np_profiler_init(sys_thread_t *tid); -extern int np_profiler_suspend(sys_thread_t *tid); -extern int np_profiler_continue(sys_thread_t *tid); -extern bool_t np_profiler_thread_is_running(sys_thread_t *tid); - -#endif /* !_JAVASOFT_NP_H_ */ diff --git a/jdk/src/solaris/hpi/native_threads/include/porting.h b/jdk/src/solaris/hpi/native_threads/include/porting.h deleted file mode 100644 index fdbbec00715..00000000000 --- a/jdk/src/solaris/hpi/native_threads/include/porting.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef _JAVASOFT_PORTING_H_ -#define _JAVASOFT_PORTING_H_ - -#ifndef USE_PTHREADS - -#include -#include -#include - -#else /* USE_PTHREADS */ - -#include - -/* There is a handshake between a newly created thread and its creator - * at thread startup because the creator thread needs to suspend the - * new thread. Currently there are two ways to do this -- with - * semaphores and with mutexes. The semaphore based implementation is - * cleaner and hence is the default. We wish the mutex based one will - * go away, but turns out the implementation of semaphores on - * Linux/ppc etc is flaky, so the mutex based solution lives for now. - */ -#ifndef USE_MUTEX_HANDSHAKE -#include -#endif - -#undef BOUND_THREADS - -#define thread_t pthread_t - -#define mutex_t pthread_mutex_t -#define mutex_lock pthread_mutex_lock -#define mutex_trylock pthread_mutex_trylock -#define mutex_unlock pthread_mutex_unlock -#define mutex_destroy pthread_mutex_destroy - -#define cond_t pthread_cond_t -#define cond_destroy pthread_cond_destroy -#define cond_wait pthread_cond_wait -#define cond_timedwait pthread_cond_timedwait -#define cond_signal pthread_cond_signal -#define cond_broadcast pthread_cond_broadcast - -#define thread_key_t pthread_key_t -#define thr_setspecific pthread_setspecific -#define thr_keycreate pthread_key_create - -#define thr_sigsetmask pthread_sigmask -#define thr_self pthread_self -#define thr_yield sched_yield -#define thr_kill pthread_kill -#define thr_exit pthread_exit -#ifdef __linux__ -void intrHandler(void*); -#endif -#endif /* USE_PTHREADS */ - -#endif /* !_JAVASOFT_PORTING_H_ */ diff --git a/jdk/src/solaris/hpi/native_threads/include/threads_md.h b/jdk/src/solaris/hpi/native_threads/include/threads_md.h deleted file mode 100644 index a958a40f9cb..00000000000 --- a/jdk/src/solaris/hpi/native_threads/include/threads_md.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Implementation of the Java threads HPI on top of Solaris threads - */ - -#ifndef _JAVASOFT_SOLARIS_THREADS_MD_H_ -#define _JAVASOFT_SOLARIS_THREADS_MD_H_ - -#include "porting.h" - -#ifdef sparc -#define N_TRACED_REGS 12 -#elif i386 -#define N_TRACED_REGS 7 -#elif amd64 -#define N_TRACED_REGS 15 -#elif ppc -#define N_TRACED_REGS 1 -#elif m68k -#define N_TRACED_REGS 8 -#elif ia64 -/* [RGV] I don't think this is referenced in the linux code */ -#define N_TRACED_REGS 32 -#else -// TODO: delete this file - threads_md.[ch] is obsolete. struct sys_thread is -// never used. Define a value just to keep compiler happy. -#define N_TRACED_REGS 32 -#endif - -/* Turn on if we want all java threads to be bound tolwps */ -/* #define BOUND_THREADS */ -/* Use /proc soln to stop lwps in place of siglwp soln */ -#define PROCLWP - -/* - * Thread C stack overflow check -#define sysThreadCheckStack(redzone, var) \ - ((var = sysThreadSelf()) && \ - (unsigned int)((char *)&(var) - (char *)(var)->stack_base)\ - < (redzone)) -*/ -/* - * Forward definition of machine dependent monitor struct - */ -struct sys_mon; - -/* - * The following thread states are really hints since there is no - * interface to get at a native thread's true state. The states - * are maintained by updating the states where ever possible - * such as a transition to CONDVAR_WAIT occurs in the definition of - * the routine condvarWait(). - * This state maintenance should disappear once we have a threads interface - * to obtain a thread's state. - */ -typedef enum { - FIRST_THREAD_STATE, - RUNNABLE = FIRST_THREAD_STATE, - SUSPENDED, - CONDVAR_WAIT, - NUM_THREAD_STATES -} thread_state_t; - -#if defined( USE_PTHREADS) && !defined(__linux__) -/* - * Mechanism for starting a new thread suspended. - */ -typedef enum { - NEW_THREAD_MUST_REQUEST_SUSPEND, - NEW_THREAD_REQUESTED_SUSPEND, - NEW_THREAD_SUSPENDED -} new_thr_state_t; - -typedef struct { - pthread_mutex_t m; - pthread_cond_t c; - new_thr_state_t state; -} new_thr_cond_t; -#endif /* USE_PTHREADS */ - -/* - * Machine dependent info in a sys_thread_t - */ -struct sys_thread { - /* - * Fields below this point may change on a per-architecture basis - * depending on how much work is needed to present the sysThread - * model on any given thread implementation. - */ - mutex_t mutex; /* per thread lock to protect thread fields */ - thread_t sys_thread; /* The native thread id */ - struct sys_thread *next; /* Pointer to next thread in the */ - /* queue of all threads. */ - thread_state_t state; - - /* Thread status flags */ - unsigned int primordial_thread:1; - unsigned int system_thread:1; - unsigned int cpending_suspend:1; -#ifdef __linux__ - unsigned int pending_interrupt:1; -#endif - unsigned int interrupted:1; - unsigned int onproc:1; /* set if thread is on an LWP */ - unsigned int :0; - -#ifdef BOUND_THREADS - lwpid_t lwpid; -#endif - -#ifdef __linux__ - void *sp; -#else - unsigned long sp; /* sp at time of last (native) thread switch */ -#endif - void * stack_bottom; /* The real bottom (high address) of stack */ - void * stack_top; /* should be equal to stack_bottom - stack_size */ - long stack_size; /* The stack size for a native thread */ - - long regs[N_TRACED_REGS]; /* stores registers as GC roots. */ - - /* Monitor specific. - - Every monitor keeps track of the number of times it is - entered. When that count goes to 0, the monitor can be - freed up. But each thread has its own entry count on a - particular monitor, because multiple threads can be using a - single monitor (as one does a wait, another enters, etc.). - Each thread can only be waiting in exactly one monitor. - That monitor waited on is saved in mon_wait, and the value - of the monitor's entry_count when the wait was performed is - saved in monitor_entry_count. That is restored into the - monitor when this waiting thread is notified. */ - - long monitor_entry_count; /* For recursive monitor entry */ - struct sys_mon *mon_wait; /* CONDVAR_WAIT'ing */ - - struct sys_mon *mon_enter; /* blocked waiting to enter */ - - void (*start_proc)(void *); - void *start_parm; - int lwp_id; - long last_sum; - - struct sys_thread *prevBlocked; /* Used by nonblocking close semantics */ - struct sys_thread *nextBlocked; -#ifdef USE_PTHREADS - int suspend_count; -#ifdef __linux__ - sem_t sem_suspended; - sem_t sem_ready_to_suspend; - sem_t sem_selfsuspend; - int selfsuspended; -#endif -#ifdef USE_MUTEX_HANDSHAKE - new_thr_cond_t ntcond; -#else - sem_t sem; -#endif /* USE_MUTEX_HANDSHAKE */ -#endif /* USE_PTHREADS */ -}; - -#define SYS_THREAD_NULL ((sys_thread_t *) 0) - -/* - * following macro copied from sys/signal.h since inside #ifdef _KERNEL there. - */ -#ifndef sigmask -#define sigmask(n) ((unsigned int)1 << (((n) - 1) & (32 - 1))) -#endif - -#ifdef __linux__ -extern thread_key_t intrJmpbufkey; -#else -extern thread_key_t sigusr1Jmpbufkey; -extern sigset_t sigusr1Mask; -#endif - -extern sys_mon_t *_sys_queue_lock; - -#define SYS_QUEUE_LOCK(self) sysMonitorEnter(self, _sys_queue_lock) -#define SYS_QUEUE_LOCKED(self) sysMonitorEntered(self, _sys_queue_lock) -#define SYS_QUEUE_UNLOCK(self) sysMonitorExit(self, _sys_queue_lock) -#define SYS_QUEUE_NOTIFYALL(self) sysMonitorNotifyAll(self, _sys_queue_lock) -#define SYS_QUEUE_WAIT(self) sysMonitorWait(self, _sys_queue_lock, \ - SYS_TIMEOUT_INFINITY) - -extern void setFPMode(void); - -extern sys_thread_t *ThreadQueue; - -extern int ActiveThreadCount; /* All threads */ - -#endif /* !_JAVASOFT_SOLARIS_THREADS_MD_H_ */ diff --git a/jdk/src/solaris/hpi/native_threads/src/condvar_md.c b/jdk/src/solaris/hpi/native_threads/src/condvar_md.c deleted file mode 100644 index 60b3fd75c72..00000000000 --- a/jdk/src/solaris/hpi/native_threads/src/condvar_md.c +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Copyright (c) 1994, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Condition variable HPI implementation for Solaris - */ - -#include -#include -#include -#include -#include - -#include "hpi_impl.h" - -#include "condvar_md.h" -#include "mutex_md.h" -#include "threads_md.h" - -int -condvarInit(condvar_t *condvar) -{ - int err; - -#ifdef USE_PTHREADS - err = pthread_cond_init(&condvar->cond, NULL); -#else - err = cond_init(&condvar->cond, USYNC_THREAD, 0 /* ignored */); -#endif - condvar->counter = 0; - return (err == 0 ? SYS_OK : SYS_ERR); -} - -int -condvarDestroy(condvar_t *condvar) -{ - int err; - -#ifdef __linux__ - err = pthread_cond_destroy((cond_t *) &condvar->cond); -#else - err = cond_destroy((cond_t *) condvar); -#endif - return (err == 0 ? SYS_OK : SYS_ERR); -} - -int -condvarWait(condvar_t *condvar, mutex_t *mutex, thread_state_t wtype) -{ - sigjmp_buf jmpbuf; - int err; - - sys_thread_t *self = sysThreadSelf(); - /* - * There is no threads interface to get a thread's state. So, instead, - * we use this hack so that the debugger agent can get at this thread's - * state. Of course, this is not very reliable, but when a thread goes - * to sleep, it *will* be reported as sleeping. During the transition - * from running to sleep, it may be incorrectly reported, since the - * setting of the state here is not atomic with the voluntary sleep. - * The better fix is to extend the Solaris threads interface and have - * the debugger agent call this interface OR to use libthread_db for - * intra-process state reporting. - * - * Now, condition variables are used either for waiting to enter a - * monitor (MONITOR_WAIT) or to execute a "wait()" method when already - * holding a monitor (CONDVAR_WAIT). So, when condvarWait() is called - * it could be to wait for a monitor or for a condition within a - * monitor. This is indicated by the "wtype" argument to condvarWait(). - * This type is set in the thread state before going to sleep. - */ - self->state = wtype; - -#ifdef __linux__ - /* - * Register our intrHandler as a cleanup handler. If we get - * interrupted (i.e. canceled), we longjmp out of this handler. - */ - pthread_cleanup_push(intrHandler, NULL); - if (setjmp(jmpbuf) == 0) { - /* - * Set the jmp buf and enable cancellation. - */ - thr_setspecific(intrJmpbufkey, &jmpbuf); - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); - - /* - * Note: pthread_cond_wait is _not_ interruptible on Linux - */ -#else - thr_setspecific(sigusr1Jmpbufkey, &jmpbuf); - if (sigsetjmp(jmpbuf, 1) == 0) { - sigset_t osigset; - - thr_sigsetmask(SIG_UNBLOCK, &sigusr1Mask, &osigset); -again: -#endif - err = cond_wait((cond_t *) condvar, (mutex_t *) mutex); - switch(err) { - case 0: - err = SYS_OK; - break; -#ifndef __linux__ - case EINTR: /* Signals other than USR1 were received. */ - goto again; -#endif - default: - err = SYS_ERR; - } -#ifdef __linux__ - /* - * Disable cancellation and clear the jump buf. - */ - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); - thr_setspecific(intrJmpbufkey, NULL); -#else - thr_sigsetmask(SIG_SETMASK, &osigset, NULL); -#endif - } else { - /* - * we've received a SIGUSR1 to interrupt our wait. We just return - * and something above use notices the change. - * clear the jump buf just to be paranoid. - */ -#ifndef __linux__ - thr_setspecific(sigusr1Jmpbufkey, NULL); -#endif - err = SYS_INTRPT; - } -#ifdef __linux__ - pthread_cleanup_pop(0); -#endif - /* - * After having woken up, change the thread state to RUNNABLE, since - * it is now runnable. - */ - self->state = RUNNABLE; - - return err; -} - -/* - * Returns 0 if condition variable became true before timeout expired. - * Returns 1 if timeout expired first. - * Returns <0 if wait fails for any other reason. - */ -int -condvarTimedWait(condvar_t *condvar, mutex_t *mutex, - jlong millis, thread_state_t wtype) -{ -#ifdef __linux__ - jmp_buf jmpbuf; -#else - sigjmp_buf jmpbuf; -#endif - int err; - struct timespec timeout; - sys_thread_t *self; - jlong end_time; - - if (millis < 0) - return SYS_ERR; - - if (millis > (jlong)INT_MAX) { - return condvarWait(condvar, mutex, wtype); - } - - end_time = sysTimeMillis() + millis; - - self = sysThreadSelf(); - self->state = wtype; - -#ifdef __linux__ - /* - * Register our intrHandler as a cleanup handler. If we get - * interrupted (i.e. canceled), we longjmp out of this handler. - */ - pthread_cleanup_push(intrHandler, NULL); - if (setjmp(jmpbuf) == 0) { - /* - * Set the jmp buf and enable cancellation. - */ - thr_setspecific(intrJmpbufkey, &jmpbuf); - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); - - /* - * Calculate an absolute timeout value. - */ - timeout.tv_sec = end_time / 1000; - timeout.tv_nsec = (end_time % 1000) * 1000000; - - again: -#else - thr_setspecific(sigusr1Jmpbufkey, &jmpbuf); - if (sigsetjmp(jmpbuf, 1) == 0) { - sigset_t osigset; - - thr_sigsetmask(SIG_UNBLOCK, &sigusr1Mask, &osigset); - - again: - timeout.tv_sec = end_time / 1000; - timeout.tv_nsec = (end_time % 1000) * 1000000; -#endif - err = cond_timedwait((cond_t *)condvar, (mutex_t *)mutex, &timeout); - switch(err) { - case 0: - err = SYS_OK; - break; - case EINTR: /* Signals other than USR1 were received. */ - if (sysTimeMillis() < end_time) { - goto again; - } - /*FALLTHRU*/ -#ifdef USE_PTHREADS - case ETIMEDOUT: -#else - case ETIME: -#endif - err = SYS_TIMEOUT; - break; - default: - err = SYS_ERR; - } -#ifdef __linux__ - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); - thr_setspecific(intrJmpbufkey, NULL); -#else - thr_sigsetmask(SIG_SETMASK, &osigset, NULL); -#endif - } else { - /* - * we've received a SIGUSR1 to interrupt our wait. We just return - * and something above use notices the change. - * clear the jump buf just to be paranoid. - */ -#ifndef __linux__ - thr_setspecific(sigusr1Jmpbufkey, NULL); -#endif - err = SYS_INTRPT; - } -#ifdef __linux__ - /* Remove intrHandler without calling it. */ - pthread_cleanup_pop(0); - - sysAssert(pthread_mutex_trylock(mutex) == EBUSY); - - /* - * After having woken up, change the thread state to RUNNABLE, since - * it is now runnable. - */ -#endif - self->state = RUNNABLE; - return err; -} - -int -condvarSignal(condvar_t *condvar) -{ - int err; - - err = cond_signal((cond_t *) condvar); - condvar->counter++; - return (err == 0 ? SYS_OK : SYS_ERR); -} - -int -condvarBroadcast(condvar_t *condvar) -{ - int err; - - err = cond_broadcast((cond_t *) condvar); - condvar->counter++; - return (err == 0 ? SYS_OK : SYS_ERR); -} diff --git a/jdk/src/solaris/hpi/native_threads/src/interrupt_md.c b/jdk/src/solaris/hpi/native_threads/src/interrupt_md.c deleted file mode 100644 index eea1c977aea..00000000000 --- a/jdk/src/solaris/hpi/native_threads/src/interrupt_md.c +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Solaris 2.X dependant interrupt handling code. - */ - -/* - * Header files. - */ -#include -#include -#include -#include -#include - -#include "hpi_impl.h" - -#include "mutex_md.h" -#include "condvar_md.h" -#include "monitor_md.h" -#include "threads_md.h" -#include "interrupt.h" - -static int pending_signals[N_INTERRUPTS]; - -/* Stubs used from interrupt.c: they are nontrivial on Green */ -void intrLock() {} -void intrUnlock() {} -#ifdef __linux__ -extern int sr_sigsusp; -extern int sr_sigresu; -#endif - -/* We need a special monitor implementation for signals because - * signal handlers are not necessarily called in a Java thread. - */ -struct { - thread_t owner; - unsigned int count; - mutex_t mutex; - condvar_t condvar; -} userSigMon; - -static void sigMonitorInit() -{ - userSigMon.owner = 0; - userSigMon.count = 0; - mutexInit(&userSigMon.mutex); - condvarInit(&userSigMon.condvar); -} - -static void sigMonitorEnter() -{ - thread_t self = thr_self(); - - if (userSigMon.owner == self) { - userSigMon.count++; - } else { - mutex_lock(&userSigMon.mutex); - userSigMon.owner = self; - userSigMon.count = 1; - } -} - -static void sigMonitorExit() -{ - thread_t self = thr_self(); - - sysAssert(userSigMon.owner == self); - sysAssert(userSigMon.count > 0); - if (--userSigMon.count == 0) { - userSigMon.owner = 0; - mutex_unlock(&userSigMon.mutex); - } -} - -static void sigMonitorNotify() -{ - thread_t self = thr_self(); - - sysAssert(userSigMon.owner == self); - sysAssert(userSigMon.count > 0); - condvarSignal(&userSigMon.condvar); -} - -static void sigMonitorWait() -{ - thread_t self = thr_self(); - - unsigned int saved_count = userSigMon.count; - - sysAssert(userSigMon.owner == self); - sysAssert(userSigMon.count > 0); - - userSigMon.count = 0; - userSigMon.owner = 0; - - condvarWait(&userSigMon.condvar, &userSigMon.mutex, CONDVAR_WAIT); - - sysAssert(userSigMon.owner == 0); - sysAssert(userSigMon.count == 0); - - userSigMon.count = saved_count; - userSigMon.owner = self; -} - -static int -my_sigignore(int sig) -{ -#ifndef HAVE_SIGIGNORE - struct sigaction action; - sigset_t set; - - action.sa_handler = SIG_IGN; - action.sa_flags = 0; - sigemptyset(&action.sa_mask); - - if (sigaction(sig, &action, (struct sigaction *)0) < 0) - return -1; - sigemptyset(&set); - if (sigaddset(&set, sig) < 0) - return -1; - return sigprocmask(SIG_UNBLOCK, &set, (sigset_t *)0); -#else - return sigignore(sig); -#endif /* HAVE_SIGIGNORE */ -} - - -/* - * intrInitMD() -- Target-specific initialization. - */ -extern void -intrInitMD() -{ - memset(pending_signals, 0, sizeof(pending_signals)); - (void)my_sigignore(SIGPIPE); - sigMonitorInit(); -} - -/*- - * intrDispatchMD() -- Turn our signal into an intrDispatch(). - */ -void -#ifdef SA_SIGINFO -intrDispatchMD(int sig, siginfo_t *info, void *uc) -#else -intrDispatchMD(int sig) -#endif /* SA_SIGINFO */ -{ - Log1(1, "signalHandlerDispatch(sig=%d)\n", sig); - - sigMonitorEnter(); -#ifdef SA_SIGINFO -#if defined(__linux__) && defined(__sparc__) - uc = (((char *)&sig) + 4 + 0x20); - info = (siginfo_t *)(((char *)uc) + 0x60); -#endif - intrDispatch(sig, info, uc); -#else - intrDispatch(sig, 0, 0); -#endif /* SA_SIGINFO */ - - sigMonitorExit(); -} - -bool_t intrInUse(int sig) -{ - /* Signals used in native threads implementation. */ -#ifdef __linux__ - return sig == SIGPIPE || sig == sr_sigsusp || sig == sr_sigresu; -#else - return sig == SIGPIPE || sig == SIGUSR1; -#endif -} - -void sysSignalNotify(int sig) -{ - sigMonitorEnter(); - pending_signals[sig]++; - sigMonitorNotify(); - sigMonitorExit(); -} - -static int lookupSignal() -{ - int i; - for (i = 0; i < N_INTERRUPTS; i++) { - if (pending_signals[i]) { - pending_signals[i]--; - return i; - } - } - return -1; -} - -int sysSignalWait() -{ - int sig; - sigMonitorEnter(); - while ((sig = lookupSignal()) == -1) { - sigMonitorWait(); - } - sigMonitorExit(); - return sig; -} diff --git a/jdk/src/solaris/hpi/native_threads/src/monitor_md.c b/jdk/src/solaris/hpi/native_threads/src/monitor_md.c deleted file mode 100644 index 577888b5141..00000000000 --- a/jdk/src/solaris/hpi/native_threads/src/monitor_md.c +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Monitor implementation for Native Solaris threads - * - * Java Monitors are implemented using one solaris mutex and two - * condition variables. Because solaris mutex is not re-entrant we - * cannot simply have a monitor map to a mutex as re-entering a monitor - * would deadlock an application. - * - * Monitor is implemented using: - * mutex_t mutex; - * condvar_t cv_monitor; - * condvar_t cv_waiters; - * - * mutex protects the monitor state. - * cv_monitor is the condtion variable used along with mutex for - * supporting wait and notify on the monitor. - * cv_waiters is used for all the threads waiting to acquire the monitor - * lock. - * - * All of the sysMonitorXXX() functions that are passed a sys_mon_t - * assume that they get something nonnull, and only check when debugging. - */ - -#include "hpi_impl.h" - -#include "threads_md.h" -#include "monitor_md.h" - -#include -#include - -static mutex_t contention_count_mutex; - -void initializeContentionCountMutex() -{ - mutexInit(&contention_count_mutex); -} - -/* - * Operations on monitors - */ -/* - * Return the size of the lib-dependent portion of monitors. This - * is done this way so that monitors can be all of one piece, - * without paying the penalty of an extra level of indirection on - * each sys_mon reference. This is not how it is done for threads - * and it might be a good idea to use a pointer the same way that - * threads do. - */ -size_t -sysMonitorSizeof() -{ - return sizeof(struct sys_mon); -} - -int -sysMonitorInit(sys_mon_t *mid) -{ - int ret; - - sysAssert(mid != SYS_MID_NULL); - ret = mutexInit(&mid->mutex); - ret = (ret == SYS_OK ? condvarInit(&mid->cv_monitor) : ret); - - mid->entry_count = 0; - mid->monitor_owner = SYS_THREAD_NULL; - mid->contention_count = 0; - INIT_MONITOR_WAIT_QUEUE( mid->mwait_queue ); - - return ret; -} - -/* - * Free any system-dependent resources held by monitors. There is - * nothing to be done for native Solaris mutexes or condition variables. - */ -int -sysMonitorDestroy(sys_mon_t *mid) -{ - sysAssert(mid != SYS_MID_NULL); - - return SYS_OK; -} - -static void -enqueue_me(monitor_waiter_t *mp, monitor_wait_queue_t *queue, - sys_thread_t *self) -{ - /* - * Order does not matter here. It is more convenient to - * enqueue ourselves at the head of the list, so we do so. - */ - mp->waiting_thread = self; - mp->next = queue->head; - mp->prev = &(queue->head); - if ( queue->head != NULL ){ - queue->head->prev = &(mp->next); - } - queue->head = mp; - queue->count++; -} - -static void -dequeue_me(monitor_waiter_t *mp, monitor_wait_queue_t *queue) -{ - queue->count--; - *(mp->prev) = mp->next; - if (mp->next != NULL ){ - mp->next->prev = mp->prev; - } - mp->next = NULL; -} - -int -sysMonitorEnter(sys_thread_t *self, sys_mon_t *mid) -{ - int err; - - sysAssert(mid != SYS_MID_NULL); - err = mutex_trylock(&mid->mutex); - if (err == 0) { /* no one owns it */ - mid->monitor_owner = self; - mid->entry_count = 1; - return SYS_OK; - } else if (err == EBUSY) { /* it's already locked */ - if (mid->monitor_owner == self) { - mid->entry_count++; - return SYS_OK; - } else { - self->mon_enter = mid; - /* block on it */ - if (profiler_on) { - VM_CALL(monitorContendedEnter)(self, mid); - mutexLock(&contention_count_mutex); - mid->contention_count++; - mutexUnlock(&contention_count_mutex); - } - mutex_lock(&mid->mutex); - mid->monitor_owner = self; - mid->entry_count = 1; - self->mon_enter = NULL; - if (profiler_on) { - mutexLock(&contention_count_mutex); - mid->contention_count--; - mutexUnlock(&contention_count_mutex); - VM_CALL(monitorContendedEntered)(self, mid); - } - return SYS_OK; - } - } else { - sysAssert(err == 0); - return SYS_ERR; - } -} - -/* - * Return true if we currently own this monitor (and threads have been - * initialized. - */ -bool_t -sysMonitorEntered(sys_thread_t *self, sys_mon_t *mid) -{ - sysAssert(mid != SYS_MID_NULL); - - /* We can only have locked monitors if threads have been initialized */ - return (mid->monitor_owner == self); -} - -int -sysMonitorExit(sys_thread_t *self, sys_mon_t *mid) -{ - sysAssert(mid != SYS_MID_NULL); - - if (mid->monitor_owner == self) { - sysAssert(mid->entry_count > 0); - if (--mid->entry_count == 0) { - mid->monitor_owner = SYS_THREAD_NULL; - if (!mid->contention_count || !profiler_on) { - mutex_unlock(&mid->mutex); - } else { - mutex_unlock(&mid->mutex); - VM_CALL(monitorContendedExit)(self, mid); - } - } - return SYS_OK; - } else { - return SYS_ERR; - } -} - -int -sysMonitorNotify(sys_thread_t *self, sys_mon_t *mid) -{ - sysAssert(mid != SYS_MID_NULL); - if (self == mid->monitor_owner) { - if (ANY_WAITING(mid->mwait_queue)) { - /* If there is someone doing a monitor wait */ - condvarSignal(&(mid->cv_monitor)); - } - return SYS_OK; - } else - return SYS_ERR; -} - -int -sysMonitorNotifyAll(sys_thread_t *self, sys_mon_t *mid) -{ - sysAssert(mid != SYS_MID_NULL); - if (self == mid->monitor_owner) { - if (ANY_WAITING(mid->mwait_queue)) { - /* If there is someone doing a monitor wait */ - condvarBroadcast(&(mid->cv_monitor)); - } - return SYS_OK; - } else - return SYS_ERR; -} - -int -sysMonitorWait(sys_thread_t *self, sys_mon_t *mid, jlong millis) -{ - int ret = SYS_OK; - monitor_waiter_t me; - sysAssert(mid != SYS_MID_NULL); - - if (self != mid->monitor_owner) { - return SYS_ERR; - } - if (sysThreadIsInterrupted(self, TRUE)) { - return SYS_INTRPT; - } - - /* Prepare to wait: drop mutex ownership */ - sysAssert(self->monitor_entry_count == 0); - sysAssert(self->mon_wait == 0); - self->mon_wait = (sys_mon_t *) mid; - self->monitor_entry_count = mid->entry_count; - mid->entry_count = 0; - mid->monitor_owner = SYS_THREAD_NULL; - - /* Add myself to the monitor waitq */ - enqueue_me(&me, &mid->mwait_queue, self); - if (millis == SYS_TIMEOUT_INFINITY) { - ret = condvarWait(&mid->cv_monitor, &mid->mutex, CONDVAR_WAIT); - } else { - ret = condvarTimedWait(&mid->cv_monitor, &mid->mutex, millis, - CONDVAR_WAIT); - } - dequeue_me(&me, &mid->mwait_queue); - - sysAssert(mid->monitor_owner == NULL); - sysAssert(mid->entry_count == 0); - mid->monitor_owner = self; - mid->entry_count = self->monitor_entry_count; - self->monitor_entry_count = 0; - self->mon_wait = 0; - - /* Did we get interrupted in mid-wait? (IS THIS THE RIGHT PLACE?) */ - if (sysThreadIsInterrupted(self, TRUE)) { - return SYS_INTRPT; - } - - return ret; -} - -static int -dumpWaitingQueue(monitor_wait_queue_t *queue, sys_thread_t **waiters, int sz) -{ - int n; - monitor_waiter_t * waiter; - if (queue == NULL || ( waiter = queue->head ) == NULL ) { - return 0; - } - for (n = 0; waiter != 0; waiter = waiter->next, n++, sz--) { - if (sz > 0) { - waiters[n] = waiter->waiting_thread; - } - } - return n; -} - -typedef struct { - sys_mon_t *mid; - sys_thread_t **waiters; - int sz; - int nwaiters; -} wait_info; - -static int -findWaitersHelper(sys_thread_t *t, void *arg) -{ - wait_info * winfo = (wait_info *) arg; - if (t->mon_enter == winfo->mid) { - if (winfo->sz > 0) { - winfo->waiters[winfo->nwaiters] = t; - } - winfo->sz--; - winfo->nwaiters++; - } - return SYS_OK; -} - -int -sysMonitorGetInfo(sys_mon_t *mid, sys_mon_info *info) -{ - wait_info winfo; - - sysAssert(mid != SYS_MID_NULL); - info->owner = mid->monitor_owner; - if (mid->monitor_owner) { - info->entry_count = mid->entry_count; - } - - winfo.mid = mid; - winfo.nwaiters = 0; - winfo.waiters = info->monitor_waiters; - winfo.sz = info->sz_monitor_waiters; - sysThreadEnumerateOver(findWaitersHelper, (void *) &winfo); - info->n_monitor_waiters = winfo.nwaiters; - - info->n_condvar_waiters = dumpWaitingQueue(&mid->mwait_queue, - info->condvar_waiters, - info->sz_condvar_waiters); - - return SYS_OK; -} - - -bool_t -sysMonitorInUse(sys_mon_t * mon) -{ - return mon->monitor_owner != 0 || - mon->mwait_queue.count != 0; -} - -sys_thread_t * -sysMonitorOwner(sys_mon_t *mon) -{ - return mon->monitor_owner; -} diff --git a/jdk/src/solaris/hpi/native_threads/src/sys_api_td.c b/jdk/src/solaris/hpi/native_threads/src/sys_api_td.c deleted file mode 100644 index 54da289e1d2..00000000000 --- a/jdk/src/solaris/hpi/native_threads/src/sys_api_td.c +++ /dev/null @@ -1,599 +0,0 @@ -/* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Solaris-dependent I/O Note: Routines here are just place holders - - * eventually we need to put in a solution that involves using - * setjmp/longjmp to avoid io races. Look at green_threads/io_md.c for - * more detailed comments on the architechture of the io modules. - */ -#include -#include -#include - -#ifdef HAVE_FILIOH -#include -#else -#include -#endif - -#include -#include -#include -#ifndef USE_SELECT -#include -#endif - -#include "hpi_impl.h" - -#include "threads_md.h" -#include "io_md.h" -#include "largefile.h" -#include "mutex_md.h" - -#if defined(__solaris__) && defined(NO_INTERRUPTIBLE_IO) -#error If there was no policy change, this could be a makefile error. -#endif - -#ifdef NO_INTERRUPTIBLE_IO -#undef CLOSEIO -#else -#define CLOSEIO -#endif /* NO_INTERRUPTIBLE_IO */ - -/* Get typedef for rlim_t */ -#include - -#ifdef CLOSEIO - -/* - * Structure for file control block, used by closable IO. - * We should NOT add more field into the data structure. - * Otherwise, the sysRead() will only work with sysOpen, - * and may NOT work with a fd return by open() - */ -typedef struct -{ - mutex_t lock; /* lock against the entry */ - sys_thread_t* list; /* blocking list on the fd */ -} file_t; - -/* - * Global data structure for interruptable io. - * It must be initialized before any IO access. - */ -static file_t * fd_table = 0; -static int fd_limit = 0; - -/* - * Initialize global data structure for non-blocking - * close semantics for Solaris 2.6 and ealier. - */ -int InitializeIO(rlim_t limit) -{ - int i; - - fd_limit = (int) limit; - - fd_table = (file_t *) sysCalloc(fd_limit, sizeof(file_t)); - if (fd_table == 0) { - return SYS_ERR; - } - - for (i = 0; i < fd_limit; i++) { - mutexInit(&(fd_table[i].lock)); - } - - return SYS_OK; -} - -/* - * Cleanup the data structure allocated as above. - * For JDK 1.2, this function is not called ... - */ -void FinalizeIO() { - int i; - for (i = 0; i < fd_limit; i++) { - mutexDestroy(&fd_table[i].lock); - } - sysFree(fd_table); - fd_table = 0; -} - -/* - * Non-blocking close semantics on Solaris native thread. - */ -int sysClose(int fd) -{ - int ret; - - /* Check if it is valid fd. */ - if (fd >= 0 && fd < fd_limit) { - file_t* file = &fd_table[fd]; - sys_thread_t *thread; - sys_thread_t *next; - - /* Lock the corresponding fd. */ - mutexLock(&file->lock); - - /* Read the blocking list. */ - thread = file->list; - - /* Iterates the list and interrupt every thread in there. */ - while (thread) { - /* This is the classic double-linked list operation. */ - if (thread->nextBlocked != thread) { - next = thread->nextBlocked; - - next->prevBlocked = thread->prevBlocked; - thread->prevBlocked->nextBlocked = next; - } else { - next = 0; - } - - thread->nextBlocked = 0; - thread->prevBlocked = 0; - - /* - * Use current interruptable IO mechanism to - * implement non-blocking closable IO. - */ - sysThreadInterrupt(thread); - - thread = next; - } - - file->list = 0; - - ret = close(fd); - - mutexUnlock(&file->lock); - } else { - /* It is not a valid fd. */ - errno = EBADF; - ret = SYS_ERR; - } - - return ret; -} - -/* - * Called before entering blocking IO. Enqueue the current - * thread to the fd blocking list. Need fd lock. - */ -static void BeginIO(sys_thread_t* self, file_t* file) { - mutexLock(&file->lock); - - if (!file->list) { - file->list = self->nextBlocked = self->prevBlocked = self; - } else { - sys_thread_t* head = file->list; - - self->prevBlocked = head->prevBlocked; - self->nextBlocked = head; - head->prevBlocked->nextBlocked = self; - head->prevBlocked = self; - } - mutexUnlock(&file->lock); -} - -/* - * Called after finishing blocking IO. Dequeue the current - * thread from the blocking list. Note: It may be waken up - * by thread interrupt or fd close operation. - */ -static ssize_t EndIO(sys_thread_t* self, file_t* file, ssize_t ret) { - mutexLock(&file->lock); - - /* - * Dequeue the current thread. It is classic double - * linked list operation. - */ -#ifdef __linux__ - if (!sysThreadIsInterrupted(self, 1) && self->prevBlocked) { -#else - if (self->prevBlocked) { -#endif - if (self->nextBlocked != self) { - self->prevBlocked->nextBlocked = self->nextBlocked; - self->nextBlocked->prevBlocked = self->prevBlocked; - file->list = self->nextBlocked; - } else { - file->list = 0; - } - self->nextBlocked = 0; - self->prevBlocked = 0; - } else { -#ifdef __linux__ - if (self->nextBlocked && self->prevBlocked) { - if (self->nextBlocked != self) { - self->prevBlocked->nextBlocked = self->nextBlocked; - self->nextBlocked->prevBlocked = self->prevBlocked; - file->list = self->nextBlocked; - } else { - file->list = 0; - } - } - self->nextBlocked = 0; - self->prevBlocked = 0; -#endif - /* file got closed during blocking call */ - errno = EBADF; - ret = SYS_ERR; - } - - mutexUnlock(&file->lock); - - return ret; -} - -/* - * The following is a big macro used to implement the closable IO. - * Note: It is also used by interruptable IO. If later we need to - * deprecate interruptable IO, all we need to change the return - * value and errno to EBADF instead of EINTR. The high level - * routine will interpret it as IOException instead of - * InterruptedIOException. No other change is needed. - * The underlying mechanism is using the SIGUSR1 signal to wake up the - * blocking thread. This may cause severe conflicts with any other - * libraries that also use SIGUSR1. - */ -#ifdef __linux__ -#define INTERRUPT_IO(cmd) \ -{\ - ssize_t ret = 0;\ - file_t* file;\ - sys_thread_t* self = sysThreadSelf();\ -\ - if (fd < 0 || fd >= fd_limit) {\ - errno = EBADF;\ - return SYS_ERR;\ - }\ -\ - file = &fd_table[fd];\ - BeginIO(self, file);\ -\ - {\ - jmp_buf jmpbuf;\ -\ - /*\ - * Register our intrHandler as a cleanup handler. If we get\ - * interrupted (i.e. canceled), we longjmp out of this handler.\ - */\ - pthread_cleanup_push(intrHandler, NULL);\ - if (setjmp(jmpbuf) == 0) {\ - thr_setspecific(intrJmpbufkey, &jmpbuf);\ - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\ - ret = cmd;\ - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);\ - thr_setspecific(intrJmpbufkey, NULL);\ - } else {\ - /* [jk] should/can we call sysThreadIsInterrupted(self, 1) here */ - - self->interrupted = FALSE;\ - errno = EINTR;\ - ret = SYS_INTRPT;\ - }\ - /* Remove intrHandler without calling it. */\ - pthread_cleanup_pop(0);\ - }\ -\ - return EndIO(self, file, ret);\ -} -#else -#define INTERRUPT_IO(cmd) \ -{\ - int ret = 0;\ - file_t* file;\ - sys_thread_t* self = sysThreadSelf();\ -\ - if (fd < 0 || fd >= fd_limit) {\ - errno = EBADF;\ - return SYS_ERR;\ - }\ -\ - file = &fd_table[fd];\ - BeginIO(self, file);\ -\ - {\ - sigjmp_buf jmpbuf;\ - sigset_t omask;\ -\ - thr_setspecific(sigusr1Jmpbufkey, &jmpbuf);\ - if (sigsetjmp(jmpbuf, 1) == 0) {\ - thr_sigsetmask(SIG_UNBLOCK, &sigusr1Mask, &omask);\ - ret = cmd;\ - thr_sigsetmask(SIG_SETMASK, &omask, NULL);\ - } else {\ - sysThreadIsInterrupted(self, TRUE);\ - errno = EINTR;\ - ret = SYS_INTRPT;\ - }\ - }\ -\ - return EndIO(self, file, ret);\ -} -#endif - -#else /* CLOSEIO */ - -#define INTERRUPT_IO(cmd) \ - return cmd; - -int sysClose(int fd) { - return close(fd); -} - -int InitializeIO(rlim_t limit) -{ - return SYS_OK; -} -#endif /* CLOSEIO */ - -/* - * sys API for I/O - */ - -size_t -sysRead(int fd, void *buf, unsigned int nBytes) { - INTERRUPT_IO(read(fd, buf, nBytes)) -} - -size_t -sysWrite(int fd, const void *buf, unsigned int nBytes) { - INTERRUPT_IO(write(fd, buf, nBytes)) -} - -int -sysSocket(int domain, int type, int protocol) { - return socket(domain, type, protocol); -} - -ssize_t -sysRecv(int fd, char *buf, int nBytes, int flags) { - INTERRUPT_IO(recv(fd, buf, nBytes, flags)) -} - -ssize_t -sysSend(int fd, char *buf, int nBytes, int flags) { - INTERRUPT_IO(send(fd, buf, nBytes, flags)) -} -/* -int -sysClose(int fd) { - INTERRUPT_IO(close(fd)) -} -*/ -jlong -sysSeek(int fd, jlong offset, int whence) { - return lseek64_w(fd, offset, whence); -} - -int -sysSetLength(int fd, jlong length) { - return ftruncate64_w(fd, length); -} - -int -sysSync(int fd) { - /* - * XXX: Is fsync() interruptible by the interrupt method? - * Is so, add the TSD, sigsetjmp()/longjmp() code here. - * - * This probably shouldn't be throwing an error and should - * be a macro. - */ - int ret; - if ((ret = fsync(fd)) == -1) { - } - return ret; -} - -int -sysAvailable(int fd, jlong *pbytes) { - jlong cur, end; - int mode; - - if (sysFfileMode(fd, &mode) >= 0) { - if (S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) { - /* - * XXX: is the following call interruptible? If so, this might - * need to go through the INTERRUPT_IO() wrapper as for other - * blocking, interruptible calls in this file. - */ - int n; - if (ioctl(fd, FIONREAD, &n) >= 0) { - *pbytes = n; - return 1; - } - } - } - if ((cur = lseek64_w(fd, 0L, SEEK_CUR)) == -1) { - return 0; - } else if ((end = lseek64_w(fd, 0L, SEEK_END)) == -1) { - return 0; - } else if (lseek64_w(fd, cur, SEEK_SET) == -1) { - return 0; - } - *pbytes = end - cur; - return 1; -} - -/* IO routines that take in a FD object */ - -int -sysTimeout(int fd, long timeout) { -#ifndef USE_SELECT - struct pollfd pfd; - -#ifdef __linux__ - jlong end_time = sysTimeMillis() + (jlong) timeout; - volatile jlong to = (jlong) timeout; -#endif - - pfd.fd = fd; - pfd.events = POLLIN; - -#ifdef __linux__ - INTERRUPT_IO(__extension__ ({ - int __result; - do { - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); - __result = poll(&pfd, 1, ((int)to)); - pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL); - } while (__result == -1 && errno == EINTR && - (to = end_time - sysTimeMillis()) > 0 && - ((pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) == 0)); - if (pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) { - __result = -1; - errno = EBADF; - } - (__result == -1 && errno == EINTR) ? 0 : __result; - })) -#else - INTERRUPT_IO(poll(&pfd, 1, (int)timeout)) -#endif -#else - fd_set tbl; - struct timeval t; - - t.tv_sec = timeout / 1000; - t.tv_usec = (timeout % 1000) * 1000; - - FD_ZERO(&tbl); - FD_SET(fd, &tbl); - -#ifdef __linux__ - INTERRUPT_IO(TEMP_FAILURE_RETRY(select(fd + 1, &tbl, 0, 0, &t))) -#else - INTERRUPT_IO(select(fd + 1, &tbl, 0, 0, &t)) -#endif -#endif -} - - -/* - * sys API for networking - */ - -long -sysSocketAvailable(int fd, jint *pbytes) { - long ret = 1; - /* - * An ILP64 port of this code should pass the address of a local int - * to the ioctl and then convert that to jint with any error handling - * required for overflows, if overflow is possible. - */ - - /* - * XXX: is the following call interruptible? If so, this might - * need to go through the INTERRUPT_IO() wrapper as for other - * blocking, interruptible calls in this file. - */ - if (fd < 0 || ioctl(fd, FIONREAD, pbytes) < 0) { - ret = 0; - } - return ret; -} - -int -sysListen(int fd, int count) { - return listen(fd, count); -} - -int -sysConnect(int fd, struct sockaddr *addr, int size) { - INTERRUPT_IO(connect(fd, addr, size)) -} - -int -sysBind(int fd, struct sockaddr *addr, int size) { - INTERRUPT_IO(bind(fd, addr, size)) -} - -int -sysAccept(int fd, struct sockaddr *him, int *len) { - INTERRUPT_IO(accept(fd, him, (uint *)len)) -} - -int -sysGetSockName(int fd, struct sockaddr *him, int *len) { - return getsockname(fd, him, (uint *)len); -} - -int -sysSocketClose(int fd) { - return sysClose(fd); -} - -int -sysSocketShutdown(int fd, int howto) { - return shutdown(fd, howto); -} - -int -sysGetSockOpt(int fd, int level, int optname, char *optval, int *optlen) { - return getsockopt(fd, level, optname, optval, optlen); -} - -int -sysSetSockOpt(int fd, int level, int optname, const char *optval, int optlen) { - return setsockopt(fd, level, optname, optval, optlen); -} - -int -sysGetHostName(char *hostname, int namelen) { - return gethostname(hostname, namelen); -} - -struct hostent * -sysGetHostByAddr(const char *hostname, int len, int type) { - return gethostbyaddr(hostname, len, type); -} - -struct hostent * -sysGetHostByName(char *hostname) { - return gethostbyname(hostname); -} - -struct protoent * -sysGetProtoByName(char* name) { - return getprotobyname(name); -} - -/* - * Routines to do datagrams - */ -ssize_t -sysSendTo(int fd, char *buf, int len, - int flags, struct sockaddr *to, int tolen) { - INTERRUPT_IO(sendto(fd, buf, len, flags, to, tolen)) -} - -ssize_t -sysRecvFrom(int fd, char *buf, int nBytes, - int flags, struct sockaddr *from, int *fromlen) { - INTERRUPT_IO(recvfrom(fd, buf, nBytes, flags, from, (uint *)fromlen)) -} diff --git a/jdk/src/solaris/hpi/native_threads/src/threads_linux.c b/jdk/src/solaris/hpi/native_threads/src/threads_linux.c deleted file mode 100644 index dddc2cc8b52..00000000000 --- a/jdk/src/solaris/hpi/native_threads/src/threads_linux.c +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Implementation of notposix.h on Linux. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "hpi_impl.h" -#include "monitor_md.h" -#include "threads_md.h" -#include "np.h" - -#undef LOG_THREADS - -/* Global lock used when calling np_suspend and np_resume */ -static pthread_mutex_t sr_lock; - -/* Semaphore used to acknowledge when the handler has received HANDLER_SIG */ -static sem_t sr_sem; - -/* The tid of the thread being suspended/resumed */ -static sys_thread_t *sr_tid; - -int sr_sigsusp; -int sr_sigresu; - -static void prtsigset(char *s, sigset_t *set) -{ - int sig; - dprintf(2, "%s:", s); - for (sig = 1; sig < _NSIG; sig++) { - if (sigismember(set, sig)) { - dprintf(2, " %d", sig); - } - } - dprintf(2, "\n"); -} - -/* - * Handler function invoked when a thread's execution is suspended - * We have to be careful that only async-safe functions are - * called here. I'm not even sure if calling sysThreadSelf is safe so - * we temporarily stash SP in a global variable instead. - */ -static void -#ifdef SA_SIGINFO -susp_handler(int sig, siginfo_t* info, void* arg) -#else -susp_handler(int sig) -#endif -{ - sys_thread_t *tid = sr_tid; - sigset_t set; - /* Save the current SP */ - tid->sp = &tid; - sem_post(&sr_sem); - sigfillset(&set); - sigdelset(&set,(sr_sigresu)); - /* block until we receive resume signal. */ - sigsuspend(&set); -} - -static void -#ifdef SA_SIGINFO -resu_handler(int sig, siginfo_t* info, void* arg) -#else -resu_handler(int sig) -#endif -{ - return; -} - -/* - * Initialize signal handlers for suspend and resume}. - */ -int -np_initialize() -{ - struct sigaction act; - char *s; - int err; - - /* Signal numbers used to suspend and resume */ -#if __GLIBC__ == 2 && __GLIBC_MINOR__ == 0 -#ifdef SIGUNUSED - sr_sigsusp = SIGUNUSED; -#else - sr_sigsusp = SIGLOST; -#endif -#ifdef SIGPWR - sr_sigresu = SIGPWR; -#else - sr_sigresu = SIGXFSZ; -#endif -#else - /* use real time signals */ - /* currently __SIGRTMIN, +1, +2 are all used by LinuxThreads */ - sr_sigsusp = SIGRTMIN + 3; - sr_sigresu = SIGRTMIN + 4; -#endif - - /* Set up signal handler for suspend and resume */ -#if defined(SA_SIGINFO) && !defined(__sparc__) - act.sa_handler = 0; - act.sa_sigaction = susp_handler; -#else - act.sa_handler = (__sighandler_t) susp_handler; -#endif -#ifdef SA_SIGINFO - act.sa_flags = SA_RESTART | SA_SIGINFO; -#else - act.sa_flags = SA_RESTART; -#endif - sigfillset(&act.sa_mask); - if (sigaction(sr_sigsusp, &act, 0) == -1) { - return -1; - } -#if defined(SA_SIGINFO) && !defined(__sparc__) - act.sa_handler = 0; - act.sa_sigaction = resu_handler; -#else - act.sa_handler = (__sighandler_t) resu_handler; -#endif -#ifdef SA_SIGINFO - act.sa_flags = SA_SIGINFO; -#else - act.sa_flags = 0; -#endif - sigfillset(&act.sa_mask); - if (sigaction(sr_sigresu, &act, 0) == -1) { - return -1; - } - - /* Initialize semaphore used by np_{suspend/resume} */ - if (sem_init(&sr_sem, 0, 0) == -1) { - return SYS_ERR; - } - - /* Initialize mutex used by np_{suspend/resume} */ - err = mutexInit(&sr_lock); - sysAssert(err == 0); - - return SYS_OK; -} - -int -np_initial_suspend(sys_thread_t* tid) -{ - int count; - - tid->selfsuspended = (tid == sysThreadSelf()); - sysAssert(tid->selfsuspended); - - count = tid->suspend_count++; - sysAssert(count == 0); - -#ifdef LOG_THREADS - dprintf(2, - "[Initial self-suspend [tid = %ld, sys_thread = %ld]\n", - pthread_self(), tid->sys_thread); -#endif - - /* Order should not matter but doing the post first should be faster */ - sem_post(&tid->sem_suspended); - do { - sem_wait(&tid->sem_selfsuspend); - } while (tid->selfsuspended); /* paranoid */ - return 0; -} - - -int -np_suspend(sys_thread_t *tid) -{ - int count, ret = 0; - - int err = mutexLock(&sr_lock); - sysAssert(err == 0); - - tid->selfsuspended = (tid == sysThreadSelf()); - - count = tid->suspend_count++; -#ifdef LOG_THREADS - dprintf(2, "[Suspending fromtid = %ld, tid = %ld, pid = %d, count = %d]\n", - pthread_self(), tid->sys_thread, tid->lwp_id, count); -#endif - if (count == 0) { - if (tid->selfsuspended) { -#ifdef LOG_THREADS - dprintf(2, - "[Self-suspending [tid = %ld, sys_thread = %ld]\n", - pthread_self(), tid->sys_thread); -#endif - mutexUnlock(&sr_lock); - do { - sem_wait(&tid->sem_selfsuspend); - } while (tid->selfsuspended); - /* [jk] What is the correct return value here? - There was no error, but when we return the thread - has already been resumed. */ - return SYS_OK; - - } else { - sr_tid = tid; - ret = pthread_kill(tid->sys_thread, sr_sigsusp); - if (ret == 0) { - sem_wait(&sr_sem); - } -#ifdef LOG_THREADS - dprintf(2, - "[Suspended fromtid = %ld, pthread_kill(%ld, %d) = %d]\n", - pthread_self(), tid->sys_thread, sr_sigsusp, ret); -#endif - } - } - - err = mutexUnlock(&sr_lock); - sysAssert(err == 0); - - return ret == 0 ? SYS_OK : SYS_ERR; -} - -int -np_continue(sys_thread_t *tid) -{ - int count, ret = 0; - - int err = mutexLock(&sr_lock); - sysAssert(err == 0); - - count = --tid->suspend_count; -#ifdef LOG_THREADS - dprintf(2, "[Resuming fromtid = %ld, tid = %ld, pid = %d, count = %d]\n", - pthread_self(), tid->sys_thread, tid->lwp_id, count); -#endif - if (count == 0) { - if (tid->selfsuspended) { - tid->selfsuspended = 0; - sem_post(&tid->sem_selfsuspend); - } else { - sr_tid = tid; - ret = pthread_kill(tid->sys_thread, sr_sigresu); - } -#ifdef LOG_THREADS - dprintf(2, "[Resumed fromtid = %ld, pthread_kill(%ld, %d) = %d]\n", - pthread_self(), tid->sys_thread, sr_sigresu, ret); -#endif - } else if (count < 0) { - /* Ignore attempts to resume a thread that has not been suspended */ - tid->suspend_count = 0; - } - - err = mutexUnlock(&sr_lock); - sysAssert(err == 0); - - return ret == 0 ? SYS_OK : SYS_ERR; -} - -/* - * Get the stack base and size. - */ -int -np_stackinfo(void **addr, long *size) -{ - /* For now assume stack is 2 meg, from internals.h. */ -#define STACK_SIZE (2 * 1024 * 1024) - void *p; - char *sp = (char *)&p; /* rougly %esp */ - - *addr = (void *)(((unsigned long)sp | (STACK_SIZE-1))+1) - 1; - *size = STACK_SIZE; - - return SYS_OK; -} - -typedef unsigned long ulong_t; -#define VALID_SP(sp, bottom, top) \ - (((ulong_t)(sp)) < ((ulong_t)(bottom)) && ((ulong_t)(sp)) > ((ulong_t)(top))) - -/* - * Go into single threaded mode for GC. - */ -int -np_single() -{ - sys_thread_t *tid; - pthread_t me = pthread_self(); - int i; - -#ifdef LOG_THREADS - dprintf(2, "[Entering np_single: thread count = %d]\n", ActiveThreadCount); -#endif - /* Stop all other threads. */ - tid = ThreadQueue; - for (i = 0; i < ActiveThreadCount && tid != 0; i++) { - if ((tid->sys_thread != me) && (tid->state != SUSPENDED)) { - np_suspend(tid); - sysAssert(VALID_SP(tid->sp, tid->stack_bottom, tid->stack_top)); - tid->onproc = FALSE; /* REMIND: Might not need this */ - } - tid = tid->next; - } -#ifdef LOG_THREADS - dprintf(2, "[Leaving np_single]\n"); -#endif - return SYS_OK; -} - -/* - * Per thread initialization. - */ -void -np_initialize_thread(sys_thread_t *tid) -{ - sigset_t set; - - /* Block SIGQUIT so that it can be handled by the SIGQUIT handler thread */ - sigemptyset(&set); - sigaddset(&set, SIGQUIT); - pthread_sigmask(SIG_BLOCK, &set, 0); - /* Set process id */ - tid->lwp_id = getpid(); - tid->suspend_count = 0; - - /* Semaphore used for self-suspension */ - sem_init(&tid->sem_selfsuspend, 0, 0); - tid->selfsuspended = 0; - -#ifdef LOG_THREADS - dprintf(2, "[Init thread, tid = %ld, pid = %d, base = %p, size = %lu]\n", - pthread_self(), tid->lwp_id, tid->stack_bottom, tid->stack_size); -#endif -} - -void -np_free_thread(sys_thread_t *tid) -{ - sem_destroy(&tid->sem_selfsuspend); -} - -/* - * Recover from single threaded mode after GC. - */ -void -np_multi() -{ - int i; - sys_thread_t *tid; - pthread_t me = pthread_self(); - - tid = ThreadQueue; - for (i = 0; i < ActiveThreadCount && tid != 0; i++) { - if ((tid->sys_thread != me) && (tid->state != SUSPENDED)) { - np_continue(tid); - } - tid = tid->next; - } -} - -void -np_profiler_init(sys_thread_t *tid) -{ -} - -int -np_profiler_suspend(sys_thread_t *tid) -{ - return np_suspend(tid); -} - -int -np_profiler_continue(sys_thread_t *tid) -{ - return np_continue(tid); -} - -bool_t -np_profiler_thread_is_running(sys_thread_t *tid) -{ - return TRUE; -} diff --git a/jdk/src/solaris/hpi/native_threads/src/threads_md.c b/jdk/src/solaris/hpi/native_threads/src/threads_md.c deleted file mode 100644 index f3aab1aad14..00000000000 --- a/jdk/src/solaris/hpi/native_threads/src/threads_md.c +++ /dev/null @@ -1,1133 +0,0 @@ -/* - * Copyright (c) 1994, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Implementation of Java threads HPI on top of native Solaris threads - * - * [Sheng 1/18/97] Do not include any JVM-specific header file (such - * as interpreter.h) here! This file implements the thread-related - * APIs sys_api.h. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "hpi_impl.h" - -#include "threads_md.h" -#include "monitor_md.h" - -#include "np.h" - -extern int InitializeIO(rlim_t limit); - -#if defined(__solaris__) && !defined(SA_SIGINFO) -#error That can NOT possibly be right. -#endif - -#ifdef SA_SIGINFO -static void sigusr1Handler(int sig, siginfo_t *info, void *uc); -#else -static void sigusr1Handler(int sig); -#endif /* SA_SIGINFO */ - -static void removeFromActiveQ(sys_thread_t *p); -static void clear_onproc_flags(void); - -sys_thread_t *ThreadQueue; -int ActiveThreadCount = 0; /* All threads */ -sys_mon_t *_sys_queue_lock; - -/* This is explained in linker_md.c. */ -#ifdef __GLIBC__ -#define NEED_DL_LOCK -#endif /* __GLIBC__ */ - -#ifdef NEED_DL_LOCK -extern sys_mon_t _dl_lock; -#endif /* NEED_DL_LOCK */ - -/* - * threads_initialized simplifies the check that has to be done in - * sysThreadCheckStack(). Otherwise, before sysThreadInit() is called - * on the primordial thread, we need to handle there being no current - * thread at all, and there being one with a 0 stack_base. - */ -static int threads_initialized = 0; - -/* The tid_key is a global key to *native* thread-specific data. That is, - * each native thread has a back pointer to the Java TID associated with it. - */ -static thread_key_t tid_key = (thread_key_t) -1; - -/* - * The sigusr1Jmpbufkey is used to get at the jmp buffer to longjmp to in a - * SIGUSR1 handler - used to implement stop(). The jmp buffer - * should have been allocated off the thread's stack. - */ -#ifdef __linux__ -thread_key_t intrJmpbufkey; -static sigset_t squm = {{sigmask(SIGUSR1), 0, 0, 0}}; -#else -thread_key_t sigusr1Jmpbufkey; -sigset_t sigusr1Mask = {{sigmask(SIGUSR1), 0, 0, 0}}; -#endif - -/* - * Thread C stack overflow check - * - * sysThreadCheckStack() being a function call is unfortunate, as it - * takes stack space to do, but that is weakly accounted for by the - * previous stack redzone. In general, where we can't predict stack - * use by C, thread stack overflow checking doesn't really work. - */ - -#define STACK_REDZONE 4096 - -#ifdef __linux__ -int jdk_waitpid(pid_t pid, int* status, int options); -int fork1(void); -int jdk_sem_init(sem_t*, int, unsigned int); -int jdk_sem_post(sem_t*); -int jdk_sem_wait(sem_t*); -int jdk_pthread_sigmask(int, const sigset_t*, sigset_t*); -pid_t waitpid(pid_t, int*, int); - -int jdk_waitpid(pid_t pid, int* status, int options) { - return waitpid(pid, status, options); -} - -int fork1() { - return fork(); -} - -int -jdk_sem_init(sem_t *sem, int pshared, unsigned int value) { - return sem_init(sem, pshared, value); -} - -int -jdk_sem_post(sem_t *sem) { - return sem_post(sem); -} - -int -jdk_sem_wait(sem_t *sem) { - return sem_wait(sem); -} - -int -jdk_pthread_sigmask(int how , const sigset_t* newmask, sigset_t* oldmask) { - return pthread_sigmask(how , newmask, oldmask); -} - -#endif - -/* REMIND: port _CurrentThread changes to make process - of getting the tid more efficient */ - -int -sysThreadCheckStack() -{ - sys_thread_t *tid = sysThreadSelf(); - - /* Stacks grow toward lower addresses on Solaris... */ - if (!threads_initialized || - (char *)(tid)->stack_bottom - (char *)&(tid) + STACK_REDZONE < - tid->stack_size) { - return 1; - } else { - return 0; - } -} - -#ifndef __linux__ -static sigset_t squm = {{sigmask(SIGUSR1), 0, 0, 0}}; -#endif - - -/* - * Allocate and initialize the sys_thread_t structure for an arbitary - * native thread. - */ -int -sysThreadAlloc(sys_thread_t **tidP) -{ - int err; - sys_thread_t *tid = allocThreadBlock(); - if (tid == NULL) { - return SYS_NOMEM; - } -#ifdef __linux__ - memset((char *)tid, 0, sizeof(sys_thread_t)); -#endif - - if (profiler_on) { - np_profiler_init(tid); - } - - if (np_stackinfo(&tid->stack_bottom, &tid->stack_size) == SYS_ERR) { - return SYS_ERR; - } -#ifdef __linux__ - tid->stack_top = tid->stack_bottom - tid->stack_size; -#else - tid->stack_top = (void *)((char *)(tid->stack_bottom) - tid->stack_size); -#endif - - tid->primordial_thread = 0; -#ifdef __linux__ - tid->interrupted = tid->pending_interrupt = FALSE; -#else - tid->interrupted = FALSE; -#endif - tid->onproc = FALSE; - tid->sys_thread = thr_self(); -#ifdef __linux__ - /* - * Disable cancellation. The default cancel type is - * PTHREAD_CANCEL_DEFERRED, so if we set the cancel state to - * PTHREAD_CANCEL_ENABLE again, we'll get deferred cancellation. - */ - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); -#endif - np_initialize_thread(tid); - - /* - * For the Invocation API: - * We update the thread-specific storage before locking the - * queue because sysMonitorEnter will access sysThreadSelf. - */ - err = thr_setspecific(tid_key, tid); - /* sys_thread_t * back pointer from native */ -#ifdef __linux__ - thr_setspecific(intrJmpbufkey, NULL); /* paranoid */ -#endif - assert (err == 0); - - if (threads_initialized) - SYS_QUEUE_LOCK(sysThreadSelf()); - ActiveThreadCount++; /* Count the thread */ - tid->next = ThreadQueue; /* Chain all threads */ - ThreadQueue = tid; - if (threads_initialized) - SYS_QUEUE_UNLOCK(sysThreadSelf()); - else - threads_initialized = TRUE; - - /* - * Ensure that SIGUSR1 is masked for interruptable IO - * Signal mask inheritance ensures all child threads are masked too. - */ -#ifndef __linux__ - thr_sigsetmask(SIG_BLOCK, &squm, NULL); -#endif - - setFPMode(); - - *tidP = tid; - return SYS_OK; -} - -/* - * threadBootstrapMD() bootstraps the UNIX process running from main() - * into a first primordial thread. This thread is distinguishable because - * it uniquely has the primordial_thread flag on in its private data. - * However, so that we have to special-case it as little as possible, we - * set it up to look as closely as possible to a thread that we created. - * One difference is that its stack is *not* known to us. - */ -int -threadBootstrapMD(sys_thread_t **tidP, sys_mon_t **lockP, int nb) -{ - /* We are running out of file descriptors in fonts. As a temporary - * fix, bump up the number of open file descriptors to OPEN_MAX. - */ - struct rlimit nbr_files; - - getrlimit(RLIMIT_NOFILE, &nbr_files); - nbr_files.rlim_cur = nbr_files.rlim_max; - setrlimit(RLIMIT_NOFILE, &nbr_files); - - /* - * Use the above setting for initialize (closable) IO package. - */ - if (InitializeIO(nbr_files.rlim_cur) != SYS_OK) { - return SYS_ERR; - } - - /* Create a thread-private key for a pointer back to the sys_thread_t *. - * Note that we don't need to worry about the destructor, as that's taken - * care of elsewhere. - */ - thr_keycreate(&tid_key, NULL); - -#ifdef __linux__ - thr_keycreate(&intrJmpbufkey, NULL); -#else - thr_keycreate(&sigusr1Jmpbufkey, NULL); -#endif - -#ifndef NO_INTERRUPTIBLE_IO - { - /* initialize SIGUSR1 handler for interruptable IO */ - struct sigaction sigAct; - -#ifdef SA_SIGINFO - sigAct.sa_handler = NULL; - sigAct.sa_sigaction = sigusr1Handler; -#else - sigAct.sa_handler = sigusr1Handler; -#endif /* SA_SIGINFO */ - memset((char *)&(sigAct.sa_mask), 0, sizeof (sigset_t)); - /* we do not want the restart flag for SIGUSR1 */ - sigAct.sa_flags = 0; - sigaction(SIGUSR1, &sigAct, (struct sigaction *)0); - } -#endif /* NO_INTERRUPTIBLE_IO */ - - nReservedBytes = (nb + 7) & (~7); - if (sysThreadAlloc(tidP) < 0) { - return SYS_NOMEM; - } - - /* profiler_on may have not been setup yet. */ - np_profiler_init(*tidP); - -#ifdef NEED_DL_LOCK - VM_CALL(monitorRegister)(&_dl_lock, "Dynamic loading lock"); -#endif /* NEED_DL_LOCK */ - - /* Initialize the queue lock monitor */ - _sys_queue_lock = (sys_mon_t *)sysMalloc(sysMonitorSizeof()); - if (_sys_queue_lock == NULL) { - return SYS_ERR; - } - VM_CALL(monitorRegister)(_sys_queue_lock, "Thread queue lock"); - *lockP = _sys_queue_lock; - - (*tidP)->primordial_thread = 1; - - if (np_initialize() == SYS_ERR) { - return SYS_ERR; - } - - return SYS_OK; -} - -/* - * Access to the thread stack pointer of an arbitrary thread (for GC). - * This information should be legitimately available in Solaris 2.5. - */ -void * -sysThreadStackPointer(sys_thread_t * tid) -{ - char *thread_info; - - if (tid == sysThreadSelf()) { - /* - * doing this assigment gets around a warning about returning - * the address of a local variable - */ - void *aStackAddress = &thread_info; - return aStackAddress; - } else { - return (void *) tid->sp; - } -} - -/* - * Get the end of stack (if you step beyond (above or below depending - * on your architecture) you can die. We refer to the logical top of - * stack. - * - * NOTE! There are restrictions about when you can call this method. If - * you did a sysThreadAlloc, then you can call this method as soon as - * sysThreadAlloc returns. If you called sysThreadCreate(start_function), - * then you must call sysThreadStackTop only inside start_function and not - * as soon as sysThreadCreate returns. - */ -void * -sysThreadStackTop(sys_thread_t *tid) -{ - return tid->stack_top; -} - -long * -sysThreadRegs(sys_thread_t * tid, int *nregs) -{ - *nregs = N_TRACED_REGS; - return tid->regs; -} - -static void * -_start(void *tid_) -{ - sys_thread_t *tid = (sys_thread_t *)tid_; - - np_initialize_thread(tid); - -#ifdef __linux__ - /* - * Disable cancellation. The default cancel type is - * PTHREAD_CANCEL_DEFERRED, so if we set the cancel state to - * PTHREAD_CANCEL_ENABLE again, we'll get deferred cancellation. - */ - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); - - tid->sp = 0; - thr_setspecific(tid_key, tid); - thr_setspecific(intrJmpbufkey, NULL); /* paranoid */ - np_stackinfo(&tid->stack_bottom, &tid->stack_size); - tid->stack_top = (void *)((char *)(tid->stack_bottom) - tid->stack_size); - - /* Wait for resume signal */ - np_initial_suspend(tid); -#else -#ifdef USE_PTHREADS -#ifndef USE_MUTEX_HANDSHAKE - /* Wait for semaphore to be posted once thread has been suspended */ - sem_wait(&tid->sem); - sem_destroy(&tid->sem); -#else - /* I'm a new thread, and I must co-operate so I can be suspended. */ - pthread_mutex_lock(&tid->ntcond.m); - tid->ntcond.state = NEW_THREAD_REQUESTED_SUSPEND; - pthread_cond_signal(&tid->ntcond.c); - while (tid->ntcond.state != NEW_THREAD_SUSPENDED) - pthread_cond_wait(&tid->ntcond.c, &tid->ntcond.m); - pthread_mutex_unlock(&tid->ntcond.m); -#endif /* USE_MUTEX_HANDSHAKE */ -#endif /* USE_PTHREADS */ -#endif /* !linux */ - if (profiler_on) { - np_profiler_init(tid); - } - -#ifndef __linux__ - tid->sp = 0; - thr_setspecific(tid_key, tid); -#endif - - tid->state = RUNNABLE; - -#ifndef __linux__ - np_stackinfo(&tid->stack_bottom, &tid->stack_size); - tid->stack_top = (void *)((char *)(tid->stack_bottom) - tid->stack_size); -#endif - - setFPMode(); - tid->start_proc(tid->start_parm); -#ifdef __linux__ - /* Paranoid: We don't want to be canceled now, it would have - unpredictable consequences */ - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); -#endif - - sysThreadFree(); - thr_exit(0); - /* NOT REACHED */ - return 0; -} - -int -sysThreadCreate(sys_thread_t **tidP, long ss, void (*start)(void *), void *arg) -{ - size_t stack_size = ss; - int err; - sys_thread_t *tid = allocThreadBlock(); -#ifdef USE_PTHREADS - pthread_attr_t attr; -#endif - - if (tid == NULL) { - return SYS_NOMEM; - } - *tidP = tid; - -#ifdef __linux__ - memset((char *)tid, 0, sizeof(sys_thread_t)); -#endif - /* Install the backpointer to the Thread object */ - -#ifdef __linux__ - tid->interrupted = tid->pending_interrupt = FALSE; -#else - tid->interrupted = FALSE; -#endif - tid->onproc = FALSE; - -#ifndef __linux__ - SYS_QUEUE_LOCK(sysThreadSelf()); - ActiveThreadCount++; /* Global thread count */ - tid->next = ThreadQueue; /* Chain all threads */ - ThreadQueue = tid; - SYS_QUEUE_UNLOCK(sysThreadSelf()); -#endif - - tid->start_proc = start; - tid->start_parm = arg; -#ifdef __linux__ - tid->state = SUSPENDED; -#endif - -#ifdef __linux__ - tid->primordial_thread = 0; - - /* Semaphore used to block thread until np_suspend() is called */ - err = sem_init(&tid->sem_suspended, 0, 0); - sysAssert(err == 0); - /* Thread attributes */ - pthread_attr_init(&attr); -#ifdef _POSIX_THREAD_ATTR_STACKSIZE - pthread_attr_setstacksize(&attr, stack_size); -#endif - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - if (profiler_on) { - pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); - } - /* Create the thread. The thread will block waiting to be suspended */ - err = pthread_create(&tid->sys_thread, &attr, _start, (void *)tid); - sysAssert(err == 0); - if (err == 0) { - err = sem_wait(&tid->sem_suspended); - if (err == 0) { - sem_destroy(&tid->sem_suspended); - } - } - sysAssert(err == 0); - - SYS_QUEUE_LOCK(sysThreadSelf()); - ActiveThreadCount++; /* Global thread count */ - tid->next = ThreadQueue; /* Chain all threads */ - ThreadQueue = tid; - SYS_QUEUE_UNLOCK(sysThreadSelf()); -#else -#ifdef USE_PTHREADS - -#ifndef USE_MUTEX_HANDSHAKE - /* Semaphore used to block thread until np_suspend() is called */ - err = sem_init(&tid->sem, 0, 0); - sysAssert(err == 0); - /* Thread attributes */ -#else - /* Setup condition required to suspend the newly created thread. */ - pthread_mutex_init(&tid->ntcond.m, NULL); - pthread_cond_init(&tid->ntcond.c, NULL); - tid->ntcond.state = NEW_THREAD_MUST_REQUEST_SUSPEND; - pthread_mutex_lock(&tid->ntcond.m); -#endif /* USE_MUTEX_HANDSHAKE */ - - /* Create the new thread. */ - pthread_attr_init(&attr); -#ifdef _POSIX_THREAD_ATTR_STACKSIZE - pthread_attr_setstacksize(&attr, stack_size); -#endif - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - if (profiler_on) - pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); - err = pthread_create(&tid->sys_thread, &attr, _start, (void *)tid); - -#ifndef USE_MUTEX_HANDSHAKE - if (err == 0) { - /* Suspend the thread */ - err = np_suspend(tid); - if (err == SYS_OK) { - /* Unblock the thread now that it has been suspended */ - err = sem_post(&tid->sem); - sysAssert(err == 0); - } - } -#else - /* Wait for the newly created thread to block. */ - while (tid->ntcond.state != NEW_THREAD_REQUESTED_SUSPEND) - pthread_cond_wait(&tid->ntcond.c, &tid->ntcond.m); - - /* So it blocked. Now suspend it and _then_ get it out of the block. */ - np_suspend(tid->sys_thread); - tid->ntcond.state = NEW_THREAD_SUSPENDED; - pthread_cond_signal(&tid->ntcond.c); - pthread_mutex_unlock(&tid->ntcond.m); -#endif /* USE_MUTEX_HANDSHAKE */ - -#else - /* Create the thread */ - err = thr_create(NULL, stack_size, _start, (void *)tid, - THR_SUSPENDED|THR_DETACHED| - (profiler_on ? THR_BOUND : 0), - &tid->sys_thread); -#endif /* USE_PTHREADS */ -#endif /* !linux */ - - tid->state = SUSPENDED; - sysAssert(err != EINVAL); /* Invalid argument: shouldn't happen */ - if (err == EAGAIN) { - err = SYS_NORESOURCE; /* Will be treated as though SYS_NOMEM */ - } else if (err == ENOMEM) { - err = SYS_NOMEM; - } else { - err = SYS_OK; - } - - return err; -} - -/* - * Free a system thread block. - * Remove from the thread queue. - */ -int -sysThreadFree() -{ - sys_thread_t *tid = sysThreadSelf(); - /* - * remove ourselves from the thread queue. This must be done after - * the notify above since monitor operations aren't really safe if - * your thread isn't on the thread queue. (This isn't true of - * the sysMonitor* functions, only monitor*) - */ - SYS_QUEUE_LOCK(tid); - removeFromActiveQ(tid); - SYS_QUEUE_UNLOCK(tid); - - /* For invocation API: later sysThreadSelf() calls will return 0 */ - thr_setspecific(tid_key, 0); - -#ifdef __linux__ - np_free_thread(tid); -#endif - - freeThreadBlock(tid); - return SYS_OK; -} - -/* - * Current thread yield control - * - * Green threads originally supported forcing another thread to yield... - */ -void -sysThreadYield() -{ -#ifndef __linux__ - thr_yield(); -#endif -} - -#ifdef USE_PTHREADS -/* - * For POSIX threads, we don't want to use real-time policies SCHED_FIFO or - * SCHED_RR. That leaves SCHED_OTHER which is implementation defined. We - * assume Solaris-pthreads like behavior for SCHED_OTHER, and if it doesn't - * work on your platform, then maybe you want to do turn off thread - * priorities by setting -DMOOT_PRIORITIES. - */ -#ifndef MOOT_PRIORITIES -#define USE_SCHED_OTHER -#endif /* MOOT_PRIORITIES */ -#endif /* USE_PTHREADS */ - -/* - * Get the scheduling priority of a specified thread - */ -int -sysThreadGetPriority(sys_thread_t * tid, int *pri) -{ -#ifdef USE_PTHREADS -#ifdef USE_SCHED_OTHER - struct sched_param param; - int policy = SCHED_OTHER; - param.sched_priority = *pri; - return pthread_getschedparam(tid->sys_thread, &policy, ¶m); -#else - return 0; -#endif /* USE_SCHED_OTHER */ -#else - return thr_getprio(tid->sys_thread, pri); -#endif /* USE_PTHREADS */ -} - - -/* - * Set the scheduling priority of a specified thread - */ -int -sysThreadSetPriority(sys_thread_t * tid, int pri) -{ - int err; -#ifdef USE_PTHREADS -#ifdef USE_SCHED_OTHER - struct sched_param param; - param.sched_priority = pri; - err = pthread_setschedparam(tid->sys_thread, SCHED_OTHER, ¶m); -#else - err = 0; -#endif /* USE_SCHED_OTHER */ -#else - err = thr_setprio(tid->sys_thread, pri); -#endif /* USE_PTHREADS */ - sysAssert(err != ESRCH); /* No such thread: shouldn't happen */ - sysAssert(err != EINVAL); /* Invalid arguments: shouldn't happen */ - return SYS_OK; -} - -/* - * Suspend execution of the specified thread - */ -int -sysThreadSuspend(sys_thread_t * tid) -{ - int err1 = 0; - int err2 = 0; - sys_thread_t *self = sysThreadSelf(); - - if (tid == self) { - self->state = SUSPENDED; - } else { -#ifndef __linux__ - mutexLock(&tid->mutex); -#endif - switch(tid->state) { - case RUNNABLE: - tid->state = SUSPENDED; - break; - case CONDVAR_WAIT: - tid->state = SUSPENDED; - tid->cpending_suspend = 1; - break; - case SUSPENDED: - default: - err1 = -1; /* Thread in inconsistent state */ - break; - } -#ifndef __linux__ - mutexUnlock(&tid->mutex); -#endif - } - if (err1 == 0) { - err2 = np_suspend(tid); - } - - return ((err1 == 0 && err2 == 0) ? SYS_OK : SYS_ERR); -} - -/* - * Resume execution of the specified thread - */ -int -sysThreadResume(sys_thread_t * tid) -{ - int err1 = 0; - int err2 = 0; - -#ifndef __linux__ - mutexLock(&tid->mutex); -#endif - if (tid->cpending_suspend) { - tid->cpending_suspend = 0; - tid->state = CONDVAR_WAIT; - } else { - switch(tid->state) { - case SUSPENDED: - tid->state = RUNNABLE; - break; - case RUNNABLE: - case CONDVAR_WAIT: - default: - err1 = -1; /* Thread in inconsistent state */ - break; - } - } -#ifndef __linux__ - mutexUnlock(&tid->mutex); -#endif - if (err1 == 0) { - err2 = np_continue(tid); - } - - return ((err1 == 0 && err2 == 0) ? SYS_OK : SYS_ERR); -} - -/* - * Return the sys_thread_t * of the calling thread - */ -sys_thread_t * -sysThreadSelf() -{ -#ifdef USE_PTHREADS - return pthread_getspecific(tid_key); -#else - sys_thread_t * tid=NULL; - int err = thr_getspecific(tid_key, (void *) &tid); - - if (err == 0) { - return tid; - } - - sysAssert(tid_key == -1 || err != 0); - - return NULL; -#endif -} - -/* - * Enumerate over all threads, calling a function for each one. A - * paranoid helper function would be prepared to deal with threads - * that have not been created by Java. - */ - -int -sysThreadEnumerateOver(int (*func)(sys_thread_t *, void *), void *arg) -{ - sys_thread_t *tid; - int err = SYS_OK; - int i; - - sysAssert(SYS_QUEUE_LOCKED(sysThreadSelf())); - - tid = ThreadQueue; - for (i = 0; i < ActiveThreadCount && tid != 0; i++) { - if ((err = (*func)(tid, arg)) != SYS_OK) { - break; - } - tid = tid->next; - } - - return err; -} - -void * -sysThreadNativeID(sys_thread_t *tid) -{ - return (void *) tid->sys_thread; -} - -/* - * Remove this thread from the list of Active threads. - */ -static void -removeFromActiveQ(sys_thread_t * t) -{ - sys_thread_t *prev; - sys_thread_t *tid; - - sysAssert(SYS_QUEUE_LOCKED(sysThreadSelf())); - - ActiveThreadCount--; - - prev = 0; - tid = ThreadQueue; - while (tid) { - if (tid == t) { - if (prev) { - prev->next = tid->next; - } else { - ThreadQueue = tid->next; - } - tid->next = 0; - break; - } - prev = tid; - tid = tid->next; - } -} - -/* - * The mechanics of actually signalling an exception (in the future, - * and Alarm or Interrupt) depend upon what thread implementation you - * are using. - */ -void -sysThreadPostException(sys_thread_t *tid, void *exc) -{ - /* Thread.stop is deprecated */ - /* No longer wake up the thread if it is sleeping */ - /* thr_kill(tid->sys_thread, SIGUSR1); */ -} - -/* - * Support for (Java-level) interrupts. - */ -void -sysThreadInterrupt(sys_thread_t *tid) -{ -#ifdef __linux__ - tid->pending_interrupt = TRUE; - pthread_cancel(tid->sys_thread); -#else - mutexLock(&tid->mutex); - tid->interrupted = TRUE; - mutexUnlock(&tid->mutex); - thr_kill(tid->sys_thread, SIGUSR1); -#endif -} - -/* This doesn't need to aquire any locks */ -int -sysThreadIsInterrupted(sys_thread_t *tid, int ClearInterrupted) -{ - bool_t interrupted; - -#ifndef __linux__ - mutexLock(&tid->mutex); -#endif -#ifdef __linux__ - interrupted = tid->pending_interrupt || tid->interrupted; - - if (ClearInterrupted == 1 && tid->pending_interrupt) { - sys_thread_t* self = sysThreadSelf(); - - if (self == tid && pthread_getspecific(intrJmpbufkey) == NULL) { - jmp_buf jmpbuf; - - /* - * Register our intrHandler as a cleanup handler. If we get - * interrupted (i.e. canceled), we longjmp out of this handler. - */ - pthread_cleanup_push(intrHandler, NULL); - if (setjmp(jmpbuf) == 0) { - thr_setspecific(intrJmpbufkey, &jmpbuf); - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); - while (1) { pthread_testcancel(); } - } - /* Remove intrHandler without calling it. */ - pthread_cleanup_pop(0); - } - } - - if (ClearInterrupted == 1 && interrupted) { - /* we have do to this last, otherwise we really would cancel the - thread */ - tid->interrupted = FALSE; - } -#else - interrupted = tid->interrupted; - if (ClearInterrupted == 1) { - tid->interrupted = FALSE; - mutexUnlock(&tid->mutex); - if (interrupted) { - sigset_t osigset; - /* - * we were interrupted so we may have a signal pending that - * we need to clear. We can just temporarily unmask SIGUSR1 - * and the sigusr1Handler to catch and notice that the - * interrupted flag is not set. - */ - - thr_setspecific(sigusr1Jmpbufkey, NULL); /* paranoid */ - thr_sigsetmask(SIG_UNBLOCK, &sigusr1Mask, &osigset); - thr_sigsetmask(SIG_SETMASK, &osigset, NULL); - } - } else { /* Otherwise leave it alone */ - mutexUnlock(&tid->mutex); - } -#endif - return interrupted; -} - - - -/* - * Stop all threads other than the current one. The stopped threads - * may be restarted with sysThreadMulti(); the operation of this - * routine is atomic; it either stops all java threads or it stops - * none of them. Upon success (all threads stopped) this routine - * returns SYS_OK, otherwise SYS_ERR. - * - * In general, sysThreadSingle() should take care of anything below - * the HPI that needs to be done to safely run single-threaded. - */ -int -sysThreadSingle() -{ - return np_single(); -} - -/* - * Allow multi threaded execution to resume after a - * sysThreadSingle() call. - * - * Note: When this routine is called the scheduler should already - * have been locked by sysThreadSingle(). - */ -void -sysThreadMulti() -{ - np_multi(); -} - -#ifdef __linux__ -/* - * We abuse thread cancellation to interrupt the threads, i.e when an - * exception is posted against the thread, pthread_cancel(3) is sent to the - * thread and the canceled thread executes the following cleanup handler - */ -void -intrHandler(void* arg) -{ - jmp_buf* jmpbufp = pthread_getspecific(intrJmpbufkey); - if (jmpbufp != NULL) { - volatile sys_thread_t* self = sysThreadSelf(); - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); - pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL); - self->interrupted = TRUE; - self->pending_interrupt = FALSE; - thr_setspecific(intrJmpbufkey, NULL); - longjmp(*jmpbufp, 1); - } else { -#ifdef PARANOID_DEBUG - sysAssert(0); -#endif - } -} - -#else -/* - * SIGUSR1 is used to interrupt the threads, i.e when an exception - * is posted against the thread, SIGUSR1 is sent to the thread and the - * thread gets the signal, executes the following handler - */ - -static void -#ifdef SA_SIGINFO -sigusr1Handler(int sig, siginfo_t *info, void *uc) -#else -sigusr1Handler(int sig) -#endif -{ - sys_thread_t *tid = sysThreadSelf(); - - if (tid->interrupted) { - sigjmp_buf *jmpbufp; -#ifdef USE_PTHREADS - jmpbufp = pthread_getspecific(sigusr1Jmpbufkey); -#else - thr_getspecific(sigusr1Jmpbufkey, (void **)&jmpbufp); -#endif - if (jmpbufp != NULL) - siglongjmp(*jmpbufp, 1); - } -} -#endif - -HPI_SysInfo * -sysGetSysInfo() -{ - static HPI_SysInfo info = {0, 0}; - - if (info.name == NULL) { - /* - * we want the number of processors configured not the number online - * since processors may be turned on and off dynamically. - */ - int cpus = (int) sysconf(_SC_NPROCESSORS_CONF); - - info.isMP = (cpus < 0) ? 1 : (cpus > 1); - info.name = "native threads"; - } - return &info; -} - - -jlong -sysThreadCPUTime() -{ -#ifdef HAVE_GETHRVTIME - return gethrvtime(); -#else - return 0; -#endif -} - -int -sysThreadGetStatus(sys_thread_t *tid, sys_mon_t **monitorPtr) -{ - int status; - switch (tid->state) { - case RUNNABLE: - if (tid->mon_enter) { - status = SYS_THREAD_MONITOR_WAIT; - } else { - status = SYS_THREAD_RUNNABLE; - } - break; - case SUSPENDED: - if (tid->mon_enter) - status = SYS_THREAD_SUSPENDED | SYS_THREAD_MONITOR_WAIT; - else if (tid->cpending_suspend) - status = SYS_THREAD_SUSPENDED | SYS_THREAD_CONDVAR_WAIT; - else - status = SYS_THREAD_SUSPENDED; - break; - case CONDVAR_WAIT: - status = SYS_THREAD_CONDVAR_WAIT; - break; - default: - return SYS_ERR; - } - if (monitorPtr) { - if (status & SYS_THREAD_MONITOR_WAIT) { - *monitorPtr = tid->mon_enter; - } else if (status & SYS_THREAD_CONDVAR_WAIT) { - *monitorPtr = tid->mon_wait; - } else { - *monitorPtr = NULL; - } - } - return status; -} - -int sysAdjustTimeSlice(int new) -{ - return SYS_ERR; -} - -void sysThreadProfSuspend(sys_thread_t *tid) -{ - np_profiler_suspend(tid); -} - -void sysThreadProfResume(sys_thread_t *tid) -{ - np_profiler_continue(tid); -} - -bool_t sysThreadIsRunning(sys_thread_t *tid) -{ - return np_profiler_thread_is_running(tid); -} - -void * -sysThreadInterruptEvent() -{ - return NULL; -} diff --git a/jdk/src/solaris/hpi/native_threads/src/threads_solaris.c b/jdk/src/solaris/hpi/native_threads/src/threads_solaris.c deleted file mode 100644 index 33606d3b2bd..00000000000 --- a/jdk/src/solaris/hpi/native_threads/src/threads_solaris.c +++ /dev/null @@ -1,666 +0,0 @@ -/* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Implementation of HPI that can not be expressed with POSIX threads. - * Note that even if you are building with USE_PTHREADS, we have to - * explicitly undef it here because pthread.h and thread.h can not be - * included in the same file, and this file needs only thread.h. - */ -#undef USE_PTHREADS - -#include "hpi_impl.h" -#include "monitor_md.h" -#include "threads_md.h" -#include "np.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -extern int syscall(int, ...); - - -/* - * Forward declarations. - */ -static int procfd; -static void stop_lwps(); -static void clear_onproc_flags(); -static void restart_lwps(); -static void MakeProcName(register char *procname, register pid_t pid); -static void GC_msec_sleep(int n); - - -/* - * Make sure that we link against a verion of libthread that has at least - * the bug fixes and the interface for getting the stack from threads that - * aren't on LWPs. Otherwise we should exit with some informative message. - */ -extern ulong_t __gettsp(thread_t); - -static const char * gettspMessage = -"You must install a Solaris patch to run the native threads version of the\n" -"Java runtime. The green threads version will work without this patch.\n" -"Please check the native threads release notes for more information.\n" -"\n" -"If you are embedding the VM in a native application, please make sure that\n" -"the native application is linked with libthread.so (-lthread).\n" -"\n" -"Exiting.\n"; - -static void -checkForCorrectLibthread() -{ - if (&__gettsp == 0) { - fprintf(stderr, gettspMessage); - exit(1); - } -} -#ifdef __GNUC__ -static void checkForCorrectLibthread() __attribute__((constructor)); -#else -#pragma init(checkForCorrectLibthread) -#endif - -#pragma weak __gettsp - - -/* - * Suspend said thread. Used to implement java.lang.Thread.suspend(), - * which is deprecated. - */ -int -np_suspend(sys_thread_t *tid) -{ - return thr_suspend(tid->sys_thread); -} - - -/* - * Resume a suspended thread. Used to implement java.lang.Thread.resume(), - * which is deprecated. - */ -int -np_continue(sys_thread_t *tid) -{ - return thr_continue(tid->sys_thread); -} - -/* - * If there is any initialization is required by the non-POSIX parts. - */ -void np_initialize_thread(sys_thread_t *tid) -{ - return; -} - - -/* - * Get the stack start address, and max stack size for the current thread. - */ -int -np_stackinfo(void **addr, long *size) -{ - stack_t stkseg; - - if (thr_stksegment(&stkseg) == 0) { - *addr = (void *)(stkseg.ss_sp); - if (thr_main()) { - struct rlimit r; - getrlimit(RLIMIT_STACK, &r); - *size = (long)r.rlim_cur; - } else { - *size = (long)(stkseg.ss_size); - } - return SYS_OK; - } else { - return SYS_ERR; /* thr_stksegment failed. */ - } -} - -/* - * On Solaris when doing CPU profiling, the threads are bound. - */ -void -np_profiler_init(sys_thread_t *tid) -{ - tid->lwp_id = _lwp_self(); -} - -int -np_profiler_suspend(sys_thread_t *tid) -{ - return _lwp_suspend(tid->lwp_id); -} - -int -np_profiler_continue(sys_thread_t *tid) -{ - return _lwp_continue(tid->lwp_id); -} - -bool_t -np_profiler_thread_is_running(sys_thread_t *tid) -{ - unsigned long sum = 0; - int i; - prstatus_t lwpstatus; - int lwpfd; - int res; - - lwpfd = syscall(SYS_ioctl, procfd, PIOCOPENLWP, &(tid->lwp_id)); - sysAssert(lwpfd >= 0); - - retry: - res = syscall(SYS_ioctl, lwpfd, PIOCSTATUS, &lwpstatus); - sysAssert(res >= 0); - - if (!(lwpstatus.pr_flags & PR_STOPPED)) { - GC_msec_sleep(1); - goto retry; - } - - close(lwpfd); - -#if defined(sparc) - sum += lwpstatus.pr_reg[R_SP]; - sum += lwpstatus.pr_reg[R_PC]; - - sum += lwpstatus.pr_reg[R_G1]; - sum += lwpstatus.pr_reg[R_G2]; - sum += lwpstatus.pr_reg[R_G3]; - sum += lwpstatus.pr_reg[R_G4]; - - sum += lwpstatus.pr_reg[R_O0]; - sum += lwpstatus.pr_reg[R_O1]; - sum += lwpstatus.pr_reg[R_O2]; - sum += lwpstatus.pr_reg[R_O3]; - sum += lwpstatus.pr_reg[R_O4]; - sum += lwpstatus.pr_reg[R_O5]; - - sum += lwpstatus.pr_reg[R_I0]; - sum += lwpstatus.pr_reg[R_I1]; - sum += lwpstatus.pr_reg[R_I2]; - sum += lwpstatus.pr_reg[R_I3]; - sum += lwpstatus.pr_reg[R_I4]; - sum += lwpstatus.pr_reg[R_I5]; - sum += lwpstatus.pr_reg[R_I6]; - sum += lwpstatus.pr_reg[R_I7]; - - sum += lwpstatus.pr_reg[R_L0]; - sum += lwpstatus.pr_reg[R_L1]; - sum += lwpstatus.pr_reg[R_L2]; - sum += lwpstatus.pr_reg[R_L3]; - sum += lwpstatus.pr_reg[R_L4]; - sum += lwpstatus.pr_reg[R_L5]; - sum += lwpstatus.pr_reg[R_L6]; - sum += lwpstatus.pr_reg[R_L7]; -#elif defined(amd64) - sum += lwpstatus.pr_reg[REG_RIP]; - sum += lwpstatus.pr_reg[REG_RSP]; - - sum += lwpstatus.pr_reg[REG_RAX]; - sum += lwpstatus.pr_reg[REG_RCX]; - sum += lwpstatus.pr_reg[REG_RDX]; - sum += lwpstatus.pr_reg[REG_RBX]; - sum += lwpstatus.pr_reg[REG_RBP]; - sum += lwpstatus.pr_reg[REG_RSI]; - sum += lwpstatus.pr_reg[REG_RDI]; - - sum += lwpstatus.pr_reg[REG_R8]; - sum += lwpstatus.pr_reg[REG_R9]; - sum += lwpstatus.pr_reg[REG_R10]; - sum += lwpstatus.pr_reg[REG_R11]; - sum += lwpstatus.pr_reg[REG_R12]; - sum += lwpstatus.pr_reg[REG_R13]; - sum += lwpstatus.pr_reg[REG_R14]; - sum += lwpstatus.pr_reg[REG_R15]; -#elif defined(i386) - sum += lwpstatus.pr_reg[EIP]; - sum += lwpstatus.pr_reg[UESP]; - - sum += lwpstatus.pr_reg[EAX]; - sum += lwpstatus.pr_reg[ECX]; - sum += lwpstatus.pr_reg[EDX]; - sum += lwpstatus.pr_reg[EBX]; - sum += lwpstatus.pr_reg[EBP]; - sum += lwpstatus.pr_reg[ESI]; - sum += lwpstatus.pr_reg[EDI]; -#endif - - if (tid->last_sum == sum) { - return FALSE; - } - tid->last_sum = sum; - - return TRUE; -} - - -/* - * If building for Solaris native threads, open up the /proc file - * descriptor to be used when doing GC. The open is done at JVM start-up so - * as to reserve this fd, to prevent GC stall due to exhausted fds. This fd - * will never be closed, and will alwyas be present. - */ -int -np_initialize() -{ - char procname[32]; - MakeProcName(procname, getpid()); - if ((procfd = open(procname, O_RDONLY, 0)) < 0) { - VM_CALL(jio_fprintf)(stderr, "Cannot open %s for GC", procname); - return SYS_ERR; - } - return SYS_OK; -} - -static void -MakeProcName(register char *procname, register pid_t pid) -{ - register char * s; - - (void) strcpy(procname, "/proc/00000"); - s = procname + strlen(procname); - while (pid) { - *--s = pid%10 + '0'; - pid /= 10; - } -} - -/* - * Suspend all other threads, and record their contexts (register - * set or stack pointer) into the sys_thread structure, so that a - * garbage collect can be run. - */ -int -np_single(void) -{ - int ret; - - sysAssert(SYS_QUEUE_LOCKED(sysThreadSelf())); - - stop_lwps(); - ret = SYS_OK; - return ret; -} - -/* - * Continue threads suspended earlier. But clear their context - * recorded in sys_thread structure first. - */ -void -np_multi(void) -{ - sysAssert(SYS_QUEUE_LOCKED(sysThreadSelf())); - clear_onproc_flags(); - restart_lwps(); -} - -/* /proc solution to stop and restrt lwps */ -/* make sure gc is run as a bound thread */ -/* make sure signals are turned off for gc thread */ -/* what about new lwps getting created in the meantime? */ - -#define MAX_LWPS 1024 - -static prstatus_t Mystatus; -static id_t lwpid_list_buf[MAX_LWPS]; -static id_t oldlwpid_list_buf[MAX_LWPS]; -static sys_thread_t *onproct_list_buf[MAX_LWPS]; -static id_t *lwpid_list = lwpid_list_buf; -static id_t *oldlwpid_list = oldlwpid_list_buf; -static sys_thread_t **onproct_list = onproct_list_buf; -static int lwpid_list_len; -static int oldlwpid_list_len; -static int onproct_ix = 0; -static int gcprio; -static sigset_t gcmask; - -static void -clear_onproc_flags() -{ - int i; - - for (i = 0; i < onproct_ix; i++) { - ((sys_thread_t *)(onproct_list[i]))->onproc = FALSE; - } - onproct_ix = 0; -} - - -/* Sleep for n milliseconds, n < 1000 */ -static void -GC_msec_sleep(int n) -{ - struct timespec ts; - - ts.tv_sec = 0; - ts.tv_nsec = 1000000*n; - if (syscall(SYS_nanosleep, &ts, 0) < 0) { - VM_CALL(jio_fprintf)(stderr, "%d\n", errno); - } -} - -/* - * Assumes stacks grow down from high to low memory. True on sparc and Intel. - */ -#define VALID_SP(sp, bottom, top) \ - (((uintptr_t)(sp)) < ((uintptr_t)(bottom)) && ((uintptr_t)(sp)) > ((uintptr_t)(top))) - -static void -record_lwp_regs(prstatus_t lwpstatus) -{ - sys_thread_t *tid; - int i; -#if defined(sparc) - register uintptr_t sp = lwpstatus.pr_reg[R_SP]; -#elif defined(amd64) - register uintptr_t sp = lwpstatus.pr_reg[REG_RSP]; -#elif defined(i386) - register uintptr_t sp = lwpstatus.pr_reg[UESP]; -#endif - - tid = ThreadQueue; - for (i = 0; i < ActiveThreadCount && tid != 0; i++) { - if (VALID_SP(sp, tid->stack_bottom, tid->stack_top)) { - long *regs = tid->regs; - tid->sp = sp; - /* - * The code below relies on N_TRACED_REGS being set - * correctly for each platform. If you change the - * number of registers being watched, you should update - * the define for N_TRACED_REGS - */ -#if defined(sparc) - regs[0] = lwpstatus.pr_reg[R_G1]; - regs[1] = lwpstatus.pr_reg[R_G2]; - regs[2] = lwpstatus.pr_reg[R_G3]; - regs[3] = lwpstatus.pr_reg[R_G4]; - - regs[4] = lwpstatus.pr_reg[R_O0]; - regs[5] = lwpstatus.pr_reg[R_O1]; - regs[6] = lwpstatus.pr_reg[R_O2]; - regs[7] = lwpstatus.pr_reg[R_O3]; - regs[8] = lwpstatus.pr_reg[R_O4]; - regs[9] = lwpstatus.pr_reg[R_O5]; - regs[10] = lwpstatus.pr_reg[R_O6]; - regs[11] = lwpstatus.pr_reg[R_O7]; -#elif defined(amd64) - regs[0] = lwpstatus.pr_reg[REG_RAX]; - regs[1] = lwpstatus.pr_reg[REG_RCX]; - regs[2] = lwpstatus.pr_reg[REG_RDX]; - regs[3] = lwpstatus.pr_reg[REG_RBX]; - regs[4] = lwpstatus.pr_reg[REG_RBP]; - regs[5] = lwpstatus.pr_reg[REG_RSI]; - regs[6] = lwpstatus.pr_reg[REG_RDI]; - regs[7] = lwpstatus.pr_reg[REG_R8]; - regs[8] = lwpstatus.pr_reg[REG_R9]; - regs[9] = lwpstatus.pr_reg[REG_R10]; - regs[10]= lwpstatus.pr_reg[REG_R11]; - regs[11]= lwpstatus.pr_reg[REG_R12]; - regs[12]= lwpstatus.pr_reg[REG_R13]; - regs[13]= lwpstatus.pr_reg[REG_R14]; - regs[14]= lwpstatus.pr_reg[REG_R15]; -#elif defined(i386) - regs[0] = lwpstatus.pr_reg[EAX]; - regs[1] = lwpstatus.pr_reg[ECX]; - regs[2] = lwpstatus.pr_reg[EDX]; - regs[3] = lwpstatus.pr_reg[EBX]; - regs[4] = lwpstatus.pr_reg[EBP]; - regs[5] = lwpstatus.pr_reg[ESI]; - regs[6] = lwpstatus.pr_reg[EDI]; -#endif - - if (tid->onproc != TRUE) { - tid->onproc = TRUE; - onproct_list[onproct_ix++] = tid; - } - break; - } - tid = tid->next; - } -} - -static void -record_thread_regs() -{ - sys_thread_t *tid; - int i; - - tid = ThreadQueue; - for (i = 0; i < ActiveThreadCount && tid != 0; i++) { - if (tid->onproc != TRUE) { - int i; - - if (tid->sys_thread != 0) { - /* if thread has already been initialized */ - tid->sp = __gettsp(tid->sys_thread); - } else { - /* - * thread is still in the process of being initalized. - * So GC should not care about this thread. Just - * set its sp to 0, and this will force GC to ignore it. - */ - tid->sp = 0; - } - - /* - * Clear out the registers since they are no longer live - * and we don't want to garbage collector to think they are. - */ - - for (i = 0; i < N_TRACED_REGS; i++) - tid->regs[i] = 0; - } - tid = tid->next; - } -} - -static void -wait_stopped_lwps(void) -{ - int i, lwpfd; - prstatus_t lwpstatus; - - for (i = 0; i < (int) Mystatus.pr_nlwp; i++) { - /* if its not me */ - if (lwpid_list[i] != _lwp_self()) { - - /* open the lwp and check the status */ - if ((lwpfd = syscall(SYS_ioctl, procfd, PIOCOPENLWP, - &lwpid_list[i])) < 0) { -#ifdef MY_DEBUG - VM_CALL(jio_fprintf)(stderr, "lwpid %d was not found in process\n", - lwpid_list[i]); -#endif - continue; - } - memset(&lwpstatus, 0, sizeof(lwpstatus)); - while (1) { - if (syscall(SYS_ioctl,lwpfd, PIOCSTATUS, &lwpstatus)<0) { - sysAssert(0); -#ifdef MY_DEBUG - VM_CALL(jio_fprintf)(stderr, "PIOCSTATUS failed for lwp %d", - lwpid_list[i]); -#endif - break; - } - if (lwpstatus.pr_flags & PR_STOPPED) { - record_lwp_regs(lwpstatus); - break; - } - GC_msec_sleep(1); - } - - close (lwpfd); - } /* end of if-me */ - } /* end of for */ -} - -static void -suspend_lwps() -{ - int i; - /* pioopen all the lwps and stop them - except the one I am running on */ - for (i = 0; i < (int) Mystatus.pr_nlwp; i++) { - - /* open and stop the lwp if its not me */ - if (lwpid_list[i] != _lwp_self()) { - - /* PIOCSTOP doesn't work without a writable */ - /* descriptor. And that makes the process */ - /* undebuggable. */ - if (_lwp_suspend(lwpid_list[i]) < 0) { - /* Could happen if the lwp exited */ - lwpid_list[i] = _lwp_self(); - continue; - } - } - } -} - -static void -print_lwps() -{ -#ifdef MY_DEBUG - /* print all the lwps in the process */ - VM_CALL(jio_fprintf)(stdout, "lwpids "); - for (i = 0; i < (int) Mystatus.pr_nlwp; i++) { - if (i == 0) { - VM_CALL(jio_fprintf)(stdout, "%d", lwpid_list[0]); - } else if (i != Mystatus.pr_nlwp - 1) { - VM_CALL(jio_fprintf)(stdout, ", %d", lwpid_list[i]); - } else { - VM_CALL(jio_fprintf)(stdout, " and %d", lwpid_list[i]); - } - } -#endif -} - -/* routine to iteratively stop all lwps */ -static void -stop_lwps() -{ - int i; - sigset_t set; - boolean_t changed; - - /* mask all signals */ - (void) sigfillset(&set); - syscall(SYS_sigprocmask, SIG_SETMASK, &set, &gcmask); - - /* run at highest prio so I cannot be preempted */ - thr_getprio(thr_self(), &gcprio); - thr_setprio(thr_self(), 2147483647); /* #define INT_MAX 2147483647 */ - - oldlwpid_list_len = 0; - - while(1) { - changed = B_FALSE; - - /* Get the # of lwps in the process */ - memset(&Mystatus, 0, sizeof(Mystatus)); - syscall(SYS_ioctl, procfd, PIOCSTATUS, &Mystatus); - -#ifdef MY_DEBUG - VM_CALL(jio_fprintf)(stdout, "Number of lwps in the process is %d\n", - Mystatus.pr_nlwp); - VM_CALL(jio_fprintf)(stdout, "My lwp id is %d\n", _lwp_self()); -#endif - lwpid_list_len = Mystatus.pr_nlwp; - if (syscall(SYS_ioctl, procfd, PIOCLWPIDS, lwpid_list) == -1) { -#ifdef MY_DEBUG - VM_CALL(jio_fprintf)(stderr, "Can't read proc's lwpid list"); -#endif - return; - } - - print_lwps(); - - /* suspend all the lwps */ - suspend_lwps(); - - /* make sure all the lwps have actually stopped */ - wait_stopped_lwps(); - - /* make sure the list has not changed while you were not looking - else start all over again */ - if (lwpid_list_len != oldlwpid_list_len) changed = B_TRUE; - else { - for (i=0; i -#include -#include -#include - -#include "hpi_impl.h" - -#include "interrupt.h" - -/* handler_entry_t is used to keep track of the registered handlers. */ -typedef struct handler_entry { - intr_handler_t handler; - void *handlerArg; -} handler_entry_t; - -static handler_entry_t handlerList[N_INTERRUPTS]; - -/* Initialize the interrupt system */ -void -intrInit() -{ - memset(handlerList, 0, sizeof(handlerList)); - /* - * Target-dependent initialization. - */ - intrInitMD(); -} - -/* Add/Remove a handler for a particular interrupt */ - -signal_handler_t -intrRegister(int interrupt, intr_handler_t handler, void *handlerArg) -{ - struct sigaction sigAct, sigActOld; - - intrLock(); - - if (handler == (intr_handler_t)SYS_SIG_IGN || - handler == (intr_handler_t)SYS_SIG_DFL) { - /* If we get IGN or DFL, register that as the process signal handler, - * and clear the handlerList entry. - */ - sigAct.sa_handler = (void (*)(int))handler; - sigAct.sa_flags = 0; - sigaction(interrupt, &sigAct, &sigActOld); - handlerList[interrupt].handler = NULL; - } else { - /* Otherwise, we register intrDispatchMD as the common signal handler, - * and set the real handler in handlerList[interrupt].handler. - */ -#ifdef SA_SIGINFO - sigAct.sa_handler = 0; - sigAct.sa_sigaction = intrDispatchMD; - sigAct.sa_flags = SA_SIGINFO | SA_RESTART; -#else - sigAct.sa_handler = intrDispatchMD; - sigAct.sa_flags = SA_RESTART; -#endif - sigfillset(&sigAct.sa_mask); - sigaction(interrupt, &sigAct, &sigActOld); - handlerList[interrupt].handler = handler; - handlerList[interrupt].handlerArg = handlerArg; - } - - intrUnlock(); - - /* If SA_SIGINFO is set, sa_sigaction is valid, otherwise sa_handler is. */ -#ifdef SA_SIGINFO - return (sigActOld.sa_flags & SA_SIGINFO) ? - (signal_handler_t)sigActOld.sa_sigaction : - (signal_handler_t)sigActOld.sa_handler; -#else - return (signal_handler_t)sigActOld.sa_handler; -#endif -} - -/* - * intrDispatch -- Dispatch an interrupt. - * - * This routine is called from the low-level handlers - * at interrupt time. - */ -void -intrDispatch(int interrupt, void *siginfo, void *context) -{ - /* - * Assumptions: - * - Each interrupt only has one priority level associated with - * it. - * - Each handler will do enough work so that when it returns - * the source of the interrupt is masked. - */ - handler_entry_t *entry = &handlerList[interrupt]; - intr_handler_t handler = entry->handler; - - if (handler) { - (*handler)(interrupt, siginfo, context, entry->handlerArg); - return; - } - - /* No handler for this interrupt, log the error */ - Log1(0, "spurious interrupt %d\n", interrupt); - return; -} - -static void userSignalHandler(int sig, void *info, void *uc, void *arg) -{ - signal_handler_t handler = (signal_handler_t)arg; - /* for now we don't change the disposition of the signal in this case */ - /* sysSignal(sig, SYS_SIG_DFL); */ - handler(sig, info, uc); -} - -signal_handler_t sysSignal(int sig, signal_handler_t newHandler) -{ - handler_entry_t *entry = &handlerList[sig]; - void *oldHandlerArg = entry->handlerArg; - signal_handler_t oldHandler; - - if (intrInUse(sig)) { - return SYS_SIG_ERR; - } - -#ifdef __linux__ - oldHandler = intrRegister(sig, (intr_handler_t)userSignalHandler, (void *)newHandler); -#else - oldHandler = intrRegister(sig, userSignalHandler, (void *)newHandler); -#endif - /* If the old handler is intrDispatchMD, we get the real handler from - * entry->handlerArg. - */ - if (oldHandler == (signal_handler_t)intrDispatchMD) { - oldHandler = (signal_handler_t)oldHandlerArg; - } - - return oldHandler; -} - -void sysRaise(int sig) -{ - raise(sig); -} diff --git a/jdk/src/solaris/hpi/src/linker_md.c b/jdk/src/solaris/hpi/src/linker_md.c deleted file mode 100644 index 5f4e09692ea..00000000000 --- a/jdk/src/solaris/hpi/src/linker_md.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Machine Dependent implementation of the dynamic linking support - * for java. This routine is Solaris specific. - */ - -#include "hpi_impl.h" - -#include -#include -#include -#include -#include - -#include "path_md.h" -#include "monitor_md.h" - -#ifndef NATIVE -#include "iomgr.h" -#include "threads_md.h" -#endif - -/* - * This lock protects the dl wrappers, assuring that two threads aren't - * in libdl at the same time. - */ -sys_mon_t _dl_lock; - -/* - * Solaris green threads needs to lock around libdl.so. - */ -#if defined(__solaris__) && !defined(NATIVE) - #define NEED_DL_LOCK -#endif - -/* - * create a string for the JNI native function name by adding the - * appropriate decorations. - */ -int -sysBuildFunName(char *name, int nameLen, int args_size, int encodingIndex) -{ - /* On Solaris, there is only one encoding method. */ - if (encodingIndex == 0) - return 1; - return 0; -} - -/* - * create a string for the dynamic lib open call by adding the - * appropriate pre and extensions to a filename and the path - */ -void -sysBuildLibName(char *holder, int holderlen, char *pname, char *fname) -{ - const size_t pnamelen = pname ? strlen(pname) : 0; - - /* Quietly truncate on buffer overflow. Should be an error. */ - if (pnamelen + strlen(fname) + 10 > (size_t) holderlen) { - *holder = '\0'; - return; - } - - if (pnamelen == 0) { - sprintf(holder, "lib%s.so", fname); - } else { - sprintf(holder, "%s/lib%s.so", pname, fname); - } -} - - -#ifdef __linux__ - static int thr_main(void) - { - return -1; - } -#else - #ifndef NATIVE - extern int thr_main(void); - #endif -#endif - -void * -sysLoadLibrary(const char *name, char *err_buf, int err_buflen) -{ - void * result; - -#ifdef NEED_DL_LOCK - sysMonitorEnter(sysThreadSelf(), &_dl_lock); - result = dlopen(name, RTLD_NOW); - sysMonitorExit(sysThreadSelf(), &_dl_lock); -#else - result = dlopen(name, RTLD_LAZY); -#endif - /* - * This is a bit of bulletproofing to catch the commonly occurring - * problem of people loading a library which depends on libthread into - * the VM. thr_main() should always return -1 which means that libthread - * isn't loaded. - */ -#ifndef NATIVE - if (thr_main() != -1) { - VM_CALL(panic)("libthread loaded into green threads"); - } -#endif - if (result == NULL) { - strncpy(err_buf, dlerror(), err_buflen-2); - err_buf[err_buflen-1] = '\0'; - } - return result; -} - -void -sysUnloadLibrary(void *handle) -{ -#ifdef NEED_DL_LOCK - sysMonitorEnter(sysThreadSelf(), &_dl_lock); - dlclose(handle); - sysMonitorExit(sysThreadSelf(), &_dl_lock); -#else - dlclose(handle); -#endif -} - -void * -sysFindLibraryEntry(void *handle, const char *name) -{ - void *sym; -#ifdef NEED_DL_LOCK - sysMonitorEnter(sysThreadSelf(), &_dl_lock); - sym = dlsym(handle, name); - sysMonitorExit(sysThreadSelf(), &_dl_lock); -#else - sym = dlsym(handle, name); -#endif - return sym; -} diff --git a/jdk/src/solaris/hpi/src/memory_md.c b/jdk/src/solaris/hpi/src/memory_md.c deleted file mode 100644 index 7650f254f6b..00000000000 --- a/jdk/src/solaris/hpi/src/memory_md.c +++ /dev/null @@ -1,439 +0,0 @@ -/* - * Copyright (c) 1995, 2000, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Implementation of primitive memory allocation. - * - * The only thing machine dependent about this allocator is how it - * initially finds all of the possible memory, and how it implements - * mapChunk() and unmapChunk(). - * - * This is all pretty simple stuff. It is not likely to be banged on - * frequently enough to be a performance issue, unless the underlying - * primitives are. Implementing things: - * - * HPI function Solaris "malloc" Win32 - * -------------------------------------------------------------------- - * sysMapMem() mmap() malloc() VirtualAlloc(...MEM_RESERVE...) - * sysUnMapMem() munmap() free() VirtualFree(...MEM_RESERVE...) - * sysCommitMem() no-op no-op VirtualAlloc(...MEM_COMMIT...) - * sysDecommitMem() no-op no-op VirtualFree(...MEM_COMMIT...) - * - * Memory mapping is the default, but compiling with -DUSE_MALLOC gives - * a system based on malloc(). - */ - -#include -#include -#include -#include /* For perror() */ -#include -#include - -#include "hpi_impl.h" - -#ifndef USE_MALLOC - -#include -#include -#ifdef __linux__ -#ifndef MAP_ANONYMOUS -static int devZeroFD; -#endif -#else -static int devZeroFD; -#endif - -#endif /* !USE_MALLOC */ - -#ifdef __linux__ -#ifndef MAP_FAILED -#define MAP_FAILED ((caddr_t)-1) -#endif -static size_t memGrainSize; /* A page for Linux */ -#else -static unsigned int memGrainSize; /* A page for Solaris */ -#endif - -/* - * Mem size rounding is done at this level. The calling code asks - * these routines for literally what it thinks it wants. The size is - * rounded up to the first multiple of memGrainSize that contains - * requestedSize bytes. - */ - -static long -roundUpToGrain(long value) -{ - return (value + memGrainSize - 1) & ~(memGrainSize - 1); -} - -static long -roundDownToGrain(long value) -{ - return value & ~(memGrainSize - 1); -} - -void -InitializeMem(void) -{ - static int init = 0; - - if (init) { - return; /* Subsequent calls are no-ops */ - } - - /* - * Set system-specific variables used by mem allocator - */ - if (memGrainSize == 0) { - memGrainSize = (int) sysconf(_SC_PAGESIZE); - } - -#ifdef __linux__ -#if !defined(USE_MALLOC) && !defined(MAP_ANONYMOUS) - devZeroFD = open("/dev/zero", O_RDWR); - if (devZeroFD == -1) { - perror("devzero"); - exit(1); - } -#endif /* !USE_MALLOC MAP_ANONYMOUS*/ -#else -#ifndef USE_MALLOC - devZeroFD = open("/dev/zero", O_RDWR); - if (devZeroFD == -1) { - perror("devzero"); - exit(1); - } -#endif /* !USE_MALLOC */ -#endif - - init = 1; /* We're initialized now */ -} - - -#ifndef USE_MALLOC - -#define PROT_ALL (PROT_READ|PROT_WRITE|PROT_EXEC) - -#ifndef MAP_NORESERVE -#define MAP_NORESERVE 0 -#endif - -/* - * Map a chunk of memory. Return the address of the base if successful, - * 0 otherwise. We do not care where the mapped memory is, and can't - * even express a preference in the current HPI. If any platforms - * require us to manage addresses of mapped chunks explicitly, that - * must be done below the HPI. - */ -static char * -mapChunk(long length) -{ - char *ret; - -#if defined(__linux__) && defined(MAP_ANONYMOUS) - ret = (char *) mmap(0, length, PROT_ALL, - MAP_NORESERVE | MAP_PRIVATE | MAP_ANONYMOUS, - -1, (off_t) 0); -#else - ret = (char *) mmap(0, length, PROT_ALL, MAP_NORESERVE|MAP_PRIVATE, - devZeroFD, (off_t) 0); -#endif - return (ret == MAP_FAILED ? 0 : ret); -} - -/* - * Map a chunk of memory at a specific address and reserve swap space - * for it. This is currently only used to remap space previously mapped - * MAP_NORESERVE, reserving swap and getting native error handling. We - * assume that all alignment and rounding has been done by the caller. - * Return 1 if successful and 0 otherwise. - */ -static char * -mapChunkReserve(char *addr, long length) -{ - char *ret; -#if defined(__linux__) && defined(MAP_ANONYMOUS) - ret = (char *) mmap(addr, length, PROT_ALL, - MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, - -1, (off_t) 0); -#else - ret = (char *) mmap(addr, length, PROT_ALL, MAP_FIXED|MAP_PRIVATE, - devZeroFD, (off_t) 0); -#endif - return (ret == MAP_FAILED ? 0 : ret); -} - -/* - * Map a chunk of memory at a specific address and reserve swap space - * for it. This is currently only used to remap space previously mapped - * MAP_RESERVE, unreserving swap and getting native error handling. We - * assume that all alignment and rounding has been done by the caller. - * Return 1 if successful and 0 otherwise. - */ -static char * -mapChunkNoreserve(char *addr, long length) -{ - char *ret; - -#if defined(__linux__) && defined(MAP_ANONYMOUS) - ret = (char *) mmap(addr, length, PROT_ALL, - MAP_FIXED | MAP_PRIVATE | - MAP_NORESERVE | MAP_ANONYMOUS, - -1, (off_t) 0); -#else - ret = (char *) mmap(addr, length, PROT_ALL, - MAP_FIXED|MAP_PRIVATE|MAP_NORESERVE, - devZeroFD, (off_t) 0); -#endif - return (ret == MAP_FAILED ? 0 : ret); -} - -/* - * Unmap a chunk of memory. Return 1 if successful, 0 otherwise. We - * currently don't do any alignment or rounding, assuming that we only - * will unmap chunks that have previously been returned by mapChunk(). - */ -static int -unmapChunk(void *addr, long length) -{ - return (munmap(addr, length) == 0); -} - -#endif /* !USE_MALLOC */ - - -/* HPI Functions: */ - -/* - * Map a range of virtual memory. Note that the size asked for here - * is literally what the upper level has asked for. We need to do - * any rounding, etc. here. If mapping fails return 0, otherwise - * return the address of the base of the mapped memory. - */ -void * -sysMapMem(size_t requestedSize, size_t *mappedSize) -{ - void *mappedAddr; - - *mappedSize = roundUpToGrain(requestedSize); -#ifdef USE_MALLOC - mappedAddr = (void *) sysMalloc(*mappedSize); /* Returns 0 on failure */ -#ifdef __linux__ - if (mappedAddr) { - memset(mappedAddr, 0, *mappedSize); - mappedAddr = (void *) roundUpToGrain(mappedAddr); - } -#endif -#else - mappedAddr = mapChunk(*mappedSize); /* Returns 0 on failure */ -#endif /* USE_MALLOC */ - if (mappedAddr) { - Log3(2, "sysMapMem: 0x%x bytes at 0x%x (request: 0x%x bytes)\n", - *mappedSize, mappedAddr, requestedSize); - } else { - Log1(2, "sysMapMem failed: (request: 0x%x bytes)\n", requestedSize); - } - return mappedAddr; -} - -/* - * Unmap a range of virtual memory. Note that the size asked for here - * is literally what the upper level has asked for. We need to do any - * rounding, etc. here. If unmapping fails return 0, otherwise return - * the address of the base of the unmapped memory. - */ -void * -sysUnmapMem(void *requestedAddr, size_t requestedSize, size_t *unmappedSize) -{ - void *unmappedAddr; - int ret; - - *unmappedSize = roundUpToGrain(requestedSize); -#ifdef USE_MALLOC - sysFree(requestedAddr); - ret = 1; -#else - ret = unmapChunk(requestedAddr, *unmappedSize); -#endif /* USE_MALLOC */ - if (ret) { - unmappedAddr = requestedAddr; - Log4(2, - "sysUnmapMem: 0x%x bytes at 0x%x (request: 0x%x bytes at 0x%x)\n", - *unmappedSize, unmappedAddr, requestedSize, requestedAddr); - } else { - unmappedAddr = 0; - Log2(2, "sysUnmapMem failed: (request: 0x%x bytes at 0x%x)\n", - requestedSize, requestedAddr); - } - return unmappedAddr; -} - -/* - * Commit/decommit backing store to a range of virtual memory. This range - * needs not be identical to a mapped range, but must be a subset of one. - * On Solaris, we remap the range to reserve swap for the space on - * commit. We don't strictly need to do this, as Solaris will demand - * page pages that we've mapped when we want to access them. But by - * reserving swap we get reasonable error handling for free where we'd - * otherwise end up getting a SIGBUS on a random write when we run out - * of swap. It also emphasizes the general need for shared code to - * postpone committing to mapped memory for as long as is feasible. - * When Java really needs space (the thread stacks excepted), it will - * soon write over it (heap, markbits), so we don't really get much from - * demand paging. - * - * We do not validate that commitment requests cover already-mapped - * memory, although in principle we could. The size asked for here - * is what the upper level has asked for. We need to do any platform- - * dependent rounding here. - * - * When you commit, you commit to the entire page (or whatever quantum - * your O/S requires) containing the pointer, and return the beginning of - * that page. When you decommit, you decommit starting at the next page - * *up* from that containing the pointer, except that decommitting from - * a pointer to the beginning of the page operates on that page. - */ - -/* - * Return the address of the base of the newly committed memory, or 0 - * if committing failed. - */ -void * -sysCommitMem(void *requestedAddr, size_t requestedSize, size_t *committedSize) -{ - void *committedAddr; - char *ret; - - *committedSize = roundUpToGrain(requestedSize); - committedAddr = (void *) roundDownToGrain((long) requestedAddr); -#ifdef USE_MALLOC -#ifdef __linux__ - ret = committedAddr; -#else - ret = requestedAddr; -#endif -#else - ret = mapChunkReserve(committedAddr, *committedSize); -#endif - if (ret) { - committedAddr = ret; - Log4(2, - "sysCommitMem: 0x%x bytes at 0x%x (request: 0x%x bytes at 0x%x)\n", - *committedSize, committedAddr, requestedSize, requestedAddr); - } else { - committedAddr = 0; - Log2(2, "sysCommitMem failed: (request: 0x%x bytes at 0x%x)\n", - requestedSize, requestedAddr); - } - - return committedAddr; -} - -/* - * Return the address of the base of the newly decommitted memory, or 0 - * if decommitting failed. - */ -void * -sysDecommitMem(void *requestedAddr, size_t requestedSize, - size_t *decommittedSize) -{ - void *decommittedAddr; - char *ret; - - *decommittedSize = roundDownToGrain(requestedSize); - decommittedAddr = (void *) roundUpToGrain((long) requestedAddr); -#ifdef USE_MALLOC - ret = 0; -#else - ret = mapChunkNoreserve(decommittedAddr, *decommittedSize); -#endif - Log4(2, - "sysDecommitMem: 0x%x bytes at 0x%x (request: 0x%x bytes at 0x%x)\n", - *decommittedSize, decommittedAddr, requestedSize, requestedAddr); - - return ret; -} - -/* - * Allocate memory on an alignment boundary. Returns aligned - * pointer to new memory. Use sysFreeBlock to free the block. - * - * sysAllocBlock() is similar to memalign(), except that it also - * returns a pointer to the beginning of the block returned by the - * OS, which must be used to deallocate the block. (On some OSes, - * these two won't be the same.) sysAllocBlock() is also more - * limited than memalign in that it can only be used to allocate - * on particular alignments (PAGE_ALIGNMENT) and should be assumed - * to round the sizes of allocated blocks up to multiples of the - * alignment value (PAGE_ALIGNMENT*n bytes). - */ -void * -sysAllocBlock(size_t size, void** allocHead) -{ - void* alignedPtr = memalign(PAGE_ALIGNMENT, size); - *allocHead = alignedPtr; - return alignedPtr; -} - -/* - * Wrapper to free block allocated by sysMemAlign. - */ -void -sysFreeBlock(void *allocHead) -{ - free(allocHead); -} - -void * sysMalloc(size_t s) -{ - if (s == 0) - return malloc(1); - return malloc(s); -} - -void * sysRealloc(void *p, size_t s) -{ - return realloc(p, s); -} - -void sysFree(void *p) -{ - if (p != NULL) - free(p); -} - -void * sysCalloc(size_t s1, size_t s2) -{ - if (s1 == 0 || s2 == 0) - return calloc(1, 1); - return calloc(s1, s2); -} - -char * sysStrdup(const char * string) -{ - return strdup(string); -} diff --git a/jdk/src/solaris/hpi/src/system_md.c b/jdk/src/solaris/hpi/src/system_md.c deleted file mode 100644 index e4823021053..00000000000 --- a/jdk/src/solaris/hpi/src/system_md.c +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include "hpi_impl.h" - -#include -#include -#include -#include /* timeval */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "jni_md.h" -#include "mutex_md.h" - -#include "hpi_init.h" - -#include "interrupt.h" -#include "threads_md.h" -#include "monitor_md.h" -#include "largefile.h" - - -#define O_DELETE 0x10000 - -int sysThreadBootstrap(sys_thread_t **tidP, sys_mon_t **lockP, int nb) -{ - threadBootstrapMD(tidP, lockP, nb); - - intrInit(); - -#ifndef NATIVE - /* Initialize the special case for sbrk on Solaris (see synch.c) */ - InitializeSbrk(); - /* Initialize the async io */ - InitializeAsyncIO(); - InitializeMem(); - /* Initialize Clock and Idle threads */ - InitializeHelperThreads(); -#else /* if NATIVE */ - initializeContentionCountMutex(); - InitializeMem(); -#endif /* NATIVE */ - - return SYS_OK; -} - -int sysShutdown() -{ - return SYS_OK; -} - -long -sysGetMilliTicks() -{ - struct timeval tv; - - (void) gettimeofday(&tv, (void *) 0); - return((tv.tv_sec * 1000) + (tv.tv_usec / 1000)); -} - -jlong -sysTimeMillis() -{ - struct timeval t; - gettimeofday(&t, 0); - return ((jlong)t.tv_sec) * 1000 + (jlong)(t.tv_usec/1000); -} - -int -sysGetLastErrorString(char *buf, int len) -{ - if (errno == 0) { - return 0; - } else { - const char *s = strerror(errno); - int n = strlen(s); - if (n >= len) n = len - 1; - strncpy(buf, s, n); - buf[n] = '\0'; - return n; - } -} - -/* - * File system - * - * These are all the sys API which implement the straight POSIX - * API. Those that do not are defined by thread-specific files - * (i.e. io_md.c) - */ - -/* - * Open a file. Unlink the file immediately after open returns - * if the specified oflag has the O_DELETE flag set. - */ -int sysOpen(const char *path, int oflag, int mode) -{ - int fd; - int delete = (oflag & O_DELETE); - oflag = oflag & ~O_DELETE; - fd = open64_w(path, oflag, mode); - if (delete != 0) { - unlink(path); - } - return fd; -} - -char *sysNativePath(char *path) -{ - return path; -} - -int -sysFileSizeFD(int fd, jlong *size) -{ - struct stat64 buf64; - int ret = fstat64(fd, &buf64); - *size = buf64.st_size; - return ret; -} - -int -sysFfileMode(int fd, int *mode) -{ - struct stat64 buf64; - int ret = fstat64(fd, &buf64); - (*mode) = buf64.st_mode; - return ret; -} - -int -sysFileType(const char *path) -{ - int ret; - struct stat buf; - - if ((ret = stat(path, &buf)) == 0) { - mode_t mode = buf.st_mode & S_IFMT; - if (mode == S_IFREG) return SYS_FILETYPE_REGULAR; - if (mode == S_IFDIR) return SYS_FILETYPE_DIRECTORY; - return SYS_FILETYPE_OTHER; - } - return ret; -} - -/* - * Wrapper functions for low-level I/O routines - use the 64 bit - * version if available, else revert to the 32 bit versions. - */ - -off64_t -lseek64_w(int fd, off64_t offset, int whence) -{ - return lseek64(fd, offset, whence); -} - -int -ftruncate64_w(int fd, off64_t length) -{ - return ftruncate64(fd, length); -} - -int -open64_w(const char *path, int oflag, int mode) -{ - int fd = open64(path, oflag, mode); - if (fd == -1) return -1; - - /* If the open succeeded, the file might still be a directory */ - { - int st_mode; - if (sysFfileMode(fd, &st_mode) != -1) { - if ((st_mode & S_IFMT) == S_IFDIR) { - errno = EISDIR; - close(fd); - return -1; - } - } else { - close(fd); - return -1; - } - } - - /* - * 32-bit Solaris systems suffer from: - * - * - an historical default soft limit of 256 per-process file - * descriptors that is too low for many Java programs. - * - * - a design flaw where file descriptors created using stdio - * fopen must be less than 256, _even_ when the first limit above - * has been raised. This can cause calls to fopen (but not calls to - * open, for example) to fail mysteriously, perhaps in 3rd party - * native code (although the JDK itself uses fopen). One can hardly - * criticize them for using this most standard of all functions. - * - * We attempt to make everything work anyways by: - * - * - raising the soft limit on per-process file descriptors beyond - * 256 (done by hotspot) - * - * - As of Solaris 10u4, we can request that Solaris raise the 256 - * stdio fopen limit by calling function enable_extended_FILE_stdio, - * (also done by hotspot). We check for its availability. - * - * - If we are stuck on an old (pre 10u4) Solaris system, we can - * workaround the bug by remapping non-stdio file descriptors below - * 256 to ones beyond 256, which is done below. - * - * See: - * 1085341: 32-bit stdio routines should support file descriptors >255 - * 6533291: Work around 32-bit Solaris stdio limit of 256 open files - * 6431278: Netbeans crash on 32 bit Solaris: need to call - * enable_extended_FILE_stdio() in VM initialisation - * Giri Mandalika's blog - * http://technopark02.blogspot.com/2005_05_01_archive.html - */ -#if defined(__solaris__) && defined(_ILP32) - { - static int needToWorkAroundBug1085341 = -1; - if (needToWorkAroundBug1085341) { - if (needToWorkAroundBug1085341 == -1) - needToWorkAroundBug1085341 = - (dlsym(RTLD_DEFAULT, "enable_extended_FILE_stdio") == NULL); - if (needToWorkAroundBug1085341 && fd < 256) { - int newfd = fcntl(fd, F_DUPFD, 256); - if (newfd != -1) { - close(fd); - fd = newfd; - } - } - } - } -#endif /* 32-bit Solaris */ - - /* - * All file descriptors that are opened in the JVM and not - * specifically destined for a subprocess should have the - * close-on-exec flag set. If we don't set it, then careless 3rd - * party native code might fork and exec without closing all - * appropriate file descriptors (e.g. as we do in closeDescriptors in - * UNIXProcess.c), and this in turn might: - * - * - cause end-of-file to fail to be detected on some file - * descriptors, resulting in mysterious hangs, or - * - * - might cause an fopen in the subprocess to fail on a system - * suffering from bug 1085341. - * - * (Yes, the default setting of the close-on-exec flag is a Unix - * design flaw) - * - * See: - * 1085341: 32-bit stdio routines should support file descriptors >255 - * 4843136: (process) pipe file descriptor from Runtime.exec not being closed - * 6339493: (process) Runtime.exec does not close all file descriptors on Solaris 9 - */ -#ifdef FD_CLOEXEC - { - int flags = fcntl(fd, F_GETFD); - if (flags != -1) - fcntl(fd, F_SETFD, flags | FD_CLOEXEC); - } -#endif - return fd; -} - -void setFPMode(void) -{ -#if defined(__amd64) - asm(" pushq $0x1F80"); - /* ldmxcsr (%rsp) */ - asm(" .byte 0x0f,0xae,0x14,0x24"); - asm(" popq %rax"); -#elif defined(i386) - asm(" pushl $575"); - asm(" fldcw (%esp)"); - asm(" popl %eax"); -#endif -#if defined(__linux__) && defined(__mc68000__) - asm(" fmovel #0x80,%fpcr"); -#endif -} diff --git a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_CommonUtils.c b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_CommonUtils.c index 3128efe252e..73ec25671d1 100644 --- a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_CommonUtils.c +++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_CommonUtils.c @@ -137,41 +137,43 @@ void getALSAVersion(char* buffer, int len) { file = fopen(ALSA_VERSION_PROC_FILE, "r"); ALSAVersionString[0] = 0; if (file) { - fgets(ALSAVersionString, ALSAVersionString_LENGTH, file); - // parse for version number - totalLen = strlen(ALSAVersionString); - inVersionString = FALSE; - len = 0; - curr = 0; - while (curr < totalLen) { - if (!inVersionString) { - // is this char the beginning of a version string ? - if (ALSAVersionString[curr] >= '0' - && ALSAVersionString[curr] <= '9') { - inVersionString = TRUE; + if (NULL != fgets(ALSAVersionString, ALSAVersionString_LENGTH, file)) { + // parse for version number + totalLen = strlen(ALSAVersionString); + inVersionString = FALSE; + len = 0; + curr = 0; + while (curr < totalLen) { + if (!inVersionString) { + // is this char the beginning of a version string ? + if (ALSAVersionString[curr] >= '0' + && ALSAVersionString[curr] <= '9') { + inVersionString = TRUE; + } } + if (inVersionString) { + // the version string ends with white space + if (ALSAVersionString[curr] <= 32) { + break; + } + if (curr != len) { + // copy this char to the beginning of the string + ALSAVersionString[len] = ALSAVersionString[curr]; + } + len++; + } + curr++; } - if (inVersionString) { - // the version string ends with white space - if (ALSAVersionString[curr] <= 32) { - break; - } - if (curr != len) { - // copy this char to the beginning of the string - ALSAVersionString[len] = ALSAVersionString[curr]; - } - len++; + // remove trailing dots + while ((len > 0) && (ALSAVersionString[len - 1] == '.')) { + len--; } - curr++; + // null terminate + ALSAVersionString[len] = 0; } - // remove trailing dots - while ((len > 0) && (ALSAVersionString[len - 1] == '.')) { - len--; - } - // null terminate - ALSAVersionString[len] = 0; + fclose(file); + hasGottenALSAVersion = TRUE; } - hasGottenALSAVersion = TRUE; } strncpy(buffer, ALSAVersionString, len); } diff --git a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_MidiIn.c b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_MidiIn.c index a2277bdb6a0..db4a30ca330 100644 --- a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_MidiIn.c +++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_MidiIn.c @@ -32,6 +32,9 @@ #include #include "PlatformMidi.h" #include "PLATFORM_API_LinuxOS_ALSA_MidiUtils.h" +#if defined(i586) +#include +#endif /* * Helper methods @@ -73,9 +76,38 @@ char* MIDI_IN_GetErrorStr(INT32 err) { return (char*) getErrorStr(err); } - INT32 MIDI_IN_GetNumDevices() { +/* Workaround for 6842956: 32bit app on 64bit linux + * gets assertion failure trying to open midiIn ports. + * Untill the issue is fixed in ALSA + * (https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4807) + * report no midi in devices in the configuration. + */ +#if defined(i586) + static int jre32onlinux64 = -1; + if (jre32onlinux64 < 0) { + jre32onlinux64 = 0; + /* The workaround may be disabled setting "JAVASOUND_ENABLE_MIDIIN" + * environment variable. + */ + if (getenv("JAVASOUND_ENABLE_MIDIIN") == NULL) { + struct utsname u; + jre32onlinux64 = 0; + if (uname(&u) == 0) { + if (strstr(u.machine, "64") != NULL) { + TRACE0("jre32 on linux64 detected - report no midiIn devices\n"); + jre32onlinux64 = 1; + } + } + } + } + if (jre32onlinux64) { + return 0; + } +#endif + TRACE0("MIDI_IN_GetNumDevices()\n"); + return getMidiDeviceCount(SND_RAWMIDI_STREAM_INPUT); } diff --git a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.c b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.c index 74af23ef042..7d2ac119234 100644 --- a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.c +++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -372,7 +372,7 @@ INT32 openMidiDevice(snd_rawmidi_stream_t direction, INT32 deviceIndex, snd_rawmidi_t* native_handle; snd_midi_event_t* event_parser = NULL; int err; - UINT32 deviceID; + UINT32 deviceID = 0; char devicename[100]; #ifdef ALSA_MIDI_USE_PLUGHW int usePlugHw = 1; diff --git a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c index 58ca8abfcc2..fb2ba3c5da3 100644 --- a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c +++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -127,7 +127,7 @@ void DAUDIO_GetFormats(INT32 mixerIndex, INT32 deviceID, int isSource, void* cre int ret; int sampleSizeInBytes, significantBits, isSigned, isBigEndian, enc; int origSampleSizeInBytes, origSignificantBits; - int channels, minChannels, maxChannels; + unsigned int channels, minChannels, maxChannels; int rate, bitIndex; for (bitIndex = 0; bitIndex <= MAX_BIT_INDEX; bitIndex++) handledBits[bitIndex] = FALSE; @@ -152,7 +152,6 @@ void DAUDIO_GetFormats(INT32 mixerIndex, INT32 deviceID, int isSource, void* cre } } snd_pcm_hw_params_get_format_mask(hwParams, formatMask); -#ifdef ALSA_PCM_NEW_HW_PARAMS_API if (ret == 0) { ret = snd_pcm_hw_params_get_channels_min(hwParams, &minChannels); if (ret != 0) { @@ -165,13 +164,6 @@ void DAUDIO_GetFormats(INT32 mixerIndex, INT32 deviceID, int isSource, void* cre ERROR1("snd_pcm_hw_params_get_channels_max returned error %d\n", ret); } } -#else - minChannels = snd_pcm_hw_params_get_channels_min(hwParams); - maxChannels = snd_pcm_hw_params_get_channels_max(hwParams); - if (minChannels > maxChannels) { - ERROR2("MinChannels=%d, maxChannels=%d\n", minChannels, maxChannels); - } -#endif // since we queried the hw: device, for many soundcards, it will only // report the maximum number of channels (which is the only way to talk @@ -222,7 +214,7 @@ void DAUDIO_GetFormats(INT32 mixerIndex, INT32 deviceID, int isSource, void* cre } else { for (channels = minChannels; channels <= maxChannels; channels++) { DAUDIO_AddAudioFormat(creator, significantBits, - (channels < 0)?-1:(sampleSizeInBytes * channels), + sampleSizeInBytes * channels, channels, rate, enc, isSigned, isBigEndian); } @@ -254,7 +246,7 @@ typedef struct tag_AlsaPcmInfo { snd_pcm_sw_params_t* swParams; int bufferSizeInBytes; int frameSize; // storage size in Bytes - int periods; + unsigned int periods; snd_pcm_uframes_t periodSize; #ifdef GET_POSITION_METHOD2 // to be used exclusively by getBytePosition! @@ -305,8 +297,8 @@ int setHWParams(AlsaPcmInfo* info, int channels, int bufferSizeInFrames, snd_pcm_format_t format) { - unsigned int rrate; - int ret, dir, periods, periodTime; + unsigned int rrate, periodTime, periods; + int ret, dir; snd_pcm_uframes_t alsaBufferSizeInFrames = (snd_pcm_uframes_t) bufferSizeInFrames; /* choose all parameters */ @@ -335,12 +327,8 @@ int setHWParams(AlsaPcmInfo* info, } /* set the stream rate */ rrate = (int) (sampleRate + 0.5f); -#ifdef ALSA_PCM_NEW_HW_PARAMS_API dir = 0; ret = snd_pcm_hw_params_set_rate_near(info->handle, info->hwParams, &rrate, &dir); -#else - ret = snd_pcm_hw_params_set_rate_near(info->handle, info->hwParams, rrate, 0); -#endif if (ret < 0) { ERROR2("Rate %dHz not available for playback: %s\n", (int) (sampleRate+0.5f), snd_strerror(ret)); return FALSE; @@ -350,12 +338,7 @@ int setHWParams(AlsaPcmInfo* info, return FALSE; } /* set the buffer time */ -#ifdef ALSA_PCM_NEW_HW_PARAMS_API - ret = snd_pcm_hw_params_set_buffer_size_near(info->handle, info->hwParams, &alsaBufferSizeInFrames); -#else - ret = snd_pcm_hw_params_set_buffer_size_near(info->handle, info->hwParams, alsaBufferSizeInFrames); -#endif if (ret < 0) { ERROR2("Unable to set buffer size to %d frames: %s\n", (int) alsaBufferSizeInFrames, snd_strerror(ret)); @@ -366,12 +349,7 @@ int setHWParams(AlsaPcmInfo* info, if (bufferSizeInFrames > 1024) { dir = 0; periodTime = DEFAULT_PERIOD_TIME; -#ifdef ALSA_PCM_NEW_HW_PARAMS_API ret = snd_pcm_hw_params_set_period_time_near(info->handle, info->hwParams, &periodTime, &dir); -#else - periodTime = snd_pcm_hw_params_set_period_time_near(info->handle, info->hwParams, periodTime, &dir); - ret = periodTime; -#endif if (ret < 0) { ERROR2("Unable to set period time to %d: %s\n", DEFAULT_PERIOD_TIME, snd_strerror(ret)); return FALSE; @@ -380,12 +358,7 @@ int setHWParams(AlsaPcmInfo* info, /* set the period count for very small buffer sizes to 2 */ dir = 0; periods = 2; -#ifdef ALSA_PCM_NEW_HW_PARAMS_API ret = snd_pcm_hw_params_set_periods_near(info->handle, info->hwParams, &periods, &dir); -#else - periods = snd_pcm_hw_params_set_periods_near(info->handle, info->hwParams, periods, &dir); - ret = periods; -#endif if (ret < 0) { ERROR2("Unable to set period count to %d: %s\n", /*periods*/ 2, snd_strerror(ret)); return FALSE; @@ -421,12 +394,6 @@ int setSWParams(AlsaPcmInfo* info) { ERROR1("Unable to set avail min for playback: %s\n", snd_strerror(ret)); return FALSE; } - /* align all transfers to 1 sample */ - ret = snd_pcm_sw_params_set_xfer_align(info->handle, info->swParams, 1); - if (ret < 0) { - ERROR1("Unable to set transfer align: %s\n", snd_strerror(ret)); - return FALSE; - } /* write the parameters to the playback device */ ret = snd_pcm_sw_params(info->handle, info->swParams); if (ret < 0) { @@ -448,7 +415,6 @@ void* DAUDIO_Open(INT32 mixerIndex, INT32 deviceID, int isSource, int ret = 0; AlsaPcmInfo* info = NULL; /* snd_pcm_uframes_t is 64 bit on 64-bit systems */ - snd_pcm_uframes_t alsaPeriodSize = 0; snd_pcm_uframes_t alsaBufferSizeInFrames = 0; @@ -484,21 +450,13 @@ void* DAUDIO_Open(INT32 mixerIndex, INT32 deviceID, int isSource, bufferSizeInBytes / frameSize, format)) { info->frameSize = frameSize; -#ifdef ALSA_PCM_NEW_HW_PARAMS_API - ret = snd_pcm_hw_params_get_period_size(info->hwParams, &alsaPeriodSize, &dir); - info->periodSize = (int) alsaPeriodSize; + ret = snd_pcm_hw_params_get_period_size(info->hwParams, &info->periodSize, &dir); if (ret < 0) { ERROR1("ERROR: snd_pcm_hw_params_get_period: %s\n", snd_strerror(ret)); } snd_pcm_hw_params_get_periods(info->hwParams, &(info->periods), &dir); snd_pcm_hw_params_get_buffer_size(info->hwParams, &alsaBufferSizeInFrames); info->bufferSizeInBytes = (int) alsaBufferSizeInFrames * frameSize; -#else - info->periodSize = snd_pcm_hw_params_get_period_size(info->hwParams, &dir); - info->periods = snd_pcm_hw_params_get_periods(info->hwParams, &dir); - info->bufferSizeInBytes = snd_pcm_hw_params_get_buffer_size(info->hwParams) * frameSize; - ret = 0; -#endif TRACE3(" DAUDIO_Open: period size = %d frames, periods = %d. Buffer size: %d bytes.\n", (int) info->periodSize, info->periods, info->bufferSizeInBytes); } diff --git a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCMUtils.h b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCMUtils.h index c8d920f8de6..ca911d2f486 100644 --- a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCMUtils.h +++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCMUtils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ */ // define this with a later version of ALSA than 0.9.0rc3 +// (starting from 1.0.0 it became default behaviour) #define ALSA_PCM_NEW_HW_PARAMS_API #include #include "Utilities.h" diff --git a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_Ports.c b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_Ports.c index 465ecadf0f9..0db0e6c4b53 100644 --- a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_Ports.c +++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_Ports.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -380,7 +380,7 @@ void PORT_GetControls(void* id, INT32 portIndex, PortControlCreator* creator) { void* controls[10]; int numControls; char* portName; - int isPlayback; + int isPlayback = 0; int isMono; int isStereo; char* type; diff --git a/jdk/src/solaris/native/java/io/FileOutputStream_md.c b/jdk/src/solaris/native/java/io/FileOutputStream_md.c index 1d71052ec56..efd5864cd9c 100644 --- a/jdk/src/solaris/native/java/io/FileOutputStream_md.c +++ b/jdk/src/solaris/native/java/io/FileOutputStream_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 +60,14 @@ Java_java_io_FileOutputStream_open(JNIEnv *env, jobject this, } JNIEXPORT void JNICALL -Java_java_io_FileOutputStream_write(JNIEnv *env, jobject this, jint byte) { - writeSingle(env, this, byte, fos_fd); +Java_java_io_FileOutputStream_write(JNIEnv *env, jobject this, jint byte, jboolean append) { + writeSingle(env, this, byte, append, fos_fd); } JNIEXPORT void JNICALL Java_java_io_FileOutputStream_writeBytes(JNIEnv *env, - jobject this, jbyteArray bytes, jint off, jint len) { - writeBytes(env, this, bytes, off, len, fos_fd); + jobject this, jbyteArray bytes, jint off, jint len, jboolean append) { + writeBytes(env, this, bytes, off, len, append, fos_fd); } JNIEXPORT void JNICALL diff --git a/jdk/src/solaris/native/java/io/UnixFileSystem_md.c b/jdk/src/solaris/native/java/io/UnixFileSystem_md.c index 4dc9ee865e0..37351253a4a 100644 --- a/jdk/src/solaris/native/java/io/UnixFileSystem_md.c +++ b/jdk/src/solaris/native/java/io/UnixFileSystem_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/java/io/canonicalize_md.c b/jdk/src/solaris/native/java/io/canonicalize_md.c index 45e1f9ce26e..6f1c5e0123c 100644 --- a/jdk/src/solaris/native/java/io/canonicalize_md.c +++ b/jdk/src/solaris/native/java/io/canonicalize_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/java/io/io_util_md.c b/jdk/src/solaris/native/java/io/io_util_md.c index eb27ff26794..d9fa67cc781 100644 --- a/jdk/src/solaris/native/java/io/io_util_md.c +++ b/jdk/src/solaris/native/java/io/io_util_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/java/io/io_util_md.h b/jdk/src/solaris/native/java/io/io_util_md.h index 378fbcb1ebc..5c116049462 100644 --- a/jdk/src/solaris/native/java/io/io_util_md.h +++ b/jdk/src/solaris/native/java/io/io_util_md.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +53,9 @@ #define THIS_FD(obj) (*env)->GetIntField(env, obj, IO_fd_fdID) /* - * Route the routines through HPI + * Route the routines through VM */ +#define IO_Append JVM_Write #define IO_Write JVM_Write #define IO_Sync JVM_Sync #define IO_Read JVM_Read diff --git a/jdk/src/solaris/native/java/lang/java_props_md.c b/jdk/src/solaris/native/java/lang/java_props_md.c index de6faf8c5b4..1e4e3b6d64b 100644 --- a/jdk/src/solaris/native/java/lang/java_props_md.c +++ b/jdk/src/solaris/native/java/lang/java_props_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -117,7 +117,8 @@ setPathEnvironment(char *envstring) #define P_tmpdir "/var/tmp" #endif -static int ParseLocale(int cat, char ** std_language, char ** std_country, char ** std_variant, char ** std_encoding) { +static int ParseLocale(int cat, char ** std_language, char ** std_script, + char ** std_country, char ** std_variant, char ** std_encoding) { char temp[64]; char *language = NULL, *country = NULL, *variant = NULL, *encoding = NULL; @@ -181,14 +182,22 @@ static int ParseLocale(int cat, char ** std_language, char ** std_country, char strcpy(encoding_variant, p); /* Copy the leading '.' */ *p = '\0'; } else if ((p = strchr(temp, '@')) != NULL) { - strcpy(encoding_variant, p); /* Copy the leading '@' */ - *p = '\0'; + strcpy(encoding_variant, p); /* Copy the leading '@' */ + *p = '\0'; } else { *encoding_variant = '\0'; } if (mapLookup(locale_aliases, temp, &p)) { strcpy(temp, p); + // check the "encoding_variant" again, if any. + if ((p = strchr(temp, '.')) != NULL) { + strcpy(encoding_variant, p); /* Copy the leading '.' */ + *p = '\0'; + } else if ((p = strchr(temp, '@')) != NULL) { + strcpy(encoding_variant, p); /* Copy the leading '@' */ + *p = '\0'; + } } language = temp; @@ -208,21 +217,31 @@ static int ParseLocale(int cat, char ** std_language, char ** std_country, char /* Normalize the language name */ if (std_language != NULL) { *std_language = "en"; - if (language != NULL) { - mapLookup(language_names, language, std_language); + if (language != NULL && mapLookup(language_names, language, std_language) == 0) { + *std_language = malloc(strlen(language)+1); + strcpy(*std_language, language); } } /* Normalize the country name */ if (std_country != NULL && country != NULL) { - *std_country = country; - mapLookup(country_names, country, std_country); + if (mapLookup(country_names, country, std_country) == 0) { + *std_country = malloc(strlen(country)+1); + strcpy(*std_country, country); + } } - /* Normalize the variant name. Note that we only use - * variants listed in the mapping array; others are ignored. */ - if (std_variant != NULL && variant != NULL) { - mapLookup(variant_names, variant, std_variant); + /* Normalize the script and variant name. Note that we only use + * variants listed in the mapping array; others are ignored. + */ + if (variant != NULL) { + if (std_script != NULL) { + mapLookup(script_names, variant, std_script); + } + + if (std_variant != NULL) { + mapLookup(variant_names, variant, std_variant); + } } /* Normalize the encoding name. Note that we IGNORE the string @@ -358,11 +377,13 @@ GetJavaProperties(JNIEnv *env) setlocale(LC_ALL, ""); if (ParseLocale(LC_CTYPE, &(sprops.format_language), + &(sprops.format_script), &(sprops.format_country), &(sprops.format_variant), &(sprops.encoding))) { ParseLocale(LC_MESSAGES, &(sprops.language), + &(sprops.script), &(sprops.country), &(sprops.variant), NULL); @@ -371,6 +392,7 @@ GetJavaProperties(JNIEnv *env) sprops.encoding = "ISO8859-1"; } sprops.display_language = sprops.language; + sprops.display_script = sprops.script; sprops.display_country = sprops.country; sprops.display_variant = sprops.variant; sprops.sun_jnu_encoding = sprops.encoding; diff --git a/jdk/src/solaris/native/java/lang/locale_str.h b/jdk/src/solaris/native/java/lang/locale_str.h index bd2ba2f87af..d63e26ce37d 100644 --- a/jdk/src/solaris/native/java/lang/locale_str.h +++ b/jdk/src/solaris/native/java/lang/locale_str.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,6 +86,8 @@ "wa", "wa_BE", "zh", "zh_CN", #ifdef __linux__ + "bokmal", "nb_NO", + "bokm\xE5l", "nb_NO", "catalan", "ca_ES", "croatian", "hr_HR", "czech", "cs_CZ", @@ -93,9 +95,13 @@ "dansk", "da_DK", "deutsch", "de_DE", "dutch", "nl_NL", + "eesti", "et_EE", + "estonian", "et_EE", "finnish", "fi_FI", "fran\xE7\x61is", "fr_FR", "french", "fr_FR", + "galego", "gl_ES", + "galician", "gl_ES", "german", "de_DE", "greek", "el_GR", "hebrew", "iw_IL", @@ -104,7 +110,10 @@ "icelandic", "is_IS", "italian", "it_IT", "japanese", "ja_JP", + "korean", "ko_KR", + "lithuanian", "lt_LT", "norwegian", "no_NO", + "nynorsk", "nn_NO", "polish", "pl_PL", "portuguese", "pt_PT", "romanian", "ro_RO", @@ -114,11 +123,16 @@ "slovenian", "sl_SI", "spanish", "es_ES", "swedish", "sv_SE", + "thai", "th_TH", "turkish", "tr_TR", #else "big5", "zh_TW.Big5", "chinese", "zh_CN", + "iso_8859_1", "en_US.ISO8859-1", + "iso_8859_15", "en_US.ISO8859-15", "japanese", "ja_JP", + "no_NY", "no_NO@nynorsk", + "sr_SP", "sr_YU", "tchinese", "zh_TW", #endif "" @@ -130,203 +144,16 @@ static char *language_names[] = { "C", "en", "POSIX", "en", - "aa", "aa", - "ab", "ab", - "ae", "ae", - "af", "af", - "ak", "ak", - "am", "am", - "an", "an", - "ar", "ar", - "as", "as", - "av", "av", - "ay", "ay", - "az", "az", - "ba", "ba", - "be", "be", - "bg", "bg", - "bh", "bh", - "bi", "bi", - "bm", "bm", - "bn", "bn", - "bo", "bo", - "br", "br", - "bs", "bs", - "ca", "ca", - "ce", "ce", - "ch", "ch", - "co", "co", - "cr", "cr", - "cs", "cs", "cz", "cs", - "cu", "cu", - "cv", "cv", - "cy", "cy", - "da", "da", - "de", "de", - "dv", "dv", - "dz", "dz", - "ee", "ee", - "el", "el", - "en", "en", - "eo", "eo", - "es", "es", - "et", "et", - "eu", "eu", - "fa", "fa", - "ff", "ff", - "fi", "fi", - "fj", "fj", - "fo", "fo", - "fr", "fr", - "fy", "fy", - "ga", "ga", - "gd", "gd", - "gl", "gl", - "gn", "gn", - "gu", "gu", - "gv", "gv", - "ha", "ha", "he", "iw", - "hi", "hi", - "ho", "ho", - "hr", "hr", #ifdef __linux__ "hs", "en", // used on Linux, not clear what it stands for #endif - "ht", "ht", - "hu", "hu", - "hy", "hy", - "hz", "hz", - "ia", "ia", "id", "in", - "ie", "ie", - "ig", "ig", - "ii", "ii", - "ik", "ik", - "in", "in", - "io", "io", - "is", "is", - "it", "it", - "iu", "iu", - "iw", "iw", - "ja", "ja", - "ji", "yi", - "jv", "jv", - "ka", "ka", - "kg", "kg", - "ki", "ki", - "kj", "kj", - "kk", "kk", - "kl", "kl", - "km", "km", - "kn", "kn", - "ko", "ko", - "kr", "kr", - "ks", "ks", - "ku", "ku", - "kv", "kv", - "kw", "kw", - "ky", "ky", - "la", "la", - "lb", "lb", - "lg", "lg", - "li", "li", - "ln", "ln", - "lo", "lo", - "lt", "lt", - "lu", "lu", - "lv", "lv", - "mg", "mg", - "mh", "mh", - "mi", "mi", - "mk", "mk", - "ml", "ml", - "mn", "mn", - "mo", "mo", - "mr", "mr", - "ms", "ms", - "mt", "mt", - "my", "my", - "na", "na", - "nb", "nb", - "nd", "nd", - "ne", "ne", - "ng", "ng", - "nl", "nl", - "nn", "nn", - "no", "no", - "nr", "nr", - "nv", "nv", - "ny", "ny", - "oc", "oc", - "oj", "oj", - "om", "om", - "or", "or", - "os", "os", - "pa", "pa", - "pi", "pi", - "pl", "pl", - "ps", "ps", - "pt", "pt", - "qu", "qu", - "rm", "rm", - "rn", "rn", - "ro", "ro", - "ru", "ru", - "rw", "rw", - "sa", "sa", - "sc", "sc", - "sd", "sd", - "se", "se", - "sg", "sg", "sh", "sr", // sh is deprecated - "si", "si", - "sk", "sk", - "sl", "sl", - "sm", "sm", - "sn", "sn", - "so", "so", - "sq", "sq", - "sr", "sr", - "ss", "ss", - "st", "st", "su", "fi", - "sv", "sv", - "sw", "sw", - "ta", "ta", - "te", "te", - "tg", "tg", - "th", "th", - "ti", "ti", - "tk", "tk", - "tl", "tl", - "tn", "tn", - "to", "to", - "tr", "tr", - "ts", "ts", - "tt", "tt", - "tw", "tw", - "ty", "ty", #ifdef __linux__ "ua", "en", // used on Linux, not clear what it stands for -#endif - "ug", "ug", - "uk", "uk", - "ur", "ur", - "uz", "uz", - "ve", "ve", - "vi", "vi", - "vo", "vo", - "wa", "wa", - "wo", "wo", - "xh", "xh", - "yi", "yi", - "yo", "yo", - "za", "za", - "zh", "zh", - "zu", "zu", -#ifdef __linux__ "catalan", "ca", "croatian", "hr", "czech", "cs", @@ -364,255 +191,27 @@ static char *language_names[] = { "", }; +/* + * Linux/Solaris script string to Java script name mapping table. + */ +static char *script_names[] = { +#ifdef __linux__ + "cyrillic", "Cyrl", + "devanagari", "Deva", + "iqtelif", "Latn", + "latin", "Latn", +#endif + "", +}; + /* * Linux/Solaris country string to ISO3166 string mapping table. */ static char *country_names[] = { - "AD", "AD", - "AE", "AE", - "AF", "AF", - "AG", "AG", - "AI", "AI", - "AL", "AL", - "AM", "AM", - "AN", "AN", - "AO", "AO", - "AQ", "AQ", - "AR", "AR", - "AS", "AS", - "AT", "AT", - "AU", "AU", - "AW", "AW", - "AX", "AX", - "AZ", "AZ", - "BA", "BA", - "BB", "BB", - "BD", "BD", - "BE", "BE", - "BF", "BF", - "BG", "BG", - "BH", "BH", - "BI", "BI", - "BJ", "BJ", - "BM", "BM", - "BN", "BN", - "BO", "BO", - "BR", "BR", - "BS", "BS", - "BT", "BT", - "BV", "BV", - "BW", "BW", - "BY", "BY", - "BZ", "BZ", - "CA", "CA", - "CC", "CC", - "CD", "CD", - "CF", "CF", - "CG", "CG", - "CH", "CH", - "CI", "CI", - "CK", "CK", - "CL", "CL", - "CM", "CM", - "CN", "CN", - "CO", "CO", - "CR", "CR", - "CS", "CS", - "CU", "CU", - "CV", "CV", - "CX", "CX", - "CY", "CY", - "CZ", "CZ", - "DE", "DE", - "DJ", "DJ", - "DK", "DK", - "DM", "DM", - "DO", "DO", - "DZ", "DZ", - "EC", "EC", - "EE", "EE", - "EG", "EG", - "EH", "EH", - "ER", "ER", - "ES", "ES", - "ET", "ET", - "FI", "FI", - "FJ", "FJ", - "FK", "FK", - "FM", "FM", - "FO", "FO", - "FR", "FR", - "GA", "GA", - "GB", "GB", - "GD", "GD", - "GE", "GE", - "GF", "GF", - "GH", "GH", - "GI", "GI", - "GL", "GL", - "GM", "GM", - "GN", "GN", - "GP", "GP", - "GQ", "GQ", - "GR", "GR", - "GS", "GS", - "GT", "GT", - "GU", "GU", - "GW", "GW", - "GY", "GY", - "HK", "HK", - "HM", "HM", - "HN", "HN", - "HR", "HR", - "HT", "HT", - "HU", "HU", - "ID", "ID", - "IE", "IE", - "IL", "IL", - "IN", "IN", - "IO", "IO", - "IQ", "IQ", - "IR", "IR", - "IS", "IS", - "IT", "IT", - "JM", "JM", - "JO", "JO", - "JP", "JP", - "KE", "KE", - "KG", "KG", - "KH", "KH", - "KI", "KI", - "KM", "KM", - "KN", "KN", - "KP", "KP", - "KR", "KR", - "KW", "KW", - "KY", "KY", - "KZ", "KZ", - "LA", "LA", - "LB", "LB", - "LC", "LC", - "LI", "LI", - "LK", "LK", - "LR", "LR", - "LS", "LS", - "LT", "LT", - "LU", "LU", - "LV", "LV", - "LY", "LY", - "MA", "MA", - "MC", "MC", - "MD", "MD", - "MG", "MG", - "MH", "MH", - "MK", "MK", - "ML", "ML", - "MM", "MM", - "MN", "MN", - "MO", "MO", - "MP", "MP", - "MQ", "MQ", - "MR", "MR", - "MS", "MS", - "MT", "MT", - "MU", "MU", - "MV", "MV", - "MW", "MW", - "MX", "MX", - "MY", "MY", - "MZ", "MZ", - "NA", "NA", - "NC", "NC", - "NE", "NE", - "NF", "NF", - "NG", "NG", - "NI", "NI", - "NL", "NL", - "NO", "NO", - "NP", "NP", - "NR", "NR", - "NU", "NU", - "NZ", "NZ", - "OM", "OM", - "PA", "PA", - "PE", "PE", - "PF", "PF", - "PG", "PG", - "PH", "PH", - "PK", "PK", - "PL", "PL", - "PM", "PM", - "PN", "PN", - "PR", "PR", - "PS", "PS", - "PT", "PT", - "PW", "PW", - "PY", "PY", - "QA", "QA", - "RE", "RE", #ifdef __linux__ "RN", "US", // used on Linux, not clear what it stands for #endif - "RO", "RO", - "RU", "RU", - "RW", "RW", - "SA", "SA", - "SB", "SB", - "SC", "SC", - "SD", "SD", - "SE", "SE", - "SG", "SG", - "SH", "SH", - "SI", "SI", - "SJ", "SJ", - "SK", "SK", - "SL", "SL", - "SM", "SM", - "SN", "SN", - "SO", "SO", - "SR", "SR", - "ST", "ST", - "SV", "SV", - "SY", "SY", - "SZ", "SZ", - "TC", "TC", - "TD", "TD", - "TF", "TF", - "TG", "TG", - "TH", "TH", - "TJ", "TJ", - "TK", "TK", - "TL", "TL", - "TM", "TM", - "TN", "TN", - "TO", "TO", - "TR", "TR", - "TT", "TT", - "TV", "TV", - "TW", "TW", - "TZ", "TZ", - "UA", "UA", - "UG", "UG", - "UK", "GB", - "UM", "UM", - "US", "US", - "UY", "UY", - "UZ", "UZ", - "VA", "VA", - "VC", "VC", - "VE", "VE", - "VG", "VG", - "VI", "VI", - "VN", "VN", - "VU", "VU", - "WF", "WF", - "WS", "WS", - "YE", "YE", - "YT", "YT", "YU", "CS", // YU has been removed from ISO 3166 - "ZA", "ZA", - "ZM", "ZM", - "ZW", "ZW", "", }; diff --git a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c index 0e9969eebe3..8514eef39ac 100644 --- a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -381,7 +381,15 @@ ping4(JNIEnv *env, jint fd, struct sockaddr_in* him, jint timeout, n = sendto(fd, sendbuf, plen, 0, (struct sockaddr *)him, sizeof(struct sockaddr)); if (n < 0 && errno != EINPROGRESS ) { - NET_ThrowNew(env, errno, "Can't send ICMP packet"); +#ifdef __linux__ + if (errno != EINVAL) + /* + * On some Linuxes, when bound to the loopback interface, sendto + * will fail and errno will be set to EINVAL. When that happens, + * don't throw an exception, just return false. + */ +#endif /*__linux__ */ + NET_ThrowNew(env, errno, "Can't send ICMP packet"); close(fd); return JNI_FALSE; } diff --git a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c index 4c5e928c560..5db03bf36fa 100644 --- a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -506,7 +506,16 @@ ping6(JNIEnv *env, jint fd, struct sockaddr_in6* him, jint timeout, plen = sizeof(struct icmp6_hdr) + sizeof(tv); n = sendto(fd, sendbuf, plen, 0, (struct sockaddr*) him, sizeof(struct sockaddr_in6)); if (n < 0 && errno != EINPROGRESS) { +#ifdef __linux__ + if (errno != EINVAL) + /* + * On some Linuxes, when bound to the loopback interface, sendto + * will fail and errno will be set to EINVAL. When that happens, + * don't throw an exception, just return false. + */ +#endif /*__linux__ */ NET_ThrowNew(env, errno, "Can't send ICMP packet"); + close(fd); return JNI_FALSE; } diff --git a/jdk/src/solaris/native/java/net/NetworkInterface.c b/jdk/src/solaris/native/java/net/NetworkInterface.c index c166cc86dda..d85ca799d4e 100644 --- a/jdk/src/solaris/native/java/net/NetworkInterface.c +++ b/jdk/src/solaris/native/java/net/NetworkInterface.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/java/net/PlainDatagramSocketImpl.c b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c index cde085a9473..03e3a64c0c8 100644 --- a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c +++ b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/java/net/PlainSocketImpl.c b/jdk/src/solaris/native/java/net/PlainSocketImpl.c index 060dacdac86..018e264ef7e 100644 --- a/jdk/src/solaris/native/java/net/PlainSocketImpl.c +++ b/jdk/src/solaris/native/java/net/PlainSocketImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/java/net/net_util_md.c b/jdk/src/solaris/native/java/net/net_util_md.c index 43baab96ea8..8367f05470b 100644 --- a/jdk/src/solaris/native/java/net/net_util_md.c +++ b/jdk/src/solaris/native/java/net/net_util_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ #include #include #include +#include #ifdef __solaris__ #include @@ -75,17 +76,17 @@ getnameinfo_f getnameinfo_ptr = NULL; #endif #ifdef __solaris__ -static int init_max_buf; +static int init_tcp_max_buf, init_udp_max_buf; static int tcp_max_buf; static int udp_max_buf; /* * Get the specified parameter from the specified driver. The value * of the parameter is assumed to be an 'int'. If the parameter - * cannot be obtained return the specified default value. + * cannot be obtained return -1 */ static int -getParam(char *driver, char *param, int dflt) +getParam(char *driver, char *param) { struct strioctl stri; char buf [64]; @@ -94,7 +95,7 @@ getParam(char *driver, char *param, int dflt) s = open (driver, O_RDWR); if (s < 0) { - return dflt; + return -1; } strncpy (buf, param, sizeof(buf)); stri.ic_cmd = ND_GET; @@ -102,13 +103,64 @@ getParam(char *driver, char *param, int dflt) stri.ic_dp = buf; stri.ic_len = sizeof(buf); if (ioctl (s, I_STR, &stri) < 0) { - value = dflt; + value = -1; } else { value = atoi(buf); } close (s); return value; } + +/* + * Iterative way to find the max value that SO_SNDBUF or SO_RCVBUF + * for Solaris versions that do not support the ioctl() in getParam(). + * Ugly, but only called once (for each sotype). + * + * As an optimisation, we make a guess using the default values for Solaris + * assuming they haven't been modified with ndd. + */ + +#define MAX_TCP_GUESS 1024 * 1024 +#define MAX_UDP_GUESS 2 * 1024 * 1024 + +#define FAIL_IF_NOT_ENOBUFS if (errno != ENOBUFS) return -1 + +static int findMaxBuf(int fd, int opt, int sotype) { + int a = 0; + int b = MAXINT; + int initial_guess; + int limit = -1; + + if (sotype == SOCK_DGRAM) { + initial_guess = MAX_UDP_GUESS; + } else { + initial_guess = MAX_TCP_GUESS; + } + + if (setsockopt(fd, SOL_SOCKET, opt, &initial_guess, sizeof(int)) == 0) { + initial_guess++; + if (setsockopt(fd, SOL_SOCKET, opt, &initial_guess,sizeof(int)) < 0) { + FAIL_IF_NOT_ENOBUFS; + return initial_guess - 1; + } + a = initial_guess; + } else { + FAIL_IF_NOT_ENOBUFS; + b = initial_guess - 1; + } + do { + int mid = a + (b-a)/2; + if (setsockopt(fd, SOL_SOCKET, opt, &mid, sizeof(int)) == 0) { + limit = mid; + a = mid + 1; + } else { + FAIL_IF_NOT_ENOBUFS; + b = mid - 1; + } + } while (b >= a); + + return limit; +} #endif #ifdef __linux__ @@ -1148,7 +1200,6 @@ NET_GetSockOpt(int fd, int level, int opt, void *result, return rv; } - /* * Wrapper for setsockopt system routine - performs any * necessary pre/post processing to deal with OS specific @@ -1212,7 +1263,7 @@ NET_SetSockOpt(int fd, int level, int opt, const void *arg, #ifdef __solaris__ if (level == SOL_SOCKET) { if (opt == SO_SNDBUF || opt == SO_RCVBUF) { - int sotype, arglen; + int sotype=0, arglen; int *bufsize, maxbuf; int ret; @@ -1223,18 +1274,37 @@ NET_SetSockOpt(int fd, int level, int opt, const void *arg, /* Exceeded system limit so clamp and retry */ - if (!init_max_buf) { - tcp_max_buf = getParam("/dev/tcp", "tcp_max_buf", 1024*1024); - udp_max_buf = getParam("/dev/udp", "udp_max_buf", 2048*1024); - init_max_buf = 1; - } - arglen = sizeof(sotype); if (getsockopt(fd, SOL_SOCKET, SO_TYPE, (void *)&sotype, &arglen) < 0) { return -1; } + /* + * We try to get tcp_maxbuf (and udp_max_buf) using + * an ioctl() that isn't available on all versions of Solaris. + * If that fails, we use the search algorithm in findMaxBuf() + */ + if (!init_tcp_max_buf && sotype == SOCK_STREAM) { + tcp_max_buf = getParam("/dev/tcp", "tcp_max_buf"); + if (tcp_max_buf == -1) { + tcp_max_buf = findMaxBuf(fd, opt, SOCK_STREAM); + if (tcp_max_buf == -1) { + return -1; + } + } + init_tcp_max_buf = 1; + } else if (!init_udp_max_buf && sotype == SOCK_DGRAM) { + udp_max_buf = getParam("/dev/udp", "udp_max_buf"); + if (udp_max_buf == -1) { + udp_max_buf = findMaxBuf(fd, opt, SOCK_DGRAM); + if (udp_max_buf == -1) { + return -1; + } + } + init_udp_max_buf = 1; + } + maxbuf = (sotype == SOCK_STREAM) ? tcp_max_buf : udp_max_buf; bufsize = (int *)arg; if (*bufsize > maxbuf) { diff --git a/jdk/src/solaris/native/java/net/net_util_md.h b/jdk/src/solaris/native/java/net/net_util_md.h index 97f2ffa30b0..5df589403ed 100644 --- a/jdk/src/solaris/native/java/net/net_util_md.h +++ b/jdk/src/solaris/native/java/net/net_util_md.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/java/nio/MappedByteBuffer.c b/jdk/src/solaris/native/java/nio/MappedByteBuffer.c index 15c4ec5f5de..a87926f5901 100644 --- a/jdk/src/solaris/native/java/nio/MappedByteBuffer.c +++ b/jdk/src/solaris/native/java/nio/MappedByteBuffer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +82,8 @@ Java_java_nio_MappedByteBuffer_load0(JNIEnv *env, jobject obj, jlong address, JNIEXPORT void JNICALL -Java_java_nio_MappedByteBuffer_force0(JNIEnv *env, jobject obj, jlong address, - jlong len) +Java_java_nio_MappedByteBuffer_force0(JNIEnv *env, jobject obj, jobject fdo, + jlong address, jlong len) { void* a = (void *)jlong_to_ptr(address); int result = msync(a, (size_t)len, MS_SYNC); diff --git a/jdk/src/solaris/native/sun/awt/awt.h b/jdk/src/solaris/native/sun/awt/awt.h index abfbdb9bde1..d83d645fcfe 100644 --- a/jdk/src/solaris/native/sun/awt/awt.h +++ b/jdk/src/solaris/native/sun/awt/awt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. * 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,20 +159,8 @@ extern int lastL; #endif /* DEBUG_AWT_LOCK && !XAWT */ #ifndef HEADLESS -extern Display *awt_display; /* awt_GraphicsEnv.c */ -extern XtAppContext awt_appContext; /* awt_MToolkit.c */ -extern Widget awt_root_shell; -extern Pixel awt_defaultBg; -extern Pixel awt_defaultFg; -extern int awt_multiclick_time; /* awt_MToolkit.c */ -extern int awt_multiclick_smudge; /* canvas.c */ -extern unsigned int awt_MetaMask; /* awt_MToolkit.c */ -extern unsigned int awt_AltMask; -extern unsigned int awt_NumLockMask; -extern unsigned int awt_ModeSwitchMask; -extern Cursor awt_scrollCursor; /* awt_MToolkit.c */ -extern Boolean awt_ModLockIsShiftLock; - +extern Display *awt_display; /* awt_GraphicsEnv.c */ +extern Boolean awt_ModLockIsShiftLock; /* XToolkit.c */ #endif /* !HEADLESS */ #endif /* ! _AWT_ */ diff --git a/jdk/src/solaris/native/sun/awt/awt_DrawingSurface.c b/jdk/src/solaris/native/sun/awt/awt_DrawingSurface.c index 1180b66b086..0c1275b3bc2 100644 --- a/jdk/src/solaris/native/sun/awt/awt_DrawingSurface.c +++ b/jdk/src/solaris/native/sun/awt/awt_DrawingSurface.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -264,7 +264,7 @@ awt_DrawingSurface_GetDrawingSurfaceInfo(JAWT_DrawingSurface* ds) #ifndef XAWT px->drawable = XtWindow(cdata->widget); #else - px->drawable = JNU_GetLongFieldAsPtr(env, peer, windowID); + px->drawable = (*env)->GetLongField(env, peer, windowID); #endif px->display = awt_display; diff --git a/jdk/src/solaris/native/sun/awt/awt_InputMethod.c b/jdk/src/solaris/native/sun/awt/awt_InputMethod.c index 549e51986f6..116a5310eb7 100644 --- a/jdk/src/solaris/native/sun/awt/awt_InputMethod.c +++ b/jdk/src/solaris/native/sun/awt/awt_InputMethod.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,8 +46,6 @@ #ifdef XAWT #include #include - -#define XtWindow(w) (w) #else /* !XAWT */ #include #include @@ -670,7 +668,8 @@ static StatusWindow *createStatusWindow( int mccr = 0; char *dsr; Pixel bg, fg, light, dim; - int x, y, w, h, bw, depth, off_x, off_y, xx, yy; + int x, y, off_x, off_y, xx, yy; + unsigned int w, h, bw, depth; XGCValues values; unsigned long valuemask = 0; /*ignore XGCvalue and use defaults*/ int screen = 0; @@ -709,7 +708,7 @@ static StatusWindow *createStatusWindow( light = adata->AwtColorMatch(195, 195, 195, adata); dim = adata->AwtColorMatch(128, 128, 128, adata); - XGetWindowAttributes(dpy, XtWindow(parent), &xwa); + XGetWindowAttributes(dpy, parent, &xwa); bw = 2; /*xwa.border_width does not have the correct value*/ /*compare the size difference between parent container @@ -717,7 +716,7 @@ static StatusWindow *createStatusWindow( and title bar height (?)*/ XQueryTree( dpy, - XtWindow(parent), + parent, &rootWindow, &containerWindow, &ignoreWindowPtr, @@ -731,7 +730,7 @@ static StatusWindow *createStatusWindow( XGetWindowAttributes(dpy, rootWindow, &xxwa); XTranslateCoordinates(dpy, - XtWindow(parent), xwa.root, + parent, xwa.root, xwa.x, xwa.y, &x, &y, &child); @@ -833,9 +832,9 @@ static void onoffStatusWindow(X11InputMethodData* pX11IMData, if (statusWindow->parent != parent){ statusWindow->parent = parent; } - XGetWindowAttributes(dpy, XtWindow(parent), &xwa); + XGetWindowAttributes(dpy, parent, &xwa); XTranslateCoordinates(dpy, - XtWindow(parent), xwa.root, + parent, xwa.root, xwa.x, xwa.y, &x, &y, &child); @@ -966,9 +965,9 @@ void adjustStatusWindow(Widget shell){ XWindowAttributes xwa; int x, y; Window child; - XGetWindowAttributes(dpy, XtWindow(shell), &xwa); + XGetWindowAttributes(dpy, shell, &xwa); XTranslateCoordinates(dpy, - XtWindow(shell), xwa.root, + shell, xwa.root, xwa.x, xwa.y, &x, &y, &child); @@ -1033,7 +1032,7 @@ createXIC(Widget w, X11InputMethodData *pX11IMData, return False; } #ifdef XAWT - if (w == NULL) { + if (!w) { return False; } #else /* !XAWT */ @@ -1148,8 +1147,8 @@ createXIC(Widget w, X11InputMethodData *pX11IMData, goto err; pX11IMData->statusWindow = createStatusWindow(w); pX11IMData->ic_active = XCreateIC(X11im, - XNClientWindow, XtWindow(w), - XNFocusWindow, XtWindow(w), + XNClientWindow, w, + XNFocusWindow, w, XNInputStyle, active_styles, XNPreeditAttributes, preedit, XNStatusAttributes, status, @@ -1166,8 +1165,8 @@ createXIC(Widget w, X11InputMethodData *pX11IMData, goto err; pX11IMData->statusWidget = awt_util_getXICStatusAreaWindow(w); pX11IMData->ic_active = XCreateIC(X11im, - XNClientWindow, XtWindow(pX11IMData->statusWidget), - XNFocusWindow, XtWindow(w), + XNClientWindow, pX11IMData->statusWidget, + XNFocusWindow, w, XNInputStyle, active_styles, XNPreeditAttributes, preedit, XNStatusAttributes, status, @@ -1176,8 +1175,8 @@ createXIC(Widget w, X11InputMethodData *pX11IMData, } else { #endif /* XAWT */ pX11IMData->ic_active = XCreateIC(X11im, - XNClientWindow, XtWindow(w), - XNFocusWindow, XtWindow(w), + XNClientWindow, w, + XNFocusWindow, w, XNInputStyle, active_styles, XNPreeditAttributes, preedit, NULL); @@ -1187,15 +1186,15 @@ createXIC(Widget w, X11InputMethodData *pX11IMData, XFree((void *)preedit); #endif /* __linux__ */ pX11IMData->ic_passive = XCreateIC(X11im, - XNClientWindow, XtWindow(w), - XNFocusWindow, XtWindow(w), + XNClientWindow, w, + XNFocusWindow, w, XNInputStyle, passive_styles, NULL); } else { pX11IMData->ic_active = XCreateIC(X11im, - XNClientWindow, XtWindow(w), - XNFocusWindow, XtWindow(w), + XNClientWindow, w, + XNFocusWindow, w, XNInputStyle, active_styles, NULL); pX11IMData->ic_passive = pX11IMData->ic_active; @@ -1213,7 +1212,7 @@ createXIC(Widget w, X11InputMethodData *pX11IMData, { XIMCallback cb; cb.client_data = (XPointer) pX11IMData->x11inputmethod; - cb.callback = CommitStringCallback; + cb.callback = (XIMProc) CommitStringCallback; XSetICValues (pX11IMData->ic_active, XNCommitStringCallback, &cb, NULL); if (pX11IMData->ic_active != pX11IMData->ic_passive) { XSetICValues (pX11IMData->ic_passive, XNCommitStringCallback, &cb, NULL); @@ -1510,7 +1509,7 @@ Java_sun_awt_motif_MInputMethod_openXIMNative(JNIEnv *env, AWT_LOCK(); #ifdef XAWT - dpy = (Display *)display; + dpy = (Display *)jlong_to_ptr(display); #else dpy = awt_display; #endif @@ -1520,7 +1519,7 @@ Java_sun_awt_motif_MInputMethod_openXIMNative(JNIEnv *env, */ #ifdef __linux__ registered = XRegisterIMInstantiateCallback(dpy, NULL, NULL, - NULL, (XIMProc)OpenXIMCallback, NULL); + NULL, (XIDProc)OpenXIMCallback, NULL); if (!registered) { /* directly call openXIM callback */ #endif @@ -1555,7 +1554,7 @@ Java_sun_awt_motif_MInputMethod_createXICNative(JNIEnv *env, AWT_LOCK(); #ifdef XAWT - if (window == NULL) { + if (!window) { #else /* !XAWT */ if (JNU_IsNull(env, comp)) { #endif /* XAWT */ @@ -1664,7 +1663,7 @@ Java_sun_awt_motif_MInputMethod_reconfigureXICNative(JNIEnv *env, * On Solaris2.6, setXICWindowFocus() has to be invoked * before setting focus. */ - setXICWindowFocus(pX11IMData->current_ic, XtWindow(cdata->widget)); + setXICWindowFocus(pX11IMData->current_ic, cdata->widget); setXICFocus(pX11IMData->current_ic, True); } else { destroyX11InputMethodData((JNIEnv *) NULL, pX11IMData); @@ -1705,7 +1704,7 @@ Java_sun_awt_X11_XInputMethod_setXICFocusNative(JNIEnv *env, if (req) { #ifdef XAWT - if (w == NULL) { + if (!w) { AWT_UNLOCK(); return; } @@ -1738,10 +1737,10 @@ Java_sun_awt_X11_XInputMethod_setXICFocusNative(JNIEnv *env, #ifndef XAWT w = cdata->widget; #endif /* XAWT */ - setXICWindowFocus(pX11IMData->current_ic, XtWindow(w)); + setXICWindowFocus(pX11IMData->current_ic, w); setXICFocus(pX11IMData->current_ic, req); currentX11InputMethodInstance = pX11IMData->x11inputmethod; - currentFocusWindow = XtWindow(w); + currentFocusWindow = w; #ifdef __linux__ if (active && pX11IMData->statusWindow && pX11IMData->statusWindow->on) onoffStatusWindow(pX11IMData, w, True); diff --git a/jdk/src/solaris/native/sun/awt/awt_MToolkit.c b/jdk/src/solaris/native/sun/awt/awt_MToolkit.c index 744646cf38f..3a7c117b23b 100644 --- a/jdk/src/solaris/native/sun/awt/awt_MToolkit.c +++ b/jdk/src/solaris/native/sun/awt/awt_MToolkit.c @@ -2773,11 +2773,6 @@ Java_sun_awt_motif_MToolkit_init(JNIEnv *env, jobject this, } } - /* - scrollBugWorkAround = - (strcmp(XServerVendor(awt_display), "Sun Microsystems, Inc.") == 0 - && XVendorRelease(awt_display) == 3400); - */ scrollBugWorkAround = TRUE; /* diff --git a/jdk/src/solaris/native/sun/awt/awt_Robot.c b/jdk/src/solaris/native/sun/awt/awt_Robot.c index 59df59689dd..c3384b2eb1a 100644 --- a/jdk/src/solaris/native/sun/awt/awt_Robot.c +++ b/jdk/src/solaris/native/sun/awt/awt_Robot.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -165,41 +165,34 @@ static XImage *getWindowImage(Display * display, Window window, // this should be called from XRobotPeer constructor JNIEXPORT void JNICALL -Java_sun_awt_X11_XRobotPeer_setup (JNIEnv * env, jclass cls, jint numberOfButtons) { +Java_sun_awt_X11_XRobotPeer_setup (JNIEnv * env, jclass cls, jint numberOfButtons, jintArray buttonDownMasks) +{ int32_t xtestAvailable; + jint *tmp; + int i; DTRACE_PRINTLN("RobotPeer: setup()"); num_buttons = numberOfButtons; - - jclass inputEventClazz = (*env)->FindClass(env, "java/awt/event/InputEvent"); - jmethodID getButtonDownMasksID = (*env)->GetStaticMethodID(env, inputEventClazz, "getButtonDownMasks", "()[I"); - jintArray obj = (jintArray)(*env)->CallStaticObjectMethod(env, inputEventClazz, getButtonDownMasksID); - jint * tmp = (*env)->GetIntArrayElements(env, obj, JNI_FALSE); - - masks = (jint *)malloc(sizeof(jint) * num_buttons); + tmp = (*env)->GetIntArrayElements(env, buttonDownMasks, JNI_FALSE); + masks = (jint *)malloc(sizeof(jint) * num_buttons); if (masks == (jint *) NULL) { JNU_ThrowOutOfMemoryError((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2), NULL); - goto finally; + (*env)->ReleaseIntArrayElements(env, buttonDownMasks, tmp, 0); + return; } - - int i; for (i = 0; i < num_buttons; i++) { masks[i] = tmp[i]; } - (*env)->ReleaseIntArrayElements(env, obj, tmp, 0); - (*env)->DeleteLocalRef(env, obj); + (*env)->ReleaseIntArrayElements(env, buttonDownMasks, tmp, 0); AWT_LOCK(); xtestAvailable = isXTestAvailable(); DTRACE_PRINTLN1("RobotPeer: XTest available = %d", xtestAvailable); if (!xtestAvailable) { JNU_ThrowByName(env, "java/awt/AWTException", "java.awt.Robot requires your X server support the XTEST extension version 2.2"); - AWT_UNLOCK(); - return; } - finally: AWT_UNLOCK(); } diff --git a/jdk/src/solaris/native/sun/awt/awt_UNIXToolkit.c b/jdk/src/solaris/native/sun/awt/awt_UNIXToolkit.c index 3ee64ca57ea..a5993736b9b 100644 --- a/jdk/src/solaris/native/sun/awt/awt_UNIXToolkit.c +++ b/jdk/src/solaris/native/sun/awt/awt_UNIXToolkit.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +112,7 @@ jboolean _icon_upcall(JNIEnv *env, jobject this, GdkPixbuf *pixbuf) /* Copy the data array into a Java structure so we can pass it back. */ jbyteArray data = (*env)->NewByteArray(env, (row_stride * height)); (*env)->SetByteArrayRegion(env, data, 0, (row_stride * height), - pixbuf_data); + (jbyte *)pixbuf_data); /* Release the pixbuf. */ (*fp_g_object_unref)(pixbuf); diff --git a/jdk/src/solaris/native/sun/awt/fontpath.c b/jdk/src/solaris/native/sun/awt/fontpath.c index e7236e4a6ff..22157d35a4e 100644 --- a/jdk/src/solaris/native/sun/awt/fontpath.c +++ b/jdk/src/solaris/native/sun/awt/fontpath.c @@ -557,7 +557,8 @@ JNIEXPORT jstring JNICALL Java_sun_awt_X11FontManager_getFontPath #ifndef HEADLESS static int isSunXServer() { #ifdef __solaris__ - return (strcmp("Sun Microsystems, Inc.", ServerVendor(awt_display)) == 0 && + return ((strncmp(ServerVendor(awt_display), "Sun Microsystems, Inc.", 22) == 0) || + (strncmp(ServerVendor(awt_display), "Oracle Corporation", 18) == 0) && VendorRelease(awt_display) >= 6410); #else return 0; diff --git a/jdk/src/solaris/native/sun/awt/gtk2_interface.c b/jdk/src/solaris/native/sun/awt/gtk2_interface.c index a26a839d120..767fe47cf07 100644 --- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c +++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c @@ -607,6 +607,7 @@ gboolean gtk2_load() fp_gtk_tree_view_new = dl_symbol("gtk_tree_view_new"); fp_gtk_viewport_new = dl_symbol("gtk_viewport_new"); fp_gtk_window_new = dl_symbol("gtk_window_new"); + fp_gtk_window_present = dl_symbol("gtk_window_present"); fp_gtk_dialog_new = dl_symbol("gtk_dialog_new"); fp_gtk_frame_new = dl_symbol("gtk_frame_new"); diff --git a/jdk/src/solaris/native/sun/awt/gtk2_interface.h b/jdk/src/solaris/native/sun/awt/gtk2_interface.h index 3ecaf94af20..c7265bff4a7 100644 --- a/jdk/src/solaris/native/sun/awt/gtk2_interface.h +++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.h @@ -749,6 +749,7 @@ int (*fp_gdk_pixbuf_get_rowstride)(const GdkPixbuf *pixbuf); int (*fp_gdk_pixbuf_get_width)(const GdkPixbuf *pixbuf); GdkPixbuf *(*fp_gdk_pixbuf_new_from_file)(const char *filename, GError **error); void (*fp_gtk_widget_destroy)(GtkWidget *widget); +void (*fp_gtk_window_present)(GtkWindow *window); /** diff --git a/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c b/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c index 0af3bed3b4e..ce49713aadf 100644 --- a/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c +++ b/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -169,7 +169,8 @@ void mlib_v_ImageLookUp_S32_S16_1(const mlib_s32 * src, { mlib_s32 *sl; mlib_s16 *dl; - const mlib_s16 *tab = &table[0][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_s16 *tab = &table[0][shift]; mlib_s32 j, i; sl = (void *)src; @@ -209,6 +210,7 @@ void mlib_v_ImageLookUp_S32_S16_2(const mlib_s32 * src, { mlib_s32 *sl; mlib_s16 *dl; + mlib_u32 shift = 2147483648u; const mlib_s16 *tab; mlib_s32 j, i; @@ -220,8 +222,8 @@ void mlib_v_ImageLookUp_S32_S16_2(const mlib_s32 * src, mlib_s32 *sp = sl; mlib_s16 *dp = dl; mlib_s32 off, size = xsize * 2; - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; off = (mlib_s32) (((8 - ((mlib_addr) dp & 7)) & 7) >> 1); @@ -261,6 +263,7 @@ void mlib_v_ImageLookUp_S32_S16_4(const mlib_s32 * src, { mlib_s32 *sl; mlib_s16 *dl; + mlib_u32 shift = 2147483648u; const mlib_s16 *tab; mlib_s32 j; @@ -271,10 +274,10 @@ void mlib_v_ImageLookUp_S32_S16_4(const mlib_s32 * src, for (j = 0; j < ysize; j++) { mlib_s32 *sp = sl; mlib_s16 *dp = dl; - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_s16 *tab2 = &table[2][(mlib_u32) 2147483648u]; - const mlib_s16 *tab3 = &table[3][(mlib_u32) 2147483648u]; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; + const mlib_s16 *tab2 = &table[2][shift]; + const mlib_s16 *tab3 = &table[3][shift]; mlib_s32 off, size = xsize * 4; off = (mlib_s32) (((8 - ((mlib_addr) dp & 7)) & 7) >> 1); @@ -453,6 +456,7 @@ void mlib_v_ImageLookUp_S32_S16_3(const mlib_s32 * src, { mlib_s32 *sl; mlib_s16 *dl; + mlib_u32 shift = 2147483648u; const mlib_s16 *tab; mlib_s32 j, i; @@ -463,9 +467,9 @@ void mlib_v_ImageLookUp_S32_S16_3(const mlib_s32 * src, for (j = 0; j < ysize; j++) { mlib_s32 *sp = sl; mlib_s16 *dp = dl; - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_s16 *tab2 = &table[2][(mlib_u32) 2147483648u]; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; + const mlib_s16 *tab2 = &table[2][shift]; mlib_s32 off, size = xsize * 3; off = (mlib_s32) (((8 - ((mlib_addr) dp & 7)) & 7) >> 1); diff --git a/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c b/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c index c68e1209a2c..aa320f6ee0f 100644 --- a/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c +++ b/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -170,7 +170,8 @@ void mlib_v_ImageLookUp_S32_U16_1(const mlib_s32 *src, { mlib_s32 *sl; mlib_u16 *dl; - const mlib_u16 *tab = &table[0][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_u16 *tab = &table[0][shift]; mlib_s32 j, i; sl = (void *)src; @@ -211,6 +212,7 @@ void mlib_v_ImageLookUp_S32_U16_2(const mlib_s32 *src, { mlib_s32 *sl; mlib_u16 *dl; + mlib_u32 shift = 2147483648u; const mlib_u16 *tab; mlib_s32 j, i; @@ -222,8 +224,8 @@ void mlib_v_ImageLookUp_S32_U16_2(const mlib_s32 *src, mlib_s32 *sp = sl; mlib_u16 *dp = dl; mlib_s32 off, size = xsize * 2; - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; off = (mlib_s32) (((8 - ((mlib_addr) dp & 7)) & 7) >> 1); @@ -264,6 +266,7 @@ void mlib_v_ImageLookUp_S32_U16_4(const mlib_s32 *src, { mlib_s32 *sl; mlib_u16 *dl; + mlib_u32 shift = 2147483648u; const mlib_u16 *tab; mlib_s32 j; @@ -274,10 +277,10 @@ void mlib_v_ImageLookUp_S32_U16_4(const mlib_s32 *src, for (j = 0; j < ysize; j++) { mlib_s32 *sp = sl; mlib_u16 *dp = dl; - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_u16 *tab2 = &table[2][(mlib_u32) 2147483648u]; - const mlib_u16 *tab3 = &table[3][(mlib_u32) 2147483648u]; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; + const mlib_u16 *tab2 = &table[2][shift]; + const mlib_u16 *tab3 = &table[3][shift]; mlib_s32 off, size = xsize * 4; off = (mlib_s32) (((8 - ((mlib_addr) dp & 7)) & 7) >> 1); @@ -457,6 +460,7 @@ void mlib_v_ImageLookUp_S32_U16_3(const mlib_s32 *src, { mlib_s32 *sl; mlib_u16 *dl; + mlib_u32 shift = 2147483648u; const mlib_u16 *tab; mlib_s32 j, i; @@ -467,9 +471,9 @@ void mlib_v_ImageLookUp_S32_U16_3(const mlib_s32 *src, for (j = 0; j < ysize; j++) { mlib_s32 *sp = sl; mlib_u16 *dp = dl; - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_u16 *tab2 = &table[2][(mlib_u32) 2147483648u]; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; + const mlib_u16 *tab2 = &table[2][shift]; mlib_s32 off, size = xsize * 3; off = (mlib_s32) (((8 - ((mlib_addr) dp & 7)) & 7) >> 1); diff --git a/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c b/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c index d9988938d06..8ca5c9659b5 100644 --- a/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c +++ b/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,8 +81,9 @@ void mlib_v_ImageLookUpSI_S32_S16_2_DstA8D1(const mlib_s32 *src, mlib_d64 t0, t1, t2; /* destination data */ mlib_d64 t3, acc; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; sp = (void *)src; dl = dst; @@ -145,8 +146,9 @@ void mlib_v_ImageLookUpSI_S32_S16_2_D1(const mlib_s32 *src, mlib_d64 t0, t1, t2; /* destination data */ mlib_d64 t3, acc; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; sp = (void *)src; dl = dst; @@ -220,8 +222,9 @@ void mlib_v_ImageLookUpSI_S32_S16_2(const mlib_s32 *src, mlib_s32 *sl; mlib_s16 *dl; mlib_s32 j; - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; sl = (void *)src; dl = dst; @@ -268,9 +271,10 @@ void mlib_v_ImageLookUpSI_S32_S16_3_D1(const mlib_s32 *src, mlib_d64 t0, t1, t2, t3; /* destination data */ mlib_d64 acc0, acc1, acc2; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_s16 *tab2 = &table[2][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; + const mlib_s16 *tab2 = &table[2][shift]; mlib_s32 s00, s01, s02, s03; sp = (void *)src; @@ -379,9 +383,10 @@ void mlib_v_ImageLookUpSI_S32_S16_3(const mlib_s32 *src, mlib_s32 *sl; mlib_s16 *dl; mlib_s32 i, j; - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_s16 *tab2 = &table[2][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; + const mlib_s16 *tab2 = &table[2][shift]; sl = (void *)src; dl = dst; @@ -425,10 +430,11 @@ void mlib_v_ImageLookUpSI_S32_S16_4_DstOff0_D1(const mlib_s32 *src, mlib_d64 t0, t1, t2, t3; /* destination data */ mlib_d64 acc; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_s16 *tab2 = &table[2][(mlib_u32) 2147483648u]; - const mlib_s16 *tab3 = &table[3][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; + const mlib_s16 *tab2 = &table[2][shift]; + const mlib_s16 *tab3 = &table[3][shift]; sp = (void *)src; dl = dst; @@ -479,10 +485,11 @@ void mlib_v_ImageLookUpSI_S32_S16_4_DstOff1_D1(const mlib_s32 *src, mlib_d64 t0, t1, t2, t3; /* destination data */ mlib_d64 acc; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_s16 *tab2 = &table[2][(mlib_u32) 2147483648u]; - const mlib_s16 *tab3 = &table[3][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; + const mlib_s16 *tab2 = &table[2][shift]; + const mlib_s16 *tab3 = &table[3][shift]; sp = (void *)src; dl = dst; @@ -543,10 +550,11 @@ void mlib_v_ImageLookUpSI_S32_S16_4_DstOff2_D1(const mlib_s32 *src, mlib_d64 t0, t1, t2, t3; /* destination data */ mlib_d64 acc; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_s16 *tab2 = &table[2][(mlib_u32) 2147483648u]; - const mlib_s16 *tab3 = &table[3][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; + const mlib_s16 *tab2 = &table[2][shift]; + const mlib_s16 *tab3 = &table[3][shift]; sp = (void *)src; dl = dst; @@ -606,10 +614,11 @@ void mlib_v_ImageLookUpSI_S32_S16_4_DstOff3_D1(const mlib_s32 *src, mlib_d64 t0, t1, t2, t3; /* destination data */ mlib_d64 acc; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_s16 *tab2 = &table[2][(mlib_u32) 2147483648u]; - const mlib_s16 *tab3 = &table[3][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; + const mlib_s16 *tab2 = &table[2][shift]; + const mlib_s16 *tab3 = &table[3][shift]; sp = (void *)src; dl = dst; @@ -667,9 +676,10 @@ void mlib_v_ImageLookUpSI_S32_S16_4(const mlib_s32 *src, mlib_s32 *sl; mlib_s16 *dl; mlib_s32 j; - const mlib_s16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_s16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_s16 *tab2 = &table[2][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_s16 *tab0 = &table[0][shift]; + const mlib_s16 *tab1 = &table[1][shift]; + const mlib_s16 *tab2 = &table[2][shift]; sl = (void *)src; dl = dst; diff --git a/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c b/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c index ebe71f34943..7c4405a0972 100644 --- a/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c +++ b/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,8 +81,9 @@ void mlib_v_ImageLookUpSI_S32_U16_2_DstA8D1(const mlib_s32 *src, mlib_d64 t0, t1, t2; /* destination data */ mlib_d64 t3, acc; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; sp = (void *)src; dl = dst; @@ -145,8 +146,9 @@ void mlib_v_ImageLookUpSI_S32_U16_2_D1(const mlib_s32 *src, mlib_d64 t0, t1, t2; /* destination data */ mlib_d64 t3, acc; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; sp = (void *)src; dl = dst; @@ -220,8 +222,9 @@ void mlib_v_ImageLookUpSI_S32_U16_2(const mlib_s32 *src, mlib_s32 *sl; mlib_u16 *dl; mlib_s32 j; - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; sl = (void *)src; dl = dst; @@ -268,9 +271,10 @@ void mlib_v_ImageLookUpSI_S32_U16_3_D1(const mlib_s32 *src, mlib_d64 t0, t1, t2, t3; /* destination data */ mlib_d64 acc0, acc1, acc2; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_u16 *tab2 = &table[2][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; + const mlib_u16 *tab2 = &table[2][shift]; mlib_s32 s00, s01, s02, s03; sp = (void *)src; @@ -379,9 +383,10 @@ void mlib_v_ImageLookUpSI_S32_U16_3(const mlib_s32 *src, mlib_s32 *sl; mlib_u16 *dl; mlib_s32 i, j; - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_u16 *tab2 = &table[2][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; + const mlib_u16 *tab2 = &table[2][shift]; sl = (void *)src; dl = dst; @@ -425,10 +430,11 @@ void mlib_v_ImageLookUpSI_S32_U16_4_DstOff0_D1(const mlib_s32 *src, mlib_d64 t0, t1, t2, t3; /* destination data */ mlib_d64 acc; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_u16 *tab2 = &table[2][(mlib_u32) 2147483648u]; - const mlib_u16 *tab3 = &table[3][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; + const mlib_u16 *tab2 = &table[2][shift]; + const mlib_u16 *tab3 = &table[3][shift]; sp = (void *)src; dl = dst; @@ -479,10 +485,11 @@ void mlib_v_ImageLookUpSI_S32_U16_4_DstOff1_D1(const mlib_s32 *src, mlib_d64 t0, t1, t2, t3; /* destination data */ mlib_d64 acc; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_u16 *tab2 = &table[2][(mlib_u32) 2147483648u]; - const mlib_u16 *tab3 = &table[3][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; + const mlib_u16 *tab2 = &table[2][shift]; + const mlib_u16 *tab3 = &table[3][shift]; sp = (void *)src; dl = dst; @@ -543,10 +550,11 @@ void mlib_v_ImageLookUpSI_S32_U16_4_DstOff2_D1(const mlib_s32 *src, mlib_d64 t0, t1, t2, t3; /* destination data */ mlib_d64 acc; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_u16 *tab2 = &table[2][(mlib_u32) 2147483648u]; - const mlib_u16 *tab3 = &table[3][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; + const mlib_u16 *tab2 = &table[2][shift]; + const mlib_u16 *tab3 = &table[3][shift]; sp = (void *)src; dl = dst; @@ -606,10 +614,11 @@ void mlib_v_ImageLookUpSI_S32_U16_4_DstOff3_D1(const mlib_s32 *src, mlib_d64 t0, t1, t2, t3; /* destination data */ mlib_d64 acc; /* destination data */ mlib_s32 i; /* loop variable */ - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_u16 *tab2 = &table[2][(mlib_u32) 2147483648u]; - const mlib_u16 *tab3 = &table[3][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; + const mlib_u16 *tab2 = &table[2][shift]; + const mlib_u16 *tab3 = &table[3][shift]; sp = (void *)src; dl = dst; @@ -667,9 +676,10 @@ void mlib_v_ImageLookUpSI_S32_U16_4(const mlib_s32 *src, mlib_s32 *sl; mlib_u16 *dl; mlib_s32 j; - const mlib_u16 *tab0 = &table[0][(mlib_u32) 2147483648u]; - const mlib_u16 *tab1 = &table[1][(mlib_u32) 2147483648u]; - const mlib_u16 *tab2 = &table[2][(mlib_u32) 2147483648u]; + mlib_u32 shift = 2147483648u; + const mlib_u16 *tab0 = &table[0][shift]; + const mlib_u16 *tab1 = &table[1][shift]; + const mlib_u16 *tab2 = &table[2][shift]; sl = (void *)src; dl = dst; diff --git a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c index 0c26096e580..63addde831c 100644 --- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c +++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c @@ -4,13 +4,29 @@ #include #include "gtk2_interface.h" #include "sun_awt_X11_GtkFileDialogPeer.h" +#include "debug_assert.h" static JavaVM *jvm; -static GtkWidget *dialog = NULL; /* To cache some method IDs */ static jmethodID filenameFilterCallbackMethodID = NULL; static jmethodID setFileInternalMethodID = NULL; +static jfieldID widgetFieldID = NULL; + +JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_initIDs +(JNIEnv *env, jclass cx) +{ + filenameFilterCallbackMethodID = (*env)->GetMethodID(env, cx, + "filenameFilterCallback", "(Ljava/lang/String;)Z"); + DASSERT(filenameFilterCallbackMethodID != NULL); + + setFileInternalMethodID = (*env)->GetMethodID(env, cx, + "setFileInternal", "(Ljava/lang/String;[Ljava/lang/String;)V"); + DASSERT(setFileInternalMethodID != NULL); + + widgetFieldID = (*env)->GetFieldID(env, cx, "widget", "J"); + DASSERT(widgetFieldID != NULL); +} static gboolean filenameFilterCallback(const GtkFileFilterInfo * filter_info, gpointer obj) { @@ -20,30 +36,17 @@ static gboolean filenameFilterCallback(const GtkFileFilterInfo * filter_info, gp env = (JNIEnv *) JNU_GetEnv(jvm, JNI_VERSION_1_2); - if (filenameFilterCallbackMethodID == NULL) { - cx = (*env)->GetObjectClass(env, (jobject) obj); - if (cx == NULL) { - JNU_ThrowInternalError(env, "Could not get file filter class"); - return 0; - } - - filenameFilterCallbackMethodID = (*env)->GetMethodID(env, cx, - "filenameFilterCallback", "(Ljava/lang/String;)Z"); - if (filenameFilterCallbackMethodID == NULL) { - JNU_ThrowInternalError(env, - "Could not get filenameFilterCallback method id"); - return 0; - } - } - filename = (*env)->NewStringUTF(env, filter_info->filename); return (*env)->CallBooleanMethod(env, obj, filenameFilterCallbackMethodID, filename); } -static void quit(gboolean isSignalHandler) +static void quit(JNIEnv * env, jobject jpeer, gboolean isSignalHandler) { + GtkWidget * dialog = (GtkWidget*)jlong_to_ptr( + (*env)->GetLongField(env, jpeer, widgetFieldID)); + if (dialog != NULL) { // Callbacks from GTK signals are made within the GTK lock @@ -57,7 +60,8 @@ static void quit(gboolean isSignalHandler) fp_gtk_widget_destroy (dialog); fp_gtk_main_quit (); - dialog = NULL; + + (*env)->SetLongField(env, jpeer, widgetFieldID, 0); if (!isSignalHandler) { fp_gdk_threads_leave(); @@ -73,7 +77,29 @@ static void quit(gboolean isSignalHandler) JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_quit (JNIEnv * env, jobject jpeer) { - quit(FALSE); + quit(env, jpeer, FALSE); +} + +/* + * Class: sun_awt_X11_GtkFileDialogPeer + * Method: toFront + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_toFront +(JNIEnv * env, jobject jpeer) +{ + GtkWidget * dialog; + + fp_gdk_threads_enter(); + + dialog = (GtkWidget*)jlong_to_ptr( + (*env)->GetLongField(env, jpeer, widgetFieldID)); + + if (dialog != NULL) { + fp_gtk_window_present((GtkWindow*)dialog); + } + + fp_gdk_threads_leave(); } /** @@ -132,24 +158,8 @@ static void handle_response(GtkWidget* aDialog, gint responseId, gpointer obj) if (responseId == GTK_RESPONSE_ACCEPT) { current_folder = fp_gtk_file_chooser_get_current_folder( - GTK_FILE_CHOOSER(dialog)); - filenames = fp_gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog)); - } - - if (setFileInternalMethodID == NULL) { - cx = (*env)->GetObjectClass(env, (jobject) obj); - if (cx == NULL) { - JNU_ThrowInternalError(env, "Could not get GTK peer class"); - return; - } - - setFileInternalMethodID = (*env)->GetMethodID(env, cx, - "setFileInternal", "(Ljava/lang/String;[Ljava/lang/String;)V"); - if (setFileInternalMethodID == NULL) { - JNU_ThrowInternalError(env, - "Could not get setFileInternalMethodID method id"); - return; - } + GTK_FILE_CHOOSER(aDialog)); + filenames = fp_gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(aDialog)); } jcurrent_folder = (*env)->NewStringUTF(env, current_folder); @@ -159,7 +169,7 @@ static void handle_response(GtkWidget* aDialog, gint responseId, gpointer obj) jfilenames); fp_g_free(current_folder); - quit(TRUE); + quit(env, (jobject)obj, TRUE); } /* @@ -172,6 +182,7 @@ Java_sun_awt_X11_GtkFileDialogPeer_run(JNIEnv * env, jobject jpeer, jstring jtitle, jint mode, jstring jdir, jstring jfile, jobject jfilter, jboolean multiple) { + GtkWidget *dialog = NULL; GtkFileFilter *filter; if (jvm == NULL) { @@ -180,7 +191,7 @@ Java_sun_awt_X11_GtkFileDialogPeer_run(JNIEnv * env, jobject jpeer, fp_gdk_threads_enter(); - const char *title = (*env)->GetStringUTFChars(env, jtitle, 0); + const char *title = jtitle == NULL? "": (*env)->GetStringUTFChars(env, jtitle, 0); if (mode == 1) { /* Save action */ @@ -201,7 +212,9 @@ Java_sun_awt_X11_GtkFileDialogPeer_run(JNIEnv * env, jobject jpeer, } } - (*env)->ReleaseStringUTFChars(env, jtitle, title); + if (jtitle != NULL) { + (*env)->ReleaseStringUTFChars(env, jtitle, title); + } /* Set the directory */ if (jdir != NULL) { @@ -233,8 +246,12 @@ Java_sun_awt_X11_GtkFileDialogPeer_run(JNIEnv * env, jobject jpeer, fp_g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK( handle_response), jpeer); + + (*env)->SetLongField(env, jpeer, widgetFieldID, ptr_to_jlong(dialog)); + fp_gtk_widget_show(dialog); fp_gtk_main(); fp_gdk_threads_leave(); } + diff --git a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.h b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.h index 91334b4ebee..81ed11ae555 100644 --- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.h +++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.h @@ -9,6 +9,14 @@ extern "C" { #endif +/* + * Class: sun_awt_X11_GtkFileDialogPeer + * Method: initIDs + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_initIDs +(JNIEnv *, jclass); + /* * Class: sun_awt_X11_GtkFileDialogPeer * Method: run @@ -25,6 +33,14 @@ JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_run JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_quit (JNIEnv *, jobject); +/* + * Class: sun_awt_X11_GtkFileDialogPeer + * Method: toFront + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_toFront +(JNIEnv *, jobject); + #ifdef __cplusplus } #endif diff --git a/jdk/src/solaris/native/sun/awt/swing_GTKStyle.c b/jdk/src/solaris/native/sun/awt/swing_GTKStyle.c index 657938c1e7d..9d24eb44973 100644 --- a/jdk/src/solaris/native/sun/awt/swing_GTKStyle.c +++ b/jdk/src/solaris/native/sun/awt/swing_GTKStyle.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/sun/java2d/loops/java2d_Mlib.c b/jdk/src/solaris/native/sun/java2d/loops/java2d_Mlib.c index d35839cf6a9..d6596eef77f 100644 --- a/jdk/src/solaris/native/sun/java2d/loops/java2d_Mlib.c +++ b/jdk/src/solaris/native/sun/java2d/loops/java2d_Mlib.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -282,6 +282,50 @@ DEFINE_XOR_SPANS(XorSpans, AnyShort, 1) /***************************************************************/ +#define DEFINE_SET_PGRAM(FUNC, ANYTYPE, NCHAN) \ +void ADD_SUFF(ANYTYPE##FUNC)(SurfaceDataRasInfo *pRasInfo, \ + jint lox, jint loy, \ + jint hix, jint hiy, \ + jlong leftx, jlong dleftx, \ + jlong rightx, jlong drightx, \ + jint pixel, NativePrimitive * pPrim, \ + CompositeInfo * pCompInfo) \ +{ \ + mlib_image dst[1]; \ + mlib_s32 dstScan = pRasInfo->scanStride; \ + mlib_u8 *dstBase = (mlib_u8*)(pRasInfo->rasBase), *pdst; \ + mlib_s32 c_arr[4]; \ + \ + STORE_CONST_##NCHAN(c_arr, pixel); \ + pdst = dstBase + loy*dstScan; \ + \ + while (loy < hiy) { \ + jint lx = WholeOfLong(leftx); \ + jint rx = WholeOfLong(rightx); \ + if (lx < lox) lx = lox; \ + if (rx > hix) rx = hix; \ + \ + MLIB_IMAGE_SET(dst, MLIB_##ANYTYPE, NCHAN_##ANYTYPE, \ + rx-lx, 1, dstScan, \ + pdst + lx*ANYTYPE##PixelStride); \ + \ + mlib_ImageClear(dst, c_arr); \ + \ + pdst = PtrAddBytes(pdst, dstScan); \ + leftx += dleftx; \ + rightx += drightx; \ + loy++; \ + } \ +} + +DEFINE_SET_PGRAM(SetParallelogram, Any3Byte, 3) +DEFINE_SET_PGRAM(SetParallelogram, Any4Byte, 4) +DEFINE_SET_PGRAM(SetParallelogram, AnyByte, 1) +DEFINE_SET_PGRAM(SetParallelogram, AnyInt, 1) +DEFINE_SET_PGRAM(SetParallelogram, AnyShort, 1) + +/***************************************************************/ + #define SCALE_COPY(index, chan) \ pDst[chan] = pSrc[index] diff --git a/jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c b/jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c index ab520919efb..0bc52cbfab3 100644 --- a/jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c +++ b/jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +51,7 @@ DEF_FUNC(AnyByteIsomorphicXorCopy) DEF_FUNC(AnyByteSetLine) DEF_FUNC(AnyByteSetRect) DEF_FUNC(AnyByteSetSpans) +DEF_FUNC(AnyByteSetParallelogram) DEF_FUNC(AnyByteXorLine) DEF_FUNC(AnyByteXorRect) DEF_FUNC(AnyByteXorSpans) @@ -62,6 +63,7 @@ DEF_FUNC(AnyShortIsomorphicXorCopy) DEF_FUNC(AnyShortSetLine) DEF_FUNC(AnyShortSetRect) DEF_FUNC(AnyShortSetSpans) +DEF_FUNC(AnyShortSetParallelogram) DEF_FUNC(AnyShortXorLine) DEF_FUNC(AnyShortXorRect) DEF_FUNC(AnyShortXorSpans) @@ -73,6 +75,7 @@ DEF_FUNC(Any3ByteIsomorphicXorCopy) DEF_FUNC(Any3ByteSetLine) DEF_FUNC(Any3ByteSetRect) DEF_FUNC(Any3ByteSetSpans) +DEF_FUNC(Any3ByteSetParallelogram) DEF_FUNC(Any3ByteXorLine) DEF_FUNC(Any3ByteXorRect) DEF_FUNC(Any3ByteXorSpans) @@ -84,6 +87,7 @@ DEF_FUNC(Any4ByteIsomorphicXorCopy) DEF_FUNC(Any4ByteSetLine) DEF_FUNC(Any4ByteSetRect) DEF_FUNC(Any4ByteSetSpans) +DEF_FUNC(Any4ByteSetParallelogram) DEF_FUNC(Any4ByteXorLine) DEF_FUNC(Any4ByteXorRect) DEF_FUNC(Any4ByteXorSpans) @@ -95,6 +99,7 @@ DEF_FUNC(AnyIntIsomorphicXorCopy) DEF_FUNC(AnyIntSetLine) DEF_FUNC(AnyIntSetRect) DEF_FUNC(AnyIntSetSpans) +DEF_FUNC(AnyIntSetParallelogram) DEF_FUNC(AnyIntXorLine) DEF_FUNC(AnyIntXorRect) DEF_FUNC(AnyIntXorSpans) @@ -513,6 +518,7 @@ static AnyFunc_pair vis_func_pair_array[] = { ADD_FUNC(AnyByteSetLine), ADD_FUNC(AnyByteSetRect), ADD_FUNC(AnyByteSetSpans), + ADD_FUNC(AnyByteSetParallelogram), ADD_FUNC(AnyByteXorLine), ADD_FUNC(AnyByteXorRect), ADD_FUNC(AnyByteXorSpans), @@ -524,6 +530,7 @@ static AnyFunc_pair vis_func_pair_array[] = { ADD_FUNC(AnyShortSetLine), ADD_FUNC(AnyShortSetRect), ADD_FUNC(AnyShortSetSpans), + ADD_FUNC(AnyShortSetParallelogram), ADD_FUNC(AnyShortXorLine), ADD_FUNC(AnyShortXorRect), ADD_FUNC(AnyShortXorSpans), @@ -533,6 +540,7 @@ static AnyFunc_pair vis_func_pair_array[] = { ADD_FUNC(Any3ByteSetLine), ADD_FUNC(Any3ByteSetRect), ADD_FUNC(Any3ByteSetSpans), + ADD_FUNC(Any3ByteSetParallelogram), ADD_FUNC(Any3ByteXorLine), ADD_FUNC(Any3ByteXorRect), ADD_FUNC(Any3ByteXorSpans), @@ -544,6 +552,7 @@ static AnyFunc_pair vis_func_pair_array[] = { ADD_FUNC(Any4ByteSetLine), ADD_FUNC(Any4ByteSetRect), ADD_FUNC(Any4ByteSetSpans), + ADD_FUNC(Any4ByteSetParallelogram), ADD_FUNC(Any4ByteXorLine), ADD_FUNC(Any4ByteXorRect), ADD_FUNC(Any4ByteXorSpans), @@ -555,6 +564,7 @@ static AnyFunc_pair vis_func_pair_array[] = { ADD_FUNC(AnyIntSetLine), ADD_FUNC(AnyIntSetRect), ADD_FUNC(AnyIntSetSpans), + ADD_FUNC(AnyIntSetParallelogram), ADD_FUNC(AnyIntXorLine), ADD_FUNC(AnyIntXorRect), ADD_FUNC(AnyIntXorSpans), diff --git a/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c b/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c index 7eb84eb1e5f..2b142c46c48 100644 --- a/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c +++ b/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgbPre_Mask.c @@ -517,13 +517,15 @@ void ADD_SUFF(IntArgbPreSrcMaskFill)(void *rasBase, ADD_SUFF(AnyIntSetRect)(pRasInfo, 0, 0, width, height, fgColor, pPrim, pCompInfo); #else + void *pBase = pRasInfo->rasBase; + pRasInfo->rasBase = rasBase; if (cnstA != 0xff) { fgColor = (cnstA << 24) | (cnstR << 16) | (cnstG << 8) | cnstB; } ADD_SUFF(AnyIntSetRect)(pRasInfo, - pRasInfo->bounds.x1, pRasInfo->bounds.y1, - pRasInfo->bounds.x2, pRasInfo->bounds.y2, + 0, 0, width, height, fgColor, pPrim, pCompInfo); + pRasInfo->rasBase = pBase; #endif return; } @@ -582,11 +584,13 @@ void ADD_SUFF(FourByteAbgrPreSrcMaskFill)(void *rasBase, } if (pMask == NULL) { + void *pBase = pRasInfo->rasBase; + pRasInfo->rasBase = rasBase; fgColor = (cnstR << 24) | (cnstG << 16) | (cnstB << 8) | cnstA; ADD_SUFF(Any4ByteSetRect)(pRasInfo, - pRasInfo->bounds.x1, pRasInfo->bounds.y1, - pRasInfo->bounds.x2, pRasInfo->bounds.y2, + 0, 0, width, height, fgColor, pPrim, pCompInfo); + pRasInfo->rasBase = pBase; return; } diff --git a/jdk/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c b/jdk/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c index f5bf5c46e49..170ab458d80 100644 --- a/jdk/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c +++ b/jdk/src/solaris/native/sun/java2d/loops/vis_SrcMaskFill.c @@ -150,10 +150,12 @@ void ADD_SUFF(IntArgbSrcMaskFill)(void *rasBase, } if (pMask == NULL) { + void *pBase = pRasInfo->rasBase; + pRasInfo->rasBase = rasBase; ADD_SUFF(AnyIntSetRect)(pRasInfo, - pRasInfo->bounds.x1, pRasInfo->bounds.y1, - pRasInfo->bounds.x2, pRasInfo->bounds.y2, + 0, 0, width, height, fgColor, pPrim, pCompInfo); + pRasInfo->rasBase = pBase; return; } @@ -214,15 +216,17 @@ void ADD_SUFF(FourByteAbgrSrcMaskFill)(void *rasBase, cnstB = (fgColor ) & 0xff; if (pMask == NULL) { + void *pBase = pRasInfo->rasBase; + pRasInfo->rasBase = rasBase; if (cnstA == 0) { fgColor = 0; } else { fgColor = (fgColor << 8) | cnstA; } ADD_SUFF(Any4ByteSetRect)(pRasInfo, - pRasInfo->bounds.x1, pRasInfo->bounds.y1, - pRasInfo->bounds.x2, pRasInfo->bounds.y2, + 0, 0, width, height, fgColor, pPrim, pCompInfo); + pRasInfo->rasBase = pBase; return; } @@ -390,10 +394,12 @@ void ADD_SUFF(IntRgbSrcMaskFill)(void *rasBase, if (cnstA == 0) fgColor = 0; if (pMask == NULL) { + void *pBase = pRasInfo->rasBase; + pRasInfo->rasBase = rasBase; ADD_SUFF(AnyIntSetRect)(pRasInfo, - pRasInfo->bounds.x1, pRasInfo->bounds.y1, - pRasInfo->bounds.x2, pRasInfo->bounds.y2, + 0, 0, width, height, fgColor, pPrim, pCompInfo); + pRasInfo->rasBase = pBase; return; } @@ -458,10 +464,12 @@ void ADD_SUFF(IntBgrSrcMaskFill)(void *rasBase, } if (pMask == NULL) { + void *pBase = pRasInfo->rasBase; + pRasInfo->rasBase = rasBase; ADD_SUFF(AnyIntSetRect)(pRasInfo, - pRasInfo->bounds.x1, pRasInfo->bounds.y1, - pRasInfo->bounds.x2, pRasInfo->bounds.y2, + 0, 0, width, height, fgColor, pPrim, pCompInfo); + pRasInfo->rasBase = pBase; return; } @@ -526,10 +534,12 @@ void ADD_SUFF(ThreeByteBgrSrcMaskFill)(void *rasBase, } if (pMask == NULL) { + void *pBase = pRasInfo->rasBase; + pRasInfo->rasBase = rasBase; ADD_SUFF(Any3ByteSetRect)(pRasInfo, - pRasInfo->bounds.x1, pRasInfo->bounds.y1, - pRasInfo->bounds.x2, pRasInfo->bounds.y2, + 0, 0, width, height, fgColor, pPrim, pCompInfo); + pRasInfo->rasBase = pBase; return; } diff --git a/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c b/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c index 3c20b825b56..76c8c8bc3ed 100644 --- a/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c +++ b/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/sun/java2d/x11/X11SurfaceData.c b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c index ab51bd259c4..7b1d717008f 100644 --- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c +++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/sun/java2d/x11/X11SurfaceData.h b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h index f5e074bff64..818688e31e7 100644 --- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h +++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/sun/net/sdp/SdpSupport.c b/jdk/src/solaris/native/sun/net/sdp/SdpSupport.c index 65fce3ebeff..6da4592144b 100644 --- a/jdk/src/solaris/native/sun/net/sdp/SdpSupport.c +++ b/jdk/src/solaris/native/sun/net/sdp/SdpSupport.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/sun/net/spi/DefaultProxySelector.c b/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c index 6c22e231602..18313bb2dca 100644 --- a/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c +++ b/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/sun/nio/ch/FileChannelImpl.c b/jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c index c570fe1bc3e..539013f0bd7 100644 --- a/jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c +++ b/jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c @@ -35,48 +35,17 @@ #include "nio_util.h" #include -static jfieldID chan_fd; /* jobject 'fd' in sun.io.FileChannelImpl */ - -#ifdef __solaris__ -typedef struct sendfilevec64 { - int sfv_fd; /* input fd */ - uint_t sfv_flag; /* Flags. see below */ - off64_t sfv_off; /* offset to start reading from */ - size_t sfv_len; /* amount of data */ -} sendfilevec_t; - -/* Function pointer for sendfilev on Solaris 8+ */ -typedef ssize_t sendfile_func(int fildes, const struct sendfilevec64 *vec, - int sfvcnt, size_t *xferred); - -sendfile_func* my_sendfile_func = NULL; -#endif - -#ifdef __linux__ +#if defined(__linux__) || defined(__solaris__) #include - -/* Function pointer for sendfile64 on Linux 2.6 (and newer 2.4 kernels) */ -typedef ssize_t sendfile64_func(int out_fd, int in_fd, off64_t *offset, size_t count); - -sendfile64_func* my_sendfile64_func = NULL; #endif +static jfieldID chan_fd; /* jobject 'fd' in sun.io.FileChannelImpl */ + JNIEXPORT jlong JNICALL Java_sun_nio_ch_FileChannelImpl_initIDs(JNIEnv *env, jclass clazz) { jlong pageSize = sysconf(_SC_PAGESIZE); chan_fd = (*env)->GetFieldID(env, clazz, "fd", "Ljava/io/FileDescriptor;"); - -#ifdef __solaris__ - if (dlopen("/usr/lib/libsendfile.so.1", RTLD_GLOBAL | RTLD_LAZY) != NULL) { - my_sendfile_func = (sendfile_func*) dlsym(RTLD_DEFAULT, "sendfilev64"); - } -#endif - -#ifdef __linux__ - my_sendfile64_func = (sendfile64_func*) dlsym(RTLD_DEFAULT, "sendfile64"); -#endif - return pageSize; } @@ -178,22 +147,9 @@ Java_sun_nio_ch_FileChannelImpl_transferTo0(JNIEnv *env, jobject this, jlong position, jlong count, jint dstFD) { -#ifdef __linux__ - jlong max = (jlong)java_lang_Integer_MAX_VALUE; - jlong n; - - if (my_sendfile64_func == NULL) { - off_t offset; - if (position > max) - return IOS_UNSUPPORTED_CASE; - if (count > max) - count = max; - offset = (off_t)position; - n = sendfile(dstFD, srcFD, &offset, (size_t)count); - } else { - off64_t offset = (off64_t)position; - n = (*my_sendfile64_func)(dstFD, srcFD, &offset, (size_t)count); - } +#if defined(__linux__) + off64_t offset = (off64_t)position; + jlong n = sendfile64(dstFD, srcFD, &offset, (size_t)count); if (n < 0) { if (errno == EAGAIN) return IOS_UNAVAILABLE; @@ -206,41 +162,37 @@ Java_sun_nio_ch_FileChannelImpl_transferTo0(JNIEnv *env, jobject this, return IOS_THROWN; } return n; -#endif +#elif defined (__solaris__) + sendfilevec64_t sfv; + size_t numBytes = 0; + jlong result; -#ifdef __solaris__ - if (my_sendfile_func == NULL) { - return IOS_UNSUPPORTED; - } else { - sendfilevec_t sfv; - size_t numBytes = 0; - jlong result; + sfv.sfv_fd = srcFD; + sfv.sfv_flag = 0; + sfv.sfv_off = (off64_t)position; + sfv.sfv_len = count; - sfv.sfv_fd = srcFD; - sfv.sfv_flag = 0; - sfv.sfv_off = (off64_t)position; - sfv.sfv_len = count; + result = sendfilev64(dstFD, &sfv, 1, &numBytes); - result = (*my_sendfile_func)(dstFD, &sfv, 1, &numBytes); - - /* Solaris sendfilev() will return -1 even if some bytes have been - * transferred, so we check numBytes first. - */ - if (numBytes > 0) - return numBytes; - if (result < 0) { - if (errno == EAGAIN) - return IOS_UNAVAILABLE; - if (errno == EOPNOTSUPP) - return IOS_UNSUPPORTED_CASE; - if ((errno == EINVAL) && ((ssize_t)count >= 0)) - return IOS_UNSUPPORTED_CASE; - if (errno == EINTR) - return IOS_INTERRUPTED; - JNU_ThrowIOExceptionWithLastError(env, "Transfer failed"); - return IOS_THROWN; - } - return result; + /* Solaris sendfilev() will return -1 even if some bytes have been + * transferred, so we check numBytes first. + */ + if (numBytes > 0) + return numBytes; + if (result < 0) { + if (errno == EAGAIN) + return IOS_UNAVAILABLE; + if (errno == EOPNOTSUPP) + return IOS_UNSUPPORTED_CASE; + if ((errno == EINVAL) && ((ssize_t)count >= 0)) + return IOS_UNSUPPORTED_CASE; + if (errno == EINTR) + return IOS_INTERRUPTED; + JNU_ThrowIOExceptionWithLastError(env, "Transfer failed"); + return IOS_THROWN; } + return result; +#else + return IOS_UNSUPPORTED_CASE; #endif } diff --git a/jdk/src/solaris/native/sun/nio/ch/IOUtil.c b/jdk/src/solaris/native/sun/nio/ch/IOUtil.c index 455878f5d40..8d0356f9039 100644 --- a/jdk/src/solaris/native/sun/nio/ch/IOUtil.c +++ b/jdk/src/solaris/native/sun/nio/ch/IOUtil.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/sun/nio/ch/Net.c b/jdk/src/solaris/native/sun/nio/ch/Net.c index 05811a3162f..c43664c5000 100644 --- a/jdk/src/solaris/native/sun/nio/ch/Net.c +++ b/jdk/src/solaris/native/sun/nio/ch/Net.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/sun/nio/ch/SctpNet.c b/jdk/src/solaris/native/sun/nio/ch/SctpNet.c index f462ae3445d..3eaf402ee80 100644 --- a/jdk/src/solaris/native/sun/nio/ch/SctpNet.c +++ b/jdk/src/solaris/native/sun/nio/ch/SctpNet.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -617,18 +617,18 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPrimAddrOption0 * Signature: (IILjava/net/InetAddress;I)V */ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0 - (JNIEnv *env, jclass klass, jint fd, jint assocId, jobject iaObj, jint port) { + (JNIEnv *env, jclass klass, jint fd, jint assocId, + jobject iaObj, jint port, jboolean preferIPv6) { struct sctp_setpeerprim prim; - struct sockaddr_storage ss; - int ss_len = sizeof(ss); + struct sockaddr* sap = (struct sockaddr*)&prim.sspp_addr; + int sap_len; - if (NET_InetAddressToSockaddr(env, iaObj, port, (struct sockaddr *)&ss, - &ss_len, JNI_TRUE) != 0) { + if (NET_InetAddressToSockaddr(env, iaObj, port, sap, + &sap_len, preferIPv6) != 0) { return; } prim.sspp_assoc_id = assocId; - prim.sspp_addr = ss; if (setsockopt(fd, IPPROTO_SCTP, SCTP_SET_PEER_PRIMARY_ADDR, &prim, sizeof(prim)) < 0) { diff --git a/jdk/src/solaris/native/sun/nio/ch/SocketChannelImpl.c b/jdk/src/solaris/native/sun/nio/ch/SocketChannelImpl.c index 99923f51eec..66c32543adb 100644 --- a/jdk/src/solaris/native/sun/nio/ch/SocketChannelImpl.c +++ b/jdk/src/solaris/native/sun/nio/ch/SocketChannelImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/sun/nio/ch/UnixAsynchronousSocketChannelImpl.c b/jdk/src/solaris/native/sun/nio/ch/UnixAsynchronousSocketChannelImpl.c index 4106d0277fa..6aa4adbf5d9 100644 --- a/jdk/src/solaris/native/sun/nio/ch/UnixAsynchronousSocketChannelImpl.c +++ b/jdk/src/solaris/native/sun/nio/ch/UnixAsynchronousSocketChannelImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/solaris/native/sun/xawt/XToolkit.c b/jdk/src/solaris/native/sun/xawt/XToolkit.c index 72024178041..4ea63143c70 100644 --- a/jdk/src/solaris/native/sun/xawt/XToolkit.c +++ b/jdk/src/solaris/native/sun/xawt/XToolkit.c @@ -187,7 +187,9 @@ Java_java_awt_Component_initIDs "()Ljava/awt/Point;"); keyclass = (*env)->FindClass(env, "java/awt/event/KeyEvent"); - DASSERT (keyclass != NULL); + if (JNU_IsNull(env, keyclass)) { + return; + } componentIDs.isProxyActive = (*env)->GetFieldID(env, keyclass, "isProxyActive", @@ -715,8 +717,10 @@ Window get_xawt_root_shell(JNIEnv *env) { if (xawt_root_shell == None){ if (classXRootWindow == NULL){ jclass cls_tmp = (*env)->FindClass(env, "sun/awt/X11/XRootWindow"); - classXRootWindow = (jclass)(*env)->NewGlobalRef(env, cls_tmp); - (*env)->DeleteLocalRef(env, cls_tmp); + if (!JNU_IsNull(env, cls_tmp)) { + classXRootWindow = (jclass)(*env)->NewGlobalRef(env, cls_tmp); + (*env)->DeleteLocalRef(env, cls_tmp); + } } if( classXRootWindow != NULL) { methodGetXRootWindow = (*env)->GetStaticMethodID(env, classXRootWindow, "getXRootWindow", "()J"); diff --git a/jdk/src/solaris/native/sun/xawt/XWindow.c b/jdk/src/solaris/native/sun/xawt/XWindow.c index 4a66d4d7e6b..d33c87f424c 100644 --- a/jdk/src/solaris/native/sun/xawt/XWindow.c +++ b/jdk/src/solaris/native/sun/xawt/XWindow.c @@ -766,7 +766,9 @@ adjustKeySym(XEvent *event, KeySym *keysym) static Boolean isXsunServer(XEvent *event) { if( awt_ServerDetected ) return awt_IsXsun; - if( strncmp( ServerVendor( event->xkey.display ), "Sun Microsystems, Inc.", 32) ) { + if( (strncmp( ServerVendor( event->xkey.display ), "Sun Microsystems, Inc.", 22) != 0) && + (strncmp( ServerVendor( event->xkey.display ), "Oracle Corporation", 18) != 0) ) + { awt_ServerDetected = True; awt_IsXsun = False; return False; diff --git a/jdk/src/solaris/native/sun/xawt/XlibWrapper.c b/jdk/src/solaris/native/sun/xawt/XlibWrapper.c index 85a462523a8..18930fecb15 100644 --- a/jdk/src/solaris/native/sun/xawt/XlibWrapper.c +++ b/jdk/src/solaris/native/sun/xawt/XlibWrapper.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -484,8 +484,8 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_XkbLibraryVersion (JNIEnv *env, jclass clazz, jlong lib_major_in_out, jlong lib_minor_in_out) { AWT_CHECK_HAVE_LOCK(); - *((int *)lib_major_in_out) = XkbMajorVersion; - *((int *)lib_minor_in_out) = XkbMinorVersion; + *((int *)jlong_to_ptr(lib_major_in_out)) = XkbMajorVersion; + *((int *)jlong_to_ptr(lib_minor_in_out)) = XkbMinorVersion; return XkbLibraryVersion((int *)jlong_to_ptr(lib_major_in_out), (int *)jlong_to_ptr(lib_minor_in_out)); } @@ -1229,7 +1229,6 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_IsKanaKeyboard (JNIEnv *env, jclass clazz, jlong display) { int xx; - AWT_CHECK_HAVE_LOCK(); static jboolean result = JNI_FALSE; int32_t minKeyCode, maxKeyCode, keySymsPerKeyCode; @@ -1237,6 +1236,8 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_IsKanaKeyboard int32_t i; int32_t kanaCount = 0; + AWT_CHECK_HAVE_LOCK(); + // There's no direct way to determine whether the keyboard has // a kana lock key. From available keyboard mapping tables, it looks // like only keyboards with the kana lock key can produce keysyms @@ -1337,12 +1338,14 @@ JNIEXPORT void JNICALL Java_sun_awt_X11_XlibWrapper_PrintXErrorEvent JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XInternAtoms (JNIEnv *env, jclass clazz, jlong display, jobjectArray names_arr, jboolean only_if_exists, jlong atoms) { - int length = (*env)->GetArrayLength(env, names_arr); char ** names = (char**)malloc(length*sizeof(char*)); jboolean copy; int index, name_index = 0; int status; + + AWT_CHECK_HAVE_LOCK(); + for (index = 0; index < length; index++) { jstring str = (*env)->GetObjectArrayElement(env, names_arr, index); if (!JNU_IsNull(env, str)) { @@ -1352,7 +1355,6 @@ JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XInternAtoms (*env)->DeleteLocalRef(env, str); } } - AWT_CHECK_HAVE_LOCK(); status = XInternAtoms((Display*)jlong_to_ptr(display), names, name_index, only_if_exists, (Atom*) jlong_to_ptr(atoms)); for (index = 0; index < length; index++) { free(names[index]); @@ -2186,12 +2188,12 @@ JNIEXPORT void JNICALL Java_sun_awt_X11_XlibWrapper_SetZOrder (JNIEnv *env, jclass clazz, jlong display, jlong window, jlong above) { - AWT_CHECK_HAVE_LOCK(); + unsigned int value_mask = CWStackMode; XWindowChanges wc; wc.sibling = (Window)jlong_to_ptr(above); - unsigned int value_mask = CWStackMode; + AWT_CHECK_HAVE_LOCK(); if (above == 0) { wc.stack_mode = Above; @@ -2219,6 +2221,7 @@ Java_sun_awt_X11_XlibWrapper_SetBitmapShape jboolean isCopy = JNI_FALSE; size_t worstBufferSize = (size_t)((width / 2 + 1) * height); RECT_T * pRect; + int numrects; AWT_CHECK_HAVE_LOCK(); @@ -2237,7 +2240,7 @@ Java_sun_awt_X11_XlibWrapper_SetBitmapShape /* Note: the values[0] and values[1] are supposed to contain the width * and height (see XIconInfo.getIntData() for details). So, we do +2. */ - int numrects = BitmapToYXBandedRectangles(32, (int)width, (int)height, + numrects = BitmapToYXBandedRectangles(32, (int)width, (int)height, (unsigned char *)(values + 2), pRect); XShapeCombineRectangles((Display *)jlong_to_ptr(display), (Window)jlong_to_ptr(window), diff --git a/jdk/src/solaris/native/sun/xawt/awt_Desktop.c b/jdk/src/solaris/native/sun/xawt/awt_Desktop.c index 9ebab6a4473..d9f9be2bf1c 100644 --- a/jdk/src/solaris/native/sun/xawt/awt_Desktop.c +++ b/jdk/src/solaris/native/sun/xawt/awt_Desktop.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 +28,15 @@ typedef int gboolean; -gboolean (*gnome_url_show) (const char *url, void **error); +typedef gboolean (GNOME_URL_SHOW_TYPE)(const char *, void **); +typedef gboolean (GNOME_VFS_INIT_TYPE)(void); + +GNOME_URL_SHOW_TYPE *gnome_url_show; +GNOME_VFS_INIT_TYPE *gnome_vfs_init; int init(){ void *vfs_handle; void *gnome_handle; - gboolean (*gnome_vfs_init) (void); const char *errmsg; vfs_handle = dlopen("libgnomevfs-2.so.0", RTLD_LAZY); @@ -44,7 +47,7 @@ int init(){ return 0; } dlerror(); /* Clear errors */ - gnome_vfs_init = dlsym(vfs_handle, "gnome_vfs_init"); + gnome_vfs_init = (GNOME_VFS_INIT_TYPE*)dlsym(vfs_handle, "gnome_vfs_init"); if ((errmsg = dlerror()) != NULL) { #ifdef INTERNAL_BUILD fprintf(stderr, "can not find symble gnome_vfs_init\n"); @@ -62,7 +65,7 @@ int init(){ return 0; } dlerror(); /* Clear errors */ - gnome_url_show = dlsym(gnome_handle, "gnome_url_show"); + gnome_url_show = (GNOME_URL_SHOW_TYPE*)dlsym(gnome_handle, "gnome_url_show"); if ((errmsg = dlerror()) != NULL) { #ifdef INTERNAL_BUILD fprintf(stderr, "can not find symble gnome_url_show\n"); @@ -94,14 +97,15 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XDesktopPeer_gnome_1url_1show (JNIEnv *env, jobject obj, jbyteArray url_j) { gboolean success; + const char* url_c; - const char* url_c = (*env)->GetByteArrayElements(env, url_j, NULL); - - if (gnome_url_show == NULL) return JNI_FALSE; + if (gnome_url_show == NULL) { + return JNI_FALSE; + } + url_c = (char*)(*env)->GetByteArrayElements(env, url_j, NULL); // call gnome_url_show(const char* , GError**) success = (*gnome_url_show)(url_c, NULL); - (*env)->ReleaseByteArrayElements(env, url_j, (signed char*)url_c, 0); return success ? JNI_TRUE : JNI_FALSE; diff --git a/jdk/src/windows/bin/java_md.c b/jdk/src/windows/bin/java_md.c index 06824ce319c..97e4a803657 100644 --- a/jdk/src/windows/bin/java_md.c +++ b/jdk/src/windows/bin/java_md.c @@ -51,6 +51,96 @@ static jboolean GetJVMPath(const char *jrepath, const char *jvmtype, static jboolean GetJREPath(char *path, jint pathsize); static void EnsureJreInstallation(const char *jrepath); +/* We supports warmup for UI stack that is performed in parallel + * to VM initialization. + * This helps to improve startup of UI application as warmup phase + * might be long due to initialization of OS or hardware resources. + * It is not CPU bound and therefore it does not interfere with VM init. + * Obviously such warmup only has sense for UI apps and therefore it needs + * to be explicitly requested by passing -Dsun.awt.warmup=true property + * (this is always the case for plugin/javaws). + * + * Implementation launches new thread after VM starts and use it to perform + * warmup code (platform dependent). + * This thread is later reused as AWT toolkit thread as graphics toolkit + * often assume that they are used from the same thread they were launched on. + * + * At the moment we only support warmup for D3D. It only possible on windows + * and only if other flags do not prohibit this (e.g. OpenGL support requested). + */ +#undef ENABLE_AWT_PRELOAD +#ifndef JAVA_ARGS /* turn off AWT preloading for javac, jar, etc */ + /* CR6999872: fastdebug crashes if awt library is loaded before JVM is + * initialized*/ + #if !defined(DEBUG) + #define ENABLE_AWT_PRELOAD + #endif +#endif + +#ifdef ENABLE_AWT_PRELOAD +/* "AWT was preloaded" flag; + * turned on by AWTPreload(). + */ +int awtPreloaded = 0; + +/* Calls a function with the name specified + * the function must be int(*fn)(void). + */ +int AWTPreload(const char *funcName); +/* stops AWT preloading */ +void AWTPreloadStop(); + +/* D3D preloading */ +/* -1: not initialized; 0: OFF, 1: ON */ +int awtPreloadD3D = -1; +/* command line parameter to swith D3D preloading on */ +#define PARAM_PRELOAD_D3D "-Dsun.awt.warmup" +/* D3D/OpenGL management parameters */ +#define PARAM_NODDRAW "-Dsun.java2d.noddraw" +#define PARAM_D3D "-Dsun.java2d.d3d" +#define PARAM_OPENGL "-Dsun.java2d.opengl" +/* funtion in awt.dll (src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp) */ +#define D3D_PRELOAD_FUNC "preloadD3D" + + +/* Extracts value of a parameter with the specified name + * from command line argument (returns pointer in the argument). + * Returns NULL if the argument does not contains the parameter. + * e.g.: + * GetParamValue("theParam", "theParam=value") returns pointer to "value". + */ +const char * GetParamValue(const char *paramName, const char *arg) { + int nameLen = JLI_StrLen(paramName); + if (JLI_StrNCmp(paramName, arg, nameLen) == 0) { + /* arg[nameLen] is valid (may contain final NULL) */ + if (arg[nameLen] == '=') { + return arg + nameLen + 1; + } + } + return NULL; +} + +/* Checks if commandline argument contains property specified + * and analyze it as boolean property (true/false). + * Returns -1 if the argument does not contain the parameter; + * Returns 1 if the argument contains the parameter and its value is "true"; + * Returns 0 if the argument contains the parameter and its value is "false". + */ +int GetBoolParamValue(const char *paramName, const char *arg) { + const char * paramValue = GetParamValue(paramName, arg); + if (paramValue != NULL) { + if (JLI_StrCaseCmp(paramValue, "true") == 0) { + return 1; + } + if (JLI_StrCaseCmp(paramValue, "false") == 0) { + return 0; + } + } + return -1; +} +#endif /* ENABLE_AWT_PRELOAD */ + + static jboolean _isjavaw = JNI_FALSE; @@ -132,6 +222,30 @@ CreateExecutionEnvironment(int *pargc, char ***pargv, exit(4); } /* If we got here, jvmpath has been correctly initialized. */ + + /* Check if we need preload AWT */ +#ifdef ENABLE_AWT_PRELOAD + argv = *pargv; + for (i = 0; i < *pargc ; i++) { + /* Tests the "turn on" parameter only if not set yet. */ + if (awtPreloadD3D < 0) { + if (GetBoolParamValue(PARAM_PRELOAD_D3D, argv[i]) == 1) { + awtPreloadD3D = 1; + } + } + /* Test parameters which can disable preloading if not already disabled. */ + if (awtPreloadD3D != 0) { + if (GetBoolParamValue(PARAM_NODDRAW, argv[i]) == 1 + || GetBoolParamValue(PARAM_D3D, argv[i]) == 0 + || GetBoolParamValue(PARAM_OPENGL, argv[i]) == 1) + { + awtPreloadD3D = 0; + /* no need to test the rest of the parameters */ + break; + } + } + } +#endif /* ENABLE_AWT_PRELOAD */ } @@ -208,7 +322,7 @@ EnsureJreInstallation(const char* jrepath) struct stat s; /* Make sure the jrepath contains something */ - if (jrepath[0] == NULL) { + if ((void*)jrepath[0] == NULL) { return; } /* 32 bit windows only please */ @@ -540,7 +654,7 @@ JLI_ReportErrorMessageSys(const char *fmt, ...) /* get the length of the string we need */ int len = mlen = _vscprintf(fmt, vl) + 1; if (freeit) { - mlen += JLI_StrLen(errtext); + mlen += (int)JLI_StrLen(errtext); } message = (char *)JLI_MemAlloc(mlen); @@ -997,7 +1111,6 @@ ExecJRE(char *jre, char **argv) { exit(exitCode); } - } /* @@ -1087,6 +1200,40 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void 0, &thread_id); } + + /* AWT preloading (AFTER main thread start) */ +#ifdef ENABLE_AWT_PRELOAD + /* D3D preloading */ + if (awtPreloadD3D != 0) { + char *envValue; + /* D3D routines checks env.var J2D_D3D if no appropriate + * command line params was specified + */ + envValue = getenv("J2D_D3D"); + if (envValue != NULL && JLI_StrCaseCmp(envValue, "false") == 0) { + awtPreloadD3D = 0; + } + /* Test that AWT preloading isn't disabled by J2D_D3D_PRELOAD env.var */ + envValue = getenv("J2D_D3D_PRELOAD"); + if (envValue != NULL && JLI_StrCaseCmp(envValue, "false") == 0) { + awtPreloadD3D = 0; + } + if (awtPreloadD3D < 0) { + /* If awtPreloadD3D is still undefined (-1), test + * if it is turned on by J2D_D3D_PRELOAD env.var. + * By default it's turned OFF. + */ + awtPreloadD3D = 0; + if (envValue != NULL && JLI_StrCaseCmp(envValue, "true") == 0) { + awtPreloadD3D = 1; + } + } + } + if (awtPreloadD3D) { + AWTPreload(D3D_PRELOAD_FUNC); + } +#endif /* ENABLE_AWT_PRELOAD */ + if (thread_handle) { WaitForSingleObject(thread_handle, INFINITE); GetExitCodeThread(thread_handle, &rslt); @@ -1094,6 +1241,13 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void } else { rslt = continuation(args); } + +#ifdef ENABLE_AWT_PRELOAD + if (awtPreloaded) { + AWTPreloadStop(); + } +#endif /* ENABLE_AWT_PRELOAD */ + return rslt; } @@ -1140,3 +1294,98 @@ InitLauncher(boolean javaw) _isjavaw = javaw; JLI_SetTraceLauncher(); } + + +/* ============================== */ +/* AWT preloading */ +#ifdef ENABLE_AWT_PRELOAD + +typedef int FnPreloadStart(void); +typedef void FnPreloadStop(void); +static FnPreloadStop *fnPreloadStop = NULL; +static HMODULE hPreloadAwt = NULL; + +/* + * Starts AWT preloading + */ +int AWTPreload(const char *funcName) +{ + int result = -1; + /* load AWT library once (if several preload function should be called) */ + if (hPreloadAwt == NULL) { + /* awt.dll is not loaded yet */ + char libraryPath[MAXPATHLEN]; + int jrePathLen = 0; + HMODULE hJava = NULL; + HMODULE hVerify = NULL; + + while (1) { + /* awt.dll depends on jvm.dll & java.dll; + * jvm.dll is already loaded, so we need only java.dll; + * java.dll depends on MSVCRT lib & verify.dll. + */ + if (!GetJREPath(libraryPath, MAXPATHLEN)) { + break; + } + + /* save path length */ + jrePathLen = JLI_StrLen(libraryPath); + + /* load msvcrt 1st */ + LoadMSVCRT(); + + /* load verify.dll */ + JLI_StrCat(libraryPath, "\\bin\\verify.dll"); + hVerify = LoadLibrary(libraryPath); + if (hVerify == NULL) { + break; + } + + /* restore jrePath */ + libraryPath[jrePathLen] = 0; + /* load java.dll */ + JLI_StrCat(libraryPath, "\\bin\\" JAVA_DLL); + hJava = LoadLibrary(libraryPath); + if (hJava == NULL) { + break; + } + + /* restore jrePath */ + libraryPath[jrePathLen] = 0; + /* load awt.dll */ + JLI_StrCat(libraryPath, "\\bin\\awt.dll"); + hPreloadAwt = LoadLibrary(libraryPath); + if (hPreloadAwt == NULL) { + break; + } + + /* get "preloadStop" func ptr */ + fnPreloadStop = (FnPreloadStop *)GetProcAddress(hPreloadAwt, "preloadStop"); + + break; + } + } + + if (hPreloadAwt != NULL) { + FnPreloadStart *fnInit = (FnPreloadStart *)GetProcAddress(hPreloadAwt, funcName); + if (fnInit != NULL) { + /* don't forget to stop preloading */ + awtPreloaded = 1; + + result = fnInit(); + } + } + + return result; +} + +/* + * Terminates AWT preloading + */ +void AWTPreloadStop() { + if (fnPreloadStop != NULL) { + fnPreloadStop(); + } +} + +#endif /* ENABLE_AWT_PRELOAD */ diff --git a/jdk/src/windows/classes/java/io/Win32FileSystem.java b/jdk/src/windows/classes/java/io/Win32FileSystem.java index 490c411b072..4040c128fb1 100644 --- a/jdk/src/windows/classes/java/io/Win32FileSystem.java +++ b/jdk/src/windows/classes/java/io/Win32FileSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/classes/java/lang/ProcessEnvironment.java b/jdk/src/windows/classes/java/lang/ProcessEnvironment.java index 77adfc23191..c5e4c130f26 100644 --- a/jdk/src/windows/classes/java/lang/ProcessEnvironment.java +++ b/jdk/src/windows/classes/java/lang/ProcessEnvironment.java @@ -250,8 +250,7 @@ final class ProcessEnvironment extends HashMap envblock.substring(eql+1,end)); } - theCaseInsensitiveEnvironment - = new TreeMap(nameComparator); + theCaseInsensitiveEnvironment = new TreeMap<>(nameComparator); theCaseInsensitiveEnvironment.putAll(theEnvironment); } @@ -296,8 +295,7 @@ final class ProcessEnvironment extends HashMap // Only for use by ProcessImpl.start() String toEnvironmentBlock() { // Sort Unicode-case-insensitively by name - List> list - = new ArrayList>(entrySet()); + List> list = new ArrayList<>(entrySet()); Collections.sort(list, entryComparator); StringBuilder sb = new StringBuilder(size()*30); diff --git a/jdk/src/windows/classes/java/lang/ProcessImpl.java b/jdk/src/windows/classes/java/lang/ProcessImpl.java index c0a0daa09a8..05891161a42 100644 --- a/jdk/src/windows/classes/java/lang/ProcessImpl.java +++ b/jdk/src/windows/classes/java/lang/ProcessImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. * 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 java.io.FileDescriptor; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.lang.ProcessBuilder.Redirect; +import java.security.AccessController; +import java.security.PrivilegedAction; /* This class is for the exclusive use of ProcessBuilder.start() to * create new processes. @@ -47,6 +49,35 @@ final class ProcessImpl extends Process { private static final sun.misc.JavaIOFileDescriptorAccess fdAccess = sun.misc.SharedSecrets.getJavaIOFileDescriptorAccess(); + /** + * Open a file for writing. If {@code append} is {@code true} then the file + * is opened for atomic append directly and a FileOutputStream constructed + * with the resulting handle. This is because a FileOutputStream created + * to append to a file does not open the file in a manner that guarantees + * that writes by the child process will be atomic. + */ + private static FileOutputStream newFileOutputStream(File f, boolean append) + throws IOException + { + if (append) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + sm.checkWrite(f.getPath()); + long handle = openForAtomicAppend(f.getPath()); + final FileDescriptor fd = new FileDescriptor(); + fdAccess.setHandle(fd, handle); + return AccessController.doPrivileged( + new PrivilegedAction() { + public FileOutputStream run() { + return new FileOutputStream(fd); + } + } + ); + } else { + return new FileOutputStream(f); + } + } + // System-dependent portion of ProcessBuilder.start() static Process start(String cmdarray[], java.util.Map environment, @@ -82,7 +113,8 @@ final class ProcessImpl extends Process { else if (redirects[1] == Redirect.INHERIT) stdHandles[1] = fdAccess.getHandle(FileDescriptor.out); else { - f1 = redirects[1].toFileOutputStream(); + f1 = newFileOutputStream(redirects[1].file(), + redirects[1].append()); stdHandles[1] = fdAccess.getHandle(f1.getFD()); } @@ -91,7 +123,8 @@ final class ProcessImpl extends Process { else if (redirects[2] == Redirect.INHERIT) stdHandles[2] = fdAccess.getHandle(FileDescriptor.err); else { - f2 = redirects[2].toFileOutputStream(); + f2 = newFileOutputStream(redirects[2].file(), + redirects[2].append()); stdHandles[2] = fdAccess.getHandle(f2.getFD()); } } @@ -251,5 +284,15 @@ final class ProcessImpl extends Process { boolean redirectErrorStream) throws IOException; + /** + * Opens a file for atomic append. The file is created if it doesn't + * already exist. + * + * @param file the file to open or create + * @return the native HANDLE + */ + private static native long openForAtomicAppend(String path) + throws IOException; + private static native boolean closeHandle(long handle); } diff --git a/jdk/src/windows/classes/sun/awt/Win32GraphicsDevice.java b/jdk/src/windows/classes/sun/awt/Win32GraphicsDevice.java index 5663a9ff7f3..a38068514c6 100644 --- a/jdk/src/windows/classes/sun/awt/Win32GraphicsDevice.java +++ b/jdk/src/windows/classes/sun/awt/Win32GraphicsDevice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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.awt.GraphicsDevice; import java.awt.GraphicsConfiguration; import java.awt.GraphicsEnvironment; import java.awt.DisplayMode; +import java.awt.EventQueue; import java.awt.Frame; import java.awt.Rectangle; import java.awt.Window; @@ -610,11 +611,18 @@ public class Win32GraphicsDevice extends GraphicsDevice implements * * @param w full-screen window */ - protected void addFSWindowListener(Window w) { + protected void addFSWindowListener(final Window w) { // Note: even though we create a listener for Window instances of // fs windows they will not receive window events. fsWindowListener = new Win32FSWindowAdapter(this); - w.addWindowListener(fsWindowListener); + + // Fix for 6709453. Using invokeLater to avoid listening + // for the events already posted to the queue. + EventQueue.invokeLater(new Runnable() { + public void run() { + w.addWindowListener(fsWindowListener); + } + }); } /** diff --git a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java index 1e4efd9ae70..5d34d4fffe6 100644 --- a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java +++ b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/classes/sun/awt/windows/WComponentPeer.java b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java index 5a3cd2ddd87..01eb239961b 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -999,6 +999,8 @@ public abstract class WComponentPeer extends WObjectPeer public void setBoundsOperation(int operation) { } + private volatile boolean isAccelCapable = true; + /** * Returns whether this component is capable of being hw accelerated. * More specifically, whether rendering to this component or a @@ -1009,11 +1011,22 @@ public abstract class WComponentPeer extends WObjectPeer * {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT * PERPIXEL_TRANSLUCENT}. * + * Another condition is if Xor paint mode was detected when rendering + * to an on-screen accelerated surface associated with this peer. + * in this case both on- and off-screen acceleration for this peer is + * disabled. + * * @return {@code true} if this component is capable of being hw * accelerated, {@code false} otherwise * @see GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT */ public boolean isAccelCapable() { + if (!isAccelCapable || + !isContainingTopLevelAccelCapable((Component)target)) + { + return false; + } + boolean isTranslucent = SunToolkit.isContainingTopLevelTranslucent((Component)target); // D3D/OGL and translucent windows interacted poorly in Windows XP; @@ -1021,6 +1034,14 @@ public abstract class WComponentPeer extends WObjectPeer return !isTranslucent || Win32GraphicsEnvironment.isVistaOS(); } + /** + * Disables acceleration for this peer. + */ + public void disableAcceleration() { + isAccelCapable = false; + } + + native void setRectangularShape(int lox, int loy, int hix, int hiy, Region region); diff --git a/jdk/src/windows/classes/sun/awt/windows/WEmbeddedFrame.java b/jdk/src/windows/classes/sun/awt/windows/WEmbeddedFrame.java index 908c1aac8e2..4e4e3838da5 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WEmbeddedFrame.java +++ b/jdk/src/windows/classes/sun/awt/windows/WEmbeddedFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import java.util.*; import java.awt.color.*; import java.awt.image.*; import sun.awt.image.ByteInterleavedRaster; +import sun.security.action.GetPropertyAction; import java.lang.reflect.*; public class WEmbeddedFrame extends EmbeddedFrame { @@ -48,8 +49,12 @@ public class WEmbeddedFrame extends EmbeddedFrame { private int imgWid = 0; private int imgHgt = 0; + private static int pScale = 0; private static final int MAX_BAND_SIZE = (1024*30); + private static String printScale = (String) java.security.AccessController + .doPrivileged(new GetPropertyAction("sun.java2d.print.pluginscalefactor")); + public WEmbeddedFrame() { this((long)0); } @@ -114,8 +119,7 @@ public class WEmbeddedFrame extends EmbeddedFrame { * real resolution of the destination so */ if (isPrinterDC(hdc)) { - xscale = 4; - yscale = 4; + xscale = yscale = getPrintScaleFactor(); } int frameHeight = getHeight(); @@ -168,6 +172,37 @@ public class WEmbeddedFrame extends EmbeddedFrame { } } + protected static int getPrintScaleFactor() { + // check if value is already cached + if (pScale != 0) + return pScale; + if (printScale == null) { + // if no system property is specified, + // check for environment setting + printScale = (String) java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public Object run() { + return System.getenv("JAVA2D_PLUGIN_PRINT_SCALE"); + } + } + ); + } + int default_printDC_scale = 4; + int scale = default_printDC_scale; + if (printScale != null) { + try { + scale = Integer.parseInt(printScale); + if (scale > 8 || scale < 1) { + scale = default_printDC_scale; + } + } catch (NumberFormatException nfe) { + } + } + pScale = scale; + return pScale; + } + + protected native boolean isPrinterDC(long hdc); protected native void printBand(long hdc, byte[] data, int offset, diff --git a/jdk/src/windows/classes/sun/awt/windows/WFileDialogPeer.java b/jdk/src/windows/classes/sun/awt/windows/WFileDialogPeer.java index 6c0cbc470f5..ed216c00d2c 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WFileDialogPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WFileDialogPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,6 +35,7 @@ import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Vector; import sun.awt.AppContext; +import sun.awt.CausedFocusEvent; import sun.awt.AWTAccessor; public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer { @@ -252,6 +253,14 @@ public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer { boolean focusedWindowChangeAllowed) { return false; } + + public boolean requestFocus + (Component lightweightChild, boolean temporary, + boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause) + { + return false; + } + void start() {} public void beginValidate() {} public void endValidate() {} diff --git a/jdk/src/windows/classes/sun/awt/windows/WFramePeer.java b/jdk/src/windows/classes/sun/awt/windows/WFramePeer.java index f5b537c5ae5..a3e4a1d17fc 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WFramePeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WFramePeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * 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,50 @@ class WFramePeer extends WWindowPeer implements FramePeer { if (b == null) { clearMaximizedBounds(); } else { - setMaximizedBounds(b.x, b.y, b.width, b.height); + Rectangle adjBounds = (Rectangle)b.clone(); + adjustMaximizedBounds(adjBounds); + setMaximizedBounds(adjBounds.x, adjBounds.y, adjBounds.width, adjBounds.height); } } + /** + * The incoming bounds describe the maximized size and position of the + * window on the monitor that displays the window. But the window manager + * expects that the bounds are based on the size and position of the + * primary monitor, even if the window ultimately maximizes onto a + * secondary monitor. And the window manager adjusts these values to + * compensate for differences between the primary monitor and the monitor + * that displays the window. + * The method translates the incoming bounds to the values acceptable + * by the window manager. For more details, please refer to 6699851. + */ + private void adjustMaximizedBounds(Rectangle b) { + GraphicsConfiguration currentDevGC = getGraphicsConfiguration(); + + GraphicsDevice primaryDev = GraphicsEnvironment + .getLocalGraphicsEnvironment().getDefaultScreenDevice(); + GraphicsConfiguration primaryDevGC = primaryDev.getDefaultConfiguration(); + + if (currentDevGC != null && currentDevGC != primaryDevGC) { + Rectangle currentDevBounds = currentDevGC.getBounds(); + Rectangle primaryDevBounds = primaryDevGC.getBounds(); + + b.width -= (currentDevBounds.width - primaryDevBounds.width); + b.height -= (currentDevBounds.height - primaryDevBounds.height); + } + } + + @Override + public boolean updateGraphicsData(GraphicsConfiguration gc) { + boolean result = super.updateGraphicsData(gc); + Rectangle bounds = AWTAccessor.getFrameAccessor(). + getMaximizedBounds((Frame)target); + if (bounds != null) { + setMaximizedBounds(bounds); + } + return result; + } + @Override boolean isTargetUndecorated() { return ((Frame)target).isUndecorated(); diff --git a/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java b/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java index 58f0469dd20..d1423a31af5 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java +++ b/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -169,7 +169,7 @@ public class WInputMethod extends InputMethodAdapter locale.equals(Locale.JAPAN) && lang.equals(Locale.JAPANESE) || locale.equals(Locale.KOREA) && lang.equals(Locale.KOREAN)) { if (isActive) { - setNativeLocale(locale.toString(), onActivate); + setNativeLocale(locale.toLanguageTag(), onActivate); } currentLocale = locale; return true; diff --git a/jdk/src/windows/classes/sun/awt/windows/WPrintDialogPeer.java b/jdk/src/windows/classes/sun/awt/windows/WPrintDialogPeer.java index 7d433679136..769e73a6828 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WPrintDialogPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WPrintDialogPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ import java.awt.peer.ComponentPeer; import java.awt.dnd.DropTarget; import java.util.Vector; import sun.awt.AppContext; +import sun.awt.CausedFocusEvent; import sun.awt.AWTAccessor; public class WPrintDialogPeer extends WWindowPeer implements DialogPeer { @@ -131,6 +132,15 @@ public class WPrintDialogPeer extends WWindowPeer implements DialogPeer { public boolean requestFocus(boolean temporary, boolean focusedWindowChangeAllowed) { return false; } + + public boolean requestFocus + (Component lightweightChild, boolean temporary, + boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause) + { + + return false; + } + public void updateFocusableWindowState() {} void start() {} public void beginValidate() {} diff --git a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java index 8c74e450a9a..967bd7b74f2 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java +++ b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ public class WToolkit extends SunToolkit implements Runnable { private static native void postDispose(); + private static native boolean startToolkitThread(Runnable thread); + public WToolkit() { // Startup toolkit threads if (PerformanceLogger.loggingEnabled()) { @@ -231,9 +233,6 @@ public class WToolkit extends SunToolkit implements Runnable { // where notifyAll can be called before // the "AWT-Windows" thread's parent thread is // waiting, resulting in a deadlock on startup. - Thread toolkitThread = new Thread(this, "AWT-Windows"); - toolkitThread.setDaemon(true); - toolkitThread.setPriority(Thread.NORM_PRIORITY+1); /* * Fix for 4701990. @@ -242,7 +241,11 @@ public class WToolkit extends SunToolkit implements Runnable { */ AWTAutoShutdown.notifyToolkitThreadBusy(); - toolkitThread.start(); + if (!startToolkitThread(this)) { + Thread toolkitThread = new Thread(this, "AWT-Windows"); + toolkitThread.setDaemon(true); + toolkitThread.start(); + } try { wait(); @@ -263,6 +266,7 @@ public class WToolkit extends SunToolkit implements Runnable { } public void run() { + Thread.currentThread().setPriority(Thread.NORM_PRIORITY+1); boolean startPump = init(); if (startPump) { diff --git a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java index d3ccd4db4d9..cdd46edc9be 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -487,13 +487,8 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, newDev.addDisplayChangedListener(this); } - SunToolkit.executeOnEventHandlerThread((Component)target, - new Runnable() { - public void run() { - AWTAccessor.getComponentAccessor(). + AWTAccessor.getComponentAccessor(). setGraphicsConfiguration((Component)target, winGraphicsConfig); - } - }); } /** @@ -605,6 +600,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, } private native void setOpacity(int iOpacity); + private float opacity = 1.0f; public void setOpacity(float opacity) { if (!((SunToolkit)((Window)target).getToolkit()). @@ -613,7 +609,21 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, return; } - replaceSurfaceDataRecursively((Component)getTarget()); + if (opacity < 0.0f || opacity > 1.0f) { + throw new IllegalArgumentException( + "The value of opacity should be in the range [0.0f .. 1.0f]."); + } + + if (((this.opacity == 1.0f && opacity < 1.0f) || + (this.opacity < 1.0f && opacity == 1.0f)) && + !Win32GraphicsEnvironment.isVistaOS()) + { + // non-Vista OS: only replace the surface data if opacity status + // changed (see WComponentPeer.isAccelCapable() for more) + replaceSurfaceDataRecursively((Component)getTarget()); + } + + this.opacity = opacity; final int maxOpacity = 0xff; int iOpacity = (int)(opacity * maxOpacity); @@ -655,7 +665,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, boolean isVistaOS = Win32GraphicsEnvironment.isVistaOS(); - if (!isVistaOS) { + if (this.isOpaque != isOpaque && !isVistaOS) { // non-Vista OS: only replace the surface data if the opacity // status changed (see WComponentPeer.isAccelCapable() for more) replaceSurfaceDataRecursively(target); diff --git a/jdk/src/windows/classes/sun/awt/windows/awtLocalization_pt_BR.properties b/jdk/src/windows/classes/sun/awt/windows/awtLocalization_pt_BR.properties new file mode 100644 index 00000000000..86e0905dce9 --- /dev/null +++ b/jdk/src/windows/classes/sun/awt/windows/awtLocalization_pt_BR.properties @@ -0,0 +1,10 @@ + +# +# AWT Localization Properties +# + +# Default font size for Menus and MenuItems +menuFont=SansSerif-plain-11 + +# Value for "All files" for FileDialog +allFiles=Todos os arquivos diff --git a/jdk/src/windows/classes/sun/awt/windows/fontconfig.properties b/jdk/src/windows/classes/sun/awt/windows/fontconfig.properties index 6d3a99d4c1a..a7f59e52b8d 100644 --- a/jdk/src/windows/classes/sun/awt/windows/fontconfig.properties +++ b/jdk/src/windows/classes/sun/awt/windows/fontconfig.properties @@ -1,6 +1,6 @@ # # -# Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java b/jdk/src/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java index cb779dc68ea..57233f66edf 100644 --- a/jdk/src/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java +++ b/jdk/src/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/classes/sun/java2d/d3d/D3DSurfaceData.java b/jdk/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java index 553d84156b2..bc7dfd8631a 100644 --- a/jdk/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java +++ b/jdk/src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java @@ -437,6 +437,10 @@ public class D3DSurfaceData extends SurfaceData implements AccelSurface { protected int getElem(final int x, final int y, final SurfaceData sData) { + if (sData.isSurfaceLost()) { + return 0; + } + int retPixel; D3DRenderQueue rq = D3DRenderQueue.getInstance(); rq.lock(); @@ -456,6 +460,10 @@ public class D3DSurfaceData extends SurfaceData implements AccelSurface { protected void setElem(final int x, final int y, final int pixel, final SurfaceData sData) { + if (sData.isSurfaceLost()) { + return; + } + D3DRenderQueue rq = D3DRenderQueue.getInstance(); rq.lock(); try { @@ -512,15 +520,32 @@ public class D3DSurfaceData extends SurfaceData implements AccelSurface { sg2d.surfaceData.getTransparency() == Transparency.OPAQUE; } + /** + * If acceleration should no longer be used for this surface. + * This implementation flags to the manager that it should no + * longer attempt to re-create a D3DSurface. + */ + void disableAccelerationForSurface() { + if (offscreenImage != null) { + SurfaceManager sm = SurfaceManager.getManager(offscreenImage); + if (sm instanceof D3DVolatileSurfaceManager) { + setSurfaceLost(true); + ((D3DVolatileSurfaceManager)sm).setAccelerationEnabled(false); + } + } + } + public void validatePipe(SunGraphics2D sg2d) { TextPipe textpipe; boolean validated = false; // REMIND: the D3D pipeline doesn't support XOR!, more - // fixes will be needed below + // fixes will be needed below. For now we disable D3D rendering + // for the surface which had any XOR rendering done to. if (sg2d.compositeState >= sg2d.COMP_XOR) { super.validatePipe(sg2d); sg2d.imagepipe = d3dImagePipe; + disableAccelerationForSurface(); return; } @@ -894,8 +919,26 @@ public class D3DSurfaceData extends SurfaceData implements AccelSurface { return peer.getTarget(); } + @Override + void disableAccelerationForSurface() { + // for on-screen surfaces we need to make sure a backup GDI surface is + // is used until a new one is set (which may happen during a resize). We + // don't want the screen update maanger to replace the surface right way + // because it causes repainting issues in Swing, so we invalidate it, + // this will prevent SUM from issuing a replaceSurfaceData call. + setSurfaceLost(true); + invalidate(); + flush(); + peer.disableAcceleration(); + ScreenUpdateManager.getInstance().dropScreenSurface(this); + } + @Override void restoreSurface() { + if (!peer.isAccelCapable()) { + throw new InvalidPipeException("Onscreen acceleration " + + "disabled for this surface"); + } Window fsw = graphicsDevice.getFullScreenWindow(); if (fsw != null && fsw != peer.getTarget()) { throw new InvalidPipeException("Can't restore onscreen surface"+ diff --git a/jdk/src/windows/classes/sun/java2d/opengl/WGLVolatileSurfaceManager.java b/jdk/src/windows/classes/sun/java2d/opengl/WGLVolatileSurfaceManager.java index ba655bf00ba..7c4fde1b640 100644 --- a/jdk/src/windows/classes/sun/java2d/opengl/WGLVolatileSurfaceManager.java +++ b/jdk/src/windows/classes/sun/java2d/opengl/WGLVolatileSurfaceManager.java @@ -133,7 +133,9 @@ public class WGLVolatileSurfaceManager @Override protected boolean isConfigValid(GraphicsConfiguration gc) { - return ((gc == null) || (gc == vImg.getGraphicsConfig())); + return ((gc == null) || + ((gc instanceof WGLGraphicsConfig) && + (gc == vImg.getGraphicsConfig()))); } @Override diff --git a/jdk/src/windows/classes/sun/nio/ch/FileDispatcherImpl.java b/jdk/src/windows/classes/sun/nio/ch/FileDispatcherImpl.java index e893a2afb07..276c6199a12 100644 --- a/jdk/src/windows/classes/sun/nio/ch/FileDispatcherImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/FileDispatcherImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 +26,29 @@ package sun.nio.ch; import java.io.*; +import sun.misc.SharedSecrets; +import sun.misc.JavaIOFileDescriptorAccess; class FileDispatcherImpl extends FileDispatcher { - static { Util.load(); } + /** + * Indicates if the dispatcher should first advance the file position + * to the end of file when writing. + */ + private final boolean append; + + FileDispatcherImpl(boolean append) { + this.append = append; + } + + FileDispatcherImpl() { + this(false); + } + int read(FileDescriptor fd, long address, int len) throws IOException { @@ -53,7 +68,7 @@ class FileDispatcherImpl extends FileDispatcher } int write(FileDescriptor fd, long address, int len) throws IOException { - return write0(fd, address, len); + return write0(fd, address, len, append); } int pwrite(FileDescriptor fd, long address, int len, @@ -65,7 +80,7 @@ class FileDispatcherImpl extends FileDispatcher } long writev(FileDescriptor fd, long address, int len) throws IOException { - return writev0(fd, address, len); + return writev0(fd, address, len, append); } int force(FileDescriptor fd, boolean metaData) throws IOException { @@ -94,6 +109,16 @@ class FileDispatcherImpl extends FileDispatcher close0(fd); } + FileDescriptor duplicateForMapping(FileDescriptor fd) throws IOException { + // on Windows we need to keep a handle to the file + JavaIOFileDescriptorAccess fdAccess = + SharedSecrets.getJavaIOFileDescriptorAccess(); + FileDescriptor result = new FileDescriptor(); + long handle = duplicateHandle(fdAccess.getHandle(fd)); + fdAccess.setHandle(result, handle); + return result; + } + //-- Native methods static native int read0(FileDescriptor fd, long address, int len) @@ -105,13 +130,13 @@ class FileDispatcherImpl extends FileDispatcher static native long readv0(FileDescriptor fd, long address, int len) throws IOException; - static native int write0(FileDescriptor fd, long address, int len) + static native int write0(FileDescriptor fd, long address, int len, boolean append) throws IOException; static native int pwrite0(FileDescriptor fd, long address, int len, long position) throws IOException; - static native long writev0(FileDescriptor fd, long address, int len) + static native long writev0(FileDescriptor fd, long address, int len, boolean append) throws IOException; static native int force0(FileDescriptor fd, boolean metaData) @@ -132,4 +157,5 @@ class FileDispatcherImpl extends FileDispatcher static native void closeByHandle(long fd) throws IOException; + static native long duplicateHandle(long fd) throws IOException; } diff --git a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousChannelProvider.java b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousChannelProvider.java index 7073482ac6a..0a42501c8c1 100644 --- a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousChannelProvider.java +++ b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousChannelProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ import java.nio.channels.*; import java.nio.channels.spi.AsynchronousChannelProvider; import java.util.concurrent.ExecutorService; import java.util.concurrent.ThreadFactory; -import java.net.ProtocolFamily; import java.io.IOException; public class WindowsAsynchronousChannelProvider @@ -90,12 +89,4 @@ public class WindowsAsynchronousChannelProvider { return new WindowsAsynchronousSocketChannelImpl(toIocp(group)); } - - @Override - public AsynchronousDatagramChannel openAsynchronousDatagramChannel(ProtocolFamily family, - AsynchronousChannelGroup group) - throws IOException - { - return new SimpleAsynchronousDatagramChannelImpl(family, toIocp(group)); - } } diff --git a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java index 1c1088f32f3..694b23a34a9 100644 --- a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/classes/sun/nio/ch/WindowsSelectorImpl.java b/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java index 86ec341df16..2011b85a0fd 100644 --- a/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/classes/sun/nio/fs/WindowsChannelFactory.java b/jdk/src/windows/classes/sun/nio/fs/WindowsChannelFactory.java index 3795a6f40d2..d9b1489c378 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsChannelFactory.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsChannelFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -157,7 +157,7 @@ class WindowsChannelFactory { throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed"); FileDescriptor fdObj = open(pathForWindows, pathToCheck, flags, pSecurityDescriptor); - return FileChannelImpl.open(fdObj, flags.read, flags.write, null); + return FileChannelImpl.open(fdObj, flags.read, flags.write, flags.append, null); } /** @@ -230,7 +230,7 @@ class WindowsChannelFactory { if (flags.read) dwDesiredAccess |= GENERIC_READ; if (flags.write) - dwDesiredAccess |= (flags.append) ? FILE_APPEND_DATA : GENERIC_WRITE; + dwDesiredAccess |= GENERIC_WRITE; int dwShareMode = 0; if (flags.shareRead) diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsDirectoryStream.java b/jdk/src/windows/classes/sun/nio/fs/WindowsDirectoryStream.java index 8b57034383e..9a461f92c82 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsDirectoryStream.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsDirectoryStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/classes/sun/security/krb5/internal/tools/Kinit.java b/jdk/src/windows/classes/sun/security/krb5/internal/tools/Kinit.java index 7a3ba93c60b..f6c53f81f1e 100644 --- a/jdk/src/windows/classes/sun/security/krb5/internal/tools/Kinit.java +++ b/jdk/src/windows/classes/sun/security/krb5/internal/tools/Kinit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +33,7 @@ package sun.security.krb5.internal.tools; import sun.security.krb5.*; import sun.security.krb5.internal.*; import sun.security.krb5.internal.ccache.*; -import java.io.BufferedReader; -import java.io.InputStreamReader; import java.io.IOException; -import java.util.StringTokenizer; -import java.io.File; import java.util.Arrays; import sun.security.util.Password; @@ -152,6 +148,7 @@ public class Kinit { if (principal != null) { princName = principal.toString(); } + KrbAsReqBuilder builder; if (DEBUG) { System.out.println("Principal is " + principal); } @@ -172,6 +169,7 @@ public class Kinit { new String(psswd)); } } + builder = new KrbAsReqBuilder(principal, psswd); } else { if (DEBUG) { System.out.println(">>> Kinit using keytab"); @@ -198,11 +196,13 @@ public class Kinit { } throw new KrbException(msg); } + builder = new KrbAsReqBuilder(principal, skeys); } KDCOptions opt = new KDCOptions(); setOptions(KDCOptions.FORWARDABLE, options.forwardable, opt); setOptions(KDCOptions.PROXIABLE, options.proxiable, opt); + builder.setOptions(opt); String realm = options.getKDCRealm(); if (realm == null) { realm = Config.getInstance().getDefaultRealm(); @@ -215,62 +215,21 @@ public class Kinit { PrincipalName sname = new PrincipalName("krbtgt" + "/" + realm, PrincipalName.KRB_NT_SRV_INST); sname.setRealm(realm); + builder.setTarget(sname); if (DEBUG) { System.out.println(">>> Creating KrbAsReq"); } - KrbAsReq as_req = null; - HostAddresses addresses = null; - try { - if (options.getAddressOption()) - addresses = HostAddresses.getLocalAddresses(); + if (options.getAddressOption()) + builder.setAddresses(HostAddresses.getLocalAddresses()); - if (useKeytab) { - as_req = new KrbAsReq(skeys, opt, - principal, sname, - null, null, null, null, addresses, null); - } else { - as_req = new KrbAsReq(psswd, opt, - principal, sname, - null, null, null, null, addresses, null); - } - } catch (KrbException exc) { - throw exc; - } catch (Exception exc) { - throw new KrbException(exc.toString()); - } - - KrbAsRep as_rep = null; - try { - as_rep = sendASRequest(as_req, useKeytab, realm, psswd, skeys); - } catch (KrbException ke) { - if ((ke.returnCode() == Krb5.KDC_ERR_PREAUTH_FAILED) || - (ke.returnCode() == Krb5.KDC_ERR_PREAUTH_REQUIRED)) { - if (DEBUG) { - System.out.println("Kinit: PREAUTH FAILED/REQ, re-send AS-REQ"); - } - KRBError error = ke.getError(); - int etype = error.getEType(); - String salt = error.getSalt(); - byte[] s2kparams = error.getParams(); - if (useKeytab) { - as_req = new KrbAsReq(skeys, true, etype, salt, - s2kparams, opt, principal, sname, - null, null, null, null, addresses, null); - } else { - as_req = new KrbAsReq(psswd, true, etype, salt, - s2kparams, opt, principal, sname, - null, null, null, null, addresses, null); - } - as_rep = sendASRequest(as_req, useKeytab, realm, psswd, skeys); - } else { - throw ke; - } - } + builder.action(); sun.security.krb5.internal.ccache.Credentials credentials = - as_rep.setCredentials(); + builder.getCCreds(); + builder.destroy(); + // we always create a new cache and store the ticket we get CredentialsCache cache = CredentialsCache.create(principal, options.cachename); @@ -296,41 +255,6 @@ public class Kinit { options = null; // release reference to options } - private static KrbAsRep sendASRequest(KrbAsReq as_req, boolean useKeytab, - String realm, char[] passwd, EncryptionKey[] skeys) - throws IOException, RealmException, KrbException { - - if (DEBUG) { - System.out.println(">>> Kinit: sending as_req to realm " + realm); - } - - String kdc = as_req.send(realm); - - if (DEBUG) { - System.out.println(">>> reading response from kdc"); - } - KrbAsRep as_rep = null; - try { - if (useKeytab) { - as_rep = as_req.getReply(skeys); - } else { - as_rep = as_req.getReply(passwd); - } - } catch (KrbException ke) { - if (ke.returnCode() == Krb5.KRB_ERR_RESPONSE_TOO_BIG) { - as_req.send(realm, kdc, true); // useTCP is set - if (useKeytab) { - as_rep = as_req.getReply(skeys); - } else { - as_rep = as_req.getReply(passwd); - } - } else { - throw ke; - } - } - return as_rep; - } - private static void setOptions(int flag, int option, KDCOptions opt) { switch (option) { case 0: diff --git a/jdk/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java b/jdk/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java index a92cb1b0e43..216c3a30c12 100644 --- a/jdk/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java +++ b/jdk/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 @@ import java.io.File; import java.text.DateFormat; import java.util.Arrays; import java.util.Date; +import java.util.Locale; import sun.security.krb5.internal.crypto.EType; /** * This class can execute as a command-line tool to help the user manage - * entires in the key table. + * entries in the key table. * Available functions include list/add/update/delete service key(s). * * @author Yanni Zhang @@ -60,30 +61,20 @@ public class Ktab { int etype = -1; char[] password = null; + boolean forced = false; // true if delete without prompt. Default false + boolean append = false; // true if new keys are appended. Default false + int vDel = -1; // kvno to delete, -1 all, -2 old. Default -1 + int vAdd = -1; // kvno to add. Default -1, means auto incremented + /** * The main program that can be invoked at command line. - *
      Usage: ktab - *
      available options to Ktab: - *
        - *
      • -l [-e] [-t] list the keytab name and entries, -e show - * encryption etypes, -t show timestamps. - *
      • -a <principal name> - * (<password>) add an entry to the keytab. - * The entry is added only to the keytab. No changes are made to the - * Kerberos database. - *
      • -d <principal name> [<etype>] - * delete an entry from the keytab. - * The entry is deleted only from the keytab. No changes are made to the - * Kerberos database. - *
      • -k <keytab name > - * specify keytab name and path with prefix FILE: - *
      • -help display instructions. + * See {@link #printHelp} for usages. */ public static void main(String[] args) { Ktab ktab = new Ktab(); if ((args.length == 1) && (args[0].equalsIgnoreCase("-help"))) { ktab.printHelp(); - System.exit(0); + return; } else if ((args == null) || (args.length == 0)) { ktab.action = 'l'; } else { @@ -138,8 +129,7 @@ public class Ktab { ktab.deleteEntry(); break; default: - ktab.printHelp(); - System.exit(-1); + ktab.error("A command must be provided"); } } @@ -147,84 +137,129 @@ public class Ktab { * Parses the command line arguments. */ void processArgs(String[] args) { - Character arg = null; + + // Commands (should appear before options): + // -l + // -a + // -d + // Options: + // -e (for -d) + // -e (for -l) + // -n + // -k + // -t + // -f + // -append + // Optional extra arguments: + // password for -a + // [kvno|all|old] for -d + + boolean argAlreadyAppeared = false; for (int i = 0; i < args.length; i++) { - if ((args[i].length() == 2) && (args[i].startsWith("-"))) { - arg = new Character(args[i].charAt(1)); - } else { - printHelp(); - System.exit(-1); - } - switch (arg.charValue()) { - case 'l': - case 'L': - action = 'l'; // list keytab location, name and entries - break; - case 'a': - case 'A': - action = 'a'; // add a new entry to keytab. - i++; - if ((i < args.length) && (!args[i].startsWith("-"))) { - principal = args[i]; - } else { - System.out.println("Please specify the principal name"+ - " after -a option."); - printHelp(); - System.exit(-1); + if (args[i].startsWith("-")) { + switch (args[i].toLowerCase(Locale.US)) { + + // Commands + case "-l": // list + action = 'l'; + break; + case "-a": // add a new entry to keytab. + action = 'a'; + if (++i >= args.length || args[i].startsWith("-")) { + error("A principal name must be specified after -a"); + } + principal = args[i]; + break; + case "-d": // delete entries + action = 'd'; + if (++i >= args.length || args[i].startsWith("-")) { + error("A principal name must be specified after -d"); + } + principal = args[i]; + break; + + // Options + case "-e": + if (action == 'l') { // list etypes + showEType = true; + } else if (action == 'd') { // delete etypes + if (++i >= args.length || args[i].startsWith("-")) { + error("An etype must be specified after -e"); + } + try { + etype = Integer.parseInt(args[i]); + if (etype <= 0) { + throw new NumberFormatException(); + } + } catch (NumberFormatException nfe) { + error(args[i] + " is not a valid etype"); + } + } else { + error(args[i] + " is not valid after -" + action); + } + break; + case "-n": // kvno for -a + if (++i >= args.length || args[i].startsWith("-")) { + error("A KVNO must be specified after -n"); + } + try { + vAdd = Integer.parseInt(args[i]); + if (vAdd < 0) { + throw new NumberFormatException(); + } + } catch (NumberFormatException nfe) { + error(args[i] + " is not a valid KVNO"); + } + break; + case "-k": // specify keytab to use + if (++i >= args.length || args[i].startsWith("-")) { + error("A keytab name must be specified after -k"); + } + if (args[i].length() >= 5 && + args[i].substring(0, 5).equalsIgnoreCase("FILE:")) { + name = args[i].substring(5); + } else { + name = args[i]; + } + break; + case "-t": // list timestamps + showTime = true; + break; + case "-f": // force delete, no prompt + forced = true; + break; + case "-append": // -a, new keys append to file + append = true; + break; + default: + error("Unknown command: " + args[i]); + break; } - if ((i + 1 < args.length) && - (!args[i + 1].startsWith("-"))) { - password = args[i + 1].toCharArray(); - i++; - } else { - password = null; // prompt user for password later. + } else { // optional standalone arguments + if (argAlreadyAppeared) { + error("Useless extra argument " + args[i]); } - break; - case 'd': - case 'D': - action = 'd'; // delete an entry. - i++; - if ((i < args.length) && (!args[i].startsWith("-"))) { - principal = args[i]; - int j = i + 1; - if ((j < args.length) && (!args[j].startsWith("-"))) { - etype = Integer.parseInt(args[j]); - i = j; + if (action == 'a') { + password = args[i].toCharArray(); + } else if (action == 'd') { + switch (args[i]) { + case "all": vDel = -1; break; + case "old": vDel = -2; break; + default: { + try { + vDel = Integer.parseInt(args[i]); + if (vDel < 0) { + throw new NumberFormatException(); + } + } catch (NumberFormatException nfe) { + error(args[i] + " is not a valid KVNO"); + } + } } } else { - System.out.println("Please specify the principal" + - "name of the entry you want to " + - " delete after -d option."); - printHelp(); - System.exit(-1); + error("Useless extra argument " + args[i]); } - break; - case 'k': - case 'K': - i++; - if ((i < args.length) && (!args[i].startsWith("-"))) { - if (args[i].length() >= 5 && - args[i].substring(0, 5).equalsIgnoreCase("FILE:")) { - name = args[i].substring(5); - } else - name = args[i]; - } else { - System.out.println("Please specify the keytab "+ - "file name and location " + - "after -k option"); - printHelp(); - System.exit(-1); - } - break; - case 'e': - showEType = true; - break; - case 't': - showTime = true; - break; - default: - printHelp(); - System.exit(-1); + argAlreadyAppeared = true; } } } @@ -263,7 +298,7 @@ public class Ktab { } try { // admin.addEntry(pname, password); - table.addEntry(pname, password); + table.addEntry(pname, password, vAdd, append); Arrays.fill(password, '0'); // clear password // admin.save(); table.save(); @@ -350,23 +385,25 @@ public class Ktab { if (pname.getRealm() == null) { pname.setRealm(Config.getInstance().getDefaultRealm()); } - String answer; - BufferedReader cis = - new BufferedReader(new InputStreamReader(System.in)); - System.out.print("Are you sure you want to"+ - " delete service key for " + pname.toString() + - " (" + (etype==-1?"all etypes":("etype = "+etype)) + - ") in " + table.tabName() + "?(Y/N): "); + if (!forced) { + String answer; + BufferedReader cis = + new BufferedReader(new InputStreamReader(System.in)); + System.out.print("Are you sure you want to delete "+ + "service key(s) for " + pname.toString() + + " (" + (etype==-1?"all etypes":("etype="+etype)) + ", " + + (vDel==-1?"all kvno":(vDel==-2?"old kvno":("kvno=" + vDel))) + + ") in " + table.tabName() + "? (Y/[N]): "); - System.out.flush(); - answer = cis.readLine(); - if (answer.equalsIgnoreCase("Y") || - answer.equalsIgnoreCase("Yes")); - else { - // no error, the user did not want to delete the entry - System.exit(0); + System.out.flush(); + answer = cis.readLine(); + if (answer.equalsIgnoreCase("Y") || + answer.equalsIgnoreCase("Yes")); + else { + // no error, the user did not want to delete the entry + System.exit(0); + } } - } catch (KrbException e) { System.err.println("Error occured while deleting the entry. "+ "Deletion failed."); @@ -379,9 +416,7 @@ public class Ktab { System.exit(-1); } - int count; - if (etype == -1) count = table.deleteEntry(pname); - else count = table.deleteEntry(pname, etype); + int count = table.deleteEntries(pname, etype, vDel); if (count == 0) { System.err.println("No matched entry in the keytab. " + @@ -396,23 +431,47 @@ public class Ktab { e.printStackTrace(); System.exit(-1); } - System.out.println("Done!"); + System.out.println("Done! " + count + " entries removed."); } } + void error(String... errors) { + for (String error: errors) { + System.out.println("Error: " + error + "."); + } + printHelp(); + System.exit(-1); + } /** * Prints out the help information. */ void printHelp() { - System.out.println("\nUsage: ktab " + - ""); - System.out.println("available options to Ktab:"); - System.out.println("-l [-e] [-t]\t\t\tlist the keytab name and entries,\n\t\t\t\t-e with etype, -t with timestamp"); - System.out.println("-a ()add an entry " + - "to the keytab"); - System.out.println("-d []\tdelete an "+ - "entry from the keytab"); - System.out.println("-k \t\tspecify keytab name and "+ - "path with prefix FILE:"); + System.out.println("\nUsage: ktab "); + System.out.println(); + System.out.println("Available commands:"); + System.out.println(); + System.out.println("-l [-e] [-t]\n" + + " list the keytab name and entries. -e with etype, -t with timestamp."); + System.out.println("-a [] [-n ] [-append]\n" + + " add new key entries to the keytab for the given principal name with\n" + + " optional . If a is specified, new keys' Key Version\n" + + " Numbers equal to the value, otherwise, automatically incrementing\n" + + " the Key Version Numbers. If -append is specified, new keys are\n" + + " appended to the keytab, otherwise, old keys for the\n" + + " same principal are removed."); + System.out.println("-d [-f] [-e ] [ | all | old]\n" + + " delete key entries from the keytab for the specified principal. If\n" + + " is specified, delete keys whose Key Version Numbers match\n" + + " kvno. If \"all\" is specified, delete all keys. If \"old\" is specified,\n" + + " delete all keys except those with the highest kvno. Default action\n" + + " is \"all\". If is specified, only keys of this encryption type\n" + + " are deleted. should be specified as the numberic value etype\n" + + " defined in RFC 3961, section 8. A prompt to confirm the deletion is\n" + + " displayed unless -f is specified."); + System.out.println(); + System.out.println("Common option(s):"); + System.out.println(); + System.out.println("-k \n" + + " specify keytab name and path with prefix FILE:"); } } diff --git a/jdk/src/windows/classes/sun/security/provider/NativeSeedGenerator.java b/jdk/src/windows/classes/sun/security/provider/NativeSeedGenerator.java index 194b970a1e1..dc14b5f6b9f 100644 --- a/jdk/src/windows/classes/sun/security/provider/NativeSeedGenerator.java +++ b/jdk/src/windows/classes/sun/security/provider/NativeSeedGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ class NativeSeedGenerator extends SeedGenerator { */ private static native boolean nativeGenerateSeed(byte[] result); + @Override void getSeedBytes(byte[] result) { // fill array as a side effect if (nativeGenerateSeed(result) == false) { @@ -62,9 +63,4 @@ class NativeSeedGenerator extends SeedGenerator { } } - byte getSeedByte() { - byte[] b = new byte[1]; - getSeedBytes(b); - return b[0]; - } } diff --git a/jdk/src/windows/demo/jvmti/hprof/hprof_md.c b/jdk/src/windows/demo/jvmti/hprof/hprof_md.c index 14ede2bb147..03e77f635d5 100644 --- a/jdk/src/windows/demo/jvmti/hprof/hprof_md.c +++ b/jdk/src/windows/demo/jvmti/hprof/hprof_md.c @@ -29,12 +29,14 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// To ensure winsock2.h is used, it has to be included ahead of +// windows.h, which includes winsock.h by default. +#include #include #include #include #include #include -#include #include #include @@ -147,7 +149,7 @@ md_seek(int filedes, jlong pos) void md_close(int filedes) { - (void)close(filedes); + (void)closesocket(filedes); } int diff --git a/jdk/src/windows/hpi/export/byteorder_md.h b/jdk/src/windows/hpi/export/byteorder_md.h deleted file mode 100644 index 3ff9e162362..00000000000 --- a/jdk/src/windows/hpi/export/byteorder_md.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/*- - * Win32 dependent machine byte ordering (actually intel ordering) - */ - -#ifndef _JAVASOFT_WIN32_BYTEORDER_MD_H_ -#define _JAVASOFT_WIN32_BYTEORDER_MD_H_ - -#ifdef x86 -#define ntohl(x) ((x << 24) | \ - ((x & 0x0000ff00) << 8) | \ - ((x & 0x00ff0000) >> 8) | \ - (((unsigned long)(x & 0xff000000)) >> 24)) -#define ntohs(x) (((x & 0xff) << 8) | ((x >> 8) & (0xff))) -#define htonl(x) ntohl(x) -#define htons(x) ntohs(x) -#else /* x86 */ -#define ntohl(x) (x) -#define ntohs(x) (x) -#define htonl(x) (x) -#define htons(x) (x) -#endif /* x86 */ - -#endif /* !_JAVASOFT_WIN32_BYTEORDER_MD_H_ */ diff --git a/jdk/src/windows/hpi/export/hpi_md.h b/jdk/src/windows/hpi/export/hpi_md.h deleted file mode 100644 index 92b96f50fc3..00000000000 --- a/jdk/src/windows/hpi/export/hpi_md.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef _JAVASOFT_HPI_MD_H_ -#define _JAVASOFT_HPI_MD_H_ - -#include "timeval_md.h" -#include "io_md.h" -#include "path_md.h" -#include "byteorder_md.h" - -#define HPI_TIMEOUT_INFINITY ((jlong)(-1)) - -#endif /* !_JAVASOFT_HPI_MD_H_ */ diff --git a/jdk/src/windows/hpi/export/io_md.h b/jdk/src/windows/hpi/export/io_md.h deleted file mode 100644 index 620533e26f4..00000000000 --- a/jdk/src/windows/hpi/export/io_md.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Win32 system dependent low level io definitions - */ - -#ifndef _JAVASOFT_WIN32_IO_MD_H_ -#define _JAVASOFT_WIN32_IO_MD_H_ - -#include -#include /* For read(), lseek() etc. */ -#include /* For mkdir() */ -#include -#include -#include -#include -#include - -#include "jvm_md.h" - -#define R_OK 4 -#define W_OK 2 -#define X_OK 1 -#define F_OK 0 - -#define MAXPATHLEN _MAX_PATH - -#define S_ISFIFO(mode) (((mode) & _S_IFIFO) == _S_IFIFO) -#define S_ISCHR(mode) (((mode) & _S_IFCHR) == _S_IFCHR) -#define S_ISDIR(mode) (((mode) & _S_IFDIR) == _S_IFDIR) -#define S_ISREG(mode) (((mode) & _S_IFREG) == _S_IFREG) - -#define LINE_SEPARATOR "\r\n" - -#endif /* !_JAVASOFT_WIN32_IO_MD_H_ */ diff --git a/jdk/src/windows/hpi/export/timeval_md.h b/jdk/src/windows/hpi/export/timeval_md.h deleted file mode 100644 index 98392b1d9f0..00000000000 --- a/jdk/src/windows/hpi/export/timeval_md.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef _JAVASOFT_WIN32_TIMEVAL_H_ -#define _JAVASOFT_WIN32_TIMEVAL_H_ - -typedef struct { - long tv_sec; - long tv_usec; -} timeval_t; - -/* - * Operations on timevals. - * - * NB: timercmp does not work for >=, <= or ==. - */ -#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) -#define timercmp(tvp, uvp, cmp) \ - ((tvp)->tv_sec cmp (uvp)->tv_sec || \ - (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) -#define timereq(tvp, uvp) \ - ((tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec == (uvp)->tv_usec) -#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 - -void timeradd(timeval_t*, timeval_t*); -void timersub(timeval_t*, timeval_t*); - -#endif /* !_JAVASOFT_WIN32_TIMEVAL_H_ */ diff --git a/jdk/src/windows/hpi/include/monitor_md.h b/jdk/src/windows/hpi/include/monitor_md.h deleted file mode 100644 index dc74c4c3b0c..00000000000 --- a/jdk/src/windows/hpi/include/monitor_md.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Win32 implementation of Java monitors - */ - -#ifndef _JAVASOFT_WIN32_MONITOR_MD_H_ -#define _JAVASOFT_WIN32_MONITOR_MD_H_ - -#include - -#include "threads_md.h" -#include "mutex_md.h" - -#define SYS_MID_NULL ((sys_mon_t *) 0) - -typedef struct sys_mon { - long atomic_count; /* Variable for atomic compare swap */ - HANDLE semaphore; /* Semaphore used for the contention */ - sys_thread_t *monitor_owner; /* Current owner of this monitor */ - long entry_count; /* Recursion depth */ - sys_thread_t *monitor_waiter; /* Monitor waiting queue head */ - long waiter_count; /* For debugging purpose */ -} sys_mon_t; - -#endif /* !_JAVASOFT_WIN32_MONITOR_MD_H_ */ diff --git a/jdk/src/windows/hpi/include/mutex_md.h b/jdk/src/windows/hpi/include/mutex_md.h deleted file mode 100644 index f927bd0a08f..00000000000 --- a/jdk/src/windows/hpi/include/mutex_md.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Win32 implementation of mutexes. Here we use critical sections as - * our mutexes. We could have used mutexes, but mutexes are heavier - * weight than critical sections. Mutexes and critical sections are - * semantically identical, the only difference being that mutexes - * can operate between processes (i.e. address spaces). - * - * It's worth noting that the Win32 functions supporting critical - * sections do not provide any error information whatsoever (i.e. - * all critical section routines return (void)). - */ - -#ifndef _JAVASOFT_WIN32_MUTEX_MD_H_ -#define _JAVASOFT_WIN32_MUTEX_MD_H_ - -#include - -typedef CRITICAL_SECTION mutex_t; - -#define mutexInit(m) InitializeCriticalSection(m) -#define mutexDestroy(m) DeleteCriticalSection(m) -#define mutexLock(m) EnterCriticalSection(m) -#define mutexUnlock(m) LeaveCriticalSection(m) - -#endif /* !_JAVASOFT_WIN32_MUTEX_MD_H_ */ diff --git a/jdk/src/windows/hpi/include/threads_md.h b/jdk/src/windows/hpi/include/threads_md.h deleted file mode 100644 index 166a880c58f..00000000000 --- a/jdk/src/windows/hpi/include/threads_md.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 1994, 1999, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Win32 implementation of Java threads - */ - -#ifndef _JAVASOFT_WIN32_THREADS_MD_H_ -#define _JAVASOFT_WIN32_THREADS_MD_H_ - -#include - -#define N_TRACED_REGS 7 - -#define SYS_THREAD_NULL ((sys_thread_t *) 0) - -/* - * Machine dependent info in a sys_thread_t: Keep these values in - * sync with the string array used by sysThreadDumpInfo() in threads_md.c! - */ -typedef enum { - FIRST_THREAD_STATE, - RUNNABLE = FIRST_THREAD_STATE, - SUSPENDED, - MONITOR_WAIT, - CONDVAR_WAIT, - MONITOR_SUSPENDED, - NUM_THREAD_STATES -} thread_state_t; - -struct sys_mon; - -/* - * Machine dependent thread data structure - */ -typedef struct sys_thread { - HANDLE handle; /* Win32 thread handle */ - unsigned long id; /* Win32 thread id */ - long regs[N_TRACED_REGS]; /* Registers */ - thread_state_t state; /* Current thread state */ - bool_t system_thread; /* TRUE if this is a system thread */ - bool_t interrupted; /* Shadow thread interruption */ - short suspend_flags; - HANDLE interrupt_event; /* Event signaled on thread interrupt */ - struct sys_mon *wait_monitor; /* Monitor the thread is waiting for */ - struct sys_thread *next_waiter; /* Next thread in the waiting queue */ - struct sys_mon *enter_monitor; /* Monitor thread is waiting to enter */ - void (*start_proc)(void *); /* Thread start routine address */ - void *start_parm; /* Thread start routine parameter */ - struct sys_thread *next; /* Next thread in active thread queue */ - void *stack_ptr; /* Pointer into the stack segment */ - unsigned int last_sum; - PNT_TIB nt_tib; /* Pointer to NT thread-local block */ -} sys_thread_t; - -#define MONITOR_WAIT_SUSPENDED 0x0001 -#define CONDVAR_WAIT_SUSPENDED 0x0002 - -extern bool_t ThreadsInitialized; - -extern sys_mon_t *_sys_queue_lock; - -#define SYS_QUEUE_LOCK(self) sysMonitorEnter(self, _sys_queue_lock) -#define SYS_QUEUE_LOCKED(self) sysMonitorEntered(self, _sys_queue_lock) -#define SYS_QUEUE_UNLOCK(self) sysMonitorExit(self, _sys_queue_lock) -#define SYS_QUEUE_NOTIFYALL(self) sysMonitorNotifyAll(self, _sys_queue_lock) -#define SYS_QUEUE_WAIT(self) sysMonitorWait(self, _sys_queue_lock, \ - SYS_TIMEOUT_INFINITY) - -#endif /* !_JAVASOFT_WIN32_THREADS_MD_H_ */ diff --git a/jdk/src/windows/hpi/src/linker_md.c b/jdk/src/windows/hpi/src/linker_md.c deleted file mode 100644 index f14109a1f66..00000000000 --- a/jdk/src/windows/hpi/src/linker_md.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 1994, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Maintains a list of currently loaded DLLs (Dynamic Link Libraries) - * and their associated handles. Library names are case-insensitive. - */ - -#include -#include -#include - -#include "hpi_impl.h" - -#include "path_md.h" - -/* - * create a string for the JNI native function name by adding the - * appropriate decorations. - * - * On Win32, "__stdcall" functions are exported differently, depending - * on the compiler. In MSVC 4.0, they are decorated with a "_" in the - * beginning, and @nnn in the end, where nnn is the number of bytes in - * the arguments (in decimal). Borland C++ exports undecorated names. - * - * sysBuildFunName handles different encodings depending on the value - * of encodingIndex. It returns 0 when handed an out-of-range - * encodingIndex. - */ -int -sysBuildFunName(char *name, int nameMax, int args_size, int encodingIndex) -{ - if (encodingIndex == 0) { - /* For Microsoft MSVC 4.0 */ - char suffix[6]; /* This is enough since Java never has more than - 256 words of arguments. */ - int nameLen; - int i; - - sprintf(suffix, "@%d", args_size * 4); - - nameLen = strlen(name); - if (nameLen >= nameMax - 7) - return 1; - for(i = nameLen; i > 0; i--) - name[i] = name[i-1]; - name[0] = '_'; - - sprintf(name + nameLen + 1, "%s", suffix); - return 1; - } else if (encodingIndex == 1) - /* For Borland, etc. */ - return 1; - else - return 0; -} - -/* - * Build a machine dependent library name out of a path and file name. - */ -void -sysBuildLibName(char *holder, int holderlen, char *pname, char *fname) -{ - const int pnamelen = pname ? strlen(pname) : 0; - const char c = (pnamelen > 0) ? pname[pnamelen-1] : 0; - - /* Quietly truncates on buffer overflow. Should be an error. */ - if (pnamelen + strlen(fname) + 10 > holderlen) { - *holder = '\0'; - return; - } - - if (pnamelen == 0) { - sprintf(holder, "%s.dll", fname); - } else if (c == ':' || c == '\\') { - sprintf(holder, "%s%s.dll", pname, fname); - } else { - sprintf(holder, "%s\\%s.dll", pname, fname); - } -} - -void * -sysLoadLibrary(const char * name, char *err_buf, int err_buflen) -{ - void *result = LoadLibrary(name); - if (result == NULL) { - /* Error message is pretty lame, try to make a better guess. */ - long errcode = GetLastError(); - if (errcode == ERROR_MOD_NOT_FOUND) { - strncpy(err_buf, "Can't find dependent libraries", err_buflen-2); - err_buf[err_buflen-1] = '\0'; - } else { - sysGetLastErrorString(err_buf, err_buflen); - } - } - return result; -} - -void sysUnloadLibrary(void *handle) -{ - FreeLibrary(handle); -} - -void * sysFindLibraryEntry(void *handle, const char *name) -{ - return GetProcAddress(handle, name); -} diff --git a/jdk/src/windows/hpi/src/memory_md.c b/jdk/src/windows/hpi/src/memory_md.c deleted file mode 100644 index 982a93f2707..00000000000 --- a/jdk/src/windows/hpi/src/memory_md.c +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Copyright (c) 1995, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Implementation of primitive memory allocation. - * - * The only thing machine dependent about this allocator is how it - * initially finds all of the possible memory, and how it implements - * mapChunk() and unmapChunk(). - * - * This is all pretty simple stuff. It is not likely to be banged on - * frequently enough to be a performance issue, unless the underlying - * primitives are. Implementing things: - * - * HPI function Solaris "malloc" Win32 - * -------------------------------------------------------------------- - * sysMapMem() mmap() malloc() VirtualAlloc(...MEM_RESERVE...) - * sysUnMapMem() munmap() free() VirtualFree(...MEM_RESERVE...) - * sysCommitMem() no-op no-op VirtualAlloc(...MEM_COMMIT...) - * sysDecommitMem() no-op no-op VirtualFree(...MEM_COMMIT...) - * - * Memory mapping is the default, but compiling with -DUSE_MALLOC gives - * a system based on malloc(). - */ - -#include -#include - -#include "hpi_impl.h" - -static size_t -roundUp(size_t n, size_t m) -{ - return (n + m - 1) & ~(m - 1); -} - -static size_t -roundDown(size_t n, size_t m) -{ - return n & ~(m - 1); -} - -#define RESERVE_SIZE 65536 /* Memory is reserved in 64KB chunks */ - -static size_t pageSize; /* Machine page size */ - -void -InitializeMem() -{ - SYSTEM_INFO si; - - GetSystemInfo(&si); - pageSize = si.dwPageSize; -} - -/* HPI Functions: */ - -/* - * Map a range of virtual memory. Note that the size asked for here - * is literally what the upper level has asked for. We need to do - * any rounding, etc. here. If mapping fails return 0, otherwise - * return the address of the base of the mapped memory. - */ -void * -sysMapMem(size_t requestedSize, size_t *mappedSize) -{ - void *mappedAddr; - -#ifdef USE_MALLOC - *mappedSize = roundUp(requestedSize, pageSize); - mappedAddr = (void *)malloc(*mappedSize); -#else - *mappedSize = roundUp(requestedSize, RESERVE_SIZE); - mappedAddr = VirtualAlloc(NULL, *mappedSize, MEM_RESERVE, PAGE_READWRITE); -#endif - if (mappedAddr != NULL) { - Log3(2, "sysMapMem: 0x%x bytes at 0x%x (request: 0x%x bytes)\n", - *mappedSize, mappedAddr, requestedSize); - } else { - Log1(2, "sysMapMem failed: (request: 0x%x bytes)\n", requestedSize); - } - return mappedAddr; -} - -/* - * Unmap a range of virtual memory. Note that the size asked for here - * is literally what the upper level has asked for. We need to do any - * rounding, etc. here. If unmapping fails return 0, otherwise return - * the address of the base of the unmapped memory. - */ -void * -sysUnmapMem(void *requestedAddr, size_t requestedSize, size_t *unmappedSize) -{ - void *unmappedAddr; - int ret; - -#ifdef USE_MALLOC - *unmappedSize = roundUp(requestedSize, pageSize); - free(requestedAddr); - ret = TRUE; -#else - *unmappedSize = roundUp(requestedSize, RESERVE_SIZE); - ret = VirtualFree(requestedAddr, 0, MEM_RELEASE); -#endif - if (ret) { - unmappedAddr = requestedAddr; - Log4(2, - "sysUnmapMem: 0x%x bytes at 0x%x (request: 0x%x bytes at 0x%x)\n", - *unmappedSize, unmappedAddr, requestedSize, requestedAddr); - } else { - unmappedAddr = NULL; - Log2(2, "sysUnmapMem failed: (request: 0x%x bytes at 0x%x)\n", - requestedSize, requestedAddr); - } - return unmappedAddr; -} - -/* - * Commit/decommit backing store to a range of virtual memory. This range - * needs not be identical to a mapped range, but must be a subset of one. - * On Solaris, we remap the range to reserve swap for the space on - * commit. We don't strictly need to do this, as Solaris will demand - * page pages that we've mapped when we want to access them. But by - * reserving swap we get reasonable error handling for free where we'd - * otherwise end up getting a SIGBUS on a random write when we run out - * of swap. It also emphasizes the general need for shared code to - * postpone committing to mapped memory for as long as is feasible. - * When Java really needs space (the thread stacks excepted), it will - * soon write over it (heap, markbits), so we don't really get much from - * demand paging. - * - * We do not validate that commitment requests cover already-mapped - * memory, although in principle we could. The size asked for here - * is what the upper level has asked for. We need to do any platform- - * dependent rounding here. - * - * When you commit, you commit to the entire page (or whatever quantum - * your O/S requires) containing the pointer, and return the beginning of - * that page. When you decommit, you decommit starting at the next page - * *up* from that containing the pointer, except that decommitting from - * a pointer to the beginning of the page operates on that page. - */ - -/* - * Return the address of the base of the newly committed memory, or 0 - * if committing failed. - */ -void * -sysCommitMem(void *requestedAddr, size_t requestedSize, size_t *committedSize) -{ - void *committedAddr; - - *committedSize = roundUp(requestedSize, pageSize); - committedAddr = VirtualAlloc(requestedAddr, *committedSize, MEM_COMMIT, - PAGE_READWRITE); - if (committedAddr != NULL) { - Log4(2, - "sysCommitMem: 0x%x bytes at 0x%x (request: 0x%x bytes at 0x%x)\n", - *committedSize, committedAddr, requestedSize, requestedAddr); - } else { - Log2(2, "sysCommitMem failed: (request: 0x%x bytes at 0x%x)\n", - requestedSize, requestedAddr); - } - return committedAddr; -} - -/* - * Return the address of the base of the newly decommitted memory, or 0 - * if decommitting failed. - */ -void * -sysDecommitMem(void *requestedAddr, size_t requestedSize, - size_t *decommittedSize) -{ - void *decommittedAddr; - - /* - * We round the size down to a multiple of the page size and - * round the address up. This ensures that we never decommit - * more that we intend to. - */ - *decommittedSize = roundDown(requestedSize, pageSize); - decommittedAddr = (void *)roundUp((size_t)requestedAddr, pageSize); - - /* - * If the rounded size is equal to zero we simply fail. Passing - * 0 to VirtualFree seems to cause the entire region to be released, - * which is definitely not what we want, since that probably means - * that decommittedAddr is at the end of the current mapping which - * may be the beginning of the next mapping. - */ - if (*decommittedSize != 0 && - VirtualFree(decommittedAddr, *decommittedSize, MEM_DECOMMIT)) { - Log4(2, - "sysDecommitMem: 0x%x bytes at 0x%x (request: 0x%x bytes at 0x%x)\n", - *decommittedSize, decommittedAddr, requestedSize, requestedAddr); - } else { - Log4(2, - "sysDecommitMem: failed 0x%x bytes at 0x%x (request: 0x%x bytes at 0x%x)\n", - *decommittedSize, decommittedAddr, requestedSize, requestedAddr); - decommittedAddr = NULL; - } - return decommittedAddr; -} - -#define PAGED_HEAPS - -#ifdef PAGED_HEAPS - -/* - * Allocate memory on an alignment boundary. Returns aligned - * pointer to new memory. Use sysFreeBlock to free the block. - * - * sysAllocBlock() is similar to memalign(), except that it also - * returns a pointer to the beginning of the block returned by the - * OS, which must be used to deallocate the block. (On some OSes, - * these two won't be the same.) sysAllocBlock() is also more - * limited than memalign in that it can only be used to allocate - * on particular alignments (PAGE_ALIGNMENT) and should be assumed - * to round the sizes of allocated blocks up to multiples of the - * alignment value (PAGE_ALIGNMENT*n bytes). - * - * Note that the use of VirtualAlloc on Win32 is closely tied in to - * the decision for paged heap pages on Win32 to be 64K (that is, - * PAGE_ALIGNMENT is 64K), a reasonable choice in any case. - */ -void * -sysAllocBlock(size_t size, void** allocHead) -{ - void* alignedPtr = VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE); - *allocHead = alignedPtr; - return alignedPtr; -} - -/* - * Wrapper to free block allocated by sysMemAlign. - */ -void -sysFreeBlock(void *allocHead) -{ - VirtualFree(allocHead, 0, MEM_RELEASE); -} - -#endif /* PAGED_HEAPS */ - -void * sysMalloc(size_t s) -{ - if (s == 0) - return malloc(1); - return malloc(s); -} - -void * sysRealloc(void *p, size_t s) -{ - return realloc(p, s); -} - -void sysFree(void *p) -{ - if (p != NULL) - free(p); -} - -void * sysCalloc(size_t s1, size_t s2) -{ - if (s1 == 0 || s2 == 0) - return calloc(1, 1); - return calloc(s1, s2); -} - -char * sysStrdup(const char * string) -{ - return strdup(string); -} diff --git a/jdk/src/windows/hpi/src/monitor_md.c b/jdk/src/windows/hpi/src/monitor_md.c deleted file mode 100644 index 9765f0a51ac..00000000000 --- a/jdk/src/windows/hpi/src/monitor_md.c +++ /dev/null @@ -1,517 +0,0 @@ -/* - * Copyright (c) 1994, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Win32 implementation of Java monitors - */ - -#include - -#include "hpi_impl.h" - -#include "threads_md.h" -#include "monitor_md.h" - -/* - * Use this information to improve performance for single CPU machine. - */ -static int systemIsMP; - -static mutex_t semaphore_init_mutex; -static mutex_t *semaphore_init_mutex_p = NULL; -/* - * Create and initialize monitor. This can be called before threads have - * been initialized. - */ -int -sysMonitorInit(sys_mon_t *mid) -{ - sysAssert(mid != SYS_MID_NULL); - - if (semaphore_init_mutex_p == NULL) { - systemIsMP = sysGetSysInfo()->isMP; - mutexInit(&semaphore_init_mutex); - semaphore_init_mutex_p = &semaphore_init_mutex; - } - - mid->atomic_count = -1; /* -1 for no thread, 0 means 1 thread */ - mid->semaphore = NULL; /* No semaphore until needed */ - mid->monitor_owner = SYS_THREAD_NULL; - mid->entry_count = 0; /* Recursion count */ - mid->monitor_waiter = 0; /* First waiting thread */ - mid->waiter_count = 0; /* Count of waiting and wake-up thread */ - - return SYS_OK; -} - -/* - * Free any system-dependent resources held by monitors. On Win32 this - * means releasing the critical section (mutex) and condition variable - * that are part of each monitor. - */ -int -sysMonitorDestroy(sys_mon_t *mid) -{ - sysAssert(mid != SYS_MID_NULL); - - CloseHandle(mid->semaphore); - - return SYS_OK; -} - -static void initializeSemaphore(HANDLE *pSema) -{ - mutexLock(semaphore_init_mutex_p); - if (*pSema == NULL) { - *pSema = CreateSemaphore(0,0,1,0); - } - mutexUnlock(semaphore_init_mutex_p); -} - -/* - * Take ownership of monitor. This can be called before threads have - * been initialized, in which case we do nothing since locked monitors - * are not yet needed. - - * The actual code is split into two functions, the assembler routine - * handles the fast path, while the C routine handle the slow path, - * including the lazy initialization of monitor semaphore. - * - * REMIND: It is EXTREMELY RISKY to change any of the code without - * thorough understanding of the system, compiler and call convention. - */ - -static int __fastcall sysMonitorEnter2(sys_thread_t *self, sys_mon_t *mid) -{ - if (mid->semaphore == NULL) { - initializeSemaphore(&(mid->semaphore)); - if (mid->semaphore == NULL) { - return SYS_NORESOURCE; - } - } - - self->enter_monitor = mid; - if (profiler_on) { - VM_CALL(monitorContendedEnter)(self, mid); - } - WaitForSingleObject(mid->semaphore, INFINITE); - self->enter_monitor = NULL; - - mid->monitor_owner = self; - mid->entry_count = 1; - - if (profiler_on) { - VM_CALL(monitorContendedEntered)(self, mid); - } - return SYS_OK; -} - -/* - * The following assembler routine is highly compiler specific. - * Because of the complexity, there is no debug error check. - */ - -#ifndef _WIN64 -int __cdecl -sysMonitorEnter(sys_thread_t *self, sys_mon_t *mid) -{ - __asm - { - mov edx, dword ptr [esp+8]; // load mid - mov ecx, dword ptr [esp+4]; // load self - mov eax, dword ptr [edx+8]; // load mid->monitor_owner - - cmp eax, ecx; // if ( self == mid->monitor_owner ) - je RECURSION; // goto RECURSION; - - mov eax, dword ptr [systemIsMP]; - test eax, eax; - jne MPM; - - inc dword ptr [edx]; /* atomic increment mid->atomic_count */ - jne ACQUIRE_SEMAPHORE; /* if there is an owner already */ - - mov dword ptr [edx+8], ecx; /* mid->monitor_owner = self */ - mov dword ptr [edx+12], 1; /* mid->entry_count = 1 */ - xor eax, eax; /* return SYS_OK */ - ret; - -MPM: - lock inc dword ptr [edx]; /* atomic increment mid->atomic_count */ - jne ACQUIRE_SEMAPHORE; /* if there is an owner already */ - - mov dword ptr [edx+8], ecx; /* mid->monitor_owner = self */ - mov dword ptr [edx+12], 1; /* mid->entry_count = 1 */ - xor eax, eax; /* return SYS_OK */ - ret; - -RECURSION: - inc dword ptr [edx+12]; /* Increment mid->entry_count */ - xor eax, eax; /* return SYS_OK */ - ret; - -ACQUIRE_SEMAPHORE: - /* The self is passed by ECX, mid is passed by EDX */ - jmp sysMonitorEnter2; - } -} -#else -int __cdecl -sysMonitorEnter(sys_thread_t *self, sys_mon_t *mid) -{ -return (SYS_NORESOURCE); -} -#endif - -/* - * Return TRUE if this thread currently owns the monitor. This can be - * called before threads have been initialized, in which case we always - * return TRUE. - */ -bool_t -sysMonitorEntered(sys_thread_t *self, sys_mon_t *mid) -{ - sysAssert(mid != SYS_MID_NULL); - sysAssert(self != 0); - sysAssert(ThreadsInitialized); - - return (mid->monitor_owner == self); -} - -/* - * Release ownership of monitor. This can be called before threads have - * been initialized, in which case we do nothing as locked monitors are - * not yet needed. - * - * The actual code is split into two functions, the assembler routine - * handles the fast path, while the C routine handle the slow path. - * - * REMIND: It is EXTREMELY RISKY to change any of the code without - * thorough understanding of the system, compiler and call convention. - */ - -static int __fastcall -sysMonitorExit2(sys_thread_t *self, sys_mon_t *mid) -{ - sysAssert(mid->entry_count == 0); - sysAssert(mid->atomic_count >= 0); - sysAssert(mid->monitor_owner == 0); - - if (mid->semaphore == NULL) { - initializeSemaphore(&(mid->semaphore)); - if (mid->semaphore == NULL) { - return SYS_NORESOURCE; - } - } - - ReleaseSemaphore(mid->semaphore, 1, 0); - - if (profiler_on) { - VM_CALL(monitorContendedExit)(self, mid); - } - - return SYS_OK; -} - -#ifndef _WIN64 -__declspec(naked) int __cdecl -sysMonitorExit(sys_thread_t *self, sys_mon_t *mid) -{ - __asm - { - mov edx, dword ptr [esp+8]; /* load mid */ - mov ecx, dword ptr [esp+4]; /* load self */ - mov eax, dword ptr [edx+8]; /* load mid->monitor_owner */ - - cmp eax, ecx; /* if ( self != mid->monitor_owner ) */ - jne ERR_RET; /* goto ERROR_RET */ - - dec dword ptr [edx+12]; /* dec mid->entry_count */ - jne OK_RET; /* entry_count != 0 */ - - mov dword ptr [edx+8], 0; /* mid->monitor_owner = 0 */ - - mov eax, dword ptr [systemIsMP]; - test eax, eax; - jne MPM; - - dec dword ptr [edx]; /* atomic decrement mid->atomic_count */ - jge RELEASE_SEMAPHORE; /* if ( atomic_variable < 0 ) */ - xor eax, eax; /* return SYS_OK */ - ret; - -MPM: - lock dec dword ptr [edx]; /* atomic decrement mid->atomic_count */ - jge RELEASE_SEMAPHORE; /* if ( atomic_variable < 0 ) */ -OK_RET: - xor eax, eax; - ret; - -ERR_RET: - mov eax, 0FFFFFFFFH; - ret; - -RELEASE_SEMAPHORE: - jmp sysMonitorExit2; /* forwading call */ - } -} -#else -int __cdecl -sysMonitorExit(sys_thread_t *self, sys_mon_t *mid) -{ -return (-1); -} -#endif - -/* - * Notify single thread waiting on condition variable. - */ -int -sysMonitorNotify(sys_thread_t *self, sys_mon_t *mid) -{ - sysAssert(mid != SYS_MID_NULL); - - if (mid->monitor_owner != self) { - return SYS_ERR; - } - - if (mid->monitor_waiter != SYS_THREAD_NULL) - { - sys_thread_t *thread = mid->monitor_waiter; - mid->monitor_waiter = thread->next_waiter; - - thread->next_waiter = SYS_THREAD_NULL; - thread->wait_monitor = SYS_MID_NULL; - - SetEvent(thread->interrupt_event); - } - - return SYS_OK; -} - -/* - * Notify all threads waiting on condition variable. - */ -int -sysMonitorNotifyAll(sys_thread_t *self, sys_mon_t *mid) -{ - sysAssert(mid != SYS_MID_NULL); - - if (mid->monitor_owner != self) { - return SYS_ERR; - } - - while (mid->monitor_waiter != SYS_THREAD_NULL) - { - sys_thread_t *thread = mid->monitor_waiter; - mid->monitor_waiter = thread->next_waiter; - - thread->next_waiter = SYS_THREAD_NULL; - thread->wait_monitor = SYS_MID_NULL; - - SetEvent(thread->interrupt_event); - } - - return SYS_OK; -} - -/* - * Atomically drop mutex and wait for notification. - */ -int -sysMonitorWait(sys_thread_t *self, sys_mon_t *mid, jlong millis) -{ - long entry_count; - DWORD timeout; - - sysAssert(mid != SYS_MID_NULL); - - if (mid->monitor_owner != self) { - return SYS_ERR; - } - - if ( sysThreadIsInterrupted(self, 1) ) { - return SYS_INTRPT; - } - - entry_count = mid->entry_count; - mid->entry_count = 1; - - self->wait_monitor = mid; - self->next_waiter = 0; - - if (mid->monitor_waiter == 0) { - mid->monitor_waiter = self; - } else { - sys_thread_t *thread = mid->monitor_waiter; - while (thread->next_waiter != 0) { - thread = thread->next_waiter; - } - thread->next_waiter = self; - } - - if ( millis == SYS_TIMEOUT_INFINITY || - millis > (jlong)((unsigned int)0xffffffff) ) { - timeout = INFINITE; - } else { - timeout = (long) millis; - } - - mid->waiter_count++; - - sysMonitorExit(self, mid); - - self->state = CONDVAR_WAIT; - - WaitForSingleObject(self->interrupt_event, timeout); - - self->state = RUNNABLE; - - sysMonitorEnter(self, mid); - - mid->waiter_count--; - - mid->entry_count = entry_count; - /* Reset event anyway, prevent racing the timeout */ - ResetEvent(self->interrupt_event); - - if (self->wait_monitor != SYS_MID_NULL) { - sys_thread_t *head; - - sysAssert( self->wait_monitor == mid ); - sysAssert( mid->monitor_waiter != SYS_THREAD_NULL ); - - head = mid->monitor_waiter; - - if (head == self) { - mid->monitor_waiter = self->next_waiter; - } else { - while (head != SYS_THREAD_NULL) { - if (head->next_waiter == self) { - head->next_waiter = self->next_waiter; - break; - } else { - head = head->next_waiter; - } - } - } - - self->next_waiter = SYS_THREAD_NULL; - self->wait_monitor = SYS_MID_NULL; - } - - if ( sysThreadIsInterrupted(self, 1) ) { - return SYS_INTRPT; - } - - return SYS_OK; -} - -static int -dumpWaitingQueue(sys_thread_t *tid, sys_thread_t **waiters, int sz) -{ - int n; - for (n = 0; tid != 0; tid = tid->next_waiter, n++, sz--) { - if (sz > 0) { - waiters[n] = tid; - } - } - return n; -} - -typedef struct { - sys_mon_t *mid; - sys_thread_t **waiters; - int sz; - int nwaiters; -} wait_info; - -static int -findWaitersHelper(sys_thread_t *t, void *arg) -{ - wait_info * winfo = (wait_info *) arg; - if (t->enter_monitor == winfo->mid) { - if (winfo->sz > 0) { - winfo->waiters[winfo->nwaiters] = t; - } - winfo->sz--; - winfo->nwaiters++; - } - return SYS_OK; -} - -int -sysMonitorGetInfo(sys_mon_t *mid, sys_mon_info *info) -{ - wait_info winfo; - - sysAssert(mid != SYS_MID_NULL); - info->owner = mid->monitor_owner; - if (mid->monitor_owner) { - info->entry_count = mid->entry_count; - } - - winfo.mid = mid; - winfo.nwaiters = 0; - winfo.waiters = info->monitor_waiters; - winfo.sz = info->sz_monitor_waiters; - sysThreadEnumerateOver(findWaitersHelper, (void *) &winfo); - info->n_monitor_waiters = winfo.nwaiters; - - info->n_condvar_waiters = dumpWaitingQueue(mid->monitor_waiter, - info->condvar_waiters, - info->sz_condvar_waiters); - - return SYS_OK; -} - -/* - * Return size of system-dependent monitor structure. - */ -size_t -sysMonitorSizeof(void) -{ - return sizeof(struct sys_mon); -} - - -/* - * Return true if there are any threads inside this monitor. - */ -bool_t -sysMonitorInUse(sys_mon_t *mid) -{ - return (mid->atomic_count != -1 - || mid->waiter_count != 0 - || mid->monitor_owner != SYS_THREAD_NULL - || mid->monitor_waiter != SYS_THREAD_NULL); -} - - -sys_thread_t * -sysMonitorOwner(sys_mon_t *mon) -{ - return mon->monitor_owner; -} diff --git a/jdk/src/windows/hpi/src/path_md.c b/jdk/src/windows/hpi/src/path_md.c deleted file mode 100644 index 2f86ceabeb4..00000000000 --- a/jdk/src/windows/hpi/src/path_md.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Machine dependent path name and file name manipulation code - */ - -#include -#include -#include -#include -#include - -#include -#include - -#include "hpi_impl.h" - -#undef DEBUG_PATH /* Define this to debug path code */ - -#define isfilesep(c) ((c) == '/' || (c) == '\\') -#define islb(c) (IsDBCSLeadByte((BYTE)(c))) - - -/* Convert a pathname to native format. On win32, this involves forcing all - separators to be '\\' rather than '/' (both are legal inputs, but Win95 - sometimes rejects '/') and removing redundant separators. The input path is - assumed to have been converted into the character encoding used by the local - system. Because this might be a double-byte encoding, care is taken to - treat double-byte lead characters correctly. - - This procedure modifies the given path in place, as the result is never - longer than the original. There is no error return; this operation always - succeeds. */ - -char * -sysNativePath(char *path) -{ - char *src = path, *dst = path, *end = path; - char *colon = NULL; /* If a drive specifier is found, this will - point to the colon following the drive - letter */ - - /* Assumption: '/', '\\', ':', and drive letters are never lead bytes */ - sysAssert(!islb('/') && !islb('\\') && !islb(':')); - - /* Check for leading separators */ - while (isfilesep(*src)) src++; - if (isalpha(*src) && !islb(*src) && src[1] == ':') { - /* Remove leading separators if followed by drive specifier. This - hack is necessary to support file URLs containing drive - specifiers (e.g., "file://c:/path"). As a side effect, - "/c:/path" can be used as an alternative to "c:/path". */ - *dst++ = *src++; - colon = dst; - *dst++ = ':'; src++; - } else { - src = path; - if (isfilesep(src[0]) && isfilesep(src[1])) { - /* UNC pathname: Retain first separator; leave src pointed at - second separator so that further separators will be collapsed - into the second separator. The result will be a pathname - beginning with "\\\\" followed (most likely) by a host name. */ - src = dst = path + 1; - path[0] = '\\'; /* Force first separator to '\\' */ - } - } - - end = dst; - - /* Remove redundant separators from remainder of path, forcing all - separators to be '\\' rather than '/'. Also, single byte space - characters are removed from the end of the path because those - are not legal ending characters on this operating system. - */ - while (*src != '\0') { - if (isfilesep(*src)) { - *dst++ = '\\'; src++; - while (isfilesep(*src)) src++; - if (*src == '\0') { /* Check for trailing separator */ - end = dst; - if (colon == dst - 2) break; /* "z:\\" */ - if (dst == path + 1) break; /* "\\" */ - if (dst == path + 2 && isfilesep(path[0])) { - /* "\\\\" is not collapsed to "\\" because "\\\\" marks the - beginning of a UNC pathname. Even though it is not, by - itself, a valid UNC pathname, we leave it as is in order - to be consistent with the path canonicalizer as well - as the win32 APIs, which treat this case as an invalid - UNC pathname rather than as an alias for the root - directory of the current drive. */ - break; - } - end = --dst; /* Path does not denote a root directory, so - remove trailing separator */ - break; - } - end = dst; - } else { - if (islb(*src)) { /* Copy a double-byte character */ - *dst++ = *src++; - if (*src) { - *dst++ = *src++; - } - end = dst; - } else { /* Copy a single-byte character */ - char c = *src++; - *dst++ = c; - /* Space is not a legal ending character */ - if (c != ' ') - end = dst; - } - } - } - - *end = '\0'; - - /* For "z:", add "." to work around a bug in the C runtime library */ - if (colon == dst - 1) { - path[2] = '.'; - path[3] = '\0'; - } - -#ifdef DEBUG_PATH - jio_fprintf(stderr, "sysNativePath: %s\n", path); -#endif DEBUG_PATH - return path; -} diff --git a/jdk/src/windows/hpi/src/socket_md.c b/jdk/src/windows/hpi/src/socket_md.c deleted file mode 100644 index 1641650dd4f..00000000000 --- a/jdk/src/windows/hpi/src/socket_md.c +++ /dev/null @@ -1,537 +0,0 @@ -/* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include -#include - -#include "hpi_impl.h" - -#include "mutex_md.h" - -struct sockaddr; - -#define FN_RECV 0 -#define FN_SEND 1 -#define FN_LISTEN 2 -#define FN_BIND 3 -#define FN_ACCEPT 4 -#define FN_RECVFROM 5 -#define FN_SENDTO 6 -#define FN_SELECT 7 -#define FN_CONNECT 8 -#define FN_CLOSESOCKET 9 -#define FN_SHUTDOWN 10 -#define FN_GETHOSTNAME 11 -#define FN_GETHOSTBYADDR 12 -#define FN_GETHOSTBYNAME 13 -#define FN_HTONS 14 -#define FN_HTONL 15 -#define FN_NTOHS 16 -#define FN_NTOHL 17 -#define FN_GETSOCKOPT 18 -#define FN_SETSOCKOPT 19 -#define FN_GETPROTOBYNAME 20 -#define FN_GETSOCKNAME 21 -#define FN_SOCKET 22 -#define FN_WSASENDDISCONNECT 23 -#define FN_SOCKETAVAILABLE 24 - -static int (PASCAL FAR *sockfnptrs[])() = - {NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, - }; - -static bool_t sockfnptrs_initialized = FALSE; -static mutex_t sockFnTableMutex; - -/* is Winsock2 loaded? better to be explicit than to rely on sockfnptrs */ -static bool_t winsock2Available = FALSE; - -/* Winsock2 options at the IPPROTO_IP level - We need the following translation in order to deal with the multiple - definitions for IPPROTO_IP level options in different winsock versions. - -in winsock.h vs. ws2tcpip.h -#define IP_OPTIONS 1 1 -#define IP_MULTICAST_IF 2 9 -#define IP_MULTICAST_TTL 3 10 -#define IP_MULTICAST_LOOP 4 11 -#define IP_ADD_MEMBERSHIP 5 12 -#define IP_DROP_MEMBERSHIP 6 13 -#define IP_TTL 7 4 -#define IP_TOS 8 3 -#define IP_DONTFRAGMENT 9 14 -*/ -static int IPPROTO_OPTIONS[] = {-1, 1, 9, 10, 11, 12, 13, 4, 3, 14}; - -/* IMPORTANT: whenever possible, we want to use Winsock2 (ws2_32.dll) - * instead of Winsock (wsock32.dll). Other than the fact that it is - * newer, less buggy and faster than Winsock, Winsock2 lets us to work - * around the following problem: - * - * Generally speaking, it is important to shutdown a socket before - * closing it, since failing to do so can sometimes result in a TCP - * RST (abortive close) which is disturbing to the peer of the - * connection. - * - * The Winsock way to shutdown a socket is the Berkeley call - * shutdown(). We do not want to call it on Win95, since it - * sporadically leads to an OS crash in IFS_MGR.VXD. Complete hull - * breach. Blue screen. Ugly. - * - * So, in initSockTable we look for Winsock 2, and if we find it we - * assign wsassendisconnectfn function pointer. When we close, we - * first check to see if it's bound, and if it is, we call it. Winsock - * 2 will always be there on NT, and we recommend that win95 user - * install it. - * - * - br 10/11/97 - */ - -static void -initSockFnTable() { - int (PASCAL FAR* WSAStartupPtr)(WORD, LPWSADATA); - WSADATA wsadata; - OSVERSIONINFO info; - - mutexInit(&sockFnTableMutex); - mutexLock(&sockFnTableMutex); - if (sockfnptrs_initialized == FALSE) { - HANDLE hWinsock; - - /* try to load Winsock2, and if that fails, load Winsock */ - hWinsock = LoadLibrary("ws2_32.dll"); - if (hWinsock == NULL) { - hWinsock = LoadLibrary("wsock32.dll"); - winsock2Available = FALSE; - } else { - winsock2Available = TRUE; - } - - if (hWinsock == NULL) { - VM_CALL(jio_fprintf)(stderr, "Could not load Winsock 1 or 2 (error: %d)\n", - GetLastError()); - } - - /* If we loaded a DLL, then we might as well initialize it. */ - WSAStartupPtr = (int (PASCAL FAR *)(WORD, LPWSADATA)) - GetProcAddress(hWinsock, "WSAStartup"); - if (WSAStartupPtr(MAKEWORD(1,1), &wsadata) != 0) { - VM_CALL(jio_fprintf)(stderr, "Could not initialize Winsock\n"); - } - - sockfnptrs[FN_RECV] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "recv"); - sockfnptrs[FN_SEND] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "send"); - sockfnptrs[FN_LISTEN] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "listen"); - sockfnptrs[FN_BIND] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "bind"); - sockfnptrs[FN_ACCEPT] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "accept"); - sockfnptrs[FN_RECVFROM] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "recvfrom"); - sockfnptrs[FN_SENDTO] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "sendto"); - sockfnptrs[FN_SELECT] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "select"); - sockfnptrs[FN_CONNECT] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "connect"); - sockfnptrs[FN_CLOSESOCKET] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "closesocket"); - /* we don't use this */ - sockfnptrs[FN_SHUTDOWN] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "shutdown"); - sockfnptrs[FN_GETHOSTNAME] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "gethostname"); - sockfnptrs[FN_GETHOSTBYADDR] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "gethostbyaddr"); - sockfnptrs[FN_GETHOSTBYNAME] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "gethostbyname"); - sockfnptrs[FN_HTONS] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "htons"); - sockfnptrs[FN_HTONL] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "htonl"); - sockfnptrs[FN_NTOHS] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "ntohs"); - sockfnptrs[FN_NTOHL] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "ntohl"); - sockfnptrs[FN_GETSOCKOPT] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "getsockopt"); - sockfnptrs[FN_SETSOCKOPT] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "setsockopt"); - sockfnptrs[FN_GETPROTOBYNAME] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "getprotobyname"); - sockfnptrs[FN_GETSOCKNAME] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "getsockname"); - - sockfnptrs[FN_SOCKET] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, "socket"); - /* in winsock 1, this will simply be 0 */ - sockfnptrs[FN_WSASENDDISCONNECT] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, - "WSASendDisconnect"); - sockfnptrs[FN_SOCKETAVAILABLE] - = (int (PASCAL FAR *)())GetProcAddress(hWinsock, - "ioctlsocket"); - } - - sysAssert(sockfnptrs[FN_RECV] != NULL); - sysAssert(sockfnptrs[FN_SEND] != NULL); - sysAssert(sockfnptrs[FN_LISTEN] != NULL); - sysAssert(sockfnptrs[FN_BIND] != NULL); - sysAssert(sockfnptrs[FN_ACCEPT] != NULL); - sysAssert(sockfnptrs[FN_RECVFROM] != NULL); - sysAssert(sockfnptrs[FN_SENDTO] != NULL); - sysAssert(sockfnptrs[FN_SELECT] != NULL); - sysAssert(sockfnptrs[FN_CONNECT] != NULL); - sysAssert(sockfnptrs[FN_CLOSESOCKET] != NULL); - sysAssert(sockfnptrs[FN_SHUTDOWN] != NULL); - sysAssert(sockfnptrs[FN_GETHOSTNAME] != NULL); - sysAssert(sockfnptrs[FN_GETHOSTBYADDR] != NULL); - sysAssert(sockfnptrs[FN_GETHOSTBYNAME] != NULL); - sysAssert(sockfnptrs[FN_HTONS] != NULL); - sysAssert(sockfnptrs[FN_HTONL] != NULL); - sysAssert(sockfnptrs[FN_NTOHS] != NULL); - sysAssert(sockfnptrs[FN_NTOHL] != NULL); - sysAssert(sockfnptrs[FN_GETSOCKOPT] != NULL); - sysAssert(sockfnptrs[FN_SETSOCKOPT] != NULL); - sysAssert(sockfnptrs[FN_GETPROTOBYNAME] != NULL); - sysAssert(sockfnptrs[FN_GETSOCKNAME] != NULL); - sysAssert(sockfnptrs[FN_SOCKET] != NULL); - - if (winsock2Available) { - sysAssert(sockfnptrs[FN_WSASENDDISCONNECT] != NULL); - } - - sysAssert(sockfnptrs[FN_SOCKETAVAILABLE] != NULL); - - sockfnptrs_initialized = TRUE; - mutexUnlock(&sockFnTableMutex); -} - -/* - * If we get a nonnull function pointer it might still be the case - * that some other thread is in the process of initializing the socket - * function pointer table, but our pointer should still be good. - */ -int -sysListen(int fd, int count) { - int (PASCAL FAR *listenfn)(); - if ((listenfn = sockfnptrs[FN_LISTEN]) == NULL) { - initSockFnTable(); - listenfn = sockfnptrs[FN_LISTEN]; - } - sysAssert(sockfnptrs_initialized == TRUE && listenfn != NULL); - return (*listenfn)(fd, (long)count); -} - -int -sysConnect(int fd, struct sockaddr *name, int namelen) { - int (PASCAL FAR *connectfn)(); - if ((connectfn = sockfnptrs[FN_CONNECT]) == NULL) { - initSockFnTable(); - connectfn = sockfnptrs[FN_CONNECT]; - } - sysAssert(sockfnptrs_initialized == TRUE); - sysAssert(connectfn != NULL); - return (*connectfn)(fd, name, namelen); -} - -int -sysBind(int fd, struct sockaddr *name, int namelen) { - int (PASCAL FAR *bindfn)(); - if ((bindfn = sockfnptrs[FN_BIND]) == NULL) { - initSockFnTable(); - bindfn = sockfnptrs[FN_BIND]; - } - sysAssert(sockfnptrs_initialized == TRUE); - sysAssert(bindfn != NULL); - return (*bindfn)(fd, name, namelen); -} - -int -sysAccept(int fd, struct sockaddr *name, int *namelen) { - int (PASCAL FAR *acceptfn)(); - if ((acceptfn = sockfnptrs[FN_ACCEPT]) == NULL) { - initSockFnTable(); - acceptfn = sockfnptrs[FN_ACCEPT]; - } - sysAssert(sockfnptrs_initialized == TRUE && acceptfn != NULL); - return (*acceptfn)(fd, name, namelen); -} - -int -sysRecvFrom(int fd, char *buf, int nBytes, - int flags, struct sockaddr *from, int *fromlen) { - int (PASCAL FAR *recvfromfn)(); - if ((recvfromfn = sockfnptrs[FN_RECVFROM]) == NULL) { - initSockFnTable(); - recvfromfn = sockfnptrs[FN_RECVFROM]; - } - sysAssert(sockfnptrs_initialized == TRUE && recvfromfn != NULL); - return (*recvfromfn)(fd, buf, nBytes, flags, from, fromlen); -} - -int -sysSendTo(int fd, char *buf, int len, - int flags, struct sockaddr *to, int tolen) { - int (PASCAL FAR *sendtofn)(); - if ((sendtofn = sockfnptrs[FN_SENDTO]) == NULL) { - initSockFnTable(); - sendtofn = sockfnptrs[FN_SENDTO]; - } - sysAssert(sockfnptrs_initialized == TRUE && sendtofn != NULL); - return (*sendtofn)(fd, buf, len, flags, to, tolen); -} - -int -sysRecv(int fd, char *buf, int nBytes, int flags) { - int (PASCAL FAR *recvfn)(); - if ((recvfn = sockfnptrs[FN_RECV]) == NULL) { - initSockFnTable(); - recvfn = sockfnptrs[FN_RECV]; - } - sysAssert(sockfnptrs_initialized == TRUE && recvfn != NULL); - return (*recvfn)(fd, buf, nBytes, flags); -} - -int -sysSend(int fd, char *buf, int nBytes, int flags) { - int (PASCAL FAR *sendfn)(); - if ((sendfn = sockfnptrs[FN_SEND]) == NULL) { - initSockFnTable(); - sendfn = sockfnptrs[FN_SEND]; - } - sysAssert(sockfnptrs_initialized == TRUE && sendfn != NULL); - return (*sendfn)(fd, buf, nBytes, flags); -} - - -int -sysGetHostName(char *hostname, int namelen) { - int (PASCAL FAR *fn)(); - if ((fn = sockfnptrs[FN_GETHOSTNAME]) == NULL) { - initSockFnTable(); - fn = sockfnptrs[FN_GETHOSTNAME]; - } - sysAssert(sockfnptrs_initialized == TRUE && fn != NULL); - return (*fn)(hostname, namelen); -} - -struct hostent * -sysGetHostByAddr(const char *hostname, int len, int type) { - struct hostent * (PASCAL FAR *fn)(); - if ((fn = (struct hostent * (PASCAL FAR *)()) sockfnptrs[FN_GETHOSTBYADDR]) == NULL) { - initSockFnTable(); - fn = (struct hostent * (PASCAL FAR *)()) sockfnptrs[FN_GETHOSTBYADDR]; - } - sysAssert(sockfnptrs_initialized == TRUE && fn != NULL); - return (*fn)(hostname, len, type); -} - -struct hostent * -sysGetHostByName(char *hostname) { - struct hostent * (PASCAL FAR *fn)(); - if ((fn = (struct hostent * (PASCAL FAR *)()) sockfnptrs[FN_GETHOSTBYNAME]) == NULL) { - initSockFnTable(); - fn = (struct hostent * (PASCAL FAR *)()) sockfnptrs[FN_GETHOSTBYNAME]; - } - sysAssert(sockfnptrs_initialized == TRUE && fn != NULL); - return (*fn)(hostname); -} - -int -sysSocket(int domain, int type, int protocol) { - int sock; - int (PASCAL FAR *socketfn)(); - if ((socketfn = sockfnptrs[FN_SOCKET]) == NULL) { - initSockFnTable(); - socketfn = sockfnptrs[FN_SOCKET]; - } - sysAssert(sockfnptrs_initialized == TRUE && socketfn != NULL); - sock = (*socketfn)(domain, type, protocol); - if (sock != INVALID_SOCKET) { - SetHandleInformation((HANDLE)(uintptr_t)sock, HANDLE_FLAG_INHERIT, FALSE); - } - return sock; -} - -int sysSocketShutdown(int fd, int how) { - if (fd > 0) { - int (PASCAL FAR *shutdownfn)(); - if ((shutdownfn = sockfnptrs[FN_SHUTDOWN]) == NULL) { - initSockFnTable(); - shutdownfn = sockfnptrs[FN_SHUTDOWN]; - } - /* At this point we are guaranteed the sockfnptrs are initialized */ - sysAssert(sockfnptrs_initialized == TRUE && shutdownfn != NULL); - (void) (*shutdownfn)(fd, how); - } -return TRUE; -} - -/* - * This function is carefully designed to work around a bug in Windows - * 95's networking winsock. Please see the beginning of this file for - * a complete description of the problem. - */ -int sysSocketClose(int fd) { - - if (fd > 0) { - int (PASCAL FAR *closesocketfn)(); - int (PASCAL FAR *wsasenddisconnectfn)(); - int dynamic_ref = -1; - - if ((closesocketfn = sockfnptrs[FN_CLOSESOCKET]) == NULL) { - initSockFnTable(); - } - /* At this point we are guaranteed the sockfnptrs are initialized */ - sysAssert(sockfnptrs_initialized == TRUE); - - closesocketfn = sockfnptrs[FN_CLOSESOCKET]; - sysAssert(closesocketfn != NULL); - - if (winsock2Available) { - struct linger l; - int len = sizeof(l); - - if (sysGetSockOpt(fd, SOL_SOCKET, SO_LINGER, (char *)&l, &len) == 0) { - if (l.l_onoff == 0) { - wsasenddisconnectfn = sockfnptrs[FN_WSASENDDISCONNECT]; - (*wsasenddisconnectfn)(fd, NULL); - } - } - } - (void) (*closesocketfn)(fd); - } - return TRUE; -} - -/* - * Poll the fd for reading for timeout ms. Returns 1 if something's - * ready, 0 if it timed out, -1 on error, -2 if interrupted (although - * interruption isn't implemented yet). Timeout in milliseconds. */ -int -sysTimeout(int fd, long timeout) { - int res; - fd_set tbl; - struct timeval t; - int (PASCAL FAR *selectfn)(); - - t.tv_sec = timeout / 1000; - t.tv_usec = (timeout % 1000) * 1000; - FD_ZERO(&tbl); - FD_SET(fd, &tbl); - - if ((selectfn = sockfnptrs[FN_SELECT]) == NULL) { - initSockFnTable(); - selectfn = sockfnptrs[FN_SELECT]; - } - sysAssert(sockfnptrs_initialized == TRUE && selectfn != NULL); - res = (*selectfn)(fd + 1, &tbl, 0, 0, &t); - return res; -} - -long -sysSocketAvailable(int fd, jint *pbytes) -{ - int (PASCAL FAR *socketfn)(); - if ((socketfn = sockfnptrs[FN_SOCKETAVAILABLE]) == NULL) { - initSockFnTable(); - socketfn = sockfnptrs[FN_SOCKETAVAILABLE]; - } - sysAssert(sockfnptrs_initialized == TRUE && socketfn != NULL); - return (*socketfn)(fd, FIONREAD, pbytes); -} - -int -sysGetSockName(int fd, struct sockaddr *name, int *namelen) { - int (PASCAL FAR *getsocknamefn)(); - if ((getsocknamefn = sockfnptrs[FN_GETSOCKNAME]) == NULL) { - initSockFnTable(); - getsocknamefn = sockfnptrs[FN_GETSOCKNAME]; - } - sysAssert(sockfnptrs_initialized == TRUE); - sysAssert(getsocknamefn != NULL); - return (*getsocknamefn)(fd, name, namelen); -} - -int -sysGetSockOpt(int fd, int level, int optname, char *optval, int *optlen ) { - int (PASCAL FAR *getsockoptfn)(); - if ((getsockoptfn = sockfnptrs[FN_GETSOCKOPT]) == NULL) { - initSockFnTable(); - getsockoptfn = sockfnptrs[FN_GETSOCKOPT]; - } - sysAssert(sockfnptrs_initialized == TRUE); - sysAssert(getsockoptfn != NULL); - - /* We need the following translation in order to deal with the multiple - definitions for IPPROTO_IP level options in different winsock versions - */ - if (winsock2Available && level == IPPROTO_IP && - optname >= IP_OPTIONS && optname <= IP_DONTFRAGMENT) { - optname = IPPROTO_OPTIONS[optname]; - } - return (*getsockoptfn)(fd, level, optname, optval, optlen); -} - -int -sysSetSockOpt(int fd, int level, int optname, const char *optval, int optlen ) { - int (PASCAL FAR *setsockoptfn)(); - if ((setsockoptfn = sockfnptrs[FN_SETSOCKOPT]) == NULL) { - initSockFnTable(); - setsockoptfn = sockfnptrs[FN_SETSOCKOPT]; - } - sysAssert(sockfnptrs_initialized == TRUE); - sysAssert(setsockoptfn != NULL); - - /* We need the following translation in order to deal with the multiple - definitions for IPPROTO_IP level options in different winsock versions - */ - if (winsock2Available && level == IPPROTO_IP && - optname >= IP_OPTIONS && optname <= IP_DONTFRAGMENT) { - optname = IPPROTO_OPTIONS[optname]; - } - - return (*setsockoptfn)(fd, level, optname, optval, optlen); -} - -struct protoent * -sysGetProtoByName(char *name) { - struct protoent * (PASCAL FAR *getprotobynamefn)(); - if ((getprotobynamefn = (struct protoent * (PASCAL FAR *)()) sockfnptrs[FN_GETPROTOBYNAME]) == NULL) { - initSockFnTable(); - getprotobynamefn = (struct protoent * (PASCAL FAR *)()) sockfnptrs[FN_GETPROTOBYNAME]; - } - sysAssert(sockfnptrs_initialized == TRUE); - sysAssert(getprotobynamefn != NULL); - return (*getprotobynamefn)(name); -} diff --git a/jdk/src/windows/hpi/src/sys_api_md.c b/jdk/src/windows/hpi/src/sys_api_md.c deleted file mode 100644 index 514b3c5529f..00000000000 --- a/jdk/src/windows/hpi/src/sys_api_md.c +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "hpi_impl.h" - -#include "path_md.h" - -static int MAX_INPUT_EVENTS = 2000; - -int -sysOpen(const char *path, int oflag, int mode) -{ - char pathbuf[MAX_PATH]; - - if (strlen(path) > MAX_PATH - 1) { - errno = ENAMETOOLONG; - return -1; - } - return open(sysNativePath(strcpy(pathbuf, path)), - oflag | O_BINARY | O_NOINHERIT, mode); -} - - -static int -nonSeekAvailable(int, long *); -static int -stdinAvailable(int, long *); - -int -sysAvailable(int fd, jlong *pbytes) { - jlong cur, end; - struct _stati64 stbuf64; - - if (_fstati64(fd, &stbuf64) >= 0) { - int mode = stbuf64.st_mode; - if (S_ISCHR(mode) || S_ISFIFO(mode)) { - int ret; - long lpbytes; - if (fd == 0) { - ret = stdinAvailable(fd, &lpbytes); - } else { - ret = nonSeekAvailable(fd, &lpbytes); - } - (*pbytes) = (jlong)(lpbytes); - return ret; - } - if ((cur = _lseeki64(fd, 0L, SEEK_CUR)) == -1) { - return FALSE; - } else if ((end = _lseeki64(fd, 0L, SEEK_END)) == -1) { - return FALSE; - } else if (_lseeki64(fd, cur, SEEK_SET) == -1) { - return FALSE; - } - *pbytes = end - cur; - return TRUE; - } else { - return FALSE; - } -} - -static int -nonSeekAvailable(int fd, long *pbytes) { - /* This is used for available on non-seekable devices - * (like both named and anonymous pipes, such as pipes - * connected to an exec'd process). - * Standard Input is a special case. - * - */ - HANDLE han; - - if ((han = (HANDLE) _get_osfhandle(fd)) == (HANDLE)(-1)) { - return FALSE; - } - - if (! PeekNamedPipe(han, NULL, 0, NULL, pbytes, NULL)) { - /* PeekNamedPipe fails when at EOF. In that case we - * simply make *pbytes = 0 which is consistent with the - * behavior we get on Solaris when an fd is at EOF. - * The only alternative is to raise an Exception, - * which isn't really warranted. - */ - if (GetLastError() != ERROR_BROKEN_PIPE) { - return FALSE; - } - *pbytes = 0; - } - return TRUE; -} - -static int -stdinAvailable(int fd, long *pbytes) { - HANDLE han; - DWORD numEventsRead = 0; /* Number of events read from buffer */ - DWORD numEvents = 0; /* Number of events in buffer */ - DWORD i = 0; /* Loop index */ - DWORD curLength = 0; /* Position marker */ - DWORD actualLength = 0; /* Number of bytes readable */ - BOOL error = FALSE; /* Error holder */ - INPUT_RECORD *lpBuffer; /* Pointer to records of input events */ - - if ((han = GetStdHandle(STD_INPUT_HANDLE)) == INVALID_HANDLE_VALUE) { - return FALSE; - } - - /* Construct an array of input records in the console buffer */ - error = GetNumberOfConsoleInputEvents(han, &numEvents); - if (error == 0) { - return nonSeekAvailable(fd, pbytes); - } - - /* lpBuffer must fit into 64K or else PeekConsoleInput fails */ - if (numEvents > MAX_INPUT_EVENTS) { - numEvents = MAX_INPUT_EVENTS; - } - - lpBuffer = sysMalloc(numEvents * sizeof(INPUT_RECORD)); - if (lpBuffer == NULL) { - return FALSE; - } - - error = PeekConsoleInput(han, lpBuffer, numEvents, &numEventsRead); - if (error == 0) { - sysFree(lpBuffer); - return FALSE; - } - - /* Examine input records for the number of bytes available */ - for(i=0; ibKeyDown == TRUE) { - CHAR *keyPressed = (CHAR *) &(keyRecord->uChar); - curLength++; - if (*keyPressed == '\r') - actualLength = curLength; - } - } - } - if(lpBuffer != NULL) - sysFree(lpBuffer); - *pbytes = (long) actualLength; - return TRUE; -} - -/* - * This is documented to succeed on read-only files, but Win32's - * FlushFileBuffers functions fails with "access denied" in such a - * case. So we only signal an error if the error is *not* "access - * denied". - */ - -int -sysSync(int fd) { - /* - * From the documentation: - * - * On Windows NT, the function FlushFileBuffers fails if hFile - * is a handle to console output. That is because console - * output is not buffered. The function returns FALSE, and - * GetLastError returns ERROR_INVALID_HANDLE. - * - * On the other hand, on Win95, it returns without error. I cannot - * assume that 0, 1, and 2 are console, because if someone closes - * System.out and then opens a file, they might get file descriptor - * 1. An error on *that* version of 1 should be reported, whereas - * an error on System.out (which was the original 1) should be - * ignored. So I use isatty() to ensure that such an error was due - * to this bogosity, and if it was, I ignore the error. - */ - - HANDLE handle = (HANDLE)_get_osfhandle(fd); - - if (!FlushFileBuffers(handle)) { - if (GetLastError() != ERROR_ACCESS_DENIED) { /* from winerror.h */ - return -1; - } - } - return 0; -} - - -int -sysSetLength(int fd, jlong length) { - HANDLE h = (HANDLE)_get_osfhandle(fd); - long high = (long)(length >> 32); - DWORD ret; - - if (h == (HANDLE)(-1)) return -1; - ret = SetFilePointer(h, (long)(length), &high, FILE_BEGIN); - if (ret == 0xFFFFFFFF && GetLastError() != NO_ERROR) { - return -1; - } - if (SetEndOfFile(h) == FALSE) return -1; - return 0; -} - -int -sysFileSizeFD(int fd, jlong *size) -{ - struct _stati64 buf64; - - if(_fstati64(fd, &buf64) < 0) { - return -1; - } - (*size) = buf64.st_size; - - if (*size & 0xFFFFFFFF00000000) { - /* - * On Win98 accessing a non-local file we have observed a - * bogus file size of 0x100000000. So if upper 32 bits - * are non-zero we re-calculate the size using lseek. This - * should work for any file size, but it might have a - * performance impact relative to fstati64. Note: Hotspot - * doesn't have this problem because it uses stat rather - * than fstat or fstati64. - */ - - jlong curpos; - jlong endpos; - jlong newpos; - - curpos = _lseeki64(fd, 0, SEEK_CUR); - if (curpos < 0) { - return -1; - } - endpos = _lseeki64(fd, 0, SEEK_END); - if (endpos < 0) { - return -1; - } - newpos = _lseeki64(fd, curpos, SEEK_SET); - if (newpos != curpos) { - return -1; - } - (*size) = endpos; - - } - return 0; -} - -int -sysFfileMode(int fd, int *mode) -{ - int ret; - struct _stati64 buf64; - ret = _fstati64(fd, &buf64); - (*mode) = buf64.st_mode; - return ret; -} - -int -sysFileType(const char *path) -{ - int ret; - struct _stati64 buf; - - if ((ret = _stati64(path, &buf)) == 0) { - int mode = buf.st_mode & S_IFMT; - if (mode == S_IFREG) return SYS_FILETYPE_REGULAR; - if (mode == S_IFDIR) return SYS_FILETYPE_DIRECTORY; - return SYS_FILETYPE_OTHER; - } - return ret; -} - -size_t sysRead(int fd, void *buf, unsigned int nBytes) -{ - return read(fd, buf, nBytes); -} - -size_t sysWrite(int fd, const void *buf, unsigned int nBytes) -{ - return write(fd, buf, nBytes); -} - -int sysClose(int fd) -{ - return close(fd); -} - -jlong sysSeek(int fd, jlong offset, int whence) -{ - return _lseeki64(fd, offset, whence); -} diff --git a/jdk/src/windows/hpi/src/system_md.c b/jdk/src/windows/hpi/src/system_md.c deleted file mode 100644 index d45c8d657a0..00000000000 --- a/jdk/src/windows/hpi/src/system_md.c +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 1994, 2002, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include -#include /* For constants for _control87() */ -#include -#include /* For _tzset() and _ftime() */ -#include - -#include "hpi_impl.h" - -#include "jni_md.h" -#include "monitor_md.h" - - -static int pending_signals[NSIG]; -static HANDLE sigEvent; -static CRITICAL_SECTION userSigMon; - - -void sysSignalNotify(int sig) -{ - sys_thread_t *self = sysThreadSelf(); - EnterCriticalSection(&userSigMon); - pending_signals[sig]++; - LeaveCriticalSection(&userSigMon); - SetEvent(sigEvent); -} - -static int lookupSignal() -{ - int i; - EnterCriticalSection(&userSigMon); - for (i = 0; i < NSIG; i++) { - if (pending_signals[i]) { - pending_signals[i]--; - LeaveCriticalSection(&userSigMon); - return i; - } - } - LeaveCriticalSection(&userSigMon); - return -1; -} - -int sysSignalWait() -{ - int sig; - while ((sig = lookupSignal()) == -1) { - WaitForSingleObject(sigEvent, INFINITE); - } - return sig; -} - -signal_handler_t sysSignal(int sig, signal_handler_t newHandler) -{ - return (signal_handler_t)signal(sig, (void (*)(int))newHandler); -} - -void sysRaise(int sig) -{ - raise(sig); -} - -int sysThreadBootstrap(sys_thread_t **tidP, sys_mon_t **lockP, int nb) -{ - extern void InitializeMem(void); - - threadBootstrapMD(tidP, lockP, nb); - - sigEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - InitializeCriticalSection(&userSigMon); - memset(pending_signals, 0, sizeof(pending_signals)); - - /* - * Change default for std. streams stdout, stderr, - * stdin to be O_BINARY not O_TEXT. The `\r` characters - * corrupt binary files. - */ - - _setmode(0, O_BINARY); - _setmode(1, O_BINARY); - _setmode(2, O_BINARY); - - /* - * Set floating point processor to no floating point exceptions. - * See bug 4027374. Should be the same values VC++ would set them - * to, but by doing this here we ensure other dll's don't override. - */ - _control87(_MCW_EM | _RC_NEAR | _PC_53, _MCW_EM | _MCW_RC | _MCW_PC); - - InitializeMem(); - - return SYS_OK; -} - -long -sysGetMilliTicks(void) -{ - return(GetTickCount()); -} - -#define FT2INT64(ft) \ - ((jlong)(ft).dwHighDateTime << 32 | (jlong)(ft).dwLowDateTime) - -jlong -sysTimeMillis(void) -{ - static jlong fileTime_1_1_70 = 0; - SYSTEMTIME st0; - FILETIME ft0; - - if (fileTime_1_1_70 == 0) { - /* Initialize fileTime_1_1_70 -- the Win32 file time of midnight - * 1/1/70. - */ - - memset(&st0, 0, sizeof(st0)); - st0.wYear = 1970; - st0.wMonth = 1; - st0.wDay = 1; - SystemTimeToFileTime(&st0, &ft0); - fileTime_1_1_70 = FT2INT64(ft0); - } - - GetSystemTime(&st0); - SystemTimeToFileTime(&st0, &ft0); - - return (FT2INT64(ft0) - fileTime_1_1_70) / 10000; -} - -void * -sysAllocateMem(long size) -{ - return malloc(size); -} - -int sysShutdown() -{ - return SYS_OK; -} - -unsigned -sleep(unsigned seconds) -{ - Sleep(seconds * 1000); - return 0; -} - -int -sysGetLastErrorString(char *buf, int len) -{ - long errval; - - if ((errval = GetLastError()) != 0) { - /* DOS error */ - int n = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, errval, - 0, buf, len, NULL); - if (n > 3) { - /* Drop final '.', CR, LF */ - if (buf[n - 1] == '\n') n--; - if (buf[n - 1] == '\r') n--; - if (buf[n - 1] == '.') n--; - buf[n] = '\0'; - } - return n; - } - - if (errno != 0) { - /* C runtime error that has no corresponding DOS error code */ - const char *s = strerror(errno); - int n = strlen(s); - if (n >= len) n = len - 1; - strncpy(buf, s, n); - buf[n] = '\0'; - return n; - } - - return 0; -} diff --git a/jdk/src/windows/hpi/src/threads_md.c b/jdk/src/windows/hpi/src/threads_md.c deleted file mode 100644 index 7bc98038b44..00000000000 --- a/jdk/src/windows/hpi/src/threads_md.c +++ /dev/null @@ -1,831 +0,0 @@ -/* - * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Win32 implementation of Java threads - */ - -#include "hpi_impl.h" - -#include -#include /* for _beginthreadex(), _endthreadex() */ -#include - -#include "threads_md.h" -#include "monitor_md.h" - - -/* - * Queue of active Java threads - */ -static sys_thread_t *ThreadQueue; -sys_mon_t *_sys_queue_lock; - -static int ActiveThreadCount = 0; /* All threads */ - -/* - * Set to TRUE once threads have been bootstrapped - */ -bool_t ThreadsInitialized = FALSE; - -/* - * Are we running under Window NT - */ -static bool_t windowsNT = FALSE; - -/* - * Thread local storage index used for looking up sys_thread_t struct - * (tid) associated with the current thread. - */ -#define TLS_INVALID_INDEX 0xffffffffUL -static unsigned long tls_index = TLS_INVALID_INDEX; - -static void RecordNTTIB(sys_thread_t *tid) -{ -#ifndef _WIN64 - PNT_TIB nt_tib; - __asm { - mov eax, dword ptr fs:[18h]; - mov nt_tib, eax; - } - tid->nt_tib = nt_tib; -#else - tid->nt_tib = 0; -#endif -} - -/* - * Add thread to queue of active threads. - */ -static void -queueInsert(sys_thread_t *tid) -{ - if (ThreadsInitialized) - SYS_QUEUE_LOCK(sysThreadSelf()); - ActiveThreadCount++; - tid->next = ThreadQueue; - ThreadQueue = tid; - if (ThreadsInitialized) - SYS_QUEUE_UNLOCK(sysThreadSelf()); - else - ThreadsInitialized = TRUE; -} - -/* - * Remove thread from queue of active threads. - */ -static void -removefromActiveQ(sys_thread_t *tid) -{ - sysAssert(SYS_QUEUE_LOCKED(sysThreadSelf())); - --ActiveThreadCount; - - if (ThreadQueue == tid) { - ThreadQueue = tid->next; - } else { - sys_thread_t *p; - for (p = ThreadQueue; p->next != 0; p = p->next) { - if (p->next == tid) { - p->next = tid->next; - break; - } - } - } -} - -/* - * Allocate and initialize the sys_thread_t structure for an arbitary - * native thread. - */ -int -sysThreadAlloc(sys_thread_t **tidP) -{ - HANDLE hnd = GetCurrentProcess(); - sys_thread_t *tid = allocThreadBlock(); - if (tid == NULL) { - return SYS_NOMEM; - } - - tid->state = RUNNABLE; - tid->interrupted = FALSE; - tid->interrupt_event = CreateEvent(NULL, TRUE, FALSE, NULL); - tid->id = GetCurrentThreadId(); - DuplicateHandle(hnd, GetCurrentThread(), hnd, &tid->handle, 0, FALSE, - DUPLICATE_SAME_ACCESS); - - RecordNTTIB(tid); - /* For the Invocation API: - We update the thread-specific storage before locking the - queue because sysMonitorEnter will access sysThreadSelf. - */ - TlsSetValue(tls_index, tid); - - queueInsert(tid); - tid->stack_ptr = &tid; - *tidP = tid; - return SYS_OK; -} - -/* - * Bootstrap the Java thread system by making the current thread the - * "primordial" thread. - */ -int threadBootstrapMD(sys_thread_t **tidP, sys_mon_t **lockP, int nb) -{ - OSVERSIONINFO windowsVersion; - HANDLE hnd = GetCurrentProcess(); - - nReservedBytes = (nb + 7) & (~7); - /* - * Allocate TLS index for thread-specific data. - */ - tls_index = TlsAlloc(); - if (tls_index == TLS_INVALID_INDEX) { - VM_CALL(jio_fprintf)(stderr, "TlsAlloc failed (errcode = %x)\n", - GetLastError()); - return SYS_NOMEM; - } - - /* OS properties */ - windowsVersion.dwOSVersionInfoSize = sizeof(windowsVersion); - GetVersionEx(&windowsVersion); - windowsNT = windowsVersion.dwPlatformId == VER_PLATFORM_WIN32_NT; - - /* Initialize the queue lock monitor */ - _sys_queue_lock = (sys_mon_t *)sysMalloc(sysMonitorSizeof()); - if (_sys_queue_lock == NULL) { - return SYS_ERR; - } - VM_CALL(monitorRegister)(_sys_queue_lock, "Thread queue lock"); - *lockP = _sys_queue_lock; - - return sysThreadAlloc(tidP); -} - -/* - * Return current stack pointer of specified thread. - */ -void * -sysThreadStackPointer(sys_thread_t *tid) -{ -#ifndef _WIN64 - CONTEXT context; - WORD __current_SS; - - /* REMIND: Need to fix this for Win95 */ - context.ContextFlags = CONTEXT_CONTROL; - if (!GetThreadContext(tid->handle, &context)) { - VM_CALL(jio_fprintf)(stderr, "GetThreadContext failed (errcode = %x)\n", - GetLastError()); - return 0; - } - - /* With the NT TIB stuff that Hong came up with, I don't think we - * need any of the complicated VirtualQuery calls anymore. If - * context.Esp is within the stack limit and base, we return - * context.Esp, otherwise, we can simply return nt_tib->StackLimit. - * To minimize code changes, though, I'm keeping the code the way - * it was. - */ - if (tid->nt_tib == NULL) { - /* thread hasn't started yet. */ - return 0; - } - - __asm { - mov ax, ss; - mov __current_SS, ax; - } - - if (context.SegSs == __current_SS && - context.Esp >= (uintptr_t)(tid->nt_tib->StackLimit) && - context.Esp < (uintptr_t)(tid->nt_tib->StackBase)) { - MEMORY_BASIC_INFORMATION mbi; - - VirtualQuery((PBYTE) context.Esp, &mbi, sizeof(mbi)); - - if (!(mbi.Protect & PAGE_GUARD)) { - return (void *) context.Esp; - } else { - SYSTEM_INFO si; - char *Esp = (char*) context.Esp; - DWORD dwPageSize; - - GetSystemInfo(&si); - dwPageSize = si.dwPageSize; - Esp -= (((DWORD) Esp) % dwPageSize); - do { - Esp += dwPageSize; - VirtualQuery((PBYTE) Esp, &mbi, sizeof(mbi)); - } while (mbi.Protect & PAGE_GUARD); - return Esp; - } - } else { - /* segment selectors don't match - thread is in some weird context */ - MEMORY_BASIC_INFORMATION mbi; - PBYTE pbStackHwm, pbStackBase; - SYSTEM_INFO si; - DWORD dwPageSize; - stackp_t stack_ptr = tid->stack_ptr; - - if (stack_ptr == 0) { - return 0; - } - GetSystemInfo(&si); - dwPageSize = si.dwPageSize; - VirtualQuery((PBYTE)stack_ptr - 1, &mbi, sizeof(mbi)); - pbStackBase = (PBYTE)mbi.AllocationBase; - /* step backwards till beginning of segment, non-RW page, or guard - page (guard pages only on WinNT) */ - do { - pbStackHwm = (PBYTE)mbi.BaseAddress; - if (pbStackHwm <= pbStackBase) { - break; - } - VirtualQuery(pbStackHwm - dwPageSize, &mbi, sizeof(mbi)); - } - while ((mbi.Protect & PAGE_READWRITE) && - !(mbi.Protect & PAGE_GUARD)); - /* the best we can do for now is the first page of stack - storage - it should be a stack high-water mark, anyway */ - return (void *)pbStackHwm; - } -#else - return 0; -#endif -} - -/* - * Get the end of stack (if you step beyond (above or below depending - * on your architecture) you can die. We refer to the logical top of - * stack. - * - * NOTE! There are restrictions about when you can call this method. If - * you did a sysThreadAlloc, then you can call this method as soon as - * sysThreadAlloc returns. If you called sysThreadCreate(start_function), - * then you must call sysThreadStackTop only inside start_function and not - * as soon as sysThreadCreate returns. - */ -void * -sysThreadStackTop(sys_thread_t *tid) -{ - return 0; /* FIXME: Unimplemented. */ -} - -long * -sysThreadRegs(sys_thread_t *tid, int *nregs) -{ - *nregs = N_TRACED_REGS; - return tid->regs; -} - -/* - * Thread start routine for new Java threads - */ -static unsigned __stdcall -_start(sys_thread_t *tid) -{ - /* Should thread suspend itself at this point? */ - - tid->state = RUNNABLE; - RecordNTTIB(tid); - TlsSetValue(tls_index, tid); - tid->stack_ptr = &tid; - tid->start_proc(tid->start_parm); - sysThreadFree(); - _endthreadex(0); - /* not reached */ - return 0; -} - -/* - * Create a new Java thread. The thread is initially suspended. - */ -int -sysThreadCreate(sys_thread_t **tidP, long stack_size, - void (*proc)(void *), void *arg) -{ - sys_thread_t *tid = allocThreadBlock(); - if (tid == NULL) { - return SYS_NOMEM; - } - tid->state = SUSPENDED; - tid->start_proc = proc; - tid->start_parm = arg; - - tid->interrupt_event = CreateEvent(NULL, TRUE, FALSE, NULL); - - /* - * Start the new thread. - */ - tid->handle = (HANDLE)_beginthreadex(NULL, stack_size, _start, tid, - CREATE_SUSPENDED, &tid->id); - if (tid->handle == 0) { - return SYS_NORESOURCE; /* Will be treated as though SYS_NOMEM */ - } - - queueInsert(tid); - *tidP = tid; - return SYS_OK; -} - -/* - * Free a system thread block. - * Remove from the thread queue. - */ -int -sysThreadFree() -{ - sys_thread_t *tid = sysThreadSelf(); - - /* - * remove ourselves from the thread queue. This must be done after - * the notify above since monitor operations aren't really safe if - * your thread isn't on the thread queue. (This isn't true of - * the sysMonitor* functions, only monitor*) - */ - SYS_QUEUE_LOCK(tid); - removefromActiveQ(tid); - SYS_QUEUE_UNLOCK(tid); - - /* For invocation API: later sysThreadSelf() calls will return 0 */ - TlsSetValue(tls_index, 0); - - /* - * Close the thread and interrupt event handles, and free the - * sys_thread_t structure. - */ - CloseHandle(tid->handle); - CloseHandle(tid->interrupt_event); - freeThreadBlock(tid); - return SYS_OK; -} - -/* - * Yield control to another thread. - */ -void -sysThreadYield(void) -{ - Sleep(0); -} - -/* - * Suspend execution of the specified thread. - */ -int -sysThreadSuspend(sys_thread_t *tid) -{ - /* REMIND: Fix for Win95 */ - /* Set state first so state is reflected before this thread */ - /* returns. Fix suggested by ARB of SAS */ - thread_state_t oldstate = tid->state; - sys_thread_t *self = sysThreadSelf(); - - if (tid == self) { - self->state = SUSPENDED; - } else { - switch(tid->state) { - case RUNNABLE: - tid->state = SUSPENDED; - break; - case MONITOR_WAIT: - tid->state = SUSPENDED; - tid->suspend_flags |= MONITOR_WAIT_SUSPENDED; - break; - case CONDVAR_WAIT: - tid->state = SUSPENDED; - tid->suspend_flags |= CONDVAR_WAIT_SUSPENDED; - break; - case SUSPENDED: - case MONITOR_SUSPENDED: - default: - return SYS_ERR; - } - } - if (SuspendThread(tid->handle) == 0xffffffffUL) { - tid->state = oldstate; - tid->suspend_flags = 0; - return SYS_ERR; - } - return SYS_OK; -} - -/* - * Continue execution of the specified thread. - */ -int -sysThreadResume(sys_thread_t *tid) -{ - unsigned long n; - - if (tid->suspend_flags & MONITOR_WAIT_SUSPENDED) { - tid->suspend_flags = 0; - tid->state = MONITOR_WAIT; - } else if (tid->suspend_flags & CONDVAR_WAIT_SUSPENDED) { - tid->suspend_flags = 0; - tid->state = CONDVAR_WAIT; - } else { - switch(tid->state) { - case SUSPENDED: - tid->state = RUNNABLE; - break; - case MONITOR_SUSPENDED: - tid->state = MONITOR_WAIT; - break; - case RUNNABLE: - case MONITOR_WAIT: - case CONDVAR_WAIT: - default: - return SYS_ERR; - break; - } - } - - /* Decrement thread's suspend count until no longer suspended */ - while ((n = ResumeThread(tid->handle)) > 1) { - if (n == 0xffffffffUL) { - return SYS_ERR; - } - } - return SYS_OK; -} - -/* - * Return priority of specified thread. - */ -int -sysThreadGetPriority(sys_thread_t *tid, int *pp) -{ - switch (GetThreadPriority(tid->handle)) { - case THREAD_PRIORITY_IDLE: - *pp = 0; break; - case THREAD_PRIORITY_LOWEST: - *pp = 2; break; - case THREAD_PRIORITY_BELOW_NORMAL: - *pp = 4; break; - case THREAD_PRIORITY_NORMAL: - *pp = 5; break; - case THREAD_PRIORITY_ABOVE_NORMAL: - *pp = 6; break; - case THREAD_PRIORITY_HIGHEST: - *pp = 8; break; - case THREAD_PRIORITY_TIME_CRITICAL: - *pp = 10; break; - case THREAD_PRIORITY_ERROR_RETURN: - return SYS_ERR; - } - return SYS_OK; -} - -/* - * Set priority of specified thread. - */ -int -sysThreadSetPriority(sys_thread_t *tid, int p) -{ - int priority; - - switch (p) { - case 0: - priority = THREAD_PRIORITY_IDLE; - break; - case 1: case 2: - priority = THREAD_PRIORITY_LOWEST; - break; - case 3: case 4: - priority = THREAD_PRIORITY_BELOW_NORMAL; - break; - case 5: - priority = THREAD_PRIORITY_NORMAL; - break; - case 6: case 7: - priority = THREAD_PRIORITY_ABOVE_NORMAL; - break; - case 8: case 9: - priority = THREAD_PRIORITY_HIGHEST; - break; - case 10: - priority = THREAD_PRIORITY_TIME_CRITICAL; - break; - default: - return SYS_ERR; - } - return SetThreadPriority(tid->handle, priority) ? SYS_OK : SYS_ERR; -} - -/* - * Return the thread information block of the calling thread. - */ -sys_thread_t * -sysThreadSelf(void) -{ - return tls_index == 0xffffffffUL ? 0 : TlsGetValue(tls_index); -} - -/* - * Enumerate over all threads in active queue calling a function for - * each one. Expects the caller to lock _queue_lock - */ -int -sysThreadEnumerateOver(int (*func)(sys_thread_t *, void *), void *arg) -{ - sys_thread_t *tid; - int ret = SYS_OK; - sys_thread_t *self = sysThreadSelf(); - - sysAssert(SYS_QUEUE_LOCKED(sysThreadSelf())); - - for (tid = ThreadQueue; tid != 0; tid = tid->next) { - if ((ret = (*func)(tid, arg)) != SYS_OK) { - break; - } - } - return ret; -} - -/* - * Helper function for sysThreadSingle() - */ -static int -threadSingleHelper(sys_thread_t *tid, void *self) -{ - if (tid == self) { - return SYS_OK; - } - if (SuspendThread(tid->handle) == 0xffffffffUL) { - return SYS_ERR; - } - { - CONTEXT context; - DWORD *esp = (DWORD *)tid->regs; - - context.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL; - if (!GetThreadContext(tid->handle, &context)) { - VM_CALL(jio_fprintf) - (stderr, "GetThreadContext failed (errcode = %x)\n", - GetLastError()); - return SYS_ERR; - } -#ifdef _M_AMD64 - *esp++ = context.Rax; - *esp++ = context.Rbx; - *esp++ = context.Rcx; - *esp++ = context.Rdx; - *esp++ = context.Rsi; - *esp++ = context.Rdi; - *esp = context.Rbp; -#else - *esp++ = context.Eax; - *esp++ = context.Ebx; - *esp++ = context.Ecx; - *esp++ = context.Edx; - *esp++ = context.Esi; - *esp++ = context.Edi; - *esp = context.Ebp; -#endif - } - return SYS_OK; -} - -/* - * Puts each thread in the active thread queue to sleep except for the - * calling thread. The threads must be later woken up with a corresponding - * call to 'sysThreadMulti'. Returns SYS_OK on success, or SYS_ERR if any - * of the threads could not be suspended. - */ -int -sysThreadSingle(void) -{ - return sysThreadEnumerateOver(threadSingleHelper, sysThreadSelf()); -} - -/* - * Helper function for sysThreadMulti(): Only ResumeThread once, unlike - * sysThreadResume(), which will repeatedly call ResumeThread until the - * thread is really resumed. That is, Thread.resume will unwind any - * number of Thread.suspend invocations, but sysThreadMulti() calls must - * be strictly matched with sysThreadSingle() calls. Doing this keeps - * the garbage collector, which uses thread suspension to stop threads - * while it operates, from waking up threads that were already suspended - * when GC was invoked. - */ -static int -threadMultiHelper(sys_thread_t *tid, void *self) -{ - if (tid == self || ResumeThread(tid->handle) != 0xffffffffUL) { - return SYS_OK; - } else { - return SYS_ERR; - } -} - -/* - * Wakes up each thread in active thread queue except for the calling - * thread. The mechanism uses thread suspension, and will not wake a - * thread that was already suspended. Must be matched 1-1 with calls - * to sysThreadSingle(). Returns SYS_ERR if not all threads could be - * woken up. - */ -void -sysThreadMulti(void) -{ - sysThreadEnumerateOver(threadMultiHelper, sysThreadSelf()); -} - -/* - * Dump system-specific information about threads. - */ -void * -sysThreadNativeID(sys_thread_t *tid) -{ - return (void *)(uintptr_t)tid->id; -} - -int -sysThreadCheckStack(void) -{ - return 1; -} - -/* - * The mechanics of actually signalling an exception (in the future, - * and Alarm or Interrupt) depend upon what thread implementation you - * are using. - */ -void -sysThreadPostException(sys_thread_t *tid, void *exc) -{ - /* Interrupt the thread if it's waiting; REMIND: race??? */ - SetEvent(tid->interrupt_event); -} - -/* - * Support for (Java-level) interrupts. - */ -void -sysThreadInterrupt(sys_thread_t *tid) -{ - if (tid->interrupted == FALSE) { - tid->interrupted = TRUE; - SetEvent(tid->interrupt_event); - } -} - -int -sysThreadIsInterrupted(sys_thread_t *tid, int ClearInterrupted) -{ - bool_t interrupted = tid->interrupted; - if (interrupted && ClearInterrupted) { - tid->interrupted = FALSE; - ResetEvent(tid->interrupt_event); - } - return interrupted; -} - -HPI_SysInfo * -sysGetSysInfo() -{ - static HPI_SysInfo info = {0, 0}; - - if (info.name == NULL) { - SYSTEM_INFO sysinfo; - GetSystemInfo(&sysinfo); - info.isMP = sysinfo.dwNumberOfProcessors > 1; - info.name = "native threads"; - } - return &info; -} - -#define FT2INT64(ft) \ - ((jlong)(ft).dwHighDateTime << 32 | (jlong)(ft).dwLowDateTime) - -jlong -sysThreadCPUTime() -{ - if (windowsNT) { - FILETIME CreationTime; - FILETIME ExitTime; - FILETIME KernelTime; - FILETIME UserTime; - - GetThreadTimes(GetCurrentThread(), - &CreationTime, &ExitTime, &KernelTime, &UserTime); - return FT2INT64(UserTime) * 100; - } else { - return (jlong)sysGetMilliTicks() * 1000000; - } -} - -int -sysThreadGetStatus(sys_thread_t *tid, sys_mon_t **monitorPtr) -{ - int status; - switch (tid->state) { - case RUNNABLE: - if (tid->enter_monitor) - status = SYS_THREAD_MONITOR_WAIT; - else - status = SYS_THREAD_RUNNABLE; - break; - case SUSPENDED: - if (tid->enter_monitor) - status = SYS_THREAD_SUSPENDED | SYS_THREAD_MONITOR_WAIT; - else if (tid->suspend_flags & CONDVAR_WAIT_SUSPENDED) - status = SYS_THREAD_SUSPENDED | SYS_THREAD_CONDVAR_WAIT; - else - status = SYS_THREAD_SUSPENDED; - break; - case MONITOR_SUSPENDED: - status = SYS_THREAD_SUSPENDED | SYS_THREAD_MONITOR_WAIT; - break; - case CONDVAR_WAIT: - status = SYS_THREAD_CONDVAR_WAIT; - break; - case MONITOR_WAIT: - /* - * this flag should never be in used on win32 since the - * state is actually signalled by setting self->enter_monitor - * to point at the monitor the thread is waiting to enter - */ - sysAssert(FALSE); - default: - return SYS_ERR; - } - if (monitorPtr) { - if (status & SYS_THREAD_MONITOR_WAIT) { - *monitorPtr = tid->enter_monitor; - } else if (status & SYS_THREAD_CONDVAR_WAIT) { - *monitorPtr = tid->wait_monitor; - } else { - *monitorPtr = NULL; - } - } - return status; -} - -int sysAdjustTimeSlice(int i) -{ - return JNI_ERR; -} - -void sysThreadProfSuspend(sys_thread_t *tid) -{ - SuspendThread(tid->handle); -} - -void sysThreadProfResume(sys_thread_t *tid) -{ - ResumeThread(tid->handle); -} - -bool_t sysThreadIsRunning(sys_thread_t *tid) -{ -#ifndef _M_AMD64 - unsigned int sum = 0; - unsigned int *p; - CONTEXT context; - - context.ContextFlags = CONTEXT_FULL; - GetThreadContext(tid->handle, &context); - p = &context.SegGs; - while (p <= &context.SegSs) { - sum += *p; - p++; - } - - if (sum == tid->last_sum) { - return FALSE; - } - tid->last_sum = sum; -#endif - return TRUE; -} - -void * -sysThreadInterruptEvent() -{ - return sysThreadSelf()->interrupt_event; -} diff --git a/jdk/src/windows/lib/tzmappings b/jdk/src/windows/lib/tzmappings index bbc3ca09ce2..7f6f0d36052 100644 --- a/jdk/src/windows/lib/tzmappings +++ b/jdk/src/windows/lib/tzmappings @@ -188,5 +188,6 @@ UTC-02:920,920::GMT-0200: UTC-11:921,921::GMT-1100: Ulaanbaatar Standard Time:922,922::Asia/Ulaanbaatar: Venezuela Standard Time:923,923::America/Caracas: -Western Brazilian Standard Time:924,924:BR:America/Rio_Branco: -Armenian Standard Time:925,925:AM:Asia/Yerevan: +Magadan Standard Time:924,924::Asia/Magadan: +Western Brazilian Standard Time:925,925:BR:America/Rio_Branco: +Armenian Standard Time:926,926:AM:Asia/Yerevan: diff --git a/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp b/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp index e17de1b8755..ce19bbaa810 100644 --- a/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp +++ b/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -476,6 +476,7 @@ DS_StartBufferHelper::Data::~Data() { DWORD WINAPI __stdcall DS_StartBufferHelper::ThreadProc(void *param) { + ::CoInitialize(NULL); while (1) { // wait for something to do ::WaitForSingleObject(data.startEvent, INFINITE); @@ -492,6 +493,7 @@ DWORD WINAPI __stdcall DS_StartBufferHelper::ThreadProc(void *param) } ::SetEvent(data.startedEvent); } + ::CoUninitialize(); return 0; } diff --git a/jdk/src/windows/native/common/jni_util_md.c b/jdk/src/windows/native/common/jni_util_md.c index 4f22836d0b2..5b90a59ceea 100644 --- a/jdk/src/windows/native/common/jni_util_md.c +++ b/jdk/src/windows/native/common/jni_util_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/java/io/FileOutputStream_md.c b/jdk/src/windows/native/java/io/FileOutputStream_md.c index 221ba504f5f..567ebaa0c83 100644 --- a/jdk/src/windows/native/java/io/FileOutputStream_md.c +++ b/jdk/src/windows/native/java/io/FileOutputStream_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 +61,15 @@ Java_java_io_FileOutputStream_open(JNIEnv *env, jobject this, } JNIEXPORT void JNICALL -Java_java_io_FileOutputStream_write(JNIEnv *env, jobject this, jint byte) { - writeSingle(env, this, byte, fos_fd); +Java_java_io_FileOutputStream_write(JNIEnv *env, jobject this, jint byte, jboolean append) { + writeSingle(env, this, byte, append, fos_fd); } JNIEXPORT void JNICALL Java_java_io_FileOutputStream_writeBytes(JNIEnv *env, - jobject this, jbyteArray bytes, jint off, jint len) { - writeBytes(env, this, bytes, off, len, fos_fd); + jobject this, jbyteArray bytes, jint off, jint len, jboolean append) +{ + writeBytes(env, this, bytes, off, len, append, fos_fd); } JNIEXPORT void JNICALL diff --git a/jdk/src/windows/native/java/io/WinNTFileSystem_md.c b/jdk/src/windows/native/java/io/WinNTFileSystem_md.c index 633d20e578a..23ff9e5dfec 100644 --- a/jdk/src/windows/native/java/io/WinNTFileSystem_md.c +++ b/jdk/src/windows/native/java/io/WinNTFileSystem_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/java/io/io_util_md.c b/jdk/src/windows/native/java/io/io_util_md.c index 722913f775a..3b6723eed6b 100644 --- a/jdk/src/windows/native/java/io/io_util_md.c +++ b/jdk/src/windows/native/java/io/io_util_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -225,14 +225,7 @@ pathToNTPath(JNIEnv *env, jstring path, jboolean throwFNFE) { jlong winFileHandleOpen(JNIEnv *env, jstring path, int flags) { - /* To implement O_APPEND, we use the strategy from - http://msdn2.microsoft.com/en-us/library/aa363858.aspx - "You can get atomic append by opening a file with - FILE_APPEND_DATA access and _without_ FILE_WRITE_DATA access. - If you do this then all writes will ignore the current file - pointer and be done at the end-of file." */ const DWORD access = - (flags & O_APPEND) ? (FILE_GENERIC_WRITE & ~FILE_WRITE_DATA) : (flags & O_WRONLY) ? GENERIC_WRITE : (flags & O_RDWR) ? (GENERIC_READ | GENERIC_WRITE) : GENERIC_READ; @@ -307,7 +300,6 @@ handleStdinAvailable(jlong, long *); int handleAvailable(jlong fd, jlong *pbytes) { - jlong current, end; HANDLE h = (HANDLE)fd; DWORD type = 0; @@ -327,18 +319,17 @@ handleAvailable(jlong fd, jlong *pbytes) { } /* Handle is for regular file */ if (type == FILE_TYPE_DISK) { - long highPos = 0; - DWORD sizeLow = 0; - DWORD sizeHigh = 0; - DWORD lowPos = SetFilePointer(h, 0, &highPos, FILE_CURRENT); - if (lowPos == ((DWORD)-1)) { + jlong current, end; + + LARGE_INTEGER filesize; + current = handleLseek(fd, 0, SEEK_CUR); + if (current < 0) { return FALSE; } - current = (((jlong)highPos) << 32) | lowPos; - end = GetFileSize(h, &sizeHigh); - if (sizeLow == ((DWORD)-1)) { + if (GetFileSizeEx(h, &filesize) == 0) { return FALSE; } + end = long_to_jlong(filesize.QuadPart); *pbytes = end - current; return TRUE; } @@ -511,24 +502,42 @@ handleRead(jlong fd, void *buf, jint len) return read; } -JNIEXPORT -size_t -handleWrite(jlong fd, const void *buf, jint len) +static size_t writeInternal(jlong fd, const void *buf, jint len, jboolean append) { BOOL result = 0; DWORD written = 0; HANDLE h = (HANDLE)fd; if (h != INVALID_HANDLE_VALUE) { - result = WriteFile(h, /* File handle to write */ - buf, /* pointers to the buffers */ - len, /* number of bytes to write */ - &written, /* receives number of bytes written */ - NULL); /* no overlapped struct */ + OVERLAPPED ov; + LPOVERLAPPED lpOv; + if (append == JNI_TRUE) { + ov.Offset = (DWORD)0xFFFFFFFF; + ov.OffsetHigh = (DWORD)0xFFFFFFFF; + ov.hEvent = NULL; + lpOv = &ov; + } else { + lpOv = NULL; + } + result = WriteFile(h, /* File handle to write */ + buf, /* pointers to the buffers */ + len, /* number of bytes to write */ + &written, /* receives number of bytes written */ + lpOv); /* overlapped struct */ } if ((h == INVALID_HANDLE_VALUE) || (result == 0)) { return -1; } - return written; + return (size_t)written; +} + +JNIEXPORT +size_t handleWrite(jlong fd, const void *buf, jint len) { + return writeInternal(fd, buf, len, JNI_FALSE); +} + +JNIEXPORT +size_t handleAppend(jlong fd, const void *buf, jint len) { + return writeInternal(fd, buf, len, JNI_TRUE); } jint @@ -558,6 +567,7 @@ handleClose(JNIEnv *env, jobject this, jfieldID fid) jlong handleLseek(jlong fd, jlong offset, jint whence) { + LARGE_INTEGER pos, distance; DWORD lowPos = 0; long highPos = 0; DWORD op = FILE_CURRENT; @@ -573,13 +583,9 @@ handleLseek(jlong fd, jlong offset, jint whence) op = FILE_BEGIN; } - lowPos = (DWORD)offset; - highPos = (long)(offset >> 32); - lowPos = SetFilePointer(h, lowPos, &highPos, op); - if (lowPos == ((DWORD)-1)) { - if (GetLastError() != ERROR_SUCCESS) { - return -1; - } + distance.QuadPart = offset; + if (SetFilePointerEx(h, distance, &pos, op) == 0) { + return -1; } - return (((jlong)highPos) << 32) | lowPos; + return long_to_jlong(pos.QuadPart); } diff --git a/jdk/src/windows/native/java/io/io_util_md.h b/jdk/src/windows/native/java/io/io_util_md.h index 6b6b89b6397..d979970ede0 100644 --- a/jdk/src/windows/native/java/io/io_util_md.h +++ b/jdk/src/windows/native/java/io/io_util_md.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ JNIEXPORT int handleSync(jlong fd); int handleSetLength(jlong fd, jlong length); JNIEXPORT size_t handleRead(jlong fd, void *buf, jint len); JNIEXPORT size_t handleWrite(jlong fd, const void *buf, jint len); +JNIEXPORT size_t handleAppend(jlong fd, const void *buf, jint len); jint handleClose(JNIEnv *env, jobject this, jfieldID fid); jlong handleLseek(jlong fd, jlong offset, jint whence); @@ -74,8 +75,9 @@ jlong winFileHandleOpen(JNIEnv *env, jstring path, int flags); #define THIS_FD(obj) (*env)->GetLongField(env, obj, IO_handle_fdID) /* - * Route the routines away from HPI layer + * Route the routines away from VM */ +#define IO_Append handleAppend #define IO_Write handleWrite #define IO_Sync handleSync #define IO_Read handleRead diff --git a/jdk/src/windows/native/java/lang/ProcessImpl_md.c b/jdk/src/windows/native/java/lang/ProcessImpl_md.c index e5fe23e71ec..89dc8252a3a 100644 --- a/jdk/src/windows/native/java/lang/ProcessImpl_md.c +++ b/jdk/src/windows/native/java/lang/ProcessImpl_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -315,3 +315,51 @@ Java_java_lang_ProcessImpl_closeHandle(JNIEnv *env, jclass ignored, jlong handle { return CloseHandle((HANDLE) handle); } + +/** + * Returns a copy of the Unicode characters of a string. Fow now this + * function doesn't handle long path names and other issues. + */ +static WCHAR* getPath(JNIEnv *env, jstring ps) { + WCHAR *pathbuf = NULL; + const jchar *chars = (*(env))->GetStringChars(env, ps, NULL); + if (chars != NULL) { + size_t pathlen = wcslen(chars); + pathbuf = (WCHAR*)malloc((pathlen + 6) * sizeof(WCHAR)); + if (pathbuf == NULL) { + JNU_ThrowOutOfMemoryError(env, NULL); + } else { + wcscpy(pathbuf, chars); + } + (*env)->ReleaseStringChars(env, ps, chars); + } + return pathbuf; +} + +JNIEXPORT jlong JNICALL +Java_java_lang_ProcessImpl_openForAtomicAppend(JNIEnv *env, jclass ignored, jstring path) +{ + const DWORD access = (FILE_GENERIC_WRITE & ~FILE_WRITE_DATA); + const DWORD sharing = FILE_SHARE_READ | FILE_SHARE_WRITE; + const DWORD disposition = OPEN_ALWAYS; + const DWORD flagsAndAttributes = FILE_ATTRIBUTE_NORMAL; + HANDLE h; + WCHAR *pathbuf = getPath(env, path); + if (pathbuf == NULL) { + /* Exception already pending */ + return -1; + } + h = CreateFileW( + pathbuf, /* Wide char path name */ + access, /* Read and/or write permission */ + sharing, /* File sharing flags */ + NULL, /* Security attributes */ + disposition, /* creation disposition */ + flagsAndAttributes, /* flags and attributes */ + NULL); + free(pathbuf); + if (h == INVALID_HANDLE_VALUE) { + JNU_ThrowIOExceptionWithLastError(env, "CreateFileW"); + } + return ptr_to_jlong(h); +} diff --git a/jdk/src/windows/native/java/lang/java_props_md.c b/jdk/src/windows/native/java/lang/java_props_md.c index 50835ee6e28..5b9332fb111 100644 --- a/jdk/src/windows/native/java/lang/java_props_md.c +++ b/jdk/src/windows/native/java/lang/java_props_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +43,14 @@ #endif typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); -static void SetupI18nProps(LCID lcid, char** language, char** country, +static void SetupI18nProps(LCID lcid, char** language, char** script, char** country, char** variant, char** encoding); #define SHELL_KEY "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" +#define PROPSIZE 9 // eight-letter + null terminator +#define SNAMESIZE 86 // max number of chars for LOCALE_SNAME is 85 + static char * getEncodingInternal(LCID lcid) { @@ -127,30 +130,31 @@ getEncodingFromLangID(LANGID langID) return getEncodingInternal(MAKELCID(langID, SORT_DEFAULT)); } +// Returns BCP47 Language Tag DllExport const char * getJavaIDFromLangID(LANGID langID) { - char * lang; - char * ctry; - char * vrnt; - char * enc; - char * ret = malloc(16); + char * elems[5]; // lang, script, ctry, variant, encoding + char * ret = malloc(SNAMESIZE); + int index; - SetupI18nProps(MAKELCID(langID, SORT_DEFAULT), &lang, &ctry, &vrnt, &enc); - if (ctry[0] != '\0') { - if (vrnt[0] != '\0') { - sprintf(ret, "%s_%s_%s", lang, ctry, vrnt); - } else { - sprintf(ret, "%s_%s", lang, ctry); + SetupI18nProps(MAKELCID(langID, SORT_DEFAULT), + &(elems[0]), &(elems[1]), &(elems[2]), &(elems[3]), &(elems[4])); + + // there always is the "language" tag + strcpy(ret, elems[0]); + + // append other elements, if any + for (index = 1; index < 4; index++) { + if ((elems[index])[0] != '\0') { + strcat(ret, "-"); + strcat(ret, elems[index]); } - } else { - strcpy(ret, lang); } - free(lang); - free(ctry); - free(vrnt); - free(enc); + for (index = 0; index < 5; index++) { + free(elems[index]); + } return ret; } @@ -289,39 +293,38 @@ cpu_isalist(void) return NULL; } -#define PROPSIZE 3 // two-letter + null terminator static void -SetupI18nProps(LCID lcid, char** language, char** country, +SetupI18nProps(LCID lcid, char** language, char** script, char** country, char** variant, char** encoding) { + /* script */ + char tmp[SNAMESIZE]; + *script = malloc(PROPSIZE); + if (GetLocaleInfo(lcid, + LOCALE_SNAME, tmp, SNAMESIZE) == 0 || + sscanf(tmp, "%*[a-z\\-]%1[A-Z]%[a-z]", *script, &((*script)[1])) == 0 || + strlen(*script) != 4) { + (*script)[0] = '\0'; + } + /* country */ *country = malloc(PROPSIZE); if (GetLocaleInfo(lcid, - LOCALE_SISO3166CTRYNAME, *country, PROPSIZE) == 0) { + LOCALE_SISO3166CTRYNAME, *country, PROPSIZE) == 0 && + GetLocaleInfo(lcid, + LOCALE_SISO3166CTRYNAME2, *country, PROPSIZE) == 0) { (*country)[0] = '\0'; } /* language */ *language = malloc(PROPSIZE); - if (lcid == 0x46c) { - /* Windows returns non-existent language code "ns" for Northern Sotho. - * Defaults to en_US - */ - strcpy(*language, "en"); - strcpy(*country, "US"); - } else if (GetLocaleInfo(lcid, - LOCALE_SISO639LANGNAME, *language, PROPSIZE) == 0) { - if (lcid == 0x465) { - /* for some reason, Windows returns "div" for this Divehi LCID, even though - * there is a two letter language code "dv". Tweak it here. - */ - strcpy(*language, "dv"); - strcpy(*country, "MV"); - } else { + if (GetLocaleInfo(lcid, + LOCALE_SISO639LANGNAME, *language, PROPSIZE) == 0 && + GetLocaleInfo(lcid, + LOCALE_SISO639LANGNAME2, *language, PROPSIZE) == 0) { /* defaults to en_US */ strcpy(*language, "en"); strcpy(*country, "US"); } - } /* variant */ *variant = malloc(PROPSIZE); @@ -564,7 +567,7 @@ GetJavaProperties(JNIEnv* env) /* * user.language - * user.country, user.variant (if user's environment specifies them) + * user.script, user.country, user.variant (if user's environment specifies them) * file.encoding * file.encoding.pkg */ @@ -582,16 +585,19 @@ GetJavaProperties(JNIEnv* env) SetupI18nProps(userDefaultUILang, &sprops.language, + &sprops.script, &sprops.country, &sprops.variant, &display_encoding); SetupI18nProps(userDefaultLCID, &sprops.format_language, + &sprops.format_script, &sprops.format_country, &sprops.format_variant, &sprops.encoding); SetupI18nProps(userDefaultUILang, &sprops.display_language, + &sprops.display_script, &sprops.display_country, &sprops.display_variant, &display_encoding); diff --git a/jdk/src/windows/native/java/net/Inet4AddressImpl.c b/jdk/src/windows/native/java/net/Inet4AddressImpl.c index cb132db83f4..197800dc59b 100644 --- a/jdk/src/windows/native/java/net/Inet4AddressImpl.c +++ b/jdk/src/windows/native/java/net/Inet4AddressImpl.c @@ -559,8 +559,8 @@ Java_java_net_Inet4AddressImpl_isReachable0(JNIEnv *env, jobject this, if (timeout >= 0) { optlen = sizeof(connect_rv); - if (JVM_GetSockOpt(fd, SOL_SOCKET, SO_ERROR, (void*)&connect_rv, - &optlen) <0) { + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&connect_rv, + &optlen) <0) { connect_rv = WSAGetLastError(); } diff --git a/jdk/src/windows/native/java/net/Inet6AddressImpl.c b/jdk/src/windows/native/java/net/Inet6AddressImpl.c index 87f9568a97a..1f9a6779e6e 100644 --- a/jdk/src/windows/native/java/net/Inet6AddressImpl.c +++ b/jdk/src/windows/native/java/net/Inet6AddressImpl.c @@ -671,8 +671,8 @@ Java_java_net_Inet6AddressImpl_isReachable0(JNIEnv *env, jobject this, if (timeout >= 0) { /* has connection been established? */ optlen = sizeof(connect_rv); - if (JVM_GetSockOpt(fd, SOL_SOCKET, SO_ERROR, (void*)&connect_rv, - &optlen) <0) { + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&connect_rv, + &optlen) <0) { connect_rv = WSAGetLastError(); } diff --git a/jdk/src/windows/native/java/net/NetworkInterface_winXP.c b/jdk/src/windows/native/java/net/NetworkInterface_winXP.c index 3185d393dd4..283be81b89a 100644 --- a/jdk/src/windows/native/java/net/NetworkInterface_winXP.c +++ b/jdk/src/windows/native/java/net/NetworkInterface_winXP.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c b/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c index bd7aa9838a3..5ca6736b903 100644 --- a/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c +++ b/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/java/net/TwoStacksPlainSocketImpl.c b/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c index 792fc251d35..71e2b2b124e 100644 --- a/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c +++ b/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c @@ -1032,21 +1032,20 @@ Java_java_net_TwoStacksPlainSocketImpl_socketGetOption(JNIEnv *env, jobject this * SO_BINDADDR isn't a socket option */ if (opt == java_net_SocketOptions_SO_BINDADDR) { - SOCKET_ADDRESS him; + SOCKETADDRESS him; int len; int port; jobject iaObj; jclass iaCntrClass; jfieldID iaFieldID; - len = sizeof(struct sockaddr_in); + len = sizeof(him); if (fd == -1) { /* must be an IPV6 only socket. Case where both sockets are != -1 * is handled in java */ fd = getFD1 (env, this); - len = sizeof(struct SOCKADDR_IN6); } if (getsockname(fd, (struct sockaddr *)&him, &len) < 0) { diff --git a/jdk/src/windows/native/java/net/net_util_md.h b/jdk/src/windows/native/java/net/net_util_md.h index d9f634170a5..b1a37e9b826 100644 --- a/jdk/src/windows/native/java/net/net_util_md.h +++ b/jdk/src/windows/native/java/net/net_util_md.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/java/nio/MappedByteBuffer.c b/jdk/src/windows/native/java/nio/MappedByteBuffer.c index 5af3b99c73d..4880123a31d 100644 --- a/jdk/src/windows/native/java/nio/MappedByteBuffer.c +++ b/jdk/src/windows/native/java/nio/MappedByteBuffer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +51,11 @@ Java_java_nio_MappedByteBuffer_load0(JNIEnv *env, jobject obj, jlong address, } JNIEXPORT void JNICALL -Java_java_nio_MappedByteBuffer_force0(JNIEnv *env, jobject obj, jlong address, - jlong len) +Java_java_nio_MappedByteBuffer_force0(JNIEnv *env, jobject obj, jobject fdo, + jlong address, jlong len) { void *a = (void *) jlong_to_ptr(address); - int result; + BOOL result; int retry; /* @@ -71,6 +71,30 @@ Java_java_nio_MappedByteBuffer_force0(JNIEnv *env, jobject obj, jlong address, retry++; } while (retry < 3); + /** + * FlushViewOfFile only initiates the writing of dirty pages to disk + * so we have to call FlushFileBuffers to and ensure they are written. + */ + if (result != 0) { + // by right, the jfieldID initialization should be in a static + // initializer but we do it here instead to avoiding needing to + // load nio.dll during startup. + static jfieldID handle_fdID; + HANDLE h; + if (handle_fdID == NULL) { + jclass clazz = (*env)->FindClass(env, "java/io/FileDescriptor"); + if (clazz == NULL) + return; // exception thrown + handle_fdID = (*env)->GetFieldID(env, clazz, "handle", "J"); + } + h = jlong_to_ptr((*env)->GetLongField(env, fdo, handle_fdID)); + result = FlushFileBuffers(h); + if (result == 0 && GetLastError() == ERROR_ACCESS_DENIED) { + // read-only mapping + result = 1; + } + } + if (result == 0) { JNU_ThrowIOExceptionWithLastError(env, "Flush failed"); } diff --git a/jdk/src/windows/native/java/util/TimeZone_md.c b/jdk/src/windows/native/java/util/TimeZone_md.c index 8bd269f76f4..5abc61c74f2 100644 --- a/jdk/src/windows/native/java/util/TimeZone_md.c +++ b/jdk/src/windows/native/java/util/TimeZone_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/font/fontpath.c b/jdk/src/windows/native/sun/font/fontpath.c index 9c82f3dceb8..f1437de5afb 100644 --- a/jdk/src/windows/native/sun/font/fontpath.c +++ b/jdk/src/windows/native/sun/font/fontpath.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/java2d/d3d/D3DGraphicsDevice.cpp b/jdk/src/windows/native/sun/java2d/d3d/D3DGraphicsDevice.cpp index b7a6bf24a9e..c84e7ea4751 100644 --- a/jdk/src/windows/native/sun/java2d/d3d/D3DGraphicsDevice.cpp +++ b/jdk/src/windows/native/sun/java2d/d3d/D3DGraphicsDevice.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,22 +36,6 @@ extern jobject CreateDisplayMode(JNIEnv* env, jint width, jint height, extern void addDisplayMode(JNIEnv* env, jobject arrayList, jint width, jint height, jint bitDepth, jint refreshRate); -void InitD3D(void *pReturn) -{ - J2dTraceLn(J2D_TRACE_INFO, "InitD3D"); - - jboolean *pRet = (jboolean *)pReturn; - - D3DPipelineManager *pMgr = D3DPipelineManager::CreateInstance(); - if (pMgr == NULL) { - J2dTraceLn(J2D_TRACE_ERROR, "InitD3D: could not create or init d3d"); - *pRet = JNI_FALSE; - } else { - J2dTraceLn(J2D_TRACE_INFO, "InitD3D: successfully initialized d3d"); - *pRet = JNI_TRUE; - } -} - extern "C" { /* * Class: sun_java2d_d3d_D3DGraphicsDevice @@ -63,8 +47,8 @@ JNIEXPORT jboolean JNICALL Java_sun_java2d_d3d_D3DGraphicsDevice_initD3D { J2dTraceLn(J2D_TRACE_INFO, "D3DGD_initD3D"); - jboolean result = JNI_FALSE; - AwtToolkit::GetInstance().InvokeFunction(InitD3D, &result); + jboolean result = D3DInitializer::GetInstance().EnsureInited() + ? JNI_TRUE : JNI_FALSE; J2dTraceLn1(J2D_TRACE_INFO, "D3DGD_initD3D: result=%x", result); return result; } diff --git a/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp b/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp index 0f9daca7141..a7da3f3b38c 100644 --- a/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp +++ b/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ static BOOL bNoHwCheck = (getenv("J2D_D3D_NO_HWCHECK") != NULL); D3DPipelineManager *D3DPipelineManager::pMgr = NULL; + D3DPipelineManager * D3DPipelineManager::CreateInstance(void) { if (!IsD3DEnabled() || @@ -179,6 +180,12 @@ void D3DPipelineManager::NotifyAdapterEventListeners(UINT adapter, HMONITOR hMon; int gdiScreen; D3DPipelineManager *pMgr; + + // fix for 6946559: if d3d preloading fails jmv may be NULL + if (jvm == NULL) { + return; + } + JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); pMgr = D3DPipelineManager::GetInstance(); @@ -342,7 +349,8 @@ D3DPipelineManager::CheckOSVersion() { // require Windows XP or newer client-class OS if (IS_WINVER_ATLEAST(5, 1) && - !D3DPPLM_OsVersionMatches(OS_WINSERV_2008|OS_WINSERV_2003)) + !D3DPPLM_OsVersionMatches(OS_WINSERV_2008R2|OS_WINSERV_2008| + OS_WINSERV_2003)) { J2dTraceLn(J2D_TRACE_INFO, "D3DPPLM::CheckOSVersion: Windows XP or newer client-classs"\ @@ -435,14 +443,22 @@ BOOL D3DPPLM_OsVersionMatches(USHORT osInfo) { if (bVersOk && osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion > 4) { - if (osvi.dwMajorVersion >= 6 && osvi.dwMinorVersion >= 0) { + if (osvi.dwMajorVersion >= 6 && osvi.dwMinorVersion == 0) { if (osvi.wProductType == VER_NT_WORKSTATION) { - J2dRlsTrace(J2D_TRACE_INFO, "OS_VISTA or newer\n"); + J2dRlsTrace(J2D_TRACE_INFO, "OS_VISTA\n"); currentOS = OS_VISTA; } else { - J2dRlsTrace(J2D_TRACE_INFO, "OS_WINSERV_2008 or newer\n"); + J2dRlsTrace(J2D_TRACE_INFO, "OS_WINSERV_2008\n"); currentOS = OS_WINSERV_2008; } + } else if (osvi.dwMajorVersion >= 6 && osvi.dwMinorVersion >= 1) { + if (osvi.wProductType == VER_NT_WORKSTATION) { + J2dRlsTrace(J2D_TRACE_INFO, "OS_WINDOWS7 or newer\n"); + currentOS = OS_WINDOWS7; + } else { + J2dRlsTrace(J2D_TRACE_INFO, "OS_WINSERV_2008R2 or newer\n"); + currentOS = OS_WINSERV_2008R2; + } } else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) { if (osvi.wProductType == VER_NT_WORKSTATION) { J2dRlsTrace(J2D_TRACE_INFO, "OS_WINXP_64\n"); @@ -934,3 +950,90 @@ HRESULT D3DPipelineManager::GetD3DContext(UINT adapterOrdinal, *ppd3dContext = pAdapters[adapterOrdinal].pd3dContext; return res; } + + +//============================================================== +// D3DInitializer +//============================================================== + +D3DInitializer D3DInitializer::theInstance; + +D3DInitializer::D3DInitializer() + : bComInitialized(false), pAdapterIniters(NULL) +{ +} + +D3DInitializer::~D3DInitializer() +{ + if (pAdapterIniters) { + delete[] pAdapterIniters; + } +} + +void D3DInitializer::InitImpl() +{ + J2dRlsTraceLn(J2D_TRACE_INFO, "D3DInitializer::InitImpl"); + if (SUCCEEDED(::CoInitialize(NULL))) { + bComInitialized = true; + } + D3DPipelineManager *pMgr = D3DPipelineManager::CreateInstance(); + if (pMgr != NULL) { + // init adapters if we are preloading + if (AwtToolkit::GetInstance().GetPreloadThread().OnPreloadThread()) { + UINT adapterCount = pMgr->adapterCount; + + pAdapterIniters = new D3DAdapterInitializer[adapterCount]; + for (UINT i=0; iGetD3DContext(adapter, &pd3dContext); + + J2dRlsTraceLn1(J2D_TRACE_INFO, "D3DAdapterInitializer::InitImpl(%d) finished", adapter); +} + +void D3DInitializer::D3DAdapterInitializer::CleanImpl(bool reInit) +{ + // nothing to do - D3DPipelineManager cleans adapters +} + + +extern "C" { +/* + * Export function to start D3D preloading + * (called from java/javaw - see src/windows/bin/java-md.c) + */ +__declspec(dllexport) int preloadD3D() +{ + J2dRlsTraceLn(J2D_TRACE_INFO, "AWT warmup: preloadD3D"); + AwtToolkit::GetInstance().GetPreloadThread().AddAction(&D3DInitializer::GetInstance()); + return 1; +} + +} + diff --git a/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.h b/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.h index 50011499303..3d7227fab28 100644 --- a/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.h +++ b/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ #include "D3DPipeline.h" #include "D3DContext.h" +#include "awt_Toolkit.h" typedef class D3DPipelineManager *LPD3DPIPELINEMANAGER; @@ -38,11 +39,15 @@ typedef struct D3DAdapter class D3DPIPELINE_API D3DPipelineManager { -public: + friend class D3DInitializer; +private: // creates and initializes instance of D3DPipelineManager, may return NULL static D3DPipelineManager* CreateInstance(void); + // deletes the single instance of the manager static void DeleteInstance(); + +public: // returns the single instance of the manager, may return NULL static D3DPipelineManager* GetInstance(void); @@ -140,6 +145,46 @@ private: #define OS_WINXP (1 << 2) #define OS_WINXP_64 (1 << 3) #define OS_WINSERV_2003 (1 << 4) -#define OS_ALL (OS_VISTA|OS_WINSERV_2008|OS_WINXP|OS_WINXP_64|OS_WINSERV_2003) +#define OS_WINDOWS7 (1 << 5) +#define OS_WINSERV_2008R2 (1 << 6) +#define OS_ALL (OS_VISTA|OS_WINSERV_2008|OS_WINXP|OS_WINXP_64|OS_WINSERV_2003|\ + OS_WINDOWS7|OS_WINSERV_2008R2) #define OS_UNKNOWN (~OS_ALL) BOOL D3DPPLM_OsVersionMatches(USHORT osInfo); + + +class D3DInitializer : public AwtToolkit::PreloadAction { +private: + D3DInitializer(); + ~D3DInitializer(); + +protected: + // PreloadAction overrides + virtual void InitImpl(); + virtual void CleanImpl(bool reInit); + +public: + static D3DInitializer& GetInstance() { return theInstance; } + +private: + // single instance + static D3DInitializer theInstance; + + // adapter initializer class + class D3DAdapterInitializer : public AwtToolkit::PreloadAction { + public: + void setAdapter(UINT adapter) { this->adapter = adapter; } + protected: + // PreloadAction overrides + virtual void InitImpl(); + virtual void CleanImpl(bool reInit); + private: + UINT adapter; + }; + + // the flag indicates success of COM initialization + bool bComInitialized; + D3DAdapterInitializer *pAdapterIniters; + +}; + diff --git a/jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c b/jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c index 03d81a3924b..c08d9a4131b 100644 --- a/jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c +++ b/jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/java2d/windows/GDIWindowSurfaceData.cpp b/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.cpp index 21b944d2084..e4473d268e8 100644 --- a/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.cpp +++ b/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ static HPEN nullpen; static jclass xorCompClass; static jboolean beingShutdown = JNI_FALSE; +static volatile LONG timeStamp = 0; extern CriticalSection windowMoveLock; extern "C" @@ -90,12 +91,24 @@ void SetupThreadGraphicsInfo(JNIEnv *env, GDIWinSDOps *wsdo) { HDC oldhDC = info->hDC; // the hDC is NULL for offscreen surfaces - we don't store it // in TLS as it must be created new every time. - if (((oldhDC == NULL) && wsdo->window != NULL) || (info->wsdo != wsdo)) { + + if( ((oldhDC == NULL) && wsdo->window != NULL) || + (info->wsdo != wsdo) || + (info->wsdoTimeStamp != wsdo->timeStamp) ) + { // Init graphics state, either because this is our first time // using it in this thread or because this thread is now // dealing with a different window than it was last time. + //check extra condition: + //(info->wsdoTimeStamp != wsdo->timeStamp). + //Checking memory addresses (info->wsdo != wsdo) will not detect + //that wsdo points to a newly allocated structure in case + //that structure just got allocated at a "recycled" memory location + //which previously was pointed by info->wsdo + //see bug# 6859086 + // Release cached DC. We use deferred DC releasing mechanism because // the DC is associated with cached wsdo and component peer, // which may've been disposed by this time, and we have @@ -157,7 +170,9 @@ void SetupThreadGraphicsInfo(JNIEnv *env, GDIWinSDOps *wsdo) { info->xorcolor = 0; info->patrop = PATCOPY; + //store the address and time stamp of newly allocated GDIWinSDOps structure info->wsdo = wsdo; + info->wsdoTimeStamp = wsdo->timeStamp; } } @@ -367,6 +382,7 @@ Java_sun_java2d_windows_GDIWindowSurfaceData_initOps(JNIEnv *env, jobject wsd, JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed."); return; } + wsdo->timeStamp = InterlockedIncrement(&timeStamp); //creation time stamp wsdo->sdOps.Lock = GDIWinSD_Lock; wsdo->sdOps.GetRasInfo = GDIWinSD_GetRasInfo; wsdo->sdOps.Unlock = GDIWinSD_Unlock; diff --git a/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h b/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h index a70b9bf21e9..3dfaa161c02 100644 --- a/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h +++ b/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +148,11 @@ typedef void InvalidateSDFunc(JNIEnv *env, */ struct _GDIWinSDOps { SurfaceDataOps sdOps; + LONG timeStamp; // creation time stamp. + // Doesn't store a real time - + // just counts creation events of this structure + // made by GDIWindowSurfaceData_initOps() + // see bug# 6859086 jboolean invalid; GetDCFunc *GetDC; ReleaseDCFunc *ReleaseDC; @@ -192,6 +197,13 @@ extern "C" { typedef struct { HDC hDC; GDIWinSDOps *wsdo; + LONG wsdoTimeStamp; // wsdo creation time stamp. + // Other threads may deallocate wsdo + // and then allocate a new GDIWinSDOps + // structure at the same memory location. + // Time stamp is the only way to detect if + // wsdo got changed. + // see bug# 6859086 RECT bounds; jobject clip; jobject comp; diff --git a/jdk/src/windows/native/sun/java2d/windows/WindowsFlags.cpp b/jdk/src/windows/native/sun/java2d/windows/WindowsFlags.cpp index 1dd3df10f10..c5313a1b571 100644 --- a/jdk/src/windows/native/sun/java2d/windows/WindowsFlags.cpp +++ b/jdk/src/windows/native/sun/java2d/windows/WindowsFlags.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +28,8 @@ #include "WindowsFlags.h" BOOL accelReset; // reset registry 2d acceleration settings -BOOL useD3D; // d3d enabled flag +BOOL useD3D = TRUE; // d3d enabled flag + // initially is TRUE to allow D3D preloading BOOL forceD3DUsage; // force d3d on or off jboolean g_offscreenSharing; // JAWT accelerated surface sharing BOOL checkRegistry; // Diagnostic tool: outputs 2d registry settings diff --git a/jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp b/jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp index dda7f73cb34..fabcd0468b8 100644 --- a/jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp +++ b/jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/jkernel/DownloadHelper.cpp b/jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp index 7d134384bcb..e61ed4851fe 100644 --- a/jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp +++ b/jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/jkernel/kernel.rc b/jdk/src/windows/native/sun/jkernel/kernel.rc index 39a8f087304..943d7cbbec4 100644 --- a/jdk/src/windows/native/sun/jkernel/kernel.rc +++ b/jdk/src/windows/native/sun/jkernel/kernel.rc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +149,18 @@ LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL #endif // Swedish resources ///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// Brazilian Portuguese resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PTB) +#ifdef _WIN32 +LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN +#pragma code_page(1252) +#endif //_WIN32 +#include "kernel_pt_BR.rc" +#endif // Brazilian Portuguese resources +///////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources diff --git a/jdk/src/windows/native/sun/jkernel/kernel_pt_BR.rc b/jdk/src/windows/native/sun/jkernel/kernel_pt_BR.rc new file mode 100644 index 00000000000..550847691de --- /dev/null +++ b/jdk/src/windows/native/sun/jkernel/kernel_pt_BR.rc @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DOWNLOAD_DIALOG DIALOGEX 0,0,340,120 +STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Componentes adicionais necessários" +EXSTYLE WS_EX_APPWINDOW +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "", IDC_DOWNLOAD_MASTHEAD,0,0,340,39 + LTEXT "", IDC_MASTHEAD_TEXT,60,8,225,12 + CONTROL "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN,0,39,340,1 + LTEXT "", IDC_DOWNLOAD_TEXT,12,60,316,20 + LTEXT "", IDC_TIME_REMAINING,12,90,316,10 + CONTROL "Progress1",1006,"msctls_progress32",PBS_SMOOTH,12,100,265,14 + PUSHBUTTON "Cancelar", 2,285,100,46,14 +END + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + 105, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 236 + TOPMARGIN, 7 + BOTTOMMARGIN, 63 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DOWNLOAD_CANCEL_MESSAGE "O cancelamento da instalação dos componentes adicionais necessários ao aplicativo pode fazer com que o aplicativo se feche.\n\nTem certeza que deseja cancelar a instalação dos componentes adicionais?" + IDS_DOWNLOAD_CANCEL_CAPTION "Cancelar - Componentes adicionais" + IDS_DOWNLOAD_CANCEL_INSTRUCTION "" + IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT "Tempo limite de conexão excedido" + IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "Não é possível se conectar à Internet" + IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR "Erro de servidor (Erro %s)" + IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL "Serviço não disponível (Erro %s)" + IDS_HTTP_INSTRUCTION_FORBIDDEN "Acesso negado ou proibido (Erro %s)" + IDS_HTTP_STATUS_OTHER "Ocorreu um erro durante esta solicitação. Deseja tentar a solicitação novamente?" + +// HTTP status code + IDS_HTTP_STATUS_REQUEST_TIMEOUT "O servidor usado para baixar os componentes necessários não está respondendo e o tempo limite da conexão foi excedido. Deseja tentar se conectar novamente?" + IDS_HTTP_STATUS_FORBIDDEN "Você não tem permissão para acessar o servidor para baixar os componentes necessários ao aplicativo. Tentar acessar o servidor novamente?" + IDS_HTTP_STATUS_SERVER_ERROR "Ocorreu um erro no servidor e não foi possível concluir a solicitação. Deseja tentar a solicitação novamente?" + IDS_HTTP_STATUS_SERVICE_UNAVAIL "O serviço solicitado não está disponível temporariamente. Deseja tentar a solicitação novamente?" + + + IDS_DOWNLOAD_STATUS_RETRY "O servidor está ocupado atualmente, tente novamente em %ld segundos ..." + + IDS_ERROR_CAPTION "Instalador Java" + IDS_HOURSMINUTESECOND "Tempo restante estimado: %d horas %d minutos %.0f segundos" + IDS_HOURMINUTESECOND "Tempo restante estimado: %d hora %d minutos %.0f segundos" + IDS_MINUTESECOND "Tempo restante estimado: %d minutos %.0f segundos" + IDS_SECOND "Tempo restante estimado: %.0f segundos" + IDS_DISK_FULL_ERROR_CAPTION "Disco cheio %s" + IDS_DISK_FULL_ERROR "Não há espaço em disco suficiente para baixar os componentes solicitados. Libere espaço em disco e, a seguir, tente novamente." + IDS_DISK_WRITE_ERROR_CAPTION "Não é possível gravar no disco %s" + IDS_DISK_WRITE_ERROR "Ocorreu um erro durante a gravação no disco. Verifique se o disco não está protegido contra gravação." + IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "O Java não pode se conectar à Internet. Verifique se as configurações de conexão à Internet estão corretas (isso pode ser encontrado no painel de controle do Windows em Opções de Internet > Conexão) e se o firewall permite que java.exe acesse a Internet." + + IDS_DOWNLOAD_RETRY "Erro de download" + IDS_DOWNLOAD_RETRY_TEXT "Ocorreu um erro durante o download de alguns componentes solicitados. Deseja tentar o download destes componentes novamente?" + + IDS_DOWNLOAD "Instalando componentes adicionais" + IDS_DOWNLOAD_UNPACKING "Descompactando pacotes" + IDS_DOWNLOAD_TEXT "O aplicativo Java se iniciará quando os componentes adicionais que ele precisa tiverem sido baixados e instalados." + + IDS_FILE_UPDATE_ERROR "Ocorreu um erro durante a atualização de %s%s." + IDS_FILE_DELETE_ERROR "Ocorreu um erro durante a remoção de %s%s." + IDS_JAVA_HOME_ERROR "Não é possível determinar o diretório base Java." + IDS_KERNEL_HOME_ERROR "Não é possível determinar o caminho para o jkernel.dll." + IDS_JBROKER_ERROR "Não é possível iniciar jbroker.exe" + IDS_FATAL_ERROR "O Java não pôde baixar os componentes necessários. O programa se fechará agora." + IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "O Java não pôde estabelecer comunicação com o servidor de downloads. O programa se fechará agora." + IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "O Java encontrou um erro ao estabelecer comunicação com o servidor de downloads. O programa se fechará agora." + IDS_ERROR_MALFORMED_URL "O Java não pôde baixar da URL '%s'. O programa se fechará agora." +END diff --git a/jdk/src/windows/native/sun/jkernel/stdafx.h b/jdk/src/windows/native/sun/jkernel/stdafx.h index d3f596d8a15..f25b5115ca3 100644 --- a/jdk/src/windows/native/sun/jkernel/stdafx.h +++ b/jdk/src/windows/native/sun/jkernel/stdafx.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/net/spi/DefaultProxySelector.c b/jdk/src/windows/native/sun/net/spi/DefaultProxySelector.c index 5171024e41c..3dffe94a67a 100644 --- a/jdk/src/windows/native/sun/net/spi/DefaultProxySelector.c +++ b/jdk/src/windows/native/sun/net/spi/DefaultProxySelector.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/nio/ch/DatagramChannelImpl.c b/jdk/src/windows/native/sun/nio/ch/DatagramChannelImpl.c index 64156b8613c..8df4b94a3ba 100644 --- a/jdk/src/windows/native/sun/nio/ch/DatagramChannelImpl.c +++ b/jdk/src/windows/native/sun/nio/ch/DatagramChannelImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/nio/ch/FileDispatcherImpl.c b/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c index d31ef21ed83..0fdc2ab51fb 100644 --- a/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c +++ b/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +32,7 @@ #include #include "nio.h" #include "nio_util.h" +#include "jlong.h" /************************************************************** @@ -183,18 +184,28 @@ Java_sun_nio_ch_FileDispatcherImpl_pread0(JNIEnv *env, jclass clazz, jobject fdo JNIEXPORT jint JNICALL Java_sun_nio_ch_FileDispatcherImpl_write0(JNIEnv *env, jclass clazz, jobject fdo, - jlong address, jint len) + jlong address, jint len, jboolean append) { BOOL result = 0; DWORD written = 0; HANDLE h = (HANDLE)(handleval(env, fdo)); if (h != INVALID_HANDLE_VALUE) { + OVERLAPPED ov; + LPOVERLAPPED lpOv; + if (append == JNI_TRUE) { + ov.Offset = (DWORD)0xFFFFFFFF; + ov.OffsetHigh = (DWORD)0xFFFFFFFF; + ov.hEvent = NULL; + lpOv = &ov; + } else { + lpOv = NULL; + } result = WriteFile(h, /* File handle to write */ (LPCVOID)address, /* pointers to the buffers */ len, /* number of bytes to write */ &written, /* receives number of bytes written */ - NULL); /* no overlapped struct */ + lpOv); /* overlapped struct */ } if ((h == INVALID_HANDLE_VALUE) || (result == 0)) { @@ -206,7 +217,7 @@ Java_sun_nio_ch_FileDispatcherImpl_write0(JNIEnv *env, jclass clazz, jobject fdo JNIEXPORT jlong JNICALL Java_sun_nio_ch_FileDispatcherImpl_writev0(JNIEnv *env, jclass clazz, jobject fdo, - jlong address, jint len) + jlong address, jint len, jboolean append) { BOOL result = 0; DWORD written = 0; @@ -218,7 +229,16 @@ Java_sun_nio_ch_FileDispatcherImpl_writev0(JNIEnv *env, jclass clazz, jobject fd int i = 0; DWORD num = 0; struct iovec *iovecp = (struct iovec *)jlong_to_ptr(address); - + OVERLAPPED ov; + LPOVERLAPPED lpOv; + if (append == JNI_TRUE) { + ov.Offset = (DWORD)0xFFFFFFFF; + ov.OffsetHigh = (DWORD)0xFFFFFFFF; + ov.hEvent = NULL; + lpOv = &ov; + } else { + lpOv = NULL; + } for(i=0; i 0) { totalWritten += written; } @@ -441,3 +461,16 @@ Java_sun_nio_ch_FileDispatcherImpl_closeByHandle(JNIEnv *env, jclass clazz, { closeFile(env, fd); } + +JNIEXPORT jlong JNICALL +Java_sun_nio_ch_FileDispatcherImpl_duplicateHandle(JNIEnv *env, jclass this, jlong handle) +{ + HANDLE hProcess = GetCurrentProcess(); + HANDLE hFile = jlong_to_ptr(handle); + HANDLE hResult; + BOOL res = DuplicateHandle(hProcess, hFile, hProcess, &hResult, 0, FALSE, + DUPLICATE_SAME_ACCESS); + if (res == 0) + JNU_ThrowIOExceptionWithLastError(env, "DuplicateHandle failed"); + return ptr_to_jlong(hResult); +} diff --git a/jdk/src/windows/native/sun/nio/ch/Net.c b/jdk/src/windows/native/sun/nio/ch/Net.c index a145393e015..b415cdfc3e2 100644 --- a/jdk/src/windows/native/sun/nio/ch/Net.c +++ b/jdk/src/windows/native/sun/nio/ch/Net.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/nio/ch/ServerSocketChannelImpl.c b/jdk/src/windows/native/sun/nio/ch/ServerSocketChannelImpl.c index 770cd3d7360..2af833c2eb7 100644 --- a/jdk/src/windows/native/sun/nio/ch/ServerSocketChannelImpl.c +++ b/jdk/src/windows/native/sun/nio/ch/ServerSocketChannelImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/nio/ch/SocketChannelImpl.c b/jdk/src/windows/native/sun/nio/ch/SocketChannelImpl.c index 5ff8b808dde..2993daf298f 100644 --- a/jdk/src/windows/native/sun/nio/ch/SocketChannelImpl.c +++ b/jdk/src/windows/native/sun/nio/ch/SocketChannelImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/nio/ch/SocketDispatcher.c b/jdk/src/windows/native/sun/nio/ch/SocketDispatcher.c index 0fa7c35a903..2a0ba288e15 100644 --- a/jdk/src/windows/native/sun/nio/ch/SocketDispatcher.c +++ b/jdk/src/windows/native/sun/nio/ch/SocketDispatcher.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/nio/ch/WindowsAsynchronousFileChannelImpl.c b/jdk/src/windows/native/sun/nio/ch/WindowsAsynchronousFileChannelImpl.c index 37edef64313..c53aedf7a8a 100644 --- a/jdk/src/windows/native/sun/nio/ch/WindowsAsynchronousFileChannelImpl.c +++ b/jdk/src/windows/native/sun/nio/ch/WindowsAsynchronousFileChannelImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/nio/ch/WindowsSelectorImpl.c b/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c index 7b28f27dab4..aa10877c42b 100644 --- a/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c +++ b/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/nio/ch/nio_util.h b/jdk/src/windows/native/sun/nio/ch/nio_util.h index 963e93ef033..5415923fc2c 100644 --- a/jdk/src/windows/native/sun/nio/ch/nio_util.h +++ b/jdk/src/windows/native/sun/nio/ch/nio_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/windows/Devices.h b/jdk/src/windows/native/sun/windows/Devices.h index e8324ce4c6c..748ded20a3f 100644 --- a/jdk/src/windows/native/sun/windows/Devices.h +++ b/jdk/src/windows/native/sun/windows/Devices.h @@ -54,7 +54,7 @@ static BOOL UpdateInstance(JNIEnv *env); InstanceAccess& operator=(const InstanceAccess&); InstanceAccess* operator&(); }; -friend InstanceAccess; +friend class InstanceAccess; private: Devices(int numElements); diff --git a/jdk/src/windows/native/sun/windows/WPrinterJob.cpp b/jdk/src/windows/native/sun/windows/WPrinterJob.cpp index 5d24aaf9c4f..37075266d34 100644 --- a/jdk/src/windows/native/sun/windows/WPrinterJob.cpp +++ b/jdk/src/windows/native/sun/windows/WPrinterJob.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -639,7 +639,7 @@ static BOOL IsDCPostscript( HDC hDC ) if( ::ExtEscape( hDC, GETTECHNOLOGY, 0, NULL, MAX_PATH, (LPSTR)szTechnology ) <= 0 ) return FALSE; - strupr( szTechnology ); + _strupr_s(szTechnology, MAX_PATH); if(!strstr( szTechnology, "POSTSCRIPT" ) == NULL ) return TRUE; diff --git a/jdk/src/windows/native/sun/windows/awt.h b/jdk/src/windows/native/sun/windows/awt.h index 8fdef922369..0ae6511c236 100644 --- a/jdk/src/windows/native/sun/windows/awt.h +++ b/jdk/src/windows/native/sun/windows/awt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -173,7 +173,7 @@ extern JavaVM *jvm; // Platform encoding is Unicode (UTF-16), re-define JNU_ functions // to proper JNI functions. -#define JNU_NewStringPlatform(env, x) env->NewString(reinterpret_cast(x), static_cast(_tcslen(x))) +#define JNU_NewStringPlatform(env, x) env->NewString(reinterpret_cast(x), static_cast(_tcslen(x))) #define JNU_GetStringPlatformChars(env, x, y) reinterpret_cast(env->GetStringChars(x, y)) #define JNU_ReleaseStringPlatformChars(env, x, y) env->ReleaseStringChars(x, reinterpret_cast(y)) diff --git a/jdk/src/windows/native/sun/windows/awt_BitmapUtil.cpp b/jdk/src/windows/native/sun/windows/awt_BitmapUtil.cpp index 92c0e6ef450..4ca8eb0da32 100644 --- a/jdk/src/windows/native/sun/windows/awt_BitmapUtil.cpp +++ b/jdk/src/windows/native/sun/windows/awt_BitmapUtil.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +246,7 @@ HRGN BitmapUtil::BitmapToRgn(HBITMAP hBitmap) UINT height = abs(bi.bmiHeader.biHeight); BYTE * buf = (BYTE*)safe_Malloc(bi.bmiHeader.biSizeImage); - bi.bmiHeader.biHeight = -height; + bi.bmiHeader.biHeight = -(INT)height; ::GetDIBits(hdc, hBitmap, 0, height, buf, reinterpret_cast(&bi), DIB_RGB_COLORS); @@ -305,7 +305,7 @@ HBITMAP BitmapUtil::BlendCopy(HBITMAP hSrcBitmap, COLORREF blendColor, UINT height = abs(bi.bmiHeader.biHeight); BYTE * buf = (BYTE*)safe_Malloc(bi.bmiHeader.biSizeImage); - bi.bmiHeader.biHeight = -height; + bi.bmiHeader.biHeight = -(INT)height; ::GetDIBits(hdc, hSrcBitmap, 0, height, buf, reinterpret_cast(&bi), DIB_RGB_COLORS); diff --git a/jdk/src/windows/native/sun/windows/awt_Choice.cpp b/jdk/src/windows/native/sun/windows/awt_Choice.cpp index 8c1621afec6..dfd9a6de6b3 100644 --- a/jdk/src/windows/native/sun/windows/awt_Choice.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Choice.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,6 +86,7 @@ static const UINT MINIMUM_NUMBER_OF_VISIBLE_ITEMS = 8; AwtChoice::AwtChoice() { m_hList = NULL; m_listDefWindowProc = NULL; + m_selectedItem = -1; } LPCTSTR AwtChoice::GetClassName() { @@ -437,9 +438,10 @@ LRESULT CALLBACK AwtChoice::ListWindowProc(HWND hwnd, UINT message, MsgRouting AwtChoice::WmNotify(UINT notifyCode) { if (notifyCode == CBN_SELCHANGE) { - int itemSelect = (int)SendMessage(CB_GETCURSEL); - if (itemSelect != CB_ERR){ - DoCallback("handleAction", "(I)V", itemSelect); + int selectedItem = (int)SendMessage(CB_GETCURSEL); + if (selectedItem != CB_ERR && m_selectedItem != selectedItem){ + m_selectedItem = selectedItem; + DoCallback("handleAction", "(I)V", selectedItem); } } else if (notifyCode == CBN_DROPDOWN) { diff --git a/jdk/src/windows/native/sun/windows/awt_Choice.h b/jdk/src/windows/native/sun/windows/awt_Choice.h index 4852301bb3d..194ae08bd1b 100644 --- a/jdk/src/windows/native/sun/windows/awt_Choice.h +++ b/jdk/src/windows/native/sun/windows/awt_Choice.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -94,6 +94,7 @@ private: static BOOL sm_isMouseMoveInList; HWND m_hList; WNDPROC m_listDefWindowProc; + int m_selectedItem; static LRESULT CALLBACK ListWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); }; diff --git a/jdk/src/windows/native/sun/windows/awt_Component.cpp b/jdk/src/windows/native/sun/windows/awt_Component.cpp index 71307cb9e58..fd75b8d52ee 100644 --- a/jdk/src/windows/native/sun/windows/awt_Component.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp @@ -6084,63 +6084,67 @@ void AwtComponent::SetParent(void * param) { void AwtComponent::_SetRectangularShape(void *param) { - JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); + if (!AwtToolkit::IsMainThread()) { + AwtToolkit::GetInstance().InvokeFunction(AwtComponent::_SetRectangularShape, param); + } else { + JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - SetRectangularShapeStruct *data = (SetRectangularShapeStruct *)param; - jobject self = data->component; - jint x1 = data->x1; - jint x2 = data->x2; - jint y1 = data->y1; - jint y2 = data->y2; - jobject region = data->region; + SetRectangularShapeStruct *data = (SetRectangularShapeStruct *)param; + jobject self = data->component; + jint x1 = data->x1; + jint x2 = data->x2; + jint y1 = data->y1; + jint y2 = data->y2; + jobject region = data->region; - AwtComponent *c = NULL; + AwtComponent *c = NULL; - PDATA pData; - JNI_CHECK_PEER_GOTO(self, ret); + PDATA pData; + JNI_CHECK_PEER_GOTO(self, ret); - c = (AwtComponent *)pData; - if (::IsWindow(c->GetHWnd())) { - HRGN hRgn = NULL; - if (region || x1 || x2 || y1 || y2) { - // If all the params are zeros, the shape must be simply reset. - // Otherwise, convert it into a region. - RGNDATA *pRgnData = NULL; - RGNDATAHEADER *pRgnHdr; + c = (AwtComponent *)pData; + if (::IsWindow(c->GetHWnd())) { + HRGN hRgn = NULL; + if (region || x1 || x2 || y1 || y2) { + // If all the params are zeros, the shape must be simply reset. + // Otherwise, convert it into a region. + RGNDATA *pRgnData = NULL; + RGNDATAHEADER *pRgnHdr; - /* reserving memory for the worst case */ - size_t worstBufferSize = size_t(((x2 - x1) / 2 + 1) * (y2 - y1)); - pRgnData = (RGNDATA *) safe_Malloc(sizeof(RGNDATAHEADER) + - sizeof(RECT_T) * worstBufferSize); - pRgnHdr = (RGNDATAHEADER *) pRgnData; + /* reserving memory for the worst case */ + size_t worstBufferSize = size_t(((x2 - x1) / 2 + 1) * (y2 - y1)); + pRgnData = (RGNDATA *) safe_Malloc(sizeof(RGNDATAHEADER) + + sizeof(RECT_T) * worstBufferSize); + pRgnHdr = (RGNDATAHEADER *) pRgnData; - pRgnHdr->dwSize = sizeof(RGNDATAHEADER); - pRgnHdr->iType = RDH_RECTANGLES; - pRgnHdr->nRgnSize = 0; - pRgnHdr->rcBound.top = 0; - pRgnHdr->rcBound.left = 0; - pRgnHdr->rcBound.bottom = LONG(y2 - y1); - pRgnHdr->rcBound.right = LONG(x2 - x1); + pRgnHdr->dwSize = sizeof(RGNDATAHEADER); + pRgnHdr->iType = RDH_RECTANGLES; + pRgnHdr->nRgnSize = 0; + pRgnHdr->rcBound.top = 0; + pRgnHdr->rcBound.left = 0; + pRgnHdr->rcBound.bottom = LONG(y2 - y1); + pRgnHdr->rcBound.right = LONG(x2 - x1); - RECT_T * pRect = (RECT_T *) (((BYTE *) pRgnData) + sizeof(RGNDATAHEADER)); - pRgnHdr->nCount = RegionToYXBandedRectangles(env, x1, y1, x2, y2, region, &pRect, worstBufferSize); + RECT_T * pRect = (RECT_T *) (((BYTE *) pRgnData) + sizeof(RGNDATAHEADER)); + pRgnHdr->nCount = RegionToYXBandedRectangles(env, x1, y1, x2, y2, region, &pRect, worstBufferSize); - hRgn = ::ExtCreateRegion(NULL, - sizeof(RGNDATAHEADER) + sizeof(RECT_T) * pRgnHdr->nCount, pRgnData); + hRgn = ::ExtCreateRegion(NULL, + sizeof(RGNDATAHEADER) + sizeof(RECT_T) * pRgnHdr->nCount, pRgnData); - free(pRgnData); + free(pRgnData); + } + + ::SetWindowRgn(c->GetHWnd(), hRgn, TRUE); } - ::SetWindowRgn(c->GetHWnd(), hRgn, TRUE); - } - ret: - env->DeleteGlobalRef(self); - if (region) { - env->DeleteGlobalRef(region); - } + env->DeleteGlobalRef(self); + if (region) { + env->DeleteGlobalRef(region); + } - delete data; + delete data; + } } void AwtComponent::_SetZOrder(void *param) { diff --git a/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp b/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp index fee6bbdb651..272978b6302 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 (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/windows/awt_Debug.cpp b/jdk/src/windows/native/sun/windows/awt_Debug.cpp index 3d6c424dbf2..42e099bb599 100644 --- a/jdk/src/windows/native/sun/windows/awt_Debug.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Debug.cpp @@ -47,12 +47,21 @@ void * operator new(size_t size, const char * filename, int linenumber) { return ptr; } +void * operator new[](size_t size, const char * filename, int linenumber) { + void * ptr = DMem_AllocateBlock(size, filename, linenumber); + if (ptr == NULL) { + throw std::bad_alloc(); + } + + return ptr; +} + #if _MSC_VER >= 1200 void operator delete(void *ptr, const char*, int) { DASSERTMSG(FALSE, "This version of 'delete' should never get called!!!"); } #endif -void operator delete(void *ptr) { +void operator delete(void *ptr) throw() { DMem_FreeBlock(ptr); } diff --git a/jdk/src/windows/native/sun/windows/awt_Debug.h b/jdk/src/windows/native/sun/windows/awt_Debug.h index 9fc4ab6b7d3..729e652621a 100644 --- a/jdk/src/windows/native/sun/windows/awt_Debug.h +++ b/jdk/src/windows/native/sun/windows/awt_Debug.h @@ -48,11 +48,14 @@ }; extern void * operator new(size_t size, const char * filename, int linenumber); + extern void * operator new[](size_t size, const char * filename, int linenumber); + #if _MSC_VER >= 1200 /* VC 6.0 is more strict about enforcing matching placement new & delete */ extern void operator delete(void *ptr, const char*, int); #endif - extern void operator delete(void *ptr); + + extern void operator delete(void *ptr) throw(); extern void DumpClipRectangle(const char * file, int line, int argc, const char * fmt, va_list arglist); extern void DumpUpdateRectangle(const char * file, int line, int argc, const char * fmt, va_list arglist); diff --git a/jdk/src/windows/native/sun/windows/awt_Desktop.cpp b/jdk/src/windows/native/sun/windows/awt_Desktop.cpp index 67506f3bc1e..5db6c4bbcec 100644 --- a/jdk/src/windows/native/sun/windows/awt_Desktop.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Desktop.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/windows/awt_DesktopProperties.cpp b/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp index 50d305fd511..8d13a97249a 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 (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -238,7 +238,7 @@ void AwtDesktopProperties::GetNonClientParameters() { // when running on XP. However this can't be referenced at compile time // with the older SDK, so there use 'lfMessageFont' plus its size. if (!IS_WINVISTA) { -#if defined(_MSC_VER) && (_MSC_VER >= 1600) { +#if defined(_MSC_VER) && (_MSC_VER >= 1600) ncmetrics.cbSize = offsetof(NONCLIENTMETRICS, iPaddedBorderWidth); #else ncmetrics.cbSize = offsetof(NONCLIENTMETRICS,lfMessageFont) + sizeof(LOGFONT); @@ -650,7 +650,7 @@ UINT AwtDesktopProperties::GetIntegerParameter(UINT spi) { } void AwtDesktopProperties::SetStringProperty(LPCTSTR propName, LPTSTR value) { - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setStringPropertyID, key, JNU_NewStringPlatform(GetEnv(), value)); @@ -658,7 +658,7 @@ void AwtDesktopProperties::SetStringProperty(LPCTSTR propName, LPTSTR value) { } void AwtDesktopProperties::SetIntegerProperty(LPCTSTR propName, int value) { - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setIntegerPropertyID, key, (jint)value); @@ -666,7 +666,7 @@ void AwtDesktopProperties::SetIntegerProperty(LPCTSTR propName, int value) { } void AwtDesktopProperties::SetBooleanProperty(LPCTSTR propName, BOOL value) { - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setBooleanPropertyID, key, value ? JNI_TRUE : JNI_FALSE); @@ -674,7 +674,7 @@ void AwtDesktopProperties::SetBooleanProperty(LPCTSTR propName, BOOL value) { } void AwtDesktopProperties::SetColorProperty(LPCTSTR propName, DWORD value) { - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setColorPropertyID, key, GetRValue(value), GetGValue(value), @@ -726,7 +726,7 @@ void AwtDesktopProperties::SetFontProperty(HDC dc, int fontID, style |= java_awt_Font_ITALIC; } - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setFontPropertyID, key, fontName, style, pointSize); @@ -744,7 +744,7 @@ void AwtDesktopProperties::SetFontProperty(LPCTSTR propName, const LOGFONT & fon jint pointSize; jint style; - fontName = JNU_NewStringPlatform(GetEnv(), const_cast(font.lfFaceName)); + fontName = JNU_NewStringPlatform(GetEnv(), font.lfFaceName); #if 0 HDC hdc; @@ -767,7 +767,7 @@ void AwtDesktopProperties::SetFontProperty(LPCTSTR propName, const LOGFONT & fon style |= java_awt_Font_ITALIC; } - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setFontPropertyID, key, fontName, style, pointSize); @@ -776,8 +776,8 @@ void AwtDesktopProperties::SetFontProperty(LPCTSTR propName, const LOGFONT & fon } void AwtDesktopProperties::SetSoundProperty(LPCTSTR propName, LPCTSTR winEventName) { - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); - jstring event = JNU_NewStringPlatform(GetEnv(), const_cast(winEventName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); + jstring event = JNU_NewStringPlatform(GetEnv(), winEventName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setSoundPropertyID, key, event); diff --git a/jdk/src/windows/native/sun/windows/awt_Dialog.cpp b/jdk/src/windows/native/sun/windows/awt_Dialog.cpp index 41142900568..3de84956989 100644 --- a/jdk/src/windows/native/sun/windows/awt_Dialog.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Dialog.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -230,7 +230,7 @@ LRESULT CALLBACK AwtDialog::ModalFilterProc(int code, if (::IsIconic(hWnd)) { ::ShowWindow(hWnd, SW_RESTORE); } - PopupAllDialogs(blocker, TRUE, ::GetForegroundWindow(), FALSE); + PopupBlockers(blocker, TRUE, ::GetForegroundWindow(), FALSE); // return 1 to prevent the system from allowing the operation return 1; } @@ -256,7 +256,7 @@ LRESULT CALLBACK AwtDialog::MouseHookProc(int nCode, HWND blocker = AwtWindow::GetModalBlocker(AwtComponent::GetTopLevelParentForWindow(hWnd)); if (::IsWindow(blocker)) { BOOL onTaskbar = !(::WindowFromPoint(mhs->pt) == hWnd); - PopupAllDialogs(hWnd, FALSE, ::GetForegroundWindow(), onTaskbar); + PopupBlockers(blocker, FALSE, ::GetForegroundWindow(), onTaskbar); // return a nonzero value to prevent the system from passing // the message to the target window procedure return 1; @@ -268,52 +268,60 @@ LRESULT CALLBACK AwtDialog::MouseHookProc(int nCode, } /* - * The function goes through the heirarchy of the blocker dialogs and - * popups all the dialogs. Note that the function starts from the top - * blocker dialog and goes down to the dialog which is the bottom dialog. - * Using another traversal may cause to the flickering issue as a bottom - * dialog will cover a top dialog for some period of time. + * The function goes through the hierarchy of the blockers and + * popups all the blockers. Note that the function starts from the top + * blocker and goes down to the blocker which is the bottom one. + * Using another traversal algorithm (bottom->top) may cause to flickering + * as the bottom blocker will cover the top blocker for a while. */ -void AwtDialog::PopupAllDialogs(HWND dialog, BOOL isModalHook, HWND prevFGWindow, BOOL onTaskbar) +void AwtDialog::PopupBlockers(HWND blocker, BOOL isModalHook, HWND prevFGWindow, BOOL onTaskbar) { - HWND blocker = AwtWindow::GetModalBlocker(dialog); - BOOL isBlocked = ::IsWindow(blocker); - if (isBlocked) { - PopupAllDialogs(blocker, isModalHook, prevFGWindow, onTaskbar); + HWND nextBlocker = AwtWindow::GetModalBlocker(blocker); + BOOL nextBlockerExists = ::IsWindow(nextBlocker); + if (nextBlockerExists) { + PopupBlockers(nextBlocker, isModalHook, prevFGWindow, onTaskbar); } - PopupOneDialog(dialog, blocker, isModalHook, prevFGWindow, onTaskbar); + PopupBlocker(blocker, nextBlocker, isModalHook, prevFGWindow, onTaskbar); } /* - * The function popups the dialog, it distinguishes non-blocked dialogs - * and activates the dialogs (sets as foreground window). If the dialog is - * blocked, then it changes the Z-order of the dialog. + * The function popups the blocker, for a non-blocked blocker we need + * to activate the blocker but if a blocker is blocked, then we need + * to change z-order of the blocker placing the blocker under the next blocker. */ -void AwtDialog::PopupOneDialog(HWND dialog, HWND blocker, BOOL isModalHook, HWND prevFGWindow, BOOL onTaskbar) +void AwtDialog::PopupBlocker(HWND blocker, HWND nextBlocker, BOOL isModalHook, HWND prevFGWindow, BOOL onTaskbar) { - if (dialog == AwtToolkit::GetInstance().GetHWnd()) { + if (blocker == AwtToolkit::GetInstance().GetHWnd()) { return; } // fix for 6494032 - if (isModalHook && !::IsWindowVisible(dialog)) { - ::ShowWindow(dialog, SW_SHOWNA); + if (isModalHook && !::IsWindowVisible(blocker)) { + ::ShowWindow(blocker, SW_SHOWNA); } - BOOL isBlocked = ::IsWindow(blocker); + BOOL nextBlockerExists = ::IsWindow(nextBlocker); UINT flags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE; - if (isBlocked) { - ::SetWindowPos(dialog, blocker, 0, 0, 0, 0, flags); + if (nextBlockerExists) { + // Fix for 6829546: if blocker is a top-most window, but window isn't, then + // calling ::SetWindowPos(dialog, blocker, ...) makes window top-most as well + BOOL topmostNextBlocker = (::GetWindowLong(nextBlocker, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0; + BOOL topmostBlocker = (::GetWindowLong(blocker, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0; + if (!topmostNextBlocker || topmostBlocker) { + ::SetWindowPos(blocker, nextBlocker, 0, 0, 0, 0, flags); + } else { + ::SetWindowPos(blocker, HWND_TOP, 0, 0, 0, 0, flags); + } } else { - ::SetWindowPos(dialog, HWND_TOP, 0, 0, 0, 0, flags); + ::SetWindowPos(blocker, HWND_TOP, 0, 0, 0, 0, flags); // no beep/flash if the mouse was clicked in the taskbar menu // or the dialog is currently inactive - if (!isModalHook && !onTaskbar && (dialog == prevFGWindow)) { - AnimateModalBlocker(dialog); + if (!isModalHook && !onTaskbar && (blocker == prevFGWindow)) { + AnimateModalBlocker(blocker); } - ::BringWindowToTop(dialog); - ::SetForegroundWindow(dialog); + ::BringWindowToTop(blocker); + ::SetForegroundWindow(blocker); } } diff --git a/jdk/src/windows/native/sun/windows/awt_Dialog.h b/jdk/src/windows/native/sun/windows/awt_Dialog.h index 5aa99dfcec3..15918a6fd88 100644 --- a/jdk/src/windows/native/sun/windows/awt_Dialog.h +++ b/jdk/src/windows/native/sun/windows/awt_Dialog.h @@ -113,8 +113,8 @@ private: */ static void ModalPerformActivation(HWND hWnd); - static void PopupAllDialogs(HWND dialog, BOOL isModalHook, HWND prevFGWindow, BOOL onTaskbar); - static void PopupOneDialog(HWND dialog, HWND blocker, BOOL isModalHook, HWND prevFGWindow, BOOL onTaskbar); + static void PopupBlockers(HWND blocker, BOOL isModalHook, HWND prevFGWindow, BOOL onTaskbar); + static void PopupBlocker(HWND blocker, HWND nextBlocker, BOOL isModalHook, HWND prevFGWindow, BOOL onTaskbar); public: diff --git a/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp b/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp index fe4f5a58145..1aea026c885 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 (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/windows/awt_DrawingSurface.h b/jdk/src/windows/native/sun/windows/awt_DrawingSurface.h index da10b7d223a..cd135b947e2 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 (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +159,8 @@ extern "C" { void JNICALL DSUnlockAWT(JNIEnv* env); _JNI_IMPORT_OR_EXPORT_ - jobject JNICALL DSGetComponent(JNIEnv* env, void* platformInfo); + jobject JNICALL DSGetComponent( + JNIEnv* env, void* platformInfo); #ifdef __cplusplus } /* extern "C" */ diff --git a/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp b/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp index cfc36a42eee..a0762b4eaaf 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 (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/windows/awt_FileDialog.h b/jdk/src/windows/native/sun/windows/awt_FileDialog.h index 25f312c40b6..a71ba6a3565 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 (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/windows/awt_Font.cpp b/jdk/src/windows/native/sun/windows/awt_Font.cpp index e1544e6ac65..d07cdae0467 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 (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1189,7 +1189,7 @@ LONG AwtFontCache::DecRefCount(Item* item){ AwtFontCache::Item::Item(const WCHAR* s, HFONT f, AwtFontCache::Item* n ) { - name = wcsdup(s); + name = _wcsdup(s); font = f; next = n; refCount = 1; @@ -1237,7 +1237,7 @@ void CSegTableComponent::Create(LPCWSTR name) free(m_lpszFontName); m_lpszFontName = NULL; } - m_lpszFontName = wcsdup(name); + m_lpszFontName = _wcsdup(name); DASSERT(m_lpszFontName); } diff --git a/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp b/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp index c93edc3621b..e661aa04831 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 (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -540,34 +540,15 @@ jobject CreateLocaleObject(JNIEnv *env, const char * name) { TRY; - // get language, country, variant information - char * language = (char *)safe_Malloc(strlen(name) + 1); - char * country; - char * variant; - DASSERT(!safe_ExceptionOccurred(env)); - strcpy(language, name); - for (country = language; *country != '_' && *country != '\0'; country++); - if (*country == '_') { - *country++ = '\0'; - for (variant = country; *variant != '_' && *variant != '\0'; variant++); - if (*variant == '_') { - *variant++ = '\0'; - } - } else { - variant = country; - } - // create Locale object - jobject langObj = env->NewStringUTF(language); - jobject ctryObj = env->NewStringUTF(country); - jobject vrntObj = env->NewStringUTF(variant); - jobject localeObj = JNU_NewObjectByName(env, "java/util/Locale", - "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", - langObj, ctryObj, vrntObj); - free(language); - env->DeleteLocalRef(langObj); - env->DeleteLocalRef(ctryObj); - env->DeleteLocalRef(vrntObj); + jobject langtagObj = env->NewStringUTF(name); + jobject localeObj = JNU_CallStaticMethodByName(env, + NULL, + "java/util/Locale", + "forLanguageTag", + "(Ljava/lang/String;)Ljava/util/Locale;", + langtagObj).l; + env->DeleteLocalRef(langtagObj); return localeObj; diff --git a/jdk/src/windows/native/sun/windows/awt_MenuItem.cpp b/jdk/src/windows/native/sun/windows/awt_MenuItem.cpp index 6ed2a73d6af..aeb1021262a 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 (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/windows/awt_PrintJob.cpp b/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp index fbaf4a6ae55..df0f263ddfc 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 (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1050,7 +1050,7 @@ static LPTSTR GetPrinterPort(JNIEnv *env, LPTSTR printer) { return NULL; } - LPTSTR port = wcsdup(info2->pPortName); + LPTSTR port = _wcsdup(info2->pPortName); ::GlobalFree(info2); return port; } diff --git a/jdk/src/windows/native/sun/windows/awt_Robot.cpp b/jdk/src/windows/native/sun/windows/awt_Robot.cpp index bef6f13ede5..cdee9cf6001 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 (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -194,9 +194,9 @@ inline jint AwtRobot::WinToJavaPixel(USHORT r, USHORT g, USHORT b) jint AwtRobot::GetRGBPixel( jint x, jint y) { - HDC hdc = GetDC(NULL); + HDC hdc = ::CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL); COLORREF ref = ::GetPixel( hdc, x, y ); - ReleaseDC(NULL,hdc); + ::DeleteDC(hdc); jint value = WinToJavaPixel(GetRValue(ref), GetGValue(ref), GetBValue(ref)); return value; } diff --git a/jdk/src/windows/native/sun/windows/awt_TextArea.cpp b/jdk/src/windows/native/sun/windows/awt_TextArea.cpp index 5cdbad959fc..350efdd91b1 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 (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/windows/awt_TextArea.h b/jdk/src/windows/native/sun/windows/awt_TextArea.h index 27b7b004b97..19a44e7681b 100644 --- a/jdk/src/windows/native/sun/windows/awt_TextArea.h +++ b/jdk/src/windows/native/sun/windows/awt_TextArea.h @@ -41,9 +41,6 @@ class AwtTextArea : public AwtTextComponent { - // inner classes - class OleCallback; - public: /* java.awt.TextArea fields ids */ @@ -89,6 +86,37 @@ public: static void _ReplaceText(void *param); protected: + + /***************************************************************** + * Inner class OleCallback declaration. + */ + class OleCallback : public IRichEditOleCallback { + public: + OleCallback(); + + STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj); + STDMETHODIMP_(ULONG) AddRef(); + STDMETHODIMP_(ULONG) Release(); + STDMETHODIMP GetNewStorage(LPSTORAGE FAR * ppstg); + STDMETHODIMP GetInPlaceContext(LPOLEINPLACEFRAME FAR * ppipframe, + LPOLEINPLACEUIWINDOW FAR* ppipuiDoc, + LPOLEINPLACEFRAMEINFO pipfinfo); + STDMETHODIMP ShowContainerUI(BOOL fShow); + STDMETHODIMP QueryInsertObject(LPCLSID pclsid, LPSTORAGE pstg, LONG cp); + STDMETHODIMP DeleteObject(LPOLEOBJECT poleobj); + STDMETHODIMP QueryAcceptData(LPDATAOBJECT pdataobj, CLIPFORMAT *pcfFormat, + DWORD reco, BOOL fReally, HGLOBAL hMetaPict); + STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode); + STDMETHODIMP GetClipboardData(CHARRANGE *pchrg, DWORD reco, + LPDATAOBJECT *ppdataobj); + STDMETHODIMP GetDragDropEffect(BOOL fDrag, DWORD grfKeyState, + LPDWORD pdwEffect); + STDMETHODIMP GetContextMenu(WORD seltype, LPOLEOBJECT poleobj, + CHARRANGE FAR * pchrg, HMENU FAR * phmenu); + private: + ULONG m_refs; // Reference count + };//OleCallback class + INLINE static OleCallback& GetOleCallback() { return sm_oleCallback; } void EditSetSel(CHARRANGE &cr); void EditGetSel(CHARRANGE &cr); @@ -114,37 +142,6 @@ protected: static OleCallback sm_oleCallback; - /***************************************************************** - * Inner class OleCallback declaration. - */ - - class AwtTextArea::OleCallback : public IRichEditOleCallback { - public: - OleCallback(); - - STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj); - STDMETHODIMP_(ULONG) AddRef(); - STDMETHODIMP_(ULONG) Release(); - STDMETHODIMP GetNewStorage(LPSTORAGE FAR * ppstg); - STDMETHODIMP GetInPlaceContext(LPOLEINPLACEFRAME FAR * ppipframe, - LPOLEINPLACEUIWINDOW FAR* ppipuiDoc, - LPOLEINPLACEFRAMEINFO pipfinfo); - STDMETHODIMP ShowContainerUI(BOOL fShow); - STDMETHODIMP QueryInsertObject(LPCLSID pclsid, LPSTORAGE pstg, LONG cp); - STDMETHODIMP DeleteObject(LPOLEOBJECT poleobj); - STDMETHODIMP QueryAcceptData(LPDATAOBJECT pdataobj, CLIPFORMAT *pcfFormat, - DWORD reco, BOOL fReally, HGLOBAL hMetaPict); - STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode); - STDMETHODIMP GetClipboardData(CHARRANGE *pchrg, DWORD reco, - LPDATAOBJECT *ppdataobj); - STDMETHODIMP GetDragDropEffect(BOOL fDrag, DWORD grfKeyState, - LPDWORD pdwEffect); - STDMETHODIMP GetContextMenu(WORD seltype, LPOLEOBJECT poleobj, - CHARRANGE FAR * pchrg, HMENU FAR * phmenu); - private: - ULONG m_refs; // Reference count - }; - }; #endif /* AWT_TEXTAREA_H */ diff --git a/jdk/src/windows/native/sun/windows/awt_TextComponent.h b/jdk/src/windows/native/sun/windows/awt_TextComponent.h index 7581c5c7aae..34ae4d67d49 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 (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/windows/awt_TextField.cpp b/jdk/src/windows/native/sun/windows/awt_TextField.cpp index 8f72dc06b56..f7033465195 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 (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/windows/awt_TextField.h b/jdk/src/windows/native/sun/windows/awt_TextField.h index a037adff795..81aeb407c46 100644 --- a/jdk/src/windows/native/sun/windows/awt_TextField.h +++ b/jdk/src/windows/native/sun/windows/awt_TextField.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/native/sun/windows/awt_Toolkit.cpp b/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp index 2beb5191bd2..cf1503981a8 100644 --- a/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 @@ * questions. */ +#define _JNI_IMPLEMENTATION_ + #include "awt.h" #include #include - -//#if defined(_DEBUG) && defined(_MSC_VER) && _MSC_VER >= 1000 -//#include -//#endif - -#define _JNI_IMPLEMENTATION_ +#include #include "awt_DrawingSurface.h" #include "awt_AWTEvent.h" @@ -92,7 +89,7 @@ extern void DWMResetCompositionEnabled(); /* Initialize the Java VM instance variable when the library is first loaded */ -JavaVM *jvm; +JavaVM *jvm = NULL; JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) @@ -362,6 +359,95 @@ HWND AwtToolkit::CreateToolkitWnd(LPCTSTR name) return hwnd; } + +struct ToolkitThreadProc_Data { + bool result; + HANDLE hCompleted; + + jobject thread; +}; + +void ToolkitThreadProc(void *param) +{ + ToolkitThreadProc_Data *data = (ToolkitThreadProc_Data *)param; + + bool bNotified = false; + + JNIEnv *env; + JavaVMAttachArgs attachArgs; + attachArgs.version = JNI_VERSION_1_2; + attachArgs.name = "AWT-Windows"; + attachArgs.group = NULL; + + jint res = jvm->AttachCurrentThreadAsDaemon((void **)&env, &attachArgs); + if (res < 0) { + return; + } + + jobject thread = env->NewGlobalRef(data->thread); + if (thread != NULL) { + jclass cls = env->GetObjectClass(thread); + if (cls != NULL) { + jmethodID runId = env->GetMethodID(cls, "run", "()V"); + if (runId != NULL) { + data->result = true; + ::SetEvent(data->hCompleted); + bNotified = true; + + env->CallVoidMethod(thread, runId); + + if (env->ExceptionCheck()) { + env->ExceptionDescribe(); + env->ExceptionClear(); + // TODO: handle + } + } + env->DeleteLocalRef(cls); + } + env->DeleteGlobalRef(thread); + } + if (!bNotified) { + ::SetEvent(data->hCompleted); + } + + jvm->DetachCurrentThread(); +} + +/* + * Class: sun_awt_windows_WToolkit + * Method: startToolkitThread + * Signature: (Ljava/lang/Runnable;)Z + */ +JNIEXPORT jboolean JNICALL +Java_sun_awt_windows_WToolkit_startToolkitThread(JNIEnv *env, jclass cls, jobject thread) +{ + AwtToolkit& tk = AwtToolkit::GetInstance(); + + ToolkitThreadProc_Data data; + data.result = false; + data.thread = env->NewGlobalRef(thread); + if (data.thread == NULL) { + return JNI_FALSE; + } + data.hCompleted = ::CreateEvent(NULL, FALSE, FALSE, NULL); + + bool result = tk.GetPreloadThread() + .InvokeAndTerminate(ToolkitThreadProc, &data); + + if (result) { + ::WaitForSingleObject(data.hCompleted, INFINITE); + result = data.result; + } else { + // no awt preloading + // return back to the usual toolkit way + } + ::CloseHandle(data.hCompleted); + + env->DeleteGlobalRef(data.thread); + + return result ? JNI_TRUE : JNI_FALSE; +} + BOOL AwtToolkit::Initialize(BOOL localPump) { AwtToolkit& tk = AwtToolkit::GetInstance(); @@ -375,6 +461,11 @@ BOOL AwtToolkit::Initialize(BOOL localPump) { // ComCtl32Util was constructed but not disposed ComCtl32Util::GetInstance().InitLibraries(); + if (!localPump) { + // if preload thread was run, terminate it + preloadThread.Terminate(true); + } + /* Register this toolkit's helper window */ VERIFY(tk.RegisterClass() != NULL); @@ -443,7 +534,7 @@ BOOL AwtToolkit::Dispose() { // 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(); + D3DInitializer::GetInstance().Clean(); AwtObjectList::Cleanup(); AwtFont::Cleanup(); @@ -1639,6 +1730,275 @@ void AwtToolkit::GetWindowRect(HWND hWnd, LPRECT lpRect) ::GetWindowRect(hWnd, lpRect); } + +/************************************************************************ + * AWT preloading support + */ +bool AwtToolkit::PreloadAction::EnsureInited() +{ + DWORD _initThreadId = GetInitThreadID(); + if (_initThreadId != 0) { + // already inited + // ensure the action is inited on correct thread + PreloadThread &preloadThread + = AwtToolkit::GetInstance().GetPreloadThread(); + if (_initThreadId == preloadThread.GetThreadId()) { + if (!preloadThread.IsWrongThread()) { + return true; + } + // inited on preloadThread (wrongThread), not cleaned yet + // have to wait cleanup completion + preloadThread.Wait4Finish(); + } else { + // inited on other thread (Toolkit thread?) + // consider as correctly inited + return true; + } + } + + // init on Toolkit thread + AwtToolkit::GetInstance().InvokeFunction(InitWrapper, this); + + return true; +} + +DWORD AwtToolkit::PreloadAction::GetInitThreadID() +{ + CriticalSection::Lock lock(initLock); + return initThreadId; +} + +bool AwtToolkit::PreloadAction::Clean() +{ + DWORD _initThreadId = GetInitThreadID(); + if (_initThreadId == ::GetCurrentThreadId()) { + // inited on this thread + Clean(false); + return true; + } + return false; +} + +/*static*/ +void AwtToolkit::PreloadAction::InitWrapper(void *param) +{ + PreloadAction *pThis = (PreloadAction *)param; + pThis->Init(); +} + +void AwtToolkit::PreloadAction::Init() +{ + CriticalSection::Lock lock(initLock); + if (initThreadId == 0) { + initThreadId = ::GetCurrentThreadId(); + InitImpl(); + } +} + +void AwtToolkit::PreloadAction::Clean(bool reInit) { + CriticalSection::Lock lock(initLock); + if (initThreadId != 0) { + //ASSERT(initThreadId == ::GetCurrentThreadId()); + CleanImpl(reInit); + initThreadId = 0; + } +} + +// PreloadThread implementation +AwtToolkit::PreloadThread::PreloadThread() + : status(None), wrongThread(false), threadId(0), + pActionChain(NULL), pLastProcessedAction(NULL), + execFunc(NULL), execParam(NULL) +{ + hFinished = ::CreateEvent(NULL, TRUE, FALSE, NULL); + hAwake = ::CreateEvent(NULL, FALSE, FALSE, NULL); +} + +AwtToolkit::PreloadThread::~PreloadThread() +{ + //Terminate(false); + ::CloseHandle(hFinished); + ::CloseHandle(hAwake); +} + +bool AwtToolkit::PreloadThread::AddAction(AwtToolkit::PreloadAction *pAction) +{ + CriticalSection::Lock lock(threadLock); + + if (status > Preloading) { + // too late - the thread already terminated or run as toolkit thread + return false; + } + + if (pActionChain == NULL) { + // 1st action + pActionChain = pAction; + } else { + // add the action to the chain + PreloadAction *pChain = pActionChain; + while (true) { + PreloadAction *pNext = pChain->GetNext(); + if (pNext == NULL) { + break; + } + pChain = pNext; + } + pChain->SetNext(pAction); + } + + if (status > None) { + // the thread is already running (status == Preloading) + AwakeThread(); + return true; + } + + // need to start thread + ::ResetEvent(hAwake); + ::ResetEvent(hFinished); + + HANDLE hThread = (HANDLE)_beginthreadex(NULL, 0x100000, StaticThreadProc, + this, 0, &threadId); + + if (hThread == 0) { + threadId = 0; + return false; + } + + status = Preloading; + + ::CloseHandle(hThread); + + return true; +} + +bool AwtToolkit::PreloadThread::Terminate(bool wrongThread) +{ + CriticalSection::Lock lock(threadLock); + + if (status != Preloading) { + return false; + } + + execFunc = NULL; + execParam = NULL; + this->wrongThread = wrongThread; + status = Cleaning; + AwakeThread(); + + return true; +} + +bool AwtToolkit::PreloadThread::InvokeAndTerminate(void(_cdecl *fn)(void *), void *param) +{ + CriticalSection::Lock lock(threadLock); + + if (status != Preloading) { + return false; + } + + execFunc = fn; + execParam = param; + status = fn == NULL ? Cleaning : RunningToolkit; + AwakeThread(); + + return true; +} + +bool AwtToolkit::PreloadThread::OnPreloadThread() +{ + return GetThreadId() == ::GetCurrentThreadId(); +} + +/*static*/ +unsigned WINAPI AwtToolkit::PreloadThread::StaticThreadProc(void *param) +{ + AwtToolkit::PreloadThread *pThis = (AwtToolkit::PreloadThread *)param; + return pThis->ThreadProc(); +} + +unsigned AwtToolkit::PreloadThread::ThreadProc() +{ + void(_cdecl *_execFunc)(void *) = NULL; + void *_execParam = NULL; + bool _wrongThread = false; + + // initialization + while (true) { + PreloadAction *pAction; + { + CriticalSection::Lock lock(threadLock); + if (status != Preloading) { + // get invoke parameters + _execFunc = execFunc; + _execParam = execParam; + _wrongThread = wrongThread; + break; + } + pAction = GetNextAction(); + } + if (pAction != NULL) { + pAction->Init(); + } else { + ::WaitForSingleObject(hAwake, INFINITE); + } + } + + // call a function from InvokeAndTerminate + if (_execFunc != NULL) { + _execFunc(_execParam); + } else { + // time to terminate.. + } + + // cleanup + { + CriticalSection::Lock lock(threadLock); + pLastProcessedAction = NULL; // goto 1st action in the chain + status = Cleaning; + } + for (PreloadAction *pAction = GetNextAction(); pAction != NULL; + pAction = GetNextAction()) { + pAction->Clean(_wrongThread); + } + + // don't clear threadId! it is used by PreloadAction::EnsureInited + + { + CriticalSection::Lock lock(threadLock); + status = Finished; + } + ::SetEvent(hFinished); + return 0; +} + +AwtToolkit::PreloadAction* AwtToolkit::PreloadThread::GetNextAction() +{ + CriticalSection::Lock lock(threadLock); + PreloadAction *pAction = (pLastProcessedAction == NULL) + ? pActionChain + : pLastProcessedAction->GetNext(); + if (pAction != NULL) { + pLastProcessedAction = pAction; + } + + return pAction; +} + + +extern "C" { + +/* Terminates preload thread (if it's still alive + * - it may occur if the application doesn't use AWT). + * The function is called from launcher after completion main java thread. + */ +__declspec(dllexport) void preloadStop() +{ + AwtToolkit::GetInstance().GetPreloadThread().Terminate(false); +} + +} + + /************************************************************************ * Toolkit native methods */ @@ -2224,21 +2584,21 @@ Java_sun_awt_windows_WToolkit_getWindowsVersion(JNIEnv *env, jclass cls) WCHAR szVer[128]; DWORD version = ::GetVersion(); - swprintf(szVer, L"0x%x = %ld", version, version); + swprintf(szVer, 128, L"0x%x = %ld", version, version); int l = lstrlen(szVer); if (IS_WIN2000) { if (IS_WINXP) { if (IS_WINVISTA) { - swprintf(szVer + l, L" (Windows Vista)"); + swprintf(szVer + l, 128, L" (Windows Vista)"); } else { - swprintf(szVer + l, L" (Windows XP)"); + swprintf(szVer + l, 128, L" (Windows XP)"); } } else { - swprintf(szVer + l, L" (Windows 2000)"); + swprintf(szVer + l, 128, L" (Windows 2000)"); } } else { - swprintf(szVer + l, L" (Unknown)"); + swprintf(szVer + l, 128, L" (Unknown)"); } return JNU_NewStringPlatform(env, szVer); diff --git a/jdk/src/windows/native/sun/windows/awt_Toolkit.h b/jdk/src/windows/native/sun/windows/awt_Toolkit.h index 2a957719337..3ebd465caca 100644 --- a/jdk/src/windows/native/sun/windows/awt_Toolkit.h +++ b/jdk/src/windows/native/sun/windows/awt_Toolkit.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -110,7 +110,7 @@ class CriticalSection { private: const CriticalSection& critSec; }; - friend Lock; + friend class Lock; private: CRITICAL_SECTION rep; @@ -465,6 +465,153 @@ public: void InstallMouseLowLevelHook(); void UninstallMouseLowLevelHook(); + + +/* AWT preloading (early Toolkit thread start) + */ +public: + /* Toolkit preload action class. + * Preload actions should be registered with + * AwtToolkit::getInstance().GetPreloadThread().AddAction(). + * AwtToolkit thread calls InitImpl method at the beghining + * and CleanImpl(false) before exiting for all registered actions. + * If an application provides own Toolkit thread + * (sun.awt.windows.WToolkit.embeddedInit), the thread calls Clean(true) + * for each action. + */ + class PreloadThread; // forward declaration + class PreloadAction { + friend class PreloadThread; + public: + PreloadAction() : initThreadId(0), pNext(NULL) {} + virtual ~PreloadAction() {} + + protected: + // called by PreloadThread or as result + // of EnsureInited() call (on Toolkit thread!). + virtual void InitImpl() = 0; + + // called by PreloadThread (before exiting). + // reInit == false: normal shutdown; + // reInit == true: PreloadThread is shutting down due external + // Toolkit thread was provided. + virtual void CleanImpl(bool reInit) = 0; + + public: + // Initialized the action on the Toolkit thread if not yet initialized. + bool EnsureInited(); + + // returns thread ID which the action was inited on (0 if not inited) + DWORD GetInitThreadID(); + + // Allows to deinitialize action earlier. + // The method must be called on the Toolkit thread only. + // returns true on success, + // false if the action was inited on other thread. + bool Clean(); + + private: + unsigned initThreadId; + // lock for Init/Clean + CriticalSection initLock; + + // Chain support (for PreloadThread) + PreloadAction *pNext; // for action chain used by PreloadThread + void SetNext(PreloadAction *pNext) { this->pNext = pNext; } + PreloadAction *GetNext() { return pNext; } + + // wrapper for AwtToolkit::InvokeFunction + static void InitWrapper(void *param); + + void Init(); + void Clean(bool reInit); + + }; + + /** Toolkit preload thread class. + */ + class PreloadThread { + public: + PreloadThread(); + ~PreloadThread(); + + // adds action & start the thread if not yet started + bool AddAction(PreloadAction *pAction); + + // sets termination flag; returns true if the thread is running. + // wrongThread specifies cause of the termination: + // false means termination on the application shutdown; + // wrongThread is used as reInit parameter for action cleanup. + bool Terminate(bool wrongThread); + bool InvokeAndTerminate(void(_cdecl *fn)(void *), void *param); + + // waits for the the thread completion; + // use the method after Terminate() only if Terminate() returned true + INLINE void Wait4Finish() { + ::WaitForSingleObject(hFinished, INFINITE); + } + + INLINE unsigned GetThreadId() { + CriticalSection::Lock lock(threadLock); + return threadId; + } + INLINE bool IsWrongThread() { + CriticalSection::Lock lock(threadLock); + return wrongThread; + } + // returns true if the current thread is "preload" thread + bool OnPreloadThread(); + + private: + // data access lock + CriticalSection threadLock; + + // the thread status + enum Status { + None = -1, // initial + Preloading = 0, // preloading in progress + RunningToolkit, // Running as Toolkit thread + Cleaning, // exited from Toolkit thread proc, cleaning + Finished // + } status; + + // "wrong thread" flag + bool wrongThread; + + // thread proc (calls (this)param->ThreadProc()) + static unsigned WINAPI StaticThreadProc(void *param); + unsigned ThreadProc(); + + INLINE void AwakeThread() { + ::SetEvent(hAwake); + } + + // if threadId != 0 -> we are running + unsigned threadId; + // ThreadProc sets the event on exit + HANDLE hFinished; + // ThreadProc waits on the event for NewAction/Terminate/InvokeAndTerminate + HANDLE hAwake; + + // function/param to invoke (InvokeAndTerminate) + // if execFunc == NULL => just terminate + void(_cdecl *execFunc)(void *); + void *execParam; + + // action chain + PreloadAction *pActionChain; + PreloadAction *pLastProcessedAction; + + // returns next action in the list (NULL if no more actions) + PreloadAction* GetNextAction(); + + }; + + INLINE PreloadThread& GetPreloadThread() { return preloadThread; } + +private: + PreloadThread preloadThread; + }; diff --git a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp index c971ee79483..03cb4675075 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 (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -269,7 +269,7 @@ Java_sun_awt_Win32FontManager_getEUDCFontFile(JNIEnv *env, jclass cl) { //if the fontPath includes %SystemRoot% LPWSTR systemRoot = _wgetenv(L"SystemRoot"); if (systemRoot != NULL - && swprintf(tmpPath, L"%s%s", systemRoot, fontPath + 12) != -1) { + && swprintf(tmpPath, MAX_PATH, L"%s%s", systemRoot, fontPath + 12) != -1) { fontPath = tmpPath; } else { @@ -279,7 +279,7 @@ Java_sun_awt_Win32FontManager_getEUDCFontFile(JNIEnv *env, jclass cl) { //else to see if it only inludes "EUDC.TTE" WCHAR systemRoot[MAX_PATH + 1]; if (GetWindowsDirectory(systemRoot, MAX_PATH + 1) != 0) { - swprintf(tmpPath, L"%s\\FONTS\\EUDC.TTE", systemRoot); + swprintf(tmpPath, MAX_PATH, L"%s\\FONTS\\EUDC.TTE", systemRoot); fontPath = tmpPath; } else { diff --git a/jdk/src/windows/native/sun/windows/awt_Window.cpp b/jdk/src/windows/native/sun/windows/awt_Window.cpp index 6023e10531f..a5dbfa3bf31 100644 --- a/jdk/src/windows/native/sun/windows/awt_Window.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ AwtWindow::AwtWindow() { ::InitializeCriticalSection(&contentBitmapCS); - m_windowType = Type::NORMAL; + m_windowType = NORMAL; m_alwaysOnTop = false; } @@ -1016,9 +1016,9 @@ void AwtWindow::InitType(JNIEnv *env, jobject peer) } if (strcmp(valueNative, "UTILITY") == 0) { - m_windowType = Type::UTILITY; + m_windowType = UTILITY; } else if (strcmp(valueNative, "POPUP") == 0) { - m_windowType = Type::POPUP; + m_windowType = POPUP; } env->ReleaseStringUTFChars(value, valueNative); @@ -1029,10 +1029,10 @@ void AwtWindow::InitType(JNIEnv *env, jobject peer) void AwtWindow::TweakStyle(DWORD & style, DWORD & exStyle) { switch (GetType()) { - case Type::UTILITY: + case UTILITY: exStyle |= WS_EX_TOOLWINDOW; break; - case Type::POPUP: + case POPUP: style &= ~WS_OVERLAPPED; style |= WS_POPUP; break; diff --git a/jdk/src/windows/native/sun/windows/awtmsg.h b/jdk/src/windows/native/sun/windows/awtmsg.h index 34ce80e1362..898471b4923 100644 --- a/jdk/src/windows/native/sun/windows/awtmsg.h +++ b/jdk/src/windows/native/sun/windows/awtmsg.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/windows/resource/java.manifest b/jdk/src/windows/resource/java.manifest index dde8ca07c04..61ec5999e19 100644 --- a/jdk/src/windows/resource/java.manifest +++ b/jdk/src/windows/resource/java.manifest @@ -3,7 +3,7 @@ AWT diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index ed75606e211..f2380764a1a 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -439,6 +439,9 @@ java/rmi/reliability/benchmark/runRmiBench.sh generic-all java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java generic-all java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java generic-all +java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java generic-all +java/rmi/transport/dgcDeadLock/TestImpl_Stub.java generic-all + # Address already in use, othervm mode, solaris java/rmi/activation/Activatable/elucidateNoSuchMethod/ElucidateNoSuchMethod.java generic-all java/rmi/activation/Activatable/forceLogSnapshot/ForceLogSnapshot.java generic-all @@ -718,9 +721,6 @@ java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java generic-all # 11 separate stacktraces created... file reuse problem? java/util/zip/ZipFile/ReadLongZipFileName.java generic-all -# Failing on all -client 32bit platforms starting with b77? See 6908348. -java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java generic-all - # Assert error, failures, on Linux Fedora 9 -server # Windows samevm failure, assert error "Passed = 134, failed = 2" java/util/Arrays/ArrayObjectMethods.java generic-all @@ -734,18 +734,8 @@ java/util/concurrent/FutureTask/BlockingTaskExecutor.java generic-all # Problems on windows, jmap.exe hangs? (these run jmap), fails on Solaris 10 x86 java/util/concurrent/locks/Lock/TimedAcquireLeak.java generic-all -# Solaris sparc client, some failures, "1 not equal to 3"? -# also Linux problems with samevm mode, -server linux i586? 1 not equal to 3? -java/util/concurrent/Executors/AutoShutdown.java generic-all - # Fails on solaris-sparc -server (Set not equal to copy. 1) java/util/EnumSet/EnumSetBash.java solaris-sparc -# Failing to close an input stream? "foo", triggers samevm windows failures -java/util/Formatter/Constructors.java generic-all - -# Need to be marked othervm, or changed to be samevm safe -java/util/WeakHashMap/GCDuringIteration.java generic-all - ############################################################################ diff --git a/jdk/test/com/sun/awt/Translucency/WindowOpacity.java b/jdk/test/com/sun/awt/Translucency/WindowOpacity.java index bf4e74dd48f..a5d80265d60 100644 --- a/jdk/test/com/sun/awt/Translucency/WindowOpacity.java +++ b/jdk/test/com/sun/awt/Translucency/WindowOpacity.java @@ -64,6 +64,7 @@ public class WindowOpacity boolean passed; Frame f = new Frame("Opacity test"); + f.setUndecorated(true); passed = false; try { diff --git a/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java b/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java index cbc45852cc7..1c1c0e0de0a 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 (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/crypto/provider/TLS/TestKeyMaterial.java b/jdk/test/com/sun/crypto/provider/TLS/TestKeyMaterial.java index e15a1f693f9..8874070f484 100644 --- a/jdk/test/com/sun/crypto/provider/TLS/TestKeyMaterial.java +++ b/jdk/test/com/sun/crypto/provider/TLS/TestKeyMaterial.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -117,16 +117,23 @@ public class TestKeyMaterial extends Utils { System.out.print("."); n++; - KeyGenerator kg = KeyGenerator.getInstance("SunTlsKeyMaterial", provider); - SecretKey masterKey = new SecretKeySpec(master, "TlsMasterSecret"); - TlsKeyMaterialParameterSpec spec = new TlsKeyMaterialParameterSpec - (masterKey, major, minor, clientRandom, serverRandom, cipherAlgorithm, - keyLength, expandedKeyLength, ivLength, macLength); + KeyGenerator kg = + KeyGenerator.getInstance("SunTlsKeyMaterial", provider); + SecretKey masterKey = + new SecretKeySpec(master, "TlsMasterSecret"); + TlsKeyMaterialParameterSpec spec = + new TlsKeyMaterialParameterSpec(masterKey, major, minor, + clientRandom, serverRandom, cipherAlgorithm, + keyLength, expandedKeyLength, ivLength, macLength, + null, -1, -1); kg.init(spec); - TlsKeyMaterialSpec result = (TlsKeyMaterialSpec)kg.generateKey(); - match(lineNumber, clientCipherBytes, result.getClientCipherKey()); - match(lineNumber, serverCipherBytes, result.getServerCipherKey()); + TlsKeyMaterialSpec result = + (TlsKeyMaterialSpec)kg.generateKey(); + match(lineNumber, clientCipherBytes, + result.getClientCipherKey()); + match(lineNumber, serverCipherBytes, + result.getServerCipherKey()); match(lineNumber, clientIv, result.getClientIv()); match(lineNumber, serverIv, result.getServerIv()); match(lineNumber, clientMacBytes, result.getClientMacKey()); @@ -144,7 +151,8 @@ public class TestKeyMaterial extends Utils { System.out.println("OK: " + n + " tests"); } - private static void match(int lineNumber, byte[] out, Object res) throws Exception { + private static void match(int lineNumber, byte[] out, Object res) + throws Exception { if ((out == null) || (res == null)) { if (out != res) { throw new Exception("null mismatch line " + lineNumber); diff --git a/jdk/test/com/sun/crypto/provider/TLS/TestMasterSecret.java b/jdk/test/com/sun/crypto/provider/TLS/TestMasterSecret.java index bc8b0ae0e99..3025ef5f2d1 100644 --- a/jdk/test/com/sun/crypto/provider/TLS/TestMasterSecret.java +++ b/jdk/test/com/sun/crypto/provider/TLS/TestMasterSecret.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -97,17 +97,22 @@ public class TestMasterSecret extends Utils { System.out.print("."); n++; - KeyGenerator kg = KeyGenerator.getInstance("SunTlsMasterSecret", provider); - SecretKey premasterKey = new SecretKeySpec(premaster, algorithm); - TlsMasterSecretParameterSpec spec = new TlsMasterSecretParameterSpec - (premasterKey, protoMajor, protoMinor, clientRandom, serverRandom); + KeyGenerator kg = + KeyGenerator.getInstance("SunTlsMasterSecret", provider); + SecretKey premasterKey = + new SecretKeySpec(premaster, algorithm); + TlsMasterSecretParameterSpec spec = + new TlsMasterSecretParameterSpec(premasterKey, protoMajor, + protoMinor, clientRandom, serverRandom, + null, -1, -1); kg.init(spec); TlsMasterSecret key = (TlsMasterSecret)kg.generateKey(); byte[] enc = key.getEncoded(); if (Arrays.equals(master, enc) == false) { throw new Exception("mismatch line: " + lineNumber); } - if ((preMajor != key.getMajorVersion()) || (preMinor != key.getMinorVersion())) { + if ((preMajor != key.getMajorVersion()) || + (preMinor != key.getMinorVersion())) { throw new Exception("version mismatch line: " + lineNumber); } } else { diff --git a/jdk/test/com/sun/crypto/provider/TLS/TestPRF.java b/jdk/test/com/sun/crypto/provider/TLS/TestPRF.java index 0b2bebc0ec0..9c6f9ecf80a 100644 --- a/jdk/test/com/sun/crypto/provider/TLS/TestPRF.java +++ b/jdk/test/com/sun/crypto/provider/TLS/TestPRF.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 +85,17 @@ public class TestPRF extends Utils { System.out.print("."); n++; - KeyGenerator kg = KeyGenerator.getInstance("SunTlsPrf", provider); + KeyGenerator kg = + KeyGenerator.getInstance("SunTlsPrf", provider); SecretKey inKey; if (secret == null) { inKey = null; } else { inKey = new SecretKeySpec(secret, "Generic"); } - TlsPrfParameterSpec spec = new TlsPrfParameterSpec(inKey, label, seed, length); + TlsPrfParameterSpec spec = + new TlsPrfParameterSpec(inKey, label, seed, length, + null, -1, -1); kg.init(spec); SecretKey key = kg.generateKey(); byte[] enc = key.getEncoded(); diff --git a/jdk/test/com/sun/crypto/provider/TLS/TestPRF12.java b/jdk/test/com/sun/crypto/provider/TLS/TestPRF12.java new file mode 100644 index 00000000000..d9384bffa78 --- /dev/null +++ b/jdk/test/com/sun/crypto/provider/TLS/TestPRF12.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6313661 + * @summary Basic known-answer-test for TlsPrf 12 + * + * Vector obtained from the IETF TLS working group mailing list: + * + * http://www.ietf.org/mail-archive/web/tls/current/msg03416.html + */ + +import java.io.*; +import java.util.*; + +import java.security.Security; +import java.security.Provider; + +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKey; + +import javax.crypto.spec.*; + +import sun.security.internal.spec.*; + +public class TestPRF12 extends Utils { + + private static int PREFIX_LENGTH = "prf-output: ".length(); + + public static void main(String[] args) throws Exception { + Provider provider = Security.getProvider("SunJCE"); + + InputStream in = new FileInputStream(new File(BASE, "prf12data.txt")); + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + + int n = 0; + int lineNumber = 0; + + byte[] secret = null; + String label = null; + byte[] seed = null; + int length = 0; + String prfAlg = null; + int prfHashLength = 0; + int prfBlockSize = 0; + byte[] output = null; + + while (true) { + String line = reader.readLine(); + lineNumber++; + if (line == null) { + break; + } + if (line.startsWith("prf-") == false) { + continue; + } + + String data = line.substring(PREFIX_LENGTH); + if (line.startsWith("prf-secret:")) { + secret = parse(data); + } else if (line.startsWith("prf-label:")) { + label = data; + } else if (line.startsWith("prf-seed:")) { + seed = parse(data); + } else if (line.startsWith("prf-length:")) { + length = Integer.parseInt(data); + } else if (line.startsWith("prf-alg:")) { + prfAlg = data; + switch (prfAlg) { + case "SHA-224": + prfHashLength = 28; + prfBlockSize = 64; + break; + case "SHA-256": + prfHashLength = 32; + prfBlockSize = 64; + break; + case "SHA-384": + prfHashLength = 48; + prfBlockSize = 128; + break; + case "SHA-512": + prfHashLength = 64; + prfBlockSize = 128; + break; + default: + throw new Exception("Unknown Alg in the data."); + } + } else if (line.startsWith("prf-output:")) { + output = parse(data); + + System.out.print("."); + n++; + + KeyGenerator kg = + KeyGenerator.getInstance("SunTls12Prf", provider); + SecretKey inKey; + if (secret == null) { + inKey = null; + } else { + inKey = new SecretKeySpec(secret, "Generic"); + } + TlsPrfParameterSpec spec = + new TlsPrfParameterSpec(inKey, label, seed, length, + prfAlg, prfHashLength, prfBlockSize); + kg.init(spec); + SecretKey key = kg.generateKey(); + byte[] enc = key.getEncoded(); + if (Arrays.equals(output, enc) == false) { + throw new Exception("mismatch line: " + lineNumber); + } + } else { + throw new Exception("Unknown line: " + line); + } + } + if (n == 0) { + throw new Exception("no tests"); + } + in.close(); + System.out.println(); + System.out.println("OK: " + n + " tests"); + } + +} diff --git a/jdk/test/com/sun/crypto/provider/TLS/TestPremaster.java b/jdk/test/com/sun/crypto/provider/TLS/TestPremaster.java index ecdac155210..bbbfbb6bdb3 100644 --- a/jdk/test/com/sun/crypto/provider/TLS/TestPremaster.java +++ b/jdk/test/com/sun/crypto/provider/TLS/TestPremaster.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +60,8 @@ public class TestPremaster { System.out.println("Done."); } - private static void test(KeyGenerator kg, int major, int minor) throws Exception { + private static void test(KeyGenerator kg, int major, int minor) + throws Exception { kg.init(new TlsRsaPremasterSecretParameterSpec(major, minor)); SecretKey key = kg.generateKey(); @@ -69,7 +70,8 @@ public class TestPremaster { throw new Exception("length: " + encoded.length); } if ((encoded[0] != major) || (encoded[1] != minor)) { - throw new Exception("version mismatch: " + encoded[0] + "." + encoded[1]); + throw new Exception("version mismatch: " + encoded[0] + + "." + encoded[1]); } System.out.println("OK: " + major + "." + minor); } diff --git a/jdk/test/com/sun/crypto/provider/TLS/Utils.java b/jdk/test/com/sun/crypto/provider/TLS/Utils.java index b588a657c2f..36d1e0f2fbb 100644 --- a/jdk/test/com/sun/crypto/provider/TLS/Utils.java +++ b/jdk/test/com/sun/crypto/provider/TLS/Utils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ */ import java.io.*; -import java.util.*; class Utils { diff --git a/jdk/test/com/sun/crypto/provider/TLS/prf12data.txt b/jdk/test/com/sun/crypto/provider/TLS/prf12data.txt new file mode 100644 index 00000000000..db2652c9bcb --- /dev/null +++ b/jdk/test/com/sun/crypto/provider/TLS/prf12data.txt @@ -0,0 +1,19 @@ +prf-secret: 9b:be:43:6b:a9:40:f0:17:b1:76:52:84:9a:71:db:35 +prf-seed: a0:ba:9f:93:6c:da:31:18:27:a6:f7:96:ff:d5:19:8c +prf-label: test label +prf-length: 100 +prf-alg: SHA-256 +prf-output: e3:f2:29:ba:72:7b:e1:7b:8d:12:26:20:55:7c:d4:53:c2:aa:b2:1d:07:c3:d4:95:32:9b:52:d4:e6:1e:db:5a:6b:30:17:91:e9:0d:35:c9:c9:a4:6b:4e:14:ba:f9:af:0f:a0:22:f7:07:7d:ef:17:ab:fd:37:97:c0:56:4b:ab:4f:bc:91:66:6e:9d:ef:9b:97:fc:e3:4f:79:67:89:ba:a4:80:82:d1:22:ee:42:c5:a7:2e:5a:51:10:ff:f7:01:87:34:7b:66 +prf-secret: b8:0b:73:3d:6c:ee:fc:dc:71:56:6e:a4:8e:55:67:df +prf-seed: cd:66:5c:f6:a8:44:7d:d6:ff:8b:27:55:5e:db:74:65 +prf-label: test label +prf-length: 148 +prf-alg: SHA-384 +prf-output: 7b:0c:18:e9:ce:d4:10:ed:18:04:f2:cf:a3:4a:33:6a:1c:14:df:fb:49:00:bb:5f:d7:94:21:07:e8:1c:83:cd:e9:ca:0f:aa:60:be:9f:e3:4f:82:b1:23:3c:91:46:a0:e5:34:cb:40:0f:ed:27:00:88:4f:9d:c2:36:f8:0e:dd:8b:fa:96:11:44:c9:e8:d7:92:ec:a7:22:a7:b3:2f:c3:d4:16:d4:73:eb:c2:c5:fd:4a:bf:da:d0:5d:91:84:25:9b:5b:f8:cd:4d:90:fa:0d:31:e2:de:c4:79:e4:f1:a2:60:66:f2:ee:a9:a6:92:36:a3:e5:26:55:c9:e9:ae:e6:91:c8:f3:a2:68:54:30:8d:5e:aa:3b:e8:5e:09:90:70:3d:73:e5:6f +prf-secret: b0:32:35:23:c1:85:35:99:58:4d:88:56:8b:bb:05:eb +prf-seed: d4:64:0e:12:e4:bc:db:fb:43:7f:03:e6:ae:41:8e:e5 +prf-label: test label +prf-length: 196 +prf-alg: SHA-512 +prf-output: 12:61:f5:88:c7:98:c5:c2:01:ff:03:6e:7a:9c:b5:ed:cd:7f:e3:f9:4c:66:9a:12:2a:46:38:d7:d5:08:b2:83:04:2d:f6:78:98:75:c7:14:7e:90:6d:86:8b:c7:5c:45:e2:0e:b4:0c:1c:f4:a1:71:3b:27:37:1f:68:43:25:92:f7:dc:8e:a8:ef:22:3e:12:ea:85:07:84:13:11:bf:68:65:3d:0c:fc:40:56:d8:11:f0:25:c4:5d:df:a6:e6:fe:c7:02:f0:54:b4:09:d6:f2:8d:d0:a3:23:3e:49:8d:a4:1a:3e:75:c5:63:0e:ed:be:22:fe:25:4e:33:a1:b0:e9:f6:b9:82:66:75:be:c7:d0:1a:84:56:58:dc:9c:39:75:45:40:1d:40:b9:f4:6c:7a:40:0e:e1:b8:f8:1c:a0:a6:0d:1a:39:7a:10:28:bf:f5:d2:ef:50:66:12:68:42:fb:8d:a4:19:76:32:bd:b5:4f:f6:63:3f:86:bb:c8:36:e6:40:d4:d8:98 + diff --git a/jdk/test/com/sun/java/swing/plaf/gtk/Test6635110.java b/jdk/test/com/sun/java/swing/plaf/gtk/Test6635110.java index d04926c2262..a2aa0f73753 100644 --- a/jdk/test/com/sun/java/swing/plaf/gtk/Test6635110.java +++ b/jdk/test/com/sun/java/swing/plaf/gtk/Test6635110.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/NativeInstanceFilter.java b/jdk/test/com/sun/jdi/NativeInstanceFilter.java new file mode 100644 index 00000000000..90e714e6889 --- /dev/null +++ b/jdk/test/com/sun/jdi/NativeInstanceFilter.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6426034 + * @summary Instance filter doesn't filter event if it occurs in native method + * + * @author Keith McGuigan + * + * @library scaffold + * @run build JDIScaffold VMConnection + * @compile -XDignore.symbol.file NativeInstanceFilterTarg.java + * @run main/othervm NativeInstanceFilter + */ + +/* + * This test tests instance filters for events generated from a native method + */ + +import java.util.*; +import com.sun.jdi.*; +import com.sun.jdi.event.*; +import com.sun.jdi.request.*; + +public class NativeInstanceFilter extends JDIScaffold { + + static int unfilteredEvents = 0; + + public static void main(String args[]) throws Exception { + new NativeInstanceFilter().startTests(); + } + + public NativeInstanceFilter() { + super(); + } + + static EventRequestManager requestManager = null; + static MethodExitRequest request = null; + + private void listen() { + TargetAdapter adapter = new TargetAdapter() { + EventSet set = null; + ObjectReference instance = null; + + public boolean eventSetReceived(EventSet set) { + this.set = set; + return false; + } + + public boolean methodExited(MethodExitEvent event) { + String name = event.method().name(); + if (instance == null && name.equals("latch")) { + // Grab the instance (return value) and set up as filter + System.out.println("Setting up instance filter"); + instance = (ObjectReference)event.returnValue(); + requestManager.deleteEventRequest(request); + request = requestManager.createMethodExitRequest(); + request.addInstanceFilter(instance); + request.enable(); + } else if (instance != null && name.equals("intern")) { + // If not for the filter, this will be called twice + System.out.println("method exit event (String.intern())"); + ++unfilteredEvents; + } + set.resume(); + return false; + } + }; + addListener(adapter); + } + + + protected void runTests() throws Exception { + String[] args = new String[2]; + args[0] = "-connect"; + args[1] = "com.sun.jdi.CommandLineLaunch:main=NativeInstanceFilterTarg"; + + connect(args); + waitForVMStart(); + + // VM has started, but hasn't started running the test program yet. + requestManager = vm().eventRequestManager(); + ReferenceType referenceType = + resumeToPrepareOf("NativeInstanceFilterTarg").referenceType(); + + request = requestManager.createMethodExitRequest(); + request.enable(); + + listen(); + + vm().resume(); + + waitForVMDeath(); + + if (unfilteredEvents != 1) { + throw new Exception( + "Failed: Event from native frame not filtered out."); + } + System.out.println("Passed: Event filtered out."); + } +} diff --git a/jdk/test/com/sun/jdi/NativeInstanceFilterTarg.java b/jdk/test/com/sun/jdi/NativeInstanceFilterTarg.java new file mode 100644 index 00000000000..48a21b43aba --- /dev/null +++ b/jdk/test/com/sun/jdi/NativeInstanceFilterTarg.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import sun.misc.Version; + +public class NativeInstanceFilterTarg { + + public static void main(String args[]) { + boolean runTest = jvmSupportsJVMTI_12x(); + String s1 = "abc"; + String s2 = "def"; + latch(s1); + s1.intern(); + if (runTest) { + s2.intern(); // this is the call that generates events that ought + // to be filtered out. + } else { + System.out.println("Neutering test since JVMTI 1.2 not supported"); + } + } + + // Used by debugger to get an instance to filter with + public static String latch(String s) { return s; } + + public static boolean jvmSupportsJVMTI_12x() { + // This fix requires the JVM to support JVMTI 1.2, which doesn't + // happen until HSX 20.0, build 05. + int major = Version.jvmMajorVersion(); + int minor = Version.jvmMinorVersion(); + int micro = Version.jvmMicroVersion(); + int build = Version.jvmBuildNumber(); + + return (major > 20 || major == 20 && + (minor > 0 || micro > 0 || build >= 5)); + } +} diff --git a/jdk/test/com/sun/jdi/PopAndInvokeTest.java b/jdk/test/com/sun/jdi/PopAndInvokeTest.java index b601f5e40bd..53dbc72afbe 100644 --- a/jdk/test/com/sun/jdi/PopAndInvokeTest.java +++ b/jdk/test/com/sun/jdi/PopAndInvokeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/connect/spi/JdiLoadedByCustomLoader.sh b/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh index 5d9182931c7..ea163780903 100644 --- a/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh +++ b/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/jndi/ldap/InvalidLdapFilters.java b/jdk/test/com/sun/jndi/ldap/InvalidLdapFilters.java index 5cadd3ad5b2..e0e0e906a65 100644 --- a/jdk/test/com/sun/jndi/ldap/InvalidLdapFilters.java +++ b/jdk/test/com/sun/jndi/ldap/InvalidLdapFilters.java @@ -48,6 +48,8 @@ * @run main/othervm InvalidLdapFilters valid (sn;lang-en:dn:2.4.6.8.10:=Barney) * @run main/othervm InvalidLdapFilters valid (&(objectClass=Person)(|(sn=Jensen)(cn=Bab*))) + * @run main/othervm InvalidLdapFilters valid + (orcluserapplnprovstatus;EMAIL_email=PROVISIONING_FAILURE) * @run main/othervm InvalidLdapFilters invalid "(&(cn=Robert Dean)))" * @run main/othervm InvalidLdapFilters invalid (&|(cn=Bob)) * @run main/othervm InvalidLdapFilters invalid (&&(cn=Bob)) diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java new file mode 100644 index 00000000000..6a230c77eed --- /dev/null +++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6173675 + * @summary Basic test of ThreadMXBean.getThreadAllocatedBytes + * @author Paul Hohensee + */ + +import java.lang.management.*; + +public class ThreadAllocatedMemory { + private static com.sun.management.ThreadMXBean mbean = + (com.sun.management.ThreadMXBean)ManagementFactory.getThreadMXBean(); + private static boolean testFailed = false; + private static boolean done = false; + private static boolean done1 = false; + private static Object obj = new Object(); + private static final int NUM_THREADS = 10; + private static Thread[] threads = new Thread[NUM_THREADS]; + private static long[] sizes = new long[NUM_THREADS]; + + public static void main(String[] argv) + throws Exception { + + if (!mbean.isThreadAllocatedMemorySupported()) { + return; + } + + // disable allocated memory measurement + if (mbean.isThreadAllocatedMemoryEnabled()) { + mbean.setThreadAllocatedMemoryEnabled(false); + } + + if (mbean.isThreadAllocatedMemoryEnabled()) { + throw new RuntimeException( + "ThreadAllocatedMemory is expected to be disabled"); + } + + Thread curThread = Thread.currentThread(); + long id = curThread.getId(); + + long s = mbean.getThreadAllocatedBytes(id); + if (s != -1) { + throw new RuntimeException( + "Invalid ThreadAllocatedBytes returned = " + + s + " expected = -1"); + } + + // enable allocated memory measurement + if (!mbean.isThreadAllocatedMemoryEnabled()) { + mbean.setThreadAllocatedMemoryEnabled(true); + } + + if (!mbean.isThreadAllocatedMemoryEnabled()) { + throw new RuntimeException( + "ThreadAllocatedMemory is expected to be enabled"); + } + + long size = mbean.getThreadAllocatedBytes(id); + // implementation could have started measurement when + // measurement was enabled, in which case size can be 0 + if (size < 0) { + throw new RuntimeException( + "Invalid allocated bytes returned = " + size); + } + + doit(); + + // Expected to be size1 >= size + long size1 = mbean.getThreadAllocatedBytes(id); + if (size1 < size) { + throw new RuntimeException("Allocated bytes " + size1 + + " expected >= " + size); + } + System.out.println(curThread.getName() + + " Current thread allocated bytes = " + size + + " allocated bytes = " + size1); + + + // start threads, wait for them to block + for (int i = 0; i < NUM_THREADS; i++) { + threads[i] = new MyThread("MyThread-" + i); + threads[i].start(); + } + + // threads block after doing some allocation + waitUntilThreadBlocked(); + + for (int i = 0; i < NUM_THREADS; i++) { + sizes[i] = mbean.getThreadAllocatedBytes(threads[i].getId()); + } + + // let threads go and do some more allocation + synchronized (obj) { + done = true; + obj.notifyAll(); + } + + // wait for threads to get going again. we don't care if we + // catch them in mid-execution or if some of them haven't + // restarted after we're done sleeping. + goSleep(400); + + for (int i = 0; i < NUM_THREADS; i++) { + long newSize = mbean.getThreadAllocatedBytes(threads[i].getId()); + if (sizes[i] > newSize) { + throw new RuntimeException("TEST FAILED: " + + threads[i].getName() + + " previous allocated bytes = " + sizes[i] + + " > current allocated bytes = " + newSize); + } + System.out.println(threads[i].getName() + + " Previous allocated bytes = " + sizes[i] + + " Current allocated bytes = " + newSize); + } + + // let threads exit + synchronized (obj) { + done1 = true; + obj.notifyAll(); + } + + for (int i = 0; i < NUM_THREADS; i++) { + try { + threads[i].join(); + } catch (InterruptedException e) { + System.out.println("Unexpected exception is thrown."); + e.printStackTrace(System.out); + testFailed = true; + break; + } + } + if (testFailed) { + throw new RuntimeException("TEST FAILED"); + } + + System.out.println("Test passed"); + } + + + private static void goSleep(long ms) throws Exception { + try { + Thread.sleep(ms); + } catch (InterruptedException e) { + System.out.println("Unexpected exception is thrown."); + throw e; + } + } + + private static void waitUntilThreadBlocked() + throws Exception { + int count = 0; + while (count != NUM_THREADS) { + goSleep(100); + count = 0; + for (int i = 0; i < NUM_THREADS; i++) { + ThreadInfo info = mbean.getThreadInfo(threads[i].getId()); + if (info.getThreadState() == Thread.State.WAITING) { + count++; + } + } + } + } + + public static void doit() { + String tmp = ""; + long hashCode = 0; + for (int counter = 0; counter < 1000; counter++) { + tmp += counter; + hashCode = tmp.hashCode(); + } + System.out.println(Thread.currentThread().getName() + + " hashcode: " + hashCode); + } + + static class MyThread extends Thread { + public MyThread(String name) { + super(name); + } + + public void run() { + ThreadAllocatedMemory.doit(); + + synchronized (obj) { + while (!done) { + try { + obj.wait(); + } catch (InterruptedException e) { + System.out.println("Unexpected exception is thrown."); + e.printStackTrace(System.out); + testFailed = true; + break; + } + } + } + + long size1 = mbean.getThreadAllocatedBytes(getId()); + ThreadAllocatedMemory.doit(); + long size2 = mbean.getThreadAllocatedBytes(getId()); + + System.out.println(getName() + ": " + + "ThreadAllocatedBytes = " + size1 + + " ThreadAllocatedBytes = " + size2); + + if (size1 > size2) { + throw new RuntimeException("TEST FAILED: " + getName() + + " ThreadAllocatedBytes = " + size1 + + " > ThreadAllocatedBytes = " + size2); + } + + synchronized (obj) { + while (!done1) { + try { + obj.wait(); + } catch (InterruptedException e) { + System.out.println("Unexpected exception is thrown."); + e.printStackTrace(System.out); + testFailed = true; + break; + } + } + } + } + } +} diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java new file mode 100644 index 00000000000..980189098cb --- /dev/null +++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java @@ -0,0 +1,249 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6173675 + * @summary Basic test of ThreadMXBean.getThreadAllocatedBytes(long[]) + * @author Paul Hohensee + */ + +import java.lang.management.*; + +public class ThreadAllocatedMemoryArray { + private static com.sun.management.ThreadMXBean mbean = + (com.sun.management.ThreadMXBean)ManagementFactory.getThreadMXBean(); + private static boolean testFailed = false; + private static boolean done = false; + private static boolean done1 = false; + private static Object obj = new Object(); + private static final int NUM_THREADS = 10; + private static Thread[] threads = new Thread[NUM_THREADS]; + + public static void main(String[] argv) + throws Exception { + + if (!mbean.isThreadAllocatedMemorySupported()) { + return; + } + + + // start threads, wait for them to block + long[] ids = new long[NUM_THREADS]; + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i] = new MyThread("MyThread-" + i); + threads[i].start(); + ids[i] = threads[i].getId(); + } + + waitUntilThreadBlocked(); + + + // disable allocated memory measurement + if (mbean.isThreadAllocatedMemoryEnabled()) { + mbean.setThreadAllocatedMemoryEnabled(false); + } + + if (mbean.isThreadAllocatedMemoryEnabled()) { + throw new RuntimeException( + "ThreadAllocatedMemory is expected to be disabled"); + } + + long sizes[] = mbean.getThreadAllocatedBytes(ids); + + if (sizes == null) { + throw new RuntimeException("Null ThreadAllocatedBytes array returned"); + } + + for (int i = 0; i < NUM_THREADS; i++) { + long s = sizes[i]; + if (s != -1) { + throw new RuntimeException( + "Invalid ThreadAllocatedBytes returned for thread " + + threads[i].getName() + " = " + s + " expected = -1"); + } + } + + // Enable allocated memory measurement + if (!mbean.isThreadAllocatedMemoryEnabled()) { + mbean.setThreadAllocatedMemoryEnabled(true); + } + + if (!mbean.isThreadAllocatedMemoryEnabled()) { + throw new RuntimeException( + "ThreadAllocatedMemory is expected to be enabled"); + } + + sizes = mbean.getThreadAllocatedBytes(ids); + + for (int i = 0; i < NUM_THREADS; i++) { + long s = sizes[i]; + if (s < 0) { + throw new RuntimeException( + "Invalid allocated bytes returned for thread " + + threads[i].getName() + " = " + s); + } + } + + // let threads go and do some more allocation + synchronized (obj) { + done = true; + obj.notifyAll(); + } + + // wait for threads to get going again. we don't care if we + // catch them in mid-execution or if some of them haven't + // restarted after we're done sleeping. + goSleep(400); + + long[] sizes1 = mbean.getThreadAllocatedBytes(ids); + + for (int i = 0; i < NUM_THREADS; i++) { + long newSize = sizes1[i]; + if (sizes[i] > newSize) { + throw new RuntimeException("TEST FAILED: " + + threads[i].getName() + + " previous allocated bytes = " + sizes[i] + + " > current allocated bytes = " + newSize); + } + System.out.println(threads[i].getName() + + " Previous allocated bytes = " + sizes[i] + + " Current allocated bytes = " + newSize); + } + + try { + sizes = mbean.getThreadAllocatedBytes(null); + } catch (NullPointerException e) { + System.out.println( + "Caught expected NullPointerException: " + e.getMessage()); + } + + try { + ids[0] = 0; + sizes = mbean.getThreadAllocatedBytes(ids); + } catch (IllegalArgumentException e) { + System.out.println( + "Caught expected IllegalArgumentException: " + e.getMessage()); + } + + + // let threads exit + synchronized (obj) { + done1 = true; + obj.notifyAll(); + } + + for (int i = 0; i < NUM_THREADS; i++) { + try { + threads[i].join(); + } catch (InterruptedException e) { + System.out.println("Unexpected exception is thrown."); + e.printStackTrace(System.out); + testFailed = true; + break; + } + } + + if (testFailed) { + throw new RuntimeException("TEST FAILED"); + } + + System.out.println("Test passed"); + } + + + private static void goSleep(long ms) throws Exception { + try { + Thread.sleep(ms); + } catch (InterruptedException e) { + System.out.println("Unexpected exception is thrown."); + throw e; + } + } + + private static void waitUntilThreadBlocked() + throws Exception { + int count = 0; + while (count != NUM_THREADS) { + goSleep(100); + count = 0; + for (int i = 0; i < NUM_THREADS; i++) { + ThreadInfo info = mbean.getThreadInfo(threads[i].getId()); + if (info.getThreadState() == Thread.State.WAITING) { + count++; + } + } + } + } + + public static void doit() { + String tmp = ""; + long hashCode = 0; + for (int counter = 0; counter < 1000; counter++) { + tmp += counter; + hashCode = tmp.hashCode(); + } + System.out.println(Thread.currentThread().getName() + + " hashcode: " + hashCode); + } + + static class MyThread extends Thread { + public MyThread(String name) { + super(name); + } + + public void run() { + ThreadAllocatedMemoryArray.doit(); + + synchronized (obj) { + while (!done) { + try { + obj.wait(); + } catch (InterruptedException e) { + System.out.println("Unexpected exception is thrown."); + e.printStackTrace(System.out); + testFailed = true; + break; + } + } + } + + ThreadAllocatedMemoryArray.doit(); + + synchronized (obj) { + while (!done1) { + try { + obj.wait(); + } catch (InterruptedException e) { + System.out.println("Unexpected exception is thrown."); + e.printStackTrace(System.out); + testFailed = true; + break; + } + } + } + + } + } +} diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java new file mode 100644 index 00000000000..67dea226bd1 --- /dev/null +++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6173675 + * @summary Basic test of ThreadMXBean.getThreadCpuTime(long[]) and + * getThreadUserTime(long[]). + * @author Paul Hohensee + */ + +import java.lang.management.*; + +public class ThreadCpuTimeArray { + private static com.sun.management.ThreadMXBean mbean = + (com.sun.management.ThreadMXBean)ManagementFactory.getThreadMXBean(); + private static boolean testFailed = false; + private static boolean done = false; + private static Object obj = new Object(); + private static final int NUM_THREADS = 10; + private static Thread[] threads = new Thread[NUM_THREADS]; + + // careful about this value + private static final int DELTA = 100; + + public static void main(String[] argv) + throws Exception { + + if (!mbean.isThreadCpuTimeSupported()) { + return; + } + + + // disable CPU time + if (mbean.isThreadCpuTimeEnabled()) { + mbean.setThreadCpuTimeEnabled(false); + } + + if (mbean.isThreadCpuTimeEnabled()) { + throw new RuntimeException("ThreadCpuTime is expected to be disabled"); + } + + // start threads, wait for them to block + long[] ids = new long[NUM_THREADS]; + + for (int i = 0; i < NUM_THREADS; i++) { + threads[i] = new MyThread("MyThread-" + i); + threads[i].start(); + ids[i] = threads[i].getId(); + } + + // threads block after doing some computation + waitUntilThreadBlocked(); + + + long times[] = mbean.getThreadCpuTime(ids); + long userTimes[] = mbean.getThreadUserTime(ids); + + if (times == null) { + throw new RuntimeException("Null ThreadCpuTime array returned"); + } + + for (int i = 0; i < NUM_THREADS; i++) { + long t = times[i]; + if (t != -1) { + throw new RuntimeException( + "Invalid ThreadCpuTime returned for thread " + + threads[i].getName() + " = " + t + " expected = -1"); + } + long ut = userTimes[i]; + if (ut != -1) { + throw new RuntimeException( + "Invalid ThreadUserTime returned for thread " + + threads[i].getName() + " = " + ut + " expected = -1"); + } + } + + + // Enable CPU Time measurement + if (!mbean.isThreadCpuTimeEnabled()) { + mbean.setThreadCpuTimeEnabled(true); + } + + if (!mbean.isThreadCpuTimeEnabled()) { + throw new RuntimeException("ThreadCpuTime is expected to be enabled"); + } + + times = mbean.getThreadCpuTime(ids); + userTimes = mbean.getThreadUserTime(ids); + + goSleep(200); + + for (int i = 0; i < NUM_THREADS; i++) { + long t = times[i]; + if (t < 0) { + throw new RuntimeException( + "Invalid CPU time returned for thread " + + threads[i].getName() + " = " + t); + } + long ut = userTimes[i]; + if (ut < 0) { + throw new RuntimeException( + "Invalid user time returned for thread " + + threads[i].getName() + " = " + ut); + } + } + + long[] times1 = mbean.getThreadCpuTime(ids); + long[] userTimes1 = mbean.getThreadUserTime(ids); + + for (int i = 0; i < NUM_THREADS; i++) { + long newTime = times1[i]; + long newUserTime = userTimes1[i]; + + if (times[i] > newTime) { + throw new RuntimeException("TEST FAILED: " + + threads[i].getName() + + " previous CPU time = " + times[i] + + " > current CPU time = " + newTime); + } + if ((times[i] + DELTA) < newTime) { + throw new RuntimeException("TEST FAILED: " + + threads[i].getName() + + " CPU time = " + newTime + + " previous CPU time " + times[i] + + " out of expected range"); + } + + System.out.println(threads[i].getName() + + " Previous Cpu Time = " + times[i] + + " Current CPU time = " + newTime); + + System.out.println(threads[i].getName() + + " Previous User Time = " + userTimes[i] + + " Current User time = " + newUserTime); + } + + + try { + times = mbean.getThreadCpuTime(null); + } catch (NullPointerException e) { + System.out.println( + "Caught expected NullPointerException: " + e.getMessage()); + } + + try { + ids[0] = 0; + times = mbean.getThreadCpuTime(ids); + } catch (IllegalArgumentException e) { + System.out.println( + "Caught expected IllegalArgumentException: " + e.getMessage()); + } + + + // let threads exit + synchronized (obj) { + done = true; + obj.notifyAll(); + } + + for (int i = 0; i < NUM_THREADS; i++) { + try { + threads[i].join(); + } catch (InterruptedException e) { + System.out.println("Unexpected exception is thrown."); + e.printStackTrace(System.out); + testFailed = true; + break; + } + } + + if (testFailed) { + throw new RuntimeException("TEST FAILED"); + } + + System.out.println("Test passed"); + } + + + private static void goSleep(long ms) throws Exception { + try { + Thread.sleep(ms); + } catch (InterruptedException e) { + System.out.println("Unexpected exception is thrown."); + throw e; + } + } + + private static void waitUntilThreadBlocked() + throws Exception { + int count = 0; + while (count != NUM_THREADS) { + goSleep(100); + count = 0; + for (int i = 0; i < NUM_THREADS; i++) { + ThreadInfo info = mbean.getThreadInfo(threads[i].getId()); + if (info.getThreadState() == Thread.State.WAITING) { + count++; + } + } + } + } + + public static void doit() { + double sum = 0; + for (int i = 0; i < 5000; i++) { + double r = Math.random(); + double x = Math.pow(3, r); + sum += x - r; + } + System.out.println(Thread.currentThread().getName() + + " sum = " + sum); + } + + static class MyThread extends Thread { + public MyThread(String name) { + super(name); + } + + public void run() { + ThreadCpuTimeArray.doit(); + + synchronized (obj) { + while (!done) { + try { + obj.wait(); + } catch (InterruptedException e) { + System.out.println("Unexpected exception is thrown."); + e.printStackTrace(System.out); + testFailed = true; + break; + } + } + } + + ThreadCpuTimeArray.doit(); + } + } +} diff --git a/jdk/test/com/sun/net/httpserver/Test.java b/jdk/test/com/sun/net/httpserver/Test.java index dee86723a2d..6a734a6ad56 100644 --- a/jdk/test/com/sun/net/httpserver/Test.java +++ b/jdk/test/com/sun/net/httpserver/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,20 @@ */ import com.sun.net.httpserver.*; +import java.util.logging.*; public class Test { + + static Logger logger; + + static void enableLogging() { + logger = Logger.getLogger("com.sun.net.httpserver"); + Handler h = new ConsoleHandler(); + h.setLevel(Level.ALL); + logger.setLevel(Level.ALL); + logger.addHandler(h); + } + static void delay () { try { Thread.sleep (1000); diff --git a/jdk/test/com/sun/net/httpserver/Test1.java b/jdk/test/com/sun/net/httpserver/Test1.java index e58900e0f7d..c8d784df935 100644 --- a/jdk/test/com/sun/net/httpserver/Test1.java +++ b/jdk/test/com/sun/net/httpserver/Test1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test * @bug 6270015 * @run main/othervm Test1 + * @run main/othervm -Dsun.net.httpserver.maxReqTime=10 Test1 * @summary Light weight HTTP server */ diff --git a/jdk/test/com/sun/net/httpserver/Test10.java b/jdk/test/com/sun/net/httpserver/Test10.java new file mode 100644 index 00000000000..9a1c9efa775 --- /dev/null +++ b/jdk/test/com/sun/net/httpserver/Test10.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 7005016 + * @summary pit jdk7 b121 sqe test jhttp/HttpServer150013 failing + * @run main/othervm -Dsun.net.httpserver.clockTick=1000 -Dsun.net.httpserver.idleInterval=3 Test10 + */ + +import com.sun.net.httpserver.*; + +import java.io.*; +import java.net.*; +import java.util.concurrent.*; + +/* + * Test handling of empty Http headers + */ + +public class Test10 extends Test { + public static void main (String[] args) throws Exception { + System.out.print ("Test10: "); + Handler handler = new Handler(); + InetSocketAddress addr = new InetSocketAddress (0); + HttpServer server = HttpServer.create (addr, 0); + int port = server.getAddress().getPort(); + HttpContext c2 = server.createContext ("/test", handler); + + ExecutorService exec = Executors.newCachedThreadPool(); + server.setExecutor (exec); + try { + server.start (); + doClient(port); + System.out.println ("OK"); + } finally { + delay(); + if (server != null) + server.stop(2); + if (exec != null) + exec.shutdown(); + } + } + + static class Handler implements HttpHandler { + volatile int invocation = 0; + public void handle (HttpExchange t) + throws IOException + { + InputStream is = t.getRequestBody(); + while (is.read() != -1); + Headers map = t.getRequestHeaders(); + t.sendResponseHeaders (200, -1); + t.close(); + } + } + + public static void doClient (int port) throws Exception { + String s = "GET /test/1.html HTTP/1.1\r\n\r\n"; + + Socket socket = new Socket ("localhost", port); + OutputStream os = socket.getOutputStream(); + os.write (s.getBytes()); + socket.setSoTimeout (10 * 1000); + InputStream is = socket.getInputStream(); + int c; + byte[] b = new byte [1024]; + while ((c=is.read(b)) != -1) ; + is.close(); + socket.close(); + } +} diff --git a/jdk/test/com/sun/net/httpserver/Test11.java b/jdk/test/com/sun/net/httpserver/Test11.java index f683a16e834..67d3a6b65e4 100644 --- a/jdk/test/com/sun/net/httpserver/Test11.java +++ b/jdk/test/com/sun/net/httpserver/Test11.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/net/httpserver/Test12.java b/jdk/test/com/sun/net/httpserver/Test12.java index 6d9049697a7..950103af6bc 100644 --- a/jdk/test/com/sun/net/httpserver/Test12.java +++ b/jdk/test/com/sun/net/httpserver/Test12.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/net/httpserver/Test13.java b/jdk/test/com/sun/net/httpserver/Test13.java index a4299322038..c0181a778f4 100644 --- a/jdk/test/com/sun/net/httpserver/Test13.java +++ b/jdk/test/com/sun/net/httpserver/Test13.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ import com.sun.net.httpserver.*; import java.util.concurrent.*; +import java.util.logging.*; import java.io.*; import java.net.*; @@ -45,12 +46,19 @@ public class Test13 extends Test { static SSLContext ctx; + final static int NUM = 32; // was 32 + static boolean fail = false; public static void main (String[] args) throws Exception { HttpServer s1 = null; HttpsServer s2 = null; ExecutorService executor=null; + Logger l = Logger.getLogger ("com.sun.net.httpserver"); + Handler ha = new ConsoleHandler(); + ha.setLevel(Level.ALL); + l.setLevel(Level.ALL); + l.addHandler(ha); try { String root = System.getProperty ("test.src")+ "/docs"; System.out.print ("Test13: "); @@ -70,10 +78,10 @@ public class Test13 extends Test { int port = s1.getAddress().getPort(); int httpsport = s2.getAddress().getPort(); - Runner r[] = new Runner[64]; - for (int i=0; i<32; i++) { + Runner r[] = new Runner[NUM*2]; + for (int i=0; i options = new HashMap(4); + Map options = new HashMap<>(4); options.put("userProvider", "ldap://localhost:23456/dc=example,dc=com"); options.put("userFilter", "(&(uid={USERNAME})(objectClass=inetOrgPerson))"); @@ -213,7 +213,7 @@ class AuthFirstMode extends LdapConfiguration { public AuthFirstMode() { super(); - Map options = new HashMap(5); + Map options = new HashMap<>(5); options.put("userProvider", "ldap://localhost:23456/dc=example,dc=com"); options.put("authIdentity", "{USERNAME}"); options.put("userFilter", @@ -248,7 +248,7 @@ class AuthOnlyMode extends LdapConfiguration { public AuthOnlyMode() { super(); - Map options = new HashMap(4); + Map options = new HashMap<>(4); options.put("userProvider", "ldap://localhost:23456 ldap://localhost:23457"); options.put("authIdentity", diff --git a/jdk/test/com/sun/security/auth/module/LdapLoginModule/CheckOptions.java b/jdk/test/com/sun/security/auth/module/LdapLoginModule/CheckOptions.java index fb175ca717a..3f7d8e3bac2 100644 --- a/jdk/test/com/sun/security/auth/module/LdapLoginModule/CheckOptions.java +++ b/jdk/test/com/sun/security/auth/module/LdapLoginModule/CheckOptions.java @@ -73,7 +73,7 @@ public class CheckOptions { // bad value for userProvider option - Map options = new HashMap(); + Map options = new HashMap<>(); options.put(USER_PROVIDER_OPTION, "ldap://localhost:23456"); ldap.initialize(subject, null, null, options); @@ -93,7 +93,7 @@ public class CheckOptions { LdapLoginModule ldap = new LdapLoginModule(); Subject subject = new Subject(); - Map options = new HashMap(); + Map options = new HashMap<>(); ldap.initialize(subject, null, null, options); try { @@ -110,7 +110,7 @@ public class CheckOptions { LdapLoginModule ldap = new LdapLoginModule(); Subject subject = new Subject(); - Map options = new HashMap(); + Map options = new HashMap<>(); CallbackHandler goodHandler = new MyCallbackHandler(true); ldap.initialize(subject, goodHandler, null, options); diff --git a/jdk/test/com/sun/servicetag/FindServiceTags.java b/jdk/test/com/sun/servicetag/FindServiceTags.java index 0e826739947..349cc7648bd 100644 --- a/jdk/test/com/sun/servicetag/FindServiceTags.java +++ b/jdk/test/com/sun/servicetag/FindServiceTags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/servicetag/JavaServiceTagTest1.java b/jdk/test/com/sun/servicetag/JavaServiceTagTest1.java index 3bb0328ade8..64e8b318aeb 100644 --- a/jdk/test/com/sun/servicetag/JavaServiceTagTest1.java +++ b/jdk/test/com/sun/servicetag/JavaServiceTagTest1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/servicetag/SystemRegistryTest.java b/jdk/test/com/sun/servicetag/SystemRegistryTest.java index 7e521c1f680..4ec459c2bb3 100644 --- a/jdk/test/com/sun/servicetag/SystemRegistryTest.java +++ b/jdk/test/com/sun/servicetag/SystemRegistryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/servicetag/Util.java b/jdk/test/com/sun/servicetag/Util.java index cf75c2c8fd3..d0d33019bab 100644 --- a/jdk/test/com/sun/servicetag/Util.java +++ b/jdk/test/com/sun/servicetag/Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/tools/attach/ProviderTests.sh b/jdk/test/com/sun/tools/attach/ProviderTests.sh index 80b2852709d..2f9297f7831 100644 --- a/jdk/test/com/sun/tools/attach/ProviderTests.sh +++ b/jdk/test/com/sun/tools/attach/ProviderTests.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/tracing/BasicFunctionality.java b/jdk/test/com/sun/tracing/BasicFunctionality.java index 614e73e2a5a..b8fc98a0728 100644 --- a/jdk/test/com/sun/tracing/BasicFunctionality.java +++ b/jdk/test/com/sun/tracing/BasicFunctionality.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/demo/zipfs/Basic.java b/jdk/test/demo/zipfs/Basic.java index 91f8af274ee..8341b939273 100644 --- a/jdk/test/demo/zipfs/Basic.java +++ b/jdk/test/demo/zipfs/Basic.java @@ -40,24 +40,24 @@ public class Basic { boolean found = false; for (FileSystemProvider provider: FileSystemProvider.installedProviders()) { - if (provider.getScheme().equalsIgnoreCase("zip")) { + if (provider.getScheme().equalsIgnoreCase("jar")) { found = true; break; } } if (!found) - throw new RuntimeException("'zip' provider not installed"); + throw new RuntimeException("'jar' provider not installed"); // Test: FileSystems#newFileSystem(FileRef) Map env = new HashMap(); FileSystems.newFileSystem(zipfile, env, null).close(); // Test: FileSystems#newFileSystem(URI) - URI uri = URI.create("zip" + zipfile.toUri().toString().substring(4)); + URI uri = new URI("jar", zipfile.toUri().toString(), null); FileSystem fs = FileSystems.newFileSystem(uri, env, null); // Test: exercise toUri method - String expected = uri.toString() + "#/foo"; + String expected = uri.toString() + "!/foo"; String actual = fs.getPath("/foo").toUri().toString(); if (!actual.equals(expected)) { throw new RuntimeException("toUri returned '" + actual + diff --git a/jdk/test/demo/zipfs/ZipFSTester.java b/jdk/test/demo/zipfs/ZipFSTester.java index 54b9274db13..8c5a104bac2 100644 --- a/jdk/test/demo/zipfs/ZipFSTester.java +++ b/jdk/test/demo/zipfs/ZipFSTester.java @@ -58,13 +58,12 @@ public class ZipFSTester { // clone a fs and test on it Path tmpfsPath = getTempPath(); Map env = new HashMap(); - env.put("createNew", true); + env.put("create", "true"); FileSystem fs0 = newZipFileSystem(tmpfsPath, env); z2zcopy(fs, fs0, "/", 0); fs0.close(); // sync to file fs = newZipFileSystem(tmpfsPath, new HashMap()); - try { // prepare a src Path src = getTempPath(); @@ -146,16 +145,9 @@ public class ZipFSTester { Path fs2Path = getTempPath(); Path fs3Path = getTempPath(); - if (fs1Path.exists()) - fs1Path.delete(); - if (fs2Path.exists()) - fs2Path.delete(); - if (fs3Path.exists()) - fs3Path.delete(); - // create a new filesystem, copy everything from fs Map env = new HashMap(); - env.put("createNew", true); + env.put("create", "true"); FileSystem fs0 = newZipFileSystem(fs1Path, env); final FileSystem fs2 = newZipFileSystem(fs2Path, env); @@ -280,7 +272,6 @@ public class ZipFSTester { walk(fs4.getPath("/")); System.out.println("closing: fs4"); fs4.close(); - System.out.printf("failed=%d%n", failed); fs1Path.delete(); @@ -291,11 +282,7 @@ public class ZipFSTester { private static FileSystem newZipFileSystem(Path path, Map env) throws IOException { - return FileSystems.newFileSystem( - URI.create("zip" + - path.toUri().toString().substring(4)), - env, - null); + return FileSystems.newFileSystem(path, env, null); } private static Path getTempPath() throws IOException @@ -426,6 +413,8 @@ public class ZipFSTester { } private static void mkdirs(Path path) throws IOException { + if (path.exists()) + return; path = path.toAbsolutePath(); Path parent = path.getParent(); if (parent != null) { diff --git a/jdk/test/java/awt/Color/OpacityChange/OpacityChange.java b/jdk/test/java/awt/Color/OpacityChange/OpacityChange.java new file mode 100644 index 00000000000..d3317eb922d --- /dev/null +++ b/jdk/test/java/awt/Color/OpacityChange/OpacityChange.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 6783910 + @summary java.awt.Color.brighter()/darker() methods make color opaque + @author Andrei Dmitriev: area=awt-color + @run main OpacityChange +*/ + +import java.awt.*; + +public class OpacityChange { + private final static int INITIAL_ALPHA = 125; + + public static void main(String argv[]) { + Color color = new Color(20, 20, 20, INITIAL_ALPHA); + System.out.println("Initial alpha: " + color.getAlpha()); + Color colorBrighter = color.brighter(); + System.out.println("New alpha (after brighter): " + colorBrighter.getAlpha()); + + Color colorDarker = color.darker(); + System.out.println("New alpha (after darker): " + colorDarker.getAlpha()); + + + if (INITIAL_ALPHA != colorBrighter.getAlpha()) { + throw new RuntimeException("Brighter color alpha has changed from : " +INITIAL_ALPHA + " to " + colorBrighter.getAlpha()); + } + if (INITIAL_ALPHA != colorDarker.getAlpha()) { + throw new RuntimeException("Darker color alpha has changed from : " +INITIAL_ALPHA + " to " + colorDarker.getAlpha()); + } + } +} diff --git a/jdk/test/java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java b/jdk/test/java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java new file mode 100644 index 00000000000..3e3e83f1069 --- /dev/null +++ b/jdk/test/java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 6829546 + @summary tests that an always-on-top modal dialog doesn't make any windows always-on-top + @author artem.ananiev: area=awt.modal + @library ../../regtesthelpers + @build Util + @run main MakeWindowAlwaysOnTop +*/ + +import java.awt.*; +import java.awt.event.*; + +import test.java.awt.regtesthelpers.Util; + +public class MakeWindowAlwaysOnTop +{ + private static Frame f; + private static Dialog d; + + public static void main(String[] args) throws Exception + { + Robot r = Util.createRobot(); + Util.waitForIdle(r); + + // Frame + f = new Frame("Test frame"); + f.setBounds(100, 100, 400, 300); + f.setBackground(Color.RED); + f.setVisible(true); + r.delay(100); + Util.waitForIdle(r); + + // Dialog + d = new Dialog(null, "Modal dialog", Dialog.ModalityType.APPLICATION_MODAL); + d.setBounds(500, 500, 160, 160); + d.setAlwaysOnTop(true); + EventQueue.invokeLater(new Runnable() + { + public void run() + { + d.setVisible(true); + } + }); + // Wait until the dialog is shown + EventQueue.invokeAndWait(new Runnable() + { + public void run() + { + // Empty + } + }); + r.delay(100); + Util.waitForIdle(r); + + // Click on the frame to trigger modality + Point p = f.getLocationOnScreen(); + r.mouseMove(p.x + f.getWidth() / 2, p.y + f.getHeight() / 2); + Util.waitForIdle(r); + r.mousePress(InputEvent.BUTTON1_MASK); + Util.waitForIdle(r); + r.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(r); + + r.delay(100); + Util.waitForIdle(r); + + // Dispose dialog + d.dispose(); + r.delay(100); + Util.waitForIdle(r); + + // Show another frame at the same location + Frame t = new Frame("Check"); + t.setBounds(100, 100, 400, 300); + t.setBackground(Color.BLUE); + t.setVisible(true); + r.delay(100); + Util.waitForIdle(r); + + // Bring it above the first frame + t.toFront(); + r.delay(100); + Util.waitForIdle(r); + + Color c = r.getPixelColor(p.x + f.getWidth() / 2, p.y + f.getHeight() / 2); + System.out.println("Color = " + c); + System.out.flush(); + // If the color is RED, then the first frame is now always-on-top + if (Color.RED.equals(c)) + { + throw new RuntimeException("Test FAILED: the frame is always-on-top"); + } + else if (!Color.BLUE.equals(c)) + { + throw new RuntimeException("Test FAILED: unknown window is on top of the frame"); + } + else + { + System.out.println("Test PASSED"); + System.out.flush(); + } + + // Dispose all the windows + t.dispose(); + f.dispose(); + } +} diff --git a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java index 3d6cc12c21f..04eb28db889 100644 --- a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java +++ b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/EventQueue/PushPopDeadlock2/PushPopTest.java b/jdk/test/java/awt/EventQueue/PushPopDeadlock2/PushPopTest.java index 940022ed48b..570ddcd46fe 100644 --- a/jdk/test/java/awt/EventQueue/PushPopDeadlock2/PushPopTest.java +++ b/jdk/test/java/awt/EventQueue/PushPopDeadlock2/PushPopTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/FileDialog/FilenameFilterTest/FilenameFilterTest.java b/jdk/test/java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java index f93c2cd746b..8072ead2fc5 100644 --- a/jdk/test/java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java +++ b/jdk/test/java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/FontClass/FontPrivilege.java b/jdk/test/java/awt/FontClass/FontPrivilege.java index d633f4d3fec..24fd5116c8c 100644 --- a/jdk/test/java/awt/FontClass/FontPrivilege.java +++ b/jdk/test/java/awt/FontClass/FontPrivilege.java @@ -25,7 +25,7 @@ * @test * @bug 5010310 6319835 6904882 6968373 * @summary test fonts can be created in the presence of a security manager - * @run main/othervm/secure=java.lang.SecurityManager FontPrivilege + * @run main FontPrivilege */ import java.awt.Font; @@ -33,6 +33,8 @@ import java.awt.Font; public class FontPrivilege { public static void main(String[] args) throws Exception { + System.setSecurityManager(new SecurityManager()); + new Font("Helvetica", Font.PLAIN, 12).getFamily(); new Font("foo bar", Font.PLAIN, 12).getFamily(); } diff --git a/jdk/test/java/awt/Frame/FrameLocation/FrameLocation.java b/jdk/test/java/awt/Frame/FrameLocation/FrameLocation.java new file mode 100644 index 00000000000..bd12a2f1c5b --- /dev/null +++ b/jdk/test/java/awt/Frame/FrameLocation/FrameLocation.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 6895647 + @summary X11 Frame locations should be what we set them to + @author anthony.petrov@oracle.com: area=awt.toplevel + @run main FrameLocation + */ + +import java.awt.*; + +public class FrameLocation { + private static final int X = 250; + private static final int Y = 250; + + public static void main(String[] args) { + Frame f = new Frame("test"); + f.setBounds(X, Y, 250, 250); // the size doesn't matter + f.setVisible(true); + + for (int i = 0; i < 10; i++) { + // 2 seconds must be enough for the WM to show the window + try { + Thread.sleep(2000); + } catch (InterruptedException ex) { + } + + // Check the location + int x = f.getX(); + int y = f.getY(); + + if (x != X || y != Y) { + throw new RuntimeException("The frame location is wrong! Current: " + x + ", " + y + "; expected: " + X + ", " + Y); + } + + // Emulate what happens when setGraphicsConfiguration() is called + synchronized (f.getTreeLock()) { + f.removeNotify(); + f.addNotify(); + } + } + + f.dispose(); + } +} + diff --git a/jdk/test/java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java b/jdk/test/java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java new file mode 100644 index 00000000000..751b38e338b --- /dev/null +++ b/jdk/test/java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 6988428 + @summary Tests whether shape is always set + @author anthony.petrov@oracle.com: area=awt.toplevel + @run main ShapeNotSetSometimes +*/ + + +import java.awt.*; +import java.awt.event.InputEvent; +import java.awt.geom.*; + + +public class ShapeNotSetSometimes { + + private Frame backgroundFrame; + private Frame window; + private static final Color BACKGROUND_COLOR = Color.BLUE; + private Shape shape; + private int[][] pointsToCheck; + + private static Robot robot; + + public ShapeNotSetSometimes() throws Exception { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + initializeGUI(); + } + }); + } + + private void initializeGUI() { + backgroundFrame = new BackgroundFrame(); + backgroundFrame.setUndecorated(true); + backgroundFrame.setSize(300, 300); + backgroundFrame.setLocation(20, 400); + backgroundFrame.setVisible(true); + + shape = null; + String shape_name = null; + Area a; + GeneralPath gp; + shape_name = "Rounded-corners"; + a = new Area(); + a.add(new Area(new Rectangle2D.Float(50, 0, 100, 150))); + a.add(new Area(new Rectangle2D.Float(0, 50, 200, 50))); + a.add(new Area(new Ellipse2D.Float(0, 0, 100, 100))); + a.add(new Area(new Ellipse2D.Float(0, 50, 100, 100))); + a.add(new Area(new Ellipse2D.Float(100, 0, 100, 100))); + a.add(new Area(new Ellipse2D.Float(100, 50, 100, 100))); + shape = a; + pointsToCheck = new int[][] { + // inside shape + {106, 86}, {96, 38}, {76, 107}, {180, 25}, {24, 105}, + {196, 77}, {165, 50}, {14, 113}, {89, 132}, {167, 117}, + // outside shape + {165, 196}, {191, 163}, {146, 185}, {61, 170}, {148, 171}, + {82, 172}, {186, 11}, {199, 141}, {13, 173}, {187, 3} + }; + + window = new TestFrame(); + window.setUndecorated(true); + window.setSize(200, 200); + window.setLocation(70, 450); + window.setShape(shape); + window.setVisible(true); + + System.out.println("Checking " + window.getClass().getSuperclass().getName() + " with " + shape_name + " shape (" + window.getShape() + ")..."); + } + + class BackgroundFrame extends Frame { + + @Override + public void paint(Graphics g) { + + g.setColor(BACKGROUND_COLOR); + g.fillRect(0, 0, 300, 300); + + super.paint(g); + } + } + + class TestFrame extends Frame { + + @Override + public void paint(Graphics g) { + + g.setColor(Color.WHITE); + g.fillRect(0, 0, 200, 200); + + super.paint(g); + } + } + + public static void main(String[] args) throws Exception { + robot = new Robot(); + + for(int i = 0; i < 100; i++) { + System.out.println("Attempt " + i); + new ShapeNotSetSometimes().doTest(); + } + } + + private void doTest() throws Exception { + Point wls = backgroundFrame.getLocationOnScreen(); + + robot.mouseMove(wls.x + 5, wls.y + 5); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(10); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(500); + + EventQueue.invokeAndWait(new Runnable() { + public void run() { + window.requestFocus(); + } + }); + + robot.waitForIdle(); + try { + Thread.sleep(300); + } catch (InterruptedException e) { + // ignore this one + } + + // check transparency + final int COUNT_TARGET = 10; + + // checking outside points only + for(int i = COUNT_TARGET; i < COUNT_TARGET * 2; i++) { + int x = pointsToCheck[i][0]; + int y = pointsToCheck[i][1]; + boolean inside = i < COUNT_TARGET; + Color c = robot.getPixelColor(window.getX() + x, window.getY() + y); + System.out.println("checking " + x + ", " + y + ", color = " + c); + if (inside && BACKGROUND_COLOR.equals(c) || !inside && !BACKGROUND_COLOR.equals(c)) { + System.out.println("window.getX() = " + window.getX() + ", window.getY() = " + window.getY()); + System.err.println("Checking for transparency failed: point: " + + (window.getX() + x) + ", " + (window.getY() + y) + + ", color = " + c + (inside ? " is of un" : " is not of ") + + "expected background color " + BACKGROUND_COLOR); + throw new RuntimeException("Test failed. The shape has not been applied."); + } + } + + EventQueue.invokeAndWait(new Runnable() { + public void run() { + backgroundFrame.dispose(); + window.dispose(); + } + }); + } +} diff --git a/jdk/test/java/awt/Graphics2D/DrawString/LCDTextSrcEa.java b/jdk/test/java/awt/Graphics2D/DrawString/LCDTextSrcEa.java new file mode 100644 index 00000000000..74c228eab67 --- /dev/null +++ b/jdk/test/java/awt/Graphics2D/DrawString/LCDTextSrcEa.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6996867 + * @summary Render as LCD Text in SrcEa composite mode. + */ + +import java.awt.*; +import java.awt.event.*; +import java.awt.image.*; + +public class LCDTextSrcEa extends Component { + + static int SZ=150; + BufferedImage target = + new BufferedImage(SZ, SZ, BufferedImage.TYPE_INT_RGB); + + public static void main(String args[]) { + Frame f = new Frame("LCD Text SrcEa Test"); + f.addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + System.exit(0); + } + }); + LCDTextSrcEa td = new LCDTextSrcEa(); + f.add("Center", td); + f.pack(); + f.setVisible(true); + } + + public Dimension getPreferredSize() { + return new Dimension(SZ,SZ); + } + + public void paint(Graphics gx) { + + Graphics2D g2d = (Graphics2D) target.getGraphics(); + g2d.setColor(Color.white); + g2d.fillRect(0, 0, getWidth(), getHeight()); + + g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, 0.01f)); + g2d.setRenderingHint( + RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_VBGR); + g2d.setRenderingHint( + RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + + g2d.setColor(Color.black); + g2d.drawString("Some sample text.", 10, 20); + gx.drawImage(target, 0, 0, null); + boolean nongrey = false; + //Test BI: should be some non-greyscale color + for (int px=0;px> 16; + int g = (rgb & 0x00ff00) >> 8; + int b = (rgb & 0x0000ff); + if (r != g || r !=b || g != b) { + nongrey=true; + break; + } + } + } + if (!nongrey) { + throw new RuntimeException("No LCD text found"); + } + } +} diff --git a/jdk/test/java/awt/Graphics2D/RenderClipTest/6766342.tests b/jdk/test/java/awt/Graphics2D/RenderClipTest/6766342.tests new file mode 100644 index 00000000000..17cf06850d6 --- /dev/null +++ b/jdk/test/java/awt/Graphics2D/RenderClipTest/6766342.tests @@ -0,0 +1,3 @@ +Filled AA Pure Rect(5, 29.4, 10, 10) +Stroked AA Pure Rect(5, 4.4, 10, 10) +Stroked AA Line(20, 20, -10, 20) diff --git a/jdk/test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java b/jdk/test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java new file mode 100644 index 00000000000..e920c448671 --- /dev/null +++ b/jdk/test/java/awt/Graphics2D/RenderClipTest/RenderClipTest.java @@ -0,0 +1,1634 @@ +/* + * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6766342 + * @summary Tests clipping invariance for AA rectangle and line primitives + * @run main RenderClipTest -strict -readfile 6766342.tests + * @run main RenderClipTest -rectsuite -count 10 + */ + +import java.awt.*; +import java.awt.geom.*; +import java.awt.image.*; +import java.awt.event.*; +import java.util.Vector; +import java.io.*; + +public class RenderClipTest { + public static double randDblCoord() { + return Math.random()*60 - 10; + } + + public static float randFltCoord() { + return (float) randDblCoord(); + } + + public static int randIntCoord() { + return (int) Math.round(randDblCoord()); + } + + public static int randInt(int n) { + return ((int) (Math.random() * (n*4))) >> 2; + } + + static int numtests; + static int numerrors; + static int numfillfailures; + static int numstrokefailures; + static int maxerr; + + static boolean useAA; + static boolean strokePure; + static boolean testFill; + static boolean testDraw; + static boolean silent; + static boolean verbose; + static boolean strict; + static boolean showErrors; + static float lw; + static double rot; + + static BufferedImage imgref; + static BufferedImage imgtst; + + static Graphics2D grefclear; + static Graphics2D gtstclear; + static Graphics2D grefrender; + static Graphics2D gtstrender; + + public static abstract class AnnotatedRenderOp { + public static AnnotatedRenderOp parse(String str) { + AnnotatedRenderOp ar; + if (((ar = Cubic.tryparse(str)) != null) || + ((ar = Quad.tryparse(str)) != null) || + ((ar = Poly.tryparse(str)) != null) || + ((ar = Path.tryparse(str)) != null) || + ((ar = Rect.tryparse(str)) != null) || + ((ar = Line.tryparse(str)) != null) || + ((ar = RectMethod.tryparse(str)) != null) || + ((ar = LineMethod.tryparse(str)) != null)) + { + return ar; + } + System.err.println("Unable to parse shape: "+str); + return null; + } + + public abstract void randomize(); + + public abstract void fill(Graphics2D g2d); + + public abstract void draw(Graphics2D g2d); + } + + public static abstract class AnnotatedShapeOp extends AnnotatedRenderOp { + public abstract Shape getShape(); + + public void fill(Graphics2D g2d) { + g2d.fill(getShape()); + } + + public void draw(Graphics2D g2d) { + g2d.draw(getShape()); + } + } + + public static void usage(String err) { + if (err != null) { + System.err.println(err); + } + System.err.println("usage: java RenderClipTest "+ + "[-read[file F]] [-rectsuite] [-fill] [-draw]"); + System.err.println(" "+ + "[-aa] [-pure] [-lw N] [-rot N]"); + System.err.println(" "+ + "[-rectmethod] [-linemethod] [-rect] [-line]"); + System.err.println(" "+ + "[-cubic] [-quad] [-poly] [-path]"); + System.err.println(" "+ + "[-silent] [-verbose] [-showerr] [-count N]"); + System.err.println(" "+ + "[-strict] [-usage]"); + System.err.println(" -read Read test data from stdin"); + System.err.println(" -readfile F Read test data from file F"); + System.err.println(" -rectsuite Run a suite of rect/line tests"); + System.err.println(" -fill Test g.fill*(...)"); + System.err.println(" -draw Test g.draw*(...)"); + System.err.println(" -aa Use antialiased rendering"); + System.err.println(" -pure Use STROKE_PURE hint"); + System.err.println(" -lw N Test line widths of N "+ + "(default 1.0)"); + System.err.println(" -rot N Test rotation by N degrees "+ + "(default 0.0)"); + System.err.println(" -rectmethod Test fillRect/drawRect methods"); + System.err.println(" -linemethod Test drawLine method"); + System.err.println(" -rect Test Rectangle2D shapes"); + System.err.println(" -line Test Line2D shapes"); + System.err.println(" -cubic Test CubicCurve2D shapes"); + System.err.println(" -quad Test QuadCurve2D shapes"); + System.err.println(" -poly Test Polygon shapes"); + System.err.println(" -path Test GeneralPath shapes"); + System.err.println(" -silent Do not print out error curves"); + System.err.println(" -verbose Print out progress info"); + System.err.println(" -showerr Display errors on screen"); + System.err.println(" -count N N tests per shape, then exit "+ + "(default 1000)"); + System.err.println(" -strict All failures are important"); + System.err.println(" -usage Print this help, then exit"); + System.exit((err != null) ? -1 : 0); + } + + public static void main(String argv[]) { + boolean readTests = false; + String readFile = null; + boolean rectsuite = false; + int count = 1000; + lw = 1.0f; + rot = 0.0; + Vector testOps = new Vector(); + for (int i = 0; i < argv.length; i++) { + String arg = argv[i].toLowerCase(); + if (arg.equals("-aa")) { + useAA = true; + } else if (arg.equals("-pure")) { + strokePure = true; + } else if (arg.equals("-fill")) { + testFill = true; + } else if (arg.equals("-draw")) { + testDraw = true; + } else if (arg.equals("-lw")) { + if (i+1 >= argv.length) { + usage("Missing argument: "+argv[i]); + } + lw = Float.parseFloat(argv[++i]); + } else if (arg.equals("-rot")) { + if (i+1 >= argv.length) { + usage("Missing argument: "+argv[i]); + } + rot = Double.parseDouble(argv[++i]); + } else if (arg.equals("-cubic")) { + testOps.add(new Cubic()); + } else if (arg.equals("-quad")) { + testOps.add(new Quad()); + } else if (arg.equals("-poly")) { + testOps.add(new Poly()); + } else if (arg.equals("-path")) { + testOps.add(new Path()); + } else if (arg.equals("-rect")) { + testOps.add(new Rect()); + } else if (arg.equals("-line")) { + testOps.add(new Line()); + } else if (arg.equals("-rectmethod")) { + testOps.add(new RectMethod()); + } else if (arg.equals("-linemethod")) { + testOps.add(new LineMethod()); + } else if (arg.equals("-verbose")) { + verbose = true; + } else if (arg.equals("-strict")) { + strict = true; + } else if (arg.equals("-silent")) { + silent = true; + } else if (arg.equals("-showerr")) { + showErrors = true; + } else if (arg.equals("-readfile")) { + if (i+1 >= argv.length) { + usage("Missing argument: "+argv[i]); + } + readTests = true; + readFile = argv[++i]; + } else if (arg.equals("-read")) { + readTests = true; + readFile = null; + } else if (arg.equals("-rectsuite")) { + rectsuite = true; + } else if (arg.equals("-count")) { + if (i+1 >= argv.length) { + usage("Missing argument: "+argv[i]); + } + count = Integer.parseInt(argv[++i]); + } else if (arg.equals("-usage")) { + usage(null); + } else { + usage("Unknown argument: "+argv[i]); + } + } + if (readTests) { + if (rectsuite || testDraw || testFill || + useAA || strokePure || + lw != 1.0f || rot != 0.0 || + testOps.size() > 0) + { + usage("Should not specify test types with -read options"); + } + } else if (rectsuite) { + if (testDraw || testFill || + useAA || strokePure || + lw != 1.0f || rot != 0.0 || + testOps.size() > 0) + { + usage("Should not specify test types with -rectsuite option"); + } + } else { + if (!testDraw && !testFill) { + usage("No work: Must specify one or both of "+ + "-fill or -draw"); + } + if (testOps.size() == 0) { + usage("No work: Must specify one or more of "+ + "-rect[method], -line[method], "+ + "-cubic, -quad, -poly, or -path"); + } + } + initImages(); + if (readTests) { + try { + InputStream is; + if (readFile == null) { + is = System.in; + } else { + File f = + new File(System.getProperty("test.src", "."), + readFile); + is = new FileInputStream(f); + } + parseAndRun(is); + } catch (IOException e) { + throw new RuntimeException(e); + } + } else if (rectsuite) { + runRectSuite(count); + } else { + initGCs(); + for (int k = 0; k < testOps.size(); k++) { + AnnotatedRenderOp ar = testOps.get(k); + runRandomTests(ar, count); + } + disposeGCs(); + } + grefclear.dispose(); + gtstclear.dispose(); + grefclear = gtstclear = null; + reportStatistics(); + } + + public static int reportStatistics() { + String connector = ""; + if (numfillfailures > 0) { + System.out.print(numfillfailures+" fills "); + connector = "and "; + } + if (numstrokefailures > 0) { + System.out.print(connector+numstrokefailures+" strokes "); + } + int totalfailures = numfillfailures + numstrokefailures; + if (totalfailures == 0) { + System.out.print("0 "); + } + System.out.println("out of "+numtests+" tests failed..."); + int critical = numerrors; + if (strict) { + critical += totalfailures; + } + if (critical > 0) { + throw new RuntimeException(critical+" tests had critical errors"); + } + System.out.println("No tests had critical errors"); + return (numerrors+totalfailures); + } + + public static void runRectSuite(int count) { + AnnotatedRenderOp ops[] = { + new Rect(), + new RectMethod(), + new Line(), + new LineMethod(), + }; + // Sometimes different fill algorithms are chosen for + // thin and wide line modes, make sure we test both... + float filllinewidths[] = { 0.0f, 2.0f }; + float drawlinewidths[] = { 0.0f, 0.5f, 1.0f, + 2.0f, 2.5f, + 5.0f, 5.3f }; + double rotations[] = { 0.0, 15.0, 90.0, + 135.0, 180.0, + 200.0, 270.0, + 300.0}; + for (AnnotatedRenderOp ar: ops) { + for (double r: rotations) { + rot = r; + for (int i = 0; i < 8; i++) { + float linewidths[]; + if ((i & 1) == 0) { + if ((ar instanceof Line) || + (ar instanceof LineMethod)) + { + continue; + } + testFill = true; + testDraw = false; + linewidths = filllinewidths; + } else { + testFill = false; + testDraw = true; + linewidths = drawlinewidths; + } + useAA = ((i & 2) != 0); + strokePure = ((i & 4) != 0); + for (float w : linewidths) { + lw = w; + runSuiteTests(ar, count); + } + } + } + } + } + + public static void runSuiteTests(AnnotatedRenderOp ar, int count) { + if (verbose) { + System.out.print("Running "); + System.out.print(testFill ? "Fill " : "Draw "); + System.out.print(BaseName(ar)); + if (useAA) { + System.out.print(" AA"); + } + if (strokePure) { + System.out.print(" Pure"); + } + if (lw != 1.0f) { + System.out.print(" lw="+lw); + } + if (rot != 0.0f) { + System.out.print(" rot="+rot); + } + System.out.println(); + } + initGCs(); + runRandomTests(ar, count); + disposeGCs(); + } + + public static String BaseName(AnnotatedRenderOp ar) { + String s = ar.toString(); + int leftparen = s.indexOf('('); + if (leftparen >= 0) { + s = s.substring(0, leftparen); + } + return s; + } + + public static void runRandomTests(AnnotatedRenderOp ar, int count) { + for (int i = 0; i < count; i++) { + ar.randomize(); + if (testDraw) { + test(ar, false); + } + if (testFill) { + test(ar, true); + } + } + } + + public static void initImages() { + imgref = new BufferedImage(40, 40, BufferedImage.TYPE_INT_RGB); + imgtst = new BufferedImage(40, 40, BufferedImage.TYPE_INT_RGB); + grefclear = imgref.createGraphics(); + gtstclear = imgtst.createGraphics(); + grefclear.setColor(Color.white); + gtstclear.setColor(Color.white); + } + + public static void initGCs() { + grefrender = imgref.createGraphics(); + gtstrender = imgtst.createGraphics(); + gtstrender.clipRect(10, 10, 20, 20); + grefrender.setColor(Color.blue); + gtstrender.setColor(Color.blue); + if (lw != 1.0f) { + BasicStroke bs = new BasicStroke(lw); + grefrender.setStroke(bs); + gtstrender.setStroke(bs); + } + if (rot != 0.0) { + double rotrad = Math.toRadians(rot); + grefrender.rotate(rotrad, 20, 20); + gtstrender.rotate(rotrad, 20, 20); + } + if (strokePure) { + grefrender.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_PURE); + gtstrender.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_PURE); + } + if (useAA) { + grefrender.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + gtstrender.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + maxerr = 1; + } + } + + public static void disposeGCs() { + grefrender.dispose(); + gtstrender.dispose(); + grefrender = gtstrender = null; + } + + public static void parseAndRun(InputStream in) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(in)); + String str; + while ((str = br.readLine()) != null) { + if (str.startsWith("Stroked ") || str.startsWith("Filled ")) { + parseTest(str); + continue; + } + if (str.startsWith("Running ")) { + continue; + } + if (str.startsWith("Failed: ")) { + continue; + } + if (str.indexOf(" out of ") > 0 && + str.indexOf(" tests failed...") > 0) + { + continue; + } + if (str.indexOf(" tests had critical errors") > 0) { + continue; + } + System.err.println("Unparseable line: "+str); + } + } + + public static void parseTest(String origstr) { + String str = origstr; + boolean isfill = false; + useAA = strokePure = false; + lw = 1.0f; + rot = 0.0; + if (str.startsWith("Stroked ")) { + str = str.substring(8); + isfill = false; + } else if (str.startsWith("Filled ")) { + str = str.substring(7); + isfill = true; + } else { + System.err.println("Unparseable test line: "+origstr); + } + if (str.startsWith("AA ")) { + str = str.substring(3); + useAA = true; + } + if (str.startsWith("Pure ")) { + str = str.substring(5); + strokePure = true; + } + if (str.startsWith("Lw=")) { + int index = str.indexOf(' ', 3); + if (index > 0) { + lw = Float.parseFloat(str.substring(3, index)); + str = str.substring(index+1); + } + } + if (str.startsWith("Rot=")) { + int index = str.indexOf(' ', 4); + if (index > 0) { + rot = Double.parseDouble(str.substring(4, index)); + str = str.substring(index+1); + } + } + AnnotatedRenderOp ar = AnnotatedRenderOp.parse(str); + if (ar != null) { + initGCs(); + test(ar, isfill); + disposeGCs(); + } else { + System.err.println("Unparseable test line: "+origstr); + } + } + + public static void test(AnnotatedRenderOp ar, boolean isfill) { + grefclear.fillRect(0, 0, 40, 40); + gtstclear.fillRect(0, 0, 40, 40); + if (isfill) { + ar.fill(grefrender); + ar.fill(gtstrender); + } else { + ar.draw(grefrender); + ar.draw(gtstrender); + } + check(imgref, imgtst, ar, isfill); + } + + public static int[] getData(BufferedImage img) { + Raster r = img.getRaster(); + DataBufferInt dbi = (DataBufferInt) r.getDataBuffer(); + return dbi.getData(); + } + + public static int getScan(BufferedImage img) { + Raster r = img.getRaster(); + SinglePixelPackedSampleModel sppsm = + (SinglePixelPackedSampleModel) r.getSampleModel(); + return sppsm.getScanlineStride(); + } + + public static int getOffset(BufferedImage img) { + Raster r = img.getRaster(); + SinglePixelPackedSampleModel sppsm = + (SinglePixelPackedSampleModel) r.getSampleModel(); + return sppsm.getOffset(-r.getSampleModelTranslateX(), + -r.getSampleModelTranslateY()); + } + + final static int opaque = 0xff000000; + final static int whitergb = Color.white.getRGB(); + + public static final int maxdiff(int rgb1, int rgb2) { + int maxd = 0; + for (int i = 0; i < 32; i += 8) { + int c1 = (rgb1 >> i) & 0xff; + int c2 = (rgb2 >> i) & 0xff; + int d = Math.abs(c1-c2); + if (maxd < d) { + maxd = d; + } + } + return maxd; + } + + public static void check(BufferedImage imgref, BufferedImage imgtst, + AnnotatedRenderOp ar, boolean wasfill) + { + numtests++; + int dataref[] = getData(imgref); + int datatst[] = getData(imgtst); + int scanref = getScan(imgref); + int scantst = getScan(imgtst); + int offref = getOffset(imgref); + int offtst = getOffset(imgtst); + + // We want to check for errors outside the clip at a higher + // priority than errors involving different pixels touched + // inside the clip. + + // Check above clip + if (check(ar, wasfill, + null, 0, 0, + datatst, scantst, offtst, + 0, 0, 40, 10)) + { + return; + } + // Check below clip + if (check(ar, wasfill, + null, 0, 0, + datatst, scantst, offtst, + 0, 30, 40, 40)) + { + return; + } + // Check left of clip + if (check(ar, wasfill, + null, 0, 0, + datatst, scantst, offtst, + 0, 10, 10, 30)) + { + return; + } + // Check right of clip + if (check(ar, wasfill, + null, 0, 0, + datatst, scantst, offtst, + 30, 10, 40, 30)) + { + return; + } + // Check inside clip + check(ar, wasfill, + dataref, scanref, offref, + datatst, scantst, offtst, + 10, 10, 30, 30); + } + + public static boolean check(AnnotatedRenderOp ar, boolean wasfill, + int dataref[], int scanref, int offref, + int datatst[], int scantst, int offtst, + int x0, int y0, int x1, int y1) + { + offref += scanref * y0; + offtst += scantst * y0; + for (int y = y0; y < y1; y++) { + for (int x = x0; x < x1; x++) { + boolean failed; + String reason; + int rgbref; + int rgbtst; + + rgbtst = datatst[offtst+x] | opaque; + if (dataref == null) { + /* Outside of clip, must be white, no error tolerance */ + rgbref = whitergb; + failed = (rgbtst != rgbref); + reason = "stray pixel rendered outside of clip"; + } else { + /* Inside of clip, check for maxerr delta in components */ + rgbref = dataref[offref+x] | opaque; + failed = (rgbref != rgbtst && + maxdiff(rgbref, rgbtst) > maxerr); + reason = "different pixel rendered inside clip"; + } + if (failed) { + if (dataref == null) { + numerrors++; + } + if (wasfill) { + numfillfailures++; + } else { + numstrokefailures++; + } + if (!silent) { + System.out.println("Failed: "+reason+" at "+x+", "+y+ + " ["+Integer.toHexString(rgbref)+ + " != "+Integer.toHexString(rgbtst)+ + "]"); + System.out.print(wasfill ? "Filled " : "Stroked "); + if (useAA) System.out.print("AA "); + if (strokePure) System.out.print("Pure "); + if (lw != 1) System.out.print("Lw="+lw+" "); + if (rot != 0) System.out.print("Rot="+rot+" "); + System.out.println(ar); + } + if (showErrors) { + show(imgref, imgtst); + } + return true; + } + } + offref += scanref; + offtst += scantst; + } + return false; + } + + static ErrorWindow errw; + + public static void show(BufferedImage imgref, BufferedImage imgtst) { + ErrorWindow errw = new ErrorWindow(); + errw.setImages(imgref, imgtst); + errw.setVisible(true); + errw.waitForHide(); + errw.dispose(); + } + + public static class Cubic extends AnnotatedShapeOp { + public static Cubic tryparse(String str) { + str = str.trim(); + if (!str.startsWith("Cubic(")) { + return null; + } + str = str.substring(6); + double coords[] = new double[8]; + boolean foundparen = false; + for (int i = 0; i < coords.length; i++) { + int index = str.indexOf(","); + if (index < 0) { + if (i < coords.length-1) { + return null; + } + index = str.indexOf(")"); + if (index < 0) { + return null; + } + foundparen = true; + } + String num = str.substring(0, index); + try { + coords[i] = Double.parseDouble(num); + } catch (NumberFormatException nfe) { + return null; + } + str = str.substring(index+1); + } + if (!foundparen || str.length() > 0) { + return null; + } + Cubic c = new Cubic(); + c.cubic.setCurve(coords[0], coords[1], + coords[2], coords[3], + coords[4], coords[5], + coords[6], coords[7]); + return c; + } + + private CubicCurve2D cubic = new CubicCurve2D.Double(); + + public void randomize() { + cubic.setCurve(randDblCoord(), randDblCoord(), + randDblCoord(), randDblCoord(), + randDblCoord(), randDblCoord(), + randDblCoord(), randDblCoord()); + } + + public Shape getShape() { + return cubic; + } + + public String toString() { + return ("Cubic("+ + cubic.getX1()+", "+ + cubic.getY1()+", "+ + cubic.getCtrlX1()+", "+ + cubic.getCtrlY1()+", "+ + cubic.getCtrlX2()+", "+ + cubic.getCtrlY2()+", "+ + cubic.getX2()+", "+ + cubic.getY2() + +")"); + } + } + + public static class Quad extends AnnotatedShapeOp { + public static Quad tryparse(String str) { + str = str.trim(); + if (!str.startsWith("Quad(")) { + return null; + } + str = str.substring(5); + double coords[] = new double[6]; + boolean foundparen = false; + for (int i = 0; i < coords.length; i++) { + int index = str.indexOf(","); + if (index < 0) { + if (i < coords.length-1) { + return null; + } + index = str.indexOf(")"); + if (index < 0) { + return null; + } + foundparen = true; + } + String num = str.substring(0, index); + try { + coords[i] = Double.parseDouble(num); + } catch (NumberFormatException nfe) { + return null; + } + str = str.substring(index+1); + } + if (!foundparen || str.length() > 0) { + return null; + } + Quad c = new Quad(); + c.quad.setCurve(coords[0], coords[1], + coords[2], coords[3], + coords[4], coords[5]); + return c; + } + + private QuadCurve2D quad = new QuadCurve2D.Double(); + + public void randomize() { + quad.setCurve(randDblCoord(), randDblCoord(), + randDblCoord(), randDblCoord(), + randDblCoord(), randDblCoord()); + } + + public Shape getShape() { + return quad; + } + + public String toString() { + return ("Quad("+ + quad.getX1()+", "+ + quad.getY1()+", "+ + quad.getCtrlX()+", "+ + quad.getCtrlY()+", "+ + quad.getX2()+", "+ + quad.getY2() + +")"); + } + } + + public static class Poly extends AnnotatedShapeOp { + public static Poly tryparse(String str) { + str = str.trim(); + if (!str.startsWith("Poly(")) { + return null; + } + str = str.substring(5); + Polygon p = new Polygon(); + while (true) { + int x, y; + str = str.trim(); + if (str.startsWith(")")) { + str = str.substring(1); + break; + } + if (p.npoints > 0) { + if (str.startsWith(",")) { + str = str.substring(2).trim(); + } else { + return null; + } + } + if (str.startsWith("[")) { + str = str.substring(1); + } else { + return null; + } + int index = str.indexOf(","); + if (index < 0) { + return null; + } + String num = str.substring(0, index); + try { + x = Integer.parseInt(num); + } catch (NumberFormatException nfe) { + return null; + } + str = str.substring(index+1); + index = str.indexOf("]"); + if (index < 0) { + return null; + } + num = str.substring(0, index).trim(); + try { + y = Integer.parseInt(num); + } catch (NumberFormatException nfe) { + return null; + } + str = str.substring(index+1); + p.addPoint(x, y); + } + if (str.length() > 0) { + return null; + } + if (p.npoints < 3) { + return null; + } + return new Poly(p); + } + + private Polygon poly; + + public Poly() { + this.poly = new Polygon(); + } + + private Poly(Polygon p) { + this.poly = p; + } + + public void randomize() { + poly.reset(); + poly.addPoint(randIntCoord(), randIntCoord()); + poly.addPoint(randIntCoord(), randIntCoord()); + poly.addPoint(randIntCoord(), randIntCoord()); + poly.addPoint(randIntCoord(), randIntCoord()); + poly.addPoint(randIntCoord(), randIntCoord()); + } + + public Shape getShape() { + return poly; + } + + public String toString() { + StringBuffer sb = new StringBuffer(100); + sb.append("Poly("); + for (int i = 0; i < poly.npoints; i++) { + if (i != 0) { + sb.append(", "); + } + sb.append("["); + sb.append(poly.xpoints[i]); + sb.append(", "); + sb.append(poly.ypoints[i]); + sb.append("]"); + } + sb.append(")"); + return sb.toString(); + } + } + + public static class Path extends AnnotatedShapeOp { + public static Path tryparse(String str) { + str = str.trim(); + if (!str.startsWith("Path(")) { + return null; + } + str = str.substring(5); + GeneralPath gp = new GeneralPath(); + float coords[] = new float[6]; + int numsegs = 0; + while (true) { + int type; + int n; + str = str.trim(); + if (str.startsWith(")")) { + str = str.substring(1); + break; + } + if (str.startsWith("M[")) { + type = PathIterator.SEG_MOVETO; + n = 2; + } else if (str.startsWith("L[")) { + type = PathIterator.SEG_LINETO; + n = 2; + } else if (str.startsWith("Q[")) { + type = PathIterator.SEG_QUADTO; + n = 4; + } else if (str.startsWith("C[")) { + type = PathIterator.SEG_CUBICTO; + n = 6; + } else if (str.startsWith("E[")) { + type = PathIterator.SEG_CLOSE; + n = 0; + } else { + return null; + } + str = str.substring(2); + if (n == 0) { + if (str.startsWith("]")) { + str = str.substring(1); + } else { + return null; + } + } + for (int i = 0; i < n; i++) { + int index; + if (i < n-1) { + index = str.indexOf(","); + } else { + index = str.indexOf("]"); + } + if (index < 0) { + return null; + } + String num = str.substring(0, index); + try { + coords[i] = Float.parseFloat(num); + } catch (NumberFormatException nfe) { + return null; + } + str = str.substring(index+1).trim(); + } + switch (type) { + case PathIterator.SEG_MOVETO: + gp.moveTo(coords[0], coords[1]); + break; + case PathIterator.SEG_LINETO: + gp.lineTo(coords[0], coords[1]); + break; + case PathIterator.SEG_QUADTO: + gp.quadTo(coords[0], coords[1], + coords[2], coords[3]); + break; + case PathIterator.SEG_CUBICTO: + gp.curveTo(coords[0], coords[1], + coords[2], coords[3], + coords[4], coords[5]); + break; + case PathIterator.SEG_CLOSE: + gp.closePath(); + break; + } + numsegs++; + } + if (str.length() > 0) { + return null; + } + if (numsegs < 2) { + return null; + } + return new Path(gp); + } + + private GeneralPath path; + + public Path() { + this.path = new GeneralPath(); + } + + private Path(GeneralPath gp) { + this.path = gp; + } + + public void randomize() { + path.reset(); + path.moveTo(randFltCoord(), randFltCoord()); + for (int i = randInt(5)+3; i > 0; --i) { + switch(randInt(5)) { + case 0: + path.moveTo(randFltCoord(), randFltCoord()); + break; + case 1: + path.lineTo(randFltCoord(), randFltCoord()); + break; + case 2: + path.quadTo(randFltCoord(), randFltCoord(), + randFltCoord(), randFltCoord()); + break; + case 3: + path.curveTo(randFltCoord(), randFltCoord(), + randFltCoord(), randFltCoord(), + randFltCoord(), randFltCoord()); + break; + case 4: + path.closePath(); + break; + } + } + } + + public Shape getShape() { + return path; + } + + public String toString() { + StringBuffer sb = new StringBuffer(100); + sb.append("Path("); + PathIterator pi = path.getPathIterator(null); + float coords[] = new float[6]; + boolean first = true; + while (!pi.isDone()) { + int n; + char c; + switch(pi.currentSegment(coords)) { + case PathIterator.SEG_MOVETO: + c = 'M'; + n = 2; + break; + case PathIterator.SEG_LINETO: + c = 'L'; + n = 2; + break; + case PathIterator.SEG_QUADTO: + c = 'Q'; + n = 4; + break; + case PathIterator.SEG_CUBICTO: + c = 'C'; + n = 6; + break; + case PathIterator.SEG_CLOSE: + c = 'E'; + n = 0; + break; + default: + throw new InternalError("Unknown segment!"); + } + sb.append(c); + sb.append("["); + for (int i = 0; i < n; i++) { + if (i != 0) { + sb.append(","); + } + sb.append(coords[i]); + } + sb.append("]"); + pi.next(); + } + sb.append(")"); + return sb.toString(); + } + } + + public static class Rect extends AnnotatedShapeOp { + public static Rect tryparse(String str) { + str = str.trim(); + if (!str.startsWith("Rect(")) { + return null; + } + str = str.substring(5); + double coords[] = new double[4]; + boolean foundparen = false; + for (int i = 0; i < coords.length; i++) { + int index = str.indexOf(","); + if (index < 0) { + if (i < coords.length-1) { + return null; + } + index = str.indexOf(")"); + if (index < 0) { + return null; + } + foundparen = true; + } + String num = str.substring(0, index); + try { + coords[i] = Double.parseDouble(num); + } catch (NumberFormatException nfe) { + return null; + } + str = str.substring(index+1); + } + if (!foundparen || str.length() > 0) { + return null; + } + Rect r = new Rect(); + r.rect.setRect(coords[0], coords[1], + coords[2], coords[3]); + return r; + } + + private Rectangle2D rect = new Rectangle2D.Double(); + + public void randomize() { + rect.setRect(randDblCoord(), randDblCoord(), + randDblCoord(), randDblCoord()); + } + + public Shape getShape() { + return rect; + } + + public String toString() { + return ("Rect("+ + rect.getX()+", "+ + rect.getY()+", "+ + rect.getWidth()+", "+ + rect.getHeight() + +")"); + } + } + + public static class Line extends AnnotatedShapeOp { + public static Line tryparse(String str) { + str = str.trim(); + if (!str.startsWith("Line(")) { + return null; + } + str = str.substring(5); + double coords[] = new double[4]; + boolean foundparen = false; + for (int i = 0; i < coords.length; i++) { + int index = str.indexOf(","); + if (index < 0) { + if (i < coords.length-1) { + return null; + } + index = str.indexOf(")"); + if (index < 0) { + return null; + } + foundparen = true; + } + String num = str.substring(0, index); + try { + coords[i] = Double.parseDouble(num); + } catch (NumberFormatException nfe) { + return null; + } + str = str.substring(index+1); + } + if (!foundparen || str.length() > 0) { + return null; + } + Line l = new Line(); + l.line.setLine(coords[0], coords[1], + coords[2], coords[3]); + return l; + } + + private Line2D line = new Line2D.Double(); + + public void randomize() { + line.setLine(randDblCoord(), randDblCoord(), + randDblCoord(), randDblCoord()); + } + + public Shape getShape() { + return line; + } + + public String toString() { + return ("Line("+ + line.getX1()+", "+ + line.getY1()+", "+ + line.getX2()+", "+ + line.getY2() + +")"); + } + } + + public static class RectMethod extends AnnotatedRenderOp { + public static RectMethod tryparse(String str) { + str = str.trim(); + if (!str.startsWith("RectMethod(")) { + return null; + } + str = str.substring(11); + int coords[] = new int[4]; + boolean foundparen = false; + for (int i = 0; i < coords.length; i++) { + int index = str.indexOf(","); + if (index < 0) { + if (i < coords.length-1) { + return null; + } + index = str.indexOf(")"); + if (index < 0) { + return null; + } + foundparen = true; + } + String num = str.substring(0, index).trim(); + try { + coords[i] = Integer.parseInt(num); + } catch (NumberFormatException nfe) { + return null; + } + str = str.substring(index+1); + } + if (!foundparen || str.length() > 0) { + return null; + } + RectMethod rm = new RectMethod(); + rm.rect.setBounds(coords[0], coords[1], + coords[2], coords[3]); + return rm; + } + + private Rectangle rect = new Rectangle(); + + public void randomize() { + rect.setBounds(randIntCoord(), randIntCoord(), + randIntCoord(), randIntCoord()); + } + + public void fill(Graphics2D g2d) { + g2d.fillRect(rect.x, rect.y, rect.width, rect.height); + } + + public void draw(Graphics2D g2d) { + g2d.drawRect(rect.x, rect.y, rect.width, rect.height); + } + + public String toString() { + return ("RectMethod("+ + rect.x+", "+ + rect.y+", "+ + rect.width+", "+ + rect.height + +")"); + } + } + + public static class LineMethod extends AnnotatedRenderOp { + public static LineMethod tryparse(String str) { + str = str.trim(); + if (!str.startsWith("LineMethod(")) { + return null; + } + str = str.substring(11); + int coords[] = new int[4]; + boolean foundparen = false; + for (int i = 0; i < coords.length; i++) { + int index = str.indexOf(","); + if (index < 0) { + if (i < coords.length-1) { + return null; + } + index = str.indexOf(")"); + if (index < 0) { + return null; + } + foundparen = true; + } + String num = str.substring(0, index).trim(); + try { + coords[i] = Integer.parseInt(num); + } catch (NumberFormatException nfe) { + return null; + } + str = str.substring(index+1); + } + if (!foundparen || str.length() > 0) { + return null; + } + LineMethod lm = new LineMethod(); + lm.line = coords; + return lm; + } + + private int line[] = new int[4]; + + public void randomize() { + line[0] = randIntCoord(); + line[1] = randIntCoord(); + line[2] = randIntCoord(); + line[3] = randIntCoord(); + } + + public void fill(Graphics2D g2d) { + } + + public void draw(Graphics2D g2d) { + g2d.drawLine(line[0], line[1], line[2], line[3]); + } + + public String toString() { + return ("LineMethod("+ + line[0]+", "+ + line[1]+", "+ + line[2]+", "+ + line[3] + +")"); + } + } + + public static class ErrorWindow extends Frame { + ImageCanvas unclipped; + ImageCanvas reference; + ImageCanvas actual; + ImageCanvas diff; + + public ErrorWindow() { + super("Error Comparison Window"); + + unclipped = new ImageCanvas(); + reference = new ImageCanvas(); + actual = new ImageCanvas(); + diff = new ImageCanvas(); + + setLayout(new SmartGridLayout(0, 2, 5, 5)); + addImagePanel(unclipped, "Unclipped rendering"); + addImagePanel(reference, "Clipped reference"); + addImagePanel(actual, "Actual clipped"); + addImagePanel(diff, "Difference"); + + addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + setVisible(false); + } + }); + } + + public void addImagePanel(ImageCanvas ic, String label) { + add(ic); + add(new Label(label)); + } + + public void setImages(BufferedImage imgref, BufferedImage imgtst) { + unclipped.setImage(imgref); + reference.setReference(imgref); + actual.setImage(imgtst); + diff.setDiff(reference.getImage(), imgtst); + invalidate(); + pack(); + repaint(); + } + + public void setVisible(boolean vis) { + super.setVisible(vis); + synchronized (this) { + notifyAll(); + } + } + + public synchronized void waitForHide() { + while (isShowing()) { + try { + wait(); + } catch (InterruptedException e) { + System.exit(2); + } + } + } + } + + public static class SmartGridLayout implements LayoutManager { + int rows; + int cols; + int hgap; + int vgap; + + public SmartGridLayout(int r, int c, int h, int v) { + this.rows = r; + this.cols = c; + this.hgap = h; + this.vgap = v; + } + + public void addLayoutComponent(String name, Component comp) { + } + + public void removeLayoutComponent(Component comp) { + } + + public int[][] getGridSizes(Container parent, boolean min) { + int ncomponents = parent.getComponentCount(); + int nrows = rows; + int ncols = cols; + + if (nrows > 0) { + ncols = (ncomponents + nrows - 1) / nrows; + } else { + nrows = (ncomponents + ncols - 1) / ncols; + } + int widths[] = new int[ncols+1]; + int heights[] = new int[nrows+1]; + int x = 0; + int y = 0; + for (int i = 0 ; i < ncomponents ; i++) { + Component comp = parent.getComponent(i); + Dimension d = (min + ? comp.getMinimumSize() + : comp.getPreferredSize()); + if (widths[x] < d.width) { + widths[x] = d.width; + } + if (heights[y] < d.height) { + heights[y] = d.height; + } + x++; + if (x >= ncols) { + x = 0; + y++; + } + } + for (int i = 0; i < ncols; i++) { + widths[ncols] += widths[i]; + } + for (int i = 0; i < nrows; i++) { + heights[nrows] += heights[i]; + } + return new int[][] { widths, heights }; + } + + public Dimension getSize(Container parent, boolean min) { + int sizes[][] = getGridSizes(parent, min); + int widths[] = sizes[0]; + int heights[] = sizes[1]; + int nrows = heights.length-1; + int ncols = widths.length-1; + int w = widths[ncols]; + int h = heights[nrows]; + Insets insets = parent.getInsets(); + return new Dimension(insets.left+insets.right + w+(ncols+1)*hgap, + insets.top+insets.bottom + h+(nrows+1)*vgap); + } + + public Dimension preferredLayoutSize(Container parent) { + return getSize(parent, false); + } + + public Dimension minimumLayoutSize(Container parent) { + return getSize(parent, true); + } + + public void layoutContainer(Container parent) { + int pref[][] = getGridSizes(parent, false); + int min[][] = getGridSizes(parent, true); + int minwidths[] = min[0]; + int minheights[] = min[1]; + int prefwidths[] = pref[0]; + int prefheights[] = pref[1]; + int nrows = minheights.length - 1; + int ncols = minwidths.length - 1; + Insets insets = parent.getInsets(); + int w = parent.getWidth() - insets.left - insets.right; + int h = parent.getHeight() - insets.top - insets.bottom; + w = w - (ncols+1)*hgap; + h = h - (nrows+1)*vgap; + int widths[] = calculateSizes(w, ncols, minwidths, prefwidths); + int heights[] = calculateSizes(h, nrows, minheights, prefheights); + int ncomponents = parent.getComponentCount(); + int x = insets.left + hgap; + int y = insets.top + vgap; + int r = 0; + int c = 0; + for (int i = 0; i < ncomponents; i++) { + parent.getComponent(i).setBounds(x, y, widths[c], heights[r]); + x += widths[c++] + hgap; + if (c >= ncols) { + c = 0; + x = insets.left + hgap; + y += heights[r++] + vgap; + if (r >= nrows) { + // just in case + break; + } + } + } + } + + public static int[] calculateSizes(int total, int num, + int minsizes[], int prefsizes[]) + { + if (total <= minsizes[num]) { + return minsizes; + } + if (total >= prefsizes[num]) { + return prefsizes; + } + int sizes[] = new int[total]; + int prevhappy = 0; + int nhappy = 0; + int happysize = 0; + do { + int addsize = (total - happysize) / (num - nhappy); + happysize = 0; + for (int i = 0; i < num; i++) { + if (sizes[i] >= prefsizes[i] || + minsizes[i] + addsize > prefsizes[i]) + { + happysize += (sizes[i] = prefsizes[i]); + nhappy++; + } else { + sizes[i] = minsizes[i] + addsize; + } + } + } while (nhappy < num && nhappy > prevhappy); + return sizes; + } + } + + public static class ImageCanvas extends Canvas { + BufferedImage image; + + public void setImage(BufferedImage img) { + this.image = img; + } + + public BufferedImage getImage() { + return image; + } + + public void checkImage(int w, int h) { + if (image == null || + image.getWidth() < w || + image.getHeight() < h) + { + image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); + } + } + + public void setReference(BufferedImage img) { + checkImage(img.getWidth(), img.getHeight()); + Graphics g = image.createGraphics(); + g.drawImage(img, 0, 0, null); + g.setColor(Color.white); + g.fillRect(0, 0, 30, 10); + g.fillRect(30, 0, 10, 30); + g.fillRect(10, 30, 30, 10); + g.fillRect(0, 10, 10, 30); + g.dispose(); + } + + public void setDiff(BufferedImage imgref, BufferedImage imgtst) { + int w = Math.max(imgref.getWidth(), imgtst.getWidth()); + int h = Math.max(imgref.getHeight(), imgtst.getHeight()); + checkImage(w, h); + Graphics g = image.createGraphics(); + g.drawImage(imgref, 0, 0, null); + g.setXORMode(Color.white); + g.drawImage(imgtst, 0, 0, null); + g.setPaintMode(); + g.setColor(new Color(1f, 1f, 0f, 0.25f)); + g.fillRect(10, 10, 20, 20); + g.setColor(new Color(1f, 0f, 0f, 0.25f)); + g.fillRect(0, 0, 30, 10); + g.fillRect(30, 0, 10, 30); + g.fillRect(10, 30, 30, 10); + g.fillRect(0, 10, 10, 30); + g.dispose(); + } + + public Dimension getPreferredSize() { + if (image == null) { + return new Dimension(); + } else { + return new Dimension(image.getWidth(), image.getHeight()); + } + } + + public void paint(Graphics g) { + g.drawImage(image, 0, 0, null); + } + } +} diff --git a/jdk/test/java/awt/Insets/WindowWithWarningTest/WindowWithWarningTest.html b/jdk/test/java/awt/Insets/WindowWithWarningTest/WindowWithWarningTest.html deleted file mode 100644 index ad6fa609d4f..00000000000 --- a/jdk/test/java/awt/Insets/WindowWithWarningTest/WindowWithWarningTest.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - WindowWithWarningTest - -
        -  This test will run automatically.
        -  
        - - - - - diff --git a/jdk/test/java/awt/Insets/WindowWithWarningTest/WindowWithWarningTest.java b/jdk/test/java/awt/Insets/WindowWithWarningTest/WindowWithWarningTest.java deleted file mode 100644 index ab9ea6950a6..00000000000 --- a/jdk/test/java/awt/Insets/WindowWithWarningTest/WindowWithWarningTest.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - test - @bug 6391770 - @summary Content of the Window should be laid out in the area left after WarningWindow was added. - @author yuri nesterenko: area= - @run applet WindowWithWarningTest.html -*/ - -// Note there is no @ in front of test above. This is so that the -// harness will not mistake this file as a test file. It should -// only see the html file as a test file. (the harness runs all -// valid test files, so it would run this test twice if this file -// were valid as well as the html file.) -// Also, note the area= after Your Name in the author tag. Here, you -// should put which functional area the test falls in. See the -// AWT-core home page -> test areas and/or -> AWT team for a list of -// areas. -// Note also the 'AutomaticAppletTest.html' in the run tag. This should -// be changed to the name of the test. - - -/** - * WindowWithWarningTest.java - * - * summary: - */ - -import java.applet.Applet; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; - -//Automated tests should run as applet tests if possible because they -// get their environments cleaned up, including AWT threads, any -// test created threads, and any system resources used by the test -// such as file descriptors. (This is normally not a problem as -// main tests usually run in a separate VM, however on some platforms -// such as the Mac, separate VMs are not possible and non-applet -// tests will cause problems). Also, you don't have to worry about -// synchronisation stuff in Applet tests they way you do in main -// tests... - - -public class WindowWithWarningTest extends Applet -{ - //Declare things used in the test, like buttons and labels here - boolean buttonClicked = false; - public static final int MAX_COUNT = 100; - - public void init() - { - //Create instructions for the user here, as well as set up - // the environment -- set the layout manager, add buttons, - // etc. - - this.setLayout (new BorderLayout ()); - - String[] instructions = - { - "This is an AUTOMATIC test", - "simply wait until it is done" - }; - //Sysout.createDialog( ); - //Sysout.printInstructions( instructions ); - - }//End init() - public void start () - { - //Get things going. Request focus, set size, et cetera - System.setSecurityManager( new SecurityManager() { - // deny AWTPermission("showWindowWithoutWarningBanner") - public boolean checkTopLevelWindow(Object window) { - return false; - } - }); - JFrame frame = new JFrame("Window Test"); - frame.setBounds(50, 50, 200, 200); - frame.show(); - - JWindow window = new JWindow( frame ); - JButton jbutton1 = new JButton( "First" ); - jbutton1.addMouseListener( new MouseAdapter() { - public void mousePressed( MouseEvent me ) { - buttonClicked = true; - } - }); - JButton jbutton2 = new JButton( "Second" ); - window.setLocation( 300, 300 ); - - window.add("North", jbutton1); - window.add("South", jbutton2); - - window.pack(); - window.show(); - //wait for frame to show: - getLocation( frame ); - window.toFront(); - - Dimension size0 = window.getSize(); - Dimension size1 = null; - try { - Robot robot = new Robot(); - - robot.delay(500); - window.pack(); - robot.delay(500); - window.pack(); - // size1 must be the same as size0 - size1 = window.getSize(); - robot.delay(500); - Point pt = jbutton1.getLocationOnScreen(); - robot.mouseMove((int) jbutton1.getLocationOnScreen().x + jbutton1.getWidth() / 2, - (int) jbutton1.getLocationOnScreen().y + jbutton1.getHeight() / 2); - robot.delay(500); - robot.mousePress(MouseEvent.BUTTON1_MASK); - robot.delay(100); - robot.mouseRelease(MouseEvent.BUTTON1_MASK); - robot.delay(2000); - }catch(Exception e) { - throw new RuntimeException( "Exception "+e ); - } - if( !size0.equals(size1) ) { - throw new RuntimeException( "Wrong Window size after multiple pack()s"); - } - if( !buttonClicked ) { - throw new RuntimeException( "Button was not clicked"); - } - window.dispose(); - frame.dispose(); - - System.out.println("Test Passed."); - }// start() - public static Point getLocation( Component co ) throws RuntimeException { - Point pt = null; - boolean bFound = false; - int count = 0; - while( !bFound ) { - try { - pt = co.getLocationOnScreen(); - bFound = true; - }catch( Exception ex ) { - bFound = false; - count++; - } - if( !bFound && count > MAX_COUNT ) { - throw new RuntimeException("don't see a component to get location"); - } - } - return pt; - } - - -}// class AutomaticAppletTest - - -/**************************************************** - 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 = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff --git a/jdk/test/java/awt/MenuBar/DeadlockTest1/DeadlockTest1.java b/jdk/test/java/awt/MenuBar/DeadlockTest1/DeadlockTest1.java new file mode 100644 index 00000000000..dc9677b49e2 --- /dev/null +++ b/jdk/test/java/awt/MenuBar/DeadlockTest1/DeadlockTest1.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 6990904 + @summary on oel5.5, Frame doesn't show if the Frame has only a MenuBar as its component. + @author Andrei Dmitriev: area=awt-menubar + @run main/timeout=30 DeadlockTest1 +*/ + +import java.awt.*; + +public class DeadlockTest1 { + Frame f = new Frame("Menu Frame"); + + DeadlockTest1() { + MenuBar menubar = new MenuBar(); + + Menu file = new Menu("File"); + Menu edit = new Menu("Edit"); + Menu help = new Menu("Help"); + + MenuItem open = new MenuItem("Open"); + MenuItem close = new MenuItem("Close"); + MenuItem copy = new MenuItem("Copy"); + MenuItem paste = new MenuItem("Paste"); + + file.add(open); + file.add(close); + + edit.add(copy); + edit.add(paste); + menubar.add(file); + menubar.add(edit); + menubar.add(help); + menubar.setHelpMenu(help); + + f.setMenuBar(menubar); + f.setSize(400,200); + f.setVisible(true); + try { + Thread.sleep(5000); + } catch (InterruptedException z) { + throw new RuntimeException(z); + } + f.dispose(); + } + + public static void main(String argv[]) { + new DeadlockTest1(); + } +} diff --git a/jdk/test/java/awt/Multiscreen/TranslucencyThrowsExceptionWhenFullScreen/TranslucencyThrowsExceptionWhenFullScreen.java b/jdk/test/java/awt/Multiscreen/TranslucencyThrowsExceptionWhenFullScreen/TranslucencyThrowsExceptionWhenFullScreen.java new file mode 100644 index 00000000000..f044b1b6cc5 --- /dev/null +++ b/jdk/test/java/awt/Multiscreen/TranslucencyThrowsExceptionWhenFullScreen/TranslucencyThrowsExceptionWhenFullScreen.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 6838089 + @summary Translucent windows should throw exception in FS mode + @author dmitry.cherepanov@oracle.com: area=awt-multiscreen + @run main TranslucencyThrowsExceptionWhenFullScreen +*/ + +import java.awt.*; +import java.lang.reflect.InvocationTargetException; + +public class TranslucencyThrowsExceptionWhenFullScreen +{ + public static void main(String[] args) + throws InvocationTargetException, InterruptedException + { + EventQueue.invokeAndWait( + new Runnable(){ + public void run() { + Frame frame = new Frame(); + frame.setBounds(100,100,100,100); + frame.setVisible(true); + + GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + GraphicsDevice[] devices = ge.getScreenDevices(); + for (GraphicsDevice device : devices) { + testGraphicsDevice(device, frame); + } + + frame.dispose(); + } + } + ); + } + + private static void testGraphicsDevice(GraphicsDevice device, Frame frame) { + device.setFullScreenWindow(frame); + try { + frame.setOpacity(0.5f); + throw new RuntimeException("Test fails, there's no exception for device="+device); + } catch(IllegalComponentStateException e) { + device.setFullScreenWindow(null); + } + } +} diff --git a/jdk/test/java/awt/PrintJob/Text/StringWidth.java b/jdk/test/java/awt/PrintJob/Text/StringWidth.java index b8760aa942c..4c2250a21dd 100644 --- a/jdk/test/java/awt/PrintJob/Text/StringWidth.java +++ b/jdk/test/java/awt/PrintJob/Text/StringWidth.java @@ -60,7 +60,6 @@ public class StringWidth extends Frame { pg.dispose(); pj.end(); setVisible(false); - System.exit(0); } public static void main(String[] args) { diff --git a/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java b/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java index 94af561ad42..09df308ba23 100644 --- a/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java +++ b/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/TextField/ScrollSelectionTest/ScrollSelectionTest.java b/jdk/test/java/awt/TextField/ScrollSelectionTest/ScrollSelectionTest.java index fb9df2cedab..482a31245ed 100644 --- a/jdk/test/java/awt/TextField/ScrollSelectionTest/ScrollSelectionTest.java +++ b/jdk/test/java/awt/TextField/ScrollSelectionTest/ScrollSelectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java b/jdk/test/java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java index d2de08e0f72..42695a51763 100644 --- a/jdk/test/java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java +++ b/jdk/test/java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/native/sun/font/layout/HebrewShaping.cpp b/jdk/test/java/awt/event/OtherEvents/UngrabID/UngrabID.java similarity index 56% rename from jdk/src/share/native/sun/font/layout/HebrewShaping.cpp rename to jdk/test/java/awt/event/OtherEvents/UngrabID/UngrabID.java index e9c0a1fa80c..34a7b769057 100644 --- a/jdk/src/share/native/sun/font/layout/HebrewShaping.cpp +++ b/jdk/test/java/awt/event/OtherEvents/UngrabID/UngrabID.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,39 +21,28 @@ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. - * */ /* - * - * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved - * - */ + @test + @bug 6960516 + @summary check if the ungrab event has the ID < AWTEvent.RESERVED_ID_MAX + @author Andrei Dmitriev : area=awt.event + @run main UngrabID +*/ -#include "LETypes.h" -#include "OpenTypeTables.h" -#include "HebrewShaping.h" +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; -const LETag ligaFeatureTag = 0x6C696761; // 'liga' -const LETag emptyTag = 0x00000000; // '' - -const LETag hebrewTags[] = -{ - ligaFeatureTag, emptyTag -}; - -void HebrewShaping::shape(const LEUnicode * /*chars*/, le_int32 /*offset*/, le_int32 charCount, le_int32 /*charMax*/, - le_bool rightToLeft, const LETag **tags) -{ - - le_int32 count, out = 0, dir = 1; - - if (rightToLeft) { - out = charCount - 1; - dir = -1; - } - - for (count = 0; count < charCount; count += 1, out += dir) { - tags[out] = hebrewTags; +public class UngrabID { + public static void main(String[] args){ + Frame f = new Frame("Dummy"); + sun.awt.UngrabEvent event = new sun.awt.UngrabEvent(f); + if (event.getID() > AWTEvent.RESERVED_ID_MAX) { + System.out.println( " Event ID : "+event.getID() + " " + event.toString()); + throw new RuntimeException(" Ungrab Event ID should be less than AWTEvent.RESERVED_ID_MAX ("+AWTEvent.RESERVED_ID_MAX+"). Actual value : "+event.getID() + " Event:" + event.toString()); } + System.out.println("Test passed. "); + } } diff --git a/jdk/test/java/awt/font/NumericShaper/ShapingTest.java b/jdk/test/java/awt/font/NumericShaper/ShapingTest.java index 927b988f31c..a82461f5a81 100644 --- a/jdk/test/java/awt/font/NumericShaper/ShapingTest.java +++ b/jdk/test/java/awt/font/NumericShaper/ShapingTest.java @@ -23,8 +23,8 @@ /* * @test - * @bug 6842557 6943963 - * @summary confirm that shaping works as expected. (Mainly for new characters which were added in Unicode 5) + * @bug 6842557 6943963 6959267 + * @summary confirm that shaping works as expected. (Mainly for new characters which were added in Unicode 5 and 6) * used where appropriate. */ @@ -39,6 +39,7 @@ public class ShapingTest { public static void main(String[] args) { test6842557(); test6943963(); + test6903266(); if (err) { throw new RuntimeException("shape() returned unexpected value."); @@ -109,6 +110,34 @@ public class ShapingTest { checkResult("Range.ARABIC, Range.EASTERN_ARABIC", ns, given, expected_EASTERN_ARABIC); } + private static void test6903266() { + NumericShaper ns = getContextualShaper(EnumSet.of(Range.TAI_THAM_HORA)); + String given = "\u1a20 012"; + String expected = "\u1a20 \u1a80\u1a81\u1a82"; + checkResult("Range.TAI_THAM_HORA", ns, given, expected); + + ns = getContextualShaper(EnumSet.of(Range.TAI_THAM_HORA, + Range.TAI_THAM_THAM)); + given = "\u1a20 012"; + expected = "\u1a20 \u1a90\u1a91\u1a92"; // Tham digits are prioritized. + checkResult("Range.TAI_THAM_HORA, Range.TAI_THAM_THAM", ns, given, expected); + + ns = getContextualShaper(EnumSet.of(Range.JAVANESE)); + given = "\ua984 012"; + expected = "\ua984 \ua9d0\ua9d1\ua9d2"; + checkResult("Range.JAVANESE", ns, given, expected); + + ns = getContextualShaper(EnumSet.of(Range.TAI_THAM_THAM)); + given = "\u1a20 012"; + expected = "\u1a20 \u1a90\u1a91\u1a92"; + checkResult("Range.TAI_THAM_THAM", ns, given, expected); + + ns = getContextualShaper(EnumSet.of(Range.MEETEI_MAYEK)); + given = "\uabc0 012"; + expected = "\uabc0 \uabf0\uabf1\uabf2"; + checkResult("Range.MEETEI_MAYEK", ns, given, expected); + } + private static void checkResult(String ranges, NumericShaper ns, String given, String expected) { char[] text = given.toCharArray(); diff --git a/jdk/test/java/awt/font/TextLayout/TestOldHangul.java b/jdk/test/java/awt/font/TextLayout/TestOldHangul.java new file mode 100644 index 00000000000..b52ba38557d --- /dev/null +++ b/jdk/test/java/awt/font/TextLayout/TestOldHangul.java @@ -0,0 +1,83 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* @test @(#)TestOldHangul.java + * @summary Verify Old Hangul display + * @bug 6886358 + * @ignore Requires a special font installed. + */ + +import javax.swing.*; +import javax.swing.border.LineBorder; +import java.awt.*; +import java.awt.event.ActionEvent; + +public class TestOldHangul { + public static void main(String[] args) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + new TestOldHangul().run(); + } + }); + } + public static boolean AUTOMATIC_TEST=true; // true; run test automatically, else manually at button push + + private void run() { + Font ourFont = null; + final String fontName = "UnBatangOdal.ttf"; // download from http://chem.skku.ac.kr/~wkpark/project/font/GSUB/UnbatangOdal/ and place in {user.home}/fonts/ + try { + ourFont = Font.createFont(Font.TRUETYPE_FONT, new java.io.File(new java.io.File(System.getProperty("user.home"),"fonts"), fontName)); + ourFont = ourFont.deriveFont((float)48.0); + } catch(Throwable t) { + t.printStackTrace(); + System.err.println("Fail: " + t); + return; + } + JFrame frame = new JFrame(System.getProperty("java.version")); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + JPanel panel = new JPanel(); + final JTextArea label = new JTextArea("(empty)"); + label.setSize(400, 300); + label.setBorder(new LineBorder(Color.black)); + label.setFont(ourFont); + final String str = "\u110A\u119E\u11B7\u0020\u1112\u119E\u11AB\uAE00\u0020\u1100\u119E\u11F9\u0020\u112B\u119E\u11BC\n"; + + if(AUTOMATIC_TEST) { /* run the test automatically (else, manually) */ + label.setText(str); + } else { + JButton button = new JButton("Old Hangul"); + button.addActionListener(new AbstractAction() { + public void actionPerformed(ActionEvent actionEvent) { + label.setText(str); + } + }); + panel.add(button); + } + panel.add(label); + + frame.getContentPane().add(panel); + frame.pack(); + frame.setVisible(true); + } +} + diff --git a/jdk/test/java/awt/font/TextLayout/TestTibetan.java b/jdk/test/java/awt/font/TextLayout/TestTibetan.java new file mode 100644 index 00000000000..bc55472a3cd --- /dev/null +++ b/jdk/test/java/awt/font/TextLayout/TestTibetan.java @@ -0,0 +1,87 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* @test @(#)TestTibetan.java + * @summary verify tibetan output + * @bug 6886358 + * @ignore Requires a special font installed + */ + +import javax.swing.*; +import javax.swing.border.LineBorder; +import java.awt.*; +import java.awt.event.ActionEvent; + +public class TestTibetan { + public static void main(String[] args) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + new TestTibetan().run(); + } + }); + } + public static boolean AUTOMATIC_TEST=true; // true; run test automatically, else manually at button push + + private void run() { + Font ourFont = null; + try { + //For best results: Font from: http://download.savannah.gnu.org/releases/free-tibetan/jomolhari/ + // place in $(user.home)/fonts/ + ourFont = Font.createFont(Font.TRUETYPE_FONT, new java.io.File(new java.io.File(System.getProperty("user.home"),"fonts"), "Jomolhari-alpha3c-0605331.ttf")); + + //ourFont = new Font("serif",Font.PLAIN, 24); + ourFont = ourFont.deriveFont((float)24.0); + } catch(Throwable t) { + t.printStackTrace(); + System.err.println("Fail: " + t); + return; + } + JFrame frame = new JFrame(System.getProperty("java.version")); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + JPanel panel = new JPanel(); + final JTextArea label = new JTextArea("(empty)"); + label.setSize(400, 300); + label.setBorder(new LineBorder(Color.black)); + label.setFont(ourFont); + + final String str = "\u0F04\u0F05\u0F0D\u0F0D\u0020\u0F4F\u0F72\u0F53\u0F0B\u0F4F\u0F72\u0F53\u0F0B\u0F42\u0FB1\u0F72\u0F0B\u0F51\u0F54\u0F60\u0F0B\u0F62\u0FA9\u0F63"; // TinTin. + + if(AUTOMATIC_TEST) { /* run the test automatically (else, manually) */ + label.setText(str); + } else { + JButton button = new JButton("Set Char x0DDD"); + button.addActionListener(new AbstractAction() { + public void actionPerformed(ActionEvent actionEvent) { + label.setText(str); + } + }); + panel.add(button); + } + panel.add(label); + + frame.getContentPane().add(panel); + frame.pack(); + frame.setVisible(true); + } +} + diff --git a/jdk/test/java/awt/image/GetDataElementsTest.java b/jdk/test/java/awt/image/GetDataElementsTest.java new file mode 100644 index 00000000000..0ece1de3447 --- /dev/null +++ b/jdk/test/java/awt/image/GetDataElementsTest.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6773022 + * @summary Test verifies that SampleModel.getDataElements() throws an appropriate + * exception if coordinates are not in bounds. + * + * @run main GetDataElementsTest + */ + +import java.awt.image.ComponentSampleModel; +import java.awt.image.DataBuffer; +import java.awt.image.SampleModel; + +public class GetDataElementsTest { + + public static int width = 100; + public static int height = 100; + public static int dataType = DataBuffer.TYPE_BYTE; + public static int numBands = 4; + + public static void main(String[] args) { + SampleModel sm = new ComponentSampleModel(dataType, width, height, 4, width * 4, new int[] { 0, 1, 2, 3 } ); + + DataBuffer db = sm.createDataBuffer(); + Object o = null; + + boolean testPassed = false; + try { + o = sm.getDataElements(Integer.MAX_VALUE, 0, 1, 1, o, db); + } catch (ArrayIndexOutOfBoundsException e) { + System.out.println(e.getMessage()); + testPassed = true; + } + + if (!testPassed) { + throw new RuntimeException("Excpected excprion was not thrown."); + } + } +} diff --git a/jdk/test/java/awt/image/IncorrectSampleMaskTest.java b/jdk/test/java/awt/image/IncorrectSampleMaskTest.java new file mode 100644 index 00000000000..bfd88cc6607 --- /dev/null +++ b/jdk/test/java/awt/image/IncorrectSampleMaskTest.java @@ -0,0 +1,113 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6782574 + * @summary Test verifies that incorrect sample masks are correctly handled + * by the constructor of the SinglePixelPackedSampleModel class + * and do not cause internal error in the medialib glue code. + * + * @run main IncorrectSampleMaskTest + */ + +import java.awt.geom.AffineTransform; +import java.awt.image.AffineTransformOp; +import java.awt.image.BufferedImageOp; +import java.awt.image.DataBuffer; +import java.awt.image.DataBufferByte; +import java.awt.image.DataBufferInt; +import java.awt.image.DataBufferUShort; +import java.awt.image.Raster; +import java.awt.image.RasterOp; +import java.awt.image.WritableRaster; +import java.awt.image.SinglePixelPackedSampleModel; + +public class IncorrectSampleMaskTest { + public static void main(String[] args) { + int[] dataTypes = new int[] { + DataBuffer.TYPE_BYTE, + DataBuffer.TYPE_USHORT, + DataBuffer.TYPE_INT }; + + for (int type : dataTypes) { + doTest(type); + } + } + + private static final int w = 100; + private static final int h = 100; + + private static AffineTransform at = + AffineTransform.getScaleInstance(0.5, 0.5); + + private static RasterOp op = + new AffineTransformOp(at, AffineTransformOp.TYPE_NEAREST_NEIGHBOR); + + private static void doTest(int dataType) { + int maxSize = DataBuffer.getDataTypeSize(dataType); + System.out.println("Type size: " + maxSize); + + int theMask = (int)(1L << (maxSize + 2)) - 1; + System.out.printf("theMask=%x\n", theMask); + + SinglePixelPackedSampleModel sm = + new SinglePixelPackedSampleModel(dataType, w, h, + new int[] { theMask }); + + + int[] sampleSize = sm.getSampleSize(); + for (int s : sampleSize) { + if (s > maxSize) { + throw new RuntimeException("Test failed: sample size is too big:" + s); + } + } + + System.out.println("Test medialib..."); + DataBuffer buf = createDataBuffer(dataType); + + WritableRaster wr = Raster.createWritableRaster(sm, buf, null); + + op.filter(wr, null); + System.out.println("Test PASSED."); + } + + private static DataBuffer createDataBuffer(int type) { + switch (type) { + case DataBuffer.TYPE_BYTE: { + byte[] buf = new byte[w * h]; + return new DataBufferByte(buf, buf.length); + } + case DataBuffer.TYPE_USHORT: { + short[] buf = new short[w * h]; + return new DataBufferUShort(buf, buf.length); + } + case DataBuffer.TYPE_INT: { + int[] buf = new int[w * h]; + return new DataBufferInt(buf, buf.length); + } + default : + throw new RuntimeException("Unsupported data type."); + } + } +} diff --git a/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java b/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java index 75a1f905e57..86e69e67f3c 100644 --- a/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java +++ b/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/xembed/server/TestXEmbedServer.java b/jdk/test/java/awt/xembed/server/TestXEmbedServer.java index d1ef46d0ca9..56756526a59 100644 --- a/jdk/test/java/awt/xembed/server/TestXEmbedServer.java +++ b/jdk/test/java/awt/xembed/server/TestXEmbedServer.java @@ -31,6 +31,9 @@ import java.awt.dnd.*; import java.awt.datatransfer.*; public abstract class TestXEmbedServer { + // vertical position of server AND client windows + private static final int VERTICAL_POSITION = 200; + private static final Logger log = Logger.getLogger("test.xembed"); Frame f; Canvas client; @@ -161,10 +164,10 @@ public abstract class TestXEmbedServer { dummy = new JFrame("Dummy"); dummy.getContentPane().add(new JButton("Button")); dummy.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - dummy.setBounds(0, 0, 100, 100); + dummy.setBounds(0, VERTICAL_POSITION, 100, 100); dummy.setVisible(true); - f.setBounds(300, 0, 800, 300); + f.setBounds(300, VERTICAL_POSITION, 800, 300); f.setVisible(true); } diff --git a/jdk/test/java/beans/Beans/Test4080522.java b/jdk/test/java/beans/Beans/Test4080522.java index c6ee1b89be4..03e4e31300a 100644 --- a/jdk/test/java/beans/Beans/Test4080522.java +++ b/jdk/test/java/beans/Beans/Test4080522.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/EventHandler/Test6277246.java b/jdk/test/java/beans/EventHandler/Test6277246.java index f0d9aaaa811..269ad5e599f 100644 --- a/jdk/test/java/beans/EventHandler/Test6277246.java +++ b/jdk/test/java/beans/EventHandler/Test6277246.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/EventHandler/Test6277266.java b/jdk/test/java/beans/EventHandler/Test6277266.java index a23a4daeaf9..60bc13727e0 100644 --- a/jdk/test/java/beans/EventHandler/Test6277266.java +++ b/jdk/test/java/beans/EventHandler/Test6277266.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Test6277246.java b/jdk/test/java/beans/Introspector/Test6277246.java index 40ea01616d8..8b536690b24 100644 --- a/jdk/test/java/beans/Introspector/Test6277246.java +++ b/jdk/test/java/beans/Introspector/Test6277246.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Test6447751.java b/jdk/test/java/beans/Introspector/Test6447751.java new file mode 100644 index 00000000000..5e43556a6c2 --- /dev/null +++ b/jdk/test/java/beans/Introspector/Test6447751.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6447751 + * @summary Tests automatic search for customizers + * @author Sergey Malenkov + */ + +import java.awt.Component; +import java.beans.Customizer; +import java.beans.Introspector; +import java.beans.IntrospectionException; +import java.beans.SimpleBeanInfo; +import java.beans.BeanDescriptor; +import java.beans.PropertyChangeListener; + +public class Test6447751 { + + public static void main(String[] args) { + test(Manual.class, AutomaticCustomizer.class); + test(Illegal.class, null); + test(Automatic.class, AutomaticCustomizer.class); + } + + private static void test(Class type, Class expected) { + Class actual; + try { + actual = Introspector.getBeanInfo(type).getBeanDescriptor().getCustomizerClass(); + } + catch (IntrospectionException exception) { + throw new Error("unexpected error", exception); + } + if (actual != expected) { + StringBuilder sb = new StringBuilder(); + sb.append("bean ").append(type).append(": "); + if (expected != null) { + sb.append("expected ").append(expected); + if (actual != null) { + sb.append(", but "); + } + } + if (actual != null) { + sb.append("found ").append(actual); + } + throw new Error(sb.toString()); + } + } + + public static class Automatic { + } + public static class AutomaticCustomizer extends Component implements Customizer { + public void setObject(Object bean) { + throw new UnsupportedOperationException(); + } + } + + public static class Illegal { + } + public static class IllegalCustomizer implements Customizer { + public void setObject(Object bean) { + throw new UnsupportedOperationException(); + } + public void addPropertyChangeListener(PropertyChangeListener listener) { + throw new UnsupportedOperationException(); + } + public void removePropertyChangeListener(PropertyChangeListener listener) { + throw new UnsupportedOperationException(); + } + } + + public static class Manual { + } + public static class ManualBeanInfo extends SimpleBeanInfo { + public BeanDescriptor getBeanDescriptor() { + return new BeanDescriptor(Manual.class, AutomaticCustomizer.class); + } + } +} diff --git a/jdk/test/java/beans/XMLEncoder/java_awt_BasicStroke.java b/jdk/test/java/beans/XMLEncoder/java_awt_BasicStroke.java new file mode 100644 index 00000000000..6a6efdad199 --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/java_awt_BasicStroke.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4358979 + * @summary Tests BasicStroke encoding + * @author Sergey Malenkov + */ + +import java.awt.BasicStroke; + +public final class java_awt_BasicStroke extends AbstractTest { + public static void main(String[] args) { + new java_awt_BasicStroke().test(true); + } + + protected BasicStroke getObject() { + return new BasicStroke(); + } + + protected BasicStroke getAnotherObject() { + float[] f = {1.0f, 2.0f, 3.0f, 4.0f}; + return new BasicStroke(f[1], BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, f[2], f, f[3]); + } +} diff --git a/jdk/test/java/beans/XMLEncoder/java_awt_GradientPaint.java b/jdk/test/java/beans/XMLEncoder/java_awt_GradientPaint.java new file mode 100644 index 00000000000..40d8bf59a9f --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/java_awt_GradientPaint.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4358979 + * @summary Tests GradientPaint encoding + * @author Sergey Malenkov + */ + +import java.awt.Color; +import java.awt.GradientPaint; + +public final class java_awt_GradientPaint extends AbstractTest { + public static void main(String[] args) { + new java_awt_GradientPaint().test(true); + } + + protected GradientPaint getObject() { + return new GradientPaint(0.1f, 0.2f, Color.BLACK, 0.3f, 0.4f, Color.WHITE, true); + } + + protected GradientPaint getAnotherObject() { + return null; /* TODO: could not update property + return new GradientPaint(0.4f, 0.3f, Color.WHITE, 0.2f, 0.1f, Color.BLACK, false);*/ + } +} diff --git a/jdk/test/java/beans/XMLEncoder/java_awt_GridBagConstraints.java b/jdk/test/java/beans/XMLEncoder/java_awt_GridBagConstraints.java index 1343588bb92..656a11d763f 100644 --- a/jdk/test/java/beans/XMLEncoder/java_awt_GridBagConstraints.java +++ b/jdk/test/java/beans/XMLEncoder/java_awt_GridBagConstraints.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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_awt_LinearGradientPaint.java b/jdk/test/java/beans/XMLEncoder/java_awt_LinearGradientPaint.java new file mode 100644 index 00000000000..7a636b10c65 --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/java_awt_LinearGradientPaint.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4358979 + * @summary Tests LinearGradientPaint encoding + * @author Sergey Malenkov + */ + +import java.awt.Color; +import java.awt.LinearGradientPaint; +import java.awt.geom.AffineTransform; +import java.awt.geom.Point2D; + +import static java.awt.MultipleGradientPaint.ColorSpaceType.LINEAR_RGB; +import static java.awt.MultipleGradientPaint.CycleMethod.REFLECT; + +public final class java_awt_LinearGradientPaint extends AbstractTest { + public static void main(String[] args) { + new java_awt_LinearGradientPaint().test(true); + } + + protected LinearGradientPaint getObject() { + float[] f = { 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f }; + Color[] c = { Color.BLUE, Color.GREEN, Color.RED, Color.BLUE, Color.GREEN, Color.RED }; + return new LinearGradientPaint(f[0], f[1], f[2], f[3], f, c); + } + + protected LinearGradientPaint getAnotherObject() { + return null; /* TODO: could not update property + float[] f = { 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f }; + Color[] c = { Color.RED, Color.GREEN, Color.BLUE, Color.RED, Color.GREEN, Color.BLUE }; + return new LinearGradientPaint( + new Point2D.Float(f[0], f[1]), + new Point2D.Float(f[2], f[3]), + f, c, REFLECT, LINEAR_RGB, + new AffineTransform(f));*/ + } +} diff --git a/jdk/test/java/beans/XMLEncoder/java_awt_RadialGradientPaint.java b/jdk/test/java/beans/XMLEncoder/java_awt_RadialGradientPaint.java new file mode 100644 index 00000000000..fbb7be9864a --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/java_awt_RadialGradientPaint.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4358979 + * @summary Tests RadialGradientPaint encoding + * @author Sergey Malenkov + */ + +import java.awt.Color; +import java.awt.RadialGradientPaint; +import java.awt.geom.AffineTransform; +import java.awt.geom.Point2D; + +import static java.awt.MultipleGradientPaint.ColorSpaceType.LINEAR_RGB; +import static java.awt.MultipleGradientPaint.CycleMethod.REFLECT; + +public final class java_awt_RadialGradientPaint extends AbstractTest { + public static void main(String[] args) { + new java_awt_RadialGradientPaint().test(true); + } + + protected RadialGradientPaint getObject() { + float[] f = { 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f }; + Color[] c = { Color.BLUE, Color.GREEN, Color.RED, Color.BLUE, Color.GREEN, Color.RED }; + return new RadialGradientPaint(f[0], f[1], f[2], f, c); + } + + protected RadialGradientPaint getAnotherObject() { + return null; /* TODO: could not update property + float[] f = { 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f }; + Color[] c = { Color.RED, Color.GREEN, Color.BLUE, Color.RED, Color.GREEN, Color.BLUE }; + return new RadialGradientPaint( + new Point2D.Float(f[0], f[1]), 100.0f, + new Point2D.Float(f[2], f[3]), + f, c, REFLECT, LINEAR_RGB, + new AffineTransform(f));*/ + } +} diff --git a/jdk/test/java/beans/XMLEncoder/java_awt_geom_AffineTransform.java b/jdk/test/java/beans/XMLEncoder/java_awt_geom_AffineTransform.java new file mode 100644 index 00000000000..9e5da1160c1 --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/java_awt_geom_AffineTransform.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4358979 + * @summary Tests AffineTransform encoding + * @author Sergey Malenkov + */ + +import java.awt.geom.AffineTransform; + +public final class java_awt_geom_AffineTransform extends AbstractTest { + public static void main(String[] args) { + new java_awt_geom_AffineTransform().test(true); + } + + protected AffineTransform getObject() { + return new AffineTransform(0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f); + } + + protected AffineTransform getAnotherObject() { + return new AffineTransform(0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f); + } +} diff --git a/jdk/test/java/beans/XMLEncoder/javax_swing_border_StrokeBorder.java b/jdk/test/java/beans/XMLEncoder/javax_swing_border_StrokeBorder.java new file mode 100644 index 00000000000..0ee1fda4ca8 --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/javax_swing_border_StrokeBorder.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4358979 + * @summary Tests StrokeBorder encoding + * @author Sergey Malenkov + */ + +import java.awt.BasicStroke; +import java.awt.Color; +import javax.swing.border.StrokeBorder; + +public final class javax_swing_border_StrokeBorder extends AbstractTest { + public static void main(String[] args) { + new javax_swing_border_StrokeBorder().test(true); + } + + protected StrokeBorder getObject() { + return new StrokeBorder(new BasicStroke(0), Color.WHITE); + } + + protected StrokeBorder getAnotherObject() { + return null; // TODO: could not update property + //return new StrokeBorder(new BasicStroke(1)); + } +} diff --git a/jdk/test/java/dyn/ClassValueTest.java b/jdk/test/java/dyn/ClassValueTest.java new file mode 100644 index 00000000000..f917e9581da --- /dev/null +++ b/jdk/test/java/dyn/ClassValueTest.java @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @summary tests for class-specific values + * @compile ClassValueTest.java + * @run junit/othervm test.java.dyn.ClassValueTest + */ + +/* + Manually: + $ $JAVA7X_HOME/bin/javac -d foo -cp $JUNIT4_JAR test/java/dyn/ClassValueTest.java + $ $JAVA7X_HOME/bin/java -cp foo:$JUNIT4_JAR org.junit.runner.JUnitCore test.java.dyn.ClassValueTest + Output: .testAdd => 1000 : Integer + */ + +package test.java.dyn; + +import java.util.*; + +import java.dyn.*; + +import org.junit.*; +import static org.junit.Assert.*; + +/** + * @author jrose + */ +public class ClassValueTest { + static String nameForCV1(Class type) { + return "CV1:" + type.getName(); + } + static int countForCV1; + static final ClassValue CV1 = new CV1(); + private static class CV1 extends ClassValue { + protected String computeValue(Class type) { + countForCV1++; + return nameForCV1(type); + } + } + + static final Class[] CLASSES = { + String.class, + Integer.class, + int.class, + boolean[].class, + char[][].class, + ClassValueTest.class + }; + + @Test + public void testGet() { + countForCV1 = 0; + for (Class c : CLASSES) { + assertEquals(nameForCV1(c), CV1.get(c)); + } + assertEquals(CLASSES.length, countForCV1); + for (Class c : CLASSES) { + assertEquals(nameForCV1(c), CV1.get(c)); + } + assertEquals(CLASSES.length, countForCV1); + } + + @Test + public void testRemove() { + for (Class c : CLASSES) { + CV1.get(c); + } + countForCV1 = 0; + int REMCOUNT = 3; + for (int i = 0; i < REMCOUNT; i++) { + CV1.remove(CLASSES[i]); + } + assertEquals(0, countForCV1); // no change + for (Class c : CLASSES) { + assertEquals(nameForCV1(c), CV1.get(c)); + } + assertEquals(REMCOUNT, countForCV1); + } + + static String nameForCVN(Class type, int n) { + return "CV[" + n + "]" + type.getName(); + } + static int countForCVN; + static class CVN extends ClassValue { + final int n; + CVN(int n) { this.n = n; } + protected String computeValue(Class type) { + countForCVN++; + return nameForCVN(type, n); + } + }; + + @Test + public void testGetMany() { + int CVN_COUNT1 = 100, CVN_COUNT2 = 100; + CVN cvns[] = new CVN[CVN_COUNT1 * CVN_COUNT2]; + for (int n = 0; n < cvns.length; n++) { + cvns[n] = new CVN(n); + } + countForCVN = 0; + for (int pass = 0; pass <= 2; pass++) { + for (int i1 = 0; i1 < CVN_COUNT1; i1++) { + eachClass: + for (Class c : CLASSES) { + for (int i2 = 0; i2 < CVN_COUNT2; i2++) { + int n = i1*CVN_COUNT2 + i2; + assertEquals(0, countForCVN); + assertEquals(nameForCVN(c, n), cvns[n].get(c)); + cvns[n].get(c); //get it again + //System.out.println("getting "+n+":"+cvns[n].get(c)); + boolean doremove = (((i1 + i2) & 3) == 0); + switch (pass) { + case 0: + assertEquals(1, countForCVN); + break; + case 1: + // remove on middle pass + assertEquals(0, countForCVN); + if (doremove) { + //System.out.println("removing "+n+":"+cvns[n].get(c)); + cvns[n].remove(c); + assertEquals(0, countForCVN); + } + break; + case 2: + assertEquals(doremove ? 1 : 0, countForCVN); + break; + } + countForCVN = 0; + if (i1 > i2 && i1 < i2+5) continue eachClass; // leave diagonal gap + } + } + } + } + assertEquals(countForCVN, 0); + for (int n = 0; n < cvns.length; n++) { + for (Class c : CLASSES) { + assertEquals(nameForCVN(c, n), cvns[n].get(c)); + } + } + } +} diff --git a/jdk/test/java/dyn/InvokeDynamicPrintArgs.java b/jdk/test/java/dyn/InvokeDynamicPrintArgs.java new file mode 100644 index 00000000000..1bf1b73b197 --- /dev/null +++ b/jdk/test/java/dyn/InvokeDynamicPrintArgs.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @summary smoke test for invokedynamic instructions + * @library indify + * @compile InvokeDynamicPrintArgs.java + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic + * indify.Indify + * --verify-specifier-count=3 --transitionalJSR292=false + * --expand-properties --classpath ${test.classes} + * --java InvokeDynamicPrintArgs --check-output + */ + +import java.util.*; +import java.io.*; + +import java.dyn.*; +import static java.dyn.MethodHandles.*; +import static java.dyn.MethodType.*; + +public class InvokeDynamicPrintArgs { + public static void main(String... av) throws Throwable { + if (av.length > 0) openBuf(); // --check-output mode + System.out.println("Printing some argument lists, starting with a empty one:"); + INDY_nothing().invokeExact(); // BSM specifier #0 = {bsm} + INDY_bar().invokeExact("bar arg", 1); // BSM specifier #1 = {bsm2, Void.class, "void type"} + INDY_bar2().invokeExact("bar2 arg", 222); // BSM specifier #1 = (same) + INDY_baz().invokeExact("baz arg", 2, 3.14); // BSM specifier #2 = {bsm2, 1234.5} + INDY_foo().invokeExact("foo arg"); // BSM specifier #0 = (same) + // Hence, BSM specifier count should be 3. See "--verify-specifier-count=3" above. + System.out.println("Done printing argument lists."); + closeBuf(); + } + + private static PrintStream oldOut; + private static ByteArrayOutputStream buf; + private static void openBuf() { + oldOut = System.out; + buf = new ByteArrayOutputStream(); + System.setOut(new PrintStream(buf)); + } + private static void closeBuf() { + if (buf == null) return; + System.out.flush(); + System.setOut(oldOut); + String[] haveLines = new String(buf.toByteArray()).split("[\n\r]+"); + for (String line : haveLines) System.out.println(line); + Iterator iter = Arrays.asList(haveLines).iterator(); + for (String want : EXPECT_OUTPUT) { + String have = iter.hasNext() ? iter.next() : "[EOF]"; + if (want.equals(have)) continue; + System.err.println("want line: "+want); + System.err.println("have line: "+have); + throw new AssertionError("unexpected output: "+have); + } + if (iter.hasNext()) + throw new AssertionError("unexpected output: "+iter.next()); + } + private static final String[] EXPECT_OUTPUT = { + "Printing some argument lists, starting with a empty one:", + "[InvokeDynamicPrintArgs, nothing, ()void][]", + "[InvokeDynamicPrintArgs, bar, (java.lang.String,int)void, class java.lang.Void, void type!, 1, 234.5, 67.5, 89][bar arg, 1]", + "[InvokeDynamicPrintArgs, bar2, (java.lang.String,int)void, class java.lang.Void, void type!, 1, 234.5, 67.5, 89][bar2 arg, 222]", + "[InvokeDynamicPrintArgs, baz, (java.lang.String,int,double)void, 1234.5][baz arg, 2, 3.14]", + "[InvokeDynamicPrintArgs, foo, (java.lang.String)void][foo arg]", + "Done printing argument lists." + }; + + private static void printArgs(Object bsmInfo, Object... args) { + System.out.println(bsmInfo+Arrays.deepToString(args)); + } + private static MethodHandle MH_printArgs() throws ReflectiveOperationException { + shouldNotCallThis(); + return lookup().findStatic(lookup().lookupClass(), + "printArgs", methodType(void.class, Object.class, Object[].class)); + } + + private static CallSite bsm(Lookup caller, String name, MethodType type) throws ReflectiveOperationException { + // ignore caller and name, but match the type: + Object bsmInfo = Arrays.asList(caller, name, type); + return new ConstantCallSite(MH_printArgs().bindTo(bsmInfo).asCollector(Object[].class, type.parameterCount()).asType(type)); + } + private static MethodType MT_bsm() { + shouldNotCallThis(); + return methodType(CallSite.class, Lookup.class, String.class, MethodType.class); + } + private static MethodHandle MH_bsm() throws ReflectiveOperationException { + shouldNotCallThis(); + return lookup().findStatic(lookup().lookupClass(), "bsm", MT_bsm()); + } + + private static CallSite bsm2(Lookup caller, String name, MethodType type, Object arg) throws ReflectiveOperationException { + // ignore caller and name, but match the type: + List bsmInfo = new ArrayList<>(Arrays.asList(caller, name, type)); + if (arg instanceof Object[]) + bsmInfo.addAll(Arrays.asList((Object[])arg)); + else + bsmInfo.add(arg); + return new ConstantCallSite(MH_printArgs().bindTo(bsmInfo).asCollector(Object[].class, type.parameterCount()).asType(type)); + } + private static MethodType MT_bsm2() { + shouldNotCallThis(); + return methodType(CallSite.class, Lookup.class, String.class, MethodType.class, Object.class); + } + private static MethodHandle MH_bsm2() throws ReflectiveOperationException { + shouldNotCallThis(); + return lookup().findStatic(lookup().lookupClass(), "bsm2", MT_bsm2()); + } + + private static MethodHandle INDY_nothing() throws Throwable { + shouldNotCallThis(); + return ((CallSite) MH_bsm().invokeGeneric(lookup(), + "nothing", methodType(void.class) + )).dynamicInvoker(); + } + private static MethodHandle INDY_foo() throws Throwable { + shouldNotCallThis(); + return ((CallSite) MH_bsm().invokeGeneric(lookup(), + "foo", methodType(void.class, String.class) + )).dynamicInvoker(); + } + private static MethodHandle INDY_bar() throws Throwable { + shouldNotCallThis(); + return ((CallSite) MH_bsm2().invokeGeneric(lookup(), + "bar", methodType(void.class, String.class, int.class) + , new Object[] { Void.class, "void type!", + 1, 234.5F, 67.5, (long)89 } + )).dynamicInvoker(); + } + private static MethodHandle INDY_bar2() throws Throwable { + shouldNotCallThis(); + return ((CallSite) MH_bsm2().invokeGeneric(lookup(), + "bar2", methodType(void.class, String.class, int.class) + , new Object[] { Void.class, "void type!", + 1, 234.5F, 67.5, (long)89 } + )).dynamicInvoker(); + } + private static MethodHandle INDY_baz() throws Throwable { + shouldNotCallThis(); + return ((CallSite) MH_bsm2().invokeGeneric(lookup(), + "baz", methodType(void.class, String.class, int.class, double.class) + , 1234.5 + )).dynamicInvoker(); + } + + private static void shouldNotCallThis() { + // if this gets called, the transformation has not taken place + if (System.getProperty("InvokeDynamicPrintArgs.allow-untransformed") != null) return; + throw new AssertionError("this code should be statically transformed away by Indify"); + } +} diff --git a/jdk/test/java/dyn/InvokeGenericTest.java b/jdk/test/java/dyn/InvokeGenericTest.java new file mode 100644 index 00000000000..12670668c7e --- /dev/null +++ b/jdk/test/java/dyn/InvokeGenericTest.java @@ -0,0 +1,484 @@ +/* + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @summary unit tests for java.dyn.MethodHandle.invokeGeneric + * @compile -XDallowTransitionalJSR292=no -target 7 InvokeGenericTest.java + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.dyn.InvokeGenericTest + */ + +package test.java.dyn; + +import java.dyn.*; +import static java.dyn.MethodHandles.*; +import static java.dyn.MethodType.*; +import java.lang.reflect.*; +import java.util.*; +import org.junit.*; +import static org.junit.Assert.*; +import static org.junit.Assume.*; + + +/** + * + * @author jrose + */ +public class InvokeGenericTest { + // How much output? + static int verbosity = 0; + static { + String vstr = System.getProperty("test.java.dyn.InvokeGenericTest.verbosity"); + if (vstr != null) verbosity = Integer.parseInt(vstr); + } + + @Test + public void testFirst() throws Throwable { + verbosity += 9; try { + // left blank for debugging + } finally { printCounts(); verbosity -= 9; } + } + + public InvokeGenericTest() { + } + + @Before + public void checkImplementedPlatform() { + boolean platformOK = false; + Properties properties = System.getProperties(); + String vers = properties.getProperty("java.vm.version"); + String name = properties.getProperty("java.vm.name"); + String arch = properties.getProperty("os.arch"); + if ((arch.equals("amd64") || arch.equals("i386") || arch.equals("x86") || + arch.equals("sparc") || arch.equals("sparcv9")) && + (name.contains("Client") || name.contains("Server")) + ) { + platformOK = true; + } else { + System.err.println("Skipping tests for unsupported platform: "+Arrays.asList(vers, name, arch)); + } + assumeTrue(platformOK); + } + + String testName; + static int allPosTests, allNegTests; + int posTests, negTests; + @After + public void printCounts() { + if (verbosity >= 2 && (posTests | negTests) != 0) { + System.out.println(); + if (posTests != 0) System.out.println("=== "+testName+": "+posTests+" positive test cases run"); + if (negTests != 0) System.out.println("=== "+testName+": "+negTests+" negative test cases run"); + allPosTests += posTests; + allNegTests += negTests; + posTests = negTests = 0; + } + } + void countTest(boolean positive) { + if (positive) ++posTests; + else ++negTests; + } + void countTest() { countTest(true); } + void startTest(String name) { + if (testName != null) printCounts(); + if (verbosity >= 1) + System.out.println(name); + posTests = negTests = 0; + testName = name; + } + + @BeforeClass + public static void setUpClass() throws Exception { + calledLog.clear(); + calledLog.add(null); + nextArgVal = INITIAL_ARG_VAL; + } + + @AfterClass + public static void tearDownClass() throws Exception { + int posTests = allPosTests, negTests = allNegTests; + if (verbosity >= 2 && (posTests | negTests) != 0) { + System.out.println(); + if (posTests != 0) System.out.println("=== "+posTests+" total positive test cases"); + if (negTests != 0) System.out.println("=== "+negTests+" total negative test cases"); + } + } + + static List calledLog = new ArrayList(); + static Object logEntry(String name, Object... args) { + return Arrays.asList(name, Arrays.asList(args)); + } + static Object called(String name, Object... args) { + Object entry = logEntry(name, args); + calledLog.add(entry); + return entry; + } + static void assertCalled(String name, Object... args) { + Object expected = logEntry(name, args); + Object actual = calledLog.get(calledLog.size() - 1); + if (expected.equals(actual) && verbosity < 9) return; + System.out.println("assertCalled "+name+":"); + System.out.println("expected: "+expected); + System.out.println("actual: "+actual); + System.out.println("ex. types: "+getClasses(expected)); + System.out.println("act. types: "+getClasses(actual)); + assertEquals("previous method call", expected, actual); + } + static void printCalled(MethodHandle target, String name, Object... args) { + if (verbosity >= 3) + System.out.println("calling MH="+target+" to "+name+Arrays.toString(args)); + } + + static Object castToWrapper(Object value, Class dst) { + Object wrap = null; + if (value instanceof Number) + wrap = castToWrapperOrNull(((Number)value).longValue(), dst); + if (value instanceof Character) + wrap = castToWrapperOrNull((char)(Character)value, dst); + if (wrap != null) return wrap; + return dst.cast(value); + } + + static Object castToWrapperOrNull(long value, Class dst) { + if (dst == int.class || dst == Integer.class) + return (int)(value); + if (dst == long.class || dst == Long.class) + return (long)(value); + if (dst == char.class || dst == Character.class) + return (char)(value); + if (dst == short.class || dst == Short.class) + return (short)(value); + if (dst == float.class || dst == Float.class) + return (float)(value); + if (dst == double.class || dst == Double.class) + return (double)(value); + if (dst == byte.class || dst == Byte.class) + return (byte)(value); + if (dst == boolean.class || dst == boolean.class) + return ((value % 29) & 1) == 0; + return null; + } + + static final int ONE_MILLION = (1000*1000), // first int value + TEN_BILLION = (10*1000*1000*1000), // scale factor to reach upper 32 bits + INITIAL_ARG_VAL = ONE_MILLION << 1; // <<1 makes space for sign bit; + static long nextArgVal; + static long nextArg(boolean moreBits) { + long val = nextArgVal++; + long sign = -(val & 1); // alternate signs + val >>= 1; + if (moreBits) + // Guarantee some bits in the high word. + // In any case keep the decimal representation simple-looking, + // with lots of zeroes, so as not to make the printed decimal + // strings unnecessarily noisy. + val += (val % ONE_MILLION) * TEN_BILLION; + return val ^ sign; + } + static int nextArg() { + // Produce a 32-bit result something like ONE_MILLION+(smallint). + // Example: 1_000_042. + return (int) nextArg(false); + } + static long nextArg(Class kind) { + if (kind == long.class || kind == Long.class || + kind == double.class || kind == Double.class) + // produce a 64-bit result something like + // ((TEN_BILLION+1) * (ONE_MILLION+(smallint))) + // Example: 10_000_420_001_000_042. + return nextArg(true); + return (long) nextArg(); + } + + static Object randomArg(Class param) { + Object wrap = castToWrapperOrNull(nextArg(param), param); + if (wrap != null) { + return wrap; + } +// import sun.dyn.util.Wrapper; +// Wrapper wrap = Wrapper.forBasicType(dst); +// if (wrap == Wrapper.OBJECT && Wrapper.isWrapperType(dst)) +// wrap = Wrapper.forWrapperType(dst); +// if (wrap != Wrapper.OBJECT) +// return wrap.wrap(nextArg++); + if (param.isInterface()) { + for (Class c : param.getClasses()) { + if (param.isAssignableFrom(c) && !c.isInterface()) + { param = c; break; } + } + } + if (param.isInterface() || param.isAssignableFrom(String.class)) + return "#"+nextArg(); + else + try { + return param.newInstance(); + } catch (InstantiationException ex) { + } catch (IllegalAccessException ex) { + } + return null; // random class not Object, String, Integer, etc. + } + static Object[] randomArgs(Class... params) { + Object[] args = new Object[params.length]; + for (int i = 0; i < args.length; i++) + args[i] = randomArg(params[i]); + return args; + } + static Object[] randomArgs(int nargs, Class param) { + Object[] args = new Object[nargs]; + for (int i = 0; i < args.length; i++) + args[i] = randomArg(param); + return args; + } + + static final Object ANON_OBJ = new Object(); + static Object zeroArg(Class param) { + Object x = castToWrapperOrNull(0L, param); + if (x != null) return x; + if (param.isInterface() || param.isAssignableFrom(String.class)) return "\"\""; + if (param == Object.class) return ANON_OBJ; + if (param.getComponentType() != null) return Array.newInstance(param.getComponentType(), 0); + return null; + } + static Object[] zeroArgs(Class... params) { + Object[] args = new Object[params.length]; + for (int i = 0; i < args.length; i++) + args[i] = zeroArg(params[i]); + return args; + } + static Object[] zeroArgs(List> params) { + return zeroArgs(params.toArray(new Class[0])); + } + + static T[] array(Class atype, E... a) { + return Arrays.copyOf(a, a.length, atype); + } + static T[] cat(T[] a, T... b) { + int alen = a.length, blen = b.length; + if (blen == 0) return a; + T[] c = Arrays.copyOf(a, alen + blen); + System.arraycopy(b, 0, c, alen, blen); + return c; + } + static Integer[] boxAll(int... vx) { + Integer[] res = new Integer[vx.length]; + for (int i = 0; i < res.length; i++) { + res[i] = vx[i]; + } + return res; + } + static Object getClasses(Object x) { + if (x == null) return x; + if (x instanceof String) return x; // keep the name + if (x instanceof List) { + // recursively report classes of the list elements + Object[] xa = ((List)x).toArray(); + for (int i = 0; i < xa.length; i++) + xa[i] = getClasses(xa[i]); + return Arrays.asList(xa); + } + return x.getClass().getSimpleName(); + } + + static MethodHandle changeArgTypes(MethodHandle target, Class argType) { + return changeArgTypes(target, 0, 999, argType); + } + static MethodHandle changeArgTypes(MethodHandle target, + int beg, int end, Class argType) { + MethodType targetType = target.type(); + end = Math.min(end, targetType.parameterCount()); + ArrayList> argTypes = new ArrayList>(targetType.parameterList()); + Collections.fill(argTypes.subList(beg, end), argType); + MethodType ttype2 = MethodType.methodType(targetType.returnType(), argTypes); + return MethodHandles.convertArguments(target, ttype2); + } + + // This lookup is good for all members in and under InvokeGenericTest. + static final Lookup LOOKUP = MethodHandles.lookup(); + + Map>, MethodHandle> CALLABLES = new HashMap>, MethodHandle>(); + MethodHandle callable(List> params) { + MethodHandle mh = CALLABLES.get(params); + if (mh == null) { + mh = collectArguments(collector_MH, methodType(Object.class, params)); + CALLABLES.put(params, mh); + } + return mh; + } + MethodHandle callable(Class... params) { + return callable(Arrays.asList(params)); + } + private static Object collector(Object... args) { + return Arrays.asList(args); + } + private static final MethodHandle collector_MH; + static { + try { + collector_MH + = LOOKUP.findStatic(LOOKUP.lookupClass(), + "collector", + methodType(Object.class, Object[].class)); + } catch (NoAccessException ex) { + throw new RuntimeException(ex); + } + } + + @Test + public void testSimple() throws Throwable { + startTest("testSimple"); + countTest(); + String[] args = { "one", "two" }; + MethodHandle mh = callable(Object.class, String.class); + Object res; List resl; + res = resl = (List) mh.invokeGeneric((String)args[0], (Object)args[1]); + //System.out.println(res); + assertEquals(Arrays.asList(args), res); + } + + @Test + public void testWrongArgumentCount() throws Throwable { + startTest("testWrongArgumentCount"); + for (int i = 0; i <= 10; i++) { + testWrongArgumentCount(Collections.>nCopies(i, Integer.class)); + if (i <= 4) { + testWrongArgumentCount(Collections.>nCopies(i, int.class)); + testWrongArgumentCount(Collections.>nCopies(i, long.class)); + } + } + } + public void testWrongArgumentCount(List> params) throws Throwable { + int max = params.size(); + for (int i = 0; i < max; i++) { + List> params2 = params.subList(0, i); + for (int k = 0; k <= 2; k++) { + if (k == 1) params = methodType(Object.class, params).generic().parameterList(); + if (k == 2) params2 = methodType(Object.class, params2).generic().parameterList(); + testWrongArgumentCount(params, params2); + testWrongArgumentCount(params2, params); + } + } + } + public void testWrongArgumentCount(List> expect, List> observe) throws Throwable { + countTest(false); + if (expect.equals(observe)) + assert(false); + MethodHandle target = callable(expect); + Object[] args = zeroArgs(observe); + Object junk; + try { + switch (args.length) { + case 0: + junk = target.invokeGeneric(); break; + case 1: + junk = target.invokeGeneric(args[0]); break; + case 2: + junk = target.invokeGeneric(args[0], args[1]); break; + case 3: + junk = target.invokeGeneric(args[0], args[1], args[2]); break; + case 4: + junk = target.invokeGeneric(args[0], args[1], args[2], args[3]); break; + default: + junk = target.invokeWithArguments(args); break; + } + } catch (WrongMethodTypeException ex) { + return; + } catch (Exception ex) { + throw new RuntimeException("wrong exception calling "+target+target.type()+" on "+Arrays.asList(args)+" : "+ex); + } + throw new RuntimeException("bad success calling "+target+target.type()+" on "+Arrays.asList(args)); + } + + /** Make a list of all combinations of the given types, with the given arities. + * A void return type is possible iff the first type is void.class. + */ + static List allMethodTypes(int minargc, int maxargc, Class... types) { + ArrayList result = new ArrayList(); + if (types.length > 0) { + ArrayList argcTypes = new ArrayList(); + // build arity-zero types first + for (Class rtype : types) { + argcTypes.add(MethodType.methodType(rtype)); + } + if (types[0] == void.class) + // void is not an argument type + types = Arrays.copyOfRange(types, 1, types.length); + for (int argc = 0; argc <= maxargc; argc++) { + if (argc >= minargc) + result.addAll(argcTypes); + if (argc >= maxargc) + break; + ArrayList prevTypes = argcTypes; + argcTypes = new ArrayList(); + for (MethodType prevType : prevTypes) { + for (Class ptype : types) { + argcTypes.add(prevType.insertParameterTypes(argc, ptype)); + } + } + } + } + return Collections.unmodifiableList(result); + } + static List allMethodTypes(int argc, Class... types) { + return allMethodTypes(argc, argc, types); + } + + interface RandomInterface { } + + MethodHandle toString_MH; + + @Test + public void testReferenceConversions() throws Throwable { + startTest("testReferenceConversions"); + toString_MH = LOOKUP. + findVirtual(Object.class, "toString", MethodType.methodType(String.class)); + String[] args = { "one", "two" }; + for (MethodType type : allMethodTypes(2, Object.class, String.class, RandomInterface.class)) { + testReferenceConversions(type, args); + } + } + public void testReferenceConversions(MethodType type, Object... args) throws Throwable { + countTest(); + if (verbosity > 3) System.out.println("target type: "+type); + MethodHandle mh = callable(type.parameterList()); + MethodHandle tsdrop = MethodHandles.dropArguments(toString_MH, 1, type.parameterList()); + mh = MethodHandles.foldArguments(tsdrop, mh); + mh = mh.asType(type); + Object res = mh.invokeGeneric((String)args[0], (Object)args[1]); + //System.out.println(res); + assertEquals(Arrays.asList(args).toString(), res); + } + + + @Test @Ignore("known failure pending 6939861") + public void testBoxConversions() throws Throwable { + startTest("testBoxConversions"); + countTest(); + Integer[] args = { 1, 2 }; + MethodHandle mh = callable(Object.class, int.class); + Object res; List resl; + res = resl = (List) mh.invokeGeneric((int)args[0], (Object)args[1]); + //System.out.println(res); + assertEquals(Arrays.asList(args), res); + } + +} diff --git a/jdk/test/java/dyn/JavaDocExamplesTest.java b/jdk/test/java/dyn/JavaDocExamplesTest.java new file mode 100644 index 00000000000..9cb41f9fcec --- /dev/null +++ b/jdk/test/java/dyn/JavaDocExamplesTest.java @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @summary example code used in javadoc for java.dyn API + * @compile -XDallowTransitionalJSR292=no JavaDocExamplesTest.java + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.dyn.JavaDocExamplesTest + */ + +/* +---- To run outside jtreg: +$ $JAVA7X_HOME/bin/javac -cp $JUNIT4_JAR -d /tmp/Classes \ + $DAVINCI/sources/jdk/test/java/dyn/JavaDocExamplesTest.java +$ $JAVA7X_HOME/bin/java -cp $JUNIT4_JAR:/tmp/Classes \ + -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles \ + -Dtest.java.dyn.JavaDocExamplesTest.verbosity=1 \ + test.java.dyn.JavaDocExamplesTest +---- +*/ + +package test.java.dyn; + +import java.dyn.*; +import static java.dyn.MethodHandles.*; +import static java.dyn.MethodType.*; + +import java.lang.reflect.*; +import java.util.*; + +import org.junit.*; +import static org.junit.Assert.*; +import static org.junit.Assume.*; + + +/** + * @author jrose + */ +public class JavaDocExamplesTest { + /** Wrapper for running the JUnit tests in this module. + * Put JUnit on the classpath! + */ + public static void main(String... ignore) { + org.junit.runner.JUnitCore.runClasses(JavaDocExamplesTest.class); + } + // How much output? + static int verbosity = Integer.getInteger("test.java.dyn.JavaDocExamplesTest.verbosity", 0); + +{} +static final private Lookup LOOKUP = lookup(); +// static final private MethodHandle CONCAT_1 = LOOKUP.findVirtual(String.class, +// "concat", methodType(String.class, String.class)); +// static final private MethodHandle HASHCODE_1 = LOOKUP.findVirtual(Object.class, +// "hashCode", methodType(int.class)); + +// form required if NoAccessException is intercepted: +static final private MethodHandle CONCAT_2, HASHCODE_2; +static { + try { + CONCAT_2 = LOOKUP.findVirtual(String.class, + "concat", methodType(String.class, String.class)); + HASHCODE_2 = LOOKUP.findVirtual(Object.class, + "hashCode", methodType(int.class)); + } catch (NoAccessException ex) { + throw new RuntimeException(ex); + } +} +{} + + @Test public void testFindVirtual() throws Throwable { +{} +MethodHandle CONCAT_3 = LOOKUP.findVirtual(String.class, + "concat", methodType(String.class, String.class)); +MethodHandle HASHCODE_3 = LOOKUP.findVirtual(Object.class, + "hashCode", methodType(int.class)); +//assertEquals("xy", (String) CONCAT_1.invokeExact("x", "y")); +assertEquals("xy", (String) CONCAT_2.invokeExact("x", "y")); +assertEquals("xy", (String) CONCAT_3.invokeExact("x", "y")); +//assertEquals("xy".hashCode(), (int) HASHCODE_1.invokeExact((Object)"xy")); +assertEquals("xy".hashCode(), (int) HASHCODE_2.invokeExact((Object)"xy")); +assertEquals("xy".hashCode(), (int) HASHCODE_3.invokeExact((Object)"xy")); +{} + } + @Test public void testDropArguments() throws Throwable { + {{ +{} /// JAVADOC +MethodHandle cat = lookup().findVirtual(String.class, + "concat", methodType(String.class, String.class)); +assertEquals("xy", (String) cat.invokeExact("x", "y")); +MethodHandle d0 = dropArguments(cat, 0, String.class); +assertEquals("yz", (String) d0.invokeExact("x", "y", "z")); +MethodHandle d1 = dropArguments(cat, 1, String.class); +assertEquals("xz", (String) d1.invokeExact("x", "y", "z")); +MethodHandle d2 = dropArguments(cat, 2, String.class); +assertEquals("xy", (String) d2.invokeExact("x", "y", "z")); +MethodHandle d12 = dropArguments(cat, 1, int.class, boolean.class); +assertEquals("xz", (String) d12.invokeExact("x", 12, true, "z")); + }} + } + + @Test public void testFilterArguments() throws Throwable { + {{ +{} /// JAVADOC +MethodHandle cat = lookup().findVirtual(String.class, + "concat", methodType(String.class, String.class)); +MethodHandle upcase = lookup().findVirtual(String.class, + "toUpperCase", methodType(String.class)); +assertEquals("xy", (String) cat.invokeExact("x", "y")); +MethodHandle f0 = filterArguments(cat, 0, upcase); +assertEquals("Xy", (String) f0.invokeExact("x", "y")); // Xy +MethodHandle f1 = filterArguments(cat, 1, upcase); +assertEquals("xY", (String) f1.invokeExact("x", "y")); // xY +MethodHandle f2 = filterArguments(cat, 0, upcase, upcase); +assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY + }} + } + + static void assertEquals(Object exp, Object act) { + if (verbosity > 0) + System.out.println("result: "+act); + Assert.assertEquals(exp, act); + } + +static MethodHandle asList; + @Test public void testWithTypeHandler() throws Throwable { + {{ +{} /// JAVADOC +MethodHandle makeEmptyList = MethodHandles.constant(List.class, Arrays.asList()); +MethodHandle asList = lookup() + .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class)); + +JavaDocExamplesTest.asList = asList; +/* +static MethodHandle collectingTypeHandler(MethodHandle base, MethodType newType) { + return asList.asCollector(Object[].class, newType.parameterCount()).asType(newType); +} +*/ + +MethodHandle collectingTypeHandler = lookup() + .findStatic(lookup().lookupClass(), "collectingTypeHandler", + methodType(MethodHandle.class, MethodHandle.class, MethodType.class)); +MethodHandle makeAnyList = makeEmptyList.withTypeHandler(collectingTypeHandler); + +assertEquals("[]", makeAnyList.invokeGeneric().toString()); +assertEquals("[1]", makeAnyList.invokeGeneric(1).toString()); +assertEquals("[two, too]", makeAnyList.invokeGeneric("two", "too").toString()); + }} + } + +static MethodHandle collectingTypeHandler(MethodHandle base, MethodType newType) { + //System.out.println("Converting "+asList+" to "+newType); + MethodHandle conv = asList.asCollector(Object[].class, newType.parameterCount()).asType(newType); + //System.out.println(" =>"+conv); + return conv; +} + +} diff --git a/jdk/test/java/dyn/MethodHandlesTest.java b/jdk/test/java/dyn/MethodHandlesTest.java index 3b33cef0e01..e92bc6dbae4 100644 --- a/jdk/test/java/dyn/MethodHandlesTest.java +++ b/jdk/test/java/dyn/MethodHandlesTest.java @@ -25,8 +25,8 @@ /* @test * @summary unit tests for java.dyn.MethodHandles - * @compile -XDinvokedynamic MethodHandlesTest.java - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic test.java.dyn.MethodHandlesTest + * @compile -source 7 -target 7 -XDallowTransitionalJSR292=no MethodHandlesTest.java + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.dyn.MethodHandlesTest */ package test.java.dyn; @@ -62,7 +62,6 @@ public class MethodHandlesTest { // lookups, without exercising the actual method handle. static boolean DO_MORE_CALLS = true; - @Test public void testFirst() throws Throwable { verbosity += 9; try { @@ -265,6 +264,12 @@ public class MethodHandlesTest { // wrap = Wrapper.forWrapperType(dst); // if (wrap != Wrapper.OBJECT) // return wrap.wrap(nextArg++); + if (param.isInterface()) { + for (Class c : param.getClasses()) { + if (param.isAssignableFrom(c) && !c.isInterface()) + { param = c; break; } + } + } if (param.isInterface() || param.isAssignableFrom(String.class)) return "#"+nextArg(); else @@ -380,7 +385,7 @@ public class MethodHandlesTest { } public static interface IntExample { public void v0(); - static class Impl implements IntExample { + public static class Impl implements IntExample { public void v0() { called("Int/v0", this); } final String name; public Impl() { name = "Impl#"+nextArg(); } @@ -449,10 +454,10 @@ public class MethodHandlesTest { countTest(positive); MethodType type = MethodType.methodType(ret, params); MethodHandle target = null; - RuntimeException noAccess = null; + Exception noAccess = null; try { if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type); - target = lookup.findStatic(defc, name, type); + target = lookup.in(defc).findStatic(defc, name, type); } catch (NoAccessException ex) { noAccess = ex; } @@ -463,16 +468,22 @@ public class MethodHandlesTest { assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null); if (!positive) return; // negative test failed as expected assertEquals(type, target.type()); - assertTrue(target.toString().contains(name)); // rough check + assertNameStringContains(target, name); if (!DO_MORE_CALLS && lookup != PRIVATE) return; Object[] args = randomArgs(params); printCalled(target, name, args); - target.invokeVarargs(args); + target.invokeWithArguments(args); assertCalled(name, args); if (verbosity >= 1) System.out.print(':'); } + // rough check of name string + static void assertNameStringContains(Object x, String s) { + if (x.toString().contains(s)) return; + assertEquals(s, x); + } + @Test public void testFindVirtual() throws Throwable { if (CAN_SKIP_WORKING) return; @@ -513,10 +524,10 @@ public class MethodHandlesTest { String methodName = name.substring(1 + name.indexOf('/')); // foo/bar => foo MethodType type = MethodType.methodType(ret, params); MethodHandle target = null; - RuntimeException noAccess = null; + Exception noAccess = null; try { if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type); - target = lookup.findVirtual(defc, methodName, type); + target = lookup.in(defc).findVirtual(defc, methodName, type); } catch (NoAccessException ex) { noAccess = ex; } @@ -529,12 +540,12 @@ public class MethodHandlesTest { Class[] paramsWithSelf = cat(array(Class[].class, (Class)defc), params); MethodType typeWithSelf = MethodType.methodType(ret, paramsWithSelf); assertEquals(typeWithSelf, target.type()); - assertTrue(target.toString().contains(methodName)); // rough check + assertNameStringContains(target, methodName); if (!DO_MORE_CALLS && lookup != PRIVATE) return; Object[] argsWithSelf = randomArgs(paramsWithSelf); if (rcvc != defc) argsWithSelf[0] = randomArg(rcvc); printCalled(target, name, argsWithSelf); - target.invokeVarargs(argsWithSelf); + target.invokeWithArguments(argsWithSelf); assertCalled(name, argsWithSelf); if (verbosity >= 1) System.out.print(':'); @@ -567,10 +578,11 @@ public class MethodHandlesTest { countTest(positive); MethodType type = MethodType.methodType(ret, params); MethodHandle target = null; - RuntimeException noAccess = null; + Exception noAccess = null; try { if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type); - target = lookup.findSpecial(defc, name, type, specialCaller); + if (verbosity >= 5) System.out.println(" lookup => "+lookup.in(specialCaller)); + target = lookup.in(specialCaller).findSpecial(defc, name, type, specialCaller); } catch (NoAccessException ex) { noAccess = ex; } @@ -585,11 +597,11 @@ public class MethodHandlesTest { assertEquals(type, target.type().dropParameterTypes(0,1)); Class[] paramsWithSelf = cat(array(Class[].class, (Class)specialCaller), params); MethodType typeWithSelf = MethodType.methodType(ret, paramsWithSelf); - assertTrue(target.toString().contains(name)); // rough check + assertNameStringContains(target, name); if (!DO_MORE_CALLS && lookup != PRIVATE && lookup != EXAMPLE) return; Object[] args = randomArgs(paramsWithSelf); printCalled(target, name, args); - target.invokeVarargs(args); + target.invokeWithArguments(args); assertCalled(name, args); } @@ -623,10 +635,10 @@ public class MethodHandlesTest { MethodType type = MethodType.methodType(ret, params); Object receiver = randomArg(defc); MethodHandle target = null; - RuntimeException noAccess = null; + Exception noAccess = null; try { if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type); - target = lookup.bind(receiver, methodName, type); + target = lookup.in(defc).bind(receiver, methodName, type); } catch (NoAccessException ex) { noAccess = ex; } @@ -639,7 +651,7 @@ public class MethodHandlesTest { assertEquals(type, target.type()); Object[] args = randomArgs(params); printCalled(target, name, args); - target.invokeVarargs(args); + target.invokeWithArguments(args); Object[] argsWithReceiver = cat(array(Object[].class, receiver), args); assertCalled(name, argsWithReceiver); if (verbosity >= 1) @@ -688,7 +700,7 @@ public class MethodHandlesTest { MethodType type = MethodType.methodType(ret, params); Method rmethod = null; MethodHandle target = null; - RuntimeException noAccess = null; + Exception noAccess = null; try { rmethod = defc.getDeclaredMethod(name, params); } catch (NoSuchMethodException ex) { @@ -699,9 +711,9 @@ public class MethodHandlesTest { try { if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type); if (isSpecial) - target = lookup.unreflectSpecial(rmethod, specialCaller); + target = lookup.in(specialCaller).unreflectSpecial(rmethod, specialCaller); else - target = lookup.unreflect(rmethod); + target = lookup.in(defc).unreflect(rmethod); } catch (NoAccessException ex) { noAccess = ex; } @@ -731,7 +743,7 @@ public class MethodHandlesTest { } Object[] argsMaybeWithSelf = randomArgs(paramsMaybeWithSelf); printCalled(target, name, argsMaybeWithSelf); - target.invokeVarargs(argsMaybeWithSelf); + target.invokeWithArguments(argsMaybeWithSelf); assertCalled(name, argsMaybeWithSelf); if (verbosity >= 1) System.out.print(':'); @@ -869,7 +881,7 @@ public class MethodHandlesTest { if (isStatic) expType = expType.dropParameterTypes(0, 1); MethodHandle mh = lookup.unreflectGetter(f); assertSame(mh.type(), expType); - assertEquals(mh.toString(), fname); + assertNameStringContains(mh, fname); HasFields fields = new HasFields(); Object sawValue; Class rtype = type; @@ -879,12 +891,12 @@ public class MethodHandlesTest { for (int i = 0; i <= 1; i++) { if (isStatic) { if (type == int.class) - sawValue = mh.invokeExact(); // do these exactly + sawValue = (int) mh.invokeExact(); // do these exactly else sawValue = mh.invokeExact(); } else { if (type == int.class) - sawValue = mh.invokeExact((Object) fields); + sawValue = (int) mh.invokeExact((Object) fields); else sawValue = mh.invokeExact((Object) fields); } @@ -941,7 +953,7 @@ public class MethodHandlesTest { mh = lookup.findStaticSetter(fclass, fname, ftype); else throw new InternalError(); assertSame(mh.type(), expType); - assertEquals(mh.toString(), fname); + assertNameStringContains(mh, fname); HasFields fields = new HasFields(); Object sawValue; Class vtype = type; @@ -953,14 +965,14 @@ public class MethodHandlesTest { Object putValue = randomArg(type); if (isStatic) { if (type == int.class) - mh.invokeExact((int)(Integer)putValue); // do these exactly + mh.invokeExact((int)putValue); // do these exactly else - mh.invokeExact(putValue); + mh.invokeExact(putValue); } else { if (type == int.class) - mh.invokeExact((Object) fields, (int)(Integer)putValue); + mh.invokeExact((Object) fields, (int)putValue); else - mh.invokeExact((Object) fields, putValue); + mh.invokeExact((Object) fields, putValue); } assertEquals(f.get(fields), putValue); } @@ -1026,11 +1038,11 @@ public class MethodHandlesTest { model.set(i, random); if (testSetter) { if (elemType == int.class) - mh.invokeExact((int[]) array, i, (int)(Integer)random); + mh.invokeExact((int[]) array, i, (int)random); else if (elemType == boolean.class) - mh.invokeExact((boolean[]) array, i, (boolean)(Boolean)random); + mh.invokeExact((boolean[]) array, i, (boolean)random); else - mh.invokeExact(array, i, random); + mh.invokeExact(array, i, random); assertEquals(model, array2list(array)); } else { Array.set(array, i, random); @@ -1046,9 +1058,9 @@ public class MethodHandlesTest { if (!testSetter) { expValue = sawValue; if (elemType == int.class) - sawValue = mh.invokeExact((int[]) array, i); + sawValue = (int) mh.invokeExact((int[]) array, i); else if (elemType == boolean.class) - sawValue = mh.invokeExact((boolean[]) array, i); + sawValue = (boolean) mh.invokeExact((boolean[]) array, i); else sawValue = mh.invokeExact(array, i); assertEquals(sawValue, expValue); @@ -1088,10 +1100,26 @@ public class MethodHandlesTest { if (rtype != Object.class) pfx = rtype.getSimpleName().substring(0, 1).toLowerCase(); String name = pfx+"id"; - return PRIVATE.findStatic(Callee.class, name, type); + try { + return PRIVATE.findStatic(Callee.class, name, type); + } catch (Exception ex) { + throw new RuntimeException(ex); + } } } + static MethodHandle typeHandler2(MethodHandle target, MethodType newType) { + MethodType oldType = target.type(); + int oldArity = oldType.parameterCount(); + int newArity = newType.parameterCount(); + if (newArity < oldArity) + return MethodHandles.insertArguments(target, oldArity, "OPTIONAL"); + else if (newArity > oldArity) + return MethodHandles.dropArguments(target, oldArity-1, newType.parameterType(oldArity-1)); + else + return target; // attempt no further conversions + } + @Test public void testConvertArguments() throws Throwable { if (CAN_SKIP_WORKING) return; @@ -1105,10 +1133,29 @@ public class MethodHandlesTest { } void testConvert(MethodHandle id, Class rtype, String name, Class... params) throws Throwable { - testConvert(true, id, rtype, name, params); + testConvert(true, false, id, rtype, name, params); + testConvert(true, true, id, rtype, name, params); } - void testConvert(boolean positive, MethodHandle id, Class rtype, String name, Class... params) throws Throwable { + @Test + public void testTypeHandler() throws Throwable { + MethodHandle id = Callee.ofType(1); + MethodHandle th2 = PRIVATE.findStatic(MethodHandlesTest.class, "typeHandler2", + MethodType.methodType(MethodHandle.class, MethodHandle.class, MethodType.class)); + MethodHandle id2 = id.withTypeHandler(th2); + testConvert(true, false, id2, null, "id", Object.class); + testConvert(true, true, id2, null, "id", Object.class); + if (true) return; //FIXME + testConvert(true, false, id2, null, "id", String.class); // FIXME: throws WMT + testConvert(false, true, id2, null, "id", String.class); // FIXME: should not succeed + testConvert(false, false, id2, null, "id", Object.class, String.class); //FIXME: array[1] line 1164 + testConvert(true, true, id2, null, "id", Object.class, String.class); + testConvert(false, false, id2, null, "id"); + testConvert(true, true, id2, null, "id"); + } + + void testConvert(boolean positive, boolean useAsType, + MethodHandle id, Class rtype, String name, Class... params) throws Throwable { countTest(positive); MethodType idType = id.type(); if (rtype == null) rtype = idType.returnType(); @@ -1125,7 +1172,7 @@ public class MethodHandlesTest { if (src != dst) convArgs[i] = castToWrapper(convArgs[i], dst); } - Object convResult = id.invokeVarargs(convArgs); + Object convResult = id.invokeWithArguments(convArgs); { Class dst = newType.returnType(); Class src = idType.returnType(); @@ -1135,7 +1182,10 @@ public class MethodHandlesTest { MethodHandle target = null; RuntimeException error = null; try { - target = MethodHandles.convertArguments(id, newType); + if (useAsType) + target = MethodHandles.convertArguments(id, newType); + else + target = id.asType(newType); } catch (RuntimeException ex) { error = ex; } @@ -1147,7 +1197,7 @@ public class MethodHandlesTest { if (!positive) return; // negative test failed as expected assertEquals(newType, target.type()); printCalled(target, id.toString(), args); - Object result = target.invokeVarargs(args); + Object result = target.invokeWithArguments(args); assertCalled(name, convArgs); assertEquals(convResult, result); if (verbosity >= 1) @@ -1269,7 +1319,7 @@ public class MethodHandlesTest { MethodType outType = MethodType.methodType(Object.class, permTypes); MethodHandle target = MethodHandles.convertArguments(ValueConversions.varargsList(outargs), outType); MethodHandle newTarget = MethodHandles.permuteArguments(target, inType, reorder); - Object result = newTarget.invokeVarargs(args); + Object result = newTarget.invokeWithArguments(args); Object expected = Arrays.asList(permArgs); assertEquals(expected, result); } @@ -1301,19 +1351,19 @@ public class MethodHandlesTest { Object[] args = randomArgs(target2.type().parameterArray()); // make sure the target does what we think it does: if (pos == 0 && nargs < 5) { - Object[] check = (Object[]) target.invokeVarargs(args); + Object[] check = (Object[]) target.invokeWithArguments(args); assertArrayEquals(args, check); switch (nargs) { case 0: - check = target.invokeExact(); + check = (Object[]) target.invokeExact(); assertArrayEquals(args, check); break; case 1: - check = target.invokeExact(args[0]); + check = (Object[]) target.invokeExact(args[0]); assertArrayEquals(args, check); break; case 2: - check = target.invokeExact(args[0], args[1]); + check = (Object[]) target.invokeExact(args[0], args[1]); assertArrayEquals(args, check); break; } @@ -1327,11 +1377,15 @@ public class MethodHandlesTest { MethodHandle result = MethodHandles.spreadArguments(target2, newType); Object[] returnValue; if (pos == 0) { - returnValue = (Object[]) result.invokeExact(args); + // In the following line, the first cast implies + // normal Object return value for the MH call (Object[])->Object, + // while the second cast dynamically converts to an Object array. + // Such a double cast is typical of MH.invokeExact. + returnValue = (Object[]) (Object) result.invokeExact(args); } else { Object[] args1 = Arrays.copyOfRange(args, 0, pos+1); args1[pos] = Arrays.copyOfRange(args, pos, args.length); - returnValue = (Object[]) result.invokeVarargs(args1); + returnValue = (Object[]) result.invokeWithArguments(args1); } assertArrayEquals(args, returnValue); } @@ -1368,7 +1422,7 @@ public class MethodHandlesTest { if (verbosity >= 3) System.out.println("collect from "+Arrays.asList(args)+" ["+pos+".."+nargs+"]"); MethodHandle result = MethodHandles.collectArguments(target, newType); - Object[] returnValue = (Object[]) result.invokeVarargs(args); + Object[] returnValue = (Object[]) result.invokeWithArguments(args); // assertTrue(returnValue.length == pos+1 && returnValue[pos] instanceof Object[]); // returnValue[pos] = Arrays.asList((Object[]) returnValue[pos]); // collectedArgs[pos] = Arrays.asList((Object[]) collectedArgs[pos]); @@ -1401,7 +1455,7 @@ public class MethodHandlesTest { MethodHandle target2 = MethodHandles.insertArguments(target, pos, (Object[]) argsToInsert.toArray()); argsToInsert.clear(); // remove from argsToInsert - Object res2 = target2.invokeVarargs(argsToPass); + Object res2 = target2.invokeWithArguments(argsToPass); Object res2List = Arrays.asList((Object[])res2); if (verbosity >= 3) System.out.println("result: "+res2List); @@ -1429,14 +1483,12 @@ public class MethodHandlesTest { Object[] argsToPass = randomArgs(nargs, Object.class); if (verbosity >= 3) System.out.println("filter "+target+" at "+pos+" with "+filter); - MethodHandle[] filters = new MethodHandle[pos*2+1]; - filters[pos] = filter; - MethodHandle target2 = MethodHandles.filterArguments(target, filters); + MethodHandle target2 = MethodHandles.filterArguments(target, pos, filter); // Simulate expected effect of filter on arglist: Object[] filteredArgs = argsToPass.clone(); filteredArgs[pos] = filter.invokeExact(filteredArgs[pos]); List expected = Arrays.asList(filteredArgs); - Object result = target2.invokeVarargs(argsToPass); + Object result = target2.invokeWithArguments(argsToPass); if (verbosity >= 3) System.out.println("result: "+result); if (!expected.equals(result)) @@ -1461,7 +1513,7 @@ public class MethodHandlesTest { if (pos != 0) return; // can fold only at pos=0 for now countTest(); MethodHandle target = ValueConversions.varargsList(1 + nargs); - MethodHandle combine = ValueConversions.varargsList(fold); + MethodHandle combine = ValueConversions.varargsList(fold).asType(MethodType.genericMethodType(fold)); List argsToPass = Arrays.asList(randomArgs(nargs, Object.class)); if (verbosity >= 3) System.out.println("fold "+target+" with "+combine); @@ -1471,9 +1523,9 @@ public class MethodHandlesTest { List argsToFold = expected.subList(pos, pos + fold); if (verbosity >= 3) System.out.println("fold: "+argsToFold+" into "+target2); - Object foldedArgs = combine.invokeVarargs(argsToFold); + Object foldedArgs = combine.invokeWithArguments(argsToFold); argsToFold.add(0, foldedArgs); - Object result = target2.invokeVarargs(argsToPass); + Object result = target2.invokeWithArguments(argsToPass); if (verbosity >= 3) System.out.println("result: "+result); if (!expected.equals(result)) @@ -1505,7 +1557,7 @@ public class MethodHandlesTest { for (int i = drop; i > 0; i--) { argsToDrop.add(pos, "blort#"+i); } - Object res2 = target2.invokeVarargs(argsToDrop); + Object res2 = target2.invokeWithArguments(argsToDrop); Object res2List = Arrays.asList((Object[])res2); //if (!resList.equals(res2List)) // System.out.println("*** fail at n/p/d = "+nargs+"/"+pos+"/"+drop+": "+argsToDrop+" => "+res2List); @@ -1561,7 +1613,7 @@ public class MethodHandlesTest { countTest(); calledLog.clear(); inv = MethodHandles.exactInvoker(type); - result = inv.invokeVarargs(targetPlusArgs); + result = inv.invokeWithArguments(targetPlusArgs); if (testRetCode) assertEquals(code, result); assertCalled("invokee", args); // generic invoker @@ -1587,7 +1639,7 @@ public class MethodHandlesTest { assertCalled("invokee", args); } calledLog.clear(); - result = inv.invokeVarargs(targetPlusArgs); + result = inv.invokeWithArguments(targetPlusArgs); if (testRetCode) assertEquals(code, result); assertCalled("invokee", args); // varargs invoker #0 @@ -1629,17 +1681,29 @@ public class MethodHandlesTest { List tailList = targetPlusVarArgs.subList(1+k, 1+nargs); Object[] tail = tailList.toArray(); tailList.clear(); tailList.add(tail); - result = inv.invokeVarargs(targetPlusVarArgs); + result = inv.invokeWithArguments(targetPlusVarArgs); if (testRetCode) assertEquals(code, result); assertCalled("invokee", args); } + // dynamic invoker countTest(); - CallSite site = new CallSite(MethodHandlesTest.class, "foo", type); - inv = MethodHandles.dynamicInvoker(site); + CallSite site = new MutableCallSite(type); + inv = site.dynamicInvoker(); + + // see if we get the result of the original target: + try { + result = inv.invokeWithArguments(args); + assertTrue("should not reach here", false); + } catch (IllegalStateException ex) { + String msg = ex.getMessage(); + assertTrue(msg, msg.contains("site")); + } + + // set new target after invoker is created, to make sure we track target site.setTarget(target); calledLog.clear(); - result = inv.invokeVarargs(args); + result = inv.invokeWithArguments(args); if (testRetCode) assertEquals(code, result); assertCalled("invokee", args); } @@ -1723,7 +1787,7 @@ public class MethodHandlesTest { String willCall = (equals ? "targetIfEquals" : "fallbackIfNotEquals"); if (verbosity >= 3) System.out.println(logEntry(willCall, argList)); - Object result = mh.invokeVarargs(argList); + Object result = mh.invokeWithArguments(argList); assertCalled(willCall, argList); } } @@ -1756,16 +1820,17 @@ public class MethodHandlesTest { MethodHandle throwOrReturn = PRIVATE.findStatic(MethodHandlesTest.class, "throwOrReturn", MethodType.methodType(Object.class, Object.class, Throwable.class)); - MethodHandle thrower = throwOrReturn; + MethodHandle thrower = throwOrReturn.asType(MethodType.genericMethodType(2)); while (thrower.type().parameterCount() < nargs) thrower = MethodHandles.dropArguments(thrower, thrower.type().parameterCount(), Object.class); + MethodHandle catcher = ValueConversions.varargsList(1+nargs).asType(MethodType.genericMethodType(1+nargs)); MethodHandle target = MethodHandles.catchException(thrower, - thrown.getClass(), ValueConversions.varargsList(1+nargs)); + thrown.getClass(), catcher); assertEquals(thrower.type(), target.type()); //System.out.println("catching with "+target+" : "+throwOrReturn); Object[] args = randomArgs(nargs, Object.class); args[1] = (throwIt ? thrown : null); - Object returned = target.invokeVarargs(args); + Object returned = target.invokeWithArguments(args); //System.out.println("return from "+target+" : "+returned); if (!throwIt) { assertSame(args[0], returned); @@ -1817,8 +1882,10 @@ public class MethodHandlesTest { testCastFailure("unbox/return", 11000); } - static class Surprise extends JavaMethodHandle { - Surprise() { super("value"); } + static class Surprise { + public MethodHandle asMethodHandle() { + return VALUE.bindTo(this); + } Object value(Object x) { trace("value", x); if (boo != null) return boo; @@ -1833,22 +1900,32 @@ public class MethodHandlesTest { static Object refIdentity(Object x) { trace("ref.x", x); return x; } static Integer boxIdentity(Integer x) { trace("box.x", x); return x; } static int intIdentity(int x) { trace("int.x", x); return x; } - static MethodHandle REF_IDENTITY = PRIVATE.findStatic( - Surprise.class, "refIdentity", - MethodType.methodType(Object.class, Object.class)); - static MethodHandle BOX_IDENTITY = PRIVATE.findStatic( - Surprise.class, "boxIdentity", - MethodType.methodType(Integer.class, Integer.class)); - static MethodHandle INT_IDENTITY = PRIVATE.findStatic( - Surprise.class, "intIdentity", - MethodType.methodType(int.class, int.class)); + static MethodHandle VALUE, REF_IDENTITY, BOX_IDENTITY, INT_IDENTITY; + static { + try { + VALUE = PRIVATE.findVirtual( + Surprise.class, "value", + MethodType.methodType(Object.class, Object.class)); + REF_IDENTITY = PRIVATE.findStatic( + Surprise.class, "refIdentity", + MethodType.methodType(Object.class, Object.class)); + BOX_IDENTITY = PRIVATE.findStatic( + Surprise.class, "boxIdentity", + MethodType.methodType(Integer.class, Integer.class)); + INT_IDENTITY = PRIVATE.findStatic( + Surprise.class, "intIdentity", + MethodType.methodType(int.class, int.class)); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } } void testCastFailure(String mode, int okCount) throws Throwable { countTest(false); if (verbosity > 2) System.out.println("mode="+mode); Surprise boo = new Surprise(); - MethodHandle identity = Surprise.REF_IDENTITY, surprise = boo; + MethodHandle identity = Surprise.REF_IDENTITY, surprise0 = boo.asMethodHandle(), surprise = surprise0; if (mode.endsWith("/return")) { if (mode.equals("unbox/return")) { // fail on return to ((Integer)surprise).intValue @@ -1870,11 +1947,11 @@ public class MethodHandlesTest { } if (callee != null) { callee = MethodHandles.convertArguments(callee, MethodType.genericMethodType(1)); - surprise = MethodHandles.filterArguments(callee, surprise); - identity = MethodHandles.filterArguments(callee, identity); + surprise = MethodHandles.filterArguments(callee, 0, surprise); + identity = MethodHandles.filterArguments(callee, 0, identity); } } - assertNotSame(mode, surprise, boo); + assertNotSame(mode, surprise, surprise0); identity = MethodHandles.convertArguments(identity, MethodType.genericMethodType(1)); surprise = MethodHandles.convertArguments(surprise, MethodType.genericMethodType(1)); Object x = 42; @@ -1923,7 +2000,7 @@ public class MethodHandlesTest { assertEquals(mt, mh.type()); assertEquals(Example.class, mh.type().returnType()); args = randomArgs(mh.type().parameterArray()); - mh.invokeVarargs(args); + mh.invokeWithArguments(args); assertCalled(name, args); // Try a virtual method. @@ -1933,9 +2010,110 @@ public class MethodHandlesTest { assertEquals(mt, mh.type().dropParameterTypes(0,1)); assertTrue(mh.type().parameterList().contains(Example.class)); args = randomArgs(mh.type().parameterArray()); - mh.invokeVarargs(args); + mh.invokeWithArguments(args); assertCalled(name, args); } + + static void runForRunnable() { + called("runForRunnable"); + } + private interface Fooable { + Object foo(Fooable x, Object y); + // this is for randomArg: + public class Impl implements Fooable { + public Object foo(Fooable x, Object y) { + throw new RuntimeException("do not call"); + } + final String name; + public Impl() { name = "Fooable#"+nextArg(); } + @Override public String toString() { return name; } + } + } + static Object fooForFooable(Fooable x, Object y) { + return called("fooForFooable", x, y); + } + private static class MyCheckedException extends Exception { + } + private interface WillThrow { + void willThrow() throws MyCheckedException; + } + + @Test + public void testAsInstance() throws Throwable { + if (CAN_SKIP_WORKING) return; + Lookup lookup = MethodHandles.lookup(); + { + MethodType mt = MethodType.methodType(void.class); + MethodHandle mh = lookup.findStatic(MethodHandlesTest.class, "runForRunnable", mt); + Runnable proxy = MethodHandles.asInstance(mh, Runnable.class); + proxy.run(); + assertCalled("runForRunnable"); + } + { + MethodType mt = MethodType.methodType(Object.class, Fooable.class, Object.class); + MethodHandle mh = lookup.findStatic(MethodHandlesTest.class, "fooForFooable", mt); + Fooable proxy = MethodHandles.asInstance(mh, Fooable.class); + Object[] args = randomArgs(mt.parameterArray()); + Object result = proxy.foo((Fooable) args[0], args[1]); + assertCalled("fooForFooable", args); + assertEquals(result, logEntry("fooForFooable", args)); + } + for (Throwable ex : new Throwable[] { new NullPointerException("ok"), + new InternalError("ok"), + new Throwable("fail"), + new Exception("fail"), + new MyCheckedException() + }) { + MethodHandle mh = MethodHandles.throwException(void.class, Throwable.class); + mh = MethodHandles.insertArguments(mh, 0, ex); + WillThrow proxy = MethodHandles.asInstance(mh, WillThrow.class); + try { + proxy.willThrow(); + System.out.println("Failed to throw: "+ex); + assertTrue(false); + } catch (Throwable ex1) { + if (verbosity > 2) { + System.out.println("throw "+ex); + System.out.println("catch "+(ex == ex1 ? "UNWRAPPED" : ex1)); + } + if (ex instanceof RuntimeException || + ex instanceof Error) { + assertSame("must pass unchecked exception out without wrapping", ex, ex1); + } else if (ex instanceof MyCheckedException) { + assertSame("must pass declared exception out without wrapping", ex, ex1); + } else { + assertNotSame("must pass undeclared checked exception with wrapping", ex, ex1); + UndeclaredThrowableException utex = (UndeclaredThrowableException) ex1; + assertSame(ex, utex.getCause()); + } + } + } + // Test error checking: + MethodHandle genericMH = ValueConversions.varargsArray(0); + genericMH = MethodHandles.convertArguments(genericMH, genericMH.type().generic()); + for (Class sam : new Class[] { Runnable.class, + Fooable.class, + Iterable.class }) { + try { + // Must throw, because none of these guys has generic type. + MethodHandles.asInstance(genericMH, sam); + System.out.println("Failed to throw"); + assertTrue(false); + } catch (IllegalArgumentException ex) { + } + } + for (Class nonSAM : new Class[] { Object.class, + String.class, + CharSequence.class, + Example.class }) { + try { + MethodHandles.asInstance(ValueConversions.varargsArray(0), nonSAM); + System.out.println("Failed to throw"); + assertTrue(false); + } catch (IllegalArgumentException ex) { + } + } + } } // Local abbreviated copy of sun.dyn.util.ValueConversions class ValueConversions { diff --git a/jdk/test/java/dyn/indify/Indify.java b/jdk/test/java/dyn/indify/Indify.java new file mode 100644 index 00000000000..0896f0e0a43 --- /dev/null +++ b/jdk/test/java/dyn/indify/Indify.java @@ -0,0 +1,1861 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package indify; + +import java.util.*; +import java.io.*; +import java.lang.reflect.Modifier; +import java.util.regex.*; + +/** + * Transform one or more class files to incorporate JSR 292 features, + * such as {@code invokedynamic}. + *

        + * This is a standalone program in a single source file. + * In this form, it may be useful for test harnesses, small experiments, and javadoc examples. + * Copies of this file may show up in multiple locations for standalone usage. + * The primary maintained location of this file is as follows: + * + * http://kenai.com/projects/ninja/sources/indify-repo/content/src/indify/Indify.java + *

        + * Static private methods named MH_x and MT_x (where x is arbitrary) + * must be stereotyped generators of MethodHandle and MethodType + * constants. All calls to them are transformed to {@code CONSTANT_MethodHandle} + * and {@code CONSTANT_MethodType} "ldc" instructions. + * The stereotyped code must create method types by calls to {@code methodType} or + * {@code fromMethodDescriptorString}. The "lookup" argument must be created + * by calls to {@code java.dyn.MethodHandles#lookup MethodHandles.lookup}. + * The class and string arguments must be constant. + * The following methods of {@code java.dyn.MethodHandle.Lookup Lookup} are + * allowed for method handle creation: {@code findStatic}, {@code findVirtual}, + * {@code findConstructor}, {@code findSpecial}, + * {@code findGetter}, {@code findSetter}, + * {@code findStaticGetter}, or {@code findStaticSetter}. + * The call to one of these methods must be followed immediately + * by an {@code areturn} instruction. + * The net result of the call to the MH_x or MT_x method must be + * the creation of a constant method handle. Thus, replacing calls + * to MH_x or MT_x methods by {@code ldc} instructions should leave + * the meaning of the program unchanged. + *

        + * Static private methods named INDY_x must be stereotyped generators + * of {@code invokedynamic} call sites. + * All calls to them must be immediately followed by + * {@code invokeExact} calls. + * All such pairs of calls are transformed to {@code invokedynamic} + * instructions. Each INDY_x method must begin with a call to a + * MH_x method, which is taken to be its bootstrap method. + * The method must be immediately invoked (via {@code invokeGeneric} + * on constant lookup, name, and type arguments. An object array of + * constants may also be appended to the {@code invokeGeneric call}. + * This call must be cast to {@code CallSite}, and the result must be + * immediately followed by a call to {@code dynamicInvoker}, with the + * resulting method handle returned. + *

        + * The net result of all of these actions is equivalent to the JVM's + * execution of an {@code invokedynamic} instruction in the unlinked state. + * Running this code once should produce the same results as running + * the corresponding {@code invokedynamic} instruction. + * In order to model the caching behavior, the code of an INDY_x + * method is allowed to begin with getstatic, aaload, and if_acmpne + * instructions which load a static method handle value and return it + * if the value is non-null. + *

        + * Example usage: + *

        +$ JAVA_HOME=(some recent OpenJDK 7 build)
        +$ ant
        +$ $JAVA_HOME/bin/java -cp build/classes indify.Indify --overwrite --dest build/testout build/classes/indify/Example.class
        +$ $JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic -cp build/classes indify.Example
        +MT = (java.lang.Object)java.lang.Object
        +MH = adder(int,int)java.lang.Integer
        +adder(1,2) = 3
        +calling indy:  42
        +$ $JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic -cp build/testout indify.Example
        +(same output as above)
        + * 
        + *

        + * Until the format of {@code CONSTANT_InvokeDynamic} entries is finalized, + * the {@code --transitionalJSR292} switch is recommended (and turned on by default). + *

        + * A version of this transformation built on top of http://asm.ow2.org/ would be welcome. + * @author John Rose + */ +public class Indify { + public static void main(String... av) throws IOException { + new Indify().run(av); + } + + public File dest; + public String[] classpath = {"."}; + public boolean keepgoing = false; + public boolean expandProperties = false; + public boolean overwrite = false; + public boolean quiet = false; + public boolean verbose = false; + public boolean transitionalJSR292 = true; // default to false later + public boolean all = false; + public int verifySpecifierCount = -1; + + public void run(String... av) throws IOException { + List avl = new ArrayList<>(Arrays.asList(av)); + parseOptions(avl); + if (avl.isEmpty()) + throw new IllegalArgumentException("Usage: indify [--dest dir] [option...] file..."); + if ("--java".equals(avl.get(0))) { + avl.remove(0); + try { + runApplication(avl.toArray(new String[0])); + } catch (Exception ex) { + if (ex instanceof RuntimeException) throw (RuntimeException) ex; + throw new RuntimeException(ex); + } + return; + } + Exception err = null; + for (String a : avl) { + try { + indify(a); + } catch (Exception ex) { + if (err == null) err = ex; + System.err.println("failure on "+a); + if (!keepgoing) break; + } + } + if (err != null) { + if (err instanceof IOException) throw (IOException) err; + throw (RuntimeException) err; + } + } + + /** Execute the given application under a class loader which indifies all application classes. */ + public void runApplication(String... av) throws Exception { + List avl = new ArrayList<>(Arrays.asList(av)); + String mainClassName = avl.remove(0); + av = avl.toArray(new String[0]); + Class mainClass = Class.forName(mainClassName, true, makeClassLoader()); + java.lang.reflect.Method main = mainClass.getMethod("main", String[].class); + main.invoke(null, (Object) av); + } + + public void parseOptions(List av) throws IOException { + for (; !av.isEmpty(); av.remove(0)) { + String a = av.get(0); + if (a.startsWith("-")) { + String a2 = null; + int eq = a.indexOf('='); + if (eq > 0) { + a2 = maybeExpandProperties(a.substring(eq+1)); + a = a.substring(0, eq+1); + } + switch (a) { + case "--java": + return; // keep this argument + case "-d": case "--dest": case "-d=": case "--dest=": + dest = new File(a2 != null ? a2 : maybeExpandProperties(av.remove(1))); + break; + case "-cp": case "--classpath": + classpath = maybeExpandProperties(av.remove(1)).split("["+File.pathSeparatorChar+"]"); + break; + case "-k": case "--keepgoing": case "--keepgoing=": + keepgoing = booleanOption(a2); // print errors but keep going + break; + case "--expand-properties": case "--expand-properties=": + expandProperties = booleanOption(a2); // expand property references in subsequent arguments + break; + case "--verify-specifier-count": case "--verify-specifier-count=": + verifySpecifierCount = Integer.valueOf(a2); + break; + case "--overwrite": case "--overwrite=": + overwrite = booleanOption(a2); // overwrite output files + break; + case "--all": case "--all=": + all = booleanOption(a2); // copy all classes, even if no patterns + break; + case "-q": case "--quiet": case "--quiet=": + quiet = booleanOption(a2); // less output + break; + case "-v": case "--verbose": case "--verbose=": + verbose = booleanOption(a2); // more output + break; + case "--transitionalJSR292": case "--transitionalJSR292=": + transitionalJSR292 = booleanOption(a2); // use older invokedynamic format + break; + default: + throw new IllegalArgumentException("unrecognized flag: "+a); + } + continue; + } else { + break; + } + } + if (dest == null && !overwrite) + throw new RuntimeException("no output specified; need --dest d or --overwrite"); + if (expandProperties) { + for (int i = 0; i < av.size(); i++) + av.set(i, maybeExpandProperties(av.get(i))); + } + } + + private boolean booleanOption(String s) { + if (s == null) return true; + switch (s) { + case "true": case "yes": case "1": return true; + case "false": case "no": case "0": return false; + } + throw new IllegalArgumentException("unrecognized boolean flag="+s); + } + + private String maybeExpandProperties(String s) { + if (!expandProperties) return s; + Set propsDone = new HashSet<>(); + while (s.contains("${")) { + int lbrk = s.indexOf("${"); + int rbrk = s.indexOf('}', lbrk); + if (rbrk < 0) break; + String prop = s.substring(lbrk+2, rbrk); + if (!propsDone.add(prop)) break; + String value = System.getProperty(prop); + if (verbose) System.err.println("expanding ${"+prop+"} => "+value); + if (value == null) break; + s = s.substring(0, lbrk) + value + s.substring(rbrk+1); + } + return s; + } + + public void indify(String a) throws IOException { + File f = new File(a); + String fn = f.getName(); + if (fn.endsWith(".class") && f.isFile()) + indifyFile(f, dest); + else if (fn.endsWith(".jar") && f.isFile()) + indifyJar(f, dest); + else if (f.isDirectory()) + indifyTree(f, dest); + else if (!keepgoing) + throw new RuntimeException("unrecognized file: "+a); + } + + private void ensureDirectory(File dir) { + if (dir.mkdirs() && !quiet) + System.err.println("created "+dir); + } + + public void indifyFile(File f, File dest) throws IOException { + if (verbose) System.err.println("reading "+f); + ClassFile cf = new ClassFile(f); + Logic logic = new Logic(cf); + boolean changed = logic.transform(); + logic.reportPatternMethods(quiet, keepgoing); + if (changed || all) { + File outfile; + if (dest != null) { + ensureDirectory(dest); + outfile = classPathFile(dest, cf.nameString()); + } else { + outfile = f; // overwrite input file, no matter where it is + } + cf.writeTo(outfile); + if (!quiet) System.err.println("wrote "+outfile); + } + } + + File classPathFile(File pathDir, String className) { + String qualname = className+".class"; + qualname = qualname.replace('/', File.separatorChar); + return new File(pathDir, qualname); + } + + public void indifyJar(File f, Object dest) throws IOException { + throw new UnsupportedOperationException("Not yet implemented"); + } + + public void indifyTree(File f, File dest) throws IOException { + if (verbose) System.err.println("reading directory: "+f); + for (File f2 : f.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { + if (name.endsWith(".class")) return true; + if (name.contains(".")) return false; + // return true if it might be a package name: + return Character.isJavaIdentifierStart(name.charAt(0)); + }})) { + if (f2.getName().endsWith(".class")) + indifyFile(f2, dest); + else if (f2.isDirectory()) + indifyTree(f2, dest); + } + } + + public ClassLoader makeClassLoader() { + return new Loader(); + } + private class Loader extends ClassLoader { + Loader() { + this(Indify.class.getClassLoader()); + } + Loader(ClassLoader parent) { + super(parent); + } + public Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + File f = findClassInPath(name); + if (f != null) { + try { + Class c = transformAndLoadClass(f); + if (c != null) { + if (resolve) resolveClass(c); + return c; + } + } catch (Exception ex) { + if (ex instanceof IllegalArgumentException) + // pass error from reportPatternMethods + throw (IllegalArgumentException) ex; + } + } + return super.loadClass(name, resolve); + } + private File findClassInPath(String name) { + for (String s : classpath) { + File f = classPathFile(new File(s), name); + if (f.exists() && f.canRead()) { + return f; + } + } + return null; + } + protected Class findClass(String name) throws ClassNotFoundException { + try { + return transformAndLoadClass(findClassInPath(name)); + } catch (IOException ex) { + throw new ClassNotFoundException("IO error", ex); + } + } + private Class transformAndLoadClass(File f) throws ClassNotFoundException, IOException { + if (verbose) System.out.println("Loading class from "+f); + ClassFile cf = new ClassFile(f); + Logic logic = new Logic(cf); + boolean changed = logic.transform(); + if (verbose && !changed) System.out.println("(no change)"); + logic.reportPatternMethods(!verbose, keepgoing); + byte[] bytes = cf.toByteArray(); + return defineClass(null, bytes, 0, bytes.length); + } + } + + private class Logic { + // Indify logic, per se. + ClassFile cf; + final char[] poolMarks; + final Map constants = new HashMap<>(); + final Map indySignatures = new HashMap<>(); + Logic(ClassFile cf) { + this.cf = cf; + poolMarks = new char[cf.pool.size()]; + } + boolean transform() { + if (!initializeMarks()) return false; + if (!findPatternMethods()) return false; + Pool pool = cf.pool; + //for (Constant c : cp) System.out.println(" # "+c); + for (Method m : cf.methods) { + if (constants.containsKey(m)) continue; // don't bother + // Transform references. + int blab = 0; + for (Instruction i = m.instructions(); i != null; i = i.next()) { + if (i.bc != opc_invokestatic) continue; + int methi = i.u2At(1); + if (poolMarks[methi] == 0) continue; + Short[] ref = pool.getMemberRef((short)methi); + Method conm = findMember(cf.methods, ref[1], ref[2]); + if (conm == null) continue; + Constant con = constants.get(conm); + if (con == null) continue; + if (blab++ == 0 && !quiet) + System.err.println("patching "+cf.nameString()+"."+m); + //if (blab == 1) { for (Instruction j = m.instructions(); j != null; j = j.next()) System.out.println(" |"+j); } + if (con.tag == CONSTANT_InvokeDynamic || + con.tag == CONSTANT_InvokeDynamic_17) { + // need to patch the following instruction too, + // but there are usually intervening argument pushes too + Instruction i2 = findPop(i); + Short[] ref2 = null; + short ref2i = 0; + if (i2 != null && i2.bc == opc_invokevirtual && + poolMarks[(char)(ref2i = (short) i2.u2At(1))] == 'D') + ref2 = pool.getMemberRef(ref2i); + if (ref2 == null || !"invokeExact".equals(pool.getString(ref2[1]))) { + System.err.println(m+": failed to create invokedynamic at "+i.pc); + continue; + } + String invType = pool.getString(ref2[2]); + String bsmType = indySignatures.get(conm); + if (!invType.equals(bsmType)) { + System.err.println(m+": warning: "+conm+" call type and local invoke type differ: " + +bsmType+", "+invType); + } + assert(i.len == 3 || i2.len == 3); + if (!quiet) System.err.println(i+" "+conm+";...; "+i2+" => invokedynamic "+con); + int start = i.pc + 3, end = i2.pc; + System.arraycopy(i.codeBase, start, i.codeBase, i.pc, end-start); + i.forceNext(0); // force revisit of new instruction + i2.u1AtPut(-3, opc_invokedynamic); + i2.u2AtPut(-2, con.index); + i2.u2AtPut(0, (short)0); + i2.u1AtPut(2, opc_nop); + //System.out.println(new Instruction(i.codeBase, i2.pc-3)); + } else { + if (!quiet) System.err.println(i+" "+conm+" => ldc "+con); + assert(i.len == 3); + i.u1AtPut(0, opc_ldc_w); + i.u2AtPut(1, con.index); + } + } + //if (blab >= 1) { for (Instruction j = m.instructions(); j != null; j = j.next()) System.out.println(" |"+j); } + } + cf.methods.removeAll(constants.keySet()); + return true; + } + + // Scan forward from the instruction to find where the stack p + // below the current sp at the instruction. + Instruction findPop(Instruction i) { + //System.out.println("findPop from "+i); + Pool pool = cf.pool; + JVMState jvm = new JVMState(); + decode: + for (i = i.clone().next(); i != null; i = i.next()) { + String pops = INSTRUCTION_POPS[i.bc]; + //System.out.println(" "+i+" "+jvm.stack+" : "+pops.replace("$", " => ")); + if (pops == null) break; + if (jvm.stackMotion(i.bc)) continue decode; + if (pops.indexOf('Q') >= 0) { + Short[] ref = pool.getMemberRef((short) i.u2At(1)); + String type = simplifyType(pool.getString(CONSTANT_Utf8, ref[2])); + switch (i.bc) { + case opc_getstatic: + case opc_getfield: + case opc_putstatic: + case opc_putfield: + pops = pops.replace("Q", type); + break; + default: + if (!type.startsWith("(")) + throw new InternalError(i.toString()); + pops = pops.replace("Q$Q", type.substring(1).replace(")","$")); + break; + } + //System.out.println("special type: "+type+" => "+pops); + } + int npops = pops.indexOf('$'); + if (npops < 0) throw new InternalError(); + if (npops > jvm.sp()) return i; + List args = jvm.args(npops); + int k = 0; + for (Object x : args) { + char have = (Character) x; + char want = pops.charAt(k++); + if (have == 'X' || want == 'X') continue; + if (have != want) break decode; + } + if (pops.charAt(k++) != '$') break decode; + args.clear(); + while (k < pops.length()) + args.add(pops.charAt(k++)); + } + System.err.println("*** bailout on jvm: "+jvm.stack+" "+i); + return null; + } + + boolean findPatternMethods() { + boolean found = false; + for (char mark : "THI".toCharArray()) { + for (Method m : cf.methods) { + if (!Modifier.isPrivate(m.access)) continue; + if (!Modifier.isStatic(m.access)) continue; + if (nameAndTypeMark(m.name, m.type) == mark) { + Constant con = scanPattern(m, mark); + if (con == null) continue; + constants.put(m, con); + found = true; + } + } + } + return found; + } + + void reportPatternMethods(boolean quietly, boolean allowMatchFailure) { + if (!quietly && !constants.keySet().isEmpty()) + System.err.println("pattern methods removed: "+constants.keySet()); + for (Method m : cf.methods) { + if (nameMark(cf.pool.getString(m.name)) != 0 && + constants.get(m) == null) { + String failure = "method has special name but fails to match pattern: "+m; + if (!allowMatchFailure) + throw new IllegalArgumentException(failure); + else if (!quietly) + System.err.println("warning: "+failure); + } + } + if (verifySpecifierCount >= 0) { + List specs = bootstrapMethodSpecifiers(false); + int specsLen = (specs == null ? 0 : specs.size()); + if (specsLen != verifySpecifierCount) { + throw new IllegalArgumentException("BootstrapMethods length is "+specsLen+" but should be "+verifySpecifierCount); + } + } + } + + // mark constant pool entries according to participation in patterns + boolean initializeMarks() { + boolean changed = false; + for (;;) { + boolean changed1 = false; + int cpindex = -1; + for (Constant e : cf.pool) { + ++cpindex; + if (e == null) continue; + char mark = poolMarks[cpindex]; + if (mark != 0) continue; + switch (e.tag) { + case CONSTANT_Utf8: + mark = nameMark(e.itemString()); break; + case CONSTANT_NameAndType: + mark = nameAndTypeMark(e.itemIndexes()); break; + case CONSTANT_Class: { + int n1 = e.itemIndex(); + char nmark = poolMarks[(char)n1]; + if ("DJ".indexOf(nmark) >= 0) + mark = nmark; + break; + } + case CONSTANT_Field: + case CONSTANT_Method: { + Short[] n12 = e.itemIndexes(); + short cl = n12[0]; + short nt = n12[1]; + char cmark = poolMarks[(char)cl]; + if (cmark != 0) { + mark = cmark; // it is a java.dyn.* or java.lang.* method + break; + } + String cls = cf.pool.getString(CONSTANT_Class, cl); + if (cls.equals(cf.nameString())) { + switch (poolMarks[(char)nt]) { + // it is a private MH/MT/INDY method + case 'T': case 'H': case 'I': + mark = poolMarks[(char)nt]; + break; + } + } + break; + } + default: break; + } + if (mark != 0) { + poolMarks[cpindex] = mark; + changed1 = true; + } + } + if (!changed1) + break; + changed = true; + } + return changed; + } + char nameMark(String s) { + if (s.startsWith("MT_")) return 'T'; + else if (s.startsWith("MH_")) return 'H'; + else if (s.startsWith("INDY_")) return 'I'; + else if (s.startsWith("java/dyn/")) return 'D'; + else if (s.startsWith("java/lang/")) return 'J'; + return 0; + } + char nameAndTypeMark(Short[] n12) { + return nameAndTypeMark(n12[0], n12[1]); + } + char nameAndTypeMark(short n1, short n2) { + char mark = poolMarks[(char)n1]; + if (mark == 0) return 0; + String descr = cf.pool.getString(CONSTANT_Utf8, n2); + String requiredType; + switch (poolMarks[(char)n1]) { + case 'H': requiredType = "()Ljava/dyn/MethodHandle;"; break; + case 'T': requiredType = "()Ljava/dyn/MethodType;"; break; + case 'I': requiredType = "()Ljava/dyn/MethodHandle;"; break; + default: return 0; + } + if (descr.equals(requiredType)) return mark; + return 0; + } + + private class JVMState { + final List stack = new ArrayList<>(); + int sp() { return stack.size(); } + void push(Object x) { stack.add(x); } + void push2(Object x) { stack.add(EMPTY_SLOT); stack.add(x); } + void pushAt(int pos, Object x) { stack.add(stack.size()+pos, x); } + Object pop() { return stack.remove(sp()-1); } + Object top() { return stack.get(sp()-1); } + List args(boolean hasRecv, String type) { + return args(argsize(type) + (hasRecv ? 1 : 0)); + } + List args(int argsize) { + return stack.subList(sp()-argsize, sp()); + } + boolean stackMotion(int bc) { + switch (bc) { + case opc_pop: pop(); break; + case opc_pop2: pop(); pop(); break; + case opc_swap: pushAt(-1, pop()); break; + case opc_dup: push(top()); break; + case opc_dup_x1: pushAt(-2, top()); break; + case opc_dup_x2: pushAt(-3, top()); break; + // ? also: dup2{,_x1,_x2} + default: return false; + } + return true; + } + } + private final String EMPTY_SLOT = "_"; + private void removeEmptyJVMSlots(List args) { + for (;;) { + int i = args.indexOf(EMPTY_SLOT); + if (i >= 0 && i+1 < args.size() + && (isConstant(args.get(i+1), CONSTANT_Long) || + isConstant(args.get(i+1), CONSTANT_Double))) + args.remove(i); + else break; + } + } + + private Constant scanPattern(Method m, char patternMark) { + if (verbose) System.err.println("scan "+m+" for pattern="+patternMark); + int wantTag; + switch (patternMark) { + case 'T': wantTag = CONSTANT_MethodType; break; + case 'H': wantTag = CONSTANT_MethodHandle; break; + case 'I': wantTag = CONSTANT_InvokeDynamic; break; + default: throw new InternalError(); + } + Instruction i = m.instructions(); + JVMState jvm = new JVMState(); + Pool pool = cf.pool; + int branchCount = 0; + Object arg; + List args; + List bsmArgs = null; // args to invokeGeneric + decode: + for (; i != null; i = i.next()) { + //System.out.println(jvm.stack+" "+i); + int bc = i.bc; + switch (bc) { + case opc_ldc: jvm.push(pool.get(i.u1At(1))); break; + case opc_ldc_w: jvm.push(pool.get(i.u2At(1))); break; + case opc_ldc2_w: jvm.push2(pool.get(i.u2At(1))); break; + case opc_aconst_null: jvm.push(null); break; + case opc_bipush: jvm.push((int)(byte) i.u1At(1)); break; + case opc_sipush: jvm.push((int)(short)i.u2At(1)); break; + + // these support creation of a restarg array + case opc_anewarray: + arg = jvm.pop(); + if (!(arg instanceof Integer)) break decode; + arg = Arrays.asList(new Object[(Integer)arg]); + jvm.push(arg); + break; + case opc_dup: + jvm.push(jvm.top()); break; + case opc_aastore: + args = jvm.args(3); // array, index, value + if (args.get(0) instanceof List && + args.get(1) instanceof Integer) { + ((List)args.get(0)).set( (Integer)args.get(1), args.get(2) ); + } + args.clear(); + break; + + case opc_getstatic: + { + // int.class compiles to getstatic Integer.TYPE + int fieldi = i.u2At(1); + char mark = poolMarks[fieldi]; + //System.err.println("getstatic "+fieldi+Arrays.asList(pool.getStrings(pool.getMemberRef((short)fieldi)))+mark); + if (mark == 'J') { + Short[] ref = pool.getMemberRef((short) fieldi); + String name = pool.getString(CONSTANT_Utf8, ref[1]); + if ("TYPE".equals(name)) { + String wrapperName = pool.getString(CONSTANT_Class, ref[0]).replace('/', '.'); + // a primitive type descriptor + Class primClass; + try { + primClass = (Class) Class.forName(wrapperName).getField(name).get(null); + } catch (Exception ex) { + throw new InternalError("cannot load "+wrapperName+"."+name); + } + jvm.push(primClass); + break; + } + } + // unknown field; keep going... + jvm.push(UNKNOWN_CON); + break; + } + case opc_putstatic: + { + if (patternMark != 'I') break decode; + jvm.pop(); + // unknown field; keep going... + break; + } + + case opc_invokestatic: + case opc_invokevirtual: + { + boolean hasRecv = (bc == opc_invokevirtual); + int methi = i.u2At(1); + char mark = poolMarks[methi]; + Short[] ref = pool.getMemberRef((short)methi); + String type = pool.getString(CONSTANT_Utf8, ref[2]); + //System.out.println("invoke "+pool.getString(CONSTANT_Utf8, ref[1])+" "+Arrays.asList(ref)+" : "+type); + args = jvm.args(hasRecv, type); + String intrinsic = null; + Constant con; + if (mark == 'D' || mark == 'J') { + intrinsic = pool.getString(CONSTANT_Utf8, ref[1]); + if (mark == 'J') { + String cls = pool.getString(CONSTANT_Class, ref[0]); + cls = cls.substring(1+cls.lastIndexOf('/')); + intrinsic = cls+"."+intrinsic; + } + //System.out.println("recognized intrinsic "+intrinsic); + byte refKind = -1; + switch (intrinsic) { + case "findGetter": refKind = REF_getField; break; + case "findStaticGetter": refKind = REF_getStatic; break; + case "findSetter": refKind = REF_putField; break; + case "findStaticSetter": refKind = REF_putStatic; break; + case "findVirtual": refKind = REF_invokeVirtual; break; + case "findStatic": refKind = REF_invokeStatic; break; + case "findSpecial": refKind = REF_invokeSpecial; break; + case "findConstructor": refKind = REF_newInvokeSpecial; break; + } + if (refKind >= 0 && (con = parseMemberLookup(refKind, args)) != null) { + args.clear(); args.add(con); + continue; + } + } + Method ownMethod = null; + if (mark == 'T' || mark == 'H' || mark == 'I') { + ownMethod = findMember(cf.methods, ref[1], ref[2]); + } + switch (intrinsic == null ? "" : intrinsic) { + case "fromMethodDescriptorString": + con = makeMethodTypeCon(args.get(0)); + args.clear(); args.add(con); + continue; + case "methodType": { + flattenVarargs(args); // there are several overloadings, some with varargs + StringBuilder buf = new StringBuilder(); + String rtype = null; + for (Object typeArg : args) { + if (typeArg instanceof Class) { + Class argClass = (Class) typeArg; + if (argClass.isPrimitive()) { + char tchar; + switch (argClass.getName()) { + case "void": tchar = 'V'; break; + case "boolean": tchar = 'Z'; break; + case "byte": tchar = 'B'; break; + case "char": tchar = 'C'; break; + case "short": tchar = 'S'; break; + case "int": tchar = 'I'; break; + case "long": tchar = 'J'; break; + case "float": tchar = 'F'; break; + case "double": tchar = 'D'; break; + default: throw new InternalError(argClass.toString()); + } + buf.append(tchar); + } else { + // should not happen, but... + buf.append('L').append(argClass.getName().replace('.','/')).append(';'); + } + } else if (typeArg instanceof Constant) { + Constant argCon = (Constant) typeArg; + if (argCon.tag == CONSTANT_Class) { + String cn = pool.get(argCon.itemIndex()).itemString(); + if (cn.endsWith(";")) + buf.append(cn); + else + buf.append('L').append(cn).append(';'); + } else { + break decode; + } + } else { + break decode; + } + if (rtype == null) { + // first arg is treated differently + rtype = buf.toString(); + buf.setLength(0); + buf.append('('); + } + } + buf.append(')').append(rtype); + con = con = makeMethodTypeCon(buf.toString()); + args.clear(); args.add(con); + continue; + } + case "lookup": + case "dynamicInvoker": + args.clear(); args.add(intrinsic); + continue; + case "lookupClass": + if (args.equals(Arrays.asList("lookup"))) { + // fold lookup().lookupClass() to the enclosing class + args.clear(); args.add(pool.get(cf.thisc)); + continue; + } + break; + case "invokeGeneric": + case "invokeWithArguments": + if (patternMark != 'I') break decode; + if ("invokeWithArguments".equals(intrinsic)) + flattenVarargs(args); + bsmArgs = new ArrayList(args); + args.clear(); args.add("invokeGeneric"); + continue; + case "Integer.valueOf": + case "Float.valueOf": + case "Long.valueOf": + case "Double.valueOf": + removeEmptyJVMSlots(args); + if (args.size() == 1) { + arg = args.remove(0); + assert(3456 == (CONSTANT_Integer*1000 + CONSTANT_Float*100 + CONSTANT_Long*10 + CONSTANT_Double)); + if (isConstant(arg, CONSTANT_Integer + "IFLD".indexOf(intrinsic.charAt(0))) + || arg instanceof Number) { + args.add(arg); continue; + } + } + break decode; + } + if (!hasRecv && ownMethod != null && patternMark != 0) { + con = constants.get(ownMethod); + if (con == null) break decode; + args.clear(); args.add(con); + continue; + } else if (type.endsWith(")V")) { + // allow calls like println("reached the pattern method") + args.clear(); + continue; + } + break decode; // bail out for most calls + } + case opc_areturn: + { + ++branchCount; + if (bsmArgs != null) { + // parse bsmArgs as (MH, lookup, String, MT, [extra]) + Constant indyCon = makeInvokeDynamicCon(bsmArgs); + if (indyCon != null) { + Constant typeCon = (Constant) bsmArgs.get(3); + indySignatures.put(m, pool.getString(typeCon.itemIndex())); + return indyCon; + } + System.err.println(m+": inscrutable bsm arguments: "+bsmArgs); + break decode; // bail out + } + arg = jvm.pop(); + if (branchCount == 2 && UNKNOWN_CON.equals(arg)) + break; // merge to next path + if (isConstant(arg, wantTag)) + return (Constant) arg; + break decode; // bail out + } + default: + if (jvm.stackMotion(i.bc)) break; + if (bc >= opc_nconst_MIN && bc <= opc_nconst_MAX) + { jvm.push(INSTRUCTION_CONSTANTS[bc - opc_nconst_MIN]); break; } + if (patternMark == 'I') { + // these support caching paths in INDY_x methods + if (bc == opc_aload || bc >= opc_aload_0 && bc <= opc_aload_MAX) + { jvm.push(UNKNOWN_CON); break; } + if (bc == opc_astore || bc >= opc_astore_0 && bc <= opc_astore_MAX) + { jvm.pop(); break; } + switch (bc) { + case opc_getfield: + case opc_aaload: + jvm.push(UNKNOWN_CON); break; + case opc_ifnull: + case opc_ifnonnull: + // ignore branch target + if (++branchCount != 1) break decode; + jvm.pop(); + break; + case opc_checkcast: + arg = jvm.top(); + if ("invokeWithArguments".equals(arg) || + "invokeGeneric".equals(arg)) + break; // assume it is a helpful cast + break decode; + default: + break decode; // bail out + } + continue decode; // go to next instruction + } + break decode; // bail out + } //end switch + } + System.err.println(m+": bailout on "+i+" jvm stack: "+jvm.stack); + return null; + } + private final String UNKNOWN_CON = ""; + + private void flattenVarargs(List args) { + int size = args.size(); + if (size > 0 && args.get(size-1) instanceof List) + args.addAll((List) args.remove(size-1)); + } + + private boolean isConstant(Object x, int tag) { + return x instanceof Constant && ((Constant)x).tag == tag; + } + private Constant makeMethodTypeCon(Object x) { + short utfIndex; + if (x instanceof String) + utfIndex = (short) cf.pool.addConstant(CONSTANT_Utf8, x).index; + else if (isConstant(x, CONSTANT_String)) + utfIndex = ((Constant)x).itemIndex(); + else return null; + return cf.pool.addConstant(CONSTANT_MethodType, utfIndex); + } + private Constant parseMemberLookup(byte refKind, List args) { + // E.g.: lookup().findStatic(Foo.class, "name", MethodType) + if (args.size() != 4) return null; + int argi = 0; + if (!"lookup".equals(args.get(argi++))) return null; + short refindex, cindex, ntindex, nindex, tindex; + Object con; + if (!isConstant(con = args.get(argi++), CONSTANT_Class)) return null; + cindex = (short)((Constant)con).index; + if (!isConstant(con = args.get(argi++), CONSTANT_String)) return null; + nindex = ((Constant)con).itemIndex(); + if (isConstant(con = args.get(argi++), CONSTANT_MethodType) || + isConstant(con, CONSTANT_Class)) { + tindex = ((Constant)con).itemIndex(); + } else return null; + ntindex = (short) cf.pool.addConstant(CONSTANT_NameAndType, + new Short[]{ nindex, tindex }).index; + byte reftag = CONSTANT_Method; + if (refKind <= REF_putStatic) + reftag = CONSTANT_Field; + else if (refKind == REF_invokeInterface) + reftag = CONSTANT_InterfaceMethod; + Constant ref = cf.pool.addConstant(reftag, new Short[]{ cindex, ntindex }); + return cf.pool.addConstant(CONSTANT_MethodHandle, new Object[]{ refKind, (short)ref.index }); + } + private Constant makeInvokeDynamicCon(List args) { + // E.g.: MH_bsm.invokeGeneric(lookup(), "name", MethodType, "extraArg") + removeEmptyJVMSlots(args); + if (args.size() != 4 && args.size() != 5) return null; + int argi = 0; + short nindex, tindex, ntindex, bsmindex; + Object con; + if (!isConstant(con = args.get(argi++), CONSTANT_MethodHandle)) return null; + bsmindex = (short) ((Constant)con).index; + if (!"lookup".equals(args.get(argi++))) return null; + if (!isConstant(con = args.get(argi++), CONSTANT_String)) return null; + nindex = ((Constant)con).itemIndex(); + if (!isConstant(con = args.get(argi++), CONSTANT_MethodType)) return null; + tindex = ((Constant)con).itemIndex(); + ntindex = (short) cf.pool.addConstant(CONSTANT_NameAndType, + new Short[]{ nindex, tindex }).index; + if (transitionalJSR292) { + if (argi != args.size()) { + System.err.println("BSM specifier has extra arguments but transitionalJSR292=1"); + return null; + } + return cf.pool.addConstant(CONSTANT_InvokeDynamic_17, + new Short[]{ bsmindex, ntindex }); + } + List extraArgs = Collections.emptyList(); + if (argi < args.size()) { + Object arg = args.get(argi); + if (arg instanceof List) + extraArgs = (List) arg; + else + extraArgs = Arrays.asList(arg); + removeEmptyJVMSlots(args); + } + List extraArgIndexes = new CountedList<>(Short.class); + for (Object x : extraArgs) { + if (x instanceof Number) { + Object num = null; byte numTag = 0; + if (x instanceof Integer) { num = x; numTag = CONSTANT_Integer; } + if (x instanceof Float) { num = Float.floatToRawIntBits((Float)x); numTag = CONSTANT_Float; } + if (x instanceof Long) { num = x; numTag = CONSTANT_Long; } + if (x instanceof Double) { num = Double.doubleToRawLongBits((Double)x); numTag = CONSTANT_Double; } + if (num != null) x = cf.pool.addConstant(numTag, x); + } + if (!(x instanceof Constant)) return null; + extraArgIndexes.add((short) ((Constant)x).index); + } + List specs = bootstrapMethodSpecifiers(true); + int specindex = -1; + Object[] spec = new Object[]{ bsmindex, extraArgIndexes }; + for (Object[] spec1 : specs) { + if (Arrays.equals(spec1, spec)) { + specindex = specs.indexOf(spec1); + if (verbose) System.err.println("reusing BSM specifier: "+spec1[0]+spec1[1]); + break; + } + } + if (specindex == -1) { + specindex = (short) specs.size(); + specs.add(spec); + if (verbose) System.err.println("adding BSM specifier: "+spec[0]+spec[1]); + } + return cf.pool.addConstant(CONSTANT_InvokeDynamic, + new Short[]{ (short)specindex, ntindex }); + } + + List bootstrapMethodSpecifiers(boolean createIfNotFound) { + Attr bsms = cf.findAttr("BootstrapMethods"); + if (bsms == null) { + if (!createIfNotFound) return null; + bsms = new Attr(cf, "BootstrapMethods", new byte[]{0,0}); + assert(bsms == cf.findAttr("BootstrapMethods")); + } + if (bsms.item instanceof byte[]) { + // unflatten + List specs = new CountedList<>(Object[].class); + DataInputStream in = new DataInputStream(new ByteArrayInputStream((byte[]) bsms.item)); + try { + int len = (char) in.readShort(); + for (int i = 0; i < len; i++) { + short bsm = in.readShort(); + int argc = (char) in.readShort(); + List argv = new CountedList<>(Short.class); + for (int j = 0; j < argc; j++) + argv.add(in.readShort()); + specs.add(new Object[]{ bsm, argv }); + } + } catch (IOException ex) { throw new InternalError(); } + bsms.item = specs; + } + return (List) bsms.item; + } + } + + private DataInputStream openInput(File f) throws IOException { + return new DataInputStream(new BufferedInputStream(new FileInputStream(f))); + } + + private DataOutputStream openOutput(File f) throws IOException { + if (!overwrite && f.exists()) + throw new IOException("file already exists: "+f); + ensureDirectory(f.getParentFile()); + return new DataOutputStream(new BufferedOutputStream(new FileOutputStream(f))); + } + + static byte[] readRawBytes(DataInputStream in, int size) throws IOException { + byte[] bytes = new byte[size]; + int nr = in.read(bytes); + if (nr != size) + throw new InternalError("wrong size: "+nr); + return bytes; + } + + private interface Chunk { + void readFrom(DataInputStream in) throws IOException; + void writeTo(DataOutputStream out) throws IOException; + } + + private static class CountedList extends ArrayList implements Chunk { + final Class itemClass; + final int rowlen; + CountedList(Class itemClass, int rowlen) { + this.itemClass = itemClass; + this.rowlen = rowlen; + } + CountedList(Class itemClass) { this(itemClass, -1); } + public void readFrom(DataInputStream in) throws IOException { + int count = in.readUnsignedShort(); + while (size() < count) { + if (rowlen < 0) { + add(readInput(in, itemClass)); + } else { + Class elemClass = itemClass.getComponentType(); + Object[] row = (Object[]) java.lang.reflect.Array.newInstance(elemClass, rowlen); + for (int i = 0; i < rowlen; i++) + row[i] = readInput(in, elemClass); + add(itemClass.cast(row)); + } + } + } + public void writeTo(DataOutputStream out) throws IOException { + out.writeShort((short)size()); + for (T item : this) { + writeOutput(out, item); + } + } + } + + private static T readInput(DataInputStream in, Class dataClass) throws IOException { + Object data; + if (dataClass == Integer.class) { + data = in.readInt(); + } else if (dataClass == Short.class) { + data = in.readShort(); + } else if (dataClass == Byte.class) { + data = in.readByte(); + } else if (dataClass == String.class) { + data = in.readUTF(); + } else if (Chunk.class.isAssignableFrom(dataClass)) { + T obj; + try { obj = dataClass.newInstance(); } + catch (Exception ex) { throw new RuntimeException(ex); } + ((Chunk)obj).readFrom(in); + data = obj; + } else { + throw new InternalError("bad input datum: "+dataClass); + } + return dataClass.cast(data); + } + private static T readInput(byte[] bytes, Class dataClass) { + try { + return readInput(new DataInputStream(new ByteArrayInputStream(bytes)), dataClass); + } catch (IOException ex) { + throw new InternalError(); + } + } + private static void readInputs(DataInputStream in, Object... data) throws IOException { + for (Object x : data) ((Chunk)x).readFrom(in); + } + + private static void writeOutput(DataOutputStream out, Object data) throws IOException { + if (data == null) { + return; + } if (data instanceof Integer) { + out.writeInt((Integer)data); + } else if (data instanceof Long) { + out.writeLong((Long)data); + } else if (data instanceof Short) { + out.writeShort((Short)data); + } else if (data instanceof Byte) { + out.writeByte((Byte)data); + } else if (data instanceof String) { + out.writeUTF((String)data); + } else if (data instanceof byte[]) { + out.write((byte[])data); + } else if (data instanceof Object[]) { + for (Object x : (Object[]) data) + writeOutput(out, x); + } else if (data instanceof Chunk) { + Chunk x = (Chunk) data; + x.writeTo(out); + } else if (data instanceof List) { + for (Object x : (List) data) + writeOutput(out, x); + } else { + throw new InternalError("bad output datum: "+data+" : "+data.getClass().getName()); + } + } + private static void writeOutputs(DataOutputStream out, Object... data) throws IOException { + for (Object x : data) writeOutput(out, x); + } + + public static abstract class Outer { + public abstract List inners(); + protected void linkInners() { + for (Inner i : inners()) { + i.linkOuter(this); + if (i instanceof Outer) + ((Outer)i).linkInners(); + } + } + public T outer(Class c) { + for (Outer walk = this;; walk = ((Inner)walk).outer()) { + if (c.isInstance(walk)) + return c.cast(walk); + //if (!(walk instanceof Inner)) return null; + } + } + + public abstract List attrs(); + public Attr findAttr(String name) { + return findAttr(outer(ClassFile.class).pool.stringIndex(name, false)); + } + public Attr findAttr(int name) { + if (name == 0) return null; + for (Attr a : attrs()) { + if (a.name == name) return a; + } + return null; + } + } + public interface Inner { Outer outer(); void linkOuter(Outer o); } + public static abstract class InnerOuter extends Outer implements Inner { + public Outer outer; + public Outer outer() { return outer; } + public void linkOuter(Outer o) { assert(outer == null); outer = o; } + } + public static class Constant implements Chunk { + public final byte tag; + public final T item; + public final int index; + public Constant(int index, byte tag, T item) { + this.index = index; + this.tag = tag; + this.item = item; + } + public Constant checkTag(byte tag) { + if (this.tag != tag) throw new InternalError(this.toString()); + return this; + } + public String itemString() { return (String)item; } + public Short itemIndex() { return (Short)item; } + public Short[] itemIndexes() { return (Short[])item; } + public void readFrom(DataInputStream in) throws IOException { + throw new InternalError("do not call"); + } + public void writeTo(DataOutputStream out) throws IOException { + writeOutputs(out, tag, item); + } + public boolean equals(Object x) { return (x instanceof Constant && equals((Constant)x)); } + public boolean equals(Constant that) { + return (this.tag == that.tag && this.itemAsComparable().equals(that.itemAsComparable())); + } + public int hashCode() { return (tag * 31) + this.itemAsComparable().hashCode(); } + public Object itemAsComparable() { + switch (tag) { + case CONSTANT_Double: return Double.longBitsToDouble((Long)item); + case CONSTANT_Float: return Float.intBitsToFloat((Integer)item); + } + return (item instanceof Object[] ? Arrays.asList((Object[])item) : item); + } + public String toString() { + String itstr = String.valueOf(itemAsComparable()); + return (index + ":" + tagName(tag) + (itstr.startsWith("[")?"":"=") + itstr); + } + private static String[] TAG_NAMES; + public static String tagName(byte tag) { // used for error messages + if (TAG_NAMES == null) + TAG_NAMES = ("None Utf8 Unicode Integer Float Long Double Class String" + +" Fieldref Methodref InterfaceMethodref NameAndType #13 #14" + +" MethodHandle MethodType InvokeDynamic#17 InvokeDynamic").split(" "); + if ((tag & 0xFF) >= TAG_NAMES.length) return "#"+(tag & 0xFF); + return TAG_NAMES[tag & 0xFF]; + } + } + + public static class Pool extends CountedList implements Chunk { + private Map strings = new TreeMap<>(); + + public Pool() { + super(Constant.class); + } + public void readFrom(DataInputStream in) throws IOException { + int count = in.readUnsignedShort(); + add(null); // always ignore first item + while (size() < count) { + readConstant(in); + } + } + public Constant addConstant(byte tag, T item) { + Constant con = new Constant<>(size(), tag, item); + int idx = indexOf(con); + if (idx >= 0) return get(idx); + add(con); + if (tag == CONSTANT_Utf8) strings.put((String)item, (short) con.index); + return con; + } + private void readConstant(DataInputStream in) throws IOException { + byte tag = in.readByte(); + int index = size(); + Object arg; + switch (tag) { + case CONSTANT_Utf8: + arg = in.readUTF(); + strings.put((String) arg, (short) size()); + break; + case CONSTANT_Integer: + case CONSTANT_Float: + arg = in.readInt(); break; + case CONSTANT_Long: + case CONSTANT_Double: + add(new Constant(index, tag, in.readLong())); + add(null); + return; + case CONSTANT_Class: + case CONSTANT_String: + arg = in.readShort(); break; + case CONSTANT_Field: + case CONSTANT_Method: + case CONSTANT_InterfaceMethod: + case CONSTANT_NameAndType: + case CONSTANT_InvokeDynamic_17: + case CONSTANT_InvokeDynamic: + // read an ordered pair + arg = new Short[] { in.readShort(), in.readShort() }; + break; + case CONSTANT_MethodHandle: + // read an ordered pair; first part is a u1 (not u2) + arg = new Object[] { in.readByte(), in.readShort() }; + break; + case CONSTANT_MethodType: + arg = in.readShort(); break; + default: + throw new InternalError("bad CP tag "+tag); + } + add(new Constant(index, tag, arg)); + } + + // Access: + public Constant get(int index) { + // extra 1-bits get into the shorts + return super.get((char) index); + } + String getString(byte tag, short index) { + get(index).checkTag(tag); + return getString(index); + } + String getString(short index) { + Object v = get(index).item; + if (v instanceof Short) + v = get((Short)v).checkTag(CONSTANT_Utf8).item; + return (String) v; + } + String[] getStrings(Short[] indexes) { + String[] res = new String[indexes.length]; + for (int i = 0; i < indexes.length; i++) + res[i] = getString(indexes[i]); + return res; + } + int stringIndex(String name, boolean createIfNotFound) { + Short x = strings.get(name); + if (x != null) return (char)(int) x; + if (!createIfNotFound) return 0; + return addConstant(CONSTANT_Utf8, name).index; + } + Short[] getMemberRef(short index) { + Short[] cls_nnt = get(index).itemIndexes(); + Short[] name_type = get(cls_nnt[1]).itemIndexes(); + return new Short[]{ cls_nnt[0], name_type[0], name_type[1] }; + } + } + + public class ClassFile extends Outer implements Chunk { + ClassFile(File f) throws IOException { + DataInputStream in = openInput(f); + try { + readFrom(in); + } finally { + if (in != null) in.close(); + } + } + + public int magic, version; // + public final Pool pool = new Pool(); + public short access, thisc, superc; + public final List interfaces = new CountedList<>(Short.class); + public final List fields = new CountedList<>(Field.class); + public final List methods = new CountedList<>(Method.class); + public final List attrs = new CountedList<>(Attr.class); + + public final void readFrom(DataInputStream in) throws IOException { + magic = in.readInt(); version = in.readInt(); + if (magic != 0xCAFEBABE) throw new IOException("bad magic number"); + pool.readFrom(in); + Code_index = pool.stringIndex("Code", false); + access = in.readShort(); thisc = in.readShort(); superc = in.readShort(); + readInputs(in, interfaces, fields, methods, attrs); + if (in.read() >= 0) throw new IOException("junk after end of file"); + linkInners(); + } + + void writeTo(File f) throws IOException { + DataOutputStream out = openOutput(f); + try { + writeTo(out); + } finally { + out.close(); + } + } + + public void writeTo(DataOutputStream out) throws IOException { + writeOutputs(out, magic, version, pool, + access, thisc, superc, interfaces, + fields, methods, attrs); + } + + public byte[] toByteArray() { + try { + ByteArrayOutputStream buf = new ByteArrayOutputStream(); + writeTo(new DataOutputStream(buf)); + return buf.toByteArray(); + } catch (IOException ex) { + throw new InternalError(); + } + } + + public List inners() { + List inns = new ArrayList<>(); + inns.addAll(fields); inns.addAll(methods); inns.addAll(attrs); + return inns; + } + public List attrs() { return attrs; } + + // derived stuff: + public String nameString() { return pool.getString(CONSTANT_Class, thisc); } + int Code_index; + } + + private static T findMember(List mems, int name, int type) { + if (name == 0 || type == 0) return null; + for (T m : mems) { + if (m.name == name && m.type == type) return m; + } + return null; + } + + public static class Member extends InnerOuter implements Chunk { + public short access, name, type; + public final List attrs = new CountedList<>(Attr.class); + public void readFrom(DataInputStream in) throws IOException { + access = in.readShort(); name = in.readShort(); type = in.readShort(); + readInputs(in, attrs); + } + public void writeTo(DataOutputStream out) throws IOException { + writeOutputs(out, access, name, type, attrs); + } + public List inners() { return attrs; } + public List attrs() { return attrs; } + public ClassFile outer() { return (ClassFile) outer; } + public String nameString() { return outer().pool.getString(CONSTANT_Utf8, name); } + public String typeString() { return outer().pool.getString(CONSTANT_Utf8, type); } + public String toString() { + if (outer == null) return super.toString(); + return nameString() + (this instanceof Method ? "" : ":") + + simplifyType(typeString()); + } + } + public static class Field extends Member { + } + public static class Method extends Member { + public Code code() { + Attr a = findAttr("Code"); + if (a == null) return null; + return (Code) a.item; + } + public Instruction instructions() { + Code code = code(); + if (code == null) return null; + return code.instructions(); + } + } + + public static class Attr extends InnerOuter implements Chunk { + public short name; + public int size = -1; // no pre-declared size + public Object item; + + public Attr() {} + public Attr(Outer outer, String name, Object item) { + ClassFile cf = outer.outer(ClassFile.class); + linkOuter(outer); + this.name = (short) cf.pool.stringIndex(name, true); + this.item = item; + outer.attrs().add(this); + } + public void readFrom(DataInputStream in) throws IOException { + name = in.readShort(); + size = in.readInt(); + item = readRawBytes(in, size); + } + public void writeTo(DataOutputStream out) throws IOException { + out.writeShort(name); + // write the 4-byte size header and then the contents: + byte[] bytes; + int trueSize; + if (item instanceof byte[]) { + bytes = (byte[]) item; + out.writeInt(trueSize = bytes.length); + out.write(bytes); + } else { + trueSize = flatten(out); + } + if (trueSize != size && size >= 0) + System.err.println("warning: attribute size changed "+size+" to "+trueSize); + } + public void linkOuter(Outer o) { + super.linkOuter(o); + if (item instanceof byte[] && + outer instanceof Method && + ((Method)outer).outer().Code_index == name) { + item = readInput((byte[])item, Code.class); + } + } + public List inners() { + if (item instanceof Inner) + return Collections.nCopies(1, (Inner)item); + return Collections.emptyList(); + } + public List attrs() { return null; } // Code overrides this + public byte[] flatten() { + ByteArrayOutputStream buf = new ByteArrayOutputStream(size); + flatten(buf); + return buf.toByteArray(); + } + public int flatten(DataOutputStream out) throws IOException { + ByteArrayOutputStream buf = new ByteArrayOutputStream(Math.max(20, size)); + int trueSize = flatten(buf); + out.writeInt(trueSize); + buf.writeTo(out); + return trueSize; + } + private int flatten(ByteArrayOutputStream buf) { + try { + writeOutput(new DataOutputStream(buf), item); + return buf.size(); + } catch (IOException ex) { + throw new InternalError(); + } + } + public String nameString() { + ClassFile cf = outer(ClassFile.class); + if (cf == null) return "#"+name; + return cf.pool.getString(name); + } + public String toString() { + return nameString()+(size < 0 ? "=" : "["+size+"]=")+item; + } + } + + public static class Code extends InnerOuter implements Chunk { + public short stacks, locals; + public byte[] bytes; + public final List etable = new CountedList<>(Short[].class, 4); + public final List attrs = new CountedList<>(Attr.class); + // etable[N] = (N)*{ startpc, endpc, handlerpc, catchtype } + public void readFrom(DataInputStream in) throws IOException { + stacks = in.readShort(); locals = in.readShort(); + bytes = readRawBytes(in, in.readInt()); + readInputs(in, etable, attrs); + } + public void writeTo(DataOutputStream out) throws IOException { + writeOutputs(out, stacks, locals, bytes.length, bytes, etable, attrs); + } + public List inners() { return attrs; } + public List attrs() { return attrs; } + public Instruction instructions() { + return new Instruction(bytes, 0); + } + } + + // lots of constants + private static final byte + CONSTANT_Utf8 = 1, + CONSTANT_Integer = 3, + CONSTANT_Float = 4, + CONSTANT_Long = 5, + CONSTANT_Double = 6, + CONSTANT_Class = 7, + CONSTANT_String = 8, + CONSTANT_Field = 9, + CONSTANT_Method = 10, + CONSTANT_InterfaceMethod = 11, + CONSTANT_NameAndType = 12, + CONSTANT_MethodHandle = 15, // JSR 292 + CONSTANT_MethodType = 16, // JSR 292 + CONSTANT_InvokeDynamic_17 = 17, // JSR 292, only occurs in old class files + CONSTANT_InvokeDynamic = 18; // JSR 292 + private static final byte + REF_getField = 1, + REF_getStatic = 2, + REF_putField = 3, + REF_putStatic = 4, + REF_invokeVirtual = 5, + REF_invokeStatic = 6, + REF_invokeSpecial = 7, + REF_newInvokeSpecial = 8, + REF_invokeInterface = 9; + + private static final int + opc_nop = 0, + opc_aconst_null = 1, + opc_nconst_MIN = 2, // iconst_m1 + opc_nconst_MAX = 15, // dconst_1 + opc_bipush = 16, + opc_sipush = 17, + opc_ldc = 18, + opc_ldc_w = 19, + opc_ldc2_w = 20, + opc_aload = 25, + opc_aload_0 = 42, + opc_aload_MAX = 45, + opc_aaload = 50, + opc_astore = 58, + opc_astore_0 = 75, + opc_astore_MAX = 78, + opc_aastore = 83, + opc_pop = 87, + opc_pop2 = 88, + opc_dup = 89, + opc_dup_x1 = 90, + opc_dup_x2 = 91, + opc_dup2 = 92, + opc_dup2_x1 = 93, + opc_dup2_x2 = 94, + opc_swap = 95, + opc_tableswitch = 170, + opc_lookupswitch = 171, + opc_areturn = 176, + opc_getstatic = 178, + opc_putstatic = 179, + opc_getfield = 180, + opc_putfield = 181, + opc_invokevirtual = 182, + opc_invokespecial = 183, + opc_invokestatic = 184, + opc_invokeinterface = 185, + opc_invokedynamic = 186, + opc_anewarray = 189, + opc_checkcast = 192, + opc_ifnull = 198, + opc_ifnonnull = 199, + opc_wide = 196; + + private static final Object[] INSTRUCTION_CONSTANTS = { + -1, 0, 1, 2, 3, 4, 5, 0L, 1L, 0.0F, 1.0F, 2.0F, 0.0D, 1.0D + }; + + private static final String INSTRUCTION_FORMATS = + "nop$ aconst_null$L iconst_m1$I iconst_0$I iconst_1$I "+ + "iconst_2$I iconst_3$I iconst_4$I iconst_5$I lconst_0$J_ "+ + "lconst_1$J_ fconst_0$F fconst_1$F fconst_2$F dconst_0$D_ "+ + "dconst_1$D_ bipush=bx$I sipush=bxx$I ldc=bk$X ldc_w=bkk$X "+ + "ldc2_w=bkk$X_ iload=bl/wbll$I lload=bl/wbll$J_ fload=bl/wbll$F "+ + "dload=bl/wbll$D_ aload=bl/wbll$L iload_0$I iload_1$I "+ + "iload_2$I iload_3$I lload_0$J_ lload_1$J_ lload_2$J_ "+ + "lload_3$J_ fload_0$F fload_1$F fload_2$F fload_3$F dload_0$D_ "+ + "dload_1$D_ dload_2$D_ dload_3$D_ aload_0$L aload_1$L "+ + "aload_2$L aload_3$L iaload$LI$I laload$LI$J_ faload$LI$F "+ + "daload$LI$D_ aaload$LI$L baload$LI$I caload$LI$I saload$LI$I "+ + "istore=bl/wbll$I$ lstore=bl/wbll$J_$ fstore=bl/wbll$F$ "+ + "dstore=bl/wbll$D_$ astore=bl/wbll$L$ istore_0$I$ istore_1$I$ "+ + "istore_2$I$ istore_3$I$ lstore_0$J_$ lstore_1$J_$ "+ + "lstore_2$J_$ lstore_3$J_$ fstore_0$F$ fstore_1$F$ fstore_2$F$ "+ + "fstore_3$F$ dstore_0$D_$ dstore_1$D_$ dstore_2$D_$ "+ + "dstore_3$D_$ astore_0$L$ astore_1$L$ astore_2$L$ astore_3$L$ "+ + "iastore$LII$ lastore$LIJ_$ fastore$LIF$ dastore$LID_$ "+ + "aastore$LIL$ bastore$LII$ castore$LII$ sastore$LII$ pop$X$ "+ + "pop2$XX$ dup$X$XX dup_x1$XX$XXX dup_x2$XXX$XXXX dup2$XX$XXXX "+ + "dup2_x1$XXX$XXXXX dup2_x2$XXXX$XXXXXX swap$XX$XX "+ + "iadd$II$I ladd$J_J_$J_ fadd$FF$F dadd$D_D_$D_ isub$II$I "+ + "lsub$J_J_$J_ fsub$FF$F dsub$D_D_$D_ imul$II$I lmul$J_J_$J_ "+ + "fmul$FF$F dmul$D_D_$D_ idiv$II$I ldiv$J_J_$J_ fdiv$FF$F "+ + "ddiv$D_D_$D_ irem$II$I lrem$J_J_$J_ frem$FF$F drem$D_D_$D_ "+ + "ineg$I$I lneg$J_$J_ fneg$F$F dneg$D_$D_ ishl$II$I lshl$J_I$J_ "+ + "ishr$II$I lshr$J_I$J_ iushr$II$I lushr$J_I$J_ iand$II$I "+ + "land$J_J_$J_ ior$II$I lor$J_J_$J_ ixor$II$I lxor$J_J_$J_ "+ + "iinc=blx/wbllxx$ i2l$I$J_ i2f$I$F i2d$I$D_ l2i$J_$I l2f$J_$F "+ + "l2d$J_$D_ f2i$F$I f2l$F$J_ f2d$F$D_ d2i$D_$I d2l$D_$J_ "+ + "d2f$D_$F i2b$I$I i2c$I$I i2s$I$I lcmp fcmpl fcmpg dcmpl dcmpg "+ + "ifeq=boo ifne=boo iflt=boo ifge=boo ifgt=boo ifle=boo "+ + "if_icmpeq=boo if_icmpne=boo if_icmplt=boo if_icmpge=boo "+ + "if_icmpgt=boo if_icmple=boo if_acmpeq=boo if_acmpne=boo "+ + "goto=boo jsr=boo ret=bl/wbll tableswitch=* lookupswitch=* "+ + "ireturn lreturn freturn dreturn areturn return "+ + "getstatic=bkf$Q putstatic=bkf$Q$ getfield=bkf$L$Q "+ + "putfield=bkf$LQ$ invokevirtual=bkm$LQ$Q "+ + "invokespecial=bkm$LQ$Q invokestatic=bkm$Q$Q "+ + "invokeinterface=bkixx$LQ$Q invokedynamic=bkd__$Q$Q new=bkc$L "+ + "newarray=bx$I$L anewarray=bkc$I$L arraylength$L$I athrow "+ + "checkcast=bkc$L$L instanceof=bkc$L$I monitorenter$L "+ + "monitorexit$L wide=* multianewarray=bkcx ifnull=boo "+ + "ifnonnull=boo goto_w=boooo jsr_w=boooo "; + private static final String[] INSTRUCTION_NAMES; + private static final String[] INSTRUCTION_POPS; + private static final int[] INSTRUCTION_INFO; + static { + String[] insns = INSTRUCTION_FORMATS.split(" "); + assert(insns[opc_lookupswitch].startsWith("lookupswitch")); + assert(insns[opc_tableswitch].startsWith("tableswitch")); + assert(insns[opc_wide].startsWith("wide")); + assert(insns[opc_invokedynamic].startsWith("invokedynamic")); + int[] info = new int[256]; + String[] names = new String[256]; + String[] pops = new String[256]; + for (int i = 0; i < insns.length; i++) { + String insn = insns[i]; + int dl = insn.indexOf('$'); + if (dl > 0) { + String p = insn.substring(dl+1); + if (p.indexOf('$') < 0) p = "$" + p; + pops[i] = p; + insn = insn.substring(0, dl); + } + int eq = insn.indexOf('='); + if (eq < 0) { + info[i] = 1; + names[i] = insn; + continue; + } + names[i] = insn.substring(0, eq); + String fmt = insn.substring(eq+1); + if (fmt.equals("*")) { + info[i] = 0; + continue; + } + int sl = fmt.indexOf('/'); + if (sl < 0) { + info[i] = (char) fmt.length(); + } else { + String wfmt = fmt.substring(sl+1); + fmt = fmt.substring(0, sl); + info[i] = (char)( fmt.length() + (wfmt.length() * 16) ); + } + } + INSTRUCTION_INFO = info; + INSTRUCTION_NAMES = names; + INSTRUCTION_POPS = pops; + } + + public static class Instruction implements Cloneable { + byte[] codeBase; + int pc; + int bc; + int info; + int wide; + int len; + Instruction(byte[] codeBase, int pc) { + this.codeBase = codeBase; + init(pc); + } + public Instruction clone() { + try { + return (Instruction) super.clone(); + } catch (CloneNotSupportedException ex) { + throw new InternalError(); + } + } + private Instruction init(int pc) { + this.pc = pc; + this.bc = codeBase[pc] & 0xFF; + this.info = INSTRUCTION_INFO[bc]; + this.wide = 0; + this.len = (info & 0x0F); + if (len == 0) + computeLength(); + return this; + } + Instruction next() { + if (len == 0 && bc != 0) throw new InternalError(); + int npc = pc + len; + if (npc == codeBase.length) + return null; + return init(npc); + } + void forceNext(int newLen) { + bc = opc_nop; + len = newLen; + } + + public String toString() { + StringBuilder buf = new StringBuilder(); + buf.append(pc).append(":").append(INSTRUCTION_NAMES[bc]); + switch (len) { + case 3: buf.append(" ").append(u2At(1)); break; + case 5: buf.append(" ").append(u2At(1)).append(" ").append(u2At(3)); break; + default: for (int i = 1; i < len; i++) buf.append(" ").append(u1At(1)); + } + return buf.toString(); + } + + // these are the hard parts + private void computeLength() { + int cases; + switch (bc) { + case opc_wide: + bc = codeBase[pc + 1]; + info = INSTRUCTION_INFO[bc]; + len = ((info >> 4) & 0x0F); + if (len == 0) throw new RuntimeException("misplaced wide bytecode: "+bc); + return; + + case opc_tableswitch: + cases = (u4At(alignedIntOffset(2)) - u4At(alignedIntOffset(1)) + 1); + len = alignedIntOffset(3 + cases*1); + return; + + case opc_lookupswitch: + cases = u4At(alignedIntOffset(1)); + len = alignedIntOffset(2 + cases*2); + return; + + default: + throw new RuntimeException("unknown bytecode: "+bc); + } + } + // switch code + // clget the Nth int (where 0 is the first after the opcode itself) + public int alignedIntOffset(int n) { + int pos = pc + 1; + pos += ((-pos) & 0x03); // align it + pos += (n * 4); + return pos - pc; + } + public int u1At(int pos) { + return (codeBase[pc+pos] & 0xFF); + } + public int u2At(int pos) { + return (u1At(pos+0)<<8) + u1At(pos+1); + } + public int u4At(int pos) { + return (u2At(pos+0)<<16) + u2At(pos+2); + } + public void u1AtPut(int pos, int x) { + codeBase[pc+pos] = (byte)x; + } + public void u2AtPut(int pos, int x) { + codeBase[pc+pos+0] = (byte)(x >> 8); + codeBase[pc+pos+1] = (byte)(x >> 0); + } + } + + static String simplifyType(String type) { + String simpleType = OBJ_SIGNATURE.matcher(type).replaceAll("L"); + assert(simpleType.matches("^\\([A-Z]*\\)[A-Z]$")); + // change (DD)D to (D_D_)D_ + simpleType = WIDE_SIGNATURE.matcher(simpleType).replaceAll("\\0_"); + return simpleType; + } + static int argsize(String type) { + return simplifyType(type).length()-3; + } + private static final Pattern OBJ_SIGNATURE = Pattern.compile("\\[*L[^;]*;|\\[+[A-Z]"); + private static final Pattern WIDE_SIGNATURE = Pattern.compile("[JD]"); +} diff --git a/jdk/test/java/io/BufferedReader/BigMark.java b/jdk/test/java/io/BufferedReader/BigMark.java index fe336a41a9a..4cedfa6081a 100644 --- a/jdk/test/java/io/BufferedReader/BigMark.java +++ b/jdk/test/java/io/BufferedReader/BigMark.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/BufferedReader/ReadLineSync.java b/jdk/test/java/io/BufferedReader/ReadLineSync.java index 2af83e47d6f..f13006c4cff 100644 --- a/jdk/test/java/io/BufferedReader/ReadLineSync.java +++ b/jdk/test/java/io/BufferedReader/ReadLineSync.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/ByteArrayInputStream/Skip.java b/jdk/test/java/io/ByteArrayInputStream/Skip.java new file mode 100644 index 00000000000..9364bd7eaac --- /dev/null +++ b/jdk/test/java/io/ByteArrayInputStream/Skip.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* @test + * @bug 6720170 + * @summary check for ByteArrayInputStream.skip + */ + +import java.io.*; + +public class Skip { + private static void dotest(InputStream in, int curpos, long total, + long toskip, long expected) + throws Exception + { + System.err.println("\nCurrently at pos = " + curpos + + "\nTotal bytes in the stream = " + total + + "\nNumber of bytes to skip = " + toskip + + "\nNumber of bytes that should be skipped = " + + expected); + + // position to curpos; EOF if negative + in.reset(); + int avail = curpos >= 0 ? curpos : in.available(); + long n = in.skip(avail); + if (n != avail) { + throw new RuntimeException("Unexpected number of bytes skipped = " + n); + } + + long skipped = in.skip(toskip); + System.err.println("actual number skipped: "+ skipped); + + if (skipped != expected) { + throw new RuntimeException("Unexpected number of bytes skipped = " + skipped); + } + } + + public static void main(String argv[]) throws Exception { + int total = 1024; + ByteArrayInputStream in = new ByteArrayInputStream(new byte[total]); + + /* test for skip */ + dotest(in, 0, total, 23, 23); + dotest(in, 10, total, 23, 23); + + /* test for negative skip */ + dotest(in, 0, total, -23, 0); + + /* check for skip after EOF */ + dotest(in, -1, total, 20, 0); + + /* check for skip beyond EOF starting from before EOF */ + dotest(in, 0, total, total+20, total); + + /* check for skip if the pos + toskip causes integer overflow */ + dotest(in, 10, total, Long.MAX_VALUE, total-10); + } +} diff --git a/jdk/test/java/io/DataInputStream/OpsAfterClose.java b/jdk/test/java/io/DataInputStream/OpsAfterClose.java index a54926b2ed1..15a0c3f311f 100644 --- a/jdk/test/java/io/DataInputStream/OpsAfterClose.java +++ b/jdk/test/java/io/DataInputStream/OpsAfterClose.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/DataInputStream/ReadFully.java b/jdk/test/java/io/DataInputStream/ReadFully.java index 53c0ee5c41f..48408ca4ffa 100644 --- a/jdk/test/java/io/DataInputStream/ReadFully.java +++ b/jdk/test/java/io/DataInputStream/ReadFully.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/File/Basic.java b/jdk/test/java/io/File/Basic.java index 3942e03c6f6..a1e3ee34ea8 100644 --- a/jdk/test/java/io/File/Basic.java +++ b/jdk/test/java/io/File/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/File/DeleteOnExit.java b/jdk/test/java/io/File/DeleteOnExit.java index b332bf9c88b..02a9d4712db 100644 --- a/jdk/test/java/io/File/DeleteOnExit.java +++ b/jdk/test/java/io/File/DeleteOnExit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/File/DeleteOnExitNPE.java b/jdk/test/java/io/File/DeleteOnExitNPE.java index 50a29c3c882..907f2f0cf93 100644 --- a/jdk/test/java/io/File/DeleteOnExitNPE.java +++ b/jdk/test/java/io/File/DeleteOnExitNPE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/File/IsHidden.java b/jdk/test/java/io/File/IsHidden.java index e34fcc39910..9e062fe61e3 100644 --- a/jdk/test/java/io/File/IsHidden.java +++ b/jdk/test/java/io/File/IsHidden.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/File/SetAccess.java b/jdk/test/java/io/File/SetAccess.java index 355740934b8..bb88ec46258 100644 --- a/jdk/test/java/io/File/SetAccess.java +++ b/jdk/test/java/io/File/SetAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/File/SetReadOnly.java b/jdk/test/java/io/File/SetReadOnly.java index 1c1301bf7b5..f06837a477d 100644 --- a/jdk/test/java/io/File/SetReadOnly.java +++ b/jdk/test/java/io/File/SetReadOnly.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/FileInputStream/LargeFileAvailable.java b/jdk/test/java/io/FileInputStream/LargeFileAvailable.java new file mode 100644 index 00000000000..35c9ce47483 --- /dev/null +++ b/jdk/test/java/io/FileInputStream/LargeFileAvailable.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6402006 + * @summary Test if available returns correct value when reading + * a large file. + */ + +import java.io.*; +import java.nio.ByteBuffer; +import java.nio.channels.*; +import static java.nio.file.StandardOpenOption.*; + +public class LargeFileAvailable { + private static final long FILESIZE = 7405576182L; + public static void main(String args[]) throws Exception { + File file = createLargeFile(FILESIZE); + try (FileInputStream fis = new FileInputStream(file)) { + if (file.length() != FILESIZE) { + throw new RuntimeException("unexpected file size = " + file.length()); + } + + long bigSkip = 3110608882L; + long remaining = FILESIZE; + remaining -= skipBytes(fis, bigSkip, remaining); + remaining -= skipBytes(fis, 10L, remaining); + remaining -= skipBytes(fis, bigSkip, remaining); + if (fis.available() != (int) remaining) { + throw new RuntimeException("available() returns " + + fis.available() + + " but expected " + remaining); + } + } finally { + file.delete(); + } + } + + // Skip toSkip number of bytes and expect that the available() method + // returns avail number of bytes. + private static long skipBytes(InputStream is, long toSkip, long avail) + throws IOException { + long skip = is.skip(toSkip); + if (skip != toSkip) { + throw new RuntimeException("skip() returns " + skip + + " but expected " + toSkip); + } + long remaining = avail - skip; + int expected = remaining >= Integer.MAX_VALUE + ? Integer.MAX_VALUE + : (int) remaining; + + System.out.println("Skipped " + skip + " bytes " + + " available() returns " + expected + + " remaining=" + remaining); + if (is.available() != expected) { + throw new RuntimeException("available() returns " + + is.available() + " but expected " + expected); + } + return skip; + } + + private static File createLargeFile(long filesize) throws Exception { + // Create a large file as a sparse file if possible + File largefile = File.createTempFile("largefile", null); + // re-create as a sparse file + largefile.toPath().delete(); + try (FileChannel fc = + FileChannel.open(largefile.toPath(), + CREATE_NEW, WRITE, SPARSE)) { + ByteBuffer bb = ByteBuffer.allocate(1).put((byte)1); + bb.rewind(); + int rc = fc.write(bb, filesize-1); + if (rc != 1) { + throw new RuntimeException("Failed to write 1 byte to the large file"); + } + } + return largefile; + } +} diff --git a/jdk/test/java/io/FileInputStream/LeadingSlash.java b/jdk/test/java/io/FileInputStream/LeadingSlash.java index 3b572430258..8e8595d7bb2 100644 --- a/jdk/test/java/io/FileInputStream/LeadingSlash.java +++ b/jdk/test/java/io/FileInputStream/LeadingSlash.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/InputStream/OpsAfterClose.java b/jdk/test/java/io/InputStream/OpsAfterClose.java index 9685782ff00..0fbd12f6c4d 100644 --- a/jdk/test/java/io/InputStream/OpsAfterClose.java +++ b/jdk/test/java/io/InputStream/OpsAfterClose.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/InputStream/ReadParams.java b/jdk/test/java/io/InputStream/ReadParams.java index 602445cd0a2..675c45c6b66 100644 --- a/jdk/test/java/io/InputStream/ReadParams.java +++ b/jdk/test/java/io/InputStream/ReadParams.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/InputStreamReader/GrowAfterEOF.java b/jdk/test/java/io/InputStreamReader/GrowAfterEOF.java index 96bb2a971a4..79a603b2a57 100644 --- a/jdk/test/java/io/InputStreamReader/GrowAfterEOF.java +++ b/jdk/test/java/io/InputStreamReader/GrowAfterEOF.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/ObjectInputStream/ResolveProxyClass.java b/jdk/test/java/io/ObjectInputStream/ResolveProxyClass.java index eaea1c32ca1..c89f6491140 100644 --- a/jdk/test/java/io/ObjectInputStream/ResolveProxyClass.java +++ b/jdk/test/java/io/ObjectInputStream/ResolveProxyClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/PrintStream/FailingConstructors.java b/jdk/test/java/io/PrintStream/FailingConstructors.java new file mode 100644 index 00000000000..1022bb9d311 --- /dev/null +++ b/jdk/test/java/io/PrintStream/FailingConstructors.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 7000511 + * @summary PrintStream, PrintWriter, Formatter, Scanner leave files open when + * exception thrown + */ + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.PrintStream; +import java.io.UnsupportedEncodingException; + +public class FailingConstructors { + static final String fileName = "FailingConstructorsTest"; + static final String UNSUPPORTED_CHARSET = "unknownCharset"; + static final String FILE_CONTENTS = "This is a small file!"; + + private static void realMain(String[] args) throws Throwable { + test(false, new File(fileName)); + + /* create the file and write its contents */ + File file = File.createTempFile(fileName, null); + file.deleteOnExit(); + FileOutputStream fos = new FileOutputStream(file); + fos.write(FILE_CONTENTS.getBytes()); + fos.close(); + + test(true, file); + file.delete(); + } + + private static void test(boolean exists, File file) throws Throwable { + /* PrintStream(File file, String csn) */ + try { + new PrintStream(file, UNSUPPORTED_CHARSET); + fail(); + } catch(FileNotFoundException|UnsupportedEncodingException e) { + pass(); + } + + check(exists, file); + + try { + new PrintStream(file, null); + fail(); + } catch(FileNotFoundException|NullPointerException e) { + pass(); + } + + check(exists, file); + + /* PrintStream(String fileName, String csn) */ + try { + new PrintStream(file.getName(), UNSUPPORTED_CHARSET); + fail(); + } catch(FileNotFoundException|UnsupportedEncodingException e) { + pass(); + } + + check(exists, file); + + try { + new PrintStream(file.getName(), null); + fail(); + } catch(FileNotFoundException|NullPointerException e) { + pass(); + } + + check(exists, file); + } + + private static void check(boolean exists, File file) { + if (exists) { + /* the file should be unchanged */ + verifyContents(file); + } else { + /* the file should not have been created */ + if (file.exists()) { fail(file + " should not have been created"); } + } + } + + private static void verifyContents(File file) { + try (FileInputStream fis = new FileInputStream(file)) { + byte[] contents = FILE_CONTENTS.getBytes(); + int read, count = 0; + while ((read = fis.read()) != -1) { + if (read != contents[count++]) { + fail("file contents have been altered"); + return; + } + } + } catch (IOException ioe) { + unexpected(ioe); + } + } + + //--------------------- Infrastructure --------------------------- + static volatile int passed = 0, failed = 0; + static void pass() {passed++;} + static void fail() {failed++; Thread.dumpStack();} + static void fail(String message) {System.out.println(message); fail(); } + static void unexpected(Throwable t) {failed++; t.printStackTrace();} + public static void main(String[] args) throws Throwable { + try {realMain(args);} catch (Throwable t) {unexpected(t);} + System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); + if (failed > 0) throw new AssertionError("Some tests failed");} +} diff --git a/jdk/test/java/io/PrintWriter/FailingConstructors.java b/jdk/test/java/io/PrintWriter/FailingConstructors.java new file mode 100644 index 00000000000..af4fa108473 --- /dev/null +++ b/jdk/test/java/io/PrintWriter/FailingConstructors.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 7000511 + * @summary PrintStream, PrintWriter, Formatter, Scanner leave files open when + * exception thrown + */ + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; + +public class FailingConstructors { + static final String fileName = "FailingConstructorsTest"; + static final String UNSUPPORTED_CHARSET = "unknownCharset"; + static final String FILE_CONTENTS = "This is a small file!"; + + private static void realMain(String[] args) throws Throwable { + test(false, new File(fileName)); + + /* create the file and write its contents */ + File file = File.createTempFile(fileName, null); + file.deleteOnExit(); + FileOutputStream fos = new FileOutputStream(file); + fos.write(FILE_CONTENTS.getBytes()); + fos.close(); + + test(true, file); + file.delete(); + } + + private static void test(boolean exists, File file) throws Throwable { + /* PrintWriter(File file, String csn) */ + try { + new PrintWriter(file, UNSUPPORTED_CHARSET); + fail(); + } catch(FileNotFoundException|UnsupportedEncodingException e) { + pass(); + } + + check(exists, file); + + try { + new PrintWriter(file, null); + fail(); + } catch(FileNotFoundException|NullPointerException e) { + pass(); + } + + check(exists, file); + + /* PrintWriter(String fileName, String csn) */ + try { + new PrintWriter(file.getName(), UNSUPPORTED_CHARSET); + fail(); + } catch(FileNotFoundException|UnsupportedEncodingException e) { + pass(); + } + + check(exists, file); + + try { + new PrintWriter(file.getName(), null); + fail(); + } catch(FileNotFoundException|NullPointerException e) { + pass(); + } + + check(exists, file); + } + + private static void check(boolean exists, File file) { + if (exists) { + /* the file should be unchanged */ + verifyContents(file); + } else { + /* the file should not have been created */ + if (file.exists()) { fail(file + " should not have been created"); } + } + } + + private static void verifyContents(File file) { + try (FileInputStream fis = new FileInputStream(file)) { + byte[] contents = FILE_CONTENTS.getBytes(); + int read, count = 0; + while ((read = fis.read()) != -1) { + if (read != contents[count++]) { + fail("file contents have been altered"); + return; + } + } + } catch (IOException ioe) { + unexpected(ioe); + } + } + + //--------------------- Infrastructure --------------------------- + static volatile int passed = 0, failed = 0; + static void pass() {passed++;} + static void fail() {failed++; Thread.dumpStack();} + static void fail(String message) {System.out.println(message); fail(); } + static void unexpected(Throwable t) {failed++; t.printStackTrace();} + public static void main(String[] args) throws Throwable { + try {realMain(args);} catch (Throwable t) {unexpected(t);} + System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); + if (failed > 0) throw new AssertionError("Some tests failed");} +} diff --git a/jdk/test/java/io/RandomAccessFile/EOF.java b/jdk/test/java/io/RandomAccessFile/EOF.java index 50b48de77a7..4571b675188 100644 --- a/jdk/test/java/io/RandomAccessFile/EOF.java +++ b/jdk/test/java/io/RandomAccessFile/EOF.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/RandomAccessFile/ParameterCheck.java b/jdk/test/java/io/RandomAccessFile/ParameterCheck.java index e483929cdf0..e6f1cd3665f 100644 --- a/jdk/test/java/io/RandomAccessFile/ParameterCheck.java +++ b/jdk/test/java/io/RandomAccessFile/ParameterCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/RandomAccessFile/ReadLine.java b/jdk/test/java/io/RandomAccessFile/ReadLine.java index 1d63ce08aeb..c31ddc5f915 100644 --- a/jdk/test/java/io/RandomAccessFile/ReadLine.java +++ b/jdk/test/java/io/RandomAccessFile/ReadLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/RandomAccessFile/Seek.java b/jdk/test/java/io/RandomAccessFile/Seek.java index 2a505e58fdc..21e4b7faeb4 100644 --- a/jdk/test/java/io/RandomAccessFile/Seek.java +++ b/jdk/test/java/io/RandomAccessFile/Seek.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/RandomAccessFile/WriteBytesChars.java b/jdk/test/java/io/RandomAccessFile/WriteBytesChars.java index bbb94943b74..cc89709b7e7 100644 --- a/jdk/test/java/io/RandomAccessFile/WriteBytesChars.java +++ b/jdk/test/java/io/RandomAccessFile/WriteBytesChars.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/RandomAccessFile/WriteUTF.java b/jdk/test/java/io/RandomAccessFile/WriteUTF.java index c3d13e0493a..d95cc047268 100644 --- a/jdk/test/java/io/RandomAccessFile/WriteUTF.java +++ b/jdk/test/java/io/RandomAccessFile/WriteUTF.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/RandomAccessFile/skipBytes/SkipBytes.java b/jdk/test/java/io/RandomAccessFile/skipBytes/SkipBytes.java index 0e8723ebe02..2cf82899d8c 100644 --- a/jdk/test/java/io/RandomAccessFile/skipBytes/SkipBytes.java +++ b/jdk/test/java/io/RandomAccessFile/skipBytes/SkipBytes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Reader/Skip.java b/jdk/test/java/io/Reader/Skip.java index 08f627f7a3a..09735345c83 100644 --- a/jdk/test/java/io/Reader/Skip.java +++ b/jdk/test/java/io/Reader/Skip.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Reader/SkipNegative.java b/jdk/test/java/io/Reader/SkipNegative.java index e1aec0ca595..2d8186eb14f 100644 --- a/jdk/test/java/io/Reader/SkipNegative.java +++ b/jdk/test/java/io/Reader/SkipNegative.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/ClassCastExceptionDetail/Read.java b/jdk/test/java/io/Serializable/ClassCastExceptionDetail/Read.java index 52373c50043..545d8062ec5 100644 --- a/jdk/test/java/io/Serializable/ClassCastExceptionDetail/Read.java +++ b/jdk/test/java/io/Serializable/ClassCastExceptionDetail/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/NPEProvoker/NPEProvoker.java b/jdk/test/java/io/Serializable/NPEProvoker/NPEProvoker.java index 6edae09dadd..47a8516a594 100644 --- a/jdk/test/java/io/Serializable/NPEProvoker/NPEProvoker.java +++ b/jdk/test/java/io/Serializable/NPEProvoker/NPEProvoker.java @@ -56,7 +56,7 @@ public class NPEProvoker implements java.io.Externalizable { public static void main(String[] args) { System.err.println("\n Regression test for bug 6541870\n"); try { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.add(new NPEProvoker()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); diff --git a/jdk/test/java/io/Serializable/auditStreamSubclass/AuditStreamSubclass.java b/jdk/test/java/io/Serializable/auditStreamSubclass/AuditStreamSubclass.java index e27eaf4e97b..973a539318e 100644 --- a/jdk/test/java/io/Serializable/auditStreamSubclass/AuditStreamSubclass.java +++ b/jdk/test/java/io/Serializable/auditStreamSubclass/AuditStreamSubclass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/backRefCNFException/Read.java b/jdk/test/java/io/Serializable/backRefCNFException/Read.java index 9bc69ada6f9..27d3801bbe0 100644 --- a/jdk/test/java/io/Serializable/backRefCNFException/Read.java +++ b/jdk/test/java/io/Serializable/backRefCNFException/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/checkModifiers/CheckModifiers.java b/jdk/test/java/io/Serializable/checkModifiers/CheckModifiers.java index d984ad54307..c3bd779f3aa 100644 --- a/jdk/test/java/io/Serializable/checkModifiers/CheckModifiers.java +++ b/jdk/test/java/io/Serializable/checkModifiers/CheckModifiers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/classDescFlagConflict/Read.java b/jdk/test/java/io/Serializable/classDescFlagConflict/Read.java index f7eb5e51250..06e5e9e16ec 100644 --- a/jdk/test/java/io/Serializable/classDescFlagConflict/Read.java +++ b/jdk/test/java/io/Serializable/classDescFlagConflict/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/classDescHooks/ClassDescHooks.java b/jdk/test/java/io/Serializable/classDescHooks/ClassDescHooks.java index 9e382fe70a0..e31899e8479 100644 --- a/jdk/test/java/io/Serializable/classDescHooks/ClassDescHooks.java +++ b/jdk/test/java/io/Serializable/classDescHooks/ClassDescHooks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/cloneArray/CloneArray.java b/jdk/test/java/io/Serializable/cloneArray/CloneArray.java new file mode 100644 index 00000000000..650ac3ccb9f --- /dev/null +++ b/jdk/test/java/io/Serializable/cloneArray/CloneArray.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* @test + * @bug 6990094 + * @summary Verify ObjectInputStream.cloneArray works on many kinds of arrays + * @author Stuart Marks, Joseph D. Darcy + */ + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamException; +import java.io.Serializable; + +public class CloneArray { + static Object replacement; + + static class Resolver implements Serializable { + private Object readResolve() throws ObjectStreamException { + return replacement; + } + } + + private static void test(Object rep) + throws IOException, ClassNotFoundException { + + try(ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + try(ObjectOutputStream oos = new ObjectOutputStream(baos)) { + oos.writeObject(new Resolver()); + oos.writeObject(new Resolver()); + } + + Object o1; + Object o2; + try(ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + ObjectInputStream ois = new ObjectInputStream(bais)) { + replacement = rep; + o1 = ois.readUnshared(); + o2 = ois.readUnshared(); + } + + if (o1 == o2) + throw new AssertionError("o1 and o2 must not be identical"); + } + } + + public static void main(String[] args) + throws IOException, ClassNotFoundException { + Object[] replacements = { + new byte[] {1}, + new char[] {'2'}, + new short[] {3}, + new int[] {4}, + new long[] {5}, + new float[] {6.0f}, + new double[] {7.0}, + new boolean[] {true}, + new Object[] {"A string."} + }; + + for(Object replacement : replacements) { + test(replacement); + } + } +} diff --git a/jdk/test/java/io/Serializable/duplicateSerialFields/Test.java b/jdk/test/java/io/Serializable/duplicateSerialFields/Test.java index 020912f21df..b1cc4264240 100644 --- a/jdk/test/java/io/Serializable/duplicateSerialFields/Test.java +++ b/jdk/test/java/io/Serializable/duplicateSerialFields/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/enum/badResolve/Read.java b/jdk/test/java/io/Serializable/enum/badResolve/Read.java index c2b4a5c1d30..db7d56b0b01 100644 --- a/jdk/test/java/io/Serializable/enum/badResolve/Read.java +++ b/jdk/test/java/io/Serializable/enum/badResolve/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/enum/constantSubclasses/Read.java b/jdk/test/java/io/Serializable/enum/constantSubclasses/Read.java index d1145768bb5..cb91adda84a 100644 --- a/jdk/test/java/io/Serializable/enum/constantSubclasses/Read.java +++ b/jdk/test/java/io/Serializable/enum/constantSubclasses/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/enum/missingConstant/Read.java b/jdk/test/java/io/Serializable/enum/missingConstant/Read.java index 4bd6075adf2..76dd4487347 100644 --- a/jdk/test/java/io/Serializable/enum/missingConstant/Read.java +++ b/jdk/test/java/io/Serializable/enum/missingConstant/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/evolution/RenamePackage/run.sh b/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh index 02c7809c5d8..8b1ea63bca1 100644 --- a/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh +++ b/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/io/Serializable/fieldTypeString/Read.java b/jdk/test/java/io/Serializable/fieldTypeString/Read.java index b8b7dd68bef..5152fbe612f 100644 --- a/jdk/test/java/io/Serializable/fieldTypeString/Read.java +++ b/jdk/test/java/io/Serializable/fieldTypeString/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/illegalHandle/Test.java b/jdk/test/java/io/Serializable/illegalHandle/Test.java index 74c7ad96c20..96ffc537bc8 100644 --- a/jdk/test/java/io/Serializable/illegalHandle/Test.java +++ b/jdk/test/java/io/Serializable/illegalHandle/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/longString/LongString.java b/jdk/test/java/io/Serializable/longString/LongString.java index 7d342b1b9f0..3e1b4c3129f 100644 --- a/jdk/test/java/io/Serializable/longString/LongString.java +++ b/jdk/test/java/io/Serializable/longString/LongString.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/oldTests/AnnotateClass.java b/jdk/test/java/io/Serializable/oldTests/AnnotateClass.java index 17f3ab1180e..5290018e218 100644 --- a/jdk/test/java/io/Serializable/oldTests/AnnotateClass.java +++ b/jdk/test/java/io/Serializable/oldTests/AnnotateClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/oldTests/ArrayFields.java b/jdk/test/java/io/Serializable/oldTests/ArrayFields.java index 6833a039a81..5fe9b231fd2 100644 --- a/jdk/test/java/io/Serializable/oldTests/ArrayFields.java +++ b/jdk/test/java/io/Serializable/oldTests/ArrayFields.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/oldTests/ArraysOfArrays.java b/jdk/test/java/io/Serializable/oldTests/ArraysOfArrays.java index ba5fc0dec19..1d8f0e73afa 100644 --- a/jdk/test/java/io/Serializable/oldTests/ArraysOfArrays.java +++ b/jdk/test/java/io/Serializable/oldTests/ArraysOfArrays.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/oldTests/BinaryTree.java b/jdk/test/java/io/Serializable/oldTests/BinaryTree.java index b4d824fdff7..73b7799f6c5 100644 --- a/jdk/test/java/io/Serializable/oldTests/BinaryTree.java +++ b/jdk/test/java/io/Serializable/oldTests/BinaryTree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/oldTests/CircularList.java b/jdk/test/java/io/Serializable/oldTests/CircularList.java index bd5814e0891..a42f8acf8ac 100644 --- a/jdk/test/java/io/Serializable/oldTests/CircularList.java +++ b/jdk/test/java/io/Serializable/oldTests/CircularList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/oldTests/SimpleArrays.java b/jdk/test/java/io/Serializable/oldTests/SimpleArrays.java index bbf4c8556de..3ae4b4d04a8 100644 --- a/jdk/test/java/io/Serializable/oldTests/SimpleArrays.java +++ b/jdk/test/java/io/Serializable/oldTests/SimpleArrays.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/oldTests/WritePrimitive.java b/jdk/test/java/io/Serializable/oldTests/WritePrimitive.java index 3976cd4164b..f2bd28d75f7 100644 --- a/jdk/test/java/io/Serializable/oldTests/WritePrimitive.java +++ b/jdk/test/java/io/Serializable/oldTests/WritePrimitive.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/packageAccess/Test.java b/jdk/test/java/io/Serializable/packageAccess/Test.java index 15d2e4ce0e0..464ccb93504 100644 --- a/jdk/test/java/io/Serializable/packageAccess/Test.java +++ b/jdk/test/java/io/Serializable/packageAccess/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/parents/EvolvedClass.java b/jdk/test/java/io/Serializable/parents/EvolvedClass.java index edb8dee8106..90559e9c3dc 100644 --- a/jdk/test/java/io/Serializable/parents/EvolvedClass.java +++ b/jdk/test/java/io/Serializable/parents/EvolvedClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/parents/OriginalClass.java b/jdk/test/java/io/Serializable/parents/OriginalClass.java index 2f21c494db5..559412ec894 100644 --- a/jdk/test/java/io/Serializable/parents/OriginalClass.java +++ b/jdk/test/java/io/Serializable/parents/OriginalClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/proxy/Basic.java b/jdk/test/java/io/Serializable/proxy/Basic.java index 92c989b2be7..402f797b139 100644 --- a/jdk/test/java/io/Serializable/proxy/Basic.java +++ b/jdk/test/java/io/Serializable/proxy/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/proxy/skipMissing/Read.java b/jdk/test/java/io/Serializable/proxy/skipMissing/Read.java index 511bb42d715..ff18ec777e0 100644 --- a/jdk/test/java/io/Serializable/proxy/skipMissing/Read.java +++ b/jdk/test/java/io/Serializable/proxy/skipMissing/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/proxy/skipMissing/Write.java b/jdk/test/java/io/Serializable/proxy/skipMissing/Write.java index c4b06f2be9d..fac6556c11e 100644 --- a/jdk/test/java/io/Serializable/proxy/skipMissing/Write.java +++ b/jdk/test/java/io/Serializable/proxy/skipMissing/Write.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/readObjectNoData/Read.java b/jdk/test/java/io/Serializable/readObjectNoData/Read.java index e786c6cc47a..f2550030a50 100644 --- a/jdk/test/java/io/Serializable/readObjectNoData/Read.java +++ b/jdk/test/java/io/Serializable/readObjectNoData/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/serialver/classpath/run.sh b/jdk/test/java/io/Serializable/serialver/classpath/run.sh index c80f6d25c7d..9cfb6235278 100644 --- a/jdk/test/java/io/Serializable/serialver/classpath/run.sh +++ b/jdk/test/java/io/Serializable/serialver/classpath/run.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/io/Serializable/serialver/nested/run.sh b/jdk/test/java/io/Serializable/serialver/nested/run.sh index cef7378df9c..77f8eff0689 100644 --- a/jdk/test/java/io/Serializable/serialver/nested/run.sh +++ b/jdk/test/java/io/Serializable/serialver/nested/run.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/io/Serializable/skipWriteObject/Read.java b/jdk/test/java/io/Serializable/skipWriteObject/Read.java index e1fcfe79f0c..cd035cfefa7 100644 --- a/jdk/test/java/io/Serializable/skipWriteObject/Read.java +++ b/jdk/test/java/io/Serializable/skipWriteObject/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/skippedObjCNFException/Read.java b/jdk/test/java/io/Serializable/skippedObjCNFException/Read.java index b50265099b5..1be47aac77c 100644 --- a/jdk/test/java/io/Serializable/skippedObjCNFException/Read.java +++ b/jdk/test/java/io/Serializable/skippedObjCNFException/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/stopCustomDeserialization/Read.java b/jdk/test/java/io/Serializable/stopCustomDeserialization/Read.java index 156fa50b8c8..afdffe6df7c 100644 --- a/jdk/test/java/io/Serializable/stopCustomDeserialization/Read.java +++ b/jdk/test/java/io/Serializable/stopCustomDeserialization/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/unresolvedClassDesc/Read.java b/jdk/test/java/io/Serializable/unresolvedClassDesc/Read.java index c3fc28bde81..78d1ea2d413 100644 --- a/jdk/test/java/io/Serializable/unresolvedClassDesc/Read.java +++ b/jdk/test/java/io/Serializable/unresolvedClassDesc/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/unshared/Read.java b/jdk/test/java/io/Serializable/unshared/Read.java index 7d7c9d49ba6..f983951968e 100644 --- a/jdk/test/java/io/Serializable/unshared/Read.java +++ b/jdk/test/java/io/Serializable/unshared/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/Serializable/wrongReturnTypes/Read.java b/jdk/test/java/io/Serializable/wrongReturnTypes/Read.java index a41599f1ea7..98d301995ff 100644 --- a/jdk/test/java/io/Serializable/wrongReturnTypes/Read.java +++ b/jdk/test/java/io/Serializable/wrongReturnTypes/Read.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/StreamTokenizer/Comment.java b/jdk/test/java/io/StreamTokenizer/Comment.java index f1192fe6205..bd6c47eca01 100644 --- a/jdk/test/java/io/StreamTokenizer/Comment.java +++ b/jdk/test/java/io/StreamTokenizer/Comment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/pathNames/GeneralWin32.java b/jdk/test/java/io/pathNames/GeneralWin32.java index 90802eee49f..aef714f9cf4 100644 --- a/jdk/test/java/io/pathNames/GeneralWin32.java +++ b/jdk/test/java/io/pathNames/GeneralWin32.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/io/readBytes/ReadBytesBounds.java b/jdk/test/java/io/readBytes/ReadBytesBounds.java index eef870b7408..3f51456a995 100644 --- a/jdk/test/java/io/readBytes/ReadBytesBounds.java +++ b/jdk/test/java/io/readBytes/ReadBytesBounds.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Character/CheckScript.java b/jdk/test/java/lang/Character/CheckScript.java index 88629136521..a286643c8cf 100644 --- a/jdk/test/java/lang/Character/CheckScript.java +++ b/jdk/test/java/lang/Character/CheckScript.java @@ -1,8 +1,7 @@ /** * @test - * @bug 6945564 + * @bug 6945564 6959267 * @summary Check that the j.l.Character.UnicodeScript - * @ignore don't run until #6903266 is integrated */ import java.io.*; @@ -15,11 +14,15 @@ public class CheckScript { public static void main(String[] args) throws Exception { - if (args.length != 1) { - System.out.println("java CharacterScript script.txt"); - System.exit(1); + BufferedReader sbfr = null; + if (args.length == 0) { + sbfr = new BufferedReader(new FileReader(new File(System.getProperty("test.src", "."), "Scripts.txt"))); + } else if (args.length == 1) { + sbfr = new BufferedReader(new FileReader(args[0])); + } else { + System.out.println("java CharacterScript Scripts.txt"); + throw new RuntimeException("Datafile name should be specified."); } - BufferedReader sbfr = new BufferedReader(new FileReader(args[0])); Matcher m = Pattern.compile("(\\p{XDigit}+)(?:\\.{2}(\\p{XDigit}+))?\\s+;\\s+(\\w+)\\s+#.*").matcher(""); String line = null; HashMap> scripts = new HashMap<>(); diff --git a/jdk/test/java/lang/Character/Scripts.txt b/jdk/test/java/lang/Character/Scripts.txt index fbeafe7a5ae..70a670703ae 100644 --- a/jdk/test/java/lang/Character/Scripts.txt +++ b/jdk/test/java/lang/Character/Scripts.txt @@ -1,8 +1,8 @@ -# Scripts-5.2.0.txt -# Date: 2009-08-22, 04:58:43 GMT [MD] +# Scripts-6.0.0.txt +# Date: 2010-08-19, 00:48:47 GMT [MD] # # Unicode Character Database -# Copyright (c) 1991-2009 Unicode, Inc. +# Copyright (c) 1991-2010 Unicode, Inc. # For terms of use, see http://www.unicode.org/terms_of_use.html # For documentation, see http://www.unicode.org/reports/tr44/ @@ -73,7 +73,7 @@ 02C2..02C5 ; Common # Sk [4] MODIFIER LETTER LEFT ARROWHEAD..MODIFIER LETTER DOWN ARROWHEAD 02C6..02D1 ; Common # Lm [12] MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON 02D2..02DF ; Common # Sk [14] MODIFIER LETTER CENTRED RIGHT HALF RING..MODIFIER LETTER CROSS ACCENT -02E5..02EB ; Common # Sk [7] MODIFIER LETTER EXTRA-HIGH TONE BAR..MODIFIER LETTER YANG DEPARTING TONE MARK +02E5..02E9 ; Common # Sk [5] MODIFIER LETTER EXTRA-HIGH TONE BAR..MODIFIER LETTER EXTRA-LOW TONE BAR 02EC ; Common # Lm MODIFIER LETTER VOICING 02ED ; Common # Sk MODIFIER LETTER UNASPIRATED 02EE ; Common # Lm MODIFIER LETTER DOUBLE APOSTROPHE @@ -83,7 +83,6 @@ 0385 ; Common # Sk GREEK DIALYTIKA TONOS 0387 ; Common # Po GREEK ANO TELEIA 0589 ; Common # Po ARMENIAN FULL STOP -0600..0603 ; Common # Cf [4] ARABIC NUMBER SIGN..ARABIC SIGN SAFHA 060C ; Common # Po ARABIC COMMA 061B ; Common # Po ARABIC SEMICOLON 061F ; Common # Po ARABIC QUESTION MARK @@ -92,7 +91,6 @@ 06DD ; Common # Cf ARABIC END OF AYAH 0964..0965 ; Common # Po [2] DEVANAGARI DANDA..DEVANAGARI DOUBLE DANDA 0970 ; Common # Po DEVANAGARI ABBREVIATION SIGN -0CF1..0CF2 ; Common # So [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA 0E3F ; Common # Sc THAI CURRENCY SYMBOL BAHT 0FD5..0FD8 ; Common # So [4] RIGHT-FACING SVASTI SIGN..LEFT-FACING SVASTI SIGN WITH DOTS 10FB ; Common # Po GEORGIAN PARAGRAPH SEPARATOR @@ -148,7 +146,7 @@ 208A..208C ; Common # Sm [3] SUBSCRIPT PLUS SIGN..SUBSCRIPT EQUALS SIGN 208D ; Common # Ps SUBSCRIPT LEFT PARENTHESIS 208E ; Common # Pe SUBSCRIPT RIGHT PARENTHESIS -20A0..20B8 ; Common # Sc [25] EURO-CURRENCY SIGN..TENGE SIGN +20A0..20B9 ; Common # Sc [26] EURO-CURRENCY SIGN..INDIAN RUPEE SIGN 2100..2101 ; Common # So [2] ACCOUNT OF..ADDRESSED TO THE SUBJECT 2102 ; Common # L& DOUBLE-STRUCK CAPITAL C 2103..2106 ; Common # So [4] DEGREE CELSIUS..CADA UNA @@ -157,7 +155,8 @@ 210A..2113 ; Common # L& [10] SCRIPT SMALL G..SCRIPT SMALL L 2114 ; Common # So L B BAR SYMBOL 2115 ; Common # L& DOUBLE-STRUCK CAPITAL N -2116..2118 ; Common # So [3] NUMERO SIGN..SCRIPT CAPITAL P +2116..2117 ; Common # So [2] NUMERO SIGN..SOUND RECORDING COPYRIGHT +2118 ; Common # Sm SCRIPT CAPITAL P 2119..211D ; Common # L& [5] DOUBLE-STRUCK CAPITAL P..DOUBLE-STRUCK CAPITAL R 211E..2123 ; Common # So [6] PRESCRIPTION TAKE..VERSICLE 2124 ; Common # L& DOUBLE-STRUCK CAPITAL Z @@ -213,7 +212,7 @@ 239B..23B3 ; Common # Sm [25] LEFT PARENTHESIS UPPER HOOK..SUMMATION BOTTOM 23B4..23DB ; Common # So [40] TOP SQUARE BRACKET..FUSE 23DC..23E1 ; Common # Sm [6] TOP PARENTHESIS..BOTTOM TORTOISE SHELL BRACKET -23E2..23E8 ; Common # So [7] WHITE TRAPEZIUM..DECIMAL EXPONENT SYMBOL +23E2..23F3 ; Common # So [18] WHITE TRAPEZIUM..HOURGLASS WITH FLOWING SAND 2400..2426 ; Common # So [39] SYMBOL FOR NULL..SYMBOL FOR SUBSTITUTE FORM TWO 2440..244A ; Common # So [11] OCR HOOK..OCR DOUBLE BACKSLASH 2460..249B ; Common # No [60] CIRCLED DIGIT ONE..NUMBER TWENTY FULL STOP @@ -227,18 +226,8 @@ 25F8..25FF ; Common # Sm [8] UPPER LEFT TRIANGLE..LOWER RIGHT TRIANGLE 2600..266E ; Common # So [111] BLACK SUN WITH RAYS..MUSIC NATURAL SIGN 266F ; Common # Sm MUSIC SHARP SIGN -2670..26CD ; Common # So [94] WEST SYRIAC CROSS..DISABLED CAR -26CF..26E1 ; Common # So [19] PICK..RESTRICTED LEFT ENTRY-2 -26E3 ; Common # So HEAVY CIRCLE WITH STROKE AND TWO DOTS ABOVE -26E8..26FF ; Common # So [24] BLACK CROSS ON SHIELD..WHITE FLAG WITH HORIZONTAL MIDDLE BLACK STRIPE -2701..2704 ; Common # So [4] UPPER BLADE SCISSORS..WHITE SCISSORS -2706..2709 ; Common # So [4] TELEPHONE LOCATION SIGN..ENVELOPE -270C..2727 ; Common # So [28] VICTORY HAND..WHITE FOUR POINTED STAR -2729..274B ; Common # So [35] STRESS OUTLINED WHITE STAR..HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK -274D ; Common # So SHADOWED WHITE CIRCLE -274F..2752 ; Common # So [4] LOWER RIGHT DROP-SHADOWED WHITE SQUARE..UPPER RIGHT SHADOWED WHITE SQUARE -2756..275E ; Common # So [9] BLACK DIAMOND MINUS WHITE X..HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT -2761..2767 ; Common # So [7] CURVED STEM PARAGRAPH SIGN ORNAMENT..ROTATED FLORAL HEART BULLET +2670..26FF ; Common # So [144] WEST SYRIAC CROSS..WHITE FLAG WITH HORIZONTAL MIDDLE BLACK STRIPE +2701..2767 ; Common # So [103] UPPER BLADE SCISSORS..ROTATED FLORAL HEART BULLET 2768 ; Common # Ps MEDIUM LEFT PARENTHESIS ORNAMENT 2769 ; Common # Pe MEDIUM RIGHT PARENTHESIS ORNAMENT 276A ; Common # Ps MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT @@ -254,15 +243,13 @@ 2774 ; Common # Ps MEDIUM LEFT CURLY BRACKET ORNAMENT 2775 ; Common # Pe MEDIUM RIGHT CURLY BRACKET ORNAMENT 2776..2793 ; Common # No [30] DINGBAT NEGATIVE CIRCLED DIGIT ONE..DINGBAT NEGATIVE CIRCLED SANS-SERIF NUMBER TEN -2794 ; Common # So HEAVY WIDE-HEADED RIGHTWARDS ARROW -2798..27AF ; Common # So [24] HEAVY SOUTH EAST ARROW..NOTCHED LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW -27B1..27BE ; Common # So [14] NOTCHED UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW..OPEN-OUTLINED RIGHTWARDS ARROW +2794..27BF ; Common # So [44] HEAVY WIDE-HEADED RIGHTWARDS ARROW..DOUBLE CURLY LOOP 27C0..27C4 ; Common # Sm [5] THREE DIMENSIONAL ANGLE..OPEN SUPERSET 27C5 ; Common # Ps LEFT S-SHAPED BAG DELIMITER 27C6 ; Common # Pe RIGHT S-SHAPED BAG DELIMITER 27C7..27CA ; Common # Sm [4] OR WITH DOT INSIDE..VERTICAL BAR WITH HORIZONTAL STROKE 27CC ; Common # Sm LONG DIVISION -27D0..27E5 ; Common # Sm [22] WHITE DIAMOND WITH CENTRED DOT..WHITE SQUARE WITH RIGHTWARDS TICK +27CE..27E5 ; Common # Sm [24] SQUARED LOGICAL AND..WHITE SQUARE WITH RIGHTWARDS TICK 27E6 ; Common # Ps MATHEMATICAL LEFT WHITE SQUARE BRACKET 27E7 ; Common # Pe MATHEMATICAL RIGHT WHITE SQUARE BRACKET 27E8 ; Common # Ps MATHEMATICAL LEFT ANGLE BRACKET @@ -555,27 +542,51 @@ FFFC..FFFD ; Common # So [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHAR 1D7CE..1D7FF ; Common # Nd [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE 1F000..1F02B ; Common # So [44] MAHJONG TILE EAST WIND..MAHJONG TILE BACK 1F030..1F093 ; Common # So [100] DOMINO TILE HORIZONTAL BACK..DOMINO TILE VERTICAL-06-06 +1F0A0..1F0AE ; Common # So [15] PLAYING CARD BACK..PLAYING CARD KING OF SPADES +1F0B1..1F0BE ; Common # So [14] PLAYING CARD ACE OF HEARTS..PLAYING CARD KING OF HEARTS +1F0C1..1F0CF ; Common # So [15] PLAYING CARD ACE OF DIAMONDS..PLAYING CARD BLACK JOKER +1F0D1..1F0DF ; Common # So [15] PLAYING CARD ACE OF CLUBS..PLAYING CARD WHITE JOKER 1F100..1F10A ; Common # No [11] DIGIT ZERO FULL STOP..DIGIT NINE COMMA 1F110..1F12E ; Common # So [31] PARENTHESIZED LATIN CAPITAL LETTER A..CIRCLED WZ -1F131 ; Common # So SQUARED LATIN CAPITAL LETTER B -1F13D ; Common # So SQUARED LATIN CAPITAL LETTER N -1F13F ; Common # So SQUARED LATIN CAPITAL LETTER P -1F142 ; Common # So SQUARED LATIN CAPITAL LETTER S -1F146 ; Common # So SQUARED LATIN CAPITAL LETTER W -1F14A..1F14E ; Common # So [5] SQUARED HV..SQUARED PPV -1F157 ; Common # So NEGATIVE CIRCLED LATIN CAPITAL LETTER H -1F15F ; Common # So NEGATIVE CIRCLED LATIN CAPITAL LETTER P -1F179 ; Common # So NEGATIVE SQUARED LATIN CAPITAL LETTER J -1F17B..1F17C ; Common # So [2] NEGATIVE SQUARED LATIN CAPITAL LETTER L..NEGATIVE SQUARED LATIN CAPITAL LETTER M -1F17F ; Common # So NEGATIVE SQUARED LATIN CAPITAL LETTER P -1F18A..1F18D ; Common # So [4] CROSSED NEGATIVE SQUARED LATIN CAPITAL LETTER P..NEGATIVE SQUARED SA -1F190 ; Common # So SQUARE DJ -1F210..1F231 ; Common # So [34] SQUARED CJK UNIFIED IDEOGRAPH-624B..SQUARED CJK UNIFIED IDEOGRAPH-6253 +1F130..1F169 ; Common # So [58] SQUARED LATIN CAPITAL LETTER A..NEGATIVE CIRCLED LATIN CAPITAL LETTER Z +1F170..1F19A ; Common # So [43] NEGATIVE SQUARED LATIN CAPITAL LETTER A..SQUARED VS +1F1E6..1F1FF ; Common # So [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z +1F201..1F202 ; Common # So [2] SQUARED KATAKANA KOKO..SQUARED KATAKANA SA +1F210..1F23A ; Common # So [43] SQUARED CJK UNIFIED IDEOGRAPH-624B..SQUARED CJK UNIFIED IDEOGRAPH-55B6 1F240..1F248 ; Common # So [9] TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-672C..TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-6557 +1F250..1F251 ; Common # So [2] CIRCLED IDEOGRAPH ADVANTAGE..CIRCLED IDEOGRAPH ACCEPT +1F300..1F320 ; Common # So [33] CYCLONE..SHOOTING STAR +1F330..1F335 ; Common # So [6] CHESTNUT..CACTUS +1F337..1F37C ; Common # So [70] TULIP..BABY BOTTLE +1F380..1F393 ; Common # So [20] RIBBON..GRADUATION CAP +1F3A0..1F3C4 ; Common # So [37] CAROUSEL HORSE..SURFER +1F3C6..1F3CA ; Common # So [5] TROPHY..SWIMMER +1F3E0..1F3F0 ; Common # So [17] HOUSE BUILDING..EUROPEAN CASTLE +1F400..1F43E ; Common # So [63] RAT..PAW PRINTS +1F440 ; Common # So EYES +1F442..1F4F7 ; Common # So [182] EAR..CAMERA +1F4F9..1F4FC ; Common # So [4] VIDEO CAMERA..VIDEOCASSETTE +1F500..1F53D ; Common # So [62] TWISTED RIGHTWARDS ARROWS..DOWN-POINTING SMALL RED TRIANGLE +1F550..1F567 ; Common # So [24] CLOCK FACE ONE OCLOCK..CLOCK FACE TWELVE-THIRTY +1F5FB..1F5FF ; Common # So [5] MOUNT FUJI..MOYAI +1F601..1F610 ; Common # So [16] GRINNING FACE WITH SMILING EYES..NEUTRAL FACE +1F612..1F614 ; Common # So [3] UNAMUSED FACE..PENSIVE FACE +1F616 ; Common # So CONFOUNDED FACE +1F618 ; Common # So FACE THROWING A KISS +1F61A ; Common # So KISSING FACE WITH CLOSED EYES +1F61C..1F61E ; Common # So [3] FACE WITH STUCK-OUT TONGUE AND WINKING EYE..DISAPPOINTED FACE +1F620..1F625 ; Common # So [6] ANGRY FACE..DISAPPOINTED BUT RELIEVED FACE +1F628..1F62B ; Common # So [4] FEARFUL FACE..TIRED FACE +1F62D ; Common # So LOUDLY CRYING FACE +1F630..1F633 ; Common # So [4] FACE WITH OPEN MOUTH AND COLD SWEAT..FLUSHED FACE +1F635..1F640 ; Common # So [12] DIZZY FACE..WEARY CAT FACE +1F645..1F64F ; Common # So [11] FACE WITH NO GOOD GESTURE..PERSON WITH FOLDED HANDS +1F680..1F6C5 ; Common # So [70] ROCKET..LEFT LUGGAGE +1F700..1F773 ; Common # So [116] ALCHEMICAL SYMBOL FOR QUINTESSENCE..ALCHEMICAL SYMBOL FOR HALF OUNCE E0001 ; Common # Cf LANGUAGE TAG E0020..E007F ; Common # Cf [96] TAG SPACE..CANCEL TAG -# Total code points: 5395 +# Total code points: 6379 # ================================================ @@ -603,7 +614,7 @@ E0020..E007F ; Common # Cf [96] TAG SPACE..CANCEL TAG 1E00..1EFF ; Latin # L& [256] LATIN CAPITAL LETTER A WITH RING BELOW..LATIN SMALL LETTER Y WITH LOOP 2071 ; Latin # Lm SUPERSCRIPT LATIN SMALL LETTER I 207F ; Latin # Lm SUPERSCRIPT LATIN SMALL LETTER N -2090..2094 ; Latin # Lm [5] LATIN SUBSCRIPT SMALL LETTER A..LATIN SUBSCRIPT SMALL LETTER SCHWA +2090..209C ; Latin # Lm [13] LATIN SUBSCRIPT SMALL LETTER A..LATIN SUBSCRIPT SMALL LETTER T 212A..212B ; Latin # L& [2] KELVIN SIGN..ANGSTROM SIGN 2132 ; Latin # L& TURNED CAPITAL F 214E ; Latin # L& TURNED SMALL F @@ -616,13 +627,16 @@ E0020..E007F ; Common # Cf [96] TAG SPACE..CANCEL TAG A722..A76F ; Latin # L& [78] LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF..LATIN SMALL LETTER CON A770 ; Latin # Lm MODIFIER LETTER US A771..A787 ; Latin # L& [23] LATIN SMALL LETTER DUM..LATIN SMALL LETTER INSULAR T -A78B..A78C ; Latin # L& [2] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER SALTILLO +A78B..A78E ; Latin # L& [4] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT +A790..A791 ; Latin # L& [2] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN SMALL LETTER N WITH DESCENDER +A7A0..A7A9 ; Latin # L& [10] LATIN CAPITAL LETTER G WITH OBLIQUE STROKE..LATIN SMALL LETTER S WITH OBLIQUE STROKE +A7FA ; Latin # L& LATIN LETTER SMALL CAPITAL TURNED M A7FB..A7FF ; Latin # Lo [5] LATIN EPIGRAPHIC LETTER REVERSED F..LATIN EPIGRAPHIC LETTER ARCHAIC M FB00..FB06 ; Latin # L& [7] LATIN SMALL LIGATURE FF..LATIN SMALL LIGATURE ST FF21..FF3A ; Latin # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LATIN CAPITAL LETTER Z FF41..FF5A ; Latin # L& [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN SMALL LETTER Z -# Total code points: 1244 +# Total code points: 1267 # ================================================ @@ -687,12 +701,11 @@ FF41..FF5A ; Latin # L& [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN 0483..0484 ; Cyrillic # Mn [2] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC PALATALIZATION 0487 ; Cyrillic # Mn COMBINING CYRILLIC POKRYTIE 0488..0489 ; Cyrillic # Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN -048A..0525 ; Cyrillic # L& [156] CYRILLIC CAPITAL LETTER SHORT I WITH TAIL..CYRILLIC SMALL LETTER PE WITH DESCENDER +048A..0527 ; Cyrillic # L& [158] CYRILLIC CAPITAL LETTER SHORT I WITH TAIL..CYRILLIC SMALL LETTER SHHA WITH DESCENDER 1D2B ; Cyrillic # L& CYRILLIC LETTER SMALL CAPITAL EL 1D78 ; Cyrillic # Lm MODIFIER LETTER CYRILLIC EN 2DE0..2DFF ; Cyrillic # Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS -A640..A65F ; Cyrillic # L& [32] CYRILLIC CAPITAL LETTER ZEMLYA..CYRILLIC SMALL LETTER YN -A662..A66D ; Cyrillic # L& [12] CYRILLIC CAPITAL LETTER SOFT DE..CYRILLIC SMALL LETTER DOUBLE MONOCULAR O +A640..A66D ; Cyrillic # L& [46] CYRILLIC CAPITAL LETTER ZEMLYA..CYRILLIC SMALL LETTER DOUBLE MONOCULAR O A66E ; Cyrillic # Lo CYRILLIC LETTER MULTIOCULAR O A66F ; Cyrillic # Mn COMBINING CYRILLIC VZMET A670..A672 ; Cyrillic # Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN @@ -702,7 +715,7 @@ A67E ; Cyrillic # Po CYRILLIC KAVYKA A67F ; Cyrillic # Lm CYRILLIC PAYEROK A680..A697 ; Cyrillic # L& [24] CYRILLIC CAPITAL LETTER DWE..CYRILLIC SMALL LETTER SHWE -# Total code points: 404 +# Total code points: 408 # ================================================ @@ -744,6 +757,7 @@ FB46..FB4F ; Hebrew # Lo [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW LIGATU # ================================================ +0600..0603 ; Arabic # Cf [4] ARABIC NUMBER SIGN..ARABIC SIGN SAFHA 0606..0608 ; Arabic # Sm [3] ARABIC-INDIC CUBE ROOT..ARABIC RAY 0609..060A ; Arabic # Po [2] ARABIC-INDIC PER MILLE SIGN..ARABIC-INDIC PER TEN THOUSAND SIGN 060B ; Arabic # Sc AFGHANI SIGN @@ -751,7 +765,7 @@ FB46..FB4F ; Hebrew # Lo [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW LIGATU 060E..060F ; Arabic # So [2] ARABIC POETIC VERSE SIGN..ARABIC SIGN MISRA 0610..061A ; Arabic # Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA 061E ; Arabic # Po ARABIC TRIPLE DOT PUNCTUATION MARK -0621..063F ; Arabic # Lo [31] ARABIC LETTER HAMZA..ARABIC LETTER FARSI YEH WITH THREE DOTS ABOVE +0620..063F ; Arabic # Lo [32] ARABIC LETTER KASHMIRI YEH..ARABIC LETTER FARSI YEH WITH THREE DOTS ABOVE 0641..064A ; Arabic # Lo [10] ARABIC LETTER FEH..ARABIC LETTER YEH 0656..065E ; Arabic # Mn [9] ARABIC SUBSCRIPT ALEF..ARABIC FATHA WITH TWO DOTS 066A..066D ; Arabic # Po [4] ARABIC PERCENT SIGN..ARABIC FIVE POINTED STAR @@ -760,7 +774,7 @@ FB46..FB4F ; Hebrew # Lo [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW LIGATU 06D4 ; Arabic # Po ARABIC FULL STOP 06D5 ; Arabic # Lo ARABIC LETTER AE 06D6..06DC ; Arabic # Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN -06DE ; Arabic # Me ARABIC START OF RUB EL HIZB +06DE ; Arabic # So ARABIC START OF RUB EL HIZB 06DF..06E4 ; Arabic # Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA 06E5..06E6 ; Arabic # Lm [2] ARABIC SMALL WAW..ARABIC SMALL YEH 06E7..06E8 ; Arabic # Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON @@ -773,6 +787,7 @@ FB46..FB4F ; Hebrew # Lo [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW LIGATU 06FF ; Arabic # Lo ARABIC LETTER HEH WITH INVERTED V 0750..077F ; Arabic # Lo [48] ARABIC LETTER BEH WITH THREE DOTS HORIZONTALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS ABOVE FB50..FBB1 ; Arabic # Lo [98] ARABIC LETTER ALEF WASLA ISOLATED FORM..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE FINAL FORM +FBB2..FBC1 ; Arabic # Sk [16] ARABIC SYMBOL DOT ABOVE..ARABIC SYMBOL SMALL TAH BELOW FBD3..FD3D ; Arabic # Lo [363] ARABIC LETTER NG ISOLATED FORM..ARABIC LIGATURE ALEF WITH FATHATAN ISOLATED FORM FD50..FD8F ; Arabic # Lo [64] ARABIC LIGATURE TEH WITH JEEM WITH MEEM INITIAL FORM..ARABIC LIGATURE MEEM WITH KHAH WITH MEEM INITIAL FORM FD92..FDC7 ; Arabic # Lo [54] ARABIC LIGATURE MEEM WITH JEEM WITH KHAH INITIAL FORM..ARABIC LIGATURE NOON WITH JEEM WITH YEH FINAL FORM @@ -782,7 +797,7 @@ FE70..FE74 ; Arabic # Lo [5] ARABIC FATHATAN ISOLATED FORM..ARABIC KASRATAN FE76..FEFC ; Arabic # Lo [135] ARABIC FATHA ISOLATED FORM..ARABIC LIGATURE LAM WITH ALEF FINAL FORM 10E60..10E7E ; Arabic # No [31] RUMI DIGIT ONE..RUMI FRACTION TWO THIRDS -# Total code points: 1030 +# Total code points: 1051 # ================================================ @@ -809,27 +824,29 @@ FE76..FEFC ; Arabic # Lo [135] ARABIC FATHA ISOLATED FORM..ARABIC LIGATURE LA 0900..0902 ; Devanagari # Mn [3] DEVANAGARI SIGN INVERTED CANDRABINDU..DEVANAGARI SIGN ANUSVARA 0903 ; Devanagari # Mc DEVANAGARI SIGN VISARGA 0904..0939 ; Devanagari # Lo [54] DEVANAGARI LETTER SHORT A..DEVANAGARI LETTER HA +093A ; Devanagari # Mn DEVANAGARI VOWEL SIGN OE +093B ; Devanagari # Mc DEVANAGARI VOWEL SIGN OOE 093C ; Devanagari # Mn DEVANAGARI SIGN NUKTA 093D ; Devanagari # Lo DEVANAGARI SIGN AVAGRAHA 093E..0940 ; Devanagari # Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II 0941..0948 ; Devanagari # Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI 0949..094C ; Devanagari # Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU 094D ; Devanagari # Mn DEVANAGARI SIGN VIRAMA -094E ; Devanagari # Mc DEVANAGARI VOWEL SIGN PRISHTHAMATRA E +094E..094F ; Devanagari # Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW 0950 ; Devanagari # Lo DEVANAGARI OM -0953..0955 ; Devanagari # Mn [3] DEVANAGARI GRAVE ACCENT..DEVANAGARI VOWEL SIGN CANDRA LONG E +0953..0957 ; Devanagari # Mn [5] DEVANAGARI GRAVE ACCENT..DEVANAGARI VOWEL SIGN UUE 0958..0961 ; Devanagari # Lo [10] DEVANAGARI LETTER QA..DEVANAGARI LETTER VOCALIC LL 0962..0963 ; Devanagari # Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL 0966..096F ; Devanagari # Nd [10] DEVANAGARI DIGIT ZERO..DEVANAGARI DIGIT NINE 0971 ; Devanagari # Lm DEVANAGARI SIGN HIGH SPACING DOT -0972 ; Devanagari # Lo DEVANAGARI LETTER CANDRA A +0972..0977 ; Devanagari # Lo [6] DEVANAGARI LETTER CANDRA A..DEVANAGARI LETTER UUE 0979..097F ; Devanagari # Lo [7] DEVANAGARI LETTER ZHA..DEVANAGARI LETTER BBA A8E0..A8F1 ; Devanagari # Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA A8F2..A8F7 ; Devanagari # Lo [6] DEVANAGARI SIGN SPACING CANDRABINDU..DEVANAGARI SIGN CANDRABINDU AVAGRAHA A8F8..A8FA ; Devanagari # Po [3] DEVANAGARI SIGN PUSHPIKA..DEVANAGARI CARET A8FB ; Devanagari # Lo DEVANAGARI HEADSTROKE -# Total code points: 140 +# Total code points: 150 # ================================================ @@ -941,8 +958,9 @@ A8FB ; Devanagari # Lo DEVANAGARI HEADSTROKE 0B66..0B6F ; Oriya # Nd [10] ORIYA DIGIT ZERO..ORIYA DIGIT NINE 0B70 ; Oriya # So ORIYA ISSHAR 0B71 ; Oriya # Lo ORIYA LETTER WA +0B72..0B77 ; Oriya # No [6] ORIYA FRACTION ONE QUARTER..ORIYA FRACTION THREE SIXTEENTHS -# Total code points: 84 +# Total code points: 90 # ================================================ @@ -1018,22 +1036,23 @@ A8FB ; Devanagari # Lo DEVANAGARI HEADSTROKE 0CE0..0CE1 ; Kannada # Lo [2] KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL 0CE2..0CE3 ; Kannada # Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL 0CE6..0CEF ; Kannada # Nd [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE +0CF1..0CF2 ; Kannada # Lo [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA -# Total code points: 84 +# Total code points: 86 # ================================================ 0D02..0D03 ; Malayalam # Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA 0D05..0D0C ; Malayalam # Lo [8] MALAYALAM LETTER A..MALAYALAM LETTER VOCALIC L 0D0E..0D10 ; Malayalam # Lo [3] MALAYALAM LETTER E..MALAYALAM LETTER AI -0D12..0D28 ; Malayalam # Lo [23] MALAYALAM LETTER O..MALAYALAM LETTER NA -0D2A..0D39 ; Malayalam # Lo [16] MALAYALAM LETTER PA..MALAYALAM LETTER HA +0D12..0D3A ; Malayalam # Lo [41] MALAYALAM LETTER O..MALAYALAM LETTER TTTA 0D3D ; Malayalam # Lo MALAYALAM SIGN AVAGRAHA 0D3E..0D40 ; Malayalam # Mc [3] MALAYALAM VOWEL SIGN AA..MALAYALAM VOWEL SIGN II 0D41..0D44 ; Malayalam # Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR 0D46..0D48 ; Malayalam # Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI 0D4A..0D4C ; Malayalam # Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU 0D4D ; Malayalam # Mn MALAYALAM SIGN VIRAMA +0D4E ; Malayalam # Lo MALAYALAM LETTER DOT REPH 0D57 ; Malayalam # Mc MALAYALAM AU LENGTH MARK 0D60..0D61 ; Malayalam # Lo [2] MALAYALAM LETTER VOCALIC RR..MALAYALAM LETTER VOCALIC LL 0D62..0D63 ; Malayalam # Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL @@ -1042,7 +1061,7 @@ A8FB ; Devanagari # Lo DEVANAGARI HEADSTROKE 0D79 ; Malayalam # So MALAYALAM DATE MARK 0D7A..0D7F ; Malayalam # Lo [6] MALAYALAM LETTER CHILLU NN..MALAYALAM LETTER CHILLU K -# Total code points: 95 +# Total code points: 98 # ================================================ @@ -1132,16 +1151,17 @@ A8FB ; Devanagari # Lo DEVANAGARI HEADSTROKE 0F80..0F84 ; Tibetan # Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA 0F85 ; Tibetan # Po TIBETAN MARK PALUTA 0F86..0F87 ; Tibetan # Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS -0F88..0F8B ; Tibetan # Lo [4] TIBETAN SIGN LCE TSA CAN..TIBETAN SIGN GRU MED RGYINGS -0F90..0F97 ; Tibetan # Mn [8] TIBETAN SUBJOINED LETTER KA..TIBETAN SUBJOINED LETTER JA +0F88..0F8C ; Tibetan # Lo [5] TIBETAN SIGN LCE TSA CAN..TIBETAN SIGN INVERTED MCHU CAN +0F8D..0F97 ; Tibetan # Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA 0F99..0FBC ; Tibetan # Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA 0FBE..0FC5 ; Tibetan # So [8] TIBETAN KU RU KHA..TIBETAN SYMBOL RDO RJE 0FC6 ; Tibetan # Mn TIBETAN SYMBOL PADMA GDAN 0FC7..0FCC ; Tibetan # So [6] TIBETAN SYMBOL RDO RJE RGYA GRAM..TIBETAN SYMBOL NOR BU BZHI -KHYIL 0FCE..0FCF ; Tibetan # So [2] TIBETAN SIGN RDEL NAG RDEL DKAR..TIBETAN SIGN RDEL NAG GSUM 0FD0..0FD4 ; Tibetan # Po [5] TIBETAN MARK BSKA- SHOG GI MGO RGYAN..TIBETAN MARK CLOSING BRDA RNYING YIG MGO SGAB MA +0FD9..0FDA ; Tibetan # Po [2] TIBETAN MARK LEADING MCHAN RTAGS..TIBETAN MARK TRAILING MCHAN RTAGS -# Total code points: 201 +# Total code points: 207 # ================================================ @@ -1201,6 +1221,7 @@ AA7B ; Myanmar # Mc MYANMAR SIGN PAO KAREN TONE # ================================================ 1100..11FF ; Hangul # Lo [256] HANGUL CHOSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN +302E..302F ; Hangul # Mn [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK 3131..318E ; Hangul # Lo [94] HANGUL LETTER KIYEOK..HANGUL LETTER ARAEAE 3200..321E ; Hangul # So [31] PARENTHESIZED HANGUL KIYEOK..PARENTHESIZED KOREAN CHARACTER O HU 3260..327E ; Hangul # So [31] CIRCLED HANGUL KIYEOK..CIRCLED HANGUL IEUNG U @@ -1214,7 +1235,7 @@ FFCA..FFCF ; Hangul # Lo [6] HALFWIDTH HANGUL LETTER YEO..HALFWIDTH HANGUL FFD2..FFD7 ; Hangul # Lo [6] HALFWIDTH HANGUL LETTER YO..HALFWIDTH HANGUL LETTER YU FFDA..FFDC ; Hangul # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL LETTER I -# Total code points: 11737 +# Total code points: 11739 # ================================================ @@ -1234,7 +1255,7 @@ FFDA..FFDC ; Hangul # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL L 12D8..1310 ; Ethiopic # Lo [57] ETHIOPIC SYLLABLE ZA..ETHIOPIC SYLLABLE GWA 1312..1315 ; Ethiopic # Lo [4] ETHIOPIC SYLLABLE GWI..ETHIOPIC SYLLABLE GWE 1318..135A ; Ethiopic # Lo [67] ETHIOPIC SYLLABLE GGA..ETHIOPIC SYLLABLE FYA -135F ; Ethiopic # Mn ETHIOPIC COMBINING GEMINATION MARK +135D..135F ; Ethiopic # Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK 1360 ; Ethiopic # So ETHIOPIC SECTION MARK 1361..1368 ; Ethiopic # Po [8] ETHIOPIC WORDSPACE..ETHIOPIC PARAGRAPH SEPARATOR 1369..137C ; Ethiopic # No [20] ETHIOPIC DIGIT ONE..ETHIOPIC NUMBER TEN THOUSAND @@ -1249,8 +1270,13 @@ FFDA..FFDC ; Hangul # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL L 2DC8..2DCE ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE KYA..ETHIOPIC SYLLABLE KYO 2DD0..2DD6 ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE XYA..ETHIOPIC SYLLABLE XYO 2DD8..2DDE ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE GYA..ETHIOPIC SYLLABLE GYO +AB01..AB06 ; Ethiopic # Lo [6] ETHIOPIC SYLLABLE TTHU..ETHIOPIC SYLLABLE TTHO +AB09..AB0E ; Ethiopic # Lo [6] ETHIOPIC SYLLABLE DDHU..ETHIOPIC SYLLABLE DDHO +AB11..AB16 ; Ethiopic # Lo [6] ETHIOPIC SYLLABLE DZU..ETHIOPIC SYLLABLE DZO +AB20..AB26 ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE CCHHA..ETHIOPIC SYLLABLE CCHHO +AB28..AB2E ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE BBA..ETHIOPIC SYLLABLE BBO -# Total code points: 461 +# Total code points: 495 # ================================================ @@ -1329,9 +1355,10 @@ FFDA..FFDC ; Hangul # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL L 3041..3096 ; Hiragana # Lo [86] HIRAGANA LETTER SMALL A..HIRAGANA LETTER SMALL KE 309D..309E ; Hiragana # Lm [2] HIRAGANA ITERATION MARK..HIRAGANA VOICED ITERATION MARK 309F ; Hiragana # Lo HIRAGANA DIGRAPH YORI +1B001 ; Hiragana # Lo HIRAGANA LETTER ARCHAIC YE 1F200 ; Hiragana # So SQUARE HIRAGANA HOKA -# Total code points: 90 +# Total code points: 91 # ================================================ @@ -1343,15 +1370,17 @@ FFDA..FFDC ; Hangul # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL L 3300..3357 ; Katakana # So [88] SQUARE APAATO..SQUARE WATTO FF66..FF6F ; Katakana # Lo [10] HALFWIDTH KATAKANA LETTER WO..HALFWIDTH KATAKANA LETTER SMALL TU FF71..FF9D ; Katakana # Lo [45] HALFWIDTH KATAKANA LETTER A..HALFWIDTH KATAKANA LETTER N +1B000 ; Katakana # Lo KATAKANA LETTER ARCHAIC E -# Total code points: 299 +# Total code points: 300 # ================================================ +02EA..02EB ; Bopomofo # Sk [2] MODIFIER LETTER YIN DEPARTING TONE MARK..MODIFIER LETTER YANG DEPARTING TONE MARK 3105..312D ; Bopomofo # Lo [41] BOPOMOFO LETTER B..BOPOMOFO LETTER IH -31A0..31B7 ; Bopomofo # Lo [24] BOPOMOFO LETTER BU..BOPOMOFO FINAL LETTER H +31A0..31BA ; Bopomofo # Lo [27] BOPOMOFO LETTER BU..BOPOMOFO LETTER ZY -# Total code points: 65 +# Total code points: 70 # ================================================ @@ -1370,9 +1399,10 @@ FA30..FA6D ; Han # Lo [62] CJK COMPATIBILITY IDEOGRAPH-FA30..CJK COMPATIBILI FA70..FAD9 ; Han # Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COMPATIBILITY IDEOGRAPH-FAD9 20000..2A6D6 ; Han # Lo [42711] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6 2A700..2B734 ; Han # Lo [4149] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B734 +2B740..2B81D ; Han # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D 2F800..2FA1D ; Han # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D -# Total code points: 75738 +# Total code points: 75960 # ================================================ @@ -1410,6 +1440,7 @@ A490..A4C6 ; Yi # So [55] YI RADICAL QOT..YI RADICAL KE 0300..036F ; Inherited # Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X 0485..0486 ; Inherited # Mn [2] COMBINING CYRILLIC DASIA PNEUMATA..COMBINING CYRILLIC PSILI PNEUMATA 064B..0655 ; Inherited # Mn [11] ARABIC FATHATAN..ARABIC HAMZA BELOW +065F ; Inherited # Mn ARABIC WAVY HAMZA BELOW 0670 ; Inherited # Mn ARABIC LETTER SUPERSCRIPT ALEF 0951..0952 ; Inherited # Mn [2] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI STRESS SIGN ANUDATTA 1CD0..1CD2 ; Inherited # Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA @@ -1417,14 +1448,14 @@ A490..A4C6 ; Yi # So [55] YI RADICAL QOT..YI RADICAL KE 1CE2..1CE8 ; Inherited # Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL 1CED ; Inherited # Mn VEDIC SIGN TIRYAK 1DC0..1DE6 ; Inherited # Mn [39] COMBINING DOTTED GRAVE ACCENT..COMBINING LATIN SMALL LETTER Z -1DFD..1DFF ; Inherited # Mn [3] COMBINING ALMOST EQUAL TO BELOW..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW +1DFC..1DFF ; Inherited # Mn [4] COMBINING DOUBLE INVERTED BREVE BELOW..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW 200C..200D ; Inherited # Cf [2] ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER 20D0..20DC ; Inherited # Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE 20DD..20E0 ; Inherited # Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH 20E1 ; Inherited # Mn COMBINING LEFT RIGHT ARROW ABOVE 20E2..20E4 ; Inherited # Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE 20E5..20F0 ; Inherited # Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE -302A..302F ; Inherited # Mn [6] IDEOGRAPHIC LEVEL TONE MARK..HANGUL DOUBLE DOT TONE MARK +302A..302D ; Inherited # Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK 3099..309A ; Inherited # Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK FE00..FE0F ; Inherited # Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 FE20..FE26 ; Inherited # Mn [7] COMBINING LIGATURE LEFT HALF..COMBINING CONJOINING MACRON @@ -1568,8 +1599,9 @@ E0100..E01EF ; Inherited # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-2 19B0..19C0 ; New_Tai_Lue # Mc [17] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE VOWEL SIGN IY 19C1..19C7 ; New_Tai_Lue # Lo [7] NEW TAI LUE LETTER FINAL V..NEW TAI LUE LETTER FINAL B 19C8..19C9 ; New_Tai_Lue # Mc [2] NEW TAI LUE TONE MARK-1..NEW TAI LUE TONE MARK-2 -19D0..19DA ; New_Tai_Lue # Nd [11] NEW TAI LUE DIGIT ZERO..NEW TAI LUE THAM DIGIT ONE -19DE..19DF ; New_Tai_Lue # Po [2] NEW TAI LUE SIGN LAE..NEW TAI LUE SIGN LAEV +19D0..19D9 ; New_Tai_Lue # Nd [10] NEW TAI LUE DIGIT ZERO..NEW TAI LUE DIGIT NINE +19DA ; New_Tai_Lue # No NEW TAI LUE THAM DIGIT ONE +19DE..19DF ; New_Tai_Lue # So [2] NEW TAI LUE SIGN LAE..NEW TAI LUE SIGN LAEV # Total code points: 83 @@ -1584,8 +1616,10 @@ E0100..E01EF ; Inherited # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-2 2D30..2D65 ; Tifinagh # Lo [54] TIFINAGH LETTER YA..TIFINAGH LETTER YAZZ 2D6F ; Tifinagh # Lm TIFINAGH MODIFIER LETTER LABIALIZATION MARK +2D70 ; Tifinagh # Po TIFINAGH SEPARATOR MARK +2D7F ; Tifinagh # Mn TIFINAGH CONSONANT JOINER -# Total code points: 55 +# Total code points: 57 # ================================================ @@ -1882,8 +1916,9 @@ A6A0..A6E5 ; Bamum # Lo [70] BAMUM LETTER A..BAMUM LETTER KI A6E6..A6EF ; Bamum # Nl [10] BAMUM LETTER MO..BAMUM LETTER KOGHOM A6F0..A6F1 ; Bamum # Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS A6F2..A6F7 ; Bamum # Po [6] BAMUM NJAEMLI..BAMUM QUESTION MARK +16800..16A38 ; Bamum # Lo [569] BAMUM LETTER PHASE-A NGKUE MFON..BAMUM LETTER PHASE-F VUEQ -# Total code points: 88 +# Total code points: 657 # ================================================ @@ -1969,4 +2004,40 @@ ABF0..ABF9 ; Meetei_Mayek # Nd [10] MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DI # Total code points: 66 +# ================================================ + +1BC0..1BE5 ; Batak # Lo [38] BATAK LETTER A..BATAK LETTER U +1BE6 ; Batak # Mn BATAK SIGN TOMPI +1BE7 ; Batak # Mc BATAK VOWEL SIGN E +1BE8..1BE9 ; Batak # Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE +1BEA..1BEC ; Batak # Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O +1BED ; Batak # Mn BATAK VOWEL SIGN KARO O +1BEE ; Batak # Mc BATAK VOWEL SIGN U +1BEF..1BF1 ; Batak # Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H +1BF2..1BF3 ; Batak # Mc [2] BATAK PANGOLAT..BATAK PANONGONAN +1BFC..1BFF ; Batak # Po [4] BATAK SYMBOL BINDU NA METEK..BATAK SYMBOL BINDU PANGOLAT + +# Total code points: 56 + +# ================================================ + +11000 ; Brahmi # Mc BRAHMI SIGN CANDRABINDU +11001 ; Brahmi # Mn BRAHMI SIGN ANUSVARA +11002 ; Brahmi # Mc BRAHMI SIGN VISARGA +11003..11037 ; Brahmi # Lo [53] BRAHMI SIGN JIHVAMULIYA..BRAHMI LETTER OLD TAMIL NNNA +11038..11046 ; Brahmi # Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA +11047..1104D ; Brahmi # Po [7] BRAHMI DANDA..BRAHMI PUNCTUATION LOTUS +11052..11065 ; Brahmi # No [20] BRAHMI NUMBER ONE..BRAHMI NUMBER ONE THOUSAND +11066..1106F ; Brahmi # Nd [10] BRAHMI DIGIT ZERO..BRAHMI DIGIT NINE + +# Total code points: 108 + +# ================================================ + +0840..0858 ; Mandaic # Lo [25] MANDAIC LETTER HALQA..MANDAIC LETTER AIN +0859..085B ; Mandaic # Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK +085E ; Mandaic # Po MANDAIC PUNCTUATION + +# Total code points: 29 + # EOF diff --git a/jdk/test/java/lang/ClassLoader/UninitializedParent.java b/jdk/test/java/lang/ClassLoader/UninitializedParent.java index 9d4459d01a8..0ef23a280f9 100644 --- a/jdk/test/java/lang/ClassLoader/UninitializedParent.java +++ b/jdk/test/java/lang/ClassLoader/UninitializedParent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ClassLoader/deadlock/TestCrossDelegate.sh b/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh index 1c7d5657423..87f3a1a14b5 100644 --- a/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh +++ b/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/ClassLoader/deadlock/TestOneWayDelegate.sh b/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh index 97870096bc5..61cff74e123 100644 --- a/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh +++ b/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/ClassLoader/defineClass/DefineClassByteBuffer.java b/jdk/test/java/lang/ClassLoader/defineClass/DefineClassByteBuffer.java index e1f79f737de..1fccf7d8390 100644 --- a/jdk/test/java/lang/ClassLoader/defineClass/DefineClassByteBuffer.java +++ b/jdk/test/java/lang/ClassLoader/defineClass/DefineClassByteBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ClassLoader/findSystemClass/Loader.java b/jdk/test/java/lang/ClassLoader/findSystemClass/Loader.java index 60f1b797218..e141462a9ae 100644 --- a/jdk/test/java/lang/ClassLoader/findSystemClass/Loader.java +++ b/jdk/test/java/lang/ClassLoader/findSystemClass/Loader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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 21ff40695ea..ebe65fb5bad 100644 --- a/jdk/test/java/lang/ProcessBuilder/Basic.java +++ b/jdk/test/java/lang/ProcessBuilder/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Runtime/exec/ExecWithDir.java b/jdk/test/java/lang/Runtime/exec/ExecWithDir.java index 910aed4b0f6..d3c87db78e8 100644 --- a/jdk/test/java/lang/Runtime/exec/ExecWithDir.java +++ b/jdk/test/java/lang/Runtime/exec/ExecWithDir.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/String/Supplementary.java b/jdk/test/java/lang/String/Supplementary.java index 1049348c25c..3fc8c70bd5c 100644 --- a/jdk/test/java/lang/String/Supplementary.java +++ b/jdk/test/java/lang/String/Supplementary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/StringBuffer/Supplementary.java b/jdk/test/java/lang/StringBuffer/Supplementary.java index ce8d89c9a94..55b7cc7fdfb 100644 --- a/jdk/test/java/lang/StringBuffer/Supplementary.java +++ b/jdk/test/java/lang/StringBuffer/Supplementary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/StringBuilder/EnsureCapacity.java b/jdk/test/java/lang/StringBuilder/EnsureCapacity.java new file mode 100644 index 00000000000..f1ef16ee8d3 --- /dev/null +++ b/jdk/test/java/lang/StringBuilder/EnsureCapacity.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6955504 6992121 + * @summary Test the StringBuilder.ensureCapacity() with negative minimumCapacity + * and append() method with negative length input argument. + * Also, test the StringBuffer class. + */ + +import java.util.ArrayList; +import java.util.Vector; + +public class EnsureCapacity { + public static void main(String[] args) { + testStringBuilder(); + testStringBuffer(); + } + + private static void checkCapacity(int before, int after) { + if (before != after) { + throw new RuntimeException("capacity is expected to be unchanged: " + + "before=" + before + " after=" + after); + } + } + + private static void testStringBuilder() { + StringBuilder sb = new StringBuilder("abc"); + int cap = sb.capacity(); + + // test if negative minimumCapacity + sb.ensureCapacity(Integer.MIN_VALUE); + checkCapacity(cap, sb.capacity()); + + try { + char[] str = {'a', 'b', 'c', 'd'}; + // test if negative length + sb.append(str, 0, Integer.MIN_VALUE + 10); + throw new RuntimeException("IndexOutOfBoundsException not thrown"); + } catch (IndexOutOfBoundsException ex) { + } + } + + private static void testStringBuffer() { + StringBuffer sb = new StringBuffer("abc"); + int cap = sb.capacity(); + + // test if negative minimumCapacity + sb.ensureCapacity(Integer.MIN_VALUE); + checkCapacity(cap, sb.capacity()); + + try { + char[] str = {'a', 'b', 'c', 'd'}; + // test if negative length + sb.append(str, 0, Integer.MIN_VALUE + 10); + throw new RuntimeException("IndexOutOfBoundsException not thrown"); + } catch (IndexOutOfBoundsException ex) { + } + } +} diff --git a/jdk/test/java/lang/StringBuilder/Supplementary.java b/jdk/test/java/lang/StringBuilder/Supplementary.java index 283d9b97250..30ff5e901c0 100644 --- a/jdk/test/java/lang/StringBuilder/Supplementary.java +++ b/jdk/test/java/lang/StringBuilder/Supplementary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/StringCoding/CheckEncodings.sh b/jdk/test/java/lang/StringCoding/CheckEncodings.sh index 75c7e7d29c4..78627222cea 100644 --- a/jdk/test/java/lang/StringCoding/CheckEncodings.sh +++ b/jdk/test/java/lang/StringCoding/CheckEncodings.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/ExitFinalizersAndJIT.java b/jdk/test/java/lang/System/ExitFinalizersAndJIT.java index 4fe5078e599..2bea5a63607 100644 --- a/jdk/test/java/lang/System/ExitFinalizersAndJIT.java +++ b/jdk/test/java/lang/System/ExitFinalizersAndJIT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/IgnoreNullSecurityManager.java b/jdk/test/java/lang/System/IgnoreNullSecurityManager.java index 03a2c0cc3e9..705b40d92d0 100644 --- a/jdk/test/java/lang/System/IgnoreNullSecurityManager.java +++ b/jdk/test/java/lang/System/IgnoreNullSecurityManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Thread/GenerifyStackTraces.java b/jdk/test/java/lang/Thread/GenerifyStackTraces.java index 98de4507337..6e26cd2edb9 100644 --- a/jdk/test/java/lang/Thread/GenerifyStackTraces.java +++ b/jdk/test/java/lang/Thread/GenerifyStackTraces.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Thread/StackTraces.java b/jdk/test/java/lang/Thread/StackTraces.java index 141c81a4ae2..e7620b513cc 100644 --- a/jdk/test/java/lang/Thread/StackTraces.java +++ b/jdk/test/java/lang/Thread/StackTraces.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Throwable/StackTraceSerialization.java b/jdk/test/java/lang/Throwable/StackTraceSerialization.java index d73c5a7e404..2d2f4f42a23 100644 --- a/jdk/test/java/lang/Throwable/StackTraceSerialization.java +++ b/jdk/test/java/lang/Throwable/StackTraceSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * 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,13 +26,33 @@ import java.util.*; /* * @test - * @bug 4202914 4363318 + * @bug 4202914 4363318 6991528 * @summary Basic test of serialization of stack trace information * @author Josh Bloch */ public class StackTraceSerialization { public static void main(String args[]) throws Exception { + testWithSetStackTrace(); + testWithFillInStackTrace(); + } + + private static void testWithSetStackTrace() throws Exception { + Throwable t = new Throwable(); + + t.setStackTrace(new StackTraceElement[] + {new StackTraceElement("foo", "bar", "baz", -1)}); + + if (!equal(t, reconstitute(t))) + throw new Exception("Unequal Throwables with set stacktrace"); + } + + private static void assertEmptyStackTrace(Throwable t) { + if (t.getStackTrace().length != 0) + throw new AssertionError("Nonempty stacktrace."); + } + + private static void testWithFillInStackTrace() throws Exception { Throwable original = null; try { a(); @@ -40,27 +60,42 @@ public class StackTraceSerialization { original = e; } - ByteArrayOutputStream bout = new ByteArrayOutputStream(); - ObjectOutputStream out = new ObjectOutputStream(bout); - out.writeObject(original); - out.flush(); - ByteArrayInputStream bin = - new ByteArrayInputStream(bout.toByteArray()); - ObjectInputStream in = new ObjectInputStream(bin); - Throwable clone = (Throwable) in.readObject(); + if (!equal(original, reconstitute(original))) + throw new Exception("Unequal Throwables with filled-in stacktrace"); + } - if (!equal(original, clone)) - throw new Exception(); + + /** + * Serialize the argument and return the deserialized result. + */ + private static Throwable reconstitute(Throwable t) throws Exception { + Throwable result = null; + + try(ByteArrayOutputStream bout = new ByteArrayOutputStream(); + ObjectOutputStream out = new ObjectOutputStream(bout)) { + out.writeObject(t); + out.flush(); + try(ByteArrayInputStream bin = + new ByteArrayInputStream(bout.toByteArray()); + ObjectInputStream in = new ObjectInputStream(bin)) { + result = (Throwable) in.readObject(); + } + } + + return result; } /** - * Returns true if e1 and e2 have equal stack traces and their causes - * are recursively equal (by the same definition). Returns false - * or throws NullPointerExeption otherwise. + * Returns true if e1 and e2 have equal stack traces and their + * causes are recursively equal (by the same definition) and their + * suppressed exception information is equals. Returns false or + * throws NullPointerExeption otherwise. */ private static boolean equal(Throwable t1, Throwable t2) { - return t1==t2 || (Arrays.equals(t1.getStackTrace(), t2.getStackTrace()) - && equal(t1.getCause(), t2.getCause())); + return t1==t2 || + (Arrays.equals(t1.getStackTrace(), t2.getStackTrace()) && + equal(t1.getCause(), t2.getCause()) && + Objects.equals(t1.getSuppressed(), t2.getSuppressed())); } static void a() throws HighLevelException { diff --git a/jdk/test/java/lang/Throwable/SuppressedExceptions.java b/jdk/test/java/lang/Throwable/SuppressedExceptions.java index 0993cd6333f..f1c30b358ad 100644 --- a/jdk/test/java/lang/Throwable/SuppressedExceptions.java +++ b/jdk/test/java/lang/Throwable/SuppressedExceptions.java @@ -26,7 +26,7 @@ import java.util.*; /* * @test - * @bug 6911258 6962571 6963622 + * @bug 6911258 6962571 6963622 6991528 * @summary Basic tests of suppressed exceptions * @author Joseph D. Darcy */ @@ -39,12 +39,21 @@ public class SuppressedExceptions { basicSupressionTest(); serializationTest(); selfReference(); + noModification(); } private static void noSelfSuppression() { Throwable throwable = new Throwable(); try { - throwable.addSuppressedException(throwable); + throwable.addSuppressed(throwable); + throw new RuntimeException("IllegalArgumentException for self-suppresion not thrown."); + } catch (IllegalArgumentException iae) { + ; // Expected + } + + throwable.addSuppressed(null); // Immutable suppression list + try { + throwable.addSuppressed(throwable); throw new RuntimeException("IllegalArgumentException for self-suppresion not thrown."); } catch (IllegalArgumentException iae) { ; // Expected @@ -56,21 +65,21 @@ public class SuppressedExceptions { RuntimeException suppressed = new RuntimeException("A suppressed exception."); AssertionError repressed = new AssertionError("A repressed error."); - Throwable[] t0 = throwable.getSuppressedExceptions(); + Throwable[] t0 = throwable.getSuppressed(); if (t0.length != 0) { throw new RuntimeException(message); } throwable.printStackTrace(); - throwable.addSuppressedException(suppressed); - Throwable[] t1 = throwable.getSuppressedExceptions(); + throwable.addSuppressed(suppressed); + Throwable[] t1 = throwable.getSuppressed(); if (t1.length != 1 || t1[0] != suppressed) {throw new RuntimeException(message); } throwable.printStackTrace(); - throwable.addSuppressedException(repressed); - Throwable[] t2 = throwable.getSuppressedExceptions(); + throwable.addSuppressed(repressed); + Throwable[] t2 = throwable.getSuppressed(); if (t2.length != 2 || t2[0] != suppressed || t2[1] != repressed) { @@ -152,7 +161,7 @@ public class SuppressedExceptions { System.err.println("TESTING SERIALIZED EXCEPTION"); - Throwable[] t0 = throwable.getSuppressedExceptions(); + Throwable[] t0 = throwable.getSuppressed(); if (t0.length != 0) { // Will fail if t0 is null. throw new RuntimeException(message); } @@ -167,9 +176,25 @@ public class SuppressedExceptions { throwable1.printStackTrace(); - throwable1.addSuppressedException(throwable2); - throwable2.addSuppressedException(throwable1); + throwable1.addSuppressed(throwable2); + throwable2.addSuppressed(throwable1); throwable1.printStackTrace(); } + + private static void noModification() { + Throwable t = new Throwable(); + t.addSuppressed(null); + + Throwable[] t0 = t.getSuppressed(); + if (t0.length != 0) + throw new RuntimeException("Bad nonzero length of suppressed exceptions."); + + t.addSuppressed(new ArithmeticException()); + + // Make sure a suppressed exception did *not* get added. + t0 = t.getSuppressed(); + if (t0.length != 0) + throw new RuntimeException("Bad nonzero length of suppressed exceptions."); + } } diff --git a/jdk/test/java/lang/annotation/ParameterAnnotations.java b/jdk/test/java/lang/annotation/ParameterAnnotations.java index 7c98241f3d9..4ea72d1ca70 100644 --- a/jdk/test/java/lang/annotation/ParameterAnnotations.java +++ b/jdk/test/java/lang/annotation/ParameterAnnotations.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ilib/Inject.java b/jdk/test/java/lang/instrument/ilib/Inject.java index af93956e72a..03a85a6ffac 100644 --- a/jdk/test/java/lang/instrument/ilib/Inject.java +++ b/jdk/test/java/lang/instrument/ilib/Inject.java @@ -107,7 +107,7 @@ public class Inject implements RuntimeConstants { class IndexedInjector implements TrackerInjector { int counter = 0; int tracker; - List infoList = new ArrayList(); + List infoList = new ArrayList<>(); public int stackSize(int currentSize) { return currentSize + 1; diff --git a/jdk/test/java/lang/instrument/ilib/InjectBytecodes.java b/jdk/test/java/lang/instrument/ilib/InjectBytecodes.java index d1dbd8a9e2c..35e185889ff 100644 --- a/jdk/test/java/lang/instrument/ilib/InjectBytecodes.java +++ b/jdk/test/java/lang/instrument/ilib/InjectBytecodes.java @@ -50,7 +50,7 @@ class InjectBytecodes implements RuntimeConstants { private final Injector[] after = new Injector[256]; private final String className; private final String methodName; - private final Map snippets = new HashMap(); + private final Map snippets = new HashMap<>(); private int pos; private int newPos; diff --git a/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java b/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java index d2daf80b47e..33f8f6f055e 100644 --- a/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java +++ b/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/ManagementFactory/MXBeanProxyTest.java b/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java index 545d7248d80..98f887ea551 100644 --- a/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java +++ b/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/MemoryMXBean/CollectionUsageThreshold.java b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java index b7a04e0307d..f8c77f7708e 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java +++ b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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 4959889 + * @bug 4959889 6992968 * @summary Basic unit test of memory management testing: * 1) setCollectionUsageThreshold() and getCollectionUsageThreshold() * 2) test notification emitted for two different memory pools. @@ -34,8 +34,10 @@ * @run main/timeout=300 CollectionUsageThreshold */ +import java.lang.Thread.*; import java.lang.management.*; import java.util.*; +import java.util.concurrent.*; import javax.management.*; import javax.management.openmbean.CompositeData; @@ -52,6 +54,12 @@ public class CollectionUsageThreshold { private static Checker checker; private static int numGCs = 0; + // semaphore to signal the arrival of a low memory notification + private static Semaphore signals = new Semaphore(0); + // barrier for the main thread to wait until the checker thread + // finishes checking the low memory notification result + private static CyclicBarrier barrier = new CyclicBarrier(2); + static class PoolRecord { private MemoryPoolMXBean pool; private int listenerInvoked = 0; @@ -98,10 +106,9 @@ public class CollectionUsageThreshold { } pr.addNotification(minfo); synchronized (this) { + System.out.println("notifying the checker thread to check result"); numNotifs++; - if (numNotifs > 0 && (numNotifs % EXPECTED_NUM_POOLS) == 0) { - checker.goCheckResult(); - } + signals.release(); } } } @@ -134,6 +141,9 @@ public class CollectionUsageThreshold { } try { + // This test creates a checker thread responsible for checking + // the low memory notifications. It blocks until a permit + // from the signals semaphore is available. checker = new Checker("Checker thread"); checker.setDaemon(true); checker.start(); @@ -148,9 +158,18 @@ public class CollectionUsageThreshold { NotificationEmitter emitter = (NotificationEmitter) mm; emitter.addNotificationListener(listener, null, null); + // The main thread invokes GC to trigger the VM to perform + // low memory detection and then waits until the checker thread + // finishes its work to check for a low-memory notification. + // + // At GC time, VM will issue low-memory notification and invoke + // the listener which will release a permit to the signals semaphore. + // When the checker thread acquires the permit and finishes + // checking the low-memory notification, it will also call + // barrier.await() to signal the main thread to resume its work. for (int i = 0; i < NUM_GCS; i++) { invokeGC(); - checker.waitForCheckResult(); + barrier.await(); } } finally { // restore the default @@ -166,6 +185,7 @@ public class CollectionUsageThreshold { } + private static void invokeGC() { System.out.println("Calling System.gc()"); numGCs++; @@ -180,8 +200,6 @@ public class CollectionUsageThreshold { } static class Checker extends Thread { - private Object lock = new Object(); - private Object go = new Object(); private boolean checkerReady = false; private int waiters = 0; private boolean readyToCheck = false; @@ -190,83 +208,48 @@ public class CollectionUsageThreshold { }; public void run() { while (true) { - synchronized (lock) { - checkerReady = true; - try { - lock.wait(); - } catch (InterruptedException e) { - // ignore - } + try { + signals.acquire(EXPECTED_NUM_POOLS); checkResult(); - checkerReady = false; + } catch (InterruptedException e) { + throw new RuntimeException(e); + } catch (BrokenBarrierException e) { + throw new RuntimeException(e); } } } - private void checkResult() { + private void checkResult() throws InterruptedException, BrokenBarrierException { for (PoolRecord pr : result.values()) { if (pr.getListenerInvokedCount() != numGCs) { - throw new RuntimeException("Listeners invoked count = " + + fail("Listeners invoked count = " + pr.getListenerInvokedCount() + " expected to be " + numGCs); } if (pr.getNotifCount() != numGCs) { - throw new RuntimeException("Notif Count = " + + fail("Notif Count = " + pr.getNotifCount() + " expected to be " + numGCs); } long count = pr.getPool().getCollectionUsageThresholdCount(); if (count != numGCs) { - throw new RuntimeException("CollectionUsageThresholdCount = " + + fail("CollectionUsageThresholdCount = " + count + " expected to be " + numGCs); } if (!pr.getPool().isCollectionUsageThresholdExceeded()) { - throw new RuntimeException("isCollectionUsageThresholdExceeded" + + fail("isCollectionUsageThresholdExceeded" + " expected to be true"); } } - synchronized (go) { - // wait until the main thread is waiting for notification - while (waiters == 0) { - try { - go.wait(50); - } catch (InterruptedException e) { - // ignore - } - } - - System.out.println(Thread.currentThread().getName() + - " notifying main thread to continue - result checking finished"); - go.notify(); - } - } - public void goCheckResult() { - System.out.println(Thread.currentThread().getName() + - " notifying to check result"); - synchronized (lock) { - while (!checkerReady) { - try { - lock.wait(50); - } catch (InterruptedException e) { - // ignore - } - } - lock.notify(); - } + // wait until the main thread is waiting for notification + barrier.await(); + System.out.println("notifying main thread to continue - result checking finished"); } - public void waitForCheckResult() { - System.out.println(Thread.currentThread().getName() + - " waiting for result checking finishes"); - synchronized (go) { - waiters++; - try { - go.wait(); - } catch (InterruptedException e) { - // ignore - } - waiters--; - } + private void fail(String msg) { + // reset the barrier to cause BrokenBarrierException to avoid hanging + barrier.reset(); + throw new RuntimeException(msg); } } } diff --git a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdConcMarkSweepGC.sh b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdConcMarkSweepGC.sh index 3dac6c5d5af..afdaaa4444d 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdConcMarkSweepGC.sh +++ b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThresholdConcMarkSweepGC.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Test CollectionUsageThreshold with concurrent marksweep collector # @author Mandy Chung # +# @ignore 6982965 # @run build CollectionUsageThreshold # @run shell/timeout=300 CollectionUsageThresholdConcMarkSweepGC.sh # diff --git a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java index 00d8b4d7506..e83eb067790 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java +++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/MemoryMXBean/MemoryManagement.java b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagement.java index f6b3b163811..d9c8d472456 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagement.java +++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/MemoryMXBean/Pending.java b/jdk/test/java/lang/management/MemoryMXBean/Pending.java index 62df8fef7ce..cc0235f58f7 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/Pending.java +++ b/jdk/test/java/lang/management/MemoryMXBean/Pending.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/MemoryMXBean/ResetPeakMemoryUsage.java b/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java index da37945bd16..9acfa7be96c 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java +++ b/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/MemoryPoolMXBean/ThresholdTest.java b/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java index 622fc68a640..1abb198c217 100644 --- a/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java +++ b/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/RuntimeMXBean/UpTime.java b/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java index 4dca590f71a..ac332caf2ce 100644 --- a/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java +++ b/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/ThreadMXBean/AllThreadIds.java b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java index fa6ec61c812..05547b78001 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java +++ b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/ThreadMXBean/DisableTest.java b/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java index f5b763a5bb1..c4058b0a03c 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java +++ b/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/ThreadMXBean/EnableTest.java b/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java index a3530e44a03..216ac5a3b46 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java +++ b/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/ThreadMXBean/FindDeadlocks.java b/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java index b913147f92f..0bdcd7ae4de 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java +++ b/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/ThreadMXBean/FindMonitorDeadlock.java b/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java index 7381bc002ed..a64501f8233 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java +++ b/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/management/ThreadMXBean/Locks.java b/jdk/test/java/lang/management/ThreadMXBean/Locks.java index 1541a0865e6..5969aebc6d0 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/Locks.java +++ b/jdk/test/java/lang/management/ThreadMXBean/Locks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/reflect/Generics/Probe.java b/jdk/test/java/lang/reflect/Generics/Probe.java index c65a0558b0a..14d094a2e6c 100644 --- a/jdk/test/java/lang/reflect/Generics/Probe.java +++ b/jdk/test/java/lang/reflect/Generics/Probe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +47,6 @@ import static java.util.Arrays.*; "java.util.WeakHashMap$EntryIterator", "java.util.WeakHashMap$KeyIterator", "java.util.WeakHashMap$ValueIterator", - "java.util.TreeMap$EntryIterator", - "java.util.TreeMap$KeyIterator", - "java.util.TreeMap$ValueIterator", "java.util.HashMap$EntryIterator", "java.util.HashMap$KeyIterator", "java.util.HashMap$ValueIterator", diff --git a/jdk/test/java/lang/reflect/Generics/TestPlainArrayNotGeneric.java b/jdk/test/java/lang/reflect/Generics/TestPlainArrayNotGeneric.java index 27f54046a9a..de25d58b4ab 100644 --- a/jdk/test/java/lang/reflect/Generics/TestPlainArrayNotGeneric.java +++ b/jdk/test/java/lang/reflect/Generics/TestPlainArrayNotGeneric.java @@ -103,7 +103,7 @@ public class TestPlainArrayNotGeneric { } } - private static final Set checking = new HashSet(); + private static final Set checking = new HashSet<>(); private static void check(Type t, String what) { if (t == null || !checking.add(t)) diff --git a/jdk/test/java/lang/reflect/Proxy/Boxing.java b/jdk/test/java/lang/reflect/Proxy/Boxing.java index 2c4c2455021..c53da3e17c4 100644 --- a/jdk/test/java/lang/reflect/Proxy/Boxing.java +++ b/jdk/test/java/lang/reflect/Proxy/Boxing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/reflect/Proxy/ClassRestrictions.java b/jdk/test/java/lang/reflect/Proxy/ClassRestrictions.java index 6c35d75e9f9..1ed673db7a7 100644 --- a/jdk/test/java/lang/reflect/Proxy/ClassRestrictions.java +++ b/jdk/test/java/lang/reflect/Proxy/ClassRestrictions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/reflect/Proxy/returnTypes/Test.java b/jdk/test/java/lang/reflect/Proxy/returnTypes/Test.java index 754e965bb0d..ed47576c5ba 100644 --- a/jdk/test/java/lang/reflect/Proxy/returnTypes/Test.java +++ b/jdk/test/java/lang/reflect/Proxy/returnTypes/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Authenticator/B4769350.java b/jdk/test/java/net/Authenticator/B4769350.java index b80e1c70e01..86bff121b3b 100644 --- a/jdk/test/java/net/Authenticator/B4769350.java +++ b/jdk/test/java/net/Authenticator/B4769350.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/BindException/Test.java b/jdk/test/java/net/BindException/Test.java index 15871b76464..19bba9af90b 100644 --- a/jdk/test/java/net/BindException/Test.java +++ b/jdk/test/java/net/BindException/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/CookieHandlerTest.java b/jdk/test/java/net/CookieHandler/CookieHandlerTest.java index 90d03295992..39cee519884 100644 --- a/jdk/test/java/net/CookieHandler/CookieHandlerTest.java +++ b/jdk/test/java/net/CookieHandler/CookieHandlerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/TestHttpCookie.java b/jdk/test/java/net/CookieHandler/TestHttpCookie.java index b276f3128dc..7d167532cd1 100644 --- a/jdk/test/java/net/CookieHandler/TestHttpCookie.java +++ b/jdk/test/java/net/CookieHandler/TestHttpCookie.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/DatagramSocket/DatagramTimeout.java b/jdk/test/java/net/DatagramSocket/DatagramTimeout.java index 85bcbbdf6b5..9b90e8b845c 100644 --- a/jdk/test/java/net/DatagramSocket/DatagramTimeout.java +++ b/jdk/test/java/net/DatagramSocket/DatagramTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/DatagramSocket/SendSize.java b/jdk/test/java/net/DatagramSocket/SendSize.java index 7ce69a72e77..5facaadf0ea 100644 --- a/jdk/test/java/net/DatagramSocket/SendSize.java +++ b/jdk/test/java/net/DatagramSocket/SendSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/B6214234.java b/jdk/test/java/net/Inet6Address/B6214234.java index 71354021998..97038a89547 100644 --- a/jdk/test/java/net/Inet6Address/B6214234.java +++ b/jdk/test/java/net/Inet6Address/B6214234.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/B6558853.java b/jdk/test/java/net/Inet6Address/B6558853.java index cf4adff93dd..bece91872da 100644 --- a/jdk/test/java/net/Inet6Address/B6558853.java +++ b/jdk/test/java/net/Inet6Address/B6558853.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Serialize.java b/jdk/test/java/net/Inet6Address/serialize/Serialize.java index 5fcf774727b..c563c8b115a 100644 --- a/jdk/test/java/net/Inet6Address/serialize/Serialize.java +++ b/jdk/test/java/net/Inet6Address/serialize/Serialize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/InetAddress/CheckJNI.java b/jdk/test/java/net/InetAddress/CheckJNI.java index 2d8efdd4660..ad121d180ba 100644 --- a/jdk/test/java/net/InetAddress/CheckJNI.java +++ b/jdk/test/java/net/InetAddress/CheckJNI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/InetAddress/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor b/jdk/test/java/net/InetAddress/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor deleted file mode 100644 index efcf2378482..00000000000 --- a/jdk/test/java/net/InetAddress/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor +++ /dev/null @@ -1,2 +0,0 @@ -Simple1NameServiceDescriptor -Simple2NameServiceDescriptor diff --git a/jdk/test/java/net/MulticastSocket/NoLoopbackPackets.java b/jdk/test/java/net/MulticastSocket/NoLoopbackPackets.java index 9f0095ee810..f01993ab131 100644 --- a/jdk/test/java/net/MulticastSocket/NoLoopbackPackets.java +++ b/jdk/test/java/net/MulticastSocket/NoLoopbackPackets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/MulticastSocket/SetOutgoingIf.java b/jdk/test/java/net/MulticastSocket/SetOutgoingIf.java index 173b79d1a1b..cfcd3c09702 100644 --- a/jdk/test/java/net/MulticastSocket/SetOutgoingIf.java +++ b/jdk/test/java/net/MulticastSocket/SetOutgoingIf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/NetworkInterface/Equals.java b/jdk/test/java/net/NetworkInterface/Equals.java new file mode 100644 index 00000000000..003fb7113ab --- /dev/null +++ b/jdk/test/java/net/NetworkInterface/Equals.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 7003398 + * @run main/othervm Equals + */ +import java.net.NetworkInterface; +import java.net.InetAddress; +import java.util.Enumeration; +import java.util.HashMap; + +public class Equals { + + public static void main(String args[]) throws Exception { + + Enumeration nifs1 = NetworkInterface.getNetworkInterfaces(); + HashMap hashes = new HashMap<>(); + HashMap nicMap = new HashMap<>(); + + while (nifs1.hasMoreElements()) { + NetworkInterface ni = (NetworkInterface)nifs1.nextElement(); + hashes.put(ni.getName(),ni.hashCode()); + nicMap.put(ni.getName(),ni); + } + + System.setSecurityManager(new SecurityManager()); + + Enumeration nifs2 = NetworkInterface.getNetworkInterfaces(); + while (nifs2.hasMoreElements()) { + NetworkInterface ni = (NetworkInterface)nifs2.nextElement(); + NetworkInterface niOrig = nicMap.get(ni.getName()); + + int h = hashes.get(ni.getName()); + if (h != ni.hashCode()) { + throw new RuntimeException ("Hashcodes different for " + + ni.getName()); + } + if (!ni.equals(niOrig)) { + throw new RuntimeException ("equality different for " + + ni.getName()); + } + } + } +} diff --git a/jdk/test/java/net/ProxySelector/B6737819.java b/jdk/test/java/net/ProxySelector/B6737819.java index 8902820c4e0..421ec2bd56f 100644 --- a/jdk/test/java/net/ProxySelector/B6737819.java +++ b/jdk/test/java/net/ProxySelector/B6737819.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ResponseCache/B6181108.java b/jdk/test/java/net/ResponseCache/B6181108.java index 8b10d99bd6e..5b8b0f4e058 100644 --- a/jdk/test/java/net/ResponseCache/B6181108.java +++ b/jdk/test/java/net/ResponseCache/B6181108.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ResponseCache/ResponseCacheTest.java b/jdk/test/java/net/ResponseCache/ResponseCacheTest.java index 1e94dcd802e..57d87c04499 100644 --- a/jdk/test/java/net/ResponseCache/ResponseCacheTest.java +++ b/jdk/test/java/net/ResponseCache/ResponseCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ResponseCache/getResponseCode.java b/jdk/test/java/net/ResponseCache/getResponseCode.java index b5a4d0c2e04..008d896f370 100644 --- a/jdk/test/java/net/ResponseCache/getResponseCode.java +++ b/jdk/test/java/net/ResponseCache/getResponseCode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ServerSocket/AcceptCauseFileDescriptorLeak.java b/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java index 79113c288ea..6105224e542 100644 --- a/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java +++ b/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/CloseAvailable.java b/jdk/test/java/net/Socket/CloseAvailable.java index 5e9fd5c97b3..826c2e844a2 100644 --- a/jdk/test/java/net/Socket/CloseAvailable.java +++ b/jdk/test/java/net/Socket/CloseAvailable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/DeadlockTest.java b/jdk/test/java/net/Socket/DeadlockTest.java index a5d7751f5fd..ee1e045042f 100644 --- a/jdk/test/java/net/Socket/DeadlockTest.java +++ b/jdk/test/java/net/Socket/DeadlockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/LingerTest.java b/jdk/test/java/net/Socket/LingerTest.java index c84e153116b..84a02ef8503 100644 --- a/jdk/test/java/net/Socket/LingerTest.java +++ b/jdk/test/java/net/Socket/LingerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/LinkLocal.java b/jdk/test/java/net/Socket/LinkLocal.java index 8a0aea287b0..35cd96ac6a7 100644 --- a/jdk/test/java/net/Socket/LinkLocal.java +++ b/jdk/test/java/net/Socket/LinkLocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/ProxyCons.java b/jdk/test/java/net/Socket/ProxyCons.java index da80337070d..400849f4062 100644 --- a/jdk/test/java/net/Socket/ProxyCons.java +++ b/jdk/test/java/net/Socket/ProxyCons.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/ReadTimeout.java b/jdk/test/java/net/Socket/ReadTimeout.java index 89fe4150466..892e863f2b5 100644 --- a/jdk/test/java/net/Socket/ReadTimeout.java +++ b/jdk/test/java/net/Socket/ReadTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/SetReceiveBufferSize.java b/jdk/test/java/net/Socket/SetReceiveBufferSize.java index fa5302a4882..3f848f1fee5 100644 --- a/jdk/test/java/net/Socket/SetReceiveBufferSize.java +++ b/jdk/test/java/net/Socket/SetReceiveBufferSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/SetSoLinger.java b/jdk/test/java/net/Socket/SetSoLinger.java index f2eaff43823..244c25df103 100644 --- a/jdk/test/java/net/Socket/SetSoLinger.java +++ b/jdk/test/java/net/Socket/SetSoLinger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/ShutdownBoth.java b/jdk/test/java/net/Socket/ShutdownBoth.java index 99281c76e1a..421d52b7361 100644 --- a/jdk/test/java/net/Socket/ShutdownBoth.java +++ b/jdk/test/java/net/Socket/ShutdownBoth.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/SoTimeout.java b/jdk/test/java/net/Socket/SoTimeout.java index 0b1e448523d..9c2204746dc 100644 --- a/jdk/test/java/net/Socket/SoTimeout.java +++ b/jdk/test/java/net/Socket/SoTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/Timeout.java b/jdk/test/java/net/Socket/Timeout.java index 31471acfc1a..083e27629f4 100644 --- a/jdk/test/java/net/Socket/Timeout.java +++ b/jdk/test/java/net/Socket/Timeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/UrgentDataTest.java b/jdk/test/java/net/Socket/UrgentDataTest.java index d63bc5cb805..198712ebbe5 100644 --- a/jdk/test/java/net/Socket/UrgentDataTest.java +++ b/jdk/test/java/net/Socket/UrgentDataTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/asyncClose/BrokenPipe.java b/jdk/test/java/net/Socket/asyncClose/BrokenPipe.java index 25789d07256..b3133c8b504 100644 --- a/jdk/test/java/net/Socket/asyncClose/BrokenPipe.java +++ b/jdk/test/java/net/Socket/asyncClose/BrokenPipe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socket/setReuseAddress/Restart.java b/jdk/test/java/net/Socket/setReuseAddress/Restart.java index 08bb5af2f62..051e322e43f 100644 --- a/jdk/test/java/net/Socket/setReuseAddress/Restart.java +++ b/jdk/test/java/net/Socket/setReuseAddress/Restart.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketInputStream/SocketClosedException.java b/jdk/test/java/net/SocketInputStream/SocketClosedException.java index cf141863a53..6ff6b440778 100644 --- a/jdk/test/java/net/SocketInputStream/SocketClosedException.java +++ b/jdk/test/java/net/SocketInputStream/SocketClosedException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketInputStream/SocketTimeout.java b/jdk/test/java/net/SocketInputStream/SocketTimeout.java index ad4c70acbbf..7108a3abad3 100644 --- a/jdk/test/java/net/SocketInputStream/SocketTimeout.java +++ b/jdk/test/java/net/SocketInputStream/SocketTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Socks/SocksProxyVersion.java b/jdk/test/java/net/Socks/SocksProxyVersion.java new file mode 100644 index 00000000000..19298e59c6b --- /dev/null +++ b/jdk/test/java/net/Socks/SocksProxyVersion.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6964547 + * @run main/othervm SocksProxyVersion + * @summary test socksProxyVersion system property + */ + +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketException; +import java.io.DataInputStream; +import java.io.IOException; + +public class SocksProxyVersion implements Runnable { + ServerSocket ss; + volatile boolean failed; + + public static void main(String[] args) throws Exception { + new SocksProxyVersion(); + } + + public SocksProxyVersion() throws Exception { + ss = new ServerSocket(0); + int port = ss.getLocalPort(); + Thread serverThread = new Thread(this); + serverThread.start(); + + System.setProperty("socksProxyHost", "localhost"); + System.setProperty("socksProxyPort", Integer.toString(port)); + + // SOCKS V4 + System.setProperty("socksProxyVersion", Integer.toString(4)); + try (Socket s = new Socket()) { + s.connect(new InetSocketAddress("localhost", port)); + } catch (SocketException e) { + // java.net.SocketException: Malformed reply from SOCKS server + // This exception is OK, since the "server" does not implement + // the socks protocol. It just verifies the version and closes. + } + + // SOCKS V5 + System.setProperty("socksProxyVersion", Integer.toString(5)); + try (Socket s = new Socket()) { + s.connect(new InetSocketAddress("localhost", port)); + } catch (SocketException e) { /* OK */ } + + serverThread.join(); + if (failed) { + throw new RuntimeException("socksProxyVersion not being set correctly"); + } + } + + public void run() { + try (ss) { + Socket s = ss.accept(); + int version = (s.getInputStream()).read(); + if (version != 4) { + System.out.println("Got " + version + ", expected 4"); + failed = true; + } + s.close(); + + s = ss.accept(); + version = (s.getInputStream()).read(); + if (version != 5) { + System.out.println("Got " + version + ", expected 5"); + failed = true; + } + s.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/jdk/test/java/net/URI/Test.java b/jdk/test/java/net/URI/Test.java index 39b5b9487d1..f0bb8da821a 100644 --- a/jdk/test/java/net/URI/Test.java +++ b/jdk/test/java/net/URI/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URL/GetContent.java b/jdk/test/java/net/URL/GetContent.java index aa32da29bd3..70dbf219bd5 100644 --- a/jdk/test/java/net/URL/GetContent.java +++ b/jdk/test/java/net/URL/GetContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URL/TestIPv6Addresses.java b/jdk/test/java/net/URL/TestIPv6Addresses.java index 0aea552d5cd..8014d3158b8 100644 --- a/jdk/test/java/net/URL/TestIPv6Addresses.java +++ b/jdk/test/java/net/URL/TestIPv6Addresses.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URLClassLoader/B6896088.java b/jdk/test/java/net/URLClassLoader/B6896088.java new file mode 100644 index 00000000000..4e0792b0345 --- /dev/null +++ b/jdk/test/java/net/URLClassLoader/B6896088.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6896088 + * @run main/othervm B6896088 + * @summary URLClassLoader.close() apparently not working for JAR URLs on Windows + */ + +import java.net.*; +import java.io.*; +import java.nio.file.Path; + +public class B6896088 { + + public static void main(String[] args) throws Exception { + + String dir = System.getProperty ("test.classes"); + File jarf = new File (dir, "foo.jar"); + FileOutputStream fos = new FileOutputStream (jarf); + fos.write(bytes(nums)); + fos.close(); + + // Create URL using JAR protocol + String jarName = (jarf.toURI()).toString(); + URL url = new URL("jar", "", jarName + "!/"); + + // Create URLClassLoader from the URL + URLClassLoader loader = new URLClassLoader(new URL[]{url}); + Class c = loader.loadClass("Foo"); + + // Close the URLClassLoader so we can delete/update the jar file + loader.close(); + + // Now try to delete the jar file + + if (jarf.delete() && !jarf.exists()) { + System.out.println(jarf.getName()+" File Deleted"); + } else { + System.out.println(jarf.getName()+" File Not Deleted"); + throw new RuntimeException ("File not deleted"); + } + } + + static byte[] bytes (int[] i) { + byte[] buf = new byte [i.length]; + + for (int j=0; j= 0) { - o.write (buf, 0, count); - } - i.close(); - o.close(); - } catch (IOException e) { - throw new RuntimeException (e); - } - } - - static void rm_minus_rf (File path) { - if (!path.exists()) { - return; - } - if (path.isFile()) { - if (!path.delete()) { - throw new RuntimeException ("Could not delete " + path); - } - } else if (path.isDirectory ()) { - String[] names = path.list(); - File[] files = path.listFiles(); - for (int i=0; i= 0) { + o.write (buf, 0, count); + } + i.close(); + o.close(); + } catch (IOException e) { + throw new RuntimeException (e); + } + } + + static void rm_minus_rf (File path) { + if (!path.exists()) { + return; + } + if (path.isFile()) { + if (!path.delete()) { + throw new RuntimeException ("Could not delete " + path); + } + } else if (path.isDirectory ()) { + String[] names = path.list(); + File[] files = path.listFiles(); + for (int i=0; i ${TESTCLASSES}/test3/hello.txt +echo "Bye world" > ${TESTCLASSES}/test3/bye.txt +cp ${TESTSRC}/test1/com/foo/TestClass.java ${TESTCLASSES}/test3 +cd ${TESTCLASSES}/test3 +${JAVAC} -d . TestClass.java + +${JAR} cvf foo.jar hello.txt bye.txt com/foo/TestClass.class +rm -f ../foo.jar +mv foo.jar .. diff --git a/jdk/test/java/net/URLConnection/B5052093.java b/jdk/test/java/net/URLConnection/B5052093.java index a6666ef0386..2446fa52627 100644 --- a/jdk/test/java/net/URLConnection/B5052093.java +++ b/jdk/test/java/net/URLConnection/B5052093.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URLConnection/DisconnectAfterEOF.java b/jdk/test/java/net/URLConnection/DisconnectAfterEOF.java index 0a3814794b7..8ae427bb194 100644 --- a/jdk/test/java/net/URLConnection/DisconnectAfterEOF.java +++ b/jdk/test/java/net/URLConnection/DisconnectAfterEOF.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URLConnection/HandleContentTypeWithAttrs.java b/jdk/test/java/net/URLConnection/HandleContentTypeWithAttrs.java index 50fcd388f16..87d1f831ec6 100644 --- a/jdk/test/java/net/URLConnection/HandleContentTypeWithAttrs.java +++ b/jdk/test/java/net/URLConnection/HandleContentTypeWithAttrs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URLConnection/HttpContinueStackOverflow.java b/jdk/test/java/net/URLConnection/HttpContinueStackOverflow.java index 502adf9fae4..5fe11730616 100644 --- a/jdk/test/java/net/URLConnection/HttpContinueStackOverflow.java +++ b/jdk/test/java/net/URLConnection/HttpContinueStackOverflow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URLConnection/Redirect307Test.java b/jdk/test/java/net/URLConnection/Redirect307Test.java index 37f044edac1..b9e77490d3b 100644 --- a/jdk/test/java/net/URLConnection/Redirect307Test.java +++ b/jdk/test/java/net/URLConnection/Redirect307Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URLConnection/RedirectLimit.java b/jdk/test/java/net/URLConnection/RedirectLimit.java index b0ef22b94d9..1df973f8bc0 100644 --- a/jdk/test/java/net/URLConnection/RedirectLimit.java +++ b/jdk/test/java/net/URLConnection/RedirectLimit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URLConnection/ResendPostBody.java b/jdk/test/java/net/URLConnection/ResendPostBody.java index 99331584bb5..771ccd6926a 100644 --- a/jdk/test/java/net/URLConnection/ResendPostBody.java +++ b/jdk/test/java/net/URLConnection/ResendPostBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URLConnection/SetIfModifiedSince.java b/jdk/test/java/net/URLConnection/SetIfModifiedSince.java index f66d9385c1e..597610e9108 100644 --- a/jdk/test/java/net/URLConnection/SetIfModifiedSince.java +++ b/jdk/test/java/net/URLConnection/SetIfModifiedSince.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URLConnection/TimeoutTest.java b/jdk/test/java/net/URLConnection/TimeoutTest.java index e8c32982c8f..b3a59b4d9ed 100644 --- a/jdk/test/java/net/URLConnection/TimeoutTest.java +++ b/jdk/test/java/net/URLConnection/TimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URLConnection/URLConnectionHeaders.java b/jdk/test/java/net/URLConnection/URLConnectionHeaders.java index 4896e7a0b58..50180a440c4 100644 --- a/jdk/test/java/net/URLConnection/URLConnectionHeaders.java +++ b/jdk/test/java/net/URLConnection/URLConnectionHeaders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URLConnection/ZeroContentLength.java b/jdk/test/java/net/URLConnection/ZeroContentLength.java index 3da6ac1aba0..b778c487abb 100644 --- a/jdk/test/java/net/URLConnection/ZeroContentLength.java +++ b/jdk/test/java/net/URLConnection/ZeroContentLength.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/URLConnection/contentHandler/UserContentHandler.java b/jdk/test/java/net/URLConnection/contentHandler/UserContentHandler.java index e10e35c085a..da433b6c7c6 100644 --- a/jdk/test/java/net/URLConnection/contentHandler/UserContentHandler.java +++ b/jdk/test/java/net/URLConnection/contentHandler/UserContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ipv6tests/B6521014.java b/jdk/test/java/net/ipv6tests/B6521014.java index 3e401bd794b..3cb16b8dfe1 100644 --- a/jdk/test/java/net/ipv6tests/B6521014.java +++ b/jdk/test/java/net/ipv6tests/B6521014.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ipv6tests/TcpTest.java b/jdk/test/java/net/ipv6tests/TcpTest.java index bbed1f7ba6d..5f72553da82 100644 --- a/jdk/test/java/net/ipv6tests/TcpTest.java +++ b/jdk/test/java/net/ipv6tests/TcpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ipv6tests/Tests.java b/jdk/test/java/net/ipv6tests/Tests.java index 588821304f8..8f1793bb381 100644 --- a/jdk/test/java/net/ipv6tests/Tests.java +++ b/jdk/test/java/net/ipv6tests/Tests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Buffer/StringCharBufferSliceTest.java b/jdk/test/java/nio/Buffer/StringCharBufferSliceTest.java index 0b8dc8aa09a..e730b224788 100644 --- a/jdk/test/java/nio/Buffer/StringCharBufferSliceTest.java +++ b/jdk/test/java/nio/Buffer/StringCharBufferSliceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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 4997655 + * @bug 4997655 7000913 * @summary (bf) CharBuffer.slice() on wrapped CharSequence results in wrong position */ @@ -75,12 +75,27 @@ public class StringCharBufferSliceTest { } } + System.out.println( + ">>> StringCharBufferSliceTest-main: testing slice with result of slice"); + buff.position(0); + buff.limit(buff.capacity()); + slice = buff.slice(); + for (int i=0; i<4; i++) { + slice.position(i); + CharBuffer nextSlice = slice.slice(); + if (nextSlice.position() != 0) + throw new RuntimeException("New buffer's position should be zero"); + if (!nextSlice.equals(slice)) + throw new RuntimeException("New buffer should be equal"); + slice = nextSlice; + } + System.out.println( ">>> StringCharBufferSliceTest-main: testing toString."); buff.position(4); buff.limit(7); slice = buff.slice(); - if (! slice.toString().equals("tes")) { + if (!slice.toString().equals("tes")) { throw new RuntimeException("bad toString() after slice(): " + slice.toString()); } @@ -104,6 +119,7 @@ public class StringCharBufferSliceTest { || dupe.charAt(2) != 's' || dupe.charAt(3) != 't') { throw new RuntimeException("bad duplicate() after slice(): '" + dupe + "'"); } + System.out.println(">>> StringCharBufferSliceTest-main: done!"); } diff --git a/jdk/test/java/nio/BufferPoolMXBean/Basic.java b/jdk/test/java/nio/BufferPoolMXBean/Basic.java index c784985cdf7..255edae0c8b 100644 --- a/jdk/test/java/nio/BufferPoolMXBean/Basic.java +++ b/jdk/test/java/nio/BufferPoolMXBean/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/MappedByteBuffer/Basic.java b/jdk/test/java/nio/MappedByteBuffer/Basic.java index 3b068b76983..f767fdf99fc 100644 --- a/jdk/test/java/nio/MappedByteBuffer/Basic.java +++ b/jdk/test/java/nio/MappedByteBuffer/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +24,6 @@ /* @test * @bug 4462336 6799037 * @summary Simple MappedByteBuffer tests - * @run main/othervm Basic */ import java.io.*; @@ -76,5 +75,10 @@ public class Basic { throw new RuntimeException("Incorrect isReadOnly"); fc.close(); raf.close(); + + // clean-up + mbb = null; + System.gc(); + Thread.sleep(500); } } diff --git a/jdk/test/java/nio/MappedByteBuffer/Force.java b/jdk/test/java/nio/MappedByteBuffer/Force.java index 5b6c804e3b4..bd66a31ff21 100644 --- a/jdk/test/java/nio/MappedByteBuffer/Force.java +++ b/jdk/test/java/nio/MappedByteBuffer/Force.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/MappedByteBuffer/ZeroMap.java b/jdk/test/java/nio/MappedByteBuffer/ZeroMap.java index 24df47a5cf9..f80e72f803d 100644 --- a/jdk/test/java/nio/MappedByteBuffer/ZeroMap.java +++ b/jdk/test/java/nio/MappedByteBuffer/ZeroMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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 b0fb0cfa351..6de7f2ede0b 100644 --- a/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java +++ b/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/AsynchronousChannelGroup/Basic.java b/jdk/test/java/nio/channels/AsynchronousChannelGroup/Basic.java index ce22484cf99..02a9f73ced5 100644 --- a/jdk/test/java/nio/channels/AsynchronousChannelGroup/Basic.java +++ b/jdk/test/java/nio/channels/AsynchronousChannelGroup/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +89,9 @@ public class Basic { } // create channel that is bound to group AsynchronousChannel ch; - switch (rand.nextInt(3)) { + switch (rand.nextInt(2)) { case 0 : ch = AsynchronousSocketChannel.open(group); break; case 1 : ch = AsynchronousServerSocketChannel.open(group); break; - case 2 : ch = AsynchronousDatagramChannel.open(null, group); break; default : throw new AssertionError(); } group.shutdown(); @@ -128,18 +127,9 @@ public class Basic { } // I/O in progress - AsynchronousChannel ch; - if (rand.nextBoolean()) { - AsynchronousServerSocketChannel listener = AsynchronousServerSocketChannel - .open(group).bind(new InetSocketAddress(0)); - listener.accept(); - ch = listener; - } else { - AsynchronousDatagramChannel adc = - AsynchronousDatagramChannel.open(null, group); - adc.receive(ByteBuffer.allocate(100)); - ch = adc; - } + AsynchronousServerSocketChannel ch = AsynchronousServerSocketChannel + .open(group).bind(new InetSocketAddress(0)); + ch.accept(); // forceful shutdown group.shutdownNow(); diff --git a/jdk/test/java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java b/jdk/test/java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java index 5e479bd042c..2945343bfe0 100644 --- a/jdk/test/java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java +++ b/jdk/test/java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/AsynchronousChannelGroup/Identity.java b/jdk/test/java/nio/channels/AsynchronousChannelGroup/Identity.java index 9bfd2a92876..366449bfc32 100644 --- a/jdk/test/java/nio/channels/AsynchronousChannelGroup/Identity.java +++ b/jdk/test/java/nio/channels/AsynchronousChannelGroup/Identity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/AsynchronousDatagramChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousDatagramChannel/Basic.java deleted file mode 100644 index 7beb7d6525f..00000000000 --- a/jdk/test/java/nio/channels/AsynchronousDatagramChannel/Basic.java +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* @test - * @bug 4527345 6842687 - * @summary Unit test for AsynchronousDatagramChannel - */ - -import java.nio.ByteBuffer; -import java.nio.channels.*; -import java.net.*; -import java.util.concurrent.*; -import java.util.concurrent.atomic.*; - -public class Basic { - - public static void main(String[] args) throws Exception { - doReceiveTests(); - doReadTests(); - doSendTests(); - doWriteTests(); - doCancelTests(); - doMulticastTests(); - } - - // basic receive tests - static void doReceiveTests() throws Exception { - final byte[] msg = "hello".getBytes(); - - AsynchronousDatagramChannel ch = AsynchronousDatagramChannel.open() - .bind(new InetSocketAddress(0)); - int port = ((InetSocketAddress)(ch.getLocalAddress())).getPort(); - InetAddress rh = InetAddress.getLocalHost(); - final SocketAddress sa = new InetSocketAddress(rh, port); - - DatagramChannel sender = DatagramChannel.open(); - ByteBuffer dst = ByteBuffer.allocateDirect(100); - - // Test: datagram packet received immediately - sender.send(ByteBuffer.wrap(msg), sa); - dst.clear(); - ch.receive(dst).get(1, TimeUnit.SECONDS); - if (dst.flip().remaining() != msg.length) - throw new RuntimeException("Unexpected number of bytes read"); - - // Test: datagram packet not received immediately - dst.clear(); - final CountDownLatch latch = new CountDownLatch(1); - ch.receive(dst, (Void)null, new CompletionHandler() { - public void completed(SocketAddress source, Void att) { - latch.countDown(); - } - public void failed (Throwable exc, Void att) { - } - }); - Thread.sleep(2000); - sender.send(ByteBuffer.wrap(msg), sa); - latch.await(2, TimeUnit.SECONDS); // wait for completion handler - - // Test: timeout - dst.clear(); - final AtomicReference exception = new AtomicReference(); - ch.receive(dst, 2, TimeUnit.SECONDS, (Void)null, new CompletionHandler() { - public void completed(SocketAddress source, Void att) { - } - public void failed (Throwable exc, Void att) { - exception.set(exc); - } - }); - Throwable result; - while ((result = exception.get()) == null) { - Thread.sleep(100); - } - if (!(result instanceof InterruptedByTimeoutException)) - throw new RuntimeException("InterruptedByTimeoutException expected"); - - // AsynchronousCloseException - dst = ByteBuffer.allocateDirect(100); - exception.set(null); - ch.receive(dst, (Void)null, new CompletionHandler() { - public void completed(SocketAddress source, Void att) { - } - public void failed (Throwable exc, Void att) { - exception.set(exc); - } - }); - ch.close(); - while ((result = exception.get()) == null) { - Thread.sleep(100); - } - if (!(result instanceof AsynchronousCloseException)) - throw new RuntimeException("AsynchronousCloseException expected"); - - // done - sender.close(); - } - - // basic read tests - static void doReadTests() throws Exception { - final byte[] msg = "hello".getBytes(); - - AsynchronousDatagramChannel ch = AsynchronousDatagramChannel.open() - .bind(new InetSocketAddress(0)); - int port = ((InetSocketAddress)(ch.getLocalAddress())).getPort(); - InetAddress lh = InetAddress.getLocalHost(); - final SocketAddress sa = new InetSocketAddress(lh, port); - - DatagramChannel sender = DatagramChannel.open(); - ByteBuffer dst = ByteBuffer.allocateDirect(100); - - // Test: not connected - try { - ch.read(dst); - throw new RuntimeException("NotYetConnectedException expected"); - } catch (NotYetConnectedException e) { - } - - // connect the channel - sender.bind(new InetSocketAddress(0)); - ch.connect(new InetSocketAddress(lh, - ((InetSocketAddress)(sender.getLocalAddress())).getPort())); - - // Test: datagram packet received immediately - sender.send(ByteBuffer.wrap(msg), sa); - dst.clear(); - ch.read(dst).get(1, TimeUnit.SECONDS); - if (dst.flip().remaining() != msg.length) - throw new RuntimeException("Unexpected number of bytes read"); - - // Test: datagram packet not received immediately - dst.clear(); - final CountDownLatch l1 = new CountDownLatch(1); - ch.read(dst, (Void)null, new CompletionHandler() { - public void completed(Integer bytesRead, Void att) { - l1.countDown(); - } - public void failed (Throwable exc, Void att) { - } - }); - Thread.sleep(2000); - sender.send(ByteBuffer.wrap(msg), sa); - l1.await(2, TimeUnit.SECONDS); - - // Test: timeout - dst.clear(); - final AtomicReference exception = new AtomicReference(); - ch.read(dst, 2, TimeUnit.SECONDS, (Void)null, new CompletionHandler() { - public void completed(Integer bytesRead, Void att) { - } - public void failed (Throwable exc, Void att) { - exception.set(exc); - } - }); - Throwable result; - while ((result = exception.get()) == null) { - Thread.sleep(100); - } - if (!(result instanceof InterruptedByTimeoutException)) - throw new RuntimeException("InterruptedByTimeoutException expected"); - - // AsynchronousCloseException - dst.clear(); - exception.set(null); - ch.read(dst, (Void)null, new CompletionHandler() { - public void completed(Integer bytesRead, Void att) { - } - public void failed (Throwable exc, Void att) { - exception.set(exc); - } - }); - ch.close(); - while ((result = exception.get()) == null) { - Thread.sleep(100); - } - if (!(result instanceof AsynchronousCloseException)) - throw new RuntimeException("AsynchronousCloseException expected"); - - // done - sender.close(); - } - - // basic send tests - static void doSendTests() throws Exception { - final byte[] msg = "hello".getBytes(); - - DatagramChannel reader = DatagramChannel.open() - .bind(new InetSocketAddress(0)); - int port = ((InetSocketAddress)(reader.getLocalAddress())).getPort(); - InetAddress rh = InetAddress.getLocalHost(); - SocketAddress sa = new InetSocketAddress(rh, port); - - AsynchronousDatagramChannel ch = AsynchronousDatagramChannel.open(); - - // Test: send datagram packet to reader - int bytesSent = ch.send(ByteBuffer.wrap(msg), sa).get(); - if (bytesSent != msg.length) - throw new RuntimeException("Unexpected number of bytes sent"); - - // check received - ByteBuffer dst = ByteBuffer.allocateDirect(100); - reader.receive(dst); - dst.flip(); - if (dst.remaining() != msg.length) - throw new RuntimeException("Unexpected number of bytes received"); - - // Test: send datagram packet to reader and check completion handler - // is invoked - final CountDownLatch l2 = new CountDownLatch(1); - ch.send(ByteBuffer.wrap(msg), sa, (Void)null, new CompletionHandler() { - public void completed(Integer bytesSent, Void att) { - if (bytesSent != msg.length) - throw new RuntimeException("Unexpected number of bytes received"); - l2.countDown(); - } - public void failed (Throwable exc, Void att) { - } - }); - l2.await(5, TimeUnit.SECONDS); - - // check received - dst.clear(); - reader.receive(dst); - dst.flip(); - if (dst.remaining() != msg.length) - throw new RuntimeException("Unexpected number of bytes received"); - - // Test: check that failed method is invoked - ch.close(); - final CountDownLatch l3 = new CountDownLatch(1); - ch.send(ByteBuffer.wrap(msg), sa, (Void)null, new CompletionHandler() { - public void completed(Integer bytesSent, Void att) { - throw new RuntimeException("completed method invoked"); - } - public void failed (Throwable exc, Void att) { - if (exc instanceof ClosedChannelException) { - l3.countDown(); - } else { - throw new RuntimeException(exc); - } - } - }); - l3.await(5, TimeUnit.SECONDS); - - // done - reader.close(); - } - - // basic write tests - static void doWriteTests() throws Exception { - final byte[] msg = "hello".getBytes(); - - DatagramChannel reader = DatagramChannel.open() - .bind(new InetSocketAddress(0)); - int port = ((InetSocketAddress)(reader.getLocalAddress())).getPort(); - InetAddress rh = InetAddress.getLocalHost(); - SocketAddress sa = new InetSocketAddress(rh, port); - - AsynchronousDatagramChannel ch = AsynchronousDatagramChannel.open(); - - // Test: unconnected - try { - ch.write(ByteBuffer.wrap(msg)).get(); - throw new RuntimeException("NotYetConnectedException expected"); - } catch (NotYetConnectedException e) { - } - - // Test: connect, and write datagram - ch.connect(sa); - int bytesSent = ch.write(ByteBuffer.wrap(msg)).get(); - if (bytesSent != msg.length) - throw new RuntimeException("Unexpected number of bytes sent"); - - // check received - ByteBuffer dst = ByteBuffer.allocateDirect(100); - reader.receive(dst); - dst.flip(); - if (dst.remaining() != msg.length) - throw new RuntimeException("Unexpected number of bytes received"); - - // Test: write datagram and check completion handler is invoked - final CountDownLatch l2 = new CountDownLatch(1); - ch.write(ByteBuffer.wrap(msg), (Void)null, new CompletionHandler() { - public void completed(Integer bytesSent, Void att) { - if (bytesSent != msg.length) - throw new RuntimeException("Unexpected number of bytes received"); - l2.countDown(); - } - public void failed (Throwable exc, Void att) { - } - }); - l2.await(5, TimeUnit.SECONDS); - - // check received - dst.clear(); - reader.receive(dst); - dst.flip(); - if (dst.remaining() != msg.length) - throw new RuntimeException("Unexpected number of bytes received"); - - // done - ch.close(); - reader.close(); - } - - static void cancelAndCheck(Future result) - throws InterruptedException - { - boolean cancelled = result.cancel(false); - if (!cancelled) - throw new RuntimeException("Not cancelled"); - if (!result.isDone()) - throw new RuntimeException("Should be done"); - try { - result.get(); - throw new RuntimeException("Result not expected"); - } catch (CancellationException e) { - // expected - } catch (ExecutionException e) { - throw new RuntimeException("Should not fail"); - } - } - - // basic cancel tests - static void doCancelTests() throws Exception { - InetAddress lh = InetAddress.getLocalHost(); - - // receive - for (int i=0; i<2; i++) { - AsynchronousDatagramChannel ch = - AsynchronousDatagramChannel.open().bind(new InetSocketAddress(0)); - Future remote = ch.receive(ByteBuffer.allocate(100)); - cancelAndCheck(remote); - ch.close(); - } - - // read - for (int i=0; i<2; i++) { - AsynchronousDatagramChannel ch = - AsynchronousDatagramChannel.open().bind(new InetSocketAddress(0)); - ch.connect(new InetSocketAddress(lh, - ((InetSocketAddress)(ch.getLocalAddress())).getPort())); - final CountDownLatch latch = new CountDownLatch(1); - long timeout = (i == 0) ? 0L : 60L; - Future result = ch.read(ByteBuffer.allocate(100)); - cancelAndCheck(result); - ch.close(); - } - } - - // basic multicast test - static void doMulticastTests() throws Exception { - final byte[] msg = "hello".getBytes(); - - InetAddress lh = InetAddress.getLocalHost(); - NetworkInterface interf = NetworkInterface.getByInetAddress(lh); - if (interf.isLoopback() || !interf.supportsMulticast()) { - System.out.println("Multicasting not tested"); - return; - } - - AsynchronousDatagramChannel ch = AsynchronousDatagramChannel - .open(StandardProtocolFamily.INET, null) - .setOption(StandardSocketOption.SO_REUSEADDR, true) - .bind(new InetSocketAddress(0)); - - int port = ((InetSocketAddress)(ch.getLocalAddress())).getPort(); - - // join group - InetAddress group = InetAddress.getByName("225.4.5.6"); - MembershipKey key = ch.join(group, interf); - - // check key - if (key.channel() != ch) - throw new RuntimeException("Not the expected channel"); - - // send message to group - DatagramChannel sender = DatagramChannel.open(); - sender.send(ByteBuffer.wrap(msg), new InetSocketAddress(group, port)); - sender.close(); - - // check message received - ByteBuffer dst = ByteBuffer.allocate(200); - SocketAddress source = ch.receive(dst).get(2, TimeUnit.SECONDS); - if (!((InetSocketAddress)source).getAddress().equals(lh)) - throw new RuntimeException("Unexpected source"); - - // done - ch.close(); - } -} diff --git a/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java index 728a12af0a6..10f51c978ca 100644 --- a/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java +++ b/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/AsynchronousFileChannel/Lock.java b/jdk/test/java/nio/channels/AsynchronousFileChannel/Lock.java index 648776832d3..a7f2c7bb0cb 100644 --- a/jdk/test/java/nio/channels/AsynchronousFileChannel/Lock.java +++ b/jdk/test/java/nio/channels/AsynchronousFileChannel/Lock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/AsynchronousServerSocketChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousServerSocketChannel/Basic.java index e526112ae26..dac878aab44 100644 --- a/jdk/test/java/nio/channels/AsynchronousServerSocketChannel/Basic.java +++ b/jdk/test/java/nio/channels/AsynchronousServerSocketChannel/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/AsynchronousSocketChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java index e8f23f46866..9f67fc37113 100644 --- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java +++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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 4607272 6842687 + * @bug 4607272 6842687 6878369 * @summary Unit test for AsynchronousSocketChannel * @run main/timeout=600 Basic */ @@ -712,52 +712,57 @@ public class Basic { } static void testTimeout() throws Exception { + System.out.println("-- timeouts --"); + testTimeout(Integer.MIN_VALUE, TimeUnit.SECONDS); + testTimeout(-1L, TimeUnit.SECONDS); + testTimeout(0L, TimeUnit.SECONDS); + testTimeout(2L, TimeUnit.SECONDS); + } + + static void testTimeout(final long timeout, final TimeUnit unit) throws Exception { Server server = new Server(); AsynchronousSocketChannel ch = AsynchronousSocketChannel.open(); ch.connect(server.address()).get(); - System.out.println("-- timeout when reading --"); - ByteBuffer dst = ByteBuffer.allocate(512); final AtomicReference readException = new AtomicReference(); - // this read should timeout - ch.read(dst, 3, TimeUnit.SECONDS, (Void)null, - new CompletionHandler() - { + // this read should timeout if value is > 0 + ch.read(dst, timeout, unit, null, new CompletionHandler() { public void completed(Integer result, Void att) { - throw new RuntimeException("Should not complete"); + readException.set(new RuntimeException("Should not complete")); } public void failed(Throwable exc, Void att) { readException.set(exc); } }); - // wait for exception - while (readException.get() == null) { - Thread.sleep(100); + if (timeout > 0L) { + // wait for exception + while (readException.get() == null) { + Thread.sleep(100); + } + if (!(readException.get() instanceof InterruptedByTimeoutException)) + throw new RuntimeException("InterruptedByTimeoutException expected"); + + // after a timeout then further reading should throw unspecified runtime exception + boolean exceptionThrown = false; + try { + ch.read(dst); + } catch (RuntimeException x) { + exceptionThrown = true; + } + if (!exceptionThrown) + throw new RuntimeException("RuntimeException expected after timeout."); + } else { + Thread.sleep(1000); + Throwable exc = readException.get(); + if (exc != null) + throw new RuntimeException(exc); } - if (!(readException.get() instanceof InterruptedByTimeoutException)) - throw new RuntimeException("InterruptedByTimeoutException expected"); - - // after a timeout then further reading should throw unspecified runtime exception - boolean exceptionThrown = false; - try { - ch.read(dst); - } catch (RuntimeException x) { - exceptionThrown = true; - } - if (!exceptionThrown) - throw new RuntimeException("RuntimeException expected after timeout."); - - - System.out.println("-- timeout when writing --"); final AtomicReference writeException = new AtomicReference(); - final long timeout = 5; - final TimeUnit unit = TimeUnit.SECONDS; - // write bytes to fill socket buffer ch.write(genBuffer(), timeout, unit, ch, new CompletionHandler() @@ -769,24 +774,32 @@ public class Basic { writeException.set(exc); } }); + if (timeout > 0) { + // wait for exception + while (writeException.get() == null) { + Thread.sleep(100); + } + if (!(writeException.get() instanceof InterruptedByTimeoutException)) + throw new RuntimeException("InterruptedByTimeoutException expected"); - // wait for exception - while (writeException.get() == null) { - Thread.sleep(100); + // after a timeout then further writing should throw unspecified runtime exception + boolean exceptionThrown = false; + try { + ch.write(genBuffer()); + } catch (RuntimeException x) { + exceptionThrown = true; + } + if (!exceptionThrown) + throw new RuntimeException("RuntimeException expected after timeout."); + } else { + Thread.sleep(1000); + Throwable exc = writeException.get(); + if (exc != null) + throw new RuntimeException(exc); } - if (!(writeException.get() instanceof InterruptedByTimeoutException)) - throw new RuntimeException("InterruptedByTimeoutException expected"); - - // after a timeout then further writing should throw unspecified runtime exception - exceptionThrown = false; - try { - ch.write(genBuffer()); - } catch (RuntimeException x) { - exceptionThrown = true; - } - if (!exceptionThrown) - throw new RuntimeException("RuntimeException expected after timeout."); + // clean-up + server.accept().close(); ch.close(); server.close(); } diff --git a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Leaky.java b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Leaky.java index a950cc6676a..2606627446d 100644 --- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Leaky.java +++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Leaky.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,15 +22,19 @@ */ /* @test - * @bug 4607272 + * @bug 4607272 6999915 * @summary Unit test for AsynchronousSocketChannel - * @run main/othervm -XX:+DisableExplicitGC -mx64m Leaky + * @run main/othervm -XX:+DisableExplicitGC -XX:MaxDirectMemorySize=64m Leaky */ import java.nio.ByteBuffer; +import java.nio.BufferPoolMXBean; import java.nio.channels.*; import java.net.*; +import java.util.List; import java.util.concurrent.Future; +import java.util.concurrent.ThreadFactory; +import java.lang.management.ManagementFactory; /** * Heap buffers must be substituted with direct buffers when doing I/O. This @@ -49,13 +53,13 @@ public class Leaky { private final ByteBuffer dst; private Future readResult; - Connection() throws Exception { + Connection(AsynchronousChannelGroup group) throws Exception { ServerSocketChannel ssc = ServerSocketChannel.open().bind(new InetSocketAddress(0)); InetAddress lh = InetAddress.getLocalHost(); int port = ((InetSocketAddress)(ssc.getLocalAddress())).getPort(); SocketAddress remote = new InetSocketAddress(lh, port); - client = AsynchronousSocketChannel.open(); + client = AsynchronousSocketChannel.open(group); client.connect(remote).get(); peer = ssc.accept(); ssc.close(); @@ -77,11 +81,21 @@ public class Leaky { } public static void main(String[] args) throws Exception { + ThreadFactory threadFactory = new ThreadFactory() { + @Override + public Thread newThread(Runnable r) { + Thread t = new Thread(r); + t.setDaemon(true); + return t; + } + }; + AsynchronousChannelGroup group = + AsynchronousChannelGroup.withFixedThreadPool(4, threadFactory); final int CONNECTION_COUNT = 10; Connection[] connections = new Connection[CONNECTION_COUNT]; for (int i=0; i pools = + ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class); + for (BufferPoolMXBean pool: pools) + System.out.format(" %8s ", pool.getName()); + System.out.println(); + for (int i=0; i newSize) { - if (c.position() != newSize) - throw new RuntimeException("Position greater than size"); - } else { - if (c.position() != position) - throw new RuntimeException("Truncate changed position"); + if (position > newSize) { + if (fc.position() != newSize) + throw new RuntimeException("Position greater than size"); + } else { + if (fc.position() != position) + throw new RuntimeException("Truncate changed position"); + }; + } + } + } + + /** + * Test behavior of truncate method when file is opened for append + */ + static void appendTest(File blah) throws Exception { + for (int i=0; i<10; i++) { + long testSize = generator.nextInt(1000) + 10; + initTestFile(blah, testSize); + FileChannel fc = (i < 5) ? + new FileOutputStream(blah, true).getChannel() : + FileChannel.open(blah.toPath(), APPEND); + try (fc) { + // truncate file + long newSize = generator.nextInt((int)testSize); + fc.truncate(newSize); + if (fc.size() != newSize) + throw new RuntimeException("Truncate failed"); + + // write one byte + ByteBuffer buf = ByteBuffer.allocate(1); + buf.put((byte)'x'); + buf.flip(); + fc.write(buf); + if (fc.size() != (newSize+1)) + throw new RuntimeException("Unexpected size"); } - - c.close(); - fis.close(); } - blah.delete(); } /** diff --git a/jdk/test/java/nio/channels/FileChannel/TryLock.java b/jdk/test/java/nio/channels/FileChannel/TryLock.java index cadf723177e..8b40f11bfa1 100644 --- a/jdk/test/java/nio/channels/FileChannel/TryLock.java +++ b/jdk/test/java/nio/channels/FileChannel/TryLock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/FileChannel/Write.java b/jdk/test/java/nio/channels/FileChannel/Write.java index 4484447695c..a52defed70b 100644 --- a/jdk/test/java/nio/channels/FileChannel/Write.java +++ b/jdk/test/java/nio/channels/FileChannel/Write.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Pipe/NonBlocking.java b/jdk/test/java/nio/channels/Pipe/NonBlocking.java index 6a052e795c4..2332f040383 100644 --- a/jdk/test/java/nio/channels/Pipe/NonBlocking.java +++ b/jdk/test/java/nio/channels/Pipe/NonBlocking.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Pipe/SelectPipe.java b/jdk/test/java/nio/channels/Pipe/SelectPipe.java index 1a942a69a40..85938eb1789 100644 --- a/jdk/test/java/nio/channels/Pipe/SelectPipe.java +++ b/jdk/test/java/nio/channels/Pipe/SelectPipe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SelectionKey/AtomicAttachTest.java b/jdk/test/java/nio/channels/SelectionKey/AtomicAttachTest.java index 1298f663df9..278bd8c1588 100644 --- a/jdk/test/java/nio/channels/SelectionKey/AtomicAttachTest.java +++ b/jdk/test/java/nio/channels/SelectionKey/AtomicAttachTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/BasicAccept.java b/jdk/test/java/nio/channels/Selector/BasicAccept.java index 882fb34b8c9..f0780315181 100644 --- a/jdk/test/java/nio/channels/Selector/BasicAccept.java +++ b/jdk/test/java/nio/channels/Selector/BasicAccept.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/BasicConnect.java b/jdk/test/java/nio/channels/Selector/BasicConnect.java index 5a282661be4..61575b1531b 100644 --- a/jdk/test/java/nio/channels/Selector/BasicConnect.java +++ b/jdk/test/java/nio/channels/Selector/BasicConnect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/ByteServer.java b/jdk/test/java/nio/channels/Selector/ByteServer.java index 53ab51f0ae7..eefd1fb17a5 100644 --- a/jdk/test/java/nio/channels/Selector/ByteServer.java +++ b/jdk/test/java/nio/channels/Selector/ByteServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/CheckLocking.java b/jdk/test/java/nio/channels/Selector/CheckLocking.java index 9a937aca5bc..825b8af2c5d 100644 --- a/jdk/test/java/nio/channels/Selector/CheckLocking.java +++ b/jdk/test/java/nio/channels/Selector/CheckLocking.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/CloseInvalidatesKeys.java b/jdk/test/java/nio/channels/Selector/CloseInvalidatesKeys.java index d339d54c0b9..3e192924640 100644 --- a/jdk/test/java/nio/channels/Selector/CloseInvalidatesKeys.java +++ b/jdk/test/java/nio/channels/Selector/CloseInvalidatesKeys.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/CloseThenRegister.java b/jdk/test/java/nio/channels/Selector/CloseThenRegister.java index 99192ea0cc1..d16533984a0 100644 --- a/jdk/test/java/nio/channels/Selector/CloseThenRegister.java +++ b/jdk/test/java/nio/channels/Selector/CloseThenRegister.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/CloseWhenKeyIdle.java b/jdk/test/java/nio/channels/Selector/CloseWhenKeyIdle.java index b206b5d360c..96af390e0d6 100644 --- a/jdk/test/java/nio/channels/Selector/CloseWhenKeyIdle.java +++ b/jdk/test/java/nio/channels/Selector/CloseWhenKeyIdle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/Connect.java b/jdk/test/java/nio/channels/Selector/Connect.java index 773e0f9cd1e..af1ce984e14 100644 --- a/jdk/test/java/nio/channels/Selector/Connect.java +++ b/jdk/test/java/nio/channels/Selector/Connect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/ConnectWrite.java b/jdk/test/java/nio/channels/Selector/ConnectWrite.java index 1d51b43ea34..904f3a64afd 100644 --- a/jdk/test/java/nio/channels/Selector/ConnectWrite.java +++ b/jdk/test/java/nio/channels/Selector/ConnectWrite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/HelperSlowToDie.java b/jdk/test/java/nio/channels/Selector/HelperSlowToDie.java index 221722abf8b..729aefaa05c 100644 --- a/jdk/test/java/nio/channels/Selector/HelperSlowToDie.java +++ b/jdk/test/java/nio/channels/Selector/HelperSlowToDie.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/KeysReady.java b/jdk/test/java/nio/channels/Selector/KeysReady.java index 4fa9ea6d935..ba09a4c6ef1 100644 --- a/jdk/test/java/nio/channels/Selector/KeysReady.java +++ b/jdk/test/java/nio/channels/Selector/KeysReady.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/LotsOfChannels.java b/jdk/test/java/nio/channels/Selector/LotsOfChannels.java index 0ffef3a8f84..d88655d807f 100644 --- a/jdk/test/java/nio/channels/Selector/LotsOfChannels.java +++ b/jdk/test/java/nio/channels/Selector/LotsOfChannels.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/OpRead.java b/jdk/test/java/nio/channels/Selector/OpRead.java index b77feafeea3..78340509ed6 100644 --- a/jdk/test/java/nio/channels/Selector/OpRead.java +++ b/jdk/test/java/nio/channels/Selector/OpRead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/ReadAfterConnect.java b/jdk/test/java/nio/channels/Selector/ReadAfterConnect.java index 136778f4ac4..e5d0b091b82 100644 --- a/jdk/test/java/nio/channels/Selector/ReadAfterConnect.java +++ b/jdk/test/java/nio/channels/Selector/ReadAfterConnect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/RegAfterPreClose.java b/jdk/test/java/nio/channels/Selector/RegAfterPreClose.java index e2128cf46e2..d7903c33040 100644 --- a/jdk/test/java/nio/channels/Selector/RegAfterPreClose.java +++ b/jdk/test/java/nio/channels/Selector/RegAfterPreClose.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/SelectAfterRead.java b/jdk/test/java/nio/channels/Selector/SelectAfterRead.java index d4b2bf1eaf7..fccd9ddb56e 100644 --- a/jdk/test/java/nio/channels/Selector/SelectAfterRead.java +++ b/jdk/test/java/nio/channels/Selector/SelectAfterRead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/SelectAndCancel.java b/jdk/test/java/nio/channels/Selector/SelectAndCancel.java index 2d717a08099..dc28480a76c 100644 --- a/jdk/test/java/nio/channels/Selector/SelectAndCancel.java +++ b/jdk/test/java/nio/channels/Selector/SelectAndCancel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/SelectWrite.java b/jdk/test/java/nio/channels/Selector/SelectWrite.java index 8f18c7e0a74..3c2d3d8870e 100644 --- a/jdk/test/java/nio/channels/Selector/SelectWrite.java +++ b/jdk/test/java/nio/channels/Selector/SelectWrite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/SelectorLimit.java b/jdk/test/java/nio/channels/Selector/SelectorLimit.java index 2c5594a2d5d..27589e24665 100644 --- a/jdk/test/java/nio/channels/Selector/SelectorLimit.java +++ b/jdk/test/java/nio/channels/Selector/SelectorLimit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/SelectorTest.java b/jdk/test/java/nio/channels/Selector/SelectorTest.java index cee50d56200..8e835d88e2b 100644 --- a/jdk/test/java/nio/channels/Selector/SelectorTest.java +++ b/jdk/test/java/nio/channels/Selector/SelectorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/TemporarySelector.java b/jdk/test/java/nio/channels/Selector/TemporarySelector.java new file mode 100644 index 00000000000..c131c327fa7 --- /dev/null +++ b/jdk/test/java/nio/channels/Selector/TemporarySelector.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 6645197 + * @run main/othervm -Xmx5m TemporarySelector + * @summary Timed read with socket adaptor throws ClosedSelectorException if temporary selector GC'ed. + */ +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; + +public class TemporarySelector { + + static volatile boolean done = false; + + public static void main(String[] args) throws Exception { + + Runnable r = new Runnable() { + public void run() { + while (!done) { + System.gc(); + try { + Thread.sleep(1000); + } catch (Exception e) { + } + } + } + }; + + try { + // Create a server socket that will open and accept on loopback connection + ServerSocketChannel ssc = ServerSocketChannel.open(); + final ServerSocket ss = ssc.socket(); + ss.bind(new InetSocketAddress(0)); + int localPort = ss.getLocalPort(); + + // Create a client socket that will connect and read + System.out.println("Connecting to server socket"); + System.out.flush(); + SocketChannel channel = SocketChannel.open(new InetSocketAddress("localhost", localPort)); + System.out.println("Connected to server socket"); + System.out.flush(); + + // Create a thread to try and cause the GC to run + Thread t = new Thread(r); + t.start(); + byte[] buffer = new byte[500]; + System.out.println("Reading from socket input stream"); + System.out.flush(); + Socket socket = channel.socket(); + socket.setSoTimeout(10000); // The timeout must be set + // to trigger this bug + try { + socket.getInputStream().read(buffer); + } catch (java.net.SocketTimeoutException ste) { + // no java.nio.channels.ClosedSelectorException + } + } finally { + done = true; + } + } +} diff --git a/jdk/test/java/nio/channels/Selector/WakeupNow.java b/jdk/test/java/nio/channels/Selector/WakeupNow.java index 7934e9a8532..23dc0c30907 100644 --- a/jdk/test/java/nio/channels/Selector/WakeupNow.java +++ b/jdk/test/java/nio/channels/Selector/WakeupNow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/WakeupOverflow.java b/jdk/test/java/nio/channels/Selector/WakeupOverflow.java index dc1c5fc4abe..d912bd222af 100644 --- a/jdk/test/java/nio/channels/Selector/WakeupOverflow.java +++ b/jdk/test/java/nio/channels/Selector/WakeupOverflow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/WakeupSpeed.java b/jdk/test/java/nio/channels/Selector/WakeupSpeed.java index e9ce071f04d..48daa87ca1f 100644 --- a/jdk/test/java/nio/channels/Selector/WakeupSpeed.java +++ b/jdk/test/java/nio/channels/Selector/WakeupSpeed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Selector/lots_of_updates.sh b/jdk/test/java/nio/channels/Selector/lots_of_updates.sh index cf94eacdfcd..021d5a418c6 100644 --- a/jdk/test/java/nio/channels/Selector/lots_of_updates.sh +++ b/jdk/test/java/nio/channels/Selector/lots_of_updates.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/ServerSocketChannel/SocketOptionTests.java b/jdk/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java index d5ad22687d1..77697248ca6 100644 --- a/jdk/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java +++ b/jdk/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/AdaptSocket.java b/jdk/test/java/nio/channels/SocketChannel/AdaptSocket.java index 875fc268ee0..80018cd658b 100644 --- a/jdk/test/java/nio/channels/SocketChannel/AdaptSocket.java +++ b/jdk/test/java/nio/channels/SocketChannel/AdaptSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/BigReadWrite.java b/jdk/test/java/nio/channels/SocketChannel/BigReadWrite.java index bd2ed2931c2..9bd1df457fa 100644 --- a/jdk/test/java/nio/channels/SocketChannel/BigReadWrite.java +++ b/jdk/test/java/nio/channels/SocketChannel/BigReadWrite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/Bind.java b/jdk/test/java/nio/channels/SocketChannel/Bind.java index cfa99aa882b..daa8f8ae3f5 100644 --- a/jdk/test/java/nio/channels/SocketChannel/Bind.java +++ b/jdk/test/java/nio/channels/SocketChannel/Bind.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/Close.java b/jdk/test/java/nio/channels/SocketChannel/Close.java index 7a677f0877c..8b5c6c22086 100644 --- a/jdk/test/java/nio/channels/SocketChannel/Close.java +++ b/jdk/test/java/nio/channels/SocketChannel/Close.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/CloseRegisteredChannel.java b/jdk/test/java/nio/channels/SocketChannel/CloseRegisteredChannel.java index 92836a8b2d7..216d6be160b 100644 --- a/jdk/test/java/nio/channels/SocketChannel/CloseRegisteredChannel.java +++ b/jdk/test/java/nio/channels/SocketChannel/CloseRegisteredChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/CloseTimeoutChannel.java b/jdk/test/java/nio/channels/SocketChannel/CloseTimeoutChannel.java index 67e33509091..a09c4bef452 100644 --- a/jdk/test/java/nio/channels/SocketChannel/CloseTimeoutChannel.java +++ b/jdk/test/java/nio/channels/SocketChannel/CloseTimeoutChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/IsConnectable.java b/jdk/test/java/nio/channels/SocketChannel/IsConnectable.java index 4bc22a19020..d646d194aa2 100644 --- a/jdk/test/java/nio/channels/SocketChannel/IsConnectable.java +++ b/jdk/test/java/nio/channels/SocketChannel/IsConnectable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/LocalAddress.java b/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java index 9561e975266..1bcd0a189d9 100644 --- a/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java +++ b/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/OpenLeak.java b/jdk/test/java/nio/channels/SocketChannel/OpenLeak.java index ab5dfde6922..135ce9a3901 100644 --- a/jdk/test/java/nio/channels/SocketChannel/OpenLeak.java +++ b/jdk/test/java/nio/channels/SocketChannel/OpenLeak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/SocketInheritance.java b/jdk/test/java/nio/channels/SocketChannel/SocketInheritance.java index 387a06280dc..1df065d2724 100644 --- a/jdk/test/java/nio/channels/SocketChannel/SocketInheritance.java +++ b/jdk/test/java/nio/channels/SocketChannel/SocketInheritance.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/SocketOptionTests.java b/jdk/test/java/nio/channels/SocketChannel/SocketOptionTests.java index 9fe1abddef4..660b522d189 100644 --- a/jdk/test/java/nio/channels/SocketChannel/SocketOptionTests.java +++ b/jdk/test/java/nio/channels/SocketChannel/SocketOptionTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/Trivial.java b/jdk/test/java/nio/channels/SocketChannel/Trivial.java index afe7bfa1092..0e73229eb65 100644 --- a/jdk/test/java/nio/channels/SocketChannel/Trivial.java +++ b/jdk/test/java/nio/channels/SocketChannel/Trivial.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/UnboundSocketTests.java b/jdk/test/java/nio/channels/SocketChannel/UnboundSocketTests.java index b51e714053a..30f20591cf2 100644 --- a/jdk/test/java/nio/channels/SocketChannel/UnboundSocketTests.java +++ b/jdk/test/java/nio/channels/SocketChannel/UnboundSocketTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/VectorIO.java b/jdk/test/java/nio/channels/SocketChannel/VectorIO.java index 58215c024bb..84c5a7f59e8 100644 --- a/jdk/test/java/nio/channels/SocketChannel/VectorIO.java +++ b/jdk/test/java/nio/channels/SocketChannel/VectorIO.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SocketChannel/Write.java b/jdk/test/java/nio/channels/SocketChannel/Write.java index faa62897be4..95a1f185de7 100644 --- a/jdk/test/java/nio/channels/SocketChannel/Write.java +++ b/jdk/test/java/nio/channels/SocketChannel/Write.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/etc/Shadow.java b/jdk/test/java/nio/channels/etc/Shadow.java index fbdbd0e861d..fe75d9953dc 100644 --- a/jdk/test/java/nio/channels/etc/Shadow.java +++ b/jdk/test/java/nio/channels/etc/Shadow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/spi/AsynchronousChannelProvider/Provider1.java b/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/Provider1.java index 9aefc9ef53e..e531e90368e 100644 --- a/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/Provider1.java +++ b/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/Provider1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ import java.nio.channels.spi.AsynchronousChannelProvider; import java.nio.channels.*; -import java.net.ProtocolFamily; import java.util.concurrent.ExecutorService; import java.util.concurrent.ThreadFactory; import java.io.IOException; @@ -59,11 +58,4 @@ public class Provider1 extends AsynchronousChannelProvider { { throw new RuntimeException(); } - - @Override - public AsynchronousDatagramChannel openAsynchronousDatagramChannel - (ProtocolFamily family, AsynchronousChannelGroup group) throws IOException - { - throw new RuntimeException(); - } } diff --git a/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/Provider2.java b/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/Provider2.java index 9dccf21cc74..bb587adf8b2 100644 --- a/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/Provider2.java +++ b/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/Provider2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ import java.nio.channels.spi.AsynchronousChannelProvider; import java.nio.channels.*; -import java.net.ProtocolFamily; import java.util.concurrent.ExecutorService; import java.util.concurrent.ThreadFactory; import java.io.IOException; @@ -59,11 +58,4 @@ public class Provider2 extends AsynchronousChannelProvider { { throw new RuntimeException(); } - - @Override - public AsynchronousDatagramChannel openAsynchronousDatagramChannel - (ProtocolFamily family, AsynchronousChannelGroup group) throws IOException - { - throw new RuntimeException(); - } } diff --git a/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh b/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh index b8e1127de1c..c334192a231 100644 --- a/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh +++ b/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/spi/SelectorProvider/inheritedChannel/ClosedStreams.java b/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/ClosedStreams.java index a469e194810..529a2085f8d 100644 --- a/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/ClosedStreams.java +++ b/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/ClosedStreams.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/spi/SelectorProvider/inheritedChannel/EchoTest.java b/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java index 16298b8479d..c47f1510644 100644 --- a/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java +++ b/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/DirectoryStream/Basic.java b/jdk/test/java/nio/file/DirectoryStream/Basic.java index f5aef3630ea..75d66280147 100644 --- a/jdk/test/java/nio/file/DirectoryStream/Basic.java +++ b/jdk/test/java/nio/file/DirectoryStream/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/DirectoryStream/SecureDS.java b/jdk/test/java/nio/file/DirectoryStream/SecureDS.java index 173d770602d..e776c8b31ad 100644 --- a/jdk/test/java/nio/file/DirectoryStream/SecureDS.java +++ b/jdk/test/java/nio/file/DirectoryStream/SecureDS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/FileStore/Basic.java b/jdk/test/java/nio/file/FileStore/Basic.java index 9c4a9dbb00b..0b43109d3a0 100644 --- a/jdk/test/java/nio/file/FileStore/Basic.java +++ b/jdk/test/java/nio/file/FileStore/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/Files/Misc.java b/jdk/test/java/nio/file/Files/Misc.java index 89e7c251a8d..621b95981ff 100644 --- a/jdk/test/java/nio/file/Files/Misc.java +++ b/jdk/test/java/nio/file/Files/Misc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/Files/PrintFileTree.java b/jdk/test/java/nio/file/Files/PrintFileTree.java index fdc17cdef3a..41ddb95a317 100644 --- a/jdk/test/java/nio/file/Files/PrintFileTree.java +++ b/jdk/test/java/nio/file/Files/PrintFileTree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/Files/SkipSiblings.java b/jdk/test/java/nio/file/Files/SkipSiblings.java index 5cd7e34ac90..36231987280 100644 --- a/jdk/test/java/nio/file/Files/SkipSiblings.java +++ b/jdk/test/java/nio/file/Files/SkipSiblings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/Files/TerminateWalk.java b/jdk/test/java/nio/file/Files/TerminateWalk.java index b2858c450ac..d72c8816f72 100644 --- a/jdk/test/java/nio/file/Files/TerminateWalk.java +++ b/jdk/test/java/nio/file/Files/TerminateWalk.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/Files/WalkWithSecurity.java b/jdk/test/java/nio/file/Files/WalkWithSecurity.java index 9044398b6ab..2a1f67f492e 100644 --- a/jdk/test/java/nio/file/Files/WalkWithSecurity.java +++ b/jdk/test/java/nio/file/Files/WalkWithSecurity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/Files/walk_file_tree.sh b/jdk/test/java/nio/file/Files/walk_file_tree.sh index 4f41d3cc036..da3ad3bb593 100644 --- a/jdk/test/java/nio/file/Files/walk_file_tree.sh +++ b/jdk/test/java/nio/file/Files/walk_file_tree.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/file/Path/CheckPermissions.java b/jdk/test/java/nio/file/Path/CheckPermissions.java index de7a2ef7fd6..9996ac7490f 100644 --- a/jdk/test/java/nio/file/Path/CheckPermissions.java +++ b/jdk/test/java/nio/file/Path/CheckPermissions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/Path/CopyAndMove.java b/jdk/test/java/nio/file/Path/CopyAndMove.java index 69ed9f93d30..17e3cab38e0 100644 --- a/jdk/test/java/nio/file/Path/CopyAndMove.java +++ b/jdk/test/java/nio/file/Path/CopyAndMove.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/Path/InterruptCopy.java b/jdk/test/java/nio/file/Path/InterruptCopy.java index c03ebb312d8..11be5a2e198 100644 --- a/jdk/test/java/nio/file/Path/InterruptCopy.java +++ b/jdk/test/java/nio/file/Path/InterruptCopy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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 4313887 + * @bug 4313887 6993267 * @summary Unit test for Sun-specific ExtendedCopyOption.INTERRUPTIBLE option * @library .. * @run main/othervm -XX:-UseVMInterruptibleIO InterruptCopy @@ -36,8 +36,9 @@ import com.sun.nio.file.ExtendedCopyOption; public class InterruptCopy { - private static final long FILE_SIZE_TO_COPY = 512 * 1024 * 1024; + private static final long FILE_SIZE_TO_COPY = 512L * 1024L * 1024L; private static final int DELAY_IN_MS = 500; + private static final int DURATION_MAX_IN_MS = 5000; public static void main(String[] args) throws Exception { Path dir = TestUtil.createTemporaryDirectory(); @@ -81,20 +82,27 @@ public class InterruptCopy { try { // copy source to target in main thread, interrupting it after a delay final Thread me = Thread.currentThread(); - pool.schedule(new Runnable() { + Future wakeup = pool.schedule(new Runnable() { public void run() { me.interrupt(); }}, DELAY_IN_MS, TimeUnit.MILLISECONDS); System.out.println("Copying file..."); try { + long start = System.currentTimeMillis(); source.copyTo(target, ExtendedCopyOption.INTERRUPTIBLE); - throw new RuntimeException("Copy completed (this is not expected)"); + long duration = System.currentTimeMillis() - start; + if (duration > DURATION_MAX_IN_MS) + throw new RuntimeException("Copy was not interrupted"); } catch (IOException e) { boolean interrupted = Thread.interrupted(); if (!interrupted) throw new RuntimeException("Interrupt status was not set"); System.out.println("Copy failed (this is expected)"); } + try { + wakeup.get(); + } catch (InterruptedException ignore) { } + Thread.interrupted(); // copy source to target via task in thread pool, interrupting it after // a delay using cancel(true) @@ -113,7 +121,6 @@ public class InterruptCopy { System.out.println("Copy cancelled."); } finally { pool.shutdown(); - pool.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS); } } } diff --git a/jdk/test/java/nio/file/Path/Misc.java b/jdk/test/java/nio/file/Path/Misc.java index 3b24c786261..dba06f1dd06 100644 --- a/jdk/test/java/nio/file/Path/Misc.java +++ b/jdk/test/java/nio/file/Path/Misc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/Path/PathOps.java b/jdk/test/java/nio/file/Path/PathOps.java index 37f31a25ab2..fcc02e61a44 100644 --- a/jdk/test/java/nio/file/Path/PathOps.java +++ b/jdk/test/java/nio/file/Path/PathOps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/file/Path/delete_on_close.sh b/jdk/test/java/nio/file/Path/delete_on_close.sh index 39a2308caad..1f3fb67ea58 100644 --- a/jdk/test/java/nio/file/Path/delete_on_close.sh +++ b/jdk/test/java/nio/file/Path/delete_on_close.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/file/TestUtil.java b/jdk/test/java/nio/file/TestUtil.java index c6acccd1ea0..b0fdd2a1f9d 100644 --- a/jdk/test/java/nio/file/TestUtil.java +++ b/jdk/test/java/nio/file/TestUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/CodeSigner/Serialize.java b/jdk/test/java/security/CodeSigner/Serialize.java new file mode 100644 index 00000000000..9a1f9fca97e --- /dev/null +++ b/jdk/test/java/security/CodeSigner/Serialize.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6799854 + * @summary CodeSigner.hashCode() does not work with serialization + */ + +import java.io.*; +import java.security.CodeSigner; +import java.security.Timestamp; +import java.security.cert.*; +import java.util.Collections; +import java.util.Date; + +public class Serialize { + + public static void main(String[] args) throws Exception { + + // Create a certpath consisting of one certificate + File f = new File(System.getProperty("test.src", "."), "cert_file"); + FileInputStream fis = new FileInputStream(f); + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + Certificate c = cf.generateCertificate(fis); + fis.close(); + CertPath cp = cf.generateCertPath(Collections.singletonList(c)); + + // Create a code signer + CodeSigner cs = new CodeSigner(cp, new Timestamp(new Date(), cp)); + + // Serialize the code signer + ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); + ObjectOutputStream out = new ObjectOutputStream(byteOut); + out.writeObject(cs); + out.close(); + + // Deserialize the code signer + byte[] data = byteOut.toByteArray(); + CodeSigner cs2 = (CodeSigner) new ObjectInputStream( + new ByteArrayInputStream(data)).readObject(); + + // Test for equality + if (!cs.equals(cs2) || cs.hashCode() != cs2.hashCode()) { + throw new Exception("CodeSigner serialization test FAILED"); + } + } +} diff --git a/jdk/test/java/security/CodeSigner/cert_file b/jdk/test/java/security/CodeSigner/cert_file new file mode 100644 index 00000000000..42af97b3762 Binary files /dev/null and b/jdk/test/java/security/CodeSigner/cert_file differ diff --git a/jdk/test/java/security/Provider/Turkish.java b/jdk/test/java/security/Provider/Turkish.java index f824a877bbf..071c58f224b 100644 --- a/jdk/test/java/security/Provider/Turkish.java +++ b/jdk/test/java/security/Provider/Turkish.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh b/jdk/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh index 717857c9cbc..ab6d609da92 100644 --- a/jdk/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh +++ b/jdk/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # 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,11 +68,10 @@ case "$OS" in ;; esac -# remove old class files cd ${TESTCLASSES}${FILESEP} -rm -f ClassLoaderDeadlock.class -rm -rf provider -mkdir provider +if [ ! -d provider ] ; then + mkdir provider +fi # compile the test program ${TESTJAVA}${FILESEP}bin${FILESEP}javac \ @@ -88,4 +87,11 @@ ${TESTJAVA}${FILESEP}bin${FILESEP}java \ -classpath "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}Deadlock.jar" \ ClassLoaderDeadlock -exit $? +STATUS=$? + +# clean up +rm -f 'ClassLoaderDeadlock.class' 'ClassLoaderDeadlock$1.class' \ +'ClassLoaderDeadlock$DelayClassLoader.class' \ +provider${FILESEP}HashProvider.class + +exit $STATUS diff --git a/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh b/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh index 2ed6da135cf..f084942af21 100644 --- a/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh +++ b/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh @@ -26,7 +26,6 @@ # @test # @bug 6440846 -# @ignore until 6203816 is dealt with. # @summary make sure we do not deadlock between ExtClassLoader and AppClassLoader # @author Valerie Peng # @run shell/timeout=20 Deadlock2.sh @@ -71,11 +70,14 @@ esac # remove old class files cd ${TESTCLASSES} -rm -f Deadlock2*.class if [ -d testlib ] ; then rm -rf testlib fi -cp -r ${TESTJAVA}${FILESEP}lib${FILESEP}ext testlib +if [ -d ${TESTJAVA}${FILESEP}lib${FILESEP}ext ] ; then + cp -r ${TESTJAVA}${FILESEP}lib${FILESEP}ext testlib +else + cp -r ${TESTJAVA}${FILESEP}jre${FILESEP}lib${FILESEP}ext testlib +fi # compile and package the test program ${TESTJAVA}${FILESEP}bin${FILESEP}javac \ diff --git a/jdk/test/java/security/cert/CertPathValidator/nameConstraintsRFC822/ValidateCertPath.java b/jdk/test/java/security/cert/CertPathValidator/nameConstraintsRFC822/ValidateCertPath.java index afa62e6e526..fad92e826ab 100644 --- a/jdk/test/java/security/cert/CertPathValidator/nameConstraintsRFC822/ValidateCertPath.java +++ b/jdk/test/java/security/cert/CertPathValidator/nameConstraintsRFC822/ValidateCertPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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 4684810 + * @bug 4684810 6994717 * @summary Verify that RFC822 name constraints are checked correctly */ @@ -38,6 +38,7 @@ import java.security.cert.PKIXReason; import java.util.ArrayList; import java.util.Collections; +import java.util.Date; import java.util.List; import java.util.Set; @@ -100,6 +101,9 @@ public final class ValidateCertPath { Set anchors = Collections.singleton(anchor); params = new PKIXParameters(anchors); params.setRevocationEnabled(false); + // The certificates expired on 10/22/10, so set the validity date to + // 05/01/2009 to avoid expiration failures + params.setDate(new Date(1243828800000l)); } /* diff --git a/jdk/test/java/text/Bidi/Bug7002398.java b/jdk/test/java/text/Bidi/Bug7002398.java new file mode 100644 index 00000000000..5b8d638dc0e --- /dev/null +++ b/jdk/test/java/text/Bidi/Bug7002398.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7002398 + * @summary Verify that Corrigendum #8 for Unicode 6.0.0 has been applied. + */ +import java.text.*; + +public class Bug7002398 { + + private static final int[] directions = { + Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT, + Bidi.DIRECTION_DEFAULT_RIGHT_TO_LEFT, + Bidi.DIRECTION_LEFT_TO_RIGHT, + Bidi.DIRECTION_RIGHT_TO_LEFT + }; + + /* + * Old Bidi class: AL AN AL AN AL + * New Bidi class: AL + */ + private static final String str = "\u0627\u0660\u0710\u070F\u070D"; + private static final int[] expectedLevels = {1, 2, 1, 1, 1}; + + public static void main(String[] args) { + boolean err = false; + + for (int dir = 0; dir < directions.length; dir ++) { + Bidi bidi = new Bidi(str, directions[dir]); + for (int index = 0; index < str.length(); index ++) { + int gotLevel = bidi.getLevelAt(index); + if (gotLevel != expectedLevels[index]) { + err = true; + System.err.println("Unexpected level for the character 0x" + + Integer.toHexString(str.charAt(index)).toUpperCase() + + ": Expected level = " + expectedLevels[index] + + ", actual level = " + bidi.getLevelAt(index) + + " in direction = " + directions[dir] + "."); + } + } + } + + if (err) { + throw new RuntimeException("Failed."); + } + } + +} diff --git a/jdk/test/java/text/Collator/Bug6970930.java b/jdk/test/java/text/Collator/Bug6970930.java new file mode 100644 index 00000000000..f20cd831a9b --- /dev/null +++ b/jdk/test/java/text/Collator/Bug6970930.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6970930 + * @summary verify that compare() throws NPE instead of IAE when an argument is null. + */ +import java.text.*; + +public class Bug6970930 { + + private static boolean err = false; + + public static void main(String[] args) { + // Check if compare() throws NPE. + test1(null, null); + test1("\"foo\"", null); + test1(null, "\"bar\""); + + if (err) { + throw new RuntimeException("Failed."); + } else { + System.out.println("Passed."); + } + } + + private static void test1(String s1, String s2) { + RuleBasedCollator col = null; + + try { + col = new RuleBasedCollator("< a < b"); + } + catch (ParseException e) { + err = true; + System.err.println(e); + } + + try { + col.compare("foo", "bar"); // This line is necessary to reproduce the bug. + col.compare(s1, s2); + + err = true; + System.err.println("No exception was thrown for compare(" + + s1 + ", " + s2 + ")."); + } + catch (NullPointerException e) { + System.out.println("NPE was thrown as expected for compare(" + + s1 + ", " + s2 + ")."); + } + catch (Exception e) { + err = true; + System.err.println("Unexpected exception was thrown for compare(" + + s1 + ", " + s2 + "): " + e); + } + } + +} diff --git a/jdk/test/java/text/Format/DateFormat/Bug4396385.java b/jdk/test/java/text/Format/DateFormat/Bug4396385.java new file mode 100644 index 00000000000..c0263257db5 --- /dev/null +++ b/jdk/test/java/text/Format/DateFormat/Bug4396385.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4396385 + * @summary Make sure to detect invalid values for 1-based hour formats. + */ + +import java.text.*; +import java.util.*; + +public class Bug4396385 { + private static int errorCount = 0; + private static String[][] data = { + { "hh:mma", "-1:30AM" }, + { "hh:mma", "00:30AM" }, + { "hh:mma", "13:30AM" }, + { "kk:mm", "-1:12" }, + { "kk:mm", "00:12" }, + { "kk:mm", "25:12" }, + }; + + public static void main(String[] args) { + TimeZone tz = TimeZone.getDefault(); + // Use "GMT" to avoid any surprises related to offset + // transitions. + TimeZone.setDefault(TimeZone.getTimeZone("GMT")); + + try { + for (String[] item : data) { + test(item[0], item[1]); + } + } finally { + // Restore the default time zone + TimeZone.setDefault(tz); + } + + if (errorCount > 0) { + throw new RuntimeException("Failed with " + errorCount + " error(s)."); + } + } + + private static void test(String pattern, String src) { + SimpleDateFormat sdf = new SimpleDateFormat(pattern, Locale.US); + sdf.setLenient(false); + ParsePosition pos = new ParsePosition(0); + System.out.printf("parse: \"%s\" with \"%s\"", src, pattern); + Date date = sdf.parse(src, pos); + System.out.printf(": date = %s, errorIndex = %d", date, pos.getErrorIndex()); + if (date != null || pos.getErrorIndex() == -1) { + System.out.println(": failed"); + errorCount++; + } else { + System.out.println(": passed"); + } + } +} diff --git a/jdk/test/java/text/Format/DateFormat/ISO8601ZoneTest.java b/jdk/test/java/text/Format/DateFormat/ISO8601ZoneTest.java index 2179948a849..2a5c2412585 100644 --- a/jdk/test/java/text/Format/DateFormat/ISO8601ZoneTest.java +++ b/jdk/test/java/text/Format/DateFormat/ISO8601ZoneTest.java @@ -60,48 +60,51 @@ public class ISO8601ZoneTest { "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", }; + // badData[][0] - format + // badData[][1] - (bad) text to be parsed + // badData[][2] - subtext at the end of which a parse error is detected static final String[][] badData = { - { "X", "1" }, - { "X", "+1" }, - { "X", "-2" }, - { "X", "-24" }, - { "X", "+24" }, + { "X", "1", "1" }, + { "X", "+1", "+1" }, + { "X", "-2", "-2" }, + { "X", "-24", "-2" }, + { "X", "+24", "+2" }, - { "XX", "9" }, - { "XX", "23" }, - { "XX", "234" }, - { "XX", "3456" }, - { "XX", "23456" }, - { "XX", "+1" }, - { "XX", "-12" }, - { "XX", "+123" }, - { "XX", "-12:34" }, - { "XX", "+12:34" }, - { "XX", "-2423" }, - { "XX", "+2423" }, - { "XX", "-1260" }, - { "XX", "+1260" }, + { "XX", "9", "9" }, + { "XX", "23", "2" }, + { "XX", "234", "2" }, + { "XX", "3456", "3" }, + { "XX", "23456", "2" }, + { "XX", "+1", "+1" }, + { "XX", "-12", "-12" }, + { "XX", "+123", "+123" }, + { "XX", "-12:34", "-12" }, + { "XX", "+12:34", "+12" }, + { "XX", "-2423", "-2" }, + { "XX", "+2423", "+2" }, + { "XX", "-1260", "-126" }, + { "XX", "+1260", "+126" }, - { "XXX", "9" }, - { "XXX", "23" }, - { "XXX", "234" }, - { "XXX", "3456" }, - { "XXX", "23456" }, - { "XXX", "2:34" }, - { "XXX", "12:4" }, - { "XXX", "12:34" }, - { "XXX", "-1" }, - { "XXX", "+1" }, - { "XXX", "-12" }, - { "XXX", "+12" }, - { "XXX", "-123" }, - { "XXX", "+123" }, - { "XXX", "-1234" }, - { "XXX", "+1234" }, - { "XXX", "+24:23" }, - { "XXX", "+12:60" }, - { "XXX", "+1:23" }, - { "XXX", "+12:3" }, + { "XXX", "9", "9" }, + { "XXX", "23", "2" }, + { "XXX", "234", "2" }, + { "XXX", "3456", "3" }, + { "XXX", "23456", "2" }, + { "XXX", "2:34", "2" }, + { "XXX", "12:4", "1" }, + { "XXX", "12:34", "1" }, + { "XXX", "-1", "-1" }, + { "XXX", "+1", "+1" }, + { "XXX", "-12", "-12" }, + { "XXX", "+12", "+12" }, + { "XXX", "-123", "-12" }, + { "XXX", "+123", "+12" }, + { "XXX", "-1234", "-12" }, + { "XXX", "+1234", "+12" }, + { "XXX", "+24:23", "+2" }, + { "XXX", "+12:60", "+12:6" }, + { "XXX", "+1:23", "+1" }, + { "XXX", "+12:3", "+12:3" }, }; static String[] badFormats = { @@ -110,6 +113,8 @@ public class ISO8601ZoneTest { public static void main(String[] args) throws Exception { TimeZone tz = TimeZone.getDefault(); + Locale loc = Locale.getDefault(); + Locale.setDefault(Locale.US); try { for (int i = 0; i < formatData.length; i++) { @@ -128,7 +133,7 @@ public class ISO8601ZoneTest { } for (String[] d : badData) { - badDataParsing(d[0], d[1]); + badDataParsing(d[0], d[1], d[2].length()); } for (String fmt : badFormats) { @@ -136,6 +141,7 @@ public class ISO8601ZoneTest { } } finally { TimeZone.setDefault(tz); + Locale.setDefault(loc); } } @@ -188,15 +194,24 @@ public class ISO8601ZoneTest { } - static void badDataParsing(String fmt, String text) { + static void badDataParsing(String fmt, String text, int expectedErrorIndex) { + SimpleDateFormat sdf = new SimpleDateFormat(fmt); try { - SimpleDateFormat sdf = new SimpleDateFormat(fmt); sdf.parse(text); throw new RuntimeException("didn't throw an exception: fmt=" + fmt + ", text=" + text); } catch (ParseException e) { // OK } + + ParsePosition pos = new ParsePosition(0); + Date d = sdf.parse(text, pos); + int errorIndex = pos.getErrorIndex(); + if (d != null || errorIndex != expectedErrorIndex) { + throw new RuntimeException("Bad error index=" + errorIndex + + ", expected=" + expectedErrorIndex + + ", fmt=" + fmt + ", text=" + text); + } } static void badFormat(String fmt) { diff --git a/jdk/test/java/text/Format/MessageFormat/Bug7003643.java b/jdk/test/java/text/Format/MessageFormat/Bug7003643.java new file mode 100644 index 00000000000..aeb722cac17 --- /dev/null +++ b/jdk/test/java/text/Format/MessageFormat/Bug7003643.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7003643 + * @summary Make sure MessageFormat.toPattern produces correct quoting. (SPI part is tested in PluggableLocale tests.) + */ + +import java.text.*; +import java.util.*; + +public class Bug7003643 { + private static final int N = 5; + + private static final String[] elements = { + "'{'", "'{", "{", "''", "}", "a", "'", + }; + + public static void main(String[] args) { + Random rand = new Random(); + int count = 0; + int max = (int) (Math.pow((double)elements.length, (double)N)/0.52); + while (count < max) { + // Create a random pattern. If the produced pattern is + // valid, then proceed with the round-trip testing. + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < N; i++) { + sb.append(elements[rand.nextInt(elements.length)]); + } + String pattern = sb.toString(); + MessageFormat mf = null; + try { + mf = new MessageFormat(pattern); + } catch (IllegalArgumentException e) { + // bad pattern data + } + if (mf == null) { + continue; + } + count++; + String res1 = MessageFormat.format(pattern, 123); + String toPattern = mf.toPattern(); + String res2 = MessageFormat.format(toPattern, 123); + if (!res1.equals(res2)) { + String s = String.format("Failed%n pattern=\"%s\" => result=\"%s\"%n" + + " toPattern()=\"%s\" => result=\"%s\"%n", + pattern, res1, toPattern, res2); + throw new RuntimeException(s); + } + } + } +} diff --git a/jdk/test/java/util/ArrayList/EnsureCapacity.java b/jdk/test/java/util/ArrayList/EnsureCapacity.java new file mode 100644 index 00000000000..a8e5f42ac6b --- /dev/null +++ b/jdk/test/java/util/ArrayList/EnsureCapacity.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6992121 + * @summary Test the ArrayList.ensureCapacity() and Vector.ensureCapacity + * method with negative minimumCapacity input argument. + */ + +import java.util.ArrayList; +import java.util.Vector; + +public class EnsureCapacity { + public static void main(String[] args) { + testArrayList(); + testVector(); + } + + private static void checkCapacity(int before, int after) { + if (before != after) { + throw new RuntimeException("capacity is expected to be unchanged: " + + "before=" + before + " after=" + after); + } + } + + private static void testArrayList() { + ArrayList al = new ArrayList(); + al.add("abc"); + al.ensureCapacity(Integer.MIN_VALUE); + + // there is no method to query the capacity of ArrayList + // so before and after capacity are not checked + } + + private static void testVector() { + Vector vector = new Vector(); + vector.add("abc"); + + int cap = vector.capacity(); + vector.ensureCapacity(Integer.MIN_VALUE); + checkCapacity(cap, vector.capacity()); + } +} diff --git a/jdk/test/java/util/Collection/BiggernYours.java b/jdk/test/java/util/Collection/BiggernYours.java index d1e1e618841..6800f43567c 100644 --- a/jdk/test/java/util/Collection/BiggernYours.java +++ b/jdk/test/java/util/Collection/BiggernYours.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Collection/IteratorAtEnd.java b/jdk/test/java/util/Collection/IteratorAtEnd.java index 9d10f33de60..fffc7f70fa1 100644 --- a/jdk/test/java/util/Collection/IteratorAtEnd.java +++ b/jdk/test/java/util/Collection/IteratorAtEnd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Collection/MOAT.java b/jdk/test/java/util/Collection/MOAT.java index 4de8ca6ee11..a85afa3c8d2 100644 --- a/jdk/test/java/util/Collection/MOAT.java +++ b/jdk/test/java/util/Collection/MOAT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Collections/RacingCollections.java b/jdk/test/java/util/Collections/RacingCollections.java index 1bc513ea60c..5cff67fd66a 100644 --- a/jdk/test/java/util/Collections/RacingCollections.java +++ b/jdk/test/java/util/Collections/RacingCollections.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Currency/Bug6807534.java b/jdk/test/java/util/Currency/Bug6807534.java new file mode 100644 index 00000000000..073518d45ac --- /dev/null +++ b/jdk/test/java/util/Currency/Bug6807534.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 6807534 + * @summary check whether the default implementation of + * CurrencNameProvider.getDisplayName(String, Locale) throws appropriate + * exceptions when necessary. + */ + +import java.util.Locale; +import java.util.spi.CurrencyNameProvider; + +public class Bug6807534 { + + static final CurrencyNameProvider cnp = new CurrencyNameProviderImpl(); + + public static void main(String[] args) throws Exception { + // test for NullPointerException (currencyCode) + try { + cnp.getDisplayName(null, Locale.US); + throwException("NPE was not thrown with null currencyCode"); + } catch (NullPointerException npe) {} + + // test for NullPointerException (locale) + try { + cnp.getDisplayName("USD", null); + throwException("NPE was not thrown with null locale"); + } catch (NullPointerException npe) {} + + // test for IllegalArgumentException (illegal currencyCode) + try { + cnp.getDisplayName("INVALID", Locale.US); + throwException("IllegalArgumentException was not thrown with invalid currency code"); + } catch (IllegalArgumentException iae) {} + try { + cnp.getDisplayName("inv", Locale.US); + throwException("IllegalArgumentException was not thrown with invalid currency code"); + } catch (IllegalArgumentException iae) {} + + // test for IllegalArgumentException (non-supported locale) + try { + cnp.getDisplayName("USD", Locale.JAPAN); + throwException("IllegalArgumentException was not thrown with non-supported locale"); + } catch (IllegalArgumentException iae) {} + } + + static void throwException(String msg) { + throw new RuntimeException("test failed. "+msg); + } + + static class CurrencyNameProviderImpl extends CurrencyNameProvider { + // dummy implementation + public String getSymbol(String currencyCode, Locale locale) { + return ""; + } + + public Locale[] getAvailableLocales() { + Locale[] avail = new Locale[1]; + avail[0] = Locale.US; + return avail; + } + } +} diff --git a/jdk/test/java/util/Deque/ChorusLine.java b/jdk/test/java/util/Deque/ChorusLine.java index 5dbb5231a21..4cce6bd98c6 100644 --- a/jdk/test/java/util/Deque/ChorusLine.java +++ b/jdk/test/java/util/Deque/ChorusLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Formatter/Constructors.java b/jdk/test/java/util/Formatter/Constructors.java index c5b6f11007b..c542e1bbfb8 100644 --- a/jdk/test/java/util/Formatter/Constructors.java +++ b/jdk/test/java/util/Formatter/Constructors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. * 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 4981811 4984465 5064492 6240171 + * @bug 4981811 4984465 5064492 6240171 7000511 * @summary Unit test for all constructors introduced by the formatter feature */ @@ -85,10 +85,8 @@ public class Constructors { } public static void main(String [] args) { - // Formatter() - try { - Formatter f = new Formatter(); + try (Formatter f = new Formatter()) { pass(); out(f, StringBuilder.class); locale(f); @@ -97,8 +95,7 @@ public class Constructors { } // Formatter(Appendable a) - try { - Formatter f = new Formatter((Appendable) null); + try (Formatter f = new Formatter((Appendable) null)) { pass(); out(f, StringBuilder.class); locale(f); @@ -107,8 +104,7 @@ public class Constructors { } // Formatter(Locale l) - try { - Formatter f = new Formatter((Locale) null); + try (Formatter f = new Formatter((Locale) null)) { pass(); out(f, StringBuilder.class); locale(f, null); @@ -117,8 +113,7 @@ public class Constructors { } // Formatter(Appendable a, Locale l) - try { - Formatter f = new Formatter((Appendable) null, (Locale) null); + try (Formatter f = new Formatter((Appendable) null, (Locale) null)) { pass(); out(f, StringBuilder.class); locale(f, null); @@ -127,8 +122,7 @@ public class Constructors { } // Formatter(String fileName) - try { - Formatter f = new Formatter("foo"); + try (Formatter f = new Formatter("foo")) { pass(); out(f, BufferedWriter.class); locale(f); @@ -137,7 +131,7 @@ public class Constructors { } try { - Formatter f = new Formatter((String)null); + new Formatter((String)null); fail("new Formatter((String)null)"); } catch (NullPointerException x) { pass(); @@ -146,8 +140,7 @@ public class Constructors { } // Formatter(String fileName, String csn) - try { - Formatter f = new Formatter("foo", "UTF-8"); + try (Formatter f = new Formatter("foo", "UTF-8")) { pass(); out(f, BufferedWriter.class); locale(f); @@ -167,15 +160,14 @@ public class Constructors { try { new Formatter(".", "bar"); fail("new Formatter(\".\", \"bar\")"); - } catch (FileNotFoundException x) { + } catch (FileNotFoundException|UnsupportedEncodingException x) { pass(); } catch (Exception x) { fail("new Formatter(\".\", \"bar\")", x); } // Formatter(String fileName, String csn, Locale l) - try { - Formatter f = new Formatter("foo", "ISO-8859-1", Locale.GERMANY); + try (Formatter f = new Formatter("foo", "ISO-8859-1", Locale.GERMANY)) { pass(); out(f, BufferedWriter.class); locale(f, Locale.GERMANY); @@ -183,8 +175,7 @@ public class Constructors { fail("new Formatter(\"foo\", \"ISO-8859-1\", Locale.GERMANY)", x); } - try { - Formatter f = new Formatter("foo", "ISO-8859-1", null); + try (Formatter f = new Formatter("foo", "ISO-8859-1", null)) { pass(); locale(f, null); out(f, BufferedWriter.class); @@ -193,8 +184,7 @@ public class Constructors { } // Formatter(File) - try { - Formatter f = new Formatter(new File("foo")); + try (Formatter f = new Formatter(new File("foo"))) { pass(); locale(f); out(f, BufferedWriter.class); @@ -203,7 +193,7 @@ public class Constructors { } try { - Formatter f = new Formatter((File)null); + new Formatter((File)null); fail("new Formatter((File)null)"); } catch (NullPointerException x) { pass(); @@ -231,8 +221,7 @@ public class Constructors { fail("new Formatter((PrintStream) null)", x); } - try { - Formatter f = new Formatter(new PrintStream("foo")); + try (Formatter f = new Formatter(new PrintStream("foo"))) { pass(); locale(f); out(f, PrintStream.class); @@ -242,9 +231,8 @@ public class Constructors { fail("new Formatter(new PrintStream(\"foo\")", x); } - try { - Formatter f = new Formatter(new PrintStream("foo"), - Locale.JAPANESE); + try (Formatter f = new Formatter(new PrintStream("foo"), + Locale.JAPANESE)) { pass(); locale(f, Locale.JAPANESE); out(f, PrintStream.class); @@ -254,12 +242,11 @@ public class Constructors { fail("new Formatter(new PrintStream(\"foo\")", x); } - try { + try (PrintStream ps = new PrintStream("foo")) { // The cast here is necessary to avoid an ambiguity error // between Formatter(Appendable a, Locale l) - // and Formatter(OutputStream os, String csn) - Formatter f = new Formatter(new PrintStream("foo"), - (String)null); + // and Formatter(OutputStream os, String csn) + new Formatter(ps, (String)null); fail("new Formatter(new PrintStream(\"foo\"), (String)null)"); } catch (FileNotFoundException x) { fail("new Formatter(new PrintStream(\"foo\"), (String)null)", x); @@ -271,12 +258,11 @@ public class Constructors { fail("new Formatter(new PrintStream(\"foo\"), (String)null)", x); } - try { - // The cast here is necessary to avoid an ambiguity error - // between Formatter(Appendable a, Locale l) - // and Formatter(OutputStream os, String csn) - Formatter f = new Formatter(new PrintStream("foo"), - (Locale)null); + // The cast here is necessary to avoid an ambiguity error + // between Formatter(Appendable a, Locale l) + // and Formatter(OutputStream os, String csn) + try (Formatter f = new Formatter(new PrintStream("foo"), + (Locale)null)) { pass(); locale(f, null); out(f, PrintStream.class); @@ -286,9 +272,8 @@ public class Constructors { fail("new Formatter(new PrintStream(\"foo\"), (Locale)null)", x); } - try { - Formatter f = new Formatter(new PrintStream("foo"), - Locale.KOREAN); + try (Formatter f = new Formatter(new PrintStream("foo"), + Locale.KOREAN)) { pass(); locale(f, Locale.KOREAN); out(f, PrintStream.class); @@ -298,9 +283,8 @@ public class Constructors { fail("new Formatter(new PrintStream(\"foo\"), Locale.KOREAN)", x); } - try { - Formatter f = new Formatter(new PrintStream("foo"), - "UTF-16BE", null); + try (Formatter f = new Formatter(new PrintStream("foo"), + "UTF-16BE", null)) { pass(); locale(f, null); out(f, BufferedWriter.class); @@ -312,9 +296,8 @@ public class Constructors { fail("new Formatter(new PrintStream(\"foo\"), \"UTF-16BE\", null"); } - try { - Formatter f = new Formatter(new PrintStream("foo"), - "UTF-16BE", Locale.ITALIAN); + try (Formatter f = new Formatter(new PrintStream("foo"), + "UTF-16BE", Locale.ITALIAN)) { pass(); locale(f, Locale.ITALIAN); out(f, BufferedWriter.class); @@ -361,8 +344,7 @@ public class Constructors { fail("new Formatter((OutputStream) null)", x); } - try { - Formatter f = new Formatter((OutputStream) new PrintStream("foo")); + try (Formatter f = new Formatter((OutputStream) new PrintStream("foo"))) { pass(); locale(f); out(f, BufferedWriter.class); @@ -380,8 +362,8 @@ public class Constructors { fail("new Formatter((OutputStream) null, \"ISO-8859-1\")", x); } - try { - new Formatter((OutputStream) new PrintStream("foo"), null); + try (PrintStream ps = new PrintStream("foo")) { + new Formatter((OutputStream) ps, null); fail("new Formatter((OutputStream) new PrintStream(\"foo\"), null"); } catch (NullPointerException x) { pass(); @@ -390,8 +372,8 @@ public class Constructors { x); } - try { - new Formatter(new PrintStream("foo"), "bar"); + try (PrintStream ps = new PrintStream("foo")) { + new Formatter(ps, "bar"); fail("new Formatter(new PrintStream(\"foo\"), \"bar\")"); } catch (UnsupportedEncodingException x) { pass(); @@ -399,8 +381,7 @@ public class Constructors { fail("new Formatter(new PrintStream(\"foo\"), \"bar\")", x); } - try { - Formatter f = new Formatter(new PrintStream("foo"), "UTF-8"); + try (Formatter f = new Formatter(new PrintStream("foo"), "UTF-8")) { pass(); locale(f); out(f, BufferedWriter.class); @@ -419,8 +400,8 @@ public class Constructors { x); } - try { - new Formatter(new PrintStream("foo"), null, Locale.UK); + try (PrintStream ps = new PrintStream("foo")) { + new Formatter(ps, null, Locale.UK); fail("new Formatter(new PrintStream(\"foo\"), null, Locale.UK)"); } catch (NullPointerException x) { pass(); @@ -429,8 +410,8 @@ public class Constructors { x); } - try { - new Formatter(new PrintStream("foo"), "bar", Locale.UK); + try (PrintStream ps = new PrintStream("foo")) { + new Formatter(ps, "bar", Locale.UK); fail("new Formatter(new PrintStream(\"foo\"), \"bar\", Locale.UK)"); } catch (UnsupportedEncodingException x) { pass(); @@ -439,9 +420,7 @@ public class Constructors { x); } - try { - Formatter f - = new Formatter(new PrintStream("foo"), "UTF-8", Locale.UK); + try (Formatter f = new Formatter(new PrintStream("foo"), "UTF-8", Locale.UK)) { pass(); out(f, BufferedWriter.class); locale(f, Locale.UK); @@ -451,8 +430,7 @@ public class Constructors { } // PrintStream(String fileName) - try { - new PrintStream("foo"); + try (PrintStream ps = new PrintStream("foo")) { pass(); } catch (Exception x) { fail("new PrintStream(\"foo\")", x); @@ -469,8 +447,7 @@ public class Constructors { } // PrintStream(File file) - try { - new PrintStream(new File("foo")); + try (PrintStream ps = new PrintStream(new File("foo"))) { pass(); } catch (Exception x) { fail("new PrintStream(new File(\"foo\"))", x); @@ -487,8 +464,7 @@ public class Constructors { } // PrintWriter(String fileName) - try { - new PrintWriter("foo"); + try (PrintWriter pw = new PrintWriter("foo")) { pass(); } catch (Exception x) { fail("new PrintWriter(\"foo\")", x); @@ -505,8 +481,7 @@ public class Constructors { } // PrintWriter(File file) - try { - new PrintWriter(new File("foo")); + try (PrintWriter pw = new PrintWriter(new File("foo"))) { pass(); } catch (Exception x) { fail("new PrintWriter(new File(\"foo\"))", x); diff --git a/jdk/test/java/util/Formatter/FailingConstructors.java b/jdk/test/java/util/Formatter/FailingConstructors.java new file mode 100644 index 00000000000..8ef99f146a4 --- /dev/null +++ b/jdk/test/java/util/Formatter/FailingConstructors.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 7000511 + * @summary PrintStream, PrintWriter, Formatter, Scanner leave files open when + * exception thrown + */ + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.Formatter; + +public class FailingConstructors { + static final String fileName = "FailingConstructorsTest"; + static final String UNSUPPORTED_CHARSET = "unknownCharset"; + static final String FILE_CONTENTS = "This is a small file!"; + + private static void realMain(String[] args) throws Throwable { + test(false, new File(fileName)); + + /* create the file and write its contents */ + File file = File.createTempFile(fileName, null); + file.deleteOnExit(); + FileOutputStream fos = new FileOutputStream(file); + fos.write(FILE_CONTENTS.getBytes()); + fos.close(); + + test(true, file); + file.delete(); + } + + private static void test(boolean exists, File file) throws Throwable { + /* Formatter(File file, String csn) */ + try { + new Formatter(file, UNSUPPORTED_CHARSET); + fail(); + } catch(FileNotFoundException|UnsupportedEncodingException e) { + pass(); + } + + check(exists, file); + + try { + new Formatter(file, null); + fail(); + } catch(FileNotFoundException|NullPointerException e) { + pass(); + } + + check(exists, file); + + /* Formatter(String fileName, String csn) */ + try { + new Formatter(file.getName(), UNSUPPORTED_CHARSET); + fail(); + } catch(FileNotFoundException|UnsupportedEncodingException e) { + pass(); + } + + check(exists, file); + + try { + new Formatter(file.getName(), null); + fail(); + } catch(FileNotFoundException|NullPointerException e) { + pass(); + } + + check(exists, file); + } + + private static void check(boolean exists, File file) { + if (exists) { + /* the file should be unchanged */ + verifyContents(file); + } else { + /* the file should not have been created */ + if (file.exists()) { fail(file + " should not have been created"); } + } + } + + private static void verifyContents(File file) { + try (FileInputStream fis = new FileInputStream(file)) { + byte[] contents = FILE_CONTENTS.getBytes(); + int read, count = 0; + while ((read = fis.read()) != -1) { + if (read != contents[count++]) { + fail("file contents have been altered"); + return; + } + } + } catch (IOException ioe) { + unexpected(ioe); + } + } + + //--------------------- Infrastructure --------------------------- + static volatile int passed = 0, failed = 0; + static void pass() {passed++;} + static void fail() {failed++; Thread.dumpStack();} + static void fail(String message) {System.out.println(message); fail(); } + static void unexpected(Throwable t) {failed++; t.printStackTrace();} + public static void main(String[] args) throws Throwable { + try {realMain(args);} catch (Throwable t) {unexpected(t);} + System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); + if (failed > 0) throw new AssertionError("Some tests failed");} +} diff --git a/jdk/test/java/util/Locale/Bug6989440.java b/jdk/test/java/util/Locale/Bug6989440.java new file mode 100644 index 00000000000..ebf62f98807 --- /dev/null +++ b/jdk/test/java/util/Locale/Bug6989440.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6989440 + * @summary Verify ConcurrentModificationException is not thrown with multiple + * thread accesses. + * @compile -XDignore.symbol.file=true Bug6989440.java + * @run main Bug6989440 + */ +import java.text.spi.DateFormatProvider; +import java.util.spi.LocaleNameProvider; +import java.util.spi.LocaleServiceProvider; +import java.util.spi.TimeZoneNameProvider; + +import sun.util.LocaleServiceProviderPool; + +public class Bug6989440 { + public static void main(String[] args) { + TestThread t1 = new TestThread(LocaleNameProvider.class); + TestThread t2 = new TestThread(TimeZoneNameProvider.class); + TestThread t3 = new TestThread(DateFormatProvider.class); + + t1.start(); + t2.start(); + t3.start(); + } + + static class TestThread extends Thread { + private Class cls; + + public TestThread(Class providerClass) { + cls = providerClass; + } + + public void run() { + LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(cls); + pool.getAvailableLocales(); + } + } +} diff --git a/jdk/test/java/util/Locale/LocaleCategory.java b/jdk/test/java/util/Locale/LocaleCategory.java index 433afedbe76..e083c62ef21 100644 --- a/jdk/test/java/util/Locale/LocaleCategory.java +++ b/jdk/test/java/util/Locale/LocaleCategory.java @@ -29,15 +29,28 @@ public class LocaleCategory { private static String enc = null; public static void main(String[] args) { - base = new Locale(System.getProperty("user.language", ""), - System.getProperty("user.country", ""), - System.getProperty("user.variant", "")); - disp = new Locale(System.getProperty("user.language.display", ""), - System.getProperty("user.country.display", ""), - System.getProperty("user.variant.display", "")); - fmt = new Locale(System.getProperty("user.language.format", ""), - System.getProperty("user.country.format", ""), - System.getProperty("user.variant.format", "")); + Locale.Builder builder = new Locale.Builder(); + + base = builder.setLanguage(System.getProperty("user.language", "")) + .setScript(System.getProperty("user.script", "")) + .setRegion(System.getProperty("user.country", "")) + .setVariant(System.getProperty("user.variant", "")).build(); + disp = builder.setLanguage(System.getProperty("user.language.display", + Locale.getDefault().getLanguage())) + .setScript(System.getProperty("user.script.display", + Locale.getDefault().getScript())) + .setRegion(System.getProperty("user.country.display", + Locale.getDefault().getCountry())) + .setVariant(System.getProperty("user.variant.display", + Locale.getDefault().getVariant())).build(); + fmt = builder.setLanguage(System.getProperty("user.language.format", + Locale.getDefault().getLanguage())) + .setScript(System.getProperty("user.script.format", + Locale.getDefault().getScript())) + .setRegion(System.getProperty("user.country.format", + Locale.getDefault().getCountry())) + .setVariant(System.getProperty("user.variant.format", + Locale.getDefault().getVariant())).build(); checkDefault(); testGetSetDefault(); } diff --git a/jdk/test/java/util/Locale/LocaleCategory.sh b/jdk/test/java/util/Locale/LocaleCategory.sh index 7ed214d9cde..8544f4dad7b 100644 --- a/jdk/test/java/util/Locale/LocaleCategory.sh +++ b/jdk/test/java/util/Locale/LocaleCategory.sh @@ -1,7 +1,7 @@ #!/bin/sh # # @test -# @bug 4700857 +# @bug 4700857 6997928 # @summary tests for Locale.getDefault(Locale.Category) and # Locale.setDefault(Locale.Category, Locale) # @build LocaleCategory diff --git a/jdk/test/java/util/Locale/LocaleEnhanceTest.java b/jdk/test/java/util/Locale/LocaleEnhanceTest.java index a4416a4789e..f7ed5ab3dfb 100644 --- a/jdk/test/java/util/Locale/LocaleEnhanceTest.java +++ b/jdk/test/java/util/Locale/LocaleEnhanceTest.java @@ -614,6 +614,55 @@ public class LocaleEnhanceTest extends LocaleTestFmwk { assertEquals("hans DE", "Simplified Han", hansLocale.getDisplayScript(Locale.GERMANY)); } + public void testGetDisplayName() { + final Locale[] testLocales = { + Locale.ROOT, + new Locale("en"), + new Locale("en", "US"), + new Locale("", "US"), + new Locale("no", "NO", "NY"), + new Locale("", "", "NY"), + Locale.forLanguageTag("zh-Hans"), + Locale.forLanguageTag("zh-Hant"), + Locale.forLanguageTag("zh-Hans-CN"), + Locale.forLanguageTag("und-Hans"), + }; + + final String[] displayNameEnglish = { + "", + "English", + "English (United States)", + "United States", + "Norwegian (Norway,Nynorsk)", + "Nynorsk", + "Chinese (Simplified Han)", + "Chinese (Traditional Han)", + "Chinese (Simplified Han,China)", + "Simplified Han", + }; + + final String[] displayNameSimplifiedChinese = { + "", + "\u82f1\u6587", + "\u82f1\u6587 (\u7f8e\u56fd)", + "\u7f8e\u56fd", + "\u632a\u5a01\u6587 (\u632a\u5a01,Nynorsk)", + "Nynorsk", + "\u4e2d\u6587 (\u7b80\u4f53\u4e2d\u6587)", + "\u4e2d\u6587 (\u7e41\u4f53\u4e2d\u6587)", + "\u4e2d\u6587 (\u7b80\u4f53\u4e2d\u6587,\u4e2d\u56fd)", + "\u7b80\u4f53\u4e2d\u6587", + }; + + for (int i = 0; i < testLocales.length; i++) { + Locale loc = testLocales[i]; + assertEquals("English display name for " + loc.toLanguageTag(), + displayNameEnglish[i], loc.getDisplayName(Locale.ENGLISH)); + assertEquals("Simplified Chinese display name for " + loc.toLanguageTag(), + displayNameSimplifiedChinese[i], loc.getDisplayName(Locale.CHINA)); + } + } + /// /// Builder tests /// @@ -1152,6 +1201,49 @@ public class LocaleEnhanceTest extends LocaleTestFmwk { } } + public void testBug7002320() { + // forLanguageTag() and Builder.setLanguageTag(String) + // should add a location extension for following two cases. + // + // 1. language/country are "ja"/"JP" and the resolved variant (x-lvariant-*) + // is exactly "JP" and no BCP 47 extensions are available, then add + // a Unicode locale extension "ca-japanese". + // 2. language/country are "th"/"TH" and the resolved variant is exactly + // "TH" and no BCP 47 extensions are available, then add a Unicode locale + // extension "nu-thai". + // + String[][] testdata = { + {"ja-JP-x-lvariant-JP", "ja-JP-u-ca-japanese-x-lvariant-JP"}, // special case 1 + {"ja-JP-x-lvariant-JP-XXX"}, + {"ja-JP-u-ca-japanese-x-lvariant-JP"}, + {"ja-JP-u-ca-gregory-x-lvariant-JP"}, + {"ja-JP-u-cu-jpy-x-lvariant-JP"}, + {"ja-x-lvariant-JP"}, + {"th-TH-x-lvariant-TH", "th-TH-u-nu-thai-x-lvariant-TH"}, // special case 2 + {"th-TH-u-nu-thai-x-lvariant-TH"}, + {"en-US-x-lvariant-JP"}, + }; + + Builder bldr = new Builder(); + + for (String[] data : testdata) { + String in = data[0]; + String expected = (data.length == 1) ? data[0] : data[1]; + + // forLanguageTag + Locale loc = Locale.forLanguageTag(in); + String out = loc.toLanguageTag(); + assertEquals("Language tag roundtrip by forLanguageTag with input: " + in, expected, out); + + // setLanguageTag + bldr.clear(); + bldr.setLanguageTag(in); + loc = bldr.build(); + out = loc.toLanguageTag(); + assertEquals("Language tag roundtrip by Builder.setLanguageTag with input: " + in, expected, out); + } + } + /// /// utility asserts /// diff --git a/jdk/test/java/util/Locale/LocaleTest.java b/jdk/test/java/util/Locale/LocaleTest.java index af00c6bba6c..0c21a8ef354 100644 --- a/jdk/test/java/util/Locale/LocaleTest.java +++ b/jdk/test/java/util/Locale/LocaleTest.java @@ -24,7 +24,8 @@ * @test * @bug 4052404 4052440 4084688 4092475 4101316 4105828 4107014 4107953 4110613 * 4118587 4118595 4122371 4126371 4126880 4135316 4135752 4139504 4139940 4143951 - * 4147315 4147317 4147552 4335196 4778440 5010672 6475525 6544471 6627549 6786276 + * 4147315 4147317 4147552 4335196 4778440 4940539 5010672 6475525 6544471 6627549 + * 6786276 * @summary test Locales */ /* @@ -895,17 +896,28 @@ test commented out pending API-change approval } /** - * @bug 4147317 - * java.util.Locale.getISO3Language() works wrong for non ISO-3166 codes. - * Should throw an exception for unknown locales + * @bug 4147317 4940539 + * java.util.Locale.getISO3Language() works wrong for non ISO-639 codes. + * Should throw an exception for unknown locales, except they have three + * letter language codes. */ public void Test4147317() { - // Try with codes that are the wrong length but happen to match text - // at a valid offset in the mapping table + // Try a three letter language code, and check whether it is + // returned as is. Locale locale = new Locale("aaa", "CCC"); + String result = locale.getISO3Language(); + if (!result.equals("aaa")) { + errln("ERROR: getISO3Language() returns: " + result + + " for locale '" + locale + "' rather than returning it as is" ); + } + + // Try an invalid two letter language code, and check whether it + // throws a MissingResourceException. + locale = new Locale("zz", "CCC"); + try { - String result = locale.getISO3Language(); + result = locale.getISO3Language(); errln("ERROR: getISO3Language() returns: " + result + " for locale '" + locale + "' rather than exception" ); diff --git a/jdk/test/java/util/Locale/PrintDefaultLocale.java b/jdk/test/java/util/Locale/PrintDefaultLocale.java index 04f39abd370..302cd4fccb5 100644 --- a/jdk/test/java/util/Locale/PrintDefaultLocale.java +++ b/jdk/test/java/util/Locale/PrintDefaultLocale.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Locale/data/deflocale.c b/jdk/test/java/util/Locale/data/deflocale.c index f1ab060dff6..5f25d8ff12d 100644 --- a/jdk/test/java/util/Locale/data/deflocale.c +++ b/jdk/test/java/util/Locale/data/deflocale.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Locale/data/deflocale.rhel5 b/jdk/test/java/util/Locale/data/deflocale.rhel5 index 5d534f9bb6b..48efff342cc 100644 --- a/jdk/test/java/util/Locale/data/deflocale.rhel5 +++ b/jdk/test/java/util/Locale/data/deflocale.rhel5 @@ -465,15 +465,15 @@ format locale: ID: be_BY, Name: Belarusian (Belarus) default charset: UTF-8 OS Locale: be_BY.utf8@latin -default locale: ID: be_BY, Name: Belarusian (Belarus) -display locale: ID: be_BY, Name: Belarusian (Belarus) -format locale: ID: be_BY, Name: Belarusian (Belarus) +default locale: ID: be_BY_#Latn, Name: Belarusian (Latin,Belarus) +display locale: ID: be_BY_#Latn, Name: Belarusian (Latin,Belarus) +format locale: ID: be_BY_#Latn, Name: Belarusian (Latin,Belarus) default charset: UTF-8 OS Locale: be_BY@latin -default locale: ID: be_BY, Name: Belarusian (Belarus) -display locale: ID: be_BY, Name: Belarusian (Belarus) -format locale: ID: be_BY, Name: Belarusian (Belarus) +default locale: ID: be_BY_#Latn, Name: Belarusian (Latin,Belarus) +display locale: ID: be_BY_#Latn, Name: Belarusian (Latin,Belarus) +format locale: ID: be_BY_#Latn, Name: Belarusian (Latin,Belarus) default charset: UTF-8 OS Locale: bg_BG @@ -519,15 +519,15 @@ format locale: ID: bn_IN, Name: Bengali (India) default charset: UTF-8 OS Locale: bokmål -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: nb_NO, Name: Norwegian Bokmål (Norway) +display locale: ID: nb_NO, Name: Norwegian Bokmål (Norway) +format locale: ID: nb_NO, Name: Norwegian Bokmål (Norway) default charset: ISO-8859-1 OS Locale: bokmal -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: nb_NO, Name: Norwegian Bokmål (Norway) +display locale: ID: nb_NO, Name: Norwegian Bokmål (Norway) +format locale: ID: nb_NO, Name: Norwegian Bokmål (Norway) default charset: ISO-8859-1 OS Locale: br_FR @@ -579,15 +579,15 @@ format locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) default charset: UTF-8 OS Locale: byn_ER -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: byn_ER, Name: Blin (Eritrea) +display locale: ID: byn_ER, Name: Blin (Eritrea) +format locale: ID: byn_ER, Name: Blin (Eritrea) default charset: UTF-8 OS Locale: byn_ER.utf8 -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: byn_ER, Name: Blin (Eritrea) +display locale: ID: byn_ER, Name: Blin (Eritrea) +format locale: ID: byn_ER, Name: Blin (Eritrea) default charset: UTF-8 OS Locale: ca_AD @@ -705,15 +705,15 @@ format locale: ID: cs_CZ, Name: Czech (Czech Republic) default charset: UTF-8 OS Locale: csb_PL -default locale: ID: en_PL, Name: English (Poland) -display locale: ID: en_PL, Name: English (Poland) -format locale: ID: en_PL, Name: English (Poland) +default locale: ID: csb_PL, Name: Kashubian (Poland) +display locale: ID: csb_PL, Name: Kashubian (Poland) +format locale: ID: csb_PL, Name: Kashubian (Poland) default charset: UTF-8 OS Locale: csb_PL.utf8 -default locale: ID: en_PL, Name: English (Poland) -display locale: ID: en_PL, Name: English (Poland) -format locale: ID: en_PL, Name: English (Poland) +default locale: ID: csb_PL, Name: Kashubian (Poland) +display locale: ID: csb_PL, Name: Kashubian (Poland) +format locale: ID: csb_PL, Name: Kashubian (Poland) default charset: UTF-8 OS Locale: cy_GB @@ -939,9 +939,9 @@ format locale: ID: dz_BT, Name: Dzongkha (Bhutan) default charset: UTF-8 OS Locale: eesti -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: et_EE, Name: Estonian (Estonia) +display locale: ID: et_EE, Name: Estonian (Estonia) +format locale: ID: et_EE, Name: Estonian (Estonia) default charset: ISO-8859-1 OS Locale: el_CY @@ -1623,9 +1623,9 @@ format locale: ID: es_VE, Name: Spanish (Venezuela) default charset: UTF-8 OS Locale: estonian -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: et_EE, Name: Estonian (Estonia) +display locale: ID: et_EE, Name: Estonian (Estonia) +format locale: ID: et_EE, Name: Estonian (Estonia) default charset: ISO-8859-1 OS Locale: et_EE @@ -1929,15 +1929,15 @@ format locale: ID: ga_IE, Name: Irish (Ireland) default charset: ISO-8859-15 OS Locale: galego -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: gl_ES, Name: Gallegan (Spain) +display locale: ID: gl_ES, Name: Gallegan (Spain) +format locale: ID: gl_ES, Name: Gallegan (Spain) default charset: ISO-8859-1 OS Locale: galician -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: gl_ES, Name: Gallegan (Spain) +display locale: ID: gl_ES, Name: Gallegan (Spain) +format locale: ID: gl_ES, Name: Gallegan (Spain) default charset: ISO-8859-1 OS Locale: gd_GB @@ -1965,51 +1965,51 @@ format locale: ID: de_DE, Name: German (Germany) default charset: ISO-8859-1 OS Locale: gez_ER -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: gez_ER, Name: Geez (Eritrea) +display locale: ID: gez_ER, Name: Geez (Eritrea) +format locale: ID: gez_ER, Name: Geez (Eritrea) default charset: UTF-8 OS Locale: gez_ER.utf8 -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: gez_ER, Name: Geez (Eritrea) +display locale: ID: gez_ER, Name: Geez (Eritrea) +format locale: ID: gez_ER, Name: Geez (Eritrea) default charset: UTF-8 OS Locale: gez_ER.utf8@abegede -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: gez_ER, Name: Geez (Eritrea) +display locale: ID: gez_ER, Name: Geez (Eritrea) +format locale: ID: gez_ER, Name: Geez (Eritrea) default charset: UTF-8 OS Locale: gez_ER@abegede -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: gez_ER, Name: Geez (Eritrea) +display locale: ID: gez_ER, Name: Geez (Eritrea) +format locale: ID: gez_ER, Name: Geez (Eritrea) default charset: UTF-8 OS Locale: gez_ET -default locale: ID: en_ET, Name: English (Ethiopia) -display locale: ID: en_ET, Name: English (Ethiopia) -format locale: ID: en_ET, Name: English (Ethiopia) +default locale: ID: gez_ET, Name: Geez (Ethiopia) +display locale: ID: gez_ET, Name: Geez (Ethiopia) +format locale: ID: gez_ET, Name: Geez (Ethiopia) default charset: UTF-8 OS Locale: gez_ET.utf8 -default locale: ID: en_ET, Name: English (Ethiopia) -display locale: ID: en_ET, Name: English (Ethiopia) -format locale: ID: en_ET, Name: English (Ethiopia) +default locale: ID: gez_ET, Name: Geez (Ethiopia) +display locale: ID: gez_ET, Name: Geez (Ethiopia) +format locale: ID: gez_ET, Name: Geez (Ethiopia) default charset: UTF-8 OS Locale: gez_ET.utf8@abegede -default locale: ID: en_ET, Name: English (Ethiopia) -display locale: ID: en_ET, Name: English (Ethiopia) -format locale: ID: en_ET, Name: English (Ethiopia) +default locale: ID: gez_ET, Name: Geez (Ethiopia) +display locale: ID: gez_ET, Name: Geez (Ethiopia) +format locale: ID: gez_ET, Name: Geez (Ethiopia) default charset: UTF-8 OS Locale: gez_ET@abegede -default locale: ID: en_ET, Name: English (Ethiopia) -display locale: ID: en_ET, Name: English (Ethiopia) -format locale: ID: en_ET, Name: English (Ethiopia) +default locale: ID: gez_ET, Name: Geez (Ethiopia) +display locale: ID: gez_ET, Name: Geez (Ethiopia) +format locale: ID: gez_ET, Name: Geez (Ethiopia) default charset: UTF-8 OS Locale: gl_ES @@ -2139,21 +2139,21 @@ format locale: ID: hr_HR, Name: Croatian (Croatia) default charset: ISO-8859-2 OS Locale: hsb_DE -default locale: ID: en_DE, Name: English (Germany) -display locale: ID: en_DE, Name: English (Germany) -format locale: ID: en_DE, Name: English (Germany) +default locale: ID: hsb_DE, Name: Upper Sorbian (Germany) +display locale: ID: hsb_DE, Name: Upper Sorbian (Germany) +format locale: ID: hsb_DE, Name: Upper Sorbian (Germany) default charset: ISO-8859-2 OS Locale: hsb_DE.iso88592 -default locale: ID: en_DE, Name: English (Germany) -display locale: ID: en_DE, Name: English (Germany) -format locale: ID: en_DE, Name: English (Germany) +default locale: ID: hsb_DE, Name: Upper Sorbian (Germany) +display locale: ID: hsb_DE, Name: Upper Sorbian (Germany) +format locale: ID: hsb_DE, Name: Upper Sorbian (Germany) default charset: ISO-8859-2 OS Locale: hsb_DE.utf8 -default locale: ID: en_DE, Name: English (Germany) -display locale: ID: en_DE, Name: English (Germany) -format locale: ID: en_DE, Name: English (Germany) +default locale: ID: hsb_DE, Name: Upper Sorbian (Germany) +display locale: ID: hsb_DE, Name: Upper Sorbian (Germany) +format locale: ID: hsb_DE, Name: Upper Sorbian (Germany) default charset: UTF-8 OS Locale: hu_HU @@ -2445,15 +2445,15 @@ format locale: ID: ko_KR, Name: Korean (South Korea) default charset: UTF-8 OS Locale: korean -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: ko_KR, Name: Korean (South Korea) +display locale: ID: ko_KR, Name: Korean (South Korea) +format locale: ID: ko_KR, Name: Korean (South Korea) default charset: EUC-KR OS Locale: korean.euc -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: ko_KR, Name: Korean (South Korea) +display locale: ID: ko_KR, Name: Korean (South Korea) +format locale: ID: ko_KR, Name: Korean (South Korea) default charset: EUC-KR OS Locale: ku_TR @@ -2523,9 +2523,9 @@ format locale: ID: lg_UG, Name: Ganda (Uganda) default charset: UTF-8 OS Locale: lithuanian -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: lt_LT, Name: Lithuanian (Lithuania) +display locale: ID: lt_LT, Name: Lithuanian (Lithuania) +format locale: ID: lt_LT, Name: Lithuanian (Lithuania) default charset: ISO-8859-13 OS Locale: lo_LA @@ -2577,15 +2577,15 @@ format locale: ID: lv_LV, Name: Latvian (Latvia) default charset: UTF-8 OS Locale: mai_IN -default locale: ID: en_IN, Name: English (India) -display locale: ID: en_IN, Name: English (India) -format locale: ID: en_IN, Name: English (India) +default locale: ID: mai_IN, Name: Maithili (India) +display locale: ID: mai_IN, Name: Maithili (India) +format locale: ID: mai_IN, Name: Maithili (India) default charset: UTF-8 OS Locale: mai_IN.utf8 -default locale: ID: en_IN, Name: English (India) -display locale: ID: en_IN, Name: English (India) -format locale: ID: en_IN, Name: English (India) +default locale: ID: mai_IN, Name: Maithili (India) +display locale: ID: mai_IN, Name: Maithili (India) +format locale: ID: mai_IN, Name: Maithili (India) default charset: UTF-8 OS Locale: mg_MG @@ -2859,21 +2859,21 @@ format locale: ID: nr_ZA, Name: South Ndebele (South Africa) default charset: UTF-8 OS Locale: nso_ZA -default locale: ID: en_ZA, Name: English (South Africa) -display locale: ID: en_ZA, Name: English (South Africa) -format locale: ID: en_ZA, Name: English (South Africa) +default locale: ID: nso_ZA, Name: Pedi (South Africa) +display locale: ID: nso_ZA, Name: Pedi (South Africa) +format locale: ID: nso_ZA, Name: Pedi (South Africa) default charset: UTF-8 OS Locale: nso_ZA.utf8 -default locale: ID: en_ZA, Name: English (South Africa) -display locale: ID: en_ZA, Name: English (South Africa) -format locale: ID: en_ZA, Name: English (South Africa) +default locale: ID: nso_ZA, Name: Pedi (South Africa) +display locale: ID: nso_ZA, Name: Pedi (South Africa) +format locale: ID: nso_ZA, Name: Pedi (South Africa) default charset: UTF-8 OS Locale: nynorsk -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: nn_NO, Name: Norwegian Nynorsk (Norway) +display locale: ID: nn_NO, Name: Norwegian Nynorsk (Norway) +format locale: ID: nn_NO, Name: Norwegian Nynorsk (Norway) default charset: ISO-8859-1 OS Locale: oc_FR @@ -3147,15 +3147,15 @@ format locale: ID: si_LK, Name: Sinhalese (Sri Lanka) default charset: UTF-8 OS Locale: sid_ET -default locale: ID: en_ET, Name: English (Ethiopia) -display locale: ID: en_ET, Name: English (Ethiopia) -format locale: ID: en_ET, Name: English (Ethiopia) +default locale: ID: sid_ET, Name: Sidamo (Ethiopia) +display locale: ID: sid_ET, Name: Sidamo (Ethiopia) +format locale: ID: sid_ET, Name: Sidamo (Ethiopia) default charset: UTF-8 OS Locale: sid_ET.utf8 -default locale: ID: en_ET, Name: English (Ethiopia) -display locale: ID: en_ET, Name: English (Ethiopia) -format locale: ID: en_ET, Name: English (Ethiopia) +default locale: ID: sid_ET, Name: Sidamo (Ethiopia) +display locale: ID: sid_ET, Name: Sidamo (Ethiopia) +format locale: ID: sid_ET, Name: Sidamo (Ethiopia) default charset: UTF-8 OS Locale: sk_SK @@ -3321,39 +3321,39 @@ format locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) default charset: UTF-8 OS Locale: sr_ME -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_ME, Name: Serbian (Montenegro) +display locale: ID: sr_ME, Name: Serbian (Montenegro) +format locale: ID: sr_ME, Name: Serbian (Montenegro) default charset: UTF-8 OS Locale: sr_ME.utf8 -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_ME, Name: Serbian (Montenegro) +display locale: ID: sr_ME, Name: Serbian (Montenegro) +format locale: ID: sr_ME, Name: Serbian (Montenegro) default charset: UTF-8 OS Locale: sr_RS -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_RS, Name: Serbian (Serbia) +display locale: ID: sr_RS, Name: Serbian (Serbia) +format locale: ID: sr_RS, Name: Serbian (Serbia) default charset: UTF-8 OS Locale: sr_RS.utf8 -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_RS, Name: Serbian (Serbia) +display locale: ID: sr_RS, Name: Serbian (Serbia) +format locale: ID: sr_RS, Name: Serbian (Serbia) default charset: UTF-8 OS Locale: sr_RS.utf8@latin -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) +display locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) +format locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) default charset: UTF-8 OS Locale: sr_RS@latin -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) +display locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) +format locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) default charset: UTF-8 OS Locale: ss_ZA @@ -3507,9 +3507,9 @@ format locale: ID: th_TH, Name: Thai (Thailand) default charset: UTF-8 OS Locale: thai -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: th_TH, Name: Thai (Thailand) +display locale: ID: th_TH, Name: Thai (Thailand) +format locale: ID: th_TH, Name: Thai (Thailand) default charset: TIS-620 OS Locale: ti_ER @@ -3537,15 +3537,15 @@ format locale: ID: ti_ET, Name: Tigrinya (Ethiopia) default charset: UTF-8 OS Locale: tig_ER -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: tig_ER, Name: Tigre (Eritrea) +display locale: ID: tig_ER, Name: Tigre (Eritrea) +format locale: ID: tig_ER, Name: Tigre (Eritrea) default charset: UTF-8 OS Locale: tig_ER.utf8 -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: tig_ER, Name: Tigre (Eritrea) +display locale: ID: tig_ER, Name: Tigre (Eritrea) +format locale: ID: tig_ER, Name: Tigre (Eritrea) default charset: UTF-8 OS Locale: tl_PH @@ -3681,15 +3681,15 @@ format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) default charset: ISO-8859-1 OS Locale: uz_UZ.utf8@cyrillic -default locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) -display locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) -format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) +default locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) +display locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) +format locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) default charset: UTF-8 OS Locale: uz_UZ@cyrillic -default locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) -display locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) -format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) +default locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) +display locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) +format locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) default charset: UTF-8 OS Locale: ve_ZA diff --git a/jdk/test/java/util/Locale/data/deflocale.rhel5.fmtasdefault b/jdk/test/java/util/Locale/data/deflocale.rhel5.fmtasdefault index 4914d1833fc..12a12fdc349 100644 --- a/jdk/test/java/util/Locale/data/deflocale.rhel5.fmtasdefault +++ b/jdk/test/java/util/Locale/data/deflocale.rhel5.fmtasdefault @@ -465,15 +465,15 @@ format locale: ID: be_BY, Name: Belarusian (Belarus) default charset: UTF-8 OS Locale: be_BY.utf8@latin -default locale: ID: be_BY, Name: Belarusian (Belarus) -display locale: ID: be_BY, Name: Belarusian (Belarus) -format locale: ID: be_BY, Name: Belarusian (Belarus) +default locale: ID: be_BY_#Latn, Name: Belarusian (Latin,Belarus) +display locale: ID: be_BY_#Latn, Name: Belarusian (Latin,Belarus) +format locale: ID: be_BY_#Latn, Name: Belarusian (Latin,Belarus) default charset: UTF-8 OS Locale: be_BY@latin -default locale: ID: be_BY, Name: Belarusian (Belarus) -display locale: ID: be_BY, Name: Belarusian (Belarus) -format locale: ID: be_BY, Name: Belarusian (Belarus) +default locale: ID: be_BY_#Latn, Name: Belarusian (Latin,Belarus) +display locale: ID: be_BY_#Latn, Name: Belarusian (Latin,Belarus) +format locale: ID: be_BY_#Latn, Name: Belarusian (Latin,Belarus) default charset: UTF-8 OS Locale: bg_BG @@ -519,15 +519,15 @@ format locale: ID: bn_IN, Name: Bengali (India) default charset: UTF-8 OS Locale: bokmål -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: nb_NO, Name: Norwegian Bokmål (Norway) +display locale: ID: nb_NO, Name: Norwegian Bokmål (Norway) +format locale: ID: nb_NO, Name: Norwegian Bokmål (Norway) default charset: ISO-8859-1 OS Locale: bokmal -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: nb_NO, Name: Norwegian Bokmål (Norway) +display locale: ID: nb_NO, Name: Norwegian Bokmål (Norway) +format locale: ID: nb_NO, Name: Norwegian Bokmål (Norway) default charset: ISO-8859-1 OS Locale: br_FR @@ -579,15 +579,15 @@ format locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) default charset: UTF-8 OS Locale: byn_ER -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: byn_ER, Name: Blin (Eritrea) +display locale: ID: byn_ER, Name: Blin (Eritrea) +format locale: ID: byn_ER, Name: Blin (Eritrea) default charset: UTF-8 OS Locale: byn_ER.utf8 -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: byn_ER, Name: Blin (Eritrea) +display locale: ID: byn_ER, Name: Blin (Eritrea) +format locale: ID: byn_ER, Name: Blin (Eritrea) default charset: UTF-8 OS Locale: ca_AD @@ -705,15 +705,15 @@ format locale: ID: cs_CZ, Name: Czech (Czech Republic) default charset: UTF-8 OS Locale: csb_PL -default locale: ID: en_PL, Name: English (Poland) -display locale: ID: en_PL, Name: English (Poland) -format locale: ID: en_PL, Name: English (Poland) +default locale: ID: csb_PL, Name: Kashubian (Poland) +display locale: ID: csb_PL, Name: Kashubian (Poland) +format locale: ID: csb_PL, Name: Kashubian (Poland) default charset: UTF-8 OS Locale: csb_PL.utf8 -default locale: ID: en_PL, Name: English (Poland) -display locale: ID: en_PL, Name: English (Poland) -format locale: ID: en_PL, Name: English (Poland) +default locale: ID: csb_PL, Name: Kashubian (Poland) +display locale: ID: csb_PL, Name: Kashubian (Poland) +format locale: ID: csb_PL, Name: Kashubian (Poland) default charset: UTF-8 OS Locale: cy_GB @@ -939,9 +939,9 @@ format locale: ID: dz_BT, Name: Dzongkha (Bhutan) default charset: UTF-8 OS Locale: eesti -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: et_EE, Name: Estonian (Estonia) +display locale: ID: et_EE, Name: Estonian (Estonia) +format locale: ID: et_EE, Name: Estonian (Estonia) default charset: ISO-8859-1 OS Locale: el_CY @@ -1623,9 +1623,9 @@ format locale: ID: es_VE, Name: Spanish (Venezuela) default charset: UTF-8 OS Locale: estonian -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: et_EE, Name: Estonian (Estonia) +display locale: ID: et_EE, Name: Estonian (Estonia) +format locale: ID: et_EE, Name: Estonian (Estonia) default charset: ISO-8859-1 OS Locale: et_EE @@ -1929,15 +1929,15 @@ format locale: ID: ga_IE, Name: Irish (Ireland) default charset: ISO-8859-15 OS Locale: galego -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: gl_ES, Name: Gallegan (Spain) +display locale: ID: gl_ES, Name: Gallegan (Spain) +format locale: ID: gl_ES, Name: Gallegan (Spain) default charset: ISO-8859-1 OS Locale: galician -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: gl_ES, Name: Gallegan (Spain) +display locale: ID: gl_ES, Name: Gallegan (Spain) +format locale: ID: gl_ES, Name: Gallegan (Spain) default charset: ISO-8859-1 OS Locale: gd_GB @@ -1965,51 +1965,51 @@ format locale: ID: de_DE, Name: German (Germany) default charset: ISO-8859-1 OS Locale: gez_ER -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: gez_ER, Name: Geez (Eritrea) +display locale: ID: gez_ER, Name: Geez (Eritrea) +format locale: ID: gez_ER, Name: Geez (Eritrea) default charset: UTF-8 OS Locale: gez_ER.utf8 -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: gez_ER, Name: Geez (Eritrea) +display locale: ID: gez_ER, Name: Geez (Eritrea) +format locale: ID: gez_ER, Name: Geez (Eritrea) default charset: UTF-8 OS Locale: gez_ER.utf8@abegede -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: gez_ER, Name: Geez (Eritrea) +display locale: ID: gez_ER, Name: Geez (Eritrea) +format locale: ID: gez_ER, Name: Geez (Eritrea) default charset: UTF-8 OS Locale: gez_ER@abegede -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: gez_ER, Name: Geez (Eritrea) +display locale: ID: gez_ER, Name: Geez (Eritrea) +format locale: ID: gez_ER, Name: Geez (Eritrea) default charset: UTF-8 OS Locale: gez_ET -default locale: ID: en_ET, Name: English (Ethiopia) -display locale: ID: en_ET, Name: English (Ethiopia) -format locale: ID: en_ET, Name: English (Ethiopia) +default locale: ID: gez_ET, Name: Geez (Ethiopia) +display locale: ID: gez_ET, Name: Geez (Ethiopia) +format locale: ID: gez_ET, Name: Geez (Ethiopia) default charset: UTF-8 OS Locale: gez_ET.utf8 -default locale: ID: en_ET, Name: English (Ethiopia) -display locale: ID: en_ET, Name: English (Ethiopia) -format locale: ID: en_ET, Name: English (Ethiopia) +default locale: ID: gez_ET, Name: Geez (Ethiopia) +display locale: ID: gez_ET, Name: Geez (Ethiopia) +format locale: ID: gez_ET, Name: Geez (Ethiopia) default charset: UTF-8 OS Locale: gez_ET.utf8@abegede -default locale: ID: en_ET, Name: English (Ethiopia) -display locale: ID: en_ET, Name: English (Ethiopia) -format locale: ID: en_ET, Name: English (Ethiopia) +default locale: ID: gez_ET, Name: Geez (Ethiopia) +display locale: ID: gez_ET, Name: Geez (Ethiopia) +format locale: ID: gez_ET, Name: Geez (Ethiopia) default charset: UTF-8 OS Locale: gez_ET@abegede -default locale: ID: en_ET, Name: English (Ethiopia) -display locale: ID: en_ET, Name: English (Ethiopia) -format locale: ID: en_ET, Name: English (Ethiopia) +default locale: ID: gez_ET, Name: Geez (Ethiopia) +display locale: ID: gez_ET, Name: Geez (Ethiopia) +format locale: ID: gez_ET, Name: Geez (Ethiopia) default charset: UTF-8 OS Locale: gl_ES @@ -2139,21 +2139,21 @@ format locale: ID: hr_HR, Name: Croatian (Croatia) default charset: ISO-8859-2 OS Locale: hsb_DE -default locale: ID: en_DE, Name: English (Germany) -display locale: ID: en_DE, Name: English (Germany) -format locale: ID: en_DE, Name: English (Germany) +default locale: ID: hsb_DE, Name: Upper Sorbian (Germany) +display locale: ID: hsb_DE, Name: Upper Sorbian (Germany) +format locale: ID: hsb_DE, Name: Upper Sorbian (Germany) default charset: ISO-8859-2 OS Locale: hsb_DE.iso88592 -default locale: ID: en_DE, Name: English (Germany) -display locale: ID: en_DE, Name: English (Germany) -format locale: ID: en_DE, Name: English (Germany) +default locale: ID: hsb_DE, Name: Upper Sorbian (Germany) +display locale: ID: hsb_DE, Name: Upper Sorbian (Germany) +format locale: ID: hsb_DE, Name: Upper Sorbian (Germany) default charset: ISO-8859-2 OS Locale: hsb_DE.utf8 -default locale: ID: en_DE, Name: English (Germany) -display locale: ID: en_DE, Name: English (Germany) -format locale: ID: en_DE, Name: English (Germany) +default locale: ID: hsb_DE, Name: Upper Sorbian (Germany) +display locale: ID: hsb_DE, Name: Upper Sorbian (Germany) +format locale: ID: hsb_DE, Name: Upper Sorbian (Germany) default charset: UTF-8 OS Locale: hu_HU @@ -2445,15 +2445,15 @@ format locale: ID: ko_KR, Name: Korean (South Korea) default charset: UTF-8 OS Locale: korean -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: ko_KR, Name: Korean (South Korea) +display locale: ID: ko_KR, Name: Korean (South Korea) +format locale: ID: ko_KR, Name: Korean (South Korea) default charset: EUC-KR OS Locale: korean.euc -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: ko_KR, Name: Korean (South Korea) +display locale: ID: ko_KR, Name: Korean (South Korea) +format locale: ID: ko_KR, Name: Korean (South Korea) default charset: EUC-KR OS Locale: ku_TR @@ -2523,9 +2523,9 @@ format locale: ID: lg_UG, Name: Ganda (Uganda) default charset: UTF-8 OS Locale: lithuanian -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: lt_LT, Name: Lithuanian (Lithuania) +display locale: ID: lt_LT, Name: Lithuanian (Lithuania) +format locale: ID: lt_LT, Name: Lithuanian (Lithuania) default charset: ISO-8859-13 OS Locale: lo_LA @@ -2577,15 +2577,15 @@ format locale: ID: lv_LV, Name: Latvian (Latvia) default charset: UTF-8 OS Locale: mai_IN -default locale: ID: en_IN, Name: English (India) -display locale: ID: en_IN, Name: English (India) -format locale: ID: en_IN, Name: English (India) +default locale: ID: mai_IN, Name: Maithili (India) +display locale: ID: mai_IN, Name: Maithili (India) +format locale: ID: mai_IN, Name: Maithili (India) default charset: UTF-8 OS Locale: mai_IN.utf8 -default locale: ID: en_IN, Name: English (India) -display locale: ID: en_IN, Name: English (India) -format locale: ID: en_IN, Name: English (India) +default locale: ID: mai_IN, Name: Maithili (India) +display locale: ID: mai_IN, Name: Maithili (India) +format locale: ID: mai_IN, Name: Maithili (India) default charset: UTF-8 OS Locale: mg_MG @@ -2859,21 +2859,21 @@ format locale: ID: nr_ZA, Name: South Ndebele (South Africa) default charset: UTF-8 OS Locale: nso_ZA -default locale: ID: en_ZA, Name: English (South Africa) -display locale: ID: en_ZA, Name: English (South Africa) -format locale: ID: en_ZA, Name: English (South Africa) +default locale: ID: nso_ZA, Name: Pedi (South Africa) +display locale: ID: nso_ZA, Name: Pedi (South Africa) +format locale: ID: nso_ZA, Name: Pedi (South Africa) default charset: UTF-8 OS Locale: nso_ZA.utf8 -default locale: ID: en_ZA, Name: English (South Africa) -display locale: ID: en_ZA, Name: English (South Africa) -format locale: ID: en_ZA, Name: English (South Africa) +default locale: ID: nso_ZA, Name: Pedi (South Africa) +display locale: ID: nso_ZA, Name: Pedi (South Africa) +format locale: ID: nso_ZA, Name: Pedi (South Africa) default charset: UTF-8 OS Locale: nynorsk -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: nn_NO, Name: Norwegian Nynorsk (Norway) +display locale: ID: nn_NO, Name: Norwegian Nynorsk (Norway) +format locale: ID: nn_NO, Name: Norwegian Nynorsk (Norway) default charset: ISO-8859-1 OS Locale: oc_FR @@ -3147,15 +3147,15 @@ format locale: ID: si_LK, Name: Sinhalese (Sri Lanka) default charset: UTF-8 OS Locale: sid_ET -default locale: ID: en_ET, Name: English (Ethiopia) -display locale: ID: en_ET, Name: English (Ethiopia) -format locale: ID: en_ET, Name: English (Ethiopia) +default locale: ID: sid_ET, Name: Sidamo (Ethiopia) +display locale: ID: sid_ET, Name: Sidamo (Ethiopia) +format locale: ID: sid_ET, Name: Sidamo (Ethiopia) default charset: UTF-8 OS Locale: sid_ET.utf8 -default locale: ID: en_ET, Name: English (Ethiopia) -display locale: ID: en_ET, Name: English (Ethiopia) -format locale: ID: en_ET, Name: English (Ethiopia) +default locale: ID: sid_ET, Name: Sidamo (Ethiopia) +display locale: ID: sid_ET, Name: Sidamo (Ethiopia) +format locale: ID: sid_ET, Name: Sidamo (Ethiopia) default charset: UTF-8 OS Locale: sk_SK @@ -3321,39 +3321,39 @@ format locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) default charset: UTF-8 OS Locale: sr_ME -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_ME, Name: Serbian (Montenegro) +display locale: ID: sr_ME, Name: Serbian (Montenegro) +format locale: ID: sr_ME, Name: Serbian (Montenegro) default charset: UTF-8 OS Locale: sr_ME.utf8 -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_ME, Name: Serbian (Montenegro) +display locale: ID: sr_ME, Name: Serbian (Montenegro) +format locale: ID: sr_ME, Name: Serbian (Montenegro) default charset: UTF-8 OS Locale: sr_RS -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_RS, Name: Serbian (Serbia) +display locale: ID: sr_RS, Name: Serbian (Serbia) +format locale: ID: sr_RS, Name: Serbian (Serbia) default charset: UTF-8 OS Locale: sr_RS.utf8 -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_RS, Name: Serbian (Serbia) +display locale: ID: sr_RS, Name: Serbian (Serbia) +format locale: ID: sr_RS, Name: Serbian (Serbia) default charset: UTF-8 OS Locale: sr_RS.utf8@latin -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) +display locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) +format locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) default charset: UTF-8 OS Locale: sr_RS@latin -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) +display locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) +format locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) default charset: UTF-8 OS Locale: ss_ZA @@ -3507,9 +3507,9 @@ format locale: ID: th_TH, Name: Thai (Thailand) default charset: UTF-8 OS Locale: thai -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English +default locale: ID: th_TH, Name: Thai (Thailand) +display locale: ID: th_TH, Name: Thai (Thailand) +format locale: ID: th_TH, Name: Thai (Thailand) default charset: TIS-620 OS Locale: ti_ER @@ -3537,15 +3537,15 @@ format locale: ID: ti_ET, Name: Tigrinya (Ethiopia) default charset: UTF-8 OS Locale: tig_ER -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: tig_ER, Name: Tigre (Eritrea) +display locale: ID: tig_ER, Name: Tigre (Eritrea) +format locale: ID: tig_ER, Name: Tigre (Eritrea) default charset: UTF-8 OS Locale: tig_ER.utf8 -default locale: ID: en_ER, Name: English (Eritrea) -display locale: ID: en_ER, Name: English (Eritrea) -format locale: ID: en_ER, Name: English (Eritrea) +default locale: ID: tig_ER, Name: Tigre (Eritrea) +display locale: ID: tig_ER, Name: Tigre (Eritrea) +format locale: ID: tig_ER, Name: Tigre (Eritrea) default charset: UTF-8 OS Locale: tl_PH @@ -3681,15 +3681,15 @@ format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) default charset: ISO-8859-1 OS Locale: uz_UZ.utf8@cyrillic -default locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) -display locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) -format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) +default locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) +display locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) +format locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) default charset: UTF-8 OS Locale: uz_UZ@cyrillic -default locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) -display locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) -format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) +default locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) +display locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) +format locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) default charset: UTF-8 OS Locale: ve_ZA diff --git a/jdk/test/java/util/Locale/data/deflocale.sh b/jdk/test/java/util/Locale/data/deflocale.sh index 161f0b66818..b0ee6f82090 100644 --- a/jdk/test/java/util/Locale/data/deflocale.sh +++ b/jdk/test/java/util/Locale/data/deflocale.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/Locale/data/deflocale.sol10 b/jdk/test/java/util/Locale/data/deflocale.sol10 index 1bd4a9884c2..5728b88aa61 100644 --- a/jdk/test/java/util/Locale/data/deflocale.sol10 +++ b/jdk/test/java/util/Locale/data/deflocale.sol10 @@ -1128,9 +1128,9 @@ format locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk) default charset: ISO-8859-1 OS Locale: no_NY -default locale: ID: no_, Name: Norwegian () -display locale: ID: no_, Name: Norwegian () -format locale: ID: no_, Name: Norwegian () +default locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk) +display locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk) +format locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk) default charset: ISO-8859-1 OS Locale: nr @@ -1332,9 +1332,9 @@ format locale: ID: sq_AL, Name: Albanian (Albania) default charset: ISO-8859-2 OS Locale: sr_SP -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) +display locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) +format locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) default charset: ISO-8859-5 OS Locale: sr_YU @@ -1721,5 +1721,5 @@ default charset: UTF-8 OS Locale (LC_CTYPE: C, LC_MESSAGES: zh_CN.UTF-8) default locale: ID: zh_CN, Name: Chinese (China) display locale: ID: zh_CN, Name: Chinese (China) -format locale: ID: en, Name: English +format locale: ID: en_CN, Name: English (China) default charset: US-ASCII diff --git a/jdk/test/java/util/Locale/data/deflocale.sol10.fmtasdefault b/jdk/test/java/util/Locale/data/deflocale.sol10.fmtasdefault index cea4b7e4430..2e52574c192 100644 --- a/jdk/test/java/util/Locale/data/deflocale.sol10.fmtasdefault +++ b/jdk/test/java/util/Locale/data/deflocale.sol10.fmtasdefault @@ -1128,9 +1128,9 @@ format locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk) default charset: ISO-8859-1 OS Locale: no_NY -default locale: ID: no_, Name: Norwegian () -display locale: ID: no_, Name: Norwegian () -format locale: ID: no_, Name: Norwegian () +default locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk) +display locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk) +format locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk) default charset: ISO-8859-1 OS Locale: nr @@ -1332,9 +1332,9 @@ format locale: ID: sq_AL, Name: Albanian (Albania) default charset: ISO-8859-2 OS Locale: sr_SP -default locale: ID: sr, Name: Serbian -display locale: ID: sr, Name: Serbian -format locale: ID: sr, Name: Serbian +default locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) +display locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) +format locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) default charset: ISO-8859-5 OS Locale: sr_YU diff --git a/jdk/test/java/util/Locale/data/deflocale.win7 b/jdk/test/java/util/Locale/data/deflocale.win7 index 9eb68e4b702..babc6e1ea42 100644 --- a/jdk/test/java/util/Locale/data/deflocale.win7 +++ b/jdk/test/java/util/Locale/data/deflocale.win7 @@ -1,1493 +1,1493 @@ -# OSVersionInfo -# MajorVersion: 6 -# MinorVersion: 1 -# BuildNumber: 7600 -# CSDVersion: - - -OS Locale (lcid: 7f, name: ): Invariant Language (Invariant Country) - 1252 +# OSVersionInfo +# MajorVersion: 6 +# MinorVersion: 1 +# BuildNumber: 7600 +# CSDVersion: + + +OS Locale (lcid: 7f, name: ): Invariant Language (Invariant Country) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: en_US, Name: English (United States) default charset: windows-1252 - -OS Locale (lcid: 401, name: ar-SA): Arabic (Saudi Arabia) - 1256 + +OS Locale (lcid: 401, name: ar-SA): Arabic (Saudi Arabia) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_SA, Name: Arabic (Saudi Arabia) default charset: windows-1252 - -OS Locale (lcid: 402, name: bg-BG): Bulgarian (Bulgaria) - 1251 + +OS Locale (lcid: 402, name: bg-BG): Bulgarian (Bulgaria) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: bg_BG, Name: Bulgarian (Bulgaria) default charset: windows-1252 - -OS Locale (lcid: 403, name: ca-ES): Catalan (Spain) - 1252 + +OS Locale (lcid: 403, name: ca-ES): Catalan (Spain) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ca_ES, Name: Catalan (Spain) default charset: windows-1252 - -OS Locale (lcid: 404, name: zh-TW): Chinese (Traditional) (Taiwan) - 950 + +OS Locale (lcid: 404, name: zh-TW): Chinese (Traditional) (Taiwan) - 950 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_TW, Name: Chinese (Taiwan) default charset: windows-1252 - -OS Locale (lcid: 405, name: cs-CZ): Czech (Czech Republic) - 1250 + +OS Locale (lcid: 405, name: cs-CZ): Czech (Czech Republic) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: cs_CZ, Name: Czech (Czech Republic) default charset: windows-1252 - -OS Locale (lcid: 406, name: da-DK): Danish (Denmark) - 1252 + +OS Locale (lcid: 406, name: da-DK): Danish (Denmark) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: da_DK, Name: Danish (Denmark) default charset: windows-1252 - -OS Locale (lcid: 407, name: de-DE): German (Germany) - 1252 + +OS Locale (lcid: 407, name: de-DE): German (Germany) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: de_DE, Name: German (Germany) default charset: windows-1252 - -OS Locale (lcid: 408, name: el-GR): Greek (Greece) - 1253 + +OS Locale (lcid: 408, name: el-GR): Greek (Greece) - 1253 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: el_GR, Name: Greek (Greece) default charset: windows-1252 - -OS Locale (lcid: 409, name: en-US): English (United States) - 1252 + +OS Locale (lcid: 409, name: en-US): English (United States) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: en_US, Name: English (United States) default charset: windows-1252 - -OS Locale (lcid: 40b, name: fi-FI): Finnish (Finland) - 1252 + +OS Locale (lcid: 40b, name: fi-FI): Finnish (Finland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: fi_FI, Name: Finnish (Finland) default charset: windows-1252 - -OS Locale (lcid: 40c, name: fr-FR): French (France) - 1252 + +OS Locale (lcid: 40c, name: fr-FR): French (France) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: fr_FR, Name: French (France) default charset: windows-1252 - -OS Locale (lcid: 40d, name: he-IL): Hebrew (Israel) - 1255 + +OS Locale (lcid: 40d, name: he-IL): Hebrew (Israel) - 1255 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: iw_IL, Name: Hebrew (Israel) default charset: windows-1252 - -OS Locale (lcid: 40e, name: hu-HU): Hungarian (Hungary) - 1250 + +OS Locale (lcid: 40e, name: hu-HU): Hungarian (Hungary) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: hu_HU, Name: Hungarian (Hungary) default charset: windows-1252 - -OS Locale (lcid: 40f, name: is-IS): Icelandic (Iceland) - 1252 + +OS Locale (lcid: 40f, name: is-IS): Icelandic (Iceland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: is_IS, Name: Icelandic (Iceland) default charset: windows-1252 - -OS Locale (lcid: 410, name: it-IT): Italian (Italy) - 1252 + +OS Locale (lcid: 410, name: it-IT): Italian (Italy) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: it_IT, Name: Italian (Italy) default charset: windows-1252 - -OS Locale (lcid: 411, name: ja-JP): Japanese (Japan) - 932 + +OS Locale (lcid: 411, name: ja-JP): Japanese (Japan) - 932 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ja_JP, Name: Japanese (Japan) default charset: windows-1252 - -OS Locale (lcid: 412, name: ko-KR): Korean (Korea) - 949 + +OS Locale (lcid: 412, name: ko-KR): Korean (Korea) - 949 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ko_KR, Name: Korean (South Korea) default charset: windows-1252 - -OS Locale (lcid: 413, name: nl-NL): Dutch (Netherlands) - 1252 + +OS Locale (lcid: 413, name: nl-NL): Dutch (Netherlands) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: nl_NL, Name: Dutch (Netherlands) default charset: windows-1252 - -OS Locale (lcid: 414, name: nb-NO): Norwegian (Bokmål) (Norway) - 1252 + +OS Locale (lcid: 414, name: nb-NO): Norwegian (Bokm…l) (Norway) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: no_NO, Name: Norwegian (Norway) default charset: windows-1252 - -OS Locale (lcid: 415, name: pl-PL): Polish (Poland) - 1250 + +OS Locale (lcid: 415, name: pl-PL): Polish (Poland) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: pl_PL, Name: Polish (Poland) default charset: windows-1252 - -OS Locale (lcid: 416, name: pt-BR): Portuguese (Brazil) - 1252 + +OS Locale (lcid: 416, name: pt-BR): Portuguese (Brazil) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: pt_BR, Name: Portuguese (Brazil) default charset: windows-1252 - -OS Locale (lcid: 417, name: rm-CH): Romansh (Switzerland) - 1252 + +OS Locale (lcid: 417, name: rm-CH): Romansh (Switzerland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: rm_CH, Name: Raeto-Romance (Switzerland) default charset: windows-1252 - -OS Locale (lcid: 418, name: ro-RO): Romanian (Romania) - 1250 + +OS Locale (lcid: 418, name: ro-RO): Romanian (Romania) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ro_RO, Name: Romanian (Romania) default charset: windows-1252 - -OS Locale (lcid: 419, name: ru-RU): Russian (Russia) - 1251 + +OS Locale (lcid: 419, name: ru-RU): Russian (Russia) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ru_RU, Name: Russian (Russia) default charset: windows-1252 - -OS Locale (lcid: 41a, name: hr-HR): Croatian (Croatia) - 1250 + +OS Locale (lcid: 41a, name: hr-HR): Croatian (Croatia) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: hr_HR, Name: Croatian (Croatia) default charset: windows-1252 - -OS Locale (lcid: 41b, name: sk-SK): Slovak (Slovakia) - 1250 + +OS Locale (lcid: 41b, name: sk-SK): Slovak (Slovakia) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: sk_SK, Name: Slovak (Slovakia) default charset: windows-1252 - -OS Locale (lcid: 41c, name: sq-AL): Albanian (Albania) - 1250 + +OS Locale (lcid: 41c, name: sq-AL): Albanian (Albania) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: sq_AL, Name: Albanian (Albania) default charset: windows-1252 - -OS Locale (lcid: 41d, name: sv-SE): Swedish (Sweden) - 1252 + +OS Locale (lcid: 41d, name: sv-SE): Swedish (Sweden) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: sv_SE, Name: Swedish (Sweden) default charset: windows-1252 - -OS Locale (lcid: 41e, name: th-TH): Thai (Thailand) - 874 + +OS Locale (lcid: 41e, name: th-TH): Thai (Thailand) - 874 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: th_TH, Name: Thai (Thailand) default charset: windows-1252 - -OS Locale (lcid: 41f, name: tr-TR): Turkish (Turkey) - 1254 + +OS Locale (lcid: 41f, name: tr-TR): Turkish (Turkey) - 1254 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: tr_TR, Name: Turkish (Turkey) default charset: windows-1252 - -OS Locale (lcid: 420, name: ur-PK): Urdu (Islamic Republic of Pakistan) - 1256 + +OS Locale (lcid: 420, name: ur-PK): Urdu (Islamic Republic of Pakistan) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ur_PK, Name: Urdu (Pakistan) default charset: windows-1252 - -OS Locale (lcid: 421, name: id-ID): Indonesian (Indonesia) - 1252 + +OS Locale (lcid: 421, name: id-ID): Indonesian (Indonesia) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: in_ID, Name: Indonesian (Indonesia) default charset: windows-1252 - -OS Locale (lcid: 422, name: uk-UA): Ukrainian (Ukraine) - 1251 + +OS Locale (lcid: 422, name: uk-UA): Ukrainian (Ukraine) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: uk_UA, Name: Ukrainian (Ukraine) default charset: windows-1252 - -OS Locale (lcid: 423, name: be-BY): Belarusian (Belarus) - 1251 + +OS Locale (lcid: 423, name: be-BY): Belarusian (Belarus) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: be_BY, Name: Belarusian (Belarus) default charset: windows-1252 - -OS Locale (lcid: 424, name: sl-SI): Slovenian (Slovenia) - 1250 + +OS Locale (lcid: 424, name: sl-SI): Slovenian (Slovenia) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: sl_SI, Name: Slovenian (Slovenia) default charset: windows-1252 - -OS Locale (lcid: 425, name: et-EE): Estonian (Estonia) - 1257 + +OS Locale (lcid: 425, name: et-EE): Estonian (Estonia) - 1257 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: et_EE, Name: Estonian (Estonia) default charset: windows-1252 - -OS Locale (lcid: 426, name: lv-LV): Latvian (Latvia) - 1257 + +OS Locale (lcid: 426, name: lv-LV): Latvian (Latvia) - 1257 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: lv_LV, Name: Latvian (Latvia) default charset: windows-1252 - -OS Locale (lcid: 427, name: lt-LT): Lithuanian (Lithuania) - 1257 + +OS Locale (lcid: 427, name: lt-LT): Lithuanian (Lithuania) - 1257 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: lt_LT, Name: Lithuanian (Lithuania) default charset: windows-1252 - -OS Locale (lcid: 428, name: tg-Cyrl-TJ): Tajik (Cyrillic) (Tajikistan) - 1251 + +OS Locale (lcid: 428, name: tg-Cyrl-TJ): Tajik (Cyrillic) (Tajikistan) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: tg_TJ, Name: Tajik (Tajikistan) +format locale: ID: tg_TJ_#Cyrl, Name: Tajik (Cyrillic,Tajikistan) default charset: windows-1252 - -OS Locale (lcid: 428, name: tg-Cyrl): Tajik (Cyrillic) (Tajikistan) - 1251 + +OS Locale (lcid: 428, name: tg-Cyrl): Tajik (Cyrillic) (Tajikistan) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: tg_TJ, Name: Tajik (Tajikistan) +format locale: ID: tg_TJ_#Cyrl, Name: Tajik (Cyrillic,Tajikistan) default charset: windows-1252 - -OS Locale (lcid: 429, name: fa-IR): Persian (Iran) - 1256 + +OS Locale (lcid: 429, name: fa-IR): Persian (Iran) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: fa_IR, Name: Persian (Iran) default charset: windows-1252 - -OS Locale (lcid: 42a, name: vi-VN): Vietnamese (Vietnam) - 1258 + +OS Locale (lcid: 42a, name: vi-VN): Vietnamese (Vietnam) - 1258 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: vi_VN, Name: Vietnamese (Vietnam) default charset: windows-1252 - -OS Locale (lcid: 42b, name: hy-AM): Armenian (Armenia) - 0 + +OS Locale (lcid: 42b, name: hy-AM): Armenian (Armenia) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: hy_AM, Name: Armenian (Armenia) default charset: windows-1252 - -OS Locale (lcid: 42c, name: az-Latn-AZ): Azeri (Latin) (Azerbaijan) - 1254 + +OS Locale (lcid: 42c, name: az-Latn-AZ): Azeri (Latin) (Azerbaijan) - 1254 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: az_AZ, Name: Azerbaijani (Azerbaijan) +format locale: ID: az_AZ_#Latn, Name: Azerbaijani (Latin,Azerbaijan) default charset: windows-1252 - -OS Locale (lcid: 42c, name: az-Latn): Azeri (Latin) (Azerbaijan) - 1254 + +OS Locale (lcid: 42c, name: az-Latn): Azeri (Latin) (Azerbaijan) - 1254 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: az_AZ, Name: Azerbaijani (Azerbaijan) +format locale: ID: az_AZ_#Latn, Name: Azerbaijani (Latin,Azerbaijan) default charset: windows-1252 - -OS Locale (lcid: 42d, name: eu-ES): Basque (Spain) - 1252 + +OS Locale (lcid: 42d, name: eu-ES): Basque (Spain) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: eu_ES, Name: Basque (Spain) default charset: windows-1252 - -OS Locale (lcid: 42e, name: hsb-DE): Upper Sorbian (Germany) - 1252 + +OS Locale (lcid: 42e, name: hsb-DE): Upper Sorbian (Germany) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: hsb_DE, Name: Upper Sorbian (Germany) default charset: windows-1252 - -OS Locale (lcid: 42e, name: hsb): Upper Sorbian (Germany) - 1252 + +OS Locale (lcid: 42e, name: hsb): Upper Sorbian (Germany) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: hsb_DE, Name: Upper Sorbian (Germany) default charset: windows-1252 - -OS Locale (lcid: 42f, name: mk-MK): Macedonian (FYROM) (Macedonia (FYROM)) - 1251 + +OS Locale (lcid: 42f, name: mk-MK): Macedonian (FYROM) (Macedonia (FYROM)) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: mk_MK, Name: Macedonian (Macedonia) default charset: windows-1252 - -OS Locale (lcid: 432, name: tn-ZA): Setswana (South Africa) - 1252 + +OS Locale (lcid: 432, name: tn-ZA): Setswana (South Africa) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: tn_ZA, Name: Tswana (South Africa) default charset: windows-1252 - -OS Locale (lcid: 434, name: xh-ZA): isiXhosa (South Africa) - 1252 + +OS Locale (lcid: 434, name: xh-ZA): isiXhosa (South Africa) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: xh_ZA, Name: Xhosa (South Africa) default charset: windows-1252 - -OS Locale (lcid: 435, name: zu-ZA): isiZulu (South Africa) - 1252 + +OS Locale (lcid: 435, name: zu-ZA): isiZulu (South Africa) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: zu_ZA, Name: Zulu (South Africa) default charset: windows-1252 - -OS Locale (lcid: 436, name: af-ZA): Afrikaans (South Africa) - 1252 + +OS Locale (lcid: 436, name: af-ZA): Afrikaans (South Africa) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: af_ZA, Name: Afrikaans (South Africa) default charset: windows-1252 - -OS Locale (lcid: 437, name: ka-GE): Georgian (Georgia) - 0 + +OS Locale (lcid: 437, name: ka-GE): Georgian (Georgia) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ka_GE, Name: Georgian (Georgia) default charset: windows-1252 - -OS Locale (lcid: 438, name: fo-FO): Faroese (Faroe Islands) - 1252 + +OS Locale (lcid: 438, name: fo-FO): Faroese (Faroe Islands) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: fo_FO, Name: Faroese (Faroe Islands) default charset: windows-1252 - -OS Locale (lcid: 439, name: hi-IN): Hindi (India) - 0 + +OS Locale (lcid: 439, name: hi-IN): Hindi (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: hi_IN, Name: Hindi (India) default charset: windows-1252 - -OS Locale (lcid: 43a, name: mt-MT): Maltese (Malta) - 0 + +OS Locale (lcid: 43a, name: mt-MT): Maltese (Malta) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: mt_MT, Name: Maltese (Malta) default charset: windows-1252 - -OS Locale (lcid: 43b, name: se-NO): Sami (Northern) (Norway) - 1252 + +OS Locale (lcid: 43b, name: se-NO): Sami (Northern) (Norway) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: se_NO, Name: Northern Sami (Norway) default charset: windows-1252 - -OS Locale (lcid: 43e, name: ms-MY): Malay (Malaysia) - 1252 + +OS Locale (lcid: 43e, name: ms-MY): Malay (Malaysia) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ms_MY, Name: Malay (Malaysia) default charset: windows-1252 - -OS Locale (lcid: 43f, name: kk-KZ): Kazakh (Kazakhstan) - 0 + +OS Locale (lcid: 43f, name: kk-KZ): Kazakh (Kazakhstan) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: kk_KZ, Name: Kazakh (Kazakhstan) default charset: windows-1252 - -OS Locale (lcid: 440, name: ky-KG): Kyrgyz (Kyrgyzstan) - 1251 + +OS Locale (lcid: 440, name: ky-KG): Kyrgyz (Kyrgyzstan) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ky_KG, Name: Kirghiz (Kyrgyzstan) default charset: windows-1252 - -OS Locale (lcid: 441, name: sw-KE): Kiswahili (Kenya) - 1252 + +OS Locale (lcid: 441, name: sw-KE): Kiswahili (Kenya) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: sw_KE, Name: Swahili (Kenya) default charset: windows-1252 - -OS Locale (lcid: 442, name: tk-TM): Turkmen (Turkmenistan) - 1250 + +OS Locale (lcid: 442, name: tk-TM): Turkmen (Turkmenistan) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: tk_TM, Name: Turkmen (Turkmenistan) default charset: windows-1252 - -OS Locale (lcid: 443, name: uz-Latn): Uzbek (Latin) (Uzbekistan) - 1254 + +OS Locale (lcid: 443, name: uz-Latn): Uzbek (Latin) (Uzbekistan) - 1254 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) +format locale: ID: uz_UZ_#Latn, Name: Uzbek (Latin,Uzbekistan) default charset: windows-1252 - -OS Locale (lcid: 443, name: uz-Latn-UZ): Uzbek (Latin) (Uzbekistan) - 1254 + +OS Locale (lcid: 443, name: uz-Latn-UZ): Uzbek (Latin) (Uzbekistan) - 1254 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) +format locale: ID: uz_UZ_#Latn, Name: Uzbek (Latin,Uzbekistan) default charset: windows-1252 - -OS Locale (lcid: 444, name: tt-RU): Tatar (Russia) - 1251 + +OS Locale (lcid: 444, name: tt-RU): Tatar (Russia) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: tt_RU, Name: Tatar (Russia) default charset: windows-1252 - -OS Locale (lcid: 445, name: bn-IN): Bengali (India) - 0 + +OS Locale (lcid: 445, name: bn-IN): Bengali (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: bn_IN, Name: Bengali (India) default charset: windows-1252 - -OS Locale (lcid: 446, name: pa-IN): Punjabi (India) - 0 + +OS Locale (lcid: 446, name: pa-IN): Punjabi (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: pa_IN, Name: Panjabi (India) default charset: windows-1252 - -OS Locale (lcid: 447, name: gu-IN): Gujarati (India) - 0 + +OS Locale (lcid: 447, name: gu-IN): Gujarati (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: gu_IN, Name: Gujarati (India) default charset: windows-1252 - -OS Locale (lcid: 448, name: or-IN): Oriya (India) - 0 + +OS Locale (lcid: 448, name: or-IN): Oriya (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: or_IN, Name: Oriya (India) default charset: windows-1252 - -OS Locale (lcid: 449, name: ta-IN): Tamil (India) - 0 + +OS Locale (lcid: 449, name: ta-IN): Tamil (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ta_IN, Name: Tamil (India) default charset: windows-1252 - -OS Locale (lcid: 44a, name: te-IN): Telugu (India) - 0 + +OS Locale (lcid: 44a, name: te-IN): Telugu (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: te_IN, Name: Telugu (India) default charset: windows-1252 - -OS Locale (lcid: 44b, name: kn-IN): Kannada (India) - 0 + +OS Locale (lcid: 44b, name: kn-IN): Kannada (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: kn_IN, Name: Kannada (India) default charset: windows-1252 - -OS Locale (lcid: 44c, name: ml-IN): Malayalam (India) - 0 + +OS Locale (lcid: 44c, name: ml-IN): Malayalam (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ml_IN, Name: Malayalam (India) default charset: windows-1252 - -OS Locale (lcid: 44d, name: as-IN): Assamese (India) - 0 + +OS Locale (lcid: 44d, name: as-IN): Assamese (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: as_IN, Name: Assamese (India) default charset: windows-1252 - -OS Locale (lcid: 44e, name: mr-IN): Marathi (India) - 0 + +OS Locale (lcid: 44e, name: mr-IN): Marathi (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: mr_IN, Name: Marathi (India) default charset: windows-1252 - -OS Locale (lcid: 44f, name: sa-IN): Sanskrit (India) - 0 + +OS Locale (lcid: 44f, name: sa-IN): Sanskrit (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: sa_IN, Name: Sanskrit (India) default charset: windows-1252 - -OS Locale (lcid: 450, name: mn-MN): Mongolian (Cyrillic) (Mongolia) - 1251 + +OS Locale (lcid: 450, name: mn-MN): Mongolian (Cyrillic) (Mongolia) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: mn_MN, Name: Mongolian (Mongolia) default charset: windows-1252 - -OS Locale (lcid: 450, name: mn-Cyrl): Mongolian (Cyrillic) (Mongolia) - 1251 + +OS Locale (lcid: 450, name: mn-Cyrl): Mongolian (Cyrillic) (Mongolia) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: mn_MN, Name: Mongolian (Mongolia) default charset: windows-1252 - -OS Locale (lcid: 451, name: bo-CN): Tibetan (People's Republic of China) - 0 + +OS Locale (lcid: 451, name: bo-CN): Tibetan (People's Republic of China) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: bo_CN, Name: Tibetan (China) default charset: windows-1252 - -OS Locale (lcid: 452, name: cy-GB): Welsh (United Kingdom) - 1252 + +OS Locale (lcid: 452, name: cy-GB): Welsh (United Kingdom) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: cy_GB, Name: Welsh (United Kingdom) default charset: windows-1252 - -OS Locale (lcid: 453, name: km-KH): Khmer (Cambodia) - 0 + +OS Locale (lcid: 453, name: km-KH): Khmer (Cambodia) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: km_KH, Name: Khmer (Cambodia) default charset: windows-1252 - -OS Locale (lcid: 454, name: lo-LA): Lao (Lao P.D.R.) - 0 + +OS Locale (lcid: 454, name: lo-LA): Lao (Lao P.D.R.) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: lo_LA, Name: Lao (Laos) default charset: windows-1252 - -OS Locale (lcid: 456, name: gl-ES): Galician (Spain) - 1252 + +OS Locale (lcid: 456, name: gl-ES): Galician (Spain) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: gl_ES, Name: Gallegan (Spain) default charset: windows-1252 - -OS Locale (lcid: 457, name: kok-IN): Konkani (India) - 0 + +OS Locale (lcid: 457, name: kok-IN): Konkani (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: kok_IN, Name: Konkani (India) default charset: windows-1252 - -OS Locale (lcid: 457, name: kok): Konkani (India) - 0 + +OS Locale (lcid: 457, name: kok): Konkani (India) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: kok_IN, Name: Konkani (India) default charset: windows-1252 - -OS Locale (lcid: 45a, name: syr): Syriac (Syria) - 0 + +OS Locale (lcid: 45a, name: syr): Syriac (Syria) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: syr_SY, Name: Syriac (Syria) default charset: windows-1252 - -OS Locale (lcid: 45a, name: syr-SY): Syriac (Syria) - 0 + +OS Locale (lcid: 45a, name: syr-SY): Syriac (Syria) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: syr_SY, Name: Syriac (Syria) default charset: windows-1252 - -OS Locale (lcid: 45b, name: si-LK): Sinhala (Sri Lanka) - 0 + +OS Locale (lcid: 45b, name: si-LK): Sinhala (Sri Lanka) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: si_LK, Name: Sinhalese (Sri Lanka) default charset: windows-1252 - -OS Locale (lcid: 45d, name: iu-Cans-CA): Inuktitut (Syllabics) (Canada) - 0 + +OS Locale (lcid: 45d, name: iu-Cans-CA): Inuktitut (Syllabics) (Canada) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: iu_CA, Name: Inuktitut (Canada) +format locale: ID: iu_CA_#Cans, Name: Inuktitut (Unified Canadian Aboriginal Syllabics,Canada) default charset: windows-1252 - -OS Locale (lcid: 45d, name: iu-Cans): Inuktitut (Syllabics) (Canada) - 0 + +OS Locale (lcid: 45d, name: iu-Cans): Inuktitut (Syllabics) (Canada) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: iu_CA, Name: Inuktitut (Canada) +format locale: ID: iu_CA_#Cans, Name: Inuktitut (Unified Canadian Aboriginal Syllabics,Canada) default charset: windows-1252 - -OS Locale (lcid: 45e, name: am-ET): Amharic (Ethiopia) - 0 + +OS Locale (lcid: 45e, name: am-ET): Amharic (Ethiopia) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: am_ET, Name: Amharic (Ethiopia) default charset: windows-1252 - -OS Locale (lcid: 461, name: ne-NP): Nepali (Nepal) - 0 + +OS Locale (lcid: 461, name: ne-NP): Nepali (Nepal) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ne_NP, Name: Nepali (Nepal) default charset: windows-1252 - -OS Locale (lcid: 462, name: fy-NL): Frisian (Netherlands) - 1252 + +OS Locale (lcid: 462, name: fy-NL): Frisian (Netherlands) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: fy_NL, Name: Frisian (Netherlands) default charset: windows-1252 - -OS Locale (lcid: 463, name: ps-AF): Pashto (Afghanistan) - 0 + +OS Locale (lcid: 463, name: ps-AF): Pashto (Afghanistan) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ps_AF, Name: Pushto (Afghanistan) default charset: windows-1252 - -OS Locale (lcid: 464, name: fil-PH): Filipino (Philippines) - 1252 + +OS Locale (lcid: 464, name: fil-PH): Filipino (Philippines) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: fil_PH, Name: Filipino (Philippines) default charset: windows-1252 - -OS Locale (lcid: 464, name: fil): Filipino (Philippines) - 1252 + +OS Locale (lcid: 464, name: fil): Filipino (Philippines) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: fil_PH, Name: Filipino (Philippines) default charset: windows-1252 - -OS Locale (lcid: 465, name: dv-MV): Divehi (Maldives) - 0 + +OS Locale (lcid: 465, name: dv-MV): Divehi (Maldives) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: dv_MV, Name: Divehi (Maldives) default charset: windows-1252 - -OS Locale (lcid: 468, name: ha-Latn-NG): Hausa (Latin) (Nigeria) - 1252 + +OS Locale (lcid: 468, name: ha-Latn-NG): Hausa (Latin) (Nigeria) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: ha_NG, Name: Hausa (Nigeria) +format locale: ID: ha_NG_#Latn, Name: Hausa (Latin,Nigeria) default charset: windows-1252 - -OS Locale (lcid: 468, name: ha-Latn): Hausa (Latin) (Nigeria) - 1252 + +OS Locale (lcid: 468, name: ha-Latn): Hausa (Latin) (Nigeria) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: ha_NG, Name: Hausa (Nigeria) +format locale: ID: ha_NG_#Latn, Name: Hausa (Latin,Nigeria) default charset: windows-1252 - -OS Locale (lcid: 46a, name: yo-NG): Yoruba (Nigeria) - 1252 + +OS Locale (lcid: 46a, name: yo-NG): Yoruba (Nigeria) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: yo_NG, Name: Yoruba (Nigeria) default charset: windows-1252 - -OS Locale (lcid: 46b, name: quz): Quechua (Bolivia) - 1252 + +OS Locale (lcid: 46b, name: quz): Quechua (Bolivia) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: quz_BO, Name: quz (Bolivia) default charset: windows-1252 - -OS Locale (lcid: 46b, name: quz-BO): Quechua (Bolivia) - 1252 + +OS Locale (lcid: 46b, name: quz-BO): Quechua (Bolivia) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: quz_BO, Name: quz (Bolivia) default charset: windows-1252 - -OS Locale (lcid: 46c, name: nso): Sesotho sa Leboa (South Africa) - 1252 + +OS Locale (lcid: 46c, name: nso): Sesotho sa Leboa (South Africa) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: nso_ZA, Name: Pedi (South Africa) default charset: windows-1252 - -OS Locale (lcid: 46c, name: nso-ZA): Sesotho sa Leboa (South Africa) - 1252 + +OS Locale (lcid: 46c, name: nso-ZA): Sesotho sa Leboa (South Africa) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: nso_ZA, Name: Pedi (South Africa) default charset: windows-1252 - -OS Locale (lcid: 46d, name: ba-RU): Bashkir (Russia) - 1251 + +OS Locale (lcid: 46d, name: ba-RU): Bashkir (Russia) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ba_RU, Name: Bashkir (Russia) default charset: windows-1252 - -OS Locale (lcid: 46e, name: lb-LU): Luxembourgish (Luxembourg) - 1252 + +OS Locale (lcid: 46e, name: lb-LU): Luxembourgish (Luxembourg) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: lb_LU, Name: Luxembourgish (Luxembourg) default charset: windows-1252 - -OS Locale (lcid: 46f, name: kl-GL): Greenlandic (Greenland) - 1252 + +OS Locale (lcid: 46f, name: kl-GL): Greenlandic (Greenland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: kl_GL, Name: Greenlandic (Greenland) default charset: windows-1252 - -OS Locale (lcid: 470, name: ig-NG): Igbo (Nigeria) - 1252 + +OS Locale (lcid: 470, name: ig-NG): Igbo (Nigeria) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ig_NG, Name: Igbo (Nigeria) default charset: windows-1252 - -OS Locale (lcid: 478, name: ii-CN): Yi (People's Republic of China) - 0 + +OS Locale (lcid: 478, name: ii-CN): Yi (People's Republic of China) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ii_CN, Name: Sichuan Yi (China) default charset: windows-1252 - -OS Locale (lcid: 47a, name: arn): Mapudungun (Chile) - 1252 + +OS Locale (lcid: 47a, name: arn): Mapudungun (Chile) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: arn_CL, Name: Mapudungun (Chile) default charset: windows-1252 - -OS Locale (lcid: 47a, name: arn-CL): Mapudungun (Chile) - 1252 + +OS Locale (lcid: 47a, name: arn-CL): Mapudungun (Chile) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: arn_CL, Name: Mapudungun (Chile) default charset: windows-1252 - -OS Locale (lcid: 47c, name: moh): Mohawk (Canada) - 1252 + +OS Locale (lcid: 47c, name: moh): Mohawk (Canada) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: moh_CA, Name: Mohawk (Canada) default charset: windows-1252 - -OS Locale (lcid: 47c, name: moh-CA): Mohawk (Canada) - 1252 + +OS Locale (lcid: 47c, name: moh-CA): Mohawk (Canada) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: moh_CA, Name: Mohawk (Canada) default charset: windows-1252 - -OS Locale (lcid: 47e, name: br-FR): Breton (France) - 1252 + +OS Locale (lcid: 47e, name: br-FR): Breton (France) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: br_FR, Name: Breton (France) default charset: windows-1252 - -OS Locale (lcid: 480, name: ug-CN): Uyghur (People's Republic of China) - 1256 + +OS Locale (lcid: 480, name: ug-CN): Uyghur (People's Republic of China) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ug_CN, Name: Uighur (China) default charset: windows-1252 - -OS Locale (lcid: 481, name: mi-NZ): Maori (New Zealand) - 0 + +OS Locale (lcid: 481, name: mi-NZ): Maori (New Zealand) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: mi_NZ, Name: Maori (New Zealand) default charset: windows-1252 - -OS Locale (lcid: 482, name: oc-FR): Occitan (France) - 1252 + +OS Locale (lcid: 482, name: oc-FR): Occitan (France) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: oc_FR, Name: Occitan (France) default charset: windows-1252 - -OS Locale (lcid: 483, name: co-FR): Corsican (France) - 1252 + +OS Locale (lcid: 483, name: co-FR): Corsican (France) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: co_FR, Name: Corsican (France) default charset: windows-1252 - -OS Locale (lcid: 484, name: gsw): Alsatian (France) - 1252 + +OS Locale (lcid: 484, name: gsw): Alsatian (France) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: gsw_FR, Name: Swiss German (France) default charset: windows-1252 - -OS Locale (lcid: 484, name: gsw-FR): Alsatian (France) - 1252 + +OS Locale (lcid: 484, name: gsw-FR): Alsatian (France) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: gsw_FR, Name: Swiss German (France) default charset: windows-1252 - -OS Locale (lcid: 485, name: sah): Yakut (Russia) - 1251 + +OS Locale (lcid: 485, name: sah): Yakut (Russia) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sah_RU, Name: Yakut (Russia) default charset: windows-1252 - -OS Locale (lcid: 485, name: sah-RU): Yakut (Russia) - 1251 + +OS Locale (lcid: 485, name: sah-RU): Yakut (Russia) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sah_RU, Name: Yakut (Russia) default charset: windows-1252 - -OS Locale (lcid: 486, name: qut): K'iche (Guatemala) - 1252 + +OS Locale (lcid: 486, name: qut): K'iche (Guatemala) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: qut_GT, Name: qut (Guatemala) default charset: windows-1252 - -OS Locale (lcid: 486, name: qut-GT): K'iche (Guatemala) - 1252 + +OS Locale (lcid: 486, name: qut-GT): K'iche (Guatemala) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: qut_GT, Name: qut (Guatemala) default charset: windows-1252 - -OS Locale (lcid: 487, name: rw-RW): Kinyarwanda (Rwanda) - 1252 + +OS Locale (lcid: 487, name: rw-RW): Kinyarwanda (Rwanda) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: rw_RW, Name: Kinyarwanda (Rwanda) default charset: windows-1252 - -OS Locale (lcid: 488, name: wo-SN): Wolof (Senegal) - 1252 + +OS Locale (lcid: 488, name: wo-SN): Wolof (Senegal) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: wo_SN, Name: Wolof (Senegal) default charset: windows-1252 - -OS Locale (lcid: 48c, name: prs): Dari (Afghanistan) - 1256 + +OS Locale (lcid: 48c, name: prs): Dari (Afghanistan) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: prs_AF, Name: prs (Afghanistan) default charset: windows-1252 - -OS Locale (lcid: 48c, name: prs-AF): Dari (Afghanistan) - 1256 + +OS Locale (lcid: 48c, name: prs-AF): Dari (Afghanistan) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: prs_AF, Name: prs (Afghanistan) default charset: windows-1252 - -OS Locale (lcid: 491, name: gd-GB): Scottish Gaelic (United Kingdom) - 1252 + +OS Locale (lcid: 491, name: gd-GB): Scottish Gaelic (United Kingdom) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: gd_GB, Name: Scottish Gaelic (United Kingdom) default charset: windows-1252 - -OS Locale (lcid: 801, name: ar-IQ): Arabic (Iraq) - 1256 + +OS Locale (lcid: 801, name: ar-IQ): Arabic (Iraq) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_IQ, Name: Arabic (Iraq) default charset: windows-1252 - -OS Locale (lcid: 804, name: zh-Hans): Chinese (Simplified) (People's Republic of China) - 936 + +OS Locale (lcid: 804, name: zh-Hans): Chinese (Simplified) (People's Republic of China) - 936 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_CN, Name: Chinese (China) default charset: windows-1252 - -OS Locale (lcid: 804, name: zh-CN): Chinese (Simplified) (People's Republic of China) - 936 + +OS Locale (lcid: 804, name: zh-CN): Chinese (Simplified) (People's Republic of China) - 936 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_CN, Name: Chinese (China) default charset: windows-1252 - -OS Locale (lcid: 807, name: de-CH): German (Switzerland) - 1252 + +OS Locale (lcid: 807, name: de-CH): German (Switzerland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: de_CH, Name: German (Switzerland) default charset: windows-1252 - -OS Locale (lcid: 809, name: en-GB): English (United Kingdom) - 1252 + +OS Locale (lcid: 809, name: en-GB): English (United Kingdom) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_GB, Name: English (United Kingdom) default charset: windows-1252 - -OS Locale (lcid: 80a, name: es-MX): Spanish (Mexico) - 1252 + +OS Locale (lcid: 80a, name: es-MX): Spanish (Mexico) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_MX, Name: Spanish (Mexico) default charset: windows-1252 - -OS Locale (lcid: 80c, name: fr-BE): French (Belgium) - 1252 + +OS Locale (lcid: 80c, name: fr-BE): French (Belgium) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: fr_BE, Name: French (Belgium) default charset: windows-1252 - -OS Locale (lcid: 810, name: it-CH): Italian (Switzerland) - 1252 + +OS Locale (lcid: 810, name: it-CH): Italian (Switzerland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: it_CH, Name: Italian (Switzerland) default charset: windows-1252 - -OS Locale (lcid: 813, name: nl-BE): Dutch (Belgium) - 1252 + +OS Locale (lcid: 813, name: nl-BE): Dutch (Belgium) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: nl_BE, Name: Dutch (Belgium) default charset: windows-1252 - -OS Locale (lcid: 814, name: nn-NO): Norwegian (Nynorsk) (Norway) - 1252 + +OS Locale (lcid: 814, name: nn-NO): Norwegian (Nynorsk) (Norway) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk) default charset: windows-1252 - -OS Locale (lcid: 816, name: pt-PT): Portuguese (Portugal) - 1252 + +OS Locale (lcid: 816, name: pt-PT): Portuguese (Portugal) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: pt_PT, Name: Portuguese (Portugal) default charset: windows-1252 - -OS Locale (lcid: 81a, name: sr-Latn-CS): Serbian (Latin) (Serbia and Montenegro (Former)) - 1250 + +OS Locale (lcid: 81a, name: sr-Latn-CS): Serbian (Latin) (Serbia and Montenegro (Former)) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) +format locale: ID: sr_CS_#Latn, Name: Serbian (Latin,Serbia and Montenegro) default charset: windows-1252 - -OS Locale (lcid: 81d, name: sv-FI): Swedish (Finland) - 1252 + +OS Locale (lcid: 81d, name: sv-FI): Swedish (Finland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: sv_FI, Name: Swedish (Finland) default charset: windows-1252 - -OS Locale (lcid: 82c, name: az-Cyrl-AZ): Azeri (Cyrillic) (Azerbaijan) - 1251 + +OS Locale (lcid: 82c, name: az-Cyrl-AZ): Azeri (Cyrillic) (Azerbaijan) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: az_AZ, Name: Azerbaijani (Azerbaijan) +format locale: ID: az_AZ_#Cyrl, Name: Azerbaijani (Cyrillic,Azerbaijan) default charset: windows-1252 - -OS Locale (lcid: 82c, name: az-Cyrl): Azeri (Cyrillic) (Azerbaijan) - 1251 + +OS Locale (lcid: 82c, name: az-Cyrl): Azeri (Cyrillic) (Azerbaijan) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: az_AZ, Name: Azerbaijani (Azerbaijan) +format locale: ID: az_AZ_#Cyrl, Name: Azerbaijani (Cyrillic,Azerbaijan) default charset: windows-1252 - -OS Locale (lcid: 82e, name: dsb): Lower Sorbian (Germany) - 1252 + +OS Locale (lcid: 82e, name: dsb): Lower Sorbian (Germany) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: dsb_DE, Name: Lower Sorbian (Germany) default charset: windows-1252 - -OS Locale (lcid: 82e, name: dsb-DE): Lower Sorbian (Germany) - 1252 + +OS Locale (lcid: 82e, name: dsb-DE): Lower Sorbian (Germany) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: dsb_DE, Name: Lower Sorbian (Germany) default charset: windows-1252 - -OS Locale (lcid: 83b, name: se-SE): Sami (Northern) (Sweden) - 1252 + +OS Locale (lcid: 83b, name: se-SE): Sami (Northern) (Sweden) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: se_SE, Name: Northern Sami (Sweden) default charset: windows-1252 - -OS Locale (lcid: 83c, name: ga-IE): Irish (Ireland) - 1252 + +OS Locale (lcid: 83c, name: ga-IE): Irish (Ireland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ga_IE, Name: Irish (Ireland) default charset: windows-1252 - -OS Locale (lcid: 83e, name: ms-BN): Malay (Brunei Darussalam) - 1252 + +OS Locale (lcid: 83e, name: ms-BN): Malay (Brunei Darussalam) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ms_BN, Name: Malay (Brunei) default charset: windows-1252 - -OS Locale (lcid: 843, name: uz-Cyrl-UZ): Uzbek (Cyrillic) (Uzbekistan) - 1251 + +OS Locale (lcid: 843, name: uz-Cyrl-UZ): Uzbek (Cyrillic) (Uzbekistan) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) +format locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) default charset: windows-1252 - -OS Locale (lcid: 843, name: uz-Cyrl): Uzbek (Cyrillic) (Uzbekistan) - 1251 + +OS Locale (lcid: 843, name: uz-Cyrl): Uzbek (Cyrillic) (Uzbekistan) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) +format locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) default charset: windows-1252 - -OS Locale (lcid: 845, name: bn-BD): Bengali (Bangladesh) - 0 + +OS Locale (lcid: 845, name: bn-BD): Bengali (Bangladesh) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: bn_BD, Name: Bengali (Bangladesh) default charset: windows-1252 - -OS Locale (lcid: 850, name: mn-Mong-CN): Mongolian (Traditional Mongolian) (People's Republic of China) - 0 + +OS Locale (lcid: 850, name: mn-Mong-CN): Mongolian (Traditional Mongolian) (People's Republic of China) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: mn_CN, Name: Mongolian (China) +format locale: ID: mn_CN_#Mong, Name: Mongolian (Mongolian,China) default charset: windows-1252 - -OS Locale (lcid: 850, name: mn-Mong): Mongolian (Traditional Mongolian) (People's Republic of China) - 0 + +OS Locale (lcid: 850, name: mn-Mong): Mongolian (Traditional Mongolian) (People's Republic of China) - 0 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: mn_CN, Name: Mongolian (China) +format locale: ID: mn_CN_#Mong, Name: Mongolian (Mongolian,China) default charset: windows-1252 - -OS Locale (lcid: 85d, name: iu-Latn): Inuktitut (Latin) (Canada) - 1252 + +OS Locale (lcid: 85d, name: iu-Latn): Inuktitut (Latin) (Canada) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: iu_CA, Name: Inuktitut (Canada) +format locale: ID: iu_CA_#Latn, Name: Inuktitut (Latin,Canada) default charset: windows-1252 - -OS Locale (lcid: 85d, name: iu-Latn-CA): Inuktitut (Latin) (Canada) - 1252 + +OS Locale (lcid: 85d, name: iu-Latn-CA): Inuktitut (Latin) (Canada) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: iu_CA, Name: Inuktitut (Canada) +format locale: ID: iu_CA_#Latn, Name: Inuktitut (Latin,Canada) default charset: windows-1252 - -OS Locale (lcid: 85f, name: tzm): Tamazight (Latin) (Algeria) - 1252 + +OS Locale (lcid: 85f, name: tzm): Tamazight (Latin) (Algeria) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: tzm_DZ_#Latn, Name: tzm (Latin,Algeria) default charset: windows-1252 - -OS Locale (lcid: 85f, name: tzm-Latn-DZ): Tamazight (Latin) (Algeria) - 1252 + +OS Locale (lcid: 85f, name: tzm-Latn-DZ): Tamazight (Latin) (Algeria) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: tzm_DZ_#Latn, Name: tzm (Latin,Algeria) default charset: windows-1252 - -OS Locale (lcid: 85f, name: tzm-Latn): Tamazight (Latin) (Algeria) - 1252 + +OS Locale (lcid: 85f, name: tzm-Latn): Tamazight (Latin) (Algeria) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: tzm_DZ_#Latn, Name: tzm (Latin,Algeria) default charset: windows-1252 - -OS Locale (lcid: 86b, name: quz-EC): Quechua (Ecuador) - 1252 + +OS Locale (lcid: 86b, name: quz-EC): Quechua (Ecuador) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: quz_EC, Name: quz (Ecuador) default charset: windows-1252 - -OS Locale (lcid: c01, name: ar-EG): Arabic (Egypt) - 1256 + +OS Locale (lcid: c01, name: ar-EG): Arabic (Egypt) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_EG, Name: Arabic (Egypt) default charset: windows-1252 - -OS Locale (lcid: c04, name: zh-HK): Chinese (Traditional) (Hong Kong S.A.R.) - 950 + +OS Locale (lcid: c04, name: zh-HK): Chinese (Traditional) (Hong Kong S.A.R.) - 950 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_HK, Name: Chinese (Hong Kong) default charset: x-MS950-HKSCS - -OS Locale (lcid: c04, name: zh-Hant): Chinese (Traditional) (Hong Kong S.A.R.) - 950 + +OS Locale (lcid: c04, name: zh-Hant): Chinese (Traditional) (Hong Kong S.A.R.) - 950 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_HK, Name: Chinese (Hong Kong) default charset: windows-1252 - -OS Locale (lcid: c07, name: de-AT): German (Austria) - 1252 + +OS Locale (lcid: c07, name: de-AT): German (Austria) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: de_AT, Name: German (Austria) default charset: windows-1252 - -OS Locale (lcid: c09, name: en-AU): English (Australia) - 1252 + +OS Locale (lcid: c09, name: en-AU): English (Australia) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_AU, Name: English (Australia) default charset: windows-1252 - -OS Locale (lcid: c0a, name: es-ES): Spanish (Spain) - 1252 + +OS Locale (lcid: c0a, name: es-ES): Spanish (Spain) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_ES, Name: Spanish (Spain) default charset: windows-1252 - -OS Locale (lcid: c0c, name: fr-CA): French (Canada) - 1252 + +OS Locale (lcid: c0c, name: fr-CA): French (Canada) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: fr_CA, Name: French (Canada) default charset: windows-1252 - -OS Locale (lcid: c1a, name: sr-Cyrl-CS): Serbian (Cyrillic) (Serbia and Montenegro (Former)) - 1251 + +OS Locale (lcid: c1a, name: sr-Cyrl-CS): Serbian (Cyrillic) (Serbia and Montenegro (Former)) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) +format locale: ID: sr_CS_#Cyrl, Name: Serbian (Cyrillic,Serbia and Montenegro) default charset: windows-1252 - -OS Locale (lcid: c3b, name: se-FI): Sami (Northern) (Finland) - 1252 + +OS Locale (lcid: c3b, name: se-FI): Sami (Northern) (Finland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: se_FI, Name: Northern Sami (Finland) default charset: windows-1252 - -OS Locale (lcid: c6b, name: quz-PE): Quechua (Peru) - 1252 + +OS Locale (lcid: c6b, name: quz-PE): Quechua (Peru) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: quz_PE, Name: quz (Peru) default charset: windows-1252 - -OS Locale (lcid: 1001, name: ar-LY): Arabic (Libya) - 1256 + +OS Locale (lcid: 1001, name: ar-LY): Arabic (Libya) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_LY, Name: Arabic (Libya) default charset: windows-1252 - -OS Locale (lcid: 1004, name: zh-SG): Chinese (Simplified) (Singapore) - 936 + +OS Locale (lcid: 1004, name: zh-SG): Chinese (Simplified) (Singapore) - 936 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_SG, Name: Chinese (Singapore) default charset: windows-1252 - -OS Locale (lcid: 1007, name: de-LU): German (Luxembourg) - 1252 + +OS Locale (lcid: 1007, name: de-LU): German (Luxembourg) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: de_LU, Name: German (Luxembourg) default charset: windows-1252 - -OS Locale (lcid: 1009, name: en-CA): English (Canada) - 1252 + +OS Locale (lcid: 1009, name: en-CA): English (Canada) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_CA, Name: English (Canada) default charset: windows-1252 - -OS Locale (lcid: 100a, name: es-GT): Spanish (Guatemala) - 1252 + +OS Locale (lcid: 100a, name: es-GT): Spanish (Guatemala) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_GT, Name: Spanish (Guatemala) default charset: windows-1252 - -OS Locale (lcid: 100c, name: fr-CH): French (Switzerland) - 1252 + +OS Locale (lcid: 100c, name: fr-CH): French (Switzerland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: fr_CH, Name: French (Switzerland) default charset: windows-1252 - -OS Locale (lcid: 101a, name: hr-BA): Croatian (Latin) (Bosnia and Herzegovina) - 1250 + +OS Locale (lcid: 101a, name: hr-BA): Croatian (Latin) (Bosnia and Herzegovina) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: hr_BA, Name: Croatian (Bosnia and Herzegovina) default charset: windows-1252 - -OS Locale (lcid: 103b, name: smj-NO): Sami (Lule) (Norway) - 1252 + +OS Locale (lcid: 103b, name: smj-NO): Sami (Lule) (Norway) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: smj_NO, Name: Lule Sami (Norway) default charset: windows-1252 - -OS Locale (lcid: 1401, name: ar-DZ): Arabic (Algeria) - 1256 + +OS Locale (lcid: 1401, name: ar-DZ): Arabic (Algeria) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_DZ, Name: Arabic (Algeria) default charset: windows-1252 - -OS Locale (lcid: 1404, name: zh-MO): Chinese (Traditional) (Macao S.A.R.) - 950 + +OS Locale (lcid: 1404, name: zh-MO): Chinese (Traditional) (Macao S.A.R.) - 950 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_MO, Name: Chinese (Macao) default charset: windows-1252 - -OS Locale (lcid: 1407, name: de-LI): German (Liechtenstein) - 1252 + +OS Locale (lcid: 1407, name: de-LI): German (Liechtenstein) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: de_LI, Name: German (Liechtenstein) default charset: windows-1252 - -OS Locale (lcid: 1409, name: en-NZ): English (New Zealand) - 1252 + +OS Locale (lcid: 1409, name: en-NZ): English (New Zealand) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_NZ, Name: English (New Zealand) default charset: windows-1252 - -OS Locale (lcid: 140a, name: es-CR): Spanish (Costa Rica) - 1252 + +OS Locale (lcid: 140a, name: es-CR): Spanish (Costa Rica) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_CR, Name: Spanish (Costa Rica) default charset: windows-1252 - -OS Locale (lcid: 140c, name: fr-LU): French (Luxembourg) - 1252 + +OS Locale (lcid: 140c, name: fr-LU): French (Luxembourg) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: fr_LU, Name: French (Luxembourg) default charset: windows-1252 - -OS Locale (lcid: 141a, name: bs-Latn): Bosnian (Latin) (Bosnia and Herzegovina) - 1250 + +OS Locale (lcid: 141a, name: bs-Latn): Bosnian (Latin) (Bosnia and Herzegovina) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) +format locale: ID: bs_BA_#Latn, Name: Bosnian (Latin,Bosnia and Herzegovina) default charset: windows-1252 - -OS Locale (lcid: 141a, name: bs-Latn-BA): Bosnian (Latin) (Bosnia and Herzegovina) - 1250 + +OS Locale (lcid: 141a, name: bs-Latn-BA): Bosnian (Latin) (Bosnia and Herzegovina) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) +format locale: ID: bs_BA_#Latn, Name: Bosnian (Latin,Bosnia and Herzegovina) default charset: windows-1252 - -OS Locale (lcid: 143b, name: smj-SE): Sami (Lule) (Sweden) - 1252 + +OS Locale (lcid: 143b, name: smj-SE): Sami (Lule) (Sweden) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: smj_SE, Name: Lule Sami (Sweden) default charset: windows-1252 - -OS Locale (lcid: 143b, name: smj): Sami (Lule) (Sweden) - 1252 + +OS Locale (lcid: 143b, name: smj): Sami (Lule) (Sweden) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: smj_SE, Name: Lule Sami (Sweden) default charset: windows-1252 - -OS Locale (lcid: 1801, name: ar-MA): Arabic (Morocco) - 1256 + +OS Locale (lcid: 1801, name: ar-MA): Arabic (Morocco) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_MA, Name: Arabic (Morocco) default charset: windows-1252 - -OS Locale (lcid: 1809, name: en-IE): English (Ireland) - 1252 + +OS Locale (lcid: 1809, name: en-IE): English (Ireland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_IE, Name: English (Ireland) default charset: windows-1252 - -OS Locale (lcid: 180a, name: es-PA): Spanish (Panama) - 1252 + +OS Locale (lcid: 180a, name: es-PA): Spanish (Panama) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_PA, Name: Spanish (Panama) default charset: windows-1252 - -OS Locale (lcid: 180c, name: fr-MC): French (Principality of Monaco) - 1252 + +OS Locale (lcid: 180c, name: fr-MC): French (Principality of Monaco) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: fr_MC, Name: French (Monaco) default charset: windows-1252 - -OS Locale (lcid: 181a, name: sr-Latn-BA): Serbian (Latin) (Bosnia and Herzegovina) - 1250 + +OS Locale (lcid: 181a, name: sr-Latn-BA): Serbian (Latin) (Bosnia and Herzegovina) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_BA, Name: Serbian (Bosnia and Herzegovina) +format locale: ID: sr_BA_#Latn, Name: Serbian (Latin,Bosnia and Herzegovina) default charset: windows-1252 - -OS Locale (lcid: 183b, name: sma-NO): Sami (Southern) (Norway) - 1252 + +OS Locale (lcid: 183b, name: sma-NO): Sami (Southern) (Norway) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sma_NO, Name: Southern Sami (Norway) default charset: windows-1252 - -OS Locale (lcid: 1c01, name: ar-TN): Arabic (Tunisia) - 1256 + +OS Locale (lcid: 1c01, name: ar-TN): Arabic (Tunisia) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_TN, Name: Arabic (Tunisia) default charset: windows-1252 - -OS Locale (lcid: 1c09, name: en-ZA): English (South Africa) - 1252 + +OS Locale (lcid: 1c09, name: en-ZA): English (South Africa) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_ZA, Name: English (South Africa) default charset: windows-1252 - -OS Locale (lcid: 1c0a, name: es-DO): Spanish (Dominican Republic) - 1252 + +OS Locale (lcid: 1c0a, name: es-DO): Spanish (Dominican Republic) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_DO, Name: Spanish (Dominican Republic) default charset: windows-1252 - -OS Locale (lcid: 1c1a, name: sr-Cyrl-BA): Serbian (Cyrillic) (Bosnia and Herzegovina) - 1251 + +OS Locale (lcid: 1c1a, name: sr-Cyrl-BA): Serbian (Cyrillic) (Bosnia and Herzegovina) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_BA, Name: Serbian (Bosnia and Herzegovina) +format locale: ID: sr_BA_#Cyrl, Name: Serbian (Cyrillic,Bosnia and Herzegovina) default charset: windows-1252 - -OS Locale (lcid: 1c3b, name: sma): Sami (Southern) (Sweden) - 1252 + +OS Locale (lcid: 1c3b, name: sma): Sami (Southern) (Sweden) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sma_SE, Name: Southern Sami (Sweden) default charset: windows-1252 - -OS Locale (lcid: 1c3b, name: sma-SE): Sami (Southern) (Sweden) - 1252 + +OS Locale (lcid: 1c3b, name: sma-SE): Sami (Southern) (Sweden) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sma_SE, Name: Southern Sami (Sweden) default charset: windows-1252 - -OS Locale (lcid: 2001, name: ar-OM): Arabic (Oman) - 1256 + +OS Locale (lcid: 2001, name: ar-OM): Arabic (Oman) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_OM, Name: Arabic (Oman) default charset: windows-1252 - -OS Locale (lcid: 2009, name: en-JM): English (Jamaica) - 1252 + +OS Locale (lcid: 2009, name: en-JM): English (Jamaica) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_JM, Name: English (Jamaica) default charset: windows-1252 - -OS Locale (lcid: 200a, name: es-VE): Spanish (Bolivarian Republic of Venezuela) - 1252 + +OS Locale (lcid: 200a, name: es-VE): Spanish (Bolivarian Republic of Venezuela) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_VE, Name: Spanish (Venezuela) default charset: windows-1252 - -OS Locale (lcid: 201a, name: bs-Cyrl-BA): Bosnian (Cyrillic) (Bosnia and Herzegovina) - 1251 + +OS Locale (lcid: 201a, name: bs-Cyrl-BA): Bosnian (Cyrillic) (Bosnia and Herzegovina) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) +format locale: ID: bs_BA_#Cyrl, Name: Bosnian (Cyrillic,Bosnia and Herzegovina) default charset: windows-1252 - -OS Locale (lcid: 201a, name: bs-Cyrl): Bosnian (Cyrillic) (Bosnia and Herzegovina) - 1251 + +OS Locale (lcid: 201a, name: bs-Cyrl): Bosnian (Cyrillic) (Bosnia and Herzegovina) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) +format locale: ID: bs_BA_#Cyrl, Name: Bosnian (Cyrillic,Bosnia and Herzegovina) default charset: windows-1252 - -OS Locale (lcid: 203b, name: sms-FI): Sami (Skolt) (Finland) - 1252 + +OS Locale (lcid: 203b, name: sms-FI): Sami (Skolt) (Finland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sms_FI, Name: Skolt Sami (Finland) default charset: windows-1252 - -OS Locale (lcid: 203b, name: sms): Sami (Skolt) (Finland) - 1252 + +OS Locale (lcid: 203b, name: sms): Sami (Skolt) (Finland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sms_FI, Name: Skolt Sami (Finland) default charset: windows-1252 - -OS Locale (lcid: 2401, name: ar-YE): Arabic (Yemen) - 1256 + +OS Locale (lcid: 2401, name: ar-YE): Arabic (Yemen) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_YE, Name: Arabic (Yemen) default charset: windows-1252 - -OS Locale (lcid: 2409, name: en-029): English (Caribbean) - 1252 + +OS Locale (lcid: 2409, name: en-029): English (Caribbean) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_029, Name: English (Caribbean) default charset: windows-1252 - -OS Locale (lcid: 240a, name: es-CO): Spanish (Colombia) - 1252 + +OS Locale (lcid: 240a, name: es-CO): Spanish (Colombia) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_CO, Name: Spanish (Colombia) default charset: windows-1252 - -OS Locale (lcid: 241a, name: sr-Latn-RS): Serbian (Latin) (Serbia) - 1250 + +OS Locale (lcid: 241a, name: sr-Latn-RS): Serbian (Latin) (Serbia) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_RS, Name: Serbian (Serbia) +format locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) default charset: windows-1252 - -OS Locale (lcid: 241a, name: sr-Latn): Serbian (Latin) (Serbia) - 1250 + +OS Locale (lcid: 241a, name: sr-Latn): Serbian (Latin) (Serbia) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_RS, Name: Serbian (Serbia) +format locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) default charset: windows-1252 - -OS Locale (lcid: 243b, name: smn): Sami (Inari) (Finland) - 1252 + +OS Locale (lcid: 243b, name: smn): Sami (Inari) (Finland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: smn_FI, Name: Inari Sami (Finland) default charset: windows-1252 - -OS Locale (lcid: 243b, name: smn-FI): Sami (Inari) (Finland) - 1252 + +OS Locale (lcid: 243b, name: smn-FI): Sami (Inari) (Finland) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: smn_FI, Name: Inari Sami (Finland) default charset: windows-1252 - -OS Locale (lcid: 2801, name: ar-SY): Arabic (Syria) - 1256 + +OS Locale (lcid: 2801, name: ar-SY): Arabic (Syria) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_SY, Name: Arabic (Syria) default charset: windows-1252 - -OS Locale (lcid: 2809, name: en-BZ): English (Belize) - 1252 + +OS Locale (lcid: 2809, name: en-BZ): English (Belize) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_BZ, Name: English (Belize) default charset: windows-1252 - -OS Locale (lcid: 280a, name: es-PE): Spanish (Peru) - 1252 + +OS Locale (lcid: 280a, name: es-PE): Spanish (Peru) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_PE, Name: Spanish (Peru) default charset: windows-1252 - -OS Locale (lcid: 281a, name: sr-Cyrl-RS): Serbian (Cyrillic) (Serbia) - 1251 + +OS Locale (lcid: 281a, name: sr-Cyrl-RS): Serbian (Cyrillic) (Serbia) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_RS, Name: Serbian (Serbia) +format locale: ID: sr_RS_#Cyrl, Name: Serbian (Cyrillic,Serbia) default charset: windows-1252 - -OS Locale (lcid: 281a, name: sr-Cyrl): Serbian (Cyrillic) (Serbia) - 1251 + +OS Locale (lcid: 281a, name: sr-Cyrl): Serbian (Cyrillic) (Serbia) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_RS, Name: Serbian (Serbia) +format locale: ID: sr_RS_#Cyrl, Name: Serbian (Cyrillic,Serbia) default charset: windows-1252 - -OS Locale (lcid: 2c01, name: ar-JO): Arabic (Jordan) - 1256 + +OS Locale (lcid: 2c01, name: ar-JO): Arabic (Jordan) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_JO, Name: Arabic (Jordan) default charset: windows-1252 - -OS Locale (lcid: 2c09, name: en-TT): English (Trinidad and Tobago) - 1252 + +OS Locale (lcid: 2c09, name: en-TT): English (Trinidad and Tobago) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_TT, Name: English (Trinidad and Tobago) default charset: windows-1252 - -OS Locale (lcid: 2c0a, name: es-AR): Spanish (Argentina) - 1252 + +OS Locale (lcid: 2c0a, name: es-AR): Spanish (Argentina) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_AR, Name: Spanish (Argentina) default charset: windows-1252 - -OS Locale (lcid: 2c1a, name: sr-Latn-ME): Serbian (Latin) (Montenegro) - 1250 + +OS Locale (lcid: 2c1a, name: sr-Latn-ME): Serbian (Latin) (Montenegro) - 1250 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_ME, Name: Serbian (Montenegro) +format locale: ID: sr_ME_#Latn, Name: Serbian (Latin,Montenegro) default charset: windows-1252 - -OS Locale (lcid: 3001, name: ar-LB): Arabic (Lebanon) - 1256 + +OS Locale (lcid: 3001, name: ar-LB): Arabic (Lebanon) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_LB, Name: Arabic (Lebanon) default charset: windows-1252 - -OS Locale (lcid: 3009, name: en-ZW): English (Zimbabwe) - 1252 + +OS Locale (lcid: 3009, name: en-ZW): English (Zimbabwe) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_ZW, Name: English (Zimbabwe) default charset: windows-1252 - -OS Locale (lcid: 300a, name: es-EC): Spanish (Ecuador) - 1252 + +OS Locale (lcid: 300a, name: es-EC): Spanish (Ecuador) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_EC, Name: Spanish (Ecuador) default charset: windows-1252 - -OS Locale (lcid: 301a, name: sr-Cyrl-ME): Serbian (Cyrillic) (Montenegro) - 1251 + +OS Locale (lcid: 301a, name: sr-Cyrl-ME): Serbian (Cyrillic) (Montenegro) - 1251 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_ME, Name: Serbian (Montenegro) +format locale: ID: sr_ME_#Cyrl, Name: Serbian (Cyrillic,Montenegro) default charset: windows-1252 - -OS Locale (lcid: 3401, name: ar-KW): Arabic (Kuwait) - 1256 + +OS Locale (lcid: 3401, name: ar-KW): Arabic (Kuwait) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_KW, Name: Arabic (Kuwait) default charset: windows-1252 - -OS Locale (lcid: 3409, name: en-PH): English (Republic of the Philippines) - 1252 + +OS Locale (lcid: 3409, name: en-PH): English (Republic of the Philippines) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_PH, Name: English (Philippines) default charset: windows-1252 - -OS Locale (lcid: 340a, name: es-CL): Spanish (Chile) - 1252 + +OS Locale (lcid: 340a, name: es-CL): Spanish (Chile) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_CL, Name: Spanish (Chile) default charset: windows-1252 - -OS Locale (lcid: 3801, name: ar-AE): Arabic (U.A.E.) - 1256 + +OS Locale (lcid: 3801, name: ar-AE): Arabic (U.A.E.) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_AE, Name: Arabic (United Arab Emirates) default charset: windows-1252 - -OS Locale (lcid: 380a, name: es-UY): Spanish (Uruguay) - 1252 + +OS Locale (lcid: 380a, name: es-UY): Spanish (Uruguay) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_UY, Name: Spanish (Uruguay) default charset: windows-1252 - -OS Locale (lcid: 3c01, name: ar-BH): Arabic (Bahrain) - 1256 + +OS Locale (lcid: 3c01, name: ar-BH): Arabic (Bahrain) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_BH, Name: Arabic (Bahrain) default charset: windows-1252 - -OS Locale (lcid: 3c0a, name: es-PY): Spanish (Paraguay) - 1252 + +OS Locale (lcid: 3c0a, name: es-PY): Spanish (Paraguay) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_PY, Name: Spanish (Paraguay) default charset: windows-1252 - -OS Locale (lcid: 4001, name: ar-QA): Arabic (Qatar) - 1256 + +OS Locale (lcid: 4001, name: ar-QA): Arabic (Qatar) - 1256 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_QA, Name: Arabic (Qatar) default charset: windows-1252 - -OS Locale (lcid: 4009, name: en-IN): English (India) - 1252 + +OS Locale (lcid: 4009, name: en-IN): English (India) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_IN, Name: English (India) default charset: windows-1252 - -OS Locale (lcid: 400a, name: es-BO): Spanish (Bolivia) - 1252 + +OS Locale (lcid: 400a, name: es-BO): Spanish (Bolivia) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_BO, Name: Spanish (Bolivia) default charset: windows-1252 - -OS Locale (lcid: 4409, name: en-MY): English (Malaysia) - 1252 + +OS Locale (lcid: 4409, name: en-MY): English (Malaysia) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_MY, Name: English (Malaysia) default charset: windows-1252 - -OS Locale (lcid: 440a, name: es-SV): Spanish (El Salvador) - 1252 + +OS Locale (lcid: 440a, name: es-SV): Spanish (El Salvador) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_SV, Name: Spanish (El Salvador) default charset: windows-1252 - -OS Locale (lcid: 4809, name: en-SG): English (Singapore) - 1252 + +OS Locale (lcid: 4809, name: en-SG): English (Singapore) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: en_SG, Name: English (Singapore) default charset: windows-1252 - -OS Locale (lcid: 480a, name: es-HN): Spanish (Honduras) - 1252 + +OS Locale (lcid: 480a, name: es-HN): Spanish (Honduras) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_HN, Name: Spanish (Honduras) default charset: windows-1252 - -OS Locale (lcid: 4c0a, name: es-NI): Spanish (Nicaragua) - 1252 + +OS Locale (lcid: 4c0a, name: es-NI): Spanish (Nicaragua) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_NI, Name: Spanish (Nicaragua) default charset: windows-1252 - -OS Locale (lcid: 500a, name: es-PR): Spanish (Puerto Rico) - 1252 + +OS Locale (lcid: 500a, name: es-PR): Spanish (Puerto Rico) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: es_PR, Name: Spanish (Puerto Rico) default charset: windows-1252 - -OS Locale (lcid: 540a, name: es-US): Spanish (United States) - 1252 + +OS Locale (lcid: 540a, name: es-US): Spanish (United States) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) -format locale: ID: es, Name: Spanish +format locale: ID: es_US, Name: Spanish (United States) default charset: windows-1252 - -OS UI Language (name: en-US) + +OS UI Language (name: en-US) default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: en_US, Name: English (United States) default charset: windows-1252 - -OS UI Language (name: ja-JP) + +OS UI Language (name: ja-JP) default locale: ID: ja_JP, Name: Japanese (Japan) display locale: ID: ja_JP, Name: Japanese (Japan) format locale: ID: en_US, Name: English (United States) diff --git a/jdk/test/java/util/Locale/data/deflocale.win7.fmtasdefault b/jdk/test/java/util/Locale/data/deflocale.win7.fmtasdefault index d5a8656a15d..44e619054cc 100644 --- a/jdk/test/java/util/Locale/data/deflocale.win7.fmtasdefault +++ b/jdk/test/java/util/Locale/data/deflocale.win7.fmtasdefault @@ -1,1493 +1,1493 @@ -# OSVersionInfo -# MajorVersion: 6 -# MinorVersion: 1 -# BuildNumber: 7600 -# CSDVersion: - - -OS Locale (lcid: 7f, name: ): Invariant Language (Invariant Country) - 1252 +# OSVersionInfo +# MajorVersion: 6 +# MinorVersion: 1 +# BuildNumber: 7600 +# CSDVersion: + + +OS Locale (lcid: 7f, name: ): Invariant Language (Invariant Country) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: en_US, Name: English (United States) default charset: windows-1252 - -OS Locale (lcid: 401, name: ar-SA): Arabic (Saudi Arabia) - 1256 + +OS Locale (lcid: 401, name: ar-SA): Arabic (Saudi Arabia) - 1256 default locale: ID: ar_SA, Name: Arabic (Saudi Arabia) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_SA, Name: Arabic (Saudi Arabia) default charset: windows-1256 - -OS Locale (lcid: 402, name: bg-BG): Bulgarian (Bulgaria) - 1251 + +OS Locale (lcid: 402, name: bg-BG): Bulgarian (Bulgaria) - 1251 default locale: ID: bg_BG, Name: Bulgarian (Bulgaria) display locale: ID: en_US, Name: English (United States) format locale: ID: bg_BG, Name: Bulgarian (Bulgaria) default charset: windows-1251 - -OS Locale (lcid: 403, name: ca-ES): Catalan (Spain) - 1252 + +OS Locale (lcid: 403, name: ca-ES): Catalan (Spain) - 1252 default locale: ID: ca_ES, Name: Catalan (Spain) display locale: ID: en_US, Name: English (United States) format locale: ID: ca_ES, Name: Catalan (Spain) default charset: windows-1252 - -OS Locale (lcid: 404, name: zh-TW): Chinese (Traditional) (Taiwan) - 950 + +OS Locale (lcid: 404, name: zh-TW): Chinese (Traditional) (Taiwan) - 950 default locale: ID: zh_TW, Name: Chinese (Taiwan) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_TW, Name: Chinese (Taiwan) default charset: x-windows-950 - -OS Locale (lcid: 405, name: cs-CZ): Czech (Czech Republic) - 1250 + +OS Locale (lcid: 405, name: cs-CZ): Czech (Czech Republic) - 1250 default locale: ID: cs_CZ, Name: Czech (Czech Republic) display locale: ID: en_US, Name: English (United States) format locale: ID: cs_CZ, Name: Czech (Czech Republic) default charset: windows-1250 - -OS Locale (lcid: 406, name: da-DK): Danish (Denmark) - 1252 + +OS Locale (lcid: 406, name: da-DK): Danish (Denmark) - 1252 default locale: ID: da_DK, Name: Danish (Denmark) display locale: ID: en_US, Name: English (United States) format locale: ID: da_DK, Name: Danish (Denmark) default charset: windows-1252 - -OS Locale (lcid: 407, name: de-DE): German (Germany) - 1252 + +OS Locale (lcid: 407, name: de-DE): German (Germany) - 1252 default locale: ID: de_DE, Name: German (Germany) display locale: ID: en_US, Name: English (United States) format locale: ID: de_DE, Name: German (Germany) default charset: windows-1252 - -OS Locale (lcid: 408, name: el-GR): Greek (Greece) - 1253 + +OS Locale (lcid: 408, name: el-GR): Greek (Greece) - 1253 default locale: ID: el_GR, Name: Greek (Greece) display locale: ID: en_US, Name: English (United States) format locale: ID: el_GR, Name: Greek (Greece) default charset: windows-1253 - -OS Locale (lcid: 409, name: en-US): English (United States) - 1252 + +OS Locale (lcid: 409, name: en-US): English (United States) - 1252 default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: en_US, Name: English (United States) default charset: windows-1252 - -OS Locale (lcid: 40b, name: fi-FI): Finnish (Finland) - 1252 + +OS Locale (lcid: 40b, name: fi-FI): Finnish (Finland) - 1252 default locale: ID: fi_FI, Name: Finnish (Finland) display locale: ID: en_US, Name: English (United States) format locale: ID: fi_FI, Name: Finnish (Finland) default charset: windows-1252 - -OS Locale (lcid: 40c, name: fr-FR): French (France) - 1252 + +OS Locale (lcid: 40c, name: fr-FR): French (France) - 1252 default locale: ID: fr_FR, Name: French (France) display locale: ID: en_US, Name: English (United States) format locale: ID: fr_FR, Name: French (France) default charset: windows-1252 - -OS Locale (lcid: 40d, name: he-IL): Hebrew (Israel) - 1255 + +OS Locale (lcid: 40d, name: he-IL): Hebrew (Israel) - 1255 default locale: ID: iw_IL, Name: Hebrew (Israel) display locale: ID: en_US, Name: English (United States) format locale: ID: iw_IL, Name: Hebrew (Israel) default charset: windows-1255 - -OS Locale (lcid: 40e, name: hu-HU): Hungarian (Hungary) - 1250 + +OS Locale (lcid: 40e, name: hu-HU): Hungarian (Hungary) - 1250 default locale: ID: hu_HU, Name: Hungarian (Hungary) display locale: ID: en_US, Name: English (United States) format locale: ID: hu_HU, Name: Hungarian (Hungary) default charset: windows-1250 - -OS Locale (lcid: 40f, name: is-IS): Icelandic (Iceland) - 1252 + +OS Locale (lcid: 40f, name: is-IS): Icelandic (Iceland) - 1252 default locale: ID: is_IS, Name: Icelandic (Iceland) display locale: ID: en_US, Name: English (United States) format locale: ID: is_IS, Name: Icelandic (Iceland) default charset: windows-1252 - -OS Locale (lcid: 410, name: it-IT): Italian (Italy) - 1252 + +OS Locale (lcid: 410, name: it-IT): Italian (Italy) - 1252 default locale: ID: it_IT, Name: Italian (Italy) display locale: ID: en_US, Name: English (United States) format locale: ID: it_IT, Name: Italian (Italy) default charset: windows-1252 - -OS Locale (lcid: 411, name: ja-JP): Japanese (Japan) - 932 + +OS Locale (lcid: 411, name: ja-JP): Japanese (Japan) - 932 default locale: ID: ja_JP, Name: Japanese (Japan) display locale: ID: en_US, Name: English (United States) format locale: ID: ja_JP, Name: Japanese (Japan) default charset: windows-31j - -OS Locale (lcid: 412, name: ko-KR): Korean (Korea) - 949 + +OS Locale (lcid: 412, name: ko-KR): Korean (Korea) - 949 default locale: ID: ko_KR, Name: Korean (South Korea) display locale: ID: en_US, Name: English (United States) format locale: ID: ko_KR, Name: Korean (South Korea) default charset: x-windows-949 - -OS Locale (lcid: 413, name: nl-NL): Dutch (Netherlands) - 1252 + +OS Locale (lcid: 413, name: nl-NL): Dutch (Netherlands) - 1252 default locale: ID: nl_NL, Name: Dutch (Netherlands) display locale: ID: en_US, Name: English (United States) format locale: ID: nl_NL, Name: Dutch (Netherlands) default charset: windows-1252 - -OS Locale (lcid: 414, name: nb-NO): Norwegian (Bokmål) (Norway) - 1252 + +OS Locale (lcid: 414, name: nb-NO): Norwegian (Bokm…l) (Norway) - 1252 default locale: ID: no_NO, Name: Norwegian (Norway) display locale: ID: en_US, Name: English (United States) format locale: ID: no_NO, Name: Norwegian (Norway) default charset: windows-1252 - -OS Locale (lcid: 415, name: pl-PL): Polish (Poland) - 1250 + +OS Locale (lcid: 415, name: pl-PL): Polish (Poland) - 1250 default locale: ID: pl_PL, Name: Polish (Poland) display locale: ID: en_US, Name: English (United States) format locale: ID: pl_PL, Name: Polish (Poland) default charset: windows-1250 - -OS Locale (lcid: 416, name: pt-BR): Portuguese (Brazil) - 1252 + +OS Locale (lcid: 416, name: pt-BR): Portuguese (Brazil) - 1252 default locale: ID: pt_BR, Name: Portuguese (Brazil) display locale: ID: en_US, Name: English (United States) format locale: ID: pt_BR, Name: Portuguese (Brazil) default charset: windows-1252 - -OS Locale (lcid: 417, name: rm-CH): Romansh (Switzerland) - 1252 + +OS Locale (lcid: 417, name: rm-CH): Romansh (Switzerland) - 1252 default locale: ID: rm_CH, Name: Raeto-Romance (Switzerland) display locale: ID: en_US, Name: English (United States) format locale: ID: rm_CH, Name: Raeto-Romance (Switzerland) default charset: windows-1252 - -OS Locale (lcid: 418, name: ro-RO): Romanian (Romania) - 1250 + +OS Locale (lcid: 418, name: ro-RO): Romanian (Romania) - 1250 default locale: ID: ro_RO, Name: Romanian (Romania) display locale: ID: en_US, Name: English (United States) format locale: ID: ro_RO, Name: Romanian (Romania) default charset: windows-1250 - -OS Locale (lcid: 419, name: ru-RU): Russian (Russia) - 1251 + +OS Locale (lcid: 419, name: ru-RU): Russian (Russia) - 1251 default locale: ID: ru_RU, Name: Russian (Russia) display locale: ID: en_US, Name: English (United States) format locale: ID: ru_RU, Name: Russian (Russia) default charset: windows-1251 - -OS Locale (lcid: 41a, name: hr-HR): Croatian (Croatia) - 1250 + +OS Locale (lcid: 41a, name: hr-HR): Croatian (Croatia) - 1250 default locale: ID: hr_HR, Name: Croatian (Croatia) display locale: ID: en_US, Name: English (United States) format locale: ID: hr_HR, Name: Croatian (Croatia) default charset: windows-1250 - -OS Locale (lcid: 41b, name: sk-SK): Slovak (Slovakia) - 1250 + +OS Locale (lcid: 41b, name: sk-SK): Slovak (Slovakia) - 1250 default locale: ID: sk_SK, Name: Slovak (Slovakia) display locale: ID: en_US, Name: English (United States) format locale: ID: sk_SK, Name: Slovak (Slovakia) default charset: windows-1250 - -OS Locale (lcid: 41c, name: sq-AL): Albanian (Albania) - 1250 + +OS Locale (lcid: 41c, name: sq-AL): Albanian (Albania) - 1250 default locale: ID: sq_AL, Name: Albanian (Albania) display locale: ID: en_US, Name: English (United States) format locale: ID: sq_AL, Name: Albanian (Albania) default charset: windows-1250 - -OS Locale (lcid: 41d, name: sv-SE): Swedish (Sweden) - 1252 + +OS Locale (lcid: 41d, name: sv-SE): Swedish (Sweden) - 1252 default locale: ID: sv_SE, Name: Swedish (Sweden) display locale: ID: en_US, Name: English (United States) format locale: ID: sv_SE, Name: Swedish (Sweden) default charset: windows-1252 - -OS Locale (lcid: 41e, name: th-TH): Thai (Thailand) - 874 + +OS Locale (lcid: 41e, name: th-TH): Thai (Thailand) - 874 default locale: ID: th_TH, Name: Thai (Thailand) display locale: ID: en_US, Name: English (United States) format locale: ID: th_TH, Name: Thai (Thailand) default charset: x-windows-874 - -OS Locale (lcid: 41f, name: tr-TR): Turkish (Turkey) - 1254 + +OS Locale (lcid: 41f, name: tr-TR): Turkish (Turkey) - 1254 default locale: ID: tr_TR, Name: Turkish (Turkey) display locale: ID: en_US, Name: English (United States) format locale: ID: tr_TR, Name: Turkish (Turkey) default charset: windows-1254 - -OS Locale (lcid: 420, name: ur-PK): Urdu (Islamic Republic of Pakistan) - 1256 + +OS Locale (lcid: 420, name: ur-PK): Urdu (Islamic Republic of Pakistan) - 1256 default locale: ID: ur_PK, Name: Urdu (Pakistan) display locale: ID: en_US, Name: English (United States) format locale: ID: ur_PK, Name: Urdu (Pakistan) default charset: windows-1256 - -OS Locale (lcid: 421, name: id-ID): Indonesian (Indonesia) - 1252 + +OS Locale (lcid: 421, name: id-ID): Indonesian (Indonesia) - 1252 default locale: ID: in_ID, Name: Indonesian (Indonesia) display locale: ID: en_US, Name: English (United States) format locale: ID: in_ID, Name: Indonesian (Indonesia) default charset: windows-1252 - -OS Locale (lcid: 422, name: uk-UA): Ukrainian (Ukraine) - 1251 + +OS Locale (lcid: 422, name: uk-UA): Ukrainian (Ukraine) - 1251 default locale: ID: uk_UA, Name: Ukrainian (Ukraine) display locale: ID: en_US, Name: English (United States) format locale: ID: uk_UA, Name: Ukrainian (Ukraine) default charset: windows-1251 - -OS Locale (lcid: 423, name: be-BY): Belarusian (Belarus) - 1251 + +OS Locale (lcid: 423, name: be-BY): Belarusian (Belarus) - 1251 default locale: ID: be_BY, Name: Belarusian (Belarus) display locale: ID: en_US, Name: English (United States) format locale: ID: be_BY, Name: Belarusian (Belarus) default charset: windows-1251 - -OS Locale (lcid: 424, name: sl-SI): Slovenian (Slovenia) - 1250 + +OS Locale (lcid: 424, name: sl-SI): Slovenian (Slovenia) - 1250 default locale: ID: sl_SI, Name: Slovenian (Slovenia) display locale: ID: en_US, Name: English (United States) format locale: ID: sl_SI, Name: Slovenian (Slovenia) default charset: windows-1250 - -OS Locale (lcid: 425, name: et-EE): Estonian (Estonia) - 1257 + +OS Locale (lcid: 425, name: et-EE): Estonian (Estonia) - 1257 default locale: ID: et_EE, Name: Estonian (Estonia) display locale: ID: en_US, Name: English (United States) format locale: ID: et_EE, Name: Estonian (Estonia) default charset: windows-1257 - -OS Locale (lcid: 426, name: lv-LV): Latvian (Latvia) - 1257 + +OS Locale (lcid: 426, name: lv-LV): Latvian (Latvia) - 1257 default locale: ID: lv_LV, Name: Latvian (Latvia) display locale: ID: en_US, Name: English (United States) format locale: ID: lv_LV, Name: Latvian (Latvia) default charset: windows-1257 - -OS Locale (lcid: 427, name: lt-LT): Lithuanian (Lithuania) - 1257 + +OS Locale (lcid: 427, name: lt-LT): Lithuanian (Lithuania) - 1257 default locale: ID: lt_LT, Name: Lithuanian (Lithuania) display locale: ID: en_US, Name: English (United States) format locale: ID: lt_LT, Name: Lithuanian (Lithuania) default charset: windows-1257 - -OS Locale (lcid: 428, name: tg-Cyrl-TJ): Tajik (Cyrillic) (Tajikistan) - 1251 -default locale: ID: tg_TJ, Name: Tajik (Tajikistan) + +OS Locale (lcid: 428, name: tg-Cyrl-TJ): Tajik (Cyrillic) (Tajikistan) - 1251 +default locale: ID: tg_TJ_#Cyrl, Name: Tajik (Cyrillic,Tajikistan) display locale: ID: en_US, Name: English (United States) -format locale: ID: tg_TJ, Name: Tajik (Tajikistan) +format locale: ID: tg_TJ_#Cyrl, Name: Tajik (Cyrillic,Tajikistan) default charset: windows-1251 - -OS Locale (lcid: 428, name: tg-Cyrl): Tajik (Cyrillic) (Tajikistan) - 1251 -default locale: ID: tg_TJ, Name: Tajik (Tajikistan) + +OS Locale (lcid: 428, name: tg-Cyrl): Tajik (Cyrillic) (Tajikistan) - 1251 +default locale: ID: tg_TJ_#Cyrl, Name: Tajik (Cyrillic,Tajikistan) display locale: ID: en_US, Name: English (United States) -format locale: ID: tg_TJ, Name: Tajik (Tajikistan) +format locale: ID: tg_TJ_#Cyrl, Name: Tajik (Cyrillic,Tajikistan) default charset: windows-1251 - -OS Locale (lcid: 429, name: fa-IR): Persian (Iran) - 1256 + +OS Locale (lcid: 429, name: fa-IR): Persian (Iran) - 1256 default locale: ID: fa_IR, Name: Persian (Iran) display locale: ID: en_US, Name: English (United States) format locale: ID: fa_IR, Name: Persian (Iran) default charset: windows-1256 - -OS Locale (lcid: 42a, name: vi-VN): Vietnamese (Vietnam) - 1258 + +OS Locale (lcid: 42a, name: vi-VN): Vietnamese (Vietnam) - 1258 default locale: ID: vi_VN, Name: Vietnamese (Vietnam) display locale: ID: en_US, Name: English (United States) format locale: ID: vi_VN, Name: Vietnamese (Vietnam) default charset: windows-1258 - -OS Locale (lcid: 42b, name: hy-AM): Armenian (Armenia) - 0 + +OS Locale (lcid: 42b, name: hy-AM): Armenian (Armenia) - 0 default locale: ID: hy_AM, Name: Armenian (Armenia) display locale: ID: en_US, Name: English (United States) format locale: ID: hy_AM, Name: Armenian (Armenia) default charset: UTF-8 - -OS Locale (lcid: 42c, name: az-Latn-AZ): Azeri (Latin) (Azerbaijan) - 1254 -default locale: ID: az_AZ, Name: Azerbaijani (Azerbaijan) + +OS Locale (lcid: 42c, name: az-Latn-AZ): Azeri (Latin) (Azerbaijan) - 1254 +default locale: ID: az_AZ_#Latn, Name: Azerbaijani (Latin,Azerbaijan) display locale: ID: en_US, Name: English (United States) -format locale: ID: az_AZ, Name: Azerbaijani (Azerbaijan) +format locale: ID: az_AZ_#Latn, Name: Azerbaijani (Latin,Azerbaijan) default charset: windows-1254 - -OS Locale (lcid: 42c, name: az-Latn): Azeri (Latin) (Azerbaijan) - 1254 -default locale: ID: az_AZ, Name: Azerbaijani (Azerbaijan) + +OS Locale (lcid: 42c, name: az-Latn): Azeri (Latin) (Azerbaijan) - 1254 +default locale: ID: az_AZ_#Latn, Name: Azerbaijani (Latin,Azerbaijan) display locale: ID: en_US, Name: English (United States) -format locale: ID: az_AZ, Name: Azerbaijani (Azerbaijan) +format locale: ID: az_AZ_#Latn, Name: Azerbaijani (Latin,Azerbaijan) default charset: windows-1254 - -OS Locale (lcid: 42d, name: eu-ES): Basque (Spain) - 1252 + +OS Locale (lcid: 42d, name: eu-ES): Basque (Spain) - 1252 default locale: ID: eu_ES, Name: Basque (Spain) display locale: ID: en_US, Name: English (United States) format locale: ID: eu_ES, Name: Basque (Spain) default charset: windows-1252 - -OS Locale (lcid: 42e, name: hsb-DE): Upper Sorbian (Germany) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 42e, name: hsb-DE): Upper Sorbian (Germany) - 1252 +default locale: ID: hsb_DE, Name: Upper Sorbian (Germany) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: hsb_DE, Name: Upper Sorbian (Germany) default charset: windows-1252 - -OS Locale (lcid: 42e, name: hsb): Upper Sorbian (Germany) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 42e, name: hsb): Upper Sorbian (Germany) - 1252 +default locale: ID: hsb_DE, Name: Upper Sorbian (Germany) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: hsb_DE, Name: Upper Sorbian (Germany) default charset: windows-1252 - -OS Locale (lcid: 42f, name: mk-MK): Macedonian (FYROM) (Macedonia (FYROM)) - 1251 + +OS Locale (lcid: 42f, name: mk-MK): Macedonian (FYROM) (Macedonia (FYROM)) - 1251 default locale: ID: mk_MK, Name: Macedonian (Macedonia) display locale: ID: en_US, Name: English (United States) format locale: ID: mk_MK, Name: Macedonian (Macedonia) default charset: windows-1251 - -OS Locale (lcid: 432, name: tn-ZA): Setswana (South Africa) - 1252 + +OS Locale (lcid: 432, name: tn-ZA): Setswana (South Africa) - 1252 default locale: ID: tn_ZA, Name: Tswana (South Africa) display locale: ID: en_US, Name: English (United States) format locale: ID: tn_ZA, Name: Tswana (South Africa) default charset: windows-1252 - -OS Locale (lcid: 434, name: xh-ZA): isiXhosa (South Africa) - 1252 + +OS Locale (lcid: 434, name: xh-ZA): isiXhosa (South Africa) - 1252 default locale: ID: xh_ZA, Name: Xhosa (South Africa) display locale: ID: en_US, Name: English (United States) format locale: ID: xh_ZA, Name: Xhosa (South Africa) default charset: windows-1252 - -OS Locale (lcid: 435, name: zu-ZA): isiZulu (South Africa) - 1252 + +OS Locale (lcid: 435, name: zu-ZA): isiZulu (South Africa) - 1252 default locale: ID: zu_ZA, Name: Zulu (South Africa) display locale: ID: en_US, Name: English (United States) format locale: ID: zu_ZA, Name: Zulu (South Africa) default charset: windows-1252 - -OS Locale (lcid: 436, name: af-ZA): Afrikaans (South Africa) - 1252 + +OS Locale (lcid: 436, name: af-ZA): Afrikaans (South Africa) - 1252 default locale: ID: af_ZA, Name: Afrikaans (South Africa) display locale: ID: en_US, Name: English (United States) format locale: ID: af_ZA, Name: Afrikaans (South Africa) default charset: windows-1252 - -OS Locale (lcid: 437, name: ka-GE): Georgian (Georgia) - 0 + +OS Locale (lcid: 437, name: ka-GE): Georgian (Georgia) - 0 default locale: ID: ka_GE, Name: Georgian (Georgia) display locale: ID: en_US, Name: English (United States) format locale: ID: ka_GE, Name: Georgian (Georgia) default charset: UTF-8 - -OS Locale (lcid: 438, name: fo-FO): Faroese (Faroe Islands) - 1252 + +OS Locale (lcid: 438, name: fo-FO): Faroese (Faroe Islands) - 1252 default locale: ID: fo_FO, Name: Faroese (Faroe Islands) display locale: ID: en_US, Name: English (United States) format locale: ID: fo_FO, Name: Faroese (Faroe Islands) default charset: windows-1252 - -OS Locale (lcid: 439, name: hi-IN): Hindi (India) - 0 + +OS Locale (lcid: 439, name: hi-IN): Hindi (India) - 0 default locale: ID: hi_IN, Name: Hindi (India) display locale: ID: en_US, Name: English (United States) format locale: ID: hi_IN, Name: Hindi (India) default charset: UTF-8 - -OS Locale (lcid: 43a, name: mt-MT): Maltese (Malta) - 0 + +OS Locale (lcid: 43a, name: mt-MT): Maltese (Malta) - 0 default locale: ID: mt_MT, Name: Maltese (Malta) display locale: ID: en_US, Name: English (United States) format locale: ID: mt_MT, Name: Maltese (Malta) default charset: UTF-8 - -OS Locale (lcid: 43b, name: se-NO): Sami (Northern) (Norway) - 1252 + +OS Locale (lcid: 43b, name: se-NO): Sami (Northern) (Norway) - 1252 default locale: ID: se_NO, Name: Northern Sami (Norway) display locale: ID: en_US, Name: English (United States) format locale: ID: se_NO, Name: Northern Sami (Norway) default charset: windows-1252 - -OS Locale (lcid: 43e, name: ms-MY): Malay (Malaysia) - 1252 + +OS Locale (lcid: 43e, name: ms-MY): Malay (Malaysia) - 1252 default locale: ID: ms_MY, Name: Malay (Malaysia) display locale: ID: en_US, Name: English (United States) format locale: ID: ms_MY, Name: Malay (Malaysia) default charset: windows-1252 - -OS Locale (lcid: 43f, name: kk-KZ): Kazakh (Kazakhstan) - 0 + +OS Locale (lcid: 43f, name: kk-KZ): Kazakh (Kazakhstan) - 0 default locale: ID: kk_KZ, Name: Kazakh (Kazakhstan) display locale: ID: en_US, Name: English (United States) format locale: ID: kk_KZ, Name: Kazakh (Kazakhstan) default charset: UTF-8 - -OS Locale (lcid: 440, name: ky-KG): Kyrgyz (Kyrgyzstan) - 1251 + +OS Locale (lcid: 440, name: ky-KG): Kyrgyz (Kyrgyzstan) - 1251 default locale: ID: ky_KG, Name: Kirghiz (Kyrgyzstan) display locale: ID: en_US, Name: English (United States) format locale: ID: ky_KG, Name: Kirghiz (Kyrgyzstan) default charset: windows-1251 - -OS Locale (lcid: 441, name: sw-KE): Kiswahili (Kenya) - 1252 + +OS Locale (lcid: 441, name: sw-KE): Kiswahili (Kenya) - 1252 default locale: ID: sw_KE, Name: Swahili (Kenya) display locale: ID: en_US, Name: English (United States) format locale: ID: sw_KE, Name: Swahili (Kenya) default charset: windows-1252 - -OS Locale (lcid: 442, name: tk-TM): Turkmen (Turkmenistan) - 1250 + +OS Locale (lcid: 442, name: tk-TM): Turkmen (Turkmenistan) - 1250 default locale: ID: tk_TM, Name: Turkmen (Turkmenistan) display locale: ID: en_US, Name: English (United States) format locale: ID: tk_TM, Name: Turkmen (Turkmenistan) default charset: windows-1250 - -OS Locale (lcid: 443, name: uz-Latn): Uzbek (Latin) (Uzbekistan) - 1254 -default locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) + +OS Locale (lcid: 443, name: uz-Latn): Uzbek (Latin) (Uzbekistan) - 1254 +default locale: ID: uz_UZ_#Latn, Name: Uzbek (Latin,Uzbekistan) display locale: ID: en_US, Name: English (United States) -format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) +format locale: ID: uz_UZ_#Latn, Name: Uzbek (Latin,Uzbekistan) default charset: windows-1254 - -OS Locale (lcid: 443, name: uz-Latn-UZ): Uzbek (Latin) (Uzbekistan) - 1254 -default locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) + +OS Locale (lcid: 443, name: uz-Latn-UZ): Uzbek (Latin) (Uzbekistan) - 1254 +default locale: ID: uz_UZ_#Latn, Name: Uzbek (Latin,Uzbekistan) display locale: ID: en_US, Name: English (United States) -format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) +format locale: ID: uz_UZ_#Latn, Name: Uzbek (Latin,Uzbekistan) default charset: windows-1254 - -OS Locale (lcid: 444, name: tt-RU): Tatar (Russia) - 1251 + +OS Locale (lcid: 444, name: tt-RU): Tatar (Russia) - 1251 default locale: ID: tt_RU, Name: Tatar (Russia) display locale: ID: en_US, Name: English (United States) format locale: ID: tt_RU, Name: Tatar (Russia) default charset: windows-1251 - -OS Locale (lcid: 445, name: bn-IN): Bengali (India) - 0 + +OS Locale (lcid: 445, name: bn-IN): Bengali (India) - 0 default locale: ID: bn_IN, Name: Bengali (India) display locale: ID: en_US, Name: English (United States) format locale: ID: bn_IN, Name: Bengali (India) default charset: UTF-8 - -OS Locale (lcid: 446, name: pa-IN): Punjabi (India) - 0 + +OS Locale (lcid: 446, name: pa-IN): Punjabi (India) - 0 default locale: ID: pa_IN, Name: Panjabi (India) display locale: ID: en_US, Name: English (United States) format locale: ID: pa_IN, Name: Panjabi (India) default charset: UTF-8 - -OS Locale (lcid: 447, name: gu-IN): Gujarati (India) - 0 + +OS Locale (lcid: 447, name: gu-IN): Gujarati (India) - 0 default locale: ID: gu_IN, Name: Gujarati (India) display locale: ID: en_US, Name: English (United States) format locale: ID: gu_IN, Name: Gujarati (India) default charset: UTF-8 - -OS Locale (lcid: 448, name: or-IN): Oriya (India) - 0 + +OS Locale (lcid: 448, name: or-IN): Oriya (India) - 0 default locale: ID: or_IN, Name: Oriya (India) display locale: ID: en_US, Name: English (United States) format locale: ID: or_IN, Name: Oriya (India) default charset: UTF-8 - -OS Locale (lcid: 449, name: ta-IN): Tamil (India) - 0 + +OS Locale (lcid: 449, name: ta-IN): Tamil (India) - 0 default locale: ID: ta_IN, Name: Tamil (India) display locale: ID: en_US, Name: English (United States) format locale: ID: ta_IN, Name: Tamil (India) default charset: UTF-8 - -OS Locale (lcid: 44a, name: te-IN): Telugu (India) - 0 + +OS Locale (lcid: 44a, name: te-IN): Telugu (India) - 0 default locale: ID: te_IN, Name: Telugu (India) display locale: ID: en_US, Name: English (United States) format locale: ID: te_IN, Name: Telugu (India) default charset: UTF-8 - -OS Locale (lcid: 44b, name: kn-IN): Kannada (India) - 0 + +OS Locale (lcid: 44b, name: kn-IN): Kannada (India) - 0 default locale: ID: kn_IN, Name: Kannada (India) display locale: ID: en_US, Name: English (United States) format locale: ID: kn_IN, Name: Kannada (India) default charset: UTF-8 - -OS Locale (lcid: 44c, name: ml-IN): Malayalam (India) - 0 + +OS Locale (lcid: 44c, name: ml-IN): Malayalam (India) - 0 default locale: ID: ml_IN, Name: Malayalam (India) display locale: ID: en_US, Name: English (United States) format locale: ID: ml_IN, Name: Malayalam (India) default charset: UTF-8 - -OS Locale (lcid: 44d, name: as-IN): Assamese (India) - 0 + +OS Locale (lcid: 44d, name: as-IN): Assamese (India) - 0 default locale: ID: as_IN, Name: Assamese (India) display locale: ID: en_US, Name: English (United States) format locale: ID: as_IN, Name: Assamese (India) default charset: UTF-8 - -OS Locale (lcid: 44e, name: mr-IN): Marathi (India) - 0 + +OS Locale (lcid: 44e, name: mr-IN): Marathi (India) - 0 default locale: ID: mr_IN, Name: Marathi (India) display locale: ID: en_US, Name: English (United States) format locale: ID: mr_IN, Name: Marathi (India) default charset: UTF-8 - -OS Locale (lcid: 44f, name: sa-IN): Sanskrit (India) - 0 + +OS Locale (lcid: 44f, name: sa-IN): Sanskrit (India) - 0 default locale: ID: sa_IN, Name: Sanskrit (India) display locale: ID: en_US, Name: English (United States) format locale: ID: sa_IN, Name: Sanskrit (India) default charset: UTF-8 - -OS Locale (lcid: 450, name: mn-MN): Mongolian (Cyrillic) (Mongolia) - 1251 + +OS Locale (lcid: 450, name: mn-MN): Mongolian (Cyrillic) (Mongolia) - 1251 default locale: ID: mn_MN, Name: Mongolian (Mongolia) display locale: ID: en_US, Name: English (United States) format locale: ID: mn_MN, Name: Mongolian (Mongolia) default charset: windows-1251 - -OS Locale (lcid: 450, name: mn-Cyrl): Mongolian (Cyrillic) (Mongolia) - 1251 + +OS Locale (lcid: 450, name: mn-Cyrl): Mongolian (Cyrillic) (Mongolia) - 1251 default locale: ID: mn_MN, Name: Mongolian (Mongolia) display locale: ID: en_US, Name: English (United States) format locale: ID: mn_MN, Name: Mongolian (Mongolia) default charset: windows-1251 - -OS Locale (lcid: 451, name: bo-CN): Tibetan (People's Republic of China) - 0 + +OS Locale (lcid: 451, name: bo-CN): Tibetan (People's Republic of China) - 0 default locale: ID: bo_CN, Name: Tibetan (China) display locale: ID: en_US, Name: English (United States) format locale: ID: bo_CN, Name: Tibetan (China) default charset: UTF-8 - -OS Locale (lcid: 452, name: cy-GB): Welsh (United Kingdom) - 1252 + +OS Locale (lcid: 452, name: cy-GB): Welsh (United Kingdom) - 1252 default locale: ID: cy_GB, Name: Welsh (United Kingdom) display locale: ID: en_US, Name: English (United States) format locale: ID: cy_GB, Name: Welsh (United Kingdom) default charset: windows-1252 - -OS Locale (lcid: 453, name: km-KH): Khmer (Cambodia) - 0 + +OS Locale (lcid: 453, name: km-KH): Khmer (Cambodia) - 0 default locale: ID: km_KH, Name: Khmer (Cambodia) display locale: ID: en_US, Name: English (United States) format locale: ID: km_KH, Name: Khmer (Cambodia) default charset: UTF-8 - -OS Locale (lcid: 454, name: lo-LA): Lao (Lao P.D.R.) - 0 + +OS Locale (lcid: 454, name: lo-LA): Lao (Lao P.D.R.) - 0 default locale: ID: lo_LA, Name: Lao (Laos) display locale: ID: en_US, Name: English (United States) format locale: ID: lo_LA, Name: Lao (Laos) default charset: UTF-8 - -OS Locale (lcid: 456, name: gl-ES): Galician (Spain) - 1252 + +OS Locale (lcid: 456, name: gl-ES): Galician (Spain) - 1252 default locale: ID: gl_ES, Name: Gallegan (Spain) display locale: ID: en_US, Name: English (United States) format locale: ID: gl_ES, Name: Gallegan (Spain) default charset: windows-1252 - -OS Locale (lcid: 457, name: kok-IN): Konkani (India) - 0 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 457, name: kok-IN): Konkani (India) - 0 +default locale: ID: kok_IN, Name: Konkani (India) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: kok_IN, Name: Konkani (India) default charset: UTF-8 - -OS Locale (lcid: 457, name: kok): Konkani (India) - 0 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 457, name: kok): Konkani (India) - 0 +default locale: ID: kok_IN, Name: Konkani (India) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: kok_IN, Name: Konkani (India) default charset: UTF-8 - -OS Locale (lcid: 45a, name: syr): Syriac (Syria) - 0 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 45a, name: syr): Syriac (Syria) - 0 +default locale: ID: syr_SY, Name: Syriac (Syria) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: syr_SY, Name: Syriac (Syria) default charset: UTF-8 - -OS Locale (lcid: 45a, name: syr-SY): Syriac (Syria) - 0 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 45a, name: syr-SY): Syriac (Syria) - 0 +default locale: ID: syr_SY, Name: Syriac (Syria) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: syr_SY, Name: Syriac (Syria) default charset: UTF-8 - -OS Locale (lcid: 45b, name: si-LK): Sinhala (Sri Lanka) - 0 + +OS Locale (lcid: 45b, name: si-LK): Sinhala (Sri Lanka) - 0 default locale: ID: si_LK, Name: Sinhalese (Sri Lanka) display locale: ID: en_US, Name: English (United States) format locale: ID: si_LK, Name: Sinhalese (Sri Lanka) default charset: UTF-8 - -OS Locale (lcid: 45d, name: iu-Cans-CA): Inuktitut (Syllabics) (Canada) - 0 -default locale: ID: iu_CA, Name: Inuktitut (Canada) + +OS Locale (lcid: 45d, name: iu-Cans-CA): Inuktitut (Syllabics) (Canada) - 0 +default locale: ID: iu_CA_#Cans, Name: Inuktitut (Unified Canadian Aboriginal Syllabics,Canada) display locale: ID: en_US, Name: English (United States) -format locale: ID: iu_CA, Name: Inuktitut (Canada) +format locale: ID: iu_CA_#Cans, Name: Inuktitut (Unified Canadian Aboriginal Syllabics,Canada) default charset: UTF-8 - -OS Locale (lcid: 45d, name: iu-Cans): Inuktitut (Syllabics) (Canada) - 0 -default locale: ID: iu_CA, Name: Inuktitut (Canada) + +OS Locale (lcid: 45d, name: iu-Cans): Inuktitut (Syllabics) (Canada) - 0 +default locale: ID: iu_CA_#Cans, Name: Inuktitut (Unified Canadian Aboriginal Syllabics,Canada) display locale: ID: en_US, Name: English (United States) -format locale: ID: iu_CA, Name: Inuktitut (Canada) +format locale: ID: iu_CA_#Cans, Name: Inuktitut (Unified Canadian Aboriginal Syllabics,Canada) default charset: UTF-8 - -OS Locale (lcid: 45e, name: am-ET): Amharic (Ethiopia) - 0 + +OS Locale (lcid: 45e, name: am-ET): Amharic (Ethiopia) - 0 default locale: ID: am_ET, Name: Amharic (Ethiopia) display locale: ID: en_US, Name: English (United States) format locale: ID: am_ET, Name: Amharic (Ethiopia) default charset: UTF-8 - -OS Locale (lcid: 461, name: ne-NP): Nepali (Nepal) - 0 + +OS Locale (lcid: 461, name: ne-NP): Nepali (Nepal) - 0 default locale: ID: ne_NP, Name: Nepali (Nepal) display locale: ID: en_US, Name: English (United States) format locale: ID: ne_NP, Name: Nepali (Nepal) default charset: UTF-8 - -OS Locale (lcid: 462, name: fy-NL): Frisian (Netherlands) - 1252 + +OS Locale (lcid: 462, name: fy-NL): Frisian (Netherlands) - 1252 default locale: ID: fy_NL, Name: Frisian (Netherlands) display locale: ID: en_US, Name: English (United States) format locale: ID: fy_NL, Name: Frisian (Netherlands) default charset: windows-1252 - -OS Locale (lcid: 463, name: ps-AF): Pashto (Afghanistan) - 0 + +OS Locale (lcid: 463, name: ps-AF): Pashto (Afghanistan) - 0 default locale: ID: ps_AF, Name: Pushto (Afghanistan) display locale: ID: en_US, Name: English (United States) format locale: ID: ps_AF, Name: Pushto (Afghanistan) default charset: UTF-8 - -OS Locale (lcid: 464, name: fil-PH): Filipino (Philippines) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 464, name: fil-PH): Filipino (Philippines) - 1252 +default locale: ID: fil_PH, Name: Filipino (Philippines) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: fil_PH, Name: Filipino (Philippines) default charset: windows-1252 - -OS Locale (lcid: 464, name: fil): Filipino (Philippines) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 464, name: fil): Filipino (Philippines) - 1252 +default locale: ID: fil_PH, Name: Filipino (Philippines) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: fil_PH, Name: Filipino (Philippines) default charset: windows-1252 - -OS Locale (lcid: 465, name: dv-MV): Divehi (Maldives) - 0 + +OS Locale (lcid: 465, name: dv-MV): Divehi (Maldives) - 0 default locale: ID: dv_MV, Name: Divehi (Maldives) display locale: ID: en_US, Name: English (United States) format locale: ID: dv_MV, Name: Divehi (Maldives) default charset: UTF-8 - -OS Locale (lcid: 468, name: ha-Latn-NG): Hausa (Latin) (Nigeria) - 1252 -default locale: ID: ha_NG, Name: Hausa (Nigeria) + +OS Locale (lcid: 468, name: ha-Latn-NG): Hausa (Latin) (Nigeria) - 1252 +default locale: ID: ha_NG_#Latn, Name: Hausa (Latin,Nigeria) display locale: ID: en_US, Name: English (United States) -format locale: ID: ha_NG, Name: Hausa (Nigeria) +format locale: ID: ha_NG_#Latn, Name: Hausa (Latin,Nigeria) default charset: windows-1252 - -OS Locale (lcid: 468, name: ha-Latn): Hausa (Latin) (Nigeria) - 1252 -default locale: ID: ha_NG, Name: Hausa (Nigeria) + +OS Locale (lcid: 468, name: ha-Latn): Hausa (Latin) (Nigeria) - 1252 +default locale: ID: ha_NG_#Latn, Name: Hausa (Latin,Nigeria) display locale: ID: en_US, Name: English (United States) -format locale: ID: ha_NG, Name: Hausa (Nigeria) +format locale: ID: ha_NG_#Latn, Name: Hausa (Latin,Nigeria) default charset: windows-1252 - -OS Locale (lcid: 46a, name: yo-NG): Yoruba (Nigeria) - 1252 + +OS Locale (lcid: 46a, name: yo-NG): Yoruba (Nigeria) - 1252 default locale: ID: yo_NG, Name: Yoruba (Nigeria) display locale: ID: en_US, Name: English (United States) format locale: ID: yo_NG, Name: Yoruba (Nigeria) default charset: windows-1252 - -OS Locale (lcid: 46b, name: quz): Quechua (Bolivia) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 46b, name: quz): Quechua (Bolivia) - 1252 +default locale: ID: quz_BO, Name: quz (Bolivia) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: quz_BO, Name: quz (Bolivia) default charset: windows-1252 - -OS Locale (lcid: 46b, name: quz-BO): Quechua (Bolivia) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 46b, name: quz-BO): Quechua (Bolivia) - 1252 +default locale: ID: quz_BO, Name: quz (Bolivia) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: quz_BO, Name: quz (Bolivia) default charset: windows-1252 - -OS Locale (lcid: 46c, name: nso): Sesotho sa Leboa (South Africa) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 46c, name: nso): Sesotho sa Leboa (South Africa) - 1252 +default locale: ID: nso_ZA, Name: Pedi (South Africa) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: nso_ZA, Name: Pedi (South Africa) default charset: windows-1252 - -OS Locale (lcid: 46c, name: nso-ZA): Sesotho sa Leboa (South Africa) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 46c, name: nso-ZA): Sesotho sa Leboa (South Africa) - 1252 +default locale: ID: nso_ZA, Name: Pedi (South Africa) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: nso_ZA, Name: Pedi (South Africa) default charset: windows-1252 - -OS Locale (lcid: 46d, name: ba-RU): Bashkir (Russia) - 1251 + +OS Locale (lcid: 46d, name: ba-RU): Bashkir (Russia) - 1251 default locale: ID: ba_RU, Name: Bashkir (Russia) display locale: ID: en_US, Name: English (United States) format locale: ID: ba_RU, Name: Bashkir (Russia) default charset: windows-1251 - -OS Locale (lcid: 46e, name: lb-LU): Luxembourgish (Luxembourg) - 1252 + +OS Locale (lcid: 46e, name: lb-LU): Luxembourgish (Luxembourg) - 1252 default locale: ID: lb_LU, Name: Luxembourgish (Luxembourg) display locale: ID: en_US, Name: English (United States) format locale: ID: lb_LU, Name: Luxembourgish (Luxembourg) default charset: windows-1252 - -OS Locale (lcid: 46f, name: kl-GL): Greenlandic (Greenland) - 1252 + +OS Locale (lcid: 46f, name: kl-GL): Greenlandic (Greenland) - 1252 default locale: ID: kl_GL, Name: Greenlandic (Greenland) display locale: ID: en_US, Name: English (United States) format locale: ID: kl_GL, Name: Greenlandic (Greenland) default charset: windows-1252 - -OS Locale (lcid: 470, name: ig-NG): Igbo (Nigeria) - 1252 + +OS Locale (lcid: 470, name: ig-NG): Igbo (Nigeria) - 1252 default locale: ID: ig_NG, Name: Igbo (Nigeria) display locale: ID: en_US, Name: English (United States) format locale: ID: ig_NG, Name: Igbo (Nigeria) default charset: windows-1252 - -OS Locale (lcid: 478, name: ii-CN): Yi (People's Republic of China) - 0 + +OS Locale (lcid: 478, name: ii-CN): Yi (People's Republic of China) - 0 default locale: ID: ii_CN, Name: Sichuan Yi (China) display locale: ID: en_US, Name: English (United States) format locale: ID: ii_CN, Name: Sichuan Yi (China) default charset: UTF-8 - -OS Locale (lcid: 47a, name: arn): Mapudungun (Chile) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 47a, name: arn): Mapudungun (Chile) - 1252 +default locale: ID: arn_CL, Name: Mapudungun (Chile) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: arn_CL, Name: Mapudungun (Chile) default charset: windows-1252 - -OS Locale (lcid: 47a, name: arn-CL): Mapudungun (Chile) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 47a, name: arn-CL): Mapudungun (Chile) - 1252 +default locale: ID: arn_CL, Name: Mapudungun (Chile) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: arn_CL, Name: Mapudungun (Chile) default charset: windows-1252 - -OS Locale (lcid: 47c, name: moh): Mohawk (Canada) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 47c, name: moh): Mohawk (Canada) - 1252 +default locale: ID: moh_CA, Name: Mohawk (Canada) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: moh_CA, Name: Mohawk (Canada) default charset: windows-1252 - -OS Locale (lcid: 47c, name: moh-CA): Mohawk (Canada) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 47c, name: moh-CA): Mohawk (Canada) - 1252 +default locale: ID: moh_CA, Name: Mohawk (Canada) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: moh_CA, Name: Mohawk (Canada) default charset: windows-1252 - -OS Locale (lcid: 47e, name: br-FR): Breton (France) - 1252 + +OS Locale (lcid: 47e, name: br-FR): Breton (France) - 1252 default locale: ID: br_FR, Name: Breton (France) display locale: ID: en_US, Name: English (United States) format locale: ID: br_FR, Name: Breton (France) default charset: windows-1252 - -OS Locale (lcid: 480, name: ug-CN): Uyghur (People's Republic of China) - 1256 + +OS Locale (lcid: 480, name: ug-CN): Uyghur (People's Republic of China) - 1256 default locale: ID: ug_CN, Name: Uighur (China) display locale: ID: en_US, Name: English (United States) format locale: ID: ug_CN, Name: Uighur (China) default charset: windows-1256 - -OS Locale (lcid: 481, name: mi-NZ): Maori (New Zealand) - 0 + +OS Locale (lcid: 481, name: mi-NZ): Maori (New Zealand) - 0 default locale: ID: mi_NZ, Name: Maori (New Zealand) display locale: ID: en_US, Name: English (United States) format locale: ID: mi_NZ, Name: Maori (New Zealand) default charset: UTF-8 - -OS Locale (lcid: 482, name: oc-FR): Occitan (France) - 1252 + +OS Locale (lcid: 482, name: oc-FR): Occitan (France) - 1252 default locale: ID: oc_FR, Name: Occitan (France) display locale: ID: en_US, Name: English (United States) format locale: ID: oc_FR, Name: Occitan (France) default charset: windows-1252 - -OS Locale (lcid: 483, name: co-FR): Corsican (France) - 1252 + +OS Locale (lcid: 483, name: co-FR): Corsican (France) - 1252 default locale: ID: co_FR, Name: Corsican (France) display locale: ID: en_US, Name: English (United States) format locale: ID: co_FR, Name: Corsican (France) default charset: windows-1252 - -OS Locale (lcid: 484, name: gsw): Alsatian (France) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 484, name: gsw): Alsatian (France) - 1252 +default locale: ID: gsw_FR, Name: Swiss German (France) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: gsw_FR, Name: Swiss German (France) default charset: windows-1252 - -OS Locale (lcid: 484, name: gsw-FR): Alsatian (France) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 484, name: gsw-FR): Alsatian (France) - 1252 +default locale: ID: gsw_FR, Name: Swiss German (France) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: gsw_FR, Name: Swiss German (France) default charset: windows-1252 - -OS Locale (lcid: 485, name: sah): Yakut (Russia) - 1251 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 485, name: sah): Yakut (Russia) - 1251 +default locale: ID: sah_RU, Name: Yakut (Russia) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sah_RU, Name: Yakut (Russia) default charset: windows-1251 - -OS Locale (lcid: 485, name: sah-RU): Yakut (Russia) - 1251 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 485, name: sah-RU): Yakut (Russia) - 1251 +default locale: ID: sah_RU, Name: Yakut (Russia) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sah_RU, Name: Yakut (Russia) default charset: windows-1251 - -OS Locale (lcid: 486, name: qut): K'iche (Guatemala) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 486, name: qut): K'iche (Guatemala) - 1252 +default locale: ID: qut_GT, Name: qut (Guatemala) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: qut_GT, Name: qut (Guatemala) default charset: windows-1252 - -OS Locale (lcid: 486, name: qut-GT): K'iche (Guatemala) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 486, name: qut-GT): K'iche (Guatemala) - 1252 +default locale: ID: qut_GT, Name: qut (Guatemala) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: qut_GT, Name: qut (Guatemala) default charset: windows-1252 - -OS Locale (lcid: 487, name: rw-RW): Kinyarwanda (Rwanda) - 1252 + +OS Locale (lcid: 487, name: rw-RW): Kinyarwanda (Rwanda) - 1252 default locale: ID: rw_RW, Name: Kinyarwanda (Rwanda) display locale: ID: en_US, Name: English (United States) format locale: ID: rw_RW, Name: Kinyarwanda (Rwanda) default charset: windows-1252 - -OS Locale (lcid: 488, name: wo-SN): Wolof (Senegal) - 1252 + +OS Locale (lcid: 488, name: wo-SN): Wolof (Senegal) - 1252 default locale: ID: wo_SN, Name: Wolof (Senegal) display locale: ID: en_US, Name: English (United States) format locale: ID: wo_SN, Name: Wolof (Senegal) default charset: windows-1252 - -OS Locale (lcid: 48c, name: prs): Dari (Afghanistan) - 1256 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 48c, name: prs): Dari (Afghanistan) - 1256 +default locale: ID: prs_AF, Name: prs (Afghanistan) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: prs_AF, Name: prs (Afghanistan) default charset: windows-1256 - -OS Locale (lcid: 48c, name: prs-AF): Dari (Afghanistan) - 1256 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 48c, name: prs-AF): Dari (Afghanistan) - 1256 +default locale: ID: prs_AF, Name: prs (Afghanistan) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: prs_AF, Name: prs (Afghanistan) default charset: windows-1256 - -OS Locale (lcid: 491, name: gd-GB): Scottish Gaelic (United Kingdom) - 1252 + +OS Locale (lcid: 491, name: gd-GB): Scottish Gaelic (United Kingdom) - 1252 default locale: ID: gd_GB, Name: Scottish Gaelic (United Kingdom) display locale: ID: en_US, Name: English (United States) format locale: ID: gd_GB, Name: Scottish Gaelic (United Kingdom) default charset: windows-1252 - -OS Locale (lcid: 801, name: ar-IQ): Arabic (Iraq) - 1256 + +OS Locale (lcid: 801, name: ar-IQ): Arabic (Iraq) - 1256 default locale: ID: ar_IQ, Name: Arabic (Iraq) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_IQ, Name: Arabic (Iraq) default charset: windows-1256 - -OS Locale (lcid: 804, name: zh-Hans): Chinese (Simplified) (People's Republic of China) - 936 + +OS Locale (lcid: 804, name: zh-Hans): Chinese (Simplified) (People's Republic of China) - 936 default locale: ID: zh_CN, Name: Chinese (China) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_CN, Name: Chinese (China) default charset: GBK - -OS Locale (lcid: 804, name: zh-CN): Chinese (Simplified) (People's Republic of China) - 936 + +OS Locale (lcid: 804, name: zh-CN): Chinese (Simplified) (People's Republic of China) - 936 default locale: ID: zh_CN, Name: Chinese (China) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_CN, Name: Chinese (China) default charset: GBK - -OS Locale (lcid: 807, name: de-CH): German (Switzerland) - 1252 + +OS Locale (lcid: 807, name: de-CH): German (Switzerland) - 1252 default locale: ID: de_CH, Name: German (Switzerland) display locale: ID: en_US, Name: English (United States) format locale: ID: de_CH, Name: German (Switzerland) default charset: windows-1252 - -OS Locale (lcid: 809, name: en-GB): English (United Kingdom) - 1252 + +OS Locale (lcid: 809, name: en-GB): English (United Kingdom) - 1252 default locale: ID: en_GB, Name: English (United Kingdom) -display locale: ID: en_GB, Name: English (United Kingdom) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_GB, Name: English (United Kingdom) default charset: windows-1252 - -OS Locale (lcid: 80a, name: es-MX): Spanish (Mexico) - 1252 + +OS Locale (lcid: 80a, name: es-MX): Spanish (Mexico) - 1252 default locale: ID: es_MX, Name: Spanish (Mexico) display locale: ID: en_US, Name: English (United States) format locale: ID: es_MX, Name: Spanish (Mexico) default charset: windows-1252 - -OS Locale (lcid: 80c, name: fr-BE): French (Belgium) - 1252 + +OS Locale (lcid: 80c, name: fr-BE): French (Belgium) - 1252 default locale: ID: fr_BE, Name: French (Belgium) display locale: ID: en_US, Name: English (United States) format locale: ID: fr_BE, Name: French (Belgium) default charset: windows-1252 - -OS Locale (lcid: 810, name: it-CH): Italian (Switzerland) - 1252 + +OS Locale (lcid: 810, name: it-CH): Italian (Switzerland) - 1252 default locale: ID: it_CH, Name: Italian (Switzerland) display locale: ID: en_US, Name: English (United States) format locale: ID: it_CH, Name: Italian (Switzerland) default charset: windows-1252 - -OS Locale (lcid: 813, name: nl-BE): Dutch (Belgium) - 1252 + +OS Locale (lcid: 813, name: nl-BE): Dutch (Belgium) - 1252 default locale: ID: nl_BE, Name: Dutch (Belgium) display locale: ID: en_US, Name: English (United States) format locale: ID: nl_BE, Name: Dutch (Belgium) default charset: windows-1252 - -OS Locale (lcid: 814, name: nn-NO): Norwegian (Nynorsk) (Norway) - 1252 + +OS Locale (lcid: 814, name: nn-NO): Norwegian (Nynorsk) (Norway) - 1252 default locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk) display locale: ID: en_US, Name: English (United States) format locale: ID: no_NO_NY, Name: Norwegian (Norway,Nynorsk) default charset: windows-1252 - -OS Locale (lcid: 816, name: pt-PT): Portuguese (Portugal) - 1252 + +OS Locale (lcid: 816, name: pt-PT): Portuguese (Portugal) - 1252 default locale: ID: pt_PT, Name: Portuguese (Portugal) display locale: ID: en_US, Name: English (United States) format locale: ID: pt_PT, Name: Portuguese (Portugal) default charset: windows-1252 - -OS Locale (lcid: 81a, name: sr-Latn-CS): Serbian (Latin) (Serbia and Montenegro (Former)) - 1250 -default locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) + +OS Locale (lcid: 81a, name: sr-Latn-CS): Serbian (Latin) (Serbia and Montenegro (Former)) - 1250 +default locale: ID: sr_CS_#Latn, Name: Serbian (Latin,Serbia and Montenegro) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) +format locale: ID: sr_CS_#Latn, Name: Serbian (Latin,Serbia and Montenegro) default charset: windows-1250 - -OS Locale (lcid: 81d, name: sv-FI): Swedish (Finland) - 1252 + +OS Locale (lcid: 81d, name: sv-FI): Swedish (Finland) - 1252 default locale: ID: sv_FI, Name: Swedish (Finland) display locale: ID: en_US, Name: English (United States) format locale: ID: sv_FI, Name: Swedish (Finland) default charset: windows-1252 - -OS Locale (lcid: 82c, name: az-Cyrl-AZ): Azeri (Cyrillic) (Azerbaijan) - 1251 -default locale: ID: az_AZ, Name: Azerbaijani (Azerbaijan) + +OS Locale (lcid: 82c, name: az-Cyrl-AZ): Azeri (Cyrillic) (Azerbaijan) - 1251 +default locale: ID: az_AZ_#Cyrl, Name: Azerbaijani (Cyrillic,Azerbaijan) display locale: ID: en_US, Name: English (United States) -format locale: ID: az_AZ, Name: Azerbaijani (Azerbaijan) +format locale: ID: az_AZ_#Cyrl, Name: Azerbaijani (Cyrillic,Azerbaijan) default charset: windows-1251 - -OS Locale (lcid: 82c, name: az-Cyrl): Azeri (Cyrillic) (Azerbaijan) - 1251 -default locale: ID: az_AZ, Name: Azerbaijani (Azerbaijan) + +OS Locale (lcid: 82c, name: az-Cyrl): Azeri (Cyrillic) (Azerbaijan) - 1251 +default locale: ID: az_AZ_#Cyrl, Name: Azerbaijani (Cyrillic,Azerbaijan) display locale: ID: en_US, Name: English (United States) -format locale: ID: az_AZ, Name: Azerbaijani (Azerbaijan) +format locale: ID: az_AZ_#Cyrl, Name: Azerbaijani (Cyrillic,Azerbaijan) default charset: windows-1251 - -OS Locale (lcid: 82e, name: dsb): Lower Sorbian (Germany) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 82e, name: dsb): Lower Sorbian (Germany) - 1252 +default locale: ID: dsb_DE, Name: Lower Sorbian (Germany) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: dsb_DE, Name: Lower Sorbian (Germany) default charset: windows-1252 - -OS Locale (lcid: 82e, name: dsb-DE): Lower Sorbian (Germany) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 82e, name: dsb-DE): Lower Sorbian (Germany) - 1252 +default locale: ID: dsb_DE, Name: Lower Sorbian (Germany) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: dsb_DE, Name: Lower Sorbian (Germany) default charset: windows-1252 - -OS Locale (lcid: 83b, name: se-SE): Sami (Northern) (Sweden) - 1252 + +OS Locale (lcid: 83b, name: se-SE): Sami (Northern) (Sweden) - 1252 default locale: ID: se_SE, Name: Northern Sami (Sweden) display locale: ID: en_US, Name: English (United States) format locale: ID: se_SE, Name: Northern Sami (Sweden) default charset: windows-1252 - -OS Locale (lcid: 83c, name: ga-IE): Irish (Ireland) - 1252 + +OS Locale (lcid: 83c, name: ga-IE): Irish (Ireland) - 1252 default locale: ID: ga_IE, Name: Irish (Ireland) display locale: ID: en_US, Name: English (United States) format locale: ID: ga_IE, Name: Irish (Ireland) default charset: windows-1252 - -OS Locale (lcid: 83e, name: ms-BN): Malay (Brunei Darussalam) - 1252 + +OS Locale (lcid: 83e, name: ms-BN): Malay (Brunei Darussalam) - 1252 default locale: ID: ms_BN, Name: Malay (Brunei) display locale: ID: en_US, Name: English (United States) format locale: ID: ms_BN, Name: Malay (Brunei) default charset: windows-1252 - -OS Locale (lcid: 843, name: uz-Cyrl-UZ): Uzbek (Cyrillic) (Uzbekistan) - 1251 -default locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) + +OS Locale (lcid: 843, name: uz-Cyrl-UZ): Uzbek (Cyrillic) (Uzbekistan) - 1251 +default locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) display locale: ID: en_US, Name: English (United States) -format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) +format locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) default charset: windows-1251 - -OS Locale (lcid: 843, name: uz-Cyrl): Uzbek (Cyrillic) (Uzbekistan) - 1251 -default locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) + +OS Locale (lcid: 843, name: uz-Cyrl): Uzbek (Cyrillic) (Uzbekistan) - 1251 +default locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) display locale: ID: en_US, Name: English (United States) -format locale: ID: uz_UZ, Name: Uzbek (Uzbekistan) +format locale: ID: uz_UZ_#Cyrl, Name: Uzbek (Cyrillic,Uzbekistan) default charset: windows-1251 - -OS Locale (lcid: 845, name: bn-BD): Bengali (Bangladesh) - 0 + +OS Locale (lcid: 845, name: bn-BD): Bengali (Bangladesh) - 0 default locale: ID: bn_BD, Name: Bengali (Bangladesh) display locale: ID: en_US, Name: English (United States) format locale: ID: bn_BD, Name: Bengali (Bangladesh) default charset: UTF-8 - -OS Locale (lcid: 850, name: mn-Mong-CN): Mongolian (Traditional Mongolian) (People's Republic of China) - 0 -default locale: ID: mn_CN, Name: Mongolian (China) + +OS Locale (lcid: 850, name: mn-Mong-CN): Mongolian (Traditional Mongolian) (People's Republic of China) - 0 +default locale: ID: mn_CN_#Mong, Name: Mongolian (Mongolian,China) display locale: ID: en_US, Name: English (United States) -format locale: ID: mn_CN, Name: Mongolian (China) +format locale: ID: mn_CN_#Mong, Name: Mongolian (Mongolian,China) default charset: UTF-8 - -OS Locale (lcid: 850, name: mn-Mong): Mongolian (Traditional Mongolian) (People's Republic of China) - 0 -default locale: ID: mn_CN, Name: Mongolian (China) + +OS Locale (lcid: 850, name: mn-Mong): Mongolian (Traditional Mongolian) (People's Republic of China) - 0 +default locale: ID: mn_CN_#Mong, Name: Mongolian (Mongolian,China) display locale: ID: en_US, Name: English (United States) -format locale: ID: mn_CN, Name: Mongolian (China) +format locale: ID: mn_CN_#Mong, Name: Mongolian (Mongolian,China) default charset: UTF-8 - -OS Locale (lcid: 85d, name: iu-Latn): Inuktitut (Latin) (Canada) - 1252 -default locale: ID: iu_CA, Name: Inuktitut (Canada) + +OS Locale (lcid: 85d, name: iu-Latn): Inuktitut (Latin) (Canada) - 1252 +default locale: ID: iu_CA_#Latn, Name: Inuktitut (Latin,Canada) display locale: ID: en_US, Name: English (United States) -format locale: ID: iu_CA, Name: Inuktitut (Canada) +format locale: ID: iu_CA_#Latn, Name: Inuktitut (Latin,Canada) default charset: windows-1252 - -OS Locale (lcid: 85d, name: iu-Latn-CA): Inuktitut (Latin) (Canada) - 1252 -default locale: ID: iu_CA, Name: Inuktitut (Canada) + +OS Locale (lcid: 85d, name: iu-Latn-CA): Inuktitut (Latin) (Canada) - 1252 +default locale: ID: iu_CA_#Latn, Name: Inuktitut (Latin,Canada) display locale: ID: en_US, Name: English (United States) -format locale: ID: iu_CA, Name: Inuktitut (Canada) +format locale: ID: iu_CA_#Latn, Name: Inuktitut (Latin,Canada) default charset: windows-1252 - -OS Locale (lcid: 85f, name: tzm): Tamazight (Latin) (Algeria) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 85f, name: tzm): Tamazight (Latin) (Algeria) - 1252 +default locale: ID: tzm_DZ_#Latn, Name: tzm (Latin,Algeria) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: tzm_DZ_#Latn, Name: tzm (Latin,Algeria) default charset: windows-1252 - -OS Locale (lcid: 85f, name: tzm-Latn-DZ): Tamazight (Latin) (Algeria) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 85f, name: tzm-Latn-DZ): Tamazight (Latin) (Algeria) - 1252 +default locale: ID: tzm_DZ_#Latn, Name: tzm (Latin,Algeria) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: tzm_DZ_#Latn, Name: tzm (Latin,Algeria) default charset: windows-1252 - -OS Locale (lcid: 85f, name: tzm-Latn): Tamazight (Latin) (Algeria) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 85f, name: tzm-Latn): Tamazight (Latin) (Algeria) - 1252 +default locale: ID: tzm_DZ_#Latn, Name: tzm (Latin,Algeria) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: tzm_DZ_#Latn, Name: tzm (Latin,Algeria) default charset: windows-1252 - -OS Locale (lcid: 86b, name: quz-EC): Quechua (Ecuador) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 86b, name: quz-EC): Quechua (Ecuador) - 1252 +default locale: ID: quz_EC, Name: quz (Ecuador) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: quz_EC, Name: quz (Ecuador) default charset: windows-1252 - -OS Locale (lcid: c01, name: ar-EG): Arabic (Egypt) - 1256 + +OS Locale (lcid: c01, name: ar-EG): Arabic (Egypt) - 1256 default locale: ID: ar_EG, Name: Arabic (Egypt) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_EG, Name: Arabic (Egypt) default charset: windows-1256 - -OS Locale (lcid: c04, name: zh-HK): Chinese (Traditional) (Hong Kong S.A.R.) - 950 + +OS Locale (lcid: c04, name: zh-HK): Chinese (Traditional) (Hong Kong S.A.R.) - 950 default locale: ID: zh_HK, Name: Chinese (Hong Kong) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_HK, Name: Chinese (Hong Kong) default charset: x-MS950-HKSCS - -OS Locale (lcid: c04, name: zh-Hant): Chinese (Traditional) (Hong Kong S.A.R.) - 950 + +OS Locale (lcid: c04, name: zh-Hant): Chinese (Traditional) (Hong Kong S.A.R.) - 950 default locale: ID: zh_HK, Name: Chinese (Hong Kong) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_HK, Name: Chinese (Hong Kong) default charset: x-windows-950 - -OS Locale (lcid: c07, name: de-AT): German (Austria) - 1252 + +OS Locale (lcid: c07, name: de-AT): German (Austria) - 1252 default locale: ID: de_AT, Name: German (Austria) display locale: ID: en_US, Name: English (United States) format locale: ID: de_AT, Name: German (Austria) default charset: windows-1252 - -OS Locale (lcid: c09, name: en-AU): English (Australia) - 1252 + +OS Locale (lcid: c09, name: en-AU): English (Australia) - 1252 default locale: ID: en_AU, Name: English (Australia) -display locale: ID: en_AU, Name: English (Australia) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_AU, Name: English (Australia) default charset: windows-1252 - -OS Locale (lcid: c0a, name: es-ES): Spanish (Spain) - 1252 + +OS Locale (lcid: c0a, name: es-ES): Spanish (Spain) - 1252 default locale: ID: es_ES, Name: Spanish (Spain) display locale: ID: en_US, Name: English (United States) format locale: ID: es_ES, Name: Spanish (Spain) default charset: windows-1252 - -OS Locale (lcid: c0c, name: fr-CA): French (Canada) - 1252 + +OS Locale (lcid: c0c, name: fr-CA): French (Canada) - 1252 default locale: ID: fr_CA, Name: French (Canada) display locale: ID: en_US, Name: English (United States) format locale: ID: fr_CA, Name: French (Canada) default charset: windows-1252 - -OS Locale (lcid: c1a, name: sr-Cyrl-CS): Serbian (Cyrillic) (Serbia and Montenegro (Former)) - 1251 -default locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) + +OS Locale (lcid: c1a, name: sr-Cyrl-CS): Serbian (Cyrillic) (Serbia and Montenegro (Former)) - 1251 +default locale: ID: sr_CS_#Cyrl, Name: Serbian (Cyrillic,Serbia and Montenegro) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_CS, Name: Serbian (Serbia and Montenegro) +format locale: ID: sr_CS_#Cyrl, Name: Serbian (Cyrillic,Serbia and Montenegro) default charset: windows-1251 - -OS Locale (lcid: c3b, name: se-FI): Sami (Northern) (Finland) - 1252 + +OS Locale (lcid: c3b, name: se-FI): Sami (Northern) (Finland) - 1252 default locale: ID: se_FI, Name: Northern Sami (Finland) display locale: ID: en_US, Name: English (United States) format locale: ID: se_FI, Name: Northern Sami (Finland) default charset: windows-1252 - -OS Locale (lcid: c6b, name: quz-PE): Quechua (Peru) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: c6b, name: quz-PE): Quechua (Peru) - 1252 +default locale: ID: quz_PE, Name: quz (Peru) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: quz_PE, Name: quz (Peru) default charset: windows-1252 - -OS Locale (lcid: 1001, name: ar-LY): Arabic (Libya) - 1256 + +OS Locale (lcid: 1001, name: ar-LY): Arabic (Libya) - 1256 default locale: ID: ar_LY, Name: Arabic (Libya) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_LY, Name: Arabic (Libya) default charset: windows-1256 - -OS Locale (lcid: 1004, name: zh-SG): Chinese (Simplified) (Singapore) - 936 + +OS Locale (lcid: 1004, name: zh-SG): Chinese (Simplified) (Singapore) - 936 default locale: ID: zh_SG, Name: Chinese (Singapore) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_SG, Name: Chinese (Singapore) default charset: GBK - -OS Locale (lcid: 1007, name: de-LU): German (Luxembourg) - 1252 + +OS Locale (lcid: 1007, name: de-LU): German (Luxembourg) - 1252 default locale: ID: de_LU, Name: German (Luxembourg) display locale: ID: en_US, Name: English (United States) format locale: ID: de_LU, Name: German (Luxembourg) default charset: windows-1252 - -OS Locale (lcid: 1009, name: en-CA): English (Canada) - 1252 + +OS Locale (lcid: 1009, name: en-CA): English (Canada) - 1252 default locale: ID: en_CA, Name: English (Canada) -display locale: ID: en_CA, Name: English (Canada) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_CA, Name: English (Canada) default charset: windows-1252 - -OS Locale (lcid: 100a, name: es-GT): Spanish (Guatemala) - 1252 + +OS Locale (lcid: 100a, name: es-GT): Spanish (Guatemala) - 1252 default locale: ID: es_GT, Name: Spanish (Guatemala) display locale: ID: en_US, Name: English (United States) format locale: ID: es_GT, Name: Spanish (Guatemala) default charset: windows-1252 - -OS Locale (lcid: 100c, name: fr-CH): French (Switzerland) - 1252 + +OS Locale (lcid: 100c, name: fr-CH): French (Switzerland) - 1252 default locale: ID: fr_CH, Name: French (Switzerland) display locale: ID: en_US, Name: English (United States) format locale: ID: fr_CH, Name: French (Switzerland) default charset: windows-1252 - -OS Locale (lcid: 101a, name: hr-BA): Croatian (Latin) (Bosnia and Herzegovina) - 1250 + +OS Locale (lcid: 101a, name: hr-BA): Croatian (Latin) (Bosnia and Herzegovina) - 1250 default locale: ID: hr_BA, Name: Croatian (Bosnia and Herzegovina) display locale: ID: en_US, Name: English (United States) format locale: ID: hr_BA, Name: Croatian (Bosnia and Herzegovina) default charset: windows-1250 - -OS Locale (lcid: 103b, name: smj-NO): Sami (Lule) (Norway) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 103b, name: smj-NO): Sami (Lule) (Norway) - 1252 +default locale: ID: smj_NO, Name: Lule Sami (Norway) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: smj_NO, Name: Lule Sami (Norway) default charset: windows-1252 - -OS Locale (lcid: 1401, name: ar-DZ): Arabic (Algeria) - 1256 + +OS Locale (lcid: 1401, name: ar-DZ): Arabic (Algeria) - 1256 default locale: ID: ar_DZ, Name: Arabic (Algeria) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_DZ, Name: Arabic (Algeria) default charset: windows-1256 - -OS Locale (lcid: 1404, name: zh-MO): Chinese (Traditional) (Macao S.A.R.) - 950 + +OS Locale (lcid: 1404, name: zh-MO): Chinese (Traditional) (Macao S.A.R.) - 950 default locale: ID: zh_MO, Name: Chinese (Macao) display locale: ID: en_US, Name: English (United States) format locale: ID: zh_MO, Name: Chinese (Macao) default charset: x-windows-950 - -OS Locale (lcid: 1407, name: de-LI): German (Liechtenstein) - 1252 + +OS Locale (lcid: 1407, name: de-LI): German (Liechtenstein) - 1252 default locale: ID: de_LI, Name: German (Liechtenstein) display locale: ID: en_US, Name: English (United States) format locale: ID: de_LI, Name: German (Liechtenstein) default charset: windows-1252 - -OS Locale (lcid: 1409, name: en-NZ): English (New Zealand) - 1252 + +OS Locale (lcid: 1409, name: en-NZ): English (New Zealand) - 1252 default locale: ID: en_NZ, Name: English (New Zealand) -display locale: ID: en_NZ, Name: English (New Zealand) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_NZ, Name: English (New Zealand) default charset: windows-1252 - -OS Locale (lcid: 140a, name: es-CR): Spanish (Costa Rica) - 1252 + +OS Locale (lcid: 140a, name: es-CR): Spanish (Costa Rica) - 1252 default locale: ID: es_CR, Name: Spanish (Costa Rica) display locale: ID: en_US, Name: English (United States) format locale: ID: es_CR, Name: Spanish (Costa Rica) default charset: windows-1252 - -OS Locale (lcid: 140c, name: fr-LU): French (Luxembourg) - 1252 + +OS Locale (lcid: 140c, name: fr-LU): French (Luxembourg) - 1252 default locale: ID: fr_LU, Name: French (Luxembourg) display locale: ID: en_US, Name: English (United States) format locale: ID: fr_LU, Name: French (Luxembourg) default charset: windows-1252 - -OS Locale (lcid: 141a, name: bs-Latn): Bosnian (Latin) (Bosnia and Herzegovina) - 1250 -default locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) + +OS Locale (lcid: 141a, name: bs-Latn): Bosnian (Latin) (Bosnia and Herzegovina) - 1250 +default locale: ID: bs_BA_#Latn, Name: Bosnian (Latin,Bosnia and Herzegovina) display locale: ID: en_US, Name: English (United States) -format locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) +format locale: ID: bs_BA_#Latn, Name: Bosnian (Latin,Bosnia and Herzegovina) default charset: windows-1250 - -OS Locale (lcid: 141a, name: bs-Latn-BA): Bosnian (Latin) (Bosnia and Herzegovina) - 1250 -default locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) + +OS Locale (lcid: 141a, name: bs-Latn-BA): Bosnian (Latin) (Bosnia and Herzegovina) - 1250 +default locale: ID: bs_BA_#Latn, Name: Bosnian (Latin,Bosnia and Herzegovina) display locale: ID: en_US, Name: English (United States) -format locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) +format locale: ID: bs_BA_#Latn, Name: Bosnian (Latin,Bosnia and Herzegovina) default charset: windows-1250 - -OS Locale (lcid: 143b, name: smj-SE): Sami (Lule) (Sweden) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 143b, name: smj-SE): Sami (Lule) (Sweden) - 1252 +default locale: ID: smj_SE, Name: Lule Sami (Sweden) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: smj_SE, Name: Lule Sami (Sweden) default charset: windows-1252 - -OS Locale (lcid: 143b, name: smj): Sami (Lule) (Sweden) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 143b, name: smj): Sami (Lule) (Sweden) - 1252 +default locale: ID: smj_SE, Name: Lule Sami (Sweden) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: smj_SE, Name: Lule Sami (Sweden) default charset: windows-1252 - -OS Locale (lcid: 1801, name: ar-MA): Arabic (Morocco) - 1256 + +OS Locale (lcid: 1801, name: ar-MA): Arabic (Morocco) - 1256 default locale: ID: ar_MA, Name: Arabic (Morocco) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_MA, Name: Arabic (Morocco) default charset: windows-1256 - -OS Locale (lcid: 1809, name: en-IE): English (Ireland) - 1252 + +OS Locale (lcid: 1809, name: en-IE): English (Ireland) - 1252 default locale: ID: en_IE, Name: English (Ireland) -display locale: ID: en_IE, Name: English (Ireland) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_IE, Name: English (Ireland) default charset: windows-1252 - -OS Locale (lcid: 180a, name: es-PA): Spanish (Panama) - 1252 + +OS Locale (lcid: 180a, name: es-PA): Spanish (Panama) - 1252 default locale: ID: es_PA, Name: Spanish (Panama) display locale: ID: en_US, Name: English (United States) format locale: ID: es_PA, Name: Spanish (Panama) default charset: windows-1252 - -OS Locale (lcid: 180c, name: fr-MC): French (Principality of Monaco) - 1252 + +OS Locale (lcid: 180c, name: fr-MC): French (Principality of Monaco) - 1252 default locale: ID: fr_MC, Name: French (Monaco) display locale: ID: en_US, Name: English (United States) format locale: ID: fr_MC, Name: French (Monaco) default charset: windows-1252 - -OS Locale (lcid: 181a, name: sr-Latn-BA): Serbian (Latin) (Bosnia and Herzegovina) - 1250 -default locale: ID: sr_BA, Name: Serbian (Bosnia and Herzegovina) + +OS Locale (lcid: 181a, name: sr-Latn-BA): Serbian (Latin) (Bosnia and Herzegovina) - 1250 +default locale: ID: sr_BA_#Latn, Name: Serbian (Latin,Bosnia and Herzegovina) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_BA, Name: Serbian (Bosnia and Herzegovina) +format locale: ID: sr_BA_#Latn, Name: Serbian (Latin,Bosnia and Herzegovina) default charset: windows-1250 - -OS Locale (lcid: 183b, name: sma-NO): Sami (Southern) (Norway) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 183b, name: sma-NO): Sami (Southern) (Norway) - 1252 +default locale: ID: sma_NO, Name: Southern Sami (Norway) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sma_NO, Name: Southern Sami (Norway) default charset: windows-1252 - -OS Locale (lcid: 1c01, name: ar-TN): Arabic (Tunisia) - 1256 + +OS Locale (lcid: 1c01, name: ar-TN): Arabic (Tunisia) - 1256 default locale: ID: ar_TN, Name: Arabic (Tunisia) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_TN, Name: Arabic (Tunisia) default charset: windows-1256 - -OS Locale (lcid: 1c09, name: en-ZA): English (South Africa) - 1252 + +OS Locale (lcid: 1c09, name: en-ZA): English (South Africa) - 1252 default locale: ID: en_ZA, Name: English (South Africa) -display locale: ID: en_ZA, Name: English (South Africa) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_ZA, Name: English (South Africa) default charset: windows-1252 - -OS Locale (lcid: 1c0a, name: es-DO): Spanish (Dominican Republic) - 1252 + +OS Locale (lcid: 1c0a, name: es-DO): Spanish (Dominican Republic) - 1252 default locale: ID: es_DO, Name: Spanish (Dominican Republic) display locale: ID: en_US, Name: English (United States) format locale: ID: es_DO, Name: Spanish (Dominican Republic) default charset: windows-1252 - -OS Locale (lcid: 1c1a, name: sr-Cyrl-BA): Serbian (Cyrillic) (Bosnia and Herzegovina) - 1251 -default locale: ID: sr_BA, Name: Serbian (Bosnia and Herzegovina) + +OS Locale (lcid: 1c1a, name: sr-Cyrl-BA): Serbian (Cyrillic) (Bosnia and Herzegovina) - 1251 +default locale: ID: sr_BA_#Cyrl, Name: Serbian (Cyrillic,Bosnia and Herzegovina) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_BA, Name: Serbian (Bosnia and Herzegovina) +format locale: ID: sr_BA_#Cyrl, Name: Serbian (Cyrillic,Bosnia and Herzegovina) default charset: windows-1251 - -OS Locale (lcid: 1c3b, name: sma): Sami (Southern) (Sweden) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 1c3b, name: sma): Sami (Southern) (Sweden) - 1252 +default locale: ID: sma_SE, Name: Southern Sami (Sweden) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sma_SE, Name: Southern Sami (Sweden) default charset: windows-1252 - -OS Locale (lcid: 1c3b, name: sma-SE): Sami (Southern) (Sweden) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 1c3b, name: sma-SE): Sami (Southern) (Sweden) - 1252 +default locale: ID: sma_SE, Name: Southern Sami (Sweden) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sma_SE, Name: Southern Sami (Sweden) default charset: windows-1252 - -OS Locale (lcid: 2001, name: ar-OM): Arabic (Oman) - 1256 + +OS Locale (lcid: 2001, name: ar-OM): Arabic (Oman) - 1256 default locale: ID: ar_OM, Name: Arabic (Oman) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_OM, Name: Arabic (Oman) default charset: windows-1256 - -OS Locale (lcid: 2009, name: en-JM): English (Jamaica) - 1252 + +OS Locale (lcid: 2009, name: en-JM): English (Jamaica) - 1252 default locale: ID: en_JM, Name: English (Jamaica) -display locale: ID: en_JM, Name: English (Jamaica) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_JM, Name: English (Jamaica) default charset: windows-1252 - -OS Locale (lcid: 200a, name: es-VE): Spanish (Bolivarian Republic of Venezuela) - 1252 + +OS Locale (lcid: 200a, name: es-VE): Spanish (Bolivarian Republic of Venezuela) - 1252 default locale: ID: es_VE, Name: Spanish (Venezuela) display locale: ID: en_US, Name: English (United States) format locale: ID: es_VE, Name: Spanish (Venezuela) default charset: windows-1252 - -OS Locale (lcid: 201a, name: bs-Cyrl-BA): Bosnian (Cyrillic) (Bosnia and Herzegovina) - 1251 -default locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) + +OS Locale (lcid: 201a, name: bs-Cyrl-BA): Bosnian (Cyrillic) (Bosnia and Herzegovina) - 1251 +default locale: ID: bs_BA_#Cyrl, Name: Bosnian (Cyrillic,Bosnia and Herzegovina) display locale: ID: en_US, Name: English (United States) -format locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) +format locale: ID: bs_BA_#Cyrl, Name: Bosnian (Cyrillic,Bosnia and Herzegovina) default charset: windows-1251 - -OS Locale (lcid: 201a, name: bs-Cyrl): Bosnian (Cyrillic) (Bosnia and Herzegovina) - 1251 -default locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) + +OS Locale (lcid: 201a, name: bs-Cyrl): Bosnian (Cyrillic) (Bosnia and Herzegovina) - 1251 +default locale: ID: bs_BA_#Cyrl, Name: Bosnian (Cyrillic,Bosnia and Herzegovina) display locale: ID: en_US, Name: English (United States) -format locale: ID: bs_BA, Name: Bosnian (Bosnia and Herzegovina) +format locale: ID: bs_BA_#Cyrl, Name: Bosnian (Cyrillic,Bosnia and Herzegovina) default charset: windows-1251 - -OS Locale (lcid: 203b, name: sms-FI): Sami (Skolt) (Finland) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 203b, name: sms-FI): Sami (Skolt) (Finland) - 1252 +default locale: ID: sms_FI, Name: Skolt Sami (Finland) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sms_FI, Name: Skolt Sami (Finland) default charset: windows-1252 - -OS Locale (lcid: 203b, name: sms): Sami (Skolt) (Finland) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 203b, name: sms): Sami (Skolt) (Finland) - 1252 +default locale: ID: sms_FI, Name: Skolt Sami (Finland) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: sms_FI, Name: Skolt Sami (Finland) default charset: windows-1252 - -OS Locale (lcid: 2401, name: ar-YE): Arabic (Yemen) - 1256 + +OS Locale (lcid: 2401, name: ar-YE): Arabic (Yemen) - 1256 default locale: ID: ar_YE, Name: Arabic (Yemen) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_YE, Name: Arabic (Yemen) default charset: windows-1256 - -OS Locale (lcid: 2409, name: en-029): English (Caribbean) - 1252 -default locale: ID: en, Name: English -display locale: ID: en, Name: English -format locale: ID: en, Name: English + +OS Locale (lcid: 2409, name: en-029): English (Caribbean) - 1252 +default locale: ID: en_029, Name: English (Caribbean) +display locale: ID: en_US, Name: English (United States) +format locale: ID: en_029, Name: English (Caribbean) default charset: windows-1252 - -OS Locale (lcid: 240a, name: es-CO): Spanish (Colombia) - 1252 + +OS Locale (lcid: 240a, name: es-CO): Spanish (Colombia) - 1252 default locale: ID: es_CO, Name: Spanish (Colombia) display locale: ID: en_US, Name: English (United States) format locale: ID: es_CO, Name: Spanish (Colombia) default charset: windows-1252 - -OS Locale (lcid: 241a, name: sr-Latn-RS): Serbian (Latin) (Serbia) - 1250 -default locale: ID: sr_RS, Name: Serbian (Serbia) + +OS Locale (lcid: 241a, name: sr-Latn-RS): Serbian (Latin) (Serbia) - 1250 +default locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_RS, Name: Serbian (Serbia) +format locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) default charset: windows-1250 - -OS Locale (lcid: 241a, name: sr-Latn): Serbian (Latin) (Serbia) - 1250 -default locale: ID: sr_RS, Name: Serbian (Serbia) + +OS Locale (lcid: 241a, name: sr-Latn): Serbian (Latin) (Serbia) - 1250 +default locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_RS, Name: Serbian (Serbia) +format locale: ID: sr_RS_#Latn, Name: Serbian (Latin,Serbia) default charset: windows-1250 - -OS Locale (lcid: 243b, name: smn): Sami (Inari) (Finland) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 243b, name: smn): Sami (Inari) (Finland) - 1252 +default locale: ID: smn_FI, Name: Inari Sami (Finland) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: smn_FI, Name: Inari Sami (Finland) default charset: windows-1252 - -OS Locale (lcid: 243b, name: smn-FI): Sami (Inari) (Finland) - 1252 -default locale: ID: en_US, Name: English (United States) + +OS Locale (lcid: 243b, name: smn-FI): Sami (Inari) (Finland) - 1252 +default locale: ID: smn_FI, Name: Inari Sami (Finland) display locale: ID: en_US, Name: English (United States) -format locale: ID: en_US, Name: English (United States) +format locale: ID: smn_FI, Name: Inari Sami (Finland) default charset: windows-1252 - -OS Locale (lcid: 2801, name: ar-SY): Arabic (Syria) - 1256 + +OS Locale (lcid: 2801, name: ar-SY): Arabic (Syria) - 1256 default locale: ID: ar_SY, Name: Arabic (Syria) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_SY, Name: Arabic (Syria) default charset: windows-1256 - -OS Locale (lcid: 2809, name: en-BZ): English (Belize) - 1252 + +OS Locale (lcid: 2809, name: en-BZ): English (Belize) - 1252 default locale: ID: en_BZ, Name: English (Belize) -display locale: ID: en_BZ, Name: English (Belize) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_BZ, Name: English (Belize) default charset: windows-1252 - -OS Locale (lcid: 280a, name: es-PE): Spanish (Peru) - 1252 + +OS Locale (lcid: 280a, name: es-PE): Spanish (Peru) - 1252 default locale: ID: es_PE, Name: Spanish (Peru) display locale: ID: en_US, Name: English (United States) format locale: ID: es_PE, Name: Spanish (Peru) default charset: windows-1252 - -OS Locale (lcid: 281a, name: sr-Cyrl-RS): Serbian (Cyrillic) (Serbia) - 1251 -default locale: ID: sr_RS, Name: Serbian (Serbia) + +OS Locale (lcid: 281a, name: sr-Cyrl-RS): Serbian (Cyrillic) (Serbia) - 1251 +default locale: ID: sr_RS_#Cyrl, Name: Serbian (Cyrillic,Serbia) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_RS, Name: Serbian (Serbia) +format locale: ID: sr_RS_#Cyrl, Name: Serbian (Cyrillic,Serbia) default charset: windows-1251 - -OS Locale (lcid: 281a, name: sr-Cyrl): Serbian (Cyrillic) (Serbia) - 1251 -default locale: ID: sr_RS, Name: Serbian (Serbia) + +OS Locale (lcid: 281a, name: sr-Cyrl): Serbian (Cyrillic) (Serbia) - 1251 +default locale: ID: sr_RS_#Cyrl, Name: Serbian (Cyrillic,Serbia) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_RS, Name: Serbian (Serbia) +format locale: ID: sr_RS_#Cyrl, Name: Serbian (Cyrillic,Serbia) default charset: windows-1251 - -OS Locale (lcid: 2c01, name: ar-JO): Arabic (Jordan) - 1256 + +OS Locale (lcid: 2c01, name: ar-JO): Arabic (Jordan) - 1256 default locale: ID: ar_JO, Name: Arabic (Jordan) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_JO, Name: Arabic (Jordan) default charset: windows-1256 - -OS Locale (lcid: 2c09, name: en-TT): English (Trinidad and Tobago) - 1252 + +OS Locale (lcid: 2c09, name: en-TT): English (Trinidad and Tobago) - 1252 default locale: ID: en_TT, Name: English (Trinidad and Tobago) -display locale: ID: en_TT, Name: English (Trinidad and Tobago) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_TT, Name: English (Trinidad and Tobago) default charset: windows-1252 - -OS Locale (lcid: 2c0a, name: es-AR): Spanish (Argentina) - 1252 + +OS Locale (lcid: 2c0a, name: es-AR): Spanish (Argentina) - 1252 default locale: ID: es_AR, Name: Spanish (Argentina) display locale: ID: en_US, Name: English (United States) format locale: ID: es_AR, Name: Spanish (Argentina) default charset: windows-1252 - -OS Locale (lcid: 2c1a, name: sr-Latn-ME): Serbian (Latin) (Montenegro) - 1250 -default locale: ID: sr_ME, Name: Serbian (Montenegro) + +OS Locale (lcid: 2c1a, name: sr-Latn-ME): Serbian (Latin) (Montenegro) - 1250 +default locale: ID: sr_ME_#Latn, Name: Serbian (Latin,Montenegro) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_ME, Name: Serbian (Montenegro) +format locale: ID: sr_ME_#Latn, Name: Serbian (Latin,Montenegro) default charset: windows-1250 - -OS Locale (lcid: 3001, name: ar-LB): Arabic (Lebanon) - 1256 + +OS Locale (lcid: 3001, name: ar-LB): Arabic (Lebanon) - 1256 default locale: ID: ar_LB, Name: Arabic (Lebanon) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_LB, Name: Arabic (Lebanon) default charset: windows-1256 - -OS Locale (lcid: 3009, name: en-ZW): English (Zimbabwe) - 1252 + +OS Locale (lcid: 3009, name: en-ZW): English (Zimbabwe) - 1252 default locale: ID: en_ZW, Name: English (Zimbabwe) -display locale: ID: en_ZW, Name: English (Zimbabwe) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_ZW, Name: English (Zimbabwe) default charset: windows-1252 - -OS Locale (lcid: 300a, name: es-EC): Spanish (Ecuador) - 1252 + +OS Locale (lcid: 300a, name: es-EC): Spanish (Ecuador) - 1252 default locale: ID: es_EC, Name: Spanish (Ecuador) display locale: ID: en_US, Name: English (United States) format locale: ID: es_EC, Name: Spanish (Ecuador) default charset: windows-1252 - -OS Locale (lcid: 301a, name: sr-Cyrl-ME): Serbian (Cyrillic) (Montenegro) - 1251 -default locale: ID: sr_ME, Name: Serbian (Montenegro) + +OS Locale (lcid: 301a, name: sr-Cyrl-ME): Serbian (Cyrillic) (Montenegro) - 1251 +default locale: ID: sr_ME_#Cyrl, Name: Serbian (Cyrillic,Montenegro) display locale: ID: en_US, Name: English (United States) -format locale: ID: sr_ME, Name: Serbian (Montenegro) +format locale: ID: sr_ME_#Cyrl, Name: Serbian (Cyrillic,Montenegro) default charset: windows-1251 - -OS Locale (lcid: 3401, name: ar-KW): Arabic (Kuwait) - 1256 + +OS Locale (lcid: 3401, name: ar-KW): Arabic (Kuwait) - 1256 default locale: ID: ar_KW, Name: Arabic (Kuwait) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_KW, Name: Arabic (Kuwait) default charset: windows-1256 - -OS Locale (lcid: 3409, name: en-PH): English (Republic of the Philippines) - 1252 + +OS Locale (lcid: 3409, name: en-PH): English (Republic of the Philippines) - 1252 default locale: ID: en_PH, Name: English (Philippines) -display locale: ID: en_PH, Name: English (Philippines) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_PH, Name: English (Philippines) default charset: windows-1252 - -OS Locale (lcid: 340a, name: es-CL): Spanish (Chile) - 1252 + +OS Locale (lcid: 340a, name: es-CL): Spanish (Chile) - 1252 default locale: ID: es_CL, Name: Spanish (Chile) display locale: ID: en_US, Name: English (United States) format locale: ID: es_CL, Name: Spanish (Chile) default charset: windows-1252 - -OS Locale (lcid: 3801, name: ar-AE): Arabic (U.A.E.) - 1256 + +OS Locale (lcid: 3801, name: ar-AE): Arabic (U.A.E.) - 1256 default locale: ID: ar_AE, Name: Arabic (United Arab Emirates) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_AE, Name: Arabic (United Arab Emirates) default charset: windows-1256 - -OS Locale (lcid: 380a, name: es-UY): Spanish (Uruguay) - 1252 + +OS Locale (lcid: 380a, name: es-UY): Spanish (Uruguay) - 1252 default locale: ID: es_UY, Name: Spanish (Uruguay) display locale: ID: en_US, Name: English (United States) format locale: ID: es_UY, Name: Spanish (Uruguay) default charset: windows-1252 - -OS Locale (lcid: 3c01, name: ar-BH): Arabic (Bahrain) - 1256 + +OS Locale (lcid: 3c01, name: ar-BH): Arabic (Bahrain) - 1256 default locale: ID: ar_BH, Name: Arabic (Bahrain) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_BH, Name: Arabic (Bahrain) default charset: windows-1256 - -OS Locale (lcid: 3c0a, name: es-PY): Spanish (Paraguay) - 1252 + +OS Locale (lcid: 3c0a, name: es-PY): Spanish (Paraguay) - 1252 default locale: ID: es_PY, Name: Spanish (Paraguay) display locale: ID: en_US, Name: English (United States) format locale: ID: es_PY, Name: Spanish (Paraguay) default charset: windows-1252 - -OS Locale (lcid: 4001, name: ar-QA): Arabic (Qatar) - 1256 + +OS Locale (lcid: 4001, name: ar-QA): Arabic (Qatar) - 1256 default locale: ID: ar_QA, Name: Arabic (Qatar) display locale: ID: en_US, Name: English (United States) format locale: ID: ar_QA, Name: Arabic (Qatar) default charset: windows-1256 - -OS Locale (lcid: 4009, name: en-IN): English (India) - 1252 + +OS Locale (lcid: 4009, name: en-IN): English (India) - 1252 default locale: ID: en_IN, Name: English (India) -display locale: ID: en_IN, Name: English (India) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_IN, Name: English (India) default charset: windows-1252 - -OS Locale (lcid: 400a, name: es-BO): Spanish (Bolivia) - 1252 + +OS Locale (lcid: 400a, name: es-BO): Spanish (Bolivia) - 1252 default locale: ID: es_BO, Name: Spanish (Bolivia) display locale: ID: en_US, Name: English (United States) format locale: ID: es_BO, Name: Spanish (Bolivia) default charset: windows-1252 - -OS Locale (lcid: 4409, name: en-MY): English (Malaysia) - 1252 + +OS Locale (lcid: 4409, name: en-MY): English (Malaysia) - 1252 default locale: ID: en_MY, Name: English (Malaysia) -display locale: ID: en_MY, Name: English (Malaysia) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_MY, Name: English (Malaysia) default charset: windows-1252 - -OS Locale (lcid: 440a, name: es-SV): Spanish (El Salvador) - 1252 + +OS Locale (lcid: 440a, name: es-SV): Spanish (El Salvador) - 1252 default locale: ID: es_SV, Name: Spanish (El Salvador) display locale: ID: en_US, Name: English (United States) format locale: ID: es_SV, Name: Spanish (El Salvador) default charset: windows-1252 - -OS Locale (lcid: 4809, name: en-SG): English (Singapore) - 1252 + +OS Locale (lcid: 4809, name: en-SG): English (Singapore) - 1252 default locale: ID: en_SG, Name: English (Singapore) -display locale: ID: en_SG, Name: English (Singapore) +display locale: ID: en_US, Name: English (United States) format locale: ID: en_SG, Name: English (Singapore) default charset: windows-1252 - -OS Locale (lcid: 480a, name: es-HN): Spanish (Honduras) - 1252 + +OS Locale (lcid: 480a, name: es-HN): Spanish (Honduras) - 1252 default locale: ID: es_HN, Name: Spanish (Honduras) display locale: ID: en_US, Name: English (United States) format locale: ID: es_HN, Name: Spanish (Honduras) default charset: windows-1252 - -OS Locale (lcid: 4c0a, name: es-NI): Spanish (Nicaragua) - 1252 + +OS Locale (lcid: 4c0a, name: es-NI): Spanish (Nicaragua) - 1252 default locale: ID: es_NI, Name: Spanish (Nicaragua) display locale: ID: en_US, Name: English (United States) format locale: ID: es_NI, Name: Spanish (Nicaragua) default charset: windows-1252 - -OS Locale (lcid: 500a, name: es-PR): Spanish (Puerto Rico) - 1252 + +OS Locale (lcid: 500a, name: es-PR): Spanish (Puerto Rico) - 1252 default locale: ID: es_PR, Name: Spanish (Puerto Rico) display locale: ID: en_US, Name: English (United States) format locale: ID: es_PR, Name: Spanish (Puerto Rico) default charset: windows-1252 - -OS Locale (lcid: 540a, name: es-US): Spanish (United States) - 1252 + +OS Locale (lcid: 540a, name: es-US): Spanish (United States) - 1252 default locale: ID: es_US, Name: Spanish (United States) -display locale: ID: en, Name: English +display locale: ID: en_US, Name: English (United States) format locale: ID: es_US, Name: Spanish (United States) default charset: windows-1252 - -OS UI Language (name: en-US) + +OS UI Language (name: en-US) default locale: ID: en_US, Name: English (United States) display locale: ID: en_US, Name: English (United States) format locale: ID: en_US, Name: English (United States) default charset: windows-1252 - -OS UI Language (name: ja-JP) + +OS UI Language (name: ja-JP) default locale: ID: en_US, Name: English (United States) display locale: ID: ja_JP, Name: Japanese (Japan) format locale: ID: en_US, Name: English (United States) diff --git a/jdk/test/java/util/NavigableMap/LockStep.java b/jdk/test/java/util/NavigableMap/LockStep.java index fbe58dedc70..64f9bdf7683 100644 --- a/jdk/test/java/util/NavigableMap/LockStep.java +++ b/jdk/test/java/util/NavigableMap/LockStep.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 @@ * @test * @bug 6420753 6242436 6691185 * @summary Compare NavigableMap implementations for identical behavior + * @run main LockStep + * @run main/othervm -XX:+AggressiveOpts LockStep + * @run main/othervm -XX:+AggressiveOpts -Dthorough=true LockStep * @author Martin Buchholz */ diff --git a/jdk/test/java/util/PluggableLocale/DateFormatProviderTest.java b/jdk/test/java/util/PluggableLocale/DateFormatProviderTest.java index 6112b6836a4..6d5ecd23f3a 100644 --- a/jdk/test/java/util/PluggableLocale/DateFormatProviderTest.java +++ b/jdk/test/java/util/PluggableLocale/DateFormatProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class DateFormatProviderTest extends ProviderTest { availableLocalesTest(); objectValidityTest(); extendedVariantTest(); + messageFormatTest(); } void availableLocalesTest() { @@ -118,4 +119,48 @@ public class DateFormatProviderTest extends ProviderTest { } } } + + + private static final String[] TYPES = { + "date", + "time" + }; + private static final String[] MODIFIERS = { + "", + "short", + "medium", // Same as DEFAULT + "long", + "full" + }; + + void messageFormatTest() { + for (Locale target : providerloc) { + for (String type : TYPES) { + for (String modifier : MODIFIERS) { + String pattern, expected; + if (modifier.equals("")) { + pattern = String.format("%s={0,%s}", type, type); + } else { + pattern = String.format("%s={0,%s,%s}", type, type, modifier); + } + if (modifier.equals("medium")) { + // medium is default. + expected = String.format("%s={0,%s}", type, type); + } else { + expected = pattern; + } + MessageFormat mf = new MessageFormat(pattern, target); + Format[] fmts = mf.getFormats(); + if (fmts[0] instanceof SimpleDateFormat) { + continue; + } + String toPattern = mf.toPattern(); + if (!toPattern.equals(expected)) { + throw new RuntimeException("messageFormatTest: got '" + toPattern + + "', expected '" + expected + "'"); + } + } + } + } + } } diff --git a/jdk/test/java/util/PluggableLocale/DateFormatProviderTest.sh b/jdk/test/java/util/PluggableLocale/DateFormatProviderTest.sh index 0d7ad953fe2..228a2484a10 100644 --- a/jdk/test/java/util/PluggableLocale/DateFormatProviderTest.sh +++ b/jdk/test/java/util/PluggableLocale/DateFormatProviderTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # 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,6 @@ #!/bin/sh # # @test -# @bug 4052440 +# @bug 4052440 7003643 # @summary DateFormatProvider tests # @run shell ExecTest.sh foo DateFormatProviderTest true diff --git a/jdk/test/java/util/PluggableLocale/ExecTest.sh b/jdk/test/java/util/PluggableLocale/ExecTest.sh index ece64dca691..0e2fdc7d6c7 100644 --- a/jdk/test/java/util/PluggableLocale/ExecTest.sh +++ b/jdk/test/java/util/PluggableLocale/ExecTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/PluggableLocale/NumberFormatProviderTest.java b/jdk/test/java/util/PluggableLocale/NumberFormatProviderTest.java index 93540bf1764..a7ebfb79497 100644 --- a/jdk/test/java/util/PluggableLocale/NumberFormatProviderTest.java +++ b/jdk/test/java/util/PluggableLocale/NumberFormatProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import java.util.*; import sun.util.*; import sun.util.resources.*; +import com.foo.FooNumberFormat; + public class NumberFormatProviderTest extends ProviderTest { com.foo.NumberFormatProviderImpl nfp = new com.foo.NumberFormatProviderImpl(); @@ -43,6 +45,7 @@ public class NumberFormatProviderTest extends ProviderTest { NumberFormatProviderTest() { availableLocalesTest(); objectValidityTest(); + messageFormatTest(); } void availableLocalesTest() { @@ -72,14 +75,10 @@ public class NumberFormatProviderTest extends ProviderTest { } // result object - String resultCur = - ((DecimalFormat)NumberFormat.getCurrencyInstance(target)).toPattern(); - String resultInt = - ((DecimalFormat)NumberFormat.getIntegerInstance(target)).toPattern(); - String resultNum = - ((DecimalFormat)NumberFormat.getNumberInstance(target)).toPattern(); - String resultPer = - ((DecimalFormat)NumberFormat.getPercentInstance(target)).toPattern(); + String resultCur = getPattern(NumberFormat.getCurrencyInstance(target)); + String resultInt = getPattern(NumberFormat.getIntegerInstance(target)); + String resultNum = getPattern(NumberFormat.getNumberInstance(target)); + String resultPer = getPattern(NumberFormat.getPercentInstance(target)); // provider's object (if any) String providersCur = null; @@ -87,21 +86,21 @@ public class NumberFormatProviderTest extends ProviderTest { String providersNum = null; String providersPer = null; if (providerloc.contains(target)) { - DecimalFormat dfCur = (DecimalFormat)nfp.getCurrencyInstance(target); + NumberFormat dfCur = nfp.getCurrencyInstance(target); if (dfCur != null) { - providersCur = dfCur.toPattern(); + providersCur = getPattern(dfCur); } - DecimalFormat dfInt = (DecimalFormat)nfp.getIntegerInstance(target); + NumberFormat dfInt = nfp.getIntegerInstance(target); if (dfInt != null) { - providersInt = dfInt.toPattern(); + providersInt = getPattern(dfInt); } - DecimalFormat dfNum = (DecimalFormat)nfp.getNumberInstance(target); + NumberFormat dfNum = nfp.getNumberInstance(target); if (dfNum != null) { - providersNum = dfNum.toPattern(); + providersNum = getPattern(dfNum); } - DecimalFormat dfPer = (DecimalFormat)nfp.getPercentInstance(target); + NumberFormat dfPer = nfp.getPercentInstance(target); if (dfPer != null) { - providersPer = dfPer.toPattern(); + providersPer = getPattern(dfPer); } } @@ -174,4 +173,35 @@ public class NumberFormatProviderTest extends ProviderTest { } } } + + private static String getPattern(NumberFormat nf) { + if (nf instanceof DecimalFormat) { + return ((DecimalFormat)nf).toPattern(); + } + if (nf instanceof FooNumberFormat) { + return ((FooNumberFormat)nf).toPattern(); + } + return null; + } + + private static final String[] NUMBER_PATTERNS = { + "num={0,number}", + "num={0,number,currency}", + "num={0,number,percent}", + "num={0,number,integer}" + }; + + void messageFormatTest() { + for (Locale target : providerloc) { + for (String pattern : NUMBER_PATTERNS) { + MessageFormat mf = new MessageFormat(pattern, target); + String toPattern = mf.toPattern(); + if (!pattern.equals(toPattern)) { + throw new RuntimeException("MessageFormat.toPattern: got '" + + toPattern + + "', expected '" + pattern + "'"); + } + } + } + } } diff --git a/jdk/test/java/util/PluggableLocale/NumberFormatProviderTest.sh b/jdk/test/java/util/PluggableLocale/NumberFormatProviderTest.sh index 7967da9f070..7f4e902a914 100644 --- a/jdk/test/java/util/PluggableLocale/NumberFormatProviderTest.sh +++ b/jdk/test/java/util/PluggableLocale/NumberFormatProviderTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # 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,6 @@ #!/bin/sh # # @test -# @bug 4052440 +# @bug 4052440 7003643 # @summary NumberFormatProvider tests # @run shell ExecTest.sh foo NumberFormatProviderTest true diff --git a/jdk/test/java/util/PluggableLocale/fooprovider.jar b/jdk/test/java/util/PluggableLocale/fooprovider.jar index 29ea53fcca6..c1b5723f9b9 100644 Binary files a/jdk/test/java/util/PluggableLocale/fooprovider.jar and b/jdk/test/java/util/PluggableLocale/fooprovider.jar differ diff --git a/jdk/test/java/util/PluggableLocale/providersrc/DateFormatProviderImpl.java b/jdk/test/java/util/PluggableLocale/providersrc/DateFormatProviderImpl.java index 25e7b176946..55bc8d5ae73 100644 --- a/jdk/test/java/util/PluggableLocale/providersrc/DateFormatProviderImpl.java +++ b/jdk/test/java/util/PluggableLocale/providersrc/DateFormatProviderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ public class DateFormatProviderImpl extends DateFormatProvider { static String[] datePattern = { "yyyy'\u5e74'M'\u6708'd'\u65e5'", // full date pattern - "yyyy/MM/dd", // long date pattern + "yyyy/MMM/dd", // long date pattern "yyyy/MM/dd", // medium date pattern "yy/MM/dd" // short date pattern }; @@ -68,7 +68,7 @@ public class DateFormatProviderImpl extends DateFormatProvider { public DateFormat getDateInstance(int style, Locale locale) { for (int i = 0; i < avail.length; i ++) { if (Utils.supportsLocale(avail[i], locale)) { - return new SimpleDateFormat(datePattern[style]+dialect[i], locale); + return new FooDateFormat(datePattern[style]+dialect[i], locale); } } throw new IllegalArgumentException("locale is not supported: "+locale); @@ -77,7 +77,7 @@ public class DateFormatProviderImpl extends DateFormatProvider { public DateFormat getTimeInstance(int style, Locale locale) { for (int i = 0; i < avail.length; i ++) { if (Utils.supportsLocale(avail[i], locale)) { - return new SimpleDateFormat(timePattern[style]+dialect[i], locale); + return new FooDateFormat(timePattern[style]+dialect[i], locale); } } throw new IllegalArgumentException("locale is not supported: "+locale); @@ -86,7 +86,7 @@ public class DateFormatProviderImpl extends DateFormatProvider { public DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale) { for (int i = 0; i < avail.length; i ++) { if (Utils.supportsLocale(avail[i], locale)) { - return new SimpleDateFormat( + return new FooDateFormat( datePattern[dateStyle]+" "+timePattern[timeStyle]+dialect[i], locale); } } diff --git a/jdk/test/java/util/PluggableLocale/providersrc/FooDateFormat.java b/jdk/test/java/util/PluggableLocale/providersrc/FooDateFormat.java new file mode 100644 index 00000000000..80d4ce2010f --- /dev/null +++ b/jdk/test/java/util/PluggableLocale/providersrc/FooDateFormat.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.foo; + +import java.text.*; +import java.util.*; + +/** + * FooDateFormat provides SimpleDateFormat methods required for the SPI testing. + */ +public class FooDateFormat extends DateFormat { + private SimpleDateFormat sdf; + + public FooDateFormat(String pattern, Locale loc) { + sdf = new SimpleDateFormat(pattern, loc); + } + + @Override + public StringBuffer format(Date date, + StringBuffer toAppendTo, + FieldPosition fieldPosition) { + return sdf.format(date, toAppendTo, fieldPosition); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return sdf.parse(source, pos); + } + + @Override + public boolean equals(Object other) { + return other instanceof FooDateFormat + && sdf.equals(((FooDateFormat)other).sdf); + } + + @Override + public int hashCode() { + return sdf.hashCode(); + } +} diff --git a/jdk/test/java/util/PluggableLocale/providersrc/FooNumberFormat.java b/jdk/test/java/util/PluggableLocale/providersrc/FooNumberFormat.java new file mode 100644 index 00000000000..d13bd7362fe --- /dev/null +++ b/jdk/test/java/util/PluggableLocale/providersrc/FooNumberFormat.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.foo; + +import java.text.*; + +/** + * FooNumberFormat provides DecimalFormat methods required for the SPI testing. + */ +public class FooNumberFormat extends NumberFormat { + private DecimalFormat df; + + public FooNumberFormat(String pattern, DecimalFormatSymbols dfs) { + df = new DecimalFormat(pattern, dfs); + } + + @Override + public StringBuffer format(double number, + StringBuffer toAppendTo, + FieldPosition pos) { + return df.format(number, toAppendTo, pos); + } + + @Override + public StringBuffer format(long number, + StringBuffer toAppendTo, + FieldPosition pos) { + return df.format(number, toAppendTo, pos); + } + + @Override + public Number parse(String source, ParsePosition parsePosition) { + return df.parse(source, parsePosition); + } + + @Override + public boolean equals(Object other) { + return other instanceof FooNumberFormat + && df.equals(((FooNumberFormat)other).df); + } + + @Override + public int hashCode() { + return df.hashCode(); + } + + // DecimalFormat specific methods required for testing + + public String toPattern() { + return df.toPattern(); + } + + public DecimalFormatSymbols getDecimalFormatSymbols() { + return df.getDecimalFormatSymbols(); + } + + public void setDecimalSeparatorAlwaysShown(boolean newValue) { + df.setDecimalSeparatorAlwaysShown(newValue); + } +} diff --git a/jdk/test/java/util/PluggableLocale/providersrc/Makefile b/jdk/test/java/util/PluggableLocale/providersrc/Makefile index a85ea065e98..8d2fa9cab80 100644 --- a/jdk/test/java/util/PluggableLocale/providersrc/Makefile +++ b/jdk/test/java/util/PluggableLocale/providersrc/Makefile @@ -28,6 +28,8 @@ FOOFILES_JAVA = \ DateFormatSymbolsProviderImpl.java \ DecimalFormatSymbolsProviderImpl.java \ NumberFormatProviderImpl.java \ + FooDateFormat.java \ + FooNumberFormat.java \ Utils.java BARFILES_JAVA = \ diff --git a/jdk/test/java/util/PluggableLocale/providersrc/NumberFormatProviderImpl.java b/jdk/test/java/util/PluggableLocale/providersrc/NumberFormatProviderImpl.java index 164de5e1db6..9aa677cf89b 100644 --- a/jdk/test/java/util/PluggableLocale/providersrc/NumberFormatProviderImpl.java +++ b/jdk/test/java/util/PluggableLocale/providersrc/NumberFormatProviderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,13 +49,15 @@ public class NumberFormatProviderImpl extends NumberFormatProvider { static String[] patterns = { "#,##0.###{0};-#,##0.###{1}", // decimal pattern + "#{0};(#){1}", // integer pattern "\u00A4#,##0{0};-\u00A4#,##0{1}", // currency pattern "#,##0%{0}" // percent pattern }; // Constants used by factory methods to specify a style of format. static final int NUMBERSTYLE = 0; - static final int CURRENCYSTYLE = 1; - static final int PERCENTSTYLE = 2; + static final int INTEGERSTYLE = 1; + static final int CURRENCYSTYLE = 2; + static final int PERCENTSTYLE = 3; public Locale[] getAvailableLocales() { return avail; @@ -68,10 +70,10 @@ public class NumberFormatProviderImpl extends NumberFormatProvider { MessageFormat.format(patterns[CURRENCYSTYLE], dialect[i], dialect[i]); - DecimalFormat df = new DecimalFormat(pattern, + FooNumberFormat nf = new FooNumberFormat(pattern, DecimalFormatSymbols.getInstance(locale)); - adjustForCurrencyDefaultFractionDigits(df); - return df; + adjustForCurrencyDefaultFractionDigits(nf); + return nf; } } throw new IllegalArgumentException("locale is not supported: "+locale); @@ -81,15 +83,15 @@ public class NumberFormatProviderImpl extends NumberFormatProvider { for (int i = 0; i < avail.length; i ++) { if (Utils.supportsLocale(avail[i], locale)) { String pattern = - MessageFormat.format(patterns[NUMBERSTYLE], + MessageFormat.format(patterns[INTEGERSTYLE], dialect[i], dialect[i]); - DecimalFormat df = new DecimalFormat(pattern, + FooNumberFormat nf = new FooNumberFormat(pattern, DecimalFormatSymbols.getInstance(locale)); - df.setMaximumFractionDigits(0); - df.setDecimalSeparatorAlwaysShown(false); - df.setParseIntegerOnly(true); - return df; + nf.setMaximumFractionDigits(0); + nf.setDecimalSeparatorAlwaysShown(false); + nf.setParseIntegerOnly(true); + return nf; } } throw new IllegalArgumentException("locale is not supported: "+locale); @@ -102,7 +104,7 @@ public class NumberFormatProviderImpl extends NumberFormatProvider { MessageFormat.format(patterns[NUMBERSTYLE], dialect[i], dialect[i]); - return new DecimalFormat(pattern, + return new FooNumberFormat(pattern, DecimalFormatSymbols.getInstance(locale)); } } @@ -115,7 +117,7 @@ public class NumberFormatProviderImpl extends NumberFormatProvider { String pattern = MessageFormat.format(patterns[PERCENTSTYLE], dialect[i]); - return new DecimalFormat(pattern, + return new FooNumberFormat(pattern, DecimalFormatSymbols.getInstance(locale)); } } @@ -126,8 +128,8 @@ public class NumberFormatProviderImpl extends NumberFormatProvider { * Adjusts the minimum and maximum fraction digits to values that * are reasonable for the currency's default fraction digits. */ - void adjustForCurrencyDefaultFractionDigits(DecimalFormat df) { - DecimalFormatSymbols dfs = df.getDecimalFormatSymbols(); + void adjustForCurrencyDefaultFractionDigits(FooNumberFormat nf) { + DecimalFormatSymbols dfs = nf.getDecimalFormatSymbols(); Currency currency = dfs.getCurrency(); if (currency == null) { try { @@ -138,15 +140,15 @@ public class NumberFormatProviderImpl extends NumberFormatProvider { if (currency != null) { int digits = currency.getDefaultFractionDigits(); if (digits != -1) { - int oldMinDigits = df.getMinimumFractionDigits(); + int oldMinDigits = nf.getMinimumFractionDigits(); // Common patterns are "#.##", "#.00", "#". // Try to adjust all of them in a reasonable way. - if (oldMinDigits == df.getMaximumFractionDigits()) { - df.setMinimumFractionDigits(digits); - df.setMaximumFractionDigits(digits); + if (oldMinDigits == nf.getMaximumFractionDigits()) { + nf.setMinimumFractionDigits(digits); + nf.setMaximumFractionDigits(digits); } else { - df.setMinimumFractionDigits(Math.min(digits, oldMinDigits)); - df.setMaximumFractionDigits(digits); + nf.setMinimumFractionDigits(Math.min(digits, oldMinDigits)); + nf.setMaximumFractionDigits(digits); } } } diff --git a/jdk/test/java/util/Random/DistinctSeeds.java b/jdk/test/java/util/Random/DistinctSeeds.java index 21b653f02ee..76067507c7c 100644 --- a/jdk/test/java/util/Random/DistinctSeeds.java +++ b/jdk/test/java/util/Random/DistinctSeeds.java @@ -59,7 +59,7 @@ public class DistinctSeeds { } } final int threadCount = 2; - List collectors = new ArrayList(); + List collectors = new ArrayList<>(); List threads = new ArrayList(); for (int i = 0; i < threadCount; i++) { RandomCollector r = new RandomCollector(); diff --git a/jdk/test/java/util/ResourceBundle/Bug4168625Test.java b/jdk/test/java/util/ResourceBundle/Bug4168625Test.java index 1b2d2b50924..f9f58fba46b 100644 --- a/jdk/test/java/util/ResourceBundle/Bug4168625Test.java +++ b/jdk/test/java/util/ResourceBundle/Bug4168625Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,19 +25,13 @@ @summary test Resource Bundle for bug 4168625 @build Bug4168625Class Bug4168625Getter Bug4168625Resource Bug4168625Resource3 Bug4168625Resource3_en Bug4168625Resource3_en_CA Bug4168625Resource3_en_IE Bug4168625Resource3_en_US Bug4168625Resource2_en_US Bug4168625Resource2 @run main/timeout=600 Bug4168625Test - @bug 4168625 + @bug 4168625 6993339 */ /* * * * (C) Copyright IBM Corp. 1999 - All Rights Reserved * - * This software is the confidential and proprietary information - * of Sun Microsystems, Inc. ("Confidential Information"). You - * shall not disclose such Confidential Information and shall use - * it only in accordance with the terms of the license agreement - * you entered into with Sun. - * * The original version of this source code and documentation is * copyrighted and owned by IBM. These materials are provided * under terms of a License Agreement between IBM and Sun. @@ -50,9 +44,8 @@ import java.util.*; import java.io.*; /** - * This test tries to correct three efficiency problems with the caching - * mechanism of ResourceBundle. All tests assume that none of the bundles - * have been previously loaded and cached. It also allows concurrent loads + * This test tries to correct two efficiency problems with the caching + * mechanism of ResourceBundle. It also allows concurrent loads * of resource bundles to be performed if the bundles are unrelated (ex. a * load of a local system resource by one thread while another thread is * doing a slow load over a network). @@ -230,83 +223,6 @@ public class Bug4168625Test extends RBTestFmwk { } } - /** - * Previous versions of ResourceBundle exhibited the following caching behavior. - * Assume the class Bug4168625Resource_en exists. Bug4168625Resource_en_US does - * not. Two threads, ThreadA and ThreadB both try to get the same bundle. - *

        - *

        -     *  ThreadA.getBundle("Bug4168625Resource", new Locale("en", "US"));
        -     *      A-->try to load Bug4168625Resource_en_US
        -     *  ThreadB.getBundle("Bug4168625Resource", new Locale("en", "US"));
        -     *      B-->try to load Bug4168625Resource_en_US
        -     *      B-->load Bug4168625Resource_en (#1)
        -     *      A-->load Bug4168625Resource_en (#2)
        -     *      A-->cache Bug4168625Resource_en (#2) as Bug4168625Resource_en
        -     *      A-->cache Bug4168625Resource_en (#2) as Bug4168625Resource_en_US
        -     *      A-->return Bug4168625Resource_en (#2)
        -     *      B-->cache Bug4168625Resource_en (#1) as Bug4168625Resource_en
        -     *      B-->cache Bug4168625Resource_en (#1) as Bug4168625Resource_en_US
        -     *      B-->return Bug4168625Resource_en (#1)
        -     *  
        - *

        - * Both threads try and fail to load Bug4168625Resource_en_US. Both - * threads load Bug4168625Resource_en. Both threads get their own copy - * of the Bug4168625Resource_en resource. - * - * The desired behavior is as follows: - *

        - *

        -     *  ThreadA.getBundle("Bug4168625Resource", new Locale("en", "US"));
        -     *      A-->try to load Bug4168625Resource_en_US
        -     *  ThreadB.getBundle("Bug4168625Resource", new Locale("en", "US"));
        -     *      B-->try to load Bug4168625Resource_en_US
        -     *      B-->load Bug4168625Resource_en
        -     *      A-->load Bug4168625Resource_en (block in ResourceBundle.getBundle)
        -     *      B-->cache Bug4168625Resource_en as Bug4168625Resource_en
        -     *      B-->cache Bug4168625Resource_en as Bug4168625Resource_en_US
        -     *      A-->return Bug4168625Resource_en
        -     *      B-->return Bug4168625Resource_en
        -     *  
        - *

        - * Note that both threads return the same bundle object. - */ - public void testConcurrentLoading1() throws Exception { - final Loader loader = new Loader( new String[] { "Bug4168625Class" }, new String[] { "Bug4168625Resource3_en_US", "Bug4168625Resource3_en_CA" }); - final Class c = loader.loadClass("Bug4168625Class"); - final Bug4168625Getter test = (Bug4168625Getter)c.newInstance(); - - //both threads want the same resource - ConcurrentLoadingThread thread1 = new ConcurrentLoadingThread(loader, test, new Locale("en", "US")); - ConcurrentLoadingThread thread2 = new ConcurrentLoadingThread(loader, test, new Locale("en", "US")); - - thread1.start(); //start thread 1 - loader.waitForNotify(1); //wait for thread1 to do getBundle & block in loader - thread2.start(); //start second thread - loader.waitForNotify(2, 1000); //wait until thread2 blocks somewhere in getBundle - thread1.ping(); //continue both threads - thread2.ping(); - - thread1.join(); //wait unitl both threads complete - thread2.join(); - - //Now, examine the class loads that were done. - loader.logClasses("Classes loaded after completion of both threads:"); - - boolean dups = false; - for (int i = loader.loadedClasses.size() - 1; i >= 0 ; i--) { - final Object item = loader.loadedClasses.elementAt(i); - loader.loadedClasses.removeElementAt(i); - if (loader.loadedClasses.contains(item)) { - logln("Resource loaded more than once: "+item); - dups = true; - } - } - if (dups) { - errln("ResourceBundle loaded some classes multiple times"); - } - } - private class ConcurrentLoadingThread extends Thread { private Loader loader; public Object bundle; @@ -355,7 +271,7 @@ public class Bug4168625Test extends RBTestFmwk { * This test ensures that multiple resources can be loading at the same * time as long as they don't depend on each other in some way. */ - public void testConcurrentLoading2() throws Exception { + public void testConcurrentLoading() throws Exception { final Loader loader = new Loader( new String[] { "Bug4168625Class" }, new String[] { "Bug4168625Resource3_en_US", "Bug4168625Resource3_en_CA" }); final Class c = loader.loadClass("Bug4168625Class"); final Bug4168625Getter test = (Bug4168625Getter)c.newInstance(); diff --git a/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh b/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh index 85ec0c798b6..9509864ab83 100644 --- a/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh +++ b/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/ResourceBundle/Bug6359330.java b/jdk/test/java/util/ResourceBundle/Bug6359330.java index 2755f3376b4..7163e843d21 100644 --- a/jdk/test/java/util/ResourceBundle/Bug6359330.java +++ b/jdk/test/java/util/ResourceBundle/Bug6359330.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ResourceBundle/Control/ExpirationTest.sh b/jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh index eb668245857..e798bf9330d 100644 --- a/jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh +++ b/jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/ResourceBundle/Test4300693.java b/jdk/test/java/util/ResourceBundle/Test4300693.java index 471c0c8cfe7..e3571891d27 100644 --- a/jdk/test/java/util/ResourceBundle/Test4300693.java +++ b/jdk/test/java/util/ResourceBundle/Test4300693.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/ResourceBundle/TestBug4179766.java b/jdk/test/java/util/ResourceBundle/TestBug4179766.java index 0c6a8b9bc9c..38b151b7ae7 100644 --- a/jdk/test/java/util/ResourceBundle/TestBug4179766.java +++ b/jdk/test/java/util/ResourceBundle/TestBug4179766.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/Scanner/FailingConstructors.java b/jdk/test/java/util/Scanner/FailingConstructors.java new file mode 100644 index 00000000000..476c000ae1a --- /dev/null +++ b/jdk/test/java/util/Scanner/FailingConstructors.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 7000511 + * @summary PrintStream, PrintWriter, Formatter, Scanner leave files open when + * exception thrown + */ + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Scanner; + +public class FailingConstructors { + static final String fileName = "FailingConstructorsTest"; + static final String UNSUPPORTED_CHARSET = "unknownCharset"; + static final String FILE_CONTENTS = "This is a small file!"; + + private static void realMain(String[] args) throws Throwable { + test(false, new File(fileName)); + + /* create the file and write its contents */ + File file = File.createTempFile(fileName, null); + file.deleteOnExit(); + FileOutputStream fos = new FileOutputStream(file); + fos.write(FILE_CONTENTS.getBytes()); + fos.close(); + + test(true, file); + file.delete(); + } + + private static void test(boolean exists, File file) throws Throwable { + /* Scanner(File source, String charsetName) */ + try { + new Scanner(file, UNSUPPORTED_CHARSET); + fail(); + } catch(FileNotFoundException|IllegalArgumentException e) { + pass(); + } + + check(exists, file); + + try { + new Scanner(file, null); + fail(); + } catch(FileNotFoundException|NullPointerException e) { + pass(); + } + + check(exists, file); + + /* Scanner(FileRef source, String charsetName) */ + try { + new Scanner(file.toPath(), UNSUPPORTED_CHARSET); + fail(); + } catch(FileNotFoundException|IllegalArgumentException e) { + pass(); + } + + check(exists, file); + + try { + new Scanner(file.toPath(), null); + fail(); + } catch(FileNotFoundException|NullPointerException e) { + pass(); + } + + check(exists, file); + } + + private static void check(boolean exists, File file) { + if (exists) { + /* the file should be unchanged */ + verifyContents(file); + } else { + /* the file should not have been created */ + if (file.exists()) { fail(file + " should not have been created"); } + } + } + + private static void verifyContents(File file) { + try (FileInputStream fis = new FileInputStream(file)) { + byte[] contents = FILE_CONTENTS.getBytes(); + int read, count = 0; + while ((read = fis.read()) != -1) { + if (read != contents[count++]) { + fail("file contents have been altered"); + return; + } + } + } catch (IOException ioe) { + unexpected(ioe); + } + } + + //--------------------- Infrastructure --------------------------- + static volatile int passed = 0, failed = 0; + static void pass() {passed++;} + static void fail() {failed++; Thread.dumpStack();} + static void fail(String message) {System.out.println(message); fail(); } + static void unexpected(Throwable t) {failed++; t.printStackTrace();} + public static void main(String[] args) throws Throwable { + try {realMain(args);} catch (Throwable t) {unexpected(t);} + System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); + if (failed > 0) throw new AssertionError("Some tests failed");} +} diff --git a/jdk/test/java/util/ServiceLoader/basic.sh b/jdk/test/java/util/ServiceLoader/basic.sh index 87d650acc5e..7ab184e8956 100644 --- a/jdk/test/java/util/ServiceLoader/basic.sh +++ b/jdk/test/java/util/ServiceLoader/basic.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/WeakHashMap/GCDuringIteration.java b/jdk/test/java/util/WeakHashMap/GCDuringIteration.java index 938322b7db2..482d04426ca 100644 --- a/jdk/test/java/util/WeakHashMap/GCDuringIteration.java +++ b/jdk/test/java/util/WeakHashMap/GCDuringIteration.java @@ -33,18 +33,17 @@ import java.util.*; import java.util.concurrent.CountDownLatch; public class GCDuringIteration { - static void finalizeTillYouDrop() { - System.gc(); // Enqueue all finalizables + private static void waitForFinalizersToRun() { + for (int i = 0; i < 2; i++) + tryWaitForFinalizersToRun(); + } - System.runFinalization(); // Drain finalizer queue - - // There may be a straggler finalizable object still being - // finalized by the dedicated finalizer thread. Enqueue one - // more finalizable object, and wait for it to be finalized. - final CountDownLatch latch = new CountDownLatch(1); - new Object() { protected void finalize() { latch.countDown(); }}; + private static void tryWaitForFinalizersToRun() { System.gc(); - try { latch.await(); } + final CountDownLatch fin = new CountDownLatch(1); + new Object() { protected void finalize() { fin.countDown(); }}; + System.gc(); + try { fin.await(); } catch (InterruptedException ie) { throw new Error(ie); } } @@ -101,7 +100,9 @@ public class GCDuringIteration { { int first = firstValue(map); final Iterator> it = map.entrySet().iterator(); - foos[first] = null; finalizeTillYouDrop(); + foos[first] = null; + for (int i = 0; i < 10 && map.size() != first; i++) + tryWaitForFinalizersToRun(); equal(map.size(), first); checkIterator(it, first-1); equal(map.size(), first); @@ -113,11 +114,14 @@ public class GCDuringIteration { final Iterator> it = map.entrySet().iterator(); it.next(); // protects first entry System.out.println(map.values()); - foos[first] = null; finalizeTillYouDrop(); + foos[first] = null; + tryWaitForFinalizersToRun() equal(map.size(), first+1); System.out.println(map.values()); checkIterator(it, first-1); - finalizeTillYouDrop(); // first entry no longer protected + // first entry no longer protected + for (int i = 0; i < 10 && map.size() != first; i++) + tryWaitForFinalizersToRun(); equal(map.size(), first); equal(firstValue(map), first-1); } @@ -127,12 +131,15 @@ public class GCDuringIteration { final Iterator> it = map.entrySet().iterator(); it.next(); // protects first entry System.out.println(map.values()); - foos[first] = foos[first-1] = null; finalizeTillYouDrop(); + foos[first] = foos[first-1] = null; + tryWaitForFinalizersToRun(); equal(map.size(), first); equal(firstValue(map), first); System.out.println(map.values()); checkIterator(it, first-2); - finalizeTillYouDrop(); // first entry no longer protected + // first entry no longer protected + for (int i = 0; i < 10 && map.size() != first-1; i++) + tryWaitForFinalizersToRun(); equal(map.size(), first-1); equal(firstValue(map), first-2); } @@ -143,12 +150,15 @@ public class GCDuringIteration { it.next(); // protects first entry it.hasNext(); // protects second entry System.out.println(map.values()); - foos[first] = foos[first-1] = null; finalizeTillYouDrop(); + foos[first] = foos[first-1] = null; + tryWaitForFinalizersToRun(); equal(firstValue(map), first); equal(map.size(), first+1); System.out.println(map.values()); checkIterator(it, first-1); - finalizeTillYouDrop(); // first entry no longer protected + // first entry no longer protected + for (int i = 0; i < 10 && map.size() != first-1; i++) + tryWaitForFinalizersToRun(); equal(map.size(), first-1); equal(firstValue(map), first-2); } @@ -158,13 +168,16 @@ public class GCDuringIteration { final Iterator> it = map.entrySet().iterator(); it.next(); // protects first entry System.out.println(map.values()); - foos[first] = foos[first-1] = null; finalizeTillYouDrop(); + foos[first] = foos[first-1] = null; + tryWaitForFinalizersToRun(); it.remove(); equal(firstValue(map), first-2); equal(map.size(), first-1); System.out.println(map.values()); checkIterator(it, first-2); - finalizeTillYouDrop(); + // first entry no longer protected + for (int i = 0; i < 10 && map.size() != first-1; i++) + tryWaitForFinalizersToRun(); equal(map.size(), first-1); equal(firstValue(map), first-2); } @@ -176,12 +189,14 @@ public class GCDuringIteration { it.remove(); it.hasNext(); // protects second entry System.out.println(map.values()); - foos[first] = foos[first-1] = null; finalizeTillYouDrop(); + foos[first] = foos[first-1] = null; + tryWaitForFinalizersToRun(); equal(firstValue(map), first-1); equal(map.size(), first); System.out.println(map.values()); checkIterator(it, first-1); - finalizeTillYouDrop(); + for (int i = 0; i < 10 && map.size() != first-1; i++) + tryWaitForFinalizersToRun(); equal(map.size(), first-1); equal(firstValue(map), first-2); } @@ -191,12 +206,13 @@ public class GCDuringIteration { final Iterator> it = map.entrySet().iterator(); it.hasNext(); // protects first entry Arrays.fill(foos, null); - finalizeTillYouDrop(); + tryWaitForFinalizersToRun(); equal(map.size(), 1); System.out.println(map.values()); equal(it.next().getValue(), first); check(! it.hasNext()); - finalizeTillYouDrop(); + for (int i = 0; i < 10 && map.size() != 0; i++) + tryWaitForFinalizersToRun(); equal(map.size(), 0); check(map.isEmpty()); } diff --git a/jdk/test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java b/jdk/test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java index c12a57ec708..34f0722d8bd 100644 --- a/jdk/test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java +++ b/jdk/test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java @@ -34,7 +34,7 @@ /* * @test * @bug 4486658 - * @compile CancelledProducerConsumerLoops.java + * @compile -source 1.5 CancelledProducerConsumerLoops.java * @run main/timeout=7000 CancelledProducerConsumerLoops * @summary Checks for responsiveness of blocking queues to cancellation. * Runs under the assumption that ITERS computations require more than @@ -119,48 +119,24 @@ public class CancelledProducerConsumerLoops { } } - static final class LTQasSQ extends LinkedTransferQueue { - LTQasSQ() { super(); } - public void put(T x) { - try { super.transfer(x); } - catch (InterruptedException ex) { throw new Error(); } - } - private final static long serialVersionUID = 42; - } - - static final class HalfSyncLTQ extends LinkedTransferQueue { - HalfSyncLTQ() { super(); } - public void put(T x) { - if (ThreadLocalRandom.current().nextBoolean()) - super.put(x); - else { - try { super.transfer(x); } - catch (InterruptedException ex) { throw new Error(); } - } - } - private final static long serialVersionUID = 42; - } - static void oneTest(int pairs, int iters) throws Exception { oneRun(new ArrayBlockingQueue(CAPACITY), pairs, iters); oneRun(new LinkedBlockingQueue(CAPACITY), pairs, iters); oneRun(new LinkedBlockingDeque(CAPACITY), pairs, iters); + oneRun(new LinkedTransferQueue(), pairs, iters); oneRun(new SynchronousQueue(), pairs, iters / 8); - /* TODO: unbounded queue implementations are prone to OOME + /* PriorityBlockingQueue is unbounded oneRun(new PriorityBlockingQueue(iters / 2 * pairs), pairs, iters / 4); - oneRun(new LinkedTransferQueue(), pairs, iters); - oneRun(new LTQasSQ(), pairs, iters); - oneRun(new HalfSyncLTQ(), pairs, iters); */ } - static abstract class Stage implements Callable { + abstract static class Stage implements Callable { final BlockingQueue queue; final CyclicBarrier barrier; final int iters; - Stage (BlockingQueue q, CyclicBarrier b, int iters) { + Stage(BlockingQueue q, CyclicBarrier b, int iters) { queue = q; barrier = b; this.iters = iters; diff --git a/jdk/test/java/util/concurrent/BlockingQueue/Interrupt.java b/jdk/test/java/util/concurrent/BlockingQueue/Interrupt.java index 418515ded51..d8d55d9902b 100644 --- a/jdk/test/java/util/concurrent/BlockingQueue/Interrupt.java +++ b/jdk/test/java/util/concurrent/BlockingQueue/Interrupt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -136,5 +136,5 @@ public class Interrupt { try {realMain(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} - private static abstract class Fun {abstract void f() throws Throwable;} + private abstract static class Fun {abstract void f() throws Throwable;} } diff --git a/jdk/test/java/util/concurrent/BlockingQueue/LoopHelpers.java b/jdk/test/java/util/concurrent/BlockingQueue/LoopHelpers.java index f6bac816a7b..5bf6d0dbbee 100644 --- a/jdk/test/java/util/concurrent/BlockingQueue/LoopHelpers.java +++ b/jdk/test/java/util/concurrent/BlockingQueue/LoopHelpers.java @@ -79,9 +79,9 @@ class LoopHelpers { * Basically same as java.util.Random. */ public static class SimpleRandom { - private final static long multiplier = 0x5DEECE66DL; - private final static long addend = 0xBL; - private final static long mask = (1L << 48) - 1; + private static final long multiplier = 0x5DEECE66DL; + private static final long addend = 0xBL; + private static final long mask = (1L << 48) - 1; static final AtomicLong seq = new AtomicLong(1); private long seed = System.nanoTime() + seq.getAndIncrement(); diff --git a/jdk/test/java/util/concurrent/BlockingQueue/MultipleProducersSingleConsumerLoops.java b/jdk/test/java/util/concurrent/BlockingQueue/MultipleProducersSingleConsumerLoops.java index 1f85c511e59..d57939fc374 100644 --- a/jdk/test/java/util/concurrent/BlockingQueue/MultipleProducersSingleConsumerLoops.java +++ b/jdk/test/java/util/concurrent/BlockingQueue/MultipleProducersSingleConsumerLoops.java @@ -34,7 +34,7 @@ /* * @test * @bug 4486658 - * @compile MultipleProducersSingleConsumerLoops.java + * @compile -source 1.5 MultipleProducersSingleConsumerLoops.java * @run main/timeout=3600 MultipleProducersSingleConsumerLoops * @summary multiple producers and single consumer using blocking queues */ @@ -87,35 +87,11 @@ public class MultipleProducersSingleConsumerLoops { throw new Error(); } - static final class LTQasSQ extends LinkedTransferQueue { - LTQasSQ() { super(); } - public void put(T x) { - try { super.transfer(x); } - catch (InterruptedException ex) { throw new Error(); } - } - private final static long serialVersionUID = 42; - } - - static final class HalfSyncLTQ extends LinkedTransferQueue { - HalfSyncLTQ() { super(); } - public void put(T x) { - if (ThreadLocalRandom.current().nextBoolean()) - super.put(x); - else { - try { super.transfer(x); } - catch (InterruptedException ex) { throw new Error(); } - } - } - private final static long serialVersionUID = 42; - } - static void oneTest(int producers, int iters) throws Exception { oneRun(new ArrayBlockingQueue(CAPACITY), producers, iters); oneRun(new LinkedBlockingQueue(CAPACITY), producers, iters); oneRun(new LinkedBlockingDeque(CAPACITY), producers, iters); oneRun(new LinkedTransferQueue(), producers, iters); - oneRun(new LTQasSQ(), producers, iters); - oneRun(new HalfSyncLTQ(), producers, iters); // Don't run PBQ since can legitimately run out of memory // if (print) @@ -129,11 +105,11 @@ public class MultipleProducersSingleConsumerLoops { oneRun(new ArrayBlockingQueue(CAPACITY, true), producers, iters); } - static abstract class Stage implements Runnable { + abstract static class Stage implements Runnable { final int iters; final BlockingQueue queue; final CyclicBarrier barrier; - Stage (BlockingQueue q, CyclicBarrier b, int iters) { + Stage(BlockingQueue q, CyclicBarrier b, int iters) { queue = q; barrier = b; this.iters = iters; diff --git a/jdk/test/java/util/concurrent/BlockingQueue/ProducerConsumerLoops.java b/jdk/test/java/util/concurrent/BlockingQueue/ProducerConsumerLoops.java index f2b4a5b334d..9f18ab53c89 100644 --- a/jdk/test/java/util/concurrent/BlockingQueue/ProducerConsumerLoops.java +++ b/jdk/test/java/util/concurrent/BlockingQueue/ProducerConsumerLoops.java @@ -34,7 +34,7 @@ /* * @test * @bug 4486658 - * @compile ProducerConsumerLoops.java + * @compile -source 1.5 ProducerConsumerLoops.java * @run main/timeout=3600 ProducerConsumerLoops * @summary multiple producers and consumers using blocking queues */ @@ -87,35 +87,11 @@ public class ProducerConsumerLoops { throw new Error(); } - static final class LTQasSQ extends LinkedTransferQueue { - LTQasSQ() { super(); } - public void put(T x) { - try { super.transfer(x); } - catch (InterruptedException ex) { throw new Error(); } - } - private final static long serialVersionUID = 42; - } - - static final class HalfSyncLTQ extends LinkedTransferQueue { - HalfSyncLTQ() { super(); } - public void put(T x) { - if (ThreadLocalRandom.current().nextBoolean()) - super.put(x); - else { - try { super.transfer(x); } - catch (InterruptedException ex) { throw new Error(); } - } - } - private final static long serialVersionUID = 42; - } - static void oneTest(int pairs, int iters) throws Exception { oneRun(new ArrayBlockingQueue(CAPACITY), pairs, iters); oneRun(new LinkedBlockingQueue(CAPACITY), pairs, iters); oneRun(new LinkedBlockingDeque(CAPACITY), pairs, iters); oneRun(new LinkedTransferQueue(), pairs, iters); - oneRun(new LTQasSQ(), pairs, iters); - oneRun(new HalfSyncLTQ(), pairs, iters); oneRun(new PriorityBlockingQueue(), pairs, iters); oneRun(new SynchronousQueue(), pairs, iters); @@ -126,11 +102,11 @@ public class ProducerConsumerLoops { oneRun(new ArrayBlockingQueue(CAPACITY, true), pairs, iters); } - static abstract class Stage implements Runnable { + abstract static class Stage implements Runnable { final int iters; final BlockingQueue queue; final CyclicBarrier barrier; - Stage (BlockingQueue q, CyclicBarrier b, int iters) { + Stage(BlockingQueue q, CyclicBarrier b, int iters) { queue = q; barrier = b; this.iters = iters; diff --git a/jdk/test/java/util/concurrent/BlockingQueue/SingleProducerMultipleConsumerLoops.java b/jdk/test/java/util/concurrent/BlockingQueue/SingleProducerMultipleConsumerLoops.java index 1550bb22277..85699bc7d56 100644 --- a/jdk/test/java/util/concurrent/BlockingQueue/SingleProducerMultipleConsumerLoops.java +++ b/jdk/test/java/util/concurrent/BlockingQueue/SingleProducerMultipleConsumerLoops.java @@ -34,7 +34,7 @@ /* * @test * @bug 4486658 - * @compile SingleProducerMultipleConsumerLoops.java + * @compile -source 1.5 SingleProducerMultipleConsumerLoops.java * @run main/timeout=600 SingleProducerMultipleConsumerLoops * @summary check ordering for blocking queues with 1 producer and multiple consumers */ @@ -73,35 +73,11 @@ public class SingleProducerMultipleConsumerLoops { throw new Error(); } - static final class LTQasSQ extends LinkedTransferQueue { - LTQasSQ() { super(); } - public void put(T x) { - try { super.transfer(x); } - catch (InterruptedException ex) { throw new Error(); } - } - private final static long serialVersionUID = 42; - } - - static final class HalfSyncLTQ extends LinkedTransferQueue { - HalfSyncLTQ() { super(); } - public void put(T x) { - if (ThreadLocalRandom.current().nextBoolean()) - super.put(x); - else { - try { super.transfer(x); } - catch (InterruptedException ex) { throw new Error(); } - } - } - private final static long serialVersionUID = 42; - } - static void oneTest(int consumers, int iters) throws Exception { oneRun(new ArrayBlockingQueue(CAPACITY), consumers, iters); oneRun(new LinkedBlockingQueue(CAPACITY), consumers, iters); oneRun(new LinkedBlockingDeque(CAPACITY), consumers, iters); oneRun(new LinkedTransferQueue(), consumers, iters); - oneRun(new LTQasSQ(), consumers, iters); - oneRun(new HalfSyncLTQ(), consumers, iters); oneRun(new PriorityBlockingQueue(), consumers, iters); oneRun(new SynchronousQueue(), consumers, iters); if (print) @@ -110,12 +86,12 @@ public class SingleProducerMultipleConsumerLoops { oneRun(new ArrayBlockingQueue(CAPACITY, true), consumers, iters); } - static abstract class Stage implements Runnable { + abstract static class Stage implements Runnable { final int iters; final BlockingQueue queue; final CyclicBarrier barrier; volatile int result; - Stage (BlockingQueue q, CyclicBarrier b, int iters) { + Stage(BlockingQueue q, CyclicBarrier b, int iters) { queue = q; barrier = b; this.iters = iters; diff --git a/jdk/test/java/util/concurrent/ConcurrentHashMap/LoopHelpers.java b/jdk/test/java/util/concurrent/ConcurrentHashMap/LoopHelpers.java index f6bac816a7b..5bf6d0dbbee 100644 --- a/jdk/test/java/util/concurrent/ConcurrentHashMap/LoopHelpers.java +++ b/jdk/test/java/util/concurrent/ConcurrentHashMap/LoopHelpers.java @@ -79,9 +79,9 @@ class LoopHelpers { * Basically same as java.util.Random. */ public static class SimpleRandom { - private final static long multiplier = 0x5DEECE66DL; - private final static long addend = 0xBL; - private final static long mask = (1L << 48) - 1; + private static final long multiplier = 0x5DEECE66DL; + private static final long addend = 0xBL; + private static final long mask = (1L << 48) - 1; static final AtomicLong seq = new AtomicLong(1); private long seed = System.nanoTime() + seq.getAndIncrement(); diff --git a/jdk/test/java/util/concurrent/ConcurrentHashMap/MapCheck.java b/jdk/test/java/util/concurrent/ConcurrentHashMap/MapCheck.java index e9ca263c910..c6075c131b9 100644 --- a/jdk/test/java/util/concurrent/ConcurrentHashMap/MapCheck.java +++ b/jdk/test/java/util/concurrent/ConcurrentHashMap/MapCheck.java @@ -34,7 +34,7 @@ /* * @test * @bug 4486658 - * @compile MapCheck.java + * @compile -source 1.5 MapCheck.java * @run main/timeout=240 MapCheck * @summary Times and checks basic map operations */ @@ -64,7 +64,7 @@ public class MapCheck { if (args.length > 0) { try { mapClass = Class.forName(args[0]); - } catch(ClassNotFoundException e) { + } catch (ClassNotFoundException e) { throw new RuntimeException("Class " + args[0] + " not found."); } } @@ -102,7 +102,7 @@ public class MapCheck { try { Map m = (Map)cl.newInstance(); return m; - } catch(Exception e) { + } catch (Exception e) { throw new RuntimeException("Can't instantiate " + cl + ": " + e); } } @@ -139,7 +139,7 @@ public class MapCheck { } } timer.finish(); - reallyAssert (sum == expect * iters); + reallyAssert(sum == expect * iters); } static void t2(String nm, int n, Map s, Object[] key, int expect) { @@ -149,7 +149,7 @@ public class MapCheck { if (s.remove(key[i]) != null) ++sum; } timer.finish(); - reallyAssert (sum == expect); + reallyAssert(sum == expect); } static void t3(String nm, int n, Map s, Object[] key, int expect) { @@ -159,7 +159,7 @@ public class MapCheck { if (s.put(key[i], absent[i & absentMask]) == null) ++sum; } timer.finish(); - reallyAssert (sum == expect); + reallyAssert(sum == expect); } static void t4(String nm, int n, Map s, Object[] key, int expect) { @@ -169,7 +169,7 @@ public class MapCheck { if (s.containsKey(key[i])) ++sum; } timer.finish(); - reallyAssert (sum == expect); + reallyAssert(sum == expect); } static void t5(String nm, int n, Map s, Object[] key, int expect) { @@ -179,7 +179,7 @@ public class MapCheck { if (s.remove(key[i]) != null) ++sum; } timer.finish(); - reallyAssert (sum == expect); + reallyAssert(sum == expect); } static void t6(String nm, int n, Map s, Object[] k1, Object[] k2) { @@ -190,7 +190,7 @@ public class MapCheck { if (s.get(k2[i & absentMask]) != null) ++sum; } timer.finish(); - reallyAssert (sum == n); + reallyAssert(sum == n); } static void t7(String nm, int n, Map s, Object[] k1, Object[] k2) { @@ -201,7 +201,7 @@ public class MapCheck { if (s.containsKey(k2[i & absentMask])) ++sum; } timer.finish(); - reallyAssert (sum == n); + reallyAssert(sum == n); } static void t8(String nm, int n, Map s, Object[] key, int expect) { @@ -211,7 +211,7 @@ public class MapCheck { if (s.get(key[i]) != null) ++sum; } timer.finish(); - reallyAssert (sum == expect); + reallyAssert(sum == expect); } @@ -223,7 +223,7 @@ public class MapCheck { for (int i = 0; i < absentSize; i += step) if (s.containsValue(absent[i])) ++sum; timer.finish(); - reallyAssert (sum != 0); + reallyAssert(sum != 0); } @@ -235,7 +235,7 @@ public class MapCheck { if (ks.contains(key[i])) ++sum; } timer.finish(); - reallyAssert (sum == size); + reallyAssert(sum == size); } @@ -243,37 +243,37 @@ public class MapCheck { int sum = 0; timer.start("Iter Key ", size); for (Iterator it = s.keySet().iterator(); it.hasNext(); ) { - if(it.next() != MISSING) + if (it.next() != MISSING) ++sum; } timer.finish(); - reallyAssert (sum == size); + reallyAssert(sum == size); } static void ittest2(Map s, int size) { int sum = 0; timer.start("Iter Value ", size); for (Iterator it = s.values().iterator(); it.hasNext(); ) { - if(it.next() != MISSING) + if (it.next() != MISSING) ++sum; } timer.finish(); - reallyAssert (sum == size); + reallyAssert(sum == size); } static void ittest3(Map s, int size) { int sum = 0; timer.start("Iter Entry ", size); for (Iterator it = s.entrySet().iterator(); it.hasNext(); ) { - if(it.next() != MISSING) + if (it.next() != MISSING) ++sum; } timer.finish(); - reallyAssert (sum == size); + reallyAssert(sum == size); } static void ittest4(Map s, int size, int pos) { IdentityHashMap seen = new IdentityHashMap(size); - reallyAssert (s.size() == size); + reallyAssert(s.size() == size); int sum = 0; timer.start("Iter XEntry ", size); Iterator it = s.entrySet().iterator(); @@ -287,9 +287,9 @@ public class MapCheck { if (x != MISSING) ++sum; } - reallyAssert (s.containsKey(k)); + reallyAssert(s.containsKey(k)); it.remove(); - reallyAssert (!s.containsKey(k)); + reallyAssert(!s.containsKey(k)); while (it.hasNext()) { Map.Entry x = (Map.Entry)(it.next()); Object k2 = x.getKey(); @@ -298,12 +298,12 @@ public class MapCheck { ++sum; } - reallyAssert (s.size() == size-1); + reallyAssert(s.size() == size-1); s.put(k, v); - reallyAssert (seen.size() == size); + reallyAssert(seen.size() == size); timer.finish(); - reallyAssert (sum == size); - reallyAssert (s.size() == size); + reallyAssert(sum == size); + reallyAssert(s.size() == size); } @@ -324,7 +324,7 @@ public class MapCheck { ++sum; } timer.finish(); - reallyAssert (sum == size); + reallyAssert(sum == size); } static void entest2(Hashtable ht, int size) { @@ -335,7 +335,7 @@ public class MapCheck { ++sum; } timer.finish(); - reallyAssert (sum == size); + reallyAssert(sum == size); } @@ -349,7 +349,7 @@ public class MapCheck { ++sum; } timer.finish(); - reallyAssert (sum == size); + reallyAssert(sum == size); } static void entest4(Hashtable ht, int size) { @@ -361,7 +361,7 @@ public class MapCheck { ++sum; } timer.finish(); - reallyAssert (sum == size); + reallyAssert(sum == size); } static void entest(Map s, int size) { @@ -409,13 +409,13 @@ public class MapCheck { timer.start("Iter Equals ", size * 2); boolean eqt = s2.equals(s) && s.equals(s2); - reallyAssert (eqt); + reallyAssert(eqt); timer.finish(); timer.start("Iter HashCode ", size * 2); int shc = s.hashCode(); int s2hc = s2.hashCode(); - reallyAssert (shc == s2hc); + reallyAssert(shc == s2hc); timer.finish(); timer.start("Put (present) ", size); @@ -430,7 +430,7 @@ public class MapCheck { if (es2.contains(entry)) ++sum; } timer.finish(); - reallyAssert (sum == size); + reallyAssert(sum == size); t6("Get ", size, s2, key, absent); @@ -438,13 +438,13 @@ public class MapCheck { s2.put(key[size-1], absent[0]); timer.start("Iter Equals ", size * 2); eqt = s2.equals(s) && s.equals(s2); - reallyAssert (!eqt); + reallyAssert(!eqt); timer.finish(); timer.start("Iter HashCode ", size * 2); int s1h = s.hashCode(); int s2h = s2.hashCode(); - reallyAssert (s1h != s2h); + reallyAssert(s1h != s2h); timer.finish(); s2.put(key[size-1], hold); @@ -455,12 +455,12 @@ public class MapCheck { es.remove(s2i.next()); timer.finish(); - reallyAssert (s.isEmpty()); + reallyAssert(s.isEmpty()); timer.start("Clear ", size); s2.clear(); timer.finish(); - reallyAssert (s2.isEmpty() && s.isEmpty()); + reallyAssert(s2.isEmpty() && s.isEmpty()); } static void stest(Map s, int size) throws Exception { @@ -489,7 +489,7 @@ public class MapCheck { System.out.print(time + "ms"); if (s instanceof IdentityHashMap) return; - reallyAssert (s.equals(m)); + reallyAssert(s.equals(m)); } diff --git a/jdk/test/java/util/concurrent/ConcurrentHashMap/MapLoops.java b/jdk/test/java/util/concurrent/ConcurrentHashMap/MapLoops.java index 5f3d375515e..53ed2919a9d 100644 --- a/jdk/test/java/util/concurrent/ConcurrentHashMap/MapLoops.java +++ b/jdk/test/java/util/concurrent/ConcurrentHashMap/MapLoops.java @@ -34,7 +34,7 @@ /* * @test * @bug 4486658 - * @compile MapLoops.java + * @compile -source 1.5 MapLoops.java * @run main/timeout=1600 MapLoops * @summary Exercise multithreaded maps, by default ConcurrentHashMap. * Multithreaded hash table test. Each thread does a random walk @@ -225,7 +225,7 @@ public class MapLoops { barrier.await(); } catch (Throwable throwable) { - synchronized(System.err) { + synchronized (System.err) { System.err.println("--------------------------------"); throwable.printStackTrace(); } diff --git a/jdk/test/java/util/concurrent/ConcurrentQueues/IteratorWeakConsistency.java b/jdk/test/java/util/concurrent/ConcurrentQueues/IteratorWeakConsistency.java index 36411ad3693..dabb2b9de2a 100644 --- a/jdk/test/java/util/concurrent/ConcurrentQueues/IteratorWeakConsistency.java +++ b/jdk/test/java/util/concurrent/ConcurrentQueues/IteratorWeakConsistency.java @@ -53,26 +53,49 @@ public class IteratorWeakConsistency { test(new LinkedTransferQueue()); // Other concurrent queues (e.g. ArrayBlockingQueue) do not // currently have weakly consistent iterators. - // test(new ArrayBlockingQueue(20)); + // As of 2010-09, ArrayBlockingQueue passes this test, but + // does not fully implement weak consistency. + test(new ArrayBlockingQueue(20)); } - void test(Queue q) throws Throwable { + void test(Queue q) { // TODO: make this more general - for (int i = 0; i < 10; i++) - q.add(i); - Iterator it = q.iterator(); - q.poll(); - q.poll(); - q.poll(); - q.remove(7); - List list = new ArrayList(); - while (it.hasNext()) - list.add(it.next()); - equal(list, Arrays.asList(0, 3, 4, 5, 6, 8, 9)); - check(! list.contains(null)); - System.out.printf("%s: %s%n", - q.getClass().getSimpleName(), - list); + try { + for (int i = 0; i < 10; i++) + q.add(i); + Iterator it = q.iterator(); + q.poll(); + q.poll(); + q.poll(); + q.remove(7); + List list = new ArrayList(); + while (it.hasNext()) + list.add(it.next()); + equal(list, Arrays.asList(0, 3, 4, 5, 6, 8, 9)); + check(! list.contains(null)); + System.out.printf("%s: %s%n", + q.getClass().getSimpleName(), + list); + } catch (Throwable t) { unexpected(t); } + + try { + q.clear(); + q.add(1); + q.add(2); + q.add(3); + q.add(4); + Iterator it = q.iterator(); + it.next(); + q.remove(2); + q.remove(1); + q.remove(3); + boolean found4 = false; + while (it.hasNext()) { + found4 |= it.next().equals(4); + } + check(found4); + } catch (Throwable t) { unexpected(t); } + } //--------------------- Infrastructure --------------------------- @@ -85,7 +108,6 @@ public class IteratorWeakConsistency { void equal(Object x, Object y) { if (x == null ? y == null : x.equals(y)) pass(); else fail(x + " not equal to " + y);} - static Class thisClass = new Object(){}.getClass().getEnclosingClass(); public static void main(String[] args) throws Throwable { new IteratorWeakConsistency().instanceMain(args);} public void instanceMain(String[] args) throws Throwable { diff --git a/jdk/test/java/util/concurrent/ConcurrentQueues/LoopHelpers.java b/jdk/test/java/util/concurrent/ConcurrentQueues/LoopHelpers.java index f6bac816a7b..5bf6d0dbbee 100644 --- a/jdk/test/java/util/concurrent/ConcurrentQueues/LoopHelpers.java +++ b/jdk/test/java/util/concurrent/ConcurrentQueues/LoopHelpers.java @@ -79,9 +79,9 @@ class LoopHelpers { * Basically same as java.util.Random. */ public static class SimpleRandom { - private final static long multiplier = 0x5DEECE66DL; - private final static long addend = 0xBL; - private final static long mask = (1L << 48) - 1; + private static final long multiplier = 0x5DEECE66DL; + private static final long addend = 0xBL; + private static final long mask = (1L << 48) - 1; static final AtomicLong seq = new AtomicLong(1); private long seed = System.nanoTime() + seq.getAndIncrement(); diff --git a/jdk/test/java/util/concurrent/ConcurrentQueues/OfferRemoveLoops.java b/jdk/test/java/util/concurrent/ConcurrentQueues/OfferRemoveLoops.java index 798a148e5b6..56aeadc7cb2 100644 --- a/jdk/test/java/util/concurrent/ConcurrentQueues/OfferRemoveLoops.java +++ b/jdk/test/java/util/concurrent/ConcurrentQueues/OfferRemoveLoops.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/CopyOnWriteArrayList/EqualsRace.java b/jdk/test/java/util/concurrent/CopyOnWriteArrayList/EqualsRace.java index ad063ea237a..7445d26dbb1 100644 --- a/jdk/test/java/util/concurrent/CopyOnWriteArrayList/EqualsRace.java +++ b/jdk/test/java/util/concurrent/CopyOnWriteArrayList/EqualsRace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class EqualsRace { try {realMain(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} - private static abstract class CheckedThread extends Thread { + private abstract static class CheckedThread extends Thread { public abstract void realRun() throws Throwable; public void run() { try { realRun(); } catch (Throwable t) { unexpected(t); }}} diff --git a/jdk/test/java/util/concurrent/CopyOnWriteArraySet/RacingCows.java b/jdk/test/java/util/concurrent/CopyOnWriteArraySet/RacingCows.java index afde87549ed..addfb0961cd 100644 --- a/jdk/test/java/util/concurrent/CopyOnWriteArraySet/RacingCows.java +++ b/jdk/test/java/util/concurrent/CopyOnWriteArraySet/RacingCows.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,7 +125,7 @@ public class RacingCows { try {realMain(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} - private static abstract class CheckedThread extends Thread { + private abstract static class CheckedThread extends Thread { public abstract void realRun() throws Throwable; public void run() { try { realRun(); } catch (Throwable t) { unexpected(t); }}} diff --git a/jdk/test/java/util/concurrent/CyclicBarrier/Basic.java b/jdk/test/java/util/concurrent/CyclicBarrier/Basic.java index b20a81ea2ff..123481985b2 100644 --- a/jdk/test/java/util/concurrent/CyclicBarrier/Basic.java +++ b/jdk/test/java/util/concurrent/CyclicBarrier/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -83,7 +83,7 @@ public class Basic { //---------------------------------------------------------------- // Convenience methods for creating threads that call CyclicBarrier.await //---------------------------------------------------------------- - private static abstract class Awaiter extends Thread { + private abstract static class Awaiter extends Thread { static AtomicInteger count = new AtomicInteger(1); { @@ -417,14 +417,14 @@ public class Basic { try {realMain(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} - static abstract class Fun { abstract void f() throws Throwable; } + abstract static class Fun { abstract void f() throws Throwable; } private static void THROWS(Class k, Fun... fs) { for (Fun f : fs) try { f.f(); fail("Expected " + k.getName() + " not thrown"); } catch (Throwable t) { if (k.isAssignableFrom(t.getClass())) pass(); else unexpected(t);}} - private static abstract class CheckedThread extends Thread { + private abstract static class CheckedThread extends Thread { abstract void realRun() throws Throwable; public void run() { try {realRun();} catch (Throwable t) {unexpected(t);}}} diff --git a/jdk/test/java/util/concurrent/Exchanger/ExchangeLoops.java b/jdk/test/java/util/concurrent/Exchanger/ExchangeLoops.java index b207b8c2d92..2055c056ca3 100644 --- a/jdk/test/java/util/concurrent/Exchanger/ExchangeLoops.java +++ b/jdk/test/java/util/concurrent/Exchanger/ExchangeLoops.java @@ -34,7 +34,7 @@ /* * @test * @bug 4486658 - * @compile ExchangeLoops.java + * @compile -source 1.5 ExchangeLoops.java * @run main/timeout=720 ExchangeLoops * @summary checks to make sure a pipeline of exchangers passes data. */ @@ -78,9 +78,9 @@ public class ExchangeLoops { final Exchanger right; final CyclicBarrier barrier; volatile int result; - Stage (Exchanger left, - Exchanger right, - CyclicBarrier b, int iters) { + Stage(Exchanger left, + Exchanger right, + CyclicBarrier b, int iters) { this.left = left; this.right = right; barrier = b; diff --git a/jdk/test/java/util/concurrent/Exchanger/LoopHelpers.java b/jdk/test/java/util/concurrent/Exchanger/LoopHelpers.java index d3dd5b4a5ef..6b65b8b2d4a 100644 --- a/jdk/test/java/util/concurrent/Exchanger/LoopHelpers.java +++ b/jdk/test/java/util/concurrent/Exchanger/LoopHelpers.java @@ -78,9 +78,9 @@ class LoopHelpers { * Basically same as java.util.Random. */ public static class SimpleRandom { - private final static long multiplier = 0x5DEECE66DL; - private final static long addend = 0xBL; - private final static long mask = (1L << 48) - 1; + private static final long multiplier = 0x5DEECE66DL; + private static final long addend = 0xBL; + private static final long mask = (1L << 48) - 1; static final AtomicLong seq = new AtomicLong(1); private long seed = System.nanoTime() + seq.getAndIncrement(); diff --git a/jdk/test/java/util/concurrent/ExecutorCompletionService/ExecutorCompletionServiceLoops.java b/jdk/test/java/util/concurrent/ExecutorCompletionService/ExecutorCompletionServiceLoops.java index 2c67ba5697d..71c45e75f7f 100644 --- a/jdk/test/java/util/concurrent/ExecutorCompletionService/ExecutorCompletionServiceLoops.java +++ b/jdk/test/java/util/concurrent/ExecutorCompletionService/ExecutorCompletionServiceLoops.java @@ -34,7 +34,7 @@ /* * @test * @bug 4965960 - * @compile ExecutorCompletionServiceLoops.java + * @compile -source 1.5 ExecutorCompletionServiceLoops.java * @run main/timeout=3600 ExecutorCompletionServiceLoops * @summary Exercise ExecutorCompletionServiceLoops */ diff --git a/jdk/test/java/util/concurrent/ExecutorCompletionService/LoopHelpers.java b/jdk/test/java/util/concurrent/ExecutorCompletionService/LoopHelpers.java index d3dd5b4a5ef..6b65b8b2d4a 100644 --- a/jdk/test/java/util/concurrent/ExecutorCompletionService/LoopHelpers.java +++ b/jdk/test/java/util/concurrent/ExecutorCompletionService/LoopHelpers.java @@ -78,9 +78,9 @@ class LoopHelpers { * Basically same as java.util.Random. */ public static class SimpleRandom { - private final static long multiplier = 0x5DEECE66DL; - private final static long addend = 0xBL; - private final static long mask = (1L << 48) - 1; + private static final long multiplier = 0x5DEECE66DL; + private static final long addend = 0xBL; + private static final long mask = (1L << 48) - 1; static final AtomicLong seq = new AtomicLong(1); private long seed = System.nanoTime() + seq.getAndIncrement(); diff --git a/jdk/test/java/util/concurrent/Executors/AutoShutdown.java b/jdk/test/java/util/concurrent/Executors/AutoShutdown.java index 67fe405f3c9..fb4976ff878 100644 --- a/jdk/test/java/util/concurrent/Executors/AutoShutdown.java +++ b/jdk/test/java/util/concurrent/Executors/AutoShutdown.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ /* * @test * @bug 6399443 + * @run main/othervm AutoShutdown * @summary Check for auto-shutdown and gc of singleThreadExecutors * @author Martin Buchholz */ @@ -32,21 +33,40 @@ import java.io.*; import java.util.*; import java.util.concurrent.*; import static java.util.concurrent.Executors.*; +import java.util.concurrent.Phaser; public class AutoShutdown { - private static void waitForFinalizersToRun() throws Throwable { - System.gc(); System.runFinalization(); Thread.sleep(10); - System.gc(); System.runFinalization(); Thread.sleep(10); + private static void waitForFinalizersToRun() { + for (int i = 0; i < 2; i++) + tryWaitForFinalizersToRun(); + } + + private static void tryWaitForFinalizersToRun() { + System.gc(); + final CountDownLatch fin = new CountDownLatch(1); + new Object() { protected void finalize() { fin.countDown(); }}; + System.gc(); + try { fin.await(); } + catch (InterruptedException ie) { throw new Error(ie); } } private static void realMain(String[] args) throws Throwable { - Runnable trivialRunnable = new Runnable() { public void run() {}}; + final Phaser phaser = new Phaser(3); + Runnable trivialRunnable = new Runnable() { + public void run() { + phaser.arriveAndAwaitAdvance(); + } + }; int count0 = Thread.activeCount(); - newSingleThreadExecutor().execute(trivialRunnable); - newSingleThreadExecutor(defaultThreadFactory()).execute(trivialRunnable); - Thread.sleep(100); + Executor e1 = newSingleThreadExecutor(); + Executor e2 = newSingleThreadExecutor(defaultThreadFactory()); + e1.execute(trivialRunnable); + e2.execute(trivialRunnable); + phaser.arriveAndAwaitAdvance(); equal(Thread.activeCount(), count0 + 2); - waitForFinalizersToRun(); + e1 = e2 = null; + for (int i = 0; i < 10 && Thread.activeCount() > count0; i++) + tryWaitForFinalizersToRun(); equal(Thread.activeCount(), count0); } diff --git a/jdk/test/java/util/concurrent/Executors/Throws.java b/jdk/test/java/util/concurrent/Executors/Throws.java index c310ad5c9ec..424b60d6d72 100644 --- a/jdk/test/java/util/concurrent/Executors/Throws.java +++ b/jdk/test/java/util/concurrent/Executors/Throws.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -122,7 +122,7 @@ public class Throws { try {realMain(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} - private static abstract class Fun {abstract void f() throws Throwable;} + private abstract static class Fun {abstract void f() throws Throwable;} static void THROWS(Class k, Fun... fs) { for (Fun f : fs) try { f.f(); fail("Expected " + k.getName() + " not thrown"); } diff --git a/jdk/test/java/util/concurrent/FutureTask/BlockingTaskExecutor.java b/jdk/test/java/util/concurrent/FutureTask/BlockingTaskExecutor.java index bd6c2e839da..00aed7c47f0 100644 --- a/jdk/test/java/util/concurrent/FutureTask/BlockingTaskExecutor.java +++ b/jdk/test/java/util/concurrent/FutureTask/BlockingTaskExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +87,7 @@ public class BlockingTaskExecutor { * A helper class with a method to wait for a notification. * * The notification is received via the - * sendNotification method. + * {@code sendNotification} method. */ static class NotificationReceiver { /** Has the notifiee been notified? */ diff --git a/jdk/test/java/util/concurrent/FutureTask/CancelledFutureLoops.java b/jdk/test/java/util/concurrent/FutureTask/CancelledFutureLoops.java index c12f5cde944..6a0ca8c93df 100644 --- a/jdk/test/java/util/concurrent/FutureTask/CancelledFutureLoops.java +++ b/jdk/test/java/util/concurrent/FutureTask/CancelledFutureLoops.java @@ -34,7 +34,7 @@ /* * @test * @bug 4486658 - * @compile CancelledFutureLoops.java + * @compile -source 1.5 CancelledFutureLoops.java * @run main/timeout=2000 CancelledFutureLoops * @summary Checks for responsiveness of futures to cancellation. * Runs under the assumption that ITERS computations require more than @@ -64,10 +64,10 @@ public final class CancelledFutureLoops { try { new FutureLoop(i).test(); } - catch(BrokenBarrierException bb) { + catch (BrokenBarrierException bb) { // OK; ignore } - catch(ExecutionException ee) { + catch (ExecutionException ee) { // OK; ignore } Thread.sleep(TIMEOUT); diff --git a/jdk/test/java/util/concurrent/FutureTask/Customized.java b/jdk/test/java/util/concurrent/FutureTask/Customized.java index 1f1f8fb4939..15159ca0aab 100644 --- a/jdk/test/java/util/concurrent/FutureTask/Customized.java +++ b/jdk/test/java/util/concurrent/FutureTask/Customized.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -203,7 +203,7 @@ public class Customized { try {realMain(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} - private static abstract class Fun {abstract void f() throws Throwable;} + private abstract static class Fun {abstract void f() throws Throwable;} static void THROWS(Class k, Fun... fs) { for (Fun f : fs) try { f.f(); fail("Expected " + k.getName() + " not thrown"); } diff --git a/jdk/test/java/util/concurrent/FutureTask/LoopHelpers.java b/jdk/test/java/util/concurrent/FutureTask/LoopHelpers.java index d3dd5b4a5ef..6b65b8b2d4a 100644 --- a/jdk/test/java/util/concurrent/FutureTask/LoopHelpers.java +++ b/jdk/test/java/util/concurrent/FutureTask/LoopHelpers.java @@ -78,9 +78,9 @@ class LoopHelpers { * Basically same as java.util.Random. */ public static class SimpleRandom { - private final static long multiplier = 0x5DEECE66DL; - private final static long addend = 0xBL; - private final static long mask = (1L << 48) - 1; + private static final long multiplier = 0x5DEECE66DL; + private static final long addend = 0xBL; + private static final long mask = (1L << 48) - 1; static final AtomicLong seq = new AtomicLong(1); private long seed = System.nanoTime() + seq.getAndIncrement(); diff --git a/jdk/test/java/util/concurrent/Phaser/Basic.java b/jdk/test/java/util/concurrent/Phaser/Basic.java index e394cee94f6..a358873c2ec 100644 --- a/jdk/test/java/util/concurrent/Phaser/Basic.java +++ b/jdk/test/java/util/concurrent/Phaser/Basic.java @@ -52,15 +52,16 @@ public class Basic { check(phaser.isTerminated()); int unarriverParties = phaser.getUnarrivedParties(); int registeredParties = phaser.getRegisteredParties(); - equal(phaser.arrive(), -1); - equal(phaser.arriveAndDeregister(), -1); - equal(phaser.arriveAndAwaitAdvance(), -1); - equal(phaser.bulkRegister(10), -1); - equal(phaser.getPhase(), -1); - equal(phaser.register(), -1); + int phase = phaser.getPhase(); + check(phase < 0); + equal(phase, phaser.arrive()); + equal(phase, phaser.arriveAndDeregister()); + equal(phase, phaser.arriveAndAwaitAdvance()); + equal(phase, phaser.bulkRegister(10)); + equal(phase, phaser.register()); try { - equal(phaser.awaitAdvanceInterruptibly(0), -1); - equal(phaser.awaitAdvanceInterruptibly(0, 10, SECONDS), -1); + equal(phase, phaser.awaitAdvanceInterruptibly(0)); + equal(phase, phaser.awaitAdvanceInterruptibly(0, 10, SECONDS)); } catch (Exception ie) { unexpected(ie); } @@ -94,10 +95,9 @@ public class Basic { } int phase = atTheStartingGate.getPhase(); equal(phase, atTheStartingGate.arrive()); - int AwaitPhase = atTheStartingGate.awaitAdvanceInterruptibly(phase, - 10, - SECONDS); - if (expectNextPhase) check(AwaitPhase == (phase + 1)); + int awaitPhase = atTheStartingGate.awaitAdvanceInterruptibly + (phase, 10, SECONDS); + if (expectNextPhase) check(awaitPhase == (phase + 1)); pass(); } catch (Throwable t) { @@ -271,18 +271,19 @@ public class Basic { // Phaser is terminated while threads are waiting //---------------------------------------------------------------- try { - Phaser phaser = new Phaser(3); - Iterator awaiters = awaiterIterator(phaser); for (int i = 0; i < 4; i++) { + Phaser phaser = new Phaser(3); + Iterator awaiters = awaiterIterator(phaser); Arriver a1 = awaiters.next(); a1.start(); Arriver a2 = awaiters.next(); a2.start(); toTheStartingGate(); while (phaser.getArrivedParties() < 2) Thread.yield(); + equal(0, phaser.getPhase()); phaser.forceTermination(); a1.join(); a2.join(); - check(a1.phase == -1); - check(a2.phase == -1); + equal(0 + Integer.MIN_VALUE, a1.phase); + equal(0 + Integer.MIN_VALUE, a2.phase); int arrivedParties = phaser.getArrivedParties(); checkTerminated(phaser); equal(phaser.getArrivedParties(), arrivedParties); diff --git a/jdk/test/java/util/concurrent/Phaser/FickleRegister.java b/jdk/test/java/util/concurrent/Phaser/FickleRegister.java new file mode 100644 index 00000000000..9ce91c5de44 --- /dev/null +++ b/jdk/test/java/util/concurrent/Phaser/FickleRegister.java @@ -0,0 +1,150 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * This file is available under and governed by the GNU General Public + * License version 2 only, as published by the Free Software Foundation. + * However, the following notice accompanied the original version of this + * file: + * + * Written by Doug Lea with assistance from members of JCP JSR-166 + * Expert Group and released to the public domain, as explained at + * http://creativecommons.org/licenses/publicdomain + */ + +/* + * @test + * @summary stress test for register/arriveAndDeregister + * @run main FickleRegister 300 + */ + +import java.util.*; +import java.util.concurrent.*; +import java.util.concurrent.atomic.*; + +public class FickleRegister { + final AtomicLong count = new AtomicLong(0); + final long testDurationMillisDefault = 10L * 1000L; + final long testDurationMillis; + final long quittingTimeNanos; + final int chunkSize = 1000; + + FickleRegister(String[] args) { + testDurationMillis = (args.length > 0) ? + Long.valueOf(args[0]) : testDurationMillisDefault; + quittingTimeNanos = System.nanoTime() + + testDurationMillis * 1000L * 1000L; + } + + class Runner extends CheckedRunnable { + final Phaser p; + Runner(Phaser phaser) { p = phaser; } + public void realRun() { + int prevPhase = -1; + for (int k = 1;; k++) { + for (int i = 0; i < chunkSize; i++) { + int phase = p.register(); + if (phase < 0) break; + check(phase > prevPhase); + prevPhase = phase; + equal(phase, p.arriveAndDeregister()); + check(phase < p.awaitAdvance(phase)); + } + if (System.nanoTime() - quittingTimeNanos > 0) { + count.getAndAdd(k * chunkSize); + break; + } + } + } + } + + void test(String[] args) throws Throwable { + final Phaser parent = new Phaser() { + protected boolean onAdvance(int phase, int parties) { + return false; + } + }; + + final Phaser child1 = new Phaser(parent); + final Phaser child2 = new Phaser(parent); + final Phaser subchild1 = new Phaser(child1); + final Phaser subchild2 = new Phaser(child2); + final Phaser[] phasers = { + parent, child1, child2, subchild1, subchild2 + }; + + int reps = 4; + ArrayList threads = new ArrayList(); + for (int j = 0; j < reps; ++j) { + threads.add(new Thread(new Runner(subchild1))); + threads.add(new Thread(new Runner(child1))); + threads.add(new Thread(new Runner(parent))); + threads.add(new Thread(new Runner(child2))); + threads.add(new Thread(new Runner(subchild2))); + } + + for (Thread thread : threads) + thread.start(); + + for (Thread thread : threads) + thread.join(); + + System.out.println("Parent: " + parent); + System.out.println("Child1: " + child1); + System.out.println("Child2: " + child2); + System.out.println("Subchild1: " + subchild1); + System.out.println("Subchild2: " + subchild2); + System.out.println("Iterations:" + count.get()); + + for (Phaser phaser : phasers) { + check(phaser.getPhase() > 0); + equal(0, phaser.getRegisteredParties()); + equal(0, phaser.getUnarrivedParties()); + equal(parent.getPhase(), phaser.getPhase()); + } + } + + //--------------------- Infrastructure --------------------------- + volatile int passed = 0, failed = 0; + void pass() {passed++;} + void fail() {failed++; Thread.dumpStack();} + void fail(String msg) {System.err.println(msg); fail();} + void unexpected(Throwable t) {failed++; t.printStackTrace();} + void check(boolean cond) {if (cond) pass(); else fail();} + void equal(Object x, Object y) { + if (x == null ? y == null : x.equals(y)) pass(); + else fail(x + " not equal to " + y);} + public static void main(String[] args) throws Throwable { + new FickleRegister(args).instanceMain(args);} + public void instanceMain(String[] args) throws Throwable { + try {test(args);} catch (Throwable t) {unexpected(t);} + System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); + if (failed > 0) throw new AssertionError("Some tests failed");} + + abstract class CheckedRunnable implements Runnable { + protected abstract void realRun() throws Throwable; + + public final void run() { + try {realRun();} catch (Throwable t) {unexpected(t);} + } + } +} diff --git a/jdk/test/java/util/concurrent/Phaser/PhaseOverflow.java b/jdk/test/java/util/concurrent/Phaser/PhaseOverflow.java new file mode 100644 index 00000000000..da8b5367072 --- /dev/null +++ b/jdk/test/java/util/concurrent/Phaser/PhaseOverflow.java @@ -0,0 +1,158 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * This file is available under and governed by the GNU General Public + * License version 2 only, as published by the Free Software Foundation. + * However, the following notice accompanied the original version of this + * file: + * + * Written by Martin Buchholz and Doug Lea with assistance from + * members of JCP JSR-166 Expert Group and released to the public + * domain, as explained at + * http://creativecommons.org/licenses/publicdomain + */ + +/* + * @test + * @summary Test Phaser phase integer overflow behavior + */ + +import java.util.concurrent.Phaser; +import java.lang.reflect.Field; + +public class PhaseOverflow { + Field stateField; + + void checkState(Phaser phaser, + int phase, int parties, int unarrived) { + equal(phase, phaser.getPhase()); + equal(parties, phaser.getRegisteredParties()); + equal(unarrived, phaser.getUnarrivedParties()); + } + + void test(String[] args) throws Throwable { + stateField = Phaser.class.getDeclaredField("state"); + stateField.setAccessible(true); + testLeaf(); + testTiered(); + } + + void testLeaf() throws Throwable { + Phaser phaser = new Phaser(); + // this is extremely dependent on internal representation + stateField.setLong(phaser, ((Integer.MAX_VALUE - 1L) << 32) | 1L); + checkState(phaser, Integer.MAX_VALUE - 1, 0, 0); + phaser.register(); + checkState(phaser, Integer.MAX_VALUE - 1, 1, 1); + phaser.arrive(); + checkState(phaser, Integer.MAX_VALUE, 1, 1); + phaser.arrive(); + checkState(phaser, 0, 1, 1); + phaser.arrive(); + checkState(phaser, 1, 1, 1); + } + + int phaseInc(int phase) { return (phase + 1) & Integer.MAX_VALUE; } + + void testTiered() throws Throwable { + Phaser root = new Phaser(); + // this is extremely dependent on internal representation + stateField.setLong(root, ((Integer.MAX_VALUE - 1L) << 32) | 1L); + checkState(root, Integer.MAX_VALUE - 1, 0, 0); + Phaser p1 = new Phaser(root, 1); + checkState(root, Integer.MAX_VALUE - 1, 1, 1); + checkState(p1, Integer.MAX_VALUE - 1, 1, 1); + Phaser p2 = new Phaser(root, 2); + checkState(root, Integer.MAX_VALUE - 1, 2, 2); + checkState(p2, Integer.MAX_VALUE - 1, 2, 2); + int ph = Integer.MAX_VALUE - 1; + for (int k = 0; k < 5; k++) { + checkState(root, ph, 2, 2); + checkState(p1, ph, 1, 1); + checkState(p2, ph, 2, 2); + p1.arrive(); + checkState(root, ph, 2, 1); + checkState(p1, ph, 1, 0); + checkState(p2, ph, 2, 2); + p2.arrive(); + checkState(root, ph, 2, 1); + checkState(p1, ph, 1, 0); + checkState(p2, ph, 2, 1); + p2.arrive(); + ph = phaseInc(ph); + checkState(root, ph, 2, 2); + checkState(p1, ph, 1, 1); + checkState(p2, ph, 2, 2); + } + equal(3, ph); + } + + void xtestTiered() throws Throwable { + Phaser root = new Phaser(); + stateField.setLong(root, ((Integer.MAX_VALUE - 1L) << 32) | 1L); + checkState(root, Integer.MAX_VALUE - 1, 0, 0); + Phaser p1 = new Phaser(root, 1); + checkState(root, Integer.MAX_VALUE - 1, 1, 1); + checkState(p1, Integer.MAX_VALUE - 1, 1, 1); + Phaser p2 = new Phaser(root, 2); + checkState(root, Integer.MAX_VALUE - 1, 2, 2); + checkState(p2, Integer.MAX_VALUE - 1, 2, 2); + int ph = Integer.MAX_VALUE - 1; + for (int k = 0; k < 5; k++) { + checkState(root, ph, 2, 2); + checkState(p1, ph, 1, 1); + checkState(p2, ph, 2, 2); + p1.arrive(); + checkState(root, ph, 2, 1); + checkState(p1, ph, 1, 0); + checkState(p2, ph, 2, 2); + p2.arrive(); + checkState(root, ph, 2, 1); + checkState(p1, ph, 1, 0); + checkState(p2, ph, 2, 1); + p2.arrive(); + ph = phaseInc(ph); + checkState(root, ph, 2, 2); + checkState(p1, ph, 1, 1); + checkState(p2, ph, 2, 2); + } + equal(3, ph); + } + + //--------------------- Infrastructure --------------------------- + volatile int passed = 0, failed = 0; + void pass() {passed++;} + void fail() {failed++; Thread.dumpStack();} + void fail(String msg) {System.err.println(msg); fail();} + void unexpected(Throwable t) {failed++; t.printStackTrace();} + void check(boolean cond) {if (cond) pass(); else fail();} + void equal(Object x, Object y) { + if (x == null ? y == null : x.equals(y)) pass(); + else fail(x + " not equal to " + y);} + public static void main(String[] args) throws Throwable { + new PhaseOverflow().instanceMain(args);} + public void instanceMain(String[] args) throws Throwable { + try {test(args);} catch (Throwable t) {unexpected(t);} + System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); + if (failed > 0) throw new AssertionError("Some tests failed");} +} diff --git a/jdk/test/java/util/concurrent/Phaser/TieredArriveLoops.java b/jdk/test/java/util/concurrent/Phaser/TieredArriveLoops.java new file mode 100644 index 00000000000..33a03f08dab --- /dev/null +++ b/jdk/test/java/util/concurrent/Phaser/TieredArriveLoops.java @@ -0,0 +1,117 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * This file is available under and governed by the GNU General Public + * License version 2 only, as published by the Free Software Foundation. + * However, the following notice accompanied the original version of this + * file: + * + * Written by Doug Lea with assistance from members of JCP JSR-166 + * Expert Group and released to the public domain, as explained at + * http://creativecommons.org/licenses/publicdomain + */ + +/* + * @test + * @summary stress test for arrivals in a tiered phaser + * @run main TieredArriveLoops 300 + */ +import java.util.*; +import java.util.concurrent.*; + +public class TieredArriveLoops { + final long testDurationMillisDefault = 10L * 1000L; + final long testDurationMillis; + final long quittingTimeNanos; + + TieredArriveLoops(String[] args) { + testDurationMillis = (args.length > 0) ? + Long.valueOf(args[0]) : testDurationMillisDefault; + quittingTimeNanos = System.nanoTime() + + testDurationMillis * 1000L * 1000L; + } + + Runnable runner(final Phaser p) { + return new CheckedRunnable() { public void realRun() { + int prevPhase = p.register(); + while (!p.isTerminated()) { + int phase = p.awaitAdvance(p.arrive()); + if (phase < 0) + return; + equal(phase, (prevPhase + 1) & Integer.MAX_VALUE); + int ph = p.getPhase(); + check(ph < 0 || ph == phase); + prevPhase = phase; + } + }}; + } + + void test(String[] args) throws Throwable { + final Phaser parent = new Phaser(); + final Phaser child1 = new Phaser(parent); + final Phaser child2 = new Phaser(parent); + + Thread t1 = new Thread(runner(child1)); + Thread t2 = new Thread(runner(child2)); + t1.start(); + t2.start(); + + for (int prevPhase = 0, phase; ; prevPhase = phase) { + phase = child2.getPhase(); + check(phase >= prevPhase); + if (System.nanoTime() - quittingTimeNanos > 0) { + System.err.printf("phase=%d%n", phase); + child1.forceTermination(); + break; + } + } + + t1.join(); + t2.join(); + } + + //--------------------- Infrastructure --------------------------- + volatile int passed = 0, failed = 0; + void pass() {passed++;} + void fail() {failed++; Thread.dumpStack();} + void fail(String msg) {System.err.println(msg); fail();} + void unexpected(Throwable t) {failed++; t.printStackTrace();} + void check(boolean cond) {if (cond) pass(); else fail();} + void equal(Object x, Object y) { + if (x == null ? y == null : x.equals(y)) pass(); + else fail(x + " not equal to " + y);} + public static void main(String[] args) throws Throwable { + new TieredArriveLoops(args).instanceMain(args);} + public void instanceMain(String[] args) throws Throwable { + try {test(args);} catch (Throwable t) {unexpected(t);} + System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); + if (failed > 0) throw new AssertionError("Some tests failed");} + + abstract class CheckedRunnable implements Runnable { + protected abstract void realRun() throws Throwable; + + public final void run() { + try {realRun();} catch (Throwable t) {unexpected(t);} + } + } +} diff --git a/jdk/test/java/util/concurrent/ScheduledThreadPoolExecutor/DelayOverflow.java b/jdk/test/java/util/concurrent/ScheduledThreadPoolExecutor/DelayOverflow.java index 2e0854b0fc7..bc34d00965f 100644 --- a/jdk/test/java/util/concurrent/ScheduledThreadPoolExecutor/DelayOverflow.java +++ b/jdk/test/java/util/concurrent/ScheduledThreadPoolExecutor/DelayOverflow.java @@ -161,11 +161,8 @@ public class DelayOverflow { if (x == null ? y == null : x.equals(y)) pass(); else fail(x + " not equal to " + y);} public static void main(String[] args) throws Throwable { - Class k = new Object(){}.getClass().getEnclosingClass(); - try {k.getMethod("instanceMain",String[].class) - .invoke( k.newInstance(), (Object) args);} - catch (Throwable e) {throw e.getCause();}} - public void instanceMain(String[] args) throws Throwable { + new DelayOverflow().instanceMain(args);} + void instanceMain(String[] args) throws Throwable { try {test(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} diff --git a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java index 40d11e04b31..aed43ac68a8 100644 --- a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java +++ b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,9 +36,9 @@ import java.util.concurrent.atomic.*; import static java.util.concurrent.TimeUnit.*; public class ConfigChanges { - final static ThreadGroup tg = new ThreadGroup("pool"); + static final ThreadGroup tg = new ThreadGroup("pool"); - final static Random rnd = new Random(); + static final Random rnd = new Random(); static void report(ThreadPoolExecutor tpe) { try { @@ -241,7 +241,7 @@ public class ConfigChanges { try {realMain(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} - private static abstract class Fun {abstract void f() throws Throwable;} + private abstract static class Fun {abstract void f() throws Throwable;} static void THROWS(Class k, Fun... fs) { for (Fun f : fs) try { f.f(); fail("Expected " + k.getName() + " not thrown"); } diff --git a/jdk/test/java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java b/jdk/test/java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java index 6bd37fe7035..547cd2130f0 100644 --- a/jdk/test/java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java +++ b/jdk/test/java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java @@ -31,47 +31,79 @@ import java.util.concurrent.*; public class CoreThreadTimeOut { - static volatile int passed = 0, failed = 0; - static void pass() { passed++; } - static void fail() { failed++; Thread.dumpStack(); } - static void unexpected(Throwable t) { failed++; t.printStackTrace(); } - static void check(boolean cond) { if (cond) pass(); else fail(); } - static void equal(Object x, Object y) { - if (x == null ? y == null : x.equals(y)) pass(); - else {System.out.println(x + " not equal to " + y); fail(); }} - static int countExecutorThreads() { + static class IdentifiableThreadFactory implements ThreadFactory { + static ThreadFactory defaultThreadFactory + = Executors.defaultThreadFactory(); + + public Thread newThread(Runnable r) { + Thread t = defaultThreadFactory.newThread(r); + t.setName("CoreThreadTimeOut-" + t.getName()); + return t; + } + } + + int countExecutorThreads() { Thread[] threads = new Thread[Thread.activeCount()+100]; Thread.enumerate(threads); int count = 0; for (Thread t : threads) - if (t != null && t.getName().matches("pool-[0-9]+-thread-[0-9]+")) + if (t != null && + t.getName().matches + ("CoreThreadTimeOut-pool-[0-9]+-thread-[0-9]+")) count++; return count; } - public static void main(String[] args) throws Throwable { + long millisElapsedSince(long t0) { + return (System.nanoTime() - t0) / (1000L * 1000L); + } + + void test(String[] args) throws Throwable { final int threadCount = 10; + final int timeoutMillis = 30; BlockingQueue q = new ArrayBlockingQueue(2*threadCount); ThreadPoolExecutor tpe = new ThreadPoolExecutor(threadCount, threadCount, - 30, TimeUnit.MILLISECONDS, - q); + timeoutMillis, TimeUnit.MILLISECONDS, + q, new IdentifiableThreadFactory()); equal(tpe.getCorePoolSize(), threadCount); check(! tpe.allowsCoreThreadTimeOut()); tpe.allowCoreThreadTimeOut(true); check(tpe.allowsCoreThreadTimeOut()); equal(countExecutorThreads(), 0); + long t0 = System.nanoTime(); for (int i = 0; i < threadCount; i++) tpe.submit(new Runnable() { public void run() {}}); - equal(countExecutorThreads(), threadCount); - Thread.sleep(500); + int count = countExecutorThreads(); + if (millisElapsedSince(t0) < timeoutMillis) + equal(count, threadCount); + while (countExecutorThreads() > 0 && + millisElapsedSince(t0) < 10 * 1000); equal(countExecutorThreads(), 0); tpe.shutdown(); check(tpe.allowsCoreThreadTimeOut()); + check(tpe.awaitTermination(10, TimeUnit.SECONDS)); System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new Exception("Some tests failed"); } + + //--------------------- Infrastructure --------------------------- + volatile int passed = 0, failed = 0; + void pass() {passed++;} + void fail() {failed++; Thread.dumpStack();} + void fail(String msg) {System.err.println(msg); fail();} + void unexpected(Throwable t) {failed++; t.printStackTrace();} + void check(boolean cond) {if (cond) pass(); else fail();} + void equal(Object x, Object y) { + if (x == null ? y == null : x.equals(y)) pass(); + else fail(x + " not equal to " + y);} + public static void main(String[] args) throws Throwable { + new CoreThreadTimeOut().instanceMain(args);} + public void instanceMain(String[] args) throws Throwable { + try {test(args);} catch (Throwable t) {unexpected(t);} + System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); + if (failed > 0) throw new AssertionError("Some tests failed");} } diff --git a/jdk/test/java/util/concurrent/ThreadPoolExecutor/Custom.java b/jdk/test/java/util/concurrent/ThreadPoolExecutor/Custom.java index 108ca7bd4fc..ac666b68951 100644 --- a/jdk/test/java/util/concurrent/ThreadPoolExecutor/Custom.java +++ b/jdk/test/java/util/concurrent/ThreadPoolExecutor/Custom.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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 Custom { private static class CustomTask extends FutureTask { - public final static AtomicInteger births = new AtomicInteger(0); + public static final AtomicInteger births = new AtomicInteger(0); CustomTask(Callable c) { super(c); births.getAndIncrement(); } CustomTask(Runnable r, V v) { super(r, v); births.getAndIncrement(); } } @@ -63,7 +63,7 @@ public class Custom { } private static class CustomSTPE extends ScheduledThreadPoolExecutor { - public final static AtomicInteger decorations = new AtomicInteger(0); + public static final AtomicInteger decorations = new AtomicInteger(0); CustomSTPE() { super(threadCount); } @@ -89,7 +89,7 @@ public class Custom { return count; } - private final static int threadCount = 10; + private static final int threadCount = 10; public static void main(String[] args) throws Throwable { CustomTPE tpe = new CustomTPE(); diff --git a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ScheduledTickleService.java b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ScheduledTickleService.java index 94c71e72605..9eeda4927d7 100644 --- a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ScheduledTickleService.java +++ b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ScheduledTickleService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +37,10 @@ public class ScheduledTickleService { // We get intermittent ClassCastException if greater than 1 // because of calls to compareTo - private final static int concurrency = 2; + private static final int concurrency = 2; // Record when tasks are done - public final static CountDownLatch done = new CountDownLatch(concurrency); + public static final CountDownLatch done = new CountDownLatch(concurrency); public static void realMain(String... args) throws InterruptedException { // our tickle service diff --git a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ShutdownNowExecuteRace.java b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ShutdownNowExecuteRace.java index b2a8313893c..dbf82f22ece 100644 --- a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ShutdownNowExecuteRace.java +++ b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ShutdownNowExecuteRace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ public class ShutdownNowExecuteRace { static volatile boolean quit = false; static volatile ThreadPoolExecutor pool = null; - final static Runnable sleeper = new Runnable() { public void run() { + static final Runnable sleeper = new Runnable() { public void run() { final long ONE_HOUR = 1000L * 60L * 60L; try { Thread.sleep(ONE_HOUR); } catch (InterruptedException ie) {} @@ -81,14 +81,14 @@ public class ShutdownNowExecuteRace { try {realMain(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} - private static abstract class Fun {abstract void f() throws Throwable;} + private abstract static class Fun {abstract void f() throws Throwable;} static void THROWS(Class k, Fun... fs) { for (Fun f : fs) try { f.f(); fail("Expected " + k.getName() + " not thrown"); } catch (Throwable t) { if (k.isAssignableFrom(t.getClass())) pass(); else unexpected(t);}} - private static abstract class CheckedThread extends Thread { + private abstract static class CheckedThread extends Thread { abstract void realRun() throws Throwable; public void run() { try {realRun();} catch (Throwable t) {unexpected(t);}}} diff --git a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java index 6ff46c95c6b..7699d180005 100644 --- a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java +++ b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +35,7 @@ import java.util.concurrent.*; import java.util.concurrent.atomic.*; public class ThrowingTasks { - final static Random rnd = new Random(); + static final Random rnd = new Random(); @SuppressWarnings("serial") static class UncaughtExceptions @@ -65,16 +65,16 @@ public class ThrowingTasks { } } - final static UncaughtExceptions uncaughtExceptions + static final UncaughtExceptions uncaughtExceptions = new UncaughtExceptions(); - final static UncaughtExceptionsTable uncaughtExceptionsTable + static final UncaughtExceptionsTable uncaughtExceptionsTable = new UncaughtExceptionsTable(); - final static AtomicLong totalUncaughtExceptions + static final AtomicLong totalUncaughtExceptions = new AtomicLong(0); - final static CountDownLatch uncaughtExceptionsLatch + static final CountDownLatch uncaughtExceptionsLatch = new CountDownLatch(24); - final static Thread.UncaughtExceptionHandler handler + static final Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler() { public void uncaughtException(Thread t, Throwable e) { check(! Thread.currentThread().isInterrupted()); @@ -84,19 +84,19 @@ public class ThrowingTasks { uncaughtExceptionsLatch.countDown(); }}; - final static ThreadGroup tg = new ThreadGroup("Flaky"); + static final ThreadGroup tg = new ThreadGroup("Flaky"); - final static ThreadFactory tf = new ThreadFactory() { + static final ThreadFactory tf = new ThreadFactory() { public Thread newThread(Runnable r) { Thread t = new Thread(tg, r); t.setUncaughtExceptionHandler(handler); return t; }}; - final static RuntimeException rte = new RuntimeException(); - final static Error error = new Error(); - final static Throwable weird = new Throwable(); - final static Exception checkedException = new Exception(); + static final RuntimeException rte = new RuntimeException(); + static final Error error = new Error(); + static final Throwable weird = new Throwable(); + static final Exception checkedException = new Exception(); static class Thrower implements Runnable { Throwable t; @@ -105,13 +105,13 @@ public class ThrowingTasks { public void run() { if (t != null) Thread.currentThread().stop(t); } } - final static Thrower noThrower = new Thrower(null); - final static Thrower rteThrower = new Thrower(rte); - final static Thrower errorThrower = new Thrower(error); - final static Thrower weirdThrower = new Thrower(weird); - final static Thrower checkedThrower = new Thrower(checkedException); + static final Thrower noThrower = new Thrower(null); + static final Thrower rteThrower = new Thrower(rte); + static final Thrower errorThrower = new Thrower(error); + static final Thrower weirdThrower = new Thrower(weird); + static final Thrower checkedThrower = new Thrower(checkedException); - final static List throwers = Arrays.asList( + static final List throwers = Arrays.asList( noThrower, rteThrower, errorThrower, weirdThrower, checkedThrower); static class Flaky implements Runnable { diff --git a/jdk/test/java/util/concurrent/atomic/VMSupportsCS8.java b/jdk/test/java/util/concurrent/atomic/VMSupportsCS8.java index 09c648c3fca..9bbce5d72eb 100644 --- a/jdk/test/java/util/concurrent/atomic/VMSupportsCS8.java +++ b/jdk/test/java/util/concurrent/atomic/VMSupportsCS8.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,8 @@ /* * @test * @bug 4992443 4994819 + * @compile -source 1.5 VMSupportsCS8.java + * @run main VMSupportsCS8 * @summary Checks that the value of VMSupportsCS8 matches system properties. */ diff --git a/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java b/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java index 5d4fc70460d..8422c33fa5c 100644 --- a/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java +++ b/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +75,10 @@ public class FlakyMutex implements Lock { catch (Throwable t) { checkThrowable(t); } } - try { check (! m.tryLock()); } + try { check(! m.tryLock()); } catch (Throwable t) { checkThrowable(t); } - try { check (! m.tryLock(1, TimeUnit.MICROSECONDS)); } + try { check(! m.tryLock(1, TimeUnit.MICROSECONDS)); } catch (Throwable t) { checkThrowable(t); } m.unlock(); diff --git a/jdk/test/java/util/concurrent/locks/Lock/TimedAcquireLeak.java b/jdk/test/java/util/concurrent/locks/Lock/TimedAcquireLeak.java index 5fd884ad33c..ad0af9e6780 100644 --- a/jdk/test/java/util/concurrent/locks/Lock/TimedAcquireLeak.java +++ b/jdk/test/java/util/concurrent/locks/Lock/TimedAcquireLeak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,7 +64,7 @@ public class TimedAcquireLeak { return outputOf(new InputStreamReader(is, "UTF-8")); } - final static ExecutorService drainers = Executors.newFixedThreadPool(12); + static final ExecutorService drainers = Executors.newFixedThreadPool(12); static Future futureOutputOf(final InputStream is) { return drainers.submit( new Callable() { public String call() throws IOException { diff --git a/jdk/test/java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java b/jdk/test/java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java index fc769df4092..3f7667c247a 100644 --- a/jdk/test/java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java +++ b/jdk/test/java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java @@ -34,7 +34,7 @@ /* * @test * @bug 4486658 - * @compile CancelledLockLoops.java + * @compile -source 1.5 CancelledLockLoops.java * @run main/timeout=2800 CancelledLockLoops * @summary tests lockInterruptibly. * Checks for responsiveness of locks to interrupts. Runs under that @@ -64,7 +64,7 @@ public final class CancelledLockLoops { try { new ReentrantLockLoop(i).test(); } - catch(BrokenBarrierException bb) { + catch (BrokenBarrierException bb) { // OK, ignore } Thread.sleep(TIMEOUT); diff --git a/jdk/test/java/util/concurrent/locks/ReentrantLock/LockOncePerThreadLoops.java b/jdk/test/java/util/concurrent/locks/ReentrantLock/LockOncePerThreadLoops.java index 88b2f2d00b1..8682e24dbab 100644 --- a/jdk/test/java/util/concurrent/locks/ReentrantLock/LockOncePerThreadLoops.java +++ b/jdk/test/java/util/concurrent/locks/ReentrantLock/LockOncePerThreadLoops.java @@ -34,7 +34,7 @@ /* * @test * @bug 4486658 - * @compile LockOncePerThreadLoops.java + * @compile -source 1.5 LockOncePerThreadLoops.java * @run main/timeout=15000 LockOncePerThreadLoops * @summary Checks for missed signals by locking and unlocking each of an array of locks once per thread */ diff --git a/jdk/test/java/util/concurrent/locks/ReentrantLock/LoopHelpers.java b/jdk/test/java/util/concurrent/locks/ReentrantLock/LoopHelpers.java index d3dd5b4a5ef..6b65b8b2d4a 100644 --- a/jdk/test/java/util/concurrent/locks/ReentrantLock/LoopHelpers.java +++ b/jdk/test/java/util/concurrent/locks/ReentrantLock/LoopHelpers.java @@ -78,9 +78,9 @@ class LoopHelpers { * Basically same as java.util.Random. */ public static class SimpleRandom { - private final static long multiplier = 0x5DEECE66DL; - private final static long addend = 0xBL; - private final static long mask = (1L << 48) - 1; + private static final long multiplier = 0x5DEECE66DL; + private static final long addend = 0xBL; + private static final long mask = (1L << 48) - 1; static final AtomicLong seq = new AtomicLong(1); private long seed = System.nanoTime() + seq.getAndIncrement(); diff --git a/jdk/test/java/util/concurrent/locks/ReentrantLock/SimpleReentrantLockLoops.java b/jdk/test/java/util/concurrent/locks/ReentrantLock/SimpleReentrantLockLoops.java index ac85bba4c3f..db7d5af61dc 100644 --- a/jdk/test/java/util/concurrent/locks/ReentrantLock/SimpleReentrantLockLoops.java +++ b/jdk/test/java/util/concurrent/locks/ReentrantLock/SimpleReentrantLockLoops.java @@ -34,7 +34,7 @@ /* * @test * @bug 4486658 - * @compile SimpleReentrantLockLoops.java + * @compile -source 1.5 SimpleReentrantLockLoops.java * @run main/timeout=4500 SimpleReentrantLockLoops * @summary multiple threads using a single lock */ diff --git a/jdk/test/java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java b/jdk/test/java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java index 0a90bebc352..3c20867531a 100644 --- a/jdk/test/java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java +++ b/jdk/test/java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java @@ -34,6 +34,8 @@ /* * @test * @bug 4486658 5031862 + * @compile -source 1.5 TimeoutLockLoops.java + * @run main TimeoutLockLoops * @summary Checks for responsiveness of locks to timeouts. * Runs under the assumption that ITERS computations require more than * TIMEOUT msecs to complete, which seems to be a safe assumption for diff --git a/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/Bug6571733.java b/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/Bug6571733.java index c63e7a30c77..92714ba3604 100644 --- a/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/Bug6571733.java +++ b/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/Bug6571733.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +45,7 @@ public class Bug6571733 { Thread thread = new Thread() { public void run() { try { - check (! lock.writeLock().tryLock(0, TimeUnit.DAYS)); + check(! lock.writeLock().tryLock(0, TimeUnit.DAYS)); lock.readLock().lock(); lock.readLock().unlock(); diff --git a/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/LoopHelpers.java b/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/LoopHelpers.java index d3dd5b4a5ef..6b65b8b2d4a 100644 --- a/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/LoopHelpers.java +++ b/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/LoopHelpers.java @@ -78,9 +78,9 @@ class LoopHelpers { * Basically same as java.util.Random. */ public static class SimpleRandom { - private final static long multiplier = 0x5DEECE66DL; - private final static long addend = 0xBL; - private final static long mask = (1L << 48) - 1; + private static final long multiplier = 0x5DEECE66DL; + private static final long addend = 0xBL; + private static final long mask = (1L << 48) - 1; static final AtomicLong seq = new AtomicLong(1); private long seed = System.nanoTime() + seq.getAndIncrement(); diff --git a/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/MapLoops.java b/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/MapLoops.java index ce6651fbb2d..a8e47e5a25e 100644 --- a/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/MapLoops.java +++ b/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/MapLoops.java @@ -34,7 +34,7 @@ /* * @test * @bug 4486658 - * @compile MapLoops.java + * @compile -source 1.5 MapLoops.java * @run main/timeout=4700 MapLoops * @summary Exercise multithreaded maps, by default ConcurrentHashMap. * Multithreaded hash table test. Each thread does a random walk @@ -65,7 +65,7 @@ public class MapLoops { if (args.length > 0) { try { mapClass = Class.forName(args[0]); - } catch(ClassNotFoundException e) { + } catch (ClassNotFoundException e) { throw new RuntimeException("Class " + args[0] + " not found."); } } diff --git a/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/RWMap.java b/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/RWMap.java index 8c5121e536a..53f63d6e33c 100644 --- a/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/RWMap.java +++ b/jdk/test/java/util/concurrent/locks/ReentrantReadWriteLock/RWMap.java @@ -57,21 +57,33 @@ public class RWMap implements Map { } public int size() { - rwl.readLock().lock(); try {return m.size();} finally { rwl.readLock().unlock(); } + rwl.readLock().lock(); + try { return m.size(); } + finally { rwl.readLock().unlock(); } } - public boolean isEmpty(){ - rwl.readLock().lock(); try {return m.isEmpty();} finally { rwl.readLock().unlock(); } + + public boolean isEmpty() { + rwl.readLock().lock(); + try { return m.isEmpty(); } + finally { rwl.readLock().unlock(); } } public Object get(Object key) { - rwl.readLock().lock(); try {return m.get(key);} finally { rwl.readLock().unlock(); } + rwl.readLock().lock(); + try { return m.get(key); } + finally { rwl.readLock().unlock(); } } public boolean containsKey(Object key) { - rwl.readLock().lock(); try {return m.containsKey(key);} finally { rwl.readLock().unlock(); } + rwl.readLock().lock(); + try { return m.containsKey(key); } + finally { rwl.readLock().unlock(); } } - public boolean containsValue(Object value){ - rwl.readLock().lock(); try {return m.containsValue(value);} finally { rwl.readLock().unlock(); } + + public boolean containsValue(Object value) { + rwl.readLock().lock(); + try { return m.containsValue(value); } + finally { rwl.readLock().unlock(); } } @@ -88,28 +100,45 @@ public class RWMap implements Map { } public boolean equals(Object o) { - rwl.readLock().lock(); try {return m.equals(o);} finally { rwl.readLock().unlock(); } + rwl.readLock().lock(); + try { return m.equals(o); } + finally { rwl.readLock().unlock(); } } + public int hashCode() { - rwl.readLock().lock(); try {return m.hashCode();} finally { rwl.readLock().unlock(); } + rwl.readLock().lock(); + try { return m.hashCode(); } + finally { rwl.readLock().unlock(); } } + public String toString() { - rwl.readLock().lock(); try {return m.toString();} finally { rwl.readLock().unlock(); } + rwl.readLock().lock(); + try { return m.toString(); } + finally { rwl.readLock().unlock(); } } - - public Object put(Object key, Object value) { - rwl.writeLock().lock(); try {return m.put(key, value);} finally { rwl.writeLock().unlock(); } + rwl.writeLock().lock(); + try { return m.put(key, value); } + finally { rwl.writeLock().unlock(); } } + public Object remove(Object key) { - rwl.writeLock().lock(); try {return m.remove(key);} finally { rwl.writeLock().unlock(); } + rwl.writeLock().lock(); + try { return m.remove(key); } + finally { rwl.writeLock().unlock(); } } + public void putAll(Map map) { - rwl.writeLock().lock(); try {m.putAll(map);} finally { rwl.writeLock().unlock(); } + rwl.writeLock().lock(); + try { m.putAll(map); } + finally { rwl.writeLock().unlock(); } } + public void clear() { - rwl.writeLock().lock(); try {m.clear();} finally { rwl.writeLock().unlock(); } + rwl.writeLock().lock(); + try { m.clear(); } + finally { rwl.writeLock().unlock(); } } } diff --git a/jdk/test/java/util/jar/JarInputStream/BadSignedJar.jar b/jdk/test/java/util/jar/JarInputStream/BadSignedJar.jar new file mode 100644 index 00000000000..651c9ff3dd0 Binary files /dev/null and b/jdk/test/java/util/jar/JarInputStream/BadSignedJar.jar differ diff --git a/jdk/test/java/util/jar/JarInputStream/TestIndexedJarWithBadSignature.java b/jdk/test/java/util/jar/JarInputStream/TestIndexedJarWithBadSignature.java new file mode 100644 index 00000000000..977c10121da --- /dev/null +++ b/jdk/test/java/util/jar/JarInputStream/TestIndexedJarWithBadSignature.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6544278 + * @summary Confirm the JarInputStream throws the SecurityException when + * verifying an indexed jar file with corrupted signature + */ + +import java.io.IOException; +import java.io.FileInputStream; +import java.util.jar.JarEntry; +import java.util.jar.JarInputStream; + +public class TestIndexedJarWithBadSignature { + + public static void main(String...args) throws Throwable { + try (JarInputStream jis = new JarInputStream( + new FileInputStream(System.getProperty("tst.src", ".") + + System.getProperty("file.separator") + + "BadSignedJar.jar"))) + { + JarEntry je1 = jis.getNextJarEntry(); + while(je1!=null){ + System.out.println("Jar Entry1==>"+je1.getName()); + je1 = jis.getNextJarEntry(); // This should throw Security Exception + } + throw new RuntimeException( + "Test Failed:Security Exception not being thrown"); + } catch (IOException ie){ + ie.printStackTrace(); + } catch (SecurityException e) { + System.out.println("Test passed: Security Exception thrown as expected"); + } + } +} diff --git a/jdk/test/java/util/logging/ClassLoaderLeakTest.java b/jdk/test/java/util/logging/ClassLoaderLeakTest.java index 30e6552d2ab..bc29876510d 100644 --- a/jdk/test/java/util/logging/ClassLoaderLeakTest.java +++ b/jdk/test/java/util/logging/ClassLoaderLeakTest.java @@ -89,7 +89,7 @@ public class ClassLoaderLeakTest { MyClassLoader appClassLoader = new MyClassLoader(urls, "test0"); WeakReference ref = - new WeakReference(appClassLoader); + new WeakReference<>(appClassLoader); Thread appThread = new Thread(appsThreadGroup, launcher, "AppThread-0"); diff --git a/jdk/test/java/util/regex/RegExTest.java b/jdk/test/java/util/regex/RegExTest.java index 70b7aa668a5..0e8470c4c11 100644 --- a/jdk/test/java/util/regex/RegExTest.java +++ b/jdk/test/java/util/regex/RegExTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/zip/ZipFile/FinalizeInflater.java b/jdk/test/java/util/zip/ZipFile/FinalizeInflater.java new file mode 100644 index 00000000000..e80fd749076 --- /dev/null +++ b/jdk/test/java/util/zip/ZipFile/FinalizeInflater.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 7003462 + @summary Make sure cached Inflater does not get finalized. + */ + +import java.io.File; +import java.io.InputStream; +import java.io.IOException; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +public class FinalizeInflater { + + public static void main(String[] args) throws Throwable { + try (ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."), "input.zip"))) + { + ZipEntry ze = zf.getEntry("ReadZip.java"); + read(zf.getInputStream(ze)); + System.gc(); + System.runFinalization(); + System.gc(); + // read again + read(zf.getInputStream(ze)); + } + } + + private static void read(InputStream is) + throws IOException + { + Wrapper wrapper = new Wrapper(is); + byte[] buffer = new byte[32]; + try { + while(is.read(buffer)>0){} + } catch (IOException ioe) { + ioe.printStackTrace(); + } + } + + static class Wrapper{ + InputStream is; + public Wrapper(InputStream is) { + this.is = is; + } + + @Override + protected void finalize() throws Throwable { + super.finalize(); + is.close(); + } + } +} diff --git a/jdk/test/java/util/zip/ZipFile/FinalizeZipFile.java b/jdk/test/java/util/zip/ZipFile/FinalizeZipFile.java new file mode 100644 index 00000000000..ab89803e5a4 --- /dev/null +++ b/jdk/test/java/util/zip/ZipFile/FinalizeZipFile.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 7007609 7009618 + * @summary Check that ZipFile objects are always collected + */ + +import java.io.*; +import java.nio.*; +import java.util.Random; +import java.util.zip.*; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +public class FinalizeZipFile { + + private final static CountDownLatch finalizersDone = new CountDownLatch(3); + + private static class InstrumentedZipFile extends ZipFile { + + public InstrumentedZipFile(File f) throws Exception { + super(f); + System.out.printf("Using %s%n", f.getPath()); + } + protected void finalize() throws IOException { + System.out.printf("Killing %s%n", getName()); + super.finalize(); + finalizersDone.countDown(); + } + } + + private static void makeGarbage() throws Throwable { + final Random rnd = new Random(); + final String javaHome = System.getProperty("java.home"); + // Create some ZipFiles. + // Find some .jar files in JDK's lib directory. + final File lib = new File(javaHome, "lib"); + check(lib.isDirectory()); + final File[] jars = lib.listFiles( + new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.endsWith(".jar");}}); + check(jars.length > 1); + + new InstrumentedZipFile(jars[rnd.nextInt(jars.length)]).close(); + new InstrumentedZipFile(jars[rnd.nextInt(jars.length)]).close(); + + // Create a ZipFile and get an input stream from it + ZipFile zf = new InstrumentedZipFile(jars[rnd.nextInt(jars.length)]); + ZipEntry ze = zf.getEntry("META-INF/MANIFEST.MF"); + InputStream is = zf.getInputStream(ze); + } + + public static void realMain(String[] args) throws Throwable { + makeGarbage(); + + System.gc(); + finalizersDone.await(5, TimeUnit.SECONDS); + + // Not all ZipFiles were collected? + equal(finalizersDone.getCount(), 0L); + } + + //--------------------- Infrastructure --------------------------- + static volatile int passed = 0, failed = 0; + static void pass() {passed++;} + static void fail() {failed++; Thread.dumpStack();} + static void fail(String msg) {System.out.println(msg); fail();} + static void unexpected(Throwable t) {failed++; t.printStackTrace();} + static void check(boolean cond) {if (cond) pass(); else fail();} + static void equal(Object x, Object y) { + if (x == null ? y == null : x.equals(y)) pass(); + else fail(x + " not equal to " + y);} + public static void main(String[] args) throws Throwable { + try {realMain(args);} catch (Throwable t) {unexpected(t);} + System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); + if (failed > 0) throw new AssertionError("Some tests failed");} +} + diff --git a/jdk/test/java/util/zip/ZipFile/ReadZip.java b/jdk/test/java/util/zip/ZipFile/ReadZip.java index 0eb1162dc79..9f525c87600 100644 --- a/jdk/test/java/util/zip/ZipFile/ReadZip.java +++ b/jdk/test/java/util/zip/ZipFile/ReadZip.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/accessibility/6986385/bug6986385.java b/jdk/test/javax/accessibility/6986385/bug6986385.java new file mode 100644 index 00000000000..8ad6078f7b1 --- /dev/null +++ b/jdk/test/javax/accessibility/6986385/bug6986385.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 6986385 + @summary JLayer should implement accessible interface + @author Alexander Potochkin + @run main bug6986385 +*/ + +import javax.swing.*; +import javax.accessibility.AccessibleContext; +import javax.accessibility.AccessibleRole; + +public class bug6986385 { + + public static void main(String... args) throws Exception { + JLayer l = new JLayer(); + AccessibleContext acc = l.getAccessibleContext(); + if (acc == null) { + throw new RuntimeException("JLayer's AccessibleContext is null"); + } + if (acc.getAccessibleRole() != AccessibleRole.PANEL) { + throw new RuntimeException("JLayer's AccessibleRole must be PANEL"); + } + } +} diff --git a/jdk/test/javax/imageio/CachePremissionsTest/CachePermissionsTest.java b/jdk/test/javax/imageio/CachePremissionsTest/CachePermissionsTest.java index a76561c2f45..c101f9d1780 100644 --- a/jdk/test/javax/imageio/CachePremissionsTest/CachePermissionsTest.java +++ b/jdk/test/javax/imageio/CachePremissionsTest/CachePermissionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/remote/mandatory/connection/RMIConnector_NPETest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java new file mode 100644 index 00000000000..91ec8fa7c46 --- /dev/null +++ b/jdk/test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary NPE IN RMIConnector.connect + * @bug 6984520 + * @run clean RMIConnector_NPETest + * @run build RMIConnector_NPETest + * @run main RMIConnector_NPETest + */ + +import java.io.*; +import java.lang.management.*; +import java.rmi.registry.*; +import javax.management.*; +import javax.management.remote.*; +import javax.management.remote.rmi.*; + +public class RMIConnector_NPETest { + + public static void main(String argv[]) throws Exception { + boolean testFailed = false; + String rmidCmd = System.getProperty("java.home") + File.separator + + "bin" + File.separator + "rmid -port 3333"; + String stopRmidCmd = System.getProperty("java.home") + File.separator + + "bin" + File.separator + "rmid -stop -port 3333"; + try { + //start an rmid daemon and give it some time + System.out.println("Starting rmid"); + Runtime.getRuntime().exec(rmidCmd); + Thread.sleep(5000); + + MBeanServer mbs = MBeanServerFactory.createMBeanServer(); + RMIJRMPServerImpl rmiserver = new RMIJRMPServerImpl(3333, null, null, null); + rmiserver.setMBeanServer(mbs); + RMIConnector agent = new RMIConnector(rmiserver, null); + agent.connect(); + } catch(NullPointerException npe) { + npe.printStackTrace(); + testFailed = true; + } catch (Exception e) { + // OK + } finally { + System.out.println("Stopping rmid"); + Runtime.getRuntime().exec(stopRmidCmd); + } + + if(testFailed) + throw new Exception("Test failed"); + + } +} diff --git a/jdk/test/javax/management/remote/mandatory/notif/DeadListenerTest.java b/jdk/test/javax/management/remote/mandatory/notif/DeadListenerTest.java new file mode 100644 index 00000000000..d5fd91e527f --- /dev/null +++ b/jdk/test/javax/management/remote/mandatory/notif/DeadListenerTest.java @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6957378 + * @summary Test that a listener can be removed remotely from an MBean that no longer exists. + * @author Eamonn McManus + */ + +import com.sun.jmx.remote.internal.ServerNotifForwarder; +import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; +import javax.management.ListenerNotFoundException; +import javax.management.MBeanServer; +import javax.management.MBeanServerConnection; +import javax.management.MBeanServerDelegate; +import javax.management.Notification; +import javax.management.NotificationBroadcasterSupport; +import javax.management.NotificationFilterSupport; +import javax.management.NotificationListener; +import javax.management.ObjectName; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; +import javax.management.remote.rmi.RMIConnection; +import javax.management.remote.rmi.RMIConnectionImpl; +import javax.management.remote.rmi.RMIConnectorServer; +import javax.management.remote.rmi.RMIJRMPServerImpl; +import javax.security.auth.Subject; + +public class DeadListenerTest { + public static void main(String[] args) throws Exception { + final ObjectName delegateName = MBeanServerDelegate.DELEGATE_NAME; + + MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + Noddy mbean = new Noddy(); + ObjectName name = new ObjectName("d:k=v"); + mbs.registerMBean(mbean, name); + + JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///"); + SnoopRMIServerImpl rmiServer = new SnoopRMIServerImpl(); + RMIConnectorServer cs = new RMIConnectorServer(url, null, rmiServer, mbs); + cs.start(); + JMXServiceURL addr = cs.getAddress(); + assertTrue("No connections in new connector server", rmiServer.connections.isEmpty()); + + JMXConnector cc = JMXConnectorFactory.connect(addr); + MBeanServerConnection mbsc = cc.getMBeanServerConnection(); + assertTrue("One connection on server after client connect", rmiServer.connections.size() == 1); + RMIConnectionImpl connection = rmiServer.connections.get(0); + Method getServerNotifFwdM = RMIConnectionImpl.class.getDeclaredMethod("getServerNotifFwd"); + getServerNotifFwdM.setAccessible(true); + ServerNotifForwarder serverNotifForwarder = (ServerNotifForwarder) getServerNotifFwdM.invoke(connection); + Field listenerMapF = ServerNotifForwarder.class.getDeclaredField("listenerMap"); + listenerMapF.setAccessible(true); + @SuppressWarnings("unchecked") + Map> listenerMap = (Map>) listenerMapF.get(serverNotifForwarder); + assertTrue("Server listenerMap initially empty", mapWithoutKey(listenerMap, delegateName).isEmpty()); + + CountListener count1 = new CountListener(); + mbsc.addNotificationListener(name, count1, null, null); + + CountListener count2 = new CountListener(); + NotificationFilterSupport dummyFilter = new NotificationFilterSupport(); + dummyFilter.enableType(""); + mbsc.addNotificationListener(name, count2, dummyFilter, "noddy"); + + assertTrue("One entry in listenerMap for two listeners on same MBean", mapWithoutKey(listenerMap, delegateName).size() == 1); + Set set = listenerMap.get(name); + assertTrue("Set in listenerMap for MBean has two elements", set != null && set.size() == 2); + + assertTrue("Initial value of count1 == 0", count1.count() == 0); + assertTrue("Initial value of count2 == 0", count2.count() == 0); + + Notification notif = new Notification("type", name, 0); + + mbean.sendNotification(notif); + + // Make sure notifs are working normally. + long deadline = System.currentTimeMillis() + 2000; + while ((count1.count() != 1 || count2.count() != 1) && System.currentTimeMillis() < deadline) { + Thread.sleep(10); + } + assertTrue("New value of count1 == 1", count1.count() == 1); + assertTrue("Initial value of count2 == 1", count2.count() == 1); + + // Make sure that removing a nonexistent listener from an existent MBean produces ListenerNotFoundException + CountListener count3 = new CountListener(); + try { + mbsc.removeNotificationListener(name, count3); + assertTrue("Remove of nonexistent listener succeeded but should not have", false); + } catch (ListenerNotFoundException e) { + // OK: expected + } + + // Make sure that removing a nonexistent listener from a nonexistent MBean produces ListenerNotFoundException + ObjectName nonexistent = new ObjectName("foo:bar=baz"); + assertTrue("Nonexistent is nonexistent", !mbs.isRegistered(nonexistent)); + try { + mbsc.removeNotificationListener(nonexistent, count3); + assertTrue("Remove of listener from nonexistent MBean succeeded but should not have", false); + } catch (ListenerNotFoundException e) { + // OK: expected + } + + // Now unregister our MBean, and check that notifs it sends no longer go anywhere. + mbs.unregisterMBean(name); + mbean.sendNotification(notif); + Thread.sleep(200); + assertTrue("New value of count1 == 1", count1.count() == 1); + assertTrue("Initial value of count2 == 1", count2.count() == 1); + + // Check that there is no trace of the listeners any more in ServerNotifForwarder.listenerMap. + // THIS DEPENDS ON JMX IMPLEMENTATION DETAILS. + // If the JMX implementation changes, the code here may have to change too. + Set setForUnreg = listenerMap.get(name); + assertTrue("No trace of unregistered MBean: " + setForUnreg, setForUnreg == null); + + // Remove attempts should fail. + try { + mbsc.removeNotificationListener(name, count1); + assertTrue("Remove of count1 listener should have failed", false); + } catch (ListenerNotFoundException e) { + // OK: expected + } + try { + mbsc.removeNotificationListener(name, count2, dummyFilter, "noddy"); + assertTrue("Remove of count2 listener should have failed", false); + } catch (ListenerNotFoundException e) { + // OK: expected + } + } + + private static Map mapWithoutKey(Map map, K key) { + Map copy = new HashMap(map); + copy.remove(key); + return copy; + } + + public static interface NoddyMBean {} + + public static class Noddy extends NotificationBroadcasterSupport implements NoddyMBean {} + + public static class CountListener implements NotificationListener { + final AtomicInteger count; + + public CountListener() { + this.count = new AtomicInteger(); + } + + int count() { + return count.get(); + } + + public void handleNotification(Notification notification, Object handback) { + count.incrementAndGet(); + } + } + + private static void assertTrue(String what, boolean cond) { + if (!cond) { + throw new AssertionError("Assertion failed: " + what); + } + } + + private static class SnoopRMIServerImpl extends RMIJRMPServerImpl { + final List connections = new ArrayList(); + SnoopRMIServerImpl() throws IOException { + super(0, null, null, null); + } + + @Override + protected RMIConnection makeClient(String id, Subject subject) throws IOException { + RMIConnectionImpl conn = (RMIConnectionImpl) super.makeClient(id, subject); + connections.add(conn); + return conn; + } + } +} diff --git a/jdk/test/javax/print/attribute/ServiceDialogTest.java b/jdk/test/javax/print/attribute/ServiceDialogTest.java index 98d268cd589..e5b6d2d969b 100644 --- a/jdk/test/javax/print/attribute/ServiceDialogTest.java +++ b/jdk/test/javax/print/attribute/ServiceDialogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/print/attribute/SidesPageRangesTest.java b/jdk/test/javax/print/attribute/SidesPageRangesTest.java index d946d3b2bf8..a5092cdfdea 100644 --- a/jdk/test/javax/print/attribute/SidesPageRangesTest.java +++ b/jdk/test/javax/print/attribute/SidesPageRangesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/script/CauseExceptionTest.java b/jdk/test/javax/script/CauseExceptionTest.java new file mode 100644 index 00000000000..535717609e9 --- /dev/null +++ b/jdk/test/javax/script/CauseExceptionTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6869617 + * @summary RhinoScriptEngine bug : ScriptException cause not set (with fix) + */ + +import javax.script.*; +import java.io.*; + +public class CauseExceptionTest { + public static void main(String[] args) throws ScriptException, NoSuchMethodException { + ScriptEngineManager sem = new ScriptEngineManager(); + ScriptEngine engine = sem.getEngineByName("js"); + engine.eval("function hello_world() { println('hello world'); throw 'out of here'; } "); + Invocable invocable = (Invocable) engine; + try { + invocable.invokeFunction("hello_world", (Object[])null); + } catch (ScriptException se) { + Throwable cause = se.getCause(); + if (cause == null) { + throw new RuntimeException("null cause"); + } + System.out.println(cause); + } + } +}; diff --git a/jdk/test/javax/script/E4XErrorTest.java b/jdk/test/javax/script/E4XErrorTest.java deleted file mode 100644 index 97eb7aabd7e..00000000000 --- a/jdk/test/javax/script/E4XErrorTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6346734 6705893 - * @summary We do *not* support E4X (ECMAScript for XML) in our - * implementation. We want to throw error on XML literals - * as early as possible rather than at "runtime" - i.e., when - * engine looks for "XML" constructor. - */ - -import javax.script.*; -import java.util.Locale; - -public class E4XErrorTest { - - public static void main(String[] args) throws Exception { - ScriptEngineManager manager = new ScriptEngineManager(); - ScriptEngine jsengine = Helper.getJsEngine(manager); - if (jsengine == null) { - System.out.println("Warning: No js engine found; test vacuously passes."); - return; - } - - // The test below depends on the error message content - // that is loaded from resource bundles. So, we force - // English Locale to compare correct value.. - Locale.setDefault(Locale.US); - - try { - jsengine.eval("var v = ;"); - } catch (ScriptException se) { - String msg = se.getMessage(); - if (msg.indexOf("syntax error") == -1) { - throw new RuntimeException("syntax error expected, got " + - msg); - } - return; - } - // should not reach here.. exception should have been thrown. - throw new RuntimeException("Huh! E4X is supported??"); - } -} diff --git a/jdk/test/javax/script/ProviderTest.sh b/jdk/test/javax/script/ProviderTest.sh index f11cb5efbd7..5221d00d5fd 100644 --- a/jdk/test/javax/script/ProviderTest.sh +++ b/jdk/test/javax/script/ProviderTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javap/typeAnnotations/T6855990.java b/jdk/test/javax/script/StringWriterPrintTest.java similarity index 59% rename from langtools/test/tools/javap/typeAnnotations/T6855990.java rename to jdk/test/javax/script/StringWriterPrintTest.java index 66ffb67110e..65b401ce637 100644 --- a/langtools/test/tools/javap/typeAnnotations/T6855990.java +++ b/jdk/test/javax/script/StringWriterPrintTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,31 +21,24 @@ * questions. */ -import java.io.*; - /* * @test - * @bug 6855990 - * @summary InstructionDetailWriter should support new 308 annotations attribute + * @bug 6759414 + * @summary javascript engine can not write to StringWriter. */ -public class T6855990 { - public static void main(String[] args) throws Exception { - new T6855990().run(); - } +import javax.script.*; +import java.io.*; - public void run() throws Exception { - @Simple String[] args = { "-c", "-XDdetails:typeAnnotations", "T6855990" }; +public class StringWriterPrintTest { + public static void main(String[] args) throws ScriptException { + ScriptEngineManager sem = new ScriptEngineManager(); + ScriptEngine engine = sem.getEngineByName("js"); StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - int rc = com.sun.tools.javap.Main.run(args, pw); - pw.close(); - String out = sw.toString(); - System.out.println(out); - if (out.indexOf("@Simple: LOCAL_VARIABLE") == -1) - throw new Exception("expected output not found"); + engine.eval("print(\"hello world 1\\n\")"); + engine.getContext().setWriter(sw); + // the following "print" call throws exception + engine.eval("print(\"hello world 2\\n\")"); + System.out.println(sw.toString()); } -} - -@interface Simple { } - +}; diff --git a/langtools/test/tools/javac/typeAnnotations/MultipleTargets.java b/jdk/test/javax/script/UnescapedBracketRegExTest.java similarity index 65% rename from langtools/test/tools/javac/typeAnnotations/MultipleTargets.java rename to jdk/test/javax/script/UnescapedBracketRegExTest.java index c0982c10bd6..d444ec74aaa 100644 --- a/langtools/test/tools/javac/typeAnnotations/MultipleTargets.java +++ b/jdk/test/javax/script/UnescapedBracketRegExTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * 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,19 +23,18 @@ /* * @test - * @bug 6843077 - * @summary check that type annotations may appear on void method if it is a - * method annotation too. - * @author Mahmood Ali - * @compile -source 1.7 MultipleTargets.java + * @bug 7012701 + * @summary 7012701 Add a test to check that Rhino's RegExp parser accepts unescaped '[' */ -import java.lang.annotation.Target; -import java.lang.annotation.ElementType; +import javax.script.*; +import java.io.*; -class TypeUseTarget { - @A void voidMethod() { } -} - -@Target({ElementType.TYPE_USE, ElementType.METHOD}) -@interface A { } +public class UnescapedBracketRegExTest { + public static void main(String[] args) throws ScriptException { + ScriptEngineManager sem = new ScriptEngineManager(); + ScriptEngine engine = sem.getEngineByName("js"); + // the following throws exception + engine.eval("var x = /[a-zA-Z+/=]/;"); + } +}; diff --git a/jdk/test/javax/script/VersionTest.java b/jdk/test/javax/script/VersionTest.java index 13ed9c05115..ff28c2c2e17 100644 --- a/jdk/test/javax/script/VersionTest.java +++ b/jdk/test/javax/script/VersionTest.java @@ -32,8 +32,8 @@ import java.io.*; public class VersionTest { - private static final String JS_LANG_VERSION = "1.6"; - private static final String JS_ENGINE_VERSION = "1.6 release 2"; + private static final String JS_LANG_VERSION = "1.8"; + private static final String JS_ENGINE_VERSION = "1.7 release 3 PRERELEASE"; public static void main(String[] args) throws Exception { ScriptEngineManager manager = new ScriptEngineManager(); diff --git a/jdk/test/javax/sound/midi/Gervill/AudioFloatConverter/ToFloatArray.java b/jdk/test/javax/sound/midi/Gervill/AudioFloatConverter/ToFloatArray.java index 639b9db34e9..62bf3677ded 100644 --- a/jdk/test/javax/sound/midi/Gervill/AudioFloatConverter/ToFloatArray.java +++ b/jdk/test/javax/sound/midi/Gervill/AudioFloatConverter/ToFloatArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ public class ToFloatArray { for (int big = 0; big < 2; big+=1) for (int bits = 32; bits <= 64; bits+=32) { AudioFormat frm = new AudioFormat( - AudioFloatConverter.PCM_FLOAT, + AudioFormat.Encoding.PCM_FLOAT, 44100, bits, 1, bits/8, 44100, big==1); byte[] buff = new byte[testarray.length * frm.getFrameSize()]; diff --git a/jdk/test/javax/sound/midi/Gervill/SoftAudioSynthesizer/DummySourceDataLine.java b/jdk/test/javax/sound/midi/Gervill/SoftAudioSynthesizer/DummySourceDataLine.java index ae8ea108971..4d9c0bc4b38 100644 --- a/jdk/test/javax/sound/midi/Gervill/SoftAudioSynthesizer/DummySourceDataLine.java +++ b/jdk/test/javax/sound/midi/Gervill/SoftAudioSynthesizer/DummySourceDataLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,16 +84,16 @@ public class DummySourceDataLine implements SourceDataLine { AudioSystem.NOT_SPECIFIED, bits, channels, channels * bits / 8, AudioSystem.NOT_SPECIFIED, true)); } - formats.add(new AudioFormat(AudioFloatConverter.PCM_FLOAT, + formats.add(new AudioFormat(Encoding.PCM_FLOAT, AudioSystem.NOT_SPECIFIED, 32, channels, channels * 4, AudioSystem.NOT_SPECIFIED, false)); - formats.add(new AudioFormat(AudioFloatConverter.PCM_FLOAT, + formats.add(new AudioFormat(Encoding.PCM_FLOAT, AudioSystem.NOT_SPECIFIED, 32, channels, channels * 4, AudioSystem.NOT_SPECIFIED, true)); - formats.add(new AudioFormat(AudioFloatConverter.PCM_FLOAT, + formats.add(new AudioFormat(Encoding.PCM_FLOAT, AudioSystem.NOT_SPECIFIED, 64, channels, channels * 8, AudioSystem.NOT_SPECIFIED, false)); - formats.add(new AudioFormat(AudioFloatConverter.PCM_FLOAT, + formats.add(new AudioFormat(Encoding.PCM_FLOAT, AudioSystem.NOT_SPECIFIED, 64, channels, channels * 8, AudioSystem.NOT_SPECIFIED, true)); } diff --git a/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/DummySourceDataLine.java b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/DummySourceDataLine.java index ae8ea108971..4d9c0bc4b38 100644 --- a/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/DummySourceDataLine.java +++ b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/DummySourceDataLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * 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,16 +84,16 @@ public class DummySourceDataLine implements SourceDataLine { AudioSystem.NOT_SPECIFIED, bits, channels, channels * bits / 8, AudioSystem.NOT_SPECIFIED, true)); } - formats.add(new AudioFormat(AudioFloatConverter.PCM_FLOAT, + formats.add(new AudioFormat(Encoding.PCM_FLOAT, AudioSystem.NOT_SPECIFIED, 32, channels, channels * 4, AudioSystem.NOT_SPECIFIED, false)); - formats.add(new AudioFormat(AudioFloatConverter.PCM_FLOAT, + formats.add(new AudioFormat(Encoding.PCM_FLOAT, AudioSystem.NOT_SPECIFIED, 32, channels, channels * 4, AudioSystem.NOT_SPECIFIED, true)); - formats.add(new AudioFormat(AudioFloatConverter.PCM_FLOAT, + formats.add(new AudioFormat(Encoding.PCM_FLOAT, AudioSystem.NOT_SPECIFIED, 64, channels, channels * 8, AudioSystem.NOT_SPECIFIED, false)); - formats.add(new AudioFormat(AudioFloatConverter.PCM_FLOAT, + formats.add(new AudioFormat(Encoding.PCM_FLOAT, AudioSystem.NOT_SPECIFIED, 64, channels, channels * 8, AudioSystem.NOT_SPECIFIED, true)); } diff --git a/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/LoadAllInstruments.java b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/LoadAllInstruments.java index 5dc16828695..0e67c614e5b 100644 --- a/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/LoadAllInstruments.java +++ b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/LoadAllInstruments.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sound/midi/Gervill/SoftSynthesizer/LoadInstrument.java b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/LoadInstrument.java index 97d69a34855..9333b36bdf8 100644 --- a/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/LoadInstrument.java +++ b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/LoadInstrument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sound/midi/Gervill/SoftSynthesizer/LoadInstruments.java b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/LoadInstruments.java index 263ef470f5d..a86f3955dd7 100644 --- a/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/LoadInstruments.java +++ b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/LoadInstruments.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sound/midi/Gervill/SoftSynthesizer/RemapInstrument.java b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/RemapInstrument.java index f7fa9e59a71..64baf2d3f38 100644 --- a/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/RemapInstrument.java +++ b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/RemapInstrument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sound/midi/Gervill/SoftSynthesizer/UnloadAllInstruments.java b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/UnloadAllInstruments.java index 6070db12001..70414a251ac 100644 --- a/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/UnloadAllInstruments.java +++ b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/UnloadAllInstruments.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sound/midi/Gervill/SoftSynthesizer/UnloadInstrument.java b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/UnloadInstrument.java index 13753af120a..3a3861cddcd 100644 --- a/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/UnloadInstrument.java +++ b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/UnloadInstrument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sound/midi/Gervill/SoftSynthesizer/UnloadInstruments.java b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/UnloadInstruments.java index bfa791ef402..b34e45a7192 100644 --- a/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/UnloadInstruments.java +++ b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/UnloadInstruments.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/AbstractButton/6711682/bug6711682.java b/jdk/test/javax/swing/AbstractButton/6711682/bug6711682.java index 0e55fd09eb1..bc6b36b1f14 100644 --- a/jdk/test/javax/swing/AbstractButton/6711682/bug6711682.java +++ b/jdk/test/javax/swing/AbstractButton/6711682/bug6711682.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/DataTransfer/6456844/bug6456844.java b/jdk/test/javax/swing/DataTransfer/6456844/bug6456844.java new file mode 100644 index 00000000000..0b290375f45 --- /dev/null +++ b/jdk/test/javax/swing/DataTransfer/6456844/bug6456844.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 6456844 + @summary Tests that JTextComponent doesn't create drop locations with null bias. + @author Shannon Hickey +*/ + +import sun.swing.SwingAccessor; + +import javax.swing.*; +import javax.swing.border.EmptyBorder; +import javax.swing.text.JTextComponent; +import java.awt.*; + +public class bug6456844 { + + public static void main(String[] args) { + JEditorPane ep = new JEditorPane(); + ep.setContentType("text/html"); + ep.setText("abc"); + ep.setBorder(new EmptyBorder(20, 20, 20, 20)); + ep.setBounds(0, 0, 100, 100); + + JTextComponent.DropLocation location = + (JTextComponent.DropLocation) SwingAccessor.getJTextComponentAccessor().dropLocationForPoint(ep, + new Point(0, 0)); + + if (location.getBias() == null) { + throw new RuntimeException("null bias"); + } + } +} diff --git a/jdk/test/javax/swing/GroupLayout/6613904/bug6613904.java b/jdk/test/javax/swing/GroupLayout/6613904/bug6613904.java new file mode 100644 index 00000000000..0f0626e66c9 --- /dev/null +++ b/jdk/test/javax/swing/GroupLayout/6613904/bug6613904.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6613904 + * @summary javax.swing.GroupLayout.createParallelGroup(..) doesn't throw IllegalArgumentException for null arg + * @author Pavel Porvatov + */ + +import javax.swing.*; + +public class bug6613904 { + public static void main(String[] args) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + GroupLayout groupLayout = new GroupLayout(new JPanel()); + + try { + groupLayout.createParallelGroup(null); + + throw new RuntimeException("groupLayout.createParallelGroup(null) doesn't throw IAE"); + } catch (IllegalArgumentException e) { + // Ok + } + + try { + groupLayout.createParallelGroup(null, true); + + throw new RuntimeException("groupLayout.createParallelGroup(null, true) doesn't throw IAE"); + } catch (IllegalArgumentException e) { + // Ok + } + + try { + groupLayout.createParallelGroup(null, false); + + throw new RuntimeException("groupLayout.createParallelGroup(null, false) doesn't throw IAE"); + } catch (IllegalArgumentException e) { + // Ok + } + } + }); + } +} diff --git a/jdk/test/javax/swing/JComponent/6989617/bug6989617.java b/jdk/test/javax/swing/JComponent/6989617/bug6989617.java new file mode 100644 index 00000000000..7f7aa958bf6 --- /dev/null +++ b/jdk/test/javax/swing/JComponent/6989617/bug6989617.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 6989617 + @summary Enable JComponent to control repaintings of its children + @author Alexander Potochkin + @run main bug6989617 +*/ + +import javax.swing.*; +import java.awt.*; + +public class bug6989617 { + + private boolean isPaintingOrigin; + private boolean innerPanelRepainted, outerPanelRepainted; + + public bug6989617() { + + final JButton button = new JButton("button"); + + JPanel innerPanel = new JPanel() { + protected boolean isPaintingOrigin() { + return isPaintingOrigin; + } + + public void repaint(long tm, int x, int y, int width, int height) { + if (button.getParent() != null) { + innerPanelRepainted = true; + if (!button.getSize().equals(new Dimension(width, height))) { + throw new RuntimeException("Wrong size of the dirty area"); + } + if (!button.getLocation().equals(new Point(x, y))) { + throw new RuntimeException("Wrong location of the dirty area"); + } + } + super.repaint(tm, x, y, width, height); + } + }; + + JPanel outerPanel = new JPanel() { + protected boolean isPaintingOrigin() { + return isPaintingOrigin; + } + + public void repaint(long tm, int x, int y, int width, int height) { + if (button.getParent() != null) { + outerPanelRepainted = true; + if (!button.getSize().equals(new Dimension(width, height))) { + throw new RuntimeException("Wrong size of the dirty area"); + } + } + super.repaint(tm, x, y, width, height); + } + }; + + + outerPanel.add(innerPanel); + innerPanel.add(button); + + outerPanel.setSize(100, 100); + innerPanel.setBounds(10, 10, 50, 50); + button.setBounds(10, 10, 20, 20); + + if (innerPanelRepainted || outerPanelRepainted) { + throw new RuntimeException("Repainted flag is unexpectedly on"); + } + button.repaint(); + if (innerPanelRepainted || outerPanelRepainted) { + throw new RuntimeException("Repainted flag is unexpectedly on"); + } + isPaintingOrigin = true; + button.repaint(); + if (!innerPanelRepainted || !outerPanelRepainted) { + throw new RuntimeException("Repainted flag is unexpectedly off"); + } + } + + public static void main(String... args) throws Exception { + new bug6989617(); + } +} diff --git a/jdk/test/javax/swing/JDialog/6639507/bug6639507.java b/jdk/test/javax/swing/JDialog/6639507/bug6639507.java new file mode 100644 index 00000000000..13d1915a3b7 --- /dev/null +++ b/jdk/test/javax/swing/JDialog/6639507/bug6639507.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 6639507 + @summary Title of javax.swing.JDialog is null while spec says it's empty + @author Pavel Porvatov +*/ +import javax.swing.*; +import java.awt.*; + +public class bug6639507 { + public static void main(String[] args) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + assertEmptyTitle(new Dialog((Frame) null), "new Dialog((Frame) null)"); + assertEmptyTitle(new Dialog((Frame) null, true), "new Dialog((Frame) null, true)"); + assertEmptyTitle(new Dialog((Dialog) null), "new Dialog((Dialog) null)"); + assertEmptyTitle(new Dialog((Window) null), "new Dialog((Window) null)"); + assertEmptyTitle(new Dialog(new Dialog((Window) null), Dialog.ModalityType.APPLICATION_MODAL), + "new Dialog((Window) null), Dialog.ModalityType.APPLICATION_MODAL"); + + assertEmptyTitle(new JDialog((Frame) null), "new JDialog((Frame) null)"); + assertEmptyTitle(new JDialog((Frame) null, true), "new JDialog((Frame) null, true)"); + assertEmptyTitle(new JDialog((Dialog) null), "new JDialog((Dialog) null)"); + assertEmptyTitle(new JDialog((Dialog) null, true), "new JDialog((Dialog) null, true)"); + assertEmptyTitle(new JDialog((Window) null), "new JDialog((Window) null)"); + assertEmptyTitle(new JDialog((Window) null, Dialog.ModalityType.APPLICATION_MODAL), + "new JDialog((Window) null, Dialog.ModalityType.APPLICATION_MODAL)"); + } + }); + } + + private static void assertEmptyTitle(Dialog dialog, String ctr) { + String title = dialog.getTitle(); + + if (title == null || title.length() > 0) { + throw new RuntimeException("Title is not empty for constructor " + ctr); + } + } +} diff --git a/jdk/test/javax/swing/JFileChooser/4150029/bug4150029.html b/jdk/test/javax/swing/JFileChooser/4150029/bug4150029.html new file mode 100644 index 00000000000..15620bf05a3 --- /dev/null +++ b/jdk/test/javax/swing/JFileChooser/4150029/bug4150029.html @@ -0,0 +1,9 @@ + + + +1.Go into 'subDir' folder. +2.Press BACKSPACE key. +3.Push OPEN button. +4.Push DONE button. + + diff --git a/jdk/test/javax/swing/JFileChooser/4150029/bug4150029.java b/jdk/test/javax/swing/JFileChooser/4150029/bug4150029.java new file mode 100644 index 00000000000..d71bbf46828 --- /dev/null +++ b/jdk/test/javax/swing/JFileChooser/4150029/bug4150029.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 4150029 + @summary BackSpace keyboard button does not lead to parent directory + @author Oleg Mokhovikov + @run applet/manual=done bug4150029.html +*/ + +import javax.swing.*; +import java.io.File; +import java.io.IOException; + +public class bug4150029 extends JApplet { + private boolean res; + + public void init() { + String tmpDir = System.getProperty("java.io.tmpdir"); + + if (tmpDir.length() == 0) {//'java.io.tmpdir' isn't guaranteed to be defined + tmpDir = System.getProperty("user.home"); + } + + System.out.println("Temp directory: " + tmpDir); + + File testDir = new File(tmpDir, "testDir"); + + testDir.mkdir(); + + File subDir = new File(testDir, "subDir"); + + subDir.mkdir(); + + System.out.println("Created directory: " + testDir); + System.out.println("Created sub-directory: " + subDir); + + JFileChooser fileChooser = new JFileChooser(testDir); + + fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + + try { + res = fileChooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION || + testDir.getCanonicalPath().equals(fileChooser.getSelectedFile().getCanonicalPath()); + } catch (IOException e) { + res = false; + + e.printStackTrace(); + } + + try { + subDir.delete(); + testDir.delete(); + } catch (SecurityException e) { + e.printStackTrace(); + } + } + + public void destroy() { + if (!res) { + throw new RuntimeException("BackSpace keyboard button does not lead to parent directory"); + } + } +} diff --git a/jdk/test/javax/swing/JFileChooser/4847375/bug4847375.java b/jdk/test/javax/swing/JFileChooser/4847375/bug4847375.java new file mode 100644 index 00000000000..8a9af80b672 --- /dev/null +++ b/jdk/test/javax/swing/JFileChooser/4847375/bug4847375.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4847375 + * @summary JFileChooser Create New Folder button is disabled incorrectly + * @author Pavel Porvatov + */ + +import sun.awt.OSInfo; +import sun.awt.shell.ShellFolder; + +import javax.swing.*; +import java.awt.*; +import java.lang.reflect.Method; + +public class bug4847375 { + private final String newFolderToolTipText; + + private final String lookAndFeel; + + public static void main(String[] args) throws Exception { + if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) { + System.out.println("The test is suitable only for Windows OS. Skipped."); + + return; + } + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + new bug4847375("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); + + new bug4847375("javax.swing.plaf.metal.MetalLookAndFeel"); + } + }); + } + + private static Object[][] DIRECTORIES = new Object[][]{ + {"getDesktop", Boolean.TRUE}, + {"getDrives", Boolean.FALSE}, // My computer + {"getRecent", Boolean.TRUE}, + {"getNetwork", Boolean.FALSE}, + {"getPersonal", Boolean.TRUE}, + }; + + private bug4847375(String lookAndFeel) { + this.lookAndFeel = lookAndFeel; + + try { + UIManager.setLookAndFeel(lookAndFeel); + } catch (Exception e) { + fail("Cannot set LookAndFeel", e); + } + + JFileChooser fileChooser = new JFileChooser(); + + // Find button NewFolder + newFolderToolTipText = UIManager.getString("FileChooser.newFolderToolTipText", fileChooser.getLocale()); + + if (newFolderToolTipText == null || newFolderToolTipText.length() == 0) { + fail("Cannot find NewFolderButton in FileChooser (tooltip doesn't exist)"); + + return; + } + + JButton newFolderButton = findNewFolderButton(fileChooser); + + if (newFolderButton == null) { + fail("Cannot find NewFolderButton in FileChooser"); + + return; + } + + for (Object[] objects : DIRECTORIES) { + String getterName = (String) objects[0]; + Boolean enabledNewFolder = (Boolean) objects[1]; + + fileChooser.setCurrentDirectory(getWin32Folder(getterName)); + + if (newFolderButton.isEnabled() != enabledNewFolder) { + fail("Enabled state of NewFolderButton should be " + enabledNewFolder + + " for Win32ShellFolderManager2." + getterName + "()"); + } + } + } + + private JButton findNewFolderButton(Container container) { + JButton result = null; + + for (int i = 0; i < container.getComponentCount(); i++) { + Component c = container.getComponent(i); + + if (c instanceof JButton && newFolderToolTipText.equals(((JButton) c).getToolTipText())) { + if (result != null) { + fail("Two or more NewFolderButton found in FileChooser"); + } + + result = (JButton) c; + } + + if (c instanceof Container) { + JButton button = findNewFolderButton((Container) c); + + if (result == null) { + result = button; + } else { + if (button != null) { + fail("Two or more NewFolderButton found in FileChooser"); + } + } + } + } + + return result; + } + + private ShellFolder getWin32Folder(String getterName) { + try { + Class win32ShellFolderManager2 = Class.forName("sun.awt.shell.Win32ShellFolderManager2"); + + Method method = win32ShellFolderManager2.getDeclaredMethod(getterName); + method.setAccessible(true); + + return (ShellFolder) method.invoke(null); + } catch (Exception e) { + fail("Cannot call '" + getterName + "' in the Win32ShellFolderManager2 class", e); + + return null; + } + } + + private void fail(String s) { + throw new RuntimeException("Test failed: " + s); + } + + private void fail(String s, Throwable e) { + throw new RuntimeException("Test failed for LookAndFeel " + lookAndFeel + ": " + s, e); + } +} diff --git a/jdk/test/javax/swing/JFileChooser/6396844/TwentyThousandTest.java b/jdk/test/javax/swing/JFileChooser/6396844/TwentyThousandTest.java new file mode 100644 index 00000000000..2e244a380d6 --- /dev/null +++ b/jdk/test/javax/swing/JFileChooser/6396844/TwentyThousandTest.java @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6396844 + * @summary Tests memory leak for 20000 files + * @author Sergey Malenkov + * @run main/othervm/timeout=1000 -mx256m TwentyThousandTest + */ + +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.io.FileWriter; + +public class TwentyThousandTest implements ActionListener, Runnable { + + private static final int FILES = 20000; + private static final int ATTEMPTS = 100; + private static final int INTERVAL = 100; + + private static final boolean ALWAYS_NEW_INSTANCE = false; + private static final boolean UPDATE_UI_EACH_INTERVAL = true; + private static final boolean AUTO_CLOSE_DIALOG = true; + + private static JFileChooser CHOOSER; + + private static String tmpDir; + + public static void main(String[] args) throws Exception { + tmpDir = System.getProperty("java.io.tmpdir"); + + if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined + tmpDir = System.getProperty("user.home"); + } + + System.out.println("Temp directory: " + tmpDir); + + System.out.println("Creating " + FILES + " files"); + + for (int i = 0; i < FILES; i++) { + File file = getTempFile(i); + + FileWriter writer = new FileWriter(file); + writer.write("File " + i); + writer.close(); + } + + for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) { + if (laf.getClassName().contains("Motif")) { + continue; + } + + UIManager.setLookAndFeel(laf.getClassName()); + + System.out.println("Do " + ATTEMPTS + " attempts for " + laf.getClassName()); + + for ( int i = 0; i < ATTEMPTS; i++ ) { + System.out.print(i + " "); + + doAttempt(); + } + + System.out.println(); + + CHOOSER = null; + } + + System.out.println("Removing " + FILES + " files"); + + for (int i = 0; i < FILES; i++) { + getTempFile(i).delete(); + } + + System.out.println( "Test passed successfully" ); + } + + private static File getTempFile(int i) { + return new File(tmpDir, "temp" + i + ".txt"); + } + + private static void doAttempt() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + if ( ALWAYS_NEW_INSTANCE || ( CHOOSER == null ) ) + CHOOSER = new JFileChooser(tmpDir); + + if ( UPDATE_UI_EACH_INTERVAL ) + CHOOSER.updateUI(); + + if ( AUTO_CLOSE_DIALOG ) { + Thread t = new Thread( new TwentyThousandTest( CHOOSER ) ); + t.start(); + CHOOSER.showOpenDialog( null ); + } else { + CHOOSER.showOpenDialog( null ); + } + } + }); + + // Allow to collect garbage by GC + Thread.sleep(1000); + + System.gc(); + } + + private final JFileChooser chooser; + + TwentyThousandTest( JFileChooser chooser ) { + this.chooser = chooser; + } + + public void run() { + while ( !this.chooser.isShowing() ) { + try { + Thread.sleep( 30 ); + } catch ( InterruptedException exception ) { + exception.printStackTrace(); + } + } + Timer timer = new Timer( INTERVAL, this ); + timer.setRepeats( false ); + timer.start(); + } + + public void actionPerformed( ActionEvent event ) { + this.chooser.cancelSelection(); + } +} diff --git a/jdk/test/javax/swing/JLayer/6994419/bug6994419.java b/jdk/test/javax/swing/JLayer/6994419/bug6994419.java new file mode 100644 index 00000000000..bc77c67872f --- /dev/null +++ b/jdk/test/javax/swing/JLayer/6994419/bug6994419.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 6994419 + * @summary JLayer.removeAll() behavior doesn't correspond to JLayer.remove() behavior. + * @author Alexander Potochkin + */ + +import javax.swing.*; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeEvent; + +public class bug6994419 { + + public static void main(String... args) throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + + JLayer l = new JLayer(new JButton()); + + l.removeAll(); + + l.addPropertyChangeListener(new PropertyChangeListener() { + + public void propertyChange(PropertyChangeEvent evt) { + throw new RuntimeException("Property change event was unexpectedly fired"); + } + }); + + l.removeAll(); + } + }); + } +} diff --git a/jdk/test/javax/swing/JLayer/SerializationTest/SerializationTest.java b/jdk/test/javax/swing/JLayer/SerializationTest/SerializationTest.java index 6dc0eea87d6..bdb6e8406b3 100644 --- a/jdk/test/javax/swing/JLayer/SerializationTest/SerializationTest.java +++ b/jdk/test/javax/swing/JLayer/SerializationTest/SerializationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +54,6 @@ public class SerializationTest { JLayer newLayer = (JLayer) inputStream.readObject(); - if (newLayer.getLayout() == null) { - throw new RuntimeException("JLayer's layout is null"); - } if (newLayer.getGlassPane() == null) { throw new RuntimeException("JLayer's glassPane is null"); } diff --git a/jdk/test/javax/swing/JPopupMenu/6987844/bug6987844.java b/jdk/test/javax/swing/JPopupMenu/6987844/bug6987844.java new file mode 100644 index 00000000000..d8802351bcb --- /dev/null +++ b/jdk/test/javax/swing/JPopupMenu/6987844/bug6987844.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6987844 + * @summary Incorrect width of JComboBox drop down + * @author Alexander Potochkin + * @run main bug6987844 + */ + +import sun.awt.SunToolkit; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.InputEvent; + +public class bug6987844 { + static JMenu menu1; + static JMenu menu2; + + public static void main(String... args) throws Exception { + SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + Robot robot = new Robot(); + robot.setAutoDelay(200); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + JFrame frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JMenuBar bar = new JMenuBar(); + menu1 = new JMenu("Menu1"); + menu1.add(new JMenuItem("item")); + bar.add(menu1); + menu2 = new JMenu("Menu2"); + menu2.add(new JMenuItem("item")); + menu2.add(new JMenuItem("item")); + bar.add(menu2); + + frame.setJMenuBar(bar); + frame.pack(); + + frame.setVisible(true); + } + }); + toolkit.realSync(); + Point point1 = menu1.getLocationOnScreen(); + Point point2 = menu2.getLocationOnScreen(); + + robot.mouseMove(point1.x + 1, point1.y + 1); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + robot.mouseMove(point2.x + 1, point2.y + 1); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + robot.mouseMove(point1.x + 1, point1.y + 1); + toolkit.realSync(); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + Dimension popupSize1 = menu1.getPopupMenu().getSize(); + Dimension popupSize2 = menu2.getPopupMenu().getSize(); + if (popupSize1.equals(popupSize2)) { + throw new RuntimeException("First popup unexpedetly changed its size"); + } + } + }); + } +} diff --git a/jdk/test/javax/swing/JScrollBar/6542335/bug6542335.java b/jdk/test/javax/swing/JScrollBar/6542335/bug6542335.java index 33e95d8ecac..d4ed4736e34 100644 --- a/jdk/test/javax/swing/JScrollBar/6542335/bug6542335.java +++ b/jdk/test/javax/swing/JScrollBar/6542335/bug6542335.java @@ -40,11 +40,13 @@ public class bug6542335 { private static MyScrollBarUI ui; public static void main(String[] args) throws Exception { - Robot robot = new Robot(); + final Robot robot = new Robot(); robot.setAutoDelay(10); SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + final Rectangle[] thumbBounds = new Rectangle[1]; + SwingUtilities.invokeAndWait(new Runnable() { public void run() { final JFrame frame = new JFrame("bug6542335"); @@ -63,25 +65,39 @@ public class bug6542335 { rangeModel.setValue(50); sb.setModel(rangeModel); - frame.add(sb); + frame.add(sb, BorderLayout.NORTH); frame.setSize(200, 100); frame.setVisible(true); + + thumbBounds[0] = new Rectangle(ui.getThumbBounds()); } }); - Rectangle thumbBounds = new Rectangle(ui.getThumbBounds()); - - toolkit.realSync(); - Point l = sb.getLocationOnScreen(); - robot.mouseMove(l.x + (int) (0.75 * sb.getWidth()), l.y + sb.getHeight()/2); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.mouseRelease(InputEvent.BUTTON1_MASK); toolkit.realSync(); - if (!thumbBounds.equals(ui.getThumbBounds())) { - throw new RuntimeException("Test failed"); - } + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + Point l = sb.getLocationOnScreen(); + + robot.mouseMove(l.x + (int) (0.75 * sb.getWidth()), l.y + sb.getHeight() / 2); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + } + }); + + toolkit.realSync(); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + Rectangle newThumbBounds = ui.getThumbBounds(); + + if (!thumbBounds[0].equals(newThumbBounds)) { + throw new RuntimeException("Test failed.\nOld bounds: " + thumbBounds[0] + + "\nNew bounds: " + newThumbBounds); + } + } + }); } static class MyScrollBarUI extends BasicScrollBarUI { diff --git a/jdk/test/javax/swing/JScrollPane/6559589/bug6559589.java b/jdk/test/javax/swing/JScrollPane/6559589/bug6559589.java new file mode 100644 index 00000000000..65b35fd5993 --- /dev/null +++ b/jdk/test/javax/swing/JScrollPane/6559589/bug6559589.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6559589 + * @summary Memory leak in JScrollPane.updateUI() + * @author Alexander Potochkin + * @run main bug6559589 + */ + +import javax.swing.*; +import javax.swing.plaf.metal.MetalLookAndFeel; + +public class bug6559589 { + + private static void createGui() { + JScrollPane sp = new JScrollPane(); + int listenerCount = sp.getPropertyChangeListeners().length; + sp.updateUI(); + if(listenerCount != sp.getPropertyChangeListeners().length) { + throw new RuntimeException("Listeners' leak"); + } + } + + public static void main(String[] args) throws Exception { + UIManager.setLookAndFeel(new MetalLookAndFeel()); + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + bug6559589.createGui(); + } + }); + } +} diff --git a/jdk/test/javax/swing/JSpinner/6532833/bug6532833.java b/jdk/test/javax/swing/JSpinner/6532833/bug6532833.java new file mode 100644 index 00000000000..184fe69d96d --- /dev/null +++ b/jdk/test/javax/swing/JSpinner/6532833/bug6532833.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 6532833 + @summary PIT: Metal LAF - The right side border is not shown for the Spinner after the removing the buttons + @author Pavel Porvatov +*/ + +import javax.swing.*; +import java.awt.*; + +public class bug6532833 { + public static void main(String[] args) throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + JSpinner[] spinners = new JSpinner[2]; + + for (int i = 0; i < spinners.length; i++) { + JSpinner spinner = new JSpinner(); + + spinner.setValue(2010); + + Component arrowUp = spinner.getComponent(0); + Component arrowDown = spinner.getComponent(1); + + LayoutManager layout = spinner.getLayout(); + + layout.removeLayoutComponent(arrowUp); + layout.removeLayoutComponent(arrowDown); + + if (i == 1) { + spinner.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); + } + + spinners[i] = spinner; + } + + // Do layout of spinners components + JFrame frame = new JFrame(); + + for (JSpinner spinner : spinners) { + frame.getContentPane().add(spinner); + } + + frame.pack(); + + for (JSpinner spinner : spinners) { + Insets insets = spinner.getInsets(); + + if (spinner.getWidth() != insets.left + insets.right + spinner.getEditor().getWidth()) { + throw new RuntimeException("Spinner editor width is invalid"); + } + } + + frame.dispose(); + } + }); + } +} diff --git a/jdk/test/javax/swing/JTable/6735286/bug6735286.java b/jdk/test/javax/swing/JTable/6735286/bug6735286.java new file mode 100644 index 00000000000..0bb8bbff52d --- /dev/null +++ b/jdk/test/javax/swing/JTable/6735286/bug6735286.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 6735286 + @summary javax.swing.DefaultTableCellRender.getTableCellRendererComponent() doesn't allow passing null Tables + @author Pavel Porvatov +*/ + +import javax.swing.*; + +public class bug6735286 { + public static void main(String[] args) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + new JTable().getDefaultRenderer(Object.class).getTableCellRendererComponent(null, "a value", + true, true, 0, 0); + + } + }); + } +} diff --git a/jdk/test/javax/swing/JTextArea/Test6593649.java b/jdk/test/javax/swing/JTextArea/Test6593649.java index f7cadb8ddbc..f27057c4b08 100644 --- a/jdk/test/javax/swing/JTextArea/Test6593649.java +++ b/jdk/test/javax/swing/JTextArea/Test6593649.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/SwingWorker/6480289/bug6480289.java b/jdk/test/javax/swing/SwingWorker/6480289/bug6480289.java deleted file mode 100644 index 9ff34969a31..00000000000 --- a/jdk/test/javax/swing/SwingWorker/6480289/bug6480289.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* @test - * - * @bug 6480289 - * @author Igor Kushnirskiy - * @summary tests if consequent workers are executed on the same thread and that VM can exit. - */ - -import java.util.*; -import javax.swing.SwingWorker; - -public class bug6480289 { - private static final int ITERATIONS = 5; - private static final Map threadMap = - Collections.synchronizedMap(new HashMap()); - public static void main(String[] args) throws Exception { - - for (int i = 0; i < ITERATIONS; i++) { - if (i != 0) { - Thread.sleep(1000 * 5); - } - SwingWorker worker = - new SwingWorker() { - @Override - protected Void doInBackground() { - Integer value = threadMap.get(Thread.currentThread()); - value = Integer.valueOf( - ((value == null) ? 0 : value.intValue()) - + 1); - threadMap.put(Thread.currentThread(), value); - return null; - } - }; - worker.execute(); - } - if (threadMap.keySet().size() != 1) { - throw new RuntimeException("failed. More than one thread."); - } - } -} diff --git a/jdk/test/javax/swing/border/Test6981576.java b/jdk/test/javax/swing/border/Test6981576.java new file mode 100644 index 00000000000..479118f1b9f --- /dev/null +++ b/jdk/test/javax/swing/border/Test6981576.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6981576 + * @summary Tests that default border for the titled border is not null + * @author Sergey Malenkov + */ + +import java.awt.Component; +import java.awt.Graphics; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UIManager.LookAndFeelInfo; +import javax.swing.border.TitledBorder; + +public class Test6981576 extends TitledBorder implements Runnable, Thread.UncaughtExceptionHandler { + public static void main(String[] args) { + SwingUtilities.invokeLater(new Test6981576()); + } + + private int index; + private LookAndFeelInfo[] infos; + private JFrame frame; + + private Test6981576() { + super(""); + } + + @Override + public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { + getBorder().paintBorder(c, g, x, y, width, height); + } + + public void run() { + if (this.infos == null) { + this.infos = UIManager.getInstalledLookAndFeels(); + Thread.currentThread().setUncaughtExceptionHandler(this); + JPanel panel = new JPanel(); + panel.setBorder(this); + this.frame = new JFrame(getClass().getSimpleName()); + this.frame.add(panel); + this.frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + this.frame.setVisible(true); + } + if (this.index == this.infos.length) { + this.frame.dispose(); + } + else { + LookAndFeelInfo info = this.infos[this.index % this.infos.length]; + try { + UIManager.setLookAndFeel(info.getClassName()); + } + catch (Exception exception) { + System.err.println("could not change look and feel"); + } + SwingUtilities.updateComponentTreeUI(this.frame); + this.frame.pack(); + this.frame.setLocationRelativeTo(null); + this.index++; + SwingUtilities.invokeLater(this); + } + } + + public void uncaughtException(Thread thread, Throwable throwable) { + System.exit(1); + } +} diff --git a/jdk/test/javax/swing/plaf/basic/BasicScrollPaneUI/Test6632810.java b/jdk/test/javax/swing/plaf/basic/BasicScrollPaneUI/Test6632810.java new file mode 100644 index 00000000000..086b34d3759 --- /dev/null +++ b/jdk/test/javax/swing/plaf/basic/BasicScrollPaneUI/Test6632810.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6632810 + * @summary javax.swing.plaf.basic.BasicScrollPaneUI.getBaseline(JComponent, int, int) doesn't throw NPE and IAE + * @author Pavel Porvatov + */ + +import javax.swing.*; +import javax.swing.plaf.basic.BasicScrollPaneUI; + +public class Test6632810 { + public static void main(String[] args) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + BasicScrollPaneUI ui = new BasicScrollPaneUI(); + + ui.installUI(new JScrollPane()); + + try { + ui.getBaseline(null, 1, 1); + + throw new RuntimeException("getBaseline(null, 1, 1) does not throw NPE"); + } catch (NullPointerException e) { + // Ok + } + + int[][] illegelParams = new int[][]{ + {-1, 1,}, + {1, -1,}, + {-1, -1,}, + }; + + for (int[] illegelParam : illegelParams) { + try { + int width = illegelParam[0]; + int height = illegelParam[1]; + + ui.getBaseline(new JScrollPane(), width, height); + + throw new RuntimeException("getBaseline(new JScrollPane(), " + width + ", " + height + + ") does not throw IAE"); + } catch (IllegalArgumentException e) { + // Ok + } + } + } + }); + } +} diff --git a/jdk/test/javax/swing/plaf/basic/Test6984643.java b/jdk/test/javax/swing/plaf/basic/Test6984643.java new file mode 100644 index 00000000000..57df156026a --- /dev/null +++ b/jdk/test/javax/swing/plaf/basic/Test6984643.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6984643 + * @summary Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed + * @author Pavel Porvatov + */ + +import javax.swing.*; +import javax.swing.plaf.basic.BasicLookAndFeel; + +public class Test6984643 { + public static void main(String[] args) throws Exception { + UIManager.setLookAndFeel(new BasicLookAndFeel() { + public String getName() { + return "A name"; + } + + public String getID() { + return "An id"; + } + + public String getDescription() { + return "A description"; + } + + public boolean isNativeLookAndFeel() { + return false; + } + + public boolean isSupportedLookAndFeel() { + return true; + } + }); + + SwingUtilities.invokeLater(new Runnable() { + public void run() { + new JFileChooser(); + } + }); + } +} diff --git a/jdk/test/javax/swing/plaf/nimbus/Test6919629.java b/jdk/test/javax/swing/plaf/nimbus/Test6919629.java index bc61cba7fa0..6fe98facf28 100644 --- a/jdk/test/javax/swing/plaf/nimbus/Test6919629.java +++ b/jdk/test/javax/swing/plaf/nimbus/Test6919629.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/system/6799345/TestShutdown.java b/jdk/test/javax/swing/system/6799345/TestShutdown.java index 0ca7643754e..9a858f1f5bd 100644 --- a/jdk/test/javax/swing/system/6799345/TestShutdown.java +++ b/jdk/test/javax/swing/system/6799345/TestShutdown.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +59,7 @@ public class TestShutdown while (!appcontextInitDone) { - Thread.sleep(500); + Thread.sleep(1000); } targetAppContext.dispose(); @@ -146,7 +146,6 @@ public class TestShutdown startGUI(); } }); - stk.realSync(); // start multiple SwingWorkers while (!Thread.interrupted()) diff --git a/jdk/test/javax/swing/text/DefaultHighlighter/6771184/bug6771184.java b/jdk/test/javax/swing/text/DefaultHighlighter/6771184/bug6771184.java new file mode 100644 index 00000000000..d63e8da0e61 --- /dev/null +++ b/jdk/test/javax/swing/text/DefaultHighlighter/6771184/bug6771184.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6771184 + * @summary Some methods in text package don't throw BadLocationException when expected + * @author Pavel Porvatov + */ + +import javax.swing.*; +import javax.swing.text.BadLocationException; +import javax.swing.text.Highlighter; +import javax.swing.text.JTextComponent; +import java.awt.*; + +public class bug6771184 { + public static void main(String[] args) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + JTextArea textArea = new JTextArea("Tested string"); + + Highlighter highlighter = textArea.getHighlighter(); + Highlighter.HighlightPainter myPainter = new Highlighter.HighlightPainter() { + public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c) { + } + }; + + int negativeTestedData[][] = {{50, 0}, + {-1, 1}, + {-5, -4}, + {Integer.MAX_VALUE, Integer.MIN_VALUE}, + {Integer.MIN_VALUE, Integer.MAX_VALUE}, + {Integer.MIN_VALUE, Integer.MIN_VALUE}}; + + for (int[] data : negativeTestedData) { + try { + highlighter.addHighlight(data[0], data[1], myPainter); + + throw new RuntimeException("Method addHighlight() does not throw BadLocationException for (" + + data[0] + ", " + data[1] + ") "); + } catch (BadLocationException e) { + // Ok + } + + Object objRef; + + try { + objRef = highlighter.addHighlight(0, 1, myPainter); + } catch (BadLocationException e) { + throw new RuntimeException("highlighter.addHighlight(0, 1, myPainter) throws exception", e); + } + + try { + highlighter.changeHighlight(objRef, data[0], data[1]); + + throw new RuntimeException("Method changeHighlight() does not throw BadLocationException for (" + + data[0] + ", " + data[1] + ") "); + } catch (BadLocationException e) { + // Ok + } + } + } + }); + } +} diff --git a/jdk/test/sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java b/jdk/test/sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java index c4c11c35609..7c323d6912d 100644 --- a/jdk/test/sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java +++ b/jdk/test/sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/java2d/GdiRendering/InsetClipping.java b/jdk/test/sun/java2d/GdiRendering/InsetClipping.java index 363f1609a35..f49a7270433 100644 --- a/jdk/test/sun/java2d/GdiRendering/InsetClipping.java +++ b/jdk/test/sun/java2d/GdiRendering/InsetClipping.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +84,9 @@ public class InsetClipping extends Frame { Thread.sleep(100); } catch (Exception e) {} } + try { + Thread.sleep(2000); + } catch (InterruptedException ex) {} try { Robot robot = new Robot(); Point clientLoc = clipTest.getLocationOnScreen(); diff --git a/jdk/test/sun/java2d/SunGraphics2D/DrawImageBilinear.java b/jdk/test/sun/java2d/SunGraphics2D/DrawImageBilinear.java index cb664731e7b..4dd829c4b87 100644 --- a/jdk/test/sun/java2d/SunGraphics2D/DrawImageBilinear.java +++ b/jdk/test/sun/java2d/SunGraphics2D/DrawImageBilinear.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,6 +56,9 @@ public class DrawImageBilinear extends Canvas { private VolatileImage vimg; private static volatile BufferedImage capture; private static void doCapture(Component test) { + try { + Thread.sleep(2000); + } catch (InterruptedException ex) {} // Grab the screen region try { Robot robot = new Robot(); @@ -104,7 +107,9 @@ public class DrawImageBilinear extends Canvas { // second time will be a texture->surface blit g2d.drawImage(bimg2, 80, 10, 40, 40, null); - g2d.drawImage(bimg2, 80, 10, 40, 40, null); + if (!skipOglTextureTest) { + g2d.drawImage(bimg2, 80, 10, 40, 40, null); + } // third time will be a pbuffer->surface blit if (vimg.validate(getGraphicsConfiguration()) != VolatileImage.IMAGE_OK) { @@ -150,6 +155,8 @@ public class DrawImageBilinear extends Canvas { } } + private static boolean skipOglTextureTest = false; + public static void main(String[] args) { boolean show = false; for (String arg : args) { @@ -158,6 +165,11 @@ public class DrawImageBilinear extends Canvas { } } + String arch = System.getProperty("os.arch"); + boolean isOglEnabled = Boolean.getBoolean("sun.java2d.opengl"); + skipOglTextureTest = isOglEnabled && ("sparc".equals(arch)); + System.out.println("Skip OpenGL texture test: " + skipOglTextureTest); + DrawImageBilinear test = new DrawImageBilinear(); Frame frame = new Frame(); frame.add(test); diff --git a/jdk/test/sun/java2d/SunGraphics2D/SourceClippingBlitTest/SourceClippingBlitTest.java b/jdk/test/sun/java2d/SunGraphics2D/SourceClippingBlitTest/SourceClippingBlitTest.java index 97fa8279730..6dcfe8a2ead 100644 --- a/jdk/test/sun/java2d/SunGraphics2D/SourceClippingBlitTest/SourceClippingBlitTest.java +++ b/jdk/test/sun/java2d/SunGraphics2D/SourceClippingBlitTest/SourceClippingBlitTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -204,6 +204,9 @@ public class SourceClippingBlitTest extends Canvas { int w = getWidth(); int h = getHeight(); Toolkit.getDefaultToolkit().sync(); + try { + Thread.sleep(2000); + } catch (InterruptedException ex) {} Point p = getLocationOnScreen(); grabbedBI = robot.createScreenCapture(new Rectangle(p.x, p.y, w, h)); diff --git a/jdk/test/sun/java2d/X11SurfaceData/SharedMemoryPixmapsTest/SharedMemoryPixmapsTest.java b/jdk/test/sun/java2d/X11SurfaceData/SharedMemoryPixmapsTest/SharedMemoryPixmapsTest.java index 21da7948778..49f517e552a 100644 --- a/jdk/test/sun/java2d/X11SurfaceData/SharedMemoryPixmapsTest/SharedMemoryPixmapsTest.java +++ b/jdk/test/sun/java2d/X11SurfaceData/SharedMemoryPixmapsTest/SharedMemoryPixmapsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -120,6 +120,9 @@ public class SharedMemoryPixmapsTest { } private boolean testRendering() throws RuntimeException { + try { + Thread.sleep(2000); + } catch (InterruptedException ex) {} Robot r = null; try { r = new Robot(); diff --git a/jdk/test/sun/java2d/pipe/MutableColorTest/MutableColorTest.java b/jdk/test/sun/java2d/pipe/MutableColorTest/MutableColorTest.java index 2660b496122..df1fa2aa18f 100644 --- a/jdk/test/sun/java2d/pipe/MutableColorTest/MutableColorTest.java +++ b/jdk/test/sun/java2d/pipe/MutableColorTest/MutableColorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -105,7 +105,7 @@ public class MutableColorTest { for (int y = 0; y < snapshot.getHeight(); y++) { for (int x = 0; x < snapshot.getWidth(); x++) { int snapRGB = snapshot.getRGB(x, y); - if (snapRGB != evilColor) { + if (!isSameColor(snapRGB, evilColor)) { System.err.printf("Wrong RGB for %s at (%d,%d): 0x%x " + "instead of 0x%x\n", desc, x, y, snapRGB, evilColor); String fileName = "MutableColorTest_"+desc+".png"; @@ -166,4 +166,24 @@ public class MutableColorTest { System.err.println("Test passed."); } + + /* + * We assume that colors with slightly different components + * are the same. This is done just in order to workaround + * peculiarities of OGL rendering pipeline on some platforms. + * See CR 6989217 for more details. + */ + private static boolean isSameColor(int color1, int color2) { + final int tolerance = 2; + + for (int i = 0; i < 32; i += 8) { + int c1 = 0xff & (color1 >> i); + int c2 = 0xff & (color2 >> i); + + if (Math.abs(c1 - c2) > tolerance) { + return false; + } + } + return true; + } } diff --git a/jdk/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh b/jdk/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh index 49d5f44be71..c4b4756e4b3 100644 --- a/jdk/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh +++ b/jdk/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/jvmstat/testlibrary/utils.sh b/jdk/test/sun/jvmstat/testlibrary/utils.sh index a2e4608dae1..1574d09f7bb 100644 --- a/jdk/test/sun/jvmstat/testlibrary/utils.sh +++ b/jdk/test/sun/jvmstat/testlibrary/utils.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh b/jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh index d8f8eeb299c..eef07a28655 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh +++ b/jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/misc/BootClassLoaderHook/TestHook.java b/jdk/test/sun/misc/BootClassLoaderHook/TestHook.java index 5a620b1a6f5..da5f505d843 100644 --- a/jdk/test/sun/misc/BootClassLoaderHook/TestHook.java +++ b/jdk/test/sun/misc/BootClassLoaderHook/TestHook.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/misc/Version/Version.java b/jdk/test/sun/misc/Version/Version.java new file mode 100644 index 00000000000..6e7d3626d9f --- /dev/null +++ b/jdk/test/sun/misc/Version/Version.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 6994413 + * @summary Check the JDK and JVM version returned by sun.misc.Version + * matches the versions defined in the system properties + * @compile -XDignore.symbol.file Version.java + * @run main Version + */ + +import static sun.misc.Version.*; +public class Version { + + public static void main(String[] args) throws Exception { + VersionInfo jdk = newVersionInfo(System.getProperty("java.runtime.version")); + VersionInfo v1 = new VersionInfo(jdkMajorVersion(), + jdkMinorVersion(), + jdkMicroVersion(), + jdkUpdateVersion(), + jdkSpecialVersion(), + jdkBuildNumber()); + System.out.println("JDK version = " + jdk + " " + v1); + if (!jdk.equals(v1)) { + throw new RuntimeException("Unmatched version: " + jdk + " vs " + v1); + } + VersionInfo jvm = newVersionInfo(System.getProperty("java.vm.version")); + VersionInfo v2 = new VersionInfo(jvmMajorVersion(), + jvmMinorVersion(), + jvmMicroVersion(), + jvmUpdateVersion(), + jvmSpecialVersion(), + jvmBuildNumber()); + System.out.println("JVM version = " + jvm + " " + v2); + if (!jvm.equals(v2)) { + throw new RuntimeException("Unmatched version: " + jvm + " vs " + v2); + } + } + + static class VersionInfo { + final int major; + final int minor; + final int micro; + final int update; + final String special; + final int build; + VersionInfo(int major, int minor, int micro, + int update, String special, int build) { + this.major = major; + this.minor = minor; + this.micro = micro; + this.update = update; + this.special = special; + this.build = build; + } + + public boolean equals(VersionInfo v) { + return (this.major == v.major && this.minor == v.minor && + this.micro == v.micro && this.update == v.update && + this.special.equals(v.special) && this.build == v.build); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(major + "." + minor + "." + micro); + if (update > 0) { + sb.append("_" + update); + } + + if (!special.isEmpty()) { + sb.append(special); + } + sb.append("-b" + build); + return sb.toString(); + } + } + + private static VersionInfo newVersionInfo(String version) throws Exception { + // valid format of the version string is: + // n.n.n[_uu[c]][-]-bxx + int major = 0; + int minor = 0; + int micro = 0; + int update = 0; + String special = ""; + int build = 0; + CharSequence cs = version; + if (cs.length() >= 5) { + if (Character.isDigit(cs.charAt(0)) && cs.charAt(1) == '.' && + Character.isDigit(cs.charAt(2)) && cs.charAt(3) == '.' && + Character.isDigit(cs.charAt(4))) { + major = Character.digit(cs.charAt(0), 10); + minor = Character.digit(cs.charAt(2), 10); + micro = Character.digit(cs.charAt(4), 10); + cs = cs.subSequence(5, cs.length()); + } else if (Character.isDigit(cs.charAt(0)) && + Character.isDigit(cs.charAt(1)) && cs.charAt(2) == '.' && + Character.isDigit(cs.charAt(3))) { + // HSX has nn.n (major.minor) version + major = Integer.valueOf(version.substring(0, 2)).intValue(); + minor = Character.digit(cs.charAt(3), 10); + cs = cs.subSequence(4, cs.length()); + } + if (cs.charAt(0) == '_' && cs.length() >= 3 && + Character.isDigit(cs.charAt(1)) && + Character.isDigit(cs.charAt(2))) { + int nextChar = 3; + String uu = cs.subSequence(1, 3).toString(); + update = Integer.valueOf(uu).intValue(); + if (cs.length() >= 4) { + char c = cs.charAt(3); + if (c >= 'a' && c <= 'z') { + special = Character.toString(c); + nextChar++; + } + } + cs = cs.subSequence(nextChar, cs.length()); + } + if (cs.charAt(0) == '-') { + // skip the first character + // valid format: -bxx or bxx + // non-product VM will have -debug|-release appended + cs = cs.subSequence(1, cs.length()); + String[] res = cs.toString().split("-"); + for (String s : res) { + if (s.charAt(0) == 'b') { + build = + Integer.valueOf(s.substring(1, s.length())).intValue(); + break; + } + } + } + } + return new VersionInfo(major, minor, micro, update, special, build); + } +} diff --git a/jdk/test/sun/net/InetAddress/nameservice/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor b/jdk/test/sun/net/InetAddress/nameservice/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor deleted file mode 100644 index 6fc851da50f..00000000000 --- a/jdk/test/sun/net/InetAddress/nameservice/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor +++ /dev/null @@ -1,2 +0,0 @@ -# name service provider descriptor -SimpleNameServiceDescriptor diff --git a/jdk/test/sun/net/InetAddress/nameservice/chaining/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor b/jdk/test/sun/net/InetAddress/nameservice/chaining/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor new file mode 100644 index 00000000000..5ed3b8ea755 --- /dev/null +++ b/jdk/test/sun/net/InetAddress/nameservice/chaining/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor @@ -0,0 +1,23 @@ +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions + +Simple1NameServiceDescriptor +Simple2NameServiceDescriptor diff --git a/jdk/test/java/net/InetAddress/B4762344.java b/jdk/test/sun/net/InetAddress/nameservice/chaining/Providers.java similarity index 90% rename from jdk/test/java/net/InetAddress/B4762344.java rename to jdk/test/sun/net/InetAddress/nameservice/chaining/Providers.java index 0e287059d00..590f4e25a94 100644 --- a/jdk/test/java/net/InetAddress/B4762344.java +++ b/jdk/test/sun/net/InetAddress/nameservice/chaining/Providers.java @@ -25,15 +25,17 @@ * @test * @bug 4762344 * @summary 2nd nameservice provider is non functional - * @build B4762344 SimpleNameService Simple1NameServiceDescriptor Simple2NameServiceDescriptor - * @run main/othervm -Dsun.net.spi.nameservice.provider.1=simple1,sun -Dsun.net.spi.nameservice.provider.2=simple2,sun B4762344 + * @compile -XDignore.symbol.file=true SimpleNameService.java + * Simple1NameServiceDescriptor.java + * Simple2NameServiceDescriptor.java + * @run main/othervm -Dsun.net.spi.nameservice.provider.1=simple1,sun -Dsun.net.spi.nameservice.provider.2=simple2,sun Providers */ import java.net.*; import java.util.*; -public class B4762344 { +public class Providers { private static String[][] hostnames = new String[][] { // both providers know this host, but with different address new String[] {"blade", "10.0.0.1"}, diff --git a/jdk/test/java/net/InetAddress/Simple1NameServiceDescriptor.java b/jdk/test/sun/net/InetAddress/nameservice/chaining/Simple1NameServiceDescriptor.java similarity index 100% rename from jdk/test/java/net/InetAddress/Simple1NameServiceDescriptor.java rename to jdk/test/sun/net/InetAddress/nameservice/chaining/Simple1NameServiceDescriptor.java diff --git a/jdk/test/java/net/InetAddress/Simple2NameServiceDescriptor.java b/jdk/test/sun/net/InetAddress/nameservice/chaining/Simple2NameServiceDescriptor.java similarity index 100% rename from jdk/test/java/net/InetAddress/Simple2NameServiceDescriptor.java rename to jdk/test/sun/net/InetAddress/nameservice/chaining/Simple2NameServiceDescriptor.java diff --git a/jdk/test/java/net/InetAddress/SimpleNameService.java b/jdk/test/sun/net/InetAddress/nameservice/chaining/SimpleNameService.java similarity index 100% rename from jdk/test/java/net/InetAddress/SimpleNameService.java rename to jdk/test/sun/net/InetAddress/nameservice/chaining/SimpleNameService.java diff --git a/langtools/test/tools/javac/typeAnnotations/InnerClass.java b/jdk/test/sun/net/InetAddress/nameservice/deadlock/Hang.java similarity index 56% rename from langtools/test/tools/javac/typeAnnotations/InnerClass.java rename to jdk/test/sun/net/InetAddress/nameservice/deadlock/Hang.java index e373eae58f4..79246ea8d89 100644 --- a/langtools/test/tools/javac/typeAnnotations/InnerClass.java +++ b/jdk/test/sun/net/InetAddress/nameservice/deadlock/Hang.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,39 +21,26 @@ * questions. */ -/* +/** * @test - * @bug 6843077 - * @summary compiler crashes when visiting inner classes - * @author Mahmood Ali - * @compile -source 1.7 InnerClass.java + * @bug 7012768 + * @compile -XDignore.symbol.file=true ThrowingNameService.java + * ThrowingNameServiceDescriptor.java + * @run main/othervm/timeout=30 -Dsun.net.spi.nameservice.provider.1=throwing,sun Hang + * @summary InetAddress lookupTable leaks/deadlocks when using unsupported + * name service spi */ -class InnerClass { +import java.net.InetAddress; - InnerClass() {} - InnerClass(Object o) {} +public class Hang { + public static void main(String[] args) throws Exception { + try { + // 1st attempt - IllegalStateException caught below + InetAddress.getByName("host.company.com"); + } catch (IllegalStateException e) { } - private void a() { - new Object() { - public void method() { } - }; + // 2nd attempt - Stuck here forever if bug exists + InetAddress.getByName("host.company.com"); } - - Object f1 = new InnerClass() { - void method() { } - }; - - Object f2 = new InnerClass() { - <@A R> void method() { } - }; - - Object f3 = new InnerClass(null) { - void method() { } - }; - - Object f4 = new InnerClass(null) { - <@A R> void method() { } - }; - @interface A { } } diff --git a/hotspot/make/solaris/makefiles/makedeps.make b/jdk/test/sun/net/InetAddress/nameservice/deadlock/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor similarity index 51% rename from hotspot/make/solaris/makefiles/makedeps.make rename to jdk/test/sun/net/InetAddress/nameservice/deadlock/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor index 671b53df29f..3490a904f5f 100644 --- a/hotspot/make/solaris/makefiles/makedeps.make +++ b/jdk/test/sun/net/InetAddress/nameservice/deadlock/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor @@ -1,5 +1,4 @@ -# -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -19,25 +18,5 @@ # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA # or visit www.oracle.com if you need additional information or have any # questions. -# -# -include $(GAMMADIR)/make/solaris/makefiles/rules.make - -COMPILE.JAVAC.FLAGS += -d $(OUTDIR) - -MakeDepsSources=\ - $(GAMMADIR)/src/share/tools/MakeDeps/Database.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTree.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTreeNode.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/FileFormatException.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/FileList.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/FileName.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/Macro.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/MacroDefinitions.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/MakeDeps.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/MetroWerksMacPlatform.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/Platform.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/UnixPlatform.java - -MakeDepsOptions= +ThrowingNameServiceDescriptor diff --git a/jdk/test/sun/net/InetAddress/nameservice/deadlock/ThrowingNameService.java b/jdk/test/sun/net/InetAddress/nameservice/deadlock/ThrowingNameService.java new file mode 100644 index 00000000000..292b31dda88 --- /dev/null +++ b/jdk/test/sun/net/InetAddress/nameservice/deadlock/ThrowingNameService.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.net.InetAddress; +import java.net.UnknownHostException; +import sun.net.spi.nameservice.NameService; + +public class ThrowingNameService implements NameService { + static boolean firstCall = true; + + @Override + public InetAddress[] lookupAllHostAddr(String host) throws UnknownHostException { + if (firstCall) { + firstCall = false; + // throw unchecked exception first time round + throw new IllegalStateException(); + } + + // return any valid address + return new InetAddress[] { InetAddress.getLoopbackAddress() }; + } + + @Override + public String getHostByAddr(byte[] addr) throws UnknownHostException { + throw new IllegalStateException(); + } +} diff --git a/langtools/test/tools/javac/typeAnnotations/attribution/Scopes.java b/jdk/test/sun/net/InetAddress/nameservice/deadlock/ThrowingNameServiceDescriptor.java similarity index 69% rename from langtools/test/tools/javac/typeAnnotations/attribution/Scopes.java rename to jdk/test/sun/net/InetAddress/nameservice/deadlock/ThrowingNameServiceDescriptor.java index 5b3e56bd1f7..3075412857f 100644 --- a/langtools/test/tools/javac/typeAnnotations/attribution/Scopes.java +++ b/jdk/test/sun/net/InetAddress/nameservice/deadlock/ThrowingNameServiceDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,18 +21,20 @@ * questions. */ -/* - * @test - * @bug 6843077 - * @summary test scopes of attribution - * @author Mahmood Ali - * @compile -source 1.7 Scopes.java - */ -class Scopes { +import sun.net.spi.nameservice.*; - void test() @A(VALUE) { } - void test1() @A(value=VALUE) { } +public class ThrowingNameServiceDescriptor implements NameServiceDescriptor { + public NameService createNameService() { + return new ThrowingNameService(); + } - private static final int VALUE = 1; - @interface A { int value(); } + @Override + public String getProviderName() { + return "sun"; + } + + @Override + public String getType() { + return "throwing"; + } } diff --git a/jdk/test/sun/net/InetAddress/nameservice/CacheTest.java b/jdk/test/sun/net/InetAddress/nameservice/simple/CacheTest.java similarity index 96% rename from jdk/test/sun/net/InetAddress/nameservice/CacheTest.java rename to jdk/test/sun/net/InetAddress/nameservice/simple/CacheTest.java index b6bf0e19ffc..0aadfd399ca 100644 --- a/jdk/test/sun/net/InetAddress/nameservice/CacheTest.java +++ b/jdk/test/sun/net/InetAddress/nameservice/simple/CacheTest.java @@ -26,8 +26,8 @@ * @summary Check that InetAddress doesn't continue to throw UHE * after the name service has recovered and the negative ttl * on the initial lookup has expired. - * - * @build CacheTest SimpleNameService SimpleNameServiceDescriptor + * @compile -XDignore.symbol.file=true SimpleNameService.java + * SimpleNameServiceDescriptor.java * @run main/othervm/timeout=200 -Dsun.net.spi.nameservice.provider.1=simple,sun CacheTest */ import java.net.InetAddress; diff --git a/jdk/test/sun/net/InetAddress/nameservice/B6442088.java b/jdk/test/sun/net/InetAddress/nameservice/simple/DefaultCaching.java similarity index 94% rename from jdk/test/sun/net/InetAddress/nameservice/B6442088.java rename to jdk/test/sun/net/InetAddress/nameservice/simple/DefaultCaching.java index a68f7983052..f1010daa55f 100644 --- a/jdk/test/sun/net/InetAddress/nameservice/B6442088.java +++ b/jdk/test/sun/net/InetAddress/nameservice/simple/DefaultCaching.java @@ -25,15 +25,15 @@ * @bug 6442088 * @summary Change default DNS caching behavior for code not running under * security manager. - * - * @build B6442088 SimpleNameService SimpleNameServiceDescriptor - * @run main/othervm/timeout=200 -Dsun.net.inetaddr.ttl=20 -Dsun.net.spi.nameservice.provider.1=simple,sun B6442088 + * @compile -XDignore.symbol.file=true SimpleNameService.java + * SimpleNameServiceDescriptor.java + * @run main/othervm/timeout=200 -Dsun.net.inetaddr.ttl=20 -Dsun.net.spi.nameservice.provider.1=simple,sun DefaultCaching */ import java.net.InetAddress; import java.net.UnknownHostException; import java.security.Security; -public class B6442088 { +public class DefaultCaching { public static void main(String args[]) throws Exception { diff --git a/hotspot/make/linux/makefiles/makedeps.make b/jdk/test/sun/net/InetAddress/nameservice/simple/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor similarity index 51% rename from hotspot/make/linux/makefiles/makedeps.make rename to jdk/test/sun/net/InetAddress/nameservice/simple/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor index 1ea4f3b117f..b7527c07074 100644 --- a/hotspot/make/linux/makefiles/makedeps.make +++ b/jdk/test/sun/net/InetAddress/nameservice/simple/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor @@ -1,5 +1,4 @@ -# -# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -19,25 +18,5 @@ # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA # or visit www.oracle.com if you need additional information or have any # questions. -# -# -include $(GAMMADIR)/make/linux/makefiles/rules.make - -COMPILE.JAVAC.FLAGS += -d $(OUTDIR) - -MakeDepsSources=\ - $(GAMMADIR)/src/share/tools/MakeDeps/Database.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTree.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTreeNode.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/FileFormatException.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/FileList.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/FileName.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/Macro.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/MacroDefinitions.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/MakeDeps.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/MetroWerksMacPlatform.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/Platform.java \ - $(GAMMADIR)/src/share/tools/MakeDeps/UnixPlatform.java - -MakeDepsOptions= +SimpleNameServiceDescriptor # name service provider descriptor diff --git a/jdk/test/sun/net/InetAddress/nameservice/SimpleNameService.java b/jdk/test/sun/net/InetAddress/nameservice/simple/SimpleNameService.java similarity index 100% rename from jdk/test/sun/net/InetAddress/nameservice/SimpleNameService.java rename to jdk/test/sun/net/InetAddress/nameservice/simple/SimpleNameService.java diff --git a/jdk/test/sun/net/InetAddress/nameservice/SimpleNameServiceDescriptor.java b/jdk/test/sun/net/InetAddress/nameservice/simple/SimpleNameServiceDescriptor.java similarity index 100% rename from jdk/test/sun/net/InetAddress/nameservice/SimpleNameServiceDescriptor.java rename to jdk/test/sun/net/InetAddress/nameservice/simple/SimpleNameServiceDescriptor.java diff --git a/jdk/test/sun/net/ftp/FtpGetContent.java b/jdk/test/sun/net/ftp/FtpGetContent.java index c736fd43752..8f712b41565 100644 --- a/jdk/test/sun/net/ftp/FtpGetContent.java +++ b/jdk/test/sun/net/ftp/FtpGetContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/ftp/FtpURL.java b/jdk/test/sun/net/ftp/FtpURL.java index 1d50e49ba20..117913f6a63 100644 --- a/jdk/test/sun/net/ftp/FtpURL.java +++ b/jdk/test/sun/net/ftp/FtpURL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/sdp/ProbeIB.java b/jdk/test/sun/net/sdp/ProbeIB.java index 0f1535fce14..4f9fdb5e485 100644 --- a/jdk/test/sun/net/sdp/ProbeIB.java +++ b/jdk/test/sun/net/sdp/ProbeIB.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/sdp/sanity.sh b/jdk/test/sun/net/sdp/sanity.sh index f35425b46f2..0de27095d1c 100644 --- a/jdk/test/sun/net/sdp/sanity.sh +++ b/jdk/test/sun/net/sdp/sanity.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/net/www/http/ChunkedInputStream/ChunkedEncodingTest.java b/jdk/test/sun/net/www/http/ChunkedInputStream/ChunkedEncodingTest.java index 436e29f720b..8791b4e27af 100644 --- a/jdk/test/sun/net/www/http/ChunkedInputStream/ChunkedEncodingTest.java +++ b/jdk/test/sun/net/www/http/ChunkedInputStream/ChunkedEncodingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/www/http/ChunkedInputStream/ChunkedEncodingWithProgressMonitorTest.java b/jdk/test/sun/net/www/http/ChunkedInputStream/ChunkedEncodingWithProgressMonitorTest.java index b2cdf6ec042..e1827a96fe6 100644 --- a/jdk/test/sun/net/www/http/ChunkedInputStream/ChunkedEncodingWithProgressMonitorTest.java +++ b/jdk/test/sun/net/www/http/ChunkedInputStream/ChunkedEncodingWithProgressMonitorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/www/http/ChunkedOutputStream/Test.java b/jdk/test/sun/net/www/http/ChunkedOutputStream/Test.java index 48d365a7c38..a017e6eca9e 100644 --- a/jdk/test/sun/net/www/http/ChunkedOutputStream/Test.java +++ b/jdk/test/sun/net/www/http/ChunkedOutputStream/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/www/http/HttpClient/B6726695.java b/jdk/test/sun/net/www/http/HttpClient/B6726695.java index 9e69e8e3d46..5726868ce22 100644 --- a/jdk/test/sun/net/www/http/HttpClient/B6726695.java +++ b/jdk/test/sun/net/www/http/HttpClient/B6726695.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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 6726695 + * @bug 6726695 6993490 * @summary HttpURLConnection shoul support 'Expect: 100-contimue' headers for PUT */ @@ -184,7 +184,15 @@ public class B6726695 extends Thread { out.flush(); // Then read the body char[] cbuf = new char[512]; - int l = in.read(cbuf); + in.read(cbuf); + + /* Force the server to not respond for more that the expect 100-Continue + * timeout set by the HTTP handler (5000 millis). This ensures the + * timeout is correctly resets the default read timeout, infinity. + * See 6993490. */ + System.out.println("server sleeping..."); + try {Thread.sleep(6000); } catch (InterruptedException e) {} + // finally send the 200 OK out.print("HTTP/1.1 200 OK"); out.print("Server: Sun-Java-System-Web-Server/7.0\r\n"); diff --git a/jdk/test/sun/net/www/http/HttpClient/MultiThreadTest.java b/jdk/test/sun/net/www/http/HttpClient/MultiThreadTest.java index 750e4d0d009..b9f347b9172 100644 --- a/jdk/test/sun/net/www/http/HttpClient/MultiThreadTest.java +++ b/jdk/test/sun/net/www/http/HttpClient/MultiThreadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/www/http/HttpClient/ProxyTest.java b/jdk/test/sun/net/www/http/HttpClient/ProxyTest.java index 62395f6fc2c..18c2e1f0840 100644 --- a/jdk/test/sun/net/www/http/HttpClient/ProxyTest.java +++ b/jdk/test/sun/net/www/http/HttpClient/ProxyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/www/http/KeepAliveCache/B5045306.java b/jdk/test/sun/net/www/http/KeepAliveCache/B5045306.java index ac9d4e568f3..0a13017f43b 100644 --- a/jdk/test/sun/net/www/http/KeepAliveCache/B5045306.java +++ b/jdk/test/sun/net/www/http/KeepAliveCache/B5045306.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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 5045306 6356004 + * @bug 5045306 6356004 6993490 * @library ../../httptest/ * @build HttpCallback HttpServer HttpTransaction * @run main/othervm B5045306 @@ -32,7 +32,6 @@ import java.net.*; import java.io.*; -import java.nio.channels.*; import java.lang.management.*; /* Part 1: @@ -164,6 +163,14 @@ class SimpleHttpTransaction implements HttpCallback failed = true; trans.setResponseHeader ("Content-length", Integer.toString(0)); + + /* Force the server to not respond for more that the timeout + * set by the keepalive cleaner (5000 millis). This ensures the + * timeout is correctly resets the default read timeout, + * infinity. See 6993490. */ + System.out.println("server sleeping..."); + try {Thread.sleep(6000); } catch (InterruptedException e) {} + trans.sendResponse(200, "OK"); } else if(path.equals("/part2")) { System.out.println("Call to /part2"); diff --git a/jdk/test/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java b/jdk/test/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java index 6868de89234..3d98994ff63 100644 --- a/jdk/test/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java +++ b/jdk/test/sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/www/http/KeepAliveStream/KeepAliveStreamCloseWithWrongContentLength.java b/jdk/test/sun/net/www/http/KeepAliveStream/KeepAliveStreamCloseWithWrongContentLength.java index 18f978c5c41..0c93247afeb 100644 --- a/jdk/test/sun/net/www/http/KeepAliveStream/KeepAliveStreamCloseWithWrongContentLength.java +++ b/jdk/test/sun/net/www/http/KeepAliveStream/KeepAliveStreamCloseWithWrongContentLength.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/www/httptest/HttpServer.java b/jdk/test/sun/net/www/httptest/HttpServer.java index 8fcca408f7d..33541f6a524 100644 --- a/jdk/test/sun/net/www/httptest/HttpServer.java +++ b/jdk/test/sun/net/www/httptest/HttpServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/net/www/protocol/http/ChunkedErrorStream.java b/jdk/test/sun/net/www/protocol/http/ChunkedErrorStream.java index ee5368a59cc..33a143b5b5c 100644 --- a/jdk/test/sun/net/www/protocol/http/ChunkedErrorStream.java +++ b/jdk/test/sun/net/www/protocol/http/ChunkedErrorStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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 6488669 6595324 + * @bug 6488669 6595324 6993490 * @run main/othervm ChunkedErrorStream * @summary Chunked ErrorStream tests */ @@ -48,6 +48,18 @@ import com.sun.net.httpserver.*; * 2) Client sends request to server and tries to * getErrorStream(). 4K + 10 bytes must be read from * the errorStream. + * + * Part 3: 6993490 + * Reuse persistent connection from part 2, the error stream + * buffering will have set a reduced timeout on the socket and + * tried to reset it to the default, infinity. Client must not + * throw a timeout exception. If it does, it indicates that the + * default timeout was not reset correctly. + * If no timeout exception is thrown, it does not guarantee that + * the timeout was reset correctly, as there is a potential race + * between the sleeping server and the client thread. Typically, + * 1000 millis has been enought to reliable reproduce this problem + * since the error stream buffering sets the timeout to 60 millis. */ public class ChunkedErrorStream @@ -75,19 +87,18 @@ public class ChunkedErrorStream } finally { httpServer.stop(1); } - } void doClient() { - for (int times=0; times<2; times++) { + for (int times=0; times<3; times++) { HttpURLConnection uc = null; try { InetSocketAddress address = httpServer.getAddress(); String URLStr = "http://localhost:" + address.getPort() + "/test/"; if (times == 0) { - URLStr += 6488669; + URLStr += "first"; } else { - URLStr += 6595324; + URLStr += "second"; } System.out.println("Trying " + URLStr); @@ -97,6 +108,11 @@ public class ChunkedErrorStream throw new RuntimeException("Failed: getInputStream should throw and IOException"); } catch (IOException e) { + if (e instanceof SocketTimeoutException) { + e.printStackTrace(); + throw new RuntimeException("Failed: SocketTimeoutException should not happen"); + } + // This is what we expect to happen. InputStream es = uc.getErrorStream(); byte[] ba = new byte[1024]; @@ -112,7 +128,7 @@ public class ChunkedErrorStream if (count == 0) throw new RuntimeException("Failed: ErrorStream returning 0 bytes"); - if (times == 1 && count != (4096+10)) + if (times >= 1 && count != (4096+10)) throw new RuntimeException("Failed: ErrorStream returning " + count + " bytes. Expecting " + (4096+10)); @@ -128,13 +144,13 @@ public class ChunkedErrorStream httpServer = com.sun.net.httpserver.HttpServer.create(new InetSocketAddress(0), 0); // create HttpServer context - HttpContext ctx1 = httpServer.createContext("/test/6488669", new Handler6488669()); - HttpContext ctx2 = httpServer.createContext("/test/6595324", new Handler6595324()); + httpServer.createContext("/test/first", new FirstHandler()); + httpServer.createContext("/test/second", new SecondHandler()); httpServer.start(); } - class Handler6488669 implements HttpHandler { + class FirstHandler implements HttpHandler { public void handle(HttpExchange t) throws IOException { InputStream is = t.getRequestBody(); byte[] ba = new byte[1024]; @@ -156,13 +172,22 @@ public class ChunkedErrorStream } } - class Handler6595324 implements HttpHandler { + static class SecondHandler implements HttpHandler { + /* count greater than 0, slow response */ + static int count = 0; + public void handle(HttpExchange t) throws IOException { InputStream is = t.getRequestBody(); byte[] ba = new byte[1024]; while (is.read(ba) != -1); is.close(); + if (count > 0) { + System.out.println("server sleeping..."); + try { Thread.sleep(1000); } catch(InterruptedException e) {} + } + count++; + t.sendResponseHeaders(404, 0); OutputStream os = t.getResponseBody(); diff --git a/jdk/test/sun/net/www/protocol/http/DigestTest.java b/jdk/test/sun/net/www/protocol/http/DigestTest.java index c9d82fdc264..24c8ed88b83 100644 --- a/jdk/test/sun/net/www/protocol/http/DigestTest.java +++ b/jdk/test/sun/net/www/protocol/http/DigestTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/ch/Basic.java b/jdk/test/sun/nio/ch/Basic.java index 5d13d08ee54..0109a7879e3 100644 --- a/jdk/test/sun/nio/ch/Basic.java +++ b/jdk/test/sun/nio/ch/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/ch/TempBuffer.java b/jdk/test/sun/nio/ch/TempBuffer.java index e71ce7d60f9..5a674593ae0 100644 --- a/jdk/test/sun/nio/ch/TempBuffer.java +++ b/jdk/test/sun/nio/ch/TempBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/CheckHistoricalNames.java b/jdk/test/sun/nio/cs/CheckHistoricalNames.java index fdab32d75ed..39e1ecd144c 100644 --- a/jdk/test/sun/nio/cs/CheckHistoricalNames.java +++ b/jdk/test/sun/nio/cs/CheckHistoricalNames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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 4513767 4961027 + @bug 4513767 4961027 6217210 @summary Checks canonical names match between old and (NIO) core charsets */ import java.io.InputStreamReader; @@ -154,6 +154,7 @@ public class CheckHistoricalNames { checkHistoricalName("Cp500"); checkHistoricalName("Cp737"); checkHistoricalName("Cp775"); + checkHistoricalName("Cp833"); checkHistoricalName("Cp838"); checkHistoricalName("Cp850"); checkHistoricalName("Cp852"); @@ -228,6 +229,7 @@ public class CheckHistoricalNames { checkMappedName("IBM856", "Cp856"); checkMappedName("IBM857", "Cp857"); checkMappedName("IBM00858", "Cp858"); + checkMappedName("IBM833", "Cp833"); checkMappedName("IBM860", "Cp860"); checkMappedName("IBM861", "Cp861"); checkMappedName("IBM862", "Cp862"); diff --git a/jdk/test/sun/nio/cs/EncodingNothing.java b/jdk/test/sun/nio/cs/EncodingNothing.java new file mode 100644 index 00000000000..e75e0800e96 --- /dev/null +++ b/jdk/test/sun/nio/cs/EncodingNothing.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6415373 + * @summary Encoding nothing should output nothing + */ + +import java.io.*; +import java.nio.charset.*; + +public class EncodingNothing { + + public static void main(String[] args) throws Throwable { + int failed = 0; + for (Charset cs : Charset.availableCharsets().values()) { + if (! cs.canEncode()) + continue; + System.out.printf("%s: ", cs.name()); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + OutputStreamWriter osw = new OutputStreamWriter(baos, cs); + osw.close(); + if (baos.size() != 0) { + System.out.printf(" Failed: output bytes=%d", baos.size()); + failed++; + } + System.out.println(); + } + if (failed != 0) + throw new AssertionError("Some tests failed"); + } +} diff --git a/jdk/test/sun/nio/cs/FindDecoderBugs.java b/jdk/test/sun/nio/cs/FindDecoderBugs.java index f0f9d258b2d..8c1fd910f5b 100644 --- a/jdk/test/sun/nio/cs/FindDecoderBugs.java +++ b/jdk/test/sun/nio/cs/FindDecoderBugs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/ReadZero.java b/jdk/test/sun/nio/cs/ReadZero.java index 05b58194ab8..d1212c41383 100644 --- a/jdk/test/sun/nio/cs/ReadZero.java +++ b/jdk/test/sun/nio/cs/ReadZero.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/Test4200310.sh b/jdk/test/sun/nio/cs/Test4200310.sh index c69a43b7a3b..ff9a45f5deb 100644 --- a/jdk/test/sun/nio/cs/Test4200310.sh +++ b/jdk/test/sun/nio/cs/Test4200310.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/nio/cs/Test4206507.java b/jdk/test/sun/nio/cs/Test4206507.java index 3b6f9f61f21..055c658c60c 100644 --- a/jdk/test/sun/nio/cs/Test4206507.java +++ b/jdk/test/sun/nio/cs/Test4206507.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/TestStringCoding.java b/jdk/test/sun/nio/cs/TestStringCoding.java index 61b1c37e73b..4ab70731035 100644 --- a/jdk/test/sun/nio/cs/TestStringCoding.java +++ b/jdk/test/sun/nio/cs/TestStringCoding.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/nio/cs/TestX11CNS.java b/jdk/test/sun/nio/cs/TestX11CNS.java index 9d276a8ef7c..33b7e4c4b11 100644 --- a/jdk/test/sun/nio/cs/TestX11CNS.java +++ b/jdk/test/sun/nio/cs/TestX11CNS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/rmi/rmic/manifestClassPath/run.sh b/jdk/test/sun/rmi/rmic/manifestClassPath/run.sh index 169e66c3f13..4faf141ff91 100644 --- a/jdk/test/sun/rmi/rmic/manifestClassPath/run.sh +++ b/jdk/test/sun/rmi/rmic/manifestClassPath/run.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/security/ec/TestEC.java b/jdk/test/sun/security/ec/TestEC.java index 985e5cfd7a4..fe075cd3f0a 100644 --- a/jdk/test/sun/security/ec/TestEC.java +++ b/jdk/test/sun/security/ec/TestEC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @test * @bug 6840752 * @summary Provide out-of-the-box support for ECC algorithms + * @ignore JSSE supported cipher suites are changed with CR 6916074, + * need to update this test case in JDK 7 soon * @library ../pkcs11 * @library ../pkcs11/ec * @library ../pkcs11/sslecc diff --git a/jdk/test/sun/security/krb5/IPv6.java b/jdk/test/sun/security/krb5/IPv6.java index 58abbe9739e..4b4f2a88767 100644 --- a/jdk/test/sun/security/krb5/IPv6.java +++ b/jdk/test/sun/security/krb5/IPv6.java @@ -78,8 +78,8 @@ public class IPv6 { try { Subject subject = new Subject(); Krb5LoginModule krb5 = new Krb5LoginModule(); - Map map = new HashMap(); - Map shared = new HashMap(); + Map map = new HashMap<>(); + Map shared = new HashMap<>(); map.put("debug", "true"); map.put("doNotPrompt", "true"); diff --git a/jdk/test/sun/security/krb5/UnknownCCEntry.java b/jdk/test/sun/security/krb5/UnknownCCEntry.java new file mode 100644 index 00000000000..17af51e2847 --- /dev/null +++ b/jdk/test/sun/security/krb5/UnknownCCEntry.java @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 6979329 + * @summary CCacheInputStream fails to read ticket cache files from Kerberos 1.8.1 + */ + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileOutputStream; +import sun.security.krb5.internal.ccache.CCacheInputStream; +import sun.security.krb5.internal.ccache.CredentialsCache; + +public class UnknownCCEntry { + public static void main(String[] args) throws Exception { + // This is a ccache file generated on a test machine: + // Default principal: dummy@MAX.LOCAL + // Valid starting Expires Service principal + // 08/24/10 10:37:28 08/25/10 10:37:28 krbtgt/MAX.LOCAL@MAX.LOCAL + // Flags: FI, Etype (skey, tkt): AES-128 CTS mode with 96-bit SHA-1 + // HMAC, AES-256 CTS mode with 96-bit SHA-1 HMAC + byte[] krb5cc = { + (byte)0x05, (byte)0x04, (byte)0x00, (byte)0x0C, + (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x08, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFA, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09, + (byte)0x4D, (byte)0x41, (byte)0x58, (byte)0x2E, + (byte)0x4C, (byte)0x4F, (byte)0x43, (byte)0x41, + (byte)0x4C, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x05, (byte)0x64, (byte)0x75, (byte)0x6D, + (byte)0x6D, (byte)0x79, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x09, (byte)0x4D, (byte)0x41, + (byte)0x58, (byte)0x2E, (byte)0x4C, (byte)0x4F, + (byte)0x43, (byte)0x41, (byte)0x4C, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x05, (byte)0x64, + (byte)0x75, (byte)0x6D, (byte)0x6D, (byte)0x79, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x02, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09, + (byte)0x4D, (byte)0x41, (byte)0x58, (byte)0x2E, + (byte)0x4C, (byte)0x4F, (byte)0x43, (byte)0x41, + (byte)0x4C, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x06, (byte)0x6B, (byte)0x72, (byte)0x62, + (byte)0x74, (byte)0x67, (byte)0x74, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x09, (byte)0x4D, + (byte)0x41, (byte)0x58, (byte)0x2E, (byte)0x4C, + (byte)0x4F, (byte)0x43, (byte)0x41, (byte)0x4C, + (byte)0x00, (byte)0x11, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x10, (byte)0x92, (byte)0x1D, + (byte)0x1A, (byte)0x0C, (byte)0x7F, (byte)0xB8, + (byte)0x01, (byte)0x2E, (byte)0xC9, (byte)0xF5, + (byte)0x7B, (byte)0x92, (byte)0x81, (byte)0xCA, + (byte)0x49, (byte)0xC5, (byte)0x4C, (byte)0x73, + (byte)0x30, (byte)0x68, (byte)0x4C, (byte)0x73, + (byte)0x30, (byte)0x68, (byte)0x4C, (byte)0x74, + (byte)0x81, (byte)0xE8, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x40, + (byte)0x41, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x01, (byte)0x29, (byte)0x61, + (byte)0x82, (byte)0x01, (byte)0x25, (byte)0x30, + (byte)0x82, (byte)0x01, (byte)0x21, (byte)0xA0, + (byte)0x03, (byte)0x02, (byte)0x01, (byte)0x05, + (byte)0xA1, (byte)0x0B, (byte)0x1B, (byte)0x09, + (byte)0x4D, (byte)0x41, (byte)0x58, (byte)0x2E, + (byte)0x4C, (byte)0x4F, (byte)0x43, (byte)0x41, + (byte)0x4C, (byte)0xA2, (byte)0x1E, (byte)0x30, + (byte)0x1C, (byte)0xA0, (byte)0x03, (byte)0x02, + (byte)0x01, (byte)0x00, (byte)0xA1, (byte)0x15, + (byte)0x30, (byte)0x13, (byte)0x1B, (byte)0x06, + (byte)0x6B, (byte)0x72, (byte)0x62, (byte)0x74, + (byte)0x67, (byte)0x74, (byte)0x1B, (byte)0x09, + (byte)0x4D, (byte)0x41, (byte)0x58, (byte)0x2E, + (byte)0x4C, (byte)0x4F, (byte)0x43, (byte)0x41, + (byte)0x4C, (byte)0xA3, (byte)0x81, (byte)0xEC, + (byte)0x30, (byte)0x81, (byte)0xE9, (byte)0xA0, + (byte)0x03, (byte)0x02, (byte)0x01, (byte)0x12, + (byte)0xA1, (byte)0x03, (byte)0x02, (byte)0x01, + (byte)0x01, (byte)0xA2, (byte)0x81, (byte)0xDC, + (byte)0x04, (byte)0x81, (byte)0xD9, (byte)0xFB, + (byte)0x4B, (byte)0xD2, (byte)0x55, (byte)0x33, + (byte)0xA8, (byte)0x1A, (byte)0xE6, (byte)0xB5, + (byte)0x3D, (byte)0x67, (byte)0x46, (byte)0x69, + (byte)0x6F, (byte)0x0A, (byte)0x64, (byte)0xE7, + (byte)0x3D, (byte)0xEF, (byte)0x22, (byte)0xBE, + (byte)0x81, (byte)0x32, (byte)0xF3, (byte)0x72, + (byte)0xB4, (byte)0x50, (byte)0xE3, (byte)0xC3, + (byte)0xDB, (byte)0xE5, (byte)0x38, (byte)0x3C, + (byte)0x60, (byte)0xC8, (byte)0x08, (byte)0x53, + (byte)0x44, (byte)0x6F, (byte)0xDF, (byte)0x55, + (byte)0x67, (byte)0x32, (byte)0x02, (byte)0xDD, + (byte)0x6B, (byte)0xFB, (byte)0x23, (byte)0x1A, + (byte)0x88, (byte)0x71, (byte)0xE0, (byte)0xF8, + (byte)0xBB, (byte)0x51, (byte)0x1E, (byte)0x76, + (byte)0xC9, (byte)0x1F, (byte)0x45, (byte)0x9B, + (byte)0xA0, (byte)0xA5, (byte)0x61, (byte)0x45, + (byte)0x9E, (byte)0x65, (byte)0xB8, (byte)0xD6, + (byte)0x0E, (byte)0x3C, (byte)0xD9, (byte)0x56, + (byte)0xD6, (byte)0xA6, (byte)0xDD, (byte)0x36, + (byte)0x21, (byte)0x25, (byte)0x0E, (byte)0xE6, + (byte)0xAD, (byte)0xA0, (byte)0x3A, (byte)0x9B, + (byte)0x21, (byte)0x87, (byte)0xE2, (byte)0xAF, + (byte)0x3A, (byte)0xEF, (byte)0x75, (byte)0x85, + (byte)0xA8, (byte)0xD7, (byte)0xE5, (byte)0x46, + (byte)0xD8, (byte)0x5C, (byte)0x17, (byte)0x4E, + (byte)0x64, (byte)0x51, (byte)0xDB, (byte)0x38, + (byte)0x8E, (byte)0x6B, (byte)0x02, (byte)0x05, + (byte)0x46, (byte)0x77, (byte)0xD0, (byte)0x75, + (byte)0x8A, (byte)0xE0, (byte)0x42, (byte)0x5E, + (byte)0x8D, (byte)0x49, (byte)0x86, (byte)0xDE, + (byte)0x6C, (byte)0xBC, (byte)0xAF, (byte)0x10, + (byte)0x9A, (byte)0x97, (byte)0x64, (byte)0xA6, + (byte)0xBD, (byte)0xDB, (byte)0x01, (byte)0x40, + (byte)0xA9, (byte)0x3D, (byte)0x74, (byte)0x99, + (byte)0xDC, (byte)0x63, (byte)0x34, (byte)0x40, + (byte)0x31, (byte)0x57, (byte)0xC7, (byte)0x70, + (byte)0x9F, (byte)0xCE, (byte)0xC6, (byte)0x7B, + (byte)0x00, (byte)0x5B, (byte)0x02, (byte)0x5C, + (byte)0xC7, (byte)0x81, (byte)0x40, (byte)0x4D, + (byte)0xA7, (byte)0xB1, (byte)0xD2, (byte)0xEA, + (byte)0x8E, (byte)0xEC, (byte)0xA0, (byte)0xB3, + (byte)0x03, (byte)0x29, (byte)0xB8, (byte)0x44, + (byte)0xD7, (byte)0xA1, (byte)0x2B, (byte)0x37, + (byte)0x9D, (byte)0x19, (byte)0x11, (byte)0x1D, + (byte)0x58, (byte)0xE8, (byte)0x06, (byte)0xE7, + (byte)0x06, (byte)0xE3, (byte)0xF7, (byte)0xEF, + (byte)0x05, (byte)0xA9, (byte)0x05, (byte)0x93, + (byte)0x42, (byte)0x94, (byte)0x5A, (byte)0xD6, + (byte)0xA0, (byte)0x24, (byte)0x3A, (byte)0x52, + (byte)0x92, (byte)0xA3, (byte)0x79, (byte)0x98, + (byte)0x3C, (byte)0x68, (byte)0x55, (byte)0x1B, + (byte)0x6A, (byte)0xC5, (byte)0x83, (byte)0x89, + (byte)0x5A, (byte)0x79, (byte)0x5C, (byte)0x52, + (byte)0xBA, (byte)0xB8, (byte)0xF7, (byte)0x72, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09, + (byte)0x4D, (byte)0x41, (byte)0x58, (byte)0x2E, + (byte)0x4C, (byte)0x4F, (byte)0x43, (byte)0x41, + (byte)0x4C, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x05, (byte)0x64, (byte)0x75, (byte)0x6D, + (byte)0x6D, (byte)0x79, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x03, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x0C, (byte)0x58, (byte)0x2D, + (byte)0x43, (byte)0x41, (byte)0x43, (byte)0x48, + (byte)0x45, (byte)0x43, (byte)0x4F, (byte)0x4E, + (byte)0x46, (byte)0x3A, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x15, (byte)0x6B, (byte)0x72, + (byte)0x62, (byte)0x35, (byte)0x5F, (byte)0x63, + (byte)0x63, (byte)0x61, (byte)0x63, (byte)0x68, + (byte)0x65, (byte)0x5F, (byte)0x63, (byte)0x6F, + (byte)0x6E, (byte)0x66, (byte)0x5F, (byte)0x64, + (byte)0x61, (byte)0x74, (byte)0x61, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x0A, (byte)0x66, + (byte)0x61, (byte)0x73, (byte)0x74, (byte)0x5F, + (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x69, + (byte)0x6C, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x1A, (byte)0x6B, (byte)0x72, (byte)0x62, + (byte)0x74, (byte)0x67, (byte)0x74, (byte)0x2F, + (byte)0x4D, (byte)0x41, (byte)0x58, (byte)0x2E, + (byte)0x4C, (byte)0x4F, (byte)0x43, (byte)0x41, + (byte)0x4C, (byte)0x40, (byte)0x4D, (byte)0x41, + (byte)0x58, (byte)0x2E, (byte)0x4C, (byte)0x4F, + (byte)0x43, (byte)0x41, (byte)0x4C, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x03, (byte)0x79, (byte)0x65, + (byte)0x73, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, + }; + + File f = File.createTempFile("ccache", "cc", new File(".")); + FileOutputStream fout = new FileOutputStream(f); + fout.write(krb5cc); + fout.close(); + + CredentialsCache cc = CredentialsCache.getInstance(f.getPath()); + if (!cc.getDefaultCreds().getServicePrincipal().getNameStrings()[0] + .equals("krbtgt")) { + throw new Exception("No TGT found"); + } + } +} diff --git a/jdk/test/sun/security/krb5/auto/BasicKrb5Test.java b/jdk/test/sun/security/krb5/auto/BasicKrb5Test.java index 1222c7c44dc..aaf6b126668 100644 --- a/jdk/test/sun/security/krb5/auto/BasicKrb5Test.java +++ b/jdk/test/sun/security/krb5/auto/BasicKrb5Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,34 @@ * @test * @bug 6706974 * @summary Add krb5 test infrastructure + * @run main/othervm BasicKrb5Test + * @run main/othervm BasicKrb5Test des-cbc-crc + * @run main/othervm BasicKrb5Test des-cbc-md5 + * @run main/othervm BasicKrb5Test des3-cbc-sha1 + * @run main/othervm BasicKrb5Test aes128-cts + * @run main/othervm BasicKrb5Test aes256-cts + * @run main/othervm BasicKrb5Test rc4-hmac + * @run main/othervm BasicKrb5Test -s + * @run main/othervm BasicKrb5Test des-cbc-crc -s + * @run main/othervm BasicKrb5Test des-cbc-md5 -s + * @run main/othervm BasicKrb5Test des3-cbc-sha1 -s + * @run main/othervm BasicKrb5Test aes128-cts -s + * @run main/othervm BasicKrb5Test aes256-cts -s + * @run main/othervm BasicKrb5Test rc4-hmac -s + * @run main/othervm BasicKrb5Test -C + * @run main/othervm BasicKrb5Test des-cbc-crc -C + * @run main/othervm BasicKrb5Test des-cbc-md5 -C + * @run main/othervm BasicKrb5Test des3-cbc-sha1 -C + * @run main/othervm BasicKrb5Test aes128-cts -C + * @run main/othervm BasicKrb5Test aes256-cts -C + * @run main/othervm BasicKrb5Test rc4-hmac -C + * @run main/othervm BasicKrb5Test -s -C + * @run main/othervm BasicKrb5Test des-cbc-crc -s -C + * @run main/othervm BasicKrb5Test des-cbc-md5 -s -C + * @run main/othervm BasicKrb5Test des3-cbc-sha1 -s -C + * @run main/othervm BasicKrb5Test aes128-cts -s -C + * @run main/othervm BasicKrb5Test aes256-cts -s -C + * @run main/othervm BasicKrb5Test rc4-hmac -s -C */ import org.ietf.jgss.GSSName; @@ -39,6 +67,7 @@ import sun.security.krb5.internal.crypto.EType; */ public class BasicKrb5Test { + private static boolean conf = true; /** * @param args empty or etype */ @@ -46,8 +75,10 @@ public class BasicKrb5Test { throws Exception { String etype = null; - if (args.length > 0) { - etype = args[0]; + for (String arg: args) { + if (arg.equals("-s")) Context.usingStream = true; + else if(arg.equals("-C")) conf = false; + else etype = arg; } // Creates and starts the KDC. This line must be put ahead of etype check @@ -56,8 +87,9 @@ public class BasicKrb5Test { System.out.println("Testing etype " + etype); if (etype != null && !EType.isSupported(Config.getInstance().getType(etype))) { + // aes256 is not enabled on all systems System.out.println("Not supported."); - System.exit(0); + return; } new BasicKrb5Test().go(OneKDC.SERVER, OneKDC.BACKEND); @@ -71,6 +103,7 @@ public class BasicKrb5Test { c.startAsClient(server, GSSUtil.GSS_KRB5_MECH_OID); c.x().requestCredDeleg(true); + c.x().requestConf(conf); s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); c.status(); @@ -90,6 +123,7 @@ public class BasicKrb5Test { s = null; s2.startAsClient(backend, GSSUtil.GSS_KRB5_MECH_OID); + s2.x().requestConf(conf); b.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); s2.status(); diff --git a/jdk/test/sun/security/krb5/auto/CleanState.java b/jdk/test/sun/security/krb5/auto/CleanState.java index cc6e7e54322..316a730edfe 100644 --- a/jdk/test/sun/security/krb5/auto/CleanState.java +++ b/jdk/test/sun/security/krb5/auto/CleanState.java @@ -49,11 +49,11 @@ public class CleanState { final char[] password = OneKDC.PASS; char[] badpassword = "hellokitty".toCharArray(); - Map map = new HashMap(); + Map map = new HashMap<>(); map.put("useTicketCache", "false"); map.put("doNotPrompt", "false"); map.put("tryFirstPass", "true"); - Map shared = new HashMap(); + Map shared = new HashMap<>(); shared.put("javax.security.auth.login.name", name); shared.put("javax.security.auth.login.password", badpassword); diff --git a/jdk/test/sun/security/krb5/auto/Context.java b/jdk/test/sun/security/krb5/auto/Context.java index 14ba827e357..4c67109121f 100644 --- a/jdk/test/sun/security/krb5/auto/Context.java +++ b/jdk/test/sun/security/krb5/auto/Context.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,8 @@ import org.ietf.jgss.Oid; import com.sun.security.jgss.ExtendedGSSContext; import com.sun.security.jgss.InquireType; import com.sun.security.jgss.AuthorizationDataEntry; -import java.io.File; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; /** * Context of a JGSS subject, encapsulating Subject and GSSContext. @@ -78,6 +79,8 @@ public class Context { private String name; private GSSCredential cred; // see static method delegated(). + static boolean usingStream = false; + private Context() {} /** @@ -114,8 +117,8 @@ public class Context { out.name = user; out.s = new Subject(); Krb5LoginModule krb5 = new Krb5LoginModule(); - Map map = new HashMap(); - Map shared = new HashMap(); + Map map = new HashMap<>(); + Map shared = new HashMap<>(); if (pass != null) { map.put("useFirstPass", "true"); @@ -148,7 +151,7 @@ public class Context { out.name = user; out.s = new Subject(); Krb5LoginModule krb5 = new Krb5LoginModule(); - Map map = new HashMap(); + Map map = new HashMap<>(); map.put("doNotPrompt", "true"); map.put("useTicketCache", "false"); @@ -365,7 +368,14 @@ public class Context { public byte[] run(Context me, byte[] dummy) throws Exception { System.out.println("wrap"); MessageProp p1 = new MessageProp(0, true); - byte[] out = me.x.wrap(messageBytes, 0, messageBytes.length, p1); + byte[] out; + if (usingStream) { + ByteArrayOutputStream os = new ByteArrayOutputStream(); + me.x.wrap(new ByteArrayInputStream(messageBytes), os, p1); + out = os.toByteArray(); + } else { + out = me.x.wrap(messageBytes, 0, messageBytes.length, p1); + } System.out.println(printProp(p1)); return out; } @@ -375,27 +385,46 @@ public class Context { @Override public byte[] run(Context me, byte[] input) throws Exception { MessageProp p1 = new MessageProp(0, true); - byte[] bytes = me.x.unwrap(input, 0, input.length, p1); + byte[] bytes; + if (usingStream) { + ByteArrayOutputStream os = new ByteArrayOutputStream(); + me.x.unwrap(new ByteArrayInputStream(input), os, p1); + bytes = os.toByteArray(); + } else { + bytes = me.x.unwrap(input, 0, input.length, p1); + } if (!Arrays.equals(messageBytes, bytes)) throw new Exception("wrap/unwrap mismatch"); System.out.println("unwrap"); System.out.println(printProp(p1)); p1 = new MessageProp(0, true); System.out.println("getMIC"); - bytes = me.x.getMIC(bytes, 0, bytes.length, p1); + if (usingStream) { + ByteArrayOutputStream os = new ByteArrayOutputStream(); + me.x.getMIC(new ByteArrayInputStream(messageBytes), os, p1); + bytes = os.toByteArray(); + } else { + bytes = me.x.getMIC(messageBytes, 0, messageBytes.length, p1); + } System.out.println(printProp(p1)); return bytes; } }, t); + // Re-unwrap should make p2.isDuplicateToken() returns true s1.doAs(new Action() { @Override public byte[] run(Context me, byte[] input) throws Exception { MessageProp p1 = new MessageProp(0, true); System.out.println("verifyMIC"); - me.x.verifyMIC(input, 0, input.length, - messageBytes, 0, messageBytes.length, - p1); + if (usingStream) { + me.x.verifyMIC(new ByteArrayInputStream(input), + new ByteArrayInputStream(messageBytes), p1); + } else { + me.x.verifyMIC(input, 0, input.length, + messageBytes, 0, messageBytes.length, + p1); + } System.out.println(printProp(p1)); return null; } @@ -416,7 +445,9 @@ public class Context { sb.append(prop.isGapToken()?"gap, ":""); sb.append(prop.isOldToken()?"old, ":""); sb.append(prop.isUnseqToken()?"unseq, ":""); - sb.append(prop.getMinorString()+ "(" + prop.getMinorStatus()+")"); + if (prop.getMinorStatus() != 0) { + sb.append(prop.getMinorString()+ "(" + prop.getMinorStatus()+")"); + } return sb.toString(); } @@ -442,7 +473,13 @@ public class Context { return null; } else { System.out.println(c.name + " call initSecContext"); - return me.x.initSecContext(input, 0, input.length); + if (usingStream) { + ByteArrayOutputStream os = new ByteArrayOutputStream(); + me.x.initSecContext(new ByteArrayInputStream(input), os); + return os.size() == 0 ? null : os.toByteArray(); + } else { + return me.x.initSecContext(input, 0, input.length); + } } } }, t); @@ -460,7 +497,13 @@ public class Context { return null; } else { System.out.println(s.name + " called acceptSecContext"); - return me.x.acceptSecContext(input, 0, input.length); + if (usingStream) { + ByteArrayOutputStream os = new ByteArrayOutputStream(); + me.x.acceptSecContext(new ByteArrayInputStream(input), os); + return os.size() == 0 ? null : os.toByteArray(); + } else { + return me.x.acceptSecContext(input, 0, input.length); + } } } }, t); diff --git a/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java b/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java index 96323b76553..e25e60d6ab5 100644 --- a/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java +++ b/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java @@ -297,8 +297,8 @@ public class HttpNegotiateServer { } Krb5LoginModule krb5 = new Krb5LoginModule(); - Map map = new HashMap(); - Map shared = new HashMap(); + Map map = new HashMap<>(); + Map shared = new HashMap<>(); map.put("storeKey", "true"); map.put("isInitiator", "false"); diff --git a/jdk/test/sun/security/krb5/auto/KDC.java b/jdk/test/sun/security/krb5/auto/KDC.java index 6aca26c7f4d..36dc08b4ae6 100644 --- a/jdk/test/sun/security/krb5/auto/KDC.java +++ b/jdk/test/sun/security/krb5/auto/KDC.java @@ -35,7 +35,6 @@ import sun.net.spi.nameservice.NameServiceDescriptor; import sun.security.krb5.*; import sun.security.krb5.internal.*; import sun.security.krb5.internal.ccache.CredentialsCache; -import sun.security.krb5.internal.crypto.EType; import sun.security.krb5.internal.crypto.KeyUsage; import sun.security.krb5.internal.ktab.KeyTab; import sun.security.util.DerInputStream; @@ -129,8 +128,13 @@ public class KDC { // The random generator to generate random keys (including session keys) private static SecureRandom secureRandom = new SecureRandom(); - // Principal db. principal -> pass - private Map passwords = new HashMap(); + + // Principal db. principal -> pass. A case-insensitive TreeMap is used + // so that even if the client provides a name with different case, the KDC + // can still locate the principal and give back correct salt. + private TreeMap passwords = new TreeMap<> + (String.CASE_INSENSITIVE_ORDER); + // Realm name private String realm; // KDC @@ -138,9 +142,9 @@ public class KDC { // Service port number private int port; // The request/response job queue - private BlockingQueue q = new ArrayBlockingQueue(100); + private BlockingQueue q = new ArrayBlockingQueue<>(100); // Options - private Map options = new HashMap(); + private Map options = new HashMap<>(); private Thread thread1, thread2, thread3; DatagramSocket u1 = null; @@ -159,9 +163,13 @@ public class KDC { */ ONLY_RC4_TGT, /** - * Only use RC4 in preauth, enc-type still using eTypes[0] + * Use RC4 as the first in preauth */ - ONLY_RC4_PREAUTH, + RC4_FIRST_PREAUTH, + /** + * Use only one preauth, so that some keys are not easy to generate + */ + ONLY_ONE_PREAUTH, }; static { @@ -191,6 +199,12 @@ public class KDC { return create(realm, "kdc." + realm.toLowerCase(), 0, true); } + public static KDC existing(String realm, String kdc, int port) { + KDC k = new KDC(realm, kdc); + k.port = port; + return k; + } + /** * Creates and starts a KDC server. * @param realm the realm name @@ -245,7 +259,7 @@ public class KDC { name.indexOf('/') < 0 ? PrincipalName.KRB_NT_UNKNOWN : PrincipalName.KRB_NT_SRV_HST), - kdc.passwords.get(name)); + kdc.passwords.get(name), -1, true); } } ktab.save(); @@ -471,7 +485,18 @@ public class KDC { * @return the salt */ private String getSalt(PrincipalName p) { - String[] ns = p.getNameStrings(); + String pn = p.toString(); + if (p.getRealmString() == null) { + pn = pn + "@" + getRealm(); + } + if (passwords.containsKey(pn)) { + try { + // Find the principal name with correct case. + p = new PrincipalName(passwords.ceilingEntry(pn).getKey()); + } catch (RealmException re) { + // Won't happen + } + } String s = p.getRealmString(); if (s == null) s = getRealm(); for (String n: p.getNameStrings()) { @@ -493,8 +518,6 @@ public class KDC { try { // Do not call EncryptionKey.acquireSecretKeys(), otherwise // the krb5.conf config file would be loaded. - Method stringToKey = EncryptionKey.class.getDeclaredMethod("stringToKey", char[].class, String.class, byte[].class, Integer.TYPE); - stringToKey.setAccessible(true); Integer kvno = null; // For service whose password ending with a number, use it as kvno. // Kvno must be postive. @@ -504,12 +527,9 @@ public class KDC { kvno = pass[pass.length-1] - '0'; } } - return new EncryptionKey((byte[]) stringToKey.invoke( - null, getPassword(p, server), getSalt(p), null, etype), + return new EncryptionKey(EncryptionKeyDotStringToKey( + getPassword(p, server), getSalt(p), null, etype), etype, kvno); - } catch (InvocationTargetException ex) { - KrbException ke = (KrbException)ex.getCause(); - throw ke; } catch (KrbException ke) { throw ke; } catch (Exception e) { @@ -517,7 +537,7 @@ public class KDC { } } - private Map policies = new HashMap(); + private Map policies = new HashMap<>(); public void setPolicy(String rule, String value) { if (value == null) { @@ -590,12 +610,11 @@ public class KDC { " sends TGS-REQ for " + tgsReq.reqBody.sname); KDCReqBody body = tgsReq.reqBody; - int etype = 0; + int[] eTypes = KDCReqBodyDotEType(body); + int e2 = eTypes[0]; // etype for outgoing session key + int e3 = eTypes[0]; // etype for outgoing ticket - // Reflection: PAData[] pas = tgsReq.pAData; - Field f = KDCReq.class.getDeclaredField("pAData"); - f.setAccessible(true); - PAData[] pas = (PAData[])f.get(tgsReq); + PAData[] pas = kDCReqDotPAData(tgsReq); Ticket tkt = null; EncTicketPart etp = null; @@ -607,9 +626,9 @@ public class KDC { APReq apReq = new APReq(pa.getValue()); EncryptedData ed = apReq.authenticator; tkt = apReq.ticket; - etype = tkt.encPart.getEType(); + int te = tkt.encPart.getEType(); tkt.sname.setRealm(tkt.realm); - EncryptionKey kkey = keyForUser(tkt.sname, etype, true); + EncryptionKey kkey = keyForUser(tkt.sname, te, true); byte[] bb = tkt.encPart.decrypt(kkey, KeyUsage.KU_TICKET); DerInputStream derIn = new DerInputStream(bb); DerValue der = derIn.getDerValue(); @@ -620,16 +639,12 @@ public class KDC { throw new KrbException(Krb5.KDC_ERR_PADATA_TYPE_NOSUPP); } } - EncryptionKey skey = keyForUser(body.sname, etype, true); - if (skey == null) { - throw new KrbException(Krb5.KDC_ERR_SUMTYPE_NOSUPP); // TODO - } // Session key for original ticket, TGT EncryptionKey ckey = etp.key; // Session key for session with the service - EncryptionKey key = generateRandomKey(etype); + EncryptionKey key = generateRandomKey(e2); // Check time, TODO KerberosTime till = body.till; @@ -678,6 +693,10 @@ public class KDC { till, body.rtime, body.addresses, null); + EncryptionKey skey = keyForUser(body.sname, e3, true); + if (skey == null) { + throw new KrbException(Krb5.KDC_ERR_SUMTYPE_NOSUPP); // TODO + } Ticket t = new Ticket( body.crealm, body.sname, @@ -741,17 +760,17 @@ public class KDC { private byte[] processAsReq(byte[] in) throws Exception { ASReq asReq = new ASReq(in); int[] eTypes = null; + List outPAs = new ArrayList<>(); + try { System.out.println(realm + "> " + asReq.reqBody.cname + " sends AS-REQ for " + asReq.reqBody.sname); KDCReqBody body = asReq.reqBody; + body.cname.setRealm(getRealm()); - // Reflection: int[] eType = body.eType; - Field f = KDCReqBody.class.getDeclaredField("eType"); - f.setAccessible(true); - eTypes = (int[])f.get(body); + eTypes = KDCReqBodyDotEType(body); int eType = eTypes[0]; EncryptionKey ckey = keyForUser(body.cname, eType, false); @@ -807,19 +826,63 @@ public class KDC { } bFlags[Krb5.TKT_OPTS_INITIAL] = true; - f = KDCReq.class.getDeclaredField("pAData"); - f.setAccessible(true); - PAData[] pas = (PAData[])f.get(asReq); - if (pas == null || pas.length == 0) { + // Creating PA-DATA + int[] epas = eTypes; + if (options.containsKey(KDC.Option.RC4_FIRST_PREAUTH)) { + for (int i=1; i ctor = EncryptedData.class.getDeclaredConstructor(DerValue.class); - ctor.setAccessible(true); - EncryptedData data = ctor.newInstance(new DerValue(pas[0].getValue())); + EncryptedData data = newEncryptedData(new DerValue(inPAs[0].getValue())); EncryptionKey pakey = keyForUser(body.cname, data.getEType(), false); data.decrypt(pakey, KeyUsage.KU_PA_ENC_TS); } catch (Exception e) { @@ -862,7 +925,8 @@ public class KDC { body.addresses ); EncryptedData edata = new EncryptedData(ckey, enc_part.asn1Encode(), KeyUsage.KU_ENC_AS_REP_PART); - ASRep asRep = new ASRep(null, + ASRep asRep = new ASRep( + outPAs.toArray(new PAData[outPAs.size()]), body.crealm, body.cname, t, @@ -907,36 +971,10 @@ public class KDC { if (kerr == null) { if (ke.returnCode() == Krb5.KDC_ERR_PREAUTH_REQUIRED || ke.returnCode() == Krb5.KDC_ERR_PREAUTH_FAILED) { - PAData pa; - - int epa = eTypes[0]; - if (options.containsKey(KDC.Option.ONLY_RC4_PREAUTH)) { - epa = EncryptedData.ETYPE_ARCFOUR_HMAC; - } - ETypeInfo2 ei2 = new ETypeInfo2(epa, null, null); - DerOutputStream eid = new DerOutputStream(); - eid.write(DerValue.tag_Sequence, ei2.asn1Encode()); - - pa = new PAData(Krb5.PA_ETYPE_INFO2, eid.toByteArray()); - DerOutputStream bytes = new DerOutputStream(); bytes.write(new PAData(Krb5.PA_ENC_TIMESTAMP, new byte[0]).asn1Encode()); - bytes.write(pa.asn1Encode()); - - boolean allOld = true; - for (int i: eTypes) { - if (i == EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96 || - i == EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96) { - allOld = false; - break; - } - } - if (allOld) { - ETypeInfo ei = new ETypeInfo(epa, null); - eid = new DerOutputStream(); - eid.write(DerValue.tag_Sequence, ei.asn1Encode()); - pa = new PAData(Krb5.PA_ETYPE_INFO, eid.toByteArray()); - bytes.write(pa.asn1Encode()); + for (PAData p: outPAs) { + bytes.write(p.asn1Encode()); } DerOutputStream temp = new DerOutputStream(); temp.write(DerValue.tag_Sequence, bytes); @@ -1146,4 +1184,61 @@ public class KDC { return "ns"; } } + + // Calling private methods thru reflections + private static final Field getPADataField; + private static final Field getEType; + private static final Constructor ctorEncryptedData; + private static final Method stringToKey; + + static { + try { + ctorEncryptedData = EncryptedData.class.getDeclaredConstructor(DerValue.class); + ctorEncryptedData.setAccessible(true); + getPADataField = KDCReq.class.getDeclaredField("pAData"); + getPADataField.setAccessible(true); + getEType = KDCReqBody.class.getDeclaredField("eType"); + getEType.setAccessible(true); + stringToKey = EncryptionKey.class.getDeclaredMethod( + "stringToKey", + char[].class, String.class, byte[].class, Integer.TYPE); + stringToKey.setAccessible(true); + } catch (NoSuchFieldException nsfe) { + throw new AssertionError(nsfe); + } catch (NoSuchMethodException nsme) { + throw new AssertionError(nsme); + } + } + private EncryptedData newEncryptedData(DerValue der) { + try { + return ctorEncryptedData.newInstance(der); + } catch (Exception e) { + throw new AssertionError(e); + } + } + private static PAData[] kDCReqDotPAData(KDCReq req) { + try { + return (PAData[])getPADataField.get(req); + } catch (Exception e) { + throw new AssertionError(e); + } + } + private static int[] KDCReqBodyDotEType(KDCReqBody body) { + try { + return (int[]) getEType.get(body); + } catch (Exception e) { + throw new AssertionError(e); + } + } + private static byte[] EncryptionKeyDotStringToKey(char[] password, String salt, + byte[] s2kparams, int keyType) throws KrbCryptoException { + try { + return (byte[])stringToKey.invoke( + null, password, salt, s2kparams, keyType); + } catch (InvocationTargetException ex) { + throw (KrbCryptoException)ex.getCause(); + } catch (Exception e) { + throw new AssertionError(e); + } + } } diff --git a/jdk/test/sun/security/krb5/auto/LoginModuleOptions.java b/jdk/test/sun/security/krb5/auto/LoginModuleOptions.java index 44c4a414d0d..f22f774316f 100644 --- a/jdk/test/sun/security/krb5/auto/LoginModuleOptions.java +++ b/jdk/test/sun/security/krb5/auto/LoginModuleOptions.java @@ -135,8 +135,8 @@ public class LoginModuleOptions { throws Exception { Krb5LoginModule krb5 = new Krb5LoginModule(); Subject subject = new Subject(); - Map map = new HashMap(); - Map shared = new HashMap(); + Map map = new HashMap<>(); + Map shared = new HashMap<>(); int count = options.length / 2; for (int i = 0; i < count; i++) { diff --git a/jdk/test/sun/security/krb5/auto/MoreKvno.java b/jdk/test/sun/security/krb5/auto/MoreKvno.java index bf5b7e6aada..84cfa362d0d 100644 --- a/jdk/test/sun/security/krb5/auto/MoreKvno.java +++ b/jdk/test/sun/security/krb5/auto/MoreKvno.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +48,9 @@ public class MoreKvno { KeyTab ktab = KeyTab.create(OneKDC.KTAB); p = new PrincipalName( OneKDC.SERVER+"@"+OneKDC.REALM, PrincipalName.KRB_NT_SRV_HST); - ktab.addEntry(p, "pass1".toCharArray(), 1); - ktab.addEntry(p, "pass3".toCharArray(), 3); - ktab.addEntry(p, "pass2".toCharArray(), 2); + ktab.addEntry(p, "pass1".toCharArray(), 1, true); + ktab.addEntry(p, "pass3".toCharArray(), 3, true); + ktab.addEntry(p, "pass2".toCharArray(), 2, true); ktab.save(); char[] pass = "pass2".toCharArray(); diff --git a/jdk/test/sun/security/krb5/auto/NewSalt.java b/jdk/test/sun/security/krb5/auto/NewSalt.java new file mode 100644 index 00000000000..54cc9562f37 --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/NewSalt.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6960894 + * @summary Better AS-REQ creation and processing + * @run main NewSalt + * @run main/othervm -Dnopreauth NewSalt + * @run main/othervm -Donlyonepreauth NewSalt + */ + +import sun.security.jgss.GSSUtil; +import sun.security.krb5.Config; + +public class NewSalt { + + public static void main(String[] args) + throws Exception { + + // Create and start the KDC + KDC kdc = new OneKDC(null); + if (System.getProperty("onlyonepreauth") != null) { + KDC.saveConfig(OneKDC.KRB5_CONF, kdc, + "default_tgs_enctypes=des3-cbc-sha1"); + Config.refresh(); + kdc.setOption(KDC.Option.ONLY_ONE_PREAUTH, true); + } + if (System.getProperty("nopreauth") != null) { + kdc.setOption(KDC.Option.PREAUTH_REQUIRED, false); + } + + // Use a different case of name. KDC will return correct salt + Context c1 = Context.fromUserPass(OneKDC.USER.toUpperCase(), + OneKDC.PASS, true); + Context c2 = Context.fromUserPass(OneKDC.USER2.toUpperCase(), + OneKDC.PASS2, true); + + c1.startAsClient(OneKDC.USER2, GSSUtil.GSS_KRB5_MECH_OID); + c2.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); + + Context.handshake(c1, c2); + } +} diff --git a/jdk/test/sun/security/krb5/auto/OneKDC.java b/jdk/test/sun/security/krb5/auto/OneKDC.java index 538ab3f32c8..79a883017e3 100644 --- a/jdk/test/sun/security/krb5/auto/OneKDC.java +++ b/jdk/test/sun/security/krb5/auto/OneKDC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,6 +46,8 @@ public class OneKDC extends KDC { public static final String USER = "dummy"; public static final char[] PASS = "bogus".toCharArray(); + public static final String USER2 = "foo"; + public static final char[] PASS2 = "bar".toCharArray(); public static final String KRB5_CONF = "localkdc-krb5.conf"; public static final String KTAB = "localkdc.ktab"; public static final String JAAS_CONF = "localkdc-jaas.conf"; @@ -61,6 +63,7 @@ public class OneKDC extends KDC { public OneKDC(String etype) throws Exception { super(REALM, KDCHOST, 0, true); addPrincipal(USER, PASS); + addPrincipal(USER2, PASS2); addPrincipalRandKey("krbtgt/" + REALM); addPrincipalRandKey(SERVER); addPrincipalRandKey(BACKEND); diff --git a/jdk/test/sun/security/krb5/auto/SSL.java b/jdk/test/sun/security/krb5/auto/SSL.java index 08ceaca8498..1deae8e6f16 100644 --- a/jdk/test/sun/security/krb5/auto/SSL.java +++ b/jdk/test/sun/security/krb5/auto/SSL.java @@ -74,9 +74,9 @@ public class SSL { KeyTab ktab = KeyTab.create(OneKDC.KTAB); PrincipalName service = new PrincipalName( "host/" + server, PrincipalName.KRB_NT_SRV_HST); - ktab.addEntry(service, "pass1".toCharArray(), 1); - ktab.addEntry(service, "pass2".toCharArray(), 2); - ktab.addEntry(service, "pass3".toCharArray(), 3); + ktab.addEntry(service, "pass1".toCharArray(), 1, true); + ktab.addEntry(service, "pass2".toCharArray(), 2, true); + ktab.addEntry(service, "pass3".toCharArray(), 3, true); ktab.save(); // and use the middle one as the real key diff --git a/jdk/test/sun/security/krb5/auto/TcpTimeout.java b/jdk/test/sun/security/krb5/auto/TcpTimeout.java new file mode 100644 index 00000000000..9530803b5b2 --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/TcpTimeout.java @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6952519 + * @run main/timeout=40/othervm TcpTimeout + * @summary kdc_timeout is not being honoured when using TCP + */ + +import java.io.*; +import java.net.ServerSocket; +import sun.security.krb5.Config; + +public class TcpTimeout { + public static void main(String[] args) + throws Exception { + + System.setProperty("sun.security.krb5.debug", "true"); + final int p1 = 10000 + new java.util.Random().nextInt(10000); + final int p2 = 20000 + new java.util.Random().nextInt(10000); + final int p3 = 30000 + new java.util.Random().nextInt(10000); + + KDC k = new KDC(OneKDC.REALM, OneKDC.KDCHOST, p3, true); + k.addPrincipal(OneKDC.USER, OneKDC.PASS); + k.addPrincipalRandKey("krbtgt/" + OneKDC.REALM); + + // Start two listener that does not communicate, simulate timeout + new Thread() { + public void run() { + try { + new ServerSocket(p1).accept(); + } catch (Exception e) { + }} + }.start(); + new Thread() { + public void run() { + try { + new ServerSocket(p2).accept(); + } catch (Exception e) { + }} + }.start(); + + FileWriter fw = new FileWriter("alternative-krb5.conf"); + + fw.write("[libdefaults]\n" + + "udp_preference_limit = 1\n" + + "max_retries = 2\n" + + "default_realm = " + OneKDC.REALM + "\n" + + "kdc_timeout = 5000\n"); + fw.write("[realms]\n" + OneKDC.REALM + " = {\n" + + "kdc = " + OneKDC.KDCHOST + ":" + p1 + "\n" + + "kdc = " + OneKDC.KDCHOST + ":" + p2 + "\n" + + "kdc = " + OneKDC.KDCHOST + ":" + p3 + "\n" + + "}\n"); + + fw.close(); + System.setProperty("java.security.krb5.conf", "alternative-krb5.conf"); + Config.refresh(); + + // The correct behavior should be: + // 5 sec on p1, 5 sec on p1, fail + // 5 sec on p2, 5 sec on p2, fail + // p3 ok, p3 ok again for preauth. + // The total time should be 20sec + 2x. x is processing time for AS-REQ. + int count = 6; + long start = System.nanoTime(); + + ByteArrayOutputStream bo = new ByteArrayOutputStream(); + PrintStream oldout = System.out; + System.setOut(new PrintStream(bo)); + Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); + System.setOut(oldout); + + String[] lines = new String(bo.toByteArray()).split("\n"); + for (String line: lines) { + if (line.startsWith(">>> KDCCommunication")) { + System.out.println(line); + count--; + } + } + if (count != 0) { + throw new Exception("Retry count is " + count + " less"); + } + + long end = System.nanoTime(); + if ((end - start)/1000000000L < 20) { + throw new Exception("Too fast? " + (end - start)/1000000000L); + } + } + + private static KDC on(int p) throws Exception { + KDC k = new KDC(OneKDC.REALM, OneKDC.KDCHOST, p, true); + k.addPrincipal(OneKDC.USER, OneKDC.PASS); + k.addPrincipalRandKey("krbtgt/" + OneKDC.REALM); + return k; + } + + private static void addFakeKDCs() + throws Exception { + BufferedReader fr = new BufferedReader(new FileReader(OneKDC.KRB5_CONF)); + FileWriter fw = new FileWriter("alternative-krb5.conf"); + while (true) { + String s = fr.readLine(); + if (s == null) { + break; + } + if (s.trim().startsWith("kdc = ")) { + fw.write(" kdc = localhost:33333\n"); + fw.write(" kdc = localhost:22222\n"); + } + fw.write(s + "\n"); + } + fr.close(); + fw.close(); + sun.security.krb5.Config.refresh(); + } +} diff --git a/jdk/test/sun/security/krb5/auto/W83.java b/jdk/test/sun/security/krb5/auto/W83.java index a0951cad289..5c5e9af5cb3 100644 --- a/jdk/test/sun/security/krb5/auto/W83.java +++ b/jdk/test/sun/security/krb5/auto/W83.java @@ -26,6 +26,8 @@ * @bug 6932525 6951366 6959292 * @summary kerberos login failure on win2008 with AD set to win2000 compat mode * and cannot login if session key and preauth does not use the same etype + * @run main/othervm -D6932525 W83 + * @run main/othervm -D6959292 W83 */ import com.sun.security.auth.module.Krb5LoginModule; import java.io.File; @@ -56,19 +58,21 @@ public class W83 { KeyTab ktab = KeyTab.getInstance(OneKDC.KTAB); for (int etype: EType.getBuiltInDefaults()) { if (etype != EncryptedData.ETYPE_ARCFOUR_HMAC) { - ktab.deleteEntry(new PrincipalName(OneKDC.USER), etype); + ktab.deleteEntries(new PrincipalName(OneKDC.USER), etype, -1); } } ktab.save(); - // For 6932525 and 6951366, make sure the etypes sent in 2nd AS-REQ - // is not restricted to that of preauth - kdc.setOption(KDC.Option.ONLY_RC4_TGT, true); - x.go(); - - // For 6959292, make sure that when etype for enc-part in 2nd AS-REQ - // is different from that of preauth, client can still decrypt it - kdc.setOption(KDC.Option.ONLY_RC4_PREAUTH, true); + if (System.getProperty("6932525") != null) { + // For 6932525 and 6951366, make sure the etypes sent in 2nd AS-REQ + // is not restricted to that of preauth + kdc.setOption(KDC.Option.ONLY_RC4_TGT, true); + } + if (System.getProperty("6959292") != null) { + // For 6959292, make sure that when etype for enc-part in 2nd AS-REQ + // is different from that of preauth, client can still decrypt it + kdc.setOption(KDC.Option.RC4_FIRST_PREAUTH, true); + } x.go(); } @@ -78,11 +82,13 @@ public class W83 { try { Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); } catch (Exception e) { + e.printStackTrace(); error.append("Krb5LoginModule password login error\n"); } try { Context.fromUserKtab(OneKDC.USER, OneKDC.KTAB, false); } catch (Exception e) { + e.printStackTrace(); error.append("Krb5LoginModule keytab login error\n"); } try { diff --git a/jdk/test/sun/security/krb5/ktab/KeyTabIndex.java b/jdk/test/sun/security/krb5/ktab/KeyTabIndex.java index feb9566373e..f0cd88e6a65 100644 --- a/jdk/test/sun/security/krb5/ktab/KeyTabIndex.java +++ b/jdk/test/sun/security/krb5/ktab/KeyTabIndex.java @@ -35,8 +35,8 @@ public class KeyTabIndex { // observice the abnormal change of "index" field. kt.addEntry(new PrincipalName( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@A"), - "x".toCharArray(), 1); - kt.addEntry(new PrincipalName("a@A"), "x".toCharArray(), 1); + "x".toCharArray(), 1, true); + kt.addEntry(new PrincipalName("a@A"), "x".toCharArray(), 1, true); kt.save(); Runnable t = new Runnable() { @Override diff --git a/jdk/test/sun/security/krb5/tools/KtabCheck.java b/jdk/test/sun/security/krb5/tools/KtabCheck.java new file mode 100644 index 00000000000..e82b83ac740 --- /dev/null +++ b/jdk/test/sun/security/krb5/tools/KtabCheck.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import sun.security.krb5.internal.ktab.KeyTab; +import sun.security.krb5.internal.ktab.KeyTabEntry; + +/** + * This class is called by the test ktcheck.sh and is not meant to run + * by itself. + */ +public class KtabCheck { + /** + * Checks if a keytab contains exactly the keys (kvno and etype) + * @param args keytabname kvno etype... + */ + public static void main(String[] args) throws Exception { + System.out.println("Checking " + Arrays.toString(args)); + KeyTab ktab = KeyTab.getInstance(args[0]); + Set expected = new HashSet<>(); + for (int i=1; i /dev/null +KTAB="${TESTJAVA}${FS}bin${FS}ktab -k $KEYTAB" -$J || exit 100 -$J des-cbc-crc || exit 1 -$J des-cbc-md5 || exit 3 -$J des3-cbc-sha1 || exit 16 -$J aes128-cts || exit 17 -$J aes256-cts || exit 18 -$J rc4-hmac || exit 23 +$KTAB -a me@LOCAL mine || exit 1 + +$KTAB -hello +if [ $? = 0 ]; then exit 2; fi + +$KTAB +if [ $? = 0 ]; then exit 3; fi exit 0 diff --git a/jdk/test/sun/security/krb5/tools/ktcheck.sh b/jdk/test/sun/security/krb5/tools/ktcheck.sh new file mode 100644 index 00000000000..383de8fc4f9 --- /dev/null +++ b/jdk/test/sun/security/krb5/tools/ktcheck.sh @@ -0,0 +1,94 @@ +# +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# @test +# @bug 6950546 +# @summary "ktab -d name etype" to "ktab -d name [-e etype] [kvno | all | old]" +# @run shell ktcheck.sh +# + +if [ "${TESTJAVA}" = "" ] ; then + JAVAC_CMD=`which javac` + TESTJAVA=`dirname $JAVAC_CMD`/.. +fi + +if [ "${TESTSRC}" = "" ] ; then + TESTSRC="." +fi + +OS=`uname -s` +case "$OS" in + CYGWIN* ) + FS="/" + ;; + Windows_* ) + FS="\\" + ;; + * ) + FS="/" + echo "Unsupported system!" + exit 0; + ;; +esac + +KEYTAB=ktab.tmp + +rm $KEYTAB +${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}KtabCheck.java + +EXTRA_OPTIONS="-Djava.security.krb5.conf=${TESTSRC}${FS}onlythree.conf" +KTAB="${TESTJAVA}${FS}bin${FS}ktab -J${EXTRA_OPTIONS} -k $KEYTAB -f" +CHECK="${TESTJAVA}${FS}bin${FS}java ${EXTRA_OPTIONS} KtabCheck $KEYTAB" + +echo ${EXTRA_OPTIONS} + +$KTAB -a me mine +$CHECK 1 16 1 23 1 17 || exit 1 +$KTAB -a me mine -n 0 +$CHECK 0 16 0 23 0 17 || exit 1 +$KTAB -a me mine -n 1 -append +$CHECK 0 16 0 23 0 17 1 16 1 23 1 17 || exit 1 +$KTAB -a me mine -append +$CHECK 0 16 0 23 0 17 1 16 1 23 1 17 2 16 2 23 2 17 || exit 1 +$KTAB -a me mine +$CHECK 3 16 3 23 3 17 || exit 1 +$KTAB -a me mine -n 4 -append +$CHECK 3 16 3 23 3 17 4 16 4 23 4 17 || exit 1 +$KTAB -a me mine -n 5 -append +$CHECK 3 16 3 23 3 17 4 16 4 23 4 17 5 16 5 23 5 17 || exit 1 +$KTAB -a me mine -n 6 -append +$CHECK 3 16 3 23 3 17 4 16 4 23 4 17 5 16 5 23 5 17 6 16 6 23 6 17 || exit 1 +$KTAB -d me 3 +$CHECK 4 16 4 23 4 17 5 16 5 23 5 17 6 16 6 23 6 17 || exit 1 +$KTAB -d me -e 16 6 +$CHECK 4 16 4 23 4 17 5 16 5 23 5 17 6 23 6 17 || exit 1 +$KTAB -d me -e 17 6 +$CHECK 4 16 4 23 4 17 5 16 5 23 5 17 6 23 || exit 1 +$KTAB -d me -e 16 5 +$CHECK 4 16 4 23 4 17 5 23 5 17 6 23 || exit 1 +$KTAB -d me old +$CHECK 4 16 5 17 6 23 || exit 1 +$KTAB -d me old +$CHECK 4 16 5 17 6 23 || exit 1 +$KTAB -d me +$CHECK || exit 1 diff --git a/jdk/test/sun/security/krb5/tools/onlythree.conf b/jdk/test/sun/security/krb5/tools/onlythree.conf new file mode 100644 index 00000000000..9b26a04dc46 --- /dev/null +++ b/jdk/test/sun/security/krb5/tools/onlythree.conf @@ -0,0 +1,9 @@ +[libdefaults] +default_realm = LOCAL.COM +default_tkt_enctypes = des3-cbc-sha1 rc4-hmac aes128-cts + +[realms] +LOCAL.COM = { + kdc = localhost +} + diff --git a/jdk/test/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java b/jdk/test/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java new file mode 100644 index 00000000000..f0721daa2e5 --- /dev/null +++ b/jdk/test/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6687725 + * @summary Test internal PKCS5Padding impl with various error conditions. + * @author Valerie Peng + * @library .. + */ +import java.io.*; +import java.nio.*; +import java.util.*; + +import java.security.*; +import java.security.spec.AlgorithmParameterSpec; + +import javax.crypto.*; +import javax.crypto.spec.IvParameterSpec; + +public class TestPKCS5PaddingError extends PKCS11Test { + private static class CI { // class for holding Cipher Information + String transformation; + String keyAlgo; + + CI(String transformation, String keyAlgo) { + this.transformation = transformation; + this.keyAlgo = keyAlgo; + } + } + + private static final CI[] TEST_LIST = { + // algorithms which use the native padding impl + new CI("DES/CBC/PKCS5Padding", "DES"), + new CI("DESede/CBC/PKCS5Padding", "DESede"), + new CI("AES/CBC/PKCS5Padding", "AES"), + // algorithms which use SunPKCS11's own padding impl + new CI("DES/ECB/PKCS5Padding", "DES"), + new CI("DESede/ECB/PKCS5Padding", "DESede"), + new CI("AES/ECB/PKCS5Padding", "AES"), + }; + + private static StringBuffer debugBuf = new StringBuffer(); + + public void main(Provider p) throws Exception { + boolean status = true; + Random random = new Random(); + + try { + byte[] plainText = new byte[200]; + + for (int i = 0; i < TEST_LIST.length; i++) { + CI currTest = TEST_LIST[i]; + System.out.println("===" + currTest.transformation + "==="); + try { + KeyGenerator kg = + KeyGenerator.getInstance(currTest.keyAlgo, p); + SecretKey key = kg.generateKey(); + Cipher c1 = Cipher.getInstance(currTest.transformation, + "SunJCE"); + c1.init(Cipher.ENCRYPT_MODE, key); + byte[] cipherText = c1.doFinal(plainText); + AlgorithmParameters params = c1.getParameters(); + Cipher c2 = Cipher.getInstance(currTest.transformation, p); + c2.init(Cipher.DECRYPT_MODE, key, params); + + // 1st test: wrong output length + // NOTE: Skip NSS since it reports CKR_DEVICE_ERROR when + // the data passed to its EncryptUpdate/DecryptUpdate is + // not multiple of blocks + if (!p.getName().equals("SunPKCS11-NSS")) { + try { + System.out.println("Testing with wrong cipherText length"); + c2.doFinal(cipherText, 0, cipherText.length - 2); + } catch (IllegalBlockSizeException ibe) { + // expected + } catch (Exception ex) { + System.out.println("Error: Unexpected Ex " + ex); + ex.printStackTrace(); + } + } + // 2nd test: wrong padding value + try { + System.out.println("Testing with wrong padding bytes"); + cipherText[cipherText.length - 1]++; + c2.doFinal(cipherText); + } catch (BadPaddingException bpe) { + // expected + } catch (Exception ex) { + System.out.println("Error: Unexpected Ex " + ex); + ex.printStackTrace(); + } + System.out.println("DONE"); + } catch (NoSuchAlgorithmException nsae) { + System.out.println("Skipping unsupported algorithm: " + + nsae); + } + } + } catch (Exception ex) { + // print out debug info when exception is encountered + if (debugBuf != null) { + System.out.println(debugBuf.toString()); + debugBuf = new StringBuffer(); + } + throw ex; + } + } + + public static void main(String[] args) throws Exception { + main(new TestPKCS5PaddingError()); + } +} diff --git a/jdk/test/sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java b/jdk/test/sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java index 0c79da6826f..3bd7e96f117 100644 --- a/jdk/test/sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java +++ b/jdk/test/sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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 4917233 6461727 6490213 + * @bug 4917233 6461727 6490213 6720456 * @summary test the KeyGenerator * @author Andreas Sterbenz * @library .. @@ -104,7 +104,7 @@ public class TestKeyGenerator extends PKCS11Test { // Different PKCS11 impls have different ranges // of supported key sizes for variable-key-length // algorithms. - // Solaris> Blowfish: 32-128 bits, RC4: 8-128 bits + // Solaris> Blowfish: 32-128 or even 448 bits, RC4: 8-128 bits or as much as 2048 bits // NSS> Blowfish: n/a, RC4: 8-2048 bits // However, we explicitly disallowed key sizes less // than 40-bits. @@ -114,8 +114,8 @@ public class TestKeyGenerator extends PKCS11Test { test("Blowfish", 32, p, TestResult.FAIL); test("Blowfish", 40, p, TestResult.PASS); test("Blowfish", 128, p, TestResult.PASS); - test("Blowfish", 136, p, TestResult.FAIL); - test("Blowfish", 448, p, TestResult.FAIL); + test("Blowfish", 136, p, TestResult.TBD); + test("Blowfish", 448, p, TestResult.TBD); test("Blowfish", 456, p, TestResult.FAIL); test("ARCFOUR", 0, p, TestResult.FAIL); @@ -124,7 +124,7 @@ public class TestKeyGenerator extends PKCS11Test { test("ARCFOUR", 128, p, TestResult.PASS); if (p.getName().equals("SunPKCS11-Solaris")) { - test("ARCFOUR", 1024, p, TestResult.FAIL); + test("ARCFOUR", 1024, p, TestResult.TBD); } else if (p.getName().equals("SunPKCS11-NSS")) { test("ARCFOUR", 1024, p, TestResult.PASS); test("ARCFOUR", 2048, p, TestResult.PASS); diff --git a/jdk/test/sun/security/pkcs11/Provider/ConfigShortPath.java b/jdk/test/sun/security/pkcs11/Provider/ConfigShortPath.java new file mode 100644 index 00000000000..daa1ab3c1bf --- /dev/null +++ b/jdk/test/sun/security/pkcs11/Provider/ConfigShortPath.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/** + * @test + * @bug 6581254 + * @summary Allow "~" in config to support windows short path + * @author Valerie Peng + */ + +import java.security.*; +import java.io.*; + +public class ConfigShortPath { + + public static void main(String[] args) { + String testSrc = System.getProperty("test.src", "."); + String configFile = testSrc + File.separator + "csp.cfg"; + System.out.println("Testing against " + configFile); + try { + Provider p = new sun.security.pkcs11.SunPKCS11(configFile); + } catch (ProviderException pe) { + String cause = pe.getCause().getMessage(); + if (cause.indexOf("Unexpected token") != -1) { + // re-throw to indicate test failure + throw pe; + } + } + } +} diff --git a/jdk/test/sun/security/pkcs11/Provider/csp.cfg b/jdk/test/sun/security/pkcs11/Provider/csp.cfg new file mode 100644 index 00000000000..9cd8962a7b4 --- /dev/null +++ b/jdk/test/sun/security/pkcs11/Provider/csp.cfg @@ -0,0 +1,4 @@ +showInfo = false +name = NSSTrust +nssSecmodDirectory = C:/DOCUME~1/dtftest/LOCALS~1/Temp/Work/exec/jsn_7.0_int-7.0_nightly_sec_win_32_part2-2007-07-16-09-06-04-0209/dtftest.Windows_2003.x86/NSS//db +nssLibraryDirectory = Y:/xml/CC_DTF/knight_ws/suites/jsn_7.0_int/security/tools/lib/nss/WINNT/ diff --git a/jdk/test/sun/security/pkcs11/fips/CipherTest.java b/jdk/test/sun/security/pkcs11/fips/CipherTest.java index ea99884a4c7..3736aa07d08 100644 --- a/jdk/test/sun/security/pkcs11/fips/CipherTest.java +++ b/jdk/test/sun/security/pkcs11/fips/CipherTest.java @@ -119,6 +119,13 @@ public class CipherTest { return false; } + // ignore exportable cipher suite for TLSv1.1 + if (protocol.equals("TLSv1.1")) { + if(cipherSuite.indexOf("_EXPORT_") != -1) { + return false; + } + } + return true; } @@ -149,18 +156,14 @@ public class CipherTest { cipherSuites.length * protocols.length * clientAuths.length); for (int i = 0; i < cipherSuites.length; i++) { String cipherSuite = cipherSuites[i]; - if (peerFactory.isSupported(cipherSuite) == false) { - continue; - } - // skip kerberos cipher suites - if (cipherSuite.startsWith("TLS_KRB5")) { - continue; - } + for (int j = 0; j < protocols.length; j++) { String protocol = protocols[j]; - if (protocol.equals("SSLv2Hello")) { + + if (!peerFactory.isSupported(cipherSuite, protocol)) { continue; } + for (int k = 0; k < clientAuths.length; k++) { String clientAuth = clientAuths[k]; if ((clientAuth != null) && @@ -293,11 +296,12 @@ public class CipherTest { return ks; } - public static void main(PeerFactory peerFactory, KeyStore keyStore, String[] args) - throws Exception { + public static void main(PeerFactory peerFactory, KeyStore keyStore, + String[] args) throws Exception { + long time = System.currentTimeMillis(); String relPath; - if ((args.length > 0) && args[0].equals("sh")) { + if ((args != null) && (args.length > 0) && args[0].equals("sh")) { relPath = pathToStoresSH; } else { relPath = pathToStores; @@ -345,7 +349,30 @@ public class CipherTest { abstract Server newServer(CipherTest cipherTest) throws Exception; - boolean isSupported(String cipherSuite) { + boolean isSupported(String cipherSuite, String protocol) { + // skip kerberos cipher suites + if (cipherSuite.startsWith("TLS_KRB5")) { + System.out.println("Skipping unsupported test for " + + cipherSuite + " of " + protocol); + return false; + } + + // skip SSLv2Hello protocol + if (protocol.equals("SSLv2Hello")) { + System.out.println("Skipping unsupported test for " + + cipherSuite + " of " + protocol); + return false; + } + + // ignore exportable cipher suite for TLSv1.1 + if (protocol.equals("TLSv1.1")) { + if (cipherSuite.indexOf("_EXPORT_WITH") != -1) { + System.out.println("Skipping obsoleted test for " + + cipherSuite + " of " + protocol); + return false; + } + } + return true; } } diff --git a/jdk/test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java b/jdk/test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java index 486a1b09be7..5362f59071e 100644 --- a/jdk/test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java +++ b/jdk/test/sun/security/pkcs11/fips/ClientJSSEServerJSSE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @test * @bug 6313675 6323647 * @summary Verify that all ciphersuites work in FIPS mode + * @ignore JSSE supported cipher suites are changed with CR 6916074, + * need to update this test case in JDK 7 soon * @author Andreas Sterbenz * @library .. */ diff --git a/jdk/test/sun/security/pkcs11/sslecc/CipherTest.java b/jdk/test/sun/security/pkcs11/sslecc/CipherTest.java index 34ed0eeb9d7..09ab1c66ffb 100644 --- a/jdk/test/sun/security/pkcs11/sslecc/CipherTest.java +++ b/jdk/test/sun/security/pkcs11/sslecc/CipherTest.java @@ -119,6 +119,13 @@ public class CipherTest { return false; } + // ignore exportable cipher suite for TLSv1.1 + if (protocol.equals("TLSv1.1")) { + if(cipherSuite.indexOf("_EXPORT_") != -1) { + return false; + } + } + return true; } @@ -148,18 +155,14 @@ public class CipherTest { cipherSuites.length * protocols.length * clientAuths.length); for (int i = 0; i < cipherSuites.length; i++) { String cipherSuite = cipherSuites[i]; - if (peerFactory.isSupported(cipherSuite) == false) { - continue; - } - // skip kerberos cipher suites - if (cipherSuite.startsWith("TLS_KRB5")) { - continue; - } + for (int j = 0; j < protocols.length; j++) { String protocol = protocols[j]; - if (protocol.equals("SSLv2Hello")) { + + if (!peerFactory.isSupported(cipherSuite, protocol)) { continue; } + for (int k = 0; k < clientAuths.length; k++) { String clientAuth = clientAuths[k]; if ((clientAuth != null) && @@ -275,7 +278,6 @@ public class CipherTest { // for some reason, ${test.src} has a different value when the // test is called from the script and when it is called directly... -// static String pathToStores = "../../etc"; static String pathToStores = "."; static String pathToStoresSH = "."; static String keyStoreFile = "keystore"; @@ -336,7 +338,30 @@ public class CipherTest { abstract Server newServer(CipherTest cipherTest) throws Exception; - boolean isSupported(String cipherSuite) { + boolean isSupported(String cipherSuite, String protocol) { + // skip kerberos cipher suites + if (cipherSuite.startsWith("TLS_KRB5")) { + System.out.println("Skipping unsupported test for " + + cipherSuite + " of " + protocol); + return false; + } + + // skip SSLv2Hello protocol + if (protocol.equals("SSLv2Hello")) { + System.out.println("Skipping unsupported test for " + + cipherSuite + " of " + protocol); + return false; + } + + // ignore exportable cipher suite for TLSv1.1 + if (protocol.equals("TLSv1.1")) { + if (cipherSuite.indexOf("_EXPORT_WITH") != -1) { + System.out.println("Skipping obsoleted test for " + + cipherSuite + " of " + protocol); + return false; + } + } + return true; } } diff --git a/jdk/test/sun/security/pkcs11/tls/TestKeyMaterial.java b/jdk/test/sun/security/pkcs11/tls/TestKeyMaterial.java index f8e79b33f17..e32f6c3c19f 100644 --- a/jdk/test/sun/security/pkcs11/tls/TestKeyMaterial.java +++ b/jdk/test/sun/security/pkcs11/tls/TestKeyMaterial.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,16 +125,23 @@ public class TestKeyMaterial extends PKCS11Test { System.out.print("."); n++; - KeyGenerator kg = KeyGenerator.getInstance("SunTlsKeyMaterial", provider); - SecretKey masterKey = new SecretKeySpec(master, "TlsMasterSecret"); - TlsKeyMaterialParameterSpec spec = new TlsKeyMaterialParameterSpec - (masterKey, major, minor, clientRandom, serverRandom, cipherAlgorithm, - keyLength, expandedKeyLength, ivLength, macLength); + KeyGenerator kg = + KeyGenerator.getInstance("SunTlsKeyMaterial", provider); + SecretKey masterKey = + new SecretKeySpec(master, "TlsMasterSecret"); + TlsKeyMaterialParameterSpec spec = + new TlsKeyMaterialParameterSpec(masterKey, major, minor, + clientRandom, serverRandom, cipherAlgorithm, + keyLength, expandedKeyLength, ivLength, macLength, + null, -1, -1); kg.init(spec); - TlsKeyMaterialSpec result = (TlsKeyMaterialSpec)kg.generateKey(); - match(lineNumber, clientCipherBytes, result.getClientCipherKey(), cipherAlgorithm); - match(lineNumber, serverCipherBytes, result.getServerCipherKey(), cipherAlgorithm); + TlsKeyMaterialSpec result = + (TlsKeyMaterialSpec)kg.generateKey(); + match(lineNumber, clientCipherBytes, + result.getClientCipherKey(), cipherAlgorithm); + match(lineNumber, serverCipherBytes, + result.getServerCipherKey(), cipherAlgorithm); match(lineNumber, clientIv, result.getClientIv(), ""); match(lineNumber, serverIv, result.getServerIv(), ""); match(lineNumber, clientMacBytes, result.getClientMacKey(), ""); @@ -158,7 +165,8 @@ public class TestKeyMaterial extends PKCS11Test { } } - private static void match(int lineNumber, byte[] out, Object res, String cipherAlgorithm) throws Exception { + private static void match(int lineNumber, byte[] out, Object res, + String cipherAlgorithm) throws Exception { if ((out == null) || (res == null)) { if (out != res) { throw new Exception("null mismatch line " + lineNumber); @@ -169,7 +177,8 @@ public class TestKeyMaterial extends PKCS11Test { byte[] b; if (res instanceof SecretKey) { b = ((SecretKey)res).getEncoded(); - if (cipherAlgorithm.equalsIgnoreCase("DES") || cipherAlgorithm.equalsIgnoreCase("DESede")) { + if (cipherAlgorithm.equalsIgnoreCase("DES") || + cipherAlgorithm.equalsIgnoreCase("DESede")) { // strip DES parity bits before comparision stripParity(out); stripParity(b); diff --git a/jdk/test/sun/security/pkcs11/tls/TestMasterSecret.java b/jdk/test/sun/security/pkcs11/tls/TestMasterSecret.java index b4c6369ac5c..e1fa4d984ca 100644 --- a/jdk/test/sun/security/pkcs11/tls/TestMasterSecret.java +++ b/jdk/test/sun/security/pkcs11/tls/TestMasterSecret.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -104,17 +104,22 @@ public class TestMasterSecret extends PKCS11Test { System.out.print("."); n++; - KeyGenerator kg = KeyGenerator.getInstance("SunTlsMasterSecret", provider); - SecretKey premasterKey = new SecretKeySpec(premaster, algorithm); - TlsMasterSecretParameterSpec spec = new TlsMasterSecretParameterSpec - (premasterKey, protoMajor, protoMinor, clientRandom, serverRandom); + KeyGenerator kg = + KeyGenerator.getInstance("SunTlsMasterSecret", provider); + SecretKey premasterKey = + new SecretKeySpec(premaster, algorithm); + TlsMasterSecretParameterSpec spec = + new TlsMasterSecretParameterSpec(premasterKey, + protoMajor, protoMinor, clientRandom, serverRandom, + null, -1, -1); kg.init(spec); TlsMasterSecret key = (TlsMasterSecret)kg.generateKey(); byte[] enc = key.getEncoded(); if (Arrays.equals(master, enc) == false) { throw new Exception("mismatch line: " + lineNumber); } - if ((preMajor != key.getMajorVersion()) || (preMinor != key.getMinorVersion())) { + if ((preMajor != key.getMajorVersion()) || + (preMinor != key.getMinorVersion())) { throw new Exception("version mismatch line: " + lineNumber); } } else { diff --git a/jdk/test/sun/security/pkcs11/tls/TestPRF.java b/jdk/test/sun/security/pkcs11/tls/TestPRF.java index 7ed40c441c0..60b12528277 100644 --- a/jdk/test/sun/security/pkcs11/tls/TestPRF.java +++ b/jdk/test/sun/security/pkcs11/tls/TestPRF.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -93,14 +93,17 @@ public class TestPRF extends PKCS11Test { System.out.print("."); n++; - KeyGenerator kg = KeyGenerator.getInstance("SunTlsPrf", provider); + KeyGenerator kg = + KeyGenerator.getInstance("SunTlsPrf", provider); SecretKey inKey; if (secret == null) { inKey = null; } else { inKey = new SecretKeySpec(secret, "Generic"); } - TlsPrfParameterSpec spec = new TlsPrfParameterSpec(inKey, label, seed, length); + TlsPrfParameterSpec spec = + new TlsPrfParameterSpec(inKey, label, seed, length, + null, -1, -1); SecretKey key; try { kg.init(spec); @@ -109,7 +112,8 @@ public class TestPRF extends PKCS11Test { if (secret == null) { // This fails on Solaris, but since we never call this // API for this case in JSSE, ignore the failure. - // (SunJSSE uses the CKM_TLS_KEY_AND_MAC_DERIVE mechanism) + // (SunJSSE uses the CKM_TLS_KEY_AND_MAC_DERIVE + // mechanism) System.out.print("X"); continue; } diff --git a/jdk/test/sun/security/pkcs11/tls/TestPremaster.java b/jdk/test/sun/security/pkcs11/tls/TestPremaster.java index 4d0851a3318..f7a51041ead 100644 --- a/jdk/test/sun/security/pkcs11/tls/TestPremaster.java +++ b/jdk/test/sun/security/pkcs11/tls/TestPremaster.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,8 @@ public class TestPremaster extends PKCS11Test { } public void main(Provider provider) throws Exception { - if (provider.getService("KeyGenerator", "SunTlsRsaPremasterSecret") == null) { + if (provider.getService( + "KeyGenerator", "SunTlsRsaPremasterSecret") == null) { System.out.println("Not supported by provider, skipping"); return; } @@ -66,7 +67,8 @@ public class TestPremaster extends PKCS11Test { System.out.println("Done."); } - private static void test(KeyGenerator kg, int major, int minor) throws Exception { + private static void test(KeyGenerator kg, int major, int minor) + throws Exception { kg.init(new TlsRsaPremasterSecretParameterSpec(major, minor)); SecretKey key = kg.generateKey(); @@ -75,7 +77,8 @@ public class TestPremaster extends PKCS11Test { throw new Exception("length: " + encoded.length); } if ((encoded[0] != major) || (encoded[1] != minor)) { - throw new Exception("version mismatch: " + encoded[0] + "." + encoded[1]); + throw new Exception("version mismatch: " + encoded[0] + + "." + encoded[1]); } System.out.println("OK: " + major + "." + minor); } diff --git a/jdk/test/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java b/jdk/test/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java new file mode 100644 index 00000000000..ba49c6564b7 --- /dev/null +++ b/jdk/test/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6998583 + * @summary NativeSeedGenerator is making 8192 byte read requests from + * entropy pool on each init. + * @run main SeedGeneratorChoice + * @run main/othervm -Djava.security.egd=file:/dev/random SeedGeneratorChoice + * @run main/othervm -Djava.security.egd=file:filename SeedGeneratorChoice + */ + +/* + * Side testcase introduced to ensure changes for 6998583 will always + * succeed in falling back to ThreadedSeedGenerator if issues are found + * with the native OS generator request. We should never see an exception + * causing exit. + * We should always fall back to the ThreadedSeedGenerator if exceptions + * are encountered with user defined source of entropy. + */ + +import java.security.SecureRandom; + +public class SeedGeneratorChoice { + + public static void main(String... arguments) throws Exception { + byte[] bytes; + SecureRandom prng = SecureRandom.getInstance("SHA1PRNG"); + bytes = prng.generateSeed(1); + } +} diff --git a/jdk/test/sun/security/rsa/InvalidBitString.java b/jdk/test/sun/security/rsa/InvalidBitString.java new file mode 100644 index 00000000000..be9e42ca544 --- /dev/null +++ b/jdk/test/sun/security/rsa/InvalidBitString.java @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @summary Validation of signatures succeed when it should fail + * @bug 6896700 + */ + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.security.cert.Certificate; +import java.security.cert.CertificateFactory; +import java.security.PublicKey; +import java.security.SignatureException; + +public class InvalidBitString { + + // Test cert for CN=CA + static String signerCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIIBtDCCAR2gAwIBAgIEemxRHjANBgkqhkiG9w0BAQUFADANMQswCQYDVQQDEwJDQTAeFw0xMDA2\n" + + "MDMwODA2MjlaFw0xMDA5MDEwODA2MjlaMA0xCzAJBgNVBAMTAkNBMIGfMA0GCSqGSIb3DQEBAQUA\n" + + "A4GNADCBiQKBgQCp2G7pGwMOw4oM7zFFeRKrByuPLNAXClGsh+itdRiOeUgEby6OB9IAgXm93086\n" + + "Z9dWCfRYbzJbDRSnUE7FS1iQsIRIeOEuFMIMogcBK+sOf364ONwMXsI4gtYVmxn4BaaajVWt6C/g\n" + + "FBGZQxp81aORDyUIrlCkMIxhZBSsNPIJYwIDAQABoyEwHzAdBgNVHQ4EFgQUKrvzNhJmdKoqq2li\n" + + "utCzKkwA1N0wDQYJKoZIhvcNAQEFBQADgYEAEIaegsW7fWWjXk4YOMlcl893vx6tnU8ThuQSjwGI\n" + + "rIs93sBYuY7lQIpQw8+XM89WT1XuBB6R2SsnxeW+gHtsU/EE6iJJAEMeCILwEGUL02blwHBQWmpa\n" + + "i3YeGXw+IFe/4OAysPT7ZRbUb7mPt37Ht6hIjain71ShR5anXIuawVE=\n" + + "-----END CERTIFICATE-----\n"; + // Test cert for CN=A, happens to have a zero at the beginning of signature + static String normalCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIIB1DCCAT2gAwIBAgIEae+u1TANBgkqhkiG9w0BAQUFADANMQswCQYDVQQDEwJDQTAeFw0xMDA2\n" + + "MDMwODA2NTNaFw0xMDA5MDEwODA2NTNaMAwxCjAIBgNVBAMTAUEwgZ8wDQYJKoZIhvcNAQEBBQAD\n" + + "gY0AMIGJAoGBAKZ7C6bC8AJmXIRNwuPJcgIPW1ygN3rE5PIKPAkeK/dYnPmUJNuiSxOFPJCrLMuL\n" + + "sweQh82Dq/viu+KBb27xVzJ4pK02fbcWdJDo7cIms0Wm+HckK5myA6xmqnpmPOjb/vWCLE6pN2Xg\n" + + "pJyrdeWV77eBvqE9OiCsMTP8WgHI9zLvAgMBAAGjQjBAMB0GA1UdDgQWBBTtIKqCHnL9QeFn+YrX\n" + + "+k00NUk9mjAfBgNVHSMEGDAWgBQqu/M2EmZ0qiqraWK60LMqTADU3TANBgkqhkiG9w0BAQUFAAOB\n" + + "gQAAOcQsEruDAY/z3eXJ7OtWSZlLC0yTVNVdUVNLQ58xNqPrmKNBXNpj/72N8xrTB++ApW+DLgLy\n" + + "cwGU5PVRtsYeiV6prUkpqUf62SQgwI4guAQy1ileeP1CNQJI3cHQExMAHvQT8fJtlD0WZD3nfesq\n" + + "mmQDOpoJLkmO/73Z7IibVA==\n" + + "-----END CERTIFICATE-----\n"; + // normalCertStr with an extra zero at the beginning of signature + static String longerCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIIB1TCCAT2gAwIBAgIEae+u1TANBgkqhkiG9w0BAQUFADANMQswCQYDVQQDEwJDQTAeFw0xMDA2\n" + + "MDMwODA2NTNaFw0xMDA5MDEwODA2NTNaMAwxCjAIBgNVBAMTAUEwgZ8wDQYJKoZIhvcNAQEBBQAD\n" + + "gY0AMIGJAoGBAKZ7C6bC8AJmXIRNwuPJcgIPW1ygN3rE5PIKPAkeK/dYnPmUJNuiSxOFPJCrLMuL\n" + + "sweQh82Dq/viu+KBb27xVzJ4pK02fbcWdJDo7cIms0Wm+HckK5myA6xmqnpmPOjb/vWCLE6pN2Xg\n" + + "pJyrdeWV77eBvqE9OiCsMTP8WgHI9zLvAgMBAAGjQjBAMB0GA1UdDgQWBBTtIKqCHnL9QeFn+YrX\n" + + "+k00NUk9mjAfBgNVHSMEGDAWgBQqu/M2EmZ0qiqraWK60LMqTADU3TANBgkqhkiG9w0BAQUFAAOB\n" + + "ggAAADnELBK7gwGP893lyezrVkmZSwtMk1TVXVFTS0OfMTaj65ijQVzaY/+9jfMa0wfvgKVvgy4C\n" + + "8nMBlOT1UbbGHoleqa1JKalH+tkkIMCOILgEMtYpXnj9QjUCSN3B0BMTAB70E/HybZQ9FmQ9533r\n" + + "KppkAzqaCS5Jjv+92eyIm1Q=\n" + + "-----END CERTIFICATE-----\n"; + // normalCertStr without the initial zero at the beginning of signature + static String shorterCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIIB0zCCAT2gAwIBAgIEae+u1TANBgkqhkiG9w0BAQUFADANMQswCQYDVQQDEwJDQTAeFw0xMDA2\n" + + "MDMwODA2NTNaFw0xMDA5MDEwODA2NTNaMAwxCjAIBgNVBAMTAUEwgZ8wDQYJKoZIhvcNAQEBBQAD\n" + + "gY0AMIGJAoGBAKZ7C6bC8AJmXIRNwuPJcgIPW1ygN3rE5PIKPAkeK/dYnPmUJNuiSxOFPJCrLMuL\n" + + "sweQh82Dq/viu+KBb27xVzJ4pK02fbcWdJDo7cIms0Wm+HckK5myA6xmqnpmPOjb/vWCLE6pN2Xg\n" + + "pJyrdeWV77eBvqE9OiCsMTP8WgHI9zLvAgMBAAGjQjBAMB0GA1UdDgQWBBTtIKqCHnL9QeFn+YrX\n" + + "+k00NUk9mjAfBgNVHSMEGDAWgBQqu/M2EmZ0qiqraWK60LMqTADU3TANBgkqhkiG9w0BAQUFAAOB\n" + + "gAA5xCwSu4MBj/Pd5cns61ZJmUsLTJNU1V1RU0tDnzE2o+uYo0Fc2mP/vY3zGtMH74Clb4MuAvJz\n" + + "AZTk9VG2xh6JXqmtSSmpR/rZJCDAjiC4BDLWKV54/UI1AkjdwdATEwAe9BPx8m2UPRZkPed96yqa\n" + + "ZAM6mgkuSY7/vdnsiJtU\n" + + "-----END CERTIFICATE-----\n"; + + public static void main(String args[]) throws Exception { + + Certificate signer = generate(signerCertStr); + + // the valid certificate + Certificate normal = generate(normalCertStr); + // the invalid certificate with extra signature bits + Certificate longer = generate(longerCertStr); + // the invalid certificate without enough signature bits + Certificate shorter = generate(shorterCertStr); + + if (!test(normal, signer, " normal", true) || + !test(longer, signer, " longer", false) || + !test(shorter, signer, "shorter", false)) { + throw new Exception("Test failed."); + } + } + + private static Certificate generate(String certStr) throws Exception { + InputStream is = null; + try { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + is = new ByteArrayInputStream(certStr.getBytes()); + return cf.generateCertificate(is); + } finally { + if (is != null) { + is.close(); + } + } + } + + private static boolean test(Certificate target, Certificate signer, + String title, boolean expected) throws Exception { + System.out.print("Checking " + title + ": expected: " + + (expected ? " verified" : "NOT verified")); + boolean actual; + try { + PublicKey pubKey = signer.getPublicKey(); + target.verify(pubKey); + actual = true; + } catch (SignatureException se) { + actual = false; + } + System.out.println(", actual: " + + (actual ? " verified" : "NOT verified")); + return actual == expected; + } + +} diff --git a/jdk/test/sun/security/rsa/TestKeyPairGenerator.java b/jdk/test/sun/security/rsa/TestKeyPairGenerator.java index 444d5ece291..88ab075bced 100644 --- a/jdk/test/sun/security/rsa/TestKeyPairGenerator.java +++ b/jdk/test/sun/security/rsa/TestKeyPairGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +85,12 @@ public class TestKeyPairGenerator { sig.initVerify(kp2.getPublic()); sig.update(data); // verify needs to return false and not throw an Exception - if (sig.verify(signature)) { - throw new Exception("verification unexpectedly succeeded"); + try { + if (sig.verify(signature)) { + throw new Exception("verification unexpectedly succeeded"); + } + } catch (SignatureException se) { + // Yet another kind of failure, OK. } } diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ClientModeClientAuth.java b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ClientModeClientAuth.java index 792e73ddbd0..11185afd2e1 100644 --- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ClientModeClientAuth.java +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ClientModeClientAuth.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ /* * @test * @bug 4390659 + * @run main/othervm -Djavax.net.debug=all ClientModeClientAuth * @summary setNeedClientAuth() isn't working after a handshaker is established * @author Brad Wetmore */ diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/ClientServer.java b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/ClientServer.java index 6884d5075c0..1c2eb6b1ce3 100644 --- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/ClientServer.java +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/ClientServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @test * @bug 4717766 * @summary 1.0.3 JsseX509TrustManager erroneously calls isClientTrusted() + * @ignore JSSE supports algorithm constraints with CR 6916074, + * need to update this test case in JDK 7 soon * @author Brad Wetmore * * This problem didn't exist in JSSE 1.4, only JSSE 1.0.3. However, diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/PKIXExtendedTM.java b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/PKIXExtendedTM.java new file mode 100644 index 00000000000..d29ef31ffee --- /dev/null +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/PKIXExtendedTM.java @@ -0,0 +1,882 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @bug 6916074 + * @summary Add support for TLS 1.2 + */ + +import java.net.*; +import java.util.*; +import java.io.*; +import javax.net.ssl.*; +import java.security.KeyStore; +import java.security.KeyFactory; +import java.security.cert.Certificate; +import java.security.cert.CertificateFactory; +import java.security.spec.*; +import java.security.interfaces.*; +import java.math.BigInteger; + + +/* + * Certificates and key used in the test. + * + * TLS server certificate: + * server private key: + * -----BEGIN RSA PRIVATE KEY----- + * Proc-Type: 4,ENCRYPTED + * DEK-Info: DES-EDE3-CBC,D9AE407F6D0E389A + * + * WPrA7TFol/cQCcp9oHnXWNpYlvRbbIcQj0m+RKT2Iuzfus+DHt3Zadf8nJpKfX2e + * h2rnhlzCN9M7djRDooZKDOPCsdBn51Au7HlZF3S3Opgo7D8XFM1a8t1Je4ke14oI + * nw6QKYsBblRziPnP2PZ0zvX24nOv7bbY8beynlJHGs00VWSFdoH2DS0aE1p6D+3n + * ptJuJ75dVfZFK4X7162APlNXevX8D6PEQpSiRw1rjjGGcnvQ4HdWk3BxDVDcCNJb + * Y1aGNRxsjTDvPi3R9Qx2M+W03QzEPx4SR3ZHVskeSJHaetM0TM/w/45Paq4GokXP + * ZeTnbEx1xmjkA7h+t4doLL4watx5F6yLsJzu8xB3lt/1EtmkYtLz1t7X4BetPAXz + * zS69X/VwhKfsOI3qXBWuL2oHPyhDmT1gcaUQwEPSV6ogHEEQEDXdiUS8heNK13KF + * TCQYFkETvV2BLxUhV1hypPzRQ6tUpJiAbD5KmoK2lD9slshG2QtvKQq0/bgkDY5J + * LhDHV2dtcZ3kDPkkZXpbcJQvoeH3d09C5sIsuTFo2zgNR6oETHUc5TzP6FY2YYRa + * QcK5HcmtsRRiXFm01ac+aMejJUIujjFt84SiKWT/73vC8AmY4tYcJBLjCg4XIxSH + * fdDFLL1YZENNO5ivlp8mdiHqcawx+36L7DrEZQ8RZt6cqST5t/+XTdM74s6k81GT + * pNsa82P2K2zmIUZ/DL2mKjW1vfRByw1NQFEBkN3vdyZxYfM/JyUzX4hbjXBEkh9Q + * QYrcwLKLjis2QzSvK04B3bvRzRb+4ocWiso8ZPAXAIxZFBWDpTMM2A== + * -----END RSA PRIVATE KEY----- + * + * -----BEGIN RSA PRIVATE KEY----- + * MIICXAIBAAKBgQClrFscN6LdmYktsnm4j9VIpecchBeNaZzGrG358h0fORna03Ie + * buxEzHCk3LoAMPagTz1UemFqzFfQCn+VKBg/mtmU8hvIJIh+/p0PPftXUwizIDPU + * PxdHFNHN6gjYDnVOr77M0uyvqXpJ38LZrLgkQJCmA1Yq0DAFQCxPq9l0iQIDAQAB + * AoGAbqcbg1E1mkR99uOJoNeQYKFOJyGiiXTMnXV1TseC4+PDfQBU7Dax35GcesBi + * CtapIpFKKS5D+ozY6b7ZT8ojxuQ/uHLPAvz0WDR3ds4iRF8tyu71Q1ZHcQsJa17y + * yO7UbkSSKn/Mp9Rb+/dKqftUGNXVFLqgHBOzN2s3We3bbbECQQDYBPKOg3hkaGHo + * OhpHKqtQ6EVkldihG/3i4WejRonelXN+HRh1KrB2HBx0M8D/qAzP1i3rNSlSHer4 + * 59YRTJnHAkEAxFX/sVYSn07BHv9Zhn6XXct/Cj43z/tKNbzlNbcxqQwQerw3IH51 + * 8UH2YOA+GD3lXbKp+MytoFLWv8zg4YT/LwJAfqan75Z1R6lLffRS49bIiq8jwE16 + * rTrUJ+kv8jKxMqc9B3vXkxpsS1M/+4E8bqgAmvpgAb8xcsvHsBd9ErdukQJBAKs2 + * j67W75BrPjBI34pQ1LEfp56IGWXOrq1kF8IbCjxv3+MYRT6Z6UJFkpRymNPNDjsC + * dgUYgITiGJHUGXuw3lMCQHEHqo9ZtXz92yFT+VhsNc29B8m/sqUJdtCcMd/jGpAF + * u6GHufjqIZBpQsk63wbwESAPZZ+kk1O1kS5GIRLX608= + * -----END RSA PRIVATE KEY----- + * + * Private-Key: (1024 bit) + * modulus: + * 00:a5:ac:5b:1c:37:a2:dd:99:89:2d:b2:79:b8:8f: + * d5:48:a5:e7:1c:84:17:8d:69:9c:c6:ac:6d:f9:f2: + * 1d:1f:39:19:da:d3:72:1e:6e:ec:44:cc:70:a4:dc: + * ba:00:30:f6:a0:4f:3d:54:7a:61:6a:cc:57:d0:0a: + * 7f:95:28:18:3f:9a:d9:94:f2:1b:c8:24:88:7e:fe: + * 9d:0f:3d:fb:57:53:08:b3:20:33:d4:3f:17:47:14: + * d1:cd:ea:08:d8:0e:75:4e:af:be:cc:d2:ec:af:a9: + * 7a:49:df:c2:d9:ac:b8:24:40:90:a6:03:56:2a:d0: + * 30:05:40:2c:4f:ab:d9:74:89 + * publicExponent: 65537 (0x10001) + * privateExponent: + * 6e:a7:1b:83:51:35:9a:44:7d:f6:e3:89:a0:d7:90: + * 60:a1:4e:27:21:a2:89:74:cc:9d:75:75:4e:c7:82: + * e3:e3:c3:7d:00:54:ec:36:b1:df:91:9c:7a:c0:62: + * 0a:d6:a9:22:91:4a:29:2e:43:fa:8c:d8:e9:be:d9: + * 4f:ca:23:c6:e4:3f:b8:72:cf:02:fc:f4:58:34:77: + * 76:ce:22:44:5f:2d:ca:ee:f5:43:56:47:71:0b:09: + * 6b:5e:f2:c8:ee:d4:6e:44:92:2a:7f:cc:a7:d4:5b: + * fb:f7:4a:a9:fb:54:18:d5:d5:14:ba:a0:1c:13:b3: + * 37:6b:37:59:ed:db:6d:b1 + * prime1: + * 00:d8:04:f2:8e:83:78:64:68:61:e8:3a:1a:47:2a: + * ab:50:e8:45:64:95:d8:a1:1b:fd:e2:e1:67:a3:46: + * 89:de:95:73:7e:1d:18:75:2a:b0:76:1c:1c:74:33: + * c0:ff:a8:0c:cf:d6:2d:eb:35:29:52:1d:ea:f8:e7: + * d6:11:4c:99:c7 + * prime2: + * 00:c4:55:ff:b1:56:12:9f:4e:c1:1e:ff:59:86:7e: + * 97:5d:cb:7f:0a:3e:37:cf:fb:4a:35:bc:e5:35:b7: + * 31:a9:0c:10:7a:bc:37:20:7e:75:f1:41:f6:60:e0: + * 3e:18:3d:e5:5d:b2:a9:f8:cc:ad:a0:52:d6:bf:cc: + * e0:e1:84:ff:2f + * exponent1: + * 7e:a6:a7:ef:96:75:47:a9:4b:7d:f4:52:e3:d6:c8: + * 8a:af:23:c0:4d:7a:ad:3a:d4:27:e9:2f:f2:32:b1: + * 32:a7:3d:07:7b:d7:93:1a:6c:4b:53:3f:fb:81:3c: + * 6e:a8:00:9a:fa:60:01:bf:31:72:cb:c7:b0:17:7d: + * 12:b7:6e:91 + * exponent2: + * 00:ab:36:8f:ae:d6:ef:90:6b:3e:30:48:df:8a:50: + * d4:b1:1f:a7:9e:88:19:65:ce:ae:ad:64:17:c2:1b: + * 0a:3c:6f:df:e3:18:45:3e:99:e9:42:45:92:94:72: + * 98:d3:cd:0e:3b:02:76:05:18:80:84:e2:18:91:d4: + * 19:7b:b0:de:53 + * coefficient: + * 71:07:aa:8f:59:b5:7c:fd:db:21:53:f9:58:6c:35: + * cd:bd:07:c9:bf:b2:a5:09:76:d0:9c:31:df:e3:1a: + * 90:05:bb:a1:87:b9:f8:ea:21:90:69:42:c9:3a:df: + * 06:f0:11:20:0f:65:9f:a4:93:53:b5:91:2e:46:21: + * 12:d7:eb:4f + * + * + * server certificate: + * Data: + * Version: 3 (0x2) + * Serial Number: 8 (0x8) + * Signature Algorithm: md5WithRSAEncryption + * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org + * Validity + * Not Before: Dec 8 03:43:04 2008 GMT + * Not After : Aug 25 03:43:04 2028 GMT + * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Server, CN=localhost + * Subject Public Key Info: + * Public Key Algorithm: rsaEncryption + * RSA Public Key: (1024 bit) + * Modulus (1024 bit): + * 00:a5:ac:5b:1c:37:a2:dd:99:89:2d:b2:79:b8:8f: + * d5:48:a5:e7:1c:84:17:8d:69:9c:c6:ac:6d:f9:f2: + * 1d:1f:39:19:da:d3:72:1e:6e:ec:44:cc:70:a4:dc: + * ba:00:30:f6:a0:4f:3d:54:7a:61:6a:cc:57:d0:0a: + * 7f:95:28:18:3f:9a:d9:94:f2:1b:c8:24:88:7e:fe: + * 9d:0f:3d:fb:57:53:08:b3:20:33:d4:3f:17:47:14: + * d1:cd:ea:08:d8:0e:75:4e:af:be:cc:d2:ec:af:a9: + * 7a:49:df:c2:d9:ac:b8:24:40:90:a6:03:56:2a:d0: + * 30:05:40:2c:4f:ab:d9:74:89 + * Exponent: 65537 (0x10001) + * X509v3 extensions: + * X509v3 Basic Constraints: + * CA:FALSE + * X509v3 Key Usage: + * Digital Signature, Non Repudiation, Key Encipherment + * X509v3 Subject Key Identifier: + * ED:6E:DB:F4:B5:56:C8:FB:1A:06:61:3F:0F:08:BB:A6:04:D8:16:54 + * X509v3 Authority Key Identifier: + * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 + * + * X509v3 Subject Alternative Name: critical + * DNS:localhost + * Signature Algorithm: md5WithRSAEncryption0 + * + * -----BEGIN CERTIFICATE----- + * MIICpDCCAg2gAwIBAgIBCDANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET + * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK + * EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMDRaFw0yODA4MjUwMzQzMDRaMHIxCzAJ + * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp + * dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtU2VydmVyMRIwEAYD + * VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKWsWxw3 + * ot2ZiS2yebiP1Uil5xyEF41pnMasbfnyHR85GdrTch5u7ETMcKTcugAw9qBPPVR6 + * YWrMV9AKf5UoGD+a2ZTyG8gkiH7+nQ89+1dTCLMgM9Q/F0cU0c3qCNgOdU6vvszS + * 7K+peknfwtmsuCRAkKYDVirQMAVALE+r2XSJAgMBAAGjczBxMAkGA1UdEwQCMAAw + * CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTtbtv0tVbI+xoGYT8PCLumBNgWVDAfBgNV + * HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh + * bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAoqVTciHtcvsUj+YaTct8tUh3aTCsKsac + * PHhfQ+ObjiXSgxsKYTX7ym/wk/wvlbUcbqLKxsu7qrcJitH+H9heV1hEHEu65Uoi + * nRugFruyOrwvAylV8Cm2af7ddilmYJ+sdJA6N2M3xJRxR0G2LFHEXDNEjYReyexn + * JqCpf5uZGOo= + * -----END CERTIFICATE----- + * + * + * TLS client certificate: + * client private key: + * ----BEGIN RSA PRIVATE KEY----- + * Proc-Type: 4,ENCRYPTED + * DEK-Info: DES-EDE3-CBC,FA2A435CD35A9390 + * + * Z+Y2uaETbsUWIyJUyVu1UV2G4rgFYJyACZT6Tp1KjRtxflSh2kXkJ9MpuXMXA0V4 + * Yy3fDzPqCL9NJmQAYRlAx/W/+j4F5EyMWDIx8fUxzONRZyoiwF7jLm+KscAfv6Pf + * q7ItWOdj3z7IYrwlB8YIGd3F2cDKT3S+lYRk7rKb/qT7itbuHnY4Ardh3yl+MZak + * jBp+ELUlRsUqSr1V0LoM+0rCCykarpyfhpxEcqsrl0v9Cyi5uhU50/oKv5zql3SH + * l2ImgDjp3batAs8+Bd4NF2aqi0a7Hy44JUHxRm4caZryU/i/D9N1MbuM6882HLat + * 5N0G+NaIUfywa8mjwq2D5aiit18HqKA6XeRRYeJ5Dvu9DCO4GeFSwcUFIBMI0L46 + * 7s114+oDodg57pMgITi+04vmUxvqlN9aiyd7f5Fgd7PeHGeOdbMz1NaJLJaPI9++ + * NakK8eK9iwT/Gdq0Uap5/CHW7vCT5PO+h3HY0STH0lWStXhdWnFO04zTdywsbSp+ + * DLpHeFT66shfeUlxR0PsCbG9vPRt/QmGLeYQZITppWo/ylSq4j+pRIuXvuWHdBRN + * rTZ8QF4Y7AxQUXVz1j1++s6ZMHTzaK2i9HrhmDs1MbJl+QwWre3Xpv3LvTVz3k5U + * wX8kuY1m3STt71QCaRWENq5sRaMImLxZbxc/ivFl9RAzUqo4NCxLod/QgA4iLqtO + * ztnlpzwlC/F8HbQ1oqYWwnZAPhzU/cULtstl+Yrws2c2atO323LbPXZqbASySgig + * sNpFXQMObdfP6LN23bY+1SvtK7V4NUTNhpdIc6INQAQ= + * -----END RSA PRIVATE KEY----- + * + * -----BEGIN RSA PRIVATE KEY----- + * MIICWwIBAAKBgQC78EA2rCZUTvSjWgAvaSFvuXo6k+yi9uGOx2PYLxIwmS6w8o/4 + * Jy0keCiE9wG/jUR53TvSVfPOPLJbIX3v/TNKsaP/xsibuQ98QTWX+ds6BWAFFa9Z + * F5KjEK0WHOQHU6+odqJWKpLT+SjgeM9eH0irXBnd4WdDunWN9YKsQ5JEGwIDAQAB + * AoGAEbdqNj0wN85hnWyEi/ObJU8UyKTdL9eaF72QGfcF/fLSxfd3vurihIeXOkGW + * tpn4lIxYcVGM9CognhqgJpl11jFTQzn1KqZ+NEJRKkCHA4hDabKJbSC9fXHvRwrf + * BsFpZqgiNxp3HseUTiwnaUVeyPgMt/jAj5nB5Sib+UyUxrECQQDnNQBiF2aifEg6 + * zbJOOC7he5CHAdkFxSxWVFVHL6EfXfqdLVkUohMbgZv+XxyIeU2biOExSg49Kds3 + * FOKgTau1AkEA0Bd1haj6QuCo8I0AXm2WO+MMTZMTvtHD/bGjKNM+fT4I8rKYnQRX + * 1acHdqS9Xx2rNJqZgkMmpESIdPR2fc4yjwJALFeM6EMmqvj8/VIf5UJ/Mz14fXwM + * PEARfckUxd9LnnFutCBTWlKvKXJVEZb6KO5ixPaegc57Jp3Vbh3yTN44lQJADD/1 + * SSMDaIB1MYP7a5Oj7m6VQNPRq8AJe5vDcRnOae0G9dKRrVyeFxO4GsHj6/+BHp2j + * P8nYMn9eURQ7DXjf/QJAAQzMlWnKGSO8pyTDtnQx3hRMoUkOEhmNq4bQhLkYqtnY + * FcqpUQ2qMjW+NiNWk5HnTrMS3L9EdJobMUzaNZLy4w== + * -----END RSA PRIVATE KEY----- + * + * Private-Key: (1024 bit) + * modulus: + * 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69: + * 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f: + * 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7: + * 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21: + * 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41: + * 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10: + * ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9: + * 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba: + * 75:8d:f5:82:ac:43:92:44:1b + * publicExponent: 65537 (0x10001) + * privateExponent: + * 11:b7:6a:36:3d:30:37:ce:61:9d:6c:84:8b:f3:9b: + * 25:4f:14:c8:a4:dd:2f:d7:9a:17:bd:90:19:f7:05: + * fd:f2:d2:c5:f7:77:be:ea:e2:84:87:97:3a:41:96: + * b6:99:f8:94:8c:58:71:51:8c:f4:2a:20:9e:1a:a0: + * 26:99:75:d6:31:53:43:39:f5:2a:a6:7e:34:42:51: + * 2a:40:87:03:88:43:69:b2:89:6d:20:bd:7d:71:ef: + * 47:0a:df:06:c1:69:66:a8:22:37:1a:77:1e:c7:94: + * 4e:2c:27:69:45:5e:c8:f8:0c:b7:f8:c0:8f:99:c1: + * e5:28:9b:f9:4c:94:c6:b1 + * prime1: + * 00:e7:35:00:62:17:66:a2:7c:48:3a:cd:b2:4e:38: + * 2e:e1:7b:90:87:01:d9:05:c5:2c:56:54:55:47:2f: + * a1:1f:5d:fa:9d:2d:59:14:a2:13:1b:81:9b:fe:5f: + * 1c:88:79:4d:9b:88:e1:31:4a:0e:3d:29:db:37:14: + * e2:a0:4d:ab:b5 + * prime2: + * 00:d0:17:75:85:a8:fa:42:e0:a8:f0:8d:00:5e:6d: + * 96:3b:e3:0c:4d:93:13:be:d1:c3:fd:b1:a3:28:d3: + * 3e:7d:3e:08:f2:b2:98:9d:04:57:d5:a7:07:76:a4: + * bd:5f:1d:ab:34:9a:99:82:43:26:a4:44:88:74:f4: + * 76:7d:ce:32:8f + * exponent1: + * 2c:57:8c:e8:43:26:aa:f8:fc:fd:52:1f:e5:42:7f: + * 33:3d:78:7d:7c:0c:3c:40:11:7d:c9:14:c5:df:4b: + * 9e:71:6e:b4:20:53:5a:52:af:29:72:55:11:96:fa: + * 28:ee:62:c4:f6:9e:81:ce:7b:26:9d:d5:6e:1d:f2: + * 4c:de:38:95 + * exponent2: + * 0c:3f:f5:49:23:03:68:80:75:31:83:fb:6b:93:a3: + * ee:6e:95:40:d3:d1:ab:c0:09:7b:9b:c3:71:19:ce: + * 69:ed:06:f5:d2:91:ad:5c:9e:17:13:b8:1a:c1:e3: + * eb:ff:81:1e:9d:a3:3f:c9:d8:32:7f:5e:51:14:3b: + * 0d:78:df:fd + * coefficient: + * 01:0c:cc:95:69:ca:19:23:bc:a7:24:c3:b6:74:31: + * de:14:4c:a1:49:0e:12:19:8d:ab:86:d0:84:b9:18: + * aa:d9:d8:15:ca:a9:51:0d:aa:32:35:be:36:23:56: + * 93:91:e7:4e:b3:12:dc:bf:44:74:9a:1b:31:4c:da: + * 35:92:f2:e3 + * + * client certificate: + * Data: + * Version: 3 (0x2) + * Serial Number: 9 (0x9) + * Signature Algorithm: md5WithRSAEncryption + * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org + * Validity + * Not Before: Dec 8 03:43:24 2008 GMT + * Not After : Aug 25 03:43:24 2028 GMT + * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Client, CN=localhost + * Subject Public Key Info: + * Public Key Algorithm: rsaEncryption + * RSA Public Key: (1024 bit) + * Modulus (1024 bit): + * 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69: + * 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f: + * 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7: + * 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21: + * 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41: + * 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10: + * ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9: + * 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba: + * 75:8d:f5:82:ac:43:92:44:1b + * Exponent: 65537 (0x10001) + * X509v3 extensions: + * X509v3 Basic Constraints: + * CA:FALSE + * X509v3 Key Usage: + * Digital Signature, Non Repudiation, Key Encipherment + * X509v3 Subject Key Identifier: + * CD:BB:C8:85:AA:91:BD:FD:1D:BE:CD:67:7C:FF:B3:E9:4C:A8:22:E6 + * X509v3 Authority Key Identifier: + * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 + * + * X509v3 Subject Alternative Name: critical + * DNS:localhost + * Signature Algorithm: md5WithRSAEncryption + * + * -----BEGIN CERTIFICATE----- + * MIICpDCCAg2gAwIBAgIBCTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET + * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK + * EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMjRaFw0yODA4MjUwMzQzMjRaMHIxCzAJ + * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp + * dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD + * VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas + * JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV + * 8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq + * ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjczBxMAkGA1UdEwQCMAAw + * CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV + * HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh + * bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAm25gJyqW1JznQ1EyOtTGswBVwfgBOf+F + * HJuBTcflYQLbTD/AETPQJGvZU9tdhuLtbG3OPhR7vSY8zeAbfM3dbH7QFr3r47Gj + * XEH7qM/MX+Z3ifVaC4MeJmrYQkYFSuKeyyKpdRVX4w4nnFHF6OsNASsYrMW6LpxN + * cl/epUcHL7E= + * -----END CERTIFICATE----- + * + * + * + * Trusted CA certificate: + * Certificate: + * Data: + * Version: 3 (0x2) + * Serial Number: 0 (0x0) + * Signature Algorithm: md5WithRSAEncryption + * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org + * Validity + * Not Before: Dec 8 02:43:36 2008 GMT + * Not After : Aug 25 02:43:36 2028 GMT + * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org + * Subject Public Key Info: + * Public Key Algorithm: rsaEncryption + * RSA Public Key: (1024 bit) + * Modulus (1024 bit): + * 00:cb:c4:38:20:07:be:88:a7:93:b0:a1:43:51:2d: + * d7:8e:85:af:54:dd:ad:a2:7b:23:5b:cf:99:13:53: + * 99:45:7d:ee:6d:ba:2d:bf:e3:ad:6e:3d:9f:1a:f9: + * 03:97:e0:17:55:ae:11:26:57:de:01:29:8e:05:3f: + * 21:f7:e7:36:e8:2e:37:d7:48:ac:53:d6:60:0e:c7: + * 50:6d:f6:c5:85:f7:8b:a6:c5:91:35:72:3c:94:ee: + * f1:17:f0:71:e3:ec:1b:ce:ca:4e:40:42:b0:6d:ee: + * 6a:0e:d6:e5:ad:3c:0f:c9:ba:82:4f:78:f8:89:97: + * 89:2a:95:12:4c:d8:09:2a:e9 + * Exponent: 65537 (0x10001) + * X509v3 extensions: + * X509v3 Subject Key Identifier: + * FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 + * X509v3 Authority Key Identifier: + * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 + * DirName:/C=US/ST=Some-State/L=Some-City/O=Some-Org + * serial:00 + * + * X509v3 Basic Constraints: + * CA:TRUE + * Signature Algorithm: md5WithRSAEncryption + * + * -----BEGIN CERTIFICATE----- + * MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET + * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK + * EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ + * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp + * dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB + * gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX + * 4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj + * 7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G + * A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ + * hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt + * U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw + * DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA + * ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ + * LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P + * 6Mvf0r1PNTY2hwTJLJmKtg== + * -----END CERTIFICATE--- + */ + + +public class PKIXExtendedTM { + + /* + * ============================================================= + * Set the various variables needed for the tests, then + * specify what tests to run on each side. + */ + + /* + * Should we run the client or server in a separate thread? + * Both sides can throw exceptions, but do you have a preference + * as to which side should be the main thread. + */ + static boolean separateServerThread = true; + + /* + * Where do we find the keystores? + */ + static String trusedCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" + + "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" + + "EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ\n" + + "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" + + "dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n" + + "gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX\n" + + "4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj\n" + + "7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G\n" + + "A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ\n" + + "hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt\n" + + "U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw\n" + + "DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA\n" + + "ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ\n" + + "LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P\n" + + "6Mvf0r1PNTY2hwTJLJmKtg==\n" + + "-----END CERTIFICATE-----"; + + static String serverCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICpDCCAg2gAwIBAgIBCDANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" + + "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" + + "EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMDRaFw0yODA4MjUwMzQzMDRaMHIxCzAJ\n" + + "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" + + "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtU2VydmVyMRIwEAYD\n" + + "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKWsWxw3\n" + + "ot2ZiS2yebiP1Uil5xyEF41pnMasbfnyHR85GdrTch5u7ETMcKTcugAw9qBPPVR6\n" + + "YWrMV9AKf5UoGD+a2ZTyG8gkiH7+nQ89+1dTCLMgM9Q/F0cU0c3qCNgOdU6vvszS\n" + + "7K+peknfwtmsuCRAkKYDVirQMAVALE+r2XSJAgMBAAGjczBxMAkGA1UdEwQCMAAw\n" + + "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTtbtv0tVbI+xoGYT8PCLumBNgWVDAfBgNV\n" + + "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh\n" + + "bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAoqVTciHtcvsUj+YaTct8tUh3aTCsKsac\n" + + "PHhfQ+ObjiXSgxsKYTX7ym/wk/wvlbUcbqLKxsu7qrcJitH+H9heV1hEHEu65Uoi\n" + + "nRugFruyOrwvAylV8Cm2af7ddilmYJ+sdJA6N2M3xJRxR0G2LFHEXDNEjYReyexn\n" + + "JqCpf5uZGOo=\n" + + "-----END CERTIFICATE-----"; + + static String clientCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICpDCCAg2gAwIBAgIBCTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" + + "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" + + "EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMjRaFw0yODA4MjUwMzQzMjRaMHIxCzAJ\n" + + "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" + + "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD\n" + + "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas\n" + + "JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV\n" + + "8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq\n" + + "ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjczBxMAkGA1UdEwQCMAAw\n" + + "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV\n" + + "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh\n" + + "bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAm25gJyqW1JznQ1EyOtTGswBVwfgBOf+F\n" + + "HJuBTcflYQLbTD/AETPQJGvZU9tdhuLtbG3OPhR7vSY8zeAbfM3dbH7QFr3r47Gj\n" + + "XEH7qM/MX+Z3ifVaC4MeJmrYQkYFSuKeyyKpdRVX4w4nnFHF6OsNASsYrMW6LpxN\n" + + "cl/epUcHL7E=\n" + + "-----END CERTIFICATE-----"; + + static byte serverPrivateExponent[] = { + (byte)0x6e, (byte)0xa7, (byte)0x1b, (byte)0x83, + (byte)0x51, (byte)0x35, (byte)0x9a, (byte)0x44, + (byte)0x7d, (byte)0xf6, (byte)0xe3, (byte)0x89, + (byte)0xa0, (byte)0xd7, (byte)0x90, (byte)0x60, + (byte)0xa1, (byte)0x4e, (byte)0x27, (byte)0x21, + (byte)0xa2, (byte)0x89, (byte)0x74, (byte)0xcc, + (byte)0x9d, (byte)0x75, (byte)0x75, (byte)0x4e, + (byte)0xc7, (byte)0x82, (byte)0xe3, (byte)0xe3, + (byte)0xc3, (byte)0x7d, (byte)0x00, (byte)0x54, + (byte)0xec, (byte)0x36, (byte)0xb1, (byte)0xdf, + (byte)0x91, (byte)0x9c, (byte)0x7a, (byte)0xc0, + (byte)0x62, (byte)0x0a, (byte)0xd6, (byte)0xa9, + (byte)0x22, (byte)0x91, (byte)0x4a, (byte)0x29, + (byte)0x2e, (byte)0x43, (byte)0xfa, (byte)0x8c, + (byte)0xd8, (byte)0xe9, (byte)0xbe, (byte)0xd9, + (byte)0x4f, (byte)0xca, (byte)0x23, (byte)0xc6, + (byte)0xe4, (byte)0x3f, (byte)0xb8, (byte)0x72, + (byte)0xcf, (byte)0x02, (byte)0xfc, (byte)0xf4, + (byte)0x58, (byte)0x34, (byte)0x77, (byte)0x76, + (byte)0xce, (byte)0x22, (byte)0x44, (byte)0x5f, + (byte)0x2d, (byte)0xca, (byte)0xee, (byte)0xf5, + (byte)0x43, (byte)0x56, (byte)0x47, (byte)0x71, + (byte)0x0b, (byte)0x09, (byte)0x6b, (byte)0x5e, + (byte)0xf2, (byte)0xc8, (byte)0xee, (byte)0xd4, + (byte)0x6e, (byte)0x44, (byte)0x92, (byte)0x2a, + (byte)0x7f, (byte)0xcc, (byte)0xa7, (byte)0xd4, + (byte)0x5b, (byte)0xfb, (byte)0xf7, (byte)0x4a, + (byte)0xa9, (byte)0xfb, (byte)0x54, (byte)0x18, + (byte)0xd5, (byte)0xd5, (byte)0x14, (byte)0xba, + (byte)0xa0, (byte)0x1c, (byte)0x13, (byte)0xb3, + (byte)0x37, (byte)0x6b, (byte)0x37, (byte)0x59, + (byte)0xed, (byte)0xdb, (byte)0x6d, (byte)0xb1 + }; + + static byte serverModulus[] = { + (byte)0x00, + (byte)0xa5, (byte)0xac, (byte)0x5b, (byte)0x1c, + (byte)0x37, (byte)0xa2, (byte)0xdd, (byte)0x99, + (byte)0x89, (byte)0x2d, (byte)0xb2, (byte)0x79, + (byte)0xb8, (byte)0x8f, (byte)0xd5, (byte)0x48, + (byte)0xa5, (byte)0xe7, (byte)0x1c, (byte)0x84, + (byte)0x17, (byte)0x8d, (byte)0x69, (byte)0x9c, + (byte)0xc6, (byte)0xac, (byte)0x6d, (byte)0xf9, + (byte)0xf2, (byte)0x1d, (byte)0x1f, (byte)0x39, + (byte)0x19, (byte)0xda, (byte)0xd3, (byte)0x72, + (byte)0x1e, (byte)0x6e, (byte)0xec, (byte)0x44, + (byte)0xcc, (byte)0x70, (byte)0xa4, (byte)0xdc, + (byte)0xba, (byte)0x00, (byte)0x30, (byte)0xf6, + (byte)0xa0, (byte)0x4f, (byte)0x3d, (byte)0x54, + (byte)0x7a, (byte)0x61, (byte)0x6a, (byte)0xcc, + (byte)0x57, (byte)0xd0, (byte)0x0a, (byte)0x7f, + (byte)0x95, (byte)0x28, (byte)0x18, (byte)0x3f, + (byte)0x9a, (byte)0xd9, (byte)0x94, (byte)0xf2, + (byte)0x1b, (byte)0xc8, (byte)0x24, (byte)0x88, + (byte)0x7e, (byte)0xfe, (byte)0x9d, (byte)0x0f, + (byte)0x3d, (byte)0xfb, (byte)0x57, (byte)0x53, + (byte)0x08, (byte)0xb3, (byte)0x20, (byte)0x33, + (byte)0xd4, (byte)0x3f, (byte)0x17, (byte)0x47, + (byte)0x14, (byte)0xd1, (byte)0xcd, (byte)0xea, + (byte)0x08, (byte)0xd8, (byte)0x0e, (byte)0x75, + (byte)0x4e, (byte)0xaf, (byte)0xbe, (byte)0xcc, + (byte)0xd2, (byte)0xec, (byte)0xaf, (byte)0xa9, + (byte)0x7a, (byte)0x49, (byte)0xdf, (byte)0xc2, + (byte)0xd9, (byte)0xac, (byte)0xb8, (byte)0x24, + (byte)0x40, (byte)0x90, (byte)0xa6, (byte)0x03, + (byte)0x56, (byte)0x2a, (byte)0xd0, (byte)0x30, + (byte)0x05, (byte)0x40, (byte)0x2c, (byte)0x4f, + (byte)0xab, (byte)0xd9, (byte)0x74, (byte)0x89 + }; + + static byte clientPrivateExponent[] = { + (byte)0x11, (byte)0xb7, (byte)0x6a, (byte)0x36, + (byte)0x3d, (byte)0x30, (byte)0x37, (byte)0xce, + (byte)0x61, (byte)0x9d, (byte)0x6c, (byte)0x84, + (byte)0x8b, (byte)0xf3, (byte)0x9b, (byte)0x25, + (byte)0x4f, (byte)0x14, (byte)0xc8, (byte)0xa4, + (byte)0xdd, (byte)0x2f, (byte)0xd7, (byte)0x9a, + (byte)0x17, (byte)0xbd, (byte)0x90, (byte)0x19, + (byte)0xf7, (byte)0x05, (byte)0xfd, (byte)0xf2, + (byte)0xd2, (byte)0xc5, (byte)0xf7, (byte)0x77, + (byte)0xbe, (byte)0xea, (byte)0xe2, (byte)0x84, + (byte)0x87, (byte)0x97, (byte)0x3a, (byte)0x41, + (byte)0x96, (byte)0xb6, (byte)0x99, (byte)0xf8, + (byte)0x94, (byte)0x8c, (byte)0x58, (byte)0x71, + (byte)0x51, (byte)0x8c, (byte)0xf4, (byte)0x2a, + (byte)0x20, (byte)0x9e, (byte)0x1a, (byte)0xa0, + (byte)0x26, (byte)0x99, (byte)0x75, (byte)0xd6, + (byte)0x31, (byte)0x53, (byte)0x43, (byte)0x39, + (byte)0xf5, (byte)0x2a, (byte)0xa6, (byte)0x7e, + (byte)0x34, (byte)0x42, (byte)0x51, (byte)0x2a, + (byte)0x40, (byte)0x87, (byte)0x03, (byte)0x88, + (byte)0x43, (byte)0x69, (byte)0xb2, (byte)0x89, + (byte)0x6d, (byte)0x20, (byte)0xbd, (byte)0x7d, + (byte)0x71, (byte)0xef, (byte)0x47, (byte)0x0a, + (byte)0xdf, (byte)0x06, (byte)0xc1, (byte)0x69, + (byte)0x66, (byte)0xa8, (byte)0x22, (byte)0x37, + (byte)0x1a, (byte)0x77, (byte)0x1e, (byte)0xc7, + (byte)0x94, (byte)0x4e, (byte)0x2c, (byte)0x27, + (byte)0x69, (byte)0x45, (byte)0x5e, (byte)0xc8, + (byte)0xf8, (byte)0x0c, (byte)0xb7, (byte)0xf8, + (byte)0xc0, (byte)0x8f, (byte)0x99, (byte)0xc1, + (byte)0xe5, (byte)0x28, (byte)0x9b, (byte)0xf9, + (byte)0x4c, (byte)0x94, (byte)0xc6, (byte)0xb1 + }; + + static byte clientModulus[] = { + (byte)0x00, + (byte)0xbb, (byte)0xf0, (byte)0x40, (byte)0x36, + (byte)0xac, (byte)0x26, (byte)0x54, (byte)0x4e, + (byte)0xf4, (byte)0xa3, (byte)0x5a, (byte)0x00, + (byte)0x2f, (byte)0x69, (byte)0x21, (byte)0x6f, + (byte)0xb9, (byte)0x7a, (byte)0x3a, (byte)0x93, + (byte)0xec, (byte)0xa2, (byte)0xf6, (byte)0xe1, + (byte)0x8e, (byte)0xc7, (byte)0x63, (byte)0xd8, + (byte)0x2f, (byte)0x12, (byte)0x30, (byte)0x99, + (byte)0x2e, (byte)0xb0, (byte)0xf2, (byte)0x8f, + (byte)0xf8, (byte)0x27, (byte)0x2d, (byte)0x24, + (byte)0x78, (byte)0x28, (byte)0x84, (byte)0xf7, + (byte)0x01, (byte)0xbf, (byte)0x8d, (byte)0x44, + (byte)0x79, (byte)0xdd, (byte)0x3b, (byte)0xd2, + (byte)0x55, (byte)0xf3, (byte)0xce, (byte)0x3c, + (byte)0xb2, (byte)0x5b, (byte)0x21, (byte)0x7d, + (byte)0xef, (byte)0xfd, (byte)0x33, (byte)0x4a, + (byte)0xb1, (byte)0xa3, (byte)0xff, (byte)0xc6, + (byte)0xc8, (byte)0x9b, (byte)0xb9, (byte)0x0f, + (byte)0x7c, (byte)0x41, (byte)0x35, (byte)0x97, + (byte)0xf9, (byte)0xdb, (byte)0x3a, (byte)0x05, + (byte)0x60, (byte)0x05, (byte)0x15, (byte)0xaf, + (byte)0x59, (byte)0x17, (byte)0x92, (byte)0xa3, + (byte)0x10, (byte)0xad, (byte)0x16, (byte)0x1c, + (byte)0xe4, (byte)0x07, (byte)0x53, (byte)0xaf, + (byte)0xa8, (byte)0x76, (byte)0xa2, (byte)0x56, + (byte)0x2a, (byte)0x92, (byte)0xd3, (byte)0xf9, + (byte)0x28, (byte)0xe0, (byte)0x78, (byte)0xcf, + (byte)0x5e, (byte)0x1f, (byte)0x48, (byte)0xab, + (byte)0x5c, (byte)0x19, (byte)0xdd, (byte)0xe1, + (byte)0x67, (byte)0x43, (byte)0xba, (byte)0x75, + (byte)0x8d, (byte)0xf5, (byte)0x82, (byte)0xac, + (byte)0x43, (byte)0x92, (byte)0x44, (byte)0x1b + }; + + static char passphrase[] = "passphrase".toCharArray(); + + /* + * Is the server ready to serve? + */ + volatile static boolean serverReady = false; + + /* + * Turn on SSL debugging? + */ + static boolean debug = false; + + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doServerSide() throws Exception { + SSLContext context = getSSLContext(trusedCertStr, serverCertStr, + serverModulus, serverPrivateExponent, passphrase); + SSLServerSocketFactory sslssf = context.getServerSocketFactory(); + + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + serverPort = sslServerSocket.getLocalPort(); + + // enable endpoint identification + // ignore, we may test the feature when known how to parse client + // hostname + //SSLParameters params = sslServerSocket.getSSLParameters(); + //params.setEndpointIdentificationAlgorithm("HTTPS"); + //sslServerSocket.setSSLParameters(params); + + /* + * Signal Client, we're ready for his connect. + */ + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + sslSocket.setNeedClientAuth(true); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslIS.read(); + sslOS.write(85); + sslOS.flush(); + + sslSocket.close(); + + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doClientSide() throws Exception { + /* + * Wait for server to get started. + */ + while (!serverReady) { + Thread.sleep(50); + } + + SSLContext context = getSSLContext(trusedCertStr, clientCertStr, + clientModulus, clientPrivateExponent, passphrase); + + SSLSocketFactory sslsf = context.getSocketFactory(); + SSLSocket sslSocket = (SSLSocket) + sslsf.createSocket("localhost", serverPort); + + // enable endpoint identification + SSLParameters params = sslSocket.getSSLParameters(); + params.setEndpointIdentificationAlgorithm("HTTPS"); + sslSocket.setSSLParameters(params); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslOS.write(280); + sslOS.flush(); + sslIS.read(); + + sslSocket.close(); + + } + + // get the ssl context + private static SSLContext getSSLContext(String trusedCertStr, + String keyCertStr, byte[] modulus, + byte[] privateExponent, char[] passphrase) throws Exception { + + // generate certificate from cert string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + ByteArrayInputStream is = + new ByteArrayInputStream(trusedCertStr.getBytes()); + Certificate trusedCert = cf.generateCertificate(is); + is.close(); + + // create a key store + KeyStore ks = KeyStore.getInstance("JKS"); + ks.load(null, null); + + // import the trused cert + ks.setCertificateEntry("RSA Export Signer", trusedCert); + + if (keyCertStr != null) { + // generate the private key. + RSAPrivateKeySpec priKeySpec = new RSAPrivateKeySpec( + new BigInteger(modulus), + new BigInteger(privateExponent)); + KeyFactory kf = KeyFactory.getInstance("RSA"); + RSAPrivateKey priKey = + (RSAPrivateKey)kf.generatePrivate(priKeySpec); + + // generate certificate chain + is = new ByteArrayInputStream(keyCertStr.getBytes()); + Certificate keyCert = cf.generateCertificate(is); + is.close(); + + Certificate[] chain = new Certificate[2]; + chain[0] = keyCert; + chain[1] = trusedCert; + + // import the key entry. + ks.setKeyEntry("Whatever", priKey, passphrase, chain); + } + + // create SSL context + TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX"); + tmf.init(ks); + + TrustManager tms[] = tmf.getTrustManagers(); + if (tms == null || tms.length == 0) { + throw new Exception("unexpected trust manager implementation"); + } else { + if (!(tms[0] instanceof X509ExtendedTrustManager)) { + throw new Exception("unexpected trust manager implementation: " + + tms[0].getClass().getCanonicalName()); + } + } + + + SSLContext ctx = SSLContext.getInstance("TLS"); + + if (keyCertStr != null) { + KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); + kmf.init(ks, passphrase); + + ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + } else { + ctx.init(null, tmf.getTrustManagers(), null); + } + + return ctx; + } + + /* + * ============================================================= + * The remainder is just support stuff + */ + + // use any free port by default + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + public static void main(String args[]) throws Exception { + if (debug) + System.setProperty("javax.net.debug", "all"); + + /* + * Start the tests. + */ + new PKIXExtendedTM(); + } + + Thread clientThread = null; + Thread serverThread = null; + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + PKIXExtendedTM() throws Exception { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * + * If the main thread excepted, that propagates back + * immediately. If the other thread threw an exception, we + * should report back. + */ + if (serverException != null) + throw serverException; + if (clientException != null) + throw clientException; + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + doServerSide(); + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + doClientSide(); + } + } + +} diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java new file mode 100644 index 00000000000..19eb41a8aa2 --- /dev/null +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/SunX509ExtendedTM.java @@ -0,0 +1,884 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6916074 + * @run main/othervm -Djavax.net.debug=all SunX509ExtendedTM + * @summary Add support for TLS 1.2 + */ + +import java.net.*; +import java.util.*; +import java.io.*; +import javax.net.ssl.*; +import java.security.KeyStore; +import java.security.KeyFactory; +import java.security.cert.Certificate; +import java.security.cert.CertificateFactory; +import java.security.spec.*; +import java.security.interfaces.*; +import java.math.BigInteger; + + +/* + * Certificates and key used in the test. + * + * TLS server certificate: + * server private key: + * -----BEGIN RSA PRIVATE KEY----- + * Proc-Type: 4,ENCRYPTED + * DEK-Info: DES-EDE3-CBC,D9AE407F6D0E389A + * + * WPrA7TFol/cQCcp9oHnXWNpYlvRbbIcQj0m+RKT2Iuzfus+DHt3Zadf8nJpKfX2e + * h2rnhlzCN9M7djRDooZKDOPCsdBn51Au7HlZF3S3Opgo7D8XFM1a8t1Je4ke14oI + * nw6QKYsBblRziPnP2PZ0zvX24nOv7bbY8beynlJHGs00VWSFdoH2DS0aE1p6D+3n + * ptJuJ75dVfZFK4X7162APlNXevX8D6PEQpSiRw1rjjGGcnvQ4HdWk3BxDVDcCNJb + * Y1aGNRxsjTDvPi3R9Qx2M+W03QzEPx4SR3ZHVskeSJHaetM0TM/w/45Paq4GokXP + * ZeTnbEx1xmjkA7h+t4doLL4watx5F6yLsJzu8xB3lt/1EtmkYtLz1t7X4BetPAXz + * zS69X/VwhKfsOI3qXBWuL2oHPyhDmT1gcaUQwEPSV6ogHEEQEDXdiUS8heNK13KF + * TCQYFkETvV2BLxUhV1hypPzRQ6tUpJiAbD5KmoK2lD9slshG2QtvKQq0/bgkDY5J + * LhDHV2dtcZ3kDPkkZXpbcJQvoeH3d09C5sIsuTFo2zgNR6oETHUc5TzP6FY2YYRa + * QcK5HcmtsRRiXFm01ac+aMejJUIujjFt84SiKWT/73vC8AmY4tYcJBLjCg4XIxSH + * fdDFLL1YZENNO5ivlp8mdiHqcawx+36L7DrEZQ8RZt6cqST5t/+XTdM74s6k81GT + * pNsa82P2K2zmIUZ/DL2mKjW1vfRByw1NQFEBkN3vdyZxYfM/JyUzX4hbjXBEkh9Q + * QYrcwLKLjis2QzSvK04B3bvRzRb+4ocWiso8ZPAXAIxZFBWDpTMM2A== + * -----END RSA PRIVATE KEY----- + * + * -----BEGIN RSA PRIVATE KEY----- + * MIICXAIBAAKBgQClrFscN6LdmYktsnm4j9VIpecchBeNaZzGrG358h0fORna03Ie + * buxEzHCk3LoAMPagTz1UemFqzFfQCn+VKBg/mtmU8hvIJIh+/p0PPftXUwizIDPU + * PxdHFNHN6gjYDnVOr77M0uyvqXpJ38LZrLgkQJCmA1Yq0DAFQCxPq9l0iQIDAQAB + * AoGAbqcbg1E1mkR99uOJoNeQYKFOJyGiiXTMnXV1TseC4+PDfQBU7Dax35GcesBi + * CtapIpFKKS5D+ozY6b7ZT8ojxuQ/uHLPAvz0WDR3ds4iRF8tyu71Q1ZHcQsJa17y + * yO7UbkSSKn/Mp9Rb+/dKqftUGNXVFLqgHBOzN2s3We3bbbECQQDYBPKOg3hkaGHo + * OhpHKqtQ6EVkldihG/3i4WejRonelXN+HRh1KrB2HBx0M8D/qAzP1i3rNSlSHer4 + * 59YRTJnHAkEAxFX/sVYSn07BHv9Zhn6XXct/Cj43z/tKNbzlNbcxqQwQerw3IH51 + * 8UH2YOA+GD3lXbKp+MytoFLWv8zg4YT/LwJAfqan75Z1R6lLffRS49bIiq8jwE16 + * rTrUJ+kv8jKxMqc9B3vXkxpsS1M/+4E8bqgAmvpgAb8xcsvHsBd9ErdukQJBAKs2 + * j67W75BrPjBI34pQ1LEfp56IGWXOrq1kF8IbCjxv3+MYRT6Z6UJFkpRymNPNDjsC + * dgUYgITiGJHUGXuw3lMCQHEHqo9ZtXz92yFT+VhsNc29B8m/sqUJdtCcMd/jGpAF + * u6GHufjqIZBpQsk63wbwESAPZZ+kk1O1kS5GIRLX608= + * -----END RSA PRIVATE KEY----- + * + * Private-Key: (1024 bit) + * modulus: + * 00:a5:ac:5b:1c:37:a2:dd:99:89:2d:b2:79:b8:8f: + * d5:48:a5:e7:1c:84:17:8d:69:9c:c6:ac:6d:f9:f2: + * 1d:1f:39:19:da:d3:72:1e:6e:ec:44:cc:70:a4:dc: + * ba:00:30:f6:a0:4f:3d:54:7a:61:6a:cc:57:d0:0a: + * 7f:95:28:18:3f:9a:d9:94:f2:1b:c8:24:88:7e:fe: + * 9d:0f:3d:fb:57:53:08:b3:20:33:d4:3f:17:47:14: + * d1:cd:ea:08:d8:0e:75:4e:af:be:cc:d2:ec:af:a9: + * 7a:49:df:c2:d9:ac:b8:24:40:90:a6:03:56:2a:d0: + * 30:05:40:2c:4f:ab:d9:74:89 + * publicExponent: 65537 (0x10001) + * privateExponent: + * 6e:a7:1b:83:51:35:9a:44:7d:f6:e3:89:a0:d7:90: + * 60:a1:4e:27:21:a2:89:74:cc:9d:75:75:4e:c7:82: + * e3:e3:c3:7d:00:54:ec:36:b1:df:91:9c:7a:c0:62: + * 0a:d6:a9:22:91:4a:29:2e:43:fa:8c:d8:e9:be:d9: + * 4f:ca:23:c6:e4:3f:b8:72:cf:02:fc:f4:58:34:77: + * 76:ce:22:44:5f:2d:ca:ee:f5:43:56:47:71:0b:09: + * 6b:5e:f2:c8:ee:d4:6e:44:92:2a:7f:cc:a7:d4:5b: + * fb:f7:4a:a9:fb:54:18:d5:d5:14:ba:a0:1c:13:b3: + * 37:6b:37:59:ed:db:6d:b1 + * prime1: + * 00:d8:04:f2:8e:83:78:64:68:61:e8:3a:1a:47:2a: + * ab:50:e8:45:64:95:d8:a1:1b:fd:e2:e1:67:a3:46: + * 89:de:95:73:7e:1d:18:75:2a:b0:76:1c:1c:74:33: + * c0:ff:a8:0c:cf:d6:2d:eb:35:29:52:1d:ea:f8:e7: + * d6:11:4c:99:c7 + * prime2: + * 00:c4:55:ff:b1:56:12:9f:4e:c1:1e:ff:59:86:7e: + * 97:5d:cb:7f:0a:3e:37:cf:fb:4a:35:bc:e5:35:b7: + * 31:a9:0c:10:7a:bc:37:20:7e:75:f1:41:f6:60:e0: + * 3e:18:3d:e5:5d:b2:a9:f8:cc:ad:a0:52:d6:bf:cc: + * e0:e1:84:ff:2f + * exponent1: + * 7e:a6:a7:ef:96:75:47:a9:4b:7d:f4:52:e3:d6:c8: + * 8a:af:23:c0:4d:7a:ad:3a:d4:27:e9:2f:f2:32:b1: + * 32:a7:3d:07:7b:d7:93:1a:6c:4b:53:3f:fb:81:3c: + * 6e:a8:00:9a:fa:60:01:bf:31:72:cb:c7:b0:17:7d: + * 12:b7:6e:91 + * exponent2: + * 00:ab:36:8f:ae:d6:ef:90:6b:3e:30:48:df:8a:50: + * d4:b1:1f:a7:9e:88:19:65:ce:ae:ad:64:17:c2:1b: + * 0a:3c:6f:df:e3:18:45:3e:99:e9:42:45:92:94:72: + * 98:d3:cd:0e:3b:02:76:05:18:80:84:e2:18:91:d4: + * 19:7b:b0:de:53 + * coefficient: + * 71:07:aa:8f:59:b5:7c:fd:db:21:53:f9:58:6c:35: + * cd:bd:07:c9:bf:b2:a5:09:76:d0:9c:31:df:e3:1a: + * 90:05:bb:a1:87:b9:f8:ea:21:90:69:42:c9:3a:df: + * 06:f0:11:20:0f:65:9f:a4:93:53:b5:91:2e:46:21: + * 12:d7:eb:4f + * + * + * server certificate: + * Data: + * Version: 3 (0x2) + * Serial Number: 8 (0x8) + * Signature Algorithm: md5WithRSAEncryption + * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org + * Validity + * Not Before: Dec 8 03:43:04 2008 GMT + * Not After : Aug 25 03:43:04 2028 GMT + * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Server, CN=localhost + * Subject Public Key Info: + * Public Key Algorithm: rsaEncryption + * RSA Public Key: (1024 bit) + * Modulus (1024 bit): + * 00:a5:ac:5b:1c:37:a2:dd:99:89:2d:b2:79:b8:8f: + * d5:48:a5:e7:1c:84:17:8d:69:9c:c6:ac:6d:f9:f2: + * 1d:1f:39:19:da:d3:72:1e:6e:ec:44:cc:70:a4:dc: + * ba:00:30:f6:a0:4f:3d:54:7a:61:6a:cc:57:d0:0a: + * 7f:95:28:18:3f:9a:d9:94:f2:1b:c8:24:88:7e:fe: + * 9d:0f:3d:fb:57:53:08:b3:20:33:d4:3f:17:47:14: + * d1:cd:ea:08:d8:0e:75:4e:af:be:cc:d2:ec:af:a9: + * 7a:49:df:c2:d9:ac:b8:24:40:90:a6:03:56:2a:d0: + * 30:05:40:2c:4f:ab:d9:74:89 + * Exponent: 65537 (0x10001) + * X509v3 extensions: + * X509v3 Basic Constraints: + * CA:FALSE + * X509v3 Key Usage: + * Digital Signature, Non Repudiation, Key Encipherment + * X509v3 Subject Key Identifier: + * ED:6E:DB:F4:B5:56:C8:FB:1A:06:61:3F:0F:08:BB:A6:04:D8:16:54 + * X509v3 Authority Key Identifier: + * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 + * + * X509v3 Subject Alternative Name: critical + * DNS:localhost + * Signature Algorithm: md5WithRSAEncryption0 + * + * -----BEGIN CERTIFICATE----- + * MIICpDCCAg2gAwIBAgIBCDANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET + * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK + * EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMDRaFw0yODA4MjUwMzQzMDRaMHIxCzAJ + * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp + * dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtU2VydmVyMRIwEAYD + * VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKWsWxw3 + * ot2ZiS2yebiP1Uil5xyEF41pnMasbfnyHR85GdrTch5u7ETMcKTcugAw9qBPPVR6 + * YWrMV9AKf5UoGD+a2ZTyG8gkiH7+nQ89+1dTCLMgM9Q/F0cU0c3qCNgOdU6vvszS + * 7K+peknfwtmsuCRAkKYDVirQMAVALE+r2XSJAgMBAAGjczBxMAkGA1UdEwQCMAAw + * CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTtbtv0tVbI+xoGYT8PCLumBNgWVDAfBgNV + * HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh + * bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAoqVTciHtcvsUj+YaTct8tUh3aTCsKsac + * PHhfQ+ObjiXSgxsKYTX7ym/wk/wvlbUcbqLKxsu7qrcJitH+H9heV1hEHEu65Uoi + * nRugFruyOrwvAylV8Cm2af7ddilmYJ+sdJA6N2M3xJRxR0G2LFHEXDNEjYReyexn + * JqCpf5uZGOo= + * -----END CERTIFICATE----- + * + * + * TLS client certificate: + * client private key: + * ----BEGIN RSA PRIVATE KEY----- + * Proc-Type: 4,ENCRYPTED + * DEK-Info: DES-EDE3-CBC,FA2A435CD35A9390 + * + * Z+Y2uaETbsUWIyJUyVu1UV2G4rgFYJyACZT6Tp1KjRtxflSh2kXkJ9MpuXMXA0V4 + * Yy3fDzPqCL9NJmQAYRlAx/W/+j4F5EyMWDIx8fUxzONRZyoiwF7jLm+KscAfv6Pf + * q7ItWOdj3z7IYrwlB8YIGd3F2cDKT3S+lYRk7rKb/qT7itbuHnY4Ardh3yl+MZak + * jBp+ELUlRsUqSr1V0LoM+0rCCykarpyfhpxEcqsrl0v9Cyi5uhU50/oKv5zql3SH + * l2ImgDjp3batAs8+Bd4NF2aqi0a7Hy44JUHxRm4caZryU/i/D9N1MbuM6882HLat + * 5N0G+NaIUfywa8mjwq2D5aiit18HqKA6XeRRYeJ5Dvu9DCO4GeFSwcUFIBMI0L46 + * 7s114+oDodg57pMgITi+04vmUxvqlN9aiyd7f5Fgd7PeHGeOdbMz1NaJLJaPI9++ + * NakK8eK9iwT/Gdq0Uap5/CHW7vCT5PO+h3HY0STH0lWStXhdWnFO04zTdywsbSp+ + * DLpHeFT66shfeUlxR0PsCbG9vPRt/QmGLeYQZITppWo/ylSq4j+pRIuXvuWHdBRN + * rTZ8QF4Y7AxQUXVz1j1++s6ZMHTzaK2i9HrhmDs1MbJl+QwWre3Xpv3LvTVz3k5U + * wX8kuY1m3STt71QCaRWENq5sRaMImLxZbxc/ivFl9RAzUqo4NCxLod/QgA4iLqtO + * ztnlpzwlC/F8HbQ1oqYWwnZAPhzU/cULtstl+Yrws2c2atO323LbPXZqbASySgig + * sNpFXQMObdfP6LN23bY+1SvtK7V4NUTNhpdIc6INQAQ= + * -----END RSA PRIVATE KEY----- + * + * -----BEGIN RSA PRIVATE KEY----- + * MIICWwIBAAKBgQC78EA2rCZUTvSjWgAvaSFvuXo6k+yi9uGOx2PYLxIwmS6w8o/4 + * Jy0keCiE9wG/jUR53TvSVfPOPLJbIX3v/TNKsaP/xsibuQ98QTWX+ds6BWAFFa9Z + * F5KjEK0WHOQHU6+odqJWKpLT+SjgeM9eH0irXBnd4WdDunWN9YKsQ5JEGwIDAQAB + * AoGAEbdqNj0wN85hnWyEi/ObJU8UyKTdL9eaF72QGfcF/fLSxfd3vurihIeXOkGW + * tpn4lIxYcVGM9CognhqgJpl11jFTQzn1KqZ+NEJRKkCHA4hDabKJbSC9fXHvRwrf + * BsFpZqgiNxp3HseUTiwnaUVeyPgMt/jAj5nB5Sib+UyUxrECQQDnNQBiF2aifEg6 + * zbJOOC7he5CHAdkFxSxWVFVHL6EfXfqdLVkUohMbgZv+XxyIeU2biOExSg49Kds3 + * FOKgTau1AkEA0Bd1haj6QuCo8I0AXm2WO+MMTZMTvtHD/bGjKNM+fT4I8rKYnQRX + * 1acHdqS9Xx2rNJqZgkMmpESIdPR2fc4yjwJALFeM6EMmqvj8/VIf5UJ/Mz14fXwM + * PEARfckUxd9LnnFutCBTWlKvKXJVEZb6KO5ixPaegc57Jp3Vbh3yTN44lQJADD/1 + * SSMDaIB1MYP7a5Oj7m6VQNPRq8AJe5vDcRnOae0G9dKRrVyeFxO4GsHj6/+BHp2j + * P8nYMn9eURQ7DXjf/QJAAQzMlWnKGSO8pyTDtnQx3hRMoUkOEhmNq4bQhLkYqtnY + * FcqpUQ2qMjW+NiNWk5HnTrMS3L9EdJobMUzaNZLy4w== + * -----END RSA PRIVATE KEY----- + * + * Private-Key: (1024 bit) + * modulus: + * 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69: + * 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f: + * 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7: + * 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21: + * 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41: + * 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10: + * ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9: + * 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba: + * 75:8d:f5:82:ac:43:92:44:1b + * publicExponent: 65537 (0x10001) + * privateExponent: + * 11:b7:6a:36:3d:30:37:ce:61:9d:6c:84:8b:f3:9b: + * 25:4f:14:c8:a4:dd:2f:d7:9a:17:bd:90:19:f7:05: + * fd:f2:d2:c5:f7:77:be:ea:e2:84:87:97:3a:41:96: + * b6:99:f8:94:8c:58:71:51:8c:f4:2a:20:9e:1a:a0: + * 26:99:75:d6:31:53:43:39:f5:2a:a6:7e:34:42:51: + * 2a:40:87:03:88:43:69:b2:89:6d:20:bd:7d:71:ef: + * 47:0a:df:06:c1:69:66:a8:22:37:1a:77:1e:c7:94: + * 4e:2c:27:69:45:5e:c8:f8:0c:b7:f8:c0:8f:99:c1: + * e5:28:9b:f9:4c:94:c6:b1 + * prime1: + * 00:e7:35:00:62:17:66:a2:7c:48:3a:cd:b2:4e:38: + * 2e:e1:7b:90:87:01:d9:05:c5:2c:56:54:55:47:2f: + * a1:1f:5d:fa:9d:2d:59:14:a2:13:1b:81:9b:fe:5f: + * 1c:88:79:4d:9b:88:e1:31:4a:0e:3d:29:db:37:14: + * e2:a0:4d:ab:b5 + * prime2: + * 00:d0:17:75:85:a8:fa:42:e0:a8:f0:8d:00:5e:6d: + * 96:3b:e3:0c:4d:93:13:be:d1:c3:fd:b1:a3:28:d3: + * 3e:7d:3e:08:f2:b2:98:9d:04:57:d5:a7:07:76:a4: + * bd:5f:1d:ab:34:9a:99:82:43:26:a4:44:88:74:f4: + * 76:7d:ce:32:8f + * exponent1: + * 2c:57:8c:e8:43:26:aa:f8:fc:fd:52:1f:e5:42:7f: + * 33:3d:78:7d:7c:0c:3c:40:11:7d:c9:14:c5:df:4b: + * 9e:71:6e:b4:20:53:5a:52:af:29:72:55:11:96:fa: + * 28:ee:62:c4:f6:9e:81:ce:7b:26:9d:d5:6e:1d:f2: + * 4c:de:38:95 + * exponent2: + * 0c:3f:f5:49:23:03:68:80:75:31:83:fb:6b:93:a3: + * ee:6e:95:40:d3:d1:ab:c0:09:7b:9b:c3:71:19:ce: + * 69:ed:06:f5:d2:91:ad:5c:9e:17:13:b8:1a:c1:e3: + * eb:ff:81:1e:9d:a3:3f:c9:d8:32:7f:5e:51:14:3b: + * 0d:78:df:fd + * coefficient: + * 01:0c:cc:95:69:ca:19:23:bc:a7:24:c3:b6:74:31: + * de:14:4c:a1:49:0e:12:19:8d:ab:86:d0:84:b9:18: + * aa:d9:d8:15:ca:a9:51:0d:aa:32:35:be:36:23:56: + * 93:91:e7:4e:b3:12:dc:bf:44:74:9a:1b:31:4c:da: + * 35:92:f2:e3 + * + * client certificate: + * Data: + * Version: 3 (0x2) + * Serial Number: 9 (0x9) + * Signature Algorithm: md5WithRSAEncryption + * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org + * Validity + * Not Before: Dec 8 03:43:24 2008 GMT + * Not After : Aug 25 03:43:24 2028 GMT + * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Client, CN=localhost + * Subject Public Key Info: + * Public Key Algorithm: rsaEncryption + * RSA Public Key: (1024 bit) + * Modulus (1024 bit): + * 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69: + * 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f: + * 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7: + * 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21: + * 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41: + * 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10: + * ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9: + * 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba: + * 75:8d:f5:82:ac:43:92:44:1b + * Exponent: 65537 (0x10001) + * X509v3 extensions: + * X509v3 Basic Constraints: + * CA:FALSE + * X509v3 Key Usage: + * Digital Signature, Non Repudiation, Key Encipherment + * X509v3 Subject Key Identifier: + * CD:BB:C8:85:AA:91:BD:FD:1D:BE:CD:67:7C:FF:B3:E9:4C:A8:22:E6 + * X509v3 Authority Key Identifier: + * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 + * + * X509v3 Subject Alternative Name: critical + * DNS:localhost + * Signature Algorithm: md5WithRSAEncryption + * + * -----BEGIN CERTIFICATE----- + * MIICpDCCAg2gAwIBAgIBCTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET + * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK + * EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMjRaFw0yODA4MjUwMzQzMjRaMHIxCzAJ + * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp + * dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD + * VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas + * JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV + * 8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq + * ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjczBxMAkGA1UdEwQCMAAw + * CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV + * HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh + * bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAm25gJyqW1JznQ1EyOtTGswBVwfgBOf+F + * HJuBTcflYQLbTD/AETPQJGvZU9tdhuLtbG3OPhR7vSY8zeAbfM3dbH7QFr3r47Gj + * XEH7qM/MX+Z3ifVaC4MeJmrYQkYFSuKeyyKpdRVX4w4nnFHF6OsNASsYrMW6LpxN + * cl/epUcHL7E= + * -----END CERTIFICATE----- + * + * + * + * Trusted CA certificate: + * Certificate: + * Data: + * Version: 3 (0x2) + * Serial Number: 0 (0x0) + * Signature Algorithm: md5WithRSAEncryption + * Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org + * Validity + * Not Before: Dec 8 02:43:36 2008 GMT + * Not After : Aug 25 02:43:36 2028 GMT + * Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org + * Subject Public Key Info: + * Public Key Algorithm: rsaEncryption + * RSA Public Key: (1024 bit) + * Modulus (1024 bit): + * 00:cb:c4:38:20:07:be:88:a7:93:b0:a1:43:51:2d: + * d7:8e:85:af:54:dd:ad:a2:7b:23:5b:cf:99:13:53: + * 99:45:7d:ee:6d:ba:2d:bf:e3:ad:6e:3d:9f:1a:f9: + * 03:97:e0:17:55:ae:11:26:57:de:01:29:8e:05:3f: + * 21:f7:e7:36:e8:2e:37:d7:48:ac:53:d6:60:0e:c7: + * 50:6d:f6:c5:85:f7:8b:a6:c5:91:35:72:3c:94:ee: + * f1:17:f0:71:e3:ec:1b:ce:ca:4e:40:42:b0:6d:ee: + * 6a:0e:d6:e5:ad:3c:0f:c9:ba:82:4f:78:f8:89:97: + * 89:2a:95:12:4c:d8:09:2a:e9 + * Exponent: 65537 (0x10001) + * X509v3 extensions: + * X509v3 Subject Key Identifier: + * FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 + * X509v3 Authority Key Identifier: + * keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14 + * DirName:/C=US/ST=Some-State/L=Some-City/O=Some-Org + * serial:00 + * + * X509v3 Basic Constraints: + * CA:TRUE + * Signature Algorithm: md5WithRSAEncryption + * + * -----BEGIN CERTIFICATE----- + * MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET + * MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK + * EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ + * BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp + * dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB + * gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX + * 4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj + * 7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G + * A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ + * hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt + * U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw + * DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA + * ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ + * LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P + * 6Mvf0r1PNTY2hwTJLJmKtg== + * -----END CERTIFICATE--- + */ + + +public class SunX509ExtendedTM { + + /* + * ============================================================= + * Set the various variables needed for the tests, then + * specify what tests to run on each side. + */ + + /* + * Should we run the client or server in a separate thread? + * Both sides can throw exceptions, but do you have a preference + * as to which side should be the main thread. + */ + static boolean separateServerThread = false; + + /* + * Where do we find the keystores? + */ + static String trusedCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" + + "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" + + "EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ\n" + + "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" + + "dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n" + + "gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX\n" + + "4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj\n" + + "7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G\n" + + "A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ\n" + + "hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt\n" + + "U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw\n" + + "DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA\n" + + "ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ\n" + + "LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P\n" + + "6Mvf0r1PNTY2hwTJLJmKtg==\n" + + "-----END CERTIFICATE-----"; + + static String serverCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICpDCCAg2gAwIBAgIBCDANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" + + "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" + + "EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMDRaFw0yODA4MjUwMzQzMDRaMHIxCzAJ\n" + + "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" + + "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtU2VydmVyMRIwEAYD\n" + + "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKWsWxw3\n" + + "ot2ZiS2yebiP1Uil5xyEF41pnMasbfnyHR85GdrTch5u7ETMcKTcugAw9qBPPVR6\n" + + "YWrMV9AKf5UoGD+a2ZTyG8gkiH7+nQ89+1dTCLMgM9Q/F0cU0c3qCNgOdU6vvszS\n" + + "7K+peknfwtmsuCRAkKYDVirQMAVALE+r2XSJAgMBAAGjczBxMAkGA1UdEwQCMAAw\n" + + "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTtbtv0tVbI+xoGYT8PCLumBNgWVDAfBgNV\n" + + "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh\n" + + "bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAoqVTciHtcvsUj+YaTct8tUh3aTCsKsac\n" + + "PHhfQ+ObjiXSgxsKYTX7ym/wk/wvlbUcbqLKxsu7qrcJitH+H9heV1hEHEu65Uoi\n" + + "nRugFruyOrwvAylV8Cm2af7ddilmYJ+sdJA6N2M3xJRxR0G2LFHEXDNEjYReyexn\n" + + "JqCpf5uZGOo=\n" + + "-----END CERTIFICATE-----"; + + static String clientCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICpDCCAg2gAwIBAgIBCTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" + + "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" + + "EwhTb21lLU9yZzAeFw0wODEyMDgwMzQzMjRaFw0yODA4MjUwMzQzMjRaMHIxCzAJ\n" + + "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" + + "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD\n" + + "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas\n" + + "JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV\n" + + "8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq\n" + + "ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjczBxMAkGA1UdEwQCMAAw\n" + + "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV\n" + + "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDAXBgNVHREBAf8EDTALgglsb2Nh\n" + + "bGhvc3QwDQYJKoZIhvcNAQEEBQADgYEAm25gJyqW1JznQ1EyOtTGswBVwfgBOf+F\n" + + "HJuBTcflYQLbTD/AETPQJGvZU9tdhuLtbG3OPhR7vSY8zeAbfM3dbH7QFr3r47Gj\n" + + "XEH7qM/MX+Z3ifVaC4MeJmrYQkYFSuKeyyKpdRVX4w4nnFHF6OsNASsYrMW6LpxN\n" + + "cl/epUcHL7E=\n" + + "-----END CERTIFICATE-----"; + + static byte serverPrivateExponent[] = { + (byte)0x6e, (byte)0xa7, (byte)0x1b, (byte)0x83, + (byte)0x51, (byte)0x35, (byte)0x9a, (byte)0x44, + (byte)0x7d, (byte)0xf6, (byte)0xe3, (byte)0x89, + (byte)0xa0, (byte)0xd7, (byte)0x90, (byte)0x60, + (byte)0xa1, (byte)0x4e, (byte)0x27, (byte)0x21, + (byte)0xa2, (byte)0x89, (byte)0x74, (byte)0xcc, + (byte)0x9d, (byte)0x75, (byte)0x75, (byte)0x4e, + (byte)0xc7, (byte)0x82, (byte)0xe3, (byte)0xe3, + (byte)0xc3, (byte)0x7d, (byte)0x00, (byte)0x54, + (byte)0xec, (byte)0x36, (byte)0xb1, (byte)0xdf, + (byte)0x91, (byte)0x9c, (byte)0x7a, (byte)0xc0, + (byte)0x62, (byte)0x0a, (byte)0xd6, (byte)0xa9, + (byte)0x22, (byte)0x91, (byte)0x4a, (byte)0x29, + (byte)0x2e, (byte)0x43, (byte)0xfa, (byte)0x8c, + (byte)0xd8, (byte)0xe9, (byte)0xbe, (byte)0xd9, + (byte)0x4f, (byte)0xca, (byte)0x23, (byte)0xc6, + (byte)0xe4, (byte)0x3f, (byte)0xb8, (byte)0x72, + (byte)0xcf, (byte)0x02, (byte)0xfc, (byte)0xf4, + (byte)0x58, (byte)0x34, (byte)0x77, (byte)0x76, + (byte)0xce, (byte)0x22, (byte)0x44, (byte)0x5f, + (byte)0x2d, (byte)0xca, (byte)0xee, (byte)0xf5, + (byte)0x43, (byte)0x56, (byte)0x47, (byte)0x71, + (byte)0x0b, (byte)0x09, (byte)0x6b, (byte)0x5e, + (byte)0xf2, (byte)0xc8, (byte)0xee, (byte)0xd4, + (byte)0x6e, (byte)0x44, (byte)0x92, (byte)0x2a, + (byte)0x7f, (byte)0xcc, (byte)0xa7, (byte)0xd4, + (byte)0x5b, (byte)0xfb, (byte)0xf7, (byte)0x4a, + (byte)0xa9, (byte)0xfb, (byte)0x54, (byte)0x18, + (byte)0xd5, (byte)0xd5, (byte)0x14, (byte)0xba, + (byte)0xa0, (byte)0x1c, (byte)0x13, (byte)0xb3, + (byte)0x37, (byte)0x6b, (byte)0x37, (byte)0x59, + (byte)0xed, (byte)0xdb, (byte)0x6d, (byte)0xb1 + }; + + static byte serverModulus[] = { + (byte)0x00, + (byte)0xa5, (byte)0xac, (byte)0x5b, (byte)0x1c, + (byte)0x37, (byte)0xa2, (byte)0xdd, (byte)0x99, + (byte)0x89, (byte)0x2d, (byte)0xb2, (byte)0x79, + (byte)0xb8, (byte)0x8f, (byte)0xd5, (byte)0x48, + (byte)0xa5, (byte)0xe7, (byte)0x1c, (byte)0x84, + (byte)0x17, (byte)0x8d, (byte)0x69, (byte)0x9c, + (byte)0xc6, (byte)0xac, (byte)0x6d, (byte)0xf9, + (byte)0xf2, (byte)0x1d, (byte)0x1f, (byte)0x39, + (byte)0x19, (byte)0xda, (byte)0xd3, (byte)0x72, + (byte)0x1e, (byte)0x6e, (byte)0xec, (byte)0x44, + (byte)0xcc, (byte)0x70, (byte)0xa4, (byte)0xdc, + (byte)0xba, (byte)0x00, (byte)0x30, (byte)0xf6, + (byte)0xa0, (byte)0x4f, (byte)0x3d, (byte)0x54, + (byte)0x7a, (byte)0x61, (byte)0x6a, (byte)0xcc, + (byte)0x57, (byte)0xd0, (byte)0x0a, (byte)0x7f, + (byte)0x95, (byte)0x28, (byte)0x18, (byte)0x3f, + (byte)0x9a, (byte)0xd9, (byte)0x94, (byte)0xf2, + (byte)0x1b, (byte)0xc8, (byte)0x24, (byte)0x88, + (byte)0x7e, (byte)0xfe, (byte)0x9d, (byte)0x0f, + (byte)0x3d, (byte)0xfb, (byte)0x57, (byte)0x53, + (byte)0x08, (byte)0xb3, (byte)0x20, (byte)0x33, + (byte)0xd4, (byte)0x3f, (byte)0x17, (byte)0x47, + (byte)0x14, (byte)0xd1, (byte)0xcd, (byte)0xea, + (byte)0x08, (byte)0xd8, (byte)0x0e, (byte)0x75, + (byte)0x4e, (byte)0xaf, (byte)0xbe, (byte)0xcc, + (byte)0xd2, (byte)0xec, (byte)0xaf, (byte)0xa9, + (byte)0x7a, (byte)0x49, (byte)0xdf, (byte)0xc2, + (byte)0xd9, (byte)0xac, (byte)0xb8, (byte)0x24, + (byte)0x40, (byte)0x90, (byte)0xa6, (byte)0x03, + (byte)0x56, (byte)0x2a, (byte)0xd0, (byte)0x30, + (byte)0x05, (byte)0x40, (byte)0x2c, (byte)0x4f, + (byte)0xab, (byte)0xd9, (byte)0x74, (byte)0x89 + }; + + static byte clientPrivateExponent[] = { + (byte)0x11, (byte)0xb7, (byte)0x6a, (byte)0x36, + (byte)0x3d, (byte)0x30, (byte)0x37, (byte)0xce, + (byte)0x61, (byte)0x9d, (byte)0x6c, (byte)0x84, + (byte)0x8b, (byte)0xf3, (byte)0x9b, (byte)0x25, + (byte)0x4f, (byte)0x14, (byte)0xc8, (byte)0xa4, + (byte)0xdd, (byte)0x2f, (byte)0xd7, (byte)0x9a, + (byte)0x17, (byte)0xbd, (byte)0x90, (byte)0x19, + (byte)0xf7, (byte)0x05, (byte)0xfd, (byte)0xf2, + (byte)0xd2, (byte)0xc5, (byte)0xf7, (byte)0x77, + (byte)0xbe, (byte)0xea, (byte)0xe2, (byte)0x84, + (byte)0x87, (byte)0x97, (byte)0x3a, (byte)0x41, + (byte)0x96, (byte)0xb6, (byte)0x99, (byte)0xf8, + (byte)0x94, (byte)0x8c, (byte)0x58, (byte)0x71, + (byte)0x51, (byte)0x8c, (byte)0xf4, (byte)0x2a, + (byte)0x20, (byte)0x9e, (byte)0x1a, (byte)0xa0, + (byte)0x26, (byte)0x99, (byte)0x75, (byte)0xd6, + (byte)0x31, (byte)0x53, (byte)0x43, (byte)0x39, + (byte)0xf5, (byte)0x2a, (byte)0xa6, (byte)0x7e, + (byte)0x34, (byte)0x42, (byte)0x51, (byte)0x2a, + (byte)0x40, (byte)0x87, (byte)0x03, (byte)0x88, + (byte)0x43, (byte)0x69, (byte)0xb2, (byte)0x89, + (byte)0x6d, (byte)0x20, (byte)0xbd, (byte)0x7d, + (byte)0x71, (byte)0xef, (byte)0x47, (byte)0x0a, + (byte)0xdf, (byte)0x06, (byte)0xc1, (byte)0x69, + (byte)0x66, (byte)0xa8, (byte)0x22, (byte)0x37, + (byte)0x1a, (byte)0x77, (byte)0x1e, (byte)0xc7, + (byte)0x94, (byte)0x4e, (byte)0x2c, (byte)0x27, + (byte)0x69, (byte)0x45, (byte)0x5e, (byte)0xc8, + (byte)0xf8, (byte)0x0c, (byte)0xb7, (byte)0xf8, + (byte)0xc0, (byte)0x8f, (byte)0x99, (byte)0xc1, + (byte)0xe5, (byte)0x28, (byte)0x9b, (byte)0xf9, + (byte)0x4c, (byte)0x94, (byte)0xc6, (byte)0xb1 + }; + + static byte clientModulus[] = { + (byte)0x00, + (byte)0xbb, (byte)0xf0, (byte)0x40, (byte)0x36, + (byte)0xac, (byte)0x26, (byte)0x54, (byte)0x4e, + (byte)0xf4, (byte)0xa3, (byte)0x5a, (byte)0x00, + (byte)0x2f, (byte)0x69, (byte)0x21, (byte)0x6f, + (byte)0xb9, (byte)0x7a, (byte)0x3a, (byte)0x93, + (byte)0xec, (byte)0xa2, (byte)0xf6, (byte)0xe1, + (byte)0x8e, (byte)0xc7, (byte)0x63, (byte)0xd8, + (byte)0x2f, (byte)0x12, (byte)0x30, (byte)0x99, + (byte)0x2e, (byte)0xb0, (byte)0xf2, (byte)0x8f, + (byte)0xf8, (byte)0x27, (byte)0x2d, (byte)0x24, + (byte)0x78, (byte)0x28, (byte)0x84, (byte)0xf7, + (byte)0x01, (byte)0xbf, (byte)0x8d, (byte)0x44, + (byte)0x79, (byte)0xdd, (byte)0x3b, (byte)0xd2, + (byte)0x55, (byte)0xf3, (byte)0xce, (byte)0x3c, + (byte)0xb2, (byte)0x5b, (byte)0x21, (byte)0x7d, + (byte)0xef, (byte)0xfd, (byte)0x33, (byte)0x4a, + (byte)0xb1, (byte)0xa3, (byte)0xff, (byte)0xc6, + (byte)0xc8, (byte)0x9b, (byte)0xb9, (byte)0x0f, + (byte)0x7c, (byte)0x41, (byte)0x35, (byte)0x97, + (byte)0xf9, (byte)0xdb, (byte)0x3a, (byte)0x05, + (byte)0x60, (byte)0x05, (byte)0x15, (byte)0xaf, + (byte)0x59, (byte)0x17, (byte)0x92, (byte)0xa3, + (byte)0x10, (byte)0xad, (byte)0x16, (byte)0x1c, + (byte)0xe4, (byte)0x07, (byte)0x53, (byte)0xaf, + (byte)0xa8, (byte)0x76, (byte)0xa2, (byte)0x56, + (byte)0x2a, (byte)0x92, (byte)0xd3, (byte)0xf9, + (byte)0x28, (byte)0xe0, (byte)0x78, (byte)0xcf, + (byte)0x5e, (byte)0x1f, (byte)0x48, (byte)0xab, + (byte)0x5c, (byte)0x19, (byte)0xdd, (byte)0xe1, + (byte)0x67, (byte)0x43, (byte)0xba, (byte)0x75, + (byte)0x8d, (byte)0xf5, (byte)0x82, (byte)0xac, + (byte)0x43, (byte)0x92, (byte)0x44, (byte)0x1b + }; + + static char passphrase[] = "passphrase".toCharArray(); + + /* + * Is the server ready to serve? + */ + volatile static boolean serverReady = false; + + /* + * Turn on SSL debugging? + */ + static boolean debug = false; + + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doServerSide() throws Exception { + SSLContext context = getSSLContext(trusedCertStr, serverCertStr, + serverModulus, serverPrivateExponent, passphrase); + SSLServerSocketFactory sslssf = context.getServerSocketFactory(); + + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + serverPort = sslServerSocket.getLocalPort(); + + + // enable endpoint identification + // ignore, we may test the feature when known how to parse client + // hostname + //SSLParameters params = sslServerSocket.getSSLParameters(); + //params.setEndpointIdentificationAlgorithm("HTTPS"); + //sslServerSocket.setSSLParameters(params); + + /* + * Signal Client, we're ready for his connect. + */ + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + sslSocket.setNeedClientAuth(true); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslIS.read(); + sslOS.write(85); + sslOS.flush(); + + sslSocket.close(); + + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doClientSide() throws Exception { + /* + * Wait for server to get started. + */ + while (!serverReady) { + Thread.sleep(50); + } + + SSLContext context = getSSLContext(trusedCertStr, clientCertStr, + clientModulus, clientPrivateExponent, passphrase); + + SSLSocketFactory sslsf = context.getSocketFactory(); + SSLSocket sslSocket = (SSLSocket) + sslsf.createSocket("localhost", serverPort); + + // enable endpoint identification + SSLParameters params = sslSocket.getSSLParameters(); + params.setEndpointIdentificationAlgorithm("HTTPS"); + sslSocket.setSSLParameters(params); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslOS.write(280); + sslOS.flush(); + sslIS.read(); + + sslSocket.close(); + + } + + // get the ssl context + private static SSLContext getSSLContext(String trusedCertStr, + String keyCertStr, byte[] modulus, + byte[] privateExponent, char[] passphrase) throws Exception { + + // generate certificate from cert string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + ByteArrayInputStream is = + new ByteArrayInputStream(trusedCertStr.getBytes()); + Certificate trusedCert = cf.generateCertificate(is); + is.close(); + + // create a key store + KeyStore ks = KeyStore.getInstance("JKS"); + ks.load(null, null); + + // import the trused cert + ks.setCertificateEntry("RSA Export Signer", trusedCert); + + if (keyCertStr != null) { + // generate the private key. + RSAPrivateKeySpec priKeySpec = new RSAPrivateKeySpec( + new BigInteger(modulus), + new BigInteger(privateExponent)); + KeyFactory kf = KeyFactory.getInstance("RSA"); + RSAPrivateKey priKey = + (RSAPrivateKey)kf.generatePrivate(priKeySpec); + + // generate certificate chain + is = new ByteArrayInputStream(keyCertStr.getBytes()); + Certificate keyCert = cf.generateCertificate(is); + is.close(); + + Certificate[] chain = new Certificate[2]; + chain[0] = keyCert; + chain[1] = trusedCert; + + // import the key entry. + ks.setKeyEntry("Whatever", priKey, passphrase, chain); + } + + // create SSL context + TrustManagerFactory tmf = + TrustManagerFactory.getInstance("SunX509"); + tmf.init(ks); + + TrustManager tms[] = tmf.getTrustManagers(); + if (tms == null || tms.length == 0) { + throw new Exception("unexpected trust manager implementation"); + } else { + if (!(tms[0] instanceof X509ExtendedTrustManager)) { + throw new Exception("unexpected trust manager implementation: " + + tms[0].getClass().getCanonicalName()); + } + } + + + SSLContext ctx = SSLContext.getInstance("TLS"); + + if (keyCertStr != null) { + KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); + kmf.init(ks, passphrase); + + ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + } else { + ctx.init(null, tmf.getTrustManagers(), null); + } + + return ctx; + } + + /* + * ============================================================= + * The remainder is just support stuff + */ + + // use any free port by default + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + public static void main(String args[]) throws Exception { + if (debug) + System.setProperty("javax.net.debug", "all"); + + /* + * Start the tests. + */ + new SunX509ExtendedTM(); + } + + Thread clientThread = null; + Thread serverThread = null; + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + SunX509ExtendedTM() throws Exception { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * + * If the main thread excepted, that propagates back + * immediately. If the other thread threw an exception, we + * should report back. + */ + if (serverException != null) + throw serverException; + if (clientException != null) + throw clientException; + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + doServerSide(); + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + doClientSide(); + } + } + +} diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/X509ExtendedTMEnabled.java b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/X509ExtendedTMEnabled.java new file mode 100644 index 00000000000..5796abe2074 --- /dev/null +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/X509ExtendedTMEnabled.java @@ -0,0 +1,384 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6916074 + * @summary Add support for TLS 1.2 + * + * Ensure that the SunJSSE provider enables the X509ExtendedTrustManager. + */ + +import java.io.*; +import java.net.*; +import javax.net.ssl.*; +import java.security.cert.*; +import java.security.*; + +public class X509ExtendedTMEnabled { + + /* + * ============================================================= + * Set the various variables needed for the tests, then + * specify what tests to run on each side. + */ + + /* + * Should we run the client or server in a separate thread? + * Both sides can throw exceptions, but do you have a preference + * as to which side should be the main thread. + */ + static boolean separateServerThread = true; + + /* + * Where do we find the keystores? + */ + static String pathToStores = "../../../../../../../etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + private final static char[] cpasswd = "passphrase".toCharArray(); + + /* + * Is the server ready to serve? + */ + volatile static boolean serverReady = false; + + /* + * Turn on SSL debugging? + */ + static boolean debug = false; + + /* + * If the client or server is doing some kind of object creation + * that the other side depends on, and that thread prematurely + * exits, you may experience a hang. The test harness will + * terminate all hung threads after its timeout has expired, + * currently 3 minutes by default, but you might try to be + * smart about it.... + */ + + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doServerSide() throws Exception { + SSLServerSocketFactory sslssf = + getContext(true).getServerSocketFactory(); + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + serverPort = sslServerSocket.getLocalPort(); + + // enable endpoint identification + // ignore, we may test the feature when known how to parse client + // hostname + //SSLParameters params = sslServerSocket.getSSLParameters(); + //params.setEndpointIdentificationAlgorithm("HTTPS"); + //sslServerSocket.setSSLParameters(params); + + /* + * Signal Client, we're ready for his connect. + */ + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + sslSocket.setNeedClientAuth(true); + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslIS.read(); + sslOS.write(85); + sslOS.flush(); + + sslSocket.close(); + + if (!serverTM.wasServerChecked() && serverTM.wasClientChecked()) { + System.out.println("SERVER TEST PASSED!"); + } else { + throw new Exception("SERVER TEST FAILED! " + + !serverTM.wasServerChecked() + " " + + serverTM.wasClientChecked()); + } + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doClientSide() throws Exception { + + /* + * Wait for server to get started. + */ + while (!serverReady) { + Thread.sleep(50); + } + + SSLSocketFactory sslsf = getContext(false).getSocketFactory(); + SSLSocket sslSocket = (SSLSocket) + sslsf.createSocket("localhost", serverPort); + + // enable endpoint identification + SSLParameters params = sslSocket.getSSLParameters(); + params.setEndpointIdentificationAlgorithm("HTTPS"); + sslSocket.setSSLParameters(params); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslOS.write(280); + sslOS.flush(); + sslIS.read(); + + sslSocket.close(); + + if (clientTM.wasServerChecked() && !clientTM.wasClientChecked()) { + System.out.println("CLIENT TEST PASSED!"); + } else { + throw new Exception("CLIENT TEST FAILED! " + + clientTM.wasServerChecked() + " " + + !clientTM.wasClientChecked()); + } + } + + MyExtendedX509TM serverTM; + MyExtendedX509TM clientTM; + + private SSLContext getContext(boolean server) throws Exception { + String keyFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + trustStoreFile; + + KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); + KeyStore ks = KeyStore.getInstance("JKS"); + ks.load(new FileInputStream(keyFilename), cpasswd); + kmf.init(ks, cpasswd); + + TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); + KeyStore ts = KeyStore.getInstance("JKS"); + ts.load(new FileInputStream(trustFilename), cpasswd); + tmf.init(ts); + + TrustManager tms[] = tmf.getTrustManagers(); + if (tms == null || tms.length == 0) { + throw new Exception("unexpected trust manager implementation"); + } else { + if (!(tms[0] instanceof X509TrustManager)) { + throw new Exception("unexpected trust manager implementation: " + + tms[0].getClass().getCanonicalName()); + } + } + + if (server) { + serverTM = new MyExtendedX509TM((X509TrustManager)tms[0]); + + tms = new TrustManager[] {serverTM}; + } else { + clientTM = new MyExtendedX509TM((X509TrustManager)tms[0]); + + tms = new TrustManager[] {clientTM}; + } + + SSLContext ctx = SSLContext.getInstance("TLS"); + ctx.init(kmf.getKeyManagers(), tms, null); + + return ctx; + } + + static class MyExtendedX509TM extends X509ExtendedTrustManager + implements X509TrustManager { + + X509TrustManager tm; + + boolean clientChecked; + boolean serverChecked; + + MyExtendedX509TM(X509TrustManager tm) { + clientChecked = false; + serverChecked = false; + + this.tm = tm; + } + + public boolean wasClientChecked() { + return clientChecked; + } + + public boolean wasServerChecked() { + return serverChecked; + } + + + public void checkClientTrusted(X509Certificate chain[], String authType) + throws CertificateException { + tm.checkClientTrusted(chain, authType); + } + + public void checkServerTrusted(X509Certificate chain[], String authType) + throws CertificateException { + tm.checkServerTrusted(chain, authType); + } + + public X509Certificate[] getAcceptedIssuers() { + return tm.getAcceptedIssuers(); + } + + public void checkClientTrusted(X509Certificate[] chain, String authType, + Socket socket) throws CertificateException { + clientChecked = true; + tm.checkClientTrusted(chain, authType); + } + + public void checkServerTrusted(X509Certificate[] chain, String authType, + Socket socket) throws CertificateException { + serverChecked = true; + tm.checkServerTrusted(chain, authType); + } + + public void checkClientTrusted(X509Certificate[] chain, String authType, + SSLEngine engine) throws CertificateException { + clientChecked = true; + tm.checkClientTrusted(chain, authType); + } + + public void checkServerTrusted(X509Certificate[] chain, String authType, + SSLEngine engine) throws CertificateException { + serverChecked = true; + tm.checkServerTrusted(chain, authType); + } + } + + /* + * ============================================================= + * The remainder is just support stuff + */ + + // use any free port by default + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + public static void main(String[] args) throws Exception { + + if (debug) + System.setProperty("javax.net.debug", "all"); + + /* + * Start the tests. + */ + new X509ExtendedTMEnabled(); + } + + Thread clientThread = null; + Thread serverThread = null; + + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + X509ExtendedTMEnabled() throws Exception { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * + * If the main thread excepted, that propagates back + * immediately. If the other thread threw an exception, we + * should report back. + */ + if (serverException != null) + throw serverException; + if (clientException != null) + throw clientException; + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + doServerSide(); + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + doClientSide(); + } + } +} + diff --git a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/CheckMyTrustedKeystore.java b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/CheckMyTrustedKeystore.java index 817cf1d81ff..925be00f5cc 100644 --- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/CheckMyTrustedKeystore.java +++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/CheckMyTrustedKeystore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4329114 * @summary Need better way of reflecting the reason when a chain is * rejected as untrusted. + * @ignore JSSE supports algorithm constraints with CR 6916074, + * need to update this test case in JDK 7 soon * This is a serious hack job! * @author Brad Wetmore */ diff --git a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/Basics.java b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/Basics.java index 47526634e6e..9f73c8dccf5 100644 --- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/Basics.java +++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/Basics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4495742 * @summary Add non-blocking SSL/TLS functionality, usable with any * I/O abstraction + * @ignore JSSE supported cipher suites are changed with CR 6916074, + * need to update this test case in JDK 7 soon * * This is intended to test many of the basic API calls to the SSLEngine * interface. This doesn't really exercise much of the SSL code. diff --git a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/TestAllSuites.java b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/TestAllSuites.java index 6b477a2bf20..9781614318d 100644 --- a/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/TestAllSuites.java +++ b/jdk/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/TestAllSuites.java @@ -24,6 +24,8 @@ /* * @test * @bug 4495742 + * @ignore JSSE supported cipher suites are changed with CR 6916074, + * need to update this test case in JDK 7 soon * @run main/timeout=180 TestAllSuites * @summary Add non-blocking SSL/TLS functionality, usable with any * I/O abstraction diff --git a/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/EmptyCertificateAuthorities.java b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/EmptyCertificateAuthorities.java new file mode 100644 index 00000000000..5afb0045296 --- /dev/null +++ b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/EmptyCertificateAuthorities.java @@ -0,0 +1,371 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4873188 + * @summary Support TLS 1.1 + * @run main/othervm -Djavax.net.debug=all EmptyCertificateAuthorities + * + * @author Xuelei Fan + */ + +import java.io.*; +import java.net.*; +import java.security.*; +import java.security.cert.*; +import javax.net.ssl.*; + +public class EmptyCertificateAuthorities { + + /* + * ============================================================= + * Set the various variables needed for the tests, then + * specify what tests to run on each side. + */ + + /* + * Should we run the client or server in a separate thread? + * Both sides can throw exceptions, but do you have a preference + * as to which side should be the main thread. + */ + static boolean separateServerThread = false; + + /* + * Where do we find the keystores? + */ + static String pathToStores = "/../../../../etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + + /* + * Is the server ready to serve? + */ + volatile static boolean serverReady = false; + + /* + * Turn on SSL debugging? + */ + static boolean debug = false; + + /* + * If the client or server is doing some kind of object creation + * that the other side depends on, and that thread prematurely + * exits, you may experience a hang. The test harness will + * terminate all hung threads after its timeout has expired, + * currently 3 minutes by default, but you might try to be + * smart about it.... + */ + + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doServerSide() throws Exception { + SSLServerSocketFactory sslssf = getSSLServerSF(); + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + + // require client authentication. + sslServerSocket.setNeedClientAuth(true); + + serverPort = sslServerSocket.getLocalPort(); + + /* + * Signal Client, we're ready for his connect. + */ + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslIS.read(); + sslOS.write('A'); + sslOS.flush(); + + sslSocket.close(); + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doClientSide() throws Exception { + + /* + * Wait for server to get started. + */ + while (!serverReady) { + Thread.sleep(50); + } + + SSLSocketFactory sslsf = + (SSLSocketFactory) SSLSocketFactory.getDefault(); + SSLSocket sslSocket = (SSLSocket) + sslsf.createSocket("localhost", serverPort); + + // enable TLSv1.1 only + sslSocket.setEnabledProtocols(new String[] {"TLSv1.1"}); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslOS.write('B'); + sslOS.flush(); + sslIS.read(); + + sslSocket.close(); + } + + private SSLServerSocketFactory getSSLServerSF() throws Exception { + + char [] password = + System.getProperty("javax.net.ssl.keyStorePassword").toCharArray(); + String keyFilename = System.getProperty("javax.net.ssl.keyStore"); + + KeyStore ks = KeyStore.getInstance("JKS"); + ks.load(new FileInputStream(keyFilename), password); + + KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509"); + kmf.init(ks, password); + + KeyManager[] kms = kmf.getKeyManagers(); + TrustManager[] tms = new MyX509TM[] {new MyX509TM()}; + + SSLContext ctx = SSLContext.getInstance("TLS"); + ctx.init(kms, tms, null); + + return ctx.getServerSocketFactory(); + } + + + static class MyX509TM implements X509TrustManager { + X509TrustManager tm; + + public void checkClientTrusted(X509Certificate[] chain, + String authType) throws CertificateException { + if (tm == null) { + initialize(); + } + tm.checkClientTrusted(chain, authType); + } + + public void checkServerTrusted(X509Certificate[] chain, + String authType) throws CertificateException { + if (tm == null) { + initialize(); + } + tm.checkServerTrusted(chain, authType); + } + + public X509Certificate[] getAcceptedIssuers() { + // always return empty array + return new X509Certificate[0]; + } + + private void initialize() throws CertificateException { + String passwd = + System.getProperty("javax.net.ssl.trustStorePassword"); + char [] password = passwd.toCharArray(); + String trustFilename = + System.getProperty("javax.net.ssl.trustStore"); + + try { + KeyStore ks = KeyStore.getInstance("JKS"); + ks.load(new FileInputStream(trustFilename), password); + + TrustManagerFactory tmf = + TrustManagerFactory.getInstance("PKIX"); + tmf.init(ks); + tm = (X509TrustManager)tmf.getTrustManagers()[0]; + } catch (Exception e) { + throw new CertificateException("Unable to initialize TM"); + } + + } + } + + /* + * ============================================================= + * The remainder is just support stuff + */ + + // use any free port by default + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + public static void main(String[] args) throws Exception { + String keyFilename = + System.getProperty("test.src", ".") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", ".") + "/" + pathToStores + + "/" + trustStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + System.setProperty("javax.net.ssl.trustStore", trustFilename); + System.setProperty("javax.net.ssl.trustStorePassword", passwd); + + if (debug) + System.setProperty("javax.net.debug", "all"); + + /* + * Start the tests. + */ + new EmptyCertificateAuthorities(); + } + + Thread clientThread = null; + Thread serverThread = null; + + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + EmptyCertificateAuthorities() throws Exception { + try { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + } catch (Exception e) { + // swallow for now. Show later + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * Which side threw the error? + */ + Exception local; + Exception remote; + String whichRemote; + + if (separateServerThread) { + remote = serverException; + local = clientException; + whichRemote = "server"; + } else { + remote = clientException; + local = serverException; + whichRemote = "client"; + } + + /* + * If both failed, return the curthread's exception, but also + * print the remote side Exception + */ + if ((local != null) && (remote != null)) { + System.out.println(whichRemote + " also threw:"); + remote.printStackTrace(); + System.out.println(); + throw local; + } + + if (remote != null) { + throw remote; + } + + if (local != null) { + throw local; + } + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + try { + doServerSide(); + } catch (Exception e) { + serverException = e; + } finally { + serverReady = true; + } + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + try { + doClientSide(); + } catch (Exception e) { + clientException = e; + } + } + } +} diff --git a/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/ExportableBlockCipher.java b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/ExportableBlockCipher.java new file mode 100644 index 00000000000..e3e30c65790 --- /dev/null +++ b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/ExportableBlockCipher.java @@ -0,0 +1,327 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4873188 + * @summary Support TLS 1.1 + * @run main/othervm -Djavax.net.debug=all ExportableBlockCipher + * + * @author Xuelei Fan + */ + +import java.io.*; +import java.net.*; +import javax.net.ssl.*; + +public class ExportableBlockCipher { + + /* + * ============================================================= + * Set the various variables needed for the tests, then + * specify what tests to run on each side. + */ + + /* + * Should we run the client or server in a separate thread? + * Both sides can throw exceptions, but do you have a preference + * as to which side should be the main thread. + */ + static boolean separateServerThread = false; + + /* + * Where do we find the keystores? + */ + static String pathToStores = "/../../../../etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + + /* + * Is the server ready to serve? + */ + volatile static boolean serverReady = false; + + /* + * Turn on SSL debugging? + */ + static boolean debug = false; + + /* + * If the client or server is doing some kind of object creation + * that the other side depends on, and that thread prematurely + * exits, you may experience a hang. The test harness will + * terminate all hung threads after its timeout has expired, + * currently 3 minutes by default, but you might try to be + * smart about it.... + */ + + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doServerSide() throws Exception { + SSLServerSocketFactory sslssf = + (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + + serverPort = sslServerSocket.getLocalPort(); + + /* + * Signal Client, we're ready for his connect. + */ + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + boolean interrupted = false; + try { + sslIS.read(); + sslOS.write('A'); + sslOS.flush(); + } catch (SSLException ssle) { + // get the expected exception + interrupted = true; + } finally { + sslSocket.close(); + } + + if (!interrupted) { + throw new SSLHandshakeException( + "A weak cipher suite is negotiated, " + + "TLSv1.1 must not negotiate the exportable cipher suites."); + } + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doClientSide() throws Exception { + + /* + * Wait for server to get started. + */ + while (!serverReady) { + Thread.sleep(50); + } + + SSLSocketFactory sslsf = + (SSLSocketFactory) SSLSocketFactory.getDefault(); + SSLSocket sslSocket = (SSLSocket) + sslsf.createSocket("localhost", serverPort); + + // enable TLSv1.1 only + sslSocket.setEnabledProtocols(new String[] {"TLSv1.1"}); + + // enable a exportable block cipher + sslSocket.setEnabledCipherSuites( + new String[] {"SSL_RSA_EXPORT_WITH_DES40_CBC_SHA"}); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + boolean interrupted = false; + try { + sslOS.write('B'); + sslOS.flush(); + sslIS.read(); + } catch (SSLException ssle) { + // get the expected exception + interrupted = true; + } finally { + sslSocket.close(); + } + + if (!interrupted) { + throw new SSLHandshakeException( + "A weak cipher suite is negotiated, " + + "TLSv1.1 must not negotiate the exportable cipher suites."); + } + } + + /* + * ============================================================= + * The remainder is just support stuff + */ + + // use any free port by default + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + public static void main(String[] args) throws Exception { + String keyFilename = + System.getProperty("test.src", ".") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", ".") + "/" + pathToStores + + "/" + trustStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + System.setProperty("javax.net.ssl.trustStore", trustFilename); + System.setProperty("javax.net.ssl.trustStorePassword", passwd); + + if (debug) + System.setProperty("javax.net.debug", "all"); + + /* + * Start the tests. + */ + new ExportableBlockCipher(); + } + + Thread clientThread = null; + Thread serverThread = null; + + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + ExportableBlockCipher() throws Exception { + try { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + } catch (Exception e) { + // swallow for now. Show later + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * Which side threw the error? + */ + Exception local; + Exception remote; + String whichRemote; + + if (separateServerThread) { + remote = serverException; + local = clientException; + whichRemote = "server"; + } else { + remote = clientException; + local = serverException; + whichRemote = "client"; + } + + /* + * If both failed, return the curthread's exception, but also + * print the remote side Exception + */ + if ((local != null) && (remote != null)) { + System.out.println(whichRemote + " also threw:"); + remote.printStackTrace(); + System.out.println(); + throw local; + } + + if (remote != null) { + throw remote; + } + + if (local != null) { + throw local; + } + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + try { + doServerSide(); + } catch (Exception e) { + serverException = e; + } finally { + serverReady = true; + } + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + try { + doClientSide(); + } catch (Exception e) { + clientException = e; + } + } + } +} diff --git a/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/ExportableStreamCipher.java b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/ExportableStreamCipher.java new file mode 100644 index 00000000000..11d91faef64 --- /dev/null +++ b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/ExportableStreamCipher.java @@ -0,0 +1,327 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4873188 + * @summary Support TLS 1.1 + * @run main/othervm -Djavax.net.debug=all ExportableStreamCipher + * + * @author Xuelei Fan + */ + +import java.io.*; +import java.net.*; +import javax.net.ssl.*; + +public class ExportableStreamCipher { + + /* + * ============================================================= + * Set the various variables needed for the tests, then + * specify what tests to run on each side. + */ + + /* + * Should we run the client or server in a separate thread? + * Both sides can throw exceptions, but do you have a preference + * as to which side should be the main thread. + */ + static boolean separateServerThread = false; + + /* + * Where do we find the keystores? + */ + static String pathToStores = "/../../../../etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + + /* + * Is the server ready to serve? + */ + volatile static boolean serverReady = false; + + /* + * Turn on SSL debugging? + */ + static boolean debug = false; + + /* + * If the client or server is doing some kind of object creation + * that the other side depends on, and that thread prematurely + * exits, you may experience a hang. The test harness will + * terminate all hung threads after its timeout has expired, + * currently 3 minutes by default, but you might try to be + * smart about it.... + */ + + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doServerSide() throws Exception { + SSLServerSocketFactory sslssf = + (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + + serverPort = sslServerSocket.getLocalPort(); + + /* + * Signal Client, we're ready for his connect. + */ + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + boolean interrupted = false; + try { + sslIS.read(); + sslOS.write('A'); + sslOS.flush(); + } catch (SSLException ssle) { + // get the expected exception + interrupted = true; + } finally { + sslSocket.close(); + } + + if (!interrupted) { + throw new SSLHandshakeException( + "A weak cipher suite is negotiated, " + + "TLSv1.1 must not negotiate the exportable cipher suites."); + } + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doClientSide() throws Exception { + + /* + * Wait for server to get started. + */ + while (!serverReady) { + Thread.sleep(50); + } + + SSLSocketFactory sslsf = + (SSLSocketFactory) SSLSocketFactory.getDefault(); + SSLSocket sslSocket = (SSLSocket) + sslsf.createSocket("localhost", serverPort); + + // enable TLSv1.1 only + sslSocket.setEnabledProtocols(new String[] {"TLSv1.1"}); + + // enable a exportable stream cipher + sslSocket.setEnabledCipherSuites( + new String[] {"SSL_RSA_EXPORT_WITH_RC4_40_MD5"}); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + boolean interrupted = false; + try { + sslOS.write('B'); + sslOS.flush(); + sslIS.read(); + } catch (SSLException ssle) { + // get the expected exception + interrupted = true; + } finally { + sslSocket.close(); + } + + if (!interrupted) { + throw new SSLHandshakeException( + "A weak cipher suite is negotiated, " + + "TLSv1.1 must not negotiate the exportable cipher suites."); + } + } + + /* + * ============================================================= + * The remainder is just support stuff + */ + + // use any free port by default + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + public static void main(String[] args) throws Exception { + String keyFilename = + System.getProperty("test.src", ".") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", ".") + "/" + pathToStores + + "/" + trustStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + System.setProperty("javax.net.ssl.trustStore", trustFilename); + System.setProperty("javax.net.ssl.trustStorePassword", passwd); + + if (debug) + System.setProperty("javax.net.debug", "all"); + + /* + * Start the tests. + */ + new ExportableStreamCipher(); + } + + Thread clientThread = null; + Thread serverThread = null; + + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + ExportableStreamCipher() throws Exception { + try { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + } catch (Exception e) { + // swallow for now. Show later + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * Which side threw the error? + */ + Exception local; + Exception remote; + String whichRemote; + + if (separateServerThread) { + remote = serverException; + local = clientException; + whichRemote = "server"; + } else { + remote = clientException; + local = serverException; + whichRemote = "client"; + } + + /* + * If both failed, return the curthread's exception, but also + * print the remote side Exception + */ + if ((local != null) && (remote != null)) { + System.out.println(whichRemote + " also threw:"); + remote.printStackTrace(); + System.out.println(); + throw local; + } + + if (remote != null) { + throw remote; + } + + if (local != null) { + throw local; + } + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + try { + doServerSide(); + } catch (Exception e) { + serverException = e; + } finally { + serverReady = true; + } + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + try { + doClientSide(); + } catch (Exception e) { + clientException = e; + } + } + } +} diff --git a/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericBlockCipher.java b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericBlockCipher.java new file mode 100644 index 00000000000..b56d3f13c03 --- /dev/null +++ b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericBlockCipher.java @@ -0,0 +1,303 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4873188 + * @summary Support TLS 1.1 + * @run main/othervm -Djavax.net.debug=all GenericBlockCipher + * + * @author Xuelei Fan + */ + +import java.io.*; +import java.net.*; +import javax.net.ssl.*; + +public class GenericBlockCipher { + + /* + * ============================================================= + * Set the various variables needed for the tests, then + * specify what tests to run on each side. + */ + + /* + * Should we run the client or server in a separate thread? + * Both sides can throw exceptions, but do you have a preference + * as to which side should be the main thread. + */ + static boolean separateServerThread = false; + + /* + * Where do we find the keystores? + */ + static String pathToStores = "/../../../../etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + + /* + * Is the server ready to serve? + */ + volatile static boolean serverReady = false; + + /* + * Turn on SSL debugging? + */ + static boolean debug = false; + + /* + * If the client or server is doing some kind of object creation + * that the other side depends on, and that thread prematurely + * exits, you may experience a hang. The test harness will + * terminate all hung threads after its timeout has expired, + * currently 3 minutes by default, but you might try to be + * smart about it.... + */ + + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doServerSide() throws Exception { + SSLServerSocketFactory sslssf = + (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + + serverPort = sslServerSocket.getLocalPort(); + + /* + * Signal Client, we're ready for his connect. + */ + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslIS.read(); + sslOS.write('A'); + sslOS.flush(); + + sslSocket.close(); + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doClientSide() throws Exception { + + /* + * Wait for server to get started. + */ + while (!serverReady) { + Thread.sleep(50); + } + + SSLSocketFactory sslsf = + (SSLSocketFactory) SSLSocketFactory.getDefault(); + SSLSocket sslSocket = (SSLSocket) + sslsf.createSocket("localhost", serverPort); + + // enable TLSv1.1 only + sslSocket.setEnabledProtocols(new String[] {"TLSv1.1"}); + + // enable a block cipher + sslSocket.setEnabledCipherSuites( + new String[] {"TLS_RSA_WITH_AES_128_CBC_SHA"}); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslOS.write('B'); + sslOS.flush(); + sslIS.read(); + + sslSocket.close(); + } + + /* + * ============================================================= + * The remainder is just support stuff + */ + + // use any free port by default + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + public static void main(String[] args) throws Exception { + String keyFilename = + System.getProperty("test.src", ".") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", ".") + "/" + pathToStores + + "/" + trustStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + System.setProperty("javax.net.ssl.trustStore", trustFilename); + System.setProperty("javax.net.ssl.trustStorePassword", passwd); + + if (debug) + System.setProperty("javax.net.debug", "all"); + + /* + * Start the tests. + */ + new GenericBlockCipher(); + } + + Thread clientThread = null; + Thread serverThread = null; + + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + GenericBlockCipher() throws Exception { + try { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + } catch (Exception e) { + // swallow for now. Show later + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * Which side threw the error? + */ + Exception local; + Exception remote; + String whichRemote; + + if (separateServerThread) { + remote = serverException; + local = clientException; + whichRemote = "server"; + } else { + remote = clientException; + local = serverException; + whichRemote = "client"; + } + + /* + * If both failed, return the curthread's exception, but also + * print the remote side Exception + */ + if ((local != null) && (remote != null)) { + System.out.println(whichRemote + " also threw:"); + remote.printStackTrace(); + System.out.println(); + throw local; + } + + if (remote != null) { + throw remote; + } + + if (local != null) { + throw local; + } + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + try { + doServerSide(); + } catch (Exception e) { + serverException = e; + } finally { + serverReady = true; + } + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + try { + doClientSide(); + } catch (Exception e) { + clientException = e; + } + } + } +} diff --git a/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericStreamCipher.java b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericStreamCipher.java new file mode 100644 index 00000000000..f402ee1c8ba --- /dev/null +++ b/jdk/test/sun/security/ssl/javax/net/ssl/TLSv11/GenericStreamCipher.java @@ -0,0 +1,303 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4873188 + * @summary Support TLS 1.1 + * @run main/othervm -Djavax.net.debug=all GenericStreamCipher + * + * @author Xuelei Fan + */ + +import java.io.*; +import java.net.*; +import javax.net.ssl.*; + +public class GenericStreamCipher { + + /* + * ============================================================= + * Set the various variables needed for the tests, then + * specify what tests to run on each side. + */ + + /* + * Should we run the client or server in a separate thread? + * Both sides can throw exceptions, but do you have a preference + * as to which side should be the main thread. + */ + static boolean separateServerThread = false; + + /* + * Where do we find the keystores? + */ + static String pathToStores = "/../../../../etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + + /* + * Is the server ready to serve? + */ + volatile static boolean serverReady = false; + + /* + * Turn on SSL debugging? + */ + static boolean debug = false; + + /* + * If the client or server is doing some kind of object creation + * that the other side depends on, and that thread prematurely + * exits, you may experience a hang. The test harness will + * terminate all hung threads after its timeout has expired, + * currently 3 minutes by default, but you might try to be + * smart about it.... + */ + + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doServerSide() throws Exception { + SSLServerSocketFactory sslssf = + (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + + serverPort = sslServerSocket.getLocalPort(); + + /* + * Signal Client, we're ready for his connect. + */ + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslIS.read(); + sslOS.write('A'); + sslOS.flush(); + + sslSocket.close(); + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doClientSide() throws Exception { + + /* + * Wait for server to get started. + */ + while (!serverReady) { + Thread.sleep(50); + } + + SSLSocketFactory sslsf = + (SSLSocketFactory) SSLSocketFactory.getDefault(); + SSLSocket sslSocket = (SSLSocket) + sslsf.createSocket("localhost", serverPort); + + // enable TLSv1.1 only + sslSocket.setEnabledProtocols(new String[] {"TLSv1.1"}); + + // enable a stream cipher + sslSocket.setEnabledCipherSuites( + new String[] {"SSL_RSA_WITH_RC4_128_MD5"}); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslOS.write('B'); + sslOS.flush(); + sslIS.read(); + + sslSocket.close(); + } + + /* + * ============================================================= + * The remainder is just support stuff + */ + + // use any free port by default + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + public static void main(String[] args) throws Exception { + String keyFilename = + System.getProperty("test.src", ".") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", ".") + "/" + pathToStores + + "/" + trustStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + System.setProperty("javax.net.ssl.trustStore", trustFilename); + System.setProperty("javax.net.ssl.trustStorePassword", passwd); + + if (debug) + System.setProperty("javax.net.debug", "all"); + + /* + * Start the tests. + */ + new GenericStreamCipher(); + } + + Thread clientThread = null; + Thread serverThread = null; + + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + GenericStreamCipher() throws Exception { + try { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + } catch (Exception e) { + // swallow for now. Show later + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * Which side threw the error? + */ + Exception local; + Exception remote; + String whichRemote; + + if (separateServerThread) { + remote = serverException; + local = clientException; + whichRemote = "server"; + } else { + remote = clientException; + local = serverException; + whichRemote = "client"; + } + + /* + * If both failed, return the curthread's exception, but also + * print the remote side Exception + */ + if ((local != null) && (remote != null)) { + System.out.println(whichRemote + " also threw:"); + remote.printStackTrace(); + System.out.println(); + throw local; + } + + if (remote != null) { + throw remote; + } + + if (local != null) { + throw local; + } + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + try { + doServerSide(); + } catch (Exception e) { + serverException = e; + } finally { + serverReady = true; + } + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + try { + doClientSide(); + } catch (Exception e) { + clientException = e; + } + } + } +} diff --git a/jdk/test/sun/security/ssl/sanity/ciphersuites/CheckCipherSuites.java b/jdk/test/sun/security/ssl/sanity/ciphersuites/CheckCipherSuites.java index e1ff7e6464e..41966f4fd5a 100644 --- a/jdk/test/sun/security/ssl/sanity/ciphersuites/CheckCipherSuites.java +++ b/jdk/test/sun/security/ssl/sanity/ciphersuites/CheckCipherSuites.java @@ -25,6 +25,8 @@ * @test * @bug 4750141 4895631 * @summary Check enabled and supported ciphersuites are correct + * @ignore JSSE supported cipher suites are changed with CR 6916074, + * need to update this test case in JDK 7 soon */ import java.util.*; diff --git a/jdk/test/sun/security/ssl/sanity/interop/CipherTest.java b/jdk/test/sun/security/ssl/sanity/interop/CipherTest.java index 975bbe833e7..c7b544260ae 100644 --- a/jdk/test/sun/security/ssl/sanity/interop/CipherTest.java +++ b/jdk/test/sun/security/ssl/sanity/interop/CipherTest.java @@ -120,6 +120,13 @@ public class CipherTest { return false; } + // ignore exportable cipher suite for TLSv1.1 + if (protocol.equals("TLSv1.1")) { + if(cipherSuite.indexOf("_EXPORT_") != -1) { + return false; + } + } + return true; } @@ -149,18 +156,14 @@ public class CipherTest { cipherSuites.length * protocols.length * clientAuths.length); for (int i = 0; i < cipherSuites.length; i++) { String cipherSuite = cipherSuites[i]; - if (peerFactory.isSupported(cipherSuite) == false) { - continue; - } - // skip kerberos cipher suites - if (cipherSuite.startsWith("TLS_KRB5")) { - continue; - } + for (int j = 0; j < protocols.length; j++) { String protocol = protocols[j]; - if (protocol.equals("SSLv2Hello")) { + + if (!peerFactory.isSupported(cipherSuite, protocol)) { continue; } + for (int k = 0; k < clientAuths.length; k++) { String clientAuth = clientAuths[k]; if ((clientAuth != null) && @@ -297,7 +300,7 @@ public class CipherTest { throws Exception { long time = System.currentTimeMillis(); String relPath; - if ((args.length > 0) && args[0].equals("sh")) { + if ((args != null) && (args.length > 0) && args[0].equals("sh")) { relPath = pathToStoresSH; } else { relPath = pathToStores; @@ -336,7 +339,36 @@ public class CipherTest { abstract Server newServer(CipherTest cipherTest) throws Exception; - boolean isSupported(String cipherSuite) { + boolean isSupported(String cipherSuite, String protocol) { + // skip kerberos cipher suites + if (cipherSuite.startsWith("TLS_KRB5")) { + System.out.println("Skipping unsupported test for " + + cipherSuite + " of " + protocol); + return false; + } + + // skip SSLv2Hello protocol + if (protocol.equals("SSLv2Hello")) { + System.out.println("Skipping unsupported test for " + + cipherSuite + " of " + protocol); + return false; + } + + // ignore exportable cipher suite for TLSv1.1 + if (protocol.equals("TLSv1.1")) { + if (cipherSuite.indexOf("_EXPORT_WITH") != -1) { + System.out.println("Skipping obsoleted test for " + + cipherSuite + " of " + protocol); + return false; + } + } + + // ignore obsoleted cipher suite for the specified protocol + // TODO + + // ignore unsupported cipher suite for the specified protocol + // TODO + return true; } } diff --git a/jdk/test/sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java b/jdk/test/sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java index 22527a0530f..74564602d00 100644 --- a/jdk/test/sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java +++ b/jdk/test/sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @test * @bug 4496785 * @summary Verify that all ciphersuites work in all configurations + * @ignore JSSE supported cipher suites are changed with CR 6916074, + * need to update this test case in JDK 7 soon * @author Andreas Sterbenz * @run main/othervm/timeout=300 ClientJSSEServerJSSE */ diff --git a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java index 7481a6cbf04..3f80e8e68dd 100644 --- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java +++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java index 6b9f314561b..6b966fc2c79 100644 --- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java +++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java @@ -300,8 +300,8 @@ public class CookieHandlerTest { getCalled = true; // returns cookies[0] // they will be include in request - Map> map = new HashMap>(); - List l = new ArrayList(); + Map> map = new HashMap<>(); + List l = new ArrayList<>(); l.add(cookies.get("Cookie")); map.put("Cookie",l); return Collections.unmodifiableMap(map); diff --git a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java index 3913c9ac459..a7ac9954a36 100644 --- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java +++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsPost.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java index 4e63013676c..eac73836572 100644 --- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java +++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/IPAddressDNSIdentities.java @@ -713,13 +713,16 @@ public class IPAddressDNSIdentities { http = (HttpsURLConnection)url.openConnection(); int respCode = http.getResponseCode(); - System.out.println("respCode = "+respCode); + System.out.println("respCode = " + respCode); throw new Exception("Unexpectly found subject alternative name " + "matching IP address"); } catch (SSLHandshakeException sslhe) { // no subject alternative names matching IP address 127.0.0.1 found // that's the expected exception, ignore it. + } catch (IOException ioe) { + // HttpsClient may throw IOE during checking URL spoofing, + // that's the expected exception, ignore it. } finally { if (http != null) { http.disconnect(); diff --git a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Redirect.java b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Redirect.java index 4c21c1703aa..f2764ab2c8b 100644 --- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Redirect.java +++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/Redirect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/security/tools/jarsigner/JarSigningNonAscii.java b/jdk/test/sun/security/tools/jarsigner/JarSigningNonAscii.java index ed17e6e7bb6..c0cae086252 100644 --- a/jdk/test/sun/security/tools/jarsigner/JarSigningNonAscii.java +++ b/jdk/test/sun/security/tools/jarsigner/JarSigningNonAscii.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +113,7 @@ public class JarSigningNonAscii { } } - if (isSignedCount != 3) { + if (isSignedCount != 4) { throw new SecurityException("error signing JAR file"); } diff --git a/jdk/test/sun/security/tools/jarsigner/checkusage.sh b/jdk/test/sun/security/tools/jarsigner/checkusage.sh new file mode 100644 index 00000000000..957df161d9b --- /dev/null +++ b/jdk/test/sun/security/tools/jarsigner/checkusage.sh @@ -0,0 +1,109 @@ +# +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# @test +# @bug 7004168 +# @summary jarsigner -verify checks for KeyUsage codesigning ext on all certs +# instead of just signing cert +# +# @run shell checkusage.sh +# + +if [ "${TESTJAVA}" = "" ] ; then + JAVAC_CMD=`which javac` + TESTJAVA=`dirname $JAVAC_CMD`/.. +fi + +# set platform-dependent variables +OS=`uname -s` +case "$OS" in + Windows_* ) + FS="\\" + ;; + * ) + FS="/" + ;; +esac + +KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit" +JAR=$TESTJAVA${FS}bin${FS}jar +JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner" + +rm js.jks trust.jks unrelated.jks 2> /dev/null + +echo x > x +$JAR cvf a.jar x + +################### 3 Keystores ####################### + +# Keystore js.jks: including CA and Publisher +# CA contains a non-empty KeyUsage +$KT -keystore js.jks -genkeypair -alias ca -dname CN=CA -ext KU=kCS -ext bc -validity 365 +$KT -keystore js.jks -genkeypair -alias pub -dname CN=Publisher + +# Publisher contains the correct KeyUsage +$KT -keystore js.jks -certreq -alias pub | \ + $KT -keystore js.jks -gencert -alias ca -ext KU=dig -validity 365 | \ + $KT -keystore js.jks -importcert -alias pub + +# Keystore trust.jks: including CA only +$KT -keystore js.jks -exportcert -alias ca | \ + $KT -keystore trust.jks -importcert -alias ca -noprompt + +# Keystore unrelated.jks: unrelated +$KT -keystore unrelated.jks -genkeypair -alias nothing -dname CN=Nothing -validity 365 + + +################### 4 Tests ####################### + +# Test 1: Sign should be OK + +$JARSIGNER -keystore js.jks -storepass changeit a.jar pub +RESULT=$? +echo $RESULT +#[ $RESULT = 0 ] || exit 1 + +# Test 2: Verify should be OK + +$JARSIGNER -keystore trust.jks -strict -verify a.jar +RESULT=$? +echo $RESULT +#[ $RESULT = 0 ] || exit 2 + +# Test 3: When no keystore is specified, the error is only +# "chain not validated" + +$JARSIGNER -strict -verify a.jar +RESULT=$? +echo $RESULT +#[ $RESULT = 4 ] || exit 3 + +# Test 4: When unrelated keystore is specified, the error is +# "chain not validated" and "not alias in keystore" + +$JARSIGNER -keystore unrelated.jks -strict -verify a.jar +RESULT=$? +echo $RESULT +#[ $RESULT = 36 ] || exit 4 + +exit 0 diff --git a/jdk/test/sun/security/tools/jarsigner/concise_jarsigner.sh b/jdk/test/sun/security/tools/jarsigner/concise_jarsigner.sh index 0b145a902b6..5edce57057b 100644 --- a/jdk/test/sun/security/tools/jarsigner/concise_jarsigner.sh +++ b/jdk/test/sun/security/tools/jarsigner/concise_jarsigner.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. # 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,9 @@ $JAR uvf a.jar A5.class A6.class $JARSIGNER -verify a.jar [ $? = 0 ] || exit $LINENO -# 4(chainNotValidated)+16(hasUnsignedEntry)+32(aliasNotInStore) +# 4(chainNotValidated)+16(hasUnsignedEntry) $JARSIGNER -verify a.jar -strict -[ $? = 52 ] || exit $LINENO +[ $? = 20 ] || exit $LINENO # 16(hasUnsignedEntry) $JARSIGNER -verify a.jar -strict -keystore js.jks @@ -103,27 +103,31 @@ LINES=`$JARSIGNER -verify a.jar -verbose | grep $YEAR | wc -l` LINES=`$JARSIGNER -verify a.jar -verbose:grouped | grep $YEAR | wc -l` [ $LINES = 12 ] || exit $LINENO -# 3 groups: unrelated, signed, unsigned +# 4 groups: MANIFST, unrelated, signed, unsigned LINES=`$JARSIGNER -verify a.jar -verbose:summary | grep $YEAR | wc -l` -[ $LINES = 3 ] || exit $LINENO - -# 4 groups: unrelated, signed by a1/a2, signed by a2, unsigned -LINES=`$JARSIGNER -verify a.jar -verbose:summary -certs | grep $YEAR | wc -l` [ $LINES = 4 ] || exit $LINENO -# 2*2 for A1/A2, 2 for A3/A4 +# still 4 groups, but MANIFEST group has no other file +LINES=`$JARSIGNER -verify a.jar -verbose:summary | grep "more)" | wc -l` +[ $LINES = 3 ] || exit $LINENO + +# 5 groups: MANIFEST, unrelated, signed by a1/a2, signed by a2, unsigned +LINES=`$JARSIGNER -verify a.jar -verbose:summary -certs | grep $YEAR | wc -l` +[ $LINES = 5 ] || exit $LINENO + +# 2 for MANIFEST, 2*2 for A1/A2, 2 for A3/A4 LINES=`$JARSIGNER -verify a.jar -verbose -certs | grep "\[certificate" | wc -l` -[ $LINES = 6 ] || exit $LINENO +[ $LINES = 8 ] || exit $LINENO -# a1,a2 for A1/A2, a2 for A3/A4 +# a1,a2 for MANIFEST, a1,a2 for A1/A2, a2 for A3/A4 LINES=`$JARSIGNER -verify a.jar -verbose:grouped -certs | grep "\[certificate" | wc -l` -[ $LINES = 3 ] || exit $LINENO +[ $LINES = 5 ] || exit $LINENO -# a1,a2 for A1/A2, a2 for A3/A4 +# a1,a2 for MANIFEST, a1,a2 for A1/A2, a2 for A3/A4 LINES=`$JARSIGNER -verify a.jar -verbose:summary -certs | grep "\[certificate" | wc -l` -[ $LINES = 3 ] || exit $LINENO +[ $LINES = 5 ] || exit $LINENO -# 4 groups +# still 5 groups, but MANIFEST group has no other file LINES=`$JARSIGNER -verify a.jar -verbose:summary -certs | grep "more)" | wc -l` [ $LINES = 4 ] || exit $LINENO diff --git a/jdk/test/sun/security/tools/jarsigner/onlymanifest.sh b/jdk/test/sun/security/tools/jarsigner/onlymanifest.sh new file mode 100644 index 00000000000..5ea95784b1b --- /dev/null +++ b/jdk/test/sun/security/tools/jarsigner/onlymanifest.sh @@ -0,0 +1,68 @@ +# +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# @test +# @bug 7004035 +# @summary signed jar with only META-INF/* inside is not verifiable +# + +if [ "${TESTJAVA}" = "" ] ; then + JAVAC_CMD=`which javac` + TESTJAVA=`dirname $JAVAC_CMD`/.. +fi + +# set platform-dependent variables +OS=`uname -s` +case "$OS" in + Windows_* ) + FS="\\" + ;; + * ) + FS="/" + ;; +esac + +KS=onlymanifest.jks +JFILE=onlymanifest.jar + +KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \ + -keystore $KS" +JAR=$TESTJAVA${FS}bin${FS}jar +JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner + +rm $KS $JFILE 2> /dev/null + +# Create an empty jar file with only MANIFEST.MF + +echo "Key: Value" > manifest +$JAR cvfm $JFILE manifest + +$KT -alias a -dname CN=a -genkey -validity 300 || exit 1 +$JARSIGNER -keystore $KS -storepass changeit $JFILE a -debug -strict || exit 2 +$JARSIGNER -keystore $KS -storepass changeit -verify $JFILE a -debug -strict \ + > onlymanifest.out || exit 3 + +grep unsigned onlymanifest.out && exit 4 + +exit 0 + diff --git a/jdk/test/sun/security/util/Resources/NewNamesFormat.java b/jdk/test/sun/security/util/Resources/NewNamesFormat.java new file mode 100644 index 00000000000..9c3b4521908 --- /dev/null +++ b/jdk/test/sun/security/util/Resources/NewNamesFormat.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6987827 + * @summary security/util/Resources.java needs improvement + */ + + +import java.lang.reflect.Method; +import java.util.HashSet; +import java.util.Set; + +/** + * This test makes sure that the keys in resources files are using the new + * format and there is no duplication. + */ +public class NewNamesFormat { + public static void main(String[] args) throws Exception { + checkRes("sun.security.util.Resources"); + checkRes("sun.security.util.AuthResources"); + checkRes("sun.security.tools.JarSignerResources"); + } + + private static void checkRes(String resName) throws Exception { + System.out.println("Checking " + resName + "..."); + Class clazz = Class.forName(resName); + Method m = clazz.getMethod("getContents"); + Object[][] contents = (Object[][])m.invoke(clazz.newInstance()); + Set keys = new HashSet(); + for (Object[] pair: contents) { + String key = (String)pair[0]; + if (keys.contains(key)) { + System.out.println("Found dup: " + key); + throw new Exception(); + } + checkKey(key); + keys.add(key); + } + } + + private static void checkKey(String key) throws Exception { + for (char c: key.toCharArray()) { + if (Character.isLetter(c) || Character.isDigit(c) || + c == '{' || c == '}' || c == '.') { + // OK + } else { + System.out.println("Illegal char [" + c + "] in key: " + key); + throw new Exception(); + } + } + } +} diff --git a/jdk/test/sun/security/util/Resources/NewResourcesNames.java b/jdk/test/sun/security/util/Resources/NewResourcesNames.java new file mode 100644 index 00000000000..72078b5c333 --- /dev/null +++ b/jdk/test/sun/security/util/Resources/NewResourcesNames.java @@ -0,0 +1,439 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.util.HashMap; +import java.util.HashSet; +import java.util.ListResourceBundle; +import java.util.Map; +import java.util.Set; + +/** + * Prepares new key names for Resources.java. + * 6987827: security/util/Resources.java needs improvement + * + * Run inside jdk/src/share/classes: + * + * java NewResourcesNames $( + * for a in $(find com/sun/security sun/security javax/security -type f); do + * egrep -q '(ResourcesMgr.getString|rb.getString)' $a && echo $a + * done) + * + * Before running this tool, run the following two commands to make sure there + * are only these 2 types of calls into the resources: + * for a in `find com/sun/security sun/security javax/security -type f`; do + * cat $a | perl -ne 'print if /\bResourcesMgr\b/'; done | + * grep -v ResourcesMgr.getString + * for a in `find com/sun/security sun/security -type f`; do + * cat $a | perl -ne 'print if /\brb\b/'; done | + * grep -v rb.getString + */ +class NewResourcesNames { + + // Max length of normalized names + static int MAXLEN = 127; + + static String[] resources = { + "sun/security/tools/JarSignerResources.java", + "sun/security/util/Resources.java", + "sun/security/util/AuthResources.java", + }; + + public static void main(String[] args) throws Exception { + + // Load all names inside resources files + Map allnames = loadResources(); + + // Modify the callers. There are two patterns: + // 1. ResourcesMgr.getString(" + // used by most JAAS codes + // 2. rb.getString(" + // used by tools + Set allfound = new HashSet(); + for (String arg: args) { + allfound.addAll(rewriteFile(arg, "ResourcesMgr.getString(\"")); + allfound.addAll(rewriteFile(arg, "rb.getString(\"")); + } + + // Special case 1: KeyTool's enum definition of commands and options + allfound.addAll(keyToolEnums()); + + // Special case 2: PolicyFile called this 4 times + allfound.addAll(rewriteFile("sun/security/provider/PolicyFile.java", + "ResourcesMgr.getString(POLICY+\"")); + + // During the calls above, you can read sth like: + // + // Working on com/sun/security/auth/PolicyParser.java + // GOOD match is 17 + // + // This means a " exists right after getString(. Sometimes you see + // + // Working on sun/security/tools/KeyTool.java + // BAD!! pmatch != match: 212 != 209 + // Working on sun/security/provider/PolicyFile.java + // BAD!! pmatch != match: 14 != 10 + // + // which is mismatch. There are only two such special cases list above. + // For KeyTool, there are 3 calls for showing help. For PolicyTool, 3 + // for name prefixed with POLICY. They are covered in the two special + // cases above. + + // Names used but not defined. This is mostly error, except for + // special case 2 above. So it's OK to see 3 entries red here + if (!allnames.keySet().containsAll(allfound)) { + err("FATAL: Undefined names"); + for (String name: allfound) { + if (!allnames.keySet().contains(name)) { + err(" " + name); + } + } + } + + // Names defined but not used. Mostly this is old entries not removed. + // When soemone remove a line of code, he dares not remove the entry + // in case it's also used somewhere else. + if (!allfound.containsAll(allnames.keySet())) { + System.err.println("WARNING: Unused names"); + for (String name: allnames.keySet()) { + if (!allfound.contains(name)) { + System.err.println(allnames.get(name)); + System.err.println(" " + normalize(name)); + System.err.println(" [" + name + "]"); + } + } + } + } + + + /** + * Loads the three resources files. Saves names into a Map. + */ + private static Map loadResources() throws Exception { + + // Name vs Resource + Map allnames = new HashMap(); + + for (String f: resources) { + String clazz = + f.replace('/', '.').substring(0, f.length()-5); + + Set expected = loadClass(clazz); + Set found = rewriteFile(f, "{\""); + + // This is to check that word parsing is identical to Java thinks + if (!expected.equals(found)) { + throw new Exception("Expected and found do not match"); + } + + for (String name: found) { + allnames.put(name, f); + } + } + return allnames; + } + + /** + * Special case treat for enums description in KeyTool + */ + private static Set keyToolEnums() throws Exception { + + Set names = new HashSet(); + + String file = "sun/security/tools/KeyTool.java"; + System.err.println("Working on " + file); + File origFile = new File(file); + File tmpFile = new File(file + ".tmp"); + origFile.renameTo(tmpFile); + tmpFile.deleteOnExit(); + + BufferedReader br = new BufferedReader( + new InputStreamReader(new FileInputStream(tmpFile))); + PrintWriter out = new PrintWriter(new FileOutputStream(origFile)); + + int stage = 0; // 1. commands, 2. options, 3. finished + int match = 0; + + while (true) { + String s = br.readLine(); + if (s == null) { + break; + } + if (s.indexOf("enum Command") >= 0) stage = 1; + else if (s.indexOf("enum Option") >= 0) stage = 2; + else if (s.indexOf("private static final String JKS") >= 0) stage = 3; + + if (stage == 1 || stage == 2) { + if (s.indexOf("(\"") >= 0) { + match++; + int p1, p2; + if (stage == 1) { + p1 = s.indexOf("\""); + p2 = s.indexOf("\"", p1+1); + } else { + p2 = s.lastIndexOf("\""); + p1 = s.lastIndexOf("\"", p2-1); + } + String name = s.substring(p1+1, p2); + names.add(name); + out.println(s.substring(0, p1+1) + + normalize(name) + + s.substring(p2)); + } else { + out.println(s); + } + } else { + out.println(s); + } + } + br.close(); + out.close(); + System.err.println(" GOOD match is " + match); + return names; + } + + /** + * Loads a resources using JRE and returns the names + */ + private static Set loadClass(String clazz) throws Exception { + ListResourceBundle lrb = + (ListResourceBundle)Class.forName(clazz).newInstance(); + Set keys = lrb.keySet(); + Map newold = new HashMap(); + boolean dup = false; + // Check if normalize() creates dup entries. This is crucial. + for (String k: keys) { + String key = normalize(k); + if (newold.containsKey(key)) { + err("Dup found for " + key + ":"); + err("["+newold.get(key)+"]"); + err("["+k+"]"); + dup = true; + } + newold.put(key, k); + } + if (dup) throw new Exception(); + return keys; + } + + /** + * Rewrites a file using a pattern. The name string should be right after + * the pattern. Note: pattern ignores whitespaces. Returns names found. + */ + private static Set rewriteFile(String file, String pattern) + throws Exception { + + System.err.println("Working on " + file); + Set names = new HashSet(); + + int plen = pattern.length(); + int match = 0; + + // The bare XXX.getString is also matched. Sometimes getString is + // called but does not use literal strings. This is harder to solve. + + int pmatch = 0; + int pheadlen = plen - 2; + String phead = pattern.substring(0, plen-2); + + // The non-whitespace chars read since, used to check for pattern + StringBuilder history = new StringBuilder(); + int hlen = 0; + + File origFile = new File(file); + File tmpFile = new File(file + ".tmp"); + origFile.renameTo(tmpFile); + tmpFile.deleteOnExit(); + + FileInputStream fis = new FileInputStream(tmpFile); + FileOutputStream fos = new FileOutputStream(origFile); + + while (true) { + int ch = fis.read(); + if (ch < 0) break; + if (!Character.isWhitespace(ch)) { + history.append((char)ch); + hlen++; + if (pheadlen > 0 && hlen >= pheadlen && + history.substring(hlen-pheadlen, hlen).equals(phead)) { + pmatch++; + } + } + + if (hlen >= plen && + history.substring(hlen-plen, hlen).equals(pattern)) { + match++; + history = new StringBuilder(); + hlen = 0; + + fos.write(ch); + + // Save a name + StringBuilder sb = new StringBuilder(); + // Save things after the second ". Maybe it's an end, maybe + // it's just literal string concatenation. + StringBuilder tail = new StringBuilder(); + + boolean in = true; // inside name string + while (true) { + int n = fis.read(); + if (in) { + if (n == '\\') { + int second = fis.read(); + switch (second) { + case 'n': sb.append('\n'); break; + case 'r': sb.append('\r'); break; + case 't': sb.append('\t'); break; + case '"': sb.append('"'); break; + default: throw new Exception(String.format( + "I don't know this escape: %s%c", + sb.toString(), second)); + } + } else if (n == '"') { + in = false; + // Maybe string concat? say bytes until clear + tail = new StringBuilder(); + tail.append('"'); + } else { + sb.append((char)n); + } + } else { + tail.append((char)n); + if (n == '"') { // string concat, in again + in = true; + } else if (n == ',' || n == ')') { // real end + break; + } else if (Character.isWhitespace(n) || n == '+') { + // string concat + } else { + throw new Exception("Not a correct concat"); + } + } + } + String s = sb.toString(); + names.add(s); + fos.write(normalize(s).getBytes()); + fos.write(tail.toString().getBytes()); + } else { + fos.write(ch); + } + } + + // Check pheadlen > 0. Don't want to mess with rewrite for resources + if (pheadlen > 0 && pmatch != match) { + err(" BAD!! pmatch != match: " + pmatch + " != " + match); + } else { + System.err.println(" GOOD match is " + match); + } + + fis.close(); + fos.close(); + return names; + } + + /** + * Normalize a string. Rules: + * + * 1. If all spacebar return "nSPACE", n is count + * 2. If consisting at least one alphanumeric: + * a. All alphanumeric remain + * b. All others in a row goes to a single ".", even if at head or tail + * 3. Otherwise: + * a. "****\n\n" to "STARNN", special case + * b. the English name if first char in *,.\n():'" + * + * Current observations show there's no dup, Hurray! Otherwise, add more + * special cases. + */ + private static String normalize(String s) throws Exception { + boolean needDot = false; + + // All spacebar case + int n = 0; + for (char c: s.toCharArray()) { + if (c == ' ') n++; + else n = -10000; + } + if (n == 1) return "SPACE"; + else if (n > 1) return "" + n + "SPACE"; + + StringBuilder sb = new StringBuilder(); + int dotpos = -1; + for (int i=0; i MAXLEN) { + if (dotpos < 0) throw new Exception("No dot all over? " + s); + return res.substring(0, dotpos); + } else { + return res; + } + } + + private static void err(String string) { + System.out.println("\u001b[1;37;41m" + string + "\u001b[m"); + } +} diff --git a/jdk/test/sun/text/resources/LocaleData b/jdk/test/sun/text/resources/LocaleData index bf609d108b7..090b73c8d12 100644 --- a/jdk/test/sun/text/resources/LocaleData +++ b/jdk/test/sun/text/resources/LocaleData @@ -5468,12 +5468,12 @@ LocaleNames/fr/GF=Guyane fran\u00e7aise LocaleNames/fr/GY=Guyana # bug 4225362 -FormatData/fr/DateTimePatternChars=GaMjkHmsSEDFwWahKzZ -FormatData/fr_BE/DateTimePatternChars=GaMjkHmsSEDFwWahKzZ -FormatData/fr_CA/DateTimePatternChars=GaMjkHmsSEDFwWahKzZ -FormatData/fr_CH/DateTimePatternChars=GaMjkHmsSEDFwWahKzZ -FormatData/fr_FR/DateTimePatternChars=GaMjkHmsSEDFwWahKzZ -FormatData/fr_LU/DateTimePatternChars=GaMjkHmsSEDFwWahKzZ +FormatData/fr/DateTimePatternChars=GaMjkHmsSEDFwWxhKzZ +FormatData/fr_BE/DateTimePatternChars=GaMjkHmsSEDFwWxhKzZ +FormatData/fr_CA/DateTimePatternChars=GaMjkHmsSEDFwWxhKzZ +FormatData/fr_CH/DateTimePatternChars=GaMjkHmsSEDFwWxhKzZ +FormatData/fr_FR/DateTimePatternChars=GaMjkHmsSEDFwWxhKzZ +FormatData/fr_LU/DateTimePatternChars=GaMjkHmsSEDFwWxhKzZ # bug 6547501 FormatData/fr/NumberPatterns/2=#,##0 % diff --git a/jdk/test/sun/text/resources/LocaleDataTest.java b/jdk/test/sun/text/resources/LocaleDataTest.java index b42f2ca90f0..2a04cd973db 100644 --- a/jdk/test/sun/text/resources/LocaleDataTest.java +++ b/jdk/test/sun/text/resources/LocaleDataTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/sun/tools/jps/jps-Vvml_2.sh b/jdk/test/sun/tools/jps/jps-Vvml_2.sh index 83f9a05249a..08fa41d56a6 100644 --- a/jdk/test/sun/tools/jps/jps-Vvml_2.sh +++ b/jdk/test/sun/tools/jps/jps-Vvml_2.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/tools/jps/jps-help.sh b/jdk/test/sun/tools/jps/jps-help.sh index 8407e18a54e..4cec37025e4 100644 --- a/jdk/test/sun/tools/jps/jps-help.sh +++ b/jdk/test/sun/tools/jps/jps-help.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/tools/jps/jps-m_2.sh b/jdk/test/sun/tools/jps/jps-m_2.sh index afa0451804e..cbea3879818 100644 --- a/jdk/test/sun/tools/jps/jps-m_2.sh +++ b/jdk/test/sun/tools/jps/jps-m_2.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/tools/jstat/gcNewCapacityOutput1.awk b/jdk/test/sun/tools/jstat/gcNewCapacityOutput1.awk index b0587b70bed..0491fa52076 100644 --- a/jdk/test/sun/tools/jstat/gcNewCapacityOutput1.awk +++ b/jdk/test/sun/tools/jstat/gcNewCapacityOutput1.awk @@ -4,7 +4,7 @@ # specific values. # # NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC -# 2176.0 7232.0 2176.0 64.0 192.0 192.0 64.0 6848.0 2048.0 1 0 +# 2176.0 7232.0 2176.0 192.0 64.0 192.0 64.0 6848.0 2048.0 1 0 BEGIN { diff --git a/jdk/test/sun/tools/jstat/jstatHelp.sh b/jdk/test/sun/tools/jstat/jstatHelp.sh index 4cbcf11c30c..e0c42900ddd 100644 --- a/jdk/test/sun/tools/jstat/jstatHelp.sh +++ b/jdk/test/sun/tools/jstat/jstatHelp.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/tools/jstat/jstatOptions1.sh b/jdk/test/sun/tools/jstat/jstatOptions1.sh index af9367f7915..1baa02301d9 100644 --- a/jdk/test/sun/tools/jstat/jstatOptions1.sh +++ b/jdk/test/sun/tools/jstat/jstatOptions1.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/tools/jstatd/jstatdDefaults.sh b/jdk/test/sun/tools/jstatd/jstatdDefaults.sh index 34b21801191..f6ddb83af65 100644 --- a/jdk/test/sun/tools/jstatd/jstatdDefaults.sh +++ b/jdk/test/sun/tools/jstatd/jstatdDefaults.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/tools/jstatd/jstatdExternalRegistry.sh b/jdk/test/sun/tools/jstatd/jstatdExternalRegistry.sh index 3385c821ee6..ba960c26dd8 100644 --- a/jdk/test/sun/tools/jstatd/jstatdExternalRegistry.sh +++ b/jdk/test/sun/tools/jstatd/jstatdExternalRegistry.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/tools/jstatd/jstatdPort.sh b/jdk/test/sun/tools/jstatd/jstatdPort.sh index 7e8f4455dea..a5021c9757c 100644 --- a/jdk/test/sun/tools/jstatd/jstatdPort.sh +++ b/jdk/test/sun/tools/jstatd/jstatdPort.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/tools/jstatd/jstatdServerName.sh b/jdk/test/sun/tools/jstatd/jstatdServerName.sh index 723a26c2efe..61730a55ded 100644 --- a/jdk/test/sun/tools/jstatd/jstatdServerName.sh +++ b/jdk/test/sun/tools/jstatd/jstatdServerName.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/tools/jstatd/jstatdUsage1.sh b/jdk/test/sun/tools/jstatd/jstatdUsage1.sh index a8c777a65cb..d6543b3ab12 100644 --- a/jdk/test/sun/tools/jstatd/jstatdUsage1.sh +++ b/jdk/test/sun/tools/jstatd/jstatdUsage1.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/sun/util/calendar/Bug6653944.java b/jdk/test/sun/util/calendar/Bug6653944.java new file mode 100644 index 00000000000..59c8b734c97 --- /dev/null +++ b/jdk/test/sun/util/calendar/Bug6653944.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + *@test + *@bug 6653944 + *@summary Deserialization tests for YEAR calculcations + */ + +import java.io.*; +import java.util.*; + +public class Bug6653944 { + private static int errorCount = 0; + + public static void main(String[] args) throws Exception { + Calendar buddhist = Calendar.getInstance(new Locale("th", "TH")); + int expectedYear = buddhist.get(Calendar.YEAR); + + Calendar deserialized = (Calendar) deserialize(serialize(buddhist)); + compare(deserialized, buddhist); + + int deserializedYear = deserialized.get(Calendar.YEAR); + compare(deserializedYear, expectedYear); + + // test add(YEAR, n). + buddhist.add(Calendar.YEAR, 12); + expectedYear = buddhist.get(Calendar.YEAR); + deserialized.add(Calendar.YEAR, 12); + deserializedYear = deserialized.get(Calendar.YEAR); + compare(deserialized, buddhist); + compare(deserializedYear, expectedYear); + + if (errorCount > 0) { + throw new RuntimeException("Bug6653944: failed"); + } + } + + private static void compare(int got, int expected) { + if (got != expected) { + System.err.println("got " + got + ", expected " + expected); + errorCount++; + } + } + + private static void compare(Calendar got, Calendar expected) { + if (!got.equals(expected)) { + System.err.println("got " + got + ", expected " + expected); + errorCount++; + } + } + + private static byte[] serialize(Serializable obj) throws Exception { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(obj); + oos.close(); + return baos.toByteArray(); + } + + private static Object deserialize(byte[] data) throws Exception { + ByteArrayInputStream bais = new ByteArrayInputStream(data); + ObjectInputStream ois = new ObjectInputStream(bais); + return ois.readObject(); + } +} diff --git a/jdk/test/sun/util/logging/PlatformLoggerTest.java b/jdk/test/sun/util/logging/PlatformLoggerTest.java index 5f7f923fee3..35fccfc00e6 100644 --- a/jdk/test/sun/util/logging/PlatformLoggerTest.java +++ b/jdk/test/sun/util/logging/PlatformLoggerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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 6882376 + * @bug 6882376 6985460 * @summary Test if java.util.logging.Logger is created before and after * logging is enabled. Also validate some basic PlatformLogger * operations. @@ -43,6 +43,8 @@ public class PlatformLoggerTest { final String GOO_PLATFORM_LOGGER = "test.platformlogger.goo"; final String BAR_LOGGER = "test.logger.bar"; PlatformLogger goo = PlatformLogger.getLogger(GOO_PLATFORM_LOGGER); + // test the PlatformLogger methods + testLogMethods(goo); // Create a platform logger using the default PlatformLogger foo = PlatformLogger.getLogger(FOO_PLATFORM_LOGGER); @@ -56,6 +58,10 @@ public class PlatformLoggerTest { PlatformLogger bar = PlatformLogger.getLogger(BAR_PLATFORM_LOGGER); checkPlatformLogger(bar, BAR_PLATFORM_LOGGER); + // test the PlatformLogger methods + testLogMethods(goo); + testLogMethods(bar); + checkLogger(FOO_PLATFORM_LOGGER, Level.FINER); checkLogger(BAR_PLATFORM_LOGGER, Level.FINER); @@ -64,6 +70,7 @@ public class PlatformLoggerTest { foo.setLevel(PlatformLogger.SEVERE); checkLogger(FOO_PLATFORM_LOGGER, Level.SEVERE); + } private static void checkPlatformLogger(PlatformLogger logger, String name) { @@ -108,4 +115,33 @@ public class PlatformLoggerTest { logger.getName() + " " + logger.getLevel()); } } + + private static void testLogMethods(PlatformLogger logger) { + logger.severe("Test severe(String, Object...) {0} {1}", new Long(1), "string"); + // test Object[] + logger.severe("Test severe(String, Object...) {0}", (Object[]) getPoints()); + logger.warning("Test warning(String, Throwable)", new Throwable("Testing")); + logger.info("Test info(String)"); + } + + static Point[] getPoints() { + Point[] res = new Point[3]; + res[0] = new Point(0,0); + res[1] = new Point(1,1); + res[2] = new Point(2,2); + return res; + } + + static class Point { + final int x; + final int y; + public Point(int x, int y) { + this.x = x; + this.y = y; + } + public String toString() { + return "{x="+x + ", y=" + y + "}"; + } + } + } diff --git a/jdk/test/sun/util/logging/SourceClassName.java b/jdk/test/sun/util/logging/SourceClassName.java new file mode 100644 index 00000000000..e662166ab46 --- /dev/null +++ b/jdk/test/sun/util/logging/SourceClassName.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6985460 + * @summary Test the source class name and method output by the platform + * logger. + * + * @compile -XDignore.symbol.file SourceClassName.java + * @run main/othervm SourceClassName + */ + +import java.util.logging.*; +import java.io.*; +import sun.util.logging.PlatformLogger; + +public class SourceClassName { + public static void main(String[] args) throws Exception { + File dir = new File(System.getProperty("user.dir", ".")); + File log = new File(dir, "testlog.txt"); + PrintStream logps = new PrintStream(log); + writeLogRecords(logps); + checkLogRecords(log); + } + + private static void writeLogRecords(PrintStream logps) throws Exception { + PrintStream err = System.err; + try { + System.setErr(logps); + + Object[] params = new Object[] { new Long(1), "string"}; + PlatformLogger plog = PlatformLogger.getLogger("test.log.foo"); + plog.severe("Log message {0} {1}", (Object[]) params); + + // create a java.util.logging.Logger + // now java.util.logging.Logger should be created for each platform logger + Logger logger = Logger.getLogger("test.log.bar"); + logger.log(Level.SEVERE, "Log message {0} {1}", params); + + plog.severe("Log message {0} {1}", (Object[]) params); + } finally { + logps.flush(); + logps.close(); + System.setErr(err); + } + } + + private static void checkLogRecords(File log) throws Exception { + System.out.println("Checking log records in file: " + log); + FileInputStream in = new FileInputStream(log); + String EXPECTED_LOG = "SEVERE: Log message 1 string"; + try { + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + String line; + String[] record = new String[2]; + int count = 0; + int i = 0; + while ((line = reader.readLine()) != null) { + line = line.trim(); + System.out.println(line); + record[i++] = line; + if (i == 2) { + i = 0; + count++; + // check source class name and method + String[] ss = record[0].split("\\s+"); + int len = ss.length; + if (!ss[len-2].equals("SourceClassName") || + !ss[len-1].equals("writeLogRecords")) { + throw new RuntimeException("Unexpected source: " + + ss[len-2] + " " + ss[len-1]); + } + + // check log message + if (!record[1].equals(EXPECTED_LOG)) { + throw new RuntimeException("Unexpected log: " + record[1]); + } + } + } + if (count != 3) { + throw new RuntimeException("Unexpected number of records: " + count); + } + } finally { + in.close(); + } + } +} diff --git a/jdk/test/sun/util/resources/TimeZone/Bug6317929.java b/jdk/test/sun/util/resources/TimeZone/Bug6317929.java index ec66e796f68..665fdb7fdfe 100644 --- a/jdk/test/sun/util/resources/TimeZone/Bug6317929.java +++ b/jdk/test/sun/util/resources/TimeZone/Bug6317929.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/tools/jar/JarEntryTime.java b/jdk/test/tools/jar/JarEntryTime.java index 2998b29bc8a..deef85bbfef 100644 --- a/jdk/test/tools/jar/JarEntryTime.java +++ b/jdk/test/tools/jar/JarEntryTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/tools/jar/index/MetaInf.java b/jdk/test/tools/jar/index/MetaInf.java index ea62e2ba7bc..706333be3a5 100644 --- a/jdk/test/tools/jar/index/MetaInf.java +++ b/jdk/test/tools/jar/index/MetaInf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR 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/tools/launcher/ChangeDataModel.sh b/jdk/test/tools/launcher/ChangeDataModel.sh index cb69a128ace..f0656039cb0 100644 --- a/jdk/test/tools/launcher/ChangeDataModel.sh +++ b/jdk/test/tools/launcher/ChangeDataModel.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/tools/launcher/DefaultLocaleTest.sh b/jdk/test/tools/launcher/DefaultLocaleTest.sh index 33606ed6802..fdb9de89e38 100644 --- a/jdk/test/tools/launcher/DefaultLocaleTest.sh +++ b/jdk/test/tools/launcher/DefaultLocaleTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/tools/launcher/Settings.java b/jdk/test/tools/launcher/Settings.java new file mode 100644 index 00000000000..10511bff86f --- /dev/null +++ b/jdk/test/tools/launcher/Settings.java @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.io.File; +import java.io.IOException; + +/* + * @test + * @bug 6994753 + * @summary tests -XshowSettings options + * @compile -XDignore.symbol.file Settings.java TestHelper.java + * @run main Settings + * @author ksrini + */ +public class Settings { + private static File testJar = null; + + static void init() throws IOException { + if (testJar != null) { + return; + } + testJar = new File("test.jar"); + StringBuilder tsrc = new StringBuilder(); + tsrc.append("public static void main(String... args) {\n"); + tsrc.append(" for (String x : args) {\n"); + tsrc.append(" System.out.println(x);\n"); + tsrc.append(" }\n"); + tsrc.append("}\n"); + TestHelper.createJar(testJar, tsrc.toString()); + } + + static void checkContains(TestHelper.TestResult tr, String str) { + if (!tr.contains(str)) { + System.out.println(tr); + throw new RuntimeException(str + " not found"); + } + } + + static void checkNoContains(TestHelper.TestResult tr, String str) { + if (tr.contains(str)) { + System.out.println(tr.status); + throw new RuntimeException(str + " found"); + } + } + + private static final String VM_SETTINGS = "VM settings:"; + private static final String PROP_SETTINGS = "Property settings:"; + private static final String LOCALE_SETTINGS = "Locale settings:"; + + static void containsAllOptions(TestHelper.TestResult tr) { + checkContains(tr, VM_SETTINGS); + checkContains(tr, PROP_SETTINGS); + checkContains(tr, LOCALE_SETTINGS); + } + + static void runTestOptionDefault() throws IOException { + TestHelper.TestResult tr = null; + tr = TestHelper.doExec(TestHelper.javaCmd, "-Xms64m", "-Xmx512m", + "-Xss128k", "-XshowSettings", "-jar", testJar.getAbsolutePath()); + containsAllOptions(tr); + if (!tr.isOK()) { + System.out.println(tr.status); + throw new RuntimeException("test fails"); + } + tr = TestHelper.doExec(TestHelper.javaCmd, "-Xms65536k", "-Xmx712m", + "-Xss122880", "-XshowSettings", "-jar", testJar.getAbsolutePath()); + containsAllOptions(tr); + if (!tr.isOK()) { + System.out.println(tr.status); + throw new RuntimeException("test fails"); + } + } + + static void runTestOptionAll() throws IOException { + init(); + TestHelper.TestResult tr = null; + tr = TestHelper.doExec(TestHelper.javaCmd, "-XshowSettings:all"); + containsAllOptions(tr); + } + + static void runTestOptionVM() throws IOException { + TestHelper.TestResult tr = null; + tr = TestHelper.doExec(TestHelper.javaCmd, "-XshowSettings:vm"); + checkContains(tr, VM_SETTINGS); + checkNoContains(tr, PROP_SETTINGS); + checkNoContains(tr, LOCALE_SETTINGS); + } + + static void runTestOptionProperty() throws IOException { + TestHelper.TestResult tr = null; + tr = TestHelper.doExec(TestHelper.javaCmd, "-XshowSettings:properties"); + checkNoContains(tr, VM_SETTINGS); + checkContains(tr, PROP_SETTINGS); + checkNoContains(tr, LOCALE_SETTINGS); + } + + static void runTestOptionLocale() throws IOException { + TestHelper.TestResult tr = null; + tr = TestHelper.doExec(TestHelper.javaCmd, "-XshowSettings:locale"); + checkNoContains(tr, VM_SETTINGS); + checkNoContains(tr, PROP_SETTINGS); + checkContains(tr, LOCALE_SETTINGS); + } + + static void runTestBadOptions() throws IOException { + TestHelper.TestResult tr = null; + tr = TestHelper.doExec(TestHelper.javaCmd, "-XshowSettingsBadOption"); + checkNoContains(tr, VM_SETTINGS); + checkNoContains(tr, PROP_SETTINGS); + checkNoContains(tr, LOCALE_SETTINGS); + checkContains(tr, "Unrecognized option: -XshowSettingsBadOption"); + } + public static void main(String... args) { + try { + runTestOptionAll(); + runTestOptionDefault(); + runTestOptionVM(); + runTestOptionProperty(); + runTestOptionLocale(); + runTestBadOptions(); + } catch (IOException ioe) { + throw new RuntimeException(ioe); + } + } +} diff --git a/jdk/test/tools/launcher/UnicodeTest.sh b/jdk/test/tools/launcher/UnicodeTest.sh index 5ce017658af..f64969b3a39 100644 --- a/jdk/test/tools/launcher/UnicodeTest.sh +++ b/jdk/test/tools/launcher/UnicodeTest.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR 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/tools/pack200/T7007157.java b/jdk/test/tools/pack200/T7007157.java new file mode 100644 index 00000000000..72f8792c22b --- /dev/null +++ b/jdk/test/tools/pack200/T7007157.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Map; +import java.util.jar.JarFile; +import java.util.jar.Pack200; +/* + * @test + * @bug 7007157 + * @summary make sure the strip command works on an attribute + * @compile -XDignore.symbol.file Utils.java T7007157.java + * @run main T7007157 + * @author ksrini + */ +public class T7007157 { + + public static void main(String... args) throws IOException { + File sdkHome = Utils.JavaSDK; + File testJar = new File(new File(sdkHome, "lib"), "tools.jar"); + JarFile jarFile = new JarFile(testJar); + File packFile = new File("foo.pack"); + Pack200.Packer packer = Pack200.newPacker(); + Map p = packer.properties(); + // Take the time optimization vs. space + p.put(packer.EFFORT, "1"); // CAUTION: do not use 0. + // Make the memory consumption as effective as possible + p.put(packer.SEGMENT_LIMIT, "10000"); + // ignore all JAR deflation requests to save time + p.put(packer.DEFLATE_HINT, packer.FALSE); + // save the file ordering of the original JAR + p.put(packer.KEEP_FILE_ORDER, packer.TRUE); + // strip the StackMapTables + p.put(packer.CODE_ATTRIBUTE_PFX + "StackMapTable", packer.STRIP); + FileOutputStream fos = null; + try { + // Write out to a jtreg scratch area + fos = new FileOutputStream(packFile); + // Call the packer + packer.pack(jarFile, fos); + } finally { + Utils.close(fos); + Utils.close(jarFile); + } + } +} diff --git a/jdk/test/tools/pack200/TestExceptions.java b/jdk/test/tools/pack200/TestExceptions.java new file mode 100644 index 00000000000..0778cf5c7e1 --- /dev/null +++ b/jdk/test/tools/pack200/TestExceptions.java @@ -0,0 +1,340 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.ByteArrayOutputStream; +import java.io.Closeable; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.jar.JarFile; +import java.util.jar.JarInputStream; +import java.util.jar.JarOutputStream; +import java.util.jar.Pack200; + +/* + * @test + * @bug 6985763 + * @summary verify that proper exceptions are thrown + * @compile -XDignore.symbol.file Utils.java TestExceptions.java + * @run main TestExceptions + * @author ksrini + */ + +public class TestExceptions { + + static final File testJar = new File("test.jar"); + static final File testPackFile = new File("test.pack"); + + static void init() { + Utils.jar("cvf", testJar.getAbsolutePath(), "."); + JarFile jf = null; + try { + jf = new JarFile(testJar); + Utils.pack(jf, testPackFile); + } catch (IOException ioe) { + throw new Error("Initialization error", ioe); + } finally { + Utils.close(jf); + } + } + + // a test that closes the input jarFile. + static void pack200Test1() { + PackTestInput ti = null; + // setup the scenario + try { + ti = new PackTestInput(new JarFile(testJar), new ByteArrayOutputStream()); + } catch (Exception e) { + throw new Error("Initialization error", e); + } finally { + Utils.close(ti.getJarFile()); + } + // test the scenario + try { + System.out.println(ti); + Pack200.Packer p = Pack200.newPacker(); + p.pack(ti.getJarFile(), ti.getOutputStream()); + } catch (Exception e) { + ti.checkException(e); + } finally { + if (ti != null) { + ti.close(); + } + } + } + + // test the Pack200.pack(JarFile, OutputStream); + static void pack200Test2() { + List tlist = new ArrayList(); + try { + // setup the test scenarios + try { + tlist.add(new PackTestInput((JarFile)null, null)); + tlist.add(new PackTestInput(new JarFile(testJar), null)); + tlist.add(new PackTestInput((JarFile)null, new ByteArrayOutputStream())); + } catch (Exception e) { + throw new Error("Initialization error", e); + } + + // test the scenarios + for (PackTestInput ti : tlist) { + System.out.println(ti); + try { + Pack200.Packer p = Pack200.newPacker(); + p.pack(ti.getJarFile(), ti.getOutputStream()); + } catch (Exception e) { + ti.checkException(e); + } + } + } finally { // keep jprt happy + for (TestInput ti : tlist) { + if (ti != null) { + ti.close(); + } + } + } + } + + // test the Pack200.pack(JarInputStream, OutputStream); + static void pack200Test3() { + List tlist = new ArrayList(); + try { + // setup the test scenarios + try { + tlist.add(new PackTestJarInputStream((JarInputStream)null, null)); + tlist.add(new PackTestJarInputStream((JarInputStream)null, + new ByteArrayOutputStream())); + tlist.add(new PackTestJarInputStream( + new JarInputStream(new FileInputStream(testJar)), null)); + + } catch (Exception e) { + throw new Error("Initialization error", e); + } + for (PackTestJarInputStream ti : tlist) { + System.out.println(ti); + try { + Pack200.Packer p = Pack200.newPacker(); + p.pack(ti.getJarInputStream(), ti.getOutputStream()); + } catch (Exception e) { + ti.checkException(e); + } + } + } finally { // keep jprt happy + for (PackTestJarInputStream ti : tlist) { + if (ti != null) { + ti.close(); + } + } + } + } + + // test the Pack200.unpack(InputStream, OutputStream); + static void unpack200Test1() { + List tlist = new ArrayList(); + try { + // setup the test scenarios + try { + tlist.add(new UnpackTestInput((InputStream)null, null)); + tlist.add(new UnpackTestInput(new FileInputStream(testPackFile), + null)); + tlist.add(new UnpackTestInput((InputStream) null, + new JarOutputStream(new ByteArrayOutputStream()))); + } catch (Exception e) { + throw new Error("Initialization error", e); + } + + // test the scenarios + for (UnpackTestInput ti : tlist) { + System.out.println(ti); + try { + Pack200.Unpacker unpacker = Pack200.newUnpacker(); + unpacker.unpack(ti.getInputStream(), ti.getJarOutputStream()); + } catch (Exception e) { + ti.checkException(e); + } + } + } finally { // keep jprt happy + for (TestInput ti : tlist) { + if (ti != null) { + ti.close(); + } + } + } + } + + // test the Pack200.unpack(File, OutputStream); + static void unpack200Test2() { + List tlist = new ArrayList(); + try { + // setup the test scenarios + try { + tlist.add(new UnpackTestFileInput((File)null, null)); + tlist.add(new UnpackTestFileInput(testPackFile, null)); + tlist.add(new UnpackTestFileInput((File)null, + new JarOutputStream(new ByteArrayOutputStream()))); + } catch (Exception e) { + throw new Error("Initialization error", e); + } + + // test the scenarios + for (UnpackTestFileInput ti : tlist) { + System.out.println(ti); + try { + Pack200.Unpacker unpacker = Pack200.newUnpacker(); + unpacker.unpack(ti.getInputFile(), ti.getJarOutputStream()); + } catch (Exception e) { + ti.checkException(e); + } + } + } finally { // keep jprt happy + for (TestInput ti : tlist) { + if (ti != null) { + ti.close(); + } + } + } + } + + public static void main(String... args) { + init(); + pack200Test1(); + pack200Test2(); + pack200Test3(); + unpack200Test1(); + } + + // containers for test inputs and management + static abstract class TestInput { + + private final Object in; + private final Object out; + final boolean shouldNPE; + final String testname; + + public TestInput(String name, Object in, Object out) { + this.testname = name; + this.in = in; + this.out = out; + shouldNPE = (in == null || out == null); + } + + @Override + public String toString() { + StringBuilder outStr = new StringBuilder(testname); + outStr.append(", input:").append(in); + outStr.append(", output:").append(this.out); + outStr.append(", should NPE:").append(shouldNPE); + return outStr.toString(); + } + + void close() { + if (in != null && (in instanceof Closeable)) { + Utils.close((Closeable) in); + } + if (out != null && (out instanceof Closeable)) { + Utils.close((Closeable) out); + } + } + + void checkException(Throwable t) { + if (shouldNPE) { + if (t instanceof NullPointerException) { + System.out.println("Got expected exception"); + return; + } else { + throw new RuntimeException("Expected NPE, but got ", t); + } + } + if (t instanceof IOException) { + System.out.println("Got expected exception"); + return; + } else { + throw new RuntimeException("Expected IOException but got ", t); + } + } + } + + static class PackTestInput extends TestInput { + + public PackTestInput(JarFile jf, OutputStream out) { + super("PackTestInput", jf, out); + } + + JarFile getJarFile() { + return (JarFile) super.in; + } + + OutputStream getOutputStream() { + return (OutputStream) super.out; + } + }; + + static class PackTestJarInputStream extends TestInput { + + public PackTestJarInputStream(JarInputStream in, OutputStream out) { + super("PackTestJarInputStream", in, out); + } + + JarInputStream getJarInputStream() { + return (JarInputStream) super.in; + } + + OutputStream getOutputStream() { + return (OutputStream) super.out; + } + }; + + static class UnpackTestInput extends TestInput { + + public UnpackTestInput(InputStream in, JarOutputStream out) { + super("UnpackTestInput", in, out); + } + + InputStream getInputStream() { + return (InputStream) super.in; + } + + JarOutputStream getJarOutputStream() { + return (JarOutputStream) super.out; + } + }; + + static class UnpackTestFileInput extends TestInput { + + public UnpackTestFileInput(File in, JarOutputStream out) { + super("UnpackTestInput", in, out); + } + + File getInputFile() { + return (File) super.in; + } + + JarOutputStream getJarOutputStream() { + return (JarOutputStream) super.out; + } + }; +} diff --git a/langtools/.hgtags b/langtools/.hgtags index 0d6cdae403a..112c4c2ca39 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -88,3 +88,15 @@ a408ebb8b3d427dbb3d8ce153dfaeb060564a0a4 jdk7-b108 8bec624274ef8535720cff553374347c2f4f5fb2 jdk7-b111 fd2579b80b83bf5d4289426016c7d29174ba5dd9 jdk7-b112 6dbd2d869b0573fa5b799a23cccff47d20c12696 jdk7-b113 +e4e7408cdc5b3d91d39161e1e94aad576ecc2dcd jdk7-b114 +01e8ac5fbefd35d2d9a0996213cf2390fd164e57 jdk7-b115 +857bfcea3f30cb5f4ae96f46a53ae1c772f9b0e5 jdk7-b116 +2129a046f117547fc8a5cb3397a767e6d528f5b6 jdk7-b117 +c491eec0acc73fa41b77e1619ed03e56d8a75b83 jdk7-b118 +814561077c448292f78de461b6de5d78d57c2089 jdk7-b119 +1dd813a529cfa06d850ee7dc42da42efb8f6af0e jdk7-b120 +1bf969e9792f977a8593496681539840a54fe644 jdk7-b121 +11e7b4c0476e4d6085d8d28c4aa2833d46714a2a jdk7-b122 +a3b5b531542a372f30e014b1543a619a15a90780 jdk7-b123 +4868a36f6fd8972505c466013813eeb28f0482ea jdk7-b124 +4b0560c72b529d4b952924b2da94d8436af79d05 jdk7-b125 diff --git a/langtools/make/Makefile b/langtools/make/Makefile index 1ee42703ee6..5735a549c2a 100644 --- a/langtools/make/Makefile +++ b/langtools/make/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -187,7 +187,7 @@ all: build clobber: clean # All ant targets of interest -ANT_TARGETS = build clean sanity post-sanity diagnostics # for now +ANT_TARGETS = build clean sanity post-sanity diagnostics build-all-tools # for now # Create diagnostics log (careful, ant 1.8.0 -diagnostics always does an exit 1) $(OUTPUTDIR)/build/ant-diagnostics.log: diff --git a/langtools/make/build.properties b/langtools/make/build.properties index 4ba6256f053..ad48717afd5 100644 --- a/langtools/make/build.properties +++ b/langtools/make/build.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/langtools/make/tools/CompileProperties/CompileProperties.java b/langtools/make/tools/CompileProperties/CompileProperties.java index 5accd4df494..8889c59ff41 100644 --- a/langtools/make/tools/CompileProperties/CompileProperties.java +++ b/langtools/make/tools/CompileProperties/CompileProperties.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/make/tools/CompileProperties/CompilePropertiesTask.java b/langtools/make/tools/CompileProperties/CompilePropertiesTask.java index 4d16098701d..8bf330301ec 100644 --- a/langtools/make/tools/CompileProperties/CompilePropertiesTask.java +++ b/langtools/make/tools/CompileProperties/CompilePropertiesTask.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/src/share/bin/launcher.sh-template b/langtools/src/share/bin/launcher.sh-template index c912f83fad4..c4abbf4f742 100644 --- a/langtools/src/share/bin/launcher.sh-template +++ b/langtools/src/share/bin/launcher.sh-template @@ -26,6 +26,12 @@ # mydir="`dirname $0`" +case `uname -s` in + CYGWIN*) + mydir=`cygpath -m $mydir` + ;; +esac + mylib="`dirname $mydir`"/lib # By default, put the jar file and its dependencies on the bootclasspath. diff --git a/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java b/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java index 7fc82c6c368..243de9340e6 100644 --- a/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java +++ b/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/src/share/classes/com/sun/source/tree/DisjointTypeTree.java b/langtools/src/share/classes/com/sun/source/tree/DisjunctiveTypeTree.java similarity index 87% rename from langtools/src/share/classes/com/sun/source/tree/DisjointTypeTree.java rename to langtools/src/share/classes/com/sun/source/tree/DisjunctiveTypeTree.java index 6d122aaee48..ae8e5813845 100644 --- a/langtools/src/share/classes/com/sun/source/tree/DisjointTypeTree.java +++ b/langtools/src/share/classes/com/sun/source/tree/DisjunctiveTypeTree.java @@ -28,13 +28,13 @@ package com.sun.source.tree; import java.util.List; /** - * A tree node for a disjoint type expression in a multicatch var declaration. + * A tree node for a disjunctive type expression in a multicatch var declaration. * * * @author Maurizio Cimadamore * * @since 1.7 */ -public interface DisjointTypeTree extends Tree { - List getTypeComponents(); +public interface DisjunctiveTypeTree extends Tree { + List getTypeAlternatives(); } diff --git a/langtools/src/share/classes/com/sun/source/tree/MethodTree.java b/langtools/src/share/classes/com/sun/source/tree/MethodTree.java index 2e7cf4addb3..71eedc996bd 100644 --- a/langtools/src/share/classes/com/sun/source/tree/MethodTree.java +++ b/langtools/src/share/classes/com/sun/source/tree/MethodTree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +53,7 @@ public interface MethodTree extends Tree { Tree getReturnType(); List getTypeParameters(); List getParameters(); - List getReceiverAnnotations(); +//308 List getReceiverAnnotations(); List getThrows(); BlockTree getBody(); Tree getDefaultValue(); // for annotation types diff --git a/langtools/src/share/classes/com/sun/source/tree/Tree.java b/langtools/src/share/classes/com/sun/source/tree/Tree.java index 7e5ede9bf0a..28e7ba8ac85 100644 --- a/langtools/src/share/classes/com/sun/source/tree/Tree.java +++ b/langtools/src/share/classes/com/sun/source/tree/Tree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ public interface Tree { */ public enum Kind { - ANNOTATED_TYPE(AnnotatedTypeTree.class), +//308 ANNOTATED_TYPE(AnnotatedTypeTree.class), /** * Used for instances of {@link AnnotationTree}. @@ -234,9 +234,9 @@ public interface Tree { PARAMETERIZED_TYPE(ParameterizedTypeTree.class), /** - * Used for instances of {@link DisjointTypeTree}. + * Used for instances of {@link DisjunctiveTypeTree}. */ - DISJOINT_TYPE(DisjointTypeTree.class), + DISJUNCTIVE_TYPE(DisjunctiveTypeTree.class), /** * Used for instances of {@link TypeCastTree}. diff --git a/langtools/src/share/classes/com/sun/source/tree/TreeVisitor.java b/langtools/src/share/classes/com/sun/source/tree/TreeVisitor.java index d36b3690232..0f4e9259f00 100644 --- a/langtools/src/share/classes/com/sun/source/tree/TreeVisitor.java +++ b/langtools/src/share/classes/com/sun/source/tree/TreeVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,7 @@ package com.sun.source.tree; * @since 1.6 */ public interface TreeVisitor { - R visitAnnotatedType(AnnotatedTypeTree node, P p); +//308 R visitAnnotatedType(AnnotatedTypeTree node, P p); R visitAnnotation(AnnotationTree node, P p); R visitMethodInvocation(MethodInvocationTree node, P p); R visitAssert(AssertTree node, P p); @@ -96,7 +96,7 @@ public interface TreeVisitor { R visitCompilationUnit(CompilationUnitTree node, P p); R visitTry(TryTree node, P p); R visitParameterizedType(ParameterizedTypeTree node, P p); - R visitDisjointType(DisjointTypeTree node, P p); + R visitDisjunctiveType(DisjunctiveTypeTree node, P p); R visitArrayType(ArrayTypeTree node, P p); R visitTypeCast(TypeCastTree node, P p); R visitPrimitiveType(PrimitiveTypeTree node, P p); diff --git a/langtools/src/share/classes/com/sun/source/tree/TryTree.java b/langtools/src/share/classes/com/sun/source/tree/TryTree.java index 6e31bee66b0..24c185dc6d4 100644 --- a/langtools/src/share/classes/com/sun/source/tree/TryTree.java +++ b/langtools/src/share/classes/com/sun/source/tree/TryTree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/src/share/classes/com/sun/source/tree/TypeParameterTree.java b/langtools/src/share/classes/com/sun/source/tree/TypeParameterTree.java index 24f6e36884f..36d970e8c1e 100644 --- a/langtools/src/share/classes/com/sun/source/tree/TypeParameterTree.java +++ b/langtools/src/share/classes/com/sun/source/tree/TypeParameterTree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +47,5 @@ import javax.lang.model.element.Name; public interface TypeParameterTree extends Tree { Name getName(); List getBounds(); - List getAnnotations(); +//308 List getAnnotations(); } diff --git a/langtools/src/share/classes/com/sun/source/util/AbstractTypeProcessor.java b/langtools/src/share/classes/com/sun/source/util/AbstractTypeProcessor.java deleted file mode 100644 index 2e1053f3232..00000000000 --- a/langtools/src/share/classes/com/sun/source/util/AbstractTypeProcessor.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.source.util; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.annotation.processing.*; -import javax.lang.model.element.Name; -import javax.lang.model.element.TypeElement; -import javax.lang.model.util.ElementFilter; - -import com.sun.tools.javac.processing.JavacProcessingEnvironment; -import com.sun.tools.javac.util.Context; -import com.sun.tools.javac.util.Log; - -import com.sun.source.tree.ClassTree; - -/** - * This class is an abstract annotation processor designed to be a - * convenient superclass for concrete "type processors", processors that - * require the type information in the processed source. - * - *

        Type processing occurs in one round after the tool (e.g. java compiler) - * analyzes the source (all sources taken as input to the tool and sources - * generated by other annotation processors). - * - *

        The tool infrastructure will interact with classes extending this abstract - * class as follows: - * - *

          - * [1-3: Identical to {@link Processor} life cycle] - * - *
        1. If an existing {@code Processor} object is not being used, to - * create an instance of a processor the tool calls the no-arg - * constructor of the processor class. - * - *
        2. Next, the tool calls the {@link #init init} method with - * an appropriate {@code ProcessingEnvironment}. - * - *
        3. Afterwards, the tool calls {@link #getSupportedAnnotationTypes - * getSupportedAnnotationTypes}, {@link #getSupportedOptions - * getSupportedOptions}, and {@link #getSupportedSourceVersion - * getSupportedSourceVersion}. These methods are only called once per - * run, not on each round. - * - * [4-5Unique to {@code AbstractTypeProcessor} subclasses] - * - *
        4. For each class containing a supported annotation, the tool calls - * {@link #typeProcess(TypeElement, TreePath) typeProcess} method on the - * {@code Processor}. The class is guaranteed to be type-checked Java code - * and all the tree type and symbol information is resolved. - * - *
        5. Finally, the tools calls the - * {@link #typeProcessingOver() typeProcessingOver} method - * on the {@code Processor}. - * - *
        - * - *

        The tool is permitted to ask type processors to process a class once - * it is analyzed before the rest of classes are analyzed. The tool is also - * permitted to stop type processing immediately if any errors are raised, - * without invoking {@code typeProcessingOver} - * - *

        A subclass may override any of the methods in this class, as long as the - * general {@link javax.annotation.processing.Processor Processor} - * contract is obeyed, with one notable exception. - * {@link #process(Set, RoundEnvironment)} may not be overridden, as it - * is called during the regular annotation phase before classes are analyzed. - * - * @author Mahmood Ali - * @since 1.7 - */ -public abstract class AbstractTypeProcessor extends AbstractProcessor { - private final Set elements = new HashSet(); - private boolean hasInvokedTypeProcessingOver = false; - private JavacProcessingEnvironment env; - private final AttributionTaskListener listener = new AttributionTaskListener(); - - /** - * Constructor for subclasses to call. - */ - protected AbstractTypeProcessor() { } - - /** - * {@inheritDoc} - */ - @Override - public void init(ProcessingEnvironment env) { - super.init(env); - this.env = (JavacProcessingEnvironment)env; - prepareContext(this.env.getContext()); - } - - /** - * The use of this method is obsolete in type processors. The method is - * called during regular annotation processing phase only. - */ - @Override - public final boolean process(Set annotations, - RoundEnvironment roundEnv) { - for (TypeElement elem : ElementFilter.typesIn(roundEnv.getRootElements())) { - elements.add(elem.getQualifiedName()); - } - return false; - } - - /** - * Processes a fully analyzed class that contains a supported annotation - * (look {@link #getSupportedAnnotationTypes()}). - * - *

        The passed class is always a valid type-checked Java code. - * - * @param element element of the analyzed class - * @param tree the tree path to the element, with the leaf being a - * {@link ClassTree} - */ - public abstract void typeProcess(TypeElement element, TreePath tree); - - /** - * A method to be called once all the classes are processed and no error - * is reported. - * - *

        Subclasses may override this method to do any aggregate analysis - * (e.g. generate report, persistence) or resource deallocation. - * - *

        If an error (a Java error or a processor error) is reported, this - * method is not guaranteed to be invoked. - */ - public void typeProcessingOver() { } - - /** - * adds a listener for attribution. - */ - private void prepareContext(Context context) { - TaskListener otherListener = context.get(TaskListener.class); - if (otherListener == null) { - context.put(TaskListener.class, listener); - } else { - // handle cases of multiple listeners - context.put(TaskListener.class, (TaskListener)null); - TaskListeners listeners = new TaskListeners(); - listeners.add(otherListener); - listeners.add(listener); - context.put(TaskListener.class, listeners); - } - } - - /** - * A task listener that invokes the processor whenever a class is fully - * analyzed. - */ - private final class AttributionTaskListener implements TaskListener { - - @Override - public void finished(TaskEvent e) { - Log log = Log.instance(env.getContext()); - - if (!hasInvokedTypeProcessingOver && elements.isEmpty() && log.nerrors == 0) { - typeProcessingOver(); - hasInvokedTypeProcessingOver = true; - } - - if (e.getKind() != TaskEvent.Kind.ANALYZE) - return; - - if (e.getTypeElement() == null) - throw new AssertionError("event task without a type element"); - if (e.getCompilationUnit() == null) - throw new AssertionError("even task without compilation unit"); - - if (!elements.remove(e.getTypeElement().getQualifiedName())) - return; - - if (log.nerrors != 0) - return; - - TypeElement elem = e.getTypeElement(); - TreePath p = Trees.instance(env).getPath(elem); - - typeProcess(elem, p); - - if (!hasInvokedTypeProcessingOver && elements.isEmpty() && log.nerrors == 0) { - typeProcessingOver(); - hasInvokedTypeProcessingOver = true; - } - } - - @Override - public void started(TaskEvent e) { } - - } - - /** - * A task listener multiplexer. - */ - private static class TaskListeners implements TaskListener { - private final List listeners = new ArrayList(); - - public void add(TaskListener listener) { - listeners.add(listener); - } - - public void remove(TaskListener listener) { - listeners.remove(listener); - } - - @Override - public void finished(TaskEvent e) { - for (TaskListener listener : listeners) - listener.finished(e); - } - - @Override - public void started(TaskEvent e) { - for (TaskListener listener : listeners) - listener.started(e); - } - } -} diff --git a/langtools/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java b/langtools/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java index fb60b890542..f3c59fdfd91 100644 --- a/langtools/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java +++ b/langtools/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +228,7 @@ public class SimpleTreeVisitor implements TreeVisitor { return defaultAction(node, p); } - public R visitDisjointType(DisjointTypeTree node, P p) { + public R visitDisjunctiveType(DisjunctiveTypeTree node, P p) { return defaultAction(node, p); } @@ -248,9 +248,9 @@ public class SimpleTreeVisitor implements TreeVisitor { return defaultAction(node, p); } - public R visitAnnotatedType(AnnotatedTypeTree node, P p) { - return defaultAction(node, p); - } +//308 public R visitAnnotatedType(AnnotatedTypeTree node, P p) { +//308 return defaultAction(node, p); +//308 } public R visitErroneous(ErroneousTree node, P p) { return defaultAction(node, p); diff --git a/langtools/src/share/classes/com/sun/source/util/TreeScanner.java b/langtools/src/share/classes/com/sun/source/util/TreeScanner.java index 3a8f07aca99..b8525b8008d 100644 --- a/langtools/src/share/classes/com/sun/source/util/TreeScanner.java +++ b/langtools/src/share/classes/com/sun/source/util/TreeScanner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -138,7 +138,7 @@ public class TreeScanner implements TreeVisitor { r = scanAndReduce(node.getReturnType(), p, r); r = scanAndReduce(node.getTypeParameters(), p, r); r = scanAndReduce(node.getParameters(), p, r); - r = scanAndReduce(node.getReceiverAnnotations(), p, r); +//308 r = scanAndReduce(node.getReceiverAnnotations(), p, r); r = scanAndReduce(node.getThrows(), p, r); r = scanAndReduce(node.getBody(), p, r); r = scanAndReduce(node.getDefaultValue(), p, r); @@ -356,13 +356,13 @@ public class TreeScanner implements TreeVisitor { return r; } - public R visitDisjointType(DisjointTypeTree node, P p) { - return scan(node.getTypeComponents(), p); + public R visitDisjunctiveType(DisjunctiveTypeTree node, P p) { + return scan(node.getTypeAlternatives(), p); } public R visitTypeParameter(TypeParameterTree node, P p) { - R r = scan(node.getAnnotations(), p); - r = scanAndReduce(node.getBounds(), p, r); + R r = scan(node.getBounds(), p); +//308 R r = scanAndReduce(node.getAnnotations(), p, r); return r; } @@ -380,11 +380,11 @@ public class TreeScanner implements TreeVisitor { return r; } - public R visitAnnotatedType(AnnotatedTypeTree node, P p) { - R r = scan(node.getAnnotations(), p); - r = scanAndReduce(node.getUnderlyingType(), p, r); - return r; - } +//308 public R visitAnnotatedType(AnnotatedTypeTree node, P p) { +//308 R r = scan(node.getAnnotations(), p); +//308 r = scanAndReduce(node.getUnderlyingType(), p, r); +//308 return r; +//308 } public R visitOther(Tree node, P p) { return null; diff --git a/langtools/src/share/classes/com/sun/source/util/Trees.java b/langtools/src/share/classes/com/sun/source/util/Trees.java index 4c0d49c7ccb..50f5f714007 100644 --- a/langtools/src/share/classes/com/sun/source/util/Trees.java +++ b/langtools/src/share/classes/com/sun/source/util/Trees.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +52,7 @@ import com.sun.source.tree.Tree; public abstract class Trees { /** * Gets a Trees object for a given CompilationTask. + * @param task the compilation task for which to get the Trees object * @throws IllegalArgumentException if the task does not support the Trees API. */ public static Trees instance(CompilationTask task) { @@ -61,7 +62,8 @@ public abstract class Trees { } /** - * Gets a Trees object for a given CompilationTask. + * Gets a Trees object for a given ProcessingEnvironment. + * @param env the processing environment for which to get the Trees object * @throws IllegalArgumentException if the env does not support the Trees API. */ public static Trees instance(ProcessingEnvironment env) { @@ -162,6 +164,12 @@ public abstract class Trees { */ public abstract Scope getScope(TreePath path); + /** + * Gets the doc comment, if any, for the Tree node identified by a given TreePath. + * Returns null if no doc comment was found. + */ + public abstract String getDocComment(TreePath path); + /** * Checks whether a given type is accessible in a given scope. * @param scope the scope to be checked diff --git a/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java b/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java index 07184df0073..00f261a2faf 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java +++ b/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java b/langtools/src/share/classes/com/sun/tools/apt/main/AptJavaCompiler.java similarity index 96% rename from langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java rename to langtools/src/share/classes/com/sun/tools/apt/main/AptJavaCompiler.java index 023712e4c3b..96403007faa 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java +++ b/langtools/src/share/classes/com/sun/tools/apt/main/AptJavaCompiler.java @@ -51,16 +51,16 @@ import com.sun.tools.javac.parser.DocCommentScanner; * or deletion without notice. */ @SuppressWarnings("deprecation") -public class JavaCompiler extends com.sun.tools.javac.main.JavaCompiler { +public class AptJavaCompiler extends com.sun.tools.javac.main.JavaCompiler { /** The context key for the compiler. */ - protected static final Context.Key compilerKey = - new Context.Key(); + protected static final Context.Key compilerKey = + new Context.Key(); /** Get the JavaCompiler instance for this context. */ - public static JavaCompiler instance(Context context) { - JavaCompiler instance = context.get(compilerKey); + public static AptJavaCompiler instance(Context context) { + AptJavaCompiler instance = context.get(compilerKey); if (instance == null) - instance = new JavaCompiler(context); + instance = new AptJavaCompiler(context); return instance; } @@ -107,7 +107,7 @@ public class JavaCompiler extends com.sun.tools.javac.main.JavaCompiler { /** Construct a new compiler from a shared context. */ - public JavaCompiler(Context context) { + public AptJavaCompiler(Context context) { super(preRegister(context)); context.put(compilerKey, this); diff --git a/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java b/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java index 63aa98b2750..530683078bb 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java +++ b/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/src/share/classes/com/sun/tools/apt/main/Main.java b/langtools/src/share/classes/com/sun/tools/apt/main/Main.java index 4f2ce9b0a7c..5c2cfcc4b7d 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/main/Main.java +++ b/langtools/src/share/classes/com/sun/tools/apt/main/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -421,7 +421,7 @@ public class Main { }, new AptOption("-version", "opt.version") { boolean process(String option) { - Bark.printLines(out, ownName + " " + JavaCompiler.version()); + Bark.printLines(out, ownName + " " + AptJavaCompiler.version()); return super.process(option); } }, @@ -1111,11 +1111,11 @@ public class Main { } int exitCode = EXIT_OK; - JavaCompiler comp = null; + AptJavaCompiler comp = null; try { context.put(Bark.outKey, out); - comp = JavaCompiler.instance(context); + comp = AptJavaCompiler.instance(context); if (comp == null) return EXIT_SYSERR; @@ -1184,7 +1184,7 @@ public class Main { */ void bugMessage(Throwable ex) { Bark.printLines(out, getLocalizedString("msg.bug", - JavaCompiler.version())); + AptJavaCompiler.version())); ex.printStackTrace(out); } diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java index 048bfe036b9..3a15cc4c2a5 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -120,7 +120,7 @@ public class FilerImpl implements Filer { private final Options opts; private final DeclarationMaker declMaker; - private final com.sun.tools.apt.main.JavaCompiler comp; + private final com.sun.tools.apt.main.AptJavaCompiler comp; // Platform's default encoding private final static String DEFAULT_ENCODING = @@ -177,7 +177,7 @@ public class FilerImpl implements Filer { opts = Options.instance(context); declMaker = DeclarationMaker.instance(context); bark = Bark.instance(context); - comp = com.sun.tools.apt.main.JavaCompiler.instance(context); + comp = com.sun.tools.apt.main.AptJavaCompiler.instance(context); roundOver = false; this.filesCreated = comp.getAggregateGenFiles(); diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java index 6dae6cd7d81..1849c9a859e 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -250,9 +250,13 @@ class AnnotationProxyMaker { /** * Sets "value" to an ExceptionProxy indicating a type mismatch. */ - private void typeMismatch(final Method method, final Attribute attr) { - value = new ExceptionProxy() { + private void typeMismatch(Method method, final Attribute attr) { + class AnnotationTypeMismatchExceptionProxy extends ExceptionProxy { private static final long serialVersionUID = 8473323277815075163L; + transient final Method method; + AnnotationTypeMismatchExceptionProxy(Method method) { + this.method = method; + } public String toString() { return ""; // eg: @Anno(value=) } @@ -260,7 +264,8 @@ class AnnotationProxyMaker { return new AnnotationTypeMismatchException(method, attr.type.toString()); } - }; + } + value = new AnnotationTypeMismatchExceptionProxy(method); } } diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java index 8f813a27374..69ff36e2672 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java index 11a4eb3272f..0e9e23db2d4 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/src/share/classes/com/sun/tools/apt/resources/apt_ja.properties b/langtools/src/share/classes/com/sun/tools/apt/resources/apt_ja.properties index 7436904ed29..a103aa7aa07 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/resources/apt_ja.properties +++ b/langtools/src/share/classes/com/sun/tools/apt/resources/apt_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/langtools/src/share/classes/com/sun/tools/apt/resources/apt_zh_CN.properties b/langtools/src/share/classes/com/sun/tools/apt/resources/apt_zh_CN.properties index c54564345c8..87a2d3cc6f5 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/resources/apt_zh_CN.properties +++ b/langtools/src/share/classes/com/sun/tools/apt/resources/apt_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java b/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java index 12f56a0f7cf..13b3d48b900 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java b/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java index 5f8f9211dd8..a007421d03a 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java index f7e87b9c996..191b392937e 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 +26,16 @@ package com.sun.tools.doclets.formats.html; import com.sun.javadoc.*; +import com.sun.tools.doclets.formats.html.markup.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; /** * Print method and constructor info. * * @author Robert Field * @author Atul M Dambalkar + * @author Bhavesh Patel (Modified) */ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWriter { @@ -45,82 +49,111 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite } /** - * Write the type parameters for the executable member. + * Add the type parameters for the executable member. * * @param member the member to write type parameters for. + * @param htmltree the content tree to which the parameters will be added. * @return the display length required to write this information. */ - protected int writeTypeParameters(ExecutableMemberDoc member) { + protected int addTypeParameters(ExecutableMemberDoc member, Content htmltree) { LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_MEMBER_TYPE_PARAMS, member, false); String typeParameters = writer.getTypeParameterLinks(linkInfo); if (linkInfo.displayLength > 0) { - writer.print(typeParameters + " "); + Content linkContent = new RawHtml(typeParameters); + htmltree.addContent(linkContent); + htmltree.addContent(writer.getSpace()); writer.displayLength += linkInfo.displayLength + 1; } return linkInfo.displayLength; } - protected void writeSignature(ExecutableMemberDoc member) { - writer.displayLength = 0; - writer.pre(); - writer.writeAnnotationInfo(member); - printModifiers(member); - writeTypeParameters(member); - if (configuration().linksource && - member.position().line() != classdoc.position().line()) { - writer.printSrcLink(member, member.name()); - } else { - strong(member.name()); - } - writeParameters(member); - writeExceptions(member); - writer.preEnd(); - } - - protected void writeDeprecatedLink(ProgramElementDoc member) { + /** + * {@inheritDoc} + */ + protected Content getDeprecatedLink(ProgramElementDoc member) { ExecutableMemberDoc emd = (ExecutableMemberDoc)member; - writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, (MemberDoc) emd, - emd.qualifiedName() + emd.flatSignature(), false); + return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, (MemberDoc) emd, + emd.qualifiedName() + emd.flatSignature()); } - protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) { + /** + * Add the summary link for the member. + * + * @param context the id of the context where the link will be printed + * @param classDoc the classDoc that we should link to + * @param member the member being linked to + * @param tdSummary the content tree to which the link will be added + */ + protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member, + Content tdSummary) { ExecutableMemberDoc emd = (ExecutableMemberDoc)member; String name = emd.name(); - writer.strong(); - writer.printDocLink(context, cd, (MemberDoc) emd, - name, false); - writer.strongEnd(); + Content strong = HtmlTree.STRONG(new RawHtml( + writer.getDocLink(context, cd, (MemberDoc) emd, + name, false))); + Content code = HtmlTree.CODE(strong); writer.displayLength = name.length(); - writeParameters(emd, false); + addParameters(emd, false, code); + tdSummary.addContent(code); } - protected void writeInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member) { - writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc) member, - member.name(), false); + /** + * Add the inherited summary link for the member. + * + * @param classDoc the classDoc that we should link to + * @param member the member being linked to + * @param linksTree the content tree to which the link will be added + */ + protected void addInheritedSummaryLink(ClassDoc cd, + ProgramElementDoc member, Content linksTree) { + linksTree.addContent(new RawHtml( + writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc) member, + member.name(), false))); } - protected void writeParam(ExecutableMemberDoc member, Parameter param, - boolean isVarArg) { + /** + * Add the parameter for the executable member. + * + * @param member the member to write parameter for. + * @param param the parameter that needs to be written. + * @param isVarArg true if this is a link to var arg. + * @param tree the content tree to which the parameter information will be added. + */ + protected void addParam(ExecutableMemberDoc member, Parameter param, + boolean isVarArg, Content tree) { if (param.type() != null) { - writer.printLink(new LinkInfoImpl( - LinkInfoImpl.CONTEXT_EXECUTABLE_MEMBER_PARAM, param.type(), - isVarArg)); + Content link = new RawHtml(writer.getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_EXECUTABLE_MEMBER_PARAM, param.type(), + isVarArg))); + tree.addContent(link); } if(param.name().length() > 0) { - writer.space(); - writer.print(param.name()); + tree.addContent(writer.getSpace()); + tree.addContent(param.name()); } } - protected void writeParameters(ExecutableMemberDoc member) { - writeParameters(member, true); + /** + * Add all the parameters for the executable member. + * + * @param member the member to write parameters for. + * @param tree the content tree to which the parameters information will be added. + */ + protected void addParameters(ExecutableMemberDoc member, Content htmltree) { + addParameters(member, true, htmltree); } - protected void writeParameters(ExecutableMemberDoc member, - boolean includeAnnotations) { - print('('); + /** + * Add all the parameters for the executable member. + * + * @param member the member to write parameters for. + * @param includeAnnotations true if annotation information needs to be added. + * @param tree the content tree to which the parameters information will be added. + */ + protected void addParameters(ExecutableMemberDoc member, + boolean includeAnnotations, Content htmltree) { + htmltree.addContent("("); Parameter[] params = member.parameters(); String indent = makeSpace(writer.displayLength); if (configuration().linksource) { @@ -132,58 +165,70 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite Parameter param = params[paramstart]; if (!param.name().startsWith("this$")) { if (includeAnnotations) { - boolean foundAnnotations = - writer.writeAnnotationInfo(indent.length(), member, param); - if (foundAnnotations) { - writer.println(); - writer.print(indent); + boolean foundAnnotations = + writer.addAnnotationInfo(indent.length(), + member, param, htmltree); + if (foundAnnotations) { + htmltree.addContent(DocletConstants.NL); + htmltree.addContent(indent); } } - writeParam(member, param, - (paramstart == params.length - 1) && member.isVarArgs()); + addParam(member, param, + (paramstart == params.length - 1) && member.isVarArgs(), htmltree); break; } } for (int i = paramstart + 1; i < params.length; i++) { - writer.print(','); - writer.println(); - writer.print(indent); + htmltree.addContent(","); + htmltree.addContent(DocletConstants.NL); + htmltree.addContent(indent); if (includeAnnotations) { boolean foundAnnotations = - writer.writeAnnotationInfo(indent.length(), member, params[i]); + writer.addAnnotationInfo(indent.length(), member, params[i], + htmltree); if (foundAnnotations) { - writer.println(); - writer.print(indent); + htmltree.addContent(DocletConstants.NL); + htmltree.addContent(indent); } } - writeParam(member, params[i], (i == params.length - 1) && member.isVarArgs()); + addParam(member, params[i], (i == params.length - 1) && member.isVarArgs(), + htmltree); } - writer.print(')'); + htmltree.addContent(")"); } - protected void writeExceptions(ExecutableMemberDoc member) { + /** + * Add exceptions for the executable member. + * + * @param member the member to write exceptions for. + * @param htmltree the content tree to which the exceptions information will be added. + */ + protected void addExceptions(ExecutableMemberDoc member, Content htmltree) { Type[] exceptions = member.thrownExceptionTypes(); if(exceptions.length > 0) { LinkInfoImpl memberTypeParam = new LinkInfoImpl( - LinkInfoImpl.CONTEXT_MEMBER, member, false); + LinkInfoImpl.CONTEXT_MEMBER, member, false); int retlen = getReturnTypeLength(member); writer.getTypeParameterLinks(memberTypeParam); retlen += memberTypeParam.displayLength == 0 ? 0 : memberTypeParam.displayLength + 1; String indent = makeSpace(modifierString(member).length() + - member.name().length() + retlen - 4); - writer.println(); - writer.print(indent); - writer.print("throws "); + member.name().length() + retlen - 4); + htmltree.addContent(DocletConstants.NL); + htmltree.addContent(indent); + htmltree.addContent("throws "); indent += " "; - writer.printLink(new LinkInfoImpl( - LinkInfoImpl.CONTEXT_MEMBER, exceptions[0])); + Content link = new RawHtml(writer.getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_MEMBER, exceptions[0]))); + htmltree.addContent(link); for(int i = 1; i < exceptions.length; i++) { - writer.println(","); - writer.print(indent); - writer.printLink(new LinkInfoImpl( - LinkInfoImpl.CONTEXT_MEMBER, exceptions[i])); + htmltree.addContent(","); + htmltree.addContent(DocletConstants.NL); + htmltree.addContent(indent); + Content exceptionLink = new RawHtml(writer.getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_MEMBER, exceptions[i]))); + htmltree.addContent(exceptionLink); } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java index eced2077e67..0284f8a1f9f 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import java.util.*; import com.sun.javadoc.*; import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; +import com.sun.tools.doclets.internal.toolkit.*; /** * Generate Index for all the Member Names with Indexing in @@ -39,6 +41,7 @@ import com.sun.tools.doclets.internal.toolkit.util.*; * * @see IndexBuilder * @author Atul M Dambalkar + * @author Bhavesh Patel (Modified) */ public class AbstractIndexWriter extends HtmlDocletWriter { @@ -78,175 +81,187 @@ public class AbstractIndexWriter extends HtmlDocletWriter { } /** - * Print the text "Index" in strong format in the navigation bar. + * Get the index label for navigation bar. + * + * @return a content tree for the tree label */ - protected void navLinkIndex() { - navCellRevStart(); - fontStyle("NavBarFont1Rev"); - strongText("doclet.Index"); - fontEnd(); - navCellEnd(); + protected Content getNavLinkIndex() { + Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, indexLabel); + return li; } /** - * Generate the member information for the unicode character along with the + * Add the member information for the unicode character along with the * list of the members. * - * @param unicode Unicode for which member list information to be generated. - * @param memberlist List of members for the unicode character. + * @param unicode Unicode for which member list information to be generated + * @param memberlist List of members for the unicode character + * @param contentTree the content tree to which the information will be added */ - protected void generateContents(Character unicode, List memberlist) { - anchor("_" + unicode + "_"); - h2(); - strong(unicode.toString()); - h2End(); + protected void addContents(Character unicode, List memberlist, + Content contentTree) { + contentTree.addContent(getMarkerAnchor("_" + unicode + "_")); + Content headContent = new StringContent(unicode.toString()); + Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, false, + HtmlStyle.title, headContent); + contentTree.addContent(heading); int memberListSize = memberlist.size(); // Display the list only if there are elements to be displayed. if (memberListSize > 0) { - dl(); + Content dl = new HtmlTree(HtmlTag.DL); for (int i = 0; i < memberListSize; i++) { Doc element = memberlist.get(i); if (element instanceof MemberDoc) { - printDescription((MemberDoc)element); + addDescription((MemberDoc)element, dl); } else if (element instanceof ClassDoc) { - printDescription((ClassDoc)element); + addDescription((ClassDoc)element, dl); } else if (element instanceof PackageDoc) { - printDescription((PackageDoc)element); + addDescription((PackageDoc)element, dl); } } - dlEnd(); + contentTree.addContent(dl); } - hr(); } - /** - * Print one line summary comment for the package. + * Add one line summary comment for the package. * - * @param pkg PackageDoc passed. + * @param pkg the package to be documented + * @param dlTree the content tree to which the description will be added */ - protected void printDescription(PackageDoc pkg) { - dt(); - printPackageLink(pkg, Util.getPackageName(pkg), true); - print(" - "); - print(configuration.getText("doclet.package") + " " + pkg.name()); - dtEnd(); - dd(); - printSummaryComment(pkg); - ddEnd(); + protected void addDescription(PackageDoc pkg, Content dlTree) { + Content link = getPackageLink(pkg, new StringContent(Util.getPackageName(pkg))); + Content dt = HtmlTree.DT(link); + dt.addContent(" - "); + dt.addContent(getResource("doclet.package")); + dt.addContent(" " + pkg.name()); + dlTree.addContent(dt); + Content dd = new HtmlTree(HtmlTag.DD); + addSummaryComment(pkg, dd); + dlTree.addContent(dd); } /** - * Print one line summary comment for the class. + * Add one line summary comment for the class. * - * @param cd ClassDoc passed. + * @param cd the class being documented + * @param dlTree the content tree to which the description will be added */ - protected void printDescription(ClassDoc cd) { - dt(); - printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_INDEX, cd, true)); - print(" - "); - printClassInfo(cd); - dtEnd(); - dd(); - printComment(cd); - ddEnd(); + protected void addDescription(ClassDoc cd, Content dlTree) { + Content link = new RawHtml( + getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_INDEX, cd, true))); + Content dt = HtmlTree.DT(link); + dt.addContent(" - "); + addClassInfo(cd, dt); + dlTree.addContent(dt); + Content dd = new HtmlTree(HtmlTag.DD); + addComment(cd, dd); + dlTree.addContent(dd); } /** - * Print the classkind(class, interface, exception, error of the class + * Add the classkind(class, interface, exception, error of the class * passed. * - * @param cd ClassDoc. + * @param cd the class being documented + * @param contentTree the content tree to which the class info will be added */ - protected void printClassInfo(ClassDoc cd) { - print(configuration.getText("doclet.in", - Util.getTypeName(configuration, cd, false), - getPackageLink(cd.containingPackage(), + protected void addClassInfo(ClassDoc cd, Content contentTree) { + contentTree.addContent(getResource("doclet.in", + Util.getTypeName(configuration, cd, false), + getPackageLinkString(cd.containingPackage(), Util.getPackageName(cd.containingPackage()), false))); } - /** - * Generate Description for Class, Field, Method or Constructor. - * for Java.* Packages Class Members. + * Add description for Class, Field, Method or Constructor. * - * @param member MemberDoc for the member of the Class Kind. - * @see com.sun.javadoc.MemberDoc + * @param member MemberDoc for the member of the Class Kind + * @param dlTree the content tree to which the description will be added */ - protected void printDescription(MemberDoc member) { + protected void addDescription(MemberDoc member, Content dlTree) { String name = (member instanceof ExecutableMemberDoc)? member.name() + ((ExecutableMemberDoc)member).flatSignature() : member.name(); if (name.indexOf("<") != -1 || name.indexOf(">") != -1) { name = Util.escapeHtmlChars(name); } - ClassDoc containing = member.containingClass(); - dt(); - printDocLink(LinkInfoImpl.CONTEXT_INDEX, member, name, true); - println(" - "); - printMemberDesc(member); - println(); - dtEnd(); - dd(); - printComment(member); - ddEnd(); - println(); + Content span = HtmlTree.SPAN(HtmlStyle.strong, + getDocLink(LinkInfoImpl.CONTEXT_INDEX, member, name)); + Content dt = HtmlTree.DT(span); + dt.addContent(" - "); + addMemberDesc(member, dt); + dlTree.addContent(dt); + Content dd = new HtmlTree(HtmlTag.DD); + addComment(member, dd); + dlTree.addContent(dd); } - /** - * Print comment for each element in the index. If the element is deprecated + * Add comment for each element in the index. If the element is deprecated * and it has a @deprecated tag, use that comment. Else if the containing * class for this element is deprecated, then add the word "Deprecated." at * the start and then print the normal comment. * - * @param element Index element. + * @param element Index element + * @param contentTree the content tree to which the comment will be added */ - protected void printComment(ProgramElementDoc element) { + protected void addComment(ProgramElementDoc element, Content contentTree) { Tag[] tags; + Content span = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase); + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.block); if (Util.isDeprecated(element)) { - strongText("doclet.Deprecated"); space(); + div.addContent(span); if ((tags = element.tags("deprecated")).length > 0) - printInlineDeprecatedComment(element, tags[0]); + addInlineDeprecatedComment(element, tags[0], div); + contentTree.addContent(div); } else { ClassDoc cont = element.containingClass(); while (cont != null) { if (Util.isDeprecated(cont)) { - strongText("doclet.Deprecated"); space(); + div.addContent(span); + contentTree.addContent(div); break; } cont = cont.containingClass(); } - printSummaryComment(element); + addSummaryComment(element, contentTree); } } /** - * Print description about the Static Varible/Method/Constructor for a + * Add description about the Static Varible/Method/Constructor for a * member. * - * @param member MemberDoc for the member within the Class Kind. - * @see com.sun.javadoc.MemberDoc + * @param member MemberDoc for the member within the Class Kind + * @param contentTree the content tree to which the member description will be added */ - protected void printMemberDesc(MemberDoc member) { + protected void addMemberDesc(MemberDoc member, Content contentTree) { ClassDoc containing = member.containingClass(); - String classdesc = Util.getTypeName(configuration, containing, true) + " " + - getPreQualifiedClassLink(LinkInfoImpl.CONTEXT_INDEX, containing, - false); + String classdesc = Util.getTypeName( + configuration, containing, true) + " "; if (member.isField()) { if (member.isStatic()) { - printText("doclet.Static_variable_in", classdesc); + contentTree.addContent( + getResource("doclet.Static_variable_in", classdesc)); } else { - printText("doclet.Variable_in", classdesc); + contentTree.addContent( + getResource("doclet.Variable_in", classdesc)); } } else if (member.isConstructor()) { - printText("doclet.Constructor_for", classdesc); + contentTree.addContent( + getResource("doclet.Constructor_for", classdesc)); } else if (member.isMethod()) { if (member.isStatic()) { - printText("doclet.Static_method_in", classdesc); + contentTree.addContent( + getResource("doclet.Static_method_in", classdesc)); } else { - printText("doclet.Method_in", classdesc); + contentTree.addContent( + getResource("doclet.Method_in", classdesc)); } } + addPreQualifiedClassLink(LinkInfoImpl.CONTEXT_INDEX, containing, + false, contentTree); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java index c1cbbd775e9..27ca14fab60 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,11 @@ package com.sun.tools.doclets.formats.html; -import java.lang.reflect.Modifier; import java.util.*; - +import java.lang.reflect.Modifier; import com.sun.javadoc.*; +import com.sun.tools.doclets.formats.html.markup.*; +import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.taglets.*; @@ -60,36 +61,125 @@ public abstract class AbstractMemberWriter { /*** abstracts ***/ - public abstract void printSummaryLabel(); + /** + * Add the summary label for the member. + * + * @param memberTree the content tree to which the label will be added + */ + public abstract void addSummaryLabel(Content memberTree); - public abstract void printTableSummary(); + /** + * Get the summary for the member summary table. + * + * @return a string for the table summary + */ + public abstract String getTableSummary(); - public abstract void printSummaryTableHeader(ProgramElementDoc member); + /** + * Get the caption for the member summary table. + * + * @return a string for the table caption + */ + public abstract String getCaption(); - public abstract void printInheritedSummaryLabel(ClassDoc cd); + /** + * Get the summary table header for the member. + * + * @param member the member to be documented + * @return the summary table header + */ + public abstract String[] getSummaryTableHeader(ProgramElementDoc member); - public abstract void printSummaryAnchor(ClassDoc cd); + /** + * Add inherited summary lable for the member. + * + * @param cd the class doc to which to link to + * @param inheritedTree the content tree to which the inherited summary label will be added + */ + public abstract void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree); - public abstract void printInheritedSummaryAnchor(ClassDoc cd); + /** + * Add the anchor for the summary section of the member. + * + * @param cd the class doc to be documented + * @param memberTree the content tree to which the summary anchor will be added + */ + public abstract void addSummaryAnchor(ClassDoc cd, Content memberTree); - protected abstract void printSummaryType(ProgramElementDoc member); + /** + * Add the anchor for the inherited summary section of the member. + * + * @param cd the class doc to be documented + * @param inheritedTree the content tree to which the inherited summary anchor will be added + */ + public abstract void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree); - protected void writeSummaryLink(ClassDoc cd, ProgramElementDoc member) { - writeSummaryLink(LinkInfoImpl.CONTEXT_MEMBER, cd, member); + /** + * Add the summary type for the member. + * + * @param member the member to be documented + * @param tdSummaryType the content tree to which the type will be added + */ + protected abstract void addSummaryType(ProgramElementDoc member, + Content tdSummaryType); + + /** + * Add the summary link for the member. + * + * @param cd the class doc to be documented + * @param member the member to be documented + * @param tdSummary the content tree to which the link will be added + */ + protected void addSummaryLink(ClassDoc cd, ProgramElementDoc member, + Content tdSummary) { + addSummaryLink(LinkInfoImpl.CONTEXT_MEMBER, cd, member, tdSummary); } - protected abstract void writeSummaryLink(int context, - ClassDoc cd, - ProgramElementDoc member); + /** + * Add the summary link for the member. + * + * @param context the id of the context where the link will be printed + * @param cd the class doc to be documented + * @param member the member to be documented + * @param tdSummary the content tree to which the summary link will be added + */ + protected abstract void addSummaryLink(int context, + ClassDoc cd, ProgramElementDoc member, Content tdSummary); - protected abstract void writeInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member); + /** + * Add the inherited summary link for the member. + * + * @param cd the class doc to be documented + * @param member the member to be documented + * @param linksTree the content tree to which the inherited summary link will be added + */ + protected abstract void addInheritedSummaryLink(ClassDoc cd, + ProgramElementDoc member, Content linksTree); - protected abstract void writeDeprecatedLink(ProgramElementDoc member); + /** + * Get the deprecated link. + * + * @param member the member being linked to + * @return a content tree representing the link + */ + protected abstract Content getDeprecatedLink(ProgramElementDoc member); - protected abstract void printNavSummaryLink(ClassDoc cd, boolean link); + /** + * Get the navigation summary link. + * + * @param cd the class doc to be documented + * @param link true if its a link else the label to be printed + * @return a content tree for the navigation summary link. + */ + protected abstract Content getNavSummaryLink(ClassDoc cd, boolean link); - protected abstract void printNavDetailLink(boolean link); + /** + * Add the navigation detail link. + * + * @param link true if its a link else the label to be printed + * @param liNav the content tree to which the navigation detail link will be added + */ + protected abstract void addNavDetailLink(boolean link, Content liNav); /*** ***/ @@ -108,6 +198,17 @@ public abstract class AbstractMemberWriter { writer.displayLength += str.length(); } + /** + * Add the member name to the content tree and modifies the display length. + * + * @param name the member name to be added to the content tree. + * @param htmltree the content tree to which the name will be added. + */ + protected void addName(String name, Content htmltree) { + htmltree.addContent(name); + writer.displayLength += name.length(); + } + /** * Return a string describing the access modifier flags. * Don't include native or synchronized. @@ -131,18 +232,24 @@ public abstract class AbstractMemberWriter { return type; } - protected void printModifiers(MemberDoc member) { + /** + * Add the modifier for the member. + * + * @param member the member for which teh modifier will be added. + * @param htmltree the content tree to which the modifier information will be added. + */ + protected void addModifiers(MemberDoc member, Content htmltree) { String mod = modifierString(member); // According to JLS, we should not be showing public modifier for // interface methods. if ((member.isField() || member.isMethod()) && writer instanceof ClassWriterImpl && - ((ClassWriterImpl) writer).getClassDoc().isInterface()) { + ((ClassWriterImpl) writer).getClassDoc().isInterface()) { mod = Util.replaceText(mod, "public", "").trim(); } if(mod.length() > 0) { - print(mod); - print(' '); + htmltree.addContent(mod); + htmltree.addContent(writer.getSpace()); } } @@ -158,66 +265,43 @@ public abstract class AbstractMemberWriter { } /** - * Print 'static' if static and type link. - */ - protected void printStaticAndType(boolean isStatic, Type type) { - writer.printTypeSummaryHeader(); - if (isStatic) { - print("static"); - } - writer.space(); - if (type != null) { - writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, - type)); - } - writer.printTypeSummaryFooter(); - } - - /** - * Print the modifier and type for the member in the member summary. + * Add the modifier and type for the member in the member summary. * - * @param member the member to print the type for. - * @param type the type to print. + * @param member the member to add the type for + * @param type the type to add + * @param tdSummaryType the content tree to which the modified and type will be added */ - protected void printModifierAndType(ProgramElementDoc member, Type type) { - writer.printTypeSummaryHeader(); - printModifier(member); + protected void addModifierAndType(ProgramElementDoc member, Type type, + Content tdSummaryType) { + HtmlTree code = new HtmlTree(HtmlTag.CODE); + addModifier(member, code); if (type == null) { - writer.space(); if (member.isClass()) { - print("class"); + code.addContent("class"); } else { - print("interface"); + code.addContent("interface"); } + code.addContent(writer.getSpace()); } else { if (member instanceof ExecutableMemberDoc && ((ExecutableMemberDoc) member).typeParameters().length > 0) { //Code to avoid ugly wrapping in member summary table. - writer.table(0,0,0); - writer.trAlignVAlign("right", ""); - writer.tdNowrap(); - writer.font("-1"); - writer.code(); - int displayLength = ((AbstractExecutableMemberWriter) this). - writeTypeParameters((ExecutableMemberDoc) member); + int displayLength = ((AbstractExecutableMemberWriter) this).addTypeParameters( + (ExecutableMemberDoc) member, code); if (displayLength > 10) { - writer.br(); + code.addContent(new HtmlTree(HtmlTag.BR)); } - writer.printLink(new LinkInfoImpl( - LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type)); - writer.codeEnd(); - writer.fontEnd(); - writer.tdEnd(); - writer.trEnd(); - writer.tableEnd(); + code.addContent(new RawHtml( + writer.getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type)))); } else { - writer.space(); - writer.printLink(new LinkInfoImpl( - LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type)); + code.addContent(new RawHtml( + writer.getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type)))); } } - writer.printTypeSummaryFooter(); + tdSummaryType.addContent(code); } private void printModifier(ProgramElementDoc member) { @@ -238,25 +322,53 @@ public abstract class AbstractMemberWriter { } /** - * Print the deprecated output for the given member. + * Add the modifier for the member. * - * @param member the member being documented. + * @param member the member to add the type for + * @param code the content tree to which the modified will be added */ - protected void printDeprecated(ProgramElementDoc member) { - String output = (new DeprecatedTaglet()).getTagletOutput(member, - writer.getTagletWriterInstance(false)).toString().trim(); - if (!output.isEmpty()) { - writer.printMemberDetailsListStartTag(); - writer.print(output); + private void addModifier(ProgramElementDoc member, Content code) { + if (member.isProtected()) { + code.addContent("protected "); + } else if (member.isPrivate()) { + code.addContent("private "); + } else if (!member.isPublic()) { // Package private + code.addContent(configuration().getText("doclet.Package_private")); + code.addContent(" "); + } + if (member.isMethod() && ((MethodDoc)member).isAbstract()) { + code.addContent("abstract "); + } + if (member.isStatic()) { + code.addContent("static "); } } - protected void printComment(ProgramElementDoc member) { + /** + * Add the deprecated information for the given member. + * + * @param member the member being documented. + * @param contentTree the content tree to which the deprecated information will be added. + */ + protected void addDeprecatedInfo(ProgramElementDoc member, Content contentTree) { + String output = (new DeprecatedTaglet()).getTagletOutput(member, + writer.getTagletWriterInstance(false)).toString().trim(); + if (!output.isEmpty()) { + Content deprecatedContent = new RawHtml(output); + Content div = HtmlTree.DIV(HtmlStyle.block, deprecatedContent); + contentTree.addContent(div); + } + } + + /** + * Add the comment for the given member. + * + * @param member the member being documented. + * @param contentTree the content tree to which the comment will be added. + */ + protected void addComment(ProgramElementDoc member, Content htmltree) { if (member.inlineTags().length > 0) { - writer.printMemberDetailsListStartTag(); - writer.dd(); - writer.printInlineComment(member); - writer.ddEnd(); + writer.addInlineComment(member, htmltree); } } @@ -264,67 +376,19 @@ public abstract class AbstractMemberWriter { return member.name(); } - protected void printHead(MemberDoc member) { - writer.h3(); - writer.print(member.name()); - writer.h3End(); - } - - protected void printFullComment(ProgramElementDoc member) { - if(configuration().nocomment){ - return; - } - writer.dl(); - print(((TagletOutputImpl) - (new DeprecatedTaglet()).getTagletOutput(member, - writer.getTagletWriterInstance(false))).toString()); - printCommentAndTags(member); - writer.dlEnd(); - } - - protected void printCommentAndTags(ProgramElementDoc member) { - printComment(member); - writer.printTags(member); + /** + * Get the header for the section. + * + * @param member the member being documented. + * @return a header content for the section. + */ + protected Content getHead(MemberDoc member) { + Content memberContent = new RawHtml(member.name()); + Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, memberContent); + return heading; } /** - * Write the member footer. - */ - protected void printMemberFooter() { - writer.printMemberDetailsListEndTag(); - assert !writer.getMemberDetailsListPrinted(); - } - - /** - * Forward to containing writer - */ - public void printSummaryHeader(ClassDoc cd) { - printedSummaryHeader = true; - writer.printSummaryHeader(this, cd); - } - - /** - * Forward to containing writer - */ - public void printInheritedSummaryHeader(ClassDoc cd) { - writer.printInheritedSummaryHeader(this, cd); - } - - /** - * Forward to containing writer - */ - public void printInheritedSummaryFooter(ClassDoc cd) { - writer.printInheritedSummaryFooter(this, cd); - } - - /** - * Forward to containing writer - */ - public void printSummaryFooter(ClassDoc cd) { - writer.printSummaryFooter(this, cd); - } - - /** * Return true if the given ProgramElement is inherited * by the class that is being documented. * @@ -340,102 +404,134 @@ public abstract class AbstractMemberWriter { return true; } - /** - * Generate the code for listing the deprecated APIs. Create the table - * format for listing the API. Call methods from the sub-class to complete - * the generation. + * Add deprecated information to the documentation tree + * + * @param deprmembers list of deprecated members + * @param headingKey the caption for the deprecated members table + * @param tableSummary the summary for the deprecated members table + * @param tableHeader table headers for the deprecated members table + * @param contentTree the content tree to which the deprecated members table will be added */ - protected void printDeprecatedAPI(List deprmembers, String headingKey, String tableSummary, String[] tableHeader) { + protected void addDeprecatedAPI(List deprmembers, String headingKey, + String tableSummary, String[] tableHeader, Content contentTree) { if (deprmembers.size() > 0) { - writer.tableIndexSummary(tableSummary); - writer.tableCaptionStart(); - writer.printText(headingKey); - writer.tableCaptionEnd(); - writer.summaryTableHeader(tableHeader, "col"); + Content table = HtmlTree.TABLE(0, 3, 0, tableSummary, + writer.getTableCaption(configuration().getText(headingKey))); + table.addContent(writer.getSummaryTableHeader(tableHeader, "col")); + Content tbody = new HtmlTree(HtmlTag.TBODY); for (int i = 0; i < deprmembers.size(); i++) { ProgramElementDoc member =(ProgramElementDoc)deprmembers.get(i); - writer.trBgcolorStyle("white", "TableRowColor"); - writer.summaryRow(0); - writeDeprecatedLink(member); - writer.br(); - writer.printNbsps(); + HtmlTree td = HtmlTree.TD(HtmlStyle.colOne, getDeprecatedLink(member)); if (member.tags("deprecated").length > 0) - writer.printInlineDeprecatedComment(member, member.tags("deprecated")[0]); - writer.space(); - writer.summaryRowEnd(); - writer.trEnd(); + writer.addInlineDeprecatedComment(member, + member.tags("deprecated")[0], td); + HtmlTree tr = HtmlTree.TR(td); + if (i%2 == 0) + tr.addStyle(HtmlStyle.altColor); + else + tr.addStyle(HtmlStyle.rowColor); + tbody.addContent(tr); } - writer.tableEnd(); - writer.space(); - writer.p(); + table.addContent(tbody); + Content li = HtmlTree.LI(HtmlStyle.blockList, table); + Content ul = HtmlTree.UL(HtmlStyle.blockList, li); + contentTree.addContent(ul); } } /** - * Print use info. + * Add use information to the documentation tree. + * + * @param mems list of program elements for which the use information will be added + * @param heading the section heading + * @param tableSummary the summary for the use table + * @param contentTree the content tree to which the use information will be added */ - protected void printUseInfo(List mems, String heading, String tableSummary) { + protected void addUseInfo(List mems, + String heading, String tableSummary, Content contentTree) { if (mems == null) { return; } List members = mems; boolean printedUseTableHeader = false; if (members.size() > 0) { - writer.tableIndexSummary(tableSummary); - writer.tableSubCaptionStart(); - writer.print(heading); - writer.tableCaptionEnd(); - for (Iterator it = members.iterator(); it.hasNext(); ) { + Content table = HtmlTree.TABLE(0, 3, 0, tableSummary, + writer.getTableCaption(heading)); + Content tbody = new HtmlTree(HtmlTag.TBODY); + Iterator it = members.iterator(); + for (int i = 0; it.hasNext(); i++) { ProgramElementDoc pgmdoc = it.next(); ClassDoc cd = pgmdoc.containingClass(); if (!printedUseTableHeader) { - // Passing ProgramElementDoc helps decides printing - // interface or class header in case of nested classes. - this.printSummaryTableHeader(pgmdoc); + table.addContent(writer.getSummaryTableHeader( + this.getSummaryTableHeader(pgmdoc), "col")); printedUseTableHeader = true; } - - writer.printSummaryLinkType(this, pgmdoc); + HtmlTree tr = new HtmlTree(HtmlTag.TR); + if (i % 2 == 0) { + tr.addStyle(HtmlStyle.altColor); + } else { + tr.addStyle(HtmlStyle.rowColor); + } + HtmlTree tdFirst = new HtmlTree(HtmlTag.TD); + tdFirst.addStyle(HtmlStyle.colFirst); + writer.addSummaryType(this, pgmdoc, tdFirst); + tr.addContent(tdFirst); + HtmlTree tdLast = new HtmlTree(HtmlTag.TD); + tdLast.addStyle(HtmlStyle.colLast); if (cd != null && !(pgmdoc instanceof ConstructorDoc) - && !(pgmdoc instanceof ClassDoc)) { - // Add class context - writer.strong(cd.name() + "."); + && !(pgmdoc instanceof ClassDoc)) { + HtmlTree name = new HtmlTree(HtmlTag.SPAN); + name.addStyle(HtmlStyle.strong); + name.addContent(cd.name() + "."); + tdLast.addContent(name); } - writeSummaryLink( - pgmdoc instanceof ClassDoc ? - LinkInfoImpl.CONTEXT_CLASS_USE : LinkInfoImpl.CONTEXT_MEMBER, - cd, pgmdoc); - writer.printSummaryLinkComment(this, pgmdoc); + addSummaryLink(pgmdoc instanceof ClassDoc ? + LinkInfoImpl.CONTEXT_CLASS_USE : LinkInfoImpl.CONTEXT_MEMBER, + cd, pgmdoc, tdLast); + writer.addSummaryLinkComment(this, pgmdoc, tdLast); + tr.addContent(tdLast); + tbody.addContent(tr); } - writer.tableEnd(); - writer.space(); - writer.p(); + table.addContent(tbody); + contentTree.addContent(table); } } - protected void navDetailLink(List members) { - printNavDetailLink(members.size() > 0? true: false); + /** + * Add the navigation detail link. + * + * @param members the members to be linked + * @param liNav the content tree to which the navigation detail link will be added + */ + protected void addNavDetailLink(List members, Content liNav) { + addNavDetailLink(members.size() > 0 ? true : false, liNav); } - - protected void navSummaryLink(List members, - VisibleMemberMap visibleMemberMap) { + /** + * Add the navigation summary link. + * + * @param members members to be linked + * @param visibleMemberMap the visible inherited members map + * @param liNav the content tree to which the navigation summary link will be added + */ + protected void addNavSummaryLink(List members, + VisibleMemberMap visibleMemberMap, Content liNav) { if (members.size() > 0) { - printNavSummaryLink(null, true); + liNav.addContent(getNavSummaryLink(null, true)); return; - } else { - ClassDoc icd = classdoc.superclass(); - while (icd != null) { - List inhmembers = visibleMemberMap.getMembersFor(icd); - if (inhmembers.size() > 0) { - printNavSummaryLink(icd, true); - return; - } - icd = icd.superclass(); - } } - printNavSummaryLink(null, false); + ClassDoc icd = classdoc.superclass(); + while (icd != null) { + List inhmembers = visibleMemberMap.getMembersFor(icd); + if (inhmembers.size() > 0) { + liNav.addContent(getNavSummaryLink(icd, true)); + return; + } + icd = icd.superclass(); + } + liNav.addContent(getNavSummaryLink(null, false)); } protected void serialWarning(SourcePosition pos, String key, String a1, String a2) { @@ -453,12 +549,109 @@ public abstract class AbstractMemberWriter { } /** - * {@inheritDoc} + * Add the member summary for the given class. + * + * @param classDoc the class that is being documented + * @param member the member being documented + * @param firstSentenceTags the first sentence tags to be added to the summary + * @param tableTree the content tree to which the documentation will be added + * @param counter the counter for determing style for the table row */ - public void writeMemberSummary(ClassDoc classDoc, ProgramElementDoc member, - Tag[] firstSentenceTags, boolean isFirst, boolean isLast) { - writer.printSummaryLinkType(this, member); - writeSummaryLink(classDoc, member); - writer.printSummaryLinkComment(this, member, firstSentenceTags); + public void addMemberSummary(ClassDoc classDoc, ProgramElementDoc member, + Tag[] firstSentenceTags, Content tableTree, int counter) { + HtmlTree tdSummaryType = new HtmlTree(HtmlTag.TD); + tdSummaryType.addStyle(HtmlStyle.colFirst); + writer.addSummaryType(this, member, tdSummaryType); + HtmlTree tdSummary = new HtmlTree(HtmlTag.TD); + setSummaryColumnStyle(tdSummary); + addSummaryLink(classDoc, member, tdSummary); + writer.addSummaryLinkComment(this, member, firstSentenceTags, tdSummary); + HtmlTree tr = HtmlTree.TR(tdSummaryType); + tr.addContent(tdSummary); + if (counter%2 == 0) + tr.addStyle(HtmlStyle.altColor); + else + tr.addStyle(HtmlStyle.rowColor); + tableTree.addContent(tr); + } + + /** + * Set the style for the summary column. + * + * @param tdTree the column for which the style will be set + */ + public void setSummaryColumnStyle(HtmlTree tdTree) { + tdTree.addStyle(HtmlStyle.colLast); + } + + /** + * Add inherited member summary for the given class and member. + * + * @param classDoc the class the inherited member belongs to + * @param nestedClass the inherited member that is summarized + * @param isFirst true if this is the first member in the list + * @param isLast true if this is the last member in the list + * @param linksTree the content tree to which the summary will be added + */ + public void addInheritedMemberSummary(ClassDoc classDoc, + ProgramElementDoc nestedClass, boolean isFirst, boolean isLast, + Content linksTree) { + writer.addInheritedMemberSummary(this, classDoc, nestedClass, isFirst, + linksTree); + } + + /** + * Get the inherited summary header for the given class. + * + * @param classDoc the class the inherited member belongs to + * @return a content tree for the inherited summary header + */ + public Content getInheritedSummaryHeader(ClassDoc classDoc) { + Content inheritedTree = writer.getMemberTreeHeader(); + writer.addInheritedSummaryHeader(this, classDoc, inheritedTree); + return inheritedTree; + } + + /** + * Get the inherited summary links tree. + * + * @return a content tree for the inherited summary links + */ + public Content getInheritedSummaryLinksTree() { + return new HtmlTree(HtmlTag.CODE); + } + + /** + * Get the summary table tree for the given class. + * + * @param classDoc the class for which the summary table is generated + * @return a content tree for the summary table + */ + public Content getSummaryTableTree(ClassDoc classDoc) { + return writer.getSummaryTableTree(this, classDoc); + } + + /** + * Get the member tree to be documented. + * + * @param memberTree the content tree of member to be documented + * @return a content tree that will be added to the class documentation + */ + public Content getMemberTree(Content memberTree) { + return writer.getMemberTree(memberTree); + } + + /** + * Get the member tree to be documented. + * + * @param memberTree the content tree of member to be documented + * @param isLastContent true if the content to be added is the last content + * @return a content tree that will be added to the class documentation + */ + public Content getMemberTree(Content memberTree, boolean isLastContent) { + if (isLastContent) + return HtmlTree.UL(HtmlStyle.blockListLast, memberTree); + else + return HtmlTree.UL(HtmlStyle.blockList, memberTree); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java index 2daa107c635..ef407dfb206 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +25,11 @@ package com.sun.tools.doclets.formats.html; -import com.sun.javadoc.*; import java.io.*; import java.util.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.formats.html.markup.*; +import com.sun.tools.doclets.internal.toolkit.*; /** * Abstract class to generate the overview files in @@ -56,105 +58,127 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter { packages = configuration.packages; } - protected abstract void printNavigationBarHeader(); - - protected abstract void printNavigationBarFooter(); - - protected abstract void printOverviewHeader(); - - protected abstract void printIndexHeader(String text, String tableSummary); - - protected abstract void printIndexRow(PackageDoc pkg); - - protected abstract void printIndexFooter(); + /** + * Adds the navigation bar header to the documentation tree. + * + * @param body the document tree to which the navigation bar header will be added + */ + protected abstract void addNavigationBarHeader(Content body); /** - * Generate the contants in the package index file. Call appropriate + * Adds the navigation bar footer to the documentation tree. + * + * @param body the document tree to which the navigation bar footer will be added + */ + protected abstract void addNavigationBarFooter(Content body); + + /** + * Adds the overview header to the documentation tree. + * + * @param body the document tree to which the overview header will be added + */ + protected abstract void addOverviewHeader(Content body); + + /** + * Adds the packages list to the documentation tree. + * + * @param packages an array of packagedoc objects + * @param text caption for the table + * @param tableSummary summary for the table + * @param body the document tree to which the packages list will be added + */ + protected abstract void addPackagesList(PackageDoc[] packages, String text, + String tableSummary, Content body); + + /** + * Generate and prints the contents in the package index file. Call appropriate * methods from the sub-class in order to generate Frame or Non * Frame format. + * * @param title the title of the window. * @param includeScript boolean set true if windowtitle script is to be included */ - protected void generatePackageIndexFile(String title, boolean includeScript) throws IOException { + protected void buildPackageIndexFile(String title, boolean includeScript) throws IOException { String windowOverview = configuration.getText(title); - printHtmlHeader(windowOverview, - configuration.metakeywords.getOverviewMetaKeywords(title, - configuration.doctitle), - includeScript); - printNavigationBarHeader(); - printOverviewHeader(); - - generateIndex(); - - printOverview(); - - printNavigationBarFooter(); - printBodyHtmlEnd(); + Content body = getBody(includeScript, getWindowTitle(windowOverview)); + addNavigationBarHeader(body); + addOverviewHeader(body); + addIndex(body); + addOverview(body); + addNavigationBarFooter(body); + printHtmlDocument(configuration.metakeywords.getOverviewMetaKeywords(title, + configuration.doctitle), includeScript, body); } /** - * Default to no overview, overwrite to add overview. + * Default to no overview, override to add overview. + * + * @param body the document tree to which the overview will be added */ - protected void printOverview() throws IOException { + protected void addOverview(Content body) throws IOException { } /** - * Generate the frame or non-frame package index. + * Adds the frame or non-frame package index to the documentation tree. + * + * @param body the document tree to which the index will be added */ - protected void generateIndex() { - printIndexContents(packages, "doclet.Package_Summary", + protected void addIndex(Content body) { + addIndexContents(packages, "doclet.Package_Summary", configuration.getText("doclet.Member_Table_Summary", configuration.getText("doclet.Package_Summary"), - configuration.getText("doclet.packages"))); + configuration.getText("doclet.packages")), body); } /** - * Generate code for package index contents. Call appropriate methods from - * the sub-classes. + * Adds package index contents. Call appropriate methods from + * the sub-classes. Adds it to the body HtmlTree * - * @param packages Array of packages to be documented. - * @param text String which will be used as the heading. + * @param packages array of packages to be documented + * @param text string which will be used as the heading + * @param tableSummary summary for the table + * @param body the document tree to which the index contents will be added */ - protected void printIndexContents(PackageDoc[] packages, String text, String tableSummary) { + protected void addIndexContents(PackageDoc[] packages, String text, + String tableSummary, Content body) { if (packages.length > 0) { Arrays.sort(packages); - printIndexHeader(text, tableSummary); - printAllClassesPackagesLink(); - for(int i = 0; i < packages.length; i++) { - if (packages[i] != null) { - printIndexRow(packages[i]); - } - } - printIndexFooter(); + addAllClassesLink(body); + addPackagesList(packages, text, tableSummary, body); } } /** - * Print the doctitle, if it is specified on the command line. + * Adds the doctitle to the documentation tree, if it is specified on the command line. + * + * @param body the document tree to which the title will be added */ - protected void printConfigurationTitle() { + protected void addConfigurationTitle(Content body) { if (configuration.doctitle.length() > 0) { - center(); - h1(configuration.doctitle); - centerEnd(); + Content title = new RawHtml(configuration.doctitle); + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, + HtmlStyle.title, title); + Content div = HtmlTree.DIV(HtmlStyle.header, heading); + body.addContent(div); } } /** - * Highlight "Overview" in the strong format, in the navigation bar as this - * is the overview page. + * Returns highlighted "Overview", in the navigation bar as this is the + * overview page. + * + * @return a Content object to be added to the documentation tree */ - protected void navLinkContents() { - navCellRevStart(); - fontStyle("NavBarFont1Rev"); - strongText("doclet.Overview"); - fontEnd(); - navCellEnd(); + protected Content getNavLinkContents() { + Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, overviewLabel); + return li; } /** * Do nothing. This will be overridden in PackageIndexFrameWriter. + * + * @param body the document tree to which the all classes link will be added */ - protected void printAllClassesPackagesLink() { + protected void addAllClassesLink(Content body) { } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java index 5c6fc40e783..2b1b352942c 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +25,12 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.util.*; - -import com.sun.javadoc.*; import java.io.*; import java.util.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.formats.html.markup.*; +import com.sun.javadoc.*; /** * Abstract class to print the class hierarchy page for all the Classes. This @@ -46,6 +47,8 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter { */ protected final ClassTree classtree; + private static final String LI_CIRCLE = "circle"; + /** * Constructor initilises classtree variable. This constructor will be used * while generating global tree file "overview-tree.html". @@ -87,55 +90,64 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter { } /** - * Generate each level of the class tree. For each sub-class or + * Add each level of the class tree. For each sub-class or * sub-interface indents the next level information. - * Recurses itself to generate subclasses info. - * To iterate is human, to recurse is divine - L. Peter Deutsch. + * Recurses itself to add subclasses info. * - * @param parent the superclass or superinterface of the list. - * @param list list of the sub-classes at this level. - * @param isEnum true if we are generating a tree for enums. + * @param parent the superclass or superinterface of the list + * @param list list of the sub-classes at this level + * @param isEnum true if we are generating a tree for enums + * @param contentTree the content tree to which the level information will be added */ - protected void generateLevelInfo(ClassDoc parent, List list, - boolean isEnum) { - if (list.size() > 0) { - ul(); - for (int i = 0; i < list.size(); i++) { + protected void addLevelInfo(ClassDoc parent, List list, + boolean isEnum, Content contentTree) { + int size = list.size(); + if (size > 0) { + Content ul = new HtmlTree(HtmlTag.UL); + for (int i = 0; i < size; i++) { ClassDoc local = list.get(i); - printPartialInfo(local); - printExtendsImplements(parent, local); - generateLevelInfo(local, classtree.subs(local, isEnum), - isEnum); // Recurse + HtmlTree li = new HtmlTree(HtmlTag.LI); + li.addAttr(HtmlAttr.TYPE, LI_CIRCLE); + addPartialInfo(local, li); + addExtendsImplements(parent, local, li); + addLevelInfo(local, classtree.subs(local, isEnum), + isEnum, li); // Recurse + ul.addContent(li); } - ulEnd(); + contentTree.addContent(ul); } } /** - * Generate the heading for the tree depending upon tree type if it's a - * Class Tree or Interface tree and also print the tree. + * Add the heading for the tree depending upon tree type if it's a + * Class Tree or Interface tree. * * @param list List of classes which are at the most base level, all the - * other classes in this run will derive from these classes. - * @param heading Heading for the tree. + * other classes in this run will derive from these classes + * @param heading heading for the tree + * @param div the content tree to which the tree will be added */ - protected void generateTree(List list, String heading) { + protected void addTree(List list, String heading, Content div) { if (list.size() > 0) { ClassDoc firstClassDoc = list.get(0); - printTreeHeading(heading); - generateLevelInfo(!firstClassDoc.isInterface()? firstClassDoc : null, - list, - list == classtree.baseEnums()); + Content headingContent = getResource(heading); + div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true, + headingContent)); + addLevelInfo(!firstClassDoc.isInterface()? firstClassDoc : null, + list, list == classtree.baseEnums(), div); } } /** - * Print the information regarding the classes which this class extends or + * Add information regarding the classes which this class extends or * implements. * - * @param cd The classdoc under consideration. + * @param parent the parent class of the class being documented + * @param cd the classdoc under consideration + * @param contentTree the content tree to which the information will be added */ - protected void printExtendsImplements(ClassDoc parent, ClassDoc cd) { + protected void addExtendsImplements(ClassDoc parent, ClassDoc cd, + Content contentTree) { ClassDoc[] interfaces = cd.interfaces(); if (interfaces.length > (cd.isInterface()? 1 : 0)) { Arrays.sort(interfaces); @@ -148,53 +160,43 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter { } if (counter == 0) { if (cd.isInterface()) { - print(" (" + configuration.getText("doclet.also") + " extends "); + contentTree.addContent(" ("); + contentTree.addContent(getResource("doclet.also")); + contentTree.addContent(" extends "); } else { - print(" (implements "); + contentTree.addContent(" (implements "); } } else { - print(", "); + contentTree.addContent(", "); } - printPreQualifiedClassLink(LinkInfoImpl.CONTEXT_TREE, - interfaces[i]); + addPreQualifiedClassLink(LinkInfoImpl.CONTEXT_TREE, + interfaces[i], contentTree); counter++; } } if (counter > 0) { - println(")"); + contentTree.addContent(")"); } } } /** - * Print information about the class kind, if it's a "class" or "interface". + * Add information about the class kind, if it's a "class" or "interface". * - * @param cd classdoc. + * @param cd the class being documented + * @param contentTree the content tree to which the information will be added */ - protected void printPartialInfo(ClassDoc cd) { - li("circle"); - printPreQualifiedStrongClassLink(LinkInfoImpl.CONTEXT_TREE, cd); + protected void addPartialInfo(ClassDoc cd, Content contentTree) { + addPreQualifiedStrongClassLink(LinkInfoImpl.CONTEXT_TREE, cd, contentTree); } /** - * Print the heading for the tree. + * Get the tree label for the navigation bar. * - * @param heading Heading for the tree. + * @return a content tree for the tree label */ - protected void printTreeHeading(String heading) { - h2(); - println(configuration.getText(heading)); - h2End(); - } - - /** - * Highlight "Tree" word in the navigation bar, since this is the tree page. - */ - protected void navLinkTree() { - navCellRevStart(); - fontStyle("NavBarFont1Rev"); - strongText("doclet.Tree"); - fontEnd(); - navCellEnd(); + protected Content getNavLinkTree() { + Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, treeLabel); + return li; } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java index b62ec040b68..b68af0445cc 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +25,14 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.javadoc.*; import java.io.*; import java.util.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; + /** * Generate the file with list of all the classes in this run. This page will be * used in the left-hand bottom frame, when "All Classes" link is clicked in @@ -38,6 +41,7 @@ import java.util.*; * * @author Atul M Dambalkar * @author Doug Kramer + * @author Bhavesh Patel (Modified) */ public class AllClassesFrameWriter extends HtmlDocletWriter { @@ -56,6 +60,11 @@ public class AllClassesFrameWriter extends HtmlDocletWriter { */ protected IndexBuilder indexbuilder; + /** + * BR tag to be used within a document tree. + */ + final HtmlTree BR = new HtmlTree(HtmlTag.BR); + /** * Construct AllClassesFrameWriter object. Also initilises the indexbuilder * variable in this class. @@ -84,12 +93,12 @@ public class AllClassesFrameWriter extends HtmlDocletWriter { try { allclassgen = new AllClassesFrameWriter(configuration, filename, indexbuilder); - allclassgen.generateAllClassesFile(true); + allclassgen.buildAllClassesFile(true); allclassgen.close(); filename = OUTPUT_FILE_NAME_NOFRAMES; allclassgen = new AllClassesFrameWriter(configuration, filename, indexbuilder); - allclassgen.generateAllClassesFile(false); + allclassgen.buildAllClassesFile(false); allclassgen.close(); } catch (IOException exc) { configuration.standardmessage. @@ -100,30 +109,34 @@ public class AllClassesFrameWriter extends HtmlDocletWriter { } /** - * Print all the classes in table format in the file. + * Print all the classes in the file. * @param wantFrames True if we want frames. */ - protected void generateAllClassesFile(boolean wantFrames) throws IOException { + protected void buildAllClassesFile(boolean wantFrames) throws IOException { String label = configuration.getText("doclet.All_Classes"); - - printHtmlHeader(label, null, false); - - printAllClassesTableHeader(); - printAllClasses(wantFrames); - printAllClassesTableFooter(); - - printBodyHtmlEnd(); + Content body = getBody(false, getWindowTitle(label)); + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, + HtmlStyle.bar, allclassesLabel); + body.addContent(heading); + Content ul = new HtmlTree(HtmlTag.UL); + // Generate the class links and add it to the tdFont tree. + addAllClasses(ul, wantFrames); + Content div = HtmlTree.DIV(HtmlStyle.indexContainer, ul); + body.addContent(div); + printHtmlDocument(null, false, body); } /** - * Use the sorted index of all the classes and print all the classes. + * Use the sorted index of all the classes and add all the classes to the + * content list. * + * @param content HtmlTree content to which all classes information will be added * @param wantFrames True if we want frames. */ - protected void printAllClasses(boolean wantFrames) { + protected void addAllClasses(Content content, boolean wantFrames) { for (int i = 0; i < indexbuilder.elements().length; i++) { Character unicode = (Character)((indexbuilder.elements())[i]); - generateContents(indexbuilder.getMemberList(unicode), wantFrames); + addContents(indexbuilder.getMemberList(unicode), wantFrames, content); } } @@ -136,46 +149,25 @@ public class AllClassesFrameWriter extends HtmlDocletWriter { * * @param classlist Sorted list of classes. * @param wantFrames True if we want frames. + * @param content HtmlTree content to which the links will be added */ - protected void generateContents(List classlist, boolean wantFrames) { + protected void addContents(List classlist, boolean wantFrames, + Content content) { for (int i = 0; i < classlist.size(); i++) { ClassDoc cd = (ClassDoc)classlist.get(i); if (!Util.isCoreClass(cd)) { continue; } String label = italicsClassName(cd, false); + Content linkContent; if(wantFrames){ - printLink(new LinkInfoImpl(LinkInfoImpl.ALL_CLASSES_FRAME, cd, - label, "classFrame") - ); + linkContent = new RawHtml(getLink(new LinkInfoImpl( + LinkInfoImpl.ALL_CLASSES_FRAME, cd, label, "classFrame"))); } else { - printLink(new LinkInfoImpl(cd, label)); + linkContent = new RawHtml(getLink(new LinkInfoImpl(cd, label))); } - br(); + Content li = HtmlTree.LI(linkContent); + content.addContent(li); } } - - /** - * Print the heading "All Classes" and also print Html table tag. - */ - protected void printAllClassesTableHeader() { - fontSizeStyle("+1", "FrameHeadingFont"); - strongText("doclet.All_Classes"); - fontEnd(); - br(); - table(); - tr(); - tdNowrap(); - fontStyle("FrameItemFont"); - } - - /** - * Print Html closing table tag. - */ - protected void printAllClassesTableFooter() { - fontEnd(); - tdEnd(); - trEnd(); - tableEnd(); - } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java index adc09a98734..77f23279071 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ package com.sun.tools.doclets.formats.html; import java.io.*; import com.sun.javadoc.*; +import com.sun.tools.doclets.formats.html.markup.*; import com.sun.tools.doclets.internal.toolkit.*; /** @@ -54,29 +55,26 @@ public class AnnotationTypeOptionalMemberWriterImpl extends /** * {@inheritDoc} */ - public void writeMemberSummaryHeader(ClassDoc classDoc) { - writer.println(""); - writer.println(); - writer.printSummaryHeader(this, classDoc); + public Content getMemberSummaryHeader(ClassDoc classDoc, + Content memberSummaryTree) { + memberSummaryTree.addContent( + HtmlConstants.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY); + Content memberTree = writer.getMemberTreeHeader(); + writer.addSummaryHeader(this, classDoc, memberTree); + return memberTree; } /** * {@inheritDoc} */ - public void writeDefaultValueInfo(MemberDoc member) { + public void addDefaultValueInfo(MemberDoc member, Content annotationDocTree) { if (((AnnotationTypeElementDoc) member).defaultValue() != null) { - writer.printMemberDetailsListStartTag(); - writer.dd(); - writer.dl(); - writer.dt(); - writer.strong(ConfigurationImpl.getInstance(). - getText("doclet.Default")); - writer.dtEnd(); - writer.dd(); - writer.print(((AnnotationTypeElementDoc) member).defaultValue()); - writer.ddEnd(); - writer.dlEnd(); - writer.ddEnd(); + Content dt = HtmlTree.DT(writer.getResource("doclet.Default")); + Content dl = HtmlTree.DL(dt); + Content dd = HtmlTree.DD(new StringContent( + ((AnnotationTypeElementDoc) member).defaultValue().toString())); + dl.addContent(dd); + annotationDocTree.addContent(dl); } } @@ -90,45 +88,58 @@ public class AnnotationTypeOptionalMemberWriterImpl extends /** * {@inheritDoc} */ - public void printSummaryLabel() { - writer.printText("doclet.Annotation_Type_Optional_Member_Summary"); + public void addSummaryLabel(Content memberTree) { + Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, + writer.getResource("doclet.Annotation_Type_Optional_Member_Summary")); + memberTree.addContent(label); } /** * {@inheritDoc} */ - public void printTableSummary() { - writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary", + public String getTableSummary() { + return configuration().getText("doclet.Member_Table_Summary", configuration().getText("doclet.Annotation_Type_Optional_Member_Summary"), - configuration().getText("doclet.annotation_type_optional_members"))); + configuration().getText("doclet.annotation_type_optional_members")); } - public void printSummaryTableHeader(ProgramElementDoc member) { + /** + * {@inheritDoc} + */ + public String getCaption() { + return configuration().getText("doclet.Annotation_Type_Optional_Members"); + } + + /** + * {@inheritDoc} + */ + public String[] getSummaryTableHeader(ProgramElementDoc member) { String[] header = new String[] { writer.getModifierTypeHeader(), configuration().getText("doclet.0_and_1", configuration().getText("doclet.Annotation_Type_Optional_Member"), configuration().getText("doclet.Description")) }; - writer.summaryTableHeader(header, "col"); + return header; } /** * {@inheritDoc} */ - public void printSummaryAnchor(ClassDoc cd) { - writer.anchor("annotation_type_optional_element_summary"); + public void addSummaryAnchor(ClassDoc cd, Content memberTree) { + memberTree.addContent(writer.getMarkerAnchor( + "annotation_type_optional_element_summary")); } /** * {@inheritDoc} */ - protected void printNavSummaryLink(ClassDoc cd, boolean link) { + protected Content getNavSummaryLink(ClassDoc cd, boolean link) { if (link) { - writer.printHyperLink("", "annotation_type_optional_element_summary", - configuration().getText("doclet.navAnnotationTypeOptionalMember")); + return writer.getHyperLink("", "annotation_type_optional_element_summary", + writer.getResource("doclet.navAnnotationTypeOptionalMember")); } else { - writer.printText("doclet.navAnnotationTypeOptionalMember"); + return writer.getResource("doclet.navAnnotationTypeOptionalMember"); } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java index ccfb05d90e8..f2418e5143d 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ package com.sun.tools.doclets.formats.html; import java.io.*; import com.sun.javadoc.*; +import com.sun.tools.doclets.formats.html.markup.*; import com.sun.tools.doclets.internal.toolkit.*; /** @@ -51,122 +52,102 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter } /** - * Write the annotation type member summary header for the given class. - * - * @param classDoc the class the summary belongs to. + * {@inheritDoc} */ - public void writeMemberSummaryHeader(ClassDoc classDoc) { - writer.println(""); - writer.println(); - writer.printSummaryHeader(this, classDoc); - } - - /** - * Write the annotation type member summary footer for the given class. - * - * @param classDoc the class the summary belongs to. - */ - public void writeMemberSummaryFooter(ClassDoc classDoc) { - writer.printSummaryFooter(this, classDoc); + public Content getMemberSummaryHeader(ClassDoc classDoc, + Content memberSummaryTree) { + memberSummaryTree.addContent( + HtmlConstants.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY); + Content memberTree = writer.getMemberTreeHeader(); + writer.addSummaryHeader(this, classDoc, memberTree); + return memberTree; } /** * {@inheritDoc} */ - public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) { - //Not appliable. - } - - /** - * {@inheritDoc} - */ - public void writeInheritedMemberSummary(ClassDoc classDoc, - ProgramElementDoc member, boolean isFirst, boolean isLast) { - //Not appliable. - } - - /** - * {@inheritDoc} - */ - public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) { - //Not appliable. - } - - /** - * {@inheritDoc} - */ - public void writeHeader(ClassDoc classDoc, String header) { - writer.println(); - writer.println(""); - writer.println(); - writer.anchor("annotation_type_element_detail"); - writer.printTableHeadingBackground(header); - writer.println(); - } - - /** - * {@inheritDoc} - */ - public void writeMemberHeader(MemberDoc member, boolean isFirst) { - if (! isFirst) { - writer.printMemberHeader(); - writer.println(""); + public void addAnnotationDetailsTreeHeader(ClassDoc classDoc, + Content memberDetailsTree) { + if (!writer.printedAnnotationHeading) { + memberDetailsTree.addContent(writer.getMarkerAnchor( + "annotation_type_element_detail")); + Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, + writer.annotationTypeDetailsLabel); + memberDetailsTree.addContent(heading); + writer.printedAnnotationHeading = true; } - writer.anchor(member.name() + ((ExecutableMemberDoc) member).signature()); - writer.h3(); - writer.print(member.name()); - writer.h3End(); } /** * {@inheritDoc} */ - public void writeSignature(MemberDoc member) { - writer.pre(); - writer.writeAnnotationInfo(member); - printModifiers(member); - writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, - getType(member))); - print(' '); + public Content getAnnotationDocTreeHeader(MemberDoc member, + Content annotationDetailsTree) { + annotationDetailsTree.addContent( + writer.getMarkerAnchor(member.name() + + ((ExecutableMemberDoc) member).signature())); + Content annotationDocTree = writer.getMemberTreeHeader(); + Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); + heading.addContent(member.name()); + annotationDocTree.addContent(heading); + return annotationDocTree; + } + + /** + * {@inheritDoc} + */ + public Content getSignature(MemberDoc member) { + Content pre = new HtmlTree(HtmlTag.PRE); + writer.addAnnotationInfo(member, pre); + addModifiers(member, pre); + Content link = new RawHtml( + writer.getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, + getType(member)))); + pre.addContent(link); + pre.addContent(writer.getSpace()); if (configuration().linksource) { - writer.printSrcLink(member, member.name()); + Content memberName = new StringContent(member.name()); + writer.addSrcLink(member, memberName, pre); } else { - strong(member.name()); + addName(member.name(), pre); } - writer.preEnd(); - assert !writer.getMemberDetailsListPrinted(); + return pre; } /** * {@inheritDoc} */ - public void writeComments(MemberDoc member) { - printComment(member); + public void addDeprecated(MemberDoc member, Content annotationDocTree) { + addDeprecatedInfo(member, annotationDocTree); } /** - * Write the tag output for the given member. - * - * @param member the member being documented. + * {@inheritDoc} */ - public void writeTags(MemberDoc member) { - writer.printTags(member); + public void addComments(MemberDoc member, Content annotationDocTree) { + addComment(member, annotationDocTree); } /** - * Write the annotation type member footer. + * {@inheritDoc} */ - public void writeMemberFooter() { - printMemberFooter(); + public void addTags(MemberDoc member, Content annotationDocTree) { + writer.addTagsInfo(member, annotationDocTree); } /** - * Write the footer for the annotation type member documentation. - * - * @param classDoc the class that the annotation type member belong to. + * {@inheritDoc} */ - public void writeFooter(ClassDoc classDoc) { - //No footer to write for annotation type member documentation + public Content getAnnotationDetails(Content annotationDetailsTree) { + return getMemberTree(annotationDetailsTree); + } + + /** + * {@inheritDoc} + */ + public Content getAnnotationDoc(Content annotationDocTree, + boolean isLastContent) { + return getMemberTree(annotationDocTree, isLastContent); } /** @@ -179,113 +160,120 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter /** * {@inheritDoc} */ - public void printSummaryLabel() { - writer.printText("doclet.Annotation_Type_Required_Member_Summary"); + public void addSummaryLabel(Content memberTree) { + Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, + writer.getResource("doclet.Annotation_Type_Required_Member_Summary")); + memberTree.addContent(label); } /** * {@inheritDoc} */ - public void printTableSummary() { - writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary", + public String getTableSummary() { + return configuration().getText("doclet.Member_Table_Summary", configuration().getText("doclet.Annotation_Type_Required_Member_Summary"), - configuration().getText("doclet.annotation_type_required_members"))); + configuration().getText("doclet.annotation_type_required_members")); } - public void printSummaryTableHeader(ProgramElementDoc member) { + /** + * {@inheritDoc} + */ + public String getCaption() { + return configuration().getText("doclet.Annotation_Type_Required_Members"); + } + + /** + * {@inheritDoc} + */ + public String[] getSummaryTableHeader(ProgramElementDoc member) { String[] header = new String[] { writer.getModifierTypeHeader(), configuration().getText("doclet.0_and_1", configuration().getText("doclet.Annotation_Type_Required_Member"), configuration().getText("doclet.Description")) }; - writer.summaryTableHeader(header, "col"); + return header; } /** * {@inheritDoc} */ - public void printSummaryAnchor(ClassDoc cd) { - writer.anchor("annotation_type_required_element_summary"); + public void addSummaryAnchor(ClassDoc cd, Content memberTree) { + memberTree.addContent(writer.getMarkerAnchor( + "annotation_type_required_element_summary")); } /** * {@inheritDoc} */ - public void printInheritedSummaryAnchor(ClassDoc cd) { - } // no such - - /** - * {@inheritDoc} - */ - public void printInheritedSummaryLabel(ClassDoc cd) { - // no such + public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { } /** * {@inheritDoc} */ - protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) { - writer.strong(); - writer.printDocLink(context, (MemberDoc) member, member.name(), false); - writer.strongEnd(); + public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { } /** * {@inheritDoc} */ - protected void writeInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member) { + protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member, + Content tdSummary) { + Content strong = HtmlTree.STRONG(new RawHtml( + writer.getDocLink(context, (MemberDoc) member, member.name(), false))); + Content code = HtmlTree.CODE(strong); + tdSummary.addContent(code); + } + + /** + * {@inheritDoc} + */ + protected void addInheritedSummaryLink(ClassDoc cd, + ProgramElementDoc member, Content linksTree) { //Not applicable. } /** * {@inheritDoc} */ - protected void printSummaryType(ProgramElementDoc member) { + protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { MemberDoc m = (MemberDoc)member; - printModifierAndType(m, getType(m)); + addModifierAndType(m, getType(m), tdSummaryType); } /** * {@inheritDoc} */ - protected void writeDeprecatedLink(ProgramElementDoc member) { - writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, - (MemberDoc) member, ((MemberDoc)member).qualifiedName(), false); + protected Content getDeprecatedLink(ProgramElementDoc member) { + return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, + (MemberDoc) member, ((MemberDoc)member).qualifiedName()); } /** * {@inheritDoc} */ - protected void printNavSummaryLink(ClassDoc cd, boolean link) { + protected Content getNavSummaryLink(ClassDoc cd, boolean link) { if (link) { - writer.printHyperLink("", "annotation_type_required_element_summary", - configuration().getText("doclet.navAnnotationTypeRequiredMember")); + return writer.getHyperLink("", "annotation_type_required_element_summary", + writer.getResource("doclet.navAnnotationTypeRequiredMember")); } else { - writer.printText("doclet.navAnnotationTypeRequiredMember"); + return writer.getResource("doclet.navAnnotationTypeRequiredMember"); } } /** * {@inheritDoc} */ - protected void printNavDetailLink(boolean link) { + protected void addNavDetailLink(boolean link, Content liNav) { if (link) { - writer.printHyperLink("", "annotation_type_element_detail", - configuration().getText("doclet.navAnnotationTypeMember")); + liNav.addContent(writer.getHyperLink("", "annotation_type_element_detail", + writer.getResource("doclet.navAnnotationTypeMember"))); } else { - writer.printText("doclet.navAnnotationTypeMember"); + liNav.addContent(writer.getResource("doclet.navAnnotationTypeMember")); } } - /** - * {@inheritDoc} - */ - public void writeDeprecated(MemberDoc member) { - printDeprecated(member); - } - private Type getType(MemberDoc member) { if (member instanceof FieldDoc) { return ((FieldDoc) member).type(); diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java index 1393aeb4cec..b555f1e7f7f 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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.javadoc.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.builders.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * Generate the Class Information Page. @@ -40,6 +41,7 @@ import com.sun.tools.doclets.internal.toolkit.builders.*; * * @author Atul M Dambalkar * @author Robert Field + * @author Bhavesh Patel (Modified) */ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter implements AnnotationTypeWriter { @@ -69,126 +71,168 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter } /** - * Print this package link + * Get this package link. + * + * @return a content tree for the package link */ - protected void navLinkPackage() { - navCellStart(); - printHyperLink("package-summary.html", "", - configuration.getText("doclet.Package"), true, "NavBarFont1"); - navCellEnd(); + protected Content getNavLinkPackage() { + Content linkContent = getHyperLink("package-summary.html", "", + packageLabel); + Content li = HtmlTree.LI(linkContent); + return li; } /** - * Print class page indicator + * Get the class link. + * + * @return a content tree for the class link */ - protected void navLinkClass() { - navCellRevStart(); - fontStyle("NavBarFont1Rev"); - strongText("doclet.Class"); - fontEnd(); - navCellEnd(); + protected Content getNavLinkClass() { + Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, classLabel); + return li; } /** - * Print class use link + * Get the class use link. + * + * @return a content tree for the class use link */ - protected void navLinkClassUse() { - navCellStart(); - printHyperLink("class-use/" + filename, "", - configuration.getText("doclet.navClassUse"), true, "NavBarFont1"); - navCellEnd(); + protected Content getNavLinkClassUse() { + Content linkContent = getHyperLink("class-use/" + filename, "", useLabel); + Content li = HtmlTree.LI(linkContent); + return li; } /** - * Print previous package link + * Get link to previous class. + * + * @return a content tree for the previous class link */ - protected void navLinkPrevious() { - if (prev == null) { - printText("doclet.Prev_Class"); - } else { - printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, - prev.asClassDoc(), "", - configuration.getText("doclet.Prev_Class"), true)); + public Content getNavLinkPrevious() { + Content li; + if (prev != null) { + Content prevLink = new RawHtml(getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS, prev.asClassDoc(), "", + configuration.getText("doclet.Prev_Class"), true))); + li = HtmlTree.LI(prevLink); } + else + li = HtmlTree.LI(prevclassLabel); + return li; } /** - * Print next package link + * Get link to next class. + * + * @return a content tree for the next class link */ - protected void navLinkNext() { - if (next == null) { - printText("doclet.Next_Class"); - } else { - printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, - next.asClassDoc(), "", - configuration.getText("doclet.Next_Class"), true)); + public Content getNavLinkNext() { + Content li; + if (next != null) { + Content nextLink = new RawHtml(getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS, next.asClassDoc(), "", + configuration.getText("doclet.Next_Class"), true))); + li = HtmlTree.LI(nextLink); } + else + li = HtmlTree.LI(nextclassLabel); + return li; } /** * {@inheritDoc} */ - public void writeHeader(String header) { - + public Content getHeader(String header) { String pkgname = (annotationType.containingPackage() != null)? annotationType.containingPackage().name(): ""; String clname = annotationType.name(); - - printHtmlHeader(clname, - configuration.metakeywords.getMetaKeywords(annotationType), true); - printTop(); - navLinks(true); - hr(); - println(""); - h2(); + Content bodyTree = getBody(true, getWindowTitle(clname)); + addTop(bodyTree); + addNavLinks(true, bodyTree); + bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA); + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.header); if (pkgname.length() > 0) { - font("-1"); print(pkgname); fontEnd(); br(); + Content pkgNameContent = new StringContent(pkgname); + Content pkgNamePara = HtmlTree.P(HtmlStyle.subTitle, pkgNameContent); + div.addContent(pkgNamePara); } - print(header + getTypeParameterLinks(new LinkInfoImpl( - LinkInfoImpl.CONTEXT_CLASS_HEADER, - annotationType, false))); - h2End(); + LinkInfoImpl linkInfo = new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS_HEADER, annotationType, false); + Content headerContent = new StringContent(header); + Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true, + HtmlStyle.title, headerContent); + heading.addContent(new RawHtml(getTypeParameterLinks(linkInfo))); + div.addContent(heading); + bodyTree.addContent(div); + return bodyTree; } /** * {@inheritDoc} */ - public void writeFooter() { - println(""); - hr(); - navLinks(false); - printBottom(); - printBodyHtmlEnd(); + public Content getAnnotationContentHeader() { + return getContentHeader(); } /** * {@inheritDoc} */ - public void writeAnnotationTypeSignature(String modifiers) { - preNoNewLine(); - writeAnnotationInfo(annotationType); - print(modifiers); - String name = annotationType.name() + - getTypeParameterLinks(new LinkInfoImpl( - LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false)); + public void addFooter(Content contentTree) { + contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA); + addNavLinks(false, contentTree); + addBottom(contentTree); + } + + /** + * {@inheritDoc} + */ + public void printDocument(Content contentTree) { + printHtmlDocument(configuration.metakeywords.getMetaKeywords(annotationType), + true, contentTree); + } + + /** + * {@inheritDoc} + */ + public Content getAnnotationInfoTreeHeader() { + return getMemberTreeHeader(); + } + + /** + * {@inheritDoc} + */ + public Content getAnnotationInfo(Content annotationInfoTree) { + return getMemberTree(HtmlStyle.description, annotationInfoTree); + } + + /** + * {@inheritDoc} + */ + public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree) { + annotationInfoTree.addContent(new HtmlTree(HtmlTag.BR)); + Content pre = new HtmlTree(HtmlTag.PRE); + addAnnotationInfo(annotationType, pre); + pre.addContent(modifiers); + LinkInfoImpl linkInfo = new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false); + Content name = new RawHtml (annotationType.name() + + getTypeParameterLinks(linkInfo)); if (configuration().linksource) { - printSrcLink(annotationType, name); + addSrcLink(annotationType, name, pre); } else { - strong(name); + pre.addContent(HtmlTree.STRONG(name)); } - preEnd(); - p(); + annotationInfoTree.addContent(pre); } /** * {@inheritDoc} */ - public void writeAnnotationTypeDescription() { + public void addAnnotationTypeDescription(Content annotationInfoTree) { if(!configuration.nocomment) { - // generate documentation for the class. if (annotationType.inlineTags().length > 0) { - printInlineComment(annotationType); - p(); + addInlineComment(annotationType, annotationInfoTree); } } } @@ -196,148 +240,152 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter /** * {@inheritDoc} */ - public void writeAnnotationTypeTagInfo() { - boolean needHr = annotationType.elements().length > 0; + public void addAnnotationTypeTagInfo(Content annotationInfoTree) { if(!configuration.nocomment) { - // Print Information about all the tags here - printTags(annotationType); - if (needHr) { - hr(); - } - p(); - } else if (needHr) { - hr(); + addTagsInfo(annotationType, annotationInfoTree); } } /** * {@inheritDoc} */ - public void writeAnnotationTypeDeprecationInfo() { - hr(); + public void addAnnotationTypeDeprecationInfo(Content annotationInfoTree) { + Content hr = new HtmlTree(HtmlTag.HR); + annotationInfoTree.addContent(hr); Tag[] deprs = annotationType.tags("deprecated"); if (Util.isDeprecated(annotationType)) { - strongText("doclet.Deprecated"); + Content strong = HtmlTree.STRONG(deprecatedPhrase); + Content div = HtmlTree.DIV(HtmlStyle.block, strong); if (deprs.length > 0) { Tag[] commentTags = deprs[0].inlineTags(); if (commentTags.length > 0) { - - space(); - printInlineDeprecatedComment(annotationType, deprs[0]); + div.addContent(getSpace()); + addInlineDeprecatedComment(annotationType, deprs[0], div); } } - p(); + annotationInfoTree.addContent(div); } } - protected void navLinkTree() { - navCellStart(); - printHyperLink("package-tree.html", "", - configuration.getText("doclet.Tree"), true, "NavBarFont1"); - navCellEnd(); + /** + * {@inheritDoc} + */ + public void addAnnotationDetailsMarker(Content memberDetails) { + memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS); } - protected void printSummaryDetailLinks() { - try { - tr(); - tdVAlignClass("top", "NavBarCell3"); - font("-2"); - print(" "); - navSummaryLinks(); - fontEnd(); - tdEnd(); + /** + * {@inheritDoc} + */ + protected Content getNavLinkTree() { + Content treeLinkContent = getHyperLink("package-tree.html", + "", treeLabel, "", ""); + Content li = HtmlTree.LI(treeLinkContent); + return li; + } - tdVAlignClass("top", "NavBarCell3"); - font("-2"); - navDetailLinks(); - fontEnd(); - tdEnd(); - trEnd(); + /** + * Add summary details to the navigation bar. + * + * @param subDiv the content tree to which the summary detail links will be added + */ + protected void addSummaryDetailLinks(Content subDiv) { + try { + Content div = HtmlTree.DIV(getNavSummaryLinks()); + div.addContent(getNavDetailLinks()); + subDiv.addContent(div); } catch (Exception e) { e.printStackTrace(); throw new DocletAbortException(); } } - protected void navSummaryLinks() throws Exception { - printText("doclet.Summary"); - space(); + /** + * Get summary links for navigation bar. + * + * @return the content tree for the navigation summary links + */ + protected Content getNavSummaryLinks() throws Exception { + Content li = HtmlTree.LI(summaryLabel); + li.addContent(getSpace()); + Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) - configuration.getBuilderFactory().getMemberSummaryBuilder(this); - writeNavSummaryLink(memberSummaryBuilder, - "doclet.navAnnotationTypeRequiredMember", - VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED); - navGap(); - writeNavSummaryLink(memberSummaryBuilder, - "doclet.navAnnotationTypeOptionalMember", - VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL); + configuration.getBuilderFactory().getMemberSummaryBuilder(this); + Content liNavReq = new HtmlTree(HtmlTag.LI); + addNavSummaryLink(memberSummaryBuilder, + "doclet.navAnnotationTypeRequiredMember", + VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED, liNavReq); + addNavGap(liNavReq); + ulNav.addContent(liNavReq); + Content liNavOpt = new HtmlTree(HtmlTag.LI); + addNavSummaryLink(memberSummaryBuilder, + "doclet.navAnnotationTypeOptionalMember", + VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL, liNavOpt); + ulNav.addContent(liNavOpt); + return ulNav; } - private void writeNavSummaryLink(MemberSummaryBuilder builder, - String label, int type) { + /** + * Add the navigation summary link. + * + * @param builder builder for the member to be documented + * @param label the label for the navigation + * @param type type to be documented + * @param liNav the content tree to which the navigation summary link will be added + */ + protected void addNavSummaryLink(MemberSummaryBuilder builder, + String label, int type, Content liNav) { AbstractMemberWriter writer = ((AbstractMemberWriter) builder. - getMemberSummaryWriter(type)); + getMemberSummaryWriter(type)); if (writer == null) { - printText(label); + liNav.addContent(getResource(label)); } else { - writer.printNavSummaryLink(null, - ! builder.getVisibleMemberMap(type).noVisibleMembers()); + liNav.addContent(writer.getNavSummaryLink(null, + ! builder.getVisibleMemberMap(type).noVisibleMembers())); } } /** - * Method navDetailLinks - * - * @throws Exception + * Get detail links for the navigation bar. * + * @return the content tree for the detail links */ - protected void navDetailLinks() throws Exception { - printText("doclet.Detail"); - space(); + protected Content getNavDetailLinks() throws Exception { + Content li = HtmlTree.LI(detailLabel); + li.addContent(getSpace()); + Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) - configuration.getBuilderFactory().getMemberSummaryBuilder(this); + configuration.getBuilderFactory().getMemberSummaryBuilder(this); AbstractMemberWriter writerOptional = - ((AbstractMemberWriter) memberSummaryBuilder. + ((AbstractMemberWriter) memberSummaryBuilder. getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL)); AbstractMemberWriter writerRequired = - ((AbstractMemberWriter) memberSummaryBuilder. + ((AbstractMemberWriter) memberSummaryBuilder. getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED)); if (writerOptional != null){ - writerOptional.printNavDetailLink(annotationType.elements().length > 0); + Content liNavOpt = new HtmlTree(HtmlTag.LI); + writerOptional.addNavDetailLink(annotationType.elements().length > 0, liNavOpt); + ulNav.addContent(liNavOpt); } else if (writerRequired != null){ - writerRequired.printNavDetailLink(annotationType.elements().length > 0); + Content liNavReq = new HtmlTree(HtmlTag.LI); + writerRequired.addNavDetailLink(annotationType.elements().length > 0, liNavReq); + ulNav.addContent(liNavReq); } else { - printText("doclet.navAnnotationTypeMember"); + Content liNav = HtmlTree.LI(getResource("doclet.navAnnotationTypeMember")); + ulNav.addContent(liNav); } - } - - protected void navGap() { - space(); - print('|'); - space(); + return ulNav; } /** - * If this is an inner class or interface, write the enclosing class or - * interface. + * Add gap between navigation bar elements. + * + * @param liNav the content tree to which the gap will be added */ - public void writeNestedClassInfo() { - ClassDoc outerClass = annotationType.containingClass(); - if (outerClass != null) { - dl(); - dt(); - if (annotationType.isInterface()) { - strongText("doclet.Enclosing_Interface"); - } else { - strongText("doclet.Enclosing_Class"); - } - dtEnd(); - dd(); - printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass, - false)); - ddEnd(); - dlEnd(); - } + protected void addNavGap(Content liNav) { + liNav.addContent(getSpace()); + liNav.addContent("|"); + liNav.addContent(getSpace()); } /** @@ -346,11 +394,4 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter public AnnotationTypeDoc getAnnotationTypeDoc() { return annotationType; } - - /** - * {@inheritDoc} - */ - public void completeMemberSummaryBuild() { - p(); - } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java index 511b3d59919..9db6e97bb3d 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,12 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.javadoc.*; import java.io.*; import java.util.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; +import com.sun.tools.doclets.internal.toolkit.*; /** * Generate class usage information. @@ -207,257 +209,301 @@ public class ClassUseWriter extends SubWriterHolderWriter { } /** - * Print the class use list. + * Generate the class use list. */ protected void generateClassUseFile() throws IOException { - - printClassUseHeader(); - + Content body = getClassUseHeader(); + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.classUseContainer); if (pkgSet.size() > 0) { - generateClassUse(); + addClassUse(div); } else { - printText("doclet.ClassUse_No.usage.of.0", - classdoc.qualifiedName()); - p(); + div.addContent(getResource("doclet.ClassUse_No.usage.of.0", + classdoc.qualifiedName())); } - - printClassUseFooter(); + body.addContent(div); + addNavLinks(false, body); + addBottom(body); + printHtmlDocument(null, true, body); } - protected void generateClassUse() throws IOException { + /** + * Add the class use documentation. + * + * @param contentTree the content tree to which the class use information will be added + */ + protected void addClassUse(Content contentTree) throws IOException { + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.blockList); if (configuration.packages.length > 1) { - generatePackageList(); - generatePackageAnnotationList(); + addPackageList(ul); + addPackageAnnotationList(ul); } - generateClassList(); + addClassList(ul); + contentTree.addContent(ul); } - protected void generatePackageList() throws IOException { - tableIndexSummary(useTableSummary); - tableCaptionStart(); - printText("doclet.ClassUse_Packages.that.use.0", - getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, - false))); - tableCaptionEnd(); - summaryTableHeader(packageTableHeader, "col"); - - for (Iterator it = pkgSet.iterator(); it.hasNext();) { + /** + * Add the packages list that use the given class. + * + * @param contentTree the content tree to which the packages list will be added + */ + protected void addPackageList(Content contentTree) throws IOException { + Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary, + getTableCaption(configuration().getText( + "doclet.ClassUse_Packages.that.use.0", + getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, + false))))); + table.addContent(getSummaryTableHeader(packageTableHeader, "col")); + Content tbody = new HtmlTree(HtmlTag.TBODY); + Iterator it = pkgSet.iterator(); + for (int i = 0; it.hasNext(); i++) { PackageDoc pkg = it.next(); - generatePackageUse(pkg); + HtmlTree tr = new HtmlTree(HtmlTag.TR); + if (i % 2 == 0) { + tr.addStyle(HtmlStyle.altColor); + } else { + tr.addStyle(HtmlStyle.rowColor); + } + addPackageUse(pkg, tr); + tbody.addContent(tr); } - tableEnd(); - space(); - p(); + table.addContent(tbody); + Content li = HtmlTree.LI(HtmlStyle.blockList, table); + contentTree.addContent(li); } - protected void generatePackageAnnotationList() throws IOException { - if ((! classdoc.isAnnotationType()) || - pkgToPackageAnnotations == null || - pkgToPackageAnnotations.size() == 0) + /** + * Add the package annotation list. + * + * @param contentTree the content tree to which the package annotation list will be added + */ + protected void addPackageAnnotationList(Content contentTree) throws IOException { + if ((!classdoc.isAnnotationType()) || + pkgToPackageAnnotations == null || + pkgToPackageAnnotations.size() == 0) { return; - tableIndexSummary(useTableSummary); - tableCaptionStart(); - printText("doclet.ClassUse_PackageAnnotation", - getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, - false))); - tableCaptionEnd(); - summaryTableHeader(packageTableHeader, "col"); - for (Iterator it = pkgToPackageAnnotations.iterator(); it.hasNext();) { - PackageDoc pkg = it.next(); - trBgcolorStyle("white", "TableRowColor"); - summaryRow(0); - //Just want an anchor here. - printPackageLink(pkg, pkg.name(), true); - summaryRowEnd(); - summaryRow(0); - printSummaryComment(pkg); - space(); - summaryRowEnd(); - trEnd(); } - tableEnd(); - space(); - p(); + Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary, + getTableCaption(configuration().getText( + "doclet.ClassUse_PackageAnnotation", + getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, + false))))); + table.addContent(getSummaryTableHeader(packageTableHeader, "col")); + Content tbody = new HtmlTree(HtmlTag.TBODY); + Iterator it = pkgToPackageAnnotations.iterator(); + for (int i = 0; it.hasNext(); i++) { + PackageDoc pkg = it.next(); + HtmlTree tr = new HtmlTree(HtmlTag.TR); + if (i % 2 == 0) { + tr.addStyle(HtmlStyle.altColor); + } else { + tr.addStyle(HtmlStyle.rowColor); + } + Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, + getPackageLink(pkg, new StringContent(pkg.name()))); + tr.addContent(tdFirst); + HtmlTree tdLast = new HtmlTree(HtmlTag.TD); + tdLast.addStyle(HtmlStyle.colLast); + if (pkg != null) { + addSummaryComment(pkg, tdLast); + } else { + tdLast.addContent(getSpace()); + } + tr.addContent(tdLast); + tbody.addContent(tr); + } + table.addContent(tbody); + Content li = HtmlTree.LI(HtmlStyle.blockList, table); + contentTree.addContent(li); } - protected void generateClassList() throws IOException { + /** + * Add the class list that use the given class. + * + * @param contentTree the content tree to which the class list will be added + */ + protected void addClassList(Content contentTree) throws IOException { + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.blockList); for (Iterator it = pkgSet.iterator(); it.hasNext();) { PackageDoc pkg = it.next(); - anchor(pkg.name()); - tableIndexSummary(); - tableHeaderStart("#CCCCFF"); - printText("doclet.ClassUse_Uses.of.0.in.1", - getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, + Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name())); + Content link = new RawHtml( + configuration.getText("doclet.ClassUse_Uses.of.0.in.1", + getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, false)), - getPackageLink(pkg, Util.getPackageName(pkg), false)); - tableHeaderEnd(); - tableEnd(); - space(); - p(); - generateClassUse(pkg); + getPackageLinkString(pkg, Util.getPackageName(pkg), false))); + Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link); + li.addContent(heading); + addClassUse(pkg, li); + ul.addContent(li); } + Content li = HtmlTree.LI(HtmlStyle.blockList, ul); + contentTree.addContent(li); } /** - * Print the package use list. + * Add the package use information. + * + * @param pkg the package that uses the given class + * @param contentTree the content tree to which the package use information will be added */ - protected void generatePackageUse(PackageDoc pkg) throws IOException { - trBgcolorStyle("white", "TableRowColor"); - summaryRow(0); - //Just want an anchor here. - printHyperLink("", pkg.name(), Util.getPackageName(pkg), true); - summaryRowEnd(); - summaryRow(0); - printSummaryComment(pkg); - space(); - summaryRowEnd(); - trEnd(); + protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException { + Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, + getHyperLink("", pkg.name(), new StringContent(Util.getPackageName(pkg)))); + contentTree.addContent(tdFirst); + HtmlTree tdLast = new HtmlTree(HtmlTag.TD); + tdLast.addStyle(HtmlStyle.colLast); + if (pkg != null) + addSummaryComment(pkg, tdLast); + else + tdLast.addContent(getSpace()); + contentTree.addContent(tdLast); } /** - * Print the class use list. + * Add the class use information. + * + * @param pkg the package that uses the given class + * @param contentTree the content tree to which the class use information will be added */ - protected void generateClassUse(PackageDoc pkg) throws IOException { + protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException { String classLink = getLink(new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, false)); - String pkgLink = getPackageLink(pkg, Util.getPackageName(pkg), false); - classSubWriter.printUseInfo(pkgToClassAnnotations.get(pkg.name()), + String pkgLink = getPackageLinkString(pkg, Util.getPackageName(pkg), false); + classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()), configuration.getText("doclet.ClassUse_Annotation", classLink, - pkgLink), classUseTableSummary); - classSubWriter.printUseInfo(pkgToClassTypeParameter.get(pkg.name()), + pkgLink), classUseTableSummary, contentTree); + classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg.name()), configuration.getText("doclet.ClassUse_TypeParameter", classLink, - pkgLink), classUseTableSummary); - classSubWriter.printUseInfo(pkgToSubclass.get(pkg.name()), + pkgLink), classUseTableSummary, contentTree); + classSubWriter.addUseInfo(pkgToSubclass.get(pkg.name()), configuration.getText("doclet.ClassUse_Subclass", classLink, - pkgLink), subclassUseTableSummary); - classSubWriter.printUseInfo(pkgToSubinterface.get(pkg.name()), + pkgLink), subclassUseTableSummary, contentTree); + classSubWriter.addUseInfo(pkgToSubinterface.get(pkg.name()), configuration.getText("doclet.ClassUse_Subinterface", classLink, - pkgLink), subinterfaceUseTableSummary); - classSubWriter.printUseInfo(pkgToImplementingClass.get(pkg.name()), + pkgLink), subinterfaceUseTableSummary, contentTree); + classSubWriter.addUseInfo(pkgToImplementingClass.get(pkg.name()), configuration.getText("doclet.ClassUse_ImplementingClass", classLink, - pkgLink), classUseTableSummary); - fieldSubWriter.printUseInfo(pkgToField.get(pkg.name()), + pkgLink), classUseTableSummary, contentTree); + fieldSubWriter.addUseInfo(pkgToField.get(pkg.name()), configuration.getText("doclet.ClassUse_Field", classLink, - pkgLink), fieldUseTableSummary); - fieldSubWriter.printUseInfo(pkgToFieldAnnotations.get(pkg.name()), + pkgLink), fieldUseTableSummary, contentTree); + fieldSubWriter.addUseInfo(pkgToFieldAnnotations.get(pkg.name()), configuration.getText("doclet.ClassUse_FieldAnnotations", classLink, - pkgLink), fieldUseTableSummary); - fieldSubWriter.printUseInfo(pkgToFieldTypeParameter.get(pkg.name()), + pkgLink), fieldUseTableSummary, contentTree); + fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.get(pkg.name()), configuration.getText("doclet.ClassUse_FieldTypeParameter", classLink, - pkgLink), fieldUseTableSummary); - methodSubWriter.printUseInfo(pkgToMethodAnnotations.get(pkg.name()), + pkgLink), fieldUseTableSummary, contentTree); + methodSubWriter.addUseInfo(pkgToMethodAnnotations.get(pkg.name()), configuration.getText("doclet.ClassUse_MethodAnnotations", classLink, - pkgLink), methodUseTableSummary); - methodSubWriter.printUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()), + pkgLink), methodUseTableSummary, contentTree); + methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()), configuration.getText("doclet.ClassUse_MethodParameterAnnotations", classLink, - pkgLink), methodUseTableSummary); - methodSubWriter.printUseInfo(pkgToMethodTypeParameter.get(pkg.name()), + pkgLink), methodUseTableSummary, contentTree); + methodSubWriter.addUseInfo(pkgToMethodTypeParameter.get(pkg.name()), configuration.getText("doclet.ClassUse_MethodTypeParameter", classLink, - pkgLink), methodUseTableSummary); - methodSubWriter.printUseInfo(pkgToMethodReturn.get(pkg.name()), + pkgLink), methodUseTableSummary, contentTree); + methodSubWriter.addUseInfo(pkgToMethodReturn.get(pkg.name()), configuration.getText("doclet.ClassUse_MethodReturn", classLink, - pkgLink), methodUseTableSummary); - methodSubWriter.printUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()), + pkgLink), methodUseTableSummary, contentTree); + methodSubWriter.addUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()), configuration.getText("doclet.ClassUse_MethodReturnTypeParameter", classLink, - pkgLink), methodUseTableSummary); - methodSubWriter.printUseInfo(pkgToMethodArgs.get(pkg.name()), + pkgLink), methodUseTableSummary, contentTree); + methodSubWriter.addUseInfo(pkgToMethodArgs.get(pkg.name()), configuration.getText("doclet.ClassUse_MethodArgs", classLink, - pkgLink), methodUseTableSummary); - methodSubWriter.printUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()), + pkgLink), methodUseTableSummary, contentTree); + methodSubWriter.addUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()), configuration.getText("doclet.ClassUse_MethodArgsTypeParameters", classLink, - pkgLink), methodUseTableSummary); - methodSubWriter.printUseInfo(pkgToMethodThrows.get(pkg.name()), + pkgLink), methodUseTableSummary, contentTree); + methodSubWriter.addUseInfo(pkgToMethodThrows.get(pkg.name()), configuration.getText("doclet.ClassUse_MethodThrows", classLink, - pkgLink), methodUseTableSummary); - constrSubWriter.printUseInfo(pkgToConstructorAnnotations.get(pkg.name()), + pkgLink), methodUseTableSummary, contentTree); + constrSubWriter.addUseInfo(pkgToConstructorAnnotations.get(pkg.name()), configuration.getText("doclet.ClassUse_ConstructorAnnotations", classLink, - pkgLink), constructorUseTableSummary); - constrSubWriter.printUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()), + pkgLink), constructorUseTableSummary, contentTree); + constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()), configuration.getText("doclet.ClassUse_ConstructorParameterAnnotations", classLink, - pkgLink), constructorUseTableSummary); - constrSubWriter.printUseInfo(pkgToConstructorArgs.get(pkg.name()), + pkgLink), constructorUseTableSummary, contentTree); + constrSubWriter.addUseInfo(pkgToConstructorArgs.get(pkg.name()), configuration.getText("doclet.ClassUse_ConstructorArgs", classLink, - pkgLink), constructorUseTableSummary); - constrSubWriter.printUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()), + pkgLink), constructorUseTableSummary, contentTree); + constrSubWriter.addUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()), configuration.getText("doclet.ClassUse_ConstructorArgsTypeParameters", classLink, - pkgLink), constructorUseTableSummary); - constrSubWriter.printUseInfo(pkgToConstructorThrows.get(pkg.name()), + pkgLink), constructorUseTableSummary, contentTree); + constrSubWriter.addUseInfo(pkgToConstructorThrows.get(pkg.name()), configuration.getText("doclet.ClassUse_ConstructorThrows", classLink, - pkgLink), constructorUseTableSummary); + pkgLink), constructorUseTableSummary, contentTree); } /** - * Print the header for the class use Listing. + * Get the header for the class use Listing. + * + * @return a content tree representing the class use header */ - protected void printClassUseHeader() { + protected Content getClassUseHeader() { String cltype = configuration.getText(classdoc.isInterface()? - "doclet.Interface": - "doclet.Class"); + "doclet.Interface":"doclet.Class"); String clname = classdoc.qualifiedName(); - printHtmlHeader(configuration.getText("doclet.Window_ClassUse_Header", - cltype, clname), null, true); - printTop(); - navLinks(true); - hr(); - center(); - h2(); - strongText("doclet.ClassUse_Title", cltype, clname); - h2End(); - centerEnd(); + String title = configuration.getText("doclet.Window_ClassUse_Header", + cltype, clname); + Content bodyTree = getBody(true, getWindowTitle(title)); + addTop(bodyTree); + addNavLinks(true, bodyTree); + Content headContent = getResource("doclet.ClassUse_Title", cltype, clname); + Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, + true, HtmlStyle.title, headContent); + Content div = HtmlTree.DIV(HtmlStyle.header, heading); + bodyTree.addContent(div); + return bodyTree; } /** - * Print the footer for the class use Listing. + * Get this package link. + * + * @return a content tree for the package link */ - protected void printClassUseFooter() { - hr(); - navLinks(false); - printBottom(); - printBodyHtmlEnd(); - } - - - /** - * Print this package link - */ - protected void navLinkPackage() { - navCellStart(); - printHyperLink("../package-summary.html", "", - configuration.getText("doclet.Package"), true, "NavBarFont1"); - navCellEnd(); + protected Content getNavLinkPackage() { + Content linkContent = getHyperLink("../package-summary.html", "", + packageLabel); + Content li = HtmlTree.LI(linkContent); + return li; } /** - * Print class page indicator + * Get class page link. + * + * @return a content tree for the class page link */ - protected void navLinkClass() { - navCellStart(); - printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, "", - configuration.getText("doclet.Class"), true, "NavBarFont1")); - navCellEnd(); + protected Content getNavLinkClass() { + Content linkContent = new RawHtml(getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, "", + configuration.getText("doclet.Class"), false))); + Content li = HtmlTree.LI(linkContent); + return li; } /** - * Print class use link + * Get the use link. + * + * @return a content tree for the use link */ - protected void navLinkClassUse() { - navCellRevStart(); - fontStyle("NavBarFont1Rev"); - strongText("doclet.navClassUse"); - fontEnd(); - navCellEnd(); + protected Content getNavLinkClassUse() { + Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, useLabel); + return li; } - protected void navLinkTree() { - navCellStart(); - if (classdoc.containingPackage().isIncluded()) { - printHyperLink("../package-tree.html", "", - configuration.getText("doclet.Tree"), true, "NavBarFont1"); - } else { - printHyperLink(relativePath + "overview-tree.html", "", - configuration.getText("doclet.Tree"), true, "NavBarFont1"); - } - navCellEnd(); + /** + * Get the tree link. + * + * @return a content tree for the tree link + */ + protected Content getNavLinkTree() { + Content linkContent = classdoc.containingPackage().isIncluded() ? + getHyperLink("../package-tree.html", "", treeLabel) : + getHyperLink(relativePath + "overview-tree.html", "", treeLabel); + Content li = HtmlTree.LI(linkContent); + return li; } - } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java index acd8ff5c79c..306331866d4 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +32,7 @@ import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.builders.*; import com.sun.tools.doclets.internal.toolkit.taglets.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * Generate the Class Information Page. @@ -43,6 +44,7 @@ import com.sun.tools.doclets.internal.toolkit.taglets.*; * * @author Atul M Dambalkar * @author Robert Field + * @author Bhavesh Patel (Modified) */ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWriter { @@ -76,124 +78,173 @@ public class ClassWriterImpl extends SubWriterHolderWriter } /** - * Print this package link + * Get this package link. + * + * @return a content tree for the package link */ - protected void navLinkPackage() { - navCellStart(); - printHyperLink("package-summary.html", "", - configuration.getText("doclet.Package"), true, "NavBarFont1"); - navCellEnd(); + protected Content getNavLinkPackage() { + Content linkContent = getHyperLink("package-summary.html", "", + packageLabel); + Content li = HtmlTree.LI(linkContent); + return li; } /** - * Print class page indicator + * Get the class link. + * + * @return a content tree for the class link */ - protected void navLinkClass() { - navCellRevStart(); - fontStyle("NavBarFont1Rev"); - strongText("doclet.Class"); - fontEnd(); - navCellEnd(); + protected Content getNavLinkClass() { + Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, classLabel); + return li; } /** - * Print class use link + * Get the class use link. + * + * @return a content tree for the class use link */ - protected void navLinkClassUse() { - navCellStart(); - printHyperLink("class-use/" + filename, "", - configuration.getText("doclet.navClassUse"), true, "NavBarFont1"); - navCellEnd(); + protected Content getNavLinkClassUse() { + Content linkContent = getHyperLink("class-use/" + filename, "", useLabel); + Content li = HtmlTree.LI(linkContent); + return li; } /** - * Print previous package link + * Get link to previous class. + * + * @return a content tree for the previous class link */ - protected void navLinkPrevious() { - if (prev == null) { - printText("doclet.Prev_Class"); - } else { - printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, prev, "", - configuration.getText("doclet.Prev_Class"), true)); + public Content getNavLinkPrevious() { + Content li; + if (prev != null) { + Content prevLink = new RawHtml(getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS, prev, "", + configuration.getText("doclet.Prev_Class"), true))); + li = HtmlTree.LI(prevLink); } + else + li = HtmlTree.LI(prevclassLabel); + return li; } /** - * Print next package link + * Get link to next class. + * + * @return a content tree for the next class link */ - protected void navLinkNext() { - if (next == null) { - printText("doclet.Next_Class"); - } else { - printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, next, "", - configuration.getText("doclet.Next_Class"), true)); + public Content getNavLinkNext() { + Content li; + if (next != null) { + Content nextLink = new RawHtml(getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS, next, "", + configuration.getText("doclet.Next_Class"), true))); + li = HtmlTree.LI(nextLink); } + else + li = HtmlTree.LI(nextclassLabel); + return li; } /** * {@inheritDoc} */ - public void writeHeader(String header) { + public Content getHeader(String header) { String pkgname = (classDoc.containingPackage() != null)? classDoc.containingPackage().name(): ""; String clname = classDoc.name(); - printHtmlHeader(clname, - configuration.metakeywords.getMetaKeywords(classDoc), true); - printTop(); - navLinks(true); - hr(); - println(""); - h2(); + Content bodyTree = getBody(true, getWindowTitle(clname)); + addTop(bodyTree); + addNavLinks(true, bodyTree); + bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA); + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.header); if (pkgname.length() > 0) { - font("-1"); print(pkgname); fontEnd(); br(); + Content pkgNameContent = new StringContent(pkgname); + Content pkgNamePara = HtmlTree.P(HtmlStyle.subTitle, pkgNameContent); + div.addContent(pkgNamePara); } LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER, - classDoc, false); + classDoc, false); //Let's not link to ourselves in the header. linkInfo.linkToSelf = false; - print(header + getTypeParameterLinks(linkInfo)); - h2End(); + Content headerContent = new StringContent(header); + Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true, + HtmlStyle.title, headerContent); + heading.addContent(new RawHtml(getTypeParameterLinks(linkInfo))); + div.addContent(heading); + bodyTree.addContent(div); + return bodyTree; } /** * {@inheritDoc} */ - public void writeFooter() { - println(""); - hr(); - navLinks(false); - printBottom(); - printBodyHtmlEnd(); + public Content getClassContentHeader() { + return getContentHeader(); } /** * {@inheritDoc} */ - public void writeClassSignature(String modifiers) { + public void addFooter(Content contentTree) { + contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA); + addNavLinks(false, contentTree); + addBottom(contentTree); + } + + /** + * {@inheritDoc} + */ + public void printDocument(Content contentTree) { + printHtmlDocument(configuration.metakeywords.getMetaKeywords(classDoc), + true, contentTree); + } + + /** + * {@inheritDoc} + */ + public Content getClassInfoTreeHeader() { + return getMemberTreeHeader(); + } + + /** + * {@inheritDoc} + */ + public Content getClassInfo(Content classInfoTree) { + return getMemberTree(HtmlStyle.description, classInfoTree); + } + + /** + * {@inheritDoc} + */ + public void addClassSignature(String modifiers, Content classInfoTree) { boolean isInterface = classDoc.isInterface(); - preNoNewLine(); - writeAnnotationInfo(classDoc); - print(modifiers); + classInfoTree.addContent(new HtmlTree(HtmlTag.BR)); + Content pre = new HtmlTree(HtmlTag.PRE); + addAnnotationInfo(classDoc, pre); + pre.addContent(modifiers); LinkInfoImpl linkInfo = new LinkInfoImpl( - LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, classDoc, false); + LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, classDoc, false); //Let's not link to ourselves in the signature. linkInfo.linkToSelf = false; - String name = classDoc.name() + - getTypeParameterLinks(linkInfo); + Content name = new RawHtml (classDoc.name() + + getTypeParameterLinks(linkInfo)); if (configuration().linksource) { - printSrcLink(classDoc, name); + addSrcLink(classDoc, name, pre); } else { - strong(name); + pre.addContent(HtmlTree.STRONG(name)); } if (!isInterface) { Type superclass = Util.getFirstVisibleSuperClass(classDoc, - configuration()); + configuration()); if (superclass != null) { - println(); - print("extends "); - printLink(new LinkInfoImpl( - LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME, - superclass)); + pre.addContent(DocletConstants.NL); + pre.addContent("extends "); + Content link = new RawHtml(getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME, + superclass))); + pre.addContent(link); } } Type[] implIntfacs = classDoc.interfaceTypes(); @@ -202,34 +253,33 @@ public class ClassWriterImpl extends SubWriterHolderWriter for (int i = 0; i < implIntfacs.length; i++) { ClassDoc classDoc = implIntfacs[i].asClassDoc(); if (! (classDoc.isPublic() || - Util.isLinkable(classDoc, configuration()))) { + Util.isLinkable(classDoc, configuration()))) { continue; } if (counter == 0) { - println(); - print(isInterface? "extends " : "implements "); + pre.addContent(DocletConstants.NL); + pre.addContent(isInterface? "extends " : "implements "); } else { - print(", "); + pre.addContent(", "); } - printLink(new LinkInfoImpl( - LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME, - implIntfacs[i])); + Content link = new RawHtml(getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME, + implIntfacs[i]))); + pre.addContent(link); counter++; } } - preEnd(); - p(); + classInfoTree.addContent(pre); } /** * {@inheritDoc} */ - public void writeClassDescription() { + public void addClassDescription(Content classInfoTree) { if(!configuration.nocomment) { // generate documentation for the class. if (classDoc.inlineTags().length > 0) { - printInlineComment(classDoc); - p(); + addInlineComment(classDoc, classInfoTree); } } } @@ -237,131 +287,118 @@ public class ClassWriterImpl extends SubWriterHolderWriter /** * {@inheritDoc} */ - public void writeClassTagInfo() { + public void addClassTagInfo(Content classInfoTree) { if(!configuration.nocomment) { // Print Information about all the tags here - printTags(classDoc); - hr(); - p(); - } else { - hr(); + addTagsInfo(classDoc, classInfoTree); } } /** - * {@inheritDoc} - */ - public void writeClassDeprecationInfo() { - hr(); - Tag[] deprs = classDoc.tags("deprecated"); - if (Util.isDeprecated(classDoc)) { - strongText("doclet.Deprecated"); - if (deprs.length > 0) { - Tag[] commentTags = deprs[0].inlineTags(); - if (commentTags.length > 0) { - space(); - printInlineDeprecatedComment(classDoc, deprs[0]); - } - } - p(); - } - } - - /** - * Generate the indent and get the line image for the class tree. - * For user accessibility, the image includes the alt attribute - * "extended by". (This method is not intended for a class - * implementing an interface, where "implemented by" would be required.) + * Get the class hierarchy tree for the given class. * - * indent integer indicating the number of spaces to indent + * @param type the class to print the hierarchy for + * @return a content tree for class inheritence */ - private void writeStep(int indent) { - print(spaces(4 * indent - 2)); - print(""); + private Content getClassInheritenceTree(Type type) { + Type sup; + HtmlTree classTreeUl = new HtmlTree(HtmlTag.UL); + classTreeUl.addStyle(HtmlStyle.inheritance); + Content liTree = null; + do { + sup = Util.getFirstVisibleSuperClass( + type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(), + configuration()); + if (sup != null) { + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.inheritance); + ul.addContent(getTreeForClassHelper(type)); + if (liTree != null) + ul.addContent(liTree); + Content li = HtmlTree.LI(ul); + liTree = li; + type = sup; + } + else + classTreeUl.addContent(getTreeForClassHelper(type)); + } + while (sup != null); + if (liTree != null) + classTreeUl.addContent(liTree); + return classTreeUl; } /** - * Print the class hierarchy tree for the given class. - * @param type the class to print the hierarchy for. - * @return return the amount that should be indented in - * the next level of the tree. + * Get the class helper tree for the given class. + * + * @param type the class to print the helper for + * @return a content tree for class helper */ - private int writeTreeForClassHelper(Type type) { - Type sup = Util.getFirstVisibleSuperClass( - type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(), - configuration()); - int indent = 0; - if (sup != null) { - indent = writeTreeForClassHelper(sup); - writeStep(indent); - } - + private Content getTreeForClassHelper(Type type) { + Content li = new HtmlTree(HtmlTag.LI); if (type.equals(classDoc)) { String typeParameters = getTypeParameterLinks( - new LinkInfoImpl( - LinkInfoImpl.CONTEXT_TREE, + new LinkInfoImpl(LinkInfoImpl.CONTEXT_TREE, classDoc, false)); if (configuration.shouldExcludeQualifier( classDoc.containingPackage().name())) { - strong(type.asClassDoc().name() + typeParameters); + li.addContent(type.asClassDoc().name()); + li.addContent(new RawHtml(typeParameters)); } else { - strong(type.asClassDoc().qualifiedName() + typeParameters); + li.addContent(type.asClassDoc().qualifiedName()); + li.addContent(new RawHtml(typeParameters)); } } else { - print(getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_TREE_PARENT, + Content link = new RawHtml(getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS_TREE_PARENT, type instanceof ClassDoc ? (ClassDoc) type : type, configuration.getClassName(type.asClassDoc()), false))); + li.addContent(link); } - println(); - return indent + 1; + return li; } /** - * Print the class hierarchy tree for this class only. + * {@inheritDoc} */ - public void writeClassTree() { - if (! classDoc.isClass()) { + public void addClassTree(Content classContentTree) { + if (!classDoc.isClass()) { return; } - pre(); - writeTreeForClassHelper(classDoc); - preEnd(); + classContentTree.addContent(getClassInheritenceTree(classDoc)); } /** - * Write the type parameter information. + * {@inheritDoc} */ - public void writeTypeParamInfo() { + public void addTypeParamInfo(Content classInfoTree) { if (classDoc.typeParamTags().length > 0) { - dl(); - dt(); TagletOutput output = (new ParamTaglet()).getTagletOutput(classDoc, - getTagletWriterInstance(false)); - print(output.toString()); - dtEnd(); - dlEnd(); + getTagletWriterInstance(false)); + Content typeParam = new RawHtml(output.toString()); + Content dl = HtmlTree.DL(typeParam); + classInfoTree.addContent(dl); } } /** * {@inheritDoc} */ - public void writeSubClassInfo() { + public void addSubClassInfo(Content classInfoTree) { if (classDoc.isClass()) { if (classDoc.qualifiedName().equals("java.lang.Object") || - classDoc.qualifiedName().equals("org.omg.CORBA.Object")) { + classDoc.qualifiedName().equals("org.omg.CORBA.Object")) { return; // Don't generate the list, too huge } List subclasses = classtree.subs(classDoc, false); if (subclasses.size() > 0) { - dl(); - dt(); - strongText("doclet.Subclasses"); - dtEnd(); - writeClassLinks(LinkInfoImpl.CONTEXT_SUBCLASSES, - subclasses); - dlEnd(); + Content label = getResource( + "doclet.Subclasses"); + Content dt = HtmlTree.DT(label); + Content dl = HtmlTree.DL(dt); + dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_SUBCLASSES, + subclasses)); + classInfoTree.addContent(dl); } } } @@ -369,140 +406,196 @@ public class ClassWriterImpl extends SubWriterHolderWriter /** * {@inheritDoc} */ - public void writeSubInterfacesInfo() { + public void addSubInterfacesInfo(Content classInfoTree) { if (classDoc.isInterface()) { List subInterfaces = classtree.allSubs(classDoc, false); if (subInterfaces.size() > 0) { - dl(); - dt(); - strongText("doclet.Subinterfaces"); - dtEnd(); - writeClassLinks(LinkInfoImpl.CONTEXT_SUBINTERFACES, - subInterfaces); - dlEnd(); + Content label = getResource( + "doclet.Subinterfaces"); + Content dt = HtmlTree.DT(label); + Content dl = HtmlTree.DL(dt); + dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_SUBINTERFACES, + subInterfaces)); + classInfoTree.addContent(dl); } } } /** - * If this is the interface which are the classes, that implement this? + * {@inheritDoc} */ - public void writeInterfaceUsageInfo () { + public void addInterfaceUsageInfo (Content classInfoTree) { if (! classDoc.isInterface()) { return; } if (classDoc.qualifiedName().equals("java.lang.Cloneable") || - classDoc.qualifiedName().equals("java.io.Serializable")) { + classDoc.qualifiedName().equals("java.io.Serializable")) { return; // Don't generate the list, too big } List implcl = classtree.implementingclasses(classDoc); if (implcl.size() > 0) { - dl(); - dt(); - strongText("doclet.Implementing_Classes"); - dtEnd(); - writeClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_CLASSES, - implcl); - dlEnd(); + Content label = getResource( + "doclet.Implementing_Classes"); + Content dt = HtmlTree.DT(label); + Content dl = HtmlTree.DL(dt); + dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_CLASSES, + implcl)); + classInfoTree.addContent(dl); } } /** * {@inheritDoc} */ - public void writeImplementedInterfacesInfo() { + public void addImplementedInterfacesInfo(Content classInfoTree) { //NOTE: we really should be using ClassDoc.interfaceTypes() here, but // it doesn't walk up the tree like we want it to. List interfaceArray = Util.getAllInterfaces(classDoc, configuration); if (classDoc.isClass() && interfaceArray.size() > 0) { - dl(); - dt(); - strongText("doclet.All_Implemented_Interfaces"); - dtEnd(); - writeClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_INTERFACES, - interfaceArray); - dlEnd(); + Content label = getResource( + "doclet.All_Implemented_Interfaces"); + Content dt = HtmlTree.DT(label); + Content dl = HtmlTree.DL(dt); + dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_INTERFACES, + interfaceArray)); + classInfoTree.addContent(dl); } } /** * {@inheritDoc} */ - public void writeSuperInterfacesInfo() { + public void addSuperInterfacesInfo(Content classInfoTree) { //NOTE: we really should be using ClassDoc.interfaceTypes() here, but // it doesn't walk up the tree like we want it to. List interfaceArray = Util.getAllInterfaces(classDoc, configuration); if (classDoc.isInterface() && interfaceArray.size() > 0) { - dl(); - dt(); - strongText("doclet.All_Superinterfaces"); - dtEnd(); - writeClassLinks(LinkInfoImpl.CONTEXT_SUPER_INTERFACES, - interfaceArray); - dlEnd(); + Content label = getResource( + "doclet.All_Superinterfaces"); + Content dt = HtmlTree.DT(label); + Content dl = HtmlTree.DL(dt); + dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_SUPER_INTERFACES, + interfaceArray)); + classInfoTree.addContent(dl); } } /** - * Generate links to the given classes. + * {@inheritDoc} */ - private void writeClassLinks(int context, List list) { + public void addNestedClassInfo(Content classInfoTree) { + ClassDoc outerClass = classDoc.containingClass(); + if (outerClass != null) { + Content label; + if (outerClass.isInterface()) { + label = getResource( + "doclet.Enclosing_Interface"); + } else { + label = getResource( + "doclet.Enclosing_Class"); + } + Content dt = HtmlTree.DT(label); + Content dl = HtmlTree.DL(dt); + Content dd = new HtmlTree(HtmlTag.DD); + dd.addContent(new RawHtml(getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass, + false)))); + dl.addContent(dd); + classInfoTree.addContent(dl); + } + } + + /** + * {@inheritDoc} + */ + public void addClassDeprecationInfo(Content classInfoTree) { + Content hr = new HtmlTree(HtmlTag.HR); + classInfoTree.addContent(hr); + Tag[] deprs = classDoc.tags("deprecated"); + if (Util.isDeprecated(classDoc)) { + Content strong = HtmlTree.STRONG(deprecatedPhrase); + Content div = HtmlTree.DIV(HtmlStyle.block, strong); + if (deprs.length > 0) { + Tag[] commentTags = deprs[0].inlineTags(); + if (commentTags.length > 0) { + div.addContent(getSpace()); + addInlineDeprecatedComment(classDoc, deprs[0], div); + } + } + classInfoTree.addContent(div); + } + } + + /** + * Get links to the given classes. + * + * @param context the id of the context where the link will be printed + * @param list the list of classes + * @return a content tree for the class list + */ + private Content getClassLinks(int context, List list) { Object[] typeList = list.toArray(); - //Sort the list to be printed. - print(' '); - dd(); + Content dd = new HtmlTree(HtmlTag.DD); for (int i = 0; i < list.size(); i++) { if (i > 0) { - print(", "); + Content separator = new StringContent(", "); + dd.addContent(separator); } if (typeList[i] instanceof ClassDoc) { - printLink(new LinkInfoImpl(context, (ClassDoc)(typeList[i]))); - + Content link = new RawHtml(getLink( + new LinkInfoImpl(context, (ClassDoc)(typeList[i])))); + dd.addContent(link); } else { - printLink(new LinkInfoImpl(context, (Type)(typeList[i]))); + Content link = new RawHtml(getLink( + new LinkInfoImpl(context, (Type)(typeList[i])))); + dd.addContent(link); } } - ddEnd(); + return dd; } - protected void navLinkTree() { - navCellStart(); - printHyperLink("package-tree.html", "", - configuration.getText("doclet.Tree"), true, "NavBarFont1"); - navCellEnd(); + /** + * {@inheritDoc} + */ + protected Content getNavLinkTree() { + Content treeLinkContent = getHyperLink("package-tree.html", + "", treeLabel, "", ""); + Content li = HtmlTree.LI(treeLinkContent); + return li; } - protected void printSummaryDetailLinks() { + /** + * Add summary details to the navigation bar. + * + * @param subDiv the content tree to which the summary detail links will be added + */ + protected void addSummaryDetailLinks(Content subDiv) { try { - tr(); - tdVAlignClass("top", "NavBarCell3"); - font("-2"); - print(" "); - navSummaryLinks(); - fontEnd(); - tdEnd(); - tdVAlignClass("top", "NavBarCell3"); - font("-2"); - navDetailLinks(); - fontEnd(); - tdEnd(); - trEnd(); + Content div = HtmlTree.DIV(getNavSummaryLinks()); + div.addContent(getNavDetailLinks()); + subDiv.addContent(div); } catch (Exception e) { e.printStackTrace(); throw new DocletAbortException(); } } - protected void navSummaryLinks() throws Exception { - printText("doclet.Summary"); - space(); + /** + * Get summary links for navigation bar. + * + * @return the content tree for the navigation summary links + */ + protected Content getNavSummaryLinks() throws Exception { + Content li = HtmlTree.LI(summaryLabel); + li.addContent(getSpace()); + Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) - configuration.getBuilderFactory().getMemberSummaryBuilder(this); + configuration.getBuilderFactory().getMemberSummaryBuilder(this); String[] navLinkLabels = new String[] { "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor", - "doclet.navMethod" + "doclet.navMethod" }; for (int i = 0; i < navLinkLabels.length; i++ ) { + Content liNav = new HtmlTree(HtmlTag.LI); if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) { continue; } @@ -511,38 +604,41 @@ public class ClassWriterImpl extends SubWriterHolderWriter } AbstractMemberWriter writer = ((AbstractMemberWriter) memberSummaryBuilder. - getMemberSummaryWriter(i)); + getMemberSummaryWriter(i)); if (writer == null) { - printText(navLinkLabels[i]); + liNav.addContent(getResource(navLinkLabels[i])); } else { - writer.navSummaryLink( - memberSummaryBuilder.members(i), - memberSummaryBuilder.getVisibleMemberMap(i)); + writer.addNavSummaryLink( + memberSummaryBuilder.members(i), + memberSummaryBuilder.getVisibleMemberMap(i), liNav); } if (i < navLinkLabels.length-1) { - navGap(); + addNavGap(liNav); } + ulNav.addContent(liNav); } + return ulNav; } /** - * Method navDetailLinks - * - * @throws Exception + * Get detail links for the navigation bar. * + * @return the content tree for the detail links */ - protected void navDetailLinks() throws Exception { - printText("doclet.Detail"); - space(); + protected Content getNavDetailLinks() throws Exception { + Content li = HtmlTree.LI(detailLabel); + li.addContent(getSpace()); + Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) - configuration.getBuilderFactory().getMemberSummaryBuilder(this); + configuration.getBuilderFactory().getMemberSummaryBuilder(this); String[] navLinkLabels = new String[] { "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor", - "doclet.navMethod" + "doclet.navMethod" }; for (int i = 1; i < navLinkLabels.length; i++ ) { + Content liNav = new HtmlTree(HtmlTag.LI); AbstractMemberWriter writer = - ((AbstractMemberWriter) memberSummaryBuilder. + ((AbstractMemberWriter) memberSummaryBuilder. getMemberSummaryWriter(i)); if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) { continue; @@ -551,43 +647,27 @@ public class ClassWriterImpl extends SubWriterHolderWriter continue; } if (writer == null) { - printText(navLinkLabels[i]); + liNav.addContent(getResource(navLinkLabels[i])); } else { - writer.navDetailLink(memberSummaryBuilder.members(i)); + writer.addNavDetailLink(memberSummaryBuilder.members(i), liNav); } if (i < navLinkLabels.length - 1) { - navGap(); + addNavGap(liNav); } + ulNav.addContent(liNav); } - } - - protected void navGap() { - space(); - print('|'); - space(); + return ulNav; } /** - * If this is an inner class or interface, write the enclosing class or - * interface. + * Add gap between navigation bar elements. + * + * @param liNav the content tree to which the gap will be added */ - public void writeNestedClassInfo() { - ClassDoc outerClass = classDoc.containingClass(); - if (outerClass != null) { - dl(); - dt(); - if (outerClass.isInterface()) { - strongText("doclet.Enclosing_Interface"); - } else { - strongText("doclet.Enclosing_Class"); - } - dtEnd(); - dd(); - printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass, - false)); - ddEnd(); - dlEnd(); - } + protected void addNavGap(Content liNav) { + liNav.addContent(getSpace()); + liNav.addContent("|"); + liNav.addContent(getSpace()); } /** @@ -598,11 +678,4 @@ public class ClassWriterImpl extends SubWriterHolderWriter public ClassDoc getClassDoc() { return classDoc; } - - /** - * {@inheritDoc} - */ - public void completeMemberSummaryBuild() { - p(); - } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java index 0b0bfa29382..4d38ad9778c 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +25,12 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.javadoc.*; import java.io.*; import java.util.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * Write the Constants Summary Page in HTML format. @@ -76,67 +77,106 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter /** * {@inheritDoc} */ - public void writeHeader() { - printHtmlHeader(configuration.getText("doclet.Constants_Summary"), - null, true); - printTop(); - navLinks(true); - hr(); - - center(); - h1(); printText("doclet.Constants_Summary"); h1End(); - centerEnd(); - - hr(4, "noshade"); + public Content getHeader() { + String label = configuration.getText("doclet.Constants_Summary"); + Content bodyTree = getBody(true, getWindowTitle(label)); + addTop(bodyTree); + addNavLinks(true, bodyTree); + return bodyTree; } /** * {@inheritDoc} */ - public void writeFooter() { - hr(); - navLinks(false); - printBottom(); - printBodyHtmlEnd(); + public Content getContentsHeader() { + return new HtmlTree(HtmlTag.UL); } /** * {@inheritDoc} */ - public void writeContentsHeader() { - strong(configuration.getText("doclet.Contents")); - ul(); - } - - /** - * {@inheritDoc} - */ - public void writeContentsFooter() { - ulEnd(); - println(); - } - - /** - * {@inheritDoc} - */ - public void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName, Set printedPackageHeaders) { + public void addLinkToPackageContent(PackageDoc pkg, String parsedPackageName, + Set printedPackageHeaders, Content contentListTree) { String packageName = pkg.name(); //add link to summary - li(); + Content link; if (packageName.length() == 0) { - printHyperLink("#" + DocletConstants.UNNAMED_PACKAGE_ANCHOR, - DocletConstants.DEFAULT_PACKAGE_NAME); + link = getHyperLink("#" + DocletConstants.UNNAMED_PACKAGE_ANCHOR, + "", defaultPackageLabel, "", ""); } else { - printHyperLink("#" + parsedPackageName, parsedPackageName + ".*"); + Content packageNameContent = getPackageLabel(parsedPackageName); + packageNameContent.addContent(".*"); + link = getHyperLink("#" + parsedPackageName, + "", packageNameContent, "", ""); printedPackageHeaders.add(parsedPackageName); } - println(); + contentListTree.addContent(HtmlTree.LI(link)); } /** * {@inheritDoc} */ - public void writeConstantMembersHeader(ClassDoc cd) { + public Content getContentsList(Content contentListTree) { + Content titleContent = getResource( + "doclet.Constants_Summary"); + Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, + HtmlStyle.title, titleContent); + Content div = HtmlTree.DIV(HtmlStyle.header, pHeading); + Content headingContent = getResource( + "doclet.Contents"); + div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true, + headingContent)); + div.addContent(contentListTree); + return div; + } + + /** + * {@inheritDoc} + */ + public Content getConstantSummaries() { + HtmlTree summariesDiv = new HtmlTree(HtmlTag.DIV); + summariesDiv.addStyle(HtmlStyle.constantValuesContainer); + return summariesDiv; + } + + /** + * {@inheritDoc} + */ + public void addPackageName(PackageDoc pkg, String parsedPackageName, + Content summariesTree) { + Content pkgNameContent; + if (parsedPackageName.length() == 0) { + summariesTree.addContent(getMarkerAnchor( + DocletConstants.UNNAMED_PACKAGE_ANCHOR)); + pkgNameContent = defaultPackageLabel; + } else { + summariesTree.addContent(getMarkerAnchor( + parsedPackageName)); + pkgNameContent = getPackageLabel(parsedPackageName); + } + Content headingContent = new StringContent(".*"); + Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true, + pkgNameContent); + heading.addContent(headingContent); + summariesTree.addContent(heading); + } + + /** + * {@inheritDoc} + */ + public Content getClassConstantHeader() { + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.blockList); + return ul; + } + + /** + * Get the table caption and header for the constant summary table + * + * @param cd classdoc to be documented + * @return constant members header content + */ + public Content getConstantMembersHeader(ClassDoc cd) { //generate links backward only to public classes. String classlink = (cd.isPublic() || cd.isProtected())? getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, cd, @@ -144,112 +184,120 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter cd.qualifiedName(); String name = cd.containingPackage().name(); if (name.length() > 0) { - writeClassName(name + "." + classlink); + return getClassName(name + "." + classlink); } else { - writeClassName(classlink); + return getClassName(classlink); } } + /** + * Get the class name in the table caption and the table header. + * + * @param classStr the class name to print. + * @return the table caption and header + */ + protected Content getClassName(String classStr) { + Content table = HtmlTree.TABLE(0, 3, 0, constantsTableSummary, + getTableCaption(classStr)); + table.addContent(getSummaryTableHeader(constantsTableHeader, "col")); + return table; + } + /** * {@inheritDoc} */ - public void writeConstantMembersFooter(ClassDoc cd) { - tableFooter(false); - p(); - } - - /** - * Print the class name in the table heading. - * @param classStr the heading to print. - */ - protected void writeClassName(String classStr) { - table(1, 3, 0, constantsTableSummary); - tableSubCaptionStart(); - write(classStr); - tableCaptionEnd(); - summaryTableHeader(constantsTableHeader, "col"); - } - - private void tableFooter(boolean isHeader) { - fontEnd(); - if (isHeader) { - thEnd(); - } else { - tdEnd(); - } - trEnd(); - tableEnd(); - p(); - } - - /** - * {@inheritDoc} - */ - public void writePackageName(PackageDoc pkg, String parsedPackageName) { - String pkgname; - if (parsedPackageName.length() == 0) { - anchor(DocletConstants.UNNAMED_PACKAGE_ANCHOR); - pkgname = DocletConstants.DEFAULT_PACKAGE_NAME; - } else { - anchor(parsedPackageName); - pkgname = parsedPackageName; - } - table(1, "100%", 3, 0); - trBgcolorStyle("#CCCCFF", "TableHeadingColor"); - thAlign("left"); - font("+2"); - write(pkgname + ".*"); - tableFooter(true); - } - - /** - * {@inheritDoc} - */ - public void writeConstantMembers(ClassDoc cd, List fields) { + public void addConstantMembers(ClassDoc cd, List fields, + Content classConstantTree) { currentClassDoc = cd; + Content tbody = new HtmlTree(HtmlTag.TBODY); for (int i = 0; i < fields.size(); ++i) { - writeConstantMember(fields.get(i)); + HtmlTree tr = new HtmlTree(HtmlTag.TR); + if (i%2 == 0) + tr.addStyle(HtmlStyle.altColor); + else + tr.addStyle(HtmlStyle.rowColor); + addConstantMember(fields.get(i), tr); + tbody.addContent(tr); } + Content table = getConstantMembersHeader(cd); + table.addContent(tbody); + Content li = HtmlTree.LI(HtmlStyle.blockList, table); + classConstantTree.addContent(li); } - private void writeConstantMember(FieldDoc member) { - trBgcolorStyle("white", "TableRowColor"); - anchor(currentClassDoc.qualifiedName() + "." + member.name()); - writeTypeColumn(member); - writeNameColumn(member); - writeValue(member); - trEnd(); + /** + * Add the row for the constant summary table. + * + * @param member the field to be documented. + * @param trTree an htmltree object for the table row + */ + private void addConstantMember(FieldDoc member, HtmlTree trTree) { + trTree.addContent(getTypeColumn(member)); + trTree.addContent(getNameColumn(member)); + trTree.addContent(getValue(member)); } - private void writeTypeColumn(FieldDoc member) { - tdAlign("right"); - font("-1"); - code(); + /** + * Get the type column for the constant summary table row. + * + * @param member the field to be documented. + * @return the type column of the constant table row + */ + private Content getTypeColumn(FieldDoc member) { + Content anchor = getMarkerAnchor(currentClassDoc.qualifiedName() + + "." + member.name()); + Content tdType = HtmlTree.TD(HtmlStyle.colFirst, anchor); + Content code = new HtmlTree(HtmlTag.CODE); StringTokenizer mods = new StringTokenizer(member.modifiers()); while(mods.hasMoreTokens()) { - print(mods.nextToken() + " "); + Content modifier = new StringContent(mods.nextToken()); + code.addContent(modifier); + code.addContent(getSpace()); } - printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, - member.type())); - codeEnd(); - fontEnd(); - tdEnd(); + Content type = new RawHtml(getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, member.type()))); + code.addContent(type); + tdType.addContent(code); + return tdType; } - private void writeNameColumn(FieldDoc member) { - tdAlign("left"); - code(); - printDocLink(LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, member, - member.name(), false); - codeEnd(); - tdEnd(); + /** + * Get the name column for the constant summary table row. + * + * @param member the field to be documented. + * @return the name column of the constant table row + */ + private Content getNameColumn(FieldDoc member) { + Content nameContent = new RawHtml(getDocLink( + LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, member, member.name(), false)); + Content code = HtmlTree.CODE(nameContent); + return HtmlTree.TD(code); } - private void writeValue(FieldDoc member) { - tdAlign("right"); - code(); - print(Util.escapeHtmlChars(member.constantValueExpression())); - codeEnd(); - tdEnd(); + /** + * Get the value column for the constant summary table row. + * + * @param member the field to be documented. + * @return the value column of the constant table row + */ + private Content getValue(FieldDoc member) { + Content valueContent = new StringContent(member.constantValueExpression()); + Content code = HtmlTree.CODE(valueContent); + return HtmlTree.TD(HtmlStyle.colLast, code); + } + + /** + * {@inheritDoc} + */ + public void addFooter(Content contentTree) { + addNavLinks(false, contentTree); + addBottom(contentTree); + } + + /** + * {@inheritDoc} + */ + public void printDocument(Content contentTree) { + printHtmlDocument(null, true, contentTree); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java index 0d5f6b8895a..6db2b0d23c3 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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 java.io.*; import java.util.*; import com.sun.javadoc.*; +import com.sun.tools.doclets.formats.html.markup.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.util.*; @@ -43,7 +44,6 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter implements ConstructorWriter, MemberSummaryWriter { private boolean foundNonPubConstructor = false; - private boolean printedSummaryHeader = false; /** * Construct a new ConstructorWriterImpl. @@ -75,125 +75,112 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter } /** - * Write the constructors summary header for the given class. - * - * @param classDoc the class the summary belongs to. + * {@inheritDoc} */ - public void writeMemberSummaryHeader(ClassDoc classDoc) { - printedSummaryHeader = true; - writer.println(); - writer.println(""); - writer.println(); - writer.printSummaryHeader(this, classDoc); + public Content getMemberSummaryHeader(ClassDoc classDoc, + Content memberSummaryTree) { + memberSummaryTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_SUMMARY); + Content memberTree = writer.getMemberTreeHeader(); + writer.addSummaryHeader(this, classDoc, memberTree); + return memberTree; } /** - * Write the constructors summary footer for the given class. - * - * @param classDoc the class the summary belongs to. + * {@inheritDoc} */ - public void writeMemberSummaryFooter(ClassDoc classDoc) { - writer.printSummaryFooter(this, classDoc); + public Content getConstructorDetailsTreeHeader(ClassDoc classDoc, + Content memberDetailsTree) { + memberDetailsTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_DETAILS); + Content constructorDetailsTree = writer.getMemberTreeHeader(); + constructorDetailsTree.addContent(writer.getMarkerAnchor("constructor_detail")); + Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, + writer.constructorDetailsLabel); + constructorDetailsTree.addContent(heading); + return constructorDetailsTree; } /** - * Write the header for the constructor documentation. - * - * @param classDoc the class that the constructors belong to. + * {@inheritDoc} */ - public void writeHeader(ClassDoc classDoc, String header) { - writer.println(); - writer.println(""); - writer.println(); - writer.anchor("constructor_detail"); - writer.printTableHeadingBackground(header); - } - - /** - * Write the constructor header for the given constructor. - * - * @param constructor the constructor being documented. - * @param isFirst the flag to indicate whether or not the constructor is the - * first to be documented. - */ - public void writeConstructorHeader(ConstructorDoc constructor, boolean isFirst) { - if (! isFirst) { - writer.printMemberHeader(); - } - writer.println(); + public Content getConstructorDocTreeHeader(ConstructorDoc constructor, + Content constructorDetailsTree) { String erasureAnchor; if ((erasureAnchor = getErasureAnchor(constructor)) != null) { - writer.anchor(erasureAnchor); + constructorDetailsTree.addContent(writer.getMarkerAnchor((erasureAnchor))); } - writer.anchor(constructor); - writer.h3(); - writer.print(constructor.name()); - writer.h3End(); + constructorDetailsTree.addContent( + writer.getMarkerAnchor(writer.getAnchor(constructor))); + Content constructorDocTree = writer.getMemberTreeHeader(); + Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); + heading.addContent(constructor.name()); + constructorDocTree.addContent(heading); + return constructorDocTree; } /** - * Write the signature for the given constructor. - * - * @param constructor the constructor being documented. + * {@inheritDoc} */ - public void writeSignature(ConstructorDoc constructor) { + public Content getSignature(ConstructorDoc constructor) { writer.displayLength = 0; - writer.pre(); - writer.writeAnnotationInfo(constructor); - printModifiers(constructor); - //printReturnType((ConstructorDoc)constructor); + Content pre = new HtmlTree(HtmlTag.PRE); + writer.addAnnotationInfo(constructor, pre); + addModifiers(constructor, pre); if (configuration().linksource) { - writer.printSrcLink(constructor, constructor.name()); + Content constructorName = new StringContent(constructor.name()); + writer.addSrcLink(constructor, constructorName, pre); } else { - strong(constructor.name()); + addName(constructor.name(), pre); } - writeParameters(constructor); - writeExceptions(constructor); - writer.preEnd(); - assert !writer.getMemberDetailsListPrinted(); + addParameters(constructor, pre); + addExceptions(constructor, pre); + return pre; } /** - * Write the deprecated output for the given constructor. - * - * @param constructor the constructor being documented. + * {@inheritDoc} */ - public void writeDeprecated(ConstructorDoc constructor) { - printDeprecated(constructor); + @Override + public void setSummaryColumnStyle(HtmlTree tdTree) { + if (foundNonPubConstructor) + tdTree.addStyle(HtmlStyle.colLast); + else + tdTree.addStyle(HtmlStyle.colOne); } /** - * Write the comments for the given constructor. - * - * @param constructor the constructor being documented. + * {@inheritDoc} */ - public void writeComments(ConstructorDoc constructor) { - printComment(constructor); + public void addDeprecated(ConstructorDoc constructor, Content constructorDocTree) { + addDeprecatedInfo(constructor, constructorDocTree); } /** - * Write the tag output for the given constructor. - * - * @param constructor the constructor being documented. + * {@inheritDoc} */ - public void writeTags(ConstructorDoc constructor) { - writer.printTags(constructor); + public void addComments(ConstructorDoc constructor, Content constructorDocTree) { + addComment(constructor, constructorDocTree); } /** - * Write the constructor footer. + * {@inheritDoc} */ - public void writeConstructorFooter() { - printMemberFooter(); + public void addTags(ConstructorDoc constructor, Content constructorDocTree) { + writer.addTagsInfo(constructor, constructorDocTree); } /** - * Write the footer for the constructor documentation. - * - * @param classDoc the class that the constructors belong to. + * {@inheritDoc} */ - public void writeFooter(ClassDoc classDoc) { - //No footer to write for constructor documentation + public Content getConstructorDetails(Content constructorDetailsTree) { + return getMemberTree(constructorDetailsTree); + } + + /** + * {@inheritDoc} + */ + public Content getConstructorDoc(Content constructorDocTree, + boolean isLastContent) { + return getMemberTree(constructorDocTree, isLastContent); } /** @@ -212,17 +199,35 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter this.foundNonPubConstructor = foundNonPubConstructor; } - public void printSummaryLabel() { - writer.printText("doclet.Constructor_Summary"); + /** + * {@inheritDoc} + */ + public void addSummaryLabel(Content memberTree) { + Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, + writer.getResource("doclet.Constructor_Summary")); + memberTree.addContent(label); } - public void printTableSummary() { - writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary", + /** + * {@inheritDoc} + */ + public String getTableSummary() { + return configuration().getText("doclet.Member_Table_Summary", configuration().getText("doclet.Constructor_Summary"), - configuration().getText("doclet.constructors"))); + configuration().getText("doclet.constructors")); } - public void printSummaryTableHeader(ProgramElementDoc member) { + /** + * {@inheritDoc} + */ + public String getCaption() { + return configuration().getText("doclet.Constructors"); + } + + /** + * {@inheritDoc} + */ + public String[] getSummaryTableHeader(ProgramElementDoc member) { String[] header; if (foundNonPubConstructor) { header = new String[] { @@ -239,87 +244,73 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter configuration().getText("doclet.Description")) }; } - writer.summaryTableHeader(header, "col"); + return header; } - public void printSummaryAnchor(ClassDoc cd) { - writer.anchor("constructor_summary"); + /** + * {@inheritDoc} + */ + public void addSummaryAnchor(ClassDoc cd, Content memberTree) { + memberTree.addContent(writer.getMarkerAnchor("constructor_summary")); } - public void printInheritedSummaryAnchor(ClassDoc cd) { - } // no such + /** + * {@inheritDoc} + */ + public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { + } - public void printInheritedSummaryLabel(ClassDoc cd) { - // no such + /** + * {@inheritDoc} + */ + public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { } public int getMemberKind() { return VisibleMemberMap.CONSTRUCTORS; } - protected void navSummaryLink(List members) { - printNavSummaryLink(classdoc, - members.size() > 0? true: false); - } - - protected void printNavSummaryLink(ClassDoc cd, boolean link) { - if (link) { - writer.printHyperLink("", "constructor_summary", - ConfigurationImpl.getInstance().getText("doclet.navConstructor")); - } else { - writer.printText("doclet.navConstructor"); - } - } - - protected void printNavDetailLink(boolean link) { - if (link) { - writer.printHyperLink("", "constructor_detail", - ConfigurationImpl.getInstance().getText("doclet.navConstructor")); - } else { - writer.printText("doclet.navConstructor"); - } - } - - protected void printSummaryType(ProgramElementDoc member) { - if (foundNonPubConstructor) { - writer.printTypeSummaryHeader(); - if (member.isProtected()) { - print("protected "); - } else if (member.isPrivate()) { - print("private "); - } else if (member.isPublic()) { - writer.space(); - } else { - writer.printText("doclet.Package_private"); - } - writer.printTypeSummaryFooter(); - } - } - /** - * Write the inherited member summary header for the given class. - * - * @param classDoc the class the summary belongs to. + * {@inheritDoc} */ - public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) { - if(! printedSummaryHeader){ - //We don't want inherited summary to not be under heading. - writeMemberSummaryHeader(classDoc); - writeMemberSummaryFooter(classDoc); - printedSummaryHeader = true; + protected Content getNavSummaryLink(ClassDoc cd, boolean link) { + if (link) { + return writer.getHyperLink("", "constructor_summary", + writer.getResource("doclet.navConstructor")); + } else { + return writer.getResource("doclet.navConstructor"); } } /** * {@inheritDoc} */ - public void writeInheritedMemberSummary(ClassDoc classDoc, - ProgramElementDoc member, boolean isFirst, boolean isLast) {} + protected void addNavDetailLink(boolean link, Content liNav) { + if (link) { + liNav.addContent(writer.getHyperLink("", "constructor_detail", + writer.getResource("doclet.navConstructor"))); + } else { + liNav.addContent(writer.getResource("doclet.navConstructor")); + } + } /** - * Write the inherited member summary footer for the given class. - * - * @param classDoc the class the summary belongs to. + * {@inheritDoc} */ - public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) {} + protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { + if (foundNonPubConstructor) { + Content code = new HtmlTree(HtmlTag.CODE); + if (member.isProtected()) { + code.addContent("protected "); + } else if (member.isPrivate()) { + code.addContent("private "); + } else if (member.isPublic()) { + code.addContent(writer.getSpace()); + } else { + code.addContent( + configuration().getText("doclet.Package_private")); + } + tdSummaryType.addContent(code); + } + } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java index f0a6bfed3d6..917720fac4f 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +25,11 @@ package com.sun.tools.doclets.formats.html; +import java.io.*; +import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.util.DeprecatedAPIListBuilder; import com.sun.tools.doclets.internal.toolkit.util.*; -import java.io.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * Generate File to list all the deprecated classes and class members with the @@ -125,28 +127,21 @@ public class DeprecatedListWriter extends SubWriterHolderWriter { } /** - * Print the deprecated API list. Separately print all class kinds and - * member kinds. + * Generate the deprecated API list. * * @param deprapi list of deprecated API built already. */ protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi) - throws IOException { - writeHeader(); - - strong(configuration.getText("doclet.Contents")); - ul(); - for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) { - writeIndexLink(deprapi, i); - } - ulEnd(); - println(); - + throws IOException { + Content body = getHeader(); + body.addContent(getContentsList(deprapi)); String memberTableSummary; String[] memberTableHeader = new String[1]; + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.contentContainer); for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) { if (deprapi.hasDocumentation(i)) { - writeAnchor(deprapi, i); + addAnchor(deprapi, i, div); memberTableSummary = configuration.getText("doclet.Member_Table_Summary", configuration.getText(HEADING_KEYS[i]), @@ -154,66 +149,87 @@ public class DeprecatedListWriter extends SubWriterHolderWriter { memberTableHeader[0] = configuration.getText("doclet.0_and_1", configuration.getText(HEADER_KEYS[i]), configuration.getText("doclet.Description")); - writers[i].printDeprecatedAPI(deprapi.getList(i), - HEADING_KEYS[i], memberTableSummary, memberTableHeader); + writers[i].addDeprecatedAPI(deprapi.getList(i), + HEADING_KEYS[i], memberTableSummary, memberTableHeader, div); } } - printDeprecatedFooter(); + body.addContent(div); + addNavLinks(false, body); + addBottom(body); + printHtmlDocument(null, true, body); } - private void writeIndexLink(DeprecatedAPIListBuilder builder, - int type) { + /** + * Add the index link. + * + * @param builder the deprecated list builder + * @param type the type of list being documented + * @param contentTree the content tree to which the index link will be added + */ + private void addIndexLink(DeprecatedAPIListBuilder builder, + int type, Content contentTree) { if (builder.hasDocumentation(type)) { - li(); - printHyperLink("#" + ANCHORS[type], - configuration.getText(HEADING_KEYS[type])); - println(); - } - } - - private void writeAnchor(DeprecatedAPIListBuilder builder, int type) { - if (builder.hasDocumentation(type)) { - anchor(ANCHORS[type]); + Content li = HtmlTree.LI(getHyperLink("#" + ANCHORS[type], + getResource(HEADING_KEYS[type]))); + contentTree.addContent(li); } } /** - * Print the navigation bar and header for the deprecated API Listing. + * Get the contents list. + * + * @param deprapi the deprecated list builder + * @return a content tree for the contents list */ - protected void writeHeader() { - printHtmlHeader(configuration.getText("doclet.Window_Deprecated_List"), - null, true); - printTop(); - navLinks(true); - hr(); - center(); - h2(); - strongText("doclet.Deprecated_API"); - h2End(); - centerEnd(); - - hr(4, "noshade"); + public Content getContentsList(DeprecatedAPIListBuilder deprapi) { + Content headContent = getResource("doclet.Deprecated_API"); + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, + HtmlStyle.title, headContent); + Content div = HtmlTree.DIV(HtmlStyle.header, heading); + Content headingContent = getResource("doclet.Contents"); + div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true, + headingContent)); + Content ul = new HtmlTree(HtmlTag.UL); + for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) { + addIndexLink(deprapi, i, ul); + } + div.addContent(ul); + return div; } /** - * Print the navigation bar and the footer for the deprecated API Listing. + * Add the anchor. + * + * @param builder the deprecated list builder + * @param type the type of list being documented + * @param contentTree the content tree to which the anchor will be added */ - protected void printDeprecatedFooter() { - hr(); - navLinks(false); - printBottom(); - printBodyHtmlEnd(); + private void addAnchor(DeprecatedAPIListBuilder builder, int type, Content htmlTree) { + if (builder.hasDocumentation(type)) { + htmlTree.addContent(getMarkerAnchor(ANCHORS[type])); + } } /** - * Highlight the word "Deprecated" in the navigation bar as this is the same - * page. + * Get the header for the deprecated API Listing. + * + * @return a content tree for the header */ - protected void navLinkDeprecated() { - navCellRevStart(); - fontStyle("NavBarFont1Rev"); - strongText("doclet.navDeprecated"); - fontEnd(); - navCellEnd(); + public Content getHeader() { + String title = configuration.getText("doclet.Window_Deprecated_List"); + Content bodyTree = getBody(true, getWindowTitle(title)); + addTop(bodyTree); + addNavLinks(true, bodyTree); + return bodyTree; + } + + /** + * Get the deprecated label. + * + * @return a content tree for the deprecated label + */ + protected Content getNavLinkDeprecated() { + Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, deprecatedLabel); + return li; } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java index afa63b4c492..f567aae7ae1 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ package com.sun.tools.doclets.formats.html; import java.io.*; import com.sun.javadoc.*; +import com.sun.tools.doclets.formats.html.markup.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.util.*; @@ -40,8 +41,6 @@ import com.sun.tools.doclets.internal.toolkit.util.*; public class EnumConstantWriterImpl extends AbstractMemberWriter implements EnumConstantWriter, MemberSummaryWriter { - private boolean printedSummaryHeader = false; - public EnumConstantWriterImpl(SubWriterHolderWriter writer, ClassDoc classdoc) { super(writer, classdoc); @@ -52,136 +51,98 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter } /** - * Write the enum constant summary header for the given class. - * - * @param classDoc the class the summary belongs to. + * {@inheritDoc} */ - public void writeMemberSummaryHeader(ClassDoc classDoc) { - printedSummaryHeader = true; - writer.println(""); - writer.println(); - writer.printSummaryHeader(this, classDoc); - } - - /** - * Write the enum constant summary footer for the given class. - * - * @param classDoc the class the summary belongs to. - */ - public void writeMemberSummaryFooter(ClassDoc classDoc) { - writer.printSummaryFooter(this, classDoc); - } - - /** - * Write the inherited enum constant summary header for the given class. - * - * @param classDoc the class the summary belongs to. - */ - public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) { - if(! printedSummaryHeader){ - //We don't want inherited summary to not be under heading. - writeMemberSummaryHeader(classDoc); - writeMemberSummaryFooter(classDoc); - printedSummaryHeader = true; - } - writer.printInheritedSummaryHeader(this, classDoc); + public Content getMemberSummaryHeader(ClassDoc classDoc, + Content memberSummaryTree) { + memberSummaryTree.addContent(HtmlConstants.START_OF_ENUM_CONSTANT_SUMMARY); + Content memberTree = writer.getMemberTreeHeader(); + writer.addSummaryHeader(this, classDoc, memberTree); + return memberTree; } /** * {@inheritDoc} */ - public void writeInheritedMemberSummary(ClassDoc classDoc, - ProgramElementDoc enumConstant, boolean isFirst, boolean isLast) { - writer.printInheritedSummaryMember(this, classDoc, enumConstant, isFirst); - } - - /** - * Write the inherited enum constant summary footer for the given class. - * - * @param classDoc the class the summary belongs to. - */ - public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) { - writer.printInheritedSummaryFooter(this, classDoc); + public Content getEnumConstantsDetailsTreeHeader(ClassDoc classDoc, + Content memberDetailsTree) { + memberDetailsTree.addContent(HtmlConstants.START_OF_ENUM_CONSTANT_DETAILS); + Content enumConstantsDetailsTree = writer.getMemberTreeHeader(); + enumConstantsDetailsTree.addContent(writer.getMarkerAnchor("enum_constant_detail")); + Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, + writer.enumConstantsDetailsLabel); + enumConstantsDetailsTree.addContent(heading); + return enumConstantsDetailsTree; } /** * {@inheritDoc} */ - public void writeHeader(ClassDoc classDoc, String header) { - writer.println(); - writer.println(""); - writer.println(); - writer.anchor("enum_constant_detail"); - writer.printTableHeadingBackground(header); - writer.println(); + public Content getEnumConstantsTreeHeader(FieldDoc enumConstant, + Content enumConstantsDetailsTree) { + enumConstantsDetailsTree.addContent( + writer.getMarkerAnchor(enumConstant.name())); + Content enumConstantsTree = writer.getMemberTreeHeader(); + Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); + heading.addContent(enumConstant.name()); + enumConstantsTree.addContent(heading); + return enumConstantsTree; } /** * {@inheritDoc} */ - public void writeEnumConstantHeader(FieldDoc enumConstant, boolean isFirst) { - if (! isFirst) { - writer.printMemberHeader(); - writer.println(""); - } - writer.anchor(enumConstant.name()); - writer.h3(); - writer.print(enumConstant.name()); - writer.h3End(); - } - - /** - * {@inheritDoc} - */ - public void writeSignature(FieldDoc enumConstant) { - writer.pre(); - writer.writeAnnotationInfo(enumConstant); - printModifiers(enumConstant); - writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, - enumConstant.type())); - print(' '); + public Content getSignature(FieldDoc enumConstant) { + Content pre = new HtmlTree(HtmlTag.PRE); + writer.addAnnotationInfo(enumConstant, pre); + addModifiers(enumConstant, pre); + Content enumConstantLink = new RawHtml(writer.getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, + enumConstant.type()))); + pre.addContent(enumConstantLink); + pre.addContent(" "); if (configuration().linksource) { - writer.printSrcLink(enumConstant, enumConstant.name()); + Content enumConstantName = new StringContent(enumConstant.name()); + writer.addSrcLink(enumConstant, enumConstantName, pre); } else { - strong(enumConstant.name()); + addName(enumConstant.name(), pre); } - writer.preEnd(); - assert !writer.getMemberDetailsListPrinted(); + return pre; } /** * {@inheritDoc} */ - public void writeDeprecated(FieldDoc enumConstant) { - printDeprecated(enumConstant); + public void addDeprecated(FieldDoc enumConstant, Content enumConstantsTree) { + addDeprecatedInfo(enumConstant, enumConstantsTree); } /** * {@inheritDoc} */ - public void writeComments(FieldDoc enumConstant) { - printComment(enumConstant); + public void addComments(FieldDoc enumConstant, Content enumConstantsTree) { + addComment(enumConstant, enumConstantsTree); } /** * {@inheritDoc} */ - public void writeTags(FieldDoc enumConstant) { - writer.printTags(enumConstant); + public void addTags(FieldDoc enumConstant, Content enumConstantsTree) { + writer.addTagsInfo(enumConstant, enumConstantsTree); } /** * {@inheritDoc} */ - public void writeEnumConstantFooter() { - printMemberFooter(); + public Content getEnumConstantsDetails(Content enumConstantsDetailsTree) { + return getMemberTree(enumConstantsDetailsTree); } /** * {@inheritDoc} */ - public void writeFooter(ClassDoc classDoc) { - //No footer to write for enum constant documentation + public Content getEnumConstants(Content enumConstantsTree, + boolean isLastContent) { + return getMemberTree(enumConstantsTree, isLastContent); } /** @@ -195,75 +156,127 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter return VisibleMemberMap.ENUM_CONSTANTS; } - public void printSummaryLabel() { - writer.printText("doclet.Enum_Constant_Summary"); + /** + * {@inheritDoc} + */ + public void addSummaryLabel(Content memberTree) { + Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, + writer.getResource("doclet.Enum_Constant_Summary")); + memberTree.addContent(label); } - public void printTableSummary() { - writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary", + /** + * {@inheritDoc} + */ + public String getTableSummary() { + return configuration().getText("doclet.Member_Table_Summary", configuration().getText("doclet.Enum_Constant_Summary"), - configuration().getText("doclet.enum_constants"))); + configuration().getText("doclet.enum_constants")); } - public void printSummaryTableHeader(ProgramElementDoc member) { + /** + * {@inheritDoc} + */ + public String getCaption() { + return configuration().getText("doclet.Enum_Constants"); + } + + /** + * {@inheritDoc} + */ + public String[] getSummaryTableHeader(ProgramElementDoc member) { String[] header = new String[] { configuration().getText("doclet.0_and_1", configuration().getText("doclet.Enum_Constant"), configuration().getText("doclet.Description")) }; - writer.summaryTableHeader(header, "col"); + return header; } - public void printSummaryAnchor(ClassDoc cd) { - writer.anchor("enum_constant_summary"); + /** + * {@inheritDoc} + */ + public void addSummaryAnchor(ClassDoc cd, Content memberTree) { + memberTree.addContent(writer.getMarkerAnchor("enum_constant_summary")); } - public void printInheritedSummaryAnchor(ClassDoc cd) { - } // no such - - public void printInheritedSummaryLabel(ClassDoc cd) { - // no such + /** + * {@inheritDoc} + */ + public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { } - protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) { - writer.strong(); - writer.printDocLink(context, (MemberDoc) member, member.name(), false); - writer.strongEnd(); + /** + * {@inheritDoc} + */ + public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { } - protected void writeInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member) { - writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, (MemberDoc)member, - member.name(), false); + /** + * {@inheritDoc} + */ + protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member, + Content tdSummary) { + Content strong = HtmlTree.STRONG(new RawHtml( + writer.getDocLink(context, (MemberDoc) member, member.name(), false))); + Content code = HtmlTree.CODE(strong); + tdSummary.addContent(code); } - protected void printSummaryType(ProgramElementDoc member) { + /** + * {@inheritDoc} + */ + @Override + public void setSummaryColumnStyle(HtmlTree tdTree) { + tdTree.addStyle(HtmlStyle.colOne); + } + + /** + * {@inheritDoc} + */ + protected void addInheritedSummaryLink(ClassDoc cd, + ProgramElementDoc member, Content linksTree) { + } + + /** + * {@inheritDoc} + */ + protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { //Not applicable. } - protected void writeDeprecatedLink(ProgramElementDoc member) { - writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, - (MemberDoc) member, ((FieldDoc)member).qualifiedName(), false); + /** + * {@inheritDoc} + */ + protected Content getDeprecatedLink(ProgramElementDoc member) { + return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, + (MemberDoc) member, ((FieldDoc)member).qualifiedName()); } - protected void printNavSummaryLink(ClassDoc cd, boolean link) { + /** + * {@inheritDoc} + */ + protected Content getNavSummaryLink(ClassDoc cd, boolean link) { if (link) { - writer.printHyperLink("", (cd == null)? - "enum_constant_summary": - "enum_constants_inherited_from_class_" + - configuration().getClassName(cd), - configuration().getText("doclet.navEnum")); + return writer.getHyperLink("", (cd == null)? + "enum_constant_summary": + "enum_constants_inherited_from_class_" + + configuration().getClassName(cd), + writer.getResource("doclet.navEnum")); } else { - writer.printText("doclet.navEnum"); + return writer.getResource("doclet.navEnum"); } } - protected void printNavDetailLink(boolean link) { + /** + * {@inheritDoc} + */ + protected void addNavDetailLink(boolean link, Content liNav) { if (link) { - writer.printHyperLink("", "enum_constant_detail", - configuration().getText("doclet.navEnum")); + liNav.addContent(writer.getHyperLink("", "enum_constant_detail", + writer.getResource("doclet.navEnum"))); } else { - writer.printText("doclet.navEnum"); + liNav.addContent(writer.getResource("doclet.navEnum")); } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java index 6d9cc1aa65b..ed442aaf731 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ package com.sun.tools.doclets.formats.html; import java.io.*; import com.sun.javadoc.*; +import com.sun.tools.doclets.formats.html.markup.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.util.*; @@ -42,8 +43,6 @@ import com.sun.tools.doclets.internal.toolkit.util.*; public class FieldWriterImpl extends AbstractMemberWriter implements FieldWriter, MemberSummaryWriter { - private boolean printedSummaryHeader = false; - public FieldWriterImpl(SubWriterHolderWriter writer, ClassDoc classdoc) { super(writer, classdoc); } @@ -53,177 +52,118 @@ public class FieldWriterImpl extends AbstractMemberWriter } /** - * Write the fields summary header for the given class. - * - * @param classDoc the class the summary belongs to. + * {@inheritDoc} */ - public void writeMemberSummaryHeader(ClassDoc classDoc) { - printedSummaryHeader = true; - writer.println(""); - writer.println(); - writer.printSummaryHeader(this, classDoc); - } - - /** - * Write the fields summary footer for the given class. - * - * @param classDoc the class the summary belongs to. - */ - public void writeMemberSummaryFooter(ClassDoc classDoc) { - writer.tableEnd(); - writer.space(); - } - - /** - * Write the inherited fields summary header for the given class. - * - * @param classDoc the class the summary belongs to. - */ - public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) { - if(! printedSummaryHeader){ - //We don't want inherited summary to not be under heading. - writeMemberSummaryHeader(classDoc); - writeMemberSummaryFooter(classDoc); - printedSummaryHeader = true; - } - writer.printInheritedSummaryHeader(this, classDoc); + public Content getMemberSummaryHeader(ClassDoc classDoc, + Content memberSummaryTree) { + memberSummaryTree.addContent(HtmlConstants.START_OF_FIELD_SUMMARY); + Content memberTree = writer.getMemberTreeHeader(); + writer.addSummaryHeader(this, classDoc, memberTree); + return memberTree; } /** * {@inheritDoc} */ - public void writeInheritedMemberSummary(ClassDoc classDoc, - ProgramElementDoc field, boolean isFirst, boolean isLast) { - writer.printInheritedSummaryMember(this, classDoc, field, isFirst); + public Content getFieldDetailsTreeHeader(ClassDoc classDoc, + Content memberDetailsTree) { + memberDetailsTree.addContent(HtmlConstants.START_OF_FIELD_DETAILS); + Content fieldDetailsTree = writer.getMemberTreeHeader(); + fieldDetailsTree.addContent(writer.getMarkerAnchor("field_detail")); + Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, + writer.fieldDetailsLabel); + fieldDetailsTree.addContent(heading); + return fieldDetailsTree; } /** - * Write the inherited fields summary footer for the given class. - * - * @param classDoc the class the summary belongs to. + * {@inheritDoc} */ - public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) { - writer.printInheritedSummaryFooter(this, classDoc); + public Content getFieldDocTreeHeader(FieldDoc field, + Content fieldDetailsTree) { + fieldDetailsTree.addContent( + writer.getMarkerAnchor(field.name())); + Content fieldDocTree = writer.getMemberTreeHeader(); + Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); + heading.addContent(field.name()); + fieldDocTree.addContent(heading); + return fieldDocTree; } /** - * Write the header for the field documentation. - * - * @param classDoc the class that the fields belong to. + * {@inheritDoc} */ - public void writeHeader(ClassDoc classDoc, String header) { - writer.println(); - writer.println(""); - writer.println(); - writer.anchor("field_detail"); - writer.printTableHeadingBackground(header); - writer.println(); - } - - /** - * Write the field header for the given field. - * - * @param field the field being documented. - * @param isFirst the flag to indicate whether or not the field is the - * first to be documented. - */ - public void writeFieldHeader(FieldDoc field, boolean isFirst) { - if (! isFirst) { - writer.printMemberHeader(); - writer.println(""); - } - writer.anchor(field.name()); - writer.h3(); - writer.print(field.name()); - writer.h3End(); - } - - /** - * Write the signature for the given field. - * - * @param field the field being documented. - */ - public void writeSignature(FieldDoc field) { - writer.pre(); - writer.writeAnnotationInfo(field); - printModifiers(field); - writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, - field.type())); - print(' '); + public Content getSignature(FieldDoc field) { + Content pre = new HtmlTree(HtmlTag.PRE); + writer.addAnnotationInfo(field, pre); + addModifiers(field, pre); + Content fieldlink = new RawHtml(writer.getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, + field.type()))); + pre.addContent(fieldlink); + pre.addContent(" "); if (configuration().linksource) { - writer.printSrcLink(field, field.name()); + Content fieldName = new StringContent(field.name()); + writer.addSrcLink(field, fieldName, pre); } else { - strong(field.name()); + addName(field.name(), pre); } - writer.preEnd(); - assert !writer.getMemberDetailsListPrinted(); + return pre; } /** - * Write the deprecated output for the given field. - * - * @param field the field being documented. + * {@inheritDoc} */ - public void writeDeprecated(FieldDoc field) { - printDeprecated(field); + public void addDeprecated(FieldDoc field, Content fieldDocTree) { + addDeprecatedInfo(field, fieldDocTree); } /** - * Write the comments for the given field. - * - * @param field the field being documented. + * {@inheritDoc} */ - public void writeComments(FieldDoc field) { + public void addComments(FieldDoc field, Content fieldDocTree) { ClassDoc holder = field.containingClass(); if (field.inlineTags().length > 0) { - writer.printMemberDetailsListStartTag(); if (holder.equals(classdoc) || - (! (holder.isPublic() || Util.isLinkable(holder, configuration())))) { - writer.dd(); - writer.printInlineComment(field); - writer.ddEnd(); + (! (holder.isPublic() || Util.isLinkable(holder, configuration())))) { + writer.addInlineComment(field, fieldDocTree); } else { - String classlink = writer.codeText( - writer.getDocLink(LinkInfoImpl.CONTEXT_FIELD_DOC_COPY, + Content link = new RawHtml( + writer.getDocLink(LinkInfoImpl.CONTEXT_FIELD_DOC_COPY, holder, field, holder.isIncluded() ? holder.typeName() : holder.qualifiedTypeName(), - false)); - writer.dd(); - writer.strong(configuration().getText(holder.isClass()? - "doclet.Description_From_Class" : - "doclet.Description_From_Interface", classlink)); - writer.ddEnd(); - writer.dd(); - writer.printInlineComment(field); - writer.ddEnd(); + false)); + Content codeLink = HtmlTree.CODE(link); + Content strong = HtmlTree.STRONG(holder.isClass()? + writer.descfrmClassLabel : writer.descfrmInterfaceLabel); + strong.addContent(writer.getSpace()); + strong.addContent(codeLink); + fieldDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, strong)); + writer.addInlineComment(field, fieldDocTree); } } } /** - * Write the tag output for the given field. - * - * @param field the field being documented. + * {@inheritDoc} */ - public void writeTags(FieldDoc field) { - writer.printTags(field); + public void addTags(FieldDoc field, Content fieldDocTree) { + writer.addTagsInfo(field, fieldDocTree); } /** - * Write the field footer. + * {@inheritDoc} */ - public void writeFieldFooter() { - printMemberFooter(); + public Content getFieldDetails(Content fieldDetailsTree) { + return getMemberTree(fieldDetailsTree); } /** - * Write the footer for the field documentation. - * - * @param classDoc the class that the fields belong to. + * {@inheritDoc} */ - public void writeFooter(ClassDoc classDoc) { - //No footer to write for field documentation + public Content getFieldDoc(Content fieldDocTree, + boolean isLastContent) { + return getMemberTree(fieldDocTree, isLastContent); } /** @@ -237,85 +177,136 @@ public class FieldWriterImpl extends AbstractMemberWriter return VisibleMemberMap.FIELDS; } - public void printSummaryLabel() { - writer.printText("doclet.Field_Summary"); + /** + * {@inheritDoc} + */ + public void addSummaryLabel(Content memberTree) { + Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, + writer.getResource("doclet.Field_Summary")); + memberTree.addContent(label); } - public void printTableSummary() { - writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary", + /** + * {@inheritDoc} + */ + public String getTableSummary() { + return configuration().getText("doclet.Member_Table_Summary", configuration().getText("doclet.Field_Summary"), - configuration().getText("doclet.fields"))); + configuration().getText("doclet.fields")); } - public void printSummaryTableHeader(ProgramElementDoc member) { + /** + * {@inheritDoc} + */ + public String getCaption() { + return configuration().getText("doclet.Fields"); + } + + /** + * {@inheritDoc} + */ + public String[] getSummaryTableHeader(ProgramElementDoc member) { String[] header = new String[] { writer.getModifierTypeHeader(), configuration().getText("doclet.0_and_1", configuration().getText("doclet.Field"), configuration().getText("doclet.Description")) }; - writer.summaryTableHeader(header, "col"); + return header; } - public void printSummaryAnchor(ClassDoc cd) { - writer.anchor("field_summary"); + /** + * {@inheritDoc} + */ + public void addSummaryAnchor(ClassDoc cd, Content memberTree) { + memberTree.addContent(writer.getMarkerAnchor("field_summary")); } - public void printInheritedSummaryAnchor(ClassDoc cd) { - writer.anchor("fields_inherited_from_class_" + configuration().getClassName(cd)); + /** + * {@inheritDoc} + */ + public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { + inheritedTree.addContent(writer.getMarkerAnchor( + "fields_inherited_from_class_" + configuration().getClassName(cd))); } - public void printInheritedSummaryLabel(ClassDoc cd) { - String classlink = writer.getPreQualifiedClassLink( - LinkInfoImpl.CONTEXT_MEMBER, cd, false); - writer.strong(); - String key = cd.isClass()? - "doclet.Fields_Inherited_From_Class" : - "doclet.Fields_Inherited_From_Interface"; - writer.printText(key, classlink); - writer.strongEnd(); + /** + * {@inheritDoc} + */ + public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { + Content classLink = new RawHtml(writer.getPreQualifiedClassLink( + LinkInfoImpl.CONTEXT_MEMBER, cd, false)); + Content label = new StringContent(cd.isClass() ? + configuration().getText("doclet.Fields_Inherited_From_Class") : + configuration().getText("doclet.Fields_Inherited_From_Interface")); + Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING, + label); + labelHeading.addContent(writer.getSpace()); + labelHeading.addContent(classLink); + inheritedTree.addContent(labelHeading); } - protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) { - writer.strong(); - writer.printDocLink(context, cd , (MemberDoc) member, member.name(), false); - writer.strongEnd(); + /** + * {@inheritDoc} + */ + protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member, + Content tdSummary) { + Content strong = HtmlTree.STRONG(new RawHtml( + writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false))); + Content code = HtmlTree.CODE(strong); + tdSummary.addContent(code); } - protected void writeInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member) { - writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc)member, - member.name(), false); + /** + * {@inheritDoc} + */ + protected void addInheritedSummaryLink(ClassDoc cd, + ProgramElementDoc member, Content linksTree) { + linksTree.addContent(new RawHtml( + writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc)member, + member.name(), false))); } - protected void printSummaryType(ProgramElementDoc member) { + /** + * {@inheritDoc} + */ + protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { FieldDoc field = (FieldDoc)member; - printModifierAndType(field, field.type()); + addModifierAndType(field, field.type(), tdSummaryType); } - protected void writeDeprecatedLink(ProgramElementDoc member) { - writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, - (MemberDoc) member, ((FieldDoc)member).qualifiedName(), false); + /** + * {@inheritDoc} + */ + protected Content getDeprecatedLink(ProgramElementDoc member) { + return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, + (MemberDoc) member, ((FieldDoc)member).qualifiedName()); } - protected void printNavSummaryLink(ClassDoc cd, boolean link) { + /** + * {@inheritDoc} + */ + protected Content getNavSummaryLink(ClassDoc cd, boolean link) { if (link) { - writer.printHyperLink("", (cd == null)? - "field_summary": - "fields_inherited_from_class_" + - configuration().getClassName(cd), - configuration().getText("doclet.navField")); + return writer.getHyperLink("", (cd == null)? + "field_summary": + "fields_inherited_from_class_" + + configuration().getClassName(cd), + writer.getResource("doclet.navField")); } else { - writer.printText("doclet.navField"); + return writer.getResource("doclet.navField"); } } - protected void printNavDetailLink(boolean link) { + /** + * {@inheritDoc} + */ + protected void addNavDetailLink(boolean link, Content liNav) { if (link) { - writer.printHyperLink("", "field_detail", - configuration().getText("doclet.navField")); + liNav.addContent(writer.getHyperLink("", "field_detail", + writer.getResource("doclet.navField"))); } else { - writer.printText("doclet.navField"); + liNav.addContent(writer.getResource("doclet.navField")); } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java index 9d11d9e262e..aac67c9385c 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +25,10 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.util.*; import java.io.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * Generate the documentation in the Html "frame" format in the browser. The @@ -47,6 +49,8 @@ public class FrameOutputWriter extends HtmlDocletWriter { */ int noOfPackages; + private final String SCROLL_YES = "yes"; + /** * Constructor to construct FrameOutputWriter object. * @@ -86,82 +90,93 @@ public class FrameOutputWriter extends HtmlDocletWriter { * as well as warning if browser is not supporting the Html frames. */ protected void generateFrameFile() { + Content frameset = getFrameDetails(); if (configuration.windowtitle.length() > 0) { - printFramesetHeader(configuration.windowtitle, configuration.notimestamp); + printFramesetDocument(configuration.windowtitle, configuration.notimestamp, + frameset); } else { - printFramesetHeader(configuration.getText("doclet.Generated_Docs_Untitled"), - configuration.notimestamp); + printFramesetDocument(configuration.getText("doclet.Generated_Docs_Untitled"), + configuration.notimestamp, frameset); } - printFrameDetails(); - printFrameFooter(); } /** - * Generate the code for issueing the warning for a non-frame capable web + * Add the code for issueing the warning for a non-frame capable web * client. Also provide links to the non-frame version documentation. + * + * @param contentTree the content tree to which the non-frames information will be added */ - protected void printFrameWarning() { - noFrames(); - h2(); - printText("doclet.Frame_Alert"); - h2End(); - p(); - printText("doclet.Frame_Warning_Message"); - br(); - printText("doclet.Link_To"); - printHyperLink(configuration.topFile, - configuration.getText("doclet.Non_Frame_Version")); - println(""); - noFramesEnd(); + protected void addFrameWarning(Content contentTree) { + Content noframes = new HtmlTree(HtmlTag.NOFRAMES); + Content noScript = HtmlTree.NOSCRIPT( + HtmlTree.DIV(getResource("doclet.No_Script_Message"))); + noframes.addContent(noScript); + Content noframesHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Frame_Alert")); + noframes.addContent(noframesHead); + Content p = HtmlTree.P(getResource("doclet.Frame_Warning_Message")); + noframes.addContent(p); + noframes.addContent(new HtmlTree(HtmlTag.BR)); + noframes.addContent(getResource("doclet.Link_To")); + Content link = getHyperLink(configuration.topFile, + getResource("doclet.Non_Frame_Version")); + noframes.addContent(link); + contentTree.addContent(noframes); } /** - * Print the frame sizes and their contents. + * Get the frame sizes and their contents. + * + * @return a content tree for the frame details */ - protected void printFrameDetails() { - // title attribute intentionally made empty so - // 508 tests will not flag it as missing - frameSet("cols=\"20%,80%\" title=\"\" onLoad=\"top.loadFrames()\""); + protected Content getFrameDetails() { + HtmlTree frameset = HtmlTree.FRAMESET("20%,80%", null, "Documentation frame", + "top.loadFrames()"); if (noOfPackages <= 1) { - printAllClassesFrameTag(); + addAllClassesFrameTag(frameset); } else if (noOfPackages > 1) { - frameSet("rows=\"30%,70%\" title=\"\" onLoad=\"top.loadFrames()\""); - printAllPackagesFrameTag(); - printAllClassesFrameTag(); - frameSetEnd(); + HtmlTree leftFrameset = HtmlTree.FRAMESET(null, "30%,70%", "Left frames", + "top.loadFrames()"); + addAllPackagesFrameTag(leftFrameset); + addAllClassesFrameTag(leftFrameset); + frameset.addContent(leftFrameset); } - printClassFrameTag(); - printFrameWarning(); - frameSetEnd(); + addClassFrameTag(frameset); + addFrameWarning(frameset); + return frameset; } /** - * Print the FRAME tag for the frame that lists all packages + * Add the FRAME tag for the frame that lists all packages. + * + * @param contentTree the content tree to which the information will be added */ - private void printAllPackagesFrameTag() { - frame("src=\"overview-frame.html\" name=\"packageListFrame\"" - + " title=\"" + configuration.getText("doclet.All_Packages") + "\""); + private void addAllPackagesFrameTag(Content contentTree) { + HtmlTree frame = HtmlTree.FRAME("overview-frame.html", "packageListFrame", + configuration.getText("doclet.All_Packages")); + contentTree.addContent(frame); } /** - * Print the FRAME tag for the frame that lists all classes + * Add the FRAME tag for the frame that lists all classes. + * + * @param contentTree the content tree to which the information will be added */ - private void printAllClassesFrameTag() { - frame("src=\"" + "allclasses-frame.html" + "\"" - + " name=\"packageFrame\"" - + " title=\"" + configuration.getText("doclet.All_classes_and_interfaces") - + "\""); + private void addAllClassesFrameTag(Content contentTree) { + HtmlTree frame = HtmlTree.FRAME("allclasses-frame.html", "packageFrame", + configuration.getText("doclet.All_classes_and_interfaces")); + contentTree.addContent(frame); } /** - * Print the FRAME tag for the frame that describes the class in detail + * Add the FRAME tag for the frame that describes the class in detail. + * + * @param contentTree the content tree to which the information will be added */ - private void printClassFrameTag() { - frame("src=\"" + configuration.topFile + "\"" - + " name=\"classFrame\"" - + " title=\"" - + configuration.getText("doclet.Package_class_and_interface_descriptions") - + "\" scrolling=\"yes\""); + private void addClassFrameTag(Content contentTree) { + HtmlTree frame = HtmlTree.FRAME(configuration.topFile, "classFrame", + configuration.getText("doclet.Package_class_and_interface_descriptions"), + SCROLL_YES); + contentTree.addContent(frame); } - } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java index 2c6eaca5941..e162075a636 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +25,10 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.util.*; import java.io.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * Generate the Help File for the generated API documentation. The help file @@ -72,159 +74,242 @@ public class HelpWriter extends HtmlDocletWriter { * Generate the help file contents. */ protected void generateHelpFile() { - printHtmlHeader(configuration.getText("doclet.Window_Help_title"), - null, true); - printTop(); - navLinks(true); hr(); - - printHelpFileContents(); - - navLinks(false); - printBottom(); - printBodyHtmlEnd(); + String title = configuration.getText("doclet.Window_Help_title"); + Content body = getBody(true, getWindowTitle(title)); + addTop(body); + addNavLinks(true, body); + addHelpFileContents(body); + addNavLinks(false, body); + addBottom(body); + printHtmlDocument(null, true, body); } /** - * Print the help file contents from the resource file. While generating the + * Add the help file contents from the resource file to the content tree. While adding the * help file contents it also keeps track of user options. If "-notree" - * is used, then the "overview-tree.html" will not get generated and hence - * help information also will not get generated. + * is used, then the "overview-tree.html" will not get added and hence + * help information also will not get added. + * + * @param contentTree the content tree to which the help file contents will be added */ - protected void printHelpFileContents() { - center(); h1(); printText("doclet.Help_line_1"); h1End(); centerEnd(); - printText("doclet.Help_line_2"); + protected void addHelpFileContents(Content contentTree) { + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title, + getResource("doclet.Help_line_1")); + Content div = HtmlTree.DIV(HtmlStyle.header, heading); + Content line2 = HtmlTree.P(HtmlStyle.subTitle, + getResource("doclet.Help_line_2")); + div.addContent(line2); + contentTree.addContent(div); + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.blockList); if (configuration.createoverview) { - h3(); printText("doclet.Overview"); h3End(); - blockquote(); p(); - printText("doclet.Help_line_3", - getHyperLink("overview-summary.html", - configuration.getText("doclet.Overview"))); - blockquoteEnd(); + Content overviewHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Overview")); + Content liOverview = HtmlTree.LI(HtmlStyle.blockList, overviewHeading); + Content line3 = getResource("doclet.Help_line_3", + getHyperLinkString("overview-summary.html", + configuration.getText("doclet.Overview"))); + Content overviewPara = HtmlTree.P(line3); + liOverview.addContent(overviewPara); + ul.addContent(liOverview); } - h3(); printText("doclet.Package"); h3End(); - blockquote(); p(); printText("doclet.Help_line_4"); - ul(); - li(); printText("doclet.Interfaces_Italic"); - li(); printText("doclet.Classes"); - li(); printText("doclet.Enums"); - li(); printText("doclet.Exceptions"); - li(); printText("doclet.Errors"); - li(); printText("doclet.AnnotationTypes"); - ulEnd(); - blockquoteEnd(); - h3(); printText("doclet.Help_line_5"); h3End(); - blockquote(); p(); printText("doclet.Help_line_6"); - ul(); - li(); printText("doclet.Help_line_7"); - li(); printText("doclet.Help_line_8"); - li(); printText("doclet.Help_line_9"); - li(); printText("doclet.Help_line_10"); - li(); printText("doclet.Help_line_11"); - li(); printText("doclet.Help_line_12"); - p(); - li(); printText("doclet.Nested_Class_Summary"); - li(); printText("doclet.Field_Summary"); - li(); printText("doclet.Constructor_Summary"); - li(); printText("doclet.Method_Summary"); - p(); - li(); printText("doclet.Field_Detail"); - li(); printText("doclet.Constructor_Detail"); - li(); printText("doclet.Method_Detail"); - ulEnd(); - printText("doclet.Help_line_13"); - blockquoteEnd(); - + Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Package")); + Content liPackage = HtmlTree.LI(HtmlStyle.blockList, packageHead); + Content line4 = getResource("doclet.Help_line_4"); + Content packagePara = HtmlTree.P(line4); + liPackage.addContent(packagePara); + HtmlTree ulPackage = new HtmlTree(HtmlTag.UL); + ulPackage.addContent(HtmlTree.LI( + getResource("doclet.Interfaces_Italic"))); + ulPackage.addContent(HtmlTree.LI( + getResource("doclet.Classes"))); + ulPackage.addContent(HtmlTree.LI( + getResource("doclet.Enums"))); + ulPackage.addContent(HtmlTree.LI( + getResource("doclet.Exceptions"))); + ulPackage.addContent(HtmlTree.LI( + getResource("doclet.Errors"))); + ulPackage.addContent(HtmlTree.LI( + getResource("doclet.AnnotationTypes"))); + liPackage.addContent(ulPackage); + ul.addContent(liPackage); + Content classHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Help_line_5")); + Content liClass = HtmlTree.LI(HtmlStyle.blockList, classHead); + Content line6 = getResource("doclet.Help_line_6"); + Content classPara = HtmlTree.P(line6); + liClass.addContent(classPara); + HtmlTree ul1 = new HtmlTree(HtmlTag.UL); + ul1.addContent(HtmlTree.LI( + getResource("doclet.Help_line_7"))); + ul1.addContent(HtmlTree.LI( + getResource("doclet.Help_line_8"))); + ul1.addContent(HtmlTree.LI( + getResource("doclet.Help_line_9"))); + ul1.addContent(HtmlTree.LI( + getResource("doclet.Help_line_10"))); + ul1.addContent(HtmlTree.LI( + getResource("doclet.Help_line_11"))); + ul1.addContent(HtmlTree.LI( + getResource("doclet.Help_line_12"))); + liClass.addContent(ul1); + HtmlTree ul2 = new HtmlTree(HtmlTag.UL); + ul2.addContent(HtmlTree.LI( + getResource("doclet.Nested_Class_Summary"))); + ul2.addContent(HtmlTree.LI( + getResource("doclet.Field_Summary"))); + ul2.addContent(HtmlTree.LI( + getResource("doclet.Constructor_Summary"))); + ul2.addContent(HtmlTree.LI( + getResource("doclet.Method_Summary"))); + liClass.addContent(ul2); + HtmlTree ul3 = new HtmlTree(HtmlTag.UL); + ul3.addContent(HtmlTree.LI( + getResource("doclet.Field_Detail"))); + ul3.addContent(HtmlTree.LI( + getResource("doclet.Constructor_Detail"))); + ul3.addContent(HtmlTree.LI( + getResource("doclet.Method_Detail"))); + liClass.addContent(ul3); + Content line13 = getResource("doclet.Help_line_13"); + Content para = HtmlTree.P(line13); + liClass.addContent(para); + ul.addContent(liClass); //Annotation Types - blockquoteEnd(); - h3(); printText("doclet.AnnotationType"); h3End(); - blockquote(); p(); printText("doclet.Help_annotation_type_line_1"); - ul(); - li(); printText("doclet.Help_annotation_type_line_2"); - li(); printText("doclet.Help_annotation_type_line_3"); - li(); printText("doclet.Annotation_Type_Required_Member_Summary"); - li(); printText("doclet.Annotation_Type_Optional_Member_Summary"); - li(); printText("doclet.Annotation_Type_Member_Detail"); - ulEnd(); - blockquoteEnd(); - + Content aHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.AnnotationType")); + Content liAnnotation = HtmlTree.LI(HtmlStyle.blockList, aHead); + Content aline1 = getResource("doclet.Help_annotation_type_line_1"); + Content aPara = HtmlTree.P(aline1); + liAnnotation.addContent(aPara); + HtmlTree aul = new HtmlTree(HtmlTag.UL); + aul.addContent(HtmlTree.LI( + getResource("doclet.Help_annotation_type_line_2"))); + aul.addContent(HtmlTree.LI( + getResource("doclet.Help_annotation_type_line_3"))); + aul.addContent(HtmlTree.LI( + getResource("doclet.Annotation_Type_Required_Member_Summary"))); + aul.addContent(HtmlTree.LI( + getResource("doclet.Annotation_Type_Optional_Member_Summary"))); + aul.addContent(HtmlTree.LI( + getResource("doclet.Annotation_Type_Member_Detail"))); + liAnnotation.addContent(aul); + ul.addContent(liAnnotation); //Enums - blockquoteEnd(); - h3(); printText("doclet.Enum"); h3End(); - blockquote(); p(); printText("doclet.Help_enum_line_1"); - ul(); - li(); printText("doclet.Help_enum_line_2"); - li(); printText("doclet.Help_enum_line_3"); - li(); printText("doclet.Enum_Constant_Summary"); - li(); printText("doclet.Enum_Constant_Detail"); - ulEnd(); - blockquoteEnd(); - + Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Enum")); + Content liEnum = HtmlTree.LI(HtmlStyle.blockList, enumHead); + Content eline1 = getResource("doclet.Help_enum_line_1"); + Content enumPara = HtmlTree.P(eline1); + liEnum.addContent(enumPara); + HtmlTree eul = new HtmlTree(HtmlTag.UL); + eul.addContent(HtmlTree.LI( + getResource("doclet.Help_enum_line_2"))); + eul.addContent(HtmlTree.LI( + getResource("doclet.Help_enum_line_3"))); + eul.addContent(HtmlTree.LI( + getResource("doclet.Enum_Constant_Summary"))); + eul.addContent(HtmlTree.LI( + getResource("doclet.Enum_Constant_Detail"))); + liEnum.addContent(eul); + ul.addContent(liEnum); if (configuration.classuse) { - h3(); printText("doclet.Help_line_14"); h3End(); - blockquote(); - printText("doclet.Help_line_15"); - blockquoteEnd(); + Content useHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Help_line_14")); + Content liUse = HtmlTree.LI(HtmlStyle.blockList, useHead); + Content line15 = getResource("doclet.Help_line_15"); + Content usePara = HtmlTree.P(line15); + liUse.addContent(usePara); + ul.addContent(liUse); } if (configuration.createtree) { - h3(); printText("doclet.Help_line_16"); h3End(); - blockquote(); - printText("doclet.Help_line_17_with_tree_link", - getHyperLink("overview-tree.html", - configuration.getText("doclet.Class_Hierarchy"))); - ul(); - li(); printText("doclet.Help_line_18"); - li(); printText("doclet.Help_line_19"); - ulEnd(); - blockquoteEnd(); + Content treeHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Help_line_16")); + Content liTree = HtmlTree.LI(HtmlStyle.blockList, treeHead); + Content line17 = getResource("doclet.Help_line_17_with_tree_link", + getHyperLinkString("overview-tree.html", + configuration.getText("doclet.Class_Hierarchy"))); + Content treePara = HtmlTree.P(line17); + liTree.addContent(treePara); + HtmlTree tul = new HtmlTree(HtmlTag.UL); + tul.addContent(HtmlTree.LI( + getResource("doclet.Help_line_18"))); + tul.addContent(HtmlTree.LI( + getResource("doclet.Help_line_19"))); + liTree.addContent(tul); + ul.addContent(liTree); } if (!(configuration.nodeprecatedlist || configuration.nodeprecated)) { - h3(); printText("doclet.Deprecated_API"); h3End(); - blockquote(); - printText("doclet.Help_line_20_with_deprecated_api_link", - getHyperLink("deprecated-list.html", - configuration.getText("doclet.Deprecated_API"))); - blockquoteEnd(); + Content dHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Deprecated_API")); + Content liDeprecated = HtmlTree.LI(HtmlStyle.blockList, dHead); + Content line20 = getResource("doclet.Help_line_20_with_deprecated_api_link", + getHyperLinkString("deprecated-list.html", + configuration.getText("doclet.Deprecated_API"))); + Content dPara = HtmlTree.P(line20); + liDeprecated.addContent(dPara); + ul.addContent(liDeprecated); } if (configuration.createindex) { String indexlink; if (configuration.splitindex) { - indexlink = getHyperLink("index-files/index-1.html", - configuration.getText("doclet.Index")); + indexlink = getHyperLinkString("index-files/index-1.html", + configuration.getText("doclet.Index")); } else { - indexlink = getHyperLink("index-all.html", - configuration.getText("doclet.Index")); + indexlink = getHyperLinkString("index-all.html", + configuration.getText("doclet.Index")); } - h3(); printText("doclet.Help_line_21"); h3End(); - blockquote(); - printText("doclet.Help_line_22", indexlink); - blockquoteEnd(); + Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Help_line_21")); + Content liIndex = HtmlTree.LI(HtmlStyle.blockList, indexHead); + Content line22 = getResource("doclet.Help_line_22", indexlink); + Content indexPara = HtmlTree.P(line22); + liIndex.addContent(indexPara); + ul.addContent(liIndex); } - h3(); printText("doclet.Help_line_23"); h3End(); - printText("doclet.Help_line_24"); - h3(); printText("doclet.Help_line_25"); h3End(); - printText("doclet.Help_line_26"); p(); - - h3(); printText("doclet.Serialized_Form"); h3End(); - printText("doclet.Help_line_27"); p(); - - h3(); printText("doclet.Constants_Summary"); h3End(); - printText("doclet.Help_line_28"); p(); - - font("-1"); em(); - printText("doclet.Help_line_29"); - emEnd(); fontEnd(); br(); - hr(); + Content prevHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Help_line_23")); + Content liPrev = HtmlTree.LI(HtmlStyle.blockList, prevHead); + Content line24 = getResource("doclet.Help_line_24"); + Content prevPara = HtmlTree.P(line24); + liPrev.addContent(prevPara); + ul.addContent(liPrev); + Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Help_line_25")); + Content liFrame = HtmlTree.LI(HtmlStyle.blockList, frameHead); + Content line26 = getResource("doclet.Help_line_26"); + Content framePara = HtmlTree.P(line26); + liFrame.addContent(framePara); + ul.addContent(liFrame); + Content sHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Serialized_Form")); + Content liSerial = HtmlTree.LI(HtmlStyle.blockList, sHead); + Content line27 = getResource("doclet.Help_line_27"); + Content serialPara = HtmlTree.P(line27); + liSerial.addContent(serialPara); + ul.addContent(liSerial); + Content constHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + getResource("doclet.Constants_Summary")); + Content liConst = HtmlTree.LI(HtmlStyle.blockList, constHead); + Content line28 = getResource("doclet.Help_line_28"); + Content constPara = HtmlTree.P(line28); + liConst.addContent(constPara); + ul.addContent(liConst); + Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul); + Content line29 = HtmlTree.EM(getResource("doclet.Help_line_29")); + divContent.addContent(line29); + contentTree.addContent(divContent); } /** - * Highlight the word "Help" in the navigation bar as this is the help file. + * Get the help label. + * + * @return a content tree for the help label */ - protected void navLinkHelp() { - navCellRevStart(); - fontStyle("NavBarFont1Rev"); - strongText("doclet.Help"); - fontEnd(); - navCellEnd(); + protected Content getNavLinkHelp() { + Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, helpLabel); + return li; } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java index b70fc9792be..8c4d1f315b4 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -144,8 +144,12 @@ public class HtmlDoclet extends AbstractDoclet { !configuration.nohelp) { HelpWriter.generate(configuration); } + // If a stylesheet file is not specified, copy the default stylesheet + // and replace newline with platform-specific newline. if (configuration.stylesheetfile.length() == 0) { - StylesheetWriter.generate(configuration); + Util.copyFile(configuration, "stylesheet.css", Util.RESOURCESDIR, + (configdestdir.isEmpty()) ? + System.getProperty("user.dir") : configdestdir, false, true); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java index 5659f496efd..9e315fa47f5 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 @@ public class HtmlDocletWriter extends HtmlDocWriter { */ public ConfigurationImpl configuration; + /** + * To check whether annotation heading is printed or not. + */ + protected boolean printedAnnotationHeading = false; + /** * Constructor to construct the HtmlStandardWriter object. * @@ -169,7 +174,7 @@ public class HtmlDocletWriter extends HtmlDocWriter { // Append slash if next character is not a slash if (relativepathNoSlash.length() > 0 && previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') { - buf.append(DirectoryManager.URL_FILE_SEPERATOR); + buf.append(DirectoryManager.URL_FILE_SEPARATOR); } } return buf.toString(); @@ -192,17 +197,47 @@ public class HtmlDocletWriter extends HtmlDocWriter { println(" "); scriptEnd(); noScript(); - println(" " + getHyperLink(link, where, label, strong, "", "", target)); + println(" " + getHyperLinkString(link, where, label, strong, "", "", target)); noScriptEnd(); println(DocletConstants.NL); } - private void printMethodInfo(MethodDoc method) { + /** + * Get the script to show or hide the All classes link. + * + * @param id id of the element to show or hide + * @return a content tree for the script + */ + public Content getAllClassesLinkScript(String id) { + HtmlTree script = new HtmlTree(HtmlTag.SCRIPT); + script.addAttr(HtmlAttr.TYPE, "text/javascript"); + String scriptCode = "" + DocletConstants.NL; + Content scriptContent = new RawHtml(scriptCode); + script.addContent(scriptContent); + Content div = HtmlTree.DIV(script); + return div; + } + + /** + * Add method information. + * + * @param method the method to be documented + * @param dl the content tree to which the method information will be added + */ + private void addMethodInfo(MethodDoc method, Content dl) { ClassDoc[] intfacs = method.containingClass().interfaces(); MethodDoc overriddenMethod = method.overriddenMethod(); // Check whether there is any implementation or overridden info to be @@ -211,46 +246,38 @@ public class HtmlDocletWriter extends HtmlDocWriter { if ((intfacs.length > 0 && new ImplementedMethods(method, this.configuration).build().length > 0) || overriddenMethod != null) { - printMemberDetailsListStartTag(); - dd(); - printTagsInfoHeader(); - MethodWriterImpl.printImplementsInfo(this, method); + MethodWriterImpl.addImplementsInfo(this, method, dl); if (overriddenMethod != null) { - MethodWriterImpl.printOverridden(this, - method.overriddenType(), overriddenMethod); + MethodWriterImpl.addOverridden(this, + method.overriddenType(), overriddenMethod, dl); } - printTagsInfoFooter(); - ddEnd(); } } - protected void printTags(Doc doc) { - if(configuration.nocomment){ + /** + * Adds the tags information. + * + * @param doc the doc for which the tags will be generated + * @param htmltree the documentation tree to which the tags will be added + */ + protected void addTagsInfo(Doc doc, Content htmltree) { + if (configuration.nocomment) { return; } + Content dl = new HtmlTree(HtmlTag.DL); if (doc instanceof MethodDoc) { - printMethodInfo((MethodDoc) doc); + addMethodInfo((MethodDoc) doc, dl); } TagletOutputImpl output = new TagletOutputImpl(""); TagletWriter.genTagOuput(configuration.tagletManager, doc, configuration.tagletManager.getCustomTags(doc), getTagletWriterInstance(false), output); String outputString = output.toString().trim(); - // For RootDoc, ClassDoc and PackageDoc, this section is not the - // definition description but the start of definition list. if (!outputString.isEmpty()) { - if (!(doc instanceof RootDoc || doc instanceof ClassDoc || - doc instanceof PackageDoc)) { - printMemberDetailsListStartTag(); - dd(); - } - printTagsInfoHeader(); - print(outputString); - printTagsInfoFooter(); - if (!(doc instanceof RootDoc || doc instanceof ClassDoc || - doc instanceof PackageDoc)) - ddEnd(); + Content resultString = new RawHtml(outputString); + dl.addContent(resultString); } + htmltree.addContent(dl); } /** @@ -286,17 +313,16 @@ public class HtmlDocletWriter extends HtmlDocWriter { } /** - * Print Package link, with target frame. + * Get Package link, with target frame. * - * @param pd The link will be to the "package-summary.html" page for this - * package. - * @param target Name of the target frame. - * @param label Tag for the link. + * @param pd The link will be to the "package-summary.html" page for this package + * @param target name of the target frame + * @param label tag for the link + * @return a content for the target package link */ - public void printTargetPackageLink(PackageDoc pd, String target, - String label) { - print(getHyperLink(pathString(pd, "package-summary.html"), "", label, - false, "", "", target)); + public Content getTargetPackageLink(PackageDoc pd, String target, + Content label) { + return getHyperLink(pathString(pd, "package-summary.html"), "", label, "", target); } /** @@ -359,6 +385,64 @@ public class HtmlDocletWriter extends HtmlDocWriter { body("white", includeScript); } + /** + * Generates the HTML document tree and prints it out. + * + * @param metakeywords Array of String keywords for META tag. Each element + * of the array is assigned to a separate META tag. + * Pass in null for no array + * @param includeScript true if printing windowtitle script + * false for files that appear in the left-hand frames + * @param body the body htmltree to be included in the document + */ + public void printHtmlDocument(String[] metakeywords, boolean includeScript, + Content body) { + Content htmlDocType = DocType.Transitional(); + Content htmlComment = new Comment(configuration.getText("doclet.New_Page")); + Content head = new HtmlTree(HtmlTag.HEAD); + if (!configuration.notimestamp) { + Content headComment = new Comment("Generated by javadoc (version " + + ConfigurationImpl.BUILD_DATE + ") on " + today()); + head.addContent(headComment); + } + if (configuration.charset.length() > 0) { + Content meta = HtmlTree.META("Content-Type", "text/html", + configuration.charset); + head.addContent(meta); + } + head.addContent(getTitle()); + if (!configuration.notimestamp) { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + Content meta = HtmlTree.META("date", dateFormat.format(new Date())); + head.addContent(meta); + } + if (metakeywords != null) { + for (int i=0; i < metakeywords.length; i++) { + Content meta = HtmlTree.META("keywords", metakeywords[i]); + head.addContent(meta); + } + } + head.addContent(getStyleSheetProperties()); + Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), + head, body); + Content htmlDocument = new HtmlDocument(htmlDocType, + htmlComment, htmlTree); + print(htmlDocument.toString()); + } + + /** + * Get the window title. + * + * @param title the title string to construct the complete window title + * @return the window title string + */ + public String getWindowTitle(String title) { + if (configuration.windowtitle.length() > 0) { + title += " (" + configuration.windowtitle + ")"; + } + return title; + } + /** * Print user specified header and the footer. * @@ -379,6 +463,28 @@ public class HtmlDocletWriter extends HtmlDocWriter { emEnd(); } + /** + * Get user specified header and the footer. + * + * @param header if true print the user provided header else print the + * user provided footer. + */ + public Content getUserHeaderFooter(boolean header) { + String content; + if (header) { + content = replaceDocRootDir(configuration.header); + } else { + if (configuration.footer.length() != 0) { + content = replaceDocRootDir(configuration.footer); + } else { + content = replaceDocRootDir(configuration.header); + } + } + Content rawContent = new RawHtml(content); + Content em = HtmlTree.EM(rawContent); + return em; + } + /** * Print the user specified top. */ @@ -387,6 +493,16 @@ public class HtmlDocletWriter extends HtmlDocWriter { hr(); } + /** + * Adds the user specified top. + * + * @param body the content tree to which user specified top will be added + */ + public void addTop(Content body) { + Content top = new RawHtml(replaceDocRootDir(configuration.top)); + body.addContent(top); + } + /** * Print the user specified bottom. */ @@ -395,6 +511,18 @@ public class HtmlDocletWriter extends HtmlDocWriter { print(replaceDocRootDir(configuration.bottom)); } + /** + * Adds the user specified bottom. + * + * @param body the content tree to which user specified bottom will be added + */ + public void addBottom(Content body) { + Content bottom = new RawHtml(replaceDocRootDir(configuration.bottom)); + Content small = HtmlTree.SMALL(bottom); + Content p = HtmlTree.P(HtmlStyle.legalCopy, small); + body.addContent(p); + } + /** * Print the navigation bar for the Html page at the top and and the bottom. * @@ -408,13 +536,13 @@ public class HtmlDocletWriter extends HtmlDocWriter { println(DocletConstants.NL + ""); anchor("navbar_top"); println(); - print(getHyperLink("", "skip-navbar_top", "", false, "", + print(getHyperLinkString("", "skip-navbar_top", "", false, "", configuration.getText("doclet.Skip_navigation_links"), "")); } else { println(DocletConstants.NL + ""); anchor("navbar_bottom"); println(); - print(getHyperLink("", "skip-navbar_bottom", "", false, "", + print(getHyperLinkString("", "skip-navbar_bottom", "", false, "", configuration.getText("doclet.Skip_navigation_links"), "")); } table(0, "100%", 1, 0); @@ -517,6 +645,97 @@ public class HtmlDocletWriter extends HtmlDocWriter { } } + /** + * Adds the navigation bar for the Html page at the top and and the bottom. + * + * @param header If true print navigation bar at the top of the page else + * @param body the HtmlTree to which the nav links will be added + */ + protected void addNavLinks(boolean header, Content body) { + if (!configuration.nonavbar) { + String allClassesId = "allclasses_"; + HtmlTree navDiv = new HtmlTree(HtmlTag.DIV); + if (header) { + body.addContent(HtmlConstants.START_OF_TOP_NAVBAR); + navDiv.addStyle(HtmlStyle.topNav); + allClassesId += "navbar_top"; + Content a = getMarkerAnchor("navbar_top"); + navDiv.addContent(a); + Content skipLinkContent = getHyperLink("", + "skip-navbar_top", HtmlTree.EMPTY, configuration.getText( + "doclet.Skip_navigation_links"), ""); + navDiv.addContent(skipLinkContent); + } else { + body.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR); + navDiv.addStyle(HtmlStyle.bottomNav); + allClassesId += "navbar_bottom"; + Content a = getMarkerAnchor("navbar_bottom"); + navDiv.addContent(a); + Content skipLinkContent = getHyperLink("", + "skip-navbar_bottom", HtmlTree.EMPTY, configuration.getText( + "doclet.Skip_navigation_links"), ""); + navDiv.addContent(skipLinkContent); + } + if (header) { + navDiv.addContent(getMarkerAnchor("navbar_top_firstrow")); + } else { + navDiv.addContent(getMarkerAnchor("navbar_bottom_firstrow")); + } + HtmlTree navList = new HtmlTree(HtmlTag.UL); + navList.addStyle(HtmlStyle.navList); + navList.addAttr(HtmlAttr.TITLE, "Navigation"); + if (configuration.createoverview) { + navList.addContent(getNavLinkContents()); + } + if (configuration.packages.length == 1) { + navList.addContent(getNavLinkPackage(configuration.packages[0])); + } else if (configuration.packages.length > 1) { + navList.addContent(getNavLinkPackage()); + } + navList.addContent(getNavLinkClass()); + if(configuration.classuse) { + navList.addContent(getNavLinkClassUse()); + } + if(configuration.createtree) { + navList.addContent(getNavLinkTree()); + } + if(!(configuration.nodeprecated || + configuration.nodeprecatedlist)) { + navList.addContent(getNavLinkDeprecated()); + } + if(configuration.createindex) { + navList.addContent(getNavLinkIndex()); + } + if (!configuration.nohelp) { + navList.addContent(getNavLinkHelp()); + } + navDiv.addContent(navList); + Content aboutDiv = HtmlTree.DIV(HtmlStyle.aboutLanguage, getUserHeaderFooter(header)); + navDiv.addContent(aboutDiv); + body.addContent(navDiv); + Content ulNav = HtmlTree.UL(HtmlStyle.navList, getNavLinkPrevious()); + ulNav.addContent(getNavLinkNext()); + Content subDiv = HtmlTree.DIV(HtmlStyle.subNav, ulNav); + Content ulFrames = HtmlTree.UL(HtmlStyle.navList, getNavShowLists()); + ulFrames.addContent(getNavHideLists(filename)); + subDiv.addContent(ulFrames); + HtmlTree ulAllClasses = HtmlTree.UL(HtmlStyle.navList, getNavLinkClassIndex()); + ulAllClasses.addAttr(HtmlAttr.ID, allClassesId.toString()); + subDiv.addContent(ulAllClasses); + subDiv.addContent(getAllClassesLinkScript(allClassesId.toString())); + addSummaryDetailLinks(subDiv); + if (header) { + subDiv.addContent(getMarkerAnchor("skip-navbar_top")); + body.addContent(subDiv); + body.addContent(HtmlConstants.END_OF_TOP_NAVBAR); + } else { + subDiv.addContent(getMarkerAnchor("skip-navbar_bottom")); + body.addContent(subDiv); + body.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR); + } + } + } + /** * Print the word "NEXT" to indicate that no link is available. Override * this method to customize next link. @@ -525,6 +744,16 @@ public class HtmlDocletWriter extends HtmlDocWriter { navLinkNext(null); } + /** + * Get the word "NEXT" to indicate that no link is available. Override + * this method to customize next link. + * + * @return a content tree for the link + */ + protected Content getNavLinkNext() { + return getNavLinkNext(null); + } + /** * Print the word "PREV" to indicate that no link is available. Override * this method to customize prev link. @@ -533,12 +762,28 @@ public class HtmlDocletWriter extends HtmlDocWriter { navLinkPrevious(null); } + /** + * Get the word "PREV" to indicate that no link is available. Override + * this method to customize prev link. + * + * @return a content tree for the link + */ + protected Content getNavLinkPrevious() { + return getNavLinkPrevious(null); + } + /** * Do nothing. This is the default method. */ protected void printSummaryDetailLinks() { } + /** + * Do nothing. This is the default method. + */ + protected void addSummaryDetailLinks(Content navDiv) { + } + /** * Print link to the "overview-summary.html" page. */ @@ -549,6 +794,18 @@ public class HtmlDocletWriter extends HtmlDocWriter { navCellEnd(); } + /** + * Get link to the "overview-summary.html" page. + * + * @return a content tree for the link + */ + protected Content getNavLinkContents() { + Content linkContent = getHyperLink(relativePath + + "overview-summary.html", "", overviewLabel, "", ""); + Content li = HtmlTree.LI(linkContent); + return li; + } + /** * Description for a cell in the navigation bar. */ @@ -589,6 +846,19 @@ public class HtmlDocletWriter extends HtmlDocWriter { navCellEnd(); } + /** + * Get link to the "package-summary.html" page for the package passed. + * + * @param pkg Package to which link will be generated + * @return a content tree for the link + */ + protected Content getNavLinkPackage(PackageDoc pkg) { + Content linkContent = getPackageLink(pkg, + packageLabel); + Content li = HtmlTree.LI(linkContent); + return li; + } + /** * Print the word "Package" in the navigation bar cell, to indicate that * link is not available here. @@ -601,6 +871,16 @@ public class HtmlDocletWriter extends HtmlDocWriter { navCellEnd(); } + /** + * Get the word "Package" , to indicate that link is not available here. + * + * @return a content tree for the link + */ + protected Content getNavLinkPackage() { + Content li = HtmlTree.LI(packageLabel); + return li; + } + /** * Print the word "Use" in the navigation bar cell, to indicate that link * is not available. @@ -613,6 +893,16 @@ public class HtmlDocletWriter extends HtmlDocWriter { navCellEnd(); } + /** + * Get the word "Use", to indicate that link is not available. + * + * @return a content tree for the link + */ + protected Content getNavLinkClassUse() { + Content li = HtmlTree.LI(useLabel); + return li; + } + /** * Print link for previous file. * @@ -627,6 +917,22 @@ public class HtmlDocletWriter extends HtmlDocWriter { } } + /** + * Get link for previous file. + * + * @param prev File name for the prev link + * @return a content tree for the link + */ + public Content getNavLinkPrevious(String prev) { + Content li; + if (prev != null) { + li = HtmlTree.LI(getHyperLink(prev, "", prevLabel, "", "")); + } + else + li = HtmlTree.LI(prevLabel); + return li; + } + /** * Print link for next file. If next is null, just print the label * without linking it anywhere. @@ -642,16 +948,46 @@ public class HtmlDocletWriter extends HtmlDocWriter { } } + /** + * Get link for next file. If next is null, just print the label + * without linking it anywhere. + * + * @param next File name for the next link + * @return a content tree for the link + */ + public Content getNavLinkNext(String next) { + Content li; + if (next != null) { + li = HtmlTree.LI(getHyperLink(next, "", nextLabel, "", "")); + } + else + li = HtmlTree.LI(nextLabel); + return li; + } + /** * Print "FRAMES" link, to switch to the frame version of the output. * * @param link File to be linked, "index.html". */ protected void navShowLists(String link) { - print(getHyperLink(link + "?" + path + filename, "", + print(getHyperLinkString(link + "?" + path + filename, "", configuration.getText("doclet.FRAMES"), true, "", "", "_top")); } + /** + * Get "FRAMES" link, to switch to the frame version of the output. + * + * @param link File to be linked, "index.html" + * @return a content tree for the link + */ + protected Content getNavShowLists(String link) { + Content framesContent = getHyperLink(link + "?" + path + + filename, "", framesLabel, "", "_top"); + Content li = HtmlTree.LI(framesContent); + return li; + } + /** * Print "FRAMES" link, to switch to the frame version of the output. */ @@ -659,16 +995,37 @@ public class HtmlDocletWriter extends HtmlDocWriter { navShowLists(relativePath + "index.html"); } + /** + * Get "FRAMES" link, to switch to the frame version of the output. + * + * @return a content tree for the link + */ + protected Content getNavShowLists() { + return getNavShowLists(relativePath + "index.html"); + } + /** * Print "NO FRAMES" link, to switch to the non-frame version of the output. * * @param link File to be linked. */ protected void navHideLists(String link) { - print(getHyperLink(link, "", configuration.getText("doclet.NO_FRAMES"), + print(getHyperLinkString(link, "", configuration.getText("doclet.NO_FRAMES"), true, "", "", "_top")); } + /** + * Get "NO FRAMES" link, to switch to the non-frame version of the output. + * + * @param link File to be linked + * @return a content tree for the link + */ + protected Content getNavHideLists(String link) { + Content noFramesContent = getHyperLink(link, "", noframesLabel, "", "_top"); + Content li = HtmlTree.LI(noFramesContent); + return li; + } + /** * Print "Tree" link in the navigation bar. If there is only one package * specified on the command line, then the "Tree" link will be to the @@ -689,10 +1046,39 @@ public class HtmlDocletWriter extends HtmlDocWriter { } /** - * Print "Tree" link to the "overview-tree.html" file. + * Get "Tree" link in the navigation bar. If there is only one package + * specified on the command line, then the "Tree" link will be to the + * only "package-tree.html" file otherwise it will be to the + * "overview-tree.html" file. + * + * @return a content tree for the link */ - protected void navLinkMainTree(String label) { - printHyperLink(relativePath + "overview-tree.html", label); + protected Content getNavLinkTree() { + Content treeLinkContent; + PackageDoc[] packages = configuration.root.specifiedPackages(); + if (packages.length == 1 && configuration.root.specifiedClasses().length == 0) { + treeLinkContent = getHyperLink(pathString(packages[0], + "package-tree.html"), "", treeLabel, + "", ""); + } else { + treeLinkContent = getHyperLink(relativePath + "overview-tree.html", + "", treeLabel, "", ""); + } + Content li = HtmlTree.LI(treeLinkContent); + return li; + } + + /** + * Get the overview tree link for the main tree. + * + * @param label the label for the link + * @return a content tree for the link + */ + protected Content getNavLinkMainTree(String label) { + Content mainTreeContent = getHyperLink(relativePath + "overview-tree.html", + new StringContent(label)); + Content li = HtmlTree.LI(mainTreeContent); + return li; } /** @@ -707,6 +1093,16 @@ public class HtmlDocletWriter extends HtmlDocWriter { navCellEnd(); } + /** + * Get the word "Class", to indicate that class link is not available. + * + * @return a content tree for the link + */ + protected Content getNavLinkClass() { + Content li = HtmlTree.LI(classLabel); + return li; + } + /** * Print "Deprecated" API link in the navigation bar. */ @@ -717,6 +1113,18 @@ public class HtmlDocletWriter extends HtmlDocWriter { navCellEnd(); } + /** + * Get "Deprecated" API link in the navigation bar. + * + * @return a content tree for the link + */ + protected Content getNavLinkDeprecated() { + Content linkContent = getHyperLink(relativePath + + "deprecated-list.html", "", deprecatedLabel, "", ""); + Content li = HtmlTree.LI(linkContent); + return li; + } + /** * Print link for generated index. If the user has used "-splitindex" * command line option, then link to file "index-files/index-1.html" is @@ -727,6 +1135,21 @@ public class HtmlDocletWriter extends HtmlDocWriter { AllClassesFrameWriter.OUTPUT_FILE_NAME_NOFRAMES, "", "", configuration.getText("doclet.All_Classes"), true); } + + /** + * Get link for generated index. If the user has used "-splitindex" + * command line option, then link to file "index-files/index-1.html" is + * generated otherwise link to file "index-all.html" is generated. + * + * @return a content tree for the link + */ + protected Content getNavLinkClassIndex() { + Content allClassesContent = getHyperLink(relativePath + + AllClassesFrameWriter.OUTPUT_FILE_NAME_NOFRAMES, "", + allclassesLabel, "", ""); + Content li = HtmlTree.LI(allClassesContent); + return li; + } /** * Print link for generated class index. */ @@ -742,6 +1165,20 @@ public class HtmlDocletWriter extends HtmlDocWriter { navCellEnd(); } + /** + * Get link for generated class index. + * + * @return a content tree for the link + */ + protected Content getNavLinkIndex() { + Content linkContent = getHyperLink(relativePath +(configuration.splitindex? + DirectoryManager.getPath("index-files") + fileseparator: "") + + (configuration.splitindex?"index-1.html" : "index-all.html"), "", + indexLabel, "", ""); + Content li = HtmlTree.LI(linkContent); + return li; + } + /** * Print help file link. If user has provided a help file, then generate a * link to the user given file, which is already copied to current or @@ -763,6 +1200,29 @@ public class HtmlDocletWriter extends HtmlDocWriter { navCellEnd(); } + /** + * Get help file link. If user has provided a help file, then generate a + * link to the user given file, which is already copied to current or + * destination directory. + * + * @return a content tree for the link + */ + protected Content getNavLinkHelp() { + String helpfilenm = configuration.helpfile; + if (helpfilenm.equals("")) { + helpfilenm = "help-doc.html"; + } else { + int lastsep; + if ((lastsep = helpfilenm.lastIndexOf(File.separatorChar)) != -1) { + helpfilenm = helpfilenm.substring(lastsep + 1); + } + } + Content linkContent = getHyperLink(relativePath + helpfilenm, "", + helpLabel, "", ""); + Content li = HtmlTree.LI(linkContent); + return li; + } + /** * Print the word "Detail" in the navigation bar. No link is available. */ @@ -844,6 +1304,96 @@ public class HtmlDocletWriter extends HtmlDocWriter { trEnd(); } + /** + * Get summary table header. + * + * @param header the header for the table + * @param scope the scope of the headers + * @return a content tree for the header + */ + public Content getSummaryTableHeader(String[] header, String scope) { + Content tr = new HtmlTree(HtmlTag.TR); + int size = header.length; + Content tableHeader; + if (size == 1) { + tableHeader = new StringContent(header[0]); + tr.addContent(HtmlTree.TH(HtmlStyle.colOne, scope, tableHeader)); + return tr; + } + for (int i = 0; i < size; i++) { + tableHeader = new StringContent(header[i]); + if(i == 0) + tr.addContent(HtmlTree.TH(HtmlStyle.colFirst, scope, tableHeader)); + else if(i == (size - 1)) + tr.addContent(HtmlTree.TH(HtmlStyle.colLast, scope, tableHeader)); + else + tr.addContent(HtmlTree.TH(scope, tableHeader)); + } + return tr; + } + + /** + * Get table caption. + * + * @param rawText the caption for the table which could be raw Html + * @return a content tree for the caption + */ + public Content getTableCaption(String rawText) { + Content title = new RawHtml(rawText); + Content captionSpan = HtmlTree.SPAN(title); + Content space = getSpace(); + Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, space); + Content caption = HtmlTree.CAPTION(captionSpan); + caption.addContent(tabSpan); + return caption; + } + + /** + * Get the marker anchor which will be added to the documentation tree. + * + * @param anchorName the anchor name attribute + * @return a content tree for the marker anchor + */ + public Content getMarkerAnchor(String anchorName) { + return getMarkerAnchor(anchorName, null); + } + + /** + * Get the marker anchor which will be added to the documentation tree. + * + * @param anchorName the anchor name attribute + * @param anchorContent the content that should be added to the anchor + * @return a content tree for the marker anchor + */ + public Content getMarkerAnchor(String anchorName, Content anchorContent) { + if (anchorContent == null) + anchorContent = new Comment(" "); + Content markerAnchor = HtmlTree.A_NAME(anchorName, anchorContent); + return markerAnchor; + } + + /** + * Returns a packagename content. + * + * @param packageDoc the package to check + * @return package name content + */ + public Content getPackageName(PackageDoc packageDoc) { + return packageDoc == null || packageDoc.name().length() == 0 ? + defaultPackageLabel : + getPackageLabel(packageDoc.name()); + } + + /** + * Returns a package name label. + * + * @param parsedName the package name + * @return the package name content + */ + public Content getPackageLabel(String packageName) { + return new StringContent(packageName); + } + /** * Prine table header information about color, column span and the font. * @@ -1028,7 +1578,7 @@ public class HtmlDocletWriter extends HtmlDocWriter { * @param isStrong true if the label should be strong. */ public void printPackageLink(PackageDoc pkg, String label, boolean isStrong) { - print(getPackageLink(pkg, label, isStrong)); + print(getPackageLinkString(pkg, label, isStrong)); } /** @@ -1041,7 +1591,7 @@ public class HtmlDocletWriter extends HtmlDocWriter { */ public void printPackageLink(PackageDoc pkg, String label, boolean isStrong, String style) { - print(getPackageLink(pkg, label, isStrong, style)); + print(getPackageLinkString(pkg, label, isStrong, style)); } /** @@ -1052,9 +1602,9 @@ public class HtmlDocletWriter extends HtmlDocWriter { * @param isStrong true if the label should be strong. * @return the link to the given package. */ - public String getPackageLink(PackageDoc pkg, String label, + public String getPackageLinkString(PackageDoc pkg, String label, boolean isStrong) { - return getPackageLink(pkg, label, isStrong, ""); + return getPackageLinkString(pkg, label, isStrong, ""); } /** @@ -1066,7 +1616,7 @@ public class HtmlDocletWriter extends HtmlDocWriter { * @param style the font of the package link label. * @return the link to the given package. */ - public String getPackageLink(PackageDoc pkg, String label, boolean isStrong, + public String getPackageLinkString(PackageDoc pkg, String label, boolean isStrong, String style) { boolean included = pkg != null && pkg.isIncluded(); if (! included) { @@ -1079,12 +1629,43 @@ public class HtmlDocletWriter extends HtmlDocWriter { } } if (included || pkg == null) { - return getHyperLink(pathString(pkg, "package-summary.html"), + return getHyperLinkString(pathString(pkg, "package-summary.html"), "", label, isStrong, style); } else { String crossPkgLink = getCrossPackageLink(Util.getPackageName(pkg)); if (crossPkgLink != null) { - return getHyperLink(crossPkgLink, "", label, isStrong, style); + return getHyperLinkString(crossPkgLink, "", label, isStrong, style); + } else { + return label; + } + } + } + + /** + * Return the link to the given package. + * + * @param pkg the package to link to. + * @param label the label for the link. + * @return a content tree for the package link. + */ + public Content getPackageLink(PackageDoc pkg, Content label) { + boolean included = pkg != null && pkg.isIncluded(); + if (! included) { + PackageDoc[] packages = configuration.packages; + for (int i = 0; i < packages.length; i++) { + if (packages[i].equals(pkg)) { + included = true; + break; + } + } + } + if (included || pkg == null) { + return getHyperLink(pathString(pkg, "package-summary.html"), + "", label); + } else { + String crossPkgLink = getCrossPackageLink(Util.getPackageName(pkg)); + if (crossPkgLink != null) { + return getHyperLink(crossPkgLink, "", label); } else { return label; } @@ -1111,6 +1692,29 @@ public class HtmlDocletWriter extends HtmlDocWriter { printHyperLink(href, "", label, true); } + /** + * Add the link to the content tree. + * + * @param doc program element doc for which the link will be added + * @param label label for the link + * @param htmltree the content tree to which the link will be added + */ + public void addSrcLink(ProgramElementDoc doc, Content label, Content htmltree) { + if (doc == null) { + return; + } + ClassDoc cd = doc.containingClass(); + if (cd == null) { + //d must be a class doc since in has no containing class. + cd = (ClassDoc) doc; + } + String href = relativePath + DocletConstants.SOURCE_OUTPUT_DIR_NAME + + DirectoryManager.getDirectoryPath(cd.containingPackage()) + + cd.name() + ".html#" + SourceToHTMLConverter.getAnchorName(doc); + Content linkContent = getHyperLink(href, "", label, "", ""); + htmltree.addContent(linkContent); + } + /** * Return the link to the given class. * @@ -1175,7 +1779,7 @@ public class HtmlDocletWriter extends HtmlDocWriter { //the -link option. There are ways to determine if an external package //exists, but no way to determine if the external class exists. We just //have to assume that it does. - return getHyperLink( + return getHyperLinkString( configuration.extern.getExternalLink(packageName, relativePath, className + ".html?is-external=true"), refMemName == null ? "" : refMemName, @@ -1200,17 +1804,27 @@ public class HtmlDocletWriter extends HtmlDocWriter { "package-summary.html?is-external=true"); } - public void printQualifiedClassLink(int context, ClassDoc cd) { - printLink(new LinkInfoImpl(context, cd, - configuration.getClassName(cd), "")); + /** + * Get the class link. + * + * @param context the id of the context where the link will be added + * @param cd the class doc to link to + * @return a content tree for the link + */ + public Content getQualifiedClassLink(int context, ClassDoc cd) { + return new RawHtml(getLink(new LinkInfoImpl(context, cd, + configuration.getClassName(cd), ""))); } /** - * Print Class link, with only class name as the link and prefixing - * plain package name. + * Add the class link. + * + * @param context the id of the context where the link will be added + * @param cd the class doc to link to + * @param contentTree the content tree to which the link will be added */ - public void printPreQualifiedClassLink(int context, ClassDoc cd) { - print(getPreQualifiedClassLink(context, cd, false)); + public void addPreQualifiedClassLink(int context, ClassDoc cd, Content contentTree) { + addPreQualifiedClassLink(context, cd, false, contentTree); } /** @@ -1233,13 +1847,36 @@ public class HtmlDocletWriter extends HtmlDocWriter { return classlink; } + /** + * Add the class link with the package portion of the label in + * plain text. If the qualifier is excluded, it will not be included in the + * link label. + * + * @param context the id of the context where the link will be added + * @param cd the class to link to + * @param isStrong true if the link should be strong + * @param contentTree the content tree to which the link with be added + */ + public void addPreQualifiedClassLink(int context, + ClassDoc cd, boolean isStrong, Content contentTree) { + PackageDoc pd = cd.containingPackage(); + if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) { + contentTree.addContent(getPkgName(cd)); + } + contentTree.addContent(new RawHtml(getLink(new LinkInfoImpl( + context, cd, cd.name(), isStrong)))); + } /** - * Print Class link, with only class name as the strong link and prefixing + * Add the class link, with only class name as the strong link and prefixing * plain package name. + * + * @param context the id of the context where the link will be added + * @param cd the class to link to + * @param contentTree the content tree to which the link with be added */ - public void printPreQualifiedStrongClassLink(int context, ClassDoc cd) { - print(getPreQualifiedClassLink(context, cd, true)); + public void addPreQualifiedStrongClassLink(int context, ClassDoc cd, Content contentTree) { + addPreQualifiedClassLink(context, cd, true, contentTree); } public void printText(String key) { @@ -1267,16 +1904,15 @@ public class HtmlDocletWriter extends HtmlDocWriter { } /** - * Print the link for the given member. + * Get the link for the given member. * - * @param context the id of the context where the link will be printed. - * @param doc the member being linked to. - * @param label the label for the link. - * @param strong true if the link should be strong. + * @param context the id of the context where the link will be added + * @param doc the member being linked to + * @param label the label for the link + * @return a content tree for the doc link */ - public void printDocLink(int context, MemberDoc doc, String label, - boolean strong) { - print(getDocLink(context, doc, label, strong)); + public Content getDocLink(int context, MemberDoc doc, String label) { + return getDocLink(context, doc.containingClass(), doc, label); } /** @@ -1338,6 +1974,34 @@ public class HtmlDocletWriter extends HtmlDocWriter { } } + /** + * Return the link for the given member. + * + * @param context the id of the context where the link will be added + * @param classDoc the classDoc that we should link to. This is not + * necessarily equal to doc.containingClass(). We may be + * inheriting comments + * @param doc the member being linked to + * @param label the label for the link + * @return the link for the given member + */ + public Content getDocLink(int context, ClassDoc classDoc, MemberDoc doc, + String label) { + if (! (doc.isIncluded() || + Util.isLinkable(classDoc, configuration()))) { + return new StringContent(label); + } else if (doc instanceof ExecutableMemberDoc) { + ExecutableMemberDoc emd = (ExecutableMemberDoc)doc; + return new RawHtml(getLink(new LinkInfoImpl(context, classDoc, + getAnchor(emd), label, false))); + } else if (doc instanceof MemberDoc) { + return new RawHtml(getLink(new LinkInfoImpl(context, classDoc, + doc.name(), label, false))); + } else { + return new StringContent(label); + } + } + public void anchor(ExecutableMemberDoc emd) { anchor(getAnchor(emd)); } @@ -1392,14 +2056,14 @@ public class HtmlDocletWriter extends HtmlDocWriter { //@see is referencing an included package String packageName = isplaintext ? refPackage.name() : getCode() + refPackage.name() + getCodeEnd(); - result.append(getPackageLink(refPackage, + result.append(getPackageLinkString(refPackage, label.length() == 0 ? packageName : label, false)); } else { //@see is not referencing an included class or package. Check for cross links. String classCrossLink, packageCrossLink = getCrossPackageLink(refClassName); if (packageCrossLink != null) { //Package cross link found - result.append(getHyperLink(packageCrossLink, "", + result.append(getHyperLinkString(packageCrossLink, "", (label.length() == 0)? text : label, false)); } else if ((classCrossLink = getCrossClassLink(refClassName, refMemName, label, false, "", ! isplaintext)) != null) { @@ -1468,18 +2132,61 @@ public class HtmlDocletWriter extends HtmlDocWriter { printCommentTags(doc, tag.inlineTags(), false, false); } + /** + * Add the inline comment. + * + * @param doc the doc for which the inline comment will be added + * @param tag the inline tag to be added + * @param htmltree the content tree to which the comment will be added + */ + public void addInlineComment(Doc doc, Tag tag, Content htmltree) { + addCommentTags(doc, tag.inlineTags(), false, false, htmltree); + } + public void printInlineDeprecatedComment(Doc doc, Tag tag) { printCommentTags(doc, tag.inlineTags(), true, false); } + /** + * Add the inline deprecated comment. + * + * @param doc the doc for which the inline deprecated comment will be added + * @param tag the inline tag to be added + * @param htmltree the content tree to which the comment will be added + */ + public void addInlineDeprecatedComment(Doc doc, Tag tag, Content htmltree) { + addCommentTags(doc, tag.inlineTags(), true, false, htmltree); + } + public void printSummaryComment(Doc doc) { printSummaryComment(doc, doc.firstSentenceTags()); } + /** + * Adds the summary content. + * + * @param doc the doc for which the summary will be generated + * @param htmltree the documentation tree to which the summary will be added + */ + public void addSummaryComment(Doc doc, Content htmltree) { + addSummaryComment(doc, doc.firstSentenceTags(), htmltree); + } + public void printSummaryComment(Doc doc, Tag[] firstSentenceTags) { printCommentTags(doc, firstSentenceTags, false, true); } + /** + * Adds the summary content. + * + * @param doc the doc for which the summary will be generated + * @param firstSentenceTags the first sentence tags for the doc + * @param htmltree the documentation tree to which the summary will be added + */ + public void addSummaryComment(Doc doc, Tag[] firstSentenceTags, Content htmltree) { + addCommentTags(doc, firstSentenceTags, false, true, htmltree); + } + public void printSummaryDeprecatedComment(Doc doc) { printCommentTags(doc, doc.firstSentenceTags(), true, true); } @@ -1488,11 +2195,25 @@ public class HtmlDocletWriter extends HtmlDocWriter { printCommentTags(doc, tag.firstSentenceTags(), true, true); } + public void addSummaryDeprecatedComment(Doc doc, Tag tag, Content htmltree) { + addCommentTags(doc, tag.firstSentenceTags(), true, true, htmltree); + } + public void printInlineComment(Doc doc) { printCommentTags(doc, doc.inlineTags(), false, false); p(); } + /** + * Adds the inline comment. + * + * @param doc the doc for which the inline comments will be generated + * @param htmltree the documentation tree to which the inline comments will be added + */ + public void addInlineComment(Doc doc, Content htmltree) { + addCommentTags(doc, doc.inlineTags(), false, false, htmltree); + } + public void printInlineDeprecatedComment(Doc doc) { printCommentTags(doc, doc.inlineTags(), true, false); } @@ -1514,6 +2235,36 @@ public class HtmlDocletWriter extends HtmlDocWriter { } } + /** + * Adds the comment tags. + * + * @param doc the doc for which the comment tags will be generated + * @param tags the first sentence tags for the doc + * @param depr true if it is deprecated + * @param first true if the first sentenge tags should be added + * @param htmltree the documentation tree to which the comment tags will be added + */ + private void addCommentTags(Doc doc, Tag[] tags, boolean depr, + boolean first, Content htmltree) { + if(configuration.nocomment){ + return; + } + Content div; + Content result = new RawHtml(commentTagsToString(null, doc, tags, first)); + if (depr) { + Content italic = HtmlTree.I(result); + div = HtmlTree.DIV(HtmlStyle.block, italic); + htmltree.addContent(div); + } + else { + div = HtmlTree.DIV(HtmlStyle.block, result); + htmltree.addContent(div); + } + if (tags.length == 0) { + htmltree.addContent(getSpace()); + } + } + /** * Converts inline tags and text to text strings, expanding the * inline tags along the way. Called wherever text can contain @@ -1624,8 +2375,8 @@ public class HtmlDocletWriter extends HtmlDocWriter { return text; } - if (! redirectPathFromRoot.endsWith(DirectoryManager.URL_FILE_SEPERATOR)) { - redirectPathFromRoot += DirectoryManager.URL_FILE_SEPERATOR; + if (! redirectPathFromRoot.endsWith(DirectoryManager.URL_FILE_SEPARATOR)) { + redirectPathFromRoot += DirectoryManager.URL_FILE_SEPARATOR; } //Redirect all relative links. @@ -1750,6 +2501,27 @@ public class HtmlDocletWriter extends HtmlDocWriter { filename + "\" " + "TITLE=\"Style\""); } + /** + * Returns a link to the stylesheet file. + * + * @return an HtmlTree for the lINK tag which provides the stylesheet location + */ + public HtmlTree getStyleSheetProperties() { + String filename = configuration.stylesheetfile; + if (filename.length() > 0) { + File stylefile = new File(filename); + String parent = stylefile.getParent(); + filename = (parent == null)? + filename: + filename.substring(parent.length() + 1); + } else { + filename = "stylesheet.css"; + } + filename = relativePath + filename; + HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", filename, "Style"); + return link; + } + /** * According to the Java Language Specifications, all the outer classes * and static nested classes are core classes. @@ -1767,6 +2539,17 @@ public class HtmlDocletWriter extends HtmlDocWriter { writeAnnotationInfo(packageDoc, packageDoc.annotations()); } + /** + * Adds the annotatation types for the given packageDoc. + * + * @param packageDoc the package to write annotations for. + * @param htmltree the documentation tree to which the annotation info will be + * added + */ + public void addAnnotationInfo(PackageDoc packageDoc, Content htmltree) { + addAnnotationInfo(packageDoc, packageDoc.annotations(), htmltree); + } + /** * Write the annotatation types for the given doc. * @@ -1776,6 +2559,16 @@ public class HtmlDocletWriter extends HtmlDocWriter { writeAnnotationInfo(doc, doc.annotations()); } + /** + * Adds the annotatation types for the given doc. + * + * @param packageDoc the package to write annotations for + * @param htmltree the content tree to which the annotation types will be added + */ + public void addAnnotationInfo(ProgramElementDoc doc, Content htmltree) { + addAnnotationInfo(doc, doc.annotations(), htmltree); + } + /** * Write the annotatation types for the given doc and parameter. * @@ -1787,6 +2580,19 @@ public class HtmlDocletWriter extends HtmlDocWriter { return writeAnnotationInfo(indent, doc, param.annotations(), false); } + /** + * Add the annotatation types for the given doc and parameter. + * + * @param indent the number of spaces to indent the parameters. + * @param doc the doc to write annotations for. + * @param param the parameter to write annotations for. + * @param tree the content tree to which the annotation types will be added + */ + public boolean addAnnotationInfo(int indent, Doc doc, Parameter param, + Content tree) { + return addAnnotationInfo(indent, doc, param.annotations(), false, tree); + } + /** * Write the annotatation types for the given doc. * @@ -1797,6 +2603,19 @@ public class HtmlDocletWriter extends HtmlDocWriter { writeAnnotationInfo(0, doc, descList, true); } + /** + * Adds the annotatation types for the given doc. + * + * @param doc the doc to write annotations for. + * @param descList the array of {@link AnnotationDesc}. + * @param htmltree the documentation tree to which the annotation info will be + * added + */ + private void addAnnotationInfo(Doc doc, AnnotationDesc[] descList, + Content htmltree) { + addAnnotationInfo(0, doc, descList, true, htmltree); + } + /** * Write the annotatation types for the given doc. * @@ -1818,6 +2637,29 @@ public class HtmlDocletWriter extends HtmlDocWriter { } /** + * Adds the annotatation types for the given doc. + * + * @param indent the number of extra spaces to indent the annotations. + * @param doc the doc to write annotations for. + * @param descList the array of {@link AnnotationDesc}. + * @param htmltree the documentation tree to which the annotation info will be + * added + */ + private boolean addAnnotationInfo(int indent, Doc doc, + AnnotationDesc[] descList, boolean lineBreak, Content htmltree) { + List annotations = getAnnotations(indent, descList, lineBreak); + if (annotations.size() == 0) { + return false; + } + Content annotationContent; + for (Iterator iter = annotations.iterator(); iter.hasNext();) { + annotationContent = new RawHtml(iter.next()); + htmltree.addContent(annotationContent); + } + return true; + } + + /** * Return the string representations of the annotation types for * the given doc. * diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java index cb438b7c748..a5db7d932a0 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ import com.sun.javadoc.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.taglets.*; import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * Generate serialized form for serializable fields. @@ -46,8 +47,6 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl private boolean printedOverallAnchor = false; - private boolean printedFirstMember = false; - public HtmlSerialFieldWriter(SubWriterHolderWriter writer, ClassDoc classdoc) { super(writer, classdoc); @@ -69,109 +68,143 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl } } - public void writeHeader(String heading) { - if (! printedOverallAnchor) { - writer.anchor("serializedForm"); - printedOverallAnchor = true; - writer.printTableHeadingBackground(heading); - writer.println(); - if (heading.equals( - configuration().getText("doclet.Serialized_Form_class"))) { - assert !writer.getMemberDetailsListPrinted(); + /** + * Return the header for serializable fields section. + * + * @return a content tree for the header + */ + public Content getSerializableFieldsHeader() { + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.blockList); + return ul; + } + + /** + * Return the header for serializable fields content section. + * + * @param isLastContent true if the cotent being documented is the last content. + * @return a content tree for the header + */ + public Content getFieldsContentHeader(boolean isLastContent) { + HtmlTree li = new HtmlTree(HtmlTag.LI); + if (isLastContent) + li.addStyle(HtmlStyle.blockListLast); + else + li.addStyle(HtmlStyle.blockList); + return li; + } + + /** + * Add serializable fields. + * + * @param heading the heading for the section + * @param serializableFieldsTree the tree to be added to the serializable fileds + * content tree + * @return a content tree for the serializable fields content + */ + public Content getSerializableFields(String heading, Content serializableFieldsTree) { + HtmlTree li = new HtmlTree(HtmlTag.LI); + li.addStyle(HtmlStyle.blockList); + if (serializableFieldsTree.isValid()) { + if (!printedOverallAnchor) { + li.addContent(writer.getMarkerAnchor("serializedForm")); + printedOverallAnchor = true; } - } else { - writer.printTableHeadingBackground(heading); - writer.println(); + Content headingContent = new StringContent(heading); + Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING, + headingContent); + li.addContent(serialHeading); + li.addContent(serializableFieldsTree); } + return li; } - public void writeMemberHeader(ClassDoc fieldType, String fieldTypeStr, - String fieldDimensions, String fieldName) { - if (printedFirstMember) { - writer.printMemberHeader(); - } - printedFirstMember = true; - writer.h3(); - writer.print(fieldName); - writer.h3End(); - writer.pre(); + /** + * Add the member header. + * + * @param fieldsType the class document to be listed + * @param fieldTypeStr the string for the filed type to be documented + * @param fieldDimensions the dimensions of the field string to be added + * @param firldName name of the field to be added + * @param contentTree the content tree to which the member header will be added + */ + public void addMemberHeader(ClassDoc fieldType, String fieldTypeStr, + String fieldDimensions, String fieldName, Content contentTree) { + Content nameContent = new RawHtml(fieldName); + Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, nameContent); + contentTree.addContent(heading); + Content pre = new HtmlTree(HtmlTag.PRE); if (fieldType == null) { - writer.print(fieldTypeStr); + pre.addContent(fieldTypeStr); } else { - writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_SERIAL_MEMBER, - fieldType)); + Content fieldContent = new RawHtml(writer.getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_SERIAL_MEMBER, fieldType))); + pre.addContent(fieldContent); } - print(fieldDimensions + ' '); - strong(fieldName); - writer.preEnd(); - assert !writer.getMemberDetailsListPrinted(); + pre.addContent(fieldDimensions + " "); + pre.addContent(fieldName); + contentTree.addContent(pre); } /** - * Write the deprecated information for this member. + * Add the deprecated information for this member. * * @param field the field to document. + * @param contentTree the tree to which the deprecated info will be added */ - public void writeMemberDeprecatedInfo(FieldDoc field) { - printDeprecated(field); + public void addMemberDeprecatedInfo(FieldDoc field, Content contentTree) { + addDeprecatedInfo(field, contentTree); } /** - * Write the description text for this member. + * Add the description text for this member. * * @param field the field to document. + * @param contentTree the tree to which the deprecated info will be added */ - public void writeMemberDescription(FieldDoc field) { + public void addMemberDescription(FieldDoc field, Content contentTree) { if (field.inlineTags().length > 0) { - writer.printMemberDetailsListStartTag(); - writer.dd(); - writer.printInlineComment(field); - writer.ddEnd(); + writer.addInlineComment(field, contentTree); } Tag[] tags = field.tags("serial"); if (tags.length > 0) { - writer.printMemberDetailsListStartTag(); - writer.dd(); - writer.printInlineComment(field, tags[0]); - writer.ddEnd(); + writer.addInlineComment(field, tags[0], contentTree); } } /** - * Write the description text for this member represented by the tag. + * Add the description text for this member represented by the tag. * - * @param serialFieldTag the field to document (represented by tag). + * @param serialFieldTag the field to document (represented by tag) + * @param contentTree the tree to which the deprecated info will be added */ - public void writeMemberDescription(SerialFieldTag serialFieldTag) { + public void addMemberDescription(SerialFieldTag serialFieldTag, Content contentTree) { String serialFieldTagDesc = serialFieldTag.description().trim(); if (!serialFieldTagDesc.isEmpty()) { - writer.dl(); - writer.dd(); - writer.print(serialFieldTagDesc); - writer.ddEnd(); - writer.dlEnd(); + Content serialFieldContent = new RawHtml(serialFieldTagDesc); + Content div = HtmlTree.DIV(HtmlStyle.block, serialFieldContent); + contentTree.addContent(div); } } /** - * Write the tag information for this member. + * Add the tag information for this member. * * @param field the field to document. + * @param contentTree the tree to which the member tags info will be added */ - public void writeMemberTags(FieldDoc field) { + public void addMemberTags(FieldDoc field, Content contentTree) { TagletOutputImpl output = new TagletOutputImpl(""); TagletWriter.genTagOuput(configuration().tagletManager, field, - configuration().tagletManager.getCustomTags(field), + configuration().tagletManager.getCustomTags(field), writer.getTagletWriterInstance(false), output); String outputString = output.toString().trim(); + Content dlTags = new HtmlTree(HtmlTag.DL); if (!outputString.isEmpty()) { - writer.printMemberDetailsListStartTag(); - writer.dd(); - writer.dl(); - print(outputString); - writer.dlEnd(); - writer.ddEnd(); + Content tagContent = new RawHtml(outputString); + dlTags.addContent(tagContent); } + contentTree.addContent(dlTags); } /** @@ -192,24 +225,4 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl return true; return false; } - - public void writeMemberFooter() { - printMemberFooter(); - } - - /** - * Write the footer information. If the serilization overview section was - * printed, check for definition list and close list tag. - * - * @param heading the heading that was written. - */ - public void writeFooter(String heading) { - if (printedOverallAnchor) { - if (heading.equals( - configuration().getText("doclet.Serialized_Form_class"))) { - writer.printMemberDetailsListEndTag(); - assert !writer.getMemberDetailsListPrinted(); - } - } - } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java index fdce605169e..6ce01209cf9 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,57 +28,119 @@ package com.sun.tools.doclets.formats.html; import com.sun.javadoc.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.taglets.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * Generate serialized form for Serializable/Externalizable methods. * Documentation denoted by the serialData tag is processed. * * @author Joe Fialli + * @author Bhavesh Patel (Modified) */ public class HtmlSerialMethodWriter extends MethodWriterImpl implements SerializedFormWriter.SerialMethodWriter{ - private boolean printedFirstMember = false; - public HtmlSerialMethodWriter(SubWriterHolderWriter writer, ClassDoc classdoc) { super(writer, classdoc); } - public void writeHeader(String heading) { - writer.anchor("serialized_methods"); - writer.printTableHeadingBackground(heading); - writer.p(); + /** + * Return the header for serializable methods section. + * + * @return a content tree for the header + */ + public Content getSerializableMethodsHeader() { + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.blockList); + return ul; } - public void writeNoCustomizationMsg(String msg) { - writer.print(msg); - writer.p(); + /** + * Return the header for serializable methods content section. + * + * @param isLastContent true if the cotent being documented is the last content. + * @return a content tree for the header + */ + public Content getMethodsContentHeader(boolean isLastContent) { + HtmlTree li = new HtmlTree(HtmlTag.LI); + if (isLastContent) + li.addStyle(HtmlStyle.blockListLast); + else + li.addStyle(HtmlStyle.blockList); + return li; } - public void writeMemberHeader(MethodDoc member) { - if (printedFirstMember) { - writer.printMemberHeader(); - } - printedFirstMember = true; - writer.anchor(member); - printHead(member); - writeSignature(member); + /** + * Add serializable methods. + * + * @param heading the heading for the section + * @param serializableMethodContent the tree to be added to the serializable methods + * content tree + * @return a content tree for the serializable methods content + */ + public Content getSerializableMethods(String heading, Content serializableMethodContent) { + Content li = HtmlTree.LI(HtmlStyle.blockList, writer.getMarkerAnchor( + "serialized_methods")); + Content headingContent = new StringContent(heading); + Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING, + headingContent); + li.addContent(serialHeading); + li.addContent(serializableMethodContent); + return li; } - public void writeMemberFooter() { - printMemberFooter(); + /** + * Return the no customization message. + * + * @param msg the message to be displayed + * @return no customization message content + */ + public Content getNoCustomizationMsg(String msg) { + Content noCustomizationMsg = new StringContent(msg); + return noCustomizationMsg; } - public void writeDeprecatedMemberInfo(MethodDoc member) { - printDeprecated(member); + /** + * Add the member header. + * + * @param member the method document to be listed + * @param methodsContentTree the content tree to which the member header will be added + */ + public void addMemberHeader(MethodDoc member, Content methodsContentTree) { + methodsContentTree.addContent(writer.getMarkerAnchor( + writer.getAnchor(member))); + methodsContentTree.addContent(getHead(member)); + methodsContentTree.addContent(getSignature(member)); } - public void writeMemberDescription(MethodDoc member) { - printComment(member); + /** + * Add the deprecated information for this member. + * + * @param member the method to document. + * @param methodsContentTree the tree to which the deprecated info will be added + */ + public void addDeprecatedMemberInfo(MethodDoc member, Content methodsContentTree) { + addDeprecatedInfo(member, methodsContentTree); } - public void writeMemberTags(MethodDoc member) { + /** + * Add the description text for this member. + * + * @param member the method to document. + * @param methodsContentTree the tree to which the deprecated info will be added + */ + public void addMemberDescription(MethodDoc member, Content methodsContentTree) { + addComment(member, methodsContentTree); + } + + /** + * Add the tag information for this member. + * + * @param member the method to document. + * @param methodsContentTree the tree to which the member tags info will be added + */ + public void addMemberTags(MethodDoc member, Content methodsContentTree) { TagletOutputImpl output = new TagletOutputImpl(""); TagletManager tagletManager = ConfigurationImpl.getInstance().tagletManager; @@ -86,14 +148,12 @@ public class HtmlSerialMethodWriter extends MethodWriterImpl implements tagletManager.getSerializedFormTags(), writer.getTagletWriterInstance(false), output); String outputString = output.toString().trim(); + Content dlTags = new HtmlTree(HtmlTag.DL); if (!outputString.isEmpty()) { - writer.printMemberDetailsListStartTag(); - writer.dd(); - writer.dl(); - print(outputString); - writer.dlEnd(); - writer.ddEnd(); + Content tagContent = new RawHtml(outputString); + dlTags.addContent(tagContent); } + methodsContentTree.addContent(dlTags); MethodDoc method = member; if (method.name().compareTo("writeExternal") == 0 && method.tags("serialData").length == 0) { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java index 08dc1efab27..8129b8190f6 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +79,7 @@ public class LinkFactoryImpl extends LinkFactory { String filename = pathString(classLinkInfo); if (linkInfo.linkToSelf || !(linkInfo.classDoc.name() + ".html").equals(m_writer.filename)) { - linkOutput.append(m_writer.getHyperLink(filename, + linkOutput.append(m_writer.getHyperLinkString(filename, classLinkInfo.where, label.toString(), classLinkInfo.isStrong, classLinkInfo.styleName, title, classLinkInfo.target)); diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java index 1605d807cfe..87591558482 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +28,9 @@ package com.sun.tools.doclets.formats.html; import java.io.*; import com.sun.javadoc.*; +import com.sun.tools.doclets.formats.html.markup.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.tools.doclets.internal.toolkit.taglets.*; /** * Writes method documentation in HTML format. @@ -43,8 +43,6 @@ import com.sun.tools.doclets.internal.toolkit.taglets.*; public class MethodWriterImpl extends AbstractExecutableMemberWriter implements MethodWriter, MemberSummaryWriter { - private boolean printedSummaryHeader = false; - /** * Construct a new MethodWriterImpl. * @@ -65,184 +63,127 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter } /** - * Write the methods summary header for the given class. - * - * @param classDoc the class the summary belongs to. + * {@inheritDoc} */ - public void writeMemberSummaryHeader(ClassDoc classDoc) { - printedSummaryHeader = true; - writer.println(); - writer.println(""); - writer.println(); - writer.printSummaryHeader(this, classDoc); - } - - /** - * Write the methods summary footer for the given class. - * - * @param classDoc the class the summary belongs to. - */ - public void writeMemberSummaryFooter(ClassDoc classDoc) { - writer.printSummaryFooter(this, classDoc); - } - - /** - * Write the inherited methods summary header for the given class. - * - * @param classDoc the class the summary belongs to. - */ - public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) { - if(! printedSummaryHeader){ - //We don't want inherited summary to not be under heading. - writeMemberSummaryHeader(classDoc); - writeMemberSummaryFooter(classDoc); - printedSummaryHeader = true; - } - writer.printInheritedSummaryHeader(this, classDoc); + public Content getMemberSummaryHeader(ClassDoc classDoc, + Content memberSummaryTree) { + memberSummaryTree.addContent(HtmlConstants.START_OF_METHOD_SUMMARY); + Content memberTree = writer.getMemberTreeHeader(); + writer.addSummaryHeader(this, classDoc, memberTree); + return memberTree; } /** * {@inheritDoc} */ - public void writeInheritedMemberSummary(ClassDoc classDoc, - ProgramElementDoc method, boolean isFirst, boolean isLast) { - writer.printInheritedSummaryMember(this, classDoc, method, isFirst); + public Content getMethodDetailsTreeHeader(ClassDoc classDoc, + Content memberDetailsTree) { + memberDetailsTree.addContent(HtmlConstants.START_OF_METHOD_DETAILS); + Content methodDetailsTree = writer.getMemberTreeHeader(); + methodDetailsTree.addContent(writer.getMarkerAnchor("method_detail")); + Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, + writer.methodDetailsLabel); + methodDetailsTree.addContent(heading); + return methodDetailsTree; } /** - * Write the inherited methods summary footer for the given class. - * - * @param classDoc the class the summary belongs to. + * {@inheritDoc} */ - public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) { - writer.printInheritedSummaryFooter(this, classDoc); ; - } - - /** - * Write the header for the method documentation. - * - * @param classDoc the class that the methods belong to. - */ - public void writeHeader(ClassDoc classDoc, String header) { - writer.println(); - writer.println(""); - writer.println(); - writer.anchor("method_detail"); - writer.printTableHeadingBackground(header); - } - - /** - * Write the method header for the given method. - * - * @param method the method being documented. - * @param isFirst the flag to indicate whether or not the method is the - * first to be documented. - */ - public void writeMethodHeader(MethodDoc method, boolean isFirst) { - if (! isFirst) { - writer.printMemberHeader(); - } - writer.println(); + public Content getMethodDocTreeHeader(MethodDoc method, + Content methodDetailsTree) { String erasureAnchor; if ((erasureAnchor = getErasureAnchor(method)) != null) { - writer.anchor(erasureAnchor); + methodDetailsTree.addContent(writer.getMarkerAnchor((erasureAnchor))); } - writer.anchor(method); - writer.h3(); - writer.print(method.name()); - writer.h3End(); + methodDetailsTree.addContent( + writer.getMarkerAnchor(writer.getAnchor(method))); + Content methodDocTree = writer.getMemberTreeHeader(); + Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); + heading.addContent(method.name()); + methodDocTree.addContent(heading); + return methodDocTree; } /** - * Write the signature for the given method. + * Get the signature for the given method. * * @param method the method being documented. + * @return a content object for the signature */ - public void writeSignature(MethodDoc method) { + public Content getSignature(MethodDoc method) { writer.displayLength = 0; - writer.pre(); - writer.writeAnnotationInfo(method); - printModifiers(method); - writeTypeParameters(method); - printReturnType(method); + Content pre = new HtmlTree(HtmlTag.PRE); + writer.addAnnotationInfo(method, pre); + addModifiers(method, pre); + addTypeParameters(method, pre); + addReturnType(method, pre); if (configuration().linksource) { - writer.printSrcLink(method, method.name()); + Content methodName = new StringContent(method.name()); + writer.addSrcLink(method, methodName, pre); } else { - strong(method.name()); + addName(method.name(), pre); } - writeParameters(method); - writeExceptions(method); - writer.preEnd(); - assert !writer.getMemberDetailsListPrinted(); + addParameters(method, pre); + addExceptions(method, pre); + return pre; } /** - * Write the deprecated output for the given method. - * - * @param method the method being documented. + * {@inheritDoc} */ - public void writeDeprecated(MethodDoc method) { - printDeprecated(method); + public void addDeprecated(MethodDoc method, Content methodDocTree) { + addDeprecatedInfo(method, methodDocTree); } /** - * Write the comments for the given method. - * - * @param method the method being documented. + * {@inheritDoc} */ - public void writeComments(Type holder, MethodDoc method) { + public void addComments(Type holder, MethodDoc method, Content methodDocTree) { ClassDoc holderClassDoc = holder.asClassDoc(); if (method.inlineTags().length > 0) { - writer.printMemberDetailsListStartTag(); if (holder.asClassDoc().equals(classdoc) || - (! (holderClassDoc.isPublic() || + (! (holderClassDoc.isPublic() || Util.isLinkable(holderClassDoc, configuration())))) { - writer.dd(); - writer.printInlineComment(method); - writer.ddEnd(); + writer.addInlineComment(method, methodDocTree); } else { - String classlink = writer.codeText( - writer.getDocLink(LinkInfoImpl.CONTEXT_METHOD_DOC_COPY, + Content link = new RawHtml( + writer.getDocLink(LinkInfoImpl.CONTEXT_METHOD_DOC_COPY, holder.asClassDoc(), method, holder.asClassDoc().isIncluded() ? holder.typeName() : holder.qualifiedTypeName(), - false)); - writer.dd(); - writer.strongText(holder.asClassDoc().isClass()? - "doclet.Description_From_Class": - "doclet.Description_From_Interface", - classlink); - writer.ddEnd(); - writer.dd(); - writer.printInlineComment(method); - writer.ddEnd(); + false)); + Content codelLink = HtmlTree.CODE(link); + Content strong = HtmlTree.STRONG(holder.asClassDoc().isClass()? + writer.descfrmClassLabel : writer.descfrmInterfaceLabel); + strong.addContent(writer.getSpace()); + strong.addContent(codelLink); + methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, strong)); + writer.addInlineComment(method, methodDocTree); } } } /** - * Write the tag output for the given method. - * - * @param method the method being documented. + * {@inheritDoc} */ - public void writeTags(MethodDoc method) { - writer.printTags(method); + public void addTags(MethodDoc method, Content methodDocTree) { + writer.addTagsInfo(method, methodDocTree); } /** - * Write the method footer. + * {@inheritDoc} */ - public void writeMethodFooter() { - printMemberFooter(); + public Content getMethodDetails(Content methodDetailsTree) { + return getMemberTree(methodDetailsTree); } /** - * Write the footer for the method documentation. - * - * @param classDoc the class that the methods belong to. + * {@inheritDoc} */ - public void writeFooter(ClassDoc classDoc) { - //No footer to write for method documentation + public Content getMethodDoc(Content methodDocTree, + boolean isLastContent) { + return getMemberTree(methodDocTree, isLastContent); } /** @@ -256,53 +197,89 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter return VisibleMemberMap.METHODS; } - public void printSummaryLabel() { - writer.printText("doclet.Method_Summary"); + /** + * {@inheritDoc} + */ + public void addSummaryLabel(Content memberTree) { + Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, + writer.getResource("doclet.Method_Summary")); + memberTree.addContent(label); } - public void printTableSummary() { - writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary", + /** + * {@inheritDoc} + */ + public String getTableSummary() { + return configuration().getText("doclet.Member_Table_Summary", configuration().getText("doclet.Method_Summary"), - configuration().getText("doclet.methods"))); + configuration().getText("doclet.methods")); } - public void printSummaryTableHeader(ProgramElementDoc member) { + /** + * {@inheritDoc} + */ + public String getCaption() { + return configuration().getText("doclet.Methods"); + } + + /** + * {@inheritDoc} + */ + public String[] getSummaryTableHeader(ProgramElementDoc member) { String[] header = new String[] { writer.getModifierTypeHeader(), configuration().getText("doclet.0_and_1", configuration().getText("doclet.Method"), configuration().getText("doclet.Description")) }; - writer.summaryTableHeader(header, "col"); + return header; } - public void printSummaryAnchor(ClassDoc cd) { - writer.anchor("method_summary"); + /** + * {@inheritDoc} + */ + public void addSummaryAnchor(ClassDoc cd, Content memberTree) { + memberTree.addContent(writer.getMarkerAnchor("method_summary")); } - public void printInheritedSummaryAnchor(ClassDoc cd) { - writer.anchor("methods_inherited_from_class_" + - ConfigurationImpl.getInstance().getClassName(cd)); + /** + * {@inheritDoc} + */ + public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { + inheritedTree.addContent(writer.getMarkerAnchor( + "methods_inherited_from_class_" + + configuration().getClassName(cd))); } - public void printInheritedSummaryLabel(ClassDoc cd) { - String classlink = writer.getPreQualifiedClassLink( - LinkInfoImpl.CONTEXT_MEMBER, cd, false); - writer.strong(); - String key = cd.isClass()? - "doclet.Methods_Inherited_From_Class" : - "doclet.Methods_Inherited_From_Interface"; - writer.printText(key, classlink); - writer.strongEnd(); + /** + * {@inheritDoc} + */ + public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { + Content classLink = new RawHtml(writer.getPreQualifiedClassLink( + LinkInfoImpl.CONTEXT_MEMBER, cd, false)); + Content label = new StringContent(cd.isClass() ? + configuration().getText("doclet.Methods_Inherited_From_Class") : + configuration().getText("doclet.Methods_Inherited_From_Interface")); + Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING, + label); + labelHeading.addContent(writer.getSpace()); + labelHeading.addContent(classLink); + inheritedTree.addContent(labelHeading); } - protected void printSummaryType(ProgramElementDoc member) { + /** + * {@inheritDoc} + */ + protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { MethodDoc meth = (MethodDoc)member; - printModifierAndType(meth, meth.returnType()); + addModifierAndType(meth, meth.returnType(), tdSummaryType); } - protected static void printOverridden(HtmlDocletWriter writer, - Type overriddenType, MethodDoc method) { + /** + * {@inheritDoc} + */ + protected static void addOverridden(HtmlDocletWriter writer, + Type overriddenType, MethodDoc method, Content dl) { if(writer.configuration.nocomment){ return; } @@ -317,31 +294,33 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter //is not visible so don't document this. return; } - String label = "doclet.Overrides"; + Content label = writer.overridesLabel; int context = LinkInfoImpl.CONTEXT_METHOD_OVERRIDES; if (method != null) { if(overriddenType.asClassDoc().isAbstract() && method.isAbstract()){ //Abstract method is implemented from abstract class, //not overridden - label = "doclet.Specified_By"; + label = writer.specifiedByLabel; context = LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY; } - String overriddenTypeLink = writer.codeText( - writer.getLink(new LinkInfoImpl(context, overriddenType))); + Content dt = HtmlTree.DT(HtmlTree.STRONG(label)); + dl.addContent(dt); + Content overriddenTypeLink = new RawHtml( + writer.getLink(new LinkInfoImpl(context, overriddenType))); + Content codeOverridenTypeLink = HtmlTree.CODE(overriddenTypeLink); String name = method.name(); - writer.dt(); - writer.strongText(label); - writer.dtEnd(); - writer.dd(); - String methLink = writer.codeText( - writer.getLink( + Content methlink = new RawHtml(writer.getLink( new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, - overriddenType.asClassDoc(), - writer.getAnchor(method), name, false) - )); - writer.printText("doclet.in_class", methLink, overriddenTypeLink); - writer.ddEnd(); + overriddenType.asClassDoc(), + writer.getAnchor(method), name, false))); + Content codeMethLink = HtmlTree.CODE(methlink); + Content dd = HtmlTree.DD(codeMethLink); + dd.addContent(writer.getSpace()); + dd.addContent(writer.getResource("doclet.in_class")); + dd.addContent(writer.getSpace()); + dd.addContent(codeOverridenTypeLink); + dl.addContent(dd); } } @@ -363,61 +342,78 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter } } - protected static void printImplementsInfo(HtmlDocletWriter writer, - MethodDoc method) { + /** + * {@inheritDoc} + */ + protected static void addImplementsInfo(HtmlDocletWriter writer, + MethodDoc method, Content dl) { if(writer.configuration.nocomment){ return; } ImplementedMethods implementedMethodsFinder = - new ImplementedMethods(method, writer.configuration); + new ImplementedMethods(method, writer.configuration); MethodDoc[] implementedMethods = implementedMethodsFinder.build(); for (int i = 0; i < implementedMethods.length; i++) { MethodDoc implementedMeth = implementedMethods[i]; Type intfac = implementedMethodsFinder.getMethodHolder(implementedMeth); - String methlink = ""; - String intfaclink = writer.codeText( - writer.getLink(new LinkInfoImpl( + Content intfaclink = new RawHtml(writer.getLink(new LinkInfoImpl( LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY, intfac))); - writer.dt(); - writer.strongText("doclet.Specified_By"); - writer.dtEnd(); - writer.dd(); - methlink = writer.codeText(writer.getDocLink( - LinkInfoImpl.CONTEXT_MEMBER, implementedMeth, - implementedMeth.name(), false)); - writer.printText("doclet.in_interface", methlink, intfaclink); - writer.ddEnd(); + Content codeIntfacLink = HtmlTree.CODE(intfaclink); + Content dt = HtmlTree.DT(HtmlTree.STRONG(writer.specifiedByLabel)); + dl.addContent(dt); + Content methlink = new RawHtml(writer.getDocLink( + LinkInfoImpl.CONTEXT_MEMBER, implementedMeth, + implementedMeth.name(), false)); + Content codeMethLink = HtmlTree.CODE(methlink); + Content dd = HtmlTree.DD(codeMethLink); + dd.addContent(writer.getSpace()); + dd.addContent(writer.getResource("doclet.in_interface")); + dd.addContent(writer.getSpace()); + dd.addContent(codeIntfacLink); + dl.addContent(dd); } - } - protected void printReturnType(MethodDoc method) { + /** + * Add the return type. + * + * @param method the method being documented. + * @param htmltree the content tree to which the return type will be added + */ + protected void addReturnType(MethodDoc method, Content htmltree) { Type type = method.returnType(); if (type != null) { - writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_RETURN_TYPE, - type)); - print(' '); + Content linkContent = new RawHtml(writer.getLink( + new LinkInfoImpl(LinkInfoImpl.CONTEXT_RETURN_TYPE, type))); + htmltree.addContent(linkContent); + htmltree.addContent(writer.getSpace()); } } - protected void printNavSummaryLink(ClassDoc cd, boolean link) { + /** + * {@inheritDoc} + */ + protected Content getNavSummaryLink(ClassDoc cd, boolean link) { if (link) { - writer.printHyperLink("", (cd == null)? + return writer.getHyperLink("", (cd == null)? "method_summary": "methods_inherited_from_class_" + - ConfigurationImpl.getInstance().getClassName(cd), - ConfigurationImpl.getInstance().getText("doclet.navMethod")); + configuration().getClassName(cd), + writer.getResource("doclet.navMethod")); } else { - writer.printText("doclet.navMethod"); + return writer.getResource("doclet.navMethod"); } } - protected void printNavDetailLink(boolean link) { + /** + * {@inheritDoc} + */ + protected void addNavDetailLink(boolean link, Content liNav) { if (link) { - writer.printHyperLink("", "method_detail", - ConfigurationImpl.getInstance().getText("doclet.navMethod")); + liNav.addContent(writer.getHyperLink("", "method_detail", + writer.getResource("doclet.navMethod"))); } else { - writer.printText("doclet.navMethod"); + liNav.addContent(writer.getResource("doclet.navMethod")); } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java index 083adabef80..dda91ced7d6 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 @@ package com.sun.tools.doclets.formats.html; import java.io.*; +import java.util.*; import com.sun.javadoc.*; +import com.sun.tools.doclets.formats.html.markup.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.util.*; @@ -42,8 +44,6 @@ import com.sun.tools.doclets.internal.toolkit.util.*; public class NestedClassWriterImpl extends AbstractMemberWriter implements MemberSummaryWriter { - private boolean printedSummaryHeader = false; - public NestedClassWriterImpl(SubWriterHolderWriter writer, ClassDoc classdoc) { super(writer, classdoc); @@ -53,90 +53,17 @@ public class NestedClassWriterImpl extends AbstractMemberWriter super(writer); } - /** - * Write the classes summary header for the given class. - * - * @param classDoc the class the summary belongs to. - */ - public void writeMemberSummaryHeader(ClassDoc classDoc) { - printedSummaryHeader = true; - writer.println(""); - writer.println(); - writer.printSummaryHeader(this, classDoc); - } - - /** - * Write the classes summary footer for the given class. - * - * @param classDoc the class the summary belongs to. - */ - public void writeMemberSummaryFooter(ClassDoc classDoc) { - writer.printSummaryFooter(this, classDoc); - } - - /** - * Write the inherited classes summary header for the given class. - * - * @param classDoc the class the summary belongs to. - */ - public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) { - if(! printedSummaryHeader){ - //We don't want inherited summary to not be under heading. - writeMemberSummaryHeader(classDoc); - writeMemberSummaryFooter(classDoc); - printedSummaryHeader = true; - } - writer.printInheritedSummaryHeader(this, classDoc); - } - /** * {@inheritDoc} */ - public void writeInheritedMemberSummary(ClassDoc classDoc, - ProgramElementDoc nestedClass, boolean isFirst, boolean isLast) { - writer.printInheritedSummaryMember(this, classDoc, nestedClass, isFirst); + public Content getMemberSummaryHeader(ClassDoc classDoc, + Content memberSummaryTree) { + memberSummaryTree.addContent(HtmlConstants.START_OF_NESTED_CLASS_SUMMARY); + Content memberTree = writer.getMemberTreeHeader(); + writer.addSummaryHeader(this, classDoc, memberTree); + return memberTree; } - /** - * Write the inherited classes summary footer for the given class. - * - * @param classDoc the class the summary belongs to. - */ - public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) { - writer.printInheritedSummaryFooter(this, classDoc); - writer.println(); - } - - /** - * Write the header for the nested class documentation. - * - * @param classDoc the class that the classes belong to. - */ - public void writeHeader(ClassDoc classDoc, String header) { - writer.anchor("nested class_detail"); - writer.printTableHeadingBackground(header); - } - - /** - * Write the nested class header for the given nested class. - * - * @param nestedClass the nested class being documented. - * @param isFirst the flag to indicate whether or not the nested class is the - * first to be documented. - */ - public void writeClassHeader(ClassDoc nestedClass, boolean isFirst) { - if (! isFirst) { - writer.printMemberHeader(); - writer.println(""); - } - writer.anchor(nestedClass.name()); - writer.h3(); - writer.print(nestedClass.name()); - writer.h3End(); - } - - - /** * Close the writer. */ @@ -148,17 +75,35 @@ public class NestedClassWriterImpl extends AbstractMemberWriter return VisibleMemberMap.INNERCLASSES; } - public void printSummaryLabel() { - writer.printText("doclet.Nested_Class_Summary"); + /** + * {@inheritDoc} + */ + public void addSummaryLabel(Content memberTree) { + Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, + writer.getResource("doclet.Nested_Class_Summary")); + memberTree.addContent(label); } - public void printTableSummary() { - writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary", + /** + * {@inheritDoc} + */ + public String getTableSummary() { + return configuration().getText("doclet.Member_Table_Summary", configuration().getText("doclet.Nested_Class_Summary"), - configuration().getText("doclet.nested_classes"))); + configuration().getText("doclet.nested_classes")); } - public void printSummaryTableHeader(ProgramElementDoc member) { + /** + * {@inheritDoc} + */ + public String getCaption() { + return configuration().getText("doclet.Nested_Classes"); + } + + /** + * {@inheritDoc} + */ + public String[] getSummaryTableHeader(ProgramElementDoc member) { String[] header; if (member.isInterface()) { header = new String[] { @@ -176,92 +121,95 @@ public class NestedClassWriterImpl extends AbstractMemberWriter configuration().getText("doclet.Description")) }; } - writer.summaryTableHeader(header, "col"); + return header; } - public void printSummaryAnchor(ClassDoc cd) { - writer.anchor("nested_class_summary"); + /** + * {@inheritDoc} + */ + public void addSummaryAnchor(ClassDoc cd, Content memberTree) { + memberTree.addContent(writer.getMarkerAnchor("nested_class_summary")); } - public void printInheritedSummaryAnchor(ClassDoc cd) { - writer.anchor("nested_classes_inherited_from_class_" + - cd.qualifiedName()); + /** + * {@inheritDoc} + */ + public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { + inheritedTree.addContent(writer.getMarkerAnchor( + "nested_classes_inherited_from_class_" + cd.qualifiedName())); } - public void printInheritedSummaryLabel(ClassDoc cd) { - String clslink = writer.getPreQualifiedClassLink( - LinkInfoImpl.CONTEXT_MEMBER, cd, false); - writer.strong(); - writer.printText(cd.isInterface() ? - "doclet.Nested_Classes_Interface_Inherited_From_Interface" : - "doclet.Nested_Classes_Interfaces_Inherited_From_Class", - clslink); - writer.strongEnd(); + /** + * {@inheritDoc} + */ + public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { + Content classLink = new RawHtml(writer.getPreQualifiedClassLink( + LinkInfoImpl.CONTEXT_MEMBER, cd, false)); + Content label = new StringContent(cd.isInterface() ? + configuration().getText("doclet.Nested_Classes_Interface_Inherited_From_Interface") : + configuration().getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class")); + Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING, + label); + labelHeading.addContent(writer.getSpace()); + labelHeading.addContent(classLink); + inheritedTree.addContent(labelHeading); } - protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) { - writer.strong(); - writer.printLink(new LinkInfoImpl(context, (ClassDoc)member, false)); - writer.strongEnd(); + /** + * {@inheritDoc} + */ + protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member, + Content tdSummary) { + Content strong = HtmlTree.STRONG(new RawHtml( + writer.getLink(new LinkInfoImpl(context, (ClassDoc)member, false)))); + Content code = HtmlTree.CODE(strong); + tdSummary.addContent(code); } - protected void writeInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member) { - writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, - (ClassDoc)member, false)); + /** + * {@inheritDoc} + */ + protected void addInheritedSummaryLink(ClassDoc cd, + ProgramElementDoc member, Content linksTree) { + linksTree.addContent(new RawHtml( + writer.getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, + (ClassDoc)member, false)))); } - protected void printSummaryType(ProgramElementDoc member) { + /** + * {@inheritDoc} + */ + protected void addSummaryType(ProgramElementDoc member, + Content tdSummaryType) { ClassDoc cd = (ClassDoc)member; - printModifierAndType(cd, null); + addModifierAndType(cd, null, tdSummaryType); } - protected void printHeader(ClassDoc cd) { - // N.A. + /** + * {@inheritDoc} + */ + protected Content getDeprecatedLink(ProgramElementDoc member) { + return writer.getQualifiedClassLink(LinkInfoImpl.CONTEXT_MEMBER, + (ClassDoc)member); } - protected void printBodyHtmlEnd(ClassDoc cd) { - // N.A. - } - - protected void printMember(ProgramElementDoc member) { - // N.A. - } - - protected void writeDeprecatedLink(ProgramElementDoc member) { - writer.printQualifiedClassLink(LinkInfoImpl.CONTEXT_MEMBER, - (ClassDoc)member); - } - - protected void printNavSummaryLink(ClassDoc cd, boolean link) { + /** + * {@inheritDoc} + */ + protected Content getNavSummaryLink(ClassDoc cd, boolean link) { if (link) { - writer.printHyperLink("", (cd == null) ? "nested_class_summary": - "nested_classes_inherited_from_class_" + + return writer.getHyperLink("", (cd == null) ? "nested_class_summary": + "nested_classes_inherited_from_class_" + cd.qualifiedName(), - ConfigurationImpl.getInstance().getText("doclet.navNested")); + writer.getResource("doclet.navNested")); } else { - writer.printText("doclet.navNested"); + return writer.getResource("doclet.navNested"); } } - protected void printNavDetailLink(boolean link) { - } - - protected void printMemberLink(ProgramElementDoc member) { - } - - protected void printMembersSummaryLink(ClassDoc cd, ClassDoc icd, - boolean link) { - if (link) { - writer.printHyperLink(cd.name() + ".html", - (cd == icd)? - "nested_class_summary": - "nested_classes_inherited_from_class_" + - icd.qualifiedName(), - ConfigurationImpl.getInstance().getText( - "doclet.Nested_Class_Summary")); - } else { - writer.printText("doclet.Nested_Class_Summary"); - } + /** + * {@inheritDoc} + */ + protected void addNavDetailLink(boolean link, Content liNav) { } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java index 2f19b31e386..69c04fa2bbc 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,20 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.tools.doclets.internal.toolkit.*; - -import com.sun.javadoc.*; import java.io.*; import java.util.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.formats.html.markup.*; + /** * Class to generate file for each package contents in the left-hand bottom * frame. This will list all the Class Kinds in the package. A click on any * class-kind will update the right-hand frame with the clicked class-kind page. * * @author Atul M Dambalkar + * @author Bhavesh Patel (Modified) */ public class PackageFrameWriter extends HtmlDocletWriter { @@ -85,132 +87,107 @@ public class PackageFrameWriter extends HtmlDocletWriter { * @param packageDoc The package for which "pacakge-frame.html" is to be generated. */ public static void generate(ConfigurationImpl configuration, - PackageDoc packageDoc) { + PackageDoc packageDoc) { PackageFrameWriter packgen; try { packgen = new PackageFrameWriter(configuration, packageDoc); String pkgName = Util.getPackageName(packageDoc); - packgen.printHtmlHeader(pkgName, configuration.metakeywords.getMetaKeywords(packageDoc), false); - packgen.printPackageHeader(pkgName); - packgen.generateClassListing(); - packgen.printBodyHtmlEnd(); + Content body = packgen.getBody(false, packgen.getWindowTitle(pkgName)); + Content pkgNameContent = new StringContent(pkgName); + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar, + packgen.getTargetPackageLink(packageDoc, "classFrame", pkgNameContent)); + body.addContent(heading); + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.indexContainer); + packgen.addClassListing(div); + body.addContent(div); + packgen.printHtmlDocument( + configuration.metakeywords.getMetaKeywords(packageDoc), false, body); packgen.close(); } catch (IOException exc) { configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), OUTPUT_FILE_NAME); + "doclet.exception_encountered", + exc.toString(), OUTPUT_FILE_NAME); throw new DocletAbortException(); } } /** - * Generate class listing for all the classes in this package. Divide class + * Add class listing for all the classes in this package. Divide class * listing as per the class kind and generate separate listing for * Classes, Interfaces, Exceptions and Errors. + * + * @param contentTree the content tree to which the listing will be added */ - protected void generateClassListing() { + protected void addClassListing(Content contentTree) { Configuration config = configuration(); if (packageDoc.isIncluded()) { - generateClassKindListing(packageDoc.interfaces(), - configuration.getText("doclet.Interfaces")); - generateClassKindListing(packageDoc.ordinaryClasses(), - configuration.getText("doclet.Classes")); - generateClassKindListing(packageDoc.enums(), - configuration.getText("doclet.Enums")); - generateClassKindListing(packageDoc.exceptions(), - configuration.getText("doclet.Exceptions")); - generateClassKindListing(packageDoc.errors(), - configuration.getText("doclet.Errors")); - generateClassKindListing(packageDoc.annotationTypes(), - configuration.getText("doclet.AnnotationTypes")); + addClassKindListing(packageDoc.interfaces(), + getResource("doclet.Interfaces"), contentTree); + addClassKindListing(packageDoc.ordinaryClasses(), + getResource("doclet.Classes"), contentTree); + addClassKindListing(packageDoc.enums(), + getResource("doclet.Enums"), contentTree); + addClassKindListing(packageDoc.exceptions(), + getResource("doclet.Exceptions"), contentTree); + addClassKindListing(packageDoc.errors(), + getResource("doclet.Errors"), contentTree); + addClassKindListing(packageDoc.annotationTypes(), + getResource("doclet.AnnotationTypes"), contentTree); } else { String name = Util.getPackageName(packageDoc); - generateClassKindListing(config.classDocCatalog.interfaces(name), - configuration.getText("doclet.Interfaces")); - generateClassKindListing(config.classDocCatalog.ordinaryClasses(name), - configuration.getText("doclet.Classes")); - generateClassKindListing(config.classDocCatalog.enums(name), - configuration.getText("doclet.Enums")); - generateClassKindListing(config.classDocCatalog.exceptions(name), - configuration.getText("doclet.Exceptions")); - generateClassKindListing(config.classDocCatalog.errors(name), - configuration.getText("doclet.Errors")); - generateClassKindListing(config.classDocCatalog.annotationTypes(name), - configuration.getText("doclet.AnnotationTypes")); + addClassKindListing(config.classDocCatalog.interfaces(name), + getResource("doclet.Interfaces"), contentTree); + addClassKindListing(config.classDocCatalog.ordinaryClasses(name), + getResource("doclet.Classes"), contentTree); + addClassKindListing(config.classDocCatalog.enums(name), + getResource("doclet.Enums"), contentTree); + addClassKindListing(config.classDocCatalog.exceptions(name), + getResource("doclet.Exceptions"), contentTree); + addClassKindListing(config.classDocCatalog.errors(name), + getResource("doclet.Errors"), contentTree); + addClassKindListing(config.classDocCatalog.annotationTypes(name), + getResource("doclet.AnnotationTypes"), contentTree); } } /** - * Generate specific class kind listing. Also add label to the listing. + * Add specific class kind listing. Also add label to the listing. * - * @param arr Array of specific class kinds, namely Class or Interface or - * Exception or Error. - * @param label Label for the listing + * @param arr Array of specific class kinds, namely Class or Interface or Exception or Error + * @param labelContent content tree of the label to be added + * @param contentTree the content tree to which the class kind listing will be added */ - protected void generateClassKindListing(ClassDoc[] arr, String label) { + protected void addClassKindListing(ClassDoc[] arr, Content labelContent, + Content contentTree) { if(arr.length > 0) { Arrays.sort(arr); - printPackageTableHeader(); - fontSizeStyle("+1", "FrameHeadingFont"); boolean printedHeader = false; + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addAttr(HtmlAttr.TITLE, labelContent.toString()); for (int i = 0; i < arr.length; i++) { if (documentedClasses != null && - !documentedClasses.contains(arr[i])) { + !documentedClasses.contains(arr[i])) { continue; } if (!Util.isCoreClass(arr[i]) || ! - configuration.isGeneratedDoc(arr[i])) { + configuration.isGeneratedDoc(arr[i])) { continue; } if (!printedHeader) { - print(label); - fontEnd(); - println(" "); - fontStyle("FrameItemFont"); + Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + true, labelContent); + contentTree.addContent(heading); printedHeader = true; } - br(); - printLink(new LinkInfoImpl( - LinkInfoImpl.PACKAGE_FRAME, - arr[i], - (arr[i].isInterface() ? - italicsText(arr[i].name()) : - arr[i].name()),"classFrame") - ); + Content link = new RawHtml (getLink(new LinkInfoImpl( + LinkInfoImpl.PACKAGE_FRAME, arr[i], + (arr[i].isInterface() ? italicsText(arr[i].name()) : + arr[i].name()),"classFrame"))); + Content li = HtmlTree.LI(link); + ul.addContent(li); } - fontEnd(); - printPackageTableFooter(); - println(); + contentTree.addContent(ul); } } - - /** - * Print the package link at the top of the class kind listing. Clicking - * this link, package-summary page will appear in the right hand frame. - * - * @param heading Top Heading to be used for the class kind listing. - */ - protected void printPackageHeader(String heading) { - fontSizeStyle("+1", "FrameTitleFont"); - printTargetPackageLink(packageDoc, "classFrame", heading); - fontEnd(); - } - - /** - * The table for the class kind listing. - */ - protected void printPackageTableHeader() { - table(); - tr(); - tdNowrap(); - } - - /** - * Closing Html tags for table of class kind listing. - */ - protected void printPackageTableFooter() { - tdEnd(); - trEnd(); - tableEnd(); - } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java index 60f853f2868..45e58d8120c 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,11 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.util.*; - -import com.sun.javadoc.*; import java.io.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * Generate the package index for the left-hand frame in the generated output. @@ -58,7 +59,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter { String filename = "overview-frame.html"; try { packgen = new PackageIndexFrameWriter(configuration, filename); - packgen.generatePackageIndexFile("doclet.Window_Overview", false); + packgen.buildPackageIndexFile("doclet.Window_Overview", false); packgen.close(); } catch (IOException exc) { configuration.standardmessage.error( @@ -69,114 +70,86 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter { } /** - * Print each package name on separate rows. - * - * @param pd PackageDoc + * {@inheritDoc} */ - protected void printIndexRow(PackageDoc pd) { - fontStyle("FrameItemFont"); - if (pd.name().length() > 0) { - print(getHyperLink(pathString(pd, "package-frame.html"), "", - pd.name(), false, "", "", "packageFrame")); - } else { - print(getHyperLink("package-frame.html", "", "<unnamed package>", - false, "", "", "packageFrame")); + protected void addPackagesList(PackageDoc[] packages, String text, + String tableSummary, Content body) { + Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true, + packagesLabel); + Content div = HtmlTree.DIV(HtmlStyle.indexContainer, heading); + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addAttr(HtmlAttr.TITLE, packagesLabel.toString()); + for(int i = 0; i < packages.length; i++) { + if (packages[i] != null) { + ul.addContent(getPackage(packages[i])); + } } - fontEnd(); - br(); + div.addContent(ul); + body.addContent(div); } /** - * Print the "-packagesheader" string in strong format, at top of the page, - * if it is not the empty string. Otherwise print the "-header" string. - * Despite the name, there is actually no navigation bar for this page. + * Gets each package name as a separate link. + * + * @param pd PackageDoc + * @return content for the package link */ - protected void printNavigationBarHeader() { - printTableHeader(true); - fontSizeStyle("+1", "FrameTitleFont"); - if (configuration.packagesheader.length() > 0) { - strong(replaceDocRootDir(configuration.packagesheader)); + protected Content getPackage(PackageDoc pd) { + Content packageLinkContent; + Content packageLabel; + if (pd.name().length() > 0) { + packageLabel = getPackageLabel(pd.name()); + packageLinkContent = getHyperLink(pathString(pd, + "package-frame.html"), "", packageLabel, "", + "packageFrame"); } else { - strong(replaceDocRootDir(configuration.header)); + packageLabel = new RawHtml("<unnamed package>"); + packageLinkContent = getHyperLink("package-frame.html", + "", packageLabel, "", "packageFrame"); } - fontEnd(); - printTableFooter(true); + Content li = HtmlTree.LI(packageLinkContent); + return li; + } + + /** + * {@inheritDoc} + */ + protected void addNavigationBarHeader(Content body) { + Content headerContent; + if (configuration.packagesheader.length() > 0) { + headerContent = new RawHtml(replaceDocRootDir(configuration.packagesheader)); + } else { + headerContent = new RawHtml(replaceDocRootDir(configuration.header)); + } + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, + HtmlStyle.bar, headerContent); + body.addContent(heading); } /** * Do nothing as there is no overview information in this page. */ - protected void printOverviewHeader() { + protected void addOverviewHeader(Content body) { } /** - * Print Html "table" tag for the package index format. + * Adds "All Classes" link for the top of the left-hand frame page to the + * documentation tree. * - * @param text Text string will not be used in this method. + * @param body the Content object to which the all classes link should be added */ - protected void printIndexHeader(String text, String tableSummary) { - printTableHeader(false); + protected void addAllClassesLink(Content body) { + Content linkContent = getHyperLink("allclasses-frame.html", "", + allclassesLabel, "", "packageFrame"); + Content div = HtmlTree.DIV(HtmlStyle.indexHeader, linkContent); + body.addContent(div); } /** - * Print Html closing "table" tag at the end of the package index. + * {@inheritDoc} */ - protected void printIndexFooter() { - printTableFooter(false); - } - - /** - * Print "All Classes" link at the top of the left-hand frame page. - */ - protected void printAllClassesPackagesLink() { - fontStyle("FrameItemFont"); - print(getHyperLink("allclasses-frame.html", "", - configuration.getText("doclet.All_Classes"), false, "", "", - "packageFrame")); - fontEnd(); - p(); - fontSizeStyle("+1", "FrameHeadingFont"); - printText("doclet.Packages"); - fontEnd(); - br(); - } - - /** - * Just print some space, since there is no navigation bar for this page. - */ - protected void printNavigationBarFooter() { - p(); - space(); - } - - /** - * Print Html closing tags for the table for package index. - * - * @param isHeading true if this is a table for a heading. - */ - private void printTableFooter(boolean isHeading) { - if (isHeading) { - thEnd(); - } else { - tdEnd(); - } - trEnd(); - tableEnd(); - } - - /** - * Print Html tags for the table for package index. - * - * @param isHeading true if this is a table for a heading. - */ - private void printTableHeader(boolean isHeading) { - table(); - tr(); - if (isHeading) { - thAlignNowrap("left"); - } else { - tdNowrap(); - } - + protected void addNavigationBarFooter(Content body) { + Content p = HtmlTree.P(getSpace()); + body.addContent(p); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java index 4088c14f1be..9529d025a48 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,12 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.javadoc.*; import java.io.*; import java.util.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * Generate the package index page "overview-summary.html" for the right-hand @@ -83,7 +85,7 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter { String filename = "overview-summary.html"; try { packgen = new PackageIndexWriter(configuration, filename); - packgen.generatePackageIndexFile("doclet.Window_Overview_Summary", true); + packgen.buildPackageIndexFile("doclet.Window_Overview_Summary", true); packgen.close(); } catch (IOException exc) { configuration.standardmessage.error( @@ -94,124 +96,140 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter { } /** - * Print each package in separate rows in the index table. Generate link - * to each package. - * - * @param pkg Package to which link is to be generated. - */ - protected void printIndexRow(PackageDoc pkg) { - if(pkg != null && pkg.name().length() > 0) { - trBgcolorStyle("white", "TableRowColor"); - summaryRow(20); - strong(); - printPackageLink(pkg, Util.getPackageName(pkg), false); - strongEnd(); - summaryRowEnd(); - summaryRow(0); - printSummaryComment(pkg); - summaryRowEnd(); - trEnd(); - } - } - - /** - * Depending upon the grouping information and their titles, generate + * Depending upon the grouping information and their titles, add * separate table indices for each package group. + * + * @param body the documentation tree to which the index will be added */ - protected void generateIndex() { + protected void addIndex(Content body) { for (int i = 0; i < groupList.size(); i++) { String groupname = groupList.get(i); List list = groupPackageMap.get(groupname); if (list != null && list.size() > 0) { - printIndexContents(list.toArray(new PackageDoc[list.size()]), - groupname, - configuration.getText("doclet.Member_Table_Summary", - groupname, - configuration.getText("doclet.packages"))); + addIndexContents(list.toArray(new PackageDoc[list.size()]), + groupname, configuration.getText("doclet.Member_Table_Summary", + groupname, configuration.getText("doclet.packages")), body); } } } /** - * Print the overview summary comment for this documentation. Print one line + * {@inheritDoc} + */ + protected void addPackagesList(PackageDoc[] packages, String text, + String tableSummary, Content body) { + Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, tableSummary, + getTableCaption(text)); + table.addContent(getSummaryTableHeader(packageTableHeader, "col")); + Content tbody = new HtmlTree(HtmlTag.TBODY); + addPackagesList(packages, tbody); + table.addContent(tbody); + Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table); + body.addContent(div); + } + + /** + * Adds list of packages in the index table. Generate link to each package. + * + * @param packages Packages to which link is to be generated + * @param tbody the documentation tree to which the list will be added + */ + protected void addPackagesList(PackageDoc[] packages, Content tbody) { + for (int i = 0; i < packages.length; i++) { + if (packages[i] != null && packages[i].name().length() > 0) { + Content packageLinkContent = getPackageLink(packages[i], + getPackageName(packages[i])); + Content tdPackage = HtmlTree.TD(HtmlStyle.colFirst, packageLinkContent); + HtmlTree tdSummary = new HtmlTree(HtmlTag.TD); + tdSummary.addStyle(HtmlStyle.colLast); + addSummaryComment(packages[i], tdSummary); + HtmlTree tr = HtmlTree.TR(tdPackage); + tr.addContent(tdSummary); + if (i%2 == 0) + tr.addStyle(HtmlStyle.altColor); + else + tr.addStyle(HtmlStyle.rowColor); + tbody.addContent(tr); + } + } + } + + /** + * Adds the overview summary comment for this documentation. Add one line * summary at the top of the page and generate a link to the description, - * which is generated at the end of this page. + * which is added at the end of this page. + * + * @param body the documentation tree to which the overview header will be added */ - protected void printOverviewHeader() { + protected void addOverviewHeader(Content body) { if (root.inlineTags().length > 0) { - printSummaryComment(root); - p(); - strong(configuration.getText("doclet.See")); - br(); - printNbsps(); - printHyperLink("", "overview_description", - configuration.getText("doclet.Description"), true); - p(); + HtmlTree p = new HtmlTree(HtmlTag.P); + p.addStyle(HtmlStyle.subTitle); + addSummaryComment(root, p); + Content div = HtmlTree.DIV(HtmlStyle.header, p); + Content see = seeLabel; + see.addContent(" "); + Content descPara = HtmlTree.P(see); + Content descLink = getHyperLink("", "overview_description", + descriptionLabel, "", ""); + descPara.addContent(descLink); + div.addContent(descPara); + body.addContent(div); } } /** - * Print Html tags for the table for this package index. - */ - protected void printIndexHeader(String text, String tableSummary) { - tableIndexSummary(tableSummary); - tableCaptionStart(); - print(text); - tableCaptionEnd(); - summaryTableHeader(packageTableHeader, "col"); - } - - /** - * Print Html closing tags for the table for this package index. - */ - protected void printIndexFooter() { - tableEnd(); - p(); - space(); - } - - /** - * Print the overview comment as provided in the file specified by the + * Adds the overview comment as provided in the file specified by the * "-overview" option on the command line. + * + * @param htmltree the documentation tree to which the overview comment will + * be added */ - protected void printOverviewComment() { + protected void addOverviewComment(Content htmltree) { if (root.inlineTags().length > 0) { - anchor("overview_description"); - p(); - printInlineComment(root); - p(); + htmltree.addContent(getMarkerAnchor("overview_description")); + HtmlTree p = new HtmlTree(HtmlTag.P); + p.addStyle(HtmlStyle.subTitle); + addInlineComment(root, p); + htmltree.addContent(p); } } /** - * Call {@link #printOverviewComment()} and then genrate the tag information - * as provided in the file specified by the "-overview" option on the - * command line. + * Adds the tag information as provided in the file specified by the + * "-overview" option on the command line. + * + * @param body the documentation tree to which the overview will be added */ - protected void printOverview() throws IOException { - printOverviewComment(); - printTags(root); + protected void addOverview(Content body) throws IOException { + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.footer); + addOverviewComment(div); + addTagsInfo(root, div); + body.addContent(div); } /** - * Print the top text (from the -top option), the upper + * Adds the top text (from the -top option), the upper * navigation bar, and then the title (from the"-title" * option), at the top of page. + * + * @body the documentation tree to which the navigation bar header will be added */ - protected void printNavigationBarHeader() { - printTop(); - navLinks(true); - hr(); - printConfigurationTitle(); + protected void addNavigationBarHeader(Content body) { + addTop(body); + addNavLinks(true, body); + addConfigurationTitle(body); } /** - * Print the lower navigation bar and the bottom text + * Adds the lower navigation bar and the bottom text * (from the -bottom option) at the bottom of page. + * + * @param the documentation tree to which the navigation bar footer will be added */ - protected void printNavigationBarFooter() { - hr(); - navLinks(false); - printBottom(); + protected void addNavigationBarFooter(Content body) { + addNavLinks(false, body); + addBottom(body); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java index 957dda4d38e..7996655559b 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 +29,15 @@ import java.io.*; import com.sun.javadoc.*; import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; +import com.sun.tools.doclets.internal.toolkit.*; /** * Class to generate Tree page for a package. The name of the file generated is * "package-tree.html" and it is generated in the respective package directory. * * @author Atul M Dambalkar + * @author Bhavesh Patel (Modified) */ public class PackageTreeWriter extends AbstractTreeWriter { @@ -107,94 +110,96 @@ public class PackageTreeWriter extends AbstractTreeWriter { * Generate a separate tree file for each package. */ protected void generatePackageTreeFile() throws IOException { - printHtmlHeader(packagedoc.name() + " " - + configuration.getText("doclet.Window_Class_Hierarchy"), null, true); - - printPackageTreeHeader(); - + Content body = getPackageTreeHeader(); + Content headContent = getResource("doclet.Hierarchy_For_Package", + Util.getPackageName(packagedoc)); + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, + HtmlStyle.title, headContent); + Content div = HtmlTree.DIV(HtmlStyle.header, heading); if (configuration.packages.length > 1) { - printLinkToMainTree(); + addLinkToMainTree(div); } - - generateTree(classtree.baseclasses(), "doclet.Class_Hierarchy"); - generateTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy"); - generateTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy"); - generateTree(classtree.baseEnums(), "doclet.Enum_Hierarchy"); - - printPackageTreeFooter(); - printBottom(); - printBodyHtmlEnd(); + body.addContent(div); + HtmlTree divTree = new HtmlTree(HtmlTag.DIV); + divTree.addStyle(HtmlStyle.contentContainer); + addTree(classtree.baseclasses(), "doclet.Class_Hierarchy", divTree); + addTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy", divTree); + addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree); + addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree); + body.addContent(divTree); + addNavLinks(false, body); + addBottom(body); + printHtmlDocument(null, true, body); } /** - * Print the navigation bar header for the package tree file. + * Get the package tree header. + * + * @return a content tree for the header */ - protected void printPackageTreeHeader() { - printTop(); - navLinks(true); - hr(); - center(); - h2(configuration.getText("doclet.Hierarchy_For_Package", - Util.getPackageName(packagedoc))); - centerEnd(); + protected Content getPackageTreeHeader() { + String title = packagedoc.name() + " " + + configuration.getText("doclet.Window_Class_Hierarchy"); + Content bodyTree = getBody(true, getWindowTitle(title)); + addTop(bodyTree); + addNavLinks(true, bodyTree); + return bodyTree; } /** - * Generate a link to the tree for all the packages. + * Add a link to the tree for all the packages. + * + * @param div the content tree to which the link will be added */ - protected void printLinkToMainTree() { - dl(); - dt(); - strongText("doclet.Package_Hierarchies"); - dtEnd(); - dd(); - navLinkMainTree(configuration.getText("doclet.All_Packages")); - ddEnd(); - dlEnd(); - hr(); + protected void addLinkToMainTree(Content div) { + Content span = HtmlTree.SPAN(HtmlStyle.strong, + getResource("doclet.Package_Hierarchies")); + div.addContent(span); + HtmlTree ul = new HtmlTree (HtmlTag.UL); + ul.addStyle(HtmlStyle.horizontal); + ul.addContent(getNavLinkMainTree(configuration.getText("doclet.All_Packages"))); + div.addContent(ul); } /** - * Print the navigation bar footer for the package tree file. + * Get link for the previous package tree file. + * + * @return a content tree for the link */ - protected void printPackageTreeFooter() { - hr(); - navLinks(false); - } - - /** - * Link for the previous package tree file. - */ - protected void navLinkPrevious() { + protected Content getNavLinkPrevious() { if (prev == null) { - navLinkPrevious(null); + return getNavLinkPrevious(null); } else { String path = DirectoryManager.getRelativePath(packagedoc.name(), - prev.name()); - navLinkPrevious(path + "package-tree.html"); + prev.name()); + return getNavLinkPrevious(path + "package-tree.html"); } } /** - * Link for the next package tree file. + * Get link for the next package tree file. + * + * @return a content tree for the link */ - protected void navLinkNext() { + protected Content getNavLinkNext() { if (next == null) { - navLinkNext(null); + return getNavLinkNext(null); } else { String path = DirectoryManager.getRelativePath(packagedoc.name(), - next.name()); - navLinkNext(path + "package-tree.html"); + next.name()); + return getNavLinkNext(path + "package-tree.html"); } } /** - * Link to the package summary page for the package of this tree. + * Get link to the package summary page for the package of this tree. + * + * @return a content tree for the package link */ - protected void navLinkPackage() { - navCellStart(); - printHyperLink("package-summary.html", "", configuration.getText("doclet.Package"), - true, "NavBarFont1"); - navCellEnd(); + protected Content getNavLinkPackage() { + Content linkContent = getHyperLink("package-summary.html", "", + packageLabel); + Content li = HtmlTree.LI(linkContent); + return li; } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java index 57e2f02995d..5bea2d75204 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,12 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.javadoc.*; import java.io.*; import java.util.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; +import com.sun.tools.doclets.internal.toolkit.*; /** * Generate package usage information. @@ -106,49 +108,74 @@ public class PackageUseWriter extends SubWriterHolderWriter { /** - * Print the class use list. + * Generate the package use list. */ protected void generatePackageUseFile() throws IOException { - printPackageUseHeader(); - + Content body = getPackageUseHeader(); + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.contentContainer); if (usingPackageToUsedClasses.isEmpty()) { - printText("doclet.ClassUse_No.usage.of.0", pkgdoc.name()); - p(); + div.addContent(getResource( + "doclet.ClassUse_No.usage.of.0", pkgdoc.name())); } else { - generatePackageUse(); + addPackageUse(div); } - - printPackageUseFooter(); + body.addContent(div); + addNavLinks(false, body); + addBottom(body); + printHtmlDocument(null, true, body); } /** - * Print the class use list. + * Add the package use information. + * + * @param contentTree the content tree to which the package use information will be added */ - protected void generatePackageUse() throws IOException { + protected void addPackageUse(Content contentTree) throws IOException { + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.blockList); if (configuration.packages.length > 1) { - generatePackageList(); + addPackageList(ul); } - generateClassList(); + addClassList(ul); + contentTree.addContent(ul); } - protected void generatePackageList() throws IOException { - tableIndexSummary(useTableSummary); - tableCaptionStart(); - printText("doclet.ClassUse_Packages.that.use.0", - getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false)); - tableCaptionEnd(); - summaryTableHeader(packageTableHeader, "col"); + /** + * Add the list of packages that use the given package. + * + * @param contentTree the content tree to which the package list will be added + */ + protected void addPackageList(Content contentTree) throws IOException { + Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary, + getTableCaption(configuration().getText( + "doclet.ClassUse_Packages.that.use.0", + getPackageLinkString(pkgdoc, Util.getPackageName(pkgdoc), false)))); + table.addContent(getSummaryTableHeader(packageTableHeader, "col")); + Content tbody = new HtmlTree(HtmlTag.TBODY); Iterator it = usingPackageToUsedClasses.keySet().iterator(); - while (it.hasNext()) { + for (int i = 0; it.hasNext(); i++) { PackageDoc pkg = configuration.root.packageNamed(it.next()); - generatePackageUse(pkg); + HtmlTree tr = new HtmlTree(HtmlTag.TR); + if (i % 2 == 0) { + tr.addStyle(HtmlStyle.altColor); + } else { + tr.addStyle(HtmlStyle.rowColor); + } + addPackageUse(pkg, tr); + tbody.addContent(tr); } - tableEnd(); - space(); - p(); + table.addContent(tbody); + Content li = HtmlTree.LI(HtmlStyle.blockList, table); + contentTree.addContent(li); } - protected void generateClassList() throws IOException { + /** + * Add the list of classes that use the given package. + * + * @param contentTree the content tree to which the class list will be added + */ + protected void addClassList(Content contentTree) throws IOException { String[] classTableHeader = new String[] { configuration.getText("doclet.0_and_1", configuration.getText("doclet.Class"), @@ -158,117 +185,126 @@ public class PackageUseWriter extends SubWriterHolderWriter { while (itp.hasNext()) { String packageName = itp.next(); PackageDoc usingPackage = configuration.root.packageNamed(packageName); + HtmlTree li = new HtmlTree(HtmlTag.LI); + li.addStyle(HtmlStyle.blockList); if (usingPackage != null) { - anchor(usingPackage.name()); + li.addContent(getMarkerAnchor(usingPackage.name())); } - tableIndexSummary(configuration.getText("doclet.Use_Table_Summary", - configuration.getText("doclet.classes"))); - tableCaptionStart(); - printText("doclet.ClassUse_Classes.in.0.used.by.1", - getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false), - getPackageLink(usingPackage,Util.getPackageName(usingPackage), false)); - tableCaptionEnd(); - summaryTableHeader(classTableHeader, "col"); + String tableSummary = configuration.getText("doclet.Use_Table_Summary", + configuration.getText("doclet.classes")); + Content table = HtmlTree.TABLE(0, 3, 0, tableSummary, + getTableCaption(configuration().getText( + "doclet.ClassUse_Classes.in.0.used.by.1", + getPackageLinkString(pkgdoc, Util.getPackageName(pkgdoc), false), + getPackageLinkString(usingPackage,Util.getPackageName(usingPackage), false)))); + table.addContent(getSummaryTableHeader(classTableHeader, "col")); + Content tbody = new HtmlTree(HtmlTag.TBODY); Iterator itc = usingPackageToUsedClasses.get(packageName).iterator(); - while (itc.hasNext()) { - printClassRow(itc.next(), packageName); + for (int i = 0; itc.hasNext(); i++) { + HtmlTree tr = new HtmlTree(HtmlTag.TR); + if (i % 2 == 0) { + tr.addStyle(HtmlStyle.altColor); + } else { + tr.addStyle(HtmlStyle.rowColor); + } + addClassRow(itc.next(), packageName, tr); + tbody.addContent(tr); } - tableEnd(); - space(); - p(); + table.addContent(tbody); + li.addContent(table); + contentTree.addContent(li); } } - protected void printClassRow(ClassDoc usedClass, String packageName) { + /** + * Add a row for the class that uses the given package. + * + * @param usedClass the class that uses the given package + * @param packageName the name of the package to which the class belongs + * @param contentTree the content tree to which the row will be added + */ + protected void addClassRow(ClassDoc usedClass, String packageName, + Content contentTree) { String path = pathString(usedClass, - "class-use/" + usedClass.name() + ".html"); - - trBgcolorStyle("white", "TableRowColor"); - summaryRow(0); - strong(); - printHyperLink(path, packageName, usedClass.name(), true); - strongEnd(); - println(); br(); - printNbsps(); - printIndexComment(usedClass); - summaryRowEnd(); - trEnd(); + "class-use/" + usedClass.name() + ".html"); + Content td = HtmlTree.TD(HtmlStyle.colOne, + getHyperLink(path, packageName, new StringContent(usedClass.name()))); + addIndexComment(usedClass, td); + contentTree.addContent(td); } /** - * Print the package use list. + * Add the package use information. + * + * @param pkg the package that used the given package + * @param contentTree the content tree to which the information will be added */ - protected void generatePackageUse(PackageDoc pkg) throws IOException { - trBgcolorStyle("white", "TableRowColor"); - summaryRow(0); - //Just want an anchor here. - printHyperLink("", pkg.name(), Util.getPackageName(pkg), true); - summaryRowEnd(); - summaryRow(0); - if (pkg != null) { - printSummaryComment(pkg); - } - space(); - summaryRowEnd(); - trEnd(); + protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException { + Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, + getHyperLink("", pkg.name(), new StringContent(Util.getPackageName(pkg)))); + contentTree.addContent(tdFirst); + HtmlTree tdLast = new HtmlTree(HtmlTag.TD); + tdLast.addStyle(HtmlStyle.colLast); + if (pkg != null) + addSummaryComment(pkg, tdLast); + else + tdLast.addContent(getSpace()); + contentTree.addContent(tdLast); } /** - * Print the header for the class use Listing. + * Get the header for the package use listing. + * + * @return a content tree representing the package use header */ - protected void printPackageUseHeader() { - String packageLabel = configuration.getText("doclet.Package"); + protected Content getPackageUseHeader() { + String packageText = configuration.getText("doclet.Package"); String name = pkgdoc.name(); - printHtmlHeader(configuration.getText("doclet.Window_ClassUse_Header", - packageLabel, name), null, true); - printTop(); - navLinks(true); - hr(); - center(); - h2(); - strongText("doclet.ClassUse_Title", packageLabel, name); - h2End(); - centerEnd(); + String title = configuration.getText("doclet.Window_ClassUse_Header", + packageText, name); + Content bodyTree = getBody(true, getWindowTitle(title)); + addTop(bodyTree); + addNavLinks(true, bodyTree); + Content headContent = getResource("doclet.ClassUse_Title", packageText, name); + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, + HtmlStyle.title, headContent); + Content div = HtmlTree.DIV(HtmlStyle.header, heading); + bodyTree.addContent(div); + return bodyTree; } /** - * Print the footer for the class use Listing. + * Get this package link. + * + * @return a content tree for the package link */ - protected void printPackageUseFooter() { - hr(); - navLinks(false); - printBottom(); - printBodyHtmlEnd(); - } - - - /** - * Print this package link - */ - protected void navLinkPackage() { - navCellStart(); - printHyperLink("package-summary.html", "", configuration.getText("doclet.Package"), - true, "NavBarFont1"); - navCellEnd(); + protected Content getNavLinkPackage() { + Content linkContent = getHyperLink("package-summary.html", "", + packageLabel); + Content li = HtmlTree.LI(linkContent); + return li; } /** - * Print class use link + * Get the use link. + * + * @return a content tree for the use link */ - protected void navLinkClassUse() { - navCellRevStart(); - fontStyle("NavBarFont1Rev"); - strongText("doclet.navClassUse"); - fontEnd(); - navCellEnd(); + protected Content getNavLinkClassUse() { + Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, useLabel); + return li; } - protected void navLinkTree() { - navCellStart(); - printHyperLink("package-tree.html", "", configuration.getText("doclet.Tree"), - true, "NavBarFont1"); - navCellEnd(); + /** + * Get the tree link. + * + * @return a content tree for the tree link + */ + protected Content getNavLinkTree() { + Content linkContent = getHyperLink("package-tree.html", "", + treeLabel); + Content li = HtmlTree.LI(linkContent); + return li; } - } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java index b7cef1b661e..d74d994d039 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 +25,12 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -import com.sun.javadoc.*; import java.io.*; import java.util.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * Class to generate file for each package contents in the right-hand @@ -98,189 +98,206 @@ public class PackageWriterImpl extends HtmlDocletWriter /** * {@inheritDoc} */ - public void writeSummaryHeader() {} + public Content getPackageHeader(String heading) { + String pkgName = packageDoc.name(); + Content bodyTree = getBody(true, getWindowTitle(pkgName)); + addTop(bodyTree); + addNavLinks(true, bodyTree); + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.header); + Content annotationContent = new HtmlTree(HtmlTag.P); + addAnnotationInfo(packageDoc, annotationContent); + div.addContent(annotationContent); + Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, + HtmlStyle.title, packageLabel); + tHeading.addContent(getSpace()); + Content packageHead = new RawHtml(heading); + tHeading.addContent(packageHead); + div.addContent(tHeading); + if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) { + HtmlTree p = new HtmlTree(HtmlTag.P); + p.addStyle(HtmlStyle.subTitle); + addSummaryComment(packageDoc, p); + div.addContent(p); + Content space = getSpace(); + Content descLink = getHyperLink("", "package_description", + descriptionLabel, "", ""); + Content descPara = new HtmlTree(HtmlTag.P, seeLabel, space, descLink); + div.addContent(descPara); + } + bodyTree.addContent(div); + return bodyTree; + } /** * {@inheritDoc} */ - public void writeSummaryFooter() {} + public Content getContentHeader() { + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.contentContainer); + return div; + } /** * {@inheritDoc} */ - public void writeClassesSummary(ClassDoc[] classes, String label, String tableSummary, String[] tableHeader) { + public Content getSummaryHeader() { + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.blockList); + return ul; + } + + /** + * {@inheritDoc} + */ + public void addClassesSummary(ClassDoc[] classes, String label, + String tableSummary, String[] tableHeader, Content summaryContentTree) { if(classes.length > 0) { Arrays.sort(classes); - tableIndexSummary(tableSummary); - boolean printedHeading = false; + Content caption = getTableCaption(label); + Content table = HtmlTree.TABLE(HtmlStyle.packageSummary, 0, 3, 0, + tableSummary, caption); + table.addContent(getSummaryTableHeader(tableHeader, "col")); + Content tbody = new HtmlTree(HtmlTag.TBODY); for (int i = 0; i < classes.length; i++) { - if (!printedHeading) { - printTableCaption(label); - printFirstRow(tableHeader); - printedHeading = true; - } if (!Util.isCoreClass(classes[i]) || !configuration.isGeneratedDoc(classes[i])) { continue; } - trBgcolorStyle("white", "TableRowColor"); - summaryRow(15); - strong(); - printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_PACKAGE, - classes[i], false)); - strongEnd(); - summaryRowEnd(); - summaryRow(0); + Content classContent = new RawHtml(getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_PACKAGE, classes[i], false))); + Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent); + HtmlTree tr = HtmlTree.TR(tdClass); + if (i%2 == 0) + tr.addStyle(HtmlStyle.altColor); + else + tr.addStyle(HtmlStyle.rowColor); + HtmlTree tdClassDescription = new HtmlTree(HtmlTag.TD); + tdClassDescription.addStyle(HtmlStyle.colLast); if (Util.isDeprecated(classes[i])) { - strongText("doclet.Deprecated"); + tdClassDescription.addContent(deprecatedLabel); if (classes[i].tags("deprecated").length > 0) { - space(); - printSummaryDeprecatedComment(classes[i], - classes[i].tags("deprecated")[0]); + addSummaryDeprecatedComment(classes[i], + classes[i].tags("deprecated")[0], tdClassDescription); } - } else { - printSummaryComment(classes[i]); } - summaryRowEnd(); - trEnd(); + else + addSummaryComment(classes[i], tdClassDescription); + tr.addContent(tdClassDescription); + tbody.addContent(tr); } - tableEnd(); - println(" "); - p(); + table.addContent(tbody); + Content li = HtmlTree.LI(HtmlStyle.blockList, table); + summaryContentTree.addContent(li); } } - /** - * Print the table caption for the class-listing. - * - * @param label label for the Class kind listing. - */ - protected void printTableCaption(String label) { - tableCaptionStart(); - print(label); - tableCaptionEnd(); - } - - /** - * Print the table heading for the class-listing. - * - * @param tableHeader table header string for the Class listing. - */ - protected void printFirstRow(String[] tableHeader) { - summaryTableHeader(tableHeader, "col"); - } - /** * {@inheritDoc} */ - public void writePackageDescription() { + public void addPackageDescription(Content packageContentTree) { if (packageDoc.inlineTags().length > 0) { - anchor("package_description"); - h2(configuration.getText("doclet.Package_Description", packageDoc.name())); - p(); - printInlineComment(packageDoc); - p(); + packageContentTree.addContent(getMarkerAnchor("package_description")); + Content h2Content = new StringContent( + configuration.getText("doclet.Package_Description", + packageDoc.name())); + packageContentTree.addContent(HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, + true, h2Content)); + addInlineComment(packageDoc, packageContentTree); } } /** * {@inheritDoc} */ - public void writePackageTags() { - printTags(packageDoc); + public void addPackageTags(Content packageContentTree) { + addTagsInfo(packageDoc, packageContentTree); } /** * {@inheritDoc} */ - public void writePackageHeader(String heading) { - String pkgName = packageDoc.name(); - printHtmlHeader(pkgName, - configuration.metakeywords.getMetaKeywords(packageDoc), true); - printTop(); - navLinks(true); - hr(); - writeAnnotationInfo(packageDoc); - h2(configuration.getText("doclet.Package") + " " + heading); - if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) { - printSummaryComment(packageDoc); - p(); - strong(configuration.getText("doclet.See")); - br(); - printNbsps(); - printHyperLink("", "package_description", - configuration.getText("doclet.Description"), true); - p(); - } + public void addPackageFooter(Content contentTree) { + addNavLinks(false, contentTree); + addBottom(contentTree); } /** * {@inheritDoc} */ - public void writePackageFooter() { - hr(); - navLinks(false); - printBottom(); - printBodyHtmlEnd(); + public void printDocument(Content contentTree) { + printHtmlDocument(configuration.metakeywords.getMetaKeywords(packageDoc), + true, contentTree); } /** - * Print "Use" link for this pacakge in the navigation bar. + * Get "Use" link for this pacakge in the navigation bar. + * + * @return a content tree for the class use link */ - protected void navLinkClassUse() { - navCellStart(); - printHyperLink("package-use.html", "", configuration.getText("doclet.navClassUse"), - true, "NavBarFont1"); - navCellEnd(); + protected Content getNavLinkClassUse() { + Content useLink = getHyperLink("package-use.html", "", + useLabel, "", ""); + Content li = HtmlTree.LI(useLink); + return li; } /** - * Print "PREV PACKAGE" link in the navigation bar. + * Get "PREV PACKAGE" link in the navigation bar. + * + * @return a content tree for the previous link */ - protected void navLinkPrevious() { + public Content getNavLinkPrevious() { + Content li; if (prev == null) { - printText("doclet.Prev_Package"); + li = HtmlTree.LI(prevpackageLabel); } else { String path = DirectoryManager.getRelativePath(packageDoc.name(), prev.name()); - printHyperLink(path + "package-summary.html", "", - configuration.getText("doclet.Prev_Package"), true); + li = HtmlTree.LI(getHyperLink(path + "package-summary.html", "", + prevpackageLabel, "", "")); } + return li; } /** - * Print "NEXT PACKAGE" link in the navigation bar. + * Get "NEXT PACKAGE" link in the navigation bar. + * + * @return a content tree for the next link */ - protected void navLinkNext() { + public Content getNavLinkNext() { + Content li; if (next == null) { - printText("doclet.Next_Package"); + li = HtmlTree.LI(nextpackageLabel); } else { String path = DirectoryManager.getRelativePath(packageDoc.name(), next.name()); - printHyperLink(path + "package-summary.html", "", - configuration.getText("doclet.Next_Package"), true); + li = HtmlTree.LI(getHyperLink(path + "package-summary.html", "", + nextpackageLabel, "", "")); } + return li; } /** - * Print "Tree" link in the navigation bar. This will be link to the package + * Get "Tree" link in the navigation bar. This will be link to the package * tree file. + * + * @return a content tree for the tree link */ - protected void navLinkTree() { - navCellStart(); - printHyperLink("package-tree.html", "", configuration.getText("doclet.Tree"), - true, "NavBarFont1"); - navCellEnd(); + protected Content getNavLinkTree() { + Content useLink = getHyperLink("package-tree.html", "", + treeLabel, "", ""); + Content li = HtmlTree.LI(useLink); + return li; } /** * Highlight "Package" in the navigation bar, as this is the package page. + * + * @return a content tree for the package link */ - protected void navLinkPackage() { - navCellRevStart(); - fontStyle("NavBarFont1Rev"); - strongText("doclet.Package"); - fontEnd(); - navCellEnd(); + protected Content getNavLinkPackage() { + Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, packageLabel); + return li; } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java index e06a5a1f959..6d39f0a4cc7 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 +25,10 @@ package com.sun.tools.doclets.formats.html; -import com.sun.javadoc.*; import java.io.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.formats.html.markup.*; +import com.sun.tools.doclets.internal.toolkit.*; /** * Generate the Serialized Form Information Page. @@ -64,76 +66,167 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter } /** - * Write the given package header. + * Get the given header. * - * @param packageName the package header to write. + * @param header the header to write + * @return the body content tree */ - public void writePackageHeader(String packageName) { - hr(4, "noshade"); - tableHeader(); - thAlign("center"); - font("+2"); - strongText("doclet.Package"); - print(' '); - strong(packageName); - tableFooter(); + public Content getHeader(String header) { + Content bodyTree = getBody(true, getWindowTitle(header)); + addTop(bodyTree); + addNavLinks(true, bodyTree); + Content h1Content = new StringContent(header); + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, + HtmlStyle.title, h1Content); + Content div = HtmlTree.DIV(HtmlStyle.header, heading); + bodyTree.addContent(div); + return bodyTree; } /** - * Write the serial UID info. + * Get the serialized form summaries header. * - * @param header the header that will show up before the UID. - * @param serialUID the serial UID to print. + * @return the serialized form summary header tree */ - public void writeSerialUIDInfo(String header, String serialUID) { - strong(header + " "); - println(serialUID); - p(); + public Content getSerializedSummariesHeader() { + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.blockList); + return ul; } /** - * Write the footer. + * Get the package serialized form header. + * + * @return the package serialized form header tree */ - public void writeFooter() { - p(); - hr(); - navLinks(false); - printBottom(); - printBodyHtmlEnd(); + public Content getPackageSerializedHeader() { + HtmlTree li = new HtmlTree(HtmlTag.LI); + li.addStyle(HtmlStyle.blockList); + return li; } + /** + * Get the given package header. + * + * @param packageName the package header to write + * @return a content tree for the package header + */ + public Content getPackageHeader(String packageName) { + Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true, + packageLabel); + heading.addContent(getSpace()); + heading.addContent(packageName); + return heading; + } /** - * Write the serializable class heading. + * Get the serialized class header. * - * @param classDoc the class being processed. + * @return a content tree for the serialized class header */ - public void writeClassHeader(ClassDoc classDoc) { + public Content getClassSerializedHeader() { + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.blockList); + return ul; + } + + /** + * Get the serializable class heading. + * + * @param classDoc the class being processed + * @return a content tree for the class header + */ + public Content getClassHeader(ClassDoc classDoc) { String classLink = (classDoc.isPublic() || classDoc.isProtected())? getLink(new LinkInfoImpl(classDoc, - configuration.getClassName(classDoc))): + configuration.getClassName(classDoc))): classDoc.qualifiedName(); - p(); - anchor(classDoc.qualifiedName()); + Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor( + classDoc.qualifiedName())); String superClassLink = classDoc.superclassType() != null ? getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_SERIALIZED_FORM, - classDoc.superclassType())) : + classDoc.superclassType())) : null; //Print the heading. String className = superClassLink == null ? configuration.getText( - "doclet.Class_0_implements_serializable", classLink) : + "doclet.Class_0_implements_serializable", classLink) : configuration.getText( - "doclet.Class_0_extends_implements_serializable", classLink, - superClassLink); - tableHeader(); - thAlignColspan("left", 2); - font("+2"); - strong(className); - tableFooter(); - p(); + "doclet.Class_0_extends_implements_serializable", classLink, + superClassLink); + Content classNameContent = new RawHtml(className); + li.addContent(HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING, + classNameContent)); + return li; + } + + /** + * Get the serial UID info header. + * + * @return a content tree for the serial uid info header + */ + public Content getSerialUIDInfoHeader() { + HtmlTree dl = new HtmlTree(HtmlTag.DL); + dl.addStyle(HtmlStyle.nameValue); + return dl; + } + + /** + * Adds the serial UID info. + * + * @param header the header that will show up before the UID. + * @param serialUID the serial UID to print. + * @param serialUidTree the serial UID content tree to which the serial UID + * content will be added + */ + public void addSerialUIDInfo(String header, String serialUID, + Content serialUidTree) { + Content headerContent = new StringContent(header); + serialUidTree.addContent(HtmlTree.DT(headerContent)); + Content serialContent = new StringContent(serialUID); + serialUidTree.addContent(HtmlTree.DD(serialContent)); + } + + /** + * Get the class serialize content header. + * + * @return a content tree for the class serialize content header + */ + public Content getClassContentHeader() { + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.blockList); + return ul; + } + + /** + * Get the serialized content tree section. + * + * @param serializedTreeContent the serialized content tree to be added + * @return a div content tree + */ + public Content getSerializedContent(Content serializedTreeContent) { + Content divContent = HtmlTree.DIV(HtmlStyle.serializedFormContainer, + serializedTreeContent); + return divContent; + } + + /** + * Add the footer. + * + * @param serializedTree the serialized tree to be added + */ + public void addFooter(Content serializedTree) { + addNavLinks(false, serializedTree); + addBottom(serializedTree); + } + + /** + * {@inheritDoc} + */ + public void printDocument(Content serializedTree) { + printHtmlDocument(null, true, serializedTree); } private void tableHeader() { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java index fcb6ece5883..6bbcae6c14f 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +25,10 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.util.*; - import java.io.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; +import com.sun.tools.doclets.internal.toolkit.*; /** * Generate only one index file for all the Member Names with Indexing in @@ -36,6 +37,7 @@ import java.io.*; * * @see java.lang.Character * @author Atul M Dambalkar + * @author Bhavesh Patel (Modified) */ public class SingleIndexWriter extends AbstractIndexWriter { @@ -82,34 +84,35 @@ public class SingleIndexWriter extends AbstractIndexWriter { * Member Field, Method and Constructor Description. */ protected void generateIndexFile() throws IOException { - printHtmlHeader(configuration.getText("doclet.Window_Single_Index"), - null, true); - printTop(); - navLinks(true); - printLinksForIndexes(); - - hr(); - + String title = configuration.getText("doclet.Window_Single_Index"); + Content body = getBody(true, getWindowTitle(title)); + addTop(body); + addNavLinks(true, body); + HtmlTree divTree = new HtmlTree(HtmlTag.DIV); + divTree.addStyle(HtmlStyle.contentContainer); + addLinksForIndexes(divTree); for (int i = 0; i < indexbuilder.elements().length; i++) { Character unicode = (Character)((indexbuilder.elements())[i]); - generateContents(unicode, indexbuilder.getMemberList(unicode)); + addContents(unicode, indexbuilder.getMemberList(unicode), divTree); } - - printLinksForIndexes(); - navLinks(false); - - printBottom(); - printBodyHtmlEnd(); + addLinksForIndexes(divTree); + body.addContent(divTree); + addNavLinks(false, body); + addBottom(body); + printHtmlDocument(null, true, body); } /** - * Print Links for all the Index Files per unicode character. + * Add links for all the Index Files per unicode character. + * + * @param contentTree the content tree to which the links for indexes will be added */ - protected void printLinksForIndexes() { + protected void addLinksForIndexes(Content contentTree) { for (int i = 0; i < indexbuilder.elements().length; i++) { String unicode = (indexbuilder.elements())[i].toString(); - printHyperLink("#_" + unicode + "_", unicode); - print(' '); + contentTree.addContent( + getHyperLink("#_" + unicode + "_", new StringContent(unicode))); + contentTree.addContent(getSpace()); } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java similarity index 55% rename from langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java rename to langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java index 578160588f5..9a612f8bb49 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 +23,14 @@ * questions. */ -package com.sun.tools.doclets.internal.toolkit.util; +package com.sun.tools.doclets.formats.html; import java.io.*; -import java.util.*; import javax.tools.FileObject; - import com.sun.javadoc.*; import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * Converts Java Source Code to HTML. @@ -40,27 +40,28 @@ import com.sun.tools.doclets.internal.toolkit.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.4 */ public class SourceToHTMLConverter { - /** - * The background color. - */ - protected static final String BGCOLOR = "white"; - - /** - * The line number color. - */ - protected static final String LINE_NO_COLOR = "green"; - /** * The number of trailing blank lines at the end of the page. * This is inserted so that anchors at the bottom of small pages * can be reached. */ - protected static final int NUM_BLANK_LINES = 60; + private static final int NUM_BLANK_LINES = 60; + /** + * New line to be added to the documentation. + */ + private static final Content NEW_LINE = new RawHtml(DocletConstants.NL); + + /** + * Relative path from the documentation root to the file that is being + * generated. + */ + private static String relativePath = ""; /** * Source is converted to HTML using static methods below. @@ -69,11 +70,13 @@ public class SourceToHTMLConverter { /** * Convert the Classes in the given RootDoc to an HTML. + * * @param configuration the configuration. * @param rd the RootDoc to convert. * @param outputdir the name of the directory to output to. */ - public static void convertRoot(Configuration configuration, RootDoc rd, String outputdir) { + public static void convertRoot(ConfigurationImpl configuration, RootDoc rd, + String outputdir) { if (rd == null || outputdir == null) { return; } @@ -84,17 +87,19 @@ public class SourceToHTMLConverter { ClassDoc[] cds = rd.specifiedClasses(); for (int i = 0; i < cds.length; i++) { convertClass(configuration, cds[i], - getPackageOutputDir(outputdir, cds[i].containingPackage())); + getPackageOutputDir(outputdir, cds[i].containingPackage())); } } /** * Convert the Classes in the given Package to an HTML. + * * @param configuration the configuration. * @param pd the Package to convert. * @param outputdir the name of the directory to output to. */ - public static void convertPackage(Configuration configuration, PackageDoc pd, String outputdir) { + public static void convertPackage(ConfigurationImpl configuration, PackageDoc pd, + String outputdir) { if (pd == null || outputdir == null) { return; } @@ -107,8 +112,10 @@ public class SourceToHTMLConverter { /** * Return the directory write output to for the given package. + * * @param outputDir the directory to output to. * @param pd the Package to generate output for. + * @return the package output directory as a String. */ private static String getPackageOutputDir(String outputDir, PackageDoc pd) { return outputDir + File.separator + @@ -117,11 +124,13 @@ public class SourceToHTMLConverter { /** * Convert the given Class to an HTML. + * * @param configuration the configuration. * @param cd the class to convert. * @param outputdir the name of the directory to output to. */ - public static void convertClass(Configuration configuration, ClassDoc cd, String outputdir) { + public static void convertClass(ConfigurationImpl configuration, ClassDoc cd, + String outputdir) { if (cd == null || outputdir == null) { return; } @@ -145,19 +154,23 @@ public class SourceToHTMLConverter { LineNumberReader reader = new LineNumberReader(r); int lineno = 1; String line; - StringBuffer output = new StringBuffer(); + relativePath = DirectoryManager.getRelativePath(DocletConstants.SOURCE_OUTPUT_DIR_NAME) + + DirectoryManager.getRelativePath(cd.containingPackage()); + Content body = getHeader(); + Content pre = new HtmlTree(HtmlTag.PRE); try { while ((line = reader.readLine()) != null) { - output.append(formatLine(line, configuration.sourcetab, lineno)); + addLineNo(pre, lineno); + addLine(pre, line, configuration.sourcetab, lineno); lineno++; } } finally { reader.close(); } - output = addLineNumbers(output.toString()); - output.insert(0, getHeader(configuration)); - output.append(getFooter()); - writeToFile(output.toString(), outputdir, cd.name(), configuration); + addBlankLines(pre); + Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre); + body.addContent(div); + writeToFile(body, outputdir, cd.name(), configuration); } catch (Exception e){ e.printStackTrace(); } @@ -165,135 +178,117 @@ public class SourceToHTMLConverter { /** * Write the output to the file. - * @param output the string to output. + * + * @param body the documentation content to be written to the file. * @param outputDir the directory to output to. * @param className the name of the class that I am converting to HTML. * @param configuration the Doclet configuration to pass notices to. */ - private static void writeToFile(String output, String outputDir, String className, Configuration configuration) throws IOException { + private static void writeToFile(Content body, String outputDir, + String className, ConfigurationImpl configuration) throws IOException { + Content htmlDocType = DocType.Transitional(); + Content head = new HtmlTree(HtmlTag.HEAD); + head.addContent(HtmlTree.TITLE(new StringContent( + configuration.getText("doclet.Window_Source_title")))); + head.addContent(getStyleSheetProperties(configuration)); + Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), + head, body); + Content htmlDocument = new HtmlDocument(htmlDocType, htmlTree); File dir = new File(outputDir); dir.mkdirs(); File newFile = new File(dir, className + ".html"); configuration.message.notice("doclet.Generating_0", newFile.getPath()); FileOutputStream fout = new FileOutputStream(newFile); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fout)); - bw.write(output); + bw.write(htmlDocument.toString()); bw.close(); fout.close(); } /** - * Given a String, add line numbers. - * @param s the text to add line numbers to. + * Returns a link to the stylesheet file. * - * @return the string buffer with the line numbering for each line. + * @param configuration the doclet configuration for the current run of javadoc + * @return an HtmlTree for the lINK tag which provides the stylesheet location */ - private static StringBuffer addLineNumbers(String s) { - StringBuffer sb = new StringBuffer(); - StringTokenizer st = new StringTokenizer(s, "\n", true); - int lineno = 1; - String current; - while(st.hasMoreTokens()){ - current = st.nextToken(); - sb.append(current.equals("\n") ? - getHTMLLineNo(lineno) + current : - getHTMLLineNo(lineno) + current + st.nextToken()); - lineno++; + public static HtmlTree getStyleSheetProperties(ConfigurationImpl configuration) { + String filename = configuration.stylesheetfile; + if (filename.length() > 0) { + File stylefile = new File(filename); + String parent = stylefile.getParent(); + filename = (parent == null)? + filename: + filename.substring(parent.length() + 1); + } else { + filename = "stylesheet.css"; } - return sb; + filename = relativePath + filename; + HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", filename, "Style"); + return link; } /** * Get the header. - * @param configuration the Doclet configuration - * @return the header to the output file + * + * @return the header content for the HTML file */ - protected static String getHeader(Configuration configuration) { - StringBuffer result = new StringBuffer("" + DocletConstants.NL); - result.append("" + DocletConstants.NL); - result.append("

        " + DocletConstants.NL);
        -        return result.toString();
        +    private static Content getHeader() {
        +        return new HtmlTree(HtmlTag.BODY);
             }
         
             /**
        -     * Get the footer
        -     * @return the footer to the output file
        -     */
        -    protected static String getFooter() {
        -        StringBuffer footer = new StringBuffer();
        -        for (int i = 0; i < NUM_BLANK_LINES; i++) {
        -            footer.append(DocletConstants.NL);
        -        }
        -        footer.append("
        " + DocletConstants.NL + "" + - DocletConstants.NL + "" + DocletConstants.NL); - return footer.toString(); - } - - /** - * Get the HTML for the lines. + * Add the line numbers for the source code. + * + * @param pre the content tree to which the line number will be added * @param lineno The line number - * @return the HTML code for the line */ - protected static String getHTMLLineNo(int lineno) { - StringBuffer result = new StringBuffer(""); + private static void addLineNo(Content pre, int lineno) { + HtmlTree span = new HtmlTree(HtmlTag.SPAN); + span.addStyle(HtmlStyle.sourceLineNo); if (lineno < 10) { - result.append("00" + ((new Integer(lineno)).toString())); + span.addContent("00" + Integer.toString(lineno)); } else if (lineno < 100) { - result.append("0" + ((new Integer(lineno)).toString())); + span.addContent("0" + Integer.toString(lineno)); } else { - result.append((new Integer(lineno)).toString()); + span.addContent(Integer.toString(lineno)); } - result.append(" "); - return result.toString(); + pre.addContent(span); } /** - * Format a given line of source.
        - * Note: In the future, we will add special colors for constructs in the - * language. + * Add a line from source to the HTML file that is generated. + * + * @param pre the content tree to which the line will be added. * @param line the string to format. * @param tabLength the number of spaces for each tab. * @param currentLineNo the current number. */ - protected static String formatLine(String line, int tabLength, int currentLineNo) { - if (line == null) { - return null; - } - StringBuffer lineBuffer = new StringBuffer(Util.escapeHtmlChars(line)); - //Insert an anchor for the line - lineBuffer.append(""); - lineBuffer.append(DocletConstants.NL); - Util.replaceTabs(tabLength, lineBuffer); - return lineBuffer.toString(); - } - - /** - * Given an array of Docs, add to the given HashMap the - * line numbers and anchors that should be inserted in the output at those lines. - * @param docs the array of Docs to add anchors for. - * @param hash the HashMap to add to. - */ - protected static void addToHash(Doc[] docs, HashMap hash) { - if(docs == null) { - return; - } - for(int i = 0; i < docs.length; i++) { - hash.put(docs[i].position().line(), getAnchor(docs[i])); + private static void addLine(Content pre, String line, int tabLength, + int currentLineNo) { + if (line != null) { + StringBuffer lineBuffer = new StringBuffer(Util.escapeHtmlChars(line)); + Util.replaceTabs(tabLength, lineBuffer); + pre.addContent(new RawHtml(lineBuffer.toString())); + Content anchor = HtmlTree.A_NAME("line." + Integer.toString(currentLineNo)); + pre.addContent(anchor); + pre.addContent(NEW_LINE); } } /** - * Given a Doc, return an anchor for it. - * @param d the Doc to check. - * @return an anchor of the form <a name="my_name"></a> + * Add trailing blank lines at the end of the page. + * + * @param pre the content tree to which the blank lines will be added. */ - protected static String getAnchor(Doc d) { - return " "; + private static void addBlankLines(Content pre) { + for (int i = 0; i < NUM_BLANK_LINES; i++) { + pre.addContent(NEW_LINE); + } } /** * Given a Doc, return an anchor name for it. + * * @param d the Doc to check. * @return the name of the anchor. */ diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java index e539667821b..9d608730654 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +25,10 @@ package com.sun.tools.doclets.formats.html; -import com.sun.tools.doclets.internal.toolkit.util.*; - import java.io.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; +import com.sun.tools.doclets.internal.toolkit.*; /** * Generate Separate Index Files for all the member names with Indexing in @@ -36,6 +37,7 @@ import java.io.*; * * @see java.lang.Character * @author Atul M Dambalkar + * @author Bhavesh Patel (Modified) */ public class SplitIndexWriter extends AbstractIndexWriter { @@ -109,56 +111,68 @@ public class SplitIndexWriter extends AbstractIndexWriter { * index. */ protected void generateIndexFile(Character unicode) throws IOException { - printHtmlHeader(configuration.getText("doclet.Window_Split_Index", - unicode.toString()), null, true); - printTop(); - navLinks(true); - printLinksForIndexes(); - - hr(); - - generateContents(unicode, indexbuilder.getMemberList(unicode)); - - navLinks(false); - printLinksForIndexes(); - - printBottom(); - printBodyHtmlEnd(); + String title = configuration.getText("doclet.Window_Split_Index", + unicode.toString()); + Content body = getBody(true, getWindowTitle(title)); + addTop(body); + addNavLinks(true, body); + HtmlTree divTree = new HtmlTree(HtmlTag.DIV); + divTree.addStyle(HtmlStyle.contentContainer); + addLinksForIndexes(divTree); + addContents(unicode, indexbuilder.getMemberList(unicode), divTree); + addLinksForIndexes(divTree); + body.addContent(divTree); + addNavLinks(false, body); + addBottom(body); + printHtmlDocument(null, true, body); } /** - * Print Links for all the Index Files per unicode character. + * Add links for all the Index Files per unicode character. + * + * @param contentTree the content tree to which the links for indexes will be added */ - protected void printLinksForIndexes() { - for (int i = 0; i < indexbuilder.elements().length; i++) { + protected void addLinksForIndexes(Content contentTree) { + Object[] unicodeChars = indexbuilder.elements(); + for (int i = 0; i < unicodeChars.length; i++) { int j = i + 1; - printHyperLink("index-" + j + ".html", - indexbuilder.elements()[i].toString()); - print(' '); + contentTree.addContent(getHyperLink("index-" + j + ".html", + new StringContent(unicodeChars[i].toString()))); + contentTree.addContent(getSpace()); } } /** - * Print the previous unicode character index link. + * Get link to the previous unicode character. + * + * @return a content tree for the link */ - protected void navLinkPrevious() { + public Content getNavLinkPrevious() { + Content prevletterLabel = getResource("doclet.Prev_Letter"); if (prev == -1) { - printText("doclet.Prev_Letter"); - } else { - printHyperLink("index-" + prev + ".html", "", - configuration.getText("doclet.Prev_Letter"), true); + return HtmlTree.LI(prevletterLabel); + } + else { + Content prevLink = getHyperLink("index-" + prev + ".html", "", + prevletterLabel); + return HtmlTree.LI(prevLink); } } /** - * Print the next unicode character index link. + * Get link to the next unicode character. + * + * @return a content tree for the link */ - protected void navLinkNext() { + public Content getNavLinkNext() { + Content nextletterLabel = getResource("doclet.Next_Letter"); if (next == -1) { - printText("doclet.Next_Letter"); - } else { - printHyperLink("index-" + next + ".html","", - configuration.getText("doclet.Next_Letter"), true); + return HtmlTree.LI(nextletterLabel); + } + else { + Content nextLink = getHyperLink("index-" + next + ".html","", + nextletterLabel); + return HtmlTree.LI(nextLink); } } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/StylesheetWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/StylesheetWriter.java deleted file mode 100644 index 3363be5f8f7..00000000000 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/StylesheetWriter.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import com.sun.tools.doclets.internal.toolkit.util.*; - -import java.io.*; - -/** - * Writes the style sheet for the doclet output. - * - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -public class StylesheetWriter extends HtmlDocletWriter { - - /** - * Constructor. - */ - public StylesheetWriter(ConfigurationImpl configuration, - String filename) throws IOException { - super(configuration, filename); - } - - /** - * Generate the style file contents. - * @throws DocletAbortException - */ - public static void generate(ConfigurationImpl configuration) { - StylesheetWriter stylegen; - String filename = ""; - try { - filename = "stylesheet.css"; - stylegen = new StylesheetWriter(configuration, filename); - stylegen.generateStyleFile(); - stylegen.close(); - } catch (IOException exc) { - configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), filename); - throw new DocletAbortException(); - } - } - - /** - * Generate the style file contents. - */ - protected void generateStyleFile() { - print("/* "); printText("doclet.Style_line_1"); println(" */"); - println(""); - - print("/* "); printText("doclet.Style_line_2"); println(" */"); - println(""); - - print("/* "); printText("doclet.Style_line_3"); println(" */"); - println("body { background-color: #FFFFFF; color:#000000 }"); - println(""); - - print("/* "); printText("doclet.Style_Headings"); println(" */"); - println("h1 { font-size: 145% }"); - println(""); - - print("/* "); printText("doclet.Style_line_4"); println(" */"); - print(".TableHeadingColor { background: #CCCCFF; color:#000000 }"); - print(" /* "); printText("doclet.Style_line_5"); println(" */"); - print(".TableSubHeadingColor { background: #EEEEFF; color:#000000 }"); - print(" /* "); printText("doclet.Style_line_6"); println(" */"); - print(".TableRowColor { background: #FFFFFF; color:#000000 }"); - print(" /* "); printText("doclet.Style_line_7"); println(" */"); - println(""); - - print("/* "); printText("doclet.Style_line_8"); println(" */"); - println(".FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"); - println(".FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"); - println(".FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"); - println(""); - - // Removed doclet.Style_line_9 as no longer needed - - print("/* "); printText("doclet.Style_line_10"); println(" */"); - print(".NavBarCell1 { background-color:#EEEEFF; color:#000000}"); - print(" /* "); printText("doclet.Style_line_6"); println(" */"); - print(".NavBarCell1Rev { background-color:#00008B; color:#FFFFFF}"); - print(" /* "); printText("doclet.Style_line_11"); println(" */"); - - print(".NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;"); - println("color:#000000;}"); - print(".NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;"); - println("color:#FFFFFF;}"); - println(""); - - print(".NavBarCell2 { font-family: Arial, Helvetica, sans-serif; "); - println("background-color:#FFFFFF; color:#000000}"); - print(".NavBarCell3 { font-family: Arial, Helvetica, sans-serif; "); - println("background-color:#FFFFFF; color:#000000}"); - - print("/* "); printText("doclet.Style_line_12"); println(" */"); - print(".TableCaption { background: #CCCCFF; color:#000000; text-align: left; font-size: 150%; font-weight: bold; border-left: 2px ridge; border-right: 2px ridge; border-top: 2px ridge; padding-left: 5px; }"); - print(" /* "); printText("doclet.Style_line_5"); println(" */"); - print(".TableSubCaption { background: #EEEEFF; color:#000000; text-align: left; font-weight: bold; border-left: 2px ridge; border-right: 2px ridge; border-top: 2px ridge; padding-left: 5px; }"); - print(" /* "); printText("doclet.Style_line_6"); println(" */"); - print(".TableHeader { text-align: center; font-size: 80%; font-weight: bold; }"); - println(""); - - } - -} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java index ae5a8e8db37..6790b739ef6 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,11 @@ package com.sun.tools.doclets.formats.html; -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - import java.io.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; /** * This abstract class exists to provide functionality needed in the @@ -71,13 +72,31 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter { tdEnd(); } - public void printSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) { - mw.printSummaryAnchor(cd); - mw.printTableSummary(); - tableCaptionStart(); - mw.printSummaryLabel(); - tableCaptionEnd(); - mw.printSummaryTableHeader(cd); + /** + * Add the summary header. + * + * @param mw the writer for the member being documented + * @param cd the classdoc to be documented + * @param memberTree the content tree to which the summary header will be added + */ + public void addSummaryHeader(AbstractMemberWriter mw, ClassDoc cd, + Content memberTree) { + mw.addSummaryAnchor(cd, memberTree); + mw.addSummaryLabel(memberTree); + } + + /** + * Get the summary table. + * + * @param mw the writer for the member being documented + * @param cd the classdoc to be documented + * @return the content tree for the summary table + */ + public Content getSummaryTableTree(AbstractMemberWriter mw, ClassDoc cd) { + Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, + mw.getTableSummary(), getTableCaption(mw.getCaption())); + table.addContent(getSummaryTableHeader(mw.getSummaryTableHeader(cd), "col")); + return table; } public void printTableHeadingBackground(String str) { @@ -88,15 +107,17 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter { tableEnd(); } - public void printInheritedSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) { - mw.printInheritedSummaryAnchor(cd); - tableIndexSummary(); - tableInheritedHeaderStart("#EEEEFF"); - mw.printInheritedSummaryLabel(cd); - tableInheritedHeaderEnd(); - trBgcolorStyle("white", "TableRowColor"); - summaryRow(0); - code(); + /** + * Add the inherited summary header. + * + * @param mw the writer for the member being documented + * @param cd the classdoc to be documented + * @param inheritedTree the content tree to which the inherited summary header will be added + */ + public void addInheritedSummaryHeader(AbstractMemberWriter mw, ClassDoc cd, + Content inheritedTree) { + mw.addInheritedSummaryAnchor(cd, inheritedTree); + mw.addInheritedSummaryLabel(cd, inheritedTree); } public void printSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) { @@ -112,8 +133,14 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter { space(); } - protected void printIndexComment(Doc member) { - printIndexComment(member, member.firstSentenceTags()); + /** + * Add the index comment. + * + * @param member the member being documented + * @param contentTree the content tree to which the comment will be added + */ + protected void addIndexComment(Doc member, Content contentTree) { + addIndexComment(member, member.firstSentenceTags(), contentTree); } protected void printIndexComment(Doc member, Tag[] firstSentenceTags) { @@ -134,17 +161,60 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter { printSummaryComment(member, firstSentenceTags); } - public void printSummaryLinkType(AbstractMemberWriter mw, - ProgramElementDoc member) { - trBgcolorStyle("white", "TableRowColor"); - mw.printSummaryType(member); - summaryRow(0); - code(); + /** + * Add the index comment. + * + * @param member the member being documented + * @param firstSentenceTags the first sentence tags for the member to be documented + * @param tdSummary the content tree to which the comment will be added + */ + protected void addIndexComment(Doc member, Tag[] firstSentenceTags, + Content tdSummary) { + Tag[] deprs = member.tags("deprecated"); + Content div; + if (Util.isDeprecated((ProgramElementDoc) member)) { + Content strong = HtmlTree.STRONG(deprecatedPhrase); + div = HtmlTree.DIV(HtmlStyle.block, strong); + div.addContent(getSpace()); + if (deprs.length > 0) { + addInlineDeprecatedComment(member, deprs[0], div); + } + tdSummary.addContent(div); + return; + } else { + ClassDoc cd = ((ProgramElementDoc)member).containingClass(); + if (cd != null && Util.isDeprecated(cd)) { + Content strong = HtmlTree.STRONG(deprecatedPhrase); + div = HtmlTree.DIV(HtmlStyle.block, strong); + div.addContent(getSpace()); + tdSummary.addContent(div); + } + } + addSummaryComment(member, firstSentenceTags, tdSummary); } - public void printSummaryLinkComment(AbstractMemberWriter mw, - ProgramElementDoc member) { - printSummaryLinkComment(mw, member, member.firstSentenceTags()); + /** + * Add the summary type for the member. + * + * @param mw the writer for the member being documented + * @param member the member to be documented + * @param tdSummaryType the content tree to which the type will be added + */ + public void addSummaryType(AbstractMemberWriter mw, ProgramElementDoc member, + Content tdSummaryType) { + mw.addSummaryType(member, tdSummaryType); + } + + /** + * Add the summary link for the member. + * + * @param mw the writer for the member being documented + * @param member the member to be documented + * @param contentTree the content tree to which the link will be added + */ + public void addSummaryLinkComment(AbstractMemberWriter mw, + ProgramElementDoc member, Content contentTree) { + addSummaryLinkComment(mw, member, member.firstSentenceTags(), contentTree); } public void printSummaryLinkComment(AbstractMemberWriter mw, @@ -159,12 +229,34 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter { trEnd(); } - public void printInheritedSummaryMember(AbstractMemberWriter mw, ClassDoc cd, - ProgramElementDoc member, boolean isFirst) { + /** + * Add the summary link comment. + * + * @param mw the writer for the member being documented + * @param member the member being documented + * @param firstSentenceTags the first sentence tags for the member to be documented + * @param tdSummary the content tree to which the comment will be added + */ + public void addSummaryLinkComment(AbstractMemberWriter mw, + ProgramElementDoc member, Tag[] firstSentenceTags, Content tdSummary) { + addIndexComment(member, firstSentenceTags, tdSummary); + } + + /** + * Add the inherited member summary. + * + * @param mw the writer for the member being documented + * @param cd the class being documented + * @param member the member being documented + * @param isFirst true if its the first link being documented + * @param linksTree the content tree to which the summary will be added + */ + public void addInheritedMemberSummary(AbstractMemberWriter mw, ClassDoc cd, + ProgramElementDoc member, boolean isFirst, Content linksTree) { if (! isFirst) { - mw.print(", "); + linksTree.addContent(", "); } - mw.writeInheritedSummaryLink(cd, member); + mw.addInheritedSummaryLink(cd, member, linksTree); } public void printMemberHeader() { @@ -174,4 +266,67 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter { public void printMemberFooter() { } + /** + * Get the document content header tree + * + * @return a content tree the document content header + */ + public Content getContentHeader() { + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.contentContainer); + return div; + } + + /** + * Get the member header tree + * + * @return a content tree the member header + */ + public Content getMemberTreeHeader() { + HtmlTree li = new HtmlTree(HtmlTag.LI); + li.addStyle(HtmlStyle.blockList); + return li; + } + + /** + * Get the member tree + * + * @param contentTree the tree used to generate the complete member tree + * @return a content tree for the member + */ + public Content getMemberTree(Content contentTree) { + Content ul = HtmlTree.UL(HtmlStyle.blockList, contentTree); + return ul; + } + + /** + * Get the member summary tree + * + * @param contentTree the tree used to generate the member summary tree + * @return a content tree for the member summary + */ + public Content getMemberSummaryTree(Content contentTree) { + return getMemberTree(HtmlStyle.summary, contentTree); + } + + /** + * Get the member details tree + * + * @param contentTree the tree used to generate the member details tree + * @return a content tree for the member details + */ + public Content getMemberDetailsTree(Content contentTree) { + return getMemberTree(HtmlStyle.details, contentTree); + } + + /** + * Get the member tree + * + * @param style the style class to be added to the content tree + * @param contentTree the tree used to generate the complete member tree + */ + public Content getMemberTree(HtmlStyle style, Content contentTree) { + Content div = HtmlTree.DIV(style, getMemberTree(contentTree)); + return div; + } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java index 2f7c0071f94..a72b73984d4 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +70,9 @@ public class TagletWriterImpl extends TagletWriter { Tag[] deprs = doc.tags("deprecated"); if (doc instanceof ClassDoc) { if (Util.isDeprecated((ProgramElementDoc) doc)) { - output.append("" + + output.append("" + ConfigurationImpl.getInstance(). - getText("doclet.Deprecated") + " "); + getText("doclet.Deprecated") + " "); if (deprs.length > 0) { Tag[] commentTags = deprs[0].inlineTags(); if (commentTags.length > 0) { @@ -82,30 +82,24 @@ public class TagletWriterImpl extends TagletWriter { ); } } - output.append("

        "); } } else { MemberDoc member = (MemberDoc) doc; if (Util.isDeprecated((ProgramElementDoc) doc)) { - output.append("

        " + + output.append("" + ConfigurationImpl.getInstance(). - getText("doclet.Deprecated") + " "); + getText("doclet.Deprecated") + " "); if (deprs.length > 0) { - output.append(""); + output.append(""); output.append(commentTagsToOutput(null, doc, deprs[0].inlineTags(), false).toString()); - output.append(""); + output.append(""); } - if (member instanceof ExecutableMemberDoc) { - output.append(DocletConstants.NL + "

        " + - DocletConstants.NL); - } - output.append("

        "); } else { if (Util.isDeprecated(member.containingClass())) { - output.append("
        " + + output.append("" + ConfigurationImpl.getInstance(). - getText("doclet.Deprecated") + " 
        "); + getText("doclet.Deprecated") + " "); } } } @@ -124,8 +118,8 @@ public class TagletWriterImpl extends TagletWriter { */ public TagletOutput getParamHeader(String header) { StringBuffer result = new StringBuffer(); - result.append("
        "); - result.append("" + header + "
        "); + result.append("
        "); + result.append("" + header + "
        "); return new TagletOutputImpl(result.toString()); } @@ -133,8 +127,8 @@ public class TagletWriterImpl extends TagletWriter { * {@inheritDoc} */ public TagletOutput paramTagOutput(ParamTag paramTag, String paramName) { - TagletOutput result = new TagletOutputImpl("
        " + paramName + "" - + " - " + htmlWriter.commentTagsToString(paramTag, null, paramTag.inlineTags(), false) + "
        "); + TagletOutput result = new TagletOutputImpl("
        " + paramName + "" + + " - " + htmlWriter.commentTagsToString(paramTag, null, paramTag.inlineTags(), false) + "
        "); return result; } @@ -142,11 +136,11 @@ public class TagletWriterImpl extends TagletWriter { * {@inheritDoc} */ public TagletOutput returnTagOutput(Tag returnTag) { - TagletOutput result = new TagletOutputImpl(DocletConstants.NL + "
        " + - "" + htmlWriter.configuration.getText("doclet.Returns") + - "" + "
        " + "
        " + + TagletOutput result = new TagletOutputImpl(DocletConstants.NL + "
        " + + "" + htmlWriter.configuration.getText("doclet.Returns") + + "" + "
        " + "
        " + htmlWriter.commentTagsToString(returnTag, null, returnTag.inlineTags(), - false) + "
        "); + false) + ""); return result; } @@ -168,7 +162,7 @@ public class TagletWriterImpl extends TagletWriter { htmlWriter instanceof ClassWriterImpl) { //Automatically add link to constant values page for constant fields. result = addSeeHeader(result); - result += htmlWriter.getHyperLink(htmlWriter.relativePath + + result += htmlWriter.getHyperLinkString(htmlWriter.relativePath + ConfigurationImpl.CONSTANTS_FILE_NAME + "#" + ((ClassWriterImpl) htmlWriter).getClassDoc().qualifiedName() + "." + ((FieldDoc) holder).name(), @@ -179,18 +173,19 @@ public class TagletWriterImpl extends TagletWriter { if ((SerializedFormBuilder.serialInclude(holder) && SerializedFormBuilder.serialInclude(((ClassDoc)holder).containingPackage()))) { result = addSeeHeader(result); - result += htmlWriter.getHyperLink(htmlWriter.relativePath + "serialized-form.html", + result += htmlWriter.getHyperLinkString(htmlWriter.relativePath + "serialized-form.html", ((ClassDoc)holder).qualifiedName(), htmlWriter.configuration.getText("doclet.Serialized_Form"), false); } } - return result.equals("") ? null : new TagletOutputImpl(result + ""); + return result.equals("") ? null : new TagletOutputImpl(result + ""); } private String addSeeHeader(String result) { if (result != null && result.length() > 0) { return result + ", " + DocletConstants.NL; } else { - return "
        " + htmlWriter.configuration().getText("doclet.See_Also") + "
        "; + return "
        " + + htmlWriter.configuration().getText("doclet.See_Also") + "
        "; } } @@ -198,15 +193,15 @@ public class TagletWriterImpl extends TagletWriter { * {@inheritDoc} */ public TagletOutput simpleTagOutput(Tag[] simpleTags, String header) { - String result = "
        " + header + "
        " + DocletConstants.NL + - "
        "; + String result = "
        " + header + "
        " + DocletConstants.NL + + "
        "; for (int i = 0; i < simpleTags.length; i++) { if (i > 0) { result += ", "; } result += htmlWriter.commentTagsToString(simpleTags[i], null, simpleTags[i].inlineTags(), false); } - result += "
        " + DocletConstants.NL; + result += "" + DocletConstants.NL; return new TagletOutputImpl(result); } @@ -214,24 +209,24 @@ public class TagletWriterImpl extends TagletWriter { * {@inheritDoc} */ public TagletOutput simpleTagOutput(Tag simpleTag, String header) { - return new TagletOutputImpl("
        " + header + "
        " + "
        " + return new TagletOutputImpl("
        " + header + "
        " + "
        " + htmlWriter.commentTagsToString(simpleTag, null, simpleTag.inlineTags(), false) - + "
        " + DocletConstants.NL); + + "" + DocletConstants.NL); } /** * {@inheritDoc} */ public TagletOutput getThrowsHeader() { - return new TagletOutputImpl(DocletConstants.NL + "
        " + "" + - htmlWriter.configuration().getText("doclet.Throws") + "
        "); + return new TagletOutputImpl(DocletConstants.NL + "
        " + "" + + htmlWriter.configuration().getText("doclet.Throws") + "
        "); } /** * {@inheritDoc} */ public TagletOutput throwsTagOutput(ThrowsTag throwsTag) { - String result = DocletConstants.NL + "
        "; + String result = DocletConstants.NL + "
        "; result += throwsTag.exceptionType() == null ? htmlWriter.codeText(throwsTag.exceptionName()) : htmlWriter.codeText( @@ -243,7 +238,7 @@ public class TagletWriterImpl extends TagletWriter { if (text != null && text.toString().length() > 0) { result += " - " + text; } - result += "
        "; + result += ""; return new TagletOutputImpl(result); } @@ -251,9 +246,9 @@ public class TagletWriterImpl extends TagletWriter { * {@inheritDoc} */ public TagletOutput throwsTagOutput(Type throwsType) { - return new TagletOutputImpl(DocletConstants.NL + "
        " + + return new TagletOutputImpl(DocletConstants.NL + "
        " + htmlWriter.codeText(htmlWriter.getLink( - new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, throwsType))) + "
        "); + new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, throwsType))) + ""); } /** diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java index 5dc678da549..ceb330e3d2f 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import java.io.*; import com.sun.javadoc.*; import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.formats.html.markup.*; +import com.sun.tools.doclets.internal.toolkit.*; /** * Generate Class Hierarchy page for all the Classes in this run. Use @@ -37,6 +39,7 @@ import com.sun.tools.doclets.internal.toolkit.util.*; * current or the destination directory. * * @author Atul M Dambalkar + * @author Bhavesh Patel (Modified) */ public class TreeWriter extends AbstractTreeWriter { @@ -90,86 +93,70 @@ public class TreeWriter extends AbstractTreeWriter { } /** - * Print the interface hierarchy and class hierarchy in the file. + * Generate the interface hierarchy and class hierarchy. */ public void generateTreeFile() throws IOException { - printHtmlHeader(configuration.getText("doclet.Window_Class_Hierarchy"), - null, true); - - printTreeHeader(); - - printPageHeading(); - - printPackageTreeLinks(); - - generateTree(classtree.baseclasses(), "doclet.Class_Hierarchy"); - generateTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy"); - generateTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy"); - generateTree(classtree.baseEnums(), "doclet.Enum_Hierarchy"); - - printTreeFooter(); + Content body = getTreeHeader(); + Content headContent = getResource("doclet.Hierarchy_For_All_Packages"); + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, + HtmlStyle.title, headContent); + Content div = HtmlTree.DIV(HtmlStyle.header, heading); + addPackageTreeLinks(div); + body.addContent(div); + HtmlTree divTree = new HtmlTree(HtmlTag.DIV); + divTree.addStyle(HtmlStyle.contentContainer); + addTree(classtree.baseclasses(), "doclet.Class_Hierarchy", divTree); + addTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy", divTree); + addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree); + addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree); + body.addContent(divTree); + addNavLinks(false, body); + addBottom(body); + printHtmlDocument(null, true, body); } /** - * Generate the links to all the package tree files. + * Add the links to all the package tree files. + * + * @param contentTree the content tree to which the links will be added */ - protected void printPackageTreeLinks() { + protected void addPackageTreeLinks(Content contentTree) { //Do nothing if only unnamed package is used if (packages.length == 1 && packages[0].name().length() == 0) { return; } if (!classesonly) { - dl(); - dt(); - strongText("doclet.Package_Hierarchies"); - dtEnd(); - dd(); + Content span = HtmlTree.SPAN(HtmlStyle.strong, + getResource("doclet.Package_Hierarchies")); + contentTree.addContent(span); + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.addStyle(HtmlStyle.horizontal); for (int i = 0; i < packages.length; i++) { if (packages[i].name().length() == 0) { continue; } - String filename = pathString(packages[i], "package-tree.html"); - printHyperLink(filename, "", packages[i].name()); + String link = pathString(packages[i], "package-tree.html"); + Content li = HtmlTree.LI(getHyperLink( + link, "", new StringContent(packages[i].name()))); if (i < packages.length - 1) { - print(", "); + li.addContent(", "); } + ul.addContent(li); } - ddEnd(); - dlEnd(); - hr(); + contentTree.addContent(ul); } } /** - * Print the top text (from the -top option) and - * navigation bar at the top of page. + * Get the tree header. + * + * @return a content tree for the tree header */ - protected void printTreeHeader() { - printTop(); - navLinks(true); - hr(); - } - - /** - * Print the navigation bar and bottom text (from the -bottom option) - * at the bottom of page. - */ - protected void printTreeFooter() { - hr(); - navLinks(false); - printBottom(); - printBodyHtmlEnd(); - } - - /** - * Print the page title "Hierarchy For All Packages" at the top of the tree - * page. - */ - protected void printPageHeading() { - center(); - h2(); - printText("doclet.Hierarchy_For_All_Packages"); - h2End(); - centerEnd(); + protected Content getTreeHeader() { + String title = configuration.getText("doclet.Window_Class_Hierarchy"); + Content bodyTree = getBody(true, getWindowTitle(title)); + addTop(bodyTree); + addNavLinks(true, bodyTree); + return bodyTree; } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/Comment.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/Comment.java new file mode 100644 index 00000000000..86fea133c2b --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/Comment.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.doclets.formats.html.markup; + +import com.sun.tools.doclets.internal.toolkit.Content; +import com.sun.tools.doclets.internal.toolkit.util.*; + +/** + * Class for generating a comment for HTML pages of javadoc output. + * + * @author Bhavesh Patel + */ +public class Comment extends Content{ + + private String commentText; + + /** + * Constructor to construct a Comment object. + * + * @param comment comment text for the comment + */ + public Comment(String comment) { + commentText = nullCheck(comment); + } + + /** + * This method is not supported by the class. + * + * @param content content that needs to be added + * @throws DocletAbortException this method will always throw a + * DocletAbortException because it + * is not supported. + */ + public void addContent(Content content) { + throw new DocletAbortException(); + } + + /** + * This method is not supported by the class. + * + * @param stringContent string content that needs to be added + * @throws DocletAbortException this method will always throw a + * DocletAbortException because it + * is not supported. + */ + public void addContent(String stringContent) { + throw new DocletAbortException(); + } + + /** + * {@inheritDoc} + */ + public boolean isEmpty() { + return commentText.isEmpty(); + } + + /** + * {@inheritDoc} + */ + public void write(StringBuilder contentBuilder) { + if (!endsWithNewLine(contentBuilder)) + contentBuilder.append(DocletConstants.NL); + contentBuilder.append("" + DocletConstants.NL); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java new file mode 100644 index 00000000000..03265d29e6f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.doclets.formats.html.markup; + +import com.sun.tools.doclets.internal.toolkit.Content; +import com.sun.tools.doclets.internal.toolkit.util.*; + +/** + * Class for generating document type for HTML pages of javadoc output. + * + * @author Bhavesh Patel + */ +public class DocType extends Content{ + + private String docType; + + private static DocType transitional; + + private static DocType frameset; + + /** + * Constructor to construct a DocType object. + * + * @param type the doctype to be added + */ + private DocType(String type, String dtd) { + docType = "" + DocletConstants.NL; + } + + /** + * Construct and return a HTML 4.01 transitional DocType content + * + * @return a content tree for transitional DocType + */ + public static DocType Transitional() { + if (transitional == null) + transitional = new DocType("Transitional", "http://www.w3.org/TR/html4/loose.dtd"); + return transitional; + } + + /** + * Construct and return a HTML 4.01 frameset DocType content + * + * @return a content tree for frameset DocType + */ + public static DocType Frameset() { + if (frameset == null) + frameset = new DocType("Frameset", "http://www.w3.org/TR/html4/frameset.dtd"); + return frameset; + } + + /** + * This method is not supported by the class. + * + * @param content content that needs to be added + * @throws DocletAbortException this method will always throw a + * DocletAbortException because it + * is not supported. + */ + public void addContent(Content content) { + throw new DocletAbortException(); + } + + /** + * This method is not supported by the class. + * + * @param stringContent string content that needs to be added + * @throws DocletAbortException this method will always throw a + * DocletAbortException because it + * is not supported. + */ + public void addContent(String stringContent) { + throw new DocletAbortException(); + } + + /** + * {@inheritDoc} + */ + public boolean isEmpty() { + return (docType.length() == 0); + } + + /** + * {@inheritDoc} + */ + public void write(StringBuilder contentBuilder) { + contentBuilder.append(docType); + } +} diff --git a/jdk/src/share/hpi/export/dll.h b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java similarity index 61% rename from jdk/src/share/hpi/export/dll.h rename to langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java index 76403eef6d3..96895531dd6 100644 --- a/jdk/src/share/hpi/export/dll.h +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * 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,28 +23,51 @@ * questions. */ -#ifndef _JAVASOFT_DLL_H_ -#define _JAVASOFT_DLL_H_ +package com.sun.tools.doclets.formats.html.markup; -#include - -/* DLL.H: A common interface for helper DLLs loaded by the VM. - * Each library exports the main entry point "DLL_Initialize". Through - * that function the programmer can obtain a function pointer which has - * type "GetInterfaceFunc." Through the function pointer the programmer - * can obtain other interfaces supported in the DLL. +/** + * Enum representing HTML tag attributes. + * + * @author Bhavesh Patel */ -#ifdef __cplusplus -extern "C" { -#endif +public enum HtmlAttr { + ALT, + BORDER, + CELLPADDING, + CELLSPACING, + CHARSET, + CLASS, + CLEAR, + COLS, + CONTENT, + HREF, + HTTP_EQUIV("http-equiv"), + ID, + LANG, + NAME, + ONLOAD, + REL, + ROWS, + SCOPE, + SCROLLING, + SRC, + SUMMARY, + TARGET, + TITLE, + TYPE, + WIDTH; -typedef jint (JNICALL * GetInterfaceFunc) - (void **intfP, const char *name, jint ver); + private final String value; -jint JNICALL DLL_Initialize(GetInterfaceFunc *, void *args); + HtmlAttr() { + this.value = name().toLowerCase(); + } -#ifdef __cplusplus + HtmlAttr(String name) { + this.value = name; + } + + public String toString() { + return value; + } } -#endif - -#endif /* !_JAVASOFT_DLL_H_ */ diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java new file mode 100644 index 00000000000..c85927e0b67 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.doclets.formats.html.markup; + +import com.sun.tools.doclets.internal.toolkit.Content; + +/** + * Stores constants for Html Doclet. + * + * @author Bhavesh Patel + */ +public class HtmlConstants { + + /** + * Marker to identify start of top navigation bar. + */ + public static final Content START_OF_TOP_NAVBAR = + new Comment("========= START OF TOP NAVBAR ======="); + + /** + * Marker to identify start of bottom navigation bar. + */ + public static final Content START_OF_BOTTOM_NAVBAR = + new Comment("======= START OF BOTTOM NAVBAR ======"); + + /** + * Marker to identify end of top navigation bar. + */ + public static final Content END_OF_TOP_NAVBAR = + new Comment("========= END OF TOP NAVBAR ========="); + + /** + * Marker to identify end of bottom navigation bar. + */ + public static final Content END_OF_BOTTOM_NAVBAR = + new Comment("======== END OF BOTTOM NAVBAR ======="); + + /** + * Marker to identify start of class data. + */ + public static final Content START_OF_CLASS_DATA = + new Comment("======== START OF CLASS DATA ========"); + + /** + * Marker to identify end of class data. + */ + public static final Content END_OF_CLASS_DATA = + new Comment("========= END OF CLASS DATA ========="); + + /** + * Marker to identify start of nested class summary. + */ + public static final Content START_OF_NESTED_CLASS_SUMMARY = + new Comment("======== NESTED CLASS SUMMARY ========"); + + /** + * Marker to identify start of annotation type optional member summary. + */ + public static final Content START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY = + new Comment("=========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY ==========="); + + /** + * Marker to identify start of annotation type required member summary. + */ + public static final Content START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY = + new Comment("=========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY ==========="); + + /** + * Marker to identify start of constructor summary. + */ + public static final Content START_OF_CONSTRUCTOR_SUMMARY = + new Comment("======== CONSTRUCTOR SUMMARY ========"); + + /** + * Marker to identify start of enum constants summary. + */ + public static final Content START_OF_ENUM_CONSTANT_SUMMARY = + new Comment("=========== ENUM CONSTANT SUMMARY ==========="); + + /** + * Marker to identify start of field summary. + */ + public static final Content START_OF_FIELD_SUMMARY = + new Comment("=========== FIELD SUMMARY ==========="); + + /** + * Marker to identify start of method summary. + */ + public static final Content START_OF_METHOD_SUMMARY = + new Comment("========== METHOD SUMMARY ==========="); + + /** + * Marker to identify start of annotation type details. + */ + public static final Content START_OF_ANNOTATION_TYPE_DETAILS = + new Comment("============ ANNOTATION TYPE MEMBER DETAIL ==========="); + + /** + * Marker to identify start of method details. + */ + public static final Content START_OF_METHOD_DETAILS = + new Comment("============ METHOD DETAIL =========="); + + /** + * Marker to identify start of field details. + */ + public static final Content START_OF_FIELD_DETAILS = + new Comment("============ FIELD DETAIL ==========="); + + /** + * Marker to identify start of constructor details. + */ + public static final Content START_OF_CONSTRUCTOR_DETAILS = + new Comment("========= CONSTRUCTOR DETAIL ========"); + + /** + * Marker to identify start of enum constants details. + */ + public static final Content START_OF_ENUM_CONSTANT_DETAILS = + new Comment("============ ENUM CONSTANT DETAIL ==========="); + + /** + * Html tag for the page title heading. + */ + public static final HtmlTag TITLE_HEADING = HtmlTag.H1; + + /** + * Html tag for the class page title heading. + */ + public static final HtmlTag CLASS_PAGE_HEADING = HtmlTag.H2; + + /** + * Html tag for the content heading. + */ + public static final HtmlTag CONTENT_HEADING = HtmlTag.H2; + + /** + * Html tag for the package name heading. + */ + public static final HtmlTag PACKAGE_HEADING = HtmlTag.H2; + + /** + * Html tag for the member summary heading. + */ + public static final HtmlTag SUMMARY_HEADING = HtmlTag.H3; + + /** + * Html tag for the inherited member summary heading. + */ + public static final HtmlTag INHERITED_SUMMARY_HEADING = HtmlTag.H3; + + /** + * Html tag for the member details heading. + */ + public static final HtmlTag DETAILS_HEADING = HtmlTag.H3; + + /** + * Html tag for the serialized member heading. + */ + public static final HtmlTag SERIALIZED_MEMBER_HEADING = HtmlTag.H3; + + /** + * Html tag for the member heading. + */ + public static final HtmlTag MEMBER_HEADING = HtmlTag.H4; +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java index 7079a987f96..979c72b9211 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +87,7 @@ public abstract class HtmlDocWriter extends HtmlWriter { */ public void printHyperLink(String link, String where, String label, boolean strong) { - print(getHyperLink(link, where, label, strong, "", "", "")); + print(getHyperLinkString(link, where, label, strong, "", "", "")); } /** @@ -115,7 +115,7 @@ public abstract class HtmlDocWriter extends HtmlWriter { public void printHyperLink(String link, String where, String label, boolean strong, String stylename) { - print(getHyperLink(link, where, label, strong, stylename, "", "")); + print(getHyperLinkString(link, where, label, strong, stylename, "", "")); } /** @@ -128,9 +128,9 @@ public abstract class HtmlDocWriter extends HtmlWriter { * @param strong Boolean that sets label to strong. * @return String Hyper Link. */ - public String getHyperLink(String link, String where, + public String getHyperLinkString(String link, String where, String label, boolean strong) { - return getHyperLink(link, where, label, strong, "", "", ""); + return getHyperLinkString(link, where, label, strong, "", "", ""); } /** @@ -144,10 +144,24 @@ public abstract class HtmlDocWriter extends HtmlWriter { * @param stylename String style of text defined in style sheet. * @return String Hyper Link. */ - public String getHyperLink(String link, String where, + public String getHyperLinkString(String link, String where, String label, boolean strong, String stylename) { - return getHyperLink(link, where, label, strong, stylename, "", ""); + return getHyperLinkString(link, where, label, strong, stylename, "", ""); + } + + /** + * Get Html Hyper Link string. + * + * @param link String name of the file. + * @param where Position of the link in the file. Character '#' is not + * needed. + * @param label Tag for the link. + * @return a content tree for the hyper link + */ + public Content getHyperLink(String link, String where, + Content label) { + return getHyperLink(link, where, label, "", ""); } /** @@ -163,11 +177,11 @@ public abstract class HtmlDocWriter extends HtmlWriter { * @param target Target frame. * @return String Hyper Link. */ - public String getHyperLink(String link, String where, + public String getHyperLinkString(String link, String where, String label, boolean strong, String stylename, String title, String target) { StringBuffer retlink = new StringBuffer(); - retlink.append(""); } if (strong) { - retlink.append(""); + retlink.append(""); } retlink.append(label); if (strong) { - retlink.append(""); + retlink.append(""); } if (stylename != null && stylename.length() != 0) { retlink.append(""); } - retlink.append(""); + retlink.append(""); return retlink.toString(); } /** - * Print link without positioning in the file. + * Get Html Hyper Link. * * @param link String name of the file. + * @param where Position of the link in the file. Character '#' is not + * needed. * @param label Tag for the link. + * @param title String that describes the link's content for accessibility. + * @param target Target frame. + * @return a content tree for the hyper link. */ - public void printHyperLink(String link, String label) { - print(getHyperLink(link, "", label, false)); + public Content getHyperLink(String link, String where, + Content label, String title, String target) { + if (where != null && where.length() != 0) { + link += "#" + where; + } + HtmlTree anchor = HtmlTree.A(link, label); + if (title != null && title.length() != 0) { + anchor.addAttr(HtmlAttr.TITLE, title); + } + if (target != null && target.length() != 0) { + anchor.addAttr(HtmlAttr.TARGET, target); + } + return anchor; + } + + /** + * Get a hyperlink to a file. + * + * @param link String name of the file + * @param label Label for the link + * @return a content for the hyperlink to the file + */ + public Content getHyperLink(String link, Content label) { + return getHyperLink(link, "", label); } /** @@ -217,8 +258,8 @@ public abstract class HtmlDocWriter extends HtmlWriter { * @param label Tag for the link. * @return Strign Hyper link. */ - public String getHyperLink(String link, String label) { - return getHyperLink(link, "", label, false); + public String getHyperLinkString(String link, String label) { + return getHyperLinkString(link, "", label, false); } /** @@ -273,54 +314,32 @@ public abstract class HtmlDocWriter extends HtmlWriter { * Print the frameset version of the Html file header. * Called only when generating an HTML frameset file. * - * @param title Title of this HTML document. + * @param title Title of this HTML document + * @param noTimeStamp If true, don't print time stamp in header + * @param frameset the frameset to be added to the HTML document */ - public void printFramesetHeader(String title) { - printFramesetHeader(title, false); - } - - /** - * Print the frameset version of the Html file header. - * Called only when generating an HTML frameset file. - * - * @param title Title of this HTML document. - * @param noTimeStamp If true, don't print time stamp in header. - */ - public void printFramesetHeader(String title, boolean noTimeStamp) { - println(""); - println(""); - html(); - head(); + public void printFramesetDocument(String title, boolean noTimeStamp, + Content frameset) { + Content htmlDocType = DocType.Frameset(); + Content htmlComment = new Comment(configuration.getText("doclet.New_Page")); + Content head = new HtmlTree(HtmlTag.HEAD); if (! noTimeStamp) { - print(""); + Content headComment = new Comment("Generated by javadoc on " + today()); + head.addContent(headComment); } if (configuration.charset.length() > 0) { - println(""); + Content meta = HtmlTree.META("Content-Type", "text/html", + configuration.charset); + head.addContent(meta); } - title(); - println(title); - titleEnd(); - //Script to set the classFrame if necessary. - script(); - println(" targetPage = \"\" + window.location.search;"); - println(" if (targetPage != \"\" && targetPage != \"undefined\")"); - println(" targetPage = targetPage.substring(1);"); - println(" if (targetPage.indexOf(\":\") != -1)"); - println(" targetPage = \"undefined\";"); - - println(" function loadFrames() {"); - println(" if (targetPage != \"\" && targetPage != \"undefined\")"); - println(" top.classFrame.location = top.targetPage;"); - println(" }"); - scriptEnd(); - noScript(); - noScriptEnd(); - headEnd(); + Content windowTitle = HtmlTree.TITLE(new StringContent(title)); + head.addContent(windowTitle); + head.addContent(getFramesetJavaScript()); + Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), + head, frameset); + Content htmlDocument = new HtmlDocument(htmlDocType, + htmlComment, htmlTree); + print(htmlDocument.toString()); } /** diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocument.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocument.java new file mode 100644 index 00000000000..458c174ba46 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocument.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.doclets.formats.html.markup; + +import java.util.*; +import com.sun.tools.doclets.internal.toolkit.Content; +import com.sun.tools.doclets.internal.toolkit.util.*; + +/** + * Class for generating an HTML document for javadoc output. + * + * @author Bhavesh Patel + */ +public class HtmlDocument extends Content { + + private List docContent = Collections.emptyList(); + + /** + * Constructor to construct an HTML document. + * + * @param docType document type for the HTML document + * @param docComment comment for the document + * @param htmlTree HTML tree of the document + */ + public HtmlDocument(Content docType, Content docComment, Content htmlTree) { + docContent = new ArrayList(); + addContent(nullCheck(docType)); + addContent(nullCheck(docComment)); + addContent(nullCheck(htmlTree)); + } + + /** + * Constructor to construct an HTML document. + * + * @param docType document type for the HTML document + * @param htmlTree HTML tree of the document + */ + public HtmlDocument(Content docType, Content htmlTree) { + docContent = new ArrayList(); + addContent(nullCheck(docType)); + addContent(nullCheck(htmlTree)); + } + + /** + * Adds content for the HTML document. + * + * @param htmlContent html content to be added + */ + public void addContent(Content htmlContent) { + if (htmlContent.isValid()) + docContent.add(htmlContent); + } + + /** + * This method is not supported by the class. + * + * @param stringContent string content that needs to be added + * @throws DocletAbortException this method will always throw a + * DocletAbortException because it + * is not supported. + */ + public void addContent(String stringContent) { + throw new DocletAbortException(); + } + + /** + * {@inheritDoc} + */ + public boolean isEmpty() { + return (docContent.isEmpty()); + } + + /** + * {@inheritDoc} + */ + public void write(StringBuilder contentBuilder) { + for (Content c : docContent) + c.write(contentBuilder); + } +} diff --git a/jdk/src/solaris/hpi/include/largefile.h b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java similarity index 56% rename from jdk/src/solaris/hpi/include/largefile.h rename to langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java index 45305347588..3780152d99b 100644 --- a/jdk/src/solaris/hpi/include/largefile.h +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * 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,28 +23,51 @@ * questions. */ -#ifndef _JAVASOFT_LARGEFILE_SUPPORT_H_ -#define _JAVASOFT_LARGEFILE_SUPPORT_H_ +package com.sun.tools.doclets.formats.html.markup; -#ifdef __solaris__ -#include "largefile_solaris.h" -#endif - -#ifdef __linux__ -#include "largefile_linux.h" -#endif - -/* - * Prototypes for wrappers that we define. These wrapper functions - * are low-level I/O routines that will use 64 bit versions if - * available, else revert to the 32 bit ones. +/** + * Enum representing HTML styles. The name map to values in the CSS file. + * + * @author Bhavesh Patel */ -extern off64_t lseek64_w(int fd, off64_t offset, int whence); -extern int fstat64_w(int fd, struct stat *buf); -extern int ftruncate64_w(int fd, off64_t length); -extern int open64_w(const char *path, int oflag, int mode); - -/* This is defined in system_md.c */ -extern int sysFfileMode(int fd, int* mode); - -#endif /* _JAVASOFT_LARGEFILE_SUPPORT_H_ */ +public enum HtmlStyle { + aboutLanguage, + altColor, + bar, + block, + blockList, + blockListLast, + bottomNav, + classUseContainer, + colFirst, + colLast, + colOne, + constantValuesContainer, + contentContainer, + description, + details, + header, + horizontal, + footer, + indexContainer, + indexHeader, + inheritance, + legalCopy, + nameValue, + navBarCell1Rev, + navList, + overviewSummary, + packageSummary, + rowColor, + serializedFormContainer, + sourceContainer, + sourceLineNo, + strong, + subNav, + subNavList, + subTitle, + summary, + tabEnd, + title, + topNav; +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java new file mode 100644 index 00000000000..6a58bb0b3d8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.doclets.formats.html.markup; + +/** + * Enum representing HTML tags. + * + * @author Bhavesh Patel + */ +public enum HtmlTag { + A(BlockType.INLINE, EndTag.END), + BLOCKQUOTE, + BODY(BlockType.OTHER, EndTag.END), + BR(BlockType.INLINE, EndTag.NOEND), + CAPTION, + CENTER, + CODE(BlockType.INLINE, EndTag.END), + DD, + DIV, + DL, + DT, + EM(BlockType.INLINE, EndTag.END), + FONT(BlockType.INLINE, EndTag.END), + FRAME(BlockType.OTHER, EndTag.NOEND), + FRAMESET(BlockType.OTHER, EndTag.END), + H1, + H2, + H3, + H4, + H5, + H6, + HEAD(BlockType.OTHER, EndTag.END), + HR(BlockType.BLOCK, EndTag.NOEND), + HTML(BlockType.OTHER, EndTag.END), + I(BlockType.INLINE, EndTag.END), + IMG(BlockType.INLINE, EndTag.NOEND), + LI, + LINK(BlockType.OTHER, EndTag.NOEND), + MENU, + META(BlockType.OTHER, EndTag.NOEND), + NOFRAMES(BlockType.OTHER, EndTag.END), + NOSCRIPT(BlockType.OTHER, EndTag.END), + OL, + P, + PRE, + SCRIPT(BlockType.OTHER, EndTag.END), + SMALL(BlockType.INLINE, EndTag.END), + SPAN(BlockType.INLINE, EndTag.END), + STRONG(BlockType.INLINE, EndTag.END), + TABLE, + TBODY, + TD, + TH, + TITLE(BlockType.OTHER, EndTag.END), + TR, + TT(BlockType.INLINE, EndTag.END), + UL; + + protected final BlockType blockType; + protected final EndTag endTag; + private final String value; + + /** + * Enum representing the type of HTML element. + */ + protected static enum BlockType { + BLOCK, + INLINE, + OTHER; + } + + /** + * Enum representing HTML end tag requirement. + */ + protected static enum EndTag { + END, + NOEND; + } + + HtmlTag() { + this(BlockType.BLOCK, EndTag.END); + } + + HtmlTag(BlockType blockType, EndTag endTag ) { + this.blockType = blockType; + this.endTag = endTag; + this.value = name().toLowerCase(); + } + + /** + * Returns true if the end tag is required. This is specific to the standard + * doclet and does not exactly resemble the W3C specifications. + * + * @return true if end tag needs to be displayed else return false + */ + public boolean endTagRequired() { + return (endTag == EndTag.END); + } + + public String toString() { + return value; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java new file mode 100644 index 00000000000..13019c663e1 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java @@ -0,0 +1,777 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.doclets.formats.html.markup; + +import java.util.*; +import com.sun.tools.doclets.internal.toolkit.Content; +import com.sun.tools.doclets.internal.toolkit.util.*; + +/** + * Class for generating HTML tree for javadoc output. + * + * @author Bhavesh Patel + */ +public class HtmlTree extends Content { + + private HtmlTag htmlTag; + private Map attrs = Collections.emptyMap(); + private List content = Collections.emptyList(); + public static final Content EMPTY = new StringContent(""); + + /** + * Constructor to construct HtmlTree object. + * + * @param tag HTML tag for the HtmlTree object + */ + public HtmlTree(HtmlTag tag) { + htmlTag = nullCheck(tag); + } + + /** + * Constructor to construct HtmlTree object. + * + * @param tag HTML tag for the HtmlTree object + * @param contents contents to be added to the tree + */ + public HtmlTree(HtmlTag tag, Content... contents) { + this(tag); + for (Content content: contents) + addContent(content); + } + + /** + * Adds an attribute for the HTML tag. + * + * @param attrName name of the attribute + * @param attrValue value of the attribute + */ + public void addAttr(HtmlAttr attrName, String attrValue) { + if (attrs.isEmpty()) + attrs = new LinkedHashMap(); + attrs.put(nullCheck(attrName), nullCheck(attrValue)); + } + + /** + * Adds a style for the HTML tag. + * + * @param style style to be added + */ + public void addStyle(HtmlStyle style) { + addAttr(HtmlAttr.CLASS, style.toString()); + } + + /** + * Adds content for the HTML tag. + * + * @param tagContent tag content to be added + */ + public void addContent(Content tagContent) { + if (tagContent == HtmlTree.EMPTY || tagContent.isValid()) { + if (content.isEmpty()) + content = new ArrayList(); + content.add(tagContent); + } + } + + /** + * This method adds a string content to the htmltree. If the last content member + * added is a StringContent, append the string to that StringContent or else + * create a new StringContent and add it to the html tree. + * + * @param stringContent string content that needs to be added + */ + public void addContent(String stringContent) { + if (!content.isEmpty()) { + Content lastContent = content.get(content.size() - 1); + if (lastContent instanceof StringContent) + lastContent.addContent(stringContent); + else + addContent(new StringContent(stringContent)); + } + else + addContent(new StringContent(stringContent)); + } + + /** + * Generates an HTML anchor tag. + * + * @param ref reference url for the anchor tag + * @param body content for the anchor tag + * @return an HtmlTree object + */ + public static HtmlTree A(String ref, Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.A, nullCheck(body)); + htmltree.addAttr(HtmlAttr.HREF, nullCheck(ref)); + return htmltree; + } + + /** + * Generates an HTML anchor tag with name attribute and content. + * + * @param name name for the anchor tag + * @param body content for the anchor tag + * @return an HtmlTree object + */ + public static HtmlTree A_NAME(String name, Content body) { + HtmlTree htmltree = HtmlTree.A_NAME(name); + htmltree.addContent(nullCheck(body)); + return htmltree; + } + + /** + * Generates an HTML anchor tag with name attribute. + * + * @param name name for the anchor tag + * @return an HtmlTree object + */ + public static HtmlTree A_NAME(String name) { + HtmlTree htmltree = new HtmlTree(HtmlTag.A); + htmltree.addAttr(HtmlAttr.NAME, nullCheck(name)); + return htmltree; + } + + /** + * Generates a CAPTION tag with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the CAPTION tag + */ + public static HtmlTree CAPTION(Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.CAPTION, nullCheck(body)); + return htmltree; + } + + /** + * Generates a CODE tag with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the CODE tag + */ + public static HtmlTree CODE(Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.CODE, nullCheck(body)); + return htmltree; + } + + /** + * Generates a DD tag with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the DD tag + */ + public static HtmlTree DD(Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.DD, nullCheck(body)); + return htmltree; + } + + /** + * Generates a DL tag with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the DL tag + */ + public static HtmlTree DL(Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.DL, nullCheck(body)); + return htmltree; + } + + /** + * Generates a DIV tag with the style class attributes. It also encloses + * a content. + * + * @param styleClass stylesheet class for the tag + * @param body content for the tag + * @return an HtmlTree object for the DIV tag + */ + public static HtmlTree DIV(HtmlStyle styleClass, Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.DIV, nullCheck(body)); + if (styleClass != null) + htmltree.addStyle(styleClass); + return htmltree; + } + + /** + * Generates a DIV tag with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the DIV tag + */ + public static HtmlTree DIV(Content body) { + return DIV(null, body); + } + + /** + * Generates a DT tag with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the DT tag + */ + public static HtmlTree DT(Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.DT, nullCheck(body)); + return htmltree; + } + + /** + * Generates a EM tag with some content. + * + * @param body content to be added to the tag + * @return an HtmlTree object for the EM tag + */ + public static HtmlTree EM(Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.EM, nullCheck(body)); + return htmltree; + } + + /** + * Generates a FRAME tag. + * + * @param src the url of the document to be shown in the frame + * @param name specifies the name of the frame + * @param title the title for the frame + * @param scrolling specifies whether to display scrollbars in the frame + * @return an HtmlTree object for the FRAME tag + */ + public static HtmlTree FRAME(String src, String name, String title, String scrolling) { + HtmlTree htmltree = new HtmlTree(HtmlTag.FRAME); + htmltree.addAttr(HtmlAttr.SRC, nullCheck(src)); + htmltree.addAttr(HtmlAttr.NAME, nullCheck(name)); + htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title)); + if (scrolling != null) + htmltree.addAttr(HtmlAttr.SCROLLING, scrolling); + return htmltree; + } + + /** + * Generates a Frame tag. + * + * @param src the url of the document to be shown in the frame + * @param name specifies the name of the frame + * @param title the title for the frame + * @return an HtmlTree object for the SPAN tag + */ + public static HtmlTree FRAME(String src, String name, String title) { + return FRAME(src, name, title, null); + } + + /** + * Generates a FRAMESET tag. + * + * @param cols the size of columns in the frameset + * @param rows the size of rows in the frameset + * @param title the title for the frameset + * @param onload the script to run when the document loads + * @return an HtmlTree object for the FRAMESET tag + */ + public static HtmlTree FRAMESET(String cols, String rows, String title, String onload) { + HtmlTree htmltree = new HtmlTree(HtmlTag.FRAMESET); + if (cols != null) + htmltree.addAttr(HtmlAttr.COLS, cols); + if (rows != null) + htmltree.addAttr(HtmlAttr.ROWS, rows); + htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title)); + htmltree.addAttr(HtmlAttr.ONLOAD, nullCheck(onload)); + return htmltree; + } + + /** + * Generates a heading tag (h1 to h6) with the title and style class attributes. It also encloses + * a content. + * + * @param headingTag the heading tag to be generated + * @param printTitle true if title for the tag needs to be printed else false + * @param styleClass stylesheet class for the tag + * @param body content for the tag + * @return an HtmlTree object for the tag + */ + public static HtmlTree HEADING(HtmlTag headingTag, boolean printTitle, + HtmlStyle styleClass, Content body) { + HtmlTree htmltree = new HtmlTree(headingTag, nullCheck(body)); + if (printTitle) + htmltree.addAttr(HtmlAttr.TITLE, Util.stripHtml(body.toString())); + if (styleClass != null) + htmltree.addStyle(styleClass); + return htmltree; + } + + /** + * Generates a heading tag (h1 to h6) with style class attribute. It also encloses + * a content. + * + * @param headingTag the heading tag to be generated + * @param styleClass stylesheet class for the tag + * @param body content for the tag + * @return an HtmlTree object for the tag + */ + public static HtmlTree HEADING(HtmlTag headingTag, HtmlStyle styleClass, Content body) { + return HEADING(headingTag, false, styleClass, body); + } + + /** + * Generates a heading tag (h1 to h6) with the title attribute. It also encloses + * a content. + * + * @param headingTag the heading tag to be generated + * @param printTitle true if the title for the tag needs to be printed else false + * @param body content for the tag + * @return an HtmlTree object for the tag + */ + public static HtmlTree HEADING(HtmlTag headingTag, boolean printTitle, Content body) { + return HEADING(headingTag, printTitle, null, body); + } + + /** + * Generates a heading tag (h1 to h6) with some content. + * + * @param headingTag the heading tag to be generated + * @param body content for the tag + * @return an HtmlTree object for the tag + */ + public static HtmlTree HEADING(HtmlTag headingTag, Content body) { + return HEADING(headingTag, false, null, body); + } + + /** + * Generates an HTML tag with lang attribute. It also adds head and body + * content to the HTML tree. + * + * @param lang language for the HTML document + * @param head head for the HTML tag + * @param body body for the HTML tag + * @return an HtmlTree object for the HTML tag + */ + public static HtmlTree HTML(String lang, Content head, Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.HTML, nullCheck(head), nullCheck(body)); + htmltree.addAttr(HtmlAttr.LANG, nullCheck(lang)); + return htmltree; + } + + /** + * Generates a I tag with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the I tag + */ + public static HtmlTree I(Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.I, nullCheck(body)); + return htmltree; + } + + /** + * Generates a LI tag with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the LI tag + */ + public static HtmlTree LI(Content body) { + return LI(null, body); + } + + /** + * Generates a LI tag with some content. + * + * @param styleClass style for the tag + * @param body content for the tag + * @return an HtmlTree object for the LI tag + */ + public static HtmlTree LI(HtmlStyle styleClass, Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.LI, nullCheck(body)); + if (styleClass != null) + htmltree.addStyle(styleClass); + return htmltree; + } + + /** + * Generates a LINK tag with the rel, type, href and title attributes. + * + * @param rel relevance of the link + * @param type type of link + * @param href the path for the link + * @param title title for the link + * @return an HtmlTree object for the LINK tag + */ + public static HtmlTree LINK(String rel, String type, String href, String title) { + HtmlTree htmltree = new HtmlTree(HtmlTag.LINK); + htmltree.addAttr(HtmlAttr.REL, nullCheck(rel)); + htmltree.addAttr(HtmlAttr.TYPE, nullCheck(type)); + htmltree.addAttr(HtmlAttr.HREF, nullCheck(href)); + htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title)); + return htmltree; + } + + /** + * Generates a META tag with the http-equiv, content and charset attributes. + * + * @param http-equiv http equiv attribute for the META tag + * @param content type of content + * @param charset character set used + * @return an HtmlTree object for the META tag + */ + public static HtmlTree META(String httpEquiv, String content, String charSet) { + HtmlTree htmltree = new HtmlTree(HtmlTag.META); + htmltree.addAttr(HtmlAttr.HTTP_EQUIV, nullCheck(httpEquiv)); + htmltree.addAttr(HtmlAttr.CONTENT, nullCheck(content)); + htmltree.addAttr(HtmlAttr.CHARSET, nullCheck(charSet)); + return htmltree; + } + + /** + * Generates a META tag with the name and content attributes. + * + * @param name name attribute + * @param content type of content + * @return an HtmlTree object for the META tag + */ + public static HtmlTree META(String name, String content) { + HtmlTree htmltree = new HtmlTree(HtmlTag.META); + htmltree.addAttr(HtmlAttr.NAME, nullCheck(name)); + htmltree.addAttr(HtmlAttr.CONTENT, nullCheck(content)); + return htmltree; + } + + /** + * Generates a NOSCRIPT tag with some content. + * + * @param body content of the noscript tag + * @return an HtmlTree object for the NOSCRIPT tag + */ + public static HtmlTree NOSCRIPT(Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.NOSCRIPT, nullCheck(body)); + return htmltree; + } + + /** + * Generates a P tag with some content. + * + * @param body content of the Paragraph tag + * @return an HtmlTree object for the P tag + */ + public static HtmlTree P(Content body) { + return P(null, body); + } + + /** + * Generates a P tag with some content. + * + * @param styleClass style of the Paragraph tag + * @param body content of the Paragraph tag + * @return an HtmlTree object for the P tag + */ + public static HtmlTree P(HtmlStyle styleClass, Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.P, nullCheck(body)); + if (styleClass != null) + htmltree.addStyle(styleClass); + return htmltree; + } + + /** + * Generates a SMALL tag with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the SMALL tag + */ + public static HtmlTree SMALL(Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.SMALL, nullCheck(body)); + return htmltree; + } + + /** + * Generates a STRONG tag with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the STRONG tag + */ + public static HtmlTree STRONG(Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.STRONG, nullCheck(body)); + return htmltree; + } + + /** + * Generates a SPAN tag with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the SPAN tag + */ + public static HtmlTree SPAN(Content body) { + return SPAN(null, body); + } + + /** + * Generates a SPAN tag with style class attribute and some content. + * + * @param styleClass style class for the tag + * @param body content for the tag + * @return an HtmlTree object for the SPAN tag + */ + public static HtmlTree SPAN(HtmlStyle styleClass, Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.SPAN, nullCheck(body)); + if (styleClass != null) + htmltree.addStyle(styleClass); + return htmltree; + } + + /** + * Generates a Table tag with border, width and summary attributes and + * some content. + * + * @param border border for the table + * @param width width of the table + * @param summary summary for the table + * @param body content for the table + * @return an HtmlTree object for the TABLE tag + */ + public static HtmlTree TABLE(int border, int width, String summary, + Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.TABLE, nullCheck(body)); + htmltree.addAttr(HtmlAttr.BORDER, Integer.toString(border)); + htmltree.addAttr(HtmlAttr.WIDTH, Integer.toString(width)); + htmltree.addAttr(HtmlAttr.SUMMARY, nullCheck(summary)); + return htmltree; + } + + /** + * Generates a Table tag with style class, border, cell padding, + * cellspacing and summary attributes and some content. + * + * @param styleClass style of the table + * @param border border for the table + * @param cellPadding cell padding for the table + * @param cellSpacing cell spacing for the table + * @param summary summary for the table + * @param body content for the table + * @return an HtmlTree object for the TABLE tag + */ + public static HtmlTree TABLE(HtmlStyle styleClass, int border, int cellPadding, + int cellSpacing, String summary, Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.TABLE, nullCheck(body)); + if (styleClass != null) + htmltree.addStyle(styleClass); + htmltree.addAttr(HtmlAttr.BORDER, Integer.toString(border)); + htmltree.addAttr(HtmlAttr.CELLPADDING, Integer.toString(cellPadding)); + htmltree.addAttr(HtmlAttr.CELLSPACING, Integer.toString(cellSpacing)); + htmltree.addAttr(HtmlAttr.SUMMARY, nullCheck(summary)); + return htmltree; + } + + /** + * Generates a Table tag with border, cell padding, + * cellspacing and summary attributes and some content. + * + * @param border border for the table + * @param cellPadding cell padding for the table + * @param cellSpacing cell spacing for the table + * @param summary summary for the table + * @param body content for the table + * @return an HtmlTree object for the TABLE tag + */ + public static HtmlTree TABLE(int border, int cellPadding, + int cellSpacing, String summary, Content body) { + return TABLE(null, border, cellPadding, cellSpacing, summary, body); + } + + /** + * Generates a TD tag with style class attribute and some content. + * + * @param styleClass style for the tag + * @param body content for the tag + * @return an HtmlTree object for the TD tag + */ + public static HtmlTree TD(HtmlStyle styleClass, Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.TD, nullCheck(body)); + if (styleClass != null) + htmltree.addStyle(styleClass); + return htmltree; + } + + /** + * Generates a TD tag for an HTML table with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the TD tag + */ + public static HtmlTree TD(Content body) { + return TD(null, body); + } + + /** + * Generates a TH tag with style class and scope attributes and some content. + * + * @param styleClass style for the tag + * @param scope scope of the tag + * @param body content for the tag + * @return an HtmlTree object for the TH tag + */ + public static HtmlTree TH(HtmlStyle styleClass, String scope, Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.TH, nullCheck(body)); + if (styleClass != null) + htmltree.addStyle(styleClass); + htmltree.addAttr(HtmlAttr.SCOPE, nullCheck(scope)); + return htmltree; + } + + /** + * Generates a TH tag with scope attribute and some content. + * + * @param scope scope of the tag + * @param body content for the tag + * @return an HtmlTree object for the TH tag + */ + public static HtmlTree TH(String scope, Content body) { + return TH(null, scope, body); + } + + /** + * Generates a TITLE tag with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the TITLE tag + */ + public static HtmlTree TITLE(Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.TITLE, nullCheck(body)); + return htmltree; + } + + /** + * Generates a TR tag for an HTML table with some content. + * + * @param body content for the tag + * @return an HtmlTree object for the TR tag + */ + public static HtmlTree TR(Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.TR, nullCheck(body)); + return htmltree; + } + + /** + * Generates a UL tag with the style class attribute and some content. + * + * @param styleClass style for the tag + * @param body content for the tag + * @return an HtmlTree object for the UL tag + */ + public static HtmlTree UL(HtmlStyle styleClass, Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.UL, nullCheck(body)); + htmltree.addStyle(nullCheck(styleClass)); + return htmltree; + } + + /** + * {@inheritDoc} + */ + public boolean isEmpty() { + return (!hasContent() && !hasAttrs()); + } + + /** + * Returns true if the HTML tree has content. + * + * @return true if the HTML tree has content else return false + */ + public boolean hasContent() { + return (!content.isEmpty()); + } + + /** + * Returns true if the HTML tree has attributes. + * + * @return true if the HTML tree has attributes else return false + */ + public boolean hasAttrs() { + return (!attrs.isEmpty()); + } + + /** + * Returns true if the HTML tree has a specific attribute. + * + * @param attrName name of the attribute to check within the HTML tree + * @return true if the HTML tree has the specified attribute else return false + */ + public boolean hasAttr(HtmlAttr attrName) { + return (attrs.containsKey(attrName)); + } + + /** + * Returns true if the HTML tree is valid. This check is more specific to + * standard doclet and not exactly similar to W3C specifications. But it + * ensures HTML validation. + * + * @return true if the HTML tree is valid + */ + public boolean isValid() { + switch (htmlTag) { + case A : + return (hasAttr(HtmlAttr.NAME) || (hasAttr(HtmlAttr.HREF) && hasContent())); + case BR : + return (!hasContent() && (!hasAttrs() || hasAttr(HtmlAttr.CLEAR))); + case FRAME : + return (hasAttr(HtmlAttr.SRC) && !hasContent()); + case HR : + return (!hasContent()); + case IMG : + return (hasAttr(HtmlAttr.SRC) && hasAttr(HtmlAttr.ALT) && !hasContent()); + case LINK : + return (hasAttr(HtmlAttr.HREF) && !hasContent()); + case META : + return (hasAttr(HtmlAttr.CONTENT) && !hasContent()); + default : + return hasContent(); + } + } + + /** + * Returns true if the element is an inline element. + * + * @return true if the HTML tag is an inline element + */ + public boolean isInline() { + return (htmlTag.blockType == HtmlTag.BlockType.INLINE); + } + + /** + * {@inheritDoc} + */ + public void write(StringBuilder contentBuilder) { + if (!isInline() && !endsWithNewLine(contentBuilder)) + contentBuilder.append(DocletConstants.NL); + String tagString = htmlTag.toString(); + contentBuilder.append("<" + tagString); + Iterator iterator = attrs.keySet().iterator(); + HtmlAttr key; + String value = ""; + while (iterator.hasNext()) { + key = iterator.next(); + value = attrs.get(key); + contentBuilder.append(" " + key.toString()); + if (!value.isEmpty()) + contentBuilder.append("=\"" + value + "\""); + } + contentBuilder.append(">"); + for (Content c : content) + c.write(contentBuilder); + if (htmlTag.endTagRequired()) + contentBuilder.append(""); + if (!isInline()) + contentBuilder.append(DocletConstants.NL); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java index 2d607af4a67..0ebd587f094 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,7 +55,7 @@ public class HtmlWriter extends PrintWriter { * URL file separator string("/"). */ public static final String fileseparator = - DirectoryManager.URL_FILE_SEPERATOR; + DirectoryManager.URL_FILE_SEPARATOR; /** * The configuration @@ -82,6 +82,72 @@ public class HtmlWriter extends PrintWriter { */ protected final String modifierTypeHeader; + public final Content overviewLabel; + + public final Content defaultPackageLabel; + + public final Content packageLabel; + + public final Content useLabel; + + public final Content prevLabel; + + public final Content nextLabel; + + public final Content prevclassLabel; + + public final Content nextclassLabel; + + public final Content summaryLabel; + + public final Content detailLabel; + + public final Content framesLabel; + + public final Content noframesLabel; + + public final Content treeLabel; + + public final Content classLabel; + + public final Content deprecatedLabel; + + public final Content deprecatedPhrase; + + public final Content allclassesLabel; + + public final Content indexLabel; + + public final Content helpLabel; + + public final Content seeLabel; + + public final Content descriptionLabel; + + public final Content prevpackageLabel; + + public final Content nextpackageLabel; + + public final Content packagesLabel; + + public final Content methodDetailsLabel; + + public final Content annotationTypeDetailsLabel; + + public final Content fieldDetailsLabel; + + public final Content constructorDetailsLabel; + + public final Content enumConstantsDetailsLabel; + + public final Content specifiedByLabel; + + public final Content overridesLabel; + + public final Content descfrmClassLabel; + + public final Content descfrmInterfaceLabel; + /** * Constructor. * @@ -111,6 +177,73 @@ public class HtmlWriter extends PrintWriter { modifierTypeHeader = configuration.getText("doclet.0_and_1", configuration.getText("doclet.Modifier"), configuration.getText("doclet.Type")); + overviewLabel = getResource("doclet.Overview"); + defaultPackageLabel = new RawHtml( + DocletConstants.DEFAULT_PACKAGE_NAME); + packageLabel = getResource("doclet.Package"); + useLabel = getResource("doclet.navClassUse"); + prevLabel = getResource("doclet.Prev"); + nextLabel = getResource("doclet.Next"); + prevclassLabel = getResource("doclet.Prev_Class"); + nextclassLabel = getResource("doclet.Next_Class"); + summaryLabel = getResource("doclet.Summary"); + detailLabel = getResource("doclet.Detail"); + framesLabel = getResource("doclet.FRAMES"); + noframesLabel = getResource("doclet.NO_FRAMES"); + treeLabel = getResource("doclet.Tree"); + classLabel = getResource("doclet.Class"); + deprecatedLabel = getResource("doclet.navDeprecated"); + deprecatedPhrase = getResource("doclet.Deprecated"); + allclassesLabel = getResource("doclet.All_Classes"); + indexLabel = getResource("doclet.Index"); + helpLabel = getResource("doclet.Help"); + seeLabel = getResource("doclet.See"); + descriptionLabel = getResource("doclet.Description"); + prevpackageLabel = getResource("doclet.Prev_Package"); + nextpackageLabel = getResource("doclet.Next_Package"); + packagesLabel = getResource("doclet.Packages"); + methodDetailsLabel = getResource("doclet.Method_Detail"); + annotationTypeDetailsLabel = getResource("doclet.Annotation_Type_Member_Detail"); + fieldDetailsLabel = getResource("doclet.Field_Detail"); + constructorDetailsLabel = getResource("doclet.Constructor_Detail"); + enumConstantsDetailsLabel = getResource("doclet.Enum_Constant_Detail"); + specifiedByLabel = getResource("doclet.Specified_By"); + overridesLabel = getResource("doclet.Overrides"); + descfrmClassLabel = getResource("doclet.Description_From_Class"); + descfrmInterfaceLabel = getResource("doclet.Description_From_Interface"); + } + + /** + * Get the configuration string as a content. + * + * @param key the key to look for in the configuration file + * @return a content tree for the text + */ + public Content getResource(String key) { + return new StringContent(configuration.getText(key)); + } + + /** + * Get the configuration string as a content. + * + * @param key the key to look for in the configuration file + * @param a1 string argument added to configuration text + * @return a content tree for the text + */ + public Content getResource(String key, String a1) { + return new RawHtml(configuration.getText(key, a1)); + } + + /** + * Get the configuration string as a content. + * + * @param key the key to look for in the configuration file + * @param a1 string argument added to configuration text + * @param a2 string argument added to configuration text + * @return a content tree for the text + */ + public Content getResource(String key, String a1, String a2) { + return new RawHtml(configuration.getText(key, a1, a2)); } /** @@ -145,6 +278,48 @@ public class HtmlWriter extends PrintWriter { } } + /** + * Returns an HtmlTree for the SCRIPT tag. + * + * @return an HtmlTree for the SCRIPT tag + */ + protected HtmlTree getWinTitleScript(){ + HtmlTree script = new HtmlTree(HtmlTag.SCRIPT); + if(winTitle != null && winTitle.length() > 0) { + script.addAttr(HtmlAttr.TYPE, "text/javascript"); + String scriptCode = "" + DocletConstants.NL; + RawHtml scriptContent = new RawHtml(scriptCode); + script.addContent(scriptContent); + } + return script; + } + + /** + * Returns a content tree for the SCRIPT tag for the main page(index.html). + * + * @return a content for the SCRIPT tag + */ + protected Content getFramesetJavaScript(){ + HtmlTree script = new HtmlTree(HtmlTag.SCRIPT); + script.addAttr(HtmlAttr.TYPE, "text/javascript"); + String scriptCode = DocletConstants.NL + " targetPage = \"\" + window.location.search;" + DocletConstants.NL + + " if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL + + " targetPage = targetPage.substring(1);" + DocletConstants.NL + + " if (targetPage.indexOf(\":\") != -1)" + DocletConstants.NL + + " targetPage = \"undefined\";" + DocletConstants.NL + + " function loadFrames() {" + DocletConstants.NL + + " if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL + + " top.classFrame.location = top.targetPage;" + DocletConstants.NL + + " }" + DocletConstants.NL; + RawHtml scriptContent = new RawHtml(scriptCode); + script.addContent(scriptContent); + return script; + } + /** * Print the Javascript <SCRIPT> start tag with its type * attribute. @@ -203,6 +378,28 @@ public class HtmlWriter extends PrintWriter { println(">"); } + /** + * Returns an HtmlTree for the BODY tag. + * + * @param includeScript set true if printing windowtitle script + * @param title title for the window + * @return an HtmlTree for the BODY tag + */ + public HtmlTree getBody(boolean includeScript, String title) { + HtmlTree body = new HtmlTree(HtmlTag.BODY); + // Set window title string which is later printed + this.winTitle = title; + // Don't print windowtitle script for overview-frame, allclasses-frame + // and package-frame + if (includeScript) { + body.addContent(getWinTitleScript()); + Content noScript = HtmlTree.NOSCRIPT( + HtmlTree.DIV(getResource("doclet.No_Script_Message"))); + body.addContent(noScript); + } + return body; + } + /** * Print </BODY> tag. Add a newline character at the end. */ @@ -228,6 +425,15 @@ public class HtmlWriter extends PrintWriter { title(); } + /** + * Returns an HtmlTree for the TITLE tag. + * + * @return an HtmlTree for the TITLE tag + */ + public HtmlTree getTitle() { + HtmlTree title = HtmlTree.TITLE(new StringContent(winTitle)); + return title; + } /** * Print </TITLE> tag. Add a newline character at the end. @@ -519,17 +725,17 @@ public class HtmlWriter extends PrintWriter { } /** - * Return, text passed, with Italics <I> and </I> tags, surrounding it. - * So if the text passed is "Hi", then string returned will be "<I>Hi</I>". + * Return, text passed, with Italics <i> and </i> tags, surrounding it. + * So if the text passed is "Hi", then string returned will be "<i>Hi</i>". * * @param text String to be printed in between <I> and </I> tags. */ public String italicsText(String text) { - return "" + text + ""; + return "" + text + ""; } public String codeText(String text) { - return "" + text + ""; + return "" + text + ""; } /** @@ -539,6 +745,13 @@ public class HtmlWriter extends PrintWriter { print(" "); } + /** + * Return "&nbsp;", non-breaking space. + */ + public Content getSpace() { + return RawHtml.nbsp; + } + /** * Print <DL> tag. Add a newline character at the end. */ @@ -1182,21 +1395,21 @@ public class HtmlWriter extends PrintWriter { } /** - * Get the "<CODE>" string. + * Get the "<code>" string. * - * @return String Return String "<CODE>"; + * @return String Return String "<code>"; */ public String getCode() { - return ""; + return ""; } /** - * Get the "</CODE>" string. + * Get the "</code>" string. * - * @return String Return String "</CODE>"; + * @return String Return String "</code>"; */ public String getCodeEnd() { - return ""; + return ""; } /** diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/RawHtml.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/RawHtml.java new file mode 100644 index 00000000000..56c23965534 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/RawHtml.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.doclets.formats.html.markup; + +import com.sun.tools.doclets.internal.toolkit.Content; +import com.sun.tools.doclets.internal.toolkit.util.*; + +/** + * Class for generating raw HTML content to be added to HTML pages of javadoc output. + * + * @author Bhavesh Patel + */ +public class RawHtml extends Content{ + + private String rawHtmlContent; + + public static final Content nbsp = new RawHtml(" "); + + /** + * Constructor to construct a RawHtml object. + * + * @param rawHtml raw HTML text to be added + */ + public RawHtml(String rawHtml) { + rawHtmlContent = nullCheck(rawHtml); + } + + /** + * This method is not supported by the class. + * + * @param content content that needs to be added + * @throws DocletAbortException this method will always throw a + * DocletAbortException because it + * is not supported. + */ + public void addContent(Content content) { + throw new DocletAbortException(); + } + + /** + * This method is not supported by the class. + * + * @param stringContent string content that needs to be added + * @throws DocletAbortException this method will always throw a + * DocletAbortException because it + * is not supported. + */ + public void addContent(String stringContent) { + throw new DocletAbortException(); + } + + /** + * {@inheritDoc} + */ + public boolean isEmpty() { + return rawHtmlContent.isEmpty(); + } + + /** + * {@inheritDoc} + */ + public void write(StringBuilder contentBuilder) { + contentBuilder.append(rawHtmlContent); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/StringContent.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/StringContent.java new file mode 100644 index 00000000000..2bf4437fb31 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/StringContent.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.doclets.formats.html.markup; + +import com.sun.tools.doclets.internal.toolkit.Content; +import com.sun.tools.doclets.internal.toolkit.util.*; + +/** + * Class for generating string content for HTML tags of javadoc output. + * + * @author Bhavesh Patel + */ +public class StringContent extends Content{ + + private StringBuilder stringContent; + + /** + * Constructor to construct StringContent object. + */ + public StringContent() { + stringContent = new StringBuilder(); + } + + /** + * Constructor to construct StringContent object with some initial content. + * + * @param initialContent initial content for the object + */ + public StringContent(String initialContent) { + stringContent = new StringBuilder( + Util.escapeHtmlChars(nullCheck(initialContent))); + } + + /** + * This method is not supported by the class. + * + * @param content content that needs to be added + * @throws DocletAbortException this method will always throw a + * DocletAbortException because it + * is not supported. + */ + public void addContent(Content content) { + throw new DocletAbortException(); + } + + /** + * Adds content for the StringContent object. The method escapes + * HTML characters for the string content that is added. + * + * @param strContent string content to be added + */ + public void addContent(String strContent) { + stringContent.append(Util.escapeHtmlChars(nullCheck(strContent))); + } + + /** + * {@inheritDoc} + */ + public boolean isEmpty() { + return (stringContent.length() == 0); + } + + /** + * {@inheritDoc} + */ + public String toString() { + return stringContent.toString(); + } + + /** + * {@inheritDoc} + */ + public void write(StringBuilder contentBuilder) { + contentBuilder.append(stringContent); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties index 598cc88d74b..46a783c1b90 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties @@ -43,6 +43,7 @@ doclet.Window_Single_Index=Index doclet.Window_Split_Index={0}-Index doclet.Help=Help doclet.Skip_navigation_links=Skip navigation links +doclet.New_Page=NewPage doclet.None=None doclet.CLASSES=CLASSES doclet.MEMBERS=MEMBERS @@ -53,7 +54,7 @@ doclet.Deprecated_List=Deprecated List doclet.Window_Deprecated_List=Deprecated List doclet.Note_0_is_deprecated=Note: {0} is deprecated. doclet.Overrides=Overrides: -doclet.in_class={0} in class {1} +doclet.in_class=in class doclet.0_Fields_and_Methods="{0}" Fields and Methods doclet.Index_of_Fields_and_Methods=Index of Fields and Methods doclet.Static_variable_in=Static variable in {0} @@ -103,7 +104,7 @@ doclet.Other_Packages=Other Packages doclet.Package_Description=Package {0} Description doclet.Description=Description doclet.Specified_By=Specified by: -doclet.in_interface={0} in interface {1} +doclet.in_interface=in interface doclet.Subclasses=Direct Known Subclasses: doclet.Subinterfaces=All Known Subinterfaces: doclet.Implementing_Classes=All Known Implementing Classes: @@ -121,18 +122,20 @@ doclet.Cannot_handle_no_packages=Cannot handle no packages. doclet.Frame_Alert=Frame Alert doclet.Overview-Member-Frame=Overview Member Frame doclet.Frame_Warning_Message=This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +doclet.No_Script_Message=JavaScript is disabled on your browser. doclet.Non_Frame_Version=Non-frame version. doclet.Frame_Version=Frame version doclet.Link_To=Link to doclet.Following_From_Class=Following copied from class: {0} doclet.Following_From_Interface=Following copied from interface: {0} -doclet.Description_From_Interface=Description copied from interface: {0} -doclet.Description_From_Class=Description copied from class: {0} +doclet.Description_From_Interface=Description copied from interface: +doclet.Description_From_Class=Description copied from class: doclet.Standard_doclet_invoked=Standard doclet invoked... doclet.No_Non_Deprecated_Classes_To_Document=No non-deprecated classes found to document. doclet.Interfaces_Italic=Interfaces (italic) doclet.Enclosing_Class=Enclosing class: doclet.Enclosing_Interface=Enclosing interface: +doclet.Window_Source_title=Source code doclet.Help_title=API Help doclet.Window_Help_title=API Help doclet.Help_line_1=How This API Document Is Organized diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties index 667fa978061..938ac750b21 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties @@ -130,7 +130,7 @@ doclet.Description_From_Class=\u4ece\u7c7b {0} \u590d\u5236\u7684\u63cf\u8ff0 doclet.Standard_doclet_invoked=\u5df2\u8c03\u7528\u7684\u6807\u51c6 doclet... doclet.No_Non_Deprecated_Classes_To_Document=\u627e\u4e0d\u5230\u53ef\u4ee5\u6587\u6863\u5316\u7684\u672a\u8fc7\u65f6\u7684\u7c7b\u3002 doclet.Interfaces_Italic=\u63a5\u53e3\uff08\u659c\u4f53\uff09 -doclet.Enclosing_Class=\u6b63\u5728\u5c01\u95ed\u7c7b\uff1a +doclet.Enclosing_Class=\u5305\u5bb9\u7c7b\uff1a doclet.Enclosing_Interface=\u6b63\u5728\u5c01\u95ed\u63a5\u53e3\uff1a doclet.Help_title=API \u5e2e\u52a9 doclet.Window_Help_title=API \u5e2e\u52a9 diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java index b823eb2ca42..64f4b34e10b 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,14 +35,18 @@ import com.sun.javadoc.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public interface AnnotationTypeOptionalMemberWriter extends - AnnotationTypeRequiredMemberWriter { + AnnotationTypeRequiredMemberWriter { /** - * Write the default value documentation. + * Add the the default value documentation. + * + * @param member the member being documented + * @param annotationDocTree content tree to which the default value will be added */ - public void writeDefaultValueInfo(MemberDoc member); + public void addDefaultValueInfo(MemberDoc member, Content annotationDocTree); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java index 60f4912da21..fb83c2a5688 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,67 +36,79 @@ import com.sun.javadoc.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public interface AnnotationTypeRequiredMemberWriter { /** - * Write the header for the member documentation. + * Add the annotation type details tree header. * - * @param classDoc the annotation type that the members belong to. - * @param header the header to write. + * @param classDoc the annotation type being documented + * @param memberDetailsTree the content tree representing member details */ - public void writeHeader(ClassDoc classDoc, String header); + public void addAnnotationDetailsTreeHeader(ClassDoc classDoc, + Content memberDetailsTree); /** - * Write the member header for the given member. + * Get the annotation type documentation tree header. * - * @param member the member being documented. - * @param isFirst the flag to indicate whether or not the member is - * the first to be documented. + * @param member the annotation type being documented + * @param annotationDetailsTree the content tree representing annotation type details + * @return content tree for the annotation type documentation header */ - public void writeMemberHeader(MemberDoc member, boolean isFirst); + public Content getAnnotationDocTreeHeader(MemberDoc member, + Content annotationDetailsTree); /** - * Write the signature for the given member. + * Get the annotation type details tree. * - * @param member the member being documented. + * @param annotationDetailsTree the content tree representing annotation type details + * @return content tree for the annotation type details */ - public void writeSignature(MemberDoc member); + public Content getAnnotationDetails(Content annotationDetailsTree); /** - * Write the deprecated output for the given member. + * Get the annotation type documentation. * - * @param member the member being documented. + * @param annotationDocTree the content tree representing annotation type documentation + * @param isLastContent true if the content to be added is the last content + * @return content tree for the annotation type documentation */ - public void writeDeprecated(MemberDoc member); + public Content getAnnotationDoc(Content annotationDocTree, boolean isLastContent); /** - * Write the comments for the given member. + * Get the signature for the given member. * - * @param member the member being documented. + * @param member the member being documented + * @return content tree for the annotation type signature */ - public void writeComments(MemberDoc member); + public Content getSignature(MemberDoc member); /** - * Write the tag output for the given member. + * Add the deprecated output for the given member. * - * @param member the member being documented. + * @param member the member being documented + * @param annotationDocTree content tree to which the deprecated information will be added */ - public void writeTags(MemberDoc member); + public void addDeprecated(MemberDoc member, Content annotationDocTree); /** - * Write the member footer. + * Add the comments for the given member. + * + * @param member the member being documented + * @param annotationDocTree the content tree to which the comments will be added */ - public void writeMemberFooter(); + public void addComments(MemberDoc member, Content annotationDocTree); /** - * Write the footer for the member documentation. + * Add the tags for the given member. * - * @param classDoc the class that the member belong to. + * @param member the member being documented + * @param annotationDocTree the content tree to which the tags will be added */ - public void writeFooter(ClassDoc classDoc); + public void addTags(MemberDoc member, Content annotationDocTree); /** * Close the writer. diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java index 51c037aced6..9ef63b50258 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,43 +37,122 @@ import com.sun.javadoc.*; * Do not use it as an API. * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public interface AnnotationTypeWriter { /** - * Write the header of the page. - * @param header the header to write. + * Get the header of the page. + * + * @param header the header string to write + * @return a content tree for the header documentation */ - public void writeHeader(String header); + public Content getHeader(String header); /** - * Write the signature of the current annotation type. + * Get the annotation content header. * - * @param modifiers the modifiers for the signature. + * @return annotation content header that needs to be added to the documentation */ - public void writeAnnotationTypeSignature(String modifiers); + public Content getAnnotationContentHeader(); + + /** + * Get the annotation information tree header. + * + * @return annotation information tree header that needs to be added to the documentation + */ + public Content getAnnotationInfoTreeHeader(); + + /** + * Get the annotation information. + * + * @param annotationInfoTree content tree containing the annotation information + * @return a content tree for the annotation + */ + public Content getAnnotationInfo(Content annotationInfoTree); + + /** + * Add the signature of the current annotation type. + * + * @param modifiers the modifiers for the signature + * @param annotationInfoTree the annotation content tree to which the signature will be added + */ + public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree); /** * Build the annotation type description. + * + * @param annotationInfoTree content tree to which the description will be added */ - public void writeAnnotationTypeDescription(); + public void addAnnotationTypeDescription(Content annotationInfoTree); /** - * Write the tag information for the current annotation type. + * Add the tag information for the current annotation type. + * + * @param annotationInfoTree content tree to which the tag information will be added */ - public void writeAnnotationTypeTagInfo(); + public void addAnnotationTypeTagInfo(Content annotationInfoTree); /** - * If this annotation type is deprecated, write the appropriate information. + * If this annotation is deprecated, add the appropriate information. + * + * @param annotationInfoTree content tree to which the deprecated information will be added */ - public void writeAnnotationTypeDeprecationInfo(); + public void addAnnotationTypeDeprecationInfo (Content annotationInfoTree); /** - * Write the footer of the page. + * Add the annotation type details marker. + * + * @param memberDetails the content tree representing member details marker */ - public void writeFooter(); + public void addAnnotationDetailsMarker(Content memberDetails); + + /** + * Get the member tree header for the annotation type. + * + * @return a content tree for the member tree header + */ + public Content getMemberTreeHeader(); + + /** + * Get the member tree. + * + * @param memberTree the content tree that will be modified and returned + * @return a content tree for the member + */ + public Content getMemberTree(Content memberTree); + + /** + * Get the member summary tree. + * + * @param memberTree the content tree that will be used to build the summary tree + * @return a content tree for the member summary + */ + public Content getMemberSummaryTree(Content memberTree); + + /** + * Get the member details tree. + * + * @param memberTree the content tree that will be used to build the details tree + * @return a content tree for the member details + */ + public Content getMemberDetailsTree(Content memberTree); + + /** + * Add the footer of the page. + * + * @param contentTree content tree to which the footer will be added + */ + public void addFooter(Content contentTree); + + /** + * Print the document. + * + * @param contentTree content tree that will be printed as a document + */ + public void printDocument(Content contentTree); /** * Close the writer. @@ -86,10 +165,4 @@ public interface AnnotationTypeWriter { * @return the AnnotationTypeDoc being documented. */ public AnnotationTypeDoc getAnnotationTypeDoc(); - - /** - * Perform any operations that are necessary when the member summary - * finished building. - */ - public void completeMemberSummaryBuild(); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java index 5af17724ae7..c5bfb13e41b 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,85 +37,149 @@ import com.sun.javadoc.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public interface ClassWriter { /** - * Write the header of the page. - * @param header the header to write. - */ - public void writeHeader(String header); - - /** - * Write the class tree documentation. - */ - public void writeClassTree(); - - /** - * Write all implemented interfaces if this is a class. - */ - public void writeImplementedInterfacesInfo(); - - /** - * Write all super interfaces if this is an interface. - */ - public void writeSuperInterfacesInfo(); - - /** - * Write the type parameter information. - */ - public void writeTypeParamInfo(); - - /** - * Write all the classes that extend this one. - */ - public void writeSubClassInfo(); - - /** - * Write all the interfaces that extend this one. - */ - public void writeSubInterfacesInfo(); - - /** - * If this is an interface, write all classes that implement this - * interface. - */ - public void writeInterfaceUsageInfo (); - - /** - * If this is an inner class or interface, write the enclosing class or - * interface. - */ - public void writeNestedClassInfo (); - - /** - * If this class is deprecated, write the appropriate information. - */ - public void writeClassDeprecationInfo (); - - /** - * Write the signature of the current class. + * Get the header of the page. * - * @param modifiers the modifiers for the signature. + * @param header the header string to write + * @return header content that needs to be added to the documentation */ - public void writeClassSignature(String modifiers); + public Content getHeader(String header); + + /** + * Get the class content header. + * + * @return class content header that needs to be added to the documentation + */ + public Content getClassContentHeader(); + + /** + * Add the class tree documentation. + * + * @param classContentTree class content tree to which the documentation will be added + */ + public void addClassTree(Content classContentTree); + + /** + * Get the class information tree header. + * + * @return class informaion tree header that needs to be added to the documentation + */ + public Content getClassInfoTreeHeader(); + + /** + * Add the type parameter information. + * + * @param classInfoTree content tree to which the documentation will be added + */ + public void addTypeParamInfo(Content classInfoTree); + + /** + * Add all super interfaces if this is an interface. + * + * @param classInfoTree content tree to which the documentation will be added + */ + public void addSuperInterfacesInfo(Content classInfoTree); + + /** + * Add all implemented interfaces if this is a class. + * + * @param classInfoTree content tree to which the documentation will be added + */ + public void addImplementedInterfacesInfo(Content classInfoTree); + + /** + * Add all the classes that extend this one. + * + * @param classInfoTree content tree to which the documentation will be added + */ + public void addSubClassInfo(Content classInfoTree); + + /** + * Add all the interfaces that extend this one. + * + * @param classInfoTree content tree to which the documentation will be added + */ + public void addSubInterfacesInfo(Content classInfoTree); + + /** + * If this is an interface, add all classes that implement this + * interface. + * + * @param classInfoTree content tree to which the documentation will be added + */ + public void addInterfaceUsageInfo(Content classInfoTree); + + /** + * If this is an inner class or interface, add the enclosing class or + * interface. + * + * @param classInfoTree content tree to which the documentation will be added + */ + public void addNestedClassInfo (Content classInfoTree); + + /** + * Get the class information. + * + * @param classInfoTree content tree conatining the class information + * @return a content tree for the class + */ + public Content getClassInfo(Content classInfoTree); + + /** + * If this class is deprecated, add the appropriate information. + * + * @param classInfoTree content tree to which the documentation will be added + */ + public void addClassDeprecationInfo (Content classInfoTree); + + /** + * Add the signature of the current class content tree. + * + * @param modifiers the modifiers for the signature + * @param classInfoTree the class content tree to which the signature will be added + */ + public void addClassSignature(String modifiers, Content classInfoTree); /** * Build the class description. + * + * @param classInfoTree content tree to which the documentation will be added */ - public void writeClassDescription(); + public void addClassDescription(Content classInfoTree); /** - * Write the tag information for the current class. + * Add the tag information for the current class. + * + * @param classInfoTree content tree to which the tag information will be added */ - public void writeClassTagInfo(); + public void addClassTagInfo(Content classInfoTree); /** - * Write the footer of the page. + * Get the member tree header for the class. + * + * @return a content tree for the member tree header */ - public void writeFooter(); + public Content getMemberTreeHeader(); + + /** + * Add the footer of the page. + * + * @param contentTree content tree to which the footer will be added + */ + public void addFooter(Content contentTree); + + /** + * Print the document. + * + * @param contentTree content tree that will be printed as a document + */ + public void printDocument(Content contentTree); /** * Close the writer. @@ -130,8 +194,18 @@ public interface ClassWriter { public ClassDoc getClassDoc(); /** - * Perform any operations that are necessary when the member summary - * finished building. + * Get the member summary tree. + * + * @param memberTree the content tree used to build the summary tree + * @return a content tree for the member summary */ - public void completeMemberSummaryBuild(); + public Content getMemberSummaryTree(Content memberTree); + + /** + * Get the member details tree. + * + * @param memberTree the content tree used to build the details tree + * @return a content tree for the member details + */ + public Content getMemberDetailsTree(Content memberTree); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java index 5c7133232b4..a2eab1b46ec 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +25,9 @@ package com.sun.tools.doclets.internal.toolkit; -import com.sun.javadoc.*; import java.util.*; import java.io.*; +import com.sun.javadoc.*; /** * The interface for writing constants summary output. @@ -37,38 +37,34 @@ import java.io.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public interface ConstantsSummaryWriter { - /** - * Write the header for the summary. - */ - public abstract void writeHeader(); - - /** - * Write the footer for the summary. - */ - public abstract void writeFooter(); - /** * Close the writer. */ public abstract void close() throws IOException; /** - * Write the header for the index. + * Get the header for the constant summary documentation. + * + * @return header that needs to be added to the documentation */ - public abstract void writeContentsHeader(); + public abstract Content getHeader(); /** - * Write the footer for the index. + * Get the header for the constant content list. + * + * @return content header that needs to be added to the documentation */ - public abstract void writeContentsFooter(); + public abstract Content getContentsHeader(); /** - * Add the given package name to the index. + * Adds the given package name link to the constant content list tree. + * * @param pkg the {@link PackageDoc} to index. * @param parsedPackageName the parsed package name. We only Write the * first 2 directory levels of the package @@ -77,38 +73,70 @@ public interface ConstantsSummaryWriter { * @param WriteedPackageHeaders the set of package headers that have already * been indexed. We don't want to index * something more than once. + * @param contentListTree the content tree to which the link will be added */ - public abstract void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName, - Set WriteedPackageHeaders); + public abstract void addLinkToPackageContent(PackageDoc pkg, String parsedPackageName, + Set WriteedPackageHeaders, Content contentListTree); /** - * Write the given package name. - * @param pkg the {@link PackageDoc} to index. - * @param parsedPackageName the parsed package name. We only Write the - * first 2 directory levels of the package - * name. For example, java.lang.ref would be - * indexed as java.lang.*. + * Get the content list to be added to the documentation tree. + * + * @param contentListTree the content that will be added to the list + * @return content list that will be added to the documentation tree */ - public abstract void writePackageName(PackageDoc pkg, - String parsedPackageName); + public abstract Content getContentsList(Content contentListTree); /** - * Write the heading for the current table of constants for a given class. - * @param cd the class whose constants are being documented. + * Get the constant summaries for the document. + * + * @return constant summaries header to be added to the documentation tree */ - public abstract void writeConstantMembersHeader(ClassDoc cd); + public abstract Content getConstantSummaries(); /** - * Document the given constants. + * Adds the given package name. + * + * @param pkg the {@link PackageDoc} to index. + * @param parsedPackageName the parsed package name. We only Write the + * first 2 directory levels of the package + * name. For example, java.lang.ref would be + * indexed as java.lang.*. + * @param summariesTree the documentation tree to which the package name will + * be written + */ + public abstract void addPackageName(PackageDoc pkg, + String parsedPackageName, Content summariesTree); + + /** + * Get the class summary header for the constants summary. + * + * @return the header content for the class constants summary + */ + public abstract Content getClassConstantHeader(); + + /** + * Adds the constant member table to the documentation tree. + * * @param cd the class whose constants are being documented. * @param fields the constants being documented. + * @param classConstantTree the documentation tree to which theconstant member + * table content will be added */ - public abstract void writeConstantMembers(ClassDoc cd, List fields); + public abstract void addConstantMembers(ClassDoc cd, List fields, + Content classConstantTree); /** - * Document the given constants. - * @param cd the class whose constants are being documented. + * Adds the footer for the summary documentation. + * + * @param contentTree content tree to which the footer will be added */ - public abstract void writeConstantMembersFooter(ClassDoc cd); + public abstract void addFooter(Content contentTree); + + /** + * Print the constants summary document. + * + * @param contentTree content tree which should be printed + */ + public abstract void printDocument(Content contentTree); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java index 397a4f31011..8ad48246377 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,67 +36,80 @@ import com.sun.javadoc.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public interface ConstructorWriter { /** - * Write the header for the constructor documentation. + * Get the constructor details tree header. * - * @param classDoc the class that the constructors belong to. - * @param header the header to write. + * @param classDoc the class being documented + * @param memberDetailsTree the content tree representing member details + * @return content tree for the constructor details header */ - public void writeHeader(ClassDoc classDoc, String header); + public Content getConstructorDetailsTreeHeader(ClassDoc classDoc, + Content memberDetailsTree); /** - * Write the constructor header for the given constructor. + * Get the constructor documentation tree header. * - * @param constructor the constructor being documented. - * @param isFirst the flag to indicate whether or not the constructor is the - * first to be documented. + * @param constructor the constructor being documented + * @param constructorDetailsTree the content tree representing constructor details + * @return content tree for the constructor documentation header */ - public void writeConstructorHeader(ConstructorDoc constructor, boolean isFirst); + public Content getConstructorDocTreeHeader(ConstructorDoc constructor, + Content constructorDetailsTree); /** - * Write the signature for the given constructor. + * Get the signature for the given constructor. * - * @param constructor the constructor being documented. + * @param constructor the constructor being documented + * @return content tree for the constructor signature */ - public void writeSignature(ConstructorDoc constructor); + public Content getSignature(ConstructorDoc constructor); /** - * Write the deprecated output for the given constructor. + * Add the deprecated output for the given constructor. * - * @param constructor the constructor being documented. + * @param constructor the constructor being documented + * @param constructorDocTree content tree to which the deprecated information will be added */ - public void writeDeprecated(ConstructorDoc constructor); + public void addDeprecated(ConstructorDoc constructor, Content constructorDocTree); /** - * Write the comments for the given constructor. + * Add the comments for the given constructor. * - * @param constructor the constructor being documented. + * @param constructor the constructor being documented + * @param constructorDocTree the content tree to which the comments will be added */ - public void writeComments(ConstructorDoc constructor); + public void addComments(ConstructorDoc constructor, Content constructorDocTree); /** - * Write the tag output for the given constructor. + * Add the tags for the given constructor. * - * @param constructor the constructor being documented. + * @param constructor the constructor being documented + * @param constructorDocTree the content tree to which the tags will be added */ - public void writeTags(ConstructorDoc constructor); + public void addTags(ConstructorDoc constructor, Content constructorDocTree); /** - * Write the constructor footer. + * Get the constructor details tree. + * + * @param memberDetailsTree the content tree representing member details + * @return content tree for the constructor details */ - public void writeConstructorFooter(); + public Content getConstructorDetails(Content memberDetailsTree); /** - * Write the footer for the constructor documentation. + * Get the constructor documentation. * - * @param classDoc the class that the constructors belong to. + * @param constructorDocTree the content tree representing constructor documentation + * @param isLastContent true if the content to be added is the last content + * @return content tree for the constructor documentation */ - public void writeFooter(ClassDoc classDoc); + public Content getConstructorDoc(Content constructorDocTree, boolean isLastContent); /** * Let the writer know whether a non public constructor was found. diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java new file mode 100644 index 00000000000..8f1c4a12983 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import com.sun.tools.doclets.internal.toolkit.util.*; + +/** + * A class to create content for javadoc output pages. + * + * @author Bhavesh Patel + */ +public abstract class Content { + + /** + * Returns a string representation of the content. + * + * @return string representation of the content + */ + public String toString() { + StringBuilder contentBuilder = new StringBuilder(); + write(contentBuilder); + return contentBuilder.toString(); + } + + /** + * Adds content to the existing content. + * + * @param content content that needs to be added + */ + public abstract void addContent(Content content); + + /** + * Adds a string content to the existing content. + * + * @param stringContent the string content to be added + */ + public abstract void addContent(String stringContent); + + /** + * Writes content to a StringBuilder. + * + */ + public abstract void write(StringBuilder contentBuilder); + + /** + * Returns true if the content is empty. + * + * @return true if no content to be displayed else return false + */ + public abstract boolean isEmpty(); + + /** + * Returns true if the content is valid. + * + * @return true if the content is valid else return false + */ + public boolean isValid() { + return !isEmpty(); + } + + /** + * Checks for null values. + * + * @param t reference type to check for null values + * @return the reference type if not null or else throws a null pointer exception + */ + protected static T nullCheck(T t) { + t.getClass(); + return t; + } + + /** + * Returns true if the content ends with a newline character. Empty content + * is considered as ending with new line. + * + * @param contentBuilder content to test for newline character at the end + * @return true if the content ends with newline. + */ + public boolean endsWithNewLine(StringBuilder contentBuilder) { + return ((contentBuilder.length() == 0) || + (contentBuilder.toString().endsWith(DocletConstants.NL))); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java index 15db4e7cb5c..8b14267880c 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,67 +36,80 @@ import com.sun.javadoc.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public interface EnumConstantWriter { /** - * Write the header for the enum constant documentation. + * Get the enum constants details tree header. * - * @param classDoc the class that the enum constants belong to. - * @param header the header to write. + * @param classDoc the class being documented + * @param memberDetailsTree the content tree representing member details + * @return content tree for the enum constants details header */ - public void writeHeader(ClassDoc classDoc, String header); + public Content getEnumConstantsDetailsTreeHeader(ClassDoc classDoc, + Content memberDetailsTree); /** - * Write the enum constant header for the given enum constant. + * Get the enum constants documentation tree header. * - * @param enumConstant the enum constant being documented. - * @param isFirst the flag to indicate whether or not the enum constant is - * the first to be documented. + * @param enumConstant the enum constant being documented + * @param enumConstantDetailsTree the content tree representing enum constant details + * @return content tree for the enum constant documentation header */ - public void writeEnumConstantHeader(FieldDoc enumConstant, boolean isFirst); + public Content getEnumConstantsTreeHeader(FieldDoc enumConstant, + Content enumConstantsDetailsTree); /** - * Write the signature for the given enum constant. + * Get the signature for the given enum constant. * - * @param enumConstant the enum constant being documented. + * @param enumConstant the enum constant being documented + * @return content tree for the enum constant signature */ - public void writeSignature(FieldDoc enumConstant); + public Content getSignature(FieldDoc enumConstant); /** - * Write the deprecated output for the given enum constant. + * Add the deprecated output for the given enum constant. * - * @param enumConstant the enum constant being documented. + * @param enumConstant the enum constant being documented + * @param enumConstantsTree content tree to which the deprecated information will be added */ - public void writeDeprecated(FieldDoc enumConstant); + public void addDeprecated(FieldDoc enumConstant, Content enumConstantsTree); /** - * Write the comments for the given enum constant. + * Add the comments for the given enum constant. * - * @param enumConstant the enum constant being documented. + * @param enumConstant the enum constant being documented + * @param enumConstantsTree the content tree to which the comments will be added */ - public void writeComments(FieldDoc enumConstant); + public void addComments(FieldDoc enumConstant, Content enumConstantsTree); /** - * Write the tag output for the given enum constant. + * Add the tags for the given enum constant. * - * @param enumConstant the enum constant being documented. + * @param enumConstant the enum constant being documented + * @param enumConstantsTree the content tree to which the tags will be added */ - public void writeTags(FieldDoc enumConstant); + public void addTags(FieldDoc enumConstant, Content enumConstantsTree); /** - * Write the enum constant footer. + * Get the enum constants details tree. + * + * @param memberDetailsTree the content tree representing member details + * @return content tree for the enum constant details */ - public void writeEnumConstantFooter(); + public Content getEnumConstantsDetails(Content memberDetailsTree); /** - * Write the footer for the enum constant documentation. + * Get the enum constants documentation. * - * @param classDoc the class that the enum constant belong to. + * @param enumConstantsTree the content tree representing enum constants documentation + * @param isLastContent true if the content to be added is the last content + * @return content tree for the enum constants documentation */ - public void writeFooter(ClassDoc classDoc); + public Content getEnumConstants(Content enumConstantsTree, boolean isLastContent); /** * Close the writer. diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java index 401eb30a343..c17ac269b32 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,67 +36,80 @@ import com.sun.javadoc.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public interface FieldWriter { /** - * Write the header for the field documentation. + * Get the field details tree header. * - * @param classDoc the class that the fields belong to. - * @param header the header to write. + * @param classDoc the class being documented + * @param memberDetailsTree the content tree representing member details + * @return content tree for the field details header */ - public void writeHeader(ClassDoc classDoc, String header); + public Content getFieldDetailsTreeHeader(ClassDoc classDoc, + Content memberDetailsTree); /** - * Write the field header for the given field. + * Get the field documentation tree header. * - * @param field the field being documented. - * @param isFirst the flag to indicate whether or not the field is the - * first to be documented. + * @param field the constructor being documented + * @param fieldDetailsTree the content tree representing field details + * @return content tree for the field documentation header */ - public void writeFieldHeader(FieldDoc field, boolean isFirst); + public Content getFieldDocTreeHeader(FieldDoc field, + Content fieldDetailsTree); /** - * Write the signature for the given field. + * Get the signature for the given field. * - * @param field the field being documented. + * @param field the field being documented + * @return content tree for the field signature */ - public void writeSignature(FieldDoc field); + public Content getSignature(FieldDoc field); /** - * Write the deprecated output for the given field. + * Add the deprecated output for the given field. * - * @param field the field being documented. + * @param field the field being documented + * @param fieldDocTree content tree to which the deprecated information will be added */ - public void writeDeprecated(FieldDoc field); + public void addDeprecated(FieldDoc field, Content fieldDocTree); /** - * Write the comments for the given field. + * Add the comments for the given field. * - * @param field the field being documented. + * @param field the field being documented + * @param fieldDocTree the content tree to which the comments will be added */ - public void writeComments(FieldDoc field); + public void addComments(FieldDoc field, Content fieldDocTree); /** - * Write the tag output for the given field. + * Add the tags for the given field. * - * @param field the field being documented. + * @param field the field being documented + * @param fieldDocTree the content tree to which the tags will be added */ - public void writeTags(FieldDoc field); + public void addTags(FieldDoc field, Content fieldDocTree); /** - * Write the field footer. + * Get the field details tree. + * + * @param memberDetailsTree the content tree representing member details + * @return content tree for the field details */ - public void writeFieldFooter(); + public Content getFieldDetails(Content memberDetailsTree); /** - * Write the footer for the field documentation. + * Get the field documentation. * - * @param classDoc the class that the fields belong to. + * @param fieldDocTree the content tree representing field documentation + * @param isLastContent true if the content to be added is the last content + * @return content tree for the field documentation */ - public void writeFooter(ClassDoc classDoc); + public Content getFieldDoc(Content fieldDocTree, boolean isLastContent); /** * Close the writer. diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java index 64a87a0fab2..76baf59a1cd 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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.tools.doclets.internal.toolkit; import java.io.*; +import java.util.*; import com.sun.javadoc.*; /** @@ -36,61 +37,77 @@ import com.sun.javadoc.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public interface MemberSummaryWriter { /** - * Write the member summary header for the given class. + * Get the member summary header for the given class. * - * @param classDoc the class the summary belongs to. + * @param classDoc the class the summary belongs to + * @param memberSummaryTree the content tree to which the member summary will be added + * @return a content tree for the member summary header */ - public void writeMemberSummaryHeader(ClassDoc classDoc); + public Content getMemberSummaryHeader(ClassDoc classDoc, + Content memberSummaryTree); /** - * Write the member summary for the given class and member. + * Get the summary table for the given class. * - * @param classDoc the class the summary belongs to. - * @param member the member that I am summarizing. - * @param firstSentenceTags the tags for the sentence being documented. - * @param isFirst true if this is the first member in the list. - * @param isLast true if this the last member being documented. + * @param classDoc the class the summary table belongs to + * @return a content tree for the member summary table */ - public void writeMemberSummary(ClassDoc classDoc, ProgramElementDoc member, - Tag[] firstSentenceTags, boolean isFirst, boolean isLast); + public Content getSummaryTableTree(ClassDoc classDoc); /** - * Write the member summary footer for the given class. + * Add the member summary for the given class and member. * - * @param classDoc the class the summary belongs to. + * @param classDoc the class the summary belongs to + * @param member the member that is documented + * @param firstSentenceTags the tags for the sentence being documented + * @param tableTree the content treeto which the information will be added + * @param counter the counter for determing style for the table row */ - public void writeMemberSummaryFooter(ClassDoc classDoc); + public void addMemberSummary(ClassDoc classDoc, ProgramElementDoc member, + Tag[] firstSentenceTags, Content tableTree, int counter); /** - * Write the inherited member summary header for the given class. + * Get the inherited member summary header for the given class. * - * @param classDoc the class the summary belongs to. + * @param classDoc the class the summary belongs to + * @return a content tree containing the inherited summary header */ - public void writeInheritedMemberSummaryHeader(ClassDoc classDoc); + public Content getInheritedSummaryHeader(ClassDoc classDoc); /** - * Write the inherited member summary for the given class and member. + * Add the inherited member summary for the given class and member. * - * @param classDoc the class the inherited member belongs to. - * @param member the inherited member that I am summarizing. - * @param isFirst true if this is the first member in the list. - * @param isLast true if this is the last member in the list. + * @param classDoc the class the inherited member belongs to + * @param member the inherited member that is being documented + * @param isFirst true if this is the first member in the list + * @param isLast true if this is the last member in the list + * @param linksTree the content tree to which the links will be added */ - public void writeInheritedMemberSummary(ClassDoc classDoc, - ProgramElementDoc member, boolean isFirst, boolean isLast); + public void addInheritedMemberSummary(ClassDoc classDoc, + ProgramElementDoc member, boolean isFirst, boolean isLast, + Content linksTree); /** - * Write the inherited member summary footer for the given class. + * Get inherited summary links. * - * @param classDoc the class the summary belongs to. + * @return a content tree conatining the inherited summary links */ - public void writeInheritedMemberSummaryFooter(ClassDoc classDoc); + public Content getInheritedSummaryLinksTree(); + + /** + * Get the member tree. + * + * @param memberTree the content tree representating the member + * @return a content tree for the member + */ + public Content getMemberTree(Content memberTree); /** * Close the writer. diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java index e9d2083912d..1864bf94364 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,68 +36,81 @@ import com.sun.javadoc.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public interface MethodWriter { /** - * Write the header for the method documentation. + * Get the method details tree header. * - * @param classDoc the class that the methods belong to. - * @param header the header to write. + * @param classDoc the class being documented + * @param memberDetailsTree the content tree representing member details + * @return content tree for the method details header */ - public void writeHeader(ClassDoc classDoc, String header); + public Content getMethodDetailsTreeHeader(ClassDoc classDoc, + Content memberDetailsTree); /** - * Write the method header for the given method. + * Get the method documentation tree header. * - * @param method the method being documented. - * @param isFirst the flag to indicate whether or not the method is the - * first to be documented. + * @param method the method being documented + * @param methodDetailsTree the content tree representing method details + * @return content tree for the method documentation header */ - public void writeMethodHeader(MethodDoc method, boolean isFirst); + public Content getMethodDocTreeHeader(MethodDoc method, + Content methodDetailsTree); /** - * Write the signature for the given method. + * Get the signature for the given method. * - * @param method the method being documented. + * @param method the method being documented + * @return content tree for the method signature */ - public void writeSignature(MethodDoc method); + public Content getSignature(MethodDoc method); /** - * Write the deprecated output for the given method. + * Add the deprecated output for the given method. * - * @param method the method being documented. + * @param method the method being documented + * @param methodDocTree content tree to which the deprecated information will be added */ - public void writeDeprecated(MethodDoc method); + public void addDeprecated(MethodDoc method, Content methodDocTree); /** - * Write the comments for the given method. + * Add the comments for the given method. * - * @param holder the holder type (not erasure) of the method. - * @param method the method being documented. + * @param holder the holder type (not erasure) of the method + * @param method the method being documented + * @param methodDocTree the content tree to which the comments will be added */ - public void writeComments(Type holder, MethodDoc method); + public void addComments(Type holder, MethodDoc method, Content methodDocTree); /** - * Write the tag output for the given method. + * Add the tags for the given method. * - * @param method the method being documented. + * @param method the method being documented + * @param methodDocTree the content tree to which the tags will be added */ - public void writeTags(MethodDoc method); + public void addTags(MethodDoc method, Content methodDocTree); /** - * Write the method footer. + * Get the method details tree. + * + * @param methodDetailsTree the content tree representing method details + * @return content tree for the method details */ - public void writeMethodFooter(); + public Content getMethodDetails(Content methodDetailsTree); /** - * Write the footer for the method documentation. + * Get the method documentation. * - * @param classDoc the class that the methods belong to. + * @param methodDocTree the content tree representing method documentation + * @param isLastContent true if the content to be added is the last content + * @return content tree for the method documentation */ - public void writeFooter(ClassDoc classDoc); + public Content getMethodDoc(Content methodDocTree, boolean isLastContent); /** * Close the writer. diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java index f11144ad611..a5a023a3f8e 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ package com.sun.tools.doclets.internal.toolkit; import java.io.*; -import com.sun.javadoc.*; /** * The interface for writing class output. @@ -36,58 +35,12 @@ import com.sun.javadoc.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public interface NestedClassWriter { - /** - * Write the classes summary header for the given class. - * - * @param nestedClass the class the summary belongs to. - */ - public void writeNestedClassSummaryHeader(ClassDoc nestedClass); - - /** - * Write the class summary for the given class and class. - * - * @param classDoc the class the summary belongs to. - * @param nestedClass the nested class that I am summarizing. - */ - public void writeNestedClassSummary(ClassDoc classDoc, ClassDoc nestedClass); - - /** - * Write the classes summary footer for the given class. - * - * @param nestedClass the class the summary belongs to. - */ - public void writeNestedClassSummaryFooter(ClassDoc nestedClass); - - /** - * Write the inherited classes summary header for the given class. - * - * @param nestedClass the class the summary belongs to. - */ - public void writeInheritedNestedClassSummaryHeader(ClassDoc nestedClass); - - /** - * Write the inherited nested class summary for the given class and nested - * class. - * - * @param classDoc the class the inherited nested class belongs to. - * @param nestedClass the inherited nested class that I am summarizing. - * @param isFirst true if this is the first member in the list. - */ - public void writeInheritedNestedClassSummary(ClassDoc classDoc, - ClassDoc nestedClass, boolean isFirst); - - /** - * Write the inherited classes summary footer for the given class. - * - * @param nestedClass the class the summary belongs to. - */ - public void writeInheritedNestedClassSummaryFooter(ClassDoc nestedClass); - /** * Close the writer. */ diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java index 5ffe7b9928e..eb8bf7be0d0 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,6 +36,7 @@ import java.io.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ @@ -49,45 +50,70 @@ public interface PackageSummaryWriter { public abstract String getOutputFileName(); /** - * Write the header for the package summary. + * Get the header for the summary. + * + * @param heading Package name. + * @return the header to be added to the content tree */ - public abstract void writeSummaryHeader(); + public abstract Content getPackageHeader(String heading); /** - * Write the footer for the package summary. + * Get the header for the package content. + * + * @return a content tree for the package content header */ - public abstract void writeSummaryFooter(); + public abstract Content getContentHeader(); /** - * Write the table of classes in this package. + * Get the header for the package summary. + * + * @return a content tree with the package summary header + */ + public abstract Content getSummaryHeader(); + + /** + * Adds the table of classes to the documentation tree. * * @param classes the array of classes to document. * @param label the label for this table. + * @param tableSummary the summary string for the table + * @param tableHeader array of table headers + * @param summaryContentTree the content tree to which the summaries will be added */ - public abstract void writeClassesSummary(ClassDoc[] classes, String label, String tableSummary, String[] tableHeader); + public abstract void addClassesSummary(ClassDoc[] classes, String label, + String tableSummary, String[] tableHeader, Content summaryContentTree); /** - * Write the header for the summary. + * Adds the package description from the "packages.html" file to the documentation + * tree. * - * @param heading Package name. + * @param packageContentTree the content tree to which the package description + * will be added */ - public abstract void writePackageHeader(String heading); + public abstract void addPackageDescription(Content packageContentTree); /** - * Print the package description from the "packages.html" file. - */ - public abstract void writePackageDescription(); - - /** - * Print the tag information from the "packages.html" file. - */ - public abstract void writePackageTags(); - - /** - * Write the footer for the summary. + * Adds the tag information from the "packages.html" file to the documentation + * tree. * + * @param packageContentTree the content tree to which the package tags will + * be added */ - public abstract void writePackageFooter(); + public abstract void addPackageTags(Content packageContentTree); + + /** + * Adds the footer to the documentation tree. + * + * @param contentTree the tree to which the footer will be added + */ + public abstract void addPackageFooter(Content contentTree); + + /** + * Print the package summary document. + * + * @param contentTree the content tree that will be printed + */ + public abstract void printDocument(Content contentTree); /** * Close the writer. diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java index dc19a9bf95a..84454acdf24 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,33 +43,73 @@ import com.sun.javadoc.*; public interface SerializedFormWriter { /** - * Write the given header. + * Get the header. * * @param header the header to write. + * @return the header content tree */ - public void writeHeader(String header); + public Content getHeader(String header); /** - * Write the given package header. + * Get the serialized form summaries header. * - * @param packageName the package header to write. + * @return the serialized form summary header tree */ - public void writePackageHeader(String packageName); + public Content getSerializedSummariesHeader(); /** - * Write the heading for the serializable class. + * Get the package serialized form header. * - * @param classDoc the class being processed. + * @return the package serialized form header tree */ - public void writeClassHeader(ClassDoc classDoc); + public Content getPackageSerializedHeader(); /** - * Write the serial UID info. + * Get the given package header. + * + * @param packageName the package header to write + * @return a content tree for the package header + */ + public Content getPackageHeader(String packageName); + + /** + * Get the serialized class header. + * + * @return a content tree for the serialized class header + */ + public Content getClassSerializedHeader(); + + /** + * Get the heading for the serializable class. + * + * @param classDoc the class being processed + * @return a content tree for the class heading + */ + public Content getClassHeader(ClassDoc classDoc); + + /** + * Get the serial UID info header. + * + * @return a content tree for the serial uid info header + */ + public Content getSerialUIDInfoHeader(); + + /** + * Adds the serial UID info. * * @param header the header that will show up before the UID. * @param serialUID the serial UID to print. + * @param serialUidTree the serial UID tree to which the content will be added. */ - public void writeSerialUIDInfo(String header, String serialUID); + public void addSerialUIDInfo(String header, String serialUID, + Content serialUidTree); + + /** + * Get the class serialize content header. + * + * @return a content tree for the class serialize content header + */ + public Content getClassContentHeader(); /** * Return an instance of a SerialFieldWriter. @@ -91,9 +131,26 @@ public interface SerializedFormWriter { public abstract void close() throws IOException; /** - * Write the footer. + * Get the serialized content. + * + * @param serializedTreeContent content for serialized data + * @return a content tree for serialized information */ - public void writeFooter(); + public Content getSerializedContent(Content serializedTreeContent); + + /** + * Add the footer. + * + * @param serializedTree the serialized tree to be added + */ + public void addFooter(Content serializedTree); + + /** + * Print the serialized form document. + * + * @param serializedTree the content tree that will be printed + */ + public abstract void printDocument(Content serializedTree); /** * Write the serialized form for a given field. @@ -101,56 +158,73 @@ public interface SerializedFormWriter { public interface SerialFieldWriter { /** - * Write the given heading. + * Get the serializable field header. + * + * @return serialized fields header content tree + */ + public Content getSerializableFieldsHeader(); + + /** + * Get the field content header. + * + * @param isLastContent true if this is the last content to be documented + * @return fields header content tree + */ + public Content getFieldsContentHeader(boolean isLastContent); + + /** + * Get the fields content. * * @param heading the heading to write. + * @param contentTree content tree to which the heading will be added + * @return serializable fields content tree */ - public void writeHeader(String heading); + public Content getSerializableFields(String heading, Content contentTree); /** - * Write the deprecated information for this member. + * Adds the deprecated information for this member. * * @param field the field to document. + * @param contentTree content tree to which the deprecated information will be added */ - public void writeMemberDeprecatedInfo(FieldDoc field); + public void addMemberDeprecatedInfo(FieldDoc field, Content contentTree); /** - * Write the description text for this member. + * Adds the description text for this member. * * @param field the field to document. + * @param contentTree content tree to which the member description will be added */ - public void writeMemberDescription(FieldDoc field); + public void addMemberDescription(FieldDoc field, Content contentTree); /** - * Write the description text for this member represented by the tag. + * Adds the description text for this member represented by the tag. * * @param serialFieldTag the field to document (represented by tag). + * @param contentTree content tree to which the member description will be added */ - public void writeMemberDescription(SerialFieldTag serialFieldTag); + public void addMemberDescription(SerialFieldTag serialFieldTag, Content contentTree); /** - * Write the tag information for this member. + * Adds the tag information for this member. * * @param field the field to document. + * @param contentTree content tree to which the member tags will be added */ - public void writeMemberTags(FieldDoc field); + public void addMemberTags(FieldDoc field, Content contentTree); /** - * Write the member header. + * Adds the member header. * * @param fieldType the type of the field. * @param fieldTypeStr the type of the field in string format. We will * print this out if we can't link to the type. * @param fieldDimensions the dimensions of the field. * @param fieldName the name of the field. + * @param contentTree content tree to which the member header will be added */ - public void writeMemberHeader(ClassDoc fieldType, String fieldTypeStr, - String fieldDimensions, String fieldName); - - /** - * Write the member footer. - */ - public void writeMemberFooter(); + public void addMemberHeader(ClassDoc fieldType, String fieldTypeStr, + String fieldDimensions, String fieldName, Content contentTree); /** * Check to see if overview details should be printed. If @@ -162,13 +236,6 @@ public interface SerializedFormWriter { * @return true if overview details need to be printed */ public boolean shouldPrintOverview(FieldDoc field); - - /** - * Write the footer. - * - * @param heading the heading that was written. - */ - public void writeFooter (String heading); } /** @@ -176,45 +243,71 @@ public interface SerializedFormWriter { */ public interface SerialMethodWriter { + /** + * Get the serializable method header. + * + * @return serializable methods content tree + */ + public Content getSerializableMethodsHeader(); + + /** + * Get the method content header. + * + * @param isLastContent true if this is the last content to be documented + * @return methods content tree + */ + public Content getMethodsContentHeader(boolean isLastContent); + /** * Write the given heading. * - * @param heading the heading to write. + * @param heading the heading to write + * @param serializableMethodTree content tree which will be added + * @return serializable methods content tree */ - public void writeHeader(String heading); + public Content getSerializableMethods(String heading, Content serializableMethodTree); /** * Write a warning that no serializable methods exist. * - * @param msg the warning to print. + * @param msg the warning to print + * @return no customization message tree */ - public void writeNoCustomizationMsg(String msg); + public Content getNoCustomizationMsg(String msg); /** - * Write the header. + * Adds the header. * - * @param member the member to write the header for. + * @param member the member to write the header for + * @param methodsContentTree content tree to which the header will be added */ - public void writeMemberHeader(MethodDoc member); + public void addMemberHeader(MethodDoc member, Content methodsContentTree); /** - * Write the footer. + * Adds the deprecated information for this member. + * + * @param member the member to write the deprecated information for + * @param methodsContentTree content tree to which the deprecated + * information will be added */ - public void writeMemberFooter(); + public void addDeprecatedMemberInfo(MethodDoc member, Content methodsContentTree); /** - * Write the deprecated information for this member. + * Adds the description for this member. + * + * @param member the member to write the information for + * @param methodsContentTree content tree to which the member + * information will be added */ - public void writeDeprecatedMemberInfo(MethodDoc member); + public void addMemberDescription(MethodDoc member, Content methodsContentTree); /** - * Write the description for this member. + * Adds the tag information for this member. + * + * @param member the member to write the tags information for + * @param methodsContentTree content tree to which the tags + * information will be added */ - public void writeMemberDescription(MethodDoc member); - - /** - * Write the tag information for this member. - */ - public void writeMemberTags(MethodDoc member); + public void addMemberTags(MethodDoc member, Content methodsContentTree); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java index 4145af7cb90..c016775a546 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,13 +95,14 @@ public abstract class AbstractBuilder { * Build the documentation, as specified by the given XML element. * * @param node the XML element that specifies which component to document. + * @param contentTree content tree to which the documentation will be added */ - protected void build(XMLNode node) { + protected void build(XMLNode node, Content contentTree) { String component = node.name; try { invokeMethod("build" + component, - new Class[] { XMLNode.class }, - new Object[] { node }); + new Class[]{XMLNode.class, Content.class}, + new Object[]{node, contentTree}); } catch (NoSuchMethodException e) { e.printStackTrace(); configuration.root.printError("Unknown element: " + component); @@ -111,8 +112,8 @@ public abstract class AbstractBuilder { } catch (Exception e) { e.printStackTrace(); configuration.root.printError("Exception " + - e.getClass().getName() + - " thrown while processing element: " + component); + e.getClass().getName() + + " thrown while processing element: " + component); throw new DocletAbortException(); } } @@ -121,10 +122,11 @@ public abstract class AbstractBuilder { * Build the documentation, as specified by the children of the given XML element. * * @param node the XML element that specifies which components to document. + * @param contentTree content tree to which the documentation will be added */ - protected void buildChildren(XMLNode node) { - for (XMLNode child: node.children) - build(child); + protected void buildChildren(XMLNode node, Content contentTree) { + for (XMLNode child : node.children) + build(child, contentTree); } /** @@ -140,8 +142,7 @@ public abstract class AbstractBuilder { Object[] params) throws Exception { if (DEBUG) { - configuration.root.printError("DEBUG: " + this.getClass().getName() - + "." + methodName); + configuration.root.printError("DEBUG: " + this.getClass().getName() + "." + methodName); } Method method = this.getClass().getMethod(methodName, paramClasses); method.invoke(this, params); diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java index f91fbd62cc9..6a4be60532a 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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 com.sun.tools.doclets.internal.toolkit.builders; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.tools.doclets.internal.toolkit.util.*; +import java.util.*; /** * The superclass for all member builders. Member builders are only executed @@ -66,12 +67,13 @@ public abstract class AbstractMemberBuilder extends AbstractBuilder { /** * Build the sub component if there is anything to document. * - * @param elements {@inheritDoc} + * @param node the XML element that specifies which components to document. + * @param contentTree content tree to which the documentation will be added */ @Override - public void build(XMLNode node) { + public void build(XMLNode node, Content contentTree) { if (hasMembersToDocument()) { - super.build(node); + super.build(node, contentTree); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java index 8df119853c8..a92ea569bcd 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +25,11 @@ package com.sun.tools.doclets.internal.toolkit.builders; +import java.io.*; +import java.util.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.javadoc.*; -import java.io.*; -import java.util.*; /** * Builds the summary for a given annotation type. @@ -39,6 +39,7 @@ import java.util.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public class AnnotationTypeBuilder extends AbstractBuilder { @@ -58,6 +59,11 @@ public class AnnotationTypeBuilder extends AbstractBuilder { */ private AnnotationTypeWriter writer; + /** + * The content tree for the annotation documentation. + */ + private Content contentTree; + /** * Construct a new ClassBuilder. * @@ -92,7 +98,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder { * {@inheritDoc} */ public void build() throws IOException { - build(LayoutParser.getInstance(configuration).parseXML(ROOT)); + build(LayoutParser.getInstance(configuration).parseXML(ROOT), contentTree); } /** @@ -102,18 +108,24 @@ public class AnnotationTypeBuilder extends AbstractBuilder { return ROOT; } - /** - * Handles the <AnnotationTypeDoc> tag. + /** + * Build the annotation type documentation. * - * @param elements the XML elements that specify how to document a class. + * @param node the XML element that specifies which components to document + * @param contentTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeDoc(XMLNode node) throws Exception { - buildChildren(node); - writer.close(); - copyDocFiles(); + public void buildAnnotationTypeDoc(XMLNode node, Content contentTree) throws Exception { + contentTree = writer.getHeader(configuration.getText("doclet.AnnotationType") + + " " + annotationTypeDoc.name()); + Content annotationContentTree = writer.getAnnotationContentHeader(); + buildChildren(node, annotationContentTree); + contentTree.addContent(annotationContentTree); + writer.addFooter(contentTree); + writer.printDocument(contentTree); + writer.close(); + copyDocFiles(); } - /** * Copy the doc files for the current ClassDoc if necessary. */ @@ -137,86 +149,112 @@ public class AnnotationTypeBuilder extends AbstractBuilder { } /** - * Build the header of the page. + * Build the annotation information tree documentation. + * + * @param node the XML element that specifies which components to document + * @param annotationContentTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeHeader(XMLNode node) { - writer.writeHeader(configuration.getText("doclet.AnnotationType") + - " " + annotationTypeDoc.name()); + public void buildAnnotationTypeInfo(XMLNode node, Content annotationContentTree) { + Content annotationInfoTree = writer.getAnnotationInfoTreeHeader(); + buildChildren(node, annotationInfoTree); + annotationContentTree.addContent(writer.getAnnotationInfo(annotationInfoTree)); } /** - * If this class is deprecated, print the appropriate information. + * If this annotation is deprecated, build the appropriate information. + * + * @param node the XML element that specifies which components to document + * @param annotationInfoTree the content tree to which the documentation will be added */ - public void buildDeprecationInfo (XMLNode node) { - writer.writeAnnotationTypeDeprecationInfo(); + public void buildDeprecationInfo (XMLNode node, Content annotationInfoTree) { + writer.addAnnotationTypeDeprecationInfo(annotationInfoTree); } /** * Build the signature of the current annotation type. - */ - public void buildAnnotationTypeSignature(XMLNode node) { - StringBuffer modifiers = new StringBuffer( - annotationTypeDoc.modifiers() + " "); - writer.writeAnnotationTypeSignature( - Util.replaceText( - modifiers.toString(), "interface", "@interface")); - } - - /** - * Build the class description. - */ - public void buildAnnotationTypeDescription(XMLNode node) { - writer.writeAnnotationTypeDescription(); - } - - /** - * Build the tag information for the current class. - */ - public void buildAnnotationTypeTagInfo(XMLNode node) { - writer.writeAnnotationTypeTagInfo(); - } - - /** - * Build the contents of the page. * - * @param elements the XML elements that specify how a member summary is - * documented. + * @param node the XML element that specifies which components to document + * @param annotationInfoTree the content tree to which the documentation will be added */ - public void buildMemberSummary(XMLNode node) throws Exception { + public void buildAnnotationTypeSignature(XMLNode node, Content annotationInfoTree) { + StringBuffer modifiers = new StringBuffer( + annotationTypeDoc.modifiers() + " "); + writer.addAnnotationTypeSignature(Util.replaceText( + modifiers.toString(), "interface", "@interface"), annotationInfoTree); + } + + /** + * Build the annotation type description. + * + * @param node the XML element that specifies which components to document + * @param annotationInfoTree the content tree to which the documentation will be added + */ + public void buildAnnotationTypeDescription(XMLNode node, Content annotationInfoTree) { + writer.addAnnotationTypeDescription(annotationInfoTree); + } + + /** + * Build the tag information for the current annotation type. + * + * @param node the XML element that specifies which components to document + * @param annotationInfoTree the content tree to which the documentation will be added + */ + public void buildAnnotationTypeTagInfo(XMLNode node, Content annotationInfoTree) { + writer.addAnnotationTypeTagInfo(annotationInfoTree); + } + + /** + * Build the member summary contents of the page. + * + * @param node the XML element that specifies which components to document + * @param annotationContentTree the content tree to which the documentation will be added + */ + public void buildMemberSummary(XMLNode node, Content annotationContentTree) + throws Exception { + Content memberSummaryTree = writer.getMemberTreeHeader(); configuration.getBuilderFactory(). - getMemberSummaryBuilder(writer).buildChildren(node); - writer.completeMemberSummaryBuild(); + getMemberSummaryBuilder(writer).buildChildren(node, memberSummaryTree); + annotationContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree)); + } + + /** + * Build the member details contents of the page. + * + * @param node the XML element that specifies which components to document + * @param annotationContentTree the content tree to which the documentation will be added + */ + public void buildAnnotationTypeMemberDetails(XMLNode node, Content annotationContentTree) { + Content memberDetailsTree = writer.getMemberTreeHeader(); + buildChildren(node, memberDetailsTree); + if (memberDetailsTree.isValid()) { + Content memberDetails = writer.getMemberTreeHeader(); + writer.addAnnotationDetailsMarker(memberDetails); + memberDetails.addContent(writer.getMemberTree(memberDetailsTree)); + annotationContentTree.addContent(writer.getMemberDetailsTree(memberDetails)); + } } /** * Build the annotation type optional member documentation. * - * @param elements the XML elements that specify how a annotation type - * members are documented. + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeOptionalMemberDetails(XMLNode node) - throws Exception { + public void buildAnnotationTypeOptionalMemberDetails(XMLNode node, Content memberDetailsTree) + throws Exception { configuration.getBuilderFactory(). - getAnnotationTypeOptionalMemberBuilder(writer).buildChildren(node); + getAnnotationTypeOptionalMemberBuilder(writer).buildChildren(node, memberDetailsTree); } /** * Build the annotation type required member documentation. * - * @param elements the XML elements that specify how a annotation type - * members are documented. + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeRequiredMemberDetails(XMLNode node) - throws Exception { + public void buildAnnotationTypeRequiredMemberDetails(XMLNode node, Content memberDetailsTree) + throws Exception { configuration.getBuilderFactory(). - getAnnotationTypeRequiredMemberBuilder(writer).buildChildren(node); - } - - - /** - * Build the footer of the page. - */ - public void buildAnnotationTypeFooter(XMLNode node) { - writer.writeFooter(); + getAnnotationTypeRequiredMemberBuilder(writer).buildChildren(node, memberDetailsTree); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java index 632f26a7ce1..b0abbc305dd 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +25,10 @@ package com.sun.tools.doclets.internal.toolkit.builders; - +import java.util.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.javadoc.*; -import java.util.*; /** * Builds documentation for optional annotation type members. @@ -39,6 +38,7 @@ import java.util.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public class AnnotationTypeOptionalMemberBuilder extends @@ -90,27 +90,25 @@ public class AnnotationTypeOptionalMemberBuilder extends } /** - * Build the member documentation. + * Build the annotation type optional member documentation. * - * @param elements the XML elements that specify how to construct this - * documentation. + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeOptionalMember(XMLNode node) { - if (writer == null) { - return; - } - for (currentMemberIndex = 0; currentMemberIndex < members.size(); - currentMemberIndex++) { - buildChildren(node); - } + public void buildAnnotationTypeOptionalMember(XMLNode node, Content memberDetailsTree) { + buildAnnotationTypeMember(node, memberDetailsTree); } /** - * Document the default value for this optional member. + * Build the default value for this optional member. + * + * @param node the XML element that specifies which components to document + * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildDefaultValueInfo(XMLNode node) { - ((AnnotationTypeOptionalMemberWriter) writer).writeDefaultValueInfo( - (MemberDoc) members.get(currentMemberIndex)); + public void buildDefaultValueInfo(XMLNode node, Content annotationDocTree) { + ((AnnotationTypeOptionalMemberWriter) writer).addDefaultValueInfo( + (MemberDoc) members.get(currentMemberIndex), + annotationDocTree); } /** diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java index f278e696b98..ec9c4f2a961 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +25,10 @@ package com.sun.tools.doclets.internal.toolkit.builders; - +import java.util.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.javadoc.*; -import java.util.*; /** * Builds documentation for required annotation type members. @@ -39,6 +38,7 @@ import java.util.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { @@ -140,82 +140,87 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { return members.size() > 0; } + /** + * Build the annotation type required member documentation. + * + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added + */ + public void buildAnnotationTypeRequiredMember(XMLNode node, Content memberDetailsTree) { + buildAnnotationTypeMember(node, memberDetailsTree); + } + /** * Build the member documentation. * - * @param elements the XML elements that specify how to construct this - * documentation. + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeRequiredMember(XMLNode node) { + public void buildAnnotationTypeMember(XMLNode node, Content memberDetailsTree) { if (writer == null) { return; } - for (currentMemberIndex = 0; currentMemberIndex < members.size(); + int size = members.size(); + if (size > 0) { + writer.addAnnotationDetailsTreeHeader( + classDoc, memberDetailsTree); + for (currentMemberIndex = 0; currentMemberIndex < size; currentMemberIndex++) { - buildChildren(node); + Content annotationDocTree = writer.getAnnotationDocTreeHeader( + (MemberDoc) members.get(currentMemberIndex), + memberDetailsTree); + buildChildren(node, annotationDocTree); + memberDetailsTree.addContent(writer.getAnnotationDoc( + annotationDocTree, (currentMemberIndex == size - 1))); + } } } - /** - * Build the overall header. - */ - public void buildHeader(XMLNode node) { - writer.writeHeader(classDoc, - configuration.getText("doclet.Annotation_Type_Member_Detail")); - } - - /** - * Build the header for the individual members. - */ - public void buildMemberHeader(XMLNode node) { - writer.writeMemberHeader((MemberDoc) members.get( - currentMemberIndex), - currentMemberIndex == 0); - } - /** * Build the signature. + * + * @param node the XML element that specifies which components to document + * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildSignature(XMLNode node) { - writer.writeSignature((MemberDoc) members.get(currentMemberIndex)); + public void buildSignature(XMLNode node, Content annotationDocTree) { + annotationDocTree.addContent( + writer.getSignature((MemberDoc) members.get(currentMemberIndex))); } /** * Build the deprecation information. + * + * @param node the XML element that specifies which components to document + * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildDeprecationInfo(XMLNode node) { - writer.writeDeprecated((MemberDoc) members.get(currentMemberIndex)); + public void buildDeprecationInfo(XMLNode node, Content annotationDocTree) { + writer.addDeprecated((MemberDoc) members.get(currentMemberIndex), + annotationDocTree); } /** * Build the comments for the member. Do nothing if * {@link Configuration#nocomment} is set to true. + * + * @param node the XML element that specifies which components to document + * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildMemberComments(XMLNode node) { + public void buildMemberComments(XMLNode node, Content annotationDocTree) { if(! configuration.nocomment){ - writer.writeComments((MemberDoc) members.get(currentMemberIndex)); + writer.addComments((MemberDoc) members.get(currentMemberIndex), + annotationDocTree); } } /** * Build the tag information. + * + * @param node the XML element that specifies which components to document + * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildTagInfo(XMLNode node) { - writer.writeTags((MemberDoc) members.get(currentMemberIndex)); - } - - /** - * Build the footer for the individual member. - */ - public void buildMemberFooter(XMLNode node) { - writer.writeMemberFooter(); - } - - /** - * Build the overall footer. - */ - public void buildFooter(XMLNode node) { - writer.writeFooter(classDoc); + public void buildTagInfo(XMLNode node, Content annotationDocTree) { + writer.addTags((MemberDoc) members.get(currentMemberIndex), + annotationDocTree); } /** diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java index 15a5341d8d1..e0c8d7b1b21 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +25,11 @@ package com.sun.tools.doclets.internal.toolkit.builders; +import java.io.*; +import java.util.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.javadoc.*; -import java.io.*; -import java.util.*; /** * Builds the summary for a given class. @@ -39,6 +39,7 @@ import java.util.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public class ClassBuilder extends AbstractBuilder { @@ -68,6 +69,11 @@ public class ClassBuilder extends AbstractBuilder { */ private boolean isEnum = false; + /** + * The content tree for the class documentation. + */ + private Content contentTree; + /** * Construct a new ClassBuilder. * @@ -108,7 +114,7 @@ public class ClassBuilder extends AbstractBuilder { * {@inheritDoc} */ public void build() throws IOException { - build(LayoutParser.getInstance(configuration).parseXML(ROOT)); + build(LayoutParser.getInstance(configuration).parseXML(ROOT), contentTree); } /** @@ -121,121 +127,159 @@ public class ClassBuilder extends AbstractBuilder { /** * Handles the <ClassDoc> tag. * - * @param elements the XML elements that specify how to document a class. + * @param node the XML element that specifies which components to document + * @param contentTree the content tree to which the documentation will be added */ - public void buildClassDoc(XMLNode node) throws Exception { - buildChildren(node); - writer.close(); - copyDocFiles(); + public void buildClassDoc(XMLNode node, Content contentTree) throws Exception { + String key; + if (isInterface) { + key = "doclet.Interface"; + } else if (isEnum) { + key = "doclet.Enum"; + } else { + key = "doclet.Class"; + } + contentTree = writer.getHeader(configuration.getText(key) + " " + + classDoc.name()); + Content classContentTree = writer.getClassContentHeader(); + buildChildren(node, classContentTree); + contentTree.addContent(classContentTree); + writer.addFooter(contentTree); + writer.printDocument(contentTree); + writer.close(); + copyDocFiles(); } - /** - * Copy the doc files for the current ClassDoc if necessary. + * Build the class tree documentation. + * + * @param node the XML element that specifies which components to document + * @param classContentTree the content tree to which the documentation will be added */ + public void buildClassTree(XMLNode node, Content classContentTree) { + writer.addClassTree(classContentTree); + } + + /** + * Build the class information tree documentation. + * + * @param node the XML element that specifies which components to document + * @param classContentTree the content tree to which the documentation will be added + */ + public void buildClassInfo(XMLNode node, Content classContentTree) { + Content classInfoTree = writer.getClassInfoTreeHeader(); + buildChildren(node, classInfoTree); + classContentTree.addContent(writer.getClassInfo(classInfoTree)); + } + + /** + * Build the typeparameters of this class. + * + * @param node the XML element that specifies which components to document + * @param classInfoTree the content tree to which the documentation will be added + */ + public void buildTypeParamInfo(XMLNode node, Content classInfoTree) { + writer.addTypeParamInfo(classInfoTree); + } + + /** + * If this is an interface, list all super interfaces. + * + * @param node the XML element that specifies which components to document + * @param classInfoTree the content tree to which the documentation will be added + */ + public void buildSuperInterfacesInfo(XMLNode node, Content classInfoTree) { + writer.addSuperInterfacesInfo(classInfoTree); + } + + /** + * If this is a class, list all interfaces implemented by this class. + * + * @param node the XML element that specifies which components to document + * @param classInfoTree the content tree to which the documentation will be added + */ + public void buildImplementedInterfacesInfo(XMLNode node, Content classInfoTree) { + writer.addImplementedInterfacesInfo(classInfoTree); + } + + /** + * List all the classes extend this one. + * + * @param node the XML element that specifies which components to document + * @param classInfoTree the content tree to which the documentation will be added + */ + public void buildSubClassInfo(XMLNode node, Content classInfoTree) { + writer.addSubClassInfo(classInfoTree); + } + + /** + * List all the interfaces that extend this one. + * + * @param node the XML element that specifies which components to document + * @param classInfoTree the content tree to which the documentation will be added + */ + public void buildSubInterfacesInfo(XMLNode node, Content classInfoTree) { + writer.addSubInterfacesInfo(classInfoTree); + } + + /** + * If this is an interface, list all classes that implement this interface. + * + * @param node the XML element that specifies which components to document + * @param classInfoTree the content tree to which the documentation will be added + */ + public void buildInterfaceUsageInfo(XMLNode node, Content classInfoTree) { + writer.addInterfaceUsageInfo(classInfoTree); + } + + /** + * If this class is deprecated, build the appropriate information. + * + * @param node the XML element that specifies which components to document + * @param classInfoTree the content tree to which the documentation will be added + */ + public void buildDeprecationInfo (XMLNode node, Content classInfoTree) { + writer.addClassDeprecationInfo(classInfoTree); + } + + /** + * If this is an inner class or interface, list the enclosing class or interface. + * + * @param node the XML element that specifies which components to document + * @param classInfoTree the content tree to which the documentation will be added + */ + public void buildNestedClassInfo (XMLNode node, Content classInfoTree) { + writer.addNestedClassInfo(classInfoTree); + } + + /** + * Copy the doc files for the current ClassDoc if necessary. + */ private void copyDocFiles() { PackageDoc containingPackage = classDoc.containingPackage(); if((configuration.packages == null || Arrays.binarySearch(configuration.packages, - containingPackage) < 0) && - ! containingPackagesSeen.contains(containingPackage.name())){ + containingPackage) < 0) && + ! containingPackagesSeen.contains(containingPackage.name())){ //Only copy doc files dir if the containing package is not //documented AND if we have not documented a class from the same //package already. Otherwise, we are making duplicate copies. Util.copyDocFiles(configuration, - Util.getPackageSourcePath(configuration, + Util.getPackageSourcePath(configuration, classDoc.containingPackage()) + - DirectoryManager.getDirectoryPath(classDoc.containingPackage()) + DirectoryManager.getDirectoryPath(classDoc.containingPackage()) + File.separator, DocletConstants.DOC_FILES_DIR_NAME, true); containingPackagesSeen.add(containingPackage.name()); } } - /** - * Build the header of the page. - */ - public void buildClassHeader(XMLNode node) { - String key; - if (isInterface) { - key = "doclet.Interface"; - } else if (isEnum) { - key = "doclet.Enum"; - } else { - key = "doclet.Class"; - } - - writer.writeHeader(configuration.getText(key) + " " + classDoc.name()); - } - - /** - * Build the class tree documentation. - */ - public void buildClassTree(XMLNode node) { - writer.writeClassTree(); - } - - /** - * If this is a class, list all interfaces - * implemented by this class. - */ - public void buildImplementedInterfacesInfo(XMLNode node) { - writer.writeImplementedInterfacesInfo(); - } - - /** - * If this is an interface, list all super interfaces. - */ - public void buildSuperInterfacesInfo(XMLNode node) { - writer.writeSuperInterfacesInfo(); - } - - /** - * List the parameters of this class. - */ - public void buildTypeParamInfo(XMLNode node) { - writer.writeTypeParamInfo(); - } - - /** - * List all the classes extend this one. - */ - public void buildSubClassInfo(XMLNode node) { - writer.writeSubClassInfo(); - } - - /** - * List all the interfaces that extend this one. - */ - public void buildSubInterfacesInfo(XMLNode node) { - writer.writeSubInterfacesInfo(); - } - - /** - * If this is an interface, list all classes that implement this interface. - */ - public void buildInterfaceUsageInfo (XMLNode node) { - writer.writeInterfaceUsageInfo(); - } - - /** - * If this is an inner class or interface, list the enclosing class or - * interface. - */ - public void buildNestedClassInfo (XMLNode node) { - writer.writeNestedClassInfo(); - } - - /** - * If this class is deprecated, print the appropriate information. - */ - public void buildDeprecationInfo (XMLNode node) { - writer.writeClassDeprecationInfo(); - } - /** * Build the signature of the current class. + * + * @param node the XML element that specifies which components to document + * @param classInfoTree the content tree to which the documentation will be added */ - public void buildClassSignature(XMLNode node) { + public void buildClassSignature(XMLNode node, Content classInfoTree) { StringBuffer modifiers = new StringBuffer(classDoc.modifiers() + " "); if (isEnum) { modifiers.append("enum "); @@ -243,93 +287,111 @@ public class ClassBuilder extends AbstractBuilder { if ((index = modifiers.indexOf("abstract")) >= 0) { modifiers.delete(index, index + (new String("abstract")).length()); modifiers = new StringBuffer( - Util.replaceText(modifiers.toString(), " ", " ")); + Util.replaceText(modifiers.toString(), " ", " ")); } if ((index = modifiers.indexOf("final")) >= 0) { modifiers.delete(index, index + (new String("final")).length()); modifiers = new StringBuffer( - Util.replaceText(modifiers.toString(), " ", " ")); + Util.replaceText(modifiers.toString(), " ", " ")); } //} else if (classDoc.isAnnotationType()) { //modifiers.append("@interface "); } else if (! isInterface) { modifiers.append("class "); } - writer.writeClassSignature(modifiers.toString()); + writer.addClassSignature(modifiers.toString(), classInfoTree); } /** * Build the class description. + * + * @param node the XML element that specifies which components to document + * @param classInfoTree the content tree to which the documentation will be added */ - public void buildClassDescription(XMLNode node) { - writer.writeClassDescription(); + public void buildClassDescription(XMLNode node, Content classInfoTree) { + writer.addClassDescription(classInfoTree); } /** * Build the tag information for the current class. + * + * @param node the XML element that specifies which components to document + * @param classInfoTree the content tree to which the documentation will be added */ - public void buildClassTagInfo(XMLNode node) { - writer.writeClassTagInfo(); + public void buildClassTagInfo(XMLNode node, Content classInfoTree) { + writer.addClassTagInfo(classInfoTree); } /** - * Build the contents of the page. + * Build the member summary contents of the page. * - * @param elements the XML elements that specify how a member summary is - * documented. + * @param node the XML element that specifies which components to document + * @param classContentTree the content tree to which the documentation will be added */ - public void buildMemberSummary(XMLNode node) throws Exception { + public void buildMemberSummary(XMLNode node, Content classContentTree) throws Exception { + Content memberSummaryTree = writer.getMemberTreeHeader(); configuration.getBuilderFactory(). - getMemberSummaryBuilder(writer).buildChildren(node); - writer.completeMemberSummaryBuild(); + getMemberSummaryBuilder(writer).buildChildren(node, memberSummaryTree); + classContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree)); + } + + /** + * Build the member details contents of the page. + * + * @param node the XML element that specifies which components to document + * @param classContentTree the content tree to which the documentation will be added + */ + public void buildMemberDetails(XMLNode node, Content classContentTree) { + Content memberDetailsTree = writer.getMemberTreeHeader(); + buildChildren(node, memberDetailsTree); + classContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree)); } /** * Build the enum constants documentation. * - * @param elements the XML elements that specify how a enum constants are - * documented. + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added */ - public void buildEnumConstantsDetails(XMLNode node) throws Exception { + public void buildEnumConstantsDetails(XMLNode node, + Content memberDetailsTree) throws Exception { configuration.getBuilderFactory(). - getEnumConstantsBuilder(writer).buildChildren(node); + getEnumConstantsBuilder(writer).buildChildren(node, memberDetailsTree); } /** * Build the field documentation. * - * @param elements the XML elements that specify how a field is documented. + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added */ - public void buildFieldDetails(XMLNode node) throws Exception { + public void buildFieldDetails(XMLNode node, + Content memberDetailsTree) throws Exception { configuration.getBuilderFactory(). - getFieldBuilder(writer).buildChildren(node); + getFieldBuilder(writer).buildChildren(node, memberDetailsTree); } /** * Build the constructor documentation. * - * @param elements the XML elements that specify how to document a - * constructor. + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added */ - public void buildConstructorDetails(XMLNode node) throws Exception { + public void buildConstructorDetails(XMLNode node, + Content memberDetailsTree) throws Exception { configuration.getBuilderFactory(). - getConstructorBuilder(writer).buildChildren(node); + getConstructorBuilder(writer).buildChildren(node, memberDetailsTree); } /** * Build the method documentation. * - * @param elements the XML elements that specify how a method is documented. + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added */ - public void buildMethodDetails(XMLNode node) throws Exception { + public void buildMethodDetails(XMLNode node, + Content memberDetailsTree) throws Exception { configuration.getBuilderFactory(). - getMethodBuilder(writer).buildChildren(node); - } - - /** - * Build the footer of the page. - */ - public void buildClassFooter(XMLNode node) { - writer.writeFooter(); + getMethodBuilder(writer).buildChildren(node, memberDetailsTree); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java index 2126b619ba7..bded1e85e09 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +25,11 @@ package com.sun.tools.doclets.internal.toolkit.builders; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.javadoc.*; import java.io.*; import java.util.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; /** * Builds the Constants Summary Page. @@ -39,6 +39,7 @@ import java.util.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public class ConstantsSummaryBuilder extends AbstractBuilder { @@ -79,6 +80,11 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { */ private ClassDoc currentClass; + /** + * The content tree for the constant summary documentation. + */ + private Content contentTree; + /** * Construct a new ConstantsSummaryBuilder. * @@ -113,7 +119,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { //Doclet does not support this output. return; } - build(LayoutParser.getInstance(configuration).parseXML(ROOT)); + build(LayoutParser.getInstance(configuration).parseXML(ROOT), contentTree); } /** @@ -126,85 +132,85 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { /** * Build the constant summary. * - * @param elements the list of elements describing constant summary - * documentation. + * @param node the XML element that specifies which components to document + * @param contentTree the content tree to which the documentation will be added */ - public void buildConstantSummary(XMLNode node) throws Exception { - buildChildren(node); + public void buildConstantSummary(XMLNode node, Content contentTree) throws Exception { + contentTree = writer.getHeader(); + buildChildren(node, contentTree); + writer.addFooter(contentTree); + writer.printDocument(contentTree); writer.close(); } /** - * Build the header. + * Build the list of packages. + * + * @param node the XML element that specifies which components to document + * @param contentTree the content tree to which the content list will be added */ - public void buildHeader(XMLNode node) { - writer.writeHeader(); - } - - /** - * Build the footer. - */ - public void buildFooter(XMLNode node) { - writer.writeFooter(); - } - - /** - * Build the table of contents. - */ - public void buildContents(XMLNode node) { - writer.writeContentsHeader(); + public void buildContents(XMLNode node, Content contentTree) { + Content contentListTree = writer.getContentsHeader(); PackageDoc[] packages = configuration.packages; printedPackageHeaders = new HashSet(); for (int i = 0; i < packages.length; i++) { if (hasConstantField(packages[i]) && ! hasPrintedPackageIndex(packages[i].name())) { - writer.writeLinkToPackageContent(packages[i], + writer.addLinkToPackageContent(packages[i], parsePackageName(packages[i].name()), - printedPackageHeaders); + printedPackageHeaders, contentListTree); } } - writer.writeContentsFooter(); + contentTree.addContent(writer.getContentsList(contentListTree)); } /** * Build the summary for each documented package. * - * @param elements the XML elements that represent the components - * of documentation for each package. + * @param node the XML element that specifies which components to document + * @param contentTree the tree to which the summaries will be added */ - public void buildConstantSummaries(XMLNode node) { + public void buildConstantSummaries(XMLNode node, Content contentTree) { PackageDoc[] packages = configuration.packages; printedPackageHeaders = new HashSet(); + Content summariesTree = writer.getConstantSummaries(); for (int i = 0; i < packages.length; i++) { if (hasConstantField(packages[i])) { currentPackage = packages[i]; //Build the documentation for the current package. - buildChildren(node); + buildChildren(node, summariesTree); } } + contentTree.addContent(summariesTree); } /** - * Build the summary for the current package. + * Build the header for the given package. * - * @param elements the list of XML elements that make up package - * documentation. + * @param node the XML element that specifies which components to document + * @param summariesTree the tree to which the package header will be added */ - public void buildPackageConstantSummary(XMLNode node) { - buildChildren(node); + public void buildPackageHeader(XMLNode node, Content summariesTree) { + String parsedPackageName = parsePackageName(currentPackage.name()); + if (! printedPackageHeaders.contains(parsedPackageName)) { + writer.addPackageName(currentPackage, + parsePackageName(currentPackage.name()), summariesTree); + printedPackageHeaders.add(parsedPackageName); + } } /** * Build the summary for the current class. * - * @param elements the list of XML elements that make up the class - * constant summary. + * @param node the XML element that specifies which components to document + * @param summariesTree the tree to which the class constant summary will be added */ - public void buildClassConstantSummary(XMLNode node) { + public void buildClassConstantSummary(XMLNode node, Content summariesTree) { ClassDoc[] classes = currentPackage.name().length() > 0 ? currentPackage.allClasses() : configuration.classDocCatalog.allClasses( DocletConstants.DEFAULT_PACKAGE_NAME); Arrays.sort(classes); + Content classConstantTree = writer.getClassConstantHeader(); for (int i = 0; i < classes.length; i++) { if (! classDocsWithConstFields.contains(classes[i]) || ! classes[i].isIncluded()) { @@ -212,42 +218,20 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { } currentClass = classes[i]; //Build the documentation for the current class. - buildChildren(node); + buildChildren(node, classConstantTree); } + summariesTree.addContent(classConstantTree); } /** - * Build the header for the given class. + * Build the summary of constant members in the class. + * + * @param node the XML element that specifies which components to document + * @param classConstantTree the tree to which the constant members table + * will be added */ - public void buildPackageHeader(XMLNode node) { - String parsedPackageName = parsePackageName(currentPackage.name()); - if (! printedPackageHeaders.contains(parsedPackageName)) { - writer.writePackageName(currentPackage, - parsePackageName(currentPackage.name())); - printedPackageHeaders.add(parsedPackageName); - } - } - - /** - * Build the header for the given class. - */ - public void buildClassHeader(XMLNode node) { - writer.writeConstantMembersHeader(currentClass); - } - - /** - * Print summary of constant members in the - * class. - */ - public void buildConstantMembers(XMLNode node) { - new ConstantFieldBuilder(currentClass).buildMembersSummary(node); - } - - /** - * Build the footer for the given class. - */ - public void buildClassFooter(XMLNode node) { - writer.writeConstantMembersFooter(currentClass); + public void buildConstantMembers(XMLNode node, Content classConstantTree) { + new ConstantFieldBuilder(currentClass).buildMembersSummary(node, classConstantTree); } /** @@ -346,12 +330,16 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { /** * Builds the table of constants for a given class. + * + * @param node the XML element that specifies which components to document + * @param classConstantTree the tree to which the class constants table + * will be added */ - protected void buildMembersSummary(XMLNode node) { + protected void buildMembersSummary(XMLNode node, Content classConstantTree) { List members = new ArrayList(members()); if (members.size() > 0) { Collections.sort(members); - writer.writeConstantMembers(classdoc, members); + writer.addConstantMembers(classdoc, members, classConstantTree); } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java index ea3b3bee97c..68efe8c124b 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,10 @@ package com.sun.tools.doclets.internal.toolkit.builders; +import java.util.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.javadoc.*; -import java.util.*; /** * Builds documentation for a constructor. @@ -38,200 +38,195 @@ import java.util.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public class ConstructorBuilder extends AbstractMemberBuilder { - /** - * The name of this builder. - */ - public static final String NAME = "ConstructorDetails"; + /** + * The name of this builder. + */ + public static final String NAME = "ConstructorDetails"; - /** - * The index of the current field that is being documented at this point - * in time. - */ - private int currentMethodIndex; + /** + * The index of the current field that is being documented at this point + * in time. + */ + private int currentConstructorIndex; - /** - * The class whose constructors are being documented. - */ - private ClassDoc classDoc; + /** + * The class whose constructors are being documented. + */ + private ClassDoc classDoc; - /** - * The visible constructors for the given class. - */ - private VisibleMemberMap visibleMemberMap; + /** + * The visible constructors for the given class. + */ + private VisibleMemberMap visibleMemberMap; - /** - * The writer to output the constructor documentation. - */ - private ConstructorWriter writer; + /** + * The writer to output the constructor documentation. + */ + private ConstructorWriter writer; - /** - * The constructors being documented. - */ - private List constructors; + /** + * The constructors being documented. + */ + private List constructors; - /** - * Construct a new ConstructorBuilder. - * - * @param configuration the current configuration of the - * doclet. - */ - private ConstructorBuilder(Configuration configuration) { - super(configuration); + /** + * Construct a new ConstructorBuilder. + * + * @param configuration the current configuration of the + * doclet. + */ + private ConstructorBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new ConstructorBuilder. + * + * @param configuration the current configuration of the doclet. + * @param classDoc the class whoses members are being documented. + * @param writer the doclet specific writer. + */ + public static ConstructorBuilder getInstance( + Configuration configuration, + ClassDoc classDoc, + ConstructorWriter writer) { + ConstructorBuilder builder = new ConstructorBuilder(configuration); + builder.classDoc = classDoc; + builder.writer = writer; + builder.visibleMemberMap = + new VisibleMemberMap( + classDoc, + VisibleMemberMap.CONSTRUCTORS, + configuration.nodeprecated); + builder.constructors = + new ArrayList(builder.visibleMemberMap.getMembersFor(classDoc)); + for (int i = 0; i < builder.constructors.size(); i++) { + if (builder.constructors.get(i).isProtected() + || builder.constructors.get(i).isPrivate()) { + writer.setFoundNonPubConstructor(true); + } } - - /** - * Construct a new ConstructorBuilder. - * - * @param configuration the current configuration of the doclet. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - */ - public static ConstructorBuilder getInstance( - Configuration configuration, - ClassDoc classDoc, - ConstructorWriter writer) { - ConstructorBuilder builder = new ConstructorBuilder(configuration); - builder.classDoc = classDoc; - builder.writer = writer; - builder.visibleMemberMap = - new VisibleMemberMap( - classDoc, - VisibleMemberMap.CONSTRUCTORS, - configuration.nodeprecated); - builder.constructors = - new ArrayList(builder.visibleMemberMap.getMembersFor(classDoc)); - for (int i = 0; i < builder.constructors.size(); i++) { - if (builder.constructors.get(i).isProtected() - || builder.constructors.get(i).isPrivate()) { - writer.setFoundNonPubConstructor(true); - } - } - if (configuration.getMemberComparator() != null) { - Collections.sort( - builder.constructors, - configuration.getMemberComparator()); - } - return builder; + if (configuration.getMemberComparator() != null) { + Collections.sort( + builder.constructors, + configuration.getMemberComparator()); } + return builder; + } - /** - * {@inheritDoc} - */ - public String getName() { - return NAME; - } + /** + * {@inheritDoc} + */ + public String getName() { + return NAME; + } - /** - * {@inheritDoc} - */ - public boolean hasMembersToDocument() { - return constructors.size() > 0; - } + /** + * {@inheritDoc} + */ + public boolean hasMembersToDocument() { + return constructors.size() > 0; + } - /** - * Returns a list of constructors that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @return a list of constructors that will be documented. - */ - public List members(ClassDoc classDoc) { - return visibleMemberMap.getMembersFor(classDoc); - } + /** + * Returns a list of constructors that will be documented for the given class. + * This information can be used for doclet specific documentation + * generation. + * + * @return a list of constructors that will be documented. + */ + public List members(ClassDoc classDoc) { + return visibleMemberMap.getMembersFor(classDoc); + } - /** - * Return the constructor writer for this builder. - * - * @return the constructor writer for this builder. - */ - public ConstructorWriter getWriter() { - return writer; - } + /** + * Return the constructor writer for this builder. + * + * @return the constructor writer for this builder. + */ + public ConstructorWriter getWriter() { + return writer; + } - /** - * Build the constructor documentation. - * - * @param elements the XML elements that specify how to construct this - * documentation. - */ - public void buildConstructorDoc(XMLNode node) { - if (writer == null) { - return; - } - for (currentMethodIndex = 0; - currentMethodIndex < constructors.size(); - currentMethodIndex++) { - buildChildren(node); - } + /** + * Build the constructor documentation. + * + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added + */ + public void buildConstructorDoc(XMLNode node, Content memberDetailsTree) { + if (writer == null) { + return; } + int size = constructors.size(); + if (size > 0) { + Content constructorDetailsTree = writer.getConstructorDetailsTreeHeader( + classDoc, memberDetailsTree); + for (currentConstructorIndex = 0; currentConstructorIndex < size; + currentConstructorIndex++) { + Content constructorDocTree = writer.getConstructorDocTreeHeader( + (ConstructorDoc) constructors.get(currentConstructorIndex), + constructorDetailsTree); + buildChildren(node, constructorDocTree); + constructorDetailsTree.addContent(writer.getConstructorDoc( + constructorDocTree, (currentConstructorIndex == size - 1))); + } + memberDetailsTree.addContent( + writer.getConstructorDetails(constructorDetailsTree)); + } + } - /** - * Build the overall header. - */ - public void buildHeader(XMLNode node) { - writer.writeHeader( - classDoc, - configuration.getText("doclet.Constructor_Detail")); - } + /** + * Build the signature. + * + * @param node the XML element that specifies which components to document + * @param constructorDocTree the content tree to which the documentation will be added + */ + public void buildSignature(XMLNode node, Content constructorDocTree) { + constructorDocTree.addContent( + writer.getSignature( + (ConstructorDoc) constructors.get(currentConstructorIndex))); + } - /** - * Build the header for the individual constructor. - */ - public void buildConstructorHeader(XMLNode node) { - writer.writeConstructorHeader( - (ConstructorDoc) constructors.get(currentMethodIndex), - currentMethodIndex == 0); - } + /** + * Build the deprecation information. + * + * @param node the XML element that specifies which components to document + * @param constructorDocTree the content tree to which the documentation will be added + */ + public void buildDeprecationInfo(XMLNode node, Content constructorDocTree) { + writer.addDeprecated( + (ConstructorDoc) constructors.get(currentConstructorIndex), constructorDocTree); + } - /** - * Build the signature. - */ - public void buildSignature(XMLNode node) { - writer.writeSignature( - (ConstructorDoc) constructors.get(currentMethodIndex)); + /** + * Build the comments for the constructor. Do nothing if + * {@link Configuration#nocomment} is set to true. + * + * @param node the XML element that specifies which components to document + * @param constructorDocTree the content tree to which the documentation will be added + */ + public void buildConstructorComments(XMLNode node, Content constructorDocTree) { + if (!configuration.nocomment) { + writer.addComments( + (ConstructorDoc) constructors.get(currentConstructorIndex), + constructorDocTree); } + } - /** - * Build the deprecation information. - */ - public void buildDeprecationInfo(XMLNode node) { - writer.writeDeprecated( - (ConstructorDoc) constructors.get(currentMethodIndex)); - } - - /** - * Build the comments for the constructor. Do nothing if - * {@link Configuration#nocomment} is set to true. - */ - public void buildConstructorComments(XMLNode node) { - if (!configuration.nocomment) { - writer.writeComments( - (ConstructorDoc) constructors.get(currentMethodIndex)); - } - } - - /** - * Build the tag information. - */ - public void buildTagInfo(XMLNode node) { - writer.writeTags((ConstructorDoc) constructors.get(currentMethodIndex)); - } - - /** - * Build the footer for the individual constructor. - */ - public void buildConstructorFooter(XMLNode node) { - writer.writeConstructorFooter(); - } - - /** - * Build the overall footer. - */ - public void buildFooter(XMLNode node) { - writer.writeFooter(classDoc); - } + /** + * Build the tag information. + * + * @param node the XML element that specifies which components to document + * @param constructorDocTree the content tree to which the documentation will be added + */ + public void buildTagInfo(XMLNode node, Content constructorDocTree) { + writer.addTags((ConstructorDoc) constructors.get(currentConstructorIndex), + constructorDocTree); + } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java index f0cff8374b5..868297bc034 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,10 @@ package com.sun.tools.doclets.internal.toolkit.builders; +import java.util.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.javadoc.*; -import java.util.*; /** * Builds documentation for a enum constants. @@ -38,200 +38,195 @@ import java.util.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public class EnumConstantBuilder extends AbstractMemberBuilder { - /** - * The class whose enum constants are being documented. - */ - private ClassDoc classDoc; + /** + * The class whose enum constants are being documented. + */ + private ClassDoc classDoc; - /** - * The visible enum constantss for the given class. - */ - private VisibleMemberMap visibleMemberMap; + /** + * The visible enum constantss for the given class. + */ + private VisibleMemberMap visibleMemberMap; - /** - * The writer to output the enum constants documentation. - */ - private EnumConstantWriter writer; + /** + * The writer to output the enum constants documentation. + */ + private EnumConstantWriter writer; - /** - * The list of enum constants being documented. - */ - private List enumConstants; + /** + * The list of enum constants being documented. + */ + private List enumConstants; - /** - * The index of the current enum constant that is being documented at this point - * in time. - */ - private int currentEnumConstantsIndex; + /** + * The index of the current enum constant that is being documented at this point + * in time. + */ + private int currentEnumConstantsIndex; - /** - * Construct a new EnumConstantsBuilder. - * - * @param configuration the current configuration of the - * doclet. - */ - private EnumConstantBuilder(Configuration configuration) { - super(configuration); + /** + * Construct a new EnumConstantsBuilder. + * + * @param configuration the current configuration of the + * doclet. + */ + private EnumConstantBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new EnumConstantsBuilder. + * + * @param configuration the current configuration of the doclet. + * @param classDoc the class whoses members are being documented. + * @param writer the doclet specific writer. + */ + public static EnumConstantBuilder getInstance( + Configuration configuration, + ClassDoc classDoc, + EnumConstantWriter writer) { + EnumConstantBuilder builder = new EnumConstantBuilder(configuration); + builder.classDoc = classDoc; + builder.writer = writer; + builder.visibleMemberMap = + new VisibleMemberMap( + classDoc, + VisibleMemberMap.ENUM_CONSTANTS, + configuration.nodeprecated); + builder.enumConstants = + new ArrayList(builder.visibleMemberMap.getMembersFor(classDoc)); + if (configuration.getMemberComparator() != null) { + Collections.sort( + builder.enumConstants, + configuration.getMemberComparator()); } + return builder; + } - /** - * Construct a new EnumConstantsBuilder. - * - * @param configuration the current configuration of the doclet. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - */ - public static EnumConstantBuilder getInstance( - Configuration configuration, - ClassDoc classDoc, - EnumConstantWriter writer) { - EnumConstantBuilder builder = new EnumConstantBuilder(configuration); - builder.classDoc = classDoc; - builder.writer = writer; - builder.visibleMemberMap = - new VisibleMemberMap( - classDoc, - VisibleMemberMap.ENUM_CONSTANTS, - configuration.nodeprecated); - builder.enumConstants = - new ArrayList(builder.visibleMemberMap.getMembersFor(classDoc)); - if (configuration.getMemberComparator() != null) { - Collections.sort( - builder.enumConstants, - configuration.getMemberComparator()); - } - return builder; + /** + * {@inheritDoc} + */ + public String getName() { + return "EnumConstantDetails"; + } + + /** + * Returns a list of enum constants that will be documented for the given class. + * This information can be used for doclet specific documentation + * generation. + * + * @param classDoc the {@link ClassDoc} we want to check. + * @return a list of enum constants that will be documented. + */ + public List members(ClassDoc classDoc) { + return visibleMemberMap.getMembersFor(classDoc); + } + + /** + * Returns the visible member map for the enum constants of this class. + * + * @return the visible member map for the enum constants of this class. + */ + public VisibleMemberMap getVisibleMemberMap() { + return visibleMemberMap; + } + + /** + * summaryOrder.size() + */ + public boolean hasMembersToDocument() { + return enumConstants.size() > 0; + } + + /** + * Build the enum constant documentation. + * + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added + */ + public void buildEnumConstant(XMLNode node, Content memberDetailsTree) { + if (writer == null) { + return; } - - /** - * {@inheritDoc} - */ - public String getName() { - return "EnumConstantDetails"; - } - - /** - * Returns a list of enum constants that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @param classDoc the {@link ClassDoc} we want to check. - * @return a list of enum constants that will be documented. - */ - public List members(ClassDoc classDoc) { - return visibleMemberMap.getMembersFor(classDoc); - } - - /** - * Returns the visible member map for the enum constants of this class. - * - * @return the visible member map for the enum constants of this class. - */ - public VisibleMemberMap getVisibleMemberMap() { - return visibleMemberMap; - } - - /** - * summaryOrder.size() - */ - public boolean hasMembersToDocument() { - return enumConstants.size() > 0; - } - - /** - * Build the enum constant documentation. - * - * @param elements the XML elements that specify how to construct this - * documentation. - */ - public void buildEnumConstant(XMLNode node) { - if (writer == null) { - return; - } - for (currentEnumConstantsIndex = 0; - currentEnumConstantsIndex < enumConstants.size(); - currentEnumConstantsIndex++) { - buildChildren(node); - } - } - - /** - * Build the overall header. - */ - public void buildHeader(XMLNode node) { - writer.writeHeader( - classDoc, - configuration.getText("doclet.Enum_Constant_Detail")); - } - - /** - * Build the header for the individual enum constants. - */ - public void buildEnumConstantHeader(XMLNode node) { - writer.writeEnumConstantHeader( + int size = enumConstants.size(); + if (size > 0) { + Content enumConstantsDetailsTree = writer.getEnumConstantsDetailsTreeHeader( + classDoc, memberDetailsTree); + for (currentEnumConstantsIndex = 0; currentEnumConstantsIndex < size; + currentEnumConstantsIndex++) { + Content enumConstantsTree = writer.getEnumConstantsTreeHeader( (FieldDoc) enumConstants.get(currentEnumConstantsIndex), - currentEnumConstantsIndex == 0); + enumConstantsDetailsTree); + buildChildren(node, enumConstantsTree); + enumConstantsDetailsTree.addContent(writer.getEnumConstants( + enumConstantsTree, (currentEnumConstantsIndex == size - 1))); + } + memberDetailsTree.addContent( + writer.getEnumConstantsDetails(enumConstantsDetailsTree)); } + } - /** - * Build the signature. - */ - public void buildSignature(XMLNode node) { - writer.writeSignature( - (FieldDoc) enumConstants.get(currentEnumConstantsIndex)); - } + /** + * Build the signature. + * + * @param node the XML element that specifies which components to document + * @param enumConstantsTree the content tree to which the documentation will be added + */ + public void buildSignature(XMLNode node, Content enumConstantsTree) { + enumConstantsTree.addContent(writer.getSignature( + (FieldDoc) enumConstants.get(currentEnumConstantsIndex))); + } - /** - * Build the deprecation information. - */ - public void buildDeprecationInfo(XMLNode node) { - writer.writeDeprecated( - (FieldDoc) enumConstants.get(currentEnumConstantsIndex)); - } + /** + * Build the deprecation information. + * + * @param node the XML element that specifies which components to document + * @param enumConstantsTree the content tree to which the documentation will be added + */ + public void buildDeprecationInfo(XMLNode node, Content enumConstantsTree) { + writer.addDeprecated( + (FieldDoc) enumConstants.get(currentEnumConstantsIndex), + enumConstantsTree); + } - /** - * Build the comments for the enum constant. Do nothing if - * {@link Configuration#nocomment} is set to true. - */ - public void buildEnumConstantComments(XMLNode node) { - if (!configuration.nocomment) { - writer.writeComments( - (FieldDoc) enumConstants.get(currentEnumConstantsIndex)); - } + /** + * Build the comments for the enum constant. Do nothing if + * {@link Configuration#nocomment} is set to true. + * + * @param node the XML element that specifies which components to document + * @param enumConstantsTree the content tree to which the documentation will be added + */ + public void buildEnumConstantComments(XMLNode node, Content enumConstantsTree) { + if (!configuration.nocomment) { + writer.addComments( + (FieldDoc) enumConstants.get(currentEnumConstantsIndex), + enumConstantsTree); } + } - /** - * Build the tag information. - */ - public void buildTagInfo(XMLNode node) { - writer.writeTags( - (FieldDoc) enumConstants.get(currentEnumConstantsIndex)); - } + /** + * Build the tag information. + * + * @param node the XML element that specifies which components to document + * @param enumConstantsTree the content tree to which the documentation will be added + */ + public void buildTagInfo(XMLNode node, Content enumConstantsTree) { + writer.addTags( + (FieldDoc) enumConstants.get(currentEnumConstantsIndex), + enumConstantsTree); + } - /** - * Build the footer for the individual enum constants. - */ - public void buildEnumConstantFooter(XMLNode node) { - writer.writeEnumConstantFooter(); - } - - /** - * Build the overall footer. - */ - public void buildFooter(XMLNode node) { - writer.writeFooter(classDoc); - } - - /** - * Return the enum constant writer for this builder. - * - * @return the enum constant writer for this builder. - */ - public EnumConstantWriter getWriter() { - return writer; - } + /** + * Return the enum constant writer for this builder. + * + * @return the enum constant writer for this builder. + */ + public EnumConstantWriter getWriter() { + return writer; + } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java index 0e381f2ed0d..0416ba98555 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,10 @@ package com.sun.tools.doclets.internal.toolkit.builders; +import java.util.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.javadoc.*; -import java.util.*; /** * Builds documentation for a field. @@ -38,197 +38,191 @@ import java.util.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public class FieldBuilder extends AbstractMemberBuilder { - /** - * The class whose fields are being documented. - */ - private ClassDoc classDoc; + /** + * The class whose fields are being documented. + */ + private ClassDoc classDoc; - /** - * The visible fields for the given class. - */ - private VisibleMemberMap visibleMemberMap; + /** + * The visible fields for the given class. + */ + private VisibleMemberMap visibleMemberMap; - /** - * The writer to output the field documentation. - */ - private FieldWriter writer; + /** + * The writer to output the field documentation. + */ + private FieldWriter writer; - /** - * The list of fields being documented. - */ - private List fields; + /** + * The list of fields being documented. + */ + private List fields; - /** - * The index of the current field that is being documented at this point - * in time. - */ - private int currentFieldIndex; + /** + * The index of the current field that is being documented at this point + * in time. + */ + private int currentFieldIndex; - /** - * Construct a new FieldBuilder. - * - * @param configuration the current configuration of the - * doclet. - */ - private FieldBuilder(Configuration configuration) { - super(configuration); + /** + * Construct a new FieldBuilder. + * + * @param configuration the current configuration of the + * doclet. + */ + private FieldBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new FieldBuilder. + * + * @param configuration the current configuration of the doclet. + * @param classDoc the class whoses members are being documented. + * @param writer the doclet specific writer. + */ + public static FieldBuilder getInstance( + Configuration configuration, + ClassDoc classDoc, + FieldWriter writer) { + FieldBuilder builder = new FieldBuilder(configuration); + builder.classDoc = classDoc; + builder.writer = writer; + builder.visibleMemberMap = + new VisibleMemberMap( + classDoc, + VisibleMemberMap.FIELDS, + configuration.nodeprecated); + builder.fields = + new ArrayList(builder.visibleMemberMap.getLeafClassMembers( + configuration)); + if (configuration.getMemberComparator() != null) { + Collections.sort( + builder.fields, + configuration.getMemberComparator()); } + return builder; + } - /** - * Construct a new FieldBuilder. - * - * @param configuration the current configuration of the doclet. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - */ - public static FieldBuilder getInstance( - Configuration configuration, - ClassDoc classDoc, - FieldWriter writer) { - FieldBuilder builder = new FieldBuilder(configuration); - builder.classDoc = classDoc; - builder.writer = writer; - builder.visibleMemberMap = - new VisibleMemberMap( - classDoc, - VisibleMemberMap.FIELDS, - configuration.nodeprecated); - builder.fields = - new ArrayList(builder.visibleMemberMap.getLeafClassMembers( - configuration)); - if (configuration.getMemberComparator() != null) { - Collections.sort( - builder.fields, - configuration.getMemberComparator()); - } - return builder; + /** + * {@inheritDoc} + */ + public String getName() { + return "FieldDetails"; + } + + /** + * Returns a list of fields that will be documented for the given class. + * This information can be used for doclet specific documentation + * generation. + * + * @param classDoc the {@link ClassDoc} we want to check. + * @return a list of fields that will be documented. + */ + public List members(ClassDoc classDoc) { + return visibleMemberMap.getMembersFor(classDoc); + } + + /** + * Returns the visible member map for the fields of this class. + * + * @return the visible member map for the fields of this class. + */ + public VisibleMemberMap getVisibleMemberMap() { + return visibleMemberMap; + } + + /** + * summaryOrder.size() + */ + public boolean hasMembersToDocument() { + return fields.size() > 0; + } + + /** + * Build the field documentation. + * + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added + */ + public void buildFieldDoc(XMLNode node, Content memberDetailsTree) { + if (writer == null) { + return; } - - /** - * {@inheritDoc} - */ - public String getName() { - return "FieldDetails"; - } - - /** - * Returns a list of fields that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @param classDoc the {@link ClassDoc} we want to check. - * @return a list of fields that will be documented. - */ - public List members(ClassDoc classDoc) { - return visibleMemberMap.getMembersFor(classDoc); - } - - /** - * Returns the visible member map for the fields of this class. - * - * @return the visible member map for the fields of this class. - */ - public VisibleMemberMap getVisibleMemberMap() { - return visibleMemberMap; - } - - /** - * summaryOrder.size() - */ - public boolean hasMembersToDocument() { - return fields.size() > 0; - } - - /** - * Build the field documentation. - * - * @param elements the XML elements that specify how to construct this - * documentation. - */ - public void buildFieldDoc(XMLNode node) { - if (writer == null) { - return; - } - for (currentFieldIndex = 0; - currentFieldIndex < fields.size(); - currentFieldIndex++) { - buildChildren(node); - } - } - - /** - * Build the overall header. - */ - public void buildHeader(XMLNode node) { - writer.writeHeader( - classDoc, - configuration.getText("doclet.Field_Detail")); - } - - /** - * Build the header for the individual field. - */ - public void buildFieldHeader(XMLNode node) { - writer.writeFieldHeader( + int size = fields.size(); + if (size > 0) { + Content fieldDetailsTree = writer.getFieldDetailsTreeHeader( + classDoc, memberDetailsTree); + for (currentFieldIndex = 0; currentFieldIndex < size; + currentFieldIndex++) { + Content fieldDocTree = writer.getFieldDocTreeHeader( (FieldDoc) fields.get(currentFieldIndex), - currentFieldIndex == 0); + fieldDetailsTree); + buildChildren(node, fieldDocTree); + fieldDetailsTree.addContent(writer.getFieldDoc( + fieldDocTree, (currentFieldIndex == size - 1))); + } + memberDetailsTree.addContent( + writer.getFieldDetails(fieldDetailsTree)); } + } - /** - * Build the signature. - */ - public void buildSignature(XMLNode node) { - writer.writeSignature((FieldDoc) fields.get(currentFieldIndex)); - } + /** + * Build the signature. + * + * @param node the XML element that specifies which components to document + * @param fieldDocTree the content tree to which the documentation will be added + */ + public void buildSignature(XMLNode node, Content fieldDocTree) { + fieldDocTree.addContent( + writer.getSignature((FieldDoc) fields.get(currentFieldIndex))); + } - /** - * Build the deprecation information. - */ - public void buildDeprecationInfo(XMLNode node) { - writer.writeDeprecated((FieldDoc) fields.get(currentFieldIndex)); - } + /** + * Build the deprecation information. + * + * @param node the XML element that specifies which components to document + * @param fieldDocTree the content tree to which the documentation will be added + */ + public void buildDeprecationInfo(XMLNode node, Content fieldDocTree) { + writer.addDeprecated( + (FieldDoc) fields.get(currentFieldIndex), fieldDocTree); + } - /** - * Build the comments for the field. Do nothing if - * {@link Configuration#nocomment} is set to true. - */ - public void buildFieldComments(XMLNode node) { - if (!configuration.nocomment) { - writer.writeComments((FieldDoc) fields.get(currentFieldIndex)); - } + /** + * Build the comments for the field. Do nothing if + * {@link Configuration#nocomment} is set to true. + * + * @param node the XML element that specifies which components to document + * @param fieldDocTree the content tree to which the documentation will be added + */ + public void buildFieldComments(XMLNode node, Content fieldDocTree) { + if (!configuration.nocomment) { + writer.addComments((FieldDoc) fields.get(currentFieldIndex), fieldDocTree); } + } - /** - * Build the tag information. - */ - public void buildTagInfo(XMLNode node) { - writer.writeTags((FieldDoc) fields.get(currentFieldIndex)); - } + /** + * Build the tag information. + * + * @param node the XML element that specifies which components to document + * @param fieldDocTree the content tree to which the documentation will be added + */ + public void buildTagInfo(XMLNode node, Content fieldDocTree) { + writer.addTags((FieldDoc) fields.get(currentFieldIndex), fieldDocTree); + } - /** - * Build the footer for the individual field. - */ - public void buildFieldFooter(XMLNode node) { - writer.writeFieldFooter(); - } - - /** - * Build the overall footer. - */ - public void buildFooter(XMLNode node) { - writer.writeFooter(classDoc); - } - - /** - * Return the field writer for this builder. - * - * @return the field writer for this builder. - */ - public FieldWriter getWriter() { - return writer; - } + /** + * Return the field writer for this builder. + * + * @return the field writer for this builder. + */ + public FieldWriter getWriter() { + return writer; + } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java index 3b413e7b75b..3445d9617af 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -76,7 +76,7 @@ public class LayoutParser extends DefaultHandler { /** * Parse the XML specifying the layout of the documentation. * - * @return List the list of XML elements parsed. + * @return the list of XML elements parsed. */ public XMLNode parseXML(String root) { if (xmlElementsMap.containsKey(root)) { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java index 404b2e6d1cf..8ad4c58f527 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,10 @@ package com.sun.tools.doclets.internal.toolkit.builders; +import java.util.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.javadoc.*; -import java.util.*; /** * Builds the member summary. @@ -38,49 +38,50 @@ import java.util.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public class MemberSummaryBuilder extends AbstractMemberBuilder { - /** - * The XML root for this builder. - */ - public static final String NAME = "MemberSummary"; + /** + * The XML root for this builder. + */ + public static final String NAME = "MemberSummary"; - /** - * The visible members for the given class. - */ - private VisibleMemberMap[] visibleMemberMaps; + /** + * The visible members for the given class. + */ + private VisibleMemberMap[] visibleMemberMaps; - /** - * The member summary writers for the given class. - */ - private MemberSummaryWriter[] memberSummaryWriters; + /** + * The member summary writers for the given class. + */ + private MemberSummaryWriter[] memberSummaryWriters; - /** - * The type being documented. - */ - private ClassDoc classDoc; + /** + * The type being documented. + */ + private ClassDoc classDoc; - private MemberSummaryBuilder(Configuration configuration) { - super(configuration); - } + private MemberSummaryBuilder(Configuration configuration) { + super(configuration); + } - /** - * Construct a new MemberSummaryBuilder. - * - * @param classWriter the writer for the class whose members are being - * summarized. - * @param configuration the current configuration of the doclet. - */ - public static MemberSummaryBuilder getInstance( - ClassWriter classWriter, Configuration configuration) - throws Exception { - MemberSummaryBuilder builder = new MemberSummaryBuilder(configuration); - builder.classDoc = classWriter.getClassDoc(); - builder.init(classWriter); - return builder; - } + /** + * Construct a new MemberSummaryBuilder. + * + * @param classWriter the writer for the class whose members are being + * summarized. + * @param configuration the current configuration of the doclet. + */ + public static MemberSummaryBuilder getInstance( + ClassWriter classWriter, Configuration configuration) + throws Exception { + MemberSummaryBuilder builder = new MemberSummaryBuilder(configuration); + builder.classDoc = classWriter.getClassDoc(); + builder.init(classWriter); + return builder; + } /** * Construct a new MemberSummaryBuilder. @@ -90,8 +91,8 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { * @param configuration the current configuration of the doclet. */ public static MemberSummaryBuilder getInstance( - AnnotationTypeWriter annotationTypeWriter, Configuration configuration) - throws Exception { + AnnotationTypeWriter annotationTypeWriter, Configuration configuration) + throws Exception { MemberSummaryBuilder builder = new MemberSummaryBuilder(configuration); builder.classDoc = annotationTypeWriter.getAnnotationTypeDoc(); builder.init(annotationTypeWriter); @@ -100,200 +101,209 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { private void init(Object writer) throws Exception { visibleMemberMaps = - new VisibleMemberMap[VisibleMemberMap.NUM_MEMBER_TYPES]; + new VisibleMemberMap[VisibleMemberMap.NUM_MEMBER_TYPES]; for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) { visibleMemberMaps[i] = - new VisibleMemberMap( + new VisibleMemberMap( classDoc, i, configuration.nodeprecated); } memberSummaryWriters = - new MemberSummaryWriter[VisibleMemberMap.NUM_MEMBER_TYPES]; + new MemberSummaryWriter[VisibleMemberMap.NUM_MEMBER_TYPES]; for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) { if (classDoc.isAnnotationType()) { memberSummaryWriters[i] = visibleMemberMaps[i].noVisibleMembers()? null : configuration.getWriterFactory().getMemberSummaryWriter( - (AnnotationTypeWriter) writer, i); + (AnnotationTypeWriter) writer, i); } else { memberSummaryWriters[i] = visibleMemberMaps[i].noVisibleMembers()? null : configuration.getWriterFactory().getMemberSummaryWriter( - (ClassWriter) writer, i); + (ClassWriter) writer, i); } } } - /** - * {@inheritDoc} - */ - public String getName() { - return NAME; - } + /** + * {@inheritDoc} + */ + public String getName() { + return NAME; + } - /** - * Return the specified visible member map. - * - * @param type the type of visible member map to return. - * @return the specified visible member map. - * @throws ArrayIndexOutOfBoundsException when the type is invalid. - * @see VisibleMemberMap - */ - public VisibleMemberMap getVisibleMemberMap(int type) { - return visibleMemberMaps[type]; - } + /** + * Return the specified visible member map. + * + * @param type the type of visible member map to return. + * @return the specified visible member map. + * @throws ArrayIndexOutOfBoundsException when the type is invalid. + * @see VisibleMemberMap + */ + public VisibleMemberMap getVisibleMemberMap(int type) { + return visibleMemberMaps[type]; + } - /** - * Return the specified member summary writer. - * - * @param type the type of member summary writer to return. - * @return the specified member summary writer. - * @throws ArrayIndexOutOfBoundsException when the type is invalid. - * @see VisibleMemberMap - */ - public MemberSummaryWriter getMemberSummaryWriter(int type) { - return memberSummaryWriters[type]; - } + /** + * Return the specified member summary writer. + * + * @param type the type of member summary writer to return. + * @return the specified member summary writer. + * @throws ArrayIndexOutOfBoundsException when the type is invalid. + * @see VisibleMemberMap + */ + public MemberSummaryWriter getMemberSummaryWriter(int type) { + return memberSummaryWriters[type]; + } - /** - * Returns a list of methods that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @param classDoc the {@link ClassDoc} we want to check. - * @param type the type of members to return. - * @return a list of methods that will be documented. - * @see VisibleMemberMap - */ - public List members(int type) { - return visibleMemberMaps[type].getLeafClassMembers(configuration); - } + /** + * Returns a list of methods that will be documented for the given class. + * This information can be used for doclet specific documentation + * generation. + * + * @param classDoc the {@link ClassDoc} we want to check. + * @param type the type of members to return. + * @return a list of methods that will be documented. + * @see VisibleMemberMap + */ + public List members(int type) { + return visibleMemberMaps[type].getLeafClassMembers(configuration); + } - /** - * Return true it there are any members to summarize. - * - * @return true if there are any members to summarize. - */ - public boolean hasMembersToDocument() { + /** + * Return true it there are any members to summarize. + * + * @return true if there are any members to summarize. + */ + public boolean hasMembersToDocument() { if (classDoc instanceof AnnotationTypeDoc) { return ((AnnotationTypeDoc) classDoc).elements().length > 0; } - for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) { - VisibleMemberMap members = visibleMemberMaps[i]; - if (!members.noVisibleMembers()) { - return true; - } - } - return false; - } - - /** - * Build the summary for the enum constants. - */ - public void buildEnumConstantsSummary(XMLNode node) { - buildSummary( - memberSummaryWriters[VisibleMemberMap.ENUM_CONSTANTS], - visibleMemberMaps[VisibleMemberMap.ENUM_CONSTANTS]); + for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) { + VisibleMemberMap members = visibleMemberMaps[i]; + if (!members.noVisibleMembers()) { + return true; + } } + return false; + } /** - * Build the summary for the optional members. + * Build the summary for the enum constants. + * + * @param node the XML element that specifies which components to document + * @param memberSummaryTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeOptionalMemberSummary(XMLNode node) { - buildSummary( - memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL], - visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL]); + public void buildEnumConstantsSummary(XMLNode node, Content memberSummaryTree) { + MemberSummaryWriter writer = + memberSummaryWriters[VisibleMemberMap.ENUM_CONSTANTS]; + VisibleMemberMap visibleMemberMap = + visibleMemberMaps[VisibleMemberMap.ENUM_CONSTANTS]; + addSummary(writer, visibleMemberMap, false, memberSummaryTree); } /** * Build the summary for the optional members. + * + * @param node the XML element that specifies which components to document + * @param memberSummaryTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeRequiredMemberSummary(XMLNode node) { - buildSummary( - memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED], - visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED]); + public void buildAnnotationTypeOptionalMemberSummary(XMLNode node, Content memberSummaryTree) { + MemberSummaryWriter writer = + memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL]; + VisibleMemberMap visibleMemberMap = + visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL]; + addSummary(writer, visibleMemberMap, false, memberSummaryTree); } - /** - * Build the summary for the fields. - */ - public void buildFieldsSummary(XMLNode node) { - buildSummary( - memberSummaryWriters[VisibleMemberMap.FIELDS], - visibleMemberMaps[VisibleMemberMap.FIELDS]); - } + /** + * Build the summary for the optional members. + * + * @param node the XML element that specifies which components to document + * @param memberSummaryTree the content tree to which the documentation will be added + */ + public void buildAnnotationTypeRequiredMemberSummary(XMLNode node, Content memberSummaryTree) { + MemberSummaryWriter writer = + memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED]; + VisibleMemberMap visibleMemberMap = + visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED]; + addSummary(writer, visibleMemberMap, false, memberSummaryTree); + } - /** - * Build the inherited summary for the fields. - */ - public void buildFieldsInheritedSummary(XMLNode node) { - buildInheritedSummary( - memberSummaryWriters[VisibleMemberMap.FIELDS], - visibleMemberMaps[VisibleMemberMap.FIELDS]); - } + /** + * Build the summary for the fields. + * + * @param node the XML element that specifies which components to document + * @param memberSummaryTree the content tree to which the documentation will be added + */ + public void buildFieldsSummary(XMLNode node, Content memberSummaryTree) { + MemberSummaryWriter writer = + memberSummaryWriters[VisibleMemberMap.FIELDS]; + VisibleMemberMap visibleMemberMap = + visibleMemberMaps[VisibleMemberMap.FIELDS]; + addSummary(writer, visibleMemberMap, true, memberSummaryTree); + } - /** - * Build the summary for the nested classes. - */ - public void buildNestedClassesSummary(XMLNode node) { - buildSummary( - memberSummaryWriters[VisibleMemberMap.INNERCLASSES], - visibleMemberMaps[VisibleMemberMap.INNERCLASSES]); - } + /** + * Build the summary for the nested classes. + * + * @param node the XML element that specifies which components to document + * @param memberSummaryTree the content tree to which the documentation will be added + */ + public void buildNestedClassesSummary(XMLNode node, Content memberSummaryTree) { + MemberSummaryWriter writer = + memberSummaryWriters[VisibleMemberMap.INNERCLASSES]; + VisibleMemberMap visibleMemberMap = + visibleMemberMaps[VisibleMemberMap.INNERCLASSES]; + addSummary(writer, visibleMemberMap, true, memberSummaryTree); + } - /** - * Build the inherited summary for the nested classes. - */ - public void buildNestedClassesInheritedSummary(XMLNode node) { - buildInheritedSummary( - memberSummaryWriters[VisibleMemberMap.INNERCLASSES], - visibleMemberMaps[VisibleMemberMap.INNERCLASSES]); - } + /** + * Build the method summary. + * + * @param node the XML element that specifies which components to document + * @param memberSummaryTree the content tree to which the documentation will be added + */ + public void buildMethodsSummary(XMLNode node, Content memberSummaryTree) { + MemberSummaryWriter writer = + memberSummaryWriters[VisibleMemberMap.METHODS]; + VisibleMemberMap visibleMemberMap = + visibleMemberMaps[VisibleMemberMap.METHODS]; + addSummary(writer, visibleMemberMap, true, memberSummaryTree); + } - /** - * Build the method summary. - */ - public void buildMethodsSummary(XMLNode node) { - buildSummary( - memberSummaryWriters[VisibleMemberMap.METHODS], - visibleMemberMaps[VisibleMemberMap.METHODS]); - } + /** + * Build the constructor summary. + * + * @param node the XML element that specifies which components to document + * @param memberSummaryTree the content tree to which the documentation will be added + */ + public void buildConstructorsSummary(XMLNode node, Content memberSummaryTree) { + MemberSummaryWriter writer = + memberSummaryWriters[VisibleMemberMap.CONSTRUCTORS]; + VisibleMemberMap visibleMemberMap = + visibleMemberMaps[VisibleMemberMap.CONSTRUCTORS]; + addSummary(writer, visibleMemberMap, false, memberSummaryTree); + } - /** - * Build the inherited method summary. - */ - public void buildMethodsInheritedSummary(XMLNode node) { - buildInheritedSummary( - memberSummaryWriters[VisibleMemberMap.METHODS], - visibleMemberMaps[VisibleMemberMap.METHODS]); - } - - /** - * Build the constructor summary. - */ - public void buildConstructorsSummary(XMLNode node) { - buildSummary( - memberSummaryWriters[VisibleMemberMap.CONSTRUCTORS], - visibleMemberMaps[VisibleMemberMap.CONSTRUCTORS]); - } - - /** - * Build the member summary for the given members. - * - * @param writer the summary writer to write the output. - * @param visibleMemberMap the given members to summarize. - */ - private void buildSummary(MemberSummaryWriter writer, - VisibleMemberMap visibleMemberMap) { + /** + * Build the member summary for the given members. + * + * @param writer the summary writer to write the output. + * @param visibleMemberMap the given members to summarize. + * @param summaryTreeList list of content trees to which the documentation will be added + */ + private void buildSummary(MemberSummaryWriter writer, + VisibleMemberMap visibleMemberMap, LinkedList summaryTreeList) { List members = new ArrayList(visibleMemberMap.getLeafClassMembers( - configuration)); + configuration)); if (members.size() > 0) { Collections.sort(members); - writer.writeMemberSummaryHeader(classDoc); + Content tableTree = writer.getSummaryTableTree(classDoc); for (int i = 0; i < members.size(); i++) { ProgramElementDoc member = members.get(i); Tag[] firstSentenceTags = member.firstSentenceTags(); @@ -301,32 +311,32 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { //Inherit comments from overriden or implemented method if //necessary. DocFinder.Output inheritedDoc = - DocFinder.search(new DocFinder.Input((MethodDoc) member)); + DocFinder.search(new DocFinder.Input((MethodDoc) member)); if (inheritedDoc.holder != null && inheritedDoc.holder.firstSentenceTags().length > 0) { firstSentenceTags = inheritedDoc.holder.firstSentenceTags(); } } - writer.writeMemberSummary(classDoc, member, firstSentenceTags, - i == 0, i == members.size() - 1); + writer.addMemberSummary(classDoc, member, firstSentenceTags, tableTree, i); } - writer.writeMemberSummaryFooter(classDoc); - } + summaryTreeList.add(tableTree); } + } /** * Build the inherited member summary for the given methods. * - * @param writer the writer for this member summary. + * @param writer the writer for this member summary. * @param visibleMemberMap the map for the members to document. + * @param summaryTreeList list of content trees to which the documentation will be added */ - private void buildInheritedSummary(MemberSummaryWriter writer, - VisibleMemberMap visibleMemberMap) { + private void buildInheritedSummary(MemberSummaryWriter writer, + VisibleMemberMap visibleMemberMap, LinkedList summaryTreeList) { for (Iterator iter = visibleMemberMap.getVisibleClassesList().iterator(); iter.hasNext();) { ClassDoc inhclass = iter.next(); if (! (inhclass.isPublic() || - Util.isLinkable(inhclass, configuration))) { + Util.isLinkable(inhclass, configuration))) { continue; } if (inhclass == classDoc) { @@ -335,18 +345,45 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { List inhmembers = visibleMemberMap.getMembersFor(inhclass); if (inhmembers.size() > 0) { Collections.sort(inhmembers); - writer.writeInheritedMemberSummaryHeader(inhclass); + Content inheritedTree = writer.getInheritedSummaryHeader(inhclass); + Content linksTree = writer.getInheritedSummaryLinksTree(); for (int j = 0; j < inhmembers.size(); ++j) { - writer.writeInheritedMemberSummary( - inhclass.isPackagePrivate() && + writer.addInheritedMemberSummary( + inhclass.isPackagePrivate() && ! Util.isLinkable(inhclass, configuration) ? classDoc : inhclass, - inhmembers.get(j), - j == 0, - j == inhmembers.size() - 1); + inhmembers.get(j), + j == 0, + j == inhmembers.size() - 1, linksTree); } - writer.writeInheritedMemberSummaryFooter(inhclass); + inheritedTree.addContent(linksTree); + summaryTreeList.add(writer.getMemberTree(inheritedTree)); } } } + + /** + * Add the summary for the documentation. + * + * @param writer the writer for this member summary. + * @param visibleMemberMap the map for the members to document. + * @param showInheritedSummary true if inherited summary should be documented + * @param memberSummaryTree the content tree to which the documentation will be added + */ + private void addSummary(MemberSummaryWriter writer, + VisibleMemberMap visibleMemberMap, boolean showInheritedSummary, + Content memberSummaryTree) { + LinkedList summaryTreeList = new LinkedList(); + buildSummary(writer, visibleMemberMap, summaryTreeList); + if (showInheritedSummary) + buildInheritedSummary(writer, visibleMemberMap, summaryTreeList); + if (!summaryTreeList.isEmpty()) { + Content memberTree = writer.getMemberSummaryHeader( + classDoc, memberSummaryTree); + for (int i = 0; i < summaryTreeList.size(); i++) { + memberTree.addContent(summaryTreeList.get(i)); + } + memberSummaryTree.addContent(writer.getMemberTree(memberTree)); + } + } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java index 04816ac65f2..0a28d8928ea 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,10 @@ package com.sun.tools.doclets.internal.toolkit.builders; +import java.util.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.*; import com.sun.javadoc.*; -import java.util.*; /** * Builds documentation for a method. @@ -38,204 +38,199 @@ import java.util.*; * Do not use it as an API * * @author Jamie Ho + * @author Bhavesh Patel (Modified) * @since 1.5 */ public class MethodBuilder extends AbstractMemberBuilder { - /** - * The index of the current field that is being documented at this point - * in time. - */ - private int currentMethodIndex; + /** + * The index of the current field that is being documented at this point + * in time. + */ + private int currentMethodIndex; - /** - * The class whose methods are being documented. - */ - private ClassDoc classDoc; + /** + * The class whose methods are being documented. + */ + private ClassDoc classDoc; - /** - * The visible methods for the given class. - */ - private VisibleMemberMap visibleMemberMap; + /** + * The visible methods for the given class. + */ + private VisibleMemberMap visibleMemberMap; - /** - * The writer to output the method documentation. - */ - private MethodWriter writer; + /** + * The writer to output the method documentation. + */ + private MethodWriter writer; - /** - * The methods being documented. - */ - private List methods; + /** + * The methods being documented. + */ + private List methods; - private MethodBuilder(Configuration configuration) { - super(configuration); - } + private MethodBuilder(Configuration configuration) { + super(configuration); + } - /** - * Construct a new MethodBuilder. - * - * @param configuration the current configuration of the doclet. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - * - * @return an instance of a MethodBuilder. - */ - public static MethodBuilder getInstance( - Configuration configuration, - ClassDoc classDoc, - MethodWriter writer) { - MethodBuilder builder = new MethodBuilder(configuration); - builder.classDoc = classDoc; - builder.writer = writer; - builder.visibleMemberMap = - new VisibleMemberMap( - classDoc, - VisibleMemberMap.METHODS, - configuration.nodeprecated); - builder.methods = - new ArrayList(builder.visibleMemberMap.getLeafClassMembers( + /** + * Construct a new MethodBuilder. + * + * @param configuration the current configuration of the doclet. + * @param classDoc the class whoses members are being documented. + * @param writer the doclet specific writer. + * + * @return an instance of a MethodBuilder. + */ + public static MethodBuilder getInstance( + Configuration configuration, + ClassDoc classDoc, + MethodWriter writer) { + MethodBuilder builder = new MethodBuilder(configuration); + builder.classDoc = classDoc; + builder.writer = writer; + builder.visibleMemberMap = + new VisibleMemberMap( + classDoc, + VisibleMemberMap.METHODS, + configuration.nodeprecated); + builder.methods = + new ArrayList(builder.visibleMemberMap.getLeafClassMembers( configuration)); - if (configuration.getMemberComparator() != null) { - Collections.sort( - builder.methods, - configuration.getMemberComparator()); - } - return builder; + if (configuration.getMemberComparator() != null) { + Collections.sort( + builder.methods, + configuration.getMemberComparator()); } + return builder; + } - /** - * {@inheritDoc} - */ - public String getName() { - return "MethodDetails"; + /** + * {@inheritDoc} + */ + public String getName() { + return "MethodDetails"; + } + + /** + * Returns a list of methods that will be documented for the given class. + * This information can be used for doclet specific documentation + * generation. + * + * @param classDoc the {@link ClassDoc} we want to check. + * @return a list of methods that will be documented. + */ + public List members(ClassDoc classDoc) { + return visibleMemberMap.getMembersFor(classDoc); + } + + /** + * Returns the visible member map for the methods of this class. + * + * @return the visible member map for the methods of this class. + */ + public VisibleMemberMap getVisibleMemberMap() { + return visibleMemberMap; + } + + /** + * {@inheritDoc} + */ + public boolean hasMembersToDocument() { + return methods.size() > 0; + } + + /** + * Build the method documentation. + * + * @param node the XML element that specifies which components to document + * @param memberDetailsTree the content tree to which the documentation will be added + */ + public void buildMethodDoc(XMLNode node, Content memberDetailsTree) { + if (writer == null) { + return; } - - /** - * Returns a list of methods that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @param classDoc the {@link ClassDoc} we want to check. - * @return a list of methods that will be documented. - */ - public List members(ClassDoc classDoc) { - return visibleMemberMap.getMembersFor(classDoc); - } - - /** - * Returns the visible member map for the methods of this class. - * - * @return the visible member map for the methods of this class. - */ - public VisibleMemberMap getVisibleMemberMap() { - return visibleMemberMap; - } - - /** - * {@inheritDoc} - */ - public boolean hasMembersToDocument() { - return methods.size() > 0; - } - - /** - * Build the method documentation. - */ - public void buildMethodDoc(XMLNode node) { - if (writer == null) { - return; - } - for (currentMethodIndex = 0; - currentMethodIndex < methods.size(); - currentMethodIndex++) { - buildChildren(node); - } - } - - /** - * Build the overall header. - */ - public void buildHeader(XMLNode node) { - writer.writeHeader( - classDoc, - configuration.getText("doclet.Method_Detail")); - } - - /** - * Build the header for the individual method. - */ - public void buildMethodHeader(XMLNode node) { - writer.writeMethodHeader( + int size = methods.size(); + if (size > 0) { + Content methodDetailsTree = writer.getMethodDetailsTreeHeader( + classDoc, memberDetailsTree); + for (currentMethodIndex = 0; currentMethodIndex < size; + currentMethodIndex++) { + Content methodDocTree = writer.getMethodDocTreeHeader( (MethodDoc) methods.get(currentMethodIndex), - currentMethodIndex == 0); + methodDetailsTree); + buildChildren(node, methodDocTree); + methodDetailsTree.addContent(writer.getMethodDoc( + methodDocTree, (currentMethodIndex == size - 1))); + } + memberDetailsTree.addContent( + writer.getMethodDetails(methodDetailsTree)); } + } - /** - * Build the signature. - */ - public void buildSignature(XMLNode node) { - writer.writeSignature((MethodDoc) methods.get(currentMethodIndex)); - } + /** + * Build the signature. + * + * @param node the XML element that specifies which components to document + * @param methodDocTree the content tree to which the documentation will be added + */ + public void buildSignature(XMLNode node, Content methodDocTree) { + methodDocTree.addContent( + writer.getSignature((MethodDoc) methods.get(currentMethodIndex))); + } - /** - * Build the deprecation information. - */ - public void buildDeprecationInfo(XMLNode node) { - writer.writeDeprecated((MethodDoc) methods.get(currentMethodIndex)); - } + /** + * Build the deprecation information. + * + * @param node the XML element that specifies which components to document + * @param methodDocTree the content tree to which the documentation will be added + */ + public void buildDeprecationInfo(XMLNode node, Content methodDocTree) { + writer.addDeprecated( + (MethodDoc) methods.get(currentMethodIndex), methodDocTree); + } - /** - * Build the comments for the method. Do nothing if - * {@link Configuration#nocomment} is set to true. If this method - */ - public void buildMethodComments(XMLNode node) { - if (!configuration.nocomment) { + /** + * Build the comments for the method. Do nothing if + * {@link Configuration#nocomment} is set to true. + * + * @param node the XML element that specifies which components to document + * @param methodDocTree the content tree to which the documentation will be added + */ + public void buildMethodComments(XMLNode node, Content methodDocTree) { + if (!configuration.nocomment) { MethodDoc method = (MethodDoc) methods.get(currentMethodIndex); if (method.inlineTags().length == 0) { DocFinder.Output docs = DocFinder.search( - new DocFinder.Input(method)); + new DocFinder.Input(method)); method = docs.inlineTags != null && docs.inlineTags.length > 0 ? (MethodDoc) docs.holder : method; - } //NOTE: When we fix the bug where ClassDoc.interfaceTypes() does // not pass all implemented interfaces, holder will be the // interface type. For now, it is really the erasure. - writer.writeComments(method.containingClass(), method); - } + writer.addComments(method.containingClass(), method, methodDocTree); } + } + /** + * Build the tag information. + * + * @param node the XML element that specifies which components to document + * @param methodDocTree the content tree to which the documentation will be added + */ + public void buildTagInfo(XMLNode node, Content methodDocTree) { + writer.addTags((MethodDoc) methods.get(currentMethodIndex), + methodDocTree); + } - - /** - * Build the tag information. - */ - public void buildTagInfo(XMLNode node) { - writer.writeTags((MethodDoc) methods.get(currentMethodIndex)); - } - - /** - * Build the footer of the method. - */ - public void buildMethodFooter(XMLNode node) { - writer.writeMethodFooter(); - } - - /** - * Build the overall footer. - */ - public void buildFooter(XMLNode node) { - writer.writeFooter(classDoc); - } - - /** - * Return the method writer for this builder. - * - * @return the method writer for this builder. - */ - public MethodWriter getWriter() { - return writer; - } + /** + * Return the method writer for this builder. + * + * @return the method writer for this builder. + */ + public MethodWriter getWriter() { + return writer; + } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java index acd382d35d4..3f4494ae3c8 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,10 @@ package com.sun.tools.doclets.internal.toolkit.builders; +import java.io.*; +import com.sun.javadoc.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.javadoc.*; -import java.io.*; /** * Builds the summary for a given package. @@ -42,281 +42,315 @@ import java.io.*; * @since 1.5 */ public class PackageSummaryBuilder extends AbstractBuilder { + /** + * The root element of the package summary XML is {@value}. + */ + public static final String ROOT = "PackageDoc"; - /** - * The root element of the package summary XML is {@value}. - */ - public static final String ROOT = "PackageDoc"; + /** + * The package being documented. + */ + private PackageDoc packageDoc; - /** - * The package being documented. - */ - private PackageDoc packageDoc; + /** + * The doclet specific writer that will output the result. + */ + private PackageSummaryWriter packageWriter; - /** - * The doclet specific writer that will output the result. - */ - private PackageSummaryWriter packageWriter; + /** + * The content that will be added to the package summary documentation tree. + */ + private Content contentTree; - private PackageSummaryBuilder(Configuration configuration) { - super(configuration); + private PackageSummaryBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new PackageSummaryBuilder. + * @param configuration the current configuration of the doclet. + * @param pkg the package being documented. + * @param packageWriter the doclet specific writer that will output the + * result. + * + * @return an instance of a PackageSummaryBuilder. + */ + public static PackageSummaryBuilder getInstance( + Configuration configuration, + PackageDoc pkg, + PackageSummaryWriter packageWriter) { + PackageSummaryBuilder builder = + new PackageSummaryBuilder(configuration); + builder.packageDoc = pkg; + builder.packageWriter = packageWriter; + return builder; + } + + /** + * Build the package summary. + */ + public void build() throws IOException { + if (packageWriter == null) { + //Doclet does not support this output. + return; } + build(LayoutParser.getInstance(configuration).parseXML(ROOT), contentTree); + } - /** - * Construct a new PackageSummaryBuilder. - * @param configuration the current configuration of the doclet. - * @param pkg the package being documented. - * @param packageWriter the doclet specific writer that will output the - * result. - * - * @return an instance of a PackageSummaryBuilder. - */ - public static PackageSummaryBuilder getInstance( - Configuration configuration, - PackageDoc pkg, - PackageSummaryWriter packageWriter) { - PackageSummaryBuilder builder = - new PackageSummaryBuilder(configuration); - builder.packageDoc = pkg; - builder.packageWriter = packageWriter; - return builder; - } + /** + * {@inheritDoc} + */ + public String getName() { + return ROOT; + } - /** - * Build the package summary. - */ - public void build() throws IOException { - if (packageWriter == null) { - //Doclet does not support this output. - return; - } - build(LayoutParser.getInstance(configuration).parseXML(ROOT)); - } + /** + * Build the package documentation. + * + * @param node the XML element that specifies which components to document + * @param contentTree the content tree to which the documentation will be added + */ + public void buildPackageDoc(XMLNode node, Content contentTree) throws Exception { + contentTree = packageWriter.getPackageHeader( + Util.getPackageName(packageDoc)); + buildChildren(node, contentTree); + packageWriter.addPackageFooter(contentTree); + packageWriter.printDocument(contentTree); + packageWriter.close(); + Util.copyDocFiles( + configuration, + Util.getPackageSourcePath(configuration, packageDoc), + DirectoryManager.getDirectoryPath(packageDoc) + + File.separator + + DocletConstants.DOC_FILES_DIR_NAME, + true); + } - /** - * {@inheritDoc} - */ - public String getName() { - return ROOT; - } + /** + * Build the content for the package doc. + * + * @param node the XML element that specifies which components to document + * @param contentTree the content tree to which the package contents + * will be added + */ + public void buildContent(XMLNode node, Content contentTree) { + Content packageContentTree = packageWriter.getContentHeader(); + buildChildren(node, packageContentTree); + contentTree.addContent(packageContentTree); + } - /** - * Build the package documentation. - */ - public void buildPackageDoc(XMLNode node) throws Exception { - buildChildren(node); - packageWriter.close(); - Util.copyDocFiles( - configuration, - Util.getPackageSourcePath(configuration, packageDoc), - DirectoryManager.getDirectoryPath(packageDoc) - + File.separator - + DocletConstants.DOC_FILES_DIR_NAME, - true); - } + /** + * Build the package summary. + * + * @param node the XML element that specifies which components to document + * @param packageContentTree the package content tree to which the summaries will + * be added + */ + public void buildSummary(XMLNode node, Content packageContentTree) { + Content summaryContentTree = packageWriter.getSummaryHeader(); + buildChildren(node, summaryContentTree); + packageContentTree.addContent(summaryContentTree); + } - /** - * Build the header of the summary. - */ - public void buildPackageHeader(XMLNode node) { - packageWriter.writePackageHeader(Util.getPackageName(packageDoc)); - } - - /** - * Build the description of the summary. - */ - public void buildPackageDescription(XMLNode node) { - if (configuration.nocomment) { - return; - } - packageWriter.writePackageDescription(); - } - - /** - * Build the tags of the summary. - */ - public void buildPackageTags(XMLNode node) { - if (configuration.nocomment) { - return; - } - packageWriter.writePackageTags(); - } - - /** - * Build the package summary. - */ - public void buildSummary(XMLNode node) { - buildChildren(node); - } - - /** - * Build the overall header. - */ - public void buildSummaryHeader(XMLNode node) { - packageWriter.writeSummaryHeader(); - } - - /** - * Build the overall footer. - */ - public void buildSummaryFooter(XMLNode node) { - packageWriter.writeSummaryFooter(); - } - - /** - * Build the summary for the classes in this package. - */ - public void buildClassSummary(XMLNode node) { - String classTableSummary = - configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Class_Summary"), - configuration.getText("doclet.classes")); - String[] classTableHeader = new String[] { - configuration.getText("doclet.Class"), - configuration.getText("doclet.Description") - }; - ClassDoc[] classes = - packageDoc.isIncluded() - ? packageDoc.ordinaryClasses() - : configuration.classDocCatalog.ordinaryClasses( - Util.getPackageName(packageDoc)); - if (classes.length > 0) { - packageWriter.writeClassesSummary( - classes, - configuration.getText("doclet.Class_Summary"), - classTableSummary, classTableHeader); - } - } - - /** - * Build the summary for the interfaces in this package. - */ - public void buildInterfaceSummary(XMLNode node) { - String interfaceTableSummary = - configuration.getText("doclet.Member_Table_Summary", + /** + * Build the summary for the interfaces in this package. + * + * @param node the XML element that specifies which components to document + * @param summaryContentTree the summary tree to which the interface summary + * will be added + */ + public void buildInterfaceSummary(XMLNode node, Content summaryContentTree) { + String interfaceTableSummary = + configuration.getText("doclet.Member_Table_Summary", + configuration.getText("doclet.Interface_Summary"), + configuration.getText("doclet.interfaces")); + String[] interfaceTableHeader = new String[] { + configuration.getText("doclet.Interface"), + configuration.getText("doclet.Description") + }; + ClassDoc[] interfaces = + packageDoc.isIncluded() + ? packageDoc.interfaces() + : configuration.classDocCatalog.interfaces( + Util.getPackageName(packageDoc)); + if (interfaces.length > 0) { + packageWriter.addClassesSummary( + interfaces, configuration.getText("doclet.Interface_Summary"), - configuration.getText("doclet.interfaces")); - String[] interfaceTableHeader = new String[] { - configuration.getText("doclet.Interface"), - configuration.getText("doclet.Description") - }; - ClassDoc[] interfaces = - packageDoc.isIncluded() - ? packageDoc.interfaces() - : configuration.classDocCatalog.interfaces( - Util.getPackageName(packageDoc)); - if (interfaces.length > 0) { - packageWriter.writeClassesSummary( - interfaces, - configuration.getText("doclet.Interface_Summary"), - interfaceTableSummary, interfaceTableHeader); - } + interfaceTableSummary, interfaceTableHeader, summaryContentTree); } + } - /** - * Build the summary for the enums in this package. - */ - public void buildAnnotationTypeSummary(XMLNode node) { - String annotationtypeTableSummary = - configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Annotation_Types_Summary"), - configuration.getText("doclet.annotationtypes")); - String[] annotationtypeTableHeader = new String[] { - configuration.getText("doclet.AnnotationType"), - configuration.getText("doclet.Description") - }; - ClassDoc[] annotationTypes = - packageDoc.isIncluded() - ? packageDoc.annotationTypes() - : configuration.classDocCatalog.annotationTypes( - Util.getPackageName(packageDoc)); - if (annotationTypes.length > 0) { - packageWriter.writeClassesSummary( - annotationTypes, - configuration.getText("doclet.Annotation_Types_Summary"), - annotationtypeTableSummary, annotationtypeTableHeader); - } + /** + * Build the summary for the classes in this package. + * + * @param node the XML element that specifies which components to document + * @param summaryContentTree the summary tree to which the class summary will + * be added + */ + public void buildClassSummary(XMLNode node, Content summaryContentTree) { + String classTableSummary = + configuration.getText("doclet.Member_Table_Summary", + configuration.getText("doclet.Class_Summary"), + configuration.getText("doclet.classes")); + String[] classTableHeader = new String[] { + configuration.getText("doclet.Class"), + configuration.getText("doclet.Description") + }; + ClassDoc[] classes = + packageDoc.isIncluded() + ? packageDoc.ordinaryClasses() + : configuration.classDocCatalog.ordinaryClasses( + Util.getPackageName(packageDoc)); + if (classes.length > 0) { + packageWriter.addClassesSummary( + classes, + configuration.getText("doclet.Class_Summary"), + classTableSummary, classTableHeader, summaryContentTree); } + } - /** - * Build the summary for the enums in this package. - */ - public void buildEnumSummary(XMLNode node) { - String enumTableSummary = - configuration.getText("doclet.Member_Table_Summary", + /** + * Build the summary for the enums in this package. + * + * @param node the XML element that specifies which components to document + * @param summaryContentTree the summary tree to which the enum summary will + * be added + */ + public void buildEnumSummary(XMLNode node, Content summaryContentTree) { + String enumTableSummary = + configuration.getText("doclet.Member_Table_Summary", + configuration.getText("doclet.Enum_Summary"), + configuration.getText("doclet.enums")); + String[] enumTableHeader = new String[] { + configuration.getText("doclet.Enum"), + configuration.getText("doclet.Description") + }; + ClassDoc[] enums = + packageDoc.isIncluded() + ? packageDoc.enums() + : configuration.classDocCatalog.enums( + Util.getPackageName(packageDoc)); + if (enums.length > 0) { + packageWriter.addClassesSummary( + enums, configuration.getText("doclet.Enum_Summary"), - configuration.getText("doclet.enums")); - String[] enumTableHeader = new String[] { - configuration.getText("doclet.Enum"), - configuration.getText("doclet.Description") - }; - ClassDoc[] enums = - packageDoc.isIncluded() - ? packageDoc.enums() - : configuration.classDocCatalog.enums( - Util.getPackageName(packageDoc)); - if (enums.length > 0) { - packageWriter.writeClassesSummary( - enums, - configuration.getText("doclet.Enum_Summary"), - enumTableSummary, enumTableHeader); - } + enumTableSummary, enumTableHeader, summaryContentTree); } + } - /** - * Build the summary for the exceptions in this package. - */ - public void buildExceptionSummary(XMLNode node) { - String exceptionTableSummary = - configuration.getText("doclet.Member_Table_Summary", + /** + * Build the summary for the exceptions in this package. + * + * @param node the XML element that specifies which components to document + * @param summaryContentTree the summary tree to which the exception summary will + * be added + */ + public void buildExceptionSummary(XMLNode node, Content summaryContentTree) { + String exceptionTableSummary = + configuration.getText("doclet.Member_Table_Summary", + configuration.getText("doclet.Exception_Summary"), + configuration.getText("doclet.exceptions")); + String[] exceptionTableHeader = new String[] { + configuration.getText("doclet.Exception"), + configuration.getText("doclet.Description") + }; + ClassDoc[] exceptions = + packageDoc.isIncluded() + ? packageDoc.exceptions() + : configuration.classDocCatalog.exceptions( + Util.getPackageName(packageDoc)); + if (exceptions.length > 0) { + packageWriter.addClassesSummary( + exceptions, configuration.getText("doclet.Exception_Summary"), - configuration.getText("doclet.exceptions")); - String[] exceptionTableHeader = new String[] { - configuration.getText("doclet.Exception"), - configuration.getText("doclet.Description") - }; - ClassDoc[] exceptions = - packageDoc.isIncluded() - ? packageDoc.exceptions() - : configuration.classDocCatalog.exceptions( - Util.getPackageName(packageDoc)); - if (exceptions.length > 0) { - packageWriter.writeClassesSummary( - exceptions, - configuration.getText("doclet.Exception_Summary"), - exceptionTableSummary, exceptionTableHeader); - } + exceptionTableSummary, exceptionTableHeader, summaryContentTree); } + } - /** - * Build the summary for the errors in this package. - */ - public void buildErrorSummary(XMLNode node) { - String errorTableSummary = - configuration.getText("doclet.Member_Table_Summary", + /** + * Build the summary for the errors in this package. + * + * @param node the XML element that specifies which components to document + * @param summaryContentTree the summary tree to which the error summary will + * be added + */ + public void buildErrorSummary(XMLNode node, Content summaryContentTree) { + String errorTableSummary = + configuration.getText("doclet.Member_Table_Summary", + configuration.getText("doclet.Error_Summary"), + configuration.getText("doclet.errors")); + String[] errorTableHeader = new String[] { + configuration.getText("doclet.Error"), + configuration.getText("doclet.Description") + }; + ClassDoc[] errors = + packageDoc.isIncluded() + ? packageDoc.errors() + : configuration.classDocCatalog.errors( + Util.getPackageName(packageDoc)); + if (errors.length > 0) { + packageWriter.addClassesSummary( + errors, configuration.getText("doclet.Error_Summary"), - configuration.getText("doclet.errors")); - String[] errorTableHeader = new String[] { - configuration.getText("doclet.Error"), - configuration.getText("doclet.Description") - }; - ClassDoc[] errors = - packageDoc.isIncluded() - ? packageDoc.errors() - : configuration.classDocCatalog.errors( - Util.getPackageName(packageDoc)); - if (errors.length > 0) { - packageWriter.writeClassesSummary( - errors, - configuration.getText("doclet.Error_Summary"), - errorTableSummary, errorTableHeader); - } + errorTableSummary, errorTableHeader, summaryContentTree); } + } - /** - * Build the footer of the summary. - */ - public void buildPackageFooter(XMLNode node) { - packageWriter.writePackageFooter(); + /** + * Build the summary for the annotation type in this package. + * + * @param node the XML element that specifies which components to document + * @param summaryContentTree the summary tree to which the annotation type + * summary will be added + */ + public void buildAnnotationTypeSummary(XMLNode node, Content summaryContentTree) { + String annotationtypeTableSummary = + configuration.getText("doclet.Member_Table_Summary", + configuration.getText("doclet.Annotation_Types_Summary"), + configuration.getText("doclet.annotationtypes")); + String[] annotationtypeTableHeader = new String[] { + configuration.getText("doclet.AnnotationType"), + configuration.getText("doclet.Description") + }; + ClassDoc[] annotationTypes = + packageDoc.isIncluded() + ? packageDoc.annotationTypes() + : configuration.classDocCatalog.annotationTypes( + Util.getPackageName(packageDoc)); + if (annotationTypes.length > 0) { + packageWriter.addClassesSummary( + annotationTypes, + configuration.getText("doclet.Annotation_Types_Summary"), + annotationtypeTableSummary, annotationtypeTableHeader, + summaryContentTree); } + } + + /** + * Build the description of the summary. + * + * @param node the XML element that specifies which components to document + * @param packageContentTree the tree to which the package description will + * be added + */ + public void buildPackageDescription(XMLNode node, Content packageContentTree) { + if (configuration.nocomment) { + return; + } + packageWriter.addPackageDescription(packageContentTree); + } + + /** + * Build the tags of the summary. + * + * @param node the XML element that specifies which components to document + * @param packageContentTree the tree to which the package tags will be added + */ + public void buildPackageTags(XMLNode node, Content packageContentTree) { + if (configuration.nocomment) { + return; + } + packageWriter.addPackageTags(packageContentTree); + } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java index 5cfc42a9009..838973f5dfd 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ package com.sun.tools.doclets.internal.toolkit.builders; import java.io.*; import java.util.*; - import com.sun.javadoc.*; import com.sun.tools.doclets.internal.toolkit.util.*; import com.sun.tools.doclets.internal.toolkit.*; @@ -87,6 +86,11 @@ public class SerializedFormBuilder extends AbstractBuilder { */ protected MemberDoc currentMember; + /** + * The content that will be added to the serialized form documentation tree. + */ + private Content contentTree; + private SerializedFormBuilder(Configuration configuration) { super(configuration); } @@ -117,7 +121,7 @@ public class SerializedFormBuilder extends AbstractBuilder { } catch (Exception e) { throw new DocletAbortException(); } - build(LayoutParser.getInstance(configuration).parseXML(NAME)); + build(LayoutParser.getInstance(configuration).parseXML(NAME), contentTree); writer.close(); } @@ -130,34 +134,44 @@ public class SerializedFormBuilder extends AbstractBuilder { /** * Build the serialized form. + * + * @param node the XML element that specifies which components to document + * @param serializedTree content tree to which the documentation will be added */ - public void buildSerializedForm(XMLNode node) throws Exception { - buildChildren(node); + public void buildSerializedForm(XMLNode node, Content serializedTree) throws Exception { + serializedTree = writer.getHeader(configuration.getText( + "doclet.Serialized_Form")); + buildChildren(node, serializedTree); + writer.addFooter(serializedTree); + writer.printDocument(serializedTree); writer.close(); } /** - * Build the header. + * Build the serialized form summaries. + * + * @param node the XML element that specifies which components to document + * @param serializedTree content tree to which the documentation will be added */ - public void buildHeader(XMLNode node) { - writer.writeHeader(configuration.getText("doclet.Serialized_Form")); - } - - /** - * Build the contents. - */ - public void buildSerializedFormSummaries(XMLNode node) { + public void buildSerializedFormSummaries(XMLNode node, Content serializedTree) { + Content serializedSummariesTree = writer.getSerializedSummariesHeader(); PackageDoc[] packages = configuration.packages; for (int i = 0; i < packages.length; i++) { currentPackage = packages[i]; - buildChildren(node); + buildChildren(node, serializedSummariesTree); } + serializedTree.addContent(writer.getSerializedContent( + serializedSummariesTree)); } /** - * Build the package serialized for for the current package being processed. + * Build the package serialized form for the current package being processed. + * + * @param node the XML element that specifies which components to document + * @param serializedSummariesTree content tree to which the documentation will be added */ - public void buildPackageSerializedForm(XMLNode node) { + public void buildPackageSerializedForm(XMLNode node, Content serializedSummariesTree) { + Content packageSerializedTree = writer.getPackageSerializedHeader(); String foo = currentPackage.name(); ClassDoc[] classes = currentPackage.allClasses(false); if (classes == null || classes.length == 0) { @@ -169,14 +183,29 @@ public class SerializedFormBuilder extends AbstractBuilder { if (!serialClassFoundToDocument(classes)) { return; } - buildChildren(node); + buildChildren(node, packageSerializedTree); + serializedSummariesTree.addContent(packageSerializedTree); } - public void buildPackageHeader(XMLNode node) { - writer.writePackageHeader(Util.getPackageName(currentPackage)); + /** + * Build the package header. + * + * @param node the XML element that specifies which components to document + * @param packageSerializedTree content tree to which the documentation will be added + */ + public void buildPackageHeader(XMLNode node, Content packageSerializedTree) { + packageSerializedTree.addContent(writer.getPackageHeader( + Util.getPackageName(currentPackage))); } - public void buildClassSerializedForm(XMLNode node) { + /** + * Build the class serialized form. + * + * @param node the XML element that specifies which components to document + * @param packageSerializedTree content tree to which the documentation will be added + */ + public void buildClassSerializedForm(XMLNode node, Content packageSerializedTree) { + Content classSerializedTree = writer.getClassSerializedHeader(); ClassDoc[] classes = currentPackage.allClasses(false); Arrays.sort(classes); for (int j = 0; j < classes.length; j++) { @@ -187,35 +216,293 @@ public class SerializedFormBuilder extends AbstractBuilder { if(!serialClassInclude(currentClass)) { continue; } - buildChildren(node); + Content classTree = writer.getClassHeader(currentClass); + buildChildren(node, classTree); + classSerializedTree.addContent(classTree); } } - } - - public void buildClassHeader(XMLNode node) { - writer.writeClassHeader(currentClass); + packageSerializedTree.addContent(classSerializedTree); } /** * Build the serial UID information for the given class. + * + * @param node the XML element that specifies which components to document + * @param classTree content tree to which the serial UID information will be added */ - public void buildSerialUIDInfo(XMLNode node) { + public void buildSerialUIDInfo(XMLNode node, Content classTree) { + Content serialUidTree = writer.getSerialUIDInfoHeader(); FieldDoc[] fields = currentClass.fields(false); for (int i = 0; i < fields.length; i++) { if (fields[i].name().equals("serialVersionUID") && fields[i].constantValueExpression() != null) { - writer.writeSerialUIDInfo(SERIAL_VERSION_UID_HEADER, - fields[i].constantValueExpression()); - return; + writer.addSerialUIDInfo(SERIAL_VERSION_UID_HEADER, + fields[i].constantValueExpression(), serialUidTree); + break; + } + } + classTree.addContent(serialUidTree); + } + + /** + * Build the summaries for the methods and fields. + * + * @param node the XML element that specifies which components to document + * @param classTree content tree to which the documentation will be added + */ + public void buildClassContent(XMLNode node, Content classTree) { + Content classContentTree = writer.getClassContentHeader(); + buildChildren(node, classContentTree); + classTree.addContent(classContentTree); + } + + /** + * Build the summaries for the methods that belong to the given + * class. + * + * @param node the XML element that specifies which components to document + * @param classContentTree content tree to which the documentation will be added + */ + public void buildSerializableMethods(XMLNode node, Content classContentTree) { + Content serializableMethodTree = methodWriter.getSerializableMethodsHeader(); + MemberDoc[] members = currentClass.serializationMethods(); + int membersLength = members.length; + if (membersLength > 0) { + for (int i = 0; i < membersLength; i++) { + currentMember = members[i]; + Content methodsContentTree = methodWriter.getMethodsContentHeader( + (i == membersLength - 1)); + buildChildren(node, methodsContentTree); + serializableMethodTree.addContent(methodsContentTree); + } + } + if (currentClass.serializationMethods().length > 0) { + classContentTree.addContent(methodWriter.getSerializableMethods( + configuration.getText("doclet.Serialized_Form_methods"), + serializableMethodTree)); + if (currentClass.isSerializable() && !currentClass.isExternalizable()) { + if (currentClass.serializationMethods().length == 0) { + Content noCustomizationMsg = methodWriter.getNoCustomizationMsg( + configuration.getText( + "doclet.Serializable_no_customization")); + classContentTree.addContent(methodWriter.getSerializableMethods( + configuration.getText("doclet.Serialized_Form_methods"), + noCustomizationMsg)); + } } } } /** - * Build the footer. + * Build the method sub header. + * + * @param node the XML element that specifies which components to document + * @param methodsContentTree content tree to which the documentation will be added */ - public void buildFooter(XMLNode node) { - writer.writeFooter(); + public void buildMethodSubHeader(XMLNode node, Content methodsContentTree) { + methodWriter.addMemberHeader((MethodDoc)currentMember, methodsContentTree); + } + + /** + * Build the deprecated method description. + * + * @param node the XML element that specifies which components to document + * @param methodsContentTree content tree to which the documentation will be added + */ + public void buildDeprecatedMethodInfo(XMLNode node, Content methodsContentTree) { + methodWriter.addDeprecatedMemberInfo((MethodDoc) currentMember, methodsContentTree); + } + + /** + * Build the information for the method. + * + * @param node the XML element that specifies which components to document + * @param methodsContentTree content tree to which the documentation will be added + */ + public void buildMethodInfo(XMLNode node, Content methodsContentTree) { + if(configuration.nocomment){ + return; + } + buildChildren(node, methodsContentTree); + } + + /** + * Build method description. + * + * @param node the XML element that specifies which components to document + * @param methodsContentTree content tree to which the documentation will be added + */ + public void buildMethodDescription(XMLNode node, Content methodsContentTree) { + methodWriter.addMemberDescription((MethodDoc) currentMember, methodsContentTree); + } + + /** + * Build the method tags. + * + * @param node the XML element that specifies which components to document + * @param methodsContentTree content tree to which the documentation will be added + */ + public void buildMethodTags(XMLNode node, Content methodsContentTree) { + methodWriter.addMemberTags((MethodDoc) currentMember, methodsContentTree); + MethodDoc method = (MethodDoc)currentMember; + if (method.name().compareTo("writeExternal") == 0 + && method.tags("serialData").length == 0) { + if (configuration.serialwarn) { + configuration.getDocletSpecificMsg().warning( + currentMember.position(), "doclet.MissingSerialDataTag", + method.containingClass().qualifiedName(), method.name()); + } + } + } + + /** + * Build the field header. + * + * @param node the XML element that specifies which components to document + * @param classContentTree content tree to which the documentation will be added + */ + public void buildFieldHeader(XMLNode node, Content classContentTree) { + if (currentClass.serializableFields().length > 0) { + buildFieldSerializationOverview(currentClass, classContentTree); + } + } + + /** + * Build the serialization overview for the given class. + * + * @param classDoc the class to print the overview for. + * @param classContentTree content tree to which the documentation will be added + */ + public void buildFieldSerializationOverview(ClassDoc classDoc, Content classContentTree) { + if (classDoc.definesSerializableFields()) { + FieldDoc serialPersistentField = + Util.asList(classDoc.serializableFields()).get(0); + // Check to see if there are inline comments, tags or deprecation + // information to be printed. + if (fieldWriter.shouldPrintOverview(serialPersistentField)) { + Content serializableFieldsTree = fieldWriter.getSerializableFieldsHeader(); + Content fieldsOverviewContentTree = fieldWriter.getFieldsContentHeader(true); + fieldWriter.addMemberDeprecatedInfo(serialPersistentField, + fieldsOverviewContentTree); + if (!configuration.nocomment) { + fieldWriter.addMemberDescription(serialPersistentField, + fieldsOverviewContentTree); + fieldWriter.addMemberTags(serialPersistentField, + fieldsOverviewContentTree); + } + serializableFieldsTree.addContent(fieldsOverviewContentTree); + classContentTree.addContent(fieldWriter.getSerializableFields( + configuration.getText("doclet.Serialized_Form_class"), + serializableFieldsTree)); + } + } + } + + /** + * Build the summaries for the fields that belong to the given class. + * + * @param node the XML element that specifies which components to document + * @param classContentTree content tree to which the documentation will be added + */ + public void buildSerializableFields(XMLNode node, Content classContentTree) { + MemberDoc[] members = currentClass.serializableFields(); + int membersLength = members.length; + if (membersLength > 0) { + Content serializableFieldsTree = fieldWriter.getSerializableFieldsHeader(); + for (int i = 0; i < membersLength; i++) { + currentMember = members[i]; + if (!currentClass.definesSerializableFields()) { + Content fieldsContentTree = fieldWriter.getFieldsContentHeader( + (i == membersLength - 1)); + buildChildren(node, fieldsContentTree); + serializableFieldsTree.addContent(fieldsContentTree); + } + else { + buildSerialFieldTagsInfo(serializableFieldsTree); + } + } + classContentTree.addContent(fieldWriter.getSerializableFields( + configuration.getText("doclet.Serialized_Form_fields"), + serializableFieldsTree)); + } + } + + /** + * Build the field sub header. + * + * @param node the XML element that specifies which components to document + * @param fieldsContentTree content tree to which the documentation will be added + */ + public void buildFieldSubHeader(XMLNode node, Content fieldsContentTree) { + if (!currentClass.definesSerializableFields()) { + FieldDoc field = (FieldDoc) currentMember; + fieldWriter.addMemberHeader(field.type().asClassDoc(), + field.type().typeName(), field.type().dimension(), field.name(), + fieldsContentTree); + } + } + + /** + * Build the field deprecation information. + * + * @param node the XML element that specifies which components to document + * @param fieldsContentTree content tree to which the documentation will be added + */ + public void buildFieldDeprecationInfo(XMLNode node, Content fieldsContentTree) { + if (!currentClass.definesSerializableFields()) { + FieldDoc field = (FieldDoc)currentMember; + fieldWriter.addMemberDeprecatedInfo(field, fieldsContentTree); + } + } + + /** + * Build the serial field tags information. + * + * @param serializableFieldsTree content tree to which the documentation will be added + */ + public void buildSerialFieldTagsInfo(Content serializableFieldsTree) { + if(configuration.nocomment){ + return; + } + FieldDoc field = (FieldDoc)currentMember; + // Process Serializable Fields specified as array of + // ObjectStreamFields. Print a member for each serialField tag. + // (There should be one serialField tag per ObjectStreamField + // element.) + SerialFieldTag[] tags = field.serialFieldTags(); + Arrays.sort(tags); + int tagsLength = tags.length; + for (int i = 0; i < tagsLength; i++) { + Content fieldsContentTree = fieldWriter.getFieldsContentHeader( + (i == tagsLength - 1)); + fieldWriter.addMemberHeader(tags[i].fieldTypeDoc(), + tags[i].fieldType(), "", tags[i].fieldName(), fieldsContentTree); + fieldWriter.addMemberDescription(tags[i], fieldsContentTree); + serializableFieldsTree.addContent(fieldsContentTree); + } + } + + /** + * Build the field information. + * + * @param node the XML element that specifies which components to document + * @param fieldsContentTree content tree to which the documentation will be added + */ + public void buildFieldInfo(XMLNode node, Content fieldsContentTree) { + if(configuration.nocomment){ + return; + } + FieldDoc field = (FieldDoc)currentMember; + ClassDoc cd = field.containingClass(); + // Process default Serializable field. + if ((field.tags("serial").length == 0) && ! field.isSynthetic() + && configuration.serialwarn) { + configuration.message.warning(field.position(), + "doclet.MissingSerialTag", cd.qualifiedName(), + field.name()); + } + fieldWriter.addMemberDescription(field, fieldsContentTree); + fieldWriter.addMemberTags(field, fieldsContentTree); } /** @@ -297,208 +584,4 @@ public class SerializedFormBuilder extends AbstractBuilder { } return false; } - - /** - * Build the method header. - */ - public void buildMethodHeader(XMLNode node) { - if (currentClass.serializationMethods().length > 0) { - methodWriter.writeHeader( - configuration.getText("doclet.Serialized_Form_methods")); - if (currentClass.isSerializable() && !currentClass.isExternalizable()) { - if (currentClass.serializationMethods().length == 0) { - methodWriter.writeNoCustomizationMsg( - configuration.getText( - "doclet.Serializable_no_customization")); - } - } - } - } - - /** - * Build the method sub header. - */ - public void buildMethodSubHeader(XMLNode node) { - methodWriter.writeMemberHeader((MethodDoc) currentMember); - } - - /** - * Build the deprecated method description. - */ - public void buildDeprecatedMethodInfo(XMLNode node) { - methodWriter.writeDeprecatedMemberInfo((MethodDoc) currentMember); - } - - /** - * Build method tags. - */ - public void buildMethodDescription(XMLNode node) { - methodWriter.writeMemberDescription((MethodDoc) currentMember); - } - - /** - * Build the method tags. - */ - public void buildMethodTags(XMLNode node) { - methodWriter.writeMemberTags((MethodDoc) currentMember); - MethodDoc method = (MethodDoc)currentMember; - if (method.name().compareTo("writeExternal") == 0 - && method.tags("serialData").length == 0) { - if (configuration.serialwarn) { - configuration.getDocletSpecificMsg().warning( - currentMember.position(), "doclet.MissingSerialDataTag", - method.containingClass().qualifiedName(), method.name()); - } - } - } - - /** - * build the information for the method. - */ - public void buildMethodInfo(XMLNode node) { - if(configuration.nocomment){ - return; - } - buildChildren(node); - } - - /** - * Build the method footer. - */ - public void buildMethodFooter(XMLNode node) { - methodWriter.writeMemberFooter(); - } - - /** - * Build the field header. - */ - public void buildFieldHeader(XMLNode node) { - if (currentClass.serializableFields().length > 0) { - buildFieldSerializationOverview(currentClass); - fieldWriter.writeHeader(configuration.getText( - "doclet.Serialized_Form_fields")); - } - } - - /** - * If possible, build the serialization overview for the given - * class. - * - * @param classDoc the class to print the overview for. - */ - public void buildFieldSerializationOverview(ClassDoc classDoc) { - if (classDoc.definesSerializableFields()) { - FieldDoc serialPersistentField = - Util.asList(classDoc.serializableFields()).get(0); - // Check to see if there are inline comments, tags or deprecation - // information to be printed. - if (fieldWriter.shouldPrintOverview(serialPersistentField)) { - fieldWriter.writeHeader( - configuration.getText("doclet.Serialized_Form_class")); - fieldWriter.writeMemberDeprecatedInfo(serialPersistentField); - if (!configuration.nocomment) { - fieldWriter.writeMemberDescription(serialPersistentField); - fieldWriter.writeMemberTags(serialPersistentField); - } - // Footer required to close the definition list tag - // for serialization overview. - fieldWriter.writeFooter( - configuration.getText("doclet.Serialized_Form_class")); - } - } - } - - /** - * Build the field sub header. - */ - public void buildFieldSubHeader(XMLNode node) { - if (! currentClass.definesSerializableFields() ){ - FieldDoc field = (FieldDoc) currentMember; - fieldWriter.writeMemberHeader(field.type().asClassDoc(), - field.type().typeName(), field.type().dimension(), field.name()); - } - } - - /** - * Build the field deprecation information. - */ - public void buildFieldDeprecationInfo(XMLNode node) { - if (!currentClass.definesSerializableFields()) { - FieldDoc field = (FieldDoc)currentMember; - fieldWriter.writeMemberDeprecatedInfo(field); - } - } - - /** - * Build the field information. - */ - public void buildFieldInfo(XMLNode node) { - if(configuration.nocomment){ - return; - } - FieldDoc field = (FieldDoc)currentMember; - ClassDoc cd = field.containingClass(); - if (cd.definesSerializableFields()) { - // Process Serializable Fields specified as array of - // ObjectStreamFields. Print a member for each serialField tag. - // (There should be one serialField tag per ObjectStreamField - // element.) - SerialFieldTag[] tags = field.serialFieldTags(); - Arrays.sort(tags); - for (int i = 0; i < tags.length; i++) { - fieldWriter.writeMemberHeader(tags[i].fieldTypeDoc(), - tags[i].fieldType(), "", tags[i].fieldName()); - fieldWriter.writeMemberDescription(tags[i]); - - } - } else { - - // Process default Serializable field. - if ((field.tags("serial").length == 0) && ! field.isSynthetic() - && configuration.serialwarn) { - configuration.message.warning(field.position(), - "doclet.MissingSerialTag", cd.qualifiedName(), - field.name()); - } - fieldWriter.writeMemberDescription(field); - fieldWriter.writeMemberTags(field); - } - } - - /** - * Build the field sub footer. - */ - public void buildFieldSubFooter(XMLNode node) { - if (! currentClass.definesSerializableFields()) { - fieldWriter.writeMemberFooter(); - } - } - - /** - * Build the summaries for the methods that belong to the given - * class. - */ - public void buildSerializableMethods(XMLNode node) { - MemberDoc[] members = currentClass.serializationMethods(); - if (members.length > 0) { - for (int i = 0; i < members.length; i++) { - currentMember = members[i]; - buildChildren(node); - } - } - } - - /** - * Build the summaries for the fields that belong to the given - * class. - */ - public void buildSerializableFields(XMLNode node) { - MemberDoc[] members = currentClass.serializableFields(); - if (members.length > 0) { - for (int i = 0; i < members.length; i++) { - currentMember = members[i]; - buildChildren(node); - } - } - } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml index 2be5de4bad2..a39cea10843 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml @@ -1,7 +1,7 @@ " + LS + "", TMPDEST_DIR1 + "p1" + FS + "C1.html" }, - // Bottom navbar - { "", + // Bottom navbar + { "", TMPDEST_DIR1 + "p1" + FS + "C1.html" }, - // Bottom navbar - { "", + // Bottom navbar + { "" + LS + + "" + LS + "", TMPDEST_DIR1 + "p1" + FS + "C1.html" } }; diff --git a/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java b/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java index fdff27ba4c4..bb0b13d74fc 100644 --- a/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java +++ b/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,7 +24,7 @@ /* * @test * @bug 4637604 4775148 - * @summary Test the tables for summary="" + * @summary Test the tables for summary attribute * @author dkramer * @library ../lib/ * @build JavadocTester @@ -44,15 +44,15 @@ public class AccessSummary extends JavadocTester { // Test that the summary attribute appears { OUTPUT_DIR1 + "overview-summary.html", - "SUMMARY=\"\"" }, + "summary=\"Packages table, listing packages, and an explanation\"" }, // Test that the summary attribute appears { OUTPUT_DIR1 + "p1" + FS + "C1.html", - "SUMMARY=\"\"" }, + "summary=\"Constructor Summary table, listing constructors, and an explanation\"" }, // Test that the summary attribute appears { OUTPUT_DIR1 + "constant-values.html", - "SUMMARY=\"\"" } + "summary=\"Constant Field Values table, listing constant fields, and values\"" } }; // First test with -header only diff --git a/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java b/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java index f58235f8b00..c238abfe68d 100644 --- a/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java +++ b/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,12 +86,12 @@ public class AuthorDD // Test single @since tag: - { "
        Since:
        "+NL+"
        JDK 1.0
        ", + { "
        Since:
        "+NL+"
        JDK 1.0
        ", BUGID + FS + "p1" + FS + "C1.html" }, // Test multiple @author tags: - { "
        Author:
        "+NL+"
        Doug Kramer, Jamie, Neal
        ", + { "
        Author:
        "+NL+"
        Doug Kramer, Jamie, Neal
        ", BUGID + FS + "p1" + FS + "C1.html" }, }; diff --git a/langtools/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java b/langtools/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java index 3dc3cef79f8..ae24b4d1d97 100644 --- a/langtools/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java +++ b/langtools/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,44 +90,34 @@ public class JavascriptWinTitle { private static final String[][] testArray = { // Test the javascript "type" attribute is present: - { "" + LS + - "", + {"", TMPDEST_DIR1 + FS + "p1" + FS + "C.html" } diff --git a/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java b/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java index 1f0bd16761d..6e0e7264d93 100644 --- a/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java +++ b/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,31 +67,31 @@ public class MetaTag extends JavadocTester { private static final String[][] TEST = { { OUTPUT_DIR + FS + "p1" + FS + "C1.html", - "" }, + "" }, { OUTPUT_DIR + FS + "p1" + FS + "C1.html", - "" }, + "" }, { OUTPUT_DIR + FS + "p1" + FS + "C1.html", - "" }, + "" }, { OUTPUT_DIR + FS + "p1" + FS + "C1.html", - "" }, + "" }, { OUTPUT_DIR + FS + "p1" + FS + "C1.html", - "" }, + "" }, { OUTPUT_DIR + FS + "p1" + FS + "package-summary.html", - "" }, + "" }, { OUTPUT_DIR + FS + "overview-summary.html", - "" }, + "" }, //NOTE: Hopefully, this regression test is not run at midnight. If the output //was generated yesterday and this test is run today, the test will fail. {OUTPUT_DIR + FS + "overview-summary.html", - ""}, + ""}, }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java b/langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java index 44281f588d5..f8c8d0d751e 100644 --- a/langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java +++ b/langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 +33,10 @@ * @run main ValidHtml */ - import com.sun.javadoc.*; import java.util.*; import java.io.*; - /** * Runs javadoc and runs regression tests on the resulting HTML. * It reads each file, complete with newlines, into a string to easily @@ -66,13 +64,14 @@ public class ValidHtml { String srcdir = System.getProperty("test.src", "."); // Test for all cases except the split index page - runJavadoc(new String[] {"-d", TMPDEST_DIR1, - "-doctitle", "Document Title", - "-windowtitle", "Window Title", - "-use", - "-overview", (srcdir + FS + "overview.html"), - "-sourcepath", srcdir, - "p1", "p2"}); + runJavadoc(new String[]{"-d", TMPDEST_DIR1, + "-doctitle", "Document Title", + "-windowtitle", "Window Title", + "-use", + "-overview", (srcdir + FS + "overview.html"), + "-sourcepath", srcdir, + "p1", "p2" + }); runTestsOnHTML(testArray); printSummary(); @@ -90,53 +89,52 @@ public class ValidHtml { * NOTE: The standard doclet uses the same separator "\n" for all OS's */ private static final String[][] testArray = { - - // Test the proper DOCTYPE element is present: - { -"", - TMPDEST_DIR1 + "index.html" }, - - // Test the proper DOCTYPE element is present: - { -"", - TMPDEST_DIR1 + "overview-summary.html" }, - - // Test the proper DOCTYPE element is present: - { -"", - TMPDEST_DIR1 + "p1" + FS + "package-summary.html" }, - - // Test the proper DOCTYPE element is present: - { -"", - TMPDEST_DIR1 + "p1" + FS + "C.html" }, - - // Test the proper DOCTYPE element is present: - { -"", - TMPDEST_DIR1 + "overview-frame.html" }, - - // Test the proper DOCTYPE element is present: - { -"", - TMPDEST_DIR1 + "allclasses-frame.html" }, - - // Test the proper DOCTYPE element is present: - { -"", - TMPDEST_DIR1 + "p1" + FS + "package-frame.html" }, - - // Test that is inside <FRAMESET> element: - { -"" + LS + "", - TMPDEST_DIR1 + "index.html" }, - - // Test the table elements are in the correct order: - { -"" + LS + "", - TMPDEST_DIR1 + FS + "p1" + FS + "package-use.html" } - - }; + // Test the proper DOCTYPE element is present: + { + "", + TMPDEST_DIR1 + "index.html" + }, + // Test the proper DOCTYPE element is present: + { + "", + TMPDEST_DIR1 + "overview-summary.html" + }, + // Test the proper DOCTYPE element is present: + { + "", + TMPDEST_DIR1 + "p1" + FS + "package-summary.html" + }, + // Test the proper DOCTYPE element is present: + { + "", + TMPDEST_DIR1 + "p1" + FS + "C.html" + }, + // Test the proper DOCTYPE element is present: + { + "", + TMPDEST_DIR1 + "overview-frame.html" + }, + // Test the proper DOCTYPE element is present: + { + "", + TMPDEST_DIR1 + "allclasses-frame.html" + }, + // Test the proper DOCTYPE element is present: + { + "", + TMPDEST_DIR1 + "p1" + FS + "package-frame.html" + }, + // Test that is inside <FRAMESET> element: + { + "" + LS + "", + TMPDEST_DIR1 + "index.html" + }, + // Test the table elements are in the correct order: + { + "" + LS + "", + TMPDEST_DIR1 + FS + "p1" + FS + "package-use.html" + } + }; public static void runTestsOnHTML(String[][] testArray) { @@ -152,10 +150,7 @@ public class ValidHtml { // Find string in file's contents if (findString(fileString, stringToFind) == -1) { - System.out.println("\nSub-test " + (subtestNum) - + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" - + "when searching for:\n" - + stringToFind); + System.out.println("\nSub-test " + (subtestNum) + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" + "when searching for:\n" + stringToFind); } else { numSubtestsPassed += 1; System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind); @@ -164,11 +159,10 @@ public class ValidHtml { } public static void printSummary() { - if ( numSubtestsPassed == subtestNum ) { + if (numSubtestsPassed == subtestNum) { System.out.println("\nAll " + numSubtestsPassed + " subtests passed"); } else { - throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) - + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n"); + throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n"); } } @@ -176,16 +170,16 @@ public class ValidHtml { public static String readFileToString(String filename) { try { File file = new File(filename); - if ( !file.exists() ) { + if (!file.exists()) { System.out.println("\nFILE DOES NOT EXIST: " + filename); } BufferedReader in = new BufferedReader(new FileReader(file)); // Create an array of characters the size of the file - char[] allChars = new char[(int)file.length()]; + char[] allChars = new char[(int) file.length()]; // Read the characters into the allChars array - in.read(allChars, 0, (int)file.length()); + in.read(allChars, 0, (int) file.length()); in.close(); // Convert to a string diff --git a/langtools/test/com/sun/javadoc/VersionNumber/VersionNumber.java b/langtools/test/com/sun/javadoc/VersionNumber/VersionNumber.java index c4c885fec83..eadf1ca527d 100644 --- a/langtools/test/com/sun/javadoc/VersionNumber/VersionNumber.java +++ b/langtools/test/com/sun/javadoc/VersionNumber/VersionNumber.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -84,7 +84,7 @@ public class VersionNumber { // Test the proper DOCTYPE element is present: { - "" + "" + NL + + "" + NL + + "" }, //Backward compatibility anchor test. {BUG_ID + FS + "pkg" + FS + "C1.html", - "" + "" + NL + + "" + NL + + "" }, //{@link} test. {BUG_ID + FS + "pkg" + FS + "C2.html", - "Link: " + "Link: " }, //@see test. {BUG_ID + FS + "pkg" + FS + "C2.html", - "See Also:
        " + "See Also:
        " }, //Header does not link to the page itself. {BUG_ID + FS + "pkg" + FS + "C4.html", - "Class C4<E extends C4<E>>" + "Class C4<E extends C4<E>>" }, //Signature does not link to the page itself. {BUG_ID + FS + "pkg" + FS + "C4.html", - "public abstract class C4<E extends C4<E>>" + "public abstract class C4<E extends C4<E>>" }, }; private static final String[][] NEGATED_TEST = diff --git a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java index 903c5b154c0..f8a28232384 100644 --- a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java +++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,152 +43,77 @@ public class TestHtmlDefinitionListTag extends JavadocTester { // Optional Element should print properly nested definition list tags // for default value. private static final String[][] TEST_ALL = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        public class " +
        -                 "C1" + NL + "extends " +
        -                 "java.lang.Object" + NL + "implements " +
        -                 "java.io.Serializable
        "}, - {BUG_ID + FS + "pkg1" + FS + "C4.html", "
        " + NL + "
        " + NL + - "
        Default:
        true
        " + NL + - "
        " + NL + "
        " + NL + "
        "}}; + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        public class C1" + NL +
        +                 "extends java.lang.Object" + NL + "implements java.io.Serializable
        "}, + {BUG_ID + FS + "pkg1" + FS + "C4.html", "
        " + NL + + "
        Default:
        " + NL + "
        true
        " + NL + + "
        "}}; // Test for normal run of javadoc in which various ClassDocs and // serialized form should have properly nested definition list tags // enclosing comments, tags and deprecated information. private static final String[][] TEST_CMNT_DEPR = { - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "
        " + NL + - "
        Since:
        " + NL + - "
        JDK1.0
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + - "
        Since:
        " + NL + - "
        JDK1.0
        " + NL + "
        See Also:
        " + - "" + - "C2, " + NL + - "" + - "Serialized Form
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + - "
        Deprecated. As of JDK version" + - " 1.5, replaced by" + NL + - " " + - "setUndecorated(boolean).
        " + - "
        This field indicates whether the C1 is undecorated." + NL + - "

        " + NL + "

        " + NL + "
        " + NL + "
        " + - "Since:
        " + NL + "
        1.4
        " + NL + "
        " + - "See Also:
        " + - "" + - "setUndecorated(boolean)
        " + NL +"
        " + NL + - "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + - "
        Constructor." + NL + "

        " + NL + "

        " + NL + - "
        " + NL + "
        Parameters:
        " + - "title - the title
        test" + - " - boolean value
        " + NL + "
        Throws:
        " + NL + - "
        java.lang.IllegalArgumentException" + - " - if the owner's" + NL + " GraphicsConfiguration" + - " is not from a screen device
        " + NL +"
        " + - "HeadlessException
        " + NL + "
        " + NL + - "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + - "
        Method comments." + NL + "

        " + NL + - "

        " + NL + "
        " + NL + "
        Parameters:" + - "
        undecorated - true" + - " if no decorations are" + NL + " to be enabled;" + NL + - " false if decorations are to be enabled." + - "
        Since:
        " + NL + - "
        1.4
        " + NL + "
        See Also:
        " + - "
        " + - "readObject()
        " + NL + "
        " + NL + - "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + "
        " + NL + - "
        Throws:
        " + NL + "
        " + - "java.io.IOException
        See Also:" + - "
        " + - "" + - "setUndecorated(boolean)
        " + NL + - "
        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "
        " + NL + - "
        No modal exclusion." + NL + "

        " + NL +"

        " + NL + - "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C2.html", "
        " + NL + "
        Constructor." + NL + - "

        " + NL +"

        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C2.html", "
        " + NL + "
        " + - "Deprecated. As of JDK version 1.5, replaced " + - "by" + NL + " " + - "setUndecorated(boolean)." + NL + "

        " + NL + - "

        Set visible." + NL + "

        " + NL + "

        " +NL + - "
        " + NL + "
        Parameters:
        " + - "set - boolean
        Since:
        " + NL + - "
        1.4
        " + NL + "
        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C3.html", "
        " + NL + "
        Comment." + NL + - "

        " + NL + "

        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "
        " + NL + - "
        Throws:
        " + NL + "
        " + - "java.io.IOException
        See Also:" + - "
        " + - "C1.setUndecorated(boolean)
        " + NL + - "
        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + - "
        Deprecated. As of JDK version " + - "1.5, replaced by" + NL + - " " + - "setUndecorated(boolean).
        " + - "
        This field indicates whether the C1 is undecorated." + NL + - "

        " + NL + "

        " + NL + "
         
        " + NL + - "
        " + NL + "
        Since:
        " + NL + - "
        1.4
        " + NL + "
        See Also:" + - "
        " + - "C1.setUndecorated(boolean)
        " + NL + - "
        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + - "
        Deprecated. As of JDK version" + - " 1.5, replaced by" + NL + - " " + - "setUndecorated(boolean)." + NL + "

        " + NL + - "

        Reads the object stream." + NL + "

        " + NL + - "

        " + NL + "
        " + NL + "
        Throws:" + - "
        " + NL + "
        " + - "IOException
        " + NL + - "
        java.io.IOException
        " + NL + - "
        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + - "
        Deprecated. 
        " + - "The name for this class." + NL + "

        " + NL + "

        " + NL + - "
         
        " + NL + "
        "}}; - - // Test with -nocomment option. The ClassDocs and serialized form should - // have properly nested definition list tags enclosing deprecated - // information and should not display definition lists for comments - // and tags. - private static final String[][] TEST_NOCMNT = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + "
        " + - "Deprecated. As of JDK version 1.5, replaced by" + NL + - " " + - "setUndecorated(boolean).
        "}, - {BUG_ID + FS + "pkg1" + FS + "C2.html", "
        " + NL + - "
        Deprecated. As of JDK version" + - " 1.5, replaced by" + NL + - " " + - "setUndecorated(boolean)." + NL + "

        " + NL + - "

        "}, - {BUG_ID + FS + "pkg1" + FS + "C5.html", "
        " + NL +
        -                 "protected C5()
        " + NL + "
        " + NL + - "
        Deprecated. 
        "}, - {BUG_ID + FS + "pkg1" + FS + "C5.html", "
        " + NL +
        -                 "public void printInfo()
        " + NL + "
        " + NL + - "
        Deprecated. 
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "boolean " +
        -                 "undecorated
        " + NL + "
        " + NL + "
        " + - "Deprecated. As of JDK version 1.5, replaced by" + NL + - " " + - "setUndecorated(boolean).
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "
        " + - "Deprecated. As of JDK version" + - " 1.5, replaced by" + NL + - " " + - "setUndecorated(boolean)." + NL + "

        " + NL + - "

        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "int " +
        -                 "publicKey
        " + NL + "
        " + NL + "
        " + - "Deprecated. 
        "}}; + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "
        " + + "
        Since:
        " + NL + + "
        JDK1.0
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        Since:
        " + NL + + "
        JDK1.0
        " + NL + "
        See Also:
        " + + "
        " + + "C2, " + NL + "" + + "Serialized Form
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        Since:
        " + NL + + "
        1.4
        " + NL + + "
        See Also:
        " + + "" + + "setUndecorated(boolean)
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        Parameters:
        title" + + " - the title
        test - boolean value" + + "
        " + NL + "
        Throws:
        " + NL + + "
        java.lang.IllegalArgumentException - if the " + + "owner's" + NL + + " GraphicsConfiguration is not from a screen " + + "device
        " + NL + "
        HeadlessException
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        Parameters:
        undecorated" + + " - true if no decorations are" + NL + + " to be enabled;" + NL + " false " + + "if decorations are to be enabled.
        Since:" + + "
        " + NL + "
        1.4
        " + NL + + "
        See Also:
        " + + "readObject()" + + "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        Throws:
        " + NL + + "
        java.io.IOException
        See Also:" + + "
        " + + "setUndecorated(boolean)
        "}, + {BUG_ID + FS + "pkg1" + FS + "C2.html", "
        Parameters:" + + "
        set - boolean
        " + + "Since:
        " + NL + "
        1.4
        "}, + {BUG_ID + FS + "serialized-form.html", "
        Throws:" + + "
        " + NL + "
        " + + "java.io.IOException
        See Also:" + + "
        " + + "C1.setUndecorated(boolean)
        "}, + {BUG_ID + FS + "serialized-form.html", "Deprecated." + + " As of JDK version 1.5, replaced by" + NL + + " " + + "setUndecorated(boolean)." + NL + + "
        This field indicates whether the C1 is " + + "undecorated.
        " + NL + " " + NL + "
        Since:
        " + NL + + "
        1.4
        " + NL + "
        See Also:" + + "
        " + + "C1.setUndecorated(boolean)
        "}, + {BUG_ID + FS + "serialized-form.html", "Deprecated." + + " As of JDK version 1.5, replaced by" + NL + + " " + + "setUndecorated(boolean)." + NL + + "
        Reads the object stream.
        " + NL + + "
        Throws:" + + "
        " + NL + "
        " + + "IOException
        " + NL + + "
        java.io.IOException
        "}, + {BUG_ID + FS + "serialized-form.html", "Deprecated." + + " " + NL + + "
        The name for this class.
        "}}; // Test with -nodeprecated option. The ClassDocs should have properly nested // definition list tags enclosing comments and tags. The ClassDocs should not @@ -196,138 +121,104 @@ public class TestHtmlDefinitionListTag extends JavadocTester { // should display properly nested definition list tags for comments, tags // and deprecated information. private static final String[][] TEST_NODEPR = { - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "
        " + NL + - "
        Since:
        " + NL + - "
        JDK1.0
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + - "
        Since:
        " + NL + - "
        JDK1.0
        " + NL + "
        See Also:
        " + - "" + - "C2, " + NL + - "" + - "Serialized Form
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + - "
        Constructor." + NL + "

        " + NL + "

        " + NL + - "
        " + NL + "
        Parameters:
        " + - "title - the title
        test" + - " - boolean value
        " + NL + "
        Throws:
        " + NL + - "
        java.lang.IllegalArgumentException" + - " - if the owner's" + NL + " GraphicsConfiguration" + - " is not from a screen device
        " + NL +"
        " + - "HeadlessException
        " + NL + "
        " + NL + - "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + - "
        Method comments." + NL + "

        " + NL + - "

        " + NL + "
        " + NL + "
        Parameters:" + - "
        undecorated - true" + + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "
        " + + "
        Since:
        " + NL + + "
        JDK1.0
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        Since:" + + "
        " + NL + "
        JDK1.0
        " + NL + "
        See Also:" + + "
        " + + "C2, " + NL + "" + + "Serialized Form
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        Parameters:" + + "
        title - the title
        " + + "test - boolean value
        " + NL + "
        Throws:" + + "
        " + NL + "
        java.lang.IllegalArgumentException" + + " - if the owner's" + NL + " GraphicsConfiguration" + + " is not from a screen device
        " + NL + "
        " + + "HeadlessException
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        Parameters:" + + "
        undecorated - true" + " if no decorations are" + NL + " to be enabled;" + NL + " false if decorations are to be enabled." + - "
        Since:
        " + NL + - "
        1.4
        " + NL + "
        See Also:
        " + - "
        " + - "readObject()
        " + NL + "
        " + NL + - "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + "
        " + NL + - "
        Throws:
        " + NL + "
        " + - "java.io.IOException
        See Also:" + - "
        " + - "" + - "setUndecorated(boolean)
        " + NL + - "
        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "
        " + NL + - "
        No modal exclusion." + NL + "

        " + NL +"

        " + NL + - "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C2.html", "
        " + NL + "
        Constructor." + NL + - "

        " + NL +"

        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C3.html", "
        " + NL + "
        Comment." + NL + - "

        " + NL + "

        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "
        " + NL + - "
        Throws:
        " + NL + "
        " + - "java.io.IOException
        See Also:" + - "
        " + - "C1.setUndecorated(boolean)
        " + NL + - "
        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + - "
        Deprecated. As of JDK version " + - "1.5, replaced by" + NL + - " " + - "setUndecorated(boolean).
        " + - "
        This field indicates whether the C1 is undecorated." + NL + - "

        " + NL + "

        " + NL + "
         
        " + NL + - "
        " + NL + "
        Since:
        " + NL + - "
        1.4
        " + NL + "
        See Also:" + - "
        " + - "C1.setUndecorated(boolean)
        " + NL + - "
        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + - "
        Deprecated. As of JDK version" + - " 1.5, replaced by" + NL + - " " + - "setUndecorated(boolean)." + NL + "

        " + NL + - "

        Reads the object stream." + NL + "

        " + NL + - "

        " + NL + "
        " + NL + "
        Throws:" + - "
        " + NL + "
        " + - "IOException
        " + NL + - "
        java.io.IOException
        " + NL + - "
        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + - "
        Deprecated. 
        " + - "The name for this class." + NL + "

        " + NL + "

        " + NL + - "
         
        " + NL + "
        "}}; + "
        Since:
        " + NL + "
        1.4
        " + NL + + "
        See Also:
        " + + "readObject()
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        Throws:" + + "
        " + NL + "
        java.io.IOException
        " + + "See Also:
        " + + "setUndecorated(boolean)
        "}, + {BUG_ID + FS + "serialized-form.html", "
        Throws:" + + "
        " + NL + "
        " + + "java.io.IOException
        See Also:" + + "
        " + + "C1.setUndecorated(boolean)
        "}, + {BUG_ID + FS + "serialized-form.html", "Deprecated." + + " As of JDK version 1.5, replaced by" + NL + + " " + + "setUndecorated(boolean)." + NL + + "
        This field indicates whether the C1 is " + + "undecorated.
        " + NL + " " + NL + "
        Since:
        " + NL + + "
        1.4
        " + NL + "
        See Also:" + + "
        " + + "C1.setUndecorated(boolean)
        "}, + {BUG_ID + FS + "serialized-form.html", "Deprecated." + + " As of JDK version 1.5, replaced by" + NL + + " " + + "setUndecorated(boolean)." + NL + + "
        Reads the object stream.
        " + NL + + "
        Throws:" + + "
        " + NL + "
        " + + "IOException
        " + NL + + "
        java.io.IOException
        "}, + {BUG_ID + FS + "serialized-form.html", "Deprecated." + + " " + NL + "
        " + + "The name for this class.
        "}}; // Test with -nocomment and -nodeprecated options. The ClassDocs whould - // not display definition lists for any member details. The serialized - // form should display properly nested definition list tags for - // deprecated information only. + // not display definition lists for any member details. private static final String[][] TEST_NOCMNT_NODEPR = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + "public void " +
        -                 "readObject()" + NL + "                throws" +
        -                 " java.io.IOException
        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C2.html", "
        " +NL + "public " +
        -                 "C2()
        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "
        " + NL +
        -                 "public static final " +
        -                 "C1.ModalExclusionType " +
        -                 "APPLICATION_EXCLUDE
        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "boolean " +
        -                 "undecorated
        " + NL + "
        " + NL + "
        " + - "Deprecated. As of JDK version 1.5, replaced by" + NL + - " " + - "setUndecorated(boolean).
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "
        " + - "Deprecated. As of JDK version" + + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        public void readObject()" + NL +
        +                 "                throws java.io.IOException
        " + NL + ""}, + {BUG_ID + FS + "pkg1" + FS + "C2.html", "
        public C2()
        " + NL + + ""}, + {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "
        public " +
        +                 "static final C1.ModalExclusionType " +
        +                 "APPLICATION_EXCLUDE
        " + NL + ""}, + {BUG_ID + FS + "serialized-form.html", "
        boolean " +
        +                 "undecorated
        " + NL + "
        " + + "Deprecated. As of JDK version 1.5, replaced by" + NL + + " " + + "setUndecorated(boolean).
        " + NL + ""}, + {BUG_ID + FS + "serialized-form.html", "" + + "Deprecated. As of JDK version" + " 1.5, replaced by" + NL + - " " + - "setUndecorated(boolean)." + NL + "

        " + NL + - "

        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "int " +
        -                 "publicKey
        " + NL + "
        " + NL + "
        " + - "Deprecated. 
        "}}; + " " + + "setUndecorated(boolean).
        " + NL + ""}}; // Test for valid HTML generation which should not comprise of empty // definition list tags. private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "
        "}, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "
        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "
        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C2.html", "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C2.html", "
        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "
        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C3.html", "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C3.html", "
        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C4.html", "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C4.html", "
        " + NL + "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C5.html", "
        "}, - {BUG_ID + FS + "pkg1" + FS + "C5.html", "
        " + NL + "
        "}, - {BUG_ID + FS + "overview-tree.html", "
        "}, - {BUG_ID + FS + "overview-tree.html", "
        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "
        "}}; + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "
        "}, + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "
        " + NL + "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
        " + NL + "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "
        " + NL + "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C2.html", "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C2.html", "
        " + NL + "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "
        " + NL + "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C3.html", "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C3.html", "
        " + NL + "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C4.html", "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C4.html", "
        " + NL + "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C5.html", "
        "}, + {BUG_ID + FS + "pkg1" + FS + "C5.html", "
        " + NL + "
        "}, + {BUG_ID + FS + "overview-tree.html", "
        "}, + {BUG_ID + FS + "overview-tree.html", "
        " + NL + "
        "}, + {BUG_ID + FS + "serialized-form.html", "
        "}, + {BUG_ID + FS + "serialized-form.html", "
        " + NL + "
        "}}; private static final String[] ARGS1 = new String[] { @@ -355,7 +246,7 @@ public class TestHtmlDefinitionListTag extends JavadocTester { run(tester, ARGS1, TEST_ALL, NEGATED_TEST); run(tester, ARGS1, TEST_CMNT_DEPR, NEGATED_TEST); run(tester, ARGS2, TEST_ALL, NEGATED_TEST); - run(tester, ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR); + run(tester, ARGS2, NO_TEST, TEST_CMNT_DEPR); run(tester, ARGS3, TEST_ALL, NEGATED_TEST); run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR); run(tester, ARGS4, TEST_ALL, NEGATED_TEST); diff --git a/langtools/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java b/langtools/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java new file mode 100644 index 00000000000..d6e16e02beb --- /dev/null +++ b/langtools/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6851834 + * @summary This test verifies the HTML document generation for javadoc output. + * @author Bhavesh Patel + * @build TestHtmlDocument + * @run main TestHtmlDocument + */ + +import java.io.*; +import com.sun.tools.doclets.formats.html.markup.*; + +/** + * The class reads each file, complete with newlines, into a string to easily + * compare the existing markup with the generated markup. + */ +public class TestHtmlDocument { + + private static final String BUGID = "6851834"; + private static final String BUGNAME = "TestHtmlDocument"; + private static final String FS = System.getProperty("file.separator"); + private static final String LS = System.getProperty("line.separator"); + private static String srcdir = System.getProperty("test.src", "."); + + // Entry point + public static void main(String[] args) throws IOException { + // Check whether the generated markup is same as the existing markup. + if (generateHtmlTree().equals(readFileToString(srcdir + FS + "testMarkup.html"))) { + System.out.println("\nTest passed for bug " + BUGID + " (" + BUGNAME + ")\n"); + } else { + throw new Error("\nTest failed for bug " + BUGID + " (" + BUGNAME + ")\n"); + } + } + + // Generate the HTML output using the HTML document generation within doclet. + public static String generateHtmlTree() { + // Document type for the HTML document + DocType htmlDocType = DocType.Transitional(); + HtmlTree html = new HtmlTree(HtmlTag.HTML); + HtmlTree head = new HtmlTree(HtmlTag.HEAD); + HtmlTree title = new HtmlTree(HtmlTag.TITLE); + // String content within the document + StringContent titleContent = new StringContent("Markup test"); + title.addContent(titleContent); + head.addContent(title); + // Test META tag + HtmlTree meta = new HtmlTree(HtmlTag.META); + meta.addAttr(HtmlAttr.NAME, "keywords"); + meta.addAttr(HtmlAttr.CONTENT, "testContent"); + head.addContent(meta); + // Test invalid META tag + HtmlTree invmeta = new HtmlTree(HtmlTag.META); + head.addContent(invmeta); + // Test LINK tag + HtmlTree link = new HtmlTree(HtmlTag.LINK); + link.addAttr(HtmlAttr.REL, "testRel"); + link.addAttr(HtmlAttr.HREF, "testLink.html"); + head.addContent(link); + // Test invalid LINK tag + HtmlTree invlink = new HtmlTree(HtmlTag.LINK); + head.addContent(invlink); + html.addContent(head); + // Comment within the document + Comment bodyMarker = new Comment("======== START OF BODY ========"); + html.addContent(bodyMarker); + HtmlTree body = new HtmlTree(HtmlTag.BODY); + Comment pMarker = new Comment("======== START OF PARAGRAPH ========"); + body.addContent(pMarker); + HtmlTree p = new HtmlTree(HtmlTag.P); + StringContent bodyContent = new StringContent( + "This document is generated from sample source code and HTML " + + "files with examples of a wide variety of Java language constructs: packages, " + + "subclasses, subinterfaces, nested classes, nested interfaces," + + "inheriting from other packages, constructors, fields," + + "methods, and so forth. "); + p.addContent(bodyContent); + StringContent anchorContent = new StringContent("Click Here"); + p.addContent(HtmlTree.A("testLink.html", anchorContent)); + StringContent pContent = new StringContent(" to out a link."); + p.addContent(pContent); + body.addContent(p); + HtmlTree p1 = new HtmlTree(HtmlTag.P); + // Test another version of A tag. + HtmlTree anchor = new HtmlTree(HtmlTag.A); + anchor.addAttr(HtmlAttr.HREF, "testLink.html"); + anchor.addAttr(HtmlAttr.NAME, "Another version of a tag"); + p1.addContent(anchor); + body.addContent(p1); + // Test for empty tags. + HtmlTree dl = new HtmlTree(HtmlTag.DL); + html.addContent(dl); + // Test for empty nested tags. + HtmlTree dlTree = new HtmlTree(HtmlTag.DL); + dlTree.addContent(new HtmlTree(HtmlTag.DT)); + dlTree.addContent(new HtmlTree (HtmlTag.DD)); + html.addContent(dlTree); + HtmlTree dlDisplay = new HtmlTree(HtmlTag.DL); + dlDisplay.addContent(new HtmlTree(HtmlTag.DT)); + HtmlTree dd = new HtmlTree (HtmlTag.DD); + StringContent ddContent = new StringContent("Test DD"); + dd.addContent(ddContent); + dlDisplay.addContent(dd); + body.addContent(dlDisplay); + StringContent emptyString = new StringContent(""); + body.addContent(emptyString); + Comment emptyComment = new Comment(""); + body.addContent(emptyComment); + HtmlTree hr = new HtmlTree(HtmlTag.HR); + body.addContent(hr); + html.addContent(body); + HtmlDocument htmlDoc = new HtmlDocument(htmlDocType, html); + return htmlDoc.toString(); + } + + // Read the file into a String + public static String readFileToString(String filename) throws IOException { + File file = new File(filename); + if ( !file.exists() ) { + System.out.println("\nFILE DOES NOT EXIST: " + filename); + } + BufferedReader in = new BufferedReader(new FileReader(file)); + StringBuilder fileString = new StringBuilder(); + // Create an array of characters the size of the file + try { + String line; + while ((line = in.readLine()) != null) { + fileString.append(line); + fileString.append(LS); + } + } finally { + in.close(); + } + return fileString.toString(); + } +} diff --git a/langtools/test/com/sun/javadoc/testHtmlDocument/testLink.html b/langtools/test/com/sun/javadoc/testHtmlDocument/testLink.html new file mode 100644 index 00000000000..a93d9cbba0c --- /dev/null +++ b/langtools/test/com/sun/javadoc/testHtmlDocument/testLink.html @@ -0,0 +1,9 @@ + + + +Markup test + + +This is a test for link. + + diff --git a/langtools/test/com/sun/javadoc/testHtmlDocument/testMarkup.html b/langtools/test/com/sun/javadoc/testHtmlDocument/testMarkup.html new file mode 100644 index 00000000000..4dc92027917 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testHtmlDocument/testMarkup.html @@ -0,0 +1,18 @@ + + + +Markup test + + + + + + +

        This document is generated from sample source code and HTML files with examples of a wide variety of Java language constructs: packages, subclasses, subinterfaces, nested classes, nested interfaces,inheriting from other packages, constructors, fields,methods, and so forth. Click Here to <test> out a link.

        +

        +
        +
        Test DD
        +
        +
        + + diff --git a/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java b/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java index 0ac360155f5..eef768a445d 100644 --- a/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java +++ b/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class TestHtmlStrongTag extends JavadocTester { private static final String BUG_ID = "6786028"; private static final String[][] TEST1 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "See Also:"}}; + {BUG_ID + FS + "pkg1" + FS + "C1.html", "See Also:"}}; private static final String[][] NEGATED_TEST1 = { {BUG_ID + FS + "pkg1" + FS + "C1.html", "Method Summary"}, {BUG_ID + FS + "pkg1" + FS + "C1.html", ""}, diff --git a/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java b/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java index ecb6a645d72..df87249969e 100644 --- a/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java +++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,139 +50,128 @@ public class TestHtmlTableTags extends JavadocTester { //Package summary {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "" }, {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "
        " }, {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "
        " }, {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "
        " }, // Class documentation {BUG_ID + FS + "pkg1" + FS + "C1.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg1" + FS + "C1.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg2" + FS + "C2.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg2" + FS + "C2.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg2" + FS + "C3.html", - "
        " }, {BUG_ID + FS + "pkg2" + FS + "C4.html", - "
        " }, // Class use documentation {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "I1.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html", - "
        " + "
        " }, // Package use documentation {BUG_ID + FS + "pkg1" + FS + "package-use.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg1" + FS + "package-use.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg2" + FS + "package-use.html", - "
        " + "
        " }, {BUG_ID + FS + "pkg2" + FS + "package-use.html", - "
        " + "
        " }, // Deprecated {BUG_ID + FS + "deprecated-list.html", - "
        " + "
        " }, {BUG_ID + FS + "deprecated-list.html", - "
        " + "
        " }, // Constant values {BUG_ID + FS + "constant-values.html", - "
        " }, // Overview Summary {BUG_ID + FS + "overview-summary.html", - "
        " }, @@ -192,125 +181,117 @@ public class TestHtmlTableTags extends JavadocTester { //Package summary {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "" + "" }, {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "" + "" }, // Class documentation {BUG_ID + FS + "pkg1" + FS + "C1.html", - "" + "" }, {BUG_ID + FS + "pkg1" + FS + "C1.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "C2.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "C2.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "C3.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "C4.html", - "" + "" }, // Class use documentation {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "I1.html", - "" + "" }, {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "" + "" }, {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html", - "" + "" }, // Package use documentation {BUG_ID + FS + "pkg1" + FS + "package-use.html", - "" + "" }, {BUG_ID + FS + "pkg1" + FS + "package-use.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "package-use.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "package-use.html", - "" + "" }, // Deprecated {BUG_ID + FS + "deprecated-list.html", - "" + "" }, {BUG_ID + FS + "deprecated-list.html", - "" + "" }, // Constant values {BUG_ID + FS + "constant-values.html", - "" + "" }, // Overview Summary {BUG_ID + FS + "overview-summary.html", - "" + "" }, /* @@ -319,135 +300,115 @@ public class TestHtmlTableTags extends JavadocTester { //Package summary {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "" + NL + "" + "" + NL + "" }, {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "" + NL + "" + "" + NL + "" }, {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "" + NL + "" + "" + NL + "" }, {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "" + NL + "" + "" + NL + "" }, // Class documentation {BUG_ID + FS + "pkg1" + FS + "C1.html", - "" + NL + "" + "" + NL + + "" }, {BUG_ID + FS + "pkg1" + FS + "C1.html", - "" + NL + "" + "" + NL + + "" }, {BUG_ID + FS + "pkg2" + FS + "C2.html", - "" + NL + "" + "" + NL + + "" }, {BUG_ID + FS + "pkg2" + FS + "C2.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "C3.html", - "" + NL + "" + "" + NL + + "" }, {BUG_ID + FS + "pkg2" + FS + "C4.html", - "" + NL + "" + "" + NL + + "" }, // Class use documentation {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "I1.html", - "" + NL + "" + "" + NL + + "" }, {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "" + NL + "" + "" + NL + + "" }, {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "" + NL + "" + "" + NL + + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html", - "" + NL + "" + "" + NL + + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html", - "" + NL + "" + "" + NL + + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html", - "" + NL + "" + "" + NL + + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html", - "" + NL + "" + "" + NL + + "" }, // Package use documentation {BUG_ID + FS + "pkg1" + FS + "package-use.html", - "" + NL + "" + "" + NL + + "" }, {BUG_ID + FS + "pkg1" + FS + "package-use.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "package-use.html", - "" + NL + "" + "" + NL + + "" }, {BUG_ID + FS + "pkg2" + FS + "package-use.html", - "" + "" }, // Deprecated {BUG_ID + FS + "deprecated-list.html", - "" + "" }, {BUG_ID + FS + "deprecated-list.html", - "" + "" }, // Constant values {BUG_ID + FS + "constant-values.html", - "" + NL + "" + NL + - "" + "" + NL + "Constant Field" + NL + + "" }, // Overview Summary {BUG_ID + FS + "overview-summary.html", - "" + NL + "" + "" + NL + "" } }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java b/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java index 8fe1734b00a..eb1b316bc30 100644 --- a/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java +++ b/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,20 +40,20 @@ public class TestHtmlTag extends JavadocTester { private static final String BUG_ID = "6786682"; private static final String[][] TEST1 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", ""}, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", ""}}; + {BUG_ID + FS + "pkg1" + FS + "C1.html", ""}, + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", ""}}; private static final String[][] NEGATED_TEST1 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", ""}}; + {BUG_ID + FS + "pkg1" + FS + "C1.html", ""}}; private static final String[][] TEST2 = { - {BUG_ID + FS + "pkg2" + FS + "C2.html", ""}, - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", ""}}; + {BUG_ID + FS + "pkg2" + FS + "C2.html", ""}, + {BUG_ID + FS + "pkg2" + FS + "package-summary.html", ""}}; private static final String[][] NEGATED_TEST2 = { - {BUG_ID + FS + "pkg2" + FS + "C2.html", ""}}; + {BUG_ID + FS + "pkg2" + FS + "C2.html", ""}}; private static final String[][] TEST3 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", ""}, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", ""}}; + {BUG_ID + FS + "pkg1" + FS + "C1.html", ""}, + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", ""}}; private static final String[][] NEGATED_TEST3 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", ""}}; + {BUG_ID + FS + "pkg1" + FS + "C1.html", ""}}; private static final String[] ARGS1 = new String[] { diff --git a/langtools/test/com/sun/javadoc/testIndex/TestIndex.java b/langtools/test/com/sun/javadoc/testIndex/TestIndex.java index 213cf8d6fa7..f38982807fa 100644 --- a/langtools/test/com/sun/javadoc/testIndex/TestIndex.java +++ b/langtools/test/com/sun/javadoc/testIndex/TestIndex.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,35 +48,34 @@ public class TestIndex extends JavadocTester { private static final String[][] TEST = { //Make sure the horizontal scroll bar does not appear in class frame. {BUG_ID + FS + "index.html", - ""}, + ""}, //Test index-all.html {BUG_ID + FS + "index-all.html", - "C" + - " - Class in pkg"}, + "C" + + " - Class in pkg"}, {BUG_ID + FS + "index-all.html", - "" + - "Interface - Interface in " + - "pkg"}, + "" + + "Interface - Interface in " + + "pkg"}, {BUG_ID + FS + "index-all.html", - "" + - "AnnotationType - Annotation Type in " + - "pkg"}, + "" + + "AnnotationType - Annotation Type in " + + "pkg"}, {BUG_ID + FS + "index-all.html", - "" + - "Coin - Enum in " + - "pkg"}, + "" + + "Coin - Enum in " + + "pkg"}, {BUG_ID + FS + "index-all.html", - "Class in <Unnamed>"}, + "Class in <Unnamed>"}, {BUG_ID + FS + "index-all.html", - "
        Java - " + NL + - "Static variable in class pkg.C" + NL + - "
         
        " + NL + NL + - "
        JDK - " + NL + - "Static variable in class pkg.C" + NL + - "
         
        "}, + "
        " + NL + "
        " + + "Java - Static variable in class pkg.C
        " + NL + "
         
        " + NL + + "
        JDK " + + "- Static variable in class pkg." + + "C
        " + NL + "
         
        " + NL + "
        "}, }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java b/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java index ada8d5fc81b..806f5015ccd 100644 --- a/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java +++ b/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,10 +37,10 @@ public class TestInlineLinkLabel extends JavadocTester { private static final String BUG_ID = "4524136"; private static final String[][] TEST = { //Search for the label to the package link. - {BUG_ID + FS + "pkg" + FS + "C1.html" , "Here is a link to a package"}, + {BUG_ID + FS + "pkg" + FS + "C1.html" , "Here is a link to a package"}, //Search for the label to the class link - {BUG_ID + FS + "pkg" + FS + "C1.html" , "Here is a link to a class"} + {BUG_ID + FS + "pkg" + FS + "C1.html" , "Here is a link to a class"} }; private static final String[][] NEGATED_TEST = NO_TEST; private static final String[] ARGS = diff --git a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java index bec349bfa23..d0f1afc2bf3 100644 --- a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java +++ b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,51 +48,62 @@ public class TestInterface extends JavadocTester { //Input for string search tests. private static final String[][] TEST = { {BUG_ID + FS + "pkg" + FS + "Interface.html", - "int method()"}, + "
        int method()
        "}, {BUG_ID + FS + "pkg" + FS + "Interface.html", - "static final int field"}, + "
        static final int field
        "}, // Make sure known implementing class list is correct and omits type parameters. {BUG_ID + FS + "pkg" + FS + "Interface.html", - "
        All Known Implementing Classes:
        " + - "
        Child, " + - "" + - "Parent
        "}, + "
        " + NL + "
        All Known Implementing Classes:
        " + NL + + "
        Child" + + ", Parent" + + "
        " + NL + "
        "}, // Make sure "All Implemented Interfaces": has substituted type parameters {BUG_ID + FS + "pkg" + FS + "Child.html", - "All Implemented Interfaces:
        " + - "" + - "Interface<T>" + "
        " + NL + "
        All Implemented Interfaces:
        " + NL + + "
        " + + "Interface<T>
        " + NL + "
        " }, //Make sure Class Tree has substituted type parameters. {BUG_ID + FS + "pkg" + FS + "Child.html", - "
        " + NL +
        -            "java.lang.Object" + NL +
        -            "  \"extendedpkg.Parent<T>" + NL +
        -            "      \"extendedpkg.Child<T>" + NL +
        -            "
        " + "
          " + NL + "
        • java.lang.Object
        • " + NL + + "
        • " + NL + "
            " + NL + + "
          • " + + "pkg.Parent<T>
          • " + NL + "
          • " + NL + + "
              " + NL + "
            • pkg.Child<T>
            • " + NL + + "
            " + NL + "
          • " + NL + "
          " + NL + "
        • " + NL + "
        " }, //Make sure "Direct Know Subclasses" omits type parameters {BUG_ID + FS + "pkg" + FS + "Parent.html", - "Direct Known Subclasses:
        Child" + "
        " + NL + "
        Direct Known Subclasses:
        " + NL + + "
        Child" + + "
        " + NL + "
        " }, //Make sure "Specified By" has substituted type parameters. {BUG_ID + FS + "pkg" + FS + "Child.html", - "Specified by:
        method in interface Interface<T>" + "
        Specified by:
        " + NL + + "
        method" + + " in interface " + + "" + + "Interface<" + + "T>
        " }, //Make sure "Overrides" has substituted type parameters. {BUG_ID + FS + "pkg" + FS + "Child.html", - "Overrides:
        method in class Parent<T>" + "
        Overrides:
        " + NL + + "
        method" + + " in class Parent<T>
        " }, }; private static final String[][] NEGATED_TEST = { {BUG_ID + FS + "pkg" + FS + "Interface.html", - "public int method()"}, + "public int method()"}, {BUG_ID + FS + "pkg" + FS + "Interface.html", - "public static final int field"}, + "public static final int field"}, }; /** diff --git a/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java b/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java index cbe14b77eb7..54deaad0bc7 100644 --- a/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java +++ b/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +45,11 @@ public class TestJavascript extends JavadocTester { //Input for string search tests. private static final String[][] TEST = { {BUG_ID + FS + "pkg" + FS + "C.html", - "FRAMES"}, + "FRAMES"}, {BUG_ID + FS + "TestJavascript.html", - "FRAMES"}, + "FRAMES"}, {BUG_ID + FS + "index.html", - ""}, + ""}, //Make sure title javascript only runs if is-external is not true {BUG_ID + FS + "pkg" + FS + "C.html", diff --git a/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java b/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java index d2298437e34..159d5f23819 100644 --- a/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java +++ b/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,25 +46,25 @@ public class TestLinkOption extends JavadocTester { private static final String[][] TEST1 = { {BUG_ID + "-1" + FS + "pkg" + FS + "C.html", - "Link to String Class" + "Link to String Class" }, //Make sure the parameters are indented properly when the -link option is used. {BUG_ID + "-1" + FS + "pkg" + FS + "C.html", "(int p1," + NL + - " int p2," + NL + - " int p3)" + " int p2," + NL + + " int p3)" }, {BUG_ID + "-1" + FS + "pkg" + FS + "C.html", "(int p1," + NL + - " int p2," + NL + - " " + - "Object p3)" + " int p2," + NL + + " " + + "Object p3)" }, {BUG_ID + "-1" + FS + "java" + FS + "lang" + FS + "StringBuilderChild.html", - "public abstract class StringBuilderChild" + NL + - "extends Object" + "
        public abstract class StringBuilderChild" + NL +
        +                "extends Object
        " }, }; @@ -79,8 +79,8 @@ public class TestLinkOption extends JavadocTester { private static final String[][] TEST2 = { {BUG_ID + "-2" + FS + "pkg2" + FS + "C2.html", - "This is a link to Class C." + "This is a link to Class C." } }; private static final String[][] NEGATED_TEST2 = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java b/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java index ac7ae6db1c2..cb89e5a3298 100644 --- a/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java +++ b/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,20 +46,22 @@ public class TestLinkTaglet extends JavadocTester { //Input for string search tests. private static final String[][] TEST = { {BUG_ID + FS + "pkg" + FS + "C.html", - "Qualified Link: C.InnerC.
        \n" + - " Unqualified Link1: C.InnerC.
        \n" + - " Unqualified Link2: C.InnerC.
        \n" + - " Qualified Link: method(pkg.C.InnerC, pkg.C.InnerC2).
        \n" + - " Unqualified Link: method(C.InnerC, C.InnerC2).
        \n" + - " Unqualified Link: method(InnerC, InnerC2).
        " + "Qualified Link: C.InnerC.
        \n" + + " Unqualified Link1: C.InnerC.
        \n" + + " Unqualified Link2: C.InnerC.
        \n" + + " Qualified Link: method(pkg.C.InnerC, pkg.C.InnerC2).
        \n" + + " Unqualified Link: method(C.InnerC, C.InnerC2).
        \n" + + " Unqualified Link: method(InnerC, InnerC2).
        " }, {BUG_ID + FS + "pkg" + FS + "C.InnerC.html", - "Link to member in outer class: C.MEMBER
        \n" + - " Link to member in inner class: C.InnerC2.MEMBER2
        \n" + - " Link to another inner class: C.InnerC2" + "Link to member in outer class: C.MEMBER
        \n" + + " Link to member in inner class: C.InnerC2.MEMBER2
        \n" + + " Link to another inner class: C.InnerC2" }, {BUG_ID + FS + "pkg" + FS + "C.InnerC2.html", - "Enclosing class:
        C" + "
        " + NL + "
        Enclosing class:
        " + NL + + "
        C
        " + NL + + "
        " }, }; private static final String[][] NEGATED_TEST = { diff --git a/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java b/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java index fac9ec81638..24fdd874cde 100644 --- a/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java +++ b/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ public class TestLinkToSerialForm extends JavadocTester { private static final String BUG_ID = "4521661"; private static final String[][] TEST = { - {BUG_ID + FS + "serialized-form.html", ""}, - {BUG_ID + FS + "pkg" + FS + "C.html", ""} + {BUG_ID + FS + "serialized-form.html", ""}, + {BUG_ID + FS + "pkg" + FS + "C.html", ""} }; private static final String[][] NEGATED_TEST = NO_TEST; private static final String[] ARGS = diff --git a/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java index 2819b254202..47873bc3433 100644 --- a/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java +++ b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,55 +40,57 @@ public class TestMemberInheritence extends JavadocTester { private static final String[][] TEST = { //Public field should be inherited {BUG_ID + FS + "pkg" + FS + "SubClass.html", - ""}, + ""}, //Public method should be inherited {BUG_ID + FS + "pkg" + FS + "SubClass.html", - ""}, + ""}, //Public inner class should be inherited. {BUG_ID + FS + "pkg" + FS + "SubClass.html", - ""}, + ""}, //Protected field should be inherited {BUG_ID + FS + "pkg" + FS + "SubClass.html", - ""}, + ""}, //Protected method should be inherited {BUG_ID + FS + "pkg" + FS + "SubClass.html", - ""}, + ""}, //Protected inner class should be inherited. {BUG_ID + FS + "pkg" + FS + "SubClass.html", - ""}, + ""}, // New labels as of 1.5.0 {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "Nested classes/interfaces inherited from class pkg." + - "" + - "BaseClass"}, + "Nested classes/interfaces inherited from class pkg." + + "BaseClass"}, {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "Nested classes/interfaces inherited from interface pkg." + - "" + - "BaseInterface"}, + "Nested classes/interfaces inherited from interface pkg." + + "BaseInterface"}, // Test overriding/implementing methods with generic parameters. {BUG_ID + FS + "pkg" + FS + "BaseClass.html", - "
        Specified by:
        getAnnotation in interface BaseInterface
        "+NL+""}, + "
        " + NL + "
        Specified by:
        " + NL + + "
        " + + "getAnnotation in interface " + + "" + + "BaseInterface
        " + NL + "
        "}, // Test diamond inheritence member summary (6256068) {BUG_ID + FS + "diamond" + FS + "Z.html", - ""}, + "aMethod"}, // Test that doc is inherited from closed parent (6270645) {BUG_ID + FS + "inheritDist" + FS + "C.html", - "          m1-B"}, + "
        m1-B
        "}, }; private static final String[][] NEGATED_TEST = { {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "staticMethod"}, + "staticMethod"}, }; private static final String[] ARGS = new String[] { diff --git a/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java b/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java index 7797fb2a3ee..e30f579d4fe 100644 --- a/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java +++ b/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,21 +48,23 @@ public class TestMemberSummary extends JavadocTester { private static final String[][] TEST = { // Check return type in member summary. {BUG_ID + FS + "pkg" + FS + "PublicChild.html", - " PublicChild" + NL + - "" + NL + + ""}, + {BUG_ID + FS + "pkg" + FS + "Coin.html", ""}, //Detail for enum constant {BUG_ID + FS + "pkg" + FS + "Coin.html", - "Dime"}, + "Dime"}, //Automatically insert documentation for values() and valueOf(). {BUG_ID + FS + "pkg" + FS + "Coin.html", "Returns an array containing the constants of this enum type,"}, @@ -77,38 +77,39 @@ public class TestNewLanguageFeatures extends JavadocTester { //================================= //Make sure the header is correct. {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "Class TypeParameters<E>"}, + "Class TypeParameters<E>"}, //Check class type parameters section. {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "
        Type Parameters:
        E - " + + "
        Type Parameters:
        E - " + "the type parameter for this class."}, //Type parameters in @see/@link {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "
        See Also:
        TypeParameters
        "}, + "
        See Also:
        " + + "" + + "TypeParameters
        "}, //Method that uses class type parameter. {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "(E param)"}, + "(E param)"}, //Method type parameter section. {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "Type Parameters:
        T - This is the first " + - "type parameter.
        V - This is the second type " + + "Type Parameters:
        T - This is the first " + + "type parameter.
        V - This is the second type " + "parameter."}, //Signature of method with type parameters {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "public <T extends java.util.List,V> " + - "java.lang.String[] methodThatHasTypeParameters"}, + "public <T extends java.util.List,V> " + + "java.lang.String[] methodThatHasTypeParameters"}, //Wildcard testing. {BUG_ID + FS + "pkg" + FS + "Wildcards.html", - "" + - "TypeParameters<? super java.lang.String> a"}, + "" + + "TypeParameters<? super java.lang.String> a"}, {BUG_ID + FS + "pkg" + FS + "Wildcards.html", - "" + - "TypeParameters<? extends java.lang.StringBuffer> b"}, + "" + + "TypeParameters<? extends java.lang.StringBuffer> b"}, {BUG_ID + FS + "pkg" + FS + "Wildcards.html", - "" + - "TypeParameters c"}, + "" + + "TypeParameters c"}, //Bad type parameter warnings. {WARNING_OUTPUT, "warning - @param argument " + "\"\" is not a type parameter name."}, @@ -117,18 +118,27 @@ public class TestNewLanguageFeatures extends JavadocTester { //Signature of subclass that has type parameters. {BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html", - "public class TypeParameterSubClass<T extends java.lang.String>" + - "" + NL + "extends TypeParameterSuperClass<T>"}, + "
        public class TypeParameterSubClass<T extends " +
        +                "java.lang.String>" + NL + "extends " +
        +                "" +
        +                "TypeParameterSuperClass<T>
        "}, //Interface generic parameter substitution //Signature of subclass that has type parameters. {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "All Implemented Interfaces:
        SubInterface<E>, SuperInterface<E>
        "}, + "
        " + NL + "
        All Implemented Interfaces:
        " + NL + + "
        " + + "SubInterface<E>, SuperInterface<E>
        " + NL + + "
        "}, {BUG_ID + FS + "pkg" + FS + "SuperInterface.html", - "All Known Subinterfaces:
        SubInterface<V>
        "}, + "
        " + NL + "
        All Known Subinterfaces:
        " + NL + + "
        " + + "SubInterface<V>
        " + NL + "
        "}, {BUG_ID + FS + "pkg" + FS + "SubInterface.html", - "All Superinterfaces:
        SuperInterface<V>
        "}, + "
        " + NL + "
        All Superinterfaces:
        " + NL + + "
        " + + "SuperInterface<V>
        " + NL + "
        "}, //================================= // VAR ARG TESTING @@ -137,39 +147,40 @@ public class TestNewLanguageFeatures extends JavadocTester { {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[][]... i)"}, {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[]...)"}, {BUG_ID + FS + "pkg" + FS + "VarArgs.html", - "" + - "TypeParameters... t"}, + "" + + "TypeParameters... t"}, //================================= // ANNOTATION TYPE TESTING //================================= //Make sure the summary links are correct. {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "SUMMARY: " + - "REQUIRED | " + - "OPTIONAL"}, + "
      • SUMMARY: 
      • " + NL + + "
      • " + + "REQUIRED | 
      • " + NL + "
      • " + + "OPTIONAL
      • "}, //Make sure the detail links are correct. {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "DETAIL: ELEMENT"}, + "
      • DETAIL: 
      • " + NL + + "
      • ELEMENT
      • "}, //Make sure the heading is correct. {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "Annotation Type AnnotationType"}, + "Annotation Type AnnotationType"}, //Make sure the signature is correct. {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "public @interface AnnotationType"}, + "public @interface AnnotationType"}, //Make sure member summary headings are correct. {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - ""}, + "

        Required Element Summary

        "}, {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - ""}, + "

        Optional Element Summary

        "}, //Make sure element detail heading is correct {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", "Element Detail"}, //Make sure default annotation type value is printed when necessary. {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "Default:
        \"unknown\"
        "}, + "
        " + NL + "
        Default:
        " + NL + "
        \"unknown\"
        " + NL + + "
        "}, //================================= // ANNOTATION TYPE USAGE TESTING @@ -177,51 +188,65 @@ public class TestNewLanguageFeatures extends JavadocTester { //PACKAGE {BUG_ID + FS + "pkg" + FS + "package-summary.html", - "@AnnotationType(optional=\"Package Annotation\"," + NL + - " required=1994)"}, + "@AnnotationType(optional=\"Package Annotation\"," + NL + + " required=1994)"}, //CLASS {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "" + - "@AnnotationType(optional=\"Class Annotation\","+NL + - " required=1994)"+NL + - "public class AnnotationTypeUsage" + NL + - "extends java.lang.Object"}, + "
        @AnnotationType(" +
        +                "optional" +
        +                "=\"Class Annotation\"," + NL +
        +                "                " +
        +                "required=1994)" + NL + "public class " +
        +                "AnnotationTypeUsage" + NL + "extends java.lang.Object
        "}, //FIELD {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "" + - "@AnnotationType(optional=\"Field Annotation\","+NL + - " required=1994)"+NL + - "public int field"}, + "
        @AnnotationType(" +
        +                "optional" +
        +                "=\"Field Annotation\"," + NL +
        +                "                " +
        +                "required=1994)" + NL + "public int field
        "}, //CONSTRUCTOR {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "" + - "@AnnotationType(optional=\"Constructor Annotation\","+NL + - " required=1994)"+NL + - "public AnnotationTypeUsage()"}, + "
        @AnnotationType(" +
        +                "optional" +
        +                "=\"Constructor Annotation\"," + NL +
        +                "                " +
        +                "required=1994)" + NL + "public AnnotationTypeUsage()
        "}, //METHOD {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "" + - "@AnnotationType(optional=\"Method Annotation\","+NL + - " required=1994)"+NL + - "public void method()"}, + "
        @AnnotationType(" +
        +                "optional" +
        +                "=\"Method Annotation\"," + NL +
        +                "                " +
        +                "required=1994)" + NL + "public void method()
        "}, //METHOD PARAMS {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "
        " + NL +
        -                "public void methodWithParams(@AnnotationType(optional=\"Parameter Annotation\",required=1994)" + NL +
        -                "                             int documented," + NL +
        -                "                             int undocmented)
        "}, + "
        public void methodWithParams(" +
        +                "" +
        +                "@AnnotationType(" +
        +                "optional=\"Parameter Annotation\",required=1994)" + NL +
        +                "                    int documented," + NL +
        +                "                    int undocmented)
        "}, //CONSTRUCTOR PARAMS {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "
        " + NL +
        -                                "public AnnotationTypeUsage(@AnnotationType(optional=\"Constructor Param Annotation\",required=1994)" + NL +
        -                                "                           int documented," + NL +
        -                "                           int undocmented)
        "}, + "
        public AnnotationTypeUsage(" +
        +                "@AnnotationType(" +
        +                "optional=\"Constructor Param Annotation\",required=1994)" + NL +
        +                "                   int documented," + NL +
        +                "                   int undocmented)
        "}, //================================= // ANNOTATION TYPE USAGE TESTING (All Different Types). @@ -229,59 +254,59 @@ public class TestNewLanguageFeatures extends JavadocTester { //Integer {BUG_ID + FS + "pkg1" + FS + "B.html", - "d=3.14,"}, + "d=3.14,"}, //Double {BUG_ID + FS + "pkg1" + FS + "B.html", - "d=3.14,"}, + "d=3.14,"}, //Boolean {BUG_ID + FS + "pkg1" + FS + "B.html", - "b=true,"}, + "b=true,"}, //String {BUG_ID + FS + "pkg1" + FS + "B.html", - "s=\"sigh\","}, + "s=\"sigh\","}, //Class {BUG_ID + FS + "pkg1" + FS + "B.html", - "c=Foo.class,"}, + "c=Foo.class,"}, //Bounded Class {BUG_ID + FS + "pkg1" + FS + "B.html", - "w=TypeParameterSubClass.class,"}, + "w=TypeParameterSubClass.class,"}, //Enum {BUG_ID + FS + "pkg1" + FS + "B.html", - "e=Penny,"}, + "e=Penny,"}, //Annotation Type {BUG_ID + FS + "pkg1" + FS + "B.html", - "a=@AnnotationType(optional=\"foo\",required=1994),"}, + "a=@AnnotationType(optional=\"foo\",required=1994),"}, //String Array {BUG_ID + FS + "pkg1" + FS + "B.html", - "sa={\"up\",\"down\"},"}, + "sa={\"up\",\"down\"},"}, //Primitive {BUG_ID + FS + "pkg1" + FS + "B.html", - "primitiveClassTest=boolean.class,"}, + "primitiveClassTest=boolean.class,"}, //XXX: Add array test case after this if fixed: //5020899: Incorrect internal representation of class-valued annotation elements //Make sure that annotations are surrounded by
         and 
        {BUG_ID + FS + "pkg1" + FS + "B.html", - "
        @A"},
        +                "
        @A"},
                     {BUG_ID + FS + "pkg1" + FS + "B.html",
        -                "public interface B
        "}, + "public interface B
        "}, //============================================================== // Handle multiple bounds. //============================================================== {BUG_ID + FS + "pkg" + FS + "MultiTypeParameters.html", - "public <T extends java.lang.Number & java.lang.Runnable> T foo(T t)"}, + "public <T extends java.lang.Number & java.lang.Runnable> T foo(T t)"}, //============================================================== // Test Class-Use Documenation for Type Parameters. @@ -289,347 +314,356 @@ public class TestNewLanguageFeatures extends JavadocTester { //ClassUseTest1: {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "ParamTest<Foo>" + "td class=\"colFirst\">ParamTest" + + "<Foo>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "ParamTest<Foo>" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html", - "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html", - "" }, //ClassUseTest2: > {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "ParamTest<Foo>" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "<T extends ParamTest<Foo3>>" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "<T extends ParamTest<Foo3>>" + "" }, //ClassUseTest3: >> {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", - "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", - "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", - "" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", - "<T extends ParamTest2<java.util.List<? extends Foo4>>>" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "" + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "<T extends ParamTest2<java.util.List<? extends Foo4>>>" + "" }, //Type parameters in constructor and method args {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "" + NL + - "" + NL + "" + NL + "" + NL + - "" + NL + - "" + NL + - "" + NL + - "" + NL + "" + NL + + "" + NL + + "" + NL + + "" + NL + "" + NL + "" + NL + + "" + NL + + "" + NL + + "" + NL + "" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "" + NL + - "" + NL + "" + NL + "" + NL + - "" + NL + - "" }, //================================= // Annotatation Type Usage //================================= {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "Packages with annotations of type " + - "AnnotationType" + NL + - "" + NL + "" + NL + "" + NL + "" + NL + - "" + NL + - "" + "" }, {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "Classes in pkg" + - " with annotations of type AnnotationType" + NL + - "" + NL + "" + NL + "" + NL + - "" + NL + - "" + NL + - "" + NL + - "" }, {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "Fields in pkg" + - " with annotations of type AnnotationType" + NL + - "" + NL + "" + NL + "" + NL + - "" + NL + - "" + NL + - "" + NL + - "" }, {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "Methods in pkg" + - " with annotations of type AnnotationType" + NL + - "" + NL + "" + NL + "" + NL + - "" + NL + - "" + NL + - "" + NL + - "" }, {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "Method parameters in pkg" + - " with annotations of type AnnotationType" + NL + - "" + NL + "" + NL + "" + NL + - "" + NL + - "" + NL + - "" + NL + - "" }, {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "Constructors in pkg" + - " with annotations of type AnnotationType" + NL + - "" + NL + "" + NL + "" + NL + - "" + NL + - "" }, {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "Constructor parameters in pkg" + - " with annotations of type AnnotationType" + NL + - "" + NL + "" + NL + "" + NL + - "" + NL + - "" }, //================================= // TYPE PARAMETER IN INDEX //================================= {BUG_ID + FS + "index-all.html", - "method(Vector<Object>)" + "" + + "method(Vector<Object>)" }, //================================= // TYPE PARAMETER IN INDEX //================================= {BUG_ID + FS + "index-all.html", - "method(Vector<Object>)" + "" + + "method(Vector<Object>)" }, }; private static final String[][] NEGATED_TEST = { @@ -637,15 +671,15 @@ public class TestNewLanguageFeatures extends JavadocTester { // ENUM TESTING //================================= //NO constructor section - {BUG_ID + FS + "pkg" + FS + "Coin.html", "Constructor Summary"}, + {BUG_ID + FS + "pkg" + FS + "Coin.html", "Constructor Summary"}, //================================= // TYPE PARAMETER TESTING //================================= //No type parameters in class frame. {BUG_ID + FS + "allclasses-frame.html", - "" + - "TypeParameters<E>" + "" + + "TypeParameters<E>" }, //============================================================== @@ -654,31 +688,27 @@ public class TestNewLanguageFeatures extends JavadocTester { //CLASS {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "" + NL + - "@AnnotationTypeUndocumented(optional=\"Class Annotation\"," + NL + - " required=1994)" + NL + - "public class AnnotationTypeUsage
        extends java.lang.Object
        "}, + "@AnnotationTypeUndocumented(optional=\"Class Annotation\"," + NL + + " required=1994)" + NL + + "public class AnnotationTypeUsage
        extends java.lang.Object
        "}, //FIELD {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "" + NL + - "@AnnotationTypeUndocumented(optional=\"Field Annotation\"," + NL + - " required=1994)" + NL + - "public int field"}, + "@AnnotationTypeUndocumented(optional=\"Field Annotation\"," + NL + + " required=1994)" + NL + + "public int field"}, //CONSTRUCTOR {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "" + NL + - "@AnnotationTypeUndocumented(optional=\"Constructor Annotation\"," + NL + - " required=1994)" + NL + - "public AnnotationTypeUsage()"}, + "@AnnotationTypeUndocumented(optional=\"Constructor Annotation\"," + NL + + " required=1994)" + NL + + "public AnnotationTypeUsage()"}, //METHOD {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "" + NL + - "@AnnotationTypeUndocumented(optional=\"Method Annotation\"," + NL + - " required=1994)" + NL + - "public void method()"}, + "@AnnotationTypeUndocumented(optional=\"Method Annotation\"," + NL + + " required=1994)" + NL + + "public void method()"}, //================================= // Make sure annotation types do not diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java index 871ed283514..4e8b8de2637 100644 --- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java +++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,27 +46,34 @@ public class TestMultiInheritence extends JavadocTester { //Method foo() is inherited from BOTH I2 and I3 private static final String[][] TEST = { {BUG_ID + FS + "pkg3" + FS + "I1.html", - "Methods inherited from interface pkg3." + "I2"}, + "Methods inherited from interface pkg3." + + "" + + "I2"}, {BUG_ID + FS + "pkg3" + FS +"I1.html", - "Methods inherited from interface pkg3." + - "I3"}, + "Methods inherited from interface pkg3." + + "" + + "I3"}, {BUG_ID + FS + "pkg3" + FS + "I0.html", - "Methods inherited from interface pkg3." + - "I2"}, + "Methods inherited from interface pkg3." + + "" + + "I2"}, {BUG_ID + FS + "pkg3" + FS +"I0.html", - "Methods inherited from interface pkg3." + - "I3"}, + "Methods inherited from interface pkg3." + + "" + + "I3"}, }; //Method foo() is NOT inherited from I4 because it is overriden by //I3. private static final String[][] NEGATED_TEST = { {BUG_ID + FS + "pkg3" + FS + "I1.html", - "Methods inherited from interface pkg3." + - "I4"}, + "Methods inherited from interface pkg3." + + "" + + "I4"}, {BUG_ID + FS + "pkg3" + FS + "I0.html", - "Methods inherited from interface pkg3." + - "I4"}, + "Methods inherited from interface pkg3." + + "" + + "I4"}, }; /** diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java index c5ba7e9cf98..7568b0a2516 100644 --- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java +++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,9 +46,9 @@ public class TestOverridenMethodDocCopy extends JavadocTester { //Input for string search tests. private static final String[][] TEST = { {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "Description copied from class: " + - "" + - "BaseClass" + "Description copied from class: " + + "" + + "BaseClass" } }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java index 8f3a5672913..aa136d8be91 100644 --- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java +++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +40,13 @@ public class TestOverridenPrivateMethods extends JavadocTester { private static final String[][] TEST = { //The public method should be overriden {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "Overrides:
        Overrides:" + NL + + "
        Overrides:" + NL + + "
        Overrides:" + NL + + "
        Overrides:" + NL + + "
        Overrides:" + NL + + "
        Overrides:" + NL + + "
        " + + "publicMethod in class " + + "BaseClass
        "}, //The public method in different package should be overriden {BUG_ID + FS + "pkg2" + FS + "SubClass.html", - "Overrides:
        Overrides:" + NL + + "
        " + + "publicMethod in class " + + "BaseClass
        "}, //The package private method should be overriden since the base and sub class are in the same //package. {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "Overrides:
        Overrides:" + NL + + "
        " + + "packagePrivateMethod in class " + + "BaseClass
        "} }; private static final String[][] NEGATED_TEST = { //The private method in should not be overriden {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "Overrides:
        Overrides:" + NL + + "
        "}, //The private method in different package should not be overriden {BUG_ID + FS + "pkg2" + FS + "SubClass.html", - "Overrides:
        Overrides:" + NL + + "
        "}, //The package private method should not be overriden since the base and sub class are in //different packages. {BUG_ID + FS + "pkg2" + FS + "SubClass.html", - "Overrides:
        Overrides:" + NL + + "
        "}, }; private static final String[] ARGS = diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java index 76a4e735b9e..b8b5e7329c4 100644 --- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java +++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,32 +40,38 @@ public class TestOverridenPrivateMethodsWithPrivateFlag extends JavadocTester { private static final String[][] TEST = { //The public method should be overriden {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "Overrides:
        Overrides:" + NL + + "
        Overrides:" + NL + + "
        Overrides:" + NL + + "
        Overrides:" + NL + + "
        Overrides:" + NL + + "
        Overrides:" + NL + + "
        " + - "Package" + "Package" }, {BUG_ID + "-1" + FS + "com" + FS + "pkg" + FS + "package-tree.html", - "" + - "Package" + "
      • Package
      • " }, {BUG_ID + "-1" + FS + "deprecated-list.html", - "" + - "Package" + "
      • Package
      • " }, {BUG_ID + "-1" + FS + "index-all.html", - "" + - "Package" + "
      • Package
      • " }, {BUG_ID + "-1" + FS + "help-doc.html", - "" + - "Package" + "
      • Package
      • " }, }; private static final String[][] TEST2 = { //With multiple packages, there is no package link in general pages. {BUG_ID + "-2" + FS + "deprecated-list.html", - " Package " + "
      • Package
      • " }, {BUG_ID + "-2" + FS + "index-all.html", - " Package " + "
      • Package
      • " }, {BUG_ID + "-2" + FS + "help-doc.html", - " Package " + "
      • Package
      • " }, }; diff --git a/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java b/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java index a8eb2b6c467..3def6b87882 100644 --- a/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java +++ b/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,20 +48,20 @@ public class TestParamTaglet extends JavadocTester { private static final String[][] TEST = { //Regular param tags. {BUG_ID + FS + "pkg" + FS + "C.html", - "Parameters:
        param1 - testing 1 2 3.
        " + - "
        param2 - testing 1 2 3." + "Parameters:
        param1 - testing 1 2 3.
        " + + "
        param2 - testing 1 2 3." }, //Param tags that don't match with any real parameters. {BUG_ID + FS + "pkg" + FS + "C.html", - "Parameters:
        p1 - testing 1 2 3.
        " + - "
        p2 - testing 1 2 3." + "Parameters:
        p1 - testing 1 2 3.
        " + + "
        p2 - testing 1 2 3." }, //{@inherit} doc misuse does not cause doclet to throw exception. // Param is printed with nothing inherited. //XXX: in the future when Configuration is available during doc inheritence, //print a warning for this mistake. {BUG_ID + FS + "pkg" + FS + "C.html", - "inheritBug -" + "inheritBug -" }, }; diff --git a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java index 7aafbfc73c2..f0cf05dcb62 100644 --- a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java +++ b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,50 +58,50 @@ public class TestPrivateClasses extends JavadocTester { private static final String[][] TEST1 = { // Field inheritence from non-public superclass. {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "" + - "fieldInheritedFromParent" + "" + + "fieldInheritedFromParent" }, // Method inheritence from non-public superclass. {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "" + - "methodInheritedFromParent" + "" + + "methodInheritedFromParent" }, // Field inheritence from non-public superinterface. {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", - "" + - "fieldInheritedFromInterface" + "" + + "fieldInheritedFromInterface" }, // Method inheritence from non-public superinterface. {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", - "" + - "methodInterface" + "" + + "methodInterface" }, // private class does not show up in tree {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "
        " + NL +
        -                "java.lang.Object" + NL +
        -                "  pkg.PublicChild" + NL +
        -            "
        " + "
          " + NL + "
        • java.lang.Object
        • " + NL + + "
        • " + NL + "
            " + NL + "
          • pkg.PublicChild
          • " + NL + + "
          " + NL + "
        • " + NL + "
        " }, // Method is documented as though it is declared in the inheriting method. {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "public void methodInheritedFromParent(int p1)" + "
        public void methodInheritedFromParent(int p1)"
                 },
         
                 //Make sure implemented interfaces from private superclass are inherited
                 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
        -            "All Known Implementing Classes: 
        PublicChild"}, + "
        " + NL + "
        All Known Implementing Classes:
        " + NL + + "
        " + + "PublicChild
        " + NL + "
        "}, {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "All Implemented Interfaces:
        PublicInterface"}, + "
        " + NL + "
        All Implemented Interfaces:
        " + NL + + "
        " + + "PublicInterface
        " + NL + "
        "}, //Generic interface method test. {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html", @@ -110,12 +110,12 @@ public class TestPrivateClasses extends JavadocTester { private static final String[][] NEGATED_TEST1 = { // Should not document that a method overrides method from private class. {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "Overrides:"}, + "Overrides:"}, // Should not document that a method specified by private interface. {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "Specified by:"}, + "Specified by:"}, {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", - "Specified by:"}, + "Specified by:"}, // Should not mention that any documentation was copied. {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", "Description copied from"}, @@ -137,64 +137,64 @@ public class TestPrivateClasses extends JavadocTester { //Do not inherit private interface method with generic parameters. //This method has been implemented. {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html", - "hello"}, + "hello"}, }; // Test output when -private flag is used. private static final String[][] TEST2 = { // Field inheritence from non-public superclass. {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "Fields inherited from class " + - "pkg.PrivateParent" + "Fields inherited from class pkg." + + "" + + "PrivateParent" }, {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "" + - "fieldInheritedFromParent" + "" + + "fieldInheritedFromParent" }, // Field inheritence from non-public superinterface. {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", - "Fields inherited from interface " + - "pkg.PrivateInterface" + "Fields inherited from interface pkg." + + "" + + "PrivateInterface" }, {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", - "" + - "fieldInheritedFromInterface" + "" + + "fieldInheritedFromInterface" }, // Method inheritence from non-public superclass. {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "Methods inherited from class " + - "pkg.PrivateParent" + "Methods inherited from class pkg." + + "" + + "PrivateParent" }, {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "" + - "methodInheritedFromParent" + "" + + "methodInheritedFromParent" }, // Should document that a method overrides method from private class. {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "Overrides:
        " + - "" + - "methodOverridenFromParent in class " + - "" + - "PrivateParent
        " + NL + ""}, + "
        Overrides:
        " + NL + + "
        " + + "methodOverridenFromParent in class " + + "" + + "PrivateParent
        "}, // Should document that a method is specified by private interface. {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "Specified by:
        " + - "" + - "methodInterface in interface " + - "" + - "PrivateInterface
        " + NL + "" + NL + "
        "}, + "
        Specified by:
        " + NL + + "
        " + + "methodInterface in interface " + + "" + + "PrivateInterface
        "}, // Method inheritence from non-public superinterface. {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", - "Methods inherited from interface " + - "pkg.PrivateInterface" + "Methods inherited from interface pkg." + + "" + + "PrivateInterface" }, {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateInterface.html", - "" + - "methodInterface" + "" + + "methodInterface" }, // Should mention that any documentation was copied. {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", @@ -209,26 +209,31 @@ public class TestPrivateClasses extends JavadocTester { //Make sure implemented interfaces from private superclass are inherited {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", - "All Known Implementing Classes:
        PrivateParent, " + - "PublicChild"}, + "
        " + NL + "
        All Known Implementing Classes:
        " + NL + + "
        " + + "PrivateParent, " + + "PublicChild" + + "
        " + NL + "
        "}, {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "All Implemented Interfaces:
        PrivateInterface, " + - "" + - "PublicInterface"}, + "
        " + NL + "
        All Implemented Interfaces:
        " + NL + + "
        " + + "PrivateInterface, " + + "" + + "PublicInterface
        " + NL + "
        "}, //Since private flag is used, we can document that private interface method //with generic parameters has been implemented. {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html", - "Description copied from interface: " + - "I"}, + "Description copied from interface: " + + "I"}, {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html", - "Specified by:
        " + - "hello in interface I"}, + "
        Specified by:
        " + NL + + "
        hello" + + " in interface " + + "I" + + "<java.lang.String>
        "}, }; private static final String[][] NEGATED_TEST2 = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java b/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java index a877771c9f1..7749bb92b67 100644 --- a/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java +++ b/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * 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,11 +47,11 @@ public class TestSerializedForm extends JavadocTester implements Serializable { private static final String[][] TEST = { {BUG_ID + FS + "serialized-form.html", - "protected java.lang.Object readResolve()"}, + "protected java.lang.Object readResolve()"}, {BUG_ID + FS + "serialized-form.html", - "protected java.lang.Object writeReplace()"}, + "protected java.lang.Object writeReplace()"}, {BUG_ID + FS + "serialized-form.html", - "protected java.lang.Object readObjectNoData()"}, + "protected java.lang.Object readObjectNoData()"}, {BUG_ID + FS + "serialized-form.html", "See Also"}, }; diff --git a/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java index 1495f991033..4a2a1ccb8cc 100644 --- a/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java +++ b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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,58 +41,47 @@ public class TestSerializedFormDeprecationInfo extends JavadocTester { // Test for normal run of javadoc. The serialized-form.html should // display the inline comments, tags and deprecation information if any. private static final String[][] TEST_CMNT_DEPR = { - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "
        " + NL + - "
        Throws:
        " + NL + "
        " + - "java.io.IOException
        See Also:" + - "
        " + - "C1.setUndecorated(boolean)
        " + NL + - "
        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + - "
        Deprecated. As of JDK version " + - "1.5, replaced by" + NL + - " " + - "setUndecorated(boolean).
        " + - "
        This field indicates whether the C1 is undecorated." + NL + - "

        " + NL + "

        " + NL + "
         
        " + NL + - "
        " + NL + "
        Since:
        " + NL + - "
        1.4
        " + NL + "
        See Also:" + - "
        " + - "C1.setUndecorated(boolean)
        " + NL + - "
        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + - "
        Deprecated. As of JDK version" + - " 1.5, replaced by" + NL + - " " + - "setUndecorated(boolean)." + NL + "

        " + NL + - "

        Reads the object stream." + NL + "

        " + NL + - "

        " + NL + "
        " + NL + "
        Throws:" + - "
        " + NL + "
        " + - "IOException
        " + NL + - "
        java.io.IOException
        " + NL + - "
        " + NL + "
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + - "
        Deprecated. 
        " + - "The name for this class." + NL + "

        " + NL + "

        " + NL + - "
         
        " + NL + "
        "}}; + {BUG_ID + FS + "serialized-form.html", "
        " + + "
        Throws:
        " + NL + "
        " + + "java.io.IOException
        See Also:" + + "
        " + + "C1.setUndecorated(boolean)
        "}, + {BUG_ID + FS + "serialized-form.html", "Deprecated." + + " As of JDK version 1.5, replaced by" + NL + + " " + + "setUndecorated(boolean)." + NL + + "
        This field indicates whether the C1 " + + "is undecorated.
        " + NL + " " + NL + + "
        Since:
        " + NL + + "
        1.4
        " + NL + "
        See Also:" + + "
        " + + "C1.setUndecorated(boolean)
        "}, + {BUG_ID + FS + "serialized-form.html", "Deprecated." + + " As of JDK version 1.5, replaced by" + NL + + " " + + "setUndecorated(boolean)." + NL + + "
        Reads the object stream.
        " + NL + + "
        Throws:
        " + NL + "
        " + + "IOException
        " + NL + + "
        java.io.IOException
        "}, + {BUG_ID + FS + "serialized-form.html", "Deprecated." + + " " + NL + "
        " + + "The name for this class.
        "}}; // Test with -nocomment option. The serialized-form.html should // not display the inline comments and tags but should display deprecation // information if any. private static final String[][] TEST_NOCMNT = { - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "boolean " +
        -                 "undecorated
        " + NL + "
        " + NL + "
        " + - "Deprecated. As of JDK version 1.5, replaced by" + NL + - " " + - "setUndecorated(boolean).
        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "
        " + - "Deprecated. As of JDK version" + + {BUG_ID + FS + "serialized-form.html", "
        boolean undecorated
        " + NL + + "
        Deprecated. " + + "As of JDK version 1.5, replaced by" + NL + + " " + + "setUndecorated(boolean).
        " + NL + ""}, + {BUG_ID + FS + "serialized-form.html", "" + + "Deprecated. As of JDK version" + " 1.5, replaced by" + NL + - " " + - "setUndecorated(boolean)." + NL + "

        " + NL + - "

        "}, - {BUG_ID + FS + "serialized-form.html", "
        " + NL + "int " +
        -                 "publicKey
        " + NL + "
        " + NL + "
        " + - "Deprecated. 
        "}}; + " " + + "setUndecorated(boolean).
        " + NL + ""}}; // Test with -nodeprecated option. The serialized-form.html should // ignore the -nodeprecated tag and display the deprecation info. This diff --git a/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java b/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java index 201d2a83b3d..94b3eb134ef 100644 --- a/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java +++ b/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class TestSimpleTag extends JavadocTester { private static final String[][] TEST = new String[][] { {"./" + BUG_ID + "/C.html", - "Todo:"}, + "Todo:"}, {"./" + BUG_ID + "/C.html", - "EJB Beans:"}, + "EJB Beans:"}, {"./" + BUG_ID + "/C.html", - "Regular Tag:"}, + "Regular Tag:"}, {"./" + BUG_ID + "/C.html", - "Back-Slash-Tag:"}, + "Back-Slash-Tag:"}, }; private static final String[] ARGS = new String[] { diff --git a/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java b/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java index 992d1a854b7..572c4ef1e29 100644 --- a/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java +++ b/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,32 +45,24 @@ public class TestStylesheet extends JavadocTester { //Input for string search tests. private static final String[][] TEST = { {BUG_ID + FS + "stylesheet.css", - "body { background-color: #FFFFFF; color:#000000 }"}, + "/* Javadoc style sheet */"}, {BUG_ID + FS + "stylesheet.css", - ".TableHeadingColor { background: #CCCCFF; color:#000000 }"}, + "/*" + NL + "Overall document style" + NL + "*/"}, {BUG_ID + FS + "stylesheet.css", - ".TableSubHeadingColor { background: #EEEEFF; color:#000000 }"}, + "/*" + NL + "Heading styles" + NL + "*/"}, {BUG_ID + FS + "stylesheet.css", - ".TableRowColor { background: #FFFFFF; color:#000000 }"}, + "/*" + NL + "Navigation bar styles" + NL + "*/"}, {BUG_ID + FS + "stylesheet.css", - ".FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"}, + "body {" + NL + " font-family:Helvetica, Arial, sans-serif;" + NL + + " color:#000000;" + NL + "}"}, {BUG_ID + FS + "stylesheet.css", - ".FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"}, - {BUG_ID + FS + "stylesheet.css", - ".FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"}, - {BUG_ID + FS + "stylesheet.css", - ".NavBarCell1 { background-color:#EEEEFF; color:#000000}"}, - {BUG_ID + FS + "stylesheet.css", - ".NavBarCell1Rev { background-color:#00008B; color:#FFFFFF}"}, - {BUG_ID + FS + "stylesheet.css", - ".NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;}"}, - {BUG_ID + FS + "stylesheet.css", - ".NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;}"}, - {BUG_ID + FS + "stylesheet.css", - ".NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}"}, - {BUG_ID + FS + "stylesheet.css", - ".NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}"}, - + "dl dd ul li {" + NL + " list-style:none;" + NL + + " margin:10px 0 10px 0;" + NL + "}"}, + // Test whether a link to the stylesheet file is inserted properly + // in the class documentation. + {BUG_ID + FS + "pkg" + FS + "A.html", + ""} }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java b/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java index 6ef3794b316..fec7c1e766b 100644 --- a/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java +++ b/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,8 +46,7 @@ public class TestSummaryHeading extends JavadocTester { //Input for string search tests. private static final String[][] TEST = { - {BUG_ID + FS + "C.html", "
        "} + {BUG_ID + FS + "C.html", "

        Method Summary

        "} }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java b/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java index 0e640245cc5..7445b2a04ad 100644 --- a/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java +++ b/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ public class TestSuperClassInSerialForm extends JavadocTester { private static final String[][] TEST = { {BUG_ID + FS + "serialized-form.html", - "pkg.SubClass extends SuperClass"} + "pkg.SubClass extends SuperClass"} }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java b/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java index 8c6af31bb5d..ca6f4c0f108 100644 --- a/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java +++ b/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 +59,12 @@ public class TestTagInheritence extends JavadocTester { //First sentence test (6253614) tests[tests.length - 2][0] =BUG_ID + FS + "firstSentence" + FS + "B.html"; - tests[tests.length - 2][1] = "          First sentence."; + tests[tests.length - 2][1] = "
        First sentence.
        "; //Another first sentence test (6253604) tests[tests.length - 1][0] =BUG_ID + FS + "firstSentence2" + FS + "C.html"; - tests[tests.length - 1][1] = "          First sentence."; + tests[tests.length - 1][1] = "
        First sentence.
        "; TestTagInheritence tester = new TestTagInheritence(); run(tester, ARGS, tests, NO_TEST); diff --git a/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java b/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java index 53b727e38ff..53461390e52 100644 --- a/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java +++ b/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,13 +55,15 @@ public class TestTaglets extends JavadocTester { //Input for string search tests. private static final String[][] TEST_4654308 = new String[][] { - {"4654308" + FS + "C.html", "Foo:
        my only method is " + "here"} + {"4654308" + FS + "C.html", "Foo:" + + "
        my only method is here" + + "
        "} }; private static final String[][] NEGATED_TEST_4654308 = NO_TEST; private static final String[][] TEST_4767038 = new String[][] { {"4767038" + FS + "Child.html", - " This is the first sentence."} + "This is the first sentence."} }; private static final String[][] NEGATED_TEST_4767038 = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java b/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java index a5f60622dd2..e28c452212b 100644 --- a/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java +++ b/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 +50,9 @@ public class Foo extends BaseTaglet { */ public TagletOutput getTagletOutput(Tag tag, TagletWriter writer) { ArrayList inlineTags = new ArrayList(); - inlineTags.add(new TextTag(tag.holder(), "
        Foo:
        ")); + inlineTags.add(new TextTag(tag.holder(), "
        Foo:
        ")); inlineTags.addAll(Arrays.asList(tag.inlineTags())); - inlineTags.add(new TextTag(tag.holder(), "
        ")); + inlineTags.add(new TextTag(tag.holder(), "")); return writer.commentTagsToOutput(tag, (Tag[]) inlineTags.toArray(new Tag[] {})); } diff --git a/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java b/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java index 1c401df9d49..49408e4ed01 100644 --- a/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java +++ b/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class TestThrowsHead extends JavadocTester { private static final String BUG_ID = "4530727"; private static final String[][] TEST = { - {BUG_ID + FS + "C.html", "
        Throws:"} + {BUG_ID + FS + "C.html", "
        Throws:"} }; private static final String[][] NEGATED_TEST = NO_TEST; private static final String[] ARGS = new String[] { diff --git a/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java b/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java index 2f065fd9de5..ceb8ca676a5 100644 --- a/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java +++ b/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,14 +46,14 @@ public class TestThrowsTag extends JavadocTester { //Input for string search tests. private static final String[][] TEST = { {BUG_ID + FS + "pkg" + FS + "C.html", - "
        T1 - the first throws tag.
        " + NL + - "
        T2 - the second throws tag.
        " + NL + - "
        T3 - the third throws tag.
        " + NL + - "
        T4 - the fourth throws tag.
        " + NL + - "
        T5 - the first inherited throws tag.
        " + NL + - "
        T6 - the second inherited throws tag.
        " + NL + - "
        T7 - the third inherited throws tag.
        " + NL + - "
        T8 - the fourth inherited throws tag.
        " + "
        T1 - the first throws tag.
        " + NL + + "
        T2 - the second throws tag.
        " + NL + + "
        T3 - the third throws tag.
        " + NL + + "
        T4 - the fourth throws tag.
        " + NL + + "
        T5 - the first inherited throws tag.
        " + NL + + "
        T6 - the second inherited throws tag.
        " + NL + + "
        T7 - the third inherited throws tag.
        " + NL + + "
        T8 - the fourth inherited throws tag.
        " }, }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java b/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java index 1aa6fdddfc3..bc3ffe037f4 100644 --- a/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java +++ b/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * 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,13 +38,13 @@ public class TestTitleInHref extends JavadocTester { private static final String[][] TEST = { //Test to make sure that the title shows up in a class link. - {BUG_ID + FS + "pkg" + FS + "Links.html", ""}, + {BUG_ID + FS + "pkg" + FS + "Links.html", ""}, //Test to make sure that the title shows up in an interface link. - {BUG_ID + FS + "pkg" + FS + "Links.html", ""}, + {BUG_ID + FS + "pkg" + FS + "Links.html", ""}, //Test to make sure that the title shows up in cross link shows up - {BUG_ID + FS + "pkg" + FS + "Links.html", "This is a cross link to class File"}, + {BUG_ID + FS + "pkg" + FS + "Links.html", "This is a cross link to class File"}, }; diff --git a/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java b/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java index 1fb4d014455..21e708ead46 100644 --- a/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java +++ b/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,16 +49,17 @@ public class TestTypeParameters extends JavadocTester { private static final String[][] TEST = { {BUG_ID + FS + "pkg" + FS + "C.html", - "<W extends java.lang.String,V extends java.util.List> " + NL + - "
        " + NL + - "java.lang.Object
        "}, + "
        "}, {BUG_ID + FS + "pkg" + FS + "C.html", - "<T> java.lang.Object"}, + "<T> java.lang.Object"}, {BUG_ID + FS + "pkg" + FS + "package-summary.html", "C<E extends Parent>"}, //Nested type parameters {BUG_ID + FS + "pkg" + FS + "C.html", - ""}, + "" + NL + + "" + NL + + ""}, }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java b/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java index d3bb6460200..51352e2bb84 100644 --- a/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java +++ b/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ public class TestUnnamedPackage extends JavadocTester { //Input for string search tests. private static final String[][] TEST = { {BUG_ID + FS + "package-summary.html", - "

        "+NL+"Package <Unnamed>"+NL+"

        " + "

        Package <Unnamed>

        " }, {BUG_ID + FS + "package-summary.html", "This is a package comment for the unnamed package." @@ -55,12 +55,12 @@ public class TestUnnamedPackage extends JavadocTester { "This is a class in the unnamed package." }, {BUG_ID + FS + "package-tree.html", - "

        "+NL+"Hierarchy For Package <Unnamed>"+NL+"

        " + "

        Hierarchy For Package <Unnamed>

        " }, {BUG_ID + FS + "index-all.html", "title=\"class in <Unnamed>\"" }, - {BUG_ID + FS + "C.html", ""} + {BUG_ID + FS + "C.html", ""} }; private static final String[][] NEGATED_TEST = { {ERROR_OUTPUT, "BadSource"}, diff --git a/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java b/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java index c4f94511871..08780aa6acb 100644 --- a/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java +++ b/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,44 +52,44 @@ public class TestValueTag extends JavadocTester { "Result: \"Test 1 passes\""}, //Retrieve value of constant in same class. {BUG_ID + FS + "pkg1" + FS + "Class1.html", - "Result: \"Test 2 passes\""}, + "Result: \"Test 2 passes\""}, {BUG_ID + FS + "pkg1" + FS + "Class1.html", - "Result: \"Test 3 passes\""}, + "Result: \"Test 3 passes\""}, {BUG_ID + FS + "pkg1" + FS + "Class1.html", - "Result: \"Test 4 passes\""}, + "Result: \"Test 4 passes\""}, {BUG_ID + FS + "pkg1" + FS + "Class1.html", - "Result: \"Test 5 passes\""}, + "Result: \"Test 5 passes\""}, {BUG_ID + FS + "pkg1" + FS + "Class1.html", - "Result: \"Test 6 passes\""}, + "Result: \"Test 6 passes\""}, //Retrieve value of constant in different class. {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: \"Test 7 passes\""}, + "Result: \"Test 7 passes\""}, {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: \"Test 8 passes\""}, + "Result: \"Test 8 passes\""}, {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: \"Test 9 passes\""}, + "Result: \"Test 9 passes\""}, {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: \"Test 10 passes\""}, + "Result: \"Test 10 passes\""}, {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: \"Test 11 passes\""}, + "Result: \"Test 11 passes\""}, //Retrieve value of constant in different package {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: \"Test 12 passes\""}, + "Result: \"Test 12 passes\""}, {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: \"Test 13 passes\""}, + "Result: \"Test 13 passes\""}, {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: \"Test 14 passes\""}, + "Result: \"Test 14 passes\""}, {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: \"Test 15 passes\""}, + "Result: \"Test 15 passes\""}, {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: \"Test 16 passes\""}, + "Result: \"Test 16 passes\""}, //Retrieve value of constant from a package page {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "Result: \"Test 17 passes\""}, + "Result: \"Test 17 passes\""}, //Test @value tag used with custom tag. {BUG_ID + FS + "pkg1" + FS + "CustomTagUsage.html", - "
        Todo:
        " + NL + - "
        the value of this constant is 55.
        "}, + "
        Todo:
        " + NL + + "
        the value of this constant is 55.
        "}, //Test @value warning printed when used with non-constant. {WARNING_OUTPUT,"warning - @value tag (which references nonConstant) " + "can only be used in constants." diff --git a/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java b/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java index 4632fb94721..bf21f3f0d8f 100644 --- a/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java +++ b/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * 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,9 @@ public class TestWarnings extends JavadocTester { }; private static final String[][] TEST2 = { - {BUG_ID + FS + "pkg" + FS + "X.html", "m()
        "}, - {BUG_ID + FS + "pkg" + FS + "X.html", "X()
        "}, - {BUG_ID + FS + "pkg" + FS + "X.html", "f
        "}, + {BUG_ID + FS + "pkg" + FS + "X.html", "m()
        "}, + {BUG_ID + FS + "pkg" + FS + "X.html", "X()
        "}, + {BUG_ID + FS + "pkg" + FS + "X.html", "f
        "}, }; private static final String[][] NEGATED_TEST2 = NO_TEST; diff --git a/langtools/test/tools/javac/4917091/Test255.java b/langtools/test/tools/javac/4917091/Test255.java new file mode 100644 index 00000000000..af143912615 --- /dev/null +++ b/langtools/test/tools/javac/4917091/Test255.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 4917091 + * @summary javac rejects array over 128 in length + */ + + +public class Test255 { + public static void main(String... args) { + // allocating an array with 255 dimensions is allowed + Object expected = (Object)new Object + [1/*001*/][1/*002*/][1/*003*/][1/*004*/][1/*005*/] + [1/*006*/][1/*007*/][1/*008*/][1/*009*/][1/*010*/] + [1/*011*/][1/*012*/][1/*013*/][1/*014*/][1/*015*/] + [1/*016*/][1/*017*/][1/*018*/][1/*019*/][1/*020*/] + [1/*021*/][1/*022*/][1/*023*/][1/*024*/][1/*025*/] + [1/*026*/][1/*027*/][1/*028*/][1/*029*/][1/*030*/] + [1/*031*/][1/*032*/][1/*033*/][1/*034*/][1/*035*/] + [1/*036*/][1/*037*/][1/*038*/][1/*039*/][1/*040*/] + [1/*041*/][1/*042*/][1/*043*/][1/*044*/][1/*045*/] + [1/*046*/][1/*047*/][1/*048*/][1/*049*/][1/*050*/] + [1/*051*/][1/*052*/][1/*053*/][1/*054*/][1/*055*/] + [1/*056*/][1/*057*/][1/*058*/][1/*059*/][1/*060*/] + [1/*061*/][1/*062*/][1/*063*/][1/*064*/][1/*065*/] + [1/*066*/][1/*067*/][1/*068*/][1/*069*/][1/*070*/] + [1/*071*/][1/*072*/][1/*073*/][1/*074*/][1/*075*/] + [1/*076*/][1/*077*/][1/*078*/][1/*079*/][1/*080*/] + [1/*081*/][1/*082*/][1/*083*/][1/*084*/][1/*085*/] + [1/*086*/][1/*087*/][1/*088*/][1/*089*/][1/*090*/] + [1/*091*/][1/*092*/][1/*093*/][1/*094*/][1/*095*/] + [1/*096*/][1/*097*/][1/*098*/][1/*099*/][1/*100*/] + + [1/*101*/][1/*102*/][1/*103*/][1/*104*/][1/*105*/] + [1/*106*/][1/*107*/][1/*108*/][1/*109*/][1/*110*/] + [1/*111*/][1/*112*/][1/*113*/][1/*114*/][1/*115*/] + [1/*116*/][1/*117*/][1/*118*/][1/*119*/][1/*120*/] + [1/*121*/][1/*122*/][1/*123*/][1/*124*/][1/*125*/] + [1/*126*/][1/*127*/][1/*128*/][1/*129*/][1/*130*/] + [1/*131*/][1/*132*/][1/*133*/][1/*134*/][1/*135*/] + [1/*136*/][1/*137*/][1/*138*/][1/*139*/][1/*140*/] + [1/*141*/][1/*142*/][1/*143*/][1/*144*/][1/*145*/] + [1/*146*/][1/*147*/][1/*148*/][1/*149*/][1/*150*/] + [1/*151*/][1/*152*/][1/*153*/][1/*154*/][1/*155*/] + [1/*156*/][1/*157*/][1/*158*/][1/*159*/][1/*160*/] + [1/*161*/][1/*162*/][1/*163*/][1/*164*/][1/*165*/] + [1/*166*/][1/*167*/][1/*168*/][1/*169*/][1/*170*/] + [1/*171*/][1/*172*/][1/*173*/][1/*174*/][1/*175*/] + [1/*176*/][1/*177*/][1/*178*/][1/*179*/][1/*180*/] + [1/*181*/][1/*182*/][1/*183*/][1/*184*/][1/*185*/] + [1/*186*/][1/*187*/][1/*188*/][1/*189*/][1/*190*/] + [1/*191*/][1/*192*/][1/*193*/][1/*194*/][1/*195*/] + [1/*196*/][1/*197*/][1/*198*/][1/*199*/][1/*200*/] + + [1/*201*/][1/*202*/][1/*203*/][1/*204*/][1/*205*/] + [1/*206*/][1/*207*/][1/*208*/][1/*209*/][1/*210*/] + [1/*211*/][1/*212*/][1/*213*/][1/*214*/][1/*215*/] + [1/*216*/][1/*217*/][1/*218*/][1/*219*/][1/*220*/] + [1/*221*/][1/*222*/][1/*223*/][1/*224*/][1/*225*/] + [1/*226*/][1/*227*/][1/*228*/][1/*229*/][1/*230*/] + [1/*231*/][1/*232*/][1/*233*/][1/*234*/][1/*235*/] + [1/*236*/][1/*237*/][1/*238*/][1/*239*/][1/*240*/] + [1/*241*/][1/*242*/][1/*243*/][1/*244*/][1/*245*/] + [1/*246*/][1/*247*/][1/*248*/][1/*249*/][1/*250*/] + [1/*251*/][1/*252*/][1/*253*/][1/*254*/][1/*255*/]; + } +} diff --git a/langtools/test/tools/javac/4917091/Test256a.java b/langtools/test/tools/javac/4917091/Test256a.java new file mode 100644 index 00000000000..b0f9ae6d7ca --- /dev/null +++ b/langtools/test/tools/javac/4917091/Test256a.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 4917091 + * @summary javac rejects array over 128 in length + * @compile/fail/ref=Test256a.out -XDrawDiagnostics Test256a.java + */ + +public class Test256a { + // allocating an array with more than 255 dimensions is not allowed + static Object expected = (Object)new Object + [1/*001*/][1/*002*/][1/*003*/][1/*004*/][1/*005*/] + [1/*006*/][1/*007*/][1/*008*/][1/*009*/][1/*010*/] + [1/*011*/][1/*012*/][1/*013*/][1/*014*/][1/*015*/] + [1/*016*/][1/*017*/][1/*018*/][1/*019*/][1/*020*/] + [1/*021*/][1/*022*/][1/*023*/][1/*024*/][1/*025*/] + [1/*026*/][1/*027*/][1/*028*/][1/*029*/][1/*030*/] + [1/*031*/][1/*032*/][1/*033*/][1/*034*/][1/*035*/] + [1/*036*/][1/*037*/][1/*038*/][1/*039*/][1/*040*/] + [1/*041*/][1/*042*/][1/*043*/][1/*044*/][1/*045*/] + [1/*046*/][1/*047*/][1/*048*/][1/*049*/][1/*050*/] + [1/*051*/][1/*052*/][1/*053*/][1/*054*/][1/*055*/] + [1/*056*/][1/*057*/][1/*058*/][1/*059*/][1/*060*/] + [1/*061*/][1/*062*/][1/*063*/][1/*064*/][1/*065*/] + [1/*066*/][1/*067*/][1/*068*/][1/*069*/][1/*070*/] + [1/*071*/][1/*072*/][1/*073*/][1/*074*/][1/*075*/] + [1/*076*/][1/*077*/][1/*078*/][1/*079*/][1/*080*/] + [1/*081*/][1/*082*/][1/*083*/][1/*084*/][1/*085*/] + [1/*086*/][1/*087*/][1/*088*/][1/*089*/][1/*090*/] + [1/*091*/][1/*092*/][1/*093*/][1/*094*/][1/*095*/] + [1/*096*/][1/*097*/][1/*098*/][1/*099*/][1/*100*/] + + [1/*101*/][1/*102*/][1/*103*/][1/*104*/][1/*105*/] + [1/*106*/][1/*107*/][1/*108*/][1/*109*/][1/*110*/] + [1/*111*/][1/*112*/][1/*113*/][1/*114*/][1/*115*/] + [1/*116*/][1/*117*/][1/*118*/][1/*119*/][1/*120*/] + [1/*121*/][1/*122*/][1/*123*/][1/*124*/][1/*125*/] + [1/*126*/][1/*127*/][1/*128*/][1/*129*/][1/*130*/] + [1/*131*/][1/*132*/][1/*133*/][1/*134*/][1/*135*/] + [1/*136*/][1/*137*/][1/*138*/][1/*139*/][1/*140*/] + [1/*141*/][1/*142*/][1/*143*/][1/*144*/][1/*145*/] + [1/*146*/][1/*147*/][1/*148*/][1/*149*/][1/*150*/] + [1/*151*/][1/*152*/][1/*153*/][1/*154*/][1/*155*/] + [1/*156*/][1/*157*/][1/*158*/][1/*159*/][1/*160*/] + [1/*161*/][1/*162*/][1/*163*/][1/*164*/][1/*165*/] + [1/*166*/][1/*167*/][1/*168*/][1/*169*/][1/*170*/] + [1/*171*/][1/*172*/][1/*173*/][1/*174*/][1/*175*/] + [1/*176*/][1/*177*/][1/*178*/][1/*179*/][1/*180*/] + [1/*181*/][1/*182*/][1/*183*/][1/*184*/][1/*185*/] + [1/*186*/][1/*187*/][1/*188*/][1/*189*/][1/*190*/] + [1/*191*/][1/*192*/][1/*193*/][1/*194*/][1/*195*/] + [1/*196*/][1/*197*/][1/*198*/][1/*199*/][1/*200*/] + + [1/*201*/][1/*202*/][1/*203*/][1/*204*/][1/*205*/] + [1/*206*/][1/*207*/][1/*208*/][1/*209*/][1/*210*/] + [1/*211*/][1/*212*/][1/*213*/][1/*214*/][1/*215*/] + [1/*216*/][1/*217*/][1/*218*/][1/*219*/][1/*220*/] + [1/*221*/][1/*222*/][1/*223*/][1/*224*/][1/*225*/] + [1/*226*/][1/*227*/][1/*228*/][1/*229*/][1/*230*/] + [1/*231*/][1/*232*/][1/*233*/][1/*234*/][1/*235*/] + [1/*236*/][1/*237*/][1/*238*/][1/*239*/][1/*240*/] + [1/*241*/][1/*242*/][1/*243*/][1/*244*/][1/*245*/] + [1/*246*/][1/*247*/][1/*248*/][1/*249*/][1/*250*/] + [1/*251*/][1/*252*/][1/*253*/][1/*254*/][1/*255*/] + [1/*256*/]; +} diff --git a/langtools/test/tools/javac/4917091/Test256a.out b/langtools/test/tools/javac/4917091/Test256a.out new file mode 100644 index 00000000000..ccc107fc4bd --- /dev/null +++ b/langtools/test/tools/javac/4917091/Test256a.out @@ -0,0 +1,2 @@ +Test256a.java:33:46: compiler.err.limit.dimensions +1 error diff --git a/langtools/test/tools/javac/4917091/Test256b.java b/langtools/test/tools/javac/4917091/Test256b.java new file mode 100644 index 00000000000..fd247fa8757 --- /dev/null +++ b/langtools/test/tools/javac/4917091/Test256b.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 4917091 + * @summary javac rejects array over 128 in length + * @compile/fail/ref=Test256b.out -XDrawDiagnostics Test256b.java + */ + +public class Test256b { + // allocating an array with 255 dimensions whose component + // type provides additional dimensions is not allowed, + // since the type descriptor for any array is limited to + // 255 dimensions: JVMS3, section 4.3.2. + static Object expected = (Object)new Object + [1/*001*/][1/*002*/][1/*003*/][1/*004*/][1/*005*/] + [1/*006*/][1/*007*/][1/*008*/][1/*009*/][1/*010*/] + [1/*011*/][1/*012*/][1/*013*/][1/*014*/][1/*015*/] + [1/*016*/][1/*017*/][1/*018*/][1/*019*/][1/*020*/] + [1/*021*/][1/*022*/][1/*023*/][1/*024*/][1/*025*/] + [1/*026*/][1/*027*/][1/*028*/][1/*029*/][1/*030*/] + [1/*031*/][1/*032*/][1/*033*/][1/*034*/][1/*035*/] + [1/*036*/][1/*037*/][1/*038*/][1/*039*/][1/*040*/] + [1/*041*/][1/*042*/][1/*043*/][1/*044*/][1/*045*/] + [1/*046*/][1/*047*/][1/*048*/][1/*049*/][1/*050*/] + [1/*051*/][1/*052*/][1/*053*/][1/*054*/][1/*055*/] + [1/*056*/][1/*057*/][1/*058*/][1/*059*/][1/*060*/] + [1/*061*/][1/*062*/][1/*063*/][1/*064*/][1/*065*/] + [1/*066*/][1/*067*/][1/*068*/][1/*069*/][1/*070*/] + [1/*071*/][1/*072*/][1/*073*/][1/*074*/][1/*075*/] + [1/*076*/][1/*077*/][1/*078*/][1/*079*/][1/*080*/] + [1/*081*/][1/*082*/][1/*083*/][1/*084*/][1/*085*/] + [1/*086*/][1/*087*/][1/*088*/][1/*089*/][1/*090*/] + [1/*091*/][1/*092*/][1/*093*/][1/*094*/][1/*095*/] + [1/*096*/][1/*097*/][1/*098*/][1/*099*/][1/*100*/] + + [1/*101*/][1/*102*/][1/*103*/][1/*104*/][1/*105*/] + [1/*106*/][1/*107*/][1/*108*/][1/*109*/][1/*110*/] + [1/*111*/][1/*112*/][1/*113*/][1/*114*/][1/*115*/] + [1/*116*/][1/*117*/][1/*118*/][1/*119*/][1/*120*/] + [1/*121*/][1/*122*/][1/*123*/][1/*124*/][1/*125*/] + [1/*126*/][1/*127*/][1/*128*/][1/*129*/][1/*130*/] + [1/*131*/][1/*132*/][1/*133*/][1/*134*/][1/*135*/] + [1/*136*/][1/*137*/][1/*138*/][1/*139*/][1/*140*/] + [1/*141*/][1/*142*/][1/*143*/][1/*144*/][1/*145*/] + [1/*146*/][1/*147*/][1/*148*/][1/*149*/][1/*150*/] + [1/*151*/][1/*152*/][1/*153*/][1/*154*/][1/*155*/] + [1/*156*/][1/*157*/][1/*158*/][1/*159*/][1/*160*/] + [1/*161*/][1/*162*/][1/*163*/][1/*164*/][1/*165*/] + [1/*166*/][1/*167*/][1/*168*/][1/*169*/][1/*170*/] + [1/*171*/][1/*172*/][1/*173*/][1/*174*/][1/*175*/] + [1/*176*/][1/*177*/][1/*178*/][1/*179*/][1/*180*/] + [1/*181*/][1/*182*/][1/*183*/][1/*184*/][1/*185*/] + [1/*186*/][1/*187*/][1/*188*/][1/*189*/][1/*190*/] + [1/*191*/][1/*192*/][1/*193*/][1/*194*/][1/*195*/] + [1/*196*/][1/*197*/][1/*198*/][1/*199*/][1/*200*/] + + [1/*201*/][1/*202*/][1/*203*/][1/*204*/][1/*205*/] + [1/*206*/][1/*207*/][1/*208*/][1/*209*/][1/*210*/] + [1/*211*/][1/*212*/][1/*213*/][1/*214*/][1/*215*/] + [1/*216*/][1/*217*/][1/*218*/][1/*219*/][1/*220*/] + [1/*221*/][1/*222*/][1/*223*/][1/*224*/][1/*225*/] + [1/*226*/][1/*227*/][1/*228*/][1/*229*/][1/*230*/] + [1/*231*/][1/*232*/][1/*233*/][1/*234*/][1/*235*/] + [1/*236*/][1/*237*/][1/*238*/][1/*239*/][1/*240*/] + [1/*241*/][1/*242*/][1/*243*/][1/*244*/][1/*245*/] + [1/*246*/][1/*247*/][1/*248*/][1/*249*/][1/*250*/] + [1/*251*/][1/*252*/][1/*253*/][1/*254*/][1/*255*/] + []; +} diff --git a/langtools/test/tools/javac/4917091/Test256b.out b/langtools/test/tools/javac/4917091/Test256b.out new file mode 100644 index 00000000000..3fc10cc4155 --- /dev/null +++ b/langtools/test/tools/javac/4917091/Test256b.out @@ -0,0 +1,2 @@ +Test256b.java:36:46: compiler.err.limit.dimensions +1 error diff --git a/langtools/test/tools/javac/6341866/Anno.java b/langtools/test/tools/javac/6341866/Anno.java index c090c8a623e..165967a34de 100644 --- a/langtools/test/tools/javac/6341866/Anno.java +++ b/langtools/test/tools/javac/6341866/Anno.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/6341866/T6341866.java b/langtools/test/tools/javac/6341866/T6341866.java index 7a62987a4b6..213f5b44105 100644 --- a/langtools/test/tools/javac/6341866/T6341866.java +++ b/langtools/test/tools/javac/6341866/T6341866.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -97,7 +97,7 @@ public class T6341866 { processorServices.delete(); List opts = new ArrayList(); - opts.addAll(Arrays.asList("-d", ".", "-sourcepath", testSrc, "-classpath", testClasses, "-source", "1.6")); + opts.addAll(Arrays.asList("-d", ".", "-sourcepath", testSrc, "-classpath", testClasses, "-source", "1.6", "-Xlint:-options")); if (implicitType.opt != null) opts.add(implicitType.opt); diff --git a/langtools/test/tools/javac/6402516/CheckLocalElements.java b/langtools/test/tools/javac/6402516/CheckLocalElements.java index 2e4f477c331..0b80876625b 100644 --- a/langtools/test/tools/javac/6402516/CheckLocalElements.java +++ b/langtools/test/tools/javac/6402516/CheckLocalElements.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/6567415/T6567415.java b/langtools/test/tools/javac/6567415/T6567415.java new file mode 100644 index 00000000000..683197e6e84 --- /dev/null +++ b/langtools/test/tools/javac/6567415/T6567415.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6567415 + * @summary Test to ensure javac does not go into an infinite loop, while + * reading a classfile of a specific length. + * @compile -XDignore.symbol.file T6567415.java + * @run main T6567415 + * @author ksrini + */ + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.io.RandomAccessFile; +import java.nio.ByteBuffer; +import java.nio.MappedByteBuffer; +import java.nio.channels.FileChannel; + +/* + * this test compiles Bar.java into a classfile and enlarges the file to the + * magic file length, then use this mutated file on the classpath to compile + * Foo.java which references Bar.java and Ka-boom. QED. + */ +public class T6567415 { + final static String TEST_FILE_NAME = "Bar"; + final static String TEST_JAVA = TEST_FILE_NAME + ".java"; + final static String TEST_CLASS = TEST_FILE_NAME + ".class"; + + final static String TEST2_FILE_NAME = "Foo"; + final static String TEST2_JAVA = TEST2_FILE_NAME + ".java"; + + /* + * the following is the initial buffer length set in ClassReader.java + * thus this value needs to change if ClassReader buf length changes. + */ + + final static int BAD_FILE_LENGTH = + com.sun.tools.javac.jvm.ClassReader.INITIAL_BUFFER_SIZE; + + static void createClassFile() throws IOException { + FileOutputStream fos = null; + try { + fos = new FileOutputStream(TEST_JAVA); + PrintStream ps = new PrintStream(fos); + ps.println("public class " + TEST_FILE_NAME + " {}"); + } finally { + fos.close(); + } + String cmds[] = {TEST_JAVA}; + com.sun.tools.javac.Main.compile(cmds); + } + + static void enlargeClassFile() throws IOException { + File f = new File(TEST_CLASS); + if (!f.exists()) { + System.out.println("file not found: " + TEST_CLASS); + System.exit(1); + } + File tfile = new File(f.getAbsolutePath() + ".tmp"); + f.renameTo(tfile); + + RandomAccessFile raf = null; + FileChannel wfc = null; + + FileInputStream fis = null; + FileChannel rfc = null; + + try { + raf = new RandomAccessFile(f, "rw"); + wfc = raf.getChannel(); + + fis = new FileInputStream(tfile); + rfc = fis.getChannel(); + + ByteBuffer bb = MappedByteBuffer.allocate(BAD_FILE_LENGTH); + rfc.read(bb); + bb.rewind(); + wfc.write(bb); + wfc.truncate(BAD_FILE_LENGTH); + } finally { + wfc.close(); + raf.close(); + rfc.close(); + fis.close(); + } + System.out.println("file length = " + f.length()); + } + + static void createJavaFile() throws IOException { + FileOutputStream fos = null; + try { + fos = new FileOutputStream(TEST2_JAVA); + PrintStream ps = new PrintStream(fos); + ps.println("public class " + TEST2_FILE_NAME + + " {" + TEST_FILE_NAME + " b = new " + + TEST_FILE_NAME + " ();}"); + } finally { + fos.close(); + } + } + + public static void main(String... args) throws Exception { + createClassFile(); + enlargeClassFile(); + createJavaFile(); + Thread t = new Thread () { + @Override + public void run() { + String cmds[] = {"-verbose", "-cp", ".", TEST2_JAVA}; + int ret = com.sun.tools.javac.Main.compile(cmds); + System.out.println("test compilation returns: " + ret); + } + }; + t.start(); + t.join(1000*10); + System.out.println(t.getState()); + if (t.isAlive()) { + throw new RuntimeException("Error: compilation is looping"); + } + } +} diff --git a/langtools/test/tools/javac/treeannotests/AnnoTreeTests.java b/langtools/test/tools/javac/6996626/Main.java similarity index 70% rename from langtools/test/tools/javac/treeannotests/AnnoTreeTests.java rename to langtools/test/tools/javac/6996626/Main.java index fcfb4e55d56..6c3848050a1 100644 --- a/langtools/test/tools/javac/treeannotests/AnnoTreeTests.java +++ b/langtools/test/tools/javac/6996626/Main.java @@ -21,24 +21,25 @@ * questions. */ -/* - * @test - * @build DA TA Test TestProcessor - * @compile -proc:only -processor TestProcessor AnnoTreeTests.java +/* @test + * @bug 6996626 + * @summary Scope fix issues for ImportScope + * @compile pack1/Symbol.java + * @compile Main.java */ -@Test(6) -class AnnoTreeTests { - // primitive types - @DA("int") int i1; - int i2 = (@TA("int") int) 0; +import pack1.*; +import pack1.Symbol.*; - // simple array types - @DA("int[]") int[] a1; - int @TA("int") [] a2; - int[] a3 = (@TA("int[]") int[]) a1; - int[] a4 = (int @TA("int") []) a1; +// The following imports are just to trigger re-hashing (in +// com.sun.tools.javac.code.Scope.dble()) of the star-import scope. +import java.io.*; +import java.net.*; +import java.util.*; - // multi-dimensional array types - // (still to come) +public class Main { + public void main (String[] args) { + throw new CompletionFailure(); + } } + diff --git a/langtools/test/tools/javac/diags/examples/IllegalBytecodeIdentChar.java b/langtools/test/tools/javac/6996626/pack1/Symbol.java similarity index 90% rename from langtools/test/tools/javac/diags/examples/IllegalBytecodeIdentChar.java rename to langtools/test/tools/javac/6996626/pack1/Symbol.java index 186fb5655c4..583cd647240 100644 --- a/langtools/test/tools/javac/diags/examples/IllegalBytecodeIdentChar.java +++ b/langtools/test/tools/javac/6996626/pack1/Symbol.java @@ -21,8 +21,11 @@ * questions. */ -// key: compiler.err.illegal.bytecode.ident.char +package pack1; -class IllegalBytecodeIdentChar { - int #"abc/def" = 3; +public class Symbol { + public static class CompletionFailure extends RuntimeException { } } + + + diff --git a/langtools/test/tools/javac/ClassFileModifiers/ClassModifiers.java b/langtools/test/tools/javac/ClassFileModifiers/ClassModifiers.java index cc768589c5d..a2041abad1d 100644 --- a/langtools/test/tools/javac/ClassFileModifiers/ClassModifiers.java +++ b/langtools/test/tools/javac/ClassFileModifiers/ClassModifiers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/ClassFileModifiers/MemberModifiers.java b/langtools/test/tools/javac/ClassFileModifiers/MemberModifiers.java index 8eec7c1e276..f66376d5802 100644 --- a/langtools/test/tools/javac/ClassFileModifiers/MemberModifiers.java +++ b/langtools/test/tools/javac/ClassFileModifiers/MemberModifiers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4249112 4785453 * @summary Verify that implicit member modifiers are set correctly. * - * @compile/ref=MemberModifiers.out -source 1.4 -target 1.4.2 -XDdumpmodifiers=cfm MemberModifiers.java + * @compile/ref=MemberModifiers.out -source 1.4 -target 1.4.2 -Xlint:-options -XDdumpmodifiers=cfm MemberModifiers.java */ // Currently, we check only that members of final classes are not final. diff --git a/langtools/test/tools/javac/DefiniteAssignment/7003744/T7003744a.java b/langtools/test/tools/javac/DefiniteAssignment/7003744/T7003744a.java new file mode 100644 index 00000000000..d06c3fccd72 --- /dev/null +++ b/langtools/test/tools/javac/DefiniteAssignment/7003744/T7003744a.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7003744 6999622 + * @summary Compiler error concerning final variables + * @author mcimadamore + * + * @compile T7003744a.java + */ + +class T7003744a { + final Object x; + + T7003744a() { + { + int inx = 0; + for(int i = 0; i < 5; i++) { } + } + for(String am: new String[1]) { + final String mode = am; + } + + x = null; + } +} diff --git a/langtools/test/tools/javac/DefiniteAssignment/7003744/T7003744b.java b/langtools/test/tools/javac/DefiniteAssignment/7003744/T7003744b.java new file mode 100644 index 00000000000..2b7f881def6 --- /dev/null +++ b/langtools/test/tools/javac/DefiniteAssignment/7003744/T7003744b.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7003744 6999622 + * @summary Compiler error concerning final variables + * @author mcimadamore + * + * @compile T7003744b.java + */ + +class T7003744b { + void test() { + final int bogus; + + for (int i1 = 0, i2 = 2; i1 < i2; i1++) { + final int i_1 = 2; + } + for (Object o : new Object[] { null }) { + final int i_2 = 2; + } + + bogus = 4; + } +} diff --git a/langtools/test/tools/javac/EarlyAssert.java b/langtools/test/tools/javac/EarlyAssert.java index 6905d91d7af..eb5c3b937c0 100644 --- a/langtools/test/tools/javac/EarlyAssert.java +++ b/langtools/test/tools/javac/EarlyAssert.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/InterfaceAssert.java b/langtools/test/tools/javac/InterfaceAssert.java index 06684757f05..a7614a9b6d5 100644 --- a/langtools/test/tools/javac/InterfaceAssert.java +++ b/langtools/test/tools/javac/InterfaceAssert.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/OverrideChecks/6738538/T6738538a.java b/langtools/test/tools/javac/OverrideChecks/6738538/T6738538a.java index 8817c2e31a1..cc2fea6194f 100644 --- a/langtools/test/tools/javac/OverrideChecks/6738538/T6738538a.java +++ b/langtools/test/tools/javac/OverrideChecks/6738538/T6738538a.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/OverrideChecks/6738538/T6738538b.java b/langtools/test/tools/javac/OverrideChecks/6738538/T6738538b.java index ebfc9fae4e6..072da26d330 100644 --- a/langtools/test/tools/javac/OverrideChecks/6738538/T6738538b.java +++ b/langtools/test/tools/javac/OverrideChecks/6738538/T6738538b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/T6358024.java b/langtools/test/tools/javac/T6358024.java index ae2d8ab2f5d..1aa511543f2 100644 --- a/langtools/test/tools/javac/T6358024.java +++ b/langtools/test/tools/javac/T6358024.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/T6403466.java b/langtools/test/tools/javac/T6403466.java index efeff335ef2..f6556fca2e3 100644 --- a/langtools/test/tools/javac/T6403466.java +++ b/langtools/test/tools/javac/T6403466.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/T6411379.java b/langtools/test/tools/javac/T6411379.java index a35d607e546..261ee98eef6 100644 --- a/langtools/test/tools/javac/T6411379.java +++ b/langtools/test/tools/javac/T6411379.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/T6423583.java b/langtools/test/tools/javac/T6423583.java index c6dfeacd0fd..d9fc9674604 100644 --- a/langtools/test/tools/javac/T6423583.java +++ b/langtools/test/tools/javac/T6423583.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/T6705935.java b/langtools/test/tools/javac/T6705935.java index 45e7454d140..5cc770aece3 100644 --- a/langtools/test/tools/javac/T6705935.java +++ b/langtools/test/tools/javac/T6705935.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import java.io.*; import java.util.*; import javax.tools.*; import com.sun.tools.javac.file.*; +import com.sun.tools.javac.file.ZipArchive.ZipFileObject; +import com.sun.tools.javac.file.ZipFileIndexArchive.ZipFileIndexFileObject; public class T6705935 { public static void main(String... args) throws Exception { @@ -43,11 +45,22 @@ public class T6705935 { java_home = java_home.getParentFile(); JavaCompiler c = ToolProvider.getSystemJavaCompiler(); - JavaFileManager fm = c.getStandardFileManager(null, null, null); + StandardJavaFileManager fm = c.getStandardFileManager(null, null, null); + //System.err.println("platform class path: " + asList(fm.getLocation(StandardLocation.PLATFORM_CLASS_PATH))); + for (JavaFileObject fo: fm.list(StandardLocation.PLATFORM_CLASS_PATH, "java.lang", Collections.singleton(JavaFileObject.Kind.CLASS), false)) { + test++; + + if (!(fo instanceof ZipFileObject || fo instanceof ZipFileIndexFileObject)) { + System.out.println("Skip " + fo.getClass().getSimpleName() + " " + fo.getName()); + skip++; + continue; + } + + //System.err.println(fo.getName()); String p = fo.getName(); int bra = p.indexOf("("); int ket = p.indexOf(")"); @@ -61,5 +74,26 @@ public class T6705935 { throw new Exception("bad path: " + p); } + + if (test == 0) + throw new Exception("no files found"); + + if (skip == 0) + System.out.println(test + " files found"); + else + System.out.println(test + " files found, " + skip + " files skipped"); + + if (test == skip) + System.out.println("Warning: all files skipped; no platform classes found in zip files."); } + + private List asList(Iterable items) { + List list = new ArrayList(); + for (T item: items) + list.add(item); + return list; + } + + private int skip; + private int test; } diff --git a/langtools/test/tools/javac/T6900037.java b/langtools/test/tools/javac/T6900037.java new file mode 100644 index 00000000000..c5002e02e20 --- /dev/null +++ b/langtools/test/tools/javac/T6900037.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6900037 + * @summary javac should warn if earlier -source is used and bootclasspath not set + * @compile T6900037.java + * @compile -source 1.6 T6900037.java + * @compile/fail/ref=T6900037.out -XDrawDiagnostics -Werror -source 1.6 T6900037.java + * @compile -Werror -source 1.6 -Xlint:-options T6900037.java + */ + +class T6900037 { } diff --git a/langtools/test/tools/javac/T6900037.out b/langtools/test/tools/javac/T6900037.out new file mode 100644 index 00000000000..f98225f4ecf --- /dev/null +++ b/langtools/test/tools/javac/T6900037.out @@ -0,0 +1,4 @@ +- compiler.warn.source.no.bootclasspath: 1.6 +- compiler.err.warnings.and.werror +1 error +1 warning diff --git a/langtools/test/tools/javac/T6985181.java b/langtools/test/tools/javac/T6985181.java deleted file mode 100644 index fd588d1d71f..00000000000 --- a/langtools/test/tools/javac/T6985181.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6985181 - * @summary Annotations lost from classfile - */ - -import java.io.*; -import java.util.*; - -public class T6985181 { - public static void main(String... args) throws Exception{ - new T6985181().run(); - } - - public void run() throws Exception { - String code = "@interface Simple { }\ninterface Test<@Simple T> { }"; - - File srcFile = writeFile("Test.java", code); - File classesDir = new File("classes"); - classesDir.mkdirs(); - compile("-d", classesDir.getPath(), srcFile.getPath()); - String out = javap(new File(classesDir, srcFile.getName().replace(".java", ".class"))); - if (!out.contains("RuntimeInvisibleTypeAnnotations")) - throw new Exception("RuntimeInvisibleTypeAnnotations not found"); - } - - void compile(String... args) throws Exception { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - int rc = com.sun.tools.javac.Main.compile(args, pw); - pw.close(); - String out = sw.toString(); - if (out.length() > 0) - System.err.println(out); - if (rc != 0) - throw new Exception("Compilation failed: rc=" + rc); - } - - String javap(File classFile) throws Exception { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - String[] args = { "-v", classFile.getPath() }; - int rc = com.sun.tools.javap.Main.run(args, pw); - pw.close(); - String out = sw.toString(); - if (out.length() > 0) - System.err.println(out); - if (rc != 0) - throw new Exception("javap failed: rc=" + rc); - return out; - } - - File writeFile(String path, String body) throws IOException { - File f = new File(path); - FileWriter out = new FileWriter(f); - try { - out.write(body); - } finally { - out.close(); - } - return f; - } -} diff --git a/langtools/test/tools/javac/T6993301.java b/langtools/test/tools/javac/T6993301.java new file mode 100644 index 00000000000..ab5d532a3d5 --- /dev/null +++ b/langtools/test/tools/javac/T6993301.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6993301 + * @summary catch parameters do not have correct kind (i.e. ElementKind.EXCEPTION_PARAMETER) + */ + +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.tree.IdentifierTree; +import com.sun.source.tree.VariableTree; +import com.sun.source.util.TreePathScanner; +import com.sun.source.util.Trees; +import com.sun.tools.javac.api.JavacTaskImpl; +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; + +/** + * + * @author Jan Lahoda + */ +public class T6993301 { + public static void main(String... args) throws Exception { + new T6993301().testExceptionParameterCorrectKind(); + } + + static class MyFileObject extends SimpleJavaFileObject { + private String text; + public MyFileObject(String text) { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + this.text = text; + } + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return text; + } + } + + public void testExceptionParameterCorrectKind() throws IOException { + final String bootPath = System.getProperty("sun.boot.class.path"); + final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); + assert tool != null; + + String code = "package test; public class Test { { try { } catch (NullPointerException ex) {} } }"; + + final JavacTaskImpl ct = (JavacTaskImpl)tool.getTask(null, null, null, + Arrays.asList("-bootclasspath", bootPath), + null, Arrays.asList(new MyFileObject(code))); + CompilationUnitTree cut = ct.parse().iterator().next(); + + ct.analyze(); + + new TreePathScanner() { + @Override + public Void visitVariable(VariableTree node, Void p) { + Element el = Trees.instance(ct).getElement(getCurrentPath()); + + assertNotNull(el); + assertEquals(ElementKind.EXCEPTION_PARAMETER, el.getKind()); + + return super.visitVariable(node, p); + } + }.scan(cut, null); + } + + private void assertNotNull(Object o) { + if (o == null) + throw new AssertionError(); + } + + private void assertEquals(T expected, T actual) { + if (expected == null ? actual == null : expected.equals(actual)) + return; + throw new AssertionError("expected: " + expected + ", actual: " + actual); + } + +} diff --git a/langtools/test/tools/javac/T6999210.java b/langtools/test/tools/javac/T6999210.java new file mode 100644 index 00000000000..7de019610c7 --- /dev/null +++ b/langtools/test/tools/javac/T6999210.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6999210 + * @summary javac should be able to warn of anomalous conditions in classfiles + */ + +import java.io.*; +import java.util.*; + +public class T6999210 { + public static void main(String... args) throws Exception { + new T6999210().run(); + } + + void run() throws Exception { + File srcDir = new File("src"); + File classesDir = new File("classes"); + classesDir.mkdirs(); + + File c_java = writeFile(srcDir, "C.java", "class C { }"); + compile("-d", classesDir.getPath(), c_java.getPath()); + File c_class = new File(classesDir, "C.class"); + setMajorVersion(c_class, 48); + File d_java = writeFile(srcDir, "D.java", "class D { C c; }"); + + // verify no warning if -Xlint:classfile not enabled + String out1 = compile( + "-d", classesDir.getPath(), + "-classpath", classesDir.getPath(), + d_java.getPath()); + if (out1.length() > 0) + error("unexpected output from javac"); + + // sanity check of warning when -XDrawDiagnostics not used + String out2 = compile( + "-d", classesDir.getPath(), + "-classpath", classesDir.getPath(), + "-Xlint:classfile", + d_java.getPath()); + if (!out2.contains("[classfile]")) + error("expected output \"[classfile]\" not found"); + + // check specific details, using -XDrawDiagnostics + String out3 = compile( + "-d", classesDir.getPath(), + "-classpath", classesDir.getPath(), + "-Xlint:classfile", "-XDrawDiagnostics", + d_java.getPath()); + String expect = "C.class:-:-: compiler.warn.future.attr: Signature, 49, 0, 48, 0"; + if (!out3.contains(expect)) + error("expected output \"" + expect + "\" not found"); + + if (errors > 0) + throw new Exception(errors + " errors occurred"); + } + + String compile(String... args) throws Exception { + System.err.println("compile: " + Arrays.asList(args)); + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + int rc = com.sun.tools.javac.Main.compile(args, pw); + pw.close(); + String out = sw.toString(); + if (out.length() > 0) + System.err.println(out); + if (rc != 0) + throw new Exception("compilation failed, rc=" + rc); + return out; + } + + void setMajorVersion(File f, int major) throws IOException { + int len = (int) f.length(); + byte[] data = new byte[len]; + try (DataInputStream in = new DataInputStream(new FileInputStream(f))) { + in.readFully(data); + } + // u4 magic + // u2 minor + data[6] = (byte) (major >> 8); + data[7] = (byte) (major & 0xff); + try (FileOutputStream out = new FileOutputStream(f)) { + out.write(data); + } + } + + File writeFile(File dir, String path, String body) throws IOException { + File f = new File(dir, path); + f.getParentFile().mkdirs(); + try (FileWriter out = new FileWriter(f)) { + out.write(body); + } + return f; + } + + void error(String msg) { + System.err.println("Error: " + msg); + errors++; + } + + int errors; +} diff --git a/langtools/test/tools/javac/ThrowsIntersection_1.java b/langtools/test/tools/javac/ThrowsIntersection_1.java index 2dee7972abb..da1fe2cde5b 100644 --- a/langtools/test/tools/javac/ThrowsIntersection_1.java +++ b/langtools/test/tools/javac/ThrowsIntersection_1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/ThrowsIntersection_2.java b/langtools/test/tools/javac/ThrowsIntersection_2.java index 07451efd82a..facaa519df7 100644 --- a/langtools/test/tools/javac/ThrowsIntersection_2.java +++ b/langtools/test/tools/javac/ThrowsIntersection_2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/ThrowsIntersection_3.java b/langtools/test/tools/javac/ThrowsIntersection_3.java index 323f1e80552..0c53ad629e0 100644 --- a/langtools/test/tools/javac/ThrowsIntersection_3.java +++ b/langtools/test/tools/javac/ThrowsIntersection_3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/ThrowsIntersection_4.java b/langtools/test/tools/javac/ThrowsIntersection_4.java index b743aa939d3..4fea7a00b83 100644 --- a/langtools/test/tools/javac/ThrowsIntersection_4.java +++ b/langtools/test/tools/javac/ThrowsIntersection_4.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/TryWithResources/ArmLint.out b/langtools/test/tools/javac/TryWithResources/ArmLint.out deleted file mode 100644 index f60161a5257..00000000000 --- a/langtools/test/tools/javac/TryWithResources/ArmLint.out +++ /dev/null @@ -1,3 +0,0 @@ -ArmLint.java:14:15: compiler.warn.twr.explicit.close.call -ArmLint.java:13:13: compiler.warn.automatic.resource.not.referenced: r3 -2 warnings diff --git a/langtools/test/tools/javac/TryWithResources/ImplicitFinal.out b/langtools/test/tools/javac/TryWithResources/ImplicitFinal.out index 0e33814b83f..062fd46b668 100644 --- a/langtools/test/tools/javac/TryWithResources/ImplicitFinal.out +++ b/langtools/test/tools/javac/TryWithResources/ImplicitFinal.out @@ -1,2 +1,2 @@ -ImplicitFinal.java:14:13: compiler.err.twr.resource.may.not.be.assigned: r +ImplicitFinal.java:14:13: compiler.err.try.resource.may.not.be.assigned: r 1 error diff --git a/langtools/test/tools/javac/TryWithResources/PlainTry.java b/langtools/test/tools/javac/TryWithResources/PlainTry.java index fad4ca8c054..294012f8b83 100644 --- a/langtools/test/tools/javac/TryWithResources/PlainTry.java +++ b/langtools/test/tools/javac/TryWithResources/PlainTry.java @@ -3,8 +3,8 @@ * @bug 6911256 6964740 * @author Joseph D. Darcy * @summary Test error messages for an unadorned try - * @compile/fail/ref=PlainTry6.out -XDrawDiagnostics -source 6 PlainTry.java - * @compile/fail/ref=PlainTry.out -XDrawDiagnostics PlainTry.java + * @compile/fail/ref=PlainTry6.out -XDrawDiagnostics -source 6 -Xlint:-options PlainTry.java + * @compile/fail/ref=PlainTry.out -XDrawDiagnostics PlainTry.java */ public class PlainTry { public static void main(String... args) { diff --git a/langtools/test/tools/javac/TryWithResources/ArmLint.java b/langtools/test/tools/javac/TryWithResources/TwrLint.java similarity index 68% rename from langtools/test/tools/javac/TryWithResources/ArmLint.java rename to langtools/test/tools/javac/TryWithResources/TwrLint.java index 2a5a22392ba..39c5ed67f8f 100644 --- a/langtools/test/tools/javac/TryWithResources/ArmLint.java +++ b/langtools/test/tools/javac/TryWithResources/TwrLint.java @@ -2,15 +2,15 @@ * @test /nodynamiccopyright/ * @bug 6911256 6964740 6965277 6967065 * @author Joseph D. Darcy - * @summary Check that -Xlint:arm warnings are generated as expected - * @compile/ref=ArmLint.out -Xlint:arm,deprecation -XDrawDiagnostics ArmLint.java + * @summary Check that -Xlint:twr warnings are generated as expected + * @compile/ref=TwrLint.out -Xlint:try,deprecation -XDrawDiagnostics TwrLint.java */ -class ArmLint implements AutoCloseable { +class TwrLint implements AutoCloseable { private static void test1() { - try(ArmLint r1 = new ArmLint(); - ArmLint r2 = new ArmLint(); - ArmLint r3 = new ArmLint()) { + try(TwrLint r1 = new TwrLint(); + TwrLint r2 = new TwrLint(); + TwrLint r3 = new TwrLint()) { r1.close(); // The resource's close r2.close(42); // *Not* the resource's close // r3 not referenced @@ -18,11 +18,11 @@ class ArmLint implements AutoCloseable { } - @SuppressWarnings("arm") + @SuppressWarnings("try") private static void test2() { try(@SuppressWarnings("deprecation") AutoCloseable r4 = new DeprecatedAutoCloseable()) { - // r4 not referenced + // r4 not referenced - but no warning is generated because of @SuppressWarnings } catch(Exception e) { ; } diff --git a/langtools/test/tools/javac/TryWithResources/TwrLint.out b/langtools/test/tools/javac/TryWithResources/TwrLint.out new file mode 100644 index 00000000000..9b3f6188b14 --- /dev/null +++ b/langtools/test/tools/javac/TryWithResources/TwrLint.out @@ -0,0 +1,3 @@ +TwrLint.java:14:15: compiler.warn.try.explicit.close.call +TwrLint.java:13:13: compiler.warn.try.resource.not.referenced: r3 +2 warnings diff --git a/langtools/test/tools/javac/TryWithResources/TwrOnNonResource.out b/langtools/test/tools/javac/TryWithResources/TwrOnNonResource.out index a894aff7ffb..eafdbfbf632 100644 --- a/langtools/test/tools/javac/TryWithResources/TwrOnNonResource.out +++ b/langtools/test/tools/javac/TryWithResources/TwrOnNonResource.out @@ -1,7 +1,7 @@ -TwrOnNonResource.java:12:13: compiler.err.prob.found.req: (compiler.misc.twr.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable -TwrOnNonResource.java:15:13: compiler.err.prob.found.req: (compiler.misc.twr.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable -TwrOnNonResource.java:18:13: compiler.err.prob.found.req: (compiler.misc.twr.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable -TwrOnNonResource.java:24:13: compiler.err.prob.found.req: (compiler.misc.twr.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable -TwrOnNonResource.java:27:13: compiler.err.prob.found.req: (compiler.misc.twr.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable -TwrOnNonResource.java:30:13: compiler.err.prob.found.req: (compiler.misc.twr.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable +TwrOnNonResource.java:12:13: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable +TwrOnNonResource.java:15:13: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable +TwrOnNonResource.java:18:13: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable +TwrOnNonResource.java:24:13: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable +TwrOnNonResource.java:27:13: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable +TwrOnNonResource.java:30:13: compiler.err.prob.found.req: (compiler.misc.try.not.applicable.to.type), TwrOnNonResource, java.lang.AutoCloseable 6 errors diff --git a/langtools/test/tools/javac/TryWithResources/TwrSuppression.java b/langtools/test/tools/javac/TryWithResources/TwrSuppression.java index 2b06b0f51d3..9834d5a17b2 100644 --- a/langtools/test/tools/javac/TryWithResources/TwrSuppression.java +++ b/langtools/test/tools/javac/TryWithResources/TwrSuppression.java @@ -36,7 +36,7 @@ public class TwrSuppression implements AutoCloseable { throw new RuntimeException(); } } catch(RuntimeException e) { - Throwable[] suppressedExceptions = e.getSuppressedExceptions(); + Throwable[] suppressedExceptions = e.getSuppressed(); int length = suppressedExceptions.length; if (length != 2) throw new RuntimeException("Unexpected length " + length); diff --git a/langtools/test/tools/javac/TryWithResources/TwrTests.java b/langtools/test/tools/javac/TryWithResources/TwrTests.java index c3ca6176573..124227989aa 100644 --- a/langtools/test/tools/javac/TryWithResources/TwrTests.java +++ b/langtools/test/tools/javac/TryWithResources/TwrTests.java @@ -90,7 +90,7 @@ public class TwrTests { } catch (Resource.CreateFailException e) { creationFailuresDetected++; checkCreateFailureId(e.resourceId(), createFailureId); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { throw new AssertionError("Secondary exception suppression failed"); } @@ -112,7 +112,7 @@ public class TwrTests { } catch (Resource.CreateFailException e) { creationFailuresDetected++; checkCreateFailureId(e.resourceId(), createFailureId); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { throw new AssertionError("Secondary exception suppression failed"); } @@ -134,7 +134,7 @@ public class TwrTests { } catch (Resource.CreateFailException e) { creationFailuresDetected++; checkCreateFailureId(e.resourceId(), createFailureId); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { throw new AssertionError("Secondary exception suppression failed:" + e); } @@ -158,7 +158,7 @@ public class TwrTests { } catch (Resource.CreateFailException e) { creationFailuresDetected++; checkCreateFailureId(e.resourceId(), createFailureId); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { throw new AssertionError("Secondary exception suppression failed:" + e); } @@ -181,7 +181,7 @@ public class TwrTests { } catch (Resource.CreateFailException e) { creationFailuresDetected++; checkCreateFailureId(e.resourceId(), createFailureId); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { throw new AssertionError("Secondary exception suppression failed:" + e); } @@ -207,7 +207,7 @@ public class TwrTests { } catch (Resource.CreateFailException e) { creationFailuresDetected++; checkCreateFailureId(e.resourceId(), createFailureId); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { throw new AssertionError("Secondary exception suppression failed:" + e); } @@ -231,7 +231,7 @@ public class TwrTests { } catch (Resource.CreateFailException e) { creationFailuresDetected++; checkCreateFailureId(e.resourceId(), createFailureId); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { throw new AssertionError("Secondary exception suppression failed:" + e); } @@ -259,7 +259,7 @@ public class TwrTests { } catch (Resource.CreateFailException e) { creationFailuresDetected++; checkCreateFailureId(e.resourceId(), createFailureId); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { throw new AssertionError("Secondary exception suppression failed:" + e); } @@ -310,7 +310,7 @@ public class TwrTests { * Check for proper suppressed exceptions in proper order. * * @param suppressedExceptions the suppressed exceptions array returned by - * getSuppressedExceptions() + * getSuppressed() * @bitmap a bitmap indicating which suppressed exceptions are expected. * Bit i is set iff id should throw a CloseFailException. */ @@ -376,7 +376,7 @@ public class TwrTests { } catch (MyKindOfException e) { if (failure == 0) throw new AssertionError("Unexpected MyKindOfException"); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { if (failure == 1) throw new AssertionError("Secondary exception suppression failed"); @@ -388,7 +388,7 @@ public class TwrTests { throw new AssertionError("CloseFailException: got id " + id + ", expected lg(" + highestCloseFailBit +")"); } - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit); + checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit); } checkClosedList(closedList, 1); } @@ -409,7 +409,7 @@ public class TwrTests { } catch (MyKindOfException e) { if (failure == 0) throw new AssertionError("Unexpected MyKindOfException"); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { if (failure == 1) throw new AssertionError("Secondary exception suppression failed"); @@ -421,7 +421,7 @@ public class TwrTests { throw new AssertionError("CloseFailException: got id " + id + ", expected lg(" + highestCloseFailBit +")"); } - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit); + checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit); } checkClosedList(closedList, 2); } @@ -443,7 +443,7 @@ public class TwrTests { } catch (MyKindOfException e) { if (failure == 0) throw new AssertionError("Unexpected MyKindOfException"); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { if (failure == 1) throw new AssertionError("Secondary exception suppression failed"); @@ -455,7 +455,7 @@ public class TwrTests { throw new AssertionError("CloseFailException: got id " + id + ", expected lg(" + highestCloseFailBit +")"); } - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit); + checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit); } checkClosedList(closedList, 2); } @@ -477,7 +477,7 @@ public class TwrTests { } catch (MyKindOfException e) { if (failure == 0) throw new AssertionError("Unexpected MyKindOfException"); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { if (failure == 1) throw new AssertionError("Secondary exception suppression failed"); @@ -489,7 +489,7 @@ public class TwrTests { throw new AssertionError("CloseFailException: got id " + id + ", expected lg(" + highestCloseFailBit +")"); } - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit); + checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit); } checkClosedList(closedList, 3); } @@ -513,7 +513,7 @@ public class TwrTests { } catch (MyKindOfException e) { if (failure == 0) throw new AssertionError("Unexpected MyKindOfException"); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { if (failure == 1) throw new AssertionError("Secondary exception suppression failed"); @@ -525,7 +525,7 @@ public class TwrTests { throw new AssertionError("CloseFailException: got id " + id + ", expected lg(" + highestCloseFailBit +")"); } - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit); + checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit); } checkClosedList(closedList, 3); } @@ -548,7 +548,7 @@ public class TwrTests { } catch (MyKindOfException e) { if (failure == 0) throw new AssertionError("Unexpected MyKindOfException"); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { if (failure == 1) throw new AssertionError("Secondary exception suppression failed"); @@ -560,7 +560,7 @@ public class TwrTests { throw new AssertionError("CloseFailException: got id " + id + ", expected lg(" + highestCloseFailBit +")"); } - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit); + checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit); } checkClosedList(closedList, 4); } @@ -586,7 +586,7 @@ public class TwrTests { } catch (MyKindOfException e) { if (failure == 0) throw new AssertionError("Unexpected MyKindOfException"); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { if (failure == 1) throw new AssertionError("Secondary exception suppression failed"); @@ -598,7 +598,7 @@ public class TwrTests { throw new AssertionError("CloseFailException: got id " + id + ", expected lg(" + highestCloseFailBit +")"); } - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit); + checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit); } checkClosedList(closedList, 4); } @@ -621,7 +621,7 @@ public class TwrTests { } catch (MyKindOfException e) { if (failure == 0) throw new AssertionError("Unexpected MyKindOfException"); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { if (failure == 1) throw new AssertionError("Secondary exception suppression failed"); @@ -633,7 +633,7 @@ public class TwrTests { throw new AssertionError("CloseFailException: got id " + id + ", expected lg(" + highestCloseFailBit +")"); } - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit); + checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit); } checkClosedList(closedList, 5); } @@ -660,7 +660,7 @@ public class TwrTests { } catch (MyKindOfException e) { if (failure == 0) throw new AssertionError("Unexpected MyKindOfException"); - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap); + checkSuppressedExceptions(e.getSuppressed(), bitMap); } catch (Resource.CloseFailException e) { if (failure == 1) throw new AssertionError("Secondary exception suppression failed"); @@ -672,7 +672,7 @@ public class TwrTests { throw new AssertionError("CloseFailException: got id " + id + ", expected lg(" + highestCloseFailBit +")"); } - checkSuppressedExceptions(e.getSuppressedExceptions(), bitMap & ~highestCloseFailBit); + checkSuppressedExceptions(e.getSuppressed(), bitMap & ~highestCloseFailBit); } checkClosedList(closedList, 5); } diff --git a/langtools/test/tools/javac/annotations/6214965/T6214965.java b/langtools/test/tools/javac/annotations/6214965/T6214965.java index 5d5f8ff3054..cdac2431271 100644 --- a/langtools/test/tools/javac/annotations/6214965/T6214965.java +++ b/langtools/test/tools/javac/annotations/6214965/T6214965.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/annotations/6214965/T6214965.out b/langtools/test/tools/javac/annotations/6214965/T6214965.out index 4bc9ef58681..3fba92d08e8 100644 --- a/langtools/test/tools/javac/annotations/6214965/T6214965.out +++ b/langtools/test/tools/javac/annotations/6214965/T6214965.out @@ -1,2 +1,2 @@ -- compiler.warn.annotation.method.not.found: CompilerAnnotationTest2, name2 +CompilerAnnotationTest.class:-:-: compiler.warn.annotation.method.not.found: CompilerAnnotationTest2, name2 1 warning diff --git a/langtools/test/tools/javac/annotations/6365854/T6365854.java b/langtools/test/tools/javac/annotations/6365854/T6365854.java index bf16feb4947..daa24f651f7 100644 --- a/langtools/test/tools/javac/annotations/6365854/T6365854.java +++ b/langtools/test/tools/javac/annotations/6365854/T6365854.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/annotations/6365854/test1.out b/langtools/test/tools/javac/annotations/6365854/test1.out index 00eaf216db2..c8bf69b095d 100644 --- a/langtools/test/tools/javac/annotations/6365854/test1.out +++ b/langtools/test/tools/javac/annotations/6365854/test1.out @@ -1,2 +1,2 @@ -- compiler.warn.annotation.method.not.found.reason: test.annotation.TestAnnotation, test, (compiler.misc.class.file.not.found: test.annotation.TestAnnotation) +TestCore.class:-:-: compiler.warn.annotation.method.not.found.reason: test.annotation.TestAnnotation, test, (compiler.misc.class.file.not.found: test.annotation.TestAnnotation) 1 warning diff --git a/langtools/test/tools/javac/annotations/6365854/test2.out b/langtools/test/tools/javac/annotations/6365854/test2.out index a661939fbc7..13fe08dce97 100644 --- a/langtools/test/tools/javac/annotations/6365854/test2.out +++ b/langtools/test/tools/javac/annotations/6365854/test2.out @@ -1,2 +1,2 @@ -- compiler.warn.annotation.method.not.found: test.annotation.TestAnnotation, test +TestCore.class:-:-: compiler.warn.annotation.method.not.found: test.annotation.TestAnnotation, test 1 warning diff --git a/langtools/test/tools/javac/annotations/6881115/T6881115.java b/langtools/test/tools/javac/annotations/6881115/T6881115.java index a0b9960c2fe..2f779c4ac46 100644 --- a/langtools/test/tools/javac/annotations/6881115/T6881115.java +++ b/langtools/test/tools/javac/annotations/6881115/T6881115.java @@ -16,5 +16,5 @@ } @A(b = @B(b2 = 1, b2 = 2), b_arr = {@B(), @B(b2 = 1, b2 = 2)}) -class T6881115<@A(b = @B(b2 = 1, b2 = 2), - b_arr = {@B(), @B(b2 = 1, b2 = 2)}) X> {} +class T6881115 {} diff --git a/langtools/test/tools/javac/annotations/6881115/T6881115.out b/langtools/test/tools/javac/annotations/6881115/T6881115.out index 4cece230577..93b90cff473 100644 --- a/langtools/test/tools/javac/annotations/6881115/T6881115.out +++ b/langtools/test/tools/javac/annotations/6881115/T6881115.out @@ -8,9 +8,4 @@ T6881115.java:17:8: compiler.err.annotation.missing.default.value: B, b1 T6881115.java:18:13: compiler.err.annotation.missing.default.value.1: B, b1,b2 T6881115.java:18:30: compiler.err.duplicate.annotation.member.value: b2, B T6881115.java:18:19: compiler.err.annotation.missing.default.value: B, b1 -T6881115.java:19:34: compiler.err.duplicate.annotation.member.value: b2, B -T6881115.java:19:23: compiler.err.annotation.missing.default.value: B, b1 -T6881115.java:20:28: compiler.err.annotation.missing.default.value.1: B, b1,b2 -T6881115.java:20:45: compiler.err.duplicate.annotation.member.value: b2, B -T6881115.java:20:34: compiler.err.annotation.missing.default.value: B, b1 -15 errors +10 errors diff --git a/langtools/test/tools/javac/annotations/neg/Constant.java b/langtools/test/tools/javac/annotations/neg/Constant.java index fdcd3805a51..5ae4ed2c87f 100644 --- a/langtools/test/tools/javac/annotations/neg/Constant.java +++ b/langtools/test/tools/javac/annotations/neg/Constant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/annotations/neg/Dep.java b/langtools/test/tools/javac/annotations/neg/Dep.java index 4ffbe3f3ef0..4493366af78 100644 --- a/langtools/test/tools/javac/annotations/neg/Dep.java +++ b/langtools/test/tools/javac/annotations/neg/Dep.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,9 +27,9 @@ * @summary Please add annotation Deprecated to supplant the javadoc tag * @author gafter * - * @compile -source 1.4 -Xlint:dep-ann -Werror Dep.java - * @compile/fail -Xlint:dep-ann -Werror Dep.java - * @compile -Xlint:dep-ann Dep.java + * @compile -source 1.4 -Xlint:-options -Xlint:dep-ann -Werror Dep.java + * @compile/fail -Xlint:dep-ann -Werror Dep.java + * @compile -Xlint:dep-ann Dep.java */ /** @deprecated */ diff --git a/langtools/test/tools/javac/annotations/pos/TrailingComma.java b/langtools/test/tools/javac/annotations/pos/TrailingComma.java index 20345b56f89..d6601ce419d 100644 --- a/langtools/test/tools/javac/annotations/pos/TrailingComma.java +++ b/langtools/test/tools/javac/annotations/pos/TrailingComma.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/api/6406133/Erroneous.java b/langtools/test/tools/javac/api/6406133/Erroneous.java index ecd230006ff..36b8c7c2422 100644 --- a/langtools/test/tools/javac/api/6406133/Erroneous.java +++ b/langtools/test/tools/javac/api/6406133/Erroneous.java @@ -1,4 +1,26 @@ +/* + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + @Deprecated -class A { - class A {} +class A extends Missing { } diff --git a/langtools/test/tools/javac/api/6421111/T6421111.java b/langtools/test/tools/javac/api/6421111/T6421111.java index 5d3d4cf7b24..fc2c5816471 100644 --- a/langtools/test/tools/javac/api/6421111/T6421111.java +++ b/langtools/test/tools/javac/api/6421111/T6421111.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/api/6468404/T6468404.java b/langtools/test/tools/javac/api/6468404/T6468404.java index 18aa49566b3..8b7e0458066 100644 --- a/langtools/test/tools/javac/api/6468404/T6468404.java +++ b/langtools/test/tools/javac/api/6468404/T6468404.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/api/6598108/T6598108.java b/langtools/test/tools/javac/api/6598108/T6598108.java new file mode 100644 index 00000000000..a7ca25971aa --- /dev/null +++ b/langtools/test/tools/javac/api/6598108/T6598108.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6598108 + * @summary com.sun.source.util.Trees.isAccessible incorrect + * @author Jan Lahoda + */ + +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.tree.Scope; +import com.sun.source.util.JavacTask; +import com.sun.source.util.TreePath; +import com.sun.source.util.Trees; +import java.net.URI; +import java.util.Arrays; +import javax.lang.model.element.TypeElement; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; + +public class T6598108 { + public static void main(String[] args) throws Exception { + final String bootPath = System.getProperty("sun.boot.class.path"); //NOI18N + final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); + assert tool != null; + final JavacTask ct = (JavacTask)tool.getTask(null, null, null, Arrays.asList("-bootclasspath", bootPath), null, Arrays.asList(new MyFileObject())); + + CompilationUnitTree cut = ct.parse().iterator().next(); + TreePath tp = new TreePath(new TreePath(cut), cut.getTypeDecls().get(0)); + Scope s = Trees.instance(ct).getScope(tp); + TypeElement type = ct.getElements().getTypeElement("com.sun.java.util.jar.pack.Package.File"); + + if (Trees.instance(ct).isAccessible(s, type)) { + //com.sun.java.util.jar.pack.Package.File is a public innerclass inside a non-accessible class, so + //"false" would be expected here. + throw new IllegalStateException(""); + } + } + + static class MyFileObject extends SimpleJavaFileObject { + public MyFileObject() { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + } + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return "public class Test { public void test() {TTT ttt;}}"; + } + } +} diff --git a/langtools/test/tools/javac/api/6731573/T6731573.java b/langtools/test/tools/javac/api/6731573/T6731573.java index 9084a23b2b4..03d699aa6d5 100644 --- a/langtools/test/tools/javac/api/6731573/T6731573.java +++ b/langtools/test/tools/javac/api/6731573/T6731573.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/api/T6392782.java b/langtools/test/tools/javac/api/T6392782.java index f3c11d54462..9bb010070d1 100644 --- a/langtools/test/tools/javac/api/T6392782.java +++ b/langtools/test/tools/javac/api/T6392782.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/api/T6412669.java b/langtools/test/tools/javac/api/T6412669.java index 465ee25422d..de7e76051a3 100644 --- a/langtools/test/tools/javac/api/T6412669.java +++ b/langtools/test/tools/javac/api/T6412669.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * 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,12 @@ /* * @test - * @bug 6412669 + * @bug 6412669 6997958 * @summary Should be able to get SourcePositions from 269 world */ import java.io.*; +import java.net.*; import java.util.*; import javax.annotation.*; import javax.annotation.processing.*; @@ -39,28 +40,59 @@ import com.sun.tools.javac.api.*; @SupportedAnnotationTypes("*") public class T6412669 extends AbstractProcessor { - public static void main(String... args) throws IOException { - String testSrc = System.getProperty("test.src", "."); - String testClasses = System.getProperty("test.classes", "."); + public static void main(String... args) throws Exception { + File testSrc = new File(System.getProperty("test.src", ".")); + File testClasses = new File(System.getProperty("test.classes", ".")); + + // Determine location of necessary tools classes. Assume all in one place. + // Likely candidates are typically tools.jar (when testing JDK build) + // or build/classes or dist/javac.jar (when testing langtools, using -Xbootclasspath/p:) + File toolsClasses; + URL u = T6412669.class.getClassLoader().getResource("com/sun/source/util/JavacTask.class"); + switch (u.getProtocol()) { + case "file": + toolsClasses = new File(u.toURI()); + break; + case "jar": + String s = u.getFile(); // will be file:path!/entry + int sep = s.indexOf("!"); + toolsClasses = new File(new URI(s.substring(0, sep))); + break; + default: + throw new AssertionError("Cannot locate tools classes"); + } + //System.err.println("toolsClasses: " + toolsClasses); JavacTool tool = JavacTool.create(); StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null); - fm.setLocation(StandardLocation.CLASS_PATH, Arrays.asList(new File(testClasses))); + fm.setLocation(StandardLocation.CLASS_PATH, Arrays.asList(testClasses, toolsClasses)); Iterable files = fm.getJavaFileObjectsFromFiles(Arrays.asList(new File(testSrc, T6412669.class.getName()+".java"))); - String[] opts = { "-proc:only", "-processor", T6412669.class.getName(), - "-classpath", new File(testClasses).getPath() }; - JavacTask task = tool.getTask(null, fm, null, Arrays.asList(opts), null, files); - if (!task.call()) - throw new AssertionError("test failed"); + String[] opts = { "-proc:only", "-processor", T6412669.class.getName()}; + StringWriter sw = new StringWriter(); + JavacTask task = tool.getTask(sw, fm, null, Arrays.asList(opts), null, files); + boolean ok = task.call(); + String out = sw.toString(); + if (!out.isEmpty()) + System.err.println(out); + if (!ok) + throw new AssertionError("compilation of test program failed"); + // verify we found an annotated element to exercise the SourcePositions API + if (!out.contains("processing element")) + throw new AssertionError("expected text not found in compilation output"); } public boolean process(Set annotations, RoundEnvironment roundEnv) { Trees trees = Trees.instance(processingEnv); SourcePositions sp = trees.getSourcePositions(); Messager m = processingEnv.getMessager(); + m.printMessage(Diagnostic.Kind.NOTE, "processing annotations"); + int count = 0; for (TypeElement anno: annotations) { + count++; + m.printMessage(Diagnostic.Kind.NOTE, " processing annotation " + anno); for (Element e: roundEnv.getElementsAnnotatedWith(anno)) { + m.printMessage(Diagnostic.Kind.NOTE, " processing element " + e); TreePath p = trees.getPath(e); long start = sp.getStartPosition(p.getCompilationUnit(), p.getLeaf()); long end = sp.getEndPosition(p.getCompilationUnit(), p.getLeaf()); @@ -69,6 +101,8 @@ public class T6412669 extends AbstractProcessor { m.printMessage(k, "test [" + start + "," + end + "]", e); } } + if (count == 0) + m.printMessage(Diagnostic.Kind.NOTE, "no annotations found"); return true; } diff --git a/langtools/test/tools/javac/api/TestDocComments.java b/langtools/test/tools/javac/api/TestDocComments.java new file mode 100644 index 00000000000..ab47db9329c --- /dev/null +++ b/langtools/test/tools/javac/api/TestDocComments.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 6985202 + * @summary no access to doc comments from Tree API + */ + +import java.io.*; +import java.util.*; +import javax.tools.*; +import com.sun.source.tree.*; +import com.sun.source.util.*; +import com.sun.tools.javac.api.JavacTool; + +/** + * class-TestDocComments. + */ +public class TestDocComments { + /** + * method-main. + */ + public static void main(String... args) throws Exception { + new TestDocComments().run(); + } + + /** + * method-run. + */ + void run() throws Exception { + File testSrc = new File(System.getProperty("test.src")); + File file = new File(testSrc, "TestDocComments.java"); + + JavacTool tool = JavacTool.create(); + StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null); + + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + Iterable fileObjects = fm.getJavaFileObjects(file); + JavacTask task = tool.getTask(pw, fm, null, null, null, fileObjects); + Iterable units = task.parse(); + Trees trees = Trees.instance(task); + + CommentScanner s = new CommentScanner(); + int n = s.scan(units, trees); + + if (n != 12) + error("Unexpected number of doc comments found: " + n); + + if (errors > 0) + throw new Exception(errors + " errors occurred"); + } + + /** + * class-CommentScanner. + */ + class CommentScanner extends TreePathScanner { + + /** + * method-visitClass. + */ + @Override + public Integer visitClass(ClassTree t, Trees trees) { + return reduce(super.visitClass(t, trees), + check(trees, "class-" + t.getSimpleName() + ".")); + } + + /** + * method-visitMethod. + */ + @Override + public Integer visitMethod(MethodTree t, Trees trees) { + return reduce(super.visitMethod(t, trees), + check(trees, "method-" + t.getName() + ".")); + } + + /** + * method-visitVariable. + */ + @Override + public Integer visitVariable(VariableTree t, Trees trees) { + // for simplicity, only check fields, not parameters or local decls + int n = (getCurrentPath().getParentPath().getLeaf().getKind() == Tree.Kind.CLASS) + ? check(trees, "field-" + t.getName() + ".") + : 0; + return reduce(super.visitVariable(t, trees), n); + } + + /** + * method-reduce. + */ + @Override + public Integer reduce(Integer i1, Integer i2) { + return (i1 == null) ? i2 : (i2 == null) ? i1 : Integer.valueOf(i1 + i2); + } + + /** + * method-check. + */ + int check(Trees trees, String expect) { + TreePath p = getCurrentPath(); + String dc = trees.getDocComment(p); + + if (dc != null && dc.trim().equals(expect)) + return 1; + + Tree.Kind k = p.getLeaf().getKind(); + if (dc == null) + error("no doc comment for " + k); + else + error("unexpected doc comment for " + k + "\nexpect: " + expect + "\nfound: " + dc); + + return 0; + } + } + + /** + * method-nullCheck. + */ + int nullCheck(Integer i) { + return (i == null) ? 0 : i; + } + + /** + * method-error. + */ + void error(String msg) { + System.err.println("Error: " + msg); + errors++; + } + + /** + * field-errors. + */ + int errors; +} + diff --git a/langtools/test/tools/javac/api/TestOperators.java b/langtools/test/tools/javac/api/TestOperators.java index fa11740fd57..a963d05f6b7 100644 --- a/langtools/test/tools/javac/api/TestOperators.java +++ b/langtools/test/tools/javac/api/TestOperators.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/cast/6467183/T6467183a.out b/langtools/test/tools/javac/cast/6467183/T6467183a.out index 972d54de989..562a48a09b1 100644 --- a/langtools/test/tools/javac/cast/6467183/T6467183a.out +++ b/langtools/test/tools/javac/cast/6467183/T6467183a.out @@ -1,6 +1,4 @@ T6467183a.java:16:26: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a.B, T6467183a.A -T6467183a.java:24:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a.A, T6467183a.C -T6467183a.java:28:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a.A, T6467183a.C - compiler.err.warnings.and.werror 1 error -3 warnings +1 warning diff --git a/langtools/test/tools/javac/cast/6548436/T6548436d.java b/langtools/test/tools/javac/cast/6548436/T6548436d.java index d995ba4bb62..bf8833b26b0 100644 --- a/langtools/test/tools/javac/cast/6548436/T6548436d.java +++ b/langtools/test/tools/javac/cast/6548436/T6548436d.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/cast/6558559/T6558559a.java b/langtools/test/tools/javac/cast/6558559/T6558559a.java index 578d58aaca6..079877f8fc4 100644 --- a/langtools/test/tools/javac/cast/6558559/T6558559a.java +++ b/langtools/test/tools/javac/cast/6558559/T6558559a.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/cast/6558559/T6558559b.java b/langtools/test/tools/javac/cast/6558559/T6558559b.java index 4d88af4c0e3..32612885519 100644 --- a/langtools/test/tools/javac/cast/6558559/T6558559b.java +++ b/langtools/test/tools/javac/cast/6558559/T6558559b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/cast/6586091/T6586091.java b/langtools/test/tools/javac/cast/6586091/T6586091.java index 051893109eb..93c672bc24e 100644 --- a/langtools/test/tools/javac/cast/6586091/T6586091.java +++ b/langtools/test/tools/javac/cast/6586091/T6586091.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/cast/6714835/T6714835.java b/langtools/test/tools/javac/cast/6714835/T6714835.java new file mode 100644 index 00000000000..6c31596ae14 --- /dev/null +++ b/langtools/test/tools/javac/cast/6714835/T6714835.java @@ -0,0 +1,21 @@ +/* + * @test /nodynamiccopyright/ + * @author mcimadamore + * @bug 6714835 + * @summary Safe cast is rejected (with warning) by javac + * @compile/fail/ref=T6714835.out -Xlint:unchecked -Werror -XDrawDiagnostics T6714835.java + */ + +import java.util.*; + +class T6714835 { + void cast1(Iterable x) { + Collection x1 = (Collection)x; //ok + Collection x2 = (Collection)x; //warn + } + + void cast2(Iterable x) { + Collection x1 = (Collection)x; //ok + Collection x2 = (Collection)x; //warn + } +} diff --git a/langtools/test/tools/javac/cast/6714835/T6714835.out b/langtools/test/tools/javac/cast/6714835/T6714835.out new file mode 100644 index 00000000000..dc4a86b02ed --- /dev/null +++ b/langtools/test/tools/javac/cast/6714835/T6714835.out @@ -0,0 +1,5 @@ +T6714835.java:14:71: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), java.lang.Iterable, java.util.Collection +T6714835.java:19:73: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), java.lang.Iterable, java.util.Collection +- compiler.err.warnings.and.werror +1 error +2 warnings diff --git a/langtools/test/tools/javac/cast/7005095/T7005095neg.java b/langtools/test/tools/javac/cast/7005095/T7005095neg.java new file mode 100644 index 00000000000..1a767a2ecfc --- /dev/null +++ b/langtools/test/tools/javac/cast/7005095/T7005095neg.java @@ -0,0 +1,14 @@ +/* + * @test /nodynamiccopyright/ + * @bug 7005095 + * @summary Cast: compile reject sensible cast from final class to interface + * @compile/fail/ref=T7005095neg.out -XDrawDiagnostics T7005095neg.java + */ + +class T7005095pos { + interface Foo {} + + static final class FooImpl implements Foo {} + + Object o = (Foo) new FooImpl(); +} diff --git a/langtools/test/tools/javac/cast/7005095/T7005095neg.out b/langtools/test/tools/javac/cast/7005095/T7005095neg.out new file mode 100644 index 00000000000..88b831b59cb --- /dev/null +++ b/langtools/test/tools/javac/cast/7005095/T7005095neg.out @@ -0,0 +1,2 @@ +T7005095neg.java:13:25: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T7005095pos.FooImpl, T7005095pos.Foo +1 error diff --git a/langtools/test/tools/javac/cast/7005095/T7005095pos.java b/langtools/test/tools/javac/cast/7005095/T7005095pos.java new file mode 100644 index 00000000000..e89136c789e --- /dev/null +++ b/langtools/test/tools/javac/cast/7005095/T7005095pos.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7005095 + * @summary Cast: compile reject sensible cast from final class to interface + * @compile T7005095pos.java + */ + +class T7005095pos { + interface Foo {} + + static final class FooImpl implements Foo {} + + Object o = (Foo) new FooImpl(); +} diff --git a/langtools/test/tools/javac/cast/7005671/T7005671.java b/langtools/test/tools/javac/cast/7005671/T7005671.java new file mode 100644 index 00000000000..8c02f07a8fb --- /dev/null +++ b/langtools/test/tools/javac/cast/7005671/T7005671.java @@ -0,0 +1,32 @@ +/* + * @test /nodynamiccopyright/ + * @author mcimadamore + * @bug 7005671 + * @summary Regression: compiler accepts invalid cast from X[] to primitive array + * @compile/fail/ref=T7005671.out -XDrawDiagnostics T7005671.java + */ + +class T7005671 { + + void test1() { + Object o1 = (X[])(byte[])null; + Object o2 = (X[])(short[])null; + Object o3 = (X[])(int[])null; + Object o4 = (X[])(long[])null; + Object o5 = (X[])(float[])null; + Object o6 = (X[])(double[])null; + Object o7 = (X[])(char[])null; + Object o8 = (X[])(boolean[])null; + } + + void test2() { + Object o1 = (byte[])(X[])null; + Object o2 = (short[])(X[])null; + Object o3 = (int[])(X[])null; + Object o4 = (long[])(X[])null; + Object o5 = (float[])(X[])null; + Object o6 = (double[])(X[])null; + Object o7 = (char[])(X[])null; + Object o8 = (boolean[])(X[])null; + } +} diff --git a/langtools/test/tools/javac/cast/7005671/T7005671.out b/langtools/test/tools/javac/cast/7005671/T7005671.out new file mode 100644 index 00000000000..a6546224344 --- /dev/null +++ b/langtools/test/tools/javac/cast/7005671/T7005671.out @@ -0,0 +1,17 @@ +T7005671.java:12:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), byte[], X[] +T7005671.java:13:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), short[], X[] +T7005671.java:14:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), int[], X[] +T7005671.java:15:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), long[], X[] +T7005671.java:16:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), float[], X[] +T7005671.java:17:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), double[], X[] +T7005671.java:18:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), char[], X[] +T7005671.java:19:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), boolean[], X[] +T7005671.java:23:29: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], byte[] +T7005671.java:24:30: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], short[] +T7005671.java:25:28: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], int[] +T7005671.java:26:29: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], long[] +T7005671.java:27:30: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], float[] +T7005671.java:28:31: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], double[] +T7005671.java:29:29: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], char[] +T7005671.java:30:32: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], boolean[] +16 errors diff --git a/langtools/test/tools/javac/danglingDep/DepX.java b/langtools/test/tools/javac/danglingDep/DepX.java index b78c9788923..c2228ba8e0e 100644 --- a/langtools/test/tools/javac/danglingDep/DepX.java +++ b/langtools/test/tools/javac/danglingDep/DepX.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/danglingDep/NoDepX.java b/langtools/test/tools/javac/danglingDep/NoDepX.java index e46abce334e..57a6ad1dbd6 100644 --- a/langtools/test/tools/javac/danglingDep/NoDepX.java +++ b/langtools/test/tools/javac/danglingDep/NoDepX.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/danglingDep/Test1.java b/langtools/test/tools/javac/danglingDep/Test1.java index 9385eca6ea6..a3d68edfb47 100644 --- a/langtools/test/tools/javac/danglingDep/Test1.java +++ b/langtools/test/tools/javac/danglingDep/Test1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/depOverrides/annotation/Test1.java b/langtools/test/tools/javac/depOverrides/annotation/Test1.java index 3057757cd66..ef28836306b 100644 --- a/langtools/test/tools/javac/depOverrides/annotation/Test1.java +++ b/langtools/test/tools/javac/depOverrides/annotation/Test1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/depOverrides/annotation/Test2.java b/langtools/test/tools/javac/depOverrides/annotation/Test2.java index 10ef8c36d13..6595ca22de3 100644 --- a/langtools/test/tools/javac/depOverrides/annotation/Test2.java +++ b/langtools/test/tools/javac/depOverrides/annotation/Test2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test1.java b/langtools/test/tools/javac/depOverrides/doccomment/Test1.java index eabc072e810..563492d4d29 100644 --- a/langtools/test/tools/javac/depOverrides/doccomment/Test1.java +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/depOverrides/doccomment/Test2.java b/langtools/test/tools/javac/depOverrides/doccomment/Test2.java index 10ef8c36d13..6595ca22de3 100644 --- a/langtools/test/tools/javac/depOverrides/doccomment/Test2.java +++ b/langtools/test/tools/javac/depOverrides/doccomment/Test2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/diags/CheckExamples.java b/langtools/test/tools/javac/diags/CheckExamples.java index f0111a72c03..b29c5447b97 100644 --- a/langtools/test/tools/javac/diags/CheckExamples.java +++ b/langtools/test/tools/javac/diags/CheckExamples.java @@ -40,7 +40,7 @@ import java.util.*; * compiler.properties bundle. A list of exceptions may be given in the * not-yet.txt file. Entries on the not-yet.txt list should not be * covered by examples. - * When new keys are added to the resource buncle, it is strongly recommended + * When new keys are added to the resource bundle, it is strongly recommended * that corresponding new examples be added here, if at all practical, instead * of simply and lazily being added to the not-yet.txt list. */ @@ -129,12 +129,17 @@ public class CheckExamples { File testSrc = new File(System.getProperty("test.src")); File examples = new File(testSrc, "examples"); for (File f: examples.listFiles()) { - if (f.isDirectory() || f.isFile() && f.getName().endsWith(".java")) + if (isValidExample(f)) results.add(new Example(f)); } return results; } + boolean isValidExample(File f) { + return (f.isDirectory() && f.list().length > 0) || + (f.isFile() && f.getName().endsWith(".java")); + } + /** * Get the contents of the "not-yet" list. */ diff --git a/langtools/test/tools/javac/diags/FileManager.java b/langtools/test/tools/javac/diags/FileManager.java index 4132d25557d..2019eef6da4 100644 --- a/langtools/test/tools/javac/diags/FileManager.java +++ b/langtools/test/tools/javac/diags/FileManager.java @@ -177,12 +177,14 @@ public class FileManager } void checkRead() throws IOException { - if (cantRead != null && cantRead.matcher(getName()).matches()) + String canonName = getName().replace(File.separatorChar, '/'); + if (cantRead != null && cantRead.matcher(canonName).matches()) throw new IOException("FileManager: Can't read"); } void checkWrite() throws IOException { - if (cantWrite != null && cantWrite.matcher(getName()).matches()) + String canonName = getName().replace(File.separatorChar, '/'); + if (cantWrite != null && cantWrite.matcher(canonName).matches()) throw new IOException("FileManager: Can't write"); } diff --git a/langtools/test/tools/javac/diags/RunExamples.java b/langtools/test/tools/javac/diags/RunExamples.java index 2c2ba381741..751d1056b87 100644 --- a/langtools/test/tools/javac/diags/RunExamples.java +++ b/langtools/test/tools/javac/diags/RunExamples.java @@ -52,7 +52,7 @@ import java.util.regex.Pattern; */ public class RunExamples { public static void main(String... args) throws Exception { - boolean jtreg = (System.getProperty("test.src") != null); + jtreg = (System.getProperty("test.src") != null); File tmpDir; if (jtreg) { // use standard jtreg scratch directory: the current directory @@ -166,12 +166,17 @@ public class RunExamples { Set getExamples(File examplesDir) { Set results = new TreeSet(); for (File f: examplesDir.listFiles()) { - if (f.isDirectory() || f.isFile() && f.getName().endsWith(".java")) + if (isValidExample(f)) results.add(new Example(f)); } return results; } + boolean isValidExample(File f) { + return (f.isDirectory() && (!jtreg || f.list().length > 0)) || + (f.isFile() && f.getName().endsWith(".java")); + } + /** * Report an error. */ @@ -180,6 +185,8 @@ public class RunExamples { errors++; } + static boolean jtreg; + int errors; /** diff --git a/langtools/test/tools/javac/diags/examples.not-yet.txt b/langtools/test/tools/javac/diags/examples.not-yet.txt index 1a1fe5101aa..7979febe830 100644 --- a/langtools/test/tools/javac/diags/examples.not-yet.txt +++ b/langtools/test/tools/javac/diags/examples.not-yet.txt @@ -104,6 +104,7 @@ compiler.misc.wrong.version # ClassReader compiler.warn.annotation.method.not.found # ClassReader compiler.warn.annotation.method.not.found.reason # ClassReader compiler.warn.big.major.version # ClassReader +compiler.warn.future.attr # ClassReader compiler.warn.illegal.char.for.encoding compiler.warn.invalid.archive.file compiler.warn.override.bridge diff --git a/langtools/test/tools/javac/diags/examples/AnnotationsNotSupported.java b/langtools/test/tools/javac/diags/examples/AnnotationsNotSupported.java index 9ab2747c522..e318d70d6e3 100644 --- a/langtools/test/tools/javac/diags/examples/AnnotationsNotSupported.java +++ b/langtools/test/tools/javac/diags/examples/AnnotationsNotSupported.java @@ -22,7 +22,7 @@ */ // key: compiler.err.annotations.not.supported.in.source -// options: -source 1.4 +// options: -source 1.4 -Xlint:-options @Deprecated class AnnotationsNotSupported { } diff --git a/langtools/test/tools/javac/diags/examples/AssertAsIdentifier.java b/langtools/test/tools/javac/diags/examples/AssertAsIdentifier.java index 9c09276c158..5a4e5a258f3 100644 --- a/langtools/test/tools/javac/diags/examples/AssertAsIdentifier.java +++ b/langtools/test/tools/javac/diags/examples/AssertAsIdentifier.java @@ -22,7 +22,7 @@ */ // key: compiler.warn.assert.as.identifier -// options: -source 1.3 +// options: -source 1.3 -Xlint:-options class AssertAsIdentifier { int assert; diff --git a/langtools/test/tools/javac/diags/examples/BadSourceFileHeader/sourcepath/p/A.java b/langtools/test/tools/javac/diags/examples/BadSourceFileHeader/sourcepath/p/A.java index 13ec54b309c..ca342f9fe99 100644 --- a/langtools/test/tools/javac/diags/examples/BadSourceFileHeader/sourcepath/p/A.java +++ b/langtools/test/tools/javac/diags/examples/BadSourceFileHeader/sourcepath/p/A.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/diags/examples/DiamondNotSupported.java b/langtools/test/tools/javac/diags/examples/DiamondNotSupported.java index d4c2a13b201..82b38f1975b 100644 --- a/langtools/test/tools/javac/diags/examples/DiamondNotSupported.java +++ b/langtools/test/tools/javac/diags/examples/DiamondNotSupported.java @@ -22,7 +22,7 @@ */ // key: compiler.err.diamond.not.supported.in.source -// options: -source 6 +// options: -source 6 -Xlint:-options import java.util.*; diff --git a/langtools/test/tools/javac/diags/examples/DiamondRedundantArgs.java b/langtools/test/tools/javac/diags/examples/DiamondRedundantArgs.java new file mode 100644 index 00000000000..d8502c319ce --- /dev/null +++ b/langtools/test/tools/javac/diags/examples/DiamondRedundantArgs.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// key: compiler.warn.diamond.redundant.args +// options: -XDfindDiamond + +class Foo { + Foo fs = new Foo(); +} diff --git a/langtools/test/tools/javac/diags/examples/DiamondRedundantArgs1.java b/langtools/test/tools/javac/diags/examples/DiamondRedundantArgs1.java new file mode 100644 index 00000000000..ddc8502f92f --- /dev/null +++ b/langtools/test/tools/javac/diags/examples/DiamondRedundantArgs1.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// key: compiler.warn.diamond.redundant.args.1 +// options: -XDfindDiamond + +class Foo { + Foo fs = new Foo(); +} diff --git a/langtools/test/tools/javac/diags/examples/EnumAsIdentifier.java b/langtools/test/tools/javac/diags/examples/EnumAsIdentifier.java index 00ec5f712ea..bfa3d211ad3 100644 --- a/langtools/test/tools/javac/diags/examples/EnumAsIdentifier.java +++ b/langtools/test/tools/javac/diags/examples/EnumAsIdentifier.java @@ -22,7 +22,7 @@ */ // key: compiler.warn.enum.as.identifier -// options: -source 1.3 +// options: -source 1.3 -Xlint:-options class EnumAsIdentifier { int enum; diff --git a/langtools/test/tools/javac/diags/examples/EnumsNotSupported.java b/langtools/test/tools/javac/diags/examples/EnumsNotSupported.java index 6f288ca1057..5b90eec64b4 100644 --- a/langtools/test/tools/javac/diags/examples/EnumsNotSupported.java +++ b/langtools/test/tools/javac/diags/examples/EnumsNotSupported.java @@ -22,6 +22,6 @@ */ // key: compiler.err.enums.not.supported.in.source -// options: -source 1.4 +// options: -source 1.4 -Xlint:-options enum EnumsNotSupported { A, B, C } diff --git a/langtools/test/tools/javac/diags/examples/Expected2.java b/langtools/test/tools/javac/diags/examples/Expected2.java index 008146a0341..0eee97aff20 100644 --- a/langtools/test/tools/javac/diags/examples/Expected2.java +++ b/langtools/test/tools/javac/diags/examples/Expected2.java @@ -22,6 +22,6 @@ */ // key: compiler.err.expected2 -// options: -source 1.4 +// options: -source 1.4 -Xlint:-options int Expected2; diff --git a/langtools/test/tools/javac/diags/examples/ForeachNotSupported.java b/langtools/test/tools/javac/diags/examples/ForeachNotSupported.java index a8ec5b943a0..2590cb3c721 100644 --- a/langtools/test/tools/javac/diags/examples/ForeachNotSupported.java +++ b/langtools/test/tools/javac/diags/examples/ForeachNotSupported.java @@ -22,7 +22,7 @@ */ // key: compiler.err.foreach.not.supported.in.source -// options: -source 1.4 +// options: -source 1.4 -Xlint:-options class ForeachNotSupported { void m(String[] args) { diff --git a/langtools/test/tools/javac/diags/examples/GenericsNotSupported.java b/langtools/test/tools/javac/diags/examples/GenericsNotSupported.java index 374fe29a2fe..d64f74cb824 100644 --- a/langtools/test/tools/javac/diags/examples/GenericsNotSupported.java +++ b/langtools/test/tools/javac/diags/examples/GenericsNotSupported.java @@ -22,6 +22,6 @@ */ // key: compiler.err.generics.not.supported.in.source -// options: -source 1.4 +// options: -source 1.4 -Xlint:-options class GenericsNotSupported { } diff --git a/langtools/test/tools/javac/diags/examples/MulticatchNotSupported.java b/langtools/test/tools/javac/diags/examples/MulticatchNotSupported.java index 76efa83f592..9159a609fc1 100644 --- a/langtools/test/tools/javac/diags/examples/MulticatchNotSupported.java +++ b/langtools/test/tools/javac/diags/examples/MulticatchNotSupported.java @@ -22,7 +22,7 @@ */ // key: compiler.err.multicatch.not.supported.in.source -// options: -source 1.6 +// options: -source 1.6 -Xlint:-options class MulticatchNotSupported { class E1 extends Exception { } diff --git a/langtools/test/tools/javac/diags/examples/NeitherConditionalSubtype.java b/langtools/test/tools/javac/diags/examples/NeitherConditionalSubtype.java index 647487c450b..ac766332aad 100644 --- a/langtools/test/tools/javac/diags/examples/NeitherConditionalSubtype.java +++ b/langtools/test/tools/javac/diags/examples/NeitherConditionalSubtype.java @@ -22,7 +22,7 @@ */ // key: compiler.err.neither.conditional.subtype -// options: -source 1.4 +// options: -source 1.4 -Xlint:-options class X { Object m(boolean b) { diff --git a/langtools/test/tools/javac/diags/examples/ResourceClosed.java b/langtools/test/tools/javac/diags/examples/ResourceClosed.java index 6f08187d820..08b2391c71c 100644 --- a/langtools/test/tools/javac/diags/examples/ResourceClosed.java +++ b/langtools/test/tools/javac/diags/examples/ResourceClosed.java @@ -21,8 +21,8 @@ * questions. */ -// key: compiler.warn.twr.explicit.close.call -// options: -Xlint:arm +// key: compiler.warn.try.explicit.close.call +// options: -Xlint:try import java.io.*; diff --git a/langtools/test/tools/javac/diags/examples/ResourceMayNotBeAssigned.java b/langtools/test/tools/javac/diags/examples/ResourceMayNotBeAssigned.java index e8d5edf5ff5..b66245fc8e9 100644 --- a/langtools/test/tools/javac/diags/examples/ResourceMayNotBeAssigned.java +++ b/langtools/test/tools/javac/diags/examples/ResourceMayNotBeAssigned.java @@ -21,7 +21,7 @@ * questions. */ -// key: compiler.err.twr.resource.may.not.be.assigned +// key: compiler.err.try.resource.may.not.be.assigned import java.io.*; diff --git a/langtools/test/tools/javac/diags/examples/ResourceNotApplicableToType.java b/langtools/test/tools/javac/diags/examples/ResourceNotApplicableToType.java index 95890cff5bd..f34477ef237 100644 --- a/langtools/test/tools/javac/diags/examples/ResourceNotApplicableToType.java +++ b/langtools/test/tools/javac/diags/examples/ResourceNotApplicableToType.java @@ -21,7 +21,7 @@ * questions. */ -// key: compiler.misc.twr.not.applicable.to.type +// key: compiler.misc.try.not.applicable.to.type // key: compiler.err.prob.found.req class ResourceNotApplicableToType { diff --git a/langtools/test/tools/javac/diags/examples/ResourceNotReferenced.java b/langtools/test/tools/javac/diags/examples/ResourceNotReferenced.java index e4d9d9f5bfd..8f6cfb2e2e6 100644 --- a/langtools/test/tools/javac/diags/examples/ResourceNotReferenced.java +++ b/langtools/test/tools/javac/diags/examples/ResourceNotReferenced.java @@ -21,8 +21,8 @@ * questions. */ -// key: compiler.warn.automatic.resource.not.referenced -// options: -Xlint:arm +// key: compiler.warn.try.resource.not.referenced +// options: -Xlint:try import java.io.*; diff --git a/langtools/test/tools/javac/diags/examples/UnclosedBytecodeIdent.java b/langtools/test/tools/javac/diags/examples/SourceNoBootclasspath.java similarity index 91% rename from langtools/test/tools/javac/diags/examples/UnclosedBytecodeIdent.java rename to langtools/test/tools/javac/diags/examples/SourceNoBootclasspath.java index 0f74d279b99..6cc20165cef 100644 --- a/langtools/test/tools/javac/diags/examples/UnclosedBytecodeIdent.java +++ b/langtools/test/tools/javac/diags/examples/SourceNoBootclasspath.java @@ -21,8 +21,7 @@ * questions. */ -// key: compiler.err.unclosed.bytecode.ident +// key: compiler.warn.source.no.bootclasspath +// options: -source 6 -class UnclosedBytecodeIdent { - int #"abc -} +class SourceNoBootclasspath { } diff --git a/langtools/test/tools/javac/diags/examples/StaticImportNotSupported.java b/langtools/test/tools/javac/diags/examples/StaticImportNotSupported.java index ee151a25057..c545c19cd06 100644 --- a/langtools/test/tools/javac/diags/examples/StaticImportNotSupported.java +++ b/langtools/test/tools/javac/diags/examples/StaticImportNotSupported.java @@ -22,7 +22,7 @@ */ // key: compiler.err.static.import.not.supported.in.source -// options: -source 1.4 +// options: -source 1.4 -Xlint:-options import static java.util.regex.Pattern.*; diff --git a/langtools/test/tools/javac/diags/examples/StringSwitchNotSupported.java b/langtools/test/tools/javac/diags/examples/StringSwitchNotSupported.java index b6169d1c09c..3df19d6ee5f 100644 --- a/langtools/test/tools/javac/diags/examples/StringSwitchNotSupported.java +++ b/langtools/test/tools/javac/diags/examples/StringSwitchNotSupported.java @@ -22,7 +22,7 @@ */ // key: compiler.err.string.switch.not.supported.in.source -// options: -source 6 +// options: -source 6 -Xlint:-options class StringSwitchNotSupported { int m(String s) { diff --git a/langtools/test/tools/javac/diags/examples/TrustMeOnNonVarargsMeth.java b/langtools/test/tools/javac/diags/examples/TrustMeOnNonVarargsMeth.java new file mode 100644 index 00000000000..ca96b61b717 --- /dev/null +++ b/langtools/test/tools/javac/diags/examples/TrustMeOnNonVarargsMeth.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// key: compiler.err.varargs.invalid.trustme.anno +// key: compiler.misc.varargs.trustme.on.non.varargs.meth +// options: -Xlint:varargs + +class TrustMeOnNonVarargsMeth { + @SafeVarargs static void m(String[] args) { } +} diff --git a/langtools/test/tools/javac/diags/examples/TrustMeOnReifiableVarargsParam.java b/langtools/test/tools/javac/diags/examples/TrustMeOnReifiableVarargsParam.java new file mode 100644 index 00000000000..dc90a1a37f7 --- /dev/null +++ b/langtools/test/tools/javac/diags/examples/TrustMeOnReifiableVarargsParam.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// key: compiler.warn.varargs.redundant.trustme.anno +// key: compiler.misc.varargs.trustme.on.reifiable.varargs +// options: -Xlint:varargs + +class TrustMeOnReifiableVarargsParam { + @SafeVarargs static void m(String... args) { } +} diff --git a/langtools/test/tools/javac/diags/examples/TrustMeOnVirtualMethod.java b/langtools/test/tools/javac/diags/examples/TrustMeOnVirtualMethod.java new file mode 100644 index 00000000000..f4d40be8c84 --- /dev/null +++ b/langtools/test/tools/javac/diags/examples/TrustMeOnVirtualMethod.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// key: compiler.err.varargs.invalid.trustme.anno +// key: compiler.misc.varargs.trustme.on.virtual.varargs +// options: -Xlint:varargs,unchecked + +import java.util.List; + +class TrustMeOnVirtualMethod { + @SafeVarargs void m(List... args) { } +} diff --git a/langtools/test/tools/javac/diags/examples/TryResourceNotSupported.java b/langtools/test/tools/javac/diags/examples/TryResourceNotSupported.java index 4f2ca7c3714..bd3a04bb947 100644 --- a/langtools/test/tools/javac/diags/examples/TryResourceNotSupported.java +++ b/langtools/test/tools/javac/diags/examples/TryResourceNotSupported.java @@ -21,8 +21,8 @@ * questions. */ -// key: compiler.err.automatic.resource.management.not.supported.in.source -// options: -source 1.6 +// key: compiler.err.try.with.resources.not.supported.in.source +// options: -source 1.6 -Xlint:-options import java.io.*; diff --git a/langtools/test/tools/javac/diags/examples/TryWithoutCatchOrFinally.java b/langtools/test/tools/javac/diags/examples/TryWithoutCatchOrFinally.java index 78511219056..bd23aad855b 100644 --- a/langtools/test/tools/javac/diags/examples/TryWithoutCatchOrFinally.java +++ b/langtools/test/tools/javac/diags/examples/TryWithoutCatchOrFinally.java @@ -22,7 +22,7 @@ */ // key: compiler.err.try.without.catch.or.finally -// options: -source 1.6 +// options: -source 1.6 -Xlint:-options class TryWithoutCatchOrFinally { void m() { diff --git a/langtools/test/tools/javac/diags/examples/TypeParameterOnPolymorphicSignature.java b/langtools/test/tools/javac/diags/examples/TypeParameterOnPolymorphicSignature.java index 77a02b9c52e..fc23fde5412 100644 --- a/langtools/test/tools/javac/diags/examples/TypeParameterOnPolymorphicSignature.java +++ b/langtools/test/tools/javac/diags/examples/TypeParameterOnPolymorphicSignature.java @@ -24,8 +24,10 @@ // key: compiler.warn.type.parameter.on.polymorphic.signature // key: compiler.err.unreported.exception.need.to.catch.or.throw -import java.dyn.InvokeDynamic; +import java.dyn.MethodHandle; class TypeParameterOnPolymorphicSignature { - { InvokeDynamic.call("",123); } + void test(MethodHandle mh) { + mh.invokeExact("",123); + } } diff --git a/langtools/test/tools/javac/diags/examples/UncheckedGenericArrayCreation.java b/langtools/test/tools/javac/diags/examples/UncheckedGenericArrayCreation.java index 445228e2d1d..0fa0c63e706 100644 --- a/langtools/test/tools/javac/diags/examples/UncheckedGenericArrayCreation.java +++ b/langtools/test/tools/javac/diags/examples/UncheckedGenericArrayCreation.java @@ -22,10 +22,8 @@ */ // key: compiler.warn.unchecked.generic.array.creation -// key: compiler.warn.varargs.non.reifiable.type -// options: -Xlint:unchecked,varargs - -import java.util.*; +// key: compiler.warn.unchecked.varargs.non.reifiable.type +// options: -Xlint:unchecked class UncheckedGenericArrayCreation { void m(T t1, T t2, T t3) { diff --git a/langtools/test/tools/javac/diags/examples/UnsafeUseOfVarargsParam.java b/langtools/test/tools/javac/diags/examples/UnsafeUseOfVarargsParam.java new file mode 100644 index 00000000000..011b129750c --- /dev/null +++ b/langtools/test/tools/javac/diags/examples/UnsafeUseOfVarargsParam.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// key: compiler.warn.varargs.unsafe.use.varargs.param +// options: -Xlint:varargs + +class UnsafeUseOfVarargsParam { + @SafeVarargs static void m(X... x) { + Object[] o = x; + } +} diff --git a/langtools/test/tools/javac/diags/examples/UnsupportedBinaryLiteral.java b/langtools/test/tools/javac/diags/examples/UnsupportedBinaryLiteral.java index 6d620c94244..7a311b25f3c 100644 --- a/langtools/test/tools/javac/diags/examples/UnsupportedBinaryLiteral.java +++ b/langtools/test/tools/javac/diags/examples/UnsupportedBinaryLiteral.java @@ -22,7 +22,7 @@ */ // key: compiler.err.unsupported.binary.lit -// options: -source 6 +// options: -source 6 -Xlint:-options class UnsupportedBinaryLiteral { int i = 0b01000010; diff --git a/langtools/test/tools/javac/diags/examples/UnsupportedFpLit.java b/langtools/test/tools/javac/diags/examples/UnsupportedFpLit.java index c2ced724d6b..8f70b6e88d8 100644 --- a/langtools/test/tools/javac/diags/examples/UnsupportedFpLit.java +++ b/langtools/test/tools/javac/diags/examples/UnsupportedFpLit.java @@ -22,7 +22,7 @@ */ // key: compiler.err.unsupported.fp.lit -// options: -source 1.4 +// options: -source 1.4 -Xlint:-options class UnsupportedFpLit { float f = 0xCafe.BabeP1; diff --git a/langtools/test/tools/javac/diags/examples/UnsupportedUnderscoreLiteral.java b/langtools/test/tools/javac/diags/examples/UnsupportedUnderscoreLiteral.java index 233f93f880a..3ae8cc9ba37 100644 --- a/langtools/test/tools/javac/diags/examples/UnsupportedUnderscoreLiteral.java +++ b/langtools/test/tools/javac/diags/examples/UnsupportedUnderscoreLiteral.java @@ -22,7 +22,7 @@ */ // key: compiler.err.unsupported.underscore.lit -// options: -source 6 +// options: -source 6 -Xlint:-options class UnsupportedUnderscoreLiteral { int i = 123_456_789; diff --git a/langtools/test/tools/javac/diags/examples/VarargsFilename.java b/langtools/test/tools/javac/diags/examples/VarargsFilename.java deleted file mode 100644 index ce0bfe37a9a..00000000000 --- a/langtools/test/tools/javac/diags/examples/VarargsFilename.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// key: compiler.note.varargs.filename -// key: compiler.note.varargs.recompile - -class VarargsFilename { - void m(T... items) { } -} diff --git a/langtools/test/tools/javac/diags/examples/VarargsFilenameAdditional.java b/langtools/test/tools/javac/diags/examples/VarargsFilenameAdditional.java deleted file mode 100644 index e84060aa1bb..00000000000 --- a/langtools/test/tools/javac/diags/examples/VarargsFilenameAdditional.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// key: compiler.note.varargs.filename.additional -// key: compiler.warn.varargs.non.reifiable.type -// options: -Xlint:varargs -Xmaxwarns 1 - -class VarargsFilenameAdditional { - void m1(T... items) { } - void m2(T... items) { } -} diff --git a/langtools/test/tools/javac/diags/examples/VarargsNonReifiableType.java b/langtools/test/tools/javac/diags/examples/VarargsNonReifiableType.java index f568823bcca..0474cc51931 100644 --- a/langtools/test/tools/javac/diags/examples/VarargsNonReifiableType.java +++ b/langtools/test/tools/javac/diags/examples/VarargsNonReifiableType.java @@ -21,10 +21,8 @@ * questions. */ -// key: compiler.warn.varargs.non.reifiable.type -// options: -Xlint:varargs - -import java.util.*; +// key: compiler.warn.unchecked.varargs.non.reifiable.type +// options: -Xlint:unchecked class VarargsNonReifiableType { void m(T... items) { diff --git a/langtools/test/tools/javac/diags/examples/VarargsNotSupported.java b/langtools/test/tools/javac/diags/examples/VarargsNotSupported.java index 559340352c8..110b71af421 100644 --- a/langtools/test/tools/javac/diags/examples/VarargsNotSupported.java +++ b/langtools/test/tools/javac/diags/examples/VarargsNotSupported.java @@ -22,7 +22,7 @@ */ // key: compiler.err.varargs.not.supported.in.source -// options: -source 1.4 +// options: -source 1.4 -Xlint:-options class VarargsNotSupported { void m(String... args) { } diff --git a/langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsPlural.java b/langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsPlural.java deleted file mode 100644 index 4e6df25a7a3..00000000000 --- a/langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsPlural.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// key: compiler.note.varargs.plural -// key: compiler.note.varargs.recompile - -class VarargsPlural { - void m(T... items) { } -} diff --git a/langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsPlural.java b/langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsPlural.java deleted file mode 100644 index c8525848f36..00000000000 --- a/langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsPlural.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -class VarargsPlural { - void m(T... items) { } -} diff --git a/langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsPluralAdditional.java b/langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsPluralAdditional.java deleted file mode 100644 index 541e0adc543..00000000000 --- a/langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsPluralAdditional.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// key: compiler.note.varargs.plural.additional -// key: compiler.warn.varargs.non.reifiable.type -// options: -Xlint:varargs -Xmaxwarns 1 - -class VarargsPluralAdditional { - void m(T... items) { } -} diff --git a/langtools/test/tools/javac/enum/6384542/T6384542.java b/langtools/test/tools/javac/enum/6384542/T6384542.java index 06b15b71069..234ba485864 100644 --- a/langtools/test/tools/javac/enum/6384542/T6384542.java +++ b/langtools/test/tools/javac/enum/6384542/T6384542.java @@ -3,8 +3,8 @@ * @bug 6384542 * @summary crash: test/tools/javac/versions/check.sh * @author Peter von der Ah\u00e9 - * @compile/fail -source 1.4 T6384542.java - * @compile/fail/ref=T6384542.out -source 1.4 -XDrawDiagnostics T6384542.java + * @compile/fail -source 1.4 -Xlint:-options T6384542.java + * @compile/fail/ref=T6384542.out -source 1.4 -Xlint:-options -XDrawDiagnostics T6384542.java */ import static java.lang.Math.sin; diff --git a/langtools/test/tools/javac/enum/6384542/T6384542a.java b/langtools/test/tools/javac/enum/6384542/T6384542a.java index cb95a527e6c..f313b73f167 100644 --- a/langtools/test/tools/javac/enum/6384542/T6384542a.java +++ b/langtools/test/tools/javac/enum/6384542/T6384542a.java @@ -5,8 +5,8 @@ * @author Peter von der Ah\u00e9 * @compile/fail -source 5 T6384542a.java * @compile -source 1.4 T6384542a.java - * @compile/fail/ref=T6384542a_5.out -source 5 -XDrawDiagnostics T6384542a.java - * @compile/ref=T6384542a_1_4.out -source 1.4 -XDrawDiagnostics T6384542a.java + * @compile/fail/ref=T6384542a_5.out -source 5 -Xlint:-options -XDrawDiagnostics T6384542a.java + * @compile/ref=T6384542a_1_4.out -source 1.4 -Xlint:-options -XDrawDiagnostics T6384542a.java */ public class T6384542a { diff --git a/langtools/test/tools/javac/enum/6424358/T6424358.java b/langtools/test/tools/javac/enum/6424358/T6424358.java index 681a45c0dbe..0ab0d8d0c3d 100644 --- a/langtools/test/tools/javac/enum/6424358/T6424358.java +++ b/langtools/test/tools/javac/enum/6424358/T6424358.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/enum/T6724345.java b/langtools/test/tools/javac/enum/T6724345.java index d1d0953b74e..8ddd1780e02 100644 --- a/langtools/test/tools/javac/enum/T6724345.java +++ b/langtools/test/tools/javac/enum/T6724345.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/failover/CheckAttributedTree.java b/langtools/test/tools/javac/failover/CheckAttributedTree.java index 208cbe5cb74..e249689a41a 100644 --- a/langtools/test/tools/javac/failover/CheckAttributedTree.java +++ b/langtools/test/tools/javac/failover/CheckAttributedTree.java @@ -252,6 +252,13 @@ public class CheckAttributedTree { error("File " + file + " ignored"); } + // See CR: 6982992 Tests CheckAttributedTree.java, JavacTreeScannerTest.java, and SourceTreeeScannerTest.java timeout + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + Reporter r = new Reporter(pw); + JavacTool tool = JavacTool.create(); + StandardJavaFileManager fm = tool.getStandardFileManager(r, null, null); + /** * Read a file. * @param file the file to be read @@ -260,12 +267,8 @@ public class CheckAttributedTree { * @throws TreePosTest.ParseException if any errors occur while parsing the file */ List> read(File file) throws IOException, AttributionException { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - Reporter r = new Reporter(pw); JavacTool tool = JavacTool.create(); - Charset cs = (encoding == null ? null : Charset.forName(encoding)); - StandardJavaFileManager fm = tool.getStandardFileManager(r, null, null); + r.errors = 0; Iterable files = fm.getJavaFileObjects(file); String[] opts = { "-XDshouldStopPolicy=ATTR", "-XDverboseCompilePolicy" }; JavacTask task = tool.getTask(pw, fm, r, Arrays.asList(opts), null, files); diff --git a/langtools/test/tools/javac/generics/6476118/T6476118a.java b/langtools/test/tools/javac/generics/6476118/T6476118a.java new file mode 100644 index 00000000000..27af70085b1 --- /dev/null +++ b/langtools/test/tools/javac/generics/6476118/T6476118a.java @@ -0,0 +1,16 @@ +/** + * @test /nodynamiccopyright/ + * @bug 6476118 + * @summary compiler bug causes runtime ClassCastException for generics overloading + * @compile/fail/ref=T6476118a.out -XDrawDiagnostics T6476118a.java + */ + +class T6476118a { + static class A { + public int compareTo(Object o) { return 0; } + } + + static class B extends A implements Comparable{ + public int compareTo(B b){ return 0; } + } +} diff --git a/langtools/test/tools/javac/generics/6476118/T6476118a.out b/langtools/test/tools/javac/generics/6476118/T6476118a.out new file mode 100644 index 00000000000..bcd398581ed --- /dev/null +++ b/langtools/test/tools/javac/generics/6476118/T6476118a.out @@ -0,0 +1,2 @@ +T6476118a.java:14:20: compiler.err.name.clash.same.erasure.no.override: compareTo(T), java.lang.Comparable, compareTo(java.lang.Object), T6476118a.A +1 error diff --git a/langtools/test/tools/javac/generics/6476118/T6476118b.java b/langtools/test/tools/javac/generics/6476118/T6476118b.java new file mode 100644 index 00000000000..a5026f3e6e7 --- /dev/null +++ b/langtools/test/tools/javac/generics/6476118/T6476118b.java @@ -0,0 +1,14 @@ +/** + * @test /nodynamiccopyright/ + * @bug 6476118 6533652 + * @summary compiler bug causes runtime ClassCastException for generics overloading + * @compile/fail/ref=T6476118b.out -XDrawDiagnostics T6476118b.java + */ + +class T6476118b { + public final int compareTo(Object o) { return 0; } + + static class B extends T6476118b implements Comparable { + public int compareTo(B b){ return 0; } + } +} diff --git a/langtools/test/tools/javac/generics/6476118/T6476118b.out b/langtools/test/tools/javac/generics/6476118/T6476118b.out new file mode 100644 index 00000000000..56aa31901ca --- /dev/null +++ b/langtools/test/tools/javac/generics/6476118/T6476118b.out @@ -0,0 +1,2 @@ +T6476118b.java:12:20: compiler.err.name.clash.same.erasure.no.override: compareTo(T), java.lang.Comparable, compareTo(java.lang.Object), T6476118b +1 error diff --git a/langtools/test/tools/javac/generics/6476118/T6476118c.java b/langtools/test/tools/javac/generics/6476118/T6476118c.java new file mode 100644 index 00000000000..751b4fb9fce --- /dev/null +++ b/langtools/test/tools/javac/generics/6476118/T6476118c.java @@ -0,0 +1,23 @@ +/** + * @test /nodynamiccopyright/ + * @bug 6476118 + * @summary compiler bug causes runtime ClassCastException for generics overloading + * @compile/fail/ref=T6476118c.out -XDrawDiagnostics T6476118c.java + */ + +class T6476118b { + static class A { + public void foo(T t) { } + } + + static class B extends A { + public void foo(T t) { } + } + + static class C extends B { + public void foo(Object o) { } + public void foo(Number o) { } + } + + static class D extends C {} //check that no spurious diags generated here! +} diff --git a/langtools/test/tools/javac/generics/6476118/T6476118c.out b/langtools/test/tools/javac/generics/6476118/T6476118c.out new file mode 100644 index 00000000000..6b4d0b67000 --- /dev/null +++ b/langtools/test/tools/javac/generics/6476118/T6476118c.out @@ -0,0 +1,3 @@ +T6476118c.java:18:21: compiler.err.name.clash.same.erasure.no.override: foo(java.lang.Object), T6476118b.C, foo(T), T6476118b.A +T6476118c.java:19:21: compiler.err.name.clash.same.erasure.no.override: foo(java.lang.Number), T6476118b.C, foo(T), T6476118b.B +2 errors diff --git a/langtools/test/tools/javac/generics/6476118/T6476118d.java b/langtools/test/tools/javac/generics/6476118/T6476118d.java new file mode 100644 index 00000000000..8642113af6e --- /dev/null +++ b/langtools/test/tools/javac/generics/6476118/T6476118d.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6476118 + * @summary compiler bug causes runtime ClassCastException for generics overloading + * @compile T6476118d.java + */ + +class T6476118d { + int m = 3; + + interface m { } + + int m () { + return m; + } +} diff --git a/langtools/test/tools/javac/generics/6956758/T6956758neg.java b/langtools/test/tools/javac/generics/6956758/T6956758neg.java new file mode 100644 index 00000000000..ec1561a532a --- /dev/null +++ b/langtools/test/tools/javac/generics/6956758/T6956758neg.java @@ -0,0 +1,20 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6956758 + * + * @summary NPE in com.sun.tools.javac.code.Symbol - isSubClass + * @author Maurizio Cimadamore + * @compile/fail/ref=T6956758neg.out -XDrawDiagnostics T6956758neg.java + * + */ + +class T6956758neg { + + interface I {} + + static class C { + T cloneObject(T object) throws Exception { + return (T)object.clone(); + } + } +} diff --git a/langtools/test/tools/javac/generics/6956758/T6956758neg.out b/langtools/test/tools/javac/generics/6956758/T6956758neg.out new file mode 100644 index 00000000000..bbbca0ab03b --- /dev/null +++ b/langtools/test/tools/javac/generics/6956758/T6956758neg.out @@ -0,0 +1,4 @@ +T6956758neg.java:17:29: compiler.err.report.access: clone(), protected, java.lang.Object +- compiler.note.unchecked.filename: T6956758neg.java +- compiler.note.unchecked.recompile +1 error diff --git a/langtools/test/tools/javac/generics/6956758/T6956758pos.java b/langtools/test/tools/javac/generics/6956758/T6956758pos.java new file mode 100644 index 00000000000..7eb3b2e66c4 --- /dev/null +++ b/langtools/test/tools/javac/generics/6956758/T6956758pos.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6956758 + * + * @summary NPE in com.sun.tools.javac.code.Symbol - isSubClass + * @author Maurizio Cimadamore + * @compile T6956758pos.java + * + */ + +class T6956758pos { + + interface I {} + + static class C { + T cloneObject(T object) throws Exception { + return (T)object.clone(); + } + } +} diff --git a/langtools/test/tools/javac/generics/6985719/T6985719a.java b/langtools/test/tools/javac/generics/6985719/T6985719a.java new file mode 100644 index 00000000000..aef4ba2f698 --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719a.java @@ -0,0 +1,15 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6985719 + * @summary Alike methods in interfaces (Inheritance and Overriding) + * @author mcimadamore + * @compile/fail/ref=T6985719a.out -XDrawDiagnostics T6985719a.java + */ + +import java.util.List; + +class T6985719a { + interface A { void f(List ls); } + interface B { void f(List ls); } + interface C extends A,B {} +} diff --git a/langtools/test/tools/javac/generics/6985719/T6985719a.out b/langtools/test/tools/javac/generics/6985719/T6985719a.out new file mode 100644 index 00000000000..9948d6cf393 --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719a.out @@ -0,0 +1,2 @@ +T6985719a.java:14:5: compiler.err.name.clash.same.erasure.no.override: f(java.util.List), T6985719a.B, f(java.util.List), T6985719a.A +1 error diff --git a/langtools/test/tools/javac/generics/6985719/T6985719b.java b/langtools/test/tools/javac/generics/6985719/T6985719b.java new file mode 100644 index 00000000000..7e4e928b67d --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719b.java @@ -0,0 +1,15 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6985719 + * @summary Alike methods in interfaces (Inheritance and Overriding) + * @author mcimadamore + * @compile/fail/ref=T6985719b.out -XDrawDiagnostics T6985719b.java + */ + +import java.util.List; + +class T6985719b { + abstract class A { abstract void f(List ls); } + interface B { void f(List ls); } + abstract class C extends A implements B {} +} diff --git a/langtools/test/tools/javac/generics/6985719/T6985719b.out b/langtools/test/tools/javac/generics/6985719/T6985719b.out new file mode 100644 index 00000000000..ef2ab842aea --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719b.out @@ -0,0 +1,2 @@ +T6985719b.java:14:14: compiler.err.name.clash.same.erasure.no.override: f(java.util.List), T6985719b.B, f(java.util.List), T6985719b.A +1 error diff --git a/langtools/test/tools/javac/generics/6985719/T6985719c.java b/langtools/test/tools/javac/generics/6985719/T6985719c.java new file mode 100644 index 00000000000..51e52c014d7 --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719c.java @@ -0,0 +1,15 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6985719 + * @summary Alike methods in interfaces (Inheritance and Overriding) + * @author mcimadamore + * @compile/fail/ref=T6985719c.out -XDrawDiagnostics T6985719c.java + */ + +import java.util.List; + +class T6985719c { + interface A { void f(List ls); } + interface B { void f(List ls); } + interface C extends A,B {} +} diff --git a/langtools/test/tools/javac/generics/6985719/T6985719c.out b/langtools/test/tools/javac/generics/6985719/T6985719c.out new file mode 100644 index 00000000000..23d2ba7687c --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719c.out @@ -0,0 +1,2 @@ +T6985719c.java:14:5: compiler.err.name.clash.same.erasure.no.override: f(java.util.List), T6985719c.B, f(java.util.List), T6985719c.A +1 error diff --git a/langtools/test/tools/javac/generics/6985719/T6985719d.java b/langtools/test/tools/javac/generics/6985719/T6985719d.java new file mode 100644 index 00000000000..df2d9409170 --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719d.java @@ -0,0 +1,15 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6985719 + * @summary Alike methods in interfaces (Inheritance and Overriding) + * @author mcimadamore + * @compile/fail/ref=T6985719d.out -XDrawDiagnostics T6985719d.java + */ + +import java.util.List; + +class T6985719d { + abstract class A { abstract void f(List ls); } + interface B { void f(List ls); } + abstract class C extends A implements B {} +} diff --git a/langtools/test/tools/javac/generics/6985719/T6985719d.out b/langtools/test/tools/javac/generics/6985719/T6985719d.out new file mode 100644 index 00000000000..c46439c4921 --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719d.out @@ -0,0 +1,2 @@ +T6985719d.java:14:14: compiler.err.name.clash.same.erasure.no.override: f(java.util.List), T6985719d.B, f(java.util.List), T6985719d.A +1 error diff --git a/langtools/test/tools/javac/generics/6985719/T6985719e.java b/langtools/test/tools/javac/generics/6985719/T6985719e.java new file mode 100644 index 00000000000..1b3e6a5e165 --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719e.java @@ -0,0 +1,14 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6985719 + * @summary Alike methods in interfaces (Inheritance and Overriding) + * @author mcimadamore + * @compile/fail/ref=T6985719e.out -XDrawDiagnostics T6985719e.java + */ + +import java.util.List; + +class T6985719e { + interface A { void f(List ls); } + interface B extends A { void f(List ls); } +} diff --git a/langtools/test/tools/javac/generics/6985719/T6985719e.out b/langtools/test/tools/javac/generics/6985719/T6985719e.out new file mode 100644 index 00000000000..82fd2cd3c36 --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719e.out @@ -0,0 +1,2 @@ +T6985719e.java:13:34: compiler.err.name.clash.same.erasure.no.override: f(java.util.List), T6985719e.B, f(java.util.List), T6985719e.A +1 error diff --git a/langtools/test/tools/javac/generics/6985719/T6985719f.java b/langtools/test/tools/javac/generics/6985719/T6985719f.java new file mode 100644 index 00000000000..54b5c3001e2 --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719f.java @@ -0,0 +1,14 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6985719 + * @summary Alike methods in interfaces (Inheritance and Overriding) + * @author mcimadamore + * @compile/fail/ref=T6985719f.out -XDrawDiagnostics T6985719f.java + */ + +import java.util.List; + +class T6985719f { + abstract class A { abstract void f(List ls); } + abstract class B extends A { void f(List ls); } +} diff --git a/langtools/test/tools/javac/generics/6985719/T6985719f.out b/langtools/test/tools/javac/generics/6985719/T6985719f.out new file mode 100644 index 00000000000..12a07a279ac --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719f.out @@ -0,0 +1,2 @@ +T6985719f.java:13:39: compiler.err.name.clash.same.erasure.no.override: f(java.util.List), T6985719f.B, f(java.util.List), T6985719f.A +1 error diff --git a/langtools/test/tools/javac/generics/6985719/T6985719g.java b/langtools/test/tools/javac/generics/6985719/T6985719g.java new file mode 100644 index 00000000000..df8afa01259 --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719g.java @@ -0,0 +1,14 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6985719 + * @summary Alike methods in interfaces (Inheritance and Overriding) + * @author mcimadamore + * @compile/fail/ref=T6985719g.out -XDrawDiagnostics T6985719g.java + */ + +import java.util.List; + +class T6985719g { + interface A { void f(List ls); } + interface B extends A { void f(List ls); } +} diff --git a/langtools/test/tools/javac/generics/6985719/T6985719g.out b/langtools/test/tools/javac/generics/6985719/T6985719g.out new file mode 100644 index 00000000000..1d37a78937c --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719g.out @@ -0,0 +1,2 @@ +T6985719g.java:13:42: compiler.err.name.clash.same.erasure.no.override: f(java.util.List), T6985719g.B, f(java.util.List), T6985719g.A +1 error diff --git a/langtools/test/tools/javac/generics/6985719/T6985719h.java b/langtools/test/tools/javac/generics/6985719/T6985719h.java new file mode 100644 index 00000000000..9bcc1431197 --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719h.java @@ -0,0 +1,14 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6985719 + * @summary Alike methods in interfaces (Inheritance and Overriding) + * @author mcimadamore + * @compile/fail/ref=T6985719h.out -XDrawDiagnostics T6985719h.java + */ + +import java.util.List; + +class T6985719h { + abstract class A { abstract void f(List ls); } + abstract class B extends A { abstract void f(List ls); } +} diff --git a/langtools/test/tools/javac/generics/6985719/T6985719h.out b/langtools/test/tools/javac/generics/6985719/T6985719h.out new file mode 100644 index 00000000000..64b3e4a3c84 --- /dev/null +++ b/langtools/test/tools/javac/generics/6985719/T6985719h.out @@ -0,0 +1,2 @@ +T6985719h.java:13:56: compiler.err.name.clash.same.erasure.no.override: f(java.util.List), T6985719h.B, f(java.util.List), T6985719h.A +1 error diff --git a/langtools/test/tools/javac/generics/Casting.java b/langtools/test/tools/javac/generics/Casting.java index dd397ae5d45..58a15e88e69 100644 --- a/langtools/test/tools/javac/generics/Casting.java +++ b/langtools/test/tools/javac/generics/Casting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/Casting3.java b/langtools/test/tools/javac/generics/Casting3.java index fe73d3a838a..6116a91baec 100644 --- a/langtools/test/tools/javac/generics/Casting3.java +++ b/langtools/test/tools/javac/generics/Casting3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/Casting4.java b/langtools/test/tools/javac/generics/Casting4.java index 445872465fb..b76d3258cf6 100644 --- a/langtools/test/tools/javac/generics/Casting4.java +++ b/langtools/test/tools/javac/generics/Casting4.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/InnerInterface1.java b/langtools/test/tools/javac/generics/InnerInterface1.java index 08068d873bc..da35397a025 100644 --- a/langtools/test/tools/javac/generics/InnerInterface1.java +++ b/langtools/test/tools/javac/generics/InnerInterface1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/InnerInterface2.java b/langtools/test/tools/javac/generics/InnerInterface2.java index 6eef316dcd7..7e9adce0ab4 100644 --- a/langtools/test/tools/javac/generics/InnerInterface2.java +++ b/langtools/test/tools/javac/generics/InnerInterface2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/Multibound1.java b/langtools/test/tools/javac/generics/Multibound1.java index 864368912f0..e9318f22802 100644 --- a/langtools/test/tools/javac/generics/Multibound1.java +++ b/langtools/test/tools/javac/generics/Multibound1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/MultipleInheritance.java b/langtools/test/tools/javac/generics/MultipleInheritance.java index 5c150514648..698cccee56c 100644 --- a/langtools/test/tools/javac/generics/MultipleInheritance.java +++ b/langtools/test/tools/javac/generics/MultipleInheritance.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/NameOrder.java b/langtools/test/tools/javac/generics/NameOrder.java index 46b8de9d7c1..97dfc828f9f 100644 --- a/langtools/test/tools/javac/generics/NameOrder.java +++ b/langtools/test/tools/javac/generics/NameOrder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/OverrideBridge.java b/langtools/test/tools/javac/generics/OverrideBridge.java index 548057540c7..43c1f5e67e8 100644 --- a/langtools/test/tools/javac/generics/OverrideBridge.java +++ b/langtools/test/tools/javac/generics/OverrideBridge.java @@ -23,7 +23,8 @@ /* * @test - * @bug 6337171 + * @bug 6337171 6996415 + * @ignore fix has been disabled as a consequence of 6996415 * @summary javac should create bridge methods when type variable bounds restricted * @run main OverrideBridge */ diff --git a/langtools/test/tools/javac/generics/PermuteBound.java b/langtools/test/tools/javac/generics/PermuteBound.java index f92056ae7de..ad1cda49de9 100644 --- a/langtools/test/tools/javac/generics/PermuteBound.java +++ b/langtools/test/tools/javac/generics/PermuteBound.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/PrimitiveVariant.java b/langtools/test/tools/javac/generics/PrimitiveVariant.java index 20abe2b621c..ec47013295c 100644 --- a/langtools/test/tools/javac/generics/PrimitiveVariant.java +++ b/langtools/test/tools/javac/generics/PrimitiveVariant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/T6557954.java b/langtools/test/tools/javac/generics/T6557954.java index af952ddcdf4..5fb82a8a158 100644 --- a/langtools/test/tools/javac/generics/T6557954.java +++ b/langtools/test/tools/javac/generics/T6557954.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/T6751514.java b/langtools/test/tools/javac/generics/T6751514.java index 10d52619d88..47c605832b9 100644 --- a/langtools/test/tools/javac/generics/T6751514.java +++ b/langtools/test/tools/javac/generics/T6751514.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/T6869075.java b/langtools/test/tools/javac/generics/T6869075.java index e5dda6455a5..1704c82d612 100644 --- a/langtools/test/tools/javac/generics/T6869075.java +++ b/langtools/test/tools/javac/generics/T6869075.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/diamond/6996914/T6996914a.java b/langtools/test/tools/javac/generics/diamond/6996914/T6996914a.java new file mode 100644 index 00000000000..b0bc084570a --- /dev/null +++ b/langtools/test/tools/javac/generics/diamond/6996914/T6996914a.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6996914 + * @summary Diamond inference: problem when accessing protected constructor + * @run main T6996914a + */ + +import com.sun.source.util.JavacTask; +import java.net.URI; +import java.util.Arrays; +import javax.tools.Diagnostic; +import javax.tools.DiagnosticListener; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; + +public class T6996914a { + + enum PackageKind { + DEFAULT("", ""), + A("package a;", "import a.*;"); + + String pkgDecl; + String importDecl; + + PackageKind(String pkgDecl, String importDecl) { + this.pkgDecl = pkgDecl; + this.importDecl = importDecl; + } + } + + enum DiamondKind { + STANDARD("new Foo<>();"), + ANON("new Foo<>() {};"); + + String expr; + + DiamondKind(String expr) { + this.expr = expr; + } + } + + enum ConstructorKind { + PACKAGE(""), + PROTECTED("protected"), + PRIVATE("private"), + PUBLIC("public"); + + String mod; + + ConstructorKind(String mod) { + this.mod = mod; + } + } + + static class FooClass extends SimpleJavaFileObject { + + final static String sourceStub = + "#P\n" + + "public class Foo {\n" + + " #M Foo() {}\n" + + "}\n"; + + String source; + + public FooClass(PackageKind pk, ConstructorKind ck) { + super(URI.create("myfo:/" + (pk != PackageKind.DEFAULT ? "a/Foo.java" : "Foo.java")), + JavaFileObject.Kind.SOURCE); + source = sourceStub.replace("#P", pk.pkgDecl).replace("#M", ck.mod); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + } + + static class ClientClass extends SimpleJavaFileObject { + + final static String sourceStub = + "#I\n" + + "class Test {\n" + + " Foo fs = #D\n" + + "}\n"; + + String source; + + public ClientClass(PackageKind pk, DiamondKind dk) { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + source = sourceStub.replace("#I", pk.importDecl).replace("#D", dk.expr); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + } + + public static void main(String... args) throws Exception { + for (PackageKind pk : PackageKind.values()) { + for (ConstructorKind ck : ConstructorKind.values()) { + for (DiamondKind dk : DiamondKind.values()) { + compileAndCheck(pk, ck, dk); + } + } + } + } + + static void compileAndCheck(PackageKind pk, ConstructorKind ck, DiamondKind dk) throws Exception { + FooClass foo = new FooClass(pk, ck); + ClientClass client = new ClientClass(pk, dk); + final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); + ErrorListener el = new ErrorListener(); + JavacTask ct = (JavacTask)tool.getTask(null, null, el, + null, null, Arrays.asList(foo, client)); + ct.analyze(); + if (el.errors > 0 == check(pk, ck, dk)) { + String msg = el.errors > 0 ? + "Error compiling files" : + "No error when compiling files"; + throw new AssertionError(msg + ": \n" + foo.source + "\n" + client.source); + } + } + + static boolean check(PackageKind pk, ConstructorKind ck, DiamondKind dk) { + switch (pk) { + case A: return ck == ConstructorKind.PUBLIC || + (ck == ConstructorKind.PROTECTED && dk == DiamondKind.ANON); + case DEFAULT: return ck != ConstructorKind.PRIVATE; + default: throw new AssertionError("Unknown package kind"); + } + } + + /** + * DiagnosticListener to count any errors that occur + */ + private static class ErrorListener implements DiagnosticListener { + + public void report(Diagnostic diagnostic) { + switch (diagnostic.getKind()) { + case ERROR: + errors++; + } + } + int errors; + } +} diff --git a/langtools/test/tools/javac/generics/diamond/6996914/T6996914b.java b/langtools/test/tools/javac/generics/diamond/6996914/T6996914b.java new file mode 100644 index 00000000000..d82e7998c13 --- /dev/null +++ b/langtools/test/tools/javac/generics/diamond/6996914/T6996914b.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6996914 + * @summary Diamond inference: problem when accessing protected constructor + * @compile T6996914b.java + */ + +class Super { + private Super(Integer i, Y y, X x) {} + public Super(Number n, X x, Y y) {} +} + +class Test { + Super ssi1 = new Super<>(1, "", 2); + Super ssi2 = new Super<>(1, "", 2) {}; +} diff --git a/langtools/test/tools/javac/generics/diamond/7002837/T7002837.java b/langtools/test/tools/javac/generics/diamond/7002837/T7002837.java new file mode 100644 index 00000000000..4a930050c4b --- /dev/null +++ b/langtools/test/tools/javac/generics/diamond/7002837/T7002837.java @@ -0,0 +1,14 @@ +/* + * @test /nodynamiccopyright/ + * @bug 7002837 + * + * @summary Diamond: javac generates diamond inference errors when in 'finder' mode + * @author mcimadamore + * @compile -Werror -XDfindDiamond T7002837.java + * + */ + +class T7002837> { + T7002837() {} + { new T7002837(); } +} diff --git a/langtools/test/tools/javac/generics/diamond/T6939780.java b/langtools/test/tools/javac/generics/diamond/T6939780.java new file mode 100644 index 00000000000..82020228460 --- /dev/null +++ b/langtools/test/tools/javac/generics/diamond/T6939780.java @@ -0,0 +1,25 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6939780 + * + * @summary add a warning to detect diamond sites + * @author mcimadamore + * @compile/ref=T6939780.out T6939780.java -XDrawDiagnostics -XDfindDiamond + * + */ + +class T6939780 { + + void test() { + class Foo { + Foo() {} + Foo(X x) {} + } + Foo f1 = new Foo(1); + Foo f2 = new Foo(); + Foo f3 = new Foo(); + Foo f4 = new Foo(1) {}; + Foo f5 = new Foo() {}; + Foo f6 = new Foo() {}; + } +} diff --git a/langtools/test/tools/javac/generics/diamond/T6939780.out b/langtools/test/tools/javac/generics/diamond/T6939780.out new file mode 100644 index 00000000000..d3043fb70b3 --- /dev/null +++ b/langtools/test/tools/javac/generics/diamond/T6939780.out @@ -0,0 +1,5 @@ +T6939780.java:19:28: compiler.warn.diamond.redundant.args: Foo, Foo +T6939780.java:20:28: compiler.warn.diamond.redundant.args.1: Foo, Foo +T6939780.java:22:28: compiler.warn.diamond.redundant.args: Foo, Foo +T6939780.java:23:28: compiler.warn.diamond.redundant.args.1: Foo, Foo +4 warnings diff --git a/langtools/test/tools/javac/generics/inference/6569789/T6569789.java b/langtools/test/tools/javac/generics/inference/6569789/T6569789.java index 40bfcfb03c4..8104c97d909 100644 --- a/langtools/test/tools/javac/generics/inference/6569789/T6569789.java +++ b/langtools/test/tools/javac/generics/inference/6569789/T6569789.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/inference/6638712/T6638712a.java b/langtools/test/tools/javac/generics/inference/6638712/T6638712a.java index b6f70f486de..768e99f15d7 100644 --- a/langtools/test/tools/javac/generics/inference/6638712/T6638712a.java +++ b/langtools/test/tools/javac/generics/inference/6638712/T6638712a.java @@ -10,7 +10,7 @@ import java.util.*; class T6638712a { - Comparator compound(Iterable> it) {} + Comparator compound(Iterable> it) { return null; } public void test(List> x) { Comparator c3 = compound(x); diff --git a/langtools/test/tools/javac/generics/inference/6650759/T6650759a.java b/langtools/test/tools/javac/generics/inference/6650759/T6650759a.java index 5daa4fcd421..19c44d10fc6 100644 --- a/langtools/test/tools/javac/generics/inference/6650759/T6650759a.java +++ b/langtools/test/tools/javac/generics/inference/6650759/T6650759a.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/inference/6995200/T6995200.java b/langtools/test/tools/javac/generics/inference/6995200/T6995200.java new file mode 100644 index 00000000000..0afc684377e --- /dev/null +++ b/langtools/test/tools/javac/generics/inference/6995200/T6995200.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6995200 + * + * @summary JDK 7 compiler crashes when type-variable is inferred from expected primitive type + * @author mcimadamore + * @compile T6995200.java + * + */ + +import java.util.List; + +class T6995200 { + static T getValue() { + return null; + } + + void test() { + byte v1 = getValue(); + short v2 = getValue(); + int v3 = getValue(); + long v4 = getValue(); + float v5 = getValue(); + double v6 = getValue(); + String v7 = getValue(); + String[] v8 = getValue(); + List v9 = getValue(); + List[] v10 = getValue(); + List v11 = getValue(); + List[] v12 = getValue(); + List v13 = getValue(); + List[] v14 = getValue(); + List v15 = getValue(); + List[] v16 = getValue(); + X v17 = getValue(); + X[] v18 = getValue(); + List v19 = getValue(); + List[] v20 = getValue(); + List v21 = getValue(); + List[] v22 = getValue(); + List v23 = getValue(); + List[] v24 = getValue(); + } +} diff --git a/langtools/test/tools/javac/generics/typevars/5060485/Compatibility.java b/langtools/test/tools/javac/generics/typevars/5060485/Compatibility.java index 3817e207069..ba332f52764 100644 --- a/langtools/test/tools/javac/generics/typevars/5060485/Compatibility.java +++ b/langtools/test/tools/javac/generics/typevars/5060485/Compatibility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/typevars/5060485/Compatibility02.java b/langtools/test/tools/javac/generics/typevars/5060485/Compatibility02.java index 6a5a612c2ad..12a2ae200f6 100644 --- a/langtools/test/tools/javac/generics/typevars/5060485/Compatibility02.java +++ b/langtools/test/tools/javac/generics/typevars/5060485/Compatibility02.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/typevars/T6880344.java b/langtools/test/tools/javac/generics/typevars/T6880344.java index 650ecb947e1..f0007024576 100644 --- a/langtools/test/tools/javac/generics/typevars/T6880344.java +++ b/langtools/test/tools/javac/generics/typevars/T6880344.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/generics/wildcards/T6732484.java b/langtools/test/tools/javac/generics/wildcards/T6732484.java index f4ce59948b1..9a55c280f82 100644 --- a/langtools/test/tools/javac/generics/wildcards/T6732484.java +++ b/langtools/test/tools/javac/generics/wildcards/T6732484.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/literals/BadBinaryLiterals.java b/langtools/test/tools/javac/literals/BadBinaryLiterals.java index 8a8f5ea5568..034d1f6d6f2 100644 --- a/langtools/test/tools/javac/literals/BadBinaryLiterals.java +++ b/langtools/test/tools/javac/literals/BadBinaryLiterals.java @@ -2,7 +2,7 @@ * @test /nodynamiccopyright/ * @bug 6860965 * @summary Project Coin: binary literals - * @compile/fail/ref=BadBinaryLiterals.6.out -XDrawDiagnostics -source 6 BadBinaryLiterals.java + * @compile/fail/ref=BadBinaryLiterals.6.out -XDrawDiagnostics -source 6 -Xlint:-options BadBinaryLiterals.java * @compile/fail/ref=BadBinaryLiterals.7.out -XDrawDiagnostics BadBinaryLiterals.java */ diff --git a/langtools/test/tools/javac/literals/BadUnderscoreLiterals.java b/langtools/test/tools/javac/literals/BadUnderscoreLiterals.java index 26debae019b..2254596192b 100644 --- a/langtools/test/tools/javac/literals/BadUnderscoreLiterals.java +++ b/langtools/test/tools/javac/literals/BadUnderscoreLiterals.java @@ -7,7 +7,7 @@ * @compile/fail/ref=BadUnderscoreLiterals.7.out -XDrawDiagnostics BadUnderscoreLiterals.java * * @compile/fail -source 6 BadUnderscoreLiterals.java - * @compile/fail/ref=BadUnderscoreLiterals.6.out -XDrawDiagnostics -source 6 BadUnderscoreLiterals.java + * @compile/fail/ref=BadUnderscoreLiterals.6.out -XDrawDiagnostics -source 6 -Xlint:-options BadUnderscoreLiterals.java */ public class BadUnderscoreLiterals { diff --git a/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test.java b/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test.java index 5ab4a57b1a1..28e3e2f222b 100644 --- a/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test.java +++ b/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/mandatoryWarnings/unchecked/Test.java b/langtools/test/tools/javac/mandatoryWarnings/unchecked/Test.java index 844e5a41f92..6bce09f55fd 100644 --- a/langtools/test/tools/javac/mandatoryWarnings/unchecked/Test.java +++ b/langtools/test/tools/javac/mandatoryWarnings/unchecked/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/meth/InvokeDyn.java b/langtools/test/tools/javac/meth/InvokeDyn.java deleted file mode 100644 index b9b9f90a3f9..00000000000 --- a/langtools/test/tools/javac/meth/InvokeDyn.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6754038 6979327 - * @summary Generate call sites for method handle - * @author jrose - * - * @library .. - * @compile -source 7 -target 7 -XDinvokedynamic -XDallowTransitionalJSR292=no InvokeDyn.java - */ -//No: @run main/othervm -XX:+EnableInvokeDynamic meth.InvokeDyn - -/* - * Standalone testing: - * - * $ cd $MY_REPO_DIR/langtools - * $ (cd make; make) - * $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/meth/InvokeDyn.java - * $ javap -c -classpath dist meth.InvokeDyn - * - */ - -package meth; - -import java.dyn.*; - -public class InvokeDyn { - class CS extends CallSite { - CS(Object x, Object y, Object z) { throw new RuntimeException(); } - } - //@BootstrapMethod(CS.class) //note: requires 6964498 - void test() throws Throwable { - Object x = "hello"; - Object ojunk; int ijunk; - ojunk = InvokeDynamic.greet(x, "world", 123); - ojunk = InvokeDynamic.greet(x, "mundus", 456); - ojunk = InvokeDynamic.greet(x, "kosmos", 789); - ojunk = (String) InvokeDynamic.cogitate(10.11121, 3.14); - InvokeDynamic.#"yow: what I mean to say is, please treat this one specially"(null); - ijunk = (int) InvokeDynamic.invoke("goodbye"); - } -} diff --git a/langtools/test/tools/javac/meth/InvokeDynTrans.java b/langtools/test/tools/javac/meth/InvokeDynTrans.java deleted file mode 100644 index b4e992aca28..00000000000 --- a/langtools/test/tools/javac/meth/InvokeDynTrans.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2008-2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6754038 6979327 - * @summary Generate call sites for method handle - * @author jrose - * - * @library .. - * @compile/fail/ref=InvokeDynTrans.out -Werror -XDrawDiagnostics -source 7 -target 7 InvokeDynTrans.java - */ -//No: @run main/othervm -XX:+EnableInvokeDynamic meth.InvokeDyn - -/* - * Standalone testing: - * - * $ cd $MY_REPO_DIR/langtools - * $ (cd make; make) - * $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/meth/InvokeDyn.java - * $ javap -c -classpath dist meth.InvokeDyn - * - */ - -package meth; - -import java.dyn.InvokeDynamic; - -public class InvokeDynTrans { - void test() throws Throwable { - Object x = "hello"; - InvokeDynamic.greet(x, "world", 123); - InvokeDynamic.greet(x, "mundus", 456); - InvokeDynamic.greet(x, "kosmos", 789); - InvokeDynamic.cogitate(10.11121, 3.14); - InvokeDynamic.#"yow: what I mean to say is, please treat this one specially"(null); - InvokeDynamic.invoke("goodbye"); - } -} diff --git a/langtools/test/tools/javac/meth/InvokeDynTrans.out b/langtools/test/tools/javac/meth/InvokeDynTrans.out index fc7d7bd8851..06ed485189c 100644 --- a/langtools/test/tools/javac/meth/InvokeDynTrans.out +++ b/langtools/test/tools/javac/meth/InvokeDynTrans.out @@ -1,6 +1,5 @@ InvokeDynTrans.java:55:39: compiler.warn.type.parameter.on.polymorphic.signature -InvokeDynTrans.java:56:91: compiler.warn.type.parameter.on.polymorphic.signature InvokeDynTrans.java:57:34: compiler.warn.type.parameter.on.polymorphic.signature - compiler.err.warnings.and.werror 1 error -3 warnings +2 warnings diff --git a/langtools/test/tools/javac/meth/InvokeMHTrans.java b/langtools/test/tools/javac/meth/InvokeMHTrans.java index 1b43d846c31..b3ebca4415c 100644 --- a/langtools/test/tools/javac/meth/InvokeMHTrans.java +++ b/langtools/test/tools/javac/meth/InvokeMHTrans.java @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/meth/TestCP.java b/langtools/test/tools/javac/meth/TestCP.java new file mode 100644 index 00000000000..bbcb5bf9e39 --- /dev/null +++ b/langtools/test/tools/javac/meth/TestCP.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6991980 + * @summary polymorphic signature calls don't share the same CP entries + * @run main TestCP + */ + +import com.sun.tools.classfile.Instruction; +import com.sun.tools.classfile.Attribute; +import com.sun.tools.classfile.ClassFile; +import com.sun.tools.classfile.Code_attribute; +import com.sun.tools.classfile.ConstantPool.*; +import com.sun.tools.classfile.Method; + +import java.dyn.*; +import java.io.*; + +public class TestCP { + + static class TestClass { + void test(MethodHandle mh) throws Throwable { + Number n = mh.invokeExact("daddy",1,'n'); + n = (Number)mh.invokeExact("bunny",1,'d'); + } + } + + static final String PS_TYPE = "(Ljava/lang/String;IC)Ljava/lang/Number;"; + static final int PS_CALLS_COUNT = 2; + static final String SUBTEST_NAME = TestClass.class.getName() + ".class"; + static final String TEST_METHOD_NAME = "test"; + + public static void main(String... args) throws Exception { + new TestCP().run(); + } + + public void run() throws Exception { + String workDir = System.getProperty("test.classes"); + File compiledTest = new File(workDir, SUBTEST_NAME); + verifyMethodHandleInvocationDescriptors(compiledTest); + } + + void verifyMethodHandleInvocationDescriptors(File f) { + System.err.println("verify: " + f); + try { + int count = 0; + ClassFile cf = ClassFile.read(f); + Method testMethod = null; + for (Method m : cf.methods) { + if (m.getName(cf.constant_pool).equals(TEST_METHOD_NAME)) { + testMethod = m; + break; + } + } + if (testMethod == null) { + throw new Error("Test method not found"); + } + Code_attribute ea = (Code_attribute)testMethod.attributes.get(Attribute.Code); + if (testMethod == null) { + throw new Error("Code attribute for test() method not found"); + } + int instr_count = 0; + int cp_entry = -1; + + for (Instruction i : ea.getInstructions()) { + if (i.getMnemonic().equals("invokevirtual")) { + instr_count++; + if (cp_entry == -1) { + cp_entry = i.getUnsignedShort(1); + } else if (cp_entry != i.getUnsignedShort(1)) { + throw new Error("Unexpected CP entry in polymorphic signature call"); + } + CONSTANT_Methodref_info methRef = + (CONSTANT_Methodref_info)cf.constant_pool.get(cp_entry); + String type = methRef.getNameAndTypeInfo().getType(); + if (!type.equals(PS_TYPE)) { + throw new Error("Unexpected type in polymorphic signature call: " + type); + } + } + } + if (instr_count != PS_CALLS_COUNT) { + throw new Error("Wrong number of polymorphic signature call found: " + instr_count); + } + } catch (Exception e) { + e.printStackTrace(); + throw new Error("error reading " + f +": " + e); + } + } +} diff --git a/langtools/test/tools/javac/typeAnnotations/failures/OldArray.java b/langtools/test/tools/javac/meth/XlintWarn.java similarity index 70% rename from langtools/test/tools/javac/typeAnnotations/failures/OldArray.java rename to langtools/test/tools/javac/meth/XlintWarn.java index 746a6d47496..844994b8e69 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/OldArray.java +++ b/langtools/test/tools/javac/meth/XlintWarn.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * 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,13 +23,18 @@ /* * @test - * @bug 6843077 - * @summary test old array syntax - * @author Mahmood Ali - * @compile/fail -XDrawDiagnostics -source 1.7 OldArray.java + * @bug 6999067 7010194 + * @summary cast for invokeExact call gets redundant cast to warnings + * @author mcimadamore + * + * @compile -Werror -Xlint:cast XlintWarn.java */ -class OldArray { - String [@A] s() { return null; } -} -@interface A { } +import java.dyn.*; + +class XlintWarn { + void test(MethodHandle mh) throws Throwable { + int i1 = (int)mh.invokeExact(); + int i2 = (int)mh.invokeVarargs(); + } +} diff --git a/langtools/test/tools/javac/diags/examples/MulticatchMustBeFinal.java b/langtools/test/tools/javac/multicatch/7005371/SubTest.java similarity index 75% rename from langtools/test/tools/javac/diags/examples/MulticatchMustBeFinal.java rename to langtools/test/tools/javac/multicatch/7005371/SubTest.java index 219f22add64..5ef8a905104 100644 --- a/langtools/test/tools/javac/diags/examples/MulticatchMustBeFinal.java +++ b/langtools/test/tools/javac/multicatch/7005371/SubTest.java @@ -21,18 +21,21 @@ * questions. */ -// key: compiler.err.multicatch.param.must.be.final +import java.util.*; -class MulticatchMustBeFinal { - void e1() throws NullPointerException { } - void e2() throws IllegalArgumentException { } +class SubTest { - void m() { + interface Foo {} + static class X1 extends Exception implements Foo {} + static class X2 extends Exception implements Foo {} + + void test(boolean cond, List ls) { try { - e1(); - e2(); - } catch (NullPointerException | IllegalArgumentException e) { - e.printStackTrace(); + if (cond) + throw new X1(); + else + throw new X2(); } + catch (X1 | X2 ex) {} } } diff --git a/langtools/test/tools/javac/multicatch/7005371/T7005371.java b/langtools/test/tools/javac/multicatch/7005371/T7005371.java new file mode 100644 index 00000000000..ae3360d6175 --- /dev/null +++ b/langtools/test/tools/javac/multicatch/7005371/T7005371.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7005371 + * @summary Multicatch: assertion error while generating LocalVariableTypeTable attribute + * @compile -g SubTest.java + * @run main T7005371 + */ + +import com.sun.tools.classfile.Attribute; +import com.sun.tools.classfile.ClassFile; +import com.sun.tools.classfile.Code_attribute; +import com.sun.tools.classfile.LocalVariableTypeTable_attribute; +import com.sun.tools.classfile.Method; + +import java.io.*; + +public class T7005371 { + + static final String SUBTEST_NAME = SubTest.class.getName() + ".class"; + static final String TEST_METHOD_NAME = "test"; + static final int LVT_LENGTH = 1; + static final String LVT_SIG_TYPE = "Ljava/util/List;"; + + + public static void main(String... args) throws Exception { + new T7005371().run(); + } + + public void run() throws Exception { + String workDir = System.getProperty("test.classes"); + System.out.println(workDir); + File compiledTest = new File(workDir, SUBTEST_NAME); + verifyLocalVariableTypeTableAttr(compiledTest); + } + + void verifyLocalVariableTypeTableAttr(File f) { + System.err.println("verify: " + f); + try { + ClassFile cf = ClassFile.read(f); + Method testMethod = null; + for (Method m : cf.methods) { + if (m.getName(cf.constant_pool).equals(TEST_METHOD_NAME)) { + testMethod = m; + break; + } + } + if (testMethod == null) { + throw new Error("Missing method: " + TEST_METHOD_NAME); + } + Code_attribute code = (Code_attribute)testMethod.attributes.get(Attribute.Code); + if (code == null) { + throw new Error("Missing Code attribute for method: " + TEST_METHOD_NAME); + } + LocalVariableTypeTable_attribute lvt_table = + (LocalVariableTypeTable_attribute)code.attributes.get(Attribute.LocalVariableTypeTable); + if (lvt_table == null) { + throw new Error("Missing LocalVariableTypeTable attribute for method: " + TEST_METHOD_NAME); + } + if (lvt_table.local_variable_table_length != LVT_LENGTH) { + throw new Error("LocalVariableTypeTable has wrong size" + + "\nfound: " + lvt_table.local_variable_table_length + + "\nrequired: " + LVT_LENGTH); + } + String sig = + cf.constant_pool.getUTF8Value(lvt_table.local_variable_table[0].signature_index); + + if (sig == null || !sig.equals(LVT_SIG_TYPE)) { + throw new Error("LocalVariableTypeTable has wrong signature" + + "\nfound: " + sig + + "\nrequired: " + LVT_SIG_TYPE); + } + } catch (Exception e) { + e.printStackTrace(); + throw new Error("error reading " + f +": " + e); + } + } +} diff --git a/langtools/test/tools/javac/multicatch/Neg01eff_final.java b/langtools/test/tools/javac/multicatch/Neg01eff_final.java new file mode 100644 index 00000000000..46a23b20fd5 --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Neg01eff_final.java @@ -0,0 +1,28 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6943289 + * + * @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch') + * @author darcy + * @compile/fail/ref=Neg01eff_final.out -XDrawDiagnostics Neg01eff_final.java + * @compile -source 6 -XDrawDiagnostics Neg01eff_final.java + * + */ + +class Neg01eff_final { + static class A extends Exception {} + static class B1 extends A {} + static class B2 extends A {} + + class Test { + void m() throws A { + try { + throw new B1(); + } catch (A ex1) { + try { + throw ex1; // used to throw A, now throws B1! + } catch (B2 ex2) { }//unreachable + } + } + } +} diff --git a/langtools/test/tools/javac/multicatch/Neg01eff_final.out b/langtools/test/tools/javac/multicatch/Neg01eff_final.out new file mode 100644 index 00000000000..6b6ab613949 --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Neg01eff_final.out @@ -0,0 +1,2 @@ +Neg01eff_final.java:24:19: compiler.err.except.never.thrown.in.try: Neg01eff_final.B2 +1 error diff --git a/langtools/test/tools/javac/multicatch/Neg02.java b/langtools/test/tools/javac/multicatch/Neg02.java index 6312447eb53..d4bd4070cb6 100644 --- a/langtools/test/tools/javac/multicatch/Neg02.java +++ b/langtools/test/tools/javac/multicatch/Neg02.java @@ -20,6 +20,8 @@ class Neg02 { else { throw new B(); } - } catch (A | B ex) { } + } catch (final A | B ex) { + ex = new B(); + } } } diff --git a/langtools/test/tools/javac/multicatch/Neg02.out b/langtools/test/tools/javac/multicatch/Neg02.out index f1404578442..5033a5fa62f 100644 --- a/langtools/test/tools/javac/multicatch/Neg02.out +++ b/langtools/test/tools/javac/multicatch/Neg02.out @@ -1,2 +1,2 @@ -Neg02.java:23:24: compiler.err.multicatch.param.must.be.final: ex +Neg02.java:24:13: compiler.err.multicatch.parameter.may.not.be.assigned: ex 1 error diff --git a/langtools/test/tools/javac/multicatch/Neg02eff_final.java b/langtools/test/tools/javac/multicatch/Neg02eff_final.java new file mode 100644 index 00000000000..6430b541bf6 --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Neg02eff_final.java @@ -0,0 +1,27 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6943289 6993963 + * + * @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch') + * @author mcimadamore + * @compile/fail/ref=Neg02eff_final.out -XDrawDiagnostics Neg02eff_final.java + * + */ + +class Neg02eff_final { + static class A extends Exception {} + static class B extends Exception {} + + void m() { + try { + if (true) { + throw new A(); + } + else { + throw new B(); + } + } catch (A | B ex) { + ex = new B(); + } + } +} diff --git a/langtools/test/tools/javac/multicatch/Neg02eff_final.out b/langtools/test/tools/javac/multicatch/Neg02eff_final.out new file mode 100644 index 00000000000..2d735a4cd6c --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Neg02eff_final.out @@ -0,0 +1,2 @@ +Neg02eff_final.java:24:13: compiler.err.multicatch.parameter.may.not.be.assigned: ex +1 error diff --git a/langtools/test/tools/javac/multicatch/Neg03.java b/langtools/test/tools/javac/multicatch/Neg03.java index c9e0b202c54..cf13a6372ee 100644 --- a/langtools/test/tools/javac/multicatch/Neg03.java +++ b/langtools/test/tools/javac/multicatch/Neg03.java @@ -9,19 +9,22 @@ */ class Neg03 { - static class A extends Exception {} - static class B extends Exception {} - void m() { + static class A extends Exception { public void m() {}; public Object f;} + static class B1 extends A {} + static class B2 extends A {} + + void m() throws B1, B2 { try { if (true) { - throw new A(); + throw new B1(); } else { - throw new B(); + throw new B2(); } - } catch (final A | B ex) { - ex = new B(); + } catch (Exception ex) { + ex = new B2(); //effectively final analysis disabled! + throw ex; } } } diff --git a/langtools/test/tools/javac/multicatch/Neg03.out b/langtools/test/tools/javac/multicatch/Neg03.out index c854ee991ff..f3487a5ac93 100644 --- a/langtools/test/tools/javac/multicatch/Neg03.out +++ b/langtools/test/tools/javac/multicatch/Neg03.out @@ -1,2 +1,2 @@ -Neg03.java:24:13: compiler.err.multicatch.parameter.may.not.be.assigned: ex +Neg03.java:27:13: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception 1 error diff --git a/langtools/test/tools/javac/multicatch/Neg04eff_final.java b/langtools/test/tools/javac/multicatch/Neg04eff_final.java new file mode 100644 index 00000000000..ea2548df51d --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Neg04eff_final.java @@ -0,0 +1,31 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6943289 + * + * @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch') + * @author mcimadamore + * @compile/fail/ref=Neg04eff_final.out -XDrawDiagnostics Neg04eff_final.java + * + */ + +class Neg04eff_final { + static class A extends Exception {} + static class B extends Exception {} + + void test() throws B { + try { + if (true) { + throw new A(); + } else if (false) { + throw new B(); + } else { + throw (Throwable)new Exception(); + } + } + catch (A e) {} + catch (Exception e) { + throw e; + } + catch (Throwable t) {} + } +} diff --git a/langtools/test/tools/javac/multicatch/Neg04eff_final.out b/langtools/test/tools/javac/multicatch/Neg04eff_final.out new file mode 100644 index 00000000000..e5b2e3d31de --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Neg04eff_final.out @@ -0,0 +1,2 @@ +Neg04eff_final.java:27:13: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception +1 error diff --git a/langtools/test/tools/javac/multicatch/Neg05.java b/langtools/test/tools/javac/multicatch/Neg05.java new file mode 100644 index 00000000000..0dcb7db353d --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Neg05.java @@ -0,0 +1,33 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6943289 + * + * @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch') + * @author mcimadamore + * @compile/fail/ref=Neg05.out -XDrawDiagnostics Neg05.java + * + */ + +class Neg02 { + + static class Foo { + Foo(X x) {} + } + + static interface Base {} + static class A extends Exception implements Base {} + static class B extends Exception implements Base {} + + void m() { + try { + if (true) { + throw new A(); + } + else { + throw new B(); + } + } catch (A | B ex) { + Foo f = new Foo<>(ex); + } + } +} diff --git a/langtools/test/tools/javac/multicatch/Neg05.out b/langtools/test/tools/javac/multicatch/Neg05.out new file mode 100644 index 00000000000..fbd05511adc --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Neg05.out @@ -0,0 +1,2 @@ +Neg05.java:30:31: compiler.err.cant.apply.diamond.1: (compiler.misc.diamond: Neg02.Foo), (compiler.misc.diamond.invalid.arg: java.lang.Exception&Neg02.Base>>, (compiler.misc.diamond: Neg02.Foo)) +1 error diff --git a/langtools/test/tools/javac/multicatch/Neg06.java b/langtools/test/tools/javac/multicatch/Neg06.java new file mode 100644 index 00000000000..3e6c7bbf2cf --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Neg06.java @@ -0,0 +1,16 @@ +/* + * @test /nodynamiccopyright/ + * @bug 7002070 + * + * @summary If catch clause has an incompatible type, error pointer points to first exception type in list + * @author mcimadamore + * @compile/fail/ref=Neg06.out -XDrawDiagnostics Neg06.java + * + */ + +class Neg06 { + void test() { + try { } + catch (String | Integer s) {} + } +} diff --git a/langtools/test/tools/javac/multicatch/Neg06.out b/langtools/test/tools/javac/multicatch/Neg06.out new file mode 100644 index 00000000000..9b89d06dcc4 --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Neg06.out @@ -0,0 +1,3 @@ +Neg06.java:14:16: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.String, java.lang.Throwable +Neg06.java:14:25: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Integer, java.lang.Throwable +2 errors diff --git a/langtools/test/tools/javac/multicatch/Pos06.java b/langtools/test/tools/javac/multicatch/Pos06.java new file mode 100644 index 00000000000..4819b0afcce --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Pos06.java @@ -0,0 +1,27 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6993963 + * + * @summary Project Coin: Use precise exception analysis for effectively final catch parameters + * @author mcimadamore + * @compile Pos06.java + * + */ + +class Pos06 { + static class A extends Exception {} + static class B extends Exception {} + + void m() { + try { + if (true) { + throw new A(); + } + else { + throw new B(); + } + } catch (A | B ex) { + System.out.println(ex); + } + } +} diff --git a/langtools/test/tools/javac/multicatch/Pos07.java b/langtools/test/tools/javac/multicatch/Pos07.java new file mode 100644 index 00000000000..3136ad25c43 --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Pos07.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6993963 + * @summary Project Coin: Use precise exception analysis for effectively final catch parameters + * @compile Pos07.java + */ + +class Pos07 { + + static class A extends Exception { public void m() {}; public Object f;} + static class B1 extends A {} + static class B2 extends A {} + + void m() throws B1, B2 { + try { + if (true) { + throw new B1(); + } + else { + throw new B2(); + } + } catch (Exception ex) { //effectively final analysis + throw ex; + } + } +} diff --git a/langtools/test/tools/javac/multicatch/Pos08.java b/langtools/test/tools/javac/multicatch/Pos08.java new file mode 100644 index 00000000000..7491e22fd0b --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Pos08.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6993963 + * @summary Multicatch: crash while compiling simple code with a multicatch parameter + * @compile Pos08.java + */ + +class Pos08 { + + interface Foo {} + static class X1 extends Exception implements Foo {} + static class X2 extends Exception implements Foo {} + + void m(boolean cond) { + try { + if (cond) + throw new X1(); + else + throw new X2(); + } + catch (final X1 | X2 ex) {} + } +} diff --git a/langtools/test/tools/javac/multicatch/Pos08eff_final.java b/langtools/test/tools/javac/multicatch/Pos08eff_final.java new file mode 100644 index 00000000000..034aa67cd58 --- /dev/null +++ b/langtools/test/tools/javac/multicatch/Pos08eff_final.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6993963 + * @summary Multicatch: crash while compiling simple code with a multicatch parameter + * @compile Pos08eff_final.java + */ + +class Pos08eff_final { + + interface Foo {} + static class X1 extends Exception implements Foo {} + static class X2 extends Exception implements Foo {} + + void m(boolean cond) { + try { + if (cond) + throw new X1(); + else + throw new X2(); + } + catch (X1 | X2 ex) {} + } +} diff --git a/langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsFilename.java b/langtools/test/tools/javac/multicatch/model/Check.java similarity index 90% rename from langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsFilename.java rename to langtools/test/tools/javac/multicatch/model/Check.java index 2e3cd0ff9a5..0f633e8436a 100644 --- a/langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsFilename.java +++ b/langtools/test/tools/javac/multicatch/model/Check.java @@ -21,6 +21,7 @@ * questions. */ -class VarargsFilename { - void m(T... items) { } -} +/** + * Annotation used by ModelChecker to mark the class whose model is to be checked + */ +@interface Check {} diff --git a/langtools/test/tools/javac/diags/examples/UnsupportedExoticID.java b/langtools/test/tools/javac/multicatch/model/Member.java similarity index 86% rename from langtools/test/tools/javac/diags/examples/UnsupportedExoticID.java rename to langtools/test/tools/javac/multicatch/model/Member.java index c14e9cd49d0..bf19ab1e2df 100644 --- a/langtools/test/tools/javac/diags/examples/UnsupportedExoticID.java +++ b/langtools/test/tools/javac/multicatch/model/Member.java @@ -21,11 +21,11 @@ * questions. */ -// key: compiler.err.unsupported.exotic.id -// options: -source 6 +import javax.lang.model.element.ElementKind; -class UnsupportedExoticID { - void m() { - Object #"Hello!" = null; - } +/** + * Annotation used by ModelChecker to mark a member that is to be checked + */ +@interface Member { + ElementKind value(); } diff --git a/langtools/test/tools/javac/multicatch/model/Model01.java b/langtools/test/tools/javac/multicatch/model/Model01.java new file mode 100644 index 00000000000..4a734ef9355 --- /dev/null +++ b/langtools/test/tools/javac/multicatch/model/Model01.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.lang.model.element.ElementKind; + +@Check +class Test { + + class A extends Exception { + @Member(ElementKind.METHOD) + public void m() {}; + @Member(ElementKind.FIELD) + public Object f; + } + + class B1 extends A {} + class B2 extends A {} + + void test(){ + try { + if (true) + throw new B1(); + else + throw new B2(); + } + catch(B1 | B2 ex) { } + } +} diff --git a/langtools/test/tools/javac/multicatch/model/ModelChecker.java b/langtools/test/tools/javac/multicatch/model/ModelChecker.java new file mode 100644 index 00000000000..2d1423c9437 --- /dev/null +++ b/langtools/test/tools/javac/multicatch/model/ModelChecker.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6993963 + * @summary Project Coin: Use precise exception analysis for effectively final catch parameters + * @library ../../lib + * @build JavacTestingAbstractProcessor ModelChecker + * @compile -processor ModelChecker Model01.java + */ + +import com.sun.source.tree.VariableTree; +import com.sun.source.util.TreePathScanner; +import com.sun.source.util.Trees; +import com.sun.source.util.TreePath; + +import java.util.Set; +import javax.annotation.processing.RoundEnvironment; +import javax.annotation.processing.SupportedAnnotationTypes; +import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; +import javax.lang.model.element.TypeElement; + +@SupportedAnnotationTypes("Check") +public class ModelChecker extends JavacTestingAbstractProcessor { + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + if (roundEnv.processingOver()) + return true; + + Trees trees = Trees.instance(processingEnv); + + TypeElement testAnno = elements.getTypeElement("Check"); + for (Element elem: roundEnv.getElementsAnnotatedWith(testAnno)) { + TreePath p = trees.getPath(elem); + new MulticatchParamTester(trees).scan(p, null); + } + return true; + } + + class MulticatchParamTester extends TreePathScanner { + Trees trees; + + public MulticatchParamTester(Trees trees) { + super(); + this.trees = trees; + } + + @Override + public Void visitVariable(VariableTree node, Void p) { + Element ex = trees.getElement(getCurrentPath()); + if (ex.getSimpleName().contentEquals("ex")) { + assertTrue(ex.getKind() == ElementKind.EXCEPTION_PARAMETER, "Expected EXCEPTION_PARAMETER - found " + ex.getKind()); + for (Element e : types.asElement(ex.asType()).getEnclosedElements()) { + Member m = e.getAnnotation(Member.class); + if (m != null) { + assertTrue(e.getKind() == m.value(), "Expected " + m.value() + " - found " + e.getKind()); + } + } + assertTrue(assertionCount == 3, "Expected 3 assertions - found " + assertionCount); + } + return super.visitVariable(node, p); + } + } + + private static void assertTrue(boolean cond, String msg) { + assertionCount++; + if (!cond) + throw new AssertionError(msg); + } + + static int assertionCount = 0; +} diff --git a/langtools/test/tools/javac/nio/compileTest/CompileTest.java b/langtools/test/tools/javac/nio/compileTest/CompileTest.java index b93fbfe9ded..739b2d75ca3 100644 --- a/langtools/test/tools/javac/nio/compileTest/CompileTest.java +++ b/langtools/test/tools/javac/nio/compileTest/CompileTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * 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 6906175 6915476 6915497 + * @bug 6906175 6915476 6915497 7006564 * @summary Path-based JavaFileManager * @compile -g HelloPathWorld.java * @run main CompileTest diff --git a/langtools/test/tools/javac/policy/test1/Test1a.java b/langtools/test/tools/javac/policy/test1/Test1a.java index bdf51d9bbf2..7d816d99d14 100644 --- a/langtools/test/tools/javac/policy/test1/Test1a.java +++ b/langtools/test/tools/javac/policy/test1/Test1a.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/policy/test2/Test.java b/langtools/test/tools/javac/policy/test2/Test.java index c331136f4da..80c12925de7 100644 --- a/langtools/test/tools/javac/policy/test2/Test.java +++ b/langtools/test/tools/javac/policy/test2/Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/processing/6994946/SemanticErrorTest.1.out b/langtools/test/tools/javac/processing/6994946/SemanticErrorTest.1.out new file mode 100644 index 00000000000..d91ade61e69 --- /dev/null +++ b/langtools/test/tools/javac/processing/6994946/SemanticErrorTest.1.out @@ -0,0 +1,2 @@ +SemanticErrorTest.java:11:46: compiler.err.repeated.interface +1 error diff --git a/langtools/test/tools/javac/processing/6994946/SemanticErrorTest.2.out b/langtools/test/tools/javac/processing/6994946/SemanticErrorTest.2.out new file mode 100644 index 00000000000..6a48a0e137b --- /dev/null +++ b/langtools/test/tools/javac/processing/6994946/SemanticErrorTest.2.out @@ -0,0 +1,4 @@ +SemanticErrorTest.java:11:46: compiler.err.repeated.interface +- compiler.err.proc.messager: Deliberate Error +SemanticErrorTest.java:11:46: compiler.err.repeated.interface +1 error diff --git a/langtools/test/tools/javac/processing/6994946/SemanticErrorTest.java b/langtools/test/tools/javac/processing/6994946/SemanticErrorTest.java new file mode 100644 index 00000000000..43a0521bba1 --- /dev/null +++ b/langtools/test/tools/javac/processing/6994946/SemanticErrorTest.java @@ -0,0 +1,13 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6994946 + * @summary option to specify only syntax errors as unrecoverable + * @library ../../lib + * @build JavacTestingAbstractProcessor TestProcessor + * @compile/fail/ref=SemanticErrorTest.1.out -XDrawDiagnostics -processor TestProcessor SemanticErrorTest.java + * @compile/fail/ref=SemanticErrorTest.2.out -XDrawDiagnostics -XDonlySyntaxErrorsUnrecoverable -processor TestProcessor SemanticErrorTest.java + */ + +class SemanticErrorTest implements Runnable, Runnable { + public void run() { } +} diff --git a/langtools/test/tools/javac/processing/6994946/SyntaxErrorTest.java b/langtools/test/tools/javac/processing/6994946/SyntaxErrorTest.java new file mode 100644 index 00000000000..44d67b62775 --- /dev/null +++ b/langtools/test/tools/javac/processing/6994946/SyntaxErrorTest.java @@ -0,0 +1,13 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6994946 + * @summary option to specify only syntax errors as unrecoverable + * @library ../../lib + * @build JavacTestingAbstractProcessor TestProcessor + * @compile/fail/ref=SyntaxErrorTest.out -XDrawDiagnostics -processor TestProcessor SyntaxErrorTest.java + * @compile/fail/ref=SyntaxErrorTest.out -XDrawDiagnostics -XDonlySyntaxErrorsUnrecoverable -processor TestProcessor SyntaxErrorTest.java + */ + +class SyntaxErrorTest { + int i +} diff --git a/langtools/test/tools/javac/processing/6994946/SyntaxErrorTest.out b/langtools/test/tools/javac/processing/6994946/SyntaxErrorTest.out new file mode 100644 index 00000000000..2b02bac18bc --- /dev/null +++ b/langtools/test/tools/javac/processing/6994946/SyntaxErrorTest.out @@ -0,0 +1,2 @@ +SyntaxErrorTest.java:12:10: compiler.err.expected: ';' +1 error diff --git a/langtools/test/tools/javac/processing/6994946/TestProcessor.java b/langtools/test/tools/javac/processing/6994946/TestProcessor.java new file mode 100644 index 00000000000..a6527a416d9 --- /dev/null +++ b/langtools/test/tools/javac/processing/6994946/TestProcessor.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.*; +import javax.annotation.processing.*; +import javax.lang.model.*; +import javax.lang.model.element.*; +import static javax.tools.Diagnostic.Kind.*; + +public class TestProcessor extends JavacTestingAbstractProcessor { + private int round = 0; + + public boolean process(Set annotations, + RoundEnvironment roundEnv) { + if (++round == 1) + messager.printMessage(ERROR, "Deliberate Error"); + return false; + } +} + diff --git a/langtools/test/tools/javac/processing/environment/round/TestContext.java b/langtools/test/tools/javac/processing/environment/round/TestContext.java new file mode 100644 index 00000000000..ddcba25fe80 --- /dev/null +++ b/langtools/test/tools/javac/processing/environment/round/TestContext.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6988836 + * @summary A new JavacElements is created for each round of annotation processing + * @library ../../../lib + * @build JavacTestingAbstractProcessor TestContext + * @compile/process -processor TestContext -XprintRounds TestContext + */ + +import java.io.*; +import java.util.*; +import javax.annotation.processing.*; +import javax.lang.model.element.*; +import javax.tools.*; +import static javax.tools.Diagnostic.Kind.*; + +import com.sun.source.util.Trees; +import com.sun.tools.javac.api.JavacTrees; +import com.sun.tools.javac.model.JavacElements; +import com.sun.tools.javac.model.JavacTypes; +import com.sun.tools.javac.processing.JavacProcessingEnvironment; +import com.sun.tools.javac.util.Context; + +public class TestContext extends JavacTestingAbstractProcessor { + + Trees treeUtils; + int round = 0; + + @Override + public void init(ProcessingEnvironment pEnv) { + super.init(pEnv); + treeUtils = Trees.instance(processingEnv); + } + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + round++; + + JavacProcessingEnvironment jpe = (JavacProcessingEnvironment) processingEnv; + Context c = jpe.getContext(); + check(c.get(JavacElements.class), eltUtils); + check(c.get(JavacTypes.class), typeUtils); + check(c.get(JavacTrees.class), treeUtils); + + final int MAXROUNDS = 3; + if (round < MAXROUNDS) + generateSource("Gen" + round); + + return true; + } + + void check(T actual, T expected) { +// messager.printMessage(NOTE, "expect: " + expected); +// messager.printMessage(NOTE, "actual: " + actual); + + if (actual != expected) { + messager.printMessage(ERROR, + "round " + round + " unexpected value for " + expected.getClass().getName() + ": " + actual); + } + } + + void generateSource(String name) { + String text = "class " + name + " { }\n"; + + try (Writer out = filer.createSourceFile(name).openWriter()) { + out.write(text); + } catch (IOException e) { + throw new Error(e); + } + } + +} + diff --git a/langtools/test/tools/javac/processing/errors/TestParseErrors/ParseErrors.java b/langtools/test/tools/javac/processing/errors/TestParseErrors/ParseErrors.java new file mode 100644 index 00000000000..9911916f5f9 --- /dev/null +++ b/langtools/test/tools/javac/processing/errors/TestParseErrors/ParseErrors.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.List; +import java.util.Vector; + +class test { + + public String m(List v, String s ) { + return null; + } + + public String m2(Vector vs, String s) { + return null; + } + + public void m3(testclass, +} + +class testclass { + T t; +} diff --git a/langtools/test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.java b/langtools/test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.java new file mode 100644 index 00000000000..bc094f31578 --- /dev/null +++ b/langtools/test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6988407 + * @summary javac crashes running processor on errant code; it used to print error message + * @library ../../../lib + * @build JavacTestingAbstractProcessor TestParseErrors + * @compile/fail/ref=TestParseErrors.out -XDrawDiagnostics -proc:only -processor TestParseErrors ParseErrors.java + */ + +import java.util.*; +import javax.annotation.processing.*; +import javax.lang.model.element.*; + +public class TestParseErrors extends JavacTestingAbstractProcessor { + + public boolean process(Set annotations, + RoundEnvironment roundEnvironment) { + throw new Error("Should not be called"); + } +} diff --git a/langtools/test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.out b/langtools/test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.out new file mode 100644 index 00000000000..947e921dd4d --- /dev/null +++ b/langtools/test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.out @@ -0,0 +1,8 @@ +ParseErrors.java:37:37: compiler.err.expected: token.identifier +ParseErrors.java:38:1: compiler.err.illegal.start.of.type +ParseErrors.java:38:2: compiler.err.expected: ')' +ParseErrors.java:40:6: compiler.err.expected: ';' +ParseErrors.java:40:20: compiler.err.illegal.start.of.type +ParseErrors.java:41:5: compiler.err.expected: '(' +ParseErrors.java:41:8: compiler.err.expected: token.identifier +7 errors diff --git a/langtools/test/tools/javac/processing/filer/TestValidRelativeNames.java b/langtools/test/tools/javac/processing/filer/TestValidRelativeNames.java new file mode 100644 index 00000000000..67d44e27734 --- /dev/null +++ b/langtools/test/tools/javac/processing/filer/TestValidRelativeNames.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6999891 + * @summary Test valid relative names for Filer.createResource and Filer.getResource + * @library ../../lib + * @build JavacTestingAbstractProcessor + * @compile TestValidRelativeNames.java + * @compile/process -processor TestValidRelativeNames -Amode=create java.lang.Object + * @compile/process -processor TestValidRelativeNames -Amode=get java.lang.Object + */ + +import java.io.*; +import java.util.*; +import javax.annotation.processing.*; +import javax.lang.model.*; +import javax.lang.model.element.*; +import javax.tools.Diagnostic; +import javax.tools.StandardLocation; + +@SupportedOptions("mode") +public class TestValidRelativeNames extends JavacTestingAbstractProcessor { + enum Kind { READER_WRITER, INPUT_OUTPUT_STREAM }; + + static final String[] validRelativeNames = { + "foo", "foo.bar", ".foo", ".foo.bar", "foodir/bar", "foodir/.bar" + }; + + public boolean process(Set annotations, RoundEnvironment roundEnv) { + if (roundEnv.processingOver()) { + String mode = options.get("mode"); + for (String relativeBase: validRelativeNames) { + for (Kind kind: Kind.values()) { + if (mode.equals("create")) + testCreate(relativeBase, kind); + else + testGet(relativeBase, kind); + } + } + } + + return true; + } + + void testCreate(String relativeBase, Kind kind) { + String relative = getRelative(relativeBase, kind); + System.out.println("test create relative path: " + relative + ", kind: " + kind); + try { + switch (kind) { + case READER_WRITER: + try (Writer writer = filer.createResource( + StandardLocation.CLASS_OUTPUT, "", relative).openWriter()) { + writer.write(relative); + } + break; + + case INPUT_OUTPUT_STREAM: + try (OutputStream out = filer.createResource( + StandardLocation.CLASS_OUTPUT, "", relative).openOutputStream()) { + out.write(relative.getBytes()); + } + break; + } + } catch (Exception e) { + messager.printMessage(Diagnostic.Kind.ERROR, + "relative path: " + relative + ", kind: " + kind + ", unexpected exception: " + e); + } + } + + void testGet(String relativeBase, Kind kind) { + String relative = getRelative(relativeBase, kind); + System.out.println("test get relative path: " + relative + ", kind: " + kind); + try { + switch (kind) { + case READER_WRITER: + try (Reader reader = new BufferedReader(filer.getResource( + StandardLocation.CLASS_OUTPUT, "", relative).openReader(true))) { + StringBuilder sb = new StringBuilder(); + char[] buf = new char[1024]; + int n; + while ((n = reader.read(buf, 0, buf.length)) > 0) + sb.append(new String(buf, 0, n)); + if (!sb.toString().equals(relative)) { + messager.printMessage(Diagnostic.Kind.ERROR, "unexpected content: " + sb); + } + } + break; + + case INPUT_OUTPUT_STREAM: + try (InputStream in = new DataInputStream(filer.getResource( + StandardLocation.CLASS_OUTPUT, "", relative).openInputStream())) { + StringBuilder sb = new StringBuilder(); + byte[] buf = new byte[1024]; + int n; + while ((n = in.read(buf, 0, buf.length)) > 0) + sb.append(new String(buf, 0, n)); + if (!sb.toString().equals(relative)) { + messager.printMessage(Diagnostic.Kind.ERROR, "unexpected content: " + sb); + } + } + break; + } + } catch (Exception e) { + messager.printMessage(Diagnostic.Kind.ERROR, + "relative path: " + relative + ", kind: " + kind + ", unexpected exception: " + e); + } + } + + String getRelative(String relativeBase, Kind kind) { + String suffix = (kind == Kind.READER_WRITER ? "RW" : "IOS"); + return relativeBase.replace("foo", "foo" + suffix); + } +} + diff --git a/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java b/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java index f5bddff0a45..d602bc08ead 100644 --- a/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java +++ b/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java @@ -78,7 +78,7 @@ public class TestAnonClassNames { @Nesting(LOCAL) class LocalClass{}; - Object o = new @Nesting(ANONYMOUS) Object() { // An anonymous annotated class + Object o = new /*@Nesting(ANONYMOUS)*/ Object() { // An anonymous annotated class public String toString() { return "I have no name!"; } @@ -95,9 +95,10 @@ public class TestAnonClassNames { for(Class clazz : classes) { String name = clazz.getName(); + Nesting anno = clazz.getAnnotation(Nesting.class); System.out.format("%s is %s%n", clazz.getName(), - clazz.getAnnotation(Nesting.class).value()); + anno == null ? "(unset/ANONYMOUS)" : anno.value()); testClassName(name); } } @@ -161,8 +162,8 @@ class ClassNameProber extends JavacTestingAbstractProcessor { typeElt.getQualifiedName().toString(), typeElt.getKind().toString(), nestingKind.toString()); - - if (typeElt.getAnnotation(Nesting.class).value() != nestingKind) { + Nesting anno = typeElt.getAnnotation(Nesting.class); + if ((anno == null ? NestingKind.ANONYMOUS : anno.value()) != nestingKind) { throw new RuntimeException("Mismatch of expected and reported nesting kind."); } } diff --git a/langtools/test/tools/javac/processing/model/util/elements/Foo.java b/langtools/test/tools/javac/processing/model/util/elements/Foo.java index f7dde2e60b3..39b4eb9f316 100644 --- a/langtools/test/tools/javac/processing/model/util/elements/Foo.java +++ b/langtools/test/tools/javac/processing/model/util/elements/Foo.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java b/langtools/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java index bba89985c57..a5c0c2f3058 100644 --- a/langtools/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java +++ b/langtools/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java @@ -27,15 +27,15 @@ * @summary Test that warnings about source versions are output as expected. * @author Joseph D. Darcy * @compile TestSourceVersionWarnings.java - * @compile/ref=gold_0.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -source 1.5 HelloWorld.java - * @compile/ref=gold_sv_warn_0_2.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_0 -source 1.2 HelloWorld.java - * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.2 HelloWorld.java - * @compile/ref=gold_sv_warn_2_3.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.3 HelloWorld.java - * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.5 HelloWorld.java - * @compile/ref=gold_sv_warn_5_6.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.6 HelloWorld.java - * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 HelloWorld.java - * @compile/ref=gold_unsp_warn.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Aunsupported HelloWorld.java - * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_7 -source 1.7 HelloWorld.java + * @compile/ref=gold_0.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -source 1.5 -Xlint:-options HelloWorld.java + * @compile/ref=gold_sv_warn_0_2.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_0 -source 1.2 -Xlint:-options HelloWorld.java + * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.2 -Xlint:-options HelloWorld.java + * @compile/ref=gold_sv_warn_2_3.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.3 -Xlint:-options HelloWorld.java + * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.5 -Xlint:-options HelloWorld.java + * @compile/ref=gold_sv_warn_5_6.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.6 -Xlint:-options HelloWorld.java + * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options HelloWorld.java + * @compile/ref=gold_unsp_warn.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options -Aunsupported HelloWorld.java + * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_7 -source 1.7 HelloWorld.java */ import java.util.Set; diff --git a/langtools/test/tools/javac/quid/QuotedIdent.java b/langtools/test/tools/javac/quid/QuotedIdent.java deleted file mode 100644 index 6920dc5a240..00000000000 --- a/langtools/test/tools/javac/quid/QuotedIdent.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6746458 - * @summary Verify correct lexing of quoted identifiers. - * @author jrose - * @ignore 6877225 test fails on Windows: - * QuotedIdent.java:81: error while writing QuotedIdent.*86: PATH\QuotedIdent$*86.class - * (The filename, directory name, or volume label syntax is incorrect) - * - * @library .. - * @compile -source 7 -target 7 -XDinvokedynamic QuotedIdent.java - * @run main quid.QuotedIdent - */ - -/* - * Standalone testing: - * - * $ cd $MY_REPO_DIR/langtools - * $ (cd make; make) - * $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/quid/QuotedIdent.java - * $ java -version # should print 1.6 or later - * $ java -cp dist quid.QuotedIdent - * - */ - -package quid; - -public class QuotedIdent { - static void check(int testid, String have, String expect) - throws RuntimeException { - if ((have == null && have != expect) || - (have != null && !have.equals(expect))) { - String msg = - "TEST " + testid + ": HAVE \"" + - have + "\" EXPECT \"" + expect + "\""; - System.out.println("StringConversion: " + msg); - throw new RuntimeException(msg); - } - } - - // negative tests: - //static class #"" { } //BAD empty ident name - //static class #"" { } //BAD bad char in ident name - /*static class /*(//BAD ident name interrupted by newline) #"jump: - " { } /* uncomment previous line to attempt class w/ bad name */ - - static class #"int" extends Number { - final int #"int"; - #"int"(int #"int") { - this.#"int" = #"int"; - } - static #"int" valueOf(int #"int") { - return new #"int"(#"int"); - } - public int intValue() { return #"int"; } - public long longValue() { return #"int"; } - public float floatValue() { return #"int"; } - public double doubleValue() { return #"int"; } - public String toString() { return String.valueOf(#"int"); } - } - - class #"*86" { - String #"555-1212"() { return "[*86.555-1212]"; } - } - static#"*86"#"MAKE-*86"() { // note close spacing - return new QuotedIdent().new#"*86"(); - } - - static String bar() { return "[bar]"; } - - public static void main(String[] args) throws Exception { - String s; - - String #"sticky \' wicket" = "wicked ' stick"; - s = #"sticky ' wicket"; - check(11, s, "wicked \' stick"); - check(12, #"s", s); - check(13, #"\163", s); - - s = #"QuotedIdent".bar(); - check(21, s, "[bar]"); - - s = #"int".valueOf(123).toString(); - check(22, s, "123"); - - s = #"MAKE-*86"().#"555-1212"(); - check(23, s, "[*86.555-1212]"); - - class#"{{{inmost}}}" { } - s = new#"{{{inmost}}}"().getClass().getName(); - if (!s.endsWith("{{{inmost}}}")) - check(24, s, "should end with \"{{{inmost}}}\""); - - s = #"Yog-Shoggoth".#"(nameless ululation)"; - check(25, s, "Tekeli-li!"); - - s = #"int".class.getName(); - check(31, s, QuotedIdent.class.getName()+"$int"); - - Class x86 = Class.forName(QuotedIdent.class.getName()+"$*86"); - if (x86 != #"*86".class) - check(32, "reflected "+x86, "static "+#"*86".class); - - s = (String) x86.getDeclaredMethod("555-1212").invoke(#"MAKE-*86"()); - check(31, s, "[*86.555-1212]"); - - System.out.println("OK"); - } -} - -interface #"Yog-Shoggoth" { - final String #"(nameless ululation)" = "Tekeli-li!"; -} diff --git a/langtools/test/tools/javac/quid/QuotedIdent2.java b/langtools/test/tools/javac/quid/QuotedIdent2.java deleted file mode 100644 index eeea1538277..00000000000 --- a/langtools/test/tools/javac/quid/QuotedIdent2.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6746458 - * @summary Verify correct separate compilation of classes with extended identifiers. - * @author jrose - * @ignore 6877225 test fails on Windows: - * QuotedIdent.java:81: error while writing QuotedIdent.*86: PATH\QuotedIdent$*86.class - * (The filename, directory name, or volume label syntax is incorrect) - * - * @library .. - * @compile -source 7 -target 7 -XDinvokedynamic QuotedIdent.java - * @run main quid.QuotedIdent2 - */ -/* - * Standalone testing: - * - * $ cd $MY_REPO_DIR/langtools - * $ (cd make; make) - * $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/quid/QuotedIdent.java - * $ ./dist/bootstrap/bin/javac -d dist -cp dist test/tools/javac/quid/QuotedIdent2.java - * $ java -version # should print 1.6 or later - * $ java -cp dist QuotedIdent2 - * - */ - -package quid; - -import quid.QuotedIdent.*; -import quid.QuotedIdent.#"*86"; -import static quid.QuotedIdent.#"MAKE-*86"; - -public class QuotedIdent2 { - static void check(int testid, String have, String expect) - throws RuntimeException { - QuotedIdent.check(testid, have, expect); - } - - public static void main(String[] args) throws Exception { - String s; - - s = #"int".valueOf(123).toString(); - check(22, s, "123"); - - s = #"MAKE-*86"().#"555-1212"(); - check(23, s, "[*86.555-1212]"); - - s = #"Yog-Shoggoth".#"(nameless ululation)"; - check(25, s, "Tekeli-li!"); - - s = QuotedIdent.#"int".class.getName(); - check(31, s, QuotedIdent.class.getName()+"$int"); - - Class x86 = Class.forName(QuotedIdent.class.getName()+"$*86"); - if (x86 != #"*86".class) - check(32, "reflected "+x86, "static "+#"*86".class); - - s = (String) x86.getDeclaredMethod("555-1212").invoke(QuotedIdent.#"MAKE-*86"()); - check(31, s, "[*86.555-1212]"); - - System.out.println("OK"); - } -} diff --git a/langtools/test/tools/javac/quid/T6999438.java b/langtools/test/tools/javac/quid/T6999438.java new file mode 100644 index 00000000000..c42b1f74960 --- /dev/null +++ b/langtools/test/tools/javac/quid/T6999438.java @@ -0,0 +1,9 @@ +/* @test /nodynamiccopyright/ + * @bug 6999438 + * @summary remove support for exotic identifiers from JDK 7 + * @compile/fail/ref=T6999438.out -XDrawDiagnostics -source 7 T6999438.java + */ + +class Test { + int #"not supported"; +} diff --git a/langtools/test/tools/javac/quid/T6999438.out b/langtools/test/tools/javac/quid/T6999438.out new file mode 100644 index 00000000000..cd6266895d1 --- /dev/null +++ b/langtools/test/tools/javac/quid/T6999438.out @@ -0,0 +1,6 @@ +T6999438.java:8:9: compiler.err.illegal.char: 35 +T6999438.java:8:10: compiler.err.illegal.start.of.type +T6999438.java:8:25: compiler.err.expected: token.identifier +T6999438.java:8:26: compiler.err.expected: ';' +T6999438.java:9:2: compiler.err.premature.eof +5 errors diff --git a/langtools/test/tools/javac/rawDiags/Note.java b/langtools/test/tools/javac/rawDiags/Note.java index 3e44f5aed5e..0f160ff7ed0 100644 --- a/langtools/test/tools/javac/rawDiags/Note.java +++ b/langtools/test/tools/javac/rawDiags/Note.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/scope/HashCollisionTest.java b/langtools/test/tools/javac/scope/HashCollisionTest.java new file mode 100644 index 00000000000..b0a1ef51f22 --- /dev/null +++ b/langtools/test/tools/javac/scope/HashCollisionTest.java @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7004029 + * @summary Ensure Scope impl can cope with hash collisions + */ + +import java.lang.reflect.*; +import java.io.*; +import com.sun.tools.javac.util.*; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Scope.*; +import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.file.JavacFileManager; +import static com.sun.tools.javac.code.Kinds.*; + +public class HashCollisionTest { + public static void main(String... args) throws Exception { + new HashCollisionTest().run(); + } + + void run() throws Exception { + // set up basic environment for test + Context context = new Context(); + JavacFileManager.preRegister(context); // required by ClassReader which is required by Symtab + names = Names.instance(context); // Name.Table impls tied to an instance of Names + symtab = Symtab.instance(context); + scopeCounter = ScopeCounter.instance(context); + + // determine hashMask for an empty scope + Scope emptyScope = new Scope(symtab.unnamedPackage); // any owner will do + Field sHashMask = Scope.class.getDeclaredField("hashMask"); + sHashMask.setAccessible(true); + scopeHashMask = sHashMask.getInt(emptyScope); + log("scopeHashMask: " + scopeHashMask); + + // 1. determine the Name.hashCode of "Entry", and therefore the index of + // Entry in an empty scope. i.e. name.hashCode() & Scope.hashMask + Name entry = names.fromString("Entry"); + + // 2. create names of the form *$Entry until we find a name with a + // hashcode which yields the same index as Entry in an empty scope. + // Since Name.hashCode is a function of position (and not content) it + // should work to create successively longer names until one with the + // desired characteristics is found. + Name outerName; + Name innerName; + StringBuilder sb = new StringBuilder("C"); + int i = 0; + do { + sb.append(Integer.toString(i % 10)); + innerName = names.fromString(sb + "$Entry"); + } while (!clash(entry, innerName) && (++i) < MAX_TRIES); + + if (clash(entry, innerName)) { + log("Detected expected hash collision for " + entry + " and " + innerName + + " after " + i + " tries"); + } else { + throw new Exception("No potential collision found after " + i + " tries"); + } + + outerName = names.fromString(sb.toString()); + + /* + * Now we can set up the scenario. + */ + + // 3. Create a nested class named Entry + ClassSymbol cc = createClass(names.fromString("C"), symtab.unnamedPackage); + ClassSymbol ce = createClass(entry, cc); + + // 4. Create a package containing a nested class using the name from 2 + PackageSymbol p = new PackageSymbol(names.fromString("p"), symtab.rootPackage); + p.members_field = new Scope(p); + ClassSymbol inner = createClass(innerName, p); + // we'll need this later when we "rename" cn + ClassSymbol outer = createClass(outerName, p); + + // 5. Create a star-import scope + log ("createStarImportScope"); + + // if StarImportScope exists, use it, otherwise, for testing legacy code, + // fall back on ImportScope + Scope starImportScope; + Method importAll; + PackageSymbol pkg = new PackageSymbol(names.fromString("pkg"), symtab.rootPackage); + try { + Class c = Class.forName("com.sun.tools.javac.code.Scope$StarImportScope"); + Constructor ctor = c.getDeclaredConstructor(new Class[] { Symbol.class }); + importAll = c.getDeclaredMethod("importAll", new Class[] { Scope.class }); + starImportScope = (Scope) ctor.newInstance(new Object[] { pkg }); + } catch (ClassNotFoundException e) { + starImportScope = new ImportScope(pkg); + importAll = null; + } + + dump("initial", starImportScope); + + // 6. Insert the contents of the package from 4. + Scope p_members = p.members(); + if (importAll != null) { + importAll.invoke(starImportScope, p_members); + } else { + Scope fromScope = p_members; + Scope toScope = starImportScope; + // The following lines are taken from MemberEnter.importAll, + // before the use of StarImportScope.importAll. + for (Scope.Entry e = fromScope.elems; e != null; e = e.sibling) { + if (e.sym.kind == TYP && !toScope.includes(e.sym)) + toScope.enter(e.sym, fromScope); + } + } + + dump("imported p", starImportScope); + + // 7. Insert the class from 3. + starImportScope.enter(ce, cc.members_field); + dump("imported ce", starImportScope); + + /* + * Set the trap. + */ + + // 8. Rename the nested class to Entry. so that there is a bogus entry in the star-import scope + p.members_field.remove(inner); + inner.name = entry; + inner.owner = outer; + outer.members_field.enter(inner); + + // 9. Lookup Entry + Scope.Entry e = starImportScope.lookup(entry); + dump("final", starImportScope); + + if (e.sym == null) + throw new Exception("symbol not found: " + entry); + } + + /* + * Check for a (probable) hash collision in an empty scope. + */ + boolean clash(Name n1, Name n2) { + log(n1 + " hc:" + n1.hashCode() + " v:" + (n1.hashCode() & scopeHashMask) + ", " + + n2 + " hc:" + n2.hashCode() + " v:" + (n2.hashCode() & scopeHashMask)); + return (n1.hashCode() & scopeHashMask) == (n2.hashCode() & scopeHashMask); + } + + /** + * Create a class symbol, init the members scope, and add it to owner's scope. + */ + ClassSymbol createClass(Name name, Symbol owner) { + ClassSymbol sym = new ClassSymbol(0, name, owner); + sym.members_field = new ClassScope(sym, scopeCounter); + if (owner != symtab.unnamedPackage) + owner.members().enter(sym); + return sym; + } + + /** + * Dump the contents of a scope to System.err. + */ + void dump(String label, Scope s) throws Exception { + dump(label, s, System.err); + } + + /** + * Dump the contents of a scope to a stream. + */ + void dump(String label, Scope s, PrintStream out) throws Exception { + out.println(label); + Field sTable = Scope.class.getDeclaredField("table"); + sTable.setAccessible(true); + + out.println("owner:" + s.owner); + Scope.Entry[] table = (Scope.Entry[]) sTable.get(s); + for (int i = 0; i < table.length; i++) { + if (i > 0) + out.print(", "); + out.print(i + ":" + toString(table[i], table, false)); + } + out.println(); + } + + /** + * Create a string showing the contents of an entry, using the table + * to help identify cross-references to other entries in the table. + * @param e the entry to be shown + * @param table the table containing the other entries + */ + String toString(Scope.Entry e, Scope.Entry[] table, boolean ref) { + if (e == null) + return "null"; + if (e.sym == null) + return "sent"; // sentinel + if (ref) { + int index = indexOf(table, e); + if (index != -1) + return String.valueOf(index); + } + return "(" + e.sym.name + ":" + e.sym + + ",shdw:" + toString(e.next(), table, true) + + ",sibl:" + toString(e.sibling, table, true) + + ((e.sym.owner != e.scope.owner) + ? (",BOGUS[" + e.sym.owner + "," + e.scope.owner + "]") + : "") + + ")"; + } + + int indexOf(T[] array, T item) { + for (int i = 0; i < array.length; i++) { + if (array[i] == item) + return i; + } + return -1; + } + + /** + * Write a message to stderr. + */ + void log(String msg) { + System.err.println(msg); + } + + int MAX_TRIES = 100; // max tries to find a hash clash before giving up. + int scopeHashMask; + + Names names; + Symtab symtab; + ScopeCounter scopeCounter; +} diff --git a/langtools/test/tools/javac/scope/StarImportTest.java b/langtools/test/tools/javac/scope/StarImportTest.java new file mode 100644 index 00000000000..600b0227332 --- /dev/null +++ b/langtools/test/tools/javac/scope/StarImportTest.java @@ -0,0 +1,402 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7004029 + * @summary Basher for star-import scopes + */ + +import java.lang.reflect.*; +import java.util.*; +import java.util.List; +import com.sun.tools.javac.util.*; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Scope.*; +import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.file.JavacFileManager; +import static com.sun.tools.javac.code.Kinds.*; + +public class StarImportTest { + public static void main(String... args) throws Exception { + new StarImportTest().run(args); + } + + void run(String... args) throws Exception { + int count = 1; + + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + if (arg.equals("-seed") && (i + 1 < args.length)) + seed = Long.parseLong(args[++i]); + else if(arg.equals("-tests") && (i + 1 < args.length)) + count = Integer.parseInt(args[++i]); + else + throw new Exception("unknown arg: " + arg); + } + + rgen = new Random(seed); + + for (int i = 0; i < count; i++) { + Test t = new Test(); + t.run(); + } + + if (errors > 0) + throw new Exception(errors + " errors found"); + } + + /** + * Select a random element from an array of choices. + */ + T random(T... choices) { + return choices[rgen.nextInt(choices.length)]; + } + + /** + * Write a message to stderr. + */ + void log(String msg) { + System.err.println(msg); + } + + /** + * Write a message to stderr, and dump a scope. + */ + void log(String msg, Scope s) { + System.err.print(msg); + System.err.print(": "); + String sep = "("; + for (Scope.Entry se = s.elems; se != null; se = se.sibling) { + for (Scope.Entry e = se; e.sym != null; e = e.next()) { + System.err.print(sep + e.sym.name + ":" + e.sym); + sep = ","; + } + System.err.print(")"); + sep = ", ("; + } + System.err.println(); + } + + /** + * Write an error message to stderr. + */ + void error(String msg) { + System.err.println("Error: " + msg); + errors++; + } + + Random rgen; + long seed = 0; + + int errors; + + enum SetupKind { NAMES, PACKAGE, CLASS }; + static final int MAX_SETUP_COUNT = 50; + static final int MAX_SETUP_NAME_COUNT = 20; + static final int MAX_SETUP_PACKAGE_COUNT = 20; + static final int MAX_SETUP_CLASS_COUNT = 20; + + /** Class to encapsulate a test run. */ + class Test { + /** Run the test. */ + void run() throws Exception { + log ("starting test"); + setup(); + createStarImportScope(); + test(); + } + + /** + * Setup env by creating pseudo-random collection of names, packages and classes. + */ + void setup() { + log ("setup"); + context = new Context(); + JavacFileManager.preRegister(context); // required by ClassReader which is required by Symtab + names = Names.instance(context); // Name.Table impls tied to an instance of Names + symtab = Symtab.instance(context); + scopeCounter = ScopeCounter.instance(context); + int setupCount = rgen.nextInt(MAX_SETUP_COUNT); + for (int i = 0; i < setupCount; i++) { + switch (random(SetupKind.values())) { + case NAMES: + setupNames(); + break; + case PACKAGE: + setupPackage(); + break; + case CLASS: + setupClass(); + break; + } + } + } + + /** + * Set up a random number of names. + */ + void setupNames() { + int count = rgen.nextInt(MAX_SETUP_NAME_COUNT); + log("setup: creating " + count + " new names"); + for (int i = 0; i < count; i++) { + names.fromString("n" + (++nextNameSerial)); + } + } + + /** + * Set up a package containing a random number of member elements. + */ + void setupPackage() { + Name name = names.fromString("p" + (++nextPackageSerial)); + int count = rgen.nextInt(MAX_SETUP_PACKAGE_COUNT); + log("setup: creating package " + name + " with " + count + " entries"); + PackageSymbol p = new PackageSymbol(name, symtab.rootPackage); + p.members_field = new Scope(p); + for (int i = 0; i < count; i++) { + String outer = name + "c" + i; + String suffix = random(null, "$Entry", "$Entry2"); + ClassSymbol c1 = createClass(names.fromString(outer), p); +// log("setup: created " + c1); + if (suffix != null) { + ClassSymbol c2 = createClass(names.fromString(outer + suffix), p); +// log("setup: created " + c2); + } + } +// log("package " + p, p.members_field); + packages.add(p); + imports.add(p); + } + + /** + * Set up a class containing a random number of member elements. + */ + void setupClass() { + Name name = names.fromString("c" + (++nextClassSerial)); + int count = rgen.nextInt(MAX_SETUP_CLASS_COUNT); + log("setup: creating class " + name + " with " + count + " entries"); + ClassSymbol c = createClass(name, symtab.unnamedPackage); +// log("setup: created " + c); + for (int i = 0; i < count; i++) { + ClassSymbol ic = createClass(names.fromString("Entry" + i), c); +// log("setup: created " + ic); + } + classes.add(c); + imports.add(c); + } + + /** + * Create a star-import scope and a model therof, from the packages and + * classes created by setupPackages and setupClasses. + * @throws Exception for fatal errors, such as from reflection + */ + void createStarImportScope() throws Exception { + log ("createStarImportScope"); + PackageSymbol pkg = new PackageSymbol(names.fromString("pkg"), symtab.rootPackage); + + // if StarImportScope exists, use it, otherwise, for testing legacy code, + // fall back on ImportScope + Method importAll; + try { + Class c = Class.forName("com.sun.tools.javac.code.Scope$StarImportScope"); + Constructor ctor = c.getDeclaredConstructor(new Class[] { Symbol.class }); + importAll = c.getDeclaredMethod("importAll", new Class[] { Scope.class }); + starImportScope = (Scope) ctor.newInstance(new Object[] { pkg }); + } catch (ClassNotFoundException e) { + starImportScope = new ImportScope(pkg); + importAll = null; + } + starImportModel = new Model(); + + for (Symbol imp: imports) { + Scope members = imp.members(); + if (importAll != null) { +// log("importAll", members); + importAll.invoke(starImportScope, members); + } else { + Scope fromScope = members; + Scope toScope = starImportScope; + // The following lines are taken from MemberEnter.importAll, + // before the use of StarImportScope.importAll. + for (Scope.Entry e = fromScope.elems; e != null; e = e.sibling) { + if (e.sym.kind == TYP && !toScope.includes(e.sym)) + toScope.enter(e.sym, fromScope); + } + } + + for (Scope.Entry e = members.elems; e != null; e = e.sibling) { + starImportModel.enter(e.sym); + } + } + +// log("star-import scope", starImportScope); + starImportModel.check(starImportScope); + } + + /** + * The core of the test. In a random order, move nested classes from + * the package in which they created to the class which should own them. + */ + void test() { + log ("test"); + List nestedClasses = new LinkedList(); + for (PackageSymbol p: packages) { + for (Scope.Entry se = p.members_field.elems; se != null; se = se.sibling) { + if (se.sym.name.toString().contains("$")) + nestedClasses.add((ClassSymbol) se.sym); + } + } + + for (int i = nestedClasses.size(); i > 0; i--) { + // select a random nested class to move from package to class + ClassSymbol sym = nestedClasses.remove(rgen.nextInt(i)); + log("adjusting class " + sym); + + // remove from star import model + starImportModel.remove(sym); + + String s = sym.name.toString(); + int dollar = s.indexOf("$"); + + // owner should be a package + assert (sym.owner.kind == PCK); + + // determine new owner + Name outerName = names.fromString(s.substring(0, dollar)); +// log(sym + " owner: " + sym.owner, sym.owner.members()); + Scope.Entry outerEntry = sym.owner.members().lookup(outerName); + ClassSymbol outer = (ClassSymbol) outerEntry.sym; +// log("outer: " + outerName + " " + outer); + + // remove from package + sym.owner.members().remove(sym); + + // rename and insert into class + sym.name = names.fromString(s.substring(dollar + 1)); + outer.members().enter(sym); + sym.owner = outer; + + // verify + starImportModel.check(starImportScope); + } + } + + ClassSymbol createClass(Name name, Symbol owner) { + ClassSymbol sym = new ClassSymbol(0, name, owner); + sym.members_field = new ClassScope(sym, scopeCounter); + if (owner != symtab.unnamedPackage) + owner.members().enter(sym); + return sym; + } + + Context context; + Symtab symtab; + ScopeCounter scopeCounter; + Names names; + int nextNameSerial; + List packages = new ArrayList(); + int nextPackageSerial; + List classes = new ArrayList(); + List imports = new ArrayList(); + int nextClassSerial; + + Scope starImportScope; + Model starImportModel; + } + + class Model { + private Map> map = new HashMap>(); + private Set bogus = new HashSet(); + + void enter(Symbol sym) { + Set syms = map.get(sym.name); + if (syms == null) + map.put(sym.name, syms = new LinkedHashSet()); + syms.add(sym); + } + + void remove(Symbol sym) { + Set syms = map.get(sym.name); + if (syms == null) + error("no entries for " + sym.name + " found in reference model"); + else { + boolean ok = syms.remove(sym); + if (ok) { +// log(sym.name + "(" + sym + ") removed from reference model"); + } else { + error(sym.name + " not found in reference model"); + } + if (syms.isEmpty()) + map.remove(sym.name); + } + } + + /** + * Check the contents of a scope + */ + void check(Scope scope) { + // First, check all entries in scope are in map + int bogusCount = 0; + for (Scope.Entry se = scope.elems; se != null; se = se.sibling) { + Symbol sym = se.sym; + if (sym.owner != se.scope.owner) { + if (bogus.contains(sym)) { + bogusCount++; + } else { + log("Warning: " + sym.name + ":" + sym + " appears to be bogus"); + bogus.add(sym); + } + } else { + Set syms = map.get(sym.name); + if (syms == null) { + error("check: no entries found for " + sym.name + ":" + sym + " in reference map"); + } else if (!syms.contains(sym)) { + error("check: symbol " + sym.name + ":" + sym + " not found in reference map"); + } + } + } + if (bogusCount > 0) { + log("Warning: " + bogusCount + " other bogus entries previously reported"); + } + + // Second, check all entries in map are in scope + for (Map.Entry> me: map.entrySet()) { + Name name = me.getKey(); + Scope.Entry se = scope.lookup(name); + assert (se != null); + if (se.sym == null) { + error("check: no entries found for " + name + " in scope"); + continue; + } + nextSym: + for (Symbol sym: me.getValue()) { + for (Scope.Entry e = se; e.sym != null; e = e.next()) { + if (sym == e.sym) + continue nextSym; + } + error("check: symbol " + sym + " not found in scope"); + } + } + } + } +} diff --git a/langtools/test/tools/javac/tree/AbstractTreeScannerTest.java b/langtools/test/tools/javac/tree/AbstractTreeScannerTest.java index 359690b9f5e..b0fe687fdff 100644 --- a/langtools/test/tools/javac/tree/AbstractTreeScannerTest.java +++ b/langtools/test/tools/javac/tree/AbstractTreeScannerTest.java @@ -143,6 +143,13 @@ public abstract class AbstractTreeScannerTest { abstract int test(JCCompilationUnit t); + // See CR: 6982992 Tests CheckAttributedTree.java, JavacTreeScannerTest.java, and SourceTreeeScannerTest.java timeout + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + Reporter r = new Reporter(pw); + JavacTool tool = JavacTool.create(); + StandardJavaFileManager fm = tool.getStandardFileManager(r, null, null); + /** * Read a file. * @param file the file to be read @@ -151,11 +158,8 @@ public abstract class AbstractTreeScannerTest { * @throws TreePosTest.ParseException if any errors occur while parsing the file */ JCCompilationUnit read(File file) throws IOException, ParseException { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - Reporter r = new Reporter(pw); JavacTool tool = JavacTool.create(); - StandardJavaFileManager fm = tool.getStandardFileManager(r, null, null); + r.errors = 0; Iterable files = fm.getJavaFileObjects(file); JavacTask task = tool.getTask(pw, fm, r, Collections.emptyList(), null, files); Iterable trees = task.parse(); diff --git a/langtools/test/tools/javac/tree/MakeLiteralTest.java b/langtools/test/tools/javac/tree/MakeLiteralTest.java new file mode 100644 index 00000000000..c205bf7da4c --- /dev/null +++ b/langtools/test/tools/javac/tree/MakeLiteralTest.java @@ -0,0 +1,90 @@ + + +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6504896 + * @summary TreeMaker.Literal(Object) does not support Booleans + */ + +import com.sun.tools.javac.code.Type; +import com.sun.tools.javac.code.Symtab; +import com.sun.tools.javac.code.Types; +import com.sun.tools.javac.file.JavacFileManager; +import com.sun.tools.javac.tree.JCTree.JCLiteral; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.tree.TreeMaker; +import static com.sun.tools.javac.code.TypeTags.*; + +public class MakeLiteralTest { + public static void main(String... args) throws Exception { + new MakeLiteralTest().run(); + } + + void run() throws Exception { + Context context = new Context(); + JavacFileManager.preRegister(context); + Symtab syms = Symtab.instance(context); + maker = TreeMaker.instance(context); + types = Types.instance(context); + + test("abc", CLASS, syms.stringType, "abc"); + test(Boolean.FALSE, BOOLEAN, syms.booleanType, Integer.valueOf(0)); + test(Boolean.TRUE, BOOLEAN, syms.booleanType, Integer.valueOf(1)); + test(Byte.valueOf((byte) 1), BYTE, syms.byteType, Byte.valueOf((byte) 1)); + test(Character.valueOf('a'), CHAR, syms.charType, Integer.valueOf('a')); + test(Double.valueOf(1d), DOUBLE, syms.doubleType, Double.valueOf(1d)); + test(Float.valueOf(1f), FLOAT, syms.floatType, Float.valueOf(1f)); + test(Integer.valueOf(1), INT, syms.intType, Integer.valueOf(1)); + test(Long.valueOf(1), LONG, syms.longType, Long.valueOf(1)); + test(Short.valueOf((short) 1), SHORT, syms.shortType, Short.valueOf((short) 1)); + + if (errors > 0) + throw new Exception(errors + " errors found"); + } + + void test(Object value, int tag, Type type, Object constValue) { + JCLiteral l = maker.Literal(value); + if (l.type.tag != tag) + error("unexpected tag: " + l.getTag() + ": expected: " + tag); + if (!types.isSameType(l.type, type)) + error("unexpected type: " + l.type + ": expected: " + type); + if (l.type.constValue().getClass() != constValue.getClass() + || !constValue.equals(l.type.constValue())) { + error("unexpected const value: " + + l.type.constValue().getClass() + " " + l.type.constValue() + + ": expected:" + constValue.getClass() + " " + constValue); + } + } + + void error(String msg) { + System.err.println("Error: " + msg); + errors++; + } + + TreeMaker maker; + Types types; + int errors; +} diff --git a/langtools/test/tools/javac/tree/TreeKindTest.java b/langtools/test/tools/javac/tree/TreeKindTest.java index c726eb7b1cd..608c45a4df7 100644 --- a/langtools/test/tools/javac/tree/TreeKindTest.java +++ b/langtools/test/tools/javac/tree/TreeKindTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/tree/TreePosTest.java b/langtools/test/tools/javac/tree/TreePosTest.java index b83c4c68250..bb6e466b557 100644 --- a/langtools/test/tools/javac/tree/TreePosTest.java +++ b/langtools/test/tools/javac/tree/TreePosTest.java @@ -249,6 +249,13 @@ public class TreePosTest { error("File " + file + " ignored"); } + // See CR: 6982992 Tests CheckAttributedTree.java, JavacTreeScannerTest.java, and SourceTreeeScannerTest.java timeout + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + Reporter r = new Reporter(pw); + JavacTool tool = JavacTool.create(); + StandardJavaFileManager fm = tool.getStandardFileManager(r, null, null); + /** * Read a file. * @param file the file to be read @@ -257,12 +264,8 @@ public class TreePosTest { * @throws TreePosTest.ParseException if any errors occur while parsing the file */ JCCompilationUnit read(File file) throws IOException, ParseException { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - Reporter r = new Reporter(pw); JavacTool tool = JavacTool.create(); - Charset cs = (encoding == null ? null : Charset.forName(encoding)); - StandardJavaFileManager fm = tool.getStandardFileManager(r, null, null); + r.errors = 0; Iterable files = fm.getJavaFileObjects(file); JavacTask task = tool.getTask(pw, fm, r, Collections.emptyList(), null, files); Iterable trees = task.parse(); @@ -357,7 +360,9 @@ public class TreePosTest { check("encl.start <= start", encl, self, encl.start <= self.start); check("start <= pos", encl, self, self.start <= self.pos); if (!(self.tag == JCTree.TYPEARRAY - && (encl.tag == JCTree.VARDEF || encl.tag == JCTree.TYPEARRAY))) { + && (encl.tag == JCTree.VARDEF || + encl.tag == JCTree.METHODDEF || + encl.tag == JCTree.TYPEARRAY))) { check("encl.pos <= start || end <= encl.pos", encl, self, encl.pos <= self.start || self.end <= encl.pos); } diff --git a/langtools/test/tools/javac/typeAnnotations/6967002/T6967002.out b/langtools/test/tools/javac/typeAnnotations/6967002/T6967002.out deleted file mode 100644 index 18b75307f04..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/6967002/T6967002.out +++ /dev/null @@ -1,8 +0,0 @@ -T6967002.java:33:22: compiler.err.expected: ')' -T6967002.java:33:25: compiler.err.illegal.start.of.expr -T6967002.java:33:28: compiler.err.illegal.start.of.expr -T6967002.java:33:29: compiler.err.illegal.start.of.expr -T6967002.java:33:27: compiler.err.not.stmt -T6967002.java:33:30: compiler.err.expected: ';' -T6967002.java:35:2: compiler.err.premature.eof -7 errors diff --git a/langtools/test/tools/javac/typeAnnotations/TypeParameterTarget.java b/langtools/test/tools/javac/typeAnnotations/TypeParameterTarget.java deleted file mode 100644 index e1de7a1f006..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/TypeParameterTarget.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary check that type annotations may appear on all type parameter - * @author Mahmood Ali - * @compile -source 1.7 TypeParameterTarget.java - */ - -import java.lang.annotation.Target; -import java.lang.annotation.ElementType; - -class TypeUseTarget<@A K extends Object> { - String[] field; - - <@A K, @A V> String genericMethod(K k) { return null; } -} - -interface MyInterface { } - -@interface MyAnnotation { } - -@Target(ElementType.TYPE_PARAMETER) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/TypeUseTarget.java b/langtools/test/tools/javac/typeAnnotations/TypeUseTarget.java deleted file mode 100644 index 2b87d99fb75..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/TypeUseTarget.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary check that type annotations may appear on all type declarations - * @author Mahmood Ali - * @compile -source 1.7 TypeUseTarget.java - */ - -import java.lang.annotation.Target; -import java.lang.annotation.ElementType; - -@A -class TypeUseTarget { - @A String @A [] field; - - @A String test(@A String param, @A String @A ... vararg) @A { - @A Object o = new @A String @A [3]; - TypeUseTarget<@A String> target; - return (@A String) null; - } - - @A String genericMethod(K k) { return null; } -} - -@A -interface MyInterface { } - -@A -@interface MyAnnotation { } - -@Target(ElementType.TYPE_USE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/classfile/DeadCode.java b/langtools/test/tools/javac/typeAnnotations/classfile/DeadCode.java deleted file mode 100644 index d7451f425b2..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/classfile/DeadCode.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import java.net.URL; -import java.util.List; - -import com.sun.tools.classfile.*; - -/* - * @test - * @bug 6917130 - * @summary test that optimized away annotations are not emited to classfile - */ - -public class DeadCode { - public static void main(String[] args) throws Exception { - new DeadCode().run(); - } - - public void run() throws Exception { - ClassFile cf = getClassFile("DeadCode$Test.class"); - test(cf); - for (Field f : cf.fields) { - test(cf, f); - } - for (Method m: cf.methods) { - test(cf, m); - } - - countAnnotations(); - - if (errors > 0) - throw new Exception(errors + " errors found"); - System.out.println("PASSED"); - } - - ClassFile getClassFile(String name) throws IOException, ConstantPoolException { - URL url = getClass().getResource(name); - InputStream in = url.openStream(); - try { - return ClassFile.read(in); - } finally { - in.close(); - } - } - - /************ Helper annotations counting methods ******************/ - void test(ClassFile cf) { - test(cf, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Method m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Field m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, String name, boolean visible) { - int index = cf.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = cf.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Method m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Field m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - void countAnnotations() { - int expected_all = expected_visibles + expected_invisibles; - - if (expected_all != all) { - errors++; - System.err.println("expected " + expected_all - + " annotations but found " + all); - } - - if (expected_visibles != visibles) { - errors++; - System.err.println("expected " + expected_visibles - + " visibles annotations but found " + visibles); - } - - if (expected_invisibles != invisibles) { - errors++; - System.err.println("expected " + expected_invisibles - + " invisibles annotations but found " + invisibles); - } - - } - - int errors; - int all; - int visibles; - int invisibles; - - /*********************** Test class *************************/ - static int expected_invisibles = 1; - static int expected_visibles = 0; - static class Test { - @interface A {} - - void test() { - List o = null; - o.toString(); - - @A String m; - if (false) { - @A String a; - @A String b = "m"; - b.toString(); - List c = null; - c.toString(); - } - } - } - -} diff --git a/langtools/test/tools/javac/typeAnnotations/failures/AnnotationVersion.java b/langtools/test/tools/javac/typeAnnotations/failures/AnnotationVersion.java deleted file mode 100644 index d9d74acca60..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/AnnotationVersion.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary test that only java 7 allows type annotations - * @author Mahmood Ali - * @compile/fail/ref=AnnotationVersion.out -XDrawDiagnostics -source 1.6 AnnotationVersion.java - */ -class AnnotationVersion { - public void method() @A { } -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/AnnotationVersion.out b/langtools/test/tools/javac/typeAnnotations/failures/AnnotationVersion.out deleted file mode 100644 index 521a5eb8005..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/AnnotationVersion.out +++ /dev/null @@ -1,2 +0,0 @@ -AnnotationVersion.java:9:25: compiler.err.type.annotations.not.supported.in.source: 1.6 -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/IncompleteArray.java b/langtools/test/tools/javac/typeAnnotations/failures/IncompleteArray.java deleted file mode 100644 index 8edb60807d4..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/IncompleteArray.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary test incomplete array declaration - * @author Mahmood Ali - * @compile/fail/ref=IncompleteArray.out -XDrawDiagnostics -source 1.7 IncompleteArray.java - */ -class IncompleteArray { - int @A [] @A var; -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/IncompleteArray.out b/langtools/test/tools/javac/typeAnnotations/failures/IncompleteArray.out deleted file mode 100644 index a03a09283ee..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/IncompleteArray.out +++ /dev/null @@ -1,2 +0,0 @@ -IncompleteArray.java:9:13: compiler.err.illegal.start.of.type -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/IncompleteVararg.java b/langtools/test/tools/javac/typeAnnotations/failures/IncompleteVararg.java deleted file mode 100644 index b54df921ec4..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/IncompleteVararg.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary test incomplete vararg declaration - * @author Mahmood Ali - * @compile/fail/ref=IncompleteVararg.out -XDrawDiagnostics -source 1.7 IncompleteVararg.java - */ -class IncompleteArray { - // the last variable may be vararg - void method(int @A test) { } -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/IncompleteVararg.out b/langtools/test/tools/javac/typeAnnotations/failures/IncompleteVararg.out deleted file mode 100644 index 7cec6c9ee78..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/IncompleteVararg.out +++ /dev/null @@ -1,2 +0,0 @@ -IncompleteVararg.java:10:19: compiler.err.illegal.start.of.type -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/IndexArray.java b/langtools/test/tools/javac/typeAnnotations/failures/IndexArray.java deleted file mode 100644 index 5cb324d0cdb..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/IndexArray.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary test indexing of an array - * @author Mahmood Ali - * @compile/fail/ref=IndexArray.out -XDrawDiagnostics -source 1.7 IndexArray.java - */ -class IndexArray { - int[] var; - int a = var @A [1]; -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/IndexArray.out b/langtools/test/tools/javac/typeAnnotations/failures/IndexArray.out deleted file mode 100644 index 762f38b15a8..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/IndexArray.out +++ /dev/null @@ -1,2 +0,0 @@ -IndexArray.java:10:15: compiler.err.illegal.start.of.expr -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/LintCast.java b/langtools/test/tools/javac/typeAnnotations/failures/LintCast.java deleted file mode 100644 index 4830de3ebf2..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/LintCast.java +++ /dev/null @@ -1,42 +0,0 @@ -import java.util.List; - -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary test that compiler doesn't warn about annotated redundant casts - * @author Mahmood Ali - * @compile/ref=LintCast.out -Xlint:cast -XDrawDiagnostics -source 1.7 LintCast.java - */ -class LintCast { - void unparameterized() { - String s = "m"; - String s1 = (String)s; - String s2 = (@A String)s; - } - - void parameterized() { - List l = null; - List l1 = (List)l; - List l2 = (List<@A String>)l; - } - - void array() { - int @A [] a = null; - int[] a1 = (int[])a; - int[] a2 = (int @A [])a; - } - - void sameAnnotations() { - @A String annotated = null; - String unannotated = null; - - // compiler ignore annotated casts even if redundant - @A String anno1 = (@A String)annotated; - - // warn if redundant without an annotation - String anno2 = (String)annotated; - String unanno2 = (String)unannotated; - } -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/LintCast.out b/langtools/test/tools/javac/typeAnnotations/failures/LintCast.out deleted file mode 100644 index 67388ab2f4d..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/LintCast.out +++ /dev/null @@ -1,6 +0,0 @@ -LintCast.java:13:21: compiler.warn.redundant.cast: java.lang.String -LintCast.java:19:27: compiler.warn.redundant.cast: java.util.List -LintCast.java:25:20: compiler.warn.redundant.cast: int[] -LintCast.java:37:24: compiler.warn.redundant.cast: java.lang.String -LintCast.java:38:26: compiler.warn.redundant.cast: java.lang.String -5 warnings diff --git a/langtools/test/tools/javac/typeAnnotations/failures/Scopes.java b/langtools/test/tools/javac/typeAnnotations/failures/Scopes.java deleted file mode 100644 index 71eda33a775..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/Scopes.java +++ /dev/null @@ -1,10 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check that A is accessible in the class type parameters - * @author Mahmood Ali - * @compile/fail/ref=Scopes.out -XDrawDiagnostics -source 1.7 Scopes.java - */ -class Scopes { - @interface UniqueInner { }; -} diff --git a/langtools/test/tools/javac/typeAnnotations/failures/Scopes.out b/langtools/test/tools/javac/typeAnnotations/failures/Scopes.out deleted file mode 100644 index 3335f6ecff1..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/Scopes.out +++ /dev/null @@ -1,2 +0,0 @@ -Scopes.java:8:25: compiler.err.cant.resolve: kindname.class, UniqueInner, , -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/StaticFields.java b/langtools/test/tools/javac/typeAnnotations/failures/StaticFields.java deleted file mode 100644 index 8b96bf6c2f1..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/StaticFields.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary static field access isn't a valid location - * @author Mahmood Ali - * @compile/fail/ref=StaticFields.out -XDrawDiagnostics -source 1.7 StaticFields.java - */ -class C { - int f; - int a = @A C.f; -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/StaticFields.out b/langtools/test/tools/javac/typeAnnotations/failures/StaticFields.out deleted file mode 100644 index 3364c661fdb..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/StaticFields.out +++ /dev/null @@ -1,2 +0,0 @@ -StaticFields.java:10:17: compiler.err.illegal.start.of.expr -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/StaticMethods.java b/langtools/test/tools/javac/typeAnnotations/failures/StaticMethods.java deleted file mode 100644 index 045601c97a7..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/StaticMethods.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary static methods don't have receivers - * @author Mahmood Ali - * @compile/fail/ref=StaticMethods.out -XDrawDiagnostics -source 1.7 StaticMethods.java - */ -class StaticMethods { - static void main() @A { } -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/StaticMethods.out b/langtools/test/tools/javac/typeAnnotations/failures/StaticMethods.out deleted file mode 100644 index d3ec9a5538f..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/StaticMethods.out +++ /dev/null @@ -1,2 +0,0 @@ -StaticMethods.java:9:22: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/VoidGenericMethod.java b/langtools/test/tools/javac/typeAnnotations/failures/VoidGenericMethod.java deleted file mode 100644 index b48c33e2e1a..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/VoidGenericMethod.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary test type annotation on void generic methods - * @author Mahmood Ali - * @compile/fail -source 1.7 VoidGenericMethod.java - */ -class VoidGenericMethod { - public @A void method() { } -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java deleted file mode 100644 index 129bf3f8f0e..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 6919944 - * @summary check for duplicate annotation values - * @author Mahmood Ali - * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java - */ -class DuplicateAnnotationValue { - void test() { - Object a = String @A(value = 2, value = 1) [].class; - } -} - -@interface A { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.out deleted file mode 100644 index 16493d988cc..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateAnnotationValue.java:10:37: compiler.err.duplicate.annotation.member.value: value, A -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateTypeAnnotation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateTypeAnnotation.java deleted file mode 100644 index 1b79248293e..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateTypeAnnotation.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for duplicate annotations - * @author Mahmood Ali - * @compile/fail/ref=DuplicateTypeAnnotation.out -XDrawDiagnostics -source 1.7 DuplicateTypeAnnotation.java - */ - -class DuplicateTypeAnnotation { - void test() { - Object a = String @A @A [].class; - } -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateTypeAnnotation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateTypeAnnotation.out deleted file mode 100644 index f9ae0eda9de..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateTypeAnnotation.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateTypeAnnotation.java:11:26: compiler.err.duplicate.annotation -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/InvalidLocation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/InvalidLocation.java deleted file mode 100644 index 1f7477d3945..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/InvalidLocation.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for invalid annotatins given the target - * @author Mahmood Ali - * @compile/fail/ref=InvalidLocation.out -XDrawDiagnostics -source 1.7 InvalidLocation.java - */ - -class InvalidLocation { - void test() { - Object a = String @A [].class; - } -} - -@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/InvalidLocation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/InvalidLocation.out deleted file mode 100644 index 20d6f4835dd..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/InvalidLocation.out +++ /dev/null @@ -1,2 +0,0 @@ -InvalidLocation.java:11:23: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/MissingAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/MissingAnnotationValue.java deleted file mode 100644 index 798df949c41..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/MissingAnnotationValue.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for missing annotation value - * @author Mahmood Ali - * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics -source 1.7 MissingAnnotationValue.java - */ -class MissingAnnotationValue { - void test() { - Object a = String @A [].class; - } -} - -@interface A { int field(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/MissingAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/MissingAnnotationValue.out deleted file mode 100644 index 6b00f8c7904..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/MissingAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -MissingAnnotationValue.java:10:23: compiler.err.annotation.missing.default.value: A, field -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.java deleted file mode 100644 index 9f67df1c3fe..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 6919944 - * @summary check for duplicate annotation values - * @author Mahmood Ali - * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java - */ -class DuplicateAnnotationValue { - void test() { - String @A(value = 2, value = 1) [] s; - } -} - -@interface A { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.out deleted file mode 100644 index 240239e566b..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateAnnotationValue.java:10:26: compiler.err.duplicate.annotation.member.value: value, A -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateTypeAnnotation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateTypeAnnotation.java deleted file mode 100644 index 79cf843d62a..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateTypeAnnotation.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for duplicate annotations - * @author Mahmood Ali - * @compile/fail/ref=DuplicateTypeAnnotation.out -XDrawDiagnostics -source 1.7 DuplicateTypeAnnotation.java - */ - -class DuplicateTypeAnnotation { - void test() { - String @A @A [] s; - } -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateTypeAnnotation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateTypeAnnotation.out deleted file mode 100644 index 5647c04430e..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateTypeAnnotation.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateTypeAnnotation.java:11:15: compiler.err.duplicate.annotation -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/InvalidLocation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/InvalidLocation.java deleted file mode 100644 index 08a88db5e3e..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/InvalidLocation.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for invalid annotatins given the target - * @author Mahmood Ali - * @compile/fail/ref=InvalidLocation.out -XDrawDiagnostics -source 1.7 InvalidLocation.java - */ - -class InvalidLocation { - void test() { - String @A [] s; - } -} - -@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/InvalidLocation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/InvalidLocation.out deleted file mode 100644 index 868ab979837..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/InvalidLocation.out +++ /dev/null @@ -1,2 +0,0 @@ -InvalidLocation.java:11:12: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/MissingAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/MissingAnnotationValue.java deleted file mode 100644 index dc73272adba..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/MissingAnnotationValue.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for missing annotation value - * @author Mahmood Ali - * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics -source 1.7 MissingAnnotationValue.java - */ -class MissingAnnotationValue { - void test() { - String @A [] s; - } -} - -@interface A { int field(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/MissingAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/MissingAnnotationValue.out deleted file mode 100644 index 74a7ef7340b..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/MissingAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -MissingAnnotationValue.java:10:12: compiler.err.annotation.missing.default.value: A, field -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.java deleted file mode 100644 index 62ef4189d4b..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 6919944 - * @summary check for duplicate annotation values for type parameter - * @author Mahmood Ali - * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java - */ -class DuplicateAnnotationValue { - void method() { - class Inner<@A(value = 2, value = 1) K> {} - } -} - -@interface A { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.out deleted file mode 100644 index d717c98c486..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateAnnotationValue.java:10:31: compiler.err.duplicate.annotation.member.value: value, A -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateTypeAnnotation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateTypeAnnotation.java deleted file mode 100644 index 66cb0bd7fd9..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateTypeAnnotation.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for duplicate annotations - * @author Mahmood Ali - * @compile/fail/ref=DuplicateTypeAnnotation.out -XDrawDiagnostics -source 1.7 DuplicateTypeAnnotation.java - */ -class DuplicateTypeAnno { - void innermethod() { - class Inner<@A @A K> { } - } -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateTypeAnnotation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateTypeAnnotation.out deleted file mode 100644 index accba46be32..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateTypeAnnotation.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateTypeAnnotation.java:10:20: compiler.err.duplicate.annotation -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/InvalidLocation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/InvalidLocation.java deleted file mode 100644 index d93fb8dff15..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/InvalidLocation.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for invalid annotatins given the target - * @author Mahmood Ali - * @compile/fail/ref=InvalidLocation.out -XDrawDiagnostics -source 1.7 InvalidLocation.java - */ -class InvalidLocation { - void innermethod() { - class Inner<@A K> {} - } -} - -@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/InvalidLocation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/InvalidLocation.out deleted file mode 100644 index b74ad54ba94..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/InvalidLocation.out +++ /dev/null @@ -1,2 +0,0 @@ -InvalidLocation.java:10:17: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.java deleted file mode 100644 index da47aeaa705..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for missing annotation value - * @author Mahmood Ali - * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics -source 1.7 MissingAnnotationValue.java - */ -class MissingAnnotationValue { - void innermethod() { - class Inner<@A K> { } - } -} - -@interface A { int field(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.out deleted file mode 100644 index 637ff4acc0a..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -MissingAnnotationValue.java:10:17: compiler.err.annotation.missing.default.value: A, field -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.java deleted file mode 100644 index 3574e79d8a1..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 6919944 - * @summary check for duplicate annotation values - * @author Mahmood Ali - * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java - */ -class DuplicateAnnotationValue { - void test() { - String[] a = new String @A(value = 2, value = 1) [5] ; - } -} - -@interface A { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.out deleted file mode 100644 index 1852f279ef1..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateAnnotationValue.java:10:43: compiler.err.duplicate.annotation.member.value: value, A -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateTypeAnnotation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateTypeAnnotation.java deleted file mode 100644 index d8ad961afaa..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateTypeAnnotation.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for duplicate annotations - * @author Mahmood Ali - * @compile/fail/ref=DuplicateTypeAnnotation.out -XDrawDiagnostics -source 1.7 DuplicateTypeAnnotation.java - */ - -class DuplicateTypeAnnotation { - void test() { - String[] a = new String @A @A [5] ; - } -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateTypeAnnotation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateTypeAnnotation.out deleted file mode 100644 index 7b13962b5d0..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateTypeAnnotation.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateTypeAnnotation.java:11:32: compiler.err.duplicate.annotation -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/InvalidLocation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/InvalidLocation.java deleted file mode 100644 index 7071e9a0c24..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/InvalidLocation.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for invalid annotatins given the target - * @author Mahmood Ali - * @compile/fail/ref=InvalidLocation.out -XDrawDiagnostics -source 1.7 InvalidLocation.java - */ - -class InvalidLocation { - void test() { - String[] s = new String @A [5] ; - } -} - -@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/InvalidLocation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/InvalidLocation.out deleted file mode 100644 index 1d98d174319..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/InvalidLocation.out +++ /dev/null @@ -1,2 +0,0 @@ -InvalidLocation.java:11:29: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/MissingAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/MissingAnnotationValue.java deleted file mode 100644 index 3817df58223..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/MissingAnnotationValue.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for missing annotation value - * @author Mahmood Ali - * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics -source 1.7 MissingAnnotationValue.java - */ -class MissingAnnotationValue { - void test() { - String[] a = new String @A [5]; - } -} - -@interface A { int field(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/MissingAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/MissingAnnotationValue.out deleted file mode 100644 index 6865348250b..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/MissingAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -MissingAnnotationValue.java:10:29: compiler.err.annotation.missing.default.value: A, field -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.java deleted file mode 100644 index 83a064c416a..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 6919944 - * @summary check for duplicate annotation values for type parameter - * @author Mahmood Ali - * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java - */ -class DuplicateAnnotationValue { -} - -@interface A { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.out deleted file mode 100644 index 01a2f1603e7..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateAnnotationValue.java:8:56: compiler.err.duplicate.annotation.member.value: value, A -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateTypeAnnotation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateTypeAnnotation.java deleted file mode 100644 index 7fdb5c992da..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateTypeAnnotation.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for duplicate annotations - * @author Mahmood Ali - * @compile/fail/ref=DuplicateTypeAnnotation.out -XDrawDiagnostics -source 1.7 DuplicateTypeAnnotation.java - */ - -class DuplicateTypeAnno { -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateTypeAnnotation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateTypeAnnotation.out deleted file mode 100644 index 3b97ec81f46..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateTypeAnnotation.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateTypeAnnotation.java:9:38: compiler.err.duplicate.annotation -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/InvalidLocation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/InvalidLocation.java deleted file mode 100644 index 30a43321dc2..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/InvalidLocation.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for invalid annotatins given the target - * @author Mahmood Ali - * @compile/fail/ref=InvalidLocation.out -XDrawDiagnostics -source 1.7 InvalidLocation.java - */ - -class InvalidLocation { -} - -@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/InvalidLocation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/InvalidLocation.out deleted file mode 100644 index d474f174346..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/InvalidLocation.out +++ /dev/null @@ -1,2 +0,0 @@ -InvalidLocation.java:9:33: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/MissingAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/MissingAnnotationValue.java deleted file mode 100644 index ac73a70035f..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/MissingAnnotationValue.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for missing annotation value - * @author Mahmood Ali - * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics -source 1.7 MissingAnnotationValue.java - */ -class MissingAnnotationValue { -} - -@interface A { int field(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/MissingAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/MissingAnnotationValue.out deleted file mode 100644 index b6d727e835f..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/MissingAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -MissingAnnotationValue.java:8:40: compiler.err.annotation.missing.default.value: A, field -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.java deleted file mode 100644 index 27844e6eed0..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 6919944 - * @summary check for duplicate annotation values in receiver - * @author Mahmood Ali - * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java - */ -class DuplicateAnnotationValue { - void test() @A(value = 2, value = 1) { } -} - -@interface A { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.out deleted file mode 100644 index c1df363dd2e..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateAnnotationValue.java:9:29: compiler.err.duplicate.annotation.member.value: value, A -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateTypeAnnotation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateTypeAnnotation.java deleted file mode 100644 index 791497cd445..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateTypeAnnotation.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for duplicate annotations in receiver - * @author Mahmood Ali - * @compile/fail/ref=DuplicateTypeAnnotation.out -XDrawDiagnostics -source 1.7 DuplicateTypeAnnotation.java - */ - -class DuplicateTypeAnnotation { - void test() @A @A { } -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateTypeAnnotation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateTypeAnnotation.out deleted file mode 100644 index 565aae06318..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateTypeAnnotation.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateTypeAnnotation.java:10:18: compiler.err.duplicate.annotation -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/InvalidLocation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/InvalidLocation.java deleted file mode 100644 index 8ffd9e244aa..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/InvalidLocation.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for invalid annotatins given the target - * @author Mahmood Ali - * @compile/fail/ref=InvalidLocation.out -XDrawDiagnostics -source 1.7 InvalidLocation.java - */ - -class InvalidLocation { - void test() @A { - } -} - -@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/InvalidLocation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/InvalidLocation.out deleted file mode 100644 index c82f335cfa3..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/InvalidLocation.out +++ /dev/null @@ -1,2 +0,0 @@ -InvalidLocation.java:10:15: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/MissingAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/MissingAnnotationValue.java deleted file mode 100644 index e4b8536ef65..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/MissingAnnotationValue.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for missing annotation value - * @author Mahmood Ali - * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics -source 1.7 MissingAnnotationValue.java - */ -class MissingAnnotationValue { - void test() @A { } -} - -@interface A { int field(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/MissingAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/MissingAnnotationValue.out deleted file mode 100644 index f3f66d2e428..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/MissingAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -MissingAnnotationValue.java:9:15: compiler.err.annotation.missing.default.value: A, field -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/rest/DuplicateAnnotationValue.java deleted file mode 100644 index 70621e74940..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/DuplicateAnnotationValue.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for Duplicate annotation value - * @author Mahmood Ali - * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java - */ -class DuplicateAnnotationValue { - void test() { - new @A String(); - } -} - -@interface A { int field(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/rest/DuplicateAnnotationValue.out deleted file mode 100644 index 0b3be7cc3fd..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/DuplicateAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateAnnotationValue.java:10:9: compiler.err.annotation.missing.default.value: A, field -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/DuplicateTypeAnnotation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/rest/DuplicateTypeAnnotation.java deleted file mode 100644 index ae541996fd4..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/DuplicateTypeAnnotation.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for duplicate annotations - * @author Mahmood Ali - * @compile/fail/ref=DuplicateTypeAnnotation.out -XDrawDiagnostics -source 1.7 DuplicateTypeAnnotation.java - */ - -class DuplicateTypeAnnotation { - void test() { - new @A @A String(); - } -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/DuplicateTypeAnnotation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/rest/DuplicateTypeAnnotation.out deleted file mode 100644 index 13b6046e94c..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/DuplicateTypeAnnotation.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateTypeAnnotation.java:11:12: compiler.err.duplicate.annotation -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/InvalidLocation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/rest/InvalidLocation.java deleted file mode 100644 index 92f38ae479c..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/InvalidLocation.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for invalid annotatins given the target - * @author Mahmood Ali - * @compile/fail/ref=InvalidLocation.out -XDrawDiagnostics -source 1.7 InvalidLocation.java - */ - -class InvalidLocation { - void test() { - new @A String(); - } -} - -@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/InvalidLocation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/rest/InvalidLocation.out deleted file mode 100644 index ad9861c2f6f..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/InvalidLocation.out +++ /dev/null @@ -1,2 +0,0 @@ -InvalidLocation.java:11:9: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/MissingAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/rest/MissingAnnotationValue.java deleted file mode 100644 index 6b64f2d54c8..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/MissingAnnotationValue.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for missing annotation value - * @author Mahmood Ali - * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics -source 1.7 MissingAnnotationValue.java - */ -class MissingAnnotationValue { - void test() { - new @A String(); - } -} - -@interface A { int field(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/MissingAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/rest/MissingAnnotationValue.out deleted file mode 100644 index f83f6dfa58a..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/rest/MissingAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -MissingAnnotationValue.java:10:9: compiler.err.annotation.missing.default.value: A, field -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.java deleted file mode 100644 index e09ee4e2f00..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 6919944 - * @summary check for duplicate annotation values for type parameter - * @author Mahmood Ali - * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java - */ -class DuplicateAnnotationValue { - DuplicateAnnotationValue<@A(value = 2, value = 1) String> l; -} - -@interface A { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.out deleted file mode 100644 index e2ecdfb4829..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateAnnotationValue.java:9:42: compiler.err.duplicate.annotation.member.value: value, A -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateTypeAnnotation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateTypeAnnotation.java deleted file mode 100644 index 3877a001b47..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateTypeAnnotation.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for duplicate annotations - * @author Mahmood Ali - * @compile/fail/ref=DuplicateTypeAnnotation.out -XDrawDiagnostics -source 1.7 DuplicateTypeAnnotation.java - */ - -class DuplicateTypeAnno { - DuplicateTypeAnno<@A @A String> l; -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateTypeAnnotation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateTypeAnnotation.out deleted file mode 100644 index 738591669fe..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateTypeAnnotation.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateTypeAnnotation.java:10:24: compiler.err.duplicate.annotation -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/InvalidLocation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/InvalidLocation.java deleted file mode 100644 index 7affd108e72..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/InvalidLocation.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for invalid annotatins given the target - * @author Mahmood Ali - * @compile/fail/ref=InvalidLocation.out -XDrawDiagnostics -source 1.7 InvalidLocation.java - */ - -class InvalidLocation { - InvalidLocation<@A String> l; -} - -@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/InvalidLocation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/InvalidLocation.out deleted file mode 100644 index 30841b78f0f..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/InvalidLocation.out +++ /dev/null @@ -1,2 +0,0 @@ -InvalidLocation.java:10:19: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.java deleted file mode 100644 index fe078ab98fe..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for missing annotation value - * @author Mahmood Ali - * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics -source 1.7 MissingAnnotationValue.java - */ -class MissingAnnotationValue { - MissingAnnotationValue<@A String> l; -} - -@interface A { int field(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.out deleted file mode 100644 index 749442f45b6..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -MissingAnnotationValue.java:9:26: compiler.err.annotation.missing.default.value: A, field -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.java deleted file mode 100644 index 2f40f713a7c..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 6919944 - * @summary check for duplicate annotation values for type parameter - * @author Mahmood Ali - * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java - */ -class DuplicateAnnotationValue<@A(value = 2, value = 1) K> { -} - -@interface A { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.out deleted file mode 100644 index a9846317257..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateAnnotationValue.java:8:46: compiler.err.duplicate.annotation.member.value: value, A -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateTypeAnnotation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateTypeAnnotation.java deleted file mode 100644 index 1fb65c74f33..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateTypeAnnotation.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for duplicate annotations - * @author Mahmood Ali - * @compile/fail/ref=DuplicateTypeAnnotation.out -XDrawDiagnostics -source 1.7 DuplicateTypeAnnotation.java - */ - -class DuplicateTypeAnno<@A @A K> { -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateTypeAnnotation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateTypeAnnotation.out deleted file mode 100644 index 6e7a1af2bd3..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateTypeAnnotation.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateTypeAnnotation.java:9:28: compiler.err.duplicate.annotation -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/InvalidLocation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/InvalidLocation.java deleted file mode 100644 index c9d00c4f55c..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/InvalidLocation.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for invalid annotatins given the target - * @author Mahmood Ali - * @compile/fail/ref=InvalidLocation.out -XDrawDiagnostics -source 1.7 InvalidLocation.java - */ - -class InvalidLocation<@A K> { -} - -@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/InvalidLocation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/InvalidLocation.out deleted file mode 100644 index 87d42a278c4..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/InvalidLocation.out +++ /dev/null @@ -1,2 +0,0 @@ -InvalidLocation.java:9:23: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.java deleted file mode 100644 index 9d4cbef2e9a..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for missing annotation value - * @author Mahmood Ali - * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics -source 1.7 MissingAnnotationValue.java - */ -class MissingAnnotationValue<@A K> { -} - -@interface A { int field(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.out deleted file mode 100644 index acac021869b..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -MissingAnnotationValue.java:8:30: compiler.err.annotation.missing.default.value: A, field -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.java deleted file mode 100644 index 44321123cb5..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 6919944 - * @summary check for duplicate annotation values for type parameter - * @author Mahmood Ali - * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java - */ -class DuplicateAnnotationValue { - DuplicateAnnotationValue<@A(value = 2, value = 1) ?> l; -} - -@interface A { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.out deleted file mode 100644 index e2ecdfb4829..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateAnnotationValue.java:9:42: compiler.err.duplicate.annotation.member.value: value, A -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateTypeAnnotation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateTypeAnnotation.java deleted file mode 100644 index b6a2e47d87a..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateTypeAnnotation.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for duplicate annotations - * @author Mahmood Ali - * @compile/fail/ref=DuplicateTypeAnnotation.out -XDrawDiagnostics -source 1.7 DuplicateTypeAnnotation.java - */ - -class DuplicateTypeAnno { - DuplicateTypeAnno<@A @A ?> l; -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateTypeAnnotation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateTypeAnnotation.out deleted file mode 100644 index 738591669fe..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateTypeAnnotation.out +++ /dev/null @@ -1,2 +0,0 @@ -DuplicateTypeAnnotation.java:10:24: compiler.err.duplicate.annotation -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/InvalidLocation.java b/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/InvalidLocation.java deleted file mode 100644 index addb1e8dcff..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/InvalidLocation.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for invalid annotatins given the target - * @author Mahmood Ali - * @compile/fail/ref=InvalidLocation.out -XDrawDiagnostics -source 1.7 InvalidLocation.java - */ - -class InvalidLocation { - InvalidLocation<@A ?> l; -} - -@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/InvalidLocation.out b/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/InvalidLocation.out deleted file mode 100644 index 30841b78f0f..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/InvalidLocation.out +++ /dev/null @@ -1,2 +0,0 @@ -InvalidLocation.java:10:19: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.java deleted file mode 100644 index 1178294799f..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary check for missing annotation value - * @author Mahmood Ali - * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics -source 1.7 MissingAnnotationValue.java - */ -class MissingAnnotationValue { - MissingAnnotationValue<@A ?> l; -} - -@interface A { int field(); } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.out deleted file mode 100644 index 749442f45b6..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.out +++ /dev/null @@ -1,2 +0,0 @@ -MissingAnnotationValue.java:9:26: compiler.err.annotation.missing.default.value: A, field -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/target/Constructor.java b/langtools/test/tools/javac/typeAnnotations/failures/target/Constructor.java deleted file mode 100644 index 284a9649a1b..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/target/Constructor.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary test invalid location of TypeUse - * @author Mahmood Ali - * @compile/fail/ref=Constructor.out -XDrawDiagnostics -source 1.7 Constructor.java - */ - -import java.lang.annotation.Target; -import java.lang.annotation.ElementType; - -class Constructor { - @A Constructor() { } -} - -@Target(ElementType.TYPE_USE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/target/Constructor.out b/langtools/test/tools/javac/typeAnnotations/failures/target/Constructor.out deleted file mode 100644 index 5114f23816f..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/target/Constructor.out +++ /dev/null @@ -1,2 +0,0 @@ -Constructor.java:13:3: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/target/IncompleteArray.java b/langtools/test/tools/javac/typeAnnotations/failures/target/IncompleteArray.java deleted file mode 100644 index 8edb60807d4..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/target/IncompleteArray.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary test incomplete array declaration - * @author Mahmood Ali - * @compile/fail/ref=IncompleteArray.out -XDrawDiagnostics -source 1.7 IncompleteArray.java - */ -class IncompleteArray { - int @A [] @A var; -} - -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/target/IncompleteArray.out b/langtools/test/tools/javac/typeAnnotations/failures/target/IncompleteArray.out deleted file mode 100644 index a03a09283ee..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/target/IncompleteArray.out +++ /dev/null @@ -1,2 +0,0 @@ -IncompleteArray.java:9:13: compiler.err.illegal.start.of.type -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/target/NotTypeParameter.java b/langtools/test/tools/javac/typeAnnotations/failures/target/NotTypeParameter.java deleted file mode 100644 index 457a7ef6730..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/target/NotTypeParameter.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary test invalid location of TypeUse - * @author Mahmood Ali - * @compile/fail/ref=NotTypeParameter.out -XDrawDiagnostics -source 1.7 NotTypeParameter.java - */ - -import java.lang.annotation.Target; -import java.lang.annotation.ElementType; - -class VoidMethod<@A K> { - @A void test() { } -} - -@Target(ElementType.TYPE_USE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/target/NotTypeParameter.out b/langtools/test/tools/javac/typeAnnotations/failures/target/NotTypeParameter.out deleted file mode 100644 index 8c6dcaf8b39..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/target/NotTypeParameter.out +++ /dev/null @@ -1,3 +0,0 @@ -NotTypeParameter.java:13:3: compiler.err.annotation.type.not.applicable -NotTypeParameter.java:12:18: compiler.err.annotation.type.not.applicable -2 errors diff --git a/langtools/test/tools/javac/typeAnnotations/failures/target/NotTypeUse.java b/langtools/test/tools/javac/typeAnnotations/failures/target/NotTypeUse.java deleted file mode 100644 index 407c0b218dd..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/target/NotTypeUse.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary test invalid location of TypeUse - * @author Mahmood Ali - * @compile/fail/ref=NotTypeUse.out -XDrawDiagnostics -source 1.7 NotTypeUse.java - */ - -import java.lang.annotation.Target; -import java.lang.annotation.ElementType; - -class VoidMethod { - @A void test() { } -} - -@Target(ElementType.TYPE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/target/NotTypeUse.out b/langtools/test/tools/javac/typeAnnotations/failures/target/NotTypeUse.out deleted file mode 100644 index 9728d3589ec..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/target/NotTypeUse.out +++ /dev/null @@ -1,2 +0,0 @@ -NotTypeUse.java:13:3: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/target/VoidMethod.java b/langtools/test/tools/javac/typeAnnotations/failures/target/VoidMethod.java deleted file mode 100644 index a16bf1917fe..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/target/VoidMethod.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @test /nodynamiccopyright/ - * @bug 6843077 - * @summary test invalid location of TypeUse - * @author Mahmood Ali - * @compile/fail/ref=VoidMethod.out -XDrawDiagnostics -source 1.7 VoidMethod.java - */ - -import java.lang.annotation.Target; -import java.lang.annotation.ElementType; - -class VoidMethod { - @A void test() { } -} - -@Target(ElementType.TYPE_USE) -@interface A { } diff --git a/langtools/test/tools/javac/typeAnnotations/failures/target/VoidMethod.out b/langtools/test/tools/javac/typeAnnotations/failures/target/VoidMethod.out deleted file mode 100644 index b7569540158..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/failures/target/VoidMethod.out +++ /dev/null @@ -1,2 +0,0 @@ -VoidMethod.java:13:3: compiler.err.annotation.type.not.applicable -1 error diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/BasicTest.java b/langtools/test/tools/javac/typeAnnotations/newlocations/BasicTest.java index 24175fa1f0c..a5de45959cb 100644 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/BasicTest.java +++ b/langtools/test/tools/javac/typeAnnotations/newlocations/BasicTest.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ * @bug 6843077 * @summary random tests for new locations * @author Matt Papi - * @compile -source 1.7 BasicTest.java + * @compile/fail/ref=BasicTest.out -XDrawDiagnostics BasicTest.java */ import java.util.*; @@ -38,6 +38,8 @@ import java.io.*; @interface C {} @interface D {} +//308: Test inverted to verify that type annotations can not be parsed yet. + /** * Tests basic JSR 308 parser functionality. We don't really care about what * the parse tree looks like, just that these annotations can be parsed. diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/BasicTest.out b/langtools/test/tools/javac/typeAnnotations/newlocations/BasicTest.out new file mode 100644 index 00000000000..9973f328fbd --- /dev/null +++ b/langtools/test/tools/javac/typeAnnotations/newlocations/BasicTest.out @@ -0,0 +1,66 @@ +BasicTest.java:47:27: compiler.err.illegal.start.of.type +BasicTest.java:47:28: compiler.err.expected: '{' +BasicTest.java:47:36: compiler.err.expected: token.identifier +BasicTest.java:47:38: compiler.err.illegal.start.of.type +BasicTest.java:47:45: compiler.err.expected: token.identifier +BasicTest.java:47:47: compiler.err.expected: ';' +BasicTest.java:47:62: compiler.err.expected: token.identifier +BasicTest.java:47:84: compiler.err.expected: token.identifier +BasicTest.java:52:22: compiler.err.illegal.start.of.expr +BasicTest.java:52:31: compiler.err.expected: ';' +BasicTest.java:52:37: compiler.err.expected: token.identifier +BasicTest.java:53:21: compiler.err.illegal.start.of.expr +BasicTest.java:53:23: compiler.err.expected: ';' +BasicTest.java:53:30: compiler.err.expected: token.identifier +BasicTest.java:53:32: compiler.err.illegal.start.of.type +BasicTest.java:53:37: compiler.err.expected: token.identifier +BasicTest.java:53:38: compiler.err.expected: ';' +BasicTest.java:56:17: compiler.err.expected: token.identifier +BasicTest.java:56:23: compiler.err.expected: token.identifier +BasicTest.java:56:24: compiler.err.expected2: '(', '[' +BasicTest.java:56:25: compiler.err.expected: ';' +BasicTest.java:56:27: compiler.err.invalid.meth.decl.ret.type.req +BasicTest.java:56:34: compiler.err.illegal.start.of.type +BasicTest.java:58:34: compiler.err.illegal.start.of.type +BasicTest.java:61:16: compiler.err.illegal.start.of.type +BasicTest.java:61:18: compiler.err.expected: ';' +BasicTest.java:61:24: compiler.err.illegal.start.of.type +BasicTest.java:61:26: compiler.err.expected: ';' +BasicTest.java:61:33: compiler.err.expected: token.identifier +BasicTest.java:61:34: compiler.err.illegal.start.of.type +BasicTest.java:61:35: compiler.err.expected: token.identifier +BasicTest.java:61:37: compiler.err.expected: ';' +BasicTest.java:61:45: compiler.err.expected: token.identifier +BasicTest.java:61:50: compiler.err.expected: token.identifier +BasicTest.java:62:16: compiler.err.expected: token.identifier +BasicTest.java:62:17: compiler.err.expected2: '(', '[' +BasicTest.java:62:18: compiler.err.expected: ';' +BasicTest.java:62:28: compiler.err.illegal.start.of.type +BasicTest.java:62:30: compiler.err.expected: ';' +BasicTest.java:62:36: compiler.err.illegal.start.of.type +BasicTest.java:62:38: compiler.err.expected: ';' +BasicTest.java:62:45: compiler.err.expected: token.identifier +BasicTest.java:62:46: compiler.err.illegal.start.of.type +BasicTest.java:62:47: compiler.err.expected: token.identifier +BasicTest.java:62:49: compiler.err.expected: ';' +BasicTest.java:62:57: compiler.err.expected: token.identifier +BasicTest.java:62:58: compiler.err.illegal.start.of.type +BasicTest.java:62:59: compiler.err.expected: token.identifier +BasicTest.java:64:25: compiler.err.illegal.start.of.type +BasicTest.java:64:27: compiler.err.expected: ';' +BasicTest.java:64:34: compiler.err.expected: token.identifier +BasicTest.java:64:38: compiler.err.expected: token.identifier +BasicTest.java:64:41: compiler.err.illegal.start.of.expr +BasicTest.java:64:50: compiler.err.expected: ';' +BasicTest.java:64:56: compiler.err.expected: token.identifier +BasicTest.java:69:17: compiler.err.expected: ';' +BasicTest.java:69:24: compiler.err.illegal.start.of.type +BasicTest.java:69:30: compiler.err.expected: ';' +BasicTest.java:69:59: compiler.err.expected: token.identifier +BasicTest.java:69:74: compiler.err.expected: ';' +BasicTest.java:74:22: compiler.err.expected: token.identifier +BasicTest.java:74:24: compiler.err.expected: ';' +BasicTest.java:74:25: compiler.err.illegal.start.of.type +BasicTest.java:74:33: compiler.err.expected: ';' +BasicTest.java:77:2: compiler.err.premature.eof +65 errors diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/ClassExtends.java b/langtools/test/tools/javac/typeAnnotations/newlocations/ClassExtends.java deleted file mode 100644 index 3f029ee9602..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/ClassExtends.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: class extends/implements - * @author Mahmood Ali - * @compile -source 1.7 ClassExtends.java - */ -abstract class MyClass extends @A ParameterizedClass<@B String> - implements @B CharSequence, @A ParameterizedInterface<@B String> { } - -interface MyInterface extends @A ParameterizedInterface<@A String>, - @B CharSequence { } - -class ParameterizedClass {} -interface ParameterizedInterface {} -@interface A {} -@interface B {} diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/ClassLiterals.java b/langtools/test/tools/javac/typeAnnotations/newlocations/ClassLiterals.java deleted file mode 100644 index 3558a0166ca..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/ClassLiterals.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: class literals - * @author Mahmood Ali - * @compile -source 1.7 ClassLiterals.java - */ - -class ClassLiterals { - - public static void main(String[] args) { - if (String.class != @A String.class) throw new Error(); - if (@A int.class != int.class) throw new Error(); - if (@A int.class != Integer.TYPE) throw new Error(); - if (@A int @B(0) [].class != int[].class) throw new Error(); - - if (String[].class != @A String[].class) throw new Error(); - if (String[].class != String @A [].class) throw new Error(); - if (@A int[].class != int[].class) throw new Error(); - if (@A int @B(0) [].class != int[].class) throw new Error(); - } -} - -@interface A {} -@interface B { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/ClassParameters.java b/langtools/test/tools/javac/typeAnnotations/newlocations/ClassParameters.java deleted file mode 100644 index 729a1533555..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/ClassParameters.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: class type parameter bounds - * @author Mahmood Ali - * @compile -source 1.7 ClassParameters.java - */ -class Unannotated { } - -class ExtendsBound { } -class ExtendsGeneric> { } -class TwoBounds { } - -class Complex1 { } -class Complex2 { } -class ComplexBoth { } - -class Outer { - void inner() { - class Unannotated { } - - class ExtendsBound { } - class ExtendsGeneric> { } - class TwoBounds { } - - class Complex1 { } - class Complex2 { } - class ComplexBoth { } - } -} - -@interface A { } -@interface B { } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/ConstructorTypeArgs.java b/langtools/test/tools/javac/typeAnnotations/newlocations/ConstructorTypeArgs.java deleted file mode 100644 index 9191b00be8b..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/ConstructorTypeArgs.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: constructor type args - * @author Mahmood Ali - * @compile -source 1.7 ConstructorTypeArgs.java - */ - -class ConstructorTypeArgs { - void oneArg() { - new @A MyList<@A String>(); - new MyList<@A MyList<@B(0) String>>(); - } - - void twoArg() { - new MyMap(); - new MyMap<@A String, @B(0) MyList<@A String>>(); - } - - void withArraysIn() { - new MyList(); - new MyList<@A String @B(0) [] @A []>(); - - new MyMap<@A String[], @B(0) MyList<@A String> @A []>(); - } -} - -class MyList { } -class MyMap { } - -@interface A { } -@interface B { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/Expressions.java b/langtools/test/tools/javac/typeAnnotations/newlocations/Expressions.java deleted file mode 100644 index 012e65c2110..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/Expressions.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: expressions - * @author Mahmood Ali - * @compile -source 1.7 Expressions.java - */ -class Expressions { - void instanceOf() { - Object o = null; - boolean a = o instanceof @A String; - boolean b = o instanceof @B(0) String; - } - - void instanceOfArray() { - Object o = null; - boolean a1 = o instanceof @A String []; - boolean a2 = o instanceof @B(0) String []; - - boolean b1 = o instanceof String @A []; - boolean b2 = o instanceof String @B(0) []; - } - - void objectCreation() { - new @A String(); - new @B(0) String(); - } - - void objectCreationArray() { - Object a1 = new @A String [] [] { }; - Object a2 = new @A String [1] []; - Object a3 = new @A String [1] [2]; - - Object b1 = new @A String @B(0) [] [] { }; - Object b2 = new @A String @B(0) [1] []; - Object b3 = new @A String @B(0) [1] [2]; - - Object c1 = new @A String [] @B(0) [] { }; - Object c2 = new @A String [1] @B(0) []; - Object c3 = new @A String [1] @B(0) [2]; - - Object d1 = new @A String @B(0) [] @B(0) [] { }; - Object d2 = new @A String @B(0) [1] @B(0) []; - Object d3 = new @A String @B(0) [1] @B(0) [2]; - - Object rand = new @A String @B(value = 0) [1] @B(value = 0) [2]; - - } -} - -@interface A { } -@interface B { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/Fields.java b/langtools/test/tools/javac/typeAnnotations/newlocations/Fields.java deleted file mode 100644 index d5d39c71b0f..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/Fields.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: field type array/generics - * @author Mahmood Ali - * @compile -source 1.7 Fields.java - */ - -class DefaultScope { - Parameterized unannotated; - Parameterized<@A String, String> firstTypeArg; - Parameterized secondTypeArg; - Parameterized<@A String, @B String> bothTypeArgs; - - Parameterized<@A Parameterized<@A String, @B String>, @B String> - nestedParameterized; - - @A String [] array1; - @A String @B [] array1Deep; - @A String [] [] array2; - @A String @A [] @B [] array2Deep; - String @A [] [] array2First; - String [] @B [] array2Second; -} - -class ModifiedScoped { - public final Parameterized unannotated = null; - public final Parameterized<@A String, String> firstTypeArg = null; - public final Parameterized secondTypeArg = null; - public final Parameterized<@A String, @B String> bothTypeArgs = null; - - public final Parameterized<@A Parameterized<@A String, @B String>, @B String> - nestedParameterized = null; - - public final @A String [] array1 = null; - public final @A String @B [] array1Deep = null; - public final @A String [] [] array2 = null; - public final @A String @A [] @B [] array2Deep = null; - public final String @A [] [] array2First = null; - public final String [] @B [] array2Second = null; -} - -class Parameterized { } - -@interface A { } -@interface B { } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/LocalVariables.java b/langtools/test/tools/javac/typeAnnotations/newlocations/LocalVariables.java deleted file mode 100644 index 2676bd0ec08..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/LocalVariables.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: local variables array/generics - * @author Mahmood Ali - * @compile -source 1.7 LocalVariables.java - */ - -class DefaultScope { - void parameterized() { - Parameterized unannotated; - Parameterized<@A String, String> firstTypeArg; - Parameterized secondTypeArg; - Parameterized<@A String, @B String> bothTypeArgs; - - Parameterized<@A Parameterized<@A String, @B String>, @B String> - nestedParameterized; - } - - void arrays() { - @A String [] array1; - @A String @B [] array1Deep; - @A String [] [] array2; - @A String @A [] @B [] array2Deep; - String @A [] [] array2First; - String [] @B [] array2Second; - } -} - -class ModifiedVars { - void parameterized() { - final Parameterized unannotated = null; - final Parameterized<@A String, String> firstTypeArg = null; - final Parameterized secondTypeArg = null; - final Parameterized<@A String, @B String> bothTypeArgs = null; - - final Parameterized<@A Parameterized<@A String, @B String>, @B String> - nestedParameterized = null; - } - - void arrays() { - final @A String [] array1 = null; - final @A String @B [] array1Deep = null; - final @A String [] [] array2 = null; - final @A String @A [] @B [] array2Deep = null; - final String @A [] [] array2First = null; - final String [] @B [] array2Second = null; - } -} - -class Parameterized { } - -@interface A { } -@interface B { } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/MethodReturnType.java b/langtools/test/tools/javac/typeAnnotations/newlocations/MethodReturnType.java deleted file mode 100644 index ee35f875792..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/MethodReturnType.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: method return type array/generics - * @author Mahmood Ali - * @compile -source 1.7 MethodReturnType.java - */ - -class DefaultScope { - Parameterized unannotated() { return null; } - Parameterized<@A String, String> firstTypeArg() { return null; } - Parameterized secondTypeArg() { return null; } - Parameterized<@A String, @B String> bothTypeArgs() { return null; } - - Parameterized<@A Parameterized<@A String, @B String>, @B String> - nestedParameterized() { return null; } - - public @A String method() { return null; } - - @A String [] array1() { return null; } - @A String @B [] array1Deep() { return null; } - @A String [] [] array2() { return null; } - @A String @A [] @B [] array2Deep() { return null; } - String @A [] [] array2First() { return null; } - String [] @B [] array2Second() { return null; } -} - -class ModifiedScoped { - public final Parameterized unannotated() { return null; } - public final Parameterized<@A String, String> firstTypeArg() { return null; } - public final Parameterized secondTypeArg() { return null; } - public final Parameterized<@A String, @B String> bothTypeArgs() { return null; } - - public final Parameterized<@A Parameterized<@A String, @B String>, @B String> - nestedParameterized() { return null; } - - public final @A String [] array1() { return null; } - public final @A String @B [] array1Deep() { return null; } - public final @A String [] [] array2() { return null; } - public final @A String @A [] @B [] array2Deep() { return null; } - public final String @A [] [] array2First() { return null; } - public final String [] @B [] array2Second() { return null; } -} - -class Parameterized { } - -@interface A { } -@interface B { } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/MethodTypeArgs.java b/langtools/test/tools/javac/typeAnnotations/newlocations/MethodTypeArgs.java deleted file mode 100644 index f901dc13466..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/MethodTypeArgs.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: method type args - * @author Mahmood Ali - * @compile -source 1.7 MethodTypeArgs.java - */ - -class MethodTypeArgs { - void oneArg() { - this.<@A String>newList(); - this.<@A MyList<@B(0) String>>newList(); - - MethodTypeArgs.<@A String>newList(); - MethodTypeArgs.<@A MyList<@B(0) String>>newList(); - } - - void twoArg() { - this.newMap(); - this.<@A String, @B(0) MyList<@A String>>newMap(); - - MethodTypeArgs.newMap(); - MethodTypeArgs.<@A String, @B(0) MyList<@A String>>newMap(); - } - - void withArraysIn() { - this.newList(); - this.<@A String @B(0) [] @A []>newList(); - - this.<@A String[], @B(0) MyList<@A String> @A []>newMap(); - } - - static void newList() { } - static void newMap() { } -} - -class MyList { } -@interface A { } -@interface B { int value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/MethodTypeParameters.java b/langtools/test/tools/javac/typeAnnotations/newlocations/MethodTypeParameters.java deleted file mode 100644 index 48f52496213..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/MethodTypeParameters.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: method type parameter bounds - * @author Mahmood Ali - * @compile -source 1.7 MethodTypeParameters.java - */ - -class UnscopedUnmodified { - void methodExtends() {} - > void nestedExtends() {} - > void dual() {} - > void dualOneAnno() {} -} - -class PublicModifiedMethods { - public final void methodExtends() {} - public final > void nestedExtends() {} - public final > void dual() {} - public final > void dualOneAnno() {} -} - -class Parameterized { } -@interface A { } -@interface B { } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/Parameters.java b/langtools/test/tools/javac/typeAnnotations/newlocations/Parameters.java deleted file mode 100644 index feda414b75d..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/Parameters.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: parameter type array/generics - * @author Mahmood Ali - * @compile -source 1.7 Parameters.java - */ - -class Parameters { - void unannotated(Parameterized a) {} - void firstTypeArg(Parameterized<@A String, String> a) {} - void secondTypeArg(Parameterized a) {} - void bothTypeArgs(Parameterized<@A String, @B String> both) {} - - void nestedParameterized(Parameterized<@A Parameterized<@A String, @B String>, @B String> a) {} - - void array1(@A String [] a) {} - void array1Deep(@A String @B [] a) {} - void array2(@A String [] [] a) {} - void array2Deep(@A String @A [] @B [] a) {} - void array2First(String @A [] [] a) {} - void array2Second(String [] @B [] a) {} -} - -class Parameterized { } - -@interface A { } -@interface B { } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/Receivers.java b/langtools/test/tools/javac/typeAnnotations/newlocations/Receivers.java deleted file mode 100644 index 700f946d5b1..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/Receivers.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: receivers - * @author Mahmood Ali - * @compile -source 1.7 Receivers.java - */ -class DefaultUnmodified { - void plain() @A { } - void generic() @A { } - void withException() @A throws Exception { } - String nonVoid() @A { return null; } - void accept(T r) @A throws Exception { } -} - -class PublicModified { - public final void plain() @A { } - public final void generic() @A { } - public final void withException() @A throws Exception { } - public final String nonVoid() @A { return null; } - public final void accept(T r) @A throws Exception { } -} - -class WithValue { - void plain() @B("m") { } - void generic() @B("m") { } - void withException() @B("m") throws Exception { } - String nonVoid() @B("m") { return null; } - void accept(T r) @B("m") throws Exception { } -} - -@interface A {} -@interface B { String value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/Throws.java b/langtools/test/tools/javac/typeAnnotations/newlocations/Throws.java deleted file mode 100644 index 2477d913c2f..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/Throws.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: throw clauses - * @author Mahmood Ali - * @compile -source 1.7 Throws.java - */ -class DefaultUnmodified { - void oneException() throws @A Exception {} - void twoExceptions() throws @A RuntimeException, @A Exception {} -} - -class PublicModified { - public final void oneException(String a) throws @A Exception {} - public final void twoExceptions(String a) throws @A RuntimeException, @A Exception {} -} - -class WithValue { - void oneException() throws @B("m") Exception {} - void twoExceptions() throws @B(value="m") RuntimeException, @A Exception {} -} - -@interface A {} -@interface B { String value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/TypeCasts.java b/langtools/test/tools/javac/typeAnnotations/newlocations/TypeCasts.java deleted file mode 100644 index aef203e01e8..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/TypeCasts.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: type casts - * @author Mahmood Ali - * @compile -source 1.7 TypeCasts.java - */ -class TypeCasts { - void methodA() { - String s = (@A String) null; - Object o = (@A Class<@A String>) null; - } - - void methodB() { - String s = (@B("m") String) null; - Object o = (@B("m") Class<@B("m") String>) null; - } -} - -@interface A { } -@interface B { String value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/TypeParameters.java b/langtools/test/tools/javac/typeAnnotations/newlocations/TypeParameters.java deleted file mode 100644 index 8faf3fb0e5b..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/TypeParameters.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: class and method type parameters - * @author Mahmood Ali - * @compile -source 1.7 TypeParameters.java - */ - -class Unannotated { } -class OneAnnotated<@A K> { } -class TwoAnnotated<@A K, @A V> { } -class SecondAnnotated { } - -class TestMethods { - void unannotated() { } - <@A K> void oneAnnotated() { } - <@A K, @B("m") V> void twoAnnotated() { } - void secondAnnotated() { } -} - -class UnannotatedB { } -class OneAnnotatedB<@B("m") K> { } -class TwoAnnotatedB<@B("m") K, @B("m") V> { } -class SecondAnnotatedB { } - -@interface A { } -@interface B { String value(); } diff --git a/langtools/test/tools/javac/typeAnnotations/newlocations/Wildcards.java b/langtools/test/tools/javac/typeAnnotations/newlocations/Wildcards.java deleted file mode 100644 index 1efad06ac0e..00000000000 --- a/langtools/test/tools/javac/typeAnnotations/newlocations/Wildcards.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6843077 - * @summary new type annotation location: wildcard bound - * @author Mahmood Ali - * @compile -source 1.7 Wildcards.java - */ -class BoundTest { - void wcExtends(MyList l) { } - void wcSuper(MyList l) { } - - MyList returnWcExtends() { return null; } - MyList returnWcSuper() { return null; } - MyList> complex() { return null; } -} - -class BoundWithValue { - void wcExtends(MyList l) { } - void wcSuper(MyList l) { } - - MyList returnWcExtends() { return null; } - MyList returnWcSuper() { return null; } - MyList> complex() { return null; } -} - -class SelfTest { - void wcExtends(MyList<@A ?> l) { } - void wcSuper(MyList<@A ?> l) { } - - MyList<@A ?> returnWcExtends() { return null; } - MyList<@A ?> returnWcSuper() { return null; } - MyList<@A ? extends @A MyList<@B("m") ?>> complex() { return null; } -} - -class SelfWithValue { - void wcExtends(MyList<@B("m") ?> l) { } - void wcSuper(MyList<@B(value="m") ?> l) { } - - MyList<@B("m") ?> returnWcExtends() { return null; } - MyList<@B(value="m") ?> returnWcSuper() { return null; } - MyList<@B("m") ? extends MyList<@B("m") ? super String>> complex() { return null; } -} - -class MyList { } - -@interface A { } -@interface B { String value(); } diff --git a/langtools/test/tools/javac/types/BoxingConversionTest.java b/langtools/test/tools/javac/types/BoxingConversionTest.java new file mode 100644 index 00000000000..0ca0ca6053a --- /dev/null +++ b/langtools/test/tools/javac/types/BoxingConversionTest.java @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7006109 + * @summary Add test library to simplify the task of writing automated type-system tests + * @author mcimadamore + * @library . + * @run main BoxingConversionTest + */ + +import com.sun.tools.javac.code.Type; +import com.sun.tools.javac.code.Type.*; +import com.sun.tools.javac.code.Symbol.*; +import java.lang.reflect.Array; +import java.util.EnumSet; + +/** + * Check invariants in assignment/method conversion involving boxing conversions + */ +public class BoxingConversionTest extends TypeHarness { + + Type[] types1; + Type[] types2; + Type[] types3; + + enum Result { + OK_BOTH(true), + FAIL_BOTH(false), + OK_ASSIGN_ONLY(true); + + boolean value; + + Result(boolean value) { + this.value = value; + } + } + + enum ConversionKind { + ASSIGNMENT_CONVERSION(EnumSet.of(Result.OK_BOTH, Result.OK_ASSIGN_ONLY)) { + @Override + void check(TypeHarness harness, Type from, Type to, Result expected) { + harness.assertAssignable(from, to, resSet.contains(expected)); + } + }, + METHOD_CONVERSION(EnumSet.of(Result.OK_BOTH)) { + @Override + void check(TypeHarness harness, Type from, Type to, Result expected) { + harness.assertConvertible(from, to, resSet.contains(expected)); + } + }; + + EnumSet resSet; + + private ConversionKind(EnumSet resSet) { + this.resSet = resSet; + } + + abstract void check(TypeHarness harness, Type from, Type to, Result expected); + } + + enum TestKind { + SIMPLE { + @Override + Type[] getFromTypes(BoxingConversionTest harness) { + return harness.types1; + } + @Override + Type[] getToTypes(BoxingConversionTest harness) { + return harness.types1; + } + @Override + Result[][] getResults(BoxingConversionTest harness) { + return harness.results1; + } + }, + CONSTANT_TYPES { + @Override + Type[] getFromTypes(BoxingConversionTest harness) { + return harness.types2; + } + @Override + Type[] getToTypes(BoxingConversionTest harness) { + return harness.types3; + } + @Override + Result[][] getResults(BoxingConversionTest harness) { + return harness.results2; + } + }; + + abstract Type[] getFromTypes(BoxingConversionTest harness); + abstract Type[] getToTypes(BoxingConversionTest harness); + abstract Result[][] getResults(BoxingConversionTest harness); + } + + static final Result T = Result.OK_BOTH; + static final Result F = Result.FAIL_BOTH; + static final Result A = Result.OK_ASSIGN_ONLY; + static final Result X = Result.FAIL_BOTH.FAIL_BOTH; + + Result[][] results1 = { + //byte, short, int, long, float, double, char, bool, Byte, Short, Integer, Long, Float, Double, Character, Boolean + /*byte*/ { T , T , T , T , T , T , F , F , T , F , F , F , F , F , F , F }, + /*short*/ { F , T , T , T , T , T , F , F , F , T , F , F , F , F , F , F }, + /*int*/ { F , F , T , T , T , T , F , F , F , F , T , F , F , F , F , F }, + /*long*/ { F , F , F , T , T , T , F , F , F , F , F , T , F , F , F , F }, + /*float*/ { F , F , F , F , T , T , F , F , F , F , F , F , T , F , F , F }, + /*double*/ { F , F , F , F , F , T , F , F , F , F , F , F , F , T , F , F }, + /*char*/ { F , F , T , T , T , T , T , F , F , F , F , F , F , F , T , F }, + /*bool*/ { F , F , F , F , F , F , F , T , F , F , F , F , F , F , F , T }, + /*Byte*/ { T , T , T , T , T , T , F , F , T , F , F , F , F , F , F , F }, + /*Short*/ { F , T , T , T , T , T , F , F , F , T , F , F , F , F , F , F }, + /*Integer*/ { F , F , T , T , T , T , F , F , F , F , T , F , F , F , F , F }, + /*Long*/ { F , F , F , T , T , T , F , F , F , F , F , T , F , F , F , F }, + /*Float*/ { F , F , F , F , T , T , F , F , F , F , F , F , T , F , F , F }, + /*Double*/ { F , F , F , F , F , T , F , F , F , F , F , F , F , T , F , F }, + /*Character*/ { F , F , T , T , T , T , T , F , F , F , F , F , F , F , T , F }, + /*Boolean*/ { F , F , F , F , F , F , F , T , F , F , F , F , F , F , F , T }}; + + Result[][] results2 = { + //Byte, Short, Integer, Long, Float, Double, Chararacter, Boolean + /*byte*/ { T , F , F , F , F , F , F , F }, + /*short*/ { F , T , F , F , F , F , F , F }, + /*short1*/ { A , T , F , F , F , F , A , F }, + /*short2*/ { F , T , F , F , F , F , A , F }, + /*int*/ { F , F , T , F , F , F , F , F }, + /*int1*/ { A , A , T , F , F , F , A , F }, + /*int2*/ { F , A , T , F , F , F , A , F }, + /*int4*/ { F , F , T , F , F , F , F , F }, + /*long*/ { F , F , F , T , F , F , F , F }, + /*long1*/ { F , F , F , T , F , F , F , F }, + /*long2*/ { F , F , F , T , F , F , F , F }, + /*long4*/ { F , F , F , T , F , F , F , F }, + /*long8*/ { F , F , F , T , F , F , F , F }, + /*float*/ { F , F , F , F , T , F , F , F }, + /*float1*/ { F , F , F , F , T , F , F , F }, + /*float2*/ { F , F , F , F , T , F , F , F }, + /*float4*/ { F , F , F , F , T , F , F , F }, + /*double*/ { F , F , F , F , F , T , F , F }, + /*double1*/ { F , F , F , F , F , T , F , F }, + /*double2*/ { F , F , F , F , F , T , F , F }, + /*double4*/ { F , F , F , F , F , T , F , F }, + /*double8*/ { F , F , F , F , F , T , F , F }, + /*char*/ { F , F , F , F , F , F , T , F }, + /*char1*/ { A , A , F , F , F , F , T , F }, + /*char2*/ { F , A , F , F , F , F , T , F }, + /*bool*/ { F , F , F , F , F , F , F , T }}; + + BoxingConversionTest() { + Type[] primitiveTypes = new Type[] { + predef.byteType, + predef.shortType, + predef.intType, + predef.longType, + predef.floatType, + predef.doubleType, + predef.charType, + predef.booleanType }; + + Type[] boxedTypes = new Type[primitiveTypes.length]; + for (int i = 0 ; i < primitiveTypes.length ; i++) { + boxedTypes[i] = box(primitiveTypes[i]); + } + + types1 = join(Type.class, primitiveTypes, boxedTypes); + + types2 = new Type[] { + predef.byteType, + predef.shortType, + fac.Constant((short)0x0001), + fac.Constant((short)0x0100), + predef.intType, + fac.Constant((int)0x0000_0001), + fac.Constant((int)0x0000_0100), + fac.Constant((int)0x0001_0000), + predef.longType, + fac.Constant((long)0x0000_0000_0000_0001L), + fac.Constant((long)0x0000_0000_0000_0100L), + fac.Constant((long)0x0000_0000_0001_0000L), + fac.Constant((long)0x0001_0000_0000_0000L), + predef.floatType, + fac.Constant((float)0x0000_0001), + fac.Constant((float)0x0000_0100), + fac.Constant((float)0x0001_0000), + predef.doubleType, + fac.Constant((double)0x0000_0000_0000_0001L), + fac.Constant((double)0x0000_0000_0000_0100L), + fac.Constant((double)0x0000_0000_0001_0000L), + fac.Constant((double)0x0001_0000_0000_0000L), + predef.charType, + fac.Constant((char)0x0001), + fac.Constant((char)0x0100), + predef.booleanType + }; + + types3 = boxedTypes; + } + + void testConversion(ConversionKind convKind, TestKind testKind) { + Type[] rows = testKind.getFromTypes(this); + Type[] cols = testKind.getToTypes(this); + for (int i = 0; i < rows.length ; i++) { + for (int j = 0; j < cols.length ; j++) { + convKind.check(this, rows[i], cols[j], testKind.getResults(this)[i][j]); + } + } + } + + @SuppressWarnings("unchecked") + T[] join(Class type, T[]... args) { + int totalLength = 0; + for (T[] arr : args) { + totalLength += arr.length; + } + T[] new_arr = (T[])Array.newInstance(type, totalLength); + int idx = 0; + for (T[] arr : args) { + System.arraycopy(arr, 0, new_arr, idx, arr.length); + idx += arr.length; + } + return new_arr; + } + + public static void main(String[] args) { + BoxingConversionTest harness = new BoxingConversionTest(); + for (ConversionKind convKind : ConversionKind.values()) { + for (TestKind testKind : TestKind.values()) { + harness.testConversion(convKind, testKind); + } + } + } +} diff --git a/langtools/test/tools/javac/types/CastTest.java b/langtools/test/tools/javac/types/CastTest.java new file mode 100644 index 00000000000..78addb06770 --- /dev/null +++ b/langtools/test/tools/javac/types/CastTest.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7006109 + * @summary Add test library to simplify the task of writing automated type-system tests + * @author mcimadamore + * @library . + * @run main CastTest + */ + +import com.sun.tools.javac.code.Type; +import com.sun.tools.javac.code.Type.*; +import com.sun.tools.javac.code.Symbol.*; +import java.lang.reflect.Array; + +import static com.sun.tools.javac.code.Flags.*; + +/** + * Check invariants in cast conversion involving primitive types and arrays + */ +public class CastTest extends TypeHarness { + + Type[] allTypes; + + static final boolean T = true; + static final boolean F = false; + + boolean[][] cast_result = { + //byte, short, int, long, float, double, char, bool, C, +C, I, T, byte[], short[], int[], long[], float[], double[], char[], bool[], C[], +C[], I[], T[] + /*byte*/ { T , T , T , T , T , T , T , F , F, F , F, F, F , F , F , F , F , F , F , F , F , F , F , F }, + /*short*/ { T , T , T , T , T , T , T , F , F, F , F, F, F , F , F , F , F , F , F , F , F , F , F , F }, + /*int*/ { T , T , T , T , T , T , T , F , F, F , F, F, F , F , F , F , F , F , F , F , F , F , F , F }, + /*long*/ { T , T , T , T , T , T , T , F , F, F , F, F, F , F , F , F , F , F , F , F , F , F , F , F }, + /*float*/ { T , T , T , T , T , T , T , F , F, F , F, F, F , F , F , F , F , F , F , F , F , F , F , F }, + /*double*/ { T , T , T , T , T , T , T , F , F, F , F, F, F , F , F , F , F , F , F , F , F , F , F , F }, + /*char*/ { T , T , T , T , T , T , T , F , F, F , F, F, F , F , F , F , F , F , F , F , F , F , F , F }, + /*bool*/ { F , F , F , F , F , F , F , T , F, F , F, F, F , F , F , F , F , F , F , F , F , F , F , F }, + /*C*/ { F , F , F , F , F , F , F , F , T, F , T, T, F , F , F , F , F , F , F , F , F , F , F , F }, + /*+C*/ { F , F , F , F , F , F , F , F , F, T , F, T, F , F , F , F , F , F , F , F , F , F , F , F }, + /*I*/ { F , F , F , F , F , F , F , F , T, F , T, T, F , F , F , F , F , F , F , F , F , F , F , F }, + /*T*/ { F , F , F , F , F , F , F , F , T, T , T, T, T , T , T , T , T , T , T , T , T , T , T , T }, + /*byte[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, T , F , F , F , F , F , F , F , F , F , F , F }, + /*short[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, F , T , F , F , F , F , F , F , F , F , F , F }, + /*int[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, F , F , T , F , F , F , F , F , F , F , F , F }, + /*long[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, F , F , F , T , F , F , F , F , F , F , F , F }, + /*float[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, F , F , F , F , T , F , F , F , F , F , F , F }, + /*double[]*/{ F , F , F , F , F , F , F , F , F, F , F, T, F , F , F , F , F , T , F , F , F , F , F , F }, + /*char[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, F , F , F , F , F , F , T , F , F , F , F , F }, + /*bool[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, F , F , F , F , F , F , F , T , F , F , F , F }, + /*C[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, F , F , F , F , F , F , F , F , T , F , T , T }, + /*+C[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, F , F , F , F , F , F , F , F , F , T , F , T }, + /*I[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, F , F , F , F , F , F , F , F , T , F , T , T }, + /*T[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, F , F , F , F , F , F , F , F , T , T , T , T }}; + + CastTest() { + Type[] primitiveTypes = { + predef.byteType, + predef.shortType, + predef.intType, + predef.longType, + predef.floatType, + predef.doubleType, + predef.charType, + predef.booleanType }; + + Type[] referenceTypes = { + fac.Class(), + fac.Class(FINAL), + fac.Interface(), + fac.TypeVariable() }; + + Type[] arrayTypes = new Type[primitiveTypes.length + referenceTypes.length]; + int idx = 0; + for (Type t : join(Type.class, primitiveTypes, referenceTypes)) { + arrayTypes[idx++] = fac.Array(t); + } + + allTypes = join(Type.class, primitiveTypes, referenceTypes, arrayTypes); + } + + void test() { + for (int i = 0; i < allTypes.length ; i++) { + for (int j = 0; j < allTypes.length ; j++) { + assertCastable(allTypes[i], allTypes[j], cast_result[i][j]); + } + } + } + + @SuppressWarnings("unchecked") + T[] join(Class type, T[]... args) { + int totalLength = 0; + for (T[] arr : args) { + totalLength += arr.length; + } + T[] new_arr = (T[])Array.newInstance(type, totalLength); + int idx = 0; + for (T[] arr : args) { + System.arraycopy(arr, 0, new_arr, idx, arr.length); + idx += arr.length; + } + return new_arr; + } + + public static void main(String[] args) { + new CastTest().test(); + } +} diff --git a/langtools/test/tools/javac/types/PrimitiveConversionTest.java b/langtools/test/tools/javac/types/PrimitiveConversionTest.java new file mode 100644 index 00000000000..36c8199eb22 --- /dev/null +++ b/langtools/test/tools/javac/types/PrimitiveConversionTest.java @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7006109 + * @summary Add test library to simplify the task of writing automated type-system tests + * @author mcimadamore + * @library . + * @run main PrimitiveConversionTest + */ + +import com.sun.tools.javac.code.Type; +import com.sun.tools.javac.code.Type.*; +import com.sun.tools.javac.code.Symbol.*; +import java.lang.reflect.Array; +import java.util.EnumSet; + +/** + * Check invariants in assignment/method conversion involving primitive types and arrays + */ +public class PrimitiveConversionTest extends TypeHarness { + + Type[] types1; + Type[] types2; + Type[] types3; + + enum Result { + OK_BOTH(true), + FAIL_BOTH(false), + OK_ASSIGN_ONLY(true); + + boolean value; + + Result(boolean value) { + this.value = value; + } + } + + enum ConversionKind { + ASSIGNMENT_CONVERSION(EnumSet.of(Result.OK_BOTH, Result.OK_ASSIGN_ONLY)) { + @Override + void check(TypeHarness harness, Type from, Type to, Result expected) { + harness.assertAssignable(from, to, resSet.contains(expected)); + } + }, + METHOD_CONVERSION(EnumSet.of(Result.OK_BOTH)) { + @Override + void check(TypeHarness harness, Type from, Type to, Result expected) { + harness.assertConvertible(from, to, resSet.contains(expected)); + } + }; + + EnumSet resSet; + + private ConversionKind(EnumSet resSet) { + this.resSet = resSet; + } + + abstract void check(TypeHarness harness, Type from, Type to, Result expected); + } + + enum TestKind { + SIMPLE { + @Override + Type[] getFromTypes(PrimitiveConversionTest harness) { + return harness.types1; + } + @Override + Type[] getToTypes(PrimitiveConversionTest harness) { + return harness.types1; + } + @Override + Result[][] getResults(PrimitiveConversionTest harness) { + return harness.results1; + } + }, + CONSTANT_TYPES { + @Override + Type[] getFromTypes(PrimitiveConversionTest harness) { + return harness.types2; + } + @Override + Type[] getToTypes(PrimitiveConversionTest harness) { + return harness.types3; + } + @Override + Result[][] getResults(PrimitiveConversionTest harness) { + return harness.results2; + } + }; + + abstract Type[] getFromTypes(PrimitiveConversionTest harness); + abstract Type[] getToTypes(PrimitiveConversionTest harness); + abstract Result[][] getResults(PrimitiveConversionTest harness); + } + + static final Result T = Result.OK_BOTH; + static final Result F = Result.FAIL_BOTH; + static final Result A = Result.OK_ASSIGN_ONLY; + + Result[][] results1 = { + //byte, short, int, long, float, double, char, bool, C1, C2, C3, T , byte[], short[], int[], long[], float[], double[], char[], bool[], C1[], C2[], C3[], T[] + /*byte*/ { T , T , T , T , T , T , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F }, + /*short*/ { F , T , T , T , T , T , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F }, + /*int*/ { F , F , T , T , T , T , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F }, + /*long*/ { F , F , F , T , T , T , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F }, + /*float*/ { F , F , F , F , T , T , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F }, + /*double*/ { F , F , F , F , F , T , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F }, + /*char*/ { F , F , T , T , T , T , T , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F }, + /*bool*/ { F , F , F , F , F , F , F , T , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F }, + /*C1*/ { F , F , F , F , F , F , F , F , T , F , T , F , F , F , F , F , F , F , F , F , F , F , F , F }, + /*C2*/ { F , F , F , F , F , F , F , F , T , T , T , F , F , F , F , F , F , F , F , F , F , F , F , F }, + /*C3*/ { F , F , F , F , F , F , F , F , T , F , T , F , F , F , F , F , F , F , F , F , F , F , F , F }, + /*T*/ { F , F , F , F , F , F , F , F , F , F , F , T , F , F , F , F , F , F , F , F , F , F , F , F }, + /*byte[]*/ { F , F , F , F , F , F , F , F , F , F , F , F , T , F , F , F , F , F , F , F , F , F , F , F }, + /*short[]*/ { F , F , F , F , F , F , F , F , F , F , F , F , F , T , F , F , F , F , F , F , F , F , F , F }, + /*int[]*/ { F , F , F , F , F , F , F , F , F , F , F , F , F , F , T , F , F , F , F , F , F , F , F , F }, + /*long[]*/ { F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , T , F , F , F , F , F , F , F , F }, + /*float[]*/ { F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , T , F , F , F , F , F , F , F }, + /*double[]*/{ F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , T , F , F , F , F , F , F }, + /*char[]*/ { F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , T , F , F , F , F , F }, + /*bool[]*/ { F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , T , F , F , F , F }, + /*C1[]*/ { F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , T , F , T , F }, + /*C2[]*/ { F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , T , T , T , F }, + /*C3[]*/ { F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , T , F , T , F }, + /*T[]*/ { F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , F , T }}; + + Result[][] results2 = { + //byte, short, int, long, float, double, char, bool + /*byte*/ { T , T , T , T , T , T , F , F }, + /*short*/ { F , T , T , T , T , T , F , F }, + /*short1*/ { A , T , T , T , T , T , A , F }, + /*short2*/ { F , T , T , T , T , T , A , F }, + /*int*/ { F , F , T , T , T , T , F , F }, + /*int1*/ { A , A , T , T , T , T , A , F }, + /*int2*/ { F , A , T , T , T , T , A , F }, + /*int4*/ { F , F , T , T , T , T , F , F }, + /*long*/ { F , F , F , T , T , T , F , F }, + /*long1*/ { F , F , F , T , T , T , F , F }, + /*long2*/ { F , F , F , T , T , T , F , F }, + /*long4*/ { F , F , F , T , T , T , F , F }, + /*long8*/ { F , F , F , T , T , T , F , F }, + /*float*/ { F , F , F , F , T , T , F , F }, + /*float1*/ { F , F , F , F , T , T , F , F }, + /*float2*/ { F , F , F , F , T , T , F , F }, + /*float4*/ { F , F , F , F , T , T , F , F }, + /*double*/ { F , F , F , F , F , T , F , F }, + /*double1*/ { F , F , F , F , F , T , F , F }, + /*double2*/ { F , F , F , F , F , T , F , F }, + /*double4*/ { F , F , F , F , F , T , F , F }, + /*double8*/ { F , F , F , F , F , T , F , F }, + /*char*/ { F , F , T , T , T , T , T , F }, + /*char1*/ { A , A , T , T , T , T , T , F }, + /*char2*/ { F , A , T , T , T , T , T , F }, + /*bool*/ { F , F , F , F , F , F , F , T }}; + + PrimitiveConversionTest() { + Type[] primitiveTypes = new Type[] { + predef.byteType, + predef.shortType, + predef.intType, + predef.longType, + predef.floatType, + predef.doubleType, + predef.charType, + predef.booleanType }; + + ClassType c1 = fac.Class(fac.TypeVariable()); + ClassType c2 = fac.Class(); + c2.supertype_field = subst(c1, + Mapping(c1.getTypeArguments().head, predef.stringType)); + Type c3 = erasure(c1); + + Type[] referenceTypes = { + subst(c1, + Mapping(c1.getTypeArguments().head, predef.stringType)), + c2, + c3, + fac.TypeVariable() }; + + Type[] arrayTypes = new Type[primitiveTypes.length + referenceTypes.length]; + int idx = 0; + for (Type t : join(Type.class, primitiveTypes, referenceTypes)) { + arrayTypes[idx++] = fac.Array(t); + } + + types1 = join(Type.class, primitiveTypes, referenceTypes, arrayTypes); + + types2 = new Type[] { + predef.byteType, + predef.shortType, + fac.Constant((short)0x0001), + fac.Constant((short)0x0100), + predef.intType, + fac.Constant((int)0x0000_0001), + fac.Constant((int)0x0000_0100), + fac.Constant((int)0x0001_0000), + predef.longType, + fac.Constant((long)0x0000_0000_0000_0001L), + fac.Constant((long)0x0000_0000_0000_0100L), + fac.Constant((long)0x0000_0000_0001_0000L), + fac.Constant((long)0x0001_0000_0000_0000L), + predef.floatType, + fac.Constant((float)0x0000_0001), + fac.Constant((float)0x0000_0100), + fac.Constant((float)0x0001_0000), + predef.doubleType, + fac.Constant((double)0x0000_0000_0000_0001L), + fac.Constant((double)0x0000_0000_0000_0100L), + fac.Constant((double)0x0000_0000_0001_0000L), + fac.Constant((double)0x0001_0000_0000_0000L), + predef.charType, + fac.Constant((char)0x0001), + fac.Constant((char)0x0100), + predef.booleanType + }; + + types3 = primitiveTypes; + } + + void testConversion(ConversionKind convKind, TestKind testKind) { + Type[] rows = testKind.getFromTypes(this); + Type[] cols = testKind.getToTypes(this); + for (int i = 0; i < rows.length ; i++) { + for (int j = 0; j < cols.length ; j++) { + convKind.check(this, rows[i], cols[j], testKind.getResults(this)[i][j]); + } + } + } + + @SuppressWarnings("unchecked") + T[] join(Class type, T[]... args) { + int totalLength = 0; + for (T[] arr : args) { + totalLength += arr.length; + } + T[] new_arr = (T[])Array.newInstance(type, totalLength); + int idx = 0; + for (T[] arr : args) { + System.arraycopy(arr, 0, new_arr, idx, arr.length); + idx += arr.length; + } + return new_arr; + } + + public static void main(String[] args) { + PrimitiveConversionTest harness = new PrimitiveConversionTest(); + for (ConversionKind convKind : ConversionKind.values()) { + for (TestKind testKind : TestKind.values()) { + harness.testConversion(convKind, testKind); + } + } + } +} diff --git a/langtools/test/tools/javac/types/TypeHarness.java b/langtools/test/tools/javac/types/TypeHarness.java new file mode 100644 index 00000000000..3689b9a38aa --- /dev/null +++ b/langtools/test/tools/javac/types/TypeHarness.java @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import com.sun.tools.javac.code.BoundKind; +import com.sun.tools.javac.code.Flags; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.code.Types; +import com.sun.tools.javac.code.Symtab; +import com.sun.tools.javac.code.Type; +import com.sun.tools.javac.code.Type.*; +import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.util.List; +import com.sun.tools.javac.util.ListBuffer; +import com.sun.tools.javac.util.Name; +import com.sun.tools.javac.util.Names; +import com.sun.tools.javac.file.JavacFileManager; + +/** + * Test harness whose goal is to simplify the task of writing type-system + * regression test. It provides functionalities to build custom types as well + * as to access the underlying javac's symbol table in order to retrieve + * predefined types. Among the features supported by the harness are: type + * substitution, type containment, subtyping, cast-conversion, assigment + * conversion. + * + * This class is meant to be a common super class for all concrete type test + * classes. A subclass can access the type-factory and the test methods so as + * to write compact tests. An example is reported below: + * + *
        + * Type X = fac.TypeVariable();
        + * Type Y = fac.TypeVariable();
        + * Type A_X_Y = fac.Class(0, X, Y);
        + * Type A_Obj_Obj = fac.Class(0,
        + *           predef.objectType,
        + *           predef.objectType);
        + * checkSameType(A_Obj_Obj, subst(A_X_Y,
        + *           Mapping(X, predef.objectType),
        + *           Mapping(Y, predef.objectType)));
        + * 
        + * + * The above code is used to create two class types, namely {@code A} and + * {@code A} where both {@code X} and {@code Y} are type-variables. + * The code then verifies that {@code [X:=Object,Y:=Object]A == A}. + * + * @author mcimadamore + */ +public class TypeHarness { + + protected Types types; + protected Symtab predef; + protected Names names; + protected Factory fac; + + protected TypeHarness() { + Context ctx = new Context(); + JavacFileManager.preRegister(ctx); + types = Types.instance(ctx); + predef = Symtab.instance(ctx); + names = Names.instance(ctx); + fac = new Factory(); + } + + // + + /** assert that 's' is a subtype of 't' */ + public void assertSubtype(Type s, Type t) { + assertSubtype(s, t, true); + } + + /** assert that 's' is/is not a subtype of 't' */ + public void assertSubtype(Type s, Type t, boolean expected) { + if (types.isSubtype(s, t) != expected) { + String msg = expected ? + " is not a subtype of " : + " is a subtype of "; + error(s + msg + t); + } + } + + /** assert that 's' is the same type as 't' */ + public void assertSameType(Type s, Type t) { + assertSameType(s, t, true); + } + + /** assert that 's' is/is not the same type as 't' */ + public void assertSameType(Type s, Type t, boolean expected) { + if (types.isSameType(s, t) != expected) { + String msg = expected ? + " is not the same type as " : + " is the same type as "; + error(s + msg + t); + } + } + + /** assert that 's' is castable to 't' */ + public void assertCastable(Type s, Type t) { + assertCastable(s, t, true); + } + + /** assert that 's' is/is not castable to 't' */ + public void assertCastable(Type s, Type t, boolean expected) { + if (types.isCastable(s, t) != expected) { + String msg = expected ? + " is not castable to " : + " is castable to "; + error(s + msg + t); + } + } + + /** assert that 's' is convertible (method invocation conversion) to 't' */ + public void assertConvertible(Type s, Type t) { + assertCastable(s, t, true); + } + + /** assert that 's' is/is not convertible (method invocation conversion) to 't' */ + public void assertConvertible(Type s, Type t, boolean expected) { + if (types.isConvertible(s, t) != expected) { + String msg = expected ? + " is not convertible to " : + " is convertible to "; + error(s + msg + t); + } + } + + /** assert that 's' is assignable to 't' */ + public void assertAssignable(Type s, Type t) { + assertCastable(s, t, true); + } + + /** assert that 's' is/is not assignable to 't' */ + public void assertAssignable(Type s, Type t, boolean expected) { + if (types.isAssignable(s, t) != expected) { + String msg = expected ? + " is not assignable to " : + " is assignable to "; + error(s + msg + t); + } + } + // + + private void error(String msg) { + throw new AssertionError("Unexpected result: " + msg); + } + + // + + /** compute the erasure of a type 't' */ + public Type erasure(Type t) { + return types.erasure(t); + } + + /** compute the capture of a type 't' */ + public Type capture(Type t) { + return types.capture(t); + } + + /** compute the boxed type associated with 't' */ + public Type box(Type t) { + if (!t.isPrimitive()) { + throw new AssertionError("Cannot box non-primitive type: " + t); + } + return types.boxedClass(t).type; + } + + /** compute the unboxed type associated with 't' */ + public Type unbox(Type t) { + Type u = types.unboxedType(t); + if (t == null) { + throw new AssertionError("Cannot unbox reference type: " + t); + } else { + return u; + } + } + + /** compute a type substitution on 't' given a list of type mappings */ + public Type subst(Type t, Mapping... maps) { + ListBuffer from = ListBuffer.lb(); + ListBuffer to = ListBuffer.lb(); + for (Mapping tm : maps) { + from.append(tm.from); + to.append(tm.to); + } + return types.subst(t, from.toList(), to.toList()); + } + + /** create a fresh type mapping from a type to another */ + public Mapping Mapping(Type from, Type to) { + return new Mapping(from, to); + } + + public static class Mapping { + Type from; + Type to; + private Mapping(Type from, Type to) { + this.from = from; + this.to = to; + } + } + // + + // + + /** + * This class is used to create Java types in a simple way. All main + * kinds of type are supported: primitive, reference, non-denotable. The + * factory also supports creation of constant types (used by the compiler + * to represent the type of a literal). + */ + public class Factory { + + private int synthNameCount = 0; + + private Name syntheticName() { + return names.fromString("A$" + synthNameCount++); + } + + public ClassType Class(long flags, Type... typeArgs) { + ClassSymbol csym = new ClassSymbol(flags, syntheticName(), predef.noSymbol); + csym.type = new ClassType(Type.noType, List.from(typeArgs), csym); + ((ClassType)csym.type).supertype_field = predef.objectType; + return (ClassType)csym.type; + } + + public ClassType Class(Type... typeArgs) { + return Class(0, typeArgs); + } + + public ClassType Interface(Type... typeArgs) { + return Class(Flags.INTERFACE, typeArgs); + } + + public ClassType Interface(long flags, Type... typeArgs) { + return Class(Flags.INTERFACE | flags, typeArgs); + } + + public Type Constant(byte b) { + return predef.byteType.constType(b); + } + + public Type Constant(short s) { + return predef.shortType.constType(s); + } + + public Type Constant(int i) { + return predef.intType.constType(i); + } + + public Type Constant(long l) { + return predef.longType.constType(l); + } + + public Type Constant(float f) { + return predef.floatType.constType(f); + } + + public Type Constant(double d) { + return predef.doubleType.constType(d); + } + + public Type Constant(char c) { + return predef.charType.constType(c + 0); + } + + public ArrayType Array(Type elemType) { + return new ArrayType(elemType, predef.arrayClass); + } + + public TypeVar TypeVariable() { + return TypeVariable(predef.objectType); + } + + public TypeVar TypeVariable(Type bound) { + TypeSymbol tvsym = new TypeSymbol(0, syntheticName(), null, predef.noSymbol); + tvsym.type = new TypeVar(tvsym, bound, null); + return (TypeVar)tvsym.type; + } + + public WildcardType Wildcard(BoundKind bk, Type bound) { + return new WildcardType(bound, bk, predef.boundClass); + } + + public CapturedType CapturedVariable(Type upper, Type lower) { + return new CapturedType(syntheticName(), predef.noSymbol, upper, lower, null); + } + + public ClassType Intersection(Type classBound, Type... intfBounds) { + ClassType ct = Class(Flags.COMPOUND); + ct.supertype_field = classBound; + ct.interfaces_field = List.from(intfBounds); + return ct; + } + } + // +} diff --git a/langtools/test/tools/javac/varargs/5088429/T5088429Neg01.java b/langtools/test/tools/javac/varargs/5088429/T5088429Neg01.java new file mode 100644 index 00000000000..723bac09f5e --- /dev/null +++ b/langtools/test/tools/javac/varargs/5088429/T5088429Neg01.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 5088429 + * + * @summary varargs overloading problem + * @author mcimadamore + * @compile/fail/ref=T5088429Neg01.out -XDrawDiagnostics T5088429Neg01.java + * + */ + +class T5088429Neg01 { + interface A {} + interface B extends A {} + + T5088429Neg01(A... args) {} + T5088429Neg01(A a, A... args) {} + + void test(B b) { + new T5088429Neg01(b); + } +} diff --git a/langtools/test/tools/javac/varargs/5088429/T5088429Neg01.out b/langtools/test/tools/javac/varargs/5088429/T5088429Neg01.out new file mode 100644 index 00000000000..4661eb00129 --- /dev/null +++ b/langtools/test/tools/javac/varargs/5088429/T5088429Neg01.out @@ -0,0 +1,2 @@ +T5088429Neg01.java:42:9: compiler.err.ref.ambiguous: T5088429Neg01, kindname.constructor, T5088429Neg01(T5088429Neg01.A...), T5088429Neg01, kindname.constructor, T5088429Neg01(T5088429Neg01.A,T5088429Neg01.A...), T5088429Neg01 +1 error diff --git a/langtools/test/tools/javac/varargs/5088429/T5088429Neg02.java b/langtools/test/tools/javac/varargs/5088429/T5088429Neg02.java new file mode 100644 index 00000000000..ede3aa72353 --- /dev/null +++ b/langtools/test/tools/javac/varargs/5088429/T5088429Neg02.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 5088429 + * + * @summary varargs overloading problem + * @author mcimadamore + * @compile/fail/ref=T5088429Neg02.out -XDrawDiagnostics T5088429Neg02.java + * + */ + +class T5088429Neg02 { + interface A {} + interface B extends A {} + + void m(A... args) {} + void m(A a, A... args) {} + + void test(B b) { + m(b); + } +} diff --git a/langtools/test/tools/javac/varargs/5088429/T5088429Neg02.out b/langtools/test/tools/javac/varargs/5088429/T5088429Neg02.out new file mode 100644 index 00000000000..279c0f29b79 --- /dev/null +++ b/langtools/test/tools/javac/varargs/5088429/T5088429Neg02.out @@ -0,0 +1,2 @@ +T5088429Neg02.java:42:9: compiler.err.ref.ambiguous: m, kindname.method, m(T5088429Neg02.A...), T5088429Neg02, kindname.method, m(T5088429Neg02.A,T5088429Neg02.A...), T5088429Neg02 +1 error diff --git a/langtools/test/tools/javac/varargs/5088429/T5088429Pos01.java b/langtools/test/tools/javac/varargs/5088429/T5088429Pos01.java new file mode 100644 index 00000000000..ad2e2fcbb47 --- /dev/null +++ b/langtools/test/tools/javac/varargs/5088429/T5088429Pos01.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 5088429 + * + * @summary varargs overloading problem + * @author mcimadamore + * @compile T5088429Pos01.java + * + */ + +class T5088429Pos01 { + interface A {} + interface B extends A {} + + T5088429Pos01(A... args) {} + T5088429Pos01(B b, A... args) {} + + void test(B b) { + new T5088429Pos01(b); + } +} diff --git a/langtools/test/tools/javac/typeAnnotations/6967002/T6967002.java b/langtools/test/tools/javac/varargs/5088429/T5088429Pos02.java similarity index 78% rename from langtools/test/tools/javac/typeAnnotations/6967002/T6967002.java rename to langtools/test/tools/javac/varargs/5088429/T5088429Pos02.java index 317cf34199e..abf0ec70783 100644 --- a/langtools/test/tools/javac/typeAnnotations/6967002/T6967002.java +++ b/langtools/test/tools/javac/varargs/5088429/T5088429Pos02.java @@ -23,13 +23,22 @@ /* * @test - * @bug 6967002 - * @summary JDK7 b99 javac compilation error (java.lang.AssertionError) - * @author Maurizio Cimadamore - * @compile/fail/ref=T6967002.out -XDrawDiagnostics T6967002.java + * @bug 5088429 + * + * @summary varargs overloading problem + * @author mcimadamore + * @compile T5088429Pos02.java + * */ -class Test { - private static void m(byte[] octets) { - return m(octets..., ?); - } + +class T5088429Pos02 { + interface A {} + interface B extends A {} + + void m(A... args) {} + void m(B b, A... args) {} + + void test(B b) { + m(b); + } } diff --git a/langtools/test/tools/javac/varargs/6199075/T6199075.java b/langtools/test/tools/javac/varargs/6199075/T6199075.java new file mode 100644 index 00000000000..290712b1d0f --- /dev/null +++ b/langtools/test/tools/javac/varargs/6199075/T6199075.java @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6199075 + * + * @summary Unambiguous varargs method calls flagged as ambiguous + * @author mcimadamore + * + */ + +import com.sun.source.util.JavacTask; +import com.sun.tools.classfile.Instruction; +import com.sun.tools.classfile.Attribute; +import com.sun.tools.classfile.ClassFile; +import com.sun.tools.classfile.Code_attribute; +import com.sun.tools.classfile.ConstantPool.*; +import com.sun.tools.classfile.Method; +import com.sun.tools.javac.util.List; + +import java.io.File; +import java.net.URI; +import java.util.Arrays; +import java.util.Locale; +import javax.tools.Diagnostic; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; + +public class T6199075 { + + int checkCount = 0; + int bytecodeCheckCount = 0; + + enum TypeKind { + BYTE("byte", "(byte)1", "[B", 0), + CHAR("char", "'c'", "[C", 1), + SHORT("short", "(short)1", "[S", 2), + INT("int", "1", "[I", 3), + LONG("long", "1L", "[J", 4), + FLOAT("float", "1.0F", "[F", 5), + DOUBLE("double", "1.0D", "[D", 6), + BOOLEAN("boolean", "true", "[Z", -1); + + String typeString; + String valueString; + String bytecodeString; + private int subtypeTag; + + TypeKind(String typeString, String valueString, String bytecodeString, int subtypeTag) { + this.typeString = typeString; + this.valueString = valueString; + this.bytecodeString = bytecodeString; + this.subtypeTag = subtypeTag; + } + + boolean isSubtypeOf(TypeKind that) { + switch (this) { + case BOOLEAN: + return that == BOOLEAN; + case BYTE: + case CHAR: + return this.subtypeTag == that.subtypeTag || + this.subtypeTag + 2 <= that.subtypeTag; + default: + return this.subtypeTag <= that.subtypeTag; + } + } + } + + enum ArgumentsArity { + ZERO(0), + ONE(1), + TWO(2), + THREE(3); + + int arity; + + ArgumentsArity(int arity) { + this.arity = arity; + } + + String asExpressionList(TypeKind type) { + StringBuilder buf = new StringBuilder(); + String sep = ""; + for (int i = 0; i < arity; i++) { + buf.append(sep); + buf.append(type.valueString); + sep = ","; + } + return buf.toString(); + } + } + + static class VarargsMethod { + TypeKind varargsElement; + + VarargsMethod(TypeKind varargsElement) { + this.varargsElement = varargsElement; + } + + @Override + public String toString() { + return "void m("+ varargsElement.typeString+ "... args) {}"; + } + + boolean isApplicable(TypeKind actual, ArgumentsArity argsArity) { + return argsArity == ArgumentsArity.ZERO || + actual.isSubtypeOf(varargsElement); + } + + boolean isMoreSpecificThan(VarargsMethod that) { + return varargsElement.isSubtypeOf(that.varargsElement); + } + } + + public static void main(String... args) throws Exception { + new T6199075().test(); + } + + void test() throws Exception { + for (TypeKind formal1 : TypeKind.values()) { + VarargsMethod m1 = new VarargsMethod(formal1); + for (TypeKind formal2 : TypeKind.values()) { + VarargsMethod m2 = new VarargsMethod(formal2); + for (TypeKind actual : TypeKind.values()) { + for (ArgumentsArity argsArity : ArgumentsArity.values()) { + compileAndCheck(m1, m2, actual, argsArity); + } + } + } + } + + System.out.println("Total checks made: " + checkCount); + System.out.println("Bytecode checks made: " + bytecodeCheckCount); + } + + void compileAndCheck(VarargsMethod m1, VarargsMethod m2, TypeKind actual, ArgumentsArity argsArity) throws Exception { + final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); + JavaSource source = new JavaSource(m1, m2, actual, argsArity); + ErrorChecker ec = new ErrorChecker(); + JavacTask ct = (JavacTask)tool.getTask(null, null, ec, + null, null, Arrays.asList(source)); + ct.generate(); + check(source, ec, m1, m2, actual, argsArity); + } + + void check(JavaSource source, ErrorChecker ec, VarargsMethod m1, VarargsMethod m2, TypeKind actual, ArgumentsArity argsArity) { + checkCount++; + boolean resolutionError = false; + VarargsMethod selectedMethod = null; + + boolean m1_applicable = m1.isApplicable(actual, argsArity); + boolean m2_applicable = m2.isApplicable(actual, argsArity); + + if (!m1_applicable && !m2_applicable) { + resolutionError = true; + } else if (m1_applicable && m2_applicable) { + //most specific + boolean m1_moreSpecific = m1.isMoreSpecificThan(m2); + boolean m2_moreSpecific = m2.isMoreSpecificThan(m1); + resolutionError = m1_moreSpecific == m2_moreSpecific; + selectedMethod = m1_moreSpecific ? m1 : m2; + } else { + selectedMethod = m1_applicable ? + m1 : m2; + } + + if (ec.errorFound != resolutionError) { + throw new Error("invalid diagnostics for source:\n" + + source.getCharContent(true) + + "\nExpected resolution error: " + resolutionError + + "\nFound error: " + ec.errorFound + + "\nCompiler diagnostics:\n" + ec.printDiags()); + } else if (!resolutionError) { + verifyBytecode(selectedMethod); + } + } + + void verifyBytecode(VarargsMethod selected) { + bytecodeCheckCount++; + File compiledTest = new File("Test.class"); + try { + ClassFile cf = ClassFile.read(compiledTest); + Method testMethod = null; + for (Method m : cf.methods) { + if (m.getName(cf.constant_pool).equals("test")) { + testMethod = m; + break; + } + } + if (testMethod == null) { + throw new Error("Test method not found"); + } + Code_attribute ea = (Code_attribute)testMethod.attributes.get(Attribute.Code); + if (testMethod == null) { + throw new Error("Code attribute for test() method not found"); + } + + for (Instruction i : ea.getInstructions()) { + if (i.getMnemonic().equals("invokevirtual")) { + int cp_entry = i.getUnsignedShort(1); + CONSTANT_Methodref_info methRef = + (CONSTANT_Methodref_info)cf.constant_pool.get(cp_entry); + String type = methRef.getNameAndTypeInfo().getType(); + if (!type.contains(selected.varargsElement.bytecodeString)) { + throw new Error("Unexpected type method call: " + type); + } + break; + } + } + } catch (Exception e) { + e.printStackTrace(); + throw new Error("error reading " + compiledTest +": " + e); + } + } + + static class JavaSource extends SimpleJavaFileObject { + + static final String source_template = "class Test {\n" + + " #V1\n" + + " #V2\n" + + " void test() { m(#E); }\n" + + "}"; + + String source; + + public JavaSource(VarargsMethod m1, VarargsMethod m2, TypeKind actual, ArgumentsArity argsArity) { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + source = source_template.replaceAll("#V1", m1.toString()). + replaceAll("#V2", m2.toString()). + replaceAll("#E", argsArity.asExpressionList(actual)); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + } + + static class ErrorChecker implements javax.tools.DiagnosticListener { + + boolean errorFound; + List errDiags = List.nil(); + + public void report(Diagnostic diagnostic) { + if (diagnostic.getKind() == Diagnostic.Kind.ERROR) { + errDiags = errDiags.append(diagnostic.getMessage(Locale.getDefault())); + errorFound = true; + } + } + + String printDiags() { + StringBuilder buf = new StringBuilder(); + for (String s : errDiags) { + buf.append(s); + buf.append("\n"); + } + return buf.toString(); + } + } +} diff --git a/langtools/test/tools/javac/varargs/6730476/T6730476a.java b/langtools/test/tools/javac/varargs/6730476/T6730476a.java index 7eca3cb0bcf..4d5cc57a296 100644 --- a/langtools/test/tools/javac/varargs/6730476/T6730476a.java +++ b/langtools/test/tools/javac/varargs/6730476/T6730476a.java @@ -32,6 +32,7 @@ */ class T6730476a { + @SuppressWarnings("unchecked") void f(int i, T ... x) {} void g() { f(1); diff --git a/langtools/test/tools/javac/varargs/6806876/T6806876.out b/langtools/test/tools/javac/varargs/6806876/T6806876.out index 8d4ad3d4551..7932d7a1c5b 100644 --- a/langtools/test/tools/javac/varargs/6806876/T6806876.out +++ b/langtools/test/tools/javac/varargs/6806876/T6806876.out @@ -1,6 +1,5 @@ T6806876.java:11:32: compiler.warn.unchecked.generic.array.creation: java.lang.Number&java.lang.Comparable>[] +T6806876.java:14:19: compiler.warn.unchecked.varargs.non.reifiable.type: T - compiler.err.warnings.and.werror -- compiler.note.varargs.filename: T6806876.java -- compiler.note.varargs.recompile 1 error -1 warning +2 warnings diff --git a/langtools/test/tools/javac/varargs/6993978/T6993978neg.java b/langtools/test/tools/javac/varargs/6993978/T6993978neg.java new file mode 100644 index 00000000000..3487725bb0d --- /dev/null +++ b/langtools/test/tools/javac/varargs/6993978/T6993978neg.java @@ -0,0 +1,17 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6993978 + * @author mcimadamore + * @summary ClassCastException occurs in assignment expressions without any heap pollutions + * @compile/fail/ref=T6993978neg.out -Xlint:unchecked -Werror -XDrawDiagnostics T6993978neg.java + */ + +import java.util.List; + +class T6993978neg { + @SuppressWarnings({"varargs","unchecked"}) + static void m(X... x) { } + static void test(List ls) { + m(ls); //compiler should still give unchecked here + } +} diff --git a/langtools/test/tools/javac/varargs/6993978/T6993978neg.out b/langtools/test/tools/javac/varargs/6993978/T6993978neg.out new file mode 100644 index 00000000000..c1e752a6b8b --- /dev/null +++ b/langtools/test/tools/javac/varargs/6993978/T6993978neg.out @@ -0,0 +1,4 @@ +T6993978neg.java:15:9: compiler.warn.unchecked.generic.array.creation: java.util.List[] +- compiler.err.warnings.and.werror +1 error +1 warning diff --git a/langtools/test/tools/javac/varargs/T6746184.java b/langtools/test/tools/javac/varargs/T6746184.java index c0d5b06c009..f59f852ad84 100644 --- a/langtools/test/tools/javac/varargs/T6746184.java +++ b/langtools/test/tools/javac/varargs/T6746184.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javac/varargs/warning/Warn1.java b/langtools/test/tools/javac/varargs/warning/Warn1.java index 05f68446434..8ffaabfbe11 100644 --- a/langtools/test/tools/javac/varargs/warning/Warn1.java +++ b/langtools/test/tools/javac/varargs/warning/Warn1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ * @summary fixed-arity warning given too often * @author gafter * - * @compile -Werror -source 1.4 Warn1.java + * @compile -Werror -source 1.4 -Xlint:-options Warn1.java */ package varargs.warning.warn1; diff --git a/langtools/test/tools/javac/varargs/warning/Warn4.java b/langtools/test/tools/javac/varargs/warning/Warn4.java index df63fdc3f4a..43e8a2715b4 100644 --- a/langtools/test/tools/javac/varargs/warning/Warn4.java +++ b/langtools/test/tools/javac/varargs/warning/Warn4.java @@ -23,7 +23,7 @@ /** * @test - * @bug 6945418 + * @bug 6945418 6993978 * @summary Project Coin: Simplified Varargs Method Invocation * @author mcimadamore * @run main Warn4 @@ -48,96 +48,95 @@ public class Warn4 { final static Warning[] both = new Warning[] { Warning.VARARGS, Warning.UNCHECKED }; enum Warning { - UNCHECKED("unchecked"), - VARARGS("varargs"); + UNCHECKED("generic.array.creation"), + VARARGS("varargs.non.reifiable.type"); - String category; + String key; - Warning(String category) { - this.category = category; + Warning(String key) { + this.key = key; } - boolean isEnabled(XlintOption xlint, SuppressLevel suppressLevel) { - return Arrays.asList(xlint.enabledWarnings).contains(this); - } + boolean isSuppressed(TrustMe trustMe, SourceLevel source, SuppressLevel suppressLevelClient, + SuppressLevel suppressLevelDecl, ModifierKind modKind) { + switch(this) { + case VARARGS: + return source == SourceLevel.JDK_6 || + suppressLevelDecl == SuppressLevel.UNCHECKED || + trustMe == TrustMe.TRUST; + case UNCHECKED: + return suppressLevelClient == SuppressLevel.UNCHECKED || + (trustMe == TrustMe.TRUST && modKind != ModifierKind.NONE && source == SourceLevel.JDK_7); + } - boolean isSuppressed(SuppressLevel suppressLevel) { - return Arrays.asList(suppressLevel.suppressedWarnings).contains(VARARGS); + SuppressLevel supLev = this == VARARGS ? + suppressLevelDecl : + suppressLevelClient; + return supLev == SuppressLevel.UNCHECKED || + (trustMe == TrustMe.TRUST && modKind != ModifierKind.NONE); } } - enum XlintOption { - NONE(), - UNCHECKED(Warning.UNCHECKED), - VARARGS(Warning.VARARGS), - ALL(Warning.UNCHECKED, Warning.VARARGS); + enum SourceLevel { + JDK_6("6"), + JDK_7("7"); - Warning[] enabledWarnings; + String sourceKey; - XlintOption(Warning... enabledWarnings) { - this.enabledWarnings = enabledWarnings; + SourceLevel(String sourceKey) { + this.sourceKey = sourceKey; } + } - String getXlintOption() { - StringBuilder buf = new StringBuilder(); - String sep = ""; - for (Warning w : enabledWarnings) { - buf.append(sep); - buf.append(w.category); - sep=","; - } - return "-Xlint:" + - (this == NONE ? "none" : buf.toString()); + enum TrustMe { + DONT_TRUST(""), + TRUST("@java.lang.SafeVarargs"); + + String anno; + + TrustMe(String anno) { + this.anno = anno; + } + } + + enum ModifierKind { + NONE(" "), + FINAL("final "), + STATIC("static "); + + String mod; + + ModifierKind(String mod) { + this.mod = mod; } } enum SuppressLevel { - NONE(), - UNCHECKED(Warning.UNCHECKED), - VARARGS(Warning.VARARGS), - ALL(Warning.UNCHECKED, Warning.VARARGS); + NONE(""), + UNCHECKED("unchecked"); - Warning[] suppressedWarnings; + String lint; - SuppressLevel(Warning... suppressedWarnings) { - this.suppressedWarnings = suppressedWarnings; + SuppressLevel(String lint) { + this.lint = lint; } - String getSuppressAnnotation() { - StringBuilder buf = new StringBuilder(); - String sep = ""; - for (Warning w : suppressedWarnings) { - buf.append(sep); - buf.append("\""); - buf.append(w.category); - buf.append("\""); - sep=","; - } - return this == NONE ? "" : - "@SuppressWarnings({" + buf.toString() + "})"; + String getSuppressAnno() { + return "@SuppressWarnings(\"" + lint + "\")"; } } enum Signature { - - EXTENDS_TVAR(" void #name(List#arity arg) { #body }", - new Warning[][] {both, both, both, both, error, both, both, both, error}), - SUPER_TVAR(" void #name(List#arity arg) { #body }", - new Warning[][] {error, both, error, both, error, error, both, both, error}), UNBOUND("void #name(List#arity arg) { #body }", - new Warning[][] {none, none, none, none, none, none, none, none, error}), + new Warning[][] {none, none, none, none, error}), INVARIANT_TVAR(" void #name(List#arity arg) { #body }", - new Warning[][] {both, both, both, both, error, both, both, both, error}), + new Warning[][] {both, both, error, both, error}), TVAR(" void #name(Z#arity arg) { #body }", - new Warning[][] {both, both, both, both, both, both, both, both, vararg}), - EXTENDS("void #name(List#arity arg) { #body }", - new Warning[][] {error, error, error, error, error, both, error, both, error}), - SUPER("void #name(List#arity arg) { #body }", - new Warning[][] {error, error, error, error, error, error, both, both, error}), + new Warning[][] {both, both, both, both, vararg}), INVARIANT("void #name(List#arity arg) { #body }", - new Warning[][] {error, error, error, error, error, error, error, both, error}), + new Warning[][] {error, error, error, both, error}), UNPARAMETERIZED("void #name(String#arity arg) { #body }", - new Warning[][] {error, error, error, error, error, error, error, error, none}); + new Warning[][] {error, error, error, error, none}); String template; Warning[][] warnings; @@ -163,15 +162,24 @@ public class Warn4 { } public static void main(String... args) throws Exception { - for (XlintOption xlint : XlintOption.values()) { - for (SuppressLevel suppressLevel : SuppressLevel.values()) { - for (Signature vararg_meth : Signature.values()) { - for (Signature client_meth : Signature.values()) { - if (vararg_meth.isApplicableTo(client_meth)) { - test(xlint, - suppressLevel, - vararg_meth, - client_meth); + for (SourceLevel sourceLevel : SourceLevel.values()) { + for (TrustMe trustMe : TrustMe.values()) { + for (SuppressLevel suppressLevelClient : SuppressLevel.values()) { + for (SuppressLevel suppressLevelDecl : SuppressLevel.values()) { + for (ModifierKind modKind : ModifierKind.values()) { + for (Signature vararg_meth : Signature.values()) { + for (Signature client_meth : Signature.values()) { + if (vararg_meth.isApplicableTo(client_meth)) { + test(sourceLevel, + trustMe, + suppressLevelClient, + suppressLevelDecl, + modKind, + vararg_meth, + client_meth); + } + } + } } } } @@ -179,37 +187,37 @@ public class Warn4 { } } - static void test(XlintOption xlint, SuppressLevel suppressLevel, - Signature vararg_meth, Signature client_meth) throws Exception { + static void test(SourceLevel sourceLevel, TrustMe trustMe, SuppressLevel suppressLevelClient, + SuppressLevel suppressLevelDecl, ModifierKind modKind, Signature vararg_meth, Signature client_meth) throws Exception { final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); - JavaSource source = new JavaSource(suppressLevel, vararg_meth, client_meth); + JavaSource source = new JavaSource(trustMe, suppressLevelClient, suppressLevelDecl, modKind, vararg_meth, client_meth); DiagnosticChecker dc = new DiagnosticChecker(); JavacTask ct = (JavacTask)tool.getTask(null, null, dc, - Arrays.asList(xlint.getXlintOption()), null, Arrays.asList(source)); + Arrays.asList("-Xlint:unchecked", "-source", sourceLevel.sourceKey), + null, Arrays.asList(source)); ct.generate(); //to get mandatory notes - check(dc.warnings, - dc.notes, + check(dc.warnings, sourceLevel, new boolean[] {vararg_meth.giveUnchecked(client_meth), vararg_meth.giveVarargs(client_meth)}, - source, xlint, suppressLevel); + source, trustMe, suppressLevelClient, suppressLevelDecl, modKind); } - static void check(Set warnings, Set notes, boolean[] warnArr, JavaSource source, XlintOption xlint, SuppressLevel suppressLevel) { + static void check(Set warnings, SourceLevel sourceLevel, boolean[] warnArr, JavaSource source, + TrustMe trustMe, SuppressLevel suppressLevelClient, SuppressLevel suppressLevelDecl, ModifierKind modKind) { boolean badOutput = false; for (Warning wkind : Warning.values()) { - badOutput |= (warnArr[wkind.ordinal()] && !wkind.isSuppressed(suppressLevel)) != - (wkind.isEnabled(xlint, suppressLevel) ? - warnings.contains(wkind) : - notes.contains(wkind)); + boolean isSuppressed = wkind.isSuppressed(trustMe, sourceLevel, + suppressLevelClient, suppressLevelDecl, modKind); + System.out.println("SUPPRESSED = " + isSuppressed); + badOutput |= (warnArr[wkind.ordinal()] && !isSuppressed) != warnings.contains(wkind); } if (badOutput) { throw new Error("invalid diagnostics for source:\n" + source.getCharContent(true) + - "\nOptions: " + xlint.getXlintOption() + "\nExpected unchecked warning: " + warnArr[0] + "\nExpected unsafe vararg warning: " + warnArr[1] + "\nWarnings: " + warnings + - "\nNotes: " + notes); + "\nSource level: " + sourceLevel); } } @@ -217,18 +225,20 @@ public class Warn4 { String source; - public JavaSource(SuppressLevel suppressLevel, Signature vararg_meth, Signature client_meth) { + public JavaSource(TrustMe trustMe, SuppressLevel suppressLevelClient, SuppressLevel suppressLevelDecl, + ModifierKind modKind, Signature vararg_meth, Signature client_meth) { super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); String meth1 = vararg_meth.template.replace("#arity", "..."); meth1 = meth1.replace("#name", "m"); meth1 = meth1.replace("#body", ""); - meth1 = suppressLevel.getSuppressAnnotation() + meth1; + meth1 = trustMe.anno + "\n" + suppressLevelDecl.getSuppressAnno() + modKind.mod + meth1; String meth2 = client_meth.template.replace("#arity", ""); meth2 = meth2.replace("#name", "test"); meth2 = meth2.replace("#body", "m(arg);"); + meth2 = suppressLevelClient.getSuppressAnno() + meth2; source = "import java.util.List;\n" + - "class Test {\n" + meth1 + - "\n" + meth2 + "\n}\n"; + "class Test {\n" + meth1 + + "\n" + meth2 + "\n}\n"; } @Override @@ -240,19 +250,15 @@ public class Warn4 { static class DiagnosticChecker implements javax.tools.DiagnosticListener { Set warnings = new HashSet<>(); - Set notes = new HashSet<>(); public void report(Diagnostic diagnostic) { if (diagnostic.getKind() == Diagnostic.Kind.MANDATORY_WARNING || diagnostic.getKind() == Diagnostic.Kind.WARNING) { - warnings.add(diagnostic.getCode().contains("varargs") ? - Warning.VARARGS : - Warning.UNCHECKED); - } - else if (diagnostic.getKind() == Diagnostic.Kind.NOTE) { - notes.add(diagnostic.getCode().contains("varargs") ? - Warning.VARARGS : - Warning.UNCHECKED); + if (diagnostic.getCode().contains(Warning.VARARGS.key)) { + warnings.add(Warning.VARARGS); + } else if(diagnostic.getCode().contains(Warning.UNCHECKED.key)) { + warnings.add(Warning.UNCHECKED); + } } } } diff --git a/langtools/test/tools/javac/varargs/warning/Warn5.java b/langtools/test/tools/javac/varargs/warning/Warn5.java new file mode 100644 index 00000000000..31bf2badb82 --- /dev/null +++ b/langtools/test/tools/javac/varargs/warning/Warn5.java @@ -0,0 +1,293 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6993978 + * @summary Project Coin: Annotation to reduce varargs warnings + * @author mcimadamore + * @run main Warn5 + */ +import com.sun.source.util.JavacTask; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import javax.tools.Diagnostic; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; + +public class Warn5 { + + enum XlintOption { + NONE("none"), + ALL("all"); + + String opt; + + XlintOption(String opt) { + this.opt = opt; + } + + String getXlintOption() { + return "-Xlint:" + opt; + } + } + + enum TrustMe { + DONT_TRUST(""), + TRUST("@java.lang.SafeVarargs"); + + String anno; + + TrustMe(String anno) { + this.anno = anno; + } + } + + enum SuppressLevel { + NONE, + VARARGS; + + String getSuppressAnno() { + return this == VARARGS ? + "@SuppressWarnings(\"varargs\")" : + ""; + } + } + + enum ModifierKind { + NONE(""), + FINAL("final"), + STATIC("static"); + + String mod; + + ModifierKind(String mod) { + this.mod = mod; + } + } + + enum MethodKind { + METHOD("void m"), + CONSTRUCTOR("Test"); + + + String name; + + MethodKind(String name) { + this.name = name; + } + } + + enum SourceLevel { + JDK_6("6"), + JDK_7("7"); + + String sourceKey; + + SourceLevel(String sourceKey) { + this.sourceKey = sourceKey; + } + } + + enum SignatureKind { + VARARGS_X("#K #N(X... x)", false, true), + VARARGS_STRING("#K #N(String... x)", true, true), + ARRAY_X("#K #N(X[] x)", false, false), + ARRAY_STRING("#K #N(String[] x)", true, false); + + String stub; + boolean isReifiableArg; + boolean isVarargs; + + SignatureKind(String stub, boolean isReifiableArg, boolean isVarargs) { + this.stub = stub; + this.isReifiableArg = isReifiableArg; + this.isVarargs = isVarargs; + } + + String getSignature(ModifierKind modKind, MethodKind methKind) { + return methKind != MethodKind.CONSTRUCTOR ? + stub.replace("#K", modKind.mod).replace("#N", methKind.name) : + stub.replace("#K", "").replace("#N", methKind.name); + } + } + + enum BodyKind { + ASSIGN("Object o = x;", true), + CAST("Object o = (Object)x;", true), + METH("test(x);", true), + PRINT("System.out.println(x.toString());", false), + ARRAY_ASSIGN("Object[] o = x;", true), + ARRAY_CAST("Object[] o = (Object[])x;", true), + ARRAY_METH("testArr(x);", true); + + String body; + boolean hasAliasing; + + BodyKind(String body, boolean hasAliasing) { + this.body = body; + this.hasAliasing = hasAliasing; + } + } + + static class JavaSource extends SimpleJavaFileObject { + + String template = "import com.sun.tools.javac.api.*;\n" + + "import java.util.List;\n" + + "class Test {\n" + + " static void test(Object o) {}\n" + + " static void testArr(Object[] o) {}\n" + + " #T \n #S #M { #B }\n" + + "}\n"; + + String source; + + public JavaSource(TrustMe trustMe, SuppressLevel suppressLevel, ModifierKind modKind, + MethodKind methKind, SignatureKind meth, BodyKind body) { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + source = template.replace("#T", trustMe.anno). + replace("#S", suppressLevel.getSuppressAnno()). + replace("#M", meth.getSignature(modKind, methKind)). + replace("#B", body.body); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + } + + public static void main(String... args) throws Exception { + for (SourceLevel sourceLevel : SourceLevel.values()) { + for (XlintOption xlint : XlintOption.values()) { + for (TrustMe trustMe : TrustMe.values()) { + for (SuppressLevel suppressLevel : SuppressLevel.values()) { + for (ModifierKind modKind : ModifierKind.values()) { + for (MethodKind methKind : MethodKind.values()) { + for (SignatureKind sig : SignatureKind.values()) { + for (BodyKind body : BodyKind.values()) { + test(sourceLevel, + xlint, + trustMe, + suppressLevel, + modKind, + methKind, + sig, + body); + } + } + } + } + } + } + } + } + } + + static void test(SourceLevel sourceLevel, XlintOption xlint, TrustMe trustMe, SuppressLevel suppressLevel, + ModifierKind modKind, MethodKind methKind, SignatureKind sig, BodyKind body) throws Exception { + final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); + JavaSource source = new JavaSource(trustMe, suppressLevel, modKind, methKind, sig, body); + DiagnosticChecker dc = new DiagnosticChecker(); + JavacTask ct = (JavacTask)tool.getTask(null, null, dc, + Arrays.asList(xlint.getXlintOption(), "-source", sourceLevel.sourceKey), null, Arrays.asList(source)); + ct.analyze(); + check(sourceLevel, dc, source, xlint, trustMe, + suppressLevel, modKind, methKind, sig, body); + } + + static void check(SourceLevel sourceLevel, DiagnosticChecker dc, JavaSource source, + XlintOption xlint, TrustMe trustMe, SuppressLevel suppressLevel, ModifierKind modKind, + MethodKind methKind, SignatureKind meth, BodyKind body) { + + boolean hasPotentiallyUnsafeBody = sourceLevel == SourceLevel.JDK_7 && + trustMe == TrustMe.TRUST && + suppressLevel != SuppressLevel.VARARGS && + xlint != XlintOption.NONE && + meth.isVarargs && !meth.isReifiableArg && body.hasAliasing && + (methKind == MethodKind.CONSTRUCTOR || (methKind == MethodKind.METHOD && modKind != ModifierKind.NONE)); + + boolean hasPotentiallyPollutingDecl = sourceLevel == SourceLevel.JDK_7 && + trustMe == TrustMe.DONT_TRUST && + meth.isVarargs && + !meth.isReifiableArg && + xlint == XlintOption.ALL; + + boolean hasMalformedAnnoInDecl = sourceLevel == SourceLevel.JDK_7 && + trustMe == TrustMe.TRUST && + (!meth.isVarargs || + (modKind == ModifierKind.NONE && methKind == MethodKind.METHOD)); + + boolean hasRedundantAnnoInDecl = sourceLevel == SourceLevel.JDK_7 && + trustMe == TrustMe.TRUST && + xlint != XlintOption.NONE && + suppressLevel != SuppressLevel.VARARGS && + (modKind != ModifierKind.NONE || methKind == MethodKind.CONSTRUCTOR) && + meth.isVarargs && + meth.isReifiableArg; + + if (hasPotentiallyUnsafeBody != dc.hasPotentiallyUnsafeBody || + hasPotentiallyPollutingDecl != dc.hasPotentiallyPollutingDecl || + hasMalformedAnnoInDecl != dc.hasMalformedAnnoInDecl || + hasRedundantAnnoInDecl != dc.hasRedundantAnnoInDecl) { + throw new Error("invalid diagnostics for source:\n" + + source.getCharContent(true) + + "\nOptions: " + xlint.getXlintOption() + + "\nExpected potentially unsafe body warning: " + hasPotentiallyUnsafeBody + + "\nExpected potentially polluting decl warning: " + hasPotentiallyPollutingDecl + + "\nExpected malformed anno error: " + hasMalformedAnnoInDecl + + "\nExpected redundant anno warning: " + hasRedundantAnnoInDecl + + "\nFound potentially unsafe body warning: " + dc.hasPotentiallyUnsafeBody + + "\nFound potentially polluting decl warning: " + dc.hasPotentiallyPollutingDecl + + "\nFound malformed anno error: " + dc.hasMalformedAnnoInDecl + + "\nFound redundant anno warning: " + dc.hasRedundantAnnoInDecl); + } + } + + static class DiagnosticChecker implements javax.tools.DiagnosticListener { + + boolean hasPotentiallyUnsafeBody = false; + boolean hasPotentiallyPollutingDecl = false; + boolean hasMalformedAnnoInDecl = false; + boolean hasRedundantAnnoInDecl = false; + + public void report(Diagnostic diagnostic) { + if (diagnostic.getKind() == Diagnostic.Kind.WARNING) { + if (diagnostic.getCode().contains("unsafe.use.varargs.param")) { + hasPotentiallyUnsafeBody = true; + } else if (diagnostic.getCode().contains("redundant.trustme")) { + hasRedundantAnnoInDecl = true; + } + } else if (diagnostic.getKind() == Diagnostic.Kind.MANDATORY_WARNING && + diagnostic.getCode().contains("varargs.non.reifiable.type")) { + hasPotentiallyPollutingDecl = true; + } else if (diagnostic.getKind() == Diagnostic.Kind.ERROR && + diagnostic.getCode().contains("invalid.trustme")) { + hasMalformedAnnoInDecl = true; + } + } + } +} diff --git a/langtools/test/tools/javadoc/6942366/T6942366.java b/langtools/test/tools/javadoc/6942366/T6942366.java new file mode 100644 index 00000000000..c5199981e66 --- /dev/null +++ b/langtools/test/tools/javadoc/6942366/T6942366.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6942366 + * @summary javadoc no longer inherits doc from sourcepath + * @build p.Base Test + * @run main T6942366 + */ + +import java.io.*; +import java.util.*; + +public class T6942366 { + public static void main(String... args) throws Exception { + new T6942366().run(); + } + + File testSrc; + File testClasses; + int count; + int errors; + + void run() throws Exception { + testSrc = new File(System.getProperty("test.src")); + testClasses = new File(System.getProperty("test.classes")); + + test(true, false); + test(false, true); + test(true, true); + + if (errors > 0) + throw new Exception(errors + " errors found"); + } + + void test(boolean useSourcePath, boolean useClassPath) throws Exception { + System.out.println("test " + (++count) + " sp:" + useSourcePath + " cp:" + useClassPath); + File testDir = new File("test" + count); + testDir.mkdirs(); + + List args = new ArrayList(); + //args.add("-verbose"); + args.add("-d"); + args.add(testDir.getPath()); + if (useSourcePath) { + args.add("-sourcepath"); + args.add(testSrc.getPath()); + } + if (useClassPath) { + args.add("-classpath"); + args.add(testClasses.getPath()); + } else { + // override classpath to avoid stuff jtreg might have put on papth + args.add("-classpath"); + args.add("."); + } + + // use a very simple bootclasspath to avoid stuff jtreg might have put on path + File javaHome = new File(System.getProperty("java.home")); + File rt_jar = new File(javaHome, "lib/rt.jar"); + if (!rt_jar.exists()) + throw new Exception("rt.jar not found"); + args.add("-bootclasspath"); + args.add(rt_jar.getPath()); + + args.add(new File(testSrc, "Test.java").getPath()); + System.out.println("javadoc: " + args); + + int rc = com.sun.tools.javadoc.Main.execute(args.toArray(new String[args.size()])); + if (rc != 0) + throw new Exception("unexpected exit from javadoc, rc=" + rc); + + if (useSourcePath && useClassPath) { + long srcLastMod = new File(testSrc, "Test.java").lastModified(); + long classLastMod = new File(testClasses, "Test.class").lastModified(); + System.out.println("Test.java last modified: " + new Date(srcLastMod)); + System.out.println("Test.class last modified: " + new Date(classLastMod)); + System.out.println((srcLastMod > classLastMod ? "source" : "class") + " is newer"); + } + + String s = "javadoc-for-Base.m"; + boolean expect = useSourcePath; + boolean found = contains(new File(testDir, "Test.html"), s); + if (found) { + if (expect) + System.out.println("javadoc content \"" + s + "\" found, as expected"); + else + error("javadoc content \"" + s + "\" found unexpectedly"); + } else { + if (expect) + error("javadoc content \"" + s + "\" not found"); + else + System.out.println("javadoc content \"" + s + "\" not found, as expected"); + } + + System.out.println(); + } + + boolean contains(File f, String s) throws Exception { + byte[] buf = new byte[(int) f.length()]; + try (DataInputStream in = new DataInputStream(new FileInputStream(f))) { + in.readFully(buf); + } + return new String(buf).contains(s); + } + + void error(String msg) { + System.out.println("Error: " + msg); + errors++; + } + +} + diff --git a/langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsFilename.java b/langtools/test/tools/javadoc/6942366/Test.java similarity index 92% rename from langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsFilename.java rename to langtools/test/tools/javadoc/6942366/Test.java index 2e3cd0ff9a5..a9ac75624e4 100644 --- a/langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsFilename.java +++ b/langtools/test/tools/javadoc/6942366/Test.java @@ -21,6 +21,8 @@ * questions. */ -class VarargsFilename { - void m(T... items) { } +public class Test extends p.Base { + // overrides Base.m + public void m() { } } + diff --git a/langtools/test/tools/javac/diags/examples/EmptyBytecodeIdent.java b/langtools/test/tools/javadoc/6942366/p/Base.java similarity index 92% rename from langtools/test/tools/javac/diags/examples/EmptyBytecodeIdent.java rename to langtools/test/tools/javadoc/6942366/p/Base.java index 11cf6f95f8b..df70cad735c 100644 --- a/langtools/test/tools/javac/diags/examples/EmptyBytecodeIdent.java +++ b/langtools/test/tools/javadoc/6942366/p/Base.java @@ -21,8 +21,10 @@ * questions. */ -// key: compiler.err.empty.bytecode.ident +package p; -class EmptyBytecodeIdent { - int #"" = 3; +public class Base { + /** javadoc-for-Base.m. */ + public void m() { } } + diff --git a/langtools/test/tools/javadoc/T4994049/FileWithTabs.java b/langtools/test/tools/javadoc/T4994049/FileWithTabs.java index 2ac29d48ef3..2243451e6d5 100644 --- a/langtools/test/tools/javadoc/T4994049/FileWithTabs.java +++ b/langtools/test/tools/javadoc/T4994049/FileWithTabs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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,5 +22,5 @@ */ public class FileWithTabs { - public void tabbedMethod() {} +\tpublic void tabbedMethod() {} } diff --git a/langtools/test/tools/javadoc/T4994049/T4994049.java b/langtools/test/tools/javadoc/T4994049/T4994049.java index f8017af9114..c82f185a47d 100644 --- a/langtools/test/tools/javadoc/T4994049/T4994049.java +++ b/langtools/test/tools/javadoc/T4994049/T4994049.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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 @@ */ import com.sun.javadoc.*; -import java.io.File; +import java.io.*; import static com.sun.tools.javadoc.Main.execute; public class T4994049 extends Doclet { @@ -52,12 +52,47 @@ public class T4994049 extends Doclet { return false; } - public static void main(String... args) { + public static void main(String... args) throws Exception { + File testSrc = new File(System.getProperty("test.src")); + File tmpSrc = new File("tmpSrc"); + initTabs(testSrc, tmpSrc); + for (String file : args) { - File source = new File(System.getProperty("test.src", "."), file); - if (execute("javadoc", "T4994049", T4994049.class.getClassLoader(), - new String[]{source.getPath()} ) != 0) - throw new Error(); + File source = new File(tmpSrc, file); + int rc = execute("javadoc", "T4994049", T4994049.class.getClassLoader(), + new String[]{ source.getPath() } ); + if (rc != 0) + throw new Error("Unexpected return code from javadoc: " + rc); + } + } + + static void initTabs(File from, File to) throws IOException { + for (File f: from.listFiles()) { + File t = new File(to, f.getName()); + if (f.isDirectory()) { + initTabs(f, t); + } else if (f.getName().endsWith(".java")) { + write(t, read(f).replace("\\t", "\t")); + } + } + } + + static String read(File f) throws IOException { + StringBuilder sb = new StringBuilder(); + try (BufferedReader in = new BufferedReader(new FileReader(f))) { + String line; + while ((line = in.readLine()) != null) { + sb.append(line); + sb.append("\n"); + } + } + return sb.toString(); + } + + static void write(File f, String s) throws IOException { + f.getParentFile().mkdirs(); + try (Writer out = new FileWriter(f)) { + out.write(s); } } diff --git a/langtools/test/tools/javadoc/T6551367.java b/langtools/test/tools/javadoc/T6551367.java new file mode 100644 index 00000000000..04e6bdc1bde --- /dev/null +++ b/langtools/test/tools/javadoc/T6551367.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6551367 + * @summary javadoc throws ClassCastException when an link tag tries to reference constructor. + * @author A. Sundararajan + * @run main T6551367 T6551367.java + */ + +import com.sun.javadoc.*; +import java.io.File; +import static com.sun.tools.javadoc.Main.execute; + +public class T6551367 extends com.sun.tools.doclets.standard.Standard { + public T6551367() {} + + /** Here, in the javadoc for this method, I try to link to + * {@link # a constructor}. + */ + public static void main(String... args) { + File testSrc = new File(System.getProperty("test.src", ".")); + File destDir = new File(System.getProperty("user.dir", ".")); + for (String file : args) { + File source = new File(testSrc, file); + int rc = execute("javadoc", "T6551367", + T6551367.class.getClassLoader(), + new String[]{source.getPath(), "-d", destDir.getAbsolutePath()}); + if (rc != 0) + throw new Error("unexpected exit from javadoc: " + rc); + } + } +} diff --git a/langtools/test/tools/javac/diags/examples/TypeAnnotationsNotSupported.java b/langtools/test/tools/javah/4942232/ParamClassTest.java similarity index 84% rename from langtools/test/tools/javac/diags/examples/TypeAnnotationsNotSupported.java rename to langtools/test/tools/javah/4942232/ParamClassTest.java index 8f028cbd1de..143ae367e20 100644 --- a/langtools/test/tools/javac/diags/examples/TypeAnnotationsNotSupported.java +++ b/langtools/test/tools/javah/4942232/ParamClassTest.java @@ -21,13 +21,16 @@ * questions. */ -// key: compiler.err.type.annotations.not.supported.in.source -// options: -source 6 +public class ParamClassTest { + static { + System.loadLibrary("Test"); + } -@interface Anno { } + public native void method(Param s); -class TypeAnnotationsNotSupported { - void m() { - int i = (@Anno int) 3.14; + public static void main(String[] a) { } } + +class Param { +} diff --git a/langtools/test/tools/javah/4942232/Test.java b/langtools/test/tools/javah/4942232/Test.java new file mode 100644 index 00000000000..d108adf846f --- /dev/null +++ b/langtools/test/tools/javah/4942232/Test.java @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4942232 + * @summary missing param class processes without error + * @build ParamClassTest Test + * @run main Test + */ + +import java.io.*; +import java.util.*; + +public class Test { + public static void main(String... args) throws Exception { + new Test().run(); + } + + void run() throws Exception { + File testSrc = new File(System.getProperty("test.src")); + File testClasses = new File(System.getProperty("test.classes")); + + // standard use of javah on valid class file + String[] test1Args = { + "-d", mkdir("test1/out").getPath(), + "-classpath", testClasses.getPath(), + "ParamClassTest" + }; + test(test1Args, 0); + + // extended use of javah on valid source file + String[] test2Args = { + "-d", mkdir("test2/out").getPath(), + "-classpath", testSrc.getPath(), + "ParamClassTest" + }; + test(test2Args, 0); + + // javah on class file with missing referents + File test3Classes = mkdir("test3/classes"); + copy(new File(testClasses, "ParamClassTest.class"), test3Classes); + String[] test3Args = { + "-d", mkdir("test3/out").getPath(), + "-classpath", test3Classes.getPath(), + "ParamClassTest" + }; + test(test3Args, 1); + + // javah on source file with missing referents + File test4Src = mkdir("test4/src"); + String paramClassTestSrc = readFile(new File(testSrc, "ParamClassTest.java")); + writeFile(new File(test4Src, "ParamClassTest.java"), + paramClassTestSrc.replaceAll("class Param \\{\\s+\\}", "")); + String[] test4Args = { + "-d", mkdir("test4/out").getPath(), + "-classpath", test4Src.getPath(), + "ParamClassTest" + }; + test(test4Args, 15); + + if (errors > 0) + throw new Exception(errors + " errors occurred"); + } + + void test(String[] args, int expect) { + System.err.println("test: " + Arrays.asList(args)); + int rc = javah(args); + if (rc != expect) + error("Unexpected return code: " + rc + "; expected: " + expect); + } + + int javah(String... args) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + int rc = com.sun.tools.javah.Main.run(args, pw); + pw.close(); + String out = sw.toString(); + if (!out.isEmpty()) + System.err.println(out); + return rc; + } + + File mkdir(String path) { + File f = new File(path); + f.mkdirs(); + return f; + } + + void copy(File from, File to) throws IOException { + if (to.isDirectory()) + to = new File(to, from.getName()); + try (DataInputStream in = new DataInputStream(new FileInputStream(from)); + FileOutputStream out = new FileOutputStream(to)) { + byte[] buf = new byte[(int) from.length()]; + in.readFully(buf); + out.write(buf); + } + } + + String readFile(File f) throws IOException { + try (DataInputStream in = new DataInputStream(new FileInputStream(f))) { + byte[] buf = new byte[(int) f.length()]; + in.readFully(buf); + return new String(buf); + } + } + + void writeFile(File f, String body) throws IOException { + try (FileWriter out = new FileWriter(f)) { + out.write(body); + } + } + + void error(String msg) { + System.err.println(msg); + errors++; + } + + int errors; +} diff --git a/langtools/test/tools/javah/T6994608.java b/langtools/test/tools/javah/T6994608.java new file mode 100644 index 00000000000..91a9fdb74cd --- /dev/null +++ b/langtools/test/tools/javah/T6994608.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6994608 + * @summary javah no longer accepts parameter files as input + */ + +import java.io.*; +import java.util.*; + +public class T6994608 { + public static void main(String... args) throws Exception { + new T6994608().run(); + } + + void run() throws Exception { + Locale prev = Locale.getDefault(); + Locale.setDefault(Locale.ENGLISH); + try { + File f = writeFile(new File("classList"), "java.lang.Object"); + test(Arrays.asList("@" + f.getPath()), 0, null); + test(Arrays.asList("@badfile"), 1, "Can't find file badfile"); + if (errors > 0) + throw new Exception(errors + " errors occurred"); + } finally { + Locale.setDefault(prev); + } + } + + void test(List args, int expectRC, String expectOut) { + System.err.println("Test: " + args + + " rc:" + expectRC + + ((expectOut != null) ? " out:" + expectOut : "")); + + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + int rc = com.sun.tools.javah.Main.run(args.toArray(new String[args.size()]), pw); + pw.close(); + String out = sw.toString(); + if (!out.isEmpty()) + System.err.println(out); + + if (rc != expectRC) + error("Unexpected exit code: " + rc + "; expected: " + expectRC); + if (expectOut != null && !out.contains(expectOut)) + error("Expected string not found: " + expectOut); + + System.err.println(); + } + + File writeFile(File f, String s) throws IOException { + if (f.getParentFile() != null) + f.getParentFile().mkdirs(); + try (FileWriter out = new FileWriter(f)) { + out.write(s); + } + return f; + } + + void error(String msg) { + System.err.println(msg); + errors++; + } + + int errors; +} + diff --git a/langtools/test/tools/javah/TestHelpOpts.java b/langtools/test/tools/javah/TestHelpOpts.java new file mode 100644 index 00000000000..108be057b00 --- /dev/null +++ b/langtools/test/tools/javah/TestHelpOpts.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6893932 6990390 + * @summary javah help screen lists -h and -? but does not accept them + */ + +import java.io.*; +import java.util.*; + +public class TestHelpOpts { + public static void main(String... args) throws Exception { + new TestHelpOpts().run(); + } + + void run() throws Exception { + Locale prev = Locale.getDefault(); + try { + Locale.setDefault(Locale.ENGLISH); + + String[] opts = { "-h", "-help", "-?", "--help" }; + for (String opt: opts) + test(opt); + } finally { + Locale.setDefault(prev); + } + + if (errors > 0) + throw new Exception(errors + " errors occurred"); + } + + void test(String opt) { + System.err.println("test " + opt); + String[] args = { opt }; + + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + int rc = com.sun.tools.javah.Main.run(args, pw); + pw.close(); + String out = sw.toString(); + if (!out.isEmpty()) + System.err.println(out); + if (rc != 0) + error("Unexpected exit: rc=" + rc); + + String flat = out.replaceAll("\\s+", " "); // canonicalize whitespace + if (!flat.contains("Usage: javah [options] where [options] include:")) + error("expected text not found"); + if (flat.contains("main.opt")) + error("key not found in resource bundle: " + flat.replaceAll(".*(main.opt.[^ ]*).*", "$1")); + } + + void error(String msg) { + System.err.println(msg); + errors++; + } + + int errors; +} diff --git a/langtools/test/tools/javap/T6715251.java b/langtools/test/tools/javap/T6715251.java index c71e907ccf0..55f97027d2c 100644 --- a/langtools/test/tools/javap/T6715251.java +++ b/langtools/test/tools/javap/T6715251.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javap/T6715753.java b/langtools/test/tools/javap/T6715753.java index 8ed21c7ada6..a3fd18f32a6 100644 --- a/langtools/test/tools/javap/T6715753.java +++ b/langtools/test/tools/javap/T6715753.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javap/T6729471.java b/langtools/test/tools/javap/T6729471.java index d55017f0845..5fdb368885b 100644 --- a/langtools/test/tools/javap/T6729471.java +++ b/langtools/test/tools/javap/T6729471.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,8 @@ public class T6729471 } void run() { + File testClasses = new File(System.getProperty("test.classes")); + // simple class verify("java.util.Map", "public abstract boolean containsKey(java.lang.Object)"); @@ -48,11 +50,11 @@ public class T6729471 "public abstract K getKey()"); // file name - verify("../classes/tools/javap/T6729471.class", + verify(new File(testClasses, "T6729471.class").getPath(), "public static void main(java.lang.String...)"); // file url - verify("file:../classes/tools/javap/T6729471.class", + verify(new File(testClasses, "T6729471.class").toURI().toString(), "public static void main(java.lang.String...)"); // jar url: rt.jar diff --git a/langtools/test/tools/javap/T6868539.java b/langtools/test/tools/javap/T6868539.java index e2bc162e941..3971ea0bffa 100644 --- a/langtools/test/tools/javap/T6868539.java +++ b/langtools/test/tools/javap/T6868539.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/langtools/test/tools/javap/T7004698.java b/langtools/test/tools/javap/T7004698.java new file mode 100644 index 00000000000..60ac34f537e --- /dev/null +++ b/langtools/test/tools/javap/T7004698.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7004698 + * @summary javap does not output CharacterRangeTable attributes correctly + */ + +import java.io.*; +import java.util.*; +import java.util.regex.*; + +public class T7004698 { + public static void main(String... args) throws Exception { + new T7004698().run(); + } + + void run() throws Exception { + File srcDir = new File(System.getProperty("test.src")); + File srcFile = new File(srcDir, T7004698.class.getSimpleName() + ".java"); + File classesDir = new File("."); + compile("-Xjcov", "-d", classesDir.getPath(), srcFile.getPath()); + + File classFile = new File(classesDir, T7004698.class.getSimpleName() + ".class"); + String out = javap("-v", classFile.getPath()); + + Pattern attrBody = Pattern.compile("[0-9a-f, ]+//[-0-9a-z:, ]+"); + Pattern endOfAttr = Pattern.compile("(^$|[A-Z][A-Za-z0-9_]+:.*|})"); + boolean inAttr = false; + int count = 0; + int errors = 0; + for (String line: out.split(System.getProperty("line.separator"))) { + line = line.trim(); + if (line.equals("CharacterRangeTable:")) { + inAttr = true; + count++; + } else if (inAttr) { + if (endOfAttr.matcher(line).matches()) { + inAttr = false; + } else if (!attrBody.matcher(line).matches()) { + System.err.println("unexpected line found: " + line); + errors++; + } + } + } + if (count == 0) + throw new Exception("no attribute instances found"); + + if (errors > 0) + throw new Exception(errors + " errors found"); + } + + void compile(String... args) throws Exception { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + int rc = com.sun.tools.javac.Main.compile(args, pw); + pw.close(); + String out = sw.toString(); + if (!out.isEmpty()) + System.err.println(out); + if (rc != 0) + throw new Exception("javac failed unexpectedly; rc=" + rc); + } + + String javap(String... args) throws Exception { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + int rc = com.sun.tools.javap.Main.run(args, pw); + pw.close(); + String out = sw.toString(); + if (!out.isEmpty()) + System.err.println(out); + if (rc != 0) + throw new Exception("javap failed unexpectedly; rc=" + rc); + return out; + } +} diff --git a/langtools/test/tools/javap/typeAnnotations/ArrayClassLiterals.java b/langtools/test/tools/javap/typeAnnotations/ArrayClassLiterals.java deleted file mode 100644 index 24d414aa55b..00000000000 --- a/langtools/test/tools/javap/typeAnnotations/ArrayClassLiterals.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import com.sun.tools.classfile.*; - -/* - * @test ArrayClassLiterals - * @bug 6863814 - * @summary test that class literals array doesn't crash javap - */ - -public class ArrayClassLiterals { - public static void main(String[] args) throws Exception { - new ArrayClassLiterals().run(); - } - - public void run() throws Exception { - File javaFile = writeTestFile(); - File classFile = compileTestFile(javaFile); - - ClassFile cf = ClassFile.read(classFile); - test(cf); - for (Field f : cf.fields) { - test(cf, f); - } - for (Method m: cf.methods) { - test(cf, m); - } - - countAnnotations(); - - if (errors > 0) - throw new Exception(errors + " errors found"); - System.out.println("PASSED"); - } - - void test(ClassFile cf) { - test(cf, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Method m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Field m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, String name, boolean visible) { - int index = cf.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = cf.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - - for (ExtendedAnnotation anno : tAttr.annotations) - anno.position.toString(); - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Method m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - - for (ExtendedAnnotation anno : tAttr.annotations) - anno.position.toString(); - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Field m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - - for (ExtendedAnnotation anno : tAttr.annotations) - anno.position.toString(); - } - } - - File writeTestFile() throws IOException { - File f = new File("Testa.java"); - PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f))); - out.println("import java.util.*;"); - out.println("class Testa { "); - out.println(" @interface A { }"); - - out.println(" void test() {"); - out.println(" Object a = @A String.class;"); - out.println(" Object b = @A String @A [] @A [].class;"); - out.println(" }"); - out.println("}"); - - out.close(); - return f; - } - - File compileTestFile(File f) { - int rc = com.sun.tools.javac.Main.compile(new String[] { "-source", "1.7", "-g", f.getPath() }); - if (rc != 0) - throw new Error("compilation failed. rc=" + rc); - String path = f.getPath(); - return new File(path.substring(0, path.length() - 5) + ".class"); - } - - void countAnnotations() { - int expected_visibles = 0, expected_invisibles = 4; - int expected_all = expected_visibles + expected_invisibles; - - if (expected_all != all) { - errors++; - System.err.println("expected " + expected_all - + " annotations but found " + all); - } - - if (expected_visibles != visibles) { - errors++; - System.err.println("expected " + expected_visibles - + " visibles annotations but found " + visibles); - } - - if (expected_invisibles != invisibles) { - errors++; - System.err.println("expected " + expected_invisibles - + " invisibles annotations but found " + invisibles); - } - - } - - int errors; - int all; - int visibles; - int invisibles; -} diff --git a/langtools/test/tools/javap/typeAnnotations/ArrayClassLiterals2.java b/langtools/test/tools/javap/typeAnnotations/ArrayClassLiterals2.java deleted file mode 100644 index 1e3c277fa0d..00000000000 --- a/langtools/test/tools/javap/typeAnnotations/ArrayClassLiterals2.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6918625 - * @summary javap dumps type information of array class literals - */ - -import java.io.*; - -public class ArrayClassLiterals2 { - public static void main(String[] args) throws Exception { - new ArrayClassLiterals2().run(); - } - - public void run() throws IOException { - File classFile = new File(System.getProperty("test.classes"), "ArrayClassLiterals2$Test.class"); - - verify(classFile, - "RuntimeInvisibleTypeAnnotations:", - "CLASS_LITERAL_GENERIC_OR_ARRAY" - ); - - if (errors > 0) - throw new Error(errors + " found."); - } - - String javap(File f) { - StringWriter sw = new StringWriter(); - PrintWriter out = new PrintWriter(sw); - int rc = com.sun.tools.javap.Main.run(new String[] { "-v", f.getPath() }, out); - if (rc != 0) - throw new Error("javap failed. rc=" + rc); - out.close(); - return sw.toString(); - } - - void verify(File classFile, String... expects) { - String output = javap(classFile); - for (String expect: expects) { - if (output.indexOf(expect)< 0) - error(expect + " not found"); - } - } - - void error(String msg) { - System.err.println(msg); - errors++; - } - - int errors; - - - /*********************** Test class *************************/ - static class Test { - @interface A { } - void test() { - Object a = @A String @A [] @A [].class; - } - } -} diff --git a/langtools/test/tools/javap/typeAnnotations/ClassLiterals.java b/langtools/test/tools/javap/typeAnnotations/ClassLiterals.java deleted file mode 100644 index 5c3fd7c8a49..00000000000 --- a/langtools/test/tools/javap/typeAnnotations/ClassLiterals.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import com.sun.tools.classfile.*; - -/* - * @test ClassLiterals - * @bug 6843077 - * @summary test that all type annotations are present in the classfile - */ - -public class ClassLiterals { - public static void main(String[] args) throws Exception { - new ClassLiterals().run(); - } - - public void run() throws Exception { - File javaFile = writeTestFile(); - File classFile = compileTestFile(javaFile); - - ClassFile cf = ClassFile.read(classFile); - test(cf); - for (Field f : cf.fields) { - test(cf, f); - } - for (Method m: cf.methods) { - test(cf, m); - } - - countAnnotations(); - - if (errors > 0) - throw new Exception(errors + " errors found"); - System.out.println("PASSED"); - } - - void test(ClassFile cf) { - test(cf, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Method m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Field m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, String name, boolean visible) { - int index = cf.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = cf.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Method m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Field m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - File writeTestFile() throws IOException { - File f = new File("Testa.java"); - PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f))); - out.println("import java.util.*;"); - out.println("class Testa { "); - out.println(" @interface A { }"); - - out.println(" void test() {"); - out.println(" Object a = @A String.class;"); - out.println(" Object b = @A String @A [] @A [].class;"); - out.println(" }"); - out.println("}"); - - out.close(); - return f; - } - - File compileTestFile(File f) { - int rc = com.sun.tools.javac.Main.compile(new String[] { "-source", "1.7", "-g", f.getPath() }); - if (rc != 0) - throw new Error("compilation failed. rc=" + rc); - String path = f.getPath(); - return new File(path.substring(0, path.length() - 5) + ".class"); - } - - void countAnnotations() { - int expected_visibles = 0, expected_invisibles = 4; - int expected_all = expected_visibles + expected_invisibles; - - if (expected_all != all) { - errors++; - System.err.println("expected " + expected_all - + " annotations but found " + all); - } - - if (expected_visibles != visibles) { - errors++; - System.err.println("expected " + expected_visibles - + " visibles annotations but found " + visibles); - } - - if (expected_invisibles != invisibles) { - errors++; - System.err.println("expected " + expected_invisibles - + " invisibles annotations but found " + invisibles); - } - - } - - int errors; - int all; - int visibles; - int invisibles; -} diff --git a/langtools/test/tools/javap/typeAnnotations/JSR175Annotations.java b/langtools/test/tools/javap/typeAnnotations/JSR175Annotations.java deleted file mode 100644 index fe3c65f1965..00000000000 --- a/langtools/test/tools/javap/typeAnnotations/JSR175Annotations.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import com.sun.tools.classfile.*; - -/* - * @test JSR175Annotations - * @bug 6843077 - * @summary test that only type annotations are recorded as such in classfile - */ - -public class JSR175Annotations { - public static void main(String[] args) throws Exception { - new JSR175Annotations().run(); - } - - public void run() throws Exception { - File javaFile = writeTestFile(); - File classFile = compileTestFile(javaFile); - - ClassFile cf = ClassFile.read(classFile); - for (Field f : cf.fields) { - test(cf, f); - } - for (Method m: cf.methods) { - test(cf, m); - } - - countAnnotations(); - - if (errors > 0) - throw new Exception(errors + " errors found"); - System.out.println("PASSED"); - } - - void test(ClassFile cf, Method m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Field m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Method m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Field m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - File writeTestFile() throws IOException { - File f = new File("Test.java"); - PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f))); - out.println("import java.lang.annotation.Retention;"); - out.println("import java.lang.annotation.RetentionPolicy;"); - out.println("abstract class Test { "); - out.println(" @Retention(RetentionPolicy.RUNTIME)"); - out.println(" @interface A { }"); - out.println(" @A String m;"); - out.println(" @A String method(@A String a) {"); - out.println(" return a;"); - out.println(" }"); - out.println("}"); - out.close(); - return f; - } - - File compileTestFile(File f) { - int rc = com.sun.tools.javac.Main.compile(new String[] { "-source", "1.7", "-g", f.getPath() }); - if (rc != 0) - throw new Error("compilation failed. rc=" + rc); - String path = f.getPath(); - return new File(path.substring(0, path.length() - 5) + ".class"); - } - - void countAnnotations() { - int expected_visibles = 0, expected_invisibles = 0; - int expected_all = expected_visibles + expected_invisibles; - - if (expected_all != all) { - errors++; - System.err.println("expected " + expected_all - + " annotations but found " + all); - } - - if (expected_visibles != visibles) { - errors++; - System.err.println("expected " + expected_visibles - + " visibles annotations but found " + visibles); - } - - if (expected_invisibles != invisibles) { - errors++; - System.err.println("expected " + expected_invisibles - + " invisibles annotations but found " + invisibles); - } - - } - - int errors; - int all; - int visibles; - int invisibles; -} diff --git a/langtools/test/tools/javap/typeAnnotations/NewArray.java b/langtools/test/tools/javap/typeAnnotations/NewArray.java deleted file mode 100644 index aa15b89f550..00000000000 --- a/langtools/test/tools/javap/typeAnnotations/NewArray.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import com.sun.tools.classfile.*; - -/* - * @test NewArray - * @bug 6843077 - * @summary test that all type annotations are present in the classfile - */ - -public class NewArray { - public static void main(String[] args) throws Exception { - new NewArray().run(); - } - - public void run() throws Exception { - File javaFile = writeTestFile(); - File classFile = compileTestFile(javaFile); - - ClassFile cf = ClassFile.read(classFile); - test(cf); - for (Field f : cf.fields) { - test(cf, f); - } - for (Method m: cf.methods) { - test(cf, m); - } - - countAnnotations(); - - if (errors > 0) - throw new Exception(errors + " errors found"); - System.out.println("PASSED"); - } - - void test(ClassFile cf) { - test(cf, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Method m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Field m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, String name, boolean visible) { - int index = cf.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = cf.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Method m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Field m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - File writeTestFile() throws IOException { - File f = new File("Test.java"); - PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f))); - out.println("import java.util.*;"); - out.println("class Test { "); - out.println(" @interface A { }"); - - out.println(" void test() {"); - out.println(" Object a = new @A String @A [5] @A [];"); - out.println(" Object b = new @A String @A [5] @A [3];"); - out.println(" Object c = new @A String @A [] @A [] {};"); - out.println(" }"); - out.println("}"); - - out.close(); - return f; - } - - File compileTestFile(File f) { - int rc = com.sun.tools.javac.Main.compile(new String[] { "-source", "1.7", "-g", f.getPath() }); - if (rc != 0) - throw new Error("compilation failed. rc=" + rc); - String path = f.getPath(); - return new File(path.substring(0, path.length() - 5) + ".class"); - } - - void countAnnotations() { - int expected_visibles = 0, expected_invisibles = 9; - int expected_all = expected_visibles + expected_invisibles; - - if (expected_all != all) { - errors++; - System.err.println("expected " + expected_all - + " annotations but found " + all); - } - - if (expected_visibles != visibles) { - errors++; - System.err.println("expected " + expected_visibles - + " visibles annotations but found " + visibles); - } - - if (expected_invisibles != invisibles) { - errors++; - System.err.println("expected " + expected_invisibles - + " invisibles annotations but found " + invisibles); - } - - } - - int errors; - int all; - int visibles; - int invisibles; -} diff --git a/langtools/test/tools/javap/typeAnnotations/Presence.java b/langtools/test/tools/javap/typeAnnotations/Presence.java deleted file mode 100644 index 6fdf5c0cc4d..00000000000 --- a/langtools/test/tools/javap/typeAnnotations/Presence.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import com.sun.tools.classfile.*; - -/* - * @test Presence - * @bug 6843077 - * @summary test that all type annotations are present in the classfile - */ - -public class Presence { - public static void main(String[] args) throws Exception { - new Presence().run(); - } - - public void run() throws Exception { - File javaFile = writeTestFile(); - File classFile = compileTestFile(javaFile); - - ClassFile cf = ClassFile.read(classFile); - test(cf); - for (Field f : cf.fields) { - test(cf, f); - } - for (Method m: cf.methods) { - test(cf, m); - } - - countAnnotations(); - - if (errors > 0) - throw new Exception(errors + " errors found"); - System.out.println("PASSED"); - } - - void test(ClassFile cf) { - test(cf, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Method m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Field m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, String name, boolean visible) { - int index = cf.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = cf.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Method m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Field m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - File writeTestFile() throws IOException { - File f = new File("Test.java"); - PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f))); - out.println("import java.util.*;"); - out.println("class Test<@Test.A T extends @Test.A List<@Test.A String>> { "); - out.println(" @interface A { }"); - - out.println(" Map<@A String, Map<@A String, @A String>> f1;"); - - out.println(" <@A T extends @A List<@A String>>"); - out.println(" Map<@A String, @A List<@A String>>"); - out.println(" method(List<@A String> @A [] param1, String @A [] @A ... param2) @A"); - out.println(" throws @A Exception {"); - out.println(" @A String lc1 = null;"); - out.println(" @A List<@A String> lc2 = null;"); - out.println(" @A String @A [] [] @A[] lc3 = null;"); - out.println(" List> lc4 = null;"); - out.println(" Object lc5 = (@A List<@A String>) null;"); - out.println(" boolean lc6 = lc1 instanceof @A String;"); - out.println(" boolean lc7 = lc5 instanceof @A String @A [] @A [];"); - out.println(" new @A ArrayList<@A String>();"); - out.println(" Object lc8 = new @A String @A [4];"); - out.println(" Object lc9 = @A String.class;"); - out.println(" Object lc10 = @A int.class;"); - out.println(" return null;"); - out.println(" }"); - out.println(" void vararg1(String @A ... t) { } "); - out.println("}"); - out.close(); - return f; - } - - File compileTestFile(File f) { - int rc = com.sun.tools.javac.Main.compile(new String[] { "-source", "1.7", "-g", f.getPath() }); - if (rc != 0) - throw new Error("compilation failed. rc=" + rc); - String path = f.getPath(); - return new File(path.substring(0, path.length() - 5) + ".class"); - } - - void countAnnotations() { - int expected_visibles = 0, expected_invisibles = 39; - int expected_all = expected_visibles + expected_invisibles; - - if (expected_all != all) { - errors++; - System.err.println("expected " + expected_all - + " annotations but found " + all); - } - - if (expected_visibles != visibles) { - errors++; - System.err.println("expected " + expected_visibles - + " visibles annotations but found " + visibles); - } - - if (expected_invisibles != invisibles) { - errors++; - System.err.println("expected " + expected_invisibles - + " invisibles annotations but found " + invisibles); - } - - } - - int errors; - int all; - int visibles; - int invisibles; -} diff --git a/langtools/test/tools/javap/typeAnnotations/PresenceInner.java b/langtools/test/tools/javap/typeAnnotations/PresenceInner.java deleted file mode 100644 index 50ae3a9ad8c..00000000000 --- a/langtools/test/tools/javap/typeAnnotations/PresenceInner.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import com.sun.tools.classfile.*; - -/* - * @test PresenceInner - * @bug 6843077 - * @summary test that annotations in inner types count only once - */ - -public class PresenceInner { - public static void main(String[] args) throws Exception { - new PresenceInner().run(); - } - - public void run() throws Exception { - File javaFile = writeTestFile(); - File classFile = compileTestFile(javaFile); - - ClassFile cf = ClassFile.read(classFile); - test(cf); - for (Field f : cf.fields) { - test(cf, f); - } - for (Method m: cf.methods) { - test(cf, m); - } - - // counts are zero when vising outer class - countAnnotations(0); - - // visit inner class - File innerFile = new File("Test$1Inner.class"); - ClassFile icf = ClassFile.read(innerFile); - test(icf); - for (Field f : icf.fields) { - test(cf, f); - } - for (Method m: icf.methods) { - test(cf, m); - } - - countAnnotations(1); - if (errors > 0) - throw new Exception(errors + " errors found"); - System.out.println("PASSED"); - } - - void test(ClassFile cf) { - test(cf, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Method m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - void test(ClassFile cf, Field m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, String name, boolean visible) { - int index = cf.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = cf.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Method m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Field m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - File writeTestFile() throws IOException { - File f = new File("Test.java"); - PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f))); - - out.println("class Test {"); - out.println(" void method() {"); - out.println(" class Inner { }"); - out.println(" }"); - out.println("}"); - out.println("@interface A { }"); - out.close(); - System.out.println(f.getAbsolutePath()); - return f; - } - - File compileTestFile(File f) { - int rc = com.sun.tools.javac.Main.compile(new String[] { "-source", "1.7", "-g", f.getPath() }); - if (rc != 0) - throw new Error("compilation failed. rc=" + rc); - String path = f.getPath(); - return new File(path.substring(0, path.length() - 5) + ".class"); - } - - void countAnnotations(int expected_invisibles) { - int expected_visibles = 0; - int expected_all = expected_visibles + expected_invisibles; - - if (expected_all != all) { - errors++; - System.err.println("expected " + expected_all - + " annotations but found " + all); - } - - if (expected_visibles != visibles) { - errors++; - System.err.println("expected " + expected_visibles - + " visibles annotations but found " + visibles); - } - - if (expected_invisibles != invisibles) { - errors++; - System.err.println("expected " + expected_invisibles - + " invisibles annotations but found " + invisibles); - } - - } - - int errors; - int all; - int visibles; - int invisibles; -} diff --git a/langtools/test/tools/javap/typeAnnotations/Visibility.java b/langtools/test/tools/javap/typeAnnotations/Visibility.java deleted file mode 100644 index 49b619c386e..00000000000 --- a/langtools/test/tools/javap/typeAnnotations/Visibility.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.*; -import com.sun.tools.classfile.*; - -/* - * @test Visibility - * @bug 6843077 - * @summary test that type annotations are recorded in the classfile - */ - -public class Visibility { - public static void main(String[] args) throws Exception { - new Visibility().run(); - } - - public void run() throws Exception { - File javaFile = writeTestFile(); - File classFile = compileTestFile(javaFile); - - ClassFile cf = ClassFile.read(classFile); - for (Method m: cf.methods) { - test(cf, m); - } - - countAnnotations(); - - if (errors > 0) - throw new Exception(errors + " errors found"); - System.out.println("PASSED"); - } - - void test(ClassFile cf, Method m) { - test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); - test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); - } - - // test the result of Attributes.getIndex according to expectations - // encoded in the method's name - void test(ClassFile cf, Method m, String name, boolean visible) { - int index = m.attributes.getIndex(cf.constant_pool, name); - if (index != -1) { - Attribute attr = m.attributes.get(index); - assert attr instanceof RuntimeTypeAnnotations_attribute; - RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; - all += tAttr.annotations.length; - if (visible) - visibles += tAttr.annotations.length; - else - invisibles += tAttr.annotations.length; - } - } - - File writeTestFile() throws IOException { - File f = new File("Test.java"); - PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f))); - out.println("import java.lang.annotation.Retention;"); - out.println("import java.lang.annotation.RetentionPolicy;"); - out.println("abstract class Test { "); - // visible annotations: RUNTIME - out.println(" @Retention(RetentionPolicy.RUNTIME)"); - out.println(" @interface A { }"); - out.println(" void visible() @A { }"); - - // invisible annotations: CLASS - out.println(" @Retention(RetentionPolicy.CLASS)"); - out.println(" @interface B { }"); - out.println(" void invisible() @B { }"); - - // source annotations - out.println(" @Retention(RetentionPolicy.SOURCE)"); - out.println(" @interface C { }"); - out.println(" void source() @C { }"); - - // default visibility: CLASS - out.println(" @interface D { }"); - out.println(" void def() @D { }"); - out.println("}"); - out.close(); - return f; - } - - File compileTestFile(File f) { - int rc = com.sun.tools.javac.Main.compile(new String[] { "-source", "1.7", "-g", f.getPath() }); - if (rc != 0) - throw new Error("compilation failed. rc=" + rc); - String path = f.getPath(); - return new File(path.substring(0, path.length() - 5) + ".class"); - } - - void countAnnotations() { - int expected_all = 3, expected_visibles = 1, expected_invisibles = 2; - - if (expected_all != all) { - errors++; - System.err.println("expected " + expected_all - + " annotations but found " + all); - } - - if (expected_visibles != visibles) { - errors++; - System.err.println("expected " + expected_visibles - + " visibles annotations but found " + visibles); - } - - if (expected_invisibles != invisibles) { - errors++; - System.err.println("expected " + expected_invisibles - + " invisibles annotations but found " + invisibles); - } - - } - - int errors; - int all; - int visibles; - int invisibles; -} diff --git a/make/Defs-internal.gmk b/make/Defs-internal.gmk index cab13f38de8..907ee95ac1e 100644 --- a/make/Defs-internal.gmk +++ b/make/Defs-internal.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/make/deploy-rules.gmk b/make/deploy-rules.gmk index 3aa6e16d982..1308d51518b 100644 --- a/make/deploy-rules.gmk +++ b/make/deploy-rules.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. # 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,12 +41,11 @@ else IMAGES_TARGET = images endif -DEPLOY_BUILD_TARGETS = sanity javaws-all plugin-all +DEPLOY_BUILD_TARGETS = sanity deploy # Only build 7-Zip LZMA file compression if it is available # Enable 7-Zip LZMA file (de)compression for Java Kernel if it is available ifeq ($(ARCH_DATA_MODEL), 32) ifeq ($(PLATFORM), windows) - ifneq ($(KERNEL), off) EC_TMP = $(shell if [ -d $(DEPLOY_TOPDIR)/make/lzma ] ; then \ $(ECHO) true ; \ else \ @@ -55,7 +54,6 @@ ifeq ($(ARCH_DATA_MODEL), 32) ifeq ($(EC_TMP), true) DEPLOY_BUILD_TARGETS += extra-comp-all endif - endif endif endif @@ -79,7 +77,6 @@ ifneq ($(KERNEL), off) ifeq ($(UP_TMP), true) DEPLOY_BUILD_TARGETS += cmd-comp-all endif - DEPLOY_BUILD_TARGETS += kernel-all endif endif endif diff --git a/make/hotspot-rules.gmk b/make/hotspot-rules.gmk index 9a85b93f990..674ce633da0 100644 --- a/make/hotspot-rules.gmk +++ b/make/hotspot-rules.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/make/install-rules.gmk b/make/install-rules.gmk index b20f8ea072f..8e1f189d521 100644 --- a/make/install-rules.gmk +++ b/make/install-rules.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -93,6 +93,10 @@ ifeq ($(BUILD_INSTALL), true) fi endif +combo_build: + @$(ECHO) $@ installer combo build started: `$(DATE) '+%y-%m-%d %H:%M'` + $(CD) $(INSTALL_TOPDIR)/make/installer/bundles/windows/ishield/wrapper/wrapper.jreboth ; $(MAKE) all + install-clobber: ifeq ($(BUILD_INSTALL), true) @$(call MakeStart, install, clobber) diff --git a/make/jprt.gmk b/make/jprt.gmk index 57fd1d32e34..49687d9921d 100644 --- a/make/jprt.gmk +++ b/make/jprt.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/make/sanity-rules.gmk b/make/sanity-rules.gmk index 1ab62f7d601..58345ad09f4 100644 --- a/make/sanity-rules.gmk +++ b/make/sanity-rules.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/make/scripts/hgforest.sh b/make/scripts/hgforest.sh new file mode 100644 index 00000000000..7834826d8eb --- /dev/null +++ b/make/scripts/hgforest.sh @@ -0,0 +1,104 @@ +#!/bin/sh + +# +# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Shell script for a fast parallel forest command + +tmp=/tmp/forest.$$ +rm -f -r ${tmp} +mkdir -p ${tmp} + +# Remove tmp area on A. B. Normal termination +trap 'rm -f -r ${tmp}' KILL +trap 'rm -f -r ${tmp}' EXIT + +# Only look in specific locations for possible forests (avoids long searches) +pull_default="" +if [ "$1" = "clone" -o "$1" = "fclone" ] ; then + subrepos="corba jaxp jaxws langtools jdk hotspot" + if [ -f .hg/hgrc ] ; then + pull_default=`hg paths default` + fi + if [ "${pull_default}" = "" ] ; then + echo "ERROR: Need initial clone with 'hg paths default' defined" + exit 1 + fi + repos="" + for i in ${subrepos} ; do + if [ ! -f ${i}/.hg/hgrc ] ; then + repos="${repos} ${i}" + fi + done + at_a_time=2 +else + hgdirs=`ls -d ./.hg ./*/.hg ./*/*/.hg ./*/*/*/.hg ./*/*/*/*/.hg 2>/dev/null` + # Derive repository names from the .hg directory locations + repos="" + for i in ${hgdirs} ; do + repos="${repos} `echo ${i} | sed -e 's@/.hg$@@'`" + done + at_a_time=8 +fi + +# Any repos to deal with? +if [ "${repos}" = "" ] ; then + echo "No repositories to process." + exit +fi + +# Echo out what repositories we will process +echo "# Repos: ${repos}" + +# Run the supplied command on all repos in parallel, save output until end +n=0 +for i in ${repos} ; do + echo "Starting on ${i}" + n=`expr ${n} '+' 1` + ( + ( + if [ "$1" = "clone" -o "$1" = "fclone" ] ; then + cline="hg $* ${pull_default}/${i} ${i}" + echo "# ${cline}" + ( eval "${cline}" ) + else + cline="hg $*" + echo "# cd ${i} && ${cline}" + ( cd ${i} && eval "${cline}" ) + fi + echo "# exit code $?" + ) > ${tmp}/repo.${n} 2>&1 ; cat ${tmp}/repo.${n} ) & + if [ `expr ${n} '%' ${at_a_time}` -eq 0 ] ; then + sleep 5 + fi +done + +# Wait for all hg commands to complete +wait + +# Cleanup +rm -f -r ${tmp} + +# Terminate with exit 0 all the time (hard to know when to say "failed") +exit 0 + diff --git a/make/scripts/update_copyright_year.sh b/make/scripts/update_copyright_year.sh new file mode 100644 index 00000000000..cd8b0a07e2f --- /dev/null +++ b/make/scripts/update_copyright_year.sh @@ -0,0 +1,189 @@ +#!/bin/sh -f + +# +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Script to update the Copyright YEAR range in Mercurial sources. +# (Originally from xdono, Thanks!) + +if [ "`uname -s`" = "SunOS" ] ; then + awk=nawk +else + awk=awk +fi + +# Stop on any error +set -e + +# Temp area +tmp=/tmp/`basename $0`.${USER}.$$ +rm -f -r ${tmp} +mkdir -p ${tmp} +total=0 + +# This year or supplied year +if [ "$1" != "" ] ; then + year="$1" +else + year=`date +%Y` +fi + +# Return true if it makes sense to edit this file +saneFileToCheck() +{ + if [ "$1" != "" -a -f $1 ] ; then + isText=`file "$1" | egrep -i '(text|source)' | cat` + hasCopyright=`grep 'Copyright' "$1" | cat` + lastLineCount=`tail -1 "$1" | wc -l` + if [ "${isText}" != "" \ + -a "${hasCopyright}" != "" \ + -a ${lastLineCount} -eq 1 ] ; then + echo "true" + else + echo "false" + fi + else + echo "false" + fi +} + +# Update the copyright year on a file +updateFile() # file +{ + changed="false" + if [ `saneFileToCheck "$1"` = "true" ] ; then + copyright="Copyright (c)" + company="Oracle" + rm -f $1.OLD + mv $1 $1.OLD + cat $1.OLD | \ + sed -e "s@\(${copyright} [12][0-9][0-9][0-9],\) [12][0-9][0-9][0-9], ${company}@\1 ${year}, ${company}@" | \ + sed -e "s@\(${copyright} [12][0-9][0-9][0-9],\) ${company}@\1 ${year}, ${company}@" | \ + sed -e "s@${copyright} ${year}, ${year}, ${company}@${copyright} ${year}, ${company}@" \ + > $1 + if ! diff -b -w $1.OLD $1 > /dev/null ; then \ + changed="true" + rm -f $1.OLD + else + rm -f $1 + mv $1.OLD $1 + fi + fi + echo "${changed}" +} + +# Update the copyright year on all files changed by this changeset +updateChangesetFiles() # changeset +{ + count=0 + files=${tmp}/files.$1 + rm -f ${files} + hg log --rev $1 -v --template '{files}\n' | expand \ + | ${awk} -F' ' '{for(i=1;i<=NF;i++)print $i}' \ + > ${files} + if [ -f "${files}" -a -s "${files}" ] ; then + copyright="Copyright (c)" + company="Oracle" + fcount=`cat ${files}| wc -l` + for i in `cat ${files}` ; do + if [ `updateFile "${i}"` = "true" ] ; then + count=`expr ${count} '+' 1` + fi + done + if [ ${count} -gt 0 ] ; then + printf " UPDATED year on %d of %d files.\n" ${count} ${fcount} + total=`expr ${total} '+' ${count}` + else + printf " None of the %d files were changed.\n" ${fcount} + fi + else + printf " ERROR: No files changed in the changeset? Must be a mistake.\n" + set -x + ls -al ${files} + hg log --rev $1 -v --template '{files}\n' + hg log --rev $1 -v --template '{files}\n' | expand \ + | ${awk} -F' ' '{for(i=1;i<=NF;i++)print $i}' + set +x + exit 1 + fi + rm -f ${files} +} + +# Check if repository is clean +previous=`hg status|wc -l` +if [ ${previous} -ne 0 ] ; then + echo "WARNING: This repository contains previously edited working set files." + echo " hg status | wc -l = `hg status | wc -l`" +fi + +# Get all changesets this year +all_changesets=${tmp}/all_changesets +rm -f ${all_changesets} +hg log --no-merges -v -d "${year}-01-01 to ${year}-12-31" --template '{node}\n' > ${all_changesets} + +# Check changeset to see if it is Copyright only changes, filter changesets +if [ -s ${all_changesets} ] ; then + echo "Changesets made in ${year}: `cat ${all_changesets} | wc -l`" + index=0 + cat ${all_changesets} | while read changeset ; do + index=`expr ${index} '+' 1` + desc=${tmp}/desc.${changeset} + rm -f ${desc} + echo "------------------------------------------------" + hg log --rev ${changeset} --template '{desc}\n' > ${desc} + printf "%d: %s\n%s\n" ${index} "${changeset}" "`cat ${desc}|head -1`" + if cat ${desc} | fgrep -i "Added tag" > /dev/null ; then + printf " EXCLUDED tag changeset.\n" + elif cat ${desc} | fgrep -i rebrand > /dev/null ; then + printf " EXCLUDED rebrand changeset.\n" + elif cat ${desc} | fgrep -i copyright > /dev/null ; then + printf " EXCLUDED copyright changeset.\n" + else + updateChangesetFiles ${changeset} + fi + rm -f ${desc} + done +fi + +if [ ${total} -gt 0 ] ; then + echo "---------------------------------------------" + echo "Updated the copyright year on a total of ${total} files." + if [ ${previous} -eq 0 ] ; then + echo "This count should match the count of modified files in the repository: hg status -m" + else + echo "WARNING: This repository contained previously edited working set files." + fi + echo " hg status -m | wc -l = `hg status -m | wc -l`" +else + echo "---------------------------------------------" + echo "No files were changed" + if [ ${previous} -ne 0 ] ; then + echo "WARNING: This repository contained previously edited working set files." + fi + echo " hg status -m | wc -l = `hg status -m | wc -l`" +fi + +# Cleanup +rm -f -r ${tmp} +exit 0 + diff --git a/make/scripts/vsvars.sh b/make/scripts/vsvars.sh new file mode 100644 index 00000000000..369a04a9ec3 --- /dev/null +++ b/make/scripts/vsvars.sh @@ -0,0 +1,546 @@ +#!/bin/sh + +# +# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# This file should be used to set the Visual Studio environment +# variables normally set by the vcvars32.bat or vcvars64.bat file or +# SetEnv.cmd for older SDKs. + +# Use cygpath? +isCygwin="`uname -s | grep CYGWIN`" +if [ "${isCygwin}" != "" ] ; then + cygpath="/usr/bin/cygpath" + cygpath_short="${cygpath} -m -s" + cygpath_windows="${cygpath} -w -s" + cygpath_path="${cygpath} -p" + pathsep=':' +else + cygpath="dosname" + cygpath_short="${cygpath} -s" + cygpath_windows="${cygpath} -s" + cygpath_path="echo" + pathsep=';' +fi + +######################################################################## +# Error functions +msg() # message +{ + echo "$1" 1>&2 +} +error() # message +{ + msg "ERROR: $1" + exit 1 +} +warning() # message +{ + msg "WARNING: $1" +} +envpath() # path +{ + if [ "${cygpath_short}" != "" -a -d "$1" ] ; then + ${cygpath_short} "$1" + else + echo "$1" + fi +} +######################################################################## + + +# Defaults settings +debug="false" +verbose="false" +shellStyle="sh" +parentCsh="` ps -p ${PPID} 2> /dev/null | grep csh `" +if [ "${parentCsh}" != "" ] ; then + shellStyle="csh" +fi + +set -e + +# Check environment first +if [ "${PROGRAMFILES}" != "" ] ; then + progfiles=`envpath "${PROGRAMFILES}"` +elif [ "${ProgramFiles}" != "" ] ; then + progfiles=`envpath "${ProgramFiles}"` +elif [ "${SYSTEMDRIVE}" != "" ] ; then + progfiles=`envpath "${SYSTEMDRIVE}/Program Files"` +elif [ "${SystemDrive}" != "" ] ; then + progfiles=`envpath "${SystemDrive}/Program Files"` +else + error "No PROGRAMFILES or SYSTEMDRIVE defined in environment" +fi + +# Arch data model +if [ "${PROCESSOR_IDENTIFIER}" != "" ] ; then + arch=`echo "${PROCESSOR_IDENTIFIER}" | cut -d' ' -f1` +elif [ "${MACHTYPE}" != "" ] ; then + if [ "`echo ${MACHTYPE} | grep 64`" != "" ] ; then + # Assume this is X64, not IA64 + arch="x64" + else + arch="x86" + fi +else + arch="`uname -m`" +fi +if [ "${arch}" = "X86" -o \ + "${arch}" = "386" -o "${arch}" = "i386" -o \ + "${arch}" = "486" -o "${arch}" = "i486" -o \ + "${arch}" = "586" -o "${arch}" = "i586" -o \ + "${arch}" = "686" -o "${arch}" = "i686" -o \ + "${arch}" = "86" ] ; then + arch="x86" +fi +if [ "${arch}" = "X64" -o \ + "${arch}" = "8664" -o "${arch}" = "i8664" -o \ + "${arch}" = "amd64" -o "${arch}" = "AMD64" -o \ + "${arch}" = "EM64T" -o "${arch}" = "emt64t" -o \ + "${arch}" = "intel64" -o "${arch}" = "Intel64" -o \ + "${arch}" = "64" ] ; then + arch="x64" + binarch64="/amd64" +fi +if [ "${arch}" = "IA64" ] ; then + arch="ia64" + binarch64="/ia64" +fi +if [ "${arch}" != "x86" -a "${arch}" != "x64" -a "${arch}" != "ia64" ] ; then + error "No PROCESSOR_IDENTIFIER or MACHTYPE environment variables and uname -m is not helping" +fi +if [ "${arch}" = "x86" ] ; then + arch_data_model=32 + progfiles32="${progfiles}" + progfiles64="${progfiles}" +else + arch_data_model=64 + progfiles32="${progfiles}" + if [ "${PROGRAMW6432}" != "" ] ; then + progfiles64=`envpath "${PROGRAMW6432}"` + else + progfiles64=`envpath "C:/Program Files"` + fi +fi + +# VS2010 (VC10) +if [ "${VS100COMNTOOLS}" = "" ] ; then + VS100COMNTOOLS="${progfiles32}/Microsoft Visual Studio 10.0/Common7/Tools/" + export VS100COMNTOOLS +fi +vc10Bin32Dir=`envpath "${VS100COMNTOOLS}"`/../../VC/Bin +vc10Bin64Dir="${vc10Bin32Dir}${binarch64}" +vc10vars32Bat="vcvars32.bat" +vc10vars64Bat="vcvars64.bat" + +# VS2008 (VC9) +if [ "${VS90COMNTOOLS}" = "" ] ; then + VS90COMNTOOLS="${progfiles32}/Microsoft Visual Studio 9.0/Common7/Tools/" + export VS90COMNTOOLS +fi +vc9Bin32Dir=`envpath "${VS90COMNTOOLS}"`/../../VC/Bin +vc9Bin64Dir="${vc9Bin32Dir}" +vc9vars32Bat="vcvars32.bat" +vc9vars64Bat="vcvars64.bat" + +# VS2005 (VC8) +if [ "${VS80COMNTOOLS}" = "" ] ; then + VS80COMNTOOLS="${progfiles32}/Microsoft Visual Studio 8.0/Common7/Tools/" + export VS80COMNTOOLS +fi +vc8Bin32Dir=`envpath "${VS80COMNTOOLS}"`/../../VC/Bin +vc8Bin64Dir="${progfiles64}/Microsoft Platform SDK" +vc8vars32Bat="vcvars32.bat" +vc8vars64Bat="SetEnv.cmd /X64" + +# VS2003 (VC7) +if [ "${VS71COMNTOOLS}" = "" ] ; then + VS71COMNTOOLS="${progfiles32}/Microsoft Visual Studio .NET 2003/Common7/Tools/" + export VS71COMNTOOLS +fi +vc7Bin32Dir=`envpath "${VS71COMNTOOLS}"`/../../VC7/Bin +vc7Bin64Dir="${progfiles64}/Microsoft Platform SDK" +vc7vars32Bat="vcvars32.bat" +vc7vars64Bat="SetEnv.cmd /X64" + +# Force user to select +vcSelection="" + +# Parse options +usage="Usage: $0 [-help] [-debug] [-v] [-c] [-s] [-p] [-v10] [-v9] [-v8] [-v7] [-32] [-64]" +while [ $# -gt 0 ] ; do + if [ "$1" = "-help" ] ; then + msg "${usage}" + msg " -help Print out this help message" + msg " -debug Print out extra env variables to help debug this script" + msg " -v Verbose output warns about missing directories" + msg " -c Print out csh style output" + msg " -s Print out sh style output" + msg " -p Print out properties style output" + msg " -v10 Use Visual Studio 10 VS2010" + msg " -v9 Use Visual Studio 9 VS2008" + msg " -v8 Use Visual Studio 8 VS2005" + msg " -v7 Use Visual Studio 7 VS2003" + msg " -32 Force 32bit" + msg " -64 Force 64bit" + exit 0 + elif [ "$1" = "-debug" ] ; then + debug="true" + shift + elif [ "$1" = "-v" ] ; then + verbose="true" + shift + elif [ "$1" = "-c" ] ; then + shellStyle="csh" + shift + elif [ "$1" = "-s" ] ; then + shellStyle="sh" + shift + elif [ "$1" = "-p" ] ; then + shellStyle="props" + shift + elif [ "$1" = "-v10" ] ; then + vcBin32Dir="${vc10Bin32Dir}" + vcBin64Dir="${vc10Bin64Dir}" + vcvars32Bat="${vc10vars32Bat}" + vcvars64Bat="${vc10vars64Bat}" + vcSelection="10" + shift + elif [ "$1" = "-v9" ] ; then + vcBin32Dir="${vc9Bin32Dir}" + vcBin64Dir="${vc9Bin64Dir}" + vcvars32Bat="${vc9vars32Bat}" + vcvars64Bat="${vc9vars64Bat}" + vcSelection="9" + shift + elif [ "$1" = "-v8" ] ; then + vcBin32Dir="${vc8Bin32Dir}" + vcBin64Dir="${vc8Bin64Dir}" + vcvars32Bat="${vc8vars32Bat}" + vcvars64Bat="${vc8vars64Bat}" + vcSelection="8" + shift + elif [ "$1" = "-v7" ] ; then + vcBin32Dir="${vc7Bin32Dir}" + vcBin64Dir="${vc7Bin64Dir}" + vcvars32Bat="${vc7vars32Bat}" + vcvars64Bat="${vc7vars64Bat}" + vcSelection="7" + shift + elif [ "$1" = "-32" ] ; then + arch_data_model=32 + shift + elif [ "$1" = "-64" ] ; then + arch_data_model=64 + shift + else + msg "${usage}" + error "Unknown option: $1" + fi +done + +# Need to pick +if [ "${vcSelection}" = "" ] ; then + msg "${usage}" + error "You must pick the version" +fi + +# Which vcvars bat file to run +if [ "${arch_data_model}" = "32" ] ; then + vcBinDir="${vcBin32Dir}" + vcvarsBat="${vcvars32Bat}" +fi +if [ "${arch_data_model}" = "64" ] ; then + vcBinDir="${vcBin64Dir}" + vcvarsBat="${vcvars64Bat}" +fi + +# Do not allow any error returns +set -e + +# Different systems have different awk's +if [ -f /usr/bin/nawk ] ; then + awk="nawk" +elif [ -f /usr/bin/gawk ] ; then + awk="gawk" +else + awk="awk" +fi + +if [ "${verbose}" = "true" ] ; then + echo "# Welcome to verbose mode" + set -x +fi + +if [ "${debug}" = "true" ] ; then + echo "# Welcome to debug mode" + set -x +fi + +# Temp file area +tmp="/tmp/vsvars.$$" +rm -f -r ${tmp} +mkdir -p ${tmp} + +# Check paths +checkPaths() # var path sep +{ + set -e + sep="$3" + checklist="${tmp}/checklist" + printf "%s\n" "$2" | \ + sed -e 's@\\@/@g' | \ + sed -e 's@//@/@g' | \ + ${awk} -F"${sep}" '{for(i=1;i<=NF;i++){printf "%s\n",$i;}}' \ + > ${checklist} + cat ${checklist} | while read orig; do + if [ "${orig}" != "" ] ; then + if [ ! -d "${orig}" ] ; then + warning "Directory in $1 does not exist: ${orig}" + fi + fi + done +} + +# Remove all duplicate entries +removeDeadDups() # string sep +{ + set -e + sep="$2" + pathlist="${tmp}/pathlist" + printf "%s\n" "$1" | \ + sed -e 's@\\@/@g' | \ + sed -e 's@//@/@g' | \ + ${awk} -F"${sep}" '{for(i=1;i<=NF;i++){printf "%s\n",$i;}}' \ + > ${pathlist} + upaths="${tmp}/upaths" + cat ${pathlist} | while read orig; do + p="${orig}" + if [ "${cygpath_short}" != "" ] ; then + if [ "${p}" != "" ] ; then + if [ -d "${p}" ] ; then + short=`${cygpath_short} "${p}"` + if [ "${short}" != "" -a -d "${short}" ] ; then + p=`${cygpath} "${short}"` + fi + echo "${p}" >> ${upaths} + fi + fi + fi + done + newpaths="" + for i in `cat ${upaths}` ; do + # For some reason, \r characters can get into this + i=`echo "${i}" | tr -d '\r' | sed -e 's@/$@@'` + if [ "${newpaths}" = "" ] ; then + newpaths="${i}" + else + newpaths="${newpaths}${sep}${i}" + fi + done + printf "%s\n" "${newpaths}" | \ + ${awk} -F"${sep}" \ + '{a[$1];printf "%s",$1;for(i=2;i<=NF;i++){if(!($i in a)){a[$i];printf "%s%s",FS,$i;}};printf "\n";}' +} + +# Create bat file to process Visual Studio vcvars*.bat files +createBat() # batfile bindir command +{ + bat="$1" + bindir="$2" + command="$3" + stdout="${bat}.stdout" + rm -f ${bat} ${stdout} + echo "Output from: ${command}" > ${stdout} + bdir=`envpath "${bindir}"` + cat > ${bat} << EOF +REM Pick the right vcvars bat file +REM Empty these out so we only get the additions we want +set INCLUDE= +set LIB= +set LIBPATH= +set MSVCDIR= +set MSSdk= +set Mstools= +set DevEnvDir= +set VCINSTALLDIR= +set VSINSTALLDIR= +set WindowsSdkDir= +REM Run the vcvars bat file, send all output to stderr +call `${cygpath_windows} ${bdir}`\\${command} > `${cygpath_windows} "${stdout}"` +REM Echo out env var settings +echo VS_VS71COMNTOOLS="%VS71COMNTOOLS%" +echo export VS_VS71COMNTOOLS +echo VS_VS80COMNTOOLS="%VS80COMNTOOLS%" +echo export VS_VS80COMNTOOLS +echo VS_VS90COMNTOOLS="%VS90COMNTOOLS%" +echo export VS_VS90COMNTOOLS +echo VS_VS100COMNTOOLS="%VS100COMNTOOLS%" +echo export VS_VS100COMNTOOLS +echo VS_VCINSTALLDIR="%VCINSTALLDIR%" +echo export VS_VCINSTALLDIR +echo VS_VSINSTALLDIR="%VSINSTALLDIR%" +echo export VS_VSINSTALLDIR +echo VS_DEVENVDIR="%DevEnvDir%" +echo export VS_DEVENVDIR +echo VS_MSVCDIR="%MSVCDIR%" +echo export VS_MSVCDIR +echo VS_MSSDK="%MSSdk%" +echo export VS_MSSDK +echo VS_MSTOOLS="%Mstools%" +echo export VS_MSTOOLS +echo VS_WINDOWSSDKDIR="%WindowsSdkDir%" +echo export VS_WINDOWSSDKDIR +echo VS_INCLUDE="%INCLUDE%" +echo export VS_INCLUDE +echo VS_LIB="%LIB%" +echo export VS_LIB +echo VS_LIBPATH="%LIBPATH%" +echo export VS_LIBPATH +echo VS_WPATH="%PATH%" +echo export VS_WPATH +EOF + chmod a+x ${bat} +} + +# Create env file +createEnv() # batfile envfile +{ + rm -f ${1}.stdout + cmd.exe /Q /C `${cygpath_short} $1` | \ + sed -e 's@\\@/@g' | \ + sed -e 's@//@/@g' > $2 + if [ -f "${1}.stdout" ] ; then + cat ${1}.stdout 1>&2 + fi + chmod a+x $2 +} + +printEnv() # name pname vsname val +{ + name="$1" + pname="$2" + vsname="$3" + val="$4" + if [ "${val}" != "" ] ; then + if [ "${shellStyle}" = "csh" ] ; then + if [ "${debug}" = "true" ] ; then + echo "setenv ${vsname} \"${val}\";" + fi + echo "setenv ${name} \"${val}\";" + elif [ "${shellStyle}" = "sh" ] ; then + if [ "${debug}" = "true" ] ; then + echo "${vsname}=\"${val}\";" + echo "export ${vsname};" + fi + echo "${name}=\"${val}\";" + echo "export ${name};" + elif [ "${shellStyle}" = "props" ] ; then + echo "vs.${pname}=${val}" + fi + fi +} + +############################################################################# + +# Get Visual Studio settings +if [ "${cygpath}" != "" ] ; then + + # Create bat file to run + batfile="${tmp}/vs-to-env.bat" + if [ ! -d "${vcBinDir}" ] ; then + error "Does not exist: ${vcBinDir}" + elif [ "${vcvarsBat}" = "" ] ; then + error "No vcvars script: ${vcvarsBat}" + else + createBat "${batfile}" "${vcBinDir}" "${vcvarsBat}" + fi + + # Run bat file to create environment variable settings + envfile="${tmp}/env.sh" + createEnv "${batfile}" "${envfile}" + + # Read in the VS_* settings + . ${envfile} + + # Derive unix style path, save old, and define new (remove dups) + VS_UPATH=`${cygpath_path} "${VS_WPATH}"` + export VS_UPATH + VS_OPATH=`printf "%s" "${PATH}" | sed -e 's@\\\\@/@g'` + export VS_OPATH + VS_PATH=`removeDeadDups "${VS_UPATH}${pathsep}${VS_OPATH}" "${pathsep}"` + export VS_PATH + +fi + +# Adjustments due to differences in vcvars*bat files +if [ "${VS_MSVCDIR}" = "" ] ; then + VS_MSVCDIR="${VS_VCINSTALLDIR}" +fi +if [ "${VS_DEVENVDIR}" = "" ] ; then + VS_DEVENVDIR="${VS_VSINSTALLDIR}" +fi + +# Print env settings +# env vs.prop vs env value +# ------- ------- ---------- ----- +printEnv INCLUDE include VS_INCLUDE "${VS_INCLUDE}" +printEnv LIB lib VS_LIB "${VS_LIB}" +printEnv LIBPATH libpath VS_LIBPATH "${VS_LIBPATH}" +if [ "${debug}" = "true" ] ; then + printEnv UPATH upath VS_UPATH "${VS_UPATH}" + printEnv WPATH wpath VS_WPATH "${VS_WPATH}" + printEnv OPATH opath VS_OPATH "${VS_OPATH}" +fi +printEnv PATH path VS_PATH "${VS_PATH}" +printEnv VCINSTALLDIR vcinstalldir VS_VCINSTALLDIR "${VS_VCINSTALLDIR}" +printEnv VSINSTALLDIR vsinstalldir VS_VSINSTALLDIR "${VS_VSINSTALLDIR}" +printEnv MSVCDIR msvcdir VS_MSVCDIR "${VS_MSVCDIR}" +printEnv MSSDK mssdk VS_MSSDK "${VS_MSSDK}" +printEnv MSTOOLS mstools VS_MSTOOLS "${VS_MSTOOLS}" +printEnv DEVENVDIR devenvdir VS_DEVENVDIR "${VS_DEVENVDIR}" +printEnv WINDOWSSDKDIR windowssdkdir VS_WINDOWSSDKDIR "${VS_WINDOWSSDKDIR}" +if [ "${vcSelection}" = "10" ] ; then + printEnv VS100COMNTOOLS vs100comntools VS_VS100COMNTOOLS "${VS_VS100COMNTOOLS}" +elif [ "${vcSelection}" = "9" ] ; then + printEnv VS90COMNTOOLS vs90comntools VS_VS90COMNTOOLS "${VS_VS90COMNTOOLS}" +elif [ "${vcSelection}" = "7" ] ; then + printEnv VS71COMNTOOLS vs71comntools VS_VS71COMNTOOLS "${VS_VS71COMNTOOLS}" +elif [ "${vcSelection}" = "8" ] ; then + printEnv VS80COMNTOOLS vs80comntools VS_VS80COMNTOOLS "${VS_VS80COMNTOOLS}" +fi + +# Check final settings +if [ "${verbose}" = "true" ] ; then + checkPaths "Windows PATH" "${VS_WPATH}" ";" + checkPaths LIB "${VS_LIB}" ";" + checkPaths INCLUDE "${VS_INCLUDE}" ";" + checkPaths PATH "${VS_PATH}" "${pathsep}" +fi + +# Remove all temp files +rm -f -r ${tmp} + +exit 0 + diff --git a/make/templates/bsd-header b/make/templates/bsd-header index 1291114fc49..cce4fa786bf 100644 --- a/make/templates/bsd-header +++ b/make/templates/bsd-header @@ -1,4 +1,4 @@ -Copyright %YEARS% Sun Microsystems, Inc. All Rights Reserved. +Copyright (c) %YEARS% Oracle and/or its affiliates. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -26,3 +26,4 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/make/templates/gpl-cp-header b/make/templates/gpl-cp-header index ed422f45fdc..8c03edf89e0 100644 --- a/make/templates/gpl-cp-header +++ b/make/templates/gpl-cp-header @@ -1,4 +1,4 @@ -Copyright %YEARS% Sun Microsystems, Inc. All Rights Reserved. +Copyright (c) %YEARS% Oracle and/or its affiliates. All rights reserved. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it @@ -20,3 +20,4 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions. + diff --git a/make/templates/gpl-header b/make/templates/gpl-header index e717b45b516..dffde479c68 100644 --- a/make/templates/gpl-header +++ b/make/templates/gpl-header @@ -1,4 +1,4 @@ -Copyright %YEARS% Sun Microsystems, Inc. All Rights Reserved. +Copyright (c) %YEARS% Oracle and/or its affiliates. All rights reserved. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it @@ -18,3 +18,4 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions. +
        " + NL + - "Class SummaryClass Summary" + + " " + NL + - "Interface SummaryInterface Summary" + + " " + NL + - "Enum SummaryEnum Summary" + + " " + NL + - "Annotation Types SummaryAnnotation Types Summary" + + " " + NL + - "Field SummaryFields " + NL + - "Method SummaryMethods " + NL + - "Nested Class SummaryNested Classes " + NL + - "Constructor SummaryConstructors " + NL + - "Enum Constant SummaryEnum Constants " + NL + - "Required Element SummaryRequired Elements " + + "" + NL + - "Optional Element SummaryOptional Elements " + + "" + NL + - "Packages that use I1Packages that use I1" + + " " + NL + - "Fields in pkg2 " + - "declared as " + - "C1Fields in " + + "pkg2 declared as C1 " + + "" + NL + - "Methods in pkg2 " + - "with parameters of type C1Methods in " + + "pkg2 that return C1" + + " " + NL + - "Fields in pkg1 " + - "declared as " + - "C2Fields in " + + "pkg1 declared as C2" + + " " + NL + - "Methods in pkg1 " + - "with parameters of type C2Methods in " + + "pkg1 that return C2" + + " " + NL + - "Methods in pkg2 " + - "that return C2.ModalExclusionTypeMethods in " + + "pkg2 that return C2.ModalExclusionType" + + " " + NL + - "Packages that use " + - "pkg1Packages that use " + + "pkg1 " + NL + - "Classes in pkg1 " + - "used by pkg1Classes in " + + "pkg1 used by pkg1" + + " " + NL + - "Packages that use " + - "pkg2Packages that use " + + "pkg2 " + NL + - "Classes in pkg2 " + - "used by pkg1Classes in " + + "pkg2 used by pkg1" + + " " + NL + - "Deprecated FieldsDeprecated Fields" + + " " + NL + - "Deprecated MethodsDeprecated Methods" + + " " + NL + - "pkg1.C1pkg1." + + "C1 " + NL + - "PackagesPackages 
        " + - "ClassDescription" + + "ClassDescription" + - "InterfaceDescription" + + "InterfaceDescription" + - "EnumDescription" + + "EnumDescription" + - "Annotation TypeDescription" + + "Annotation TypeDescription" + - "Modifier and TypeField and DescriptionModifier and TypeField and Description" + - "Modifier and TypeMethod and DescriptionModifier and TypeMethod and Description" + - "Modifier and TypeClass and DescriptionModifier and TypeClass and Description" + - "Constructor and DescriptionConstructor and Description" + - "Enum Constant and DescriptionEnum Constant and Description" + - "Modifier and TypeRequired Element and DescriptionModifier and TypeRequired Element and Description" + - "Modifier and TypeOptional Element and DescriptionModifier and TypeOptional Element and Description" + - "PackageDescriptionPackageDescription" + - "Modifier and TypeField and DescriptionModifier and TypeField and Description" + - "Modifier and TypeMethod and DescriptionModifier and TypeMethod and Description" + - "Modifier and TypeField and DescriptionModifier and TypeField and Description" + - "Modifier and TypeMethod and DescriptionModifier and TypeMethod and Description" + - "PackageDescriptionPackageDescription" + - "Modifier and TypeMethod and DescriptionModifier and TypeMethod and Description" + - "PackageDescriptionPackageDescription" + - "Class and DescriptionClass and Description" + - "PackageDescriptionPackageDescription" + - "Class and DescriptionClass and Description" + - "Field and DescriptionField and Description" + - "Method and DescriptionMethod and Description" + - "Modifier and TypeConstant FieldValue" + + "Modifier and TypeValue" + - "PackageDescription" + + "PackageDescription aMethodreturnTypeTest()" + "PublicChild" + + "returnTypeTest()" }, // Check return type in member detail. {BUG_ID + FS + "pkg" + FS + "PublicChild.html", - "public PublicChild " + - "returnTypeTest()" + "
        public " +
        +            "PublicChild returnTypeTest()
        " }, // Legacy anchor dimensions (6290760) {BUG_ID + FS + "pkg2" + FS + "A.html", - "" + "" + NL + + "" + NL + + "" + NL + + "" + NL + + "" }, }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testNavagation/TestNavagation.java b/langtools/test/com/sun/javadoc/testNavagation/TestNavagation.java index 182662ee0f4..5548f32b614 100644 --- a/langtools/test/com/sun/javadoc/testNavagation/TestNavagation.java +++ b/langtools/test/com/sun/javadoc/testNavagation/TestNavagation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,24 +45,24 @@ public class TestNavagation extends JavadocTester { //Input for string search tests. private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "A.html", " PREV CLASS "}, + {BUG_ID + FS + "pkg" + FS + "A.html", "
      • PREV CLASS
      • "}, {BUG_ID + FS + "pkg" + FS + "A.html", - "NEXT CLASS"}, + "NEXT CLASS"}, {BUG_ID + FS + "pkg" + FS + "C.html", - "PREV CLASS"}, + "PREV CLASS"}, {BUG_ID + FS + "pkg" + FS + "C.html", - "NEXT CLASS"}, + "NEXT CLASS"}, {BUG_ID + FS + "pkg" + FS + "E.html", - "PREV CLASS"}, + "PREV CLASS"}, {BUG_ID + FS + "pkg" + FS + "E.html", - "NEXT CLASS"}, + "NEXT CLASS"}, {BUG_ID + FS + "pkg" + FS + "I.html", - "PREV CLASS"}, - {BUG_ID + FS + "pkg" + FS + "I.html", " NEXT CLASS"}, + "PREV CLASS"}, + {BUG_ID + FS + "pkg" + FS + "I.html", "
      • NEXT CLASS
      • "}, // Test for 4664607 {BUG_ID + FS + "pkg" + FS + "I.html", - "
        " + NL + - ""} + "" + NL + + "" + NL + ""} }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java index 38fd1506259..1c416475c8b 100644 --- a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java +++ b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * 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,18 +51,18 @@ public class TestNewLanguageFeatures extends JavadocTester { // ENUM TESTING //================================= //Make sure enum header is correct. - {BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin"}, + {BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin"}, //Make sure enum signature is correct. - {BUG_ID + FS + "pkg" + FS + "Coin.html", "public enum "+ - "Coin" + NL + "extends java.lang.Enum<" + - "Coin>" + {BUG_ID + FS + "pkg" + FS + "Coin.html", "
        public enum Coin" + NL +
        +                "extends java.lang.Enum<Coin>
        " }, //Check for enum constant section - {BUG_ID + FS + "pkg" + FS + "Coin.html", "
        " + NL + - "Enum Constant SummaryEnum Constants" + + "  " + NL + - "Required Element Summary" + NL + - "Optional Element Summary" + NL + - "Classes in pkg2" + - " with type parameters of type FooClasses in pkg2 with type parameters of " + + "type " + + "Foo 
        ClassUseTest1<T extends Foo & Foo2>" + "ClassUseTest1" + + "<T extends Foo & Foo2> 
        " + NL + - "Methods in pkg2" + - " with type parameters of type FooMethods in pkg2 with type parameters of " + + "type Foo 
        ClassUseTest1.method(T t)" + "ClassUseTest1." + + "method" + + "(T t) 
        " + NL + - "Fields in pkg2" + - " with type parameters of type FooFields in pkg2 with type parameters of " + + "type " + + "Foo " + NL + - "Fields in pkg2" + - " declared as ParamTestFields in pkg2 declared as ParamTest" + + " 
        ParamTest<Foo>
        " + NL + - "Classes in pkg2" + - " with type parameters of type Foo2Classes in pkg2 with type parameters of " + + "type Foo2 " + + "
        ClassUseTest1<T extends Foo & Foo2>" + "" + + "ClassUseTest1<T extends Foo & Foo2>" + + " 
        " + NL + - "Methods in pkg2" + - " with type parameters of type Foo2Methods in pkg2 with type parameters of " + + "type Foo2 " + + "
        ClassUseTest1.method(T t)" + "" + + "ClassUseTest1.method" + + "(T t) 
        " + NL + - "Classes in pkg2" + - " with type parameters of type ParamTestClasses in pkg2 with type parameters of " + + "type ParamTest" + + " 
        ClassUseTest2<T extends ParamTest<Foo3>>" + "ClassUseTest2<T " + + "extends ParamTest<Foo3>> 
        " + NL + - "Methods in pkg2" + - " with type parameters of type ParamTestMethods in pkg2 with type parameters of " + + "type ParamTest" + + " 
        ClassUseTest2.method(T t)" + "ClassUseTest2." + + "method" + + "(T t) 
        " + NL + - "Fields in pkg2" + - " declared as ParamTestFields in pkg2 declared as ParamTest" + + " 
        ParamTest" + + "<" + + "Foo>
        " + NL + - "Methods in pkg2" + - " with type parameters of type ParamTestMethods in pkg2 with type parameters of " + + "type ParamTest" + + " 
        <T extends ParamTest" + + "<Foo3>> 
        ParamTest" + + "<Foo3>
        " + NL + - "Classes in pkg2" + - " with type parameters of type Foo3Classes in pkg2 with type parameters of " + + "type " + + "Foo3 
        ClassUseTest2<T extends ParamTest<Foo3>>" + "" + + "ClassUseTest2<T extends ParamTest<Foo3>>" + + " 
        " + NL + - "Methods in pkg2" + - " with type parameters of type Foo3Methods in pkg2 with type parameters of " + + "type Foo3 " + + "
        ClassUseTest2.method(T t)" + "ClassUseTest2." + + "method" + + "(T t) 
        " + NL + - "Methods in pkg2" + - " that return types with arguments of type " + - "" + - "Foo3Methods in pkg2 that return types with " + + "arguments of type Foo3" + + " 
        <T extends ParamTest<" + + "Foo3" + + ">> 
        ParamTest<Foo3>
        " + NL + - "Classes in pkg2" + - " with type parameters of type " + - "" + - "ParamTest2Classes in pkg2 with type parameters of " + + "type ParamTest2" + + " 
        ClassUseTest3<T extends ParamTest2<java.util.List<? extends Foo4>>>" + "" + + "ClassUseTest3<T extends ParamTest2<java.util.List" + + "<? extends Foo4>>> 
        " + NL + - "Methods in pkg2" + - " with type parameters of type " + - "" + - "ParamTest2Methods in pkg2 with type parameters of " + + "type ParamTest2" + + " 
        ClassUseTest3.method(T t)" + "ClassUseTest3" + + ".method(T t) 
        " + NL + - "Methods in pkg2" + - " with type parameters of type " + - "" + - "ParamTest2
        <T extends " + + "ParamTest2<java.util.List<? extends Foo4>" + + ">> 
        ParamTest2<java.util.List" + + "<? extends Foo4>>
        " + NL + - "Classes in pkg2" + - " with type parameters of type " + - "" + - "Foo4Classes in pkg2 with type parameters of " + + "type Foo4 " + + "
        ClassUseTest3<T extends ParamTest2<java.util.List<? extends Foo4>>>" + "" + + "ClassUseTest3<T extends ParamTest2<java.util.List" + + "<? extends Foo4>>> 
        " + NL + - "Methods in pkg2" + - " with type parameters of type Foo4Methods in pkg2 with type parameters of " + + "type Foo4 
        ClassUseTest3.method(T t)" + "ClassUseTest3." + + "method(T t)" + + " 
        " + NL + - "Methods in pkg2" + - " that return types with arguments of type " + - "" + - "Foo4Methods in pkg2 that return types with " + + "arguments of type Foo4 
        <T extends " + + "ParamTest2<java.util.List<? extends Foo4>" + + ">> 
        ParamTest2<java.util.List" + + "<? extends Foo4>>
        " + NL + - "Method parameters in pkg2" + - " with type arguments of type Foo4
        Modifier and Type" + - "Method and Description
        " + NL + - " voidClassUseTest3." + - "" + - "method(java.util.Set<Foo4> p)" + "
        Method parameters in pkg2 with type arguments of " + + "type Foo4 " + + "
        Modifier and TypeMethod and Description
        voidClassUseTest3." + + "method(java." + + "util.Set<Foo4> p) 
        " + NL + - "Constructor parameters in " + - "pkg2 with type arguments of type Foo4
        Constructor and Description" + - "
        ClassUseTest3(java.util.Set<" + - "" + - "Foo4> p)" + "
        Constructor parameters in pkg2 with type arguments " + + "of type Foo4 " + + "
        Package" + - "Description
        pkg" + - "
        Packages with annotations of type " + + "AnnotationType " + + "
        Modifier and Type" + - "Class and Description
        " + NL + - " classAnnotationTypeUsage" + "
        Classes in pkg with annotations of type " + + "AnnotationType 
        Modifier and Type" + - "Field and Description
        " + NL + - " intAnnotationTypeUsage." + - "field" + - "" + "
        Fields in pkg with annotations of type " + + "AnnotationType" + + " 
        Modifier and Type" + - "Method and Description
        " + NL + - " voidAnnotationTypeUsage." + - "" + - "method()" + "
        Methods in pkg with annotations of type " + + "AnnotationType" + + " 
        Modifier and Type" + - "Method and Description
        " + NL + - " voidAnnotationTypeUsage." + - "methodWithParams(int documented," + NL + - " int undocmented)" + "
        Method parameters in pkg with annotations of type " + + "AnnotationType" + + " 
        Constructor and Description" + - "
        " + - "AnnotationTypeUsage()" + "
        Constructors in pkg with annotations of type " + + "AnnotationType" + + " 
        Constructor and Description" + - "
        " + - "AnnotationTypeUsage(int documented," + NL + - " int undocmented)" + "
        Constructor parameters in pkg with annotations of " + + "type AnnotationType " + NL + - "Method Summary
        <W extends java.lang.String,V extends " + + "java.util.List> 
        java.lang.Object